MCPcopy Create free account
hub / github.com/modAL-python/modAL / Torch_Model

Class Torch_Model

examples/pytorch_mc_dropout.py:18–41  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16
17# Standard Pytorch Model (Visit the PyTorch documentation for more details)
18class Torch_Model(nn.Module):
19 def __init__(self,):
20 super(Torch_Model, self).__init__()
21 self.convs = nn.Sequential(
22 nn.Conv2d(1, 32, 3),
23 nn.ReLU(),
24 nn.Conv2d(32, 64, 3),
25 nn.ReLU(),
26 nn.MaxPool2d(2),
27 nn.Dropout(0.25)
28 )
29 self.fcs = nn.Sequential(
30 nn.Linear(12*12*64, 128),
31 nn.ReLU(),
32 nn.Dropout(0.5),
33 nn.Linear(128, 10),
34 )
35
36 def forward(self, x):
37 out = x
38 out = self.convs(out)
39 out = out.view(-1, 12*12*64)
40 out = self.fcs(out)
41 return out
42
43
44torch_model = Torch_Model()

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…