Run model backwards in Keras

I am currently playing with a Keras framework. And they did some simple classification tests, etc. I would like to find a way to start the network in the reverse order, using the outputs as input and vice versa. Any way to do this?

+4
source share
2 answers

There is no such thing as “starting the neural network in reverse order”, since the general architecture of the neural network does not determine the processing of data without forwarding . There is, however, a subclass of models that make - generative models that are not part of keras right now. The only thing you can do is create a network that somehow "mimics" the generating process that interests you. But this is a specific method characteristic of the sample, and does not have a general solution.

+3
source

I'm not sure about this case, but just add a quick solution, you just need to redesign the architecture so that the inputs are then treated as outputs and vice versa.

, ( ):

n_obs, n_feat = 1000, 20
n_labels = 2
n_hidden = 100 # you can make this whatever you want

:

Dense(input_dim = n_feat, output_dim = n_hidden)

:

Dense(input_dim = n_hidden, output_dim = n_labels)

" ", , :

:

Dense(input_dim = n_labels, output_dim = n_hidden)

:

Dense(input_dim = n_hidden, output_dim = n_feat)

, , . , . ?

, , (.. ), , .

, , Neural Networks, .

+1

All Articles