# 給教授看的理論 ## 隱藏層神經元 ### 圖示 <svg width="689" height="203" viewBox="0 0 689 203" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M90.0607 102.061C90.6464 101.475 90.6464 100.525 90.0607 99.9393L80.5147 90.3934C79.9289 89.8076 78.9792 89.8076 78.3934 90.3934C77.8076 90.9792 77.8076 91.9289 78.3934 92.5147L86.8787 101L78.3934 109.485C77.8076 110.071 77.8076 111.021 78.3934 111.607C78.9792 112.192 79.9289 112.192 80.5147 111.607L90.0607 102.061ZM0 102.5H89V99.5H0V102.5Z" fill="black"/><circle cx="197.5" cy="101.5" r="100.5" stroke="black" stroke-width="2"/><path d="M688.061 102.061C688.646 101.475 688.646 100.525 688.061 99.9393L678.515 90.3934C677.929 89.8076 676.979 89.8076 676.393 90.3934C675.808 90.9792 675.808 91.9289 676.393 92.5147L684.879 101L676.393 109.485C675.808 110.071 675.808 111.021 676.393 111.607C676.979 112.192 677.929 112.192 678.515 111.607L688.061 102.061ZM598 102.5H687V99.5H598V102.5Z" fill="black"/><path d="M389.061 102.061C389.646 101.475 389.646 100.525 389.061 99.9393L379.515 90.3934C378.929 89.8076 377.979 89.8076 377.393 90.3934C376.808 90.9792 376.808 91.9289 377.393 92.5147L385.879 101L377.393 109.485C376.808 110.071 376.808 111.021 377.393 111.607C377.979 112.192 378.929 112.192 379.515 111.607L389.061 102.061ZM299 102.5H388V99.5H299V102.5Z" fill="black"/><circle cx="496.5" cy="101.5" r="100.5" stroke="black" stroke-width="2"/><path d="M177.773 101.302H162.856V117H158.169V81.4531H180.19V85.3105H162.856V97.4688H177.773V101.302ZM184.927 102.571C184.927 98.8929 185.415 95.361 186.392 91.9756C187.384 88.5902 188.857 85.514 190.811 82.7471C192.764 79.9801 194.79 78.027 196.89 76.8877L197.817 79.8662C195.441 81.6891 193.488 84.4723 191.958 88.2158C190.444 91.9593 189.614 96.1504 189.468 100.789L189.443 102.864C189.443 109.147 190.591 114.599 192.886 119.222C194.269 121.989 195.913 124.153 197.817 125.716L196.89 128.475C194.725 127.27 192.658 125.252 190.688 122.42C186.847 116.886 184.927 110.27 184.927 102.571ZM211.05 100.228L216.909 90.584H222.183L213.54 103.646L222.451 117H217.227L211.123 107.112L205.02 117H199.771L208.682 103.646L200.039 90.584H205.264L211.05 100.228ZM237.417 102.815C237.417 106.445 236.937 109.928 235.977 113.265C235.033 116.585 233.576 119.653 231.606 122.469C229.653 125.285 227.603 127.286 225.454 128.475L224.502 125.716C227.008 123.795 229.019 120.817 230.532 116.78C232.062 112.728 232.843 108.235 232.876 103.304V102.522C232.876 99.1045 232.518 95.9307 231.802 93.001C231.086 90.055 230.085 87.4183 228.799 85.0908C227.529 82.7633 226.097 80.9486 224.502 79.6465L225.454 76.8877C227.603 78.0758 229.645 80.0615 231.582 82.8447C233.535 85.6279 234.992 88.696 235.952 92.0488C236.929 95.4017 237.417 98.9906 237.417 102.815Z" fill="black"/> <path d="M433.342 104.32H422.619L420.211 111H416.73L426.504 85.4062H429.457L439.248 111H435.785L433.342 104.32ZM423.639 101.543H432.34L427.98 89.5723L423.639 101.543ZM449.812 108.697C450.973 108.697 451.986 108.346 452.854 107.643C453.721 106.939 454.201 106.061 454.295 105.006H457.371C457.312 106.096 456.938 107.133 456.246 108.117C455.555 109.102 454.629 109.887 453.469 110.473C452.32 111.059 451.102 111.352 449.812 111.352C447.223 111.352 445.16 110.49 443.625 108.768C442.102 107.033 441.34 104.666 441.34 101.666V101.121C441.34 99.2695 441.68 97.623 442.359 96.1816C443.039 94.7402 444.012 93.6211 445.277 92.8242C446.555 92.0273 448.061 91.6289 449.795 91.6289C451.928 91.6289 453.697 92.2676 455.104 93.5449C456.521 94.8223 457.277 96.4805 457.371 98.5195H454.295C454.201 97.2891 453.732 96.2812 452.889 95.4961C452.057 94.6992 451.025 94.3008 449.795 94.3008C448.143 94.3008 446.859 94.8984 445.945 96.0938C445.043 97.2773 444.592 98.9941 444.592 101.244V101.859C444.592 104.051 445.043 105.738 445.945 106.922C446.848 108.105 448.137 108.697 449.812 108.697ZM465.439 87.375V91.9805H468.99V94.4941H465.439V106.289C465.439 107.051 465.598 107.625 465.914 108.012C466.23 108.387 466.77 108.574 467.531 108.574C467.906 108.574 468.422 108.504 469.078 108.363V111C468.223 111.234 467.391 111.352 466.582 111.352C465.129 111.352 464.033 110.912 463.295 110.033C462.557 109.154 462.188 107.906 462.188 106.289V94.4941H458.725V91.9805H462.188V87.375H465.439ZM476.338 111H473.086V91.9805H476.338V111ZM472.822 86.9355C472.822 86.4082 472.98 85.9629 473.297 85.5996C473.625 85.2363 474.105 85.0547 474.738 85.0547C475.371 85.0547 475.852 85.2363 476.18 85.5996C476.508 85.9629 476.672 86.4082 476.672 86.9355C476.672 87.4629 476.508 87.9023 476.18 88.2539C475.852 88.6055 475.371 88.7812 474.738 88.7812C474.105 88.7812 473.625 88.6055 473.297 88.2539C472.98 87.9023 472.822 87.4629 472.822 86.9355ZM487.834 106.588L492.545 91.9805H495.867L489.047 111H486.568L479.678 91.9805H483L487.834 106.588ZM510.457 111C510.27 110.625 510.117 109.957 510 108.996C508.488 110.566 506.684 111.352 504.586 111.352C502.711 111.352 501.17 110.824 499.963 109.77C498.768 108.703 498.17 107.355 498.17 105.727C498.17 103.746 498.92 102.211 500.42 101.121C501.932 100.02 504.053 99.4688 506.783 99.4688H509.947V97.9746C509.947 96.8379 509.607 95.9355 508.928 95.2676C508.248 94.5879 507.246 94.248 505.922 94.248C504.762 94.248 503.789 94.541 503.004 95.127C502.219 95.7129 501.826 96.4219 501.826 97.2539H498.557C498.557 96.3047 498.891 95.3906 499.559 94.5117C500.238 93.6211 501.152 92.918 502.301 92.4023C503.461 91.8867 504.732 91.6289 506.115 91.6289C508.307 91.6289 510.023 92.1797 511.266 93.2812C512.508 94.3711 513.152 95.877 513.199 97.7988V106.553C513.199 108.299 513.422 109.688 513.867 110.719V111H510.457ZM505.061 108.521C506.08 108.521 507.047 108.258 507.961 107.73C508.875 107.203 509.537 106.518 509.947 105.674V101.771H507.398C503.414 101.771 501.422 102.938 501.422 105.27C501.422 106.289 501.762 107.086 502.441 107.66C503.121 108.234 503.994 108.521 505.061 108.521ZM522.709 87.375V91.9805H526.26V94.4941H522.709V106.289C522.709 107.051 522.867 107.625 523.184 108.012C523.5 108.387 524.039 108.574 524.801 108.574C525.176 108.574 525.691 108.504 526.348 108.363V111C525.492 111.234 524.66 111.352 523.852 111.352C522.398 111.352 521.303 110.912 520.564 110.033C519.826 109.154 519.457 107.906 519.457 106.289V94.4941H515.994V91.9805H519.457V87.375H522.709ZM533.607 111H530.355V91.9805H533.607V111ZM530.092 86.9355C530.092 86.4082 530.25 85.9629 530.566 85.5996C530.895 85.2363 531.375 85.0547 532.008 85.0547C532.641 85.0547 533.121 85.2363 533.449 85.5996C533.777 85.9629 533.941 86.4082 533.941 86.9355C533.941 87.4629 533.777 87.9023 533.449 88.2539C533.121 88.6055 532.641 88.7812 532.008 88.7812C531.375 88.7812 530.895 88.6055 530.566 88.2539C530.25 87.9023 530.092 87.4629 530.092 86.9355ZM537.967 101.314C537.967 99.4512 538.33 97.7754 539.057 96.2871C539.795 94.7988 540.814 93.6504 542.115 92.8418C543.428 92.0332 544.922 91.6289 546.598 91.6289C549.188 91.6289 551.279 92.5254 552.873 94.3184C554.479 96.1113 555.281 98.4961 555.281 101.473V101.701C555.281 103.553 554.924 105.217 554.209 106.693C553.506 108.158 552.492 109.301 551.168 110.121C549.855 110.941 548.344 111.352 546.633 111.352C544.055 111.352 541.963 110.455 540.357 108.662C538.764 106.869 537.967 104.496 537.967 101.543V101.314ZM541.236 101.701C541.236 103.811 541.723 105.504 542.695 106.781C543.68 108.059 544.992 108.697 546.633 108.697C548.285 108.697 549.598 108.053 550.57 106.764C551.543 105.463 552.029 103.646 552.029 101.314C552.029 99.2285 551.531 97.541 550.535 96.252C549.551 94.9512 548.238 94.3008 546.598 94.3008C544.992 94.3008 543.697 94.9395 542.713 96.2168C541.729 97.4941 541.236 99.3223 541.236 101.701ZM562.436 91.9805L562.541 94.3711C563.994 92.543 565.893 91.6289 568.236 91.6289C572.256 91.6289 574.283 93.8965 574.318 98.4316V111H571.066V98.4141C571.055 97.043 570.738 96.0293 570.117 95.373C569.508 94.7168 568.553 94.3887 567.252 94.3887C566.197 94.3887 565.271 94.6699 564.475 95.2324C563.678 95.7949 563.057 96.5332 562.611 97.4473V111H559.359V91.9805H562.436Z" fill="black"/> </svg> $F(x)=weight*x$ ### Activation Function (激勵函數) - 讓資料可以被微分 - 表示狀態(激活和不激活) #### Relu <svg width="247" height="246" viewBox="0 0 247 246" fill="none" xmlns="http://www.w3.org/2000/svg"> <g filter="url(#filter0_d)"> <line x1="4" y1="118.5" x2="242" y2="118.5" stroke="black" stroke-dasharray="4 4"/> </g> <g filter="url(#filter1_d)"> <line x1="123.5" x2="123.5" y2="238" stroke="black" stroke-dasharray="4 4"/> </g> <line x1="4" y1="118" x2="123" y2="118" stroke="black" stroke-width="2"/> <line x1="242.707" y1="0.707107" x2="123.707" y2="119.707" stroke="black" stroke-width="2"/> <path d="M114.628 14H113.266V4.96924L110.534 5.97266V4.74219L114.416 3.28467H114.628V14Z" fill="black"/> <path d="M243.628 138H242.266V128.969L239.534 129.973V128.742L243.416 127.285H243.628V138Z" fill="black"/> <defs> <filter id="filter0_d" x="0" y="118" width="246" height="9" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feOffset dy="4"/> <feGaussianBlur stdDeviation="2"/> <feComposite in2="hardAlpha" operator="out"/> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/> <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/> <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/> </filter> <filter id="filter1_d" x="119" y="0" width="9" height="246" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feOffset dy="4"/> <feGaussianBlur stdDeviation="2"/> <feComposite in2="hardAlpha" operator="out"/> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/> <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/> <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/> </filter> </defs> </svg> ### Cost Function (成本函數) 其實就是**均方誤差**,又稱Error函數 ### Backpropagation (反向傳播) 利用更新**權重**來影響 ANN 的結果,本次專題藉由**隨機梯度下降**反向傳播 ### Stochastic Gradient Descent 隨機梯度下降法 #### $/frac{dError}{dWeight_i}$ <svg width="495" height="293" viewBox="0 0 495 293" fill="none" xmlns="http://www.w3.org/2000/svg"> <g filter="url(#filter0_i)"> <line x1="4" y1="284" x2="495" y2="284" stroke="black" stroke-width="2" stroke-dasharray="3 3"/> </g> <g filter="url(#filter1_d)"> <line x1="249" y1="285" x2="249" y2="4.37114e-08" stroke="black" stroke-width="2" stroke-dasharray="2 2"/> </g> <path d="M1 10C1 10 43 118 71 135C99 152 98 135 135 135C172 135 179 256 209 265C239 274 269 284 292 265C315 246 301 135 333 135C365 135 383 104 383 104L423 10" stroke="black"/> <path d="M29.5518 157H28.1968V145.75H29.5518V157ZM31.3682 152.964C31.3682 152.188 31.5195 151.49 31.8223 150.87C32.1299 150.25 32.5547 149.771 33.0967 149.434C33.6436 149.097 34.2661 148.929 34.9644 148.929C36.0435 148.929 36.915 149.302 37.5791 150.049C38.248 150.796 38.5825 151.79 38.5825 153.03V153.125C38.5825 153.897 38.4336 154.59 38.1357 155.206C37.8428 155.816 37.4204 156.292 36.8687 156.634C36.3218 156.976 35.6919 157.146 34.979 157.146C33.9048 157.146 33.0332 156.773 32.3643 156.026C31.7002 155.279 31.3682 154.29 31.3682 153.06V152.964ZM32.7305 153.125C32.7305 154.004 32.9331 154.71 33.3384 155.242C33.7485 155.774 34.2954 156.041 34.979 156.041C35.6675 156.041 36.2144 155.772 36.6196 155.235C37.0249 154.693 37.2275 153.936 37.2275 152.964C37.2275 152.095 37.02 151.392 36.605 150.855C36.1948 150.313 35.6479 150.042 34.9644 150.042C34.2954 150.042 33.7559 150.308 33.3457 150.84C32.9355 151.373 32.7305 152.134 32.7305 153.125ZM43.4604 156.041C43.9438 156.041 44.3662 155.894 44.7275 155.601C45.0889 155.308 45.2891 154.942 45.3281 154.502H46.6099C46.5854 154.957 46.4292 155.389 46.1411 155.799C45.853 156.209 45.4673 156.536 44.9839 156.78C44.5054 157.024 43.9976 157.146 43.4604 157.146C42.3813 157.146 41.522 156.788 40.8823 156.07C40.2476 155.347 39.9302 154.361 39.9302 153.111V152.884C39.9302 152.112 40.0718 151.426 40.355 150.826C40.6382 150.225 41.0435 149.759 41.5708 149.427C42.103 149.095 42.7305 148.929 43.4531 148.929C44.3418 148.929 45.0791 149.195 45.665 149.727C46.2559 150.259 46.5708 150.95 46.6099 151.8H45.3281C45.2891 151.287 45.0938 150.867 44.7422 150.54C44.3955 150.208 43.9658 150.042 43.4531 150.042C42.7646 150.042 42.23 150.291 41.8491 150.789C41.4731 151.282 41.2852 151.998 41.2852 152.935V153.191C41.2852 154.104 41.4731 154.808 41.8491 155.301C42.2251 155.794 42.7622 156.041 43.4604 156.041ZM53.0259 157C52.9478 156.844 52.8843 156.565 52.8354 156.165C52.2056 156.819 51.4536 157.146 50.5796 157.146C49.7983 157.146 49.1562 156.927 48.6533 156.487C48.1553 156.043 47.9062 155.481 47.9062 154.803C47.9062 153.978 48.2188 153.338 48.8438 152.884C49.4736 152.425 50.3574 152.195 51.4951 152.195H52.8135V151.573C52.8135 151.099 52.6719 150.723 52.3887 150.445C52.1055 150.162 51.688 150.02 51.1362 150.02C50.6528 150.02 50.2476 150.142 49.9204 150.386C49.5933 150.63 49.4297 150.926 49.4297 151.272H48.0674C48.0674 150.877 48.2065 150.496 48.4849 150.13C48.7681 149.759 49.1489 149.466 49.6274 149.251C50.1108 149.036 50.6406 148.929 51.2168 148.929C52.1299 148.929 52.8452 149.158 53.3628 149.617C53.8804 150.071 54.1489 150.699 54.1685 151.5V155.147C54.1685 155.875 54.2612 156.453 54.4468 156.883V157H53.0259ZM50.7773 155.967C51.2021 155.967 51.605 155.857 51.9858 155.638C52.3667 155.418 52.6426 155.132 52.8135 154.781V153.155H51.7515C50.0913 153.155 49.2612 153.641 49.2612 154.612C49.2612 155.037 49.4028 155.369 49.686 155.608C49.9692 155.848 50.333 155.967 50.7773 155.967ZM57.7646 157H56.4097V145.75H57.7646V157ZM64.9351 149.075L64.9717 149.954C65.5527 149.271 66.3364 148.929 67.3228 148.929C68.4312 148.929 69.1855 149.354 69.5859 150.203C69.8496 149.822 70.1914 149.515 70.6113 149.28C71.0361 149.046 71.5366 148.929 72.1128 148.929C73.8511 148.929 74.7349 149.849 74.7642 151.69V157H73.4092V151.771C73.4092 151.204 73.2798 150.782 73.021 150.503C72.7622 150.22 72.3276 150.079 71.7173 150.079C71.2144 150.079 70.7969 150.23 70.4648 150.533C70.1328 150.831 69.9399 151.233 69.8862 151.741V157H68.5239V151.807C68.5239 150.655 67.96 150.079 66.832 150.079C65.9434 150.079 65.3354 150.457 65.0083 151.214V157H63.6533V149.075H64.9351ZM78.2871 157H76.9321V149.075H78.2871V157ZM76.8223 146.973C76.8223 146.753 76.8882 146.568 77.02 146.417C77.1567 146.265 77.3569 146.189 77.6206 146.189C77.8843 146.189 78.0845 146.265 78.2212 146.417C78.3579 146.568 78.4263 146.753 78.4263 146.973C78.4263 147.193 78.3579 147.376 78.2212 147.522C78.0845 147.669 77.8843 147.742 77.6206 147.742C77.3569 147.742 77.1567 147.669 77.02 147.522C76.8882 147.376 76.8223 147.193 76.8223 146.973ZM81.7441 149.075L81.7881 150.071C82.3936 149.31 83.1846 148.929 84.1611 148.929C85.8359 148.929 86.6807 149.874 86.6953 151.763V157H85.3403V151.756C85.3354 151.185 85.2036 150.762 84.9448 150.489C84.6909 150.215 84.293 150.079 83.751 150.079C83.3115 150.079 82.9258 150.196 82.5938 150.43C82.2617 150.665 82.0029 150.972 81.8174 151.353V157H80.4624V149.075H81.7441ZM90.2109 157H88.856V149.075H90.2109V157ZM88.7461 146.973C88.7461 146.753 88.812 146.568 88.9438 146.417C89.0806 146.265 89.2808 146.189 89.5444 146.189C89.8081 146.189 90.0083 146.265 90.145 146.417C90.2817 146.568 90.3501 146.753 90.3501 146.973C90.3501 147.193 90.2817 147.376 90.145 147.522C90.0083 147.669 89.8081 147.742 89.5444 147.742C89.2808 147.742 89.0806 147.669 88.9438 147.522C88.812 147.376 88.7461 147.193 88.7461 146.973ZM93.6606 149.075L93.6973 149.954C94.2783 149.271 95.062 148.929 96.0483 148.929C97.1567 148.929 97.9111 149.354 98.3115 150.203C98.5752 149.822 98.917 149.515 99.3369 149.28C99.7617 149.046 100.262 148.929 100.838 148.929C102.577 148.929 103.46 149.849 103.49 151.69V157H102.135V151.771C102.135 151.204 102.005 150.782 101.747 150.503C101.488 150.22 101.053 150.079 100.443 150.079C99.9399 150.079 99.5225 150.23 99.1904 150.533C98.8584 150.831 98.6655 151.233 98.6118 151.741V157H97.2495V151.807C97.2495 150.655 96.6855 150.079 95.5576 150.079C94.6689 150.079 94.061 150.457 93.7339 151.214V157H92.3789V149.075H93.6606ZM110.433 156.216C109.906 156.836 109.132 157.146 108.111 157.146C107.267 157.146 106.622 156.902 106.178 156.414C105.738 155.921 105.516 155.193 105.511 154.231V149.075H106.866V154.195C106.866 155.396 107.354 155.997 108.331 155.997C109.366 155.997 110.055 155.611 110.396 154.839V149.075H111.751V157H110.462L110.433 156.216ZM115.091 149.075L115.128 149.954C115.709 149.271 116.493 148.929 117.479 148.929C118.587 148.929 119.342 149.354 119.742 150.203C120.006 149.822 120.348 149.515 120.768 149.28C121.192 149.046 121.693 148.929 122.269 148.929C124.007 148.929 124.891 149.849 124.92 151.69V157H123.565V151.771C123.565 151.204 123.436 150.782 123.177 150.503C122.918 150.22 122.484 150.079 121.874 150.079C121.371 150.079 120.953 150.23 120.621 150.533C120.289 150.831 120.096 151.233 120.042 151.741V157H118.68V151.807C118.68 150.655 118.116 150.079 116.988 150.079C116.1 150.079 115.492 150.457 115.165 151.214V157H113.81V149.075H115.091Z" fill="black"/> <path d="M194.26 242.972C194.26 241.736 194.546 240.755 195.117 240.027C195.688 239.295 196.445 238.929 197.388 238.929C198.354 238.929 199.109 239.271 199.651 239.954L199.717 239.075H200.955V246.81C200.955 247.835 200.649 248.643 200.039 249.234C199.434 249.825 198.618 250.12 197.593 250.12C197.021 250.12 196.462 249.998 195.916 249.754C195.369 249.51 194.951 249.175 194.663 248.75L195.366 247.938C195.947 248.655 196.658 249.014 197.498 249.014C198.157 249.014 198.669 248.829 199.036 248.458C199.407 248.086 199.592 247.564 199.592 246.89V246.209C199.05 246.834 198.311 247.146 197.373 247.146C196.445 247.146 195.693 246.773 195.117 246.026C194.546 245.279 194.26 244.261 194.26 242.972ZM195.623 243.125C195.623 244.019 195.806 244.722 196.172 245.235C196.538 245.743 197.051 245.997 197.71 245.997C198.564 245.997 199.192 245.608 199.592 244.832V241.214C199.177 240.457 198.555 240.079 197.725 240.079C197.065 240.079 196.55 240.335 196.179 240.848C195.808 241.36 195.623 242.12 195.623 243.125ZM204.478 247H203.123V235.75H204.478V247ZM206.294 242.964C206.294 242.188 206.445 241.49 206.748 240.87C207.056 240.25 207.48 239.771 208.022 239.434C208.569 239.097 209.192 238.929 209.89 238.929C210.969 238.929 211.841 239.302 212.505 240.049C213.174 240.796 213.508 241.79 213.508 243.03V243.125C213.508 243.897 213.359 244.59 213.062 245.206C212.769 245.816 212.346 246.292 211.794 246.634C211.248 246.976 210.618 247.146 209.905 247.146C208.831 247.146 207.959 246.773 207.29 246.026C206.626 245.279 206.294 244.29 206.294 243.06V242.964ZM207.656 243.125C207.656 244.004 207.859 244.71 208.264 245.242C208.674 245.774 209.221 246.041 209.905 246.041C210.593 246.041 211.14 245.772 211.545 245.235C211.951 244.693 212.153 243.936 212.153 242.964C212.153 242.095 211.946 241.392 211.531 240.855C211.121 240.313 210.574 240.042 209.89 240.042C209.221 240.042 208.682 240.308 208.271 240.84C207.861 241.373 207.656 242.134 207.656 243.125ZM221.917 243.125C221.917 244.336 221.638 245.311 221.082 246.048C220.525 246.78 219.778 247.146 218.84 247.146C217.839 247.146 217.065 246.792 216.519 246.084L216.453 247H215.208V235.75H216.562V239.947C217.109 239.268 217.864 238.929 218.826 238.929C219.788 238.929 220.542 239.292 221.089 240.02C221.641 240.748 221.917 241.744 221.917 243.008V243.125ZM220.562 242.972C220.562 242.049 220.383 241.336 220.027 240.833C219.67 240.33 219.158 240.079 218.489 240.079C217.595 240.079 216.953 240.494 216.562 241.324V244.751C216.978 245.582 217.625 245.997 218.503 245.997C219.153 245.997 219.658 245.745 220.02 245.242C220.381 244.739 220.562 243.982 220.562 242.972ZM228.523 247C228.445 246.844 228.381 246.565 228.333 246.165C227.703 246.819 226.951 247.146 226.077 247.146C225.295 247.146 224.653 246.927 224.15 246.487C223.652 246.043 223.403 245.481 223.403 244.803C223.403 243.978 223.716 243.338 224.341 242.884C224.971 242.425 225.854 242.195 226.992 242.195H228.311V241.573C228.311 241.099 228.169 240.723 227.886 240.445C227.603 240.162 227.185 240.02 226.633 240.02C226.15 240.02 225.745 240.142 225.417 240.386C225.09 240.63 224.927 240.926 224.927 241.272H223.564C223.564 240.877 223.704 240.496 223.982 240.13C224.265 239.759 224.646 239.466 225.125 239.251C225.608 239.036 226.138 238.929 226.714 238.929C227.627 238.929 228.342 239.158 228.86 239.617C229.377 240.071 229.646 240.699 229.666 241.5V245.147C229.666 245.875 229.758 246.453 229.944 246.883V247H228.523ZM226.274 245.967C226.699 245.967 227.102 245.857 227.483 245.638C227.864 245.418 228.14 245.132 228.311 244.781V243.155H227.249C225.588 243.155 224.758 243.641 224.758 244.612C224.758 245.037 224.9 245.369 225.183 245.608C225.466 245.848 225.83 245.967 226.274 245.967ZM233.262 247H231.907V235.75H233.262V247ZM240.432 239.075L240.469 239.954C241.05 239.271 241.833 238.929 242.82 238.929C243.928 238.929 244.683 239.354 245.083 240.203C245.347 239.822 245.688 239.515 246.108 239.28C246.533 239.046 247.034 238.929 247.61 238.929C249.348 238.929 250.232 239.849 250.261 241.69V247H248.906V241.771C248.906 241.204 248.777 240.782 248.518 240.503C248.259 240.22 247.825 240.079 247.214 240.079C246.711 240.079 246.294 240.23 245.962 240.533C245.63 240.831 245.437 241.233 245.383 241.741V247H244.021V241.807C244.021 240.655 243.457 240.079 242.329 240.079C241.44 240.079 240.833 240.457 240.505 241.214V247H239.15V239.075H240.432ZM253.784 247H252.429V239.075H253.784V247ZM252.319 236.973C252.319 236.753 252.385 236.568 252.517 236.417C252.654 236.265 252.854 236.189 253.118 236.189C253.381 236.189 253.582 236.265 253.718 236.417C253.855 236.568 253.923 236.753 253.923 236.973C253.923 237.193 253.855 237.376 253.718 237.522C253.582 237.669 253.381 237.742 253.118 237.742C252.854 237.742 252.654 237.669 252.517 237.522C252.385 237.376 252.319 237.193 252.319 236.973ZM257.241 239.075L257.285 240.071C257.891 239.31 258.682 238.929 259.658 238.929C261.333 238.929 262.178 239.874 262.192 241.763V247H260.837V241.756C260.833 241.185 260.701 240.762 260.442 240.489C260.188 240.215 259.79 240.079 259.248 240.079C258.809 240.079 258.423 240.196 258.091 240.43C257.759 240.665 257.5 240.972 257.314 241.353V247H255.959V239.075H257.241ZM265.708 247H264.353V239.075H265.708V247ZM264.243 236.973C264.243 236.753 264.309 236.568 264.441 236.417C264.578 236.265 264.778 236.189 265.042 236.189C265.305 236.189 265.505 236.265 265.642 236.417C265.779 236.568 265.847 236.753 265.847 236.973C265.847 237.193 265.779 237.376 265.642 237.522C265.505 237.669 265.305 237.742 265.042 237.742C264.778 237.742 264.578 237.669 264.441 237.522C264.309 237.376 264.243 237.193 264.243 236.973ZM269.158 239.075L269.194 239.954C269.775 239.271 270.559 238.929 271.545 238.929C272.654 238.929 273.408 239.354 273.809 240.203C274.072 239.822 274.414 239.515 274.834 239.28C275.259 239.046 275.759 238.929 276.335 238.929C278.074 238.929 278.958 239.849 278.987 241.69V247H277.632V241.771C277.632 241.204 277.502 240.782 277.244 240.503C276.985 240.22 276.55 240.079 275.94 240.079C275.437 240.079 275.02 240.23 274.688 240.533C274.355 240.831 274.163 241.233 274.109 241.741V247H272.747V241.807C272.747 240.655 272.183 240.079 271.055 240.079C270.166 240.079 269.558 240.457 269.231 241.214V247H267.876V239.075H269.158ZM285.93 246.216C285.403 246.836 284.629 247.146 283.608 247.146C282.764 247.146 282.119 246.902 281.675 246.414C281.235 245.921 281.013 245.193 281.008 244.231V239.075H282.363V244.195C282.363 245.396 282.852 245.997 283.828 245.997C284.863 245.997 285.552 245.611 285.894 244.839V239.075H287.249V247H285.959L285.93 246.216ZM290.588 239.075L290.625 239.954C291.206 239.271 291.99 238.929 292.976 238.929C294.084 238.929 294.839 239.354 295.239 240.203C295.503 239.822 295.845 239.515 296.265 239.28C296.689 239.046 297.19 238.929 297.766 238.929C299.504 238.929 300.388 239.849 300.417 241.69V247H299.062V241.771C299.062 241.204 298.933 240.782 298.674 240.503C298.416 240.22 297.981 240.079 297.371 240.079C296.868 240.079 296.45 240.23 296.118 240.533C295.786 240.831 295.593 241.233 295.54 241.741V247H294.177V241.807C294.177 240.655 293.613 240.079 292.485 240.079C291.597 240.079 290.989 240.457 290.662 241.214V247H289.307V239.075H290.588Z" fill="black"/> <defs> <filter id="filter0_i" x="4" y="283" width="491" height="6" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feBlend mode="normal" in="SourceGraphic" in2="BackgroundImageFix" result="shape"/> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feOffset dy="4"/> <feGaussianBlur stdDeviation="2"/> <feComposite in2="hardAlpha" operator="arithmetic" k2="-1" k3="1"/> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/> <feBlend mode="normal" in2="shape" result="effect1_innerShadow"/> </filter> <filter id="filter1_d" x="244" y="0" width="10" height="293" filterUnits="userSpaceOnUse" color-interpolation-filters="sRGB"> <feFlood flood-opacity="0" result="BackgroundImageFix"/> <feColorMatrix in="SourceAlpha" type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0" result="hardAlpha"/> <feOffset dy="4"/> <feGaussianBlur stdDeviation="2"/> <feComposite in2="hardAlpha" operator="out"/> <feColorMatrix type="matrix" values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.25 0"/> <feBlend mode="normal" in2="BackgroundImageFix" result="effect1_dropShadow"/> <feBlend mode="normal" in="SourceGraphic" in2="effect1_dropShadow" result="shape"/> </filter> </defs> </svg> w是權重,$\eta$是學習率 將$Error$對$Weight_{i}$微分,求出梯度g 將$Error$對$Weight_{i}$微分: $\frac{dError}{dWeight_{i}}=\frac{\sum (x_i-f(x_i))^2}{dWeight_{i}}=\frac{\sum x_i^2+f(x_i)^2-2x_if(x_i)}{dWeight_{i}}$ $=(\sum\frac{x_i^2+f(x_i)^2-2x_if(x_i)}{df(x_i)})*\frac{df(x_i)}{dWeight_{i}}=\sum(2f(x_i)-2)*\frac{df(x_i)}{dWeight_{i}}$ 其中對每一次的batch而言,$(\sum2f(x_i)-2)$是常數。 $\frac{df(x_i)}{dWeight_{i}}$可以透過自動微分快速取得。 $Weight_i=Weight_i+g*\eta;$ #### 多項輸入值 ~~照做~~ #### 自動微分 自動微分大量使用鏈鎖法則和$\frac{d(a+b+c)}{de}=\frac{da+db+dc}{de}$ 下面展示Error Singal的概念和為何和微分結果一樣:
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up