Neural network to get input attributes using only the output value

0

I have an idea about how to use neural networks but I'm not sure if it is possible or not.

In supervised learning we have a set of attributes labeled with an output value. I can use these set to train my network.

Now I have a network trained to get an output value from an random set of attributes but, can I use this trained network to get the input attributes using only the desired output?

I will have N input values and only 1 output value. I've thought that I can use the weights for that network into a new one with 1 input value and N output values but I'm not sure if I can do that.

VansFannel

Posted 2018-03-07T08:41:55.487

Reputation: 523

Answers

2

Now I have a network trained to get an output value from an random set of attributes but, can I use this trained network to get the input attributes using only the desired output?

It depends:

  • If you are happy to find any inputs, even non-realistic ones, that get your desired output, then you can use your trained network, with a minor modification. Freeze all the weights, and allow back-propagation to determine the gradient of the input (which should now be a variable to optimise, not source data). Start with a noise input, back-propagate the error to find gradient to make the input better at creating your desired output, then take a gradient step towards it in the input data. This is essentially how Deep Dream works. Like Deep Dream, you will not necessarily get realistic input values, but will get semi-random ones that cause your network to predict a specific class.

  • If you want the newly generated input to be a best guess at something from the original dataset, then you have to look at one of more advanced models:

These network types are quite advanced, and can be tricky to understand and train successfully. You will want to spend some time researching each type.

To generalise terribly: A GAN will tend to generate realistic "noise" in the generated items, but at the expense of overall structure and cohesion (images tend to look distorted but with realistic textures). A VAE will tend to produce smooth, coherent inputs, but at the expense of lack of fine detail (VAE images tend to look smoothed and/or blurred).

If not sure what to try, probably GAN is a reasonable choice, since there are lots of tutorials available, and recent advances with image generation can look very impressive.

Neil Slater

Posted 2018-03-07T08:41:55.487

Reputation: 14 632

Thanks. I've thought about this question because I'm using genetic algorithm to optimize a function. I know which is the desirable output, 0, and I have tested a lot without successful. Maybe I can use a neural network to find the input to the genetic algorithm to get 0 as output. Thanks again. – VansFannel – 2018-03-07T20:02:57.923

0

NN isn't symmetric and the result may haven't any seems. You can just use loss like this (target_output - model_output)**2 - MSE differentiate this loss according to input variables and use optimizer to solve this task. Try to search about adversarial models, the idea is very similar.

user2674414

Posted 2018-03-07T08:41:55.487

Reputation: 171

could I ask you to give this answer an edit? I would do it, but I'm not sure of the meaning of the first sentence... – DukeZhou – 2018-03-09T18:04:39.427