Skip to content

Commit

Permalink
Merge pull request #77 from AllenCell/npm1_64_res
Browse files Browse the repository at this point in the history
Npm1 64 res
  • Loading branch information
ritvikvasan authored Dec 13, 2024
2 parents b20fcf5 + 27c8d82 commit 6f43518
Show file tree
Hide file tree
Showing 21 changed files with 723 additions and 48 deletions.
40 changes: 40 additions & 0 deletions configs/data/npm1_64_res/classical_image_sdf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
_target_: cyto_dl.datamodules.DataframeDatamodule
_convert_: all
path: ./morphology_appropriate_representation_learning/preprocessed_data/npm1_64_res/manifest.csv
split_column: split
batch_size: 64
num_workers: 4
transforms:
- _target_: cyto_dl.dataframe.transforms.GroupCols
groups:
image: sdf_path
cell_id: CellId
- _target_: cyto_dl.image.io.ReadNumpyFile
keys:
- image
remote: false
unsqueeze: True
- _target_: monai.transforms.ThresholdIntensityd
keys:
- image
threshold: 2
above: false
cval: 2
- _target_: monai.transforms.ThresholdIntensityd
keys:
- image
threshold: -2
above: true
cval: -2
- _target_: monai.transforms.SpatialPadd
keys:
- image
spatial_size:
- 67
- 67
- 67
value: 2
- _target_: monai.transforms.ToTensord
keys:
- image
track_meta: false
28 changes: 28 additions & 0 deletions configs/data/npm1_64_res/classical_image_seg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
_target_: cyto_dl.datamodules.DataframeDatamodule
_convert_: all
path: ./morphology_appropriate_representation_learning/preprocessed_data/npm1_64_res/manifest.csv
split_column: split
batch_size: 64
num_workers: 4
transforms:
- _target_: cyto_dl.dataframe.transforms.GroupCols
groups:
image: seg_path
cell_id: CellId
- _target_: cyto_dl.image.io.ReadNumpyFile
keys:
- image
remote: false
unsqueeze: True
- _target_: monai.transforms.SpatialPadd
keys:
- image
spatial_size:
- 67
- 67
- 67
value: 0
- _target_: monai.transforms.ToTensord
keys:
- image
track_meta: false
24 changes: 24 additions & 0 deletions configs/data/npm1_64_res/pc.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
_target_: pointcloudutils.datamodules.ShapenetDataModule
dataset_folder: ./morphology_appropriate_representation_learning/preprocessed_data/npm1_64_res/pointcloud/
method: shapenet_dfnet
dataset_type: pointcloud
train_split: train
val_split: val
test_split: test
points_subsample: 20000
input_type: pointcloud
points_file: points.npz
points_iou_file: points.npz
pointcloud_n: 8192
pointcloud_noise: 0.005
pointcloud_file: pointcloud.npz
part_ratio: 0.5
partial_type: centery_random
return_idx: true
train_rotate: true
train_translate: false
train_single_trans: false
batch_size: 4
num_workers: 16
multi_files: null
x_label: pcloud
47 changes: 47 additions & 0 deletions configs/data/npm1_64_res/so3_image_sdf.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
_target_: cyto_dl.datamodules.DataframeDatamodule
_convert_: all
path: ./morphology_appropriate_representation_learning/preprocessed_data/npm1_64_res/manifest.csv
split_column: split
batch_size: 64
num_workers: 4
transforms:
- _target_: cyto_dl.dataframe.transforms.GroupCols
groups:
image: sdf_path
cell_id: CellId
- _target_: cyto_dl.image.io.ReadNumpyFile
keys:
- image
remote: false
unsqueeze: True
- _target_: monai.transforms.ThresholdIntensityd
keys:
- image
threshold: 2
above: false
cval: 2
- _target_: monai.transforms.ThresholdIntensityd
keys:
- image
threshold: -2
above: true
cval: -2
- _target_: monai.transforms.SpatialPadd
keys:
- image
spatial_size:
- 67
- 67
- 67
value: 2
- _target_: cyto_dl.image.transforms.RotationMaskd
keys:
- image
group: so3
spatial_dims: 3
mask_side: 67
background: 2
- _target_: monai.transforms.ToTensord
keys:
- image
track_meta: false
35 changes: 35 additions & 0 deletions configs/data/npm1_64_res/so3_image_seg.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
_target_: cyto_dl.datamodules.DataframeDatamodule
_convert_: all
path: ./morphology_appropriate_representation_learning/preprocessed_data/npm1_64_res/manifest.csv
split_column: split
batch_size: 64
num_workers: 4
transforms:
- _target_: cyto_dl.dataframe.transforms.GroupCols
groups:
image: seg_path
cell_id: CellId
- _target_: cyto_dl.image.io.ReadNumpyFile
keys:
- image
remote: false
unsqueeze: True
- _target_: monai.transforms.SpatialPadd
keys:
- image
spatial_size:
- 67
- 67
- 67
value: 0
- _target_: cyto_dl.image.transforms.RotationMaskd
keys:
- image
group: so3
spatial_dims: 3
mask_side: 67
background: 0
- _target_: monai.transforms.ToTensord
keys:
- image
track_meta: false
2 changes: 1 addition & 1 deletion configs/experiment/npm1/image_sdf_classical.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# python train.py experiment=example

