Matlab中经过预先训练的Keras / Tensorflow模型

时间:2018-04-19 20:58:12

标签: matlab tensorflow machine-learning keras

似乎Matlab Keras导入器允许我们使用Keras / Tensorflow训练的模型,我们可以在Matlab中使用它。在他们的所有文档中,他们使用了图像输入和CNN模型。我在keras中创建了一个简单的前馈ANN模型,输入不是图像。 Matlab Keras导入器是否仅适用于图像输入或CNN模型?虽然Matlab能够读取模型并给出激活函数,一些隐藏的层和其他东西准确,当我检查Keras和Matlab中的分类器输出时,他们的答案是不匹配的。有人可以澄清一下吗? 这是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中的答案不匹配。我犯过什么错误吗?

0 个答案:

没有答案