Furthering research efforts

Reproduce machine learning results with pre-trained models in PyTorch Hub

Sarah Schlothauer
© Shutterstock / Quon_ID

PyTorch offers a new API that will help machine learning researchers to reproduce research results. PyTorch Hub supports the publication of pre-trained models in order to help facilitate more transparent ML research. Do you have a pre-trained model that you wish to submit? PyTorch Hub accepts contributions.

Facebook’s open source deep learning platform Pytorch has been on the up and up, with a recent May update improving JIT compilation and offering TensorBoard support.

PyTorch unveiled some news regarding open and reproducible research.

Currently, in beta phase, meet PyTorch Hub. According to its documentation, it is a “pre-trained model repository designed to facilitate research reproducibility“. This API and workflow allow for easier, more transparent reproducibility, which is an important part of machine learning and reliable data science.

ML research reproducibility

From the announcement blog: “As a user, PyTorch Hub allows you to follow a few simple steps and do things like: 1) explore available models; 2) load a model; and 3) understand what methods are available for any given model.”

It also comes with built-in support and integration for Papers with Code and Google’s Colab, two free-to-use deep learning resources.

SEE ALSO: Create interactive data-exploration tools and web apps with Python in Panel

Machine learning researchers can explore through a variety of pre-trained models, including: BERT, Deeplabv3-ResNet101, U-Net for brain MRI, and more.

More models to come as the project grows more mature. See them at Papers With Code, which offers free and open source papers, code, and evaluation tables. See an example of how Papers With Code works. Google Colab example also available here.

Users can load pre-trained models using a single command and the torch.hub.load() API.

Join the hub

Users are free to contribute their own models if they use public data, not private. Have a pre-trained model that you would like to submit to further ML reproducibility efforts and potentially help further research? Find out how to submit and create a pull request via GitHub. Host your models either on a cloud or on GitHub.

PyTorch Hub supports publishing pre-trained models (model definitions and pre-trained weights) to a GitHub repository by adding a simple file.

SEE ALSO: Pythia: Facebook’s deep learning framework for the vision and language domain

For developers, ML plug-and-play models are slated for arrival in the future.

Upcoming changes also include the addition of an upvote/downvote system for models so that users can vote on the most useful or relevant.

Refer to the full documentation for PyTorch Hub and find out more about running a loaded model.

Sarah Schlothauer

Sarah Schlothauer

All Posts by Sarah Schlothauer

Sarah Schlothauer is the editor for She received her Bachelor's degree from Monmouth University, West Long Branch, New Jersey. She currently lives in Frankfurt, Germany with her husband and cat where she enjoys reading, writing, and medieval reenactment. She is also the editor for Conditio Humana, an online magazine about ethics, AI, and technology.

Inline Feedbacks
View all comments