Skip to content

Commit e5ada24

Browse files
committed
Smaller initial model
1 parent b672fa3 commit e5ada24

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

config.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -134,26 +134,26 @@ def load_parameters():
134134
RNN_TYPE = 'LSTM' # RNN unit type ('LSTM' and 'GRU' supported)
135135
INIT_FUNCTION = 'glorot_uniform' # Initialization function for matrices (see keras/initializations.py)
136136

137-
SOURCE_TEXT_EMBEDDING_SIZE = 128 # Source language word embedding size.
137+
SOURCE_TEXT_EMBEDDING_SIZE = 64 # Source language word embedding size.
138138
SRC_PRETRAINED_VECTORS = None # Path to pretrained vectors (e.g.: DATA_ROOT_PATH + '/DATA/word2vec.%s.npy' % SRC_LAN)
139139
# Set to None if you don't want to use pretrained vectors.
140140
# When using pretrained word embeddings. this parameter must match with the word embeddings size
141141
SRC_PRETRAINED_VECTORS_TRAINABLE = True # Finetune or not the target word embedding vectors.
142142

143-
TARGET_TEXT_EMBEDDING_SIZE = 128 # Source language word embedding size.
143+
TARGET_TEXT_EMBEDDING_SIZE = 64 # Source language word embedding size.
144144
TRG_PRETRAINED_VECTORS = None # Path to pretrained vectors. (e.g. DATA_ROOT_PATH + '/DATA/word2vec.%s.npy' % TRG_LAN)
145145
# Set to None if you don't want to use pretrained vectors.
146146
# When using pretrained word embeddings, the size of the pretrained word embeddings must match with the word embeddings size.
147147
TRG_PRETRAINED_VECTORS_TRAINABLE = True # Finetune or not the target word embedding vectors.
148148

149149
# Encoder configuration
150-
ENCODER_HIDDEN_SIZE = 128 # For models with RNN encoder
150+
ENCODER_HIDDEN_SIZE = 64 # For models with RNN encoder
151151
BIDIRECTIONAL_ENCODER = True # Use bidirectional encoder
152152
N_LAYERS_ENCODER = 1 # Stack this number of encoding layers
153153
BIDIRECTIONAL_DEEP_ENCODER = True # Use bidirectional encoder in all encoding layers
154154

155155
# Decoder configuration
156-
DECODER_HIDDEN_SIZE = 128 # For models with RNN decoder
156+
DECODER_HIDDEN_SIZE = 64 # For models with RNN decoder
157157
N_LAYERS_DECODER = 1 # Stack this number of decoding layers.
158158
ADDITIONAL_OUTPUT_MERGE_MODE = 'sum' # Merge mode for the skip-connections
159159
ATTENTION_SIZE = DECODER_HIDDEN_SIZE

sample_ensemble.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def parse_args():
8787
params_prediction['length_norm_factor'] = params.get('LENGTH_NORM_FACTOR', 0.0)
8888
params_prediction['coverage_norm_factor'] = params.get('COVERAGE_NORM_FACTOR', 0.0)
8989
params_prediction['pos_unk'] = params.get('POS_UNK', False)
90-
params_prediction['heuristic'] = params.get('HEURISTIC', 0)
90+
heuristic = params.get('HEURISTIC', 0)
9191
mapping = None if dataset.mapping == dict() else dataset.mapping
9292

9393
for s in args.splits:
@@ -105,7 +105,6 @@ def parse_args():
105105
alphas = predictions[1]
106106
sources = [x.strip() for x in open(args.text, 'r').read().split('\n')]
107107
sources = sources[:-1] if len(sources[-1]) == 0 else sources
108-
heuristic = params_prediction['heuristic']
109108
else:
110109
samples = predictions
111110
alphas = None

0 commit comments

Comments
 (0)