Fix README rand_sparse_tri QuickStart example (#92) - #93
Conversation
3daf005 to
68968df
Compare
|
Congrats on your first contribution! 🎉 The Maybe another small change - Three comments still say "unit triangular," but -# Create sparse lower triangular matrix (unit triangular, no diagonal)
+# Create sparse lower triangular matrix (strictly lower triangular, no diagonal) dist_ldlt = SparseMultivariateNormal(
loc=loc,
diagonal=diagonal,
- scale_tril=scale_tril # Unit lower triangular
+ scale_tril=scale_tril # Strictly lower triangular
) dist_precision = SparseMultivariateNormal(
loc=loc,
diagonal=precision_diagonal,
- precision_tril=precision_tril # Unit triangular precision factor
+ precision_tril=precision_tril # Strictly triangular precision factor
) |
|
After reviewing the code I updated any remaining comments that included "unit triangular" ensuring they align with the rest of the code and so that the comments are clear to read. |
|
@theo-barfoot LGTM |
theo-barfoot
left a comment
There was a problem hiding this comment.
Thanks for this, this looks good. The replacement of unit_triangular with strict correctly matches the current rand_sparse_tri API, and the values used for the LDLᵀ and LLᵀ examples are appropriate. Adding requires_grad_(True) also fixes the gradient section at the end of the example.
I found one small pre-existing terminology issue, that was my mistake, which it would be good to correct. In the updated sparsity comment: 5,000 nonzeros in a 1000 × 1000 matrix corresponds to 0.5% density, or 99.5% sparsity.
So I would change the comment to:
nnz=5000, # 5000 nonzeros per 1000x1000 matrix (99.5% sparsity)
Once that wording is corrected, this looks ready to merge.
|
I have now corrected the sparsity comment to state a 99.5% sparsity, to make the wording clear. |
|
Thanks for the review @theo-barfoot ! |
theo-barfoot
left a comment
There was a problem hiding this comment.
Looks good! Congrats on your first contribution 😃
Summary
unit_triangularparameter withstrictin the README Quickstart examples to align with the currentrand_sparse_tri()API.event_size=1000.Testing
strictkeyword.