tfep.nn.transformers.affine.volume_preserving_shift_transformer_inverse
- tfep.nn.transformers.affine.volume_preserving_shift_transformer_inverse(y, shift, periodic_indices=None, periodic_limits=None)[source]
Inverse function of
volume_preserving_shift_transformer.This provides a functional API to the
VolumePreservingShiftTransformerlayer. It implements the inverse of the transformation\(y_i = x_i + b_i\)
where \(b_i\) is the shift parameter of the transformation that are usually generated by a conditioner.
The function returns the transformed feature as a
Tensorof shape(batch_size, n_features)and the log absolute determinant of its Jacobian (always a zero vector) as aTensorof shape(batch_size,).- Parameters:
y (torch.Tensor) – Input tensor x of shape
(batch_size, n_features).shift (torch.Tensor) – The shift coefficients of shape
(batch_size, n_features)(i.e. thebcoefficients).periodic_indices (torch.Tensor, optional) – If provided, the features indexed by
periodic_indiceswill be treated as periodic with periodperiodic_limits.periodic_limits (torch.Tensor, optional) – The period of periodic features.
- Returns:
x (torch.Tensor) – Output tensor of shape
(batch_size, n_features).log_det_J (torch.Tensor) – The logarithm of the absolute value of the determinant of the Jacobian of the transformation (always zero) with shape
(batch_size,).