erikbern / deep-pink

Deep Pink is a chess AI that learns to play chess using deep learning.
http://erikbern.com/2014/11/29/deep-learning-for-chess/
813 stars 159 forks source link

Loss function seems incorrect?? #22

Closed otj202 closed 3 years ago

otj202 commented 3 years ago

Hello! I have been reading your article on this and implementing it myself to learn pytorch. However, I am a bit confused by your loss function. specifically, why do you include the term: -log(sigmoid(f(q)-f(r)) and not -log(sigmoid(f(r)-f(q))? Don't we want to reward f(r)>f(q) with low loss, and punish f(r)<f(q) with high loss, and not the other way around? Just looking for an explanation so I understand :)

erikbern commented 3 years ago

I don't know, it's a million years since I built this!