|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectneural.net.Layer
public class Layer
Represents a layer of neurons within an Artificial Neural Net
Constructor Summary | |
---|---|
Layer(int neuronCount,
int inputCountPerNeuron,
ActivationFunction activationFunction)
Constructor |
Method Summary | |
---|---|
double[] |
fire(double[] inputs)
Fire the layer of neurons, loops through each neuron in the layer and fires it |
double[] |
getLastOutputs()
Get the output from the last fire() |
Neuron |
getNeuron(int id)
Get a specific neuron in the layer |
int |
getNeuronCount()
Get number of neurons in the layer |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Layer(int neuronCount, int inputCountPerNeuron, ActivationFunction activationFunction)
neuronCount
- - number of neurons in the layerinputCountPerNeuron
- - number of inputs for each neuron in the layeractivationFunction
- - class implementing ActivationFunction, used to calculate activation value of neuronMethod Detail |
---|
public int getNeuronCount()
public Neuron getNeuron(int id) throws java.lang.Exception
id
- - the neuron to get
java.lang.Exception
- - throws an exception if id is out of boundspublic double[] getLastOutputs()
public double[] fire(double[] inputs) throws java.lang.Exception
inputs
- - input to pass to each neuron
java.lang.Exception
- - throws an exception if inputs length is invalid
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |