Package ai.djl.nn.core
Class Linear.Builder
- java.lang.Object
-
- ai.djl.nn.core.Linear.Builder
-
- Enclosing class:
- Linear
public static final class Linear.Builder extends java.lang.Object
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Linear
build()
Returns the constructedLinear
.Linear.Builder
optBias(boolean bias)
Sets the optional parameter that indicates whether to include a bias vector with default value of true.Linear.Builder
setUnits(long units)
Sets the number of output channels.
-
-
-
Method Detail
-
setUnits
public Linear.Builder setUnits(long units)
Sets the number of output channels.- Parameters:
units
- the number of desired output channels- Returns:
- this Builder
-
optBias
public Linear.Builder optBias(boolean bias)
Sets the optional parameter that indicates whether to include a bias vector with default value of true.- Parameters:
bias
- whether to use a bias vector parameter- Returns:
- this Builder
-
build
public Linear build()
Returns the constructedLinear
.- Returns:
- the constructed
Linear
- Throws:
java.lang.IllegalArgumentException
- if all required parameters (outChannels) have not been set
-
-