Skip to content

Commit 1d1d2c5

Browse files
committed
add network comparison notebook, update dataset and training script, update simulation
1 parent f1352c5 commit 1d1d2c5

17 files changed

+866
-236
lines changed

.gitignore

+7
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,19 @@ dist/
1515
data/
1616
models/
1717

18+
figures/
19+
20+
simulation/new_sim.py
21+
simulation/sim_smlm_data.py
22+
simulation/simulate_smlm.py
23+
1824
scripts/test.py
1925
scripts/*.def
2026
scripts/*.sif
2127
scripts/*.yaml
2228
scripts/quick_read.py
2329
scripts/scraps.py
30+
scripts/test_gpu.py
2431

2532
dataset/SMLMSimulatorStats.py
2633

configs/config.yaml

+6-5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
dataset:
2-
root_folder: '/home/dim26fa/data/sim_dna_tetra_31102024/'
2+
root_folder: '/home/dim26fa/data/sim_17022025/samples'
33
classes: ['all']
44
suffix: '.csv'
55
highest_shape: 500
@@ -9,7 +9,7 @@ dataset:
99
number_corners_remove: [0,1,2]
1010
remove_outliers: True
1111
anisotropy: True
12-
anisotropy_factor: 1.5
12+
anisotropy_factor: 0.6
1313
anisotropy_axis: 'z'
1414
initial_alpha: 1.0
1515
number_classes: 2
@@ -32,21 +32,22 @@ train:
3232
scheduler_patience: 20
3333
gamma: 0.0001 # for other than stepLR use smaller values e.g. 0.0001
3434
step_size: 50
35-
grid_size: 4
3635
ignore_zeros: False
3736
augmentation: True
3837
initial_alpha:
3938
loss1_improvement_threshold: 30
4039
min_improvement_epochs: 10
4140
classifier: True
4241
pretrained: False
43-
ckpt: ''
42+
#ckpt: '/home/dim26fa/coding/training/logs_pcn_20241009_225619/best_l1_cd.pth'
43+
ckpt: None
4444
autoencoder: False
4545
lambda_reg: 0.01
4646
alpha_density: 0.5
4747
beta_sparsity: 0.02
48-
num_dense: 16384
48+
num_dense: 2048
4949
latent_dim: 1024
50+
grid_size: 2
5051
pcn_config:
5152
coarse_dim: 16384
5253
fine_dim: 1024

configs/test_config.yaml

+2-1
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,6 @@ test:
3939
#ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20240807_163550/best_l1_cd.pth'
4040
#ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20240812_124453/best_l1_cd.pth'
4141
#ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20240814_165920/best_l1_cd.pth'
42-
ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20241009_225619/best_l1_cd.pth'
42+
#ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20241009_225619/best_l1_cd.pth'
43+
ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20241205_012746/best_l1_cd.pth'
4344
# ckpt_path: '/home/dim26fa/coding/training/logs_pcn_20240819_100525/best_l1_cd.pth'

dataset/SMLMDataset.py

+17-2
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,21 @@ def __getitem__(self, index):
200200
filepath = self.filepaths[index]
201201
if 'csv' in self.suffix:
202202
# Load data from file
203-
arr = np.array(pd.read_csv(filepath))[:, :3]
203+
data = pd.read_csv(filepath)[['x', 'y', 'z']]
204+
arr = np.array(data)[:, :3]
205+
if all(col in data.columns for col in ['rot_x', 'rot_y', 'rot_z', 'rot_w']):
206+
# Take first row since rotation should be same for all points
207+
rotation = np.array([
208+
data['rot_x'].iloc[0],
209+
data['rot_y'].iloc[0],
210+
data['rot_z'].iloc[0],
211+
data['rot_w'].iloc[0]
212+
])
213+
else:
214+
rotation = None
204215
elif 'pts' in self.suffix:
205216
arr = read_pts_file(filepath)[:, :3]
217+
rotation = None
206218
else:
207219
raise NotImplementedError("This data type is not implemented at the moment.")
208220
partial_arr = None
@@ -248,7 +260,10 @@ def __getitem__(self, index):
248260
'path': filepath,
249261
'label_name': cls,
250262
'corner_label': np.array(corner),
251-
'corner_label_name': corner_to_label_name[corner]}
263+
'corner_label_name': corner_to_label_name[corner]
264+
}
265+
if rotation is not None:
266+
sample['rotation'] = rotation
252267

253268
if self.transform is not None:
254269
sample = self.transform(sample)

0 commit comments

Comments
 (0)