ä½ã®è©±ãã¨ããã¨
ä¸è¨ã®è¨äºã§ã¯ãé ãUnitãï¼åã¨ãããä¸çã§æãã·ã³ãã«ãªãã¥ã¼ã©ã«ãããã¯ã¼ã¯ãæ§æãã¾ããã
ãããã¡ããã£ã¨ã ããæ¡å¼µãã¦éãã§ã¿ã¾ãã
é ãUnitãå¢ãã
ããããã®é ãUnitã¯å¹³é¢ãç´ç·ã§åå²ããããã§ãã®ã§ãé ãUnitãå¢ããã°åå²ç·ãã©ãã©ãå¢ããã¾ãã
ååã®ã³ã¼ãã§ã¯ãä¸è¨ã®é¨åã§é ãUnitã®åæ°ãæå®ãã¦ããã®ã§ããããå¤ãã¦ãããã¦ã¿ã¾ããããã§ã¯ã4åã«ãã¦ã¿ã¾ãã
hidden1_units = 4
ã¯ããäºæ³éããå¢çç·ãããè¤éã«ãªãã¾ãããé ãUnitã®æ°ãã©ãã©ãå¢ãããã¨ã§ãã©ãã»ã©è¤éãªé¢æ°ã§ã表ç¾ã§ãã¦ãã¾ãã¾ãã
ã¡ãªã¿ã«ãä¸å³ã®å·¦å´ã§ã¯ã確ç0.5ãå¢çã«ãã¦âã¨âã®é åãåç´ã«åå²ãã¦ãã¾ãããå³å´ãè¦ãã¨ãâã¨âãæ··å¨ããé åã§ã¯ããã¡ãã¨ä¸éçãªç¢ºçã«ãªã£ã¦ãããã¨ãåããã¾ãã
Activationãå¤ãã¦ã¿ã
ååã®ã³ã¼ãã§ã¯ãé ãUnitã次ã®ããã«å®ç¾©ãã¾ããã
ã
ã
ã¯ãä¸å³ã®ããã«ãåç¹ä»è¿ã§-1ãã1ã«ã²ããã£ã¨å¤ãç«ã¡ä¸ããé¢æ°ã§ãããããActivationã§ãã
ä¸æ¹ãActivationã«ä½¿ç¨ããé¢æ°ãåãæ¿ãããã¨ã§ããã¥ã¼ã©ã«ãããã¯ã¼ã¯ã®æ§è½ãå¤åãããã¨ãç¥ããã¦ãã¾ãããã£ã¼ãã©ã¼ãã³ã°ã§ãã使ãããã®ãã次ã®ReLUï¼ã©ã³ãé¢æ°ï¼ã§ãã
ã³ã¼ãã®ä¸è¨ã®é¨åãä¿®æ£ãã¦ãReLUãActivationã«ä½¿ã£ã¦ã¿ã¾ãã
hidden1 = tf.nn.relu(tf.matmul(x, w0) + b0*mult)
# hidden1 = tf.nn.tanh(tf.matmul(x, w0) + b0*mult)
çµæã¯ã次ã®ã¨ããã§ãã
ãã®ä¾ã§ã¯ãå³ä¸ã®é åãã«ãªã£ã¦ãããããããâ¯ã®ç¢ºçãé«ãé åãã¨å¤å®ããã¦ãã¾ããããããå¢çç·ããããã¨ããã«ã®å¤ã大ãããªãããã§ã¯ãªãã®ã§ãå¢çç·ãã¯ã¿ã ãã¦ç¢ºçãå¤åãã¦ãã¾ããçµæã¨ãã¦ãåç´ãª4åå²ãããããè¤éãªå¢çç·ãæããã¨ã«æåãã¦ãã¾ãã
次åäºå
ä»åã¯ãï¼æ®µã®é ã層ã«å«ã¾ããUnitã®æ°ãå¢ããã¦ãåå²ç·ãè¤éã«ãã¦ããã¾ãããããããªãããçµå±ã¯ãç´ç·ã®çµã¿åããã§åå²ãããã¨ããã§ããªãã¨ããéçãããã¾ãã次ã®ã¹ãããã¯ãé ã層ã®å¾ãã«ãããã«é ã層ã追å ãã¦ãé ã層ãï¼æ®µã«ããæ¡å¼µã«ãªãã¾ããããã¯ãï¼æ®µç®ã®å±¤ã§ãç¹å¾´éï¼ç¹å¾´å¤æ°ï¼ããæ½åºãã¦ããããå ã«ãã¦ï¼æ®µç®ã®å±¤ã§åé¡ãè¡ãã¨ããå¦çã«ãªãã¾ãããã£ããã©ããããã¨ãªãã§ããããã»ã»ã»ã»ï¼
次åã®è¨äºã¯ãã¡ãã§ãã