# FMGAN: A Filter-Enhanced MLP Debias Recommendation Model Based on Generative Adversarial Network
## 3 Methodology
### Generator  
The purpose of the generator is to generate a top-N recommendation list based on the user's historical interaction and user characteristics. Figure 2 illustrates the structure of our generator, which mainly includes input, embedding layer, combination layer, filter layer, and output layer. We will introduce the role of each layer in detail. The input of G consists of two parts. One is the user ID used to obtain the user embedding vector, and the other is the conditional vector \(c\) related to the historical interaction. The embedding vector is used to save the user's basic preferences and demographic information. The embedding vector provides the generator with stable characteristics of the user,  
Figure 1: The overview of the proposed GAN-based recommendation model. Figure 2: The generator structure in our model. maintaining the basic learning ability of the model. The conditional vector \(\mathbf{c}\) is an important point of model input. The introduction of this vector is to solve the problem of exposure bias in the recommendation process. This vector can be obtained from historical implicit interaction data or by sampling methods such as negative sampling. The conditional vector provides the generator with short-term preferences of users and alleviates exposure bias, and the two-part input enables G to float up and down around stable features of users to improve recommendation performance. The embedding layer obtains the embedding vectors of users and items by querying user IDs: \(U_{embd}=\{u_{1},u_{2},\cdots,u_{d}\}\), \(I_{embd}=\{i_{1},i_{2},\cdots,i_{d}\}\), where \(d\) represents the embedding dimension. The combination layer first calculates the user's stable feature: \(\mathbf{s_{u}}=U^{T}\times I\), and concatenates \(\mathbf{s_{u}}\) and the conditional vector \(\mathbf{c}\) to form the user's initial preference \(\mathbf{p}=cat(\mathbf{s_{u}},\mathbf{c})\in\mathbb{R}^{1\times 2m}\). \(\mathbf{p}\) can be directly input into the linear layer, giving a recommendation list, but it consists of two parts. \(\mathbf{s_{u}}\) is the calculation data, and \(\mathbf{c}\) is collected through real-world user feedback; directly inputting into the linear layer will mix the noise of the two, making the noise further amplified. So, we apply a filter layer in the generator, which can better fuse information and remove part of the noise. The initial preference \(\mathbf{p}\) is first transformed to the frequency domain by fast Fourier transform:  
\[\mathbf{X}^{l}=\mathcal{F}(\mathbf{p})\in\mathbb{C}^{1\times m} \tag{5}\]  
where \(\mathcal{F}(\cdot)\) represents the one-dimensional fast Fourier transform, and \(\mathbf{X}^{l}\) is a complex vector representing the spectrum of \(\mathbf{p}\). This way, we can start the filtering (modulation) operation by multiplying the learnable filter \(\mathbf{K}\in\mathbb{C}^{1\times m}\) with \(\mathbf{X}^{l}\) to get the modulated vector \(\widetilde{\mathbf{X}}\):  
\[\widetilde{\mathbf{X}}=\mathbf{K}\odot\mathbf{X}^{l}\in\mathbb{C}^{1\times m} \tag{6}\]  
where \(\odot\) represents elementwise multiplication. The filter \(\mathbf{K}\) is a randomly initialized complex vector. During training, its parameters are updated through the gradients of the optimization function. Following modulation, the resulting vector \(\widetilde{\mathbf{X}}\) remains in the complex domain, necessitating conversion back to the time domain prior to further processing. \[\mathbf{p_{I}}=\mathcal{F}^{-1}\Big{(}\widetilde{\mathbf{X}}\Big{)} \tag{7}\]  
where \(\mathcal{F}^{-1}(\cdot)\) represents the inverse Fourier transform. After the last transformation, the initial user preference \(\mathbf{p}\) has been fused and denoised, resulting in a complete user preference vector \(\mathbf{p_{I}}\) that is suitable for subsequent processing. The final layer in the neural network architecture consists of two linear layers and an activation function, which are responsible for generating the output.