Jannis (0.1preAlpha) | ||
Prev Class | Next Class | Frames | No Frames | |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
de.webdings.jannis.neuralnet.NeuralNet
public class NeuralNet
extends java.lang.Object
layers
.Neuron
. It accepts
only one such type at a time. So you can't mix different
neuron types in one net.
Currently only one neuron type is supported:
Field Summary | |
protected Neuron[][] |
|
protected String |
|
Constructor Summary | |
| |
| |
Method Summary | |
void |
|
void | |
void | |
void |
|
void | |
static boolean |
|
Neuron[][] | |
String |
|
void |
|
void | |
void |
|
protected Neuron[][] layers
layers
is an array containing layers of neurons. Each layer is an array containing neurons. Solayers
is the actual neural net wrapped by this class.
public NeuralNet(Class type) throws NeuronTypeMismatchException
Constructs an empty NeuralNet of the specified type.
- Parameters:
type
-
- Throws:
NeuronTypeMismatchException
-
public NeuralNet(String type) throws NeuronTypeMismatchException
Constructs an empty NeuralNet of the specified type.
- Parameters:
type
-
- Throws:
NeuronTypeMismatchException
-
public NeuralNet(Neuron layers) throws NeuronTypeMismatchException
Constructs a NeuralNet using a specified array containing layers of neurons. This constructor automatically determines the type of the neurons that the specified layers contain and rejects layers that contain neurons of unsupported types as well as layers that contain neurons of mixed types.
- Parameters:
layers
-
- Throws:
NeuronTypeMismatchException
-
public NeuralNet(Neuron aFirstInputNeuron) throws NeuronTypeMismatchException
Constructs a NeuralNet starting with a single specified neuron and automatically determines the type of this neuron. It rejects unsupported neuron types.
- Parameters:
aFirstInputNeuron
-
- Throws:
NeuronTypeMismatchException
-
public void addLayer() throws NeuronTypeMismatchException
Adds a new empty layer to the net.
- Throws:
NeuronTypeMismatchException
-
public void addLayer(Neuron l) throws NeuronTypeMismatchException
Adds the specified layer to the net.
- Parameters:
l
-
- Throws:
NeuronTypeMismatchException
-
public void addLayer(Neuron l, int layerID) throws NeuronTypeMismatchException
Adds the specified layer to the net using the specified layerID. If the net already contains a layer with this ID it (and the following layers) will be moved one step farther.
So the ID number of these layers will be increased by one.
If you don't want that, but want to replace the existing layer use the method replaceLayer.
- Parameters:
l
-layerID
-
- Throws:
NeuronTypeMismatchException
-
public void addLayers(int numberOfLayersToAdd) throws NeuronTypeMismatchException
Adds a specified number of empty layers to the net.
- Parameters:
numberOfLayersToAdd
-
- Throws:
NeuronTypeMismatchException
-
public void addNeuron(Neuron neuron, int targetLayerID) throws LowerLayersEmptyException, NeuronTypeMismatchException, BadArgumentException
Adds a neuron to the specified layer
- Parameters:
neuron
-targetLayerID
-
public static boolean areNeuronTypesConsistent(Neuron layers) throws NeuronTypeMismatchException
This static method is called by other methods and constructors to ensure that the neuron types used in this net are consistent.
- Parameters:
layers
- The layers of the net that is checked for consistency.
- Returns:
true
if only one type of Neurons is used in this net,false
if there are mixed types.
- Throws:
NeuronTypeMismatchException
- if the specified layers are empty.
public void replaceLayer(Neuron l, int layerID) throws NeuronTypeMismatchException
Replaces the layer of the specified layerID with the specified layer l.
- Parameters:
l
-layerID
-
- Throws:
NeuronTypeMismatchException
-
public void setLayers(Neuron layers) throws NeuronTypeMismatchException
This methods replaces the actual neural net wrapped by this class with the specified array. It does essentially the same as the constructor with the same parameter.
- Parameters:
layers
- The layers to set.
- Throws:
NeuronTypeMismatchException
-
public void toFile(String fileName) throws NeuronTypeMismatchException, IOException
Saves a NNML representation of the net to a file of the specified filename.
- Parameters:
fileName
-
- Throws:
NeuronTypeMismatchException
- if the neuron type of the net is not supported.
This file is part of Jannis.
Jannis is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
Jannis is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Jannis; if not, write to the
Free Software Foundation, Inc.,
51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Jannis (0.1preAlpha) |
© 2005 by Stefan Thesing;
Verbatim copying and redistribution of this entire page are permitted provided this notice is preserved.