18 lines
518 B
Python
18 lines
518 B
Python
# model/trading_model.py
|
|
import torch
|
|
import torch.nn as nn
|
|
import torch.nn.functional as F
|
|
|
|
class TradingModel(nn.Module):
|
|
def __init__(self, input_dim, hidden_dim, output_dim):
|
|
super(TradingModel, self).__init__()
|
|
self.fc1 = nn.Linear(input_dim, hidden_dim)
|
|
self.fc2 = nn.Linear(hidden_dim, hidden_dim)
|
|
self.fc3 = nn.Linear(hidden_dim, output_dim)
|
|
|
|
def forward(self, x):
|
|
x = F.relu(self.fc1(x))
|
|
x = F.relu(self.fc2(x))
|
|
x = self.fc3(x)
|
|
return x
|