ç©èª
çæã¢ããªã³ã°ã«ã¯ãæªèšç®ã®äºåŸååžã®è¿äŒŒãå«ãŸããŸãã ãã®ãããå·®å¥ã¢ãã«ããã¬ãŒãã³ã°ããããã«éçºãããæãå¹æçãªæ¹æ³ã¯ãçæã¢ãã«ã§ã¯æ©èœããŸããã ãã®åé¡ã解決ããããã®æ¢åã®æ¹æ³ã¯èšç®ãé£ãããäž»ã«æ¡åŒµæ§ã«ä¹ãããã«ã³ãé£éã¢ã³ãã«ã«ãæ³ã®äœ¿çšã«åºã¥ããŠããŸãã ãããã£ãŠãçæã¢ãã«ããã¬ãŒãã³ã°ããã«ã¯ã 確ççåŸé éäžïŒSGDïŒãéäŒæãªã©ã®ã¹ã±ãŒã©ãã«ãªææ³ã«åºã¥ãæ¹æ³ãå¿ èŠã§ããã ãã®ãããªæ¹æ³ã®1ã€ã¯ãGenerative Adversarial NetworksïŒGANïŒã§ãã GANã¯2014幎ã«ãã®èšäºã§åããŠææ¡ãããŸãã ã é«ã¬ãã«ã®ãã®ã¢ãã«ã¯ãäºãã«ç«¶åãã2ã€ã®ãµãã¢ãã«ãšããŠèª¬æã§ããŸãããããã®ã¢ãã«ã®1ã€ïŒãžã§ãã¬ãŒã¿ãŒïŒã¯ã2çªç®ã®ãµãã¢ãã«ïŒå·®å¥è ïŒã欺ãæå³ã§åŠç¿ããããšããŠããŸãã ãããè¡ãããã«ããžã§ãã¬ãŒã¿ãŒã¯ã©ã³ãã ãªãªããžã§ã¯ããçæããåŒå¥åšã¯ãããã®çæããããªããžã§ã¯ãããã¬ãŒãã³ã°ã»ããã®å®éã®ãªããžã§ã¯ããšåºå¥ããããšããŸãã åŠç¿ããã»ã¹ã§ã¯ããžã§ãã¬ãŒã¿ãŒããµã³ãã«ã«ãŸããŸãé¡äŒŒãããªããžã§ã¯ããçæããåŒå¥è ãããããå®éã®ãªããžã§ã¯ããšåºå¥ããããšããŸããŸãå°é£ã«ãªããŸãã ãããã£ãŠããžã§ãã¬ãŒã¿ã¯ãããšãã°äººéã®é¡ã®åçã®ååžãªã©ãäœããã®è€éãªååžãããªããžã§ã¯ããçæããçæã¢ãã«ã«å€ãããŸãã
ã¢ãã«
ãŸããå¿ èŠãªçšèªã玹ä»ããŸãã ãéã㊠ãªããžã§ã¯ãã®ã¹ããŒã¹ã瀺ããŸãã ããšãã°ãåç ãã¯ã»ã«ã ãã確ç空é㧠ãã¯ãã«ç¢ºçå€æ° å¯åºŠãæã€ç¢ºçååž ãã®ãããªã¹ããŒã¹ã®ãµãã»ãã ãã®äž ãŒã以å€ã®å€ãåããŸã-ãããã¯ãããšãã°ã人éã®é¡ã®åçã§ãã ãã°ããã¥ãŒãã®é¡åçã®ã©ã³ãã ãªiidãµã³ãã«ãäžããããŸã ã ããã«ãè£å©ã¹ããŒã¹ãå®çŸ©ããŸã ããã³ã©ã³ãã å€æ° å¯åºŠãæã€ç¢ºçååž ã -åŒå¥åšæ©èœã ãã®é¢æ°ã¯ãå ¥åãšããŠãªããžã§ã¯ããåããŸãã ïŒãã®äŸã§ã¯ãé©åãªãµã€ãºã®ç»åïŒããã³å ¥åç»åã人éã®é¡ã®åçã§ãã確çãè¿ããŸãã -ãžã§ãã¬ãŒã¿ãŒæ©èœã 圌女ã¯æå³ãåããŸã 空éãªããžã§ã¯ããçæããŸã ãã€ãŸããç§ãã¡ã®å Žåãåçã§ãã
ãã§ã«å®ç§ãªèå¥åšãæã£ãŠãããšããŸã ã ã©ããªäŸã§ã ãã®äŸãç¹å®ã®ãµãã»ããã«å±ããçã®ç¢ºçãæäŸããŸã ãµã³ãã«ã®ååŸå ã 確ççèšèªã§åŒå¥åšã欺ãåé¡ãåå®åŒåãããšãçæãããäŸã䜿çšããŠçæ³çãªåŒå¥åšãäžãã確çãæ倧åããå¿ èŠãããããšãããããŸãã ãããã£ãŠãæé©ãªçºé»æ©ã¯ ã ä»¥æ¥ å調ã«å¢å ããé¢æ°ã§ãããåŒæ°ã®æ¥µå€ã®äœçœ®ãå€æŽããŸããããã®åŒã次ã®ããã«æžãæããŸãã ããã¯å°æ¥äŸ¿å©ã«ãªããŸãã
çŸå®ã«ã¯ãéåžžãçæ³çãªèå¥åšã¯ãªããèŠã€ããªããã°ãªããŸããã åŒå¥åšã®ã¿ã¹ã¯ã¯ãçæ³çãªåŒå¥åšã®ä»£ããã«ãžã§ãã¬ãŒã¿ãŒããã¬ãŒãã³ã°ããä¿¡å·ãæäŸããããšã§ãããããçŸåšã®ãžã§ãã¬ãŒã¿ãŒã«ãã£ãŠçæãããäŸããå®éã®äŸãçæ³çã«åé¢ããåŒå¥åšãåãã ãã§ååã§ãã ãµãã»ããã§ã®ã¿å®ç§ ããããçŸåšã®ãžã§ãã¬ãŒã¿ãŒã«ãã£ãŠãµã³ãã«ãçæãããŸãã ãã®åé¡ã¯ããã®ãããªé¢æ°ã®æ€çŽ¢ãšããŠåå®åŒåã§ããŸã ãäŸãå®ç©ãŸãã¯çæç©ãšããŠæ£ããåé¡ããå¯èœæ§ãæ倧åããŸãã ããã¯ããã€ããªåé¡åé¡ãšåŒã°ãããã®å Žåãç¡éã®ãã¬ãŒãã³ã°ã»ããããããŸãïŒæéæ°ã®å®äŸãšæœåšçã«ç¡éæ°ã®çæãããäŸã§ãã åäŸã«ã¯ã©ãã«ããããŸãããããæ¬ç©ãçæç©ãã§ãã æåã®èšäºã§ã¯ãæå°€æ³ã䜿çšããåé¡åé¡ã®è§£æ±ºçã«ã€ããŠèª¬æããŸããã ç§ãã¡ã®ã±ãŒã¹ã®ããã«æžããŸãããã
ãµã³ãã« ã ååžå¯åºŠã決å®ããŸã ãããã å·®å¥è ã®åå®åŒåã§ã ã¯ã©ã¹ç¢ºç ïŒå®éã®äŸïŒã¯ã©ã¹ã®ååžãšã㊠ã ä»¥æ¥ ããã®å®çŸ©ã¯æ£ãã確çå¯åºŠãèšå®ããŸãã 次ã«ãæé©ãªèå¥åšã¯æ¬¡ã®ããã«èŠã€ããããšãã§ããŸãã
èŠå ãã°ã«ãŒãåãã ãã㊠ïŒ
ãããŠããµã³ãã«ãµã€ãºãç¡é倧ã«ãªããšã次ã®ããã«ãªããŸãã
åèšã§ã次ã®å埩ããã»ã¹ãåŸãããŸãã
- ä»»æã®ã€ãã·ã£ã«ãèšå® ã
- å§ãŸã çªç®ã®å埩 ã
- çŸåšã®çºé»æ©ã«æé©ãªåŒå¥åšãæ¢ããŠããŸãã
ã - æé©ãªèå¥åšã䜿çšããŠãžã§ãã¬ãŒã¿ãŒãæ¹åããŸãã
ã é»æµçºçåšã®è¿ãã«ããããšãéèŠã§ãã çŸåšã®ãžã§ãã¬ãŒã¿ãŒããé¢ãããšãåŒå¥åšã¯æé©ã§ãªããªããã¢ã«ãŽãªãºã ã¯çã§ãªããªããŸãã - ãžã§ãã¬ãŒã¿ãŒããã¬ãŒãã³ã°ããã¿ã¹ã¯ã¯ã次ã®å Žåã«è§£æ±ºããããšèŠãªãããŸãã ã®ããã« ã ããã»ã¹ãåæããªãå Žåã¯ã段èœïŒ2ïŒã®æ¬¡ã®å埩ã«é²ã¿ãŸãã
å ã®èšäºã§ã¯ããã®ã¢ã«ãŽãªãºã ã¯ãããæå³ãåŒå¥åšãšçºçåšã®éã®ããããã¯ã¹ã²ãŒã ãå®çŸ©ãã1ã€ã®åŒã«ãŸãšããããŠããŸãã
äž¡æ¹ã®æ©èœ ãã¥ãŒã©ã«ãããã¯ãŒã¯ãšããŠè¡šãããšãã§ããŸãã ããã®åŸãæé©ãªé¢æ°ãæ€çŽ¢ããã¿ã¹ã¯ã¯ããã©ã¡ãŒã¿ãŒã«ããæé©åã®åé¡ã«éå ãããåŸæ¥ã®æ¹æ³ã䜿çšããŠè§£æ±ºã§ããŸãïŒããã¯ãããã²ãŒã·ã§ã³ãšSGDã ããã«ããã¥ãŒã©ã«ãããã¯ãŒã¯ã¯æ©èœã®æ®éçãªè¿äŒŒã§ããããã ä»»æã®ç¢ºçååžãè¿äŒŒããããšãã§ããååžã®éžæã®åé¡ãåãé€ããŸã ã äœããã®åççãªãã¬ãŒã ã¯ãŒã¯å ã§ç¶ç¶çã«é åžã§ããŸãã äŸãã° ãŸã㯠ã ãã®ã¢ã«ãŽãªãºã ãšåæã®æ£ç¢ºã ã« ããªãäžè¬çãªä»®å®ã®äžã§ãå ã®èšäºã§èšŒæãããŠããŸãã
æ£èŠååžãã©ã¡ãŒã¿ãŒãèŠã€ãã
æ°åŠãããã£ãã®ã§ãä»åºŠã¯ãã®ä»çµã¿ãèŠãŠã¿ãŸãããã èšããŸããã ãã€ãŸã äžæ¬¡å ã®åé¡ã解決ããŸãã ã ç·åœ¢ãžã§ãã¬ãŒã¿ãŒã䜿çšããŸããã ã©ã㧠ã èå¥åšã¯ãæåŸã«ãã€ããªåé¡åšãåããå®å šã«æ¥ç¶ããã3å±€ãã¥ãŒã©ã«ãããã¯ãŒã¯ã«ãªããŸãã ãã®åé¡ã®è§£æ±ºç㯠ã€ãŸãã ã Tensorflowã䜿çšããŠããã®åé¡ã®æ°å€è§£ãããã°ã©ã ããŠã¿ãŸãããã å®å šãªã³ãŒãã¯ããã«ãããŸãããéèŠãªãã€ã³ãã®ã¿ããã®èšäºã§èª¬æãããŠããŸãã
æåã«èšå®ããã®ã¯å ¥åãµã³ãã«ã§ãã ã ãã¬ãŒãã³ã°ã¯ãããããã§è¡ããããããäžåºŠã«æ°å€ã®ãã¯ãã«ãçæããŸãã ããã«ããµã³ãã«ã¯å¹³åãšæšæºåå·®ã«ãã£ãŠãã©ã¡ãŒã¿ãŒåãããŸãã
def data_batch(hparams): """ Input data are just samples from N(mean, stddev). """ return tf.random_normal( [hparams.batch_size, 1], hparams.input_mean, hparams.input_stddev)
ãžã§ãã¬ãŒã¿ãŒã®ã©ã³ãã å ¥åãèšå®ããŸããã ïŒ
def generator_input(hparams): """ Generator input data are just samples from N(0, 1). """ return tf.random_normal([hparams.batch_size, 1], 0., 1.)
ãžã§ãã¬ãŒã¿ãŒãå®çŸ©ããŸãã 2çªç®ã®ãã©ã¡ãŒã¿ãŒã®çµ¶å¯Ÿå€ãååŸããŠãæšæºåå·®ã®æå³ãæå®ããŸãã
def generator(input, hparams): mean = tf.Variable(tf.constant(0.)) stddev = tf.sqrt(tf.Variable(tf.constant(1.)) ** 2) return input * stddev + mean
å®éã®äŸã®ãã¯ãã«ãäœæããŸãããïŒ
generator_input = generator_input(hparams) generated = generator(generator_input)
ãããŠçæãããäŸã®ãã¯ãã«ïŒ
generator_input = generator_input(hparams) generated = generator(generator_input)
次ã«ããã¹ãŠã®äŸãèå¥åšãéããŠå®è¡ããŠã¿ãŸãããã Tensorflowã¯äž¡æ¹ã®å ¥åã«åããã©ã¡ãŒã¿ãŒã䜿çšããããã«èŠæ±ãããå¿ èŠãããããã2ã€ã®ç°ãªãåŒå¥åã§ã¯ãªã1ã€ãå¿ èŠã§ããããšãèŠããŠããããšãéèŠã§ãã
with tf.variable_scope("discriminator"): real_ratings = discriminator(real_input, hparams) with tf.variable_scope("discriminator", reuse=True): generated_ratings = discriminator(generated, hparams)
å®éã®äŸã®æ倱é¢æ°ã¯ããŠãããïŒå®éã®äŸã®èå¥åšã®äºæ³ãããå¿çïŒãšèå¥åšã®æšå®å€ã®éã®ã¯ãã¹ãšã³ããããŒã§ãã
loss_real = tf.reduce_mean( tf.nn.sigmoid_cross_entropy_with_logits( labels=tf.ones_like(real_ratings), logits=real_ratings))
åœã®äŸã§ã®æ倱é¢æ°ã¯ããŒãïŒåœã®äŸã§äºæ³ãããå€å¥åã®å¿çïŒãšå€å¥åã®æšå®å€ã®éã®ã¯ãã¹ãšã³ããããŒã§ãã
loss_generated = tf.reduce_mean( tf.nn.sigmoid_cross_entropy_with_logits( labels=tf.zeros_like(generated_ratings), logits=generated_ratings))
å€å¥æ倱é¢æ°ã¯ãå®éã®äŸãšåœã®äŸã®æ倱ã®åèšã§ãã
discriminator_loss = loss_generated + loss_real
ãžã§ãã¬ãŒã¿ãŒæ倱é¢æ°ã¯ããŠãããïŒåœã®äŸã§ã®æãŸããèå¥åšã®ãšã©ãŒå¿çïŒãšåŒå¥åšã«ãããããã®åœã®äŸã®æšå®å€ã®éã®ã¯ãã¹ãšã³ããããŒã§ãã
generator_loss = tf.reduce_mean( tf.nn.sigmoid_cross_entropy_with_logits( labels=tf.ones_like(generated_ratings), logits=generated_ratings))
ãªãã·ã§ã³ã®L2æ£ååãåŒå¥åæ倱é¢æ°ã«è¿œå ãããŸãã
ã¢ãã«ãã¬ãŒãã³ã°ã¯ãåæãŸã§ã®ãµã€ã¯ã«ã§ã®åŒå¥åšãšçæåšã®é 次ãã¬ãŒãã³ã°ã«çž®å°ãããŸãã
for step in range(args.max_steps): session.run(model.discriminator_train) session.run(model.generator_train)
以äžã¯ã4ã€ã®ãã£ã¹ã¯ãªãããŒã¿ãŒã¢ãã«ã®ã°ã©ãã§ãã
- 3å±€ãã¥ãŒã©ã«ãããã¯ãŒã¯ã
- L2æ£èŠåã«ãã3å±€ãã¥ãŒã©ã«ãããã¯ãŒã¯..
- ããããã¢ãŠãæ£ååãåãã3å±€ãã¥ãŒã©ã«ãããã¯ãŒã¯ã
- L2ããã³ããããã¢ãŠãæ£ååãåãã3å±€ãã¥ãŒã©ã«ãããã¯ãŒã¯ã
å³ 1.èå¥åšãå®äŸãå®ãšããŠåé¡ãã確çã
å³ 2.çæãããäŸã®èå¥åšã«ããå®æ°ãšããŠã®åé¡ã®ç¢ºçã
4ã€ã®ã¢ãã«ã¯ãã¹ãŠãåŒå¥åšãçæãããã®ã«ãã°ããåæããŸã ãã¹ãŠã®å ¥ãå£ã§ã ãžã§ãã¬ãŒã¿ãŒã解決ããåé¡ã¯åçŽã§ãããããã¢ãã«éã«ã»ãšãã©éãã¯ãããŸããã ã°ã©ãã¯ãå¹³åãšæšæºåå·®ãããŒã¿ååžã®å€ã«ãã°ããåæããããšã瀺ããŠããŸãã
å³ 3.çæãããååžã®å¹³åã
å³ 4.çæãããååžã®æšæºåå·®ã
以äžã¯ãåŠç¿ããã»ã¹ã«ãããå®éã®äŸãšçæãããäŸã®ååžã§ãã ãã¬ãŒãã³ã°ã®çµãããŸã§ã«çæãããäŸã¯ãå®éã®äŸãšã¯å®éäžåºå¥ã§ããŸããïŒTensorboardãç°ãªãã¹ã±ãŒã«ãéžæãããããã°ã©ãäžã§åºå¥ãããŸãããå€ãèŠããšåãã§ãïŒã
å³ 5.å®ããŒã¿ã®é åžã æéãšãšãã«å€åããŸããã ãã¬ãŒãã³ã°ã¹ãããã¯åçŽè»žã§é ããŸãã
å³ 6.å®ããŒã¿ã®é åžã æéãšãšãã«å€åããŸããã ãã¬ãŒãã³ã°ã¹ãããã¯åçŽè»žã§é ããŸãã
ã¢ãã«ã®ãã¬ãŒãã³ã°ããã»ã¹ãèŠãŠã¿ãŸãããã
å³ 7.ã¢ãã«ã®åŠç¿ããã»ã¹ã®èŠèŠåã åºå®ã¬ãŠã¹-å®ããŒã¿ã®ååžå¯åºŠã移åã¬ãŠã¹-çæãããäŸã®ååžå¯åºŠãéãæ²ç·ã¯åŒå¥åšã®çµæãã€ãŸã å®äŸã®å¯èœæ§ã
ãã¬ãŒãã³ã°ã®éå§æã®åŒå¥åšã¯ããŒã¿ãéåžžã«ããåé¢ããŠããããšãããããŸãããçæãããäŸã®ååžã¯å®éã®äŸã®ååžã«æåéããã¯ãªãŒããããŸãã æåŸã«ããžã§ãã¬ãŒã¿ã¯ããŒã¿ãè¿äŒŒããåŒå¥åšãå®æ°ã«ãªãããã«ããŸã ã¿ã¹ã¯ãåæããŸãã
æ£èŠååžã®æ··åã®è¿äŒŒI
亀æããŠã¿ãŸããã ã« ããã«ããããœãŒã¹ããŒã¿ã®ãã«ãã¢ãŒãã«ååžãã·ãã¥ã¬ãŒãããŸãã ãã®ã¢ãã«ã§ã¯ãå®éã®äŸãçæããããã®ã³ãŒãã®ã¿ãå€æŽããå¿ èŠããããŸãã æ£èŠååžããã©ã³ãã å€æ°ãè¿ã代ããã«ãããã€ãã®æ··åç©ãè¿ããŸãã
def data_batch(hparams): count = len(hparams.input_mean) componens = [] for i in range(count): componens.append( tf.contrib.distributions.Normal( loc=hparams.input_mean[i], scale=hparams.input_stddev[i])) return tf.contrib.distributions.Mixture( cat=tf.contrib.distributions.Categorical( probs=[1./count] * count), components=componens) .sample(sample_shape=[hparams.batch_size, 1])
以äžã¯ãåã®å®éšãšåãã¢ãã«ã®ã°ã©ãã§ããã2ã€ã®ã¢ãŒãã®ããŒã¿ã®ã°ã©ãã§ãã
å³ 8.èå¥åšãå®äŸãå®ãšããŠåé¡ãã確çã
å³ 9.çæãããäŸã®èå¥åšã«ããå®æ°ãšããŠã®åé¡ã®ç¢ºçã
æ£èŠåãããã¢ãã«ã¯ãäžèŠååãããã¢ãã«ãããã¯ããã«åªããŠããããšãããããŸãã ãã ããã¢ãã«ã«é¢ä¿ãªãããžã§ãã¬ãŒã¿ãŒãåŒå¥åšãããã»ã©ããŸã欺ããªãããšã¯æããã§ãã ããããªãèµ·ãã£ãã®ããç解ããŸãããã
å³ 10.çæãããååžã®å¹³åã
å³ 11.çæãããååžã®æšæºåå·®ã
æåã®å®éšã®ããã«ããžã§ãã¬ãŒã¿ãŒã¯ããŒã¿ãæ£èŠååžã§è¿äŒŒããŸãã å質ãäœäžããçç±ã¯ãããŒã¿ã2ã€ã®æ£èŠååžã®æ··åç©ãããµã³ããªã³ã°ããããããããŒã¿ãæ£èŠååžã§æ£ç¢ºã«è¿äŒŒã§ããªãããã§ãã æ··åç©ã®ã¢ãŒãã¯ãŒãã«é¢ããŠå¯Ÿç§°ã§ããã4ã€ã®ã¢ãã«ãã¹ãŠãããŒãã«è¿ãäžå¿ãšååã«å€§ããªåæ£ãæã€æ£èŠååžã«ãã£ãŠããŒã¿ãè¿äŒŒããŠããããšãããããŸãã å®éã®äŸãšåœã®äŸã®ååžãèŠãŠãäœãèµ·ããããç解ããŸãããã
å³12.å®éã®ããŒã¿ã®ååžã æéãšãšãã«å€åããŸããã ãã¬ãŒãã³ã°ã¹ãããã¯åçŽè»žã§é ããŸãã
å³13. 4ã€ã®ã¢ãã«ããçæãããããŒã¿ã®ååžã ãã¬ãŒãã³ã°ã¹ãããã¯åçŽè»žã§é ããŸãã
ãããã¢ãã«åŠç¿ããã»ã¹ã®æµãã§ãïŒ
å³ 14.ã¢ãã«ã®åŠç¿ããã»ã¹ã®èŠèŠåã åºå®ã¬ãŠã¹æ··åã¯å®ããŒã¿ã®ååžå¯åºŠã移åã¬ãŠã¹ã¯çæãããäŸã®ååžå¯åºŠãéãæ²ç·ã¯èå¥åšã®çµæãã€ãŸã å®äŸã®å¯èœæ§ã
ãã®ã¢ãã¡ãŒã·ã§ã³ã¯ãäžèšã§æ€èšããäºäŸã詳现ã«ç€ºããŠããŸãã ãžã§ãã¬ãŒã¿ãŒã¯ãååãªè¡šçŸåãæãããã¬ãŠã¹ååžã®ã¿ã§ããŒã¿ãè¿äŒŒããæ©èœãåããŠãããããäž¡æ¹ã®ããŒã¿ååžã¢ãŒããã«ããŒããããšããŠãåºãã¬ãŠã¹ååžã«åºãããŸãã ãã®çµæããžã§ãã¬ãŒã¿ãŒã¯ããžã§ãã¬ãŒã¿ãŒã«ãŒããšãœãŒã¹ããŒã¿ã®äžã®é åãè¿ãå Žæãã€ãŸããããã®ã«ãŒãã®äº€ç¹ã§ã®ã¿ã確å®ã«åŒå¥åšã欺ããŸãã
ãã ãããããå¯äžã®å¯èœãªã±ãŒã¹ã§ã¯ãããŸããã ãžã§ãã¬ãŒã¿ã®åæè¿äŒŒããã£ããã£ããªãããã«ãå³ã¢ãŒããå°ãå³ã«ç§»åããŸãããã
å³ 15.ã¢ãã«ã®åŠç¿ããã»ã¹ã®èŠèŠåã åºå®ã¬ãŠã¹æ··åã¯å®ããŒã¿ã®ååžå¯åºŠã移åã¬ãŠã¹ã¯çæãããäŸã®ååžå¯åºŠãéãæ²ç·ã¯èå¥åšã®çµæãã€ãŸã å®äŸã®å¯èœæ§ã
ãã®å Žåãçºé»æ©ãå·Šã®åé ã¢ãŒããè¿äŒŒããããšããããšãæãæçã§ããããšãããããŸãã ãããçºçãããšããžã§ãã¬ãŒã¿ãŒã¯å·Šã¢ãŒãããã£ããã£ããããšããŸãã ã¢ãã¡ãŒã·ã§ã³ã®åŸåã§ã¯ããžã§ãã¬ãŒã¿ãŒã®æšæºåå·®ã®æ¯åã®ããã«èŠããŸãã ããããåŒå¥åšã¯ãžã§ãã¬ãŒã¿ããããã¯ãããå·Šã¢ãŒãããã£ããã£ããããã«ãåŠç¿é床ãäžååã§ããããã«ã§ããªãé«æ倱æ©èœã®éå£ãå æããå¿ èŠãããããããããã®è©Šã¿ã¯ãã¹ãŠå€±æããŸãã ãã®å¹æã¯ãã¢ãŒã厩å£ãšåŒã°ããŸãã
äžèšã®2ã€ã®äŸã§ã¯ãããŒã¿ã®åæååžãè¡šçŸããã®ã«ãžã§ãã¬ãŒã¿ãŒãååã«åŒ·åã§ãªãå Žåã«çºçãã2ã€ã®ã¿ã€ãã®åé¡ãèŠãŸãããã¢ãŒãå¹³ååããžã§ãã¬ãŒã¿ãŒãååžå šäœãè¿äŒŒããããã©ãã§ãååã«æªãå Žåã ãžã§ãã¬ãŒã¿ãã¢ãŒãã®ãµãã»ãããåŠç¿ããåŠç¿ããŠããªãã¢ãŒããã¢ãŒãã«åœ±é¿ãäžããªãå Žåãã¢ãŒãã®åŽ©å£ã
ãããã®åé¡ã®äž¡æ¹ãå·®å¥ã«ã€ãªãããšããäºå®ã«å ã㊠ããããã¯ãŸããçæã¢ãã«ã®å質ã®äœäžã«ã€ãªãããŸãã æåã®åé¡ã¯ããžã§ãã¬ãŒã¿ãŒããã¹ãã§ã¯ãªããéãã¢ãŒãã®äŸãæäŸãããšããäºå®ã«ã€ãªããã2çªç®ã®åé¡ã¯ããžã§ãã¬ãŒã¿ãŒãäžéšã®ã¢ãŒãã®ã¿ããäŸãæäŸãããšããäºå®ã«ã€ãªãããããã«ãã£ãŠåæããŒã¿ååžã®è±å¯ããæžãããŸãã
æ£èŠååžã®æ··åã®è¿äŒŒII
åã®ã»ã¯ã·ã§ã³ã§åŒå¥åšãå®å šã«æ¬ºãããšãã§ããªãã£ãçç±ã¯ããžã§ãã¬ãŒã¿ãŒã®èªææ§ã§ãããåçŽã«ç·åœ¢å€æãè¡ããŸããã 次ã«ãå®å šã«æ¥ç¶ããã3å±€ãã¥ãŒã©ã«ãããã¯ãŒã¯ããžã§ãã¬ãŒã¿ãŒãšããŠäœ¿çšããŠã¿ãŸãããã
def generator(self, input, hparams): # 256 . input_size = 1 features = 256 weights = tf.get_variable( "weights_1", initializer=tf.truncated_normal( [input_size, features], stddev=0.1)) biases = tf.get_variable( "biases_1", initializer=tf.constant(0.1, shape=[features])) hidden_layer = tf.nn.relu(tf.matmul(input, weights) + biases) # 256 . features = 256 weights = tf.get_variable( "weights_2", initializer=tf.truncated_normal( [input_size, features], stddev=0.1)) biases = tf.get_variable( "biases_2", initializer=tf.constant(0.1, shape=[features])) hidden_layer = tf.nn.relu(tf.matmul(input, weights) + biases) # , . output_size = 1 weights = tf.get_variable( "weights_out", initializer=tf.truncated_normal( [features, output_size], stddev=0.1)) biases = tf.get_variable( "biases_out", initializer=tf.constant(0.1, shape=[output_size])) return tf.matmul(hidden_layer, weights) + biases
ãã¬ãŒãã³ã°ã¹ã±ãžã¥ãŒã«ãèŠãŠã¿ãŸãããã
å³ 16.å®äŸã®å®äŸãšããŠã®èå¥åšã«ããåé¡ã®ç¢ºçã
å³ 17.çæããããµã³ãã«ã®èå¥åšã«ããå®æ°ãšããŠã®åé¡ã®ç¢ºçã
å€æ°ã®ãã©ã¡ãŒã¿ãŒãåå ã§ããã¬ãŒãã³ã°ã®ãã€ãºã倧ãããªã£ãŠããããšãããããŸãã ãã¹ãŠã®ã¢ãã«ã®åŒå¥åšã¯ãçŽã®çµæã«åæããŸã ãããããã®æç¹ã§äžå®å®ã«ãªããŸãã ãžã§ãã¬ãŒã¿ãŒã®åœ¢ç¶ãèŠãŠã¿ãŸãããã
å³18.å®éã®ããŒã¿ã®ååžã æéãšãšãã«å€åããŸããã ãã¬ãŒãã³ã°ã¹ãããã¯åçŽè»žã§é ããŸãã
å³19. 4ã€ã®ã¢ãã«ããçæãããããŒã¿ã®ååžã ãã¬ãŒãã³ã°ã¹ãããã¯åçŽè»žã§é ããŸãã
ãžã§ãã¬ãŒã¿ãŒã®ååžã¯ãããŒã¿ã®ååžãšã¯äžèŽããŸããããéåžžã«äŒŒãŠããããšãããããŸãã æãæ£èŠåãããã¢ãã«ãåã³æé©ã§ããããšã蚌æãããŸããã 圌女ã¯ããŒã¿é åžã¢ãŒããšã»ãŒäžèŽãã2ã€ã®ã¢ãŒããåŠç¿ããããšãããããŸãã ããŒã¯ãµã€ãºãããŸãæ£ç¢ºã§ã¯ãããŸããããããŒã¿ã®ååžã«è¿äŒŒããŠããŸãã ãããã£ãŠããã¥ãŒã©ã«ãããã¯ãŒã¯ãžã§ãã¬ãŒã¿ãŒã¯ããã«ãã¢ãŒãã«ããŒã¿ååžãåŠç¿ã§ããŸãã
ãããã¢ãã«åŠç¿ããã»ã¹ã®æµãã§ãïŒ
å³ 20.è¿æ¥ã¢ãŒãã䜿çšããã¢ãã«ã®åŠç¿ããã»ã¹ã®èŠèŠåã åºå®ã¬ãŠã¹æ··åã¯å®ããŒã¿ã®ååžå¯åºŠã移åã¬ãŠã¹ã¯çæãããäŸã®ååžå¯åºŠãéãæ²ç·ã¯èå¥åšã®çµæãã€ãŸã å®äŸã®å¯èœæ§ã
å³ 21.é éã¢ãŒãã䜿çšããã¢ãã«ã®åŠç¿ããã»ã¹ã®èŠèŠåã åºå®ã¬ãŠã¹æ··åã¯å®ããŒã¿ã®ååžå¯åºŠã移åã¬ãŠã¹ã¯çæãããäŸã®ååžå¯åºŠãéãæ²ç·ã¯èå¥åšã®çµæãã€ãŸã å®äŸã®å¯èœæ§ã
ããã2ã€ã®ã¢ãã¡ãŒã·ã§ã³ã¯ãåã®ã»ã¯ã·ã§ã³ã®ããŒã¿ååžã«é¢ãããã¬ãŒãã³ã°ã瀺ããŠããŸãã ãããã®ã¢ãã¡ãŒã·ã§ã³ãããå€ãã®ãã©ã¡ãŒã¿ãŒãåããååã«å€§ããªãžã§ãã¬ãŒã¿ãŒã䜿çšãããšã倧ãŸãã«ã§ããã«ãã¢ãŒãã«ååžãè¿äŒŒã§ãããããåã®ã»ã¯ã·ã§ã³ã®åé¡ãäžååã«è€éãªãžã§ãã¬ãŒã¿ãŒã«èµ·å ããããšãéæ¥çã«ç¢ºèªã§ããããšãããããŸãã ãããã®ã¢ãã¡ãŒã·ã§ã³ã®èå¥åšã¯ãæ£èŠååžã®ãã©ã¡ãŒã¿ãŒãèŠã€ããã»ã¯ã·ã§ã³ãããã¯ããã«ãã€ãºãå€ãã§ãããããã«ããããããããã¬ãŒãã³ã°ã®çµãããŸã§ã«ããã€ãºã®å€ãæ°Žå¹³ç·ã«äŒŒå§ããŸã ã
ãŸãšã
GANã¯ããã®ååžãããµã³ããªã³ã°ããããšã«ãã£ãŠã®ã¿ãä»»æã®ååžãè¿äŒŒããããã®ã¢ãã«ã§ãã ãã®èšäºã§ã¯ãæ£èŠååžã®ãã©ã¡ãŒã¿ãŒãæ€çŽ¢ããç°¡åãªäŸãšããã¥ãŒã©ã«ãããã¯ãŒã¯ã«ããåå³°ååžãè¿äŒŒããããè€éãªäŸã§ãã¢ãã«ãã©ã®ããã«æ©èœãããã詳ãã調ã¹ãŸããã äž¡æ¹ã®åé¡ã¯é«ã粟床ã§è§£æ±ºãããããããžã§ãã¬ãŒã¿ãŒã®ããªãè€éãªã¢ãã«ã䜿çšããå¿ èŠããããŸããã 次ã®èšäºã§ã¯ããããã®ã¢ãã«äŸãããç»åååžã®äŸã䜿çšããŠè€éãªååžãããµã³ãã«ãçæããå®éã®äŸã«ç§»ããŸãã
è¬èŸ
ããã¹ããã¬ãã¥ãŒããŠãããOlga TalanovaãšRuslan Loginã«æè¬ããŸãã ç»åãšã¢ãã¡ãŒã·ã§ã³ã®æºåã«ååããŠãããRuslan Loginã«æè¬ããŸãã ãã®èšäºã®ã¬ã€ã¢ãŠããæäŒã£ãŠãããAndrei Tarashkevichã«æè¬ããŸãã