{"id":3270,"date":"2019-04-21T12:30:27","date_gmt":"2019-04-21T03:30:27","guid":{"rendered":"https:\/\/na-inet.jp\/weblog2\/?p=3270"},"modified":"2019-04-21T12:41:00","modified_gmt":"2019-04-21T03:41:00","slug":"4-21%e6%97%a5-%e9%a7%bf%e5%ba%9c%e3%83%bb%e6%99%b4%e5%be%8c%e6%9b%87","status":"publish","type":"post","link":"https:\/\/na-inet.jp\/weblog2\/2019\/04\/21\/4-21%e6%97%a5-%e9%a7%bf%e5%ba%9c%e3%83%bb%e6%99%b4%e5%be%8c%e6%9b%87\/","title":{"rendered":"4\/21(\u65e5) \u99ff\u5e9c\u30fb\u6674\u5f8c\u66c7"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u3000\u590f\u3082\u8fd1\u3065\u304f\u516b\u5341\u516b\u591c\u304c\u3059\u3050\u305d\u3053\u306b\u8feb\u3063\u3066\u3044\u308b\u3002\u65e5\u4e2d\u306e\u6c17\u6e29\u306f\uff12\uff10\u5ea6\u3092\u8d85\u3048\u308b\u3053\u3068\u3082\u73cd\u3057\u304f\u306a\u304f\u306a\u308a\uff0c\u671d\u6669\u3082\u30b3\u30fc\u30c8\u304c\u4e0d\u8981\u306b\u306a\u3063\u305f\u3002\u3063\u3066\u3053\u3068\u306f\uff0c\u6226\u5f8c\u65e5\u672c\u521d\u306e\u5341\u9023\u4f11\u3092\u904e\u304e\u305f\u8fba\u308a\u3067\u30b8\u30e1\u30b8\u30e1\u30d9\u30c8\u30d9\u30c8\u306a\u6bce\u65e5\u304c\u3084\u3063\u3066\u304f\u308b\u3053\u3068\u306b\u306a\u308b\u308f\u3051\u3067\uff0c\u305d\u308c\u304c\u7d42\u308f\u308b\u3068\u707c\u71b1\u306e\u65e5\u3005\u304c\u5f85\u3063\u3066\u3044\u308b\u3002\u30cf\u30f3\u30b3\u62bc\u3057\u3092\u3053\u306a\u3057\u3066\u3044\u308b\u3046\u3061\u306b\u590f\u306b\u306a\u308a\u305d\u3046\u306a\u4e88\u611f\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u4eca\u5e74\uff11\u6708\u306b\u983c\u3093\u3060SIAM\u306e\u672c\u304c\uff0c\u30af\u30ec\u30fc\u30e0\u3092\u9001\u3063\u3066\u3088\u3046\u3084\u304f\u5c4a\u3044\u305f\u3002\u306a\u3093\u3068\u306a\u304f\uff0c\u25cb\u25cb\u307e\u3067\u5c4a\u3044\u3066\u6d88\u3048\u3061\u3083\u3063\u305f\u611f\u3058\u304c\u3042\u308b\u3093\u3060\u3051\u3069\uff0c\u771f\u76f8\u306f\u85ea\u306e\u4e2d\u3002\u5c4a\u3044\u3066\u3044\u306a\u3044\u30e2\u30ce\u306f\u5c4a\u3044\u3066\u3044\u306a\u3044\u308f\u3051\u3067\uff0c\u300c\u3068\u3063\u3068\u3068\u5c4a\u3051\u3066\uff0c\u5c4a\u304b\u306a\u3044\u306a\u3089\u8fd4\u91d1\u3057\u3066\u300d\u3068\u50ac\u4fc3\u3057\u305f\u3089\u8fd4\u4e8b\u304c\u3042\u3063\u305f\u5f8c\uff0c\u6700\u901f\u4fbf\u3067\u4e09\u65e5\u3067\u5c4a\u3044\u305f\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/na-inet.jp\/wordpress\/wp-content\/uploads\/2019\/04\/IMG_5137-821x1024.jpg\" alt=\"\" class=\"wp-image-3271\" width=\"374\" height=\"466\" srcset=\"https:\/\/na-inet.jp\/wordpress\/wp-content\/uploads\/2019\/04\/IMG_5137-821x1024.jpg 821w, https:\/\/na-inet.jp\/wordpress\/wp-content\/uploads\/2019\/04\/IMG_5137-120x150.jpg 120w, https:\/\/na-inet.jp\/wordpress\/wp-content\/uploads\/2019\/04\/IMG_5137-240x300.jpg 240w, https:\/\/na-inet.jp\/wordpress\/wp-content\/uploads\/2019\/04\/IMG_5137-768x958.jpg 768w\" sizes=\"auto, (max-width: 374px) 100vw, 374px\" \/><figcaption><a href=\"https:\/\/math.mit.edu\/~gs\/learningfromdata\/\" target=\"_blank\" rel=\"noreferrer noopener\" aria-label=\"G.Strang, &quot;Linear Algebra and Learning from Data&quot;, SIAM (\u65b0\u3057\u3044\u30bf\u30d6\u3067\u958b\u304f)\">G.Strang, &#8220;Linear Algebra and Learning from Data&#8221;, SIAM<\/a><\/figcaption><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000Strang\u306e\u672c\u3063\u3066\uff0c\u7406\u8ad6\u3082\u6982\u8aac\u3082\u30b3\u30f3\u30d1\u30af\u30c8\u306b\u307e\u3068\u307e\u3063\u3066\u3044\u308b\u3093\u3060\u3051\u3069\uff0c\u30ef\u30b7\u307f\u305f\u3044\u306a\u30d0\u30ab\u306b\u306f\u30b9\u30f3\u30ca\u30ea\u67d3\u307f\u3053\u3093\u3067\u3053\u306a\u3044\u3093\u3060\u3088\u306a\u3041\u3002\u6a5f\u68b0\u5b66\u7fd2\u3068Deep Learning\u306e\u89e3\u8aac\u306f\u53c2\u8003\u306b\u3057\u3064\u3064\uff0c\u30ef\u30b7\u306a\u308a\u306e\u30e2\u30ce\u306b\u3057\u3066\u3044\u304b\u306a\u3044\u3068\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u5148\u9031\u306f\u4e88\u5b9a\u901a\u308a\u5b66\u5185\u6559\u80b2\u30d7\u30ed\u30b8\u30a7\u30af\u30c8\u306e\u5831\u544a\u66f8\u304c\u3066\u3089\u306e\u7d00\u8981\u539f\u7a3f\u3092\u4e0a\u3052\uff0c\u660e\u65e5\u306e\u65b0\u5165\u751f\u5411\u3051\u30ac\u30a4\u30c0\u30f3\u30b9\uff08\u4f55\u5ea6\u76ee\u3060\uff09\u3067\u4f7f\u3046\u8cc7\u6599\u3092\uff0c\u524d\u4efb\u8005\u5236\u4f5c\u7269\u306b\u624b\u3092\u52a0\u3048\u3066\u4ed5\u4e0a\u3052\u3066\u5370\u5237\u3057\uff0c6\/9\uff5e11\u306b\u958b\u50ac\u3055\u308c\u308bIEEE\u56fd\u969b\u7814\u7a76\u96c6\u4f1a\u306b\u53c2\u52a0\u7533\u3057\u8fbc\u307f\u3057($480\uff01\u9ad8\u3047)\uff0cPython\u6570\u5024\u8a08\u7b97\u5165\u9580\u8cc7\u6599\u3092\u3061\u3087\u308d\u3063\u3068\u6574\u3048\u305f\u3002\u4e38\u3081\u30e2\u30fc\u30c9\u5909\u66f4\u624b\u7d9a\u304d\u306b\u3064\u3044\u3066\u306f\u30a4\u30ed\u30a4\u30ed\u8abf\u3079\u305f\u7d50\u679c\uff0c\u3053\u3046\u3044\u3046\u98a8\u306b\u3059\u308c\u3070\u3088\u3055\u3052\u306a\u3053\u3068\u304c\u5206\u304b\u3063\u305f\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># \u4e38\u3081\u30e2\u30fc\u30c9\u5909\u66f4\n# [Windows&amp;Linux] https:\/\/rafaelbarreto.wordpress.com\/2009\/03\/30\/controlling-fpu-rounding-modes-with-python\/\n# [macOS] https:\/\/stackoverflow.com\/questions\/16000574\/tie-breaking-of-round-with-numpy\n\n# OS\u7a2e\u5225\n# https:\/\/stackoverflow.com\/questions\/1854\/python-what-os-am-i-running-on\nimport platform\n\n# \u4e38\u3081\u30e2\u30fc\u30c9\u5b9a\u7fa9\nglobal FE_TOZERO, FE_DOWNWARD, FE_UPWARD, FE_TONEAREST\n# set_rmode(\u4e38\u3081\u30e2\u30fc\u30c9), \u4e38\u3081\u30e2\u30fc\u30c9 = get_rmode()\nglobal set_rmode, get_rmode\n\n# DLL\u547c\u3073\u51fa\u3057\n# from ctypes import cdll\nfrom ctypes import *\n\n# OS\u540d\nos_name = platform.system()\n\n# Windows\nif os_name == 'Windows':\n\tmsvcrt = cdll.msvcrt\n\tMW_RC = 0x00000300\n\tset_rmode = lambda mode: msvcrt._controlfp_s(0, mode, MW_RC)\n#\tget_rmode = lambda     : msvcrt._controlfp_s(pointer(current_mode), 0, 0)\n\tFE_TOZERO = 0x00000300\n\tFE_DOWNWARD = 0x00000100\n\tFE_UPWARD = 0x00000200\n\tFE_TONEAREST = 0x00000000\n\tdef get_rmode():\n\t\tcurrent_rmode = c_uint()\n\t\tmsvcrt._controlfp_s(byref(current_rmode), 0, 0)\n\t\t\n\t\treturn current_rmode.value &amp; MW_RC\n# Linux\nelif os_name == 'Linux':\n\tfrom ctypes.util import find_library\n\tlibm = cdll.LoadLibrary(find_library('m'))\n\tset_rmode, get_rmode = libm.fesetround, libm.fegetround\n\t# x86\n\tFE_TOZERO = 0xc00\n\tFE_DOWNWARD = 0x400\n\tFE_UPWARD = 0x800\n\tFE_TONEAREST = 0\n# macOS\nelif os_name == \"Darwin\":\n\tfrom ctypes.util import find_library\n\tlibc = cdll.LoadLibrary(find_library('c'))\n\tset_rmode, get_rmode = libc.fesetround, libc.fegetround\n\t# x86\n\tFE_TOZERO = 0xc00\n\tFE_DOWNWARD = 0x400\n\tFE_UPWARD = 0x800\n\tFE_TONEAREST = 0\n\n# \u4e38\u3081\u30e2\u30fc\u30c9\u78ba\u8a8d\ndef print_rmode():\n\trmode = get_rmode()\n\n\tif rmode == FE_TOZERO: print('\u5207\u308a\u6368\u3066')\n\telif rmode == FE_DOWNWARD: print('-Inf\u3078\u306e\u4e38\u3081')\n\telif rmode == FE_UPWARD: print('+Inf\u3078\u306e\u4e38\u3081')\n\telif rmode == FE_TONEAREST: print('\u6700\u8fd1\u5076\u6570\u5024\u4e38\u3081')\n\telse: print('\u4e0d\u660e ', rmode)\n\n\treturn rmode\n\n# \u30c6\u30b9\u30c8\ndefault_rmode = print_rmode()\n\n# \u5207\u308a\u6368\u3066\nset_rmode(FE_TOZERO)\nprint_rmode()\n\n# \u5143\u306b\u623b\u3059\nset_rmode(default_rmode)\nprint_rmode()<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">\u3000\u3055\u3066\uff0c\u4eca\u9031\u4e2d\u306b\u300cPython\u6570\u5024\u8a08\u7b97\u5165\u9580\uff08\u4eee\uff09\u300d\u7b2c\uff12\u7ae0\u3092\u4e0a\u3052\u306a\u3051\u308c\u3070\u3002\u4e0a\u3052\u3066GW\u306f\u306e\u3093\u3073\u308a\u30c6\u30ad\u30b9\u30c8\u306e\u30cd\u30bf\u3092\u69cb\u7bc9\u3059\u308b\u306e\u3060\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u590f\u3082\u8fd1\u3065\u304f\u516b\u5341\u516b\u591c\u304c\u3059\u3050\u305d\u3053\u306b\u8feb\u3063\u3066\u3044\u308b\u3002\u65e5\u4e2d\u306e\u6c17\u6e29\u306f\uff12\uff10\u5ea6\u3092\u8d85\u3048\u308b\u3053\u3068\u3082\u73cd\u3057\u304f\u306a\u304f\u306a\u308a\uff0c\u671d\u6669\u3082\u30b3\u30fc\u30c8\u304c\u4e0d\u8981\u306b\u306a\u3063\u305f\u3002\u3063\u3066\u3053\u3068\u306f\uff0c\u6226\u5f8c\u65e5\u672c\u521d\u306e\u5341\u9023\u4f11\u3092\u904e\u304e\u305f\u8fba\u308a\u3067\u30b8\u30e1\u30b8\u30e1\u30d9\u30c8\u30d9\u30c8\u306a\u6bce\u65e5\u304c\u3084\u3063\u3066\u304f\u308b\u3053\u3068\u306b\u306a\u308b\u308f\u3051\u3067\uff0c\u305d\u308c &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/na-inet.jp\/weblog2\/2019\/04\/21\/4-21%e6%97%a5-%e9%a7%bf%e5%ba%9c%e3%83%bb%e6%99%b4%e5%be%8c%e6%9b%87\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;4\/21(\u65e5) \u99ff\u5e9c\u30fb\u6674\u5f8c\u66c7&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_hide_featured_image":false,"_jetpack_featured_image_duplicate_dismissed":0,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[14,7,2],"tags":[],"class_list":["post-3270","post","type-post","status-publish","format-standard","hentry","category-python3na","category-7","category-2"],"jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts\/3270","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/comments?post=3270"}],"version-history":[{"count":2,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts\/3270\/revisions"}],"predecessor-version":[{"id":3274,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/posts\/3270\/revisions\/3274"}],"wp:attachment":[{"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/media?parent=3270"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/categories?post=3270"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/na-inet.jp\/weblog2\/wp-json\/wp\/v2\/tags?post=3270"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}