File tree 1 file changed +5
-4
lines changed
1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,6 @@ func main() {
39
39
storage := rdb .NewStorage (db )
40
40
41
41
pruner , _ := successivehalving .NewPruner (
42
- successivehalving .OptionSetMinResource (100 ),
43
42
successivehalving .OptionSetReductionFactor (3 ))
44
43
study , err := goptuna .CreateStudy (
45
44
"gorgonia-iris" ,
@@ -136,11 +135,13 @@ func objective(trial goptuna.Trial) (float64, error) {
136
135
return 0 , err
137
136
}
138
137
acc = accuracy (predicted .Data ().([]float64 ), Y .Value ().Data ().([]float64 ))
138
+ machine .Reset () // Reset is necessary in a loop like this
139
139
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
+ }
142
144
}
143
- machine .Reset () // Reset is necessary in a loop like this
144
145
}
145
146
return acc , nil
146
147
}
You can’t perform that action at this time.
0 commit comments