Belle II Software development
Model Class Reference

Class for the ConvNet generator model. More...

Inheritance diagram for Model:

Public Member Functions

def __init__ (self)
 Constructor to create a new model instance.
 
def forward (self, z)
 Function to perform a forward pass.
 

Public Attributes

 fc
 Fully-connected layer.
 
 features
 Sequential composite layer.
 

Detailed Description

Class for the ConvNet generator model.

ConvNet generator model.

Definition at line 18 of file convnet.py.

Constructor & Destructor Documentation

◆ __init__()

def __init__ (   self)

Constructor to create a new model instance.

Definition at line 23 of file convnet.py.

23 def __init__(self):
24 super().__init__()
25 self.fc = nn.Linear(96, 98304)
26 self.features = nn.Sequential(
27 # format: (channels, height, width)
28 # (512, 8, 24)
29 nn.Conv2d(512, 512, 5, 1, 2),
30 nn.BatchNorm2d(512),
31 nn.ReLU(inplace=True),
32 nn.Upsample(scale_factor=2, mode="nearest"),
33 # (512, 16, 48)
34 nn.Conv2d(512, 256, 5, 1, 2),
35 nn.BatchNorm2d(256),
36 nn.ReLU(inplace=True),
37 nn.Upsample(scale_factor=2, mode="nearest"),
38 # (256, 32, 96)
39 nn.Conv2d(256, 128, 5, 1, 2),
40 nn.BatchNorm2d(128),
41 nn.ReLU(inplace=True),
42 nn.Upsample(scale_factor=2, mode="nearest"),
43 # (128, 64, 192)
44 nn.Conv2d(128, 64, 5, 1, 2),
45 nn.BatchNorm2d(64),
46 nn.ReLU(inplace=True),
47 nn.Upsample(scale_factor=2, mode="nearest"),
48 # (64, 128, 384)
49 nn.Conv2d(64, 32, 5, 1, 2),
50 nn.BatchNorm2d(32),
51 nn.ReLU(inplace=True),
52 nn.Upsample(scale_factor=2, mode="nearest"),
53 # (32, 256, 768)
54 nn.Conv2d(32, 1, 5, 1, 2),
55 # (1, 256, 768)
56 )
57

Member Function Documentation

◆ forward()

def forward (   self,
  z 
)

Function to perform a forward pass.

Compute the model output for a given input.

Definition at line 60 of file convnet.py.

60 def forward(self, z):
61 """Compute the model output for a given input."""
62 return self.features(self.fc(z).view(-1, 512, 8, 24)).tanh_()
63

Member Data Documentation

◆ fc

fc

Fully-connected layer.

Definition at line 25 of file convnet.py.

◆ features

features

Sequential composite layer.

Definition at line 26 of file convnet.py.


The documentation for this class was generated from the following file: