Skip to content

Commit

Permalink
add e2e tests for hyperopt
Browse files Browse the repository at this point in the history
Signed-off-by: Shashank Mittal <[email protected]>
  • Loading branch information
shashank-iitbhu committed Aug 30, 2024
1 parent f0e8a12 commit bd18135
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
60 changes: 60 additions & 0 deletions examples/v1beta1/hp-tuning/hyperopt-distribution.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
---
apiVersion: kubeflow.org/v1beta1
kind: Experiment
metadata:
namespace: kubeflow
name: hyperopt-distribution
spec:
objective:
type: minimize
goal: 0.001
objectiveMetricName: loss
algorithm:
algorithmName: random
parallelTrialCount: 3
maxTrialCount: 12
maxFailedTrialCount: 3
parameters:
- name: lr
parameterType: double
feasibleSpace:
min: "0.01"
max: "0.05"
step: "0.01"
distribution: "uniform"
- name: momentum
parameterType: double
feasibleSpace:
min: "0.5"
max: "0.9"
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
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=1"
- "--batch-size=16"
- "--lr=${trialParameters.learningRate}"
- "--momentum=${trialParameters.momentum}"
resources:
limits:
memory: "1Gi"
cpu: "0.5"
restartPolicy: Never
2 changes: 0 additions & 2 deletions examples/v1beta1/hp-tuning/random.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@ spec:
feasibleSpace:
min: "0.01"
max: "0.05"
step: "0.01"
distribution: "logUniform"
- name: momentum
parameterType: double
feasibleSpace:
Expand Down

0 comments on commit bd18135

Please sign in to comment.