Belle II Software development
Model Class Reference
Inheritance diagram for Model:

Public Member Functions

 __init__ (self)
 
 forward (self, a, b)
 

Public Attributes

 linear = nn.Linear(8, 2)
 linear Layer with 8 inputs, 2 outputs
 

Detailed Description

Example model with 2 different input tensors

Definition at line 17 of file write_test_file.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)
Intialize with a single Linear layer

Definition at line 21 of file write_test_file.py.

21 def __init__(self):
22 """
23 Intialize with a single Linear layer
24 """
25 super().__init__()
26
27
28 self.linear = nn.Linear(8, 2)
29

Member Function Documentation

◆ forward()

forward ( self,
a,
b )
Run the forward pass - a and b are concatenated and b is flattened

Definition at line 30 of file write_test_file.py.

30 def forward(self, a, b):
31 """
32 Run the forward pass - a and b are concatenated and b is flattened
33 """
34 return self.linear(torch.cat([a, b.reshape(-1, 6).float()], axis=1))
35
36

Member Data Documentation

◆ linear

linear = nn.Linear(8, 2)

linear Layer with 8 inputs, 2 outputs

Definition at line 28 of file write_test_file.py.


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