0% found this document useful (0 votes)
12 views7 pages

Unit 2 ML

Uploaded by

Uday Chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views7 pages

Unit 2 ML

Uploaded by

Uday Chowdary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

Neural Network Representation:

In machine learning, a neural network is a computational model inspired by


the structure and functioning of the human brain. It's composed of
interconnected nodes, called neurons or units, organized in layers. Each
neuron receives inputs, performs a computation, and passes its output to the
neurons in the next layer. The network typically has an input layer, one or
more hidden layers, and an output layer.

Here's a breakdown of each component:

1. **Input Layer**: This layer consists of input neurons that receive the initial
data or features. Each neuron represents one feature of the input data.

2. **Hidden Layers**: These are layers between the input and output layers
where computation occurs. Each hidden layer consists of multiple neurons,
and each neuron is connected to every neuron in the previous and following
layers.

3. **Output Layer**: The final layer produces the output of the network. It
could represent predictions, classifications, or any other desired outcome
based on the input data.

4. **Neurons/Nodes**: Neurons are the basic computational units of a neural


network. Each neuron receives input signals, processes them, and produces an
output signal. This processing typically involves applying a nonlinear activation
function to the weighted sum of its inputs.

5. **Weights**: Connections between neurons are associated with weights.


These weights represent the strength of the connection between neurons and
are adjusted during the training process to optimize the network's
performance.
6. **Activation Function**: Each neuron usually applies an activation function
to the weighted sum of its inputs. This function introduces nonlinearity into
the network, enabling it to learn complex patterns in the data.

7. **Bias**: Each neuron typically has an associated bias term, which allows
the network to capture patterns that don't necessarily pass through the origin
(0,0) in the input space.

The process of training a neural network involves presenting input data along
with the corresponding desired outputs to the network, adjusting the weights
and biases iteratively through backpropagation and optimization algorithms
(such as gradient descent), until the network's output closely matches the
desired outputs. Once trained, the neural network can be used to make
predictions or classify new, unseen data.

Perceptron:
A perceptron is the simplest form of a feedforward artificial neural network. It
consists of a single layer of neurons (nodes) with direct connections between
the input and output layers. Perceptrons were introduced by Frank Rosenblatt
in the late 1950s and are the building blocks of more complex neural network
architectures.

Here's a breakdown of the perceptron:

1. **Input Layer**: The input layer consists of one or more input neurons,
each representing a feature of the input data. The number of input neurons is
determined by the dimensionality of the input data.

2. **Weights**: Each input neuron is associated with a weight, which


represents the strength of the connection between the input neuron and the
output neuron. These weights are typically initialized with random values and
are updated during the training process to minimize the error between the
predicted output and the actual output.

3. **Activation Function**: The perceptron uses a step function (also known as


the Heaviside step function) as its activation function. This function takes the
weighted sum of the inputs and produces a binary output based on whether
the sum is above or below a certain threshold. Mathematically, the output of
the perceptron can be represented as follows:
\[ \text{output} = \begin{cases} 1 & \text{if } \sum_{i=1}^{n} (x_i \cdot w_i) + b
> 0 \\ 0 & \text{otherwise} \end{cases} \]
where \( x_i \) is the input to the \( i \)-th neuron, \( w_i \) is the weight
associated with the \( i \)-th neuron, and \( b \) is the bias term.

4. **Bias**: In addition to weights, the perceptron typically includes a bias


term, which allows the model to capture patterns that don't necessarily pass
through the origin (0,0) in the input space. The bias term effectively shifts the
decision boundary of the perceptron.

Training a perceptron involves presenting input data along with corresponding


desired outputs to the network, adjusting the weights and bias term iteratively
through a process called the perceptron learning rule. The perceptron learning
rule updates the weights and bias term based on the error between the
predicted output and the actual output. The process continues until the
perceptron reaches a satisfactory level of accuracy on the training data or a
predefined number of iterations is reached.

Perceptrons are limited in their capabilities compared to more complex neural


