You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionsave(file,uf::T;compress=false) where T<:UnfoldModeljldopen(file, "w"; compress = compress) do f
f["uf"] =T(uf.design,Unfold.DesignMatrix(designmatrix(uf).formulas,missing,designmatrix(uf).events),uf.modelfit)
endendfunctionload(file,::Type{<:UnfoldModel})
f =jldopen(file, "r")
uf = f["uf"]
form =designmatrix(uf).formulas
events =designmatrix(uf).events
X = Unfold.modelcols(form.rhs, events)
# reintegrate the designmatrixreturntypeof(uf)(uf.design,Unfold.DesignMatrix(form,X,events),uf.modelfit)
end
@jschepers can you try this out with an realistic UnfoldFile?
These tools might be helpful:
pretty_filesize(x) = Base.format_bytes(filesize(x))
pretty_summarysize(x) = Base.format_bytes(Base.summarysize(x))
@timesave(joinpath(tempdir(),"test3.jld2"),m;compress=true)
@timesave(joinpath(tempdir(),"test4.jld2"),m;compress=false)
begin
sizex = x->pretty_filesize(joinpath(tempdir(),"test$x.jld2"))
@showpretty_summarysize(m)
for k =1:4@showsizex(k)
endend@time m2 =load(joinpath(tempdir(),"test4.jld2"),UnfoldModel)
m.designmatrix.Xs == m2.designmatrix.Xs
Saved files can be quite large - play around with @save filename.JLD2 {compress} ??
Check why files of a single subject with 128 channels can be 2gb large - seems too big
The text was updated successfully, but these errors were encountered: