• Home
  • ExtropyNOW! - Courses
    • Mechatronics Engineering >
      • Mechatronics - 1st Tetramester >
        • ME-01-English I / Inglés I
        • ME-01-Values of the being / Valores del ser
        • ME-01-Metrology / Metrología >
          • Proteus Simulation Tutorial
        • ME-01-Electricity and magnetism / Electricidad y magnetismo
        • ME-01-AutoCAD / Dibujo para Ingeniería
        • ME-01-Differential and Integral Calculus >
          • II - Limits and continuity.
        • ME-01-Lineal Algebra / Álgebra lineal
      • Mechatronics - 2nd Tetramester >
        • ME-02-English II / Inglés II
        • ME-02-Emotional Intelligence / Intelligencia Emocional
        • ME-02-Static / Estática (Mechanical)
        • ME-02-Electronical Circuit Analysis / Análisis de Circuitos
        • ME-02-Structured Programming / Programación Estructurada (C)
        • ME-02-Vectorial Calculus / Cálculo Vectorial
        • ME-02-Normativity and Industrial Security / Normatividad y Seguridad Industrial
      • Mechatronics - 3rd Tetramester >
        • ME-03-English III / Inglés III
        • ME-03-Interpersonal Development / Desarrollo Interpersonal
        • ME-03-Dynamics / Dinámica (Mechanical)
        • ME-03-Analogic Electronics / Electrónica Analógica >
          • ME-03-Analog Electronics-Useful schematics
        • ME-03-Digital Electronics / Electrónica Digital >
          • N555 as timer.
        • ME-03-Probability and Statistics / Probabilidad y Estadística
        • ME-03-Maintenance Engineering
      • Mechatronics - 4th Tetramester >
        • ME-04-Thinking Abilities / Habilidades del Pensamiento
        • ME-04-Material's Resistance / Resistencia de los Materiales
        • ME-04-Power Electronics / Electrónica de Potencia
        • ME-04-Periphereal Programming / Programación de Periféricos (LabVIEW)
        • ME-04-Differential Equations / Ecuaciones Diferenciales
        • ME-04-First Internship / Estancia I
      • Mechatronics - 5th Tetramester >
        • ME-05-English V - Inglés V
        • ME-05-Organizational Abilities / Habilidades Organizacionales
        • ME-05-Engine's Analysis / Análisis de Mecanismos
        • ME-05-Sensor's and Signal Conditioning / Sensores y Acondicionamiento de Señales
        • ME-05-Microcontrollers / Microcontroladores (PIC)
        • ME-05-System's Modelling and Simulation
        • ME-05-Fluid Mechanics
      • Mechatronics - 6th Tetramester >
        • ME-06-English VI - Inglés VI
        • ME-06-Professional Ethics / Ética Profesional
        • ME-06-Mechanical Design / Diseño Mecánico
        • ME-06-Industrial Automation / Automatización Industrial (PLC's)
        • ME-06-Electric Machines / Máquinas Eléctricas
        • ME-06-Manufacturing Processes / Procesos de Manufactura
        • ME-06-Pneumatic and Hydraulic Systems / Sistemas Hidráulicos y Neumáticos
      • Mechatronics - 7th Tetramester >
        • ME-07-English VII / Inglés VII
        • ME-07-Signal Processing and Acquisition / Adquisición y Procesamiento de Señales (PDS)
        • ME-07-Computer Assisted Engineering / Ingeniería Asistida por Computadora
        • ME-07-Project's Engineering and Management / Administración e Ingeniería de Proyectos
        • ME-07-Economic Engineering / Ingeniería Económica
        • ME-07-Control Theory / Teoría de Control
        • ME-07-Second Internships / Estancias II
      • Mechatronics - 8th Tetramester >
        • ME-08-English VIII / Inglés VIII
        • ME-08-Termodynamics / Termodinámica
        • ME-08-CAM & CNC Systems / Sistemas CAM y CNC
        • ME-08-Mechatronic Design / Diseño Mecatrónico
        • ME-08-Kinematics of Robots / Cinemática de Robots
        • ME-08-Digital Control / Control Digital
        • ME-08-Mechanical Vibrations / Vibraciones Mecánicas
      • Mechatronics - 9th Tetramester. >
        • ME-09-English IX / Inglés IX
        • ME-09-Heat Transfer / Transferencia de Calor (Mechanical)
        • ME-09-Industrial Networks / Redes Industriales
        • ME-09-Mechatronics System's Integration / Integración de Sistemas Mecatrónicos (Matlab) >
          • AM Modulation - Simulation.
        • ME-09-Robot's Dynamics and Control
        • ME-09-Intelligent Control / Control Inteligente
        • ME-09-Quality and Technological Innovation. >
          • ME-09-Evidences Folder
        • A) Robotics and Control. >
          • I.-Robotics I / F. Kinematics. >
            • I.I.-An Introduction to Robotics
          • II.-Digital Control.
        • B) Computing and Programming. >
          • I.-Setting the Kinect on Ubuntu Linux (libfreenect).
          • II.-CNC Programming >
            • II.I.-An Introduction to CNC
            • II.II.-CNC Milling.
          • C) Electronics.
    • Master in Engineering with specialty on Information Technologies >
      • pcDuino
      • Artificial Intelligence >
        • Knowledge Representation >
          • Writing ontologies (RDFS and OWL)
          • RDFLib Python
          • My First Ontology in Protegé
          • My First Ontology in Protegé II
          • Making queries
          • Where to get ontologies
        • Neural Networks >
          • Perceptrons (Linear Functions)
          • One vs All Perceptron
          • Radial Networks
        • Genetic Programming >
          • Graph Colouring using GA
          • GA for function approximation >
            • String parsing
        • Scientific computing.
        • Cellular Automata
      • Machine Learning
      • Natural Language Processing >
        • AIML Language on Python
        • Machine translation
        • Markov Chatbot
        • Python Input Timeout Bot
      • Fundamentals of Information Systems >
        • Data structures >
          • Linked lists
          • Trees >
            • Implementation Binary Search Tree
          • Sparse Distributed Memory
          • Debugging with gdb
          • Finite State Machines
        • JavaFX
      • Electronics >
        • KiCAD - My First Project
        • KiCAD - Adding components
        • kiCAD - Creating Components
        • SPICE Tutorial II
        • SPICE Tutorial II - Part II
      • VHDL >
        • Programming VHDL Part I >
          • Programming VHDL Part II
          • Loading VHDL to FPGA - Part I
          • Loading VHDL to FPGA - Part II
          • VHDL - First Steps Alternative version
        • Loops
        • Switches and leds
        • UART
        • PicoBlaze uC + FPGA
        • ADC
      • Logic Programming
    • Computing. >
      • Adding subtitles to video files
      • Server Side Programming >
        • Webhosting >
          • WordPress
        • Online Storage
        • Apache/PHP >
          • MongoDB >
            • MongoDB in Python
        • Node.js >
          • NodeJS Client requests
          • MySQL with NodeJS
      • Hyperboria
      • Angular 4
      • Smartphones >
        • Rooting Samsung Galaxy Tab 2.7.0 Model P3110 >
          • Creating Nandroid Backup with Command Line
          • Installing Ubuntu Linux on Samsung Galaxy Tab 2.7.0
          • Porting Utopic Unicorn 14.10 to tablet P3110.
        • PhoneGap - Apache Cordova >
          • Debugging PhoneGap
          • PhoneGap - MyFirstApp
          • Phone Gap - My First App II
          • Improving Look and Feel with OnsenUI >
            • AngularJS + OnsenUI + Monaca
            • Angular2 + TypeScript + OnsenUI
          • Storage in Apache Cordova & Monaca
          • Maps in PhoneGap
          • Getting user location with PhoneGap
        • QT C++ >
          • Qt signals and slots
          • QT for Android
          • QT Deployment.
        • PyQt Threads
      • Computer vision >
        • OpenGL >
          • OpenGL-HelloWorld
        • Computer Vision with Matlab/Octave
        • JavaCV
        • OpenCV
      • LaTeX >
        • Citations with Zotero + LaTeX
      • Reddit
      • Video Game creation >
        • Unity3D
        • Live2D
        • Babylon JS
    • Biochemistry.
    • Humanities >
      • Cognitive Science
      • Learning
    • Economics. >
      • Accounting
      • III.-Mexican economics.
      • Patents
    • Philosophy >
      • II. The philosophical method.
      • III. Intuition as method for philosophy.
      • IV. Comes ontology.
      • V. & VI. Parménides metaphysics and Plato's realism.
      • Extropianism.
      • Extropianism II.
      • Extropianism III.
  • ExtropyNOW! - Projects
    • MacOS X on Virtual Box
    • TankSupervision System >
      • Programming
      • Programming 2 - RXTX
      • Designing the interface
      • RXTX - Functions.
      • Keybinding - Functions.
      • FAQ
    • Homemade Projector
    • Hospital Automation App >
      • Face Recognition Part I - The basics
      • Pressure and Temperature
    • The CHAMBER Project >
      • Brain Computer Interface
      • Building the Brain (AGI) >
        • OpenCog First Application
      • Server Side Programming >
        • Tornado
        • First Django Project
        • First Django Project II
      • HA Project
      • One DOF robotic arm controlled with MS Kinect. >
        • Setting Kinect+MatLAB+Processing
        • Setting communication between MatLAB and Processing.
        • The Bibliography.
    • Madoka: Superior
  • ExtropyNOW! - Interactive
    • ExtropyNOW! - Blog
    • ExtropyNOW! - Forums
  • ExtropyNOW! - Code repository...
    • ExtropyNOW! Code Repository Part II
    • ExtropyNOW! - School repository
    • ExtropyNOW! - School repository 2 >
      • School repository 3
    • ExtropyNOW! - Interesting WebPages.
  Extropy NOW!
