Skip to content

Commit

Permalink
Update tensorflow_example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
williamFalcon committed Oct 13, 2017
1 parent da7e5c8 commit 4f35512
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions examples/tensorflow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,16 @@ def train(hparams):
exp.save()


# build a wrapper around a tng function so we can use the correct gpu
# build a wrapper around a tng function so we can use the correct gpu
# the optimizer passes in the hyperparams and the job index as arguments
# to the function to optimize
def parallelize_on_gpus(trial_params, job_index_nb):
gpu_nb = str(job_index_nb)
os.environ["CUDA_VISIBLE_DEVICES"] = gpu_nb
train(trial_params)


# set up our argparser and make the y_val tunable
# set up our argparser and make the y_val tunnable
parser = HyperOptArgumentParser(strategy='random_search')
parser.add_argument('--path', default='some/path')
parser.add_opt_argument_list('--y_val', default=12, options=[1, 2, 3, 4], tunnable=True)
Expand Down

0 comments on commit 4f35512

Please sign in to comment.