提交 dd26cf3a 编写于 作者: C chenxuyi

update propeller

上级 cc785f8d
...@@ -21,7 +21,7 @@ Propeller provide the following benefits: ...@@ -21,7 +21,7 @@ Propeller provide the following benefits:
## install ## install
```script ```script
cd propeller && pip install . pip install --user .
``` ```
## Getting Started ## Getting Started
...@@ -71,7 +71,6 @@ cd propeller && pip install . ...@@ -71,7 +71,6 @@ cd propeller && pip install .
# Start training! # Start training!
propeller.train_and_eval(BowModel, hparams, run_config, train_ds, eval_ds) propeller.train_and_eval(BowModel, hparams, run_config, train_ds, eval_ds)
``` ```
More detail see example/toy/
## Main Feature ## Main Feature
1. train_and_eval 1. train_and_eval
...@@ -91,9 +90,9 @@ More detail see example/toy/ ...@@ -91,9 +90,9 @@ More detail see example/toy/
4. Summary 4. Summary
To trace tensor histogram in training, simply: To trace tensor histogram in training, simply:
```python ```python
propeller.summary.histogram('loss', tensor) propeller.summary.histogram('loss', tensor)
``` ```
## Contributing ## Contributing
......
...@@ -21,7 +21,7 @@ Propeller 具有下列优势: ...@@ -21,7 +21,7 @@ Propeller 具有下列优势:
## install|安装 ## install|安装
cd propeller && pip install . pip install --user .
## Getting Started|快速开始 ## Getting Started|快速开始
```python ```python
...@@ -70,7 +70,6 @@ cd propeller && pip install . ...@@ -70,7 +70,6 @@ cd propeller && pip install .
# 开始训练! # 开始训练!
propeller.train_and_eval(BowModel, hparams, run_config, train_ds, eval_ds) propeller.train_and_eval(BowModel, hparams, run_config, train_ds, eval_ds)
``` ```
先洗详细请见example/toy/
## 主要构件 ## 主要构件
1. train_and_eval 1. train_and_eval
...@@ -89,10 +88,10 @@ cd propeller && pip install . ...@@ -89,10 +88,10 @@ cd propeller && pip install .
4. Summary 4. Summary
对训练过程中的某些参数进行log追踪,只需要: 对训练过程中的某些参数进行log追踪,只需要:
```python ```python
propeller.summary.histogram('loss', tensor) propeller.summary.histogram('loss', tensor)
``` ```
## Contributing|贡献 ## Contributing|贡献
......
...@@ -256,8 +256,10 @@ class Mrr(Metrics): ...@@ -256,8 +256,10 @@ class Mrr(Metrics):
sorted( sorted(
tup, key=lambda t: t[2], reverse=True)) if l != 0 tup, key=lambda t: t[2], reverse=True)) if l != 0
] ]
ranks = ranks[0] if len(ranks):
return ranks return ranks[0]
else:
return 0.
mrr_for_qid = [ mrr_for_qid = [
calc_func(tup) calc_func(tup)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册