Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.learn.pytorch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
bob
bob.learn.pytorch
Commits
cda15bb0
Commit
cda15bb0
authored
6 years ago
by
Olegs NIKISINS
Browse files
Options
Downloads
Patches
Plain Diff
Added doc-strings in the MLP class
parent
cbe29954
No related branches found
No related tags found
1 merge request
!14
MLP class and config to train it
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bob/learn/pytorch/architectures/TwoLayerMLP.py
+24
-0
24 additions, 0 deletions
bob/learn/pytorch/architectures/TwoLayerMLP.py
with
24 additions
and
0 deletions
bob/learn/pytorch/architectures/TwoLayerMLP.py
+
24
−
0
View file @
cda15bb0
...
@@ -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],
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment