|
|
@ -330,6 +330,19 @@
|
|
|
|
"print(\"loss\", pn_ctc_loss.item())\n",
|
|
|
|
"print(\"loss\", pn_ctc_loss.item())\n",
|
|
|
|
" "
|
|
|
|
" "
|
|
|
|
]
|
|
|
|
]
|
|
|
|
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
"cell_type": "markdown",
|
|
|
|
|
|
|
|
"id": "de525d38",
|
|
|
|
|
|
|
|
"metadata": {},
|
|
|
|
|
|
|
|
"source": [
|
|
|
|
|
|
|
|
"## 结论\n",
|
|
|
|
|
|
|
|
"在 CPU 环境下: torch 的 CTC loss 的计算速度是 paddle 的 9.8 倍 \n",
|
|
|
|
|
|
|
|
"在 GPU 环境下: torch 的 CTC loss 的计算速度是 paddle 的 6.87 倍\n",
|
|
|
|
|
|
|
|
"\n",
|
|
|
|
|
|
|
|
"## 其他结论\n",
|
|
|
|
|
|
|
|
"torch 的 ctc loss 在 CPU 和 GPU 下 都没有完全对齐。其中CPU的前向对齐精度大约为 1e-2。 GPU 的前向对齐精度大约为 1e-4 。"
|
|
|
|
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
],
|
|
|
|
],
|
|
|
|
"metadata": {
|
|
|
|
"metadata": {
|
|
|
|