Accuracy.md 703 字节
Newer Older
S
sunyanfang01 已提交
1 2 3 4 5 6 7 8
## Accuracy


### [Accuracy](http://caffe.berkeleyvision.org/tutorial/layers/accuracy.html)
```
layer {
    name: "accuracy"
    type: "Accuracy"
S
SunAhong1993 已提交
9
    bottom: "input"
S
sunyanfang01 已提交
10 11
    bottom: "label"
    top: "accuracy"
S
SunAhong1993 已提交
12
    include {
S
sunyanfang01 已提交
13 14 15 16 17 18 19 20 21 22 23
	phase: TEST
    }
}
```


### [paddle.fluid.layers.accuracy](http://paddlepaddle.org/documentation/docs/zh/1.3/api_cn/layers_cn.html#permalink-253-accuracy)
```python
paddle.fluid.layers.accuracy(
    input,
    label,
S
SunAhong1993 已提交
24 25 26
    k=1,
    correct=None,
    total=None
S
sunyanfang01 已提交
27 28 29 30
)
```  

### 功能差异
J
Jason 已提交
31 32
#### 计算机制
Caffe:只能计算每个类别中top1中正确预测的个数;          
S
sunyanfang01 已提交
33 34 35 36 37 38 39
PaddlePaddle:可以通过设置`k`来计算每个类别中top k 中正确预测的个数。