@@ -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
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
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)
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
0 commit comments