Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hyperband Implemented in Place of RandomSearch #332

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 11 additions & 13 deletions libra/modeling/tuner.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,15 +265,15 @@ def build_model(hp):
metrics=[metrics])
return model

hypermodel = HyperResNet(input_shape=(128, 128, 3), num_classes=10)
# tuners, establish the object to look through the tuner search space
tuner = RandomSearch(
build_model,
tuner = Hyperband(
hypermodel,
max_epochs=max_trials,
objective='val_accuracy',
max_trials=max_trials,
executions_per_trial=executions_per_trial,
directory=directory,
project_name='class_tuned')

seed=42,
)

# tuner.search_space_summary()
X_train, X_test, y_train, y_test = train_test_split(
X, y, test_size=0.2, random_state=49)
Expand Down Expand Up @@ -325,13 +325,11 @@ def tuneCNN(
height, width, 3), num_classes=num_classes)

# # tuners, establish the object to look through the tuner search space
tuner = RandomSearch(
tuner = Hyperband(
hypermodel,
objective=objective,
seed=seed,
max_trials=max_trials,
executions_per_trial=executions_per_trial,
directory=directory,
max_epochs=max_trials,
objective='val_accuracy',
seed=42,
)


Expand Down