RL Model- extremely slow gradient evalution

Hm, I definitely don’t have any expertise in this realm specifically, so while I’ve looked at the code, it’s not immediately obvious to me what’s going on. So I’ll simply interject my standard recommendation to look for redundancy in the data input to the model (esp. design matrices), which usually means that there are redundant computations being done that can be avoided by identifying unique entries and indexing as shown here. Since it’s a binomial outcome, you should look at whether there’s any chunks of data for which you can predict that deltaV is constant (you don’t need to know what the constant value actually will be, just that it will be the same value for all the elements in the chunk), in which case you can speed things up substantially by using sufficient statistics.

2 Likes