フィルターのクリア

How to simulate trained networks?

5 ビュー (過去 30 日間)
Yanuar Rizki Pahlevi
Yanuar Rizki Pahlevi 2020 年 10 月 15 日
コメント済み: Yanuar Rizki Pahlevi 2020 年 11 月 11 日
Hi guys, I am trying to feed my trained networks with some data. I want to make a plot from its output
clear;
clc;
load network1
layers_encode(1)=network1.Layers(1);
layers_encode(2)=network1.Layers(2);
layers_encode(3)=network1.Layers(3);
layers_encode(4)=network1.Layers(4);
layers_encode(5)=network1.Layers(5);
layers_encode(6)=regressionLayer;
net_encode=assembleNetwork(layers_encode);
[xTrain, tTrain, xValid, tValid, xTest, tTest] = LoadMNIST(3);
xTrain= mat2gray(reshape(xTrain, [28*28 50000]));
inputs=xTrain(:,1:1000);
nInput=size(inputs,2);
[Y]=sim(net_encode, inputs);
scatterplot(Y) %i'd like to compare the input and the output with scatterplot
scatterplot(inputs)
but I cannot get the output.
i tried using [Y]=sim(net,x) but matlab gives 'model' parameter must be a character vector
y=net_code(inputs), matlab gives Array indices must be positive integers or logical values.
anybody knows what should I do?

回答 (1 件)

Shraddha Jain
Shraddha Jain 2020 年 11 月 11 日
Hi Yanuar,
I understand that you are facing issues while performing regression on input images using the method,
Y = sim(net_encode, inputs)
However, I am not able to reproduce the error at my end. For in-depth understanding of the issue, could you share the network1 or the details of it.
Meanwhile, you may try using the predict method available in Deep Learning Toolbox as,
Y = predict(net_encode, inputs)
This method predicts responses using a trained deep learning neural network on image data as well. Please refer to this documentation for more information on predict method.
  1 件のコメント
Yanuar Rizki Pahlevi
Yanuar Rizki Pahlevi 2020 年 11 月 11 日
in the end I did used predict and got the answer. thanks for looking at this question!

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeImage Data Workflows についてさらに検索

製品

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by