-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathVisuals.java
More file actions
58 lines (45 loc) · 1.67 KB
/
Visuals.java
File metadata and controls
58 lines (45 loc) · 1.67 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package code.NN;
import code.Lets_Go_Champ.DQN;
import java.io.Serializable;
import java.util.Arrays;
/**
* @author Alexandre Martens
*/
public class Visuals extends NeuralNet implements Serializable {
// Print the weights of the nn
public static void printWeights(Layer[] layers, int layerN){
for (int i = 0; i < layers[layerN].neurons.length; i++){
System.out.println(Arrays.toString(layers[layerN].neurons[i].weights));
}
System.out.println("- - - - -");
}
public static void printAllWeights(Layer[] layers){
for (int i = 0; i < layers.length; i++){
for (int j = 0; j < layers[i].neurons.length; j++){
System.out.println(Arrays.toString(layers[i].neurons[j].weights));
}
}
System.out.println("- - - - -");
}
// Print the bias of the nn
public static void printBias(Layer[] layers){
for (int i = 0; i < layers.length; i++){
for (int j = 0; j < layers[i].neurons.length; j++){
System.out.println(layers[i].neurons[j].bias);
}
}
System.out.println("- - - - -");
}
public static void printNeuronValue(Layer[] layers, int layerN){
for (int i = 0; i < layers[layerN].neurons.length; i++){
System.out.println(layers[layerN].neurons[i].value);
}
}
public static void printDQN(DQN nn){
Layer neuralnet = nn.getNn().layers[2];
System.out.println(Arrays.toString(neuralnet.neurons[4].weights));
/*for (int i = 0; i < neuralnet.neurons.length; i++){
System.out.println(Arrays.toString(neuralnet.neurons[i].weights));
}*/
}
}