Contact/Contacto:

Multi class Perceptron problem

What do you do when you have to process more than two classes using the perceptron or a similar basic classifier unit? There's several approaches available to solve it, one of the most common is called the One vs All strategy.
nn_07_perceptroniris.tar.gz
File Size: 206 kb
File Type: gz
Download File

The one vs all strategy consists on using several perceptron layers to discriminate the desired traits, so that selecting one automatically eliminates the rest. In this exercise we make use of the irisSmall.arff dataset which is widely used by researchers worldwide due to being an example of three linearly separable objects that has been provided and fully tested.

Iris dataset

This dataset consists of three different classes of flowers;
  • Iris-Setosa
  • Iris-versicolor
  • Iris-virginica
These classes each possess 4 attributes that distinguish one flower from the other. These attributes are:
  • sepallength
  • sepalwidth
  • petallength
  • petalwidth
The attributes are contained in a .arff file which is an extension widely used by the Weka classifier system/library in machine learning. The classes and attributes must be parsed from the file, which looks like follows:

@RELATION irisSmall

@ATTRIBUTE sepallength    REAL
@ATTRIBUTE sepalwidth     REAL
@ATTRIBUTE petallength     REAL
@ATTRIBUTE petalwidth    REAL
@ATTRIBUTE class     {Iris-setosa,Iris-versicolor,Iris-virginica}

