def display_data(batch_id=1, sample_id=6): """ Display a picture from a batch + sample with its information :param batch_id: batch id number :param sample_id: sample id number """ helper.display_stats(cifar10_dataset_folder_path, batch_id, sample_id)
def explore_dataset(batch_id, sample_id): """ Explore what is inside the data by showing specific image. :param batch_id: :param sample_id: :return: """ helper.display_stats(DataCenter.cifar10_dataset_folder_path, batch_id, sample_id)
# In[ ]: get_ipython().magic('matplotlib inline') get_ipython().magic("config InlineBackend.figure_format = 'retina'") import helper import numpy as np import pickle filename = "fashion-mnist.p" # Explore the dataset sample_id = 6 helper.display_stats(filename, sample_id) # ## Implement Preprocess Functions # ### Normalize # In the cell below, implement the `normalize` function to take in image data, `x`, and return it as a normalized Numpy array. The values should be in the range of 0 to 1, inclusive. The return object should be the same shape as `x`. # In[ ]: import problem_unittests as tests def normalize(x): """ Normalize a list of sample image data in the range of 0 to 1 : x: List of image data. The image shape is (28, 28, 1) : return: Numpy array of normalize data
# Understanding a dataset is part of making predictions on the data. Play around with the code cell below by changing the `batch_id` and `sample_id`. The `batch_id` is the id for a batch (1-5). The `sample_id` is the id for a image and label pair in the batch. # # Ask yourself "What are all possible labels?", "What is the range of values for the image data?", "Are the labels in order or random?". Answers to questions like these will help you preprocess the data and end up with better predictions. # In[3]: #get_ipython().magic(u'matplotlib inline') #get_ipython().magic(u"config InlineBackend.figure_format = 'retina'") import helper import numpy as np # Explore the dataset batch_id = 1 sample_id = 5 helper.display_stats(cifar10_dataset_folder_path, batch_id, sample_id) # ## Implement Preprocess Functions # ### Normalize # In the cell below, implement the `normalize` function to take in image data, `x`, and return it as a normalized Numpy array. The values should be in the range of 0 to 1, inclusive. The return object should be the same shape as `x`. # In[6]: def normalize(x): """ Normalize a list of sample image data in the range of 0 to 1 : x: List of image data. The image shape is (32, 32, 3) : return: Numpy array of normalize data """ if 1:
# # Ask yourself "What are all possible labels?", "What is the range of values for the image data?", "Are the labels in order or random?". Answers to questions like these will help you preprocess the data and end up with better predictions. # In[2]: get_ipython().run_line_magic('matplotlib', 'inline') get_ipython().run_line_magic('config', "InlineBackend.figure_format = 'retina'") import helper import numpy as np # Explore the dataset batch_id = 1 sample_id = 5 helper.display_stats(cifar10_dataset_folder_path, batch_id, sample_id) # ## Implement Preprocess Functions # ### Normalize # In the cell below, implement the `normalize` function to take in image data, `x`, and return it as a normalized Numpy array. The values should be in the range of 0 to 1, inclusive. The return object should be the same shape as `x`. # In[3]: def normalize(x): """ Normalize a list of sample image data in the range of 0 to 1 : x: List of image data. The image shape is (32, 32, 3) : return: Numpy array of normalize data """
def displayStats(self, debugTextBrowser, batchId, sampleId, m): helper.display_stats(self.cifar10_dataset_folder_path, self, debugTextBrowser, batchId, sampleId, m)