# Network structure of generative model for classification

I'm trying to model a generative model for classification problem, especially aiming to solve an imbalanced data problem.

However, I couldn't get intuitive understanding for generative classifier in terms of deep learning (or machine learning). Classical generative classifiers such as Bayes classifier are clear with such a closed form of equations.

In a viewpoint of 'neural network', it is necessary to model a network structure with input, output, and loss function to update parameters. Assuming class distribution $$p(y)$$ is known, network should be like below, I think:

Q1) I wonder that the network structure makes sense for classification even though the diagram is very simplified version. Additionally, how can I return the log likelihood function $$\log p_{\theta} (x | y)$$ as an output layer in keras? (How can I constitute the network structure in keras?)

Q2) How is loss function defined to update $$\theta$$ ?

• You can use latex on this site. Please, edit your post to do that. – nbro Dec 19 '20 at 12:49
• @nbro I just edited to use latex. Thank you – WKIm Dec 20 '20 at 22:37