From d49bbf89e79506b4962cc7041f0636efae04d1fb Mon Sep 17 00:00:00 2001 From: Carlo Lucibello Date: Thu, 12 Dec 2024 07:29:03 +0100 Subject: [PATCH 1/2] restrict to Float64 for AdamW --- src/rules.jl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/rules.jl b/src/rules.jl index 47c2d8c..49e07f9 100644 --- a/src/rules.jl +++ b/src/rules.jl @@ -528,11 +528,11 @@ Implemented as an [`OptimiserChain`](@ref) of [`Adam`](@ref) and [`WeightDecay`] The previous rule, which is closer to the original paper, can be obtained by setting `AdamW(..., couple=false)`. See [this issue](https://github.com/FluxML/Flux.jl/issues/2433) for more details. """ -struct AdamW{T1,T2,T3,T4} <: AbstractRule - eta::T1 - beta::T2 - lambda::T4 - epsilon::T3 +struct AdamW <: AbstractRule + eta::Float64 + beta::Float64 + lambda::Float64 + epsilon::Float64 couple::Bool end From a0353f52b5ddae2976f8da1ee1951d894639dda4 Mon Sep 17 00:00:00 2001 From: Carlo Lucibello Date: Thu, 12 Dec 2024 16:39:22 +0100 Subject: [PATCH 2/2] Update src/rules.jl --- src/rules.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rules.jl b/src/rules.jl index 49e07f9..0cd8d30 100644 --- a/src/rules.jl +++ b/src/rules.jl @@ -530,7 +530,7 @@ Implemented as an [`OptimiserChain`](@ref) of [`Adam`](@ref) and [`WeightDecay`] """ struct AdamW <: AbstractRule eta::Float64 - beta::Float64 + beta::Tuple{Float64, Float64} lambda::Float64 epsilon::Float64 couple::Bool