ERROR: assertion failed: lsr.slope[ib] < 0
in bisect! at /pathtojulia/.julia/v0.3/Optim/src/linesearch/hz_linesearch.jl:577
in hz_linesearch! at /pathtojulia/.julia/v0.3/Optim/src/linesearch/hz_linesearch.jl:273
in hz_linesearch! at /pathtojulia/.julia/v0.3/Optim/src/linesearch/hz_linesearch.jl:201
in bfgs at /pathtojulia/.julia/v0.3/Optim/src/bfgs.jl:121
in optimize at /pathtojulia/.julia/v0.3/Optim/src/optimize.jl:113
while loading /pathtocode/code.jl, in expression starting on line 229
I've seen this error message before, and its usually because I have a bug in my code that erroneously generates function values or gradients which are very large (i.e., 1e100). However, in this case I can confirm that the "x" I've passed to the optimizer is totally reasonable (abs value of all points less than 100), the function value at that x is reasonable (on the order of 1e6), the gradients are reasonable (between -100 and +100), and the entries in the approximate inverse Hessian are also reasonable (smallest abs value is about 1e-9, largest is about 7).
This isn't a failure on the first or second iteration of BFGS - it happens on the 34th iteration.
Unfortunately its pretty hard for me to share my code or data at the moment, so I understand that it might be challenging to solve this problem but any advice you guys can offer is appreciated!
-Thom