Skip to content

Commit a4afbdb

Browse files
authored
Feat/readme-v0.2.1 (#375)
* update something * update CN README * update EN README
1 parent 5bfb5e5 commit a4afbdb

File tree

8 files changed

+167
-219
lines changed

8 files changed

+167
-219
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ vue/components.d.ts
77
vue/auto-imports.d.ts
88
swanlog/
99
swanlog.bak/
10+
logs/
1011

1112
# Byte-compiled / optimized / DLL files
1213
__pycache__/

README.md

Lines changed: 75 additions & 92 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,11 @@ Track and visualize all the pieces of your machine learning pipeline
1717
</p>
1818

1919
<p align="center">
20-
👋 Join our <a href="https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic">WeChat</a>
20+
<img alt="SwanLab Head Image" src="readme_files/swanlab-head-image.png" width="800">
21+
</p>
22+
23+
<p align="center">
24+
👀 View <a href="https://geektechstudio.feishu.cn/wiki/MwXmw9yDeiZWyQkPnNgcixwWnwu">Document</a> | 👋 Join our <a href="https://geektechstudio.feishu.cn/wiki/NIZ9wp5LRiSqQykizbGcVzUKnic">WeChat</a>
2125
</p>
2226

2327
<p align="center">
@@ -30,58 +34,49 @@ English | <a href="README_zh-hans.md">中文</a>
3034
- [Key Function](#key-function)
3135
- [Installation](#installation)
3236
- [Getting Started](#getting-started)
37+
- [Tutorial](#Tutorial)
3338
- [Use Case](#use-case)
34-
- [More Tips](#more-tips)
3539
- [LICENSE](#license)
3640

3741
<br>
3842

3943
## Changelog
4044

41-
[24/02/08] 🔥 Very Big Update! We supported [Image Chart](https://geektechstudio.feishu.cn/wiki/LZFxwTuegiXxPGkhXcpcBUEXnHb)[Audio Chart](https://geektechstudio.feishu.cn/wiki/SU6mwcVNbixMf1k95KbcZHDCnJe)、Mutil-Experiments Chart and a series of comprehensive optimizations and improvements! Please be sure to upgrade to the latest version via `pip install -U swanlab`.
45+
Upgrade to the latest version: `pip install -U swanlab`
4246

43-
[24/01/25] 😄 We supported a new Config/Summary table component that supports parameter search. Additionally, we've used new fonts and color schemes.
47+
[24/03/01] 🚀 Still Very Big Upgrade!We supported [Text Chart](https://geektechstudio.feishu.cn/wiki/T0L7wYfzGiZUCKkxfehcFwYAnIh)to meet the needs of tasks in NLP, LLM, Agent and other scenarios; We have made a lot of optimizations to line chart's UI, legend, and rendering speed. We improved the rendering performance of Logs —— now viewing terminal printing information with 200k lines is also not lagging.(v0.2.1)
4448

45-
[24/01/23] 🚨 We use SQLite database and Peewee to replace the previous basic configuration information reading and writing solution by [#114](https://github.com/SwanHubX/SwanLab/issues/114). It's a major change that is highly beneficial for the future of the project, but the drawback is that it's not compatible with old versions (swanlab<=v0.1.4) of log data files. Therefore, if you need to visualize log files generated by older versions, please use [transfer script](script/transfer_logfile_0.1.4.py)
49+
[24/02/08] 🔥 Very Big Upgrade! We supported [Image Chart](https://geektechstudio.feishu.cn/wiki/LZFxwTuegiXxPGkhXcpcBUEXnHb)[Audio Chart](https://geektechstudio.feishu.cn/wiki/SU6mwcVNbixMf1k95KbcZHDCnJe)、Mutil-Experiments Chart and a series of comprehensive optimizations and improvements! Please be sure to upgrade to the latest version via `pip install -U swanlab`.(v0.2.0)
4650

47-
Additionally, we supported export the experiment list as `CSV`, new environment record items `Run path` and `logdir`, added interactive quick copy function, and new API `swanlab.config`.
51+
[24/01/25] 😄 We supported a new Config/Summary table component that supports parameter search. Additionally, we've used new fonts and color schemes.(v0.1.6)
4852

4953
[Full Changelog](https://github.com/SwanHubX/SwanLab/releases)
5054

5155
<br>
5256

5357
## Key Function
5458

55-
- **🚀 Multimedia charts**: log Image/Audio/Video/Text/object3D...
59+
- **📊 Visualize Training**: visualize your entire training process.
5660

5761
<div align="center">
58-
<img src="readme_files/mutilmedia-chart.gif" width="600">
59-
</div>
60-
61-
- **🧪 Experiments GridView**: compare your key metrics for inspiration faster
62-
63-
<div align="center">
64-
<img src="readme_files/experiments-table.png" width="600">
62+
<img src="readme_files/charts-1.gif" width="600">
6563
</div>
6664

67-
- **📊 Charts**: visualize your entire training process
65+
- **🚀 Multimedia Charts**: log Image/Audio/Video/Text/object3D...
6866

6967
<div align="center">
70-
<img src="readme_files/charts-1.gif" width="600">
68+
<img src="readme_files/mutilmedia-chart.gif" width="600">
7169
</div>
7270

73-
- **⚡️ Track machine-learning pipeline**: Hyperparameters, Config, Metric, Terminal logging, Environment Information auto save
71+
- **🧪 Experiments GridView**: compare your key metrics for inspiration faster.
7472

7573
<div align="center">
76-
<img src="readme_files/track-machine-learning-pipeline.gif" width="600">
74+
<img src="readme_files/experiments-table.png" width="600">
7775
</div>
7876

79-
<br>
80-
81-
- **🥔 Offline Support**: SwanLab can run entirely offile, ithout requiring any access to the Internet. For instance, this may be on your local machine, behind a corporate firewall, or in a datacenter
77+
- **⚡️ Auto Save Environment Info**: Hyperparameters, Config, Metric, Terminal logging, Environment Information auto save.
8278

83-
> [!NOTE]
84-
> See the SwanLab <a href="https://geektechstudio.feishu.cn/wiki/MwXmw9yDeiZWyQkPnNgcixwWnwu">Documentaion</a> and <a href="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/SwanHubX/SwanLab-examples">Examples</a> for a full description of the SwanLab.
79+
- **🥔 Offline Support**: SwanLab can run entirely offile, ithout requiring any access to the Internet. For instance, this may be on your local machine, behind a corporate firewall, or in a datacenter.
8580

8681
<br>
8782

@@ -117,105 +112,93 @@ import swanlab
117112

118113
# Start a SwanLab Run with swanlab.init
119114
swanlab.init(
120-
# save model inputs and hyperparameters in a swanlab.config object
121-
config={'learning_rate': 0.01},
115+
# Save model inputs and hyperparameters in a swanlab.config object
116+
config={'epochs': 20, 'learning_rate': 0.01},
117+
# Specify the save path of the log file
122118
logdir="./logs",
123119
)
124120

125121
# Model training code here...
126122

127123
# Log metrics over time for visualizing performance with swanlab.log
128-
for epoch in range(1, 20):
124+
for epoch in range(1, swanlab.config.epochs):
129125
swanlab.log({"loss": loss})
130126
```
131127

132-
3. Third, Run a Dashboard:
133-
```bash
134-
$ swanlab watch -l ./logs
135-
```
136-
137-
That's it! Open http://127.0.0.1:5092 to view a dashboard of your first SwanLab Experiment.
138-
139-
<br>
140-
141-
## Use Case
142-
143-
Learn how to use SwanLab more effectively by following these use cases:
144-
145-
| Code Cases | Description |
146-
| ------- | ------- |
147-
| [Hello World](https://github.com/SwanHubX/SwanLab-examples/tree/main/Hello_World) | Getting Started |
148-
| [MNIST](https://github.com/SwanHubX/SwanLab-examples/tree/main/MNIST) | Handwriting recognition based on a plain net and MNIST dataset with pytroch, swanlab. |
149-
| [Image Classification](https://github.com/SwanHubX/SwanLab-examples/blob/main/Resnet50) | Cat and dog classification based on ResNet50 with pytorch, swanlab and gradio. [Tutorial](https://zhuanlan.zhihu.com/p/676430630). |
150-
| [Text Generation](https://github.com/SwanHubX/SwanLab-examples/blob/main/Word_language_model) | Text generation based on Word_language_model (RNN/LSTM/GRU/Transformer) |
151-
| [UIE-Finetune](https://github.com/SwanHubX/SwanLab-examples/tree/main/UIE) | how to use personal data to finetune UIE model and monitor training process through swanlab |
152-
153-
<br>
154-
155-
## More Tips
156-
157-
🏄‍♀️ Experiment Dashboard:
158-
159-
<details>
160-
<summary>Set a log directory save path and run the Dashboard using it</summary>
161-
162-
Set a log directory save path, such as `./logs`:
128+
For example, We wrote a simulation experiment script:
163129

164130
```python
165-
import swanlab
166-
167-
swanlab.init(
168-
logdir="./logs"
131+
import swanlab
132+
import random
133+
134+
offset = random.random() / 5
135+
136+
run = swanlab.init(
137+
experiment_name="Example",
138+
description="It's a ML experiment.",
139+
config={
140+
"learning_rate": 0.01,
141+
"epochs": 20,
142+
},
143+
logdir="./logs"
169144
)
170-
```
171-
172-
Run the Dashboard using it:
173145

174-
```bash
175-
$ swanlab watch --logdir ./logs_path
146+
# Simulate the ML training process
147+
for epoch in range(2, run.config.epochs):
148+
acc = 1 - 2**-epoch - random.random() / epoch - offset
149+
loss = 2**-epoch + random.random() / epoch + offset
150+
swanlab.log({"loss": loss, "accuracy": acc})
176151
```
177152

178-
</details>
179-
180-
<details>
181-
<summary>Set the Host and Port for the Dashboard</summary>
182153

154+
3. Third, open the terminal and use the following command to start a SwanLab dashboard:
183155
```bash
184-
$ swanlab watch --host 0.0.0.0 --port 8080
156+
$ swanlab watch -l ./logs
185157
```
186158

187-
</details>
188-
189-
<details>
190-
<summary>Remotely access Dashboard</summary>
159+
SwanLab will give you a URL link (default is http://127.0.0.1:5092). Check the link to see the visualization results of your first experiment in the browser.
191160

192-
- Link:[Access the SwanLab Dashboard While Training on a Remote Server](https://zhuanlan.zhihu.com/p/677224865)
161+
<div align="center">
162+
<img src="readme_files/get-started.png" width="600">
163+
</div>
193164

194-
</details>
165+
<br>
195166

196-
⚙️ Other:
167+
## Tutorial
197168

198-
<details>
199-
<summary>argparse init swanlab.config</summary>
169+
**Get Started**
170+
- [Installation](#安装)
171+
- [Quick Start](https://geektechstudio.feishu.cn/wiki/UInBw9eaziv17IkwfrOcHCZ1nbc)
172+
- [Run Dashboard](https://geektechstudio.feishu.cn/wiki/YsEfwC79viJL2nk5TgPcAOUhn5U)
200173

201-
`swanlab.config` supports directly passing variables of type `argparse.Namespace`, such as:
174+
**Python API**
175+
- [init](https://geektechstudio.feishu.cn/wiki/H7Wbwt91LiCJtnkpHOzcar4TnCc)
176+
- [log](https://geektechstudio.feishu.cn/wiki/RmjXwjmgUi5zGCkBPsTc5ygQn4g)
177+
- [config](https://geektechstudio.feishu.cn/wiki/HkTOwxLkHiUC84kJNrlcohyGnuh)
178+
- [Image](https://geektechstudio.feishu.cn/wiki/LZFxwTuegiXxPGkhXcpcBUEXnHb)
179+
- [Audio](https://geektechstudio.feishu.cn/wiki/SU6mwcVNbixMf1k95KbcZHDCnJe)
180+
- [Text](https://geektechstudio.feishu.cn/wiki/T0L7wYfzGiZUCKkxfehcFwYAnIh)
202181

203-
```python
204-
import argparse
205-
import swanlab
182+
**CLI API**
183+
- [watch](https://geektechstudio.feishu.cn/wiki/Q6I5wdyr9iRYkdkZ2gYcHQkxnCU)
206184

207-
parser = argparse.ArgumentParser()
208-
···
209-
args = parser.parse_args()
185+
**技巧**
186+
- [Remotely view Dashboard](https://geektechstudio.feishu.cn/wiki/Icesw6coTidDsPkN960c0lNtnCb)
187+
- [Pass argparse into swanlab.config](https://geektechstudio.feishu.cn/wiki/CT1Xwo6ehimNH5kz7y9csTGkn0e)
210188

189+
<br>
211190

212-
swanlab.init(
213-
config=args
214-
)
215-
```
191+
## Use Case
216192

217-
</details>
193+
Learn how to use SwanLab more effectively by following these use cases:
218194

195+
| Code Cases | Description |
196+
| ------- | ------- |
197+
| [Hello World](https://github.com/SwanHubX/SwanLab-examples/tree/main/Hello_World) | Getting Started |
198+
| [MNIST](https://github.com/SwanHubX/SwanLab-examples/tree/main/MNIST) | Handwriting recognition based on a plain net and MNIST dataset with pytroch, swanlab. |
199+
| [Image Classification](https://github.com/SwanHubX/SwanLab-examples/blob/main/Resnet50) | Cat and dog classification based on ResNet50 with pytorch, swanlab and gradio. [Tutorial](https://zhuanlan.zhihu.com/p/676430630). |
200+
| [Text Generation](https://github.com/SwanHubX/SwanLab-examples/blob/main/Word_language_model) | Text generation based on Word_language_model (RNN/LSTM/GRU/Transformer) |
201+
| [UIE-Finetune](https://github.com/SwanHubX/SwanLab-examples/tree/main/UIE) | how to use personal data to finetune UIE model and monitor training process through swanlab |
219202

220203
<br>
221204

0 commit comments

Comments
 (0)