Clear Filters
Clear Filters

How to use trained ANN with new input datasets?

13 views (last 30 days)
Sunita
Sunita on 14 Dec 2023
Answered: atharva on 15 Dec 2023
How to use trained ANN with new input datasets?

Answers (1)

atharva
atharva on 15 Dec 2023
Hey Sunita,
I understand that you want to use trained ANN with new input datasets.
To use a trained Artificial Neural Network (ANN) with new input datasets, you can follow these steps:
  1. Load the trained ANN using the load function in MATLAB.
  2. Prepare your new input dataset in the same format as the training dataset.
  3. You can use the classify function in MATLAB to classify new input datasets using a trained ANN. The classify function is used to classify observations using a trained classifier, including ANNs.
Here's an example code snippet:
% Load the trained ANN
load('trained_ann.mat');
% Prepare new input dataset
new_inputs = [1 2 3; 4 5 6; 7 8 9];
% Classify the new input dataset using the trained ANN
labels = classify(net, new_inputs);
In this example, trained_ann.mat is the file containing the trained ANN, new_inputs is the new input dataset, and outputs is the output of the ANN for the new input dataset.
You can use the same trained ANN for different types of input datasets as long as the input datasets are in the same format as the training dataset. However, if the new input datasets are significantly different from the training dataset, the performance of the ANN may not be optimal.
For example, if you trained an ANN to recognize handwritten digits using grayscale images of size 28x28 pixels, you can use the same trained ANN to recognize handwritten digits from a different dataset of grayscale images of size 28x28 pixels.
However, if you want to use the same trained ANN to recognize handwritten digits from color images or images of a different size, you may need to retrain the ANN or modify the input layer of the ANN to accept the new input format.
You can go through the official Mathworks documentation for better understanding
I hope this helps!

Categories

Find more on Deep Learning Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!