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
5f6a67f5
Commit
5f6a67f5
authored
6 years ago
by
a.croix
Browse files
Options
Downloads
Patches
Plain Diff
Fix some style issues
parent
cdb2830d
No related branches found
No related tags found
No related merge requests found
Pipeline
#1033
failed
6 years ago
Stage: test
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/java/be/cylab/java/wowa/training/TrainerParameters.java
+2
-2
2 additions, 2 deletions
...n/java/be/cylab/java/wowa/training/TrainerParameters.java
src/main/java/be/cylab/java/wowa/training/Utils.java
+13
-4
13 additions, 4 deletions
src/main/java/be/cylab/java/wowa/training/Utils.java
with
15 additions
and
6 deletions
src/main/java/be/cylab/java/wowa/training/TrainerParameters.java
+
2
−
2
View file @
5f6a67f5
...
@@ -46,7 +46,7 @@ public class TrainerParameters {
...
@@ -46,7 +46,7 @@ public class TrainerParameters {
* the algorithm stop
* the algorithm stop
*/
*/
public
TrainerParameters
(
public
TrainerParameters
(
Logger
logger
,
final
Logger
logger
,
final
int
population_size
,
final
int
population_size
,
final
int
crossover_rate
,
final
int
crossover_rate
,
final
int
mutation_rate
,
final
int
mutation_rate
,
...
@@ -129,7 +129,7 @@ public class TrainerParameters {
...
@@ -129,7 +129,7 @@ public class TrainerParameters {
* Getter for selection method.
* Getter for selection method.
* @return int
* @return int
*/
*/
int
getSelectionMethod
()
{
final
int
getSelectionMethod
()
{
return
selection_method
;
return
selection_method
;
}
}
...
...
This diff is collapsed.
Click to expand it.
src/main/java/be/cylab/java/wowa/training/Utils.java
+
13
−
4
View file @
5f6a67f5
package
be.cylab.java.wowa.training
;
package
be.cylab.java.wowa.training
;
import
javax.rmi.CORBA.Util
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Random
;
import
java.util.Random
;
public
class
Utils
{
/**
* Class Utils.
* Contain tools for Trainer algorithm
*/
public
final
class
Utils
{
private
Utils
()
{
}
/**
/**
* @param weights
* @param weights
* @return
* @return
*/
*/
public
static
double
[]
normalizeWeights
(
final
double
[]
weights
)
{
public
static
double
[]
normalizeWeights
(
final
double
[]
weights
)
{
double
sum_weight
=
Utils
.
sumArrayElements
(
weights
);
double
sum_weight
=
Utils
.
sumArrayElements
(
weights
);
double
[]
weights
N
ormalized
=
new
double
[
weights
.
length
];
double
[]
weights
_n
ormalized
=
new
double
[
weights
.
length
];
for
(
int
i
=
0
;
i
<
weights
.
length
;
i
++)
{
for
(
int
i
=
0
;
i
<
weights
.
length
;
i
++)
{
weights
N
ormalized
[
i
]
=
weights
[
i
]
/
sum_weight
;
weights
_n
ormalized
[
i
]
=
weights
[
i
]
/
sum_weight
;
}
}
return
weights
N
ormalized
;
return
weights
_n
ormalized
;
}
}
/**
/**
...
...
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