Skip to content

Commit 7c55566

Browse files
author
hyemi
committed
Merge branch 'master' of https://github.com/YBIGTA/Deep_learning
2 parents dd50f34 + 84ba270 commit 7c55566

File tree

1 file changed

+22
-14
lines changed

1 file changed

+22
-14
lines changed

RNN/deep_speech/implementation/deep speech1 구현.ipynb

Lines changed: 22 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -641,17 +641,20 @@
641641
},
642642
{
643643
"cell_type": "code",
644-
"execution_count": 4,
644+
"execution_count": 1,
645645
"metadata": {
646646
"collapsed": false
647647
},
648648
"outputs": [
649649
{
650-
"ename": "IndentationError",
651-
"evalue": "expected an indented block (<ipython-input-4-25b7fc9e6605>, line 45)",
650+
"ename": "NameError",
651+
"evalue": "name 'nn' is not defined",
652652
"output_type": "error",
653653
"traceback": [
654-
"\u001b[0;36m File \u001b[0;32m\"<ipython-input-4-25b7fc9e6605>\"\u001b[0;36m, line \u001b[0;32m45\u001b[0m\n\u001b[0;31m \"\"\"\u001b[0m\n\u001b[0m \n^\u001b[0m\n\u001b[0;31mIndentationError\u001b[0m\u001b[0;31m:\u001b[0m expected an indented block\n"
654+
"\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
655+
"\u001b[0;31mNameError\u001b[0m Traceback (most recent call last)",
656+
"\u001b[0;32m<ipython-input-1-8feab9035334>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m()\u001b[0m\n\u001b[1;32m 8\u001b[0m \u001b[0m그\u001b[0m \u001b[0m필요성은\u001b[0m \u001b[0m위의\u001b[0m \u001b[0m딥\u001b[0m \u001b[0m스피치\u001b[0m \u001b[0m모델\u001b[0m \u001b[0m그림에서\u001b[0m \u001b[0m데이터가\u001b[0m \u001b[0mtranspose됨을\u001b[0m \u001b[0m보면\u001b[0m \u001b[0m알\u001b[0m \u001b[0m수\u001b[0m \u001b[0m있다\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 9\u001b[0m \"\"\"\n\u001b[0;32m---> 10\u001b[0;31m \u001b[0;32mclass\u001b[0m \u001b[0mSequenceWise\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mnn\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mModule\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m\u001b[1;32m 11\u001b[0m \u001b[0;32mdef\u001b[0m \u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mself\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mmodule\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m:\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[1;32m 12\u001b[0m \u001b[0msuper\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0mSequenceWise\u001b[0m\u001b[0;34m,\u001b[0m \u001b[0mself\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0m__init__\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n",
657+
"\u001b[0;31mNameError\u001b[0m: name 'nn' is not defined"
655658
]
656659
}
657660
],
@@ -723,15 +726,6 @@
723726
" return x"
724727
]
725728
},
726-
{
727-
"cell_type": "code",
728-
"execution_count": null,
729-
"metadata": {
730-
"collapsed": true
731-
},
732-
"outputs": [],
733-
"source": []
734-
},
735729
{
736730
"cell_type": "code",
737731
"execution_count": null,
@@ -792,7 +786,7 @@
792786
" self.softmax = InferenceBatchSoftmax()\n",
793787
"\n",
794788
" def forward(self, x):\n",
795-
" x = self.conv(x)\n",
789+
" x = self.coLnv(x)\n",
796790
"\n",
797791
" sizes = x.size()\n",
798792
" x = x.view(sizes[0], sizes[1] * sizes[2], sizes[3]) # Collapse feature dimension\n",
@@ -805,6 +799,20 @@
805799
" x = self.softmax(x)\n",
806800
" return x"
807801
]
802+
},
803+
{
804+
"cell_type": "markdown",
805+
"metadata": {},
806+
"source": [
807+
"## Loss function 정의.\n",
808+
"\n",
809+
"CTC loss를 정의하여야 한다. <br>\n",
810+
"[3 페이지 참조](https://github.com/YBIGTA/Deep_learning/blob/master/RNN/deep_speech/%EC%84%A4%EB%AA%85/Deep%20speech_%EC%83%81%ED%97%8C.pdf)\n",
811+
"\n",
812+
"현재 CTC loss는 pytorch에서 제공을 하고있지 않다. <br>\n",
813+
"\n",
814+
"따라서 [torch wrapper file](https://github.com/baidu-research/warp-ctc/blob/master/torch_binding/binding.cpp)을 [pytorch 로 transpile](https://github.com/pytorch/extension-ffi) 해야한다. <br>"
815+
]
808816
}
809817
],
810818
"metadata": {

0 commit comments

Comments
 (0)