{"id":697,"date":"2014-01-24T15:45:22","date_gmt":"2014-01-24T14:45:22","guid":{"rendered":"http:\/\/darksun190.cn\/?p=697"},"modified":"2022-12-17T16:02:10","modified_gmt":"2022-12-17T08:02:10","slug":"697","status":"publish","type":"post","link":"http:\/\/darksun190.cn\/blog\/?p=697","title":{"rendered":"\u6700\u5c0f\u4e8c\u4e58\u6cd5\u62df\u5408\u4e00\u4e9b\u57fa\u672c\u7a7a\u95f4\u5143\u7d20\u7684C#\u5b9e\u73b0 \u2014\u2014 \uff08\u4e00\uff09\u672f\u8bed\u3001\u57fa\u672c\u7b97\u6cd5\u4e0e\u601d\u8def"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">\u672c\u7cfb\u5217\u7684\u4e3b\u8981\u76ee\u7684\u662f\u5c06\u62df\u5408\u7b97\u6cd5\u7528C#\u5b9e\u73b0\uff0c\u76f8\u5173\u7684\u64cd\u4f5c\u7528\u5230\u4e86<a href=\"http:\/\/www.mathdotnet.com\/\">Math.NET<\/a>\u6570\u503c\u8fd0\u7b97\u5e93\uff0c\u6240\u4ee5\u5c06\u4e00\u4e9b\u57fa\u672c\u6982\u5ff5\uff0c\u7b97\u6cd5\u548c\u5bf9\u5e94\u7684C#\u4ee3\u7801\u653e\u5230\u524d\u9762\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u7ebf\u6027\u6a21\u578b\uff0c\u4f8b\u5982\u76f4\u7ebf\u548c\u5e73\u9762\uff0c\u7b97\u6cd5\u5927\u7ea6\u5206\u4e09\u6b65\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u53c2\u6570\u5316\uff1a\u5c06\u6a21\u578b\u7528\u53c2\u6570\u5316\u65b9\u5f0f\u8868\u8fbe\u51fa\u6765\u3002<\/li>\n\n\n\n<li>\u6784\u9020Design\uff08\u975e\u7ebf\u6027\u4e2d\u7684Jacobian\uff09\u77e9\u9635\uff1a\u6839\u636e\u53c2\u6570\u516c\u5f0f\u6c42\u6240\u6709\u53c2\u6570\u7684\u504f\u5bfc\u6570\u4f5c\u4e3a\u5217(Column)\uff0c\u5c06\u5b9e\u6d4b\u503c\u4f5c\u4e3a\u884c(Row)\u3002\u5c06\u504f\u5dee\u503c\u4f5c\u4e3a\u7b49\u5f0f\u53f3\u503c\u3002<\/li>\n\n\n\n<li>\u6c42\u89e3\u3002<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u975e\u7ebf\u6027\u6a21\u578b\uff0c\u4f8b\u5982\u5706\u67f1\uff0cGauss-Newton\u7b97\u6cd5\u7c7b\u4f3c\uff1a<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u53c2\u6570\u5316\uff1a<\/li>\n\n\n\n<li>\u6c42\uff08\u6216\u731c\uff09\u521d\u59cb\u89e3\u3002<\/li>\n\n\n\n<li>\u627e\u5230Jacobian\u77e9\u9635\u53ca\u53f3\u503c<\/li>\n\n\n\n<li>\u6c42\u89e3<\/li>\n\n\n\n<li>\u901a\u8fc74\u8ba1\u7b97\u903c\u8fd1\u503c\uff0c\u91cd\u590d3\u548c4<\/li>\n\n\n\n<li>\u8fed\u4ee3\u7ed3\u675f<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">\u7ebf\u6027\u6a21\u578b\u7684\u89e3\u6cd5\u662f\u57fa\u7840\uff0c\u8be6\u7ec6\u7684\u5206\u6790\u8bf7\u770b<a href=\"http:\/\/cs2.swfc.edu.cn\/~zyl\/?p=875\">\u8fd9\u7bc7\u6587\u7ae0<\/a>\uff0c\u8fd9\u91cc\u53ea\u89e3\u91ca\u4ee3\u7801\u90e8\u5206\u3002\u5728<span style=\"color: #ff0000;\"><strong>Math.Net<\/strong><\/span>\u4e2d<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u77e9\u9635\\(A=\\begin{bmatrix}A_{11} &amp; A_{12}\\\\A_{21} &amp; A_{22}\\end{bmatrix}\\)<br>A.Transpose() \u4ee3\u8868A\u7684\u8f6c\u7f6e\u77e9\u9635\\(A^T=\\begin{bmatrix}A_{11} &amp; A_{21}\\\\A_{12} &amp; A_{22}\\end{bmatrix}\\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u5728\u5750\u6807\u8fd0\u7b97\u4e2d\u662f\u975e\u5e38\u91cd\u8981\u7684\uff0c\u56e0\u4e3a\u5750\u6807\u8fd0\u7b97\u4e2d\u5750\u6807\u7cfb\u90fd\u8868\u793a\u4e3a\u6b63\u4ea4\u77e9\u9635\uff08\u62b1\u6b49\uff0c\u6ca1\u627e\u5230\u8bc1\u660e\uff09\uff0c\u5f53\u8ba1\u7b97\u4e00\u4e2a\u70b9\uff08\u7528\u4e8c\u7ef4\u4e3e\u4f8b\uff09\\(P=\\left(x,y\\right)\\)\u5728\u65b0\u5750\u6807\u7cfbA\u4e2d\u7684\u5750\u6807\\(P^{&#8216;}=\\left(x^{&#8216;},y^{&#8216;}\\right)\\)\u65f6\u3002\\[P^{&#8216;}=PA\\]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u800c\u5df2\u77e5\u5750\u6807\u7cfbA\u4e2d\u7684\u5750\u6807\u70b9\\(P^{&#8216;}\\)\u6c42\u539f\u5750\u6807\u503c\u53ef\u7528\\[P=P^{&#8216;}A^T\\]<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4e00\u4e9b\u7c7b\u4f3c\u7684\u4ee3\u7801\u4e3a\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A.Inverse()\u4ee3\u8868A\u7684\u9006\u77e9\u9635\\(A^{-1}\\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A.Multiply(B)\u4ee3\u8868\u77e9\u9635\u4e58\u6cd5\\(A*B\\)\u6216\u8005\u77e9\u9635\u4e58\u4ee5\u5411\u91cf\\(A*b\\)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u5bf9\u4e8e\u5e38\u7528\u7684\u7b97\u6cd5\uff1a<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">\u7ebf\u6027\u6a21\u578b<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u5df2\u77e5Jacobian\u77e9\u9635\\(J\\)\u53ca\u7b49\u5f0f\u53f3\u503c\uff08\u504f\u5dee\u503c\u5411\u91cf\uff09\\(y\\)\uff0c\u53e6\\[Ax=y\\]\u6c42\u89e3\u5411\u91cfx<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u6b63\u89c4\u65b9\u7a0b\uff08normal equations\uff09<br>\\[A^TAx=A^Ty\\]<br>\u9006\u77e9\u9635\u89e3\u6cd5<br>\\[x=\\left(A^TA\\right)^{-1}A^Ty\\]<br>\u5b9e\u73b0\u4ee3\u7801\u00a0  <pre class=\"font-size:16 nums:false nums-toggle:false wrap:true wrap-toggle:false lang:default decode:true\">x = A.Transpose().Multiply(A).Inverse().Multiply(A.Transpose().Multiply(y));<\/pre><p>\u66f4\u5feb\u548c\u66f4\u7a33\u5b9a\u7684\u65b9\u6cd5\u5c06\u662f\u5bf9\u5de6\u4fa7\u7684\u77e9\u9635\u8fdb\u884c\u4e54\u59c6\u65af\u57fa\u5206\u89e3\uff08Cholesky decomposition\uff09\uff0c\u5b9e\u73b0\u4ee3\u7801<\/p><pre class=\"lang:default decode:true\">x = A.Transpose().Multiply(A).Cholesky().Solve(A.Transpose().Multiply(y));<\/pre><p>\u8fd9\u4e24\u4e2a\u5728\u4e00\u4e9b\u9650\u5b9a\u6761\u4ef6\u4e0b\u662f\u7b49\u4ef7\u7684\uff0c\u800c\u8fd9\u4e9b\u9650\u5b9a\u6761\u4ef6\u5728\u70b9\u6570\u8fdc\u5927\u4e8e\u53c2\u6570\u7684\u60c5\u51b5\u4e0b\u662f\u6ee1\u8db3\u7684\u3002<\/p> <\/li>\n\n\n\n<li>QR\u5206\u89e3<br>\u63a8\u8bba\u89c1\u539f\u6587\uff0c\u4ee3\u7801\u66f4\u7b80\u5355\uff1a\u00a0 <pre class=\"lang:default decode:true\">x=A.QR().Solve(y);<\/pre><\/li>\n\n\n\n<li>\u5947\u5f02\u503c\u5206\u89e3\uff08Singular Value Decomposition, SVD\uff09<br>A\u662f\u65b9\u9635\u7684\u60c5\u51b5\u4e0b\uff08\u5373\u70b9\u6570\u7b49\u4e8e\u53c2\u6570\uff09\u4ee3\u7801\u4e3a\u00a0 <pre class=\"lang:default decode:true crayon-selected\">x = A.Svd(true).Solve(y);<\/pre><p>A\u4e0d\u662f\u65b9\u9635\u7684\u60c5\u51b5\u4e0b\u4ee3\u7801\u4e3a<\/p><pre class=\"lang:default decode:true\"><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code class=\"\">\/\/ compute the SVD \nSvd svd = A.Svd(true);\n\/\/ get matrix of left singular vectors with first n columns of U \nMatrix U1 = svd.U().SubMatrix(0, m,0, n); \n\/\/ get matrix of singular values \nMatrix S = new DiagonalMatrix(n, n, svd.S().ToArray()); \n\/\/ get matrix of right singular vectors \nMatrix V = svd.VT().Transpose(); \nx = V.Multiply(S.Inverse()).Multiply(U1.Transpose().Multiply(y));<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">\u975e\u7ebf\u6027\u6a21\u578b<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u90e8\u5206\u5bf9\u4e8e\u4ee3\u7801\u5e76\u6ca1\u6709\u4ec0\u4e48\u533a\u522b\uff0c\u53ea\u662f\u9700\u8981\u8fed\u4ee3\uff08\u5faa\u73af\uff09\u53ca\u5224\u65ad\u7ec8\u6b62\u6761\u4ef6\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u672c\u7cfb\u5217\u7684\u4e3b\u8981\u76ee\u7684\u662f\u5c06\u62df\u5408\u7b97\u6cd5\u7528C#\u5b9e\u73b0\uff0c\u76f8\u5173\u7684\u64cd\u4f5c\u7528\u5230\u4e86Math.NET\u6570\u503c\u8fd0\u7b97\u5e93\uff0c\u6240\u4ee5\u5c06\u4e00\u4e9b\u57fa\u672c\u6982\u5ff5\uff0c\u7b97\u6cd5\u548c &hellip; <a href=\"http:\/\/darksun190.cn\/blog\/?p=697\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u201c\u6700\u5c0f\u4e8c\u4e58\u6cd5\u62df\u5408\u4e00\u4e9b\u57fa\u672c\u7a7a\u95f4\u5143\u7d20\u7684C#\u5b9e\u73b0 \u2014\u2014 \uff08\u4e00\uff09\u672f\u8bed\u3001\u57fa\u672c\u7b97\u6cd5\u4e0e\u601d\u8def\u201d<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3,8],"tags":[],"class_list":["post-697","post","type-post","status-publish","format-standard","hentry","category-cs","category-geo"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts\/697","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=697"}],"version-history":[{"count":3,"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts\/697\/revisions"}],"predecessor-version":[{"id":1604,"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=\/wp\/v2\/posts\/697\/revisions\/1604"}],"wp:attachment":[{"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=697"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=697"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/darksun190.cn\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=697"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}