How to get the same output for the same test example provided to the neural network as explained below?

Hi everyone,
I'm building a property-rental prediction model using 2-layer BackPropagation neural network. Everything went well. But the net produces different output every time I apply it to the same test example. I'd like to know how can I get consistent results when applying the network on the same test data (using sim function)? I know that it has something to do with the network weights being randomly initialized. However, there must be a way to either initialize the weights to some values or maybe to use another strategy.
Thank you!
Iulia

 Respuesta aceptada

Intialize the random number generator to a specified state before the weights are initialized. For example, rng(0) or rng(1492)
Hope this helps.
Thank you for formally accepting my answer
Greg
P.S. Search rng(0) greg

1 comentario

Thanks Greg. Yes it worked just by adding rand('state',0) But I still wonder if this way is the best. I mean, does the random initialization of weights has better effect on training than static initialization?
Thanks!

Iniciar sesión para comentar.

Más respuestas (0)

Categorías

Más información sobre Deep Learning Toolbox en Centro de ayuda y File Exchange.

Preguntada:

el 28 de Jul. de 2013

Community Treasure Hunt

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

Start Hunting!

Translated by