Skip to content

Commit

Permalink
minor upds
Browse files Browse the repository at this point in the history
  • Loading branch information
anna-grim committed Oct 30, 2024
1 parent 97d94d6 commit 7ab696b
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/deep_neurographs/fragment_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
def remove_curvy(graph, max_length, ratio=0.5):
deleted_ids = set()
components = [c for c in connected_components(graph) if len(c) == 2]
for nodes in tqdm(components, desc="Curvy Fragment Filtering"):
for nodes in tqdm(components, desc="Filter Curvy Fragment"):
if len(nodes) == 2:
i, j = tuple(nodes)
length = graph.edges[i, j]["length"]
Expand Down Expand Up @@ -67,7 +67,7 @@ def remove_doubles(graph, max_length, node_spacing, output_dir=None):
util.mkdir(output_dir, delete=True)

# Main
desc = "Doubled Fragment Filtering"
desc = "Filter Doubled Fragment"
for idx in tqdm(np.argsort([len(c) for c in components]), desc=desc):
i, j = tuple(components[idx])
swc_id = graph.nodes[i]["swc_id"]
Expand Down
3 changes: 2 additions & 1 deletion src/deep_neurographs/machine_learning/heterograph_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ def __init__(

self.input_edges = nn.ModuleDict()
for key, d in edge_dict.items():
key = str(key)
self.input_edges[str(key)] = nn.Linear(d, hidden_dim, device=device)

# Layer dimensions
Expand Down Expand Up @@ -154,7 +155,7 @@ def forward(self, x_dict, edge_index_dict, edge_attr_dict):

# Input - Edges
for key, f in self.input_edges.items():
#key = reformat_edge_key(key)
key = reformat_edge_key(key)
edge_attr_dict[key] = f(edge_attr_dict[key])
edge_attr_dict = self.activation(edge_attr_dict)

Expand Down
2 changes: 1 addition & 1 deletion src/deep_neurographs/utils/swc_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ def load_from_gcs(self, gcs_dict):
with ProcessPoolExecutor() as executor:
# Assign processes
processes = list()
for path in tqdm(zip_paths, desc="Downloading SWCs"):
for path in tqdm(zip_paths, desc="Download SWCs"):
zip_content = bucket.blob(path).download_as_bytes()
processes.append(
executor.submit(self.load_from_cloud_zip, zip_content)
Expand Down

0 comments on commit 7ab696b

Please sign in to comment.