Esempio n. 1
0
def make_encoder(opt, embeddings, ent_embedding=None):
    # "rnn" or "brnn"
    # rnn_type = LSTM; opt.brnn = True; opt.enc_layers = 1;opt.rnn_size = 250;
    # opt.dropout = 0.5; opt.lock_dropout = False; opt.weight_dropout = 0;
    # embeddings = embeddings for Src and tbl, ent_embedding for ent
    return RNNEncoder(opt.rnn_type, opt.brnn, opt.enc_layers, opt.rnn_size,
                      opt.dropout, opt.lock_dropout, opt.weight_dropout,
                      embeddings, ent_embedding)
Esempio n. 2
0
def make_layout_encoder(args, embeddings):
    return RNNEncoder(args.rnn_type,
                      args.brnn,
                      args.enc_layers,
                      args.decoder_input_size,
                      args.dropout,
                      args.dropout_i,
                      args.lock_dropout,
                      args.dropword_enc,
                      args.weight_dropout,
                      embeddings,
                      ent_embedding=None)
Esempio n. 3
0
def make_encoder(opt, embeddings, ent_embedding=None):
    # "rnn" or "brnn"
    return RNNEncoder(opt.rnn_type, opt.brnn, opt.enc_layers, opt.rnn_size,
                      opt.dropout, opt.lock_dropout, opt.weight_dropout,
                      embeddings, ent_embedding)
Esempio n. 4
0
def make_layout_encoder(opt, embeddings):
    return RNNEncoder(opt.rnn_type, opt.brnn, opt.enc_layers,
                      opt.decoder_input_size, opt.dropout, opt.dropout_i,
                      opt.lock_dropout, opt.dropword_enc, opt.weight_dropout,
                      embeddings, None)