1
1
---
2
+ ---
2
3
apiVersion : kubeflow.org/v1beta1
3
4
kind : Experiment
4
5
metadata :
5
- name : grid-example
6
6
namespace : kubeflow-user
7
+ name : grid
7
8
spec :
9
+ objective :
10
+ type : minimize
11
+ goal : 0.1
12
+ objectiveMetricName : loss
13
+ algorithm :
14
+ algorithmName : grid
15
+ parallelTrialCount : 2
16
+ maxTrialCount : 2
17
+ maxFailedTrialCount : 2
8
18
parameters :
9
19
- name : lr
10
20
parameterType : double
11
21
feasibleSpace :
12
- max : ' 0.01'
13
- min : ' 0.001'
14
- step : ' 0.001'
15
- - name : num-layers
16
- parameterType : int
17
- feasibleSpace :
18
- max : ' 3'
19
- min : ' 2'
20
- - name : optimizer
21
- parameterType : categorical
22
+ min : " 0.01"
23
+ step : " 0.005"
24
+ max : " 0.05"
25
+ - name : momentum
26
+ parameterType : double
22
27
feasibleSpace :
23
- list :
24
- - adam
25
- objective :
26
- type : maximize
27
- goal : 0.80
28
- objectiveMetricName : Validation-accuracy
29
- additionalMetricNames :
30
- - Train-accuracy
31
- metricStrategies :
32
- - name : Validation-accuracy
33
- value : max
34
- - name : Train-accuracy
35
- value : max
36
- algorithm :
37
- algorithmName : grid
28
+ min : " 0.5"
29
+ step : " 0.1"
30
+ max : " 0.9"
38
31
trialTemplate :
32
+ primaryContainerName : training-container
33
+ trialParameters :
34
+ - name : learningRate
35
+ description : Learning rate for the training model
36
+ reference : lr
37
+ - name : momentum
38
+ description : Momentum for the training model
39
+ reference : momentum
39
40
trialSpec :
40
41
apiVersion : batch/v1
41
42
kind : Job
42
43
spec :
43
44
template :
44
- metadata :
45
- labels :
46
- sidecar.istio.io/inject : ' false'
47
45
spec :
48
46
containers :
49
- - command :
50
- - python3
51
- - /opt/mxnet-mnist/mnist.py
52
- - ' --batch-size=64 '
53
- - ' --lr=${trialParameters.learningRate} '
54
- - ' --num-layers=${trialParameters.numberLayers} '
55
- - ' --optimizer=${trialParameters.optimizer} '
56
- image : docker.io/kubeflowkatib/mxnet-mnist:latest
57
- name : training-container
47
+ - name : training-container
48
+ image : docker.io/kubeflowkatib/pytorch-mnist-cpu:latest
49
+ command :
50
+ - " python3 "
51
+ - " /opt/pytorch-mnist/mnist.py "
52
+ - " --epochs=1 "
53
+ - " --batch-size=16 "
54
+ - " --lr=${trialParameters.learningRate} "
55
+ - " --momentum=${trialParameters.momentum} "
58
56
restartPolicy : Never
59
- trialParameters :
60
- - name : learningRate
61
- description : Learning rate for the training model
62
- reference : lr
63
- - name : numberLayers
64
- description : Number of training model layers
65
- reference : num-layers
66
- - name : optimizer
67
- description : Training model optimizer (sdg, adam or ftrl)
68
- reference : optimizer
69
- primaryContainerName : training-container
70
- successCondition : status.conditions.#(type=="Complete")#|#(status=="True")#
71
- failureCondition : status.conditions.#(type=="Failed")#|#(status=="True")#
72
- parallelTrialCount : 1
73
- maxTrialCount : 1
74
- maxFailedTrialCount : 1
75
- metricsCollectorSpec :
76
- collector :
77
- kind : StdOut
78
- resumePolicy : LongRunning
0 commit comments