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

Class Torch_Model

tests/core_tests.py:722–741  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

720
721# PyTorch model for test cases --> Do not change the layers
722class Torch_Model(nn.Module):
723 def __init__(self,):
724 super(Torch_Model, self).__init__()
725 self.convs = nn.Sequential(
726 nn.Conv2d(1, 32, 3),
727 nn.ReLU(),
728 nn.Conv2d(32, 64, 3),
729 nn.ReLU(),
730 nn.MaxPool2d(2),
731 nn.Dropout(0.25)
732 )
733 self.fcs = nn.Sequential(
734 nn.Linear(12*12*64, 128),
735 nn.ReLU(),
736 nn.Dropout(0.5),
737 nn.Linear(128, 10),
738 )
739
740 def forward(self, x):
741 return x
742
743
744class TestDropout(unittest.TestCase):

Callers 1

test_set_dropout_modeMethod · 0.70

Calls

no outgoing calls

Tested by 1

test_set_dropout_modeMethod · 0.56

Used in the wild real call sites across dependent graphs

searching dependent graphs…