From bf99f3d809d8669ab26d185b8d5cfd9e52885c2d Mon Sep 17 00:00:00 2001 From: anna-grim Date: Mon, 29 Jan 2024 21:21:20 +0000 Subject: [PATCH] minor upds --- src/deep_neurographs/geometry_utils.py | 5 +++-- src/deep_neurographs/neurograph.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/deep_neurographs/geometry_utils.py b/src/deep_neurographs/geometry_utils.py index 634cec6..c0ff768 100644 --- a/src/deep_neurographs/geometry_utils.py +++ b/src/deep_neurographs/geometry_utils.py @@ -1,4 +1,5 @@ import heapq +import math from copy import deepcopy import numpy as np @@ -425,9 +426,9 @@ def dist(v_1, v_2, metric="l2"): """ if metric == "l1": - return np.linalg.norm(np.subtract(v_1, v_2), ord=1) + return np.sum(v_1 - v_2) else: - return np.linalg.norm(np.subtract(v_1, v_2), ord=2) + return math.dist(v_1, v_2) def make_line(xyz_1, xyz_2, num_steps): diff --git a/src/deep_neurographs/neurograph.py b/src/deep_neurographs/neurograph.py index a68b70b..7d0362b 100644 --- a/src/deep_neurographs/neurograph.py +++ b/src/deep_neurographs/neurograph.py @@ -364,7 +364,7 @@ def init_targets(self, target_neurograph): for idx in np.argsort(dists): edge = remaining_proposals[idx] add_bool = self.is_target( - target_neurograph, edge, dist=7, ratio=0.4, exclude=15 + target_neurograph, edge, dist=8, ratio=0.4, exclude=15 ) if add_bool: self.target_edges.add(edge)