<p>You cannot invert a generic nonlinear NN, however there is a NN architecture that will allow you to do this trivially (first proposed here, section 3.2 <a href="https://arxiv.org/pdf/1605.08803.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1605.08803.pdf</a>).</p>
<p>Basically, you split the input to 2 vectors, u1 and u2, and then transform it like this:</p>
<p>v1 = f1(u2) + g1(u2)u1</p>
<p>v2 = u2</p>
<p>Then, the inverse is:</p>
<p>u1 = (v1 - f(v2)) / g(v2)</p>
<p>u2 = v2</p>
<p>Note that to calculate an inverse a division by g is used (multiplication by g inverse), so you have to make sure that the inverse of g exists.</p>
Is there a way to "Invert" a Neural Network in Tensorflow?
<p>I'm training a Neural Network that, given some inputs that here we'll call x and y, is able to predict the output, z. So, z=f(x,y)
Once the neural network is correctly trained, I'd like to be able to obtain a model that, given z and x, returns the other input:
What i mean is to obtain the model for which:
y=g(x,z)
Is it possible in Tensorflow?
Thak you in advance!</p>