Deep Learning — In simple words…

Eshant Sah
3 min readDec 29, 2018

--

Deep learning is a subset of machine learning which mimics the working of Human Brain. We try to train the machine in a way in which human brain thinks and works.B’coz Human Brain has the most Powerful Learning tool/mechanism.

why so??

And the Reason is……..

Neuron and its organization.

The human brain possesses about 1 quadrillion (1million billion)neurons and the connection that wire them together is known as synapses.

So here is the new question what is Neuron and why its organization is so important?

Source:http://www.mplsvpn.info/2017/11/what-is-neuron-and-artificial-neuron-in.html

Neurons are the fundamental units of the brain which contains Dendrites, Axons, Synapses,etc .Dendrites act as a receiver whereas Axon acts as a transmitter of signals to and from other Neurons. In case of Human brain, the input comes from our Senses like ear, nose, eyes etc..and gets processed by our brain i.e organization of neurons in certain manner.

But in Artificial Neural Network(ANN) input(I1, I2, I3..Im) are independent variables whereas output is Dependent variable. And synapse are the weights assigned to each input neurons.

By changing the weights Neural networks learn which signal is important and these are the things that get adjusted during the process of Learning.

So how Neural network actually works??

step1: Once the input neurons(independent variables) are chosen its weights are assigned.

Step2: Now Activation function is applied to the summation of inputs and weights . Depending on the Activation function, Neurons learns which signal needs to be passed. (Activation Fuction will be covered in next Blog)

source: Machine Learning AtoZ course

Step3: Output(y) is generated and the Cost function is calculated for actual and predicted output. And based on the feedback from this cost function all the weights gets reassigned and again the whole process repeats until we get better feedback and this whole process is known as model training.

Note: There may be many layers between input and output Neurons and these intermediate layers are known as Hidden Layers. And the whole game of Neural Networks depend on the number of Hidden Layers, so be very calculative and selective while selecting Hidden Layers.

Source:https://medium.com/xanaduai/making-a-neural-network-quantum-34069e284bcf

Code Time:

import keras
from keras.models import Sequential
from keras.layers import Dense

Keras is a Python library for deep learning that runs on the top of Theano or TensorFlow. The sequential model represents the linear stack of layers. The Dense model represents the number of neurons in each in each layer.

# Initialising the ANN by creating object of sequential.
classifier = Sequential()
# Adding the input layer and the first hidden layer
classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 'relu', input_dim = 11))
# Adding the second hidden layer
classifier.add(Dense(units = 6, kernel_initializer = 'uniform', activation = 'relu'))
# Adding the output layer
classifier.add(Dense(units = 1, kernel_initializer = 'uniform', activation = 'sigmoid'))

Here, we are making two hidden layers, each of six neurons.

# Compiling the ANN
classifier.compile(optimizer = 'adam', loss = 'binary_crossentropy', metrics = ['accuracy'])
# Fitting the ANN to the Training set
classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)

Here, we compile our model where epoch = 100 represents iteration to train our model

Link to full code:https://www.kaggle.com/eshantsah/ann-churn-modelling/

Topics to be covered in next Blog: Activation Function and its types,Types of Neural Networks

--

--