|
| network |
| a dense model with one hidden layer
|
|
My dense neural network
Definition at line 17 of file simple.py.
◆ __init__()
def __init__ |
( |
|
self, |
|
|
|
number_of_features |
|
) |
| |
Init the network
param: number_of_features number of input variables
Definition at line 22 of file simple.py.
22 def __init__(self, number_of_features):
23 """
24 Init the network
25 param: number_of_features number of input variables
26 """
27 super(myModel, self).__init__()
28
29
30 self.network = torch.nn.Sequential(
31 torch.nn.Linear(number_of_features, 128),
32 torch.nn.ReLU(),
33 torch.nn.Linear(128, 128),
34 torch.nn.ReLU(),
35 torch.nn.Linear(128, 1),
36 torch.nn.Sigmoid(),
37 )
38
◆ forward()
Run the network
Definition at line 39 of file simple.py.
39 def forward(self, x):
40 """
41 Run the network
42 """
43 prob = self.network(x)
44 return prob
45
46
◆ network
a dense model with one hidden layer
Definition at line 30 of file simple.py.
The documentation for this class was generated from the following file: