data
WeightEntry
WeightEntry(url: str, sha256: str, num_classes: int, transforms: Transform, meta: dict[str, object] = dict())Immutable manifest describing one pretrained checkpoint.
A WeightEntry is the value held by each
WeightsEnum member. It is everything the runtime needs to
fetch, verify, and load a checkpoint — but nothing about the model
architecture itself (that is fixed by the factory that consumes the
entry).
Parameters
urlstrDirect download URL of the
model.safetensors blob. Lucid
hosts these on the Hugging Face Hub under the lucid-dl org
(.../resolve/main/<TAG>/model.safetensors) but no
provider-specific knowledge is encoded here — any HTTPS URL
works.sha256strHex-encoded SHA-256 digest of the file at
url. Verified
after download and on every cache hit; a mismatch forces a
re-download (the cached copy is presumed corrupt).num_classesintNumber of output classes the checkpoint's head produces (e.g.
1000 for ImageNet-1k). Lets callers sanity-check the entry
against a model's configured num_classes before loading.transformsTransformPreprocessing pipeline the weights were trained with — applied
to inputs at inference time so
resnet_18(pretrained=True)
"just works". A lucid.utils.transforms transform (e.g.
lucid.utils.transforms.ImageClassification).metadict= dict()Free-form provenance + metrics. Conventional keys:
source
(e.g. "torchvision/ResNet18_Weights.IMAGENET1K_V1"),
license, recipe, metrics (nested
{dataset: {metric: value}}), num_params, gflops,
file_size_mb. Rendered into the Hub config.json +
model card by the conversion tool.Notes
Frozen (frozen=True) so entries can be shared by reference and
used as enum.Enum values. Two members carrying the same
WeightEntry instance collapse into an enum alias — this is how
DEFAULT = IMAGENET1K_V1 works (see WeightsEnum).