Esempio n. 1
0
    def get_arg_parser():
        parser = ConvGlobEncoder.get_arg_parser()

        # data related
        parser.add_argument('--inst_dict_path',
                            type=str,
                            required=True,
                            help='path to dictionary')
        parser.add_argument('--max_sentence_length', type=int, default=15)
        parser.add_argument('--num_pos_inst', type=int, default=50)
        parser.add_argument('--num_neg_inst', type=int, default=50)

        # prev_inst encoder
        parser.add_argument('--word_emb_dim', type=int, default=32)
        parser.add_argument('--word_emb_dropout', type=float, default=0.0)
        parser.add_argument('--inst_hid_dim', type=int, default=128)

        # count feat encoder
        parser.add_argument('--num_count_channels',
                            type=int,
                            default=CoachDataset.get_num_count_channels())
        parser.add_argument('--count_hid_dim', type=int, default=128)
        parser.add_argument('--count_hid_layers', type=int, default=2)

        parser.add_argument('--glob_dropout', type=float, default=0.0)

        return parser
Esempio n. 2
0
    def get_arg_parser():
        # TODO: should add 'merge' function for parser instead?
        parser = ConvGlobEncoder.get_arg_parser()

        # inst encoder
        parser.add_argument(
            "--rnn_word_emb_dim",
            type=int,
            default=64,
            help="word emb dim for rnn encoder",
        )
        parser.add_argument(
            "--word_emb_dropout",
            type=float,
            default=0,
            help="word emb dim for rnn encoder",
        )
        parser.add_argument(
            "--top_num_inst", type=int, default=-1, help="num isnt for topn encoder"
        )
        parser.add_argument(
            "--inst_hid_dim", type=int, default=64, help="hid size of inst encoder"
        )
        parser.add_argument(
            "--inst_encoder_type",
            type=str,
            default="bow",
            help="type of instructions encoder",
        )

        # dictionary related
        parser.add_argument(
            "--inst_dict_path", type=str, required=True, help="path to dictionary"
        )
        parser.add_argument("--max_sentence_length", type=int, default=15)

        # # for the first term in loss
        # parser.add_argument('--cmd_type_hid_dim', type=int, default=128)
        # parser.add_argument('--cmd_type_dropout', type=float, default=0.0)
        # # for the second term in loss
        # parser.add_argument('--cmd_head_hid_dim', type=int, default=128)
        # parser.add_argument('--cmd_head_dropout', type=float, default=0.0)

        return parser