Docsity

Linearly Separable Problems-Artificial Intelligence-lecture Handout, Exercises of Artificial Intelligence

Toggle sidebar
bg1
Artificial Intelligence (CS607)
© Copyright Virtual University of Pakistan
3.3 Linearly separable problems
There is a whole class of problems which are termed as linearly separable. This
name is given to them, because if we were to represent them in the input space,
we could classify them using a straight line. The simplest examples are the
logical AND or OR. We have drawn them in their input spaces, as this is a simple
2D problem. The upper sloping line in the diagram shows the decision boundary
for AND gate, above which, the output is 1, below is 0. The lower sloping line
decides for the OR gate similarly.
A single perceptron simply draws a line, which is a hyper plane when the data is
more then 2 dimensional. Sometimes there are complex problems (as is the case
in real life). The data for these problems cannot be separated into their
respective classes by using a single straight line. These problems are not linearly
separable.
(0,0)
(0,1
(1,0
Input 2
Input 1
Input 1 Input 2 AND
0 0 0
0 1 0
1 0 0
1 1 1
Input 1 Input 2 OR
0 0 0
0 1 1
1 0 1
1 1 1
(1,1
docsity.com
pf3
pf4
pf5

Partial preview of the text

Download Linearly Separable Problems-Artificial Intelligence-lecture Handout and more Exercises Artificial Intelligence in PDF only on Docsity!

3.3 Linearly separable problems

There is a whole class of problems which are termed as linearly separable. This name is given to them, because if we were to represent them in the input space, we could classify them using a straight line. The simplest examples are the logical AND or OR. We have drawn them in their input spaces, as this is a simple 2D problem. The upper sloping line in the diagram shows the decision boundary for AND gate, above which, the output is 1, below is 0. The lower sloping line decides for the OR gate similarly.

A single perceptron simply draws a line, which is a hyper plane when the data is more then 2 dimensional. Sometimes there are complex problems (as is the case in real life). The data for these problems cannot be separated into their respective classes by using a single straight line. These problems are not linearly separable.

Input 2

Input 1

Input 1 Input 2 AND 0 0 0 0 1 0 1 0 0 1 1 1

Input 1 Input 2 OR 0 0 0 0 1 1 1 0 1 1 1 1

Another example of linearly non-separable problems is the XOR gate (exclusive OR). This shows how such a small data of just 4 rows, can make it impossible to draw one line decision boundary, which can separate the 1s from 0s.

Linearly Separable (^) Linearly Non Separable / Non linear decision region

Input 1 Input 2 Output 0 0 1 0 1 0 1 0 0 1 1 1

Input 2

Input 1

Can you draw one line which separates the ones from zeros for the output?

Each neuron in the hidden layer forms a different decision line. Together all the lines can construct any arbitrary non-linear decision boundaries. These multi- layer perceptrons are the most basic artificial neural networks.

4 Artificial Neural Networks: supervised and unsupervised

A neural network is a massively parallel distributed computing system that has a natural propensity for storing experiential knowledge and making it available for use. It resembles the brain in two respects:

  • Knowledge is acquired by the network through a learning process (called training)
  • Interneuron connection strengths known as synaptic weights are used to store the knowledge Knowledge in the artificial neural networks is implicit and distributed.

Advantages

  • Excellent for pattern recognition
  • Excellent classifiers
  • Handles noisy data well
  • Good for generalization

Draw backs

  • The power of ANNs lie in their parallel architecture
    • Unfortunately, most machines we have are serial (Von Neumann architecture)
  • Lack of defined rules to build a neural network for a specific problem
    • Too many variables, for instance, the learning algorithm, number of neurons per layer, number of layers, data representation etc
  • Knowledge is implicit
  • Data dependency

Input 1

Input 2

Input

Layer

Hidden

Layer

Output

Layer

But all these drawbacks doesn’t mean that the neural networks are useless artifacts. They are still arguably very powerful general purpose problem solvers.

4.1 Basic terminologies

  • Number of layers o Single layer network o Multilayer networks
  • Direction of information (signal) flow o Feed-forward o Recurrent (feed-back)
  • Connectivity o Fully connected o Partially connected

Single Layer Only one input and One output layer

Two Layers One input , One hidden and One output layer

Feed forward (^) Recurrent Network

output given by the hypothesis is same as the true output of concept

  • Finding the right hypothesis is the goal of the training session. So neural networks are doing function approximation, and training stops when it has found the closest possible function that gives the minimum error on all the instances
  • Training is the heart of learning, in which finding the best hypothesis that covers most of the examples is the objective. Learning is simply done through adjusting the weights of the network
  • Similarity Measurement
  • A measure to tell the difference between the actual output of the network while training and the desired labeled output
  • The most common technique for measuring the total error in each iteration of the neural network (epoch) is Mean Squared Error (MSE).
  • Validation
  • During training, training data is divided into k data sets; k- sets are used for training, and the remaining data set is used for cross validation. This ensures better results, and avoids over-fitting.
  • Stopping Criteria
  • Done through MSE. We define a low threshold usually 0.01, which if reached stops the training data.
  • Another stopping criterion is the number of epochs, which defines how many maximum times the data can be presented to the network for learning.
  • Application Testing

Weighted Sum of input

Similarity measure

Activation function

Weight updation

Input