MCPcopy Create free account
hub / github.com/geekcomputers/Python / create_simple_model

Function create_simple_model

ML/train.py:27–46  ·  view source on GitHub ↗
(num_classes=10)

Source from the content-addressed store, hash-verified

25 torch.backends.cudnn.benchmark = False
26
27def create_simple_model(num_classes=10):
28 return nn.Sequential(
29 nn.Conv2d(3, 32, 3, padding=1),
30 nn.BatchNorm2d(32),
31 nn.ReLU(inplace=True),
32 nn.MaxPool2d(2),
33
34 nn.Conv2d(32, 64, 3, padding=1),
35 nn.BatchNorm2d(64),
36 nn.ReLU(inplace=True),
37 nn.MaxPool2d(2),
38
39 nn.Conv2d(64, 128, 3, padding=1),
40 nn.BatchNorm2d(128),
41 nn.ReLU(inplace=True),
42 nn.AdaptiveAvgPool2d(1),
43
44 nn.Flatten(),
45 nn.Linear(128, num_classes)
46 )
47
48def main():
49 parser = argparse.ArgumentParser(description='NeuralForge Training')

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected