Skip to content

INN.JacobianLinear

Zhang Yanbo edited this page Oct 27, 2022 · 1 revision

CLASS INN.JacobianLinear(dim_in, dim_out=None, bias=True)

Invertible (or Jacobian-available) version of torch.nn.Linear. This layer computes log-Jacobian determinate directly from the matrix, which can be computationally intensive if the input dimension is too high. So, when dim_in is very high, you can use INN.Linear to reduce computation cost, while also losing some representation power.

  • dim_in : dimension of linear inputs. The outputs will have the same dimension if dim_out=None;
  • dim_out: the dimension of output. If dim_out != dim_in, the invertibility will lost. When dim_out=None, it will be treated as dim_out=dim_in;
  • bias: Using bias if bias=True;

Methods

forward(x, log_p0=0, log_det_J=0)

Compute the forward pass. The output will be the transformed x. If compute_p=True, logp and logdet will also returned.

inverse(y, **args)

Compute the inverse of y. The **args is a placeholder for consistent format.

Clone this wiki locally