Extreme Learning Machine implementation in Python

Overview

Python-ELM v0.3

---> ARCHIVED March 2021 <---

This is an implementation of the Extreme Learning Machine [1][2] in Python, based on scikit-learn.
From the abstract:

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] com

Copyright © 2013
License: Simple BSD

Files

random_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]

elm.py

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.

Requirements

Written using Python 2.7.3, numpy 1.6.1, scipy 0.10.1, scikit-learn 0.13.1 and ipython 0.12.1

References

[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
Comments
  • Fix broken headings in Markdown files

    Fix broken headings in Markdown files

    GitHub changed the way Markdown headings are parsed, so this change fixes it.

    See bryant1410/readmesfix for more information.

    Tackles bryant1410/readmesfix#1

    opened by bryant1410 0
  • The ELM Scandal: 5 Easy Steps to Academic Fame

    The ELM Scandal: 5 Easy Steps to Academic Fame

    The “extreme learning machines (ELM)” are indeed worth working on, but they just shouldn’t be called “ELM”. With annotated PDF files at http://elmorigin.wix.com/originofelm , you can easily verify the following facts within 10 to 20 minutes:

    1. The kernel (or constrained-optimization-based) version of ELM (ELM-Kernel, Huang 2012) is identical to kernel ridge regression (for regression and single-output classification, Saunders ICML 1998, as well as the LS-SVM with zero bias; for multiclass multi-output classification, An CVPR 2007).
    2. ELM-SLFN (the single-layer feedforward network version of the ELM, Huang IJCNN 2004) is identical to the randomized neural network (RNN, with omission of bias, Schmidt 1992) and another simultaneous work, i.e., the random vector functional link (RVFL, with omission of direct input-output links, Pao 1994).
    3. ELM-RBF (Huang ICARCV 2004) is identical to the randomized RBF neural network (Broomhead-Lowe 1988, with a performance-degrading randomization of RBF radii or impact factors).
    4. In all three cases above, G.-B. Huang got his papers published after excluding a large volume of very closely related literature.
    5. Hence, all 3 "ELM variants" have absolutely no technical originality, promote unethical research practices among researchers, and steal citations from original inventors.

    Please forward this message to your contacts so that others can also study the materials presented at this website and take appropriate actions, if necessary.

    ELM: The Sociological Phenomenon

    Since the invention of the name “extreme learning machines (ELM)” in 2004, the number of papers and citations on the ELM has been increasing exponentially. How can this be imaginable for the ELM comprising of 3 decade-old algorithms published by authors other than the ELM inventor? This phenomenon would not have been possible without the support and participation of researchers on the fringes of machine learning. Some (unknowingly and a few knowingly) love the ELM for various reasons:

    • Some authors love the ELM, because it is always easy to publish ELM papers in an ELM conference or an ELM special issue. For example, one can simply take a decade-old paper on a variant of RVFL, RBF or kernel ridge regression and re-publish it as a variant of the ELM, after paying a small price of adding 10s of citations on Huang’s “classic ELM papers”.

    • A couple of editor-in-chiefs (EiCs) love the ELM and offer multiple special issues/invited papers, because the ELM conference & special issues will bring a flood of papers, many citations and therefore high impact factors to their low quality journals. The EiCs can claim to have faithfully worked within the peer-review system, i.e. the ELM submissions are all rigorously reviewed by ELM experts.

    • A few technical leaders, e.g. some IEEE society officers, love the ELM, because it rejuvenates the community by bringing in more activities and subscriptions.

    • A couple of funding agencies love the ELM, because they would rather fund a new sexy name, than any genuine research.

    One may ask: how can something loved by so many be wrong?

    A leading cause of the current Greek economic crisis was that a previous government showered its constituents with jobs and lucrative compensations, in order to gain their votes, thereby raising the debt to an unsustainable level. At that time, the government behavior was welcome by many, but led to severe consequences. Another example of popularity leading to a massive disaster can be found in WW II as Hitler was elected by popular votes.

    The seemingly small price to pay in the case of the ELM is the diminished publishing ethics, which, in a long run, will fill the research literature with renamed junk, thereby making the research community and respected names, such as IEEE, Thomson Reuters, Springer and Elsevier, laughing stocks. Similar to that previous Greek government and its supporting constituents, the ELM inventor and his supporters are “borrowing” from the future of the entire research community for their present enjoyment! It is time to wake up to your consciousness.

    Our beloved peer-review system was grossly abused and failed spectacularly in the case of the ELM. It is time for the machine learning experts and leaders to investigate the allegations presented here and to take corrective actions soon.

    5 Easy but Proven Steps to Academic Fame

    1. The Brink of Genius: Take a paper published about 20 years ago (so that the original authors have either passed away, retired, or are too well-established/generous to publicly object. Unfortunately, pioneers like Broomhead and Pao have passed away). Introduce a very minor variation, for example, by fixing one of the tunable parameters at zero (who cares if this makes the old method worse, as long as you can claim it is now different and faster). Rewrite the paper in such a way that plagiarism software cannot detect the similarity, so that you are not in any of the “IEEE 5 levels of plagiarism”. Give a completely new sensational name (hint: the word “extreme” sounds extremely sexy).
    2. Publication: Submit your paper(s) to a poor quality conference or journal without citing any related previous works.
    3. Salesmanship: After publishing such a paper, now it is time to sell the stolen goods! Never blush. Don't worry about ethics. Get your friends/colleagues to use your “big thing”. Put up your Matlab program for download. Organize journal special issues, conferences, etc. to promote these unethical research practices among junior researchers who would just trust your unethical publications without bothering to read the original works published in the 1980s or 1990s. Of course, the pre-requisite for a paper to be accepted in your special issues/conferences is 10s of citations for your unethically created name and publications. Invite big names to be associated with your unethically created name as advisory board members, keynote speakers, or co-authors. These people may be too busy to check the details (with a default assumption that your research is ethical) and/or too nice to say no. But, once “infected” with your unethically created name, they will be obliged to defend it for you.
    4. The Smoke Screen: Should others point out the original work, you claim not to know the literature while pointing to a minor variation that you introduced in the first place. Instead of accepting that your work was almost the same as the literature and reverting back to the older works, you promote your work by: (1) repeating the tiny variation; (2) excluding the almost identical works in the list of references or citing and describing them incorrectly; (3) excluding thorough experimental comparisons with nearly identical works in the literature so that worse performance of your minute variations will not be exposed; (4) making negative statements about competing methods and positive statements about your unethically created name without solid experimental results using words like “may” or “analysis”; (5) comparing with apparently different methods. You can copy the theories and proofs derived for other methods and apply to your method (with tiny variation from those in the old literature) claim that your method has got a lot of theories while others do not have.
    5. Fame: Declare yourself as a research leader so that junior researchers can follow your footsteps. Enjoy your new fortune, i.e., high citations, invited speeches, etc. You don’t need to be on the shoulders of giants, because you are a giant! All you have to do to get there is to follow these easy steps!

    One can call the above steps “IP” (Intelligent Plagiarism), as opposed to stupid (verbatim) plagiarism specified by the IEEE in “5 levels”. The machine learning community should feel embarrassed if “IP” (Intelligent Plagiarism) was originally developed and/or grandiosely promoted by this community, while the community is supposed to create other (more ethical) intelligent algorithms to benefit the mankind.

    In mid-July 2015, G.-B. Huang posted an email on his [email protected] emailing list. This email was forwarded to [email protected] for our responses. As usual, this email was meaningless and our remarks are available at http://elmorigin.wix.com/originofelm .

    Email for feedback: [email protected]

    opened by ELM-Xposed 0
  • ValueError: output_type='binary' , but y.shape = (30, 3)

    ValueError: output_type='binary' , but y.shape = (30, 3)

    Hello,

    I'm using your implementation of ELMClassifier to run some experiments. I see it was implemented following sklearn coding interface, so i was trying to run your algorithm through a dataset and measure its performance with cross_val_score(), but i am getting this error:

    ValueError: output_type='binary', but y.shape = (30, 3)

    It has something to do with line 614, where you set:

       class_predictions = self.binarizer.inverse_transform(raw_predictions)
    

    Do you have any clue how can i fix this problem? I am using Iris dataset (3 classes). Please let me know if i can help or even push a pull request for this.

    Thanks in advance.

    opened by henrique-voni 0
  • citation missing?

    citation missing?

    The README says that the centers and radius are taken as follows:

    centers are taken uniformly from the bounding hyperrectangle of the inputs, and
    radius = max(||x-c||)/sqrt(n_centers*2)
    

    but citation [2] only talks about ELM, and [3] talks about RBF, but the centers and radius are taken in a different way. Is the solution in this implementation an idea of @dclambert or is there a citation missing?

    opened by javiribera 2
  • GPU implementation?

    GPU implementation?

    Is anyone aware of any GPU implementation of ELM? This package is based on scikit-learn, so it will probably never support GPU. I am looking for a way to speed up the computation.

    opened by javiribera 0
  • Module name and method changes has been done .

    Module name and method changes has been done .

    1A. Changed the atleast2d_or_csr method in (from sklearn.utils import check_random_state, atleast2d_or_csr ) to (from sklearn.utils import check_random_state,check_array).

    1B. 91 and 110 th line of random_layer.py.

    2.Changed the cross_validation module from (from sklearn.cross_validation import train_test_split) to (from sklearn.model_selection import train_test_split).

    opened by Danyson 1
Owner
David C. Lambert
David C. Lambert
High performance implementation of Extreme Learning Machines (fast randomized neural networks).

High Performance toolbox for Extreme Learning Machines. Extreme learning machines (ELM) are a particular kind of Artificial Neural Networks, which sol

Anton Akusok 174 Dec 7, 2022
A Python Automated Machine Learning tool that optimizes machine learning pipelines using genetic programming.

Master status: Development status: Package information: TPOT stands for Tree-based Pipeline Optimization Tool. Consider TPOT your Data Science Assista

Epistasis Lab at UPenn 8.9k Jan 9, 2023
Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques

Vowpal Wabbit is a machine learning system which pushes the frontier of machine learning with techniques such as online, hashing, allreduce, reductions, learning2search, active, and interactive learning.

Vowpal Wabbit 8.1k Dec 30, 2022
CD) in machine learning projectsImplementing continuous integration & delivery (CI/CD) in machine learning projects

