1 Star 0 Fork 13

ArriettyTrader/stock_robot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
evaluate_model.py 1.25 KB
一键复制 编辑 原始数据 按行查看 历史
邹吉华 提交于 2023-04-12 16:27 . 1.6
from stable_baselines3.common.monitor import Monitor
from stable_baselines3.common.evaluation import evaluate_policy
from stable_baselines3 import SAC
from stock_env import StockEnv
import const as cst
MODEL_NAME = [
#'best_model_1',
'best_model_ab_120c',
'best_model_ab_128c_2',
'best_model_ab_128c_3',
'best_model_ab_128c_4',
'best_model_able',
'best_model_all',
'best_model_all_128c',
'best_model_all_128c_2',
'best_model_all_128c_3',
'best_model_all_128c_4',
'best_model_all_128c_5',
'best_model_all_128c_2000_4',
'best_model_all_128c_2000_4_16l',
'best_model_all_128c_2000_5',
'best_model_all_128c_4000_5',
'best_model_all_128c_6000_4',
'best_model_zz500',
'best_model_zz500_128c',
'sac_stock_all_128c_5',
'sac_stock_all_128c_16l',
'sac_stock_all_128c_2000_4',
'sac_stock_all_128c_2000_4_16l',
'sac_stock_all_128c_2000_5',
'sac_stock_all_128c_4000_5',
'sac_stock_all_128c_6000_4'
]
# The algorithms require a vectorized environment to run
env = Monitor(StockEnv())
for it in MODEL_NAME:
model = SAC.load("./model/"+it,env)
mean_reward, std_reward = evaluate_policy(model, env, n_eval_episodes=10, render=False)
print(f"{it} {mean_reward} {std_reward}")
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ArriettyTrader/stock_robot.git
[email protected]:ArriettyTrader/stock_robot.git
ArriettyTrader
stock_robot
stock_robot
master

搜索帮助