Train and Simulate Newff

5 ビュー (過去 30 日間)
Muhammad Mubashar Qayyum
Muhammad Mubashar Qayyum 2015 年 8 月 22 日
回答済み: Greg Heath 2016 年 1 月 12 日
Dear,
Here below is a problem with requirements. I tried in same way as guided but unable to understand how to Train and then simulate using newff .
If any one please help/guide me in this regard.
Thanks
Question: Training a feedforward NN to learn the surface given by the expression:
z = cos (x) sin (y)
defined on the square−2≤x≤2,−2≤y≤2.
>>>>> You can generate and plot the above defined surface using the following Matlab commands:
x = -2:0.25:2; y = -2:0.25:2; z = cos(x)'*sin(y); mesh(x,y,z)
xlabel('x axis'); ylabel('y axis'); zlabel('z axis');
title('surface z = cos(x)sin(y)');
2.3. Now the tasks for this assignment:
(a) Design a two layer (one hidden and one output) feedforward network to learn target function.
(b) Try learning the function using different number of NN units in the hidden and output layers. E.g. 25 in the hidden and 15 in the output, and then repeat the experiment twice, with reduced and increased number of units in the two layers. For each of the three cases show (using plot) and comment on the performance of our NN by employing the function “sim” as in the tutorial part of this assignment.
(c) Show and comment on the system performance by repeating the above experiment (just once) using Levenberg-Marquardt and Gradient Descent learning schemes.

採用された回答

Greg Heath
Greg Heath 2016 年 1 月 12 日
It looks like this is a straightforward curve-fitting problem which will output z given the 2-D input [ x; y ]. With [-2:0.25:2] line grids of 17 points per line, N= 17^2 = 289 points.
[ 2 289 ] = size(input)
[ 1 289 ] = size(height)
Therefore use
FITNET (calls feeforwardnet) or the obsolete NEWFIT (calls NEWFF)
The single valued output z for the point (x,y) using FITNET is
z = net([x;y])
using NEWFIT it is probably
z = sim(net,[x;y])
Hope this helps.
Thank you for formally accepting my answer
Greg

その他の回答 (1 件)

Walter Roberson
Walter Roberson 2015 年 8 月 22 日
I see nothing in the question that requires you to use newff(), a routine that is so old that it has been removed from the MATLAB documentation. You are asked to create a Feed Forward Network, not to use newff().
There are several routines to create Feed Forward Networks now. The best one to use depends on what you need to do with the network. Your assignment does not specify what you need to do with the network, only that it has to "learn" the surface. Is the "learn"ing for the purpose of Classification? For the purpose of Prediction? You cannot measure the "system performance" unless you know what you are comparing against, which your assignment does not say.
  2 件のコメント
Muhammad Mubashar Qayyum
Muhammad Mubashar Qayyum 2015 年 8 月 23 日
Thanks for your response. I'm confused at the same point which you mentioned about "what need to do" that's why i shared for any anyone else view. Anyhow thanks once again. T.c
Walter Roberson
Walter Roberson 2015 年 8 月 24 日
It looks like sim() was used to get outputs for a given input. See http://www.mathworks.com/matlabcentral/answers/222457#answer_181929 for how to do that with a more modern Feed Forward Network

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeMatrix Indexing についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by