Skip to content

Commit

Permalink
Fixed minor bugs with integer division
Browse files Browse the repository at this point in the history
- Fixed issue with integer division (in Python3) causing image shape to be saved as a float instead of an integer.
- Corrected log comment in run_spaun.py
  • Loading branch information
xchoo committed Sep 17, 2018
1 parent 1f18c64 commit c116cd4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions _spaun/modules/stim/imagenet/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,8 @@ def __init__(self, data_filepath=None):
# --- Handle subsampling of probe data ---
self.probe_subsample = 4
self.probe_image_shape = (self.image_shape[0],
self.image_shape[1] / self.probe_subsample,
self.image_shape[2] / self.probe_subsample)
self.image_shape[1] // self.probe_subsample,
self.image_shape[2] // self.probe_subsample)

subsample_trfm = np.arange(np.cumprod(self.image_shape)[-1])
subsample_inds = \
Expand Down
4 changes: 2 additions & 2 deletions _spaun/modules/stim/mnist/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,8 @@ def __init__(self, data_filepath=None):
self.max_pixel_value = 1.0

self.probe_subsample = 1
self.probe_image_shape = (self.image_shape[0] / self.probe_subsample,
self.image_shape[1] / self.probe_subsample)
self.probe_image_shape = (self.image_shape[0] // self.probe_subsample,
self.image_shape[1] // self.probe_subsample)

subsample_trfm = np.arange(np.cumprod(self.image_shape)[-1])
subsample_inds = \
Expand Down
2 changes: 1 addition & 1 deletion run_spaun.py
Original file line number Diff line number Diff line change
Expand Up @@ -892,7 +892,7 @@

# Log subprocess call
logger.write("\n#\n# To display graphs of the recorded probe data:")
logger.write("\n# " + " ".join(subprocess_call_list))
logger.write("\n# > " + " ".join(subprocess_call_list))

if args.showgrph:
# Open subprocess
Expand Down

0 comments on commit c116cd4

Please sign in to comment.