class_docstr: An implementation of the Sylvester bijective transform of the Householder
  variety (Van den Berg Et Al., 2018),
  
      :math:`\mathbf{y} = \mathbf{x} + QR\tanh(SQ^T\mathbf{x}+\mathbf{b})`
  
  where :math:`\mathbf{x}` are the inputs, :math:`\mathbf{y}` are the outputs,
  :math:`R,S\sim D\times D` are upper triangular matrices for input dimension
  :math:`D`, :math:`Q\sim D\times D` is an orthogonal matrix, and
  :math:`\mathbf{b}\sim D` is learnable bias term.
  
  The Sylvester transform is a generalization of
  :class:`~pyro.distributions.transforms.Planar`. In the Householder type of the
  Sylvester transform, the orthogonality of :math:`Q` is enforced by representing
  it as the product of Householder transformations.
  
  Together with :class:`~pyro.distributions.TransformedDistribution` it provides a
  way to create richer variational approximations.
  
  Example usage:
  
  >>> base_dist = dist.Normal(torch.zeros(10), torch.ones(10))
  >>> transform = Sylvester(10, count_transforms=4)
  >>> pyro.module("my_transform", transform)  # doctest: +SKIP
  >>> flow_dist = dist.TransformedDistribution(base_dist, [transform])
  >>> flow_dist.sample()  # doctest: +SKIP
      tensor([-0.4071, -0.5030,  0.7924, -0.2366, -0.2387, -0.1417,  0.0868,
              0.1389, -0.4629,  0.0986])
  
  The inverse of this transform does not possess an analytical solution and is
  left unimplemented. However, the inverse is cached when the forward operation is
  called during sampling, and so samples drawn using the Sylvester transform can
  be scored.
  
  References:
  
  [1] Rianne van den Berg, Leonard Hasenclever, Jakub M. Tomczak, Max Welling.
  Sylvester Normalizing Flows for Variational Inference. UAI 2018.
class_docstr_tok: ["An","implementation","of","the","Sylvester","bijective","transform","of","the","Householder","variety","(","Van","den","Berg","Et","Al.",",","2018",")",",",":","math",":","`","\\mathbf","{","y","}","=","\\mathbf","{","x","}","+","QR\\tanh","(","SQ^T\\mathbf","{","x","}","+\\mathbf","{","b","}",")","`","where",":","math",":","`","\\mathbf","{","x","}","`","are","the","inputs",",",":","math",":","`","\\mathbf","{","y","}","`","are","the","outputs",",",":","math",":","`","R",",","S\\sim","D\\times","D","`","are","upper","triangular","matrices","for","input","dimension",":","math",":","`","D","`",",",":","math",":","`","Q\\sim","D\\times","D","`","is","an","orthogonal","matrix",",","and",":","math",":","`","\\mathbf","{","b","}","\\sim","D","`","is","learnable","bias","term",".","The","Sylvester","transform","is","a","generalization","of",":","class",":","`","~pyro.distributions.transforms.Planar","`",".","In","the","Householder","type","of","the","Sylvester","transform",",","the","orthogonality","of",":","math",":","`","Q","`","is","enforced","by","representing","it","as","the","product","of","Householder","transformations",".","Together","with",":","class",":","`","~pyro.distributions.TransformedDistribution","`","it","provides","a","way","to","create","richer","variational","approximations",".","Example","usage",":",">",">",">","base_dist","=","dist.Normal","(","torch.zeros","(","10",")",",","torch.ones","(","10",")",")",">",">",">","transform","=","Sylvester","(","10",",","count_transforms=4",")",">",">",">","pyro.module","(","``","my_transform","''",",","transform",")","#","doctest",":","+SKIP",">",">",">","flow_dist","=","dist.TransformedDistribution","(","base_dist",",","[","transform","]",")",">",">",">","flow_dist.sample","(",")","#","doctest",":","+SKIP","tensor","(","[","-0.4071",",","-0.5030",",","0.7924",",","-0.2366",",","-0.2387",",","-0.1417",",","0.0868",",","0.1389",",","-0.4629",",","0.0986","]",")","The","inverse","of","this","transform","does","not","possess","an","analytical","solution","and","is","left","unimplemented",".","However",",","the","inverse","is","cached","when","the","forward","operation","is","called","during","sampling",",","and","so","samples","drawn","using","the","Sylvester","transform","can","be","scored",".","References",":","[","1","]","Rianne","van","den","Berg",",","Leonard","Hasenclever",",","Jakub","M.","Tomczak",",","Max","Welling",".","Sylvester","Normalizing","Flows","for","Variational","Inference",".","UAI","2018","."]
docstr: Calculates the elementwise determinant of the log Jacobian
docstr_tok: ["Calculates","the","elementwise","determinant","of","the","log","Jacobian"]
code: def log_abs_det_jacobian(self, x, y):
      """
      Calculates the elementwise determinant of the log Jacobian
      """
      x_old, y_old = self._cached_x_y
      if x is not x_old or y is not y_old:
          # This call to the parent class Transform will update the cache
          # as well as calling self._call and recalculating y and log_detJ
          self(x)
  
      return self._cached_logDetJ
  
file_path: pyro/pyro/distributions/transforms/sylvester.py
imports: import torch
  import torch.nn
  from ..None import constraints
  from ..torch_transform import TransformModule
  from ..util import copy_docs_from
  from .householder import Householder
label_desc: Use image node_id 9 for calling the Sylvester obj's underlying member method code with example usage: obj.log_abs_det_jacobian(x, y) and returns: self