-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathconfig.py
More file actions
48 lines (36 loc) · 975 Bytes
/
Copy pathconfig.py
File metadata and controls
48 lines (36 loc) · 975 Bytes
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
import torch
# --- Model Selection ---
MODEL_TYPE = 'MLP' # Options: 'MLP', 'CNN1D', 'LSTM'
# --- Training Settings ---
ENV_NAME = 'StockTrading-v0'
TICKER = 'AAPL' # S&P 500. Try 'AAPL', 'GOOG', 'MSFT', etc.
START_DATE = '2015-01-01'
END_DATE = '2016-12-31'
WINDOW_SIZE = 5
# --- Agent Hyperparameters ---
LEARNING_RATE = 0.0001
GAMMA = 0.99
BATCH_SIZE = 64
REPLAY_BUFFER_SIZE = 100000
TARGET_UPDATE_FREQ = 1000
HIDDEN_LAYER_SIZE = 256
WARMUP_STEPS = 100
# --- Epsilon-Greedy Strategy ---
EPSILON_START = 1.0
EPSILON_END = 0.01
EPSILON_DECAY = 2500
# --- DQN Variants ---
double_dqn = True
dueling_network = True
# --- Training Loop Settings ---
NUM_EPISODES = 300
REPORT_INTERVAL = 10
MOVING_AVG_WINDOW = 10
SEED = 42
LOSS = "huber" # options: "huber", "mse"
SOFT_UPDATE = True
TAU = 0.005 # Polyak coefficient
# --- Device Configuration ---
DEVICE = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
# --- Save/Load Settings ---
SAVE_MODEL = True