Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sparse regression example no longer working #77

Closed
patwa67 opened this issue Mar 15, 2022 · 12 comments
Closed

Sparse regression example no longer working #77

patwa67 opened this issue Mar 15, 2022 · 12 comments

Comments

@patwa67
Copy link

patwa67 commented Mar 15, 2022

I get an error when I try to run the Sparse Regression example in the documentation:
UndefVarError: FastForwardBackward not defined
getproperty(x::Module, f::Symbol) at Base.jl:35
top-level scope at ProxAlgLASSO.jl:47
eval at boot.jl:373 [inlined]

@lostella
Copy link
Member

@patwa67 are you sure you have the latest version of the package installed (0.5.0 or newer)? Running ] st ProximalAlgorithms from the REPL, in the environment you're using, should reveal it.

I can access FastForwardBackward without issues (I have 0.5.3):

julia> using ProximalAlgorithms

julia> ProximalAlgorithms.FastForwardBackward
FastForwardBackward (generic function with 1 method)

@patwa67
Copy link
Author

patwa67 commented Mar 16, 2022

I only get v0.4.1 when I try to update.

@lostella
Copy link
Member

lostella commented Mar 16, 2022 via email

@patwa67
Copy link
Author

patwa67 commented Mar 16, 2022

Yes I have StructuredOptimization installed. So the only way is to delete that one?

@lostella
Copy link
Member

lostella commented Mar 16, 2022 via email

@patwa67
Copy link
Author

patwa67 commented Mar 16, 2022

I'm having problems that gamma becomes too low so I would very much like to try the minimum_gamma option. And this was not possible with earlier versions.

@lostella
Copy link
Member

lostella commented Mar 16, 2022 via email

@patwa67
Copy link
Author

patwa67 commented Mar 16, 2022

Well, I now got another error with the update:

MethodError: no method matching prox!(::Vector{Float64}, ::NormL1{Int64}, ::Vector{Float64}, ::Float64)
Closest candidates are:
prox!(::Any, !Matched::ProximalCore.ConvexConjugate, ::Any, ::Any) at C:\Users\pwaldman20.julia\packages\ProximalCore\vQRPk\src\ProximalCore.jl:135
prox!(::Any, !Matched::ProximalCore.Zero, ::Any, ::Any) at C:\Users\pwaldman20.julia\packages\ProximalCore\vQRPk\src\ProximalCore.jl:91
prox!(::Any, !Matched::ProximalCore.IndZero, ::Any, ::Any) at C:\Users\pwaldman20.julia\packages\ProximalCore\vQRPk\src\ProximalCore.jl:112
...
prox(f::NormL1{Int64}, x::Vector{Float64}, gamma::Float64) at ProximalCore.jl:78
iterate(iter::ProximalAlgorithms.FastForwardBackwardIteration{Float64, Vector{Float64}, typeof(training_loss), NormL1{Int64}, Nothing, Nothing, Nothing}) at fast_forward_backward.jl:74
iterate at iterators.jl:159 [inlined]
iterate at iterators.jl:158 [inlined]
(::ProximalAlgorithms.IterativeAlgorithm{ProximalAlgorithms.FastForwardBackwardIteration, ProximalAlgorithms.var"#29#31"{Float64}, typeof(ProximalAlgorithms.default_solution), typeof(ProximalAlgorithms.default_display), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}})(; kwargs::Base.Pairs{Symbol, Any, Tuple{Symbol, Symbol, Symbol}, NamedTuple{(:x0, :f, :g), Tuple{Vector{Float64}, typeof(training_loss), NormL1{Int64}}}}) at ProximalAlgorithms.jl:78
(::Core.var"#Any##kw")(::NamedTuple{(:x0, :f, :g), Tuple{Vector{Float64}, typeof(training_loss), NormL1{Int64}}}, alg::ProximalAlgorithms.IterativeAlgorithm{ProximalAlgorithms.FastForwardBackwardIteration, ProximalAlgorithms.var"#29#31"{Float64}, typeof(ProximalAlgorithms.default_solution), typeof(ProximalAlgorithms.default_display), Base.Pairs{Symbol, Union{}, Tuple{}, NamedTuple{(), Tuple{}}}}) at ProximalAlgorithms.jl:77
top-level scope at ProxAlgLASSO.jl:48
eval at boot.jl:373 [inlined]

@lostella
Copy link
Member

Could you provide self-contained code snippet that generates the error? With minimal data that is (some small matrix, even random stuff)

@patwa67
Copy link
Author

patwa67 commented Mar 16, 2022

It is your Sparse Regression example in the documentation, straight off.

@patwa67
Copy link
Author

patwa67 commented Mar 16, 2022

Aha, it turned out that I had an old version of ProximalOperators also. Is it so that StucturedOptimization holds that one back also? Maybe some warnings regarding this. Anyway, the example works now.

@patwa67 patwa67 closed this as completed Mar 16, 2022
@lostella
Copy link
Member

Ha! True, that’s a hard one to spot! Not sure how to best give a warning about this, given that there’s no dependency between the packages now.

Definitely some hint in the documentation though. I’ll open an issue for that, it should be made clear.

Anyhow, happy that things worked out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants