diff --git a/cmd/cli/command/push-model.go b/cmd/cli/command/push-model.go index 6e4ae96784c..40a4487cddb 100644 --- a/cmd/cli/command/push-model.go +++ b/cmd/cli/command/push-model.go @@ -64,13 +64,13 @@ func pushModel(cmd *cobra.Command, opt *pushModelOpt) { buf, _ := ioutil.ReadFile(opt.file) err = yaml.Unmarshal(buf, &req) if err != nil { - log.Fatalf("Fail to Purse config: %v", err) + log.Fatalf("Fail to parse config: %v", err) return } } else if len(opt.args) > 0 { err := json.Unmarshal(([]byte)(opt.args[0]), &req) if err != nil { - log.Fatalf("Fail to Purse input: %v", err) + log.Fatalf("Fail to parse input: %v", err) return } } else { diff --git a/cmd/cli/command/push-study.go b/cmd/cli/command/push-study.go index cac6b51ccc3..da4f8354919 100644 --- a/cmd/cli/command/push-study.go +++ b/cmd/cli/command/push-study.go @@ -65,13 +65,13 @@ func pushStudy(cmd *cobra.Command, opt *pushStudyOpt) { buf, _ := ioutil.ReadFile(opt.file) err = yaml.Unmarshal(buf, &in) if err != nil { - log.Fatalf("Fail to Purse config: %v", err) + log.Fatalf("Fail to parse config: %v", err) return } } else if len(opt.args) > 0 { err := json.Unmarshal(([]byte)(opt.args[0]), &in) if err != nil { - log.Fatalf("Fail to Purse input: %v", err) + log.Fatalf("Fail to parse input: %v", err) return } } else { diff --git a/pkg/earlystopping/medianstopping.go b/pkg/earlystopping/medianstopping.go index cc7a4c70ade..a3afd7eac8c 100644 --- a/pkg/earlystopping/medianstopping.go +++ b/pkg/earlystopping/medianstopping.go @@ -33,7 +33,7 @@ func NewMedianStoppingRule() *MedianStoppingRule { return m } -func (m *MedianStoppingRule) purseEarlyStoppingParameters(sc *api.StudyConfig, eps []*api.EarlyStoppingParameter) (*MedianStoppingParam, error) { +func (m *MedianStoppingRule) parseEarlyStoppingParameters(sc *api.StudyConfig, eps []*api.EarlyStoppingParameter) (*MedianStoppingParam, error) { p := &MedianStoppingParam{LeastStep: defaultLeastStep, Margin: defaultMargin, EvalMetric: sc.ObjectiveValueName, BurnIn: defaultBurnIn} for _, ep := range eps { switch ep.Name { @@ -145,7 +145,7 @@ func (m *MedianStoppingRule) GetShouldStopWorkers(ctx context.Context, in *api.G if err != nil { return &api.GetShouldStopWorkersReply{}, err } - p, err := m.purseEarlyStoppingParameters(sc, eparam) + p, err := m.parseEarlyStoppingParameters(sc, eparam) if err != nil { return &api.GetShouldStopWorkersReply{}, err } diff --git a/pkg/suggestion/grid_service.go b/pkg/suggestion/grid_service.go index 2a926d37d58..18f04947fd8 100644 --- a/pkg/suggestion/grid_service.go +++ b/pkg/suggestion/grid_service.go @@ -88,7 +88,7 @@ func (s *GridSuggestService) setP(gci int, p [][]*api.Parameter, pg [][]string, } } -func (s *GridSuggestService) purseSuggestParam(suggestParam []*api.SuggestionParameter) (int, int, map[string]int) { +func (s *GridSuggestService) parseSuggestParam(suggestParam []*api.SuggestionParameter) (int, int, map[string]int) { ret := make(map[string]int) defaultGrid := 0 i := 0 @@ -161,7 +161,7 @@ func (s *GridSuggestService) GetSuggestions(ctx context.Context, in *api.GetSugg log.Printf("GetParameter failed: %v", err) return &api.GetSuggestionsReply{}, err } - df, iteration, glist := s.purseSuggestParam(spr.SuggestionParameters) + df, iteration, glist := s.parseSuggestParam(spr.SuggestionParameters) log.Printf("Study %s iteration %d DefaltGrid %d Grids %v", in.StudyId, iteration, df, glist) grids := s.genGrids(in.StudyId, scr.StudyConfig.ParameterConfigs.Configs, df, glist) var reqnum = int(in.RequestNumber) diff --git a/pkg/suggestion/hyperband_service.go b/pkg/suggestion/hyperband_service.go index cb8916aac4a..f5f07cf03d1 100644 --- a/pkg/suggestion/hyperband_service.go +++ b/pkg/suggestion/hyperband_service.go @@ -108,7 +108,7 @@ func (h *HyperBandSuggestService) makeMasterBracket(ctx context.Context, c api.M case api.ParameterType_DOUBLE: dmin, _ := strconv.ParseFloat(pc.Feasible.Min, 64) dmax, _ := strconv.ParseFloat(pc.Feasible.Max, 64) - t.ParameterSet[j].Value = strconv.FormatFloat(h.DoubelRandom(dmin, dmax), 'f', 4, 64) + t.ParameterSet[j].Value = strconv.FormatFloat(h.DoubleRandom(dmin, dmax), 'f', 4, 64) case api.ParameterType_CATEGORICAL: t.ParameterSet[j].Value = pc.Feasible.List[h.IntRandom(0, len(pc.Feasible.List)-1)] } @@ -195,7 +195,7 @@ func (h *HyperBandSuggestService) makeChildBracket(ctx context.Context, c api.Ma return tids, ts, nil } -func (h *HyperBandSuggestService) purseSuggestionParameters(ctx context.Context, c api.ManagerClient, studyID string, sparam []*api.SuggestionParameter) (*HyperBandParameters, error) { +func (h *HyperBandSuggestService) parseSuggestionParameters(ctx context.Context, c api.ManagerClient, studyID string, sparam []*api.SuggestionParameter) (*HyperBandParameters, error) { p := &HyperBandParameters{ eta: -1, sMax: -1, @@ -238,7 +238,7 @@ func (h *HyperBandSuggestService) purseSuggestionParameters(ctx context.Context, } } if p.rL <= 0 || p.ResourceName == "" { - log.Printf("Failed to purse Suggestion Parameter. r_l and ResourceName must be set.") + log.Printf("Failed to parse Suggestion Parameter. r_l and ResourceName must be set.") return nil, fmt.Errorf("Suggestion Parameter set Error") } if p.eta <= 0 { @@ -418,7 +418,7 @@ func (h *HyperBandSuggestService) GetSuggestions(ctx context.Context, in *api.Ge log.Fatalf("GetParameter failed: %v", err) return &api.GetSuggestionsReply{}, err } - hbparam, err := h.purseSuggestionParameters(ctx, c, in.StudyId, spr.SuggestionParameters) + hbparam, err := h.parseSuggestionParameters(ctx, c, in.StudyId, spr.SuggestionParameters) if err != nil { return &api.GetSuggestionsReply{}, err } diff --git a/pkg/suggestion/random_service.go b/pkg/suggestion/random_service.go index 125624f0b75..814ec6a7c52 100644 --- a/pkg/suggestion/random_service.go +++ b/pkg/suggestion/random_service.go @@ -19,7 +19,7 @@ func NewRandomSuggestService() *RandomSuggestService { return &RandomSuggestService{} } -func (s *RandomSuggestService) DoubelRandom(min, max float64) float64 { +func (s *RandomSuggestService) DoubleRandom(min, max float64) float64 { if min == max { return min } @@ -65,7 +65,7 @@ func (s *RandomSuggestService) GetSuggestions(ctx context.Context, in *api.GetSu case api.ParameterType_DOUBLE: dmin, _ := strconv.ParseFloat(pc.Feasible.Min, 64) dmax, _ := strconv.ParseFloat(pc.Feasible.Max, 64) - sT[i].ParameterSet[j].Value = strconv.FormatFloat(s.DoubelRandom(dmin, dmax), 'f', 4, 64) + sT[i].ParameterSet[j].Value = strconv.FormatFloat(s.DoubleRandom(dmin, dmax), 'f', 4, 64) case api.ParameterType_CATEGORICAL: sT[i].ParameterSet[j].Value = pc.Feasible.List[s.IntRandom(0, len(pc.Feasible.List)-1)] }