Skip to content

Commit

Permalink
use a parameter for glove
Browse files Browse the repository at this point in the history
  • Loading branch information
ronghanghu committed Sep 17, 2018
1 parent ff43811 commit 4773a71
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tasks/R2R/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
BATCH_SIZE = 100
max_episode_len = 10
word_embedding_size = 300
glove_path = 'tasks/R2R/data/train_glove.npy'
action_embedding_size = 2048+128
hidden_size = 512
dropout_ratio = 0.5
Expand Down Expand Up @@ -182,7 +183,7 @@ def make_env_and_models(args, train_vocab_path, train_splits, test_splits,
splits=train_splits, tokenizer=tok)

enc_hidden_size = hidden_size//2 if args.bidirectional else hidden_size
glove = np.load('tasks/R2R/data/train_glove.npy')
glove = np.load(glove_path)
feature_size = FEATURE_SIZE
encoder = try_cuda(EncoderLSTM(
len(vocab), word_embedding_size, enc_hidden_size, vocab_pad_idx,
Expand Down
3 changes: 2 additions & 1 deletion tasks/R2R/train_speaker.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
batch_size = 100
max_episode_len = 10
word_embedding_size = 300
glove_path = 'tasks/R2R/data/train_glove.npy'
action_embedding_size = 2048+128
hidden_size = 512
bidirectional = False
Expand Down Expand Up @@ -182,7 +183,7 @@ def make_env_and_models(args, train_vocab_path, train_splits, test_splits,
splits=train_splits, tokenizer=tok)

enc_hidden_size = hidden_size//2 if bidirectional else hidden_size
glove = np.load('tasks/R2R/data/train_glove.npy')
glove = np.load(glove_path)
feature_size = FEATURE_SIZE
encoder = try_cuda(SpeakerEncoderLSTM(
action_embedding_size, feature_size, enc_hidden_size, dropout_ratio,
Expand Down

0 comments on commit 4773a71

Please sign in to comment.