How to write an input and output vectors

조회 수: 4 (최근 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