Getting Started

How to get started with Swanlab

1

Install SwanLab

Run `pip install swanlab` to install the core package.

2

Login with API Key

Use `swanlab login -k api-key` or `swanlab.login(api_key="Your API Key")` with a key obtained from https://swanlab.cn settings.

3

Initialize an Experiment

Create an experiment instance with `run = swanlab.init(project="my-project", config={"learning_rate": 0.01})`.

4

Log Metrics During Training

Within the training loop, log metrics using `run.log({"loss": loss})`.

5

View Experiment Dashboard

Access the dashboard online at https://swanlab.cn or locally with `swanlab watch ./swanlog` after installing the dashboard extension.