You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by pt...@apache.org on 2018/01/17 07:24:16 UTC

[6/8] ignite git commit: IGNITE-7397: Fix wrong cache configuration for MLP training data

IGNITE-7397: Fix wrong cache configuration for MLP training data

this closes #3367


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/8b5d12b9
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/8b5d12b9
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/8b5d12b9

Branch: refs/heads/ignite-2.4
Commit: 8b5d12b9e2c7a7d56c15f9d38bab6320c05e07e4
Parents: 7274c15
Author: artemmalykh <am...@gridgain.com>
Authored: Tue Jan 16 15:15:49 2018 +0300
Committer: Yury Babak <yb...@gridgain.com>
Committed: Tue Jan 16 15:15:49 2018 +0300

----------------------------------------------------------------------
 .../ml/nn/MLPGroupUpdateTrainerCacheInput.java  | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/8b5d12b9/modules/ml/src/main/java/org/apache/ignite/ml/nn/MLPGroupUpdateTrainerCacheInput.java
----------------------------------------------------------------------
diff --git a/modules/ml/src/main/java/org/apache/ignite/ml/nn/MLPGroupUpdateTrainerCacheInput.java b/modules/ml/src/main/java/org/apache/ignite/ml/nn/MLPGroupUpdateTrainerCacheInput.java
index 05f52e1..783effa 100644
--- a/modules/ml/src/main/java/org/apache/ignite/ml/nn/MLPGroupUpdateTrainerCacheInput.java
+++ b/modules/ml/src/main/java/org/apache/ignite/ml/nn/MLPGroupUpdateTrainerCacheInput.java
@@ -60,7 +60,7 @@ public class MLPGroupUpdateTrainerCacheInput extends AbstractMLPGroupUpdateTrain
     /**
      * Random number generator.
      */
-    private final Random rand;
+    private Random rand;
 
     /**
      * Construct instance of this class with given parameters.
@@ -80,7 +80,6 @@ public class MLPGroupUpdateTrainerCacheInput extends AbstractMLPGroupUpdateTrain
         this.batchSize = batchSize;
         this.cache = cache;
         this.mlp = new MultilayerPerceptron(arch, init);
-        this.rand = rand;
     }
 
     /**
@@ -98,14 +97,14 @@ public class MLPGroupUpdateTrainerCacheInput extends AbstractMLPGroupUpdateTrain
         this(arch, init, networksCnt, cache, batchSize, new Random());
     }
 
-    /**
-     * Construct instance of this class with given parameters and default initializer.
-     *
-     * @param arch Architecture of multilayer perceptron.
-     * @param networksCnt Count of networks to be trained in parallel by {@link MLPGroupUpdateTrainer}.
-     * @param cache Cache with labeled vectors.
-     * @param batchSize Size of batch to return on each training iteration.
-     */
+        /**
+         * Construct instance of this class with given parameters and default initializer.
+         *
+         * @param arch Architecture of multilayer perceptron.
+         * @param networksCnt Count of networks to be trained in parallel by {@link MLPGroupUpdateTrainer}.
+         * @param cache Cache with labeled vectors.
+         * @param batchSize Size of batch to return on each training iteration.
+         */
     public MLPGroupUpdateTrainerCacheInput(MLPArchitecture arch, int networksCnt,
         IgniteCache<Integer, LabeledVector<Vector, Vector>> cache,
         int batchSize) {
@@ -116,7 +115,7 @@ public class MLPGroupUpdateTrainerCacheInput extends AbstractMLPGroupUpdateTrain
     @Override public IgniteSupplier<IgniteBiTuple<Matrix, Matrix>> batchSupplier() {
         String cName = cache.getName();
         int bs = batchSize;
-        Random r = rand; // IMPL NOTE this is intended to make below lambda more lightweight.
+        Random r = rand;
 
         return () -> {
             Ignite ignite = Ignition.localIgnite();