Skip to content

Commit

Permalink
add more comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Xinqiang Ding committed Jan 9, 2019
1 parent 8797ebc commit c172459
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
File renamed without changes.
6 changes: 5 additions & 1 deletion script/prep_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,14 @@ def __len__(self):
return self.image.shape[0]
def __getitem__(self, idx):
image = np.copy(self.image[idx, :].reshape(28,28))

## binarize MNIST images
tmp = np.random.rand(28,28)
image = tmp <= image
image = image.astype(np.float32)


## randomly choose a direction and generate a sequence
## of images that move in the chosen direction
direction = np.random.choice(['left', 'right'])
image_list = []
image_list.append(image.reshape(-1))
Expand Down

0 comments on commit c172459

Please sign in to comment.