It is difficult for users to find the required information promptly in the massive data. The collaborative filtering is an effective way to help users get the proper information. To achieve better performance, an improved framework based on variational Generative Adversarial Networks with self-attention (VGCF) is proposed. In VGCF, self-attention mechanism and Variational Autoencoders are combined to form self-attention variational encoder, which improves the ability of acquiring explicit and implicit features of sparse data and obtains the personal preference and the correlation between users. By utilizing Generative Adversarial Networks for prediction, the generative model uses the compression matrix obtained by self-attention variational encoder to generate the predicted user-items interaction matrix. The discriminative model provides a better approximation for the posterior and maximum-likelihood assignment, which makes the generated result closer to the real data distribution. Finally, we show that the performance of VGCF is significantly better than the state-of-the-art recommendation methods on several real-world datasets.