Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
08/11/15 10:11:47 (9 years ago)
Author:
ascheibe
Message:

#2388 merged trunk into branch

Location:
branches/HiveStatistics/sources
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/HiveStatistics/sources

  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Lbfgs.cs

    r12515 r12843  
    200200        RegisterEvents();
    201201        solutionCreator.OperatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     202        solutionCreator.OperatorParameter.Hidden = true;
    202203        evaluator.OperatorParameter.ActualName = Problem.EvaluatorParameter.Name;
     204        evaluator.OperatorParameter.Hidden = true;
    203205        UpdateAnalyzers();
    204206        ParameterizeOperators();
     
    220222    protected override void Problem_OperatorsChanged(object sender, EventArgs e) {
    221223      base.Problem_OperatorsChanged(sender, e);
     224      RegisterEvents();
     225      solutionCreator.OperatorParameter.ActualName = Problem.SolutionCreatorParameter.Name;
     226      solutionCreator.OperatorParameter.Hidden = true;
     227      evaluator.OperatorParameter.ActualName = Problem.EvaluatorParameter.Name;
     228      evaluator.OperatorParameter.Hidden = true;
    222229      UpdateAnalyzers();
     230      ParameterizeOperators();
    223231    }
    224232
     
    266274        var realVectorParameterName = realVectorCreator.RealVectorParameter.ActualName;
    267275        initializer.PointParameter.ActualName = realVectorParameterName;
     276        initializer.PointParameter.Hidden = true;
    268277        makeStep.PointParameter.ActualName = realVectorParameterName;
     278        makeStep.PointParameter.Hidden = true;
    269279        analyzer.PointParameter.ActualName = realVectorParameterName;
     280        analyzer.PointParameter.Hidden = true;
    270281      }
    271282
    272283      var qualityParameterName = Problem.Evaluator.QualityParameter.ActualName;
    273284      updateResults.QualityParameter.ActualName = qualityParameterName;
     285      updateResults.QualityParameter.Hidden = true;
    274286      analyzer.QualityParameter.ActualName = qualityParameterName;
     287      analyzer.QualityParameter.Hidden = true;
    275288    }
    276289  }
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.GradientDescent/3.3/LbfgsUpdateResults.cs

    r12012 r12843  
    3737    private const string StateParameterName = "State";
    3838    private const string ApproximateGradientsParameterName = "ApproximateGradients";
     39    private const string MaximizationParameterName = "Maximization";
    3940
    4041    #region Parameter Properties
     
    5152      get { return (ILookupParameter<LbfgsState>)Parameters[StateParameterName]; }
    5253    }
     54    public ILookupParameter<BoolValue> MaximizationParameter {
     55      get { return (ILookupParameter<BoolValue>)Parameters[MaximizationParameterName]; }
     56    }
    5357    #endregion
    5458
     
    5862    private DoubleValue Quality { get { return QualityParameter.ActualValue; } }
    5963    private LbfgsState State { get { return StateParameter.ActualValue; } }
     64
     65    private BoolValue Maximization {
     66      get {
     67        // BackwardsCompatibility3.3
     68        #region Backwards compatible code, remove with 3.4
     69        // the parameter is new, previously we assumed minimization problems
     70        if (MaximizationParameter.ActualValue == null) return new BoolValue(false);
     71        #endregion
     72        return MaximizationParameter.ActualValue;
     73      }
     74    }
     75
    6076    #endregion
    6177
     
    7086      Parameters.Add(new LookupParameter<BoolValue>(ApproximateGradientsParameterName,
    7187                                                    "Flag that indicates if gradients should be approximated."));
     88      Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "Flag that indicates if we solve a maximization problem."));
    7289      // in & out
    7390      Parameters.Add(new LookupParameter<LbfgsState>(StateParameterName, "The state of the LM-BFGS algorithm."));
     91    }
     92
     93    [StorableHook(HookType.AfterDeserialization)]
     94    private void AfterDeserialization() {
     95      // BackwardsCompatibility3.3
     96
     97      #region Backwards compatible code, remove with 3.4
     98      if (!Parameters.ContainsKey(MaximizationParameterName)) {
     99        // previous behaviour defaulted to minimization
     100        Parameters.Add(new LookupParameter<BoolValue>(MaximizationParameterName, "Flag that indicates if we solve a maximization problem."));
     101      }
     102      #endregion
    74103    }
    75104
     
    80109    public override IOperation Apply() {
    81110      var state = State;
    82       var f = Quality.Value;
     111      var sign = Maximization.Value ? -1.0 : 1.0;
     112      var f = sign * Quality.Value;
    83113      state.State.f = f;
    84114      if (!ApproximateGradients.Value) {
    85         var g = QualityGradients.ToArray();
     115        var g = QualityGradients.Select(gi => sign * gi).ToArray();
    86116        state.State.g = g;
    87117      }
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Plugin.cs.frame

    r12012 r12843  
    2323
    2424namespace HeuristicLab.Algorithms.GradientDescent {
    25   [Plugin("HeuristicLab.Algorithms.GradientDescent", "3.3.11.$WCREV$")]
     25  [Plugin("HeuristicLab.Algorithms.GradientDescent", "3.3.12.$WCREV$")]
    2626  [PluginFile("HeuristicLab.Algorithms.GradientDescent-3.3.dll", PluginFileType.Assembly)]
    2727  [PluginDependency("HeuristicLab.ALGLIB", "3.7.0")]
  • branches/HiveStatistics/sources/HeuristicLab.Algorithms.GradientDescent/3.3/Properties/AssemblyInfo.cs.frame

    r12012 r12843  
    5555// [assembly: AssemblyVersion("1.0.*")]
    5656[assembly: AssemblyVersion("3.3.0.0")]
    57 [assembly: AssemblyFileVersion("3.3.11.$WCREV$")]
     57[assembly: AssemblyFileVersion("3.3.12.$WCREV$")]
Note: See TracChangeset for help on using the changeset viewer.