- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfullyconnectedexample.java
More file actions
Latest commit
28 lines (24 loc) · 711 Bytes
/
Copy pathfullyconnectedexample.java
File metadata and controls
28 lines (24 loc) · 711 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
importtensordef.tensorgraph;
importtensordef.tensorarray;
importtensordef.add_tensorarray;
importtensordef.mul_tensorarray;
importtensordef.dot;
importtensordef.sigmoid;
publicclassfullyconnectedexample
{
publicstaticvoidmain(Stringargs[])
{
tensorgraphmod=newtensorgraph();
tensorarrayt1=newtensorarray(25,20,false);
tensorarrayw1=newtensorarray(20,10,true);
tensorarrayeval1=newtensorarray(25,10,false);
tensorarrayeval2=newtensorarray(25,10,false);
System.out.println(t1.arr[0][0].grad);
dotfc1=newdot(t1,w1,mod);
eval1=fc1.forward();
sigmoidact1=newsigmoid(eval1,mod);
eval2=act1.forward();
mod.backward();
System.out.println(t1.arr[0][0].grad);
}
}