-
Notifications
You must be signed in to change notification settings - Fork 9
INN.Conv2d
Zhang Yanbo edited this page Oct 27, 2022
·
1 revision
A nonlinear 2d-convolutional INN layer.
Common parameters
-
channels
: number of channels -
kernel_size
: kernel size -
method
: This can be'NICE'
,'RealNVP'
and'ResFlow'
-
activation_fn
: Activation function for the coupling function. If the function is given, this argument will be ignored
RealNVP and NICE method
-
mask
: Mask for splitting input vectors
NICE
-
m
: Addition function, it should be a neural network maps vector with dimensionchannels // 2
tochannels - channels // 2
. Ifm=None
, it will be generated automatically byINN.utils.default_net(dim, k, activation_fn)
;
RealNVP
-
s
: Multiplication function. It has the same dimension requirements asm
; -
t
: Addition function. It has the same dimension requirements asm
; -
clip_n
: (default:clip_n=1
) Clipping the output ofs
to avoid extreme numbers between[-clip_n, clip_n]
. The clipping is usingtanh
to keep the gradient; -
clip
: Clipping the output ofs
ifclip=True
ResFlow
-
hidden
: Dimension of hidden layers -
lipschitz_constrain
: Lipschitz constrain number, it should be lower than 1. Low value may decrease the computation power of the neural network; -
mem_efficient
: Using memory-efficient back-propagation if it isTrue
; -
est_steps
: Number of iterations for estimating gradients and Jacobians
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.