0
$\begingroup$

I am currently reading up on RealNVP, which has the following transformations according Lilian Weng:

$$ \begin{aligned} \mathbf{y}_{1:d} &= \mathbf{x}_{1:d} \\ \mathbf{y}_{d+1:D} &= \mathbf{x}_{d+1:D} \odot \exp({s(\mathbf{x}_{1:d})}) + t(\mathbf{x}_{1:d}) \end{aligned} $$

I am wondering how the inverse has the scale and shift networks simply reparameterized by the outputs $\mathbf{y}_i$'s instead. Wouldn't the learned weights only provide mappings from $\mathbf{x} \rightarrow \mathbf{y}$?

Here is the math to show invertibility: $$ \begin{cases} \mathbf{y}_{1:d} &= \mathbf{x}_{1:d} \\ \mathbf{y}_{d+1:D} &= \mathbf{x}_{d+1:D} \odot \exp({s(\mathbf{x}_{1:d})}) + t(\mathbf{x}_{1:d}) \end{cases} \Leftrightarrow \begin{cases} \mathbf{x}_{1:d} &= \mathbf{y}_{1:d} \\ \mathbf{x}_{d+1:D} &= (\mathbf{y}_{d+1:D} - t(\mathbf{y}_{1:d})) \odot \exp(-s(\mathbf{y}_{1:d})) \end{cases} $$

$\endgroup$

1 Answer 1

1
$\begingroup$

I think it is important to recognize again that the so called coupling layers are splitted into two. One part directly passes to next layer without any modifications (i.e. $\pmb x_{1:d}$). That's why you can just write $\pmb x_{1:d}$ instead of $\pmb y_{1:d}$ in the inverse formulation:

\begin{cases} \mathbf{x}_{1:d} &= \mathbf{y}_{1:d} \\ \mathbf{x}_{d+1:D} &= (\mathbf{y}_{d+1:D} - t(\mathbf{y}_{1:d})) \odot \exp(-s(\mathbf{y}_{1:d})) \end{cases} Which is equivalent to \begin{cases} \mathbf{x}_{1:d} &= \mathbf{y}_{1:d} \\ \mathbf{x}_{d+1:D} \odot \exp(s(\mathbf{y}_{1:d})) + t(\mathbf{y}_{1:d}) &= \mathbf{y}_{d+1:D} \end{cases} As you can see, we acquired back the same result as the forward formulation of $\mathbf{y}_{1:d}$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.