Skip to content
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

Fix NullReferenceException when it comes to Recommendation in AutoML and CodeGenerator #4774

Conversation

LittleLittleCloud
Copy link
Contributor

add code for handle enum case in CodeGen

@LittleLittleCloud LittleLittleCloud requested a review from a team as a code owner February 3, 2020 23:14
@LittleLittleCloud
Copy link
Contributor Author

#4579

{nameof(MatrixFactorizationTrainer.Options.Lambda), 0.01f },
{nameof(MatrixFactorizationTrainer.Options.LossFunction), MatrixFactorizationTrainer.LossFunctionType.SquareLossRegression },
{nameof(MatrixFactorizationTrainer.Options.Alpha), 1f },
{nameof(MatrixFactorizationTrainer.Options.C), 0.00001f },
Copy link
Contributor

Choose a reason for hiding this comment

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

Thanks for adding the MF options to a test.

ITrainerGenerator generator = TrainerGeneratorFactory.GetInstance(node);
var trainerString = generator.GenerateTrainer();
var trainerUsings = generator.GenerateUsings();
return (trainerString, trainerUsings);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure why the try/catch was needed. If no one else knows, we may want drill down in the code, or run a variety of datasets thru the CLI to show that nothing is expected to throw.

The old catch seem to eat the error without a hint of what went wrong.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah, that's why I removed that part of code

Copy link
Contributor

@justinormont justinormont left a comment

Choose a reason for hiding this comment

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

LGTM. May want to check on why we had a try/catch before, seemed oddly written previously. Thanks for expanding the unit test to cover MF's options.

@LittleLittleCloud LittleLittleCloud merged commit daae78d into dotnet:master Feb 4, 2020
@LittleLittleCloud LittleLittleCloud changed the title fix recommendation Bug Fix NullReferenceException when it comes to Recommendation in AutoML and CodeGenerator Feb 6, 2020
@ghost ghost locked as resolved and limited conversation to collaborators Mar 19, 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