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