CML with cloud compute This repository contains a sample project using CML with Terraform (via the cml-runner function) to launch an AWS EC2 instance

Iterative 19 Oct 3, 2022
MIT-Machine Learning with Python–From Linear Models to Deep Learning

MIT-Machine Learning with Python–From Linear Models to Deep Learning | One of the 5 courses in MIT MicroMasters in Statistics & Data Science Welcome t

null 2 Aug 23, 2022
Machine learning algorithms implementation

Machine learning algorithms implementation This repository consisits of implementation of various machine learning algorithms. The algorithms implemen

Karun Dawadi 1 Jan 3, 2022
Microsoft contributing libraries, tools, recipes, sample codes and workshop contents for machine learning & deep learning.

Microsoft contributing libraries, tools, recipes, sample codes and workshop contents for machine learning & deep learning.

Microsoft 366 Jan 3, 2023
A data preprocessing package for time series data. Design for machine learning and deep learning.

A data preprocessing package for time series data. Design for machine learning and deep learning.

Allen Chiang 152 Jan 7, 2023
A mindmap summarising Machine Learning concepts, from Data Analysis to Deep Learning.

A mindmap summarising Machine Learning concepts, from Data Analysis to Deep Learning.

Daniel Formoso 5.7k Dec 30, 2022
A comprehensive repository containing 30+ notebooks on learning machine learning!

