@@ -14,7 +14,7 @@ public async Task Train()
1414 CudaBlas . Instance . Initialize ( ) ;
1515 TiledNet net = new TiledNet ( 512 , 6144 , 3 , 0.01d , 4d ) ;
1616 await net . Initialize ( ) ;
17- // net.ApplyWeights();
17+ net . ApplyWeights ( ) ;
1818
1919 var pngFiles = Directory . GetFiles ( @"E:\images\inputs\svg" , "*.png" ) ;
2020
@@ -106,18 +106,20 @@ await files.WithRepeatAsync(async (pngFile, token) =>
106106 //}
107107
108108
109- //Console.WriteLine($"Iteration {i} Output X: {output[0, 0]}, Output Y: {output[0, 1]}, Grad: {gradient[0, 0]}, {gradient[0, 1]}");
110- //Console.WriteLine($"Loss: {loss[0, 0]}, Perc: {perc}");
109+ Console . WriteLine ( $ "Iteration { i } ") ;
110+ Console . WriteLine ( $ "Loss: { lossAndGradient [ 0 , 0 ] . Item1 [ 0 , 0 ] } , { lossAndGradient [ 0 , 1 ] . Item1 [ 0 , 0 ] } , { lossAndGradient [ 0 , 2 ] . Item1 [ 0 , 0 ] } ") ;
111+ Console . WriteLine ( $ "Loss: { lossAndGradient [ 1 , 0 ] . Item1 [ 0 , 0 ] } , { lossAndGradient [ 1 , 1 ] . Item1 [ 0 , 0 ] } , { lossAndGradient [ 1 , 2 ] . Item1 [ 0 , 0 ] } ") ;
112+ Console . WriteLine ( $ "Loss: { lossAndGradient [ 2 , 0 ] . Item1 [ 0 , 0 ] } , { lossAndGradient [ 2 , 1 ] . Item1 [ 0 , 0 ] } , { lossAndGradient [ 2 , 2 ] . Item1 [ 0 , 0 ] } ") ;
111113 //Console.WriteLine($"O1 X: {o1[0, 0]}, O1 Y: {o1[0, 1]}, Loss: {loss[0, 0]}, {loss0[0, 0]}, {loss1[0, 0]}");
112- await net . Backward ( lossAndGradient ) ;
113- net . ApplyGradients ( ) ;
114+ // await net.Backward(lossAndGradient);
115+ // net.ApplyGradients();
114116 //}
115117
116118 await net . Reset ( ) ;
117119 Thread . Sleep ( 1000 ) ;
118120 if ( i % 11 == 10 )
119121 {
120- net . SaveWeights ( ) ;
122+ // net.SaveWeights();
121123 }
122124
123125 //if (token.UsageCount == 0)
0 commit comments