Jack-ki1's picture
Upload 31 files
f62a6a7 verified
Raw
History Blame Contribute Delete
601 Bytes
"""Sample: a small PyTorch MLP for tabular regression (e.g. race-result prediction)."""
import torch
import torch.nn as nn
class RacePredictorMLP(nn.Module):
def __init__(self, in_features=18):
super().__init__()
self.fc1 = nn.Linear(in_features, 64)
self.relu1 = nn.ReLU()
self.fc2 = nn.Linear(64, 32)
self.relu2 = nn.ReLU()
self.dropout = nn.Dropout(0.2)
self.fc3 = nn.Linear(32, 1)
def forward(self, x):
x = self.relu1(self.fc1(x))
x = self.relu2(self.fc2(x))
x = self.dropout(x)
return self.fc3(x)