understanding the newff and train functions

122 ビュー (過去 30 日間)
Viraj
Viraj 2014 年 5 月 23 日
コメント済み: idris 2024 年 4 月 17 日 7:19
I have been given a project to predict future exchange rates between two currencies based on exchange rates in the past. I need to create a neural network to accept 10 values and to give a one single value as the output. (10 past exchange rates as inputs and output is the predicted exchange rate.) P = [0 1 2 3 4 5 6 7 8 9 10]; T = [0 1 2 3 4 3 2 1 2 3 4]; I learnt that in a this kind of situation, there are only one input node and one output node. first value of the T vector is the output when the first value of the P vector is given as the input. I need to give 10 input values to the first layer of the network. How to use newff function here. I am only looking for newff function since I have been advised to use only newff. I hope someone will help me to overcome my issue. Thanks!
  2 件のコメント
Jo Men
Jo Men 2017 年 9 月 15 日
feedforwardnet
idris
idris 2024 年 4 月 17 日 7:19
@Viraj, having read your question, check out the link below
https://www.mathworks.com/matlabcentral/answers/77741-newff-create-a-feed-forward-backpropagation-network-obsoleted-in-r2010b-nnet-7-0

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

採用された回答

Greg Heath
Greg Heath 2014 年 5 月 24 日
NEWFF has been obsolete for 4 years. The current function to use for regression/curve-fitting is FITNET.
You only have 11 points resulting in 11 equations. By closing your eyes and imagining the plot of T vs P, you will "see" a 3rd order polynomial-type curve with an internal local maximum and an endpoint maximum. This should be able to be modeled with H = 2 hidden nodes and Nw = (1+1)*H+(H+1)*1 = 7 weights/biases.
This is straight forward. See the examples in
help/doc newff
or, if you want to use the current function model
help/doc fitnet.
To mitigate the possibility of an unfortunate assignment of initial random weights, design 10 or more nets.
Hope this helps.
Thank you for formally accepting my answer
Greg
  3 件のコメント
Greg Heath
Greg Heath 2014 年 5 月 26 日
MATLAB is a vector/matrix based language. The code tends to be relatively independent of the actual dimensions of inputs and outputs. For examples search the NEWSGROUP and ANSWERS with
greg newff
greg fitnet
waqar ali
waqar ali 2017 年 2 月 1 日
hello MyNetwork = newff(pn,tn, [i] , {tf}, 'trainlm');
i am trying to use newff function ,but i received this error , i am using matlab 2013 , any can tell me the reason of this error "Error using newff>new_5p1 (line 172) Layer sizes is not a row vector of positive integers.
Error in newff>create_network (line 130) net = new_5p1(varargin{:});
Error in newff (line 102) out1 = create_network(varargin{:});

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

その他の回答 (3 件)

ilhem ouerghui
ilhem ouerghui 2016 年 11 月 10 日
編集済み: Walter Roberson 2016 年 11 月 10 日
Iam using Matlab 2016, I tried to use the function:
net_RN=newff(minmax(app2),[nbre_caract,Nero_cache,1]);
with:
nbre_caract=size(app2) && Nero_cache = 3
but i get this error:
Warning: NEWFF used in an obsolete way.
and from the help: The recommended function is feedforwardnet
how can I use this function please?
  3 件のコメント
ilhem ouerghui
ilhem ouerghui 2016 年 11 月 11 日
ok thanks for your answer
Steven Lord
Steven Lord 2016 年 11 月 11 日
You can ignore it, but I recommend reading the documentation for feedforwardnet and using that function as its documentation describes instead.

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


abdelhafid benchikh
abdelhafid benchikh 2016 年 12 月 2 日
Hi everyone I want to understand how the newff function work I means how can I use it and thanks
  1 件のコメント
Walter Roberson
Walter Roberson 2016 年 12 月 2 日
You can go back to the last time it was documented, http://www.mathworks.com/help/releases/R2010a/toolbox/nnet/newff.html in R2010a.
If you are using a release newer than R2010a, then don't use newff(), use feedforwardnet() instead.

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


FuWei Shen
FuWei Shen 2022 年 9 月 29 日
great, it is useful.

カテゴリ

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