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

Formatters validation #875

Merged
merged 18 commits into from Feb 20, 2022
Merged

Formatters validation #875

merged 18 commits into from Feb 20, 2022

Conversation

matanper
Copy link
Contributor

@matanper matanper commented Feb 16, 2022

  1. Update formatters validations to work in the same way. until now some raised error on validation, some return string. also some received batch and some received batch[0] or batch[1] (talking about the validation method)
  2. Add formatters validation function and notebook
    resolve [FEAT] Formatters validation for users. #854

@matanper matanper added the feature Feature update or code change to the package label Feb 16, 2022
@matanper matanper self-assigned this Feb 16, 2022
@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

deepchecks/vision/utils/image_formatters.py Outdated Show resolved Hide resolved
docs/source/user-guide/vision/formatter_objects.rst Outdated Show resolved Hide resolved
docs/source/user-guide/vision/formatter_objects.rst Outdated Show resolved Hide resolved
deepchecks/vision/utils/validation.py Outdated Show resolved Hide resolved
Copy link
Collaborator

@noamzbr noamzbr left a comment

Choose a reason for hiding this comment

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

Given all of that, won't it make sense to make "infer" like functions also for image and label?

@@ -160,7 +164,7 @@ def assert_task_type(self, *expected_types: TaskType):
def infer(self, batch: Any) -> Any:
"""Return the predictions on the given batch, and cache them for later."""
if self._batch_prediction_cache is None:
self._batch_prediction_cache = self.model(batch)
self._batch_prediction_cache = self.prediction_formatter(batch, self.model, self.device)
Copy link
Collaborator

Choose a reason for hiding this comment

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

does this work? Shouldn't it be self._device ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no, we have property device

@matanper matanper merged commit d25643e into main Feb 20, 2022
@delete-merged-branch delete-merged-branch bot deleted the formatters-validation branch February 20, 2022 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature update or code change to the package
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEAT] Formatters validation for users.
3 participants