Matlab中预训练的Keras/Tensorflow模型
Matlab Keras导入器似乎允许我们使用Keras/Tensorflow训练的模型,我们可以在Matlab中使用这些模型。在他们所有的文档中,他们使用了图像输入和CNN模型。我在keras中创建了一个简单的前馈ANN模型,输入不是图像。Matlab Keras导入器是否仅适用于图像输入或CNN模型?虽然Matlab能够准确地读取模型并给出激活函数、一些隐藏层和其他内容,但当我在Keras和Matlab中检查分类器输出时,它们的答案不匹配。有人能澄清一下吗?Matlab中预训练的Keras/Tensorflow模型,matlab,tensorflow,machine-learning,keras,Matlab,Tensorflow,Machine Learning,Keras,Matlab Keras导入器似乎允许我们使用Keras/Tensorflow训练的模型,我们可以在Matlab中使用这些模型。在他们所有的文档中,他们使用了图像输入和CNN模型。我在keras中创建了一个简单的前馈ANN模型,输入不是图像。Matlab Keras导入器是否仅适用于图像输入或CNN模型?虽然Matlab能够准确地读取模型并给出激活函数、一些隐藏层和其他内容,但当我在Keras和Matlab中检查分类器输出时,它们的答案不匹配。有人能澄清一下吗? 下面是Matlab代码 clea
下面是Matlab代码
clear
close all
classnames={'0','1','2','3','4','5','6'}; % Number of classes I have
model16 = importKerasNetwork('model16.json','WeightFile','model16.h5','classnames',classnames,'OutputLayerType','classification');
model16.Layers % Displays the architecture of the network
load 'feature_vector_newtra360_48Khz.mat' % Load the feature vector used to test the classifier
A=featurevec(1,1:37); % taking one feature vector to classify
ans = classify(model16,A); % command used to classify
在这里,我采用了keras的模型。当我使用model16.layers命令时,我可以完美地看到体系结构。但是,当我输入分类时,Matlab和keras中的答案并不匹配。我犯了什么错误吗?你能给我们看一下你的matlab代码吗?嗨,我改了问题。请看一看