SlideShare a Scribd company logo
1 of 2
Download to read offline
A note on the density of Gumbel-softmax
Tomonari MASADA @ Nagasaki University
May 29, 2019
This note explicates some details of the discussion given in Appendix B of [1].
The Gumbel-softmax trick gives a k-dimensional sample vector y = (y1, . . . , yk) ∈ ∆k−1
whose entries
are obtained as
yi =
exp((log(πi) + gi)/τ)
k
j=1 exp((log(πj) + gj)/τ)
for i = 1, . . . , k, (1)
by using g1, . . . , gk, which are i.i.d samples drawn from Gumbel(0, 1).
Define xi = log(πi). Then y is rewritten as
yi =
exp((xi + gi)/τ)
k
j=1 exp((xj + gj)/τ)
for i = 1, . . . , k, (2)
Divide both numerator and denominator by exp((xk + gk)/τ).
yi =
exp((xi + gi − (xk + gk))/τ)
k
j=1 exp((xj + gj − (xk + gk))/τ)
for i = 1, . . . , k, (3)
Define ui = xi + gi − (xk + gk) for i = 1, . . . , k − 1, where gi ∼ Gumbel(0, 1). When gk is given,
gi = ui−xi+(xk+gk) and ui can thus be regarded as a sample from the Gumbel whose mean is xi−(xk+gk)
and scale parameter is 1. Therefore, p(ui|gk) = e−{(ui−xi+(xk+gk))+e−(ui−xi+(xk+gk))
}
. Consequently, the
density p(u1, . . . , uk−1) is given as follows:
p(u1, . . . , uk−1) =
∞
−∞
dgkp(u1, . . . , uk−1|gk)p(gk)
=
∞
−∞
dgkp(gk)
k−1
i=1
p(ui|gk)
=
∞
−∞
dgke−gk−e−gk
k−1
i=1
exi−ui−xk−gk−exi−ui−xk−gk
(4)
Perform a change of variables with v = e−gk
. Then dv
dgk
= −e−gk
. Therefore, dv = −e−gk
dgk and
dgk = −dvegk
= −dv/v.
p(u1, . . . , uk−1) =
0
∞
(−dv)e−v
k−1
i=1
vexi−ui−xk−vexi−ui−xk
=
k−1
i=1
exi−ui−xk
∞
0
dve−v
vk−1
k−1
i=1
e−vexi−ui−xk
= e−(k−1)xk
k−1
i=1
exi−ui
∞
0
dvvk−1
e−v(1+e−xk k−1
i=1 (exi−ui ))
(5)
Recall the following fact related to Gamma integral:
∞
0
xz−1
e−ax
dx =
∞
0
y
a
z−1
e−y dy
a
=
1
a
z ∞
0
yz−1
e−y
dy = a−z
Γ(z) (6)
1
Therefore,
p(u1, . . . , uk−1) = e−(k−1)xk
k−1
i=1
exi−ui
∞
0
dvvk−1
e−v(1+e−xk k−1
i=1 (exi−ui ))
= e−kxk
exk
k−1
i=1
exi−ui
1 + e−xk
k−1
i=1
(exi−ui
)
−k
Γ(k)
= exk
k−1
i=1
exi−ui
exk
+
k−1
i=1
(exi−ui
)
−k
Γ(k)
= exp xk +
k−1
i=1
(xi − ui) exk
+
k−1
i=1
(exi−ui
)
−k
Γ(k) (7)
Define uk = 0. Then
p(u1, . . . , uk−1) = Γ(k)
k
i=1
exp(xi − ui)
k
i=1
exp(xi − ui)
−k
(8)
A k-dimensional sample vector y = (y1, . . . , yk) ∈ ∆k−1
is obtained from u1, . . . , uk−1 by applying a
deterministic transformation h:
hi(u1, . . . , uk−1) =
exp(ui/τ)
1 +
k−1
j=1 exp(uj/τ)
for i = 1, . . . , k − 1 (9)
as follows:
yi = hi(u1, . . . , uk−1) for i = 1, . . . , k − 1 (10)
Note that yk is fixed given y1, . . . , yk−1:
yk =
1
1 +
k−1
j=1 exp(uj/τ)
= 1 −
k−1
j=1
yj (11)
By using the change of variables we can obtain the density function for y:
p(y) = p(h−1
(y1, . . . , yk−1)) det
∂(h−1
1 (y1, . . . , yk−1), . . . , h−1
k−1(y1, . . . , yk−1))
∂(y1, . . . , yk−1)
(12)
The inverse of h is obtained as follows:
yi =
exp(ui/τ)
1 +
k−1
j=1 exp(uj/τ)
yi = yk exp(ui/τ) from yk = 1
1+ k−1
j=1 exp(uj /τ)
log yi = log yk + ui/τ
∴ h−1
i (y1, . . . , yk−1) = ui = τ × (log yi − log yk) = τ × log yi − log 1 −
k−1
j=1
yj (13)
Therefore, we obtain the Jacobian:
∂h−1
i (y1, . . . , yk−1)
∂yi
= τ ×
1
yi
−
1
yk
∂yk
∂yi
= τ ×
1
yi
+
1
yk
(14)
∂h−1
i (y1, . . . , yk−1)
∂yj
= τ × −
1
yk
∂yk
∂yj
= τ ×
1
yk
for j = i (15)
Eqs. from (24) to (28) are easy to understand.
References
[1] E. Jang, S. Gu, and B. Poole. Categorical representation with Gumbel-softmax. ICLR, 2017.
2

More Related Content

What's hot

Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesVjekoslavKovac1
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 
QMC Error SAMSI Tutorial Aug 2017
QMC Error SAMSI Tutorial Aug 2017QMC Error SAMSI Tutorial Aug 2017
QMC Error SAMSI Tutorial Aug 2017Fred J. Hickernell
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)Shane Nicklas
 
Scattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysisScattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysisVjekoslavKovac1
 
Estimates for a class of non-standard bilinear multipliers
Estimates for a class of non-standard bilinear multipliersEstimates for a class of non-standard bilinear multipliers
Estimates for a class of non-standard bilinear multipliersVjekoslavKovac1
 
A Szemerédi-type theorem for subsets of the unit cube
A Szemerédi-type theorem for subsets of the unit cubeA Szemerédi-type theorem for subsets of the unit cube
A Szemerédi-type theorem for subsets of the unit cubeVjekoslavKovac1
 
Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsVjekoslavKovac1
 
The partial derivative of the binary Cross-entropy loss function
The partial derivative of the binary Cross-entropy loss functionThe partial derivative of the binary Cross-entropy loss function
The partial derivative of the binary Cross-entropy loss functionTobiasRoeschl
 
GradStudentSeminarSept30
GradStudentSeminarSept30GradStudentSeminarSept30
GradStudentSeminarSept30Ryan White
 
On maximal and variational Fourier restriction
On maximal and variational Fourier restrictionOn maximal and variational Fourier restriction
On maximal and variational Fourier restrictionVjekoslavKovac1
 
A sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentialsA sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentialsVjekoslavKovac1
 
Some Examples of Scaling Sets
Some Examples of Scaling SetsSome Examples of Scaling Sets
Some Examples of Scaling SetsVjekoslavKovac1
 
Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...
Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...
Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...VjekoslavKovac1
 
Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9Daisuke Yoneoka
 
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian ProcessesAccelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian ProcessesMatt Moores
 
MDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/MeasureMDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/MeasureJoe Suzuki
 

What's hot (20)

Quantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averagesQuantitative norm convergence of some ergodic averages
Quantitative norm convergence of some ergodic averages
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
QMC Error SAMSI Tutorial Aug 2017
QMC Error SAMSI Tutorial Aug 2017QMC Error SAMSI Tutorial Aug 2017
QMC Error SAMSI Tutorial Aug 2017
 
Specific Finite Groups(General)
Specific Finite Groups(General)Specific Finite Groups(General)
Specific Finite Groups(General)
 
Scattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysisScattering theory analogues of several classical estimates in Fourier analysis
Scattering theory analogues of several classical estimates in Fourier analysis
 
735
735735
735
 
Estimates for a class of non-standard bilinear multipliers
Estimates for a class of non-standard bilinear multipliersEstimates for a class of non-standard bilinear multipliers
Estimates for a class of non-standard bilinear multipliers
 
A Szemerédi-type theorem for subsets of the unit cube
A Szemerédi-type theorem for subsets of the unit cubeA Szemerédi-type theorem for subsets of the unit cube
A Szemerédi-type theorem for subsets of the unit cube
 
Trilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operatorsTrilinear embedding for divergence-form operators
Trilinear embedding for divergence-form operators
 
The partial derivative of the binary Cross-entropy loss function
The partial derivative of the binary Cross-entropy loss functionThe partial derivative of the binary Cross-entropy loss function
The partial derivative of the binary Cross-entropy loss function
 
GradStudentSeminarSept30
GradStudentSeminarSept30GradStudentSeminarSept30
GradStudentSeminarSept30
 
On maximal and variational Fourier restriction
On maximal and variational Fourier restrictionOn maximal and variational Fourier restriction
On maximal and variational Fourier restriction
 
A sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentialsA sharp nonlinear Hausdorff-Young inequality for small potentials
A sharp nonlinear Hausdorff-Young inequality for small potentials
 
Some Examples of Scaling Sets
Some Examples of Scaling SetsSome Examples of Scaling Sets
Some Examples of Scaling Sets
 
Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...
Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...
Variants of the Christ-Kiselev lemma and an application to the maximal Fourie...
 
Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9Murphy: Machine learning A probabilistic perspective: Ch.9
Murphy: Machine learning A probabilistic perspective: Ch.9
 
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian ProcessesAccelerating Pseudo-Marginal MCMC using Gaussian Processes
Accelerating Pseudo-Marginal MCMC using Gaussian Processes
 
MDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/MeasureMDL/Bayesian Criteria based on Universal Coding/Measure
MDL/Bayesian Criteria based on Universal Coding/Measure
 
F10
F10F10
F10
 
Genomic Graphics
Genomic GraphicsGenomic Graphics
Genomic Graphics
 

Similar to A note on the density of Gumbel-softmax

Fast parallelizable scenario-based stochastic optimization
Fast parallelizable scenario-based stochastic optimizationFast parallelizable scenario-based stochastic optimization
Fast parallelizable scenario-based stochastic optimizationPantelis Sopasakis
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)IJERD Editor
 
fouriertransform.pdf
fouriertransform.pdffouriertransform.pdf
fouriertransform.pdfssuser4dafea
 
FUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVEL
FUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVELFUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVEL
FUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVELMohanSonawane
 
The Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace EquationThe Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace EquationJohnathan Gray
 
5.8 Permutations (handout)
5.8 Permutations (handout)5.8 Permutations (handout)
5.8 Permutations (handout)Jan Plaza
 
Best Approximation in Real Linear 2-Normed Spaces
Best Approximation in Real Linear 2-Normed SpacesBest Approximation in Real Linear 2-Normed Spaces
Best Approximation in Real Linear 2-Normed SpacesIOSR Journals
 
Dominación y extensiones óptimas de operadores con rango esencial compacto en...
Dominación y extensiones óptimas de operadores con rango esencial compacto en...Dominación y extensiones óptimas de operadores con rango esencial compacto en...
Dominación y extensiones óptimas de operadores con rango esencial compacto en...esasancpe
 
Convexity in the Theory of the Gamma Function.pdf
Convexity in the Theory of the Gamma Function.pdfConvexity in the Theory of the Gamma Function.pdf
Convexity in the Theory of the Gamma Function.pdfPeterEsnayderBarranz
 
Cubic Spline Interpolation
Cubic Spline InterpolationCubic Spline Interpolation
Cubic Spline InterpolationVARUN KUMAR
 
Tales on two commuting transformations or flows
Tales on two commuting transformations or flowsTales on two commuting transformations or flows
Tales on two commuting transformations or flowsVjekoslavKovac1
 
Formulas
FormulasFormulas
FormulasZHERILL
 
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...Steven Duplij (Stepan Douplii)
 
34032 green func
34032 green func34032 green func
34032 green funcansarixxx
 
Applications of Numerical Functional Analysis in Atomless Finite Measure Spaces
Applications of Numerical Functional Analysis in Atomless Finite Measure SpacesApplications of Numerical Functional Analysis in Atomless Finite Measure Spaces
Applications of Numerical Functional Analysis in Atomless Finite Measure SpacesQUESTJOURNAL
 
Chapter1 functions
Chapter1 functionsChapter1 functions
Chapter1 functionsMonie Joey
 

Similar to A note on the density of Gumbel-softmax (20)

Fast parallelizable scenario-based stochastic optimization
Fast parallelizable scenario-based stochastic optimizationFast parallelizable scenario-based stochastic optimization
Fast parallelizable scenario-based stochastic optimization
 
Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)Welcome to International Journal of Engineering Research and Development (IJERD)
Welcome to International Journal of Engineering Research and Development (IJERD)
 
fouriertransform.pdf
fouriertransform.pdffouriertransform.pdf
fouriertransform.pdf
 
FUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVEL
FUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVELFUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVEL
FUNCTION EX 1 PROBLEMS WITH SOLUTION UPTO JEE LEVEL
 
exponen dan logaritma
exponen dan logaritmaexponen dan logaritma
exponen dan logaritma
 
The Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace EquationThe Fundamental Solution of an Extension to a Generalized Laplace Equation
The Fundamental Solution of an Extension to a Generalized Laplace Equation
 
5.8 Permutations (handout)
5.8 Permutations (handout)5.8 Permutations (handout)
5.8 Permutations (handout)
 
Ece3075 a 8
Ece3075 a 8Ece3075 a 8
Ece3075 a 8
 
Best Approximation in Real Linear 2-Normed Spaces
Best Approximation in Real Linear 2-Normed SpacesBest Approximation in Real Linear 2-Normed Spaces
Best Approximation in Real Linear 2-Normed Spaces
 
Lesson 3 Operation on Functions
Lesson 3 Operation on FunctionsLesson 3 Operation on Functions
Lesson 3 Operation on Functions
 
Dominación y extensiones óptimas de operadores con rango esencial compacto en...
Dominación y extensiones óptimas de operadores con rango esencial compacto en...Dominación y extensiones óptimas de operadores con rango esencial compacto en...
Dominación y extensiones óptimas de operadores con rango esencial compacto en...
 
Convexity in the Theory of the Gamma Function.pdf
Convexity in the Theory of the Gamma Function.pdfConvexity in the Theory of the Gamma Function.pdf
Convexity in the Theory of the Gamma Function.pdf
 
Cubic Spline Interpolation
Cubic Spline InterpolationCubic Spline Interpolation
Cubic Spline Interpolation
 
Tales on two commuting transformations or flows
Tales on two commuting transformations or flowsTales on two commuting transformations or flows
Tales on two commuting transformations or flows
 
Formulas
FormulasFormulas
Formulas
 
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
S. Duplij, Y. Hong, F. Li. Uq(sl(m+1))-module algebra structures on the coord...
 
34032 green func
34032 green func34032 green func
34032 green func
 
Applications of Numerical Functional Analysis in Atomless Finite Measure Spaces
Applications of Numerical Functional Analysis in Atomless Finite Measure SpacesApplications of Numerical Functional Analysis in Atomless Finite Measure Spaces
Applications of Numerical Functional Analysis in Atomless Finite Measure Spaces
 
Chapter1 functions
Chapter1 functionsChapter1 functions
Chapter1 functions
 
Chapter1 functions
Chapter1 functionsChapter1 functions
Chapter1 functions
 

More from Tomonari Masada

Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説Tomonari Masada
 
Denoising Diffusion Probabilistic Modelsの重要な式の解説
Denoising Diffusion Probabilistic Modelsの重要な式の解説Denoising Diffusion Probabilistic Modelsの重要な式の解説
Denoising Diffusion Probabilistic Modelsの重要な式の解説Tomonari Masada
 
Context-dependent Token-wise Variational Autoencoder for Topic Modeling
Context-dependent Token-wise Variational Autoencoder for Topic ModelingContext-dependent Token-wise Variational Autoencoder for Topic Modeling
Context-dependent Token-wise Variational Autoencoder for Topic ModelingTomonari Masada
 
トピックモデルの基礎と応用
トピックモデルの基礎と応用トピックモデルの基礎と応用
トピックモデルの基礎と応用Tomonari Masada
 
Expectation propagation for latent Dirichlet allocation
Expectation propagation for latent Dirichlet allocationExpectation propagation for latent Dirichlet allocation
Expectation propagation for latent Dirichlet allocationTomonari Masada
 
Mini-batch Variational Inference for Time-Aware Topic Modeling
Mini-batch Variational Inference for Time-Aware Topic ModelingMini-batch Variational Inference for Time-Aware Topic Modeling
Mini-batch Variational Inference for Time-Aware Topic ModelingTomonari Masada
 
