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

Public Member Functions

 __init__ (self, number_of_features)
 
 forward (self, x)
 

Public Attributes

 network
 a dense model with one hidden layer
 

Detailed Description

My dense neural network

Definition at line 75 of file torch.py.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self,
number_of_features )
Init the network
param: number_of_features number of input variables

Definition at line 80 of file torch.py.

80 def __init__(self, number_of_features):
81 """
82 Init the network
83 param: number_of_features number of input variables
84 """
85 super(myModel, self).__init__()
86
87
88 self.network = pytorch.nn.Sequential(
89 pytorch.nn.Linear(number_of_features, 128),
90 pytorch.nn.ReLU(),
91 pytorch.nn.Linear(128, 128),
92 pytorch.nn.ReLU(),
93 pytorch.nn.Linear(128, 1),
94 pytorch.nn.Sigmoid(),
95 )
96

Member Function Documentation

◆ forward()

forward ( self,
x )
Run the network

Definition at line 97 of file torch.py.

97 def forward(self, x):
98 """
99 Run the network
100 """
101 prob = self.network(x)
102 return prob
103
104

Member Data Documentation

◆ network

network
Initial value:
= pytorch.nn.Sequential(
pytorch.nn.Linear(number_of_features, 128),
pytorch.nn.ReLU(),
pytorch.nn.Linear(128, 128),
pytorch.nn.ReLU(),
pytorch.nn.Linear(128, 1),
pytorch.nn.Sigmoid(),
)

a dense model with one hidden layer

Definition at line 88 of file torch.py.


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