Skip to content

Commit

Permalink
Rename successive halving option
Browse files Browse the repository at this point in the history
  • Loading branch information
c-bata committed Apr 22, 2021
1 parent 281a2af commit 56bbce2
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions successivehalving/option.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,38 @@ package successivehalving
// Option to pass the custom option
type Option func(pruner *Pruner) error

// OptionSetMinResource to set the minimum resource.
func OptionSetMinResource(minResource int) Option {
// OptionMinResource to set the minimum resource.
func OptionMinResource(minResource int) Option {
return func(p *Pruner) error {
p.MinResource = minResource
return nil
}
}

// OptionSetReductionFactor to set the reduction factor.
func OptionSetReductionFactor(reductionFactor int) Option {
// OptionReductionFactor to set the reduction factor.
func OptionReductionFactor(reductionFactor int) Option {
return func(p *Pruner) error {
p.ReductionFactor = reductionFactor
return nil
}
}

// OptionSetMinEarlyStoppingRate to set the minimum value of the early stopping rate.
func OptionSetMinEarlyStoppingRate(minEarlyStoppingRate int) Option {
// OptionMinEarlyStoppingRate to set the minimum value of the early stopping rate.
func OptionMinEarlyStoppingRate(minEarlyStoppingRate int) Option {
return func(p *Pruner) error {
p.MinEarlyStoppingRate = minEarlyStoppingRate
return nil
}
}

// OptionSetMinResource to set the minimum resource.
// Deprecated: please use OptionMinResource instead.
var OptionSetMinResource = OptionMinResource

// OptionSetReductionFactor to set the reduction factor.
// Deprecated: please use OptionReductionFactor instead.
var OptionSetReductionFactor = OptionReductionFactor

// OptionSetMinEarlyStoppingRate to set the minimum value of the early stopping rate.
// Deprecated: please use OptionMinEarlyStoppingRate instead.
var OptionSetMinEarlyStoppingRate = OptionMinEarlyStoppingRate

0 comments on commit 56bbce2

Please sign in to comment.