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 19 of file write_test_files.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)
Intialize with a single Linear layer

Definition at line 24 of file write_test_files.py.

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

Member Function Documentation

◆ forward()

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

Definition at line 33 of file write_test_files.py.

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

Member Data Documentation

◆ linear

linear = nn.Linear(8, 2)

linear Layer with 8 inputs, 2 outputs

Definition at line 31 of file write_test_files.py.


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