Create Simple Deep Learning Network for Classification

1 回表示 (過去 30 日間)
HECTOR MORAN
HECTOR MORAN 2022 年 7 月 27 日
回答済み: Ayush 2023 年 9 月 4 日
Hello, I need to do the test of the trained neural network, someone has been able to load a number and that the neural network recognizes it.
https://la.mathworks.com/help/deeplearning/ug/create-simple-deep-learning-network-for-classification.html
Thank you

回答 (1 件)

Ayush
Ayush 2023 年 9 月 4 日
Hi Hector,
I understand that you want to test a trained neural network in MATLAB. To load a number and have the neural network recognize it.
Here are some general steps to test a trained neural network in MATLAB. Make sure to adjust them according to your specific neural network architecture and training setup.
1.Load the trained neural network model: First, you need to load the saved neural network model that you trained previously. You can use the “load” function in MATLAB to load the model.
load('trainedModel.mat');
2.Prepare the input data: Next, you need to prepare the input data for testing. If you have a number image that you want the neural network to recognize, you can read the image using the “imread” function and preprocess it as required. For example, you might need to resize the image to match the input size of the neural network and convert it to grayscale. Let's assume you have loaded the image as “inputImage”.
3.Feed the input data to the neural network: After preparing the input data, you can pass it to the neural network using the “sim” function. This function simulates the neural network and returns the output. Here's an example of how you can use it:
output = sim(net, inputImage);
Here, “net” is the loaded neural network model, and “inputImage” is the preprocessed input data.
4. Interpret the output: The output of the neural network will depend on the specific problem you trained it for. It could be a single value representing the recognized number or a probability distribution over different classes. You need to interpret the output based on your network's architecture and training. For example, if the network is trained for digit recognition, you can use the “max” function to find the index of the maximum output value, which corresponds to the recognized digit:
[~, recognizedDigit] = max(output);
Here, “recognizedDigit” will contain the recognized digit based on the neural network's output.
For more information on testing neural networks, you can refer to the documetation linked below:
Hope this helps!
Regards,
Ayush Goyal

カテゴリ

Help Center および File ExchangePattern Recognition and Classification についてさらに検索

製品


リリース

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by