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

SSPCAB implementation #500

Merged
merged 11 commits into from
Aug 15, 2022
Merged

SSPCAB implementation #500

merged 11 commits into from
Aug 15, 2022

Conversation

djdameln
Copy link
Contributor

Description

  • This PR adds SSPCAB to model components and adds it as an optional extension to DRAEM.

Changes

  • 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)
  • 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.

I like it! Only few minor points

anomalib/models/components/layers/sspcab.py Outdated Show resolved Hide resolved
anomalib/models/components/layers/sspcab.py Outdated Show resolved Hide resolved
anomalib/models/components/layers/sspcab.py Show resolved Hide resolved
anomalib/models/components/layers/sspcab.py Outdated Show resolved Hide resolved
anomalib/models/draem/lightning_model.py Show resolved Hide resolved
Comment on lines +27 to +28
enable_sspcab: false
sspcab_lambda: 0.1
Copy link
Contributor

Choose a reason for hiding this comment

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

When sspcab_lambda is set to 0, it is not added to the overall loss. In this case, can we assume that sspcab_lambda=0 would be the same as enable_sspcab=false?

Copy link
Contributor

Choose a reason for hiding this comment

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

if yes, it would be possible to just have a single argument, sspcab_lambda. When it is 0, it would be disabled.

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 would be possible, but I think it would be more clear for the user to have an explicit parameter to enable/disable SSPCAB. Especially because we would have to add some logic to enable/disable the sspcab block in the architecture of the torch model based on the value of the lambda parameter. As a user I would not expect the value of the lambda parameter to affect the architecture of the model.

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!

@samet-akcay samet-akcay merged commit b2b5ad4 into main Aug 15, 2022
@samet-akcay samet-akcay deleted the da/sspcab branch August 15, 2022 10:10
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