Skip to content

Commit df33a0e

Browse files
authored
Add usage instructions to README
Added usage instructions for setting up the environment and running the Python interface.
1 parent e0abcb0 commit df33a0e

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

README.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,41 @@
11
# rust-mlp
22
用rust训练mlp,以python接口形式调用,具体参考[test.ipynb](./test.ipynb)
3+
## 在自己的环境中使用
4+
- 创建环境
5+
```bash
6+
conda create -n your_env_name python=3.11 # 必须>=3.9
7+
conda activate your_env_name
8+
```
9+
- 下载wheel文件后
10+
```bash
11+
pip install Path/to/*.whl
12+
```
13+
- 在python环境中使用
14+
```Python
15+
import rust_mlp
16+
rust_mlp.let_me_try()
17+
```
18+
预期结果如下:
19+
```
20+
Epoch 10 | Train Loss: 1.628042
21+
Epoch 20 | Train Loss: 1.206229
22+
Epoch 30 | Train Loss: 0.876774
23+
Epoch 40 | Train Loss: 0.737402
24+
Epoch 50 | Train Loss: 0.644500
25+
Epoch 60 | Train Loss: 0.576381
26+
Epoch 70 | Train Loss: 0.524079
27+
Epoch 80 | Train Loss: 0.482977
28+
Epoch 90 | Train Loss: 0.451547
29+
Epoch 100 | Train Loss: 0.431264
30+
Epoch 110 | Train Loss: 0.417604
31+
Epoch 120 | Train Loss: 0.407959
32+
Epoch 130 | Train Loss: 0.400804
33+
Epoch 140 | Train Loss: 0.395103
34+
Epoch 150 | Train Loss: 0.390289
35+
Epoch 160 | Train Loss: 0.386080
36+
Epoch 170 | Train Loss: 0.382233
37+
Epoch 180 | Train Loss: 0.378714
38+
Epoch 190 | Train Loss: 0.375436
39+
Epoch 200 | Train Loss: 0.372300
40+
Test Loss: 0.385307
41+
```

0 commit comments

Comments
 (0)