Skip to content

Commit

Permalink
Updates for python 3 compatability
Browse files Browse the repository at this point in the history
  • Loading branch information
bmatejek committed Feb 9, 2021
1 parent b0072c7 commit 6f9adb4
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 6 deletions.
4 changes: 2 additions & 2 deletions algorithms/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,8 @@ def CollapseGraph(prefix, segmentation, vertex_ones, vertex_twos, maintained_edg
rand_error, vi = comparestacks.VariationOfInformation(new_prefix, segmentation, gold)

print ('Rand Error Full: {}'.format(rand_error[0] + rand_error[1]))
print ('Rand Error Merge: {}'.format(rand_error[0])
print ('Rand Error Split: {}'.format(rand_error[1])
print ('Rand Error Merge: {}'.format(rand_error[0]))
print ('Rand Error Split: {}'.format(rand_error[1]))

print ('Variation of Information Full: {}'.format(vi[0] + vi[1]))
print ('Variation of Information Merge: {}'.format(vi[0]))
Expand Down
4 changes: 2 additions & 2 deletions cnns/biological/edges/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from train import Train
from forward import Forward
from .train import Train
from .forward import Forward
4 changes: 2 additions & 2 deletions cnns/biological/nodes/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
from train import Train
from forward import Forward
from .train import Train
from .forward import Forward
6 changes: 6 additions & 0 deletions cnns/biological/nodes/forward.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,16 @@
def NodeGenerator(examples, width):
index = 0

import time
start_time = time.time()

while True:
# prevent overflow of the queue (these examples will not go through)
if index == examples.shape[0]: index = 0

if not index % 1000:
print ('Completed {}/{} in {:0.2f} seconds'.format(index, len(examples), time.time() - start_time))

# augment the feature
example = AugmentFeature(examples[index], width)

Expand Down

0 comments on commit 6f9adb4

Please sign in to comment.