| ||||||||||||||||||||||||||||
|
Step 2: Training the Neural NetworkThe following command trains the neural network with your data.
where, x is the input data and y is the desired data. What do Input Data and Desired Data mean?
Let’s say you want the neural network to learn the sine function for values ranging from 0 to 10, then x would be x = 0 0.1000 0.2000 0.3000 0.4000 0.5000 ... 9.7000 9.8000 9.9000 10.0000 y would be the sine value of each element in x. y = 0 0.0998 0.1987 0.2955 0.3894 0.4794 0.5646 ... -0.2718 -0.3665 -0.4575 -0.5440 Cross validation can be performed without any additional effort by passing the cross validation data to the train function as well.
What is Cross Validation?
The learning curve and the output and desired plots can be seen with ease after training by setting their respective parameters to true.
>> mynet.learningCurve = true; >> mynet.outputAndDesired = true; >> mynet = nsTrain (mynet, inputData, desiredData);
|
|||||||||||||||||||||||||||
|