| 43 | |
| 44 | |
| 45 | class FC(nn.Module): |
| 46 | def __init__(self, hidden_dim): |
| 47 | super(FC, self).__init__() |
| 48 | self.fc = nn.Sequential( |
| 49 | nn.Linear(hidden_dim, hidden_dim), |
| 50 | nn.ReLU(), |
| 51 | nn.Linear(hidden_dim, hidden_dim), |
| 52 | nn.ReLU(), |
| 53 | nn.Linear(hidden_dim, hidden_dim), |
| 54 | nn.ReLU() |
| 55 | ) |
| 56 | self.linear = nn.Linear(hidden_dim, hidden_dim) |
| 57 | |
| 58 | def forward(self, x): |
| 59 | return self.fc(x) + self.linear(x) |
| 60 | |
| 61 | |
| 62 | class Encoder(torch.nn.Module): |