reproducibility with dropout

39 views
Skip to first unread message

arakoto

unread,
Nov 23, 2015, 5:14:06 PM11/23/15
to torch7
Hi all,

I am training a CNN model with a dropout and I would like the model I obtain to be reproducible (when rerunning the code).
I have seeded the random generator manually at the beginning of the code  

 torch.manualSeed(1)

just after importing torch but I still do not get reproducible results.

can someone tell me if  there is something else I need to do for this purpose?

thanks a lot in advance

A.

Vislab

unread,
Nov 23, 2015, 5:30:27 PM11/23/15
to torch7
use mode:evaluate() to disable the dropouts and you will get what you are looking for when evaluating your model

Francisco Vitor Suzano Massa

unread,
Nov 24, 2015, 4:52:30 AM11/24/15
to torch7
If you are using cuda, you also need to set
cutorch.manualSeed

arakoto

unread,
Nov 24, 2015, 4:55:17 PM11/24/15
to torch7
Thanks a lot for all your answers.  
seeding cutorch seems to work ok.

A. 
Reply all
Reply to author
Forward
0 new messages