Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/Microsoft.ML.Sweeper/AsyncSweeper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public interface IAsyncSweeper
/// Expose existing <see cref="ISweeper"/>s as <see cref="IAsyncSweeper"/> with no synchronization over the past runs.
/// Nelder-Mead requires synchronization so is not compatible with SimpleAsyncSweeperBase.
/// </summary>
public class SimpleAsyncSweeper : IAsyncSweeper, IDisposable
public partial class SimpleAsyncSweeper : IAsyncSweeper, IDisposable
{
private readonly List<IRunResult> _results;
private readonly object _lock;
Expand All @@ -85,6 +85,16 @@ private SimpleAsyncSweeper(ISweeper baseSweeper)
_results = new List<IRunResult>();
}

public SimpleAsyncSweeper(IHostEnvironment env, UniformRandomSweeper.ArgumentsBase args)
: this(new UniformRandomSweeper(env, args))
{
}

public SimpleAsyncSweeper(IHostEnvironment env, RandomGridSweeper.Arguments args)
: this(new UniformRandomSweeper(env, args))
{
}

public void Update(int id, IRunResult result)
{
Contracts.CheckParam(0 <= id && id < _numGenerated, nameof(id), "Invalid run id");
Expand Down