Neural Networks and Fuzzy Systems: Neurolab
Neural Networks and Fuzzy Systems: Neurolab
Fuzzy Systems
NeuroLab
(a simple and powerful Neural Network Library for Python)
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
• Install neurolab using setuptools/distribute:
easy_install neurolab
• Or pip:
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:
• 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
• Returns:
• net: Net
7
Example
• To Create network with 2 inputs and 10 neurons
• each input values are between -1 and 1
8
9
10
11
Feed Forward Multilayer Perceptron (newff)
• Syntax:
• 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
https://pythonhosted.org/neurolab/index.html
• Library:
https://pythonhosted.org/neurolab/lib.html#
• Examples:
https://pythonhosted.org/neurolab/example.html
17