tensorflow / tensorflow/probability
bfgs fails with batched initial inverse Hessians
Nobody has claimed this yet.
- Dominant language
- Jupyter Notebook
- Stars
- 4.4k
- Forks
- 1.1k
- PR merge metrics
- No merged PRs in 30d
Description
When using the bfgs optimizer in batch mode, there is a bug when providing batched initial inverse hessians. This is useful to continue an incomplete batched optimization.
I tracked the bug to the _inv_hessian_control_inputs function in bfgs.py. The two calls to tf.Assert have boolean tensors instead of scalars as their first arguments. tf.Assert can only take a single boolean scalar.
This can be easily fixed with tf.reduce_all wrapping the tensors is_positive_definite and is_symmetric.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in bfgs.py at the _inv_hessian_control_inputs function and inspect the two tf.Assert calls for batched initial inverse Hessians. Verify that batched positive-definiteness and symmetry checks are accepted, then run the relevant BFGS test suite to confirm the optimizer can continue batched optimization without assertion errors.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, tensorflow
- Domain
- machine-learning
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100