Image classifier test
Example showing how the test suite can be used to add tests for a new algorithm.
TestImageClassifier #
Bases: LightningModuleTests[ImageClassifier]
Tests for the ImageClassifier
.
This runs all the tests included in the base class, with the given parametrizations:
algorithm_config
will take the value"image_classifier"
- This is because there is an
image_classifier.yaml
config file in project/configs/algorithms whose_target_
is theImageClassifier
.
- This is because there is an
datamodule_config
will take these values:['cifar10', 'fashion_mnist', 'imagenet', 'inaturalist', 'mnist']
- These are all the configs whose target is an
ImageClassificationDataModule
.
- These are all the configs whose target is an
- Similarly,
network_config
will be parametrized by the names of all configs which produce an nn.Module, except those that would create aPreTrainedModel
from HuggingFace.- This is currently the easiest way for us to say "any network for image classification.
Take a look at the LightningModuleTests
class if you want to see the actual test code.