Skip to content

Commit ee7c8ae

Browse files
committed
fix aqua tests
1 parent 6874197 commit ee7c8ae

File tree

3 files changed

+12
-15
lines changed

3 files changed

+12
-15
lines changed

src/regularized/abstract_regularized.jl

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ with g and h functions of y.
3232
3333
- `(regularized::AbstractRegularized)(θ; kwargs...)`: return `ŷ(θ)`
3434
- `compute_regularization(regularized, y)`: return `Ω(y)`
35-
36-
# Available implementations
37-
38-
- [`SoftArgmax`](@ref)
39-
- [`SparseArgmax`](@ref)
40-
- [`RegularizedFrankWolfe`](@ref)
35+
- `get_maximizer(regularized)`: return the associated `GeneralizedMaximizer` optimizer
4136
"""
4237
abstract type AbstractRegularizedGeneralizedMaximizer <: AbstractRegularized end
4338

@@ -48,16 +43,18 @@ Return the convex penalty `Ω(y)` associated with an `AbstractRegularized` layer
4843
"""
4944
function compute_regularization end
5045

46+
"""
47+
get_maximizer(regularized)
48+
49+
Return the associated optimizer.
50+
"""
51+
function get_maximizer end
52+
5153
@required AbstractRegularized begin
5254
#(regularized::AbstractRegularized)(θ::AbstractArray; kwargs...)
5355
compute_regularization(::AbstractRegularized, ::AbstractArray)
5456
end
5557

56-
"""
57-
TODO
58-
"""
59-
function get_maximizer end
60-
6158
@required AbstractRegularizedGeneralizedMaximizer begin
6259
get_maximizer(::AbstractRegularizedGeneralizedMaximizer)
6360
end

src/regularized/soft_argmax.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Corresponds to regularized prediction on the probability simplex with entropic p
77
"""
88
struct SoftArgmax <: AbstractRegularized end
99

10-
(::SoftArgmax)(z; kwargs...) = soft_argmax(z)
11-
compute_regularization(::SoftArgmax, y) = soft_argmax_regularization(y)
10+
(::SoftArgmax)(z::AbstractVector; kwargs...) = soft_argmax(z)
11+
compute_regularization(::SoftArgmax, y::AbstractVector) = soft_argmax_regularization(y)
1212

1313
function soft_argmax(z::AbstractVector)
1414
s = exp.(z)

src/regularized/sparse_argmax.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ Corresponds to regularized prediction on the probability simplex with square nor
77
"""
88
struct SparseArgmax <: AbstractRegularized end
99

10-
(::SparseArgmax)(z; kwargs...) = sparse_argmax(z)
11-
compute_regularization(::SparseArgmax, y) = sparse_argmax_regularization(y)
10+
(::SparseArgmax)(z::AbstractVector; kwargs...) = sparse_argmax(z)
11+
compute_regularization(::SparseArgmax, y::AbstractVector) = sparse_argmax_regularization(y)
1212

1313
function sparse_argmax(z::AbstractVector; kwargs...)
1414
p, _ = simplex_projection_and_support(z)

0 commit comments

Comments
 (0)