Skip to content

Commit 540cb9d

Browse files
authored
Merge pull request #288 from SciML/cjm-quickfixes
Minor fixes, removes and versioning
2 parents 4c5136b + 081976d commit 540cb9d

File tree

4 files changed

+9
-21
lines changed

4 files changed

+9
-21
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
name = "DataDrivenDiffEq"
22
uuid = "2445eb08-9709-466a-b3fc-47e12bd697a2"
33
authors = ["Julius Martensen <[email protected]>"]
4-
version = "0.6.5"
4+
version = "0.6.6"
55

66
[deps]
77
Compat = "34da2185-b29b-5c13-b0c7-acf172513d20"

src/basis/linear_independent.jl

Whitespace-only changes.

src/solve/sindy.jl

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,8 @@ function DiffEqBase.solve(p::DataDrivenProblem{dType}, b::Basis, opt::Optimize.A
2929

3030
# Evaluate the basis
3131
θ = b(DataDrivenDiffEq.get_oop_args(p)...)
32+
# Extract the target
33+
DX = DataDrivenDiffEq.get_target(p)
3234

3335
maxiter = maxiter <= 0 ? maximum(size(θ)) : maxiter
3436

@@ -41,9 +43,9 @@ function DiffEqBase.solve(p::DataDrivenProblem{dType}, b::Basis, opt::Optimize.A
4143
denoise ? optimal_shrinkage!') : nothing
4244

4345
# Init the coefficient matrix
44-
Ξ = DataDrivenDiffEq.Optimize.init(opt, θ', p.DX')
46+
Ξ = DataDrivenDiffEq.Optimize.init(opt, θ', DX')
4547
# Solve
46-
@views Optimize.sparse_regression!(Ξ, θ', p.DX', opt; kwargs...)
48+
@views Optimize.sparse_regression!(Ξ, θ', DX', opt; kwargs...)
4749

4850
normalize ? rescale_xi!(Ξ, scales, round) : nothing
4951

@@ -91,6 +93,8 @@ end
9193

9294
# Evaluate the basis
9395
θ = b(DataDrivenDiffEq.get_implicit_oop_args(p)...)
96+
# Extract the target
97+
DX = DataDrivenDiffEq.get_target(p)
9498

9599
maxiter = maxiter <= 0 ? maximum(size(θ)) : maxiter
96100

@@ -103,7 +107,7 @@ end
103107
denoise ? optimal_shrinkage!') : nothing
104108

105109
# Init the coefficient matrix
106-
Ξ = DataDrivenDiffEq.Optimize.init(opt, θ', p.DX')
110+
Ξ = DataDrivenDiffEq.Optimize.init(opt, θ', DX')
107111
# Find the implict variables in the equations and
108112
# eliminite duplictes
109113
if !isempty(implicits)
@@ -116,7 +120,7 @@ end
116120
@views for i in 1:size(inds, 1)
117121
# Initial progress offset
118122
offset = i*length(get_threshold(opt))
119-
Optimize.sparse_regression!(Ξ[inds[i,:], i:i], θ[inds[i,:],:]', p.DX[i:i, :]', opt; maxiter = maxiter,
123+
Optimize.sparse_regression!(Ξ[inds[i,:], i:i], θ[inds[i,:],:]', DX[i:i, :]', opt; maxiter = maxiter,
120124
progress_outer = size(inds, 1), progress_offset = offset, kwargs...)
121125
end
122126

test/basis.jl

Lines changed: 0 additions & 16 deletions
This file was deleted.

0 commit comments

Comments
 (0)