0% found this document useful (0 votes)
188 views

Neural Networks and Fuzzy Systems: Neurolab

The document discusses the NeuroLab library which provides tools for implementing neural networks in Python. It describes the features of NeuroLab including supported network types, how to install NeuroLab, and examples of how to create and use different types of neural networks like perceptrons, multilayer perceptrons, and recurrent networks.

Uploaded by

mesfer
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
188 views

Neural Networks and Fuzzy Systems: Neurolab

The document discusses the NeuroLab library which provides tools for implementing neural networks in Python. It describes the features of NeuroLab including supported network types, how to install NeuroLab, and examples of how to create and use different types of neural networks like perceptrons, multilayer perceptrons, and recurrent networks.

Uploaded by

mesfer
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 17

Neural Networks and

Fuzzy Systems

NeuroLab
(a simple and powerful Neural Network Library for Python)

Dr. Tamer Ahmed Farrag


Course No.: 803522-3
NeuroLab 0.3.5
• NeuroLab - a library of basic neural networks algorithms
with flexible network configurations and learning
algorithms for Python. To simplify the using of the library,
interface is similar to the package of Neural Network
Toolbox (NNT) of MATLAB© .

• The library is based on the package numpy (


http://numpy.scipy.org), some learning algorithms are
used scipy.optimize (http://scipy.org).

2
Features
• Pure python + numpy
• API like Neural Network Toolbox (NNT) from MATLAB
• Interface to use train algorithms form scipy.optimize
• Flexible network configurations and learning
algorithms. You may change: train, error, initialization
and activation functions
• Unlimited number of neural layers and number of
neurons in layers
• Variety of supported types of Artificial Neural Network
and learning algorithms

3
Supported neural networks types
• Single layer perceptron
• Multilayer feed forward perceptron
• Competing layer (Kohonen Layer)
• Learning Vector Quantization (LVQ)
• Elman Recurrent network
• Hopfield Recurrent network
• Hemming Recurrent network

4
Install

• Open Anconda Prompt as administrator as shown

• Install neurolab using setuptools/distribute:

easy_install neurolab

• Or pip:

pip install neurolab

5
net: Neural Networks
• The module contains the basic network architectures

Count of
Network Type Function Support train fcn Error fcn
layers
Single-layer perceptron newp 1 train_delta SSE
train_gd, train_gdm,
train_gda, train_gdx,
Multi-layer perceptron newff >=1 SSE
train_rprop,
train_bfgs*, train_cg
train_wta,
Competitive layer newc 1 SAE
train_cwta*
LVQ newlvq 2 train_lvq MSE
Elman newelm >=1 train_gdx MSE
Hopield newhop 1 None None
Hemming newhem 2 None None

6
Single Layer Perceptron (newp)
• Syntax:

neurolab.net.newp(minmax, cn, transf=<neurolab.trans.HardLim>)

• Parameters:
• minmax: list of list, the outer list is the number of input neurons,
inner lists must contain 2 elements: min and maxRange of each input
values
• cn: int, number of output neurons Number of neurons

• transf: func (default HardLim) Activation function

• Returns:
• net: Net
7
Example
• To Create network with 2 inputs and 10 neurons
• each input values are between -1 and 1

>>> net = newp([[-1, 1], [-1, 1]], 10)

8
9
10
11
Feed Forward Multilayer Perceptron (newff)

• Syntax:

neurolab.net.newff(minmax, size, transf=None)


Parameters:
• minmax: list of list, the outer list is the number of input neurons, inner lists must
contain 2 elements: min and max Range of each input values
• size: the length of list equal to the number of layers except input layer, the
element of the list is the neuron number for corresponding layer Contains the
number of neurons for each layer
• transf: list (default TanSig) List of activation function for each layer

• Returns:
• net: Net

12
Example
• create neural net with 2 inputs
• input range for each input is [-0.5, 0.5]
• 3 neurons for hidden layer, 1 neuron for output
• 2 layers including hidden layer and output layer

>>> net = newff( [[-0.5, 0.5], [-0.5, 0.5]] , [3, 1])


>>> net.ci
2
>>> net.co
1
>>> len(net.layers)
2
13
14
15
16
Resources

• NeuroLab web site:

https://pythonhosted.org/neurolab/index.html

• Library:

https://pythonhosted.org/neurolab/lib.html#

• Examples:
https://pythonhosted.org/neurolab/example.html

17

You might also like