Package one.empty3.neuralnetwork
Class Neuron
java.lang.Object
one.empty3.neuralnetwork.Neuron
- All Implemented Interfaces:
Comparable
- Direct Known Subclasses:
HiddenNeuron
,InputNeuron
,OutputNeuron
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondouble
void
addNext
(Neuron.Connection connection, Neuron neuron) int
void
compute()
double
error()
Not implemented yetdouble
error
(double[] w) Not implemented yetdouble
function()
double
getBias()
double[]
getInput()
getLayer()
int
double
double[]
getW()
void
initConstant
(double random) void
initRandom
(double random) double[]
multiply
(double[] input) boolean
read
(DataInputStream inputStream) boolean
save
(DataOutputStream outputStream) void
setActivationFunction
(ActivationFunction activationFunction) void
setActivationMethod
(ActivationMethod activationMethod) void
setBias
(double bias) void
setInput
(double[] input) void
setInputImage
(PixM pixM) void
void
setNetwork
(Net<? extends Neuron> network) void
setOutput
(double output) void
setW
(double[] w) double
sigmoid
(double[] x, double[] w) double[]
softMax
(double[] x, double[] w) void
updateW()
Not implemented yet
-
Field Details
-
input
protected double[] input -
output
protected double output -
bias
protected double bias
-
-
Constructor Details
-
Neuron
public Neuron(int length)
-
-
Method Details
-
compute
public void compute() -
getW
public double[] getW() -
setW
public void setW(double[] w) -
getInput
public double[] getInput() -
setInput
public void setInput(double[] input) -
getOutput
public double getOutput() -
setOutput
public void setOutput(double output) -
function
public double function() -
error
public double error()Not implemented yet- Returns:
- error double
-
error
public double error(double[] w) Not implemented yet- Returns:
- error double
-
updateW
public void updateW()Not implemented yet -
sigmoid
public double sigmoid(double[] x, double[] w) -
compareTo
- Specified by:
compareTo
in interfaceComparable
-
initRandom
public void initRandom(double random) -
initConstant
public void initConstant(double random) -
activation
public double activation() -
setBias
public void setBias(double bias) -
getBias
public double getBias() -
setInputImage
-
getLength
public int getLength() -
setNetwork
-
getLayer
-
setLayer
-
getNetwork
-
getActivationFunction
-
setActivationFunction
-
getActivationMethod
-
setActivationMethod
-
softMax
public double[] softMax(double[] x, double[] w) -
save
-
read
-
addNext
-
multiply
public double[] multiply(double[] input)
-