7 instantiations of ParameterSet
Microsoft.ML.Sweeper (7)
Algorithms\Grid.cs (2)
184return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter[Host.Rand.Next(sweepParameter.Count)])); 201return new ParameterSet(pset);
Algorithms\NelderMead.cs (1)
455return new ParameterSet(parameters);
Algorithms\Random.cs (1)
34return new ParameterSet(SweepParameters.Select(sweepParameter => sweepParameter.CreateFromNormalized(Host.Rand.NextDouble())));
Algorithms\SmacSweeper.cs (1)
434return new ParameterSet(parameters);
Algorithms\SweeperProbabilityUtils.cs (1)
251return new ParameterSet(parameters);
ISweeper.cs (1)
170new ParameterSet(new Dictionary<string, IParameterValue>(_parameterValues), _hash);
123 references to ParameterSet
Microsoft.ML.Sweeper (110)
Algorithms\Grid.cs (15)
68public virtual ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable<IRunResult> previousRuns = null) 70var prevParamSets = previousRuns?.Select(r => r.ParameterSet).ToList() ?? new List<ParameterSet>(); 71var result = new HashSet<ParameterSet>(); 74ParameterSet paramSet; 90protected abstract ParameterSet CreateParamSet(); 92protected static bool AlreadyGenerated(ParameterSet paramSet, IEnumerable<ParameterSet> previousRuns) 112private readonly ParameterSet[] _cache; 133_cache = new ParameterSet[_nGridPoints]; 150_cache = new ParameterSet[_nGridPoints]; 154public override ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable<IRunResult> previousRuns = null) 159var result = new HashSet<ParameterSet>(); 162: new List<ParameterSet>(); 182protected override ParameterSet CreateParamSet() 187private ParameterSet CreateParamSet(int combination)
Algorithms\KdoSweeper.cs (12)
86private readonly List<ParameterSet> _randomParamSets; 106_randomParamSets = new List<ParameterSet>(); 109public ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable<IRunResult> previousRuns = null) 119ParameterSet[] rcs; 131foreach (ParameterSet ps in rcs) 157private ParameterSet[] GenerateCandidateConfigurations(int numOfCandidates, IRunResult[] previousRuns) 177private ParameterSet[] GenerateChildConfigurations(IRunResult[] history, int[] parentIndicies, double[] weights, IRunResult[] previousRuns, double rMean, double rVar) 180List<ParameterSet> children = new List<ParameterSet>(); 202private ParameterSet SampleChild(ParameterSet parent, double fitness, int n, IRunResult[] previousRuns, double rMean, double rVar, bool isMetricMaximizing) 212ParameterSet ps = _randomSweeper.ProposeSweeps(1)[0];
Algorithms\NelderMead.cs (16)
75private readonly List<KeyValuePair<ParameterSet, float[]>> _pendingSweeps; 76private readonly Queue<KeyValuePair<ParameterSet, float[]>> _pendingSweepsNotSubmitted; 121_pendingSweeps = new List<KeyValuePair<ParameterSet, float[]>>(); 122_pendingSweepsNotSubmitted = new Queue<KeyValuePair<ParameterSet, float[]>>(); 125public ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable<IRunResult> previousRuns = null) 166_pendingSweeps.Add(new KeyValuePair<ParameterSet, float[]>(FloatArrayAsParameterSet(nextPoint), nextPoint)); 178return new ParameterSet[] { _pendingSweeps[0].Key }; 216_pendingSweeps.Add(new KeyValuePair<ParameterSet, float[]>(FloatArrayAsParameterSet(nextPoint), nextPoint)); 228return new ParameterSet[] { _pendingSweeps[0].Key }; 406var newParameterSet = FloatArrayAsParameterSet(newPoint); 410_pendingSweeps.Add(new KeyValuePair<ParameterSet, float[]>(newParameterSet, newPoint)); 412_pendingSweepsNotSubmitted.Enqueue(new KeyValuePair<ParameterSet, float[]>(FloatArrayAsParameterSet(newPoint), newPoint)); 417private ParameterSet[] SubmitMoreReductionPoints(int maxSweeps) 421var result = new ParameterSet[numPoints]; 431private float[] ParameterSetAsFloatArray(ParameterSet parameterSet) 445private ParameterSet FloatArrayAsParameterSet(float[] array)
Algorithms\Random.cs (1)
32protected override ParameterSet CreateParamSet()
Algorithms\SmacSweeper.cs (39)
87public ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable<IRunResult> previousRuns = null) 162private ParameterSet[] GenerateCandidateConfigurations(int numOfCandidates, IEnumerable<IRunResult> previousRuns, FastForestRegressionModelParameters forest) 165ParameterSet[] bestKParamSets = GetKBestConfigurations(previousRuns, forest, _args.LocalSearchParentCount); 168ParameterSet[] eiChallengers = GreedyPlusRandomSearch(bestKParamSets, forest, (int)Math.Ceiling(numOfCandidates / 2.0F), previousRuns); 171ParameterSet[] randomChallengers = _randomSweeper.ProposeSweeps(numOfCandidates - eiChallengers.Length, previousRuns); 175ParameterSet[] configs = new ParameterSet[eiChallengers.Length + randomChallengers.Length]; 190private ParameterSet[] GreedyPlusRandomSearch(ParameterSet[] parents, FastForestRegressionModelParameters forest, int numOfCandidates, IEnumerable<IRunResult> previousRuns) 199HashSet<Tuple<double, ParameterSet>> configurations = new HashSet<Tuple<double, ParameterSet>>(); 202foreach (ParameterSet c in parents) 204Tuple<double, ParameterSet> bestChildKvp = LocalSearch(c, forest, bestVal, _args.Epsilon); 209ParameterSet[] randomConfigs = _randomSweeper.ProposeSweeps(_args.NumRandomEISearchConfigurations, previousRuns); 214configurations.Add(new Tuple<double, ParameterSet>(randomEIs[i], randomConfigs[i])); 216HashSet<ParameterSet> retainedConfigs = new HashSet<ParameterSet>(); 217IOrderedEnumerable<Tuple<double, ParameterSet>> bestConfigurations = configurations.OrderByDescending(x => x.Item1); 219foreach (Tuple<double, ParameterSet> t in bestConfigurations.Take(numOfCandidates)) 233private Tuple<double, ParameterSet> LocalSearch(ParameterSet parent, FastForestRegressionModelParameters forest, double bestVal, double epsilon) 237double currentBestEI = EvaluateConfigurationsByEI(forest, bestVal, new ParameterSet[] { parent })[0]; 238ParameterSet currentBestConfig = parent; 242ParameterSet[] neighborhood = GetOneMutationNeighborhood(currentBestConfig); 254return new Tuple<double, ParameterSet>(currentBestEI, currentBestConfig); 268private ParameterSet[] GetOneMutationNeighborhood(ParameterSet parent) 270List<ParameterSet> neighbors = new List<ParameterSet>(); 320ParameterSet neighbor = SweeperProbabilityUtils.FloatArrayAsParameterSet(_host, _sweepParameters, neigh, false); 334private double[][] GetForestRegressionLeafValues(FastForestRegressionModelParameters forest, ParameterSet[] configs) 338foreach (ParameterSet config in configs) 371private double[] EvaluateConfigurationsByEI(FastForestRegressionModelParameters forest, double bestVal, ParameterSet[] configs) 378private ParameterSet[] GetKBestConfigurations(IEnumerable<IRunResult> previousRuns, FastForestRegressionModelParameters forest, int k = 10) 396List<ParameterSet> outSet = new List<ParameterSet>(); 421private ParameterSet UpdateParameterSet(ParameterSet original, IParameterValue newParam) 437private float ParameterAsFloat(ParameterSet parameterSet, int index)
Algorithms\SweeperProbabilityUtils.cs (2)
160public static float[] ParameterSetAsFloatArray(IHost host, IValueGenerator[] sweepParams, ParameterSet ps, bool expandCategoricals = true) 212public static ParameterSet FloatArrayAsParameterSet(IHost host, IValueGenerator[] sweepParams, float[] array, bool expandedCategoricals = true)
AsyncSweeper.cs (7)
30public readonly ParameterSet ParameterSet; 32public ParameterSetWithId(int id, ParameterSet param) 47/// Propose a <see cref="ParameterSet"/>. 49/// <returns>A future <see cref="ParameterSet"/> and its id. Null if unavailable or cancelled.</returns> 147/// Suppose n <see cref="ParameterSet"/>s are generated up to this point. The sweeper will refrain from making a decision 148/// until the runs with indices in [0, n - relaxation) have all finished. A new batch of <see cref="ParameterSet"/>s will be 228foreach (var paramSet in paramSets)
ConfigRunner.cs (5)
26IEnumerable<IRunResult> RunConfigs(ParameterSet[] sweeps, int min); 152protected string GetCommandLine(ParameterSet sweep) 160public IEnumerable<IRunResult> RunConfigs(ParameterSet[] sweeps, int min) 178protected abstract IEnumerable<IRunResult> RunConfigsCore(ParameterSet[] sweeps, IChannel ch, int min); 200protected override IEnumerable<IRunResult> RunConfigsCore(ParameterSet[] sweeps, IChannel ch, int min)
ISweeper.cs (10)
40ParameterSet[] ProposeSweeps(int maxSweeps, IEnumerable<IRunResult> previousRuns = null); 79IRunResult GetRunResult(ParameterSet parameters, TResults results); 107public sealed class ParameterSet : IEquatable<ParameterSet>, IEnumerable<IParameterValue> 162public bool Equals(ParameterSet other) 169public ParameterSet Clone() => 191ParameterSet ParameterSet { get; } 207private readonly ParameterSet _parameterSet; 217public ParameterSet ParameterSet 222public RunResult(ParameterSet parameterSet, Double metricValue, bool isMetricMaximizing) 229public RunResult(ParameterSet parameterSet)
SweepResultEvaluator.cs (1)
74public IRunResult GetRunResult(ParameterSet parameterSet, string resultFileName)
SynthConfigRunner.cs (2)
42protected override IEnumerable<IRunResult> RunConfigsCore(ParameterSet[] sweeps, IChannel ch, int min) 84private double Rastrigin(ParameterSet ps)
Microsoft.ML.Sweeper.Tests (13)
TestSweeper.cs (13)
107foreach (var parameterSet in initialList) 145var paramSets = new List<ParameterSet>(); 254var paramSets = new List<ParameterSet>(); 304var paramSets = new List<ParameterSet>(); 356var paramSets = new List<ParameterSet>(); 403private void CheckAsyncSweeperResult(List<ParameterSet> paramSets) 406foreach (var paramSet in paramSets) 451foreach (var parameterSet in initialList) 478foreach (var parameterSet in nextList) 510foreach (var parameterSet in lastList) 566foreach (var parameterSet in sweeps) 614foreach (var parameterSet in sweeps) 665foreach (var parameterSet in sweeps)