PHP Classes

File: how_does_it_works

Recommend this page to a friend!
  Classes of André Paterlini Oliveira Vieira   Perceptron   how_does_it_works   Download  
File: how_does_it_works
Role: Documentation
Content type: text/plain
Description: F.A.Q.
Class: Perceptron
Perceptron implementation for pattern recognition
Author: By
Last change: Add more tips to the explication.
Date: 20 years ago
Size: 2,881 bytes
 

Contents

Class file image Download
/**************************************************/ /* */ /* RNA - PERCEPTRON CLASS */ /* */ /**************************************************/ 1 - WHAT DOES IT DO? Perceptron is a RNA model that is, usually, used on pattern recognition applications. The most commum application we can find in our lifes is the palmtop. The palmtop uses the perceptron to recognize the words you draw on its pen pad. The palmtop must learn how the user draws some words so that it can remember how the user draws the "A", for example. To make this task even more complicated, we don't really draw the letters the same way every time, so the system must be wise enough to know that your drawing a "A" letter. 2 - HOW CAN WE USE IT ON A PHP CODE? Within this class package you will find an example code that uses perceptron to match people profiles. TeEncontro.com is nonexistant company that help people to find people that might match their life style and mood. The service works as follows: A - The main page is a web questionary composed of Yeas or No questions about the person characteristics. This page is used by the person that is looking for its twin soul. B - When the person submits the answers of the questionary, the system will generate a new list of answers changing the answers to its opposites (if question 1 had the answer "yeas" the opposite list of answers will be "no"). Then the system will merge the lists into one list. This list is then used to teach the perceptron. This is necessary to show the perceptron when the set of answers is a match (submited answers) and when it is not (inverted answers - generated by the system). After training the perceptron, the system will have a the weigths (the relevancy of each question according to the searcher profile) for each input (answers) to know either a set of answers is a match or a dismiss. C - Finally the system will sweep the hardcoded database of answers that other people submited. A score is calculated for each sweeped row of the database. If the score is positive it is a match, if the score is negative it is a dismiss. In summary, the perceptron works according to the steps: STEP1 - Training the artificial neural network: Description: Sumbit opposing patterns to the perceptron so he understands what is a match and what is not. Class function: $class->train(array input_array, int alpha, int teta). STEP2 - Finding a match: Description: Test a pattern that is unknow to you and to the system agaist the perceptron. He will either say its a match or not according to the pattern you taught him on step1. Class function: $class->test_class(array input_array, array train_result) REMEMBER: The perceptron knowledge base must be boolean.