
Back-propagation Implementation 233
bp.mse /= bp.env.max_tra_pat;
if ((++bp.env.cur_gen) < bp.env.max_gen) // add error criterion later
{
bp.mse = 0.0; //clear mean squared error
bp_cur_state = BP_UPDATE_LEARNING_RATE;
}
else
{
bp_cur_state = BP_TRAINING_DONE;
}
}
In the two states, BP_UPDATE_LEARNING_RATE and BP_UPDATE_
MOMENTUM_RATE
, if a dynamic learning rate and/or momentum rate are
used, then the new learning rate and momentum rate are updated. In our implemen-
tation, rates are fixed. Therefore, these two state handler routines do nothing except
transition the current state to state
BP_UPDATE_MOMENTUM_RATE and state
BP_GET_PATTERN, respectively.
In the