Recurrent Neural Network RNN - how to implement one output as input to the next iteration in Python Keras?

42
November 13, 2019, at 2:40 PM

The FCC fully connected cascaded network with recurrent layer is shown in the figure below.

A step-by-step is wanted in order to implement this topology in Python with Keras using advanced layer building, that means, no sequential layer definition approach.

Note that only one output is used as input to the next iteration.

Here is a code sample to implement it but without RNN.

'''

            nr_input_units = 3
            nr_output_units = 1
            hidden_activation = 'relu'
            output_activation = 'sigmoid'
            visible = Input(shape=(nr_input_units,))
            hidden1 = Dense(1, activation=hidden_activation)(visible)
            merge2_in = concatenate([visible, hidden1])
            hidden2 = Dense(1, activation=hidden_activation)(merge2_in)
            merge3_in = concatenate([visible, hidden1, hidden2])
            output= Dense(nr_output_units, activation=output_activation)(merge3_in)
            _model = Model(inputs=visible, outputs=output)

'''

READ ALSO
Is there another effective method to create a chatbot skeleton to analyze inputs?

Is there another effective method to create a chatbot skeleton to analyze inputs?

I am trying to create a chatbot using Django/Channels WebSockets, however, I am having problems with the communicationOnce the user send the message I require to analyze it and use some nlp or nltk python libraries to extract the intent

38
How to map dictionary outputs into tuple?

How to map dictionary outputs into tuple?

I have a generator like this:

76
Is there a way to make pandas read_csv function faster

Is there a way to make pandas read_csv function faster

Currently, I am working with a file that is big (around 45GB) I am trying to load the file using pandas read_csv function, however, it is taking forever just to loading the fileIs there a way to fasten this process?

65
How do I multiply all elements of a PyTorch tensor by a constant?

How do I multiply all elements of a PyTorch tensor by a constant?

Say I want to multiply a tensor by a constant (like 2), and the tensor is defined as follows:

151