Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/01/12 13:46:17 (12 years ago)
Author:
gkronber
Message:

#1902 implemented Gaussian process regression operators and analyzers

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Algorithms.DataAnalysis/3.4/GaussianProcess/BFGSMakeStep.cs

    r8371 r8375  
    3535  public sealed class BFGSMakeStep : SingleSuccessorOperator {
    3636    private const string TerminationCriterionParameterName = "TerminationCriterion";
    37     private const string HyperparameterParameterName = "Hyperparameter";
     37    private const string PointParameterName = "Point";
    3838    private const string BFGSStateParameterName = "BFGSState";
    3939
     
    4545      get { return (ILookupParameter<BoolValue>)Parameters[TerminationCriterionParameterName]; }
    4646    }
    47     public ILookupParameter<DoubleArray> HyperparameterParameter {
    48       get { return (ILookupParameter<DoubleArray>)Parameters[HyperparameterParameterName]; }
     47    public ILookupParameter<DoubleArray> PointParameter {
     48      get { return (ILookupParameter<DoubleArray>)Parameters[PointParameterName]; }
    4949    }
    5050    #endregion
     
    5252
    5353    #region Properties
    54     public BFGSState BFGSState { get { return BFGSStateParameter.ActualValue; } }
     54    private BFGSState BFGSState { get { return BFGSStateParameter.ActualValue; } }
    5555    #endregion
    5656
     
    6464      // out
    6565      Parameters.Add(new LookupParameter<BoolValue>(TerminationCriterionParameterName, "The termination criterion indicating that the BFGS optimization algorithm should stop."));
    66       Parameters.Add(new LookupParameter<DoubleArray>(HyperparameterParameterName, "The parameters of the function to optimize."));
     66      Parameters.Add(new LookupParameter<DoubleArray>(PointParameterName, "The next point that should be evaluated in the BFGS algorithm."));
    6767    }
    6868
     
    7373    public override IOperation Apply() {
    7474      var state = BFGSState;
    75       bool stop = alglib.minlbfgs.minlbfgsiteration(state.State);
    76       TerminationCriterionParameter.ActualValue = new BoolValue(stop);
    77       if (!stop) {
    78         HyperparameterParameter.ActualValue = new DoubleArray(state.State.x);
     75      bool @continue = alglib.minlbfgs.minlbfgsiteration(state.State);
     76      TerminationCriterionParameter.ActualValue = new BoolValue(!@continue);
     77      if (@continue) {
     78        PointParameter.ActualValue = new DoubleArray(state.State.x);
    7979      } else {
    8080        double[] x = new double[state.State.x.Length];
    8181        alglib.minlbfgs.minlbfgsreport rep = new alglib.minlbfgs.minlbfgsreport();
    8282        alglib.minlbfgs.minlbfgsresults(state.State, ref x, rep);
    83         HyperparameterParameter.ActualValue = new DoubleArray(x);
     83        PointParameter.ActualValue = new DoubleArray(x);
    8484      }
    8585      return base.Apply();
Note: See TracChangeset for help on using the changeset viewer.