INNER CODE UNIT · Python
dim_pos_input
taishi-i/nagisa · nagisa/model.py:49
dim_pos_input = dim_word+dim_uni+dim_tag_emb
self.pos_model = dy.BiRNNBuilder(layers, dim_pos_input, dim_hidden, model, dy.LSTMBuilder)
# Create a bi-directional LSTM model for encoding character sequence.
self.char_seq_model = dy.BiRNNBuilder(layers, dim_uni, dim_uni, model, dy.LSTMBuilder)
# Create trainer
self.trainer = dy.SimpleSGDTrainer(model, lr)
self.trainer.set_clip_threshold(5)
# Set a tag scheme for WS model.
dim_output = 4+2
self.sp_s = 4
self.sp_e = 5
# Create weight matrices and bias vectors.
self.dim_output = dim_output
self.w_ws = model.add_parameters((dim_output, dim_hidden))
self.b_ws = model.add_parameters(dim_output)