DataFES.java
1.77 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
59
60
61
62
63
64
65
66
67
68
69
70
71
package is2.data;
import java.util.Arrays;
final public class DataFES {
final public short typesLen;
final public int len;
// first order features
final public float[][] pl;
// remove !!!!
// final public float[][] highestLab;
// final public FV[][][] label;
final public float[][][] lab;
public FV fv;
final public float[][][][] sib;
final public float[][][][] gra;
public DataFES(int length, short types) {
typesLen = types;
len = length;
pl = new float[length][length];
lab = new float[length][length][types];
sib = new float[length][length][length][];
gra = new float[length][length][length][];
}
public void print2DFloatArray(float[][] a, String name) {
for(int i = 0; i < a.length; ++i)
if(a[i] != null)
for(int j = 0; j < a[i].length; ++j)
System.out.println(name + "[" + i + "][" + j + "] = " + a[i][j]);
}
public void print3DFloatArray(float[][][] a, String name) {
for(int i = 0; i < a.length; ++i)
if(a[i] != null)
for(int j = 0; j < a[i].length; ++j)
if(a[i][j] != null)
System.out.println(name + "[" + i + "][" + j + "] = " + Arrays.toString(a[i][j]));
}
public void print4DFloatArray(float[][][][] a, String name) {
for(int i = 0; i < a.length; ++i)
if(a[i] != null)
for(int j = 0; j < a[i].length; ++j)
if(a[i][j] != null)
for(int k = 0; k < a[i][j].length; ++k)
if(a[i][j][k] != null)
System.out.println(name + "[" + i + "][" + j + "][" + k + "] = " + Arrays.toString(a[i][j][k]));
}
public void print() {
System.out.println("typesLen = " + typesLen);
System.out.println("len = " + len);
print2DFloatArray(pl, "pl");
print3DFloatArray(lab, "lab");
System.out.println("fv = a feature vector");
print4DFloatArray(sib, "sib");
print4DFloatArray(gra, "gra");
}
}