pagnani / ArDCA.jl

Autoregressive networks for protein
MIT License
31 stars 8 forks source link

save ArNet to file #23

Closed PierreBarrat closed 6 months ago

PierreBarrat commented 1 year ago

Thanks for the really nice package! A question (rather than an issue): is there any official way to save a trained model to a file to read it later? Pierre

pagnani commented 1 year ago

Hi @PierreBarrat

There is no official way to do it as of now. A practical way (but it requires installing JLD2 is the following pipeline:

  1. Saving
    julia> using  JLD2, ArDCA
    julia> arnet,arvar=ardca("CODE/ArDCA/data/PF14/PF00014_mgap6.fasta.gz");
    julia> jldsave("pf14.jld2",arnet14=arnet14, arvar14=arvar14)
  2. Loading
    julia> out=JLD2.load("pf14.jld2");

    out a dictionary with two keys: "arnet14", and "arvar14". More precisely out["arnet14"] will contain the arnet14::ArNet output of ardca and out["arvart14"] the arvar14::ArVar one.