| Today,the development of machine learning and neural networks presents both challenges and opportunities for the advancement of generative models.Among the mainstream models in generative modeling,deep learning-based Generative Adversarial Networks(GANs)have emerged as a prominent approach.GANs utilize concepts from game theory and maximum likelihood estimation.The performance of GANs in capturing the true data distribution and extracting meaningful features from samples heavily depends on their network structure.A well-designed network structure can lead to the generation of more realistic and clearer images,thereby enhancing the fidelity of generated samples.Furthermore,with the expansion of training data and the complexity of model architectures,training models often require significant time investments.Therefore,improving sample generation quality and training speed are of paramount importance.Enhancing the realism of GAN models primarily involves exploring appropriate GAN architectures.Improving training speed can be achieved by parallelizing the training algorithm.In this thesis,we address the limitations of previous research approaches and propose two novel contributions:a Transformer-based GAN model for image generation,called Transformer super resolution generates adversarial networks(TransSRGAN),and a parallel algorithm for training neural networks using Spark.The specific research contributions are as follows:1.To address the issue of low image fidelity in existing generative models,we propose the TransSRGAN model based on GANs.The generator in this model employs Transformer Encoder sub-modules as fundamental units,which extract features and generate latent matrices with image features.These matrices are then fed into a convolutional neural network for upsampling,resulting in the generation of high-resolution,clear images.The discriminator in the model utilizes a convolutional neural network to extract image features and classify input samples.To ensure training stability,we introduce gradient penalty and gradient clipping mechanisms.Experimental results demonstrate that compared to existing models,the TransSRGAN model achieves a distribution of generated samples that closely resembles the training samples.It effectively improves the quality and diversity of generated samples,enhances their realism,and avoids issues such as mode collapse and training instability.2.To address the slow training speed of TransSRGAN,we propose a parallel algorithm based on Spark for training neural networks.We adopt the Distributed Full-Average Gradient Descent(DFAGD)algorithm to address the frequent interprocessor communication caused by multiple reductions.The algorithm leverages Spark to partition data into multiple Resilient Distributed Datasets(RDDs)and assigns the data to multiple machines.Each machine further divides the data into multiple partitions,and the CPUs of each machine independently perform computations on these partitions.After completing the computations,the average gradients are returned to the master node.The master node then performs gradient reduction for each machine,completing one iteration of gradient descent.This algorithm achieves parallelization of the backward propagation and gradient computation process in TransSRGAN at the data level,thereby reducing the training time for large-scale complex models.Experimental results demonstrate that our proposed algorithm effectively reduces model training time and achieves high acceleration ratios. |