-
Notifications
You must be signed in to change notification settings - Fork 19
Expand file tree
/
Copy pathDataStep.java
More file actions
41 lines (33 loc) · 849 Bytes
/
Copy pathDataStep.java
File metadata and controls
41 lines (33 loc) · 849 Bytes
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
package datastructs;
import java.io.Serializable;
import matrix.Matrix;
public class DataStep implements Serializable {
private static final long serialVersionUID = 1L;
public Matrix input = null;
public Matrix targetOutput = null;
public DataStep() {
}
public DataStep(double[] input, double[] targetOutput) {
this.input = new Matrix(input);
if (targetOutput != null) {
this.targetOutput = new Matrix(targetOutput);
}
}
@Override
public String toString() {
String result = "";
for (int i = 0; i < input.w.length; i++) {
result += String.format("%.5f", input.w[i]) + "\t";
}
result += "\t->\t";
if (targetOutput != null) {
for (int i = 0; i < targetOutput.w.length; i++) {
result += String.format("%.5f", targetOutput.w[i]) + "\t";
}
}
else {
result += "___\t";
}
return result;
}
}