-
Notifications
You must be signed in to change notification settings - Fork 9
INN.JacobianLinear
Zhang Yanbo edited this page Oct 27, 2022
·
1 revision
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 ifdim_out=None
; -
dim_out
: the dimension of output. Ifdim_out != dim_in
, the invertibility will lost. Whendim_out=None
, it will be treated asdim_out=dim_in
; -
bias
: Using bias ifbias=True
;
Compute the forward pass. The output will be the transformed x
. If compute_p=True
, logp
and logdet
will also returned.
Compute the inverse of y
. The **args
is a placeholder for consistent format.