Está en la página 1de 5

Assignment No B-04

Aim
Implementation of a simple Neural Network for any suitable application.

Pre-requisite
1. Artificial Neural Network.
2. Programming language basics.

Objective
1. To understand idea of Artificial Neural Network.
2. To implement a simple example using Artificial Neural Network.

Problem Statement
Implement a simple Neural Network for any suitable application.

Hardware / Software Used


1. Python
2. Numpy library.

Mathematical Model
M = { s, e, X, Y, DD, NDD, fme , M emshared , success, f ailure, CP UCoreCount }

1. s = Initial state - Take random numbers in array.


2. e = End state - The approximate ouput is determined or calculated.
3. X = Input - Input array [[0,0,1],[0,1,1],[1,0,1],[1,1,1]].
4. Y = Output - Output array [[0,0,1,1]].
5. DD = Deterministic Data - The input and output array.
6. NDD = Non deterministic data - The error term in weight updating process.
7. F me = The training process for neural network.
8. Mem shared = No shared Memory is used.
9. Success Case = The training process completed successfully.
10. Failure Case = If the weight updating process terminates unexpectedly.
11. CPUCoreCount = 1.

Theory
Artificial Neural Network
Artificial neural networks are statistical learning models used to estimate function that can
depend on large number of inputs and are generally unknown. Artificial neural networks are
generally presented as systems of interconnected which exchange messages between each other.
For example, a neural network for handwriting recognition is defined by a set of input
neurons which may be activated by the pixels of an input image. After being weighted and
transformed by a function, the activations of these neurons are then passed on to other neurons.
This process is repeated until finally, an output neuron is activated. This determines which
character was read.
The utility of neural network models used to infer function from observations. The applications of neural networks is particularly useful in where the complexity of data makes design
of such function by hand impractical. The applications of neural network in real life are:
Function approximation, or regression analysis, including time series prediction, fitness
approximation and modelling.
Classification, including pattern and sequence recognition, novelty detection and sequential decision making.
Data processing, including filtering, clustering, blind source separation and compression.
Robotics, including directing manipulators, prosthesis.
Control, including Computer numerical control.

Procedure
Execution of Program: python prgm name.py

Conclusion
Hence, we have studied the artificial neural network and implement it.

Program
=================================================
GROUP A
Assignment No : B4
Title : Implementation of a simple Neural Network for any suitable application.
Roll No :
Batch : B
Class : BE( Computer )
=================================================
import numpy as np
def nonlin(x,deriv=False):
if(deriv==True):
return x*(1-x)
return 1/(1+np.exp(-x))
X = np.array([[0,0,1],[0,1,1],[1,0,1],[1,1,1]])
y = np.array([[0,0,1,1]]).T
np.random.seed(1)
syn0 = 2*np.random.random((3,1)) - 1
for iter in xrange(10000):
l0 = X
l1 = nonlin(np.dot(l0,syn0))
l1 error = y - l1
l1 delta = l1 error * nonlin(l1,True)
syn0 += np.dot(l0.T,l1 delta)
print Output After Training:
print l1

Output
administrator@administrator-OptiPlex-390:~/Desktop/CL2$ python B4_neuralnetwork.py
Output After Training:
[[ 0.00966449]
[ 0.00786506]
[ 0.99358898]
[ 0.99211957]]

Plagiarism Score

También podría gustarte