MCPcopy Create free account
hub / github.com/OpenRL-Lab/Wandb_Tutorial / __init__

Method __init__

sweep/cnn/model.py:5–24  ·  view source on GitHub ↗
(self,config)

Source from the content-addressed store, hash-verified

3
4class CNNModel(nn.Module):
5 def __init__(self,config):
6 super(CNNModel, self).__init__()
7
8 # Convolution 1
9 self.cnn1 = nn.Conv2d(in_channels=1, out_channels=config.channels_one, kernel_size=5, stride=1, padding=0)
10 self.relu1 = nn.ReLU()
11 # Max pool 1
12 self.maxpool1 = nn.MaxPool2d(kernel_size=2)
13
14 # Convolution 2
15 self.cnn2 = nn.Conv2d(in_channels=config.channels_one, out_channels=config.channels_two, kernel_size=5, stride=1, padding=0)
16 self.relu2 = nn.ReLU()
17
18 # Max pool 2
19 self.maxpool2 = nn.MaxPool2d(kernel_size=2)
20
21 self.dropout = nn.Dropout(p=config.dropout)
22
23 # Fully connected 1 (readout)
24 self.fc1 = nn.Linear(config.channels_two*4*4, 10)
25
26 def forward(self, x):
27 # Convolution 1

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected