@@ -935,28 +935,28 @@ NeuralNetworkOptions NeuralNetworkSerializer::get_and_build_options(const TinyJS
935935 const auto learning_rate_warmup_start = options_object->get_or <double >(" learning-rate-warmup-start" , 0.0 );
936936 const auto learning_rate_warmup_target = options_object->get_or <double >(" learning-rate-warmup-target" , 0.0 );
937937
938- const auto number_of_epoch = options_object->get < int >(" number-of-epoch" );
939- const auto batch_size = options_object->get < int >(" batch-size" );
940- const auto data_is_unique = options_object->get <bool >(" data-is-unique" );
938+ const auto number_of_epoch = static_cast < int >( options_object->get_or < long long >(" number-of-epoch" , 1 ) );
939+ const auto batch_size = static_cast < int >( options_object->get_or < long long >(" batch-size" , 1 ) );
940+ const auto data_is_unique = options_object->get_or <bool >(" data-is-unique" , false );
941941 const auto number_of_threads = options_object->get_or <int >(" number-of-threads" , 0 );
942942 const auto learning_rate_decay_rate = options_object->get_or <double >(" learning-rate-decay-rate" , 0.0 );
943- const auto adaptive_learning_rate = options_object->get <bool >(" adaptive-learning-rate" );
943+ const auto adaptive_learning_rate = options_object->get_or <bool >(" adaptive-learning-rate" , false );
944944 const auto optimiser_type_string = options_object->try_get_string (" optimiser-type" );
945945 (void )optimiser_type_string;
946946
947947 const auto learning_rate_restart_rate = options_object->get_or <double >(" learning-rate-restart-rate" , 0.0 );
948948 const auto learning_rate_restart_boost = options_object->get_or <double >(" learning-rate-restart-boost" , 0.0 );
949- const auto residual_layer_jump = options_object->get < int >(" residual-layer-jump" );
949+ const auto residual_layer_jump = static_cast < int >( options_object->get_or < long long >(" residual-layer-jump" , - 1 ) );
950950 const auto clip_threshold = options_object->get_or <double >(" clip-threshold" , 1.0 );
951- const auto shuffle_training_data = options_object->get <bool >(" shuffle-training-data" );
951+ const auto shuffle_training_data = options_object->get_or <bool >(" shuffle-training-data" , true );
952952 const auto hidden_layers = get_hidden_layers (*options_object);
953953 const auto output_layer_details = get_output_layer_details (*options_object);
954954 const auto multi_output_layer_details = get_multi_output_layer_details (*options_object);
955955
956- const auto enable_bptt = options_object->get <bool >(" enable-bptt" );
956+ const auto enable_bptt = options_object->get_or <bool >(" enable-bptt" , false );
957957 const auto bptt_max_ticks = options_object->get_or <int >(" bptt-max-ticks" , 0 );
958- const auto shuffle_bptt_batches = options_object->get <bool >(" shuffle-bptt-batches" );
959- const auto has_bias = options_object->get <bool >(" has-bias" );
958+ const auto shuffle_bptt_batches = options_object->get_or <bool >(" shuffle-bptt-batches" , true );
959+ const auto has_bias = options_object->get_or <bool >(" has-bias" , true );
960960
961961 const auto output_error_calculation_type_string = options_object->try_get_string (" output-error-calculation-type" );
962962 (void )output_error_calculation_type_string;
0 commit comments