๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

Machine Learning/๋”ฅ๋Ÿฌ๋‹

MDN

๋ฐ˜์‘ํ˜•

MDN์—์„œ๋Š” ์ถœ๋ ฅ๊ฐ’์„ ๋ช…์‹œ์ ์œผ๋กœ ์ƒ์„ฑํ•˜์—ฌ x->y ๋งคํ•‘์„ ๋ชจ๋ธ๋งํ•˜๋Š” ๋Œ€์‹  
๊ฐ ๋Œ€์ƒ์˜ ํ™•๋ฅ  ๋ถ„ํฌ๋ฅผ ํ•™์Šตํ•˜๊ณ  ์ถœ๋ ฅ์„ ์ƒ˜ํ”Œ๋งํ•œ๋‹ค. 
๋ถ„ํฌ ์ž์ฒด๋Š” ์—ฌ๋Ÿฌ ๊ฐ€์šฐ์‹œ์•ˆ(๊ฐ€์šฐ์Šค ํ˜ผํ•ฉ) ์œผ๋กœ ํ‘œ์‹œ๋œ๋‹ค. 

๋ชจ๋“  ์ž…๋ ฅ x์— ๋Œ€ํ•ด distribution parameters๋ฅผ ํ•™์Šตํ•œ๋‹ค. mean, variance, mixing coefficient 
k : ๊ฐ€์šฐ์‹œ์•ˆ ์ˆ˜

l : ์ž…๋ ฅ ํ”ผ์ฒ˜ ์ˆ˜ (l + 2) k

์ถœ๋ ฅ๊ฐ’:

Mixing coefficient, ๋ถ„์‚ฐ, ํ‰๊ท 

 

the mixing coefficients์™€ component density parameters๋ฅผ ํ•™์Šตํ•œ๋‹ค.

# In our toy example, we have single input feature
l = 1
# Number of gaussians to represent the multimodal distribution
k = 26

# Network
input = tf.keras.Input(shape=(l,))
layer = tf.keras.layers.Dense(50, activation='tanh', name='baselayer')(input)
mu = tf.keras.layers.Dense((l * k), activation=None, name='mean_layer')(layer)
# variance (should be greater than 0 so we exponentiate it)
var_layer = tf.keras.layers.Dense(k, activation=None, name='dense_var_layer')(layer)
var = tf.keras.layers.Lambda(lambda x: tf.math.exp(x), output_shape=(k,), name='variance_layer')(var_layer)
# mixing coefficient should sum to 1.0
pi = tf.keras.layers.Dense(k, activation='softmax', name='pi_layer')(layer)
model = tf.keras.models.Model(input, [pi, mu, var])
optimizer = tf.keras.optimizers.Adam()
model.summary()

 

Loss

 

 

https://www.katnoria.com/mdn/

 

https://www.katnoria.com/mdn/

Mixture Density Networks Supervised machine learning models learn the mapping between the input features (x) and the target values (y). The regression models predict continuous output such as house price or stock price whereas classification models predict

www.katnoria.com

๋ฐ˜์‘ํ˜•