|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.knime.base.data.neural.Perceptron
public abstract class Perceptron
Abstract class defining the behaviour of a perceptron in a neural network.
Constructor Summary | |
---|---|
Perceptron()
Construct an empty perceptron (cannot be used properly unless the weights are set). |
|
Perceptron(double[] weights)
Construct a perceptron with given weights. |
|
Perceptron(int nrInputs)
Construct a perceptron with given number of weights. |
Method Summary | |
---|---|
abstract double |
activationFunction(double in)
Activation function. |
double |
evaluate(double[] in)
Evaluates a given input for the perceptron. |
String |
getClassValue()
|
double |
getThreshold()
Returns the threshold. |
double |
getWeight(int i)
Get weight at given position. |
double[] |
getWeights()
|
abstract double |
output()
Used to get the output from all input neurons. |
static double |
random()
Returns a randomly chosen double between -1 and 1. |
static double |
scalarProduct(double[] x,
double[] y)
Computes the scalar Product of two vectors, represented as double arrays. |
void |
setClassValue(String classval)
Allows to set a class value for a perceptron (optional). |
void |
setThreshold(double threshold)
Sets the threshold. |
void |
setWeight(int i,
double weight)
Sets weight at given position. |
void |
setWeights(double[] weights)
Set all new weights. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Perceptron(int nrInputs)
nrInputs
- number of inputs for the new perceptronpublic Perceptron()
public Perceptron(double[] weights)
weights
- weights for the new perceptronMethod Detail |
---|
public double[] getWeights()
public double getWeight(int i)
i
- position
i
public void setWeights(double[] weights)
weights
- new weights to setpublic void setWeight(int i, double weight)
i
- positionweight
- new value for weight at position i
public abstract double activationFunction(double in)
in
- input value
public double evaluate(double[] in)
in
- input to evaluate
public abstract double output()
public double getThreshold()
public void setThreshold(double threshold)
threshold
- The threshold to setpublic void setClassValue(String classval)
classval
- the class value to set.public String getClassValue()
public static double random()
public static double scalarProduct(double[] x, double[] y)
x
- first arrayy
- second array
x
and y
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |