Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

keras - Is there a way to "Invert" a Neural Network in Tensorflow?

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!

question from:https://stackoverflow.com/questions/65938921/is-there-a-way-to-invert-a-neural-network-in-tensorflow

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

This question kinda put me in a dilemma.

If you think it theoretically it should be possible if and only if your network has no non-linearities like ReLU and has weight matrices( plus bias) which is invertible, it is possible. However matrix multiplication is still a problem as your dimension increases.

But in practice, machine learning models tend to generalize the problem with the given input. So if you can build a model for f(x,y) then you can build another model for g(x,z) as the problem do not differ that much. If you think about complex models, it will not be practical. Also doing this does not make sense to me. There would be loss in the knowledge.

So even if you can do it, it requires lots of extra work. In my opinion it does not worth the prize. Going for a new model should be less painful.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...