Skip to content
Snippets Groups Projects
Commit cda15bb0 authored by Olegs NIKISINS's avatar Olegs NIKISINS
Browse files

Added doc-strings in the MLP class

parent cbe29954
No related branches found
No related tags found
1 merge request!14MLP class and config to train it
...@@ -36,6 +36,19 @@ class TwoLayerMLP(nn.Module): ...@@ -36,6 +36,19 @@ class TwoLayerMLP(nn.Module):
super(TwoLayerMLP, self).__init__() super(TwoLayerMLP, self).__init__()
""" """
Init method. Init method.
Parameters
----------
in_features : int
Dimensionality of the input feature vectors.
n_hidden_relu : int
Number of ReLU units in the hidden layer of the MLP.
apply_sigmoid : bool
If set to ``True`` the sigmoid will be applied to the output of the
hidden FC layer. If ``False`` the sigmoid is not applied.
Default: ``True``.
""" """
self.in_features = in_features self.in_features = in_features
...@@ -52,6 +65,17 @@ class TwoLayerMLP(nn.Module): ...@@ -52,6 +65,17 @@ class TwoLayerMLP(nn.Module):
def forward(self, x): def forward(self, x):
""" """
The forward method. The forward method.
Parameters
----------
x : :py:class:`torch.Tensor`
The batch to forward through the network. Size of the input batch
is [batch_size, 1, self.in_features].
Returns
-------
x : :py:class:`torch.Tensor`
Output of the MLP, class probability.
""" """
# input is a batch of the size: [batch_size, 1, self.in_features], # input is a batch of the size: [batch_size, 1, self.in_features],
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment