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

move threshold params to metric configuration callback #328

Conversation

djdameln
Copy link
Contributor

Description

This PR moves the thresholding parameters outside of the model parameters section. This also removes the thresholding-related arguments from the base class, which leads to a cleaner implementation of that class. The responsibility of configuring the threshold metric classes is moved from the base task to the metrics callback.

Changes

  • Refactor
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • My code follows the pre-commit style and check guidelines of this project.
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes

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.

Thanks!

Copy link
Collaborator

@ashwinvaidya17 ashwinvaidya17 left a comment

Choose a reason for hiding this comment

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

Thanks, it is nice that everything is now contained in metric configuration callback.

@samet-akcay samet-akcay merged commit a333dc6 into refactor/sa/lightning-modules May 23, 2022
@samet-akcay samet-akcay deleted the refactor/da/threshold-to-metrics-callback branch May 23, 2022 12:05
samet-akcay added a commit that referenced this pull request May 24, 2022
…e class arguments. (#315)

* Created metrics callback to access the metric params in the module

* Added metrics callback to get_callback function

* 🗑 Removed hparams from visualizer callback

* 🗑 Removed hparams from visualizer callback

* ☑️ Check if image and pixel metrics exist in anomaly module in normalization callbacks

* ➕ Add tiling callback to setup the tiler without configuring the model.

* ➕ Add log_images_to flag to VisualizerCallback

* 🗑 Removed hparams from AnomalyModule and PadimLightning

* 🛠 Fix dummy module to be initialized with explicit arguments

* ➕ Refactor dfm model

* Make thresholding parameters optional in AnomalyModule

* 🗑  Remove pixel threshold from DFM

* create default image and pixel threshold attributes in AnomalyModule

* 🗑  Remove hparams from DFM model and ➕explicit arguments.

* 🗑  Remove hparams from Patchcore model and ➕explicit arguments.

* 🗑  Remove hparams from Stfpm model and ➕explicit arguments.

* 🗑  Remove hparams from GANomaly model and ➕explicit arguments.

* 🗑  Remove hparams from Cflow model and ➕explicit arguments.

* Removed normalization and Fix the tests

* 📦 wrapped PadimLightning model from Padim

* 📦 wrapped PatchcoreLightning model from Patchcore

* 📦 wrapped StfpmLightning model from Stfpm

* 📦 wrapped CflowLightning model from Cflow

* 📦 wrapped CflowLightning model from Cflow

* 📦 wrapped DfkdeLightning model from Dfkde

* 📦 wrapped Dfm and Ganomaly models

* ⏪ Revert DummyModule and visualizer tests

* Fix visualizer tests

* Fix normalization tests

* Add metrics to lightning module

* 🗑 Remove metrics callback

* 🛠️ Fix metrics callback and tests

* 🛠️ Fix metrics callback and tests

* 🛠 Revert on_fit_start to setup in MetricCallback to properly assign threholds in test

* ➕ Added docstring to clarify to-be-deprecated methods

* 🏷 Renamed MetricCallback to MetricConfigurationCallback

* 🏷 Renamed TilerCallback to TilerConfigurationCallback

* 🏷 Renamed MetricCallback to MetricsConfigurationCallback

* 🏷 Renamed tiler.py to tiler_configuration.py

* ⏪ Removed instance check in cdf normalization

* 🚚 Move threshold params to metric configuration callback (#328)

Co-authored-by: Dick Ameln <dick.ameln@intel.com>
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