Package me.yixqiao.jlearn.layers
Class InputLayer
- java.lang.Object
-
- me.yixqiao.jlearn.layers.Layer
-
- me.yixqiao.jlearn.layers.InputLayer
-
- All Implemented Interfaces:
java.io.Serializable
public class InputLayer extends Layer
Layer for input.Basically all functions are no-ops.
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description InputLayer(int size)Create an input layer.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description LayercloneLayer()Clone the layer, including weights and biases.InputLayercloneSettings()Clone the settings.MatrixforwardPropagate(Matrix x)No op forward propagation.ActivationgetActivation()Return a linear activation.MatrixgetErrors(Matrix prevErrors)No op.MatrixgetErrorsExpected(Matrix y)No op.intgetOutSize()Get the output size of the layer.voidinitLayer(int prevSize, Activation prevActivation)No op.voidsetOptimizers(Optimizer wOptimizer, Optimizer bOptimizer)No op.java.lang.StringtoString()Get a string representation.voidupdate(Matrix errors)No op.
-
-
-
Method Detail
-
initLayer
public void initLayer(int prevSize, Activation prevActivation)No op.
-
getActivation
public Activation getActivation()
Return a linear activation.- Specified by:
getActivationin classLayer- Returns:
- a new linear activation
-
getOutSize
public int getOutSize()
Description copied from class:LayerGet the output size of the layer.- Specified by:
getOutSizein classLayer- Returns:
- the output size
-
forwardPropagate
public Matrix forwardPropagate(Matrix x)
No op forward propagation.- Specified by:
forwardPropagatein classLayer- Parameters:
x- input matrix- Returns:
- the same input matrix
-
setOptimizers
public void setOptimizers(Optimizer wOptimizer, Optimizer bOptimizer)
No op.- Specified by:
setOptimizersin classLayer- Parameters:
wOptimizer- optimizer for weightsbOptimizer- optimizer for biases
-
cloneLayer
public Layer cloneLayer()
Description copied from class:LayerClone the layer, including weights and biases.- Specified by:
cloneLayerin classLayer- Returns:
- the clone
-
getErrorsExpected
public Matrix getErrorsExpected(Matrix y)
No op.- Specified by:
getErrorsExpectedin classLayer- Parameters:
y- expected outputs- Returns:
- null
-
update
public void update(Matrix errors)
No op. Nothing is updated.
-
toString
public java.lang.String toString()
Description copied from class:LayerGet a string representation.
-
cloneSettings
public InputLayer cloneSettings()
Description copied from class:LayerClone the settings.This will return a layer with the same size and activation, but with randomly initialized weights and biases.
- Specified by:
cloneSettingsin classLayer- Returns:
- the clone
-
-