Skip to content

Convert ML.Sweeper usages of SubComponent to IComponentFactory. #734

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 29, 2018

Conversation

eerhardt
Copy link
Member

Moving all the SubComponent usages in the ML.Sweeper assembly to use IComponentFactory.

Note: I logged #733 for the NelderMeadSweeper, which was using another component that doesn't appear to be in the dotnet/machinelearning repo.

Working towards #585

@@ -193,13 +194,13 @@ public sealed class Arguments
public DeterministicSweeperAsync(IHostEnvironment env, Arguments args)
{
_host = env.Register("DeterministicSweeperAsync", args.RandomSeed);
_host.CheckUserArg(args.Sweeper.IsGood(), nameof(args.Sweeper), "Please specify a sweeper");
_host.CheckValue(args.Sweeper, nameof(args.Sweeper), "Please specify a sweeper");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

CheckValue [](start = 18, length = 10)

why is this changed to CheckValue from CheckUserArgs?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

SubComponents have an IsGood() extension method that check both for null and for a non-empty "Kind" property. CheckUserArg only has an overload for bool, which IsGood() returns.

Now that this is an IComponentFactory, the only thing we can check for is null - which is what CheckValue does.

Copy link
Member

@codemzs codemzs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

Copy link
Contributor

@TomFinley TomFinley left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @eerhardt looks like we're getting close to the end of subcomponents. 🎆

@eerhardt eerhardt merged commit d9d27ac into dotnet:master Aug 29, 2018
@eerhardt eerhardt deleted the SweeperSubComponents branch August 29, 2018 17:17
@ghost ghost locked as resolved and limited conversation to collaborators Mar 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants