| import torch | |
| import torch.nn as nn | |
| class MLBaseModel(nn.Module): | |
| def __init__(self, input_dim): | |
| super(MLBaseModel, self).__init__() | |
| self.fc1 = nn.Linear(input_dim, 256) | |
| self.fc2 = nn.Linear(256, 128) | |
| self.fc3 = nn.Linear(128, 64) | |
| self.fc4 = nn.Linear(64, 2) # Output 2 values: sale_price and days_on_market | |
| def forward(self, x): | |
| x = torch.relu(self.fc1(x)) | |
| x = torch.relu(self.fc2(x)) | |
| x = torch.relu(self.fc3(x)) | |
| x = self.fc4(x) | |
| return x |