From ba7d5467be8a6517ea3dbecf78b6a5e00418e5c9 Mon Sep 17 00:00:00 2001 From: yunjey Date: Tue, 21 Mar 2017 01:06:34 +0900 Subject: [PATCH] config and download script are added --- .../09 - Image Captioning/configuration.py | 26 +++++++++++++++++++ tutorials/09 - Image Captioning/download.sh | 9 +++++++ 2 files changed, 35 insertions(+) create mode 100644 tutorials/09 - Image Captioning/configuration.py create mode 100755 tutorials/09 - Image Captioning/download.sh diff --git a/tutorials/09 - Image Captioning/configuration.py b/tutorials/09 - Image Captioning/configuration.py new file mode 100644 index 0000000..7d1621b --- /dev/null +++ b/tutorials/09 - Image Captioning/configuration.py @@ -0,0 +1,26 @@ +class Config(object): + """Wrapper class for hyper-parameters.""" + def __init__(self): + """Set the default hyper-parameters.""" + # Preprocessing + self.image_size = 256 + self.crop_size = 224 + self.word_count_threshold = 4 + self.num_threads = 2 + + # Training + self.num_epochs = 5 + self.batch_size = 64 + self.learning_rate = 0.001 + self.log_step = 10 + self.save_step = 1000 + + # Model + self.embed_size = 256 + self.hidden_size = 512 + self.num_layers = 2 + + # Path + self.image_path = './data/' + self.caption_path = './data/annotations/' + self.vocab_path = './data/' \ No newline at end of file diff --git a/tutorials/09 - Image Captioning/download.sh b/tutorials/09 - Image Captioning/download.sh new file mode 100755 index 0000000..ad2d0da --- /dev/null +++ b/tutorials/09 - Image Captioning/download.sh @@ -0,0 +1,9 @@ +wget http://msvocds.blob.core.windows.net/annotations-1-0-3/captions_train-val2014.zip -P data/ +wget http://msvocds.blob.core.windows.net/coco2014/train2014.zip -P data/ +wget http://msvocds.blob.core.windows.net/coco2014/val2014.zip -P data/ + +unzip data/captions_train-val2014.zip -d data/ +unzip data/train2014.zip -d data/ +rm data/train2014.zip +unzip data/val2014.zip -d data/ +rm data/val2014.zip