Linear
torch.nn.modules.linear.Linear
final class Linear[ParamType <: FloatNN](inFeatures: Long, outFeatures: Long, addBias: Boolean)(implicit evidence$1: Default[ParamType]) extends HasParams[ParamType], HasWeight[ParamType], TensorModule[ParamType]
Applies a linear transformation to the incoming data: $y = xA^T + b$
This module supports TensorFloat32<tf32_on_ampere>
.
Example:
import torch.*
val linear = nn.Linear[Float32](20, 30)
val input = torch.rand(Seq(128, 20))
println(linear(input).size) // ArraySeq(128, 30)
Value parameters
- bias
-
If set to
false
, the layer will not learn an additive bias. Default:true
- inFeatures
-
size of each input sample
- outFeatures
-
size of each output sample
Attributes
- Source
- Linear.scala
- Graph
-
- Supertypes
Members list
Value members
Concrete methods
Attributes
- Source
- Linear.scala
Attributes
- Source
- Linear.scala
Attributes
- Source
- Linear.scala
Attributes
- Definition Classes
- Source
- Linear.scala
Returns a string representation of the object.
Returns a string representation of the object.
The default representation is platform dependent.
Attributes
- Returns
-
a string representation of the object.
- Definition Classes
- Source
- Linear.scala
Attributes
- Source
- Linear.scala
Attributes
- Source
- Linear.scala
Inherited methods
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- HasParams
- Source
- Module.scala
Attributes
- Definition Classes
- Inherited from:
- HasParams
- Source
- Module.scala
Attributes
- Definition Classes
- Inherited from:
- HasParams
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Adds a buffer to the module.
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
Attributes
- Inherited from:
- Module
- Source
- Module.scala
In this article