MCPcopy Create free account
hub / github.com/DataScienceHamburg/PyTorchUltimateMaterial / MultiClassNet

Class MultiClassNet

600_ModelDeployment/model_class.py:4–16  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2import torch.nn as nn
3
4class MultiClassNet(nn.Module):
5 def __init__(self, NUM_FEATURES, NUM_CLASSES, HIDDEN_FEATURES):
6 super().__init__()
7 self.lin1 = nn.Linear(NUM_FEATURES, HIDDEN_FEATURES)
8 self.lin2 = nn.Linear(HIDDEN_FEATURES, NUM_CLASSES)
9 self.log_softmax = nn.LogSoftmax(dim=1)
10
11 def forward(self, x):
12 x = self.lin1(x)
13 x = torch.sigmoid(x)
14 x = self.lin2(x)
15 x = self.log_softmax(x)
16 return x

Callers 2

app_iris.pyFile · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected