October 2018
Intermediate to advanced
252 pages
6h 49m
English
Let's look at how the model is trained:
def train(self, epochs, batch_size=128, sample_interval=50): # Load the dataset (X_train, _), (_, _) = fashion_mnist.load_data() # Rescale -1 to 1 X_train = X_train / 127.5 - 1. X_train = np.expand_dims(X_train, axis=3) # Adversarial ground truths valid = np.ones((batch_size, 1)) fake = np.zeros((batch_size, 1)) for epoch in range(epochs): # --------------------- # Train Discriminator # --------------------- # Select a random batch ...