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

🚀 Add HPO #2188

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

Conversation

ashwinvaidya17
Copy link
Collaborator

@ashwinvaidya17 ashwinvaidya17 commented Jul 15, 2024

📝 Description

  • Provide a clear summary of the changes and the issue that has been addressed.
  • 🛠️ Fixes # (issue number)

TODO

  • Unit tests
  • wandb HPO

✨ Changes

Select what type of change your PR is:

  • 🐞 Bug fix (non-breaking change which fixes an issue)
  • 🔨 Refactor (non-breaking change which refactors the code base)
  • 🚀 New feature (non-breaking change which adds functionality)
  • 💥 Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • 📚 Documentation update
  • 🔒 Security update

✅ Checklist

Before you submit your pull request, please make sure you have completed the following steps:

  • 📋 I have summarized my changes in the CHANGELOG and followed the guidelines for my type of change (skip for minor changes, documentation updates, and test enhancements).
  • 📚 I have made the necessary updates to the documentation (if applicable).
  • 🧪 I have written tests that support my changes and prove that my fix is effective or my feature works (if applicable).

For more information about code review checklists, see the Code Review Checklist.

Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Copy link
Contributor

@samet-akcay samet-akcay left a comment

Choose a reason for hiding this comment

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

done with the initial round. I'll go over it again later



@dataclass
class ParserConfig:
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if I fully understand this object. Is it parsing objects? or storing them in one dataclass?


Args:
project (str): The project name.
entity (str | None): The entity or team name that is associated with the backend account.
Copy link
Contributor

Choose a reason for hiding this comment

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

Is entity what comet uses as an argument as well?

logger: "Logger"


class CometParser:
Copy link
Contributor

Choose a reason for hiding this comment

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

If I follow the description in the docstring, would it be an idea to name this class as CometConfigParser?

return CometParser(project=self.project, entity=self.entity)
case HPOBackend.WANDB:
msg = "wandb backend is not supported yet."
raise ValueError(msg)
Copy link
Contributor

Choose a reason for hiding this comment

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

would it be an idea to replace this with NotImplementedError

) -> Generator[HPOJob, None, None]:
"""Return iterator based on the arguments."""
del previous_stage_result # Not needed for this job
assert config is not None, "Config is required for HPOJobGenerator."
Copy link
Contributor

Choose a reason for hiding this comment

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

Would it be possible to raise an error instead. Ruff does not like assert statements in the codebase

Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Signed-off-by: Ashwin Vaidya <ashwinnitinvaidya@gmail.com>
Copy link

codecov bot commented Jul 16, 2024

Codecov Report

Attention: Patch coverage is 59.11950% with 65 lines in your changes missing coverage. Please review.

Project coverage is 80.48%. Comparing base (cfd3d8e) to head (d23f48c).

Files Patch % Lines
src/anomalib/pipelines/hpo/wandb_job.py 51.16% 21 Missing ⚠️
src/anomalib/pipelines/hpo/utils.py 26.31% 14 Missing ⚠️
src/anomalib/pipelines/hpo/comet_job_generator.py 60.60% 13 Missing ⚠️
src/anomalib/pipelines/hpo/comet_job.py 59.25% 11 Missing ⚠️
src/anomalib/pipelines/hpo/pipeline.py 66.66% 3 Missing ⚠️
src/anomalib/pipelines/hpo/wandb_job_generator.py 78.57% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2188      +/-   ##
==========================================
- Coverage   80.80%   80.48%   -0.33%     
==========================================
  Files         248      255       +7     
  Lines       10859    11010     +151     
==========================================
+ Hits         8775     8861      +86     
- Misses       2084     2149      +65     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

2 participants