I'm newer to deep learning domain.

I would like to know what is the principal difference between RNN,ANN,DNN and CNN?

How to implement those neural networks using the TensorFlow library?


1 Answer 1


Welcome to DS StackExchange. I'll go through your list:

  • ANN (Artificial Neural Network): it's a very broad term that encompasses any form of Deep Learning model. All the others you listed are some forms of ANN. ANNs can be either shallow or deep. They are called shallow when they have only one hidden layer (i.e. one layer between input and output). They are called deep when hidden layers are more than one (what people implement most of the time). This is where the expression DNN (Deep Neural Network) comes.

  • CNN (Convolutional Neural Network): they are designed specifically for computer vision (they are sometimes applied elsewhere though). Their name come from convolutional layers: they are different from standard (dense) layers of canonical ANNs, and they have been invented to receive and process pixel data.

  • RNN (Recurrent Neural Network): they are the "time series version" of ANNs. They are meant to process sequences of data. They are at the basis of forecast models and language models. The most common kind of recurrent layers are called LSTM (Long Short Term Memory) and GRU (Gated Recurrent Units): their cells contain small, in-scale ANNs that choose how much past information they want to let flow through the model. That's how they modeled "memory".

If you want to learn how to implement all these forms of ANN in TensorFlow, I suggest you this wonderful book:

Hands-on Machine Learning with Scikit-Learn, Keras, and TensorFlow, 2nd Edition by Aurélien Géron

this is the best book on ML and DL, IMHO.

  • 1
    $\begingroup$ The new version of Géron's book will be out soon, with examples in the new TensorFlow 2.0 $\endgroup$
    – Leevo
    Sep 5, 2019 at 17:14
  • 1
    $\begingroup$ If you are interested in practical implementations of ANNs in TensorFlow 2.0, please take a look at this TensorFlow 2.0 tutorial repository on GitHub. $\endgroup$
    – Leevo
    Sep 5, 2019 at 17:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.