Skip to content

Commit

Permalink
Merge pull request #1 from Crysple/test-hyperband
Browse files Browse the repository at this point in the history
fix for hyperband
  • Loading branch information
QuanluZhang authored Nov 30, 2018
2 parents 1a4a1d0 + e22ac0b commit c3c8022
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 2 deletions.
39 changes: 39 additions & 0 deletions examples/trials/mnist-hyperband/config_pai.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
authorName: default
experimentName: example_mnist_hyperband
maxExecDuration: 1h
maxTrialNum: 10000
trialConcurrency: 10
#choice: local, remote, pai
trainingServicePlatform: pai
searchSpacePath: search_space.json
#choice: true, false
useAnnotation: false
advisor:
#choice: Hyperband
builtinAdvisorName: Hyperband
classArgs:
#R: the maximum STEPS
R: 100
#eta: proportion of discarded trials
eta: 3
#choice: maximize, minimize
optimize_mode: maximize
trial:
command: python3 mnist.py
codeDir: .
gpuNum: 0
cpuNum: 1
memoryMB: 8196
#The docker image to run nni job on pai
image: openpai/pai.example.tensorflow
#The hdfs directory to store data on pai, format 'hdfs://host:port/directory'
dataDir: hdfs://10.10.10.10:9000/username/nni
#The hdfs directory to store output data generated by nni, format 'hdfs://host:port/directory'
outputDir: hdfs://10.10.10.10:9000/username/nni
paiConfig:
#The username to login pai
userName: username
#The password to login pai
passWord: password
#The host of restful server of pai
host: 10.10.10.10
8 changes: 6 additions & 2 deletions src/sdk/pynni/nni/hyperband_advisor/hyperband_advisor.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,12 @@ def set_config_perf(self, i, parameter_id, seq, value):
seq,
str(type(self.configs_perf[i][parameter_id][0])),
str(type(seq)))
assert self.configs_perf[i][parameter_id][0] < seq
self.configs_perf[i][parameter_id] = [seq, value]
# assert self.configs_perf[i][parameter_id][0] < seq
if self.configs_perf[i][parameter_id][0] < seq:
self.configs_perf[i][parameter_id] = [seq, value]
else:
self.configs_perf[i][parameter_id] = [seq, value]


def inform_trial_end(self, i):
'''
Expand Down

0 comments on commit c3c8022

Please sign in to comment.