Increased range of inital weights and biases to improve results

This commit is contained in:
lluni 2022-05-22 01:17:06 +02:00
parent 5aa9313776
commit 8376c00470
2 changed files with 3 additions and 8 deletions

View file

@ -5,13 +5,8 @@
</component>
<component name="ChangeListManager">
<list default="true" id="75a8c215-b746-4a4d-aa16-f3223c12b1ed" name="Changes" comment="Commented out not yet working code">
<change afterPath="$PROJECT_DIR$/src/main/java/ActivationFunctions.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/main/java/LossFunctions.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/gradle.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/gradle.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ActivationLayer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ActivationLayer.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/ExampleXOR.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/ExampleXOR.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/Network.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/Network.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/main/java/FCLayer.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/main/java/FCLayer.java" afterDir="false" />
</list>
<option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" />

View file

@ -9,9 +9,9 @@ public class FCLayer extends Layer {
public FCLayer(int inputSize, int outputSize) {
Random random = new Random();
weights = new SimpleMatrix(inputSize, outputSize, true,
random.doubles((long) inputSize*outputSize, -0.5, 0.5).toArray());
random.doubles((long) inputSize*outputSize, -1, 1).toArray());
biases = new SimpleMatrix(1, outputSize, true,
random.doubles(outputSize, -0.5, 0.5).toArray());
random.doubles(outputSize, -1, 1).toArray());
}
@Override