Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
bob.ip.pytorch_extractor
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
Show more breadcrumbs
bob
bob.ip.pytorch_extractor
Merge requests
!4
MLPAlgorithm PAD algorithm V1 version
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
MLPAlgorithm PAD algorithm V1 version
mlp_algorithm
into
master
Overview
16
Commits
9
Pipelines
8
Changes
8
Merged
Olegs NIKISINS
requested to merge
mlp_algorithm
into
master
6 years ago
Overview
16
Commits
9
Pipelines
8
Changes
8
Expand
This is an MLP based PAD algorithm.
Edited
6 years ago
by
Olegs NIKISINS
0
0
Merge request reports
Compare
master
version 7
c51586ca
6 years ago
version 6
150166c7
6 years ago
version 5
55016a19
6 years ago
version 4
306e2efe
6 years ago
version 3
dba77525
6 years ago
version 2
405c8e83
6 years ago
version 1
48d8a345
6 years ago
master (base)
and
latest version
latest version
c94e1d3a
9 commits,
6 years ago
version 7
c51586ca
8 commits,
6 years ago
version 6
150166c7
7 commits,
6 years ago
version 5
55016a19
6 commits,
6 years ago
version 4
306e2efe
5 commits,
6 years ago
version 3
dba77525
4 commits,
6 years ago
version 2
405c8e83
3 commits,
6 years ago
version 1
48d8a345
1 commit,
6 years ago
8 files
+
423
−
10
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
8
Search (e.g. *.vue) (Ctrl+P)
bob/ip/pytorch_extractor/test_data/mlp_algo_test_config.py
0 → 100644
+
56
−
0
Options
#!/usr/bin/env python2
# -*- coding: utf-8 -*-
"""
@author: Olegs Nikisins
"""
#==============================================================================
# Import here:
import
torch
#==============================================================================
# Define parameters here:
"""
Transformations to be applied to the input 1D numpy arrays (feature vectors).
Only conversion to Tensor and unsqueezing is needed to match the input of
TwoLayerMLP network
"""
def
transform
(
x
):
"""
Convert input to Tensor and unsqueeze to match the input of
TwoLayerMLP network.
Arguments
---------
x : numpy array
1D numpy array / feature vector.
Return
------
x_transform : Tensor
Torch tensor, transformed ``x`` to be used as MLP input.
"""
return
torch
.
Tensor
(
x
).
unsqueeze
(
0
)
"""
Define the network to be trained as a class, named ``Network``.
Note: Do not change the name of the below class, always import as ``Network``.
"""
from
bob.learn.pytorch.architectures
import
TwoLayerMLP
as
Network
"""
kwargs to be used for ``Network`` initialization. The name must be ``network_kwargs``.
"""
network_kwargs
=
{}
network_kwargs
[
'
in_features
'
]
=
1296
network_kwargs
[
'
n_hidden_relu
'
]
=
10
network_kwargs
[
'
apply_sigmoid
'
]
=
False
# don't use sigmoid to make the scores more even
Loading