/** * @brief Update the neural net during training * @param net Backprop neural net object */ void bp_update(bp * net, int current_hidden_layer) { bp_dropouts(net); bp_feed_forward(net); bp_backprop(net, current_hidden_layer); bp_learn(net, current_hidden_layer); bp_clear_dropouts(net); }
int bp_learn_module(char *module) { bp_param_s *bp; exaple_info_s *info; bp_example_s *exam; int node_cnt[4] = {2,5,3,2}; bp = (bp_param_s*)malloc(sizeof(bp_param_s)); bp_example_read(module); bp_example_print(); info = bp_example_info(); bp_create(bp,4,node_cnt); bp_set_err_limit(bp,0.000002f); bp_set_learn_factor(bp,0.002f); bp_param_print(bp); bp_learn(bp,info->exam,info->exa_cnt); bp_param_print(bp); bp_param_write(bp,module); }