torch.nn.modules.linear

Members list

Grouped members

nn_linear

final class Identity[D <: DType](args: Any*)(implicit evidence$1: Default[D]) extends TensorModule[D]

A placeholder identity operator that is argument-insensitive.

A placeholder identity operator that is argument-insensitive.

Attributes

Source
Identity.scala
Supertypes
trait TensorModule[D]
trait Tensor[D] => Tensor[D]
class Module
class Object
trait Matchable
class Any
Show all
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$

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
Supertypes
trait TensorModule[ParamType]
trait Tensor[ParamType] => Tensor[ParamType]
trait HasWeight[ParamType]
trait HasParams[ParamType]
class Module
class Object
trait Matchable
class Any
Show all