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

LotkaVolterra manifest file outdated #36

Open
jd-lara opened this issue Jun 22, 2021 · 12 comments
Open

LotkaVolterra manifest file outdated #36

jd-lara opened this issue Jun 22, 2021 · 12 comments

Comments

@jd-lara
Copy link

jd-lara commented Jun 22, 2021

Looks like the LotkaVolterra example folder has an outdated and invalid Manifest file with an old reference to a master of DataDrivenDiffEq

[2445eb08] DataDrivenDiffEq v0.5.5 `https://github.com/SciML/DataDrivenDiffEq.jl.git#master`

It also seems to have a lot of packages that aren't part of the experiment and there is no Project.toml

@ChrisRackauckas
Copy link
Owner

@AlCap23 did you update the project/manifest with the last update?

@AlCap23
Copy link
Collaborator

AlCap23 commented Jul 2, 2021

Ah. Nope. Not right now. I have to fix some issues on the current versioning of DataDriven due to the SymbolicArray introduction and will update within the next few hrs.

@AlCap23
Copy link
Collaborator

AlCap23 commented Jul 3, 2021

Not everything, but the most important parts are working again.

I took the liberty to tag the current status as a release, since the optimization hyperparameters / sparse optimizers changed.

@HenriLaurie
Copy link

I think I have a related problem. According to the stacktrace, the error is thrown from the following line

nn_problem = ContinuousDataDrivenProblem(X̂, tsample, DX = Ŷ)

saying that collocate_data is given a type signature it has no method for:

MethodError: no method matching collocate_data(::Matrix{Float32}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ::InterpolationMethod{UnionAll})
Closest candidates are:
  collocate_data(::AbstractVector{T} where T, ::AbstractVector{T} where T, ::AbstractVector{T} where T, ::InterpolationMethod) at /home/henri/.julia/packages/DataDrivenDiffEq/Kd4Hy/src/utils/collocation.jl:216
  collocate_data(::Any, ::Any, ::Any) at /home/henri/.julia/packages/DataDrivenDiffEq/Kd4Hy/src/utils/collocation.jl:187
  collocate_data(::Any, ::Any, ::InterpolationMethod) at /home/henri/.julia/packages/DataDrivenDiffEq/Kd4Hy/src/utils/collocation.jl:214

You may remember last year I used this example for teaching, this year the same.

@AlCap23
Copy link
Collaborator

AlCap23 commented Jul 27, 2021

Hi! This is strange, I cannot reproduce this. Could you provide a more extensive minimal example?

If I just do

using DataDrivenDiffEq
using LinearAlgebra

X = randn(2,100)
t = 0.0:1.0:99
DX = randn(2,100)

prob = ContinuousDataDrivenProblem(X, t, DX = DX)

I don't get an error, as it should be. Maybe I need to check on the dispatch. Otherwise, you could also use

prob = ContinuousDataDrivenProblem(X, DX, t = t)

@HenriLaurie
Copy link

Well, unfortunately that will take time. I'll try to get the relevant inputs as data.

@HenriLaurie
Copy link

By the way I am a bit preoccupied, thanks for the help.

@HenriLaurie
Copy link

No idea why, but this is what happened:

I reproduced the error in a notebook with nothing but hudson_bay.jl code, except that the two matrices in the call were written to files and read back in.

I then did what you did above, in a new context, reading in the matrix data from the same files. No error.

Might the difference be the code loading?

I get the following mysterious message after the using statements in hudson_bay.jl:

 Activating environment at `~/WorkInProgress/ODEswithJulia2021/Week 3/Project.toml`
┌ Info: DataDrivenDiffEq : OccamNet is available.
└ @ DataDrivenDiffEq /home/henri/.julia/packages/DataDrivenDiffEq/Kd4Hy/src/DataDrivenDiffEq.jl:140

... no such message after using DelimitedFiles, LinearAlgebra, DataDrivenDiffEq in the minimal, non-erroring context.

@HenriLaurie
Copy link

I should add that replacing
nn_problem = ContinuousDataDrivenProblem(X̂, tsample, DX = Ŷ)
with
nn_problem = ContinuousDataDrivenProblem(X̂, tsample, Ŷ)
removes the error message.

@HenriLaurie
Copy link

HenriLaurie commented Jul 28, 2021

Here, finally, a MWE:

using LinearAlgebra, DataDrivenDiffEq

tsample = 0.0:0.5:20.0
X = rand(Float32, 2, 41)
Y = rand(Float32, 2, 41)

nn_problem = ContinuousDataDrivenProblem(X, tsample, DX=Y)

gives the error

MethodError: no method matching collocate_data(::Matrix{Float32}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ::StepRangeLen{Float64, Base.TwicePrecision{Float64}, Base.TwicePrecision{Float64}}, ::InterpolationMethod{UnionAll})

Sorry about the toothless mouthing of this problem!

@AlCap23
Copy link
Collaborator

AlCap23 commented Jul 28, 2021

No worries. I just pasted it into the REPL and was able to reproduce the error.

This is due to the type of tsample being Float64 while the data in X and Y is Float32. I do need to fix this in the collocation call ( promote type earlier than on the construction of the Problem).

Changing it into

nn_problem = ContinuousDataDrivenProblem(X, Float32.(tsample), DX=Y)

Works for me.

@HenriLaurie
Copy link

HenriLaurie commented Jul 28, 2021 via email

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

No branches or pull requests

4 participants