BIG clean up and refactoring

This commit is contained in:
hobogalaxy committed 2020-11-27 20:23:05 +01:00
1 parent a905c0b094
commit e7a579d720
24 files changed
+369 -597

No files matched your search

+21
View File
@@ -0,0 +1,21 @@
from torch import nn
class ExampleModel(nn.Module):
def __init__(self, hparams):
super().__init__()
self.model = nn.Sequential(
nn.Linear(hparams["input_size"], hparams["lin1_size"]),
nn.BatchNorm1d(hparams["lin1_size"]),
nn.ReLU(),
nn.Dropout(p=0.25),
nn.Linear(hparams["lin1_size"], hparams["lin2_size"]),
nn.LogSoftmax(dim=1)
)
def forward(self, x):
batch_size, channels, width, height = x.size()
x = x.view(batch_size, -1)
return self.model(x)