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

Refactor DFKDE model #207

Merged
merged 2 commits into from
Apr 11, 2022
Merged

Conversation

ashwinvaidya17
Copy link
Collaborator

Description

Changes

  • 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

from torch import Tensor, nn

from anomalib.models.components import PCA, GaussianKDE
from anomalib.models.components import PCA, FeatureExtractor, GaussianKDE


class NormalityModel(nn.Module):
Copy link
Contributor

Choose a reason for hiding this comment

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

I would call this DfkdeModel to follow the same naming convention as the other algos.

@samet-akcay
Copy link
Contributor

Thanks, looks good. Some time ago, we discussed about refactoring modules to organize the classes. In many of the algos, the class implementations are in model.py, while some others has model.py and torch_model.py. I think we might need to refactor this as well to have a consistent format throughout the repo. This is out of the scope of this PR, but I think we should be discussing this today.

@ashwinvaidya17
Copy link
Collaborator Author

Thanks, looks good. Some time ago, we discussed about refactoring modules to organize the classes. In many of the algos, the class implementations are in model.py, while some others has model.py and torch_model.py. I think we might need to refactor this as well to have a consistent format throughout the repo. This is out of the scope of this PR, but I think we should be discussing this today.

Yeah I agree. I was following the GANomaly convention as I believe we were planning on having model.py for lightning and torch_model.py for nn.Module. I might be wrong here. Let's discuss.

@ashwinvaidya17 ashwinvaidya17 merged commit 9c6e93e into development Apr 11, 2022
@ashwinvaidya17 ashwinvaidya17 deleted the refactor/av/dfkde_feature_extractor branch April 11, 2022 09:30
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.

Refactor DFKDE NormalityModel to contain the feature extractor
3 participants