Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GMM clustering and fixed compute pca #179

Closed
wants to merge 96 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
602e428
first draft of contrastive learning model
mattersoflight Jul 1, 2024
438895c
fixed stem and projection head, drafted lightning module
mattersoflight Jul 1, 2024
94cac32
Contrastive_dataloader (#99)
mattersoflight Jul 3, 2024
0e2fbd2
move contrastive network to viscy.representation module
mattersoflight Jul 3, 2024
41ba83b
Update hcs.py
alishbaimran Jul 3, 2024
2ec3e67
refactored class names
mattersoflight Jul 3, 2024
4da8572
correct imports
mattersoflight Jul 3, 2024
45f73a7
cleaner names for model arch and module
mattersoflight Jul 3, 2024
a933bdd
new imports
Jul 3, 2024
ae6f7ce
Merge branch 'contrastive_phenotyping' of https://github.com/mehta-la…
alishbaimran Jul 3, 2024
247cef3
Fixed epoch loss logging and WandB integration in ContrastiveModule
alishbaimran Jul 7, 2024
e7b5121
updated training_script.py
alishbaimran Jul 7, 2024
de7188b
Update hcs.py
alishbaimran Jul 7, 2024
94cd28d
contrastive.py
alishbaimran Jul 7, 2024
ebd4a78
engine.py
alishbaimran Jul 7, 2024
8162f20
script to test data i/o speed from different filesystems
mattersoflight Jul 7, 2024
2459d82
moved applications folder to viscy.applications so that pip install -…
mattersoflight Jul 7, 2024
72862e9
add resnet50 to ContrastiveEncoder
duopeng Jul 7, 2024
859de82
rename training_script.py to training_script_resnet.py
duopeng Jul 7, 2024
23bd087
test dataloader on lustre and vast
mattersoflight Jul 8, 2024
9751174
Merge remote-tracking branch 'origin/contrastive_resnet' into contras…
mattersoflight Jul 8, 2024
955fea8
move training_script_resnet to viscy.applications so that `pip instal…
mattersoflight Jul 8, 2024
f521ceb
refined the tests for contrastive dataloader
mattersoflight Jul 8, 2024
3f6d3cd
sbatch script for dataloader
mattersoflight Jul 8, 2024
346e7c5
delete redundant module
mattersoflight Jul 8, 2024
3a2a865
nits: updated the model construction of contrastive resnet encoder.
mattersoflight Jul 8, 2024
9c11b0f
Merge branch 'contrastive_phenotyping' of https://github.com/mehta-la…
alishbaimran Jul 8, 2024
675c87c
Updated training script, HCS data handling, engine, and contrastive r…
alishbaimran Jul 9, 2024
6422060
Fix normalization, visualization issues, logging and multi-channel pr…
alishbaimran Jul 11, 2024
d968334
updated training and prediction
alishbaimran Jul 16, 2024
8110e2c
update training and prediction script
alishbaimran Jul 17, 2024
68e11fd
Merge branch 'main' into contrastive_phenotyping
ziw-liu Jul 19, 2024
3961a53
formatting
ziw-liu Jul 19, 2024
22640c1
combine the application directories
ziw-liu Jul 22, 2024
5b585aa
lint
ziw-liu Jul 22, 2024
5ec5147
replace notebook with script
ziw-liu Jul 22, 2024
b061568
format script
ziw-liu Jul 22, 2024
c06ab1b
rename scripts conflicting with pytest
ziw-liu Jul 22, 2024
fd12502
lint application scripts
ziw-liu Jul 22, 2024
6312a18
do not filter all warnings
ziw-liu Jul 22, 2024
6cbebe8
log instead of print
ziw-liu Jul 22, 2024
3b7b558
split data modules by task
ziw-liu Jul 22, 2024
68d2097
clean up imports
ziw-liu Jul 22, 2024
ac43974
update typing
ziw-liu Jul 22, 2024
d03ef55
use pathlib
ziw-liu Jul 22, 2024
a520c60
remove redundant file
ziw-liu Jul 22, 2024
7d984cd
updated predict.py
alishbaimran Jul 23, 2024
b69eb2f
better typing
ziw-liu Jul 25, 2024
60ad63c
wip: triplet dataset
ziw-liu Jul 25, 2024
0cb8df0
avoid forward ref
ziw-liu Jul 26, 2024
2ac0eef
check that z range is valid
ziw-liu Jul 26, 2024
a2bc2a5
clean up and explain random sampling
ziw-liu Jul 26, 2024
b893034
sample dict instead of tuple and include track index
ziw-liu Jul 26, 2024
da4fe26
take out generic HCS methods for reuse
ziw-liu Jul 29, 2024
ac71bdd
implement TripletDataModule
ziw-liu Jul 29, 2024
0e41658
use new batch type in engine
ziw-liu Jul 29, 2024
673eb92
better typing
ziw-liu Jul 29, 2024
52df395
read normalization metadata
ziw-liu Jul 29, 2024
faaabd5
Resolve conflicts and merge changes from main
alishbaimran Aug 5, 2024
7654d71
training script w/ tensorboard logging
alishbaimran Aug 5, 2024
37b07a1
Merging code related to figures (#146)
mattersoflight Aug 28, 2024
8ebe86c
produce a report of useful visualizations to assess the dimensionalit…
mattersoflight Aug 28, 2024
6e7d61f
Remove obsolete scripts for contrastive phenotyping (#150)
ziw-liu Aug 30, 2024
1f269c7
SSL: fix MLP head and remove L2 normalization (#145)
ziw-liu Aug 31, 2024
4bfbf8b
created and updated classify_feb_embeddings.py
alishbaimran Sep 8, 2024
634b955
Module and scripts for evaluating representations (#156)
mattersoflight Sep 10, 2024
9639961
delete duplicate file
mattersoflight Sep 10, 2024
2f85eec
Merge branch 'main' into representation
ziw-liu Sep 10, 2024
083897c
lint
ziw-liu Sep 10, 2024
4521afc
fix import paths
ziw-liu Sep 10, 2024
19c4559
rename translation tests
ziw-liu Sep 10, 2024
63d9f5a
rename translation metrics
ziw-liu Sep 10, 2024
ee826b5
Sample positive and negative samples with a time offset for the tripl…
ziw-liu Sep 11, 2024
e2175b4
add fig for mitosis
Soorya19Pradeep Sep 17, 2024
2a6cd20
add script to save image patches
Soorya19Pradeep Sep 17, 2024
767b12c
add save patches as npy
Soorya19Pradeep Sep 18, 2024
2759584
save figure at 300dpi
Soorya19Pradeep Sep 18, 2024
74fa3d7
Linear probing (#160)
ziw-liu Sep 20, 2024
10219d3
Tweak attribution visualization (#170)
ziw-liu Sep 26, 2024
42a0cb5
UMAP line plot to assess temporal smoothness in features space (#176)
ziw-liu Sep 27, 2024
d5017ab
fixed import error
Soorya19Pradeep Sep 25, 2024
a58ab83
formatted with black
Soorya19Pradeep Sep 25, 2024
df9a5cd
reduce to single arrow on plot
Soorya19Pradeep Sep 27, 2024
17a2e48
remove reduntant script
Soorya19Pradeep Sep 27, 2024
ad74176
Fixes on correlation of PCA and UMAP components to computed_feature s…
Soorya19Pradeep Sep 27, 2024
582952d
updated eval module & cosine sim figures (#168)
alishbaimran Sep 27, 2024
0d6a473
GMM clustering and fixed compute pca
alishbaimran Oct 8, 2024
8e4a028
format issues fixed
alishbaimran Oct 8, 2024
1643d66
umap weights and labels
alishbaimran Oct 11, 2024
dc101ce
Ruff and black formatted
Soorya19Pradeep Oct 16, 2024
9bcb675
remove extra paths
Soorya19Pradeep Oct 16, 2024
eaa14d2
pulled changes from rep merge
alishbaimran Oct 18, 2024
f020dcf
Merge branch 'main' into clustering
alishbaimran Oct 18, 2024
c3368ba
pulled changes from main
alishbaimran Oct 18, 2024
99d43cf
pulled main changes
alishbaimran Oct 18, 2024
6996bbd
merging bugs fixed
alishbaimran Oct 18, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions applications/contrastive_phenotyping/demo_fit.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
from lightning.pytorch import Trainer
from lightning.pytorch.callbacks import ModelCheckpoint
from lightning.pytorch.loggers import TensorBoardLogger
from lightning.pytorch.callbacks import DeviceStatsMonitor


from viscy.data.triplet import TripletDataModule
from viscy.light.engine import ContrastiveModule


def main():
dm = TripletDataModule(
data_path="/hpc/projects/virtual_staining/2024_02_04_A549_DENV_ZIKV_timelapse/registered_chunked.zarr",
tracks_path="/hpc/projects/intracellular_dashboard/viral-sensor/2024_02_04_A549_DENV_ZIKV_timelapse/7.1-seg_track/tracking_v1.zarr",
source_channel=["Phase3D", "RFP"],
z_range=(20, 35),
batch_size=16,
num_workers=10,
initial_yx_patch_size=(384, 384),
final_yx_patch_size=(224, 224),
)
model = ContrastiveModule(
backbone="resnet50",
in_channels=2,
log_batches_per_epoch=2,
log_samples_per_batch=3,
)
trainer = Trainer(
max_epochs=5,
limit_train_batches=10,
limit_val_batches=5,
logger=TensorBoardLogger(
"/hpc/projects/intracellular_dashboard/viral-sensor/infection_classification/models/test_tb",
log_graph=True,
default_hp_metric=True,
),
log_every_n_steps=1,
callbacks=[ModelCheckpoint()],
profiler="simple", # other options: "advanced" uses cprofiler, "pytorch" uses pytorch profiler.
)
trainer.fit(model, dm)


if __name__ == "__main__":
main()
Loading
Loading