MDN์์๋ ์ถ๋ ฅ๊ฐ์ ๋ช
์์ ์ผ๋ก ์์ฑํ์ฌ x->y ๋งคํ์ ๋ชจ๋ธ๋งํ๋ ๋์
๊ฐ ๋์์ ํ๋ฅ ๋ถํฌ๋ฅผ ํ์ตํ๊ณ ์ถ๋ ฅ์ ์ํ๋งํ๋ค.
๋ถํฌ ์์ฒด๋ ์ฌ๋ฌ ๊ฐ์ฐ์์(๊ฐ์ฐ์ค ํผํฉ) ์ผ๋ก ํ์๋๋ค.
๋ชจ๋ ์
๋ ฅ x์ ๋ํด distribution parameters๋ฅผ ํ์ตํ๋ค. mean, variance, mixing coefficient
k : ๊ฐ์ฐ์์ ์
l : ์ ๋ ฅ ํผ์ฒ ์ (l + 2) k
์ถ๋ ฅ๊ฐ:
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/
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
'Machine Learning > ๋ฅ๋ฌ๋' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Keras] Noise Regularization (0) | 2019.08.27 |
---|---|
ํ๋ จ์ , ๊ฒ์ฆ์ , ์ํ์ (0) | 2019.08.26 |
Validation, Test ๋ฐ์ดํฐ์ธํธ ๋น๊ต (0) | 2019.08.24 |
๋ฅ๋ฌ๋ ๋ชจ๋ธ์ ๊ต์ฐจ๊ฒ์ฆ (Cross Validation) (0) | 2019.08.21 |
[Machine Learning] Train data normalization (0) | 2019.07.12 |