Skip to content

Commit 3644851

Browse files
authored
Merge pull request #142 from c-bata/reduce-report
Reduce the count of reporting intermediate values.
2 parents 8d81696 + 0e9e9e6 commit 3644851

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

_examples/gorgonia_iris/main.go

+5-4
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ func main() {
3939
storage := rdb.NewStorage(db)
4040

4141
pruner, _ := successivehalving.NewPruner(
42-
successivehalving.OptionSetMinResource(100),
4342
successivehalving.OptionSetReductionFactor(3))
4443
study, err := goptuna.CreateStudy(
4544
"gorgonia-iris",
@@ -136,11 +135,13 @@ func objective(trial goptuna.Trial) (float64, error) {
136135
return 0, err
137136
}
138137
acc = accuracy(predicted.Data().([]float64), Y.Value().Data().([]float64))
138+
machine.Reset() // Reset is necessary in a loop like this
139139

140-
if err := trial.ShouldPrune(i, acc); err != nil {
141-
return acc, err
140+
if i%100 == 0 {
141+
if err := trial.ShouldPrune(i, acc); err != nil {
142+
return acc, err
143+
}
142144
}
143-
machine.Reset() // Reset is necessary in a loop like this
144145
}
145146
return acc, nil
146147
}

0 commit comments

Comments
 (0)