### Install SwanLab via pip Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Installs the SwanLab package from PyPI using pip. ```bash pip install swanlab ``` -------------------------------- ### Install SwanLab from Source Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Two methods to install the latest SwanLab version directly from the source code on GitHub. ```bash # Method 1 git clone https://github.com/SwanHubX/SwanLab.git pip install -e . # Method 2 pip install git+https://github.com/SwanHubX/SwanLab.git ``` -------------------------------- ### Install SwanLab Dashboard Extension Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Installs the optional dashboard extension for SwanLab, enabling offline dashboard viewing. ```bash pip install 'swanlab[dashboard]' ``` -------------------------------- ### Integrate SwanLab with Python Code Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Initializes a SwanLab experiment and logs metrics. The example creates a project named 'my-first-ml' with a learning rate config, then logs loss and accuracy values in a loop. ```python import swanlab # Initialize a new SwanLab experiment swanlab.init( project="my-first-ml", config={"learning-rate": 0.003}, ) # Log metrics for i in range(10): swanlab.log({"loss": i, "acc": i}) ``` -------------------------------- ### Login to SwanLab via CLI Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Starts the SwanLab CLI login process. You will be prompted to enter your API Key, which you can copy from User Settings > API Key on swanlab.cn. ```bash swanlab login ``` -------------------------------- ### SwanLab README Badge Markdown Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Add these markdown links to your README to display the SwanLab badge. Replace 'your experiment url' with the actual URL of your experiment. ```markdown [![](https://raw.githubusercontent.com/SwanHubX/assets/main/badge2.svg)](your experiment url) [![](https://raw.githubusercontent.com/SwanHubX/assets/main/badge1.svg)](your experiment url) ``` -------------------------------- ### Citing SwanLab in Papers (BibTeX) Source: https://github.com/swanhubx/swanlab/blob/main/README_EN.md Use this BibTeX entry to cite SwanLab in academic papers. It includes the DOI, license, and author information. ```bibtex @software{Zeyilin_SwanLab_2023, author = {Zeyi Lin, Shaohong Chen, Kang Li, Qiushan Jiang, Zirui Cai, Kaifang Ji and {The SwanLab team}}, doi = {10.5281/zenodo.11100550}, license = {Apache-2.0}, title = {{SwanLab}}, url = {https://github.com/swanhubx/swanlab}, year = {2023} } ```