Skip to content

Commit

Permalink
remove support for ghostdata
Browse files Browse the repository at this point in the history
  • Loading branch information
axsk committed Feb 14, 2024
1 parent e220bfa commit 5ba17c6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
13 changes: 4 additions & 9 deletions src/data.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,16 +103,11 @@ If `reverse` is true, also take the time-reversed lag-1 data.
"""
function data_from_trajectory(xs::Matrix; reverse=false)
if reverse
ys = Array{eltype(xs)}(undef, size(xs)..., 2)
@views ys[:, 1:end-1, 1] .= xs[:, 2:end] # forward
@views ys[:, 2:end, 2] .= xs[:, 1:end-1] # backward

@views ys[:, end, 1] = ys[:, end, 2] # twice backward
@views ys[:, 1, 2] = ys[:, 1, 1] #twice forward
ys = stack([xs[:, 3:end], xs[:, 1:end-2]])
xs = xs[:, 2:end-1]
else
ys = Array{eltype(xs)}(undef, size(xs)..., 1)
@views ys[:, 1:end-1] .= xs[:, 2:end]
@views ys[:, end] .= xs[:, end] # self-reference results in 0 change to koopman
ys = xs[:, 2:end]
xs = xs[:, 1:end-1]
end
return xs, ys
end
Expand Down
1 change: 1 addition & 0 deletions src/isomolly.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ To start the actual training call the `run!` method.
- `data::T`: Data object.
- `losses`: Vector to store loss values.
- `loggers::Vector`: Vector of loggers.
- `minibatch::Int`: Size of the (shuffled) minibatches. Set to 0 to disable
"""
Base.@kwdef mutable struct IsoRun{T} # takes 10 min
Expand Down

0 comments on commit 5ba17c6

Please sign in to comment.