A comprehensive repository containing 30+ notebooks on learning machine learning!

Jean de Dieu Nyandwi 3.8k Jan 9, 2023
Implemented four supervised learning Machine Learning algorithms

Implemented four supervised learning Machine Learning algorithms from an algorithmic family called Classification and Regression Trees (CARTs), details see README_Report.

Teng (Elijah)  Xue 0 Jan 31, 2022
High performance, easy-to-use, and scalable machine learning (ML) package, including linear model (LR), factorization machines (FM), and field-aware factorization machines (FFM) for Python and CLI interface.

What is xLearn? xLearn is a high performance, easy-to-use, and scalable machine learning package that contains linear model (LR), factorization machin

Chao Ma 3k Jan 8, 2023
A library of extension and helper modules for Python's data analysis and machine learning libraries.

Mlxtend (machine learning extensions) is a Python library of useful tools for the day-to-day data science tasks. Sebastian Raschka 2014-2021 Links Doc

Sebastian Raschka 4.2k Dec 29, 2022
MLBox is a powerful Automated Machine Learning python library.

MLBox is a powerful Automated Machine Learning python library. It provides the following features: Fast reading and distributed data preprocessing/cle

Axel 1.4k Jan 6, 2023
Python package for stacking (machine learning technique)

vecstack Python package for stacking (stacked generalization) featuring lightweight functional API and fully compatible scikit-learn API Convenient wa

Igor Ivanov 671 Dec 25, 2022
A Python Package to Tackle the Curse of Imbalanced Datasets in Machine Learning

imbalanced-learn imbalanced-learn is a python package offering a number of re-sampling techniques commonly used in datasets showing strong between-cla

null 6.2k Jan 1, 2023
A fast, scalable, high performance Gradient Boosting on Decision Trees library, used for ranking, classification, regression and other machine learning tasks for Python, R, Java, C++. Supports computation on CPU and GPU.

Website | Documentation | Tutorials | Installation | Release Notes CatBoost is a machine learning method based on gradient boosting over decision tree

CatBoost 6.9k Jan 5, 2023
Python module for machine learning time series:

seglearn Seglearn is a python package for machine learning time series or sequences. It provides an integrated pipeline for segmentation, feature extr

David Burns 536 Dec 29, 2022
Uber Open Source 1.6k Dec 31, 2022