core.Joint
core.Joint(op, sizes=static())One operator across all blocks, on vectors keyed by block name.
A vector’s blocks are concatenated in sizes order (leading batch axes kept), passed to op, and split back.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| op | Op | The operator on the concatenated vector. | required |
| sizes | tuple[tuple[str, int], …] | Each block’s name and flat size, in concatenation order. | static() |
Methods
| Name | Description |
|---|---|
| add_diagonal | op.add_diagonal with the concatenated d. |
| add_isotropic | op.add_isotropic(precision). |
| add_per_block | Add precision[k] to block k: a scalar to every diagonal entry, or a vector. |
| add_same | op.add_same(other.op). |
| block_sizes | sizes as a mapping. |
| cov_sqrt_mv | op.cov_sqrt_mv on the concatenated v, split back into blocks. |
| diagonal | op.diagonal(), split into blocks. |
| inverse_diagonal | op.inverse_diagonal(), split into blocks. |
| logdet | op.logdet(). |
| mv | op.mv on the concatenated v, split back into blocks. |
| scaled | op.scaled(s). |
| solve | op.solve on the concatenated v, split back into blocks. |
add_diagonal
core.Joint.add_diagonal(d, /)op.add_diagonal with the concatenated d.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| d | Mapping[str, Tensor] | The diagonal \(d\), shaped like a vector of the operator. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Self | An operator of the same type. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | d is not a mapping, its keys differ from the blocks, a block’s last axis is not its size, or op can’t hold a diagonal. |
add_isotropic
core.Joint.add_isotropic(precision, /)op.add_isotropic(precision).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| precision | Tensor | The precision \(\lambda\), a 0-dim tensor. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Self | An operator of the same type. |
add_per_block
core.Joint.add_per_block(precision, /)Add precision[k] to block k: a scalar to every diagonal entry, or a vector.
A 0-dim precision[k] is expanded to the block’s size, and the whole goes through add_diagonal.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| precision | Mapping[str, Tensor] | A mapping from block name to a 0-dim tensor or a vector [P_k], with the operator’s block names. |
required |
Returns
| Name | Type | Description |
|---|---|---|
| Self | An operator of the same type. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | precision is not a mapping, its keys differ from the blocks, a vector’s last axis is not its block’s size, or op can’t hold a diagonal. |
add_same
core.Joint.add_same(other, /)op.add_same(other.op).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| other | Operator[Mapping[str, Tensor]] | The operator \(P'\). | required |
Returns
| Name | Type | Description |
|---|---|---|
| Self | An operator of the same type. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | other is not a Joint, its sizes differ, or op.add_same raises it. |
block_sizes
core.Joint.block_sizes()sizes as a mapping.
Returns
| Name | Type | Description |
|---|---|---|
| Mapping[str, int] | A mapping from block name to flat size, in block order. |
cov_sqrt_mv
core.Joint.cov_sqrt_mv(v, /)op.cov_sqrt_mv on the concatenated v, split back into blocks.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| v | Mapping[str, Tensor] | A mapping of vectors [..., P_k], keyed by block name. |
required |
Returns
| Name | Type | Description |
|---|---|---|
| Mapping[str, Tensor] | \(L v\), shaped like v. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | v is not a mapping, its keys differ from the blocks, or a block’s last axis is not its size. op may raise it too (such as a Dense that is not positive definite). |
diagonal
core.Joint.diagonal()op.diagonal(), split into blocks.
Returns
| Name | Type | Description |
|---|---|---|
| Mapping[str, Tensor] | A mapping of vectors [P_k], keyed by block name. |
inverse_diagonal
core.Joint.inverse_diagonal()op.inverse_diagonal(), split into blocks.
Returns
| Name | Type | Description |
|---|---|---|
| Mapping[str, Tensor] | A mapping of vectors [P_k], keyed by block name. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | op raises it (such as a Dense that is not positive definite). |
logdet
core.Joint.logdet()op.logdet().
Returns
| Name | Type | Description |
|---|---|---|
| Tensor | A 0-dim tensor. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | op raises it (such as a Dense that is not positive definite). |
mv
core.Joint.mv(v, /)op.mv on the concatenated v, split back into blocks.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| v | Mapping[str, Tensor] | A mapping of vectors [..., P_k], keyed by block name. |
required |
Returns
| Name | Type | Description |
|---|---|---|
| Mapping[str, Tensor] | \(P v\), shaped like v. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | v is not a mapping, its keys differ from the blocks, or a block’s last axis is not its size. |
scaled
core.Joint.scaled(s, /)op.scaled(s).
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| s | Tensor | A 0-dim factor. | required |
Returns
| Name | Type | Description |
|---|---|---|
| Self | An operator of the same type. |
solve
core.Joint.solve(v, /)op.solve on the concatenated v, split back into blocks.
Parameters
| Name | Type | Description | Default |
|---|---|---|---|
| v | Mapping[str, Tensor] | A mapping of vectors [..., P_k], keyed by block name. |
required |
Returns
| Name | Type | Description |
|---|---|---|
| Mapping[str, Tensor] | \(P^{-1} v\), shaped like v. |
Raises
| Name | Type | Description |
|---|---|---|
| StructureError | v is not a mapping, its keys differ from the blocks, or a block’s last axis is not its size. op may raise it too (such as a Dense that is not positive definite). |