Skip to content

Commit

Permalink
clean up. rename. remove print
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffwoollard committed Jul 10, 2024
1 parent e33801a commit 2730734
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
1 change: 0 additions & 1 deletion src/cryo_challenge/_map_to_map/map_to_map_distance.py
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,6 @@ def compute_cost_fsc_chunk(maps_gt_flat, maps_user_flat, n_pix):
cost_matrix = torch.empty(len(maps_gt_flat), len(maps_user_flat))
fsc_matrix = torch.zeros(len(maps_gt_flat), len(maps_user_flat), n_pix // 2)
for idx in range(len(maps_gt_flat)):
print(idx)
corr_vector = fourier_shell_correlation(
maps_user_flat.reshape(-1, n_pix, n_pix, n_pix),
maps_gt_flat[idx].reshape(n_pix, n_pix, n_pix),
Expand Down
10 changes: 5 additions & 5 deletions src/cryo_challenge/_map_to_map/map_to_map_distance_matrix.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def run(config):
submission[submission_metadata_key] / submission[submission_metadata_key].sum()
)

cost_funcs_d = {
map_to_map_distances = {
"fsc": FSCDistance(config),
"corr": Correlation(config),
"l2": L2DistanceSum(config),
Expand Down Expand Up @@ -139,9 +139,9 @@ def run(config):
maps_user_flat /= maps_user_flat.std(dim=1, keepdim=True)

computed_assets = {}
for cost_label, map_to_map_distance in cost_funcs_d.items():
if cost_label in config["analysis"]["metrics"]: # TODO: can remove
print("cost matrix", cost_label)
for distance_label, map_to_map_distance in map_to_map_distances.items():
if distance_label in config["analysis"]["metrics"]: # TODO: can remove
print("cost matrix", distance_label)

cost_matrix = map_to_map_distance.get_distance_matrix(
maps_gt_flat, maps_user_flat
Expand All @@ -162,7 +162,7 @@ def run(config):
"computed_assets": computed_assets,
}

results_dict[cost_label] = single_distance_results_dict
results_dict[distance_label] = single_distance_results_dict

# Validate before saving
_ = MapToMapResultsValidator.from_dict(results_dict)
Expand Down
4 changes: 2 additions & 2 deletions tests/config_files/test_config_map_to_map.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ data:
analysis:
metrics:
- l2
# - corr
# - bioem
- corr
- bioem
- fsc
chunk_size_submission: 80
chunk_size_gt: 190
Expand Down

0 comments on commit 2730734

Please sign in to comment.