Closed SkeletonOne closed 5 years ago
After training 250 iterations, I meet a problem of RuntimeWarning: divide by zero encountered in log
unary = -np.log(feat)
after that, constrain_loss=0.000000, how could I colve this problem?
In general, you can add a small positive number to pretend the feat from zero. That's says unary = -np.log(feat+1e-5) may helps.
unary = -np.log(feat+1e-5)
Yeah that's a great idea to solve my problem. thx a lot! :)
After training 250 iterations, I meet a problem of RuntimeWarning: divide by zero encountered in log
after that, constrain_loss=0.000000, how could I colve this problem?