defaults:
- override /data: other_polymorphic/classical_image_sdf.yaml
- override /data: npm1/classical_image_sdf.yaml
- override /model: image/classical_sdf_35.yaml
- override /callbacks: default.yaml
- override /trainer: default.yaml
Expand Down
54 changes: 54 additions & 0 deletions configs/experiment/npm1_64_res/image_sdf_classical.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# @package _global_

# to execute this experiment run:
# python train.py experiment=example

defaults:
- override /data: npm1_64_res/classical_image_sdf.yaml
- override /model: image/classical_sdf_64.yaml
- override /callbacks: default.yaml
- override /trainer: default.yaml
- override /logger: csv.yaml

# all parameters below will be merged with parameters from default configurations set above
# this allows you to overwrite only specified parameters

experiment_name: npm1_variance
tags: ["equivariance"]

seed: 42

data:
batch_size: 4

model:
x_label: image

trainer:
check_val_every_n_epoch: 1
min_epochs: 400
max_epochs: 2000
accelerator: gpu
devices: [0]

callbacks:
early_stopping:
monitor: val/loss

model_checkpoint:
dirpath: ./npm1_variance/ckpts
monitor: val/loss
save_top_k: 2
every_n_epochs: 1

logger:
csv:
save_dir: ./npm1_variance_64_res
name: "classical_sdf"
prefix:

##### ONLY USE WITH A100s
extras:
precision:
_target_: torch.set_float32_matmul_precision
precision: medium
55 changes: 55 additions & 0 deletions configs/experiment/npm1_64_res/image_sdf_so3.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
# @package _global_

# to execute this experiment run:
# python train.py experiment=example

defaults:
- override /data: npm1_64_res/classical_image_sdf.yaml
- override /model: image/classical_sdf_64.yaml
- override /callbacks: default.yaml
- override /trainer: default.yaml
- override /logger: csv.yaml

# all parameters below will be merged with parameters from default configurations set above
# this allows you to overwrite only specified parameters

experiment_name: npm1_variance
tags: ["equivariance"]

seed: 42

data:
batch_size: 4

model:
x_label: image
group: so3

trainer:
check_val_every_n_epoch: 1
min_epochs: 400
max_epochs: 2000
accelerator: gpu
devices: [0]

callbacks:
early_stopping:
monitor: val/loss

model_checkpoint:
dirpath: ./npm1_variance/ckpts
monitor: val/loss
save_top_k: 2
every_n_epochs: 1

logger:
csv:
save_dir: ./npm1_variance_64_res
name: "so3_sdf"
prefix:

##### ONLY USE WITH A100s
extras:
precision:
_target_: torch.set_float32_matmul_precision
precision: medium
54 changes: 54 additions & 0 deletions configs/experiment/npm1_64_res/image_seg_classical.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
# @package _global_

# to execute this experiment run:
# python train.py experiment=example

defaults:
- override /data: npm1_64_res/classical_image_seg.yaml
- override /model: image/classical_seg_64.yaml
- override /callbacks: default.yaml
- override /trainer: default.yaml
- override /logger: csv.yaml

# all parameters below will be merged with parameters from default configurations set above
# this allows you to overwrite only specified parameters

experiment_name: npm1_variance
tags: ["equivariance"]

seed: 42

data:
batch_size: 4

model:
x_label: image

trainer:
check_val_every_n_epoch: 1
min_epochs: 400
max_epochs: 2000
accelerator: gpu
devices: [0]

callbacks:
early_stopping:
monitor: val/loss

model_checkpoint:
dirpath: ./npm1_variance/ckpts
monitor: val/loss
save_top_k: 2
every_n_epochs: 1

logger:
csv:
save_dir: ./npm1_variance_64_res
name: "classical_seg"
prefix:

##### ONLY USE WITH A100s
extras:
precision:
_target_: torch.set_float32_matmul_precision
precision: medium
Loading

0 comments on commit 6f43518

Please sign in to comment.