Skip to content

Commit

Permalink
Shortening tblogger example runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
Neeratyoy committed Oct 31, 2023
1 parent 17e474f commit 17b9863
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions neps_examples/convenience/neps_tblogger_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,7 @@ def run_pipeline_BO(lr, optim, weight_decay):
"Optimizer choices are defined differently in the pipeline_space"
)

max_epochs = 9
max_epochs = 2 # Epochs to train the model, can be parameterized as fidelity

# Load the MNIST dataset for training, validation, and testing.
train_loader, validation_loader, test_loader = MNIST(
Expand Down Expand Up @@ -338,7 +338,7 @@ def run_pipeline_BO(lr, optim, weight_decay):
parser.add_argument(
"--max_evaluations_total",
type=int,
default=10,
default=3,
help="Number of different configs to train",
)
args = parser.parse_args()
Expand All @@ -356,13 +356,9 @@ def run_pipeline_BO(lr, optim, weight_decay):
neps.run(
run_pipeline=run_pipeline_BO,
pipeline_space=pipeline_space_BO(),
root_directory="bayesian_optimization",
max_evaluations_total=max_evaluations_total,
searcher="bayesian_optimization",
# By default, NePS runs 10 random configurations before sampling
# from the acquisition function. We will change this behavior with
# the following keyword argument.
initial_design_size=5,
root_directory="output",
max_evaluations_total=args.max_evaluations_total,
searcher="random_search",
)

"""
Expand All @@ -371,7 +367,7 @@ def run_pipeline_BO(lr, optim, weight_decay):
run the following command on the file created by neps root_directory.
```bash:
tensorboard --logdir bayesian_optimization
tensorboard --logdir output
```
To be able to check the visualization of tensorboard make sure to
Expand All @@ -396,10 +392,10 @@ def run_pipeline_BO(lr, optim, weight_decay):
the following command in your terminal:
```bash:
python neps_tblogger_tutorial.py --max_evaluations_total 15
python neps_tblogger_tutorial.py --max_evaluations_total 10
```
This adds five more configurations to your search and turns off tblogger.
This adds seven more configurations to your search and turns off tblogger.
By default, tblogger is on, but you can control it with `tblogger.enable()`
or `tblogger.disable()` in your code."
"""

0 comments on commit 17b9863

Please sign in to comment.