Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion scripts/train_bm4dnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ def train(train_cache_dir, val_cache_dir):
use_amp = False
use_amp_validation = False
# Validate (and consider a checkpoint) after every full-cache epoch.
val_every = 1
val_every = 1000
seed = 42

# Signal-preserving loss + target/sampling (Parts E/F). preserve_foreground
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

import logging
import fastremap
import math
import numpy as np
import os
import queue
Expand Down Expand Up @@ -77,6 +78,8 @@ def build_training_example(
transform.forward(target),
fg.astype(np.float32),
)


from aind_exaspim_image_compression.utils.swc_util import Reader


Expand Down Expand Up @@ -1312,6 +1315,9 @@ def _load_batch(self, executor, indices):
batched[j][i, 0, ...] = field
return tuple(to_tensor(arr) for arr in batched)

def __len__(self):
return math.ceil(len(self.dataset) / self.batch_size)


# --- Helpers ---
def init_datasets(
Expand Down
Loading
Loading