- Saved searches
- Use saved searches to filter your results more quickly
- License
- masaponto/Python-ELM
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- Saved searches
- Use saved searches to filter your results more quickly
- License
- dclambert/Python-ELM
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.md
- About
- Build an Extreme Learning Machine in Python
- A guide to building a neural network without parameter tuning.
- Saved searches
- Use saved searches to filter your results more quickly
- License
- acba/elm
- Name already in use
- Sign In Required
- Launching GitHub Desktop
- Launching GitHub Desktop
- Launching Xcode
- Launching Visual Studio Code
- Latest commit
- Git stats
- Files
- README.rst
- About
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Extreme learning machine implemented by python3 with scikit-learn interface
License
masaponto/Python-ELM
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
Extreme Learning Machine implemented in Python3 with scikit-learn
This module has 3-type ELM
- elm.py is general 3-step model ELM
- ecob_elm.py is equality constrained optimization based ELM
- http://www.ntu.edu.sg/home/egbhuang/pdf/ELM-Unified-Learning.pdf
- http://www.ntu.edu.sg/home/egbhuang/pdf/ieee-is-elm.pdf
pip install git+https://github.com/masaponto/python-elm
from elm import ELM from sklearn.preprocessing import normalize from sklearn.datasets import fetch_openml as fetch_mldata from sklearn.model_selection import train_test_split db_name = 'australian' data_set = fetch_mldata(db_name) data_set.data = normalize(data_set.data) data_set.target = [1 if i == 1 else -1 for i in data_set.target.astype(int)] X_train, X_test, y_train, y_test = train_test_split( data_set.data, data_set.target, test_size=0.4) elm = ELM(hid_num=10).fit(X_train, y_train) print("ELM Accuracy %0.3f " % elm.score(X_test, y_test))
from elm import ELM from sklearn.preprocessing import normalize, LabelEncoder from sklearn.datasets import fetch_openml as fetch_mldata from sklearn.model_selection import KFold, cross_val_score db_name = 'iris' hid_nums = [10, 20, 30] print(db_name) data_set = fetch_mldata(db_name) data_set.data = normalize(data_set.data) data_set.target = LabelEncoder().fit_transform(data_set.target) for hid_num in hid_nums: print(hid_num, end=' ') e = ELM(hid_num) ave = 0 for i in range(10): cv = KFold(n_splits=5, shuffle=True) scores = cross_val_score(e, data_set.data, data_set.target, cv=cv, scoring='accuracy', n_jobs=-1) ave += scores.mean() ave /= 10 print("Accuracy: %0.3f " % (ave))
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
dclambert / Python-ELM Public archive
Extreme Learning Machine implementation in Python
License
dclambert/Python-ELM
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.md
—> ARCHIVED March 2021
This is an implementation of the Extreme Learning Machine [1][2] in Python, based on scikit-learn.
It is clear that the learning speed of feedforward neural networks is in general far slower than required and it has been a major bottleneck in their applications for past decades. Two key reasons behind may be: 1) the slow gradient- based learning algorithms are extensively used to train neural networks, and 2) all the parameters of the networks are tuned iteratively by using such learning algorithms. Unlike these traditional implementations, this paper proposes a new learning algorithm called extreme learning machine (ELM) for single- hidden layer feedforward neural networks (SLFNs) which ran- domly chooses the input weights and analytically determines the output weights of SLFNs. In theory, this algorithm tends to provide the best generalization performance at extremely fast learning speed. The experimental results based on real- world benchmarking function approximation and classification problems including large complex applications show that the new algorithm can produce best generalization performance in some cases and can learn much faster than traditional popular learning algorithms for feedforward neural networks.
It’s a work in progress, so things can/might/will change.
David C. Lambert
dcl [at] panix [dot] comCopyright © 2013
License: Simple BSDrandom_layer.py
Contains the RandomLayer, MLPRandomLayer, RBFRandomLayer and GRBFRandomLayer classes.
RandomLayer is a transformer that creates a feature mapping of the inputs that corresponds to a layer of hidden units with randomly generated components.
The transformed values are a specified function of input activations that are a weighted combination of dot product (multilayer perceptron) and distance (rbf) activations:
input_activation = alpha * mlp_activation + (1-alpha) * rbf_activation mlp_activation(x) = dot(x, weights) + bias rbf_activation(x) = rbf_width * ||x - center||/radius
mlp_activation is multi-layer perceptron input activation
rbf_activation is radial basis function input activation
alpha and rbf_width are specified by the user
weights and biases are taken from normal distribution of mean 0 and sd of 1
centers are taken uniformly from the bounding hyperrectangle of the inputs, and
radius = max(||x-c||)/sqrt(n_centers*2)
(All random components can be supplied by the user by providing entries in the dictionary given as the user_components parameter.)
The input activation is transformed by a transfer function that defaults to numpy.tanh if not specified, but can be any callable that returns an array of the same shape as its argument (the input activation array, of shape [n_samples, n_hidden]).
Transfer functions provided are:
- sine
- tanh
- tribas
- inv_tribas
- sigmoid
- hardlim
- softlim
- gaussian
- multiquadric
- inv_multiquadric
MLPRandomLayer and RBFRandomLayer classes are just wrappers around the RandomLayer class, with the alpha mixing parameter set to 1.0 and 0.0 respectively (for 100% MLP input activation, or 100% RBF input activation)
The RandomLayer, MLPRandomLayer, RBFRandomLayer classes can take a callable user provided transfer function. See the docstrings and the example ipython notebook for details.
The GRBFRandomLayer implements the Generalized Radial Basis Function from [3]
Contains the ELMRegressor, ELMClassifier, GenELMRegressor, and GenELMClassifier classes.
GenELMRegressor and GenELMClassifier both take *RandomLayer instances as part of their contructors, and an optional regressor (conforming to the sklearn API)for performing the fit (instead of the default linear fit using the pseudo inverse from scipy.pinv2). GenELMClassifier is little more than a wrapper around GenELMRegressor that binarizes the target array before performing a regression, then unbinarizes the prediction of the regressor to make its own predictions.
The ELMRegressor class is a wrapper around GenELMRegressor that uses a RandomLayer instance by default and exposes the RandomLayer parameters in the constructor. ELMClassifier is similar for classification.
plot_elm_comparison.py
A small demo (based on scikit-learn’s plot_classifier_comparison) that shows the decision functions of a couple of different instantiations of the GenELMClassifier on three different datasets.
elm_notebook.py
An IPython notebook, illustrating several ways to use the *ELM* and *RandomLayer classes.
Written using Python 2.7.3, numpy 1.6.1, scipy 0.10.1, scikit-learn 0.13.1 and ipython 0.12.1
[1] http://www.extreme-learning-machines.org [2] G.-B. Huang, Q.-Y. Zhu and C.-K. Siew, "Extreme Learning Machine: Theory and Applications", Neurocomputing, vol. 70, pp. 489-501, 2006. [3] Fernandez-Navarro, et al, "MELM-GRBF: a modified version of the extreme learning machine for generalized radial basis function neural networks", Neurocomputing 74 (2011), 2502-2510
About
Extreme Learning Machine implementation in Python
Build an Extreme Learning Machine in Python
A guide to building a neural network without parameter tuning.
Extreme Learning Machines (ELMs) are single-hidden layer feedforward neural networks (SLFNs) capable to learn faster compared to gradient-based learning techniques. It’s like a classical one hidden layer neural network without a learning process. This kind of neural network does not perform iterative tuning, making it faster with better generalization performance than networks trained using backpropagation method.
ELMs are based on the Universal Approximation Theorem which states that:
“A feed-forward network with a single hidden layer containing a finite number of neurons can approximate continuous functions on compact subsets of R^n, under mild assumptions on the activation function.”
This simply means that ELMs can solve classification and regression tasks with significant accuracy if it has sufficient hidden neurons and training data to learn for all hidden neurons.
To understand how ELM works, let me show to you an illustration and the steps in building the model.
We can implement ELM in three simple steps:
- Randomly assign the parameters of the hidden nodes (w, b)
- Compute the hidden layer output matrix H
- Compute the output weights β
Now, let’s proceed to the programming part. I am expecting that you know how to program in python and familiar already using packages in machine learning such as scikit-learn, numpy, and pandas.
We will train the network to classify handwritten digits using MNIST dataset.
Saved searches
Use saved searches to filter your results more quickly
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session.
Python Extreme Learning Machine (ELM) is a machine learning technique used for classification/regression tasks.
License
acba/elm
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
Sign In Required
Please sign in to use Codespaces.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching GitHub Desktop
If nothing happens, download GitHub Desktop and try again.
Launching Xcode
If nothing happens, download Xcode and try again.
Launching Visual Studio Code
Your codespace will open once ready.
There was a problem preparing your codespace, please try again.
Latest commit
Git stats
Files
Failed to load latest commit information.
README.rst
Python Extreme Learning Machine (ELM)
Python Extreme Learning Machine (ELM) is a machine learning technique used for classification/regression tasks.
About
Python Extreme Learning Machine (ELM) is a machine learning technique used for classification/regression tasks.