## 4 Formulation of Our Approach  
We design a Bayesian network and follow a nonparametric approach for computing the conditional probabilities of the nodes. Motivated by the sparse representation power of an overcomplete dictionary, we learn sparse representations of training examples by jointly learning two Bayesian dictionaries. The same sparse representations learned with the first dictionary, called the dictionary, are further optimized by the second dictionary, called the linear classifier, to represent the labels of the corresponding classes of the examples over the classifier. Furthermore, we also used the beta-Bernoulli processes to induce discrimination in the dictionary and the classifier. The Bayesian network of our approach is shown in Figure 1.  
We use different base measures for the dictionary and the classifier and use the same Bernoulli distributions for the selection of the dictionary atoms and the classifier atoms for the representation of training examples and the corresponding labels. The Bernoulli distributions' parameters \(\pi\) are drawn from the beta process. These parameters are associated with the dictionary atoms and the classifier atoms. Though different base measures are used for beta-Bernoulli processes for the dictionary and the classifier, the same Bernoulli parameters are used for associating probabilities with dictionary atoms and the corresponding atoms of the classifier for the representation of the examples and the labels. However, to induce discrimination and associate labels with dictionary atoms and classifier atoms, we use different sets of draws of Bernoulli distribution parameters from beta-Bernoulli processes for each class of the training data. Consequently, different sets of Bernoulli distributions for the selection of atoms are used for the representation of the examples and the corresponding labels for different classes. The work in [24] uses two separate prior Gaussian distributions to draw the weights for the dictionary and the classifier for the representation of the training examples and the corresponding labels, respectively. We use the same Gaussian prior for drawing the same representation weights for the dictionary and the classifier to represent training examples and the corresponding labels. Based upon our nonparametric Bayesian approach for jointly learning the dictionary classifier with a dictionary and the same sparse representations for both the training examples and the labels of the corresponding classes, the model is expressed mathematically in Equation (6). For the construction of the \(i\)th training example of the \(c\)th class. it is formulated as \(\mathbf{a}_{i}^{c}=\boldsymbol{\Phi}\boldsymbol{\alpha}_{i}^{c}+\mathbf{a}_{c_ {i}}\) and \(\mathbf{a}_{i}^{c}=\mathbf{z}_{i}^{c}\odot\mathbf{s}_{i}^{c}\). Here, \(\boldsymbol{\alpha}_{i}^{c}\) is the sparse code vector (weights) for the \(i\)th example of data, \(\mathbf{s}_{i}^{c}\in R^{K}\) is the weight vector associated with dictionary atoms contributing  
Figure 1: **Bayesian Network**. Nodes represent the random variables of the model and edges represent conditional dependence among the variables. Note that the same atom selection (\(\boldsymbol{x}_{i}^{c}\)) and representation (\(\mathbf{s}_{ik}^{c}\)) variables contribute to the reconstruction of both the training examples, \(\mathbf{a}_{i}^{c}\), and the labels, \(\mathbf{h}_{i}^{c}\). to sparse code representation of \(i\)th example, and \(\odot\) represents the Kronecker product. The linear classifier \(\mathbf{B}\) is also learned jointly with the same sparse codes \(\mathbf{\alpha}_{i}^{c}\) for the representation of class labels, contrary to [24]. The formal representation of our model is shown below. \[