-
Notifications
You must be signed in to change notification settings - Fork 459
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[GSOC]
optuna
suggestion service logic update (#2446)
* unit test fixed Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * Update pkg/suggestion/v1beta1/hyperopt/base_service.py Co-authored-by: Yuki Iwai <yuki.iwai.tz@gmail.com> Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * comment fixed Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * initial logic update Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * added unit and e2e tests for optuna suggestion service update Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * refactored code Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * added parameter for logUniform and minor changes Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> * fix Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> --------- Signed-off-by: Shashank Mittal <shashank.mittal.mec22@itbhu.ac.in> Co-authored-by: Yuki Iwai <yuki.iwai.tz@gmail.com>
- Loading branch information
1 parent
c2b5b52
commit 6389cba
Showing
5 changed files
with
184 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
--- | ||
apiVersion: kubeflow.org/v1beta1 | ||
kind: Experiment | ||
metadata: | ||
namespace: kubeflow | ||
name: optuna-distribution | ||
spec: | ||
objective: | ||
type: minimize | ||
goal: 0.05 | ||
objectiveMetricName: loss | ||
algorithm: | ||
algorithmName: tpe | ||
parallelTrialCount: 3 | ||
maxTrialCount: 12 | ||
maxFailedTrialCount: 3 | ||
parameters: | ||
- name: lr | ||
parameterType: double | ||
feasibleSpace: | ||
min: "1" | ||
max: "5" | ||
step: "0.1" | ||
distribution: uniform | ||
- name: momentum | ||
parameterType: double | ||
feasibleSpace: | ||
min: "0.001" | ||
max: "3" | ||
distribution: logUniform | ||
- name: epochs | ||
parameterType: int | ||
feasibleSpace: | ||
min: "1" | ||
max: "3" | ||
distribution: uniform | ||
- name: batch_size | ||
parameterType: int | ||
feasibleSpace: | ||
min: "32" | ||
max: "64" | ||
distribution: logUniform | ||
trialTemplate: | ||
primaryContainerName: training-container | ||
trialParameters: | ||
- name: learningRate | ||
description: Learning rate for the training model | ||
reference: lr | ||
- name: momentum | ||
description: Momentum for the training model | ||
reference: momentum | ||
- name: epochs | ||
description: Epochs | ||
reference: epochs | ||
- name: batchSize | ||
description: Batch Size | ||
reference: batch_size | ||
trialSpec: | ||
apiVersion: batch/v1 | ||
kind: Job | ||
spec: | ||
template: | ||
spec: | ||
containers: | ||
- name: training-container | ||
image: docker.io/kubeflowkatib/pytorch-mnist-cpu:latest | ||
command: | ||
- "python3" | ||
- "/opt/pytorch-mnist/mnist.py" | ||
- "--epochs=${trialParameters.epochs}" | ||
- "--batch-size=${trialParameters.batchSize}" | ||
- "--lr=${trialParameters.learningRate}" | ||
- "--momentum=${trialParameters.momentum}" | ||
restartPolicy: Never |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters