Hub documentation

Aim on Spaces

Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

Aim on Spaces

Aim is an easy-to-use & supercharged open-source experiment tracker. Aim logs your training runs and enables a beautiful UI to compare them and an API to query them programmatically. ML engineers and researchers use Aim explorers to compare 1000s of training runs in a few clicks.

Check out the Aim docs to learn more about Aim. If you have an idea for a new feature or have noticed a bug, feel free to open a feature request or report a bug.

In the following sections, you’ll learn how to deploy Aim on the Hugging Face Hub Spaces and explore your training runs directly from the Hub.

Deploy Aim on Spaces

You can deploy Aim on Spaces with a single click!

Once you have created the Space, you’ll see the Building status, and once it becomes Running, your Space is ready to go!

Creating an Aim Space

Now, when you navigate to your Space’s App section, you can access the Aim UI.

Compare your experiments with Aim on Spaces

Let’s use a quick example of a PyTorch CNN trained on MNIST to demonstrate end-to-end Aim on Spaces deployment. The full example is in the Aim repo examples folder.

from aim import Run
from aim.pytorch import track_gradients_dists, track_params_dists

# Initialize a new Run
aim_run = Run()
...
items = {'accuracy': acc, 'loss': loss}
aim_run.track(items, epoch=epoch, context={'subset': 'train'})

# Track weights and gradients distributions
track_params_dists(model, aim_run)
track_gradients_dists(model, aim_run)

The experiments tracked by Aim are stored in the .aim folder. To display the logs with the Aim UI in your Space, you need to compress the .aim folder to a tar.gz file and upload it to your Space using git or the Files and Versions sections of your Space.

Here’s a bash command for that:

tar -czvf aim_repo.tar.gz .aim

That’s it! Now open the App section of your Space and the Aim UI is available with your logs. Here is what to expect:

Aim UI on HF Hub Spaces

Filter your runs using Aim’s Pythonic search. You can write pythonic queries against EVERYTHING you have tracked - metrics, hyperparams etc. Check out some examples on HF Hub Spaces.

Note that if your logs are in TensorBoard format, you can easily convert them to Aim with one command and use the many advanced and high-performant training run comparison features available.

More on HF Spaces

Feedback and Support

If you have improvement suggestions or need support, please open an issue on Aim GitHub repo.

The Aim community Discord is also available for community discussions.

< > Update on GitHub