Skip to content

Instantly share code, notes, and snippets.

@dongqifong
Created July 2, 2021 12:55
Show Gist options
  • Save dongqifong/4907b125759314f726d0e1ee1323462b to your computer and use it in GitHub Desktop.
Save dongqifong/4907b125759314f726d0e1ee1323462b to your computer and use it in GitHub Desktop.
pytorch_Model_medium
class MyModel(nn.Module):
def __init__(self):
super(MyModel, self).__init__()
# Encoder
self.block1 = nn.Sequential(
nn.Linear(128,64),
nn.Tanh(),
nn.Linear(64, 32),
nn.Tanh(),
nn.Linear(32, 16),
nn.Tanh(),
nn.Linear(16, 10),
)
def forward(self, x):
out = self.block1(x)
return out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment