Open lorenzoh opened 1 year ago
A documentation preview has been successfully built, view it here: Documentation preview PR-267
@darsnack @theabhirath would love to get feedback on the API. Anything unclear or an important feature missing, let me know!
Implements #246.
PR Checklist
Usage examples
From #269:
Docs
The proposed interface is well-described by the registry description, pasted below:
A
FeatureRegistry
for models. Allows you to find and load models for various learning tasks using a unified interface. Callmodels()
to see a table view of available models:Which models are available depends on the loaded packages. For example, FastVision.jl adds vision models from Metalhead to the registry. Index the registry with a model ID to get more information about that model:
If you've selected a model, call
load
to then instantiate a model:By default,
load
loads a default version of the model without any pretrained weights.load(model)
also accepts keyword arguments that allow you to specify variants of the model and weight checkpoints that should be loaded.Loading a checkpoint of pretrained weights:
load(entry; pretrained = true)
: Use any pretrained weights, if they are available.load(entry; checkpoint = "checkpoint-name")
: Use the weights with given name. Seeentry.checkpoints
for available checkpoints (if any).load(entry; pretrained = false)
: Don't use pretrained weightsLoading a model variant for a specific task:
load(entry; input = ImageTensor, output = OneHotLabel)
: Load a model variant matching an input and output block.load(entry; variant = "backbone"): Load a model variant by name. See
entry.variants` for available variants.