Esempio n. 1
0
def main(args):
    env = Market(args.codes)
    algorithm = Algorithm(
        tf.Session(config=config),
        env,
        env.trader.action_space,
        env.data_dim,
        **{
            "mode":
            args.mode,
            # "mode": "test",
            "episodes":
            args.episode,
            "save_path":
            os.path.join(CHECKPOINTS_DIR, "RL", "DuelingDQN", "model"),
            "summary_path":
            os.path.join(CHECKPOINTS_DIR, "RL", "DuelingDQN", "summary"),
            "enable_saver":
            True,
            "enable_summary_writer":
            True
        })
    algorithm.run()
    algorithm.eval_v2()
    algorithm.plot()
Esempio n. 2
0
def main(args):
    env = Market(args.codes, **{"use_sequence": True})
    algorithm = Algorithm(
        tf.Session(config=config),
        env,
        env.seq_length,
        env.data_dim,
        env.code_count,
        **{
            "mode":
            args.mode,
            # "mode": "test",
            "save_path":
            os.path.join(CHECKPOINTS_DIR, "SL", "TreNet", "model"),
            "summary_path":
            os.path.join(CHECKPOINTS_DIR, "SL", "TreNet", "summary"),
            "hidden_size":
            5,
            "enable_saver":
            True,
            "enable_summary_writer":
            True
        })
    algorithm.run()
    algorithm.eval_and_plot()
Esempio n. 3
0
def main(args):
    env = Market(args.codes)
    algorithm = Algorithm(env, env.trader.action_space, env.data_dim, **{
        # "mode": args.mode,
        # "mode": "test",
        "episodes": 10,
    })
    algorithm.run()
Esempio n. 4
0
def main(args):
    env = Market(args.codes, **{"use_sequence": True})
    algorithm = Algorithm(tf.Session(config=config), env, env.seq_length, env.data_dim, env.code_count, **{
        "mode": args.mode,
        # "mode": "test",
        "log_level": args.log_level,
        "save_path": os.path.join(CHECKPOINTS_DIR, "SL", "DualAttnRNN", "model"),
        "enable_saver": True,
    })
    algorithm.run()
    algorithm.eval_and_plot()
Esempio n. 5
0
def main(args):
    env = Market(args.codes)
    algorithm = Algorithm(
        tf.Session(config=config),
        env,
        env.trader.action_space,
        env.data_dim,
        **{
            "mode": args.mode,
            # "mode": "test",
            "episodes": 200,
            "log_level": args.log_level,
            "save_path": os.path.join(CHECKPOINTS_DIR, "RL", "DDPG", "model"),
            "enable_saver": True,
        })
    algorithm.run()
    algorithm.eval_v1()
    algorithm.plot()