Dropout

class Dropout<T : DType, V>(val p: Float = 0.5f, var training: Boolean = true, val name: String = "Dropout") : Module<T, V> (source)

Dropout layer that is aware of ExecutionContext phases.

Current implementation keeps identity semantics on both TRAIN and EVAL phases, but exposes a context-aware forward that can later be extended to apply stochastic masking when ctx.inTraining is true.

Constructors

Link copied to clipboard
constructor(p: Float = 0.5f, training: Boolean = true, name: String = "Dropout")

Properties

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

Human-readable name of the node, typically the module's name.

Link copied to clipboard
val p: Float
Link copied to clipboard

Functions

Link copied to clipboard
open override fun forward(input: Tensor<T, V>, ctx: ExecutionContext): Tensor<T, V>

Context-aware forward that can use ExecutionContext.phase. Hooks are dispatched if available.