<s> from __future__ import absolute_import <EOL> import itertools <EOL> from climin import Lbfgs <EOL> from . losses import Quadratic , LogisticRegression , Rosenbrock <EOL> def test_lbfgs_quadratic ( ) : <EOL> obj = Quadratic ( ) <EOL> opt = Lbfgs ( obj . pars , obj . f , obj . fprime ) <EOL> for i , info in enumerate ( opt ) : <EOL> if i > <NUM_LIT:50> : <EOL> break <EOL> assert obj . solved ( ) , '<STR_LIT>' <EOL> def test_lbfgs_rosen ( ) : <EOL> obj = Rosenbrock ( ) <EOL> opt = Lbfgs ( obj . pars , obj . f , obj . fprime ) <EOL> for i , info in enumerate ( opt ) : <EOL> if i > <NUM_LIT:50> : <EOL> break <EOL> assert obj . solved ( ) , '<STR_LIT>' <EOL> def test_lbfgs_lr ( ) : <EOL> obj = LogisticRegression ( seed = <NUM_LIT> ) <EOL> args = itertools . repeat ( ( ( obj . X , obj . Z ) , { } ) ) <EOL> opt = Lbfgs ( obj . pars , obj . f , obj . fprime , args = args ) <EOL> for i , info in enumerate ( opt ) : <EOL> if i > <NUM_LIT:100> : <EOL> break <EOL> assert obj . solved ( ) , '<STR_LIT>' </s>
