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 Layer
cloneLayer()
Clone the layer, including weights and biases.InputLayer
cloneSettings()
Clone the settings.Matrix
forwardPropagate(Matrix x)
No op forward propagation.Activation
getActivation()
Return a linear activation.Matrix
getErrors(Matrix prevErrors)
No op.Matrix
getErrorsExpected(Matrix y)
No op.int
getOutSize()
Get the output size of the layer.void
initLayer(int prevSize, Activation prevActivation)
No op.void
setOptimizers(Optimizer wOptimizer, Optimizer bOptimizer)
No op.java.lang.String
toString()
Get a string representation.void
update(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:
getActivation
in classLayer
- Returns:
- a new linear activation
-
getOutSize
public int getOutSize()
Description copied from class:Layer
Get the output size of the layer.- Specified by:
getOutSize
in classLayer
- Returns:
- the output size
-
forwardPropagate
public Matrix forwardPropagate(Matrix x)
No op forward propagation.- Specified by:
forwardPropagate
in classLayer
- Parameters:
x
- input matrix- Returns:
- the same input matrix
-
setOptimizers
public void setOptimizers(Optimizer wOptimizer, Optimizer bOptimizer)
No op.- Specified by:
setOptimizers
in classLayer
- Parameters:
wOptimizer
- optimizer for weightsbOptimizer
- optimizer for biases
-
cloneLayer
public Layer cloneLayer()
Description copied from class:Layer
Clone the layer, including weights and biases.- Specified by:
cloneLayer
in classLayer
- Returns:
- the clone
-
getErrorsExpected
public Matrix getErrorsExpected(Matrix y)
No op.- Specified by:
getErrorsExpected
in 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:Layer
Get a string representation.
-
cloneSettings
public InputLayer cloneSettings()
Description copied from class:Layer
Clone the settings.This will return a layer with the same size and activation, but with randomly initialized weights and biases.
- Specified by:
cloneSettings
in classLayer
- Returns:
- the clone
-
-