Skip to content

Commit

Permalink
Fix deviations from official iRProp- algorithm.
Browse files Browse the repository at this point in the history
The iRProp- algorithm as given in its original paper does not have
weight-backtracking: If the sign of the derivative changes in an
iteration, the weights should not be updated at all.
  • Loading branch information
Nico Madysa committed Jul 24, 2018
1 parent b211dc3 commit bf2c76a
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/fann_train.c
Original file line number Diff line number Diff line change
Expand Up @@ -734,15 +734,15 @@ void fann_update_weights_irpropm(struct fann *ann, unsigned int first_weight, un

same_sign = prev_slope * slope;

if(same_sign >= 0.0)
if(same_sign > 0.0)
next_step = fann_min(prev_step * increase_factor, delta_max);
else
else if(same_sign < 0.0)
{
next_step = fann_max(prev_step * decrease_factor, delta_min);
slope = 0;
}

if(slope < 0)
if(slope < 0.0)
{
weights[i] -= next_step;
if(weights[i] < -1500)
Expand Down

0 comments on commit bf2c76a

Please sign in to comment.