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
1 change: 0 additions & 1 deletion src/neuron_proofreader/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,5 @@ def save(self, dir_path):
dir_path : str
Path to directory to save JSON file.
"""

self.graph.save(os.path.join(dir_path, "metadata_graph.json"))
self.ml.save(os.path.join(dir_path, "metadata_ml.json"))
12 changes: 2 additions & 10 deletions src/neuron_proofreader/machine_learning/gnn_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,16 +91,8 @@ def forward(self, input_dict):
x_dict["proposal"] = torch.cat((x_dict["proposal"], x_img), dim=1)

# Message passing
try:
x_dict = self.gat1(x_dict, edge_index_dict)
x_dict = self.gat2(x_dict, edge_index_dict)
except:
print("Before...")
print("\n".join(before))
print("After...")
for key, x in x_dict.items():
print(key, x.size())
stop
x_dict = self.gat1(x_dict, edge_index_dict)
x_dict = self.gat2(x_dict, edge_index_dict)
return self.output(x_dict["proposal"])


Expand Down
9 changes: 2 additions & 7 deletions src/neuron_proofreader/machine_learning/subgraph_sampler.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,6 @@ def __iter__(self):
self.populate_via_bfs(subgraph, root)

# Yield batch
self.populate_attributes(subgraph)
yield subgraph

def populate_via_bfs(self, subgraph, root):
Expand Down Expand Up @@ -178,10 +177,6 @@ def visit_flagged_proposal(self, subgraph, queue, visited, proposal):
if not (v in visited and v in nodes_added):
queue.append((v, 0))

def populate_attributes(self, subgraph):
# TO DO
pass

# --- Helpers ---
def init_subgraph(self):
"""
Expand All @@ -204,10 +199,10 @@ def is_subgraph_full(self, subgraph):

class SeededSubgraphSampler(SubgraphSampler):

def __init__(self, graph, max_proposals=200, gnn_depth=2):
def __init__(self, graph, gnn_depth=2, max_proposals=64):
# Call parent class
super(SeededSubgraphSampler, self).__init__(
graph, max_proposals, gnn_depth
graph, gnn_depth, max_proposals
)

# --- Batch Generation ---
Expand Down
4 changes: 2 additions & 2 deletions src/neuron_proofreader/machine_learning/vision_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

"""

#from neurobase.finetune import finetune_model
# from neurobase.finetune import finetune_model
from einops import rearrange

import torch
Expand Down Expand Up @@ -147,7 +147,7 @@ def __init__(self, checkpoint_path, model_config):

# Instance attributes
self.encoder = full_model.encoder
self.output = ml_util.init_feedforward(384, 1, 2)
self.output = FeedForwardNet(384, 1, 3)

def forward(self, x):
latent0 = self.encoder(x[:, 0:1, ...])
Expand Down
Loading