MCPcopy Create free account
hub / github.com/circuitnet/CircuitNet / __init__

Method __init__

net_delay_prediction/model.py:7–15  ·  view source on GitHub ↗
(self, *sizes, batchnorm=False)

Source from the content-addressed store, hash-verified

5
6class MLP(torch.nn.Module):
7 def __init__(self, *sizes, batchnorm=False):
8 super().__init__()
9 fcs = []
10 for i in range(1, len(sizes)):
11 fcs.append(torch.nn.Linear(sizes[i - 1], sizes[i]))
12 if i < len(sizes) - 1:
13 fcs.append(torch.nn.LeakyReLU(negative_slope=0.2))
14 if batchnorm: fcs.append(torch.nn.BatchNorm1d(sizes[i]))
15 self.layers = torch.nn.Sequential(*fcs)
16
17 def forward(self, x):
18 return self.layers(x)

Callers 2

__init__Method · 0.45
__init__Method · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected