Skip to content

Commit

Permalink
Merge pull request rasbt#84 from rasbt/ch13-no-shuffling
Browse files Browse the repository at this point in the history
Added shuffle_files=False for loading CelebA dataset
  • Loading branch information
rasbt authored Nov 25, 2019
2 parents 332d1b0 + 7f4bee8 commit 79b58e4
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 56 deletions.
118 changes: 64 additions & 54 deletions ch13/ch13_part1.ipynb

Large diffs are not rendered by default.

9 changes: 7 additions & 2 deletions ch13/ch13_part1.py
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ def load_and_preprocess(path, label):


# Load data from disk as tf.data.Datasets
datasets = celeba_bldr.as_dataset()
datasets = celeba_bldr.as_dataset(shuffle_files=False)

datasets.keys()

Expand Down Expand Up @@ -524,14 +524,16 @@ def load_and_preprocess(path, label):
ax.imshow(image)
ax.set_title('{}'.format(label), size=15)


plt.show()


# Alternative ways for loading a dataset



mnist, mnist_info = tfds.load('mnist', with_info=True)
mnist, mnist_info = tfds.load('mnist', with_info=True,
shuffle_files=False)

print(mnist_info)

Expand All @@ -557,6 +559,9 @@ def load_and_preprocess(path, label):
ax.set_xticks([]); ax.set_yticks([])
ax.imshow(image[:, :, 0], cmap='gray_r')
ax.set_title('{}'.format(label), size=15)

#plt.savefig('ch13-mnist-new.png')
plt.show()



Expand Down

0 comments on commit 79b58e4

Please sign in to comment.