From c241d9e82c146d8311e1a67912e0ae368ae46ee2 Mon Sep 17 00:00:00 2001 From: Xinyuan Huang Date: Sun, 10 Feb 2019 01:52:07 -0800 Subject: [PATCH] Use camelCase consistently in study job spec This makes study job spec use camelCase consistently. Examples are updated correspondingly. --- examples/bayseopt-example.yaml | 18 +++++++------- examples/gpu-example.yaml | 16 ++++++------- examples/grid-example.yaml | 16 ++++++------- examples/hypb-example.yaml | 16 ++++++------- examples/nasjob-example-RL.yaml | 24 +++++++++---------- examples/pytorchjob-example.yaml | 16 ++++++------- examples/random-example.yaml | 18 +++++++------- examples/tf-event_test.yaml | 14 +++++------ examples/tfjob-example.yaml | 16 ++++++------- examples/xgboost-bayesian-example.yaml | 14 +++++------ .../apis/studyjob/v1alpha1/studyjob_types.go | 24 +++++++++---------- 11 files changed, 96 insertions(+), 96 deletions(-) diff --git a/examples/bayseopt-example.yaml b/examples/bayseopt-example.yaml index 0d582b3eb8e..c2ddd63ac37 100644 --- a/examples/bayseopt-example.yaml +++ b/examples/bayseopt-example.yaml @@ -8,25 +8,25 @@ metadata: spec: studyName: random-example owner: crd - optimizationtype: maximize - objectivevaluename: Validation-accuracy - optimizationgoal: 0.99 - requestcount: 10 - metricsnames: + optimizationType: maximize + objectiveValueName: Validation-accuracy + optimizationGoal: 0.99 + requestCount: 10 + metricsNames: - accuracy - parameterconfigs: + parameterConfigs: - name: --lr - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.03" - name: --num-layers - parametertype: int + parameterType: int feasible: min: "1" max: "4" - name: --optimizer - parametertype: categorical + parameterType: categorical feasible: list: - sgd diff --git a/examples/gpu-example.yaml b/examples/gpu-example.yaml index 6a8ff967274..632bdec2450 100644 --- a/examples/gpu-example.yaml +++ b/examples/gpu-example.yaml @@ -8,24 +8,24 @@ metadata: spec: studyName: gpu-example owner: crd - optimizationtype: maximize - objectivevaluename: Validation-accuracy - optimizationgoal: 0.99 - metricsnames: + optimizationType: maximize + objectiveValueName: Validation-accuracy + optimizationGoal: 0.99 + metricsNames: - accuracy - parameterconfigs: + parameterConfigs: - name: --lr - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.03" - name: --num-layers - parametertype: int + parameterType: int feasible: min: "2" max: "3" - name: --optimizer - parametertype: categorical + parameterType: categorical feasible: list: - sgd diff --git a/examples/grid-example.yaml b/examples/grid-example.yaml index 10cce0273e9..e529d17529d 100644 --- a/examples/grid-example.yaml +++ b/examples/grid-example.yaml @@ -8,24 +8,24 @@ metadata: spec: studyName: grid-example owner: crd - optimizationtype: maximize - objectivevaluename: Validation-accuracy - optimizationgoal: 0.99 - metricsnames: + optimizationType: maximize + objectiveValueName: Validation-accuracy + optimizationGoal: 0.99 + metricsNames: - accuracy - parameterconfigs: + parameterConfigs: - name: --lr - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.03" - name: --num-layers - parametertype: int + parameterType: int feasible: min: "2" max: "5" - name: --optimizer - parametertype: categorical + parameterType: categorical feasible: list: - sgd diff --git a/examples/hypb-example.yaml b/examples/hypb-example.yaml index a6fed35e836..1c9a19fd221 100644 --- a/examples/hypb-example.yaml +++ b/examples/hypb-example.yaml @@ -8,30 +8,30 @@ metadata: spec: studyName: hypb-example owner: crd - optimizationtype: maximize - objectivevaluename: Validation-accuracy - metricsnames: + optimizationType: maximize + objectiveValueName: Validation-accuracy + metricsNames: - accuracy - parameterconfigs: + parameterConfigs: - name: --lr - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.03" - name: --num-layers - parametertype: int + parameterType: int feasible: min: "2" max: "5" - name: --optimizer - parametertype: categorical + parameterType: categorical feasible: list: - sgd - adam - ftrl - name: --num-epochs - parametertype: int + parameterType: int feasible: min: "20" max: "20" diff --git a/examples/nasjob-example-RL.yaml b/examples/nasjob-example-RL.yaml index db0bf8318f8..04a1c1316d4 100644 --- a/examples/nasjob-example-RL.yaml +++ b/examples/nasjob-example-RL.yaml @@ -8,11 +8,11 @@ metadata: spec: studyName: nas-rl-example owner: crd - optimizationtype: maximize - objectivevaluename: Validation-Accuracy - optimizationgoal: 0.99 - requestcount: 3 - metricsnames: + optimizationType: maximize + objectiveValueName: Validation-Accuracy + optimizationGoal: 0.99 + requestCount: 3 + metricsNames: - accuracy nasConfig: graphConfig: @@ -25,16 +25,16 @@ spec: - 10 operations: - operationType: convolution - parameterconfigs: + parameterConfigs: - name: filter_size - parametertype: categorical + parameterType: categorical feasible: list: - "3" - "5" - "7" - name: num_filter - parametertype: categorical + parameterType: categorical feasible: list: - "32" @@ -43,21 +43,21 @@ spec: - "96" - "128" - name: stride - parametertype: categorical + parameterType: categorical feasible: list: - "1" - "2" - operationType: reduction - parameterconfigs: + parameterConfigs: - name: reduction_type - parametertype: categorical + parameterType: categorical feasible: list: - max_pooling - avg_pooling - name: pool_size - parametertype: int + parameterType: int feasible: min: "2" max: "3" diff --git a/examples/pytorchjob-example.yaml b/examples/pytorchjob-example.yaml index b2d97d3bcb0..4a9e4e11235 100644 --- a/examples/pytorchjob-example.yaml +++ b/examples/pytorchjob-example.yaml @@ -8,20 +8,20 @@ metadata: spec: studyName: pytorchjob-example owner: crd - optimizationtype: maximize - objectivevaluename: accuracy - optimizationgoal: 0.99 - requestcount: 4 - metricsnames: + optimizationType: maximize + objectiveValueName: accuracy + optimizationGoal: 0.99 + requestCount: 4 + metricsNames: - accuracy - parameterconfigs: + parameterConfigs: - name: --lr - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.05" - name: --momentum - parametertype: double + parameterType: double feasible: min: "0.5" max: "0.9" diff --git a/examples/random-example.yaml b/examples/random-example.yaml index dbcd1a9654f..a9416c15ec0 100644 --- a/examples/random-example.yaml +++ b/examples/random-example.yaml @@ -8,25 +8,25 @@ metadata: spec: studyName: random-example owner: crd - optimizationtype: maximize - objectivevaluename: Validation-accuracy - optimizationgoal: 0.99 - requestcount: 4 - metricsnames: + optimizationType: maximize + objectiveValueName: Validation-accuracy + optimizationGoal: 0.99 + requestCount: 4 + metricsNames: - accuracy - parameterconfigs: + parameterConfigs: - name: --lr - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.03" - name: --num-layers - parametertype: int + parameterType: int feasible: min: "2" max: "5" - name: --optimizer - parametertype: categorical + parameterType: categorical feasible: list: - sgd diff --git a/examples/tf-event_test.yaml b/examples/tf-event_test.yaml index 7f2c9ca5b14..cf946a49a3c 100644 --- a/examples/tf-event_test.yaml +++ b/examples/tf-event_test.yaml @@ -8,22 +8,22 @@ metadata: spec: studyName: random-example-long-test owner: crd - optimizationtype: maximize - objectivevaluename: test/accuracy - optimizationgoal: 0.99 - metricsnames: + optimizationType: maximize + objectiveValueName: test/accuracy + optimizationGoal: 0.99 + metricsNames: - train/accuracy - train/cross_entropy - test/accuracy - test/cross_entropy - parameterconfigs: + parameterConfigs: - name: --learning_rate - parametertype: double + parameterType: double feasible: min: "0.001" max: "0.01" - name: --dropout - parametertype: double + parameterType: double feasible: min: "0.7" max: "0.9" diff --git a/examples/tfjob-example.yaml b/examples/tfjob-example.yaml index 6765d2ce4bf..dd23d3482f5 100644 --- a/examples/tfjob-example.yaml +++ b/examples/tfjob-example.yaml @@ -8,20 +8,20 @@ metadata: spec: studyName: tfjob-example owner: crd - optimizationtype: maximize - objectivevaluename: accuracy_1 - optimizationgoal: 0.99 - requestcount: 4 - metricsnames: + optimizationType: maximize + objectiveValueName: accuracy_1 + optimizationGoal: 0.99 + requestCount: 4 + metricsNames: - accuracy_1 - parameterconfigs: + parameterConfigs: - name: --learning_rate - parametertype: double + parameterType: double feasible: min: "0.01" max: "0.05" - name: --batch_size - parametertype: int + parameterType: int feasible: min: "100" max: "200" diff --git a/examples/xgboost-bayesian-example.yaml b/examples/xgboost-bayesian-example.yaml index fd01e8d08a8..ffd41fde8e0 100644 --- a/examples/xgboost-bayesian-example.yaml +++ b/examples/xgboost-bayesian-example.yaml @@ -9,19 +9,19 @@ metadata: spec: studyName: xgboost-example owner: crd - optimizationtype: minimize - objectivevaluename: mean_absolute_error - optimizationgoal: 10000 - requestcount: 10 + optimizationType: minimize + objectiveValueName: mean_absolute_error + optimizationGoal: 10000 + requestCount: 10 - parameterconfigs: + parameterConfigs: - name: --learning-rate - parametertype: double + parameterType: double feasible: min: "0.05" max: "0.15" - name: --n-estimators - parametertype: int + parameterType: int feasible: min: "10000" max: "30000" diff --git a/pkg/api/operators/apis/studyjob/v1alpha1/studyjob_types.go b/pkg/api/operators/apis/studyjob/v1alpha1/studyjob_types.go index 1a606baa2a7..6db042f18bf 100644 --- a/pkg/api/operators/apis/studyjob/v1alpha1/studyjob_types.go +++ b/pkg/api/operators/apis/studyjob/v1alpha1/studyjob_types.go @@ -28,12 +28,12 @@ import ( type StudyJobSpec struct { StudyName string `json:"studyName,omitempty"` Owner string `json:"owner,omitempty"` - OptimizationType OptimizationType `json:"optimizationtype,omitempty"` - OptimizationGoal *float64 `json:"optimizationgoal,omitempty"` - ObjectiveValueName string `json:"objectivevaluename,omitempty"` - RequestCount int `json:"requestcount,omitempty"` - MetricsNames []string `json:"metricsnames,omitempty"` - ParameterConfigs []ParameterConfig `json:"parameterconfigs,omitempty"` + OptimizationType OptimizationType `json:"optimizationType,omitempty"` + OptimizationGoal *float64 `json:"optimizationGoal,omitempty"` + ObjectiveValueName string `json:"objectiveValueName,omitempty"` + RequestCount int `json:"requestCount,omitempty"` + MetricsNames []string `json:"metricsNames,omitempty"` + ParameterConfigs []ParameterConfig `json:"parameterConfigs,omitempty"` WorkerSpec *WorkerSpec `json:"workerSpec,omitempty"` SuggestionSpec *SuggestionSpec `json:"suggestionSpec,omitempty"` EarlyStoppingSpec *EarlyStoppingSpec `json:"earlyStoppingSpec,omitempty"` @@ -59,7 +59,7 @@ type StudyJobStatus struct { LastReconcileTime *metav1.Time `json:"lastReconcileTime,omitempty"` Condition Condition `json:"condition,omitempty"` - StudyID string `json:"studyid,omitempty"` + StudyID string `json:"studyId,omitempty"` SuggestionParameterID string `json:"suggestionParameterId,omitempty"` EarlyStoppingParameterID string `json:"earlyStoppingParameterId,omitempty"` Trials []TrialSet `json:"trials,omitempty"` @@ -70,7 +70,7 @@ type StudyJobStatus struct { } type WorkerCondition struct { - WorkerID string `json:"workerid,omitempty"` + WorkerID string `json:"workerId,omitempty"` Kind string `json:"kind,omitempty"` Condition Condition `json:"condition,omitempty"` ObjectiveValue *float64 `json:"objectiveValue,omitempty"` @@ -79,13 +79,13 @@ type WorkerCondition struct { } type TrialSet struct { - TrialID string `json:"trialid,omitempty"` - WorkerList []WorkerCondition `json:"workeridlist,omitempty"` + TrialID string `json:"trialId,omitempty"` + WorkerList []WorkerCondition `json:"workerIdList,omitempty"` } type ParameterConfig struct { Name string `json:"name,omitempty"` - ParameterType ParameterType `json:"parametertype,omitempty"` + ParameterType ParameterType `json:"parameterType,omitempty"` Feasible FeasibleSpace `json:"feasible,omitempty"` } @@ -200,7 +200,7 @@ type GraphConfig struct { // Operation contains type of operation in DAG type Operation struct { OperationType string `json:"operationType,omitempty"` - ParameterConfigs []ParameterConfig `json:"parameterconfigs,omitempty"` + ParameterConfigs []ParameterConfig `json:"parameterConfigs,omitempty"` } func init() {