Hi,
as I described my situation here, I’m trying to use DiffOpt.jl for my custom neural network training.
I realised that if I can use logsumexp
function to express the objective function, I can make it.
However, I can’t find any logsumexp
for JuMP.
For example, if I use Flux.logsumexp
, it says something like this:
ERROR: MethodError: no method matching isless(::AffExpr, ::AffExpr)
Closest candidates are:
isless(::Any, ::Missing) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/missing.jl:88
isless(::Missing, ::Any) at /Applications/Julia-1.7.app/Contents/Resources/julia/share/julia/base/missing.jl:87
Stacktrace:
[1] max(x::AffExpr, y::AffExpr)
@ Base operators.jl:492
[2] mapreduce_impl(f::typeof(identity), op::typeof(max), A::Matrix{AffExpr}, first::Int64, last::Int64)
@ Base reduce.jl:635
[3] _mapreduce(f::typeof(identity), op::typeof(max), #unused#::IndexLinear, A::Matrix{AffExpr})
@ Base reduce.jl:417
[4] _mapreduce_dim(f::typeof(identity), op::typeof(max), #unused#::Base._InitialValue, A::Matrix{AffExpr}, #unused#::Colon)
@ Base reducedim.jl:330
[5] mapreduce(f::typeof(identity), op::typeof(max), A::Matrix{AffExpr}; dims::Colon, init::Base._InitialValue)
@ Base reducedim.jl:322
[6] mapreduce(f::typeof(identity), op::typeof(max), A::Matrix{AffExpr})
@ Base reducedim.jl:322
[7] _maximum(f::typeof(identity), a::Matrix{AffExpr}, ::Colon; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base reducedim.jl:894
[8] _maximum(f::typeof(identity), a::Matrix{AffExpr}, ::Colon)
@ Base reducedim.jl:894
[9] _maximum(a::Matrix{AffExpr}, ::Colon; kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base reducedim.jl:893
[10] _maximum(a::Matrix{AffExpr}, ::Colon)
@ Base reducedim.jl:893
[11] maximum(a::Matrix{AffExpr}; dims::Colon, kw::Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}})
@ Base reducedim.jl:889
[12] (::Base.var"#maximum##kw")(::NamedTuple{(:dims,), Tuple{Colon}}, ::typeof(maximum), a::Matrix{AffExpr})
@ Base reducedim.jl:889
[13] logsumexp(x::Matrix{AffExpr}; dims::Colon)
@ NNlib ~/.julia/packages/NNlib/tvMmZ/src/softmax.jl:142
[14] logsumexp(x::Matrix{AffExpr})
@ NNlib ~/.julia/packages/NNlib/tvMmZ/src/softmax.jl:142
[15] infer_test(nn::PLSE)
@ Main ~/.julia/dev/ParametrisedConvexApproximators/test/tmp.jl:36
Is there any workaround for this?