jiweiqi / CellBox.jl

CellBox in Julia
MIT License
3 stars 1 forks source link

Using single time steps (ntotal=1) leads to bad plotting #6

Closed DesmondYuan closed 3 years ago

DesmondYuan commented 3 years ago

i_exp_77

What should be the best way to fix this? @jiweiqi

jiweiqi commented 3 years ago

A quick workaround is passing additional arguments to the prediction to disable the saveat, instead of output all of the inner datapoints. https://github.com/jiweiqi/CellBox.jl/blob/main/spilt/network.jl#L65 Change the plotting functions as well.

Something like

function predict_neuralode(u0, p, i_exp=1, batch=ntotal; dense=false)
    global μ = μ_list[i_exp, 1:ns]
    _prob = remake(prob, p=p, tspan=[0, ts[batch]])
    pred = Array(solve(_prob, Tsit5(), saveat=ts[1:batch], sensealg=InterpolatingAdjoint()))
    return pred
end
DesmondYuan commented 3 years ago

Sounds perfect. Let me implement it and test

DesmondYuan commented 3 years ago

Implemented in 4a0711b301e5410d8d7a8e5793040d0706b739c1

i_exp_7