Skip to content
Snippets Groups Projects
Commit 7883dbae authored by a.croix's avatar a.croix
Browse files

Use String.matches istead of String ==

parent 6ecc8c06
No related branches found
No related tags found
1 merge request!4Neural network
Pipeline #1937 passed
......@@ -26,14 +26,14 @@ public final class MainDL4J {
OptimizationAlgorithm optimization_algorithm;
Activation activation_function;
if (args[2] == "CONJUGATE_GRADIENT") {
if (args[2].matches("CONJUGATE_GRADIENT")) {
optimization_algorithm = OptimizationAlgorithm.CONJUGATE_GRADIENT;
} else if (args[2] == "LBFGS") {
} else if (args[2].matches("LBFGS")) {
optimization_algorithm = OptimizationAlgorithm.LBFGS;
} else if (args[2] == "LINE_GRADIENT_DESCENT") {
} else if (args[2].matches("LINE_GRADIENT_DESCENT")) {
optimization_algorithm
= OptimizationAlgorithm.LINE_GRADIENT_DESCENT;
} else if (args[2] == "STOCHASTIC_GRADIENT_DESCENT") {
} else if (args[2].matches("STOCHASTIC_GRADIENT_DESCENT")) {
optimization_algorithm
= OptimizationAlgorithm.STOCHASTIC_GRADIENT_DESCENT;
} else {
......@@ -41,11 +41,11 @@ public final class MainDL4J {
"Not correct optimization algorithm");
}
if (args[3] == "RELU") {
if (args[3].matches("RELU")) {
activation_function = Activation.RELU;
} else if (args[3] == "SIGMOID") {
} else if (args[3].matches("SIGMOID")) {
activation_function = Activation.SIGMOID;
} else if (args[3] == "TANH") {
} else if (args[3].matches("TANH")) {
activation_function = Activation.TANH;
} else {
throw new IllegalArgumentException(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment