Commit bec6d693 authored by Fabian Meyer's avatar Fabian Meyer
Browse files

Make barzilai initial step dependent on gradient

parent 1f101a5d
Loading
Loading
Loading
Loading
+2 −2
Original line number Original line Diff line number Diff line
@@ -298,7 +298,7 @@ namespace gdc
        }
        }
    public:
    public:
        BarzilaiBorweinStep()
        BarzilaiBorweinStep()
            : BarzilaiBorweinStep(Method::Direct, 1e-8)
            : BarzilaiBorweinStep(Method::Direct, 1e-2)
        { }
        { }


        BarzilaiBorweinStep(const Method method, const Scalar constStep)
        BarzilaiBorweinStep(const Method method, const Scalar constStep)
@@ -326,7 +326,7 @@ namespace gdc
            Scalar stepSize = 0;
            Scalar stepSize = 0;
            if(lastXval_.size() == 0)
            if(lastXval_.size() == 0)
            {
            {
                stepSize = constStep_;
                stepSize = gradient.norm() * constStep_;
            }
            }
            else
            else
            {
            {