Tuner\SmacTuner.cs (24)
28private Queue<Parameter> _candidates;
76_candidates = new Queue<Parameter>();
95public Parameter Propose(TrialSettings settings)
107_candidates = new Queue<Parameter>(GenerateCandidateConfigurations(_fitModelEveryNTrials, _histories, model));
115internal Queue<Parameter> Candidates => _candidates;
169private Parameter[] GenerateCandidateConfigurations(int numOfCandidates, IEnumerable<TrialResult> previousRuns, FastForestRegressionModelParameters forest)
192private Parameter[] GreedyPlusRandomSearch(IEnumerable<Parameter> parents, FastForestRegressionModelParameters forest, int numOfCandidates)
196var configurations = new HashSet<Tuple<double, Parameter>>();
199foreach (var c in parents)
207var randomConfigurations = randomParameters.Select(parameter => new Tuple<double, Parameter>(EvaluateConfigurationsByEI(forest, bestLoss, parameter), parameter));
210var comparer = Parameter.FromInt(0);
211var retainedConfigs = new HashSet<Parameter>(orderedConfigurations.Select(x => x.Item2), comparer);
229private Tuple<double, Parameter> LocalSearch(Parameter startParameter, FastForestRegressionModelParameters forest, double bestLoss)
234var currentBestConfig = startParameter;
238Parameter[] neighborhood = GetOneMutationNeighborhood(currentBestConfig);
250return new Tuple<double, Parameter>(currentBestEI, currentBestConfig);
258private Parameter[] GetOneMutationNeighborhood(Parameter currentBestConfig)
260var neighborhood = new List<Parameter>();
306private double EvaluateConfigurationsByEI(FastForestRegressionModelParameters forest, double bestVal, Parameter parameter)
319private double[] GetForestRegressionLeafValues(FastForestRegressionModelParameters forest, Parameter parameter)