yuyin / README.md
maytoo's picture
initial commit
3f689a6
metadata
title: Aim
emoji: 🔥
colorFrom: purple
colorTo: blue
sdk: docker
license: apache-2.0
fullWidth: true

Aim on Spaces

Hugging Face Spaces offer a simple way to host ML demo apps directly on your profile or your organization’s profile. This allows you to create your ML portfolio, showcase your projects at conferences or to stakeholders, and work collaboratively with other people in the ML ecosystem. Hugging Face Spaces make it easy for you to create and deploy ML-powered demos in minutes.

Check out the Hugging Face Spaces docs to learn more about Spaces.

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.