![]() # Generate data for i, ID in enumerate(list_IDs_temp): Y = np.empty(( self.batch_size), dtype = int) X = np.empty(( self.batch_size, * self.dim, self.n_channels)) 'Generates data containing batch_size samples ' # X : (n_samples, *dim, n_channels) # Initialization We make the latter inherit the properties of so that we can leverage nice functionalities such as multiprocessing.ĭef _data_generation( self, list_IDs_temp): ![]() Now, let's go through the details of how to set the Python class DataGenerator, which will be used for real-time data feeding to your Keras model.įirst, let's write the initialization function of the class. ![]() Where data/ is assumed to be the folder containing your dataset.įinally, it is good to note that the code in this tutorial is aimed at being general and minimal, so that you can easily adapt it for your own dataset. In that case, the Python variables partition and labels look like > partitionĪlso, for the sake of modularity, we will write Keras code and customized classes in separate files, so that your folder looks like folder/
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |