INNER CODE UNIT · Python
x
RichardS0268/CNN-for-Trading · model.py:42
x = self.DropOut(x.view(x.shape[0], -1))
x = self.FC(x) # output size: [N, 2]
x = self.Softmax(x)
return x
class CNN20d(nn.Module):
# Input: [N, (1), 64, 60]; Output: [N, 2]
# Three Convolution Blocks
def init_weights(self, m):
if isinstance(m, nn.Linear) or isinstance(m, nn.Conv2d):
torch.nn.init.xavier_uniform(m.weight)
m.bias.data.fill_(0.01)
def __init__(self):