Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Correct transformation of second-order tensors in adapters #304

Open
han-ol opened this issue Feb 11, 2025 · 0 comments
Open

Correct transformation of second-order tensors in adapters #304

han-ol opened this issue Feb 11, 2025 · 0 comments

Comments

@han-ol
Copy link
Contributor

han-ol commented Feb 11, 2025

Currently, only first-order tensors, a.k.a. vectors can be transformed in both forward and inverse direction through an adapter object.

Can we transform also different orders, particularly second-order?

The question arises because a PointInferenceNetwork can estimate the covariance matrix of the inference_variables.
Some adapters represent a change of basis and origin, for example, standardize is a linear coordinate transformation from "original coordinates" to "standardized coordinates".
Thus, the inference_variables live in the standardized coordinates, and the covariance matrix needs to be adapted in inverse direction to relate to unstandardized coordinates.

When a covariance matrix is estimated in the standardized coordinates, the inverse of the coordinates transformation is different from naively transforming matrix columns as if they were vectors in standardized coordinates.
Rather, a covariance matrix $\Sigma^{-1}$ transforms as an order 2 tensor: the basis change matrix $A$ is multiplied from both sides $A^T \Sigma^{-1} A$.
For standardize, $A=diag(\sigma_i)$ with $\sigma_i$ the standard deviations for each dimension, so $A^T \Sigma^{-1} A = \Sigma^{-1} \cdot diag(\sigma_i^2)$.

Solutions to this issue are likely related to a separate issue on keeping track of jacobians of adapter transforms, as mentioned in #245.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant