Simple dense net
Simple dense neural network.
SimpleDenseNet
#
Bases: Module
A simple fully-connected neural net for computing predictions.
Source code in src/models/components/simple_dense_net.py
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
__init__(input_size=784, lin1_size=256, lin2_size=256, lin3_size=256, output_size=10)
#
Initialize a SimpleDenseNet
module.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
input_size
|
int
|
The number of input features. |
784
|
lin1_size
|
int
|
The number of output features of the first linear layer. |
256
|
lin2_size
|
int
|
The number of output features of the second linear layer. |
256
|
lin3_size
|
int
|
The number of output features of the third linear layer. |
256
|
output_size
|
int
|
The number of output features of the final linear layer. |
10
|
Source code in src/models/components/simple_dense_net.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
|
forward(x)
#
Perform a single forward pass through the network.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
x
|
Tensor
|
The input tensor. |
required |
Returns:
Type | Description |
---|---|
Tensor
|
A tensor of predictions. |
Source code in src/models/components/simple_dense_net.py
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|