def test_Adam_Polyak_momentum_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(Adam(f=rosen, step_size=0.1, epochs=2000, momentum_type='polyak').minimize().x, rosen.x_star(), rtol=0.1)
def test_AdaMax_standard_momentum_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(AdaMax(f=rosen, step_size=0.1, epochs=2000, momentum_type='standard', momentum=0.3).minimize().x, rosen.x_star(), rtol=0.1)
def test_ConjugateGradient_Rosenbrock_HestenesStiefel(): rosen = Rosenbrock() assert np.allclose(ConjugateGradient(f=rosen, wf='hs', r_start=1).minimize().x, rosen.x_star(), rtol=0.1)
def test_ConjugateGradient_Rosenbrock_DaiYuan(): rosen = Rosenbrock() assert np.allclose(ConjugateGradient(f=rosen, wf='dy').minimize().x, rosen.x_star(), rtol=0.1)
def test_ConjugateGradient_Rosenbrock_FletcherReeves(): rosen = Rosenbrock() assert np.allclose(ConjugateGradient(f=rosen, wf='fr').minimize().x, rosen.x_star(), rtol=0.1)
def test_ConjugateGradient_Rosenbrock_PolakRibiere(): rosen = Rosenbrock() assert np.allclose(ConjugateGradient(f=rosen, wf='pr').minimize().x, rosen.x_star(), rtol=0.1)
def test_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(Newton(f=rosen).minimize().x, rosen.x_star())
def test_AMSGrad_nesterov_momentum_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(AMSGrad(f=rosen, momentum_type='nesterov').minimize().x, rosen.x_star(), rtol=0.1)
def test_Nadam_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(RMSProp(f=rosen, momentum_type='nesterov').minimize().x, rosen.x_star(), rtol=0.1)
def test_AdaGrad_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(AdaGrad(f=rosen).minimize().x, rosen.x_star(), rtol=0.1)
def test_RMSProp_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(RMSProp(f=rosen, epochs=1500).minimize().x, rosen.x_star(), rtol=0.1)
def test_RMSProp_Polyak_momentum_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(RMSProp(f=rosen, momentum_type='polyak').minimize().x, rosen.x_star(), rtol=0.1)
def test_StochasticGradientDescent_Nesterov_momentum_Rosenbrock(): rosen = Rosenbrock() assert np.allclose( StochasticGradientDescent(f=rosen, momentum_type='nesterov').minimize().x, rosen.x_star())
def test_StochasticGradientDescent_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(StochasticGradientDescent(f=rosen).minimize().x, rosen.x_star(), rtol=0.1)
def test_SteepestGradientDescent_Rosenbrock(): rosen = Rosenbrock() assert np.allclose( SteepestGradientDescent(f=rosen).minimize().x, rosen.x_star())
def test_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(ProximalBundle(f=rosen).minimize().x, rosen.x_star(), rtol=0.1)
def test_NadaMax_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(AdaMax(f=rosen, momentum_type='nesterov', momentum=0.8).minimize().x, rosen.x_star(), rtol=0.1)
def test_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(Subgradient(f=rosen, a_start=0.052).minimize().x, rosen.x_star(), rtol=0.1)
def test_AMSGrad_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(AMSGrad(f=rosen, step_size=0.1).minimize().x, rosen.x_star(), rtol=0.1)
def test_AdaDelta_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(AdaDelta(f=rosen, step_size=0.1).minimize().x, rosen.x_star(), rtol=0.15)
def test_Rosenbrock(): rosen = Rosenbrock() assert np.allclose(HeavyBallGradient(f=rosen).minimize().x, rosen.x_star(), rtol=0.1)