Skip to content

Commit b202395

Browse files
committed
update
1 parent 23428c1 commit b202395

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

tf2.0/plot_rl_rewards.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import matplotlib.pyplot as plt
2+
import numpy as np
3+
import argparse
4+
5+
parser = argparse.ArgumentParser()
6+
parser.add_argument('-m', '--mode', type=str, required=True,
7+
help='either "train" or "test"')
8+
args = parser.parse_args()
9+
10+
a = np.load(f'rl_trader_rewards/{args.mode}.npy')
11+
12+
print(f"average reward: {a.mean():.2f}, min: {a.min():.2f}, max: {a.max():.2f}")
13+
14+
plt.hist(a, bins=20)
15+
plt.title(args.mode)
16+
plt.show()

0 commit comments

Comments
 (0)