public class Layer extends java.lang.Object implements Storable
| Constructor and Description |
|---|
Layer()
Constructs an empty layer.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMap(Map map)
Adds a map to this layer.
|
protected void |
addMap(Map map,
int depth)
Adds a map in depth to this layer.
|
boolean |
connect(Layer layer)
Connects this layer with the given layer.
|
void |
disconnect()
Disconnects this layer from the previous layer.
|
void |
fromXML(org.jdom2.Element element)
Reads attributes from XML tree.
|
int |
getDepth()
Returns the depth of the layer, i.e., the number of maps/channels/filters.
|
int |
getHeight()
Returns the height of the first map (channel 0).
|
int |
getLevel()
Returns the level of the layer.
|
int |
getLinkCount()
Returns the the number of links into this layer.
|
int |
getMapCount()
Returns the number of maps in this layer.
|
java.util.ArrayList<Map> |
getMaps()
Returns the maps of this layer.
|
protected Neuron |
getNeuron(int row,
int col,
int chan)
Returns the neuron with given coordinates.
|
NeuronList |
getNeurons()
Returns the neurons in this layer.
|
int |
getSize()
Returns the size of this layer, i.e., the number of neurons.
|
int |
getWidth()
Returns the width of the first map (channel 0).
|
protected Map |
removeMap(int i)
Removes the map with given index from this layer.
|
protected void |
setIOType(boolean in,
boolean out)
Sets the layer maps' IO status.
|
void |
setLevel(int level)
Sets the level (number) of the layer.
|
java.lang.String |
toString()
Returns the maps of this layer.
|
org.jdom2.Element |
toXML(org.jdom2.Element element)
Returns an XML element containing information on the layer.
|
public int getWidth()
public int getHeight()
public int getDepth()
public int getSize()
public int getLevel()
public void setLevel(int level)
level - the level/layer numberpublic NeuronList getNeurons()
public java.util.ArrayList<Map> getMaps()
public void addMap(Map map)
map - a mapprotected void addMap(Map map, int depth)
map - a mapprotected Map removeMap(int i)
i - the indexpublic int getMapCount()
public int getLinkCount()
protected void setIOType(boolean in,
boolean out)
in - true, if input layerout - true, if output layerprotected Neuron getNeuron(int row, int col, int chan)
row - the row of the neuron (0 to width - 1)col - the column of the neuron (0 to height - 1)chan - the map/channel of the neuron (0 to depth - 1)public boolean connect(Layer layer)
layer - another layerpublic void disconnect()
public void fromXML(org.jdom2.Element element)
public org.jdom2.Element toXML(org.jdom2.Element element)
public java.lang.String toString()
toString in class java.lang.Object