Package smile.deep.layer
Class SequentialBlock
java.lang.Object
smile.deep.layer.LayerBlock
smile.deep.layer.SequentialBlock
- Direct Known Subclasses:
Conv2dNormActivation
A block of sequential layers. Layers will be added to it in the order
they are passed in the constructor. The forward() method of SequentialBlock
accepts any input and forwards it to the first layer it contains. It then
"chains" outputs to inputs sequentially for each subsequent module,
finally returning the output of the last layer.
-
Field Summary
Fields inherited from class smile.deep.layer.LayerBlock
device, dtype, module
-
Constructor Summary
ConstructorDescriptionConstructor.SequentialBlock
(String name) Constructor.SequentialBlock
(Layer... layers) Constructor. -
Method Summary
Methods inherited from class smile.deep.layer.LayerBlock
add, add, asTorch, device, dtype, eval, isTraining, load, save, to, to, toString, train
-
Constructor Details
-
SequentialBlock
public SequentialBlock()Constructor. -
SequentialBlock
Constructor.- Parameters:
name
- the module name.
-
SequentialBlock
Constructor.- Parameters:
layers
- the neural network layers.
-
-
Method Details
-
add
Adds a layer to the sequential block.- Parameters:
layer
- a layer.- Returns:
- this object.
-
forward
Description copied from interface:Layer
Forward propagation (or forward pass) through the layer.- Parameters:
input
- the input tensor.- Returns:
- the output tensor.
-