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

Fix docstrings #22

Merged
merged 16 commits into from
Dec 27, 2021
Merged

Fix docstrings #22

merged 16 commits into from
Dec 27, 2021

Conversation

ashwinvaidya17
Copy link
Collaborator

Changes

  • Addresses doc string issues.

Known Issues

  • We can add more examples to the docstring.

@ashwinvaidya17 ashwinvaidya17 added the Documentation Improvements or additions to documentation label Dec 13, 2021
"""Call when the test begins."""
"""Call when the test begins.

Loads the model weights from into the PyTorch module.
Copy link
Contributor

Choose a reason for hiding this comment

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

Something's missing between from and into

Copy link
Contributor

Choose a reason for hiding this comment

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

file?

tensor: torch.Tensor: Input tensor from which covariance matrix is computed.
bias: Optional[bool]: (Default value = False)
tensor (Tensor): Input tensor from which covariance matrix is computed.
bias (Optional[bool]): (Default value = False)
Copy link
Contributor

Choose a reason for hiding this comment

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

Can you add a description for this parameter?

"""Pre process the CNN features.

Args:
feature_stack: Features extracted from CNN
max_length:
feature_stack: torch.Tensor:
feature_stack: Tensor:
max_length: Optional[Tensor]: (Default value = None)
Copy link
Contributor

Choose a reason for hiding this comment

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

Descriptions are missing here

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Thanks! I missed these.

@djdameln
Copy link
Contributor

Few minor comments

C = U.S^2.U^T
This simplifies the calculation of the log-likelihood without requiring full matrix inversion.
Covariance matrix is not calculated directly using:
C = X.X^T
Copy link
Contributor

Choose a reason for hiding this comment

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

maybe we could have these equations within quotes to properly render in the docs

Copy link
Contributor

Choose a reason for hiding this comment

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

like C = X.X^T?

batch: Dict: Input batch
batch_idx: int: Index of the batch.
batch (List[Dict[str, Any]]): Input batch
_ (int): Index of the batch.
Copy link
Contributor

Choose a reason for hiding this comment

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

We could remove this. It'll appear in the documentation, which won't make sense to the reader.

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.

only couple of minor comment

@djdameln djdameln merged commit 28b8f3d into development Dec 27, 2021
@djdameln djdameln deleted the refactor/ashwin/fix_docstrings branch December 27, 2021 10:04
djdameln pushed a commit to djdameln/anomalib that referenced this pull request Jan 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants