|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.ai.Perceptron
public class Perceptron
Perceptron implements a simple pattern classifier. The Perceptron is an enhanced TLU (Threshold Logic Unit) based on the works by Rosenblatt (Rosenblatt, F. (1962). Principles of Neurodynamics. Spartan Books.). The given implementation here uses boolean values to enforce the duality of the values otherwise represented with 0 and 1. For the purpose of this implementation, false equals 0 and true equals 1. The Perceptron's capability of learning to distinguish two classes (here: not a Java class) of patterns is limited to classes that are linearly separable.
| Constructor Summary | |
|---|---|
Perceptron(int threshold,
int numberOfInputs)
|
|
| Method Summary | |
|---|---|
protected Object |
clone()
overrides Object.clone() to deep-copy the weight array |
boolean |
compute(boolean[] input)
|
int |
getLength()
|
int |
getThreshold()
|
int |
getWeight(int index)
|
void |
learn(boolean[] input,
boolean result)
learns a specified output given the input vector by adjusting the synapses (weights) if the result to be learned does not match the actual current output |
static void |
main(String[] args)
testing app |
protected void |
setThreshold(int threshold)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Perceptron(int threshold,
int numberOfInputs)
| Method Detail |
|---|
public boolean compute(boolean[] input)
public void learn(boolean[] input,
boolean result)
protected void setThreshold(int threshold)
public int getThreshold()
public int getLength()
public int getWeight(int index)
protected Object clone()
throws CloneNotSupportedException
clone in class ObjectCloneNotSupportedExceptionpublic static void main(String[] args)
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||