|
| network |
| a dense model with one hidden layer
|
|
My dense neural network
Definition at line 75 of file torch.py.
◆ __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
◆ forward()
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
◆ 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:
- mva/scripts/basf2_mva_python_interface/torch.py