I am getting different accuracy after each run in DNN.

Hello there
I am using a simple DNN architecture , with 24 layers in total, containing CNN and classification layer only. for 10 epochs I am getting a diffrent accuracy every time is it possible. Also the traing graph is not settled till end of training, I tried for 50 epochs too.
any help?

8 Kommentare

I think it likely that there is random initialization going on.
Try using rng() with a fixed seed, such as
rng(655321)
just before each training session, to see whether you get the same result each time.
No sir Its not working.
Sorry I am not sure I get it. Its a simple DNN with only few layers. I m not designing for any complicated network. I have used this rng() before trainNetwork, and ran my model 3 times every time i got different accuracy. How to specify thses hidden nodes?? I m black here.
all m getting is i need the weights for which the accuracy is max, but still ii cant initialize them as i want. so whats gain in that too.
Can you attach your code and data? You can zip it all up and attach the zip.
krishna Chauhan
krishna Chauhan am 26 Jun. 2020
Bearbeitet: krishna Chauhan am 26 Jun. 2020
okay sir I will try. Meanwhile is there any way to run the code over google colab or some other plateform as I get an optimum answer that if I go for say 1000 epochs may be the result will be stable. Currently i was exceuting the code for 10epochs only.
I cant attach the whole data its above 5MB. The example I followed was this
second part using CNN.
Sir kindly find the attachement.I have not included the data folder.

Melden Sie sich an, um zu kommentieren.

Antworten (1)

Aditya Patil
Aditya Patil am 19 Aug. 2020

0 Stimmen

Set a random seed using the rng function. Otherwise, during each run, a different random seed might be selected, resulting in different results.

1 Kommentar

I did that too before trainNetwork()
But still the problem is same

Melden Sie sich an, um zu kommentieren.

Kategorien

Mehr zu Deep Learning Toolbox finden Sie in Hilfe-Center und File Exchange

Gefragt:

am 25 Jun. 2020

Kommentiert:

am 25 Aug. 2020

Community Treasure Hunt

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

Start Hunting!

Translated by