Filter löschen
Filter löschen

How do I prepare input matrix & target matrix for Neural Networks?

2 Ansichten (letzte 30 Tage)
I’m developing an offline OCR system for Devanagari Characters for 20 alphabets. There are 100 samples per alphabet (i.e. 2000 samples). I’ve extracted 4 features per sample. For training a Neural Network, how do I prepare input matrix and target matrix? Is a 4x2000 matrix (4 is no of features & 2000 is total no of samples collected), a correct way of preparing input matrix? Should the samples in input matrix be sequential or random? Also, considering 20 alphabets, should there be 20 classes? How should my target matrix look like? Should it be 20x2000?

Akzeptierte Antwort

Greg Heath
Greg Heath am 12 Feb. 2013
>Is a 4x2000 matrix (4 is no of features & 2000 is total no of samples collected), a correct way of preparing input matrix?
Yes
>Should the samples in input matrix be sequential or random?
With default batch training (e.g.,trainlm or trainscg) it doesn't make any difference.
However, with sequential training (e.g., adapt) randomize.
>Also, considering 20 alphabets, should there be 20 classes?
Yes
> How should my target matrix look like? Should it be 20x2000?
Yes. Each column should be a column from the 20-dimensional unit matrix eye(20).
Use ind2vec to create the target matrix t from the true integer class indices.
Use vec2ind to obtain predicted class indices from the output y.
Nerr = sum(predclassind ~ trueclassind)
Hope this helps.
Thank you for formally accepting m answer!
Greg

Weitere Antworten (1)

Sugumar
Sugumar am 27 Feb. 2013
its any rules to create a neural network depending upon inputs

Community Treasure Hunt

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

Start Hunting!

Translated by