@@ -18,15 +18,15 @@ public class SequentialModelSave
1818 [ TestMethod ]
1919 public void SimpleModelFromAutoCompile ( )
2020 {
21- var inputs = tf . keras . layers . Input ( ( 28 , 28 , 1 ) ) ;
22- var x = tf . keras . layers . Flatten ( ) . Apply ( inputs ) ;
23- x = tf . keras . layers . Dense ( 100 , activation : tf . nn . relu ) . Apply ( x ) ;
24- x = tf . keras . layers . Dense ( units : 10 ) . Apply ( x ) ;
25- var outputs = tf . keras . layers . Softmax ( axis : 1 ) . Apply ( x ) ;
26- var model = tf . keras . Model ( inputs , outputs ) ;
21+ var inputs = keras . layers . Input ( ( 28 , 28 , 1 ) ) ;
22+ var x = keras . layers . Flatten ( ) . Apply ( inputs ) ;
23+ x = keras . layers . Dense ( 100 , activation : tf . nn . relu ) . Apply ( x ) ;
24+ x = keras . layers . Dense ( units : 10 ) . Apply ( x ) ;
25+ var outputs = keras . layers . Softmax ( axis : 1 ) . Apply ( x ) ;
26+ var model = keras . Model ( inputs , outputs ) ;
2727
2828 model . compile ( new Adam ( 0.001f ) ,
29- tf . keras . losses . SparseCategoricalCrossentropy ( ) ,
29+ keras . losses . SparseCategoricalCrossentropy ( ) ,
3030 new string [ ] { "accuracy" } ) ;
3131
3232 var data_loader = new MnistModelLoader ( ) ;
@@ -37,7 +37,7 @@ public void SimpleModelFromAutoCompile()
3737 {
3838 TrainDir = "mnist" ,
3939 OneHot = false ,
40- ValidationSize = 10000 ,
40+ ValidationSize = 58000 ,
4141 } ) . Result ;
4242
4343 model . fit ( dataset . Train . Data , dataset . Train . Labels , batch_size , num_epochs ) ;
@@ -69,7 +69,7 @@ public void SimpleModelFromSequential()
6969 {
7070 TrainDir = "mnist" ,
7171 OneHot = false ,
72- ValidationSize = 50000 ,
72+ ValidationSize = 58000 ,
7373 } ) . Result ;
7474
7575 model . fit ( dataset . Train . Data , dataset . Train . Labels , batch_size , num_epochs ) ;
0 commit comments