Skip to content

nexuml_library.scenarios.vision.cifar_resnet

nexuml_library.scenarios.vision.cifar_resnet

Composed CIFAR + ResNet classification scenarios.

cifar_resnet

cifar_resnet(
    dataset: str = "cifar10",
    download: bool = True,
    resnet_type: str = "resnet18",
    pretrained: bool = False,
    cifar_stem: bool | None = None,
    lr: float = 0.001,
    batch_size: int = 64,
    max_epochs: int = 10,
) -> ScenarioSpec

CIFAR image classification with ResNet backbone.

Parameters:

Name Type Description Default
dataset str

"cifar10" or "cifar100".

'cifar10'
download bool

Auto-download dataset if not present.

True
resnet_type str

ResNet variant (e.g. "resnet18").

'resnet18'
pretrained bool

Load pretrained ImageNet weights.

False
cifar_stem bool | None

Use CIFAR-friendly stem. Defaults to True when pretrained=False.

None
lr float

Learning rate.

0.001
batch_size int

Training batch size.

64
max_epochs int

Maximum training epochs.

10

Returns:

Name Type Description
ScenarioSpec ScenarioSpec

Assembled scenario with pipeline, training, data and evaluation.

Raises:

Type Description
ValueError

If dataset is not "cifar10" or "cifar100".