diff --git a/CHANGELOG.md b/CHANGELOG.md index 0c1adbbe9..7976be4a2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -39,6 +39,8 @@ ## Minor changes +* Expose `methods/scgpt_finetuned`'s epochs and batch size as arguments, preserving defaults of 15 and 64. + Batch size also applies to validation and embedding (issue #111). * Un-pin the scPRINT version and update parameters (PR #51) * Update scPRINT to better handle large datasets, including a new default model (PR #54) * Credit contributors missing from the authors list, and fix Martin Kim's orcid (PR #100). diff --git a/_viash.yaml b/_viash.yaml index f4a5a7c2a..08beb9d8b 100644 --- a/_viash.yaml +++ b/_viash.yaml @@ -141,6 +141,10 @@ authors: info: github: cmclean orcid: 0000-0001-9928-8216 + - name: Daesun Ryu + roles: [contributor] + info: + github: Daesun-Ryu config_mods: | .runners[.type == "nextflow"].config.labels := { lowmem : "memory = 20.Gb", midmem : "memory = 50.Gb", highmem : "memory = 100.Gb", lowcpu : "cpus = 5", midcpu : "cpus = 15", highcpu : "cpus = 30", lowtime : "time = 1.h", midtime : "time = 4.h", hightime : "time = 8.h", veryhightime : "time = 24.h" } diff --git a/src/methods/scgpt_finetuned/config.vsh.yaml b/src/methods/scgpt_finetuned/config.vsh.yaml index 631a0dfae..02149f84d 100644 --- a/src/methods/scgpt_finetuned/config.vsh.yaml +++ b/src/methods/scgpt_finetuned/config.vsh.yaml @@ -38,6 +38,20 @@ arguments: type: integer default: 3000 description: Number of highly variable genes to use. + - name: --epochs + type: integer + default: 15 + min: 1 + description: Number of fine-tuning epochs. + info: + test_default: 2 + - name: --batch_size + type: integer + default: 64 + min: 1 + description: Batch size for fine-tuning, validation and embedding. + info: + test_default: 4 resources: - type: python_script diff --git a/src/methods/scgpt_finetuned/script.py b/src/methods/scgpt_finetuned/script.py index 2583ae49f..ac1f36ac3 100644 --- a/src/methods/scgpt_finetuned/script.py +++ b/src/methods/scgpt_finetuned/script.py @@ -24,6 +24,8 @@ "model_name": "scGPT_human", "model": "scGPT_human", "n_hvg": 3000, + "epochs": 15, + "batch_size": 64, } meta = {"name": "scgpt"} ## VIASH END @@ -221,9 +223,9 @@ "ecs_thres": 0.8, # Elastic cell similarity objective, 0.0 to 1.0, 0.0 to disable "dab_weight": 1.0, # DAR objective weight for batch correction "mask_ratio": 0.4, - "epochs": 15, + "epochs": par["epochs"], "lr": 1e-4, - "batch_size": 64, + "batch_size": par["batch_size"], "dropout": 0.2, "schedule_ratio": 0.9, # Learning rate decay "log_interval": 100, @@ -364,7 +366,7 @@ adata, best_model_dir.name, gene_col="feature_name", - batch_size=64, + batch_size=par["batch_size"], use_fast_transformer=False, # Disable fast-attn as not installed device=device, return_new_adata=True,