Skip to content

Commit 59e42e5

Browse files
GSOC 2025 Final PR Edits.
1 parent 14dab14 commit 59e42e5

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/advancedHMC_MCMC.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,12 +430,14 @@ function ahmc_bayesian_pinn_ode(
430430
error("Invalid dataset for Inverse solve. The dataset would be a timeseries (x̂,t) with type: Vector{Vector{AbstractFloat}}")
431431
end
432432

433-
# if the above error is not triggered (this means atleast L2 is valid).
433+
# if the above errors is not triggered -> (this means atleast L2 is valid: we have x, t in the dataset) && (if estim_collocate was true then W is also present)
434434
# We must pad the dataset with a dummy W column (this ensures correct dataset
435435
# index referencing in all methods except the Data Quadrature loss).
436-
if (length(dataset) < 2 || !(dataset isa Vector{<:Vector{<:AbstractFloat}}))
437-
@info "Padding the dataset with a uniform W = 1 weights column"
436+
# do the below only if estim_collocate is false, so that L2 loss dataset access is correct.
437+
if (length(dataset) < 3 || !(dataset isa Vector{<:Vector{<:AbstractFloat}})) &&
438+
!estim_collocate
438439
dataset = vcat(dataset, ones(length(dataset[end])))
440+
@info "Padding the dataset with a uniform W = 1 weights column."
439441
end
440442
end
441443

0 commit comments

Comments
 (0)