ChessUSA.com TalkChess.com
Hosted by Your Move Chess & Games
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

tuning for the uninformed
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions Flat
View previous topic :: View next topic  
Author Message
Álvaro Begué



Joined: 09 Mar 2010
Posts: 765
Location: New York

PostPost subject: Re: tuning for the uninformed - Poisson?    Posted: Sun Dec 03, 2017 1:03 pm Reply to topic Reply with quote

ZirconiumX wrote:
jdart wrote:
It is has occurred me that the correct model here might be Poisson regression (https://en.wikipedia.org/wiki/Poisson_regression). If we ran for each position a match of n games, and if the probability of a win is some value p, then the distribution of game results (x2) would be integers that could be modeled as a Poisson distribution and the parameters could be tuned using that method to model the outcomes. I don't know if this is completely valid but it seems plausible. Texel tuning as initially described is the special case of n=1.

--Jon


This is only mildly related to the topic, but Jon, I think you said that Arasan used a closed-form equation for the derivatives of your eval. Would you mind going over how you calculated those? It confuses me a lot.

For example, even if I take a stupid material only tapered eval with mean-squared error, I get this:

Code:

Let count_p_w, count_n_w etc be the count of pawns, knights etc for white.
Let count_p_b, count_n_b etc be the count of pawns, knights etc for black.
Let phase_p, phase_n etc be the phase weight of pawns, knights, etc for tapered eval.
Let value_p_o, value_n_o etc be the material value of pawns, knights, etc in the opening.
Let value_p_e, value_n_e etc be the material value of pawns, knights, etc in the endgame

value_o = (count_p_w - count_p_b) * value_p_o + (count_n_w - count_n_b) * value_n_o + ...
value_e = (count_p_w - count_p_b) * value_p_e + (count_n_w - count_n_b) * value_n_e + ...
total_phase = 16 * phase_p + 4 * phase_n + ...
phase = (count_p_w + count_p_b) * phase_p + (count_n_w + count_n_b) * phase_n + ...
value = ((phase * value_o) + ((total_phase - phase) * value_e)) / total_phase
sigmoid = 1 / (1 + 10 ** (-K*value))
error = (result - sigmoid) * (result - sigmoid)


And I have no idea how to then differentiate that, because that's a lot of variables.


I'll give you the beginning of an explanation here. If you want to see the whole derivation, look up "backpropagation".

I am going to compute the partial derivative of `error' with respect to each quantity in your formulas, `d_error/d_quantity'. We'll go from the end of the computation.

d_error/d_error = 1

Then we see this:
error = (result - sigmoid)^2

Take the derivative of both sides with respect to `sigmoid' and you get

d_error/d_sigmoid = 2 * (result - sigmoid)

The next one is:
sigmoid = 1 / (1 + 10^(-K*value))

I am interested in computing `d_error/d_value', which by the chain rule is

d_error/d_value = d_error/d_sigmoid * d_sigmoid/d_value

We have already computed `d_error/d_sigmoid' before, and `d_sigmoid/d_value' can be obtained by differentiating `sigmoid = 1 / (1 + 10^(-K*value))' with respect to d_value:

d_sigmoid/d_value = (K * log(10) * 10^(K * value))/(10^(K * value) + 1)^2

If you understand how this last step works, you can keep going back and compute the derivative of the error with respect to everything, in particular with respect to your evaluation parameters.
Back to top
View user's profile Send private message
Display posts from previous:   
Subject Author Date/Time
tuning for the uninformed Folkert van Heusden Thu Nov 23, 2017 10:37 am
      Re: tuning for the uninformed Henk van den Belt Thu Nov 23, 2017 11:49 am
      Re: tuning for the uninformed Mehdi Amini Thu Nov 23, 2017 11:49 am
            Re: tuning for the uninformed Henk van den Belt Thu Nov 23, 2017 11:53 am
                  Re: tuning for the uninformed Folkert van Heusden Thu Nov 23, 2017 12:26 pm
                        Re: tuning for the uninformed Henk van den Belt Thu Nov 23, 2017 12:44 pm
      Re: tuning for the uninformed Alexandru Mosoi Thu Nov 23, 2017 2:07 pm
            Re: tuning for the uninformed Folkert van Heusden Thu Nov 23, 2017 2:16 pm
                  Re: tuning for the uninformed Folkert van Heusden Thu Nov 23, 2017 5:34 pm
                        Re: tuning for the uninformed Sander Maassen vd Brink Thu Nov 23, 2017 6:47 pm
                              Re: tuning for the uninformed Henk van den Belt Thu Nov 23, 2017 7:21 pm
                                    Re: tuning for the uninformed Sander Maassen vd Brink Thu Nov 23, 2017 7:26 pm
                                          Re: tuning for the uninformed Henk van den Belt Thu Nov 23, 2017 7:36 pm
                                                Re: tuning for the uninformed Sander Maassen vd Brink Thu Nov 23, 2017 7:43 pm
                                          Re: tuning for the uninformed Martin Fierz Tue Dec 12, 2017 9:17 pm
                                                Re: tuning for the uninformed Álvaro Begué Tue Dec 12, 2017 10:47 pm
                              Re: tuning for the uninformed Folkert van Heusden Fri Nov 24, 2017 9:15 am
                                    Re: tuning for the uninformed Sander Maassen vd Brink Fri Nov 24, 2017 9:30 am
                              Re: tuning for the uninformed Robin Messemer Fri Nov 24, 2017 11:04 pm
                                    Re: tuning for the uninformed Henk van den Belt Sat Nov 25, 2017 11:30 am
                                          Re: tuning for the uninformed Robin Messemer Sat Nov 25, 2017 1:58 pm
                                                Re: tuning for the uninformed Henk van den Belt Sat Nov 25, 2017 2:48 pm
                                                      Re: tuning for the uninformed Robert Pope Mon Nov 27, 2017 5:38 pm
                                                            Re: tuning for the uninformed Álvaro Begué Mon Nov 27, 2017 5:52 pm
                                                                  Re: tuning for the uninformed Alexandru Mosoi Mon Nov 27, 2017 9:56 pm
                                                                        Re: tuning for the uninformed Robert Pope Tue Nov 28, 2017 4:41 pm
                                                                              Re: tuning for the uninformed Robin Messemer Tue Nov 28, 2017 7:23 pm
                                                                                    Re: tuning for the uninformed Álvaro Begué Tue Nov 28, 2017 7:37 pm
                                                                                          Re: tuning for the uninformed Jon Dart Thu Dec 14, 2017 3:09 pm
                                                                                          Re: tuning for the uninformed Álvaro Begué Thu Dec 14, 2017 3:15 pm
                                                            Re: tuning for the uninformed Jon Dart Sat Dec 02, 2017 3:02 pm
                                          Re: tuning for the uninformed Jon Dart Sat Dec 02, 2017 2:58 pm
                                    Re: tuning for the uninformed Erin Dame Sat Dec 02, 2017 10:50 am
                        Re: tuning for the uninformed Jon Dart Sat Dec 02, 2017 2:54 pm
                              Re: tuning for the uninformed Erin Dame Sat Dec 02, 2017 5:14 pm
                                    Re: tuning for the uninformed Jon Dart Sat Dec 02, 2017 5:56 pm
                                          Re: tuning for the uninformed - Poisson? Jon Dart Sat Dec 02, 2017 8:09 pm
                                                Re: tuning for the uninformed - Poisson? Matthew R. Brades Sun Dec 03, 2017 10:09 am
                                                      Re: tuning for the uninformed - Poisson? Álvaro Begué Sun Dec 03, 2017 1:03 pm
                                                      Re: derivatives, scaling Jon Dart Sun Dec 03, 2017 3:47 pm
Post new topic    TalkChess.com Forum Index -> Computer Chess Club: Programming and Technical Discussions

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum




Powered by phpBB © 2001, 2005 phpBB Group
Enhanced with Moby Threads