Example #1
0
 public SweepableEstimator(Func <MLContext, Parameter, IEstimator <ITransformer> > factory, SearchSpace.SearchSpace ss)
     : this()
 {
     this._factory    = factory;
     this.SearchSpace = ss;
     this.Parameter   = ss.SampleFromFeatureSpace(ss.Default);
 }
        public Parameter Propose(TrialSettings settings)
        {
            var trialId = settings.TrialId;

            if (_initUsed)
            {
                var searchThread = _searchThreadPool[_currentThreadId];
                _configs[trialId]         = _searchSpace.MappingToFeatureSpace(searchThread.Suggest(trialId));
                _trialProposedBy[trialId] = _currentThreadId;
            }
            else
            {
                _configs[trialId]         = CreateInitConfigFromAdmissibleRegion();
                _trialProposedBy[trialId] = _currentThreadId;
            }

            var param = _configs[trialId];

            return(_searchSpace.SampleFromFeatureSpace(param));
        }