@@ -30,13 +30,13 @@ void store_the_net_layers(int signo)
3030{
3131 if ( SIGINT == signo ) {
3232 if ( model_layers != NULL ){
33- lstm_store (STD_LOADABLE_NET_NAME , & set ,
33+ lstm_store (params . store_network_name_raw , & set ,
3434 model_layers , params .layers );
35- lstm_store_net_layers_as_json (model_layers , STD_JSON_NET_NAME , JSON_KEY_NAME_SET , & set , params .layers );
35+ lstm_store_net_layers_as_json (model_layers , params . store_network_name_json , JSON_KEY_NAME_SET , & set , params .layers );
3636 printf ("\nStored the net as: '%s'\nYou can use that file in the .html interface.\n" ,
37- STD_JSON_NET_NAME );
37+ params . store_network_name_json );
3838 printf ("The net in its raw format is stored as: '%s'.\nYou can use that with the -r flag \
39- to continue refining the weights.\n" , STD_LOADABLE_NET_NAME );
39+ to continue refining the weights.\n" , params . store_network_name_raw );
4040 } else {
4141 printf ("\nFailed to store the net!\n" );
4242 exit (-1 );
@@ -65,6 +65,7 @@ void usage(char *argv[]) {
6565 printf (" -out: number of characters to output directly, note: a network and a datafile must be provided.\r\n" );
6666 printf (" -L : Number of layers, may not exceed %d\r\n" , LSTM_MAX_LAYERS );
6767 printf (" -N : Number of neurons in every layer\r\n" );
68+ printf (" -vr : Verbosity level. Set to zero and only the loss function after and not during training will be printed.\n" );
6869 printf ("\r\n" );
6970 printf ("Check std_conf.h to see what default values are used, these are set during compilation.\r\n" );
7071 printf ("\r\n" );
@@ -124,6 +125,8 @@ void parse_input_args(int argc, char** argv)
124125 if ( params .layers > LSTM_MAX_LAYERS ) {
125126 usage (argv );
126127 }
128+ } else if ( !strcmp (argv [a ], "-vr" ) ) {
129+ params .print_progress = !!atoi (argv [a + 1 ]);
127130 }
128131
129132 a += 2 ;
@@ -192,7 +195,7 @@ int main(int argc, char *argv[])
192195 params .store_progress_every_x_iterations = STORE_PROGRESS_EVERY_X_ITERATIONS ;
193196 params .store_progress_file_name = PROGRESS_FILE_NAME ;
194197 params .store_network_name_raw = STD_LOADABLE_NET_NAME ;
195- params .store_network_name_json = STD_LOADABLE_NET_NAME ;
198+ params .store_network_name_json = STD_JSON_NET_NAME ;
196199 params .store_char_indx_map_name = JSON_KEY_NAME_SET ;
197200
198201 srand ( time ( NULL ) );
@@ -336,6 +339,7 @@ Reallocating space in network input and output layer to accommodate this new fea
336339 lstm_output_string_from_string (model_layers , & set , argv [5 ], params .layers , 128 );
337340
338341 } else {
342+ double loss ;
339343
340344 assert (params .layers > 0 );
341345
@@ -362,9 +366,11 @@ Reallocating space in network input and output layer to accommodate this new fea
362366 file_size ,
363367 X_train ,
364368 Y_train ,
365- params .layers
369+ params .layers ,
370+ & loss
366371 );
367372
373+ printf ("Loss after training: %lf\n" , loss );
368374 }
369375
370376 free (model_layers );
0 commit comments