def run_optimize(args, logger): from lib.RLTrader import RLTrader trader = RLTrader(**vars(args), logger=logger, reward_strategy=reward_strategy) trader.optimize(n_trials=args.trials)
def optimize_code(params): from lib.RLTrader import RLTrader trader = RLTrader(**params) trader.optimize() return ""
import numpy as np from lib.RLTrader import RLTrader from lib.TraderArgs import TraderArgs from lib.util.logger import init_logger np.warnings.filterwarnings('ignore') option_parser = TraderArgs() args = option_parser.get_args() if __name__ == '__main__': logger = init_logger(__name__, show_debug=args.debug) trader = RLTrader(**vars(args), logger=logger) if args.command == 'optimize': trader.optimize(n_trials=args.trials, n_parallel_jobs=args.parallel_jobs) elif args.command == 'train': trader.train(n_epochs=args.epochs) elif args.command == 'test': trader.test(model_epoch=args.model_epoch, should_render=args.no_render) elif args.command == 'opt-train-test': trader.optimize(args.trials, args.parallel_jobs) trader.train(n_epochs=args.train_epochs, test_trained_model=args.no_test, render_trained_model=args.no_render)
import numpy as np from lib.RLTrader import RLTrader np.warnings.filterwarnings('ignore') if __name__ == '__main__': trader = RLTrader() trader.optimize() trader.train(test_trained_model=True, render_trained_model=True)
def optimize_code(params): trader = RLTrader(**params) trader.optimize()
def run_optimize(args, logger): from lib.RLTrader import RLTrader trader = RLTrader(**vars(args), logger=logger) trader.optimize(args.trials)
def run_concurrent_optimize(trader: RLTrader, args): trader.optimize(args.trials, args.trials, args.parallel_jobs)
def run_concurrent_optimize(): trader = RLTrader(**vars(args)) trader.optimize(args.trials)