network architectures, such as multilayer perceptrons (MLPs). They can only
learn linear decision boundaries and are not capable of representing nonlinear
relationships in the data. However, they laid the foundation for the
development of more sophisticated neural network models and are still used
in certain applications where linear decision boundaries are sufficient.
Multilayer Networks:
Multilayer neural networks, also known as multilayer perceptrons (MLPs), are
a type of artificial neural network with one or more hidden layers between the
input and output layers. They are a fundamental architecture in machine
learning and are widely used for various tasks such as classification, regression,
and pattern recognition.

Here's a breakdown of multilayer networks:

1. **Input Layer**: The input layer consists of neurons representing the input
features of the data. Each neuron corresponds to one feature, and the number
of neurons in this layer is determined by the dimensionality of the input data.

2. **Hidden Layers**: These are the layers between the input and output
layers where computation occurs. Each hidden layer consists of multiple
neurons, and each neuron is connected to every neuron in the previous and
following layers. The presence of multiple hidden layers allows the network to
learn complex and nonlinear relationships in the data.

3. **Output Layer**: The output layer produces the network's predictions or


classifications based on the input data. The number of neurons in this layer
depends on the nature of the task. For example, for binary classification, there
may be one neuron for each class representing the probability of belonging to
that class. For multi-class classification, there will be one neuron per class with
probabilities typically generated using a softmax activation function.

4. **Neurons/Nodes**: Neurons in the hidden layers and output layer perform


computations by taking weighted sums of their inputs and applying an
activation function. Each neuron has associated weights and biases that are
learned during the training process.
5. **Weights and Biases**: Connections between neurons are associated with
weights, which represent the strength of the connection between neurons.
Additionally, each neuron typically has an associated bias term, which allows
the network to capture patterns that don't necessarily pass through the origin
in the input space. These weights and biases are adjusted during the training
process to minimize the difference between the predicted output and the
actual output.

6. **Activation Functions**: Each neuron applies an activation function to the


weighted sum of its inputs to introduce nonlinearity into the network.
Common activation functions include sigmoid, tanh, ReLU (Rectified Linear
Unit), and softmax.

Training multilayer networks involves presenting input data along with


corresponding desired outputs to the network, adjusting the weights and
biases iteratively through backpropagation and optimization algorithms (such
as gradient descent), until the network's output closely matches the desired
outputs. Regularization techniques may also be employed to prevent
overfitting. Once trained, the multilayer network can be used to make
predictions or classify new, unseen data.

Back Propagation Algorithms:


Backpropagation (short for "backward propagation of errors") is a fundamental
algorithm used in training artificial neural networks, particularly those with
multiple layers, such as multilayer perceptrons (MLPs). It's an iterative
optimization algorithm that adjusts the weights of the network's connections
in order to minimize the difference between the predicted output and the
actual output for a given set of training examples.

Here's how backpropagation works:


1. **Forward Pass**: During the forward pass, input data is fed into the
network, and the activations of each neuron are calculated layer by layer until
the output is obtained. This involves computing the weighted sum of inputs to
each neuron and applying an activation function to produce the neuron's
output.

2. **Compute Error**: After obtaining the network's output, the error


between the predicted output and the actual output (target) is computed
using a loss function. Common loss functions include mean squared error
(MSE) for regression tasks and cross-entropy loss for classification tasks.

3. **Backward Pass**: In the backward pass (backpropagation), the error is


propagated backward through the network to compute the gradients of the
loss function with respect to the weights of the network. This is done using the
chain rule of calculus, which allows the error at the output layer to be
decomposed and distributed back through the network layer by layer.

4. **Update Weights**: Once the gradients of the loss function with respect to
the weights are computed, the weights are adjusted in the direction that
reduces the error. This is typically done using an optimization algorithm such
as stochastic gradient descent (SGD) or one of its variants (e.g., Adam,
RMSprop). The learning rate parameter determines the size of the weight
updates.

5. **Repeat**: Steps 1-4 are repeated iteratively for multiple epochs or until
convergence, with the network gradually improving its performance on the
training data.

Backpropagation allows neural networks to learn complex patterns in the data


by iteratively adjusting the weights to minimize the error between the
predicted and actual outputs. It's a key component of most neural network
training algorithms and has enabled the development of deep learning models
capable of solving a wide range of tasks in fields such as computer vision,
natural language processing, and reinforcement learning.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy