January 02, 2024
In deep learning, classification tasks are formalized as optimization problems often solved via the minimization of the cross-entropy. However, recent advancements in the design of objective functions allow the usage of the \(f\)-divergence to generalize the formulation of the optimization problem for classification. We adopt a Bayesian perspective and formulate the classification task as a maximum a posteriori probability problem. We propose a class of objective functions based on the variational representation of the \(f\)-divergence. Furthermore, driven by the challenge of improving the state-of-the-art approach, we propose a bottom-up method that leads us to the formulation of an objective function corresponding to a novel \(f\)-divergence referred to as shifted log (SL). We theoretically analyze the objective functions proposed and numerically test them in three application scenarios: toy examples, image datasets, and signal detection/decoding problems. The analyzed scenarios demonstrate the effectiveness of the proposed approach and that the SL divergence achieves the highest classification accuracy in almost all the considered cases.
Classification problems are relevant in a multitude of domains, such as computer vision, biomedical, and telecommunications engineering [1]–[3]. In general, classification refers
to the estimation of a discrete vector \(\mathbf{x}\) (i.e., the class) given an observation vector \(\mathbf{y}\). In the Bayesian framework, the optimal method to solve classification
problems is derived from the maximum a posteriori probability (MAP) principle [4], [5]. Classical estimation theory uses a model-based approach to derive the estimation algorithm. Then, the MAP algorithm is well-defined and applicable when the posterior density is known. If the posterior probability is
unknown, the first fundamental step towards solving the MAP problem consists of learning the posterior density from the data. In this direction, deep learning (DL) approaches learn the model and solve the estimation task directly via data observation. This
is achieved by leveraging artificial neural networks, whose ability to model probability density functions (pdfs) makes them particularly suited for this task, as shown in [6]–[9]. DL models require the
design of two main elements: the network architecture, which defines the class of functions the network can estimate, and the objective function that is exploited during the training phase to learn the optimal parameters of the network. In reference to
neural network-based classification techniques, most of the previous work focused on the conceievement of the network architecture [10]–[14]. Contrarily, a smaller part of classification literature is dedicated to the objective function design. In most cases, classification is achieved through the minimization of the cross-entropy loss function between the
data empirical probability density function \(p_{data}\) and the probability density function output of the neural network \(p_{model}\) [15], [16]. The
minimization of the cross-entropy corresponds to the minimization of the Kullback-Leibler (KL) divergence between the same two probability distributions. The KL divergence is defined as \[\label{eq:DKL32definition} D_{KL}(p_{data} || p_{model}) = \mathop{\mathrm{\mathbb{E}}}_{p_{data}} \left[ \log \left( \frac{p_{data}}{p_{model}} \right) \right] ,\tag{1}\] while the cross-entropy (CE) is \(\mathop{\mathrm{\mathbb{E}}}_{p_{data}} \left[- \log \left( p_{model} \right) \right]\).
Alternatively, some papers propose the usage of proper losses, which is a family of losses characterized by Bregman divergences [17]. For instance, the authors in [18] compare the square loss and the cross-entropy for supervised
classification tasks, while in [19], the authors propose two novel objective functions based on logistic regression.
Another popular class of divergence functions is the \(f\)-divergence, which has been used for various classification algorithms. The authors in [20] propose a min-max game for the objective function design of deep energy-based models, where they substitute the minimization of the KL with any \(f\)-divergence. In [21], the authors propose a max-max optimization problem to tackle classification with
noisy labels. They maximize the \(f\)-mutual information (a generalization of the mutual information) between the classifier’s output and the true label distribution. In [22], the \(f\)-divergence is used as a regularization term in a min-max optimization problem, for the design of fair
classifiers (i.e., minimize the classifier discrepancy over sub-groups of the population).
In this paper, we propose to estimate the conditional posterior probability (needed in the MAP classifier) by expressing it as a density ratio (see 7 ) and by using a discriminative learning approach [23]. Density ratio estimation approaches have been used in a wide variety of applications [21], [24], [25]. However, unlike known classification objective functions, the main idea behind the proposed estimators is not to use a divergence minimization-based technique. Instead, to solve the classification task, we estimate the ratio between joint and marginal probability densities with a discriminator network and maximize such a ratio (corresponding to the posterior probability) with respect to the class elements. Therefore, contrarily to other \(f\)-divergence-based approaches that need a double training optimization procedure (e.g., max-max or min-max), our approach relies on a single training maximization formulation needed to learn the posterior density. Additionally, it enables the use of the \(f\)-divergence to obtain a broader set of classifiers beyond the conventional approach based on the exploitation of the cross-entropy.
In more detail, the contributions of this paper are fourfold: a) we design a class of posterior probability estimators that exploits the variational representation of the \(f\)-divergence [26]; b) we present a second class of posterior probability estimators formulated using a bottom-up approach; c) we propose a new objective function for classification tasks that corresponds to the variational representation of a novel \(f\)-divergence. The proposed divergence is analyzed theoretically and experimentally, and a comparison with the \(f\)-divergences known in the literature follows, showing that the new one achieves the best performance in almost all the considered scenarios; d) finally, we conceive two specific network architectures that are trained with the proposed objective functions.

Figure 1: System model representation. \(X\) is the input of a stochastic model \(H(\cdot)\), while the output is \(Y\). In the example represented by \(H_1(\cdot)\), the input is the class element "dog" and the output is an image of a dog. Differently, \(H_2(\cdot)\) is a communication channel, therefore the input is a codeword, and the output is the binary representation of such a codeword after the noise addition..
In this section, we describe the approach that we propose to tackle classification tasks and the notation used. Let \(X\) and \(Y\) be two random vectors described by the probability
density functions \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Let \(X\) and \(Y\) be the input and output of
a stochastic model (referred to as \(H(\cdot)\)), respectively, as shown in Fig. 1. In a classification context, \(X\) is discrete and represents the
class type with alphabet \(\mathcal{A}_x\), while \(Y\) is the observation of the class elements.
The MAP estimator (classifier) is formulated as: \[\label{eq:MAP95problem} \hat{\mathbf{x}} = \mathop{\mathrm{arg\,max}}_{\mathbf{x} \in \mathcal{A}_x} p_{X|Y}(\mathbf{x}|\mathbf{y})
,\tag{2}\] where \(p_{X|Y}(\mathbf{x}|\mathbf{y})\) is the posterior probability density. In this paper, we propose to adopt a discriminative formulation. Therefore, we express \(p_{X|Y}(\mathbf{x}|\mathbf{y})\) as the ratio between \(p_{XY}(\mathbf{x}, \mathbf{y})\) and \(p_Y(\mathbf{y})\) by using the Bayes theorem.
Since the classification task is an estimation problem, we formulate it with the MAP approach because it is the optimal approach for estimation problems in the Bayesian framework [5], [27]. A key advantage of the proposed MAP-based approach is
that it does not need a double training optimization procedure because it directly learns the posterior pdf formulating the objective function either using the \(f\)-divergence (Section 3)
or with a bottom-up approach (Section 4). When the posterior pdf is learned, the estimation (thus the classification) problem is solved, because the argmax operator in 2 can be easily
computed. First, we study the more general problem of estimating the posterior pdf when \(X\) is a continuous random vector. Then, we consider the specific case of \(X\) being discrete. The
classification problem is solved choosing the optimal class \(\mathbf{x}\) that, during inference, maximizes the estimate of \(p_{X|Y}(\mathbf{x}|\mathbf{y})\) (i.e., that solves 2 ).
The first approach we propose is to estimate \(p_{X|Y}(\mathbf{x}|\mathbf{y})\) by exploiting the variational representation of the \(f\)-divergence.
Given two probability distributions \(P\) and \(Q\) admitting, respectively, the absolutely continuous density functions \(p\) and \(q\) with respect to \(d\mathbf{x}\) defined on the domain \(\mathcal{X}\), the \(f\)-divergence (also known as Ali-Silvey
distance) is defined as [28], [29] \[D_f(P||Q) = \int_{\mathcal{X}} q(\mathbf{x}) f\left( \frac{p(\mathbf{x})}{q(\mathbf{x})} \right) d\mathbf{x} ,\] where the generator function \(f: \mathbb{R}_+ \longrightarrow
\mathbb{R}\) is a convex, lower-semicontinuous function such that \(f(1)=0\). Every generator function has a Fenchel conjugate function \(f^*\), that is defined as
\[\label{eq:fenchel95conjugate} f^*(t) = \sup_{u \in dom_f} \left\{ ut - f(u) \right\},\tag{3}\] where \(dom_f\) is the domain of
\(f(\cdot)\), \(f^{*}\) is convex and such that \(f^{**}(u) = f(u)\).
Leveraging 3 , the authors in [26] expressed a lower bound on any \(f\)-divergence, that is referred to as variational representation of the \(f\)-divergence: \[\begin{align}
\label{eq:variational95representation} D_f(P||Q) &\geq \sup_{T \in \mathcal{T}} \left\{ \mathop{\mathrm{\mathbb{E}}}_{p(\mathbf{x})} \left[ T(\mathbf{x}) \right] - \mathop{\mathrm{\mathbb{E}}}_{q(\mathbf{x})} \left[ f^*(T(\mathbf{x})) \right] \right\}
,
\end{align}\tag{4}\] where \(T(\mathbf{x})\) is parametrized by an artificial neural network, and the bound in 4 is tight when \(T(\mathbf{x})\) is \[\label{eq:T95hat} T^{\diamond}(\mathbf{x}) = f^{\prime} \left( \frac{p(\mathbf{x})}{q(\mathbf{x})} \right) ,\tag{5}\] where
\(f^\prime\) is the first derivative of \(f\).
Theorem 1 provides a class of objective functions that, when maximized, leads to the estimation of the posterior probability density.
Theorem 1. Let \(X\) and \(Y\) be the random vectors with pdfs \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Assume \(\mathbf{y} = H(\mathbf{x})\), where \(H(\cdot)\) is a stochastic function, then \(p_{XY}(\mathbf{x}, \mathbf{y})\) is the joint density. Define \(\mathcal{T}_x\) to be the support of \(X\) and \(p_U(\mathbf{x})\) to be a uniform pdf with support \(\mathcal{T}_x\). Let \(f_{u}: \mathbb{R}_+ \longrightarrow \mathbb{R}\) be a convex function such that \(f_{u}(1)=0\), and \(f_{u}^*\) be the Fenchel conjugate of \(f_{u}\). Let \(\mathcal{J}_f(T)\) be the objective function defined as \[\begin{align} \label{eq:top95down95variational95representation95posterior} \mathcal{J}_f(T) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_{XY}(\mathbf{x},\mathbf{y})} \left[ T(\mathbf{x},\mathbf{y}) \right] \notag \\ & - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \left[ f_{u}^*(T(\mathbf{x},\mathbf{y})) \right] . \end{align}\tag{6}\] Then, \[T^{\diamond}(\mathbf{x},\mathbf{y}) = \mathop{\mathrm{arg\,max}}_{T \in \mathcal{T}} \mathcal{J}_f(T)\] leads to the estimation of the posterior density \[\label{eq:top95down95posterior95estimator} \hat{p}_{X|Y}(\mathbf{x}|\mathbf{y}) = \frac{p_{XY}(\mathbf{x},\mathbf{y})}{p_Y(\mathbf{y})} = \frac{(f_{u}^{*})^{\prime}(T^{\diamond}(\mathbf{x},\mathbf{y}))}{|\mathcal{T}_x|},\tag{7}\] where \(T^{\diamond}(\mathbf{x},\mathbf{y})\) is parametrized by an artificial neural network.
\begin{table}[t]
| Name | Objective function | \(T^{\diamond}(\mathbf{x}, \mathbf{y})\) | \(D^{\diamond}(\mathbf{x}, \mathbf{y})\) |
|---|---|---|---|
| \(\mathcal{J}_{KL}(D)\) | \(\E_{p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ \log(D(\mathbf{x}, \mathbf{y})) \Bigr] - \E_{p_U(\mathbf{x})p_Y(\mathbf{y})}\Bigl[ |\mathcal{T}_x| D(\mathbf{x}, \mathbf{y}) \Bigr]\) | \(\log(D^{\diamond}(\mathbf{x}, \mathbf{y})) +1\) | \(\frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_Y(\mathbf{y})}\) |
| \(\mathcal{J}_{RKL}(D)\) | \(\E_{p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ - D(\mathbf{x}, \mathbf{y}) \Bigr] + \E_{p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \log(D(\mathbf{x}, \mathbf{y})) \Bigr]\) | \(-D^{\diamond}(\mathbf{x}, \mathbf{y})\) | \(\frac{p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y})}\) |
| \(\mathcal{J}_{HD}(D)\) | \(\E_{p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[- \sqrt{D(\mathbf{x}, \mathbf{y})} \Bigr] - \E_{p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \frac{1}{\sqrt{D(\mathbf{x}, \mathbf{y})}} \Bigr]\) | \(1 - \sqrt{D^{\diamond}}\) | \(\frac{p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y})}\) |
| \(\mathcal{J}_{GAN}(D)\) | \(\E_{p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[\log(1 - D(\mathbf{x}, \mathbf{y}) )\Bigr]+ \E_{p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \log(D(\mathbf{x}, \mathbf{y})) \Bigr]\) | \(\log(1 - D^{\diamond}(\mathbf{x}, \mathbf{y}))\) | \(\frac{p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y}) + p_Y(\mathbf{y})}\) |
| \(\mathcal{J}_{P}(D)\) | \(\E_{p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[2(D(\mathbf{x}, \mathbf{y}) - 1)\Bigr] - \E_{p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| D^2(\mathbf{x}, \mathbf{y}) \Bigr]\) | \(2(D^{\diamond}(\mathbf{x}, \mathbf{y}) - 1)\) | \(\frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_Y(\mathbf{y})}\) |
-0.1in \end{table}
According to Theorem 1, there exists a class of objective functions to train a discriminator whose output is processed to obtain an estimate of the posterior probability. The choice of the \(f\)-divergence offers a degree of freedom (DOF) in the objective function design. To improve the training convergence of the objective functions formulated as variational representation of \(f\)-divergences, the literature exploits a change of variable \(T(\mathbf{x}, \mathbf{y}) = r(D(\mathbf{x}, \mathbf{y}))\) in 6. With the same goal, we propose to introduce a second DOF in the development of the objective function 6 . Accordingly, it is sufficient to substitute \(D^{\diamond}(\mathbf{x}, \mathbf{y}) = r^{-1}(T^{\diamond}(\mathbf{x}, \mathbf{y}))\) in 7 to attain the corresponding posterior probability estimator. The exploitation of the DOFs uniquely defines the objective function and numerically impacts the discriminator’s parameters convergence during the training phase. We use Theorem 1 to obtain five specific estimators trained with the objective functions reported in Tab. ¿tbl:tab:value32functions?. These objective functions are obtained by first selecting the generator function and then choosing \(r(\cdot)\). The generator functions used to derive Tab. ¿tbl:tab:value32functions? are reported in Tab. ¿tbl:tab:f95divergences95table95unsupervised? of Appendix 9 and are retrieved from a modification of the well known \(f\)-divergences reported for completeness in Tab. ¿tbl:tab:f95divergences95table? of Appendix 9. In particular, the modification applied is attained as \(f_{u}^{*}(t) = |\mathcal{T}_x|f^{*}(t)\), where \(f_u^{*}(t)\) and \(f^{*}(t)\) are referred to as unsupervised and supervised generator functions, respectively. In addition, Tab. ¿tbl:tab:value32functions? comprises the change of variable \(r(D^{\diamond}(\mathbf{x}, \mathbf{y}))\) and the expression of \(D^{\diamond}(\mathbf{x}, \mathbf{y})\) for each objective function.
Lemma 1 proves the convergence property of any posterior probability estimator that is formulated as in Theorem 1.
Lemma 1. Let the artificial neural network \(D(\cdot) \in \mathcal{D}\) be with enough capacity and training time (i.e., in the nonparametric limit). Assume the gradient ascent update rule \(D^{(i+1)} = D^{(i)} + \mu \nabla \mathcal{J}_f(D^{(i)})\) converges to \[D^{\diamond} = \mathop{\mathrm{arg\,max}}_{D \in \mathcal{D}} \mathcal{J}_f(D) ,\] where \(\mathcal{J}_f(D)\) is defined as in 6 , with the change of variable \(D = r^{-1}(T)\). Then, the difference between the optimal posterior probability and its estimate at iteration \(i\) is \[\begin{align} p^{\diamond} - p^{(i)} \simeq \frac{1}{|\mathcal{T}_x|} \Bigl( \delta^{(i)} \Bigl[ (f_{u}^{*})^{\prime \prime}(r(D^{(i)})) \Bigr] \Bigr) , \label{eq:gap95optimum95posterior} \end{align}\tag{8}\] where \(\delta^{(i)}=r(D^{\diamond}) - r(D^{(i)})\), \((f_{u}^{*})^{\prime \prime}\) is the second derivative of \(f_u^*\), and \(\mu >0\) the learning rate. If \(D^{\diamond}\) corresponds to the global optimum achieved by using the gradient ascent method, the posterior probability estimator in 7 converges to the real value of the posterior density.
In addition to proving the convergence property of the posterior estimators in Theorem 1, Lemma 1 provides an intuitive explanation of the posterior probability estimator’s bias’s dependency on \(f\) in 8 .
Theorem 1 provides an effective method to solve classification problems by designing the objective function based on the choice of an \(f\)-divergence. This differs from other methods that leverage \(f\)-divergences and that need a dual optimization strategy [21], [22]. The proposed method relies on a single optimization problem. In fact, it generalizes the cross-entropy minimization approach (see Section 6). In the next section, we propose a novel bottom-up approach that guides the design of new objective functions for the posterior probability estimation problem.
In this section, we propose a bottom-up methodology for developing objective functions that, when maximized, lead to the estimation of the posterior probability. The bottom-up approach reverses the top-down procedure typical of \(f\)-divergence formulations [21], [24]. The main advantage of this new method is that it guides the design of the objective function by starting with the imposition of the optimal convergence condition of the discriminator’s output \(D^{\diamond}(\mathbf{x}, \mathbf{y})\) (see Appendix 11). Theorem 2 presents the class of objective functions that, when maximized, leads to the bottom-up posterior estimator.
Theorem 2. Let \(X\) and \(Y\) be the random vectors with pdfs \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Assume \(\mathbf{y} = H(\mathbf{x})\), where \(H(\cdot)\) is a stochastic function, then \(p_{XY}(\mathbf{x}, \mathbf{y})\) is the joint density. Let \(\mathcal{T}_x\) and \(\mathcal{T}_y\) be the support of \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Let the discriminator \(D(\mathbf{x}, \mathbf{y})\) be a scalar function of \(\mathbf{x}\) and \(\mathbf{y}\). Let \(k(\cdot)\) be any deterministic and invertible function. Then, the posterior density is estimated as \[\label{eq:bottom95up95posterior95estimator} \hat{p}_{X|Y}(\mathbf{x}|\mathbf{y}) = k^{-1}(D^{\diamond}(\mathbf{x}, \mathbf{y})) ,\tag{9}\] where \(D^{\diamond}(\mathbf{x},\mathbf{y})\) is the optimal discriminator obtained by maximizing \[\label{eq:value95function95general95bottom95up} \mathcal{J}(D) = \int_{\mathcal{T}_x} \int_{\mathcal{T}_y} \tilde{\mathcal{J}}(D) d\mathbf{x} d\mathbf{y},\tag{10}\] for all concave functions \(\tilde{\mathcal{J}}(D)\) such that their first derivative is \[\begin{align} \label{eq:g40D41} \frac{\partial \tilde{\mathcal{J}}(D)}{\partial D} &= \Bigl( D(\mathbf{x}, \mathbf{y}) - k(p_{X|Y}(\mathbf{x}|\mathbf{y}))\Bigr) g_1(D,k) \notag \\ & \triangleq g(D, k) \end{align}\tag{11}\] with \(g_1(D,k) \neq 0\) deterministic and \(\frac{\partial g(D,k)}{ \partial D} \leq 0\).
The proposed estimator leverages a discriminative formulation to estimate the density ratio corresponding to the posterior probability. Theorem 2 comprises two
DOFs in the objective function design. The former is the choice of \(k(\cdot)\), since the discriminator estimates an invertible transformation of the posterior density. We noticed that the classifier performs better when
\(k(\cdot)\) is chosen to resemble particular activation functions. The second DOF, represented by \(g_1(\cdot)\), is a rearrangement term that modifies the result of the integration of
\(g(\cdot)\) with respect to \(D\). The exploitation of such a DOF allows to attain different objective functions even when imposing the same optimal discriminator’s output. Theorems 1 and 2 have different advantages. The benefit of Theorem 1 is its simple applicability, that must, however, begin with the selection of the generator function \(f\). Theorem 2 has the advantage of guiding the objective function design without relying on existing \(f\)-divergences.
Corollary 4 in Appendix 10.6 exploits the DOFs in the choice of \(k(\cdot)\) and \(g_1(\cdot)\) to obtain the objective
functions in Tab. ¿tbl:tab:value32functions?, which were previously derived from Theorem 1. An interesting result highlighted by Corollary 4 is that all the objective functions corresponding to the well-known \(f\)-divergences in Tab. ¿tbl:tab:f95divergences95table95unsupervised? use the same class of functions \(g_1(\cdot) \propto 1/D^{\alpha}\cdot 1/(1-D)^{\beta}\) expressed in ?? in
Appendix 10.6. This property, highlighted by the class of bottom-up estimators, shows us that \(\mathcal{J}_{GAN}(D)\) is the only
one using \(\beta \neq 0\). Thanks to the observation of this peculiarity and driven by curiosity, we develop a new objective function starting from \(k_{GAN}(\cdot)\) and \(g_{1,GAN}(\cdot)\) but imposing \(\beta=0\).
In this section, we present a new objective function for classification problems, that we design by using Theorem 2. Then, we prove that such an objective function corresponds to the variational representation of a novel \(f\)-divergence, called shifted log (SL). We will demonstrate in Section 7 that such a new objective function achieves the best performance in almost all the classification scenarios discussed.
Theorem 3. Let \(X\) and \(Y\) be two random vectors with pdfs \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Assume \(Y = H(X)\), with \(H(\cdot)\) stochastic function, then let \(p_{XY}(\mathbf{x}, \mathbf{y})\) be the joint density. Let \(\mathcal{T}_x\) be the support of \(X\). Let \(p_U(\mathbf{x})\) be a uniform pdf having the same support \(\mathcal{T}_x\). The maximization of the objective function \[\begin{align} \label{eq:fNOME95cost95fcn} &\mathcal{J}_{SL}(D) = - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ D(\mathbf{x}, \mathbf{y}) \Bigr] \notag \\ & + \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \Bigl( \log(D(\mathbf{x}, \mathbf{y})) - D(\mathbf{x}, \mathbf{y}) \Bigr) \Bigr], \end{align}\tag{12}\] leads to the optimal discriminator output \[\label{eq:fNAME95D95opt} D^{\diamond}(\mathbf{x}, \mathbf{y}) = \mathop{\mathrm{arg\,max}}_{D} \mathcal{J}_{SL}(D) = \frac{1}{1 + p_{X|Y}(\mathbf{x}, \mathbf{y})} ,\tag{13}\] and the posterior density estimate is computed as \[\label{eq:posterior95estimator95sl} \hat{p}_{X|Y}(\mathbf{x}|\mathbf{y}) = \frac{1 - D^{\diamond}(\mathbf{x},\mathbf{y})}{D^{\diamond}(\mathbf{x},\mathbf{y})} .\tag{14}\]
Corollary 1 states that \(\mathcal{J}_{SL}(D)\) in 12 can be obtained from Theorem 1 by using a new \(f\)-divergence referred to as shifted log.
Corollary 1. Define the generator function of the shifted log divergence \[\label{eq:fNOME95f} f_{u, SL}(u) = - |\mathcal{T}_x| \log(u + |\mathcal{T}_x|) + K ,\tag{15}\] where \(K=|\mathcal{T}_x| \log(1 + |\mathcal{T}_x|)\) is constant. Then, \(\mathcal{J}_{SL}(D)\) in 12 is the variational representation of \(D_{f_{u,SL}}(p_{XY}||p_Up_Y)\).


Figure 2: Diagrams of unsupervised and supervised architectures. The thick rectangle delineates the discriminator in Fig. 1. The trapezoidal shape represents the neural network architecture..
Since the proposed objective function in 12 is the variational representation of an \(f\)-divergence (for Corollary 1), Lemma 1 ensures the convergence property of its estimate to the true posterior probability in the nonparametric limit.
The supervised version of the SL divergence is \[\label{eq:general95fSL} f_{SL}(u) = -\log(u + 1) + \log(2) ,\tag{16}\] which is obtained by substituting \(|\mathcal{T}_x|=1\) (see Appendix 9). Although \(f_{SL}\) is obtained in the context of posterior estimation problems, the proposed \(f\)-divergence can be applied to a broader variety of tasks. Since \(D_{SL}\) is upper-bounded (see Corollary 7 in Appendix 10.9), it is a suitable generator function when the optimization problem requires to maximize the variational representation of the \(f\)-divergence (i.e., a max-max game). For instance, for classification tasks as in [21] or for representation learning applications as in [30].
The GAN divergence is known to be highly-performing in a wide variety of tasks [24], [30]. Moreover, the objective functions corresponding to SL and GAN divergences can be obtained from Theorem 2 by choosing the same \(k(\cdot)\), but different \(g_1(\cdot)\). Corollary 2 compares the concavity of the two objective functions in the neighborhood of the global optimum.
Corollary 2. Let \(\mathcal{J}_{SL}(D)\) be defined as in 12 . Let \(\mathcal{J}_{GAN}(D)\) be defined as in Tab. ¿tbl:tab:value32functions?. Let \(D^{\diamond}_N\) be the discriminator output in a neighborhood of \(D^{\diamond}\) where \(\mathcal{J}_{SL}(D^{\diamond}_N)\) and \(\mathcal{J}_{GAN}(D^{\diamond}_N)\) are concave. Then, \[\label{eq:unsupervised95GAN95SL} \Bigg| \frac{\partial \mathcal{J}_{GAN}(D^{\diamond}_N)}{\partial D } \Bigg| \geq \Bigg| \frac{\partial \mathcal{J}_{SL}(D^{\diamond}_N)}{\partial D } \Bigg| .\tag{17}\]
Although the shape of the loss landscape depends on many factors (e.g., the batch size [31], [32]), sharper maxima attain larger test error [33]. The steepness of the concavity of the objective function in the neighborhood of the global optimum provides insights on the basin of attraction of the point of maximum. Intuitively, a flatter landscape corresponds to a larger basin of attraction of the global optimum, rendering training with the SL divergence better than with the GAN divergence. The results in Fig. 5 and Tab. ¿tbl:tab:speed95accuracy? in Appendix 12 validate the findings of Corollary 2.
In this section, we discuss the appropriate modifications to the discriminator’s architecture to suit our estimators to the classification scenario, where the number of classes is finite. The architecture type used differs depending on the alphabet of \(X\), referred to as \(\mathcal{A}_x\). When \(X\) is continuous, we use a structure referred to as unsupervised architecture. Differently, when \(X\) is discrete, we use a structure referred to as supervised architecture.
In this setting, the samples \(\mathbf{x}\) and \(\mathbf{y}\) drawn from the empirical probability distributions \(p_{XY}(\mathbf{x}, \mathbf{y})\) and \(p_U(\mathbf{x})p_Y(\mathbf{y})\) are concatenated and fed into the discriminator. The discriminator output is a scalar, since it is the posterior density function estimate corresponding to the pair \((\mathbf{x}, \mathbf{y})\) given as input. The discriminator architecture is represented in Fig. 2 (a), where the concatenation between the \(\mathbf{x}\) and \(\mathbf{y}\) realizations is identified by a dashed rectangle.
The supervised architecture (Fig. 2 (b)) introduces in the problem’s formulation the constraint that \(\mathcal{A}_x\) is a set containing a finite number of elements \(\mathcal{A}_x = \left\{ \mathbf{x}_1, \dots, \mathbf{x}_m \right\}\). This constraint is embedded in the architecture (highlighted by a dashed arrow in Fig. 2 (b)), so that the output layer contains one neuron for each sample in \(\mathcal{A}_x\). With this modification, the i-th output neuron returns \(p_{X|Y}(\mathbf{x}_i | \mathbf{y})\). Accordingly, the input layer is fed with only the realizations \(\mathbf{y}\). Notation wise, the discriminator’s output is referred to as \(\boldsymbol{D}(\mathbf{y})\). Theorem 4 shows the modification to the formulation of the objective functions in 6 when using a supervised architecture. First, we define the notation useful for the theorem statement: \(\boldsymbol{D}(\mathbf{y}) = [D(\mathbf{x}_1, \mathbf{y}), \dots, D(\mathbf{x}_m, \mathbf{y})]\) and \(\boldsymbol{1}_m(\mathbf{x}_i)=[0, \dots, 0, \underbrace{1}_{i^{th} \>\> pos.}, 0, \dots, 0]^T\).
Theorem 4. Let \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\) be pdfs describing the input and output of a stochastic function \(H(\cdot)\), respectively. Let \(p_X(\mathbf{x}) \triangleq \sum_{i = 1}^m P_X(\mathbf{x}_i) \delta (\mathbf{x} - \mathbf{x}_i)\), where \(P_X(\cdot)\) is the probability mass function of \(X\). Let \(\mathcal{T}_x\) be the support of \(p_X(\mathbf{x})\) and \(|\mathcal{T}_x|\) its Lebesgue measure. Let \(p_U(\mathbf{x})\) be the uniform discrete pdf over \(\mathcal{T}_x\). Let the discriminator be characterized by a supervised architecture. Then, the objective function in 6 becomes \[\begin{align} \label{eq:supervised95general95value95function} \mathcal{J}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_X(\mathbf{x})}\Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}|\mathbf{x})}\Bigl[ r(\boldsymbol{D}(\mathbf{y})) \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] \notag \\ & - \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_Y(\mathbf{y})}\Biggl[ \sum_{i=1}^m f^{*} \left(r(D(\mathbf{x}_i,\mathbf{y})) \right) \Biggr] , \end{align}\tag{18}\] where \(D(\mathbf{x}_i,\mathbf{y})\) is the i-th component of \(\boldsymbol{D}(\mathbf{y})\) and \(\boldsymbol{T}(\mathbf{y}) = r(\boldsymbol{D}(\mathbf{y}))\).
The supervised versions of the objective functions utilized in this paper are listed in Section 9 of the Appendix.
For classification problems, the objective function obtained by substituting the KL divergence in Theorem 4 (see 21 in Appendix 9.1) is exactly the cross-entropy loss. When the Softmax function is applied to the discriminator output (because \(D^\diamond(\mathbf{x}, \mathbf{y})=p_{X|Y}(\mathbf{x}|\mathbf{y})\) is a discrete pdf), the expectation over \(p_Y(\mathbf{y})\) becomes a constant always equal to \(1\). Maximizing 21 is equivalent to minimizing the negative of 21 , which is precisely the minimization of the CE.
| Dataset | Model | CE | RKL | HD | GAN | P | SL |
|---|---|---|---|---|---|---|---|
| M | Tiny | \(\textbf{99.08} \pm 0.06\) | \(96.05 \pm 0.25\) | \(98.68 \pm 0.05\) | \(\textbf{99.08} \pm 0.07\) | \(98.89 \pm 0.08\) | \(99.03 \pm 0.04\) |
| FM | Tiny | \(91.64 \pm 0.09\) | \(82.63 \pm 1.78\) | \(90.75 \pm 0.13\) | \(91.63 \pm 0.10\) | \(89.86 \pm 0.67\) | \(\textbf{91.83} \pm 0.02\) |
| C10 | Tiny | \(70.13 \pm 0.05\) | \(63.59 \pm 0.34\) | \(69.38 \pm 0.28\) | \(69.98 \pm 0.15\) | \(59.62 \pm 0.45\) | \(\textbf{70.87} \pm 0.26\) |
| VGG | \(93.69 \pm 0.03\) | \(84.24 \pm 2.21\) | \(93.51 \pm 0.06\) | \(93.75 \pm 0.04\) | \(84.79 \pm 0.21\) | \(\textbf{93.93} \pm 0.08\) | |
| DLA | \(95.04 \pm 0.02\) | \(90.83 \pm 0.10\) | \(94.56 \pm 0.11\) | \(95.04 \pm 0.13\) | \(91.61 \pm 0.21\) | \(\textbf{95.31} \pm 0.09\) | |
| ResNet | \(95.39 \pm 0.04\) | \(92.88 \pm 0.26\) | \(95.15 \pm 0.08\) | \(95.24 \pm 0.06\) | \(93.78 \pm 0.21\) | \(\textbf{95.43} \pm 0.04\) | |
| MobileNet | \(92.59 \pm 0.13\) | \(83.97 \pm 0.21\) | \(91.95 \pm 0.33\) | \(92.37 \pm 0.14\) | \(84.30 \pm 0.32\) | \(\textbf{93.89} \pm 0.15\) | |
| C100 | VGG | \(72.73 \pm 0.30\) | \(45.80 \pm 2.86\) | \(73.51 \pm 0.03\) | \(68.88 \pm 0.20\) | \(37.19 \pm 0.66\) | \(\textbf{73.61} \pm 0.05\) |
| DLA | \(76.29 \pm 0.43\) | \(68.86 \pm 1.17\) | \(78.63 \pm 0.14\) | \(77.34 \pm 0.22\) | \(57.97 \pm 0.07\) | \(\textbf{78.65} \pm 0.01\) | |
| ResNet | \(\textbf{78.29} \pm 0.18\) | \(70.68 \pm 0.44\) | \(77.59 \pm 0.06\) | \(77.43 \pm 0.08\) | \(61.12 \pm 0.23\) | \(78.03 \pm 0.04\) | |
| MobileNet | \(72.61 \pm 0.08\) | \(53.17 \pm 0.35\) | \(73.00 \pm 0.30\) | \(65.66 \pm 0.46\) | \(46.00 \pm 0.37\) | \(\textbf{74.78} \pm 0.23\) |
In this section, we report several numerical results to assess the validity of the methods proposed to estimate the posterior probability density and enable the classification task. The considered scenarios are: classification for image datasets; signal
decoding in telecommunications engineering cast into a classification task; posterior probability estimation when \(p_X(\mathbf{x})\) is continuous. The results demonstrate that different \(f\)-divergences attain different performance. We show that the KL divergence (thus the CE) is not necessarily the best choice for classification tasks, and more in general for probability estimation problems. We demonstrate
that the SL divergence achieves the best performance in almost all the tested contexts. When referring to the performance of any \(f\)-divergence, we will implicitly imply the performance achieved using the objective
function derived using such an \(f\)-divergence.
The first two scenarios are classification problems, therefore we use the supervised formulation of the discriminator architecture. The third scenario comprises two toy cases, where we show that the unsupervised formulation of the proposed estimators works
for continuous random vectors \(X\). Before discussing the numerical results, we briefly describe the details of the code implementation1.
Supervised Architecture: For the first scenario (Section 7.2), we use convolutional neural networks. When referring to tiny network, we use a discriminator comprising
a small set of convolutional layers (less than 4) followed by a feedforward fully connected part. Besides the tiny network, in the first scenario we utilize various deep network architectures: VGG [10], ResNet [34], DLA [35], and MobileNetV2 [36].
The discriminator hyper-parameters slightly vary depending on the dataset tested. The network parameters are updated by using SGD with momentum. The activation function of the last layer depends on the objective function optimized during the training
phase.
For the second scenario (Section 7.3), we use fully connected feedforward neural networks. The architecture used for the decoding scenario comprises two hidden layers with \(100\) neurons each. The network weights are updated by using the Adam optimizer [37].
The LeakyReLU activation function is utilized in all the layers except the last one, where the activation function is chosen based on the objective function. In some cases, the Dropout technique [38] helps the convergence of the training process.
Unsupervised Architecture: The discriminator architecture utilized for the unsupervised tasks comprises two hidden layers with \(100\) neurons each and the LeakyReLU activation function. The activation function of the output layer depends on the objective function used during training. The network weights and biases are updated by using the Adam optimizer. Dropout is used during training.
The first scenario tackled is the classification of image datasets. The objective functions performance is tested for the MNIST [39], Fashion MNIST [40], CIFAR10, and CIFAR100 [41] datasets. A more detailed description of the datasets can be found in Appendix 12. We compare the classification accuracy of the supervised versions of the objective functions in Tab. ¿tbl:tab:value32functions? and in 12 , which are all reported in Appendix 9. To improve the training procedure, we apply data augmentation on the CIFAR datasets by randomly cropping and flipping the images. The learning rate is initially set to \(0.1\) and then we use a cosine annealing scheduler [42] to modify its value during the \(200\) epochs of training.

Figure 3: SER achieved by using a 4-PAM modulation over a nonlinear communication channel..

Figure 4: Continuous posterior density estimation for various \(f\)-divergences. The results of the Exponential task is represented in the upper row, while the outcomes of the Gaussian task are depicted in the lower row. The true posterior density is the first plot of each row..
We compute the mean accuracy and its standard deviation for each dataset and \(f\)-divergence by running the code over multiple random seeds. The classification accuracy results displayed in Tab. ¿tbl:tab:classification95images? (and in the extended version comprising more network architectures in Tab. ¿tbl:tab:classification95images95appendix? in Appendix 12) confirm that each generator function has a different impact on the neural network training, as also shown in [21], [24]. The SL divergence attains the highest classification accuracy for almost all the architectures tested, showing its effectiveness compared to the other divergences and its stable behavior over different datasets and architectures. In particular, the SL divergence attains better performance than the CE, which corresponds to the state-of-the-art approach for image classification tasks. Furthermore, in the few scenarios where the SL divergence does not achieve the best performance, it achieves the second best (only in one case the third best, in Table ¿tbl:tab:classification95images95appendix? in Appendix 12) performance, with an accuracy close to the optimal one (see Tables ¿tbl:tab:classification95images?, ¿tbl:tab:classification95images95appendix?). The CE is, on average, the second-best objective function. Conversely, the Pearson \(\chi^2\) performs the worst in almost all the scenarios. Moreover, except from the SL divergence and the CE, the performance of the other \(f\)-divergences is more architecture dependent. For instance, as reported in Tab. ¿tbl:tab:classification95images95appendix? in Appendix 12, the PreActResNet [43] attains the highest accuracy when it is trained with the GAN-based objective function. The choice of the architecture often depends on the goal of the classification algorithm. For embedded systems, light architectures are used. Therefore, the MobileNetV2 is an option [44]. In such a case, the SL divergence obtains an accuracy \(1.5/2\%\) higher than the CE, which makes the SL the preferred choice for the network’s training. Additional numerical results on other network architectures and on the speed of convergence of the training phase are reported in Appendix 12 for space limitations. The speed of convergence analysis (Fig. 5) demonstrates that the training with the SL divergence leads to a faster convergence to the optimum discriminator w.r.t. the GAN divergence, as stated in Corollary 2.
The second scenario is the decoding problem. Decoding a sequence of received bits is crucial in a telecommunication system. In some cases, when the communication channel is known, the optimal decoding technique is also known [27]. However, the communication channel is generally unknown, and DL-based techniques can be used to learn it [45]. By knowing that the optimal decoding criterion is the posterior probability maximization, we demonstrate that the proposed MAP approach solves the decoding problem and that the supervised version of \(\mathcal{J}_{SL}(D)\) (see 31 in Appendix 9.6) achieves optimal performance. We consider a 4-PAM (i.e., pulse amplitude modulation with four symbols) over a nonlinear channel with additive Gaussian noise. In particular, given the symbol at time instant \(t\) (referred to as \(x_t\)), we obtain the channel output as \(y_t = sgn(x_t)\sqrt{|x_t|} + n_t\), where \(n_t\) is the Gaussian noise and \(sgn(\cdot)\) is the sign function. We show the symbol error rate (SER) behavior achieved by the proposed posterior estimators when varying the signal-to-noise ratio (SNR) in Fig. 3. The estimators proposed are compared with the results of the max likelihood estimator (referred to as maxL) and the MAP Genie estimators. The MAP Genie estimator uses the knowledge of the channel nonlinearity to decode the received sequence of bits. The proposed list of posterior probability estimators performs better than the max likelihood estimator, achieving accuracy close to the optimal MAP Genie estimator. In Appendix 12, other scenarios of decoding tasks are reported.
This section considers two toy examples for the case \(|\Omega| \geq |\mathbb{R}|\). The comparison between the closed-form of the posterior distribution and the discriminator estimate is showed in Fig. 4. The discriminator prediction is obtained by training a tiny neural network with the objective functions reported in Tab. ¿tbl:tab:value32functions? and in 12 . The closed-form posterior distribution (referred to as true in Fig. 4) is the first element of each row.
Exponential task. In the first toy example, we define the model \(Y= X+N\), where \(X\) and \(N\) are independent Exponential random variables. Therefore, \(Y\) is a Gamma distribution [46]. The closed-form posterior probability can be expressed as in 47 (see Appendix 10.12 for the formula and proof). Similarly to the previous numerical results, different \(f\)-divergences lead to diverse estimates of the posterior density. The objective functions corresponding to the GAN, SL, and HD divergences attain better estimates w.r.t. the others. For a fixed \(y\), in fact, the posterior density value is constant over \(x\).
Gaussian task. In the second toy example, we consider the model \(Y = X+N\), where \(X\), \(N\) are independent Gaussian random variables. Thus, \(Y\) is a Gaussian distribution. The posterior density expression is reported in Appendix 10.13 (see 48 ). The objective functions corresponding to the SL, KL, and P divergences attain better estimates w.r.t. the others, since the estimate attains the desired saddle shape.
In this paper, we proposed a new MAP perspective for supervised classification problems. We have proposed to use a discriminative formulation to express the posterior probability density, and we have derived two classes of estimators to estimate it. From them, we extracted a list of posterior probability estimators and compared them with the notorious cross-entropy minimization approach. Numerical results on different scenarios demonstrate the effectiveness of the presented estimators and that the proposed SL divergence achieves the highest classification accuracy in almost all the scenarios. Additionally, we show that the proposed posterior probability estimators work for the general case of continuous a priori probabilities, for which we design a specific neural network architecture.
We thank Nunzio Alexandro Letizia for the precious insights and the fruitful discussions. We also thank the anonymous ICML 2024 reviewers for their detailed and helpful feedback.
This paper presents work whose goal is to advance the field of Machine Learning. There are many potential societal consequences of our work, none of which we feel must be specifically highlighted here.
| Name | \(f_{u}(u)\) | \(f_{u}^{*}(t)\) |
|---|---|---|
| KL | \(u \log\left(\frac{u}{|\mathcal{T}_x|}\right)\) | \(|\mathcal{T}_x|\exp{(t-1)}\) |
| RKL | \(-|\mathcal{T}_x|\log(u)\) | \(-|\mathcal{T}_x|(1 + \log(-t))\) |
| HD | \((\sqrt{u} - \sqrt{|\mathcal{T}_x|})^2\) | \(|\mathcal{T}_x|\frac{t}{1-t}\) |
| GAN | \(u \log(u) - (u+|\mathcal{T}_x|)\log(u+|\mathcal{T}_x|)\) | \(-|\mathcal{T}_x|\log(1-\exp{(t)})\) |
| P | \(\frac{1}{|\mathcal{T}_x|}(u-|\mathcal{T}_x|)^2\) | \(|\mathcal{T}_x| \left( \frac{1}{4}t^2 + t \right)\) |
| Name | \(f(u)\) | \(f^{*}(t)\) |
|---|---|---|
| KL | \(u \log(u)\) | \(\exp{(t-1)}\) |
| RKL | \(-\log(u)\) | \(-1- \log(-t)\) |
| HD | \((\sqrt{u} -1)^2\) | \(\frac{t}{1-t}\) |
| GAN | \(u \log(u) - (u+1)\log(u+1)\) | \(-\log(1-\exp{(t)})\) |
| P | \((u-1)^2\) | \(\frac{1}{4}t^2 + t\) |
The unsupervised and supervised versions of the objective functions used to achieve the results showed in Section 7 are reported in this section. The training part consists in the alternation of two phases. In the
former phase, the network is fed with \(N\) realizations of the joint distribution \(p_{XY}(\mathbf{x}, \mathbf{y})\) to compute the first term of the objective function. In the latter
phase, the type of architecture defines the procedure to compute the second term of the objective function. The unsupervised architecture is fed with \(N\) samples drawn from \(p_U(\mathbf{x})p_Y(\mathbf{y})\). The supervised architecture is fed with \(N\) samples drawn from \(p_Y(\mathbf{y})\) (see Theorem 4).
During the test part, the network is fed with the samples drawn from the joint distribution (\((\mathbf{x}, \mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})\)), and the posterior probability density estimate is obtained as
in 7 or 9 .
We report the objective functions derived from well-known \(f\)-divergences. Therefore, we first report the notorious \(f\)-divergences in Table
¿tbl:tab:f95divergences95table?, and their unsupervised version in Table ¿tbl:tab:f95divergences95table95unsupervised?. These tables do not contain the constant terms that render \(f_u(1)=0\) or \(f(1)=0\), as their presence do not affect the optimization of the derived objective functions (see the proof of Lemma 3). Let \(f_{u}\) and \(f_{u}^{*}\) the unsupervised generator function and its Fenchel conjugate in Table
¿tbl:tab:f95divergences95table95unsupervised?, respectively. Differently, \(f\) and \(f^{*}\) are the supervised generator function and its Fenchel conjugate in Table
¿tbl:tab:f95divergences95table?, respectively. Then, \[\label{eq:unsupervised95f95def} f_{u}^{*}(t) = |\mathcal{T}_x| f^{*}(t),\tag{19}\] where
\(|\mathcal{T}_x|\) is the Lebesgue measure of the support of \(p_X(\mathbf{x})\). Accordingly, \[f_{u}(u) = \sup_{t \in dom_{f_{u}^{*}}} \left\{ ut - f_{u}^{*}(t)
\right\} .\] Vice versa, the supervised version of \(f_u\) and \(f_u^*\) can be easily attained by substituting \(|\mathcal{T}_x|=1\) in the
unsupervised formulation.
The usage of 19 in Theorem 1 is needed because \(|\mathcal{T}_x|\) counterbalances the
effect of \(p_U(\mathbf{x})\) to obtain the pdf ratio equivalent to the posterior density \(p_{X|Y}(\mathbf{x}| \mathbf{y}) = p_{XY}(\mathbf{x}, \mathbf{y})/p_Y(\mathbf{y})\). In fact, \(|\mathcal{T}_x|\) is included in the expectation term computed over \(p_U(\mathbf{x})\). In Lemma 3, we prove that \(f_u\) is the generator function of a valid \(f\)-divergence.
Note: The notations supervised and unsupervised refer to the discriminator architecture. The former one is the typical supervised classification architecture, while the latter one does not use \(X\) as the set of labels, but as an additional input. The terminology we use to distinguish between the two different versions of \(f\)-divergences (\(f\) and \(f_u\)) is a consequence of the architecture’s notation. The unsupervised architecture, in fact, is trained using objective functions defined with \(f_u\) (see Theorem 1 and Corollary 1), while the supervised architecture is trained by using objective functions based on \(f\) (see Theorem 4).
We recall the notation used in the objective functions: \(\boldsymbol{D}(\mathbf{y}) = [D(\mathbf{x}_1, \mathbf{y}), \dots, D(\mathbf{x}_m, \mathbf{y})]\) is a row vector, \(\boldsymbol{1}_m = [1, \dots, 1]^T\) is a column vector and \(\boldsymbol{1}_m(\mathbf{x}_i)=[0, \dots, 0, \underbrace{1}_{i^{th} \>\> pos.}, 0, \dots, 0]^T\) is a column vector.
Kullback-Leibler Divergence: The variational representation of the KL divergence is achieved substituting \(f_{u,KL}^{*}\) listed in Table ¿tbl:tab:f95divergences95table95unsupervised?
in 6 . This leads to the unsupervised objective function \[\begin{align}
\label{eq:kl95value95function} \mathcal{J}_{KL}(D) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ \log(D(\mathbf{x}, \mathbf{y})) \Bigr] - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y})
\sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| D(\mathbf{x}, \mathbf{y}) \Bigr] + 1 ,
\end{align}\tag{20}\] where \(T^{\diamond}(\mathbf{x}, \mathbf{y}) = \log(\frac{p_{XY}(\mathbf{x}, \mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}) + 1\), \(p_U(\mathbf{x}) = \frac{1}{|\mathcal{T}_x|}\), and \(D^{\diamond}(\mathbf{x}, \mathbf{y})= \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_Y(\mathbf{y})}\). The supervised version of the objective
function in 20 is attained by using Theorem 4:
\[\begin{align}
\label{eq:kl95value95function95supervised} \mathcal{J}_{KL}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_{X}(\mathbf{x})} \Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}| \mathbf{x})} \Bigl[
\log(\boldsymbol{D}(\mathbf{y})) \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] - \mathop{\mathrm{\mathbb{E}}}_{ \mathbf{y} \sim p_Y(\mathbf{y})} \Bigl[ \boldsymbol{D}(\mathbf{y}) \boldsymbol{1}_m \Bigr] .
\end{align}\tag{21}\] When the last layer of the supervised discriminator utilizes the softmax activation function (i.e., when the output is normalized to be a discrete probability density function), then the second term in 21 is always equal to 1. Thus, the maximization of 21 exactly corresponds to the minimization of the KL divergence in 1 , and therefore to the minimization of the cross-entropy.
Interestingly, the more general formulation in 21 allows the usage of different activation functions in the last layer, with the only requirement that the discriminator’s output is constrained to assume
positive values (e.g., softplus).
Reverse Kullback-Leibler Divergence: Theorem 1 leads to the variational representation of the reverse KL divergence, when substituting \(f_{u,RKL}^{*}\) listed in Table ¿tbl:tab:f95divergences95table95unsupervised? in 6 \[\begin{align} \label{eq:reverseKL95value95function} \mathcal{J}_{RKL}(D) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ - D(\mathbf{x}, \mathbf{y}) \Bigr] + \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \log(D(\mathbf{x}, \mathbf{y})) \Bigr] , \end{align}\tag{22}\] where \(T^{\diamond}(\mathbf{x}, \mathbf{y}) = -\frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y})}\) and \(D^{\diamond}(\mathbf{x}, \mathbf{y}) = \frac{p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y})}\). The supervised version of the objective function in 22 is obtained by using Theorem 4. \[\begin{align} \label{eq:supervised95reverseKL95value95fucntion} \mathcal{J}_{RKL}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_{X}(\mathbf{x})} \Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}| \mathbf{x})} \Bigl[ - \boldsymbol{D}(\mathbf{y}) \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] + \mathop{\mathrm{\mathbb{E}}}_{ \mathbf{y} \sim p_Y(\mathbf{y})} \Bigl[ \log(\boldsymbol{D}(\mathbf{y})) \boldsymbol{1}_m \Bigr] . \\ \notag \end{align}\tag{23}\]
Hellinger Squared Distance: Theorem 1 leads to the variational representation of the Hellinger squared distance, when substituting \(f_{u,HD}^{*}\) listed in Table ¿tbl:tab:f95divergences95table95unsupervised? in 6 \[\begin{align} \label{eq:HD95value95function} \mathcal{J}_{HD}(D) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[- \sqrt{D(\mathbf{x}, \mathbf{y})} \Bigr] - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Biggl[ |\mathcal{T}_x| \frac{1}{\sqrt{D(\mathbf{x}, \mathbf{y})}} \Biggr] , \end{align}\tag{24}\] where \(T^{\diamond}(\mathbf{x}, \mathbf{y}) = \left( \sqrt{\frac{p_{XY}(\mathbf{x}, \mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}} - 1 \right) \sqrt{\frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y})}}\), and \(D^{\diamond}(\mathbf{x}, \mathbf{y}) = \frac{p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y})}\). The supervised implementation of the objective function in 24 is achieved by using Theorem 4 \[\begin{align} \label{eq:supervised95HD95value95function} \mathcal{J}_{HD}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_{X}(\mathbf{x})} \Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}| \mathbf{x})} \Bigl[ -\sqrt{\boldsymbol{D}(\mathbf{y})} \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] - \mathop{\mathrm{\mathbb{E}}}_{ \mathbf{y} \sim p_Y(\mathbf{y})} \Biggl[ \frac{1}{\sqrt{\boldsymbol{D}(\mathbf{y})}} \boldsymbol{1}_m \Biggr] . \\ \notag \end{align}\tag{25}\]
GAN: Theorem 1 leads to the variational representation of the GAN divergence, when substituting \(f_{u,GAN}^{*}\) listed in Table ¿tbl:tab:f95divergences95table95unsupervised? in 6 \[\begin{align} \label{eq:GAN95value95function} \mathcal{J}_{GAN}(D) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[\log(1 - D(\mathbf{x}, \mathbf{y}) )\Bigr] + \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \log(D(\mathbf{x}, \mathbf{y})) \Bigr] , \end{align}\tag{26}\] where \(T^{\diamond}(\mathbf{x}, \mathbf{y}) = \log{\left( \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y}) + |\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})} \right)}\) and \(D^{\diamond}(\mathbf{x}, \mathbf{y})= \frac{p_Y(\mathbf{y})}{p_Y(\mathbf{y}) + p_{XY}(\mathbf{x}, \mathbf{y})}\). The supervised implementation of the objective function in 26 is \[\begin{align} \label{eq:supervised95GAN95value95function} \mathcal{J}_{GAN}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_{X}(\mathbf{x})} \Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}| \mathbf{x})} \Bigl[ \log(\boldsymbol{1}_m - \boldsymbol{D}(\mathbf{y})) \cdot \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] \notag + \mathop{\mathrm{\mathbb{E}}}_{ \mathbf{y} \sim p_Y(\mathbf{y})} \Bigl[ \log(\boldsymbol{D}(\mathbf{y})) \boldsymbol{1}_m \Bigr] . \\ \end{align}\tag{27}\]
Pearson \(\chi^2\): Theorem 1 leads to the variational representation of the Pearson \(\chi^2\) divergence, when substituting \(f_{u,P}^{*}\) listed in Table ¿tbl:tab:f95divergences95table95unsupervised? in 6 \[\begin{align} \label{eq:P95value95function} \mathcal{J}_{P}(D) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ 2 (D(\mathbf{x}, \mathbf{y}) - 1) \Bigr] - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x}, \mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Biggl[ |\mathcal{T}_x| D^2(\mathbf{x}, \mathbf{y}) \Biggr] , \end{align}\tag{28}\] where \(T^{\diamond}(\mathbf{x}, \mathbf{y}) = 2 \left( \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})} - 1 \right)\), and \(D^{\diamond}(\mathbf{x}, \mathbf{y}) = \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_Y(\mathbf{y})}\). The supervised implementation of the objective function in 28 is achieved by using Theorem 4 \[\begin{align} \label{qftcselu} \mathcal{J}_{P}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_{X}(\mathbf{x})} \Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}| \mathbf{x})} \Bigl[ 2(\boldsymbol{D}(\mathbf{y}) - \boldsymbol{1}_m) \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] - \mathop{\mathrm{\mathbb{E}}}_{ \mathbf{y} \sim p_Y(\mathbf{y})} \Biggl[ \boldsymbol{D}(\mathbf{y})\boldsymbol{D}^T(\mathbf{y}) \Biggr] , \\ \notag \end{align}\tag{29}\] where \(\boldsymbol{D}(\mathbf{y})\boldsymbol{D}^T(\mathbf{y}) = \sum_{i=1}^m D^2(\mathbf{x}_i, \mathbf{y})\).
The unsupervised and supervised versions of the objective function corresponding to the shifted log divergence are discussed in this paragraph. For completeness, we report here the generator function and its Fenchel conjugate.
\(f_{u, SL}(u) = - |\mathcal{T}_x| \log(u + |\mathcal{T}_x|)\), \(f_{u, SL}^{*}(t) = -|\mathcal{T}_x|(\log(-t) + t)\).
Shifted log: Theorem 2 leads to the objective function in 12 when \[\begin{align} k(p_{X|Y}(\mathbf{x}|\mathbf{y})) &= \frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y}) + p_{XY}(\mathbf{x},\mathbf{y})} \\ g_1(D,k; 1, 0) & = - \frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y}) + p_{XY}(\mathbf{x}, \mathbf{y})}{D(\mathbf{x}, \mathbf{y})} . \end{align}\] We report here for completeness the unsupervised objective function in 12 \[\begin{align} \label{eq:SL95value95function} \mathcal{J}_{SL}(D) & = - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ D(\mathbf{x}, \mathbf{y}) \Bigr] + \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \Bigl( \log(D(\mathbf{x}, \mathbf{y})) - D(\mathbf{x}, \mathbf{y}) \Bigr) \Bigr] , \end{align}\tag{30}\] which can be obtained from Theorem 1 with \(T^{\diamond}(\mathbf{x}, \mathbf{y}) = -\frac{|\mathcal{T}_x| p_U(\mathbf{x})p_Y(\mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y}) + p_{XY}(\mathbf{x}, \mathbf{y})}\) and \(D^{\diamond}(\mathbf{x}, \mathbf{y}) = \frac{p_Y(\mathbf{y})}{p_Y(\mathbf{y}) + p_{XY}(\mathbf{x}, \mathbf{y})}\). The supervised implementation of the objective function in 30 is achieved by using Theorem 4 \[\begin{align} \label{eq:supervised95SL95value95function} \mathcal{J}_{SL}(D) & = - \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_{X}(\mathbf{x})} \Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}| \mathbf{x})} \Bigl[ \boldsymbol{D}(\mathbf{y})^T \boldsymbol{1}_m(\mathbf{x})\Bigr] \Biggr] + \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_Y(\mathbf{y})} \Bigl[ \Bigl( \log( \boldsymbol{D}(\mathbf{y})) - \boldsymbol{D}(\mathbf{y}) \Bigr)^T \boldsymbol{1}_m \Bigr] . \end{align}\tag{31}\]
Lemma 2. Let \(f: \mathbb{R}_+ \longrightarrow \mathbb{R}\) be the generator function of any \(f\)-divergence. Then, it holds: \[\label{eq:f95equivalence} (f^{*})'(t) = (f^{'})^{-1}(t)\tag{32}\]
Proof. Let us recall the definition of Fenchel conjugate, to report a self-contained proof: \[f^*(t) = \sup_{u \in \mathbb{R}} \left\{ ut - f(u) \right\} .\] Then, in order to find \(\hat{u}\) that achieves the supremum, we impose \[\label{eq:fenchel95derivative950} \frac{\partial}{\partial u} \left\{ ut- f(u) \right\} = 0 ,\tag{33}\] that implies \(f^{'}(u) = t\). The condition 33 can be imposed because \(f(\cdot)\) is a convex function. Thus, \[\label{eq:u95hat} \hat{u} = (f^{'})^{-1}(t)\tag{34}\] Then, substituting 34 in the definition of the fenchel conjugate, it becomes: \[f^*(t) = (f^{'})^{-1}(t)t - f((f^{'})^{-1}(t)) .\] Then, by computing the first derivative w.r.t. \(t\): \[(f^{*})^{'}(t) = ((f^{'})^{-1})^{'}(t)t + (f^{'})^{-1}(t) - \underbrace{f^{'}((f^{'})^{-1}(t))}_{=t} ((f^{'})^{-1})^{'}(t) .\] The first and third terms cancel out, leading to 32 . ◻
Lemma 3. Let \(f: \mathbb{R}_+ \longrightarrow \mathbb{R}\) be the generator function of any \(f\)-divergence, \(f^*(\cdot)\) its Fenchel conjugate, and \(K>0\) a constant. Then, \(f^*_u(t) \triangleq K f^*(t)\) is the Fenchel conjugate of a valid \(f\)-divergence.
Proof. Firstly, we must prove the convexity of \(f_u(u)\). Since \(f^*(t)\) is a convex function, then also \(f^*_u(t)\) is a convex function
because \(K\) is a positive constant (if the second derivative of \(f^*(t)\) is non-negative, then multiplying it by a positive constant will result in a non-negative function). If \(f^*_u(t)\) is a convex function, then also \(f_u(u)\) is convex, by definition, because it is computed as the Fenchel conjugate (i.e., the convex conjugate).
Secondly, if \(f_u(1)=C\), then \(f_u(1)=0\) is achieved by subtracting \(C\) to the \(f_u(u)\) obtained from the
computation of the Fenchel conjugate of \(f_u^*(t)\). The subtraction of \(C\) to \(f_u(u)\) has just a translation effect, not affecting the training
process. To prove it, let consider \(f_u(u) = f_u^{\bullet}(u)-C\), with \(f_u(1)=0\) (thus \(f_u^\bullet(1)=C\)). Then, \[\begin{align} f^*_u(t)= \sup_u[ut - f_u(u)] = \sup_u[ut-f_u^\bullet(u) + C]
\end{align}\] The \(u\) that maximizes \(ut-f_u^\bullet(u) + C\) (referred to as \(\hat{u}\)) is obtained by imposing the first derivative w.r.t.
\(u\) equal to zero (similarly to 33 and 34 in the proof of Lemma 2). Therefore, \(\hat{u}\) is not influenced by \(C\), since \(C\) disappears when computing the first derivative.
Then, the value of \(\hat{u}\) is substituted in \(ut-f_u^\bullet(u) + C\). Therefore, we obtain \(f^*_u(t) = \hat{u}t-f_u^\bullet(\hat{u}) + C\), where the
first two terms \(\hat{u}t\) and \(f_u^\bullet(\hat{u})\) do not depend on \(C\). Thus, \(C\) becomes a constant in \(f_u^*(t)\), which implies that it becomes an additive constant in the objective function (see 6 ), which does not have any effect on the training procedure.
Finally, \(f_u(1)=C\) (thus \(f^*_u(t) = \hat{u}t-f_u^\bullet(\hat{u}) + C\)) does not impact the estimate of \(p_{X|Y}\), since it is computed using \((f_u^*)^{\prime}(\cdot)\), which is not affected by \(C\). ◻
Theorem 1. Let \(X\) and \(Y\) be the random vectors with probability density functions \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Assume \(\mathbf{y} = H(\mathbf{x})\), where \(H(\cdot)\) is a stochastic function, then \(p_{XY}(\mathbf{x}, \mathbf{y})\) is the joint density. Define \(\mathcal{T}_x\) to be the support of \(X\) and \(p_U(\mathbf{x})\) to be a uniform distribution with support \(\mathcal{T}_x\). Let \(f_{u}: \mathbb{R}_+ \longrightarrow \mathbb{R}\) be a convex function such that \(f_{u}(1)=0\), and \(f_{u}^*\) be the Fenchel conjugate of \(f_{u}\). Let \(\mathcal{J}_f(T)\) be the objective function defined as \[\begin{align} \label{eq:top95down95variational95representation95posterior95appendix} \mathcal{J}_f(T) &= \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_{XY}(\mathbf{x},\mathbf{y})} \left[ T(\mathbf{x},\mathbf{y}) \right] - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \left[ f_{u}^*(T(\mathbf{x},\mathbf{y})) \right] . \end{align}\qquad{(1)}\] Then, \[T^{\diamond}(\mathbf{x},\mathbf{y}) = \mathop{\mathrm{arg\,max}}_{T \in \mathcal{T}} \mathcal{J}_f(T)\] leads to the estimation of the posterior density \[\label{eq:top95down95posterior95estimator95appendix} \hat{p}_{X|Y}(\mathbf{x}|\mathbf{y}) = \frac{p_{XY}(\mathbf{x},\mathbf{y})}{p_Y(\mathbf{y})} = \frac{(f_{u}^{*})^{\prime}(T^{\diamond}(\mathbf{x},\mathbf{y}))}{|\mathcal{T}_x|},\qquad{(2)}\] where \(T^{\diamond}(\mathbf{x},\mathbf{y})\) is parametrized by an artificial neural network.
Proof. From [26], \(T^{\diamond}(\mathbf{x}, \mathbf{y})\) achieved when maximizing ?? is \[\label{eq:t95opt95top95down95appendix} T^{\diamond}(\mathbf{x}, \mathbf{y}) = f^{\prime}_u \left( \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_U(\mathbf{x})p_Y(\mathbf{y})}\right) ,\tag{35}\] as defined in 5 . Thus, ?? is equivalent to \[\begin{align} \tag{36} \frac{(f_{u}^{*})^{\prime}(T^{\diamond}(\mathbf{x},\mathbf{y}))}{|\mathcal{T}_x|} &= \frac{(f_u^\prime)^{-1}(T^{\diamond}(\mathbf{x},\mathbf{y}))}{|\mathcal{T}_x|}\\ \tag{37} &= \frac{(f_u^\prime)^{-1} \Bigl(f^{\prime}_u \left( \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_U(\mathbf{x})p_Y(\mathbf{y})}\right) \Bigr)}{|\mathcal{T}_x|} \\ &= \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}\\ &= \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{p_Y(\mathbf{y})} , \end{align}\] where the equality in 36 is proved in Lemma 2 in Appendix 10, while 37 is obtained by substituting 35 in 36 . Since \(p_U(\mathbf{x}) = \frac{1}{|\mathcal{T}_x|}\), as it is the uniform probability density function (pdf) over \(\mathcal{T}_x\), the thesis follows. From [47], the usage of the uniform probability density function \(p_U(\mathbf{x})\) is fundamental to define the objective function in ?? . Its importance derives from the need of the discriminator to be fed with both \(X\) and \(Y\) realizations. ◻
Lemma 2. Let the artificial neural network \(D(\cdot) \in \mathcal{D}\) be with enough capacity and training time (i.e., in the nonparametric limit). Assume the gradient ascent update rule \(D^{(i+1)} = D^{(i)} + \mu \nabla \mathcal{J}_f(D^{(i)})\) converges to \[D^{\diamond} = \mathop{\mathrm{arg\,max}}_{D \in \mathcal{D}} \mathcal{J}_f(D) ,\] where \(\mathcal{J}_f(D)\) is defined as in 6 , with the change of variable \(D = r^{-1}(T)\). Then, the difference between the optimal posterior probability and its estimate at iteration \(i\) is \[\begin{align} p^{\diamond} - p^{(i)} \simeq \frac{1}{|\mathcal{T}_x|} \Bigl( \delta^{(i)} \Bigl[ (f_{u}^{*})^{\prime \prime}(r(D^{(i)})) \Bigr] \Bigr) , \label{eq:gap95optimum95posterior95appendix} \end{align}\qquad{(3)}\] where \(\delta^{(i)}=r(D^{\diamond}) - r(D^{(i)})\), and \(\mu >0\) the learning rate. If \(D^{\diamond}\) corresponds to the global optimum achieved by using the gradient ascent method, the posterior probability estimator in 7 converges to the real value of the posterior density.
Proof. The proof follows a procedure similar to Lemma 3 in [25]. We define \(\delta^{(i)} = r(D^{\diamond}) - r(D^{(i)})\) as the difference between the optimum \(T^{\diamond}\) and the one achieved at the \(i^{th}\) iteration of the training procedure, when using a gradient ascent update method. Define \(p^{(i)}\) and \(p^{\diamond}\) as the posterior probability estimate at iteration \(i\) and the optimum, respectively. Then, \[\begin{align} p^{\diamond} - p^{(i)} &= \frac{1}{|\mathcal{T}_x|} \Bigl((f_{u}^{*})^{\prime} (r(D^{\diamond})) - (f_{u}^{*})^{\prime}(r(D^{(i)})) \Bigr) \\ &= \frac{1}{|\mathcal{T}_x|} \Bigl( (f_{u}^{*})^{\prime} (r(D^{\diamond})) - (f_{u}^{*})^{\prime}(r(D^{\diamond}) - \delta^{(i)}) \Bigr) \\ & \simeq \frac{1}{|\mathcal{T}_x|} \Bigl( \delta^{(i)} \Bigl[ (f_{u}^{*})^{\prime \prime}(r(D^{\diamond}) - \delta^{(i)}) \Bigr] \Bigr) , \label{eq:gap95optimum95posterior95appendix95penultimo} \end{align}\tag{38}\] where the last step develops from the first order Taylor expansion in \(r(D^{\diamond}) - \delta^{(i)}\). From 38 , the thesis in ?? follows. If the gradient ascent method converges towards the maximum, \(\delta^{(i)} \longrightarrow 0\). Thus, when \(i \longrightarrow \infty\), \(|p^{\diamond} - p^{(i)}| \longrightarrow 0\). ◻
Theorem 3. Let \(X\) and \(Y\) be the random vectors with probability density functions \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Assume \(\mathbf{y} = H(\mathbf{x})\), where \(H(\cdot)\) is a stochastic function, then \(p_{XY}(\mathbf{x}, \mathbf{y})\) is the joint density. Let \(\mathcal{T}_x\) and \(\mathcal{T}_y\) be the support of \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Let the discriminator \(D(\mathbf{x}, \mathbf{y})\) be a scalar function of \(\mathbf{x}\) and \(\mathbf{y}\). Let \(k(\cdot)\) be any deterministic and invertible function. Then, the posterior density is estimated as \[\label{eq:bottom95up95posterior95estimator95appendix} \hat{p}_{X|Y}(\mathbf{x}|\mathbf{y}) = k^{-1}(D^{\diamond}(\mathbf{x}, \mathbf{y})) ,\qquad{(4)}\] where \(D^{\diamond}(\mathbf{x},\mathbf{y})\) is the optimal discriminator obtained by maximizing \[\label{eq:value95function95general95bottom95up95appendix} \mathcal{J}(D) = \int_{\mathcal{T}_x} \int_{\mathcal{T}_y} \tilde{\mathcal{J}}(D) d\mathbf{x} d\mathbf{y},\qquad{(5)}\] for all concave functions \(\tilde{\mathcal{J}}(D)\) such that their first derivative is \[\begin{align} \label{eq:g40D4195appendix} \frac{\partial \tilde{\mathcal{J}}(D)}{\partial D} &= \Bigl( D(\mathbf{x}, \mathbf{y}) - k(p_{X|Y}(\mathbf{x}|\mathbf{y}))\Bigr) g_1(D,k) \notag \\ & \triangleq g(D, k) \end{align}\qquad{(6)}\] with \(g_1(D,k) \neq 0\) deterministic, and \(\frac{\partial g(D,k)}{ \partial D} \leq 0\).
Proof. A necessary condition to maximize \(\mathcal{J}(D)\) requires to set the first derivative of the integrand \(\tilde{\mathcal{J}}(D)\) w.r.t. \(D\) equal to zero. Since \(g_1(D,k) \neq 0\), from ?? easily follows \[\label{eq:D95star95k95appendix} D^{\diamond}(\mathbf{x}, \mathbf{y}) = k(p_{X|Y}(\mathbf{x}|\mathbf{y})) = k \left( \frac{p_{XY}(\mathbf{x},\mathbf{y})}{p_Y(\mathbf{y})} \right) .\tag{39}\] The concavity of \(\tilde{\mathcal{J}}(D)\) is obtained by imposing the first derivative of \(g(D,k)\) with respect to \(D\) to be nonpositive, i.e., \[\begin{align} 0 & \geq \frac{\partial }{\partial D} \Bigl\{ \Bigl( D(\mathbf{x}, \mathbf{y}) - k(p_{X|Y}(\mathbf{x}|\mathbf{y}))\Bigr) g_1(D,k) \Bigr\} \notag \\ & = g_1(D,k) + \Bigl( D(\mathbf{x}, \mathbf{y}) - k(p_{X|Y}(\mathbf{x}|\mathbf{y}))\Bigr) \frac{\partial g_1(D,k)}{\partial D} . \end{align}\] Therefore, the stationary point \(D^{\diamond}(\mathbf{x}, \mathbf{y})\) corresponds to a maximum. ◻
Corollary 4. Let \(\mathcal{J}(D)\) be defined as in Theorem 2. Let \[\begin{align} k(p_{X|Y}(\mathbf{x}|\mathbf{y})) = k \left( \frac{p_{XY}(\mathbf{x},\mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})} \right) = \frac{p_0}{p_1} . \end{align}\] Let \[\label{eq:g95140D41} g_1(D,k; \alpha, \beta) \triangleq -\frac{p_1}{D^{\alpha}} \left( \frac{1}{1-D} \right)^{\beta} ,\qquad{(7)}\] where \(\alpha, \beta \in \mathbb{Q}\). Then, the objective functions in Table ¿tbl:tab:value32functions? are obtained from Theorem 2 by using \(k(\cdot)\) and \(g_1(\cdot)\) as defined in the set \(\mathcal{F}_{k, g_1}\triangleq \{(k(x), (\alpha, \beta))_f \}\): \[\begin{align} \mathcal{F}_{k, g_1} = &\Biggl\{ \Biggl(x, \left(1, 0 \right) \Biggr)_{KL}, \Biggl(-\frac{1}{x}, \left(1,0\right)\Biggr)_{RKL}, \Biggl(\frac{1}{x}, \left(\frac{3}{2},0\right)\Biggr)_{HD}, \Biggl(\frac{1}{1+x}, \left(1,1\right)\Biggr)_{GAN}, \Biggl( x, (0,0) \Biggr)_{P} \Biggr\} \end{align}\]
Proof. Let rewrite for completeness \[\begin{align} k_{KL}(p_{X|Y}(\mathbf{x}|\mathbf{y})) &= p_{X|Y}(\mathbf{x}|\mathbf{y}),\\ k_{RKL}(p_{X|Y}(\mathbf{x}|\mathbf{y})) &= -\frac{1}{p_{X|Y}(\mathbf{x}|\mathbf{y})},\\ k_{HD}(p_{X|Y}(\mathbf{x}|\mathbf{y})) &= \frac{1}{p_{X|Y}(\mathbf{x}|\mathbf{y})},\\ k_{GAN}(p_{X|Y}(\mathbf{x}|\mathbf{y})) &= \frac{1}{1 + p_{X|Y}(\mathbf{x}|\mathbf{y})},\\ k_{P}(p_{X|Y}(\mathbf{x}|\mathbf{y})) &= p_{X|Y}(\mathbf{x}|\mathbf{y}), \end{align}\] and \[\begin{align} g_{1_{KL}}(D,k) &= -\frac{p_U(\mathbf{x})p_Y(\mathbf{y})|\mathcal{T}_x|}{D(\mathbf{x}, \mathbf{y})},\\ g_{1_{RKL}}(D,k) &= \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{D(\mathbf{x}, \mathbf{y})},\\ g_{1_{HD}}(D,k) &= -\frac{p_{XY}(\mathbf{x}, \mathbf{y})}{D^{\frac{3}{2}}(\mathbf{x}, \mathbf{y})},\\ g_{1_{GAN}}(D,k) &= -\frac{p_U(\mathbf{x})p_Y(\mathbf{y})|\mathcal{T}_x| + p_{XY}(\mathbf{x}, \mathbf{y})}{D(\mathbf{x}, \mathbf{y})(1-D(\mathbf{x}, \mathbf{y}))},\\ g_{1_{P}}(D,k) &= -p_U(\mathbf{x})p_Y(\mathbf{y})|\mathcal{T}_x|, \end{align}\] where the dependence of \(g_1(\cdot)\) from \(k\) is intrinsic in \(p_1\). For instance, the KL and RKL divergences are obtained by using the same values of \(\alpha\) and \(\beta\) in ?? , but since \(k_{KL}(\cdot) \neq k_{RKL}(\cdot)\), \(g_{1_{KL}}(\cdot) \neq g_{1_{RKL}}(\cdot)\) . \(g_1(\cdot) \neq 0\) because by definition each pdf is different from \(0\) in its support. After a substitution in 11 , we obtain \[\begin{align} g_{KL}(D,k) &= \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{D(\mathbf{x}, \mathbf{y})} - p_U(\mathbf{x})p_Y(\mathbf{y})|\mathcal{T}_x|, \\ g_{RKL}(D,k) &= - p_{XY}(\mathbf{x}, \mathbf{y}) - \frac{p_Y(\mathbf{y})}{D(\mathbf{x}, \mathbf{y})},\\ g_{HD}(D,k) &= -\frac{p_{XY}(\mathbf{x}, \mathbf{y})}{\sqrt{D(\mathbf{x}, \mathbf{y})}} + \frac{p_U(\mathbf{x})p_Y(\mathbf{y})}{\sqrt{D^3(\mathbf{x}, \mathbf{y})}},\\ g_{GAN}(D,k) &= \frac{p_U(\mathbf{x})p_Y(\mathbf{y})|\mathcal{T}_x|}{D(\mathbf{x}, \mathbf{y})} - \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{1-D(\mathbf{x}, \mathbf{y})}, \\ g_{P}(D,k) &= p_{XY}(\mathbf{x}, \mathbf{y}) - p_U(\mathbf{x})p_Y(\mathbf{y})|\mathcal{T}_x|D(\mathbf{x}, \mathbf{y}). \end{align}\] After the integration w.r.t. \(D\) and the substitution in 10 , the objective functions in Table ¿tbl:tab:value32functions? are attained. ◻
Theorem 5. Let \(X\) and \(Y\) be two random vectors with pdfs \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\), respectively. Assume \(Y = H(X)\), with \(H(\cdot)\) stochastic function, then let \(p_{XY}(\mathbf{x}, \mathbf{y})\) be the joint density. Let \(\mathcal{T}_x\) be the support of \(X\). Let \(p_U(\mathbf{x})\) be a uniform pdf having the same support \(\mathcal{T}_x\). The maximization of the objective function \[\begin{align} \label{eq:fNOME95cost95fcn95appendix} \mathcal{J}_{SL}(D) & = - \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_{XY}(\mathbf{x}, \mathbf{y})} \Bigl[ D(\mathbf{x}, \mathbf{y}) \Bigr] + \mathop{\mathrm{\mathbb{E}}}_{(\mathbf{x},\mathbf{y}) \sim p_U(\mathbf{x})p_Y(\mathbf{y})} \Bigl[ |\mathcal{T}_x| \Bigl( \log(D(\mathbf{x}, \mathbf{y})) - D(\mathbf{x}, \mathbf{y}) \Bigr) \Bigr], \end{align}\qquad{(8)}\] leads to the optimal discriminator output \[\label{eq:fNAME95D95opt95appendix} D^{\diamond}(\mathbf{x}, \mathbf{y}) = \mathop{\mathrm{arg\,max}}_{D} \mathcal{J}_{SL}(D) = \frac{1}{1 + p_{X|Y}(\mathbf{x}, \mathbf{y})} ,\qquad{(9)}\] and the posterior density estimate is computed as \[\label{eq:posterior95estimator95sl95appendix} \hat{p}_{X|Y}(\mathbf{x}|\mathbf{y}) = \frac{1 - D^{\diamond}(\mathbf{x},\mathbf{y})}{D^{\diamond}(\mathbf{x},\mathbf{y})} .\qquad{(10)}\]
Proof. Following Theorem 2, the proof starts by inverting 9 . Specifically, we set \(k(x) = \frac{1}{1+x}\) and from ?? , by expressing the posterior density as the density ratio \(p_{XY}/p_Y\), we achieve \[D^{\diamond}(\mathbf{x}, \mathbf{y}) - \frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y}) + p_{XY}(\mathbf{x},\mathbf{y})} = 0 ,\] where \(p_U(\mathbf{x}) = 1/|\mathcal{T}_x|\). Then, ?? with \(\alpha=1\) and \(\beta=0\) becomes \[\begin{align} \label{eq:g95140D4195SL} g_1(D,k; 1, 0) & = - \frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y}) + p_{XY}(\mathbf{x}, \mathbf{y})}{D(\mathbf{x}, \mathbf{y})} . \end{align}\tag{40}\] Then, 40 is substituted in 11 , obtaining \[\begin{align} \label{eq:partial95der95fNome} g(D,k) = \frac{\partial }{\partial D} \mathcal{\tilde{J}}(D) =& - \Bigl( |\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y}) + p_{XY}(\mathbf{x},\mathbf{y}) \Bigr) + \frac{|\mathcal{T}_x|p_U(\mathbf{x})p_Y(\mathbf{y})}{D(\mathbf{x}, \mathbf{y})} . \end{align}\tag{41}\] The computation of the integral of 41 with respect to the discriminator’s output \(D\) leads to \[\begin{align} \tilde{\mathcal{J}}(D) &= - p_{XY}(\mathbf{x}, \mathbf{y}) D(\mathbf{x}, \mathbf{y}) + |\mathcal{T}_x| p_U(\mathbf{x})p_Y(\mathbf{y}) \Bigl( \log(D(\mathbf{x}, \mathbf{y})) - D(\mathbf{x}, \mathbf{y}) \Bigr) , \end{align}\] which proves the statement of the theorem, since \[\frac{\partial g(D,k)}{\partial D} = -\frac{p_Y(\mathbf{y})}{D^2(\mathbf{x}, \mathbf{y})} \leq 0 .\] Given the optimum discriminator \(D^{\diamond}\), the posterior density estimator in ?? is achieved by inverting ?? . ◻
Corollary 6. Define the generator function \[f_{u, SL}(u) = - |\mathcal{T}_x| \log(u + |\mathcal{T}_x|) + K ,\] where \(K=|\mathcal{T}_x| \log(1 + |\mathcal{T}_x|)\) is constant. Then, \(\mathcal{J}_{SL}(D)\) in 12 is the variational representation of \(D_{f_{u,SL}}(p_{XY}||p_Up_Y)\).
Proof. By comparing 12 to 6 , it is immediate to notice the change of variable \(D(\mathbf{x}, \mathbf{y}) = - T(\mathbf{x}, \mathbf{y})\). Then, the expression of the Fenchel conjugate is attained as \(f_{u, SL}^{*}(t) = -|\mathcal{T}_x|(\log(-t) + t)\) from inspection of the expectation over \(p_U(\mathbf{x})p_Y(\mathbf{y})\). The generating function \(f_{u, SL}(u) = - |\mathcal{T}_x| \log(u + |\mathcal{T}_x|)\) is computed by using the definition of Fenchel conjugate. We add a constant \(K = |\mathcal{T}_x|\log(1+|\mathcal{T}_x|)\) to the generator function to achieve the condition \(f_{u, SL}(1)=0\), which has no impact on the maximization of the objective function in 12 . Lastly, the second derivatives of \(f_{u, SL}(u)\) and \(f_{u, SL}^{*}(t)\) are nonpositive functions, proving that the generator function and its Fenchel conjugate are convex. ◻
Corollary 7. Let \(P\) and \(Q\) be two probability distributions. Let \(D_{SL}(P||Q)\) be the \(f\)-divergence with generator function \(f_{SL}(u)\) as in 16 . Then, \[0 \leq D_{SL}(P||Q) \leq \log(2) .\]
Proof. Let \(f: \mathbb{R}_+ \longrightarrow \mathbb{R}\) be a convex function with \(f(1)=0\), and \(f^{\circ}: \mathbb{R}_+ \longrightarrow \mathbb{R}\) defined as \[f^{\circ}(u) \triangleq u f \left( \frac{1}{u} \right),\] then \(f^{\circ}\) is also convex and such that \(f^{\circ}(1)=0\). Then, the Range of Values Theorem [48] sets upper and lower bounds on the value of the \(f\)-divergence between two distributions \(P\) and \(Q\), depending on \(f(u)\) and \(f^{\circ}(u)\): \[\label{eq:range95of95values} f(1) \leq D_f(P||Q) \leq f(0) + f^{\circ}(0) \>\>\>\>\> \forall Q, P .\tag{42}\] From which the thesis follows. ◻
Corollary 8. Let \(\mathcal{J}_{SL}(D)\) be defined as in 12 . Let \(\mathcal{J}_{GAN}(D)\) be defined as in Table ¿tbl:tab:value32functions?. Let \(D^{\diamond}_N\) be the discriminator output in a neighborhood of \(D^{\diamond}\) where \(\mathcal{J}_{SL}(D^{\diamond}_N)\) and \(\mathcal{J}_{GAN}(D^{\diamond}_N)\) are concave. Then, \[\label{rhvbiyuj} \Bigg| \frac{\partial \mathcal{J}_{GAN}(D^{\diamond}_N)}{\partial D } \Bigg| \geq \Bigg| \frac{\partial \mathcal{J}_{SL}(D^{\diamond}_N)}{\partial D } \Bigg| .\qquad{(11)}\]
Proof. To prove 17 , we just need to prove \[\Bigg|\frac{\partial \tilde{\mathcal{J}}_{GAN}(D^{\diamond}_N)}{\partial D} \Bigg| \geq \Bigg| \frac{\partial
\tilde{\mathcal{J}}_{SL}(D^{\diamond}_N)}{\partial D} \Bigg| ,\] (where \(\tilde{\mathcal{J}}\) is the integrand function in 10 ) since the inequality between
the integrands holds when the integrals are computed over the same interval.
Lemma 1 guarantees the convergence to the optimal discriminator. Therefore, let \(D^{\diamond}_N =
\frac{p_Y(\mathbf{y})}{p_{XY}(\mathbf{x}, \mathbf{y}) + p_Y(\mathbf{y})} + \delta\), with \(\delta\) arbitrarily small, so that \(D^{\diamond}_N\) belongs to the neighborhood of \(D^{\diamond}\). Then, \[\begin{align} \tag{43} \frac{\partial}{\partial D} \tilde{\mathcal{J}}_{SL}(D) \Bigg|_{D^{\diamond}_N} &= - (p_{XY}(\mathbf{x}, \mathbf{y}) +
p_Y(\mathbf{y})) + \frac{p_Y(\mathbf{y})}{D^{\diamond}_N(\mathbf{x}, \mathbf{y})} \\ \frac{\partial}{\partial D}\tilde{\mathcal{J}}_{GAN}(D) \Bigg|_{D^{\diamond}_N} &= - \frac{p_{XY}(\mathbf{x}, \mathbf{y})}{1-D^{\diamond}_N(\mathbf{x}, \mathbf{y})} +
\frac{p_Y(\mathbf{y})}{D^{\diamond}_N(\mathbf{x}, \mathbf{y})} \notag \\ &= - \frac{p_{XY}(\mathbf{x}, \mathbf{y})(p_{XY}(\mathbf{x}, \mathbf{y}) + p_Y(\mathbf{y}))}{p_{XY}(\mathbf{x}, \mathbf{y}) (1- \delta) - \delta p_Y(\mathbf{y})} \notag \\ & +
\frac{p_Y(\mathbf{y})}{D^{\diamond}_N(\mathbf{x}, \mathbf{y}) \tag{44}}
\end{align}\] By substituting \(\gamma = \frac{1}{1-\delta}\), 44 becomes \[\begin{align} \label{eq:first95derivative95GAN} \frac{\partial}{\partial D}\tilde{\mathcal{J}}_{GAN}(D)
\Bigg|_{D^{\diamond}_N} & \approx - \gamma (p_{XY}(\mathbf{x}, \mathbf{y}) + p_Y(\mathbf{y})) + \frac{p_Y(\mathbf{y})}{D^{\diamond}_N(\mathbf{x}, \mathbf{y})} ,
\end{align}\tag{45}\] where \(0 < \gamma < 1\) if \(\delta < 0\), and \(\gamma > 1\) if \(\delta
>0\). Thus, the comparison between 43 and 45 leads to the inequalities \[\begin{align} \frac{\partial}{\partial D}
\tilde{\mathcal{J}}_{SL}(D) \Bigg|_{D^{\diamond}_N} &< \frac{\partial}{\partial D}\tilde{\mathcal{J}}_{GAN}(D) \Bigg|_{D^{\diamond}_N} \quad if \delta < 0 \\ \frac{\partial}{\partial D} \tilde{\mathcal{J}}_{SL}(D) \Bigg|_{D^{\diamond}_N}
&> \frac{\partial}{\partial D}\tilde{\mathcal{J}}_{GAN}(D) \Bigg|_{D^{\diamond}_N} \quad if \delta > 0 .
\end{align}\] Since \(D^{\diamond}\) corresponds to a maximum, i.e., the sign of the left derivative is positive, and the sign of the right derivative is negative, the statement of the corollary is proved. ◻
Theorem 9. Let \(p_X(\mathbf{x})\) and \(p_Y(\mathbf{y})\) be pdfs describing the input and output of a stochastic function \(H(\cdot)\), respectively. Let \(p_X(\mathbf{x}) \triangleq \sum_{i = 1}^m P_X(\mathbf{x}_i) \delta (\mathbf{x} - \mathbf{x}_i)\), where \(P_X(\cdot)\) is the probability mass function of \(X\). Let \(\mathcal{T}_x\) be the support of \(p_X(\mathbf{x})\) and \(|\mathcal{T}_x|\) its Lebesgue measure. Let \(p_U(\mathbf{x})\) be the uniform discrete probability density function over \(\mathcal{T}_x\). Let the discriminator be characterized by a supervised architecture. Then, the objective function in 6 becomes \[\begin{align} \label{eq:supervised95general95value95function95appendix} \mathcal{J}(D) &= \mathop{\mathrm{\mathbb{E}}}_{\mathbf{x} \sim p_X(\mathbf{x})}\Biggl[ \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_{Y|X}(\mathbf{y}|\mathbf{x})}\Bigl[ r(\boldsymbol{D}(\mathbf{y}))^T \boldsymbol{1}_m(\mathbf{x}) \Bigr] \Biggr] - \mathop{\mathrm{\mathbb{E}}}_{\mathbf{y} \sim p_Y(\mathbf{y})}\Biggl[ \sum_{i=1}^m f^{*} \left(r(D(\mathbf{x}_i,\mathbf{y})) \right) \Biggr] , \end{align}\qquad{(12)}\] where \(D(\mathbf{x}_i,\mathbf{y})\) is the i-th component of \(\boldsymbol{D}(\mathbf{y})\) and \(\boldsymbol{T}(\mathbf{y}) = r(\boldsymbol{D}(\mathbf{y}))\).
Proof. Let the alphabet of \(X\) be \(\mathcal{A}_x = \left\{ \mathbf{x}_1, \dots, \mathbf{x}_m \right\}\). The objective function in 6 can be expressed as \[\begin{align} \mathcal{J}(D) &= \int_{\mathcal{T}_y} \int_{\mathcal{T}_x} p_X(\mathbf{x}) p_{Y|X}(\mathbf{y}|\mathbf{x}) r(D(\mathbf{x},\mathbf{y})) - p_U(\mathbf{x}) p_Y(\mathbf{y}) f_{u}^{*} \left( r(D(\mathbf{x}, \mathbf{y})) \right) d\mathbf{x}d\mathbf{y} . \end{align}\] Then, let \(p_U(\mathbf{x}) \triangleq \sum_{i = 1}^m P_U(\mathbf{x}_i) \delta (\mathbf{x} - \mathbf{x}_i)\), with \(P_U(\mathbf{x}_i) = \frac{1}{|\mathcal{T}_x|}\). \[\begin{align} \mathcal{J}(D) &= \int_{\mathcal{T}_y} \int_{\mathcal{T}_x} \sum_{i = 1}^m P_X(\mathbf{x}_i) \delta (\mathbf{x} - \mathbf{x}_i) p_{Y|X}(\mathbf{y}|\mathbf{x}) r(D(\mathbf{x}, \mathbf{y})) - \sum_{i = 1}^m \delta (\mathbf{x} - \mathbf{x}_i) p_Y(\mathbf{y}) f^{*} \left( r(D(\mathbf{x},\mathbf{y})) \right) d\mathbf{x}d\mathbf{y} , \end{align}\] where \(f_{u}^{*} \left( r(D(\mathbf{x},\mathbf{y})) \right) = |\mathcal{T}_x| f^{*} \left( r(D(\mathbf{x},\mathbf{y})) \right)\). Then, by using the indicator property of the delta function, the objective function becomes \[\begin{align} \label{eq:supervised95general95integral95of95sum} \mathcal{J}(D) &= \int_{\mathcal{T}_y} \sum_{i = 1}^m P_X(\mathbf{x}_i) p_{Y|X}(\mathbf{y}|\mathbf{x}_i) r(D(\mathbf{x}_i,\mathbf{y})) d\mathbf{y} - \int_{\mathcal{T}_y} p_Y(\mathbf{y}) \sum_{i = 1}^m f^{*} \left( r(D(\mathbf{x}_i,\mathbf{y})) \right) d\mathbf{y} , \end{align}\tag{46}\] that is equivalent to ?? . ◻
Closed Form Posterior Exponential Case: Let define the model \(Y= X+N\), where \(X \sim exp(\lambda)\), \(N \sim exp(\lambda)\). Therefore, \(Y \sim \Gamma(2, \frac{1}{\lambda})\) (i.e., a Gamma distribution with shape \(2\) and rate \(\frac{1}{\lambda}\)). Let define \(Y|X \triangleq Z\), then the cumulative density function (CDF) is \[\begin{align} P\left[ Z \leq z \right] &= P \left[ N+x_c \leq z \right] = P\left[ N \leq z - x_c \right] \notag \\ &= \left( 1-e^{-\lambda(z-x_c)} \right)\mathbb{1}(z-x_c) , \end{align}\] where \(X_c\) is constant. By deriving the CDF w.r.t. \(z\), we compute the likelihood \[p_{Y|X}(y|x) = \lambda e^{-\lambda(y|x - x_c)} \mathbb{1}(y|x - x_c) = p_N(n).\] Then, the posterior probability is computed as \[\begin{align} \label{eq:posterior95closed95form95exponential} p_{X|Y}(x|y) &= \frac{p_N(n)p_X(x)}{p_Y(y)} \notag \\ &= \frac{1}{y} \mathbb{1}(x) \mathbb{1}(y) . \end{align}\tag{47}\]
Closed Form Posterior Gaussian Case: Let define the model \(Y = X+N\), where \(X \sim \mathcal{N}(0, \Sigma_X)\), \(N \sim \mathcal{N}(0, \Sigma_N)\). Thus, \(Y|X \sim \mathcal{N}(X, \Sigma_N)\), \(Y \sim \mathcal{N}(0, \underbrace{\Sigma_N + \Sigma_X}_{\triangleq \Sigma_Y})\).
The posterior probability is \[\begin{align} p_{X|Y}(x|y) &= \frac{p_{Y|X}(y|x) p_{X}(x)}{p_{Y}(y)} \\ &= \frac{ \frac{1}{\sqrt{(2 \pi)^d |\Sigma_N|}} e^{-\frac{1}{2} (y-x)^T \Sigma_N^{-1} (y - x) } }{\frac{1}{\sqrt{(2 \pi)^d |\Sigma_Y|}} e^{-\frac{1}{2} y^T \Sigma_Y^{-1} y }} \notag \\ & \cdot \frac{1}{\sqrt{(2 \pi)^d |\Sigma_X|}} e^{-\frac{1}{2} x^T \Sigma_X^{-1} x }\\ &= \frac{1}{\sqrt{(2 \pi)^d}} \sqrt{\frac{|\Sigma_Y|}{|\Sigma_N||\Sigma_X|}} \exp\left\{-\frac{1}{2}G\right\} , \end{align}\] where \[\begin{align} G = x^T \Sigma_x^{-1} x + y^T \Sigma_N^{-1} y + x^T \Sigma_N^{-1} x - 2 x^T \Sigma_N^{-1}y - y^T \Sigma_Y^{-1} y . \end{align}\]
In the scalar case, where \(d=1\) and \(\Sigma_N = \sigma_N^2\), \(\Sigma_X = \sigma_X^2\) and \(\Sigma_Y = \sigma_X^2 +
\sigma_N^2\), we have: \[\begin{align}
G &= \frac{x^2}{\sigma_X^2} + \frac{y^2}{\sigma_N^2} + \frac{x^2}{\sigma_N^2} - 2 \frac{xy}{\sigma_N^2} - \frac{y^2}{\sigma_y^2} \\
&= x^2 \left( \frac{1}{\sigma_X^2} + \frac{1}{\sigma_N^2} \right) + y^2 \left( \frac{1}{\sigma_N^2} - \frac{1}{\sigma_Y^2}\right) - \frac{2xy}{\sigma_N^2} \\
&= x^2 \left( \frac{\sigma_X^2 + \sigma_N^2}{\sigma_X^2\sigma_N^2} \right) + y^2 \left( \frac{\sigma_Y^2 - \sigma_N^2}{\sigma_N^2\sigma_Y^2}\right) - \frac{2xy}{\sigma_N^2} \\
&= \frac{1}{\sigma_N^2} \left[ x^2 \frac{\sigma_N^2 + \sigma_X^2}{\sigma_X^2} + y^2 \frac{\sigma_x^2}{\sigma_X^2 + \sigma_N^2} - 2xy \right] \\
&= \frac{1}{\sigma_N^2} \left[ x^2 k^2 + \frac{y^2}{k^2} - 2xy \right] \\
&= \frac{1}{\sigma_N^2} \left[ kx - \frac{y}{k} \right]^2 ,
\end{align}\] where \(k \triangleq \frac{\sigma_X^2 + \sigma_N^2}{\sigma_X^2} > 1\).
Then, in the scalar case the posterior density expression becomes \[\begin{align}
\label{eq:posterior95closed95form95gaussian} p_{X|Y}(x|y) = \frac{1}{\sqrt{2 \pi}} \sqrt{\frac{\sigma_Y^2}{\sigma_N^2 \sigma_X^2}} e^{-\frac{1}{2 \sigma_N^2} \left[ kx - \frac{y}{k} \right]^2}.
\end{align}\tag{48}\]
In this section, we provide additional insights on the bottom-up approach proposed in Theorem 2. The idea is to design the objective function by starting from the desired discriminator’s output. When designing an objective function using the bottom-up approach, the choice of \(k(\cdot)\) is the fundamental starting point of the procedure, which is summarized in the following.
\(k(\cdot)\) is the first DOF and must be chosen as a deterministic and invertible function in the domain \(x>0\). Some examples are \(k(x)=x\) and \(k(x)=1/(1+x)\). Then the posterior pdf must be expressed as the density ratio \(p_{XY}/p_Y\).
\(g_1(\cdot)\) is an additional DOF and can be chosen as defined in Corollary 4.
Substitute \(k(\cdot)\) and \(g_1(\cdot)\) in 11 .
Compute the integral of 11 w.r.t. \(D\), which leads to \(\tilde{\mathcal{J}}(D)\).
The integral in 10 represents the expectation computed over the supports \(\mathcal{T}_x\) and \(\mathcal{T}_y\).
This exact procedure is used to prove Theorem 3.
In the case of the KL-based objective function that we proposed, to ensure that 9 is a density for the case of discrete \(X\), we use the softmax as the last activation
function of the discriminator. However, \(k(\cdot)\) is not the softmax function because if it were the softmax, then \(D^\diamond(\mathbf{x}, \mathbf{y}) =
softmax(p_{X|Y}(\mathbf{x}|\mathbf{y}))\), where \(p_{X|Y}(\mathbf{x}|\mathbf{y})\) is the density (i.e., the output of the softmax will be \(p_{X|Y}(\mathbf{x}|\mathbf{y})\) itself,
thus we do not need to apply additional transformations). Therefore, in the case of the KL divergence, \(k^{-1}(x)=x\).
We study the performance of the proposed objective functions for classification (listed in Appendix 9) for four image classification datasets. MNIST [39] comprises 10 classes with 60,000 images for training and 10,000 images for testing. Fashion MNIST has 10 classes with 60,000 images for training and 10,000 images for testing. CIFAR10 [41] has 10 classes with 50,000 images for training and 10,000 images for testing. CIFAR100 [41] has 100 classes with 50,000 images for training and 10,000 images for testing. Table ¿tbl:tab:classification95images95appendix? shows the classification accuracy of different network architectures trained by using the supervised versions of the objective functions listed in Table ¿tbl:tab:value32functions? and the one presented in Theorem 3 (see Appendix 9). The accuracies are in the form \(XX \pm YY\), where \(XX\) and \(YY\) represent the mean and standard deviation, respectively, obtained over multiple runs of the code. The tests are run by using various architectures: VGG [10], DLA2 [35], ResNet18 [34], DenseNet [49], PreActResNet [43], MobileNetV2 [36]. Interestingly, from Tab. ¿tbl:tab:classification95images95appendix?, it can be observed that every network architecture suits some objective functions more than others. For instance, the PreActResNet attains the highest accuracy when trained with the GAN-based objective function (even if the difference in performance is just 0.2% different from the second-best one). Differently, the DenseNet performs optimally in CIFAR10 and CIFAR100 when trained with the KL-based objective function, even if the difference in accuracy w.r.t. the SL-based objective function is minimal. The MobileNetV2 obtains the best performance when trained with the SL-based divergence, and the difference with the second-best objective function is around \(2\%\), which is significant. The choice of the architecture often depends on the goal of the classification algorithm. For embedded systems, light architectures are used. Therefore, the MobileNetV2 is an option. In such a case, the SL divergence is the preferred choice for the network’s training.
| Dataset | Model | CE | RKL | HD | GAN | P | SL |
|---|---|---|---|---|---|---|---|
| M | Shallow | \(\textbf{99.08} \pm 0.06\) | \(96.05 \pm 0.25\) | \(98.68 \pm 0.05\) | \(\textbf{99.08} \pm 0.07\) | \(98.89 \pm 0.08\) | \(99.03 \pm 0.04\) |
| FM | Shallow | \(91.64 \pm 0.09\) | \(82.63 \pm 1.78\) | \(90.75 \pm 0.13\) | \(91.63 \pm 0.10\) | \(89.86 \pm 0.67\) | \(\textbf{91.83} \pm 0.02\) |
| C10 | Shallow | \(70.13 \pm 0.05\) | \(63.59 \pm 0.34\) | \(69.38 \pm 0.28\) | \(69.98 \pm 0.15\) | \(59.62 \pm 0.45\) | \(\textbf{70.87} \pm 0.26\) |
| VGG | \(93.69 \pm 0.03\) | \(84.24 \pm 2.21\) | \(93.51 \pm 0.06\) | \(93.75 \pm 0.04\) | \(84.79 \pm 0.21\) | \(\textbf{93.93} \pm 0.08\) | |
| DLA | \(95.04 \pm 0.02\) | \(90.83 \pm 0.10\) | \(94.56 \pm 0.11\) | \(95.04 \pm 0.13\) | \(91.61 \pm 0.21\) | \(\textbf{95.31} \pm 0.09\) | |
| ResNet | \(95.39 \pm 0.04\) | \(92.88 \pm 0.26\) | \(95.15 \pm 0.08\) | \(95.24 \pm 0.06\) | \(93.78 \pm 0.21\) | \(\textbf{95.43} \pm 0.04\) | |
| DenseNet | \(\textbf{95.82} \pm 0.06\) | \(91.52 \pm 0.14\) | \(94.93 \pm 0.07\) | \(95.67 \pm 0.02\) | \(94.34 \pm 0.16\) | \(95.53 \pm 0.13\) | |
| PAResNet | \(94.30 \pm 0.15\) | \(89.43 \pm 0.39\) | \(56.44 \pm 0.02\) | \(\textbf{95.17} \pm 0.07\) | \(86.24 \pm 0.08\) | \(95.09 \pm 0.02\) | |
| MobileNet | \(92.59 \pm 0.13\) | \(83.97 \pm 0.21\) | \(91.95 \pm 0.33\) | \(92.37 \pm 0.14\) | \(84.30 \pm 0.32\) | \(\textbf{93.89} \pm 0.15\) | |
| C100 | VGG | \(72.73 \pm 0.30\) | \(45.80 \pm 2.86\) | \(73.51 \pm 0.03\) | \(68.88 \pm 0.20\) | \(37.19 \pm 0.66\) | \(\textbf{73.61} \pm 0.05\) |
| DLA | \(76.29 \pm 0.43\) | \(68.86 \pm 1.17\) | \(78.63 \pm 0.14\) | \(77.34 \pm 0.22\) | \(57.97 \pm 0.07\) | \(\textbf{78.65} \pm 0.01\) | |
| ResNet | \(\textbf{78.29} \pm 0.18\) | \(70.68 \pm 0.44\) | \(77.59 \pm 0.06\) | \(77.43 \pm 0.08\) | \(61.12 \pm 0.23\) | \(78.03 \pm 0.04\) | |
| DenseNet | \(\textbf{80.09} \pm 0.02\) | \(72.03 \pm 0.23\) | \(79.91 \pm 0.01\) | \(79.32 \pm 0.34\) | \(62.27 \pm 0.21\) | \(80.03 \pm 0.02\) | |
| PAResNet | \(77.13 \pm 0.15\) | \(59.28 \pm 0.12\) | \(76.98 \pm 0.05\) | \(\textbf{77.39} \pm 0.18\) | \(61.64 \pm 0.11\) | \(77.19 \pm 0.25\) | |
| MobileNet | \(72.61 \pm 0.08\) | \(53.17 \pm 0.35\) | \(73.00 \pm 0.30\) | \(65.66 \pm 0.46\) | \(46.00 \pm 0.37\) | \(\textbf{74.78} \pm 0.23\) |
The SL divergence has been proved to have favourable convergence conditions in Corollary 2. We numerically compare the convergence speed of the GAN and SL divergences on the CIFAR10 dataset in Figure 5, demonstrating the effectiveness of Corollary 2. The accuracy behavior is attained by averaging over multiple runs of the code. In Figure 5, the accuracy over the test dataset is showed, for each training epoch, with a semi-transparent color (blue and orange for the GAN and SL divergences, respectively). The vivid colors represent a moving average over \(5\) epochs, helping the clarity of the visualization. Quantitatively, we report in Tab. ¿tbl:tab:speed95accuracy? the difference between the accuracy obtained by training the network with the SL and GAN divergences. In detail, each column is identified by a number \(k\) and contains, for various discriminator architectures, the quantity \(A^k_{SL} - A^k_{GAN}\), where \(A^k_{f}\) is the average accuracy over multiple runs of the code for the selected \(f\)-divergence, in the epochs interval \([1, k]\). Each cell in Table ¿tbl:tab:speed95accuracy? contains a positive value, which shows the average faster convergence property of the SL divergence. Furthermore, the difference in speed convergence is more significant for the VGG training than for the ResNet18 and DLA architectures.

Figure 5: Convergence speed of the test accuracy over \(200\) training epochs..
| Model | 5 | 10 | 25 | 50 | 75 | 100 | 125 | 150 | 175 | 200 |
|---|---|---|---|---|---|---|---|---|---|---|
| ResNet18 | \(4.15\) | \(2.81\) | \(1.48\) | \(1.43\) | \(1.16\) | \(1.12\) | \(0.95\) | \(0.86\) | \(0.75\) | \(0.67\) |
| DLA | \(5.40\) | \(4.39\) | \(2.52\) | \(1.43\) | \(1.15\) | \(1.11\) | \(1.00\) | \(0.91\) | \(0.81\) | \(0.72\) |
| VGG | \(5.93\) | \(7.40\) | \(5.19\) | \(3.42\) | \(2.68\) | \(2.36\) | \(2.07\) | \(1.84\) | \(1.63\) | \(1.44\) |
The speed of convergence and the upper-boundness of \(D_{SL}\) is (see Corollaries 2 and 7 in Appendix 10.10 and 10.9, respectively) confirm the utility of the SL divergence for double optimization problems. For instance, when the objective function of the learning algorithm is formulated as a max-max game. For example, in [21] the \(f\)-mutual information (which is estimated by formulating a maximization problem) is maximized for classification with noisy labels. Similarly, in [30] the authors maximize the JS-mutual information (where JS refers to the Jensen-Shannon divergence, which is equivalently used in this paper as GAN divergence) for representation learning applications (then the model is extended in [50]). In [51], the authors formulate a mutual information maximization algorithm to achieve the channel capacity in a data communication system. In [52], the authors maximize the JS-mutual information for the generation of talking faces.
We analyze the decoding task in presence of additive white Gaussian noise (AWGN) in the communication channel. Let \(X\) be a \(d\)-dimensional binary vector, and \(N \sim \mathcal{N}(0,\Sigma_N)\) be Gaussian noise, with \(\Sigma_N\) diagonal. Let \(Y=X+N\) be the output of the communication channel. The SER behavior when
varying the SNR is shown in Fig. 6 for each objective function analyzed. To compare the estimated SER, we visualize the SER achieved by the maxL decoder, which corresponds to the optimal decoder for an AWGN channel
with uniform distribution \(p_X(\mathbf{x})\) [27]. The proposed SL divergence achieves the
best performance and close to the optimal maxL decoder. In general, different objective functions perform better than \(\mathcal{J}_{KL}(D)\).

Figure 6: SER achieved in an AWGN channel by the proposed posterior probability estimators..
Similarly to Section 7, we consider a 4-PAM transmission. However, in this case we examine the case where the symbols transmitted do not have a uniform prior probability \(p_X(\mathbf{x})\). We define the alphabet of \(X\) to be \(\mathcal{A}_x = \{ x _1, x_2, x_3, x_4\}\) with probabilities \(P(x_1) = P(x_2) = P/2\) and \(P(x_3) = P(x_4) = (1-P)/2\), where \(P=0.05\). The SER for various values of SNR is reported in Fig. 7, where the discriminators trained with the supervised versions of the objective functions in Tab. ¿tbl:tab:value32functions? and in 12 (see Appendix 9) are compared with the maxL and MAP decoders. Although the maxL decoder is optimal for an AWGN channel, the extreme non-uniformity of the channel significantly impacts its performance. Differently, the optimal MAP decoder knows the distribution of \(p_X(\mathbf{x})\). The discriminator trained with the SL and GAN divergences achieves performance close to the optimal MAP decoder.

Figure 7: SER achieved in an AWGN channel by a 4-PAM with non-uniform source probability distribution..
Our implementation can be found at https://github.com/tonellolab/discriminative-classification-fDiv↩︎
The implementation of the DLA is a simplified version of the one presented in the original paper↩︎