It seems that it needs a minus sign. But after adding a minus sign to g_loss, it does a bad job and generate weird MIDI after 400 epochs training.