Changed initialization of weights to gaussian distributed values and biases to 1 (this helps (Leaky)ReLu and doesn't seem hurt tanh yet)
This commit is contained in:
parent
281b42b0fb
commit
f1ca0a9e54
1 changed files with 2 additions and 5 deletions
|
@ -14,11 +14,8 @@ public class FCLayer extends Layer {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initialize(int inputSize) {
|
private void initialize(int inputSize) {
|
||||||
Random random = new Random();
|
this.weights = Utilities.gaussianMatrix(inputSize, numNeurons, 0, 1, 0.1d);
|
||||||
this.weights = new SimpleMatrix(inputSize, numNeurons, true,
|
this.biases = Utilities.ones(1, numNeurons);
|
||||||
random.doubles((long) inputSize*numNeurons, -1, 1).toArray());
|
|
||||||
this.biases = new SimpleMatrix(1, numNeurons, true,
|
|
||||||
random.doubles(numNeurons, -1, 1).toArray());
|
|
||||||
this.isInitialized = true;
|
this.isInitialized = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue