Borrar filtros
Borrar filtros

How I can use rand('seed', ??) for neural network model?

6 visualizaciones (últimos 30 días)
Surae
Surae el 29 de Jul. de 2011
Respondida: Greg Heath el 3 de Feb. de 2018
Hi,
I'm using 'newfftd' which is neural network time delayed model, and I have no idea how I can use rand('seed', ??) for the neural network model? Here is my partial codes of rand('seed').
numDelays = 3;
rand('seed',1);
net = newfftd(P,T,0:numDelays,[20 8],{'logsig' 'logsig' 'purelin'}, 'traincgb', 'learngdm', 'msereg');
net = init(net)
However, I have no idea what the number of '1' means and how it can be scalable?
I found that I got different forecast performance when I changed the number by increasing 1 to 10.
Do I need to find the number while increase until I get a good forecasted result?
Thanks a lot for your reply in advance.

Respuestas (3)

Fangjun Jiang
Fangjun Jiang el 29 de Jul. de 2011
Every time you use rand(), it gives you a random number, that is what rand() is for. But what if you want to repeat that random number, for the purpose of duplicate your simulation results? That is when rand('seed',n) is useful. It gives you a way to generate rand numbers but repeatable. Try the following to see those rand numbers be repeated, also type "doc rand" for more info. rand('seed',n) where n is used to identify or specify a particular series.
clear all;
rand(1,3)
rand('seed',1);rand(1,3)
rand(1,3)
rand('seed',1);rand(1,3)
  1 comentario
Salma Hassan
Salma Hassan el 2 de Feb. de 2018
what is the different between using n=1 or n=0 , and what about this https://www.mathworks.com/matlabcentral/answers/72733-random-numbers-seed-setting#answer_82791
a=rng;
out=randn
rng(a)
out=randn

Iniciar sesión para comentar.


Daniel Shub
Daniel Shub el 29 de Jul. de 2011

Greg Heath
Greg Heath el 3 de Feb. de 2018
Read the documentation in
help rand
and
doc rand
Hope this helps.
Thank you for formally accepting my answer
Greg

Etiquetas

Community Treasure Hunt

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

Start Hunting!

Translated by