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

[Tune] output of ray.tuner.fit().get_best_result #49327

Open
enori opened this issue Dec 18, 2024 · 0 comments
Open

[Tune] output of ray.tuner.fit().get_best_result #49327

enori opened this issue Dec 18, 2024 · 0 comments
Labels
enhancement Request for new feature and/or capability triage Needs triage (eg: priority, bug/not-bug, and owning component) tune Tune-related issues

Comments

@enori
Copy link
Contributor

enori commented Dec 18, 2024

Description

results_grids = ray.tuner.fit()
best_results = results_grids.get_best_result(
    metric="mean_accuracy",
    mode="max"
)

print("Best config: ", best_results)

After performing hyperparameter tuning with the above code, the output results were as follows:

Best config:  Result(
  metrics={'mean_accuracy': 0.965625, 'lr': 0.12270249077413087},
  path='ray-results/pbt_test/train_convnet_03fb1_00001_1_lr=0.1227,momentum=0.8192_2024-12-17_02-45-22',
  filesystem='s3',
  checkpoint=Checkpoint(filesystem=s3, path=ray-results/pbt_test/train_convnet_03fb1_00001_1_lr=0.1227,momentum=0.8192_2024-12-17_02-45-22/checkpoint_000007)
)

I was confused because lr (learning_rate) was included in the metrics.
Additionally, I expected the hyperparameters to be displayed in the output, but they were not. Instead, they were stored in the file ray-results/pbt_test/train_convnet_03fb1_00001_1_lr=0.1227,momentum=0.8192_2024-12-17_02-45-22/params.json, which required accessing the file.

Therefore, I was wondering if the output could be changed as follows:

Best config:  Result(
  metrics={'mean_accuracy': 0.965625, 'loss': xxxxxxx, 'mean_absolute_error': xxxxxxx},
  params={'checkpoint_interval': 5, 'lr': 0.12270249077413087, 'momentum': 0.8192463882731192},
  path='ray-results/pbt_test/train_convnet_03fb1_00001_1_lr=0.1227,momentum=0.8192_2024-12-17_02-45-22',
  filesystem='s3',
  checkpoint=Checkpoint(filesystem=s3, path=ray-results/pbt_test/train_convnet_03fb1_00001_1_lr=0.1227,momentum=0.8192_2024-12-17_02-45-22/checkpoint_000007)
)

Thank you always for your amazing supports and Ray!

@enori enori added enhancement Request for new feature and/or capability triage Needs triage (eg: priority, bug/not-bug, and owning component) labels Dec 18, 2024
@enori enori changed the title RayTune RayTune: output of ray.tuner.fit().get_best_result Dec 18, 2024
@jcotant1 jcotant1 added the tune Tune-related issues label Dec 18, 2024
@enori enori changed the title RayTune: output of ray.tuner.fit().get_best_result [Ray Tune] output of ray.tuner.fit().get_best_result Dec 23, 2024
@enori enori changed the title [Ray Tune] output of ray.tuner.fit().get_best_result [Tune] output of ray.tuner.fit().get_best_result Dec 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Request for new feature and/or capability triage Needs triage (eg: priority, bug/not-bug, and owning component) tune Tune-related issues
Projects
None yet
Development

No branches or pull requests

2 participants