-
Notifications
You must be signed in to change notification settings - Fork 22
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
Gorgonina hyperparameter optimization #118
Conversation
learnRate, _ := trial.SuggestLogFloat("learning_rate", 1e-5, 1e-1) | ||
solver := gorgonia.NewVanillaSolver(gorgonia.WithLearnRate(learnRate)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimize learning rate.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Following suggestion seems to be more interesting as an Goptuna example.
var solver gorgonia.Solver
solverName, _ := trial.SuggestCategorical("solver", []string{"Adam", "Vanilla"})
if solverName == "Adam" {
solver = gorgonia.NewAdamSolver()
} else if solverName == "Vanilla" {
learnRate, _ := trial.SuggestLogFloat("vanilla_learning_rate", 1e-5, 1e-1)
solver = gorgonia.NewVanillaSolver(gorgonia.WithLearnRate(learnRate))
}
I created a pull request: #119
acc = accuracy(predicted.Data().([]float64), Y.Value().Data().([]float64)) | ||
machine.Reset() // Reset is necessary in a loop like this | ||
} | ||
return acc, nil |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maximize accuracy.
study, err := goptuna.CreateStudy( | ||
"gorgonia-iris", | ||
goptuna.StudyOptionStorage(storage), | ||
goptuna.StudyOptionSampler(tpe.NewSampler()), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Optimize parameters using TPE.
Add an example to optimize hyperparameters for Gorgonia Iris example.
Result