Ein flussbasiertes generatives Modell ist ein generatives Modell , welches die Wahrscheinlichkeitsdichte der zugrundeliegenden Trainingsdaten schätzt , indem der normalisierte Fluss (normalizing flow) [ 1] berechnet wird. Der normalizing flow wird aus den Rechenregeln zum Wechseln der Variablen bei Integration (siehe Transformationssatz ) hergeleitet, wobei eine einfache Verteilung in die komplizierte Zielverteilung transformiert wird.
Normalisierten Flüssen liegt die folgende Tatsache zugrunde: Betrachten wir die bijektive Abbildung g {\displaystyle g} , sodass Y = g ( X ) {\displaystyle Y=g(X)} , dann gilt laut Transformationssatz
p X ( x ) = p Y ( g ( x ) ) | ∂ g ( x ) ∂ x | ⇔ p Y ( y ) = p X ( g − 1 ( y ) ) | ∂ g ( x ) ∂ x | − 1 , {\displaystyle p_{X}(x)=p_{Y}(g(x))\left|{\frac {\partial g(x)}{\partial x}}\right|\Leftrightarrow p_{Y}(y)=p_{X}(g^{-1}(y))\left|{\frac {\partial g(x)}{\partial x}}\right|^{-1},} wobei | ∂ g ( x ) ∂ x | {\displaystyle \left|{\frac {\partial g(x)}{\partial x}}\right|} der Betrag der Funktionaldeterminante ist und g {\displaystyle g} durch neuronale Netze parametrisiert wird.
Schema, welches den normalisierten Fluss darstellt Betrachte Bijektionen f i {\displaystyle f_{i}} , sodass z 1 = f 1 ( z 0 ) {\displaystyle z_{1}=f_{1}(z_{0})} , sodass z 0 = f 1 − 1 ( z 1 ) {\displaystyle z_{0}=f_{1}^{-1}(z_{1})} .
Aufgrund des Transformationssatzes gilt:
p 1 ( z 1 ) = p 0 ( z 0 ) | det d f 1 − 1 ( z 1 ) d z 1 | , {\displaystyle p_{1}(z_{1})=p_{0}(z_{0})\left|\det {\frac {df_{1}^{-1}(z_{1})}{dz_{1}}}\right|,} bzw. log ( p 1 ( z 1 ) ) = log ( p 0 ( z 0 ) ) + log ( | det d f 1 − 1 ( z 1 ) d z 1 | ) = log ( p 0 ( z 0 ) ) − log ( | det d f 1 ( z 1 ) d z 1 | ) , {\displaystyle \log(p_{1}(z_{1}))=\log(p_{0}(z_{0}))+\log \left(\left|\det {\frac {df_{1}^{-1}(z_{1})}{dz_{1}}}\right|\right)=\log(p_{0}(z_{0}))-\log \left(\left|\det {\frac {df_{1}(z_{1})}{dz_{1}}}\right|\right),} daher gilt
log ( p n ( z n ) ) = log ( p n − 1 ( z n − 1 ) ) − log ( | det d f n ( z n ) d z n | ) , {\displaystyle \log(p_{n}(z_{n}))=\log(p_{n-1}(z_{n-1}))-\log \left(\left|\det {\frac {df_{n}(z_{n})}{dz_{n}}}\right|\right),} und wiederholtes Einsetzen der Regel liefert:
log p K ( z K ) = log p 0 ( z 0 ) − ∑ i = 1 K log | det d f i ( z i − 1 ) d z i − 1 | {\displaystyle \log p_{K}(z_{K})=\log p_{0}(z_{0})-\sum _{i=1}^{K}\log \left|\det {\frac {df_{i}(z_{i-1})}{dz_{i-1}}}\right|} Ziel des Trainings ist es die Kullback-Leibler-Divergenz zwischen der geschätzten Wahrscheinlichkeitsdichte p θ := p K {\displaystyle p_{\theta }:=p_{K}} und der wahren, die Stichproben generierende, Wahrscheinlichkeitsdichte p ∗ {\displaystyle p^{*}} zu minimieren:
θ ^ = a r g m i n θ D K L [ p ∗ ( x ) | | p θ ( x ) ] {\displaystyle {\hat {\theta }}={\underset {\theta }{\operatorname {arg\,min} }}\ D_{KL}[p^{*}(x)||p_{\theta }(x)]} . Durch Schätzen des Erwartungswertes in der Kullback-Leibler-Divergenz mithilfe einer Realisierung des Stichprobenmittelwertes (und Vernachlässigung konstanter Terme) können die optimalen Maximum-Likelihood Parameter θ ^ {\displaystyle {\hat {\theta }}} geschätzt werden:
θ ^ = arg min θ − E ^ p ∗ ( x ) [ log ( p θ ( x ) ) ] = arg min θ − 1 N ∑ i = 0 N log ( p θ ( x i ) ) {\displaystyle {\hat {\theta }}=\arg \min _{\theta }-{\hat {\mathbb {E} }}_{p^{*}(x)}[\log(p_{\theta }(x))]=\arg \min _{\theta }-{\frac {1}{N}}\sum _{i=0}^{N}\log(p_{\theta }(x_{i}))} Das früheste Beispiel einer Abbildung f {\displaystyle f} ist der planare Fluss[ 1] . Bei gegebener Aktivierungsfunktion h {\displaystyle h} , und Parametern θ = ( u , w , b ) {\displaystyle \theta =(u,w,b)} mit entsprechender Dimension, ist x = f θ ( z ) = z + u h ( ⟨ w , z ⟩ + b ) {\displaystyle x=f_{\theta }(z)=z+uh(\langle w,z\rangle +b)} und die inverse f θ − 1 {\displaystyle f_{\theta }^{-1}} (ohne allgemeingültige geschlossene Form).
Der Jacobian ist | det ( I + h ′ ( ⟨ w , z ⟩ + b ) u w T ) | = | 1 + h ′ ( ⟨ w , z ⟩ + b ) ⟨ u , w ⟩ | {\displaystyle |\det(I+h'(\langle w,z\rangle +b)uw^{T})|=|1+h'(\langle w,z\rangle +b)\langle u,w\rangle |} .
Damit der Fluss invertierbar ist, muss die Determinante überall ungleich null sein, was z. B. mit h = tanh {\displaystyle h=\tanh } und ⟨ u , w ⟩ > − 1 {\displaystyle \langle u,w\rangle >-1} der Fall ist.
↑ a b Danilo Jimenez Rezende, Shakir Mohamed: Variational Inference with Normalizing Flows . 14. Juni 2016, arxiv :1505.05770 (englisch).