Open
Conversation
Contributor
|
A documentation preview has been successfully built, view it here: Documentation preview PR-267 |
2 tasks
Formats and adds more docs
Member
Author
|
@darsnack @theabhirath would love to get feedback on the API. Anything unclear or an important feature missing, let me know! |
Now handles both loading checkpoints and possible transformations. This makes it easier to ntegrate with third-party model libraries that likewise handle both with a single function.
A `loadfn([checkpoint])` holds the default loading function for a model. As a result, the :variants field no longer has to be populated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements #246.
PR Checklist
Usage examples
From #269:
Docs
The proposed interface is well-described by the registry description, pasted below:
A
FeatureRegistryfor models. Allows you to find and load models for various learningtasks using a unified interface. Call
models()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
loadto then instantiate a model:By default,
loadloads 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 andweight 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.checkpointsfor 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 matchingan input and output block.
load(entry; variant = "backbone"): Load a model variant by name. Seeentry.variants` foravailable variants.