@DATA
5.1,3.5,1.4,0.2,Iris-setosa
4.9,3.0,1.4,0.2,Iris-setosa
4.7,3.2,1.3,0.2,Iris-setosa
7.0,3.2,4.7,1.4,Iris-versicolor
6.4,3.2,4.5,1.5,Iris-versicolor
6.9,3.1,4.9,1.5,Iris-versicolor
6.3,3.3,6.0,2.5,Iris-virginica
5.8,2.7,5.1,1.9,Iris-virginica
7.1,3.0,5.9,2.1,Iris-virginica

Neural network topology

In order to solve this problem we decided to make a huge assumption. The data provided will only concern those three flowers, that means, no weeds, no other flowers other than iris-setosa, iris-versicolor and iris-virginica. The topology of the network makes use of the hardlim function to evaluate and with this we only require to feed the four attributes to the first input networks.

The second network that discriminates the third class only receives the outputs of the first two networks as input. Figure 1 shows the network topology.

Picture
In this case we feed the real values to the input networks and readjust the weights and bias values until we find the numbers required for the network to classify between the iris-setosa vs the rest & iris-virginica vs the rest.

Then we feed those output values which are now binary numbers to the third neuron to identify if its iris-versicolor or the others.

Powered by Create your own unique website with customizable templates.