Linear

class Linear<T : DType, V> @JvmOverloads constructor(inFeatures: Int, outFeatures: Int, val name: String = "Linear", initWeights: Tensor<T, V>, initBias: Tensor<T, V>, val trainable: Boolean = true) : Module<T, V> , ModuleParameters<T, V> (source)

Linear layer (a.k.a. fully connected dense layer). This layer applies a linear transformation to the input data. The weights and biases are learned during training.

Parameters

inFeatures

Number of input features

outFeatures

Number of output features

name

Name of the module

initWeights

Initial weights

initBias

Initial bias

Constructors

Link copied to clipboard
constructor(inFeatures: Int, outFeatures: Int, name: String = "Linear", initWeights: Tensor<T, V>, initBias: Tensor<T, V>, trainable: Boolean = true)

Properties

Link copied to clipboard
open override val modules: List<Module<T, V>>
Link copied to clipboard
open override val name: String
Link copied to clipboard
open override val params: List<ModuleParameter<T, V>>

Parameters owned by this node (weights, biases, etc.).

Link copied to clipboard