poblano_toolbox icon indicating copy to clipboard operation
poblano_toolbox copied to clipboard

ncg: create test for negative inner product update

Open dmdunla opened this issue 6 years ago • 1 comments

In all update types except Steepest Descent, a check on the sign of an vector inner product is checked:

                  if gkTgkold > 0
                        bk = ...;
                    else
                        fprintf(1,[mfilename,': warning: bk set to 0\n']);
                        bk = 0;
                    end

Currently, there is no test which reaches the else clause. A function and starting point should be identified which exercises this code.

dmdunla avatar Apr 28 '19 22:04 dmdunla

This code is unreachable. Since gkTgkold is the value of gkTgk from the previous iteration, which is the inner product of the gradient with itself, it will never be negative. Also, if gkTgk is 0 then poblano_out will return. So `gkTgkold is always positive.

These check can be removed.

dmdunla avatar May 04 '19 17:05 dmdunla