-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid NeuralLinearBandit failure if zero-weight batch
Summary: This diff addresses an issue with the NeuralLinearBandit policy learner in Pearl. The issue is that the policy learner can fail if the batch weight sums to zero. (For the specific div0 see [link](https://www.internalfb.com/code/fbsource/[266f3e6083d66d91a742991b0bfceadc148082a6]/fbcode/pearl/policy_learners/contextual_bandits/neural_linear_bandit.py?lines=184)) To circumvent this issue, I've modified the NeuralLinearBandit policy learner to avoid the optimization path altogether in this case. While in principle one might hope that zero-weight batches are never provided to the bandit, it is a relatively common problem encountered with small batches + DisjointBanditContainer, at least for this current production model -> https://www.internalfb.com/mlhub/pipelines/runs/fblearner/556370776 The result is a training flow that regularly borks out for hyperparameter tuning. The resulting NaNs actually error in the `pinv` (svd) method within the LinearUCB component of `NeuralLinearBandit` ("the input matrix contained non-finite values"). It would be helpful if the error is thrown immediately, but because they are not, the error has taken more time to debug. Reviewed By: alexnikulkov Differential Revision: D65428925 fbshipit-source-id: 61e77345293508b4732e34d33ab6989097d00538
- Loading branch information
1 parent
ececba7
commit f01b97e
Showing
2 changed files
with
58 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters