Datasets:
Add files using upload-large-folder tool
Browse files
md/train/6nbpPqUCIi7/6nbpPqUCIi7.md
CHANGED
|
Binary files a/md/train/6nbpPqUCIi7/6nbpPqUCIi7.md and b/md/train/6nbpPqUCIi7/6nbpPqUCIi7.md differ
|
|
|
md/train/HklY120cYm/HklY120cYm.md
CHANGED
|
@@ -68,7 +68,7 @@ $$
|
|
| 68 |
q ( \pmb { x } ) = q ( \pmb { z } ) \left| \operatorname* { d e t } \left( \frac { \partial f ( \pmb { z } ) } { \partial \pmb { z } } \right) \right| ^ { - 1 } ,
|
| 69 |
$$
|
| 70 |
|
| 71 |
-
where de t
|
| 72 |
|
| 73 |
$$
|
| 74 |
\operatorname* { d e t } \left( \frac { \partial f ( \boldsymbol { z } ) } { \partial \boldsymbol { z } } \right) = \prod _ { t } \frac { \partial f ( \boldsymbol { z } _ { \le t } ) } { \partial \boldsymbol { z } _ { t } } ,
|
|
|
|
| 68 |
q ( \pmb { x } ) = q ( \pmb { z } ) \left| \operatorname* { d e t } \left( \frac { \partial f ( \pmb { z } ) } { \partial \pmb { z } } \right) \right| ^ { - 1 } ,
|
| 69 |
$$
|
| 70 |
|
| 71 |
+
where de t ∂f(z)∂z is the determinant of the Jacobian and is computationally expensive to obtain in general. Inverse autoregressive flow (IAF) (Kingma et al., 2016) is a special normalizing flow with a simple Jacobian determinant. In IAF, $_ { z }$ has the same dimension as $_ { \textbf { \em x } }$ , and the transformation is based on an autoregressive network taking $_ z$ as the input: $x _ { t } = f ( z _ { \leq t } ; \vartheta )$ , where $\vartheta$ are parameters of the model. Note that the $t$ -th variable $x _ { t }$ only depends on previous and current latent variables $z _ { \leq t }$ , thus the Jacobian is a triangular matrix and the determinant is the product of the diagonal entries,
|
| 72 |
|
| 73 |
$$
|
| 74 |
\operatorname* { d e t } \left( \frac { \partial f ( \boldsymbol { z } ) } { \partial \boldsymbol { z } } \right) = \prod _ { t } \frac { \partial f ( \boldsymbol { z } _ { \le t } ) } { \partial \boldsymbol { z } _ { t } } ,
|
md/train/gDcaUj4Myhn/gDcaUj4Myhn.md
CHANGED
|
@@ -108,7 +108,7 @@ As with all approximate inference methods, the performance of the LA depends on
|
|
| 108 |
|
| 109 |
# $\textcircled{4}$ Approximate Predictive Distribution
|
| 110 |
|
| 111 |
-
To predict using a posterior (approximation) $p ( \theta \mid \mathcal { D } )$ , we need to compute $p ( y \mid f ( x _ { * } ) , \mathcal { D } ) \ =$ $\begin{array} { r } { \int p \dot { ( \boldsymbol { y } \vert } f _ { \boldsymbol { \theta } } ( x _ { * } ) ) \dot { p ( \boldsymbol { \theta } \vert } \dot { \mathcal { D } } ) d \boldsymbol { \theta } } \end{array}$ for any test point $x _ { * } \in \mathbb { R } ^ { n }$ , which is intractable in general. The sim| ⇤ D (✓s)Ss=1 from p(✓ | D): p(y | f (x⇤), D) ⇡
|
| 112 |
|
| 113 |
The predictive of a linearized neural network with a LA approximation to the posterior $p ( \boldsymbol { \theta } | \mathcal { D } ) \approx$ $\mathcal { N } ( \theta ; \theta _ { \mathrm { M A P } } , \mathcal { \Sigma } )$ results in a Gaussian distribution on neural network outputs $f _ { * } : = f ( x _ { * } )$ and therefore enables simple approximations or even a closed-form solution. The distribution on the outputs is given by $\bar { p } ( f _ { * } | \bar { x } _ { * } , \mathcal { D } ) \approx \mathcal { N } ( f _ { * } ; f _ { \theta _ { \mathrm { M A P } } } ( x _ { * } ) , J ( x _ { * } ) ^ { \intercal } \varSigma J ( x _ { * } ) )$ and is typically significantly lowerdimensional (number of outputs $C$ instead of parameters $D$ ). It can also be inferred entirely in function space as a Gaussian process [25, 26]. Given the distribution on outputs $f _ { * }$ , the predictive distribution can be obtained by integration against the likelihood: $\begin{array} { r } { p ( y | x _ { * } , \mathcal { D } ) = \int p ( y | \bar { f } _ { * } ) p ( f _ { * } | x _ { * } , \mathcal { D } ) d \theta } \end{array}$ . In the case of regression with a Gaussian likelihood with variance $\sigma ^ { 2 }$ , the solution can even be obtained analytically: $\bar { p } ( y | x _ { * } , \mathcal { D } ) \approx \mathcal { N } ( y ; f _ { \theta _ { \mathrm { M A P } } } ( x _ { * } ) , J ( x _ { * } ) ^ { \intercal } \varSigma J ( x _ { * } ) + \sigma ^ { 2 } I )$ . For non-Gaussian likelihoods, e.g. in classification, a further approximation is needed. Again, the simplest approximation to this is Monte Carlo integration. In the binary case, we can employ the probit approximation [31, 16] which approximates the logistic function with the probit function. In the multi-class case, we can use its generalization, the extended probit approximation [52]. Finally, first proposed for non-BNN applications [53, 54], the Laplace bridge approximates the softmax-Gaussian integral via a Dirichlet distribution [55]. The key advantage is that it yields a distribution of the integral solutions.
|
| 114 |
|
|
|
|
| 108 |
|
| 109 |
# $\textcircled{4}$ Approximate Predictive Distribution
|
| 110 |
|
| 111 |
+
To predict using a posterior (approximation) $p ( \theta \mid \mathcal { D } )$ , we need to compute $p ( y \mid f ( x _ { * } ) , \mathcal { D } ) \ =$ $\begin{array} { r } { \int p \dot { ( \boldsymbol { y } \vert } f _ { \boldsymbol { \theta } } ( x _ { * } ) ) \dot { p ( \boldsymbol { \theta } \vert } \dot { \mathcal { D } } ) d \boldsymbol { \theta } } \end{array}$ for any test point $x _ { * } \in \mathbb { R } ^ { n }$ , which is intractable in general. The sim| ⇤ D (✓s)Ss=1 from p(✓ | D): p(y | f (x⇤), D) ⇡ S1 PSs=1 p(y | f✓s (x⇤)). However, for LAs with GGN [26] attribute this to the inconsistency between Hessian approximation and the predictive and suggest to use a linearized predictive instead, which can also be useful for theoretic analyses [28]. For the last-layer LA, the Hessian coincides with the GGN and the linearized predictive is exact.
|
| 112 |
|
| 113 |
The predictive of a linearized neural network with a LA approximation to the posterior $p ( \boldsymbol { \theta } | \mathcal { D } ) \approx$ $\mathcal { N } ( \theta ; \theta _ { \mathrm { M A P } } , \mathcal { \Sigma } )$ results in a Gaussian distribution on neural network outputs $f _ { * } : = f ( x _ { * } )$ and therefore enables simple approximations or even a closed-form solution. The distribution on the outputs is given by $\bar { p } ( f _ { * } | \bar { x } _ { * } , \mathcal { D } ) \approx \mathcal { N } ( f _ { * } ; f _ { \theta _ { \mathrm { M A P } } } ( x _ { * } ) , J ( x _ { * } ) ^ { \intercal } \varSigma J ( x _ { * } ) )$ and is typically significantly lowerdimensional (number of outputs $C$ instead of parameters $D$ ). It can also be inferred entirely in function space as a Gaussian process [25, 26]. Given the distribution on outputs $f _ { * }$ , the predictive distribution can be obtained by integration against the likelihood: $\begin{array} { r } { p ( y | x _ { * } , \mathcal { D } ) = \int p ( y | \bar { f } _ { * } ) p ( f _ { * } | x _ { * } , \mathcal { D } ) d \theta } \end{array}$ . In the case of regression with a Gaussian likelihood with variance $\sigma ^ { 2 }$ , the solution can even be obtained analytically: $\bar { p } ( y | x _ { * } , \mathcal { D } ) \approx \mathcal { N } ( y ; f _ { \theta _ { \mathrm { M A P } } } ( x _ { * } ) , J ( x _ { * } ) ^ { \intercal } \varSigma J ( x _ { * } ) + \sigma ^ { 2 } I )$ . For non-Gaussian likelihoods, e.g. in classification, a further approximation is needed. Again, the simplest approximation to this is Monte Carlo integration. In the binary case, we can employ the probit approximation [31, 16] which approximates the logistic function with the probit function. In the multi-class case, we can use its generalization, the extended probit approximation [52]. Finally, first proposed for non-BNN applications [53, 54], the Laplace bridge approximates the softmax-Gaussian integral via a Dirichlet distribution [55]. The key advantage is that it yields a distribution of the integral solutions.
|
| 114 |
|
md/train/rkeYUsRqKQ/rkeYUsRqKQ.md
CHANGED
|
@@ -214,7 +214,7 @@ S. Zhang, E. Dinan, J. Urbanek, A. Szlam, D. Kiela, and J. Weston. Personalizing
|
|
| 214 |
Require: A generator $G$ with parameters $\theta _ { G }$ .
|
| 215 |
Require: An adversarial discriminator $D _ { a d v }$ with parameters $\theta _ { D _ { a d v } }$ .
|
| 216 |
Require: An attribute discriminator $D _ { a t t }$ with parameters $\theta _ { D _ { a t t } }$ a.
|
| 217 |
-
Require: Training hyperparameters, isT arget, $\lambda _ { G _ { a t t } }$ , $\lambda _ { G _ { a d v } }$ , and $\lambda _ { M }$ . for number of training iterations do Initialize Sample a $c R N N$ to zero tch of c tate,nver $\scriptstyle h _ { 0 }$ o , with utterances. $\pmb { X } = \{ X _ { i } , C _ { i } \} _ { i = 1 } ^ { N }$ $\pmb { X _ { i } } = \left( ( X _ { 1 } , C _ { 1 } ) , ( X _ { 2 } , C _ { 2 } ) , \cdot \cdot \cdot , ( X _ { i } , C _ { i } ) \right)$ $N$ $_ i$ $M _ { i }$ for $i = 1$ to $N - 1$ do Update the context state. $\pmb { h _ { i } } = c R N N ( e R N N ( E ( X _ { i } ) ) , \pmb { h _ { i - 1 } } , C _ { i } )$ $\begin{array} { r } { P _ { \theta _ { G } } \left( Y _ { i } | , Z _ { i } , \mathbf { X } _ { i } , C _ { i + 1 } \right) = \left\{ P _ { \theta _ { G } } \left( Y _ { i } ^ { j } | X _ { i + 1 } ^ { 1 : j - 1 } , Z _ { i } ^ { j } , \mathbf { X } _ { i } , C _ { i + 1 } \right) \right\} _ { j = 1 } ^ { M _ { i + 1 } } } \end{array}$ $Y _ { i }$ $Y _ { i } \stackrel { \cdot } { \sim } P _ { \theta _ { G } } ( Y _ { i } | , Z _ { i } , \mathbf { \bar { X } } _ { i } , C _ { i + 1 } )$ end for over utterances and Compute the adversarial discriminator accuracy $D _ { a d v } ^ { a c c }$ $N - 1$ $\{ Y _ { i } \} _ { i = 1 } ^ { N - 1 }$ $\left\{ X _ { i + 1 } \right\} _ { i = 1 } ^ { N - 1 }$ if $D _ { a d v } ^ { a c c } < a c c _ { D _ { a d v } ^ { t h } }$ then if isT arget then Update phredGANd’s $\theta _ { D _ { a d v } }$ and $\theta _ { D _ { a t t } }$ . $\begin{array} { r l } & { \frac { \operatorname { c r } } { 4 } [ \nabla _ { \theta _ { D _ { a d v } } } \log { D _ { a d v } } ( h _ { i } , X _ { i + 1 } ) + \nabla _ { \theta _ { D _ { a d v } } } \log { ( 1 - D _ { a d v } ( h _ { i } , Y _ { i } ) ) } + \nabla _ { \theta _ { D _ { a d t } } } - \log { D _ { a t t } } ( C _ { i + 1 } | h _ { i } , X _ { i + 1 } ) ] } \end{array}$ i else Update phredGANa’s $\theta _ { D _ { a d v } }$ with gradient of the discriminator loss. v log Dadv(hi, Ci+1, Xi+1) + ∇θDadv log $\left( 1 - D _ { a d v } ( h _ { i } , C _ { i + 1 } , Y _ { i } ) \right)$ ] end if end if if Dadv $D _ { a d v } { } ^ { a c c } < a c c _ { G _ { t h } }$ then Update $\theta _ { G }$ th with the generator’s MLE loss only. $\begin{array} { r } { { \underset { i } { \dot { \sum _ { i } } } } [ \nabla _ { \theta _ { G } } - \log P _ { \theta _ { G } } \left( Y _ { i } | , Z _ { i } , \mathbf { { X } } _ { i } , C _ { i + 1 } \right) ] } \end{array}$ else Update $\theta _ { G }$ with attribute, adversarial and MLE losses. P[λGatt ∇θG − log Datt(Ci+1|hi, Yi) + λGadv ∇θG log Dadv(hi, Ci+1, Yi) + λM ∇θG − log PθG |