Training the generator network