Skip to content

Commit

Permalink
Doc: Clarify Cholesky unflattening
Browse files Browse the repository at this point in the history
  • Loading branch information
gil2rok committed Aug 16, 2024
1 parent 5119889 commit 6b9c002
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions blackjax/vi/fullrank_vi.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,15 +145,15 @@ def sample_fn(rng_key: PRNGKey, state: FRVIState, num_samples: int):


def _unflatten_cholesky(chol_params):
"""Construct the Cholesky factor from a flattened vector of cholesky parameters.
"""Construct the Cholesky factor from a flattened vector of Cholesky parameters.
Transforms a flattened vector representation of a lower triangular matrix
into a full Cholesky factor. The input vector contains n = d(d+1)/2 elements
consisting of d diagonal elements followed by n - d off-diagonal elements in
consisting of d diagonal elements followed by n-d off-diagonal elements in
row-major order, where d is the dimension of the matrix.
The diagonal elements are passed through a softplus function to ensure (numerically
stable) positivity, crucial to maintain a valid covariance matrix parameterization.
stable) positivity, such that the resulting Cholesky factor is positive definite.
This parameterization allows for unconstrained optimization while ensuring the
resulting covariance matrix Sigma = CC^T is symmetric and positive definite.
Expand Down

0 comments on commit 6b9c002

Please sign in to comment.