Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MLAir
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
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
esde
machine-learning
MLAir
Merge requests
!318
Resolve "release v1.4.0"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "release v1.4.0"
release_v1.4.0
into
master
Overview
0
Commits
229
Pipelines
3
Changes
1
Merged
Ghost User
requested to merge
release_v1.4.0
into
master
3 years ago
Overview
0
Commits
229
Pipelines
3
Changes
1
Expand
Closes
#317 (closed)
Edited
3 years ago
by
Ghost User
0
0
Merge request reports
Viewing commit
782f111e
Show latest version
1 file
+
6
−
4
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
782f111e
addendum to FCN class: enable linear activations and add output_activation parameter
· 782f111e
leufen1
authored
4 years ago
mlair/model_modules/fully_connected_networks.py
+
6
−
4
Options
@@ -63,12 +63,13 @@ class FCN(AbstractModelClass):
"""
_activation
=
{
"
relu
"
:
keras
.
layers
.
ReLU
,
"
tanh
"
:
partial
(
keras
.
layers
.
Activation
,
"
tanh
"
),
"
sigmoid
"
:
partial
(
keras
.
layers
.
Activation
,
"
sigmoid
"
)}
"
sigmoid
"
:
partial
(
keras
.
layers
.
Activation
,
"
sigmoid
"
),
"
linear
"
:
partial
(
keras
.
layers
.
Activation
,
"
linear
"
)}
_optimizer
=
{
"
adam
"
:
keras
.
optimizers
.
adam
,
"
sgd
"
:
keras
.
optimizers
.
SGD
}
_requirements
=
[
"
lr
"
,
"
beta_1
"
,
"
beta_2
"
,
"
epsilon
"
,
"
decay
"
,
"
amsgrad
"
,
"
momentum
"
,
"
nesterov
"
]
def
__init__
(
self
,
input_shape
:
list
,
output_shape
:
list
,
activation
=
"
relu
"
,
optimizer
=
"
adam
"
,
n_layer
=
1
,
n_hidden
=
10
,
**
kwargs
):
def
__init__
(
self
,
input_shape
:
list
,
output_shape
:
list
,
activation
=
"
relu
"
,
activation_output
=
"
linear
"
,
optimizer
=
"
adam
"
,
n_layer
=
1
,
n_hidden
=
10
,
**
kwargs
):
"""
Sets model and loss depending on the given arguments.
@@ -82,6 +83,7 @@ class FCN(AbstractModelClass):
# settings
self
.
activation
=
self
.
_set_activation
(
activation
)
self
.
activation_output
=
self
.
_set_activation
(
activation_output
)
self
.
optimizer
=
self
.
_set_optimizer
(
optimizer
,
**
kwargs
)
self
.
layer_configuration
=
(
n_layer
,
n_hidden
)
self
.
_update_model_name
()
@@ -127,7 +129,7 @@ class FCN(AbstractModelClass):
x_in
=
keras
.
layers
.
Dense
(
n_hidden
)(
x_in
)
x_in
=
self
.
activation
()(
x_in
)
x_in
=
keras
.
layers
.
Dense
(
self
.
_output_shape
)(
x_in
)
out
=
self
.
activation
()(
x_in
)
out
=
self
.
activation
_output
()(
x_in
)
self
.
model
=
keras
.
Model
(
inputs
=
x_input
,
outputs
=
[
out
])
def
set_compile_options
(
self
):
Loading