Skip to content

Commit 1030e3b

Browse files
committed
#181: Make randomize(seed) actually use the seed.
1 parent 5067a80 commit 1030e3b

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

src/main/java/org/encog/neural/networks/BasicNetwork.java

+3-6
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
import org.encog.engine.network.activation.ActivationFunction;
3030
import org.encog.engine.network.activation.ActivationSigmoid;
3131
import org.encog.engine.network.activation.ActivationTANH;
32+
import org.encog.mathutil.randomize.ConsistentRandomizer;
3233
import org.encog.mathutil.randomize.NguyenWidrowRandomizer;
3334
import org.encog.mathutil.randomize.Randomizer;
3435
import org.encog.mathutil.randomize.RangeRandomizer;
@@ -619,16 +620,12 @@ public void reset() {
619620

620621
/**
621622
* Reset the weight matrix and the bias values. This will use a
622-
* Nguyen-Widrow randomizer with a range between -1 and 1. If the network
623-
* does not have an input, output or hidden layers, then Nguyen-Widrow
624-
* cannot be used and a simple range randomize between -1 and 1 will be
625-
* used. Use the specified seed.
623+
* RangeRandomizer with a range between -1 and 1.
626624
*
627625
*/
628626
@Override
629627
public void reset(final int seed) {
630-
Randomizer randomizer = getRandomizer();
631-
randomizer.randomize(this);
628+
(new ConsistentRandomizer(-1,1,seed)).randomize(this);
632629
}
633630

634631
/**

0 commit comments

Comments
 (0)