You only need a few steps to get started with Aim.
Install Aim via pip3:
pip3 install aim
.. note:: You need to have python3 and pip3 installed in your environment before installing Aim.
- Create Run stored in the current directory:
from aim import Run
run = Run()
- Log parameters:
run['hparams'] = {
'learning_rate': 0.001,
'batch_size': 32,
}
- Track metrics:
for i in range(10):
run.track(i, name='loss', step=i, context={ "subset":"train" })
run.track(i, name='acc', step=i, context={ "subset":"train" })
More details/examples here.
Congrats! Your first run is ready!
Start up the Aim UI to observe the run:
aim up
See more details in UI basics.
from aim import Repo
# Read .aim repo located at the current working directory
repo = Repo('.')
# Get collection of metrics
for run_metrics_collection in repo.query_metrics("metric.name == 'loss'").iter_runs():
for metric in run_metrics_collection:
# Get run params
params = metric.run[...]
# Get metric values
steps, metric_values = metric.values.sparse_numpy()
See more details in SDK basics.