Skip to content

INN.Linear

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

CLASS INN.Linear(dim, eps=1e-8)

Invertible version of torch.nn.Linear. Using the PLU decomposition method. For the full space linear transformation, see INN.JacobianLinear.

  • dim : dimension of linear inputs. The outputs will have the same dimension as the input for invertibility.
  • eps: Additional term for avoiding log(0).

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