Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
J
java-wowa-training
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
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
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
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cylab
java-wowa-training
Commits
6f92c1d3
Commit
6f92c1d3
authored
5 years ago
by
a.croix
Browse files
Options
Downloads
Patches
Plain Diff
Add setters in HyperParemeters class
parent
f1e30dbf
No related branches found
Branches containing commit
No related tags found
1 merge request
!4
Neural network
Pipeline
#2268
failed
5 years ago
Stage: leaks
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/main/java/be/cylab/java/wowa/training/HyperParameters.java
+53
-6
53 additions, 6 deletions
...ain/java/be/cylab/java/wowa/training/HyperParameters.java
with
53 additions
and
6 deletions
src/main/java/be/cylab/java/wowa/training/HyperParameters.java
+
53
−
6
View file @
6f92c1d3
...
@@ -27,11 +27,11 @@ public class HyperParameters {
...
@@ -27,11 +27,11 @@ public class HyperParameters {
final
OptimizationAlgorithm
algorithm
,
final
OptimizationAlgorithm
algorithm
,
final
Activation
activation_function
,
final
Activation
activation_function
,
final
double
percent_test_train
)
{
final
double
percent_test_train
)
{
this
.
n
eurons
_n
umber
=
neurons_number
;
setN
eurons
N
umber
(
neurons_number
)
;
this
.
l
earning
_r
ate
=
learning_rate
;
setL
earning
R
ate
(
learning_rate
)
;
this
.
a
lgorithm
=
algorithm
;
setA
lgorithm
(
algorithm
)
;
this
.
a
ctivation
_f
unction
=
activation_function
;
setA
ctivation
F
unction
(
activation_function
)
;
this
.
p
ercent
_t
est
_t
rain
=
percent_test_train
;
setP
ercent
T
est
T
rain
(
percent_test_train
)
;
}
}
/**
/**
...
@@ -47,7 +47,7 @@ public class HyperParameters {
...
@@ -47,7 +47,7 @@ public class HyperParameters {
final
OptimizationAlgorithm
algorithm
,
final
OptimizationAlgorithm
algorithm
,
final
Activation
activation_function
)
{
final
Activation
activation_function
)
{
this
(
neurons_number
,
learning_rate
,
algorithm
,
this
(
neurons_number
,
learning_rate
,
algorithm
,
activation_function
,
100
);
activation_function
,
99
);
}
}
/**
/**
...
@@ -89,4 +89,51 @@ public class HyperParameters {
...
@@ -89,4 +89,51 @@ public class HyperParameters {
public
final
double
getPercentTestTrain
()
{
public
final
double
getPercentTestTrain
()
{
return
percent_test_train
;
return
percent_test_train
;
}
}
/**
* @param neurons_number
*/
public
void
setNeuronsNumber
(
final
int
neurons_number
)
{
if
(
neurons_number
<
5
||
neurons_number
>
80
)
{
throw
new
IllegalArgumentException
(
"Neuron number must be between 5 and 80"
);
}
this
.
neurons_number
=
neurons_number
;
}
/**
* @param learning_rate
*/
public
void
setLearningRate
(
final
double
learning_rate
)
{
if
(
learning_rate
<=
0.0
||
learning_rate
>=
1.0
)
{
throw
new
IllegalArgumentException
(
"Learning rate must be between 0 and 1"
);
}
this
.
learning_rate
=
learning_rate
;
}
/**
* @param algorithm
*/
public
void
setAlgorithm
(
final
OptimizationAlgorithm
algorithm
)
{
this
.
algorithm
=
algorithm
;
}
/**
* @param activation_function
*/
public
void
setActivationFunction
(
final
Activation
activation_function
)
{
this
.
activation_function
=
activation_function
;
}
/**
* @param percent_test_train
*/
public
void
setPercentTestTrain
(
final
double
percent_test_train
)
{
if
(
percent_test_train
<=
0
||
percent_test_train
>=
100
)
{
throw
new
IllegalArgumentException
(
"Percentage of train must be between 0 and 100"
);
}
this
.
percent_test_train
=
percent_test_train
;
}
}
}
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