Supervised Learning - Classification Week 9 Challenge
# Question 1
Neural Network:
Neural Networks reflect the behavior of the human brain, allowing computer programs to recognize patterns and solve common problems in teh fields of AI and Machine Learning and deep learning.
Neural Networks, also known as artificial neural networks (ANNs) or simulated neural networks (SNNs), are a subset of machine learning and are at the heart of deep learning algorithms. Their name and structure are inspired by the human brain, mimicking the way that biological neurons signal to one or more hidden layers, and an output layer. Each node, or artificial neuron, connects to another and has an associated weight and thresold. if the outputs of ant individual node is above the specified threshold value, that node is activated, sending data to the next layer to the network. Otherwise there is no data is passed along to the next layer of the network.

Neural networks relay on training data to learn and improve their accuracy over time. However, once these learning algorithms are fine tuned for accuracy, they are powerful tools in computer science and artificial intelligence, allowing us to classify and cluster data at a high velocity. Tasks in speech recognition or image recognition can take minutes versus hours when compared to the manual identification by human experts. One of the most well-known neural networks is Google's search algorithm.
#Question 2
Deep learning attempts to mimic the human brain-albeit for from matching its ability-enabiling systems to cluster data and make predictions with incerdible accuracy.
Deep learning is a subset of machine learning, which is essentially a neural network with three or more layers. These neural networks attempt to simulate the behavior of the human brain-albeit far from matching its ability-allowing it to learn from large amounts of data. While a neural network with a single layer can still make approximate predictions, additional hidden layers can help to optimize and refine for accuracy.
Deep learning drives many artificial intelligence (AI) applications and services that improves automation, performing analytical and physical tasks without human interventions. Deep learning technology lies behind everyday products and services (such as digital assistants, voice-enabled TV remotes, and credit card fraud detection) as well as emerging technologies (such as self-driving cars).
Machine learning vs deep learning:
If deep learning is a subset of machine learning, how do they differ? Deep learning distinguishes itself from classical machine learning by the type of data that it works with and the methods in which it learns.
Machine learning algorithms leverage structured, labeled data to make predictions-meaning that specific features are defined from the input data for the model and organized into tables. This doesn't necessarily mean that it doesn't use unstructured data; it just means that if it does, it generally goes through some pre-processing to organize it into a structured format.
Deep learning eliminates some of data pre-processing that is typically involved with machine learning. These algorithms can ingest and process unstructured data, like text and image, and it automates feature extraction, removing some of the dependency on human experts. For example, let's say that we had a set of photos of different pets, and we wanted to categorize by "cat","dog" etc catera.
Deep learning algorithms can determine which features(e.g. ears) are most important to distinguish each animal from another. In machine learning, this hiearachy of features is established manually by a human expert.
Then, through the processes of gradient descent and back propagation, the deep learning as well, which are usually categorized as supervised learning, unsupervised learning, and reinforcement learning.
Supervised learning utilizes labeled datasets to categorize or make predictions; this requires some kind of human intervention to label input data correctly. In contrast, unsupervised learning doesn't require labeled datasets, and instead, it detects patterns in the data, clustering them by any distinguishing characteristics. Reinforcement learning is a process in which a model learns to become more accurate for performng an action in an environment based on feedback in order to maximize the reward.
# Question 3
Activation function decides, weather a neuron should be activated or not by calculating weighted sum and further adding bias with it. The purpose of the activation function is to introduce non-linearity into the output of a neuron.
We know, neural network has neurons that work in correspondence of weight, bias and their respective activation function. In a neural network, we would update the weights and biases of the neurons on the basis of the error at the output. This process is known as back-propagation. Activation functions make the back propagation possible since the gradients are supplied along with the error to update the weights and biases.
A neural network without an activation function is essentially just a linear regression model. The activation function does the non-linear transformation to the input making it capable to learn and perform more complex tasks.
# Question 4
Sigmoid function:
In an ANN, the sigmoid function is a non-linear AF used primarily in feedforward neural networks. it is a differentiable real function, defined for real input values, and containing positive derivatives everywhere with a specific degree of smoothness. The sigmoid function are appears in the output layer of the deep learning models and is used for predicting probability-based outputs. The sigmoid function is represented as

Generally, the derivatives of the sigmoid function are applied to learning algorithms. The graph of the sigmoid function is 'S' shaped.
some of the major drawbacks of the sigmoid function include gradient saturation, slow convergence, sharp damp graidents during backpropagation from within deeper hidden layers to the input layers, and non-zero centered output that causes the gradient updates to propagate in varying directions.
Hyperbolic tangent function (Tanh):
The hyperbolic tangent function, a, l, k ,a.., the tanh function, is another type of AF. It is a smoother, zero-centered function having a range between -1 to 1. As a result, the output of the tanh function is represented by:

