INNER CODE UNIT · Python
__init__
maxpumperla/learning_ray · notebooks/fare_predictor.py:9
def __init__(self):
super().__init__()
self.fc1 = nn.Linear(NUM_FEATURES, 256)
self.fc2 = nn.Linear(256, 16)
self.fc3 = nn.Linear(16, 1)
self.bn1 = nn.BatchNorm1d(256)
self.bn2 = nn.BatchNorm1d(16)
def forward(self, x):
x = F.relu(self.fc1(x))
x = self.bn1(x)
x = F.relu(self.fc2(x))
x = self.bn2(x)
x = torch.sigmoid(self.fc3(x))
return x