L0 gate

QuantizedNetworks.L0GateType
struct L0Gate{T, S}

Represents an L0Gate which applies L0 regularization during neural network training.

L0Gate(logα = 10; β = 2/3, dims = :, active = nothing)

Fields

  • logα::T: Controls the strength of L0 regularization. (defaults to 10)
  • β::S: Controls "temperature" of a sigmoid function. (defaults to 2/3)
  • dims::Union{Colon, Int}: Specifies the dimensions to which L0 regularization is applied. (defaults to :)
  • active::RefValue{Union{Bool, Nothing}}: Indicates whether the L0Gate is active (regularization is applied). (defaults to nothing)
source

Functions

Flux.testmode!Function
Flux.testmode!(c::L0Gate, mode=true)

Sets the testing mode for the L0Gate object. If mode is true, it sets the active field to nothing, effectively turning off L0 regularization during testing. If mode is false, it sets the active field to true, enabling L0 regularization during testing. If mode is :auto, it toggles the active field.

source

Helper functions