Ejemplo n.º 1
0
    def __init__(self, args):
        # real MemNN model architecture
        self.memnn_model = MemNNModel(args)
        self.args = args
        exp_name = args.data_set + '_' + args.exp_name

        # create experiment dir
        self.exp_dir= os.path.join(args.checkpoints_dir, exp_name)
        helper_fn.makedirs(self.exp_dir)
        hist_name = exp_name + '.hist'
        model_name = exp_name + '_final_model.h5'
        encoder_model_name = exp_name + '_encoder_model.h5'
        decoder_model_name = exp_name + '_decoder_model.h5'

        self.history_path = os.path.join(self.exp_dir, hist_name)
        self.model_path = os.path.join(self.exp_dir, model_name)
        self.encoder_model_path = os.path.join(self.exp_dir, encoder_model_name)
        self.decoder_model_path = os.path.join(self.exp_dir, decoder_model_name)
        
        outputs_dir = args.outputs_dir
        helper_fn.makedirs(outputs_dir)
        self.src_out_name = exp_name + '.src'
        self.src_out_path = os.path.join(outputs_dir, self.src_out_name)
        self.pred_out_name = exp_name + '.pred'
        self.pred_out_path = os.path.join(outputs_dir, self.pred_out_name)
        self.tar_out_name = exp_name + '.tgt'
        self.tar_out_path = os.path.join(outputs_dir, self.tar_out_name)
    def __init__(self, args):
        # real Transformer model architecture
        self.transformer_model = TransformerModel(
            args=args,
            transformer_dropout=0.05,
            embedding_dropout=0.05,
            use_same_embedding=False,
        )
        self.args = args
        exp_name = args.data_set + '_' + args.exp_name

        # create experiment dir
        self.exp_dir = os.path.join(args.checkpoints_dir, exp_name)
        helper_fn.makedirs(self.exp_dir)
        hist_name = exp_name + '.hist'
        model_name = exp_name + '_final_model.h5'

        self.history_path = os.path.join(self.exp_dir, hist_name)
        self.model_path = os.path.join(self.exp_dir, model_name)

        outputs_dir = args.outputs_dir
        helper_fn.makedirs(outputs_dir)
        self.src_out_name = exp_name + '.src'
        self.src_out_path = os.path.join(outputs_dir, self.src_out_name)
        self.pred_out_name = exp_name + '.pred'
        self.pred_out_path = os.path.join(outputs_dir, self.pred_out_name)
        self.tar_out_name = exp_name + '.tgt'
        self.tar_out_path = os.path.join(outputs_dir, self.tar_out_name)
    def __init__(self, args):
        self.tau = K.variable(0.5, name='temperature')
        self.dssm_model = AutoPointerDssmModel(args=args, tau=self.tau, use_same_embedding=False)
        self.args = args
        exp_names = []
        exp_names.append(args.data_set)
        exp_names.append(args.exp_name)
        exp_names.append('pos')
        exp_names.append(str(args.positive_number))
        exp_names.append('neg')
        exp_names.append(str(args.negative_number))
        exp_names.append('qr')
        exp_names.append(str(args.query_retrieval_number))
        exp_names.append('apr')
        exp_names.append(str(args.auto_pointer_rate))
        #exp_names.append('layers')
        #exp_names.append(str(args.transformer_depth))
        exp_name = '_'.join(exp_names)

        # create experiment dir
        self.exp_dir= os.path.join(args.checkpoints_dir, exp_name)
        helper_fn.makedirs(self.exp_dir)
        hist_name = exp_name + '.hist'
        model_name = exp_name + '_final_model.h5'

        self.history_path = os.path.join(self.exp_dir, hist_name)
        self.model_path = os.path.join(self.exp_dir, model_name)

        outputs_dir = args.outputs_dir
        helper_fn.makedirs(outputs_dir)

        self.out_name = exp_name + '.dssm'
        self.out_path = os.path.join(outputs_dir, self.out_name)
    def __init__(self, args):
        # real Transformer model architecture
        self.multi_task_model= MultiTaskModel(args=args)
        self.args = args
        exp_name = args.data_set + '_' + args.exp_name

        # create experiment dir
        self.exp_dir= os.path.join(args.checkpoints_dir, exp_name)
        helper_fn.makedirs(self.exp_dir)
        hist_name = exp_name + '.hist'
        model_name = exp_name + '_final_model.h5'

        self.history_path = os.path.join(self.exp_dir, hist_name)
        self.model_path = os.path.join(self.exp_dir, model_name)
        
        outputs_dir = args.outputs_dir
        helper_fn.makedirs(outputs_dir)
        self.src_out_name = exp_name + '.src'
        self.src_out_path = os.path.join(outputs_dir, self.src_out_name)
        self.pred_out_name = exp_name + '.pred'
        self.pred_out_path = os.path.join(outputs_dir, self.pred_out_name)
        self.tar_out_name = exp_name + '.tgt'
        self.tar_out_path = os.path.join(outputs_dir, self.tar_out_name)
    def __init__(self, args):
        self.args = args
        exp_name = args.data_set + '_' + args.exp_name

        self.checkpoints_dir = os.path.join(args.checkpoints_dir, exp_name)
        helper_fn.makedirs(self.checkpoints_dir)
        self.checkpoint_prefix = os.path.join(self.checkpoints_dir, 'ckpt')
        self.tensorboard_dir = args.tensorboard_dir
        helper_fn.makedirs(self.tensorboard_dir)

        outputs_dir = args.outputs_dir
        helper_fn.makedirs(outputs_dir)
        self.src_out_name = exp_name + '.src'
        self.src_out_path = os.path.join(outputs_dir, self.src_out_name)
        self.pred_out_name = exp_name + '.pred'
        self.pred_out_path = os.path.join(outputs_dir, self.pred_out_name)
        self.tar_out_name = exp_name + '.tgt'
        self.tar_out_path = os.path.join(outputs_dir, self.tar_out_name)