A note on variational inference for the univariate Gaussian
A note on variational inference for the univariate GaussianA note on variational inference for the univariate Gaussian
A note on variational inference for the univariate GaussianTomonari Masada
 
Document Modeling with Implicit Approximate Posterior Distributions
Document Modeling with Implicit Approximate Posterior DistributionsDocument Modeling with Implicit Approximate Posterior Distributions
Document Modeling with Implicit Approximate Posterior DistributionsTomonari Masada
 
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka CompositionLDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka CompositionTomonari Masada
 
A Note on Latent LSTM Allocation
A Note on Latent LSTM AllocationA Note on Latent LSTM Allocation
A Note on Latent LSTM AllocationTomonari Masada
 
Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Tomonari Masada
 
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic ModelA Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic ModelTomonari Masada
 
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationTomonari Masada
 
Word count in Husserliana Volumes 1 to 28
Word count in Husserliana Volumes 1 to 28Word count in Husserliana Volumes 1 to 28
Word count in Husserliana Volumes 1 to 28Tomonari Masada
 
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationTomonari Masada
 
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...Tomonari Masada
 

More from Tomonari Masada (20)

Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説Learning Latent Space Energy Based Prior Modelの解説
Learning Latent Space Energy Based Prior Modelの解説
 
Denoising Diffusion Probabilistic Modelsの重要な式の解説
Denoising Diffusion Probabilistic Modelsの重要な式の解説Denoising Diffusion Probabilistic Modelsの重要な式の解説
Denoising Diffusion Probabilistic Modelsの重要な式の解説
 
Context-dependent Token-wise Variational Autoencoder for Topic Modeling
Context-dependent Token-wise Variational Autoencoder for Topic ModelingContext-dependent Token-wise Variational Autoencoder for Topic Modeling
Context-dependent Token-wise Variational Autoencoder for Topic Modeling
 
トピックモデルの基礎と応用
トピックモデルの基礎と応用トピックモデルの基礎と応用
トピックモデルの基礎と応用
 
Expectation propagation for latent Dirichlet allocation
Expectation propagation for latent Dirichlet allocationExpectation propagation for latent Dirichlet allocation
Expectation propagation for latent Dirichlet allocation
 
Mini-batch Variational Inference for Time-Aware Topic Modeling
Mini-batch Variational Inference for Time-Aware Topic ModelingMini-batch Variational Inference for Time-Aware Topic Modeling
Mini-batch Variational Inference for Time-Aware Topic Modeling
 
A note on variational inference for the univariate Gaussian
A note on variational inference for the univariate GaussianA note on variational inference for the univariate Gaussian
A note on variational inference for the univariate Gaussian
 
Document Modeling with Implicit Approximate Posterior Distributions
Document Modeling with Implicit Approximate Posterior DistributionsDocument Modeling with Implicit Approximate Posterior Distributions
Document Modeling with Implicit Approximate Posterior Distributions
 
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka CompositionLDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
LDA-Based Scoring of Sequences Generated by RNN for Automatic Tanka Composition
 
A Note on ZINB-VAE
A Note on ZINB-VAEA Note on ZINB-VAE
A Note on ZINB-VAE
 
A Note on Latent LSTM Allocation
A Note on Latent LSTM AllocationA Note on Latent LSTM Allocation
A Note on Latent LSTM Allocation
 
A Note on TopicRNN
A Note on TopicRNNA Note on TopicRNN
A Note on TopicRNN
 
Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)Topic modeling with Poisson factorization (2)
Topic modeling with Poisson factorization (2)
 
Poisson factorization
Poisson factorizationPoisson factorization
Poisson factorization
 
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic ModelA Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
A Simple Stochastic Gradient Variational Bayes for the Correlated Topic Model
 
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
 
Word count in Husserliana Volumes 1 to 28
Word count in Husserliana Volumes 1 to 28Word count in Husserliana Volumes 1 to 28
Word count in Husserliana Volumes 1 to 28
 
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet AllocationA Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
A Simple Stochastic Gradient Variational Bayes for Latent Dirichlet Allocation
 
FDSE2015
FDSE2015FDSE2015
FDSE2015
 
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
A derivation of the sampling formulas for An Entity-Topic Model for Entity Li...
 

Recently uploaded

Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...amitlee9823
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...amitlee9823
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...amitlee9823
 
➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men 🔝Thrissur🔝 Escor...
➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men  🔝Thrissur🔝   Escor...➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men  🔝Thrissur🔝   Escor...
➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men 🔝Thrissur🔝 Escor...amitlee9823
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...amitlee9823
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...only4webmaster01
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% SecurePooja Nehwal
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachBoston Institute of Analytics
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx9to5mart
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Delhi Call girls
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...amitlee9823
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...amitlee9823
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangaloreamitlee9823
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteedamy56318795
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsJoseMangaJr1
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramMoniSankarHazra
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Standamitlee9823
 

Recently uploaded (20)

Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night StandCall Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Doddaballapur Road ☎ 7737669865 🥵 Book Your One night Stand
 
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
Call Girls Bannerghatta Road Just Call 👗 7737669865 👗 Top Class Call Girl Ser...
 
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
Call Girls Bommasandra Just Call 👗 7737669865 👗 Top Class Call Girl Service B...
 
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men  🔝malwa🔝   Escorts Ser...
➥🔝 7737669865 🔝▻ malwa Call-girls in Women Seeking Men 🔝malwa🔝 Escorts Ser...
 
➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men 🔝Thrissur🔝 Escor...
➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men  🔝Thrissur🔝   Escor...➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men  🔝Thrissur🔝   Escor...
➥🔝 7737669865 🔝▻ Thrissur Call-girls in Women Seeking Men 🔝Thrissur🔝 Escor...
 
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men  🔝Mathura🔝   Escorts...
➥🔝 7737669865 🔝▻ Mathura Call-girls in Women Seeking Men 🔝Mathura🔝 Escorts...
 
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
(NEHA) Call Girls Katra Call Now 8617697112 Katra Escorts 24x7
 
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
Call Girls Indiranagar Just Call 👗 9155563397 👗 Top Class Call Girl Service B...
 
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% SecureCall me @ 9892124323  Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
Call me @ 9892124323 Cheap Rate Call Girls in Vashi with Real Photo 100% Secure
 
Detecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning ApproachDetecting Credit Card Fraud: A Machine Learning Approach
Detecting Credit Card Fraud: A Machine Learning Approach
 
hybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptxhybrid Seed Production In Chilli & Capsicum.pptx
hybrid Seed Production In Chilli & Capsicum.pptx
 
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
Call Girls in Sarai Kale Khan Delhi 💯 Call Us 🔝9205541914 🔝( Delhi) Escorts S...
 
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
Escorts Service Kumaraswamy Layout ☎ 7737669865☎ Book Your One night Stand (B...
 
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
Vip Mumbai Call Girls Marol Naka Call On 9920725232 With Body to body massage...
 
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service BangaloreCall Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
Call Girls Begur Just Call 👗 7737669865 👗 Top Class Call Girl Service Bangalore
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Probability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter LessonsProbability Grade 10 Third Quarter Lessons
Probability Grade 10 Third Quarter Lessons
 
Capstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics ProgramCapstone Project on IBM Data Analytics Program
Capstone Project on IBM Data Analytics Program
 
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night StandCall Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Attibele ☎ 7737669865 🥵 Book Your One night Stand
 

A note on the density of Gumbel-softmax

  • 1. A note on the density of Gumbel-softmax Tomonari MASADA @ Nagasaki University May 29, 2019 This note explicates some details of the discussion given in Appendix B of [1]. The Gumbel-softmax trick gives a k-dimensional sample vector y = (y1, . . . , yk) ∈ ∆k−1 whose entries are obtained as yi = exp((log(πi) + gi)/τ) k j=1 exp((log(πj) + gj)/τ) for i = 1, . . . , k, (1) by using g1, . . . , gk, which are i.i.d samples drawn from Gumbel(0, 1). Define xi = log(πi). Then y is rewritten as yi = exp((xi + gi)/τ) k j=1 exp((xj + gj)/τ) for i = 1, . . . , k, (2) Divide both numerator and denominator by exp((xk + gk)/τ). yi = exp((xi + gi − (xk + gk))/τ) k j=1 exp((xj + gj − (xk + gk))/τ) for i = 1, . . . , k, (3) Define ui = xi + gi − (xk + gk) for i = 1, . . . , k − 1, where gi ∼ Gumbel(0, 1). When gk is given, gi = ui−xi+(xk+gk) and ui can thus be regarded as a sample from the Gumbel whose mean is xi−(xk+gk) and scale parameter is 1. Therefore, p(ui|gk) = e−{(ui−xi+(xk+gk))+e−(ui−xi+(xk+gk)) } . Consequently, the density p(u1, . . . , uk−1) is given as follows: p(u1, . . . , uk−1) = ∞ −∞ dgkp(u1, . . . , uk−1|gk)p(gk) = ∞ −∞ dgkp(gk) k−1 i=1 p(ui|gk) = ∞ −∞ dgke−gk−e−gk k−1 i=1 exi−ui−xk−gk−exi−ui−xk−gk (4) Perform a change of variables with v = e−gk . Then dv dgk = −e−gk . Therefore, dv = −e−gk dgk and dgk = −dvegk = −dv/v. p(u1, . . . , uk−1) = 0 ∞ (−dv)e−v k−1 i=1 vexi−ui−xk−vexi−ui−xk = k−1 i=1 exi−ui−xk ∞ 0 dve−v vk−1 k−1 i=1 e−vexi−ui−xk = e−(k−1)xk k−1 i=1 exi−ui ∞ 0 dvvk−1 e−v(1+e−xk k−1 i=1 (exi−ui )) (5) Recall the following fact related to Gamma integral: ∞ 0 xz−1 e−ax dx = ∞ 0 y a z−1 e−y dy a = 1 a z ∞ 0 yz−1 e−y dy = a−z Γ(z) (6) 1
  • 2. Therefore, p(u1, . . . , uk−1) = e−(k−1)xk k−1 i=1 exi−ui ∞ 0 dvvk−1 e−v(1+e−xk k−1 i=1 (exi−ui )) = e−kxk exk k−1 i=1 exi−ui 1 + e−xk k−1 i=1 (exi−ui ) −k Γ(k) = exk k−1 i=1 exi−ui exk + k−1 i=1 (exi−ui ) −k Γ(k) = exp xk + k−1 i=1 (xi − ui) exk + k−1 i=1 (exi−ui ) −k Γ(k) (7) Define uk = 0. Then p(u1, . . . , uk−1) = Γ(k) k i=1 exp(xi − ui) k i=1 exp(xi − ui) −k (8) A k-dimensional sample vector y = (y1, . . . , yk) ∈ ∆k−1 is obtained from u1, . . . , uk−1 by applying a deterministic transformation h: hi(u1, . . . , uk−1) = exp(ui/τ) 1 + k−1 j=1 exp(uj/τ) for i = 1, . . . , k − 1 (9) as follows: yi = hi(u1, . . . , uk−1) for i = 1, . . . , k − 1 (10) Note that yk is fixed given y1, . . . , yk−1: yk = 1 1 + k−1 j=1 exp(uj/τ) = 1 − k−1 j=1 yj (11) By using the change of variables we can obtain the density function for y: p(y) = p(h−1 (y1, . . . , yk−1)) det ∂(h−1 1 (y1, . . . , yk−1), . . . , h−1 k−1(y1, . . . , yk−1)) ∂(y1, . . . , yk−1) (12) The inverse of h is obtained as follows: yi = exp(ui/τ) 1 + k−1 j=1 exp(uj/τ) yi = yk exp(ui/τ) from yk = 1 1+ k−1 j=1 exp(uj /τ) log yi = log yk + ui/τ ∴ h−1 i (y1, . . . , yk−1) = ui = τ × (log yi − log yk) = τ × log yi − log 1 − k−1 j=1 yj (13) Therefore, we obtain the Jacobian: ∂h−1 i (y1, . . . , yk−1) ∂yi = τ × 1 yi − 1 yk ∂yk ∂yi = τ × 1 yi + 1 yk (14) ∂h−1 i (y1, . . . , yk−1) ∂yj = τ × − 1 yk ∂yk ∂yj = τ × 1 yk for j = i (15) Eqs. from (24) to (28) are easy to understand. References [1] E. Jang, S. Gu, and B. Poole. Categorical representation with Gumbel-softmax. ICLR, 2017. 2