0

What is the difference between keras.layer.Dense() and keras.layer.SimpleRNN()? I do understand what is Neural Network and RNN, but with the api the intuition is just not clear.? When I see keras.layer.Dense(32) I understand it as layer with 32 neurons. But not really clear if SimpleRNN(32) means the same. I am a newbie on Keras.

  1. How Dense() and SimpleRNN differ from each other?
  2. Is Dense() and SimpleRNN() function same at any point of time?
  3. If so then when and if not then what is the difference between SimpleRNN() and Dense()?
  4. Would be great if someone could help in visualizing it?

What's exactly happening in https://github.com/fchollet/keras/blob/master/examples/addition_rnn.py

Nishant Jain
  • 197
  • 1
  • 9

1 Answers1

2

Definitely different.

According to Keras Dense Dense implements the operation: output = activation(dot(input, kernel) + bias), it is a base architecture for neural network.

But for SimpleRNN, Keras SimpleRNN Fully-connected RNN where the output is to be fed back to input.

The structure of neural network and recurrent neural network are different.

To answer your question:

  1. The difference between Dense() and SimpleRNN is the differences between traditional neural network and recurrent neural network.
  2. No, they are just define structure for each network, but will work in different way.
  3. Then same as 1
  4. Check resources about neural network and recurrent neural network, there are lots of them on the internet.
Marshall7
  • 46
  • 6