The tanh function is much more extensively used that the sigmoid function since it delivers better training performance for multilayer neural networks. The biggest advantage of the tanh function is that it produces a zero-centered output, thereby supporting the back-propagation process. The tanh function has been mostly used in recurrent neural networks for natural networks for natural language processing and speech recognition tasks.
However, the tanh function too has a limitation - just like the sigmoid function, it cannot solve the vanishing gradient problem. Also, the tanh function can only attain a gradient of 1 when the input value is 0 (x is zero). As a result, the function can produce some dead neurons during the computation process.
softmax function:
The softmax function is another type of AF used in neural networks to compute probability distribution from a vector of real numbers. This function generates an output that ranges between values 0 and 1 and with the sum of the probabilities being equal to 1. The softmax function is represented as follows:
This function is mainly used in multi-class models where it returns probabilities of each class, with the target class having the highest probability. It appears in almost all the output layers of the DL architecture where they are used. The primary difference between the sigmoid and softmax AF is that while the former is used in binary classification, the latter is used for multivariate classification.
Softsign function:
The softsign function is another AF that is used in neural network computing. Although it is primarily in regression computation problems, now a days it is also used in DL based text-to-speech applications. It is a quadratic polynomial, represented by:

Here "X" equals the absolute value of the input.
The main difference between the softsign function and the tanh function is that unlike the tanh function that converges exponentially, the softsign function coverages in a polynomial form.
Rectified Linear unit (ReUL) function:
one of the most popular AFs in DL models, the rectified linear unit (ReUL) function,is a fast-learning AF that promises to deliver state-of-the-art performance with stellar results. Compared to other AFs like the sigmoid and tanh functions, that retains the properties of linear models, which makes them easy to optimize with gradient-descent methods.
The ReLU function performs a threshold operation on each input element where all values less than zero are set to zero. Thus, the ReLU is represented as:

By rectifying the values of the inputs less than zero and setting them to zero, this function eliminates the vanishing gradient problem observed in the earlier types of activation functions (sigmoid and tanh).
The most significant advantage of using the ReLU function in computation is that it guarantees faster computation - it does not compute exponentials and divisions, thereby boosting the overall computation speed. Another critical aspect of the ReUL function is that it introduces sparsity in the hidden units by squishing the values between zero to maximum.
Exponential linear units (ELU) function:
The exponential linear units (ELUs) function is an AF that is also used to speed up to the training of neural networks (just like ReLU function). The biggest advantage of the ELU function is that it can eliminate the vanishing gradient problem by using identify for positive values and by improving the learning characteristics of the model.
ELUs have negative values that push the mean unit a activation closer to zero, thereby reducing computational complexity and improving the learning speed. The ELU is an excellent alternative to the ReLU - it decreases bias shifts by pushing mean activation towards zero during the training process.
The exponential linear unit funtion is represented as:
The derivative or gradient of the ELU equation is presented as:

Here "a" equals the ELU hyperparameter that controls the saturation point for negative inputs, which is usually set to 1.0. However, the ELU function has a limitation - it is not zero -centered.
#Question 5

Back propagation algorithm is probably the most fundamental building block in a neural network. It was first introduced in 1960s and almost 30 years later (1989) popularized by Rumelhart, Hinton and williams in a paper called "Learning representations by back propagating errors".
The algorithm is used to effectively train a neural network through a method called chain rule. In simple terms, after each forward pass through a network, back propagation performs a backward pass while adjusting the model's parameter (weights and biases).
Back Propagation (backward propagation) is an important mathematical tool for improving the accuracy of predictions in data miniing and machine learning. Essentially, backpropagation is an algorithm used to calculate derivatives quickly.
Artificial neural networks use back propagation as a learning algorithm to compute a gradient descent with respect to weights. Desired outputs are compared to achieved system outputs, and then the systems are tuned by adjusting connection weights to the narrow the difference between the two as much as possible. The algorithm gets its name because the weights are updated backwards, from output towards input.
The difficulty of understanding exactly how changing weights and biases affects the overall behavior of an artificial neural network was one factor that held back wider application of neural network applications, arguably until the early 2000s when computers provided the necessary insight. Today, backproportion backproportion algorithms have practical applications is many areas of artificial intelligence (AI), including optical character recognition (OCR), natural language processing (NLP) and image processing.
Because back propagation requires a known, desired output for each input value in order to calculate the loss function gradient, it is usually classified as a type of supervised machine learning. Along with classifiers such as nataive bayesian filters and decision trees, the back propagation algorithm has emerged as an important part of machine learning applications that involve predictive analytics.