Model registry
The W&B Model Registry houses a team's trained models where ML Practitioners can publish candidates for production to be consumed by downstream teams and stakeholders. It is used to house staged/candidate models and manage workflows associated with staging.
With W&B Model Registry, you can:
- Bookmark your best model versions for each machine learning task.
- Automate downstream processes and model CI/CD.
- Move model versions through its ML lifecycle; from staging to production.
- Track a model's lineage and audit the history of changes to production models.
How it worksโ
Track and manage your staged models with a few simple steps.
- Log a model version: In your training script, add a few lines of code to save the model files as an artifact to W&B.
- Compare performance: Check live charts to compare the metrics and sample predictions from model training and validation. Identify which model version performed the best.
- Link to registry: Bookmark the best model version by linking it to a registered model, either programmatically in Python or interactively in the W&B UI.
The following code snippet demonstrates how to log and link a model to the Model Registry:
import wandb
import random
# Start a new W&B run
run = wandb.init(project="models_quickstart")
# Simulate logging model metrics
run.log({"acc": random.random()})
# Create a simulated model file
with open("my_model.h5", "w") as f:
f.write("Model: " + str(random.random()))
# Log and link the model to the Model Registry
run.link_model(path="./my_model.h5", registered_model_name="MNIST")
run.finish()
- Connect model transitions to CI/DC workflows: transition candidate models through workflow stages and automate downstream actions with webhooks or jobs.
How to get startedโ
Depending on your use case, explore the following resources to get started with W&B Models:
- Check out the two-part video series:
- Logging and registering models
- Consuming models and automating downstream processes in the Model Registry.
- Read the models walkthrough for a step-by-step outline of the W&B Python SDK commands you could use to create, track, and use a dataset artifact.
- Learn about:
- Protected models and access control.
- How to connect the Model Registry to CI/CD processes.
- Set up Slack notifications when a new model version is linked to a registered model.
- Review this report on how the Model Registry fits into your ML workflow and the benefits of using one for model management.
- Take the W&B Enterprise Model Management course and learn how to:
- Use the W&B Model Registry to manage and version your models, track lineage, and promote models through different lifecycle stages
- Automate your model management workflows using webhooks and launch jobs.
- See how the Model Registry integrates with external ML systems and tools in your model development lifecycle for model evaluation, monitoring, and deployment.