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

Public Member Functions

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

Public Attributes

 network
 a dense model with one hidden layer
 

Detailed Description

My dense neural network

Definition at line 45 of file torch.py.

Constructor & Destructor Documentation

◆ __init__()

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

Definition at line 50 of file torch.py.

50 def __init__(self, number_of_features):
51 """
52 Init the network
53 param: number_of_features number of input variables
54 """
55 super(myModel, self).__init__()
56
57
58 self.network = torch.nn.Sequential(
59 torch.nn.Linear(number_of_features, 128),
60 torch.nn.ReLU(),
61 torch.nn.Linear(128, 128),
62 torch.nn.ReLU(),
63 torch.nn.Linear(128, 1),
64 torch.nn.Sigmoid(),
65 )
66

Member Function Documentation

◆ forward()

def forward (   self,
  x 
)
Run the network

Definition at line 67 of file torch.py.

67 def forward(self, x):
68 """
69 Run the network
70 """
71 prob = self.network(x)
72 return prob
73
74

Member Data Documentation

◆ network

network

a dense model with one hidden layer

Definition at line 58 of file torch.py.


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