How to write an input and output vectors

2 ビュー (過去 30 日間)
Carlos
Carlos 2011 年 9 月 8 日
回答済み: Walter Roberson 2018 年 4 月 20 日
Hi all. I am using nntool to train a network. I need an input and a target in order to train the network. Assume that I have 5 projects. Each project has 3 inputs and one output. For example, project1={x1,x2,x3;y1}. project2={x4,x5,x6;y2}. project3={x7,x8,x9; y3}. project4={x10,x11,x12; y4}. project5={x13,x14,x15; y5} (x is the input and y is the output) my question is, how to write an input vector and an output (target) vector for the 4 projects? Thank you

回答 (2 件)

Veera Kanmani
Veera Kanmani 2018 年 4 月 20 日
https://nl.mathworks.com/matlabcentral/answers/uploaded_files/25103/NN-examples.pdf

Walter Roberson
Walter Roberson 2018 年 4 月 20 日
The majority of MATLAB routines that take samples and classes expect the samples to go across rows, each column representing a different feature. However, some of the Neural Network functions expect the rows to be the individual features with the columns corresponding to the different samples. This is just the transpose of the other arrangement.
I would tend to suggest storing in the first (more used) data arrangement, and transpose when passing into a function that expects the other way. This is a matter of taste - but be consistent. You will find your programs difficult to read if you use both arrangements, unless perhaps you use a naming convention that makes it clear which variables are which.

Community Treasure Hunt

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

Start Hunting!

Translated by