mirror of
https://github.com/yunjey/pytorch-tutorial.git
synced 2025-07-27 12:03:31 +08:00
config and download script are added
This commit is contained in:
26
tutorials/09 - Image Captioning/configuration.py
Normal file
26
tutorials/09 - Image Captioning/configuration.py
Normal file
@ -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/'
|
9
tutorials/09 - Image Captioning/download.sh
Executable file
9
tutorials/09 - Image Captioning/download.sh
Executable file
@ -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
|
Reference in New Issue
Block a user