peal.architectures.predictors

Predictor architectures and the loaders that turn a config into a model.

This module holds the classifiers PEAL explains and repairs: SequentialModel builds a plain stack of FC/VGG/ResNet/Transformer blocks from an ArchitectureConfig, while TorchvisionModel wraps pretrained backbones (torchvision ResNets and ViTs, DINOv2/DINOv3, OpenCLIP, PLIP, UNI) behind a common forward/feature_extractor/get_last_layer interface, so that adaptors such as CLARC or CFKD can reach the latent space and the final linear layer. get_predictor resolves whatever a config refers to - a live module, a pickled .cpl, an .onnx graph or a predictor config - into such a model.

Functions

get_predictor

Resolve a predictor reference into a model on device.

load_model

This function loads a model from a given path.

Classes

SequentialModel

A sequential model that is defined by a list of layers.

TorchvisionModel

Pretrained backbone plus a fresh linear head, behind one interface.