Search Results for

    Show / Hide Table of Contents

    Class BFGS

    This implementation of BFGS is based on Algorithm 6.1 from Nocedal and Wright (Second edition, 2006).

    Inheritance
    Object
    BFGS
    LBFGS
    Inherited Members
    Object.Equals(Object)
    Object.Equals(Object, Object)
    Object.GetHashCode()
    Object.GetType()
    Object.MemberwiseClone()
    Object.ReferenceEquals(Object, Object)
    Object.ToString()
    Namespace: Microsoft.ML.Probabilistic.Math
    Assembly: Microsoft.ML.Probabilistic.dll
    Syntax
    public class BFGS

    Constructors

    BFGS()

    BFGS constructor

    Declaration
    public BFGS()

    Fields

    cancel

    Declaration
    protected bool cancel
    Field Value
    Type Description
    Boolean

    convergenceCriteria

    Convergence criteria:

    Declaration
    public BFGS.ConvergenceCriteria convergenceCriteria
    Field Value
    Type Description
    BFGS.ConvergenceCriteria

    currentDeriv

    Declaration
    protected Vector currentDeriv
    Field Value
    Type Description
    Vector

    currentObj

    Declaration
    protected double currentObj
    Field Value
    Type Description
    Double

    currentX

    Declaration
    protected Vector currentX
    Field Value
    Type Description
    Vector

    debug

    Whether to output debug info

    Declaration
    public bool debug
    Field Value
    Type Description
    Boolean

    dimension

    Following fields are set up by the main run routine, and are used to provide the 1-D function that the line search needs

    Declaration
    protected int dimension
    Field Value
    Type Description
    Int32

    epsilon

    Declaration
    protected double epsilon
    Field Value
    Type Description
    Double

    feval

    Declaration
    protected FunctionEval feval
    Field Value
    Type Description
    FunctionEval

    initialStep

    Declaration
    protected double initialStep
    Field Value
    Type Description
    Double

    iter

    Declaration
    protected int iter
    Field Value
    Type Description
    Int32

    lineSearch

    Declaration
    public LineSearch lineSearch
    Field Value
    Type Description
    LineSearch

    maxIterations

    Declaration
    protected int maxIterations
    Field Value
    Type Description
    Int32

    searchDir

    Declaration
    protected Vector searchDir
    Field Value
    Type Description
    Vector

    stepMax

    Declaration
    protected double stepMax
    Field Value
    Type Description
    Double

    Properties

    Cancel

    Cancel

    Declaration
    public bool Cancel { get; set; }
    Property Value
    Type Description
    Boolean

    Epsilon

    Convergence tolerance

    Declaration
    public double Epsilon { get; set; }
    Property Value
    Type Description
    Double

    InitialStep

    Initial step

    Declaration
    public double InitialStep { get; set; }
    Property Value
    Type Description
    Double

    IterationsPerformed

    Number of iterations performed to reach convergence (or failure)

    Declaration
    public int IterationsPerformed { get; }
    Property Value
    Type Description
    Int32

    linesearchDebug

    Whether to debug the line search

    Declaration
    public bool linesearchDebug { set; }
    Property Value
    Type Description
    Boolean

    MaximumIterations

    Maximum number of iterations

    Declaration
    public int MaximumIterations { get; set; }
    Property Value
    Type Description
    Int32

    MaximumStep

    Maximum step

    Declaration
    public double MaximumStep { get; set; }
    Property Value
    Type Description
    Double

    Methods

    LSEval(Double, Boolean, out Double)

    This is the 1-D function that the line search sees. The Run function will set up the necessary fields

    Declaration
    protected virtual double LSEval(double step, bool calcDeriv, out double deriv)
    Parameters
    Type Name Description
    Double step

    step

    Boolean calcDeriv

    flag to calculate derivative

    Double deriv

    the derivative

    Returns
    Type Description
    Double

    RaiseIterationEvent(Int32, Double, Double)

    Safely invoke the iteration event

    Declaration
    protected void RaiseIterationEvent(int iteration, double objVal, double rmsDeriv)
    Parameters
    Type Name Description
    Int32 iteration
    Double objVal
    Double rmsDeriv

    Run(Vector, Double, FunctionEval)

    Run an unconstrained minimization using BFGS

    Declaration
    public virtual Vector Run(Vector x0, double normOfFirstStep, FunctionEval func)
    Parameters
    Type Name Description
    Vector x0

    Starting step

    Double normOfFirstStep

    Norm of first step

    FunctionEval func

    Multivariate function and derivative evaluator

    Returns
    Type Description
    Vector

    The local minimum point

    SetWolfeConstants(Double, Double)

    Set Wolfe conditions

    Declaration
    public void SetWolfeConstants(double c1, double c2)
    Parameters
    Type Name Description
    Double c1

    Sufficient decrease condition

    Double c2

    Curvature condition

    TryLineSearch(Double, Double, Double)

    Line search

    Declaration
    protected double TryLineSearch(double s0, double smax, double currentGrad)
    Parameters
    Type Name Description
    Double s0

    Initial step

    Double smax

    Maximum step

    Double currentGrad
    Returns
    Type Description
    Double

    Events

    OnIteration

    Event triggered at each iteration

    Declaration
    public event IterationEventHandler OnIteration
    Event Type
    Type Description
    IterationEventHandler
    In This Article
    Back to top Copyright © .NET Foundation. All rights reserved.