How do I prepare input matrix & target matrix for Neural Networks?
1 次查看(过去 30 天)
显示 更早的评论
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?
0 个评论
采纳的回答
Greg Heath
2013-2-12
>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
更多回答(1 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Deep Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!