cellarium-ai / cellarium-ml

Distributed single-cell data analysis.
BSD 3-Clause "New" or "Revised" License
22 stars 3 forks source link

Initiate a ZScore transform directly from a OnePassMeanVarStd checkpoint file #241

Open sjfleming opened 2 months ago

sjfleming commented 2 months ago

Instead of this, which is error prone

    - class_path: cellarium.ml.transforms.ZScore
      init_args:
        mean_g:
          !CheckpointLoader
          file_path: /home/jupyter/trained_models/onepass/lightning_logs/version_0/checkpoints/epoch=0-step=249.ckpt
          attr: model.mean_g
          convert_fn: null
        std_g:
          !CheckpointLoader
          file_path: /home/jupyter/trained_models/onepass/lightning_logs/version_0/checkpoints/epoch=0-step=249.ckpt
          attr: model.std_g
          convert_fn: null
        var_names_g:
          !CheckpointLoader
          file_path: /home/jupyter/trained_models/onepass/lightning_logs/version_0/checkpoints/epoch=0-step=249.ckpt
          attr: model.var_names_g
          convert_fn: null

allow this kind of thing

    - class_path: cellarium.ml.transforms.ZScore
      init_args:
        onepass_mean_var_std_ckpt:
          !CheckpointLoader
          file_path: /home/jupyter/trained_models/onepass/lightning_logs/version_0/checkpoints/epoch=0-step=249.ckpt
sjfleming commented 2 months ago

See if there are other opportunities to do this kind of thing