Skip to content

Commit

Permalink
Saving memory mapped arrays with a random number in the filename so t…
Browse files Browse the repository at this point in the history
…hat when I run multiple models they don't overwrite each other.
  • Loading branch information
daniel-muthukrishna committed May 13, 2018
1 parent fa18875 commit d381821
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions dash/create_arrays.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ def shuffle_arrays(self, memmapName='', **kwargs):
Can optionally take filenames and typeNames as arguments """
arraySize = len(kwargs['labels'])
kwargShuf = {}
self.randnum = np.random.randint(10000)
for key in kwargs:
if key == 'images':
arrayShuf = np.memmap('shuffled_{}_{}_{}.dat'.format(key, memmapName, self.randnum), dtype=np.float16, mode='w+', shape=(arraySize, int(self.nw)))
Expand Down

0 comments on commit d381821

Please sign in to comment.