pysdic.ComposedParametrization._decode#
- ComposedParametrization._decode(p_o, *, dp=False, kwargs=None)[source]#
Decode the encoded parameters through the sequence of parametrizations in reverse.
\[\vec{p_i} = P_1^{-1}(P_2^{-1}(...P_n^{-1}(\vec{p_o})...))\]The jacobian with respect to the encoded parameters is computed using the chain rule across the sequence of parametrizations in reverse:
\[\mathbf{J}_p = \frac{\partial P_1^{-1}}{\partial \vec{r}_1} \cdot ... \cdot \frac{\partial P_{n-1}^{-1}}{\partial \vec{r}_{n-1}} \cdot \frac{\partial P_n^{-1}}{\partial \vec{p_o}}\]where \(\vec{r}_k = P_{k+1}^{-1}(...P_n^{-1}(\vec{p_o})...)\) are the intermediate parameters.
- Parameters:
p_o (numpy.ndarray) – The encoded parameters to decode, with shape \((n_o,)\) where \(n_o\) is the output dimension of the last parametrization in the composition.
dp (bool, optional (default:
False)) – If True, compute the Jacobian with respect to the parameters during decoding. (ie., \(\mathbf{J}_p = \frac{\partial P_1^{-1} \circ ... \circ P_n^{-1}}{\partial \vec{p_o}}\)).kwargs (Optional[List[Optional[Dict[str, Any]]]], optional (default:
None)) – A list of dictionaries containing additional keyword arguments to pass to each parametrization’s decode method. The list must have the same length as the number of parametrizations in the composition, in the order \([P_1, P_2, ..., P_n]\) (the same order as for encoding, even if the decoding is applied in reverse).Noneelements are replaced by empty dictionaries.
- Returns:
numpy.ndarray – The decoded parameters after applying the sequence of decoding maps, with shape \((n_i,)\) where \(n_i\) is the input dimension of the first parametrization in the composition.
Optional[numpy.ndarray] – The Jacobian matrix with respect to the parameters if
dp=True, with shape \((n_i, n_o)\), or None ifdp=False.
- Return type: