dense

abstract fun dense(outputDimension: Int, id: String = "", content: DENSE<T, V>.() -> Unit = {})(source)(source)

Creates a dense (fully connected) layer with specified output dimension.

Parameters

outputDimension

The number of neurons/output features

id

Optional identifier for the layer

content

Configuration block for weights, bias, and activation


abstract fun <TLayer : DType> dense(outputDimension: Int, id: String = "", content: DENSE<TLayer, V>.() -> Unit = {}): Module<T, V>(source)(source)

Creates a dense layer with precision override and specified output dimension. This allows individual layers to use different precision than the network default.

Parameters

TLayer

The precision type for this specific layer

outputDimension

The number of neurons/output features

id

Optional identifier for the layer

content

Configuration block for weights, bias, and activation


abstract fun dense(id: String = "", content: DENSE<T, V>.() -> Unit = {})(source)(source)

Creates a dense layer without specifying output dimension (must be set in content block).

Parameters

id

Optional identifier for the layer

content

Configuration block where output dimension, weights, and bias are set


abstract fun <TLayer : DType> dense(id: String = "", content: DENSE<TLayer, V>.() -> Unit = {}): Module<T, V>(source)(source)

Creates a dense layer with precision override without specifying output dimension.

Parameters

TLayer

The precision type for this specific layer

id

Optional identifier for the layer

content

Configuration block where output dimension, weights, and bias are set