def main():
    opt = Config()

    if opt.if_real_data:
        opt.max_seq_len, opt.vocab_size = text_process('data/' + opt.dataset +
                                                       '.txt')
        opt.extend_vocab_size = len(load_test_dict(
            opt.dataset)[0])  # init classifier vocab_size

    inst = SeqGANInstructor(opt)
    inst._run()
Exemple #2
0
    parser.add_argument('--signal_file', default=cfg.signal_file, type=str)
    parser.add_argument('--tips', default=cfg.tips, type=str)

    return parser


# MAIN
if __name__ == '__main__':
    # Hyper Parameters
    parser = argparse.ArgumentParser()
    parser = program_config(parser)
    opt = parser.parse_args()

    if opt.if_real_data:
        print("Real data is being used")
        opt.max_seq_len, opt.vocab_size = text_process('dataset/' + opt.dataset + '.txt')
        cfg.extend_vocab_size = len(load_test_dict(opt.dataset)[0])  # init classifier vocab_size
    cfg.init_param(opt)
    opt.save_root = cfg.save_root
    opt.train_data = cfg.train_data
    opt.test_data = cfg.test_data

    # ===Dict===
    if cfg.if_real_data:
        from instructor.real_data.seqgan_instructor import SeqGANInstructor
        from instructor.real_data.leakgan_instructor import LeakGANInstructor
        from instructor.real_data.maligan_instructor import MaliGANInstructor
        from instructor.real_data.jsdgan_instructor import JSDGANInstructor
        from instructor.real_data.dpgan_instructor import DPGANInstructor
        from instructor.real_data.sa_dpgan_instructor import SADPGANInstructor
        from instructor.real_data.relgan_instructor import RelGANInstructor