Thank you for this contribution, I was about to recode it when I found out that it was already done!
For users wanting to get uncertainty data for their models, I would recommend reading the work of Yarin Gal who published the dropout as a way to get uncertainty idea as a part of his PhD thesis.
He has a blog post with very nice animations and the proper equations to convert the variance you get when you run the model several time with the dropout activated into a proper uncertainty on the output.