-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmodel_config.py
More file actions
33 lines (33 loc) · 1.11 KB
/
model_config.py
File metadata and controls
33 lines (33 loc) · 1.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
class ModelConfig():
def __init__(
self,
input_size,
hidden_size,
output_size,
max_length=50,
rnn_type='lstm',
bidirectional=False,
bidirectional_type = 'sum',
attention='global',
score='dot',
dropout_p=0.1,
num_layers_encoder=1,
num_layers_decoder=1,
learning_rate=0.01,
teacher_forcing_ratio=0.5,
beam_width=1):
self.input_size = input_size
self.hidden_size = hidden_size
self.output_size = output_size
self.max_length = max_length
self.rnn_type = rnn_type
self.bidirectional = bidirectional
self.bidirectional_type = bidirectional_type
self.attention = attention
self.score = score
self.dropout_p = dropout_p
self.num_layers_encoder = num_layers_encoder
self.num_layers_decoder = num_layers_decoder
self.learning_rate = learning_rate
self.teacher_forcing_ratio = teacher_forcing_ratio
self.beam_width = beam_width