-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.py
59 lines (52 loc) · 1.23 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
from src.rl.agent import Agent
if __name__ == "__main__":
model_name = "transforming-stonks-v1.0.1"
# Trading parameters
tickers = ["TSLA", "CNI", "COST", "TLT", "TD"]
fee = 0.005
trading_period = 250
# Model parameters
embeddings = 256
layers = 1
heads = 4
fwex = 128
dropout = 0.1
neurons = 1024
lr = 1e-4
gamma = 0.9
# RL parameters
mini_batch_size = 16
epsilon_max = 1
epsilon_min = 0.005
epsilon_decay = 0.83
discount = 0.98
capacity = 10_000
n_eps = 1_000
update_freq = 100
show_every = 5
render = True
agent = Agent(
model_name=model_name,
tickers=tickers,
fee=fee,
trading_period=trading_period,
embeddings=embeddings,
layers=layers,
heads=heads,
fwex=fwex,
dropout=dropout,
neurons=neurons,
lr=lr,
gamma=gamma,
mini_batch_size=mini_batch_size,
epsilon_max=epsilon_max,
epsilon_min=epsilon_min,
epsilon_decay=epsilon_decay,
discount=discount,
capacity=capacity,
n_eps=n_eps,
update_freq=update_freq,
show_every=show_every,
render=render,
)
agent.train()