Error analysis of generative adversarial network