Commit 3124ec4b authored by Davis King's avatar Davis King

Made dropout layer initialize its random number generator from std::rand() rather than always

using the same seed.
parent da28fe3b
......@@ -927,7 +927,8 @@ namespace dlib
explicit dropout_(
float drop_rate_ = 0.5
) :
drop_rate(drop_rate_)
drop_rate(drop_rate_),
rnd(std::rand())
{
DLIB_CASSERT(0 <= drop_rate && drop_rate <= 1,"");
}
......@@ -936,7 +937,7 @@ namespace dlib
// is non-copyable.
dropout_(
const dropout_& item
) : drop_rate(item.drop_rate), mask(item.mask)
) : drop_rate(item.drop_rate), mask(item.mask), rnd(std::rand())
{}
dropout_& operator= (
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment