誤差éä¼æ¬æ³ãå®è£ ãã¦MNISTã®å¦ç¿ã¨èªèããã°ã©ã ãCè¨èªã§ãã«ã¹ã¯ã©ããã§ä½ãããã®ç¶ãã
åºå®å°æ°ç¹åã«ã¤ãã¦ã¯ãä»ç¤¾ã®ä½ã£ãã©ã¤ãã©ãªã使ãã»ããè¯ãæ°ããã¦æ¥ãã®ã§ã調æ»ããã¦ããã¨ä»¥ä¸ã®ã©ã¤ãã©ãªãè¦ã¤ãããMITã®ä½ã£ãåºå®å°æ°ç¹ã©ã¤ãã©ãªãããã
æ´æ°é¨16ããããå°æ°é¨16ãããã¨ãªã£ã¦ãããçã¯è¯ããããªã©ã¤ãã©ãªã ã
ãã®ã©ã¤ãã©ãªã®ãããããã¨ããã¯ãä¸è§é¢æ°ãªã©ã®å®è£ ã«å ãã¦ãææ°é¢æ°ã®å®è£ ãããã¦ããã¨ããã ã
ç¹ã«ãã¥ã¼ã©ã«ãããã¯ã¼ã¯ã«ããã¦softmaxé¢æ°ã¯expæ¼ç®ãå¤ç¨ããããã®ãããåºå®å°æ°ç¹æ¼ç®ã©ã¤ãã©ãªã«expãå ¥ã£ã¦ããã®ã¯é常ã«ãããããã®ã ã
libfixmathã使ã£ã¦MNISTããã°ã©ã ãåºå®å°æ°ç¹åãã
å®è£
èªä½ã¯é常ã«ç°¡åã ãã¾ãã¯libfixmathã©ã¤ãã©ãªãcloneãã¦ãã«ããã¦ãããã©ã¤ãã©ãªã¨ãã¦libfixmath.a
ãåºæ¥ãã®ã§ãèªåã®ããã°ã©ã ã®ãªã³ã¯æã«ã³ãã©ãå¼ã³åºãã¦ããã°ããã
æµ®åå°æ°ç¹ããlibfixmathã¸ã®ç½®ãæãã ããã¾ãåºå®å°æ°ç¹ã®åã¨ãã¦fix16_t
ãå®ç¾©ããã¦ããããã¡ããæ´»ç¨ãããã¨ã«ãªãã
- åºå®å¤ã®ä»£å ¥
float a = 1.0; fix16_t b = fix16_from_dbl(1.0); // fix16_from_floatããã
- fix16_tããæµ®åå°æ°ç¹ã¸ã®å¤æ
float f = fix16_to_float (fx16); float d = fix16_to_dbl (fx16);
- æ¼ç®
fix16_t fx16_add = fix16_add (fx16_a, fx16_b); // add = a + b; fix16_t fx16_mul = fix16_mul (fx16_a, fx16_b); // mul = a * b; fix16_t fx16_exp = fix16_exp (fx16_a); // exp = exp (a) madd = fix16_add (madd, fix16_mul (fx16_a, fx16_b)); // madd = madd + (a * b);
ãªã©ã大æµã®æ¼ç®ãå®è¡å¯è½ã ã
ãããç¨ãã¦ãMNISTã®ããã°ã©ã ã®åºå®å°æ°ç¹åãè¡ã£ãã
MNISTã®èªè精度
doubleã§ã®æ¼ç®ãfloatã§ã®æ¼ç®ãfix16_t ã§ã®æ¼ç®ã§ã®MNISTã®èªè精度ã®æ¯è¼ãè¡ã£ãã
- double : 90.53%
- float : 90.25%
- fix16_t : 90.42%
å ¨ãããè²ãªã精度ã ãç¹ã«å®è£ ã®åé¡ã¯ãªãã¨æãããããã ããåé¡ã¯ãã®å®è¡é度ã ãä½æ ãfix16_tã使ãã¨é常ã«é ããªã£ã¦ãã¾ã£ãã
ããã¯ãä»å¾è§£æãè¡ã£ã¦ãããã®ã¨ãããã¨ãããããx86以å¤ã®ãã¤ã³ã³ããã¼ãã«ã移æ¤ãè¡ã£ã¦ãããããªã