forked from data-science-on-aws/data-science-on-aws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hyperband-example.yaml
70 lines (70 loc) · 1.68 KB
/
hyperband-example.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
apiVersion: "kubeflow.org/v1alpha3"
kind: Experiment
metadata:
name: hyperband-example
spec:
parallelTrialCount: 9
maxTrialCount: 9
objective:
type: maximize
goal: 0.99
objectiveMetricName: Validation-accuracy
additionalMetricNames:
- accuracy
algorithm:
algorithmName: hyperband
algorithmSettings:
- name: "resource_name"
value: "--num-epochs"
- name: "eta"
value: "3"
- name: "r_l"
value: "9"
maxFailedTrialCount: 9
parameters:
- name: --lr
parameterType: double
feasibleSpace:
min: "0.01"
max: "0.03"
- name: --num-layers
parameterType: int
feasibleSpace:
min: "2"
max: "5"
- name: --optimizer
parameterType: categorical
feasibleSpace:
list:
- sgd
- adam
- ftrl
- name: --num-epochs
parameterType: int
feasibleSpace:
min: "20"
max: "20"
trialTemplate:
goTemplate:
rawTemplate: |-
apiVersion: batch/v1
kind: Job
metadata:
name: {{.Trial}}
namespace: {{.NameSpace}}
spec:
template:
spec:
containers:
- name: {{.Trial}}
image: katib/mxnet-mnist-example
command:
- "python"
- "/mxnet/example/image-classification/train_mnist.py"
- "--batch-size=64"
{{- with .HyperParameters}}
{{- range .}}
- "{{.Name}}={{.Value}}"
{{- end}}
{{- end}}
restartPolicy: Never