Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KerasROOTClassification
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
Eric.Schanet
KerasROOTClassification
Commits
71e626f2
Commit
71e626f2
authored
6 years ago
by
Nikolai
Browse files
Options
Downloads
Patches
Plain Diff
output layer activation configurable
parent
4bd10c9b
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
toolkit.py
+5
-1
5 additions, 1 deletion
toolkit.py
with
5 additions
and
1 deletion
toolkit.py
+
5
−
1
View file @
71e626f2
...
@@ -81,6 +81,8 @@ class ClassificationProject(object):
...
@@ -81,6 +81,8 @@ class ClassificationProject(object):
:param activation_function: activation function in the hidden layers
:param activation_function: activation function in the hidden layers
:param activation_function_output: activation function in the output layer
:param out_dir: base directory in which the project directories should be stored
:param out_dir: base directory in which the project directories should be stored
:param scaler_type: sklearn scaler class name to transform the data before training (options:
"
StandardScaler
"
,
"
RobustScaler
"
)
:param scaler_type: sklearn scaler class name to transform the data before training (options:
"
StandardScaler
"
,
"
RobustScaler
"
)
...
@@ -136,6 +138,7 @@ class ClassificationProject(object):
...
@@ -136,6 +138,7 @@ class ClassificationProject(object):
batch_size
=
128
,
batch_size
=
128
,
validation_split
=
0.33
,
validation_split
=
0.33
,
activation_function
=
'
relu
'
,
activation_function
=
'
relu
'
,
activation_function_output
=
'
sigmoid
'
,
project_dir
=
None
,
project_dir
=
None
,
scaler_type
=
"
RobustScaler
"
,
scaler_type
=
"
RobustScaler
"
,
step_signal
=
2
,
step_signal
=
2
,
...
@@ -158,6 +161,7 @@ class ClassificationProject(object):
...
@@ -158,6 +161,7 @@ class ClassificationProject(object):
self
.
batch_size
=
batch_size
self
.
batch_size
=
batch_size
self
.
validation_split
=
validation_split
self
.
validation_split
=
validation_split
self
.
activation_function
=
activation_function
self
.
activation_function
=
activation_function
self
.
activation_function_output
=
activation_function_output
self
.
scaler_type
=
scaler_type
self
.
scaler_type
=
scaler_type
self
.
step_signal
=
step_signal
self
.
step_signal
=
step_signal
self
.
step_bkg
=
step_bkg
self
.
step_bkg
=
step_bkg
...
@@ -440,7 +444,7 @@ class ClassificationProject(object):
...
@@ -440,7 +444,7 @@ class ClassificationProject(object):
for
layer_number
in
range
(
self
.
layers
-
1
):
for
layer_number
in
range
(
self
.
layers
-
1
):
self
.
_model
.
add
(
Dense
(
self
.
nodes
,
activation
=
self
.
activation_function
))
self
.
_model
.
add
(
Dense
(
self
.
nodes
,
activation
=
self
.
activation_function
))
# last layer is one neuron (binary classification)
# last layer is one neuron (binary classification)
self
.
_model
.
add
(
Dense
(
1
,
activation
=
'
sigmoid
'
))
self
.
_model
.
add
(
Dense
(
1
,
activation
=
self
.
activation_function_output
))
logger
.
info
(
"
Using {}(**{}) as Optimizer
"
.
format
(
self
.
optimizer
,
self
.
optimizer_opts
))
logger
.
info
(
"
Using {}(**{}) as Optimizer
"
.
format
(
self
.
optimizer
,
self
.
optimizer_opts
))
Optimizer
=
getattr
(
keras
.
optimizers
,
self
.
optimizer
)
Optimizer
=
getattr
(
keras
.
optimizers
,
self
.
optimizer
)
optimizer
=
Optimizer
(
**
self
.
optimizer_opts
)
optimizer
=
Optimizer
(
**
self
.
optimizer_opts
)
...
...
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