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
π add subset to slice datasets #2038
Conversation
Check out this pull request onΒ See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
Signed-off-by: mohali <mohamed.ali@blnk.ai>
Signed-off-by: mohali <mohamed.ali@blnk.ai>
Signed-off-by: mohali <mohamed.ali@blnk.ai>
Hey, this functionality is already built in Lightning: limit_train_batches (Union[int, float, None]) β How much of training dataset to check (float = fraction, int = num_batches). Default: 1.0. limit_val_batches (Union[int, float, None]) β How much of validation dataset to check (float = fraction, int = num_batches). Default: 1.0. limit_test_batches (Union[int, float, None]) β How much of test dataset to check (float = fraction, int = num_batches). Default: 1.0. You can pass trainer arguments to the |
Hi @MightyStud, thanks for creating this PR. As @alexriedel1 mentioned above, this is already possible with Lightning. For details, you could refer here Here is how you could use this: from anomalib.data import MVTec
from anomalib.models import Patchcore
from anomalib.engine import Engine
# Create datamodule and model, whichever data and model you want to import.
datamodule = MVTec()
model = Patchcore()
# default used by the Trainer
engine = Engine(limit_val_batches=1.0)
# run through only 25% of the validation set each epoch
engine = Engine(limit_val_batches=0.25)
# run for only 10 batches
engine = Engine(limit_val_batches=10)
# disable validation
engine = Engine(limit_val_batches=0) |
I think we close this PR as the feature is already available. We would welcome more of your contributions in the future. Thanks a lot for the effort! |
π Description
Added the functionality to only take a percentage of the subset of the data, Afaik, you only can use all the data for training/testing, but with this PR you can use a subset of the data which is quite handy when experimenting.
β¨ Changes
add subset argument to folder class
Select what type of change your PR is:
β Checklist
Before you submit your pull request, please make sure you have completed the following steps:
For more information about code review checklists, see the Code Review Checklist.