{"id":10624,"date":"2019-03-29T16:08:50","date_gmt":"2019-03-29T20:08:50","guid":{"rendered":"https:\/\/blogs.mathworks.com\/pick\/?p=10624"},"modified":"2019-03-29T16:08:50","modified_gmt":"2019-03-29T20:08:50","slug":"connectionist-temporal-classification-layer","status":"publish","type":"post","link":"https:\/\/blogs.mathworks.com\/pick\/2019\/03\/29\/connectionist-temporal-classification-layer\/","title":{"rendered":"Connectionist Temporal Classification Layer"},"content":{"rendered":"<div xmlns:mwsh=\"http:\/\/www.mathworks.com\/namespace\/mcode\/v1\/syntaxhighlight.dtd\" class=\"content\">\n   <introduction><\/p>\n<p><a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495\">Sean<\/a>&#8216;s pick this week is <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/71042\">Connectionist Temporal Classification Layer<\/a> by <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/8035852\">SergeyLA<\/a>.\n      <\/p>\n<p>   <\/introduction><\/p>\n<h3>A Custom Deep Learning Layer in the Wild!<a name=\"1\"><\/a><\/h3>\n<p>Last year, we introduced the ability to <a href=\"https:\/\/www.mathworks.com\/help\/deeplearning\/ug\/define-custom-deep-learning-layers.html\">write your own custom deep learning layers<\/a> and integrate them with <a href=\"https:\/\/www.mathworks.com\/help\/deeplearning\/ref\/trainnetwork.html\"><tt>trainNetwork<\/tt><\/a> in the Deep Learning Toolbox.  Our internal deep learning discussion group was very excited last week when this was discovered on our File Exchange.\n   <\/p>\n<p>Simply create the layer and then append it to the end of the layer array making up your deep network.<\/p>\n<pre style=\"background: #F9F7F3; padding: 10px; border: 1px solid rgb(200,200,200)\">ctclayer = ctcClassificationLayer(<span style=\"color: #A020F0\">\"Blog Classifier\"<\/span>, [<span style=\"color: #A020F0\">\"POTW\"<\/span> <span style=\"color: #A020F0\">\"Art of MATLAB\"<\/span> <span style=\"color: #A020F0\">\"MATLAB Community\"<\/span>])<\/pre>\n<pre style=\"font-style:oblique\">ctclayer = \r\n  ctcClassificationLayer with properties:\r\n\r\n     Categories: [\"POTW\"    \"Art of MATLAB\"    \"MATLAB Community\"]\r\n       cacheSub: []\r\n           Name: 'Blog Classifier'\r\n        Classes: 'auto'\r\n    Description: 'Connectionist Temporal Classification Layer'\r\n           Type: ''\r\n<\/pre>\n<h3>Comments<a name=\"2\"><\/a><\/h3>\n<p>Give it a try and let us know what you think <a href=\"http:\/\/blogs.mathworks.com\/pick\/?p=10624#respond\">here<\/a> or leave a <a href=\"http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/71042#comments\">comment<\/a> for SergeyLA.\n   <\/p>\n<p><script language=\"JavaScript\">\n<!--\n\n    function grabCode_2576d9c3f76046f3a33a1efad181bf56() {\n        \/\/ Remember the title so we can use it in the new page\n        title = document.title;\n\n        \/\/ Break up these strings so that their presence\n        \/\/ in the Javascript doesn't mess up the search for\n        \/\/ the MATLAB code.\n        t1='2576d9c3f76046f3a33a1efad181bf56 ' + '##### ' + 'SOURCE BEGIN' + ' #####';\n        t2='##### ' + 'SOURCE END' + ' #####' + ' 2576d9c3f76046f3a33a1efad181bf56';\n    \n        b=document.getElementsByTagName('body')[0];\n        i1=b.innerHTML.indexOf(t1)+t1.length;\n        i2=b.innerHTML.indexOf(t2);\n \n        code_string = b.innerHTML.substring(i1, i2);\n        code_string = code_string.replace(\/REPLACE_WITH_DASH_DASH\/g,'--');\n\n        \/\/ Use \/x3C\/g instead of the less-than character to avoid errors \n        \/\/ in the XML parser.\n        \/\/ Use '\\x26#60;' instead of '<' so that the XML parser\n        \/\/ doesn't go ahead and substitute the less-than character. \n        code_string = code_string.replace(\/\\x3C\/g, '\\x26#60;');\n\n        author = 'Sean de Wolski';\n        copyright = 'Copyright 2019 The MathWorks, Inc.';\n\n        w = window.open();\n        d = w.document;\n        d.write('\n\n<pre>\\n');\r\n        d.write(code_string);\r\n\r\n        \/\/ Add author and copyright lines at the bottom if specified.\r\n        if ((author.length > 0) || (copyright.length > 0)) {\r\n            d.writeln('');\r\n            d.writeln('%%');\r\n            if (author.length > 0) {\r\n                d.writeln('% _' + author + '_');\r\n            }\r\n            if (copyright.length > 0) {\r\n                d.writeln('% _' + copyright + '_');\r\n            }\r\n        }\r\n\r\n        d.write('<\/pre>\n\n\\n');\n      \n      d.title = title + ' (MATLAB code)';\n      d.close();\n      }   \n      \n-->\n<\/script><\/p>\n<p style=\"text-align: right; font-size: xx-small; font-weight:lighter;   font-style: italic; color: gray\"><a href=\"javascript:grabCode_2576d9c3f76046f3a33a1efad181bf56()\"><span style=\"font-size: x-small;        font-style: italic;\">Get<br \/>\n            the MATLAB code<br \/>\n            <noscript>(requires JavaScript)<\/noscript><\/span><\/a><\/p>\n<p>      Published with MATLAB&reg; R2019a<\/p>\n<\/div>\n<p><!--\n2576d9c3f76046f3a33a1efad181bf56 ##### SOURCE BEGIN #####\n%% Connectionist Temporal Classification Layer\n%\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/3208495 Sean>'s pick this week is\n% <http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/71042 Connectionist Temporal Classification Layer> by\n% <http:\/\/www.mathworks.com\/matlabcentral\/profile\/authors\/8035852 SergeyLA>.\n% \n\n%% A Custom Deep Learning Layer in the Wild!\n%\n% Last year, we introduced the ability to\n% <https:\/\/www.mathworks.com\/help\/deeplearning\/ug\/define-custom-deep-learning-layers.html\n% write your own custom deep learning layers> and integrate them with\n% <https:\/\/www.mathworks.com\/help\/deeplearning\/ref\/trainnetwork.html |trainNetwork|> in the Deep Learning Toolbox.  Our internal deep learning\n% discussion group was very excited last week when this was discovered on\n% our File Exchange.\n%\n% Simply create the layer and then append it to the end of the layer array\n% making up your deep network.\n\nctclayer = ctcClassificationLayer(\"Blog Classifier\", [\"POTW\" \"Art of MATLAB\" \"MATLAB Community\"])\n\n\n\n\n%% Comments\n% \n% Give it a try and let us know what you think\n% <http:\/\/blogs.mathworks.com\/pick\/?p=10624#respond here> or leave a\n% <http:\/\/www.mathworks.com\/matlabcentral\/fileexchange\/71042#comments\n% comment> for SergeyLA.\n%\n \n\n##### SOURCE END ##### 2576d9c3f76046f3a33a1efad181bf56\n--><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Sean&#8216;s pick this week is Connectionist Temporal Classification Layer by SergeyLA.<\/p>\n<p>A Custom Deep Learning Layer in the Wild!<br \/>\nLast year, we introduced the ability to write your&#8230; <a class=\"read-more\" href=\"https:\/\/blogs.mathworks.com\/pick\/2019\/03\/29\/connectionist-temporal-classification-layer\/\">read more >><\/a><\/p>\n","protected":false},"author":87,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[16],"tags":[],"_links":{"self":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10624"}],"collection":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/users\/87"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/comments?post=10624"}],"version-history":[{"count":2,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10624\/revisions"}],"predecessor-version":[{"id":10628,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/posts\/10624\/revisions\/10628"}],"wp:attachment":[{"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/media?parent=10624"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/categories?post=10624"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.mathworks.com\/pick\/wp-json\/wp\/v2\/tags?post=10624"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}