{"id":3903,"date":"2026-07-28T07:39:47","date_gmt":"2026-07-27T23:39:47","guid":{"rendered":"https:\/\/www.khsci.com\/docs\/?p=3903"},"modified":"2026-07-28T07:39:47","modified_gmt":"2026-07-27T23:39:47","slug":"cnn-rnn-classification-matlab","status":"publish","type":"post","link":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/","title":{"rendered":"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801"},"content":{"rendered":"\n<p>\u672c\u6587\u4ecb\u7ecd\u4e00\u5957 MATLAB \u7248 CNN-RNN \u901a\u7528\u5206\u7c7b\u4ee3\u7801\u3002\u7a0b\u5e8f\u4e0d\u628a\u8f93\u5165\u9650\u5236\u4e3a\u5355\u4e00\u7684\u201c\u5e8f\u5217\u5206\u7c7b\u201d\u683c\u5f0f\uff0c\u800c\u662f\u5141\u8bb8\u7528\u6237\u5728\u6bcf\u6761\u6837\u672c\u5185\u90e8\u6307\u5b9a\u4e00\u4e2a\u6709\u987a\u5e8f\u7684\u7ef4\u5ea6\uff0c\u518d\u628a\u5176\u4ed6\u7ef4\u5ea6\u6574\u7406\u6210\u6bcf\u4e2a\u4f4d\u7f6e\u4e0a\u7684\u7279\u5f81\uff0c\u56e0\u6b64\u53ef\u4ee5\u7528\u540c\u4e00\u4e2a\u6838\u5fc3\u51fd\u6570\u5904\u7406\u4e00\u7ef4\u6570\u7ec4\u3001\u591a\u901a\u9053\u4f20\u611f\u5668\u5e8f\u5217\u3001\u7070\u5ea6\u56fe\u4ee5\u53ca\u66f4\u9ad8\u7ef4\u6570\u503c\u6837\u672c\u3002<\/p>\n\n\n\n<ul>\n<li>\u63d0\u4f9b Iris \u4e00\u7ef4\u7279\u5f81\u3001UCI HAR \u4e5d\u901a\u9053\u4eba\u4f53\u6d3b\u52a8\u5e8f\u5217\u3001MNIST \u4e8c\u7ef4\u7070\u5ea6\u56fe\u4e09\u4e2a\u6f14\u793a\u6848\u4f8b\u3002<\/li>\n<li>\u53ef\u4ee5\u901a\u8fc7 <code>sampleDimension<\/code> \u6307\u5b9a\u6837\u672c\u7ef4\uff0c\u901a\u8fc7 <code>sequenceAxis<\/code> \u6307\u5b9a CNN-RNN \u5b9e\u9645\u8bfb\u53d6\u7684\u6709\u5e8f\u8f74\u3002<\/li>\n<li>\u53ef\u4ee5\u81ea\u7531\u8bbe\u7f6e\u5377\u79ef\u5c42\u6570\u91cf\u3001\u5377\u79ef\u901a\u9053\u6570\u3001\u5377\u79ef\u6838\u3001\u6c60\u5316\u7a97\u53e3\u3001\u5faa\u73af\u7f51\u7edc\u7c7b\u578b\u3001\u9690\u85cf\u5355\u5143\u548c Dropout\u3002<\/li>\n<li>MATLAB \u7248\u652f\u6301 LSTM\u3001GRU\u3001BiLSTM \u4e09\u79cd\u5faa\u73af\u7ed3\u6784\u3002<\/li>\n<li>\u652f\u6301\u5206\u5c42\u968f\u673a\u5212\u5206\uff0c\u4e5f\u652f\u6301\u901a\u8fc7 <code>splitLabels<\/code> \u6309\u4eba\u5458\u3001\u8bbe\u5907\u6216\u6279\u6b21\u9884\u5148\u6307\u5b9a\u8bad\u7ec3\u96c6\u3001\u9a8c\u8bc1\u96c6\u548c\u6d4b\u8bd5\u96c6\u3002<\/li>\n<li>\u6807\u51c6\u5316\u53c2\u6570\u53ea\u4f7f\u7528\u8bad\u7ec3\u96c6\u8ba1\u7b97\uff0c\u518d\u5e94\u7528\u5230\u9a8c\u8bc1\u96c6\u548c\u6d4b\u8bd5\u96c6\uff0c\u907f\u514d\u5f52\u4e00\u5316\u9636\u6bb5\u7684\u6570\u636e\u6cc4\u6f0f\u3002<\/li>\n<li>\u7a0b\u5e8f\u8fd0\u884c\u540e\u81ea\u52a8\u8ba1\u7b97 Accuracy\u3001\u5b8f\u5e73\u5747 Precision\u3001Recall\u3001F1 \u548c\u9010\u7c7b\u522b\u6307\u6807\uff0c\u5e76\u751f\u6210\u6536\u655b\u56fe\u3001\u6df7\u6dc6\u77e9\u9635\u3001\u9010\u7c7b\u522b\u6307\u6807\u3001\u5206\u7c7b\u7ed3\u679c\u5bf9\u6bd4\u548c\u4e09\u96c6\u5408\u6307\u6807\u5bf9\u6bd4\u56fe\u3002<\/li>\n<li>\u53ef\u8bbe\u7f6e\u968f\u673a\u79cd\u5b50\u3001\u6c42\u89e3\u5668\u3001\u8bad\u7ec3\u8f6e\u6570\u3001\u5b66\u4e60\u7387\u3001\u6279\u5c3a\u5bf8\u3001\u65e9\u505c\u3001\u5b66\u4e60\u7387\u8870\u51cf\u548c\u8bad\u7ec3\u8bbe\u5907\u3002<\/li>\n<li>\u9700\u8981\u505a\u7684\u4e3b\u8981\u5de5\u4f5c\u662f\u5bfc\u5165\u81ea\u5df1\u7684 <code>X<\/code>\u3001<code>Y<\/code>\uff0c\u9009\u5bf9\u5e8f\u5217\u8f74\u5e76\u8c03\u6574\u53c2\u6570\uff1b\u56fa\u5b9a\u6d41\u7a0b\u5df2\u5c01\u88c5\u5728 <code>FunClassCNNRNN<\/code> \u4e2d\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e00\u3001\u4ee3\u7801\u8fd0\u884c\u73af\u5883<\/h4>\n\n\n\n<p>\u63a8\u8350\u4f7f\u7528 MATLAB R2024a\uff0c\u5e76\u5b89\u88c5 Deep Learning Toolbox\u3002\u4ee3\u7801\u4f7f\u7528\u4e86 <code>convolution1dLayer<\/code>\u3001<code>lstmLayer<\/code>\u3001<code>gruLayer<\/code>\u3001<code>bilstmLayer<\/code>\u3001<code>trainNetwork<\/code>\u3001<code>trainingOptions<\/code> \u548c <code>exportgraphics<\/code> \u7b49\u51fd\u6570\u3002<\/p>\n\n\n\n<p>\u516c\u5f00\u7248\u6309 MATLAB R2022a \u517c\u5bb9\u683c\u5f0f\u5236\u4f5c\uff0c\u9700\u4f7f\u7528 MATLAB R2022a \u6216\u66f4\u65b0\u7248\u672c\uff1b\u4e3a\u4e86\u83b7\u5f97\u4e0e\u672c\u6587\u6d4b\u8bd5\u4e00\u81f4\u7684\u884c\u4e3a\uff0c\u63a8\u8350\u4f7f\u7528 MATLAB R2024a\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e8c\u3001\u7a0b\u5e8f\u4ecb\u7ecd<\/h4>\n\n\n\n<p>\u5b8c\u6574\u7248\u6587\u4ef6\u7ed3\u6784\u5982\u4e0b\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-text\">CNN_RNN_Classification\/\n\u251c\u2500\u2500 demoCNNRNNClassIris.m\n\u251c\u2500\u2500 demoCNNRNNClassHAR.m\n\u251c\u2500\u2500 demoCNNRNNClassMNIST.m\n\u251c\u2500\u2500 FunClassCNNRNN.m\n\u251c\u2500\u2500 EvaClassEffect.m\n\u251c\u2500\u2500 iris.csv\n\u251c\u2500\u2500 har_activity_data.mat\n\u251c\u2500\u2500 mnist_subset.mat\n\u251c\u2500\u2500 \u6570\u636e\u6765\u6e90\u4e0e\u8bb8\u53ef.txt\n\u251c\u2500\u2500 \u4ee3\u7801\u8bf4\u660e.txt\n\u2514\u2500\u2500 figure\/<\/code><\/pre>\n\n\n\n<p>\u6ce8\uff1a\u4e09\u4e2a <code>demo*.m<\/code> \u90fd\u662f\u53ef\u4ee5\u76f4\u63a5\u8fd0\u884c\u7684\u811a\u672c\uff1b<code>FunClassCNNRNN.m<\/code> \u548c <code>EvaClassEffect.m<\/code> \u662f\u51fd\u6570\u6587\u4ef6\uff0c\u9700\u8981\u7531 demo \u6216\u81ea\u5df1\u7684\u811a\u672c\u4f20\u5165\u6570\u636e\u540e\u8c03\u7528\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">1. demoCNNRNNClassIris.m \u6587\u4ef6<\/h6>\n\n\n\n<p>\u8be5\u811a\u672c\u6f14\u793a\u4e8c\u7ef4\u8868\u683c\u5f62\u5f0f\u7684\u4e00\u7ef4\u7279\u5f81\u5206\u7c7b\u3002<code>X<\/code> \u7684\u5c3a\u5bf8\u662f <code>150\u00d74<\/code>\uff0c150 \u8868\u793a\u6837\u672c\u6570\uff0c4 \u8868\u793a\u6bcf\u6761\u6837\u672c\u7684\u56db\u4e2a\u7279\u5f81\u4f4d\u7f6e\uff1b<code>Y<\/code> \u662f150\u4e2a\u7c7b\u522b\u6807\u7b7e\u3002\u7a0b\u5e8f\u628a\u56db\u4e2a\u7279\u5f81\u4f4d\u7f6e\u4f5c\u4e3a\u957f\u5ea6\u4e3a4\u7684\u77ed\u5e8f\u5217\uff0c\u4f7f\u7528\u4e00\u5c42 CNN \u548c LSTM \u5b8c\u6210\u4e09\u5206\u7c7b\u3002<\/p>\n\n\n\n<p>\u6838\u5fc3\u8c03\u7528\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">[foreData, foreDataTrain, net, info] = FunClassCNNRNN(X, Y, options);<\/code><\/pre>\n\n\n\n<p>\u672c\u6b21\u5b8c\u6574\u590d\u9a8c\u7684\u6d4b\u8bd5\u96c6 Accuracy \u4e3a <code>0.9000<\/code>\uff0cMacro-F1 \u4e3a <code>0.8977<\/code>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-iris-confusion.png\" alt=\"MATLAB Iris \u6d4b\u8bd5\u96c6\u6df7\u6dc6\u77e9\u9635\"\/><\/figure>\n\n\n\n<p>\u56fe 1 \u7684\u884c\u8868\u793a\u771f\u5b9e\u7c7b\u522b\uff0c\u5217\u8868\u793a\u9884\u6d4b\u7c7b\u522b\u3002\u4e3b\u5bf9\u89d2\u7ebf\u6570\u503c\u8d8a\u96c6\u4e2d\uff0c\u8bf4\u660e\u4e09\u4e2a\u7c7b\u522b\u8d8a\u5c11\u4e92\u76f8\u6df7\u6dc6\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">2. demoCNNRNNClassHAR.m \u6587\u4ef6<\/h6>\n\n\n\n<p>\u8be5\u811a\u672c\u6f14\u793a\u771f\u6b63\u7684\u591a\u901a\u9053\u4f20\u611f\u5668\u5e8f\u5217\u5206\u7c7b\u3002<code>X<\/code> \u7684\u5c3a\u5bf8\u4e3a <code>2700\u00d79\u00d7128<\/code>\uff1a2700\u6761\u6837\u672c\uff0c\u6bcf\u6761\u6837\u672c\u67099\u4e2a\u4f20\u611f\u5668\u901a\u9053\u548c128\u4e2a\u8fde\u7eed\u65f6\u95f4\u70b9\uff1b<code>Y<\/code> \u5bf9\u5e94\u884c\u8d70\u3001\u4e0a\u697c\u3001\u4e0b\u697c\u3001\u5750\u7740\u3001\u7ad9\u7acb\u548c\u8eba\u7740\u516d\u79cd\u6d3b\u52a8\u3002<\/p>\n\n\n\n<p>HAR \u6848\u4f8b\u6ca1\u6709\u968f\u673a\u628a\u76f8\u4f3c\u7247\u6bb5\u62c6\u5230\u4e09\u4e2a\u96c6\u5408\uff0c\u800c\u662f\u901a\u8fc7 <code>splitLabels<\/code> \u6309\u53d7\u8bd5\u8005\u9694\u79bb\uff1a1500\u6761\u8bad\u7ec3\u6837\u672c\u3001480\u6761\u9a8c\u8bc1\u6837\u672c\u3001720\u6761\u6d4b\u8bd5\u6837\u672c\u3002\u8fd9\u6837\u80fd\u51cf\u5c11\u540c\u4e00\u4e2a\u4eba\u7684\u76f8\u4f3c\u52a8\u4f5c\u540c\u65f6\u51fa\u73b0\u5728\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u9020\u6210\u7684\u6307\u6807\u865a\u9ad8\u3002<\/p>\n\n\n\n<p>\u672c\u6b21\u5b8c\u6574\u590d\u9a8c\u7684\u6d4b\u8bd5\u96c6 Accuracy \u4e3a <code>0.9014<\/code>\uff0cMacro-F1 \u4e3a <code>0.9009<\/code>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-har-loss.png\" alt=\"MATLAB HAR \u6536\u655b\u8fc7\u7a0b\"\/><\/figure>\n\n\n\n<p>\u56fe 2 \u5de6\u4fa7\u89c2\u5bdf\u8bad\u7ec3\u635f\u5931\u548c\u9a8c\u8bc1\u635f\u5931\u662f\u5426\u4e00\u8d77\u4e0b\u964d\uff0c\u53f3\u4fa7\u89c2\u5bdf\u4e24\u7ec4\u51c6\u786e\u7387\u662f\u5426\u9010\u6b65\u7a33\u5b9a\u3002\u82e5\u8bad\u7ec3\u51c6\u786e\u7387\u7ee7\u7eed\u4e0a\u5347\u800c\u9a8c\u8bc1\u51c6\u786e\u7387\u660e\u663e\u4e0b\u964d\uff0c\u901a\u5e38\u8bf4\u660e\u5f00\u59cb\u8fc7\u62df\u5408\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-har-confusion.png\" alt=\"MATLAB HAR \u6d4b\u8bd5\u96c6\u6df7\u6dc6\u77e9\u9635\"\/><\/figure>\n\n\n\n<p>\u56fe 3 \u663e\u793a\u516d\u79cd\u6d3b\u52a8\u7684\u5177\u4f53\u6df7\u6dc6\u4f4d\u7f6e\u3002\u4eba\u4f53\u6d3b\u52a8\u8bc6\u522b\u4e2d\uff0c\u201c\u5750\u7740\u201d\u548c\u201c\u7ad9\u7acb\u201d\u901a\u5e38\u6bd4\u201c\u884c\u8d70\u201d\u548c\u201c\u8eba\u7740\u201d\u66f4\u5bb9\u6613\u76f8\u4e92\u6df7\u6dc6\uff0c\u56e0\u6b64\u4e0d\u80fd\u53ea\u770b\u603b\u51c6\u786e\u7387\uff0c\u8fd8\u8981\u770b\u77e9\u9635\u4e2d\u7684\u9519\u8bef\u6d41\u5411\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-har-class-metrics.png\" alt=\"MATLAB HAR \u5404\u7c7b\u522b\u6307\u6807\"\/><\/figure>\n\n\n\n<p>\u56fe 4 \u5206\u522b\u5c55\u793a\u6bcf\u4e2a\u6d3b\u52a8\u7c7b\u522b\u7684 Precision\u3001Recall \u548c F1\uff0c\u7528\u4e8e\u53d1\u73b0\u603b\u51c6\u786e\u7387\u63a9\u76d6\u7684\u8584\u5f31\u7c7b\u522b\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">3. demoCNNRNNClassMNIST.m \u6587\u4ef6<\/h6>\n\n\n\n<p>\u8be5\u811a\u672c\u6f14\u793a\u4e8c\u7ef4\u7070\u5ea6\u56fe\u5206\u7c7b\u3002<code>X<\/code> \u7684\u5c3a\u5bf8\u4e3a <code>5000\u00d728\u00d728<\/code>\uff0c\u8868\u793a5000\u5f20\u9ad828\u3001\u5bbd28\u7684\u7070\u5ea6\u56fe\uff1b\u7a0b\u5e8f\u6cbf\u56fe\u50cf\u5bbd\u5ea6\u65b9\u5411\u9010\u5217\u8bfb\u53d6\uff0c\u6bcf\u4e00\u6b65\u628a\u4e00\u6574\u521728\u4e2a\u50cf\u7d20\u4f5c\u4e3a\u7279\u5f81\uff0c\u518d\u7531 CNN \u63d0\u53d6\u76f8\u90bb\u5217\u7684\u7b14\u753b\u6a21\u5f0f\uff0c\u7531 GRU \u6c47\u603b\u6574\u5f20\u56fe\u7684\u4fe1\u606f\u3002<\/p>\n\n\n\n<p>\u672c\u6b21\u5b8c\u6574\u590d\u9a8c\u7684\u6d4b\u8bd5\u96c6 Accuracy \u4e3a <code>0.9250<\/code>\uff0cMacro-F1 \u4e3a <code>0.9248<\/code>\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-mnist-confusion.png\" alt=\"MATLAB MNIST \u6d4b\u8bd5\u96c6\u6df7\u6dc6\u77e9\u9635\"\/><\/figure>\n\n\n\n<p>\u56fe 5 \u5c55\u793a0~9\u5341\u4e2a\u6570\u5b57\u7684\u6d4b\u8bd5\u96c6\u6df7\u6dc6\u60c5\u51b5\u3002\u9664\u603b\u51c6\u786e\u7387\u5916\uff0c\u53ef\u4ee5\u91cd\u70b9\u89c2\u5bdf\u54ea\u4e9b\u7b14\u753b\u7ed3\u6784\u63a5\u8fd1\u7684\u6570\u5b57\u66f4\u5bb9\u6613\u88ab\u6df7\u6dc6\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">4. FunClassCNNRNN.m \u6587\u4ef6<\/h6>\n\n\n\n<p>\u8be5\u6587\u4ef6\u662f\u901a\u7528\u5206\u7c7b\u6838\u5fc3\u51fd\u6570\u3002\u5b83\u8d1f\u8d23\u8f93\u5165\u7ef4\u5ea6\u9002\u914d\u3001\u6570\u636e\u5212\u5206\u3001\u8bad\u7ec3\u96c6\u6807\u51c6\u5316\u3001CNN-RNN \u7f51\u7edc\u642d\u5efa\u3001\u8bad\u7ec3\u4e0e\u9a8c\u8bc1\u3001\u5206\u7c7b\u9884\u6d4b\u3001\u6307\u6807\u8ba1\u7b97\u4ee5\u53ca\u5168\u90e8\u7ed8\u56fe\u3002<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">[foreData, foreDataTrain, net, info] = FunClassCNNRNN(X, Y, options)<\/code><\/pre>\n\n\n\n<p>\u8f93\u5165\u53c2\u6570\uff1a<\/p>\n\n\n\n<ul>\n<li><code>X<\/code>\uff1a\u4efb\u610f\u7ef4\u5ea6\u7684\u6709\u9650\u6570\u503c\u6570\u7ec4\uff0c\u4e0d\u80fd\u542b NaN \u6216 Inf\u3002\u5fc5\u987b\u6709\u4e00\u7ef4\u5bf9\u5e94\u6837\u672c\uff0c\u5e76\u5728\u5355\u6761\u6837\u672c\u5185\u90e8\u9009\u62e9\u4e00\u4e2a\u6709\u5b9e\u9645\u987a\u5e8f\u7684 <code>sequenceAxis<\/code>\u3002<\/li>\n<li><code>Y<\/code>\uff1a\u6bcf\u6761\u6837\u672c\u7684\u7c7b\u522b\u6807\u7b7e\uff0c\u957f\u5ea6\u5fc5\u987b\u7b49\u4e8e\u6837\u672c\u6570\u3002\u652f\u6301\u6570\u503c\u3001<code>categorical<\/code>\u3001<code>string<\/code> \u6216 <code>cellstr<\/code>\u3002<\/li>\n<li><code>options<\/code>\uff1a\u6570\u636e\u9002\u914d\u3001\u5212\u5206\u3001\u7f51\u7edc\u3001\u8bad\u7ec3\u548c\u7ed8\u56fe\u8bbe\u7f6e\uff1b\u53ef\u7701\u7565\u90e8\u5206\u5b57\u6bb5\uff0c\u672a\u8bbe\u7f6e\u5b57\u6bb5\u91c7\u7528\u9ed8\u8ba4\u503c\u3002<\/li>\n<\/ul>\n\n\n\n<p>\u8f93\u51fa\u53c2\u6570\uff1a<\/p>\n\n\n\n<ul>\n<li><code>foreData<\/code>\uff1a\u6700\u7ec8\u6d4b\u8bd5\u96c6\u9884\u6d4b\u6807\u7b7e\u3002<\/li>\n<li><code>foreDataTrain<\/code>\uff1a\u8bad\u7ec3\u96c6\u9884\u6d4b\u6807\u7b7e\u3002<\/li>\n<li><code>net<\/code>\uff1a\u8bad\u7ec3\u5b8c\u6210\u7684 MATLAB \u795e\u7ecf\u7f51\u7edc\u3002<\/li>\n<li><code>info<\/code>\uff1a\u5305\u542b\u8bad\u7ec3\/\u9a8c\u8bc1\/\u6d4b\u8bd5\u7d22\u5f15\u548c\u771f\u5b9e\u6807\u7b7e\u3001\u9a8c\u8bc1\u96c6\u9884\u6d4b\u3001\u4e09\u96c6\u5408\u7c7b\u522b\u5f97\u5206\u3001Accuracy\/Precision\/Recall\/F1\u3001\u6df7\u6dc6\u77e9\u9635\u3001\u8bad\u7ec3\u8bb0\u5f55\u3001\u6807\u51c6\u5316\u5747\u503c\u4e0e\u6807\u51c6\u5dee\u3001\u8f93\u5165\u5c3a\u5bf8\u9002\u914d\u8bb0\u5f55\u3001\u7c7b\u522b\u987a\u5e8f\u548c\u5b8c\u6574 <code>options<\/code>\u3002<\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">\u8f93\u5165\u9002\u914d\u53c2\u6570<\/h6>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u53c2\u6570<\/th>\n<th style=\"text-align:left\">\u9ed8\u8ba4\u503c<\/th>\n<th style=\"text-align:left\">\u5141\u8bb8\u53d6\u503c<\/th>\n<th style=\"text-align:left\">\u542b\u4e49\u4e0e\u6ce8\u610f\u4e8b\u9879<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\"><code>sampleDimension<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;auto&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;auto&#039;<\/code> \u6216\u6709\u6548\u7ef4\u5ea6\u7f16\u53f7<\/td>\n<td style=\"text-align:left\">\u6307\u5b9a <code>X<\/code> \u4e2d\u54ea\u4e00\u7ef4\u662f\u6837\u672c\u7ef4\u3002\u81ea\u52a8\u6a21\u5f0f\u4f18\u5148\u8bc6\u522b\u7b2c\u4e00\u7ef4\uff0c\u518d\u517c\u5bb9\u6700\u540e\u4e00\u7ef4\u3002\u660e\u786e\u7f16\u53f7\u6309 MATLAB \u4ece1\u5f00\u59cb\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>sequenceAxis<\/code><\/td>\n<td style=\"text-align:left\"><code>-1<\/code><\/td>\n<td style=\"text-align:left\">\u5355\u6761\u6837\u672c\u5185\u90e8\u7684\u6709\u6548\u7ef4\u5ea6\u7f16\u53f7<\/td>\n<td style=\"text-align:left\">\u6307\u5b9a\u54ea\u4e00\u7ef4\u5177\u6709\u987a\u5e8f\uff0c\u63091\u5f00\u59cb\uff1b<code>-1<\/code> \u8868\u793a\u6700\u540e\u4e00\u7ef4\u3002\u4e00\u7ef4\u6570\u7ec4\u8bbe1\uff0c<code>[\u901a\u9053,\u65f6\u95f4]<\/code> \u8bbe2\uff0c<code>[\u9ad8,\u5bbd]<\/code> \u9010\u5217\u8bfb\u56fe\u8bbe2\u3002\u9009\u9519\u8f74\u65f6\u7a0b\u5e8f\u53ef\u80fd\u80fd\u8fd0\u884c\uff0c\u4f46\u6a21\u578b\u5b66\u5230\u7684\u76f8\u90bb\u5173\u7cfb\u6ca1\u6709\u5b9e\u9645\u610f\u4e49\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<p>\u7a0b\u5e8f\u4f1a\u628a\u6837\u672c\u7ef4\u79fb\u5230\u6700\u524d\u9762\uff0c\u628a\u5e8f\u5217\u8f74\u79fb\u5230\u6700\u540e\uff0c\u518d\u628a\u5176\u4f59\u7ef4\u5ea6\u5408\u5e76\u6210\u6bcf\u4e2a\u5e8f\u5217\u4f4d\u7f6e\u4e0a\u7684\u7279\u5f81\uff0c\u6700\u7ec8\u7edf\u4e00\u4e3a\u201c\u6837\u672c\u6570\u00d7\u7279\u5f81\u6570\u00d7\u5e8f\u5217\u957f\u5ea6\u201d\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">\u6570\u636e\u5212\u5206\u53c2\u6570<\/h6>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u53c2\u6570<\/th>\n<th style=\"text-align:left\">\u9ed8\u8ba4\u503c<\/th>\n<th style=\"text-align:left\">\u5141\u8bb8\u53d6\u503c<\/th>\n<th style=\"text-align:left\">\u542b\u4e49\u4e0e\u8c03\u53c2\u5f71\u54cd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\"><code>splitLabels<\/code><\/td>\n<td style=\"text-align:left\"><code>[]<\/code><\/td>\n<td style=\"text-align:left\">\u4e0eY\u7b49\u957f\u76841\/2\/3\u6570\u7ec4<\/td>\n<td style=\"text-align:left\">\u9884\u5b9a\u4e49\u5212\u5206\uff1a1=\u8bad\u7ec3\u96c6\u30012=\u9a8c\u8bc1\u96c6\u30013=\u6d4b\u8bd5\u96c6\u3002\u9002\u5408\u6309\u4eba\u5458\u3001\u8bbe\u5907\u3001\u6279\u6b21\u9694\u79bb\uff1b\u8bbe\u7f6e\u540e\u968f\u673a\u5212\u5206\u53c2\u6570\u4e0d\u8d1f\u8d23\u96c6\u5408\u5212\u5206\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>rTrain<\/code><\/td>\n<td style=\"text-align:left\"><code>0.80<\/code><\/td>\n<td style=\"text-align:left\"><code>(0,1)<\/code><\/td>\n<td style=\"text-align:left\">\u8bad\u7ec3+\u9a8c\u8bc1\u6570\u636e\u5360\u5168\u90e8\u6837\u672c\u7684\u6bd4\u4f8b\uff0c\u5269\u4f59\u6837\u672c\u4f5c\u4e3a\u6700\u7ec8\u6d4b\u8bd5\u96c6\u3002\u5b83\u4e0d\u662f\u7eaf\u8bad\u7ec3\u96c6\u6bd4\u4f8b\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>validationRatio<\/code><\/td>\n<td style=\"text-align:left\"><code>0.15<\/code><\/td>\n<td style=\"text-align:left\"><code>(0,1)<\/code><\/td>\n<td style=\"text-align:left\">\u9a8c\u8bc1\u96c6\u5360\u8bad\u7ec3+\u9a8c\u8bc1\u6570\u636e\u7684\u6bd4\u4f8b\u3002\u9a8c\u8bc1\u96c6\u7528\u4e8e\u6a21\u578b\u9009\u62e9\u548c\u65e9\u505c\uff0c\u6d4b\u8bd5\u96c6\u53ea\u5728\u8bad\u7ec3\u7ed3\u675f\u540e\u8bc4\u4f30\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>shuffle<\/code><\/td>\n<td style=\"text-align:left\"><code>true<\/code><\/td>\n<td style=\"text-align:left\"><code>true\/false<\/code><\/td>\n<td style=\"text-align:left\">\u662f\u5426\u5728\u5206\u5c42\u5212\u5206\u524d\u6253\u4e71\u72ec\u7acb\u6837\u672c\u3002\u5b58\u5728\u4e25\u683c\u65f6\u95f4\u6216\u5206\u7ec4\u5173\u7cfb\u65f6\u5e94\u63d0\u4f9b <code>splitLabels<\/code>\uff0c\u4e0d\u80fd\u968f\u610f\u6253\u4e71\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>seed<\/code><\/td>\n<td style=\"text-align:left\"><code>42<\/code><\/td>\n<td style=\"text-align:left\">\u975e\u8d1f\u6574\u6570<\/td>\n<td style=\"text-align:left\">\u56fa\u5b9a\u6570\u636e\u5212\u5206\u548c\u521d\u59cb\u5316\uff0c\u4fbf\u4e8e\u590d\u73b0\uff1b\u8bbe0\u8868\u793a\u4e0d\u56fa\u5b9a\u968f\u673a\u8fc7\u7a0b\u3002GPU\u5e95\u5c42\u7b97\u5b50\u4ecd\u53ef\u80fd\u4ea7\u751f\u672b\u4f4d\u6ce2\u52a8\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">\u7f51\u7edc\u7ed3\u6784\u53c2\u6570<\/h6>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u53c2\u6570<\/th>\n<th style=\"text-align:left\">\u9ed8\u8ba4\u503c<\/th>\n<th style=\"text-align:left\">\u5141\u8bb8\u53d6\u503c<\/th>\n<th style=\"text-align:left\">\u542b\u4e49\u4e0e\u8c03\u53c2\u5f71\u54cd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\"><code>networkType<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;LSTM&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;LSTM&#039;\/&#039;GRU&#039;\/&#039;BiLSTM&#039;<\/code><\/td>\n<td style=\"text-align:left\">\u5faa\u73af\u5c42\u7c7b\u578b\u3002GRU\u66f4\u7cbe\u7b80\uff1bBiLSTM\u540c\u65f6\u8bfb\u53d6\u7a97\u53e3\u5185\u4e24\u4e2a\u65b9\u5411\uff0c\u4f46\u53c2\u6570\u91cf\u548c\u8ba1\u7b97\u91cf\u66f4\u5927\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>convChannels<\/code><\/td>\n<td style=\"text-align:left\"><code>[32,64]<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6574\u6570\u6570\u7ec4<\/td>\n<td style=\"text-align:left\">\u6bcf\u4e2a\u4e00\u7ef4\u5377\u79ef\u5c42\u7684\u8f93\u51fa\u901a\u9053\u6570\uff0c\u6570\u7ec4\u957f\u5ea6\u5c31\u662f\u5377\u79ef\u5c42\u6570\u3002\u589e\u5927\u5bb9\u91cf\u4e5f\u4f1a\u589e\u52a0\u8017\u65f6\u548c\u8fc7\u62df\u5408\u98ce\u9669\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>kernelSize<\/code><\/td>\n<td style=\"text-align:left\"><code>5<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u5947\u6570<\/td>\n<td style=\"text-align:left\">\u5377\u79ef\u6838\u957f\u5ea6\u3002\u8d8a\u5927\u4e00\u6b21\u89c2\u5bdf\u7684\u76f8\u90bb\u4f4d\u7f6e\u8d8a\u5bbd\uff1b\u77ed\u5e8f\u5217\u901a\u5e38\u4f7f\u75283\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>poolSize<\/code><\/td>\n<td style=\"text-align:left\"><code>2<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6574\u6570\uff0c\u4e0d\u8d85\u8fc7\u5e8f\u5217\u957f\u5ea6<\/td>\n<td style=\"text-align:left\">\u6700\u5927\u6c60\u5316\u7a97\u53e3\uff1b\u8bbe1\u8868\u793a\u4e0d\u6c60\u5316\u3002\u6c60\u5316\u8fc7\u5927\u4f1a\u4e22\u5931\u77ed\u5e8f\u5217\u7ec6\u8282\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>rnnHidden<\/code><\/td>\n<td style=\"text-align:left\"><code>64<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6574\u6570<\/td>\n<td style=\"text-align:left\">\u5faa\u73af\u5c42\u9690\u85cf\u5355\u5143\u6570\u3002\u589e\u5927\u53ef\u63d0\u5347\u8bb0\u5fc6\u5bb9\u91cf\uff0c\u4e5f\u4f1a\u589e\u52a0\u8bad\u7ec3\u65f6\u95f4\u548c\u8fc7\u62df\u5408\u98ce\u9669\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>dropout<\/code><\/td>\n<td style=\"text-align:left\"><code>0.20<\/code><\/td>\n<td style=\"text-align:left\"><code>[0,1)<\/code><\/td>\n<td style=\"text-align:left\">\u5206\u7c7b\u5c42\u524d\u968f\u673a\u5931\u6d3b\u6bd4\u4f8b\u3002\u8fc7\u62df\u5408\u65f6\u53ef\u9002\u5f53\u589e\u5927\uff1b\u8fc7\u5927\u53ef\u80fd\u5bfc\u81f4\u6b20\u62df\u5408\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">\u8bad\u7ec3\u53c2\u6570<\/h6>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u53c2\u6570<\/th>\n<th style=\"text-align:left\">\u9ed8\u8ba4\u503c<\/th>\n<th style=\"text-align:left\">\u5141\u8bb8\u53d6\u503c<\/th>\n<th style=\"text-align:left\">\u542b\u4e49\u4e0e\u8c03\u53c2\u5f71\u54cd<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\"><code>solverName<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;adam&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;adam&#039;\/&#039;sgdm&#039;\/&#039;rmsprop&#039;<\/code><\/td>\n<td style=\"text-align:left\">\u53c2\u6570\u66f4\u65b0\u65b9\u6cd5\u3002Adam\u901a\u5e38\u9002\u5408\u4f5c\u4e3a\u521d\u59cb\u9009\u62e9\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>maxEpochs<\/code><\/td>\n<td style=\"text-align:left\"><code>40<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6574\u6570<\/td>\n<td style=\"text-align:left\">\u6700\u5927\u8bad\u7ec3\u8f6e\u6570\uff0c\u53ef\u80fd\u56e0\u65e9\u505c\u63d0\u524d\u7ed3\u675f\u3002\u8f6e\u6570\u8fc7\u5c11\u4f1a\u6b20\u62df\u5408\uff0c\u8fc7\u591a\u4f1a\u589e\u52a0\u8017\u65f6\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>learnRate<\/code><\/td>\n<td style=\"text-align:left\"><code>0.001<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6570<\/td>\n<td style=\"text-align:left\">\u521d\u59cb\u5b66\u4e60\u7387\u3002\u8fc7\u5927\u5bb9\u6613\u9707\u8361\uff0c\u8fc7\u5c0f\u6536\u655b\u7f13\u6162\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>batchSize<\/code><\/td>\n<td style=\"text-align:left\"><code>64<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6574\u6570<\/td>\n<td style=\"text-align:left\">\u6279\u5c3a\u5bf8\u3002\u5927\u6279\u6b21\u66f4\u5e73\u7a33\u4f46\u5360\u66f4\u591a\u5185\u5b58\uff1b\u5c0f\u6570\u636e\u901a\u5e38\u53ef\u4f7f\u752816\u621632\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>earlyStoppingPatience<\/code><\/td>\n<td style=\"text-align:left\"><code>8<\/code><\/td>\n<td style=\"text-align:left\">\u975e\u8d1f\u6574\u6570<\/td>\n<td style=\"text-align:left\">\u9a8c\u8bc1\u635f\u5931\u8fde\u7eed\u591a\u5c11\u6b21\u4e0d\u6539\u5584\u540e\u505c\u6b62\uff1b\u8bbe0\u5173\u95ed\u65e9\u505c\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>learnRateSchedule<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;none&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;none&#039;\/&#039;piecewise&#039;<\/code><\/td>\n<td style=\"text-align:left\">\u662f\u5426\u5206\u6bb5\u964d\u4f4e\u5b66\u4e60\u7387\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>learnRateDropPeriod<\/code><\/td>\n<td style=\"text-align:left\"><code>15<\/code><\/td>\n<td style=\"text-align:left\">\u6b63\u6574\u6570<\/td>\n<td style=\"text-align:left\"><code>piecewise<\/code> \u6a21\u5f0f\u4e0b\u6bcf\u9694\u591a\u5c11\u8f6e\u8870\u51cf\u4e00\u6b21\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>learnRateDropFactor<\/code><\/td>\n<td style=\"text-align:left\"><code>0.5<\/code><\/td>\n<td style=\"text-align:left\"><code>(0,1]<\/code><\/td>\n<td style=\"text-align:left\">\u6bcf\u6b21\u8870\u51cf\u540e\u5b66\u4e60\u7387\u4e58\u4ee5\u7684\u7cfb\u6570\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>classWeight<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;auto&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;auto&#039;\/&#039;none&#039;<\/code> \u6216\u6b63\u6570\u6570\u7ec4<\/td>\n<td style=\"text-align:left\"><code>auto<\/code> \u53ea\u6839\u636e\u8bad\u7ec3\u96c6\u7c7b\u522b\u9891\u6570\u8ba1\u7b97\u53cd\u6bd4\u6743\u91cd\uff1b\u81ea\u5b9a\u4e49\u6570\u7ec4\u957f\u5ea6\u5fc5\u987b\u7b49\u4e8e\u7c7b\u522b\u6570\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>executionEnvironment<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;auto&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;auto&#039;\/&#039;cpu&#039;\/&#039;gpu&#039;<\/code><\/td>\n<td style=\"text-align:left\">\u6307\u5b9a\u8bad\u7ec3\u8bbe\u5907\u3002\u6ca1\u6709\u5408\u9002GPU\u65f6\u53ef\u4f7f\u7528CPU\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">\u6570\u636e\u5904\u7406\u4e0e\u7ed8\u56fe\u53c2\u6570<\/h6>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u53c2\u6570<\/th>\n<th style=\"text-align:left\">\u9ed8\u8ba4\u503c<\/th>\n<th style=\"text-align:left\">\u5141\u8bb8\u53d6\u503c<\/th>\n<th style=\"text-align:left\">\u542b\u4e49\u4e0e\u6ce8\u610f\u4e8b\u9879<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\"><code>mapflag<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;on&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;on&#039;\/&#039;off&#039;<\/code> \u6216 logical<\/td>\n<td style=\"text-align:left\">\u662f\u5426\u6807\u51c6\u5316\u3002\u5f00\u542f\u65f6\u5747\u503c\u548c\u6807\u51c6\u5dee\u53ea\u4ece\u8bad\u7ec3\u96c6\u8ba1\u7b97\uff0c\u907f\u514d\u63d0\u524d\u770b\u5230\u9a8c\u8bc1\u548c\u6d4b\u8bd5\u6570\u636e\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>figflag<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;on&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;on&#039;\/&#039;off&#039;<\/code> \u6216 logical<\/td>\n<td style=\"text-align:left\">\u662f\u5426\u751f\u6210\u5e76\u4fdd\u5b58\u4e94\u5f20\u7ed3\u679c\u56fe\u3002\u6279\u91cf\u8c03\u53c2\u65f6\u53ef\u5173\u95ed\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>showFigures<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;on&#039;<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;on&#039;\/&#039;off&#039;<\/code> \u6216 logical<\/td>\n<td style=\"text-align:left\">\u662f\u5426\u5728\u8fd0\u884c\u65f6\u5f39\u51fa\u56fe\u7a97\uff1b\u5173\u95ed\u65f6\u4ecd\u53ef\u7531 <code>figflag<\/code> \u51b3\u5b9a\u662f\u5426\u4fdd\u5b58\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>caseName<\/code><\/td>\n<td style=\"text-align:left\"><code>&#039;CNN-RNN&#039;<\/code><\/td>\n<td style=\"text-align:left\">\u5b57\u7b26\u4e32<\/td>\n<td style=\"text-align:left\">\u7ed3\u679c\u56fe\u6587\u4ef6\u540d\u524d\u7f00\uff0c\u7528\u4e8e\u907f\u514d\u591a\u4e2a\u6848\u4f8b\u4e92\u76f8\u8986\u76d6\u3002<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\"><code>classNames<\/code><\/td>\n<td style=\"text-align:left\"><code>[]<\/code><\/td>\n<td style=\"text-align:left\">\u4e0e\u7c7b\u522b\u6570\u4e00\u81f4\u7684\u540d\u79f0\u5217\u8868<\/td>\n<td style=\"text-align:left\">\u7ed8\u56fe\u663e\u793a\u540d\u79f0\uff0c\u987a\u5e8f\u5fc5\u987b\u4e0e\u6392\u5e8f\u540e\u7684\u771f\u5b9e\u7c7b\u522b\u4e00\u81f4\u3002<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<h6 class=\"wp-block-heading\">5. EvaClassEffect.m \u6587\u4ef6<\/h6>\n\n\n\n<p>\u8be5\u51fd\u6570\u8ba1\u7b97\u591a\u5206\u7c7b\u6307\u6807\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">ind = EvaClassEffect(realData, foreData, classOrder)<\/code><\/pre>\n\n\n\n<ul>\n<li><code>realData<\/code>\uff1a\u771f\u5b9e\u7c7b\u522b\u3002<\/li>\n<li><code>foreData<\/code>\uff1a\u9884\u6d4b\u7c7b\u522b\u3002<\/li>\n<li><code>classOrder<\/code>\uff1a\u53ef\u9009\u7684\u56fa\u5b9a\u7c7b\u522b\u987a\u5e8f\u3002<\/li>\n<li><code>ind<\/code>\uff1a\u8fd4\u56de Accuracy\u3001MacroPrecision\u3001MacroRecall\u3001MacroF1\u3001\u9010\u7c7b\u522b Precision\/Recall\/F1\u3001Support\u3001ConfusionMatrix \u548c ClassOrder\u3002<\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">6. \u6570\u636e\u6587\u4ef6<\/h6>\n\n\n\n<ul>\n<li><code>iris.csv<\/code>\uff1aIris \u4e09\u5206\u7c7b\u6570\u636e\u3002<\/li>\n<li><code>har_activity_data.mat<\/code>\uff1aUCI HAR \u4e5d\u901a\u9053\u4f20\u611f\u5668\u5e8f\u5217\u53ca\u53d7\u8bd5\u8005\u9694\u79bb\u5212\u5206\u3002<\/li>\n<li><code>mnist_subset.mat<\/code>\uff1aMNIST 0~9\u5341\u5206\u7c7b\u76845000\u5f20\u7070\u5ea6\u56fe\u5b50\u96c6\u3002<\/li>\n<li><code>\u6570\u636e\u6765\u6e90\u4e0e\u8bb8\u53ef.txt<\/code>\uff1a\u8bb0\u5f55\u6570\u636e\u6765\u6e90\u4e0e\u8bb8\u53ef\u3002\u5176\u4e2d UCI HAR \u6309 CC BY 4.0 \u4f7f\u7528\u3002<\/li>\n<\/ul>\n\n\n\n<h6 class=\"wp-block-heading\">7. figure \u6587\u4ef6\u5939<\/h6>\n\n\n\n<p>\u6bcf\u4e2a\u6848\u4f8b\u81ea\u52a8\u751f\u62105\u5f20\u72ec\u7acbPNG\uff0c\u56e0\u6b64\u4e09\u4e2ademo\u5171\u751f\u621015\u5f20\u56fe\uff1a\u6536\u655b\u8fc7\u7a0b\u3001\u6d4b\u8bd5\u96c6\u6df7\u6dc6\u77e9\u9635\u3001\u9010\u7c7b\u522b\u6307\u6807\u3001\u6d4b\u8bd5\u96c6\u771f\u5b9e\/\u9884\u6d4b\u7c7b\u522b\u5bf9\u6bd4\u3001\u8bad\u7ec3\/\u9a8c\u8bc1\/\u6d4b\u8bd5\u6307\u6807\u5bf9\u6bd4\u3002\u5b8c\u6574\u7248\u56fe\u7247\u65e0\u6c34\u5370\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">8. \u4ee3\u7801\u8bf4\u660e.txt \u6587\u4ef6<\/h6>\n\n\n\n<p>\u8be5\u6587\u4ef6\u662f\u968f\u4ee3\u7801\u4ea4\u4ed8\u7684\u79bb\u7ebf\u4f7f\u7528\u624b\u518c\uff0c\u5305\u542b\u8fd0\u884c\u73af\u5883\u3001\u6240\u6709\u5165\u53e3\u53c2\u6570\u3001\u8f93\u51fa\u8bf4\u660e\u3001\u6570\u636e\u66ff\u6362\u65b9\u6cd5\u548c\u6ce8\u610f\u4e8b\u9879\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e09\u3001\u5feb\u901f\u5f00\u59cb<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\">1. \u8fd0\u884c\u6d4b\u8bd5\u811a\u672c<\/h6>\n\n\n\n<p>\u5728 MATLAB \u4e2d\u6253\u5f00\u4ee3\u7801\u6587\u4ef6\u5939\u5e76\u8bbe\u4e3a\u5f53\u524d\u6587\u4ef6\u5939\uff0c\u6839\u636e\u81ea\u5df1\u7684\u6570\u636e\u7c7b\u578b\u9009\u62e9\u4e00\u4e2ademo\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">demoCNNRNNClassIris      % \u4e00\u7ef4\u6570\u7ec4\ndemoCNNRNNClassHAR       % \u591a\u901a\u9053\u5e8f\u5217\ndemoCNNRNNClassMNIST     % \u4e8c\u7ef4\u7070\u5ea6\u56fe<\/code><\/pre>\n\n\n\n<p>\u7a0b\u5e8f\u65e0\u62a5\u9519\u3001\u547d\u4ee4\u884c\u8f93\u51fa\u4e09\u96c6\u5408\u6307\u6807\uff0c\u5e76\u5728 <code>figure\/<\/code> \u4e2d\u751f\u6210\u5bf9\u5e94\u76845\u5f20\u56fe\u7247\uff0c\u5373\u8bf4\u660e\u73af\u5883\u548c\u4ee3\u7801\u6b63\u5e38\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">2. \u66ff\u6362\u6210\u81ea\u5df1\u7684\u6570\u636e<\/h6>\n\n\n\n<p>\u590d\u5236\u4e00\u4e2a\u6700\u63a5\u8fd1\u81ea\u5df1\u8f93\u5165\u5f62\u72b6\u7684demo\uff0c\u5728\u526f\u672c\u4e2d\u53ea\u4fee\u6539\u6570\u636e\u5bfc\u5165\u90e8\u5206\u3002\u4f8b\u5982\u666e\u901a\u4e8c\u7ef4\u6570\u7ec4\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">data = readmatrix(&#039;your_data.csv&#039;);\nX = data(:, 1:end-1);\nY = data(:, end);\noptions.sequenceAxis = 1;<\/code><\/pre>\n\n\n\n<p>\u591a\u901a\u9053\u5e8f\u5217\u5efa\u8bae\u6574\u7406\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">% X\uff1a[\u6837\u672c\u6570, \u901a\u9053\u6570, \u65f6\u95f4\u957f\u5ea6]\n% Y\uff1a[\u6837\u672c\u6570, 1]\noptions.sequenceAxis = 2;<\/code><\/pre>\n\n\n\n<p>\u7070\u5ea6\u56fe\u5efa\u8bae\u6574\u7406\u4e3a\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-matlab\">% X\uff1a[\u6837\u672c\u6570, \u9ad8\u5ea6, \u5bbd\u5ea6]\n% Y\uff1a[\u6837\u672c\u6570, 1]\noptions.sequenceAxis = 2;  % \u6cbf\u5bbd\u5ea6\u9010\u5217\u8bfb\u53d6<\/code><\/pre>\n\n\n\n<p>\u5f69\u8272\u56fe\u4e5f\u53ef\u4ee5\u4f7f\u7528\uff0c\u4f46\u9700\u8981\u660e\u786e\u56fe\u50cf\u7684\u7ef4\u5ea6\u6392\u5217\u548c\u5e0c\u671b\u6cbf\u54ea\u4e2a\u65b9\u5411\u8bfb\u53d6\u3002\u4f8b\u5982 <code>[\u6837\u672c\u6570,\u9ad8\u5ea6,\u5bbd\u5ea6,\u901a\u9053]<\/code> \u6cbf\u5bbd\u5ea6\u8bfb\u53d6\u65f6\uff0c<code>sequenceAxis=2<\/code>\uff0c\u9ad8\u5ea6\u548c\u901a\u9053\u4f1a\u5408\u5e76\u4e3a\u6bcf\u4e00\u6b65\u7684\u7279\u5f81\u3002\u5bf9\u4e8e\u9700\u8981\u4e25\u683c\u4fdd\u6301\u4e8c\u7ef4\u7a7a\u95f4\u5c40\u90e8\u5173\u7cfb\u7684\u56fe\u50cf\u4efb\u52a1\uff0c\u6807\u51c6\u4e8c\u7ef4CNN\u901a\u5e38\u66f4\u81ea\u7136\uff1b\u672c\u7a0b\u5e8f\u9002\u5408\u5e0c\u671b\u628a\u67d0\u4e00\u56fe\u50cf\u65b9\u5411\u4f5c\u4e3a\u5e8f\u5217\u8bfb\u53d6\u7684\u573a\u666f\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">3. \u9009\u62e9\u6b63\u786e\u7684\u6570\u636e\u5212\u5206<\/h6>\n\n\n\n<p>\u72ec\u7acb\u6837\u672c\u53ef\u4ee5\u4f7f\u7528 <code>rTrain<\/code> \u548c <code>validationRatio<\/code> \u5206\u5c42\u968f\u673a\u5212\u5206\u3002\u540c\u4e00\u4e2a\u4eba\u5458\u3001\u8bbe\u5907\u3001\u5de5\u51b5\u6216\u6279\u6b21\u4ea7\u751f\u591a\u6761\u76f8\u4f3c\u6837\u672c\u65f6\uff0c\u5efa\u8bae\u63d0\u524d\u751f\u6210 <code>splitLabels<\/code>\uff0c\u786e\u4fdd\u76f8\u5173\u6837\u672c\u4e0d\u4f1a\u8de8\u96c6\u5408\u6cc4\u6f0f\u3002\u65f6\u95f4\u5e8f\u5217\u7a97\u53e3\u4e5f\u4e0d\u5e94\u7b80\u5355\u968f\u673a\u62c6\u5206\u672a\u6765\u6570\u636e\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">4. \u8c03\u6574\u53c2\u6570\u5e76\u8fd0\u884c<\/h6>\n\n\n\n<p>\u4f18\u5148\u786e\u8ba4 <code>sequenceAxis<\/code> \u7684\u4e1a\u52a1\u542b\u4e49\uff0c\u518d\u8c03\u6574 <code>networkType<\/code>\u3001<code>convChannels<\/code>\u3001<code>kernelSize<\/code>\u3001<code>poolSize<\/code> \u548c <code>rnnHidden<\/code>\u3002\u8bad\u7ec3\u4e0d\u7a33\u5b9a\u65f6\u68c0\u67e5\u5b66\u4e60\u7387\uff1b\u8bad\u7ec3\u96c6\u660e\u663e\u4f18\u4e8e\u9a8c\u8bc1\u96c6\u548c\u6d4b\u8bd5\u96c6\u65f6\uff0c\u8003\u8651\u51cf\u5c0f\u7f51\u7edc\u3001\u589e\u52a0 Dropout\u3001\u589e\u52a0\u6570\u636e\u6216\u6539\u8fdb\u5206\u7ec4\u5212\u5206\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u56db\u3001\u5173\u4e8e\u5b8c\u6574\u7248\u4e0e\u516c\u5f00\u7248\u4ee3\u7801<\/h4>\n\n\n\n<figure class=\"wp-block-table\"><table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u529f\u80fd<\/th>\n<th style=\"text-align:center\">\u5b8c\u6574\u7248<\/th>\n<th style=\"text-align:center\">\u516c\u5f00\u7248<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">Iris\u4e00\u7ef4\u7279\u5f81\u6f14\u793a<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<td style=\"text-align:center\">\u221a\uff0c90\u6761<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">HAR\u591a\u901a\u9053\u5e8f\u5217\u6f14\u793a<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<td style=\"text-align:center\">\u221a\uff0c96\u6761<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">MNIST\u56fe\u50cf\u6f14\u793a<\/td>\n<td style=\"text-align:center\">0~9\u5341\u5206\u7c7b\uff0c5000\u5f20<\/td>\n<td style=\"text-align:center\">0\/1\/2\u4e09\u5206\u7c7b\uff0c90\u5f20<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u81ea\u5b9a\u4e49\u6570\u636e\u3001\u53c2\u6570\u8bbe\u7f6e<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6838\u5fc3\u51fd\u6570\u6e90\u7801<\/td>\n<td style=\"text-align:center\">\u63d0\u4f9b<\/td>\n<td style=\"text-align:center\">\u4e0d\u63d0\u4f9b<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6700\u5927\u6837\u672c\u6570<\/td>\n<td style=\"text-align:center\">\u65e0\u4eba\u5de5\u9650\u5236\uff0c\u53d7\u5185\u5b58\u548c\u786c\u4ef6\u7ea6\u675f<\/td>\n<td style=\"text-align:center\">100\u6761<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6700\u5927\u5377\u79ef\u5c42\u6570<\/td>\n<td style=\"text-align:center\">\u65e0\u8bd5\u7528\u7248\u9650\u5236<\/td>\n<td style=\"text-align:center\">2\u5c42<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6700\u5927\u8bad\u7ec3\u8f6e\u6570<\/td>\n<td style=\"text-align:center\">\u65e0\u8bd5\u7528\u7248\u9650\u5236<\/td>\n<td style=\"text-align:center\">30\u8f6e<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u5faa\u73af\u7ed3\u6784<\/td>\n<td style=\"text-align:center\">LSTM\u3001GRU\u3001BiLSTM<\/td>\n<td style=\"text-align:center\">LSTM\u3001GRU<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6700\u5927\u9690\u85cf\u5355\u5143\u6570<\/td>\n<td style=\"text-align:center\">\u65e0\u8bd5\u7528\u7248\u9650\u5236<\/td>\n<td style=\"text-align:center\">64<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u81ea\u52a8\u5206\u7c7b\u6307\u6807\u548c15\u5f20\u6848\u4f8b\u56fe<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u7ed3\u679c\u56fe\u6c34\u5370<\/td>\n<td style=\"text-align:center\">\u65e0\u6c34\u5370<\/td>\n<td style=\"text-align:center\">\u6709\u201c\u8bd5\u7528\u7248@khsci.com\/docs\u201d\u6c34\u5370<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u4fee\u6539\u6838\u5fc3\u5b9e\u73b0\u4e0e\u4e8c\u6b21\u5f00\u53d1<\/td>\n<td style=\"text-align:center\">\u221a<\/td>\n<td style=\"text-align:center\">\u00d7<\/td>\n<\/tr>\n<\/tbody>\n<\/table><\/figure>\n\n\n\n<p>\u516c\u5f00\u7248\u7528\u4e8e\u68c0\u67e5\u8fd0\u884c\u73af\u5883\u3001\u7406\u89e3\u8f93\u5165\u683c\u5f0f\u5e76\u4f53\u9a8c\u8c03\u7528\u6d41\u7a0b\uff1b\u6b63\u5f0f\u8bad\u7ec3\u3001\u5927\u6837\u672c\u4efb\u52a1\u548c\u4e8c\u6b21\u4fee\u6539\u5efa\u8bae\u4f7f\u7528\u5b8c\u6574\u7248\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e94\u3001\u83b7\u53d6\u516c\u5f00\u7248\u7a0b\u5e8f<\/h4>\n\n\n\n<blockquote class=\"wp-block-quote\">\n<p><strong>\u516c\u5f00\u7248\u4e0b\u8f7d\uff1a<\/strong> <a href=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-trial-v26wq012h.zip\">\u70b9\u51fb\u6b64\u5904\u4e0b\u8f7d CNN-RNN \u901a\u7528\u5206\u7c7b MATLAB \u516c\u5f00\u7248\u4ee3\u7801<\/a><\/p>\n<\/blockquote>\n\n\n\n<p>\u6ce8\uff1a\u516c\u5f00\u7248\u9700\u8981 MATLAB R2022a \u6216\u66f4\u65b0\u7248\u672c\uff0c\u6700\u591a\u652f\u6301100\u6761\u6837\u672c\uff0c\u6700\u591a\u8bad\u7ec330\u8f6e\uff0c\u7ed3\u679c\u56fe\u5e26\u8bd5\u7528\u7248\u6c34\u5370\u3002<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u516d\u3001\u83b7\u53d6\u5b8c\u6574\u7248\u7a0b\u5e8f<\/h4>\n\n\n\n<p>\u70b9\u51fb\u672c\u9875\u9762\u201c\u7acb\u5373\u652f\u4ed8\u201d\u6309\u94ae\uff0c\u4ed8\u6b3e\u540e\u83b7\u53d6\u5b8c\u6574\u7248\u4ee3\u7801\u4e0b\u8f7d\u94fe\u63a5\u548c\u552e\u540e\u8054\u7cfb\u65b9\u5f0f\u3002\u4ed8\u6b3e\u5b8c\u6210\u540e\u5237\u65b0\u672c\u9875\u9762\u5373\u53ef\u770b\u5230\u4e0b\u8f7d\u94fe\u63a5\u3002<\/p>\n\n\n\n<p>\uff08\u6ce8\u610f\u652f\u4ed8\u8df3\u8f6c\u5931\u8d25\u7684\u8bdd\uff0c\u8bf7\u4f7f\u7528\u6d4f\u89c8\u5668\u6253\u5f00\u672c\u9875\u9762\uff09<\/p>\n\n\n<p><div class=\"erphp-wppay\">\n\t\t\t\t\u60a8\u9700\u8981\u5148\u652f\u4ed8 <b>76\u5143<\/b> \u624d\u80fd\u67e5\u770b\u6b64\u5904\u5185\u5bb9\uff01<a href=\"javascript:;\" class=\"erphp-wppay-loader\" data-post=\"3903\">\u7acb\u5373\u652f\u4ed8<\/a>\n\t\t\t<\/div><\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u4e03\u3001\u5b8c\u6574\u7248\u4ee3\u7801\u91cd\u8981\u66f4\u65b0<\/h4>\n\n\n\n<ul>\n<li>20260720\uff1a\u5b8c\u6210 MATLAB \u7248\u521d\u7248\u4ee3\u7801\uff0c\u652f\u6301\u4e00\u7ef4\u6570\u7ec4\u3001\u591a\u901a\u9053\u5e8f\u5217\u3001\u7070\u5ea6\u56fe\u548c\u66f4\u9ad8\u7ef4\u8f93\u5165\u9002\u914d\uff1b\u63d0\u4f9b Iris\u3001UCI HAR\u3001MNIST \u4e09\u4e2a\u6848\u4f8b\u4ee5\u53ca15\u5f20\u81ea\u52a8\u7ed3\u679c\u56fe\u3002<\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\">\u516b\u3001\u5e38\u89c1\u95ee\u9898<\/h4>\n\n\n\n<h6 class=\"wp-block-heading\">Q1\uff1a\u8fd9\u662f\u4e0d\u662f\u53ea\u80fd\u505a\u65f6\u95f4\u5e8f\u5217\u5206\u7c7b\uff1f<\/h6>\n\n\n\n<p>\u4e0d\u662f\u3002\u5b83\u505a\u7684\u662f\u591a\u5206\u7c7b\uff0c\u8f93\u5165\u53ef\u4ee5\u662f\u4e00\u7ef4\u7279\u5f81\u3001\u591a\u901a\u9053\u5e8f\u5217\u6216\u56fe\u50cf\u3002\u5173\u952e\u8981\u6c42\u4e0d\u662f\u201c\u6570\u636e\u5fc5\u987b\u6765\u81ea\u65f6\u95f4\u201d\uff0c\u800c\u662f\u4f60\u6307\u5b9a\u7684 <code>sequenceAxis<\/code> \u5fc5\u987b\u6709\u5408\u7406\u987a\u5e8f\uff0c\u4f8b\u5982\u65f6\u95f4\u3001\u6ce2\u957f\u3001\u8ddd\u79bb\u6216\u56fe\u50cf\u626b\u63cf\u65b9\u5411\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Q2\uff1a\u4efb\u610f\u7ef4\u5ea6\u90fd\u80fd\u7528\uff0c\u662f\u4e0d\u662f\u6240\u6709\u6570\u636e\u90fd\u9002\u5408 CNN-RNN\uff1f<\/h6>\n\n\n\n<p>\u4e0d\u662f\u3002\u7a0b\u5e8f\u53ef\u4ee5\u6574\u7406\u4efb\u610f\u7ef4\u5ea6\u6570\u503c\u6570\u7ec4\uff0c\u4f46\u6a21\u578b\u4f1a\u628a\u5e8f\u5217\u8f74\u4e0a\u7684\u76f8\u90bb\u4f4d\u7f6e\u5f53\u6210\u6709\u610f\u4e49\u7684\u90bb\u5c45\u3002\u5982\u679c\u5404\u5217\u53ea\u662f\u968f\u610f\u6392\u5217\u7684\u8868\u683c\u5b57\u6bb5\uff0cCNN\u548cRNN\u7684\u7ed3\u6784\u5047\u8bbe\u53ef\u80fd\u4e0d\u6210\u7acb\u3002\u6ca1\u6709\u660e\u786e\u987a\u5e8f\u65f6\uff0c\u5e94\u4e0e\u666e\u901a\u5168\u8fde\u63a5\u7f51\u7edc\u3001\u6811\u6a21\u578b\u6216SVM\u8fdb\u884c\u5bf9\u6bd4\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Q3\uff1a\u4e3a\u4ec0\u4e48 HAR \u8981\u4f7f\u7528 splitLabels\uff1f<\/h6>\n\n\n\n<p>\u540c\u4e00\u4e2a\u4eba\u7684\u52a8\u4f5c\u7247\u6bb5\u901a\u5e38\u5f88\u76f8\u4f3c\u3002\u5982\u679c\u968f\u673a\u62c6\u5206\uff0c\u6a21\u578b\u53ef\u80fd\u5728\u6d4b\u8bd5\u96c6\u9047\u5230\u8bad\u7ec3\u9636\u6bb5\u5df2\u7ecf\u89c1\u8fc7\u7684\u4eba\u7684\u52a8\u4f5c\u6a21\u5f0f\uff0c\u6307\u6807\u4f1a\u865a\u9ad8\u3002<code>splitLabels<\/code> \u53ef\u4ee5\u6309\u53d7\u8bd5\u8005\u3001\u8bbe\u5907\u6216\u6279\u6b21\u9694\u79bb\uff0c\u66f4\u63a5\u8fd1\u771f\u5b9e\u6cdb\u5316\u573a\u666f\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Q4\uff1a\u8bad\u7ec3\u96c6\u51c6\u786e\u7387\u5f88\u9ad8\uff0c\u6d4b\u8bd5\u96c6\u5374\u4e0d\u9ad8\u600e\u4e48\u529e\uff1f<\/h6>\n\n\n\n<p>\u5148\u68c0\u67e5\u662f\u5426\u5b58\u5728\u6570\u636e\u6cc4\u6f0f\u548c\u7c7b\u522b\u4e0d\u5e73\u8861\uff0c\u518d\u770b\u9a8c\u8bc1\u96c6\u8d70\u52bf\u3002\u53ef\u4ee5\u51cf\u5c0f <code>convChannels<\/code> \u6216 <code>rnnHidden<\/code>\u3001\u589e\u5927 <code>dropout<\/code>\u3001\u542f\u7528\u65e9\u505c\u3001\u589e\u52a0\u6570\u636e\u91cf\uff0c\u6216\u4f7f\u7528\u66f4\u5408\u7406\u7684\u5206\u7ec4\u5212\u5206\u3002\u4e0d\u8981\u53ea\u9760\u589e\u52a0\u8bad\u7ec3\u8f6e\u6570\u89e3\u51b3\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Q5\uff1a\u4e3a\u4ec0\u4e48\u56fe\u50cf\u5206\u7c7b\u4e0d\u76f4\u63a5\u4f7f\u7528\u4e8c\u7ef4CNN\uff1f<\/h6>\n\n\n\n<p>\u672c\u7a0b\u5e8f\u628a\u56fe\u50cf\u7684\u4e00\u4e2a\u65b9\u5411\u5f53\u4f5c\u5e8f\u5217\uff0c\u9002\u5408\u6f14\u793a CNN-RNN \u5982\u4f55\u9010\u5217\u6216\u9010\u884c\u8bfb\u53d6\u56fe\u50cf\u3002\u82e5\u4efb\u52a1\u9ad8\u5ea6\u4f9d\u8d56\u5b8c\u6574\u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\uff0c\u4e8c\u7ef4CNN\u901a\u5e38\u66f4\u76f4\u63a5\uff1b\u5982\u679c\u56fe\u50cf\u67d0\u4e00\u65b9\u5411\u5929\u7136\u5177\u6709\u626b\u63cf\u987a\u5e8f\u6216\u9700\u8981\u7ed3\u5408\u5faa\u73af\u8bb0\u5fc6\uff0cCNN-RNN\u624d\u66f4\u6709\u610f\u4e49\u3002<\/p>\n\n\n\n<h6 class=\"wp-block-heading\">Q6\uff1a\u6700\u5c11\u9700\u8981\u6539\u54ea\u4e9b\u5185\u5bb9\uff1f<\/h6>\n\n\n\n<p>\u6700\u5c11\u4fee\u6539 <code>X<\/code>\u3001<code>Y<\/code> \u548c <code>options.sequenceAxis<\/code>\u3002\u4e4b\u540e\u6839\u636e\u6570\u636e\u91cf\u4e0e\u6548\u679c\u8c03\u6574\u7f51\u7edc\u5bb9\u91cf\u3001\u8bad\u7ec3\u8f6e\u6570\u3001\u5b66\u4e60\u7387\u548c\u6279\u5c3a\u5bf8\u3002\u5efa\u8bae\u5148\u8fd0\u884c\u6700\u63a5\u8fd1\u81ea\u5df1\u8f93\u5165\u5f62\u6001\u7684demo\uff0c\u518d\u9010\u9879\u66ff\u6362\u3002<\/p>\n\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u6587\u4ecb\u7ecd\u4e00\u5957 MATLAB \u7248 CNN-RNN \u901a\u7528\u5206\u7c7b\u4ee3\u7801\u3002\u7a0b\u5e8f\u4e0d\u628a\u8f93\u5165\u9650\u5236\u4e3a\u5355\u4e00\u7684\u201c\u5e8f\u5217\u5206\u7c7b\u201d\u683c\u5f0f\uff0c\u800c\u662f\u5141 [&hellip;]<\/p>\n","protected":false},"author":0,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.13 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801 - \u5de5\u5177\u7bb1\u6587\u6863<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801 - \u5de5\u5177\u7bb1\u6587\u6863\" \/>\n<meta property=\"og:description\" content=\"\u672c\u6587\u4ecb\u7ecd\u4e00\u5957 MATLAB \u7248 CNN-RNN \u901a\u7528\u5206\u7c7b\u4ee3\u7801\u3002\u7a0b\u5e8f\u4e0d\u628a\u8f93\u5165\u9650\u5236\u4e3a\u5355\u4e00\u7684\u201c\u5e8f\u5217\u5206\u7c7b\u201d\u683c\u5f0f\uff0c\u800c\u662f\u5141 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\" \/>\n<meta property=\"og:site_name\" content=\"\u5de5\u5177\u7bb1\u6587\u6863\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-27T23:39:47+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-iris-confusion.png\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\"},\"author\":{\"name\":\"\",\"@id\":\"\"},\"headline\":\"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801\",\"datePublished\":\"2026-07-27T23:39:47+00:00\",\"dateModified\":\"2026-07-27T23:39:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\"},\"wordCount\":147,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/44b1dc94a273203f641349de36ebc0a5\"},\"articleSection\":[\"\u6a21\u5f0f\u8bc6\u522b\/\u5206\u7c7b\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\",\"url\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\",\"name\":\"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801 - \u5de5\u5177\u7bb1\u6587\u6863\",\"isPartOf\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/#website\"},\"datePublished\":\"2026-07-27T23:39:47+00:00\",\"dateModified\":\"2026-07-27T23:39:47+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.khsci.com\/docs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.khsci.com\/docs\/#website\",\"url\":\"https:\/\/www.khsci.com\/docs\/\",\"name\":\"\u5de5\u5177\u7bb1\u6587\u6863\",\"description\":\"khToolbox\",\"publisher\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/44b1dc94a273203f641349de36ebc0a5\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.khsci.com\/docs\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/44b1dc94a273203f641349de36ebc0a5\",\"name\":\"kuohao\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/khsci.com\/docs\/wp-content\/uploads\/2022\/11\/logo-1.png\",\"contentUrl\":\"https:\/\/khsci.com\/docs\/wp-content\/uploads\/2022\/11\/logo-1.png\",\"width\":255,\"height\":97,\"caption\":\"kuohao\"},\"logo\":{\"@id\":\"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801 - \u5de5\u5177\u7bb1\u6587\u6863","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/","og_locale":"zh_CN","og_type":"article","og_title":"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801 - \u5de5\u5177\u7bb1\u6587\u6863","og_description":"\u672c\u6587\u4ecb\u7ecd\u4e00\u5957 MATLAB \u7248 CNN-RNN \u901a\u7528\u5206\u7c7b\u4ee3\u7801\u3002\u7a0b\u5e8f\u4e0d\u628a\u8f93\u5165\u9650\u5236\u4e3a\u5355\u4e00\u7684\u201c\u5e8f\u5217\u5206\u7c7b\u201d\u683c\u5f0f\uff0c\u800c\u662f\u5141 [&hellip;]","og_url":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/","og_site_name":"\u5de5\u5177\u7bb1\u6587\u6863","article_published_time":"2026-07-27T23:39:47+00:00","og_image":[{"url":"https:\/\/www.khsci.com\/docs\/wp-content\/uploads\/2026\/07\/cnn-rnn-classification-matlab-iris-confusion.png"}],"twitter_card":"summary_large_image","twitter_misc":{"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#article","isPartOf":{"@id":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/"},"author":{"name":"","@id":""},"headline":"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801","datePublished":"2026-07-27T23:39:47+00:00","dateModified":"2026-07-27T23:39:47+00:00","mainEntityOfPage":{"@id":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/"},"wordCount":147,"commentCount":0,"publisher":{"@id":"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/44b1dc94a273203f641349de36ebc0a5"},"articleSection":["\u6a21\u5f0f\u8bc6\u522b\/\u5206\u7c7b"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/","url":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/","name":"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801 - \u5de5\u5177\u7bb1\u6587\u6863","isPartOf":{"@id":"https:\/\/www.khsci.com\/docs\/#website"},"datePublished":"2026-07-27T23:39:47+00:00","dateModified":"2026-07-27T23:39:47+00:00","breadcrumb":{"@id":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.khsci.com\/docs\/index.php\/2026\/07\/28\/cnn-rnn-classification-matlab\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.khsci.com\/docs\/"},{"@type":"ListItem","position":2,"name":"CNN-RNN\u901a\u7528\u5206\u7c7bMATLAB\u4ee3\u7801"}]},{"@type":"WebSite","@id":"https:\/\/www.khsci.com\/docs\/#website","url":"https:\/\/www.khsci.com\/docs\/","name":"\u5de5\u5177\u7bb1\u6587\u6863","description":"khToolbox","publisher":{"@id":"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/44b1dc94a273203f641349de36ebc0a5"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.khsci.com\/docs\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/44b1dc94a273203f641349de36ebc0a5","name":"kuohao","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/image\/","url":"https:\/\/khsci.com\/docs\/wp-content\/uploads\/2022\/11\/logo-1.png","contentUrl":"https:\/\/khsci.com\/docs\/wp-content\/uploads\/2022\/11\/logo-1.png","width":255,"height":97,"caption":"kuohao"},"logo":{"@id":"https:\/\/www.khsci.com\/docs\/#\/schema\/person\/image\/"}}]}},"_links":{"self":[{"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/posts\/3903"}],"collection":[{"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/types\/post"}],"replies":[{"embeddable":true,"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/comments?post=3903"}],"version-history":[{"count":1,"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/posts\/3903\/revisions"}],"predecessor-version":[{"id":3905,"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/posts\/3903\/revisions\/3905"}],"wp:attachment":[{"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/media?parent=3903"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/categories?post=3903"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.khsci.com\/docs\/index.php\/wp-json\/wp\/v2\/tags?post=3903"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}