Package smile.deep.layer
Class LayerBlock
java.lang.Object
smile.deep.layer.LayerBlock
- Direct Known Subclasses:
EfficientNet
,FusedMBConv
,MBConv
,SequentialBlock
,SqueezeExcitation
A block is combinations of one or more layers. Blocks form the basis of
more complex network designs. LayerBlock allows treating the whole
container as a single layer, such that performing a transformation on
the LayerBlock applies to each of the layers it contains (which are each
a registered submodule of the block).
-
Constructor Summary
ConstructorDescriptionConstructor.LayerBlock
(String name) Constructor.LayerBlock
(org.bytedeco.pytorch.Module module) Constructor. -
Method Summary
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
Methods inherited from interface smile.deep.layer.Layer
apply, forward, isTraining
-
Constructor Details
-
LayerBlock
public LayerBlock()Constructor. -
LayerBlock
Constructor.- Parameters:
name
- the module name.
-
LayerBlock
public LayerBlock(org.bytedeco.pytorch.Module module) Constructor.- Parameters:
module
- a module.
-
-
Method Details
-
asTorch
public org.bytedeco.pytorch.Module asTorch()Description copied from interface:Layer
Returns the PyTorch Module object. -
toString
-
add
Adds a sub-layer.- Parameters:
name
- the name of sub-layer.layer
- the sub-layer.- Returns:
- this object.
-
add
Adds a sub-layer.- Parameters:
name
- the name of sub-layer.layer
- the sub-layer.- Returns:
- this object.
-