8000 Add drop_last parameter to WsiBatchSamplerPredict by EricMarcus-ai · Pull Request #30 · NKI-AI/ahcore · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
This repository was archived by the owner on Oct 19, 2024. It is now read-only.

Add drop_last parameter to WsiBatchSamplerPredict #30

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ahcore/data/samplers.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def __init__(
self,
sampler: SequentialSampler | None = None,
batch_size: int | None = None,
drop_last: bool | None = None,
drop_last: bool = False,
dataset: ConcatDataset[TiledROIsSlideImageDataset] | None = None,
) -> None:
if sampler is not None: # During the predict phase, the sampler is passed as a parameter
Expand All @@ -74,6 +74,7 @@ def __init__(
self._dataset: ConcatDataset[TiledROIsSlideImageDataset] = dataset # type: ignore
4E4B super().__init__(data_source=self._dataset)
self.batch_size = batch_size
self.drop_last = False # This is needed for compatibility with Lightning, it serves no functional purpose

self._slices: List[slice] = []
self._populate_slices()
Expand Down
0