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

V2: Fix small hpopt bugs and add example notebook #842

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

hwpang
Copy link
Contributor

@hwpang hwpang commented Apr 25, 2024

Description

Add an example hpopt notebook. Happy to take suggestion on the notebook.
Found some small bugs related to input type and saving hpopt results while working on the notebook. Fixed those.

Example / Current workflow

n/a

Bugfix / Desired workflow

n/a

Questions

n/a

Relevant issues

n/a

Checklist

  • linted with flake8?
  • (if appropriate) unit tests added?

@hwpang hwpang added this to the v2.0.1 milestone Apr 25, 2024
@hwpang hwpang requested a review from shihchengli April 25, 2024 19:46
Copy link
Contributor

@shihchengli shihchengli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for making this PR. There are two minor things you might consider adding to the notebook:

  1. Include metrics within the model (e.g., metric_list = [nn.metrics.RMSEMetric(), nn.metrics.MAEMetric()]) in the notebook.
  2. Add the ASHAScheduler to the notebook, as we use it by default.

@@ -242,6 +243,9 @@ def update_args_with_config(args: Namespace, config: dict) -> Namespace:
case "init_lr_ratio":
setattr(args, "init_lr", value * args.max_lr)

case "batch_size" | "depth" | "ffn_num_layers" | "ffn_hidden_dim" | "message_hidden_dim":
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warmup_epochs?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be fixed in #873 and this line can be removed after that.

chemprop/cli/hpopt.py Outdated Show resolved Hide resolved
chemprop/cli/hpopt.py Outdated Show resolved Hide resolved
chemprop/cli/hpopt.py Outdated Show resolved Hide resolved
@shihchengli
Copy link
Contributor

The test fails because the filename has changed. Changing the filename of "best_params.json" to "best_config.json" in test_hyperopt_quick within tests/unit/utils/test_save_load_mol.py can fix it.

@kevingreenman
Copy link
Member

kevingreenman commented May 14, 2024

should we add another notebook with an example of using hpopt with optuna, in addition to the hyperopt example? (after #783 is resolved) see #774

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants