From 756937ff289ae4bed936b7c9769b7b6b8ad31465 Mon Sep 17 00:00:00 2001 From: jujimeizuo Date: Sun, 13 Oct 2024 15:52:03 +0800 Subject: [PATCH] Deployed 835c055 with MkDocs version: 1.5.3 --- 404.html | 20 +- changelog.yml | 4 + changelog/index.html | 22 +- cs/ai/dl/index.html | 9 +- cs/ai/ml/index.html | 9 +- cs/ai/mode-recognition/index.html | 9 +- cs/algorithm/basic-ds/index.html | 9 +- cs/algorithm/design-analysis/index.html | 9 +- cs/db/mysql/index.html | 9 +- cs/db/redis/cjh/index.html | 9 +- cs/db/redis/datatype/index.html | 9 +- cs/db/redis/work/index.html | 9 +- cs/hpc/gpu/index.html | 9 +- cs/hpc/index.html | 9 +- cs/hpc/mpi/index.html | 9 +- cs/hpc/openmp/index.html | 9 +- cs/hpc/outline/index.html | 9 +- cs/hpc/vectorizecompute/index.html | 9 +- cs/index.html | 9 +- cs/others/regex/index.html | 9 +- cs/pl/c_cpp/basic/index.html | 9 +- cs/pl/c_cpp/function/index.html | 9 +- cs/pl/c_cpp/index.html | 9 +- cs/pl/c_cpp/stl/index.html | 9 +- cs/pl/go/basic/index.html | 9 +- cs/pl/go/gin/index.html | 9 +- cs/pl/go/index.html | 9 +- cs/pl/index.html | 9 +- cs/pl/java/basic/index.html | 9 +- cs/pl/java/index.html | 9 +- cs/pl/java/springboot/index.html | 9 +- cs/pl/python/basic/index.html | 9 +- cs/pl/python/index.html | 9 +- cs/pl/python/numpy/index.html | 9 +- cs/pl/python/virtual/index.html | 9 +- cs/software/compa/index.html | 9 +- cs/software/design-pattern/index.html | 9 +- cs/software/index.html | 9 +- cs/software/piaserver/index.html | 9 +- cs/software/sca/index.html | 9 +- cv/3d-visualization/index.html | 9 +- cv/dataset/index.html | 9 +- cv/dataset/kitti/index.html | 9 +- cv/dataset/tum/index.html | 9 +- cv/dataset/waymo/index.html | 9 +- cv/index.html | 13 +- cv/mvg/3dr-camera-structure/index.html | 9 +- cv/mvg/ag-fm/index.html | 9 +- cv/mvg/calc-p/index.html | 9 +- cv/mvg/camera-model/index.html | 9 +- cv/mvg/est2d/index.html | 9 +- cv/mvg/eval/index.html | 9 +- cv/mvg/index.html | 9 +- cv/mvg/one-vg/index.html | 9 +- cv/mvg/pjt2d/index.html | 9 +- cv/mvg/pjt3d/index.html | 9 +- cv/papers/3dgs/3dgs/index.html | 13 +- cv/papers/3dgs/4dgs/index.html | 23 +- .../3dgs/gaussian-splatting-slam/index.html | 1687 +++++++++++++++++ cv/papers/3dgs/index.html | 14 +- cv/papers/3dgs/splatam/index.html | 17 +- cv/papers/dynamic-slam/crowd-slam/index.html | 9 +- cv/papers/dynamic-slam/detect-slam/index.html | 9 +- cv/papers/dynamic-slam/ds-slam/index.html | 9 +- cv/papers/dynamic-slam/dynaslam/index.html | 9 +- cv/papers/dynamic-slam/flowfusion/index.html | 9 +- cv/papers/dynamic-slam/index.html | 9 +- cv/papers/dynamic-slam/rigidfusion/index.html | 9 +- cv/papers/index.html | 14 +- cv/papers/nerf/co-slam/index.html | 9 +- cv/papers/nerf/ddn-slam/index.html | 9 +- cv/papers/nerf/imap/index.html | 9 +- cv/papers/nerf/index.html | 9 +- cv/papers/nerf/nerf-evaluation/index.html | 9 +- cv/papers/nerf/nerf/index.html | 9 +- cv/papers/nerf/nice-slam/index.html | 9 +- cv/papers/nerf/nid-slam/index.html | 9 +- cv/papers/others/deepv2d/index.html | 9 +- .../endoscopy-depth-estimation/index.html | 9 +- cv/papers/others/index.html | 13 +- cv/papers/others/let-net/index.html | 9 +- cv/papers/others/orbslam2/index.html | 9 +- cv/papers/others/vslam14/index.html | 9 +- cv/papers/others/vslam14/lec1/index.html | 9 +- cv/papers/others/vslam14/lec2/index.html | 9 +- cv/pcd/index.html | 9 +- cv/pcd/pcr/icp/index.html | 9 +- cv/pcd/pcr/index.html | 9 +- cv/pcd/pcr/prepare/index.html | 9 +- cv/utils/colmap/index.html | 9 +- cv/utils/index.html | 9 +- feed_rss_created.xml | 2 +- feed_rss_updated.xml | 2 +- index.html | 13 +- links/index.html | 9 +- llm/index.html | 9 +- llm/internlm/index.html | 9 +- llm/internlm/lec1/index.html | 9 +- llm/internlm/lec2/index.html | 9 +- llm/internlm/lec3/index.html | 9 +- llm/internlm/lec4/index.html | 9 +- llm/internlm/lec5/index.html | 9 +- llm/internlm/lec6/index.html | 9 +- llm/nlp/index.html | 9 +- llm/nlp/rnns/index.html | 9 +- llm/nlp/word2vec/index.html | 9 +- llm/others/dt/index.html | 9 +- llm/others/prompt/index.html | 9 +- llm/transformer/attention/index.html | 9 +- llm/transformer/bert/index.html | 9 +- llm/transformer/index.html | 9 +- llm/transformer/transformer/index.html | 9 +- llm/transformer/vit/index.html | 9 +- mb/comb/index.html | 9 +- mb/index.html | 9 +- mb/maa/index.html | 9 +- mb/maa/lec1/index.html | 9 +- mb/maa/lec2/index.html | 9 +- mb/maa/lec3/index.html | 9 +- mb/optimization-theory/index.html | 9 +- mb/optimization-theory/lec1/index.html | 9 +- mb/optimization-theory/lec2/index.html | 9 +- mb/optimization-theory/lec3/index.html | 9 +- redirection.html | 20 +- search/search_index.json | 2 +- sitemap.xml | 269 +-- sitemap.xml.gz | Bin 984 -> 998 bytes todo/index.html | 9 +- utils/action/index.html | 9 +- utils/docker/index.html | 9 +- utils/ffmpeg/index.html | 9 +- utils/gdb/index.html | 9 +- utils/git/index.html | 9 +- utils/gitbook/index.html | 9 +- utils/hexo/index.html | 9 +- utils/imagemagick/index.html | 9 +- utils/index.html | 9 +- utils/mkdocs/index.html | 9 +- utils/reveal-md/index.html | 9 +- utils/shell/index.html | 9 +- utils/utilsbox/index.html | 9 +- 141 files changed, 2829 insertions(+), 426 deletions(-) create mode 100644 cv/papers/3dgs/gaussian-splatting-slam/index.html diff --git a/404.html b/404.html index c0619f83..5b010b54 100644 --- a/404.html +++ b/404.html @@ -2335,6 +2335,8 @@ + + @@ -2376,6 +2378,20 @@ +
  • + + 4DGS + +
  • + + + + + + + + +
  • SplaTAM @@ -2391,8 +2407,8 @@
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/changelog.yml b/changelog.yml index 7d5fa8a2..b76c29b6 100644 --- a/changelog.yml +++ b/changelog.yml @@ -1,4 +1,8 @@ - "2024": + - "2024-10-13": + - newpage: + text: CV > SLAM > Gaussian Splatting SLAM + href: /cv/slam/gaussian-splatting-slam/ - "2024-10-9": - newpage: text: CV > SLAM > 4DGS diff --git a/changelog/index.html b/changelog/index.html index d769f277..7614fae9 100644 --- a/changelog/index.html +++ b/changelog/index.html @@ -891,13 +891,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • @@ -1432,6 +1437,19 @@

    2024 + +
    +
    +
    +
    +
    +
    2024-10-9

    CV > SLAM > 4DGS

    diff --git a/cs/ai/dl/index.html b/cs/ai/dl/index.html index a33f0bff..12bea80a 100644 --- a/cs/ai/dl/index.html +++ b/cs/ai/dl/index.html @@ -994,13 +994,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/ai/ml/index.html b/cs/ai/ml/index.html index cea65105..1248c9ca 100644 --- a/cs/ai/ml/index.html +++ b/cs/ai/ml/index.html @@ -1189,13 +1189,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/ai/mode-recognition/index.html b/cs/ai/mode-recognition/index.html index be1c7500..7b34cb1a 100644 --- a/cs/ai/mode-recognition/index.html +++ b/cs/ai/mode-recognition/index.html @@ -1044,13 +1044,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/algorithm/basic-ds/index.html b/cs/algorithm/basic-ds/index.html index 86f2ffab..6d926c33 100644 --- a/cs/algorithm/basic-ds/index.html +++ b/cs/algorithm/basic-ds/index.html @@ -866,13 +866,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/algorithm/design-analysis/index.html b/cs/algorithm/design-analysis/index.html index bfc8382c..686e0eff 100644 --- a/cs/algorithm/design-analysis/index.html +++ b/cs/algorithm/design-analysis/index.html @@ -935,13 +935,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/db/mysql/index.html b/cs/db/mysql/index.html index ac1e545f..491c1469 100644 --- a/cs/db/mysql/index.html +++ b/cs/db/mysql/index.html @@ -1092,13 +1092,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/db/redis/cjh/index.html b/cs/db/redis/cjh/index.html index 6b5856b9..8fd8c428 100644 --- a/cs/db/redis/cjh/index.html +++ b/cs/db/redis/cjh/index.html @@ -1023,13 +1023,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/db/redis/datatype/index.html b/cs/db/redis/datatype/index.html index 61e86f88..cb378eff 100644 --- a/cs/db/redis/datatype/index.html +++ b/cs/db/redis/datatype/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/db/redis/work/index.html b/cs/db/redis/work/index.html index 62fa7f80..0b72c2e3 100644 --- a/cs/db/redis/work/index.html +++ b/cs/db/redis/work/index.html @@ -949,13 +949,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/hpc/gpu/index.html b/cs/hpc/gpu/index.html index b9f7d948..375260f9 100644 --- a/cs/hpc/gpu/index.html +++ b/cs/hpc/gpu/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/hpc/index.html b/cs/hpc/index.html index 84495afa..abfae3ee 100644 --- a/cs/hpc/index.html +++ b/cs/hpc/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/hpc/mpi/index.html b/cs/hpc/mpi/index.html index ab17dff4..53fcae84 100644 --- a/cs/hpc/mpi/index.html +++ b/cs/hpc/mpi/index.html @@ -1109,13 +1109,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/hpc/openmp/index.html b/cs/hpc/openmp/index.html index 37ce5f9b..226b9e4f 100644 --- a/cs/hpc/openmp/index.html +++ b/cs/hpc/openmp/index.html @@ -1037,13 +1037,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/hpc/outline/index.html b/cs/hpc/outline/index.html index 4813aedd..ace19b59 100644 --- a/cs/hpc/outline/index.html +++ b/cs/hpc/outline/index.html @@ -935,13 +935,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/hpc/vectorizecompute/index.html b/cs/hpc/vectorizecompute/index.html index 1d8cb15b..94c4833a 100644 --- a/cs/hpc/vectorizecompute/index.html +++ b/cs/hpc/vectorizecompute/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/index.html b/cs/index.html index 59efa9d4..d124f1c3 100644 --- a/cs/index.html +++ b/cs/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/others/regex/index.html b/cs/others/regex/index.html index d1d05ca7..02e56744 100644 --- a/cs/others/regex/index.html +++ b/cs/others/regex/index.html @@ -988,13 +988,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/c_cpp/basic/index.html b/cs/pl/c_cpp/basic/index.html index 41ca0059..81e2912b 100644 --- a/cs/pl/c_cpp/basic/index.html +++ b/cs/pl/c_cpp/basic/index.html @@ -1395,13 +1395,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/c_cpp/function/index.html b/cs/pl/c_cpp/function/index.html index 3729ab3d..4fd9b0e3 100644 --- a/cs/pl/c_cpp/function/index.html +++ b/cs/pl/c_cpp/function/index.html @@ -901,13 +901,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/c_cpp/index.html b/cs/pl/c_cpp/index.html index 0b975d4a..98db7832 100644 --- a/cs/pl/c_cpp/index.html +++ b/cs/pl/c_cpp/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/c_cpp/stl/index.html b/cs/pl/c_cpp/stl/index.html index 7da061d9..e3a4f417 100644 --- a/cs/pl/c_cpp/stl/index.html +++ b/cs/pl/c_cpp/stl/index.html @@ -956,13 +956,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/go/basic/index.html b/cs/pl/go/basic/index.html index c3990c52..1722926f 100644 --- a/cs/pl/go/basic/index.html +++ b/cs/pl/go/basic/index.html @@ -1167,13 +1167,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/go/gin/index.html b/cs/pl/go/gin/index.html index 18ee92e1..5f8d15d8 100644 --- a/cs/pl/go/gin/index.html +++ b/cs/pl/go/gin/index.html @@ -866,13 +866,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/go/index.html b/cs/pl/go/index.html index f572d9e3..71ea2db6 100644 --- a/cs/pl/go/index.html +++ b/cs/pl/go/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/index.html b/cs/pl/index.html index 228d43f2..9a9d1663 100644 --- a/cs/pl/index.html +++ b/cs/pl/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/java/basic/index.html b/cs/pl/java/basic/index.html index 077b1deb..e48ea1ee 100644 --- a/cs/pl/java/basic/index.html +++ b/cs/pl/java/basic/index.html @@ -927,13 +927,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/java/index.html b/cs/pl/java/index.html index 8694748f..2f4cba93 100644 --- a/cs/pl/java/index.html +++ b/cs/pl/java/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/java/springboot/index.html b/cs/pl/java/springboot/index.html index c4f366bf..9d9237c0 100644 --- a/cs/pl/java/springboot/index.html +++ b/cs/pl/java/springboot/index.html @@ -902,13 +902,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/python/basic/index.html b/cs/pl/python/basic/index.html index 54011dc9..5f58fdd5 100644 --- a/cs/pl/python/basic/index.html +++ b/cs/pl/python/basic/index.html @@ -1186,13 +1186,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/python/index.html b/cs/pl/python/index.html index bd995d2f..56fd98de 100644 --- a/cs/pl/python/index.html +++ b/cs/pl/python/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/python/numpy/index.html b/cs/pl/python/numpy/index.html index 112a8d80..79d38e3b 100644 --- a/cs/pl/python/numpy/index.html +++ b/cs/pl/python/numpy/index.html @@ -1071,13 +1071,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/pl/python/virtual/index.html b/cs/pl/python/virtual/index.html index 14638964..2cc0745f 100644 --- a/cs/pl/python/virtual/index.html +++ b/cs/pl/python/virtual/index.html @@ -892,13 +892,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/software/compa/index.html b/cs/software/compa/index.html index 067a5f4f..efab6cfb 100644 --- a/cs/software/compa/index.html +++ b/cs/software/compa/index.html @@ -967,13 +967,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/software/design-pattern/index.html b/cs/software/design-pattern/index.html index ec09655a..ca787b72 100644 --- a/cs/software/design-pattern/index.html +++ b/cs/software/design-pattern/index.html @@ -1049,13 +1049,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/software/index.html b/cs/software/index.html index 2993d691..b704949c 100644 --- a/cs/software/index.html +++ b/cs/software/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/software/piaserver/index.html b/cs/software/piaserver/index.html index 433b7fcd..8613e19b 100644 --- a/cs/software/piaserver/index.html +++ b/cs/software/piaserver/index.html @@ -866,13 +866,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cs/software/sca/index.html b/cs/software/sca/index.html index 93f26d58..470f30b7 100644 --- a/cs/software/sca/index.html +++ b/cs/software/sca/index.html @@ -1313,13 +1313,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/3d-visualization/index.html b/cv/3d-visualization/index.html index 4d6baa0d..8cf3628e 100644 --- a/cv/3d-visualization/index.html +++ b/cv/3d-visualization/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/dataset/index.html b/cv/dataset/index.html index 168c3c70..23e4c7e1 100644 --- a/cv/dataset/index.html +++ b/cv/dataset/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/dataset/kitti/index.html b/cv/dataset/kitti/index.html index b68a56f7..5c0124d4 100644 --- a/cv/dataset/kitti/index.html +++ b/cv/dataset/kitti/index.html @@ -931,13 +931,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/dataset/tum/index.html b/cv/dataset/tum/index.html index de2dd729..f7978f05 100644 --- a/cv/dataset/tum/index.html +++ b/cv/dataset/tum/index.html @@ -911,13 +911,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/dataset/waymo/index.html b/cv/dataset/waymo/index.html index a5e376f9..75ed4167 100644 --- a/cv/dataset/waymo/index.html +++ b/cv/dataset/waymo/index.html @@ -921,13 +921,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/index.html b/cv/index.html index 346b62a2..aefacce9 100644 --- a/cv/index.html +++ b/cv/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • @@ -1565,11 +1570,11 @@

    Table of Contents3DGS 系列

    - 5526 172 21 mins + 6459 172 24 mins
    -
    1728457993
    +
    1728805876
  • diff --git a/cv/mvg/3dr-camera-structure/index.html b/cv/mvg/3dr-camera-structure/index.html index 07e1c52a..89cff557 100644 --- a/cv/mvg/3dr-camera-structure/index.html +++ b/cv/mvg/3dr-camera-structure/index.html @@ -926,13 +926,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/ag-fm/index.html b/cv/mvg/ag-fm/index.html index 1b63d22d..3c9b28d0 100644 --- a/cv/mvg/ag-fm/index.html +++ b/cv/mvg/ag-fm/index.html @@ -964,13 +964,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/calc-p/index.html b/cv/mvg/calc-p/index.html index 4c7ba3eb..9ce8b4ed 100644 --- a/cv/mvg/calc-p/index.html +++ b/cv/mvg/calc-p/index.html @@ -916,13 +916,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/camera-model/index.html b/cv/mvg/camera-model/index.html index 7e334f97..467193ee 100644 --- a/cv/mvg/camera-model/index.html +++ b/cv/mvg/camera-model/index.html @@ -979,13 +979,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/est2d/index.html b/cv/mvg/est2d/index.html index 22206f41..79a08c38 100644 --- a/cv/mvg/est2d/index.html +++ b/cv/mvg/est2d/index.html @@ -1109,13 +1109,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/eval/index.html b/cv/mvg/eval/index.html index cf94a41f..2d806f40 100644 --- a/cv/mvg/eval/index.html +++ b/cv/mvg/eval/index.html @@ -935,13 +935,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/index.html b/cv/mvg/index.html index 4158cac8..a699cf29 100644 --- a/cv/mvg/index.html +++ b/cv/mvg/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/one-vg/index.html b/cv/mvg/one-vg/index.html index fd15f0bb..430402e0 100644 --- a/cv/mvg/one-vg/index.html +++ b/cv/mvg/one-vg/index.html @@ -993,13 +993,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/pjt2d/index.html b/cv/mvg/pjt2d/index.html index c50ca6a9..48ef04d1 100644 --- a/cv/mvg/pjt2d/index.html +++ b/cv/mvg/pjt2d/index.html @@ -1058,13 +1058,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/mvg/pjt3d/index.html b/cv/mvg/pjt3d/index.html index 849adf6e..2546eb37 100644 --- a/cv/mvg/pjt3d/index.html +++ b/cv/mvg/pjt3d/index.html @@ -941,13 +941,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/papers/3dgs/3dgs/index.html b/cv/papers/3dgs/3dgs/index.html index 21908591..9ddde409 100644 --- a/cv/papers/3dgs/3dgs/index.html +++ b/cv/papers/3dgs/3dgs/index.html @@ -983,13 +983,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • @@ -2156,13 +2161,13 @@

    Reference

    - -
    diff --git a/cv/papers/others/let-net/index.html b/cv/papers/others/let-net/index.html index 8c6fb216..ee35b73e 100644 --- a/cv/papers/others/let-net/index.html +++ b/cv/papers/others/let-net/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/papers/others/orbslam2/index.html b/cv/papers/others/orbslam2/index.html index 115454e1..ae4492d8 100644 --- a/cv/papers/others/orbslam2/index.html +++ b/cv/papers/others/orbslam2/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/papers/others/vslam14/index.html b/cv/papers/others/vslam14/index.html index e2527a89..583d885a 100644 --- a/cv/papers/others/vslam14/index.html +++ b/cv/papers/others/vslam14/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/papers/others/vslam14/lec1/index.html b/cv/papers/others/vslam14/lec1/index.html index 9da9f44b..bfab8074 100644 --- a/cv/papers/others/vslam14/lec1/index.html +++ b/cv/papers/others/vslam14/lec1/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/papers/others/vslam14/lec2/index.html b/cv/papers/others/vslam14/lec2/index.html index 5e68ef11..e9024481 100644 --- a/cv/papers/others/vslam14/lec2/index.html +++ b/cv/papers/others/vslam14/lec2/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/pcd/index.html b/cv/pcd/index.html index 73ebe344..36a495a6 100644 --- a/cv/pcd/index.html +++ b/cv/pcd/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/pcd/pcr/icp/index.html b/cv/pcd/pcr/icp/index.html index 69cb3266..af490fe5 100644 --- a/cv/pcd/pcr/icp/index.html +++ b/cv/pcd/pcr/icp/index.html @@ -940,13 +940,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/pcd/pcr/index.html b/cv/pcd/pcr/index.html index 2308ef91..53b7645e 100644 --- a/cv/pcd/pcr/index.html +++ b/cv/pcd/pcr/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/pcd/pcr/prepare/index.html b/cv/pcd/pcr/prepare/index.html index fdbc8de4..3f6be209 100644 --- a/cv/pcd/pcr/prepare/index.html +++ b/cv/pcd/pcr/prepare/index.html @@ -916,13 +916,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/utils/colmap/index.html b/cv/utils/colmap/index.html index bd6c2200..2b431eb6 100644 --- a/cv/utils/colmap/index.html +++ b/cv/utils/colmap/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/cv/utils/index.html b/cv/utils/index.html index 1e21df79..54eb795f 100644 --- a/cv/utils/index.html +++ b/cv/utils/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/feed_rss_created.xml b/feed_rss_created.xml index 54aa118d..06c6a4bf 100644 --- a/feed_rss_created.xml +++ b/feed_rss_created.xml @@ -1 +1 @@ - 狙击美佐的笔记本狙击美佐(jujimeizuo)的笔记本https://note.jujimeizuo.cn/https://github.com/jujimeizuo/note/en-None Wed, 09 Oct 2024 07:13:22 -0000 Wed, 09 Oct 2024 07:13:22 -0000 1440 MkDocs RSS plugin - v1.8.0 4DGS <h1>4DGaussians</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1368 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ SplaTAM <h1>SplaTAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1520 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ ffmpeg <h1>ffmpeg</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 29 个字 :fontawesome-solid-code: 10 行代...https://note.jujimeizuo.cn/utils/ffmpeg/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/ffmpeg/ ImageMagick https://note.jujimeizuo.cn/utils/imagemagick/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/imagemagick/ 工具 <h1>工具</h1><p>!!! abstract 处理数据等相关工具</p><h2>Table of Contents</h2><ul><li><a href="colmap/">COLMAP</a></li></ul>https://note.jujimeizuo.cn/cv/utils/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/ COLMAP <h1>COLMAP</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 475 个字 :fontawesome-solid-code: 67 行...https://note.jujimeizuo.cn/cv/utils/colmap/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/colmap/ SLAM <h1>SLAM</h1><p>!!! abstract 归档一些学习三维视觉的相关笔记</p><h2>Table of Contents</h2><ul><li>Dynamic-SLAM 系列<ul><li><a href="dynamic-slam/dynaslam/">DynaSLAM</a></li><li>[DS-SLAM](dynamic-slam/ds-sl...</li></ul></li></ul>https://note.jujimeizuo.cn/cv/papers/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/ 3DGS 系列 <h1>3DGS 系列</h1><p>!!! abstract 3DGS 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="3dgs/">3DGS</a></li><li><a href="splatam/">SplaTAM</a></li><li><a href="4dgs/">4DGS</a></li></ul>https://note.jujimeizuo.cn/cv/papers/3dgs/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/ 3DGS <h1>3DGS</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2609 个字 :fontawesome-solid-code: 174 行...https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ 动态 SLAM 系列 <h1>动态 SLAM 系列</h1><p>!!! abstract 动态 SLAM 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="dynaslam/">DynaSLAM</a></li><li><a href="ds-slam/">DS-SLAM</a></li><li><a href="detect-slam/">Detect-SLAM</a></li><li>[FlowFusio...</li></ul>https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ Crowd-SLAM <h1>Crowd-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 172 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Detect-SLAM <h1>Detect-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1402 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ DS-SLAM <h1>DS-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2274 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ DynaSLAM <h1>DynaSLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1868 个字 :material-clock-time-two-o...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ FlowFusion <h1>FlowFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 861 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ RigidFusion <h1>RigidFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1358 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ NeRF 系列 <h1>NeRF 系列</h1><p>!!! abstract NeRF 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="nerf/">NeRF</a></li><li><a href="nerf-evaluation/">NeRF-Evaluation</a></li><li><a href="imap/">iMAP</a></li><li>[NICE-SLAM](nice-slam/...</li></ul>https://note.jujimeizuo.cn/cv/papers/nerf/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/ Co-SLAM <h1>Co-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 713 个字 :material-clock-time-two-out...https://note.jujimeizuo.cn/cv/papers/nerf/co-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/co-slam/ DDN-SLAM <h1>DDN-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 225 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/nerf/ddn-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/ddn-slam/ iMAP <h1>iMAP</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 969 个字 :material-clock-time-two-outlin...https://note.jujimeizuo.cn/cv/papers/nerf/imap/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/imap/ \ No newline at end of file + 狙击美佐的笔记本狙击美佐(jujimeizuo)的笔记本https://note.jujimeizuo.cn/https://github.com/jujimeizuo/note/en-None Sun, 13 Oct 2024 07:51:25 -0000 Sun, 13 Oct 2024 07:51:25 -0000 1440 MkDocs RSS plugin - v1.8.0 Gaussian Splatting SLAM <h1>Gaussian Splatting SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 926 个字 :material-cl...https://note.jujimeizuo.cn/cv/papers/3dgs/gaussian-splatting-slam/ Sun, 13 Oct 2024 15:51:16 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/gaussian-splatting-slam/ 4DGS <h1>4DGaussians</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1368 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ SplaTAM <h1>SplaTAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1520 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ ffmpeg <h1>ffmpeg</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 29 个字 :fontawesome-solid-code: 10 行代...https://note.jujimeizuo.cn/utils/ffmpeg/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/ffmpeg/ ImageMagick https://note.jujimeizuo.cn/utils/imagemagick/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/imagemagick/ 工具 <h1>工具</h1><p>!!! abstract 处理数据等相关工具</p><h2>Table of Contents</h2><ul><li><a href="colmap/">COLMAP</a></li></ul>https://note.jujimeizuo.cn/cv/utils/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/ COLMAP <h1>COLMAP</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 475 个字 :fontawesome-solid-code: 67 行...https://note.jujimeizuo.cn/cv/utils/colmap/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/colmap/ SLAM <h1>SLAM</h1><p>!!! abstract 归档一些学习三维视觉的相关笔记</p><h2>Table of Contents</h2><ul><li>Dynamic-SLAM 系列<ul><li><a href="dynamic-slam/dynaslam/">DynaSLAM</a></li><li>[DS-SLAM](dynamic-slam/ds-sl...</li></ul></li></ul>https://note.jujimeizuo.cn/cv/papers/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/ 3DGS 系列 <h1>3DGS 系列</h1><p>!!! abstract 3DGS 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="3dgs/">3DGS</a></li><li><a href="4dgs/">4DGS</a></li><li><a href="splatam/">SplaTAM</a></li><li>[Gaussian Splatting SLAM](gaussian-spl...</li></ul>https://note.jujimeizuo.cn/cv/papers/3dgs/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/ 3DGS <h1>3DGS</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2609 个字 :fontawesome-solid-code: 174 行...https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ 动态 SLAM 系列 <h1>动态 SLAM 系列</h1><p>!!! abstract 动态 SLAM 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="dynaslam/">DynaSLAM</a></li><li><a href="ds-slam/">DS-SLAM</a></li><li><a href="detect-slam/">Detect-SLAM</a></li><li>[FlowFusio...</li></ul>https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ Crowd-SLAM <h1>Crowd-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 172 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Detect-SLAM <h1>Detect-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1402 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ DS-SLAM <h1>DS-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2274 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ DynaSLAM <h1>DynaSLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1868 个字 :material-clock-time-two-o...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ FlowFusion <h1>FlowFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 861 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ RigidFusion <h1>RigidFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1358 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ NeRF 系列 <h1>NeRF 系列</h1><p>!!! abstract NeRF 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="nerf/">NeRF</a></li><li><a href="nerf-evaluation/">NeRF-Evaluation</a></li><li><a href="imap/">iMAP</a></li><li>[NICE-SLAM](nice-slam/...</li></ul>https://note.jujimeizuo.cn/cv/papers/nerf/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/ Co-SLAM <h1>Co-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 713 个字 :material-clock-time-two-out...https://note.jujimeizuo.cn/cv/papers/nerf/co-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/co-slam/ DDN-SLAM <h1>DDN-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 225 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/nerf/ddn-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/ddn-slam/ \ No newline at end of file diff --git a/feed_rss_updated.xml b/feed_rss_updated.xml index 24357beb..0292dff1 100644 --- a/feed_rss_updated.xml +++ b/feed_rss_updated.xml @@ -1 +1 @@ - 狙击美佐的笔记本狙击美佐(jujimeizuo)的笔记本https://note.jujimeizuo.cn/https://github.com/jujimeizuo/note/en-None Wed, 09 Oct 2024 07:13:22 -0000 Wed, 09 Oct 2024 07:13:22 -0000 1440 MkDocs RSS plugin - v1.8.0 SLAM <h1>SLAM</h1><p>!!! abstract 归档一些学习三维视觉的相关笔记</p><h2>Table of Contents</h2><ul><li>Dynamic-SLAM 系列<ul><li><a href="dynamic-slam/dynaslam/">DynaSLAM</a></li><li>[DS-SLAM](dynamic-slam/ds-sl...</li></ul></li></ul>https://note.jujimeizuo.cn/cv/papers/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/ 3DGS 系列 <h1>3DGS 系列</h1><p>!!! abstract 3DGS 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="3dgs/">3DGS</a></li><li><a href="splatam/">SplaTAM</a></li><li><a href="4dgs/">4DGS</a></li></ul>https://note.jujimeizuo.cn/cv/papers/3dgs/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/ 4DGS <h1>4DGaussians</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1368 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ SplaTAM <h1>SplaTAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1520 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ 3DGS <h1>3DGS</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2609 个字 :fontawesome-solid-code: 174 行...https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ NeRF 系列 <h1>NeRF 系列</h1><p>!!! abstract NeRF 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="nerf/">NeRF</a></li><li><a href="nerf-evaluation/">NeRF-Evaluation</a></li><li><a href="imap/">iMAP</a></li><li>[NICE-SLAM](nice-slam/...</li></ul>https://note.jujimeizuo.cn/cv/papers/nerf/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/ NeRF <h1>NeRF</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2137 个字 :fontawesome-solid-code: 11 行代...https://note.jujimeizuo.cn/cv/papers/nerf/nerf/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/nerf/ 工具相关 <h1>工具相关</h1><p>!!! abstract 一些工具的使用方法,包括命令行相关的命令等等</p><h2>Table of Contents</h2><div class="index-item-wrapper"> <div class="title-wrapper"> <button ...https://note.jujimeizuo.cn/utils/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/ ffmpeg <h1>ffmpeg</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 29 个字 :fontawesome-solid-code: 10 行代...https://note.jujimeizuo.cn/utils/ffmpeg/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/ffmpeg/ ImageMagick https://note.jujimeizuo.cn/utils/imagemagick/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/imagemagick/ COLMAP <h1>COLMAP</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 475 个字 :fontawesome-solid-code: 67 行...https://note.jujimeizuo.cn/cv/utils/colmap/ Thu, 26 Sep 2024 21:01:35 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/colmap/ 计算机视觉 <h1>计算机视觉</h1><p>!!! abstract 归档一些计算机视觉(SLAM、SfM、掺点机器人,例如 ROS)相关内容的笔记</p><pre><code>大多都是自学,理解 CV(数学) 的本质(雾</code></pre><h2>Table of Contents</h2><div class="index-item-wrapper"> ...https://note.jujimeizuo.cn/cv/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/ 动态 SLAM 系列 <h1>动态 SLAM 系列</h1><p>!!! abstract 动态 SLAM 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="dynaslam/">DynaSLAM</a></li><li><a href="ds-slam/">DS-SLAM</a></li><li><a href="detect-slam/">Detect-SLAM</a></li><li>[FlowFusio...</li></ul>https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ 工具 <h1>工具</h1><p>!!! abstract 处理数据等相关工具</p><h2>Table of Contents</h2><ul><li><a href="colmap/">COLMAP</a></li></ul>https://note.jujimeizuo.cn/cv/utils/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/ Crowd-SLAM <h1>Crowd-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 172 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Detect-SLAM <h1>Detect-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1402 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ DS-SLAM <h1>DS-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2274 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ DynaSLAM <h1>DynaSLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1868 个字 :material-clock-time-two-o...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ FlowFusion <h1>FlowFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 861 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ RigidFusion <h1>RigidFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1358 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ \ No newline at end of file + 狙击美佐的笔记本狙击美佐(jujimeizuo)的笔记本https://note.jujimeizuo.cn/https://github.com/jujimeizuo/note/en-None Sun, 13 Oct 2024 07:51:25 -0000 Sun, 13 Oct 2024 07:51:25 -0000 1440 MkDocs RSS plugin - v1.8.0 SLAM <h1>SLAM</h1><p>!!! abstract 归档一些学习三维视觉的相关笔记</p><h2>Table of Contents</h2><ul><li>Dynamic-SLAM 系列<ul><li><a href="dynamic-slam/dynaslam/">DynaSLAM</a></li><li>[DS-SLAM](dynamic-slam/ds-sl...</li></ul></li></ul>https://note.jujimeizuo.cn/cv/papers/ Sun, 13 Oct 2024 15:51:16 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/ 3DGS 系列 <h1>3DGS 系列</h1><p>!!! abstract 3DGS 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="3dgs/">3DGS</a></li><li><a href="4dgs/">4DGS</a></li><li><a href="splatam/">SplaTAM</a></li><li>[Gaussian Splatting SLAM](gaussian-spl...</li></ul>https://note.jujimeizuo.cn/cv/papers/3dgs/ Sun, 13 Oct 2024 15:51:16 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/ Gaussian Splatting SLAM <h1>Gaussian Splatting SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 926 个字 :material-cl...https://note.jujimeizuo.cn/cv/papers/3dgs/gaussian-splatting-slam/ Sun, 13 Oct 2024 15:51:16 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/gaussian-splatting-slam/ 4DGS <h1>4DGaussians</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1368 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ SplaTAM <h1>SplaTAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1520 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ Wed, 09 Oct 2024 15:13:13 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ 3DGS <h1>3DGS</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2609 个字 :fontawesome-solid-code: 174 行...https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ NeRF 系列 <h1>NeRF 系列</h1><p>!!! abstract NeRF 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="nerf/">NeRF</a></li><li><a href="nerf-evaluation/">NeRF-Evaluation</a></li><li><a href="imap/">iMAP</a></li><li>[NICE-SLAM](nice-slam/...</li></ul>https://note.jujimeizuo.cn/cv/papers/nerf/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/ NeRF <h1>NeRF</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2137 个字 :fontawesome-solid-code: 11 行代...https://note.jujimeizuo.cn/cv/papers/nerf/nerf/ Fri, 27 Sep 2024 21:19:54 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/nerf/nerf/ 工具相关 <h1>工具相关</h1><p>!!! abstract 一些工具的使用方法,包括命令行相关的命令等等</p><h2>Table of Contents</h2><div class="index-item-wrapper"> <div class="title-wrapper"> <button ...https://note.jujimeizuo.cn/utils/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/ ffmpeg <h1>ffmpeg</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 29 个字 :fontawesome-solid-code: 10 行代...https://note.jujimeizuo.cn/utils/ffmpeg/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/ffmpeg/ ImageMagick https://note.jujimeizuo.cn/utils/imagemagick/ Fri, 27 Sep 2024 16:01:52 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/utils/imagemagick/ COLMAP <h1>COLMAP</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 475 个字 :fontawesome-solid-code: 67 行...https://note.jujimeizuo.cn/cv/utils/colmap/ Thu, 26 Sep 2024 21:01:35 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/colmap/ 计算机视觉 <h1>计算机视觉</h1><p>!!! abstract 归档一些计算机视觉(SLAM、SfM、掺点机器人,例如 ROS)相关内容的笔记</p><pre><code>大多都是自学,理解 CV(数学) 的本质(雾</code></pre><h2>Table of Contents</h2><div class="index-item-wrapper"> ...https://note.jujimeizuo.cn/cv/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/ 动态 SLAM 系列 <h1>动态 SLAM 系列</h1><p>!!! abstract 动态 SLAM 系列相关内容</p><h2>Table of Contents</h2><ul><li><a href="dynaslam/">DynaSLAM</a></li><li><a href="ds-slam/">DS-SLAM</a></li><li><a href="detect-slam/">Detect-SLAM</a></li><li>[FlowFusio...</li></ul>https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ 工具 <h1>工具</h1><p>!!! abstract 处理数据等相关工具</p><h2>Table of Contents</h2><ul><li><a href="colmap/">COLMAP</a></li></ul>https://note.jujimeizuo.cn/cv/utils/ Wed, 25 Sep 2024 20:06:19 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/utils/ Crowd-SLAM <h1>Crowd-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 172 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ Detect-SLAM <h1>Detect-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1402 个字 :material-clock-time-tw...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ DS-SLAM <h1>DS-SLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 2274 个字 :material-clock-time-two-ou...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ DynaSLAM <h1>DynaSLAM</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 1868 个字 :material-clock-time-two-o...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ FlowFusion <h1>FlowFusion</h1><div markdown="1" style="margin-top: -30px; font-size: 0.75em; opacity: 0.7;">:material-circle-edit-outline: 约 861 个字 :material-clock-time-two-...https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ Wed, 25 Sep 2024 15:58:57 +0000狙击美佐的笔记本https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ \ No newline at end of file diff --git a/index.html b/index.html index f8b55734..9b7276aa 100644 --- a/index.html +++ b/index.html @@ -897,13 +897,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • @@ -1401,8 +1406,8 @@

    o(〃'▽'〃)o Hi! 站点统计

    -

    页面总数:132
    -总字数:158177
    +

    页面总数:133
    +总字数:159109
    代码块行数:3423
    网站运行时间:

    diff --git a/links/index.html b/links/index.html index b1869c1c..105d7faf 100644 --- a/links/index.html +++ b/links/index.html @@ -858,13 +858,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/index.html b/llm/index.html index 763a321b..6a8b738e 100644 --- a/llm/index.html +++ b/llm/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/index.html b/llm/internlm/index.html index 1f59e6de..17221685 100644 --- a/llm/internlm/index.html +++ b/llm/internlm/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/lec1/index.html b/llm/internlm/lec1/index.html index 7ab81c0b..66fed614 100644 --- a/llm/internlm/lec1/index.html +++ b/llm/internlm/lec1/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/lec2/index.html b/llm/internlm/lec2/index.html index 7aaa5629..3870d983 100644 --- a/llm/internlm/lec2/index.html +++ b/llm/internlm/lec2/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/lec3/index.html b/llm/internlm/lec3/index.html index 81c352d2..6052f27a 100644 --- a/llm/internlm/lec3/index.html +++ b/llm/internlm/lec3/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/lec4/index.html b/llm/internlm/lec4/index.html index dfdf1328..e31bfaa5 100644 --- a/llm/internlm/lec4/index.html +++ b/llm/internlm/lec4/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/lec5/index.html b/llm/internlm/lec5/index.html index 08d94fb5..48845466 100644 --- a/llm/internlm/lec5/index.html +++ b/llm/internlm/lec5/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/internlm/lec6/index.html b/llm/internlm/lec6/index.html index 73392bdb..74d23f98 100644 --- a/llm/internlm/lec6/index.html +++ b/llm/internlm/lec6/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/nlp/index.html b/llm/nlp/index.html index 4623162d..16e606ba 100644 --- a/llm/nlp/index.html +++ b/llm/nlp/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/nlp/rnns/index.html b/llm/nlp/rnns/index.html index 96b22b26..b01a873a 100644 --- a/llm/nlp/rnns/index.html +++ b/llm/nlp/rnns/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/nlp/word2vec/index.html b/llm/nlp/word2vec/index.html index 8c08dd9f..1d430184 100644 --- a/llm/nlp/word2vec/index.html +++ b/llm/nlp/word2vec/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/others/dt/index.html b/llm/others/dt/index.html index 736f7b4a..c999c7a6 100644 --- a/llm/others/dt/index.html +++ b/llm/others/dt/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/others/prompt/index.html b/llm/others/prompt/index.html index 3fc47227..f9885240 100644 --- a/llm/others/prompt/index.html +++ b/llm/others/prompt/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/transformer/attention/index.html b/llm/transformer/attention/index.html index c02a5279..438ed0ac 100644 --- a/llm/transformer/attention/index.html +++ b/llm/transformer/attention/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/transformer/bert/index.html b/llm/transformer/bert/index.html index f604a156..97733afe 100644 --- a/llm/transformer/bert/index.html +++ b/llm/transformer/bert/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/transformer/index.html b/llm/transformer/index.html index 40948590..40ab483a 100644 --- a/llm/transformer/index.html +++ b/llm/transformer/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/transformer/transformer/index.html b/llm/transformer/transformer/index.html index 40ff03f0..24274185 100644 --- a/llm/transformer/transformer/index.html +++ b/llm/transformer/transformer/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/llm/transformer/vit/index.html b/llm/transformer/vit/index.html index 800b7759..e211d4aa 100644 --- a/llm/transformer/vit/index.html +++ b/llm/transformer/vit/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/comb/index.html b/mb/comb/index.html index 3f957e44..85254d6e 100644 --- a/mb/comb/index.html +++ b/mb/comb/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/index.html b/mb/index.html index 7d8e152f..b194c8fb 100644 --- a/mb/index.html +++ b/mb/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/maa/index.html b/mb/maa/index.html index 0c01b195..a753f171 100644 --- a/mb/maa/index.html +++ b/mb/maa/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/maa/lec1/index.html b/mb/maa/lec1/index.html index d4246495..e303abd9 100644 --- a/mb/maa/lec1/index.html +++ b/mb/maa/lec1/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/maa/lec2/index.html b/mb/maa/lec2/index.html index 3e5103d7..ffaf9bc3 100644 --- a/mb/maa/lec2/index.html +++ b/mb/maa/lec2/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/maa/lec3/index.html b/mb/maa/lec3/index.html index 78f8e86b..77f76055 100644 --- a/mb/maa/lec3/index.html +++ b/mb/maa/lec3/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/optimization-theory/index.html b/mb/optimization-theory/index.html index 694cf06a..a9780d89 100644 --- a/mb/optimization-theory/index.html +++ b/mb/optimization-theory/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/optimization-theory/lec1/index.html b/mb/optimization-theory/lec1/index.html index d702425f..fa9d05b9 100644 --- a/mb/optimization-theory/lec1/index.html +++ b/mb/optimization-theory/lec1/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/optimization-theory/lec2/index.html b/mb/optimization-theory/lec2/index.html index d5b19367..58f6ff69 100644 --- a/mb/optimization-theory/lec2/index.html +++ b/mb/optimization-theory/lec2/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/mb/optimization-theory/lec3/index.html b/mb/optimization-theory/lec3/index.html index 188d0a67..b4c09abe 100644 --- a/mb/optimization-theory/lec3/index.html +++ b/mb/optimization-theory/lec3/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/redirection.html b/redirection.html index 070ca60e..d22160c5 100644 --- a/redirection.html +++ b/redirection.html @@ -2335,6 +2335,8 @@ + + @@ -2376,6 +2378,20 @@ +
  • + + 4DGS + +
  • + + + + + + + + +
  • SplaTAM @@ -2391,8 +2407,8 @@
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/search/search_index.json b/search/search_index.json index b7c8640d..2cbb2181 100644 --- a/search/search_index.json +++ b/search/search_index.json @@ -1 +1 @@ -{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"o(\u3003'\u25bd'\u3003)o Hi! \u00b6 \u8fd9\u91cc\u662f\u72d9\u51fb\u7f8e\u4f50\uff08jujimeizuo\uff09\u7684\u4e2a\u4eba\u7b14\u8bb0\u672c\u54e6\uff01 \u6700\u8fd1\u66f4\u65b0 / \u670b\u53cb\u4eec! / \u7ad9\u70b9\u7edf\u8ba1 \u9875\u9762\u603b\u6570\uff1a132 \u603b\u5b57\u6570\uff1a158177 \u4ee3\u7801\u5757\u884c\u6570\uff1a3423 \u7f51\u7ad9\u8fd0\u884c\u65f6\u95f4\uff1a function updateTime() { var date = new Date(); var now = date.getTime(); var startDate = new Date(\"2023/08/026 17:26:00\"); var start = startDate.getTime(); var diff = now - start; var y, d, h, m; y = Math.floor(diff / (365 * 24 * 3600 * 1000)); diff -= y * 365 * 24 * 3600 * 1000; d = Math.floor(diff / (24 * 3600 * 1000)); h = Math.floor(diff / (3600 * 1000) % 24); m = Math.floor(diff / (60 * 1000) % 60); if (y == 0) { document.getElementById(\"web-time\").innerHTML = d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } else { document.getElementById(\"web-time\").innerHTML = y + \" \u5e74 \" + d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } setTimeout(updateTime, 1000 * 60); } updateTime(); function toggle_statistics() { var statistics = document.getElementById(\"statistics\"); if (statistics.style.opacity == 0) { statistics.style.opacity = 1; } else { statistics.style.opacity = 0; } }","title":"o(\u3003'\u25bd'\u3003)o Hi!"},{"location":"#oo-hi","text":"\u8fd9\u91cc\u662f\u72d9\u51fb\u7f8e\u4f50\uff08jujimeizuo\uff09\u7684\u4e2a\u4eba\u7b14\u8bb0\u672c\u54e6\uff01 \u6700\u8fd1\u66f4\u65b0 / \u670b\u53cb\u4eec! / \u7ad9\u70b9\u7edf\u8ba1 \u9875\u9762\u603b\u6570\uff1a132 \u603b\u5b57\u6570\uff1a158177 \u4ee3\u7801\u5757\u884c\u6570\uff1a3423 \u7f51\u7ad9\u8fd0\u884c\u65f6\u95f4\uff1a function updateTime() { var date = new Date(); var now = date.getTime(); var startDate = new Date(\"2023/08/026 17:26:00\"); var start = startDate.getTime(); var diff = now - start; var y, d, h, m; y = Math.floor(diff / (365 * 24 * 3600 * 1000)); diff -= y * 365 * 24 * 3600 * 1000; d = Math.floor(diff / (24 * 3600 * 1000)); h = Math.floor(diff / (3600 * 1000) % 24); m = Math.floor(diff / (60 * 1000) % 60); if (y == 0) { document.getElementById(\"web-time\").innerHTML = d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } else { document.getElementById(\"web-time\").innerHTML = y + \" \u5e74 \" + d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } setTimeout(updateTime, 1000 * 60); } updateTime(); function toggle_statistics() { var statistics = document.getElementById(\"statistics\"); if (statistics.style.opacity == 0) { statistics.style.opacity = 1; } else { statistics.style.opacity = 0; } }","title":"o(\u3003'\u25bd'\u3003)o Hi!"},{"location":"changelog/","text":"\u66f4\u65b0\u8bb0\u5f55 \u00b6 Abstract PS\uff1a\u8fd9\u4e2a\u529f\u80fd\u5728\u7531 TonyCrane/mkdocs-changelog-plugin \u5f00\u53d1\u3002 .md-typeset h2 { margin-top: 0em; } 2024 \u00b6 2024-10-9 \u00b6 CV > SLAM > 4DGS 2024-10-5 \u00b6 CV > SLAM > SplaTAM 2024-9-27 \u00b6 Utils > ffmpeg 2024-9-26 \u00b6 add Experiments Section 2024-9-25 \u00b6 adjust the structure of slam CV > SLAM > 3DGS 2024-9-19 \u00b6 CV > SLAM > NeRF 2024-9-18 \u00b6 CV > SLAM > NeRF-Evaluation 2024-8-8 \u00b6 CV > SLAM > NICE-SLAM 2024-8-3 \u00b6 CV > SLAM > iMAP 2024-7-29 \u00b6 CV > SLAM > NID-SLAM 2024-7-8 \u00b6 CV > SLAM > EndoscpoyDepthEstimation 2024-6-26 \u00b6 CV > SLAM > DeepV2D 2024-6-21 \u00b6 CV > SLAM > Co-SLAM 2024-6-6 \u00b6 CV > SLAM > DDN-SLAM 2024-5-29 \u00b6 CV > Dataset > Waymo 2024-5-29 \u00b6 CV > Dataset > KITTI 2024-5-28 \u00b6 cp -r pcr prd/ 2024-5-17 \u00b6 CV > SLAM > LET-NET 2024-5-15 \u00b6 CV > SLAM > Crowd-SLAM 2024-4-4 \u00b6 CV > SLAM > RigidFusion 2024-3-27 \u00b6 CV > SLAM > Detect-SLAM 2024-3-26 \u00b6 CV > SLAM > FlowFusion 2024-3-20 \u00b6 CV > SLAM > DS-SLAM 2024-3-20 \u00b6 CV > SLAM > DynaSLAM 2024-3-20 \u00b6 CV > SLAM > ORB-SLAM2 2024-3-20 \u00b6 CV > Dataset > TUM 2024-1-24 \u00b6 LLM & LVM > Transformer > ViT 2024-1-22 \u00b6 CS > HPC > MPI \u57fa\u7840 2024-1-20 \u00b6 CS > HPC > OpenMP \u57fa\u7840 2024-1-20 \u00b6 LLM & LVM > InternLM > OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 2024-1-18 \u00b6 LLM & LVM > InternLM > LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 2024-1-11 \u00b6 LLM & LVM > InternLM > XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2024-1-8 \u00b6 LLM & LVM > InternLM > \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 2024-1-4 \u00b6 LLM & LVM > InternLM > \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 2024-1-3 \u00b6 LLM & LVM > InternLM > \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb 2023 \u00b6 2023-12-18 \u00b6 LLM & LVM > \u6742\u9879 > \u5206\u5e03\u5f0f\u8bad\u7ec3 2023-12-14 \u00b6 LLM & LVM > \u6742\u9879 > Prompt 2023-12-13 \u00b6 LLM & LVM > Transformer > BERT 2023-12-10 \u00b6 LLM & LVM > Transformer > Transformer 2023-12-09 \u00b6 LLM & LVM > Transformer > attention 2023-12-08 \u00b6 LLM & LVM > NLP > RNNs 2023-12-07 \u00b6 LLM & LVM > NLP > Word2Vec 2023-12-05 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > ICP 2023-12-04 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > \u524d\u7f6e\u77e5\u8bc6 2023-12-03 \u00b6 CV & Robot > \u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316 2023-10-09 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 2023-10-06 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2023-10-05 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5355\u89c6\u56fe\u51e0\u4f55 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 2023-10-04 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u6a21\u578b CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 2023-10-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 CV & Robot > SLAM > \u89c6\u89c9 SLAM \u5341\u56db\u8bb2 > \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 2023-09-30 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 3D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-17 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u76f4\u7ebf\u641c\u7d22 2023-09-24 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Python > Numpy 2023-09-22 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u673a\u5668\u5b66\u4e60 2023-09-17 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u6a21\u5f0f\u8bc6\u522b 2023-09-16 \u00b6 \u6570\u7406\u57fa\u7840 > \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 > \u77e9\u9635\u4ee3\u6570\u57fa\u7840 2023-09-13 \u00b6 CS > \u8f6f\u4ef6\u76f8\u5173 > \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 CS > \u8f6f\u4ef6\u76f8\u5173 > COM \u539f\u7406\u4e0e\u5e94\u7528 2023-09-12 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 CS > \u7b97\u6cd5\u76f8\u5173 > \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 2023-09-11 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u6700\u4f18\u5316\u95ee\u9898 2023-09-10 \u00b6 Utils > \u7ad9\u70b9\u751f\u6210\u5de5\u5177 > reveal-md 2023-09-09 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Go > Go \u8bed\u6cd5\u57fa\u7840 2023-09-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 2D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-01 \u00b6 Utils > \u5de5\u5177\u6536\u96c6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Docker \u547d\u4ee4\u76f8\u5173 \u65b0\u589e awesome_git_log \u547d\u4ee4 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Shell \u547d\u4ee4\u76f8\u5173 2023-08-30 \u00b6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > gdb \u547d\u4ee4\u76f8\u5173 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Git \u547d\u4ee4\u76f8\u5173 2023-08-26 \u00b6 init notebook","title":"\u66f4\u65b0\u8bb0\u5f55"},{"location":"changelog/#_1","text":"Abstract PS\uff1a\u8fd9\u4e2a\u529f\u80fd\u5728\u7531 TonyCrane/mkdocs-changelog-plugin \u5f00\u53d1\u3002 .md-typeset h2 { margin-top: 0em; }","title":"\u66f4\u65b0\u8bb0\u5f55"},{"location":"changelog/#2024","text":"2024-10-9 \u00b6 CV > SLAM > 4DGS 2024-10-5 \u00b6 CV > SLAM > SplaTAM 2024-9-27 \u00b6 Utils > ffmpeg 2024-9-26 \u00b6 add Experiments Section 2024-9-25 \u00b6 adjust the structure of slam CV > SLAM > 3DGS 2024-9-19 \u00b6 CV > SLAM > NeRF 2024-9-18 \u00b6 CV > SLAM > NeRF-Evaluation 2024-8-8 \u00b6 CV > SLAM > NICE-SLAM 2024-8-3 \u00b6 CV > SLAM > iMAP 2024-7-29 \u00b6 CV > SLAM > NID-SLAM 2024-7-8 \u00b6 CV > SLAM > EndoscpoyDepthEstimation 2024-6-26 \u00b6 CV > SLAM > DeepV2D 2024-6-21 \u00b6 CV > SLAM > Co-SLAM 2024-6-6 \u00b6 CV > SLAM > DDN-SLAM 2024-5-29 \u00b6 CV > Dataset > Waymo 2024-5-29 \u00b6 CV > Dataset > KITTI 2024-5-28 \u00b6 cp -r pcr prd/ 2024-5-17 \u00b6 CV > SLAM > LET-NET 2024-5-15 \u00b6 CV > SLAM > Crowd-SLAM 2024-4-4 \u00b6 CV > SLAM > RigidFusion 2024-3-27 \u00b6 CV > SLAM > Detect-SLAM 2024-3-26 \u00b6 CV > SLAM > FlowFusion 2024-3-20 \u00b6 CV > SLAM > DS-SLAM 2024-3-20 \u00b6 CV > SLAM > DynaSLAM 2024-3-20 \u00b6 CV > SLAM > ORB-SLAM2 2024-3-20 \u00b6 CV > Dataset > TUM 2024-1-24 \u00b6 LLM & LVM > Transformer > ViT 2024-1-22 \u00b6 CS > HPC > MPI \u57fa\u7840 2024-1-20 \u00b6 CS > HPC > OpenMP \u57fa\u7840 2024-1-20 \u00b6 LLM & LVM > InternLM > OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 2024-1-18 \u00b6 LLM & LVM > InternLM > LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 2024-1-11 \u00b6 LLM & LVM > InternLM > XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2024-1-8 \u00b6 LLM & LVM > InternLM > \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 2024-1-4 \u00b6 LLM & LVM > InternLM > \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 2024-1-3 \u00b6 LLM & LVM > InternLM > \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb","title":"2024"},{"location":"changelog/#2023","text":"2023-12-18 \u00b6 LLM & LVM > \u6742\u9879 > \u5206\u5e03\u5f0f\u8bad\u7ec3 2023-12-14 \u00b6 LLM & LVM > \u6742\u9879 > Prompt 2023-12-13 \u00b6 LLM & LVM > Transformer > BERT 2023-12-10 \u00b6 LLM & LVM > Transformer > Transformer 2023-12-09 \u00b6 LLM & LVM > Transformer > attention 2023-12-08 \u00b6 LLM & LVM > NLP > RNNs 2023-12-07 \u00b6 LLM & LVM > NLP > Word2Vec 2023-12-05 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > ICP 2023-12-04 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > \u524d\u7f6e\u77e5\u8bc6 2023-12-03 \u00b6 CV & Robot > \u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316 2023-10-09 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 2023-10-06 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2023-10-05 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5355\u89c6\u56fe\u51e0\u4f55 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 2023-10-04 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u6a21\u578b CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 2023-10-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 CV & Robot > SLAM > \u89c6\u89c9 SLAM \u5341\u56db\u8bb2 > \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 2023-09-30 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 3D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-17 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u76f4\u7ebf\u641c\u7d22 2023-09-24 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Python > Numpy 2023-09-22 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u673a\u5668\u5b66\u4e60 2023-09-17 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u6a21\u5f0f\u8bc6\u522b 2023-09-16 \u00b6 \u6570\u7406\u57fa\u7840 > \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 > \u77e9\u9635\u4ee3\u6570\u57fa\u7840 2023-09-13 \u00b6 CS > \u8f6f\u4ef6\u76f8\u5173 > \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 CS > \u8f6f\u4ef6\u76f8\u5173 > COM \u539f\u7406\u4e0e\u5e94\u7528 2023-09-12 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 CS > \u7b97\u6cd5\u76f8\u5173 > \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 2023-09-11 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u6700\u4f18\u5316\u95ee\u9898 2023-09-10 \u00b6 Utils > \u7ad9\u70b9\u751f\u6210\u5de5\u5177 > reveal-md 2023-09-09 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Go > Go \u8bed\u6cd5\u57fa\u7840 2023-09-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 2D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-01 \u00b6 Utils > \u5de5\u5177\u6536\u96c6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Docker \u547d\u4ee4\u76f8\u5173 \u65b0\u589e awesome_git_log \u547d\u4ee4 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Shell \u547d\u4ee4\u76f8\u5173 2023-08-30 \u00b6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > gdb \u547d\u4ee4\u76f8\u5173 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Git \u547d\u4ee4\u76f8\u5173 2023-08-26 \u00b6 init notebook","title":"2023"},{"location":"links/","text":"\u53cb\u94fe \u00b6 Abstract \u4e00\u4e9b\u670b\u53cb\u4eec\u7684\u7b14\u8bb0\u672c\uff01 \u9e64\u7fd4\u4e07\u91cc\u7684\u7b14\u8bb0\u672c \u975e\u5e38\u5389\u5bb3\u7684\uff08\u6d59\u5927\uff09\u5927\u4f6c","title":"\u53cb\u94fe"},{"location":"links/#_1","text":"Abstract \u4e00\u4e9b\u670b\u53cb\u4eec\u7684\u7b14\u8bb0\u672c\uff01 \u9e64\u7fd4\u4e07\u91cc\u7684\u7b14\u8bb0\u672c \u975e\u5e38\u5389\u5bb3\u7684\uff08\u6d59\u5927\uff09\u5927\u4f6c","title":"\u53cb\u94fe"},{"location":"todo/","text":"\u4ee3\u529e\u4e8b\u9879 \u00b6 \u7b14\u8bb0\u7c7b \u00b6","title":"\u4ee3\u529e\u4e8b\u9879"},{"location":"todo/#_1","text":"","title":"\u4ee3\u529e\u4e8b\u9879"},{"location":"todo/#_2","text":"","title":"\u7b14\u8bb0\u7c7b"},{"location":"cs/","text":"Computer Science \u00b6 Abstract \u8fd9\u91cc\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u7f16\u7a0b\u8bed\u8a00 C/C++ 13673 123 46 mins 1696750316 Java 3624 196 15 mins 1696750316 Python 8344 379 33 mins 1695693389 Go 3109 158 12 mins 1693968663 \u7b97\u6cd5\u76f8\u5173 \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 880 4 3 mins 1694529146 \u57fa\u7840\u6570\u636e\u7ed3\u6784 0 0 mins 1694405747 \u4eba\u5de5\u667a\u80fd\u57fa\u7840 \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 1192 4 mins 1698116017 \u673a\u5668\u5b66\u4e60 3054 4 10 mins 1697810855 \u6a21\u5f0f\u8bc6\u522b 3657 12 mins 1697363454 \u9ad8\u6027\u80fd\u8ba1\u7b97 MPI \u57fa\u7840 2268 196 10 mins 1705904815 OpenMP \u57fa\u7840 1767 38 6 mins 1705758864 \u6982\u8bba 568 24 2 mins 1695215167 \u5411\u91cf\u5316\u8ba1\u7b97 5 0 mins 1695215167 GPU \u7f16\u7a0b 3 0 mins 1695215167 \u8f6f\u4ef6\u76f8\u5173 COM \u539f\u7406\u4e0e\u5e94\u7528 1112 4 mins 1697007017 \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 5148 17 mins 1696920634 \u8bbe\u8ba1\u6a21\u5f0f 2116 496 13 mins 1695204141 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0 0 0 mins 1695089803 \u6570\u636e\u5e93 MySQL 5224 14 18 mins 1694949283 Redis 1787 102 7 mins 1694949283 \u6742\u9879 RegEx \u6b63\u5219\u8868\u8fbe\u5f0f 2402 4 8 mins 1694699468 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Computer Science"},{"location":"cs/#computer-science","text":"Abstract \u8fd9\u91cc\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0","title":"Computer Science"},{"location":"cs/#table-of-contents","text":"\u7f16\u7a0b\u8bed\u8a00 C/C++ 13673 123 46 mins 1696750316 Java 3624 196 15 mins 1696750316 Python 8344 379 33 mins 1695693389 Go 3109 158 12 mins 1693968663 \u7b97\u6cd5\u76f8\u5173 \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 880 4 3 mins 1694529146 \u57fa\u7840\u6570\u636e\u7ed3\u6784 0 0 mins 1694405747 \u4eba\u5de5\u667a\u80fd\u57fa\u7840 \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 1192 4 mins 1698116017 \u673a\u5668\u5b66\u4e60 3054 4 10 mins 1697810855 \u6a21\u5f0f\u8bc6\u522b 3657 12 mins 1697363454 \u9ad8\u6027\u80fd\u8ba1\u7b97 MPI \u57fa\u7840 2268 196 10 mins 1705904815 OpenMP \u57fa\u7840 1767 38 6 mins 1705758864 \u6982\u8bba 568 24 2 mins 1695215167 \u5411\u91cf\u5316\u8ba1\u7b97 5 0 mins 1695215167 GPU \u7f16\u7a0b 3 0 mins 1695215167 \u8f6f\u4ef6\u76f8\u5173 COM \u539f\u7406\u4e0e\u5e94\u7528 1112 4 mins 1697007017 \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 5148 17 mins 1696920634 \u8bbe\u8ba1\u6a21\u5f0f 2116 496 13 mins 1695204141 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0 0 0 mins 1695089803 \u6570\u636e\u5e93 MySQL 5224 14 18 mins 1694949283 Redis 1787 102 7 mins 1694949283 \u6742\u9879 RegEx \u6b63\u5219\u8868\u8fbe\u5f0f 2402 4 8 mins 1694699468 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"cs/ai/dl/","text":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 \u00b6 \u7ea6 1188 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u90b1\u9521\u9e4f\u8001\u5e08 \u7684\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff0c\u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u7b14\u8bb0\u3002 \u6982\u8ff0 \u00b6 \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\u662f\u4eba\u5de5\u667a\u80fd\u7684\u4e00\u4e2a\u5b50\u9886\u57df \u795e\u7ecf\u7f51\u7edc\uff1a\u4e00\u79cd\u4ee5\uff08\u4eba\u5de5\uff09\u795e\u7ecf\u5143\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b \u6df1\u5ea6\u5b66\u4e60\uff1a\u4e00\u7c7b\u673a\u5668\u5b66\u4e60\u95ee\u9898\uff0c\u4e3b\u8981\u89e3\u51b3\u8d21\u732e\u5ea6\u5206\u914d\u95ee\u9898\u3002 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc \u00b6 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u4e3b\u8981\u7531\u5927\u91cf\u7684\u795e\u7ecf\u5143\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u6709\u5411\u8fde\u63a5\u6784\u6210\u3002\u56e0\u6b64\u8003\u8651\u4e09\u65b9\u9762 \u795e\u7ecf\u5143\u7684\u6fc0\u6d3b\u89c4\u5219 \uff1a\u4e3b\u8981\u662f\u6307\u795e\u7ecf\u5143\u8f93\u5165\u5230\u8f93\u51fa\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u4e00\u822c\u4e3a\u975e\u7ebf\u6027\u51fd\u6570 \u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784 \uff1a\u4e0d\u540c\u795e\u7ecf\u5143\u4e4b\u95f4\u7684\u94fe\u63a5\u5173\u7cfb \u5b66\u4e60\u7b97\u6cd5 \uff1a\u901a\u8fc7\u8bad\u7ec3\u6570\u636e\u6765\u5b66\u4e60\u795e\u7ecf\u7f51\u7edc\u7684\u53c2\u6570 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u7531\u795e\u7ecf\u5143\u6a21\u578b\u6784\u6210\uff0c\u8fd9\u79cd\u7531\u8bb8\u591a\u795e\u7ecf\u5143\u7ec4\u6210\u7684\u4fe1\u606f\u5904\u7406\u7f51\u7edc\u5177\u6709\u5e76\u884c\u5206\u5e03\u7ed3\u6784 \u524d\u9988\u795e\u7ecf\u7f51\u7edc \u00b6 \u7f51\u7edc\u7ed3\u6784 \u00b6 \u5728\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u4e2d\uff0c\u5404\u795e\u7ecf\u5143\u5206\u522b\u5c5e\u4e8e\u4e0d\u540c\u7684\u5c42\u3002\u6574\u4e2a\u7f51\u7edc\u4e2d\u65e0\u53cd\u9988\uff0c\u4fe1\u53f7\u4ece\u8f93\u5165\u5c42\u5411\u8f93\u51fa\u5c42\u5355\u5411\u4f20\u64ad\uff0c\u53ef\u7528\u4e00\u4e2a\u6709\u5411\u65e0\u73af\u56fe\u8868\u793a \u901a\u7528\u8fd1\u4f3c\u5b9a\u7406 \u00b6 \u5bf9\u4e8e\u5177\u6709 \u7ebf\u6027\u8f93\u51fa\u5c42 \u548c\u81f3\u5c11\u4e00\u4e2a\u4f7f\u7528\u201d\u6324\u538b\u201c\u6027\u8d28\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u9690\u85cf\u5c42\u7ec4\u6210\u7684\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u3002\u53ea\u8981\u5176\u9690\u85cf\u5c42\u795e\u7ecf\u5143\u7684\u6570\u91cf\u8db3\u591f\uff0c\u5b83\u53ef\u4ee5\u4ee5 \u4efb\u610f\u7cbe\u5ea6 \u6765\u8fd1\u4f3c\u4efb\u4f55\u4ece\u4e00\u4e2a\u5b9a\u4e49\u5728 \u5b9e\u6570\u7a7a\u95f4 \u4e2d\u7684 \u6709\u754c\u95ed\u96c6\u51fd\u6570 \u5e94\u7528\u5230\u673a\u5668\u5b66\u4e60 \u00b6 \u6a21\u578b\uff1a \\(y=f^5(f^4(f^3(f^2(f^1(x)))))\\) \u5b66\u4e60\u51c6\u5219\uff1a \\(L(y,y^*)\\) \u4f18\u5316\uff08\u68af\u5ea6\u4e0b\u964d\uff09\uff1a \\(\\frac{\\partial L(y,y^*)}{\\partial f^1} = \\frac{\\partial f^2}{\\partial f^1} \\times \\frac{\\partial f^3}{\\partial f^2} \\times \\frac{\\partial f^4}{\\partial f^3} \\times \\frac{\\partial f^5}{\\partial f^4} \\times \\frac{\\partial L(y,y^*)}{\\partial f^5}\\) \u8ba1\u7b97\u56fe\u4e0e\u81ea\u52a8\u5fae\u5206 \u00b6 \u590d\u5408\u51fd\u6570 \\(f(x;w,b)=\\sigma(wx+b)\\) \u7684\u8ba1\u7b97\u56fe \u94fe\u5f0f\u6cd5\u5219\uff1a \\(\\frac{\\partial f(x;w,b)}{\\partial w}=\\frac{\\partial f(x;w,b)}{\\partial h_6} \\frac{\\partial h_6}{\\partial h_5} \\frac{\\partial h_5}{\\partial h_4} \\frac{\\partial h_4}{\\partial h_3} \\frac{\\partial h_3}{\\partial h_2} \\frac{\\partial h_2}{\\partial h_1} \\frac{\\partial h_1}{\\partial w}\\) \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u53ea\u662f\u81ea\u52a8\u5fae\u5206\u7684\u4e00\u79cd\u7279\u6b8a\u5f62\u5f0f \u4f18\u5316\u95ee\u9898 \u00b6 \u975e\u51f8\u4f18\u5316\u95ee\u9898 \uff1a \\(y=\\sigma(w \\ 2 \\ \\sigma(w \\ 1 \\ x))\\) \u7684\u635f\u5931\u51fd\u6570 \u68af\u5ea6\u6d88\u5931\u95ee\u9898 \uff1a\u5728\u6bcf\u4e00\u5c42\u90fd\u8981\u4e58\u4ee5\u8be5\u5c42\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u5bfc\u6570 \u6fc0\u6d3b\u51fd\u6570 \u00b6 \u6709\u6548\u51cf\u8f7b\u68af\u5ea6\u6d88\u5931\u95ee\u9898 \u5377\u79ef\u795e\u7ecf\u7f51\u7edc \u00b6 \u5377\u79ef \u00b6 \u5377\u79ef\u7ecf\u5e38\u7528\u5728\u4fe1\u53f7\u5904\u7406\u4e2d\uff0c\u7528\u4e8e\u8ba1\u7b97\u4fe1\u53f7\u7684\u5ef6\u8fdf\u7d2f\u79ef \u5047\u8bbe\u4e00\u4e2a\u4fe1\u53f7\u53d1\u751f\u5668\u6bcf\u4e2a\u65f6\u523b t \u4ea7\u751f\u4e00\u4e2a\u4fe1\u53f7 \\(x_t\\) \uff0c\u5176\u4fe1\u53f7\u7684\u8870\u51cf\u7387\u4e3a \\(w_k\\) \uff0c\u5373\u5728 k-1 \u4e2a\u65f6\u95f4\u6b65\u957f\u540e\uff0c\u4fe1\u606f\u4e3a\u539f\u6765\u7684 \\(w_k\\) \u500d\uff0c\u5047\u8bbe \\(w_1=1,w_2=1/2,w_3=1/4\\) \u65f6\u523b t \u6536\u5230\u7684\u4fe1\u53f7 \\(y_t\\) \u4e3a\u5f53\u524d\u65f6\u523b\u4ea7\u751f\u7684\u4fe1\u606f\u548c\u4ee5\u524d\u65f6\u523b\u5ef6\u8fdf\u4fe1\u606f\u7684\u53e0\u52a0 \u5373 \\(y_t=w_1 \\times x_t+w_2 \\times x_{t-1}+w_3 \\times x_{t-2}=\\sum_{k=1}^3w_k \\cdot x_{t-k+1}\\) \uff0c \\(y_t\\) \u79f0\u4e3a\u6ee4\u6ce2\u5668\u6216\u5377\u79ef\u6838 \u4e00\u7ef4\u5377\u79ef \u00b6 \u4e8c\u4f4d\u5377\u79ef \u00b6 \u4f5c\u7528 \u00b6 \u5377\u79ef\u4f5c\u4e3a\u7279\u5f81\u63d0\u53d6\u5668 \u5377\u79ef\u4ee3\u66ff\u5168\u8fde\u63a5 \u53ef\u4ee5\u5f15\u5165\u591a\u7ec4\u6ee4\u6ce2\u5668 \u5377\u79ef\u5c42 \u5178\u578b\u7684\u5377\u79ef\u5c42\u4e3a 3 \u7ef4\u7ed3\u6784 \u6c47\u805a\u5c42 \u5377\u79ef\u5c42\u867d\u7136\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u8fde\u63a5\u7684\u4e2a\u6570\uff0c\u4f46\u662f\u6bcf\u4e00\u4e2a\u7279\u5f81\u6620\u5c04\u7684\u795e\u7ecf\u5143\u4e2a\u6570\u5e76\u6ca1\u6709\u663e\u8457\u51cf\u5c11 \u5377\u79ef\u7f51\u7edc\u7ed3\u6784 \u00b6 \u5377\u79ef\u7f51\u7edc\u662f\u7531\u5377\u79ef\u5c42\u3001\u5b50\u91c7\u6837\u5c42\u3001\u5168\u8fde\u63a5\u5c42\u4ea4\u53c9\u5806\u53e0\u800c\u6210 \u8d8b\u5411\u4e8e\u5c0f\u5377\u79ef\u3001\u5927\u6df1\u5ea6 \u8d8b\u5411\u4e8e\u5168\u5377\u79ef \u4e00\u4e2a\u5377\u79ef\u5757\u4e3a\u8fde\u7eed\u4e2a M \u4e2a\u5377\u79ef\u5c42\u548c b \u4e2a\u6c47\u805a\u5c42\uff08M \u901a\u5e38\u8bbe\u7f6e\u4e3a 2-5\uff0cb \u4e3a 0 \u6216 1\uff09\u3002\u4e00\u4e2a\u5377\u79ef\u7f51\u7edc\u4e2d\u53ef\u4ee5\u5806\u53e0 N \u4e2a\u8fde\u7eed\u7684\u5377\u79ef\u5757\uff0c\u7136\u540e\u5728\u63a5\u7740 K \u4e2a\u5168\u8fde\u63a5\u5c42\uff08N \u7684\u53d6\u503c\u533a\u95f4\u6bd4\u8f83\u5927\uff0c\u6bd4\u5982 1-100 \u6216\u8005\u66f4\u5927\uff1bK \u4e00\u822c\u4e3a 0-2\uff09 \u8f6c\u7f6e\u5377\u79ef/\u5fae\u6b65\u5377\u79ef \u00b6 \u4f4e\u7ef4\u7279\u5f81\u6620\u5c04\u5230\u9ad8\u7ef4\u7279\u5f81 \u7a7a\u6d1e\u5377\u79ef \u00b6 \u5982\u4f55\u589e\u52a0\u8f93\u51fa\u5355\u4f4d\u7684\u611f\u53d7\u91ce \u589e\u52a0\u5377\u79ef\u6838\u7684\u5927\u5c0f \u589e\u52a0\u5c42\u6570\u6765\u5b9e\u73b0 \u5728\u5377\u79ef\u4e4b\u524d\u8fdb\u884c\u6c47\u805a\u64cd\u4f5c \u7a7a\u6d1e\u5377\u79ef\u901a\u8fc7\u7ed9\u5377\u79ef\u6838\u63d2\u5165\u201c\u7a7a\u6d1e\u201d\u6765\u53d8\u76f8\u5730\u589e\u52a0\u5176\u5927\u5c0f \u7b80\u5355\u7684\u6b8b\u5dee\u5355\u5143\u7ed3\u6784 \u00b6 \\[ h(\\mathbf{x})=\\mathbf{x}+(h(\\mathbf{x})-\\mathbf{x}) \\\\ \\mathbf{x} \u4e3a\u6052\u7b49\u51fd\u6570\uff0ch(\\mathbf{x})-\\mathbf{x} \u4e3a\u6b8b\u5dee\u51fd\u6570 f(\\mathbf{x}, \\theta) \\] \u5e94\u7528 \u00b6 AlphaGo Mask RCNN \u56fe\u50cf\u751f\u6210 Deep Dream \u753b\u98ce\u8fc1\u79fb \u5bf9\u6297\u6837\u672c Reference \u00b6 \u90b1\u9521\u9e4f,\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60,\u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e, 2020\uff0cISBN 9787111649687 \u963f\u65af\u987f\u00b7\u5f20\u7b49,\u52a8\u624b\u5b66\u6df1\u5ea6\u5b66\u4e60, ISBN: 9787115505835","title":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60"},{"location":"cs/ai/dl/#_1","text":"\u7ea6 1188 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u90b1\u9521\u9e4f\u8001\u5e08 \u7684\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff0c\u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u7b14\u8bb0\u3002","title":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60"},{"location":"cs/ai/dl/#_2","text":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\u662f\u4eba\u5de5\u667a\u80fd\u7684\u4e00\u4e2a\u5b50\u9886\u57df \u795e\u7ecf\u7f51\u7edc\uff1a\u4e00\u79cd\u4ee5\uff08\u4eba\u5de5\uff09\u795e\u7ecf\u5143\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b \u6df1\u5ea6\u5b66\u4e60\uff1a\u4e00\u7c7b\u673a\u5668\u5b66\u4e60\u95ee\u9898\uff0c\u4e3b\u8981\u89e3\u51b3\u8d21\u732e\u5ea6\u5206\u914d\u95ee\u9898\u3002","title":"\u6982\u8ff0"},{"location":"cs/ai/dl/#_3","text":"\u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u4e3b\u8981\u7531\u5927\u91cf\u7684\u795e\u7ecf\u5143\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u6709\u5411\u8fde\u63a5\u6784\u6210\u3002\u56e0\u6b64\u8003\u8651\u4e09\u65b9\u9762 \u795e\u7ecf\u5143\u7684\u6fc0\u6d3b\u89c4\u5219 \uff1a\u4e3b\u8981\u662f\u6307\u795e\u7ecf\u5143\u8f93\u5165\u5230\u8f93\u51fa\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u4e00\u822c\u4e3a\u975e\u7ebf\u6027\u51fd\u6570 \u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784 \uff1a\u4e0d\u540c\u795e\u7ecf\u5143\u4e4b\u95f4\u7684\u94fe\u63a5\u5173\u7cfb \u5b66\u4e60\u7b97\u6cd5 \uff1a\u901a\u8fc7\u8bad\u7ec3\u6570\u636e\u6765\u5b66\u4e60\u795e\u7ecf\u7f51\u7edc\u7684\u53c2\u6570 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u7531\u795e\u7ecf\u5143\u6a21\u578b\u6784\u6210\uff0c\u8fd9\u79cd\u7531\u8bb8\u591a\u795e\u7ecf\u5143\u7ec4\u6210\u7684\u4fe1\u606f\u5904\u7406\u7f51\u7edc\u5177\u6709\u5e76\u884c\u5206\u5e03\u7ed3\u6784","title":"\u4eba\u5de5\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/dl/#_4","text":"","title":"\u524d\u9988\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/dl/#_5","text":"\u5728\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u4e2d\uff0c\u5404\u795e\u7ecf\u5143\u5206\u522b\u5c5e\u4e8e\u4e0d\u540c\u7684\u5c42\u3002\u6574\u4e2a\u7f51\u7edc\u4e2d\u65e0\u53cd\u9988\uff0c\u4fe1\u53f7\u4ece\u8f93\u5165\u5c42\u5411\u8f93\u51fa\u5c42\u5355\u5411\u4f20\u64ad\uff0c\u53ef\u7528\u4e00\u4e2a\u6709\u5411\u65e0\u73af\u56fe\u8868\u793a","title":"\u7f51\u7edc\u7ed3\u6784"},{"location":"cs/ai/dl/#_6","text":"\u5bf9\u4e8e\u5177\u6709 \u7ebf\u6027\u8f93\u51fa\u5c42 \u548c\u81f3\u5c11\u4e00\u4e2a\u4f7f\u7528\u201d\u6324\u538b\u201c\u6027\u8d28\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u9690\u85cf\u5c42\u7ec4\u6210\u7684\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u3002\u53ea\u8981\u5176\u9690\u85cf\u5c42\u795e\u7ecf\u5143\u7684\u6570\u91cf\u8db3\u591f\uff0c\u5b83\u53ef\u4ee5\u4ee5 \u4efb\u610f\u7cbe\u5ea6 \u6765\u8fd1\u4f3c\u4efb\u4f55\u4ece\u4e00\u4e2a\u5b9a\u4e49\u5728 \u5b9e\u6570\u7a7a\u95f4 \u4e2d\u7684 \u6709\u754c\u95ed\u96c6\u51fd\u6570","title":"\u901a\u7528\u8fd1\u4f3c\u5b9a\u7406"},{"location":"cs/ai/dl/#_7","text":"\u6a21\u578b\uff1a \\(y=f^5(f^4(f^3(f^2(f^1(x)))))\\) \u5b66\u4e60\u51c6\u5219\uff1a \\(L(y,y^*)\\) \u4f18\u5316\uff08\u68af\u5ea6\u4e0b\u964d\uff09\uff1a \\(\\frac{\\partial L(y,y^*)}{\\partial f^1} = \\frac{\\partial f^2}{\\partial f^1} \\times \\frac{\\partial f^3}{\\partial f^2} \\times \\frac{\\partial f^4}{\\partial f^3} \\times \\frac{\\partial f^5}{\\partial f^4} \\times \\frac{\\partial L(y,y^*)}{\\partial f^5}\\)","title":"\u5e94\u7528\u5230\u673a\u5668\u5b66\u4e60"},{"location":"cs/ai/dl/#_8","text":"\u590d\u5408\u51fd\u6570 \\(f(x;w,b)=\\sigma(wx+b)\\) \u7684\u8ba1\u7b97\u56fe \u94fe\u5f0f\u6cd5\u5219\uff1a \\(\\frac{\\partial f(x;w,b)}{\\partial w}=\\frac{\\partial f(x;w,b)}{\\partial h_6} \\frac{\\partial h_6}{\\partial h_5} \\frac{\\partial h_5}{\\partial h_4} \\frac{\\partial h_4}{\\partial h_3} \\frac{\\partial h_3}{\\partial h_2} \\frac{\\partial h_2}{\\partial h_1} \\frac{\\partial h_1}{\\partial w}\\) \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u53ea\u662f\u81ea\u52a8\u5fae\u5206\u7684\u4e00\u79cd\u7279\u6b8a\u5f62\u5f0f","title":"\u8ba1\u7b97\u56fe\u4e0e\u81ea\u52a8\u5fae\u5206"},{"location":"cs/ai/dl/#_9","text":"\u975e\u51f8\u4f18\u5316\u95ee\u9898 \uff1a \\(y=\\sigma(w \\ 2 \\ \\sigma(w \\ 1 \\ x))\\) \u7684\u635f\u5931\u51fd\u6570 \u68af\u5ea6\u6d88\u5931\u95ee\u9898 \uff1a\u5728\u6bcf\u4e00\u5c42\u90fd\u8981\u4e58\u4ee5\u8be5\u5c42\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u5bfc\u6570","title":"\u4f18\u5316\u95ee\u9898"},{"location":"cs/ai/dl/#_10","text":"\u6709\u6548\u51cf\u8f7b\u68af\u5ea6\u6d88\u5931\u95ee\u9898","title":"\u6fc0\u6d3b\u51fd\u6570"},{"location":"cs/ai/dl/#_11","text":"","title":"\u5377\u79ef\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/dl/#_12","text":"\u5377\u79ef\u7ecf\u5e38\u7528\u5728\u4fe1\u53f7\u5904\u7406\u4e2d\uff0c\u7528\u4e8e\u8ba1\u7b97\u4fe1\u53f7\u7684\u5ef6\u8fdf\u7d2f\u79ef \u5047\u8bbe\u4e00\u4e2a\u4fe1\u53f7\u53d1\u751f\u5668\u6bcf\u4e2a\u65f6\u523b t \u4ea7\u751f\u4e00\u4e2a\u4fe1\u53f7 \\(x_t\\) \uff0c\u5176\u4fe1\u53f7\u7684\u8870\u51cf\u7387\u4e3a \\(w_k\\) \uff0c\u5373\u5728 k-1 \u4e2a\u65f6\u95f4\u6b65\u957f\u540e\uff0c\u4fe1\u606f\u4e3a\u539f\u6765\u7684 \\(w_k\\) \u500d\uff0c\u5047\u8bbe \\(w_1=1,w_2=1/2,w_3=1/4\\) \u65f6\u523b t \u6536\u5230\u7684\u4fe1\u53f7 \\(y_t\\) \u4e3a\u5f53\u524d\u65f6\u523b\u4ea7\u751f\u7684\u4fe1\u606f\u548c\u4ee5\u524d\u65f6\u523b\u5ef6\u8fdf\u4fe1\u606f\u7684\u53e0\u52a0 \u5373 \\(y_t=w_1 \\times x_t+w_2 \\times x_{t-1}+w_3 \\times x_{t-2}=\\sum_{k=1}^3w_k \\cdot x_{t-k+1}\\) \uff0c \\(y_t\\) \u79f0\u4e3a\u6ee4\u6ce2\u5668\u6216\u5377\u79ef\u6838","title":"\u5377\u79ef"},{"location":"cs/ai/dl/#_13","text":"","title":"\u4e00\u7ef4\u5377\u79ef"},{"location":"cs/ai/dl/#_14","text":"","title":"\u4e8c\u4f4d\u5377\u79ef"},{"location":"cs/ai/dl/#_15","text":"\u5377\u79ef\u4f5c\u4e3a\u7279\u5f81\u63d0\u53d6\u5668 \u5377\u79ef\u4ee3\u66ff\u5168\u8fde\u63a5 \u53ef\u4ee5\u5f15\u5165\u591a\u7ec4\u6ee4\u6ce2\u5668 \u5377\u79ef\u5c42 \u5178\u578b\u7684\u5377\u79ef\u5c42\u4e3a 3 \u7ef4\u7ed3\u6784 \u6c47\u805a\u5c42 \u5377\u79ef\u5c42\u867d\u7136\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u8fde\u63a5\u7684\u4e2a\u6570\uff0c\u4f46\u662f\u6bcf\u4e00\u4e2a\u7279\u5f81\u6620\u5c04\u7684\u795e\u7ecf\u5143\u4e2a\u6570\u5e76\u6ca1\u6709\u663e\u8457\u51cf\u5c11","title":"\u4f5c\u7528"},{"location":"cs/ai/dl/#_16","text":"\u5377\u79ef\u7f51\u7edc\u662f\u7531\u5377\u79ef\u5c42\u3001\u5b50\u91c7\u6837\u5c42\u3001\u5168\u8fde\u63a5\u5c42\u4ea4\u53c9\u5806\u53e0\u800c\u6210 \u8d8b\u5411\u4e8e\u5c0f\u5377\u79ef\u3001\u5927\u6df1\u5ea6 \u8d8b\u5411\u4e8e\u5168\u5377\u79ef \u4e00\u4e2a\u5377\u79ef\u5757\u4e3a\u8fde\u7eed\u4e2a M \u4e2a\u5377\u79ef\u5c42\u548c b \u4e2a\u6c47\u805a\u5c42\uff08M \u901a\u5e38\u8bbe\u7f6e\u4e3a 2-5\uff0cb \u4e3a 0 \u6216 1\uff09\u3002\u4e00\u4e2a\u5377\u79ef\u7f51\u7edc\u4e2d\u53ef\u4ee5\u5806\u53e0 N \u4e2a\u8fde\u7eed\u7684\u5377\u79ef\u5757\uff0c\u7136\u540e\u5728\u63a5\u7740 K \u4e2a\u5168\u8fde\u63a5\u5c42\uff08N \u7684\u53d6\u503c\u533a\u95f4\u6bd4\u8f83\u5927\uff0c\u6bd4\u5982 1-100 \u6216\u8005\u66f4\u5927\uff1bK \u4e00\u822c\u4e3a 0-2\uff09","title":"\u5377\u79ef\u7f51\u7edc\u7ed3\u6784"},{"location":"cs/ai/dl/#_17","text":"\u4f4e\u7ef4\u7279\u5f81\u6620\u5c04\u5230\u9ad8\u7ef4\u7279\u5f81","title":"\u8f6c\u7f6e\u5377\u79ef/\u5fae\u6b65\u5377\u79ef"},{"location":"cs/ai/dl/#_18","text":"\u5982\u4f55\u589e\u52a0\u8f93\u51fa\u5355\u4f4d\u7684\u611f\u53d7\u91ce \u589e\u52a0\u5377\u79ef\u6838\u7684\u5927\u5c0f \u589e\u52a0\u5c42\u6570\u6765\u5b9e\u73b0 \u5728\u5377\u79ef\u4e4b\u524d\u8fdb\u884c\u6c47\u805a\u64cd\u4f5c \u7a7a\u6d1e\u5377\u79ef\u901a\u8fc7\u7ed9\u5377\u79ef\u6838\u63d2\u5165\u201c\u7a7a\u6d1e\u201d\u6765\u53d8\u76f8\u5730\u589e\u52a0\u5176\u5927\u5c0f","title":"\u7a7a\u6d1e\u5377\u79ef"},{"location":"cs/ai/dl/#_19","text":"\\[ h(\\mathbf{x})=\\mathbf{x}+(h(\\mathbf{x})-\\mathbf{x}) \\\\ \\mathbf{x} \u4e3a\u6052\u7b49\u51fd\u6570\uff0ch(\\mathbf{x})-\\mathbf{x} \u4e3a\u6b8b\u5dee\u51fd\u6570 f(\\mathbf{x}, \\theta) \\]","title":"\u7b80\u5355\u7684\u6b8b\u5dee\u5355\u5143\u7ed3\u6784"},{"location":"cs/ai/dl/#_20","text":"AlphaGo Mask RCNN \u56fe\u50cf\u751f\u6210 Deep Dream \u753b\u98ce\u8fc1\u79fb \u5bf9\u6297\u6837\u672c","title":"\u5e94\u7528"},{"location":"cs/ai/dl/#reference","text":"\u90b1\u9521\u9e4f,\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60,\u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e, 2020\uff0cISBN 9787111649687 \u963f\u65af\u987f\u00b7\u5f20\u7b49,\u52a8\u624b\u5b66\u6df1\u5ea6\u5b66\u4e60, ISBN: 9787115505835","title":"Reference"},{"location":"cs/ai/ml/","text":"\u673a\u5668\u5b66\u4e60 \u00b6 \u7ea6 3050 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6c5f\u5357\u5927\u5b66 \u201c\u673a\u5668\u5b66\u4e60\u201d \u8bfe\u7a0b\u7b14\u8bb0 \u53c2\u8003\u848b\u654f\u8001\u5e08\u7684 PPT\uff08\u6bcf\u6b21 4 \u8282\u8bfe\u53ea\u4e0a 3 \u8282\u8bfe\uff0c\u7b80\u76f4\u4e0d\u8981\u592a\u723d \u7b80\u5355\u5b66\u4e2a\u57fa\u7840\uff0c\u4e3b\u8981\u8fd8\u662f\u8981\u7528\u6df1\u5ea6\u5b66\u4e60\uff08\u5176\u5b9e\u5f88\u8ba8\u538c\u673a\u5668\u5b66\u4e60 \u6982\u8ff0 \u00b6 \u6982\u5ff5 \u00b6 \u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u4ece\u539f\u59cb\u6570\u636e\u4e2d\u63d0\u53d6\u7279\u5f81\uff0c\u5b66\u4e60\u4e00\u4e2a\u6620\u5c04\u51fd\u6570 \\(f\\) \u5c06\u4e0a\u8ff0\u7279\u5f81\uff08\u6216\u539f\u59cb\u6570\u636e\uff09\u6620\u5c04\u5230\u8bed\u4e49\u7a7a\u95f4\uff0c\u5bfb\u627e\u6570\u636e\u548c\u4efb\u52a1\u76ee\u6807\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u5373 \u673a\u5668\u5b66\u4e60 \\(\\approx\\) \u6784\u5efa\u4e00\u4e2a\u6620\u5c04\u51fd\u6570 \u79cd\u7c7b \u00b6 \u76d1\u7763\u5b66\u4e60 \u00b6 \u7ed9\u5b9a\u5e26\u6709\u6807\u7b7e\u4fe1\u606f\u7684\u8bad\u7ec3\u96c6\u5408\uff0c\u5b66\u4e60\u4ece\u8f93\u5165\u5230\u8f93\u51fa\u7684\u6620\u5c04 \u4e00\u822c\u88ab\u5e94\u7528\u5728\u56de\u5f52\u6216\u5206\u7c7b\u7684\u4efb\u52a1\u4e2d \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u5e0c\u671b\u6620\u5c04\u51fd\u6570\u5728\u8bad\u7ec3\u6570\u636e\u96c6\u4e0a\u5f97\u5230\u6240\u6709\u6837\u672c\u7684\u201c\u635f\u5931\u548c\u201d\u6700\u5c0f \u635f\u5931\u51fd\u6570\u5305\u62ec 0-1 \u635f\u5931\u51fd\u6570\uff08\u76f8\u7b49\u4e3a 0\uff0c\u53cd\u4e4b\u4e3a 1\uff09\uff0c\u5e73\u65b9\u635f\u5931\u51fd\u6570\uff0c\u7edd\u5bf9- \u635f\u5931\u51fd\u6570\uff0c\u5bf9\u6570\u635f\u5931\u51fd\u6570\uff08\u5bf9\u6570\u4f3c\u7136\u51fd\u6570\uff09 \u76d1\u7763\u5b66\u4e60\u4e00\u822c\u5305\u542b\u4e09\u4e2a\u90e8\u5206\u5185\u5bb9\uff1a \u4ece\u8bad\u7ec3\u6570\u636e\u96c6\u4e2d\u5b66\u4e60\u5f97\u5230\u6620\u5c04\u51fd\u6570 f \u5728\u6d4b\u8bd5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f \u5728\u672a\u77e5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f\uff08\u6295\u5165\u4f7f\u7528\uff09 \u8bad\u7ec3\u53ca\u4e2d\u4ea7\u751f\u7684\u635f\u5931\u4e00\u822c\u79f0\u4e3a\u7ecf\u9a8c\u98ce\u9669\uff08empirical risk\uff09\uff0c\u8d8a\u5c0f\u5bf9\u8bad\u7ec3\u96c6\u62df\u5408\u6548\u679c\u8d8a\u597d \u6d4b\u8bd5\u96c6\u4e2d\u52a0\u5165\u4ece\u771f\u5b9e\u6570\u636e\u5206\u5e03\u91c7\u6837\u7684\u6837\u672c\u65f6\uff0c\u6d4b\u8bd5\u96c6\u4e0a\u7684\u635f\u5931\u4f1a\u4e0d\u65ad\u903c\u8fd1\u671f\u671b\u98ce\u9669\uff08expected risk\uff09\uff0c\u8d8a\u5c0f\u6a21\u578b\u8d8a\u597d \u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u8ffd\u6c42\u671f\u671b\u98ce\u9669\u6700\u5c0f\u5316 \u7ed3\u6784\u98ce\u9669\u6700\u5c0f\u5316\uff08structural risk minimization\uff09\uff1a\u9632\u6b62\u8fc7\u5b66\u4e60\uff0c\u57fa\u4e8e\u8fc7\u5b66\u4e60\u65f6\u53c2\u6570\u503c\u901a\u5e38\u90fd\u8f83\u5927\u8fd9\u4e00\u53d1\u73b0\uff0c\u5728\u7ecf\u9a8c\u98ce\u9669\u4e0a\u52a0\u4e0a\u8868\u793a\u6a21\u578b\u590d\u6742\u5ea6\u7684\u6b63\u5219\u5316\u9879\uff08regularizer\uff09\u6216\u60e9\u7f5a\u9879\uff08penalty term\uff09\uff0c\u5728\u6700\u5c0f\u5316\u7ecf\u9a8c\u98ce\u9669\u4e0e\u964d\u4f4e\u6a21\u578b\u590d\u6742\u5ea6\u4e4b\u95f4\u5bfb\u627e\u5e73\u8861 \u4e3b\u8981\u7684\u76d1\u7763\u5b66\u4e60\u65b9\u6cd5\uff1a \u5224\u522b\u65b9\u6cd5\uff08discriminative approach\uff09 \u76f4\u63a5\u5b66\u4e60\u5224\u522b\u51fd\u6570 f(X) \u6216\u8005\u6761\u4ef6\u6982\u7387\u5206\u5e03 P(Y|X) \u4f5c\u4e3a\u9884\u6d4b\u7684\u6a21\u578b \u5178\u578b\u5224\u522b\u6a21\u578b\u5305\u62ec\u56de\u5f52\u6a21\u578b\u3001\u795e\u7ecf\u7f51\u7edc\u3001\u652f\u6301\u5411\u91cf\u673a\u548c Ada boosting \u751f\u6210\u65b9\u6cd5\uff08generative approach\uff09 \u4ece\u6570\u636e\u4e2d\u5b66\u4e60\u8054\u5408\u6982\u7387\u5206\u5e03 P(X, Y)\uff08\u901a\u8fc7\u4f3c\u7136\u6982\u7387 P(X|Y) \u548c\u7c7b\u6982\u7387 P(Y) \u4e58\u79ef\u6765\u6c42\uff09 \u751f\u6210\u6a21\u578b\u5178\u578b\u65b9\u6cd5\u4e3a\u8d1d\u53f6\u65af\u65b9\u6cd5\u3001\u9690\u9a6c\u5c14\u53ef\u592b\u94fe \u96be\u70b9\u5728\u4e8e\u8054\u5408\u5206\u5e03\u6982\u7387\u6216\u4f3c\u7136\u6982\u7387\u5f88\u96be\u6c42 \u65e0\u76d1\u7763\u5b66\u4e60 \u00b6 \u6700\u5927\u7279\u70b9\u662f \u6570\u636e\u65e0\u6807\u7b7e \u4e00\u822c\u88ab\u5e94\u7528\u5728\u805a\u7c7b\u6216\u82e5\u5e72\u964d\u7ef4\u4efb\u52a1\u4e2d \u534a\u76d1\u7763\u5b66\u4e60\u4f9d\u8d56\u4e8e\u90e8\u5206\u88ab\u6807\u6ce8\u7684\u6570\u636e \u5f3a\u5316\u5b66\u4e60 \u00b6 \u4e00\u79cd\u5e8f\u5217\u6570\u636e\u51b3\u7b56\u5b66\u4e60\u65b9\u6cd5 \u4ece\u4e0e\u73af\u5883\u4ea4\u4e92\u4e2d\u5b66\u4e60\uff0c\u901a\u8fc7\u56de\u62a5\u503c\uff08reward\uff09\u8ba9\u667a\u80fd\u4f53\uff08agent\uff09\u5b66\u4e60\u5230\u5728\u4e0d\u540c\u72b6\u6001\uff08state\uff09\u4e0b\u5982\u4f55\u9009\u62e9\u884c\u4e3a\u65b9\u5f0f\uff08action\uff09 \u591a\u5143\u7ebf\u6027\u56de\u5f52 \u00b6 \u6709 \\(n\\) \u4e2a\u7279\u5f81 \\([x_1, ..., x_n]^{\\top}\\) \uff0c \\(m\\) \u4e2a\u8bad\u7ec3\u6570 \\(\\{(\\mathbf{x_i}, \\mathbf{y_i})\\}_{i=1}^m\\) \uff0c\u9700\u8981\u627e\u5230\u53c2\u6570 \\(\\mathbf{\\theta}\\) \u4f7f\u5f97\u7ebf\u6027\u51fd\u6570 \\(h_\\theta(\\mathbf{x})=\\theta_0+\\mathbf{\\theta}^{\\top} \\mathbf{x}\\) \u6700\u5c0f\u5316\u5747\u65b9\u8bef\u5dee\u51fd\u6570 \\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)})^2 \\] \u77e9\u9635\u6c42\u9006 \u00b6 \\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})^{\\top}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta}) \\] \u5bf9\u5747\u65b9\u8bef\u5dee\u51fd\u6570\u6c42\u5bfc\u5f97 \\(\\nabla J(\\mathbf{\\theta})=-\\frac{1}{m}\\mathbf{X}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})\\) \uff0c\u4ee4\u68af\u5ea6\u7b49\u4e8e 0 \u5f97 \\[\\mathbf{\\theta}=(\\mathbf{X}\\mathbf{X^{\\top}})^{-1}\\mathbf{X}\\mathbf{y}\\] \u68af\u5ea6\u4e0b\u964d \u00b6 \\[ \\theta_j := \\theta_j - \\alpha \\frac{\\partial}{\\partial \\theta_j} J(\\theta) \\\\ \\theta_j := \\theta_j = \\alpha \\frac{1}{m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)}) x_j^{(i)} \\\\ \\] \\(x_j^{(i)}\\) \u8868\u793a\u7b2c \\(i\\) \u4e2a\u6837\u672c\u4e2d\u7b2c \\(j\\) \u4e2a\u7279\u5f81\u3002 \u7279\u5f81\u5f52\u4e00\u5316 \u00b6 \u4f7f\u5f97\u6240\u6709\u4e0d\u540c\u7684\u7279\u5f81\u5c3a\u5ea6\u8fd1\u4f3c\u3002 \u5e38\u7528\u65b9\u6cd5\uff1a \u5747\u503c\u5f52\u4e00\u5316: \\(x_i=\\frac{x_i - \\mu_i}{x_{i\\_max}-x_{i\\_min}}\\) \u5b66\u4e60\u7387 \u00b6 \u5efa\u8bae\u9009\u62e9\u7b56\u7565\uff1a...,0.001,0.003,0.01,0.03,0.1,0.3,... \u901a\u8fc7\u4ee3\u4ef7\u6536\u655b\u56fe\uff0c\u5206\u6790\u9009\u62e9\u5408\u9002\u7684 \\(\\alpha\\) \u5bf9\u6bd4 \u00b6 \u68af\u5ea6\u4e0b\u964d \u9700\u8981\u786e\u5b9a \\(\\alpha\\) \u9700\u8981\u591a\u6b21\u5faa\u73af \u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\u65f6\u4e5f\u53ef\u4ee5\u5f88\u597d\u5de5\u4f5c \u7279\u5f81\u9700\u8981\u5f52\u4e00\u5316 \u77e9\u9635\u6c42\u9006 \u4e0d\u9700\u8981\u9009\u62e9 \\(\\alpha\\) \u4e0d\u9700\u8981\u5faa\u73af \u8981\u8ba1\u7b97 \\((X^{\\top} X)^{-1}\\) \u5982\u679c\u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\uff0c\u7b97\u6cd5\u4f1a\u975e\u5e38\u6162\uff0c\u5bf9\u5185\u5b58\u8981\u6c42\u9ad8 \u7279\u5f81\u4e0d\u9700\u8981\u5f52\u4e00\u5316 \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u7ebf\u6027\u56de\u5f52 724 KB / 12 P / 2023-09-23 \u4e0b\u8f7d \u903b\u8f91\u56de\u5f52 \u00b6 \u7ebf\u6027\u56de\u5f52\u5bf9\u79bb\u7fa4\u70b9\u975e\u5e38\u654f\u611f\uff0c\u5bfc\u81f4\u6a21\u578b\u4e0d\u7a33\u5b9a\uff0c\u4e3a\u4e86\u7f13\u89e3\u8fd9\u4e2a\u95ee\u9898\u53ef\u4ee5\u8003\u8651\u903b\u8f91\u65af\u8482\u56de\u5f52\uff08logistic regression\uff09 \u5206\u7c7b \u00b6 \u903b\u8f91\u56de\u5f52\u662f\u5206\u7c7b\u6a21\u578b\uff0c\u4e0d\u662f\u56de\u5f52\u6a21\u578b \u4e8c\u5206\u7c7b\u95ee\u9898\uff1a \\(y \\in \\{0, 1\\}\\) \uff0c0 \u8868\u793a\u8d1f\u6837\u672c\uff0c1 \u8868\u793a\u6b63\u6837\u672c \\(h_\\theta(x)\\) \u53ef\u80fd \\(>1\\) \u6216 \\(<0\\) \uff0c\u903b\u8f91\u56de\u5f52\u7684\u76ee\u7684\uff1a \\(0 \\le h_\\theta(x) \\le 1\\) \u5b66\u4e60\u6a21\u578b \u00b6 \u903b\u8f91\u56de\u5f52\u7684\u6a21\u578b\uff1a \\(h_\\theta(x)=g(\\theta^{\\top}x)\\) \uff0c\u5176\u4e2d \\(g(z)=\\frac{1}{1+e^{-z}}\\) \uff0c\u79f0\u4e3a\u903b\u8f91\u51fd\u6570\uff08logistic function\uff09\u6216 Sigmoid \u51fd\u6570 \\[ y=\\frac{1}{1+e^{-z}}=\\frac{1}{1+e^{\\mathbf{x}\\top \\mathbf{x} + b}} \\] \u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570 \u6ee1\u8db3\u5206\u7c7b\u7684\u76ee\u7684 \u4fdd\u8bc1\u6536\u655b\uff08\u51f8\u51fd\u6570\uff09 \\[ Cost(h_\\theta(x),y)= \\left\\{\\begin{matrix} -\\log (h_\\theta(x)) & if \\ y=1 \\\\ -\\log (1-h_\\theta(x)) & if \\ y=0 \\end{matrix}\\right. \\] \u7b80\u5316\u7684\u4ee3\u4ef7\u51fd\u6570\u53ca\u68af\u5ea6\u4e0b\u964d \u00b6 \u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ J(\\theta)=\\frac{1}{m} \\sum_{i=1}^m Cost(h_\\theta(x^{(i)}),y^{(i)}) \\\\ =-\\frac{1}{m} \\sum_{i=1}^m [y^{(i)}\\log (h_\\theta(x^{(i)}))+(1-y^{(i)})\\log (1-h_\\theta(x^{(i)}))] \\] \u4f18\u5316\u6a21\u578b\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u8981\u7ed9\u5b9a\u7684\u6837\u672c \\(\\mathbf{x}\\) \uff0c\u9884\u6d4b \\(y\\) \uff0c\u8f93\u51fa \\(h_\\theta(x)=\\frac{1}{1+e^{-\\theta \\top x}}\\) \u68af\u5ea6\u4e0b\u964d \\[ \\frac{\\partial J(\\theta)}{\\partial x}= \\frac{1}{m} \\sum_{i=1}^m (h_\\theta(x^{(i)})-y^{(i)})x_j^{(i)} \\] \u76ee\u6807\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u533a\u522b\uff1a\u7ebf\u6027\u56de\u5f52\uff1a \\(h_\\theta (x)=\\theta^\\top X\\) \uff0c\u903b\u8f91\u56de\u5f52\uff1a \\(h_\\theta(x)=\\frac{1}{1-e^{- \\theta \\top X}}\\) \u9ad8\u7ea7\u4f18\u5316\u95ee\u9898 \u00b6 \u4f18\u5316\u7b97\u6cd5 \u00b6 cvxpy \u7cfb\u5217\uff0ccvxpy\uff0ccvxOPT\uff0c\u8fd9\u51e0\u4e2a\u5305\u4e3b\u8981\u89e3\u51b3\u51f8\u4f18\u5316\u95ee\u9898 scipy.optimizes.scipy \u4e5f\u6709\u4f18\u5316\u65b9\u6cd5 scipy.optimize \u00b6 \u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\uff08\u4f8b\u5982 BFGS\uff0cNelder-Mead simplex\uff0cNewton Conjugate Gradient\uff0cCOBYLA \u6216 SLSQP\uff09\u5bf9\u591a\u53d8\u91cf\u6807\u91cf\u51fd\u6570\uff08\u6700\u5c0f\u5316\uff08\uff09\uff09\u8fdb\u884c\u65e0\u7ea6\u675f\u548c\u7ea6\u675f\u6700\u5c0f\u5316 \u5168\u5c40\uff08\u5f3a\u529b\uff09\u4f18\u5316\u7a0b\u5e8f\uff08\u4f8b\u5982\uff0c\u9000\u706b\uff08\uff09\uff0c\u6d41\u57df\u8d2d\u7269\uff08\uff09\uff09 \u6700\u5c0f\u4e8c\u4e58\u6700\u5c0f\u5316\uff08leastsq\uff08\uff09\uff09\u548c\u66f2\u7ebf\u62df\u5408\uff08curve_fit\uff08\uff09\uff09\u7b97\u6cd5 \u6807\u91cf\u4f46\u53d8\u91cf\u51fd\u6570\u6700\u5c0f\u5316\u5668\uff08minimize_scalar\uff08\uff09\uff09\u548c\u6839\u67e5\u627e\u5668\uff08newton\uff08\uff09\uff09 \u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\u7684\u591a\u53d8\u91cf\u65b9\u7a0b\u7cfb\u7edf\u6c42\u89e3\u5668\uff08root\uff08\uff09\uff09\uff08\u4f8b\u5982\u6df7\u5408 Powell\uff0cLevenberg-Marquardt \u6216\u5927\u89c4\u6a21\u65b9\u6cd5\uff0c\u5982 Newton-Krylov\uff09 \u591a\u5206\u7c7b\u95ee\u9898 \u00b6 \u4e00 VS \u591a \\(\\to\\) 1 VS \u5176\u4ed6 \u8f6c\u6362\u4e3a \u4e00 VS \u591a \\(\\to\\) 1 VS \u53e6\u4e00\u7c7b \u6784\u5efa\u5206\u7c7b\u5668 \u6811\u72b6\u5206\u7c7b\u5668\u6784\u5efa\uff0c\u805a\u7c7b+\u51b3\u7b56\u6811\u6765\u641c\u7d22\u7c7b\u522b\u5dee\u8ddd \u89e3\u51b3\u65b9\u6cd5\uff1a \u8bad\u7ec3 \uff1a\u4e3a\u6bcf\u4e2a\u7c7b\u522b i\uff0c\u8bad\u7ec3\u4e00\u4e2a\u5206\u7c7b\u5668 \\(h_\\theta^{(i)}(x)\\) \uff0c\u4ee5\u9884\u6d4b \\(y=i\\) \u7684\u6982\u7387 \u6d4b\u8bd5 \uff1a\u7ed9\u5b9a\u4e00\u4e2a\u6d4b\u8bd5\u6837\u672c x\uff0c\u6d4b\u8bd5\u6bcf\u4e2a\u7c7b\u522b\u6a21\u578b \\(h_\\theta^{(i)}(x)\\) \uff0c\u9009\u62e9\u6ee1\u8db3 \\(\\underset{i}{\\max} h_\\theta^{(i)}(x)\\) \u7684 i\uff0c\u5373\u4e3a\u6700\u4f18\u7c7b\u522b \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u903b\u8f91\u56de\u5f52 938 KB / 9 P / 2023-10-10 \u4e0b\u8f7d \u6570\u636e\u53ef\u89c6\u5316 \u00b6 matplotlib seaborn pyecharts Pandas \u652f\u6301\u5411\u91cf\u673a \u00b6 \u652f\u6301\u5411\u91cf\u673a SVM \u662f\u4e00\u7c7b\u6309 \u76d1\u7763\u5b66\u4e60 \u65b9\u5f0f\u5bf9\u6570\u636e\u8fdb\u884c\u4e8c\u5143\u5206\u7c7b\u7684\u5e7f\u4e49\u7ebf\u6027\u5206\u7c7b\u5668 \u51b3\u7b56\u8fb9\u754c\u662f\u5bf9\u5b66\u4e60\u6837\u672c\u6c42\u89e3\u7684 \u6700\u5927\u8fb9\u8ddd\u8d85\u5e73\u9762 \u89e3\u51b3\u7ebf\u6027\u53ef\u5206\u95ee\u9898 \u5c06\u7ebf\u6027\u53ef\u5206\u95ee\u9898\u4e2d\u5f97\u5230\u7684\u7ed3\u8bba\u63a8\u5e7f\u5230\u7ebf\u6027\u4e0d\u53ef\u5206\u2014\u2014\u6838\u51fd\u6570 \u7ebf\u6027\u53ef\u5206 VS \u7ebf\u6027\u4e0d\u53ef\u5206 \u00b6 \u7ebf\u6027\u53ef\u5206 \u00b6 \u4e8c\u7ef4\uff1a\u4e00\u6761\u76f4\u7ebf \u4e09\u7ef4\uff1a\u4e00\u4e2a\u5e73\u9762 \u56db\u7ef4\u53ca\u66f4\u9ad8\u7ef4\uff1a\u4e00\u4e2a\u8d85\u5e73\u9762 Hyperplane \u6570\u5b66\u5b9a\u4e49\uff1a\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_1,y_1),(X_2,y_2),...,(X_n,y_n)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega_1,\\omega_2,b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \u82e5 \\(y_i =+1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b > 0\\) \u82e5 \\(y_i =-1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b < 0\\) \u652f\u6301\u5411\u91cf\u673a\u8d85\u5e73\u9762\u4e0e\u6700\u4f18\u5316 \u5047\u5b9a\u6837\u672c\u96c6\u7ebf\u6027\u53ef\u5206 SVM \u8981\u5bfb\u627e\u7684\u5c31\u662f\u5177\u6709\u6700\u5927 margin \u7684\u8d85\u5e73\u9762\uff0c\u4e14\u79bb\u4e24\u8fb9\u7684\u652f\u6301\u5411\u91cf\u8ddd\u79bb\u76f8\u7b49\uff0c\u53ef\u8868\u793a\u4e3a \\[ \\min \\frac{1}{2} \\parallel \\omega \\parallel^2 \\\\ \u7ea6\u675f\u6761\u4ef6\uff1ay_i(\\omega^\\top X_i + b) \\ge 1 \\ \\ \\ (i=1 \\sim N) \\] \u7ebf\u6027\u4e0d\u53ef\u5206 \u00b6 \u5982\u679c \\(y_i=\\{+1,-1\\}\\) \uff0c\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_i,y_i)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega, b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \\(y_i(\\omega^\\top X_i + b) > 0\\) \u5178\u578b\u7684\u7ebf\u6027\u4e0d\u53ef\u5206\u95ee\u9898\u2014\u2014 \u5f02\u6216 \u975e\u7ebf\u6027\u51b3\u7b56\u8fb9\u754c \u9700\u8981\u4e00\u4e2a\u9ad8\u9636\u6a21\u578b\u4ee5\u5b9e\u73b0\u8fd9\u6837\u7684\u975e\u7ebf\u6027\u5206\u7c7b\u95ee\u9898\uff0c\u672c\u8d28\u662f\u5c06\u4e8c\u7ef4\u7a7a\u95f4\u95ee\u9898\u6620\u5c04\u4e3a\u9ad8\u7ef4\u7a7a\u95f4\u95ee\u9898 \u4f4e\u7ef4\u5230\u9ad8\u7ef4\u7684\u6620\u5c04\u2014\u2014\u6838\u51fd\u6570\uff08\u7406\u8bba\u4e0a\u51e0\u4e4e\u901a\u7528\u4e8e\u6240\u6709\u5206\u7c7b Cover \u5b9a\u7406 \u5728\u4e00\u4e2a M \u7ef4\u7a7a\u95f4\u4e0a\u968f\u673a\u53d6 N \u4e2a\u8bad\u7ec3\u6837\u672c\u968f\u673a\u7684\u5bf9\u6bcf\u4e2a\u8bad\u7ec3 d \u8d4b\u4e88\u6807\u7b7e +1 \u6216 -1 \u8fd9\u4e9b\u8bad\u7ec3\u6837\u672c\u7ebf\u6027\u53ef\u5206\u7684\u6982\u7387\u4e3a \\(P(M)\\) \uff0c\u5219\u5f53 M \u8d8b\u5411\u65e0\u7a77\u5927\u65f6 \\(P(M)=1\\) M \u4e0a\u5347 \\(\\to\\) \\((\\omega, b)\\) \u7ef4\u5ea6\u4e0a\u5347 \\(\\to\\) \u6a21\u578b\u81ea\u7531\u5ea6\u4e0a\u5347 \\(\\to\\) \u7ebf\u6027\u53ef\u5206\u6982\u7387\u4e0a\u5347 \u5982\u4f55\u5bfb\u627e\u6838\u51fd\u6570 \u6838\u51fd\u6570 \u00b6 \u7ebf\u6027\u6838\u51fd\u6570 \\(K(x,xi)=x \\cdot xi\\) \u591a\u9879\u5f0f\u6838 Polynomial kernel \\((x^\\top l+\u5e38\u91cf)^{\u5e38\u91cf}\\) \u5f84\u5411\u57fa\u6838(RBF) \\(K(x,xi)=\\exp(- \\parallel x - xi \\parallel / 2 \\sigma^2)\\) \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u652f\u6301\u5411\u91cf\u673a 892 KB / 9 P / 2023-10-20 \u4e0b\u8f7d \u795e\u7ecf\u7f51\u7edc \u00b6 \u795e\u7ecf\u5143\u6a21\u578b MP \u00b6 \u5305\u542b\u8f93\u5165\u8f93\u51fa\u4e0e\u8ba1\u7b97\u529f\u80fd\u7684\u6a21\u578b \u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u611f\u77e5\u5668\uff09 \u00b6 \u4e0e\u795e\u7ecf\u5143\u6a21\u578b\u4e0d\u540c\uff0c\u611f\u77e5\u5668\u4e2d\u7684\u6743\u503c\u662f\u901a\u8fc7\u8bad\u7ec3\u5f97\u5230\u7684 \u611f\u77e5\u5668\u53ef\u4ee5\u505a\uff08\u7b80\u5355\uff09\u7ebf\u6027\u5206\u7c7b\u4efb\u52a1 \u7528\u51b3\u7b56\u8fb9\u754c\u6765\u8868\u8fbe\u5206\u7c7b\u6548\u679c XOR \u65e0\u6cd5\u89e3\u51b3 \u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u591a\u5c42\u611f\u77e5\u5668\uff09 \u00b6 \u7ed3\u6784 \u00b6 \u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u9664\u4e86\u8f93\u5165\u5c42\u548c\u8f93\u51fa\u5c42\uff0c\u8fd8\u589e\u52a0\u4e00\u4e2a\u4e2d\u95f4\u5c42 \u4e2d\u95f4\u5c42\u548c\u8f93\u51fa\u5c42\u90fd\u662f\u8ba1\u7b97\u5c42 \u901a\u8fc7\u6269\u5c55\u4e0a\u4e2a\u5355\u5143\u7684\u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff0c\u5728\u53f3\u8fb9\u65b0\u52a0\u4e00\u4e2a\u5c42\u6b21 \u9690\u85cf\u5c42\u7684\u8282\u70b9\u6570\u8bbe\u8ba1 \u00b6 \u8f93\u5165\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u7279\u5f81\u7684\u7ef4\u5ea6\u5339\u914d \u8f93\u51fa\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u76ee\u6807\u7684\u7ef4\u5ea6\u5339\u914d \u4e2d\u95f4\u5c42\u7684\u8282\u70b9\u6570\u7531\u8bbe\u8ba1\u8005\u51b3\u5b9a \u8f83\u597d\u7684\u65b9\u6cd5\u5c31\u662f\u9884\u5148\u8bbe\u5b9a\u51e0\u4e2a\u53ef\u9009\u503c\uff0c\u901a\u8fc7\u5207\u6362\u4e0d\u540c\u503c\u6765\u770b\u6574\u4e2a\u6a21\u578b\u7684\u9884\u6d4b\u6548\u679c\uff0c\u7b80\u79f0 Grid Search \u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u8bad\u7ec3 \u00b6 \u8bad\u7ec3\u4e0e\u635f\u5931\u51fd\u6570 \u00b6 \u9996\u5148\u7ed9\u6240\u6709\u53c2\u6570\u8d4b\u4e0a\u968f\u673a\u503c\uff0c\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\u503c\u6765\u9884\u6d4b\u8bad\u7ec3\u6570\u636e\u4e2d\u7684\u6837\u672c\uff0c\u6837\u672c\u7684\u9884\u6d4b\u76ee\u6807\u4e3a \\(y_p\\) \uff0c\u771f\u5b9e\u76ee\u6807\u4e3a \\(y\\) \u3002\u90a3\u4e48\u5b9a\u4e49\u4e00\u4e2a\u503c \\(loss = (y_p-y)/2\\) loss \u79f0\u4e4b\u4e3a\u635f\u5931\uff0c\u76ee\u6807\u5c31\u662f\u4f7f\u5bf9\u6240\u6709\u8bad\u7ec3\u6570\u636e\u7684\u635f\u5931\u548c\u5c3d\u53ef\u80fd\u7684\u5c0f \u5982\u679c\u5c06\u5148\u524d\u7684\u795e\u7ecf\u7f51\u7edc\u9884\u6d4b\u7684\u77e9\u9635\u516c\u5f0f\u5e26\u5165\u5230 \\(y_p\\) \u4e2d\uff08\u56e0\u4e3a\u6709 \\(z=y_p\\) \uff09\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u628a\u635f\u5931\u5199\u4e3a\u5173\u4e8e\u53c2\u6570\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u79f0\u4e4b\u4e3a \u635f\u5931\u51fd\u6570(loss function) \u795e\u7ecf\u7f51\u7edc\u4f18\u5316\u95ee\u9898 \u00b6 \u4e00\u822c\u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6cd5\u6765\u4f18\u5316\uff0c\u56e0\u4e3a\u4ee3\u4ef7\u5f88\u5927\uff0c\u6240\u4ee5\u9700\u8981\u4f7f\u7528\u53cd\u5411\u4f20\u64ad\u7b97\u6cd5 \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u5229\u7528\u795e\u7ecf\u7f51\u7edc\u7684\u7ed3\u6784\u8fdb\u884c\u7684\u8ba1\u7b97\uff0c\u4e0d\u4e00\u6b21\u8ba1\u7b97\u6240\u6709\u7684\u68af\u5ea6\uff0c\u800c\u662f\u4ece\u540e\u5f80\u524d \u53cd\u5411\u4f20\u64ad\u7684\u4f9d\u636e\uff1a\u94fe\u5f0f\u6cd5\u5219 \u6846\u67b6 \u00b6 Pytorch optimizer = torch . optim . SGD ( model . parameters (), lr = 0.01 ) ... loss . backward () TensorFlow train = tf . train . GradientDescentOptimizer ( learning_rate = 0.01 ) . minimize ( loss ) \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u795e\u7ecf\u7f51\u7edc 855 KB / 7 P / 2023-10-20 \u4e0b\u8f7d \u8bc6\u522b\u7cfb\u7edf\u7684\u6a21\u578b\u9009\u62e9\u4e0e\u8bc4\u4f30 \u00b6 \u8bef\u5dee\u5f88\u5927\u65f6 \u83b7\u53d6\u66f4\u591a\u7684\u8bad\u7ec3\u6570\u636e \u5c1d\u8bd5\u51cf\u5c11\u7279\u5f81 \u5927\u91cf\u65f6\u95f4\uff08>6\u4e2a\u6708\uff09\u53ef\u80fd\u90fd\u5728\u505a\u8fd9\u4e9b\u8c03\u6574 \u5c1d\u8bd5\u589e\u52a0\u591a\u9879\u5f0f\u7279\u5f81 \u5c1d\u8bd5\u964d\u4f4e/\u63d0\u9ad8 \\(\\lambda\\) \u8bad\u7ec3\u96c6\u3001\u6d4b\u8bd5\u96c6\u3001\u6821\u9a8c\u96c6 \u00b6 \u9ad8\u9636\u6a21\u578b\u80fd\u591f\u5f88\u597d\u5730\u62df\u5408\uff0c\u4f46\u5bf9\u4e0d\u5728\u8bad\u7ec3\u96c6\u4e2d\u7684\u65b0\u6837\u672c\u7f3a\u4e4f\u6cdb\u5316\u80fd\u529b \u53ef\u4ee5\u8003\u8651\u6253\u4e71\u6570\u636e\uff0c\u4ee5\u589e\u5f3a\u6cdb\u5316\u80fd\u529b \u9519\u8bef\u7387&\u8bef\u5dee \u00b6 \u9519\u8bef\u7387\uff1a\u9519\u5206\u6837\u672c\u7684\u5360\u6bd4 \u8bef\u5dee\uff1a\u6837\u672c\u771f\u5b9e\u8f93\u51fa\u4e0e\u9884\u6d4b\u8f93\u51fa\u4e4b\u95f4\u7684\u5dee\u5f02 \u8bad\u7ec3\uff08\u7ecf\u9a8c\uff09\u8bef\u5dee\uff1a\u8bad\u7ec3\u96c6 \u6d4b\u8bd5\u8bef\u5dee\uff1a\u6d4b\u8bd5\u96c6 \u6cdb\u5316\u8bef\u5dee\uff1a\u9664\u8bad\u7ec3\u96c6\u5916\u6240\u6709\u6837\u672c \u7ecf\u9a8c\u8bef\u5dee\u4e0e\u8fc7\u62df\u5408 \u00b6 \u8fc7\u62df\u5408 \u5b66\u4e60\u5668\u628a\u6240\u6709\u8bad\u7ec3\u6837\u672c\u5b66\u4e60\u7684\u201c\u592a\u597d\u201d\uff0c\u5c06\u8bad\u7ec3\u6837\u672c\u672c\u8eab\u7684\u7279\u70b9\u5f53\u4f5c\u6240\u6709\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\uff0c\u5bfc\u81f4\u6cdb\u5316\u6027\u80fd\u4e0b\u964d \u4f18\u5316\u76ee\u6807\u52a0\u6b63\u5219\u9879 early stop \u6b20\u62df\u5408 \u5bf9\u8bad\u7ec3\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\u5c1a\u672a\u5b66\u597d \u51b3\u7b56\u6811\uff1a\u62d3\u5c55\u5206\u652f \u795e\u7ecf\u7f51\u7edc\uff1a\u589e\u52a0\u8bad\u7ec3\u8f6e\u6570 \u5e38\u7528\u8bc4\u4f30\u65b9\u6cd5 \u00b6 \u7559\u51fa\u6cd5 \u00b6 \u76f4\u63a5\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a\u4e24\u4e2a\u4e92\u65a5\u96c6\u5408 \u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u5212\u5206\u8981\u5c3d\u53ef\u80fd\u4fdd\u6301\u6570\u636e\u5206\u5e03\u7684\u4e00\u81f4\u6027 \u4e00\u822c\u82e5\u5e72\u6b21\u968f\u673a\u5212\u5206\uff0c\u91cd\u590d\u5b9e\u9a8c\u53d6\u5e73\u5747\u503c \u8bad\u7ec3/\u6d4b\u8bd5\u6837\u672c\u6bd4\u4f8b\u901a\u5e38\u4e3a 2:1-4:1 \u4ea4\u53c9\u9a8c\u8bc1\u6cd5 \u00b6 \u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a k \u4e2a\u5927\u5c0f\u76f8\u4f3c\u7684\u4e92\u65a5\u5b50\u96c6 \u6bcf\u6b21\u7528 k-1 \u4e2a\u5b50\u96c6\u7684\u5e76\u96c6\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u4f59\u4e0b\u7684\u5b50\u96c6\u4f5c\u4e3a\u6d4b\u8bd5\u96c6 \u8fdb\u884c k \u6b21\u8bad\u7ec3\u548c\u6d4b\u8bd5\uff0c\u6700\u7ec8\u8fd4\u56de k \u6b21\u6d4b\u8bd5\u7ed3\u679c\u7684\u5747\u503c \u4e00\u822c k \u4e3a 10 \u81ea\u52a9\u6cd5 \u00b6 \u5b9e\u9645\u6a21\u578b\u4e0e\u9884\u671f\u6a21\u578b\u90fd\u4f7f\u7528 m \u4e2a\u8bad\u7ec3\u6837\u672c \u7ea6\u6709 1/3 \u7684\u6837\u672c\u6ca1\u5728\u8bad\u7ec3\u96c6\u4e2d\u51fa\u73b0 \u4ece\u521d\u59cb\u6570\u636e\u96c6\u4e2d\u4ea7\u751f\u591a\u4e2a\u4e0d\u540c\u7684\u8bad\u7ec3\u96c6\uff0c\u5bf9\u96c6\u6210\u5b66\u4e60\u6709\u5f88\u5927\u7684\u597d\u5904 \u81ea\u52a9\u6cd5\u5728\u6570\u636e\u96c6\u8f83\u5c0f\uff0c\u96be\u4ee5\u6709\u6548\u5212\u5206\u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u65f6\u5f88\u6709\u7528 \u81ea\u52a9\u6cd5\u4ea7\u751f\u7684\u6570\u636e\u96c6\u6539\u53d8\u4e86\u521d\u59cb\u6570\u636e\u96c6\u7684\u5206\u5e03\uff0c\u4f1a\u5f15\u5165\u4f30\u8ba1\u504f\u5dee\uff0c\u5728\u6570\u636e\u91cf\u8db3\u591f\u65f6\uff0c\u7559\u51fa\u6cd5\u548c\u4ea4\u53c9\u9a8c\u8bc1\u6cd5\u66f4\u5e38\u7528 \u6027\u80fd\u5ea6\u91cf \u00b6 \u5206\u7c7b\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u9519\u8bef\u7387\u548c\u7cbe\u5ea6 \u9519\u8bef\u7387\uff1a \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) \\ne y_i)\\) \u7cbe\u5ea6\uff1a \\(acc(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) = y_i)=1-E(f;D)\\) \u56de\u5f52\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u5747\u65b9\u8bef\u5dee \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) - y_i)^2\\) \u6df7\u6dc6\u77e9\u9635 Confusion matrix \u67e5\u51c6\u7387 Precision\uff1a \\(P=\\frac{TP}{TP+FP}\\) \u67e5\u5168\u7387 Recall\uff1a \\(P=\\frac{TP}{TP+FN}\\) P-R \u66f2\u7ebf\uff1a\u6839\u636e\u5b66\u4e60\u5668\u7684\u9884\u6d4b\u7ed3\u679c\u6309\u6b63\u4f8b\u53ef\u80fd\u6027\u5927\u5c0f\u5bf9\u6837\u4f8b\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u9010\u4e2a\u628a\u6837\u672c\u4f5c\u4e3a\u6b63\u4f8b\u8fdb\u884c\u9884\u6d4b\uff0c\u5219\u53ef\u4ee5\u5f97\u5230\u67e5\u51c6\u7387-\u67e5\u5168\u7387 F1 Score\uff1a \\(F1 Score=2\\frac{PR}{P+R}\\) \u66f4\u4e00\u822c\u7684\u5f62\u5f0f \\(F_\\beta = \\frac{(1+\\beta^2) \\times P \\times R}{(\\beta^2 \\times P) + R}\\) \\(\\beta=1\\) \uff1a\u6807\u51c6 F1 \\(\\beta<1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u51c6\u7387\uff08\u5546\u54c1\u63a8\u8350\u7cfb\u7edf\uff09 \\(\\beta>1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u5168\u7387\uff08\u9003\u72af\u4fe1\u606f\u68c0\u7d22\uff09 ROC \u66f2\u7ebf\uff1a\u53d7\u8bd5\u8005\u5de5\u4f5c\u7279\u5f81\u66f2\u7ebf \u6a2a\u8f74\uff1a \\(FPR=\\frac{FP}{FP+TN}\\) \u7eb5\u8f74\uff1a \\(TPR=\\frac{TP}{TP+FN}\\) AUC\uff1aROC \u66f2\u7ebf\u4e0b\u7684\u9762\u79ef\uff0c\u8d8a\u5927\u8d8a\u597d \u4ee3\u4ef7\u654f\u611f\u9519\u8bef\u7387 \u6bd4\u8f83\u6821\u9a8c \u00b6 \u5047\u8bbe\u6821\u9a8c \u4e8c\u9879\u6821\u9a8c t \u68c0\u9a8c \u4ea4\u53c9\u9a8c\u8bc1 t \u68c0\u9a8c McNemar \u68c0\u9a8c Friedman \u68c0\u9a8c Nemenyi \u68c0\u9a8c \u805a\u7c7b \u00b6","title":"\u673a\u5668\u5b66\u4e60"},{"location":"cs/ai/ml/#_1","text":"\u7ea6 3050 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6c5f\u5357\u5927\u5b66 \u201c\u673a\u5668\u5b66\u4e60\u201d \u8bfe\u7a0b\u7b14\u8bb0 \u53c2\u8003\u848b\u654f\u8001\u5e08\u7684 PPT\uff08\u6bcf\u6b21 4 \u8282\u8bfe\u53ea\u4e0a 3 \u8282\u8bfe\uff0c\u7b80\u76f4\u4e0d\u8981\u592a\u723d \u7b80\u5355\u5b66\u4e2a\u57fa\u7840\uff0c\u4e3b\u8981\u8fd8\u662f\u8981\u7528\u6df1\u5ea6\u5b66\u4e60\uff08\u5176\u5b9e\u5f88\u8ba8\u538c\u673a\u5668\u5b66\u4e60","title":"\u673a\u5668\u5b66\u4e60"},{"location":"cs/ai/ml/#_2","text":"","title":"\u6982\u8ff0"},{"location":"cs/ai/ml/#_3","text":"\u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u4ece\u539f\u59cb\u6570\u636e\u4e2d\u63d0\u53d6\u7279\u5f81\uff0c\u5b66\u4e60\u4e00\u4e2a\u6620\u5c04\u51fd\u6570 \\(f\\) \u5c06\u4e0a\u8ff0\u7279\u5f81\uff08\u6216\u539f\u59cb\u6570\u636e\uff09\u6620\u5c04\u5230\u8bed\u4e49\u7a7a\u95f4\uff0c\u5bfb\u627e\u6570\u636e\u548c\u4efb\u52a1\u76ee\u6807\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u5373 \u673a\u5668\u5b66\u4e60 \\(\\approx\\) \u6784\u5efa\u4e00\u4e2a\u6620\u5c04\u51fd\u6570","title":"\u6982\u5ff5"},{"location":"cs/ai/ml/#_4","text":"","title":"\u79cd\u7c7b"},{"location":"cs/ai/ml/#_5","text":"\u7ed9\u5b9a\u5e26\u6709\u6807\u7b7e\u4fe1\u606f\u7684\u8bad\u7ec3\u96c6\u5408\uff0c\u5b66\u4e60\u4ece\u8f93\u5165\u5230\u8f93\u51fa\u7684\u6620\u5c04 \u4e00\u822c\u88ab\u5e94\u7528\u5728\u56de\u5f52\u6216\u5206\u7c7b\u7684\u4efb\u52a1\u4e2d \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u5e0c\u671b\u6620\u5c04\u51fd\u6570\u5728\u8bad\u7ec3\u6570\u636e\u96c6\u4e0a\u5f97\u5230\u6240\u6709\u6837\u672c\u7684\u201c\u635f\u5931\u548c\u201d\u6700\u5c0f \u635f\u5931\u51fd\u6570\u5305\u62ec 0-1 \u635f\u5931\u51fd\u6570\uff08\u76f8\u7b49\u4e3a 0\uff0c\u53cd\u4e4b\u4e3a 1\uff09\uff0c\u5e73\u65b9\u635f\u5931\u51fd\u6570\uff0c\u7edd\u5bf9- \u635f\u5931\u51fd\u6570\uff0c\u5bf9\u6570\u635f\u5931\u51fd\u6570\uff08\u5bf9\u6570\u4f3c\u7136\u51fd\u6570\uff09 \u76d1\u7763\u5b66\u4e60\u4e00\u822c\u5305\u542b\u4e09\u4e2a\u90e8\u5206\u5185\u5bb9\uff1a \u4ece\u8bad\u7ec3\u6570\u636e\u96c6\u4e2d\u5b66\u4e60\u5f97\u5230\u6620\u5c04\u51fd\u6570 f \u5728\u6d4b\u8bd5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f \u5728\u672a\u77e5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f\uff08\u6295\u5165\u4f7f\u7528\uff09 \u8bad\u7ec3\u53ca\u4e2d\u4ea7\u751f\u7684\u635f\u5931\u4e00\u822c\u79f0\u4e3a\u7ecf\u9a8c\u98ce\u9669\uff08empirical risk\uff09\uff0c\u8d8a\u5c0f\u5bf9\u8bad\u7ec3\u96c6\u62df\u5408\u6548\u679c\u8d8a\u597d \u6d4b\u8bd5\u96c6\u4e2d\u52a0\u5165\u4ece\u771f\u5b9e\u6570\u636e\u5206\u5e03\u91c7\u6837\u7684\u6837\u672c\u65f6\uff0c\u6d4b\u8bd5\u96c6\u4e0a\u7684\u635f\u5931\u4f1a\u4e0d\u65ad\u903c\u8fd1\u671f\u671b\u98ce\u9669\uff08expected risk\uff09\uff0c\u8d8a\u5c0f\u6a21\u578b\u8d8a\u597d \u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u8ffd\u6c42\u671f\u671b\u98ce\u9669\u6700\u5c0f\u5316 \u7ed3\u6784\u98ce\u9669\u6700\u5c0f\u5316\uff08structural risk minimization\uff09\uff1a\u9632\u6b62\u8fc7\u5b66\u4e60\uff0c\u57fa\u4e8e\u8fc7\u5b66\u4e60\u65f6\u53c2\u6570\u503c\u901a\u5e38\u90fd\u8f83\u5927\u8fd9\u4e00\u53d1\u73b0\uff0c\u5728\u7ecf\u9a8c\u98ce\u9669\u4e0a\u52a0\u4e0a\u8868\u793a\u6a21\u578b\u590d\u6742\u5ea6\u7684\u6b63\u5219\u5316\u9879\uff08regularizer\uff09\u6216\u60e9\u7f5a\u9879\uff08penalty term\uff09\uff0c\u5728\u6700\u5c0f\u5316\u7ecf\u9a8c\u98ce\u9669\u4e0e\u964d\u4f4e\u6a21\u578b\u590d\u6742\u5ea6\u4e4b\u95f4\u5bfb\u627e\u5e73\u8861 \u4e3b\u8981\u7684\u76d1\u7763\u5b66\u4e60\u65b9\u6cd5\uff1a \u5224\u522b\u65b9\u6cd5\uff08discriminative approach\uff09 \u76f4\u63a5\u5b66\u4e60\u5224\u522b\u51fd\u6570 f(X) \u6216\u8005\u6761\u4ef6\u6982\u7387\u5206\u5e03 P(Y|X) \u4f5c\u4e3a\u9884\u6d4b\u7684\u6a21\u578b \u5178\u578b\u5224\u522b\u6a21\u578b\u5305\u62ec\u56de\u5f52\u6a21\u578b\u3001\u795e\u7ecf\u7f51\u7edc\u3001\u652f\u6301\u5411\u91cf\u673a\u548c Ada boosting \u751f\u6210\u65b9\u6cd5\uff08generative approach\uff09 \u4ece\u6570\u636e\u4e2d\u5b66\u4e60\u8054\u5408\u6982\u7387\u5206\u5e03 P(X, Y)\uff08\u901a\u8fc7\u4f3c\u7136\u6982\u7387 P(X|Y) \u548c\u7c7b\u6982\u7387 P(Y) \u4e58\u79ef\u6765\u6c42\uff09 \u751f\u6210\u6a21\u578b\u5178\u578b\u65b9\u6cd5\u4e3a\u8d1d\u53f6\u65af\u65b9\u6cd5\u3001\u9690\u9a6c\u5c14\u53ef\u592b\u94fe \u96be\u70b9\u5728\u4e8e\u8054\u5408\u5206\u5e03\u6982\u7387\u6216\u4f3c\u7136\u6982\u7387\u5f88\u96be\u6c42","title":"\u76d1\u7763\u5b66\u4e60"},{"location":"cs/ai/ml/#_6","text":"\u6700\u5927\u7279\u70b9\u662f \u6570\u636e\u65e0\u6807\u7b7e \u4e00\u822c\u88ab\u5e94\u7528\u5728\u805a\u7c7b\u6216\u82e5\u5e72\u964d\u7ef4\u4efb\u52a1\u4e2d \u534a\u76d1\u7763\u5b66\u4e60\u4f9d\u8d56\u4e8e\u90e8\u5206\u88ab\u6807\u6ce8\u7684\u6570\u636e","title":"\u65e0\u76d1\u7763\u5b66\u4e60"},{"location":"cs/ai/ml/#_7","text":"\u4e00\u79cd\u5e8f\u5217\u6570\u636e\u51b3\u7b56\u5b66\u4e60\u65b9\u6cd5 \u4ece\u4e0e\u73af\u5883\u4ea4\u4e92\u4e2d\u5b66\u4e60\uff0c\u901a\u8fc7\u56de\u62a5\u503c\uff08reward\uff09\u8ba9\u667a\u80fd\u4f53\uff08agent\uff09\u5b66\u4e60\u5230\u5728\u4e0d\u540c\u72b6\u6001\uff08state\uff09\u4e0b\u5982\u4f55\u9009\u62e9\u884c\u4e3a\u65b9\u5f0f\uff08action\uff09","title":"\u5f3a\u5316\u5b66\u4e60"},{"location":"cs/ai/ml/#_8","text":"\u6709 \\(n\\) \u4e2a\u7279\u5f81 \\([x_1, ..., x_n]^{\\top}\\) \uff0c \\(m\\) \u4e2a\u8bad\u7ec3\u6570 \\(\\{(\\mathbf{x_i}, \\mathbf{y_i})\\}_{i=1}^m\\) \uff0c\u9700\u8981\u627e\u5230\u53c2\u6570 \\(\\mathbf{\\theta}\\) \u4f7f\u5f97\u7ebf\u6027\u51fd\u6570 \\(h_\\theta(\\mathbf{x})=\\theta_0+\\mathbf{\\theta}^{\\top} \\mathbf{x}\\) \u6700\u5c0f\u5316\u5747\u65b9\u8bef\u5dee\u51fd\u6570 \\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)})^2 \\]","title":"\u591a\u5143\u7ebf\u6027\u56de\u5f52"},{"location":"cs/ai/ml/#_9","text":"\\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})^{\\top}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta}) \\] \u5bf9\u5747\u65b9\u8bef\u5dee\u51fd\u6570\u6c42\u5bfc\u5f97 \\(\\nabla J(\\mathbf{\\theta})=-\\frac{1}{m}\\mathbf{X}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})\\) \uff0c\u4ee4\u68af\u5ea6\u7b49\u4e8e 0 \u5f97 \\[\\mathbf{\\theta}=(\\mathbf{X}\\mathbf{X^{\\top}})^{-1}\\mathbf{X}\\mathbf{y}\\]","title":"\u77e9\u9635\u6c42\u9006"},{"location":"cs/ai/ml/#_10","text":"\\[ \\theta_j := \\theta_j - \\alpha \\frac{\\partial}{\\partial \\theta_j} J(\\theta) \\\\ \\theta_j := \\theta_j = \\alpha \\frac{1}{m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)}) x_j^{(i)} \\\\ \\] \\(x_j^{(i)}\\) \u8868\u793a\u7b2c \\(i\\) \u4e2a\u6837\u672c\u4e2d\u7b2c \\(j\\) \u4e2a\u7279\u5f81\u3002","title":"\u68af\u5ea6\u4e0b\u964d"},{"location":"cs/ai/ml/#_11","text":"\u4f7f\u5f97\u6240\u6709\u4e0d\u540c\u7684\u7279\u5f81\u5c3a\u5ea6\u8fd1\u4f3c\u3002 \u5e38\u7528\u65b9\u6cd5\uff1a \u5747\u503c\u5f52\u4e00\u5316: \\(x_i=\\frac{x_i - \\mu_i}{x_{i\\_max}-x_{i\\_min}}\\)","title":"\u7279\u5f81\u5f52\u4e00\u5316"},{"location":"cs/ai/ml/#_12","text":"\u5efa\u8bae\u9009\u62e9\u7b56\u7565\uff1a...,0.001,0.003,0.01,0.03,0.1,0.3,... \u901a\u8fc7\u4ee3\u4ef7\u6536\u655b\u56fe\uff0c\u5206\u6790\u9009\u62e9\u5408\u9002\u7684 \\(\\alpha\\)","title":"\u5b66\u4e60\u7387"},{"location":"cs/ai/ml/#_13","text":"\u68af\u5ea6\u4e0b\u964d \u9700\u8981\u786e\u5b9a \\(\\alpha\\) \u9700\u8981\u591a\u6b21\u5faa\u73af \u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\u65f6\u4e5f\u53ef\u4ee5\u5f88\u597d\u5de5\u4f5c \u7279\u5f81\u9700\u8981\u5f52\u4e00\u5316 \u77e9\u9635\u6c42\u9006 \u4e0d\u9700\u8981\u9009\u62e9 \\(\\alpha\\) \u4e0d\u9700\u8981\u5faa\u73af \u8981\u8ba1\u7b97 \\((X^{\\top} X)^{-1}\\) \u5982\u679c\u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\uff0c\u7b97\u6cd5\u4f1a\u975e\u5e38\u6162\uff0c\u5bf9\u5185\u5b58\u8981\u6c42\u9ad8 \u7279\u5f81\u4e0d\u9700\u8981\u5f52\u4e00\u5316","title":"\u5bf9\u6bd4"},{"location":"cs/ai/ml/#_14","text":"\u673a\u5668\u5b66\u4e60--\u7ebf\u6027\u56de\u5f52 724 KB / 12 P / 2023-09-23 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_15","text":"\u7ebf\u6027\u56de\u5f52\u5bf9\u79bb\u7fa4\u70b9\u975e\u5e38\u654f\u611f\uff0c\u5bfc\u81f4\u6a21\u578b\u4e0d\u7a33\u5b9a\uff0c\u4e3a\u4e86\u7f13\u89e3\u8fd9\u4e2a\u95ee\u9898\u53ef\u4ee5\u8003\u8651\u903b\u8f91\u65af\u8482\u56de\u5f52\uff08logistic regression\uff09","title":"\u903b\u8f91\u56de\u5f52"},{"location":"cs/ai/ml/#_16","text":"\u903b\u8f91\u56de\u5f52\u662f\u5206\u7c7b\u6a21\u578b\uff0c\u4e0d\u662f\u56de\u5f52\u6a21\u578b \u4e8c\u5206\u7c7b\u95ee\u9898\uff1a \\(y \\in \\{0, 1\\}\\) \uff0c0 \u8868\u793a\u8d1f\u6837\u672c\uff0c1 \u8868\u793a\u6b63\u6837\u672c \\(h_\\theta(x)\\) \u53ef\u80fd \\(>1\\) \u6216 \\(<0\\) \uff0c\u903b\u8f91\u56de\u5f52\u7684\u76ee\u7684\uff1a \\(0 \\le h_\\theta(x) \\le 1\\)","title":"\u5206\u7c7b"},{"location":"cs/ai/ml/#_17","text":"\u903b\u8f91\u56de\u5f52\u7684\u6a21\u578b\uff1a \\(h_\\theta(x)=g(\\theta^{\\top}x)\\) \uff0c\u5176\u4e2d \\(g(z)=\\frac{1}{1+e^{-z}}\\) \uff0c\u79f0\u4e3a\u903b\u8f91\u51fd\u6570\uff08logistic function\uff09\u6216 Sigmoid \u51fd\u6570 \\[ y=\\frac{1}{1+e^{-z}}=\\frac{1}{1+e^{\\mathbf{x}\\top \\mathbf{x} + b}} \\] \u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570 \u6ee1\u8db3\u5206\u7c7b\u7684\u76ee\u7684 \u4fdd\u8bc1\u6536\u655b\uff08\u51f8\u51fd\u6570\uff09 \\[ Cost(h_\\theta(x),y)= \\left\\{\\begin{matrix} -\\log (h_\\theta(x)) & if \\ y=1 \\\\ -\\log (1-h_\\theta(x)) & if \\ y=0 \\end{matrix}\\right. \\]","title":"\u5b66\u4e60\u6a21\u578b"},{"location":"cs/ai/ml/#_18","text":"\u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ J(\\theta)=\\frac{1}{m} \\sum_{i=1}^m Cost(h_\\theta(x^{(i)}),y^{(i)}) \\\\ =-\\frac{1}{m} \\sum_{i=1}^m [y^{(i)}\\log (h_\\theta(x^{(i)}))+(1-y^{(i)})\\log (1-h_\\theta(x^{(i)}))] \\] \u4f18\u5316\u6a21\u578b\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u8981\u7ed9\u5b9a\u7684\u6837\u672c \\(\\mathbf{x}\\) \uff0c\u9884\u6d4b \\(y\\) \uff0c\u8f93\u51fa \\(h_\\theta(x)=\\frac{1}{1+e^{-\\theta \\top x}}\\) \u68af\u5ea6\u4e0b\u964d \\[ \\frac{\\partial J(\\theta)}{\\partial x}= \\frac{1}{m} \\sum_{i=1}^m (h_\\theta(x^{(i)})-y^{(i)})x_j^{(i)} \\] \u76ee\u6807\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u533a\u522b\uff1a\u7ebf\u6027\u56de\u5f52\uff1a \\(h_\\theta (x)=\\theta^\\top X\\) \uff0c\u903b\u8f91\u56de\u5f52\uff1a \\(h_\\theta(x)=\\frac{1}{1-e^{- \\theta \\top X}}\\)","title":"\u7b80\u5316\u7684\u4ee3\u4ef7\u51fd\u6570\u53ca\u68af\u5ea6\u4e0b\u964d"},{"location":"cs/ai/ml/#_19","text":"","title":"\u9ad8\u7ea7\u4f18\u5316\u95ee\u9898"},{"location":"cs/ai/ml/#_20","text":"cvxpy \u7cfb\u5217\uff0ccvxpy\uff0ccvxOPT\uff0c\u8fd9\u51e0\u4e2a\u5305\u4e3b\u8981\u89e3\u51b3\u51f8\u4f18\u5316\u95ee\u9898 scipy.optimizes.scipy \u4e5f\u6709\u4f18\u5316\u65b9\u6cd5","title":"\u4f18\u5316\u7b97\u6cd5"},{"location":"cs/ai/ml/#scipyoptimize","text":"\u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\uff08\u4f8b\u5982 BFGS\uff0cNelder-Mead simplex\uff0cNewton Conjugate Gradient\uff0cCOBYLA \u6216 SLSQP\uff09\u5bf9\u591a\u53d8\u91cf\u6807\u91cf\u51fd\u6570\uff08\u6700\u5c0f\u5316\uff08\uff09\uff09\u8fdb\u884c\u65e0\u7ea6\u675f\u548c\u7ea6\u675f\u6700\u5c0f\u5316 \u5168\u5c40\uff08\u5f3a\u529b\uff09\u4f18\u5316\u7a0b\u5e8f\uff08\u4f8b\u5982\uff0c\u9000\u706b\uff08\uff09\uff0c\u6d41\u57df\u8d2d\u7269\uff08\uff09\uff09 \u6700\u5c0f\u4e8c\u4e58\u6700\u5c0f\u5316\uff08leastsq\uff08\uff09\uff09\u548c\u66f2\u7ebf\u62df\u5408\uff08curve_fit\uff08\uff09\uff09\u7b97\u6cd5 \u6807\u91cf\u4f46\u53d8\u91cf\u51fd\u6570\u6700\u5c0f\u5316\u5668\uff08minimize_scalar\uff08\uff09\uff09\u548c\u6839\u67e5\u627e\u5668\uff08newton\uff08\uff09\uff09 \u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\u7684\u591a\u53d8\u91cf\u65b9\u7a0b\u7cfb\u7edf\u6c42\u89e3\u5668\uff08root\uff08\uff09\uff09\uff08\u4f8b\u5982\u6df7\u5408 Powell\uff0cLevenberg-Marquardt \u6216\u5927\u89c4\u6a21\u65b9\u6cd5\uff0c\u5982 Newton-Krylov\uff09","title":"scipy.optimize"},{"location":"cs/ai/ml/#_21","text":"\u4e00 VS \u591a \\(\\to\\) 1 VS \u5176\u4ed6 \u8f6c\u6362\u4e3a \u4e00 VS \u591a \\(\\to\\) 1 VS \u53e6\u4e00\u7c7b \u6784\u5efa\u5206\u7c7b\u5668 \u6811\u72b6\u5206\u7c7b\u5668\u6784\u5efa\uff0c\u805a\u7c7b+\u51b3\u7b56\u6811\u6765\u641c\u7d22\u7c7b\u522b\u5dee\u8ddd \u89e3\u51b3\u65b9\u6cd5\uff1a \u8bad\u7ec3 \uff1a\u4e3a\u6bcf\u4e2a\u7c7b\u522b i\uff0c\u8bad\u7ec3\u4e00\u4e2a\u5206\u7c7b\u5668 \\(h_\\theta^{(i)}(x)\\) \uff0c\u4ee5\u9884\u6d4b \\(y=i\\) \u7684\u6982\u7387 \u6d4b\u8bd5 \uff1a\u7ed9\u5b9a\u4e00\u4e2a\u6d4b\u8bd5\u6837\u672c x\uff0c\u6d4b\u8bd5\u6bcf\u4e2a\u7c7b\u522b\u6a21\u578b \\(h_\\theta^{(i)}(x)\\) \uff0c\u9009\u62e9\u6ee1\u8db3 \\(\\underset{i}{\\max} h_\\theta^{(i)}(x)\\) \u7684 i\uff0c\u5373\u4e3a\u6700\u4f18\u7c7b\u522b","title":"\u591a\u5206\u7c7b\u95ee\u9898"},{"location":"cs/ai/ml/#_22","text":"\u673a\u5668\u5b66\u4e60--\u903b\u8f91\u56de\u5f52 938 KB / 9 P / 2023-10-10 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_23","text":"matplotlib seaborn pyecharts Pandas","title":"\u6570\u636e\u53ef\u89c6\u5316"},{"location":"cs/ai/ml/#_24","text":"\u652f\u6301\u5411\u91cf\u673a SVM \u662f\u4e00\u7c7b\u6309 \u76d1\u7763\u5b66\u4e60 \u65b9\u5f0f\u5bf9\u6570\u636e\u8fdb\u884c\u4e8c\u5143\u5206\u7c7b\u7684\u5e7f\u4e49\u7ebf\u6027\u5206\u7c7b\u5668 \u51b3\u7b56\u8fb9\u754c\u662f\u5bf9\u5b66\u4e60\u6837\u672c\u6c42\u89e3\u7684 \u6700\u5927\u8fb9\u8ddd\u8d85\u5e73\u9762 \u89e3\u51b3\u7ebf\u6027\u53ef\u5206\u95ee\u9898 \u5c06\u7ebf\u6027\u53ef\u5206\u95ee\u9898\u4e2d\u5f97\u5230\u7684\u7ed3\u8bba\u63a8\u5e7f\u5230\u7ebf\u6027\u4e0d\u53ef\u5206\u2014\u2014\u6838\u51fd\u6570","title":"\u652f\u6301\u5411\u91cf\u673a"},{"location":"cs/ai/ml/#vs","text":"","title":"\u7ebf\u6027\u53ef\u5206 VS \u7ebf\u6027\u4e0d\u53ef\u5206"},{"location":"cs/ai/ml/#_25","text":"\u4e8c\u7ef4\uff1a\u4e00\u6761\u76f4\u7ebf \u4e09\u7ef4\uff1a\u4e00\u4e2a\u5e73\u9762 \u56db\u7ef4\u53ca\u66f4\u9ad8\u7ef4\uff1a\u4e00\u4e2a\u8d85\u5e73\u9762 Hyperplane \u6570\u5b66\u5b9a\u4e49\uff1a\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_1,y_1),(X_2,y_2),...,(X_n,y_n)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega_1,\\omega_2,b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \u82e5 \\(y_i =+1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b > 0\\) \u82e5 \\(y_i =-1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b < 0\\) \u652f\u6301\u5411\u91cf\u673a\u8d85\u5e73\u9762\u4e0e\u6700\u4f18\u5316 \u5047\u5b9a\u6837\u672c\u96c6\u7ebf\u6027\u53ef\u5206 SVM \u8981\u5bfb\u627e\u7684\u5c31\u662f\u5177\u6709\u6700\u5927 margin \u7684\u8d85\u5e73\u9762\uff0c\u4e14\u79bb\u4e24\u8fb9\u7684\u652f\u6301\u5411\u91cf\u8ddd\u79bb\u76f8\u7b49\uff0c\u53ef\u8868\u793a\u4e3a \\[ \\min \\frac{1}{2} \\parallel \\omega \\parallel^2 \\\\ \u7ea6\u675f\u6761\u4ef6\uff1ay_i(\\omega^\\top X_i + b) \\ge 1 \\ \\ \\ (i=1 \\sim N) \\]","title":"\u7ebf\u6027\u53ef\u5206"},{"location":"cs/ai/ml/#_26","text":"\u5982\u679c \\(y_i=\\{+1,-1\\}\\) \uff0c\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_i,y_i)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega, b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \\(y_i(\\omega^\\top X_i + b) > 0\\) \u5178\u578b\u7684\u7ebf\u6027\u4e0d\u53ef\u5206\u95ee\u9898\u2014\u2014 \u5f02\u6216 \u975e\u7ebf\u6027\u51b3\u7b56\u8fb9\u754c \u9700\u8981\u4e00\u4e2a\u9ad8\u9636\u6a21\u578b\u4ee5\u5b9e\u73b0\u8fd9\u6837\u7684\u975e\u7ebf\u6027\u5206\u7c7b\u95ee\u9898\uff0c\u672c\u8d28\u662f\u5c06\u4e8c\u7ef4\u7a7a\u95f4\u95ee\u9898\u6620\u5c04\u4e3a\u9ad8\u7ef4\u7a7a\u95f4\u95ee\u9898 \u4f4e\u7ef4\u5230\u9ad8\u7ef4\u7684\u6620\u5c04\u2014\u2014\u6838\u51fd\u6570\uff08\u7406\u8bba\u4e0a\u51e0\u4e4e\u901a\u7528\u4e8e\u6240\u6709\u5206\u7c7b Cover \u5b9a\u7406 \u5728\u4e00\u4e2a M \u7ef4\u7a7a\u95f4\u4e0a\u968f\u673a\u53d6 N \u4e2a\u8bad\u7ec3\u6837\u672c\u968f\u673a\u7684\u5bf9\u6bcf\u4e2a\u8bad\u7ec3 d \u8d4b\u4e88\u6807\u7b7e +1 \u6216 -1 \u8fd9\u4e9b\u8bad\u7ec3\u6837\u672c\u7ebf\u6027\u53ef\u5206\u7684\u6982\u7387\u4e3a \\(P(M)\\) \uff0c\u5219\u5f53 M \u8d8b\u5411\u65e0\u7a77\u5927\u65f6 \\(P(M)=1\\) M \u4e0a\u5347 \\(\\to\\) \\((\\omega, b)\\) \u7ef4\u5ea6\u4e0a\u5347 \\(\\to\\) \u6a21\u578b\u81ea\u7531\u5ea6\u4e0a\u5347 \\(\\to\\) \u7ebf\u6027\u53ef\u5206\u6982\u7387\u4e0a\u5347 \u5982\u4f55\u5bfb\u627e\u6838\u51fd\u6570","title":"\u7ebf\u6027\u4e0d\u53ef\u5206"},{"location":"cs/ai/ml/#_27","text":"\u7ebf\u6027\u6838\u51fd\u6570 \\(K(x,xi)=x \\cdot xi\\) \u591a\u9879\u5f0f\u6838 Polynomial kernel \\((x^\\top l+\u5e38\u91cf)^{\u5e38\u91cf}\\) \u5f84\u5411\u57fa\u6838(RBF) \\(K(x,xi)=\\exp(- \\parallel x - xi \\parallel / 2 \\sigma^2)\\)","title":"\u6838\u51fd\u6570"},{"location":"cs/ai/ml/#_28","text":"\u673a\u5668\u5b66\u4e60--\u652f\u6301\u5411\u91cf\u673a 892 KB / 9 P / 2023-10-20 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_29","text":"","title":"\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/ml/#mp","text":"\u5305\u542b\u8f93\u5165\u8f93\u51fa\u4e0e\u8ba1\u7b97\u529f\u80fd\u7684\u6a21\u578b","title":"\u795e\u7ecf\u5143\u6a21\u578b MP"},{"location":"cs/ai/ml/#_30","text":"\u4e0e\u795e\u7ecf\u5143\u6a21\u578b\u4e0d\u540c\uff0c\u611f\u77e5\u5668\u4e2d\u7684\u6743\u503c\u662f\u901a\u8fc7\u8bad\u7ec3\u5f97\u5230\u7684 \u611f\u77e5\u5668\u53ef\u4ee5\u505a\uff08\u7b80\u5355\uff09\u7ebf\u6027\u5206\u7c7b\u4efb\u52a1 \u7528\u51b3\u7b56\u8fb9\u754c\u6765\u8868\u8fbe\u5206\u7c7b\u6548\u679c XOR \u65e0\u6cd5\u89e3\u51b3","title":"\u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u611f\u77e5\u5668\uff09"},{"location":"cs/ai/ml/#_31","text":"","title":"\u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u591a\u5c42\u611f\u77e5\u5668\uff09"},{"location":"cs/ai/ml/#_32","text":"\u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u9664\u4e86\u8f93\u5165\u5c42\u548c\u8f93\u51fa\u5c42\uff0c\u8fd8\u589e\u52a0\u4e00\u4e2a\u4e2d\u95f4\u5c42 \u4e2d\u95f4\u5c42\u548c\u8f93\u51fa\u5c42\u90fd\u662f\u8ba1\u7b97\u5c42 \u901a\u8fc7\u6269\u5c55\u4e0a\u4e2a\u5355\u5143\u7684\u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff0c\u5728\u53f3\u8fb9\u65b0\u52a0\u4e00\u4e2a\u5c42\u6b21","title":"\u7ed3\u6784"},{"location":"cs/ai/ml/#_33","text":"\u8f93\u5165\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u7279\u5f81\u7684\u7ef4\u5ea6\u5339\u914d \u8f93\u51fa\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u76ee\u6807\u7684\u7ef4\u5ea6\u5339\u914d \u4e2d\u95f4\u5c42\u7684\u8282\u70b9\u6570\u7531\u8bbe\u8ba1\u8005\u51b3\u5b9a \u8f83\u597d\u7684\u65b9\u6cd5\u5c31\u662f\u9884\u5148\u8bbe\u5b9a\u51e0\u4e2a\u53ef\u9009\u503c\uff0c\u901a\u8fc7\u5207\u6362\u4e0d\u540c\u503c\u6765\u770b\u6574\u4e2a\u6a21\u578b\u7684\u9884\u6d4b\u6548\u679c\uff0c\u7b80\u79f0 Grid Search","title":"\u9690\u85cf\u5c42\u7684\u8282\u70b9\u6570\u8bbe\u8ba1"},{"location":"cs/ai/ml/#_34","text":"","title":"\u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u8bad\u7ec3"},{"location":"cs/ai/ml/#_35","text":"\u9996\u5148\u7ed9\u6240\u6709\u53c2\u6570\u8d4b\u4e0a\u968f\u673a\u503c\uff0c\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\u503c\u6765\u9884\u6d4b\u8bad\u7ec3\u6570\u636e\u4e2d\u7684\u6837\u672c\uff0c\u6837\u672c\u7684\u9884\u6d4b\u76ee\u6807\u4e3a \\(y_p\\) \uff0c\u771f\u5b9e\u76ee\u6807\u4e3a \\(y\\) \u3002\u90a3\u4e48\u5b9a\u4e49\u4e00\u4e2a\u503c \\(loss = (y_p-y)/2\\) loss \u79f0\u4e4b\u4e3a\u635f\u5931\uff0c\u76ee\u6807\u5c31\u662f\u4f7f\u5bf9\u6240\u6709\u8bad\u7ec3\u6570\u636e\u7684\u635f\u5931\u548c\u5c3d\u53ef\u80fd\u7684\u5c0f \u5982\u679c\u5c06\u5148\u524d\u7684\u795e\u7ecf\u7f51\u7edc\u9884\u6d4b\u7684\u77e9\u9635\u516c\u5f0f\u5e26\u5165\u5230 \\(y_p\\) \u4e2d\uff08\u56e0\u4e3a\u6709 \\(z=y_p\\) \uff09\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u628a\u635f\u5931\u5199\u4e3a\u5173\u4e8e\u53c2\u6570\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u79f0\u4e4b\u4e3a \u635f\u5931\u51fd\u6570(loss function)","title":"\u8bad\u7ec3\u4e0e\u635f\u5931\u51fd\u6570"},{"location":"cs/ai/ml/#_36","text":"\u4e00\u822c\u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6cd5\u6765\u4f18\u5316\uff0c\u56e0\u4e3a\u4ee3\u4ef7\u5f88\u5927\uff0c\u6240\u4ee5\u9700\u8981\u4f7f\u7528\u53cd\u5411\u4f20\u64ad\u7b97\u6cd5 \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u5229\u7528\u795e\u7ecf\u7f51\u7edc\u7684\u7ed3\u6784\u8fdb\u884c\u7684\u8ba1\u7b97\uff0c\u4e0d\u4e00\u6b21\u8ba1\u7b97\u6240\u6709\u7684\u68af\u5ea6\uff0c\u800c\u662f\u4ece\u540e\u5f80\u524d \u53cd\u5411\u4f20\u64ad\u7684\u4f9d\u636e\uff1a\u94fe\u5f0f\u6cd5\u5219","title":"\u795e\u7ecf\u7f51\u7edc\u4f18\u5316\u95ee\u9898"},{"location":"cs/ai/ml/#_37","text":"Pytorch optimizer = torch . optim . SGD ( model . parameters (), lr = 0.01 ) ... loss . backward () TensorFlow train = tf . train . GradientDescentOptimizer ( learning_rate = 0.01 ) . minimize ( loss )","title":"\u6846\u67b6"},{"location":"cs/ai/ml/#_38","text":"\u673a\u5668\u5b66\u4e60--\u795e\u7ecf\u7f51\u7edc 855 KB / 7 P / 2023-10-20 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_39","text":"\u8bef\u5dee\u5f88\u5927\u65f6 \u83b7\u53d6\u66f4\u591a\u7684\u8bad\u7ec3\u6570\u636e \u5c1d\u8bd5\u51cf\u5c11\u7279\u5f81 \u5927\u91cf\u65f6\u95f4\uff08>6\u4e2a\u6708\uff09\u53ef\u80fd\u90fd\u5728\u505a\u8fd9\u4e9b\u8c03\u6574 \u5c1d\u8bd5\u589e\u52a0\u591a\u9879\u5f0f\u7279\u5f81 \u5c1d\u8bd5\u964d\u4f4e/\u63d0\u9ad8 \\(\\lambda\\)","title":"\u8bc6\u522b\u7cfb\u7edf\u7684\u6a21\u578b\u9009\u62e9\u4e0e\u8bc4\u4f30"},{"location":"cs/ai/ml/#_40","text":"\u9ad8\u9636\u6a21\u578b\u80fd\u591f\u5f88\u597d\u5730\u62df\u5408\uff0c\u4f46\u5bf9\u4e0d\u5728\u8bad\u7ec3\u96c6\u4e2d\u7684\u65b0\u6837\u672c\u7f3a\u4e4f\u6cdb\u5316\u80fd\u529b \u53ef\u4ee5\u8003\u8651\u6253\u4e71\u6570\u636e\uff0c\u4ee5\u589e\u5f3a\u6cdb\u5316\u80fd\u529b","title":"\u8bad\u7ec3\u96c6\u3001\u6d4b\u8bd5\u96c6\u3001\u6821\u9a8c\u96c6"},{"location":"cs/ai/ml/#_41","text":"\u9519\u8bef\u7387\uff1a\u9519\u5206\u6837\u672c\u7684\u5360\u6bd4 \u8bef\u5dee\uff1a\u6837\u672c\u771f\u5b9e\u8f93\u51fa\u4e0e\u9884\u6d4b\u8f93\u51fa\u4e4b\u95f4\u7684\u5dee\u5f02 \u8bad\u7ec3\uff08\u7ecf\u9a8c\uff09\u8bef\u5dee\uff1a\u8bad\u7ec3\u96c6 \u6d4b\u8bd5\u8bef\u5dee\uff1a\u6d4b\u8bd5\u96c6 \u6cdb\u5316\u8bef\u5dee\uff1a\u9664\u8bad\u7ec3\u96c6\u5916\u6240\u6709\u6837\u672c","title":"\u9519\u8bef\u7387&\u8bef\u5dee"},{"location":"cs/ai/ml/#_42","text":"\u8fc7\u62df\u5408 \u5b66\u4e60\u5668\u628a\u6240\u6709\u8bad\u7ec3\u6837\u672c\u5b66\u4e60\u7684\u201c\u592a\u597d\u201d\uff0c\u5c06\u8bad\u7ec3\u6837\u672c\u672c\u8eab\u7684\u7279\u70b9\u5f53\u4f5c\u6240\u6709\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\uff0c\u5bfc\u81f4\u6cdb\u5316\u6027\u80fd\u4e0b\u964d \u4f18\u5316\u76ee\u6807\u52a0\u6b63\u5219\u9879 early stop \u6b20\u62df\u5408 \u5bf9\u8bad\u7ec3\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\u5c1a\u672a\u5b66\u597d \u51b3\u7b56\u6811\uff1a\u62d3\u5c55\u5206\u652f \u795e\u7ecf\u7f51\u7edc\uff1a\u589e\u52a0\u8bad\u7ec3\u8f6e\u6570","title":"\u7ecf\u9a8c\u8bef\u5dee\u4e0e\u8fc7\u62df\u5408"},{"location":"cs/ai/ml/#_43","text":"","title":"\u5e38\u7528\u8bc4\u4f30\u65b9\u6cd5"},{"location":"cs/ai/ml/#_44","text":"\u76f4\u63a5\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a\u4e24\u4e2a\u4e92\u65a5\u96c6\u5408 \u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u5212\u5206\u8981\u5c3d\u53ef\u80fd\u4fdd\u6301\u6570\u636e\u5206\u5e03\u7684\u4e00\u81f4\u6027 \u4e00\u822c\u82e5\u5e72\u6b21\u968f\u673a\u5212\u5206\uff0c\u91cd\u590d\u5b9e\u9a8c\u53d6\u5e73\u5747\u503c \u8bad\u7ec3/\u6d4b\u8bd5\u6837\u672c\u6bd4\u4f8b\u901a\u5e38\u4e3a 2:1-4:1","title":"\u7559\u51fa\u6cd5"},{"location":"cs/ai/ml/#_45","text":"\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a k \u4e2a\u5927\u5c0f\u76f8\u4f3c\u7684\u4e92\u65a5\u5b50\u96c6 \u6bcf\u6b21\u7528 k-1 \u4e2a\u5b50\u96c6\u7684\u5e76\u96c6\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u4f59\u4e0b\u7684\u5b50\u96c6\u4f5c\u4e3a\u6d4b\u8bd5\u96c6 \u8fdb\u884c k \u6b21\u8bad\u7ec3\u548c\u6d4b\u8bd5\uff0c\u6700\u7ec8\u8fd4\u56de k \u6b21\u6d4b\u8bd5\u7ed3\u679c\u7684\u5747\u503c \u4e00\u822c k \u4e3a 10","title":"\u4ea4\u53c9\u9a8c\u8bc1\u6cd5"},{"location":"cs/ai/ml/#_46","text":"\u5b9e\u9645\u6a21\u578b\u4e0e\u9884\u671f\u6a21\u578b\u90fd\u4f7f\u7528 m \u4e2a\u8bad\u7ec3\u6837\u672c \u7ea6\u6709 1/3 \u7684\u6837\u672c\u6ca1\u5728\u8bad\u7ec3\u96c6\u4e2d\u51fa\u73b0 \u4ece\u521d\u59cb\u6570\u636e\u96c6\u4e2d\u4ea7\u751f\u591a\u4e2a\u4e0d\u540c\u7684\u8bad\u7ec3\u96c6\uff0c\u5bf9\u96c6\u6210\u5b66\u4e60\u6709\u5f88\u5927\u7684\u597d\u5904 \u81ea\u52a9\u6cd5\u5728\u6570\u636e\u96c6\u8f83\u5c0f\uff0c\u96be\u4ee5\u6709\u6548\u5212\u5206\u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u65f6\u5f88\u6709\u7528 \u81ea\u52a9\u6cd5\u4ea7\u751f\u7684\u6570\u636e\u96c6\u6539\u53d8\u4e86\u521d\u59cb\u6570\u636e\u96c6\u7684\u5206\u5e03\uff0c\u4f1a\u5f15\u5165\u4f30\u8ba1\u504f\u5dee\uff0c\u5728\u6570\u636e\u91cf\u8db3\u591f\u65f6\uff0c\u7559\u51fa\u6cd5\u548c\u4ea4\u53c9\u9a8c\u8bc1\u6cd5\u66f4\u5e38\u7528","title":"\u81ea\u52a9\u6cd5"},{"location":"cs/ai/ml/#_47","text":"\u5206\u7c7b\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u9519\u8bef\u7387\u548c\u7cbe\u5ea6 \u9519\u8bef\u7387\uff1a \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) \\ne y_i)\\) \u7cbe\u5ea6\uff1a \\(acc(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) = y_i)=1-E(f;D)\\) \u56de\u5f52\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u5747\u65b9\u8bef\u5dee \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) - y_i)^2\\) \u6df7\u6dc6\u77e9\u9635 Confusion matrix \u67e5\u51c6\u7387 Precision\uff1a \\(P=\\frac{TP}{TP+FP}\\) \u67e5\u5168\u7387 Recall\uff1a \\(P=\\frac{TP}{TP+FN}\\) P-R \u66f2\u7ebf\uff1a\u6839\u636e\u5b66\u4e60\u5668\u7684\u9884\u6d4b\u7ed3\u679c\u6309\u6b63\u4f8b\u53ef\u80fd\u6027\u5927\u5c0f\u5bf9\u6837\u4f8b\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u9010\u4e2a\u628a\u6837\u672c\u4f5c\u4e3a\u6b63\u4f8b\u8fdb\u884c\u9884\u6d4b\uff0c\u5219\u53ef\u4ee5\u5f97\u5230\u67e5\u51c6\u7387-\u67e5\u5168\u7387 F1 Score\uff1a \\(F1 Score=2\\frac{PR}{P+R}\\) \u66f4\u4e00\u822c\u7684\u5f62\u5f0f \\(F_\\beta = \\frac{(1+\\beta^2) \\times P \\times R}{(\\beta^2 \\times P) + R}\\) \\(\\beta=1\\) \uff1a\u6807\u51c6 F1 \\(\\beta<1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u51c6\u7387\uff08\u5546\u54c1\u63a8\u8350\u7cfb\u7edf\uff09 \\(\\beta>1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u5168\u7387\uff08\u9003\u72af\u4fe1\u606f\u68c0\u7d22\uff09 ROC \u66f2\u7ebf\uff1a\u53d7\u8bd5\u8005\u5de5\u4f5c\u7279\u5f81\u66f2\u7ebf \u6a2a\u8f74\uff1a \\(FPR=\\frac{FP}{FP+TN}\\) \u7eb5\u8f74\uff1a \\(TPR=\\frac{TP}{TP+FN}\\) AUC\uff1aROC \u66f2\u7ebf\u4e0b\u7684\u9762\u79ef\uff0c\u8d8a\u5927\u8d8a\u597d \u4ee3\u4ef7\u654f\u611f\u9519\u8bef\u7387","title":"\u6027\u80fd\u5ea6\u91cf"},{"location":"cs/ai/ml/#_48","text":"\u5047\u8bbe\u6821\u9a8c \u4e8c\u9879\u6821\u9a8c t \u68c0\u9a8c \u4ea4\u53c9\u9a8c\u8bc1 t \u68c0\u9a8c McNemar \u68c0\u9a8c Friedman \u68c0\u9a8c Nemenyi \u68c0\u9a8c","title":"\u6bd4\u8f83\u6821\u9a8c"},{"location":"cs/ai/ml/#_49","text":"","title":"\u805a\u7c7b"},{"location":"cs/ai/mode-recognition/","text":"\u6a21\u5f0f\u8bc6\u522b \u00b6 \u7ea6 3653 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u5b66\u4e60\u6a21\u5f0f\u8bc6\u522b\u8bfe\u7684\u4e00\u4e9b\u7b14\u8bb0 \u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u8ff0 \u00b6 \u6a21\u5f0f\u548c\u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u5ff5 \u00b6 \u6a21\u5f0f\uff1a\u5bf9\u67d0\u4e9b\u611f\u5174\u8da3\u7684\u5ba2\u4f53\u7684\u5b9a\u91cf\u7684\u6216\u7ed3\u6784\u7684\u63cf\u8ff0\u3002\u6a21\u5f0f\u7c7b\u662f\u5177\u6709\u67d0\u4e9b\u5171\u540c\u7279\u6027\u7684\u6a21\u5f0f\u7684\u96c6\u5408\u3002 \u6a21\u5f0f\u8bc6\u522b\uff1a\u7814\u7a76\u4e00\u79cd\u81ea\u52a8\u6280\u672f\uff0c\u4f9d\u9760\u8fd9\u79cd\u6280\u672f\uff0c\u8ba1\u7b97\u673a\u5c06\u81ea\u52a8\u5730\uff08\u6216\u4eba\u5c3d\u91cf\u5c11\u5730\u5e72\u6d89\uff09\u628a\u5f85\u522b\u8bc6\u6a21\u5f0f\u5206\u914d\u5230\u5404\u81ea\u7684\u6a21\u5f0f\u7c7b\u4e2d\u53bb\u3002 \u6a21\u5f0f\u8bc6\u522b\u7cfb\u7edf\u7ec4\u6210 \u00b6 \u6ce8\u610f\u201c\u5904\u7406\u201d\u4e0e\u201c\u8bc6\u522b\u201d\u4e24\u4e2a\u6982\u5ff5\u7684\u533a\u522b \u6a21\u5f0f\u8bc6\u522b\u7684\u5206\u7c7b \u00b6 \u4ece\u7406\u8bba\u4e0a\u5206\u7c7b \u7edf\u8ba1\u6a21\u5f0f\u8bc6\u522b \u53e5\u6cd5\u6a21\u5f0f\u8bc6\u522b\uff08\u7ed3\u6784\u6a21\u5f0f\u8bc6\u522b\uff09 \u6a21\u7cca\u6a21\u5f0f\u8bc6\u522b \u795e\u7ecf\u7f51\u7edc\u6a21\u5f0f\u8bc6\u522b \u4ece\u5b9e\u73b0\u65b9\u6cd5\u5206\u7c7b \u76d1\u7763\u5206\u7c7b \u975e\u76d1\u7763\u5206\u7c7b \u6a21\u5f0f\u8bc6\u522b\u7684\u5e94\u7528 \u00b6 \u4e0d\u505c\u8f66\u6536\u8d39\u7cfb\u7edf \u5173\u952e\uff1a\u8f66\u578b\u7684\u81ea\u52a8\u5206\u7c7b\u3002\u51e0\u79cd\u4e3b\u8981\u6280\u672f\uff1a \u63d0\u53d6\u8f66\u8f86\u5916\u5f62\u51e0\u4f55\u53c2\u6570\u8fdb\u884c\u5904\u7406\u5206\u6790\uff0c\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u89c6\u9891\u68c0\u6d4b\u65b9\u6cd5\u3001\u7ea2\u5916\u68c0\u6d4b\u65b9\u6cd5\u3002 \u6d4b\u91cf\u8f66\u8f86\u7684\u5176\u4ed6\u7269\u7406\u53c2\u6570\uff08\u566a\u58f0\u3001\u632f\u52a8\u3001\u538b\u91cd\u7b49\uff09\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u52a8\u6001\u79f0\u91cd\u3001\u7535\u78c1\u611f\u5e94\u7b49\u3002 \u76f4\u63a5\u8bc6\u522b\u8f66\u8f86\u8eab\u4efd\u7684\u65b9\u6cd5\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u7535\u5b50\u6807\u7b7e\u3001\u89c6\u9891\u724c\u7167\u65b9\u6cd5\u7b49 \u805a\u7c7b\u5206\u6790 \u00b6 \u8ddd\u79bb\u805a\u7c7b\u7684\u6982\u5ff5 \u00b6 \u6982\u5ff5\uff1a \u7269\u4ee5\u7c7b\u805a \u805a\u7c7b\u5206\u6790\uff1a\u6839\u636e\u6a21\u5f0f\u4e4b\u95f4\u7684 \u76f8\u4f3c\u6027 \u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\uff0c\u662f\u4e00\u79cd\u975e\u76d1\u7763\u5206\u7c7b\u65b9\u6cd5\u3002 \u76f8\u4f3c\u5ea6\u542b\u4e49 \u6709 n \u4e2a\u7279\u5f81\u5219\u7ec4\u6210 n \u7ef4\u5411\u91cf \\(X=[x_1, x_2, ..., x_n]^{\\top}\\) \u79f0\u4e3a\u8be5\u6837\u672c\u7684\u7279\u5f81\u5411\u91cf\u3002\u5b83\u76f8\u5f53\u4e8e\u7279\u5f81\u7a7a\u95f4\u4e2d\u7684\u4e00\u4e2a\u70b9\uff0c\u4ee5\u7279\u5f81\u7a7a\u95f4\u4e2d\uff0c \u70b9\u95f4\u7684\u8ddd\u79bb\u51fd\u6570\u4f5c\u4e3a\u6a21\u5f0f\u76f8\u4f3c\u5ea6\u7684\u6d4b\u91cf \uff0c\u4ee5\u201c\u8ddd\u79bb\u201d\u4f5c\u4e3a\u6a21\u5f0f\u5206\u7c7b\u7684\u4f9d\u636e\uff0c \u8ddd\u79bb\u8d8a\u5c0f\uff0c\u8d8a\u76f8\u4f3c \u805a\u7c7b\u5206\u6790\u662f\u5426\u6709\u6548\uff0c\u4e0e\u6a21\u5f0f\u7279\u5f81\u5411\u91cf\u7684\u5206\u5e03\u5f62\u5f0f\u6709\u5f88\u5927\u5173\u7cfb\u3002\u9009\u53d6\u7684\u7279\u5f81\u5411\u91cf\u662f\u5426\u5408\u9002\u975e\u5e38\u5173\u952e\u3002 \u76f8\u4f3c\u6027\u6d4b\u5ea6\u548c\u805a\u7c7b\u51c6\u5219 \u00b6 \u76f8\u4f3c\u6027\u6d4b\u5ea6 \u00b6 \u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u76f8\u4f3c\u6027\u7684\u4e00\u79cd\u5c3a\u5ea6\u3002\u5982\uff1a\u8ddd\u79bb\u3002 \u6b27\u6c0f\u8ddd\u79bb \u8bbe \\(X_1, X_2\\) \u4e3a\u4e24\u4e2a n \u7ef4\u6a21\u5f0f\u6837\u672c\uff0c \\(X_1 = [x_{11}, x_{12}, ..., x_{1n}]^{\\top}, X_2 = [x_{21}, x_{22}, ..., x_{2n}]^{\\top}\\) \uff0c\u6b27\u6c0f\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D(X_1, X_2) = \\parallel X_1 - X_2 \\parallel = \\sqrt{(X_1 - X_2)^{\\top}(X_1-X_2)} \\] \u8ddd\u79bb\u8d8a\u5c0f\u8d8a\u76f8\u4f3c\u3002 \u9a6c\u5f0f\u8ddd\u79bb \u5e73\u65b9\u8868\u8fbe\u5f0f\uff1a \\(D^2=(X_1-X_2)^{\\top}C^{-1}(X_1-X_2)\\) \u4ee4 \\(M:\\) \u5747\u503c\u5411\u91cf M_Mean\uff0c \\(C:\\) \u8be5\u7c7b\u6a21\u5f0f\u603b\u4f53\u7684\u534f\u65b9\u5dee\u77e9\u9635 C_covariance\u3002 \u5bf9 n \u7ef4\u5411\u91cf: \\(X=[x_1, ..., x_n]^{\\top},M=[m_1,...,m_n]^{\\top}\\) \\[ C = E\\{(X-M)(X-M)^{\\top}\\} \\\\ = E \\{ \\begin{bmatrix} (x_1-m_1) \\\\ (x_2-m_2) \\\\ ... \\\\ (x_n-m_n) \\end{bmatrix} [(x_1-m_1)(x_2-m_2)\\cdot \\cdot \\cdot (x_n-m_n)]\\} \\\\ = \\begin{bmatrix} \\sigma_{11}^2 & \\sigma_{12}^2 & ... & \\sigma_{1n}^2 \\\\ \\sigma_{21}^2 & \\sigma_{22}^2 & ... & \\sigma_{2n}^2 \\\\ ... & ... & ... & ... \\\\ \\sigma_{n1}^2 & \\sigma_{n2}^2 & ... & \\sigma_{nn}^2 \\end{bmatrix} \\] \u8868\u793a\u7684\u6982\u5ff5\u662f\u5404\u5206\u91cf\u4e0a\u6a21\u5f0f\u6837\u672c\u5230\u5747\u503c\u7684\u8ddd\u79bb\uff0c\u4e5f\u5c31\u662f\u5728\u5404\u7ef4\u4e0a\u6a21\u5f0f\u7684\u5206\u6563\u60c5\u51b5\u3002 \\(\\sigma_{jk}^2\\) \u8d8a\u5927\uff0c\u79bb\u5747\u503c\u8d8a\u8fdc\u3002 \u5f53 \\(C=I\\) \u65f6\uff0c\u9a6c\u5f0f\u8ddd\u79bb\u5c31\u662f\u6b27\u6c0f\u8ddd\u79bb\u3002 \u7279\u70b9\uff1a \u9a6c\u5f0f\u8ddd\u79bb\u7684\u8ba1\u7b97\u662f\u5efa\u7acb\u5728\u603b\u4f53\u6837\u672c\u7684\u57fa\u7840\u4e0a\u3002\u540c\u6837\u7684\u4e24\u4e2a\u6837\u672c\uff0c\u653e\u5165\u4e24\u4e2a\u4e0d\u540c\u7684\u603b\u4f53\u4e2d\uff0c\u6700\u540e\u8ba1\u7b97\u5f97\u51fa\u4e24\u4e2a\u6837\u672c\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u901a\u5e38\u662f\u4e0d\u76f8\u540c\u7684\uff1b \u4e0d\u53d7\u91cf\u7eb2\u7684\u5f71\u54cd\uff0c\u4e24\u70b9\u4e4b\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u4e0e\u539f\u59cb\u6570\u636e\u7684\u6d4b\u91cf\u5355\u4f4d\u65e0\u5173\uff1b \u9a6c\u5f0f\u8ddd\u79bb\u53ef\u4ee5\u6392\u51fa\u53d8\u91cf\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u7684\u5e72\u6270\uff1b \u5938\u5927\u4e86\u53d8\u5316\u5fae\u5c0f\u7684\u53d8\u91cf\u7684\u4f5c\u7528\u3002 \u660e\u6c0f\u8ddd\u79bb n \u7ef4\u6a21\u5f0f\u6837\u672c\u5411\u91cf \\(X_i\u3001X_j\\) \u95f4\u7684\u660e\u6c0f\u8ddd\u79bb\u8868\u793a\u4e3a\uff1a \\[ D_m(X_i, X_j)=[\\sum_{k=1}^n|x_{ik}-x_{jk}|^m]^{\\frac{1}{m}} \\] \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u5f53 \\(m=2\\) \u65f6\uff0c\u660e\u6c0f\u8ddd\u79bb\u4e3a\u6b27\u6c0f\u8ddd\u79bb\u3002 \u5f53 \\(m=1\\) \u65f6\uff0c \\(D_1(X_i, X_j)=\\sum_{k=1}^n|x_{ik}-x_{jk}|\\) \uff0c\u4e3a\u8857\u574a\u8ddd\u79bb\u3002 \u6c49\u660e\u8ddd\u79bb \u8bbe \\(X_i\u3001X_j\\) \u4e3a n \u7ef4\u4e8c\u503c(1 \u6216 -1)\u6a21\u5f0f\u6837\u672c\u5411\u91cf\uff0c\u5219 \u6c49\u660e\u8ddd\u79bb\u4e3a \\(D_h(X_i, X_j)=\\frac{1}{2}(n-\\sum_{k=1}^n x_{ik}*x_{jk})\\) \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u4e24\u4e2a\u6a21\u5f0f\u5411\u91cf\u7684\u5404\u5206\u91cf\u53d6\u503c\u5747\u4e0d\u540c\uff1a \\(D_h(X_i, X_j)=n\\) \uff0c\u5168\u76f8\u540c\uff1a \\(D_h(X_i, X_j)=0\\) \u89d2\u5ea6\u76f8\u4f3c\u6027\u51fd\u6570 \\[ S(X_i, X_j) = \\frac{X_i^{\\top}X_j}{\\parallel X_i \\parallel \\cdot \\parallel X_j \\parallel} \\] \u662f\u6a21\u5f0f\u5411\u91cf \\(X_i, X_j\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7684\u4f59\u5f26\u3002 Tanimoto \u6d4b\u5ea6 \u7528\u4e8e 0,1 \u4e8c\u503c\u7279\u5f81\u7684\u60c5\u51b5, \\[ S(X_i,X_j)=\\frac{X_i^{\\top}X_j}{X_i^{\\top}X_i+X_j^{\\top}X_j-X_i^{\\top}X_j} \\\\ \\ \\\\ = \\frac{X_i,X_j\u4e2d\u5171\u6709\u7684\u7279\u5f81\u6570\u76ee}{X_i\u548cX_j\u4e2d\u5360\u6709\u7684\u7279\u5f81\u6570\u76ee\u7684\u603b\u6570} \\] \u76f8\u4f3c\u6027\u6d4b\u5ea6\u51fd\u6570\u7684\u5171\u540c\u70b9\u90fd\u6d89\u53ca\u5230\u628a\u4e24\u4e2a\u76f8\u6bd4\u8f83\u7684\u5411\u91cf \\(X_i,X_j\\) \u7684\u5206\u91cf\u503c\u7ec4\u5408\u8d77\u6765\uff0c\u4f46\u600e\u6837\u7ec4\u5408\u5e76\u65e0\u666e\u904d\u6709\u6548\u7684\u65b9\u6cd5\uff0c\u5bf9\u5177\u4f53\u7684\u6a21\u5f0f\u5206\u7c7b\uff0c\u9700\u89c6\u60c5\u51b5\u4f5c\u9002\u5f53\u9009\u62e9\u3002 \u805a\u7c7b\u51c6\u5219 \u00b6 \u6839\u636e\u76f8\u4f3c\u6027\u6d4b\u5ea6\u786e\u5b9a\u7684\uff0c\u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u662f\u5426\u76f8\u4f3c\u7684\u6807\u51c6\u3002\u5373\u628a\u4e0d\u540c\u6a21\u5f0f\u805a\u4e3a\u4e00\u7c7b\u8fd8\u662f\u5f52\u4e3a\u4e0d\u540c\u7c7b\u7684\u51c6\u5219\u3002 \u786e\u5b9a\u805a\u7c7b\u51c6\u5219\u7684\u4e24\u79cd\u65b9\u5f0f\uff1a \u9608\u503c\u51c6\u5219\uff1a\u6839\u636e\u89c4\u5b9a\u7684\u8ddd\u79bb\u9608\u503c\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u51fd\u6570\u51c6\u5219\uff1a\u5229\u7528\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u805a\u7c7b\u51c6\u5219\u51fd\u6570\uff1a\u5728\u805a\u7c7b\u5206\u6790\u4e2d\uff0c\u8868\u793a\u6a21\u5f0f\u7c7b\u95f4\u76f8\u4f3c\u6216\u5dee\u5f02\u6027\u7684\u51fd\u6570 \u5b83\u5e94\u662f\u6a21\u5f0f\u6837\u672c\u96c6 \\(\\{X\\}\\) \u548c\u6a21\u5f0f\u7c7b\u522b \\(\\{S_j,j=1,2,..,c\\}\\) \u7684\u51fd\u6570\u3002\u53ef\u4f7f\u805a\u7c7b\u5206\u6790\u8f6c\u5316\u4e3a\u5bfb\u627e\u51c6\u5219\u51fd\u6570\u6781\u503c\u7684\u6700\u4f18\u5316\u95ee\u9898\u3002\u4e00\u79cd\u5e38\u7528\u7684\u6307\u6807\u662f\u8bef\u5dee\u5e73\u65b9\u4e4b\u548c\u3002 \u805a\u7c7b\u51c6\u5219\u51fd\u6570 \\[J=\\sum_{j=1}^c\\sum_{X \\in S_j} \\parallel X-M_j \\parallel^2\\] \u5f0f\u4e2d\uff1ac \u4e3a\u805a\u7c7b\u7c7b\u522b\u7684\u6570\u76ee\uff0c \\(M_j=\\frac{1}{N_j}\\sum_{X \\in S_j}X\\) \u4e3a\u5c5e\u4e8e \\(S_j\\) \u96c6\u7684\u6837\u672c\u7684\u5747\u503c\u5411\u91cf\uff0c \\(N_j\\) \u4e3a \\(S_j\\) \u4e2d\u6837\u672c\u6570\u76ee\u3002 \\(J\\) \u4ee3\u8868\u4e86\u5206\u5c5e\u4e8e c \u4e2a\u805a\u7c7b\u7c7b\u522b\u7684\u5168\u90e8\u6a21\u5f0f\u6837\u672c\u4e0e\u5176\u76f8\u5e94\u7c7b\u522b\u6a21\u5f0f\u5747\u503c\u4e4b\u95f4\u7684\u8bef\u5dee\u5e73\u65b9\u548c\u3002 \u9002\u7528\u8303\u56f4\uff1a\u9002\u7528\u4e8e\u5404\u7c7b\u6837\u672c\u5bc6\u96c6\u4e14\u6570\u76ee\u76f8\u5dee\u4e0d\u591a\uff0c\u800c\u4e0d\u540c\u7c7b\u95f4\u7684\u6837\u672c\u53c8\u660e\u663e\u5206\u5f00\u7684\u60c5\u51b5\u3002 \u57fa\u4e8e\u8ddd\u79bb\u9608\u503c\u7684\u805a\u7c7b\u7b97\u6cd5 \u00b6 \u8fd1\u90bb\u805a\u7c7b\u6cd5 \u00b6 \u95ee\u9898\uff1a\u6709 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u8981\u6c42\u6309\u8ddd\u79bb\u9608\u503c \\(T\\) \u5206\u7c7b\u5230\u4ee5 \\(Z_1, Z_2,...\\) \u4e3a\u805a\u7c7b\u4e2d\u5fc3\u7684\u6a21\u5f0f\u7c7b\u4e2d\u3002 \u7b97\u6cd5\u63cf\u8ff0 \u4efb\u53d6\u6837\u672c \\(X_i\\) \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u521d\u59cb\u503c\uff0c\u5982\u4ee4 \\(Z_1=X_1\\) \u8ba1\u7b97\u6837\u672c \\(X_2\\) \u5230 \\(Z_1\\) \u7684\u6b27\u6c0f\u8ddd\u79bb \\(D_{21}=\\parallel X_2 - Z_1 \\parallel\\) \uff0c\u82e5 \\(D_{21}>T\\) \uff0c\u5b9a\u4e49\u4e00\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2=X_2\\) \uff1b\u5426\u5219 \\(X_2 \\in\\) \u4ee5 \\(Z_1\\) \u4e3a\u4e2d\u5fc3\u7684\u805a\u7c7b\u3002 \u5047\u8bbe\u5df2\u6709\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\u3001Z_2\\) \uff0c\u8ba1\u7b97 \\(D_{31}=\\parallel X_3 - Z_1 \\parallel\\) \u548c \\(D_{32}=\\parallel X_3 - Z_2 \\parallel\\) \uff0c\u82e5 \\(D_{31}>T\\) \u4e14 \\(D_{32} > T\\) \uff0c\u5219\u5efa\u7acb\u7b2c\u4e09\u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(Z_3=X_3\\) \uff1b\u5426\u5219 \\(X_3 \\in\\) \u79bb \\(Z_1\\) \u548c \\(Z_2\\) \u4e2d\u6700\u8fd1\u8005\uff08\u6700\u8fd1\u90bb\u7684\u805a\u7c7b\u4e2d\u5fc3\uff09\u3002 \u4f9d\u6b64\u7c7b\u63a8\uff0c\u76f4\u5230\u5c06\u6240\u6709\u7684 \\(N\\) \u4e2a\u6837\u672c\u90fd\u8fdb\u884c\u5206\u7c7b \u7b97\u6cd5\u7279\u70b9 \u5c40\u9650\u6027\uff1a\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u4e8e\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u9009\u62e9\u3001\u5f85\u5206\u7c7b\u6a21\u5f0f\u6837\u672c\u7684\u6392\u5217\u6b21\u5e8f\u3001\u8ddd\u79bb\u9608\u503c \\(T\\) \u7684\u5927\u5c0f\u4ee5\u53ca\u6837\u672c\u5206\u5e03\u7684\u51e0\u4f55\u6027\u8d28\u7b49\u3002 \u4f18\u70b9\uff1a\u8ba1\u7b97\u7b80\u5355\u3002\uff08\u4e00\u79cd\u867d\u7c97\u7cd9\u4f46\u5feb\u901f\u7684\u65b9\u6cd5\uff09 \u6700\u5927\u6700\u5c0f\u7b97\u6cd5\uff08\u5c0f\u4e2d\u53d6\u5927\u8ddd\u79bb\u7b97\u6cd5\uff09 \u00b6 \u95ee\u9898\uff1a\u5df2\u77e5 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u5206\u7c7b\u5230\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1, Z_2, ...\\) \u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u7b97\u6cd5\u63cf\u8ff0 \u9009\u4efb\u610f\u4e00\u6a21\u5f0f\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e00\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\\) \u9009\u62e9\u79bb \\(Z_1\\) \u8ddd\u79bb\u6700\u8fdc\u7684\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e8c\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2\\) \u9010\u4e2a\u8ba1\u7b97\u5404\u6a21\u5f0f\u6837\u672c\u4e0e\u5df2\u786e\u5b9a\u7684\u6240\u6709\u805a\u7c7b\u4e2d\u5fc3\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5e76\u9009\u51fa\u5176\u4e2d\u7684\u6700\u5c0f\u8ddd\u79bb\u3002\u4f8b\u5982\u805a\u7c7b\u4e2d\u5fc3\u6570 \\(k=2\\) \u65f6\uff0c\u8ba1\u7b97 \\(D_{i1}=\\parallel X_i - Z_1 \\parallel\\) , \\(D_{i2}=\\parallel X_i - Z_2 \\parallel\\) \uff0c \\(\\min\\{D_{i1}, D_{i2}\\}, i=1,...,N\\) (N \u4e2a\u6700\u5c0f\u8ddd\u79bb) \u5728\u6240\u6709\u6700\u5c0f\u8ddd\u79bb\u4e2d\u9009\u51fa\u6700\u5927\u8ddd\u79bb\uff0c\u5982\u8be5\u6700\u5927\u503c\u8fbe\u5230 \\(\\parallel Z_1 - Z_2 \\parallel\\) \u7684\u4e00\u5b9a\u5206\u6570\u6bd4\u503c\uff08\u9608\u503c \\(T\\) \uff09\u4ee5\u4e0a\uff0c\u5219\u76f8\u5e94\u7684\u6837\u672c\u70b9\u53d6\u4e3a\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\uff0c\u8fd4\u56de 3\uff1b\u5426\u5219\u7ed3\u675f \u91cd\u590d\u6b65\u9aa4 3\u30014\uff0c\u76f4\u5230\u6ca1\u6709\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\u51fa\u73b0\u4e3a\u6b62 \u5c06\u6837\u672c \\(\\{X_1, i=1,2,..,N\\}\\) \u6309\u6700\u8fd1\u8ddd\u79bb\u5212\u5206\u5230\u76f8\u5e94\u805a\u7c7b\u4e2d\u5fc3\u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u603b\u7ed3\uff1a\u5148\u627e\u4e2d\u5fc3\u540e\u5206\u7c7b\uff1b\u5173\u952e\uff1a\u600e\u4e48\u5f00\u65b0\u7c7b\uff0c\u805a\u7c7b\u4e2d\u5fc3\u5982\u4f55\u5b9a \u5c42\u6b21\u805a\u7c7b\u6cd5 \u00b6 \u6bcf\u4e2a\u6837\u672c\u5148\u81ea\u6210\u4e00\u7c7b\uff0c\u7136\u540e\u6309\u8ddd\u79bb\u51c6\u5219\u9010\u6b65\u5408\u5e76\uff0c\u51cf\u5c11\u7c7b\u6570 \u7b97\u6cd5\u63cf\u8ff0 \\(N\\) \u4e2a\u521d\u59cb\u6a21\u5f0f\u6837\u672c\u81ea\u6210\u4e00\u7c7b\uff0c\u5373\u5efa \\(N\\) \u7c7b\uff1a \\(G_1(0), G_2(0), ..., G_N(0)\\) \uff0c\u8ba1\u7b97\u5404\u7c7b\u4e4b\u95f4\uff08\u5373\u5404\u6837\u672c\u95f4\uff09\u7684\u8ddd\u79bb\uff0c\u5f97\u4e00 \\(N \\times N\\) \u7ef4\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(0)\\) \u3002 \\(\u201c0\u201d\\) \u8868\u793a\u521d\u59cb\u72b6\u6001 \u5047\u8bbe\u5df2\u6c42\u5f97\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(n)\\) \uff08n\u4e3a\u9010\u6b21\u805a\u7c7b\u5408\u5e76\u7684\u6b21\u6570\uff09\uff0c\u627e\u51fa \\(\\mathbf{D}(n)\\) \u4e2d\u7684\u6700\u5c0f\u5143\u7d20\uff0c\u5c06\u5176\u5bf9\u5e94\u7684\u4e24\u7c7b\u5408\u5e76\u6210\u4e00\u7c7b\u3002\u7531\u6b64\u5efa\u7acb\u65b0\u7684\u5206\u7c7b\uff1a \\(G_1(n+1), G_2(n+1),...\\) \u8ba1\u7b97\u5408\u5e76\u540e\u65b0\u7c7b\u522b\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5f97 \\(\\mathbf{D}(n+1)\\) \u8df3\u5230\u7b2c 2 \u6b65\uff0c\u91cd\u590d\u8ba1\u7b97\u53ca\u5408\u5e76 \u7ed3\u675f\u6761\u4ef6 \u53d6\u8ddd\u79bb\u9608\u503c \\(T\\) \uff0c\u5f53 \\(\\mathbf{D}(n)\\) \u7684\u6700\u5c0f\u5206\u91cf\u8d85\u8fc7\u7ed9\u5b9a\u503c \\(T\\) \u65f6\uff0c\u7b97\u6cd5\u505c\u6b62\uff0c\u6240\u5f97\u5373\u4e3a\u805a\u7c7b\u7ed3\u679c \u6216\u4e0d\u8bbe\u9608\u503c \\(T\\) \uff0c\u4e00\u76f4\u5c06\u5168\u90e8\u6837\u672c\u805a\u6210\u4e00\u7c7b\u4e3a\u6b62\uff0c\u8f93\u51fa\u805a\u7c7b\u7684\u5206\u7ea7\u6811 \u95ee\u9898\u8ba8\u8bba\uff1a\u7c7b\u95f4\u8ddd\u79bb\u8ba1\u7b97\u51c6\u5219 \u6700\u77ed\u8ddd\u79bb\u6cd5 \u5982 \\(H\u3001K\\) \u662f\u4e24\u4e2a\u805a\u7c7b\uff0c\u5219\u4e24\u7c7b\u95f4\u7684\u6700\u77ed\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D_{HK} = \\min\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\] \u6700\u957f\u8ddd\u79bb\u6cd5 \\[ D_{HK} = \\max\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\\\ \u82e5 K \u7c7b\u7531 I\u3001J \u4e24\u7c7b\u5408\u5e76\u800c\u6210\u5219 \\\\ D_{HK} = \\max\\{D_{HI}, D_{HJ}\\} \\] \u4e2d\u95f4\u8ddd\u79bb\u6cd5 \u4ecb\u4e8e\u6700\u957f\u4e0e\u6700\u77ed\u7684\u8ddd\u79bb\u4e4b\u95f4 \\[ D_{HK}=\\sqrt{\\frac{1}{2} D_{HI}^2+\\frac{1}{2}D_{HJ}^2-\\frac{1}{4}D_{IJ}^2} \\] \u91cd\u5fc3\u6cd5 \u5c06\u6bcf\u7c7b\u4e2d\u5305\u542b\u7684\u6837\u672c\u6570\u8003\u8651\u8fdb\u53bb\u3002\u82e5 \\(I\\) \u7c7b\u4e2d\u6709 \\(n_I\\) \u4e2a\u6837\u672c\uff0c\u82e5 \\(J\\) \u7c7b\u4e2d\u6709 \\(n_J\\) \u4e2a\u6837\u672c \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2-\\frac{n_In_J}{n_I+n_J}D_{IJ}^2} \\] \u7c7b\u5e73\u5747\u8ddd\u79bb\u6cd5 \\[ D_{HK}=\\sqrt{\\frac{1}{n_Hn_K} \\sum_{i \\in H,j \\in K}d_{ij}^2} \\] \\(d_{ij}\\) \uff1a \\(H\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u548c \\(K\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u5e73\u65b9 \u82e5 \\(K\\) \u7c7b\u7531 \\(I\\) \u7c7b\u548c \\(J\\) \u7c7b\u5408\u5e76\u4ea7\u751f\uff0c\u5219\u9012\u63a8\u5f0f\u4e3a \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2} \\] \u52a8\u6001\u805a\u7c7b\u6cd5 \u00b6 \u4e24\u79cd\u5e38\u7528\u7684\u7b97\u6cd5\uff1a \\(K\\) -\u5747\u503c\u7b97\u6cd5(\u6216 \\(C\\) -\u5747\u503c\u7b97\u6cd5) \u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5 K-\u5747\u503c\u7b97\u6cd5 \u00b6 \u57fa\u4e8e\u4f7f\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u6700\u5c0f\u5316 \u51c6\u5219\u51fd\u6570\uff1a\u805a\u7c7b\u96c6\u4e2d\u6bcf\u4e00\u6837\u672c\u70b9\u5230\u8be5\u7c7b\u4e2d\u5fc3\u5230\u8ddd\u79bb\u5e73\u65b9\u548c \u5bf9\u4e8e\u7b2c j \u805a\u7c7b\u96c6\uff0c\u51c6\u5219\u51fd\u6570\u5b9a\u4e49\u4e3a \\(J_j = \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2\uff0c\\ \\ \\ X_i \\in S_j\\) \\(S_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6\uff0c\u805a\u7c7b\u4e2d\u5fc3\u4e3a \\(Z_j\\) \\(N_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6 \\(S_j\\) \u4e2d\u6240\u5305\u542b\u7684\u6837\u672c\u4e2a\u6570 \u5bf9\u6240\u6709 \\(K\\) \u4e2a\u6a21\u5f0f\u7c7b\u6709 \\(J = \\sum_{j=1}^{K} \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2, \\ \\ \\ X_i \\in S_j\\) \u805a\u7c7b\u51c6\u5219\uff1a \u805a\u7c7b\u4e2d\u5fc3\u7684\u9009\u62e9\u5e94\u4f7f\u51c6\u5219\u51fd\u6570 \\(J\\) \u6781\u5c0f\uff0c\u5373\u4f7f \\(J_j\\) \u7684\u503c\u5f88\u5c0f \u8ba9 \\(\\frac{\\partial J_j}{\\partial \\mathbf{Z}_j}=0\\) \uff0c\u89e3\u5f97 \\(\\mathbf{Z}_j = \\frac{1}{N_j} \\sum_{i=1}^{N_j} \\mathbf{X_i}, \\ \\ \\ \\mathbf{X}_i \\in S_j\\) \u7b97\u6cd5\u63cf\u8ff0: \u4efb\u9009 K \u4e2a\u521d\u59cb\u805a\u7c7b\u4e2d\u5fc3\uff1a \\(\\mathbf{Z}_1(1), \\mathbf{Z}_2(1), ..., \\mathbf{Z}_K(1)\\) \u62ec\u53f7\u5185\u5e8f\u53f7\uff1a\u8fed\u4ee3\u8fd0\u7b97\u7684\u6b21\u5e8f\u53f7 \u6309\u6700\u5c0f\u8ddd\u79bb\u539f\u5219\u5c06\u5176\u4f59\u6837\u54c1\u5206\u914d\u5230 K \u4e2a\u805a\u7c7b\u4e2d\u5fc3\u4e2d\u7684\u67d0\u4e00\u4e2a\uff0c\u5373 \\(\\min\\{\\parallel X - Z_i(k) \\parallel, i=1,2,...,K\\}=\\parallel X-Z_j(k) \\parallel=D_j(k)\uff0c\u5219 X \\in S_j(k)\\) \uff0c\u6ce8\u610f\uff0ck \u662f\u8fed\u4ee3\u8fd0\u7b97\u6b21\u5e8f\u53f7\uff0cK \u662f\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u8ba1\u7b97\u5404\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u65b0\u5411\u91cf\u503c: \\(Z_j(k+1) \\ \\ j=1,2,...,K\\) \\[ Z_j(k+1) = \\frac{1}{N_j} \\sum_{X \\in S_j(k)} \\mathbf{X} \\ \\ \\ j=1,2,...,K \\] \\(N_j\\) : \u7b2c j \u7c7b\u7684\u6837\u672c\u6570 \u5224\u65ad \u5982\u679c \\(Z_j(k+1) \\ne Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u5219\u56de\u5230 2\uff0c\u5c06\u6a21\u5f0f\u6837\u672c\u9010\u4e2a\u91cd\u65b0\u5206\u7c7b\uff0c\u91cd\u590d\u8fed\u4ee3\u8ba1\u7b97 \u5982\u679c \\(Z_j(k+1) = Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u7b97\u6cd5\u6536\u655b\uff0c\u8ba1\u7b97\u5b8c\u6bd5 \u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5 \u00b6 \u7b97\u6cd5\u7279\u70b9 \u52a0\u5165\u4e86\u8bd5\u63a2\u6027\u6b65\u9aa4\uff0c\u7ec4\u6210\u4eba\u673a\u4ea4\u4e92\u7684\u7ed3\u6784 \u53ef\u4ee5\u901a\u8fc7\u7c7b\u7684\u81ea\u52a8\u5408\u5e76\u4e0e\u5206\u88c2\u5f97\u5230\u8f83\u5408\u7406\u7684\u7c7b\u522b\u6570 \u4e0e K-\u5747\u503c\u7b97\u6cd5 \u76f8\u4f3c\uff1a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u5747\u901a\u8fc7\u6837\u672c\u5747\u503c\u7684\u8fed\u4ee3\u8fd0\u7b97\u51b3\u5b9a \u76f8\u5f02\uff1aK-\u5747\u503c\u7b97\u6cd5\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570\u4e0d\u53d8\uff0c\u4f46ISODATA\u7b97\u6cd5\u4e0d\u53d8 \u7b97\u6cd5\u63cf\u8ff0 \u9884\u9009 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(\\{Z_1, Z_2, ..., Z_{N_C}\\}\\) \uff0c \\(N_C\\) \u4e5f\u662f\u805a\u7c7b\u8fc7\u7a0b\u4e2d\u5b9e\u9645\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u628a N \u4e2a\u6837\u672c\u6309\u6700\u8fd1\u90bb\u89c4\u5219\u5206\u914d\u5230 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d \\[ \u82e5 \\ \\ \\ \\parallel X - Z_j \\parallel = \\min\\{\\parallel X - Z_i, i = 1, ,2, .., N_C\\} \\\\ \u5219 \\ \\ \\ X \\in S_j \\] \u82e5 \\(S_j\\) \u4e2d\u7684\u6837\u672c\u6570 \\(N_j < \\theta_N\\) \uff0c\u5219\u53d6\u6d88\u8be5\u7c7b\uff0c\u5e76\u4e14 \\(N_C\\) \u51cf\u53bb 1 \u4fee\u6b63\u5404\u805a\u7c7b\u4e2d\u5fc3\u503c \\(Z_j = \\frac{1}{N_j} \\sum_{X \\in S_j} X \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97 \\(S_j\\) \u7684\u7c7b\u5185\u7684\u5e73\u5747\u8ddd\u79bb \\(\\bar{D_j} = \\frac{1}{N_j} \\sum_{X \\in S_j} \\parallel X - Z_j \\parallel \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97\u603b\u4f53\u5e73\u5747\u8ddd\u79bb \u5224\u65ad\u5f53\u524d\u662f\u5206\u88c2\u8fd8\u662f\u5408\u5e76\uff0c\u51b3\u5b9a\u8fed\u4ee3\u6b65\u9aa4\u7b49 \u82e5 \\(N_C \\le K/2\\) \uff0c\u8fdb\u5165\u5206\u88c2 \u5982\u679c\u8fed\u4ee3\u6b21\u6570\u662f\u5076\u6570\u6216 \\(N_C \\ge 2K\\) \uff0c\u5219\u5408\u5e76\u5426\u5219\u5206\u88c2 \u8ba1\u7b97\u6bcf\u4e2a\u805a\u7c7b\u4e2d\u6837\u672c\u8ddd\u79bb\u7684\u6807\u51c6\u5dee\u5411\u91cf \u6c42\u6bcf\u4e2a\u6807\u51c6\u5dee\u5411\u91cf\u7684\u6700\u5927\u5206\u91cf \u592a\u957f\u4e86\u3002\u3002\u3002 \u5168\u662f\u516c\u5f0f\u3002\u3002\u3002 \u5224\u522b\u51fd\u6570 \u00b6 \u5224\u522b\u51fd\u6570 \u00b6 \u5b9a\u4e49\uff1a\u76f4\u63a5\u7528\u6765\u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219\u51fd\u6570\u3002\u82e5\u5206\u5c5e\u4e8e \\(\\omega_1, \\omega_2\\) \u7684\u4e24\u7c7b\u6a21\u5f0f\u53ef\u7528\u4e00\u65b9\u7a0b \\(d(X)=0\\) \u6765\u5212\u5206\uff0c\u90a3\u4e48\u79f0 \\(d(X)\\) \u4e3a\u5224\u522b\u51fd\u6570\u3002 \u786e\u5b9a\u5224\u522b\u51fd\u6570\u7684\u4e24\u4e2a\u56e0\u7d20 \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u51e0\u4f55\u6027\u8d28\u3002\u5b83\u53ef\u4ee5\u662f\u7ebf\u6027\u7684\u6216\u975e\u7ebf\u6027\u7684\u51fd\u6570\uff0c\u7ef4\u6570\u5728\u7279\u5f81\u63d0\u53d6\u65f6\u5df2\u7ecf\u786e\u5b9a \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u7cfb\u6570\uff0c\u7528\u6240\u7ed9\u7684\u6a21\u5f0f\u6837\u672c\u786e\u5b9a \u7ebf\u6027\u5224\u522b\u51fd\u6570 \u00b6 \u4e00\u822c\u5f62\u5f0f \u00b6 \u5c06\u4e8c\u7ef4\u5f62\u5f0f\u63a8\u5e7f\u5230 n \u7ef4\uff0c\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f\u4e3a \\[ d(X) = w_1x_1+w_2x_2+...+w_nx_n+w_{n+1}=W_0^{\\top}X+w_{n+1} \\] \u589e\u5e7f\u5411\u91cf\u7684\u5f62\u5f0f \\(d(X)=W^{\\top}X\\) \u6027\u8d28 \u00b6 \u4e24\u7c7b\u60c5\u51b5 \\[ d(X)=W^{\\top}X \\left\\{\\begin{matrix} >0 & \u82e5 X \\in \\omega_1 \\\\ <0 & \u82e5 X \\in \\omega_2 \\end{matrix}\\right. \\] \u591a\u7c7b\u60c5\u51b5 \\(\\omega_i \\sqrt{\\omega_i}\\) \u4e24\u5206\u6cd5 \u7528\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5c06\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u4e0e\u5176\u4f59\u4e0d\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u5206\u5f00 \\(\\omega_i \\omega_i\\) \u4e24\u5206\u6cd5 \u4e00\u4e2a\u5224\u522b\u754c\u9762\u53ea\u80fd\u5206\u5f00\u4e24\u4e2a\u7c7b\u522b\uff0c\u4e0d\u80fd\u628a\u5176\u4f59\u6240\u6709\u7684\u7c7b\u522b\u90fd\u5206\u5f00\u3002\u5224\u51b3\u51fd\u6570\u4e3a \\(d_{ij}(X)=W_{ij}^{\\top}X\\) \u6027\u8d28\uff1a \\(d_{ij}(X) > 0, \\forall j \\ne i; i, j = 1,2,...,M\uff0c\u82e5X \\in \\omega_i\\) \u5e7f\u4e49\u7ebf\u6027\u5224\u522b\u51fd\u6570 \u00b6 \u76ee\u7684\uff1a\u5bf9\u975e\u7ebf\u6027\u8fb9\u754c\uff0c\u901a\u8fc7\u67d0\u6620\u5c04\uff0c\u628a\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u53d8\u6210 \\(X^*\\) \uff0c\u4ee5\u4fbf\u5c06 \\(X\\) \u7a7a\u95f4\u4e2d\u975e\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6\uff0c\u53d8\u6210\u5728 \\(X^*\\) \u7a7a\u95f4\u4e2d\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6 \u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570 \u00b6 \u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u5f62\u5f0f\u4e4b\u4e00\u662f\u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570 \u8bbe\u4e00\u8bad\u7ec3\u7528\u6a21\u5f0f\u96c6\uff0c \\(\\{X\\}\\) \u5728\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u4e2d\u7ebf\u6027\u4e0d\u53ef\u5206\uff0c\u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ d(\\mathbf{X})=w_1f_1(\\mathbf{X})+w_2f_2(\\mathbf{X})+...+w_kf_k(\\mathbf{X})+w_{k+1}=\\sum_{i=1}^{k+1}w_if_i(\\mathbf{X}) \\\\ \u5f0f\u4e2d,\\{f_i(\\mathbf{X}),i=1,2,...,k\\}\u662f\u6a21\u5f0f\\mathbf{X}\u7684\u5355\u503c\u5b9e\u51fd\u6570\uff0cf_{k+1}(\\mathbf{X})=1 \\] \u5e7f\u4e49\u5f62\u5f0f\u7684\u6a21\u5f0f\u5411\u91cf\u5b9a\u4e49\u4e3a\uff1a \\[ \\mathbf{X}^*=[x_1^*+x_2^*+...+x_k^*+1]^\\top=[f_1(\\mathbf{X})+f_2(\\mathbf{X})+...+f_k(\\mathbf{X})+1]^\\top \\] \u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u51e0\u4f55\u6027\u8d28 \u00b6 \u6a21\u5f0f\u7a7a\u95f4\u4e0e\u8d85\u5e73\u9762 \u6743\u7a7a\u95f4\u548c\u6743\u5411\u91cf\u89e3 \u611f\u77e5\u5668\u7b97\u6cd5 \u00b6","title":"\u6a21\u5f0f\u8bc6\u522b"},{"location":"cs/ai/mode-recognition/#_1","text":"\u7ea6 3653 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u5b66\u4e60\u6a21\u5f0f\u8bc6\u522b\u8bfe\u7684\u4e00\u4e9b\u7b14\u8bb0","title":"\u6a21\u5f0f\u8bc6\u522b"},{"location":"cs/ai/mode-recognition/#_2","text":"","title":"\u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u8ff0"},{"location":"cs/ai/mode-recognition/#_3","text":"\u6a21\u5f0f\uff1a\u5bf9\u67d0\u4e9b\u611f\u5174\u8da3\u7684\u5ba2\u4f53\u7684\u5b9a\u91cf\u7684\u6216\u7ed3\u6784\u7684\u63cf\u8ff0\u3002\u6a21\u5f0f\u7c7b\u662f\u5177\u6709\u67d0\u4e9b\u5171\u540c\u7279\u6027\u7684\u6a21\u5f0f\u7684\u96c6\u5408\u3002 \u6a21\u5f0f\u8bc6\u522b\uff1a\u7814\u7a76\u4e00\u79cd\u81ea\u52a8\u6280\u672f\uff0c\u4f9d\u9760\u8fd9\u79cd\u6280\u672f\uff0c\u8ba1\u7b97\u673a\u5c06\u81ea\u52a8\u5730\uff08\u6216\u4eba\u5c3d\u91cf\u5c11\u5730\u5e72\u6d89\uff09\u628a\u5f85\u522b\u8bc6\u6a21\u5f0f\u5206\u914d\u5230\u5404\u81ea\u7684\u6a21\u5f0f\u7c7b\u4e2d\u53bb\u3002","title":"\u6a21\u5f0f\u548c\u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u5ff5"},{"location":"cs/ai/mode-recognition/#_4","text":"\u6ce8\u610f\u201c\u5904\u7406\u201d\u4e0e\u201c\u8bc6\u522b\u201d\u4e24\u4e2a\u6982\u5ff5\u7684\u533a\u522b","title":"\u6a21\u5f0f\u8bc6\u522b\u7cfb\u7edf\u7ec4\u6210"},{"location":"cs/ai/mode-recognition/#_5","text":"\u4ece\u7406\u8bba\u4e0a\u5206\u7c7b \u7edf\u8ba1\u6a21\u5f0f\u8bc6\u522b \u53e5\u6cd5\u6a21\u5f0f\u8bc6\u522b\uff08\u7ed3\u6784\u6a21\u5f0f\u8bc6\u522b\uff09 \u6a21\u7cca\u6a21\u5f0f\u8bc6\u522b \u795e\u7ecf\u7f51\u7edc\u6a21\u5f0f\u8bc6\u522b \u4ece\u5b9e\u73b0\u65b9\u6cd5\u5206\u7c7b \u76d1\u7763\u5206\u7c7b \u975e\u76d1\u7763\u5206\u7c7b","title":"\u6a21\u5f0f\u8bc6\u522b\u7684\u5206\u7c7b"},{"location":"cs/ai/mode-recognition/#_6","text":"\u4e0d\u505c\u8f66\u6536\u8d39\u7cfb\u7edf \u5173\u952e\uff1a\u8f66\u578b\u7684\u81ea\u52a8\u5206\u7c7b\u3002\u51e0\u79cd\u4e3b\u8981\u6280\u672f\uff1a \u63d0\u53d6\u8f66\u8f86\u5916\u5f62\u51e0\u4f55\u53c2\u6570\u8fdb\u884c\u5904\u7406\u5206\u6790\uff0c\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u89c6\u9891\u68c0\u6d4b\u65b9\u6cd5\u3001\u7ea2\u5916\u68c0\u6d4b\u65b9\u6cd5\u3002 \u6d4b\u91cf\u8f66\u8f86\u7684\u5176\u4ed6\u7269\u7406\u53c2\u6570\uff08\u566a\u58f0\u3001\u632f\u52a8\u3001\u538b\u91cd\u7b49\uff09\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u52a8\u6001\u79f0\u91cd\u3001\u7535\u78c1\u611f\u5e94\u7b49\u3002 \u76f4\u63a5\u8bc6\u522b\u8f66\u8f86\u8eab\u4efd\u7684\u65b9\u6cd5\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u7535\u5b50\u6807\u7b7e\u3001\u89c6\u9891\u724c\u7167\u65b9\u6cd5\u7b49","title":"\u6a21\u5f0f\u8bc6\u522b\u7684\u5e94\u7528"},{"location":"cs/ai/mode-recognition/#_7","text":"","title":"\u805a\u7c7b\u5206\u6790"},{"location":"cs/ai/mode-recognition/#_8","text":"\u6982\u5ff5\uff1a \u7269\u4ee5\u7c7b\u805a \u805a\u7c7b\u5206\u6790\uff1a\u6839\u636e\u6a21\u5f0f\u4e4b\u95f4\u7684 \u76f8\u4f3c\u6027 \u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\uff0c\u662f\u4e00\u79cd\u975e\u76d1\u7763\u5206\u7c7b\u65b9\u6cd5\u3002 \u76f8\u4f3c\u5ea6\u542b\u4e49 \u6709 n \u4e2a\u7279\u5f81\u5219\u7ec4\u6210 n \u7ef4\u5411\u91cf \\(X=[x_1, x_2, ..., x_n]^{\\top}\\) \u79f0\u4e3a\u8be5\u6837\u672c\u7684\u7279\u5f81\u5411\u91cf\u3002\u5b83\u76f8\u5f53\u4e8e\u7279\u5f81\u7a7a\u95f4\u4e2d\u7684\u4e00\u4e2a\u70b9\uff0c\u4ee5\u7279\u5f81\u7a7a\u95f4\u4e2d\uff0c \u70b9\u95f4\u7684\u8ddd\u79bb\u51fd\u6570\u4f5c\u4e3a\u6a21\u5f0f\u76f8\u4f3c\u5ea6\u7684\u6d4b\u91cf \uff0c\u4ee5\u201c\u8ddd\u79bb\u201d\u4f5c\u4e3a\u6a21\u5f0f\u5206\u7c7b\u7684\u4f9d\u636e\uff0c \u8ddd\u79bb\u8d8a\u5c0f\uff0c\u8d8a\u76f8\u4f3c \u805a\u7c7b\u5206\u6790\u662f\u5426\u6709\u6548\uff0c\u4e0e\u6a21\u5f0f\u7279\u5f81\u5411\u91cf\u7684\u5206\u5e03\u5f62\u5f0f\u6709\u5f88\u5927\u5173\u7cfb\u3002\u9009\u53d6\u7684\u7279\u5f81\u5411\u91cf\u662f\u5426\u5408\u9002\u975e\u5e38\u5173\u952e\u3002","title":"\u8ddd\u79bb\u805a\u7c7b\u7684\u6982\u5ff5"},{"location":"cs/ai/mode-recognition/#_9","text":"","title":"\u76f8\u4f3c\u6027\u6d4b\u5ea6\u548c\u805a\u7c7b\u51c6\u5219"},{"location":"cs/ai/mode-recognition/#_10","text":"\u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u76f8\u4f3c\u6027\u7684\u4e00\u79cd\u5c3a\u5ea6\u3002\u5982\uff1a\u8ddd\u79bb\u3002 \u6b27\u6c0f\u8ddd\u79bb \u8bbe \\(X_1, X_2\\) \u4e3a\u4e24\u4e2a n \u7ef4\u6a21\u5f0f\u6837\u672c\uff0c \\(X_1 = [x_{11}, x_{12}, ..., x_{1n}]^{\\top}, X_2 = [x_{21}, x_{22}, ..., x_{2n}]^{\\top}\\) \uff0c\u6b27\u6c0f\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D(X_1, X_2) = \\parallel X_1 - X_2 \\parallel = \\sqrt{(X_1 - X_2)^{\\top}(X_1-X_2)} \\] \u8ddd\u79bb\u8d8a\u5c0f\u8d8a\u76f8\u4f3c\u3002 \u9a6c\u5f0f\u8ddd\u79bb \u5e73\u65b9\u8868\u8fbe\u5f0f\uff1a \\(D^2=(X_1-X_2)^{\\top}C^{-1}(X_1-X_2)\\) \u4ee4 \\(M:\\) \u5747\u503c\u5411\u91cf M_Mean\uff0c \\(C:\\) \u8be5\u7c7b\u6a21\u5f0f\u603b\u4f53\u7684\u534f\u65b9\u5dee\u77e9\u9635 C_covariance\u3002 \u5bf9 n \u7ef4\u5411\u91cf: \\(X=[x_1, ..., x_n]^{\\top},M=[m_1,...,m_n]^{\\top}\\) \\[ C = E\\{(X-M)(X-M)^{\\top}\\} \\\\ = E \\{ \\begin{bmatrix} (x_1-m_1) \\\\ (x_2-m_2) \\\\ ... \\\\ (x_n-m_n) \\end{bmatrix} [(x_1-m_1)(x_2-m_2)\\cdot \\cdot \\cdot (x_n-m_n)]\\} \\\\ = \\begin{bmatrix} \\sigma_{11}^2 & \\sigma_{12}^2 & ... & \\sigma_{1n}^2 \\\\ \\sigma_{21}^2 & \\sigma_{22}^2 & ... & \\sigma_{2n}^2 \\\\ ... & ... & ... & ... \\\\ \\sigma_{n1}^2 & \\sigma_{n2}^2 & ... & \\sigma_{nn}^2 \\end{bmatrix} \\] \u8868\u793a\u7684\u6982\u5ff5\u662f\u5404\u5206\u91cf\u4e0a\u6a21\u5f0f\u6837\u672c\u5230\u5747\u503c\u7684\u8ddd\u79bb\uff0c\u4e5f\u5c31\u662f\u5728\u5404\u7ef4\u4e0a\u6a21\u5f0f\u7684\u5206\u6563\u60c5\u51b5\u3002 \\(\\sigma_{jk}^2\\) \u8d8a\u5927\uff0c\u79bb\u5747\u503c\u8d8a\u8fdc\u3002 \u5f53 \\(C=I\\) \u65f6\uff0c\u9a6c\u5f0f\u8ddd\u79bb\u5c31\u662f\u6b27\u6c0f\u8ddd\u79bb\u3002 \u7279\u70b9\uff1a \u9a6c\u5f0f\u8ddd\u79bb\u7684\u8ba1\u7b97\u662f\u5efa\u7acb\u5728\u603b\u4f53\u6837\u672c\u7684\u57fa\u7840\u4e0a\u3002\u540c\u6837\u7684\u4e24\u4e2a\u6837\u672c\uff0c\u653e\u5165\u4e24\u4e2a\u4e0d\u540c\u7684\u603b\u4f53\u4e2d\uff0c\u6700\u540e\u8ba1\u7b97\u5f97\u51fa\u4e24\u4e2a\u6837\u672c\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u901a\u5e38\u662f\u4e0d\u76f8\u540c\u7684\uff1b \u4e0d\u53d7\u91cf\u7eb2\u7684\u5f71\u54cd\uff0c\u4e24\u70b9\u4e4b\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u4e0e\u539f\u59cb\u6570\u636e\u7684\u6d4b\u91cf\u5355\u4f4d\u65e0\u5173\uff1b \u9a6c\u5f0f\u8ddd\u79bb\u53ef\u4ee5\u6392\u51fa\u53d8\u91cf\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u7684\u5e72\u6270\uff1b \u5938\u5927\u4e86\u53d8\u5316\u5fae\u5c0f\u7684\u53d8\u91cf\u7684\u4f5c\u7528\u3002 \u660e\u6c0f\u8ddd\u79bb n \u7ef4\u6a21\u5f0f\u6837\u672c\u5411\u91cf \\(X_i\u3001X_j\\) \u95f4\u7684\u660e\u6c0f\u8ddd\u79bb\u8868\u793a\u4e3a\uff1a \\[ D_m(X_i, X_j)=[\\sum_{k=1}^n|x_{ik}-x_{jk}|^m]^{\\frac{1}{m}} \\] \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u5f53 \\(m=2\\) \u65f6\uff0c\u660e\u6c0f\u8ddd\u79bb\u4e3a\u6b27\u6c0f\u8ddd\u79bb\u3002 \u5f53 \\(m=1\\) \u65f6\uff0c \\(D_1(X_i, X_j)=\\sum_{k=1}^n|x_{ik}-x_{jk}|\\) \uff0c\u4e3a\u8857\u574a\u8ddd\u79bb\u3002 \u6c49\u660e\u8ddd\u79bb \u8bbe \\(X_i\u3001X_j\\) \u4e3a n \u7ef4\u4e8c\u503c(1 \u6216 -1)\u6a21\u5f0f\u6837\u672c\u5411\u91cf\uff0c\u5219 \u6c49\u660e\u8ddd\u79bb\u4e3a \\(D_h(X_i, X_j)=\\frac{1}{2}(n-\\sum_{k=1}^n x_{ik}*x_{jk})\\) \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u4e24\u4e2a\u6a21\u5f0f\u5411\u91cf\u7684\u5404\u5206\u91cf\u53d6\u503c\u5747\u4e0d\u540c\uff1a \\(D_h(X_i, X_j)=n\\) \uff0c\u5168\u76f8\u540c\uff1a \\(D_h(X_i, X_j)=0\\) \u89d2\u5ea6\u76f8\u4f3c\u6027\u51fd\u6570 \\[ S(X_i, X_j) = \\frac{X_i^{\\top}X_j}{\\parallel X_i \\parallel \\cdot \\parallel X_j \\parallel} \\] \u662f\u6a21\u5f0f\u5411\u91cf \\(X_i, X_j\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7684\u4f59\u5f26\u3002 Tanimoto \u6d4b\u5ea6 \u7528\u4e8e 0,1 \u4e8c\u503c\u7279\u5f81\u7684\u60c5\u51b5, \\[ S(X_i,X_j)=\\frac{X_i^{\\top}X_j}{X_i^{\\top}X_i+X_j^{\\top}X_j-X_i^{\\top}X_j} \\\\ \\ \\\\ = \\frac{X_i,X_j\u4e2d\u5171\u6709\u7684\u7279\u5f81\u6570\u76ee}{X_i\u548cX_j\u4e2d\u5360\u6709\u7684\u7279\u5f81\u6570\u76ee\u7684\u603b\u6570} \\] \u76f8\u4f3c\u6027\u6d4b\u5ea6\u51fd\u6570\u7684\u5171\u540c\u70b9\u90fd\u6d89\u53ca\u5230\u628a\u4e24\u4e2a\u76f8\u6bd4\u8f83\u7684\u5411\u91cf \\(X_i,X_j\\) \u7684\u5206\u91cf\u503c\u7ec4\u5408\u8d77\u6765\uff0c\u4f46\u600e\u6837\u7ec4\u5408\u5e76\u65e0\u666e\u904d\u6709\u6548\u7684\u65b9\u6cd5\uff0c\u5bf9\u5177\u4f53\u7684\u6a21\u5f0f\u5206\u7c7b\uff0c\u9700\u89c6\u60c5\u51b5\u4f5c\u9002\u5f53\u9009\u62e9\u3002","title":"\u76f8\u4f3c\u6027\u6d4b\u5ea6"},{"location":"cs/ai/mode-recognition/#_11","text":"\u6839\u636e\u76f8\u4f3c\u6027\u6d4b\u5ea6\u786e\u5b9a\u7684\uff0c\u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u662f\u5426\u76f8\u4f3c\u7684\u6807\u51c6\u3002\u5373\u628a\u4e0d\u540c\u6a21\u5f0f\u805a\u4e3a\u4e00\u7c7b\u8fd8\u662f\u5f52\u4e3a\u4e0d\u540c\u7c7b\u7684\u51c6\u5219\u3002 \u786e\u5b9a\u805a\u7c7b\u51c6\u5219\u7684\u4e24\u79cd\u65b9\u5f0f\uff1a \u9608\u503c\u51c6\u5219\uff1a\u6839\u636e\u89c4\u5b9a\u7684\u8ddd\u79bb\u9608\u503c\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u51fd\u6570\u51c6\u5219\uff1a\u5229\u7528\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u805a\u7c7b\u51c6\u5219\u51fd\u6570\uff1a\u5728\u805a\u7c7b\u5206\u6790\u4e2d\uff0c\u8868\u793a\u6a21\u5f0f\u7c7b\u95f4\u76f8\u4f3c\u6216\u5dee\u5f02\u6027\u7684\u51fd\u6570 \u5b83\u5e94\u662f\u6a21\u5f0f\u6837\u672c\u96c6 \\(\\{X\\}\\) \u548c\u6a21\u5f0f\u7c7b\u522b \\(\\{S_j,j=1,2,..,c\\}\\) \u7684\u51fd\u6570\u3002\u53ef\u4f7f\u805a\u7c7b\u5206\u6790\u8f6c\u5316\u4e3a\u5bfb\u627e\u51c6\u5219\u51fd\u6570\u6781\u503c\u7684\u6700\u4f18\u5316\u95ee\u9898\u3002\u4e00\u79cd\u5e38\u7528\u7684\u6307\u6807\u662f\u8bef\u5dee\u5e73\u65b9\u4e4b\u548c\u3002 \u805a\u7c7b\u51c6\u5219\u51fd\u6570 \\[J=\\sum_{j=1}^c\\sum_{X \\in S_j} \\parallel X-M_j \\parallel^2\\] \u5f0f\u4e2d\uff1ac \u4e3a\u805a\u7c7b\u7c7b\u522b\u7684\u6570\u76ee\uff0c \\(M_j=\\frac{1}{N_j}\\sum_{X \\in S_j}X\\) \u4e3a\u5c5e\u4e8e \\(S_j\\) \u96c6\u7684\u6837\u672c\u7684\u5747\u503c\u5411\u91cf\uff0c \\(N_j\\) \u4e3a \\(S_j\\) \u4e2d\u6837\u672c\u6570\u76ee\u3002 \\(J\\) \u4ee3\u8868\u4e86\u5206\u5c5e\u4e8e c \u4e2a\u805a\u7c7b\u7c7b\u522b\u7684\u5168\u90e8\u6a21\u5f0f\u6837\u672c\u4e0e\u5176\u76f8\u5e94\u7c7b\u522b\u6a21\u5f0f\u5747\u503c\u4e4b\u95f4\u7684\u8bef\u5dee\u5e73\u65b9\u548c\u3002 \u9002\u7528\u8303\u56f4\uff1a\u9002\u7528\u4e8e\u5404\u7c7b\u6837\u672c\u5bc6\u96c6\u4e14\u6570\u76ee\u76f8\u5dee\u4e0d\u591a\uff0c\u800c\u4e0d\u540c\u7c7b\u95f4\u7684\u6837\u672c\u53c8\u660e\u663e\u5206\u5f00\u7684\u60c5\u51b5\u3002","title":"\u805a\u7c7b\u51c6\u5219"},{"location":"cs/ai/mode-recognition/#_12","text":"","title":"\u57fa\u4e8e\u8ddd\u79bb\u9608\u503c\u7684\u805a\u7c7b\u7b97\u6cd5"},{"location":"cs/ai/mode-recognition/#_13","text":"\u95ee\u9898\uff1a\u6709 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u8981\u6c42\u6309\u8ddd\u79bb\u9608\u503c \\(T\\) \u5206\u7c7b\u5230\u4ee5 \\(Z_1, Z_2,...\\) \u4e3a\u805a\u7c7b\u4e2d\u5fc3\u7684\u6a21\u5f0f\u7c7b\u4e2d\u3002 \u7b97\u6cd5\u63cf\u8ff0 \u4efb\u53d6\u6837\u672c \\(X_i\\) \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u521d\u59cb\u503c\uff0c\u5982\u4ee4 \\(Z_1=X_1\\) \u8ba1\u7b97\u6837\u672c \\(X_2\\) \u5230 \\(Z_1\\) \u7684\u6b27\u6c0f\u8ddd\u79bb \\(D_{21}=\\parallel X_2 - Z_1 \\parallel\\) \uff0c\u82e5 \\(D_{21}>T\\) \uff0c\u5b9a\u4e49\u4e00\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2=X_2\\) \uff1b\u5426\u5219 \\(X_2 \\in\\) \u4ee5 \\(Z_1\\) \u4e3a\u4e2d\u5fc3\u7684\u805a\u7c7b\u3002 \u5047\u8bbe\u5df2\u6709\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\u3001Z_2\\) \uff0c\u8ba1\u7b97 \\(D_{31}=\\parallel X_3 - Z_1 \\parallel\\) \u548c \\(D_{32}=\\parallel X_3 - Z_2 \\parallel\\) \uff0c\u82e5 \\(D_{31}>T\\) \u4e14 \\(D_{32} > T\\) \uff0c\u5219\u5efa\u7acb\u7b2c\u4e09\u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(Z_3=X_3\\) \uff1b\u5426\u5219 \\(X_3 \\in\\) \u79bb \\(Z_1\\) \u548c \\(Z_2\\) \u4e2d\u6700\u8fd1\u8005\uff08\u6700\u8fd1\u90bb\u7684\u805a\u7c7b\u4e2d\u5fc3\uff09\u3002 \u4f9d\u6b64\u7c7b\u63a8\uff0c\u76f4\u5230\u5c06\u6240\u6709\u7684 \\(N\\) \u4e2a\u6837\u672c\u90fd\u8fdb\u884c\u5206\u7c7b \u7b97\u6cd5\u7279\u70b9 \u5c40\u9650\u6027\uff1a\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u4e8e\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u9009\u62e9\u3001\u5f85\u5206\u7c7b\u6a21\u5f0f\u6837\u672c\u7684\u6392\u5217\u6b21\u5e8f\u3001\u8ddd\u79bb\u9608\u503c \\(T\\) \u7684\u5927\u5c0f\u4ee5\u53ca\u6837\u672c\u5206\u5e03\u7684\u51e0\u4f55\u6027\u8d28\u7b49\u3002 \u4f18\u70b9\uff1a\u8ba1\u7b97\u7b80\u5355\u3002\uff08\u4e00\u79cd\u867d\u7c97\u7cd9\u4f46\u5feb\u901f\u7684\u65b9\u6cd5\uff09","title":"\u8fd1\u90bb\u805a\u7c7b\u6cd5"},{"location":"cs/ai/mode-recognition/#_14","text":"\u95ee\u9898\uff1a\u5df2\u77e5 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u5206\u7c7b\u5230\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1, Z_2, ...\\) \u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u7b97\u6cd5\u63cf\u8ff0 \u9009\u4efb\u610f\u4e00\u6a21\u5f0f\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e00\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\\) \u9009\u62e9\u79bb \\(Z_1\\) \u8ddd\u79bb\u6700\u8fdc\u7684\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e8c\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2\\) \u9010\u4e2a\u8ba1\u7b97\u5404\u6a21\u5f0f\u6837\u672c\u4e0e\u5df2\u786e\u5b9a\u7684\u6240\u6709\u805a\u7c7b\u4e2d\u5fc3\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5e76\u9009\u51fa\u5176\u4e2d\u7684\u6700\u5c0f\u8ddd\u79bb\u3002\u4f8b\u5982\u805a\u7c7b\u4e2d\u5fc3\u6570 \\(k=2\\) \u65f6\uff0c\u8ba1\u7b97 \\(D_{i1}=\\parallel X_i - Z_1 \\parallel\\) , \\(D_{i2}=\\parallel X_i - Z_2 \\parallel\\) \uff0c \\(\\min\\{D_{i1}, D_{i2}\\}, i=1,...,N\\) (N \u4e2a\u6700\u5c0f\u8ddd\u79bb) \u5728\u6240\u6709\u6700\u5c0f\u8ddd\u79bb\u4e2d\u9009\u51fa\u6700\u5927\u8ddd\u79bb\uff0c\u5982\u8be5\u6700\u5927\u503c\u8fbe\u5230 \\(\\parallel Z_1 - Z_2 \\parallel\\) \u7684\u4e00\u5b9a\u5206\u6570\u6bd4\u503c\uff08\u9608\u503c \\(T\\) \uff09\u4ee5\u4e0a\uff0c\u5219\u76f8\u5e94\u7684\u6837\u672c\u70b9\u53d6\u4e3a\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\uff0c\u8fd4\u56de 3\uff1b\u5426\u5219\u7ed3\u675f \u91cd\u590d\u6b65\u9aa4 3\u30014\uff0c\u76f4\u5230\u6ca1\u6709\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\u51fa\u73b0\u4e3a\u6b62 \u5c06\u6837\u672c \\(\\{X_1, i=1,2,..,N\\}\\) \u6309\u6700\u8fd1\u8ddd\u79bb\u5212\u5206\u5230\u76f8\u5e94\u805a\u7c7b\u4e2d\u5fc3\u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u603b\u7ed3\uff1a\u5148\u627e\u4e2d\u5fc3\u540e\u5206\u7c7b\uff1b\u5173\u952e\uff1a\u600e\u4e48\u5f00\u65b0\u7c7b\uff0c\u805a\u7c7b\u4e2d\u5fc3\u5982\u4f55\u5b9a","title":"\u6700\u5927\u6700\u5c0f\u7b97\u6cd5\uff08\u5c0f\u4e2d\u53d6\u5927\u8ddd\u79bb\u7b97\u6cd5\uff09"},{"location":"cs/ai/mode-recognition/#_15","text":"\u6bcf\u4e2a\u6837\u672c\u5148\u81ea\u6210\u4e00\u7c7b\uff0c\u7136\u540e\u6309\u8ddd\u79bb\u51c6\u5219\u9010\u6b65\u5408\u5e76\uff0c\u51cf\u5c11\u7c7b\u6570 \u7b97\u6cd5\u63cf\u8ff0 \\(N\\) \u4e2a\u521d\u59cb\u6a21\u5f0f\u6837\u672c\u81ea\u6210\u4e00\u7c7b\uff0c\u5373\u5efa \\(N\\) \u7c7b\uff1a \\(G_1(0), G_2(0), ..., G_N(0)\\) \uff0c\u8ba1\u7b97\u5404\u7c7b\u4e4b\u95f4\uff08\u5373\u5404\u6837\u672c\u95f4\uff09\u7684\u8ddd\u79bb\uff0c\u5f97\u4e00 \\(N \\times N\\) \u7ef4\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(0)\\) \u3002 \\(\u201c0\u201d\\) \u8868\u793a\u521d\u59cb\u72b6\u6001 \u5047\u8bbe\u5df2\u6c42\u5f97\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(n)\\) \uff08n\u4e3a\u9010\u6b21\u805a\u7c7b\u5408\u5e76\u7684\u6b21\u6570\uff09\uff0c\u627e\u51fa \\(\\mathbf{D}(n)\\) \u4e2d\u7684\u6700\u5c0f\u5143\u7d20\uff0c\u5c06\u5176\u5bf9\u5e94\u7684\u4e24\u7c7b\u5408\u5e76\u6210\u4e00\u7c7b\u3002\u7531\u6b64\u5efa\u7acb\u65b0\u7684\u5206\u7c7b\uff1a \\(G_1(n+1), G_2(n+1),...\\) \u8ba1\u7b97\u5408\u5e76\u540e\u65b0\u7c7b\u522b\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5f97 \\(\\mathbf{D}(n+1)\\) \u8df3\u5230\u7b2c 2 \u6b65\uff0c\u91cd\u590d\u8ba1\u7b97\u53ca\u5408\u5e76 \u7ed3\u675f\u6761\u4ef6 \u53d6\u8ddd\u79bb\u9608\u503c \\(T\\) \uff0c\u5f53 \\(\\mathbf{D}(n)\\) \u7684\u6700\u5c0f\u5206\u91cf\u8d85\u8fc7\u7ed9\u5b9a\u503c \\(T\\) \u65f6\uff0c\u7b97\u6cd5\u505c\u6b62\uff0c\u6240\u5f97\u5373\u4e3a\u805a\u7c7b\u7ed3\u679c \u6216\u4e0d\u8bbe\u9608\u503c \\(T\\) \uff0c\u4e00\u76f4\u5c06\u5168\u90e8\u6837\u672c\u805a\u6210\u4e00\u7c7b\u4e3a\u6b62\uff0c\u8f93\u51fa\u805a\u7c7b\u7684\u5206\u7ea7\u6811 \u95ee\u9898\u8ba8\u8bba\uff1a\u7c7b\u95f4\u8ddd\u79bb\u8ba1\u7b97\u51c6\u5219 \u6700\u77ed\u8ddd\u79bb\u6cd5 \u5982 \\(H\u3001K\\) \u662f\u4e24\u4e2a\u805a\u7c7b\uff0c\u5219\u4e24\u7c7b\u95f4\u7684\u6700\u77ed\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D_{HK} = \\min\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\] \u6700\u957f\u8ddd\u79bb\u6cd5 \\[ D_{HK} = \\max\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\\\ \u82e5 K \u7c7b\u7531 I\u3001J \u4e24\u7c7b\u5408\u5e76\u800c\u6210\u5219 \\\\ D_{HK} = \\max\\{D_{HI}, D_{HJ}\\} \\] \u4e2d\u95f4\u8ddd\u79bb\u6cd5 \u4ecb\u4e8e\u6700\u957f\u4e0e\u6700\u77ed\u7684\u8ddd\u79bb\u4e4b\u95f4 \\[ D_{HK}=\\sqrt{\\frac{1}{2} D_{HI}^2+\\frac{1}{2}D_{HJ}^2-\\frac{1}{4}D_{IJ}^2} \\] \u91cd\u5fc3\u6cd5 \u5c06\u6bcf\u7c7b\u4e2d\u5305\u542b\u7684\u6837\u672c\u6570\u8003\u8651\u8fdb\u53bb\u3002\u82e5 \\(I\\) \u7c7b\u4e2d\u6709 \\(n_I\\) \u4e2a\u6837\u672c\uff0c\u82e5 \\(J\\) \u7c7b\u4e2d\u6709 \\(n_J\\) \u4e2a\u6837\u672c \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2-\\frac{n_In_J}{n_I+n_J}D_{IJ}^2} \\] \u7c7b\u5e73\u5747\u8ddd\u79bb\u6cd5 \\[ D_{HK}=\\sqrt{\\frac{1}{n_Hn_K} \\sum_{i \\in H,j \\in K}d_{ij}^2} \\] \\(d_{ij}\\) \uff1a \\(H\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u548c \\(K\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u5e73\u65b9 \u82e5 \\(K\\) \u7c7b\u7531 \\(I\\) \u7c7b\u548c \\(J\\) \u7c7b\u5408\u5e76\u4ea7\u751f\uff0c\u5219\u9012\u63a8\u5f0f\u4e3a \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2} \\]","title":"\u5c42\u6b21\u805a\u7c7b\u6cd5"},{"location":"cs/ai/mode-recognition/#_16","text":"\u4e24\u79cd\u5e38\u7528\u7684\u7b97\u6cd5\uff1a \\(K\\) -\u5747\u503c\u7b97\u6cd5(\u6216 \\(C\\) -\u5747\u503c\u7b97\u6cd5) \u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5","title":"\u52a8\u6001\u805a\u7c7b\u6cd5"},{"location":"cs/ai/mode-recognition/#k-","text":"\u57fa\u4e8e\u4f7f\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u6700\u5c0f\u5316 \u51c6\u5219\u51fd\u6570\uff1a\u805a\u7c7b\u96c6\u4e2d\u6bcf\u4e00\u6837\u672c\u70b9\u5230\u8be5\u7c7b\u4e2d\u5fc3\u5230\u8ddd\u79bb\u5e73\u65b9\u548c \u5bf9\u4e8e\u7b2c j \u805a\u7c7b\u96c6\uff0c\u51c6\u5219\u51fd\u6570\u5b9a\u4e49\u4e3a \\(J_j = \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2\uff0c\\ \\ \\ X_i \\in S_j\\) \\(S_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6\uff0c\u805a\u7c7b\u4e2d\u5fc3\u4e3a \\(Z_j\\) \\(N_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6 \\(S_j\\) \u4e2d\u6240\u5305\u542b\u7684\u6837\u672c\u4e2a\u6570 \u5bf9\u6240\u6709 \\(K\\) \u4e2a\u6a21\u5f0f\u7c7b\u6709 \\(J = \\sum_{j=1}^{K} \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2, \\ \\ \\ X_i \\in S_j\\) \u805a\u7c7b\u51c6\u5219\uff1a \u805a\u7c7b\u4e2d\u5fc3\u7684\u9009\u62e9\u5e94\u4f7f\u51c6\u5219\u51fd\u6570 \\(J\\) \u6781\u5c0f\uff0c\u5373\u4f7f \\(J_j\\) \u7684\u503c\u5f88\u5c0f \u8ba9 \\(\\frac{\\partial J_j}{\\partial \\mathbf{Z}_j}=0\\) \uff0c\u89e3\u5f97 \\(\\mathbf{Z}_j = \\frac{1}{N_j} \\sum_{i=1}^{N_j} \\mathbf{X_i}, \\ \\ \\ \\mathbf{X}_i \\in S_j\\) \u7b97\u6cd5\u63cf\u8ff0: \u4efb\u9009 K \u4e2a\u521d\u59cb\u805a\u7c7b\u4e2d\u5fc3\uff1a \\(\\mathbf{Z}_1(1), \\mathbf{Z}_2(1), ..., \\mathbf{Z}_K(1)\\) \u62ec\u53f7\u5185\u5e8f\u53f7\uff1a\u8fed\u4ee3\u8fd0\u7b97\u7684\u6b21\u5e8f\u53f7 \u6309\u6700\u5c0f\u8ddd\u79bb\u539f\u5219\u5c06\u5176\u4f59\u6837\u54c1\u5206\u914d\u5230 K \u4e2a\u805a\u7c7b\u4e2d\u5fc3\u4e2d\u7684\u67d0\u4e00\u4e2a\uff0c\u5373 \\(\\min\\{\\parallel X - Z_i(k) \\parallel, i=1,2,...,K\\}=\\parallel X-Z_j(k) \\parallel=D_j(k)\uff0c\u5219 X \\in S_j(k)\\) \uff0c\u6ce8\u610f\uff0ck \u662f\u8fed\u4ee3\u8fd0\u7b97\u6b21\u5e8f\u53f7\uff0cK \u662f\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u8ba1\u7b97\u5404\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u65b0\u5411\u91cf\u503c: \\(Z_j(k+1) \\ \\ j=1,2,...,K\\) \\[ Z_j(k+1) = \\frac{1}{N_j} \\sum_{X \\in S_j(k)} \\mathbf{X} \\ \\ \\ j=1,2,...,K \\] \\(N_j\\) : \u7b2c j \u7c7b\u7684\u6837\u672c\u6570 \u5224\u65ad \u5982\u679c \\(Z_j(k+1) \\ne Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u5219\u56de\u5230 2\uff0c\u5c06\u6a21\u5f0f\u6837\u672c\u9010\u4e2a\u91cd\u65b0\u5206\u7c7b\uff0c\u91cd\u590d\u8fed\u4ee3\u8ba1\u7b97 \u5982\u679c \\(Z_j(k+1) = Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u7b97\u6cd5\u6536\u655b\uff0c\u8ba1\u7b97\u5b8c\u6bd5","title":"K-\u5747\u503c\u7b97\u6cd5"},{"location":"cs/ai/mode-recognition/#_17","text":"\u7b97\u6cd5\u7279\u70b9 \u52a0\u5165\u4e86\u8bd5\u63a2\u6027\u6b65\u9aa4\uff0c\u7ec4\u6210\u4eba\u673a\u4ea4\u4e92\u7684\u7ed3\u6784 \u53ef\u4ee5\u901a\u8fc7\u7c7b\u7684\u81ea\u52a8\u5408\u5e76\u4e0e\u5206\u88c2\u5f97\u5230\u8f83\u5408\u7406\u7684\u7c7b\u522b\u6570 \u4e0e K-\u5747\u503c\u7b97\u6cd5 \u76f8\u4f3c\uff1a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u5747\u901a\u8fc7\u6837\u672c\u5747\u503c\u7684\u8fed\u4ee3\u8fd0\u7b97\u51b3\u5b9a \u76f8\u5f02\uff1aK-\u5747\u503c\u7b97\u6cd5\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570\u4e0d\u53d8\uff0c\u4f46ISODATA\u7b97\u6cd5\u4e0d\u53d8 \u7b97\u6cd5\u63cf\u8ff0 \u9884\u9009 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(\\{Z_1, Z_2, ..., Z_{N_C}\\}\\) \uff0c \\(N_C\\) \u4e5f\u662f\u805a\u7c7b\u8fc7\u7a0b\u4e2d\u5b9e\u9645\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u628a N \u4e2a\u6837\u672c\u6309\u6700\u8fd1\u90bb\u89c4\u5219\u5206\u914d\u5230 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d \\[ \u82e5 \\ \\ \\ \\parallel X - Z_j \\parallel = \\min\\{\\parallel X - Z_i, i = 1, ,2, .., N_C\\} \\\\ \u5219 \\ \\ \\ X \\in S_j \\] \u82e5 \\(S_j\\) \u4e2d\u7684\u6837\u672c\u6570 \\(N_j < \\theta_N\\) \uff0c\u5219\u53d6\u6d88\u8be5\u7c7b\uff0c\u5e76\u4e14 \\(N_C\\) \u51cf\u53bb 1 \u4fee\u6b63\u5404\u805a\u7c7b\u4e2d\u5fc3\u503c \\(Z_j = \\frac{1}{N_j} \\sum_{X \\in S_j} X \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97 \\(S_j\\) \u7684\u7c7b\u5185\u7684\u5e73\u5747\u8ddd\u79bb \\(\\bar{D_j} = \\frac{1}{N_j} \\sum_{X \\in S_j} \\parallel X - Z_j \\parallel \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97\u603b\u4f53\u5e73\u5747\u8ddd\u79bb \u5224\u65ad\u5f53\u524d\u662f\u5206\u88c2\u8fd8\u662f\u5408\u5e76\uff0c\u51b3\u5b9a\u8fed\u4ee3\u6b65\u9aa4\u7b49 \u82e5 \\(N_C \\le K/2\\) \uff0c\u8fdb\u5165\u5206\u88c2 \u5982\u679c\u8fed\u4ee3\u6b21\u6570\u662f\u5076\u6570\u6216 \\(N_C \\ge 2K\\) \uff0c\u5219\u5408\u5e76\u5426\u5219\u5206\u88c2 \u8ba1\u7b97\u6bcf\u4e2a\u805a\u7c7b\u4e2d\u6837\u672c\u8ddd\u79bb\u7684\u6807\u51c6\u5dee\u5411\u91cf \u6c42\u6bcf\u4e2a\u6807\u51c6\u5dee\u5411\u91cf\u7684\u6700\u5927\u5206\u91cf \u592a\u957f\u4e86\u3002\u3002\u3002 \u5168\u662f\u516c\u5f0f\u3002\u3002\u3002","title":"\u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5"},{"location":"cs/ai/mode-recognition/#_18","text":"","title":"\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_19","text":"\u5b9a\u4e49\uff1a\u76f4\u63a5\u7528\u6765\u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219\u51fd\u6570\u3002\u82e5\u5206\u5c5e\u4e8e \\(\\omega_1, \\omega_2\\) \u7684\u4e24\u7c7b\u6a21\u5f0f\u53ef\u7528\u4e00\u65b9\u7a0b \\(d(X)=0\\) \u6765\u5212\u5206\uff0c\u90a3\u4e48\u79f0 \\(d(X)\\) \u4e3a\u5224\u522b\u51fd\u6570\u3002 \u786e\u5b9a\u5224\u522b\u51fd\u6570\u7684\u4e24\u4e2a\u56e0\u7d20 \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u51e0\u4f55\u6027\u8d28\u3002\u5b83\u53ef\u4ee5\u662f\u7ebf\u6027\u7684\u6216\u975e\u7ebf\u6027\u7684\u51fd\u6570\uff0c\u7ef4\u6570\u5728\u7279\u5f81\u63d0\u53d6\u65f6\u5df2\u7ecf\u786e\u5b9a \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u7cfb\u6570\uff0c\u7528\u6240\u7ed9\u7684\u6a21\u5f0f\u6837\u672c\u786e\u5b9a","title":"\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_20","text":"","title":"\u7ebf\u6027\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_21","text":"\u5c06\u4e8c\u7ef4\u5f62\u5f0f\u63a8\u5e7f\u5230 n \u7ef4\uff0c\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f\u4e3a \\[ d(X) = w_1x_1+w_2x_2+...+w_nx_n+w_{n+1}=W_0^{\\top}X+w_{n+1} \\] \u589e\u5e7f\u5411\u91cf\u7684\u5f62\u5f0f \\(d(X)=W^{\\top}X\\)","title":"\u4e00\u822c\u5f62\u5f0f"},{"location":"cs/ai/mode-recognition/#_22","text":"\u4e24\u7c7b\u60c5\u51b5 \\[ d(X)=W^{\\top}X \\left\\{\\begin{matrix} >0 & \u82e5 X \\in \\omega_1 \\\\ <0 & \u82e5 X \\in \\omega_2 \\end{matrix}\\right. \\] \u591a\u7c7b\u60c5\u51b5 \\(\\omega_i \\sqrt{\\omega_i}\\) \u4e24\u5206\u6cd5 \u7528\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5c06\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u4e0e\u5176\u4f59\u4e0d\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u5206\u5f00 \\(\\omega_i \\omega_i\\) \u4e24\u5206\u6cd5 \u4e00\u4e2a\u5224\u522b\u754c\u9762\u53ea\u80fd\u5206\u5f00\u4e24\u4e2a\u7c7b\u522b\uff0c\u4e0d\u80fd\u628a\u5176\u4f59\u6240\u6709\u7684\u7c7b\u522b\u90fd\u5206\u5f00\u3002\u5224\u51b3\u51fd\u6570\u4e3a \\(d_{ij}(X)=W_{ij}^{\\top}X\\) \u6027\u8d28\uff1a \\(d_{ij}(X) > 0, \\forall j \\ne i; i, j = 1,2,...,M\uff0c\u82e5X \\in \\omega_i\\)","title":"\u6027\u8d28"},{"location":"cs/ai/mode-recognition/#_23","text":"\u76ee\u7684\uff1a\u5bf9\u975e\u7ebf\u6027\u8fb9\u754c\uff0c\u901a\u8fc7\u67d0\u6620\u5c04\uff0c\u628a\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u53d8\u6210 \\(X^*\\) \uff0c\u4ee5\u4fbf\u5c06 \\(X\\) \u7a7a\u95f4\u4e2d\u975e\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6\uff0c\u53d8\u6210\u5728 \\(X^*\\) \u7a7a\u95f4\u4e2d\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6","title":"\u5e7f\u4e49\u7ebf\u6027\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_24","text":"\u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u5f62\u5f0f\u4e4b\u4e00\u662f\u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570 \u8bbe\u4e00\u8bad\u7ec3\u7528\u6a21\u5f0f\u96c6\uff0c \\(\\{X\\}\\) \u5728\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u4e2d\u7ebf\u6027\u4e0d\u53ef\u5206\uff0c\u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ d(\\mathbf{X})=w_1f_1(\\mathbf{X})+w_2f_2(\\mathbf{X})+...+w_kf_k(\\mathbf{X})+w_{k+1}=\\sum_{i=1}^{k+1}w_if_i(\\mathbf{X}) \\\\ \u5f0f\u4e2d,\\{f_i(\\mathbf{X}),i=1,2,...,k\\}\u662f\u6a21\u5f0f\\mathbf{X}\u7684\u5355\u503c\u5b9e\u51fd\u6570\uff0cf_{k+1}(\\mathbf{X})=1 \\] \u5e7f\u4e49\u5f62\u5f0f\u7684\u6a21\u5f0f\u5411\u91cf\u5b9a\u4e49\u4e3a\uff1a \\[ \\mathbf{X}^*=[x_1^*+x_2^*+...+x_k^*+1]^\\top=[f_1(\\mathbf{X})+f_2(\\mathbf{X})+...+f_k(\\mathbf{X})+1]^\\top \\]","title":"\u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_25","text":"\u6a21\u5f0f\u7a7a\u95f4\u4e0e\u8d85\u5e73\u9762 \u6743\u7a7a\u95f4\u548c\u6743\u5411\u91cf\u89e3","title":"\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u51e0\u4f55\u6027\u8d28"},{"location":"cs/ai/mode-recognition/#_26","text":"","title":"\u611f\u77e5\u5668\u7b97\u6cd5"},{"location":"cs/algorithm/basic-ds/","text":"","title":"\u57fa\u7840\u6570\u636e\u7ed3\u6784"},{"location":"cs/algorithm/design-analysis/","text":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 \u00b6 \u7ea6 876 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u672c\u79d1\u548c\u7814\u90fd\u9009\u8fc7\u8fd9\u95e8\u8bfe\uff0c\u7279\u6b64\u6765\u5f52\u6863\u4e00\u4e0b\u7b14\u8bb0 \uff08\u867d\u7136\u90fd\u662f\u6253acm\u7684\u65f6\u5019\u5b66\u7684 \ud83d\ude02 \u7b97\u6cd5\u5f15\u8bba \u00b6 \u7b97\u6cd5\u662f\u6ee1\u8db3\u4e0b\u8ff0\u6027\u8d28\u7684\u6307\u4ee4\u5e8f\u5217\uff1a \u8f93\u5165\uff1a\u6709\u96f6\u4e2a\u6216\u591a\u4e2a\u5916\u90e8\u91cf\u4f5c\u4e3a\u7b97\u6cd5\u7684\u8f93\u5165\u3002 \u8f93\u51fa\uff1a\u7b97\u6cd5\u4ea7\u751f\u81f3\u5c11\u4e00\u4e2a\u91cf\u4f5c\u4e3a\u8f93\u51fa\u3002 \u786e\u5b9a\u6027\uff1a\u7ec4\u6210\u7b97\u6cd5\u7684\u6211\u6761\u6307\u4ee4\u8db3\u6e05\u6670\u7684\uff0c\u65e0\u6b67\u4e49\u7684\u3002 \u6709\u9650\u6027\uff1a\u7b97\u6cd5\u4e2d\u6bcf\u6761\u6307\u4ee4\u7684\u6267\u884c\u6b21\u6570\u6709\u9650\uff0c\u62ab\u884c\u6bcf\u6761\u6307\u4ee4\u7684\u65f6\u95f4\u4e16\u5b58\u9650\u3002 \u7b97\u6cd5\u5206\u6790\u5185\u5bb9\uff1a \u8fd0\u884c\u65f6\u95f4\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u6709\u5173 \u65f6\u95f4\u590d\u6742\u5ea6\u3001\u7a7a\u95f4\u590d\u6742\u5ea6\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u65e0\u5173 \u590d\u6742\u5ea6\u5206\u6790\u5047\u8bbe\uff1a \u6307\u4ee4\u6309\u987a\u5e8f\u6267\u884c \u6240\u6709\u6307\u4ee4\uff08\u8fd0\u7b97\uff09\u90fd\u6d88\u8017\u540c\u4e00\u65f6\u95f4\u5355\u5143 \u6570\u636e\u89c4\u6a21\u662f\u7ed9\u5b9a\u7684\uff0c\u4e14\u6709\u65e0\u9650\u7a7a\u95f4 \u4e00\u822c\u9700\u8981\u5206\u6790 \\(T_{\\mathrm{avg}}(N)\\) \uff08\u5e73\u5747\u60c5\u51b5\uff09\u548c \\(T_{\\mathrm{worst}}(N)\\) \uff08\u6700\u5dee\u60c5\u51b5\uff09\uff0c \\(N\\) \u662f\u8f93\u5165\u7684\u6570\u636e\u89c4\u6a21\uff08\u4e5f\u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165\u89c4\u6a21\uff09 \u590d\u6742\u5ea6\u6e10\u8fdb\u8bb0\u53f7 \u00b6 \u5b9a\u4e49 \u00b6 \u5927 \\(O\\) \u8868\u793a\u6cd5 \\(T(N) = O(f(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\leq c\\cdot f(N)\\) \u6e10\u8fdb\u4e0a\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u9ad8\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u6162\u6216\u76f8\u540c\uff0c<=\uff09 \u5927 \\(\\Omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\Omega(g(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\geq c\\cdot g(N)\\) \u6e10\u8fdb\u4e0b\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u4f4e\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u5feb\u6216\u76f8\u540c\uff0c>=\uff09 \u5927 \\(\\Theta\\) \u8868\u793a\u6cd5 \\(T(N) = \\Theta(h(N))\\) \uff0c\u5f53\u4e14\u4ec5\u5f53 \\(T(N) = O(h(N))\\) \u4e14 \\(T(N) = \\Omega(h(N))\\) \u6e10\u8fdb\u7d27\u786e\u754c\uff0c\u5373 \\(T(N)\\) \u9700\u8981\u4e0e \\(h(N)\\) \u540c\u9636\uff08\u589e\u957f\u901f\u5ea6\u76f8\u540c =\uff09 \u5c0f \\(o\\) \u8868\u793a\u6cd5 \\(T(N) = o(p(N))\\) \uff0c\u5f53 \\(T(N) = O(p(N))\\) \u4e14 \\(T(N)\\ne \\Theta(p(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0a\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(p(N)\\) \u6162\uff0c<\uff09 \u5c0f \\(\\omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\omega(p(N))\\) \uff0c\u5f53 \\(T(N) = \\Omega(q(N))\\) \u4e14 \\(T(N)\\ne \\Theta(q(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0b\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(q(N)\\) \u5feb\uff0c>\uff09 \u89c4\u5219 \u00b6 \u5982\u679c \\(T_1(N) = O(f(N))\\) \u4e14 \\(T_2(N) = O(g(N))\\) \uff0c\u5219\uff1a \\(T_1(N) + T_2(N) = \\mathrm{max}(O(f(N)), O(g(N)))\\) \\(T_1(N)\\cdot T_2(N) = O(f(N)\\cdot g(N))\\) \u5982\u679c \\(T(N)\\) \u662f \\(N\\) \u7684 \\(k\\) \u6b21\u591a\u9879\u5f0f\uff0c\u5219 \\(T(N) = \\Theta(N^k)\\) \u5bf9\u4e8e\u4efb\u610f\u5e38\u6570 \\(k\\) \u5747\u6709 \\(\\log^kN = O(N)\\) \u5927 O \u8bb0\u53f7\u6bd4\u8f83\uff1a Big O Cheat Sheet \u5206\u6790\u89c4\u5219\uff1a for \u5faa\u73af\u7684\u8fd0\u884c\u65f6\u95f4\u662f\u5faa\u73af\u5185\u90e8\u8bed\u53e5\u7684\u6700\u957f\u65f6\u95f4\uff08\u542b for \u5224\u65ad\uff09\u4e58\u5faa\u73af\u6b21\u6570 \u5d4c\u5957 for \u5faa\u73af\u8981\u9010\u6b21\u76f8\u4e58 if else \u8bed\u53e5\u7684\u8fd0\u884c\u65f6\u95f4\u4e0d\u8d85\u8fc7\u5224\u65ad\u65f6\u95f4+\u8017\u65f6\u6700\u957f\u7684\u8bed\u53e5\u5757\u7684\u8fd0\u884c\u65f6\u95f4 \u8865\u5145\uff1a\u4e3b\u5b9a\u7406\u3002\u5047\u8bbe\u6709 \\(T(n) = aT(n/b)+f(n)\\) \uff08 \\(a\\geq 1, b>1\\) \uff09\uff0c\u5219\uff1a \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = O(n^{\\log_ba-\\epsilon})\\) \uff0c\u5219 \\(T(n) = \\Theta(n^{\\log_ba})\\) \u5982\u679c \\(f(n) = \\Theta(n^{\\log_ba})\\) \u5219 \\(T(n) = \\Theta(n^{\\log_ba}\\log n)\\) \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = \\Omega(n^{\\log_ba+\\epsilon})\\) \uff0c\u540c\u65f6\u5b58\u5728\u5e38\u6570 \\(c<1\\) \u4f7f\u5f97\u5bf9\u4e8e\u5145\u5206\u5927 \\(n\\) \u6709 \\(af(n/b)\\leq cf(n)\\) \u5219 \\(T(N) = \\Theta(f(n))\\) \u9012\u5f52\u4e0e\u5206\u6cbb \u00b6 \u9012\u5f52\u7684\u6982\u5ff5 \u00b6 \u76f4\u63a5\u6210\u95f4\u63a5\u5730\u8c03\u7528\u81ea\u8eab\u7684\u7b97\u6cd5\u79f0\u4e3a\u9012\u5f52\u7b97\u6cd5\u3002\u7528\u51fd\u6570\u81ea\u8eab\u7ed9\u51fa\u5b9a\u4e49\u7684\u51fd\u6570\u79f0\u4e3a\u9012\u5f52\u51fd\u6570\u3002 \u4f8b\u5982\u9636\u4e58\u51fd\u6570\u3001\u6590\u6ce2\u90a3\u5951\u51fd\u6570\u7b49\u7b49 \\[ eg \\ \\ \\ F(n) = \\left\\{\\begin{matrix} 1 & n = 0, 1 \\\\ F(n-1)+F(n-2) & n >= 1 \\end{matrix}\\right. \\] int fibonacci ( int n ) { if ( n <= 1 ) return 1 ; return fibonacci ( n - 1 ) + fibonacci ( n - 2 ); } \u5bf9\u4e8e\u5c0f\u8303\u56f4\u53ef\u4ee5\u7528\u8bb0\u5fc6\u5316 \\(O(n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3 \u5bf9\u4e8e\u5927\u8303\u56f4\u53ef\u4ee5\u7528\u77e9\u9635\u5feb\u901f\u5e42 \\(O(\\log n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3\u3002 \u5206\u6cbb\u6cd5\u601d\u60f3 \u00b6 \u5206\u6cbb\u6cd5\u7684\u57fa\u672c\u601d\u60f3\u662f\u5c06\u4e00\u4e2a\u898f\u6a21\u4e3a \\(n\\) \u7684\u95ee\u9898\u5206\u89e3\u4e3a \\(k\\) \u4e2a\u89c4\u6a21\u8f83\u5c0f\u7684\u5b50\u95ee\u9898\uff0c\u8fd9\u4e9b\u5b50\u95ee\u9898\u4e92\u76f8\u72ec\u7acb\u4e14\u4e0e\u539f\u95ee\u9898\u76f8\u540c\u3002\u9012\u95e8\u5730\u89e3\u8fd9\u4e9b\u5b50\u95ee\u9898\uff0c\u7136\u540e\u5c07\u5404\u5b50\u95ee\u9898\u7684\u89e3\u5408\u4e95\u5f97\u5230\u539f\u5411\u9898\u7684\u89e3\u3002 eg\uff1a\u5feb\u901f\u5e42\u3001\u4e8c\u5206\u3001\u5f52\u5e76\u6392\u5e8f\u3001\u7ebf\u6bb5\u6811\u3001cdq\u5206\u6cbb\u3001FFT\u7b49 \u5927\u6574\u6570\u7684\u4e58\u6cd5 \u00b6 \u6709\u4e24\u4e2a\u8d85\u8fc7 long long \u7c7b\u578b\u7684\u5927\u6574\u6570 \\(X\\) \u548c \\(Y\\) \uff0c\u7528\u8f83\u4f4e\u7684\u590d\u6742\u5ea6\u6c42\u89e3 \\(X*Y\\) \u3002 \u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u81f3\u5c11\u6709 6 \u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u770b\u4e4b\u524d\u5199\u8fc7\u7684\u6587\u7ae0\uff1a \u5927\u6574\u6570\u76f8\u4e58 \u2013 \u6a21\u62df/\u5206\u6cbb/FFT/CRT/\u7f51\u7edc\u6d41/Furer Reference \u00b6 \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790(\u738b\u6653\u4e1c).pdf","title":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790"},{"location":"cs/algorithm/design-analysis/#_1","text":"\u7ea6 876 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u672c\u79d1\u548c\u7814\u90fd\u9009\u8fc7\u8fd9\u95e8\u8bfe\uff0c\u7279\u6b64\u6765\u5f52\u6863\u4e00\u4e0b\u7b14\u8bb0 \uff08\u867d\u7136\u90fd\u662f\u6253acm\u7684\u65f6\u5019\u5b66\u7684 \ud83d\ude02","title":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790"},{"location":"cs/algorithm/design-analysis/#_2","text":"\u7b97\u6cd5\u662f\u6ee1\u8db3\u4e0b\u8ff0\u6027\u8d28\u7684\u6307\u4ee4\u5e8f\u5217\uff1a \u8f93\u5165\uff1a\u6709\u96f6\u4e2a\u6216\u591a\u4e2a\u5916\u90e8\u91cf\u4f5c\u4e3a\u7b97\u6cd5\u7684\u8f93\u5165\u3002 \u8f93\u51fa\uff1a\u7b97\u6cd5\u4ea7\u751f\u81f3\u5c11\u4e00\u4e2a\u91cf\u4f5c\u4e3a\u8f93\u51fa\u3002 \u786e\u5b9a\u6027\uff1a\u7ec4\u6210\u7b97\u6cd5\u7684\u6211\u6761\u6307\u4ee4\u8db3\u6e05\u6670\u7684\uff0c\u65e0\u6b67\u4e49\u7684\u3002 \u6709\u9650\u6027\uff1a\u7b97\u6cd5\u4e2d\u6bcf\u6761\u6307\u4ee4\u7684\u6267\u884c\u6b21\u6570\u6709\u9650\uff0c\u62ab\u884c\u6bcf\u6761\u6307\u4ee4\u7684\u65f6\u95f4\u4e16\u5b58\u9650\u3002 \u7b97\u6cd5\u5206\u6790\u5185\u5bb9\uff1a \u8fd0\u884c\u65f6\u95f4\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u6709\u5173 \u65f6\u95f4\u590d\u6742\u5ea6\u3001\u7a7a\u95f4\u590d\u6742\u5ea6\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u65e0\u5173 \u590d\u6742\u5ea6\u5206\u6790\u5047\u8bbe\uff1a \u6307\u4ee4\u6309\u987a\u5e8f\u6267\u884c \u6240\u6709\u6307\u4ee4\uff08\u8fd0\u7b97\uff09\u90fd\u6d88\u8017\u540c\u4e00\u65f6\u95f4\u5355\u5143 \u6570\u636e\u89c4\u6a21\u662f\u7ed9\u5b9a\u7684\uff0c\u4e14\u6709\u65e0\u9650\u7a7a\u95f4 \u4e00\u822c\u9700\u8981\u5206\u6790 \\(T_{\\mathrm{avg}}(N)\\) \uff08\u5e73\u5747\u60c5\u51b5\uff09\u548c \\(T_{\\mathrm{worst}}(N)\\) \uff08\u6700\u5dee\u60c5\u51b5\uff09\uff0c \\(N\\) \u662f\u8f93\u5165\u7684\u6570\u636e\u89c4\u6a21\uff08\u4e5f\u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165\u89c4\u6a21\uff09","title":"\u7b97\u6cd5\u5f15\u8bba"},{"location":"cs/algorithm/design-analysis/#_3","text":"","title":"\u590d\u6742\u5ea6\u6e10\u8fdb\u8bb0\u53f7"},{"location":"cs/algorithm/design-analysis/#_4","text":"\u5927 \\(O\\) \u8868\u793a\u6cd5 \\(T(N) = O(f(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\leq c\\cdot f(N)\\) \u6e10\u8fdb\u4e0a\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u9ad8\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u6162\u6216\u76f8\u540c\uff0c<=\uff09 \u5927 \\(\\Omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\Omega(g(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\geq c\\cdot g(N)\\) \u6e10\u8fdb\u4e0b\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u4f4e\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u5feb\u6216\u76f8\u540c\uff0c>=\uff09 \u5927 \\(\\Theta\\) \u8868\u793a\u6cd5 \\(T(N) = \\Theta(h(N))\\) \uff0c\u5f53\u4e14\u4ec5\u5f53 \\(T(N) = O(h(N))\\) \u4e14 \\(T(N) = \\Omega(h(N))\\) \u6e10\u8fdb\u7d27\u786e\u754c\uff0c\u5373 \\(T(N)\\) \u9700\u8981\u4e0e \\(h(N)\\) \u540c\u9636\uff08\u589e\u957f\u901f\u5ea6\u76f8\u540c =\uff09 \u5c0f \\(o\\) \u8868\u793a\u6cd5 \\(T(N) = o(p(N))\\) \uff0c\u5f53 \\(T(N) = O(p(N))\\) \u4e14 \\(T(N)\\ne \\Theta(p(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0a\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(p(N)\\) \u6162\uff0c<\uff09 \u5c0f \\(\\omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\omega(p(N))\\) \uff0c\u5f53 \\(T(N) = \\Omega(q(N))\\) \u4e14 \\(T(N)\\ne \\Theta(q(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0b\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(q(N)\\) \u5feb\uff0c>\uff09","title":"\u5b9a\u4e49"},{"location":"cs/algorithm/design-analysis/#_5","text":"\u5982\u679c \\(T_1(N) = O(f(N))\\) \u4e14 \\(T_2(N) = O(g(N))\\) \uff0c\u5219\uff1a \\(T_1(N) + T_2(N) = \\mathrm{max}(O(f(N)), O(g(N)))\\) \\(T_1(N)\\cdot T_2(N) = O(f(N)\\cdot g(N))\\) \u5982\u679c \\(T(N)\\) \u662f \\(N\\) \u7684 \\(k\\) \u6b21\u591a\u9879\u5f0f\uff0c\u5219 \\(T(N) = \\Theta(N^k)\\) \u5bf9\u4e8e\u4efb\u610f\u5e38\u6570 \\(k\\) \u5747\u6709 \\(\\log^kN = O(N)\\) \u5927 O \u8bb0\u53f7\u6bd4\u8f83\uff1a Big O Cheat Sheet \u5206\u6790\u89c4\u5219\uff1a for \u5faa\u73af\u7684\u8fd0\u884c\u65f6\u95f4\u662f\u5faa\u73af\u5185\u90e8\u8bed\u53e5\u7684\u6700\u957f\u65f6\u95f4\uff08\u542b for \u5224\u65ad\uff09\u4e58\u5faa\u73af\u6b21\u6570 \u5d4c\u5957 for \u5faa\u73af\u8981\u9010\u6b21\u76f8\u4e58 if else \u8bed\u53e5\u7684\u8fd0\u884c\u65f6\u95f4\u4e0d\u8d85\u8fc7\u5224\u65ad\u65f6\u95f4+\u8017\u65f6\u6700\u957f\u7684\u8bed\u53e5\u5757\u7684\u8fd0\u884c\u65f6\u95f4 \u8865\u5145\uff1a\u4e3b\u5b9a\u7406\u3002\u5047\u8bbe\u6709 \\(T(n) = aT(n/b)+f(n)\\) \uff08 \\(a\\geq 1, b>1\\) \uff09\uff0c\u5219\uff1a \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = O(n^{\\log_ba-\\epsilon})\\) \uff0c\u5219 \\(T(n) = \\Theta(n^{\\log_ba})\\) \u5982\u679c \\(f(n) = \\Theta(n^{\\log_ba})\\) \u5219 \\(T(n) = \\Theta(n^{\\log_ba}\\log n)\\) \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = \\Omega(n^{\\log_ba+\\epsilon})\\) \uff0c\u540c\u65f6\u5b58\u5728\u5e38\u6570 \\(c<1\\) \u4f7f\u5f97\u5bf9\u4e8e\u5145\u5206\u5927 \\(n\\) \u6709 \\(af(n/b)\\leq cf(n)\\) \u5219 \\(T(N) = \\Theta(f(n))\\)","title":"\u89c4\u5219"},{"location":"cs/algorithm/design-analysis/#_6","text":"","title":"\u9012\u5f52\u4e0e\u5206\u6cbb"},{"location":"cs/algorithm/design-analysis/#_7","text":"\u76f4\u63a5\u6210\u95f4\u63a5\u5730\u8c03\u7528\u81ea\u8eab\u7684\u7b97\u6cd5\u79f0\u4e3a\u9012\u5f52\u7b97\u6cd5\u3002\u7528\u51fd\u6570\u81ea\u8eab\u7ed9\u51fa\u5b9a\u4e49\u7684\u51fd\u6570\u79f0\u4e3a\u9012\u5f52\u51fd\u6570\u3002 \u4f8b\u5982\u9636\u4e58\u51fd\u6570\u3001\u6590\u6ce2\u90a3\u5951\u51fd\u6570\u7b49\u7b49 \\[ eg \\ \\ \\ F(n) = \\left\\{\\begin{matrix} 1 & n = 0, 1 \\\\ F(n-1)+F(n-2) & n >= 1 \\end{matrix}\\right. \\] int fibonacci ( int n ) { if ( n <= 1 ) return 1 ; return fibonacci ( n - 1 ) + fibonacci ( n - 2 ); } \u5bf9\u4e8e\u5c0f\u8303\u56f4\u53ef\u4ee5\u7528\u8bb0\u5fc6\u5316 \\(O(n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3 \u5bf9\u4e8e\u5927\u8303\u56f4\u53ef\u4ee5\u7528\u77e9\u9635\u5feb\u901f\u5e42 \\(O(\\log n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3\u3002","title":"\u9012\u5f52\u7684\u6982\u5ff5"},{"location":"cs/algorithm/design-analysis/#_8","text":"\u5206\u6cbb\u6cd5\u7684\u57fa\u672c\u601d\u60f3\u662f\u5c06\u4e00\u4e2a\u898f\u6a21\u4e3a \\(n\\) \u7684\u95ee\u9898\u5206\u89e3\u4e3a \\(k\\) \u4e2a\u89c4\u6a21\u8f83\u5c0f\u7684\u5b50\u95ee\u9898\uff0c\u8fd9\u4e9b\u5b50\u95ee\u9898\u4e92\u76f8\u72ec\u7acb\u4e14\u4e0e\u539f\u95ee\u9898\u76f8\u540c\u3002\u9012\u95e8\u5730\u89e3\u8fd9\u4e9b\u5b50\u95ee\u9898\uff0c\u7136\u540e\u5c07\u5404\u5b50\u95ee\u9898\u7684\u89e3\u5408\u4e95\u5f97\u5230\u539f\u5411\u9898\u7684\u89e3\u3002 eg\uff1a\u5feb\u901f\u5e42\u3001\u4e8c\u5206\u3001\u5f52\u5e76\u6392\u5e8f\u3001\u7ebf\u6bb5\u6811\u3001cdq\u5206\u6cbb\u3001FFT\u7b49","title":"\u5206\u6cbb\u6cd5\u601d\u60f3"},{"location":"cs/algorithm/design-analysis/#_9","text":"\u6709\u4e24\u4e2a\u8d85\u8fc7 long long \u7c7b\u578b\u7684\u5927\u6574\u6570 \\(X\\) \u548c \\(Y\\) \uff0c\u7528\u8f83\u4f4e\u7684\u590d\u6742\u5ea6\u6c42\u89e3 \\(X*Y\\) \u3002 \u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u81f3\u5c11\u6709 6 \u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u770b\u4e4b\u524d\u5199\u8fc7\u7684\u6587\u7ae0\uff1a \u5927\u6574\u6570\u76f8\u4e58 \u2013 \u6a21\u62df/\u5206\u6cbb/FFT/CRT/\u7f51\u7edc\u6d41/Furer","title":"\u5927\u6574\u6570\u7684\u4e58\u6cd5"},{"location":"cs/algorithm/design-analysis/#reference","text":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790(\u738b\u6653\u4e1c).pdf","title":"Reference"},{"location":"cs/db/mysql/","text":"MySQL \u00b6 \u4e8b\u52a1 \u00b6 \u4e8b\u52a1\u662f\u6ee1\u8db3ACID\u7279\u6027\u7684\u4e00\u7ec4\u64cd\u4f5c\u3002 \u539f\u5b50\u6027 \uff08Atomicity\uff09\uff1a\u4e8b\u52a1\u65f6\u4e0d\u53ef\u5206\u5272\u7684\u6700\u5c0f\u5355\u5143\uff0c\u4e8b\u52a1\u5185\u7684\u8bed\u53e5\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u6210\u529f\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u5931\u8d25\u3002 \u4e00\u81f4\u6027 \uff08Consistency\uff09\uff1a\u6570\u636e\u5e93\u5728\u4e8b\u52a1\u6267\u884c\u524d\u540e\u90fd\u4fdd\u6301\u4e00\u81f4\u6027\u72b6\u6001\u3002\u5728\u4e00\u81f4\u6027\u72b6\u6001\u4e0b\uff0c\u6240\u6709\u4e8b\u52a1\u5bf9\u4e00\u4e2a\u6570\u636e\u7684\u8bfb\u5199\u7ed3\u679c\u90fd\u662f\u76f8\u540c\u7684\u3002 \u9694\u79bb\u6027 \uff08Isolation\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u6240\u505a\u7684\u4fee\u6539\u5728\u6700\u7ec8\u63d0\u4ea4\u4ee5\u524d\uff0c\u5bf9\u5176\u4ed6\u4e8b\u52a1\u662f\u4e0d\u53ef\u89c1\u7684\u3002 \u6301\u4e45\u6027 \uff08Durability\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u63d0\u4ea4\uff0c\u5219\u5176\u6240\u505a\u7684\u4fee\u6539\u5c06\u4f1a\u6c38\u8fdc\u4fdd\u5b58\u5728\u6570\u636e\u5e93\u4e2d\u3002 MYSQL\u9ed8\u8ba4\u91c7\u7528\u81ea\u52a8\u63d0\u4ea4\u6a21\u5f0f\u3002 \u5e76\u53d1\u4e00\u81f4\u6027 \u00b6 \u4e22\u5931\u4fee\u6539 \uff1aT1\u548cT2\u4e24\u4e2a\u4e8b\u52a1\u90fd\u5bf9\u4e00\u4e2a\u6570\u636e\u8fdb\u884c\u4fee\u6539\uff0cT1\u5148\u4fee\u6539\uff0cT2\u540e\u4fee\u6539\uff0c\u5219T2\u70b9\u4fee\u6539\u4f1a\u8986\u76d6T1. \u8bfb\u810f\u6570\u636e \uff1aT1\u4fee\u6539\u4e00\u4e2a\u6570\u636e\uff0cT2\u968f\u540e\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u3002\u5982\u679cT1\u64a4\u9500\u4e86\u8fd9\u6b21\u4fee\u6539\uff0c\u5219T2\u8bfb\u5230\u7684\u662f\u810f\u6570\u636e\u3002 \u4e0d\u53ef\u91cd\u590d\u8bfb \uff1aT2\u8bfb\u53d6\u4e00\u4e2a\u6570\u636e\uff0cT1\u5bf9\u8be5\u6570\u636e\u505a\u4e86\u4fee\u6539\uff0c\u6b64\u65f6T2\u518d\u6b21\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u4f1a\u548c\u7b2c\u4e00\u6b21\u8bfb\u53d6\u7684\u7ed3\u679c\u4e0d\u540c\u3002 \u5e7b\u5f71\u8bfb \uff1aT1\u8bfb\u53d6\u67d0\u4e2a\u8303\u56f4\u7684\u6570\u636e\uff0cT2\u5728\u8fd9\u4e2a\u8303\u56f4\u5185\u63d2\u5165\u4e86\u65b0\u7684\u6570\u636e\uff0cT1\u518d\u6b21\u8bfb\u53d6\u548c\u7b2c\u4e00\u6b21\u7684\u7ed3\u679c\u4e0d\u540c\u3002 B\u6811\u548cB+\u6811 \u00b6 B\u6811\u7684\u7279\u70b9 \u4e00\u4e2a\u8282\u70b9\u4e0a\u5305\u62ec\u81f3\u591a \\(m-1\\) \u4e2a\u503c \u6839\u8282\u70b9\u81f3\u5c11\u6709\u4e24\u4e2a\u5b69\u5b50 \u975e\u53f6\u5b50\u7ed3\u70b9\u5982\u679c\u5305\u542b\u4e86 \\(k\\) \u4e2a\u503c\uff0c\u5219\u5176\u5305\u542b\u4e86 \\(k+1\\) \u4e2a\u5b69\u5b50\u8282\u70b9 \u6240\u6709\u53f6\u5b50\u7ed3\u70b9\u90fd\u4f4d\u4e8e\u540c\u4e00\u5c42 B+\u6811\u7684\u7279\u70b9 \u6240\u6709\u7684\u975e\u53f6\u5b50\u7ed3\u70b9\u4e0d\u518d\u4fdd\u5b58\u503c\uff0c\u800c\u662f\u53ea\u4fdd\u5b58\u4e86\u4e2d\u95f4\u503c \u6240\u6709\u503c\u4fdd\u5b58\u5728\u53f6\u5b50\u7ed3\u70b9\u4e0a \u6240\u6709\u7684\u53f6\u5b50\u7ed3\u70b9\u901a\u5e38\u94fe\u8868\u6309\u7167\u987a\u5e8f\u8fdb\u884c\u8fde\u63a5 \u4e3a\u4ec0\u4e48\u6570\u636e\u5e93\u4f1a\u91c7\u7528B+\u6811\u800c\u4e0d\u662fB\u6811\u6d3b\u7740AVL\u6811 AVL\u7684\u7ed3\u70b9\u8bbf\u95ee\u6b21\u6570\u66f4\u591a\uff0c\u800c\u5bf9\u4e8e\u6570\u636e\u5e93\u800c\u8a00\uff0c\u6bcf\u4e2a\u8282\u70b9\u901a\u5e38\u88ab\u5b58\u50a8\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u9700\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u6570\u91cf\u66f4\u591a\uff0c\u5bfc\u81f4\u6548\u7387\u4f4e \u5728\u6570\u636e\u5e93\u4e2d\u6709\u65f6\u9700\u8981\u8fdb\u884c\u8303\u56f4\u7684\u6240\u6709\uff0c\u6b64\u65f6B+\u6811\u7684\u94fe\u8868\u7ed3\u6784\u53ef\u4ee5\u5feb\u901f\u7684\u627e\u5230\u67d0\u4e2a\u7ed3\u70b9\u7684\u4e0b\u4e00\u4e2a\u7ed3\u70b9\u4f4d\u7f6e MySQL\u9501 \u00b6 \u7c7b\u578b \u5168\u5c40\u9501 \u8868\u7ea7\u9501 \u884c\u7ea7\u9501 \u8bfb\u5199\u9501 \u8bfb\u9501\uff1a\u53ef\u4ee5\u4e0e\u5176\u4ed6\u7684\u8bfb\u9501\u5171\u5b58\uff0c\u4f46\u662f\u4e0d\u53ef\u4ee5\u4e0e\u5199\u9501\u5171\u5b58 \u5199\u9501\uff1a\u4e0d\u53ef\u4ee5\u4e0e\u5176\u4ed6\u4efb\u4f55\u9501\u5171\u5b58 \u60b2\u89c2\u9501 \u666e\u901a\u7684\u9501\uff0c\u9501\u5b9a\u6b64\u884c/\u8868/\u6570\u636e\u5e93\u4ee5\u9632\u6b62\u5176\u4ed6\u64cd\u4f5c\u8fdb\u884c\u4fee\u6539\uff0c\u4f1a\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u88ab\u963b\u585e \u4e50\u89c2\u9501 \u901a\u8fc7\u6bd4\u8f83\u7248\u672c\u53f7\u7684\u533a\u522b\u7684\u65b9\u6cd5\uff0c\u6765\u786e\u5b9a\u6b64\u6570\u636e\u662f\u5426\u7ecf\u8fc7\u4fee\u6539\uff0c\u5982\u679c\u4fee\u6539\u5219\u9700\u8981\u8bfb\u53d6\u6700\u65b0\u7684\u503c \u6570\u636e\u5e93\u9694\u79bb\u7ea7\u522b \u00b6 \u9694\u79bb\u7ea7\u522b \u810f\u8bfb \u4e0d\u53ef\u91cd\u590d\u8bfb \u5e7b\u8bfb \u672a\u63d0\u4ea4\u8bfb \u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u5df2\u63d0\u4ea4\u8bfb \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u53ef\u91cd\u590d\u8bfb \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u4e32\u884c\u5316 \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u9694\u79bb\u7ea7\u522b\uff1a \u672a\u63d0\u4ea4\u8bfb\uff1a\u6700\u6734\u7d20\u7684\u6570\u636e\u5f62\u5f0f \u5df2\u63d0\u4ea4\u8bfb\uff1a\u5728\u4e8b\u52a1\u5b8c\u6210\u4e4b\u540e\u518d\u66f4\u65b0\u6570\u636e\u5e93\u7684\u503c \u53ef\u91cd\u590d\u8bfb\uff1a\u6bcf\u4e2a\u4e8b\u52a1\u5f00\u59cb\u524d\u9501\u5b9a\u6240\u66f4\u65b0\u7684\u884c \u53ef\u4e32\u884c\u5316\uff1a\u5355\u4e00\u7ebf\u7a0b\uff0c\u6240\u6709\u4e8b\u52a1\u5fc5\u987b\u6309\u7167\u987a\u5e8f\u8fdb\u884c3 \u5b58\u50a8\u5f15\u64ce InnoDB\u548cMyISAM \u00b6 InnoDB \u00b6 \u662fMySQL\u9ed8\u8ba4\u7684\u5b58\u50a8\u5f15\u64ce\u3002\u5b9e\u73b0\u4e86\u56db\u4e2a\u6807\u51c6\u7684\u9694\u79bb\u7ea7\u522b\u3002\u9ed8\u8ba4\u662f\u53ef\u91cd\u590d\u8bfb\uff0c\u901a\u8fc7MVCC\u548cNext-Key Locking\u9632\u6b62\u5e7b\u5f71\u8bfb\u3002\u652f\u6301\u771f\u6b63\u7684\u5728\u7ebf\u70ed\u5907\u4efd\uff0c\u5176\u4ed6\u5b58\u50a8\u5f15\u64ce\u4e0d\u652f\u6301\u5728\u7ebf\u70ed\u5907\u4efd\u3002 Record Locks \uff1a\u9501\u5b9a\u4e00\u4e2a\u8bb0\u5f55\u4e0a\u7684\u7d22\u5f15\uff0c\u800c\u4e0d\u662f\u8bb0\u5f55\u672c\u8eab\u3002 Gap Locks \uff1a\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\uff0c\u800c\u4e0d\u662f\u7d22\u5f15\u672c\u8eab\u3002 Next-Key Locks \uff1aInnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u4e00\u79cd\u9501\u5b9e\u73b0\uff0c\u662fRecord Locks\u548cGap Locks\u7684\u7ed3\u5408\u3002\u4e0d\u4ec5\u4ec5\u9501\u5b9a\u7d22\u5f15\uff0c\u4e5f\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\u3002 MyISAM \u00b6 \u8bbe\u8ba1\u7b80\u5355\uff0c\u6570\u636e\u4ee5\u7d27\u5bc6\u683c\u5f0f\u5b58\u50a8\u3002\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7279\u6027\uff0c\u5305\u62ec\u538b\u7f29\u8868\u3001\u7a7a\u95f4\u6570\u636e\u7d22\u5f15\u7b49\u3002\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c\u4e0d\u652f\u6301\u884c\u7ea7\u9501\uff0c\u53ea\u652f\u6301\u8868\u7ea7\u9501\uff0c\u53ef\u4ee5\u624b\u5de5\u6216\u8005\u81ea\u52a8\u6267\u884c\u68c0\u67e5\u548c\u4fee\u590d\u64cd\u4f5c\uff0c\u4f46\u53ef\u80fd\u5bfc\u81f4\u4e00\u4e9b\u6570\u636e\u4e22\u5931\uff0c\u800c\u4e14\u4fee\u590d\u64cd\u4f5c\u975e\u5e38\u6162\u3002 \u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08MVCC\uff09 \u00b6 \u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08Multi-Version Concurrency Control, MVCC\uff09\u662f MySQL \u7684 InnoDB \u5b58\u50a8\u5f15\u64ce\u5b9e\u73b0\u9694\u79bb\u7ea7\u522b\u7684\u4e00\u79cd\u5177\u4f53\u65b9\u5f0f\uff0c\u7528\u4e8e\u5b9e\u73b0\u63d0\u4ea4\u8bfb\u548c\u53ef\u91cd\u590d\u8bfb\u8fd9\u4e24\u79cd\u9694\u79bb\u7ea7\u522b\u3002\u800c\u672a\u63d0\u4ea4\u8bfb\u9694\u79bb\u7ea7\u522b\u603b\u662f\u8bfb\u53d6\u6700\u65b0\u7684\u6570\u636e\u884c\uff0c\u8981\u6c42\u5f88\u4f4e\uff0c\u65e0\u9700\u4f7f\u7528 MVCC\u3002\u53ef\u4e32\u884c\u5316\u9694\u79bb\u7ea7\u522b\u9700\u8981\u5bf9\u6240\u6709\u8bfb\u53d6\u7684\u884c\u90fd\u52a0\u9501\uff0c\u5355\u7eaf\u4f7f\u7528 MVCC \u65e0\u6cd5\u5b9e\u73b0\u3002 InnoDB\u7684MVCC\uff0c\u662f\u901a\u8fc7\u5728\u6bcf\u884c\u8bb0\u5f55\u540e\u9762\u4fdd\u5b58\u4e24\u4e2a\u9690\u85cf\u7684\u5217\u6765\u5b9e\u73b0\u7684\u3002\u8fd9\u4e24\u4e2a\u5217\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u8fc7\u671f\u65f6\u95f4\u3002\u5b58\u50a8\u7684\u4e0d\u662f\u5b9e\u9645\u7684\u65f6\u95f4\u503c\uff0c\u800c\u662f\u7cfb\u7edf\u7684\u7248\u672c\u53f7\u3002MVCC\u53ea\u8981\u53ef\u91cd\u590d\u8bfb\u548c\u63d0\u4ea4\u8bfb\u4e24\u4e2a\u9694\u79bb\u7ea7\u522b\u4e0b\u5de5\u4f5c\u3002 \u5728\u53ef\u91cd\u590d\u8bfb\u7684\u9694\u79bb\u7ea7\u522b\u4e0b\uff0cMVCC\u7684\u64cd\u4f5c\uff1a - SELECT 1. InnoDB\u53ea\u67e5\u627e\u7248\u672c\u65e9\u4e8e\u5f53\u524d\u4e8b\u52a1\u7248\u672c\u7684\u6570\u636e\u884c\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e8b\u52a1\u8bfb\u53d6\u7684\u884c\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u5f00\u542f\u524d\u5df2\u7ecf\u5b58\u5728\u7684\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u81ea\u8eab\u63d2\u5165\u6216\u8005\u4fee\u6539\u8fc7\u7684\u3002 2. \u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u8981\u4e48\u672a\u5b9a\u4e49\uff0c\u8981\u4e48\u5927\u4e8e\u5f53\u524d\u4e8b\u52a1\u7684\u7248\u672c\u53f7\uff0c\u8fd9\u53ef\u4ee5\u4fdd\u8bc1\u4e8b\u52a1\u8bfb\u53d6\u5230\u7684\u884c\uff0c\u5728\u4e8b\u52a1\u5f00\u59cb\u524d\u672a\u88ab\u5220\u9664\u3002 - INSERT 1. \u4e3a\u63d2\u5165\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u884c\u7248\u672c\u53f7\u3002 - DELETE 1. \u4e3a\u5220\u9664\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u5220\u9664\u7248\u672c\u53f7\u3002 - UPDATE 1. \u4fee\u6539\u540e\u7684\u6570\u636e\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u521b\u5efa\u7248\u672c\u53f7\uff0c\u540c\u65f6\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u539f\u6765\u7684\u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u3002 \u8303\u5f0f \u00b6 \u7b2c\u4e00\u8303\u5f0f\uff1a\u5c5e\u6027\u4e0d\u53ef\u5206 \u7b2c\u4e8c\u8303\u5f0f\uff1a\u6bcf\u4e2a\u975e\u4e3b\u5c5e\u6027\u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u7b2c\u4e09\u8303\u5f0f\uff1a\u975e\u4e3b\u5c5e\u6027\u4e0d\u4f20\u9012\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u8303\u5f0f\u5316\u7684\u597d\u5904\uff1a \u8303\u5f0f\u5316\u7684\u66f4\u65b0\u64cd\u4f5c\u901a\u5e38\u6bd4\u53cd\u8303\u5f0f\u5316\u8981\u5feb \u5f53\u6570\u636e\u8f83\u597d\u5730\u8303\u5f0f\u5316\u65f6\uff0c\u5c31\u53ea\u6709\u5f88\u5c11\u6216\u8005\u6ca1\u6709\u91cd\u590d\u6570\u636e\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u4fee\u6539\u66f4\u5c11\u7684\u6570\u636e\u3002 \u8303\u5f0f\u5316\u7684\u8868\u901a\u5e38\u66f4\u5c0f\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u653e\u5728\u5185\u5b58\u91cc\uff0c\u6240\u4ee5\u6267\u884c\u64cd\u4f5c\u4f1a\u66f4\u5feb\u3002 \u8303\u5f0f\u5316\u7684\u7f3a\u70b9\uff1a\u901a\u5e38\u9700\u8981\u5173\u8054\uff0c\u4ee3\u4ef7\u6602\u8d35\uff0c\u4e5f\u53ef\u80fd\u4f7f\u4e00\u4e9b\u7d22\u5f15\u7b56\u7565\u65e0\u6548\u3002 \u67e5\u8be2\u4f18\u5316 \u00b6 \u67e5\u8be2\u6027\u80fd\u4f4e\u4e0b\u7684\u6700\u57fa\u672c\u7684\u539f\u56e0\u662f\u8bbf\u95ee\u7684\u6570\u636e\u592a\u591a\u3002 \u662f\u5426\u5411\u6570\u636e\u5e93\u8bf7\u6c42\u4e86\u4e0d\u9700\u8981\u7684\u6570\u636e \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u5217\uff0c\u6700\u597d\u4e0d\u8981\u7528 select * \u8fdb\u884c\u67e5\u8be2 \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u884c\uff0c\u4f7f\u7528limit\u6765\u9650\u5236\u8fd4\u56de\u7684\u6570\u636e \u7f13\u5b58\u91cd\u590d\u67e5\u8be2\u7684\u6570\u636e \u662f\u5426\u5728\u626b\u63cf\u989d\u5916\u7684\u8bb0\u5f55 \u4f7f\u7528\u7d22\u5f15\u8986\u76d6\u626b\u63cf\uff0c\u628a\u6240\u6709\u9700\u8981\u7528\u5230\u7684\u5217\u90fd\u653e\u5728\u7d22\u5f15\u4e2d\uff0c \u8fd9\u6837\u5b58\u50a8\u5f15\u64ce\u65e0\u9700\u56de\u8868\u83b7\u53d6\u5bf9\u5e94\u884c\u5c31\u53ef\u4ee5\u8fd4\u56de\u7ed3\u679c \u6539\u53d8\u5e93\u8868\u7ed3\u6784 \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u5207\u5206\u5927\u67e5\u8be2 \u5206\u89e3\u5927\u8fde\u63a5\u67e5\u8be2 \u4e3b\u4ece\u590d\u5236 \u00b6 \u6982\u5ff5 \u00b6 MySQL\u4e3b\u4ece\u590d\u5236\u662f\u6307\u6570\u636e\u53ef\u4ee5\u4ece\u4e00\u4e2aMySQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e3b\u8282\u70b9\u590d\u5236\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u4ece\u8282\u70b9\u3002MySQL\u9ed8\u8ba4\u91c7\u7528\u5f02\u6b65\u590d\u5236\u65b9\u5f0f\uff0c\u8fd9\u6837\u4ece\u8282\u70b9\u4e0d\u7528\u4e00\u76f4\u8bbf\u95ee\u4e3b\u670d\u52a1\u5668\u6765\u66f4\u65b0\u81ea\u5df1\u7684\u6570\u636e\uff0c\u6570\u636e\u7684\u66f4\u65b0\u53ef\u4ee5\u5728\u8fdc\u7a0b\u8fde\u63a5\u4e0a\u8fdb\u884c\uff0c\u4ece\u8282\u70b9\u53ef\u4ee5\u590d\u5236\u4e3b\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u6570\u636e\u5e93\u6216\u8005\u7279\u5b9a\u7684\u6570\u636e\u5e93\uff0c\u6216\u8005\u7279\u5b9a\u7684\u8868\u3002 \u4f5c\u7528 \u00b6 \u6570\u636e\u5206\u5e03 \u8d1f\u8f7d\u5747\u8861 \u6570\u636e\u5907\u4efd\uff0c\u4fdd\u8bc1\u6570\u636e\u5b89\u5168 \u9ad8\u53ef\u7528\u6027\u548c\u5bb9\u9519\u884c \u5b9e\u73b0\u8bfb\u5199\u5206\u79bb\uff0c\u7f13\u89e3\u6570\u636e\u5e93\u538b\u529b \u7531\u4e8emysql\u5b9e\u73b0\u7684\u5f02\u6b65\u590d\u5236\uff0c\u6240\u4ee5\u4e3b\u5e93\u548c\u4ece\u5e93\u4e4b\u95f4\u5b58\u5728\u4e00\u5b9a\u7684\u5dee\u5f02\uff0c\u5728\u4ece\u5e93\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u9700\u8981\u8003\u8651\u8fd9\u4e9b\u6570\u636e\u7684\u5dee\u5f02\uff0c\u4e00\u822c\u53ea\u6709\u66f4\u65b0\u4e0d\u9891\u7e41\u548c\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4ece\u5e93\u67e5\u8be2\uff0c\u5b9e\u884c\u8981\u6c42\u9ad8\u7684\u4ecd\u7136\u8981\u4ece\u4e3b\u5e93\u67e5\u8be2\u3002 \u539f\u7406 \u00b6 MySQL\u4e3b\u4ece\u590d\u5236\u6d89\u53ca\u5230\u4e09\u4e2a\u7ebf\u7a0b\uff0c\u4e00\u4e2a\u8fd0\u884c\u5728 \u4e3b\u8282\u70b9\uff08log dump thread\uff09 \uff0c\u5176\u4f59\u4e24\u4e2a\uff08 I/O thread\uff0c SQL thread \uff09\u8fd0\u884c\u5728\u4ece\u8282\u70b9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a binlog \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u5c06\u4e3b\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u66f4\u6539\u5199\u5165\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff08Binary log\uff09\u4e2d\u3002 I/O \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u4ece\u4e3b\u670d\u52a1\u5668\u4e0a\u8bfb\u53d6\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u5e76\u5199\u5165\u4ece\u670d\u52a1\u5668\u7684\u4e2d\u7ee7\u65e5\u5fd7\uff08Relay log\uff09\u3002 SQL \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u8bfb\u53d6\u4e2d\u7ee7\u65e5\u5fd7\uff0c\u89e3\u6790\u51fa\u4e3b\u670d\u52a1\u5668\u5df2\u7ecf\u6267\u884c\u7684\u6570\u636e\u66f4\u6539\u5e76\u5728\u4ece\u670d\u52a1\u5668\u4e2d\u91cd\u653e\uff08Replay\uff09\u3002 \u8fde\u63a5\u6c60 \u00b6 \u4e3a\u4ec0\u4e48\u4f7f\u7528\u8fde\u63a5\u6c60 \u4e0eJava\u7684\u7ebf\u7a0b\u6c60\u76f8\u540c\uff0c\u4e3a\u4e86\u8282\u7ea6\u7cfb\u7edf\u8d44\u6e90 \u5e38\u7528\u7684\u8fde\u63a5\u6c60 DBCP\uff1a\u4f7f\u7528\u91cf\u6700\u5927\u7684\u8fde\u63a5\u6c60 C3P0 \u5206\u8868 \u00b6 \u6c34\u5e73\u5206\u8868 \u5c06\u4e00\u4e2a\u8868\u7684\u8bb0\u5f55\u5206\u5272\u5230\u6570\u4e2a\u8868\u4e2d\uff0c\u53ef\u4ee5\u51cf\u5c11\u7d22\u5f15\u7684\u5927\u5c0f\uff0c\u52a0\u5feb\u7d22\u5f15 \u5782\u76f4\u5206\u8868 \u5c06\u90e8\u5206\u5b57\u6bb5\u5212\u5206\u81f3\u5176\u4ed6\u7684\u8868\uff0c\u90e8\u5206\u5b57\u6bb5\u6570\u636e\u91cf\u5927\uff0c\u8fdb\u884c\u7d22\u5f15\u65f6\u4f1a\u5e26\u6765\u5927\u91cf\u7684IO\u8d1f\u62c5\uff0c\u8fdb\u884c\u5206\u8868\u6709\u5229\u4e8e\u67e5\u8be2\u6548\u7387 SQL \u00b6 \u4e00\u6761SQL\u8bed\u53e5\u7684\u6267\u884c\u8fc7\u7a0b\uff1a 1. \u8fde\u63a5\u5668\u67e5\u770b\u5f53\u524d\u7528\u6237\u6743\u9650\uff0c\u82e5\u62e5\u6709\u6743\u9650\uff0c\u5efa\u7acb\u8fde\u63a5\u3002\u5982\u679c\u5ba2\u6237\u7aef\u592a\u957f\u65f6\u95f4\u6ca1\u6709\u52a8\u9759\uff0c\u8fde\u63a5\u5668\u4f1a\u81ea\u52a8\u65ad\u5f00\u8fde\u63a5 2. \u5206\u6790\u5668\u5206\u6790SQL\u8bed\u53e5\uff0c\u5305\u62ec\u8bed\u6cd5\u5206\u6790\uff08\u8bed\u6cd5\u662f\u5426\u6b63\u786e\uff09\uff0c\u8bcd\u6cd5\u5206\u6790\uff08\u8bc6\u522bSQL\u8bed\u53e5\uff09\u3002 3. \u4f18\u5316\u5668\u4f18\u5316\u67e5\u8be2\uff0c\u51b3\u5b9a\u4f7f\u7528\u7684\u7d22\u5f15\u7b49\u3002 4. \u6267\u884c\u5668\u6765\u65f6\u6267\u884c\u8bed\u53e5\u3002 \u8bf4\u4e00\u4e0b\u7d22\u5f15\uff1f \u00b6 \u4ec0\u4e48\u662f\u7d22\u5f15 \u00b6 \u7d22\u5f15\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6587\u4ef6\uff08InnoDB\u6570\u636e\u8868\u4e0a\u7684\u7d22\u5f15\u662f\u8868\u7a7a\u95f4\u7684\u4e00\u4e2a\u7ec4\u6210\u90e8\u5206\uff09\uff0c\u4ed6\u4eec\u5305\u542b\u7740\u5bf9\u6570\u636e\u8868\u91cc\u6240\u6709\u8bb0\u5f55\u7684\u5f15\u7528\u6307\u9488\u3002 \u7d22\u5f15\u662f\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u3002\u6570\u636e\u5e93\u7d22\u5f15\uff0c\u662f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u6392\u5e8f\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4e3a\u4e86\u534f\u52a9\u5feb\u901f\u67e5\u8be2\u3001\u66f4\u65b0\u6570\u636e\u8868\u4e2d\u6570\u636e\u3002\u7d22\u5f15\u7684\u5b9e\u73b0\u901a\u5e38\u4f7f\u7528B\u6811\u4ee5\u53ca\u53d8\u79cdB+\u6811\u3002 \u7d22\u5f15\u7684\u7f3a\u70b9 \u00b6 \u65f6\u95f4\u65b9\u9762\uff1a\u521b\u5efa\u7d22\u5f15\u548c\u7ef4\u62a4\u7d22\u5f15\u8981\u8017\u8d39\u65f6\u95f4\uff0c\u5177\u4f53\u7684\uff0c\u5f53\u5bf9\u8868\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u589e\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u7684\u65f6\u5019\uff0c\u7d22\u5f15\u4e5f\u8981\u52a8\u6001\u7684\u7ef4\u62a4\uff0c\u4f1a\u8f83\u4f4e\u589e\u6539\u5220\u7684\u6267\u884c\u6548\u7387\u3002 \u7a7a\u95f4\u65b9\u9762\uff1a\u7d22\u5f15\u9700\u8981\u5360\u7528\u7269\u7406\u7a7a\u95f4\u3002 \u7d22\u5f15\u7684\u4e3b\u8981\u7c7b\u578b \u00b6 \u7269\u7406\u5b58\u50a8\u89d2\u5ea6\uff1a \u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4f5c\u4e3aB+\u6811\u7d22\u5f15\u7684\u952e\u503c\u800c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u975e\u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4e4b\u5916\u7684\u5217\u503c\u4f5c\u4e3a\u952e\u503c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u6570\u636e\u7ed3\u6784\u89d2\u5ea6\uff1a B+\u6811\u7d22\u5f15 hash\u7d22\u5f15 FULLTEXT\u7d22\u5f15 R-Tree\u7d22\u5f15 \u903b\u8f91\u89d2\u5ea6\uff1a \u4e3b\u952e\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u4e0d\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u53ea\u80fd\u6709\u4e00\u4e2a\u4e3b\u952e \u666e\u901a/\u5355\u5217\u7d22\u5f15\uff1a\u57fa\u672c\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u6ca1\u6709\u552f\u4e00\u6027\u7684\u6027\u8d28\uff0c\u5141\u8bb8\u4e3a NULL \u591a\u5217/\u8054\u5408/\u590d\u5408\u7d22\u5f15\uff1a\u4ee5\u4e00\u5b9a\u987a\u5e8f\u5f15\u7528\u591a\u5217 \u552f\u4e00\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u5141\u8bb8\u591a\u4e2a\u5217\u521b\u5efa\u552f\u4e00\u7d22\u5f15 \u5168\u6587\u7d22\u5f15\uff1a\u76ee\u524d\u641c\u7d22\u5f15\u64ce\u4f7f\u7528\u7684\u4e00\u79cd\u5173\u952e\u6280\u672f \u7a7a\u95f4\u7d22\u5f15\uff1a\u5bf9\u7a7a\u95f4\u6570\u636e\u7c7b\u578b\u7684\u5b57\u6bb5\u5efa\u7acb\u7684\u7d22\u5f15 \u6700\u5de6\u524d\u7f00\u5339\u914d\u539f\u5219 \u00b6 \u4e3b\u8981\u9488\u5bf9\u8054\u5408\u7d22\u5f15\uff0c\u5982\u679c\u67e5\u8be2\u7684\u65f6\u5019\u67e5\u8be2\u6761\u4ef6\u7cbe\u786e\u5339\u914d\u7d22\u5f15\u7684\u5de6\u8fb9\u8fde\u7eed\u4e00\u5217\u6216\u591a\u5217\uff0c\u5219\u6b64\u5217\u5c31\u53ef\u4ee5\u88ab\u7528\u5230\u3002 redis\u5e94\u7528\u573a\u666f\uff1f \u00b6 \u7f13\u5b58\u3001\u8ba1\u6570\u5668\u3001\u961f\u5217\u3001\u4f4d\u64cd\u4f5c\u3001\u6700\u65b0\u5217\u8868\u3002 \u8bf4\u4e00\u4e0b\u56de\u8868\u64cd\u4f5c\uff1f \u00b6 \u975e\u805a\u7c07\u7d22\u5f15\u548c\u805a\u7c07\u7d22\u5f15\u7684\u533a\u522b\u5728\u4e8e\u975e\u805a\u7c07\u7d22\u5f15\u7684\u53f6\u5b50\u8282\u70b9\u4e0d\u5b58\u50a8\u8868\u4e2d\u7684\u6570\u636e\uff0c\u800c\u662f\u5b58\u50a8\u8be5\u5217\u5bf9\u5e94\u7684\u4e3b\u952e\uff0c\u60f3\u8981\u67e5\u627e\u6570\u636e\u6211\u4eec\u8fd8\u9700\u8981\u6839\u636e\u4e3b\u952e\u518d\u53bb\u805a\u7c07\u7d22\u5f15\u4e2d\u8fdb\u884c\u67e5\u627e\uff0c\u8fd9\u4e2a\u518d\u6839\u636e\u805a\u7c07\u7d22\u5f15\u67e5\u627e\u6570\u636e\u7684\u8fc7\u7a0b\uff0c\u88ab\u79f0\u4e3a\u56de\u8868\u3002 \u5982\u4f55\u907f\u514d\u56de\u8868\u67e5\u8be2?\u4ec0\u4e48\u662f\u7d22\u5f15\u8986\u76d6? \u00b6 \u5982\u4f55\u907f\u514d\uff1a\u5c06\u88ab\u67e5\u8be2\u7684\u5b57\u6bb5\uff0c\u5efa\u7acb\u5230\u8054\u5408\u7d22\u5f15\u4e2d\u3002\u5c3d\u91cf\u4f7f\u7528\u5230\u7d22\u5f15\u8986\u76d6\uff0c\u4e0d\u5e94\u8be5\u4f7f\u7528 * \u6765\u5168\u8868\u67e5\u8be2\u3002 \u7d22\u5f15\u8986\u76d6\u662f\u6307\u4ece\u7d22\u5f15\u4e2d\u5c31\u53ef\u4ee5\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\uff0c\u4ece\u800c\u4e0d\u9700\u8981\u67e5\u8be2\u805a\u7c07\u7d22\u5f15\u4e2d\u7684\u884c\u6570\u636e\u4fe1\u606f\u3002 \u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u8986\u76d6\u7d22\u5f15\u5fc5\u987b\u8981\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u800c\u54c8\u5e0c\u7d22\u5f15\u3001\u7a7a\u95f4\u7d22\u5f15\u548c\u5168\u6587\u7d22\u5f15\u4e0d\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u6240\u4ee5mysql\u53ea\u80fd\u7528B+tree\u7d22\u5f15\u505a\u8986\u76d6\u7d22\u5f15\u3002 \u8bf4\u4e00\u4e0b\u8868\u8fde\u63a5\u7684\u64cd\u4f5c\uff1f \u00b6 \u5728MySQL\u4e2d\uff0c\u5e38\u89c1\u7684\u8868\u8fde\u63a5\u65b9\u5f0f\u67094\u7c7b\uff0c\u51717\u79cd\u65b9\u5f0f\uff1a - INNER JOIN \uff1ainner join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\uff1b - LEFT JOIN \uff1aleft join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u5de6\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528where\u8fc7\u6ee4\u6761\u4ef6 - RIGHT JOIN \uff1aright join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u53f3\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528where\u8fc7\u6ee4\u6761\u4ef6 - FULL JOIN \uff1afull join\u662f\u5de6\u8fde\u63a5\u548c\u53f3\u8fde\u63a5\u7684\u5e76\u96c6\uff0cMySQL\u5e76\u672a\u63d0\u4f9bfull join\u7684\u8bed\u6cd5\uff0c\u5982\u679c\u8981\u5b9e\u73b0\uff0c\u9700\u8981left join\u4e8eright join\u8fdb\u884c\u6c42\u5e76\u96c6\uff0c\u8fd8\u6709\u7528where\u8fc7\u6ee4 \u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u4f1a\u5931\u6548\uff1f \u00b6 \u6761\u4ef6\u4e2d\u6709 or like \u67e5\u8be2\uff08\u4ee5 % \u5f00\u5934\uff09 \u5982\u679c\u5217\u7c7b\u578b\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e00\u5b9a\u8981\u5728\u6761\u4ef6\u4e2d\u5c06\u6570\u636e\u4f7f\u7528\u5f15\u53f7\u5f15\u7528\u8d77\u6765\uff0c\u5426\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15 \u5bf9\u5217\u8fdb\u884c\u51fd\u6570\u8fd0\u7b97 \u8d1f\u5411\u67e5\u8be2\u6761\u4ef6\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\uff0c\u6bd4\u5982 NOT IN \uff0c NOT LIKE \uff0c != \u7b49 \u5bf9\u4e8e\u8054\u5408\u7d22\u5f15\uff0c\u4e0d\u662f\u4f7f\u7528\u7b2c\u4e00\u90e8\u5206\uff08\u7b2c\u4e00\u4e2a\uff09\uff0c\u5219\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\uff08\u6700\u5de6\u5339\u914d\uff09 \u5982\u679cmysql\u8bc4\u4f30\u4f7f\u7528\u5168\u8868\u626b\u63cf\u8981\u6bd4\u4f7f\u7528\u7d22\u5f15\u5757\uff0c\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15 \u5224\u65adsql\u662f\u5426\u4f7f\u7528\u7d22\u5f15 \u00b6 \u4f7f\u7528\u89e3\u91ca\u51fd\u6570 explain \uff0c\u53ea\u9700\u6dfb\u52a0\u5728sql\u8bed\u53e5\u4e4b\u524d\u5373\u53ef\uff1a \u6211\u4eec\u53ea\u9700\u8981\u6ce8\u610f\u4e00\u4e2a\u6700\u91cd\u8981\u7684type \u7684\u4fe1\u606f\u5f88\u660e\u663e\u7684\u63d0\u73b0\u662f\u5426\u7528\u5230\u7d22\u5f15\uff1a type\u7ed3\u679c\u503c\u4ece\u597d\u5230\u574f\u4f9d\u6b21\u662f\uff1a system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL \u4e00\u822c\u6765\u8bf4\uff0c\u5f97\u4fdd\u8bc1\u67e5\u8be2\u81f3\u5c11\u8fbe\u5230range\u7ea7\u522b\uff0c\u6700\u597d\u80fd\u8fbe\u5230ref\uff0c\u5426\u5219\u5c31\u53ef\u80fd\u4f1a\u51fa\u73b0\u6027\u80fd\u95ee\u9898\u3002 possible_keys \uff1asql\u6240\u7528\u5230\u7684\u7d22\u5f15 key \uff1a\u663e\u793aMySQL\u5b9e\u9645\u51b3\u5b9a\u4f7f\u7528\u7684\u952e\uff08\u7d22\u5f15\uff09\u3002\u5982\u679c\u6ca1\u6709\u9009\u62e9\u7d22\u5f15\uff0c\u952e\u662fNULL rows : \u663e\u793aMySQL\u8ba4\u4e3a\u5b83\u6267\u884c\u67e5\u8be2\u65f6\u5fc5\u987b\u68c0\u67e5\u7684\u884c\u6570\u3002 \u8bf4\u4e00\u4e0b\u9501\uff1f\u8bf4\u4e00\u4e0b\u533a\u522b\uff1f \u00b6 Redis\u7f13\u5b58\u66f4\u65b0\u7b56\u7565 \u00b6 \u9ad8\u5e76\u53d1 \u00b6 \u9ad8\u5e76\u53d1\uff08High Concurrency\uff09\u662f\u6307\u7cfb\u7edf\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u4e00\u79cd\u201c\u77ed\u65f6\u95f4\u5185\u9047\u5230\u5927\u91cf\u64cd\u4f5c\u8bf7\u6c42\u201d\u7684\u60c5\u51b5\uff0c\u4e3b\u8981\u53d1\u751f\u5728web\u7cfb\u7edf\u96c6\u4e2d\u5927\u91cf\u8bbf\u95ee\u6536\u5230\u5927\u91cf\u8bf7\u6c42\uff0c\u4f8b\u5982\u6dd8\u5b9d\u53cc\u5341\u4e00\u3001\u4eac\u4e1c618\u7c7b\u7684\u6d3b\u52a8\u3002\u8be5\u60c5\u51b5\u7684\u53d1\u751f\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u6267\u884c\u5927\u91cf\u64cd\u4f5c\uff08\u5bf9\u8d44\u6e90\u7684\u8bf7\u6c42\u3001\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u7b49\uff09\u3002 \u9ad8\u5e76\u53d1\u76f8\u5173\u5e38\u7528\u7684\u4e00\u4e9b\u6307\u6807\u6709\uff1a\u54cd\u5e94\u65f6\u95f4\u3001\u541e\u5410\u91cf\u3001\u6bcf\u79d2\u67e5\u8be2\u7387QPS\u3001\u5e76\u53d1\u7528\u6237\u6570\u3002 \u54cd\u5e94\u65f6\u95f4 \uff1a\u7cfb\u7edf\u5bf9\u8bf7\u6c42\u505a\u51fa\u54cd\u5e94\u7684\u65f6\u95f4\u3002\u4f8b\u5982\u7cfb\u7edf\u5904\u7406\u4e00\u4e2ahttp\u8bf7\u6c42\u9700\u8981600ms\uff0c\u8fd9\u4e2a600ms\u5c31\u662f\u7cfb\u7edf\u7684\u54cd\u5e94\u65f6\u95f4\u3002 \u541e\u5410\u91cf \uff1a\u5355\u4f4d\u65f6\u95f4\u5185\u5904\u7406\u7684\u8bf7\u6c42\u6570\u91cf\u3002 QPS \uff1a\u6bcf\u79d2\u54cd\u5e94\u8bf7\u6c42\u6570\u3002 \u5e76\u53d1\u7528\u6237\u6570 \uff1a\u540c\u65f6\u627f\u8f7d\u6b63\u5e38\u4f7f\u7528\u7cfb\u7edf\u529f\u80fd\u7684\u7528\u6237\u6570\u91cf\u3002\u4f8b\u5982\u4e00\u4e2a\u5373\u65f6\u901a\u8baf\u7cfb\u7edf\uff0c\u540c\u65f6\u5728\u7ebf\u7684\u7528\u6237\u91cf\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4ee3\u8868\u4e86\u7cfb\u7edf\u7684\u5e76\u53d1\u7528\u6237\u6570\u3002 \u7b80\u5355\u6765\u8bf4\uff0c\u9ad8\u5e76\u53d1\u7684\u57fa\u672c\u8868\u73b0\u5c31\u662f\u7cfb\u7edf\u5728\u5355\u4f4d\u65f6\u95f4\u5185\u80fd\u591f\u540c\u65f6\u5904\u7406\u7684\u8bf7\u6c42\u6570\u3002\u9ad8\u5e76\u53d1\u6ca1\u6709\u5177\u4f53\u7684\u8303\u56f4\u89c4\u5b9a\u591a\u5c11\u5e76\u53d1\u7b97\u662f\u9ad8\u5e76\u53d1\uff0c\u6bd4\u5982\u4f60\u5f00\u53d1\u7684\u7cfb\u7edf\u6700\u5927\u5e76\u53d1\u662f1000\uff0c\u90a3\u4e48\u6765\u4e861001\u7684\u5e76\u53d1\u91cf\u5bf9\u4f60\u6765\u8bf4\u5c31\u662f\u9ad8\u5e76\u53d1\uff0c\u4f46\u662f\u8fd9\u4e2a\u5e76\u53d1\u91cf\u653e\u5728\u6dd8\u5b9d\u4e0a\uff0c\u7b80\u76f4\u4ec0\u4e48\u90fd\u7b97\u4e0d\u4e0a\u3002 \u5982\u679c\u9ad8\u5e76\u53d1\u5904\u7406\u4e0d\u597d\uff0c\u4e0d\u4ec5\u4f1a\u964d\u4f4e\u7528\u6237\u7684\u4f53\u9a8c\u5ea6(\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u8fc7\u957f\u7b49)\uff0c\u540c\u65f6\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u5b95\u673a\u3001\u505c\u6b62\u5de5\u4f5c\u7b49\u3002 \u4f7f\u7528\u7f13\u5b58 \u00b6 \u5927\u5bb6\u90fd\u77e5\u9053MySQL\u52a0\u4e0aRedis\u662f\u4e00\u5bf9\u513f\u7ecf\u5178\u7684\u7ec4\u5408\u3002\u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u4e3aMySQL\u6321\u4f4f\u5927\u90e8\u5206\u67e5\u8be2\u8bf7\u6c42\uff0c\u53ef\u4ee5\u5f88\u5927\u7a0b\u5ea6\u4e0a\u7f13\u89e3MySQL\u5e76\u53d1\u8bf7\u6c42\u7684\u538b\u529b\u3002Redis\u662f\u4e00\u4e2a\u4f7f\u7528\u5185\u5b58\u4fdd\u5b58\u6570\u636e\u7684\u9ad8\u6027\u80fdK-V\u6570\u636e\u5e93\uff0c\u5b83\u7684\u9ad8\u6027\u80fd\u4e3b\u8981\u6765\u81ea\u4e8e\uff1a \u7b80\u5355\u7684\u6570\u636e\u7ed3\u6784 \u548c \u4f7f\u7528\u5185\u5b58\u5b58\u50a8\u6570\u636e \u3002\u4f46\u662f\u6211\u4eec\u9700\u8981\u77e5\u9053\u7684\u662f\u5185\u5b58\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u6613\u5931\u6027\u5b58\u50a8\uff0c\u6240\u4ee5\u4f7f\u7528Redis\u4e0d\u80fd\u4fdd\u8bc1\u6570\u636e\u53ef\u9760\u5b58\u50a8\u3002\u4ece\u8bbe\u8ba1\u4e0a\u6765\u8bf4\uff0cRedis\u727a\u7272\u4e86\u6570\u636e\u53ef\u9760\u6027\uff0c\u6362\u53d6\u4e86\u9ad8\u6027\u80fd\u3002\u4f46\u4e5f\u6b63\u662f\u8fd9\u4e9b\u7279\u6027\uff0c\u4f7f\u5f97Redis\u7279\u522b\u9002\u5408\u7528\u6765\u505aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\u3002 \u5373\u4f7f\u53ea\u662f\u628aRedis\u4f5c\u4e3a\u7f13\u5b58\u6765\u4f7f\u7528\uff0c\u6211\u4eec\u5728\u8bbe\u8ba1Redis\u7f13\u5b58\u7684\u65f6\u5019\uff0c\u4e5f\u5fc5\u987b\u8981\u8003\u8651Redis\u7684\u8fd9\u79cd \u6570\u636e\u4e0d\u53ef\u9760\u6027 \uff0c\u6216\u8005\u6362\u53e5\u8bdd\u8bf4\uff0c\u6211\u4eec\u7684\u7cfb\u7edf\u5728\u4f7f\u7528Redis\u7684\u65f6\u5019\uff0c\u8981\u80fd\u517c\u5bb9Redis\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u505a\u5230\u5373\u4f7fRedis\u53d1\u751f\u4e86\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u5f71\u54cd\u7cfb\u7edf\u7684\u6570\u636e\u51c6\u786e\u6027\u3002 \u5173\u4e8e\u7f13\u5b58\u66f4\u65b0\u7b56\u7565\uff0c\u4f7f\u7528\u7684\u591a\u7684\u4e5f\u5c31\u662f Read/Write Through\u6a21\u5f0f \u548c Cache Aside\u6a21\u5f0f \uff0c Read/Write Through\u6a21\u5f0f \u5728\u67e5\u8be2\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u7f13\u5b58\u4e2d\u67e5\u8be2\uff0c\u5982\u679c\u547d\u4e2d\u7f13\u5b58\u90a3\u5c31\u76f4\u63a5\u8fd4\u56de\u6570\u636e\uff1b\u5982\u679c\u6ca1\u6709\u547d\u4e2d\uff0c\u90a3\u5c31\u53bb\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\uff0c\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\u4e4b\u540e\u628a\u6570\u636e\u5199\u5165\u7f13\u5b58\uff0c\u7136\u540e\u8fd4\u56de\u3002\u5728\u66f4\u65b0\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u66f4\u65b0\u6570\u636e\u5e93\uff0c\u5982\u679c\u66f4\u65b0\u6210\u529f\uff0c\u518d\u53bb\u66f4\u65b0\u7f13\u5b58\u4e2d\u7684\u6570\u636e\u3002 \u603b\u7ed3 \u00b6 \u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u975e\u5e38\u6709\u6548\u5730\u63d0\u5347\u7cfb\u7edf\u5904\u7406\u9ad8\u5e76\u53d1\u7684\u80fd\u529b\uff0c\u964d\u4f4e\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u3002\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Cache Aside\u6a21\u5f0f\u6765\u66f4\u65b0\u7f13\u5b58\u90fd\u662f\u6700\u4f73\u7684\u9009\u62e9\uff0c\u76f8\u6bd4Read/Write Through\u6a21\u5f0f\u66f4\u7b80\u5355\uff0c\u8fd8\u80fd\u5927\u5e45\u964d\u4f4e\u810f\u6570\u636e\u7684\u53ef\u80fd\u6027\u3002\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u5927\u91cf\u7f13\u5b58\u7a7f\u900f\u5f15\u8d77\u96ea\u5d29\u7684\u95ee\u9898\uff0c\u4f60\u9700\u8981\u9488\u5bf9\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u6765\u9009\u62e9\u5408\u9002\u89e3\u51b3\u65b9\u6848\u3002 reids\u9047\u5230\u5927KV \u00b6 \u8df3\u8868 \u00b6 \u8df3\u8868\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u5c31\u662f\u7ed9\u94fe\u8868\u52a0\u7d22\u5f15\uff0c\u5f53\u7ed3\u70b9\u6570\u91cf\u591a\u7684\u65f6\u5019\uff0c\u8fd9\u79cd\u6dfb\u52a0\u7d22\u5f15\u7684\u65b9\u5f0f\uff0c\u4f1a\u4f7f\u67e5\u8be2\u6548\u7387\u63d0\u9ad8\u7684\u975e\u5e38\u660e\u663e\u3002 \u8df3\u8868\u8fd9\u4e2a\u52a8\u6001\u6570\u636e\u7ed3\u6784\uff0c\u4e0d\u4ec5\u652f\u6301\u67e5\u627e\u64cd\u4f5c\uff0c\u8fd8\u652f\u6301\u52a8\u6001\u7684\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\uff0c\u800c\u4e14\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \\(O(logn)\\) \u3002 \u5bf9\u4e8e\u5355\u7eaf\u7684\u5355\u94fe\u8868\uff0c\u9700\u8981\u904d\u5386\u6bcf\u4e2a\u7ed3\u70b9\u6765\u627e\u5230\u63d2\u5165\u7684\u4f4d\u7f6e\u3002\u4f46\u662f\u5bf9\u4e8e\u8df3\u8868\u6765\u8bf4\uff0c\u56e0\u4e3a\u5176\u67e5\u627e\u67d0\u4e2a\u7ed3\u70b9\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f \\(O(logn)\\) \uff0c\u6240\u4ee5\u8fd9\u91cc\u67e5\u627e\u67d0\u4e2a\u6570\u636e\u5e94\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \u25cb(\u33d2n)\u3002 Redis\u9009\u4e2d\u8df3\u8868\u800c\u4e0d\u4f7f\u7528B+\u6811 \u00b6 redis \u4f7f\u7528\u8df3\u8868\u4e0d\u7528 B + \u6570\u7684\u539f\u56e0\u662f\uff1aredis \u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u800c B + \u6811\u7eaf\u7cb9\u662f\u4e3a\u4e86 mysql \u8fd9\u79cd IO \u6570\u636e\u5e93\u51c6\u5907\u7684\u3002B + \u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u7684\u6570\u91cf\u90fd\u662f\u4e00\u4e2a mysql \u5206\u533a\u9875\u7684\u5927\u5c0f Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u662f\u901a\u8fc7\u8df3\u8868\u6765\u5b9e\u73b0\u7684\uff0c\u4e25\u683c\u70b9\u8bb2\uff0c\u8fd8\u7528\u5230\u4e86\u6563\u5217\u8868\uff08\u5173\u4e8e\u6563\u5217\u8868\uff09\uff0c\u5982\u679c\u67e5\u770b Redis \u5f00\u53d1\u624b\u518c\uff0c\u4f1a\u53d1\u73b0 Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u652f\u6301\u7684\u6838\u5fc3\u64cd\u4f5c\u4e3b\u8981\u6709\u4e0b\u9762\u8fd9\u51e0\u4e2a\uff1a \u63d2\u5165\u4e00\u4e2a\u6570\u636e \u5220\u9664\u4e00\u4e2a\u6570\u636e \u67e5\u627e\u4e00\u4e2a\u6570\u636e \u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\uff08\u6bd4\u5982\u67e5\u627e\u5728 [100,356] \u4e4b\u95f4\u7684\u6570\u636e\uff09 \u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217 \u5176\u4e2d\uff0c\u63d2\u5165\u3001\u67e5\u627e\u3001\u5220\u9664\u4ee5\u53ca\u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217\u8fd9\u51e0\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u4e5f\u80fd\u5b8c\u6210\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u8df3\u8868\u662f\u4e00\u6837\u7684\uff0c\u4f46\u662f\uff0c\u6309\u7167\u533a\u95f4\u6765\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u7684\u6548\u7387\u6ca1\u6709\u8df3\u8868\u9ad8\u3002 \u5bf9\u4e8e\u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u8df3\u8868\u53ef\u4ee5\u505a\u5230 \\(O(logn)\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u5b9a\u4f4d\u533a\u95f4\u7684\u8d77\u70b9\uff0c\u7136\u540e\u5728\u539f\u59cb\u94fe\u8868\u4e2d\u987a\u5e8f\u5f80\u540e\u904d\u5386\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6837\u505a\u975e\u5e38\u9ad8\u6548\u3002 \u5f53\u7136\uff0c\u8fd8\u6709\u5176\u4ed6\u539f\u56e0\uff0c\u6bd4\u5982\uff0c\u8df3\u8868\u4ee3\u7801\u66f4\u5bb9\u6613\u5b9e\u73b0\uff0c\u53ef\u8bfb\u6027\u597d\u4e0d\u6613\u51fa\u9519\u3002\u8df3\u8868\u66f4\u52a0\u7075\u6d3b\uff0c\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u7d22\u5f15\u6784\u5efa\u7b56\u7565\uff0c\u6709\u6548\u5e73\u8861\u6267\u884c\u6548\u7387\u548c\u5185\u5b58\u6d88\u8017\u3002 \u603b\u51718\u4e2a\u73ed\u7ea7\u3001\u8f93\u51fa\u6bcf\u4e2a\u73ed\u7ea7\u7537\u751f\u7684\u6570\u5b66\u524d\u4e09\u540d\u548c\u5973\u751f\u7684\u8bed\u6587\u524d\u4e09\u540d \u00b6 SELECT g1 . stu_id , g1 . class_id , g1 . gender , g1 . math_score FROM grade g1 WHERE g1 . gender = 'm' AND EXISTS ( SELECT count ( * ) FROM grade g2 WHERE g2 . gender = 'm' AND g2 . math_score >= g1 . math_score AND g2 . class_id = g1 . class_id GROUP BY g2 . class_id HAVING count ( * ) <= 3 ) ORDER BY class_id , math_score DESC","title":"MySQL"},{"location":"cs/db/mysql/#mysql","text":"","title":"MySQL"},{"location":"cs/db/mysql/#_1","text":"\u4e8b\u52a1\u662f\u6ee1\u8db3ACID\u7279\u6027\u7684\u4e00\u7ec4\u64cd\u4f5c\u3002 \u539f\u5b50\u6027 \uff08Atomicity\uff09\uff1a\u4e8b\u52a1\u65f6\u4e0d\u53ef\u5206\u5272\u7684\u6700\u5c0f\u5355\u5143\uff0c\u4e8b\u52a1\u5185\u7684\u8bed\u53e5\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u6210\u529f\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u5931\u8d25\u3002 \u4e00\u81f4\u6027 \uff08Consistency\uff09\uff1a\u6570\u636e\u5e93\u5728\u4e8b\u52a1\u6267\u884c\u524d\u540e\u90fd\u4fdd\u6301\u4e00\u81f4\u6027\u72b6\u6001\u3002\u5728\u4e00\u81f4\u6027\u72b6\u6001\u4e0b\uff0c\u6240\u6709\u4e8b\u52a1\u5bf9\u4e00\u4e2a\u6570\u636e\u7684\u8bfb\u5199\u7ed3\u679c\u90fd\u662f\u76f8\u540c\u7684\u3002 \u9694\u79bb\u6027 \uff08Isolation\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u6240\u505a\u7684\u4fee\u6539\u5728\u6700\u7ec8\u63d0\u4ea4\u4ee5\u524d\uff0c\u5bf9\u5176\u4ed6\u4e8b\u52a1\u662f\u4e0d\u53ef\u89c1\u7684\u3002 \u6301\u4e45\u6027 \uff08Durability\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u63d0\u4ea4\uff0c\u5219\u5176\u6240\u505a\u7684\u4fee\u6539\u5c06\u4f1a\u6c38\u8fdc\u4fdd\u5b58\u5728\u6570\u636e\u5e93\u4e2d\u3002 MYSQL\u9ed8\u8ba4\u91c7\u7528\u81ea\u52a8\u63d0\u4ea4\u6a21\u5f0f\u3002","title":"\u4e8b\u52a1"},{"location":"cs/db/mysql/#_2","text":"\u4e22\u5931\u4fee\u6539 \uff1aT1\u548cT2\u4e24\u4e2a\u4e8b\u52a1\u90fd\u5bf9\u4e00\u4e2a\u6570\u636e\u8fdb\u884c\u4fee\u6539\uff0cT1\u5148\u4fee\u6539\uff0cT2\u540e\u4fee\u6539\uff0c\u5219T2\u70b9\u4fee\u6539\u4f1a\u8986\u76d6T1. \u8bfb\u810f\u6570\u636e \uff1aT1\u4fee\u6539\u4e00\u4e2a\u6570\u636e\uff0cT2\u968f\u540e\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u3002\u5982\u679cT1\u64a4\u9500\u4e86\u8fd9\u6b21\u4fee\u6539\uff0c\u5219T2\u8bfb\u5230\u7684\u662f\u810f\u6570\u636e\u3002 \u4e0d\u53ef\u91cd\u590d\u8bfb \uff1aT2\u8bfb\u53d6\u4e00\u4e2a\u6570\u636e\uff0cT1\u5bf9\u8be5\u6570\u636e\u505a\u4e86\u4fee\u6539\uff0c\u6b64\u65f6T2\u518d\u6b21\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u4f1a\u548c\u7b2c\u4e00\u6b21\u8bfb\u53d6\u7684\u7ed3\u679c\u4e0d\u540c\u3002 \u5e7b\u5f71\u8bfb \uff1aT1\u8bfb\u53d6\u67d0\u4e2a\u8303\u56f4\u7684\u6570\u636e\uff0cT2\u5728\u8fd9\u4e2a\u8303\u56f4\u5185\u63d2\u5165\u4e86\u65b0\u7684\u6570\u636e\uff0cT1\u518d\u6b21\u8bfb\u53d6\u548c\u7b2c\u4e00\u6b21\u7684\u7ed3\u679c\u4e0d\u540c\u3002","title":"\u5e76\u53d1\u4e00\u81f4\u6027"},{"location":"cs/db/mysql/#bb","text":"B\u6811\u7684\u7279\u70b9 \u4e00\u4e2a\u8282\u70b9\u4e0a\u5305\u62ec\u81f3\u591a \\(m-1\\) \u4e2a\u503c \u6839\u8282\u70b9\u81f3\u5c11\u6709\u4e24\u4e2a\u5b69\u5b50 \u975e\u53f6\u5b50\u7ed3\u70b9\u5982\u679c\u5305\u542b\u4e86 \\(k\\) \u4e2a\u503c\uff0c\u5219\u5176\u5305\u542b\u4e86 \\(k+1\\) \u4e2a\u5b69\u5b50\u8282\u70b9 \u6240\u6709\u53f6\u5b50\u7ed3\u70b9\u90fd\u4f4d\u4e8e\u540c\u4e00\u5c42 B+\u6811\u7684\u7279\u70b9 \u6240\u6709\u7684\u975e\u53f6\u5b50\u7ed3\u70b9\u4e0d\u518d\u4fdd\u5b58\u503c\uff0c\u800c\u662f\u53ea\u4fdd\u5b58\u4e86\u4e2d\u95f4\u503c \u6240\u6709\u503c\u4fdd\u5b58\u5728\u53f6\u5b50\u7ed3\u70b9\u4e0a \u6240\u6709\u7684\u53f6\u5b50\u7ed3\u70b9\u901a\u5e38\u94fe\u8868\u6309\u7167\u987a\u5e8f\u8fdb\u884c\u8fde\u63a5 \u4e3a\u4ec0\u4e48\u6570\u636e\u5e93\u4f1a\u91c7\u7528B+\u6811\u800c\u4e0d\u662fB\u6811\u6d3b\u7740AVL\u6811 AVL\u7684\u7ed3\u70b9\u8bbf\u95ee\u6b21\u6570\u66f4\u591a\uff0c\u800c\u5bf9\u4e8e\u6570\u636e\u5e93\u800c\u8a00\uff0c\u6bcf\u4e2a\u8282\u70b9\u901a\u5e38\u88ab\u5b58\u50a8\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u9700\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u6570\u91cf\u66f4\u591a\uff0c\u5bfc\u81f4\u6548\u7387\u4f4e \u5728\u6570\u636e\u5e93\u4e2d\u6709\u65f6\u9700\u8981\u8fdb\u884c\u8303\u56f4\u7684\u6240\u6709\uff0c\u6b64\u65f6B+\u6811\u7684\u94fe\u8868\u7ed3\u6784\u53ef\u4ee5\u5feb\u901f\u7684\u627e\u5230\u67d0\u4e2a\u7ed3\u70b9\u7684\u4e0b\u4e00\u4e2a\u7ed3\u70b9\u4f4d\u7f6e","title":"B\u6811\u548cB+\u6811"},{"location":"cs/db/mysql/#mysql_1","text":"\u7c7b\u578b \u5168\u5c40\u9501 \u8868\u7ea7\u9501 \u884c\u7ea7\u9501 \u8bfb\u5199\u9501 \u8bfb\u9501\uff1a\u53ef\u4ee5\u4e0e\u5176\u4ed6\u7684\u8bfb\u9501\u5171\u5b58\uff0c\u4f46\u662f\u4e0d\u53ef\u4ee5\u4e0e\u5199\u9501\u5171\u5b58 \u5199\u9501\uff1a\u4e0d\u53ef\u4ee5\u4e0e\u5176\u4ed6\u4efb\u4f55\u9501\u5171\u5b58 \u60b2\u89c2\u9501 \u666e\u901a\u7684\u9501\uff0c\u9501\u5b9a\u6b64\u884c/\u8868/\u6570\u636e\u5e93\u4ee5\u9632\u6b62\u5176\u4ed6\u64cd\u4f5c\u8fdb\u884c\u4fee\u6539\uff0c\u4f1a\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u88ab\u963b\u585e \u4e50\u89c2\u9501 \u901a\u8fc7\u6bd4\u8f83\u7248\u672c\u53f7\u7684\u533a\u522b\u7684\u65b9\u6cd5\uff0c\u6765\u786e\u5b9a\u6b64\u6570\u636e\u662f\u5426\u7ecf\u8fc7\u4fee\u6539\uff0c\u5982\u679c\u4fee\u6539\u5219\u9700\u8981\u8bfb\u53d6\u6700\u65b0\u7684\u503c","title":"MySQL\u9501"},{"location":"cs/db/mysql/#_3","text":"\u9694\u79bb\u7ea7\u522b \u810f\u8bfb \u4e0d\u53ef\u91cd\u590d\u8bfb \u5e7b\u8bfb \u672a\u63d0\u4ea4\u8bfb \u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u5df2\u63d0\u4ea4\u8bfb \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u53ef\u91cd\u590d\u8bfb \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u4e32\u884c\u5316 \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u9694\u79bb\u7ea7\u522b\uff1a \u672a\u63d0\u4ea4\u8bfb\uff1a\u6700\u6734\u7d20\u7684\u6570\u636e\u5f62\u5f0f \u5df2\u63d0\u4ea4\u8bfb\uff1a\u5728\u4e8b\u52a1\u5b8c\u6210\u4e4b\u540e\u518d\u66f4\u65b0\u6570\u636e\u5e93\u7684\u503c \u53ef\u91cd\u590d\u8bfb\uff1a\u6bcf\u4e2a\u4e8b\u52a1\u5f00\u59cb\u524d\u9501\u5b9a\u6240\u66f4\u65b0\u7684\u884c \u53ef\u4e32\u884c\u5316\uff1a\u5355\u4e00\u7ebf\u7a0b\uff0c\u6240\u6709\u4e8b\u52a1\u5fc5\u987b\u6309\u7167\u987a\u5e8f\u8fdb\u884c3","title":"\u6570\u636e\u5e93\u9694\u79bb\u7ea7\u522b"},{"location":"cs/db/mysql/#innodbmyisam","text":"","title":"\u5b58\u50a8\u5f15\u64ce InnoDB\u548cMyISAM"},{"location":"cs/db/mysql/#innodb","text":"\u662fMySQL\u9ed8\u8ba4\u7684\u5b58\u50a8\u5f15\u64ce\u3002\u5b9e\u73b0\u4e86\u56db\u4e2a\u6807\u51c6\u7684\u9694\u79bb\u7ea7\u522b\u3002\u9ed8\u8ba4\u662f\u53ef\u91cd\u590d\u8bfb\uff0c\u901a\u8fc7MVCC\u548cNext-Key Locking\u9632\u6b62\u5e7b\u5f71\u8bfb\u3002\u652f\u6301\u771f\u6b63\u7684\u5728\u7ebf\u70ed\u5907\u4efd\uff0c\u5176\u4ed6\u5b58\u50a8\u5f15\u64ce\u4e0d\u652f\u6301\u5728\u7ebf\u70ed\u5907\u4efd\u3002 Record Locks \uff1a\u9501\u5b9a\u4e00\u4e2a\u8bb0\u5f55\u4e0a\u7684\u7d22\u5f15\uff0c\u800c\u4e0d\u662f\u8bb0\u5f55\u672c\u8eab\u3002 Gap Locks \uff1a\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\uff0c\u800c\u4e0d\u662f\u7d22\u5f15\u672c\u8eab\u3002 Next-Key Locks \uff1aInnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u4e00\u79cd\u9501\u5b9e\u73b0\uff0c\u662fRecord Locks\u548cGap Locks\u7684\u7ed3\u5408\u3002\u4e0d\u4ec5\u4ec5\u9501\u5b9a\u7d22\u5f15\uff0c\u4e5f\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\u3002","title":"InnoDB"},{"location":"cs/db/mysql/#myisam","text":"\u8bbe\u8ba1\u7b80\u5355\uff0c\u6570\u636e\u4ee5\u7d27\u5bc6\u683c\u5f0f\u5b58\u50a8\u3002\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7279\u6027\uff0c\u5305\u62ec\u538b\u7f29\u8868\u3001\u7a7a\u95f4\u6570\u636e\u7d22\u5f15\u7b49\u3002\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c\u4e0d\u652f\u6301\u884c\u7ea7\u9501\uff0c\u53ea\u652f\u6301\u8868\u7ea7\u9501\uff0c\u53ef\u4ee5\u624b\u5de5\u6216\u8005\u81ea\u52a8\u6267\u884c\u68c0\u67e5\u548c\u4fee\u590d\u64cd\u4f5c\uff0c\u4f46\u53ef\u80fd\u5bfc\u81f4\u4e00\u4e9b\u6570\u636e\u4e22\u5931\uff0c\u800c\u4e14\u4fee\u590d\u64cd\u4f5c\u975e\u5e38\u6162\u3002","title":"MyISAM"},{"location":"cs/db/mysql/#mvcc","text":"\u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08Multi-Version Concurrency Control, MVCC\uff09\u662f MySQL \u7684 InnoDB \u5b58\u50a8\u5f15\u64ce\u5b9e\u73b0\u9694\u79bb\u7ea7\u522b\u7684\u4e00\u79cd\u5177\u4f53\u65b9\u5f0f\uff0c\u7528\u4e8e\u5b9e\u73b0\u63d0\u4ea4\u8bfb\u548c\u53ef\u91cd\u590d\u8bfb\u8fd9\u4e24\u79cd\u9694\u79bb\u7ea7\u522b\u3002\u800c\u672a\u63d0\u4ea4\u8bfb\u9694\u79bb\u7ea7\u522b\u603b\u662f\u8bfb\u53d6\u6700\u65b0\u7684\u6570\u636e\u884c\uff0c\u8981\u6c42\u5f88\u4f4e\uff0c\u65e0\u9700\u4f7f\u7528 MVCC\u3002\u53ef\u4e32\u884c\u5316\u9694\u79bb\u7ea7\u522b\u9700\u8981\u5bf9\u6240\u6709\u8bfb\u53d6\u7684\u884c\u90fd\u52a0\u9501\uff0c\u5355\u7eaf\u4f7f\u7528 MVCC \u65e0\u6cd5\u5b9e\u73b0\u3002 InnoDB\u7684MVCC\uff0c\u662f\u901a\u8fc7\u5728\u6bcf\u884c\u8bb0\u5f55\u540e\u9762\u4fdd\u5b58\u4e24\u4e2a\u9690\u85cf\u7684\u5217\u6765\u5b9e\u73b0\u7684\u3002\u8fd9\u4e24\u4e2a\u5217\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u8fc7\u671f\u65f6\u95f4\u3002\u5b58\u50a8\u7684\u4e0d\u662f\u5b9e\u9645\u7684\u65f6\u95f4\u503c\uff0c\u800c\u662f\u7cfb\u7edf\u7684\u7248\u672c\u53f7\u3002MVCC\u53ea\u8981\u53ef\u91cd\u590d\u8bfb\u548c\u63d0\u4ea4\u8bfb\u4e24\u4e2a\u9694\u79bb\u7ea7\u522b\u4e0b\u5de5\u4f5c\u3002 \u5728\u53ef\u91cd\u590d\u8bfb\u7684\u9694\u79bb\u7ea7\u522b\u4e0b\uff0cMVCC\u7684\u64cd\u4f5c\uff1a - SELECT 1. InnoDB\u53ea\u67e5\u627e\u7248\u672c\u65e9\u4e8e\u5f53\u524d\u4e8b\u52a1\u7248\u672c\u7684\u6570\u636e\u884c\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e8b\u52a1\u8bfb\u53d6\u7684\u884c\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u5f00\u542f\u524d\u5df2\u7ecf\u5b58\u5728\u7684\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u81ea\u8eab\u63d2\u5165\u6216\u8005\u4fee\u6539\u8fc7\u7684\u3002 2. \u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u8981\u4e48\u672a\u5b9a\u4e49\uff0c\u8981\u4e48\u5927\u4e8e\u5f53\u524d\u4e8b\u52a1\u7684\u7248\u672c\u53f7\uff0c\u8fd9\u53ef\u4ee5\u4fdd\u8bc1\u4e8b\u52a1\u8bfb\u53d6\u5230\u7684\u884c\uff0c\u5728\u4e8b\u52a1\u5f00\u59cb\u524d\u672a\u88ab\u5220\u9664\u3002 - INSERT 1. \u4e3a\u63d2\u5165\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u884c\u7248\u672c\u53f7\u3002 - DELETE 1. \u4e3a\u5220\u9664\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u5220\u9664\u7248\u672c\u53f7\u3002 - UPDATE 1. \u4fee\u6539\u540e\u7684\u6570\u636e\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u521b\u5efa\u7248\u672c\u53f7\uff0c\u540c\u65f6\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u539f\u6765\u7684\u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u3002","title":"\u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08MVCC\uff09"},{"location":"cs/db/mysql/#_4","text":"\u7b2c\u4e00\u8303\u5f0f\uff1a\u5c5e\u6027\u4e0d\u53ef\u5206 \u7b2c\u4e8c\u8303\u5f0f\uff1a\u6bcf\u4e2a\u975e\u4e3b\u5c5e\u6027\u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u7b2c\u4e09\u8303\u5f0f\uff1a\u975e\u4e3b\u5c5e\u6027\u4e0d\u4f20\u9012\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u8303\u5f0f\u5316\u7684\u597d\u5904\uff1a \u8303\u5f0f\u5316\u7684\u66f4\u65b0\u64cd\u4f5c\u901a\u5e38\u6bd4\u53cd\u8303\u5f0f\u5316\u8981\u5feb \u5f53\u6570\u636e\u8f83\u597d\u5730\u8303\u5f0f\u5316\u65f6\uff0c\u5c31\u53ea\u6709\u5f88\u5c11\u6216\u8005\u6ca1\u6709\u91cd\u590d\u6570\u636e\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u4fee\u6539\u66f4\u5c11\u7684\u6570\u636e\u3002 \u8303\u5f0f\u5316\u7684\u8868\u901a\u5e38\u66f4\u5c0f\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u653e\u5728\u5185\u5b58\u91cc\uff0c\u6240\u4ee5\u6267\u884c\u64cd\u4f5c\u4f1a\u66f4\u5feb\u3002 \u8303\u5f0f\u5316\u7684\u7f3a\u70b9\uff1a\u901a\u5e38\u9700\u8981\u5173\u8054\uff0c\u4ee3\u4ef7\u6602\u8d35\uff0c\u4e5f\u53ef\u80fd\u4f7f\u4e00\u4e9b\u7d22\u5f15\u7b56\u7565\u65e0\u6548\u3002","title":"\u8303\u5f0f"},{"location":"cs/db/mysql/#_5","text":"\u67e5\u8be2\u6027\u80fd\u4f4e\u4e0b\u7684\u6700\u57fa\u672c\u7684\u539f\u56e0\u662f\u8bbf\u95ee\u7684\u6570\u636e\u592a\u591a\u3002 \u662f\u5426\u5411\u6570\u636e\u5e93\u8bf7\u6c42\u4e86\u4e0d\u9700\u8981\u7684\u6570\u636e \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u5217\uff0c\u6700\u597d\u4e0d\u8981\u7528 select * \u8fdb\u884c\u67e5\u8be2 \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u884c\uff0c\u4f7f\u7528limit\u6765\u9650\u5236\u8fd4\u56de\u7684\u6570\u636e \u7f13\u5b58\u91cd\u590d\u67e5\u8be2\u7684\u6570\u636e \u662f\u5426\u5728\u626b\u63cf\u989d\u5916\u7684\u8bb0\u5f55 \u4f7f\u7528\u7d22\u5f15\u8986\u76d6\u626b\u63cf\uff0c\u628a\u6240\u6709\u9700\u8981\u7528\u5230\u7684\u5217\u90fd\u653e\u5728\u7d22\u5f15\u4e2d\uff0c \u8fd9\u6837\u5b58\u50a8\u5f15\u64ce\u65e0\u9700\u56de\u8868\u83b7\u53d6\u5bf9\u5e94\u884c\u5c31\u53ef\u4ee5\u8fd4\u56de\u7ed3\u679c \u6539\u53d8\u5e93\u8868\u7ed3\u6784 \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u5207\u5206\u5927\u67e5\u8be2 \u5206\u89e3\u5927\u8fde\u63a5\u67e5\u8be2","title":"\u67e5\u8be2\u4f18\u5316"},{"location":"cs/db/mysql/#_6","text":"","title":"\u4e3b\u4ece\u590d\u5236"},{"location":"cs/db/mysql/#_7","text":"MySQL\u4e3b\u4ece\u590d\u5236\u662f\u6307\u6570\u636e\u53ef\u4ee5\u4ece\u4e00\u4e2aMySQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e3b\u8282\u70b9\u590d\u5236\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u4ece\u8282\u70b9\u3002MySQL\u9ed8\u8ba4\u91c7\u7528\u5f02\u6b65\u590d\u5236\u65b9\u5f0f\uff0c\u8fd9\u6837\u4ece\u8282\u70b9\u4e0d\u7528\u4e00\u76f4\u8bbf\u95ee\u4e3b\u670d\u52a1\u5668\u6765\u66f4\u65b0\u81ea\u5df1\u7684\u6570\u636e\uff0c\u6570\u636e\u7684\u66f4\u65b0\u53ef\u4ee5\u5728\u8fdc\u7a0b\u8fde\u63a5\u4e0a\u8fdb\u884c\uff0c\u4ece\u8282\u70b9\u53ef\u4ee5\u590d\u5236\u4e3b\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u6570\u636e\u5e93\u6216\u8005\u7279\u5b9a\u7684\u6570\u636e\u5e93\uff0c\u6216\u8005\u7279\u5b9a\u7684\u8868\u3002","title":"\u6982\u5ff5"},{"location":"cs/db/mysql/#_8","text":"\u6570\u636e\u5206\u5e03 \u8d1f\u8f7d\u5747\u8861 \u6570\u636e\u5907\u4efd\uff0c\u4fdd\u8bc1\u6570\u636e\u5b89\u5168 \u9ad8\u53ef\u7528\u6027\u548c\u5bb9\u9519\u884c \u5b9e\u73b0\u8bfb\u5199\u5206\u79bb\uff0c\u7f13\u89e3\u6570\u636e\u5e93\u538b\u529b \u7531\u4e8emysql\u5b9e\u73b0\u7684\u5f02\u6b65\u590d\u5236\uff0c\u6240\u4ee5\u4e3b\u5e93\u548c\u4ece\u5e93\u4e4b\u95f4\u5b58\u5728\u4e00\u5b9a\u7684\u5dee\u5f02\uff0c\u5728\u4ece\u5e93\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u9700\u8981\u8003\u8651\u8fd9\u4e9b\u6570\u636e\u7684\u5dee\u5f02\uff0c\u4e00\u822c\u53ea\u6709\u66f4\u65b0\u4e0d\u9891\u7e41\u548c\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4ece\u5e93\u67e5\u8be2\uff0c\u5b9e\u884c\u8981\u6c42\u9ad8\u7684\u4ecd\u7136\u8981\u4ece\u4e3b\u5e93\u67e5\u8be2\u3002","title":"\u4f5c\u7528"},{"location":"cs/db/mysql/#_9","text":"MySQL\u4e3b\u4ece\u590d\u5236\u6d89\u53ca\u5230\u4e09\u4e2a\u7ebf\u7a0b\uff0c\u4e00\u4e2a\u8fd0\u884c\u5728 \u4e3b\u8282\u70b9\uff08log dump thread\uff09 \uff0c\u5176\u4f59\u4e24\u4e2a\uff08 I/O thread\uff0c SQL thread \uff09\u8fd0\u884c\u5728\u4ece\u8282\u70b9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a binlog \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u5c06\u4e3b\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u66f4\u6539\u5199\u5165\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff08Binary log\uff09\u4e2d\u3002 I/O \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u4ece\u4e3b\u670d\u52a1\u5668\u4e0a\u8bfb\u53d6\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u5e76\u5199\u5165\u4ece\u670d\u52a1\u5668\u7684\u4e2d\u7ee7\u65e5\u5fd7\uff08Relay log\uff09\u3002 SQL \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u8bfb\u53d6\u4e2d\u7ee7\u65e5\u5fd7\uff0c\u89e3\u6790\u51fa\u4e3b\u670d\u52a1\u5668\u5df2\u7ecf\u6267\u884c\u7684\u6570\u636e\u66f4\u6539\u5e76\u5728\u4ece\u670d\u52a1\u5668\u4e2d\u91cd\u653e\uff08Replay\uff09\u3002","title":"\u539f\u7406"},{"location":"cs/db/mysql/#_10","text":"\u4e3a\u4ec0\u4e48\u4f7f\u7528\u8fde\u63a5\u6c60 \u4e0eJava\u7684\u7ebf\u7a0b\u6c60\u76f8\u540c\uff0c\u4e3a\u4e86\u8282\u7ea6\u7cfb\u7edf\u8d44\u6e90 \u5e38\u7528\u7684\u8fde\u63a5\u6c60 DBCP\uff1a\u4f7f\u7528\u91cf\u6700\u5927\u7684\u8fde\u63a5\u6c60 C3P0","title":"\u8fde\u63a5\u6c60"},{"location":"cs/db/mysql/#_11","text":"\u6c34\u5e73\u5206\u8868 \u5c06\u4e00\u4e2a\u8868\u7684\u8bb0\u5f55\u5206\u5272\u5230\u6570\u4e2a\u8868\u4e2d\uff0c\u53ef\u4ee5\u51cf\u5c11\u7d22\u5f15\u7684\u5927\u5c0f\uff0c\u52a0\u5feb\u7d22\u5f15 \u5782\u76f4\u5206\u8868 \u5c06\u90e8\u5206\u5b57\u6bb5\u5212\u5206\u81f3\u5176\u4ed6\u7684\u8868\uff0c\u90e8\u5206\u5b57\u6bb5\u6570\u636e\u91cf\u5927\uff0c\u8fdb\u884c\u7d22\u5f15\u65f6\u4f1a\u5e26\u6765\u5927\u91cf\u7684IO\u8d1f\u62c5\uff0c\u8fdb\u884c\u5206\u8868\u6709\u5229\u4e8e\u67e5\u8be2\u6548\u7387","title":"\u5206\u8868"},{"location":"cs/db/mysql/#sql","text":"\u4e00\u6761SQL\u8bed\u53e5\u7684\u6267\u884c\u8fc7\u7a0b\uff1a 1. \u8fde\u63a5\u5668\u67e5\u770b\u5f53\u524d\u7528\u6237\u6743\u9650\uff0c\u82e5\u62e5\u6709\u6743\u9650\uff0c\u5efa\u7acb\u8fde\u63a5\u3002\u5982\u679c\u5ba2\u6237\u7aef\u592a\u957f\u65f6\u95f4\u6ca1\u6709\u52a8\u9759\uff0c\u8fde\u63a5\u5668\u4f1a\u81ea\u52a8\u65ad\u5f00\u8fde\u63a5 2. \u5206\u6790\u5668\u5206\u6790SQL\u8bed\u53e5\uff0c\u5305\u62ec\u8bed\u6cd5\u5206\u6790\uff08\u8bed\u6cd5\u662f\u5426\u6b63\u786e\uff09\uff0c\u8bcd\u6cd5\u5206\u6790\uff08\u8bc6\u522bSQL\u8bed\u53e5\uff09\u3002 3. \u4f18\u5316\u5668\u4f18\u5316\u67e5\u8be2\uff0c\u51b3\u5b9a\u4f7f\u7528\u7684\u7d22\u5f15\u7b49\u3002 4. \u6267\u884c\u5668\u6765\u65f6\u6267\u884c\u8bed\u53e5\u3002","title":"SQL"},{"location":"cs/db/mysql/#_12","text":"","title":"\u8bf4\u4e00\u4e0b\u7d22\u5f15\uff1f"},{"location":"cs/db/mysql/#_13","text":"\u7d22\u5f15\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6587\u4ef6\uff08InnoDB\u6570\u636e\u8868\u4e0a\u7684\u7d22\u5f15\u662f\u8868\u7a7a\u95f4\u7684\u4e00\u4e2a\u7ec4\u6210\u90e8\u5206\uff09\uff0c\u4ed6\u4eec\u5305\u542b\u7740\u5bf9\u6570\u636e\u8868\u91cc\u6240\u6709\u8bb0\u5f55\u7684\u5f15\u7528\u6307\u9488\u3002 \u7d22\u5f15\u662f\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u3002\u6570\u636e\u5e93\u7d22\u5f15\uff0c\u662f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u6392\u5e8f\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4e3a\u4e86\u534f\u52a9\u5feb\u901f\u67e5\u8be2\u3001\u66f4\u65b0\u6570\u636e\u8868\u4e2d\u6570\u636e\u3002\u7d22\u5f15\u7684\u5b9e\u73b0\u901a\u5e38\u4f7f\u7528B\u6811\u4ee5\u53ca\u53d8\u79cdB+\u6811\u3002","title":"\u4ec0\u4e48\u662f\u7d22\u5f15"},{"location":"cs/db/mysql/#_14","text":"\u65f6\u95f4\u65b9\u9762\uff1a\u521b\u5efa\u7d22\u5f15\u548c\u7ef4\u62a4\u7d22\u5f15\u8981\u8017\u8d39\u65f6\u95f4\uff0c\u5177\u4f53\u7684\uff0c\u5f53\u5bf9\u8868\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u589e\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u7684\u65f6\u5019\uff0c\u7d22\u5f15\u4e5f\u8981\u52a8\u6001\u7684\u7ef4\u62a4\uff0c\u4f1a\u8f83\u4f4e\u589e\u6539\u5220\u7684\u6267\u884c\u6548\u7387\u3002 \u7a7a\u95f4\u65b9\u9762\uff1a\u7d22\u5f15\u9700\u8981\u5360\u7528\u7269\u7406\u7a7a\u95f4\u3002","title":"\u7d22\u5f15\u7684\u7f3a\u70b9"},{"location":"cs/db/mysql/#_15","text":"\u7269\u7406\u5b58\u50a8\u89d2\u5ea6\uff1a \u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4f5c\u4e3aB+\u6811\u7d22\u5f15\u7684\u952e\u503c\u800c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u975e\u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4e4b\u5916\u7684\u5217\u503c\u4f5c\u4e3a\u952e\u503c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u6570\u636e\u7ed3\u6784\u89d2\u5ea6\uff1a B+\u6811\u7d22\u5f15 hash\u7d22\u5f15 FULLTEXT\u7d22\u5f15 R-Tree\u7d22\u5f15 \u903b\u8f91\u89d2\u5ea6\uff1a \u4e3b\u952e\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u4e0d\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u53ea\u80fd\u6709\u4e00\u4e2a\u4e3b\u952e \u666e\u901a/\u5355\u5217\u7d22\u5f15\uff1a\u57fa\u672c\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u6ca1\u6709\u552f\u4e00\u6027\u7684\u6027\u8d28\uff0c\u5141\u8bb8\u4e3a NULL \u591a\u5217/\u8054\u5408/\u590d\u5408\u7d22\u5f15\uff1a\u4ee5\u4e00\u5b9a\u987a\u5e8f\u5f15\u7528\u591a\u5217 \u552f\u4e00\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u5141\u8bb8\u591a\u4e2a\u5217\u521b\u5efa\u552f\u4e00\u7d22\u5f15 \u5168\u6587\u7d22\u5f15\uff1a\u76ee\u524d\u641c\u7d22\u5f15\u64ce\u4f7f\u7528\u7684\u4e00\u79cd\u5173\u952e\u6280\u672f \u7a7a\u95f4\u7d22\u5f15\uff1a\u5bf9\u7a7a\u95f4\u6570\u636e\u7c7b\u578b\u7684\u5b57\u6bb5\u5efa\u7acb\u7684\u7d22\u5f15","title":"\u7d22\u5f15\u7684\u4e3b\u8981\u7c7b\u578b"},{"location":"cs/db/mysql/#_16","text":"\u4e3b\u8981\u9488\u5bf9\u8054\u5408\u7d22\u5f15\uff0c\u5982\u679c\u67e5\u8be2\u7684\u65f6\u5019\u67e5\u8be2\u6761\u4ef6\u7cbe\u786e\u5339\u914d\u7d22\u5f15\u7684\u5de6\u8fb9\u8fde\u7eed\u4e00\u5217\u6216\u591a\u5217\uff0c\u5219\u6b64\u5217\u5c31\u53ef\u4ee5\u88ab\u7528\u5230\u3002","title":"\u6700\u5de6\u524d\u7f00\u5339\u914d\u539f\u5219"},{"location":"cs/db/mysql/#redis","text":"\u7f13\u5b58\u3001\u8ba1\u6570\u5668\u3001\u961f\u5217\u3001\u4f4d\u64cd\u4f5c\u3001\u6700\u65b0\u5217\u8868\u3002","title":"redis\u5e94\u7528\u573a\u666f\uff1f"},{"location":"cs/db/mysql/#_17","text":"\u975e\u805a\u7c07\u7d22\u5f15\u548c\u805a\u7c07\u7d22\u5f15\u7684\u533a\u522b\u5728\u4e8e\u975e\u805a\u7c07\u7d22\u5f15\u7684\u53f6\u5b50\u8282\u70b9\u4e0d\u5b58\u50a8\u8868\u4e2d\u7684\u6570\u636e\uff0c\u800c\u662f\u5b58\u50a8\u8be5\u5217\u5bf9\u5e94\u7684\u4e3b\u952e\uff0c\u60f3\u8981\u67e5\u627e\u6570\u636e\u6211\u4eec\u8fd8\u9700\u8981\u6839\u636e\u4e3b\u952e\u518d\u53bb\u805a\u7c07\u7d22\u5f15\u4e2d\u8fdb\u884c\u67e5\u627e\uff0c\u8fd9\u4e2a\u518d\u6839\u636e\u805a\u7c07\u7d22\u5f15\u67e5\u627e\u6570\u636e\u7684\u8fc7\u7a0b\uff0c\u88ab\u79f0\u4e3a\u56de\u8868\u3002","title":"\u8bf4\u4e00\u4e0b\u56de\u8868\u64cd\u4f5c\uff1f"},{"location":"cs/db/mysql/#_18","text":"\u5982\u4f55\u907f\u514d\uff1a\u5c06\u88ab\u67e5\u8be2\u7684\u5b57\u6bb5\uff0c\u5efa\u7acb\u5230\u8054\u5408\u7d22\u5f15\u4e2d\u3002\u5c3d\u91cf\u4f7f\u7528\u5230\u7d22\u5f15\u8986\u76d6\uff0c\u4e0d\u5e94\u8be5\u4f7f\u7528 * \u6765\u5168\u8868\u67e5\u8be2\u3002 \u7d22\u5f15\u8986\u76d6\u662f\u6307\u4ece\u7d22\u5f15\u4e2d\u5c31\u53ef\u4ee5\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\uff0c\u4ece\u800c\u4e0d\u9700\u8981\u67e5\u8be2\u805a\u7c07\u7d22\u5f15\u4e2d\u7684\u884c\u6570\u636e\u4fe1\u606f\u3002 \u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u8986\u76d6\u7d22\u5f15\u5fc5\u987b\u8981\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u800c\u54c8\u5e0c\u7d22\u5f15\u3001\u7a7a\u95f4\u7d22\u5f15\u548c\u5168\u6587\u7d22\u5f15\u4e0d\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u6240\u4ee5mysql\u53ea\u80fd\u7528B+tree\u7d22\u5f15\u505a\u8986\u76d6\u7d22\u5f15\u3002","title":"\u5982\u4f55\u907f\u514d\u56de\u8868\u67e5\u8be2?\u4ec0\u4e48\u662f\u7d22\u5f15\u8986\u76d6?"},{"location":"cs/db/mysql/#_19","text":"\u5728MySQL\u4e2d\uff0c\u5e38\u89c1\u7684\u8868\u8fde\u63a5\u65b9\u5f0f\u67094\u7c7b\uff0c\u51717\u79cd\u65b9\u5f0f\uff1a - INNER JOIN \uff1ainner join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\uff1b - LEFT JOIN \uff1aleft join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u5de6\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528where\u8fc7\u6ee4\u6761\u4ef6 - RIGHT JOIN \uff1aright join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u53f3\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528where\u8fc7\u6ee4\u6761\u4ef6 - FULL JOIN \uff1afull join\u662f\u5de6\u8fde\u63a5\u548c\u53f3\u8fde\u63a5\u7684\u5e76\u96c6\uff0cMySQL\u5e76\u672a\u63d0\u4f9bfull join\u7684\u8bed\u6cd5\uff0c\u5982\u679c\u8981\u5b9e\u73b0\uff0c\u9700\u8981left join\u4e8eright join\u8fdb\u884c\u6c42\u5e76\u96c6\uff0c\u8fd8\u6709\u7528where\u8fc7\u6ee4","title":"\u8bf4\u4e00\u4e0b\u8868\u8fde\u63a5\u7684\u64cd\u4f5c\uff1f"},{"location":"cs/db/mysql/#_20","text":"\u6761\u4ef6\u4e2d\u6709 or like \u67e5\u8be2\uff08\u4ee5 % \u5f00\u5934\uff09 \u5982\u679c\u5217\u7c7b\u578b\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e00\u5b9a\u8981\u5728\u6761\u4ef6\u4e2d\u5c06\u6570\u636e\u4f7f\u7528\u5f15\u53f7\u5f15\u7528\u8d77\u6765\uff0c\u5426\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15 \u5bf9\u5217\u8fdb\u884c\u51fd\u6570\u8fd0\u7b97 \u8d1f\u5411\u67e5\u8be2\u6761\u4ef6\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\uff0c\u6bd4\u5982 NOT IN \uff0c NOT LIKE \uff0c != \u7b49 \u5bf9\u4e8e\u8054\u5408\u7d22\u5f15\uff0c\u4e0d\u662f\u4f7f\u7528\u7b2c\u4e00\u90e8\u5206\uff08\u7b2c\u4e00\u4e2a\uff09\uff0c\u5219\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\uff08\u6700\u5de6\u5339\u914d\uff09 \u5982\u679cmysql\u8bc4\u4f30\u4f7f\u7528\u5168\u8868\u626b\u63cf\u8981\u6bd4\u4f7f\u7528\u7d22\u5f15\u5757\uff0c\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15","title":"\u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u4f1a\u5931\u6548\uff1f"},{"location":"cs/db/mysql/#sql_1","text":"\u4f7f\u7528\u89e3\u91ca\u51fd\u6570 explain \uff0c\u53ea\u9700\u6dfb\u52a0\u5728sql\u8bed\u53e5\u4e4b\u524d\u5373\u53ef\uff1a \u6211\u4eec\u53ea\u9700\u8981\u6ce8\u610f\u4e00\u4e2a\u6700\u91cd\u8981\u7684type \u7684\u4fe1\u606f\u5f88\u660e\u663e\u7684\u63d0\u73b0\u662f\u5426\u7528\u5230\u7d22\u5f15\uff1a type\u7ed3\u679c\u503c\u4ece\u597d\u5230\u574f\u4f9d\u6b21\u662f\uff1a system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL \u4e00\u822c\u6765\u8bf4\uff0c\u5f97\u4fdd\u8bc1\u67e5\u8be2\u81f3\u5c11\u8fbe\u5230range\u7ea7\u522b\uff0c\u6700\u597d\u80fd\u8fbe\u5230ref\uff0c\u5426\u5219\u5c31\u53ef\u80fd\u4f1a\u51fa\u73b0\u6027\u80fd\u95ee\u9898\u3002 possible_keys \uff1asql\u6240\u7528\u5230\u7684\u7d22\u5f15 key \uff1a\u663e\u793aMySQL\u5b9e\u9645\u51b3\u5b9a\u4f7f\u7528\u7684\u952e\uff08\u7d22\u5f15\uff09\u3002\u5982\u679c\u6ca1\u6709\u9009\u62e9\u7d22\u5f15\uff0c\u952e\u662fNULL rows : \u663e\u793aMySQL\u8ba4\u4e3a\u5b83\u6267\u884c\u67e5\u8be2\u65f6\u5fc5\u987b\u68c0\u67e5\u7684\u884c\u6570\u3002","title":"\u5224\u65adsql\u662f\u5426\u4f7f\u7528\u7d22\u5f15"},{"location":"cs/db/mysql/#_21","text":"","title":"\u8bf4\u4e00\u4e0b\u9501\uff1f\u8bf4\u4e00\u4e0b\u533a\u522b\uff1f"},{"location":"cs/db/mysql/#redis_1","text":"","title":"Redis\u7f13\u5b58\u66f4\u65b0\u7b56\u7565"},{"location":"cs/db/mysql/#_22","text":"\u9ad8\u5e76\u53d1\uff08High Concurrency\uff09\u662f\u6307\u7cfb\u7edf\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u4e00\u79cd\u201c\u77ed\u65f6\u95f4\u5185\u9047\u5230\u5927\u91cf\u64cd\u4f5c\u8bf7\u6c42\u201d\u7684\u60c5\u51b5\uff0c\u4e3b\u8981\u53d1\u751f\u5728web\u7cfb\u7edf\u96c6\u4e2d\u5927\u91cf\u8bbf\u95ee\u6536\u5230\u5927\u91cf\u8bf7\u6c42\uff0c\u4f8b\u5982\u6dd8\u5b9d\u53cc\u5341\u4e00\u3001\u4eac\u4e1c618\u7c7b\u7684\u6d3b\u52a8\u3002\u8be5\u60c5\u51b5\u7684\u53d1\u751f\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u6267\u884c\u5927\u91cf\u64cd\u4f5c\uff08\u5bf9\u8d44\u6e90\u7684\u8bf7\u6c42\u3001\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u7b49\uff09\u3002 \u9ad8\u5e76\u53d1\u76f8\u5173\u5e38\u7528\u7684\u4e00\u4e9b\u6307\u6807\u6709\uff1a\u54cd\u5e94\u65f6\u95f4\u3001\u541e\u5410\u91cf\u3001\u6bcf\u79d2\u67e5\u8be2\u7387QPS\u3001\u5e76\u53d1\u7528\u6237\u6570\u3002 \u54cd\u5e94\u65f6\u95f4 \uff1a\u7cfb\u7edf\u5bf9\u8bf7\u6c42\u505a\u51fa\u54cd\u5e94\u7684\u65f6\u95f4\u3002\u4f8b\u5982\u7cfb\u7edf\u5904\u7406\u4e00\u4e2ahttp\u8bf7\u6c42\u9700\u8981600ms\uff0c\u8fd9\u4e2a600ms\u5c31\u662f\u7cfb\u7edf\u7684\u54cd\u5e94\u65f6\u95f4\u3002 \u541e\u5410\u91cf \uff1a\u5355\u4f4d\u65f6\u95f4\u5185\u5904\u7406\u7684\u8bf7\u6c42\u6570\u91cf\u3002 QPS \uff1a\u6bcf\u79d2\u54cd\u5e94\u8bf7\u6c42\u6570\u3002 \u5e76\u53d1\u7528\u6237\u6570 \uff1a\u540c\u65f6\u627f\u8f7d\u6b63\u5e38\u4f7f\u7528\u7cfb\u7edf\u529f\u80fd\u7684\u7528\u6237\u6570\u91cf\u3002\u4f8b\u5982\u4e00\u4e2a\u5373\u65f6\u901a\u8baf\u7cfb\u7edf\uff0c\u540c\u65f6\u5728\u7ebf\u7684\u7528\u6237\u91cf\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4ee3\u8868\u4e86\u7cfb\u7edf\u7684\u5e76\u53d1\u7528\u6237\u6570\u3002 \u7b80\u5355\u6765\u8bf4\uff0c\u9ad8\u5e76\u53d1\u7684\u57fa\u672c\u8868\u73b0\u5c31\u662f\u7cfb\u7edf\u5728\u5355\u4f4d\u65f6\u95f4\u5185\u80fd\u591f\u540c\u65f6\u5904\u7406\u7684\u8bf7\u6c42\u6570\u3002\u9ad8\u5e76\u53d1\u6ca1\u6709\u5177\u4f53\u7684\u8303\u56f4\u89c4\u5b9a\u591a\u5c11\u5e76\u53d1\u7b97\u662f\u9ad8\u5e76\u53d1\uff0c\u6bd4\u5982\u4f60\u5f00\u53d1\u7684\u7cfb\u7edf\u6700\u5927\u5e76\u53d1\u662f1000\uff0c\u90a3\u4e48\u6765\u4e861001\u7684\u5e76\u53d1\u91cf\u5bf9\u4f60\u6765\u8bf4\u5c31\u662f\u9ad8\u5e76\u53d1\uff0c\u4f46\u662f\u8fd9\u4e2a\u5e76\u53d1\u91cf\u653e\u5728\u6dd8\u5b9d\u4e0a\uff0c\u7b80\u76f4\u4ec0\u4e48\u90fd\u7b97\u4e0d\u4e0a\u3002 \u5982\u679c\u9ad8\u5e76\u53d1\u5904\u7406\u4e0d\u597d\uff0c\u4e0d\u4ec5\u4f1a\u964d\u4f4e\u7528\u6237\u7684\u4f53\u9a8c\u5ea6(\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u8fc7\u957f\u7b49)\uff0c\u540c\u65f6\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u5b95\u673a\u3001\u505c\u6b62\u5de5\u4f5c\u7b49\u3002","title":"\u9ad8\u5e76\u53d1"},{"location":"cs/db/mysql/#_23","text":"\u5927\u5bb6\u90fd\u77e5\u9053MySQL\u52a0\u4e0aRedis\u662f\u4e00\u5bf9\u513f\u7ecf\u5178\u7684\u7ec4\u5408\u3002\u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u4e3aMySQL\u6321\u4f4f\u5927\u90e8\u5206\u67e5\u8be2\u8bf7\u6c42\uff0c\u53ef\u4ee5\u5f88\u5927\u7a0b\u5ea6\u4e0a\u7f13\u89e3MySQL\u5e76\u53d1\u8bf7\u6c42\u7684\u538b\u529b\u3002Redis\u662f\u4e00\u4e2a\u4f7f\u7528\u5185\u5b58\u4fdd\u5b58\u6570\u636e\u7684\u9ad8\u6027\u80fdK-V\u6570\u636e\u5e93\uff0c\u5b83\u7684\u9ad8\u6027\u80fd\u4e3b\u8981\u6765\u81ea\u4e8e\uff1a \u7b80\u5355\u7684\u6570\u636e\u7ed3\u6784 \u548c \u4f7f\u7528\u5185\u5b58\u5b58\u50a8\u6570\u636e \u3002\u4f46\u662f\u6211\u4eec\u9700\u8981\u77e5\u9053\u7684\u662f\u5185\u5b58\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u6613\u5931\u6027\u5b58\u50a8\uff0c\u6240\u4ee5\u4f7f\u7528Redis\u4e0d\u80fd\u4fdd\u8bc1\u6570\u636e\u53ef\u9760\u5b58\u50a8\u3002\u4ece\u8bbe\u8ba1\u4e0a\u6765\u8bf4\uff0cRedis\u727a\u7272\u4e86\u6570\u636e\u53ef\u9760\u6027\uff0c\u6362\u53d6\u4e86\u9ad8\u6027\u80fd\u3002\u4f46\u4e5f\u6b63\u662f\u8fd9\u4e9b\u7279\u6027\uff0c\u4f7f\u5f97Redis\u7279\u522b\u9002\u5408\u7528\u6765\u505aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\u3002 \u5373\u4f7f\u53ea\u662f\u628aRedis\u4f5c\u4e3a\u7f13\u5b58\u6765\u4f7f\u7528\uff0c\u6211\u4eec\u5728\u8bbe\u8ba1Redis\u7f13\u5b58\u7684\u65f6\u5019\uff0c\u4e5f\u5fc5\u987b\u8981\u8003\u8651Redis\u7684\u8fd9\u79cd \u6570\u636e\u4e0d\u53ef\u9760\u6027 \uff0c\u6216\u8005\u6362\u53e5\u8bdd\u8bf4\uff0c\u6211\u4eec\u7684\u7cfb\u7edf\u5728\u4f7f\u7528Redis\u7684\u65f6\u5019\uff0c\u8981\u80fd\u517c\u5bb9Redis\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u505a\u5230\u5373\u4f7fRedis\u53d1\u751f\u4e86\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u5f71\u54cd\u7cfb\u7edf\u7684\u6570\u636e\u51c6\u786e\u6027\u3002 \u5173\u4e8e\u7f13\u5b58\u66f4\u65b0\u7b56\u7565\uff0c\u4f7f\u7528\u7684\u591a\u7684\u4e5f\u5c31\u662f Read/Write Through\u6a21\u5f0f \u548c Cache Aside\u6a21\u5f0f \uff0c Read/Write Through\u6a21\u5f0f \u5728\u67e5\u8be2\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u7f13\u5b58\u4e2d\u67e5\u8be2\uff0c\u5982\u679c\u547d\u4e2d\u7f13\u5b58\u90a3\u5c31\u76f4\u63a5\u8fd4\u56de\u6570\u636e\uff1b\u5982\u679c\u6ca1\u6709\u547d\u4e2d\uff0c\u90a3\u5c31\u53bb\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\uff0c\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\u4e4b\u540e\u628a\u6570\u636e\u5199\u5165\u7f13\u5b58\uff0c\u7136\u540e\u8fd4\u56de\u3002\u5728\u66f4\u65b0\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u66f4\u65b0\u6570\u636e\u5e93\uff0c\u5982\u679c\u66f4\u65b0\u6210\u529f\uff0c\u518d\u53bb\u66f4\u65b0\u7f13\u5b58\u4e2d\u7684\u6570\u636e\u3002","title":"\u4f7f\u7528\u7f13\u5b58"},{"location":"cs/db/mysql/#_24","text":"\u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u975e\u5e38\u6709\u6548\u5730\u63d0\u5347\u7cfb\u7edf\u5904\u7406\u9ad8\u5e76\u53d1\u7684\u80fd\u529b\uff0c\u964d\u4f4e\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u3002\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Cache Aside\u6a21\u5f0f\u6765\u66f4\u65b0\u7f13\u5b58\u90fd\u662f\u6700\u4f73\u7684\u9009\u62e9\uff0c\u76f8\u6bd4Read/Write Through\u6a21\u5f0f\u66f4\u7b80\u5355\uff0c\u8fd8\u80fd\u5927\u5e45\u964d\u4f4e\u810f\u6570\u636e\u7684\u53ef\u80fd\u6027\u3002\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u5927\u91cf\u7f13\u5b58\u7a7f\u900f\u5f15\u8d77\u96ea\u5d29\u7684\u95ee\u9898\uff0c\u4f60\u9700\u8981\u9488\u5bf9\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u6765\u9009\u62e9\u5408\u9002\u89e3\u51b3\u65b9\u6848\u3002","title":"\u603b\u7ed3"},{"location":"cs/db/mysql/#reidskv","text":"","title":"reids\u9047\u5230\u5927KV"},{"location":"cs/db/mysql/#_25","text":"\u8df3\u8868\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u5c31\u662f\u7ed9\u94fe\u8868\u52a0\u7d22\u5f15\uff0c\u5f53\u7ed3\u70b9\u6570\u91cf\u591a\u7684\u65f6\u5019\uff0c\u8fd9\u79cd\u6dfb\u52a0\u7d22\u5f15\u7684\u65b9\u5f0f\uff0c\u4f1a\u4f7f\u67e5\u8be2\u6548\u7387\u63d0\u9ad8\u7684\u975e\u5e38\u660e\u663e\u3002 \u8df3\u8868\u8fd9\u4e2a\u52a8\u6001\u6570\u636e\u7ed3\u6784\uff0c\u4e0d\u4ec5\u652f\u6301\u67e5\u627e\u64cd\u4f5c\uff0c\u8fd8\u652f\u6301\u52a8\u6001\u7684\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\uff0c\u800c\u4e14\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \\(O(logn)\\) \u3002 \u5bf9\u4e8e\u5355\u7eaf\u7684\u5355\u94fe\u8868\uff0c\u9700\u8981\u904d\u5386\u6bcf\u4e2a\u7ed3\u70b9\u6765\u627e\u5230\u63d2\u5165\u7684\u4f4d\u7f6e\u3002\u4f46\u662f\u5bf9\u4e8e\u8df3\u8868\u6765\u8bf4\uff0c\u56e0\u4e3a\u5176\u67e5\u627e\u67d0\u4e2a\u7ed3\u70b9\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f \\(O(logn)\\) \uff0c\u6240\u4ee5\u8fd9\u91cc\u67e5\u627e\u67d0\u4e2a\u6570\u636e\u5e94\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \u25cb(\u33d2n)\u3002","title":"\u8df3\u8868"},{"location":"cs/db/mysql/#redisb","text":"redis \u4f7f\u7528\u8df3\u8868\u4e0d\u7528 B + \u6570\u7684\u539f\u56e0\u662f\uff1aredis \u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u800c B + \u6811\u7eaf\u7cb9\u662f\u4e3a\u4e86 mysql \u8fd9\u79cd IO \u6570\u636e\u5e93\u51c6\u5907\u7684\u3002B + \u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u7684\u6570\u91cf\u90fd\u662f\u4e00\u4e2a mysql \u5206\u533a\u9875\u7684\u5927\u5c0f Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u662f\u901a\u8fc7\u8df3\u8868\u6765\u5b9e\u73b0\u7684\uff0c\u4e25\u683c\u70b9\u8bb2\uff0c\u8fd8\u7528\u5230\u4e86\u6563\u5217\u8868\uff08\u5173\u4e8e\u6563\u5217\u8868\uff09\uff0c\u5982\u679c\u67e5\u770b Redis \u5f00\u53d1\u624b\u518c\uff0c\u4f1a\u53d1\u73b0 Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u652f\u6301\u7684\u6838\u5fc3\u64cd\u4f5c\u4e3b\u8981\u6709\u4e0b\u9762\u8fd9\u51e0\u4e2a\uff1a \u63d2\u5165\u4e00\u4e2a\u6570\u636e \u5220\u9664\u4e00\u4e2a\u6570\u636e \u67e5\u627e\u4e00\u4e2a\u6570\u636e \u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\uff08\u6bd4\u5982\u67e5\u627e\u5728 [100,356] \u4e4b\u95f4\u7684\u6570\u636e\uff09 \u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217 \u5176\u4e2d\uff0c\u63d2\u5165\u3001\u67e5\u627e\u3001\u5220\u9664\u4ee5\u53ca\u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217\u8fd9\u51e0\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u4e5f\u80fd\u5b8c\u6210\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u8df3\u8868\u662f\u4e00\u6837\u7684\uff0c\u4f46\u662f\uff0c\u6309\u7167\u533a\u95f4\u6765\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u7684\u6548\u7387\u6ca1\u6709\u8df3\u8868\u9ad8\u3002 \u5bf9\u4e8e\u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u8df3\u8868\u53ef\u4ee5\u505a\u5230 \\(O(logn)\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u5b9a\u4f4d\u533a\u95f4\u7684\u8d77\u70b9\uff0c\u7136\u540e\u5728\u539f\u59cb\u94fe\u8868\u4e2d\u987a\u5e8f\u5f80\u540e\u904d\u5386\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6837\u505a\u975e\u5e38\u9ad8\u6548\u3002 \u5f53\u7136\uff0c\u8fd8\u6709\u5176\u4ed6\u539f\u56e0\uff0c\u6bd4\u5982\uff0c\u8df3\u8868\u4ee3\u7801\u66f4\u5bb9\u6613\u5b9e\u73b0\uff0c\u53ef\u8bfb\u6027\u597d\u4e0d\u6613\u51fa\u9519\u3002\u8df3\u8868\u66f4\u52a0\u7075\u6d3b\uff0c\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u7d22\u5f15\u6784\u5efa\u7b56\u7565\uff0c\u6709\u6548\u5e73\u8861\u6267\u884c\u6548\u7387\u548c\u5185\u5b58\u6d88\u8017\u3002","title":"Redis\u9009\u4e2d\u8df3\u8868\u800c\u4e0d\u4f7f\u7528B+\u6811"},{"location":"cs/db/mysql/#8","text":"SELECT g1 . stu_id , g1 . class_id , g1 . gender , g1 . math_score FROM grade g1 WHERE g1 . gender = 'm' AND EXISTS ( SELECT count ( * ) FROM grade g2 WHERE g2 . gender = 'm' AND g2 . math_score >= g1 . math_score AND g2 . class_id = g1 . class_id GROUP BY g2 . class_id HAVING count ( * ) <= 3 ) ORDER BY class_id , math_score DESC","title":"\u603b\u51718\u4e2a\u73ed\u7ea7\u3001\u8f93\u51fa\u6bcf\u4e2a\u73ed\u7ea7\u7537\u751f\u7684\u6570\u5b66\u524d\u4e09\u540d\u548c\u5973\u751f\u7684\u8bed\u6587\u524d\u4e09\u540d"},{"location":"cs/db/redis/cjh/","text":"Redis \u6301\u4e45\u5316 \u00b6 \u7b80\u4ecb \u00b6 \u7531\u4e8eredis\u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u5176\u6570\u636e\u65ad\u7535\u6613\u5931\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u6570\u636e\u4fdd\u5b58\u5230\u78c1\u76d8\u4e2d\u3002redis\u6709\u4e24\u79cd\u6301\u4e45\u5316\u89e3\u51b3\u65b9\u6848\uff0c\u5206\u522b\u662f\uff1aRDB\uff0cAOF\u3002 \u5feb\u7167(Snapshot) / RDB \u00b6 \u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u67d0\u4e00\u65f6\u523b\u7684\u6240\u6709\u6570\u636e\u90fd\u5199\u5165\u786c\u76d8\u4e2d,\u5f53\u7136\u8fd9\u4e5f\u662fredis\u7684\u9ed8\u8ba4\u5f00\u542f\u6301\u4e45\u5316\u65b9\u5f0f,\u4fdd\u5b58\u7684\u6587\u4ef6\u662f\u4ee5.rdb\u5f62\u5f0f\u7ed3\u5c3e\u7684\u6587\u4ef6\u56e0\u6b64\u8fd9\u79cd\u65b9\u5f0f\u4e5f\u79f0\u4e4b\u4e3aRDB\u65b9\u5f0f\u3002 \u5728\u6307\u5b9a\u65f6\u95f4\u95f4\u9694\u540e\uff0c\u5c06\u5185\u5b58\u4e2d\u7684\u6570\u636e\u96c6\u5feb\u7167\u5199\u5165\u6570\u636e\u5e93 \uff1b\u5728\u6062\u590d\u65f6\u5019\uff0c\u76f4\u63a5\u8bfb\u53d6\u5feb\u7167\u6587\u4ef6\uff0c\u8fdb\u884c\u6570\u636e\u7684\u6062\u590d \uff1b \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c Redis \u5c06\u6570\u636e\u5e93\u5feb\u7167\u4fdd\u5b58\u5728\u540d\u5b57\u4e3a dump.rdb \u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u3002\u6587\u4ef6\u540d\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002 RDB\u6301\u4e45\u5316\u7684\u5927\u81f4\u8fc7\u7a0b \u00b6 \u5728\u8fdb\u884c RDB \u7684\u65f6\u5019\uff0credis \u7684\u4e3b\u7ebf\u7a0b\u662f\u4e0d\u4f1a\u505a io \u64cd\u4f5c\u7684\uff0c\u4e3b\u7ebf\u7a0b\u4f1a fork \u4e00\u4e2a\u5b50\u7ebf\u7a0b\u6765\u5b8c\u6210\u8be5\u64cd\u4f5c\uff1b Redis \u8c03\u7528forks\u3002\u540c\u65f6\u62e5\u6709\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u3002 \u5b50\u8fdb\u7a0b\u5c06\u6570\u636e\u96c6\u5199\u5165\u5230\u4e00\u4e2a\u4e34\u65f6 RDB \u6587\u4ef6\u4e2d\u3002 \u5f53\u5b50\u8fdb\u7a0b\u5b8c\u6210\u5bf9\u65b0 RDB \u6587\u4ef6\u7684\u5199\u5165\u65f6\uff0cRedis \u7528\u65b0 RDB \u6587\u4ef6\u66ff\u6362\u539f\u6765\u7684 RDB \u6587\u4ef6\uff0c\u5e76\u5220\u9664\u65e7\u7684 RDB \u6587\u4ef6\u3002 \u8fd9\u79cd\u5de5\u4f5c\u65b9\u5f0f\u4f7f\u5f97 Redis \u53ef\u4ee5\u4ece\u5199\u65f6\u590d\u5236\uff08copy-on-write\uff09\u673a\u5236\u4e2d\u83b7\u76ca(\u56e0\u4e3a\u662f\u4f7f\u7528\u5b50\u8fdb\u7a0b\u8fdb\u884c\u5199\u64cd\u4f5c\uff0c\u800c\u7236\u8fdb\u7a0b\u4f9d\u7136\u53ef\u4ee5\u63a5\u6536\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002) bgsave\uff1a \u00b6 \u5ba2\u6237\u7aef\u53ef\u4ee5\u4f7f\u7528BGSAVE\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u5feb\u7167,\u5f53\u63a5\u6536\u5230\u5ba2\u6237\u7aef\u7684BGSAVE\u547d\u4ee4\u65f6,redis\u4f1a\u8c03\u7528fork\u6765\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b,\u7136\u540e\u5b50\u8fdb\u7a0b\u8d1f\u8d23\u5c06\u5feb\u7167\u5199\u5165\u78c1\u76d8\u4e2d,\u800c\u7236\u8fdb\u7a0b\u5219\u7ee7\u7eed\u5904\u7406\u547d\u4ee4\u8bf7\u6c42\u3002 bgsave \u662f\u5f02\u6b65\u8fdb\u884c\uff0c\u8fdb\u884c\u6301\u4e45\u5316\u7684\u65f6\u5019\uff0credis \u8fd8\u53ef\u4ee5\u5c06\u7ee7\u7eed\u54cd\u5e94\u5ba2\u6237\u7aef\u8bf7\u6c42 \uff1b save\uff1a \u00b6 \u4f7f\u7528 save \u547d\u4ee4\uff0c\u4f1a\u7acb\u523b\u5bf9\u5f53\u524d\u5185\u5b58\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6301\u4e45\u5316 ,\u4f46\u662f\u4f1a\u963b\u585e\uff0c\u4e5f\u5c31\u662f\u4e0d\u63a5\u53d7\u5176\u4ed6\u64cd\u4f5c\u4e86\uff1b \u7531\u4e8e save \u547d\u4ee4\u662f\u540c\u6b65\u547d\u4ee4\uff0c\u4f1a\u5360\u7528Redis\u7684\u4e3b\u8fdb\u7a0b\u3002\u82e5Redis\u6570\u636e\u975e\u5e38\u591a\u65f6\uff0csave\u547d\u4ee4\u6267\u884c\u901f\u5ea6\u4f1a\u975e\u5e38\u6162\uff0c\u963b\u585e\u6240\u6709\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002 shutdown\uff1a \u00b6 \u5f53redis\u901a\u8fc7shutdown\u6307\u4ee4\u63a5\u6536\u5230\u5173\u95ed\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u65f6,\u4f1a\u6267\u884c\u4e00\u4e2asave\u547d\u4ee4,\u963b\u585e\u6240\u6709\u7684\u5ba2\u6237\u7aef,\u4e0d\u518d\u6267\u884c\u5ba2\u6237\u7aef\u6267\u884c\u53d1\u9001\u7684\u4efb\u4f55\u547d\u4ee4,\u5e76\u4e14\u5728save\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\u4e4b\u540e\u5173\u95ed\u670d\u52a1\u5668 \u6ce8\u610f: \u00b6 SAVE\u547d\u4ee4\u5e76\u4e0d\u5e38\u7528,\u4f7f\u7528SAVE\u547d\u4ee4\u5728\u5feb\u7167\u521b\u5efa\u5b8c\u6bd5\u4e4b\u524d,redis\u5904\u4e8e\u963b\u585e\u72b6\u6001,\u65e0\u6cd5\u5bf9\u5916\u670d\u52a1 \u5982\u679c\u7528\u6237\u5728redis.conf\u4e2d\u8bbe\u7f6e\u4e86save\u914d\u7f6e\u9009\u9879,redis\u4f1a\u5728save\u9009\u9879\u6761\u4ef6\u6ee1\u8db3\u4e4b\u540e\u81ea\u52a8\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4,\u5982\u679c\u8bbe\u7f6e\u591a\u4e2asave\u914d\u7f6e\u9009\u9879,\u5f53\u4efb\u610f\u4e00\u4e2asave\u914d\u7f6e\u9009\u9879\u6761\u4ef6\u6ee1\u8db3,redis\u4e5f\u4f1a\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4 \u4f18\u70b9 \u00b6 RDB\u6587\u4ef6\u7d27\u51d1\uff0c\u5168\u91cf\u5907\u4efd\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u8fdb\u884c\u5907\u4efd\u548c\u707e\u96be\u6062\u590d\u3002 \u751f\u6210RDB\u6587\u4ef6\u7684\u65f6\u5019\uff0credis\u4e3b\u8fdb\u7a0b\u4f1afork()\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u6765\u5904\u7406\u6240\u6709\u4fdd\u5b58\u5de5\u4f5c\uff0c\u4e3b\u8fdb\u7a0b\u4e0d\u9700\u8981\u8fdb\u884c\u4efb\u4f55\u78c1\u76d8IO\u64cd\u4f5c\u3002 RDB \u5728\u6062\u590d\u5927\u6570\u636e\u96c6\u65f6\u7684\u901f\u5ea6\u6bd4 AOF \u7684\u6062\u590d\u901f\u5ea6\u8981\u5feb\u3002 \u7f3a\u70b9 \u00b6 \u9700\u8981\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fdb\u7a0b\u64cd\u4f5c\uff01\u5982\u679credis\u610f\u5916\u5b95\u673a\u4e86\uff0c\u8fd9\u4e2a\u6700\u540e\u4e00\u6b21\u4fee\u6539\u6570\u636e\u5c31\u6ca1\u6709\u7684\u4e86\uff01 fork\u8fdb\u7a0b\u7684\u65f6\u5019\uff0c\u4f1a\u5360\u7528\u4e00\u5b9a\u7684\u5185\u5bb9\u7a7a\u95f4\uff01\uff01 RDB\u89e6\u53d1\u673a\u5236 \u00b6 save\u7684\u89c4\u5219\u6ee1\u8db3\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u89e6\u53d1rdb\u89c4\u5219 \u6267\u884c flushall \u547d\u4ee4\uff0c\u4e5f\u4f1a\u89e6\u53d1\u6211\u4eec\u7684rdb\u89c4\u5219\uff01 \u9000\u51faredis\uff0c\u4e5f\u4f1a\u4ea7\u751f rdb \u6587\u4ef6\uff01 \u914d\u7f6e\u751f\u6210\u5feb\u7167\u540d\u79f0\u548c\u4f4d\u7f6e \u00b6 \u4fee\u6539\u751f\u6210\u5feb\u7167\u540d\u79f0 dbfilename dump.rdb \u4fee\u6539\u751f\u6210\u4f4d\u7f6e dir ./ \u6062\u590drdb\u6587\u4ef6 \u00b6 \u53ea\u9700\u8981\u5c06rdb\u6587\u4ef6\u653e\u5728redis\u542f\u52a8\u76ee\u5f55\u4e2d\uff0credis\u542f\u52a8\u65f6\u81ea\u52a8\u68c0\u67e5dump.rdb\u6062\u590d\u5176\u4e2d\u7684\u6570\u636e\u3002 \u67e5\u770b\u5176\u5b58\u5728\u7684\u4f4d\u7f6e \u5982\u679c/var/lib/redis\u8fd9\u4e2a\u76ee\u5f55\u5b58\u5728dump.rdb\u6587\u4ef6\uff0c\u5219\u542f\u52a8\u65f6\u81ea\u52a8\u6062\u590d\u6570\u636e\u3002 AOF \u00b6 Append Only File \u5c06\u6211\u4eec\u6240\u6709\u7684\u547d\u4ee4\u90fd\u8bb0\u5f55\u4e0b\u6765\uff0chistory\uff0c\u6062\u590d\u7684\u65f6\u5019\u5c31\u628a\u8fd9\u4e2a\u6587\u4ef6\u5168\u90e8\u518d\u6267\u884c\u4e00\u904d \u4ec0\u4e48\u662fAOF \u00b6 \u5feb\u7167\u529f\u80fd\uff08RDB\uff09\u5e76\u4e0d\u662f\u975e\u5e38\u8010\u4e45\uff08durable\uff09\uff1a \u5982\u679c Redis \u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u800c\u9020\u6210\u6545\u969c\u505c\u673a\uff0c \u90a3\u4e48\u670d\u52a1\u5668\u5c06\u4e22\u5931\u6700\u8fd1\u5199\u5165\u3001\u4ee5\u53ca\u672a\u4fdd\u5b58\u5230\u5feb\u7167\u4e2d\u7684\u90a3\u4e9b\u6570\u636e\u3002 \u4ece 1.1 \u7248\u672c\u5f00\u59cb\uff0c Redis \u589e\u52a0\u4e86\u4e00\u79cd\u5b8c\u5168\u8010\u4e45\u7684\u6301\u4e45\u5316\u65b9\u5f0f\uff1a AOF \u6301\u4e45\u5316\u3002 \u7279\u70b9 \u00b6 \u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u6240\u6709\u5ba2\u6237\u7aef\u6267\u884c\u7684\u5199\u547d\u4ee4\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d,AOF\u6301\u4e45\u5316\u4f1a\u5c06\u88ab\u6267\u884c\u7684\u5199\u547d\u4ee4\u5199\u5230AOF\u7684\u6587\u4ef6\u672b\u5c3e,\u4ee5\u6b64\u6765\u8bb0\u5f55\u6570\u636e\u53d1\u751f\u7684\u53d8\u5316,\u56e0\u6b64\u53ea\u8981redis\u4ece\u5934\u5230\u5c3e\u6267\u884c\u4e00\u6b21AOF\u6587\u4ef6\u6240\u5305\u542b\u7684\u6240\u6709\u5199\u547d\u4ee4,\u5c31\u53ef\u4ee5\u6062\u590dAOF\u6587\u4ef6\u7684\u8bb0\u5f55\u7684\u6570\u636e\u96c6. \u5f00\u542fAOF\u6301\u4e45\u5316 \u00b6 \u5728redis\u7684\u9ed8\u8ba4\u914d\u7f6e\u4e2dAOF\u6301\u4e45\u5316\u673a\u5236\u662f\u6ca1\u6709\u5f00\u542f\u7684\uff0c\u9700\u8981\u5728\u914d\u7f6e\u4e2d\u5f00\u542f appendonly no yes\u5219\u8868\u793a\u542f\u7528AOF \u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u914d\u7f6e\uff0c\u7136\u540e\u91cd\u542fredis\uff0c\u5c31\u53ef\u4ee5\u751f\u6548\u4e86\uff01 \u5982\u679c\u8fd9\u4e2aaof\u6587\u4ef6\u6709\u9519\u4f4d\uff0c\u8fd9\u65f6\u5019redis\u662f\u542f\u52a8\u4e0d\u8d77\u6765\u7684\uff0c\u6211\u9700\u8981\u4fee\u6539\u8fd9\u4e2aaof\u6587\u4ef6 redis\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5de5\u5177redis-check-aof --fix \u65e5\u5fd7\u8ffd\u52a0\u9891\u7387 \u00b6 \u4fee\u6539\u65e5\u5fd7\u540c\u6b65\u9891\u7387 - \u4fee\u6539appendfsync everysec | always | no \u6307\u5b9a AOF\u6587\u4ef6\u7684\u91cd\u5199 \u00b6 AOF\u5e26\u6765\u7684\u95ee\u9898 \u00b6 AOF\u7684\u65b9\u5f0f\u4e5f\u540c\u65f6\u5e26\u6765\u4e86\u53e6\u4e00\u4e2a\u95ee\u9898\u3002\u6301\u4e45\u5316\u6587\u4ef6\u4f1a\u53d8\u7684\u8d8a\u6765\u8d8a\u5927\u3002\u4f8b\u5982\u6211\u4eec\u8c03\u7528incr test\u547d\u4ee4100\u6b21\uff0c\u6587\u4ef6\u4e2d\u5fc5\u987b\u4fdd\u5b58\u5168\u90e8\u7684100\u6761\u547d\u4ee4\uff0c\u5176\u5b9e\u670999\u6761\u90fd\u662f\u591a\u4f59\u7684\u3002\u56e0\u4e3a\u8981\u6062\u590d\u6570\u636e\u5e93\u7684\u72b6\u6001\u5176\u5b9e\u6587\u4ef6\u4e2d\u4fdd\u5b58\u4e00\u6761set test 100\u5c31\u591f\u4e86\u3002\u4e3a\u4e86\u538b\u7f29aof\u7684\u6301\u4e45\u5316\u6587\u4ef6Redis\u63d0\u4f9b\u4e86AOF\u91cd\u5199(ReWriter)\u673a\u5236\u3002 AOF\u91cd\u5199 \u00b6 \u7528\u6765\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u51cf\u5c0fAOF\u6587\u4ef6\u7684\u4f53\u79ef \u89e6\u53d1\u673a\u5236 \u00b6 # 1.\u5ba2\u6237\u7aef\u65b9\u5f0f\u89e6\u53d1\u91cd\u5199 - \u6267\u884cBGREWRITEAOF\u547d\u4ee4 \u4e0d\u4f1a\u963b\u585eredis\u7684\u670d\u52a1 # 2.\u670d\u52a1\u5668\u914d\u7f6e\u65b9\u5f0f\u81ea\u52a8\u89e6\u53d1 - \u914d\u7f6eredis.conf\u4e2d\u7684auto-aof-rewrite-percentage\u9009\u9879 \u53c2\u52a0\u4e0b\u56fe\u2193\u2193\u2193 - \u5982\u679c\u8bbe\u7f6eauto-aof-rewrite-percentage\u503c\u4e3a100\u548cauto-aof-rewrite-min-size 64mb,\u5e76\u4e14\u542f\u7528\u7684AOF\u6301\u4e45\u5316\u65f6,\u90a3\u4e48\u5f53AOF\u6587\u4ef6\u4f53\u79ef\u5927\u4e8e64M,\u5e76\u4e14AOF\u6587\u4ef6\u7684\u4f53\u79ef\u6bd4\u4e0a\u4e00\u6b21\u91cd\u5199\u4e4b\u540e\u4f53\u79ef\u5927\u4e86\u81f3\u5c11\u4e00\u500d ( 100 % ) \u65f6,\u4f1a\u81ea\u52a8\u89e6\u53d1,\u5982\u679c\u91cd\u5199\u8fc7\u4e8e\u9891\u7e41,\u7528\u6237\u53ef\u4ee5\u8003\u8651\u5c06auto-aof-rewrite-percentage\u8bbe\u7f6e\u4e3a\u66f4\u5927 \u91cd\u5199\u539f\u7406 \u00b6 \u6ce8\u610f\uff1a\u91cd\u5199aof\u6587\u4ef6\u7684\u64cd\u4f5c\uff0c\u5e76\u6ca1\u6709\u8bfb\u53d6\u65e7\u7684aof\u6587\u4ef6\uff0c\u800c\u662f\u5c06\u6574\u4e2a\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5185\u5bb9\u7528\u547d\u4ee4\u7684\u65b9\u5f0f\u91cd\u5199\u4e86\u4e00\u4e2a\u65b0\u7684aof\u6587\u4ef6,\u66ff\u6362\u539f\u6709\u7684\u6587\u4ef6\u8fd9\u70b9\u548c\u5feb\u7167\u6709\u70b9\u7c7b\u4f3c\u3002 # \u91cd\u5199\u6d41\u7a0b - 1 . redis\u8c03\u7528fork \uff0c\u73b0\u5728\u6709\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b \u5b50\u8fdb\u7a0b\u6839\u636e\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5feb\u7167\uff0c\u5f80\u4e34\u65f6\u6587\u4ef6\u4e2d\u5199\u5165\u91cd\u5efa\u6570\u636e\u5e93\u72b6\u6001\u7684\u547d\u4ee4 - 2 . \u7236\u8fdb\u7a0b\u7ee7\u7eed\u5904\u7406client\u8bf7\u6c42\uff0c\u9664\u4e86\u628a\u5199\u547d\u4ee4\u5199\u5165\u5230\u539f\u6765\u7684aof\u6587\u4ef6\u4e2d\u3002\u540c\u65f6\u628a\u6536\u5230\u7684\u5199\u547d\u4ee4\u7f13\u5b58\u8d77\u6765\u3002\u8fd9\u6837\u5c31\u80fd\u4fdd\u8bc1\u5982\u679c\u5b50\u8fdb\u7a0b\u91cd\u5199\u5931\u8d25\u7684\u8bdd\u5e76\u4e0d\u4f1a\u51fa\u95ee\u9898\u3002 - 3 . \u5f53\u5b50\u8fdb\u7a0b\u628a\u5feb\u7167\u5185\u5bb9\u5199\u5165\u5df2\u547d\u4ee4\u65b9\u5f0f\u5199\u5230\u4e34\u65f6\u6587\u4ef6\u4e2d\u540e\uff0c\u5b50\u8fdb\u7a0b\u53d1\u4fe1\u53f7\u901a\u77e5\u7236\u8fdb\u7a0b\u3002\u7136\u540e\u7236\u8fdb\u7a0b\u628a\u7f13\u5b58\u7684\u5199\u547d\u4ee4\u4e5f\u5199\u5165\u5230\u4e34\u65f6\u6587\u4ef6\u3002 - 4 . \u73b0\u5728\u7236\u8fdb\u7a0b\u53ef\u4ee5\u4f7f\u7528\u4e34\u65f6\u6587\u4ef6\u66ff\u6362\u8001\u7684aof\u6587\u4ef6\uff0c\u5e76\u91cd\u547d\u540d\uff0c\u540e\u9762\u6536\u5230\u7684\u5199\u547d\u4ee4\u4e5f\u5f00\u59cb\u5f80\u65b0\u7684aof\u6587\u4ef6\u4e2d\u8ffd\u52a0\u3002 \u4f18\u70b9 \u00b6 \u6bcf\u4e00\u6b21\u4fee\u6539\u90fd\u4f1a\u540c\u6b65\uff0c\u6587\u4ef6\u7684\u5b8c\u6574\u6027\u4f1a\u66f4\u52a0\u597d \u6ca1\u79d2\u540c\u6b65\u4e00\u6b21\uff0c\u53ef\u80fd\u4f1a\u4e22\u5931\u4e00\u79d2\u7684\u6570\u636e \u4ece\u4e0d\u540c\u6b65\uff0c\u6548\u7387\u6700\u9ad8 \u7f3a\u70b9 \u00b6 \u76f8\u5bf9\u4e8e\u6570\u636e\u6587\u4ef6\u6765\u8bf4\uff0caof\u8fdc\u8fdc\u5927\u4e8erdb\uff0c\u4fee\u590d\u901f\u5ea6\u6bd4rdb\u6162\uff01 Aof\u8fd0\u884c\u6548\u7387\u4e5f\u8981\u6bd4rdb\u6162\uff0c\u6240\u4ee5\u6211\u4eecredis\u9ed8\u8ba4\u7684\u914d\u7f6e\u5c31\u662frdb\u6301\u4e45\u5316 \u5982\u4f55\u9009\u62e9\u54ea\u79cd\u6301\u4e45\u5316\u65b9\u5f0f \u00b6 \u4e00\u822c\u6765\u8bf4\uff0c \u5982\u679c\u60f3\u8fbe\u5230\u8db3\u4ee5\u5ab2\u7f8e PostgreSQL \u7684\u6570\u636e\u5b89\u5168\u6027\uff0c \u4f60\u5e94\u8be5\u540c\u65f6\u4f7f\u7528\u4e24\u79cd\u6301\u4e45\u5316\u529f\u80fd\u3002 \u5982\u679c\u4f60\u975e\u5e38\u5173\u5fc3\u4f60\u7684\u6570\u636e\uff0c \u4f46\u4ecd\u7136\u53ef\u4ee5\u627f\u53d7\u6570\u5206\u949f\u4ee5\u5185\u7684\u6570\u636e\u4e22\u5931\uff0c \u90a3\u4e48\u4f60\u53ef\u4ee5\u53ea\u4f7f\u7528 RDB \u6301\u4e45\u5316\u3002 \u6709\u5f88\u591a\u7528\u6237\u90fd\u53ea\u4f7f\u7528 AOF \u6301\u4e45\u5316\uff0c \u4f46\u5e76\u4e0d\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\uff1a \u56e0\u4e3a\u5b9a\u65f6\u751f\u6210 RDB \u5feb\u7167\uff08snapshot\uff09\u975e\u5e38\u4fbf\u4e8e\u8fdb\u884c\u6570\u636e\u5e93\u5907\u4efd\uff0c \u5e76\u4e14 RDB \u6062\u590d\u6570\u636e\u96c6\u7684\u901f\u5ea6\u4e5f\u8981\u6bd4 AOF \u6062\u590d\u7684\u901f\u5ea6\u8981\u5feb\u3002","title":"\u6301\u4e45\u5316"},{"location":"cs/db/redis/cjh/#redis","text":"","title":"Redis \u6301\u4e45\u5316"},{"location":"cs/db/redis/cjh/#_1","text":"\u7531\u4e8eredis\u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u5176\u6570\u636e\u65ad\u7535\u6613\u5931\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u6570\u636e\u4fdd\u5b58\u5230\u78c1\u76d8\u4e2d\u3002redis\u6709\u4e24\u79cd\u6301\u4e45\u5316\u89e3\u51b3\u65b9\u6848\uff0c\u5206\u522b\u662f\uff1aRDB\uff0cAOF\u3002","title":"\u7b80\u4ecb"},{"location":"cs/db/redis/cjh/#snapshot-rdb","text":"\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u67d0\u4e00\u65f6\u523b\u7684\u6240\u6709\u6570\u636e\u90fd\u5199\u5165\u786c\u76d8\u4e2d,\u5f53\u7136\u8fd9\u4e5f\u662fredis\u7684\u9ed8\u8ba4\u5f00\u542f\u6301\u4e45\u5316\u65b9\u5f0f,\u4fdd\u5b58\u7684\u6587\u4ef6\u662f\u4ee5.rdb\u5f62\u5f0f\u7ed3\u5c3e\u7684\u6587\u4ef6\u56e0\u6b64\u8fd9\u79cd\u65b9\u5f0f\u4e5f\u79f0\u4e4b\u4e3aRDB\u65b9\u5f0f\u3002 \u5728\u6307\u5b9a\u65f6\u95f4\u95f4\u9694\u540e\uff0c\u5c06\u5185\u5b58\u4e2d\u7684\u6570\u636e\u96c6\u5feb\u7167\u5199\u5165\u6570\u636e\u5e93 \uff1b\u5728\u6062\u590d\u65f6\u5019\uff0c\u76f4\u63a5\u8bfb\u53d6\u5feb\u7167\u6587\u4ef6\uff0c\u8fdb\u884c\u6570\u636e\u7684\u6062\u590d \uff1b \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c Redis \u5c06\u6570\u636e\u5e93\u5feb\u7167\u4fdd\u5b58\u5728\u540d\u5b57\u4e3a dump.rdb \u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u3002\u6587\u4ef6\u540d\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002","title":"\u5feb\u7167(Snapshot) / RDB"},{"location":"cs/db/redis/cjh/#rdb","text":"\u5728\u8fdb\u884c RDB \u7684\u65f6\u5019\uff0credis \u7684\u4e3b\u7ebf\u7a0b\u662f\u4e0d\u4f1a\u505a io \u64cd\u4f5c\u7684\uff0c\u4e3b\u7ebf\u7a0b\u4f1a fork \u4e00\u4e2a\u5b50\u7ebf\u7a0b\u6765\u5b8c\u6210\u8be5\u64cd\u4f5c\uff1b Redis \u8c03\u7528forks\u3002\u540c\u65f6\u62e5\u6709\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u3002 \u5b50\u8fdb\u7a0b\u5c06\u6570\u636e\u96c6\u5199\u5165\u5230\u4e00\u4e2a\u4e34\u65f6 RDB \u6587\u4ef6\u4e2d\u3002 \u5f53\u5b50\u8fdb\u7a0b\u5b8c\u6210\u5bf9\u65b0 RDB \u6587\u4ef6\u7684\u5199\u5165\u65f6\uff0cRedis \u7528\u65b0 RDB \u6587\u4ef6\u66ff\u6362\u539f\u6765\u7684 RDB \u6587\u4ef6\uff0c\u5e76\u5220\u9664\u65e7\u7684 RDB \u6587\u4ef6\u3002 \u8fd9\u79cd\u5de5\u4f5c\u65b9\u5f0f\u4f7f\u5f97 Redis \u53ef\u4ee5\u4ece\u5199\u65f6\u590d\u5236\uff08copy-on-write\uff09\u673a\u5236\u4e2d\u83b7\u76ca(\u56e0\u4e3a\u662f\u4f7f\u7528\u5b50\u8fdb\u7a0b\u8fdb\u884c\u5199\u64cd\u4f5c\uff0c\u800c\u7236\u8fdb\u7a0b\u4f9d\u7136\u53ef\u4ee5\u63a5\u6536\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002)","title":"RDB\u6301\u4e45\u5316\u7684\u5927\u81f4\u8fc7\u7a0b"},{"location":"cs/db/redis/cjh/#bgsave","text":"\u5ba2\u6237\u7aef\u53ef\u4ee5\u4f7f\u7528BGSAVE\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u5feb\u7167,\u5f53\u63a5\u6536\u5230\u5ba2\u6237\u7aef\u7684BGSAVE\u547d\u4ee4\u65f6,redis\u4f1a\u8c03\u7528fork\u6765\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b,\u7136\u540e\u5b50\u8fdb\u7a0b\u8d1f\u8d23\u5c06\u5feb\u7167\u5199\u5165\u78c1\u76d8\u4e2d,\u800c\u7236\u8fdb\u7a0b\u5219\u7ee7\u7eed\u5904\u7406\u547d\u4ee4\u8bf7\u6c42\u3002 bgsave \u662f\u5f02\u6b65\u8fdb\u884c\uff0c\u8fdb\u884c\u6301\u4e45\u5316\u7684\u65f6\u5019\uff0credis \u8fd8\u53ef\u4ee5\u5c06\u7ee7\u7eed\u54cd\u5e94\u5ba2\u6237\u7aef\u8bf7\u6c42 \uff1b","title":"bgsave\uff1a"},{"location":"cs/db/redis/cjh/#save","text":"\u4f7f\u7528 save \u547d\u4ee4\uff0c\u4f1a\u7acb\u523b\u5bf9\u5f53\u524d\u5185\u5b58\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6301\u4e45\u5316 ,\u4f46\u662f\u4f1a\u963b\u585e\uff0c\u4e5f\u5c31\u662f\u4e0d\u63a5\u53d7\u5176\u4ed6\u64cd\u4f5c\u4e86\uff1b \u7531\u4e8e save \u547d\u4ee4\u662f\u540c\u6b65\u547d\u4ee4\uff0c\u4f1a\u5360\u7528Redis\u7684\u4e3b\u8fdb\u7a0b\u3002\u82e5Redis\u6570\u636e\u975e\u5e38\u591a\u65f6\uff0csave\u547d\u4ee4\u6267\u884c\u901f\u5ea6\u4f1a\u975e\u5e38\u6162\uff0c\u963b\u585e\u6240\u6709\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002","title":"save\uff1a"},{"location":"cs/db/redis/cjh/#shutdown","text":"\u5f53redis\u901a\u8fc7shutdown\u6307\u4ee4\u63a5\u6536\u5230\u5173\u95ed\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u65f6,\u4f1a\u6267\u884c\u4e00\u4e2asave\u547d\u4ee4,\u963b\u585e\u6240\u6709\u7684\u5ba2\u6237\u7aef,\u4e0d\u518d\u6267\u884c\u5ba2\u6237\u7aef\u6267\u884c\u53d1\u9001\u7684\u4efb\u4f55\u547d\u4ee4,\u5e76\u4e14\u5728save\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\u4e4b\u540e\u5173\u95ed\u670d\u52a1\u5668","title":"shutdown\uff1a"},{"location":"cs/db/redis/cjh/#_2","text":"SAVE\u547d\u4ee4\u5e76\u4e0d\u5e38\u7528,\u4f7f\u7528SAVE\u547d\u4ee4\u5728\u5feb\u7167\u521b\u5efa\u5b8c\u6bd5\u4e4b\u524d,redis\u5904\u4e8e\u963b\u585e\u72b6\u6001,\u65e0\u6cd5\u5bf9\u5916\u670d\u52a1 \u5982\u679c\u7528\u6237\u5728redis.conf\u4e2d\u8bbe\u7f6e\u4e86save\u914d\u7f6e\u9009\u9879,redis\u4f1a\u5728save\u9009\u9879\u6761\u4ef6\u6ee1\u8db3\u4e4b\u540e\u81ea\u52a8\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4,\u5982\u679c\u8bbe\u7f6e\u591a\u4e2asave\u914d\u7f6e\u9009\u9879,\u5f53\u4efb\u610f\u4e00\u4e2asave\u914d\u7f6e\u9009\u9879\u6761\u4ef6\u6ee1\u8db3,redis\u4e5f\u4f1a\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4","title":"\u6ce8\u610f:"},{"location":"cs/db/redis/cjh/#_3","text":"RDB\u6587\u4ef6\u7d27\u51d1\uff0c\u5168\u91cf\u5907\u4efd\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u8fdb\u884c\u5907\u4efd\u548c\u707e\u96be\u6062\u590d\u3002 \u751f\u6210RDB\u6587\u4ef6\u7684\u65f6\u5019\uff0credis\u4e3b\u8fdb\u7a0b\u4f1afork()\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u6765\u5904\u7406\u6240\u6709\u4fdd\u5b58\u5de5\u4f5c\uff0c\u4e3b\u8fdb\u7a0b\u4e0d\u9700\u8981\u8fdb\u884c\u4efb\u4f55\u78c1\u76d8IO\u64cd\u4f5c\u3002 RDB \u5728\u6062\u590d\u5927\u6570\u636e\u96c6\u65f6\u7684\u901f\u5ea6\u6bd4 AOF \u7684\u6062\u590d\u901f\u5ea6\u8981\u5feb\u3002","title":"\u4f18\u70b9"},{"location":"cs/db/redis/cjh/#_4","text":"\u9700\u8981\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fdb\u7a0b\u64cd\u4f5c\uff01\u5982\u679credis\u610f\u5916\u5b95\u673a\u4e86\uff0c\u8fd9\u4e2a\u6700\u540e\u4e00\u6b21\u4fee\u6539\u6570\u636e\u5c31\u6ca1\u6709\u7684\u4e86\uff01 fork\u8fdb\u7a0b\u7684\u65f6\u5019\uff0c\u4f1a\u5360\u7528\u4e00\u5b9a\u7684\u5185\u5bb9\u7a7a\u95f4\uff01\uff01","title":"\u7f3a\u70b9"},{"location":"cs/db/redis/cjh/#rdb_1","text":"save\u7684\u89c4\u5219\u6ee1\u8db3\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u89e6\u53d1rdb\u89c4\u5219 \u6267\u884c flushall \u547d\u4ee4\uff0c\u4e5f\u4f1a\u89e6\u53d1\u6211\u4eec\u7684rdb\u89c4\u5219\uff01 \u9000\u51faredis\uff0c\u4e5f\u4f1a\u4ea7\u751f rdb \u6587\u4ef6\uff01","title":"RDB\u89e6\u53d1\u673a\u5236"},{"location":"cs/db/redis/cjh/#_5","text":"\u4fee\u6539\u751f\u6210\u5feb\u7167\u540d\u79f0 dbfilename dump.rdb \u4fee\u6539\u751f\u6210\u4f4d\u7f6e dir ./","title":"\u914d\u7f6e\u751f\u6210\u5feb\u7167\u540d\u79f0\u548c\u4f4d\u7f6e"},{"location":"cs/db/redis/cjh/#rdb_2","text":"\u53ea\u9700\u8981\u5c06rdb\u6587\u4ef6\u653e\u5728redis\u542f\u52a8\u76ee\u5f55\u4e2d\uff0credis\u542f\u52a8\u65f6\u81ea\u52a8\u68c0\u67e5dump.rdb\u6062\u590d\u5176\u4e2d\u7684\u6570\u636e\u3002 \u67e5\u770b\u5176\u5b58\u5728\u7684\u4f4d\u7f6e \u5982\u679c/var/lib/redis\u8fd9\u4e2a\u76ee\u5f55\u5b58\u5728dump.rdb\u6587\u4ef6\uff0c\u5219\u542f\u52a8\u65f6\u81ea\u52a8\u6062\u590d\u6570\u636e\u3002","title":"\u6062\u590drdb\u6587\u4ef6"},{"location":"cs/db/redis/cjh/#aof","text":"Append Only File \u5c06\u6211\u4eec\u6240\u6709\u7684\u547d\u4ee4\u90fd\u8bb0\u5f55\u4e0b\u6765\uff0chistory\uff0c\u6062\u590d\u7684\u65f6\u5019\u5c31\u628a\u8fd9\u4e2a\u6587\u4ef6\u5168\u90e8\u518d\u6267\u884c\u4e00\u904d","title":"AOF"},{"location":"cs/db/redis/cjh/#aof_1","text":"\u5feb\u7167\u529f\u80fd\uff08RDB\uff09\u5e76\u4e0d\u662f\u975e\u5e38\u8010\u4e45\uff08durable\uff09\uff1a \u5982\u679c Redis \u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u800c\u9020\u6210\u6545\u969c\u505c\u673a\uff0c \u90a3\u4e48\u670d\u52a1\u5668\u5c06\u4e22\u5931\u6700\u8fd1\u5199\u5165\u3001\u4ee5\u53ca\u672a\u4fdd\u5b58\u5230\u5feb\u7167\u4e2d\u7684\u90a3\u4e9b\u6570\u636e\u3002 \u4ece 1.1 \u7248\u672c\u5f00\u59cb\uff0c Redis \u589e\u52a0\u4e86\u4e00\u79cd\u5b8c\u5168\u8010\u4e45\u7684\u6301\u4e45\u5316\u65b9\u5f0f\uff1a AOF \u6301\u4e45\u5316\u3002","title":"\u4ec0\u4e48\u662fAOF"},{"location":"cs/db/redis/cjh/#_6","text":"\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u6240\u6709\u5ba2\u6237\u7aef\u6267\u884c\u7684\u5199\u547d\u4ee4\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d,AOF\u6301\u4e45\u5316\u4f1a\u5c06\u88ab\u6267\u884c\u7684\u5199\u547d\u4ee4\u5199\u5230AOF\u7684\u6587\u4ef6\u672b\u5c3e,\u4ee5\u6b64\u6765\u8bb0\u5f55\u6570\u636e\u53d1\u751f\u7684\u53d8\u5316,\u56e0\u6b64\u53ea\u8981redis\u4ece\u5934\u5230\u5c3e\u6267\u884c\u4e00\u6b21AOF\u6587\u4ef6\u6240\u5305\u542b\u7684\u6240\u6709\u5199\u547d\u4ee4,\u5c31\u53ef\u4ee5\u6062\u590dAOF\u6587\u4ef6\u7684\u8bb0\u5f55\u7684\u6570\u636e\u96c6.","title":"\u7279\u70b9"},{"location":"cs/db/redis/cjh/#aof_2","text":"\u5728redis\u7684\u9ed8\u8ba4\u914d\u7f6e\u4e2dAOF\u6301\u4e45\u5316\u673a\u5236\u662f\u6ca1\u6709\u5f00\u542f\u7684\uff0c\u9700\u8981\u5728\u914d\u7f6e\u4e2d\u5f00\u542f appendonly no yes\u5219\u8868\u793a\u542f\u7528AOF \u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u914d\u7f6e\uff0c\u7136\u540e\u91cd\u542fredis\uff0c\u5c31\u53ef\u4ee5\u751f\u6548\u4e86\uff01 \u5982\u679c\u8fd9\u4e2aaof\u6587\u4ef6\u6709\u9519\u4f4d\uff0c\u8fd9\u65f6\u5019redis\u662f\u542f\u52a8\u4e0d\u8d77\u6765\u7684\uff0c\u6211\u9700\u8981\u4fee\u6539\u8fd9\u4e2aaof\u6587\u4ef6 redis\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5de5\u5177redis-check-aof --fix","title":"\u5f00\u542fAOF\u6301\u4e45\u5316"},{"location":"cs/db/redis/cjh/#_7","text":"\u4fee\u6539\u65e5\u5fd7\u540c\u6b65\u9891\u7387 - \u4fee\u6539appendfsync everysec | always | no \u6307\u5b9a","title":"\u65e5\u5fd7\u8ffd\u52a0\u9891\u7387"},{"location":"cs/db/redis/cjh/#aof_3","text":"","title":"AOF\u6587\u4ef6\u7684\u91cd\u5199"},{"location":"cs/db/redis/cjh/#aof_4","text":"AOF\u7684\u65b9\u5f0f\u4e5f\u540c\u65f6\u5e26\u6765\u4e86\u53e6\u4e00\u4e2a\u95ee\u9898\u3002\u6301\u4e45\u5316\u6587\u4ef6\u4f1a\u53d8\u7684\u8d8a\u6765\u8d8a\u5927\u3002\u4f8b\u5982\u6211\u4eec\u8c03\u7528incr test\u547d\u4ee4100\u6b21\uff0c\u6587\u4ef6\u4e2d\u5fc5\u987b\u4fdd\u5b58\u5168\u90e8\u7684100\u6761\u547d\u4ee4\uff0c\u5176\u5b9e\u670999\u6761\u90fd\u662f\u591a\u4f59\u7684\u3002\u56e0\u4e3a\u8981\u6062\u590d\u6570\u636e\u5e93\u7684\u72b6\u6001\u5176\u5b9e\u6587\u4ef6\u4e2d\u4fdd\u5b58\u4e00\u6761set test 100\u5c31\u591f\u4e86\u3002\u4e3a\u4e86\u538b\u7f29aof\u7684\u6301\u4e45\u5316\u6587\u4ef6Redis\u63d0\u4f9b\u4e86AOF\u91cd\u5199(ReWriter)\u673a\u5236\u3002","title":"AOF\u5e26\u6765\u7684\u95ee\u9898"},{"location":"cs/db/redis/cjh/#aof_5","text":"\u7528\u6765\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u51cf\u5c0fAOF\u6587\u4ef6\u7684\u4f53\u79ef","title":"AOF\u91cd\u5199"},{"location":"cs/db/redis/cjh/#_8","text":"# 1.\u5ba2\u6237\u7aef\u65b9\u5f0f\u89e6\u53d1\u91cd\u5199 - \u6267\u884cBGREWRITEAOF\u547d\u4ee4 \u4e0d\u4f1a\u963b\u585eredis\u7684\u670d\u52a1 # 2.\u670d\u52a1\u5668\u914d\u7f6e\u65b9\u5f0f\u81ea\u52a8\u89e6\u53d1 - \u914d\u7f6eredis.conf\u4e2d\u7684auto-aof-rewrite-percentage\u9009\u9879 \u53c2\u52a0\u4e0b\u56fe\u2193\u2193\u2193 - \u5982\u679c\u8bbe\u7f6eauto-aof-rewrite-percentage\u503c\u4e3a100\u548cauto-aof-rewrite-min-size 64mb,\u5e76\u4e14\u542f\u7528\u7684AOF\u6301\u4e45\u5316\u65f6,\u90a3\u4e48\u5f53AOF\u6587\u4ef6\u4f53\u79ef\u5927\u4e8e64M,\u5e76\u4e14AOF\u6587\u4ef6\u7684\u4f53\u79ef\u6bd4\u4e0a\u4e00\u6b21\u91cd\u5199\u4e4b\u540e\u4f53\u79ef\u5927\u4e86\u81f3\u5c11\u4e00\u500d ( 100 % ) \u65f6,\u4f1a\u81ea\u52a8\u89e6\u53d1,\u5982\u679c\u91cd\u5199\u8fc7\u4e8e\u9891\u7e41,\u7528\u6237\u53ef\u4ee5\u8003\u8651\u5c06auto-aof-rewrite-percentage\u8bbe\u7f6e\u4e3a\u66f4\u5927","title":"\u89e6\u53d1\u673a\u5236"},{"location":"cs/db/redis/cjh/#_9","text":"\u6ce8\u610f\uff1a\u91cd\u5199aof\u6587\u4ef6\u7684\u64cd\u4f5c\uff0c\u5e76\u6ca1\u6709\u8bfb\u53d6\u65e7\u7684aof\u6587\u4ef6\uff0c\u800c\u662f\u5c06\u6574\u4e2a\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5185\u5bb9\u7528\u547d\u4ee4\u7684\u65b9\u5f0f\u91cd\u5199\u4e86\u4e00\u4e2a\u65b0\u7684aof\u6587\u4ef6,\u66ff\u6362\u539f\u6709\u7684\u6587\u4ef6\u8fd9\u70b9\u548c\u5feb\u7167\u6709\u70b9\u7c7b\u4f3c\u3002 # \u91cd\u5199\u6d41\u7a0b - 1 . redis\u8c03\u7528fork \uff0c\u73b0\u5728\u6709\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b \u5b50\u8fdb\u7a0b\u6839\u636e\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5feb\u7167\uff0c\u5f80\u4e34\u65f6\u6587\u4ef6\u4e2d\u5199\u5165\u91cd\u5efa\u6570\u636e\u5e93\u72b6\u6001\u7684\u547d\u4ee4 - 2 . \u7236\u8fdb\u7a0b\u7ee7\u7eed\u5904\u7406client\u8bf7\u6c42\uff0c\u9664\u4e86\u628a\u5199\u547d\u4ee4\u5199\u5165\u5230\u539f\u6765\u7684aof\u6587\u4ef6\u4e2d\u3002\u540c\u65f6\u628a\u6536\u5230\u7684\u5199\u547d\u4ee4\u7f13\u5b58\u8d77\u6765\u3002\u8fd9\u6837\u5c31\u80fd\u4fdd\u8bc1\u5982\u679c\u5b50\u8fdb\u7a0b\u91cd\u5199\u5931\u8d25\u7684\u8bdd\u5e76\u4e0d\u4f1a\u51fa\u95ee\u9898\u3002 - 3 . \u5f53\u5b50\u8fdb\u7a0b\u628a\u5feb\u7167\u5185\u5bb9\u5199\u5165\u5df2\u547d\u4ee4\u65b9\u5f0f\u5199\u5230\u4e34\u65f6\u6587\u4ef6\u4e2d\u540e\uff0c\u5b50\u8fdb\u7a0b\u53d1\u4fe1\u53f7\u901a\u77e5\u7236\u8fdb\u7a0b\u3002\u7136\u540e\u7236\u8fdb\u7a0b\u628a\u7f13\u5b58\u7684\u5199\u547d\u4ee4\u4e5f\u5199\u5165\u5230\u4e34\u65f6\u6587\u4ef6\u3002 - 4 . \u73b0\u5728\u7236\u8fdb\u7a0b\u53ef\u4ee5\u4f7f\u7528\u4e34\u65f6\u6587\u4ef6\u66ff\u6362\u8001\u7684aof\u6587\u4ef6\uff0c\u5e76\u91cd\u547d\u540d\uff0c\u540e\u9762\u6536\u5230\u7684\u5199\u547d\u4ee4\u4e5f\u5f00\u59cb\u5f80\u65b0\u7684aof\u6587\u4ef6\u4e2d\u8ffd\u52a0\u3002","title":"\u91cd\u5199\u539f\u7406"},{"location":"cs/db/redis/cjh/#_10","text":"\u6bcf\u4e00\u6b21\u4fee\u6539\u90fd\u4f1a\u540c\u6b65\uff0c\u6587\u4ef6\u7684\u5b8c\u6574\u6027\u4f1a\u66f4\u52a0\u597d \u6ca1\u79d2\u540c\u6b65\u4e00\u6b21\uff0c\u53ef\u80fd\u4f1a\u4e22\u5931\u4e00\u79d2\u7684\u6570\u636e \u4ece\u4e0d\u540c\u6b65\uff0c\u6548\u7387\u6700\u9ad8","title":"\u4f18\u70b9"},{"location":"cs/db/redis/cjh/#_11","text":"\u76f8\u5bf9\u4e8e\u6570\u636e\u6587\u4ef6\u6765\u8bf4\uff0caof\u8fdc\u8fdc\u5927\u4e8erdb\uff0c\u4fee\u590d\u901f\u5ea6\u6bd4rdb\u6162\uff01 Aof\u8fd0\u884c\u6548\u7387\u4e5f\u8981\u6bd4rdb\u6162\uff0c\u6240\u4ee5\u6211\u4eecredis\u9ed8\u8ba4\u7684\u914d\u7f6e\u5c31\u662frdb\u6301\u4e45\u5316","title":"\u7f3a\u70b9"},{"location":"cs/db/redis/cjh/#_12","text":"\u4e00\u822c\u6765\u8bf4\uff0c \u5982\u679c\u60f3\u8fbe\u5230\u8db3\u4ee5\u5ab2\u7f8e PostgreSQL \u7684\u6570\u636e\u5b89\u5168\u6027\uff0c \u4f60\u5e94\u8be5\u540c\u65f6\u4f7f\u7528\u4e24\u79cd\u6301\u4e45\u5316\u529f\u80fd\u3002 \u5982\u679c\u4f60\u975e\u5e38\u5173\u5fc3\u4f60\u7684\u6570\u636e\uff0c \u4f46\u4ecd\u7136\u53ef\u4ee5\u627f\u53d7\u6570\u5206\u949f\u4ee5\u5185\u7684\u6570\u636e\u4e22\u5931\uff0c \u90a3\u4e48\u4f60\u53ef\u4ee5\u53ea\u4f7f\u7528 RDB \u6301\u4e45\u5316\u3002 \u6709\u5f88\u591a\u7528\u6237\u90fd\u53ea\u4f7f\u7528 AOF \u6301\u4e45\u5316\uff0c \u4f46\u5e76\u4e0d\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\uff1a \u56e0\u4e3a\u5b9a\u65f6\u751f\u6210 RDB \u5feb\u7167\uff08snapshot\uff09\u975e\u5e38\u4fbf\u4e8e\u8fdb\u884c\u6570\u636e\u5e93\u5907\u4efd\uff0c \u5e76\u4e14 RDB \u6062\u590d\u6570\u636e\u96c6\u7684\u901f\u5ea6\u4e5f\u8981\u6bd4 AOF \u6062\u590d\u7684\u901f\u5ea6\u8981\u5feb\u3002","title":"\u5982\u4f55\u9009\u62e9\u54ea\u79cd\u6301\u4e45\u5316\u65b9\u5f0f"},{"location":"cs/db/redis/datatype/","text":"Redis \u6570\u636e\u7c7b\u578b \u00b6 1. NoSQL \u00b6 NoSQL(Not Only SQL )\uff0c\u610f\u5373\u4e0d\u4ec5\u4ec5\u662fSQL, \u6cdb\u6307\u975e\u5173\u7cfb\u578b\u7684\u6570\u636e\u5e93\u3002Nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b,\u65e9\u671f\u5c31\u6709\u4eba\u63d0\u51fa,\u53d1\u5c55\u81f32009\u5e74\u8d8b\u52bf\u8d8a\u53d1\u9ad8\u6da8\u3002 1.1 \u5355\u673aMysql\u65f6\u4ee3 \u00b6 1.2 Memcached(\u7f13\u5b58) + Mysql + \u5782\u76f4\u62c6\u5206\uff08\u8bfb\u5199\u5206\u79bb\uff09 \u00b6 \u7f51\u7ad980%\u7684\u60c5\u51b5\u90fd\u662f\u5728\u8bfb\uff0c\u6bcf\u6b21\u90fd\u8981\u53bb\u67e5\u8be2\u6570\u636e\u5e93\u7684\u8bdd\u5c31\u5341\u5206\u7684\u9ebb\u70e6\uff01\u6240\u4ee5\u8bf4\u6211\u4eec\u5e0c\u671b\u51cf\u8f7b\u6570\u636e\u5e93\u7684\u538b\u529b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7f13\u5b58\u6765\u4fdd\u8bc1\u6548\u7387\uff01 1.3 \u5206\u5e93\u5206\u8868 + \u6c34\u5e73\u62c6\u5206 + Mysql\u96c6\u7fa4 \u00b6 1.4 \u5982\u4eca\u6700\u8fd1\u7684\u5e74\u4ee3 \u00b6 2. \u4e3a\u4ec0\u4e48\u662fNoSQL \u00b6 NoSQL = Not Only SQL\uff08\u4e0d\u4ec5\u4ec5\u662fSQL\uff09 Not Only Structured Query Language \u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u5217+\u884c\uff0c\u540c\u4e00\u4e2a\u8868\u4e0b\u6570\u636e\u7684\u7ed3\u6784\u662f\u4e00\u6837\u7684\u3002 \u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u6570\u636e\u5b58\u50a8\u6ca1\u6709\u56fa\u5b9a\u7684\u683c\u5f0f\uff0c\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u6a2a\u5411\u6269\u5c55\u3002 NoSQL\u6cdb\u6307\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u968f\u7740web2.0\u4e92\u8054\u7f51\u7684\u8bde\u751f\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5f88\u96be\u5bf9\u4ed8web2.0\u65f6\u4ee3\uff01\u5c24\u5176\u662f\u8d85\u5927\u89c4\u6a21\u7684\u9ad8\u5e76\u53d1\u7684\u793e\u533a\uff0c\u66b4\u9732\u51fa\u6765\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\uff0cNoSQL\u5728\u5f53\u4eca\u5927\u6570\u636e\u73af\u5883\u4e0b\u53d1\u5c55\u7684\u5341\u5206\u8fc5\u901f\uff0cRedis\u662f\u53d1\u5c55\u6700\u5feb\u7684\u3002 \u968f\u7740\u4e92\u8054\u7f51\u7f51\u7ad9\u7684\u5174\u8d77\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u6570\u636e\u5e93\u5728\u5e94\u4ed8\u52a8\u6001\u7f51\u7ad9\uff0c\u7279\u522b\u662f\u8d85\u5927\u89c4\u6a21\u548c\u9ad8\u5e76\u53d1\u7684\u7eaf\u52a8\u6001\u7f51\u7ad9\u5df2\u7ecf\u663e\u5f97\u529b\u4e0d\u4ece\u5fc3\uff0c\u66b4\u9732\u4e86\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\u3002\u5982\u5546\u57ce\u7f51\u7ad9\u4e2d\u5bf9 \u5546\u54c1\u6570\u636e\u9891\u7e41\u67e5\u8be2 \u3001 \u5bf9\u70ed\u641c\u5546\u54c1\u7684\u6392\u884c\u7edf\u8ba1 \u3001 \u8ba2\u5355\u8d85\u65f6\u95ee\u9898 \u3001\u4ee5\u53ca \u5fae\u4fe1\u670b\u53cb\u5708\uff08\u97f3\u9891\uff0c\u89c6\u9891\uff09\u5b58\u50a8 \u7b49\u76f8\u5173\u4f7f\u7528\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5b9e\u73b0\u5c31\u663e\u5f97\u975e\u5e38\u590d\u6742\uff0c\u867d\u7136\u80fd\u5b9e\u73b0\u76f8\u5e94\u529f\u80fd\u4f46\u662f\u5728\u6027\u80fd\u4e0a\u5374\u4e0d\u662f\u90a3\u4e48\u4e50\u89c2\u3002nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b\u7684\u51fa\u73b0\uff0c\u66f4\u597d\u7684\u89e3\u51b3\u4e86\u8fd9\u4e9b\u95ee\u9898\uff0c\u5b83\u544a\u8bc9\u4e86\u4e16\u754c\u4e0d\u4ec5\u4ec5\u662fsql\u3002 \u4e86\u89e3\uff1a3V + 3\u9ad8 \u5927\u6570\u636e\u65f6\u4ee3\u76843V \uff1a\u4e3b\u8981\u662f\u63cf\u8ff0\u95ee\u9898\u7684 \u6d77\u91cfVelume \u591a\u6837Variety \u5b9e\u65f6Velocity \u5927\u6570\u636e\u65f6\u4ee3\u76843\u9ad8 \uff1a \u4e3b\u8981\u662f\u5bf9\u7a0b\u5e8f\u7684\u8981\u6c42 \u9ad8\u5e76\u53d1 \u9ad8\u53ef\u6269 \u9ad8\u6027\u80fd 3. NoSQL\u7684\u56db\u5927\u5206\u7c7b \u00b6 3.1 \u952e\u503c(Key-Value)\u5b58\u50a8\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e: - \u8fd9\u4e00\u7c7b\u6570\u636e\u5e93\u4e3b\u8981\u4f1a\u4f7f\u7528\u5230\u4e00\u4e2a\u54c8\u5e0c\u8868\uff0c\u8fd9\u4e2a\u8868\u4e2d\u6709\u4e00\u4e2a\u7279\u5b9a\u7684\u952e\u548c\u4e00\u4e2a\u6307\u9488\u6307\u5411\u7279\u5b9a\u7684\u6570\u636e\u3002 # 2.\u7279\u70b9 - Key/value\u6a21\u578b\u5bf9\u4e8eIT\u7cfb\u7edf\u6765\u8bf4\u7684\u4f18\u52bf\u5728\u4e8e\u7b80\u5355\u3001\u6613\u90e8\u7f72\u3002 - \u4f46\u662f\u5982\u679cDBA\u53ea\u5bf9\u90e8\u5206\u503c\u8fdb\u884c\u67e5\u8be2\u6216\u66f4\u65b0\u7684\u65f6\u5019\uff0cKey/value\u5c31\u663e\u5f97\u6548\u7387\u4f4e\u4e0b\u4e86\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Tokyo Cabinet/Tyrant, - Redis - SSDB - Voldemort - Oracle BDB 3.2 \u5217\u5b58\u50a8\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e - \u8fd9\u90e8\u5206\u6570\u636e\u5e93\u901a\u5e38\u662f\u7528\u6765\u5e94\u5bf9\u5206\u5e03\u5f0f\u5b58\u50a8\u7684\u6d77\u91cf\u6570\u636e\u3002 # 2.\u7279\u70b9 - \u952e\u4ecd\u7136\u5b58\u5728\uff0c\u4f46\u662f\u5b83\u4eec\u7684\u7279\u70b9\u662f\u6307\u5411\u4e86\u591a\u4e2a\u5217\u3002\u8fd9\u4e9b\u5217\u662f\u7531\u5217\u5bb6\u65cf\u6765\u5b89\u6392\u7684\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Cassandra\u3001HBase\u3001Riak. 3.3 \u6587\u6863\u578b\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e - \u6587\u6863\u578b\u6570\u636e\u5e93\u7684\u7075\u611f\u662f\u6765\u81ea\u4e8eLotus Notes\u529e\u516c\u8f6f\u4ef6\u7684\uff0c\u800c\u4e14\u5b83\u540c\u7b2c\u4e00\u79cd\u952e\u503c\u5b58\u50a8\u76f8\u7c7b\u4f3c\u8be5\u7c7b\u578b\u7684\u6570\u636e\u6a21\u578b\u662f\u7248\u672c\u5316\u7684\u6587\u6863\uff0c\u534a\u7ed3\u6784\u5316\u7684\u6587\u6863\u4ee5\u7279\u5b9a\u7684\u683c\u5f0f\u5b58\u50a8\uff0c\u6bd4\u5982JSON\u3002\u6587\u6863\u578b\u6570\u636e\u5e93\u53ef \u4ee5\u770b\u4f5c\u662f\u952e\u503c\u6570\u636e\u5e93\u7684\u5347\u7ea7\u7248\uff0c\u5141\u8bb8\u4e4b\u95f4\u5d4c\u5957\u952e\u503c\u3002\u800c\u4e14\u6587\u6863\u578b\u6570\u636e\u5e93\u6bd4\u952e\u503c\u6570\u636e\u5e93\u7684\u67e5\u8be2\u6548\u7387\u66f4\u9ad8 # 2.\u7279\u70b9 - \u4ee5\u6587\u6863\u5f62\u5f0f\u5b58\u50a8 # 3.\u76f8\u5173\u4ea7\u54c1 - MongoDB\u3001CouchDB\u3001 MongoDb ( 4 .x ) . \u56fd\u5185\u4e5f\u6709\u6587\u6863\u578b\u6570\u636e\u5e93SequoiaDB\uff0c\u5df2\u7ecf\u5f00\u6e90\u3002 3.4 \u56fe\u5f62(Graph)\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e - \u56fe\u5f62\u7ed3\u6784\u7684\u6570\u636e\u5e93\u540c\u5176\u4ed6\u884c\u5217\u4ee5\u53ca\u521a\u6027\u7ed3\u6784\u7684SQL\u6570\u636e\u5e93\u4e0d\u540c\uff0c\u5b83\u662f\u4f7f\u7528\u7075\u6d3b\u7684\u56fe\u5f62\u6a21\u578b\uff0c\u5e76\u4e14\u80fd\u591f\u6269\u5c55\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\u3002 - NoSQL\u6570\u636e\u5e93\u6ca1\u6709\u6807\u51c6\u7684\u67e5\u8be2\u8bed\u8a00 ( SQL ) \uff0c\u56e0\u6b64\u8fdb\u884c\u6570\u636e\u5e93\u67e5\u8be2\u9700\u8981\u5236\u5b9a\u6570\u636e\u6a21\u578b\u3002\u8bb8\u591aNoSQL\u6570\u636e\u5e93\u90fd\u6709REST\u5f0f\u7684\u6570\u636e\u63a5\u53e3\u6216\u8005\u67e5\u8be2API\u3002 # 2.\u7279\u70b9 # 3.\u76f8\u5173\u4ea7\u54c1 - Neo4J\u3001InfoGrid\u3001 Infinite Graph\u3001 4. NoSQL\u5e94\u7528\u573a\u666f \u00b6 \u6570\u636e\u6a21\u578b\u6bd4\u8f83\u7b80\u5355 \u9700\u8981\u7075\u6d3b\u6027\u66f4\u5f3a\u7684IT\u7cfb\u7edf \u5bf9\u6570\u636e\u5e93\u6027\u80fd\u8981\u6c42\u8f83\u9ad8 \u4e0d\u9700\u8981\u9ad8\u5ea6\u7684\u6570\u636e\u4e00\u81f4\u6027 5. \u4ec0\u4e48\u662fRedis \u00b6 Redis \u5f00\u6e90 \u9075\u5faaBSD \u57fa\u4e8e\u5185\u5b58\u6570\u636e\u5b58\u50a8 \u88ab\u7528\u4e8e\u4f5c\u4e3a \u6570\u636e\u5e93 \u7f13\u5b58 \u6d88\u606f\u4e2d\u95f4\u4ef6 redis\u662f\u4e00\u4e2a\u5185\u5b58\u578b\u7684\u6570\u636e\u5e93 6. Redis\u7279\u70b9 \u00b6 Redis\u662f\u4e00\u4e2a\u9ad8\u6027\u80fdkey/value\u5185\u5b58\u578b\u6570\u636e\u5e93 Redis\u652f\u6301\u4e30\u5bcc\u7684\u6570\u636e\u7c7b\u578b Redis\u652f\u6301\u6301\u4e45\u5316 Redis\u5355\u7ebf\u7a0b,\u5355\u8fdb\u7a0b \u5355\u7ebf\u7a0b\u4e0d\u4e00\u5b9a\u6bd4\u591a\u7ebf\u7a0b\u6162\uff0c\u5728CPU\u4e2d\uff0c\u591a\u7ebf\u7a0b\u9700\u8981\u8df3\u8f6c\uff0c\u800c\u5355\u7ebf\u7a0b\u4e0d\u9700\u8981\uff0c\u51cf\u5c11\u4e86\u8df3\u8f6c\u7684\u6d88\u8017\uff0c\u6240\u4ee5\u5728\u67d0\u4e9b\u573a\u666f\u91cc\u5355\u7ebf\u7a0b\u53ef\u80fd\u6bd4\u591a\u7ebf\u7a0b\u5feb\u3002 7. Ridis\u5b89\u88c5 \u00b6 \u7565 8. redis\u5e38\u7528\u547d\u4ee4 \u00b6 8.1 set get\u547d\u4ee4\uff0c\u5b58\u503c\uff0c\u53d6\u503c \u00b6 8.2 \u5207\u6362\u6570\u636e\u5e93\uff0credis\u9ed8\u8ba4\u670916\u4e2a\u6570\u636e\u5e93\uff0c\u9ed8\u8ba4\u4f7f\u75280\u53f7\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7select\u5207\u6362 \u00b6 8.3 \u6e05\u7a7a\u5f53\u524d\u6570\u636e\u5e93\uff1aflushdb,\u6e05\u7a7a\u6240\u6709\u6570\u636e\u5e93\uff1aflushall \u00b6 8.4 \u67e5\u8be2\u6240\u6709key: keys* \u00b6 8.5 \u67e5\u8be2\u6570\u636e\u5e93\u7684\u5927\u5c0f\uff1adbsize \u00b6 8.6 \u67e5\u770bkey\u662f\u5426\u5b58\u5728\uff1aexists keyName,\u5b58\u5728\u8fd4\u56de1\uff0c\u5426\u5219\u8fd4\u56de0 \u00b6 8.7 \u79fb\u9664Key: move keyName 1 \u00b6 8.8 \u4e3akey\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4: expire keyName timeout \u00b6 8.9 \u67e5\u770bkey\u7684\u5269\u4f59\u5b58\u6d3b\u65f6\u95f4\uff1attl keyName \u00b6 8.10 \u67e5\u770bkey\u7684\u7c7b\u578b\uff1atype keyName \u00b6 9. String\u8be6\u89e3 \u00b6 | \u547d\u4ee4 | \u8bf4\u660e | | ------------------------- | ----------------------- | | set | \u8bbe\u7f6e\u4e00\u4e2akey/value | | get | \u6839\u636ekey\u83b7\u5f97\u5bf9\u5e94\u7684value | | mset | \u4e00\u6b21\u8bbe\u7f6e\u591a\u4e2akey value | | mget | \u4e00\u6b21\u83b7\u5f97\u591a\u4e2akey\u7684value | | getset | \u83b7\u5f97\u539f\u59cbkey\u7684\u503c\uff0c\u540c\u65f6\u8bbe\u7f6e\u65b0\u503c | | strlen | \u83b7\u5f97\u5bf9\u5e94key\u5b58\u50a8value\u7684\u957f\u5ea6 | | append | \u4e3a\u5bf9\u5e94key\u7684value\u8ffd\u52a0\u5185\u5bb9 | | getrange \u7d22\u5f150\u5f00\u59cb | \u622a\u53d6value\u7684\u5185\u5bb9 | | setex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u79d2\uff09 | | psetex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u6beb\u79d2\uff09 | | setnx | \u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c,\u4e0d\u5b58\u5728\u6dfb\u52a0 | | msetnx\u539f\u5b50\u64cd\u4f5c ( \u53ea\u8981\u6709\u4e00\u4e2a\u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c ) | \u53ef\u4ee5\u540c\u65f6\u8bbe\u7f6e\u591a\u4e2akey,\u53ea\u6709\u6709\u4e00\u4e2a\u5b58\u5728\u90fd\u4e0d\u4fdd\u5b58 | | decr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684-1\u64cd\u4f5c | | decrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u51cf\u6cd5\u64cd\u4f5c | | Incr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684+1\u64cd\u4f5c | | incrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u52a0\u6cd5\u64cd\u4f5c | | Incrbyfloat | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u52a0\u5165\u6d6e\u70b9\u6570 | 9.1 strlen:\u6c42value\u7684\u957f\u5ea6\uff0cappend\uff1a\u8ffd\u52a0 \u00b6 9.2 \u81ea\u589e,\u81ea\u51cf\u64cd\u4f5c\uff1aincr incrby decr decrby \u00b6 9.3 \u5b57\u7b26\u4e32\u7684\u8303\u56f4\u64cd\u4f5c\uff1agetrange,setrange \u00b6 9.4 \u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\uff1asetex\uff08\u5982\u679c\u5b58\u5728Key\u5219\u8986\u76d6\uff0c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\uff09\uff0csetnx(\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8bbe\u7f6e) \u00b6 9.5 \u6279\u91cf\u8bbe\u7f6e\u548c\u83b7\u53d6\u503c\uff1amset,mget, msetnx(\u64cd\u4f5c\u4e3a\u539f\u5b50\u6027\uff0c\u8981\u4e48\u90fd\u6210\u529f\uff0c\u8981\u4e48\u90fd\u5931\u8d25) \u00b6 9.6 \u5b58\u53d6\u5bf9\u8c61 \u00b6 9.7 \u7ec4\u5408\u64cd\u4f5c\uff1agetset\u5148\u83b7\u53d6\u518d\u8bbe\u7f6e,\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8fd4\u56denil \u00b6 String\u7c7b\u4f3c\u7684\u4f7f\u7528\u573a\u666f\uff1avalue\u9664\u4e86\u662f\u6211\u4eec\u7684\u5b57\u7b26\u4e32\u8fd8\u53ef\u4ee5\u662f\u6211\u4eec\u7684\u6570\u5b57\uff01 \u8ba1\u6570\u5668 \u7edf\u8ba1\u591a\u5355\u4f4d\u7684\u6570\u91cf \u7c89\u4e1d\u6570 \u5bf9\u8c61\u7f13\u5b58\u5b58\u50a8 10. list\u8be6\u89e3 \u00b6 list\u7684\u547d\u4ee4\u90fd\u662fl\u5f00\u5934,list \u5217\u8868 \u76f8\u5f53\u4e8ejava\u4e2dlist \u96c6\u5408 \u7279\u70b9 \u5143\u7d20\u6709\u5e8f \u4e14 \u53ef\u4ee5\u91cd\u590d | \u547d\u4ee4 | \u8bf4\u660e | | ------- | --------------------- | | lpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u5934\u90e8 | | lpushx | \u540clpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | rpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u672b\u5c3e | | rpushx | \u540crpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | lpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u5de6\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | rpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u53f3\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | lrange | \u83b7\u53d6\u67d0\u4e00\u4e2a\u4e0b\u6807\u533a\u95f4\u5185\u7684\u5143\u7d20 | | llen | \u83b7\u53d6\u5217\u8868\u5143\u7d20\u4e2a\u6570 | | lset | \u8bbe\u7f6e\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u7684\u503c ( \u7d22\u5f15\u5fc5\u987b\u5b58\u5728 ) | | lindex | \u83b7\u53d6\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u4f4d\u7f6e\u7684\u5143\u7d20 | | lrem | \u5220\u9664\u91cd\u590d\u5143\u7d20 | | ltrim | \u4fdd\u7559\u5217\u8868\u4e2d\u7279\u5b9a\u533a\u95f4\u5185\u7684\u5143\u7d20 | | linsert | \u5728\u67d0\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\uff0c\u4e4b\u540e\u63d2\u5165\u65b0\u5143\u7d20 | 10.1 \u5de6\u63d2\uff1alpush,\u5de6\u5220\uff1alpop \u00b6 10.2 \u53f3\u63d2\uff1arpush,\u53f3\u5220\uff1arpop \u00b6 10.3 \u83b7\u53d6\u5217\u8868\u5143\u7d20\uff1alrange \u00b6 10.4 \u901a\u8fc7\u4e0b\u6807\u83b7\u53d6\u5143\u7d20\uff1alindex \u00b6 10.5 \u83b7\u53d6\u5217\u8868\u957f\u5ea6\uff1allen \u00b6 10.6 \u79fb\u9664\u5177\u4f53\u7684\u503c\u6240\u5728\u7684\u952e\u503c\u5bf9:lrem \u5217\u8868 \u79fb\u9664\u51e0\u4e2a \u79fb\u9664\u7684\u5177\u4f53value \u00b6 10.7 \u622a\u53d6\u64cd\u4f5c\uff1altrim \u5217\u8868 \u622a\u53d6\u7684\u5f00\u59cb\u4e0b\u6807 \u622a\u53d6\u7684\u7ed3\u675f\u4e0b\u6807 \u00b6 10.8 rpoplpush:\u79fb\u9664\u5217\u8868\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u5e76\u5c06\u8fd9\u4e2a\u5143\u7d20\u653e\u5230\u4e00\u4e2a\u65b0\u7684\u5217\u8868\u4e2d \u00b6 10.9 \u5224\u65ad\u5217\u8868\u662f\u5426\u5b58\u5728\uff1aEXISTS list \u00b6 10.10 lset:\u66f4\u65b0\u5217\u8868\u4e2d\u6307\u5b9a\u4e0b\u6807\u7684\u5143\u7d20\u7684value,\u524d\u63d0\u662f\u8be5\u4e0b\u6807\u5fc5\u987b\u6709\u503c\uff0c\u5426\u5219\u62a5\u9519 \u00b6 10.11 \u5728\u5217\u8868\u4e2d\u63d2\u5165\u503c\uff1a\u524d\u63d2\u548c\u540e\u63d2\uff1alinsert \u00b6 11. set\u8be6\u89e3 \u00b6 set\u662f\u65e0\u5e8f\u4e0d\u91cd\u590d\u96c6\u5408\uff0cset\u547d\u4ee4\u90fd\u662fs\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ----------- | ------------------------- | | sadd | \u4e3a\u96c6\u5408\u6dfb\u52a0\u5143\u7d20 | | smembers | \u663e\u793a\u96c6\u5408\u4e2d\u6240\u6709\u5143\u7d20 \u65e0\u5e8f | | scard | \u8fd4\u56de\u96c6\u5408\u4e2d\u5143\u7d20\u7684\u4e2a\u6570 | | spop | \u968f\u673a\u8fd4\u56de\u4e00\u4e2a\u5143\u7d20 \u5e76\u5c06\u5143\u7d20\u5728\u96c6\u5408\u4e2d\u5220\u9664 | | smove | \u4ece\u4e00\u4e2a\u96c6\u5408\u4e2d\u5411\u53e6\u4e00\u4e2a\u96c6\u5408\u79fb\u52a8\u5143\u7d20 \u5fc5\u987b\u662f\u540c\u4e00\u79cd\u7c7b\u578b | | srem | \u4ece\u96c6\u5408\u4e2d\u5220\u9664\u4e00\u4e2a\u5143\u7d20 | | sismember | \u5224\u65ad\u4e00\u4e2a\u96c6\u5408\u4e2d\u662f\u5426\u542b\u6709\u8fd9\u4e2a\u5143\u7d20 | | srandmember | \u968f\u673a\u8fd4\u56de\u5143\u7d20 | | sdiff | \u53bb\u6389\u7b2c\u4e00\u4e2a\u96c6\u5408\u4e2d\u5176\u5b83\u96c6\u5408\u542b\u6709\u7684\u76f8\u540c\u5143\u7d20 | | sinter | \u6c42\u4ea4\u96c6 | | sunion | \u6c42\u548c\u96c6 | 11.1 \u6dfb\u52a0\uff1asadd \u00b6 11.2 \u67e5\u770b\u6240\u6709: smembers \u00b6 11.3 \u67e5\u8be2set\u7684\u5143\u7d20\u4e2a\u6570\uff1ascard \u00b6 11.4 \u5224\u65adset\u4e2d\u662f\u5426\u5b58\u5728\u67d0\u5143\u7d20\uff1asismember \u00b6 11.5 \u79fb\u9664\u67d0\u4e2a\u5143\u7d20\uff1asrem \u00b6 11.6 \u968f\u673a\u62bd\u53d6\u4e00\u4e2a\u5143\u7d20\uff1aSRANDMEMBER \u00b6 11.7 \u968f\u673a\u79fb\u9664\u4e00\u4e2a\u5143\u7d20\uff1aspop \u00b6 11.8 \u5c06\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u5143\u7d20\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u96c6\u5408\u4e2d\uff1asmove \u00b6 11.9 \u96c6\u5408\u4e4b\u95f4\u6c42\u4ea4\u5e76\u8865\u96c6\uff1asinter sunite sdiff \u00b6 \u5dee\u96c6sdiff \u00b6 \u4ea4\u96c6sinter \u00b6 \u5e76\u96c6sunion \u00b6 12. hash\u8be6\u89e3 \u00b6 hash\u7684\u5f62\u5f0f\uff1akey filed vlaue,\u76f8\u5f53\u4e8ejava\u4e2d\u7684map\u96c6\u5408 hash\u547d\u4ee4\u90fd\u662fh\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ------------ | --------------- | | hset | \u8bbe\u7f6e\u4e00\u4e2akey/value\u5bf9 | | hget | \u83b7\u5f97\u4e00\u4e2akey\u5bf9\u5e94\u7684value | | hgetall | \u83b7\u5f97\u6240\u6709\u7684key/value\u5bf9 | | hdel | \u5220\u9664\u67d0\u4e00\u4e2akey/value\u5bf9 | | hexists | \u5224\u65ad\u4e00\u4e2akey\u662f\u5426\u5b58\u5728 | | hkeys | \u83b7\u5f97\u6240\u6709\u7684key | | hvals | \u83b7\u5f97\u6240\u6709\u7684value | | hmset | \u8bbe\u7f6e\u591a\u4e2akey/value | | hmget | \u83b7\u5f97\u591a\u4e2akey\u7684value | | hsetnx | \u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684key\u7684\u503c | | hincrby | \u4e3avalue\u8fdb\u884c\u52a0\u6cd5\u8fd0\u7b97 | | hincrbyfloat | \u4e3avalue\u52a0\u5165\u6d6e\u70b9\u503c | 12.1 \u5411hash\u4e2d\u6dfb\u52a0\u503c\uff1ahset \u00b6 12.2 \u5f97\u5230hash\u4e2d\u7684\u6307\u5b9afiled\u7684\u503c\uff1ahget \u00b6 12.3 \u5f97\u5230hash\u4e2d\u7684\u6240\u6709\u503c:hgetall \u00b6 12.4 \u6279\u91cf\u6dfb\u52a0\u548c\u83b7\u53d6\uff1ahmset hmget \u00b6 12.5 \u5220\u9664\u6307\u5b9a\u7684\u5b57\u6bb5\uff1ahdel \u00b6 12.6 \u83b7\u53d6hash\u7684\u5b57\u6bb5\u957f\u5ea6\uff1ahlen \u00b6 12.7 \u5224\u65adhash\u4e2d\u7684\u5b57\u6bb5\u662f\u5426\u5b58\u5728\uff1ahexist \u00b6 12.8 \u83b7\u53d6\u6240\u6709\u7684key(\u5b57\u6bb5)hkeys,\u83b7\u53d6\u6240\u6709\u7684value\uff1ahvals \u00b6 12.9 \u6307\u5b9a\u589e\u91cf\uff1ahincrby \u00b6 hash\u53d8\u66f4\u7684\u6570\u636e user name age,\u5c24\u5176\u662f\u662f\u7528\u6237\u4fe1\u606f\u4e4b\u7c7b\u7684\uff0c\u7ecf\u5e38\u53d8\u52a8\u7684\u4fe1\u606f\uff01 hash \u66f4\u9002\u5408\u4e8e\u5bf9\u8c61\u7684\u5b58\u50a8\uff0cString\u66f4\u52a0\u9002\u5408\u5b57\u7b26\u4e32\u5b58\u50a8\uff01 13. Zset\u8be6\u89e3 \u00b6 zset\u662f\u6709\u5e8f\u4e0d\u53ef\u91cd\u590d\u7684\u96c6\u5408,zset\u547d\u4ee4\u90fd\u662fz\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ---------------------- | -------------- | | zadd | \u6dfb\u52a0\u4e00\u4e2a\u6709\u5e8f\u96c6\u5408\u5143\u7d20 | | zcard | \u8fd4\u56de\u96c6\u5408\u7684\u5143\u7d20\u4e2a\u6570 | | zrange \u5347\u5e8f zrevrange \u964d\u5e8f | \u8fd4\u56de\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrangebyscore | \u6309\u7167\u5206\u6570\u67e5\u627e\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrank | \u8fd4\u56de\u6392\u540d | | zrevrank | \u5012\u5e8f\u6392\u540d | | zscore | \u663e\u793a\u67d0\u4e00\u4e2a\u5143\u7d20\u7684\u5206\u6570 | | zrem | \u79fb\u9664\u67d0\u4e00\u4e2a\u5143\u7d20 | | zincrby | \u7ed9\u67d0\u4e2a\u7279\u5b9a\u5143\u7d20\u52a0\u5206 | 13.1 \u6dfb\u52a0\u6570\u636e\uff1azadd \u00b6 13.2 \u83b7\u53d6\u6240\u6709\u503c,\u6309\u7167\u7d22\u5f15\u83b7\u53d6\uff1azrange \u00b6 13.3 \u83b7\u53d6\u6240\u6709\u503c\uff0c\u6309\u7167score\u83b7\u53d6\uff1azrangebyscore \u00b6 13.4 \u79fb\u9664\u5143\u7d20\uff1azrem \u00b6 13.5 \u5f97\u5230\u5143\u7d20\u7684\u4e2a\u6570:zcard \u00b6 13.6 \u83b7\u53d6\u6307\u5b9a\u533a\u95f4\u7684\u6210\u5458\u6570\u91cf\uff1azcount \u00b6 ZSET \u5b98\u65b9 \u53ef\u6392\u5e8fSET sortSet 14. geospatial \u00b6 15. bitmaps \u00b6 bitmap\u5373\u4f4d\u5b58\u50a8\uff0c\u9002\u7528\u4e8e\u53ea\u6709\u4e24\u9762\u6027\u7684\u5185\u5bb9\u3002\u5982\uff1a\u53ef\u4ee5\u7528bitmap\u5b58\u50a8\u7528\u6237\u662f\u5426\u767b\u5f55\uff0c\u662f\u5426\u6ce8\u518c\uff0c\u662f\u5426\u6253\u5361\u7b49\u7b49\u3002bitmap\u7684\u503c\u53ea\u67090\u548c1\u4e24\u4e2a\u503c\u3002 15.1 \u5b58\u50a8\u6570\u636e\uff1asetbit \u00b6 15.2 \u83b7\u53d6\u6307\u5b9a\u4e0b\u6807\u7684\u503c\uff1agetbit \u00b6 15.3 \u7edf\u8ba1bitmap\u4e2d1\u7684\u4f4d\u6570\uff1abitcount \u00b6 16. hyperloglogs \u00b6 \u7528\u4e8e\u7edf\u8ba1\u57fa\u6570\uff08\u5373\u4e0d\u91cd\u590d\u7684\u6570\u636e\uff09,\u53ef\u4ee5\u7528\u4e8e\u7edf\u8ba1\u7f51\u9875\u8bbf\u95ee\u91cf 16.1 \u6dfb\u52a0\uff1apfadd \u00b6 16.2 \u8ba1\u6570\uff1apfcount \u00b6 16.3 \u5408\u5e76\uff1apfmerge \u00b6","title":"\u6570\u636e\u7c7b\u578b"},{"location":"cs/db/redis/datatype/#redis","text":"","title":"Redis \u6570\u636e\u7c7b\u578b"},{"location":"cs/db/redis/datatype/#1-nosql","text":"NoSQL(Not Only SQL )\uff0c\u610f\u5373\u4e0d\u4ec5\u4ec5\u662fSQL, \u6cdb\u6307\u975e\u5173\u7cfb\u578b\u7684\u6570\u636e\u5e93\u3002Nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b,\u65e9\u671f\u5c31\u6709\u4eba\u63d0\u51fa,\u53d1\u5c55\u81f32009\u5e74\u8d8b\u52bf\u8d8a\u53d1\u9ad8\u6da8\u3002","title":"1. NoSQL"},{"location":"cs/db/redis/datatype/#11-mysql","text":"","title":"1.1 \u5355\u673aMysql\u65f6\u4ee3"},{"location":"cs/db/redis/datatype/#12-memcached-mysql","text":"\u7f51\u7ad980%\u7684\u60c5\u51b5\u90fd\u662f\u5728\u8bfb\uff0c\u6bcf\u6b21\u90fd\u8981\u53bb\u67e5\u8be2\u6570\u636e\u5e93\u7684\u8bdd\u5c31\u5341\u5206\u7684\u9ebb\u70e6\uff01\u6240\u4ee5\u8bf4\u6211\u4eec\u5e0c\u671b\u51cf\u8f7b\u6570\u636e\u5e93\u7684\u538b\u529b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7f13\u5b58\u6765\u4fdd\u8bc1\u6548\u7387\uff01","title":"1.2 Memcached(\u7f13\u5b58) + Mysql + \u5782\u76f4\u62c6\u5206\uff08\u8bfb\u5199\u5206\u79bb\uff09"},{"location":"cs/db/redis/datatype/#13-mysql","text":"","title":"1.3 \u5206\u5e93\u5206\u8868 + \u6c34\u5e73\u62c6\u5206 + Mysql\u96c6\u7fa4"},{"location":"cs/db/redis/datatype/#14","text":"","title":"1.4 \u5982\u4eca\u6700\u8fd1\u7684\u5e74\u4ee3"},{"location":"cs/db/redis/datatype/#2-nosql","text":"NoSQL = Not Only SQL\uff08\u4e0d\u4ec5\u4ec5\u662fSQL\uff09 Not Only Structured Query Language \u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u5217+\u884c\uff0c\u540c\u4e00\u4e2a\u8868\u4e0b\u6570\u636e\u7684\u7ed3\u6784\u662f\u4e00\u6837\u7684\u3002 \u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u6570\u636e\u5b58\u50a8\u6ca1\u6709\u56fa\u5b9a\u7684\u683c\u5f0f\uff0c\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u6a2a\u5411\u6269\u5c55\u3002 NoSQL\u6cdb\u6307\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u968f\u7740web2.0\u4e92\u8054\u7f51\u7684\u8bde\u751f\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5f88\u96be\u5bf9\u4ed8web2.0\u65f6\u4ee3\uff01\u5c24\u5176\u662f\u8d85\u5927\u89c4\u6a21\u7684\u9ad8\u5e76\u53d1\u7684\u793e\u533a\uff0c\u66b4\u9732\u51fa\u6765\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\uff0cNoSQL\u5728\u5f53\u4eca\u5927\u6570\u636e\u73af\u5883\u4e0b\u53d1\u5c55\u7684\u5341\u5206\u8fc5\u901f\uff0cRedis\u662f\u53d1\u5c55\u6700\u5feb\u7684\u3002 \u968f\u7740\u4e92\u8054\u7f51\u7f51\u7ad9\u7684\u5174\u8d77\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u6570\u636e\u5e93\u5728\u5e94\u4ed8\u52a8\u6001\u7f51\u7ad9\uff0c\u7279\u522b\u662f\u8d85\u5927\u89c4\u6a21\u548c\u9ad8\u5e76\u53d1\u7684\u7eaf\u52a8\u6001\u7f51\u7ad9\u5df2\u7ecf\u663e\u5f97\u529b\u4e0d\u4ece\u5fc3\uff0c\u66b4\u9732\u4e86\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\u3002\u5982\u5546\u57ce\u7f51\u7ad9\u4e2d\u5bf9 \u5546\u54c1\u6570\u636e\u9891\u7e41\u67e5\u8be2 \u3001 \u5bf9\u70ed\u641c\u5546\u54c1\u7684\u6392\u884c\u7edf\u8ba1 \u3001 \u8ba2\u5355\u8d85\u65f6\u95ee\u9898 \u3001\u4ee5\u53ca \u5fae\u4fe1\u670b\u53cb\u5708\uff08\u97f3\u9891\uff0c\u89c6\u9891\uff09\u5b58\u50a8 \u7b49\u76f8\u5173\u4f7f\u7528\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5b9e\u73b0\u5c31\u663e\u5f97\u975e\u5e38\u590d\u6742\uff0c\u867d\u7136\u80fd\u5b9e\u73b0\u76f8\u5e94\u529f\u80fd\u4f46\u662f\u5728\u6027\u80fd\u4e0a\u5374\u4e0d\u662f\u90a3\u4e48\u4e50\u89c2\u3002nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b\u7684\u51fa\u73b0\uff0c\u66f4\u597d\u7684\u89e3\u51b3\u4e86\u8fd9\u4e9b\u95ee\u9898\uff0c\u5b83\u544a\u8bc9\u4e86\u4e16\u754c\u4e0d\u4ec5\u4ec5\u662fsql\u3002 \u4e86\u89e3\uff1a3V + 3\u9ad8 \u5927\u6570\u636e\u65f6\u4ee3\u76843V \uff1a\u4e3b\u8981\u662f\u63cf\u8ff0\u95ee\u9898\u7684 \u6d77\u91cfVelume \u591a\u6837Variety \u5b9e\u65f6Velocity \u5927\u6570\u636e\u65f6\u4ee3\u76843\u9ad8 \uff1a \u4e3b\u8981\u662f\u5bf9\u7a0b\u5e8f\u7684\u8981\u6c42 \u9ad8\u5e76\u53d1 \u9ad8\u53ef\u6269 \u9ad8\u6027\u80fd","title":"2. \u4e3a\u4ec0\u4e48\u662fNoSQL"},{"location":"cs/db/redis/datatype/#3-nosql","text":"","title":"3. NoSQL\u7684\u56db\u5927\u5206\u7c7b"},{"location":"cs/db/redis/datatype/#31-key-value","text":"# 1.\u8bf4\u660e: - \u8fd9\u4e00\u7c7b\u6570\u636e\u5e93\u4e3b\u8981\u4f1a\u4f7f\u7528\u5230\u4e00\u4e2a\u54c8\u5e0c\u8868\uff0c\u8fd9\u4e2a\u8868\u4e2d\u6709\u4e00\u4e2a\u7279\u5b9a\u7684\u952e\u548c\u4e00\u4e2a\u6307\u9488\u6307\u5411\u7279\u5b9a\u7684\u6570\u636e\u3002 # 2.\u7279\u70b9 - Key/value\u6a21\u578b\u5bf9\u4e8eIT\u7cfb\u7edf\u6765\u8bf4\u7684\u4f18\u52bf\u5728\u4e8e\u7b80\u5355\u3001\u6613\u90e8\u7f72\u3002 - \u4f46\u662f\u5982\u679cDBA\u53ea\u5bf9\u90e8\u5206\u503c\u8fdb\u884c\u67e5\u8be2\u6216\u66f4\u65b0\u7684\u65f6\u5019\uff0cKey/value\u5c31\u663e\u5f97\u6548\u7387\u4f4e\u4e0b\u4e86\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Tokyo Cabinet/Tyrant, - Redis - SSDB - Voldemort - Oracle BDB","title":"3.1 \u952e\u503c(Key-Value)\u5b58\u50a8\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#32","text":"# 1.\u8bf4\u660e - \u8fd9\u90e8\u5206\u6570\u636e\u5e93\u901a\u5e38\u662f\u7528\u6765\u5e94\u5bf9\u5206\u5e03\u5f0f\u5b58\u50a8\u7684\u6d77\u91cf\u6570\u636e\u3002 # 2.\u7279\u70b9 - \u952e\u4ecd\u7136\u5b58\u5728\uff0c\u4f46\u662f\u5b83\u4eec\u7684\u7279\u70b9\u662f\u6307\u5411\u4e86\u591a\u4e2a\u5217\u3002\u8fd9\u4e9b\u5217\u662f\u7531\u5217\u5bb6\u65cf\u6765\u5b89\u6392\u7684\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Cassandra\u3001HBase\u3001Riak.","title":"3.2 \u5217\u5b58\u50a8\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#33","text":"# 1.\u8bf4\u660e - \u6587\u6863\u578b\u6570\u636e\u5e93\u7684\u7075\u611f\u662f\u6765\u81ea\u4e8eLotus Notes\u529e\u516c\u8f6f\u4ef6\u7684\uff0c\u800c\u4e14\u5b83\u540c\u7b2c\u4e00\u79cd\u952e\u503c\u5b58\u50a8\u76f8\u7c7b\u4f3c\u8be5\u7c7b\u578b\u7684\u6570\u636e\u6a21\u578b\u662f\u7248\u672c\u5316\u7684\u6587\u6863\uff0c\u534a\u7ed3\u6784\u5316\u7684\u6587\u6863\u4ee5\u7279\u5b9a\u7684\u683c\u5f0f\u5b58\u50a8\uff0c\u6bd4\u5982JSON\u3002\u6587\u6863\u578b\u6570\u636e\u5e93\u53ef \u4ee5\u770b\u4f5c\u662f\u952e\u503c\u6570\u636e\u5e93\u7684\u5347\u7ea7\u7248\uff0c\u5141\u8bb8\u4e4b\u95f4\u5d4c\u5957\u952e\u503c\u3002\u800c\u4e14\u6587\u6863\u578b\u6570\u636e\u5e93\u6bd4\u952e\u503c\u6570\u636e\u5e93\u7684\u67e5\u8be2\u6548\u7387\u66f4\u9ad8 # 2.\u7279\u70b9 - \u4ee5\u6587\u6863\u5f62\u5f0f\u5b58\u50a8 # 3.\u76f8\u5173\u4ea7\u54c1 - MongoDB\u3001CouchDB\u3001 MongoDb ( 4 .x ) . \u56fd\u5185\u4e5f\u6709\u6587\u6863\u578b\u6570\u636e\u5e93SequoiaDB\uff0c\u5df2\u7ecf\u5f00\u6e90\u3002","title":"3.3 \u6587\u6863\u578b\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#34-graph","text":"# 1.\u8bf4\u660e - \u56fe\u5f62\u7ed3\u6784\u7684\u6570\u636e\u5e93\u540c\u5176\u4ed6\u884c\u5217\u4ee5\u53ca\u521a\u6027\u7ed3\u6784\u7684SQL\u6570\u636e\u5e93\u4e0d\u540c\uff0c\u5b83\u662f\u4f7f\u7528\u7075\u6d3b\u7684\u56fe\u5f62\u6a21\u578b\uff0c\u5e76\u4e14\u80fd\u591f\u6269\u5c55\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\u3002 - NoSQL\u6570\u636e\u5e93\u6ca1\u6709\u6807\u51c6\u7684\u67e5\u8be2\u8bed\u8a00 ( SQL ) \uff0c\u56e0\u6b64\u8fdb\u884c\u6570\u636e\u5e93\u67e5\u8be2\u9700\u8981\u5236\u5b9a\u6570\u636e\u6a21\u578b\u3002\u8bb8\u591aNoSQL\u6570\u636e\u5e93\u90fd\u6709REST\u5f0f\u7684\u6570\u636e\u63a5\u53e3\u6216\u8005\u67e5\u8be2API\u3002 # 2.\u7279\u70b9 # 3.\u76f8\u5173\u4ea7\u54c1 - Neo4J\u3001InfoGrid\u3001 Infinite Graph\u3001","title":"3.4 \u56fe\u5f62(Graph)\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#4-nosql","text":"\u6570\u636e\u6a21\u578b\u6bd4\u8f83\u7b80\u5355 \u9700\u8981\u7075\u6d3b\u6027\u66f4\u5f3a\u7684IT\u7cfb\u7edf \u5bf9\u6570\u636e\u5e93\u6027\u80fd\u8981\u6c42\u8f83\u9ad8 \u4e0d\u9700\u8981\u9ad8\u5ea6\u7684\u6570\u636e\u4e00\u81f4\u6027","title":"4. NoSQL\u5e94\u7528\u573a\u666f"},{"location":"cs/db/redis/datatype/#5-redis","text":"Redis \u5f00\u6e90 \u9075\u5faaBSD \u57fa\u4e8e\u5185\u5b58\u6570\u636e\u5b58\u50a8 \u88ab\u7528\u4e8e\u4f5c\u4e3a \u6570\u636e\u5e93 \u7f13\u5b58 \u6d88\u606f\u4e2d\u95f4\u4ef6 redis\u662f\u4e00\u4e2a\u5185\u5b58\u578b\u7684\u6570\u636e\u5e93","title":"5. \u4ec0\u4e48\u662fRedis"},{"location":"cs/db/redis/datatype/#6-redis","text":"Redis\u662f\u4e00\u4e2a\u9ad8\u6027\u80fdkey/value\u5185\u5b58\u578b\u6570\u636e\u5e93 Redis\u652f\u6301\u4e30\u5bcc\u7684\u6570\u636e\u7c7b\u578b Redis\u652f\u6301\u6301\u4e45\u5316 Redis\u5355\u7ebf\u7a0b,\u5355\u8fdb\u7a0b \u5355\u7ebf\u7a0b\u4e0d\u4e00\u5b9a\u6bd4\u591a\u7ebf\u7a0b\u6162\uff0c\u5728CPU\u4e2d\uff0c\u591a\u7ebf\u7a0b\u9700\u8981\u8df3\u8f6c\uff0c\u800c\u5355\u7ebf\u7a0b\u4e0d\u9700\u8981\uff0c\u51cf\u5c11\u4e86\u8df3\u8f6c\u7684\u6d88\u8017\uff0c\u6240\u4ee5\u5728\u67d0\u4e9b\u573a\u666f\u91cc\u5355\u7ebf\u7a0b\u53ef\u80fd\u6bd4\u591a\u7ebf\u7a0b\u5feb\u3002","title":"6. Redis\u7279\u70b9"},{"location":"cs/db/redis/datatype/#7-ridis","text":"\u7565","title":"7. Ridis\u5b89\u88c5"},{"location":"cs/db/redis/datatype/#8-redis","text":"","title":"8. redis\u5e38\u7528\u547d\u4ee4"},{"location":"cs/db/redis/datatype/#81-set-get","text":"","title":"8.1 set get\u547d\u4ee4\uff0c\u5b58\u503c\uff0c\u53d6\u503c"},{"location":"cs/db/redis/datatype/#82-redis160select","text":"","title":"8.2 \u5207\u6362\u6570\u636e\u5e93\uff0credis\u9ed8\u8ba4\u670916\u4e2a\u6570\u636e\u5e93\uff0c\u9ed8\u8ba4\u4f7f\u75280\u53f7\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7select\u5207\u6362"},{"location":"cs/db/redis/datatype/#83-flushdbflushall","text":"","title":"8.3 \u6e05\u7a7a\u5f53\u524d\u6570\u636e\u5e93\uff1aflushdb,\u6e05\u7a7a\u6240\u6709\u6570\u636e\u5e93\uff1aflushall"},{"location":"cs/db/redis/datatype/#84-key-keys","text":"","title":"8.4 \u67e5\u8be2\u6240\u6709key: keys*"},{"location":"cs/db/redis/datatype/#85-dbsize","text":"","title":"8.5 \u67e5\u8be2\u6570\u636e\u5e93\u7684\u5927\u5c0f\uff1adbsize"},{"location":"cs/db/redis/datatype/#86-keyexists-keyname10","text":"","title":"8.6 \u67e5\u770bkey\u662f\u5426\u5b58\u5728\uff1aexists keyName,\u5b58\u5728\u8fd4\u56de1\uff0c\u5426\u5219\u8fd4\u56de0"},{"location":"cs/db/redis/datatype/#87-key-move-keyname-1","text":"","title":"8.7 \u79fb\u9664Key: move keyName 1"},{"location":"cs/db/redis/datatype/#88-key-expire-keyname-timeout","text":"","title":"8.8 \u4e3akey\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4: expire keyName timeout"},{"location":"cs/db/redis/datatype/#89-keyttl-keyname","text":"","title":"8.9 \u67e5\u770bkey\u7684\u5269\u4f59\u5b58\u6d3b\u65f6\u95f4\uff1attl keyName"},{"location":"cs/db/redis/datatype/#810-keytype-keyname","text":"","title":"8.10 \u67e5\u770bkey\u7684\u7c7b\u578b\uff1atype keyName"},{"location":"cs/db/redis/datatype/#9-string","text":"| \u547d\u4ee4 | \u8bf4\u660e | | ------------------------- | ----------------------- | | set | \u8bbe\u7f6e\u4e00\u4e2akey/value | | get | \u6839\u636ekey\u83b7\u5f97\u5bf9\u5e94\u7684value | | mset | \u4e00\u6b21\u8bbe\u7f6e\u591a\u4e2akey value | | mget | \u4e00\u6b21\u83b7\u5f97\u591a\u4e2akey\u7684value | | getset | \u83b7\u5f97\u539f\u59cbkey\u7684\u503c\uff0c\u540c\u65f6\u8bbe\u7f6e\u65b0\u503c | | strlen | \u83b7\u5f97\u5bf9\u5e94key\u5b58\u50a8value\u7684\u957f\u5ea6 | | append | \u4e3a\u5bf9\u5e94key\u7684value\u8ffd\u52a0\u5185\u5bb9 | | getrange \u7d22\u5f150\u5f00\u59cb | \u622a\u53d6value\u7684\u5185\u5bb9 | | setex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u79d2\uff09 | | psetex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u6beb\u79d2\uff09 | | setnx | \u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c,\u4e0d\u5b58\u5728\u6dfb\u52a0 | | msetnx\u539f\u5b50\u64cd\u4f5c ( \u53ea\u8981\u6709\u4e00\u4e2a\u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c ) | \u53ef\u4ee5\u540c\u65f6\u8bbe\u7f6e\u591a\u4e2akey,\u53ea\u6709\u6709\u4e00\u4e2a\u5b58\u5728\u90fd\u4e0d\u4fdd\u5b58 | | decr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684-1\u64cd\u4f5c | | decrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u51cf\u6cd5\u64cd\u4f5c | | Incr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684+1\u64cd\u4f5c | | incrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u52a0\u6cd5\u64cd\u4f5c | | Incrbyfloat | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u52a0\u5165\u6d6e\u70b9\u6570 |","title":"9. String\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#91-strlenvalueappend","text":"","title":"9.1 strlen:\u6c42value\u7684\u957f\u5ea6\uff0cappend\uff1a\u8ffd\u52a0"},{"location":"cs/db/redis/datatype/#92-incr-incrby-decr-decrby","text":"","title":"9.2 \u81ea\u589e,\u81ea\u51cf\u64cd\u4f5c\uff1aincr incrby decr decrby"},{"location":"cs/db/redis/datatype/#93-getrangesetrange","text":"","title":"9.3 \u5b57\u7b26\u4e32\u7684\u8303\u56f4\u64cd\u4f5c\uff1agetrange,setrange"},{"location":"cs/db/redis/datatype/#94-setexkeysetnx","text":"","title":"9.4 \u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\uff1asetex\uff08\u5982\u679c\u5b58\u5728Key\u5219\u8986\u76d6\uff0c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\uff09\uff0csetnx(\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8bbe\u7f6e)"},{"location":"cs/db/redis/datatype/#95-msetmget-msetnx","text":"","title":"9.5 \u6279\u91cf\u8bbe\u7f6e\u548c\u83b7\u53d6\u503c\uff1amset,mget, msetnx(\u64cd\u4f5c\u4e3a\u539f\u5b50\u6027\uff0c\u8981\u4e48\u90fd\u6210\u529f\uff0c\u8981\u4e48\u90fd\u5931\u8d25)"},{"location":"cs/db/redis/datatype/#96","text":"","title":"9.6 \u5b58\u53d6\u5bf9\u8c61"},{"location":"cs/db/redis/datatype/#97-getsetnil","text":"String\u7c7b\u4f3c\u7684\u4f7f\u7528\u573a\u666f\uff1avalue\u9664\u4e86\u662f\u6211\u4eec\u7684\u5b57\u7b26\u4e32\u8fd8\u53ef\u4ee5\u662f\u6211\u4eec\u7684\u6570\u5b57\uff01 \u8ba1\u6570\u5668 \u7edf\u8ba1\u591a\u5355\u4f4d\u7684\u6570\u91cf \u7c89\u4e1d\u6570 \u5bf9\u8c61\u7f13\u5b58\u5b58\u50a8","title":"9.7 \u7ec4\u5408\u64cd\u4f5c\uff1agetset\u5148\u83b7\u53d6\u518d\u8bbe\u7f6e,\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8fd4\u56denil"},{"location":"cs/db/redis/datatype/#10-list","text":"list\u7684\u547d\u4ee4\u90fd\u662fl\u5f00\u5934,list \u5217\u8868 \u76f8\u5f53\u4e8ejava\u4e2dlist \u96c6\u5408 \u7279\u70b9 \u5143\u7d20\u6709\u5e8f \u4e14 \u53ef\u4ee5\u91cd\u590d | \u547d\u4ee4 | \u8bf4\u660e | | ------- | --------------------- | | lpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u5934\u90e8 | | lpushx | \u540clpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | rpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u672b\u5c3e | | rpushx | \u540crpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | lpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u5de6\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | rpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u53f3\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | lrange | \u83b7\u53d6\u67d0\u4e00\u4e2a\u4e0b\u6807\u533a\u95f4\u5185\u7684\u5143\u7d20 | | llen | \u83b7\u53d6\u5217\u8868\u5143\u7d20\u4e2a\u6570 | | lset | \u8bbe\u7f6e\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u7684\u503c ( \u7d22\u5f15\u5fc5\u987b\u5b58\u5728 ) | | lindex | \u83b7\u53d6\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u4f4d\u7f6e\u7684\u5143\u7d20 | | lrem | \u5220\u9664\u91cd\u590d\u5143\u7d20 | | ltrim | \u4fdd\u7559\u5217\u8868\u4e2d\u7279\u5b9a\u533a\u95f4\u5185\u7684\u5143\u7d20 | | linsert | \u5728\u67d0\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\uff0c\u4e4b\u540e\u63d2\u5165\u65b0\u5143\u7d20 |","title":"10. list\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#101-lpushlpop","text":"","title":"10.1 \u5de6\u63d2\uff1alpush,\u5de6\u5220\uff1alpop"},{"location":"cs/db/redis/datatype/#102-rpushrpop","text":"","title":"10.2 \u53f3\u63d2\uff1arpush,\u53f3\u5220\uff1arpop"},{"location":"cs/db/redis/datatype/#103-lrange","text":"","title":"10.3 \u83b7\u53d6\u5217\u8868\u5143\u7d20\uff1alrange"},{"location":"cs/db/redis/datatype/#104-lindex","text":"","title":"10.4 \u901a\u8fc7\u4e0b\u6807\u83b7\u53d6\u5143\u7d20\uff1alindex"},{"location":"cs/db/redis/datatype/#105-llen","text":"","title":"10.5 \u83b7\u53d6\u5217\u8868\u957f\u5ea6\uff1allen"},{"location":"cs/db/redis/datatype/#106-lrem-value","text":"","title":"10.6 \u79fb\u9664\u5177\u4f53\u7684\u503c\u6240\u5728\u7684\u952e\u503c\u5bf9:lrem \u5217\u8868 \u79fb\u9664\u51e0\u4e2a \u79fb\u9664\u7684\u5177\u4f53value"},{"location":"cs/db/redis/datatype/#107-ltrim","text":"","title":"10.7 \u622a\u53d6\u64cd\u4f5c\uff1altrim \u5217\u8868 \u622a\u53d6\u7684\u5f00\u59cb\u4e0b\u6807 \u622a\u53d6\u7684\u7ed3\u675f\u4e0b\u6807"},{"location":"cs/db/redis/datatype/#108-rpoplpush","text":"","title":"10.8 rpoplpush:\u79fb\u9664\u5217\u8868\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u5e76\u5c06\u8fd9\u4e2a\u5143\u7d20\u653e\u5230\u4e00\u4e2a\u65b0\u7684\u5217\u8868\u4e2d"},{"location":"cs/db/redis/datatype/#109-exists-list","text":"","title":"10.9 \u5224\u65ad\u5217\u8868\u662f\u5426\u5b58\u5728\uff1aEXISTS list"},{"location":"cs/db/redis/datatype/#1010-lsetvalue","text":"","title":"10.10 lset:\u66f4\u65b0\u5217\u8868\u4e2d\u6307\u5b9a\u4e0b\u6807\u7684\u5143\u7d20\u7684value,\u524d\u63d0\u662f\u8be5\u4e0b\u6807\u5fc5\u987b\u6709\u503c\uff0c\u5426\u5219\u62a5\u9519"},{"location":"cs/db/redis/datatype/#1011-linsert","text":"","title":"10.11 \u5728\u5217\u8868\u4e2d\u63d2\u5165\u503c\uff1a\u524d\u63d2\u548c\u540e\u63d2\uff1alinsert"},{"location":"cs/db/redis/datatype/#11-set","text":"set\u662f\u65e0\u5e8f\u4e0d\u91cd\u590d\u96c6\u5408\uff0cset\u547d\u4ee4\u90fd\u662fs\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ----------- | ------------------------- | | sadd | \u4e3a\u96c6\u5408\u6dfb\u52a0\u5143\u7d20 | | smembers | \u663e\u793a\u96c6\u5408\u4e2d\u6240\u6709\u5143\u7d20 \u65e0\u5e8f | | scard | \u8fd4\u56de\u96c6\u5408\u4e2d\u5143\u7d20\u7684\u4e2a\u6570 | | spop | \u968f\u673a\u8fd4\u56de\u4e00\u4e2a\u5143\u7d20 \u5e76\u5c06\u5143\u7d20\u5728\u96c6\u5408\u4e2d\u5220\u9664 | | smove | \u4ece\u4e00\u4e2a\u96c6\u5408\u4e2d\u5411\u53e6\u4e00\u4e2a\u96c6\u5408\u79fb\u52a8\u5143\u7d20 \u5fc5\u987b\u662f\u540c\u4e00\u79cd\u7c7b\u578b | | srem | \u4ece\u96c6\u5408\u4e2d\u5220\u9664\u4e00\u4e2a\u5143\u7d20 | | sismember | \u5224\u65ad\u4e00\u4e2a\u96c6\u5408\u4e2d\u662f\u5426\u542b\u6709\u8fd9\u4e2a\u5143\u7d20 | | srandmember | \u968f\u673a\u8fd4\u56de\u5143\u7d20 | | sdiff | \u53bb\u6389\u7b2c\u4e00\u4e2a\u96c6\u5408\u4e2d\u5176\u5b83\u96c6\u5408\u542b\u6709\u7684\u76f8\u540c\u5143\u7d20 | | sinter | \u6c42\u4ea4\u96c6 | | sunion | \u6c42\u548c\u96c6 |","title":"11. set\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#111-sadd","text":"","title":"11.1 \u6dfb\u52a0\uff1asadd"},{"location":"cs/db/redis/datatype/#112-smembers","text":"","title":"11.2 \u67e5\u770b\u6240\u6709: smembers"},{"location":"cs/db/redis/datatype/#113-setscard","text":"","title":"11.3 \u67e5\u8be2set\u7684\u5143\u7d20\u4e2a\u6570\uff1ascard"},{"location":"cs/db/redis/datatype/#114-setsismember","text":"","title":"11.4 \u5224\u65adset\u4e2d\u662f\u5426\u5b58\u5728\u67d0\u5143\u7d20\uff1asismember"},{"location":"cs/db/redis/datatype/#115-srem","text":"","title":"11.5 \u79fb\u9664\u67d0\u4e2a\u5143\u7d20\uff1asrem"},{"location":"cs/db/redis/datatype/#116-srandmember","text":"","title":"11.6 \u968f\u673a\u62bd\u53d6\u4e00\u4e2a\u5143\u7d20\uff1aSRANDMEMBER"},{"location":"cs/db/redis/datatype/#117-spop","text":"","title":"11.7 \u968f\u673a\u79fb\u9664\u4e00\u4e2a\u5143\u7d20\uff1aspop"},{"location":"cs/db/redis/datatype/#118-smove","text":"","title":"11.8 \u5c06\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u5143\u7d20\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u96c6\u5408\u4e2d\uff1asmove"},{"location":"cs/db/redis/datatype/#119-sinter-sunite-sdiff","text":"","title":"11.9 \u96c6\u5408\u4e4b\u95f4\u6c42\u4ea4\u5e76\u8865\u96c6\uff1asinter sunite sdiff"},{"location":"cs/db/redis/datatype/#sdiff","text":"","title":"\u5dee\u96c6sdiff"},{"location":"cs/db/redis/datatype/#sinter","text":"","title":"\u4ea4\u96c6sinter"},{"location":"cs/db/redis/datatype/#sunion","text":"","title":"\u5e76\u96c6sunion"},{"location":"cs/db/redis/datatype/#12-hash","text":"hash\u7684\u5f62\u5f0f\uff1akey filed vlaue,\u76f8\u5f53\u4e8ejava\u4e2d\u7684map\u96c6\u5408 hash\u547d\u4ee4\u90fd\u662fh\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ------------ | --------------- | | hset | \u8bbe\u7f6e\u4e00\u4e2akey/value\u5bf9 | | hget | \u83b7\u5f97\u4e00\u4e2akey\u5bf9\u5e94\u7684value | | hgetall | \u83b7\u5f97\u6240\u6709\u7684key/value\u5bf9 | | hdel | \u5220\u9664\u67d0\u4e00\u4e2akey/value\u5bf9 | | hexists | \u5224\u65ad\u4e00\u4e2akey\u662f\u5426\u5b58\u5728 | | hkeys | \u83b7\u5f97\u6240\u6709\u7684key | | hvals | \u83b7\u5f97\u6240\u6709\u7684value | | hmset | \u8bbe\u7f6e\u591a\u4e2akey/value | | hmget | \u83b7\u5f97\u591a\u4e2akey\u7684value | | hsetnx | \u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684key\u7684\u503c | | hincrby | \u4e3avalue\u8fdb\u884c\u52a0\u6cd5\u8fd0\u7b97 | | hincrbyfloat | \u4e3avalue\u52a0\u5165\u6d6e\u70b9\u503c |","title":"12. hash\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#121-hashhset","text":"","title":"12.1 \u5411hash\u4e2d\u6dfb\u52a0\u503c\uff1ahset"},{"location":"cs/db/redis/datatype/#122-hashfiledhget","text":"","title":"12.2 \u5f97\u5230hash\u4e2d\u7684\u6307\u5b9afiled\u7684\u503c\uff1ahget"},{"location":"cs/db/redis/datatype/#123-hashhgetall","text":"","title":"12.3 \u5f97\u5230hash\u4e2d\u7684\u6240\u6709\u503c:hgetall"},{"location":"cs/db/redis/datatype/#124-hmset-hmget","text":"","title":"12.4 \u6279\u91cf\u6dfb\u52a0\u548c\u83b7\u53d6\uff1ahmset hmget"},{"location":"cs/db/redis/datatype/#125-hdel","text":"","title":"12.5 \u5220\u9664\u6307\u5b9a\u7684\u5b57\u6bb5\uff1ahdel"},{"location":"cs/db/redis/datatype/#126-hashhlen","text":"","title":"12.6 \u83b7\u53d6hash\u7684\u5b57\u6bb5\u957f\u5ea6\uff1ahlen"},{"location":"cs/db/redis/datatype/#127-hashhexist","text":"","title":"12.7 \u5224\u65adhash\u4e2d\u7684\u5b57\u6bb5\u662f\u5426\u5b58\u5728\uff1ahexist"},{"location":"cs/db/redis/datatype/#128-keyhkeysvaluehvals","text":"","title":"12.8 \u83b7\u53d6\u6240\u6709\u7684key(\u5b57\u6bb5)hkeys,\u83b7\u53d6\u6240\u6709\u7684value\uff1ahvals"},{"location":"cs/db/redis/datatype/#129-hincrby","text":"hash\u53d8\u66f4\u7684\u6570\u636e user name age,\u5c24\u5176\u662f\u662f\u7528\u6237\u4fe1\u606f\u4e4b\u7c7b\u7684\uff0c\u7ecf\u5e38\u53d8\u52a8\u7684\u4fe1\u606f\uff01 hash \u66f4\u9002\u5408\u4e8e\u5bf9\u8c61\u7684\u5b58\u50a8\uff0cString\u66f4\u52a0\u9002\u5408\u5b57\u7b26\u4e32\u5b58\u50a8\uff01","title":"12.9 \u6307\u5b9a\u589e\u91cf\uff1ahincrby"},{"location":"cs/db/redis/datatype/#13-zset","text":"zset\u662f\u6709\u5e8f\u4e0d\u53ef\u91cd\u590d\u7684\u96c6\u5408,zset\u547d\u4ee4\u90fd\u662fz\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ---------------------- | -------------- | | zadd | \u6dfb\u52a0\u4e00\u4e2a\u6709\u5e8f\u96c6\u5408\u5143\u7d20 | | zcard | \u8fd4\u56de\u96c6\u5408\u7684\u5143\u7d20\u4e2a\u6570 | | zrange \u5347\u5e8f zrevrange \u964d\u5e8f | \u8fd4\u56de\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrangebyscore | \u6309\u7167\u5206\u6570\u67e5\u627e\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrank | \u8fd4\u56de\u6392\u540d | | zrevrank | \u5012\u5e8f\u6392\u540d | | zscore | \u663e\u793a\u67d0\u4e00\u4e2a\u5143\u7d20\u7684\u5206\u6570 | | zrem | \u79fb\u9664\u67d0\u4e00\u4e2a\u5143\u7d20 | | zincrby | \u7ed9\u67d0\u4e2a\u7279\u5b9a\u5143\u7d20\u52a0\u5206 |","title":"13. Zset\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#131-zadd","text":"","title":"13.1 \u6dfb\u52a0\u6570\u636e\uff1azadd"},{"location":"cs/db/redis/datatype/#132-zrange","text":"","title":"13.2 \u83b7\u53d6\u6240\u6709\u503c,\u6309\u7167\u7d22\u5f15\u83b7\u53d6\uff1azrange"},{"location":"cs/db/redis/datatype/#133-scorezrangebyscore","text":"","title":"13.3 \u83b7\u53d6\u6240\u6709\u503c\uff0c\u6309\u7167score\u83b7\u53d6\uff1azrangebyscore"},{"location":"cs/db/redis/datatype/#134-zrem","text":"","title":"13.4 \u79fb\u9664\u5143\u7d20\uff1azrem"},{"location":"cs/db/redis/datatype/#135-zcard","text":"","title":"13.5 \u5f97\u5230\u5143\u7d20\u7684\u4e2a\u6570:zcard"},{"location":"cs/db/redis/datatype/#136-zcount","text":"ZSET \u5b98\u65b9 \u53ef\u6392\u5e8fSET sortSet","title":"13.6 \u83b7\u53d6\u6307\u5b9a\u533a\u95f4\u7684\u6210\u5458\u6570\u91cf\uff1azcount"},{"location":"cs/db/redis/datatype/#14-geospatial","text":"","title":"14. geospatial"},{"location":"cs/db/redis/datatype/#15-bitmaps","text":"bitmap\u5373\u4f4d\u5b58\u50a8\uff0c\u9002\u7528\u4e8e\u53ea\u6709\u4e24\u9762\u6027\u7684\u5185\u5bb9\u3002\u5982\uff1a\u53ef\u4ee5\u7528bitmap\u5b58\u50a8\u7528\u6237\u662f\u5426\u767b\u5f55\uff0c\u662f\u5426\u6ce8\u518c\uff0c\u662f\u5426\u6253\u5361\u7b49\u7b49\u3002bitmap\u7684\u503c\u53ea\u67090\u548c1\u4e24\u4e2a\u503c\u3002","title":"15. bitmaps"},{"location":"cs/db/redis/datatype/#151-setbit","text":"","title":"15.1 \u5b58\u50a8\u6570\u636e\uff1asetbit"},{"location":"cs/db/redis/datatype/#152-getbit","text":"","title":"15.2 \u83b7\u53d6\u6307\u5b9a\u4e0b\u6807\u7684\u503c\uff1agetbit"},{"location":"cs/db/redis/datatype/#153-bitmap1bitcount","text":"","title":"15.3 \u7edf\u8ba1bitmap\u4e2d1\u7684\u4f4d\u6570\uff1abitcount"},{"location":"cs/db/redis/datatype/#16-hyperloglogs","text":"\u7528\u4e8e\u7edf\u8ba1\u57fa\u6570\uff08\u5373\u4e0d\u91cd\u590d\u7684\u6570\u636e\uff09,\u53ef\u4ee5\u7528\u4e8e\u7edf\u8ba1\u7f51\u9875\u8bbf\u95ee\u91cf","title":"16. hyperloglogs"},{"location":"cs/db/redis/datatype/#161-pfadd","text":"","title":"16.1 \u6dfb\u52a0\uff1apfadd"},{"location":"cs/db/redis/datatype/#162-pfcount","text":"","title":"16.2 \u8ba1\u6570\uff1apfcount"},{"location":"cs/db/redis/datatype/#163-pfmerge","text":"","title":"16.3 \u5408\u5e76\uff1apfmerge"},{"location":"cs/db/redis/work/","text":"Redis \u4e8b\u52a1 \u00b6 redis\u7684\u4e8b\u52a1\u64cd\u4f5c \u00b6 redis\u7684\u5355\u6761\u547d\u4ee4\u4fdd\u8bc1\u539f\u5b50\u6027\uff0c\u4f46\u662fredis\u7684\u4e8b\u52a1\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027 redis\u7684\u4e8b\u52a1\u6ca1\u6709\u9694\u79bb\u7ea7\u522b\u3002redis\u4e8b\u52a1\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u7ec4\u547d\u4ee4\u7684\u96c6\u5408\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5728\u4e8b\u52a1\u4e2d\u4f1a\u88ab\u5e8f\u5217\u5316\uff0c\u7136\u540e\u6309\u7167\u547d\u4ee4\u7684\u5148\u540e\u987a\u5e8f\u4e00\u6b21\u6027\u5168\u90e8\u6267\u884c\uff0c\u5728\u6267\u884c\u7684\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u88ab\u6253\u65ad\u3002 \u5373\uff1aredis\u7684\u4e8b\u52a1\u5728\u6267\u884c\u65f6\u662f\u4e00\u6b21\u6027\uff0c\u987a\u5e8f\u6027\u548c\u6392\u4ed6\u6027\u7684 \u5f00\u542f\u4e8b\u52a1\uff1amulti \u00b6 \u547d\u4ee4\u5165\u961f: \u00b6 \u6267\u884c\u4e8b\u52a1:exec \u00b6 \u653e\u5f03\u4e8b\u52a1\uff1adiscard \u00b6 \u4e8b\u52a1\u5f02\u5e38 \u00b6 \u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u5982\u679c\u7f16\u5199\u7684\u547d\u4ee4\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u5219\u4f1a\u7acb\u5373\u62a5\u9519\uff0c\u4e14\u6574\u4e2a\u4e8b\u52a1\u961f\u5217\u4e2d\u7684\u6240\u6709\u547d\u4ee4\u90fd\u4e0d\u4f1a\u6267\u884c. \u5982\u679c\u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u547d\u4ee4\u4e2d\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u4f46\u662f\u5374\u6709\u8fd0\u884c\u9519\u8bef\uff0c\u5373\u547d\u4ee4\u80fd\u591f\u6210\u529f\u5165\u961f\uff0c\u4f46\u662f\u4e0d\u80fd\u591f\u6267\u884c\uff0c\u5219\u5728\u4e8b\u52a1\u63d0\u4ea4\u540e\u53ea\u6709\u8be5\u547d\u4ee4\u629b\u9519\uff0c\u5176\u4ed6\u547d\u4ee4\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\u3002 redis\u7684\u4e50\u89c2\u9501 \u00b6 \u4e50\u89c2\u9501\uff1a\u5c31\u662f\u5b83\u4f1a\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4e0d\u4f1a\u5931\u8d25\uff0c\u56e0\u6b64\u5b83\u4e0d\u4f1a\u7ed9\u4e8b\u52a1\u4e0a\u9501\u3002\u5b83\u53ea\u4f1a\u5728\u66f4\u65b0\u7684\u65f6\u5019\u5224\u65ad\u5728\u6b64\u671f\u95f4\u662f\u5426\u6709\u4eba\u4fee\u6539\u8fc7\u6570\u636e \u60b2\u89c2\u9501\uff1a\u5b83\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4f1a\u6267\u884c\u5931\u8d25\uff0c\u56e0\u6b64\u505a\u4efb\u4f55\u4e8b\u60c5\u5b83\u90fd\u4f1a\u52a0\u9501\uff0c\u8fd9\u6837\u662f\u53ca\u5176\u5f71\u54cd\u6548\u7387\u7684\u3002 redis\u7684\u4e50\u89c2\u9501\u5b9e\u73b0\u547d\u4ee4\uff1awatch \u00b6 \u5355\u7ebf\u7a0b\u4e0b\u8fd0\u884c \u00b6 \u591a\u7ebf\u7a0b\u4fee\u6539\u503c \u00b6 \u5982\u679c\u4e8b\u52a1\u6267\u884c\u5931\u8d25\uff0c\u9700\u8981\u5148\u89e3\u9501\uff0c\u518d\u52a0\u9501\uff0c\u89e3\u9501\u547d\u4ee4\u4e3a\uff1aunwatch \u00b6","title":"\u4e8b\u52a1"},{"location":"cs/db/redis/work/#redis","text":"","title":"Redis \u4e8b\u52a1"},{"location":"cs/db/redis/work/#redis_1","text":"redis\u7684\u5355\u6761\u547d\u4ee4\u4fdd\u8bc1\u539f\u5b50\u6027\uff0c\u4f46\u662fredis\u7684\u4e8b\u52a1\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027 redis\u7684\u4e8b\u52a1\u6ca1\u6709\u9694\u79bb\u7ea7\u522b\u3002redis\u4e8b\u52a1\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u7ec4\u547d\u4ee4\u7684\u96c6\u5408\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5728\u4e8b\u52a1\u4e2d\u4f1a\u88ab\u5e8f\u5217\u5316\uff0c\u7136\u540e\u6309\u7167\u547d\u4ee4\u7684\u5148\u540e\u987a\u5e8f\u4e00\u6b21\u6027\u5168\u90e8\u6267\u884c\uff0c\u5728\u6267\u884c\u7684\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u88ab\u6253\u65ad\u3002 \u5373\uff1aredis\u7684\u4e8b\u52a1\u5728\u6267\u884c\u65f6\u662f\u4e00\u6b21\u6027\uff0c\u987a\u5e8f\u6027\u548c\u6392\u4ed6\u6027\u7684","title":"redis\u7684\u4e8b\u52a1\u64cd\u4f5c"},{"location":"cs/db/redis/work/#multi","text":"","title":"\u5f00\u542f\u4e8b\u52a1\uff1amulti"},{"location":"cs/db/redis/work/#_1","text":"","title":"\u547d\u4ee4\u5165\u961f:"},{"location":"cs/db/redis/work/#exec","text":"","title":"\u6267\u884c\u4e8b\u52a1:exec"},{"location":"cs/db/redis/work/#discard","text":"","title":"\u653e\u5f03\u4e8b\u52a1\uff1adiscard"},{"location":"cs/db/redis/work/#_2","text":"\u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u5982\u679c\u7f16\u5199\u7684\u547d\u4ee4\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u5219\u4f1a\u7acb\u5373\u62a5\u9519\uff0c\u4e14\u6574\u4e2a\u4e8b\u52a1\u961f\u5217\u4e2d\u7684\u6240\u6709\u547d\u4ee4\u90fd\u4e0d\u4f1a\u6267\u884c. \u5982\u679c\u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u547d\u4ee4\u4e2d\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u4f46\u662f\u5374\u6709\u8fd0\u884c\u9519\u8bef\uff0c\u5373\u547d\u4ee4\u80fd\u591f\u6210\u529f\u5165\u961f\uff0c\u4f46\u662f\u4e0d\u80fd\u591f\u6267\u884c\uff0c\u5219\u5728\u4e8b\u52a1\u63d0\u4ea4\u540e\u53ea\u6709\u8be5\u547d\u4ee4\u629b\u9519\uff0c\u5176\u4ed6\u547d\u4ee4\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\u3002","title":"\u4e8b\u52a1\u5f02\u5e38"},{"location":"cs/db/redis/work/#redis_2","text":"\u4e50\u89c2\u9501\uff1a\u5c31\u662f\u5b83\u4f1a\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4e0d\u4f1a\u5931\u8d25\uff0c\u56e0\u6b64\u5b83\u4e0d\u4f1a\u7ed9\u4e8b\u52a1\u4e0a\u9501\u3002\u5b83\u53ea\u4f1a\u5728\u66f4\u65b0\u7684\u65f6\u5019\u5224\u65ad\u5728\u6b64\u671f\u95f4\u662f\u5426\u6709\u4eba\u4fee\u6539\u8fc7\u6570\u636e \u60b2\u89c2\u9501\uff1a\u5b83\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4f1a\u6267\u884c\u5931\u8d25\uff0c\u56e0\u6b64\u505a\u4efb\u4f55\u4e8b\u60c5\u5b83\u90fd\u4f1a\u52a0\u9501\uff0c\u8fd9\u6837\u662f\u53ca\u5176\u5f71\u54cd\u6548\u7387\u7684\u3002","title":"redis\u7684\u4e50\u89c2\u9501"},{"location":"cs/db/redis/work/#rediswatch","text":"","title":"redis\u7684\u4e50\u89c2\u9501\u5b9e\u73b0\u547d\u4ee4\uff1awatch"},{"location":"cs/db/redis/work/#_3","text":"","title":"\u5355\u7ebf\u7a0b\u4e0b\u8fd0\u884c"},{"location":"cs/db/redis/work/#_4","text":"","title":"\u591a\u7ebf\u7a0b\u4fee\u6539\u503c"},{"location":"cs/db/redis/work/#unwatch","text":"","title":"\u5982\u679c\u4e8b\u52a1\u6267\u884c\u5931\u8d25\uff0c\u9700\u8981\u5148\u89e3\u9501\uff0c\u518d\u52a0\u9501\uff0c\u89e3\u9501\u547d\u4ee4\u4e3a\uff1aunwatch"},{"location":"cs/hpc/","text":"\u9ad8\u6027\u80fd\u8ba1\u7b97 \u00b6 Abstract \u6211\u7684 mentor\uff08\u5927\ud83d\udc2e\uff09 \u5c31\u662f\u505a hpc \u7684\uff0c\u5f53\u521d\u5b9e\u4e60\u65f6\u4e5f\u6d89\u53ca\u5230\u4e00\u70b9\u70b9\u77e5\u8bc6\uff0c\u6240\u4ee5\u5bf9 hpc \u4e5f\u4ea7\u751f\u4e86\u4e00\u70b9\u70b9\u5174\u8da3\u3002\u867d\u7136\u8bf4\u4ee5\u540e\u5e94\u8be5\u4e0d\u4f1a\u505a hpc\uff0c\u4f46\u662f\u5b66\u4e60\u76f8\u5173\u90e8\u5206\u7684\u77e5\u8bc6\u662f\u6709\u5fc5\u8981\u7684\u3002 Table of Contents \u00b6 \u6982\u8bba \u5411\u91cf\u5316\u8ba1\u7b97 GPU \u7f16\u7a0b MPI \u57fa\u7840 OpenMP \u57fa\u7840 Reference \u00b6 HPC 101 \u8d85\u7b97\u5c0f\u5b66\u671f \u5317\u5927\u672a\u540d\u8d85\u7b97\u961f \u9ad8\u6027\u80fd\u8ba1\u7b97\u5165\u95e8 CUDA docs MPI Tutorials","title":"\u9ad8\u6027\u80fd\u8ba1\u7b97"},{"location":"cs/hpc/#_1","text":"Abstract \u6211\u7684 mentor\uff08\u5927\ud83d\udc2e\uff09 \u5c31\u662f\u505a hpc \u7684\uff0c\u5f53\u521d\u5b9e\u4e60\u65f6\u4e5f\u6d89\u53ca\u5230\u4e00\u70b9\u70b9\u77e5\u8bc6\uff0c\u6240\u4ee5\u5bf9 hpc \u4e5f\u4ea7\u751f\u4e86\u4e00\u70b9\u70b9\u5174\u8da3\u3002\u867d\u7136\u8bf4\u4ee5\u540e\u5e94\u8be5\u4e0d\u4f1a\u505a hpc\uff0c\u4f46\u662f\u5b66\u4e60\u76f8\u5173\u90e8\u5206\u7684\u77e5\u8bc6\u662f\u6709\u5fc5\u8981\u7684\u3002","title":"\u9ad8\u6027\u80fd\u8ba1\u7b97"},{"location":"cs/hpc/#table-of-contents","text":"\u6982\u8bba \u5411\u91cf\u5316\u8ba1\u7b97 GPU \u7f16\u7a0b MPI \u57fa\u7840 OpenMP \u57fa\u7840","title":"Table of Contents"},{"location":"cs/hpc/#reference","text":"HPC 101 \u8d85\u7b97\u5c0f\u5b66\u671f \u5317\u5927\u672a\u540d\u8d85\u7b97\u961f \u9ad8\u6027\u80fd\u8ba1\u7b97\u5165\u95e8 CUDA docs MPI Tutorials","title":"Reference"},{"location":"cs/hpc/gpu/","text":"GPU \u7f16\u7a0b \u00b6","title":"GPU \u7f16\u7a0b"},{"location":"cs/hpc/gpu/#gpu","text":"","title":"GPU \u7f16\u7a0b"},{"location":"cs/hpc/mpi/","text":"MPI \u57fa\u7840 \u00b6 \u7ea6 2264 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u53c2\u8003\uff1a MPI \u5e76\u884c\u7f16\u7a0b\u5165\u95e8 MPI \u7b80\u4ecb \u00b6 \u4ec0\u4e48\u662f MPI \u662f\u51fd\u6570\u5e93\u89c4\u8303\uff0c\u800c\u4e0d\u662f\u5e76\u884c\u8bed\u8a00\uff1b\u64cd\u4f5c\u5982\u540c\u5e93\u51fd\u6570\u8c03\u7528 \u2013 \u662f\u4e00\u79cd\u6807\u51c6\u548c\u89c4\u8303\uff0c\u800c\u975e\u67d0\u4e2a\u5bf9\u5b83\u7684\u5177\u4f53\u5b9e\u73b0\uff08MPICH\u7b49\uff09\uff0c\u4e0e\u7f16\u7a0b\u8bed\u8a00\u65e0\u5173 \u2013 \u662f\u4e00\u79cd\u6d88\u606f\u4f20\u9012\u7f16\u7a0b\u6a21\u578b\uff0c\u5e76\u6210\u4e3a\u8fd9\u7c7b\u7f16\u7a0b\u6a21\u578b\u7684\u4ee3\u8868 MPI \u7684\u4ea7\u751f \u6269\u5145\u5e76\u884c I/O \u8fdc\u7a0b\u5b58\u50a8\u8bbf\u95ee \u52a8\u6001\u8fdb\u7a0b\u7ba1\u7406 MPI \u7684\u8bed\u8a00\u7ed1\u5b9a: Fortran\u3001C \u4e3b\u8981\u7684 MPI \u5b9e\u73b0: MPICH\u3001LAMMPI MPI \u7a0b\u5e8f\u7f16\u8bd1\u4e0e\u8fd0\u884c \u7a0b\u5e8f\u7f16\u8bd1\uff1a C: % mpicc - o prog prog . c Fortran: % mpif77 - o prog prog . f \u7a0b\u5e8f\u8fd0\u884c % mpirun - np 4 prog \u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u52a8\u6001\u6539\u53d8\u8fdb\u7a0b\u7684\u4e2a\u6570 \u7533\u8bf7\u7684\u8fdb\u7a0b\u6570 np \u4e0e\u5b9e\u9645\u5904\u7406\u5668\u4e2a\u6570\u65e0\u5173 MPI \u57fa\u7840\u77e5\u8bc6 \u00b6 \u8fdb\u7a0b\u4e0e\u6d88\u606f\u4f20\u9012 \u00b6 \u5355\u4e2a\u8fdb\u7a0b \u5355\u673a\u5185\u591a\u4e2a\u8fdb\u7a0b \u5305\u542b\u4e8e\u901a\u8fc7\u7f51\u7edc\u8054\u63a5\u7684\u4e0d\u540c\u5904\u7406\u5668\u7684\u591a\u4e2a\u8fdb\u7a0b \u8fdb\u7a0b\u72ec\u7acb\u5b58\u5728\uff0c\u5e76\u4f4d\u4e8e\u4e0d\u540c\u7684\u5904\u7406\u5668 \u8fdb\u7a0b\u95f4\u76f8\u4e92\u4fe1\u606f\u4ea4\u6362\uff0c\u53ef\u4f9d\u9760\u6d88\u606f\u4f20\u9012 \u6700\u57fa\u672c\u7684\u6d88\u606f\u4f20\u9012\u64cd\u4f5c\u5305\u62ec\u53d1\u9001\u6d88\u606f send\u3001\u63a5\u53d7\u6d88\u606f receive\u3001\u8fdb\u7a0b\u540c\u6b65 barrier\uff0c\u89c4\u7ea6 reduction \u7b49 MPI \u91cd\u8981\u6982\u5ff5 \u00b6 \u8fdb\u7a0b\u7ec4\uff08process group\uff09\uff1aMPI \u7a0b\u5e8f\u7684\u5168\u90e8\u8fdb\u7a0b\u96c6\u5408\u7684 \u4e00\u4e2a\u6709\u5e8f\u5b50\u96c6 \u4e14\u8fdb\u7a0b\u7ec4\u4e2d\u6bcf\u4e2a\u8fdb\u7a0b\u88ab\u8d4b\u4e88\u4e00\u4e2a\u5728\u8be5\u7ec4\u4e2d\u552f\u4e00\u7684\u5e8f\u53f7\uff08rank\uff09\uff0c\u7528\u4e8e\u5728\u8be5\u7ec4\u4e2d\u6807\u8bc6\u8be5\u8fdb\u7a0b\u3002 \u901a\u4fe1\u5668\uff08communicator\uff09 \u7406\u89e3\u4e3a\u4e00\u7c7b\u8fdb\u7a0b\u7684\u96c6\u5408\u5373\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\uff0c\u4e14\u5728\u8be5 \u8fdb\u7a0b\u7ec4\uff0c\u8fdb\u7a0b\u95f4\u53ef\u4ee5\u76f8\u4e92\u901a\u4fe1 \u4efb\u4f55MPI\u901a\u4fe1\u51fd\u6570\u5747\u5fc5\u987b\u5728\u67d0\u4e2a\u901a\u4fe1\u5668\u5185\u53d1\u751f MPI \u7cfb\u7edf\u63d0\u4f9b\u7701\u7f3a\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \uff0c\u6240\u6709\u542f\u52a8\u7684 MPI \u8fdb\u7a0b\u901a\u8fc7\u8c03\u7528\u51fd\u6570 MPI_Init() \u5305\u542b\u5728\u8be5\u901a\u4fe1\u5668\u5185\uff1b\u5404\u8fdb\u7a0b\u901a\u8fc7\u51fd\u6570 PI_Comm_size() \u83b7\u53d6\u901a\u4fe1\u5668\u5305\u542b\u7684(\u521d\u59cb\u542f\u52a8)\u7684 MPI \u8fdb\u7a0b\u4e2a\u6570 \u7ec4\u5185\u901a\u4fe1\u5668 \u548c\u7ec4\u95f4\u901a\u4fe1\u5668 \u8fdb\u7a0b\u5e8f\u53f7\uff08rank\uff09\uff1a\u7528\u6765\u5728\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u6807\u8bc6\u4e00\u4e2a\u8fdb\u7a0b MPI \u7a0b\u5e8f\u4e2d\u7684\u8fdb\u7a0b\u7531\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u5e8f\u53f7\u552f\u4e00\u786e\u5b9a \uff0c \u5e8f\u53f7\u76f8\u5bf9\u4e8e\u8fdb \u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u800c\u8a00\uff08\u5047\u8bbe np \u4e2a\u5904\u7406\u5668\uff0c\u6807\u53f7 0...np-1\uff09 \u540c\u4e00\u4e2a\u8fdb\u7a0b\u5728\u4e0d\u540c\u7684\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u5e8f\u53f7 \uff0c\u8fdb\u7a0b\u7684\u5e8f \u53f7\u662f\u5728\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u88ab\u521b\u5efa\u65f6\u8d4b\u4e88\u7684 MPI \u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7279\u6b8a\u7684\u8fdb\u7a0b\u5e8f\u53f7 MPI_PROC_NULL \uff0c\u5b83\u4ee3\u8868\u7a7a \u8fdb\u7a0b(\u4e0d\u5b58\u5728\u7684\u8fdb\u7a0b)\uff0c \u4e0e MPI_PROC_NULL \u95f4\u7684\u901a\u4fe1\u5b9e\u9645\u4e0a\u6ca1\u6709\u4efb \u4f55\u4f5c\u7528 \u6d88\u606f\uff08message\uff09 \u5206\u4e3a \u6570\u636e\uff08data\uff09\u548c\u5305\u88c5\uff08envelope\uff09 \u4e24\u4e2a\u90e8\u5206 \u5305\u88c5\u7531\u63a5\u53d7\u8fdb\u7a0b\u5e8f\u53f7/\u53d1\u9001\u8fdb\u7a0b\u5e8f\u53f7\u3001\u6d88\u606f\u6807\u53f7\u548c\u901a\u4fe1\u5668\u4e09\u90e8\u5206\u7ec4\u6210\uff1b\u6570\u636e\u5305\u542b\u7528\u6237\u5c06\u8981\u4f20\u9012\u7684\u5185\u5bb9 MPI \u5bf9\u8c61\uff1aMPI \u7cfb\u7edf\u5185\u90e8\u5b9a\u4e49\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5305\u62ec\u6570\u636e\u7c7b\u578b\uff08\u5982 MPI_INT \uff09\u3001\u901a\u4fe1\u5668\uff08 MPI_Comm \uff09\u3001\u901a\u4fe1\u8bf7\u6c42\uff08 MPI_Request \uff09\u7b49\uff0c\u5b83\u4eec\u5bf9\u7528\u6237\u4e0d\u900f\u660e\u3002 MPI \u8054\u63a5\u5668\uff08handles\uff09\u8054\u63a5 MPI \u5bf9\u8c61\u7684\u5177\u4f53\u53d8\u91cf\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b83\u8bbf\u95ee\u548c\u53c2\u4e0e\u76f8\u5e94MPI\u5bf9\u8c61\u7684\u5177\u4f53\u64cd\u4f5c\u3002\u4f8b\u5982\uff0cMPI \u7cfb\u7edf\u5185\u90e8\u63d0\u4f9b\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \u3002 MPI \u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f \u00b6 error = MPI_Xxxxx ( parameters , ...); MPI_Xxxxx ( parameters , ...); \u6574\u5f62\u9519\u8bef\u7801\u7531\u51fd\u6570\u503c\u8fd4\u56de \u9664 MPI_Wtime() \u548c MPI_Wtick() \u5916\uff0c\u6240\u6709 MPI \u7684 C \u51fd\u6570\u5747\u8fd4\u56de\u4e00\u4e2a\u6574\u578b\u9519\u8bef\u7801\u3002\u6210\u529f\u65f6\u8fd4\u56de MPI_SUCCESS \uff0c\u5176\u4ed6\u9519\u8bef\u4ee3\u7801\u4f9d\u8d56\u4e8e\u6267\u884c MPI \u7a0b\u5e8f\u57fa\u672c\u7ed3\u6784 \u00b6 MPI include file -> \u53d8\u91cf\u5b9a\u4e49 -> MPI \u73af\u5883\u521d\u59cb\u5316 -> \u6267\u884c\u7a0b\u5e8f\u3001\u8fdb\u7a0b\u95f4\u901a\u4fe1 -> \u9000\u51fa MPI \u73af\u5883 #include void main ( int argc , char * argv []) { int np , rank , ierr ; ierr = MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & rank ); MPI_Comm_size ( MPI_COMM_WORLD , & np ); /* Do Some Works */ ierr = MPI_Finalize (); } MPI \u57fa\u7840\u51fd\u6570 \u00b6 MPI_Init \uff1a\u521d\u59cb\u5316 MPI \u73af\u5883 MPI_Initialized : \u68c0\u67e5 MPI \u73af\u5883\u662f\u5426\u5df2\u7ecf\u521d\u59cb\u5316 MPI_Comm_size \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u7684\u8fdb\u7a0b\u6570 MPI_Comm_rank \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u5f53\u524d\u8fdb\u7a0b\u7684\u5e8f\u53f7 MPI_Finalize \uff1a\u7ed3\u675f MPI \u73af\u5883 MPI_Abort \uff1a\u5f02\u5e38\u7ec8\u6b62 MPI \u7a0b\u5e8f MPI_Get_processor_name \uff1a\u83b7\u53d6\u5f53\u524d\u8fdb\u7a0b\u6240\u5728\u5904\u7406\u5668\u7684\u540d\u79f0 MPI_Wtime \uff1a\u83b7\u53d6\u5f53\u524d\u65f6\u95f4 Hello World \u00b6 #include #include #include void main ( int argc , char * argv [ ]) { int myid , numprocs , namelen ; char processor_name [ MPI_MAX_PROCESSOR_NAME ]; MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & myid ); MPI_Comm_size ( MPI_COMM_WORLD , & numprocs ); MPI_Get_processor_name ( processor_name , & namelen ); printf ( \"Hello World! Process %d of %d on %s \\n \" , myid , numprocs , processor_name ); MPI_Finalize (); } \u70b9\u5bf9\u70b9\u901a\u4fe1 \u00b6 MPI \u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u90fd\u5efa\u7acb\u5728\u70b9\u5bf9\u70b9\u901a\u4fe1\u4e4b\u4e0a \u4e24\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1 \u6e90\u8fdb\u7a0b\u53d1\u9001\u6d88\u606f\u5230\u76ee\u6807\u8fdb\u7a0b \u76ee\u6807\u8fdb\u7a0b\u63a5\u53d7\u6d88\u606f \u901a\u4fe1\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u901a\u4fe1\u5668\u5185 \u8fdb\u7a0b\u901a\u8fc7\u5176\u5728\u901a\u4fe1\u5668\u5185\u7684\u6807\u53f7\u8868\u793a \u901a\u4fe1\u7c7b\u578b \u51fd\u6570\u8fd4\u56de \u5bf9\u6570\u636e\u533a\u64cd\u4f5c \u7279\u6027 \u963b\u585e\u5f0f\u901a\u4fe1 1. \u963b\u585e\u578b\u51fd\u6570\u9700\u8981\u7b49\u5f85\u5236\u5b9a\u64cd\u4f5c\u5b8c\u6210\u8fd4\u56de 2. \u6216\u6240\u6d89\u53ca\u64cd\u4f5c\u7684\u6570\u636e\u8981\u88ab MPI \u7cfb\u7edf\u7f13\u5b58\u5b89\u5168\u5907\u4efd\u540e\u8fd4\u56de \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5bf9\u6570\u636e\u64cd\u4f5c\u662f\u5b89\u5168\u7684 1. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u7b80\u5355 2. \u4f7f\u7528\u4e0d\u5f53\u5bb9\u6613\u9020\u6210\u6b7b\u9501 \u975e\u963b\u585e\u5f0f\u901a\u4fe1 1. \u8c03\u7528\u540e\u7acb\u523b\u8fd4\u56de\uff0c\u5b9e\u9645\u64cd\u4f5c\u5728 MPI \u540e\u53f0\u6267\u884c 2. \u9700\u8c03\u7528\u51fd\u6570\u7b49\u5f85\u6216\u67e5\u8be2\u64cd\u4f5c\u7684\u5b8c\u6210\u60c5\u51b5 \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5373\u64cd\u4f5c\u6570\u636e\u533a\u4e0d\u5b89\u5168\u3002\u53ef\u80fd\u4e0e\u540e\u53f0\u6b63\u8fdb\u884c\u7684\u64cd\u4f5c\u51b2\u7a81 1. \u53ef\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u4e0e\u901a\u4fe1\u7684\u91cd\u53e0 2. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u590d\u6742 \u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1 \u00b6 MPI_Send \u00b6 \u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Send ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm ) buf\uff1a\u53d1\u9001\u7f13\u51b2\u533a\u7684\u8d77\u59cb\u5730\u5740 count \u4e0d\u662f\u5b57\u8282\u6570\uff0c\u800c\u662f\u6307\u5b9a\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570 datatype \u53ef\u662f\u539f\u59cb\u6570\u636e\u7c7b\u578b\uff0c\u6216\u4e3a\u7528\u6237\u81ea\u5b9a\u4e49\u7c7b\u578b dest \u662f \u53d1\u9001\u76ee\u6807\u7684 rank tag \u7528\u6765\u533a\u5206\u6d88\u606f MPI_Recv \u00b6 \u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Recv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Status * status ) buf \u662f\u8981\u5c06\u63a5\u6536\u5230\u7684\u5185\u5bb9\u5b58\u5165\u7684 buffer \u9996\u5730\u5740\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 count \u662f\u8981\u63a5\u6536\u7684 buffer \u5143\u7d20\u4e2a\u6570 datatype \u662f\u8981\u63a5\u6536\u7684 buffer \u4e2d\u5143\u7d20\u7c7b\u578b source \u662f\u63a5\u6536\u6765\u6e90\u7684 rank\uff08\u6216\u8005 MPI_ANY_SOURCE\uff09 tag \u662f message tag\uff08\u6216\u8005 MPI_ANY_TAG\uff09 comm \u662f communicator status \u662f\u63a5\u6536\u7684\u72b6\u6001\u7ed3\u6784\u4f53\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 \u4e0d\u9700\u8981\u65f6\u586b\u5199 MPI_STATUS_IGNORE MPI_Status \u4e2d\u5305\u542b\u4e09\u4e2a\u6210\u5458\u53d8\u91cf\uff1aMPI_SOURCE\u3001MPI_TAG\u3001MPI_ERROR \u53ef\u4ee5\u901a\u8fc7 MPI_Get_count(MPI_Status status, MPI_Datatype datatype, int count) \u51fd\u6570\u6765\u83b7\u53d6 count MPI_Get_count \u00b6 \u67e5\u8be2\u63a5\u6536\u5230\u7684\u6d88\u606f\u957f\u5ea6 int MPI_Get_count ( MPI_Status * status , MPI_Datatype datatype , int * count ) \u8be5\u51fd\u6570\u5728 count \u4e2d\u8fd4\u56de\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570\uff0c\u5373\u6d88\u606f\u7684\u957f\u5ea6 count \u5c5e\u4e8e MPI_Status \u7ed3\u6784\u7684\u4e00\u4e2a\u57df\uff0c\u4f46\u4e0d\u80fd\u88ab\u7528\u6237\u76f4\u63a5\u8bbf\u95ee MPI_Sendrecv \u00b6 \u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536 int MPI_Sendrecv ( void * sendbuf , int sendcount , MPI_Datatype sendtype , int dest , int sendtag , void * recvbuf , int recvcount , MPI_Datatype recvtype , int source , int recvtag , MPI_Comm comm , MPI_Status * status ) MPI_Sendrecv_replace \u00b6 \u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536\u3001\u6536\u53d1\u4f7f\u7528\u540c\u4e00\u7f13\u5b58\u533a int MPI_Sendrecv_replace ( void * buf , int count , MPI_Datatype datatype , int dest , int sendtag , int source , int recvtag , MPI_Comm comm , MPI_Status * status ) \u975e\u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1 \u00b6 MPI_Isend \u00b6 \u975e\u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Isend ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm , MPI_Request * request ) MPI \u7cfb\u7edf\u4f1a\u5728\u540e\u53f0\u5b8c\u6210\u6d88\u606f\u53d1\u9001 \u51fd\u6570\u4e3a\u8be5\u53d1\u9001\u64cd\u4f5c\u521b\u5efa\u4e86\u4e00\u4e2a\u8bf7\u6c42\uff0c\u901a\u8fc7 request \u53d8\u91cf\u8fd4\u56de request \u53ef\u4f9b\u4e4b\u540e\uff08\u67e5\u8be2\u548c\u7b49\u5f85\uff09\u51fd\u6570\u4f7f\u7528 MPI_Irecv \u00b6 \u975e\u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Irecv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Request * request ) MPI_Wait \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u7684\u5b8c\u6210 int MPI_Wait ( MPI_Request * request , MPI_Status * status ) int MPI_Test ( MPI_Request * request , int * flag , MPI_Status * status ) MPI_Wait \u963b\u585e\u7b49\u5f85\u901a\u4fe1\u51fd\u6570\u5b8c\u6210\u540e\u8fd4\u56de\uff1bMPI_Test \u68c0\u6d4b\u67d0\u901a\u4fe1\uff0c\u4e0d\u8bba\u5176\u662f\u5426\u5b8c\u6210\uff0c\u90fd\u7acb\u523b\u8fd4\u56de\uff0c\u5982\u679c\u901a\u4fe1\u5b8c\u6210\uff0c\u5219 flag=true \u5f53\u7b49\u5f85\u6216\u68c0\u6d4b\u7684\u901a\u4fe1\u5b8c\u6210\u65f6\uff0c\u901a\u4fe1\u8bf7\u6c42 request \u88ab\u8bbe\u7f6e\u6210 MPI_REQUEST_NULL \u8003\u5bdf\u63a5\u6536\u8bf7\u6c42\uff0cstatus \u8fd4\u56de\u4e0e MPI_Recv \u4e00\u6837\uff1b\u53d1\u9001\u8bf7\u6c42\uff0c\u5219\u4e0d\u786e\u5b9a MPI_Test \u8fd4\u56de\u65f6\uff0c\u5f53 flag=false\uff0cstatus \u4e0d\u88ab\u8d4b\u503c MPI_Waitany \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u4e2d\u67d0\u4e00\u4e2a\u7684\u5b8c\u6210 int MPI_Waitany ( int count , MPI_Request array_of_requests [], int * index , MPI_Status * status ) MPI_Waitall \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u5168\u90e8\u5b8c\u6210 int MPI_Waitall ( int count , MPI_Request array_of_requests [], MPI_Status array_of_statuses [] ) MPI_Waitsome \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u7684\u90e8\u5206\u5b8c\u6210 int MPI_Waitsome ( int incount , MPI_Request array_of_requests [], int * outcount , int array_of_indices [], MPI_Status array_of_statuses [] ) MPI_Request_free \u00b6 \u901a\u4fe1\u8bf7\u6c42\u7684\u91ca\u653e\uff08\u963b\u585e\u578b\uff09 int MPI_Request_free ( MPI_Request * request ) MPI_Cancel \u00b6 \u53d6\u6d88\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Cancel ( MPI_Request * request ) MPI_Test_cancelled \u00b6 \u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u662f\u5426\u88ab\u53d6\u6d88\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Test_cancelled ( MPI_Status * status , int * flag ) MPI_Probe \u00b6 \u6d88\u606f\u63a2\u6d4b\uff08\u963b\u585e\u578b\uff09 int MPI_Probe ( int source , int tag , MPI_Comm comm , MPI_Status * status ) MPI_Iprobe \u00b6 \u6d88\u606f\u63a2\u6d4b\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Iprobe ( int source , int tag , MPI_Comm comm , int * flag , MPI_Status * status ) \u96c6\u5408\u901a\u4fe1 \u00b6 \u5f53\u9700\u8981\u8fdb\u884c\u8fdb\u7a0b\u4e4b\u95f4\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u4e00\u6216\u591a\u5bf9\u591a\u901a\u4fe1\u65f6\uff08\u5982\u5212\u5206\u4efb\u52a1\u3001\u6536\u96c6\u7ed3\u679c\uff09\uff0c\u4f7f\u7528\u591a\u4e2a Send/Recv \u4e0d\u65b9\u4fbf\uff0c\u53ef\u4ee5\u4f7f\u7528\u96c6\u5408\u901a\uff08Collective Communication\uff09 Barrier \u00b6 int MPI_Barrier ( MPI_Comm comm ) \u8fd0\u884c\u5230\u6b64\u51fd\u6570\u65f6\u8fdb\u884c\u7b49\u5f85\uff0c\u76f4\u5230 communicator \u4e2d\u6240\u6709\u8fdb\u7a0b\u90fd\u8fd0\u884c\u5230 Barrier \u4e4b\u540e\u518d\u4e00\u8d77\u7ee7\u7eed\u8fd0\u884c \u4e00\u5bf9\u591a \u00b6 MPI_Bcast \u00b6 int MPI_Bcast ( void * buffer , int count , MPI_Datatype datatype , int root , MPI_Comm comm ) \u6bd4 MPI_Send \u5c11\u4e86 dest\uff0c\u5373\u5c06 buffer \u4ece root \u53d1\u9001\u5230\u6240\u6709\u8fdb\u7a0b \u5305\u542b\u53d1\u9001\u548c\u63a5\u6536\uff08root \u53d1\u9001\uff0c\u5176\u5b83\u63a5\u6536\uff0croot \u53d1\u9001\u51fa buffer\uff0c\u5176\u5b83\u63a5\u6536\u653e\u5230 buffer \u4e2d\uff09 MPI_Bcast \u6548\u7387\u4e5f\u6bd4\u591a\u4e2a Send/Recv \u6548\u7387\u9ad8\uff08\u590d\u7528\u5df2\u7ecf\u5e7f\u64ad\u8fc7\u7684\u8282\u70b9\u8fdb\u884c\u65b0\u7684\u5e7f\u64ad\uff09 MPI_Scatter \u00b6 int MPI_Scatter ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u4e0e Broadcast \u4e0d\u540c\u7684\u662f\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u63a5\u6536\u5230\u7684\u662f sendbuf \u7684\u4e00\u90e8\u5206 \u591a\u5bf9\u4e00 \u00b6 MPI_Gather \u00b6 int MPI_Gather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u53c2\u6570\u610f\u4e49\u4e5f\u90fd\u7c7b\u4f3c\uff0c\u5c06\u6240\u6709\u8fdb\u7a0b\u4e2d\u7684 sendbuf \u53d1\u9001\u7ed9 root \u8fdb\u7a0b\uff0c\u62fc\u63a5\u5230 recvbuf \u4e2d MPI_Reduce \u00b6 int MPI_Reduce ( const void * sendbuf , void * recvbuf , int count , MPI_Datatype datatype , MPI_Op op , int root , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u5c06\u6536\u96c6\u5230\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\u5408\u5e76\u5230 recvbuf \u4e2d MPI_Op \u53ef\u4ee5\u662f MPI_MAX MPI_MIN MPI_SUM MPI_PROD MPI_LAND\uff08\u903b\u8f91\u4e0e\uff09MPI_BAND\uff08\u4f4d\u4e0e\uff09MPI_LOR MPI_BOR MPI_LXOR MPI_BXOR MPI_MAXLOC\uff08\u6700\u5927\u503c\u4e0e\u4f4d\u7f6e\uff09MPI_MINLOC \u591a\u5bf9\u591a \u00b6 MPI_Allgather \u00b6 int MPI_Allgather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u6240\u6709\u8fdb\u7a0b\u90fd\u4f1a\u5f97\u5230 MPI_Gather \u4e2d root \u5f97\u5230\u7684\u5185\u5bb9 MPI_Alltoall \u00b6 int MPI_Alltoall ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm ) \u6301\u4e45\u901a\u4fe1 \u00b6 \u6301\u4e45\u901a\u4fe1\u8bf7\u6c42\u53ef\u7528\u4e8e\u4ee5\u5b8c\u5168\u76f8\u540c\u7684\u65b9\u5f0f\uff08\u76f8\u540c\u7684\u901a\u4fe1\u5668\u3001\u6536\u53d1\u7f13\u51b2\u533a\u3001\u6570\u636e\u7c7b\u578b\u4e0e\u957f\u5ea6\u3001\u6e90/\u76ee\u7684\u5730\u5740\u548c\u6d88\u606f\u6807\u7b7e\uff09\u91cd\u590d\u6536\u53d1\u7684\u6d88\u606f\u3002\u76ee\u7684\u662f\u4e3a\u4e86\u51cf\u5c11\u5904\u7406\u6d88\u606f\u7684\u5f00\u9500\u53ca\u7b80\u5316 MPI \u7a0b\u5e8f","title":"MPI \u57fa\u7840"},{"location":"cs/hpc/mpi/#mpi","text":"\u7ea6 2264 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u53c2\u8003\uff1a MPI \u5e76\u884c\u7f16\u7a0b\u5165\u95e8","title":"MPI \u57fa\u7840"},{"location":"cs/hpc/mpi/#mpi_1","text":"\u4ec0\u4e48\u662f MPI \u662f\u51fd\u6570\u5e93\u89c4\u8303\uff0c\u800c\u4e0d\u662f\u5e76\u884c\u8bed\u8a00\uff1b\u64cd\u4f5c\u5982\u540c\u5e93\u51fd\u6570\u8c03\u7528 \u2013 \u662f\u4e00\u79cd\u6807\u51c6\u548c\u89c4\u8303\uff0c\u800c\u975e\u67d0\u4e2a\u5bf9\u5b83\u7684\u5177\u4f53\u5b9e\u73b0\uff08MPICH\u7b49\uff09\uff0c\u4e0e\u7f16\u7a0b\u8bed\u8a00\u65e0\u5173 \u2013 \u662f\u4e00\u79cd\u6d88\u606f\u4f20\u9012\u7f16\u7a0b\u6a21\u578b\uff0c\u5e76\u6210\u4e3a\u8fd9\u7c7b\u7f16\u7a0b\u6a21\u578b\u7684\u4ee3\u8868 MPI \u7684\u4ea7\u751f \u6269\u5145\u5e76\u884c I/O \u8fdc\u7a0b\u5b58\u50a8\u8bbf\u95ee \u52a8\u6001\u8fdb\u7a0b\u7ba1\u7406 MPI \u7684\u8bed\u8a00\u7ed1\u5b9a: Fortran\u3001C \u4e3b\u8981\u7684 MPI \u5b9e\u73b0: MPICH\u3001LAMMPI MPI \u7a0b\u5e8f\u7f16\u8bd1\u4e0e\u8fd0\u884c \u7a0b\u5e8f\u7f16\u8bd1\uff1a C: % mpicc - o prog prog . c Fortran: % mpif77 - o prog prog . f \u7a0b\u5e8f\u8fd0\u884c % mpirun - np 4 prog \u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u52a8\u6001\u6539\u53d8\u8fdb\u7a0b\u7684\u4e2a\u6570 \u7533\u8bf7\u7684\u8fdb\u7a0b\u6570 np \u4e0e\u5b9e\u9645\u5904\u7406\u5668\u4e2a\u6570\u65e0\u5173","title":"MPI \u7b80\u4ecb"},{"location":"cs/hpc/mpi/#mpi_2","text":"","title":"MPI \u57fa\u7840\u77e5\u8bc6"},{"location":"cs/hpc/mpi/#_1","text":"\u5355\u4e2a\u8fdb\u7a0b \u5355\u673a\u5185\u591a\u4e2a\u8fdb\u7a0b \u5305\u542b\u4e8e\u901a\u8fc7\u7f51\u7edc\u8054\u63a5\u7684\u4e0d\u540c\u5904\u7406\u5668\u7684\u591a\u4e2a\u8fdb\u7a0b \u8fdb\u7a0b\u72ec\u7acb\u5b58\u5728\uff0c\u5e76\u4f4d\u4e8e\u4e0d\u540c\u7684\u5904\u7406\u5668 \u8fdb\u7a0b\u95f4\u76f8\u4e92\u4fe1\u606f\u4ea4\u6362\uff0c\u53ef\u4f9d\u9760\u6d88\u606f\u4f20\u9012 \u6700\u57fa\u672c\u7684\u6d88\u606f\u4f20\u9012\u64cd\u4f5c\u5305\u62ec\u53d1\u9001\u6d88\u606f send\u3001\u63a5\u53d7\u6d88\u606f receive\u3001\u8fdb\u7a0b\u540c\u6b65 barrier\uff0c\u89c4\u7ea6 reduction \u7b49","title":"\u8fdb\u7a0b\u4e0e\u6d88\u606f\u4f20\u9012"},{"location":"cs/hpc/mpi/#mpi_3","text":"\u8fdb\u7a0b\u7ec4\uff08process group\uff09\uff1aMPI \u7a0b\u5e8f\u7684\u5168\u90e8\u8fdb\u7a0b\u96c6\u5408\u7684 \u4e00\u4e2a\u6709\u5e8f\u5b50\u96c6 \u4e14\u8fdb\u7a0b\u7ec4\u4e2d\u6bcf\u4e2a\u8fdb\u7a0b\u88ab\u8d4b\u4e88\u4e00\u4e2a\u5728\u8be5\u7ec4\u4e2d\u552f\u4e00\u7684\u5e8f\u53f7\uff08rank\uff09\uff0c\u7528\u4e8e\u5728\u8be5\u7ec4\u4e2d\u6807\u8bc6\u8be5\u8fdb\u7a0b\u3002 \u901a\u4fe1\u5668\uff08communicator\uff09 \u7406\u89e3\u4e3a\u4e00\u7c7b\u8fdb\u7a0b\u7684\u96c6\u5408\u5373\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\uff0c\u4e14\u5728\u8be5 \u8fdb\u7a0b\u7ec4\uff0c\u8fdb\u7a0b\u95f4\u53ef\u4ee5\u76f8\u4e92\u901a\u4fe1 \u4efb\u4f55MPI\u901a\u4fe1\u51fd\u6570\u5747\u5fc5\u987b\u5728\u67d0\u4e2a\u901a\u4fe1\u5668\u5185\u53d1\u751f MPI \u7cfb\u7edf\u63d0\u4f9b\u7701\u7f3a\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \uff0c\u6240\u6709\u542f\u52a8\u7684 MPI \u8fdb\u7a0b\u901a\u8fc7\u8c03\u7528\u51fd\u6570 MPI_Init() \u5305\u542b\u5728\u8be5\u901a\u4fe1\u5668\u5185\uff1b\u5404\u8fdb\u7a0b\u901a\u8fc7\u51fd\u6570 PI_Comm_size() \u83b7\u53d6\u901a\u4fe1\u5668\u5305\u542b\u7684(\u521d\u59cb\u542f\u52a8)\u7684 MPI \u8fdb\u7a0b\u4e2a\u6570 \u7ec4\u5185\u901a\u4fe1\u5668 \u548c\u7ec4\u95f4\u901a\u4fe1\u5668 \u8fdb\u7a0b\u5e8f\u53f7\uff08rank\uff09\uff1a\u7528\u6765\u5728\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u6807\u8bc6\u4e00\u4e2a\u8fdb\u7a0b MPI \u7a0b\u5e8f\u4e2d\u7684\u8fdb\u7a0b\u7531\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u5e8f\u53f7\u552f\u4e00\u786e\u5b9a \uff0c \u5e8f\u53f7\u76f8\u5bf9\u4e8e\u8fdb \u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u800c\u8a00\uff08\u5047\u8bbe np \u4e2a\u5904\u7406\u5668\uff0c\u6807\u53f7 0...np-1\uff09 \u540c\u4e00\u4e2a\u8fdb\u7a0b\u5728\u4e0d\u540c\u7684\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u5e8f\u53f7 \uff0c\u8fdb\u7a0b\u7684\u5e8f \u53f7\u662f\u5728\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u88ab\u521b\u5efa\u65f6\u8d4b\u4e88\u7684 MPI \u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7279\u6b8a\u7684\u8fdb\u7a0b\u5e8f\u53f7 MPI_PROC_NULL \uff0c\u5b83\u4ee3\u8868\u7a7a \u8fdb\u7a0b(\u4e0d\u5b58\u5728\u7684\u8fdb\u7a0b)\uff0c \u4e0e MPI_PROC_NULL \u95f4\u7684\u901a\u4fe1\u5b9e\u9645\u4e0a\u6ca1\u6709\u4efb \u4f55\u4f5c\u7528 \u6d88\u606f\uff08message\uff09 \u5206\u4e3a \u6570\u636e\uff08data\uff09\u548c\u5305\u88c5\uff08envelope\uff09 \u4e24\u4e2a\u90e8\u5206 \u5305\u88c5\u7531\u63a5\u53d7\u8fdb\u7a0b\u5e8f\u53f7/\u53d1\u9001\u8fdb\u7a0b\u5e8f\u53f7\u3001\u6d88\u606f\u6807\u53f7\u548c\u901a\u4fe1\u5668\u4e09\u90e8\u5206\u7ec4\u6210\uff1b\u6570\u636e\u5305\u542b\u7528\u6237\u5c06\u8981\u4f20\u9012\u7684\u5185\u5bb9 MPI \u5bf9\u8c61\uff1aMPI \u7cfb\u7edf\u5185\u90e8\u5b9a\u4e49\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5305\u62ec\u6570\u636e\u7c7b\u578b\uff08\u5982 MPI_INT \uff09\u3001\u901a\u4fe1\u5668\uff08 MPI_Comm \uff09\u3001\u901a\u4fe1\u8bf7\u6c42\uff08 MPI_Request \uff09\u7b49\uff0c\u5b83\u4eec\u5bf9\u7528\u6237\u4e0d\u900f\u660e\u3002 MPI \u8054\u63a5\u5668\uff08handles\uff09\u8054\u63a5 MPI \u5bf9\u8c61\u7684\u5177\u4f53\u53d8\u91cf\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b83\u8bbf\u95ee\u548c\u53c2\u4e0e\u76f8\u5e94MPI\u5bf9\u8c61\u7684\u5177\u4f53\u64cd\u4f5c\u3002\u4f8b\u5982\uff0cMPI \u7cfb\u7edf\u5185\u90e8\u63d0\u4f9b\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \u3002","title":"MPI \u91cd\u8981\u6982\u5ff5"},{"location":"cs/hpc/mpi/#mpi_4","text":"error = MPI_Xxxxx ( parameters , ...); MPI_Xxxxx ( parameters , ...); \u6574\u5f62\u9519\u8bef\u7801\u7531\u51fd\u6570\u503c\u8fd4\u56de \u9664 MPI_Wtime() \u548c MPI_Wtick() \u5916\uff0c\u6240\u6709 MPI \u7684 C \u51fd\u6570\u5747\u8fd4\u56de\u4e00\u4e2a\u6574\u578b\u9519\u8bef\u7801\u3002\u6210\u529f\u65f6\u8fd4\u56de MPI_SUCCESS \uff0c\u5176\u4ed6\u9519\u8bef\u4ee3\u7801\u4f9d\u8d56\u4e8e\u6267\u884c","title":"MPI \u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f"},{"location":"cs/hpc/mpi/#mpi_5","text":"MPI include file -> \u53d8\u91cf\u5b9a\u4e49 -> MPI \u73af\u5883\u521d\u59cb\u5316 -> \u6267\u884c\u7a0b\u5e8f\u3001\u8fdb\u7a0b\u95f4\u901a\u4fe1 -> \u9000\u51fa MPI \u73af\u5883 #include void main ( int argc , char * argv []) { int np , rank , ierr ; ierr = MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & rank ); MPI_Comm_size ( MPI_COMM_WORLD , & np ); /* Do Some Works */ ierr = MPI_Finalize (); }","title":"MPI \u7a0b\u5e8f\u57fa\u672c\u7ed3\u6784"},{"location":"cs/hpc/mpi/#mpi_6","text":"MPI_Init \uff1a\u521d\u59cb\u5316 MPI \u73af\u5883 MPI_Initialized : \u68c0\u67e5 MPI \u73af\u5883\u662f\u5426\u5df2\u7ecf\u521d\u59cb\u5316 MPI_Comm_size \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u7684\u8fdb\u7a0b\u6570 MPI_Comm_rank \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u5f53\u524d\u8fdb\u7a0b\u7684\u5e8f\u53f7 MPI_Finalize \uff1a\u7ed3\u675f MPI \u73af\u5883 MPI_Abort \uff1a\u5f02\u5e38\u7ec8\u6b62 MPI \u7a0b\u5e8f MPI_Get_processor_name \uff1a\u83b7\u53d6\u5f53\u524d\u8fdb\u7a0b\u6240\u5728\u5904\u7406\u5668\u7684\u540d\u79f0 MPI_Wtime \uff1a\u83b7\u53d6\u5f53\u524d\u65f6\u95f4","title":"MPI \u57fa\u7840\u51fd\u6570"},{"location":"cs/hpc/mpi/#hello-world","text":"#include #include #include void main ( int argc , char * argv [ ]) { int myid , numprocs , namelen ; char processor_name [ MPI_MAX_PROCESSOR_NAME ]; MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & myid ); MPI_Comm_size ( MPI_COMM_WORLD , & numprocs ); MPI_Get_processor_name ( processor_name , & namelen ); printf ( \"Hello World! Process %d of %d on %s \\n \" , myid , numprocs , processor_name ); MPI_Finalize (); }","title":"Hello World"},{"location":"cs/hpc/mpi/#_2","text":"MPI \u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u90fd\u5efa\u7acb\u5728\u70b9\u5bf9\u70b9\u901a\u4fe1\u4e4b\u4e0a \u4e24\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1 \u6e90\u8fdb\u7a0b\u53d1\u9001\u6d88\u606f\u5230\u76ee\u6807\u8fdb\u7a0b \u76ee\u6807\u8fdb\u7a0b\u63a5\u53d7\u6d88\u606f \u901a\u4fe1\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u901a\u4fe1\u5668\u5185 \u8fdb\u7a0b\u901a\u8fc7\u5176\u5728\u901a\u4fe1\u5668\u5185\u7684\u6807\u53f7\u8868\u793a \u901a\u4fe1\u7c7b\u578b \u51fd\u6570\u8fd4\u56de \u5bf9\u6570\u636e\u533a\u64cd\u4f5c \u7279\u6027 \u963b\u585e\u5f0f\u901a\u4fe1 1. \u963b\u585e\u578b\u51fd\u6570\u9700\u8981\u7b49\u5f85\u5236\u5b9a\u64cd\u4f5c\u5b8c\u6210\u8fd4\u56de 2. \u6216\u6240\u6d89\u53ca\u64cd\u4f5c\u7684\u6570\u636e\u8981\u88ab MPI \u7cfb\u7edf\u7f13\u5b58\u5b89\u5168\u5907\u4efd\u540e\u8fd4\u56de \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5bf9\u6570\u636e\u64cd\u4f5c\u662f\u5b89\u5168\u7684 1. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u7b80\u5355 2. \u4f7f\u7528\u4e0d\u5f53\u5bb9\u6613\u9020\u6210\u6b7b\u9501 \u975e\u963b\u585e\u5f0f\u901a\u4fe1 1. \u8c03\u7528\u540e\u7acb\u523b\u8fd4\u56de\uff0c\u5b9e\u9645\u64cd\u4f5c\u5728 MPI \u540e\u53f0\u6267\u884c 2. \u9700\u8c03\u7528\u51fd\u6570\u7b49\u5f85\u6216\u67e5\u8be2\u64cd\u4f5c\u7684\u5b8c\u6210\u60c5\u51b5 \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5373\u64cd\u4f5c\u6570\u636e\u533a\u4e0d\u5b89\u5168\u3002\u53ef\u80fd\u4e0e\u540e\u53f0\u6b63\u8fdb\u884c\u7684\u64cd\u4f5c\u51b2\u7a81 1. \u53ef\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u4e0e\u901a\u4fe1\u7684\u91cd\u53e0 2. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u590d\u6742","title":"\u70b9\u5bf9\u70b9\u901a\u4fe1"},{"location":"cs/hpc/mpi/#_3","text":"","title":"\u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1"},{"location":"cs/hpc/mpi/#mpi_send","text":"\u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Send ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm ) buf\uff1a\u53d1\u9001\u7f13\u51b2\u533a\u7684\u8d77\u59cb\u5730\u5740 count \u4e0d\u662f\u5b57\u8282\u6570\uff0c\u800c\u662f\u6307\u5b9a\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570 datatype \u53ef\u662f\u539f\u59cb\u6570\u636e\u7c7b\u578b\uff0c\u6216\u4e3a\u7528\u6237\u81ea\u5b9a\u4e49\u7c7b\u578b dest \u662f \u53d1\u9001\u76ee\u6807\u7684 rank tag \u7528\u6765\u533a\u5206\u6d88\u606f","title":"MPI_Send"},{"location":"cs/hpc/mpi/#mpi_recv","text":"\u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Recv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Status * status ) buf \u662f\u8981\u5c06\u63a5\u6536\u5230\u7684\u5185\u5bb9\u5b58\u5165\u7684 buffer \u9996\u5730\u5740\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 count \u662f\u8981\u63a5\u6536\u7684 buffer \u5143\u7d20\u4e2a\u6570 datatype \u662f\u8981\u63a5\u6536\u7684 buffer \u4e2d\u5143\u7d20\u7c7b\u578b source \u662f\u63a5\u6536\u6765\u6e90\u7684 rank\uff08\u6216\u8005 MPI_ANY_SOURCE\uff09 tag \u662f message tag\uff08\u6216\u8005 MPI_ANY_TAG\uff09 comm \u662f communicator status \u662f\u63a5\u6536\u7684\u72b6\u6001\u7ed3\u6784\u4f53\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 \u4e0d\u9700\u8981\u65f6\u586b\u5199 MPI_STATUS_IGNORE MPI_Status \u4e2d\u5305\u542b\u4e09\u4e2a\u6210\u5458\u53d8\u91cf\uff1aMPI_SOURCE\u3001MPI_TAG\u3001MPI_ERROR \u53ef\u4ee5\u901a\u8fc7 MPI_Get_count(MPI_Status status, MPI_Datatype datatype, int count) \u51fd\u6570\u6765\u83b7\u53d6 count","title":"MPI_Recv"},{"location":"cs/hpc/mpi/#mpi_get_count","text":"\u67e5\u8be2\u63a5\u6536\u5230\u7684\u6d88\u606f\u957f\u5ea6 int MPI_Get_count ( MPI_Status * status , MPI_Datatype datatype , int * count ) \u8be5\u51fd\u6570\u5728 count \u4e2d\u8fd4\u56de\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570\uff0c\u5373\u6d88\u606f\u7684\u957f\u5ea6 count \u5c5e\u4e8e MPI_Status \u7ed3\u6784\u7684\u4e00\u4e2a\u57df\uff0c\u4f46\u4e0d\u80fd\u88ab\u7528\u6237\u76f4\u63a5\u8bbf\u95ee","title":"MPI_Get_count"},{"location":"cs/hpc/mpi/#mpi_sendrecv","text":"\u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536 int MPI_Sendrecv ( void * sendbuf , int sendcount , MPI_Datatype sendtype , int dest , int sendtag , void * recvbuf , int recvcount , MPI_Datatype recvtype , int source , int recvtag , MPI_Comm comm , MPI_Status * status )","title":"MPI_Sendrecv"},{"location":"cs/hpc/mpi/#mpi_sendrecv_replace","text":"\u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536\u3001\u6536\u53d1\u4f7f\u7528\u540c\u4e00\u7f13\u5b58\u533a int MPI_Sendrecv_replace ( void * buf , int count , MPI_Datatype datatype , int dest , int sendtag , int source , int recvtag , MPI_Comm comm , MPI_Status * status )","title":"MPI_Sendrecv_replace"},{"location":"cs/hpc/mpi/#_4","text":"","title":"\u975e\u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1"},{"location":"cs/hpc/mpi/#mpi_isend","text":"\u975e\u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Isend ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm , MPI_Request * request ) MPI \u7cfb\u7edf\u4f1a\u5728\u540e\u53f0\u5b8c\u6210\u6d88\u606f\u53d1\u9001 \u51fd\u6570\u4e3a\u8be5\u53d1\u9001\u64cd\u4f5c\u521b\u5efa\u4e86\u4e00\u4e2a\u8bf7\u6c42\uff0c\u901a\u8fc7 request \u53d8\u91cf\u8fd4\u56de request \u53ef\u4f9b\u4e4b\u540e\uff08\u67e5\u8be2\u548c\u7b49\u5f85\uff09\u51fd\u6570\u4f7f\u7528","title":"MPI_Isend"},{"location":"cs/hpc/mpi/#mpi_irecv","text":"\u975e\u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Irecv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Request * request )","title":"MPI_Irecv"},{"location":"cs/hpc/mpi/#mpi_wait","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u7684\u5b8c\u6210 int MPI_Wait ( MPI_Request * request , MPI_Status * status ) int MPI_Test ( MPI_Request * request , int * flag , MPI_Status * status ) MPI_Wait \u963b\u585e\u7b49\u5f85\u901a\u4fe1\u51fd\u6570\u5b8c\u6210\u540e\u8fd4\u56de\uff1bMPI_Test \u68c0\u6d4b\u67d0\u901a\u4fe1\uff0c\u4e0d\u8bba\u5176\u662f\u5426\u5b8c\u6210\uff0c\u90fd\u7acb\u523b\u8fd4\u56de\uff0c\u5982\u679c\u901a\u4fe1\u5b8c\u6210\uff0c\u5219 flag=true \u5f53\u7b49\u5f85\u6216\u68c0\u6d4b\u7684\u901a\u4fe1\u5b8c\u6210\u65f6\uff0c\u901a\u4fe1\u8bf7\u6c42 request \u88ab\u8bbe\u7f6e\u6210 MPI_REQUEST_NULL \u8003\u5bdf\u63a5\u6536\u8bf7\u6c42\uff0cstatus \u8fd4\u56de\u4e0e MPI_Recv \u4e00\u6837\uff1b\u53d1\u9001\u8bf7\u6c42\uff0c\u5219\u4e0d\u786e\u5b9a MPI_Test \u8fd4\u56de\u65f6\uff0c\u5f53 flag=false\uff0cstatus \u4e0d\u88ab\u8d4b\u503c","title":"MPI_Wait"},{"location":"cs/hpc/mpi/#mpi_waitany","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u4e2d\u67d0\u4e00\u4e2a\u7684\u5b8c\u6210 int MPI_Waitany ( int count , MPI_Request array_of_requests [], int * index , MPI_Status * status )","title":"MPI_Waitany"},{"location":"cs/hpc/mpi/#mpi_waitall","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u5168\u90e8\u5b8c\u6210 int MPI_Waitall ( int count , MPI_Request array_of_requests [], MPI_Status array_of_statuses [] )","title":"MPI_Waitall"},{"location":"cs/hpc/mpi/#mpi_waitsome","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u7684\u90e8\u5206\u5b8c\u6210 int MPI_Waitsome ( int incount , MPI_Request array_of_requests [], int * outcount , int array_of_indices [], MPI_Status array_of_statuses [] )","title":"MPI_Waitsome"},{"location":"cs/hpc/mpi/#mpi_request_free","text":"\u901a\u4fe1\u8bf7\u6c42\u7684\u91ca\u653e\uff08\u963b\u585e\u578b\uff09 int MPI_Request_free ( MPI_Request * request )","title":"MPI_Request_free"},{"location":"cs/hpc/mpi/#mpi_cancel","text":"\u53d6\u6d88\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Cancel ( MPI_Request * request )","title":"MPI_Cancel"},{"location":"cs/hpc/mpi/#mpi_test_cancelled","text":"\u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u662f\u5426\u88ab\u53d6\u6d88\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Test_cancelled ( MPI_Status * status , int * flag )","title":"MPI_Test_cancelled"},{"location":"cs/hpc/mpi/#mpi_probe","text":"\u6d88\u606f\u63a2\u6d4b\uff08\u963b\u585e\u578b\uff09 int MPI_Probe ( int source , int tag , MPI_Comm comm , MPI_Status * status )","title":"MPI_Probe"},{"location":"cs/hpc/mpi/#mpi_iprobe","text":"\u6d88\u606f\u63a2\u6d4b\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Iprobe ( int source , int tag , MPI_Comm comm , int * flag , MPI_Status * status )","title":"MPI_Iprobe"},{"location":"cs/hpc/mpi/#_5","text":"\u5f53\u9700\u8981\u8fdb\u884c\u8fdb\u7a0b\u4e4b\u95f4\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u4e00\u6216\u591a\u5bf9\u591a\u901a\u4fe1\u65f6\uff08\u5982\u5212\u5206\u4efb\u52a1\u3001\u6536\u96c6\u7ed3\u679c\uff09\uff0c\u4f7f\u7528\u591a\u4e2a Send/Recv \u4e0d\u65b9\u4fbf\uff0c\u53ef\u4ee5\u4f7f\u7528\u96c6\u5408\u901a\uff08Collective Communication\uff09","title":"\u96c6\u5408\u901a\u4fe1"},{"location":"cs/hpc/mpi/#barrier","text":"int MPI_Barrier ( MPI_Comm comm ) \u8fd0\u884c\u5230\u6b64\u51fd\u6570\u65f6\u8fdb\u884c\u7b49\u5f85\uff0c\u76f4\u5230 communicator \u4e2d\u6240\u6709\u8fdb\u7a0b\u90fd\u8fd0\u884c\u5230 Barrier \u4e4b\u540e\u518d\u4e00\u8d77\u7ee7\u7eed\u8fd0\u884c","title":"Barrier"},{"location":"cs/hpc/mpi/#_6","text":"","title":"\u4e00\u5bf9\u591a"},{"location":"cs/hpc/mpi/#mpi_bcast","text":"int MPI_Bcast ( void * buffer , int count , MPI_Datatype datatype , int root , MPI_Comm comm ) \u6bd4 MPI_Send \u5c11\u4e86 dest\uff0c\u5373\u5c06 buffer \u4ece root \u53d1\u9001\u5230\u6240\u6709\u8fdb\u7a0b \u5305\u542b\u53d1\u9001\u548c\u63a5\u6536\uff08root \u53d1\u9001\uff0c\u5176\u5b83\u63a5\u6536\uff0croot \u53d1\u9001\u51fa buffer\uff0c\u5176\u5b83\u63a5\u6536\u653e\u5230 buffer \u4e2d\uff09 MPI_Bcast \u6548\u7387\u4e5f\u6bd4\u591a\u4e2a Send/Recv \u6548\u7387\u9ad8\uff08\u590d\u7528\u5df2\u7ecf\u5e7f\u64ad\u8fc7\u7684\u8282\u70b9\u8fdb\u884c\u65b0\u7684\u5e7f\u64ad\uff09","title":"MPI_Bcast"},{"location":"cs/hpc/mpi/#mpi_scatter","text":"int MPI_Scatter ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u4e0e Broadcast \u4e0d\u540c\u7684\u662f\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u63a5\u6536\u5230\u7684\u662f sendbuf \u7684\u4e00\u90e8\u5206","title":"MPI_Scatter"},{"location":"cs/hpc/mpi/#_7","text":"","title":"\u591a\u5bf9\u4e00"},{"location":"cs/hpc/mpi/#mpi_gather","text":"int MPI_Gather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u53c2\u6570\u610f\u4e49\u4e5f\u90fd\u7c7b\u4f3c\uff0c\u5c06\u6240\u6709\u8fdb\u7a0b\u4e2d\u7684 sendbuf \u53d1\u9001\u7ed9 root \u8fdb\u7a0b\uff0c\u62fc\u63a5\u5230 recvbuf \u4e2d","title":"MPI_Gather"},{"location":"cs/hpc/mpi/#mpi_reduce","text":"int MPI_Reduce ( const void * sendbuf , void * recvbuf , int count , MPI_Datatype datatype , MPI_Op op , int root , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u5c06\u6536\u96c6\u5230\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\u5408\u5e76\u5230 recvbuf \u4e2d MPI_Op \u53ef\u4ee5\u662f MPI_MAX MPI_MIN MPI_SUM MPI_PROD MPI_LAND\uff08\u903b\u8f91\u4e0e\uff09MPI_BAND\uff08\u4f4d\u4e0e\uff09MPI_LOR MPI_BOR MPI_LXOR MPI_BXOR MPI_MAXLOC\uff08\u6700\u5927\u503c\u4e0e\u4f4d\u7f6e\uff09MPI_MINLOC","title":"MPI_Reduce"},{"location":"cs/hpc/mpi/#_8","text":"","title":"\u591a\u5bf9\u591a"},{"location":"cs/hpc/mpi/#mpi_allgather","text":"int MPI_Allgather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u6240\u6709\u8fdb\u7a0b\u90fd\u4f1a\u5f97\u5230 MPI_Gather \u4e2d root \u5f97\u5230\u7684\u5185\u5bb9","title":"MPI_Allgather"},{"location":"cs/hpc/mpi/#mpi_alltoall","text":"int MPI_Alltoall ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm )","title":"MPI_Alltoall"},{"location":"cs/hpc/mpi/#_9","text":"\u6301\u4e45\u901a\u4fe1\u8bf7\u6c42\u53ef\u7528\u4e8e\u4ee5\u5b8c\u5168\u76f8\u540c\u7684\u65b9\u5f0f\uff08\u76f8\u540c\u7684\u901a\u4fe1\u5668\u3001\u6536\u53d1\u7f13\u51b2\u533a\u3001\u6570\u636e\u7c7b\u578b\u4e0e\u957f\u5ea6\u3001\u6e90/\u76ee\u7684\u5730\u5740\u548c\u6d88\u606f\u6807\u7b7e\uff09\u91cd\u590d\u6536\u53d1\u7684\u6d88\u606f\u3002\u76ee\u7684\u662f\u4e3a\u4e86\u51cf\u5c11\u5904\u7406\u6d88\u606f\u7684\u5f00\u9500\u53ca\u7b80\u5316 MPI \u7a0b\u5e8f","title":"\u6301\u4e45\u901a\u4fe1"},{"location":"cs/hpc/openmp/","text":"OpenMP \u57fa\u7840 \u00b6 \u7ea6 1763 \u4e2a\u5b57 38 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f \u4ec0\u4e48\u662f OpenMP \u00b6 Open Multi-Processing OpenMP \u662f\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff08API\uff09\uff0c\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a\u4e00\u4e2a\u5e93 \u652f\u6301 C\u3001C++ \u548c Fortran \u652f\u6301\u591a\u79cd\u6307\u4ee4\u96c6\u548c\u64cd\u4f5c\u7cfb\u7edf OpenMP \u7684\u9002\u7528\u8303\u56f4\uff1a\u591a\u7ebf\u7a0b\u3001\u5171\u4eab\u5185\u5b58 \u5171\u4eab\u5b58\u50a8\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7684\u4e00\u4e2a\u5e76\u884c\u7f16\u7a0b\u6a21\u578b \u9002\u7528\u4e8e SMP\uff08Symmetric Multi-Processor\uff09\u5171\u4eab\u5185\u5b58\u591a\u5904\u7406\u7cfb\u7edf\u548c\u591a\u6838\u5904\u7406\u5668\u4f53\u7cfb\u7ed3\u6784 \u4e09\u7c7b\u4e3b\u8981 API\uff08\u8868\u73b0\u4e3a\u7f16\u8bd1\u5236\u5bfc\u6307\u4ee4\uff0c\u4f46\u5b9e\u9645\u4e0a\u4ecd\u4e3a API\uff09\uff1a\u7f16\u8bd1\u5668\u6307\u4ee4\u3001\u8fd0\u884c\u65f6\u5e93\u51fd\u6570\u3001\u73af\u5883\u53d8\u91cf \u4f20\u7edf\u4e0a\uff0c\u6211\u4eec\u5229\u7528 OpenMP \u8fdb\u884c\u5355\u673a\u5668 CPU \u4f18\u5316\uff08\u53ef\u8de8\u5904\u7406\u5668\uff09\uff0c\u4e0d\u8fc7\u5728\u8f83\u65b0\u7684 OpenMP \u7248\u672c\u7684\u4e2d\uff0c\u4f60\u751a\u81f3\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 OpenMP \u5c06\u4ee3\u7801\u4f18\u5316\u5230 GPU \u7b49\u5f02\u6784\u8ba1\u7b97\u8bbe\u5907\u4e0a \u5e76\u884c\u6027 \u00b6 \u8fdb\u7a0b\u548c\u7ebf\u7a0b \u00b6 \u8fdb\u7a0b \u6bcf\u4e2a\u8fdb\u7a0b\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u5730\u5740\u7a7a\u95f4 CPU \u5728\u8fdb\u7a0b\u4e4b\u95f4\u5207\u6362\u9700\u8981\u8fdb\u884c\u4e0a\u4e0b\u6587\u5207\u6362 \u7ebf\u7a0b \u4e00\u4e2a\u8fdb\u7a0b\u4e0b\u7684\u7ebf\u7a0b\u5171\u4eab\u5730\u5740\u7a7a\u95f4 CPU \u5728\u7ebf\u7a0b\u4e4b\u95f4\u5207\u6362\u5f00\u9500\u5c0f \u7ebf\u7a0b\u7684\u786c\u4ef6\u8c03\u5ea6 \u00b6 \u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5c06\u7ebf\u7a0b\u8c03\u5ea6\u5230 CPU \u6838\u5fc3\u8fd0\u884c \u5f53\u7ebf\u7a0b\u6570\u76ee\u8d85\u8fc7\u6838\u5fc3\u6570\uff0c\u4f1a\u51fa\u73b0\u591a\u4e2a\u7ebf\u7a0b\u62a2\u5360\u4e00\u4e2a CPU \u6838\u5fc3\uff0c\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d \u8d85\u7ebf\u7a0b\uff08hyper-threading\uff09\u5c06\u5355\u4e2a CPU \u7269\u7406\u6838\u5fc3\u62bd\u8c61\u4e3a\u591a\u4e2a\uff08\u76ee\u524d\u901a\u5e38\u4e3a 2 \u4e2a\uff09\u903b\u8f91\u6838\u5fc3\uff0c\u5171\u4eab\u7269\u7406\u6838\u5fc3\u7684\u8ba1\u7b97\u8d44\u6e90 \u786c\u4ef6\u7684\u5185\u5b58\u6a21\u578b \u00b6 CPU \u6838\u5fc3\u5728\u4e3b\u5b58\u4e4b\u4e0a\u6709 L1,L2,L3 \u591a\u7ea7\u7f13\u5b58 L1,L2 \u7f13\u5b58\u662f\u6838\u5fc3\u79c1\u6709\u7684 \u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4fdd\u8bc1\u4e0d\u540c\u6838\u5fc3\u7684\u7f13\u5b58\u4e00\u81f4\u6027\uff08coherence\uff09 \u88ab\u79f0\u4e3a cache coherence non-uniform memory access\uff08ccNUMA\uff09 \u7f13\u5b58\u4e00\u81f4\u6027\u4f1a\u5e26\u6765 False Sharing \u7684\u95ee\u9898 Fork-Join \u6a21\u578b \u00b6 \u5355\u7ebf\u7a0b\uff08initial thread\uff09\u5f00\u59cb\u6267\u884c \u8fdb\u5165\u5e76\u884c\u533a\uff08parallel region\uff09\u5f00\u59cb\u5e76\u884c\u6267\u884c \u5728\u5e76\u884c\u533a\u7ed3\u5c3e \u8fdb\u884c\u540c\u6b65 \u548c\u7ed3\u675f\u7ebf\u7a0b\uff0c\u7ee7\u7eed\u5355\u7ebf\u7a0b\u6267\u884c\u7a0b\u5e8f OpenMP \u7f16\u7a0b \u00b6 \u5b89\u88c5 \u00b6 \u542b\u5728 Ubuntu \u63d0\u4f9b\u7684 build-essential \u5305\u4e2d echo | cpp -fopenmp -dM | grep -i open # #define _OPENMP 201511 \u7f16\u8bd1\u4f7f\u7528 \u00b6 \u53ef\u4ee5\u76f4\u63a5\u5728\u7f16\u8bd1\u8bed\u53e5\u6dfb\u52a0 -fopenmp \uff0c\u5982 g++ -O2 -std = c++14 -fopenmp hello.cp -o hello \u5982\u679c\u7528 cmake \u6784\u5efa\u9879\u76ee\uff0cgcc \u52a0\u5165 -Wunknown-pragmas \u4f1a\u5728\u7f16\u8bd1\u65f6\u62a5\u544a\u6ca1\u6709\u5904\u7406\u7684 #pragma \uff0c\u53ef\u4ee5\u7528\u6765\u68c0\u67e5\u662f\u5426\u6709\u9057\u6f0f\u7684 OpenMP \u6307\u4ee4 find_package ( OpenMP ) add_compile_options ( -Wunknown-pragmas ) add_executable ( hello src/hello.cpp ) target_link_libraries ( hello OpenMP::OpenMP_CXX ) \u5e93\u51fd\u6570 \u00b6 \u4f7f\u7528\u65f6\u8981 #include \uff0c\u4e00\u4e9b\u5e38\u7528\u51fd\u6570\uff1a void omp_set_num_threads ( int ) \uff1a\u8bbe\u7f6e\u5e76\u884c\u533a\u8fd0\u884c\u7684\u7ebf\u7a0b\u6570 int omp_get_thread_num ( void ) \uff1a\u83b7\u53d6\u5f53\u524d\u7ebf\u7a0b\u53f7 int omp_get_num_threads ( void ) \uff1a\u83b7\u53d6\u603b\u7ebf\u7a0b\u6570 double omp_get_wtime ( void ) \uff1a\u83b7\u53d6\u65f6\u95f4\uff0c\u5e38\u7528\u4e8e\u8ba1\u7b97\u7ebf\u7a0b\u5185\u8bed\u53e5\u6267\u884c\u65f6\u95f4 double opm_get_wtick ( void ) \uff1a\u83b7\u5f97 omp_get_wtime \u65f6\u95f4\u7cbe\u5ea6 OpenMP \u4f1a\u8bfb\u53d6\u73af\u5883\u53d8\u91cf OMP_NUM_THREADS \u6765\u51b3\u5b9a\u521b\u5efa\u7684\u7ebf\u7a0b\u6570 \u5236\u5bfc\u8bed\u53e5 \u00b6 \u540c\u4e00\u7c7b openmp \u5236\u5bfc\u8bed\u53e5\u79f0\u4e3a\u4e00\u79cd\u6784\u9020\uff08construct\uff09 \u5f62\u5f0f\u4e3a #pragma omp \u4f7f\u7528 {} \u6807\u8bb0\u4f5c\u7528\u7684\u4ee3\u7801\u5757 \u652f\u6301\u7684\u4ece\u53e5 default(shared|none) \uff1a\u6307\u5b9a\u9ed8\u8ba4 shared \uff1a\u9ed8\u8ba4\u4e3a\u5171\u4eab\u53d8\u91cf none \uff1a\u65e0\u9ed8\u8ba4\u53d8\u91cf\u7c7b\u578b\uff0c\u6bcf\u4e2a\u53d8\u91cf\u90fd\u9700\u8981\u53e6\u5916\u6307\u5b9a shared(list) \uff1a\u6307\u5b9a\u5171\u4eab\u53d8\u91cf\u5217\u8868\u53d8\u91cf\u7c7b\u578b \u5171\u4eab\u53d8\u91cf\u5728\u5185\u5b58\u4e2d\u53ea\u6709\u4e00\u4efd\uff0c\u6240\u6709\u7ebf\u7a0b\u90fd\u53ef\u4ee5\u8bbf\u95ee \u8bf7\u4fdd\u8bc1\u5171\u4eab\u8bbf\u95ee\u4e0d\u4f1a\u51b2\u7a81 \u4e0d\u7279\u522b\u6307\u5b9a\u5e76\u884c\u533a\u53d8\u91cf \u9ed8\u8ba4\u4e3ashared private(list) \uff1a\u6307\u5b9a\u79c1\u6709\u53d8\u91cf\u5217\u8868 \u6bcf\u4e2a\u7ebf\u7a0b\u751f\u6210\u4e00\u4efd\u4e0e\u8be5\u79c1\u6709\u53d8\u91cf\u540c\u7c7b\u578b\u7684\u6570\u636e\u5bf9\u8c61 \u53d8\u91cf\u9700\u8981 \u91cd\u65b0\u521d\u59cb\u5316 firstprivate(list) \u540c private \u5bf9\u53d8\u91cf\u6839\u636e\u795d\u7ebf\u7a0b\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u521d\u59cb\u5316 lastprivate(list) \u540cprivate \u6267\u884c\u6700\u540e\u4e00\u4e2a\u5faa\u73af\u7684\u7ebf\u7a0b\u7684\u79c1\u6709\u6570\u636e\u53d6\u51fa\u8d4b\u503c\u7ed9\u4e3b\u7ebf\u7a0b\u7684\u53d8\u91cf nowait \uff1a\u53d6\u6d88\u4ee3\u7801\u5757\u7ed3\u675f\u7684\u6805\u680f\u540c\u6b65\uff08barrier\uff09 collapse(n) \uff1a\u5e94\u7528\u4e8e n \u91cd\u5faa\u73af\uff0c\u5408\u5e76\uff08\u5c55\u5f00\uff09\u5faa\u73af\u5e76\u884c \u6ce8\u610f\u5faa\u73af\u4e4b\u95f4\u662f\u5426\u6709\u6570\u636e\u4f9d\u8d56 ordered \uff1a\u58f0\u660e\u6709\u6f5c\u5728\u7684\u987a\u5e8f\u6267\u884c\u90e8\u5206 \u4f7f\u7528 #pragma omp ordered \u6807\u8bb0\u987a\u5e8f\u6267\u884c\u4ee3\u7801\uff08\u642d\u914d\u4f7f\u7528\uff09 ordered \u533a\u5185\u7684\u8bed\u53e5\u4efb\u610f\u65f6\u523b\u4ec5\u7531\u6700\u591a\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c schedule(type [, chuck]) \uff1a\u63a7\u5236\u8c03\u5ea6\u65b9\u5f0f static \uff1achunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 n/p\uff09 dynamic \uff1a\u52a8\u6001\u8c03\u5ea6\uff0cchunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 1\uff09 guided \uff1achunk \u5927\u5c0f\u52a8\u6001\u9012\u51cf runtime \uff1a\u7531\u7cfb\u7edf\u73af\u5883 OMP_SCHEDULE \u51b3\u5b9a parallel \u7ebf\u7a0b\u5e76\u884c \u00b6 \u4f7f\u7528 #pragma omp parallel \u521b\u5efa\u5e76\u884c\u5757\u6765\u5e76\u884c\u8fd0\u884c\u540c\u4e00\u6bb5\u7a0b\u5e8f\uff1a #include #include #include int main () { #pragma omp parallel { int ID = omp_get_thread_num (); printf ( \"thread #%d \\n \" , ID ); } } for \u5faa\u73af\u5e76\u884c \u00b6 parallel \u5757\u5185\u53ef\u4ee5\u4f7f\u7528 #pragma omp for \u6765\u5bf9 for \u5faa\u73af\u8fdb\u884c\u5e76\u884c\uff0c\u76f8\u5f53\u4e8e\u5c06\u5faa\u73af\u62c6\u6210\u4e0d\u540c\u90e8\u5206\u5206\u914d\u7ed9\u591a\u4e2a\u7ebf\u7a0b \u683c\u5f0f\u8981\u6c42 init-expr: \u9700\u8981\u662f var=lb \u5f62\u5f0f\uff0c\u7c7b\u578b\u4e5f\u6709\u9650\u5236 test-expr: \u9650\u5236\u4e3a var reational-opb \u6216\u8005 b relational-opb var incr-expr: \u9650\u5236\u4e3a var=var +/- incr \u6216\u8005 var=var +/- incr #pragma omp parallel { #pragma omp for { for ( int i = 0 ; i < N ; ++ i ) { c [ i ] = a [ i ] + b [ i ]; } } } parallel \u548c for \u53ef\u4ee5\u5408\u8d77\u6765\u5199\u4f5c\u4e00\u884c #pragma omp parallel for if \u6761\u4ef6\u5e76\u884c \u00b6 \u53ef\u4ee5\u5728\u5236\u5bfc\u8bed\u53e5\u540e\u9762\u52a0 if \u5b50\u53e5\u6765\u51b3\u5b9a\u662f\u5426\u8fdb\u884c\u5e76\u884c\uff1a #pragma omp parallel if(x) num_threads(4) { ... } \u5982\u679c x \u4e0d\u4e3a 0 \u5219\u5206\u4e3a\u56db\u4e2a\u7ebf\u7a0b\u6267\u884c\u5757\u5185\u5185\u5bb9 \u5982\u679c x \u4e3a 0 \u5219\u7531\u4e3b\u7ebf\u7a0b\u4e32\u884c\u6267\u884c reduction \u6267\u884c\u8fc7\u7a0b \u00b6 fork \u7ebf\u7a0b\u5e76\u5206\u914d\u4efb\u52a1 \u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u5b9a\u4e49\u4e00\u4e2a\u79c1\u6709\u53d8\u91cf omp_private \uff0c\u540c private \u5404\u4e2a\u7ebf\u7a0b\u6267\u884c\u8ba1\u7b97 \u6240\u6709 omp_priv \u548c omp_in \u4e00\u8d77\u987a\u5e8f\u8fdb\u884c reduction\uff0c\u5199\u56de\u539f\u53d8\u91cf \u540c\u6b65\u6784\u9020 \u00b6 #pragma omp sections \u00b6 \u5c06\u5e76\u884c\u533a\u5185\u7684\u4ee3\u7801\u5757\u5212\u5206\u4e3a\u591a\u4e2a section \u5206\u914d\u6267\u884c \u53ef\u4ee5\u642d\u914d parallel \u5408\u5e76\u4e3a #pragma omp parallel sections \u6784\u9020 \u6bcf\u4e2a section \u7531\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c \u7ebf\u7a0b\u6570\u5927\u4e8e section \u6570\u76ee\uff1a\u90e8\u5206\u7ebf\u7a0b\u7a7a\u95f2 \u7ebf\u7a0b\u6570\u5c0f\u4e8e section \u6570\u76ee\uff0c\u90e8\u5206\u7ebf\u7a0b\u5206\u914d\u591a\u4e2a section #pragma omp parallel sections { #pragma omp section code1 (); #pragma omp section code2 (); } #pragma omp barrier \u00b6 \u5728\u7279\u5b9a\u4f4d\u7f6e\u8fdb\u884c\u6805\u680f\u540c\u6b65 \u6bcf\u4e2a\u5e76\u884c\u5757\u90fd\u542b\u6709\u9690\u5f0f\u7684 barrier\uff0c\u4e5f\u5c31\u662f\u5728\u6240\u6709\u7ebf\u7a0b\u90fd\u7ed3\u675f\u540e\u624d\u80fd\u7ee7\u7eed\u5411\u4e0b\u8fd0\u884c \u5728\u5e76\u884c\u5757\u5185\u4e5f\u53ef\u4ee5\u5229\u7528 #pragma omp barrier \u6765\u540c\u6b65\u5404\u7ebf\u7a0b\uff0c\u5373\u6240\u6709\u7ebf\u7a0b\u90fd\u89e6\u78b0\u5230 barrier \u65f6\u518d\u7ee7\u7eed \u53ef\u4ee5\u5229\u7528 nowait \u5b50\u53e5\u6765\u53d6\u6d88\u5e76\u884c\u5757\u7ed3\u5c3e\u7684\u9690\u5f0f barrier\uff0c\u907f\u514d\u540c\u6b65\u4ea7\u751f\u7684\u5f00\u9500 #pragma omp single \u00b6 \u67d0\u6bb5\u4ee3\u7801\u5355\u7ebf\u7a0b\u6267\u884c\uff0c\u5e26\u9690\u5f0f\u540c\u6b65\uff08\u4f7f\u7528 nowait \u53bb\u6389\uff09 single \u7528\u6765\u5e8f\u5217\u5316\u4e00\u6bb5\u4ee3\u7801\uff0c\u5373\u5728\u4e00\u4e2a\u8fdb\u7a0b\u4e2d\u6267\u884c\uff08\u5904\u7406\u975e\u7ebf\u7a0b\u5b89\u5168\u7684\u4ee3\u7801\uff0c\u4f8b\u5982 IO\uff09 #pragma omp master \u00b6 \u91c7\u7528\u4e3b\u7ebf\u7a0b\u6267\u884c\uff0c\u65e0\u9690\u5f0f\u540c\u6b65 #pragma omp critical \u00b6 \u67d0\u6bb5\u4ee3\u7801\u7ebf\u7a0b\u4e92\u65a5\u6267\u884c #pragma omp atomic \u00b6 \u5355\u4e2a\u7279\u5b9a\u683c\u5f0f\u7684\u8bed\u53e5\u6216\u8bed\u53e5\u7ec4\u4e2d\u67d0\u4e2a\u53d8\u91cf\u8fdb\u884c\u539f\u5b50\u64cd\u4f5c False Sharing \u00b6 \u8017\u65f6\u589e\u52a0 24% \u4e0d\u540c\u6838\u5fc3\u5bf9\u540c\u4e00 cache line \u7684\u540c\u65f6\u8bfb\u5199\u4f1a\u9020\u6210\u4e25\u91cd\u7684\u51b2\u7a81\uff0c\u5bfc\u81f4\u8be5\u7ea7\u7f13\u5b58\u5931\u6548 \u66f4\u591a\u7279\u6027 \u00b6 \u4efb\u52a1\u6784\u9020 \u00b6 \u524d\u8ff0\u7684\u6784\u9020\u90fd\u9075\u5faa Fork-Join \u6a21\u5f0f\uff0c\u5bf9\u4efb\u52a1\u7c7b\u578b\u6709\u9650\u5236 \u4efb\u52a1\uff08task\uff09\u6784\u9020\u5141\u8bb8\u5b9a\u4e49\u4efb\u52a1\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\uff0c\u52a8\u6001\u8c03\u5ea6\u6267\u884c \u5373\u52a8\u6001\u7ba1\u7406\u7ebf\u7a0b\u6c60\uff08thread pool\uff09\u548c\u4efb\u52a1\u6c60\uff08task pool\uff09 \u5411\u91cf\u5316 \u00b6 \u5c06\u5faa\u73af\u8f6c\u6362\u4e3a SIMD \u5faa\u73af aligned \u7528\u4e8e\u5217\u51fa\u5185\u5b58\u5bf9\u9f50\u7684\u6307\u9488 safelen \u7528\u4e8e\u6807\u8bb0\u5faa\u73af\u5c55\u5f00\u65f6\u7684\u6570\u636e\u4f9d\u8d56 \u7f16\u8bd1\u5668\u4e5f\u81ea\u5e26\u5411\u91cf\u5316\u529f\u80fd\uff0c\u4f8b\u5982 gcc -O3 -ffast-math -fivopts -march=native -fopt-info-vec -fopt-info-vec-missed GPU \u652f\u6301 \u00b6 \u4ece OpenMP API 4.0 \u5f00\u59cb\u652f\u6301 GPU \u52a0\u901f","title":"OpenMP \u57fa\u7840"},{"location":"cs/hpc/openmp/#openmp","text":"\u7ea6 1763 \u4e2a\u5b57 38 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f","title":"OpenMP \u57fa\u7840"},{"location":"cs/hpc/openmp/#openmp_1","text":"Open Multi-Processing OpenMP \u662f\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff08API\uff09\uff0c\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a\u4e00\u4e2a\u5e93 \u652f\u6301 C\u3001C++ \u548c Fortran \u652f\u6301\u591a\u79cd\u6307\u4ee4\u96c6\u548c\u64cd\u4f5c\u7cfb\u7edf OpenMP \u7684\u9002\u7528\u8303\u56f4\uff1a\u591a\u7ebf\u7a0b\u3001\u5171\u4eab\u5185\u5b58 \u5171\u4eab\u5b58\u50a8\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7684\u4e00\u4e2a\u5e76\u884c\u7f16\u7a0b\u6a21\u578b \u9002\u7528\u4e8e SMP\uff08Symmetric Multi-Processor\uff09\u5171\u4eab\u5185\u5b58\u591a\u5904\u7406\u7cfb\u7edf\u548c\u591a\u6838\u5904\u7406\u5668\u4f53\u7cfb\u7ed3\u6784 \u4e09\u7c7b\u4e3b\u8981 API\uff08\u8868\u73b0\u4e3a\u7f16\u8bd1\u5236\u5bfc\u6307\u4ee4\uff0c\u4f46\u5b9e\u9645\u4e0a\u4ecd\u4e3a API\uff09\uff1a\u7f16\u8bd1\u5668\u6307\u4ee4\u3001\u8fd0\u884c\u65f6\u5e93\u51fd\u6570\u3001\u73af\u5883\u53d8\u91cf \u4f20\u7edf\u4e0a\uff0c\u6211\u4eec\u5229\u7528 OpenMP \u8fdb\u884c\u5355\u673a\u5668 CPU \u4f18\u5316\uff08\u53ef\u8de8\u5904\u7406\u5668\uff09\uff0c\u4e0d\u8fc7\u5728\u8f83\u65b0\u7684 OpenMP \u7248\u672c\u7684\u4e2d\uff0c\u4f60\u751a\u81f3\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 OpenMP \u5c06\u4ee3\u7801\u4f18\u5316\u5230 GPU \u7b49\u5f02\u6784\u8ba1\u7b97\u8bbe\u5907\u4e0a","title":"\u4ec0\u4e48\u662f OpenMP"},{"location":"cs/hpc/openmp/#_1","text":"","title":"\u5e76\u884c\u6027"},{"location":"cs/hpc/openmp/#_2","text":"\u8fdb\u7a0b \u6bcf\u4e2a\u8fdb\u7a0b\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u5730\u5740\u7a7a\u95f4 CPU \u5728\u8fdb\u7a0b\u4e4b\u95f4\u5207\u6362\u9700\u8981\u8fdb\u884c\u4e0a\u4e0b\u6587\u5207\u6362 \u7ebf\u7a0b \u4e00\u4e2a\u8fdb\u7a0b\u4e0b\u7684\u7ebf\u7a0b\u5171\u4eab\u5730\u5740\u7a7a\u95f4 CPU \u5728\u7ebf\u7a0b\u4e4b\u95f4\u5207\u6362\u5f00\u9500\u5c0f","title":"\u8fdb\u7a0b\u548c\u7ebf\u7a0b"},{"location":"cs/hpc/openmp/#_3","text":"\u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5c06\u7ebf\u7a0b\u8c03\u5ea6\u5230 CPU \u6838\u5fc3\u8fd0\u884c \u5f53\u7ebf\u7a0b\u6570\u76ee\u8d85\u8fc7\u6838\u5fc3\u6570\uff0c\u4f1a\u51fa\u73b0\u591a\u4e2a\u7ebf\u7a0b\u62a2\u5360\u4e00\u4e2a CPU \u6838\u5fc3\uff0c\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d \u8d85\u7ebf\u7a0b\uff08hyper-threading\uff09\u5c06\u5355\u4e2a CPU \u7269\u7406\u6838\u5fc3\u62bd\u8c61\u4e3a\u591a\u4e2a\uff08\u76ee\u524d\u901a\u5e38\u4e3a 2 \u4e2a\uff09\u903b\u8f91\u6838\u5fc3\uff0c\u5171\u4eab\u7269\u7406\u6838\u5fc3\u7684\u8ba1\u7b97\u8d44\u6e90","title":"\u7ebf\u7a0b\u7684\u786c\u4ef6\u8c03\u5ea6"},{"location":"cs/hpc/openmp/#_4","text":"CPU \u6838\u5fc3\u5728\u4e3b\u5b58\u4e4b\u4e0a\u6709 L1,L2,L3 \u591a\u7ea7\u7f13\u5b58 L1,L2 \u7f13\u5b58\u662f\u6838\u5fc3\u79c1\u6709\u7684 \u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4fdd\u8bc1\u4e0d\u540c\u6838\u5fc3\u7684\u7f13\u5b58\u4e00\u81f4\u6027\uff08coherence\uff09 \u88ab\u79f0\u4e3a cache coherence non-uniform memory access\uff08ccNUMA\uff09 \u7f13\u5b58\u4e00\u81f4\u6027\u4f1a\u5e26\u6765 False Sharing \u7684\u95ee\u9898","title":"\u786c\u4ef6\u7684\u5185\u5b58\u6a21\u578b"},{"location":"cs/hpc/openmp/#fork-join","text":"\u5355\u7ebf\u7a0b\uff08initial thread\uff09\u5f00\u59cb\u6267\u884c \u8fdb\u5165\u5e76\u884c\u533a\uff08parallel region\uff09\u5f00\u59cb\u5e76\u884c\u6267\u884c \u5728\u5e76\u884c\u533a\u7ed3\u5c3e \u8fdb\u884c\u540c\u6b65 \u548c\u7ed3\u675f\u7ebf\u7a0b\uff0c\u7ee7\u7eed\u5355\u7ebf\u7a0b\u6267\u884c\u7a0b\u5e8f","title":"Fork-Join \u6a21\u578b"},{"location":"cs/hpc/openmp/#openmp_2","text":"","title":"OpenMP \u7f16\u7a0b"},{"location":"cs/hpc/openmp/#_5","text":"\u542b\u5728 Ubuntu \u63d0\u4f9b\u7684 build-essential \u5305\u4e2d echo | cpp -fopenmp -dM | grep -i open # #define _OPENMP 201511","title":"\u5b89\u88c5"},{"location":"cs/hpc/openmp/#_6","text":"\u53ef\u4ee5\u76f4\u63a5\u5728\u7f16\u8bd1\u8bed\u53e5\u6dfb\u52a0 -fopenmp \uff0c\u5982 g++ -O2 -std = c++14 -fopenmp hello.cp -o hello \u5982\u679c\u7528 cmake \u6784\u5efa\u9879\u76ee\uff0cgcc \u52a0\u5165 -Wunknown-pragmas \u4f1a\u5728\u7f16\u8bd1\u65f6\u62a5\u544a\u6ca1\u6709\u5904\u7406\u7684 #pragma \uff0c\u53ef\u4ee5\u7528\u6765\u68c0\u67e5\u662f\u5426\u6709\u9057\u6f0f\u7684 OpenMP \u6307\u4ee4 find_package ( OpenMP ) add_compile_options ( -Wunknown-pragmas ) add_executable ( hello src/hello.cpp ) target_link_libraries ( hello OpenMP::OpenMP_CXX )","title":"\u7f16\u8bd1\u4f7f\u7528"},{"location":"cs/hpc/openmp/#_7","text":"\u4f7f\u7528\u65f6\u8981 #include \uff0c\u4e00\u4e9b\u5e38\u7528\u51fd\u6570\uff1a void omp_set_num_threads ( int ) \uff1a\u8bbe\u7f6e\u5e76\u884c\u533a\u8fd0\u884c\u7684\u7ebf\u7a0b\u6570 int omp_get_thread_num ( void ) \uff1a\u83b7\u53d6\u5f53\u524d\u7ebf\u7a0b\u53f7 int omp_get_num_threads ( void ) \uff1a\u83b7\u53d6\u603b\u7ebf\u7a0b\u6570 double omp_get_wtime ( void ) \uff1a\u83b7\u53d6\u65f6\u95f4\uff0c\u5e38\u7528\u4e8e\u8ba1\u7b97\u7ebf\u7a0b\u5185\u8bed\u53e5\u6267\u884c\u65f6\u95f4 double opm_get_wtick ( void ) \uff1a\u83b7\u5f97 omp_get_wtime \u65f6\u95f4\u7cbe\u5ea6 OpenMP \u4f1a\u8bfb\u53d6\u73af\u5883\u53d8\u91cf OMP_NUM_THREADS \u6765\u51b3\u5b9a\u521b\u5efa\u7684\u7ebf\u7a0b\u6570","title":"\u5e93\u51fd\u6570"},{"location":"cs/hpc/openmp/#_8","text":"\u540c\u4e00\u7c7b openmp \u5236\u5bfc\u8bed\u53e5\u79f0\u4e3a\u4e00\u79cd\u6784\u9020\uff08construct\uff09 \u5f62\u5f0f\u4e3a #pragma omp \u4f7f\u7528 {} \u6807\u8bb0\u4f5c\u7528\u7684\u4ee3\u7801\u5757 \u652f\u6301\u7684\u4ece\u53e5 default(shared|none) \uff1a\u6307\u5b9a\u9ed8\u8ba4 shared \uff1a\u9ed8\u8ba4\u4e3a\u5171\u4eab\u53d8\u91cf none \uff1a\u65e0\u9ed8\u8ba4\u53d8\u91cf\u7c7b\u578b\uff0c\u6bcf\u4e2a\u53d8\u91cf\u90fd\u9700\u8981\u53e6\u5916\u6307\u5b9a shared(list) \uff1a\u6307\u5b9a\u5171\u4eab\u53d8\u91cf\u5217\u8868\u53d8\u91cf\u7c7b\u578b \u5171\u4eab\u53d8\u91cf\u5728\u5185\u5b58\u4e2d\u53ea\u6709\u4e00\u4efd\uff0c\u6240\u6709\u7ebf\u7a0b\u90fd\u53ef\u4ee5\u8bbf\u95ee \u8bf7\u4fdd\u8bc1\u5171\u4eab\u8bbf\u95ee\u4e0d\u4f1a\u51b2\u7a81 \u4e0d\u7279\u522b\u6307\u5b9a\u5e76\u884c\u533a\u53d8\u91cf \u9ed8\u8ba4\u4e3ashared private(list) \uff1a\u6307\u5b9a\u79c1\u6709\u53d8\u91cf\u5217\u8868 \u6bcf\u4e2a\u7ebf\u7a0b\u751f\u6210\u4e00\u4efd\u4e0e\u8be5\u79c1\u6709\u53d8\u91cf\u540c\u7c7b\u578b\u7684\u6570\u636e\u5bf9\u8c61 \u53d8\u91cf\u9700\u8981 \u91cd\u65b0\u521d\u59cb\u5316 firstprivate(list) \u540c private \u5bf9\u53d8\u91cf\u6839\u636e\u795d\u7ebf\u7a0b\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u521d\u59cb\u5316 lastprivate(list) \u540cprivate \u6267\u884c\u6700\u540e\u4e00\u4e2a\u5faa\u73af\u7684\u7ebf\u7a0b\u7684\u79c1\u6709\u6570\u636e\u53d6\u51fa\u8d4b\u503c\u7ed9\u4e3b\u7ebf\u7a0b\u7684\u53d8\u91cf nowait \uff1a\u53d6\u6d88\u4ee3\u7801\u5757\u7ed3\u675f\u7684\u6805\u680f\u540c\u6b65\uff08barrier\uff09 collapse(n) \uff1a\u5e94\u7528\u4e8e n \u91cd\u5faa\u73af\uff0c\u5408\u5e76\uff08\u5c55\u5f00\uff09\u5faa\u73af\u5e76\u884c \u6ce8\u610f\u5faa\u73af\u4e4b\u95f4\u662f\u5426\u6709\u6570\u636e\u4f9d\u8d56 ordered \uff1a\u58f0\u660e\u6709\u6f5c\u5728\u7684\u987a\u5e8f\u6267\u884c\u90e8\u5206 \u4f7f\u7528 #pragma omp ordered \u6807\u8bb0\u987a\u5e8f\u6267\u884c\u4ee3\u7801\uff08\u642d\u914d\u4f7f\u7528\uff09 ordered \u533a\u5185\u7684\u8bed\u53e5\u4efb\u610f\u65f6\u523b\u4ec5\u7531\u6700\u591a\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c schedule(type [, chuck]) \uff1a\u63a7\u5236\u8c03\u5ea6\u65b9\u5f0f static \uff1achunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 n/p\uff09 dynamic \uff1a\u52a8\u6001\u8c03\u5ea6\uff0cchunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 1\uff09 guided \uff1achunk \u5927\u5c0f\u52a8\u6001\u9012\u51cf runtime \uff1a\u7531\u7cfb\u7edf\u73af\u5883 OMP_SCHEDULE \u51b3\u5b9a","title":"\u5236\u5bfc\u8bed\u53e5"},{"location":"cs/hpc/openmp/#parallel","text":"\u4f7f\u7528 #pragma omp parallel \u521b\u5efa\u5e76\u884c\u5757\u6765\u5e76\u884c\u8fd0\u884c\u540c\u4e00\u6bb5\u7a0b\u5e8f\uff1a #include #include #include int main () { #pragma omp parallel { int ID = omp_get_thread_num (); printf ( \"thread #%d \\n \" , ID ); } }","title":"parallel \u7ebf\u7a0b\u5e76\u884c"},{"location":"cs/hpc/openmp/#for","text":"parallel \u5757\u5185\u53ef\u4ee5\u4f7f\u7528 #pragma omp for \u6765\u5bf9 for \u5faa\u73af\u8fdb\u884c\u5e76\u884c\uff0c\u76f8\u5f53\u4e8e\u5c06\u5faa\u73af\u62c6\u6210\u4e0d\u540c\u90e8\u5206\u5206\u914d\u7ed9\u591a\u4e2a\u7ebf\u7a0b \u683c\u5f0f\u8981\u6c42 init-expr: \u9700\u8981\u662f var=lb \u5f62\u5f0f\uff0c\u7c7b\u578b\u4e5f\u6709\u9650\u5236 test-expr: \u9650\u5236\u4e3a var reational-opb \u6216\u8005 b relational-opb var incr-expr: \u9650\u5236\u4e3a var=var +/- incr \u6216\u8005 var=var +/- incr #pragma omp parallel { #pragma omp for { for ( int i = 0 ; i < N ; ++ i ) { c [ i ] = a [ i ] + b [ i ]; } } } parallel \u548c for \u53ef\u4ee5\u5408\u8d77\u6765\u5199\u4f5c\u4e00\u884c #pragma omp parallel for","title":"for \u5faa\u73af\u5e76\u884c"},{"location":"cs/hpc/openmp/#if","text":"\u53ef\u4ee5\u5728\u5236\u5bfc\u8bed\u53e5\u540e\u9762\u52a0 if \u5b50\u53e5\u6765\u51b3\u5b9a\u662f\u5426\u8fdb\u884c\u5e76\u884c\uff1a #pragma omp parallel if(x) num_threads(4) { ... } \u5982\u679c x \u4e0d\u4e3a 0 \u5219\u5206\u4e3a\u56db\u4e2a\u7ebf\u7a0b\u6267\u884c\u5757\u5185\u5185\u5bb9 \u5982\u679c x \u4e3a 0 \u5219\u7531\u4e3b\u7ebf\u7a0b\u4e32\u884c\u6267\u884c","title":"if \u6761\u4ef6\u5e76\u884c"},{"location":"cs/hpc/openmp/#reduction","text":"fork \u7ebf\u7a0b\u5e76\u5206\u914d\u4efb\u52a1 \u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u5b9a\u4e49\u4e00\u4e2a\u79c1\u6709\u53d8\u91cf omp_private \uff0c\u540c private \u5404\u4e2a\u7ebf\u7a0b\u6267\u884c\u8ba1\u7b97 \u6240\u6709 omp_priv \u548c omp_in \u4e00\u8d77\u987a\u5e8f\u8fdb\u884c reduction\uff0c\u5199\u56de\u539f\u53d8\u91cf","title":"reduction \u6267\u884c\u8fc7\u7a0b"},{"location":"cs/hpc/openmp/#_9","text":"","title":"\u540c\u6b65\u6784\u9020"},{"location":"cs/hpc/openmp/#pragma-omp-sections","text":"\u5c06\u5e76\u884c\u533a\u5185\u7684\u4ee3\u7801\u5757\u5212\u5206\u4e3a\u591a\u4e2a section \u5206\u914d\u6267\u884c \u53ef\u4ee5\u642d\u914d parallel \u5408\u5e76\u4e3a #pragma omp parallel sections \u6784\u9020 \u6bcf\u4e2a section \u7531\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c \u7ebf\u7a0b\u6570\u5927\u4e8e section \u6570\u76ee\uff1a\u90e8\u5206\u7ebf\u7a0b\u7a7a\u95f2 \u7ebf\u7a0b\u6570\u5c0f\u4e8e section \u6570\u76ee\uff0c\u90e8\u5206\u7ebf\u7a0b\u5206\u914d\u591a\u4e2a section #pragma omp parallel sections { #pragma omp section code1 (); #pragma omp section code2 (); }","title":"#pragma omp sections"},{"location":"cs/hpc/openmp/#pragma-omp-barrier","text":"\u5728\u7279\u5b9a\u4f4d\u7f6e\u8fdb\u884c\u6805\u680f\u540c\u6b65 \u6bcf\u4e2a\u5e76\u884c\u5757\u90fd\u542b\u6709\u9690\u5f0f\u7684 barrier\uff0c\u4e5f\u5c31\u662f\u5728\u6240\u6709\u7ebf\u7a0b\u90fd\u7ed3\u675f\u540e\u624d\u80fd\u7ee7\u7eed\u5411\u4e0b\u8fd0\u884c \u5728\u5e76\u884c\u5757\u5185\u4e5f\u53ef\u4ee5\u5229\u7528 #pragma omp barrier \u6765\u540c\u6b65\u5404\u7ebf\u7a0b\uff0c\u5373\u6240\u6709\u7ebf\u7a0b\u90fd\u89e6\u78b0\u5230 barrier \u65f6\u518d\u7ee7\u7eed \u53ef\u4ee5\u5229\u7528 nowait \u5b50\u53e5\u6765\u53d6\u6d88\u5e76\u884c\u5757\u7ed3\u5c3e\u7684\u9690\u5f0f barrier\uff0c\u907f\u514d\u540c\u6b65\u4ea7\u751f\u7684\u5f00\u9500","title":"#pragma omp barrier"},{"location":"cs/hpc/openmp/#pragma-omp-single","text":"\u67d0\u6bb5\u4ee3\u7801\u5355\u7ebf\u7a0b\u6267\u884c\uff0c\u5e26\u9690\u5f0f\u540c\u6b65\uff08\u4f7f\u7528 nowait \u53bb\u6389\uff09 single \u7528\u6765\u5e8f\u5217\u5316\u4e00\u6bb5\u4ee3\u7801\uff0c\u5373\u5728\u4e00\u4e2a\u8fdb\u7a0b\u4e2d\u6267\u884c\uff08\u5904\u7406\u975e\u7ebf\u7a0b\u5b89\u5168\u7684\u4ee3\u7801\uff0c\u4f8b\u5982 IO\uff09","title":"#pragma omp single"},{"location":"cs/hpc/openmp/#pragma-omp-master","text":"\u91c7\u7528\u4e3b\u7ebf\u7a0b\u6267\u884c\uff0c\u65e0\u9690\u5f0f\u540c\u6b65","title":"#pragma omp master"},{"location":"cs/hpc/openmp/#pragma-omp-critical","text":"\u67d0\u6bb5\u4ee3\u7801\u7ebf\u7a0b\u4e92\u65a5\u6267\u884c","title":"#pragma omp critical"},{"location":"cs/hpc/openmp/#pragma-omp-atomic","text":"\u5355\u4e2a\u7279\u5b9a\u683c\u5f0f\u7684\u8bed\u53e5\u6216\u8bed\u53e5\u7ec4\u4e2d\u67d0\u4e2a\u53d8\u91cf\u8fdb\u884c\u539f\u5b50\u64cd\u4f5c","title":"#pragma omp atomic"},{"location":"cs/hpc/openmp/#false-sharing","text":"\u8017\u65f6\u589e\u52a0 24% \u4e0d\u540c\u6838\u5fc3\u5bf9\u540c\u4e00 cache line \u7684\u540c\u65f6\u8bfb\u5199\u4f1a\u9020\u6210\u4e25\u91cd\u7684\u51b2\u7a81\uff0c\u5bfc\u81f4\u8be5\u7ea7\u7f13\u5b58\u5931\u6548","title":"False Sharing"},{"location":"cs/hpc/openmp/#_10","text":"","title":"\u66f4\u591a\u7279\u6027"},{"location":"cs/hpc/openmp/#_11","text":"\u524d\u8ff0\u7684\u6784\u9020\u90fd\u9075\u5faa Fork-Join \u6a21\u5f0f\uff0c\u5bf9\u4efb\u52a1\u7c7b\u578b\u6709\u9650\u5236 \u4efb\u52a1\uff08task\uff09\u6784\u9020\u5141\u8bb8\u5b9a\u4e49\u4efb\u52a1\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\uff0c\u52a8\u6001\u8c03\u5ea6\u6267\u884c \u5373\u52a8\u6001\u7ba1\u7406\u7ebf\u7a0b\u6c60\uff08thread pool\uff09\u548c\u4efb\u52a1\u6c60\uff08task pool\uff09","title":"\u4efb\u52a1\u6784\u9020"},{"location":"cs/hpc/openmp/#_12","text":"\u5c06\u5faa\u73af\u8f6c\u6362\u4e3a SIMD \u5faa\u73af aligned \u7528\u4e8e\u5217\u51fa\u5185\u5b58\u5bf9\u9f50\u7684\u6307\u9488 safelen \u7528\u4e8e\u6807\u8bb0\u5faa\u73af\u5c55\u5f00\u65f6\u7684\u6570\u636e\u4f9d\u8d56 \u7f16\u8bd1\u5668\u4e5f\u81ea\u5e26\u5411\u91cf\u5316\u529f\u80fd\uff0c\u4f8b\u5982 gcc -O3 -ffast-math -fivopts -march=native -fopt-info-vec -fopt-info-vec-missed","title":"\u5411\u91cf\u5316"},{"location":"cs/hpc/openmp/#gpu","text":"\u4ece OpenMP API 4.0 \u5f00\u59cb\u652f\u6301 GPU \u52a0\u901f","title":"GPU \u652f\u6301"},{"location":"cs/hpc/outline/","text":"\u6982\u8bba \u00b6 \u7ea6 564 \u4e2a\u5b57 24 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f \u4ec0\u4e48\u662f\u8d85\u7b97 \u00b6 \u8d85\u7ea7\u8ba1\u7b97\u673a\uff0c\u662f\u6307\u80fd\u591f\u6267\u884c\u4e00\u822c\u4e2a\u4eba\u7535\u8111\u65e0\u6cd5\u5904\u7406\u7684\u9ad8\u901f\u8fd0\u7b97\u7684\u8ba1\u7b97\u673a\uff0c\u89c4\u683c\u4e0e\u6027\u80fd\u6bd4\u4e2a\u4eba\u8ba1\u7b97\u673a\u5f3a\u5927\u8bb8\u591a\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u5f00\u53d1\u5de5\u5177 \u00b6 SIMD: AVX/SSE \u00b6 \u9ad8\u7ea7\u5411\u91cf\u6269\u5c55\u6307\u4ee4\u96c6\uff08AVX\uff09\u662f x86 \u67b6\u6784\u5fae\u5904\u7406\u5668\u4e2d\u7684\u6307\u4ee4\u96c6\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u5355\u6307\u4ee4\u591a\u6570\u636e\u6d41\uff08Single Instruction Multiple Data\uff09\uff0c\u5728\u786c\u4ef6\u5c42\u9762\u4e0a\u63d0\u4f9b\u4e86\u901a\u8fc7\u4e00\u6761\u6307\u4ee4\u8fd0\u884c\u591a\u4e2a\u8fd0\u7b97\u7684\u65b9\u6cd5 \u5728 x86 \u67b6\u6784\u4e0b\uff0cSIMD \u4e00\u534a\u548c SSE \u548c AVX \u7b49\u6307\u4ee4\u96c6\u8054\u7cfb\u5728\u4e00\u8d77\uff0cSSE \u548c AVX \u6307\u4ee4\u96c6\u4e2d\u63d0\u4f9b\u4e86\u5927\u91cf\u53ef\u4ee5\u5355\u6307\u4ee4\u64cd\u4f5c\u591a\u4e2a\u6570\u636e\u5355\u5143\u7684\u6307\u4ee4 \u4e0b\u9762\u662f SISD \u548c SIMD \u7684\u6bd4\u8f83 SISD vectorAdd ( float * a , float * b , float * c ) { for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } } SIMD \u901a\u8fc7\u4e00\u6761 CPU \u6307\u4ee4\uff0c\u5e76\u884c\u6267\u884c 8 \u4e2a float \u7684\u52a0 __m256 vectorAdd ( __m256 a , __m256 b , __m256 c ) { return _mm256_add_ps ( a , b ); } SIMT: CUDA/ROCM/OPENCL \u00b6 CUDA\uff08Compute Unified Device Architecture, \u7edf\u4e00\u8ba1\u7b97\u67b6\u6784\uff09\u662f\u7531\u82f1\u4f1f\u8fbe NVIDIA \u6240\u63a8\u51fa\u7684\u4e00\u79cd\u96c6\u6210\u6280\u672f\uff0c\u662f\u8be5\u516c\u53f8\u5bf9\u4e8e GPU \u7684\u6b63\u5f0f\u540d\u79f0\u3002 ROCm \u662f Advanced Micro Devices\uff08AMD\uff09\u7684\u8f6f\u4ef6\u6808\uff0c\u7528\u4e8e\u56fe\u5f62\u5904\u7406\u5355\u5143 GPGPU \u7f16\u7a0b\u3002 OpenCL\uff08Open Computing Language\uff0c\u5f00\u653e\u8ba1\u7b97\u8bed\u8a00\uff09\u662f\u4e00\u4e2a\u4e3a\u5f02\u6784\u5e73\u53f0\u7f16\u5199\u7a0b\u5e8f\u7684\u6846\u67b6\uff0c\u6b64\u5f02\u6784\u5e73\u53f0\u53ef\u7531 CPU\u3001GPU\u3001DSP\u3001FPGA \u6216\u5176\u5b83\u7c7b\u578b\u7684\u5904\u7406\u5668\u4e0e\u786c\u4f53\u52a0\u901f\u5668\u6240\u7ec4\u6210\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 CUDA __global__ void vectorAdd ( float * a , float * b , float * c ) { int tid = blockIdx . x ; if ( tid < 8 ) c [ tid ] = a [ tid ] + b [ tid ]; } OpenCL _kernel void vectorAdd ( global const float * a , global const float * b , global const float * c ) { int gid = get_global_id ( 0 ); if ( gid < 8 ) c [ gid ] = a [ gid ] + b [ gid ]; } MULTI-THREAD: OPENMP \u00b6 OpenMP \u662f\u4e00\u5957\u652f\u6301\u8de8\u5e73\u53f0\u5171\u4eab\u5185\u5b58\u65b9\u5f0f\u7684\u591a\u7ebf\u7a0b\u5e76\u53d1\u7684\u7f16\u7a0b API\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u4e3a\u4e86\u5229\u7528\u591a\u7ebf\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u66f4\u4f4e\u5c42\u7684\u5e93\u8fdb\u884c\u5f00\u53d1\uff08Linux \u4e0b\u7684 pthread\uff09\uff0cOpenMP \u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u7edf\u4e00\u4e14\u7b80\u6d01\u4e14\u8de8\u5e73\u53f0\u7684\u65b9\u5f0f\u8fdb\u884c\u5f00\u53d1\u3002 OpenMP vectorAdd ( float * a , float * b , float * c ) { #pragma omp for for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } } \u6027\u80fd\u8c03\u4f18 \u00b6 CPU \u00b6 CPU \u901a\u8fc7\u5c06\u6570\u636e\u7f13\u5b58\u5230 L1/L2/L3 Cache \u4e2d\u907f\u514d\u5bf9\u5185\u5b58\u7684\u9891\u7e41\u8bbf\u95ee\u9020\u6210\u7684\u4f4e\u6548 \u4f18\u5316\u65b9\u6cd5 \u5faa\u73af\u5c55\u5f00 \u5185\u5b58\u9884\u53d6 ... CPU \u672c\u8eab\u662f\u4e00\u4e2a\u6d41\u6c34\u7ebf\u7ed3\u6784\uff0c\u6267\u884c\u6bcf\u4e00\u6761\u6307\u4ee4\u5206\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u6d41\u6c34\u7ebf\u5730\u6267\u884c\u3002 \u5728\u51fa\u73b0\u5206\u652f\u7684\u5730\u65b9\u53ef\u80fd\u5bfc\u81f4\u6d41\u6c34\u7ebf\u65e0\u6cd5\u6b63\u5e38\u88ab\u586b\u5145 \u4f18\u5316\u65b9\u6cd5 \u5206\u652f\u9884\u6d4b GPU \u00b6 CUDA \u5f00\u53d1\u4e2d\u7684\u95ee\u9898 \u7ebf\u7a0b\u675f\u5206\u5316 \u7406\u89e3 GPU \u5185\u5b58\u6a21\u578b \u5e76\u53d1 ... RDMA \u00b6 \u5728\u6570\u636e\u4e2d\u5fc3\u9886\u57df\uff0c\u8fdc\u7a0b\u76f4\u63a5\u5185\u5b58\u8bbf\u95ee\u3002\u9002\u5408\u5927\u89c4\u6a21\u5e76\u884c\u8ba1\u7b97\u673a\u96c6\u7fa4\u3002","title":"\u6982\u8bba"},{"location":"cs/hpc/outline/#_1","text":"\u7ea6 564 \u4e2a\u5b57 24 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f","title":"\u6982\u8bba"},{"location":"cs/hpc/outline/#_2","text":"\u8d85\u7ea7\u8ba1\u7b97\u673a\uff0c\u662f\u6307\u80fd\u591f\u6267\u884c\u4e00\u822c\u4e2a\u4eba\u7535\u8111\u65e0\u6cd5\u5904\u7406\u7684\u9ad8\u901f\u8fd0\u7b97\u7684\u8ba1\u7b97\u673a\uff0c\u89c4\u683c\u4e0e\u6027\u80fd\u6bd4\u4e2a\u4eba\u8ba1\u7b97\u673a\u5f3a\u5927\u8bb8\u591a\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1","title":"\u4ec0\u4e48\u662f\u8d85\u7b97"},{"location":"cs/hpc/outline/#_3","text":"","title":"\u5f00\u53d1\u5de5\u5177"},{"location":"cs/hpc/outline/#simd-avxsse","text":"\u9ad8\u7ea7\u5411\u91cf\u6269\u5c55\u6307\u4ee4\u96c6\uff08AVX\uff09\u662f x86 \u67b6\u6784\u5fae\u5904\u7406\u5668\u4e2d\u7684\u6307\u4ee4\u96c6\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u5355\u6307\u4ee4\u591a\u6570\u636e\u6d41\uff08Single Instruction Multiple Data\uff09\uff0c\u5728\u786c\u4ef6\u5c42\u9762\u4e0a\u63d0\u4f9b\u4e86\u901a\u8fc7\u4e00\u6761\u6307\u4ee4\u8fd0\u884c\u591a\u4e2a\u8fd0\u7b97\u7684\u65b9\u6cd5 \u5728 x86 \u67b6\u6784\u4e0b\uff0cSIMD \u4e00\u534a\u548c SSE \u548c AVX \u7b49\u6307\u4ee4\u96c6\u8054\u7cfb\u5728\u4e00\u8d77\uff0cSSE \u548c AVX \u6307\u4ee4\u96c6\u4e2d\u63d0\u4f9b\u4e86\u5927\u91cf\u53ef\u4ee5\u5355\u6307\u4ee4\u64cd\u4f5c\u591a\u4e2a\u6570\u636e\u5355\u5143\u7684\u6307\u4ee4 \u4e0b\u9762\u662f SISD \u548c SIMD \u7684\u6bd4\u8f83 SISD vectorAdd ( float * a , float * b , float * c ) { for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } } SIMD \u901a\u8fc7\u4e00\u6761 CPU \u6307\u4ee4\uff0c\u5e76\u884c\u6267\u884c 8 \u4e2a float \u7684\u52a0 __m256 vectorAdd ( __m256 a , __m256 b , __m256 c ) { return _mm256_add_ps ( a , b ); }","title":"SIMD: AVX/SSE"},{"location":"cs/hpc/outline/#simt-cudarocmopencl","text":"CUDA\uff08Compute Unified Device Architecture, \u7edf\u4e00\u8ba1\u7b97\u67b6\u6784\uff09\u662f\u7531\u82f1\u4f1f\u8fbe NVIDIA \u6240\u63a8\u51fa\u7684\u4e00\u79cd\u96c6\u6210\u6280\u672f\uff0c\u662f\u8be5\u516c\u53f8\u5bf9\u4e8e GPU \u7684\u6b63\u5f0f\u540d\u79f0\u3002 ROCm \u662f Advanced Micro Devices\uff08AMD\uff09\u7684\u8f6f\u4ef6\u6808\uff0c\u7528\u4e8e\u56fe\u5f62\u5904\u7406\u5355\u5143 GPGPU \u7f16\u7a0b\u3002 OpenCL\uff08Open Computing Language\uff0c\u5f00\u653e\u8ba1\u7b97\u8bed\u8a00\uff09\u662f\u4e00\u4e2a\u4e3a\u5f02\u6784\u5e73\u53f0\u7f16\u5199\u7a0b\u5e8f\u7684\u6846\u67b6\uff0c\u6b64\u5f02\u6784\u5e73\u53f0\u53ef\u7531 CPU\u3001GPU\u3001DSP\u3001FPGA \u6216\u5176\u5b83\u7c7b\u578b\u7684\u5904\u7406\u5668\u4e0e\u786c\u4f53\u52a0\u901f\u5668\u6240\u7ec4\u6210\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 CUDA __global__ void vectorAdd ( float * a , float * b , float * c ) { int tid = blockIdx . x ; if ( tid < 8 ) c [ tid ] = a [ tid ] + b [ tid ]; } OpenCL _kernel void vectorAdd ( global const float * a , global const float * b , global const float * c ) { int gid = get_global_id ( 0 ); if ( gid < 8 ) c [ gid ] = a [ gid ] + b [ gid ]; }","title":"SIMT: CUDA/ROCM/OPENCL"},{"location":"cs/hpc/outline/#multi-thread-openmp","text":"OpenMP \u662f\u4e00\u5957\u652f\u6301\u8de8\u5e73\u53f0\u5171\u4eab\u5185\u5b58\u65b9\u5f0f\u7684\u591a\u7ebf\u7a0b\u5e76\u53d1\u7684\u7f16\u7a0b API\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u4e3a\u4e86\u5229\u7528\u591a\u7ebf\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u66f4\u4f4e\u5c42\u7684\u5e93\u8fdb\u884c\u5f00\u53d1\uff08Linux \u4e0b\u7684 pthread\uff09\uff0cOpenMP \u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u7edf\u4e00\u4e14\u7b80\u6d01\u4e14\u8de8\u5e73\u53f0\u7684\u65b9\u5f0f\u8fdb\u884c\u5f00\u53d1\u3002 OpenMP vectorAdd ( float * a , float * b , float * c ) { #pragma omp for for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } }","title":"MULTI-THREAD: OPENMP"},{"location":"cs/hpc/outline/#_4","text":"","title":"\u6027\u80fd\u8c03\u4f18"},{"location":"cs/hpc/outline/#cpu","text":"CPU \u901a\u8fc7\u5c06\u6570\u636e\u7f13\u5b58\u5230 L1/L2/L3 Cache \u4e2d\u907f\u514d\u5bf9\u5185\u5b58\u7684\u9891\u7e41\u8bbf\u95ee\u9020\u6210\u7684\u4f4e\u6548 \u4f18\u5316\u65b9\u6cd5 \u5faa\u73af\u5c55\u5f00 \u5185\u5b58\u9884\u53d6 ... CPU \u672c\u8eab\u662f\u4e00\u4e2a\u6d41\u6c34\u7ebf\u7ed3\u6784\uff0c\u6267\u884c\u6bcf\u4e00\u6761\u6307\u4ee4\u5206\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u6d41\u6c34\u7ebf\u5730\u6267\u884c\u3002 \u5728\u51fa\u73b0\u5206\u652f\u7684\u5730\u65b9\u53ef\u80fd\u5bfc\u81f4\u6d41\u6c34\u7ebf\u65e0\u6cd5\u6b63\u5e38\u88ab\u586b\u5145 \u4f18\u5316\u65b9\u6cd5 \u5206\u652f\u9884\u6d4b","title":"CPU"},{"location":"cs/hpc/outline/#gpu","text":"CUDA \u5f00\u53d1\u4e2d\u7684\u95ee\u9898 \u7ebf\u7a0b\u675f\u5206\u5316 \u7406\u89e3 GPU \u5185\u5b58\u6a21\u578b \u5e76\u53d1 ...","title":"GPU"},{"location":"cs/hpc/outline/#rdma","text":"\u5728\u6570\u636e\u4e2d\u5fc3\u9886\u57df\uff0c\u8fdc\u7a0b\u76f4\u63a5\u5185\u5b58\u8bbf\u95ee\u3002\u9002\u5408\u5927\u89c4\u6a21\u5e76\u884c\u8ba1\u7b97\u673a\u96c6\u7fa4\u3002","title":"RDMA"},{"location":"cs/hpc/vectorizecompute/","text":"\u5411\u91cf\u5316\u8ba1\u7b97 \u00b6","title":"\u5411\u91cf\u5316\u8ba1\u7b97"},{"location":"cs/hpc/vectorizecompute/#_1","text":"","title":"\u5411\u91cf\u5316\u8ba1\u7b97"},{"location":"cs/others/regex/","text":"\u6b63\u5219\u8868\u8fbe\u5f0f \u00b6 \u7ea6 2398 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f \u6b63\u5219\u8868\u8fbe\u5f0f\uff08Regular Expression\uff09\u4f7f\u7528\u5355\u4e2a\u5b57\u7b26\u4e32\u6765\u63cf\u8ff0\u3001\u5339\u914d\u4e00\u7cfb\u5217\u5339\u914d\u67d0\u4e2a\u53e5\u6cd5\u89c4\u5219\u7684\u5b57\u7b26\u4e32\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 Abstract \u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u4e14\u5f3a\u5927\u7684\u65b9\u5f0f\u6765\u67e5\u627e\u3001\u66ff\u6362\u3001\u9a8c\u8bc1\u548c\u63d0\u53d6\u6587\u672c\u6570\u636e\u3002\u5b66\u4e60\u4e0d\u6613\uff0c\u4f46\u4f7f\u7528\u8d77\u6765\u5f88\u8212\u670d\ud83d\ude0c RegExr \u6b63\u5219\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177 Regulex \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 HackerRank regex \u4e60\u9898\u96c6 copy from TonyCrane/note \u8bed\u6cd5 \u00b6 \u666e\u901a\u5b57\u7b26 \u00b6 \u666e\u901a\u5b57\u7b26\u5305\u62ec\u6ca1\u6709\u663e\u5f0f\u6307\u5b9a\u4e3a\u5143\u5b57\u7b26\u7684\u6240\u6709\u53ef\u6253\u5370\u548c\u4e0d\u53ef\u6253\u5370\u5b57\u7b26\u3002\u8fd9\u5305\u62ec\u6240\u6709\u5927\u5199\u548c\u5c0f\u5199\u5b57\u6bcd\u3001\u6240\u6709\u6570\u5b57\u3001\u6240\u6709\u6807\u70b9\u7b26\u53f7\u548c\u4e00\u4e9b\u5176\u4ed6\u7b26\u53f7\u3002 \u8bed\u6cd5 \u63cf\u8ff0 [...] \u5339\u914d\u4efb\u610f\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [ABC] \u5339\u914d\u6240\u6709 A B C \u5b57\u7b26 [^...] \u5339\u914d\u4efb\u610f\u4e0d\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [^ABC] \u5339\u914d\u9664\u4e86 A B C \u5916\u7684\u6240\u6709\u5355\u4e2a\u5b57\u7b26 [x-y] \u6309\u7167\u987a\u5e8f\u5339\u914d\u4ece x \u5230 y \u5230\u6240\u6709\u5b57\u7b26\uff0c\u5982 [a-z] \u5339\u914d\u6240\u6709\u5c0f\u5199\u5b57\u6bcd\uff0c[A-E] \u5339\u914d A \u5230 E \u8fd9\u4e94\u4e2a\u5b57\u7b26\uff5c \\s\\S \u5339\u914d\u6240\u6709\uff0c\\s \u662f\u5339\u914d\u6240\u6709\u7a7a\u767d\u7b26\uff08\u5305\u62ec\u6362\u884c\uff09\uff0c\\S \u975e\u7a7a\u767d\u7b26\uff08\u4e0d\u5305\u62ec\u6362\u884c\uff09 . \u5339\u914d\u4efb\u610f\u9664\u4e86\u6362\u884c\u7b26\u4ee5\u5916\u7684\u5b57\u7b26 \\w \u5339\u914d\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf\uff0c\u76f8\u5f53\u4e8e [a-zA-Z0-9_] x|y \u5339\u914d x \u6216 y \uff0c\u4f18\u5148\u7ea7\u6700\u4f4e\uff0c\u5982 a | bcd \u5339\u914d a \u6216 bcd \u975e\u6253\u5370\u5b57\u7b26 \u00b6 \u8bed\u6cd5 \u63cf\u8ff0 \\cx \u5339\u914d\u7531x\u6307\u660e\u7684\u63a7\u5236\u5b57\u7b26\u3002\u4f8b\u5982\uff0c \\cM \u5339\u914d\u4e00\u4e2a Control-M \u6216\u56de\u8f66\u7b26\u3002x \u7684\u503c\u5fc5\u987b\u4e3a A-Z \u6216 a-z \u4e4b\u4e00\u3002\u5426\u5219\uff0c\u5c06 c \u89c6\u4e3a\u4e00\u4e2a\u539f\u4e49\u7684 'c' \u5b57\u7b26\u3002 \\f \u5339\u914d\u4e00\u4e2a\u6362\u9875\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0c \u548c \\cL\u3002 \\n \u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0a \u548c \\cJ\u3002 \\r \u5339\u914d\u4e00\u4e2a\u56de\u8f66\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0d \u548c \\cM\u3002 \\s \u5339\u914d\u4efb\u4f55\u7a7a\u767d\u5b57\u7b26\uff0c\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49\u3002\u7b49\u4ef7\u4e8e [ \\f\\n\\r\\t\\v]\u3002\u6ce8\u610f Unicode \u6b63\u5219\u8868\u8fbe\u5f0f\u4f1a\u5339\u914d\u5168\u89d2\u7a7a\u683c\u7b26\u3002 \\S \u5339\u914d\u4efb\u4f55\u975e\u7a7a\u767d\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e [^ \\f\\n\\r\\t\\v]\u3002 \\t \u5339\u914d\u4e00\u4e2a\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x09 \u548c \\cI\u3002 \\v \u5339\u914d\u4e00\u4e2a\u5782\u76f4\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0b \u548c \\cK\u3002 \u7279\u6b8a\u5b57\u7b26 \u00b6 \u6709\u4e00\u4e9b\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002 \u8bed\u6cd5 \u63cf\u8ff0 $ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86 RegExp \u5bf9\u8c61\u7684 Multiline \u5c5e\u6027\uff0c\u5219 $ \u4e5f\u5339\u914d '\\n' () \u6807\u8bb0\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002\u5b50\u8868\u8fbe\u5f0f\u53ef\u4ee5\u83b7\u53d6\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u8981\u5339\u914d\u8fd9\u4e9b\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\( \u548c \\)\u3002 * \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d * \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\*\u3002 + \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u4e00\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d + \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\+\u3002 . \u5339\u914d\u9664\u6362\u884c\u7b26 \\n \u4e4b\u5916\u7684\u4efb\u4f55\u5355\u5b57\u7b26\u3002\u8981\u5339\u914d . \uff0c\u8bf7\u4f7f\u7528 \\. \u3002 [ \u6807\u8bb0\u4e00\u4e2a\u4e2d\u62ec\u53f7\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d [\uff0c\u8bf7\u4f7f\u7528 \\[\u3002 ? \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u4e00\u6b21\uff0c\u6216\u6307\u660e\u4e00\u4e2a\u975e\u8d2a\u5a6a\u9650\u5b9a\u7b26\u3002\u8981\u5339\u914d ? \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\?\u3002 \\ \u5c06\u4e0b\u4e00\u4e2a\u5b57\u7b26\u6807\u8bb0\u4e3a\u6216\u7279\u6b8a\u5b57\u7b26\u3001\u6216\u539f\u4e49\u5b57\u7b26\u3001\u6216\u5411\u540e\u5f15\u7528\u3001\u6216\u516b\u8fdb\u5236\u8f6c\u4e49\u7b26\u3002\u4f8b\u5982\uff0c'n' \u5339\u914d\u5b57\u7b26 'n'\u3002'\\n' \u5339\u914d\u6362\u884c\u7b26\u3002\u5e8f\u5217 '\\\\' \u5339\u914d \"\\\"\uff0c\u800c '\\(' \u5219\u5339\u914d \"(\"\u3002 ^ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9664\u975e\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\uff0c\u5f53\u8be5\u7b26\u53f7\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\u65f6\uff0c\u8868\u793a\u4e0d\u63a5\u53d7\u8be5\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u7684\u5b57\u7b26\u96c6\u5408\u3002\u8981\u5339\u914d ^ \u5b57\u7b26\u672c\u8eab\uff0c\u8bf7\u4f7f\u7528 \\^\u3002 { \u6807\u8bb0\u9650\u5b9a\u7b26\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d {\uff0c\u8bf7\u4f7f\u7528 \\{\u3002 | \u6307\u660e\u4e24\u9879\u4e4b\u95f4\u7684\u4e00\u4e2a\u9009\u62e9\u3002\u8981\u5339\u914d | \uff0c\u8bf7\u4f7f\u7528 \\|\u3002 \u9650\u5b9a\u7b26 \u00b6 \u7528\u6765\u6307\u5b9a\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u51fa\u73b0\u4e86\u591a\u5c11\u6b21 \u8bed\u6cd5 \u63cf\u8ff0 {n} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u51c6\u786e\u7684 n \u6b21\uff0c\u5982 o{2} \u5339\u914d\u4e24\u4e2a\u8fde\u7eed\u7684 o {n,} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u5982 o{2,} \u53ef\u4ee5\u5339\u914d goooood \u4e2d\u7684\u6240\u6709 o\uff0c\u4f46\u4e0d\u5339\u914d god \u4e2d\u7684 o {n,m} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u81f3\u591a m \u6b21 * \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 0 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {0,} + \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 1 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {1,} ? \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u53ef\u6709\u53ef\u65e0\uff08\u5339\u914d 0 \u6b21\u6216 1 \u6b21\uff09\uff0c\u76f8\u5f53\u4e8e {0,1} \u8d2a\u5a6a \u00b6 * \u548c + \u7684\u5339\u914d\u90fd\u662f\u8d2a\u5a6a\u7684\uff0c\u5373\u5c3d\u53ef\u80fd\u5339\u914d\u66f4\u591a\u7684\u5b57\u7b26\uff0c\u800c\u5728\u5b83\u4eec\u540e\u9762\u52a0\u4e0a ? \u5c31\u53ef\u4ee5\u975e\u8d2a\u5a6a\uff08\u5373\u6700\u5c0f\u5339\u914d\uff09 <.*> \u4f1a\u5339\u914d\u6574\u4e2a

    header

    \u5b57\u7b26\u4e32 <.*?> \u53ea\u4f1a\u5339\u914d\u5176\u4e2d\u7684

    \u548c

    \u5b9a\u4f4d\u7b26 \u00b6 \u53ea\u5339\u914d\u4f4d\u7f6e\uff0c\u6ca1\u6709\u5b57\u7b26\u4e0e\u4e4b\u5bf9\u5e94 \u8bed\u6cd5 \u63cf\u8ff0 ^ \u5339\u914d\u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5982\u679c\u662f\u591a\u884c\u6a21\u5f0f\uff0c\u5219\u65b0\u7684\u4e00\u884c\u4e5f\u7b97\u65b0\u7684\u5b57\u7b26\u4e32 $ \u5339\u914d\u5b57\u7b26\u4e32\u7ed3\u5c3e\uff0c\u591a\u884c\u6a21\u5f0f\u540c\u7406\u770b\u6210\u591a\u4e2a\u5b57\u7b26\u4e32 \\b \u5339\u914d\u5355\u8bcd\u8fb9\u754c\uff0c\u5373\u5b57\u7b26\u4e0e\u7a7a\u683c\u4e2d\u95f4\u7684\u4f4d\u7f6e \\B \u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c \u5b9a\u4f4d\u7b26\u53ea\u80fd\u5355\u72ec\u4f7f\u7528\uff0c\u4e0d\u80fd\u9644\u52a0\u9650\u5236\u7b26\u6307\u5b9a\u4e2a\u6570 \u5206\u7ec4 \u00b6 \u7528 () \u53ef\u4ee5\u6307\u5b9a\u5339\u914d\u4e00\u4e2a\u7ec4\uff0c\u4f7f\u7528 () \u53ef\u4ee5\u6307\u5b9a\u4e0d\u540c\u9009\u9879\uff0c\u6bcf\u4e00\u9879\u95f4\u7528 | \u5206\u9694 \u540c\u65f6 () \u4e5f\u662f\u6355\u83b7\u5206\u7ec4\uff0c\u5373\u62ec\u53f7\u5185\u5339\u914d\u7684\u5185\u5bb9\u4f1a\u88ab\u7f13\u5b58\uff0c\u5982\u679c\u8981\u907f\u514d\u8fd9\u79cd\uff0c\u9700\u8981\u4f7f\u7528 (?:) \u975e\u6355\u83b7\u5143\u6765\u8fdb\u884c\u5339\u914d \u53cd\u5411\u5f15\u7528 \u00b6 \u88ab\u7f13\u5b58\u7684\u6355\u83b7\u5206\u7ec4\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\n \u518d\u6b21\u5f15\u7528\uff0c\u5176\u4e2d n \u662f 1 \u5230 2 \u4f4d\u7684\u5341\u8fdb\u5236\u6570 \u6355\u83b7\u5206\u7ec4\u7684\u7f16\u53f7\u4ece 1 \u5f00\u59cb\uff0c\u6700\u591a 99 \u4e2a\uff0c\\1 \u5373\u8868\u793a\u548c\u7b2c\u4e00\u4e2a\u5706\u62ec\u53f7\u4e2d\u5339\u914d\u7684\u7ed3\u679c\u76f8\u540c\u7684\u90e8\u5206 \u5982 (abc|def)\\1 \u5339\u914d abcabc\u3001defdef \u4f46\u4e0d\u5339\u914d abcdef\u3001defabc \u5148\u884c\u65ad\u8a00\u548c\u540e\u884c\u65ad\u8a00 \u00b6 \u6b63\u5219\u8868\u8fbe\u5f0f\u6709\u5148\u884c\u65ad\u8a00\uff08lookahead\uff09\u548c\u540e\u884c\u65ad\u8a00\uff08lookbehind\uff09\uff0c\u5206\u4e3a\u56db\u79cd\u5f62\u5f0f\uff1a \u8bed\u6cd5 \u540d\u79f0 (?=pattern) \u96f6\u5bbd\u6b63\u5411\u5148\u884c\u65ad\u8a00 zero-width positive lookahead assertion (?!pattern) \u96f6\u5bbd\u8d1f\u5411\u5148\u884c\u65ad\u8a00 zero-width negative lookahead assertion (?<=pattern) \u96f6\u5bbd\u6b63\u5411\u540e\u884c\u65ad\u8a00 zero-width positive lookbehind assertion (?...) \u5219\u5305\u542b\u4e00\u4e2a\u4ece name \u6620\u5c04\u5230\u6355\u83b7\u7ec4\u7f16\u53f7\u7684\u952e\u503c\u5bf9 re.Match \u00b6 re.Match \u662f match \u548c search \u5728\u6210\u529f\u5339\u914d\u65f6\u8fd4\u56de\u7684\u7c7b\u578b Match.group([group])\uff1a\u8fd4\u56de\u5b57\u7b26\u4e32 group() \u6216 group(0) \u8fd4\u56de\u5339\u914d\u7684\u5b8c\u6574\u5b57\u7b26\u4e32 group(i) \u8fd4\u56de\u7b2c i \u4e2a\u6355\u83b7\u7ec4 Match.start([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u8d77\u59cb\u4f4d\u7f6e\uff08\u5b50\u4e32\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7d22\u5f15\uff09 Match.end([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u7ed3\u675f\u4f4d\u7f6e\uff08\u5b50\u4e32\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u7d22\u5f15+1\uff09 Match.span([group])\uff1a\u8fd4\u56de (Match.start([group]), Match.end([group])) Match.__gettiem__([group])\uff1a\u7b49\u540c\u4e8e .group([group]) \u989d\u5916\u8bed\u6cd5 \u00b6 (?#...)\uff1a\u6ce8\u91ca\uff0c\u76f4\u63a5\u5ffd\u7565 (?P ...)\uff1a\u4e3a\u6355\u83b7\u7ec4\u547d\u540d\u4e3a name\uff08\u5fc5\u987b\u662f\u5408\u6cd5 python \u53d8\u91cf\u540d\uff0c\u5e76\u4e14\u540c\u4e00\u4e2a pattern \u4e2d\u4e0d\u80fd\u91cd\u590d\uff09\uff0c\u540e\u9762\u53ef\u4ee5\u901a\u8fc7 name \u5f15\u7528\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7f16\u53f7\u5f15\u7528\u3002\u5728 Match.group([group]) \u7684 group \u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \"name\" \u6765\u83b7\u53d6\u8fd9\u4e2a\u6355\u83b7\u7ec4 (?P=name)\uff1a\u4e0e\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b8c\u5168\u76f8\u540c\u7684\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u901a\u8fc7\u7f16\u53f7\u5f15\u7528 (?(id/name)yes-pattern|no-pattern)\uff1a\u5982\u679c\u7f16\u53f7\u4e3a id \u6216\u8005\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b58\u5728\uff0c\u5219\u6b64\u5904\u4f7f\u7528 yes-pattern\uff0c\u5426\u5219\u4f7f\u7528 no-pattern \u4f8b\u5982\uff1a (<)?(\\w+@\\w+(?:\\.\\w+)+)(?(1)>|$) \u5339\u914d '' \u548c 'user@host.com' \uff0c\u4f46\u4e0d\u5339\u914d '' \u6807\u8bc6\u7b26 \u00b6 \u6807\u8bc6\u7b26 \u542b\u4e49 re.I \u5ffd\u7565\u5927\u5c0f\u5199 re.L \u672c\u5730\u5316\u8bc6\u522b\u5339\u914d\uff08\u4e0d\u53ef\u9760\uff09 re.M \u591a\u884c\u5339\u914d re.S \u5355\u884c\u5339\u914d\uff0c\u4f7f . \u540c\u6837\u5339\u914d\u6362\u884c\u7b26 re.U \u4f7f\u7528 unicode\uff0c\u5f71\u54cd \\w\\W\\b\\B re.X \u4f7f\u7528 python \u4e00\u6837\u7684\u6ce8\u91ca\uff0c\u5e76\u4e14\u6709\u591a\u884c pattern \u7684\u4f18\u5316\uff0c\u4f7f\u6b63\u5219\u66f4\u6613\u8bfb \u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u6807\u8bc6\u7b26\uff0c\u7528 | \u9694\u5f00\uff08\u5982 re.I | re.M \u8868\u793a\u591a\u884c\u4e14\u5ffd\u7565\u5927\u5c0f\u5199\uff09 re.X \u7684\u4f8b\u5b50 a = re . compile ( r \"\"\"\\d + # the integral part \\. # the decimal point \\d * # some fractional digits\"\"\" , re . X ) b = re . compile ( r \"\\d+\\.\\d*\" ) a b \u7b49\u4ef7 Reference \u00b6 \u83dc\u9e1f\u6559\u7a0b TonyCrane \u6b63\u5219\u8868\u8fbe\u5f0f","title":"RegEx \u6b63\u5219\u8868\u8fbe\u5f0f"},{"location":"cs/others/regex/#_1","text":"\u7ea6 2398 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f \u6b63\u5219\u8868\u8fbe\u5f0f\uff08Regular Expression\uff09\u4f7f\u7528\u5355\u4e2a\u5b57\u7b26\u4e32\u6765\u63cf\u8ff0\u3001\u5339\u914d\u4e00\u7cfb\u5217\u5339\u914d\u67d0\u4e2a\u53e5\u6cd5\u89c4\u5219\u7684\u5b57\u7b26\u4e32\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 Abstract \u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u4e14\u5f3a\u5927\u7684\u65b9\u5f0f\u6765\u67e5\u627e\u3001\u66ff\u6362\u3001\u9a8c\u8bc1\u548c\u63d0\u53d6\u6587\u672c\u6570\u636e\u3002\u5b66\u4e60\u4e0d\u6613\uff0c\u4f46\u4f7f\u7528\u8d77\u6765\u5f88\u8212\u670d\ud83d\ude0c RegExr \u6b63\u5219\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177 Regulex \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 HackerRank regex \u4e60\u9898\u96c6 copy from TonyCrane/note","title":"\u6b63\u5219\u8868\u8fbe\u5f0f"},{"location":"cs/others/regex/#_2","text":"","title":"\u8bed\u6cd5"},{"location":"cs/others/regex/#_3","text":"\u666e\u901a\u5b57\u7b26\u5305\u62ec\u6ca1\u6709\u663e\u5f0f\u6307\u5b9a\u4e3a\u5143\u5b57\u7b26\u7684\u6240\u6709\u53ef\u6253\u5370\u548c\u4e0d\u53ef\u6253\u5370\u5b57\u7b26\u3002\u8fd9\u5305\u62ec\u6240\u6709\u5927\u5199\u548c\u5c0f\u5199\u5b57\u6bcd\u3001\u6240\u6709\u6570\u5b57\u3001\u6240\u6709\u6807\u70b9\u7b26\u53f7\u548c\u4e00\u4e9b\u5176\u4ed6\u7b26\u53f7\u3002 \u8bed\u6cd5 \u63cf\u8ff0 [...] \u5339\u914d\u4efb\u610f\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [ABC] \u5339\u914d\u6240\u6709 A B C \u5b57\u7b26 [^...] \u5339\u914d\u4efb\u610f\u4e0d\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [^ABC] \u5339\u914d\u9664\u4e86 A B C \u5916\u7684\u6240\u6709\u5355\u4e2a\u5b57\u7b26 [x-y] \u6309\u7167\u987a\u5e8f\u5339\u914d\u4ece x \u5230 y \u5230\u6240\u6709\u5b57\u7b26\uff0c\u5982 [a-z] \u5339\u914d\u6240\u6709\u5c0f\u5199\u5b57\u6bcd\uff0c[A-E] \u5339\u914d A \u5230 E \u8fd9\u4e94\u4e2a\u5b57\u7b26\uff5c \\s\\S \u5339\u914d\u6240\u6709\uff0c\\s \u662f\u5339\u914d\u6240\u6709\u7a7a\u767d\u7b26\uff08\u5305\u62ec\u6362\u884c\uff09\uff0c\\S \u975e\u7a7a\u767d\u7b26\uff08\u4e0d\u5305\u62ec\u6362\u884c\uff09 . \u5339\u914d\u4efb\u610f\u9664\u4e86\u6362\u884c\u7b26\u4ee5\u5916\u7684\u5b57\u7b26 \\w \u5339\u914d\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf\uff0c\u76f8\u5f53\u4e8e [a-zA-Z0-9_] x|y \u5339\u914d x \u6216 y \uff0c\u4f18\u5148\u7ea7\u6700\u4f4e\uff0c\u5982 a | bcd \u5339\u914d a \u6216 bcd","title":"\u666e\u901a\u5b57\u7b26"},{"location":"cs/others/regex/#_4","text":"\u8bed\u6cd5 \u63cf\u8ff0 \\cx \u5339\u914d\u7531x\u6307\u660e\u7684\u63a7\u5236\u5b57\u7b26\u3002\u4f8b\u5982\uff0c \\cM \u5339\u914d\u4e00\u4e2a Control-M \u6216\u56de\u8f66\u7b26\u3002x \u7684\u503c\u5fc5\u987b\u4e3a A-Z \u6216 a-z \u4e4b\u4e00\u3002\u5426\u5219\uff0c\u5c06 c \u89c6\u4e3a\u4e00\u4e2a\u539f\u4e49\u7684 'c' \u5b57\u7b26\u3002 \\f \u5339\u914d\u4e00\u4e2a\u6362\u9875\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0c \u548c \\cL\u3002 \\n \u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0a \u548c \\cJ\u3002 \\r \u5339\u914d\u4e00\u4e2a\u56de\u8f66\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0d \u548c \\cM\u3002 \\s \u5339\u914d\u4efb\u4f55\u7a7a\u767d\u5b57\u7b26\uff0c\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49\u3002\u7b49\u4ef7\u4e8e [ \\f\\n\\r\\t\\v]\u3002\u6ce8\u610f Unicode \u6b63\u5219\u8868\u8fbe\u5f0f\u4f1a\u5339\u914d\u5168\u89d2\u7a7a\u683c\u7b26\u3002 \\S \u5339\u914d\u4efb\u4f55\u975e\u7a7a\u767d\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e [^ \\f\\n\\r\\t\\v]\u3002 \\t \u5339\u914d\u4e00\u4e2a\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x09 \u548c \\cI\u3002 \\v \u5339\u914d\u4e00\u4e2a\u5782\u76f4\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0b \u548c \\cK\u3002","title":"\u975e\u6253\u5370\u5b57\u7b26"},{"location":"cs/others/regex/#_5","text":"\u6709\u4e00\u4e9b\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002 \u8bed\u6cd5 \u63cf\u8ff0 $ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86 RegExp \u5bf9\u8c61\u7684 Multiline \u5c5e\u6027\uff0c\u5219 $ \u4e5f\u5339\u914d '\\n' () \u6807\u8bb0\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002\u5b50\u8868\u8fbe\u5f0f\u53ef\u4ee5\u83b7\u53d6\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u8981\u5339\u914d\u8fd9\u4e9b\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\( \u548c \\)\u3002 * \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d * \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\*\u3002 + \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u4e00\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d + \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\+\u3002 . \u5339\u914d\u9664\u6362\u884c\u7b26 \\n \u4e4b\u5916\u7684\u4efb\u4f55\u5355\u5b57\u7b26\u3002\u8981\u5339\u914d . \uff0c\u8bf7\u4f7f\u7528 \\. \u3002 [ \u6807\u8bb0\u4e00\u4e2a\u4e2d\u62ec\u53f7\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d [\uff0c\u8bf7\u4f7f\u7528 \\[\u3002 ? \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u4e00\u6b21\uff0c\u6216\u6307\u660e\u4e00\u4e2a\u975e\u8d2a\u5a6a\u9650\u5b9a\u7b26\u3002\u8981\u5339\u914d ? \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\?\u3002 \\ \u5c06\u4e0b\u4e00\u4e2a\u5b57\u7b26\u6807\u8bb0\u4e3a\u6216\u7279\u6b8a\u5b57\u7b26\u3001\u6216\u539f\u4e49\u5b57\u7b26\u3001\u6216\u5411\u540e\u5f15\u7528\u3001\u6216\u516b\u8fdb\u5236\u8f6c\u4e49\u7b26\u3002\u4f8b\u5982\uff0c'n' \u5339\u914d\u5b57\u7b26 'n'\u3002'\\n' \u5339\u914d\u6362\u884c\u7b26\u3002\u5e8f\u5217 '\\\\' \u5339\u914d \"\\\"\uff0c\u800c '\\(' \u5219\u5339\u914d \"(\"\u3002 ^ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9664\u975e\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\uff0c\u5f53\u8be5\u7b26\u53f7\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\u65f6\uff0c\u8868\u793a\u4e0d\u63a5\u53d7\u8be5\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u7684\u5b57\u7b26\u96c6\u5408\u3002\u8981\u5339\u914d ^ \u5b57\u7b26\u672c\u8eab\uff0c\u8bf7\u4f7f\u7528 \\^\u3002 { \u6807\u8bb0\u9650\u5b9a\u7b26\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d {\uff0c\u8bf7\u4f7f\u7528 \\{\u3002 | \u6307\u660e\u4e24\u9879\u4e4b\u95f4\u7684\u4e00\u4e2a\u9009\u62e9\u3002\u8981\u5339\u914d | \uff0c\u8bf7\u4f7f\u7528 \\|\u3002","title":"\u7279\u6b8a\u5b57\u7b26"},{"location":"cs/others/regex/#_6","text":"\u7528\u6765\u6307\u5b9a\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u51fa\u73b0\u4e86\u591a\u5c11\u6b21 \u8bed\u6cd5 \u63cf\u8ff0 {n} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u51c6\u786e\u7684 n \u6b21\uff0c\u5982 o{2} \u5339\u914d\u4e24\u4e2a\u8fde\u7eed\u7684 o {n,} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u5982 o{2,} \u53ef\u4ee5\u5339\u914d goooood \u4e2d\u7684\u6240\u6709 o\uff0c\u4f46\u4e0d\u5339\u914d god \u4e2d\u7684 o {n,m} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u81f3\u591a m \u6b21 * \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 0 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {0,} + \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 1 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {1,} ? \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u53ef\u6709\u53ef\u65e0\uff08\u5339\u914d 0 \u6b21\u6216 1 \u6b21\uff09\uff0c\u76f8\u5f53\u4e8e {0,1}","title":"\u9650\u5b9a\u7b26"},{"location":"cs/others/regex/#_7","text":"* \u548c + \u7684\u5339\u914d\u90fd\u662f\u8d2a\u5a6a\u7684\uff0c\u5373\u5c3d\u53ef\u80fd\u5339\u914d\u66f4\u591a\u7684\u5b57\u7b26\uff0c\u800c\u5728\u5b83\u4eec\u540e\u9762\u52a0\u4e0a ? \u5c31\u53ef\u4ee5\u975e\u8d2a\u5a6a\uff08\u5373\u6700\u5c0f\u5339\u914d\uff09 <.*> \u4f1a\u5339\u914d\u6574\u4e2a

    header

    \u5b57\u7b26\u4e32 <.*?> \u53ea\u4f1a\u5339\u914d\u5176\u4e2d\u7684

    \u548c

    ","title":"\u8d2a\u5a6a"},{"location":"cs/others/regex/#_8","text":"\u53ea\u5339\u914d\u4f4d\u7f6e\uff0c\u6ca1\u6709\u5b57\u7b26\u4e0e\u4e4b\u5bf9\u5e94 \u8bed\u6cd5 \u63cf\u8ff0 ^ \u5339\u914d\u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5982\u679c\u662f\u591a\u884c\u6a21\u5f0f\uff0c\u5219\u65b0\u7684\u4e00\u884c\u4e5f\u7b97\u65b0\u7684\u5b57\u7b26\u4e32 $ \u5339\u914d\u5b57\u7b26\u4e32\u7ed3\u5c3e\uff0c\u591a\u884c\u6a21\u5f0f\u540c\u7406\u770b\u6210\u591a\u4e2a\u5b57\u7b26\u4e32 \\b \u5339\u914d\u5355\u8bcd\u8fb9\u754c\uff0c\u5373\u5b57\u7b26\u4e0e\u7a7a\u683c\u4e2d\u95f4\u7684\u4f4d\u7f6e \\B \u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c \u5b9a\u4f4d\u7b26\u53ea\u80fd\u5355\u72ec\u4f7f\u7528\uff0c\u4e0d\u80fd\u9644\u52a0\u9650\u5236\u7b26\u6307\u5b9a\u4e2a\u6570","title":"\u5b9a\u4f4d\u7b26"},{"location":"cs/others/regex/#_9","text":"\u7528 () \u53ef\u4ee5\u6307\u5b9a\u5339\u914d\u4e00\u4e2a\u7ec4\uff0c\u4f7f\u7528 () \u53ef\u4ee5\u6307\u5b9a\u4e0d\u540c\u9009\u9879\uff0c\u6bcf\u4e00\u9879\u95f4\u7528 | \u5206\u9694 \u540c\u65f6 () \u4e5f\u662f\u6355\u83b7\u5206\u7ec4\uff0c\u5373\u62ec\u53f7\u5185\u5339\u914d\u7684\u5185\u5bb9\u4f1a\u88ab\u7f13\u5b58\uff0c\u5982\u679c\u8981\u907f\u514d\u8fd9\u79cd\uff0c\u9700\u8981\u4f7f\u7528 (?:) \u975e\u6355\u83b7\u5143\u6765\u8fdb\u884c\u5339\u914d","title":"\u5206\u7ec4"},{"location":"cs/others/regex/#_10","text":"\u88ab\u7f13\u5b58\u7684\u6355\u83b7\u5206\u7ec4\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\n \u518d\u6b21\u5f15\u7528\uff0c\u5176\u4e2d n \u662f 1 \u5230 2 \u4f4d\u7684\u5341\u8fdb\u5236\u6570 \u6355\u83b7\u5206\u7ec4\u7684\u7f16\u53f7\u4ece 1 \u5f00\u59cb\uff0c\u6700\u591a 99 \u4e2a\uff0c\\1 \u5373\u8868\u793a\u548c\u7b2c\u4e00\u4e2a\u5706\u62ec\u53f7\u4e2d\u5339\u914d\u7684\u7ed3\u679c\u76f8\u540c\u7684\u90e8\u5206 \u5982 (abc|def)\\1 \u5339\u914d abcabc\u3001defdef \u4f46\u4e0d\u5339\u914d abcdef\u3001defabc","title":"\u53cd\u5411\u5f15\u7528"},{"location":"cs/others/regex/#_11","text":"\u6b63\u5219\u8868\u8fbe\u5f0f\u6709\u5148\u884c\u65ad\u8a00\uff08lookahead\uff09\u548c\u540e\u884c\u65ad\u8a00\uff08lookbehind\uff09\uff0c\u5206\u4e3a\u56db\u79cd\u5f62\u5f0f\uff1a \u8bed\u6cd5 \u540d\u79f0 (?=pattern) \u96f6\u5bbd\u6b63\u5411\u5148\u884c\u65ad\u8a00 zero-width positive lookahead assertion (?!pattern) \u96f6\u5bbd\u8d1f\u5411\u5148\u884c\u65ad\u8a00 zero-width negative lookahead assertion (?<=pattern) \u96f6\u5bbd\u6b63\u5411\u540e\u884c\u65ad\u8a00 zero-width positive lookbehind assertion (?...) \u5219\u5305\u542b\u4e00\u4e2a\u4ece name \u6620\u5c04\u5230\u6355\u83b7\u7ec4\u7f16\u53f7\u7684\u952e\u503c\u5bf9","title":"re.Pattern"},{"location":"cs/others/regex/#rematch","text":"re.Match \u662f match \u548c search \u5728\u6210\u529f\u5339\u914d\u65f6\u8fd4\u56de\u7684\u7c7b\u578b Match.group([group])\uff1a\u8fd4\u56de\u5b57\u7b26\u4e32 group() \u6216 group(0) \u8fd4\u56de\u5339\u914d\u7684\u5b8c\u6574\u5b57\u7b26\u4e32 group(i) \u8fd4\u56de\u7b2c i \u4e2a\u6355\u83b7\u7ec4 Match.start([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u8d77\u59cb\u4f4d\u7f6e\uff08\u5b50\u4e32\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7d22\u5f15\uff09 Match.end([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u7ed3\u675f\u4f4d\u7f6e\uff08\u5b50\u4e32\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u7d22\u5f15+1\uff09 Match.span([group])\uff1a\u8fd4\u56de (Match.start([group]), Match.end([group])) Match.__gettiem__([group])\uff1a\u7b49\u540c\u4e8e .group([group])","title":"re.Match"},{"location":"cs/others/regex/#_14","text":"(?#...)\uff1a\u6ce8\u91ca\uff0c\u76f4\u63a5\u5ffd\u7565 (?P ...)\uff1a\u4e3a\u6355\u83b7\u7ec4\u547d\u540d\u4e3a name\uff08\u5fc5\u987b\u662f\u5408\u6cd5 python \u53d8\u91cf\u540d\uff0c\u5e76\u4e14\u540c\u4e00\u4e2a pattern \u4e2d\u4e0d\u80fd\u91cd\u590d\uff09\uff0c\u540e\u9762\u53ef\u4ee5\u901a\u8fc7 name \u5f15\u7528\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7f16\u53f7\u5f15\u7528\u3002\u5728 Match.group([group]) \u7684 group \u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \"name\" \u6765\u83b7\u53d6\u8fd9\u4e2a\u6355\u83b7\u7ec4 (?P=name)\uff1a\u4e0e\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b8c\u5168\u76f8\u540c\u7684\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u901a\u8fc7\u7f16\u53f7\u5f15\u7528 (?(id/name)yes-pattern|no-pattern)\uff1a\u5982\u679c\u7f16\u53f7\u4e3a id \u6216\u8005\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b58\u5728\uff0c\u5219\u6b64\u5904\u4f7f\u7528 yes-pattern\uff0c\u5426\u5219\u4f7f\u7528 no-pattern \u4f8b\u5982\uff1a (<)?(\\w+@\\w+(?:\\.\\w+)+)(?(1)>|$) \u5339\u914d '' \u548c 'user@host.com' \uff0c\u4f46\u4e0d\u5339\u914d ''","title":"\u989d\u5916\u8bed\u6cd5"},{"location":"cs/others/regex/#_15","text":"\u6807\u8bc6\u7b26 \u542b\u4e49 re.I \u5ffd\u7565\u5927\u5c0f\u5199 re.L \u672c\u5730\u5316\u8bc6\u522b\u5339\u914d\uff08\u4e0d\u53ef\u9760\uff09 re.M \u591a\u884c\u5339\u914d re.S \u5355\u884c\u5339\u914d\uff0c\u4f7f . \u540c\u6837\u5339\u914d\u6362\u884c\u7b26 re.U \u4f7f\u7528 unicode\uff0c\u5f71\u54cd \\w\\W\\b\\B re.X \u4f7f\u7528 python \u4e00\u6837\u7684\u6ce8\u91ca\uff0c\u5e76\u4e14\u6709\u591a\u884c pattern \u7684\u4f18\u5316\uff0c\u4f7f\u6b63\u5219\u66f4\u6613\u8bfb \u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u6807\u8bc6\u7b26\uff0c\u7528 | \u9694\u5f00\uff08\u5982 re.I | re.M \u8868\u793a\u591a\u884c\u4e14\u5ffd\u7565\u5927\u5c0f\u5199\uff09 re.X \u7684\u4f8b\u5b50 a = re . compile ( r \"\"\"\\d + # the integral part \\. # the decimal point \\d * # some fractional digits\"\"\" , re . X ) b = re . compile ( r \"\\d+\\.\\d*\" ) a b \u7b49\u4ef7","title":"\u6807\u8bc6\u7b26"},{"location":"cs/others/regex/#reference","text":"\u83dc\u9e1f\u6559\u7a0b TonyCrane \u6b63\u5219\u8868\u8fbe\u5f0f","title":"Reference"},{"location":"cs/pl/","text":"Programming language \u00b6 Abstract \u8bb0\u5f55\u4e00\u4e9b\u5b66\u4e60\u7f16\u7a0b\u8bed\u8a00\u65f6\u7684\u7b14\u8bb0 \u57fa\u672c\u90fd\u662f\u8fb9\u5b66\u8fb9\u7528\uff0c\u96f6\u96f6\u6563\u6563\uff0c\u6ca1\u6709\u7cfb\u7edf\u5730\u5b66\u4e60\u8fc7\uff08\u672c\u79d1\u6d47\u7684\u4e5f\u7b97\uff1f Table of Contents \u00b6 C/C++ C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528 Python Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883 Go Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO) Java Java \u57fa\u7840\u77e5\u8bc6 SpringBoot","title":"Programming language"},{"location":"cs/pl/#programming-language","text":"Abstract \u8bb0\u5f55\u4e00\u4e9b\u5b66\u4e60\u7f16\u7a0b\u8bed\u8a00\u65f6\u7684\u7b14\u8bb0 \u57fa\u672c\u90fd\u662f\u8fb9\u5b66\u8fb9\u7528\uff0c\u96f6\u96f6\u6563\u6563\uff0c\u6ca1\u6709\u7cfb\u7edf\u5730\u5b66\u4e60\u8fc7\uff08\u672c\u79d1\u6d47\u7684\u4e5f\u7b97\uff1f","title":"Programming language"},{"location":"cs/pl/#table-of-contents","text":"C/C++ C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528 Python Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883 Go Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO) Java Java \u57fa\u7840\u77e5\u8bc6 SpringBoot","title":"Table of Contents"},{"location":"cs/pl/c_cpp/","text":"C/C++ \u00b6 Abstract \u5b66\u4e60\u65f6\u95f4\u6700\u957f\u7684\u4e00\u95e8\u7f16\u7a0b\u8bed\u8a00\uff0c\u4f7f\u7528\u6700\u591a\u4e14\u6700\u4e3a\u719f\u6089\u7684\u7f16\u7a0b\u8bed\u8a00\u4e86\uff08\u6839\u672c\u4e0d\u4f1a \u5728ACM\u7ade\u8d5b\u4e2d\u5e38\u7528\uff0c\u5305\u62ec\u5728\u505aSLAM\u4e2d\u4e5f\u8981\u7ecf\u5e38\u4f7f\u7528\u3002 Table of Contents \u00b6 C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528","title":"C/C++"},{"location":"cs/pl/c_cpp/#cc","text":"Abstract \u5b66\u4e60\u65f6\u95f4\u6700\u957f\u7684\u4e00\u95e8\u7f16\u7a0b\u8bed\u8a00\uff0c\u4f7f\u7528\u6700\u591a\u4e14\u6700\u4e3a\u719f\u6089\u7684\u7f16\u7a0b\u8bed\u8a00\u4e86\uff08\u6839\u672c\u4e0d\u4f1a \u5728ACM\u7ade\u8d5b\u4e2d\u5e38\u7528\uff0c\u5305\u62ec\u5728\u505aSLAM\u4e2d\u4e5f\u8981\u7ecf\u5e38\u4f7f\u7528\u3002","title":"C/C++"},{"location":"cs/pl/c_cpp/#table-of-contents","text":"C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528","title":"Table of Contents"},{"location":"cs/pl/c_cpp/basic/","text":"C++ \u7cfb\u7edf\u77e5\u8bc6 \u00b6 \u7ea6 12299 \u4e2a\u5b57 8 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 41 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9b\u5173\u4e8eC++\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6\uff0c\u5305\u62ec\u9762\u5411\u5bf9\u8c61\u7b49 \u4ee3\u7801\u5230\u53ef\u6267\u884c\u7a0b\u5e8f \u00b6 \u9884\u5904\u7406\uff1a\u6761\u4ef6\u7f16\u8bd1\uff0c\u5934\u6587\u4ef6\u5305\u542b\uff0c\u5b8f\u66ff\u6362\u5904\u7406\uff0c\u751f\u6210.i\u6587\u4ef6 \u7f16\u8bd1\uff1a\u5c06\u9884\u5904\u7406\u540e\u7684\u6587\u4ef6\u8f6c\u5316\u4e3a\u6c47\u7f16\u8bed\u8a00\uff0c\u751f\u6210.s\u6587\u4ef6 \u6c47\u7f16\uff1a\u6c47\u7f16\u53d8\u4e3a\u76ee\u6807\u4ee3\u7801\uff08\u673a\u5668\u4ee3\u7801\uff09\uff0c\u751f\u6210.o\u6587\u4ef6 \u94fe\u63a5\uff1a\u8fde\u63a5\u76ee\u6807\u4ee3\u7801\uff0c\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f \u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93 \u00b6 \u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93\u6700\u672c\u8d28\u7684\u533a\u522b\u5c31\u662f\uff1a \u8be5\u5e93\u662f\u5426\u88ab\u7f16\u8bd1\u8fdb\u76ee\u6807\uff08\u7a0b\u5e8f\uff09\u5185\u90e8 \u9759\u6001\u5e93 \u4e00\u822c\u6269\u5c55\u540d\u4e3a .a \u6216 .lib \uff0c\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u4f1a\u76f4\u63a5\u6574\u5408\u5230\u76ee\u6807\u7a0b\u5e8f\u4e2d\uff0c\u6240\u4ee5\u5229\u7528\u9759\u6001\u51fd\u6570\u5e93\u7f16\u8bd1\u6210\u7684\u6587\u4ef6\u6bd4\u8f83\u5927\uff0c\u6700\u5927\u7684\u4f18\u70b9\u5c31\u662f \u7f16\u8bd1\u6210\u529f\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u4ee5\u72ec\u7acb\u8fd0\u884c \uff0c\u800c\u4e0d\u518d\u9700\u8981\u5411\u5916\u90e8\u8981\u6c42\u8bfb\u53d6\u51fd\u6570\u5e93\u7684\u5185\u5bb9\uff1b\u4f46\u662f\u4ece\u5347\u7ea7\u96be\u6613\u5ea6\u6765\u770b\u660e\u663e\u6ca1\u6709\u4f18\u52bf\uff0c \u5982\u679c\u51fd\u6570\u5e93\u66f4\u65b0\uff0c\u9700\u8981\u91cd\u65b0\u7f16\u8bd1 \u3002 \u52a8\u6001\u5e93 \u52a8\u6001\u51fd\u6570\u5e93\u7684\u6269\u5c55\u540d\u4e00\u822c\u4e3a .so \u6216 .dll \uff0c\u8fd9\u7c7b\u51fd\u6570\u5e93\u901a\u5e38\u540d\u4e3alibxxx.so\u6216xxx.dll\u3002 \u4e0e\u9759\u6001\u51fd\u6570\u5e93\u88ab\u6574\u4e2a\u6355\u6349\u5230\u7a0b\u5e8f\u4e2d\u4e0d\u540c\uff0c\u52a8\u6001\u51fd\u6570\u5e93\u5728\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u91cc\u53ea\u6709\u4e00\u4e2a\u201c\u6307\u5411\u201d\u7684\u4f4d\u7f6e\u800c\u5df2\uff0c\u4e5f\u5c31\u662f\u8bf4\u5f53\u53ef\u6267\u884c\u6587\u4ef6\u9700\u8981\u4f7f\u7528\u51fd\u6570\u5e93\u7684\u673a\u5236\u65f6\uff0c\u7a0b\u5e8f\u624d\u4f1a\u53bb\u8bfb\u53d6\u51fd\u6570\u5e93\u6765\u4f7f\u7528\uff1b\u4e5f\u5c31\u662f\u8bf4\u53ef\u6267\u884c\u6587\u4ef6\u65e0\u6cd5\u5355\u72ec\u8fd0\u884c\u3002\u8fd9\u6837\u4ece\u4ea7\u54c1\u529f\u80fd\u5347\u7ea7\u89d2\u5ea6\u65b9\u4fbf\u5347\u7ea7\uff0c\u53ea\u9700\u8981\u66ff\u6362\u5bf9\u5e94\u52a8\u6001\u5e93\u5373\u53ef\uff0c\u4e0d\u5fc5\u91cd\u65b0\u7f16\u8bd1\u6574\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002 dll\u52a0\u8f7d \u00b6 \u9690\u5f0f\u52a0\u8f7d\uff08\u9759\u6001\u8c03\u7528\uff09 \u00b6 \u5728\u7a0b\u5e8f\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u5c06dll\u7f16\u8bd1\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u8c03\u7528\u65b9\u4fbf\uff0c\u7a0b\u5e8f\u53d1\u5e03\u7684\u65f6\u5019\u53ef\u4ee5\u4e0d\u7528\u5e26\u7740dll \u7f3a\u70b9\u662f\u7a0b\u5e8f\u4f1a\u5f88\u5927 \u663e\u793a\u52a0\u8f7d\uff08\u52a8\u6001\u8c03\u7528\uff09 \u00b6 \u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u7528\u5230dll\u91cc\u7684\u51fd\u6570\u65f6\uff0c\u518d\u52a8\u6001\u52a0\u8f7ddll\u5230\u5185\u5b58\u4e2d \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u56e0\u4e3a\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u540e\u518d\u52a0\u8f7d\u5230\uff0c\u6240\u4ee5\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u542f\u52a8\u66f4\u5feb\uff0c\u800c\u4e14dll\u7684\u7ef4\u62a4\u66f4\u5bb9\u6613\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u5982\u679c\u9700\u8981\u66f4\u65b0\uff0c\u5f88\u591a\u65f6\u5019\u76f4\u63a5\u66f4\u65b0dll\uff0c\u800c\u4e0d\u7528\u91cd\u65b0\u5b89\u88c5\u7a0b\u5e8f \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\uff0c\u51fd\u6570\u8c03\u7528\u7a0d\u5fae\u590d\u6742\u4e00\u70b9 C++\u5185\u5b58\u7ba1\u7406 \u00b6 \u5185\u5b58\u7ed3\u6784 \u00b6 C++ \u5185\u5b58\u5206\u533a\uff1a\u6808\u3001\u5806\u3001\u81ea\u7531\u5b58\u50a8\u533a\u3001\u5168\u5c40/\u9759\u6001\u5b58\u50a8\u533a\u3001\u5e38\u91cf\u533a \u6808\uff1a\u5b58\u653e\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u52a8\u5206\u914d\u548c\u91ca\u653e \u5806\uff1a\u52a8\u6001\u7533\u8bf7\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u5c31\u662f\u7531 malloc \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531\u7a0b\u5e8f\u5458\u63a7\u5236\u5b83\u7684\u5206\u914d\u548c\u91ca\u653e\uff0c\u5982\u679c\u7a0b\u5e8f\u6267\u884c\u7ed3\u675f\u8fd8\u6ca1\u6709\u91ca\u653e\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u56de\u6536 \u81ea\u7531\u5b58\u50a8\u533a\uff1a\u548c\u5806\u5341\u5206\u76f8\u4f3c\uff0c\u5b58\u653e\u7531 new \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531 delete \u91ca\u653e\u5185\u5b58 \u5168\u5c40\u533a/\u9759\u6001\u533a\uff1a\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u53d8\u91cf \u5e38\u91cf\u5b58\u50a8\u533a\uff1a\u5b58\u653e\u7684\u662f\u5e38\u91cf\uff0c\u4e0d\u5141\u8bb8\u4fee\u6539 \u4e8b\u5b9e\u4e0a\uff0c\u6211\u5728\u7f51\u4e0a\u770b\u7684\u5f88\u591a\u535a\u5ba2\uff0c\u5212\u5206\u81ea\u7531\u5b58\u50a8\u533a\u4e0e\u5806\u7684\u5206\u754c\u7ebf\u5c31\u662fnew/delete\u4e0emalloc/free\u3002\u7136\u800c\uff0c\u5c3d\u7ba1C++\u6807\u51c6\u6ca1\u6709\u8981\u6c42\uff0c\u4f46\u5f88\u591a\u7f16\u8bd1\u5668\u7684new/delete\u90fd\u662f\u4ee5malloc/free\u4e3a\u57fa\u7840\u6765\u5b9e\u73b0\u7684\u3002\u90a3\u4e48\u8bf7\u95ee\uff1a\u501f\u4ee5malloc\u5b9e\u73b0\u7684new\uff0c\u6240\u7533\u8bf7\u7684\u5185\u5b58\u662f\u5728\u5806\u4e0a\u8fd8\u662f\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\uff1f \u4ece\u6280\u672f\u4e0a\u6765\u8bf4\uff0c\u5806\uff08heap\uff09\u662fC\u8bed\u8a00\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u672f\u8bed\u3002\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u6240\u7ef4\u62a4\u7684\u4e00\u5757\u7279\u6b8a\u5185\u5b58\uff0c\u5b83\u63d0\u4f9b\u4e86\u52a8\u6001\u5206\u914d\u7684\u529f\u80fd\uff0c\u5f53\u8fd0\u884c\u7a0b\u5e8f\u8c03\u7528malloc()\u65f6\u5c31\u4f1a\u4ece\u4e2d\u5206\u914d\uff0c\u7a0d\u540e\u8c03\u7528free\u53ef\u628a\u5185\u5b58\u4ea4\u8fd8\u3002\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u548cdelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\uff0c\u901a\u8fc7new\u6765\u7533\u8bf7\u7684\u5185\u5b58\u533a\u57df\u53ef\u79f0\u4e3a\u81ea\u7531\u5b58\u50a8\u533a\u3002\u57fa\u672c\u4e0a\uff0c\u6240\u6709\u7684C++\u7f16\u8bd1\u5668\u9ed8\u8ba4\u4f7f\u7528\u5806\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4e5f\u5373\u662f\u7f3a\u7701\u7684\u5168\u5c40\u8fd0\u7b97\u7b26new\u548cdelete\u4e5f\u8bb8\u4f1a\u6309\u7167malloc\u548cfree\u7684\u65b9\u5f0f\u6765\u88ab\u5b9e\u73b0\uff0c\u8fd9\u65f6\u85c9\u7531new\u8fd0\u7b97\u7b26\u5206\u914d\u7684\u5bf9\u8c61\uff0c\u8bf4\u5b83\u5728\u5806\u4e0a\u4e5f\u5bf9\uff0c\u8bf4\u5b83\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e5f\u6b63\u786e\u3002\u4f46\u7a0b\u5e8f\u5458\u4e5f\u53ef\u4ee5\u901a\u8fc7\u91cd\u8f7d\u64cd\u4f5c\u7b26\uff0c\u6539\u7528\u5176\u4ed6\u5185\u5b58\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4f8b\u5982\u5168\u5c40\u53d8\u91cf\u505a\u7684\u5bf9\u8c61\u6c60\uff0c\u8fd9\u65f6\u81ea\u7531\u5b58\u50a8\u533a\u5c31\u533a\u522b\u4e8e\u5806\u4e86\u3002\u6211\u4eec\u6240\u9700\u8981\u8bb0\u4f4f\u7684\u5c31\u662f\uff1a \u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u7ef4\u62a4\u7684\u4e00\u5757\u5185\u5b58\uff0c\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u4e0edelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\u3002\u5806\u4e0e\u81ea\u7531\u5b58\u50a8\u533a\u5e76\u4e0d\u7b49\u4ef7\u3002 \u5185\u5b58\u6cc4\u6f0f \u00b6 \u5185\u5b58\u6cc4\u6f0f\u662f\u6307\u5e94\u7528\u7a0b\u5e8f\u5206\u914d\u67d0\u6bb5\u5185\u5b58\u540e\uff0c \u5931\u53bb\u4e86\u5bf9\u8be5\u6bb5\u5185\u5b58\u7684\u63a7\u5236 \uff0c\u56e0\u800c\u9020\u6210\u4e86\u5185\u5b58\u7684\u6d6a\u8d39\u3002 1. \u5728\u7c7b\u7684\u6784\u9020\u51fd\u6570\u548c\u6790\u6784\u51fd\u6570\u4e2d\u6ca1\u6709\u5339\u914d\u7684\u8c03\u7528new\u548cdelete\u51fd\u6570 2. \u6ca1\u6709\u6b63\u786e\u5730\u6e05\u9664 \u5d4c\u5957\u7684\u5bf9\u8c61\u6307\u9488 3. \u5728\u91ca\u653e \u5bf9\u8c61\u6570\u7ec4 \u65f6\u5728\u4e2d\u6ca1\u6709\u4f7f\u7528delete[] 4. \u6307\u5411\u5bf9\u8c61\u7684\u6307\u9488\u6570\u7ec4\u4e0d\u7b49\u540c\u4e8e\u5bf9\u8c61\u6570\u7ec4 1. \u7f3a\u5c11 \u62f7\u8d1d\u6784\u9020\u51fd\u6570 \u6216 \u91cd\u8f7d\u590d\u5236\u8fd0\u7b97\u7b26 \uff1a\u9690\u5f0f\u7684\u6307\u9488\u590d\u5236\u7ed3\u679c\u5c31\u662f\u4e24\u4e2a\u5bf9\u8c61\u62e5\u6709\u6307\u5411\u540c\u4e00\u4e2a\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u7a7a\u95f4\u7684\u6307\u9488\u3002 5. \u6ca1\u6709\u5c06\u57fa\u7c7b\u7684 \u6790\u6784\u51fd\u6570 \u5b9a\u4e49\u4e3a\u865a\u51fd\u6570\u3002 \u907f\u514d\u5185\u5b58\u6cc4\u6f0f \u00b6 RAII \u8d44\u6e90\u83b7\u53d6\u5373\u521d\u59cb\u5316 \uff0c\u662f\u4e00\u79cd\u5229\u7528\u5bf9\u8c61\u751f\u547d\u5468\u671f\u6765\u63a7\u5236\u7a0b\u5e8f\u8d44\u6e90\uff08\u5982\u5185\u5b58\u3001\u6587\u4ef6\u53e5\u67c4\u3001\u7f51\u7edc\u8fde\u63a5\u3001\u4e92\u65a5\u91cf\u7b49\u7b49\uff09\u7684\u7b80\u5355\u6280\u672f\u3002\u667a\u80fd\u6307\u9488\u5373RAII\u6700\u5177\u4ee3\u8868\u7684\u5b9e\u73b0 C++\u7279\u6027 \u00b6 C++\u7684\u7279\u6027\uff08C++11\u53ca\u4ee5\u4e0a\uff09 \u00b6 \u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001 \u9700\u8981\u5728\u4e0d\u540c\u7684\u5e73\u53f0\u4e0a\u8fdb\u884c\u7f16\u8bd1 \u7f16\u8bd1\u540e\u7684\u7a0b\u5e8f\u53ef\u4ee5\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u76f4\u63a5\u8fd0\u884c \u53ef\u4ee5\u9762\u5411\u8fc7\u7a0b\u548c\u9762\u5411\u5bf9\u8c61\u4e24\u79cd\u8bbe\u8ba1\u65b9\u5f0f \u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u672c\u5730\u7684\u7cfb\u7edf\u5e93 \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u63a5\u53e3 \u7f16\u8bd1\u540e\u4ec5\u5bf9\u53d8\u91cf\u7684\u7c7b\u578b\u8fdb\u884c\u4e86\u5b58\u50a8\uff0c\u4e0d\u53ef\u4ee5\u8fdb\u884c\u7c7b\u4f3c\u53cd\u5c04\u7684\u64cd\u4f5c \u652f\u6301\u65e0\u7b26\u53f7\u6574\u578b \u53d8\u91cf\u7c7b\u578b\u7684\u5b57\u8282\u957f\u5ea6\u53d7\u64cd\u4f5c\u7cfb\u7edf\u5f71\u54cd \u652f\u6301\u6307\u9488\u3001\u5f15\u7528\u3001\u503c\u4f20\u9012 \u6ca1\u6709\u9ed8\u8ba4\u63d0\u4f9b\u7684GC\u7cfb\u7edf \u7531\u7a0b\u5e8f\u5458\u8d1f\u8d23\u7ba1\u7406\u53d8\u91cf\u6240\u50a8\u5b58\u7684\u4f4d\u7f6e \u4e25\u683c\u7684RAII \u652f\u6301\u91cd\u5199\u3001\u91cd\u8f7d\uff0c\u5305\u62ec\u8fd0\u7b97\u7b26\u7684\u91cd\u8f7d \u591a\u91cd\u7ee7\u627f \u652f\u6301\u9884\u7f16\u8bd1\uff0c\u7f16\u8bd1\u5b8f\u5b9a\u4e49 \u652f\u6301\u51fd\u6570\u6307\u9488\uff0c\u51fd\u6570\u5bf9\u8c61\uff0clambda\u8868\u8fbe\u5f0f C++11\u65b0\u589e\u7684\u7279\u6027 \u00b6 foreach auto \u81ea\u52a8\u7c7b\u578b\u63a8\u65ad lambda \u533f\u540d\u51fd\u6570 \u540e\u7f6e\u8fd4\u56de\u7c7b\u578b override \u5173\u952e\u5b57 \u7981\u6b62\u91cd\u5199 final \u5e38\u91cf\u8868\u8fbe\u5f0f constexpr nullptr \u4ee3\u8868\u539f\u6765\u7684NULL\uff0c\u800c\u539f\u6765\u7684NULL\u66f4\u591a\u8868\u793a\u4e3a0 \u5f53\u5b58\u5728 void a(int x); \u548c void a(char *x); \u65f6\uff0c\u82e5\u4f7f\u7528 a(NULL) \u5219\u4f1a\u8c03\u7528\u524d\u8005\uff0c\u8fd9\u4e0e\u901a\u5e38\u7684\u7406\u89e3\u4e0d\u540c\uff0c\u800c\u4f7f\u7528 a*nullptr) \u5219\u4f1a\u660e\u786e\u7684\u8c03\u7528\u540e\u8005 \u5143\u7ec4 tuple \uff0c\u53ef\u4ee5\u4f7f\u7528 get<>() \u53d6\u51fa\u5176\u4e2d\u4e00\u4e2a\u503c\uff0c\u6216\u8005\u4f7f\u7528 tie() \u88c5\u5305\u6216\u89e3\u5305 struct\u548cclass\u7684\u533a\u522b \u00b6 struct\u9ed8\u8ba4\u4f7f\u7528public\uff0c\u800cclass\u9ed8\u8ba4\u4f7f\u7528private struct\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 {} \u8fdb\u884c\u521d\u59cb\u5316\uff0c\u800cclass\u5219\u9700\u8981\u6240\u6709\u6210\u5458\u53d8\u91cf\u90fd\u662fpublic\u7684\u65f6\u5019\u624d\u53ef\u4ee5\u4f7f\u7528 \u5806\u548c\u6808\u7684\u533a\u522b \u00b6 \u7533\u8bf7\u65b9\u5f0f\uff1a\u6808\u662f\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u5806\u662f\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7 \u7533\u8bf7\u540e\u7cfb\u7edf\u54cd\u5e94\uff1a\u5206\u914d\u6808\u7a7a\u95f4\uff0c\u5982\u679c\u5269\u4f59\u7a7a\u95f4\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u5219\u5206\u914d\u6210\u529f\uff0c\u5426\u5219\u5206\u914d\u5931\u8d25\u6808\u6ea2\u51fa\uff1b\u7533\u8bf7\u5806\u7a7a\u95f4\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u5448\u73b0\u7684\u65b9\u5f0f\u7c7b\u4f3c\u4e8e\u94fe\u8868\uff08\u8bb0\u5f55\u7a7a\u95f2\u5730\u5740\u7a7a\u95f4\u7684\u94fe\u8868\uff09\uff0c\u5728\u94fe\u8868\u4e0a\u5bfb\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u7684\u8282\u70b9\u5206\u914d\u7ed9\u7a0b\u5e8f\uff0c\u5c06\u8be5\u8282\u70b9\u4ece\u94fe\u8868\u4e2d\u5220\u9664\uff0c\u5927\u591a\u6570\u7cfb\u7edf\u4e2d\u8be5\u5757\u7a7a\u95f4\u7684\u9996\u5730\u5740\u5b58\u653e\u7684\u662f\u672c\u6b21\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u4fbf\u4e8e\u91ca\u653e\uff0c\u5c06\u8be5\u5757\u7a7a\u95f4\u4e0a\u7684\u5269\u4f59\u7a7a\u95f4\u518d\u6b21\u8fde\u63a5\u5728\u7a7a\u95f2\u94fe\u8868\u4e0a \u6808\u5728\u5185\u5b58\u4e2d\u662f\u8fde\u7eed\u7684\u4e00\u5757\u7a7a\u95f4\uff08\u5411\u4f4e\u5730\u5740\u6269\u5c55\uff09\u6700\u5927\u5bb9\u91cf\u662f\u7cfb\u7edf\u9884\u5b9a\u597d\u7684\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u7684\u7a7a\u95f4\uff08\u5411\u9ad8\u5730\u5740\u6269\u5c55\uff09\u662f\u4e0d\u8fde\u7eed\u7684 \u7533\u8bf7\u6548\u7387\uff1a\u6808\u662f\u6709\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u7533\u8bf7\u6548\u7387\u9ad8\uff0c\u4f46\u7a0b\u5e8f\u5458\u65e0\u6cd5\u63a7\u5236\uff1b\u5806\u662f\u7531\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7\uff0c\u6548\u7387\u4f4e\uff0c\u4f7f\u7528\u8d77\u6765\u65b9\u4fbf\u4f46\u662f\u5bb9\u6613\u4ea7\u751f\u788e\u7247 \u5b58\u653e\u7684\u5185\u5bb9\uff1a\u6808\u4e2d\u5b58\u653e\u7684\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u51fd\u6570\u7684\u53c2\u6570\uff1b\u5806\u4e2d\u5b58\u653e\u7684\u5185\u5bb9\u7531\u7a0b\u5e8f\u5458\u63a7\u5236 \u64cd\u4f5c\u7cfb\u7edf\u89d2\u5ea6 \u00b6 \u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u8fdb\u7a0b\u6240\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\u7528\u6765\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u3002\u7531\u7a0b\u5e8f\u5458\u7ba1\u7406\uff0c\u4e3b\u52a8\u7533\u8bf7\u4ee5\u53ca\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\uff0c\u5728\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u7531\u64cd\u4f5c\u7cfb\u7edf\u56de\u6536 \u6808\u662f\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7ba1\u7406\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7533\u8bf7\uff0c\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u901a\u5e38\u6bd4\u5806\u8981\u5c0f\u5f88\u591a\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\uff0c2\u5f53\u8c03\u7528\u4e00\u4e2a\u51fd\u6570\u65f6\u4f1a\u521b\u5efa\u4e00\u4e2a\u6808\uff0c\u5f53\u51fd\u6570\u7ed3\u675f\u65f6\u5219\u4f1a\u56de\u6536\u6808\u7684\u7a7a\u95f4\u3002 \u6570\u636e\u7ed3\u6784\u89d2\u5ea6 \u00b6 \u5806\u662f\u4e00\u9897\u5b8c\u5168\u4e8c\u53c9\u6811\uff0c\u5e38\u89c1\u7684\u6709\u6700\u5927\u5806\u548c\u6700\u5c0f\u5806\uff0c\u4ee5\u6700\u5927\u5806\u4e3a\u4f8b\uff0c\u5176\u6ee1\u8db3\u4e8c\u53c9\u6811\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u8282\u70b9\u7684\u5b69\u5b50\u8282\u70b9\u90fd\u6bd4\u6b64\u8282\u70b9\u5c0f\u3002\u901a\u5e38\u7528\u6765\u5b9e\u73b0\u4f18\u5148\u961f\u5217\u7684\u6548\u679c\uff0c\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(log N)\\) \u6808\u662f\u4e00\u79cd\u7ebf\u6027\u6570\u636e\u7ed3\u6784\uff0c\u6ee1\u8db3\u5148\u8fdb\u540e\u51fa\u7684\u7279\u70b9\uff0c\u5373\u6700\u5148\u8fdb\u5165\u7684\u6570\u636e\u6700\u540e\u79bb\u5f00\uff0c\u5e38\u89c1\u4e8eDFS\u4e2d\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5355\u8c03\u6808\u7684\u65b9\u5f0f\u6c42\u89e3\u4e00\u4e9b\u95ee\u9898\u3002\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(1)\\) C++\u4e2d\u56db\u79cdcast\u8f6c\u6362 \u00b6 const_cast \uff1a\u5bf9\u4e8e\u672a\u5b9a\u4e49const\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528const_cast\u6765\u53bb\u9664const\u5f15\u7528\u5bf9\u8c61\u7684const\uff0c\u5b8c\u6210\u51fd\u6570\u8c03\u7528\u3002\u53e6\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u7ed3\u5408static_cast\uff0c\u53ef\u4ee5\u5728\u975econst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u5185\u6dfb\u52a0const\uff0c\u8c03\u7528\u5b8cconst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u540e\uff0c\u518d\u4f7f\u7528const_cast\u53bb\u9664const\u9650\u5b9a\u3002 static_cast \uff1a\u5b8c\u6210\u57fa\u7840\u6570\u636e\u7c7b\u578b\uff1b\u540c\u4e00\u4e2a\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7c7b\u578b\u7684\u8f6c\u6362\uff1b\u4efb\u610f\u7c7b\u578b\u4e0e\u7a7a\u6307\u9488\u7c7b\u578bvoid* \u4e4b\u95f4\u7684\u8f6c\u6362\u3002 reinterpret_cast \uff1a\u65e0\u6761\u4ef6\u8f6c\u6362\uff08\u4ec0\u4e48\u90fd\u53ef\u4ee5\u8f6c\uff09\uff0cint\u53ef\u4ee5\u8f6c\u6307\u9488\uff0c\u53ef\u80fd\u4f1a\u51fa\u95ee\u9898\uff0c\u5c3d\u91cf\u5c11\u7528\u3002 dynamic_cast \uff1a\u7528\u4e8e\u52a8\u6001\u7c7b\u578b\u8f6c\u6362\u3002\u53ea\u80fd\u7528\u4e8e\u542b\u6709\u865a\u51fd\u6570\u7684\u7c7b\uff0c\u7528\u4e8e\u7c7b\u5c42\u6b21\u95f4\u7684\u5411\u4e0a\u548c\u5411\u4e0b\u8f6c\u6362\uff08\u5b50\u7c7b\u548c\u57fa\u7c7b\uff09\u3002\u53ea\u80fd\u8f6c\u6307\u9488\u6216\u5f15\u7528\u3002\u5411\u4e0b\u8f6c\u5316\u65f6\uff0c\u5982\u679c\u662f\u975e\u6cd5\u7684\u5bf9\u4e8e\u6307\u9488\u8fd4\u56deNULL\uff0c\u5bf9\u4e8e\u5f15\u7528\u629b\u5f02\u5e38\u3002\u5b83\u901a\u8fc7\u5224\u65ad\u5728\u6267\u884c\u5230\u8be5\u8bed\u53e5\u7684\u65f6\u5019\u53d8\u91cf\u7684\u8fd0\u884c\u65f6\u7c7b\u578b\u548c\u8981\u8f6c\u6362\u7684\u7c7b\u578b\u662f\u5426\u76f8\u540c\u6765\u5224\u65ad\u662f\u5426\u80fd\u591f\u8fdb\u884c\u5411\u4e0b\u8f6c\u6362\u3002 static \u00b6 \u9759\u6001\u5c40\u90e8\u53d8\u91cf \uff1a\u53d8\u91cf\u5c5e\u4e8e\u51fd\u6570\u672c\u8eab\uff0c\u4ec5\u53d7\u51fd\u6570\u7684\u63a7\u5236\u3002\u4fdd\u5b58\u5728\u5168\u5c40\u6570\u636e\u533a\uff0c\u800c\u4e0d\u662f\u5728\u6808\u4e2d\uff0c\u6bcf\u6b21\u7684\u503c\u4fdd\u6301\u5230\u4e0b\u4e00\u6b21\u8c03\u7528\uff0c\u76f4\u5230\u4e0b\u6b21\u8d4b\u65b0\u503c\u3002 \u9759\u6001\u5168\u5c40\u53d8\u91cf \uff1a\u5b9a\u4e49\u5728\u51fd\u6570\u4f53\u5916\uff0c\u7528\u4e8e\u4fee\u9970\u5168\u5c40\u53d8\u91cf\uff0c\u8868\u793a\u8be5\u53d8\u91cf \u53ea\u5728\u672c\u6587\u4ef6\u53ef\u89c1 \uff0c\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff08\u5168\u5c40\u53d8\u91cf\u53ef\u4ee5\uff09 \u9759\u6001\u51fd\u6570 \uff1a\u9759\u6001\u51fd\u6570\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff0c\u5176\u4ed6\u6587\u4ef6\u4e2d\u53ef\u4ee5\u5b9a\u4e49\u76f8\u540c\u540d\u5b57\u7684\u51fd\u6570\uff0c\u4e0d\u4f1a\u53d1\u751f\u51b2\u7a81 \u9759\u6001\u6570\u636e\u6210\u5458 \uff1a\u9759\u6001\u6570\u636e\u6210\u5458\u7684\u751f\u5b58\u671f\u5927\u96e8class\u7684\u5b9e\u4f8b\uff08\u9759\u6001\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2aclass\u6709\u4e00\u4efd\uff0c\u666e\u901a\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2ainstance\u6709\u4e00\u4efd\uff09 1. \u9759\u6001\u6210\u5458\u4e4b\u95f4\u53ef\u4ee5\u76f8\u4e92\u8bbf\u95ee \uff0c\u5305\u62ec\u9759\u6001\u6210\u5458\u51fd\u6570\u8bbf\u95ee\u9759\u6001\u6570\u636e\u6210\u5458\u548c\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\uff1b 2. \u975e\u9759\u6001\u6210\u5458\u51fd\u6570 \u53ef\u4ee5\u4efb\u610f\u5730\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\u548c\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 3. \u9759\u6001\u6210\u5458\u51fd\u6570\u4e0d\u80fd\u8bbf\u95ee\u975e\u9759\u6001 \u6210\u5458\u51fd\u6570\u548c\u975e\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 4. \u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u53ef\u4ee5\u7528\u6210\u5458\u8bbf\u95ee\u64cd\u4f5c\u7b26 . \u6216 -> \u4e3a\u4e00\u4e2a\u7c7b\u7684\u5bf9\u8c61\u6216\u6307\u5411\u7c7b\u5bf9\u8c61\u7684\u6307\u9488\u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u4e5f\u53ef\u4ee5\u7528\u7c7b\u540d :: \u51fd\u6570\u540d\u8c03\u7528(\u56e0\u4e3a\u5b83\u672c\u6765\u5c31\u662f\u5c5e\u4e8e\u7c7b\u7684\uff0c\u7528\u7c7b\u540d\u8c03\u7528\u5f88\u6b63\u5e38) static\u53d8\u91cf\u7684\u7279\u70b9 \u00b6 \u8be5\u53d8\u91cf\u5728\u5168\u5c40\u6570\u636e\u533a\u5206\u914d\u5185\u5b58 \u672a\u7ecf\u521d\u59cb\u5316\u7684\u9759\u6001\u5168\u5c40\u53d8\u91cf\u4f1a\u88ab\u7a0b\u5e8f\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0\uff08\u81ea\u52a8\u53d8\u91cf\u7684\u503c\u662f\u968f\u673a\u7684\uff0c\u9664\u975e\u4ed6\u88ab\u663e\u5f0f\u521d\u59cb\u5316\uff09 \u9759\u6001\u5168\u5c40\u53d8\u91cf\u5728\u58f0\u660e\u5b83\u7684\u6574\u4e2a\u6587\u4ef6\u90fd\u662f\u53ef\u89c1\u7684\uff0c\u800c\u5728\u6587\u4ef6\u4e4b\u5916\u662f\u4e0d\u53ef\u89c1\u7684 const \u00b6 \u4fee\u9970\u666e\u901a\u7c7b\u578b\u7684\u53d8\u91cf \u4fee\u9970\u6307\u9488\uff1a \u9876\u5c42const \uff08\u6307\u9488\u672c\u8eab\u662f\u4e2a\u5e38\u91cf\uff09\u548c \u5e95\u5c42const \uff08\u6307\u9488\u6307\u5411\u5bf9\u8c61\u662f\u4e00\u4e2a\u5e38\u91cf\uff09 \u4fee\u9970\u51fd\u6570\u53c2\u6570\uff1a 1. \u51fd\u6570\u53c2\u6570\u4e3a\u503c\u4f20\u9012\uff1a\u503c\u4f20\u9012\uff08pass-by-value\uff09\u662f\u4f20\u9012\u4e00\u4efd\u53c2\u6570\u7684\u62f7\u8d1d\u7ed9\u51fd\u6570\uff0c\u56e0\u6b64\u4e0d\u8bba\u51fd\u6570\u4f53\u4ee3\u7801\u5982\u4f55\u8fd0\u884c\uff0c\u4e5f\u53ea\u4f1a\u4fee\u6539\u62f7\u8d1d\u800c\u65e0\u6cd5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff0c\u8fd9\u79cd\u60c5\u51b5 \u4e0d\u9700\u8981\u5c06\u53c2\u6570\u58f0\u660e\u4e3aconst \u3002 2. \u51fd\u6570\u53c2\u6570\u4e3a\u6307\u9488\uff1a\u6307\u9488\u4f20\u9012\uff08pass-by-pointer\uff09 \u53ea\u4f1a\u8fdb\u884c\u6d45\u62f7\u8d1d\uff0c\u62f7\u8d1d\u4e00\u4efd\u6307\u9488\u7ed9\u51fd\u6570 \uff0c\u800c\u4e0d\u4f1a\u62f7\u8d1d\u4e00\u4efd\u539f\u59cb\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u7ed9\u6307\u9488\u53c2\u6570\u52a0\u4e0a\u9876\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u9488\u6307\u5411\u88ab\u7be1\u6539\uff0c\u52a0\u4e0a\u5e95\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u5411\u5bf9\u8c61\u88ab\u7be1\u6539\u3002 3. \u51fd\u6570\u53c2\u6570\u4e3a\u5f15\u7528\uff1a\u5f15\u7528\u4f20\u9012\uff08pass-by-reference\uff09\u53c8\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u7531\u4e8e\u5f15\u7528\u5c31\u662f\u5bf9\u8c61\u7684\u4e00\u4e2a\u522b\u540d\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u62f7\u8d1d\u5bf9\u8c61\uff0c\u51cf\u5c0f\u4e86\u5f00\u9500\u3002\u8fd9\u540c\u65f6\u4e5f\u5bfc\u81f4\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u5f15\u7528\u76f4\u63a5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff08\u6bd5\u7adf\u5f15\u7528\u548c\u539f\u59cb\u5bf9\u8c61\u5176\u5b9e\u662f\u540c\u4e00\u4e2a\u4e1c\u897f\uff09\uff0c\u56e0\u6b64\uff0c\u5927\u591a\u6570\u65f6\u5019\uff0c\u63a8\u8350\u51fd\u6570\u53c2\u6570\u8bbe\u7f6e\u4e3a pass-by-reference-to-const \u3002\u7ed9\u5f15\u7528\u52a0\u4e0a\u5e95\u5c42const\uff0c\u65e2\u53ef\u4ee5\u51cf\u5c0f\u62f7\u8d1d\u5f00\u9500\uff0c\u53c8\u53ef\u4ee5\u9632\u6b62\u4fee\u6539\u5e95\u5c42\u6240\u7528\u7684\u5bf9\u8c61\u3002 \u4fee\u9970\u51fd\u6570\u8fd4\u56de\u503c\uff1a\u4ee4\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5e38\u91cf\uff0c\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u56e0\u7528\u6237\u9519\u8bef\u9020\u6210\u7684\u610f\u5916\uff0c\u6bd4\u5982\u201c=\u201d\u3002 const\u6210\u5458\u51fd\u6570\uff1a const\u6210\u5458\u51fd\u6570\u4e0d\u53ef\u4fee\u6539\u7c7b\u5bf9\u8c61\u7684\u5185\u5bb9 \uff08\u6307\u9488\u7c7b\u578b\u7684\u6570\u636e\u6210\u5458\u53ea\u80fd\u4fdd\u8bc1\u4e0d\u4fee\u6539\u8be5\u6307\u9488\u6307\u5411\uff09\u3002\u539f\u7406\u662fconst\u6210\u5458\u51fd\u6570\u7684this\u6307\u9488\u5f0f\u5e95\u5c42const\u6307\u9488\uff0c\u4e0d\u80fd\u540c\u4e8e\u6539\u53d8\u5176\u6240\u6307\u5bf9\u8c61\u7684\u503c\u3002 \u5f53\u6210\u5458\u51fd\u6570const\u548cnon-const\u7248\u672c\u540c\u65f6\u5b58\u5728\u65f6\uff0cconst object\u53ea\u80fd\u8c03\u7528const\u7248\u672c\uff0cnon-const object\u667a\u80fd\u8c03\u7528non-const\u7248\u672c\u3002 extern \"C\" \u00b6 extern \"C\"\u7684\u4e3b\u8981\u4f5c\u7528\u5c31\u662f\u4e3a\u96f6\u80fd\u591f\u6b63\u786e\u5b9e\u73b0 C++\u4ee3\u7801\u8c03\u7528\u5176\u4ed6C\u8bed\u8a00\u4ee3\u7801 \u3002 \u52a0\u4e0aextern \"C\"\u540e\uff0c\u4f1a\u6307\u793a\u7f16\u8bd1\u5668\u8fd9\u90e8\u5206\u4ee3\u7801\u6309C\u8bed\u8a00\uff08\u800c\u4e0d\u662fC++\uff09\u7684\u65b9\u5f0f\u8fdb\u884c\u7f16\u8bd1\u3002\u7531\u4e8eC++\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1\u5668\u7f16\u8bd1\u51fd\u6570\u7684\u8fc7\u7a0b\u4e2d\u4f1a\u5c06\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u4e5f\u52a0\u5230\u7f16\u8bd1\u540e\u7684\u4ee3\u7801\u4e2d\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u51fd\u6570\u540d\uff1b\u800cC\u8bed\u8a00\u5e76\u4e0d\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1C\u8bed\u8a00\u4ee3\u7801\u7684\u51fd\u6570\u65f6\u4e0d\u4f1a\u5e26\u4e0a\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\uff0c\u4e00\u822c\u6307\u5305\u62ec\u51fd\u6570\u540d\u3002 \u5728C++\u51fa\u73b0\u4ee5\u524d\uff0c\u5f88\u591a\u4ee3\u7801\u90fd\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u800c\u4e14\u5f88\u5e95\u5c42\u7684\u5e93\u4e5f\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u4e3a\u4e86\u66f4\u597d\u7684\u652f\u6301\u539f\u6765\u7684C\u4ee3\u7801\u548c\u5df2\u7ecf\u5199\u597d\u7684C\u8bed\u8a00\u5e93\uff0c\u9700\u8981\u5728C++\u4e2d\u5c3d\u53ef\u80fd\u652f\u6301C\uff0c\u800cextern \"C\"\u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u7b56\u7565\u3002 C++\u4ee3\u7801\u8c03\u7528C\u8bed\u8a00\u4ee3\u7801 \u5728C++\u7684\u5934\u6587\u4ef6\u4e2d\u4f7f\u7528 \u5728\u591a\u4e2a\u534f\u540c\u5f00\u53d1\u65f6\uff0c\u53ef\u80fd\u6709\u7684\u4eba\u6bd4\u8f83\u64c5\u957fC\u8bed\u8a00\uff0c\u800c\u6709\u7684\u4eba\u64c5\u957fC++ inline \u00b6 \u7c7b\u5185\u5b9a\u4e49\u6210\u5458\u51fd\u6570\u9ed8\u8ba4\u4e3ainline \u4f18\u70b9 \u00b6 inline\u5b9a\u4e49\u7684\u7c7b\u7684\u5185\u8054\u51fd\u6570\uff0c\u51fd\u6570\u7684\u4ee3\u7801\u88ab\u653e\u5165\u7b26\u53f7\u8868\u4e2d\uff0c\u5728\u4f7f\u7528\u65f6\u76f4\u63a5\u8fdb\u884c\u66ff\u6362\uff0c\uff08\u50cf\u5b8f\u4e00\u6837\u5c55\u5f00\uff09\uff0c\u6ca1\u6709\u4e86\u8c03\u7528\u7684\u5f00\u9500\uff0c\u6548\u7387\u4e5f\u5f88\u9ad8\u3002 \u5185\u8054\u51fd\u6570\u4e5f\u662f\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u5728\u8c03\u7528\u4e00\u4e2a\u5185\u8054\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u68c0\u67e5\u5b83\u7684\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u4fdd\u8bc1\u8c03\u7528\u6b63\u786e\u3002\u7136\u540e\u8fdb\u884c\u4e00\u7cfb\u5217\u7684\u76f8\u5173\u68c0\u67e5\uff0c\u5c31\u50cf\u5bf9\u5f85\u4efb\u4f55\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\u4e00\u6837\u3002\u8fd9\u6837\u5c31\u6d88\u9664\u4e86\u5b83\u7684\u9690\u60a3\u548c\u5c40\u9650\u6027\u3002\uff08\u5b8f\u66ff\u6362\u4e0d\u4f1a\u68c0\u67e5\u7c7b\u578b\uff0c\u5b89\u5168\u9690\u60a3\u8f83\u5927\uff09 inline\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u7c7b\u7684\u6210\u5458\u51fd\u6570\uff0c\u4e0e\u7c7b\u7684\u666e\u901a\u6210\u5458\u51fd\u6570\u4f5c\u7528\u76f8\u540c\uff0c\u53ef\u4ee5\u653e\u4e3a\u4e00\u4e2a\u7c7b\u7684\u79c1\u6709\u6210\u5458\u548c\u4fdd\u62a4\u6210\u5458\u3002\u5185\u8054\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u66ff\u6362\u4e00\u822c\u7684\u5b8f\u5b9a\u4e49\uff0c\u6700\u91cd\u8981\u7684\u5e94\u7528\u5728\u4e8e\u7c7b\u7684\u5b58\u53d6\u51fd\u6570\u7684\u5b9a\u4e49\u4e0a\u9762\u3002 \u7f3a\u70b9 \u00b6 \u5185\u8054\u51fd\u6570\u5177\u6709\u4e00\u5b9a\u7684\u5c40\u9650\u6027\uff0c\u5185\u8054\u51fd\u6570\u7684 \u51fd\u6570\u4f53\u4e00\u822c\u6765\u8bf4\u4e0d\u80fd\u592a\u5927 \uff0c\u5982\u679c\u5185\u8054\u51fd\u6570\u7684\u51fd\u6570\u4f53\u8fc7\u5927\uff0c\u4e00\u822c\u7684\u7f16\u8bd1\u5668\u4f1a\u653e\u5f03\u5185\u8054\u65b9\u5f0f\uff0c\u800c\u91c7\u7528\u666e\u901a\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570\u3002\uff08\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f60\u5982\u679c\u4f7f\u7528\u5185\u8054\u51fd\u6570\uff0c\u53ea\u4e0d\u8fc7\u662f\u5411\u7f16\u8bd1\u5668\u63d0\u51fa\u4e00\u4e2a\u8bf7\u6c42\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u62d2\u7edd\u4f60\u7684\u8bf7\u6c42\uff09\u8fd9\u6837\uff0c\u5185\u8054\u51fd\u6570\u5c31\u548c\u666e\u901a\u51fd\u6570\u6267\u884c\u6548\u7387\u4e00\u6837\u4e86\u3002 inline\u8bf4\u660e\u5bf9\u7f16\u8bd1\u5668\u6765\u8bf4\u53ea\u662f\u4e00\u79cd\u5efa\u8bae\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u9009\u62e9\u5ffd\u7565\u8fd9\u4e2a\u5efa\u8bae\u3002\u6bd4\u5982\uff0c\u4f60\u8bb2\u4e00\u4e2a\u957f\u8fbe1000\u591a\u884c\u7684\u51fd\u6570\u6307\u5b9a\u4e3ainline\uff0c\u7f16\u8bd1\u5668\u5c31\u4f1a\u5ffd\u7565\u8fd9\u4e2ainline\uff0c\u5c06\u8fd9\u4e2a\u51fd\u6570\u8fd8\u539f\u6210\u666e\u901a\u51fd\u6570\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u8bf4\u628a\u4e00\u4e2a\u51fd\u6570\u5b9a\u4e49\u4e3ainline\u51fd\u6570\u5c31\u4e00\u5b9a\u4f1a\u88ab\u7f16\u8bd1\u5668\u8bc6\u522b\u4e3a\u5185\u8054\u51fd\u6570\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668\u7684\u5b9e\u73b0\u548c\u51fd\u6570\u4f53\u7684\u5927\u5c0f\u3002 \u548c\u5b8f\u5b9a\u4e49\u7684\u533a\u522b \u00b6 \u5b8f\u662f\u7531\u9884\u5904\u7406\u5668\u5bf9\u5b8f\u8fdb\u884c\u66ff\u4ee3\uff0c\u800c\u4e14\u5185\u8054\u51fd\u6570\u662f\u771f\u6b63\u7684\u51fd\u6570\uff0c\u53ea\u662f\u5728\u9700\u8981\u7528\u5230\u7684\u65f6\u5019\uff0c\u5185\u8054\u51fd\u6570\u50cf\u5b8f\u4e00\u6837\u7684\u5c55\u5f00\uff0c\u6240\u4ee5 \u53d6\u6d88\u4e86\u51fd\u6570\u7684\u53c2\u6570\u538b\u6808\uff0c\u51cf\u5c11\u4e86\u8c03\u7528\u7684\u5f00\u9500 \uff0c\u4f60\u53ef\u4ee5\u50cf\u8c03\u7528\u51fd\u6570\u4e00\u6837\u6765\u8c03\u7528\u5185\u8054\u51fd\u6570\uff0c\u800c\u4e0d\u5fc5\u62c5\u5fc3\u4f1a\u4ea7\u751f\u4e8e\u5904\u7406\u5b8f\u7684\u4e00\u4e9b\u95ee\u9898\u3002\u5185\u8054\u51fd\u6570\u4e0e\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ed6\u4eec\u7684\u4ee3\u7801\u6548\u7387\u662f\u4e00\u6837\uff0c\u4f46\u662f\u5185\u8054\u51fd\u6570\u8981\u4f18\u4e8e\u5b8f\u5b9a\u4e49\uff0c\u56e0\u4e3a\u5185\u8054\u51fd\u6570\u9075\u5faa\u7684\u7c7b\u578b\u548c\u4f5c\u7528\u57df\u89c4\u5219\uff0c\u5b83\u4e0e\u4e00\u822c\u51fd\u6570\u66f4\u76f8\u8fd1\uff0c\u5728\u4e00\u4e9b\u7f16\u8bd1\u5668\u4e2d\uff0c\u4e00\u65e6\u5173\u8054\u4e0a\u5185\u8054\u6269\u5c55\uff0c\u5c06\u4e0e\u4e00\u822c\u51fd\u6570\u4e00\u6837\u8fdb\u884c\u8c03\u7528\uff0c\u6bd4\u8f83\u65b9\u4fbf\u3002 \u6307\u9488\u548c\u5f15\u7528 \u00b6 \u6307\u9488\u6709\u7740\u81ea\u5df1\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u662f\u4e00\u4e2a\u53d8\u91cf\u7c7b\u578b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e0d\u4f1a\u50cf\u5176\u4ed6\u53d8\u91cf\u4e00\u6837\u53d8\u5316\uff0c\u800c\u5f15\u7528\u672c\u8d28\u4e0a\u662f\u201c\u53d8\u91cf\u7684\u522b\u540d\u201d\uff0c\u6ca1\u6709\u5360\u7528\u5185\u5b58\u7a7a\u95f4 \u6307\u9488\u5728\u58f0\u660e\u5468\u671f\u5185\u968f\u65f6\u53ef\u80fd\u4f1aNULL\uff0c\u6240\u4ee5\u4f7f\u7528\u65f6\u4e00\u5b9a\u8981\u505a\u68c0\u67e5\uff0c\u9632\u6b62\u51fa\u73b0\u7a7a\u6307\u9488\u3001\u91ce\u6307\u9488\u7684\u60c5\u51b5 \u6307\u9488\u58f0\u660e\u65f6\u53ef\u4ee5 \u6682\u65f6\u4e0d\u521d\u59cb\u5316 \uff0c\u5f15\u7528\u58f0\u660e\u65f6 \u5fc5\u987b\u521d\u59cb\u5316 \u4f7f\u7528 sizeof \u53ef\u4ee5\u6c42\u5f97\u51fa\u572832\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e3a4\u4e2a\u5b57\u8282\uff0c\u800c\u5f15\u7528\u5219\u4e3a\u539f\u5bf9\u8c61\u7684\u5927\u5c0f \u6307\u9488\u53ef\u4ee5\u521d\u59cb\u5316\u4e3a\u4efb\u610f\u6b63\u6574\u6570\u503c\uff0c\u800c\u5f15\u7528\u5fc5\u987b\u521d\u59cb\u5316\u4e3a\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u53d8\u91cf \u53c2\u6570\u4f20\u9012\u65f6\uff0c\u6307\u9488\u9700\u8981\u5148\u8fdb\u884c\u6307\u9488\u8f6c\u4e3a\u5f15\u7528\u7136\u540e\u518d\u4f7f\u7528\uff0c\u800c\u5f15\u7528\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u539f\u5bf9\u8c61 \u6307\u9488\u53ef\u4ee5\u6709 const \u5c5e\u6027\uff0c\u800c\u5f15\u7528\u6ca1\u6709 \u6307\u9488\u53ef\u4ee5\u91cd\u65b0\u8d4b\u503c\uff0c\u800c\u5f15\u7528\u4e0d\u53ef\u4ee5\u66f4\u6539 \u6307\u9488\u53ef\u4ee5\u8fdb\u884c\u591a\u7ea7\u6307\u9488\uff0c\u800c\u5f15\u7528\u53ea\u6709\u4e00\u7ea7 \u6307\u9488\u548c\u5f15\u7528\u8fdb\u884c++\uff08\u81ea\u589e\uff09\u64cd\u4f5c\u7684\u903b\u8f91\u548c\u7ed3\u679c\u90fd\u4e0d\u540c \u5f53\u9700\u8981\u8fd4\u56de\u52a8\u6001\u5185\u5b58\u5206\u914d\u7684\u5bf9\u8c61\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u6307\u9488\u800c\u4e0d\u662f\u5f15\u7528\uff0c\u56e0\u4e3a\u5f15\u7528\u53ef\u80fd\u4f1a\u4ea7\u751f\u5185\u5b58\u6cc4\u6f0f C++\u56db\u4e2a\u667a\u80fd\u6307\u9488 \u00b6 \u5c06\u57fa\u672c\u7c7b\u578b\u6307\u9488\u5c01\u88c5\u4e3a\u7c7b\u5bf9\u8c61\u6307\u9488\uff0c\u5e76\u5728\u6790\u6784\u51fd\u6570\u91cc\u7f16\u5199delete\u8bed\u53e5\u5220\u9664\u6307\u9488\u6307\u5411\u7684\u5185\u5b58\u7a7a\u95f4\u3002 \u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f \u7a7a\u6307\u9488\u548c\u91ce\u6307\u9488\u7684\u95ee\u9898 \u5bf9\u8c61\u91cd\u590d\u91ca\u653e\u7684\u95ee\u9898 \u5185\u5b58\u6cc4\u6f0f\u7684\u95ee\u9898 auto_ptr \uff08\u5df2\u5f03\u7528\uff09 \u91c7\u7528\u6240\u6709\u6743\u6a21\u5f0f\uff0c\u4efb\u4f55\u4e00\u4e2a new \u7684\u5bf9\u8c61\u53ea\u80fd\u7531\u4e00\u4e2a auto_ptr \u6765\u6307\u5411\uff0c\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u4f1a\u4f7f\u5f97\u539f\u6765\u7684\u6307\u9488\u4e22\u5931\u6307\u5411\u7684\u5bf9\u8c61 unique_ptr \u4e0e auto_ptr \u76f8\u540c\uff0c\u4f46\u662f\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u76f4\u63a5\u62a5\u9519\uff0c\u800c auto_ptr \u4e0d\u4f1a shared_ptr \u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u591a\u4e2a\u6307\u9488\u6307\u5411\u6b64\u5bf9\u8c61\uff0c\u540c\u65f6\u5f53\u6240\u6709\u6307\u5411\u6b64\u5bf9\u8c61\u7684\u6307\u9488\u90fd\u88ab\u6790\u6784\u540e\uff0c\u6b64\u5bf9\u8c61\u5c06\u4f1a\u88ab\u5220\u9664 weak_ptr \u5f31\u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u6307\u5411\u5176\u4ed6\u7684 shared_ptr \u5bf9\u8c61\uff0c\u6b64\u6307\u9488\u4e0d\u4f1a\u5f71\u54cd shared_ptr \u7684\u6790\u6784\u884c\u4e3a\uff0c\u901a\u5e38\u7528\u6765\u907f\u514d\u76f8\u4e92\u6307\u5411\u95ee\u9898 \u91ce\u6307\u9488 \u00b6 \u6307\u5411\u88ab\u91ca\u653e\u7684\u6216\u8005\u8bbf\u95ee\u53d7\u9650\u5185\u5b58\u7684\u6307\u9488\u3002 \u9020\u6210\u91ce\u6307\u9488\u7684\u539f\u56e0\uff1a - \u6307\u9488\u53d8\u91cf\u6ca1\u6709\u88ab\u521d\u59cb\u5316\uff08\u5982\u679c\u503c\u4e0d\u5b9a\uff0c\u53ef\u4ee5\u521d\u59cb\u5316\u4e3aNULL\uff09 - \u6307\u9488\u88abfree\u6216\u8005delete\u540e\uff0c\u6ca1\u6709\u7f6e\u4e3aNULL\uff0cfree\u548cdelete\u53ea\u662f\u628a\u6307\u9488\u6240\u6307\u5411\u7684\u5185\u5b58\u7ed9\u91ca\u653e\u6389\uff0c\u5e76\u6ca1\u6709\u628a\u6307\u9488\u672c\u8eab\u5e72\u6389\uff0c\u6b64\u65f6\u6307\u9488\u6307\u5411\u7684\u662f\uff1a\u201c\u5783\u573e\u201d\u5185\u5b58\u3002\u91ca\u653e\u540e\u7684\u6307\u9488\u5e94\u8be5\u88ab\u7f6e\u4e3aNULL\u3002 - \u6307\u9488\u64cd\u4f5c\u8d85\u8d8a\u4e86\u53d8\u91cf\u7684\u4f5c\u7528\u8303\u56f4\uff0c\u6bd4\u5982\u8fd4\u56de\u6307\u5411\u6808\u5185\u5b58\u7684\u6307\u9488\u5c31\u662f\u91ce\u6307\u9488\u3002 new\u548cmalloc \u00b6 \u5728\u4f7f\u7528\u7684\u65f6\u5019 new,delete \u642d\u914d\u4f7f\u7528\uff0cmalloc \u548c free \u642d\u914d\u4f7f\u7528\u3002 \u5c5e\u6027\uff1amalloc/free \u662f\u5e93\u51fd\u6570\uff0c\u9700\u8981\u5934\u6587\u4ef6\u7684\u652f\u6301\uff1bnew/delete \u662f\u5173\u952e\u5b57\uff0c\u9700\u8981\u7f16\u8bd1\u5668\u7684\u652f\u6301 \u53c2\u6570\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u65e0\u9700\u6307\u5b9a\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u7c7b\u578b\u81ea\u884c\u8ba1\u7b97\uff1bmalloc \u5728\u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u9700\u8981\u786e\u5b9a\u6240\u7533\u8bf7\u7a7a\u95f4\u7684\u5927\u5c0f \u8fd4\u56de\u503c\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u7c7b\u578b\u662f\u5bf9\u8c61\u7684\u6307\u9488\u7c7b\u578b\uff0c\u65e0\u9700\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\uff0c\u7b26\u5408\u7c7b\u578b\u5b89\u5168\u7684\u64cd\u4f5c\u7b26\uff1bmalloc \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u662f void* \u7c7b\u578b\uff0c\u9700\u8981\u8fdb\u884c\u5f3a\u5236\u7c7b\u578b\u7684\u8f6c\u6362\uff0c\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7c7b\u578b\u7684\u6307\u9488 \u5206\u914d\u5931\u8d25\uff1anew \u5206\u914d\u5931\u8d25\u65f6\uff0c\u4f1a\u629b\u51fa bad_alloc \u5f02\u5e38\uff0cmalloc \u5206\u914d\u5931\u8d25\u65f6\u8fd4\u56de\u7a7a\u6307\u9488 \u91cd\u8f7d\uff1anew/delete \u652f\u6301\u91cd\u8f7d\uff0cmalloc/free \u4e0d\u80fd\u8fdb\u884c\u91cd\u8f7d \u81ea\u5b9a\u4e49\u7c7b\u578b\u5b9e\u73b0\uff1anew \u9996\u5148\u8c03\u7528 operator new \u51fd\u6570\u7533\u8bf7\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 malloc \u5b9e\u73b0\uff09\uff0c\u7136\u540e\u8c03\u7528\u6784\u9020\u51fd\u6570\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u6700\u540e\u8fd4\u56de\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u6307\u9488\uff1bdelete \u9996\u5148\u8c03\u7528\u6790\u6784\u51fd\u6570\uff0c\u7136\u540e\u8c03\u7528 operator delete \u91ca\u653e\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 free \u5b9e\u73b0\uff09\u3002malloc/free \u65e0\u6cd5\u8fdb\u884c\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u5bf9\u8c61\u7684\u6784\u9020\u548c\u6790\u6784 \u5185\u5b58\u533a\u57df\uff1anew \u64cd\u4f5c\u7b26\u4ece\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e3a\u5bf9\u8c61\u52a8\u6001\u5206\u914d\u5185\u5b58\uff0c\u800c malloc \u51fd\u6570\u4ece\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002\uff08\u81ea\u7531\u5b58\u50a8\u533a\u4e0d\u7b49\u4e8e\u5806\uff09 \u7279\u5f81 new/delete malloc/free \u5206\u914d\u5185\u5b58\u7684\u4f4d\u7f6e \u81ea\u7531\u5b58\u50a8\u533a \u5806 \u5206\u914d\u6210\u529f \u8fd4\u56de\u5b8c\u6574\u7c7b\u578b\u6307\u9488 \u8fd4\u56devoid* \u5206\u914d\u5931\u8d25 \u9ed8\u8ba4\u629b\u51fa\u5f02\u5e38 \u8fd4\u56deNULL \u5206\u914d\u5185\u5b58\u7684\u5927\u5c0f \u7531\u7f16\u8bd1\u5668\u6839\u636e\u7c7b\u578b\u8ba1\u7b97\u5f97\u51fa \u5fc5\u987b\u663e\u5f0f\u6307\u5b9a\u5b57\u8282\u6570 \u5904\u7406\u6570\u7ec4 \u6709\u5904\u7406\u6570\u7ec4\u7684new\u7248\u672c\u548cnew[] \u9700\u8981\u7528\u6237\u8ba1\u7b97\u6570\u7ec4\u7684\u5927\u5c0f\u540e\u8fdb\u884c\u5185\u5b58\u5206\u914d \u4ee5\u5206\u914d\u5185\u5b58\u7684\u6269\u5145 \u65e0\u6cd5\u76f4\u89c2\u5904\u7406 \u4f7f\u7528realloc\u7b80\u5355\u5b8c\u6210 \u662f\u5426\u76f8\u4e92\u8c03\u7528 \u53ef\u4ee5\uff0c\u770b\u5177\u4f53\u7684operator new/delete\u5b9e\u73b0 \u4e0d\u53ef\u8c03\u7528new \u5206\u914d\u5185\u5b58\u65f6\u5185\u5b58\u4e0d\u8db3 \u5ba2\u6237\u80fd\u591f\u5236\u5b9a\u5904\u7406\u51fd\u6570\u6216\u91cd\u65b0\u5236\u5b9a\u5206\u914d\u5668 \u65e0\u6cd5\u901a\u8fc7\u7528\u6237\u4ee3\u7801\u8fdb\u884c\u5904\u7406 \u51fd\u6570\u91cd\u8f7d \u5141\u8bb8 \u4e0d\u5141\u8bb8 \u6784\u9020\u51fd\u6570\u4e0e\u6790\u6784\u51fd\u6570 \u8c03\u7528 \u4e0d\u8c03\u7528 \u6784\u9020\u51fd\u6570 \u00b6 \u6784\u9020\u51fd\u6570\u7684\u7279\u5f81 \u00b6 \u540d\u5b57\u548c\u7c7b\u540d\u76f8\u540c \u6ca1\u6709\u8fd4\u56de\u503c \u751f\u6210\u7c7b\u7684\u81ea\u52a8\u6267\u884c\uff0c\u4e0d\u9700\u8981\u8c03\u7528 \u4e3a\u4ec0\u4e48\u6784\u9020\u51fd\u6570\u4e0d\u53ef\u4ee5\u662f\u865a\u51fd\u6570 \u00b6 \u56e0\u4e3a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u5728\u6784\u9020\u51fd\u6570\u671f\u95f4\u521b\u5efa\u7684\uff0c\u6ca1\u6709\u865a\u51fd\u6570\u8868\u5c31\u6ca1\u6709\u529e\u6cd5\u8c03\u7528\u865a\u51fd\u6570 \u6790\u6784\u51fd\u6570 \u00b6 \u6790\u6784\u51fd\u6570\u7684\u4f5c\u7528 \u00b6 \u5982\u679c\u4e00\u4e2a\u7c7b\u4e2d\u6709\u6307\u9488\uff0c\u4e14\u8fd9\u4e2a\u6307\u9488\u6307\u5411\u4e86\u4e00\u6bb5\u7531\u6b64\u7c7b\u7684\u5b9e\u4f8b\u8bf7\u6c42\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u90a3\u4e48\u9700\u8981\u7531\u6790\u6784\u51fd\u6570\u6765\u5b9e\u73b0\u5bf9\u8fd9\u5757\u533a\u57df\u7684\u91ca\u653e\uff0c\u5426\u5219\u4f1a\u9020\u6210\u5185\u5b58\u6cc4\u6f0f C++\u4e3a\u4ec0\u4e48\u4e60\u60ef\u628a\u6790\u6784\u51fd\u6570\u5b9a\u4e49\u4e3a\u865a\u51fd\u6570 \u00b6 \u515a\u8fd9\u4e2a\u7c7b\u9700\u8981\u4f5c\u4e3a\u7236\u7c7b\u6d3e\u751f\u7684\u65f6\u5019\uff0c\u5982\u679c\u7a0b\u5e8f\u5f97\u5230\u7684\u662f\u6b64\u7236\u7c7b\u7684\u6307\u9488\uff0c\u90a3\u4e48\u6b64\u65f6\u5c31\u65e0\u6cd5\u6790\u6784\u5b50\u7c7b\uff0c\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f C++\u4e3a\u4ec0\u4e48\u9ed8\u8ba4\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570 \u00b6 \u865a\u51fd\u6570\u9700\u8981\u989d\u5916\u7684\u865a\u51fd\u6570\u8868\u548c\u865a\u51fd\u6570\u8868\u6307\u9488\uff0c\u5bf9\u4e8e\u4e0d\u4f1a\u6d3e\u751f\u7684\u7c7b\u800c\u8a00\uff0c\u6d6a\u8d39\u7a7a\u95f4 \u91cd\u8f7d\u548c\u91cd\u5199\uff08\u8986\u76d6\uff09 \u00b6 \u5bf9\u4e8e\u7c7b\u4e2d\u51fd\u6570\u7684\u91cd\u8f7d\u6216\u8005\u91cd\u5199\u800c\u8a00\uff0c\u91cd\u8f7d\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u7c7b\u7684\u5185\u90e8\uff0c\u91cd\u5199\u53d1\u751f\u5728\u4e0d\u540c\u7684\u7c7b\u4e4b\u95f4\uff0c\u5b50\u7c7b\u548c\u7236\u7c7b\u4e4b\u95f4 \u91cd\u8f7d\u7684\u51fd\u6570\u9700\u8981\u4e0e\u539f\u51fd\u6570\u6709\u76f8\u540c\u7684\u51fd\u6570\u540d\u3001\u4e0d\u540c\u7684\u53c2\u6570\u5217\u8868\uff0c\u4e0d\u5173\u6ce8\u51fd\u6570\u7684\u8fd4\u56de\u503c\u7c7b\u578b\uff1b\u91cd\u5199\u7684\u51fd\u6570\u7684\u51fd\u6570\u540d\u3001\u53c2\u6570\u5217\u8868\u548c\u8fd4\u56de\u503c\u7c7b\u578b\u90fd\u9700\u8981\u548c\u539f\u51fd\u6570\u76f8\u540c\uff0c\u7236\u7c7b\u4e2d\u88ab\u91cd\u5199\u7684\u51fd\u6570\u9700\u8981\u6709 virtual \u4fee\u9970 virtual \u5173\u952e\u5b57\uff1a\u91cd\u5199\u7684\u51fd\u6570\u57fa\u7c7b\u4e2d\u5fc5\u987b\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\uff0c\u91cd\u8f7d\u7684\u51fd\u6570\u53ef\u4ee5\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\u4e5f\u53ef\u4ee5\u6ca1\u6709 \u9501 \u00b6 C++\u4e2d\u9501\u7684\u7c7b\u578b \u00b6 \u4e92\u65a5\u9501\uff1a\u5bf9\u4e8e\u540c\u4e00\u4e2a\u53d8\u91cf\u53ea\u5141\u8bb8\u4e00\u4e2a\u7ebf\u7a0b\u8fdb\u884c\u8bfb\u5199\uff0c\u82e5\u4e0d\u6ee1\u8db3\u65f6\u5219\u4f1a\u8fdb\u5165\u963b\u585e\uff0c\u5e76\u4e14CPU\u4e0d\u4f1a\u8fdb\u5165\u5fd9\u7b49 \u6761\u4ef6\u9501\uff1a\u5f53\u6ee1\u8db3\u67d0\u4e2a\u6761\u4ef6\u65f6\uff0c\u518d\u5524\u9192\u6b64\u7ebf\u7a0b\uff0c\u5426\u5219\u4e00\u76f4\u963b\u585e\u72b6\u6001 \u81ea\u65cb\u9501\uff1a\u4e0d\u65ad\u7684\u68c0\u67e5\u9501\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\uff0c\u4e0d\u91ca\u653eCPU\uff0c\u6bd4\u8f83\u8017\u8d39CPU \u8bfb\u5199\u9501\uff1a\u5141\u8bb8\u6709\u8bfb\u9501\u7684\u65f6\u5019\u518d\u52a0\u8bfb\u9501\uff0c\u4f46\u662f\u6709\u5199\u9501\u65f6\u4e0d\u518d\u80fd\u52a0\u4efb\u4f55\u9501 \u9012\u5f52\u9501\uff1a\u5141\u8bb8\u540c\u4e00\u4e2a\u7ebf\u7a0b\u5bf9\u540c\u4e00\u4e2a\u9501\u8fdb\u884c\u591a\u6b21\u52a0\u9501 \u865a\u51fd\u6570 \u00b6 \u865a\u51fd\u6570 \u00b6 \u865a\u51fd\u6570\u7531 virtual \u6807\u8bb0 \u666e\u901a\u7684\u865a\u51fd\u6570\u4ecd\u7136\u9700\u8981\u8fdb\u884c\u5b9e\u73b0\uff0c\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u53ef\u4ee5\u91cd\u65b0\u5b9e\u73b0\u6b64\u51fd\u6570\u4e5f\u53ef\u4ee5\u4e0d\u5b9e\u73b0 \u7eaf\u865a\u51fd\u6570 \u00b6 \u7eaf\u865a\u51fd\u6570\u5728\u666e\u901a\u7684\u865a\u51fd\u6570\u540e\uff0c\u52a0\u4e0a =0 \u5f53\u4e00\u4e2a\u7c7b\u62e5\u6709\u7eaf\u865a\u51fd\u6570\u540e\uff0c\u5219\u6b64\u7c7b\u53d8\u6210\u62bd\u8c61\u7c7b\uff0c \u4e0d\u53ef\u4ee5\u8fdb\u884c\u5b9e\u4f8b\u5316 \u7eaf\u865a\u51fd\u6570\u4e0d\u9700\u8981\u5b9e\u73b0\uff0c\u4e14\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u51fd\u6570\uff0c\u5426\u5219\u6d3e\u751f\u7c7b\u4e5f\u662f\u62bd\u8c61\u7c7b\uff0c\u4e0d\u53ef\u4ee5\u5b9e\u4f8b\u5316 \u865a\u51fd\u6570\u7684\u5b9e\u73b0\u539f\u7406 \u00b6 \u5728\u7c7b\u4e2d\u4fdd\u5b58\u4e00\u5f20\u865a\u51fd\u6570\u8868\uff0c\u8868\u5185\u4fdd\u5b58\u4e86\u51fd\u6570\u6240\u5728\u7684\u4ee3\u7801\u6bb5 \u5f53\u5176\u4ed6\u7c7b\u7ee7\u627f\u6b64\u7c7b\u65f6\uff0c\u590d\u5236\u4e00\u4efd\u6b64\u865a\u51fd\u6570\u8868\u3002\u5f53\u5176\u4e2d\u7684\u865a\u51fd\u6570\u8fdb\u884c\u5b9e\u73b0\u540e\uff0c\u5c06\u865a\u51fd\u6570\u8868\u4e2d\u6b64\u51fd\u6570\u7684\u6307\u9488\u6240\u6307\u5411\u65b0\u7684\u51fd\u6570\u7684\u5730\u5740 \u5b9a\u4e49\u7c7b\u7684\u5b9e\u4f8b\u7684\u65f6\u5019\uff0c\u5728\u7c7b\u7684\u5f00\u5934\u4fdd\u5b58\u4e86\u4e00\u4e2a\u6307\u5411\u6b64\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\uff0c\u5f53\u9700\u8981\u8c03\u7528\u6b64\u51fd\u6570\u7684\u65f6\u5019\uff0c\u901a\u8fc7\u6b64\u6307\u9488\u627e\u5230\u5bf9\u5e94\u7684\u51fd\u6570\u5730\u5740 \u9759\u6001\u51fd\u6570\u548c\u865a\u51fd\u6570\u7684\u533a\u522b \u00b6 \u9759\u6001\u51fd\u6570\u5728\u7f16\u8bd1\u65f6\u5c31\u786e\u5b9a\u4e86\u8fd0\u884c\u7684\u65f6\u673a\uff0c\u800c\u865a\u51fd\u6570\u5219\u662f\u5728\u8fd0\u884c\u7684\u8fc7\u7a0b\u4e2d\u52a8\u6001\u7684\u5f97\u77e5\u865a\u51fd\u6570\u5730\u5740 strcpy\u548cmemcpy\u7684\u533a\u522b \u00b6 \u590d\u5236\u7684\u5185\u5bb9\u4e0d\u540c\u3002strcpy\u53ea\u80fd\u590d\u5236\u5b57\u7b26\u4e32\uff0c\u800cmemcpy\u53ef\u4ee5\u590d\u5236\u4efb\u610f\u5185\u5bb9\uff0c\u4f8b\u5982\u5b57\u7b26\u6570\u7ec4\u3001\u6574\u578b\u3001\u7ed3\u6784\u4f53\u3001\u7c7b\u7b49\u3002\u4f01\u4e1a\u4e2d\u4f7f\u7528memcpy\u5f88\u5e73\u5e38\uff0c\u56e0\u4e3a\u9700\u8981\u62f7\u8d1d\u5927\u91cf\u7684\u7ed3\u6784\u4f53\u53c2\u6570\u3002memcpy\u901a\u5e38\u4e0ememset\u51fd\u6570\u914d\u5408\u4f7f\u7528\u3002 \u590d\u5236\u7684\u65b9\u6cd5\u4e0d\u540c\u3002strcpy\u4e0d\u9700\u8981\u6307\u5b9a\u957f\u5ea6\uff0c\u4ed6\u9047\u5230\u88ab\u590d\u5236\u5b57\u7b26\u7684\u4e32\u7ed3\u675f\u7b26\"\\0\"\u624d\u7ed3\u675f\uff0c\u6240\u4ee5\u5bb9\u6613\u6ea2\u51fa\u3002memcpy\u5219\u662f\u6839\u636e\u5176\u7b2c\u4e09\u4e2a\u53c2\u6570\u51b3\u5b9a\u590d\u5236\u7684\u957f\u5ea6\u3002\u56e0\u6b64strcpy\u4f1a\u590d\u5236\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u7b26\"\\0\"\uff0c\u800cmemcpy\u5219\u4e0d\u4f1a\u590d\u5236\u3002 \u961f\u5217\u548c\u5806\u6808\u7684\u6a21\u62df \u00b6 \u7528\u4e24\u4e2a\u5806\u6808\u6a21\u62df\u961f\u5217 \u00b6 \u5c06\u4e24\u4e2a\u5806\u6808\u547d\u540d\u4e3aA\u3001B \u82e5B\u5806\u6808\u4e3a\u7a7a\uff0c\u5219\u5c06A\u5806\u6808\u7684\u6240\u6709\u503c\u90fd\u63a8\u5165B\u4e2d \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u63a8\u51fa\uff0c\u5219\u4eceB\u4e2d\u63a8\u51fa \u7528\u4e24\u4e2a\u961f\u5217\u6a21\u62df\u5806\u6808 \u00b6 \u5c06\u4e24\u4e2a\u961f\u5217\u547d\u540d\u4e3aA\u3001B \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u5f39\u51fa\uff0c\u5219\u5c06A\u4e2d\u7684\u503c\u9664\u4e86\u6700\u540e\u4e00\u4e2a\uff0c\u5176\u4ed6\u90fd\u63a8\u5165\u5230B\u4e2d\uff0c\u4e14\u4ec5\u7559\u4e0b\u4e00\u4e2a\u503c\uff0c\u7136\u540e\u5f39\u51fa\u8fd9\u4e2a\u503c\uff0c\u5e76\u5c06A\u3001B\u961f\u5217\u547d\u540d\u4e3aA\u3001B\u961f\u5217 \u53f3\u503c\u5f15\u7528 \u00b6 \u5982\u4f55\u786e\u5b9a\u4e00\u4e2a\u503c\u662f\u5de6\u503c\u8fd8\u662f\u53f3\u503c \u63d0\u4f9b\u4e86\u5730\u5740\u7684\u4e3a\u5de6\u503c\uff0c\u5de6\u503c\u53ef\u4ee5\u6ca1\u6709\u503c\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u5730\u5740 \u63d0\u4f9b\u4e86\u503c\u7684\u4e3a\u53f3\u503c\uff0c\u53f3\u503c\u53ef\u4ee5\u6ca1\u6709\u5730\u5740\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u503c \u53f3\u503c\u5f15\u7528\u7684\u529f\u80fd \u79fb\u52a8\u8bed\u53e5 \u5b8c\u7f8e\u8f6c\u53d1 STL \u00b6 vector \u00b6 \u6269\u5bb9\u89c4\u5219 \u00b6 \u5f53\u7a7a\u95f4\u4e0d\u8db3\u7684\u65f6\u5019\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09 \u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9 \u00b6 \u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002 MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904 \u00b6 \u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4 clear\u7684\u590d\u6742\u5ea6 \u00b6 \u590d\u6742\u5ea6\u4e0e\u5df2\u6709\u7684\u5143\u7d20\u6570\u91cf\u6210\u7ebf\u6027\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u5143\u7d20\u90fd\u9700\u8981\u6790\u6784 clear\u540e\uff0c\u5e76\u4e0d\u4f1a\u6539\u53d8vector\u7684\u5bb9\u91cf\u4e0a\u9650\uff0c\u53ea\u4f1a\u66f4\u65b0vector\u5185\u7684size\u5927\u5c0f unordered_map\u548cmap \u00b6 map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u7ea2\u9ed1\u6811 \uff08\u6240\u6709\u5143\u7d20\u90fd\u662f\u6709\u5e8f\u7684\uff09\uff0cunordered_map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u54c8\u5e0c\u8868 \uff08\u5143\u7d20\u7684\u6392\u5217\u662f\u65e0\u5e8f\u7684\uff09 map \u00b6 \u4f18\u70b9\uff1a \u6709\u5e8f \u6027\uff0c\u8fd9\u662fmap\u7ed3\u6784\u6700\u5927\u7684\u4f18\u70b9\uff0c\u5176\u5143\u7d20\u7684\u6709\u5e8f\u6027\u5728\u5f88\u591a\u5e94\u7528\u4e2d\u90fd\u4f1a\u7b80\u5316\u5f88\u591a\u7684\u64cd\u4f5c\uff1b\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7ea2\u9ed1\u6811\u4f7f\u5f97map\u7684\u5f88\u591a\u64cd\u4f5c\u5728 \\(logn\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e0b\u5c31\u53ef\u4ee5\u5b9e\u73b0\uff0c\u56e0\u6b64 \u6548\u7387 \u975e\u5e38\u9ad8 \u7f3a\u70b9\uff1a \u7a7a\u95f4\u5360\u7528\u7387\u9ad8 \uff0c\u56e0\u4e3amap\u5185\u90e8\u5b9e\u73b0\u4e86\u7ea2\u9ed1\u6811\uff0c\u867d\u7136\u63d0\u9ad8\u4e86\u8fd0\u884c\u6548\u7387\uff0c\u4f46\u662f\u56e0\u4e3a \u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u9700\u8981\u989d\u5916\u4fdd\u5b58\u7236\u8282\u70b9\u3001\u5b69\u5b50\u8282\u70b9\u548c\u7ea2/\u9ed1\u6027\u8d28 \uff0c\u4f7f\u5f97\u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u5360\u7528\u5927\u91cf\u7684\u7a7a\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e\u90a3\u4e9b\u6709\u987a\u5e8f\u8981\u6c42\u7684\u95ee\u9898\uff0c\u7528map\u4f1a\u66f4\u9ad8\u6548\u4e00\u4e9b unordered_map \u00b6 \u4f18\u70b9\uff1a\u56e0\u4e3a\u5185\u90e8\u5b9e\u73b0\u4e86\u54c8\u5e0c\u8868\uff0c\u56e0\u6b64\u5176 \u67e5\u627e\u901f\u5ea6 \u975e\u5e38\u5feb \u7f3a\u70b9\uff1a\u54c8\u5e0c\u8868\u7684 \u5efa\u7acb\u6bd4\u8f83\u8017\u8d39\u65f6\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e \u67e5\u627e\u95ee\u9898 \uff0cunordered_map\u4f1a\u66f4\u52a0\u9ad8\u6548\u4e00\u4e9b \u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4f18\u70b9\uff1f \u00b6 \u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001\u662f\u9762\u5411\u5bf9\u8c61\u7684\u4e09\u5927\u7279\u6027, \u8fd9\u4e9b\u7279\u6027\u4f7f\u5f97\u9762\u5411\u5bf9\u8c61\u53ef\u4ee5\u8bbe\u8ba1\u51fa\u4f4e\u8026\u5408\u7684\u7cfb\u7edf, \u4ece\u800c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027, \u4f7f\u7cfb\u7edf\u66f4\u6613\u7ef4\u62a4, \u529f\u80fd\u66f4\u6613\u590d\u7528\u3001\u62d3\u5c55, \u4f46\u662f\u5176\u6027\u80fd\u6bd4\u9762\u5411\u8fc7\u7a0b\u8981\u4f4e\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff0c\u5373OOP\uff0c\u662f\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u6ee1\u8db3\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u8bed\u8a00\uff0c\u4e00\u822c\u4f1a\u63d0\u4f9b\u7c7b\u3001\u5c01\u88c5\u3001\u7ee7\u627f\u7b49\u8bed\u6cd5\u548c\u6982\u5ff5\u6765\u8f85\u52a9\u6211\u4eec\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002 \u7c7b\u578b\u88ab\u8bbe\u8ba1\u4e3a\u5c06\u6570\u636e\u548c\u884c\u4e3a\u6346\u7ed1\u5728\u4e00\u8d77\u7684\u4e00\u79cd\u4e1c\u897f\uff0c\u6570\u636e\u548c\u884c\u4e3a\u88ab\u79f0\u4e4b\u4e3a\u7c7b\u578b\u7684\u6210\u5458\u3002\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u7c7b\u578b\u7684\u5b9e\u4f8b\uff0c\u4e0d\u540c\u7684\u5b9e\u4f8b\u5305\u542b\u4e0d\u540c\u7684\u6570\u636e\uff0c\u4ece\u800c\u5176\u8868\u73b0\u51fa\u6765\u7684\u884c\u4e3a\u4e5f\u4f1a\u4e0d\u540c\uff0c\u5c3d\u7ba1\u5176\u4ee3\u7801\u662f\u4e00\u6837\u7684\u3002 \u5c01\u88c5\u4f7f\u5f97\u7c7b\u7684\u6210\u5458\u5f97\u4ee5\u6709\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u4e00\u4e9b\u6210\u5458\u53ea\u5728\u7c7b\u578b\u7684\u5185\u90e8\u4f7f\u7528\uff0c\u88ab\u79f0\u4e4b\u4e3a\u79c1\u6709\u7684\uff08private\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u6d3e\u751f\u7c7b\u578b\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u53d7\u4fdd\u62a4\u7684\uff08protected\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u4efb\u4f55\u4e1c\u897f\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u516c\u5f00\u7684\uff08public\uff09\u3002\u800c\u67d0\u4e9b\u8bed\u8a00\u8fd8\u63d0\u4f9b\u4e86\u5185\u90e8\u7684\uff08internal\uff09\u8fd9\u6837\u7684\u8bbf\u95ee\u4fee\u9970\u7b26\u6765\u6807\u8bc6\u4e00\u4e9b\u53ea\u80fd\u88ab\u540c\u4e00\u4e2a\u7a0b\u5e8f\u96c6\u6216\u8005\u5305\u4f7f\u7528\u7684\u6210\u5458\u3002 \u7ee7\u627f\u53ef\u4ee5\u4ece\u4e00\u4e2a\u73b0\u6709\u7c7b\u578b\u6d3e\u751f\u51fa\u65b0\u7684\u7c7b\u578b\u6765\uff0c\u6d3e\u751f\u7c7b\u7ee7\u627f\u4e86\u57fa\u7c7b\u7684\u6240\u6709\u6210\u5458\uff0c\u4e5f\u53ef\u4ee5\u65b0\u589e\u53ea\u5c5e\u4e8e\u81ea\u5df1\u7684\u6210\u5458\u3002\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\uff0c\u6d3e\u751f\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u53ef\u4ee5\u88ab\u5f53\u505a\u57fa\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u6765\u4f7f\u7528\u3002 \u865a\u65b9\u6cd5\u4e3a\u6d3e\u751f\u7c7b\u4fee\u6539\u57fa\u7c7b\u7684\u884c\u4e3a\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9014\u5f84\uff0c\u901a\u8fc7\u91cd\u5199\uff08override\uff09\u865a\u65b9\u6cd5\u53ef\u4ee5\u4fee\u6539\u57fa\u7c7b\u67d0\u4e9b\u65b9\u6cd5\u7684\u884c\u4e3a\u3002\u5f53\u6d3e\u751f\u7c7b\u5b9e\u4f8b\u88ab\u5f53\u505a\u57fa\u7c7b\u5b9e\u4f8b\u6765\u4f7f\u7528\u65f6\uff0c\u8fd9\u4e00\u884c\u4e3a\u7684\u533a\u522b\u5c06\u4f1a\u88ab\u4f53\u73b0\u51fa\u6765\uff0c\u8fd9\u79cd\u5728\u8fd0\u884c\u65f6\u4e0d\u540c\u7c7b\u578b\u7684\u5b9e\u4f8b\u5728\u540c\u6837\u7684\u4ee3\u7801\u4e2d\u5448\u73b0\u51fa\u5b8c\u5168\u4e0d\u540c\u884c\u4e3a\u7684\u73b0\u8c61\u88ab\u79f0\u4e4b\u4e3a\u591a\u6001\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u6700\u521d\u662f\u4e3a\u4e86\u89e3\u51b3GUI\u7a0b\u5e8f\u8bbe\u8ba1\u95ee\u9898\u6240\u63d0\u51fa\u7684\uff0c\u540e\u6765\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u88ab\u53d1\u73b0\u4e5f\u6bd4\u8f83\u9002\u5408\u7528\u4e8e\u8bb8\u591a\u7279\u5b9a\u9886\u57df\u7684\u5f00\u53d1\u3002\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u662f\u76ee\u524d\u8fd0\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u4ece\u800c\u4e5f\u4ea7\u751f\u4e86\u975e\u5e38\u591a\u7684\u89e3\u51b3\u4ee3\u7801\u590d\u7528\u7684\u6280\u5de7\uff0c\u5176\u4e2d\u76f8\u5f53\u4e00\u90e8\u5206\u6280\u5de7\u5728\u7a0b\u5e8f\u4e2d\u53cd\u590d\u51fa\u73b0\u800c\u88ab\u63d0\u70bc\u4e3a\u8bbe\u8ba1\u6a21\u5f0f\u3002 static\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f \u00b6 \u9690\u85cf\u3002\u5f53\u6211\u4eec\u540c\u65f6\u7f16\u8bd1\u591a\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u6240\u6709\u672a\u52a0static\u7684\u5168\u5c40\u53d8\u91cf\u548c\u51fd\u6570\u90fd\u5177\u6709\u5168\u5c40\u53ef\u89c1\u6027\u3002\u6240\u4ee5\u4f7f\u7528static\u5728\u4e0d\u540c\u7684\u6587\u4ef6\u4e2d\u5b9a\u4e49\u540c\u540d\u53d8\u91cf\u548c\u51fd\u6570\uff0c\u4e0d\u9700\u8981\u62c5\u5fc3\u547d\u540d\u51b2\u7a81\u3002 \u4fdd\u6301\u53d8\u91cf\u5185\u5bb9\u7684\u6301\u4e45\u3002\u5b58\u50a8\u5728\u9759\u6001\u6570\u636e\u533a\u7684\u53d8\u91cf\u4f1a\u5728\u7a0b\u5e8f\u521a\u5f00\u59cb\u8fd0\u884c\u65f6\u5c31\u5b8c\u6210\u521d\u59cb\u5316\uff0c\u4e5f\u662f\u552f\u4e00\u7684\u4e00\u6b21\u521d\u59cb\u5316\uff0c\u5171\u6709\u4e24\u79cd\u53d8\u91cf\u5b58\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5168\u5c40\u53d8\u91cf\u548cstatic\u3002 \u9ed8\u8ba4\u521d\u59cb\u5316\u4e3a0\u3002\u5168\u5c40\u53d8\u91cf\u4e5f\u5177\u6709\u8fd9\u4e2a\u5c5e\u6027\uff0c\u56e0\u4e3a\u5168\u5c40\u53d8\u91cf\u4e5f\u5b58\u50a8\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5728\u9759\u6001\u5b58\u50a8\u533a\u5185\uff0c\u6240\u6709\u5b57\u8282\u7684\u9ed8\u8ba4\u503c\u65f60x00\uff0c\u8fd9\u4e00\u7279\u70b9\u53ef\u4ee5\u51cf\u5c11\u5de5\u4f5c\u91cf\u3002 const\u6709\u4ec0\u4e48\u7528\uff1f \u00b6 \u4e0d\u8981\u4e00\u542c\u5230const\u5c31\u8bf4\u662f\u5e38\u91cf\uff0c\u5e94\u8be5\u8bf4const\u4fee\u9970\u7684\u5185\u5bb9\u4e0d\u53ef\u6539\u53d8\u3002\u5b9a\u4e49\u5e38\u91cf\u53ea\u662f\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u8fd8\u6709const\u6570\u636e\u6210\u5458\uff0c\u53c2\u6570\uff0c\u8fd4\u56de\u503c\uff0c\u6210\u5458\u51fd\u6570\u7b49\uff0c\u88abconst\u4fee\u9970\u7684\u4e1c\u897f\u90fd\u53d7\u5230\u4e86\u5f3a\u5236\u4fdd\u62a4\uff0c\u53ef\u4ee5\u9884\u9632\u610f\u5916\u53d8\u52a8\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u5065\u58ee\u6027\u3002 C\u548cC++\u5404\u81ea\u662f\u5982\u4f55\u5b9a\u4e49\u5e38\u91cf\u7684\uff1f\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f \u00b6 C\u662f\u4f7f\u7528\u5b8f#define\u5b9a\u4e49\uff0cC++\u4f7f\u7528\u66f4\u597d\u7684const\u5b9a\u4e49\u3002 const\u662f\u6709\u6570\u636e\u7c7b\u578b\u7684\uff0c\u800cdefine\u6ca1\u6709\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9\u524d\u8005\u8fdb\u884c\u9759\u6001\u7c7b\u578b\u5b89\u5168\u68c0\u67e5\uff0c\u5bf9\u540e\u8005\u4ec5\u4ec5\u662f\u5b57\u7b26\u66ff\u6362\uff0c\u6ca1\u6709\u68c0\u67e5\uff0c\u4f1a\u4ea7\u751f\u9519\u8bef\uff08\u8fb9\u9645\u6548\u5e94\uff09\u3002 \u6709\u4e9b\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9const\u8fdb\u884c\u8c03\u8bd5\uff0c\u800cdefine\u4e0d\u884c\u3002 \u65e2\u7136C++\u6709\u66f4\u597d\u7684const\u4e3a\u5565\u8fd8\u8981define\uff1f \u00b6 const\u65e0\u6cd5\u66ff\u4ee3\u5b8f\u4f5c\u4e3a\u536b\u54e8\u6765\u9632\u6b62\u6587\u4ef6\u7684\u91cd\u590d\u5305\u542b\u3002 #include \u548c# include\"a.h\"\u6709\u4ec0\u4e48\u533a\u522b\uff1f \u00b6 \u524d\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u6807\u51c6\u5e93\u8def\u5f84\u5f00\u59cb\u641c\u7d22\uff0c\u540e\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u7528\u6237\u7684\u5de5\u4f5c\u8def\u5f84\u5f00\u59cb\u641c\u7d22\u3002 C++\u4ec0\u4e48\u662f\u591a\u6001\u6027\uff1f\u5982\u4f55\u4f53\u73b0\u7684\uff1f \u00b6 \u591a\u6001\u6027\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7ee7\u5c01\u88c5\u548c\u7ee7\u627f\u4e4b\u540e\u7684\u7b2c\u4e09\u4e2a\u57fa\u672c\u7279\u5f81\u3002 \u4ed6\u5728\u8fd0\u884c\u65f6\u51fa\u73b0\u7684\u591a\u6001\u6027\u901a\u8fc7\u6d3e\u751f\u7c7b\u548c\u865a\u51fd\u6570\u5b9e\u73b0\uff0c\u57fa\u7c7b\u548c\u6d3e\u751f\u7c7b\u4e2d\u4f7f\u7528\u540c\u6837\u7684\u51fd\u6570\u540d\uff0c\u5b8c\u6210\u4e0d\u540c\u7684\u64cd\u4f5c\u5177\u4f53\u5b9e\u73b0\u3002 \u591a\u6001\u6027\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u7ec4\u7ec7\u6027\u548c\u53ef\u8bfb\u6027\uff0c\u865a\u51fd\u6570\u5219\u6839\u636e\u7c7b\u578b\u7684\u4e0d\u540c\u6765\u8fdb\u884c\u4e0d\u540c\u7684\u9694\u79bb\u3002 \u4ec0\u4e48\u662f\u52a8\u6001\u7279\u6027\uff1f \u00b6 \u5728\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u786e\u5b9a\u4e0b\u6765\uff0c\u6211\u4eec\u79f0\u4e4b\u4e3a\u9759\u6001\u7279\u6027\u3002\u53cd\u4e4b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u8fd0\u884c\u7684\u65f6\u5019\u786e\u5b9a\uff0c\u79f0\u4e4b\u4e3a\u52a8\u6001\u7279\u6027\u3002C++\u4e2d\uff0c\u865a\u51fd\u6570\uff0c\u62bd\u8c61\u57fa\u7c7b\uff0c\u52a8\u6001\u7ed1\u5b9a\u548c\u591a\u6001\u6784\u6210\u4e86\u51fa\u8272\u7684\u52a8\u6001\u7279\u6027\u3002 \u4ec0\u4e48\u662f\u5c01\u88c5\uff1fC++\u4e2d\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f \u00b6 \u5c01\u88c5\u6765\u6e90\u4e8e\u4fe1\u606f\u9690\u85cf\u7684\u8bbe\u8ba1\u7406\u5ff5\uff0c\u662f\u901a\u8fc7\u7279\u6027\u548c\u884c\u4e3a\u7684\u7ec4\u5408\u6765\u521b\u5efa\u65b0\u6570\u636e\u7c7b\u578b\u8ba9\u63a5\u53e3\u548c\u67d0\u4e2a\u5b9e\u73b0\u76f8\u9694\u79bb\u3002 C++\u662f\u901a\u8fc7\u7c7b\u6765\u5b9e\u73b0\u7684\uff0c\u5c01\u88c5\u4e3a\u4e86\u4f7f\u7c7b\u4e2d\u6210\u5458\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u6709\u4e09\u4e2a\u5173\u952e\u5b57(balabalabala) \u4ec0\u4e48\u662fRTTI\uff1f \u00b6 RTT\u662f\u6307\u8fd0\u884c\u65f6\u7c7b\u578b\u8bc6\u522b\uff08Run-time type identification\uff09\u5728\u53ea\u6709\u4e00\u4e2a\u6307\u5411\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u65f6\u786e\u5b9a\u4e00\u4e2a\u5bf9\u8c61\u7684\u51c6\u786e\u7c7b\u578b\u3002 \u4ec0\u4e48\u662f\u6df1\u6d45\u62f7\u8d1d\uff1f \u00b6 \u6df1\u6d45\u62f7\u8d1d\u5173\u952e\u5728\u4e8e\u6709\u6ca1\u6709\u62f7\u8d1d\u5206\u914d\u7ed9\u6210\u5458\u7684\u8d44\u6e90\uff0c\u4f8b\u5982\u7ed9\u6307\u9488\u53d8\u91cf\u5206\u914d\u5185\u5b58\u3002\u6d45\u62f7\u8d1d\u53ea\u662f\u7ed9\u6210\u5458\u7b80\u5355\u8d4b\u503c\uff0c\u800c\u6df1\u62f7\u8d1d\u4e0d\u4ec5\u8d4b\u503c\uff0c\u8fd8\u5206\u914d\u8d44\u6e90\u3002 \u7c7b\u4e2d\u9ed8\u8ba4\u7684\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u548c\u8d4b\u503c\u6784\u9020\u51fd\u6570\u90fd\u662f\u6d45\u62f7\u8d1d\uff0c\u5f53\u7c7b\u7684\u6210\u5458\u53d8\u91cf\u4e2d\u51fa\u73b0\u6307\u9488\u53d8\u91cf\u65f6\uff0c\u6700\u597d\u4f7f\u7528\u6df1\u62f7\u8d1d\uff0c\u907f\u514d\u5185\u5b58\u7a7a\u95f4\u591a\u6b21\u91ca\u653e\u7684\u95ee\u9898\u51fa\u73b0\u3002 \u865a\u51fd\u6570\u8868\u6307\u9488\u4e3a\u4ec0\u4e48\u653e\u5728\u5f00\u5934\uff1f \u00b6 \u4f4d\u7f6e\uff1a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u865a\u51fd\u6570\u8868\u6240\u5728\u4f4d\u7f6e\u7684\u5730\u5740\u3002\u865a\u51fd\u6570\u8868\u6307\u9488\u5c5e\u4e8e\u5bf9\u8c61\u5b9e\u4f8b\u3002\u56e0\u800c\u901a\u8fc7new \u51fa\u6765\u7684\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u5806\uff0c\u58f0\u540d\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u6808\u3002 \u865a\u51fd\u6570\u8868\u7684\u5b58\u5728\u662f\u7f16\u8bd1\u5668\u4f9d\u8d56\u7684(\u4f46\u6240\u6709\u7f16\u8bd1\u5668\u90fd\u662f\u5982\u6b64)\uff0cvptr\u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u5f00\u5934.\u539f\u56e0\u662f\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u4f4d\u7f6e.\u8003\u8651\u4e00\u4e2a\u7c7b\u5c42\u6b21\u7ed3\u6784: struct base { T data ; virtual void f (); }; struct derived : base { T1 data ; virtual void g (); }; \u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u90a3\u4e48\u5bf9\u4e8e\u5b8c\u6574\u7c7b\u578b base \u7684\u5bf9\u8c61\uff0c\u5b83\u5c06\u4f4d\u4e8e sizeof(T) \u5b57\u8282\u4e4b\u540e.\u73b0\u5728\uff0c\u5f53\u4f60\u6709\u4e00\u4e2a\u5b8c\u6574\u7c7b\u578b\u7684\u5bf9\u8c61 derived \u65f6\uff0cbase \u5b50\u5bf9\u8c61\u7684\u5e03\u5c40\u5fc5\u987b\u4e0e\u5b8c\u6574 base \u5bf9\u8c61\u7684\u5e03\u5c40\u517c\u5bb9\uff0c\u56e0\u6b64 vptr \u4ecd\u7136\u5fc5\u987b\u662f sizeof(T) \u5b57\u8282\u5728\u5bf9\u8c61\u5185\u90e8\uff0c\u5b83\u5c06\u4f4d\u4e8e derived \u5bf9\u8c61\u4e2d\u95f4\u7684\u67d0\u4e2a\u4f4d\u7f6e(sizeof(T) \u4ece\u5f00\u59cb\uff0csizeof(T1) \u5728\u7ed3\u675f\u4e4b\u524d).\u6240\u4ee5\u5b83\u5c06\u4e0d\u518d\u4f4d\u4e8e\u5bf9\u8c61\u7684 end \u5904. \u6b64\u5916\uff0c\u7ed9\u5b9a\u4e00\u4e2a this \u6307\u9488\uff0c\u865a\u62df\u8c03\u7528\u9700\u8981\u901a\u8fc7 vtable \u8fdb\u884c\u95f4\u63a5\u8c03\u7528\uff0c\u8fd9\u57fa\u672c\u4e0a\u662f\u53d6\u6d88\u5bf9 vptr \u7684\u5f15\u7528\uff0c\u6dfb\u52a0\u4e00\u4e2a\u504f\u79fb\u91cf\u5e76\u8df3\u8f6c\u5230\u5b58\u50a8\u5728\u90a3\u91cc\u7684\u5185\u5b58\u4f4d\u7f6e.\u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u5219\u5bf9\u4e8e\u6bcf\u4e2a\u865a\u62df\u8c03\u7528\uff0c\u5728\u53d6\u6d88\u5f15\u7528 vptr \u4e4b\u524d\u90fd\u4f1a\u5bf9 this \u8fdb\u884c\u989d\u5916\u7684\u6dfb\u52a0. STL\u6e90\u7801\u4e2dhash\u7684\u8868\u73b0 \u00b6 hashtable \u662f\u91c7\u7528\u5f00\u94fe\u6cd5\u6765\u5b8c\u6210\u7684\uff0c\uff08vector + list\uff09 \u5e95\u5c42\u952e\u503c\u5e8f\u5217\u91c7\u7528 vector \u5b9e\u73b0\uff0cvector \u7684\u5927\u5c0f\u53d6\u7684\u662f\u8d28\u6570\uff0c\u4e14\u76f8\u90bb\u8d28\u6570\u7684\u5927\u5c0f\u7ea6\u4e3a 2 \u500d\u5173\u7cfb\uff0c\u5f53\u521b\u5efa hashtable \u65f6\uff0c\u4f1a\u81ea\u52a8\u9009\u53d6\u4e00\u4e2a\u63a5\u8fd1\u6240\u521b\u5efa\u5927\u5c0f\u7684\u8d28\u6570\u4f5c\u4e3a\u5f53\u524d hashtable \u7684\u5927\u5c0f\uff1b \u5bf9\u5e94\u952e\u7684\u503c\u5e8f\u5217\u91c7\u7528\u5355\u5411 list \u5b9e\u73b0\uff1b \u5f53 hashtable \u7684\u952e vector \u7684\u5927\u5c0f\u91cd\u65b0\u5206\u914d\u7684\u65f6\u5019\uff0c\u539f\u952e\u7684\u503c list \u4e5f\u4f1a\u91cd\u65b0\u5206\u914d\uff0c\u56e0\u4e3a vector \u91cd\u5efa\u4e86\u76f8\u5f53\u4e8e\u952e\u589e\u52a0\u4e86\uff0c\u90a3\u4e48\u539f\u6765\u7684\u503c\u5bf9\u5e94\u7684\u952e\u53ef\u80fd\u5c31\u4e0d\u540c\u4e8e\u539f\u6765\u5206\u914d\u7684\u952e\uff0c\u8fd9\u6837\u5c31\u9700\u8981\u91cd\u65b0\u786e\u5b9a\u503c\u7684\u952e\u3002 \u91cd\u8f7d\u5982\u4f55\u5b9e\u73b0 \u00b6 C++\u51fd\u6570\u91cd\u8f7d\u5e95\u5c42\u5b9e\u73b0\u539f\u7406\u662fC++\u5229\u7528\u503e\u8f67\u6280\u672f\uff0c\u6765\u6539\u540d\u51fd\u6570\u540d\uff0c\u533a\u5206\u53c2\u6570\u4e0d\u540c\u7684\u540c\u540d\u51fd\u6570\u3002 C++\u4e2d\uff0c\u8fd9\u4e09\u4e2a\u51fd\u6570\u5982\u679c\u5728\u4e3b\u51fd\u6570\u4e2d\u88ab\u8c03\u7528\u9009\u62e9\u54ea\u4e00\u4e2a\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u8eab\u51b3\u5b9a\u3002 \u6e90\u6587\u4ef6\u901a\u8fc7\u7f16\u8bd1\u540e\uff0c\u5c06\u76f8\u540c\u51fd\u6570\u540d\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u683c\u5f0f\uff0c\u6539\u53d8\u6210\u53ef\u4ee5\u533a\u5206\u7684\uff0c\u53bb\u9664\u4e86\u51fd\u6570\u5728\u8c03\u7528\u65f6\u7684\u4e8c\u4e49\u6027\uff0c\u4ece\u800c\u5b9e\u73b0\u51fd\u6570\u7684\u91cd\u8f7d\u3002 \u7ed3\u5408extern \"C\". \u52a8\u6001\u7ed1\u5b9a\u548c\u9759\u6001\u7ed1\u5b9a\u533a\u522b \u00b6 C++\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\uff0c\u5b58\u5728\u7740\u9759\u6001\u7ed1\u5b9a\u548c\u52a8\u6001\u7ed1\u5b9a\u7684\u5b9a\u4e49\uff0c\u672c\u8282\u5373\u662f\u4e3b\u8981\u8bb2\u8ff0\u8fd9\u4e24\u70b9\u533a\u5206\u3002 \u6211\u662f\u5728\u4e00\u4e2a\u7c7b\u7684\u7ee7\u627f\u4f53\u7cfb\u4e2d\u5206\u6790\u7684\uff0c\u56e0\u6b64\u4e0b\u9762\u6240\u8bf4\u7684\u5bf9\u8c61\u4e00\u822c\u5c31\u662f\u6307\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b\u3002 \u9996\u5148\u6211\u4eec\u9700\u8981\u660e\u786e\u51e0\u4e2a\u540d\u8bcd\u5b9a\u4e49\uff1a \u9759\u6001\u7c7b\u578b\uff1a\u5bf9\u8c61\u5728\u58f0\u660e\u65f6\u91c7\u7528\u7684\u7c7b\u578b\uff0c\u5728\u7f16\u8bd1\u671f\u65e2\u5df2\u786e\u5b9a\uff1b \u52a8\u6001\u7c7b\u578b\uff1a\u901a\u5e38\u662f\u6307\u4e00\u4e2a\u6307\u9488\u6216\u5f15\u7528\u76ee\u524d\u6240\u6307\u5bf9\u8c61\u7684\u7c7b\u578b\uff0c\u662f\u5728\u8fd0\u884c\u671f\u51b3\u5b9a\u7684\uff1b \u9759\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u9759\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u9759\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff1b \u52a8\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u52a8\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u9759\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff0c\u52a8\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\u53ef\u4ee5\u66f4\u6539\uff0c\u4f46\u662f\u9759\u6001\u7c7b\u578b\u65e0\u6cd5\u66f4\u6539\uff1b \u8981\u60f3\u5b9e\u73b0\u52a8\u6001\uff0c\u5fc5\u987b\u4f7f\u7528\u52a8\u6001\u7ed1\u5b9a\uff1b \u5728\u7ee7\u627f\u4f53\u7cfb\u4e2d\u53ea\u6709\u865a\u51fd\u6570\u4f7f\u7528\u7684\u662f\u52a8\u6001\u7ed1\u5b9a\uff0c\u5176\u4ed6\u7684\u5168\u90e8\u662f\u9759\u6001\u7ed1\u5b9a\uff1b \u6ce8\u610f\uff1a\u7edd\u5bf9\u4e0d\u8981\u91cd\u65b0\u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627f\u800c\u6765\u7684virtual\u51fd\u6570\u7684\u7f3a\u7701\u53c2\u6570\u503c\uff0c\u56e0\u4e3a\u7f3a\u7701\u53c2\u6570\u503c\u90fd\u662f\u9759\u6001\u7ed1\u5b9a\uff08\u4e3a\u4e86\u6267\u884c\u6548\u7387\uff09\uff0c\u800cvirtual\u51fd\u6570\u5374\u662f\u52a8\u6001\u7ed1\u5b9a\u3002 C++\u7684\u51e0\u79cd\u6784\u9020\u51fd\u6570 \u00b6 C++\u4e2d\u7684\u6784\u9020\u51fd\u6570\u53ef\u4ee5\u5206\u4e3a4\u7c7b\uff1a \uff081\uff09\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u3002\u4ee5Student\u7c7b\u4e3a\u4f8b\uff0c\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u7684\u539f\u578b\u4e3a Student(\uff09\uff1b//\u6ca1\u6709\u53c2\u6570 \uff082\uff09\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570 Student(int num\uff0cint age\uff09\uff1b//\u6709\u53c2\u6570 \uff083\uff09\u590d\u5236\uff08\u62f7\u8d1d\uff09\u6784\u9020\u51fd\u6570 Student(Student&\uff09\uff1b//\u5f62\u53c2\u662f\u672c\u7c7b\u5bf9\u8c61\u7684\u5f15\u7528 \uff084\uff09\u8f6c\u6362\u6784\u9020\u51fd\u6570 Student(int r) \uff1b//\u5f62\u53c2\u662f\u5176\u4ed6\u7c7b\u578b\u53d8\u91cf\uff0c\u4e14\u53ea\u6709\u4e00\u4e2a\u5f62\u53c2 \u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u548c\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570\u5728\u5b9a\u4e49\u7c7b\u7684\u5bf9\u8c61\u7684\u65f6\u5019\uff0c\u5b8c\u6210\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u5de5\u4f5c\u3002 \u590d\u5236\u6784\u9020\u51fd\u6570\u7528\u4e8e\u590d\u5236\u672c\u7c7b\u7684\u5bf9\u8c61\u3002 \u8f6c\u6362\u6784\u9020\u51fd\u6570\u7528\u4e8e\u5c06\u5176\u4ed6\u7c7b\u578b\u7684\u53d8\u91cf\uff0c\u9690\u5f0f\u8f6c\u6362\u4e3a\u672c\u7c7b\u5bf9\u8c61\u3002 \u4ec0\u4e48\u65f6\u5019\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570 \u00b6 \u5f53\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u4e24\u4e2a\u5173\u952e\u70b9\uff0c\u5206\u522b\u662f \u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f \u548c \u521d\u59cb\u5316\u5bf9\u8c61 \u521d\u59cb\u5316\u5bf9\u8c61 \u00b6 \u521d\u59cb\u5316\u5bf9\u8c61\u662f\u6307\uff0c\u4e3a\u5bf9\u8c61\u5206\u914d\u5185\u5b58\u540e\u7b2c\u4e00\u6b21\u5411\u5185\u5b58\u4e2d\u586b\u5145\u6570\u636e\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u5bf9\u8c61\u88ab\u521b\u5efa\u540e\u5fc5\u987b\u7acb\u5373\u521d\u59cb\u5316\u3002\u4e5f\u5c31\u662f\u8bf4\u53ea\u8981\u521b\u5efa\u5bf9\u8c61\u5c31\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\u3002 \u521d\u59cb\u5316\u548c\u8d4b\u503c\u7684\u533a\u522b \u00b6 \u521d\u59cb\u5316\u548c\u8d4b\u503c\u90fd\u662f\u5c06\u6570\u636e\u5199\u5165\u5185\u5b58\u4e2d\uff0c\u4ece\u8868\u9762\u770b\uff0c\u521d\u59cb\u5316\u5728\u5f88\u591a\u65f6\u5019\u90fd\u662f\u4ee5\u590d\u5236\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u7684\uff0c\u5f88\u5bb9\u6613\u5f15\u8d77\u6df7\u6dc6\u3002\u5728\u5b9a\u4e49\u7684\u540c\u65f6\u8fdb\u884c\u590d\u5236\u53eb\u505a\u521d\u59cb\u5316\uff0c\u5b9a\u4e49\u5b8c\u6210\u4ee5\u540e\u518d\u8d4b\u503c(\u4e0d\u7ba1\u5b9a\u4e49\u7684\u65f6\u5019\u6709\u6ca1\u6709\u8d4b\u503c)\u5c31\u53eb\u505a\u8d4b\u503c\u3002\u521d\u59cb\u5316\u53ea\u80fd\u7531\u4e00\u6b21\uff0c\u8d4b\u503c\u53ef\u4ee5\u7531\u5f88\u591a\u6b21\u3002 \u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u4e0d\u540c\u7684\u521d\u59cb\u5316\u65b9\u5f0f\u4f1a\u8c03\u7528\u4e0d\u540c\u7684\u6784\u9020\u51fd\u6570\uff1a \u00b6 \u5982\u679c\u7528\u4f20\u9012\u8fdb\u6765\u7684\u5b9e\u53c2\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u90a3\u4e48\u4f1a\u8c03\u7528\u666e\u901a\u7684\u6784\u9020\u51fd\u6570\u3002 \u5982\u679c\u7528\u73b0\u6709\u5bf9\u8c61\u7684\u6570\u636e\u6765\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u5c31\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u5c31\u662f\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u3002 \u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u6765\u521d\u59cb\u5316\u5bf9\u8c61\u7684\u51e0\u79cd\u60c5\u51b5\uff1a \u00b6 \u5c06\u5176\u5b83\u5bf9\u8c61\u4f5c\u4e3a\u5b9e\u53c2\u3002 \u5728\u521b\u5efa\u5bf9\u8c61\u7684\u540c\u65f6\u8d4b\u503c\u3002 \u51fd\u6570\u7684\u5f62\u53c2\u4e3a\u7c7b\u7c7b\u578b\u3002 \u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u7c7b\u7c7b\u578b(\u4e0e\u7f16\u8bd1\u5668\u6709\u5173\u4e0d\u7edd\u5bf9) C++\u7684\u5bb9\u5668\u6bd4\u8f83\uff0c\u4e3a\u4ec0\u4e48vector\u53ef\u4ee5\u968f\u673a\u8bbf\u95ee \u00b6 stl\u5bb9\u5668\u5305\u542b\u987a\u5e8f\u5bb9\u5668\u548c\u5173\u8054\u5bb9\u5668\u3002\u987a\u5e8f\u5bb9\u5668\u4e3b\u8981\u6709vector\uff0clist\uff0cdeque\uff0c\u5173\u8054\u5bb9\u5668\u4e3b\u8981\u662fpair\u3001set\u3001map\u3001multiset\u548cmultimap\uff0c\u6240\u4ee5\u603b\u5171\u7b97\u662f7\u79cd\u3002 \u6240\u8c13\u968f\u673a\u8bbf\u95ee\uff0c\u6211\u7684\u7406\u89e3\u662f\u6309\u7167\u6570\u7ec4\u7684\u65b9\u5f0f\u5728\u5185\u5b58\u4e2d\u987a\u5e8f\u5b58\u653e\uff0c\u53ea\u9700\u8981\u6839\u636e\u9996\u5730\u5740\u548c\u76f8\u5e94\u4e0b\u6807\u5c31\u80fd\u5bfb\u5740\u5230\u76f8\u5e94\u7684\u5143\u7d20\u3002 \u6240\u4ee5\u9010\u4e2a\u5206\u6790\u5982\u4e0b\uff1a vector\u7684\u5b9e\u73b0\u539f\u7406\u662f\u6570\u7ec4\uff0c\u6240\u4ee5\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 list\u7684\u5b9e\u73b0\u539f\u7406\u662f\u53cc\u5411\u94fe\u8868\uff0c\u6240\u4ee5\u4e0d\u652f\u6301\u3002 deque\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7c7b\u4f3c\u6570\u7ec4\u7684\u53cc\u7aef\u961f\u5217\uff0c\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 pair\u662f\u4e2a\u4e8c\u5143\u7ec4\uff0c\u4e00\u5171\u5c31\u4e24\u4e2a\u503c\uff0c\u8c08\u4e0d\u4e0a\u968f\u673a\u8bbf\u95ee\u3002 set\u3001multiset\u3001map\u3001multimap\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7ea2\u9ed1\u6811\uff0c\u4e0d\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 \u6240\u4ee5\u5728\u4e0a\u8ff0\u4e03\u79cd\u5bb9\u5668\u4e2d\u53ea\u6709vector\u548cdeque\u4e24\u79cd\u662f\u652f\u6301\u968f\u673a\u8bbf\u95ee\u7684\u3002 vector\u5e95\u5c42\u6570\u7ec4\u5927\u5c0f\u5206\u914d \u00b6 vector\u7684\u5927\u5c0f\u6709\u4e24\u4e2a\u53d8\u91cf\uff0c\u4e00\u4e2asize\uff0c\u4e00\u4e2acapacity\uff0csize\u662fvector\u5b9e\u9645\u5bb9\u91cf\uff0ccapacity\u662fvector\u6700\u5927\u5bb9\u91cf\uff0c\u5f53size=capacity\u65f6\uff0cvector\u9700\u8981\u8003\u8651\u6269\u5bb9\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09 \u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9 \u00b6 \u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002 MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904 \u00b6 \u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4 C++\u3001go\u3001python\u7684\u533a\u522b \u00b6 \u5305\u7ba1\u7406 \u00b6 C++\u8fd9\u79cd\u4e0e\u5e73\u53f0\u548c\u7f16\u8bd1\u5668\u76f8\u5173\uff0c\u5f88\u96be\u6709\u8bed\u8a00\u7ea7\u522b\u7684\u5305\u7ba1\u7406\u5668\uff0c \u4e00\u822c\u662f\u5404\u4e2a\u5f00\u53d1\u73af\u5883\u6301\u6709\u5404\u81ea\u7684\u590d\u7528\u7ba1\u7406\uff0c\u6bd4\u5982 linux \u7684 apt-get, deb, yum\uff0c\u5404\u79cdlib header dev\u5305\u53ef\u4ee5\u901a\u8fc7\u5176\u5b89\u88c5\u7684\u3002\u4e00\u822c\u90fd\u9700\u8981CMake\u6216\u8005Makefile\u8fdb\u884c\u5de5\u7a0b\u7ba1\u7406\uff0c\u6240\u4ee5\u6709\u76f8\u5e94\u7684\u5b66\u4e60\u6210\u672c\u3002 Python\u6709\u4e30\u5bcc\u7684\u5305\u7ba1\u7406\u5668\uff0c\u6bd4\u5982\uff0cdistutils\uff0csetuptools, \u8fd8\u6709\u8f83\u4e3a\u6d41\u884c\u7684pip\uff0c pip \u53ef\u4ee5\u5229\u7528 requirments.txt \u6765\u5b89\u88c5\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\u3002 GO\u65e9\u671f\u7684\u5305\u7ba1\u7406\u4e5f\u662f\u4e3a\u4eba\u8bdf\u75c5\uff0c\u4e0d\u8fc71.11 \u7248\u672c\u63a8\u51fa modules \u673a\u5236\uff0c\u8ba9go\u8bed\u8a00\u5305\u7ba1\u7406\u53d8\u5f97\u66f4\u65b9\u4fbf\u7b80\u5355\uff0c\u8fd8\u652f\u6301GoProxy\uff0creplace\uff0cSubCommand\u7b49\u9ad8\u7ea7\u7279\u6027\u3002 \u8bed\u6cd5 \u00b6 \u5728\u8bed\u6cd5\u65b9\u9762\uff0cC++\u548cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u8f83\u4e3a\u76f8\u4f3c\uff0c\u4f46\u662fGO\u8bed\u8a00\u8bed\u6cd5\u7b80\u6d01\uff0c\u4e0d\u9700\u8981\u7a0b\u5e8f\u5458\u7ba1\u7406\u5185\u5b58\uff0c\u6709\u4e30\u5bcc\u7684API\u53ef\u8c03\u7528\uff0c\u4e5f\u63d0\u4f9b\u4e86\u5207\u7247\uff0cmap\u7b49\u7075\u6d3b\u7684\u6570\u636e\u7c7b\u578b\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\u5728\u8bed\u6cd5\u65b9\u9762\u4ee5\u4f18\u96c5\u8457\u79f0\uff0c\u66f4\u4e3a\u7b80\u5355\u3002Python \u793e\u533a\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e0e\u6807\u51c6\u5e93\u7c7b\u4f3c\u3002\u5b83\u4eec\u7684\u529f\u80fd\u8986\u76d6 \u79d1\u5b66\u8ba1\u7b97\u3001\u4eba\u5de5\u667a\u80fd\u3001\u673a\u5668\u5b66\u4e60\u3001Web \u5f00\u53d1\u3001\u6570\u636e\u5e93\u63a5\u53e3\u591a\u4e2a\u9886\u57df\u3002 \u6027\u80fd \u00b6 \u5728\u6027\u80fd\u65b9\u9762\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\uff0c\u5728\u6027\u80fd\u65b9\u9762\u4e0eC++\u548cGO\u8bed\u8a00\u6709\u5f88\u5927\u5dee\u8ddd\uff0c\u5e76\u884c\u7f16\u7a0b\u8fd9\u4e00\u5757\u56e0\u4e3aGIL\u7684\u5b58\u5728,Python\u5f88\u96be\u5145\u5206\u5229\u7528\u591a\u6838CPU\u7684\u4f18\u52bf\u3002GO\u7684\u8fd0\u884c\u6548\u7387\u51e0\u4e4e\u53ef\u4ee5\u5ab2\u7f8eC/C++\uff0c\u800c\u4e14\u5929\u7136\u652f\u6301\u5e76\u53d1\u7f16\u7a0b\uff0c\u53ef\u4ee5\u901a\u8fc7go\u5173\u952e\u5b57\u521b\u5efaN\u4e2agoroutine\uff08\u4e00\u79cd\u7528\u6237\u6001\u7ebf\u7a0b\uff09\u6765\u5b9e\u73b0\u5e76\u53d1\uff0c\u540c\u65f6\u63d0\u4f9b\u591a\u4e2agoroutine\u7684\u540c\u6b65\u673a\u5236\u3002 \u5c0f\u7ed3 \u00b6 \u7efc\u4e0a\u6240\u8bc9\uff0cC++\u5728\u6027\u80fd\u65b9\u9762\u5f88\u9ad8\uff0c\u4f46\u662f\u5f00\u53d1\u6210\u672c\u4e5f\u6bd4\u8f83\u9ad8\u3002Python\u5f00\u53d1\u7b80\u5355\uff0c\u4f46\u662f\u6027\u80fd\u8f83\u4f4e\uff0c\u4f7f\u7528\u4e0e\u4e00\u4e9b\u5bf9\u6027\u80fd\u6ca1\u8981\u6c42\u7684\u670d\u52a1\u548c\u5de5\u5177\u5f00\u53d1\u3002\u76f8\u5bf9\u6765\u8bf4\uff0cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u7b80\u5355\uff0c\u5f00\u53d1\u6210\u672c\u4f4e\uff0c\u800c\u4e14\u6548\u7387\u4e5f\u8fdc\u9ad8\u4e8e\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u9002\u5408\u5927\u90e8\u5206\u7684\u670d\u52a1\u5f00\u53d1\u3002 Lambda\u8868\u8fbe\u5f0f\u7684\u53c2\u6570\u6355\u83b7\u6709\u54ea\u51e0\u79cd\u60c5\u51b5 \u00b6 \u503c\u6355\u83b7 \u4e0e\u4f20\u503c\u53c2\u6570\u7c7b\u4f3c\uff0c\u8981\u6c42\u503c\u6355\u83b7\u7684\u524d\u63d0\u662f \u53d8\u91cf\u53ef\u4ee5\u62f7\u8d1d \u4e0e\u4f20\u503c\u53c2\u6570\u4e0d\u540c\u7684\u662f\uff0c\u88ab\u6355\u83b7\u7684\u53d8\u91cf\u662f\u5728lambda\u521b\u5efa\u65f6\u62f7\u8d1d\uff0c\u800c\u4e0d\u662f\u5728\u8c03\u7528\u65f6\u62f7\u8d1d \u5f15\u7528\u6355\u83b7 \u786e\u4fdd\u88ab\u5f15\u7528\u7684\u5bf9\u8c61\u5728lambda\u8868\u8fbe\u5f0f\u6267\u884c\u65f6\u8fd8\u662f\u5b58\u5728\u7684 \u9690\u5f0f\u6355\u83b7 \u5728\u6355\u83b7\u5217\u8868\u4e2d\u4f7f\u7528 &\u6216 = \u5373\u8868\u793a\u9690\u5f0f\u6355\u83b7\uff0c \u6307\u793a\u7f16\u8bd1\u5668\u81ea\u52a8\u63a8\u65ad\u6355\u83b7\u5217\u8868 & \u8868\u793a\u91c7\u7528 \u5f15\u7528\u6355\u83b7 \u7684\u65b9\u5f0f = \u8868\u793a\u91c7\u7528 \u503c\u6355\u83b7 \u7684\u65b9\u5f0f Reference \u00b6 \u73b0\u4ee3C++32\u8bb2 C++\u9762\u8bd5\u8d44\u6599 \u7ec6\u8bfb Effective C++ cppreference","title":"C++ \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/c_cpp/basic/#c","text":"\u7ea6 12299 \u4e2a\u5b57 8 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 41 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9b\u5173\u4e8eC++\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6\uff0c\u5305\u62ec\u9762\u5411\u5bf9\u8c61\u7b49","title":"C++ \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/c_cpp/basic/#_1","text":"\u9884\u5904\u7406\uff1a\u6761\u4ef6\u7f16\u8bd1\uff0c\u5934\u6587\u4ef6\u5305\u542b\uff0c\u5b8f\u66ff\u6362\u5904\u7406\uff0c\u751f\u6210.i\u6587\u4ef6 \u7f16\u8bd1\uff1a\u5c06\u9884\u5904\u7406\u540e\u7684\u6587\u4ef6\u8f6c\u5316\u4e3a\u6c47\u7f16\u8bed\u8a00\uff0c\u751f\u6210.s\u6587\u4ef6 \u6c47\u7f16\uff1a\u6c47\u7f16\u53d8\u4e3a\u76ee\u6807\u4ee3\u7801\uff08\u673a\u5668\u4ee3\u7801\uff09\uff0c\u751f\u6210.o\u6587\u4ef6 \u94fe\u63a5\uff1a\u8fde\u63a5\u76ee\u6807\u4ee3\u7801\uff0c\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f","title":"\u4ee3\u7801\u5230\u53ef\u6267\u884c\u7a0b\u5e8f"},{"location":"cs/pl/c_cpp/basic/#_2","text":"\u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93\u6700\u672c\u8d28\u7684\u533a\u522b\u5c31\u662f\uff1a \u8be5\u5e93\u662f\u5426\u88ab\u7f16\u8bd1\u8fdb\u76ee\u6807\uff08\u7a0b\u5e8f\uff09\u5185\u90e8 \u9759\u6001\u5e93 \u4e00\u822c\u6269\u5c55\u540d\u4e3a .a \u6216 .lib \uff0c\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u4f1a\u76f4\u63a5\u6574\u5408\u5230\u76ee\u6807\u7a0b\u5e8f\u4e2d\uff0c\u6240\u4ee5\u5229\u7528\u9759\u6001\u51fd\u6570\u5e93\u7f16\u8bd1\u6210\u7684\u6587\u4ef6\u6bd4\u8f83\u5927\uff0c\u6700\u5927\u7684\u4f18\u70b9\u5c31\u662f \u7f16\u8bd1\u6210\u529f\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u4ee5\u72ec\u7acb\u8fd0\u884c \uff0c\u800c\u4e0d\u518d\u9700\u8981\u5411\u5916\u90e8\u8981\u6c42\u8bfb\u53d6\u51fd\u6570\u5e93\u7684\u5185\u5bb9\uff1b\u4f46\u662f\u4ece\u5347\u7ea7\u96be\u6613\u5ea6\u6765\u770b\u660e\u663e\u6ca1\u6709\u4f18\u52bf\uff0c \u5982\u679c\u51fd\u6570\u5e93\u66f4\u65b0\uff0c\u9700\u8981\u91cd\u65b0\u7f16\u8bd1 \u3002 \u52a8\u6001\u5e93 \u52a8\u6001\u51fd\u6570\u5e93\u7684\u6269\u5c55\u540d\u4e00\u822c\u4e3a .so \u6216 .dll \uff0c\u8fd9\u7c7b\u51fd\u6570\u5e93\u901a\u5e38\u540d\u4e3alibxxx.so\u6216xxx.dll\u3002 \u4e0e\u9759\u6001\u51fd\u6570\u5e93\u88ab\u6574\u4e2a\u6355\u6349\u5230\u7a0b\u5e8f\u4e2d\u4e0d\u540c\uff0c\u52a8\u6001\u51fd\u6570\u5e93\u5728\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u91cc\u53ea\u6709\u4e00\u4e2a\u201c\u6307\u5411\u201d\u7684\u4f4d\u7f6e\u800c\u5df2\uff0c\u4e5f\u5c31\u662f\u8bf4\u5f53\u53ef\u6267\u884c\u6587\u4ef6\u9700\u8981\u4f7f\u7528\u51fd\u6570\u5e93\u7684\u673a\u5236\u65f6\uff0c\u7a0b\u5e8f\u624d\u4f1a\u53bb\u8bfb\u53d6\u51fd\u6570\u5e93\u6765\u4f7f\u7528\uff1b\u4e5f\u5c31\u662f\u8bf4\u53ef\u6267\u884c\u6587\u4ef6\u65e0\u6cd5\u5355\u72ec\u8fd0\u884c\u3002\u8fd9\u6837\u4ece\u4ea7\u54c1\u529f\u80fd\u5347\u7ea7\u89d2\u5ea6\u65b9\u4fbf\u5347\u7ea7\uff0c\u53ea\u9700\u8981\u66ff\u6362\u5bf9\u5e94\u52a8\u6001\u5e93\u5373\u53ef\uff0c\u4e0d\u5fc5\u91cd\u65b0\u7f16\u8bd1\u6574\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002","title":"\u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93"},{"location":"cs/pl/c_cpp/basic/#dll","text":"","title":"dll\u52a0\u8f7d"},{"location":"cs/pl/c_cpp/basic/#_3","text":"\u5728\u7a0b\u5e8f\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u5c06dll\u7f16\u8bd1\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u8c03\u7528\u65b9\u4fbf\uff0c\u7a0b\u5e8f\u53d1\u5e03\u7684\u65f6\u5019\u53ef\u4ee5\u4e0d\u7528\u5e26\u7740dll \u7f3a\u70b9\u662f\u7a0b\u5e8f\u4f1a\u5f88\u5927","title":"\u9690\u5f0f\u52a0\u8f7d\uff08\u9759\u6001\u8c03\u7528\uff09"},{"location":"cs/pl/c_cpp/basic/#_4","text":"\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u7528\u5230dll\u91cc\u7684\u51fd\u6570\u65f6\uff0c\u518d\u52a8\u6001\u52a0\u8f7ddll\u5230\u5185\u5b58\u4e2d \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u56e0\u4e3a\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u540e\u518d\u52a0\u8f7d\u5230\uff0c\u6240\u4ee5\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u542f\u52a8\u66f4\u5feb\uff0c\u800c\u4e14dll\u7684\u7ef4\u62a4\u66f4\u5bb9\u6613\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u5982\u679c\u9700\u8981\u66f4\u65b0\uff0c\u5f88\u591a\u65f6\u5019\u76f4\u63a5\u66f4\u65b0dll\uff0c\u800c\u4e0d\u7528\u91cd\u65b0\u5b89\u88c5\u7a0b\u5e8f \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\uff0c\u51fd\u6570\u8c03\u7528\u7a0d\u5fae\u590d\u6742\u4e00\u70b9","title":"\u663e\u793a\u52a0\u8f7d\uff08\u52a8\u6001\u8c03\u7528\uff09"},{"location":"cs/pl/c_cpp/basic/#c_1","text":"","title":"C++\u5185\u5b58\u7ba1\u7406"},{"location":"cs/pl/c_cpp/basic/#_5","text":"C++ \u5185\u5b58\u5206\u533a\uff1a\u6808\u3001\u5806\u3001\u81ea\u7531\u5b58\u50a8\u533a\u3001\u5168\u5c40/\u9759\u6001\u5b58\u50a8\u533a\u3001\u5e38\u91cf\u533a \u6808\uff1a\u5b58\u653e\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u52a8\u5206\u914d\u548c\u91ca\u653e \u5806\uff1a\u52a8\u6001\u7533\u8bf7\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u5c31\u662f\u7531 malloc \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531\u7a0b\u5e8f\u5458\u63a7\u5236\u5b83\u7684\u5206\u914d\u548c\u91ca\u653e\uff0c\u5982\u679c\u7a0b\u5e8f\u6267\u884c\u7ed3\u675f\u8fd8\u6ca1\u6709\u91ca\u653e\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u56de\u6536 \u81ea\u7531\u5b58\u50a8\u533a\uff1a\u548c\u5806\u5341\u5206\u76f8\u4f3c\uff0c\u5b58\u653e\u7531 new \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531 delete \u91ca\u653e\u5185\u5b58 \u5168\u5c40\u533a/\u9759\u6001\u533a\uff1a\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u53d8\u91cf \u5e38\u91cf\u5b58\u50a8\u533a\uff1a\u5b58\u653e\u7684\u662f\u5e38\u91cf\uff0c\u4e0d\u5141\u8bb8\u4fee\u6539 \u4e8b\u5b9e\u4e0a\uff0c\u6211\u5728\u7f51\u4e0a\u770b\u7684\u5f88\u591a\u535a\u5ba2\uff0c\u5212\u5206\u81ea\u7531\u5b58\u50a8\u533a\u4e0e\u5806\u7684\u5206\u754c\u7ebf\u5c31\u662fnew/delete\u4e0emalloc/free\u3002\u7136\u800c\uff0c\u5c3d\u7ba1C++\u6807\u51c6\u6ca1\u6709\u8981\u6c42\uff0c\u4f46\u5f88\u591a\u7f16\u8bd1\u5668\u7684new/delete\u90fd\u662f\u4ee5malloc/free\u4e3a\u57fa\u7840\u6765\u5b9e\u73b0\u7684\u3002\u90a3\u4e48\u8bf7\u95ee\uff1a\u501f\u4ee5malloc\u5b9e\u73b0\u7684new\uff0c\u6240\u7533\u8bf7\u7684\u5185\u5b58\u662f\u5728\u5806\u4e0a\u8fd8\u662f\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\uff1f \u4ece\u6280\u672f\u4e0a\u6765\u8bf4\uff0c\u5806\uff08heap\uff09\u662fC\u8bed\u8a00\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u672f\u8bed\u3002\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u6240\u7ef4\u62a4\u7684\u4e00\u5757\u7279\u6b8a\u5185\u5b58\uff0c\u5b83\u63d0\u4f9b\u4e86\u52a8\u6001\u5206\u914d\u7684\u529f\u80fd\uff0c\u5f53\u8fd0\u884c\u7a0b\u5e8f\u8c03\u7528malloc()\u65f6\u5c31\u4f1a\u4ece\u4e2d\u5206\u914d\uff0c\u7a0d\u540e\u8c03\u7528free\u53ef\u628a\u5185\u5b58\u4ea4\u8fd8\u3002\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u548cdelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\uff0c\u901a\u8fc7new\u6765\u7533\u8bf7\u7684\u5185\u5b58\u533a\u57df\u53ef\u79f0\u4e3a\u81ea\u7531\u5b58\u50a8\u533a\u3002\u57fa\u672c\u4e0a\uff0c\u6240\u6709\u7684C++\u7f16\u8bd1\u5668\u9ed8\u8ba4\u4f7f\u7528\u5806\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4e5f\u5373\u662f\u7f3a\u7701\u7684\u5168\u5c40\u8fd0\u7b97\u7b26new\u548cdelete\u4e5f\u8bb8\u4f1a\u6309\u7167malloc\u548cfree\u7684\u65b9\u5f0f\u6765\u88ab\u5b9e\u73b0\uff0c\u8fd9\u65f6\u85c9\u7531new\u8fd0\u7b97\u7b26\u5206\u914d\u7684\u5bf9\u8c61\uff0c\u8bf4\u5b83\u5728\u5806\u4e0a\u4e5f\u5bf9\uff0c\u8bf4\u5b83\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e5f\u6b63\u786e\u3002\u4f46\u7a0b\u5e8f\u5458\u4e5f\u53ef\u4ee5\u901a\u8fc7\u91cd\u8f7d\u64cd\u4f5c\u7b26\uff0c\u6539\u7528\u5176\u4ed6\u5185\u5b58\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4f8b\u5982\u5168\u5c40\u53d8\u91cf\u505a\u7684\u5bf9\u8c61\u6c60\uff0c\u8fd9\u65f6\u81ea\u7531\u5b58\u50a8\u533a\u5c31\u533a\u522b\u4e8e\u5806\u4e86\u3002\u6211\u4eec\u6240\u9700\u8981\u8bb0\u4f4f\u7684\u5c31\u662f\uff1a \u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u7ef4\u62a4\u7684\u4e00\u5757\u5185\u5b58\uff0c\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u4e0edelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\u3002\u5806\u4e0e\u81ea\u7531\u5b58\u50a8\u533a\u5e76\u4e0d\u7b49\u4ef7\u3002","title":"\u5185\u5b58\u7ed3\u6784"},{"location":"cs/pl/c_cpp/basic/#_6","text":"\u5185\u5b58\u6cc4\u6f0f\u662f\u6307\u5e94\u7528\u7a0b\u5e8f\u5206\u914d\u67d0\u6bb5\u5185\u5b58\u540e\uff0c \u5931\u53bb\u4e86\u5bf9\u8be5\u6bb5\u5185\u5b58\u7684\u63a7\u5236 \uff0c\u56e0\u800c\u9020\u6210\u4e86\u5185\u5b58\u7684\u6d6a\u8d39\u3002 1. \u5728\u7c7b\u7684\u6784\u9020\u51fd\u6570\u548c\u6790\u6784\u51fd\u6570\u4e2d\u6ca1\u6709\u5339\u914d\u7684\u8c03\u7528new\u548cdelete\u51fd\u6570 2. \u6ca1\u6709\u6b63\u786e\u5730\u6e05\u9664 \u5d4c\u5957\u7684\u5bf9\u8c61\u6307\u9488 3. \u5728\u91ca\u653e \u5bf9\u8c61\u6570\u7ec4 \u65f6\u5728\u4e2d\u6ca1\u6709\u4f7f\u7528delete[] 4. \u6307\u5411\u5bf9\u8c61\u7684\u6307\u9488\u6570\u7ec4\u4e0d\u7b49\u540c\u4e8e\u5bf9\u8c61\u6570\u7ec4 1. \u7f3a\u5c11 \u62f7\u8d1d\u6784\u9020\u51fd\u6570 \u6216 \u91cd\u8f7d\u590d\u5236\u8fd0\u7b97\u7b26 \uff1a\u9690\u5f0f\u7684\u6307\u9488\u590d\u5236\u7ed3\u679c\u5c31\u662f\u4e24\u4e2a\u5bf9\u8c61\u62e5\u6709\u6307\u5411\u540c\u4e00\u4e2a\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u7a7a\u95f4\u7684\u6307\u9488\u3002 5. \u6ca1\u6709\u5c06\u57fa\u7c7b\u7684 \u6790\u6784\u51fd\u6570 \u5b9a\u4e49\u4e3a\u865a\u51fd\u6570\u3002","title":"\u5185\u5b58\u6cc4\u6f0f"},{"location":"cs/pl/c_cpp/basic/#c_2","text":"","title":"C++\u7279\u6027"},{"location":"cs/pl/c_cpp/basic/#cc11","text":"\u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001 \u9700\u8981\u5728\u4e0d\u540c\u7684\u5e73\u53f0\u4e0a\u8fdb\u884c\u7f16\u8bd1 \u7f16\u8bd1\u540e\u7684\u7a0b\u5e8f\u53ef\u4ee5\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u76f4\u63a5\u8fd0\u884c \u53ef\u4ee5\u9762\u5411\u8fc7\u7a0b\u548c\u9762\u5411\u5bf9\u8c61\u4e24\u79cd\u8bbe\u8ba1\u65b9\u5f0f \u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u672c\u5730\u7684\u7cfb\u7edf\u5e93 \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u63a5\u53e3 \u7f16\u8bd1\u540e\u4ec5\u5bf9\u53d8\u91cf\u7684\u7c7b\u578b\u8fdb\u884c\u4e86\u5b58\u50a8\uff0c\u4e0d\u53ef\u4ee5\u8fdb\u884c\u7c7b\u4f3c\u53cd\u5c04\u7684\u64cd\u4f5c \u652f\u6301\u65e0\u7b26\u53f7\u6574\u578b \u53d8\u91cf\u7c7b\u578b\u7684\u5b57\u8282\u957f\u5ea6\u53d7\u64cd\u4f5c\u7cfb\u7edf\u5f71\u54cd \u652f\u6301\u6307\u9488\u3001\u5f15\u7528\u3001\u503c\u4f20\u9012 \u6ca1\u6709\u9ed8\u8ba4\u63d0\u4f9b\u7684GC\u7cfb\u7edf \u7531\u7a0b\u5e8f\u5458\u8d1f\u8d23\u7ba1\u7406\u53d8\u91cf\u6240\u50a8\u5b58\u7684\u4f4d\u7f6e \u4e25\u683c\u7684RAII \u652f\u6301\u91cd\u5199\u3001\u91cd\u8f7d\uff0c\u5305\u62ec\u8fd0\u7b97\u7b26\u7684\u91cd\u8f7d \u591a\u91cd\u7ee7\u627f \u652f\u6301\u9884\u7f16\u8bd1\uff0c\u7f16\u8bd1\u5b8f\u5b9a\u4e49 \u652f\u6301\u51fd\u6570\u6307\u9488\uff0c\u51fd\u6570\u5bf9\u8c61\uff0clambda\u8868\u8fbe\u5f0f","title":"C++\u7684\u7279\u6027\uff08C++11\u53ca\u4ee5\u4e0a\uff09"},{"location":"cs/pl/c_cpp/basic/#c11","text":"foreach auto \u81ea\u52a8\u7c7b\u578b\u63a8\u65ad lambda \u533f\u540d\u51fd\u6570 \u540e\u7f6e\u8fd4\u56de\u7c7b\u578b override \u5173\u952e\u5b57 \u7981\u6b62\u91cd\u5199 final \u5e38\u91cf\u8868\u8fbe\u5f0f constexpr nullptr \u4ee3\u8868\u539f\u6765\u7684NULL\uff0c\u800c\u539f\u6765\u7684NULL\u66f4\u591a\u8868\u793a\u4e3a0 \u5f53\u5b58\u5728 void a(int x); \u548c void a(char *x); \u65f6\uff0c\u82e5\u4f7f\u7528 a(NULL) \u5219\u4f1a\u8c03\u7528\u524d\u8005\uff0c\u8fd9\u4e0e\u901a\u5e38\u7684\u7406\u89e3\u4e0d\u540c\uff0c\u800c\u4f7f\u7528 a*nullptr) \u5219\u4f1a\u660e\u786e\u7684\u8c03\u7528\u540e\u8005 \u5143\u7ec4 tuple \uff0c\u53ef\u4ee5\u4f7f\u7528 get<>() \u53d6\u51fa\u5176\u4e2d\u4e00\u4e2a\u503c\uff0c\u6216\u8005\u4f7f\u7528 tie() \u88c5\u5305\u6216\u89e3\u5305","title":"C++11\u65b0\u589e\u7684\u7279\u6027"},{"location":"cs/pl/c_cpp/basic/#structclass","text":"struct\u9ed8\u8ba4\u4f7f\u7528public\uff0c\u800cclass\u9ed8\u8ba4\u4f7f\u7528private struct\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 {} \u8fdb\u884c\u521d\u59cb\u5316\uff0c\u800cclass\u5219\u9700\u8981\u6240\u6709\u6210\u5458\u53d8\u91cf\u90fd\u662fpublic\u7684\u65f6\u5019\u624d\u53ef\u4ee5\u4f7f\u7528","title":"struct\u548cclass\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_8","text":"\u7533\u8bf7\u65b9\u5f0f\uff1a\u6808\u662f\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u5806\u662f\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7 \u7533\u8bf7\u540e\u7cfb\u7edf\u54cd\u5e94\uff1a\u5206\u914d\u6808\u7a7a\u95f4\uff0c\u5982\u679c\u5269\u4f59\u7a7a\u95f4\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u5219\u5206\u914d\u6210\u529f\uff0c\u5426\u5219\u5206\u914d\u5931\u8d25\u6808\u6ea2\u51fa\uff1b\u7533\u8bf7\u5806\u7a7a\u95f4\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u5448\u73b0\u7684\u65b9\u5f0f\u7c7b\u4f3c\u4e8e\u94fe\u8868\uff08\u8bb0\u5f55\u7a7a\u95f2\u5730\u5740\u7a7a\u95f4\u7684\u94fe\u8868\uff09\uff0c\u5728\u94fe\u8868\u4e0a\u5bfb\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u7684\u8282\u70b9\u5206\u914d\u7ed9\u7a0b\u5e8f\uff0c\u5c06\u8be5\u8282\u70b9\u4ece\u94fe\u8868\u4e2d\u5220\u9664\uff0c\u5927\u591a\u6570\u7cfb\u7edf\u4e2d\u8be5\u5757\u7a7a\u95f4\u7684\u9996\u5730\u5740\u5b58\u653e\u7684\u662f\u672c\u6b21\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u4fbf\u4e8e\u91ca\u653e\uff0c\u5c06\u8be5\u5757\u7a7a\u95f4\u4e0a\u7684\u5269\u4f59\u7a7a\u95f4\u518d\u6b21\u8fde\u63a5\u5728\u7a7a\u95f2\u94fe\u8868\u4e0a \u6808\u5728\u5185\u5b58\u4e2d\u662f\u8fde\u7eed\u7684\u4e00\u5757\u7a7a\u95f4\uff08\u5411\u4f4e\u5730\u5740\u6269\u5c55\uff09\u6700\u5927\u5bb9\u91cf\u662f\u7cfb\u7edf\u9884\u5b9a\u597d\u7684\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u7684\u7a7a\u95f4\uff08\u5411\u9ad8\u5730\u5740\u6269\u5c55\uff09\u662f\u4e0d\u8fde\u7eed\u7684 \u7533\u8bf7\u6548\u7387\uff1a\u6808\u662f\u6709\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u7533\u8bf7\u6548\u7387\u9ad8\uff0c\u4f46\u7a0b\u5e8f\u5458\u65e0\u6cd5\u63a7\u5236\uff1b\u5806\u662f\u7531\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7\uff0c\u6548\u7387\u4f4e\uff0c\u4f7f\u7528\u8d77\u6765\u65b9\u4fbf\u4f46\u662f\u5bb9\u6613\u4ea7\u751f\u788e\u7247 \u5b58\u653e\u7684\u5185\u5bb9\uff1a\u6808\u4e2d\u5b58\u653e\u7684\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u51fd\u6570\u7684\u53c2\u6570\uff1b\u5806\u4e2d\u5b58\u653e\u7684\u5185\u5bb9\u7531\u7a0b\u5e8f\u5458\u63a7\u5236","title":"\u5806\u548c\u6808\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_9","text":"\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u8fdb\u7a0b\u6240\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\u7528\u6765\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u3002\u7531\u7a0b\u5e8f\u5458\u7ba1\u7406\uff0c\u4e3b\u52a8\u7533\u8bf7\u4ee5\u53ca\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\uff0c\u5728\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u7531\u64cd\u4f5c\u7cfb\u7edf\u56de\u6536 \u6808\u662f\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7ba1\u7406\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7533\u8bf7\uff0c\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u901a\u5e38\u6bd4\u5806\u8981\u5c0f\u5f88\u591a\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\uff0c2\u5f53\u8c03\u7528\u4e00\u4e2a\u51fd\u6570\u65f6\u4f1a\u521b\u5efa\u4e00\u4e2a\u6808\uff0c\u5f53\u51fd\u6570\u7ed3\u675f\u65f6\u5219\u4f1a\u56de\u6536\u6808\u7684\u7a7a\u95f4\u3002","title":"\u64cd\u4f5c\u7cfb\u7edf\u89d2\u5ea6"},{"location":"cs/pl/c_cpp/basic/#_10","text":"\u5806\u662f\u4e00\u9897\u5b8c\u5168\u4e8c\u53c9\u6811\uff0c\u5e38\u89c1\u7684\u6709\u6700\u5927\u5806\u548c\u6700\u5c0f\u5806\uff0c\u4ee5\u6700\u5927\u5806\u4e3a\u4f8b\uff0c\u5176\u6ee1\u8db3\u4e8c\u53c9\u6811\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u8282\u70b9\u7684\u5b69\u5b50\u8282\u70b9\u90fd\u6bd4\u6b64\u8282\u70b9\u5c0f\u3002\u901a\u5e38\u7528\u6765\u5b9e\u73b0\u4f18\u5148\u961f\u5217\u7684\u6548\u679c\uff0c\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(log N)\\) \u6808\u662f\u4e00\u79cd\u7ebf\u6027\u6570\u636e\u7ed3\u6784\uff0c\u6ee1\u8db3\u5148\u8fdb\u540e\u51fa\u7684\u7279\u70b9\uff0c\u5373\u6700\u5148\u8fdb\u5165\u7684\u6570\u636e\u6700\u540e\u79bb\u5f00\uff0c\u5e38\u89c1\u4e8eDFS\u4e2d\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5355\u8c03\u6808\u7684\u65b9\u5f0f\u6c42\u89e3\u4e00\u4e9b\u95ee\u9898\u3002\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(1)\\)","title":"\u6570\u636e\u7ed3\u6784\u89d2\u5ea6"},{"location":"cs/pl/c_cpp/basic/#ccast","text":"const_cast \uff1a\u5bf9\u4e8e\u672a\u5b9a\u4e49const\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528const_cast\u6765\u53bb\u9664const\u5f15\u7528\u5bf9\u8c61\u7684const\uff0c\u5b8c\u6210\u51fd\u6570\u8c03\u7528\u3002\u53e6\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u7ed3\u5408static_cast\uff0c\u53ef\u4ee5\u5728\u975econst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u5185\u6dfb\u52a0const\uff0c\u8c03\u7528\u5b8cconst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u540e\uff0c\u518d\u4f7f\u7528const_cast\u53bb\u9664const\u9650\u5b9a\u3002 static_cast \uff1a\u5b8c\u6210\u57fa\u7840\u6570\u636e\u7c7b\u578b\uff1b\u540c\u4e00\u4e2a\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7c7b\u578b\u7684\u8f6c\u6362\uff1b\u4efb\u610f\u7c7b\u578b\u4e0e\u7a7a\u6307\u9488\u7c7b\u578bvoid* \u4e4b\u95f4\u7684\u8f6c\u6362\u3002 reinterpret_cast \uff1a\u65e0\u6761\u4ef6\u8f6c\u6362\uff08\u4ec0\u4e48\u90fd\u53ef\u4ee5\u8f6c\uff09\uff0cint\u53ef\u4ee5\u8f6c\u6307\u9488\uff0c\u53ef\u80fd\u4f1a\u51fa\u95ee\u9898\uff0c\u5c3d\u91cf\u5c11\u7528\u3002 dynamic_cast \uff1a\u7528\u4e8e\u52a8\u6001\u7c7b\u578b\u8f6c\u6362\u3002\u53ea\u80fd\u7528\u4e8e\u542b\u6709\u865a\u51fd\u6570\u7684\u7c7b\uff0c\u7528\u4e8e\u7c7b\u5c42\u6b21\u95f4\u7684\u5411\u4e0a\u548c\u5411\u4e0b\u8f6c\u6362\uff08\u5b50\u7c7b\u548c\u57fa\u7c7b\uff09\u3002\u53ea\u80fd\u8f6c\u6307\u9488\u6216\u5f15\u7528\u3002\u5411\u4e0b\u8f6c\u5316\u65f6\uff0c\u5982\u679c\u662f\u975e\u6cd5\u7684\u5bf9\u4e8e\u6307\u9488\u8fd4\u56deNULL\uff0c\u5bf9\u4e8e\u5f15\u7528\u629b\u5f02\u5e38\u3002\u5b83\u901a\u8fc7\u5224\u65ad\u5728\u6267\u884c\u5230\u8be5\u8bed\u53e5\u7684\u65f6\u5019\u53d8\u91cf\u7684\u8fd0\u884c\u65f6\u7c7b\u578b\u548c\u8981\u8f6c\u6362\u7684\u7c7b\u578b\u662f\u5426\u76f8\u540c\u6765\u5224\u65ad\u662f\u5426\u80fd\u591f\u8fdb\u884c\u5411\u4e0b\u8f6c\u6362\u3002","title":"C++\u4e2d\u56db\u79cdcast\u8f6c\u6362"},{"location":"cs/pl/c_cpp/basic/#static","text":"\u9759\u6001\u5c40\u90e8\u53d8\u91cf \uff1a\u53d8\u91cf\u5c5e\u4e8e\u51fd\u6570\u672c\u8eab\uff0c\u4ec5\u53d7\u51fd\u6570\u7684\u63a7\u5236\u3002\u4fdd\u5b58\u5728\u5168\u5c40\u6570\u636e\u533a\uff0c\u800c\u4e0d\u662f\u5728\u6808\u4e2d\uff0c\u6bcf\u6b21\u7684\u503c\u4fdd\u6301\u5230\u4e0b\u4e00\u6b21\u8c03\u7528\uff0c\u76f4\u5230\u4e0b\u6b21\u8d4b\u65b0\u503c\u3002 \u9759\u6001\u5168\u5c40\u53d8\u91cf \uff1a\u5b9a\u4e49\u5728\u51fd\u6570\u4f53\u5916\uff0c\u7528\u4e8e\u4fee\u9970\u5168\u5c40\u53d8\u91cf\uff0c\u8868\u793a\u8be5\u53d8\u91cf \u53ea\u5728\u672c\u6587\u4ef6\u53ef\u89c1 \uff0c\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff08\u5168\u5c40\u53d8\u91cf\u53ef\u4ee5\uff09 \u9759\u6001\u51fd\u6570 \uff1a\u9759\u6001\u51fd\u6570\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff0c\u5176\u4ed6\u6587\u4ef6\u4e2d\u53ef\u4ee5\u5b9a\u4e49\u76f8\u540c\u540d\u5b57\u7684\u51fd\u6570\uff0c\u4e0d\u4f1a\u53d1\u751f\u51b2\u7a81 \u9759\u6001\u6570\u636e\u6210\u5458 \uff1a\u9759\u6001\u6570\u636e\u6210\u5458\u7684\u751f\u5b58\u671f\u5927\u96e8class\u7684\u5b9e\u4f8b\uff08\u9759\u6001\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2aclass\u6709\u4e00\u4efd\uff0c\u666e\u901a\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2ainstance\u6709\u4e00\u4efd\uff09 1. \u9759\u6001\u6210\u5458\u4e4b\u95f4\u53ef\u4ee5\u76f8\u4e92\u8bbf\u95ee \uff0c\u5305\u62ec\u9759\u6001\u6210\u5458\u51fd\u6570\u8bbf\u95ee\u9759\u6001\u6570\u636e\u6210\u5458\u548c\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\uff1b 2. \u975e\u9759\u6001\u6210\u5458\u51fd\u6570 \u53ef\u4ee5\u4efb\u610f\u5730\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\u548c\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 3. \u9759\u6001\u6210\u5458\u51fd\u6570\u4e0d\u80fd\u8bbf\u95ee\u975e\u9759\u6001 \u6210\u5458\u51fd\u6570\u548c\u975e\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 4. \u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u53ef\u4ee5\u7528\u6210\u5458\u8bbf\u95ee\u64cd\u4f5c\u7b26 . \u6216 -> \u4e3a\u4e00\u4e2a\u7c7b\u7684\u5bf9\u8c61\u6216\u6307\u5411\u7c7b\u5bf9\u8c61\u7684\u6307\u9488\u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u4e5f\u53ef\u4ee5\u7528\u7c7b\u540d :: \u51fd\u6570\u540d\u8c03\u7528(\u56e0\u4e3a\u5b83\u672c\u6765\u5c31\u662f\u5c5e\u4e8e\u7c7b\u7684\uff0c\u7528\u7c7b\u540d\u8c03\u7528\u5f88\u6b63\u5e38)","title":"static"},{"location":"cs/pl/c_cpp/basic/#static_1","text":"\u8be5\u53d8\u91cf\u5728\u5168\u5c40\u6570\u636e\u533a\u5206\u914d\u5185\u5b58 \u672a\u7ecf\u521d\u59cb\u5316\u7684\u9759\u6001\u5168\u5c40\u53d8\u91cf\u4f1a\u88ab\u7a0b\u5e8f\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0\uff08\u81ea\u52a8\u53d8\u91cf\u7684\u503c\u662f\u968f\u673a\u7684\uff0c\u9664\u975e\u4ed6\u88ab\u663e\u5f0f\u521d\u59cb\u5316\uff09 \u9759\u6001\u5168\u5c40\u53d8\u91cf\u5728\u58f0\u660e\u5b83\u7684\u6574\u4e2a\u6587\u4ef6\u90fd\u662f\u53ef\u89c1\u7684\uff0c\u800c\u5728\u6587\u4ef6\u4e4b\u5916\u662f\u4e0d\u53ef\u89c1\u7684","title":"static\u53d8\u91cf\u7684\u7279\u70b9"},{"location":"cs/pl/c_cpp/basic/#const","text":"\u4fee\u9970\u666e\u901a\u7c7b\u578b\u7684\u53d8\u91cf \u4fee\u9970\u6307\u9488\uff1a \u9876\u5c42const \uff08\u6307\u9488\u672c\u8eab\u662f\u4e2a\u5e38\u91cf\uff09\u548c \u5e95\u5c42const \uff08\u6307\u9488\u6307\u5411\u5bf9\u8c61\u662f\u4e00\u4e2a\u5e38\u91cf\uff09 \u4fee\u9970\u51fd\u6570\u53c2\u6570\uff1a 1. \u51fd\u6570\u53c2\u6570\u4e3a\u503c\u4f20\u9012\uff1a\u503c\u4f20\u9012\uff08pass-by-value\uff09\u662f\u4f20\u9012\u4e00\u4efd\u53c2\u6570\u7684\u62f7\u8d1d\u7ed9\u51fd\u6570\uff0c\u56e0\u6b64\u4e0d\u8bba\u51fd\u6570\u4f53\u4ee3\u7801\u5982\u4f55\u8fd0\u884c\uff0c\u4e5f\u53ea\u4f1a\u4fee\u6539\u62f7\u8d1d\u800c\u65e0\u6cd5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff0c\u8fd9\u79cd\u60c5\u51b5 \u4e0d\u9700\u8981\u5c06\u53c2\u6570\u58f0\u660e\u4e3aconst \u3002 2. \u51fd\u6570\u53c2\u6570\u4e3a\u6307\u9488\uff1a\u6307\u9488\u4f20\u9012\uff08pass-by-pointer\uff09 \u53ea\u4f1a\u8fdb\u884c\u6d45\u62f7\u8d1d\uff0c\u62f7\u8d1d\u4e00\u4efd\u6307\u9488\u7ed9\u51fd\u6570 \uff0c\u800c\u4e0d\u4f1a\u62f7\u8d1d\u4e00\u4efd\u539f\u59cb\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u7ed9\u6307\u9488\u53c2\u6570\u52a0\u4e0a\u9876\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u9488\u6307\u5411\u88ab\u7be1\u6539\uff0c\u52a0\u4e0a\u5e95\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u5411\u5bf9\u8c61\u88ab\u7be1\u6539\u3002 3. \u51fd\u6570\u53c2\u6570\u4e3a\u5f15\u7528\uff1a\u5f15\u7528\u4f20\u9012\uff08pass-by-reference\uff09\u53c8\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u7531\u4e8e\u5f15\u7528\u5c31\u662f\u5bf9\u8c61\u7684\u4e00\u4e2a\u522b\u540d\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u62f7\u8d1d\u5bf9\u8c61\uff0c\u51cf\u5c0f\u4e86\u5f00\u9500\u3002\u8fd9\u540c\u65f6\u4e5f\u5bfc\u81f4\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u5f15\u7528\u76f4\u63a5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff08\u6bd5\u7adf\u5f15\u7528\u548c\u539f\u59cb\u5bf9\u8c61\u5176\u5b9e\u662f\u540c\u4e00\u4e2a\u4e1c\u897f\uff09\uff0c\u56e0\u6b64\uff0c\u5927\u591a\u6570\u65f6\u5019\uff0c\u63a8\u8350\u51fd\u6570\u53c2\u6570\u8bbe\u7f6e\u4e3a pass-by-reference-to-const \u3002\u7ed9\u5f15\u7528\u52a0\u4e0a\u5e95\u5c42const\uff0c\u65e2\u53ef\u4ee5\u51cf\u5c0f\u62f7\u8d1d\u5f00\u9500\uff0c\u53c8\u53ef\u4ee5\u9632\u6b62\u4fee\u6539\u5e95\u5c42\u6240\u7528\u7684\u5bf9\u8c61\u3002 \u4fee\u9970\u51fd\u6570\u8fd4\u56de\u503c\uff1a\u4ee4\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5e38\u91cf\uff0c\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u56e0\u7528\u6237\u9519\u8bef\u9020\u6210\u7684\u610f\u5916\uff0c\u6bd4\u5982\u201c=\u201d\u3002 const\u6210\u5458\u51fd\u6570\uff1a const\u6210\u5458\u51fd\u6570\u4e0d\u53ef\u4fee\u6539\u7c7b\u5bf9\u8c61\u7684\u5185\u5bb9 \uff08\u6307\u9488\u7c7b\u578b\u7684\u6570\u636e\u6210\u5458\u53ea\u80fd\u4fdd\u8bc1\u4e0d\u4fee\u6539\u8be5\u6307\u9488\u6307\u5411\uff09\u3002\u539f\u7406\u662fconst\u6210\u5458\u51fd\u6570\u7684this\u6307\u9488\u5f0f\u5e95\u5c42const\u6307\u9488\uff0c\u4e0d\u80fd\u540c\u4e8e\u6539\u53d8\u5176\u6240\u6307\u5bf9\u8c61\u7684\u503c\u3002 \u5f53\u6210\u5458\u51fd\u6570const\u548cnon-const\u7248\u672c\u540c\u65f6\u5b58\u5728\u65f6\uff0cconst object\u53ea\u80fd\u8c03\u7528const\u7248\u672c\uff0cnon-const object\u667a\u80fd\u8c03\u7528non-const\u7248\u672c\u3002","title":"const"},{"location":"cs/pl/c_cpp/basic/#extern-c","text":"extern \"C\"\u7684\u4e3b\u8981\u4f5c\u7528\u5c31\u662f\u4e3a\u96f6\u80fd\u591f\u6b63\u786e\u5b9e\u73b0 C++\u4ee3\u7801\u8c03\u7528\u5176\u4ed6C\u8bed\u8a00\u4ee3\u7801 \u3002 \u52a0\u4e0aextern \"C\"\u540e\uff0c\u4f1a\u6307\u793a\u7f16\u8bd1\u5668\u8fd9\u90e8\u5206\u4ee3\u7801\u6309C\u8bed\u8a00\uff08\u800c\u4e0d\u662fC++\uff09\u7684\u65b9\u5f0f\u8fdb\u884c\u7f16\u8bd1\u3002\u7531\u4e8eC++\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1\u5668\u7f16\u8bd1\u51fd\u6570\u7684\u8fc7\u7a0b\u4e2d\u4f1a\u5c06\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u4e5f\u52a0\u5230\u7f16\u8bd1\u540e\u7684\u4ee3\u7801\u4e2d\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u51fd\u6570\u540d\uff1b\u800cC\u8bed\u8a00\u5e76\u4e0d\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1C\u8bed\u8a00\u4ee3\u7801\u7684\u51fd\u6570\u65f6\u4e0d\u4f1a\u5e26\u4e0a\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\uff0c\u4e00\u822c\u6307\u5305\u62ec\u51fd\u6570\u540d\u3002 \u5728C++\u51fa\u73b0\u4ee5\u524d\uff0c\u5f88\u591a\u4ee3\u7801\u90fd\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u800c\u4e14\u5f88\u5e95\u5c42\u7684\u5e93\u4e5f\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u4e3a\u4e86\u66f4\u597d\u7684\u652f\u6301\u539f\u6765\u7684C\u4ee3\u7801\u548c\u5df2\u7ecf\u5199\u597d\u7684C\u8bed\u8a00\u5e93\uff0c\u9700\u8981\u5728C++\u4e2d\u5c3d\u53ef\u80fd\u652f\u6301C\uff0c\u800cextern \"C\"\u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u7b56\u7565\u3002 C++\u4ee3\u7801\u8c03\u7528C\u8bed\u8a00\u4ee3\u7801 \u5728C++\u7684\u5934\u6587\u4ef6\u4e2d\u4f7f\u7528 \u5728\u591a\u4e2a\u534f\u540c\u5f00\u53d1\u65f6\uff0c\u53ef\u80fd\u6709\u7684\u4eba\u6bd4\u8f83\u64c5\u957fC\u8bed\u8a00\uff0c\u800c\u6709\u7684\u4eba\u64c5\u957fC++","title":"extern \"C\""},{"location":"cs/pl/c_cpp/basic/#inline","text":"\u7c7b\u5185\u5b9a\u4e49\u6210\u5458\u51fd\u6570\u9ed8\u8ba4\u4e3ainline","title":"inline"},{"location":"cs/pl/c_cpp/basic/#_11","text":"inline\u5b9a\u4e49\u7684\u7c7b\u7684\u5185\u8054\u51fd\u6570\uff0c\u51fd\u6570\u7684\u4ee3\u7801\u88ab\u653e\u5165\u7b26\u53f7\u8868\u4e2d\uff0c\u5728\u4f7f\u7528\u65f6\u76f4\u63a5\u8fdb\u884c\u66ff\u6362\uff0c\uff08\u50cf\u5b8f\u4e00\u6837\u5c55\u5f00\uff09\uff0c\u6ca1\u6709\u4e86\u8c03\u7528\u7684\u5f00\u9500\uff0c\u6548\u7387\u4e5f\u5f88\u9ad8\u3002 \u5185\u8054\u51fd\u6570\u4e5f\u662f\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u5728\u8c03\u7528\u4e00\u4e2a\u5185\u8054\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u68c0\u67e5\u5b83\u7684\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u4fdd\u8bc1\u8c03\u7528\u6b63\u786e\u3002\u7136\u540e\u8fdb\u884c\u4e00\u7cfb\u5217\u7684\u76f8\u5173\u68c0\u67e5\uff0c\u5c31\u50cf\u5bf9\u5f85\u4efb\u4f55\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\u4e00\u6837\u3002\u8fd9\u6837\u5c31\u6d88\u9664\u4e86\u5b83\u7684\u9690\u60a3\u548c\u5c40\u9650\u6027\u3002\uff08\u5b8f\u66ff\u6362\u4e0d\u4f1a\u68c0\u67e5\u7c7b\u578b\uff0c\u5b89\u5168\u9690\u60a3\u8f83\u5927\uff09 inline\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u7c7b\u7684\u6210\u5458\u51fd\u6570\uff0c\u4e0e\u7c7b\u7684\u666e\u901a\u6210\u5458\u51fd\u6570\u4f5c\u7528\u76f8\u540c\uff0c\u53ef\u4ee5\u653e\u4e3a\u4e00\u4e2a\u7c7b\u7684\u79c1\u6709\u6210\u5458\u548c\u4fdd\u62a4\u6210\u5458\u3002\u5185\u8054\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u66ff\u6362\u4e00\u822c\u7684\u5b8f\u5b9a\u4e49\uff0c\u6700\u91cd\u8981\u7684\u5e94\u7528\u5728\u4e8e\u7c7b\u7684\u5b58\u53d6\u51fd\u6570\u7684\u5b9a\u4e49\u4e0a\u9762\u3002","title":"\u4f18\u70b9"},{"location":"cs/pl/c_cpp/basic/#_12","text":"\u5185\u8054\u51fd\u6570\u5177\u6709\u4e00\u5b9a\u7684\u5c40\u9650\u6027\uff0c\u5185\u8054\u51fd\u6570\u7684 \u51fd\u6570\u4f53\u4e00\u822c\u6765\u8bf4\u4e0d\u80fd\u592a\u5927 \uff0c\u5982\u679c\u5185\u8054\u51fd\u6570\u7684\u51fd\u6570\u4f53\u8fc7\u5927\uff0c\u4e00\u822c\u7684\u7f16\u8bd1\u5668\u4f1a\u653e\u5f03\u5185\u8054\u65b9\u5f0f\uff0c\u800c\u91c7\u7528\u666e\u901a\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570\u3002\uff08\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f60\u5982\u679c\u4f7f\u7528\u5185\u8054\u51fd\u6570\uff0c\u53ea\u4e0d\u8fc7\u662f\u5411\u7f16\u8bd1\u5668\u63d0\u51fa\u4e00\u4e2a\u8bf7\u6c42\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u62d2\u7edd\u4f60\u7684\u8bf7\u6c42\uff09\u8fd9\u6837\uff0c\u5185\u8054\u51fd\u6570\u5c31\u548c\u666e\u901a\u51fd\u6570\u6267\u884c\u6548\u7387\u4e00\u6837\u4e86\u3002 inline\u8bf4\u660e\u5bf9\u7f16\u8bd1\u5668\u6765\u8bf4\u53ea\u662f\u4e00\u79cd\u5efa\u8bae\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u9009\u62e9\u5ffd\u7565\u8fd9\u4e2a\u5efa\u8bae\u3002\u6bd4\u5982\uff0c\u4f60\u8bb2\u4e00\u4e2a\u957f\u8fbe1000\u591a\u884c\u7684\u51fd\u6570\u6307\u5b9a\u4e3ainline\uff0c\u7f16\u8bd1\u5668\u5c31\u4f1a\u5ffd\u7565\u8fd9\u4e2ainline\uff0c\u5c06\u8fd9\u4e2a\u51fd\u6570\u8fd8\u539f\u6210\u666e\u901a\u51fd\u6570\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u8bf4\u628a\u4e00\u4e2a\u51fd\u6570\u5b9a\u4e49\u4e3ainline\u51fd\u6570\u5c31\u4e00\u5b9a\u4f1a\u88ab\u7f16\u8bd1\u5668\u8bc6\u522b\u4e3a\u5185\u8054\u51fd\u6570\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668\u7684\u5b9e\u73b0\u548c\u51fd\u6570\u4f53\u7684\u5927\u5c0f\u3002","title":"\u7f3a\u70b9"},{"location":"cs/pl/c_cpp/basic/#_13","text":"\u5b8f\u662f\u7531\u9884\u5904\u7406\u5668\u5bf9\u5b8f\u8fdb\u884c\u66ff\u4ee3\uff0c\u800c\u4e14\u5185\u8054\u51fd\u6570\u662f\u771f\u6b63\u7684\u51fd\u6570\uff0c\u53ea\u662f\u5728\u9700\u8981\u7528\u5230\u7684\u65f6\u5019\uff0c\u5185\u8054\u51fd\u6570\u50cf\u5b8f\u4e00\u6837\u7684\u5c55\u5f00\uff0c\u6240\u4ee5 \u53d6\u6d88\u4e86\u51fd\u6570\u7684\u53c2\u6570\u538b\u6808\uff0c\u51cf\u5c11\u4e86\u8c03\u7528\u7684\u5f00\u9500 \uff0c\u4f60\u53ef\u4ee5\u50cf\u8c03\u7528\u51fd\u6570\u4e00\u6837\u6765\u8c03\u7528\u5185\u8054\u51fd\u6570\uff0c\u800c\u4e0d\u5fc5\u62c5\u5fc3\u4f1a\u4ea7\u751f\u4e8e\u5904\u7406\u5b8f\u7684\u4e00\u4e9b\u95ee\u9898\u3002\u5185\u8054\u51fd\u6570\u4e0e\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ed6\u4eec\u7684\u4ee3\u7801\u6548\u7387\u662f\u4e00\u6837\uff0c\u4f46\u662f\u5185\u8054\u51fd\u6570\u8981\u4f18\u4e8e\u5b8f\u5b9a\u4e49\uff0c\u56e0\u4e3a\u5185\u8054\u51fd\u6570\u9075\u5faa\u7684\u7c7b\u578b\u548c\u4f5c\u7528\u57df\u89c4\u5219\uff0c\u5b83\u4e0e\u4e00\u822c\u51fd\u6570\u66f4\u76f8\u8fd1\uff0c\u5728\u4e00\u4e9b\u7f16\u8bd1\u5668\u4e2d\uff0c\u4e00\u65e6\u5173\u8054\u4e0a\u5185\u8054\u6269\u5c55\uff0c\u5c06\u4e0e\u4e00\u822c\u51fd\u6570\u4e00\u6837\u8fdb\u884c\u8c03\u7528\uff0c\u6bd4\u8f83\u65b9\u4fbf\u3002","title":"\u548c\u5b8f\u5b9a\u4e49\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_14","text":"\u6307\u9488\u6709\u7740\u81ea\u5df1\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u662f\u4e00\u4e2a\u53d8\u91cf\u7c7b\u578b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e0d\u4f1a\u50cf\u5176\u4ed6\u53d8\u91cf\u4e00\u6837\u53d8\u5316\uff0c\u800c\u5f15\u7528\u672c\u8d28\u4e0a\u662f\u201c\u53d8\u91cf\u7684\u522b\u540d\u201d\uff0c\u6ca1\u6709\u5360\u7528\u5185\u5b58\u7a7a\u95f4 \u6307\u9488\u5728\u58f0\u660e\u5468\u671f\u5185\u968f\u65f6\u53ef\u80fd\u4f1aNULL\uff0c\u6240\u4ee5\u4f7f\u7528\u65f6\u4e00\u5b9a\u8981\u505a\u68c0\u67e5\uff0c\u9632\u6b62\u51fa\u73b0\u7a7a\u6307\u9488\u3001\u91ce\u6307\u9488\u7684\u60c5\u51b5 \u6307\u9488\u58f0\u660e\u65f6\u53ef\u4ee5 \u6682\u65f6\u4e0d\u521d\u59cb\u5316 \uff0c\u5f15\u7528\u58f0\u660e\u65f6 \u5fc5\u987b\u521d\u59cb\u5316 \u4f7f\u7528 sizeof \u53ef\u4ee5\u6c42\u5f97\u51fa\u572832\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e3a4\u4e2a\u5b57\u8282\uff0c\u800c\u5f15\u7528\u5219\u4e3a\u539f\u5bf9\u8c61\u7684\u5927\u5c0f \u6307\u9488\u53ef\u4ee5\u521d\u59cb\u5316\u4e3a\u4efb\u610f\u6b63\u6574\u6570\u503c\uff0c\u800c\u5f15\u7528\u5fc5\u987b\u521d\u59cb\u5316\u4e3a\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u53d8\u91cf \u53c2\u6570\u4f20\u9012\u65f6\uff0c\u6307\u9488\u9700\u8981\u5148\u8fdb\u884c\u6307\u9488\u8f6c\u4e3a\u5f15\u7528\u7136\u540e\u518d\u4f7f\u7528\uff0c\u800c\u5f15\u7528\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u539f\u5bf9\u8c61 \u6307\u9488\u53ef\u4ee5\u6709 const \u5c5e\u6027\uff0c\u800c\u5f15\u7528\u6ca1\u6709 \u6307\u9488\u53ef\u4ee5\u91cd\u65b0\u8d4b\u503c\uff0c\u800c\u5f15\u7528\u4e0d\u53ef\u4ee5\u66f4\u6539 \u6307\u9488\u53ef\u4ee5\u8fdb\u884c\u591a\u7ea7\u6307\u9488\uff0c\u800c\u5f15\u7528\u53ea\u6709\u4e00\u7ea7 \u6307\u9488\u548c\u5f15\u7528\u8fdb\u884c++\uff08\u81ea\u589e\uff09\u64cd\u4f5c\u7684\u903b\u8f91\u548c\u7ed3\u679c\u90fd\u4e0d\u540c \u5f53\u9700\u8981\u8fd4\u56de\u52a8\u6001\u5185\u5b58\u5206\u914d\u7684\u5bf9\u8c61\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u6307\u9488\u800c\u4e0d\u662f\u5f15\u7528\uff0c\u56e0\u4e3a\u5f15\u7528\u53ef\u80fd\u4f1a\u4ea7\u751f\u5185\u5b58\u6cc4\u6f0f","title":"\u6307\u9488\u548c\u5f15\u7528"},{"location":"cs/pl/c_cpp/basic/#c_3","text":"\u5c06\u57fa\u672c\u7c7b\u578b\u6307\u9488\u5c01\u88c5\u4e3a\u7c7b\u5bf9\u8c61\u6307\u9488\uff0c\u5e76\u5728\u6790\u6784\u51fd\u6570\u91cc\u7f16\u5199delete\u8bed\u53e5\u5220\u9664\u6307\u9488\u6307\u5411\u7684\u5185\u5b58\u7a7a\u95f4\u3002 \u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f \u7a7a\u6307\u9488\u548c\u91ce\u6307\u9488\u7684\u95ee\u9898 \u5bf9\u8c61\u91cd\u590d\u91ca\u653e\u7684\u95ee\u9898 \u5185\u5b58\u6cc4\u6f0f\u7684\u95ee\u9898 auto_ptr \uff08\u5df2\u5f03\u7528\uff09 \u91c7\u7528\u6240\u6709\u6743\u6a21\u5f0f\uff0c\u4efb\u4f55\u4e00\u4e2a new \u7684\u5bf9\u8c61\u53ea\u80fd\u7531\u4e00\u4e2a auto_ptr \u6765\u6307\u5411\uff0c\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u4f1a\u4f7f\u5f97\u539f\u6765\u7684\u6307\u9488\u4e22\u5931\u6307\u5411\u7684\u5bf9\u8c61 unique_ptr \u4e0e auto_ptr \u76f8\u540c\uff0c\u4f46\u662f\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u76f4\u63a5\u62a5\u9519\uff0c\u800c auto_ptr \u4e0d\u4f1a shared_ptr \u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u591a\u4e2a\u6307\u9488\u6307\u5411\u6b64\u5bf9\u8c61\uff0c\u540c\u65f6\u5f53\u6240\u6709\u6307\u5411\u6b64\u5bf9\u8c61\u7684\u6307\u9488\u90fd\u88ab\u6790\u6784\u540e\uff0c\u6b64\u5bf9\u8c61\u5c06\u4f1a\u88ab\u5220\u9664 weak_ptr \u5f31\u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u6307\u5411\u5176\u4ed6\u7684 shared_ptr \u5bf9\u8c61\uff0c\u6b64\u6307\u9488\u4e0d\u4f1a\u5f71\u54cd shared_ptr \u7684\u6790\u6784\u884c\u4e3a\uff0c\u901a\u5e38\u7528\u6765\u907f\u514d\u76f8\u4e92\u6307\u5411\u95ee\u9898","title":"C++\u56db\u4e2a\u667a\u80fd\u6307\u9488"},{"location":"cs/pl/c_cpp/basic/#_15","text":"\u6307\u5411\u88ab\u91ca\u653e\u7684\u6216\u8005\u8bbf\u95ee\u53d7\u9650\u5185\u5b58\u7684\u6307\u9488\u3002 \u9020\u6210\u91ce\u6307\u9488\u7684\u539f\u56e0\uff1a - \u6307\u9488\u53d8\u91cf\u6ca1\u6709\u88ab\u521d\u59cb\u5316\uff08\u5982\u679c\u503c\u4e0d\u5b9a\uff0c\u53ef\u4ee5\u521d\u59cb\u5316\u4e3aNULL\uff09 - \u6307\u9488\u88abfree\u6216\u8005delete\u540e\uff0c\u6ca1\u6709\u7f6e\u4e3aNULL\uff0cfree\u548cdelete\u53ea\u662f\u628a\u6307\u9488\u6240\u6307\u5411\u7684\u5185\u5b58\u7ed9\u91ca\u653e\u6389\uff0c\u5e76\u6ca1\u6709\u628a\u6307\u9488\u672c\u8eab\u5e72\u6389\uff0c\u6b64\u65f6\u6307\u9488\u6307\u5411\u7684\u662f\uff1a\u201c\u5783\u573e\u201d\u5185\u5b58\u3002\u91ca\u653e\u540e\u7684\u6307\u9488\u5e94\u8be5\u88ab\u7f6e\u4e3aNULL\u3002 - \u6307\u9488\u64cd\u4f5c\u8d85\u8d8a\u4e86\u53d8\u91cf\u7684\u4f5c\u7528\u8303\u56f4\uff0c\u6bd4\u5982\u8fd4\u56de\u6307\u5411\u6808\u5185\u5b58\u7684\u6307\u9488\u5c31\u662f\u91ce\u6307\u9488\u3002","title":"\u91ce\u6307\u9488"},{"location":"cs/pl/c_cpp/basic/#newmalloc","text":"\u5728\u4f7f\u7528\u7684\u65f6\u5019 new,delete \u642d\u914d\u4f7f\u7528\uff0cmalloc \u548c free \u642d\u914d\u4f7f\u7528\u3002 \u5c5e\u6027\uff1amalloc/free \u662f\u5e93\u51fd\u6570\uff0c\u9700\u8981\u5934\u6587\u4ef6\u7684\u652f\u6301\uff1bnew/delete \u662f\u5173\u952e\u5b57\uff0c\u9700\u8981\u7f16\u8bd1\u5668\u7684\u652f\u6301 \u53c2\u6570\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u65e0\u9700\u6307\u5b9a\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u7c7b\u578b\u81ea\u884c\u8ba1\u7b97\uff1bmalloc \u5728\u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u9700\u8981\u786e\u5b9a\u6240\u7533\u8bf7\u7a7a\u95f4\u7684\u5927\u5c0f \u8fd4\u56de\u503c\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u7c7b\u578b\u662f\u5bf9\u8c61\u7684\u6307\u9488\u7c7b\u578b\uff0c\u65e0\u9700\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\uff0c\u7b26\u5408\u7c7b\u578b\u5b89\u5168\u7684\u64cd\u4f5c\u7b26\uff1bmalloc \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u662f void* \u7c7b\u578b\uff0c\u9700\u8981\u8fdb\u884c\u5f3a\u5236\u7c7b\u578b\u7684\u8f6c\u6362\uff0c\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7c7b\u578b\u7684\u6307\u9488 \u5206\u914d\u5931\u8d25\uff1anew \u5206\u914d\u5931\u8d25\u65f6\uff0c\u4f1a\u629b\u51fa bad_alloc \u5f02\u5e38\uff0cmalloc \u5206\u914d\u5931\u8d25\u65f6\u8fd4\u56de\u7a7a\u6307\u9488 \u91cd\u8f7d\uff1anew/delete \u652f\u6301\u91cd\u8f7d\uff0cmalloc/free \u4e0d\u80fd\u8fdb\u884c\u91cd\u8f7d \u81ea\u5b9a\u4e49\u7c7b\u578b\u5b9e\u73b0\uff1anew \u9996\u5148\u8c03\u7528 operator new \u51fd\u6570\u7533\u8bf7\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 malloc \u5b9e\u73b0\uff09\uff0c\u7136\u540e\u8c03\u7528\u6784\u9020\u51fd\u6570\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u6700\u540e\u8fd4\u56de\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u6307\u9488\uff1bdelete \u9996\u5148\u8c03\u7528\u6790\u6784\u51fd\u6570\uff0c\u7136\u540e\u8c03\u7528 operator delete \u91ca\u653e\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 free \u5b9e\u73b0\uff09\u3002malloc/free \u65e0\u6cd5\u8fdb\u884c\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u5bf9\u8c61\u7684\u6784\u9020\u548c\u6790\u6784 \u5185\u5b58\u533a\u57df\uff1anew \u64cd\u4f5c\u7b26\u4ece\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e3a\u5bf9\u8c61\u52a8\u6001\u5206\u914d\u5185\u5b58\uff0c\u800c malloc \u51fd\u6570\u4ece\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002\uff08\u81ea\u7531\u5b58\u50a8\u533a\u4e0d\u7b49\u4e8e\u5806\uff09 \u7279\u5f81 new/delete malloc/free \u5206\u914d\u5185\u5b58\u7684\u4f4d\u7f6e \u81ea\u7531\u5b58\u50a8\u533a \u5806 \u5206\u914d\u6210\u529f \u8fd4\u56de\u5b8c\u6574\u7c7b\u578b\u6307\u9488 \u8fd4\u56devoid* \u5206\u914d\u5931\u8d25 \u9ed8\u8ba4\u629b\u51fa\u5f02\u5e38 \u8fd4\u56deNULL \u5206\u914d\u5185\u5b58\u7684\u5927\u5c0f \u7531\u7f16\u8bd1\u5668\u6839\u636e\u7c7b\u578b\u8ba1\u7b97\u5f97\u51fa \u5fc5\u987b\u663e\u5f0f\u6307\u5b9a\u5b57\u8282\u6570 \u5904\u7406\u6570\u7ec4 \u6709\u5904\u7406\u6570\u7ec4\u7684new\u7248\u672c\u548cnew[] \u9700\u8981\u7528\u6237\u8ba1\u7b97\u6570\u7ec4\u7684\u5927\u5c0f\u540e\u8fdb\u884c\u5185\u5b58\u5206\u914d \u4ee5\u5206\u914d\u5185\u5b58\u7684\u6269\u5145 \u65e0\u6cd5\u76f4\u89c2\u5904\u7406 \u4f7f\u7528realloc\u7b80\u5355\u5b8c\u6210 \u662f\u5426\u76f8\u4e92\u8c03\u7528 \u53ef\u4ee5\uff0c\u770b\u5177\u4f53\u7684operator new/delete\u5b9e\u73b0 \u4e0d\u53ef\u8c03\u7528new \u5206\u914d\u5185\u5b58\u65f6\u5185\u5b58\u4e0d\u8db3 \u5ba2\u6237\u80fd\u591f\u5236\u5b9a\u5904\u7406\u51fd\u6570\u6216\u91cd\u65b0\u5236\u5b9a\u5206\u914d\u5668 \u65e0\u6cd5\u901a\u8fc7\u7528\u6237\u4ee3\u7801\u8fdb\u884c\u5904\u7406 \u51fd\u6570\u91cd\u8f7d \u5141\u8bb8 \u4e0d\u5141\u8bb8 \u6784\u9020\u51fd\u6570\u4e0e\u6790\u6784\u51fd\u6570 \u8c03\u7528 \u4e0d\u8c03\u7528","title":"new\u548cmalloc"},{"location":"cs/pl/c_cpp/basic/#_16","text":"","title":"\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_17","text":"\u540d\u5b57\u548c\u7c7b\u540d\u76f8\u540c \u6ca1\u6709\u8fd4\u56de\u503c \u751f\u6210\u7c7b\u7684\u81ea\u52a8\u6267\u884c\uff0c\u4e0d\u9700\u8981\u8c03\u7528","title":"\u6784\u9020\u51fd\u6570\u7684\u7279\u5f81"},{"location":"cs/pl/c_cpp/basic/#_18","text":"\u56e0\u4e3a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u5728\u6784\u9020\u51fd\u6570\u671f\u95f4\u521b\u5efa\u7684\uff0c\u6ca1\u6709\u865a\u51fd\u6570\u8868\u5c31\u6ca1\u6709\u529e\u6cd5\u8c03\u7528\u865a\u51fd\u6570","title":"\u4e3a\u4ec0\u4e48\u6784\u9020\u51fd\u6570\u4e0d\u53ef\u4ee5\u662f\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_19","text":"","title":"\u6790\u6784\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_20","text":"\u5982\u679c\u4e00\u4e2a\u7c7b\u4e2d\u6709\u6307\u9488\uff0c\u4e14\u8fd9\u4e2a\u6307\u9488\u6307\u5411\u4e86\u4e00\u6bb5\u7531\u6b64\u7c7b\u7684\u5b9e\u4f8b\u8bf7\u6c42\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u90a3\u4e48\u9700\u8981\u7531\u6790\u6784\u51fd\u6570\u6765\u5b9e\u73b0\u5bf9\u8fd9\u5757\u533a\u57df\u7684\u91ca\u653e\uff0c\u5426\u5219\u4f1a\u9020\u6210\u5185\u5b58\u6cc4\u6f0f","title":"\u6790\u6784\u51fd\u6570\u7684\u4f5c\u7528"},{"location":"cs/pl/c_cpp/basic/#c_4","text":"\u515a\u8fd9\u4e2a\u7c7b\u9700\u8981\u4f5c\u4e3a\u7236\u7c7b\u6d3e\u751f\u7684\u65f6\u5019\uff0c\u5982\u679c\u7a0b\u5e8f\u5f97\u5230\u7684\u662f\u6b64\u7236\u7c7b\u7684\u6307\u9488\uff0c\u90a3\u4e48\u6b64\u65f6\u5c31\u65e0\u6cd5\u6790\u6784\u5b50\u7c7b\uff0c\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f","title":"C++\u4e3a\u4ec0\u4e48\u4e60\u60ef\u628a\u6790\u6784\u51fd\u6570\u5b9a\u4e49\u4e3a\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#c_5","text":"\u865a\u51fd\u6570\u9700\u8981\u989d\u5916\u7684\u865a\u51fd\u6570\u8868\u548c\u865a\u51fd\u6570\u8868\u6307\u9488\uff0c\u5bf9\u4e8e\u4e0d\u4f1a\u6d3e\u751f\u7684\u7c7b\u800c\u8a00\uff0c\u6d6a\u8d39\u7a7a\u95f4","title":"C++\u4e3a\u4ec0\u4e48\u9ed8\u8ba4\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_21","text":"\u5bf9\u4e8e\u7c7b\u4e2d\u51fd\u6570\u7684\u91cd\u8f7d\u6216\u8005\u91cd\u5199\u800c\u8a00\uff0c\u91cd\u8f7d\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u7c7b\u7684\u5185\u90e8\uff0c\u91cd\u5199\u53d1\u751f\u5728\u4e0d\u540c\u7684\u7c7b\u4e4b\u95f4\uff0c\u5b50\u7c7b\u548c\u7236\u7c7b\u4e4b\u95f4 \u91cd\u8f7d\u7684\u51fd\u6570\u9700\u8981\u4e0e\u539f\u51fd\u6570\u6709\u76f8\u540c\u7684\u51fd\u6570\u540d\u3001\u4e0d\u540c\u7684\u53c2\u6570\u5217\u8868\uff0c\u4e0d\u5173\u6ce8\u51fd\u6570\u7684\u8fd4\u56de\u503c\u7c7b\u578b\uff1b\u91cd\u5199\u7684\u51fd\u6570\u7684\u51fd\u6570\u540d\u3001\u53c2\u6570\u5217\u8868\u548c\u8fd4\u56de\u503c\u7c7b\u578b\u90fd\u9700\u8981\u548c\u539f\u51fd\u6570\u76f8\u540c\uff0c\u7236\u7c7b\u4e2d\u88ab\u91cd\u5199\u7684\u51fd\u6570\u9700\u8981\u6709 virtual \u4fee\u9970 virtual \u5173\u952e\u5b57\uff1a\u91cd\u5199\u7684\u51fd\u6570\u57fa\u7c7b\u4e2d\u5fc5\u987b\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\uff0c\u91cd\u8f7d\u7684\u51fd\u6570\u53ef\u4ee5\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\u4e5f\u53ef\u4ee5\u6ca1\u6709","title":"\u91cd\u8f7d\u548c\u91cd\u5199\uff08\u8986\u76d6\uff09"},{"location":"cs/pl/c_cpp/basic/#_22","text":"","title":"\u9501"},{"location":"cs/pl/c_cpp/basic/#c_6","text":"\u4e92\u65a5\u9501\uff1a\u5bf9\u4e8e\u540c\u4e00\u4e2a\u53d8\u91cf\u53ea\u5141\u8bb8\u4e00\u4e2a\u7ebf\u7a0b\u8fdb\u884c\u8bfb\u5199\uff0c\u82e5\u4e0d\u6ee1\u8db3\u65f6\u5219\u4f1a\u8fdb\u5165\u963b\u585e\uff0c\u5e76\u4e14CPU\u4e0d\u4f1a\u8fdb\u5165\u5fd9\u7b49 \u6761\u4ef6\u9501\uff1a\u5f53\u6ee1\u8db3\u67d0\u4e2a\u6761\u4ef6\u65f6\uff0c\u518d\u5524\u9192\u6b64\u7ebf\u7a0b\uff0c\u5426\u5219\u4e00\u76f4\u963b\u585e\u72b6\u6001 \u81ea\u65cb\u9501\uff1a\u4e0d\u65ad\u7684\u68c0\u67e5\u9501\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\uff0c\u4e0d\u91ca\u653eCPU\uff0c\u6bd4\u8f83\u8017\u8d39CPU \u8bfb\u5199\u9501\uff1a\u5141\u8bb8\u6709\u8bfb\u9501\u7684\u65f6\u5019\u518d\u52a0\u8bfb\u9501\uff0c\u4f46\u662f\u6709\u5199\u9501\u65f6\u4e0d\u518d\u80fd\u52a0\u4efb\u4f55\u9501 \u9012\u5f52\u9501\uff1a\u5141\u8bb8\u540c\u4e00\u4e2a\u7ebf\u7a0b\u5bf9\u540c\u4e00\u4e2a\u9501\u8fdb\u884c\u591a\u6b21\u52a0\u9501","title":"C++\u4e2d\u9501\u7684\u7c7b\u578b"},{"location":"cs/pl/c_cpp/basic/#_23","text":"","title":"\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_24","text":"\u865a\u51fd\u6570\u7531 virtual \u6807\u8bb0 \u666e\u901a\u7684\u865a\u51fd\u6570\u4ecd\u7136\u9700\u8981\u8fdb\u884c\u5b9e\u73b0\uff0c\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u53ef\u4ee5\u91cd\u65b0\u5b9e\u73b0\u6b64\u51fd\u6570\u4e5f\u53ef\u4ee5\u4e0d\u5b9e\u73b0","title":"\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_25","text":"\u7eaf\u865a\u51fd\u6570\u5728\u666e\u901a\u7684\u865a\u51fd\u6570\u540e\uff0c\u52a0\u4e0a =0 \u5f53\u4e00\u4e2a\u7c7b\u62e5\u6709\u7eaf\u865a\u51fd\u6570\u540e\uff0c\u5219\u6b64\u7c7b\u53d8\u6210\u62bd\u8c61\u7c7b\uff0c \u4e0d\u53ef\u4ee5\u8fdb\u884c\u5b9e\u4f8b\u5316 \u7eaf\u865a\u51fd\u6570\u4e0d\u9700\u8981\u5b9e\u73b0\uff0c\u4e14\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u51fd\u6570\uff0c\u5426\u5219\u6d3e\u751f\u7c7b\u4e5f\u662f\u62bd\u8c61\u7c7b\uff0c\u4e0d\u53ef\u4ee5\u5b9e\u4f8b\u5316","title":"\u7eaf\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_26","text":"\u5728\u7c7b\u4e2d\u4fdd\u5b58\u4e00\u5f20\u865a\u51fd\u6570\u8868\uff0c\u8868\u5185\u4fdd\u5b58\u4e86\u51fd\u6570\u6240\u5728\u7684\u4ee3\u7801\u6bb5 \u5f53\u5176\u4ed6\u7c7b\u7ee7\u627f\u6b64\u7c7b\u65f6\uff0c\u590d\u5236\u4e00\u4efd\u6b64\u865a\u51fd\u6570\u8868\u3002\u5f53\u5176\u4e2d\u7684\u865a\u51fd\u6570\u8fdb\u884c\u5b9e\u73b0\u540e\uff0c\u5c06\u865a\u51fd\u6570\u8868\u4e2d\u6b64\u51fd\u6570\u7684\u6307\u9488\u6240\u6307\u5411\u65b0\u7684\u51fd\u6570\u7684\u5730\u5740 \u5b9a\u4e49\u7c7b\u7684\u5b9e\u4f8b\u7684\u65f6\u5019\uff0c\u5728\u7c7b\u7684\u5f00\u5934\u4fdd\u5b58\u4e86\u4e00\u4e2a\u6307\u5411\u6b64\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\uff0c\u5f53\u9700\u8981\u8c03\u7528\u6b64\u51fd\u6570\u7684\u65f6\u5019\uff0c\u901a\u8fc7\u6b64\u6307\u9488\u627e\u5230\u5bf9\u5e94\u7684\u51fd\u6570\u5730\u5740","title":"\u865a\u51fd\u6570\u7684\u5b9e\u73b0\u539f\u7406"},{"location":"cs/pl/c_cpp/basic/#_27","text":"\u9759\u6001\u51fd\u6570\u5728\u7f16\u8bd1\u65f6\u5c31\u786e\u5b9a\u4e86\u8fd0\u884c\u7684\u65f6\u673a\uff0c\u800c\u865a\u51fd\u6570\u5219\u662f\u5728\u8fd0\u884c\u7684\u8fc7\u7a0b\u4e2d\u52a8\u6001\u7684\u5f97\u77e5\u865a\u51fd\u6570\u5730\u5740","title":"\u9759\u6001\u51fd\u6570\u548c\u865a\u51fd\u6570\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#strcpymemcpy","text":"\u590d\u5236\u7684\u5185\u5bb9\u4e0d\u540c\u3002strcpy\u53ea\u80fd\u590d\u5236\u5b57\u7b26\u4e32\uff0c\u800cmemcpy\u53ef\u4ee5\u590d\u5236\u4efb\u610f\u5185\u5bb9\uff0c\u4f8b\u5982\u5b57\u7b26\u6570\u7ec4\u3001\u6574\u578b\u3001\u7ed3\u6784\u4f53\u3001\u7c7b\u7b49\u3002\u4f01\u4e1a\u4e2d\u4f7f\u7528memcpy\u5f88\u5e73\u5e38\uff0c\u56e0\u4e3a\u9700\u8981\u62f7\u8d1d\u5927\u91cf\u7684\u7ed3\u6784\u4f53\u53c2\u6570\u3002memcpy\u901a\u5e38\u4e0ememset\u51fd\u6570\u914d\u5408\u4f7f\u7528\u3002 \u590d\u5236\u7684\u65b9\u6cd5\u4e0d\u540c\u3002strcpy\u4e0d\u9700\u8981\u6307\u5b9a\u957f\u5ea6\uff0c\u4ed6\u9047\u5230\u88ab\u590d\u5236\u5b57\u7b26\u7684\u4e32\u7ed3\u675f\u7b26\"\\0\"\u624d\u7ed3\u675f\uff0c\u6240\u4ee5\u5bb9\u6613\u6ea2\u51fa\u3002memcpy\u5219\u662f\u6839\u636e\u5176\u7b2c\u4e09\u4e2a\u53c2\u6570\u51b3\u5b9a\u590d\u5236\u7684\u957f\u5ea6\u3002\u56e0\u6b64strcpy\u4f1a\u590d\u5236\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u7b26\"\\0\"\uff0c\u800cmemcpy\u5219\u4e0d\u4f1a\u590d\u5236\u3002","title":"strcpy\u548cmemcpy\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_28","text":"","title":"\u961f\u5217\u548c\u5806\u6808\u7684\u6a21\u62df"},{"location":"cs/pl/c_cpp/basic/#_29","text":"\u5c06\u4e24\u4e2a\u5806\u6808\u547d\u540d\u4e3aA\u3001B \u82e5B\u5806\u6808\u4e3a\u7a7a\uff0c\u5219\u5c06A\u5806\u6808\u7684\u6240\u6709\u503c\u90fd\u63a8\u5165B\u4e2d \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u63a8\u51fa\uff0c\u5219\u4eceB\u4e2d\u63a8\u51fa","title":"\u7528\u4e24\u4e2a\u5806\u6808\u6a21\u62df\u961f\u5217"},{"location":"cs/pl/c_cpp/basic/#_30","text":"\u5c06\u4e24\u4e2a\u961f\u5217\u547d\u540d\u4e3aA\u3001B \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u5f39\u51fa\uff0c\u5219\u5c06A\u4e2d\u7684\u503c\u9664\u4e86\u6700\u540e\u4e00\u4e2a\uff0c\u5176\u4ed6\u90fd\u63a8\u5165\u5230B\u4e2d\uff0c\u4e14\u4ec5\u7559\u4e0b\u4e00\u4e2a\u503c\uff0c\u7136\u540e\u5f39\u51fa\u8fd9\u4e2a\u503c\uff0c\u5e76\u5c06A\u3001B\u961f\u5217\u547d\u540d\u4e3aA\u3001B\u961f\u5217","title":"\u7528\u4e24\u4e2a\u961f\u5217\u6a21\u62df\u5806\u6808"},{"location":"cs/pl/c_cpp/basic/#_31","text":"\u5982\u4f55\u786e\u5b9a\u4e00\u4e2a\u503c\u662f\u5de6\u503c\u8fd8\u662f\u53f3\u503c \u63d0\u4f9b\u4e86\u5730\u5740\u7684\u4e3a\u5de6\u503c\uff0c\u5de6\u503c\u53ef\u4ee5\u6ca1\u6709\u503c\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u5730\u5740 \u63d0\u4f9b\u4e86\u503c\u7684\u4e3a\u53f3\u503c\uff0c\u53f3\u503c\u53ef\u4ee5\u6ca1\u6709\u5730\u5740\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u503c \u53f3\u503c\u5f15\u7528\u7684\u529f\u80fd \u79fb\u52a8\u8bed\u53e5 \u5b8c\u7f8e\u8f6c\u53d1","title":"\u53f3\u503c\u5f15\u7528"},{"location":"cs/pl/c_cpp/basic/#stl","text":"","title":"STL"},{"location":"cs/pl/c_cpp/basic/#vector","text":"","title":"vector"},{"location":"cs/pl/c_cpp/basic/#_32","text":"\u5f53\u7a7a\u95f4\u4e0d\u8db3\u7684\u65f6\u5019\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09","title":"\u6269\u5bb9\u89c4\u5219"},{"location":"cs/pl/c_cpp/basic/#_33","text":"\u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002","title":"\u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9"},{"location":"cs/pl/c_cpp/basic/#msvc15gcc2","text":"\u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4","title":"MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904"},{"location":"cs/pl/c_cpp/basic/#clear","text":"\u590d\u6742\u5ea6\u4e0e\u5df2\u6709\u7684\u5143\u7d20\u6570\u91cf\u6210\u7ebf\u6027\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u5143\u7d20\u90fd\u9700\u8981\u6790\u6784 clear\u540e\uff0c\u5e76\u4e0d\u4f1a\u6539\u53d8vector\u7684\u5bb9\u91cf\u4e0a\u9650\uff0c\u53ea\u4f1a\u66f4\u65b0vector\u5185\u7684size\u5927\u5c0f","title":"clear\u7684\u590d\u6742\u5ea6"},{"location":"cs/pl/c_cpp/basic/#unordered_mapmap","text":"map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u7ea2\u9ed1\u6811 \uff08\u6240\u6709\u5143\u7d20\u90fd\u662f\u6709\u5e8f\u7684\uff09\uff0cunordered_map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u54c8\u5e0c\u8868 \uff08\u5143\u7d20\u7684\u6392\u5217\u662f\u65e0\u5e8f\u7684\uff09","title":"unordered_map\u548cmap"},{"location":"cs/pl/c_cpp/basic/#map","text":"\u4f18\u70b9\uff1a \u6709\u5e8f \u6027\uff0c\u8fd9\u662fmap\u7ed3\u6784\u6700\u5927\u7684\u4f18\u70b9\uff0c\u5176\u5143\u7d20\u7684\u6709\u5e8f\u6027\u5728\u5f88\u591a\u5e94\u7528\u4e2d\u90fd\u4f1a\u7b80\u5316\u5f88\u591a\u7684\u64cd\u4f5c\uff1b\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7ea2\u9ed1\u6811\u4f7f\u5f97map\u7684\u5f88\u591a\u64cd\u4f5c\u5728 \\(logn\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e0b\u5c31\u53ef\u4ee5\u5b9e\u73b0\uff0c\u56e0\u6b64 \u6548\u7387 \u975e\u5e38\u9ad8 \u7f3a\u70b9\uff1a \u7a7a\u95f4\u5360\u7528\u7387\u9ad8 \uff0c\u56e0\u4e3amap\u5185\u90e8\u5b9e\u73b0\u4e86\u7ea2\u9ed1\u6811\uff0c\u867d\u7136\u63d0\u9ad8\u4e86\u8fd0\u884c\u6548\u7387\uff0c\u4f46\u662f\u56e0\u4e3a \u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u9700\u8981\u989d\u5916\u4fdd\u5b58\u7236\u8282\u70b9\u3001\u5b69\u5b50\u8282\u70b9\u548c\u7ea2/\u9ed1\u6027\u8d28 \uff0c\u4f7f\u5f97\u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u5360\u7528\u5927\u91cf\u7684\u7a7a\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e\u90a3\u4e9b\u6709\u987a\u5e8f\u8981\u6c42\u7684\u95ee\u9898\uff0c\u7528map\u4f1a\u66f4\u9ad8\u6548\u4e00\u4e9b","title":"map"},{"location":"cs/pl/c_cpp/basic/#unordered_map","text":"\u4f18\u70b9\uff1a\u56e0\u4e3a\u5185\u90e8\u5b9e\u73b0\u4e86\u54c8\u5e0c\u8868\uff0c\u56e0\u6b64\u5176 \u67e5\u627e\u901f\u5ea6 \u975e\u5e38\u5feb \u7f3a\u70b9\uff1a\u54c8\u5e0c\u8868\u7684 \u5efa\u7acb\u6bd4\u8f83\u8017\u8d39\u65f6\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e \u67e5\u627e\u95ee\u9898 \uff0cunordered_map\u4f1a\u66f4\u52a0\u9ad8\u6548\u4e00\u4e9b","title":"unordered_map"},{"location":"cs/pl/c_cpp/basic/#_34","text":"\u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001\u662f\u9762\u5411\u5bf9\u8c61\u7684\u4e09\u5927\u7279\u6027, \u8fd9\u4e9b\u7279\u6027\u4f7f\u5f97\u9762\u5411\u5bf9\u8c61\u53ef\u4ee5\u8bbe\u8ba1\u51fa\u4f4e\u8026\u5408\u7684\u7cfb\u7edf, \u4ece\u800c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027, \u4f7f\u7cfb\u7edf\u66f4\u6613\u7ef4\u62a4, \u529f\u80fd\u66f4\u6613\u590d\u7528\u3001\u62d3\u5c55, \u4f46\u662f\u5176\u6027\u80fd\u6bd4\u9762\u5411\u8fc7\u7a0b\u8981\u4f4e\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff0c\u5373OOP\uff0c\u662f\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u6ee1\u8db3\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u8bed\u8a00\uff0c\u4e00\u822c\u4f1a\u63d0\u4f9b\u7c7b\u3001\u5c01\u88c5\u3001\u7ee7\u627f\u7b49\u8bed\u6cd5\u548c\u6982\u5ff5\u6765\u8f85\u52a9\u6211\u4eec\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002 \u7c7b\u578b\u88ab\u8bbe\u8ba1\u4e3a\u5c06\u6570\u636e\u548c\u884c\u4e3a\u6346\u7ed1\u5728\u4e00\u8d77\u7684\u4e00\u79cd\u4e1c\u897f\uff0c\u6570\u636e\u548c\u884c\u4e3a\u88ab\u79f0\u4e4b\u4e3a\u7c7b\u578b\u7684\u6210\u5458\u3002\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u7c7b\u578b\u7684\u5b9e\u4f8b\uff0c\u4e0d\u540c\u7684\u5b9e\u4f8b\u5305\u542b\u4e0d\u540c\u7684\u6570\u636e\uff0c\u4ece\u800c\u5176\u8868\u73b0\u51fa\u6765\u7684\u884c\u4e3a\u4e5f\u4f1a\u4e0d\u540c\uff0c\u5c3d\u7ba1\u5176\u4ee3\u7801\u662f\u4e00\u6837\u7684\u3002 \u5c01\u88c5\u4f7f\u5f97\u7c7b\u7684\u6210\u5458\u5f97\u4ee5\u6709\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u4e00\u4e9b\u6210\u5458\u53ea\u5728\u7c7b\u578b\u7684\u5185\u90e8\u4f7f\u7528\uff0c\u88ab\u79f0\u4e4b\u4e3a\u79c1\u6709\u7684\uff08private\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u6d3e\u751f\u7c7b\u578b\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u53d7\u4fdd\u62a4\u7684\uff08protected\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u4efb\u4f55\u4e1c\u897f\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u516c\u5f00\u7684\uff08public\uff09\u3002\u800c\u67d0\u4e9b\u8bed\u8a00\u8fd8\u63d0\u4f9b\u4e86\u5185\u90e8\u7684\uff08internal\uff09\u8fd9\u6837\u7684\u8bbf\u95ee\u4fee\u9970\u7b26\u6765\u6807\u8bc6\u4e00\u4e9b\u53ea\u80fd\u88ab\u540c\u4e00\u4e2a\u7a0b\u5e8f\u96c6\u6216\u8005\u5305\u4f7f\u7528\u7684\u6210\u5458\u3002 \u7ee7\u627f\u53ef\u4ee5\u4ece\u4e00\u4e2a\u73b0\u6709\u7c7b\u578b\u6d3e\u751f\u51fa\u65b0\u7684\u7c7b\u578b\u6765\uff0c\u6d3e\u751f\u7c7b\u7ee7\u627f\u4e86\u57fa\u7c7b\u7684\u6240\u6709\u6210\u5458\uff0c\u4e5f\u53ef\u4ee5\u65b0\u589e\u53ea\u5c5e\u4e8e\u81ea\u5df1\u7684\u6210\u5458\u3002\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\uff0c\u6d3e\u751f\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u53ef\u4ee5\u88ab\u5f53\u505a\u57fa\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u6765\u4f7f\u7528\u3002 \u865a\u65b9\u6cd5\u4e3a\u6d3e\u751f\u7c7b\u4fee\u6539\u57fa\u7c7b\u7684\u884c\u4e3a\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9014\u5f84\uff0c\u901a\u8fc7\u91cd\u5199\uff08override\uff09\u865a\u65b9\u6cd5\u53ef\u4ee5\u4fee\u6539\u57fa\u7c7b\u67d0\u4e9b\u65b9\u6cd5\u7684\u884c\u4e3a\u3002\u5f53\u6d3e\u751f\u7c7b\u5b9e\u4f8b\u88ab\u5f53\u505a\u57fa\u7c7b\u5b9e\u4f8b\u6765\u4f7f\u7528\u65f6\uff0c\u8fd9\u4e00\u884c\u4e3a\u7684\u533a\u522b\u5c06\u4f1a\u88ab\u4f53\u73b0\u51fa\u6765\uff0c\u8fd9\u79cd\u5728\u8fd0\u884c\u65f6\u4e0d\u540c\u7c7b\u578b\u7684\u5b9e\u4f8b\u5728\u540c\u6837\u7684\u4ee3\u7801\u4e2d\u5448\u73b0\u51fa\u5b8c\u5168\u4e0d\u540c\u884c\u4e3a\u7684\u73b0\u8c61\u88ab\u79f0\u4e4b\u4e3a\u591a\u6001\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u6700\u521d\u662f\u4e3a\u4e86\u89e3\u51b3GUI\u7a0b\u5e8f\u8bbe\u8ba1\u95ee\u9898\u6240\u63d0\u51fa\u7684\uff0c\u540e\u6765\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u88ab\u53d1\u73b0\u4e5f\u6bd4\u8f83\u9002\u5408\u7528\u4e8e\u8bb8\u591a\u7279\u5b9a\u9886\u57df\u7684\u5f00\u53d1\u3002\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u662f\u76ee\u524d\u8fd0\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u4ece\u800c\u4e5f\u4ea7\u751f\u4e86\u975e\u5e38\u591a\u7684\u89e3\u51b3\u4ee3\u7801\u590d\u7528\u7684\u6280\u5de7\uff0c\u5176\u4e2d\u76f8\u5f53\u4e00\u90e8\u5206\u6280\u5de7\u5728\u7a0b\u5e8f\u4e2d\u53cd\u590d\u51fa\u73b0\u800c\u88ab\u63d0\u70bc\u4e3a\u8bbe\u8ba1\u6a21\u5f0f\u3002","title":"\u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4f18\u70b9\uff1f"},{"location":"cs/pl/c_cpp/basic/#static_2","text":"\u9690\u85cf\u3002\u5f53\u6211\u4eec\u540c\u65f6\u7f16\u8bd1\u591a\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u6240\u6709\u672a\u52a0static\u7684\u5168\u5c40\u53d8\u91cf\u548c\u51fd\u6570\u90fd\u5177\u6709\u5168\u5c40\u53ef\u89c1\u6027\u3002\u6240\u4ee5\u4f7f\u7528static\u5728\u4e0d\u540c\u7684\u6587\u4ef6\u4e2d\u5b9a\u4e49\u540c\u540d\u53d8\u91cf\u548c\u51fd\u6570\uff0c\u4e0d\u9700\u8981\u62c5\u5fc3\u547d\u540d\u51b2\u7a81\u3002 \u4fdd\u6301\u53d8\u91cf\u5185\u5bb9\u7684\u6301\u4e45\u3002\u5b58\u50a8\u5728\u9759\u6001\u6570\u636e\u533a\u7684\u53d8\u91cf\u4f1a\u5728\u7a0b\u5e8f\u521a\u5f00\u59cb\u8fd0\u884c\u65f6\u5c31\u5b8c\u6210\u521d\u59cb\u5316\uff0c\u4e5f\u662f\u552f\u4e00\u7684\u4e00\u6b21\u521d\u59cb\u5316\uff0c\u5171\u6709\u4e24\u79cd\u53d8\u91cf\u5b58\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5168\u5c40\u53d8\u91cf\u548cstatic\u3002 \u9ed8\u8ba4\u521d\u59cb\u5316\u4e3a0\u3002\u5168\u5c40\u53d8\u91cf\u4e5f\u5177\u6709\u8fd9\u4e2a\u5c5e\u6027\uff0c\u56e0\u4e3a\u5168\u5c40\u53d8\u91cf\u4e5f\u5b58\u50a8\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5728\u9759\u6001\u5b58\u50a8\u533a\u5185\uff0c\u6240\u6709\u5b57\u8282\u7684\u9ed8\u8ba4\u503c\u65f60x00\uff0c\u8fd9\u4e00\u7279\u70b9\u53ef\u4ee5\u51cf\u5c11\u5de5\u4f5c\u91cf\u3002","title":"static\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f"},{"location":"cs/pl/c_cpp/basic/#const_1","text":"\u4e0d\u8981\u4e00\u542c\u5230const\u5c31\u8bf4\u662f\u5e38\u91cf\uff0c\u5e94\u8be5\u8bf4const\u4fee\u9970\u7684\u5185\u5bb9\u4e0d\u53ef\u6539\u53d8\u3002\u5b9a\u4e49\u5e38\u91cf\u53ea\u662f\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u8fd8\u6709const\u6570\u636e\u6210\u5458\uff0c\u53c2\u6570\uff0c\u8fd4\u56de\u503c\uff0c\u6210\u5458\u51fd\u6570\u7b49\uff0c\u88abconst\u4fee\u9970\u7684\u4e1c\u897f\u90fd\u53d7\u5230\u4e86\u5f3a\u5236\u4fdd\u62a4\uff0c\u53ef\u4ee5\u9884\u9632\u610f\u5916\u53d8\u52a8\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u5065\u58ee\u6027\u3002","title":"const\u6709\u4ec0\u4e48\u7528\uff1f"},{"location":"cs/pl/c_cpp/basic/#cc","text":"C\u662f\u4f7f\u7528\u5b8f#define\u5b9a\u4e49\uff0cC++\u4f7f\u7528\u66f4\u597d\u7684const\u5b9a\u4e49\u3002 const\u662f\u6709\u6570\u636e\u7c7b\u578b\u7684\uff0c\u800cdefine\u6ca1\u6709\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9\u524d\u8005\u8fdb\u884c\u9759\u6001\u7c7b\u578b\u5b89\u5168\u68c0\u67e5\uff0c\u5bf9\u540e\u8005\u4ec5\u4ec5\u662f\u5b57\u7b26\u66ff\u6362\uff0c\u6ca1\u6709\u68c0\u67e5\uff0c\u4f1a\u4ea7\u751f\u9519\u8bef\uff08\u8fb9\u9645\u6548\u5e94\uff09\u3002 \u6709\u4e9b\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9const\u8fdb\u884c\u8c03\u8bd5\uff0c\u800cdefine\u4e0d\u884c\u3002","title":"C\u548cC++\u5404\u81ea\u662f\u5982\u4f55\u5b9a\u4e49\u5e38\u91cf\u7684\uff1f\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f"},{"location":"cs/pl/c_cpp/basic/#cconstdefine","text":"const\u65e0\u6cd5\u66ff\u4ee3\u5b8f\u4f5c\u4e3a\u536b\u54e8\u6765\u9632\u6b62\u6587\u4ef6\u7684\u91cd\u590d\u5305\u542b\u3002","title":"\u65e2\u7136C++\u6709\u66f4\u597d\u7684const\u4e3a\u5565\u8fd8\u8981define\uff1f"},{"location":"cs/pl/c_cpp/basic/#include-includeah","text":"\u524d\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u6807\u51c6\u5e93\u8def\u5f84\u5f00\u59cb\u641c\u7d22\uff0c\u540e\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u7528\u6237\u7684\u5de5\u4f5c\u8def\u5f84\u5f00\u59cb\u641c\u7d22\u3002","title":"#include\u548c# include\"a.h\"\u6709\u4ec0\u4e48\u533a\u522b\uff1f"},{"location":"cs/pl/c_cpp/basic/#c_7","text":"\u591a\u6001\u6027\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7ee7\u5c01\u88c5\u548c\u7ee7\u627f\u4e4b\u540e\u7684\u7b2c\u4e09\u4e2a\u57fa\u672c\u7279\u5f81\u3002 \u4ed6\u5728\u8fd0\u884c\u65f6\u51fa\u73b0\u7684\u591a\u6001\u6027\u901a\u8fc7\u6d3e\u751f\u7c7b\u548c\u865a\u51fd\u6570\u5b9e\u73b0\uff0c\u57fa\u7c7b\u548c\u6d3e\u751f\u7c7b\u4e2d\u4f7f\u7528\u540c\u6837\u7684\u51fd\u6570\u540d\uff0c\u5b8c\u6210\u4e0d\u540c\u7684\u64cd\u4f5c\u5177\u4f53\u5b9e\u73b0\u3002 \u591a\u6001\u6027\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u7ec4\u7ec7\u6027\u548c\u53ef\u8bfb\u6027\uff0c\u865a\u51fd\u6570\u5219\u6839\u636e\u7c7b\u578b\u7684\u4e0d\u540c\u6765\u8fdb\u884c\u4e0d\u540c\u7684\u9694\u79bb\u3002","title":"C++\u4ec0\u4e48\u662f\u591a\u6001\u6027\uff1f\u5982\u4f55\u4f53\u73b0\u7684\uff1f"},{"location":"cs/pl/c_cpp/basic/#_35","text":"\u5728\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u786e\u5b9a\u4e0b\u6765\uff0c\u6211\u4eec\u79f0\u4e4b\u4e3a\u9759\u6001\u7279\u6027\u3002\u53cd\u4e4b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u8fd0\u884c\u7684\u65f6\u5019\u786e\u5b9a\uff0c\u79f0\u4e4b\u4e3a\u52a8\u6001\u7279\u6027\u3002C++\u4e2d\uff0c\u865a\u51fd\u6570\uff0c\u62bd\u8c61\u57fa\u7c7b\uff0c\u52a8\u6001\u7ed1\u5b9a\u548c\u591a\u6001\u6784\u6210\u4e86\u51fa\u8272\u7684\u52a8\u6001\u7279\u6027\u3002","title":"\u4ec0\u4e48\u662f\u52a8\u6001\u7279\u6027\uff1f"},{"location":"cs/pl/c_cpp/basic/#c_8","text":"\u5c01\u88c5\u6765\u6e90\u4e8e\u4fe1\u606f\u9690\u85cf\u7684\u8bbe\u8ba1\u7406\u5ff5\uff0c\u662f\u901a\u8fc7\u7279\u6027\u548c\u884c\u4e3a\u7684\u7ec4\u5408\u6765\u521b\u5efa\u65b0\u6570\u636e\u7c7b\u578b\u8ba9\u63a5\u53e3\u548c\u67d0\u4e2a\u5b9e\u73b0\u76f8\u9694\u79bb\u3002 C++\u662f\u901a\u8fc7\u7c7b\u6765\u5b9e\u73b0\u7684\uff0c\u5c01\u88c5\u4e3a\u4e86\u4f7f\u7c7b\u4e2d\u6210\u5458\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u6709\u4e09\u4e2a\u5173\u952e\u5b57(balabalabala)","title":"\u4ec0\u4e48\u662f\u5c01\u88c5\uff1fC++\u4e2d\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},{"location":"cs/pl/c_cpp/basic/#rtti","text":"RTT\u662f\u6307\u8fd0\u884c\u65f6\u7c7b\u578b\u8bc6\u522b\uff08Run-time type identification\uff09\u5728\u53ea\u6709\u4e00\u4e2a\u6307\u5411\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u65f6\u786e\u5b9a\u4e00\u4e2a\u5bf9\u8c61\u7684\u51c6\u786e\u7c7b\u578b\u3002","title":"\u4ec0\u4e48\u662fRTTI\uff1f"},{"location":"cs/pl/c_cpp/basic/#_36","text":"\u6df1\u6d45\u62f7\u8d1d\u5173\u952e\u5728\u4e8e\u6709\u6ca1\u6709\u62f7\u8d1d\u5206\u914d\u7ed9\u6210\u5458\u7684\u8d44\u6e90\uff0c\u4f8b\u5982\u7ed9\u6307\u9488\u53d8\u91cf\u5206\u914d\u5185\u5b58\u3002\u6d45\u62f7\u8d1d\u53ea\u662f\u7ed9\u6210\u5458\u7b80\u5355\u8d4b\u503c\uff0c\u800c\u6df1\u62f7\u8d1d\u4e0d\u4ec5\u8d4b\u503c\uff0c\u8fd8\u5206\u914d\u8d44\u6e90\u3002 \u7c7b\u4e2d\u9ed8\u8ba4\u7684\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u548c\u8d4b\u503c\u6784\u9020\u51fd\u6570\u90fd\u662f\u6d45\u62f7\u8d1d\uff0c\u5f53\u7c7b\u7684\u6210\u5458\u53d8\u91cf\u4e2d\u51fa\u73b0\u6307\u9488\u53d8\u91cf\u65f6\uff0c\u6700\u597d\u4f7f\u7528\u6df1\u62f7\u8d1d\uff0c\u907f\u514d\u5185\u5b58\u7a7a\u95f4\u591a\u6b21\u91ca\u653e\u7684\u95ee\u9898\u51fa\u73b0\u3002","title":"\u4ec0\u4e48\u662f\u6df1\u6d45\u62f7\u8d1d\uff1f"},{"location":"cs/pl/c_cpp/basic/#_37","text":"\u4f4d\u7f6e\uff1a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u865a\u51fd\u6570\u8868\u6240\u5728\u4f4d\u7f6e\u7684\u5730\u5740\u3002\u865a\u51fd\u6570\u8868\u6307\u9488\u5c5e\u4e8e\u5bf9\u8c61\u5b9e\u4f8b\u3002\u56e0\u800c\u901a\u8fc7new \u51fa\u6765\u7684\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u5806\uff0c\u58f0\u540d\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u6808\u3002 \u865a\u51fd\u6570\u8868\u7684\u5b58\u5728\u662f\u7f16\u8bd1\u5668\u4f9d\u8d56\u7684(\u4f46\u6240\u6709\u7f16\u8bd1\u5668\u90fd\u662f\u5982\u6b64)\uff0cvptr\u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u5f00\u5934.\u539f\u56e0\u662f\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u4f4d\u7f6e.\u8003\u8651\u4e00\u4e2a\u7c7b\u5c42\u6b21\u7ed3\u6784: struct base { T data ; virtual void f (); }; struct derived : base { T1 data ; virtual void g (); }; \u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u90a3\u4e48\u5bf9\u4e8e\u5b8c\u6574\u7c7b\u578b base \u7684\u5bf9\u8c61\uff0c\u5b83\u5c06\u4f4d\u4e8e sizeof(T) \u5b57\u8282\u4e4b\u540e.\u73b0\u5728\uff0c\u5f53\u4f60\u6709\u4e00\u4e2a\u5b8c\u6574\u7c7b\u578b\u7684\u5bf9\u8c61 derived \u65f6\uff0cbase \u5b50\u5bf9\u8c61\u7684\u5e03\u5c40\u5fc5\u987b\u4e0e\u5b8c\u6574 base \u5bf9\u8c61\u7684\u5e03\u5c40\u517c\u5bb9\uff0c\u56e0\u6b64 vptr \u4ecd\u7136\u5fc5\u987b\u662f sizeof(T) \u5b57\u8282\u5728\u5bf9\u8c61\u5185\u90e8\uff0c\u5b83\u5c06\u4f4d\u4e8e derived \u5bf9\u8c61\u4e2d\u95f4\u7684\u67d0\u4e2a\u4f4d\u7f6e(sizeof(T) \u4ece\u5f00\u59cb\uff0csizeof(T1) \u5728\u7ed3\u675f\u4e4b\u524d).\u6240\u4ee5\u5b83\u5c06\u4e0d\u518d\u4f4d\u4e8e\u5bf9\u8c61\u7684 end \u5904. \u6b64\u5916\uff0c\u7ed9\u5b9a\u4e00\u4e2a this \u6307\u9488\uff0c\u865a\u62df\u8c03\u7528\u9700\u8981\u901a\u8fc7 vtable \u8fdb\u884c\u95f4\u63a5\u8c03\u7528\uff0c\u8fd9\u57fa\u672c\u4e0a\u662f\u53d6\u6d88\u5bf9 vptr \u7684\u5f15\u7528\uff0c\u6dfb\u52a0\u4e00\u4e2a\u504f\u79fb\u91cf\u5e76\u8df3\u8f6c\u5230\u5b58\u50a8\u5728\u90a3\u91cc\u7684\u5185\u5b58\u4f4d\u7f6e.\u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u5219\u5bf9\u4e8e\u6bcf\u4e2a\u865a\u62df\u8c03\u7528\uff0c\u5728\u53d6\u6d88\u5f15\u7528 vptr \u4e4b\u524d\u90fd\u4f1a\u5bf9 this \u8fdb\u884c\u989d\u5916\u7684\u6dfb\u52a0.","title":"\u865a\u51fd\u6570\u8868\u6307\u9488\u4e3a\u4ec0\u4e48\u653e\u5728\u5f00\u5934\uff1f"},{"location":"cs/pl/c_cpp/basic/#stlhash","text":"hashtable \u662f\u91c7\u7528\u5f00\u94fe\u6cd5\u6765\u5b8c\u6210\u7684\uff0c\uff08vector + list\uff09 \u5e95\u5c42\u952e\u503c\u5e8f\u5217\u91c7\u7528 vector \u5b9e\u73b0\uff0cvector \u7684\u5927\u5c0f\u53d6\u7684\u662f\u8d28\u6570\uff0c\u4e14\u76f8\u90bb\u8d28\u6570\u7684\u5927\u5c0f\u7ea6\u4e3a 2 \u500d\u5173\u7cfb\uff0c\u5f53\u521b\u5efa hashtable \u65f6\uff0c\u4f1a\u81ea\u52a8\u9009\u53d6\u4e00\u4e2a\u63a5\u8fd1\u6240\u521b\u5efa\u5927\u5c0f\u7684\u8d28\u6570\u4f5c\u4e3a\u5f53\u524d hashtable \u7684\u5927\u5c0f\uff1b \u5bf9\u5e94\u952e\u7684\u503c\u5e8f\u5217\u91c7\u7528\u5355\u5411 list \u5b9e\u73b0\uff1b \u5f53 hashtable \u7684\u952e vector \u7684\u5927\u5c0f\u91cd\u65b0\u5206\u914d\u7684\u65f6\u5019\uff0c\u539f\u952e\u7684\u503c list \u4e5f\u4f1a\u91cd\u65b0\u5206\u914d\uff0c\u56e0\u4e3a vector \u91cd\u5efa\u4e86\u76f8\u5f53\u4e8e\u952e\u589e\u52a0\u4e86\uff0c\u90a3\u4e48\u539f\u6765\u7684\u503c\u5bf9\u5e94\u7684\u952e\u53ef\u80fd\u5c31\u4e0d\u540c\u4e8e\u539f\u6765\u5206\u914d\u7684\u952e\uff0c\u8fd9\u6837\u5c31\u9700\u8981\u91cd\u65b0\u786e\u5b9a\u503c\u7684\u952e\u3002","title":"STL\u6e90\u7801\u4e2dhash\u7684\u8868\u73b0"},{"location":"cs/pl/c_cpp/basic/#_38","text":"C++\u51fd\u6570\u91cd\u8f7d\u5e95\u5c42\u5b9e\u73b0\u539f\u7406\u662fC++\u5229\u7528\u503e\u8f67\u6280\u672f\uff0c\u6765\u6539\u540d\u51fd\u6570\u540d\uff0c\u533a\u5206\u53c2\u6570\u4e0d\u540c\u7684\u540c\u540d\u51fd\u6570\u3002 C++\u4e2d\uff0c\u8fd9\u4e09\u4e2a\u51fd\u6570\u5982\u679c\u5728\u4e3b\u51fd\u6570\u4e2d\u88ab\u8c03\u7528\u9009\u62e9\u54ea\u4e00\u4e2a\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u8eab\u51b3\u5b9a\u3002 \u6e90\u6587\u4ef6\u901a\u8fc7\u7f16\u8bd1\u540e\uff0c\u5c06\u76f8\u540c\u51fd\u6570\u540d\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u683c\u5f0f\uff0c\u6539\u53d8\u6210\u53ef\u4ee5\u533a\u5206\u7684\uff0c\u53bb\u9664\u4e86\u51fd\u6570\u5728\u8c03\u7528\u65f6\u7684\u4e8c\u4e49\u6027\uff0c\u4ece\u800c\u5b9e\u73b0\u51fd\u6570\u7684\u91cd\u8f7d\u3002 \u7ed3\u5408extern \"C\".","title":"\u91cd\u8f7d\u5982\u4f55\u5b9e\u73b0"},{"location":"cs/pl/c_cpp/basic/#_39","text":"C++\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\uff0c\u5b58\u5728\u7740\u9759\u6001\u7ed1\u5b9a\u548c\u52a8\u6001\u7ed1\u5b9a\u7684\u5b9a\u4e49\uff0c\u672c\u8282\u5373\u662f\u4e3b\u8981\u8bb2\u8ff0\u8fd9\u4e24\u70b9\u533a\u5206\u3002 \u6211\u662f\u5728\u4e00\u4e2a\u7c7b\u7684\u7ee7\u627f\u4f53\u7cfb\u4e2d\u5206\u6790\u7684\uff0c\u56e0\u6b64\u4e0b\u9762\u6240\u8bf4\u7684\u5bf9\u8c61\u4e00\u822c\u5c31\u662f\u6307\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b\u3002 \u9996\u5148\u6211\u4eec\u9700\u8981\u660e\u786e\u51e0\u4e2a\u540d\u8bcd\u5b9a\u4e49\uff1a \u9759\u6001\u7c7b\u578b\uff1a\u5bf9\u8c61\u5728\u58f0\u660e\u65f6\u91c7\u7528\u7684\u7c7b\u578b\uff0c\u5728\u7f16\u8bd1\u671f\u65e2\u5df2\u786e\u5b9a\uff1b \u52a8\u6001\u7c7b\u578b\uff1a\u901a\u5e38\u662f\u6307\u4e00\u4e2a\u6307\u9488\u6216\u5f15\u7528\u76ee\u524d\u6240\u6307\u5bf9\u8c61\u7684\u7c7b\u578b\uff0c\u662f\u5728\u8fd0\u884c\u671f\u51b3\u5b9a\u7684\uff1b \u9759\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u9759\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u9759\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff1b \u52a8\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u52a8\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u9759\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff0c\u52a8\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\u53ef\u4ee5\u66f4\u6539\uff0c\u4f46\u662f\u9759\u6001\u7c7b\u578b\u65e0\u6cd5\u66f4\u6539\uff1b \u8981\u60f3\u5b9e\u73b0\u52a8\u6001\uff0c\u5fc5\u987b\u4f7f\u7528\u52a8\u6001\u7ed1\u5b9a\uff1b \u5728\u7ee7\u627f\u4f53\u7cfb\u4e2d\u53ea\u6709\u865a\u51fd\u6570\u4f7f\u7528\u7684\u662f\u52a8\u6001\u7ed1\u5b9a\uff0c\u5176\u4ed6\u7684\u5168\u90e8\u662f\u9759\u6001\u7ed1\u5b9a\uff1b \u6ce8\u610f\uff1a\u7edd\u5bf9\u4e0d\u8981\u91cd\u65b0\u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627f\u800c\u6765\u7684virtual\u51fd\u6570\u7684\u7f3a\u7701\u53c2\u6570\u503c\uff0c\u56e0\u4e3a\u7f3a\u7701\u53c2\u6570\u503c\u90fd\u662f\u9759\u6001\u7ed1\u5b9a\uff08\u4e3a\u4e86\u6267\u884c\u6548\u7387\uff09\uff0c\u800cvirtual\u51fd\u6570\u5374\u662f\u52a8\u6001\u7ed1\u5b9a\u3002","title":"\u52a8\u6001\u7ed1\u5b9a\u548c\u9759\u6001\u7ed1\u5b9a\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#c_9","text":"C++\u4e2d\u7684\u6784\u9020\u51fd\u6570\u53ef\u4ee5\u5206\u4e3a4\u7c7b\uff1a \uff081\uff09\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u3002\u4ee5Student\u7c7b\u4e3a\u4f8b\uff0c\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u7684\u539f\u578b\u4e3a Student(\uff09\uff1b//\u6ca1\u6709\u53c2\u6570 \uff082\uff09\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570 Student(int num\uff0cint age\uff09\uff1b//\u6709\u53c2\u6570 \uff083\uff09\u590d\u5236\uff08\u62f7\u8d1d\uff09\u6784\u9020\u51fd\u6570 Student(Student&\uff09\uff1b//\u5f62\u53c2\u662f\u672c\u7c7b\u5bf9\u8c61\u7684\u5f15\u7528 \uff084\uff09\u8f6c\u6362\u6784\u9020\u51fd\u6570 Student(int r) \uff1b//\u5f62\u53c2\u662f\u5176\u4ed6\u7c7b\u578b\u53d8\u91cf\uff0c\u4e14\u53ea\u6709\u4e00\u4e2a\u5f62\u53c2 \u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u548c\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570\u5728\u5b9a\u4e49\u7c7b\u7684\u5bf9\u8c61\u7684\u65f6\u5019\uff0c\u5b8c\u6210\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u5de5\u4f5c\u3002 \u590d\u5236\u6784\u9020\u51fd\u6570\u7528\u4e8e\u590d\u5236\u672c\u7c7b\u7684\u5bf9\u8c61\u3002 \u8f6c\u6362\u6784\u9020\u51fd\u6570\u7528\u4e8e\u5c06\u5176\u4ed6\u7c7b\u578b\u7684\u53d8\u91cf\uff0c\u9690\u5f0f\u8f6c\u6362\u4e3a\u672c\u7c7b\u5bf9\u8c61\u3002","title":"C++\u7684\u51e0\u79cd\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_40","text":"\u5f53\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u4e24\u4e2a\u5173\u952e\u70b9\uff0c\u5206\u522b\u662f \u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f \u548c \u521d\u59cb\u5316\u5bf9\u8c61","title":"\u4ec0\u4e48\u65f6\u5019\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_41","text":"\u521d\u59cb\u5316\u5bf9\u8c61\u662f\u6307\uff0c\u4e3a\u5bf9\u8c61\u5206\u914d\u5185\u5b58\u540e\u7b2c\u4e00\u6b21\u5411\u5185\u5b58\u4e2d\u586b\u5145\u6570\u636e\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u5bf9\u8c61\u88ab\u521b\u5efa\u540e\u5fc5\u987b\u7acb\u5373\u521d\u59cb\u5316\u3002\u4e5f\u5c31\u662f\u8bf4\u53ea\u8981\u521b\u5efa\u5bf9\u8c61\u5c31\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\u3002","title":"\u521d\u59cb\u5316\u5bf9\u8c61"},{"location":"cs/pl/c_cpp/basic/#_42","text":"\u521d\u59cb\u5316\u548c\u8d4b\u503c\u90fd\u662f\u5c06\u6570\u636e\u5199\u5165\u5185\u5b58\u4e2d\uff0c\u4ece\u8868\u9762\u770b\uff0c\u521d\u59cb\u5316\u5728\u5f88\u591a\u65f6\u5019\u90fd\u662f\u4ee5\u590d\u5236\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u7684\uff0c\u5f88\u5bb9\u6613\u5f15\u8d77\u6df7\u6dc6\u3002\u5728\u5b9a\u4e49\u7684\u540c\u65f6\u8fdb\u884c\u590d\u5236\u53eb\u505a\u521d\u59cb\u5316\uff0c\u5b9a\u4e49\u5b8c\u6210\u4ee5\u540e\u518d\u8d4b\u503c(\u4e0d\u7ba1\u5b9a\u4e49\u7684\u65f6\u5019\u6709\u6ca1\u6709\u8d4b\u503c)\u5c31\u53eb\u505a\u8d4b\u503c\u3002\u521d\u59cb\u5316\u53ea\u80fd\u7531\u4e00\u6b21\uff0c\u8d4b\u503c\u53ef\u4ee5\u7531\u5f88\u591a\u6b21\u3002","title":"\u521d\u59cb\u5316\u548c\u8d4b\u503c\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_43","text":"\u5982\u679c\u7528\u4f20\u9012\u8fdb\u6765\u7684\u5b9e\u53c2\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u90a3\u4e48\u4f1a\u8c03\u7528\u666e\u901a\u7684\u6784\u9020\u51fd\u6570\u3002 \u5982\u679c\u7528\u73b0\u6709\u5bf9\u8c61\u7684\u6570\u636e\u6765\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u5c31\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u5c31\u662f\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u3002","title":"\u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u4e0d\u540c\u7684\u521d\u59cb\u5316\u65b9\u5f0f\u4f1a\u8c03\u7528\u4e0d\u540c\u7684\u6784\u9020\u51fd\u6570\uff1a"},{"location":"cs/pl/c_cpp/basic/#_44","text":"\u5c06\u5176\u5b83\u5bf9\u8c61\u4f5c\u4e3a\u5b9e\u53c2\u3002 \u5728\u521b\u5efa\u5bf9\u8c61\u7684\u540c\u65f6\u8d4b\u503c\u3002 \u51fd\u6570\u7684\u5f62\u53c2\u4e3a\u7c7b\u7c7b\u578b\u3002 \u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u7c7b\u7c7b\u578b(\u4e0e\u7f16\u8bd1\u5668\u6709\u5173\u4e0d\u7edd\u5bf9)","title":"\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u6765\u521d\u59cb\u5316\u5bf9\u8c61\u7684\u51e0\u79cd\u60c5\u51b5\uff1a"},{"location":"cs/pl/c_cpp/basic/#cvector","text":"stl\u5bb9\u5668\u5305\u542b\u987a\u5e8f\u5bb9\u5668\u548c\u5173\u8054\u5bb9\u5668\u3002\u987a\u5e8f\u5bb9\u5668\u4e3b\u8981\u6709vector\uff0clist\uff0cdeque\uff0c\u5173\u8054\u5bb9\u5668\u4e3b\u8981\u662fpair\u3001set\u3001map\u3001multiset\u548cmultimap\uff0c\u6240\u4ee5\u603b\u5171\u7b97\u662f7\u79cd\u3002 \u6240\u8c13\u968f\u673a\u8bbf\u95ee\uff0c\u6211\u7684\u7406\u89e3\u662f\u6309\u7167\u6570\u7ec4\u7684\u65b9\u5f0f\u5728\u5185\u5b58\u4e2d\u987a\u5e8f\u5b58\u653e\uff0c\u53ea\u9700\u8981\u6839\u636e\u9996\u5730\u5740\u548c\u76f8\u5e94\u4e0b\u6807\u5c31\u80fd\u5bfb\u5740\u5230\u76f8\u5e94\u7684\u5143\u7d20\u3002 \u6240\u4ee5\u9010\u4e2a\u5206\u6790\u5982\u4e0b\uff1a vector\u7684\u5b9e\u73b0\u539f\u7406\u662f\u6570\u7ec4\uff0c\u6240\u4ee5\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 list\u7684\u5b9e\u73b0\u539f\u7406\u662f\u53cc\u5411\u94fe\u8868\uff0c\u6240\u4ee5\u4e0d\u652f\u6301\u3002 deque\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7c7b\u4f3c\u6570\u7ec4\u7684\u53cc\u7aef\u961f\u5217\uff0c\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 pair\u662f\u4e2a\u4e8c\u5143\u7ec4\uff0c\u4e00\u5171\u5c31\u4e24\u4e2a\u503c\uff0c\u8c08\u4e0d\u4e0a\u968f\u673a\u8bbf\u95ee\u3002 set\u3001multiset\u3001map\u3001multimap\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7ea2\u9ed1\u6811\uff0c\u4e0d\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 \u6240\u4ee5\u5728\u4e0a\u8ff0\u4e03\u79cd\u5bb9\u5668\u4e2d\u53ea\u6709vector\u548cdeque\u4e24\u79cd\u662f\u652f\u6301\u968f\u673a\u8bbf\u95ee\u7684\u3002","title":"C++\u7684\u5bb9\u5668\u6bd4\u8f83\uff0c\u4e3a\u4ec0\u4e48vector\u53ef\u4ee5\u968f\u673a\u8bbf\u95ee"},{"location":"cs/pl/c_cpp/basic/#vector_1","text":"vector\u7684\u5927\u5c0f\u6709\u4e24\u4e2a\u53d8\u91cf\uff0c\u4e00\u4e2asize\uff0c\u4e00\u4e2acapacity\uff0csize\u662fvector\u5b9e\u9645\u5bb9\u91cf\uff0ccapacity\u662fvector\u6700\u5927\u5bb9\u91cf\uff0c\u5f53size=capacity\u65f6\uff0cvector\u9700\u8981\u8003\u8651\u6269\u5bb9\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09","title":"vector\u5e95\u5c42\u6570\u7ec4\u5927\u5c0f\u5206\u914d"},{"location":"cs/pl/c_cpp/basic/#_45","text":"\u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002","title":"\u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9"},{"location":"cs/pl/c_cpp/basic/#msvc15gcc2_1","text":"\u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4","title":"MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904"},{"location":"cs/pl/c_cpp/basic/#cgopython","text":"","title":"C++\u3001go\u3001python\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_46","text":"C++\u8fd9\u79cd\u4e0e\u5e73\u53f0\u548c\u7f16\u8bd1\u5668\u76f8\u5173\uff0c\u5f88\u96be\u6709\u8bed\u8a00\u7ea7\u522b\u7684\u5305\u7ba1\u7406\u5668\uff0c \u4e00\u822c\u662f\u5404\u4e2a\u5f00\u53d1\u73af\u5883\u6301\u6709\u5404\u81ea\u7684\u590d\u7528\u7ba1\u7406\uff0c\u6bd4\u5982 linux \u7684 apt-get, deb, yum\uff0c\u5404\u79cdlib header dev\u5305\u53ef\u4ee5\u901a\u8fc7\u5176\u5b89\u88c5\u7684\u3002\u4e00\u822c\u90fd\u9700\u8981CMake\u6216\u8005Makefile\u8fdb\u884c\u5de5\u7a0b\u7ba1\u7406\uff0c\u6240\u4ee5\u6709\u76f8\u5e94\u7684\u5b66\u4e60\u6210\u672c\u3002 Python\u6709\u4e30\u5bcc\u7684\u5305\u7ba1\u7406\u5668\uff0c\u6bd4\u5982\uff0cdistutils\uff0csetuptools, \u8fd8\u6709\u8f83\u4e3a\u6d41\u884c\u7684pip\uff0c pip \u53ef\u4ee5\u5229\u7528 requirments.txt \u6765\u5b89\u88c5\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\u3002 GO\u65e9\u671f\u7684\u5305\u7ba1\u7406\u4e5f\u662f\u4e3a\u4eba\u8bdf\u75c5\uff0c\u4e0d\u8fc71.11 \u7248\u672c\u63a8\u51fa modules \u673a\u5236\uff0c\u8ba9go\u8bed\u8a00\u5305\u7ba1\u7406\u53d8\u5f97\u66f4\u65b9\u4fbf\u7b80\u5355\uff0c\u8fd8\u652f\u6301GoProxy\uff0creplace\uff0cSubCommand\u7b49\u9ad8\u7ea7\u7279\u6027\u3002","title":"\u5305\u7ba1\u7406"},{"location":"cs/pl/c_cpp/basic/#_47","text":"\u5728\u8bed\u6cd5\u65b9\u9762\uff0cC++\u548cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u8f83\u4e3a\u76f8\u4f3c\uff0c\u4f46\u662fGO\u8bed\u8a00\u8bed\u6cd5\u7b80\u6d01\uff0c\u4e0d\u9700\u8981\u7a0b\u5e8f\u5458\u7ba1\u7406\u5185\u5b58\uff0c\u6709\u4e30\u5bcc\u7684API\u53ef\u8c03\u7528\uff0c\u4e5f\u63d0\u4f9b\u4e86\u5207\u7247\uff0cmap\u7b49\u7075\u6d3b\u7684\u6570\u636e\u7c7b\u578b\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\u5728\u8bed\u6cd5\u65b9\u9762\u4ee5\u4f18\u96c5\u8457\u79f0\uff0c\u66f4\u4e3a\u7b80\u5355\u3002Python \u793e\u533a\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e0e\u6807\u51c6\u5e93\u7c7b\u4f3c\u3002\u5b83\u4eec\u7684\u529f\u80fd\u8986\u76d6 \u79d1\u5b66\u8ba1\u7b97\u3001\u4eba\u5de5\u667a\u80fd\u3001\u673a\u5668\u5b66\u4e60\u3001Web \u5f00\u53d1\u3001\u6570\u636e\u5e93\u63a5\u53e3\u591a\u4e2a\u9886\u57df\u3002","title":"\u8bed\u6cd5"},{"location":"cs/pl/c_cpp/basic/#_48","text":"\u5728\u6027\u80fd\u65b9\u9762\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\uff0c\u5728\u6027\u80fd\u65b9\u9762\u4e0eC++\u548cGO\u8bed\u8a00\u6709\u5f88\u5927\u5dee\u8ddd\uff0c\u5e76\u884c\u7f16\u7a0b\u8fd9\u4e00\u5757\u56e0\u4e3aGIL\u7684\u5b58\u5728,Python\u5f88\u96be\u5145\u5206\u5229\u7528\u591a\u6838CPU\u7684\u4f18\u52bf\u3002GO\u7684\u8fd0\u884c\u6548\u7387\u51e0\u4e4e\u53ef\u4ee5\u5ab2\u7f8eC/C++\uff0c\u800c\u4e14\u5929\u7136\u652f\u6301\u5e76\u53d1\u7f16\u7a0b\uff0c\u53ef\u4ee5\u901a\u8fc7go\u5173\u952e\u5b57\u521b\u5efaN\u4e2agoroutine\uff08\u4e00\u79cd\u7528\u6237\u6001\u7ebf\u7a0b\uff09\u6765\u5b9e\u73b0\u5e76\u53d1\uff0c\u540c\u65f6\u63d0\u4f9b\u591a\u4e2agoroutine\u7684\u540c\u6b65\u673a\u5236\u3002","title":"\u6027\u80fd"},{"location":"cs/pl/c_cpp/basic/#_49","text":"\u7efc\u4e0a\u6240\u8bc9\uff0cC++\u5728\u6027\u80fd\u65b9\u9762\u5f88\u9ad8\uff0c\u4f46\u662f\u5f00\u53d1\u6210\u672c\u4e5f\u6bd4\u8f83\u9ad8\u3002Python\u5f00\u53d1\u7b80\u5355\uff0c\u4f46\u662f\u6027\u80fd\u8f83\u4f4e\uff0c\u4f7f\u7528\u4e0e\u4e00\u4e9b\u5bf9\u6027\u80fd\u6ca1\u8981\u6c42\u7684\u670d\u52a1\u548c\u5de5\u5177\u5f00\u53d1\u3002\u76f8\u5bf9\u6765\u8bf4\uff0cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u7b80\u5355\uff0c\u5f00\u53d1\u6210\u672c\u4f4e\uff0c\u800c\u4e14\u6548\u7387\u4e5f\u8fdc\u9ad8\u4e8e\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u9002\u5408\u5927\u90e8\u5206\u7684\u670d\u52a1\u5f00\u53d1\u3002","title":"\u5c0f\u7ed3"},{"location":"cs/pl/c_cpp/basic/#lambda","text":"\u503c\u6355\u83b7 \u4e0e\u4f20\u503c\u53c2\u6570\u7c7b\u4f3c\uff0c\u8981\u6c42\u503c\u6355\u83b7\u7684\u524d\u63d0\u662f \u53d8\u91cf\u53ef\u4ee5\u62f7\u8d1d \u4e0e\u4f20\u503c\u53c2\u6570\u4e0d\u540c\u7684\u662f\uff0c\u88ab\u6355\u83b7\u7684\u53d8\u91cf\u662f\u5728lambda\u521b\u5efa\u65f6\u62f7\u8d1d\uff0c\u800c\u4e0d\u662f\u5728\u8c03\u7528\u65f6\u62f7\u8d1d \u5f15\u7528\u6355\u83b7 \u786e\u4fdd\u88ab\u5f15\u7528\u7684\u5bf9\u8c61\u5728lambda\u8868\u8fbe\u5f0f\u6267\u884c\u65f6\u8fd8\u662f\u5b58\u5728\u7684 \u9690\u5f0f\u6355\u83b7 \u5728\u6355\u83b7\u5217\u8868\u4e2d\u4f7f\u7528 &\u6216 = \u5373\u8868\u793a\u9690\u5f0f\u6355\u83b7\uff0c \u6307\u793a\u7f16\u8bd1\u5668\u81ea\u52a8\u63a8\u65ad\u6355\u83b7\u5217\u8868 & \u8868\u793a\u91c7\u7528 \u5f15\u7528\u6355\u83b7 \u7684\u65b9\u5f0f = \u8868\u793a\u91c7\u7528 \u503c\u6355\u83b7 \u7684\u65b9\u5f0f","title":"Lambda\u8868\u8fbe\u5f0f\u7684\u53c2\u6570\u6355\u83b7\u6709\u54ea\u51e0\u79cd\u60c5\u51b5"},{"location":"cs/pl/c_cpp/basic/#reference","text":"\u73b0\u4ee3C++32\u8bb2 C++\u9762\u8bd5\u8d44\u6599 \u7ec6\u8bfb Effective C++ cppreference","title":"Reference"},{"location":"cs/pl/c_cpp/function/","text":"C++\u5404\u79cd\u51fd\u6570\u4f7f\u7528 \u00b6 \u7ea6 286 \u4e2a\u5b57 28 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9bC++\u51fd\u6570\u7684\u4f7f\u7528\u548c\u6269\u5c55\u7b49 std::string \u00b6 std::string::substr \u00b6 string substr ( size_t pos = 0 , size_t len = npos ) const ; \u8fd4\u56de\u4e00\u4e2a\u65b0\u5efa\u7684 \u521d\u59cb\u5316\u4e3astring\u5bf9\u8c61\u7684\u5b50\u4e32\u7684\u62f7\u8d1dstring\u5bf9\u8c61\u3002\u5b50\u4e32\u662f\uff0c\u5728\u5b57\u7b26\u4f4d\u7f6epos\u5f00\u59cb\uff0c\u8de8\u8d8alen\u4e2a\u5b57\u7b26\uff08\u6216\u76f4\u5230\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\uff0c\u4ee5\u5148\u5230\u8005\u4e3a\u51c6\uff09\u5bf9\u8c61\u7684\u90e8\u5206\u3002 \u5e94\u7528 // string::substr #include #include int main () { std :: string str = \"We think in generalities, but we live in details.\" ; // (quoting Alfred N. Whitehead) std :: string str2 = str . substr ( 3 , 5 ); // \"think\" std :: size_t pos = str . find ( \"live\" ); // position of \"live\" in str std :: string str3 = str . substr ( pos ); // get from \"live\" to the end std :: cout << str2 << ' ' << str3 << '\\n' ; return 0 ; } std::string::find \u00b6 size_t find ( const string & str , size_t pos = 0 ) const noexcept ; size_t find ( const char * s , size_t pos = 0 ) const ; size_t find ( const char * s , size_t pos , size_type n ) const ; size_t find ( char c , size_t pos = 0 ) const noexcept ; \u8fd4\u56de\u503c\u7c7b\u578b\u662f std::string::size_type (size_t) \uff0c \u5bf9\u5e94\u7684\u662f\u67e5\u627e\u5bf9\u8c61\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\uff08\u4ece0\u5f00\u59cb\uff09\uff0c\u5982\u679c\u672a\u67e5\u627e\u5230\uff0c\u8be5\u8fd4\u56de\u503c\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u6570\u636e\uff084294967295\uff09\uff0c\u5224\u65ad\u65f6\u4e0e std::string::npos \u8fdb\u884c\u5bf9\u6bd4\u3002 \u5efa\u8bae\u4f7f\u7528 size_type \uff0c\u8fd9\u6837\u53ef\u4ee5\u9002\u5e94\u4e0d\u540c\u7684\u5e73\u53f0\u3002\u56e0\u4e3a int \u7c7b\u578b\u7684\u5927\u5c0f\u4f1a\u6839\u636e\u4e0d\u540c\u5e73\u53f0\u800c\u4e0d\u540c\u3002 \u5e94\u7528 std :: string str ( \"abcdefg\" ); std :: string :: size_type pos = str . find ( \"abc\" ); if ( pos != std :: string :: npos ) { cout << \"Not find\" << endl ; } // or std :: string str ( \"abcdefg\" ); if ( str . find ( \"abc\" ) != std :: string :: npos ) { cout << \"Not find\" << endl ; } \u6269\u5c55 s.find(t) \u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.rfind(t) \u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_last_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_not_of(t) \u7b2c\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e s.find_last_not_of(t) \u6700\u540e\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e","title":"C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528"},{"location":"cs/pl/c_cpp/function/#c","text":"\u7ea6 286 \u4e2a\u5b57 28 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9bC++\u51fd\u6570\u7684\u4f7f\u7528\u548c\u6269\u5c55\u7b49","title":"C++\u5404\u79cd\u51fd\u6570\u4f7f\u7528"},{"location":"cs/pl/c_cpp/function/#stdstring","text":"","title":"std::string"},{"location":"cs/pl/c_cpp/function/#stdstringsubstr","text":"string substr ( size_t pos = 0 , size_t len = npos ) const ; \u8fd4\u56de\u4e00\u4e2a\u65b0\u5efa\u7684 \u521d\u59cb\u5316\u4e3astring\u5bf9\u8c61\u7684\u5b50\u4e32\u7684\u62f7\u8d1dstring\u5bf9\u8c61\u3002\u5b50\u4e32\u662f\uff0c\u5728\u5b57\u7b26\u4f4d\u7f6epos\u5f00\u59cb\uff0c\u8de8\u8d8alen\u4e2a\u5b57\u7b26\uff08\u6216\u76f4\u5230\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\uff0c\u4ee5\u5148\u5230\u8005\u4e3a\u51c6\uff09\u5bf9\u8c61\u7684\u90e8\u5206\u3002 \u5e94\u7528 // string::substr #include #include int main () { std :: string str = \"We think in generalities, but we live in details.\" ; // (quoting Alfred N. Whitehead) std :: string str2 = str . substr ( 3 , 5 ); // \"think\" std :: size_t pos = str . find ( \"live\" ); // position of \"live\" in str std :: string str3 = str . substr ( pos ); // get from \"live\" to the end std :: cout << str2 << ' ' << str3 << '\\n' ; return 0 ; }","title":"std::string::substr"},{"location":"cs/pl/c_cpp/function/#stdstringfind","text":"size_t find ( const string & str , size_t pos = 0 ) const noexcept ; size_t find ( const char * s , size_t pos = 0 ) const ; size_t find ( const char * s , size_t pos , size_type n ) const ; size_t find ( char c , size_t pos = 0 ) const noexcept ; \u8fd4\u56de\u503c\u7c7b\u578b\u662f std::string::size_type (size_t) \uff0c \u5bf9\u5e94\u7684\u662f\u67e5\u627e\u5bf9\u8c61\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\uff08\u4ece0\u5f00\u59cb\uff09\uff0c\u5982\u679c\u672a\u67e5\u627e\u5230\uff0c\u8be5\u8fd4\u56de\u503c\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u6570\u636e\uff084294967295\uff09\uff0c\u5224\u65ad\u65f6\u4e0e std::string::npos \u8fdb\u884c\u5bf9\u6bd4\u3002 \u5efa\u8bae\u4f7f\u7528 size_type \uff0c\u8fd9\u6837\u53ef\u4ee5\u9002\u5e94\u4e0d\u540c\u7684\u5e73\u53f0\u3002\u56e0\u4e3a int \u7c7b\u578b\u7684\u5927\u5c0f\u4f1a\u6839\u636e\u4e0d\u540c\u5e73\u53f0\u800c\u4e0d\u540c\u3002 \u5e94\u7528 std :: string str ( \"abcdefg\" ); std :: string :: size_type pos = str . find ( \"abc\" ); if ( pos != std :: string :: npos ) { cout << \"Not find\" << endl ; } // or std :: string str ( \"abcdefg\" ); if ( str . find ( \"abc\" ) != std :: string :: npos ) { cout << \"Not find\" << endl ; } \u6269\u5c55 s.find(t) \u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.rfind(t) \u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_last_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_not_of(t) \u7b2c\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e s.find_last_not_of(t) \u6700\u540e\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e","title":"std::string::find"},{"location":"cs/pl/c_cpp/stl/","text":"STL \u00b6 \u7ea6 1006 \u4e2a\u5b57 87 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f STL\u7b80\u79f0\u6807\u51c6\u6a21\u7248\u5e93\uff0c\u88ab\u5bb9\u7eb3\u5728C++\u6807\u51c6\u7a0b\u5e8f\u5e93\uff0c\u5305\u542b\u4e86\u8bb8\u591a\u57fa\u672c\u6570\u636e\u7ed3\u6784\u548c\u57fa\u672c\u7b97\u6cd5\uff0c\u4f7f\u7a0b\u5e8f\u5458\u5199\u8d77\u6765\u5f97\u5fc3\u5e94\u624b\u3002 \u4e3a\u4ec0\u4e48\u4f7f\u7528STL \u00b6 \u5728\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u4e2d\u4f1a\u4f7f\u7528\u5230\u5806\u3001\u6808\u3001\u961f\u5217\u3001\u94fe\u8868\u7b49\u4e00\u4e9b\u57fa\u672c\u7684\u7b97\u6cd5\uff0c\u800c\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u57fa\u672c\u7b97\u6cd5\u5199\u8d77\u6765\u5341\u5206\u7e41\u7410\uff0c\u5982\u679c\u4e0d\u60f3\u5199\u8fd9\u4e9b\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u8003\u8651\u4e00\u4e0bSTL\u4e86\u3002 \u4f46\u662f\u4e0d\u8981\u592a\u8fc7\u4e8e\u4f9d\u8d56STL\uff01 STL\u57fa\u672c\u6982\u5ff5 \u00b6 \u8981\u4f7f\u7528STL\uff0c\u9700\u8981\u7406\u89e3\u4ee5\u4e0b\u51e0\u4e2a\u57fa\u672c\u6982\u5ff5\uff1a \u5bb9\u5668 \uff1a\u662f\u5b58\u653e\u6570\u636e\u7684\u5730\u65b9\uff0c\u5e38\u89c1\u7684\u5bb9\u5668\u6709\uff1a\u94fe\u8868(list) \u6808(stack) \u52a8\u6001\u6570\u7ec4 (vector) \u53cc\u7aef\u961f\u5217(deque) \u961f\u5217(queue) \u6620\u5c04(map) \u8fed\u4ee3\u5668(iterator) \uff1a\u53ef\u4ee5\u7406\u89e3\u4e3aC\u8bed\u8a00\u91cc\u7684\u5730\u5740\uff0c\u800c\u8fed\u4ee3\u5668\u5c31\u662f\u5bb9\u5668\u7684\u4e00\u4e2a\u6307\u9488\uff0c\u5341\u5206\u91cd\u8981\uff01\uff01\uff01 \u7b97\u6cd5 \uff1a\u53ef\u4ee5\u5bf9\u5bb9\u5668\u91cc\u7684\u6570\u636e\u505a\u4e00\u4e9b\u57fa\u672c\u64cd\u4f5c\uff0c\u6bd4\u5982\u6392\u5e8f\uff0c\u627e\u6700\u5927\u5143\u7d20\u7b49\u7b49\u3002 STL\u4f7f\u7528\u524d\u7684\u521d\u59cb\u5316 \u00b6 \u9700\u8981\u5bf9\u5e94\u7684\u5934\u6587\u4ef6\uff0c\u6bd4\u5982list\u5c31\u9700\u8981 #include \uff0c\u4e14\u6ca1\u6709.h\uff0c\u6216\u8005\u6076\u5fc3\u7684\u4e07\u80fd\u5934 #include \u3002 \u6dfb\u52a0std\u547d\u540d\u7a7a\u95f4\uff08using namespace std;\uff09\u4e0d\u52a0\u7684\u8bdd\u540e\u9762\u53ef\u4ee5\u81ea\u5df1\u5199\u4e00\u5806\u3002\u3002\u3002 C++\u91ccSTL\u57fa\u672c\u5bb9\u5668\u8be6\u89e3 \u00b6 cmp\u7c7b \u00b6 \u901a\u8fc7\u81ea\u5b9a\u4e49cmp\u7c7b\u6765\u5b8c\u6210STL\u7684\u66f4\u52a0\u81ea\u7531\u7684\u8bbe\u7f6e struct cmp { bool operator ()( int a , int b ) { return a > b ; } }; sort \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u590d\u6742\u5ea6\u4e3aO(nlogn)\uff0c\u6bd4\u8f83\u6392\u5e8f\u7684\u6781\u9650\u4e86\u3002 bool cmp ( int a , int b ) { return a > b ; } int a [] = { 1 , 2 , 3 , 4 }; sort ( a , a + 4 , cmp ); sort\u91cc\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e00\u4e2a\u5730\u5740\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e8c\u4e2a\u5730\u5740\uff0c\u90fd\u4e09\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u5bf9\u6570\u7ec4\u6392\u5e8f\u7684\u51fd\u6570\uff0c\u4e0a\u9762\u7684cmp\u51fd\u6570\u662f\u4f7f\u6570\u7ec4\u5143\u7d20\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\u3002 sort\u662f\u4e0d\u7a33\u5b9a\u6392\u5e8f\uff0c\u5373\u5bf9\u4e8e\u76f8\u540c\u7684\u503c\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5176\u524d\u540e\u987a\u5e8f \u89e3\u51b3\u529e\u6cd5\uff1a 1\u3001\u589e\u52a0\u4e00\u4e2a index \u53d8\u91cf\uff0c\u5728\u503c\u76f8\u540c\u7684\u4f7f\u7528\u6bd4\u8f83 index \u503c\u7684\u5927\u5c0f 2\u3001\u4f7f\u7528 `stable_sort`` vector \u00b6 \u9700\u8981\u5934\u6587\u4ef6#include \u4e0d\u5b9a\u6570\u7ec4 vector < int > a , b ; a . push_back ( 1 ); // \u63a8\u5165\u4e00\u4e2a\u65b0\u7684\u503c\u5230\u6570\u7ec4\u6700\u540e a . pop_back (); // \u5220\u9664\u6570\u7ec4\u6700\u540e\u7684\u90a3\u4e2a\u503c a . front (); // \u6570\u7ec4\u5f00\u5934\u7684\u503c a . back (); // \u6570\u7ec4\u7ed3\u5c3e\u7684\u503c a = b ; // \u6570\u7ec4\u62f7\u8d1d a == b ; // \u6570\u7ec4\u662f\u5426\u76f8\u540c a [ 1 ]; // \u6570\u7ec4\u4e2d\u7b2c\u4e8c\u4e2a\u503c vector < int > a ; a . size (); // \u5bb9\u5668\u5185\u7684\u5143\u7d20\u4e2a\u6570 a . empty (); // \u5bb9\u5668\u662f\u5426\u4e3a\u7a7a // \u9664\u4e86queue\u548cstack\u5916\u901a\u7528\u7684\u65b9\u6cd5 a . clear (); // \u6e05\u7a7a\u5bb9\u5668\u5185\u7684\u6240\u6709\u5143\u7d20 a . begin (); // \u5bb9\u5668\u7684\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668 a . end (); // \u5bb9\u5668\u5c3e\u540e\u8fed\u4ee3\u5668 vector < int > v ; vector < int >:: iterator iter // \u5b9a\u4e49\u8fed\u4ee3\u5668 iter = v . begin (); // \u6570\u7ec4\u5934\u201c\u6307\u9488\u201d iter = v . end (); // \u6570\u7ec4\u5c3e\u201c\u6307\u9488\u201d ==list==: 1.\u9700\u8981\u5934\u6587\u4ef6#include l; 2.\u53cc\u5411\u94fe\u8868 list < int > l ; l . push_front ( 1 ); // \u63d2\u5165\u5143\u7d20\u5230\u5f00\u5934 l . pop_front (); // \u4ece\u5f00\u5934\u5220\u6389\u5143\u7d20 l . erase ( l . begin ()); // \u5220\u9664\u6307\u5b9a\u8fed\u4ee3\u5668\u5904\u7684\u5143\u7d20 l . insert ( l . begin (), 1 ); // \u5728\u6307\u5b9a\u8fed\u4ee3\u5668\u524d\u63d2\u5165\u5143\u7d20 l . reverse (); // \u53cd\u8f6c\u6574\u4e2a\u94fe\u8868 string \u00b6 \u4f2a\u5b57\u7b26\u4e32\uff1b \u5b9a\u4e49\uff1astring s; \u53ea\u80fd\u6d41\u8f93\u5165\u548c\u6d41\u8f93\u51fa\uff1b string a , b ; a [ 1 ] == 'a' ; // \u5f97\u5230\u67d0\u4e2a\u5b57\u7b26 a = b ; // \u5b57\u7b26\u4e32\u62f7\u8d1d a >= b ; // \u5b57\u5178\u5e8f\u6bd4\u8f83 a [ 1 ] = b [ 1 ]; // \u4fee\u6539\u67d0\u4e2a\u5b57\u7b26 a += b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = a + b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a += \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = b + \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 int len = a . lenth (); // \u5b57\u7b26\u4e32\u7684\u957f\u5ea6 queue \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u5148\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u94fe\u8868\u5b9e\u73b0\uff09 queue < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u961f\u5217 q . pop (); // \u63a8\u51fa\u961f\u5217\u5f00\u5934\u7684\u5143\u7d20 q . front (); // \u961f\u5217\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 stack \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include ; \u540e\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u6570\u7ec4\u5b9e\u73b0\uff09 stack < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u5806\u6808 q . pop (); // \u63a8\u51fa\u5806\u6808\u6700\u540e\u7684\u5143\u7d20 q . top (); // \u5806\u6808\u7684\u6700\u540e\u7684\u5143\u7d20 pair \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \u8868\u793a\u4e00\u7ec4\u952e\u5bf9\uff08\u6709\u4e24\u4e2a\u53d8\u91cf\u7684\u7ed3\u6784\u4f53\uff09 pair < int , string > p ; p . first = 1 ; p . second = \"abc\" ; p = make_pair ( 1 , \"abc\" ); p = { 1 , \"abc\" }; pair < int , string > p [ 100 ]; sort ( p , p + 100 ); // \u9ed8\u8ba4\u4f18\u5148first\u4ece\u5c0f\u5230\u5927 // \u5982\u679cfirst\u76f8\u540c\u5219second\u4ece\u5c0f\u5230\u5927 pair\u4e0e\u5176\u4ed6\u7ed3\u6784\u5d4c\u5957 vector < pair < int , string > > vp ; queue < pair < float , int > > qp ; queue < pair < pair < int , int > , int > > qpp ; set \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b set \u4fdd\u5b58\u4e86\u4e0d\u53ef\u91cd\u590d\u7684\u5143\u7d20-- \u4e8c\u53c9\u641c\u7d22\u6811-\u7ea2\u9ed1\u6811 set < int > s ; s . insert ( 1 ); // \u63d2\u5165\u5230\u96c6\u5408\u4e2d s . erase ( 1 ); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . erase ( s . begin ()); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . count ( 1 ); // \u96c6\u5408\u4e2d\u662f\u5426\u5b58\u5728 s . find ( 1 ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u7531\u4e8eset\u662f\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 \u5185\u90e8\u6709\u5e8f(\u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927) \u6ca1\u6709\u91cd\u590d\u503c\uff0c\u5982\u679c\u51fa\u73b0\u91cd\u590d\u503c\u4f1a\u4e0d\u65ad\u88ab\u8986\u76d6 \u51e0\u4e4e\u6240\u6709\u64cd\u4f5c\u590d\u6742\u5ea6\u5747\u4e3a O(logN) \u4e0d\u53ef\u4ee5\u4fee\u6539\u8282\u70b9\u4e0a\u7684\u503c \u4fee\u6539\u64cd\u4f5c\u53ea\u80fd\u8fdb\u884c\u63d2\u5165\u548c\u5220\u9664\u4e24\u4e2a\u64cd\u4f5c set\u901a\u5e38\u4f5c\u7528\uff1a\u4fdd\u8bc1\u552f\u4e00\u6027\uff0c\u4fdd\u8bc1\u6570\u5217\u6709\u5e8f map \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b map\u5b57\u5178\uff08\u952e\u5bf9\u96c6\u5408\uff09 \u2014\u2014\u4e8c\u53c9\u641c\u7d22\u6811\u2014\u2014\u7ea2\u9ed1\u6811 map < char , int > m ; m . insert ( make_pair ( 'a' , 1 )); // \u52a0\u5165\u5b57\u5178 m . insert ({ 'a' , 1 }); // \u52a0\u5165\u5b57\u5178 m . erase ( 'a' ); // \u4ece\u5b57\u5178\u4e2d\u5220\u9664 m . count ( 'a' ); // \u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728 m . find ( 'a' ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u901a\u5e38\u79f0map\u7684first\u5143\u7d20\u4e3akey\uff0csecond\u5143\u7d20\u4e3avalue \u00b7\u7531\u4e8emap\u662f\u952e\u5bf9\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 1\u3001set\u7684\u5927\u90e8\u5206\u6027\u8d28\uff1b 2\u3001key\u4e0d\u80fd\u91cd\u590d\uff0c\u4e0d\u80fd\u4fee\u6539\uff0c\u53ea\u80fd\u5220\u9664\u548c\u6dfb\u52a0\uff1b 3\u3001\u5141\u8bb8value\u91cd\u590d\uff0c\u53ef\u4ee5\u5bf9value\u8fdb\u884c\u4fee\u6539\uff1b 4\u3001map\u662f\u6309\u7167key\u8fdb\u884c\u6392\u5e8f\u7684\uff1b 5\u3001key\u548cvalue\u4e00\u5b9a\u662f\u6210\u5bf9\u51fa\u73b0\u7684\uff1b 6\u3001map\u7684\u8fed\u4ee3\u5668\u6307\u5411\u7684\u5185\u5bb9\u662f\u4e00\u4e2apair\uff1b priority_queue \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \u4f18\u5148\u961f\u5217--\u5806 priority_queue < int > prq ; prq . top (); // \u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . pop (); // \u5f39\u51fa\u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . push ( 1 ); // \u63a8\u5165\u5806 priority_queue\u9ed8\u8ba4\u4e3a\u6700\u5927\u5806\uff0c\u5373\u5806\u9876\u7684\u5143\u7d20\u6700\u5927 \u548cqueue\u4e00\u6837\uff0cpriority_queue\u4e0d\u5141\u8bb8\u8bbf\u95ee\u9664\u4e86\u5806\u9876\u5143\u7d20\u4ee5\u5916\u7684\u4efb\u4f55\u4e00\u4e2a\u5143\u7d20\u3002 priority_queue\u7684\u63d2\u5165\u548c\u5f39\u51fa\u64cd\u4f5c\u7684\u590d\u6742\u5ea6\u5747\u4e3aO(logN) priority_queue\u529f\u80fd\u4e0eset\u63a5\u8fd1\uff0c\u800c\u4e14set\u7684\u529f\u80fd\u66f4\u5f3a\u5927\uff0c\u5e76\u4e14\u7406\u8bba\u590d\u6742\u5ea6\u76f8\u540c\uff0c\u4e3a\u4ec0\u4e48\u6709\u65f6\u5019\u53cd\u800c\u5c31\u662f\u7528priority_queue\uff1f priority_queue\u7684\u590d\u6742\u5ea6\u4e3a\u6700\u5dee\u60c5\u51b5\u4e0b\u7684\u590d\u6742\u5ea6\uff0c\u800cset\u548cmap\u7684\u590d\u6742\u5ea6\u5747\u4e3a\u7a33\u5b9a\u590d\u6742\u5ea6\u7684\u6781\u9650\u503c","title":"C++ STL"},{"location":"cs/pl/c_cpp/stl/#stl","text":"\u7ea6 1006 \u4e2a\u5b57 87 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f STL\u7b80\u79f0\u6807\u51c6\u6a21\u7248\u5e93\uff0c\u88ab\u5bb9\u7eb3\u5728C++\u6807\u51c6\u7a0b\u5e8f\u5e93\uff0c\u5305\u542b\u4e86\u8bb8\u591a\u57fa\u672c\u6570\u636e\u7ed3\u6784\u548c\u57fa\u672c\u7b97\u6cd5\uff0c\u4f7f\u7a0b\u5e8f\u5458\u5199\u8d77\u6765\u5f97\u5fc3\u5e94\u624b\u3002","title":"STL"},{"location":"cs/pl/c_cpp/stl/#stl_1","text":"\u5728\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u4e2d\u4f1a\u4f7f\u7528\u5230\u5806\u3001\u6808\u3001\u961f\u5217\u3001\u94fe\u8868\u7b49\u4e00\u4e9b\u57fa\u672c\u7684\u7b97\u6cd5\uff0c\u800c\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u57fa\u672c\u7b97\u6cd5\u5199\u8d77\u6765\u5341\u5206\u7e41\u7410\uff0c\u5982\u679c\u4e0d\u60f3\u5199\u8fd9\u4e9b\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u8003\u8651\u4e00\u4e0bSTL\u4e86\u3002 \u4f46\u662f\u4e0d\u8981\u592a\u8fc7\u4e8e\u4f9d\u8d56STL\uff01","title":"\u4e3a\u4ec0\u4e48\u4f7f\u7528STL"},{"location":"cs/pl/c_cpp/stl/#stl_2","text":"\u8981\u4f7f\u7528STL\uff0c\u9700\u8981\u7406\u89e3\u4ee5\u4e0b\u51e0\u4e2a\u57fa\u672c\u6982\u5ff5\uff1a \u5bb9\u5668 \uff1a\u662f\u5b58\u653e\u6570\u636e\u7684\u5730\u65b9\uff0c\u5e38\u89c1\u7684\u5bb9\u5668\u6709\uff1a\u94fe\u8868(list) \u6808(stack) \u52a8\u6001\u6570\u7ec4 (vector) \u53cc\u7aef\u961f\u5217(deque) \u961f\u5217(queue) \u6620\u5c04(map) \u8fed\u4ee3\u5668(iterator) \uff1a\u53ef\u4ee5\u7406\u89e3\u4e3aC\u8bed\u8a00\u91cc\u7684\u5730\u5740\uff0c\u800c\u8fed\u4ee3\u5668\u5c31\u662f\u5bb9\u5668\u7684\u4e00\u4e2a\u6307\u9488\uff0c\u5341\u5206\u91cd\u8981\uff01\uff01\uff01 \u7b97\u6cd5 \uff1a\u53ef\u4ee5\u5bf9\u5bb9\u5668\u91cc\u7684\u6570\u636e\u505a\u4e00\u4e9b\u57fa\u672c\u64cd\u4f5c\uff0c\u6bd4\u5982\u6392\u5e8f\uff0c\u627e\u6700\u5927\u5143\u7d20\u7b49\u7b49\u3002","title":"STL\u57fa\u672c\u6982\u5ff5"},{"location":"cs/pl/c_cpp/stl/#stl_3","text":"\u9700\u8981\u5bf9\u5e94\u7684\u5934\u6587\u4ef6\uff0c\u6bd4\u5982list\u5c31\u9700\u8981 #include \uff0c\u4e14\u6ca1\u6709.h\uff0c\u6216\u8005\u6076\u5fc3\u7684\u4e07\u80fd\u5934 #include \u3002 \u6dfb\u52a0std\u547d\u540d\u7a7a\u95f4\uff08using namespace std;\uff09\u4e0d\u52a0\u7684\u8bdd\u540e\u9762\u53ef\u4ee5\u81ea\u5df1\u5199\u4e00\u5806\u3002\u3002\u3002","title":"STL\u4f7f\u7528\u524d\u7684\u521d\u59cb\u5316"},{"location":"cs/pl/c_cpp/stl/#cstl","text":"","title":"C++\u91ccSTL\u57fa\u672c\u5bb9\u5668\u8be6\u89e3"},{"location":"cs/pl/c_cpp/stl/#cmp","text":"\u901a\u8fc7\u81ea\u5b9a\u4e49cmp\u7c7b\u6765\u5b8c\u6210STL\u7684\u66f4\u52a0\u81ea\u7531\u7684\u8bbe\u7f6e struct cmp { bool operator ()( int a , int b ) { return a > b ; } };","title":"cmp\u7c7b"},{"location":"cs/pl/c_cpp/stl/#sort","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u590d\u6742\u5ea6\u4e3aO(nlogn)\uff0c\u6bd4\u8f83\u6392\u5e8f\u7684\u6781\u9650\u4e86\u3002 bool cmp ( int a , int b ) { return a > b ; } int a [] = { 1 , 2 , 3 , 4 }; sort ( a , a + 4 , cmp ); sort\u91cc\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e00\u4e2a\u5730\u5740\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e8c\u4e2a\u5730\u5740\uff0c\u90fd\u4e09\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u5bf9\u6570\u7ec4\u6392\u5e8f\u7684\u51fd\u6570\uff0c\u4e0a\u9762\u7684cmp\u51fd\u6570\u662f\u4f7f\u6570\u7ec4\u5143\u7d20\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\u3002 sort\u662f\u4e0d\u7a33\u5b9a\u6392\u5e8f\uff0c\u5373\u5bf9\u4e8e\u76f8\u540c\u7684\u503c\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5176\u524d\u540e\u987a\u5e8f \u89e3\u51b3\u529e\u6cd5\uff1a 1\u3001\u589e\u52a0\u4e00\u4e2a index \u53d8\u91cf\uff0c\u5728\u503c\u76f8\u540c\u7684\u4f7f\u7528\u6bd4\u8f83 index \u503c\u7684\u5927\u5c0f 2\u3001\u4f7f\u7528 `stable_sort``","title":"sort"},{"location":"cs/pl/c_cpp/stl/#vector","text":"\u9700\u8981\u5934\u6587\u4ef6#include \u4e0d\u5b9a\u6570\u7ec4 vector < int > a , b ; a . push_back ( 1 ); // \u63a8\u5165\u4e00\u4e2a\u65b0\u7684\u503c\u5230\u6570\u7ec4\u6700\u540e a . pop_back (); // \u5220\u9664\u6570\u7ec4\u6700\u540e\u7684\u90a3\u4e2a\u503c a . front (); // \u6570\u7ec4\u5f00\u5934\u7684\u503c a . back (); // \u6570\u7ec4\u7ed3\u5c3e\u7684\u503c a = b ; // \u6570\u7ec4\u62f7\u8d1d a == b ; // \u6570\u7ec4\u662f\u5426\u76f8\u540c a [ 1 ]; // \u6570\u7ec4\u4e2d\u7b2c\u4e8c\u4e2a\u503c vector < int > a ; a . size (); // \u5bb9\u5668\u5185\u7684\u5143\u7d20\u4e2a\u6570 a . empty (); // \u5bb9\u5668\u662f\u5426\u4e3a\u7a7a // \u9664\u4e86queue\u548cstack\u5916\u901a\u7528\u7684\u65b9\u6cd5 a . clear (); // \u6e05\u7a7a\u5bb9\u5668\u5185\u7684\u6240\u6709\u5143\u7d20 a . begin (); // \u5bb9\u5668\u7684\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668 a . end (); // \u5bb9\u5668\u5c3e\u540e\u8fed\u4ee3\u5668 vector < int > v ; vector < int >:: iterator iter // \u5b9a\u4e49\u8fed\u4ee3\u5668 iter = v . begin (); // \u6570\u7ec4\u5934\u201c\u6307\u9488\u201d iter = v . end (); // \u6570\u7ec4\u5c3e\u201c\u6307\u9488\u201d ==list==: 1.\u9700\u8981\u5934\u6587\u4ef6#include l; 2.\u53cc\u5411\u94fe\u8868 list < int > l ; l . push_front ( 1 ); // \u63d2\u5165\u5143\u7d20\u5230\u5f00\u5934 l . pop_front (); // \u4ece\u5f00\u5934\u5220\u6389\u5143\u7d20 l . erase ( l . begin ()); // \u5220\u9664\u6307\u5b9a\u8fed\u4ee3\u5668\u5904\u7684\u5143\u7d20 l . insert ( l . begin (), 1 ); // \u5728\u6307\u5b9a\u8fed\u4ee3\u5668\u524d\u63d2\u5165\u5143\u7d20 l . reverse (); // \u53cd\u8f6c\u6574\u4e2a\u94fe\u8868","title":"vector"},{"location":"cs/pl/c_cpp/stl/#string","text":"\u4f2a\u5b57\u7b26\u4e32\uff1b \u5b9a\u4e49\uff1astring s; \u53ea\u80fd\u6d41\u8f93\u5165\u548c\u6d41\u8f93\u51fa\uff1b string a , b ; a [ 1 ] == 'a' ; // \u5f97\u5230\u67d0\u4e2a\u5b57\u7b26 a = b ; // \u5b57\u7b26\u4e32\u62f7\u8d1d a >= b ; // \u5b57\u5178\u5e8f\u6bd4\u8f83 a [ 1 ] = b [ 1 ]; // \u4fee\u6539\u67d0\u4e2a\u5b57\u7b26 a += b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = a + b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a += \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = b + \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 int len = a . lenth (); // \u5b57\u7b26\u4e32\u7684\u957f\u5ea6","title":"string"},{"location":"cs/pl/c_cpp/stl/#queue","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u5148\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u94fe\u8868\u5b9e\u73b0\uff09 queue < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u961f\u5217 q . pop (); // \u63a8\u51fa\u961f\u5217\u5f00\u5934\u7684\u5143\u7d20 q . front (); // \u961f\u5217\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20","title":"queue"},{"location":"cs/pl/c_cpp/stl/#stack","text":"\u9700\u8981\u5934\u6587\u4ef6 #include ; \u540e\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u6570\u7ec4\u5b9e\u73b0\uff09 stack < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u5806\u6808 q . pop (); // \u63a8\u51fa\u5806\u6808\u6700\u540e\u7684\u5143\u7d20 q . top (); // \u5806\u6808\u7684\u6700\u540e\u7684\u5143\u7d20","title":"stack"},{"location":"cs/pl/c_cpp/stl/#pair","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \u8868\u793a\u4e00\u7ec4\u952e\u5bf9\uff08\u6709\u4e24\u4e2a\u53d8\u91cf\u7684\u7ed3\u6784\u4f53\uff09 pair < int , string > p ; p . first = 1 ; p . second = \"abc\" ; p = make_pair ( 1 , \"abc\" ); p = { 1 , \"abc\" }; pair < int , string > p [ 100 ]; sort ( p , p + 100 ); // \u9ed8\u8ba4\u4f18\u5148first\u4ece\u5c0f\u5230\u5927 // \u5982\u679cfirst\u76f8\u540c\u5219second\u4ece\u5c0f\u5230\u5927 pair\u4e0e\u5176\u4ed6\u7ed3\u6784\u5d4c\u5957 vector < pair < int , string > > vp ; queue < pair < float , int > > qp ; queue < pair < pair < int , int > , int > > qpp ;","title":"pair"},{"location":"cs/pl/c_cpp/stl/#set","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b set \u4fdd\u5b58\u4e86\u4e0d\u53ef\u91cd\u590d\u7684\u5143\u7d20-- \u4e8c\u53c9\u641c\u7d22\u6811-\u7ea2\u9ed1\u6811 set < int > s ; s . insert ( 1 ); // \u63d2\u5165\u5230\u96c6\u5408\u4e2d s . erase ( 1 ); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . erase ( s . begin ()); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . count ( 1 ); // \u96c6\u5408\u4e2d\u662f\u5426\u5b58\u5728 s . find ( 1 ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u7531\u4e8eset\u662f\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 \u5185\u90e8\u6709\u5e8f(\u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927) \u6ca1\u6709\u91cd\u590d\u503c\uff0c\u5982\u679c\u51fa\u73b0\u91cd\u590d\u503c\u4f1a\u4e0d\u65ad\u88ab\u8986\u76d6 \u51e0\u4e4e\u6240\u6709\u64cd\u4f5c\u590d\u6742\u5ea6\u5747\u4e3a O(logN) \u4e0d\u53ef\u4ee5\u4fee\u6539\u8282\u70b9\u4e0a\u7684\u503c \u4fee\u6539\u64cd\u4f5c\u53ea\u80fd\u8fdb\u884c\u63d2\u5165\u548c\u5220\u9664\u4e24\u4e2a\u64cd\u4f5c set\u901a\u5e38\u4f5c\u7528\uff1a\u4fdd\u8bc1\u552f\u4e00\u6027\uff0c\u4fdd\u8bc1\u6570\u5217\u6709\u5e8f","title":"set"},{"location":"cs/pl/c_cpp/stl/#map","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b map\u5b57\u5178\uff08\u952e\u5bf9\u96c6\u5408\uff09 \u2014\u2014\u4e8c\u53c9\u641c\u7d22\u6811\u2014\u2014\u7ea2\u9ed1\u6811 map < char , int > m ; m . insert ( make_pair ( 'a' , 1 )); // \u52a0\u5165\u5b57\u5178 m . insert ({ 'a' , 1 }); // \u52a0\u5165\u5b57\u5178 m . erase ( 'a' ); // \u4ece\u5b57\u5178\u4e2d\u5220\u9664 m . count ( 'a' ); // \u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728 m . find ( 'a' ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u901a\u5e38\u79f0map\u7684first\u5143\u7d20\u4e3akey\uff0csecond\u5143\u7d20\u4e3avalue \u00b7\u7531\u4e8emap\u662f\u952e\u5bf9\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 1\u3001set\u7684\u5927\u90e8\u5206\u6027\u8d28\uff1b 2\u3001key\u4e0d\u80fd\u91cd\u590d\uff0c\u4e0d\u80fd\u4fee\u6539\uff0c\u53ea\u80fd\u5220\u9664\u548c\u6dfb\u52a0\uff1b 3\u3001\u5141\u8bb8value\u91cd\u590d\uff0c\u53ef\u4ee5\u5bf9value\u8fdb\u884c\u4fee\u6539\uff1b 4\u3001map\u662f\u6309\u7167key\u8fdb\u884c\u6392\u5e8f\u7684\uff1b 5\u3001key\u548cvalue\u4e00\u5b9a\u662f\u6210\u5bf9\u51fa\u73b0\u7684\uff1b 6\u3001map\u7684\u8fed\u4ee3\u5668\u6307\u5411\u7684\u5185\u5bb9\u662f\u4e00\u4e2apair\uff1b","title":"map"},{"location":"cs/pl/c_cpp/stl/#priority_queue","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \u4f18\u5148\u961f\u5217--\u5806 priority_queue < int > prq ; prq . top (); // \u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . pop (); // \u5f39\u51fa\u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . push ( 1 ); // \u63a8\u5165\u5806 priority_queue\u9ed8\u8ba4\u4e3a\u6700\u5927\u5806\uff0c\u5373\u5806\u9876\u7684\u5143\u7d20\u6700\u5927 \u548cqueue\u4e00\u6837\uff0cpriority_queue\u4e0d\u5141\u8bb8\u8bbf\u95ee\u9664\u4e86\u5806\u9876\u5143\u7d20\u4ee5\u5916\u7684\u4efb\u4f55\u4e00\u4e2a\u5143\u7d20\u3002 priority_queue\u7684\u63d2\u5165\u548c\u5f39\u51fa\u64cd\u4f5c\u7684\u590d\u6742\u5ea6\u5747\u4e3aO(logN) priority_queue\u529f\u80fd\u4e0eset\u63a5\u8fd1\uff0c\u800c\u4e14set\u7684\u529f\u80fd\u66f4\u5f3a\u5927\uff0c\u5e76\u4e14\u7406\u8bba\u590d\u6742\u5ea6\u76f8\u540c\uff0c\u4e3a\u4ec0\u4e48\u6709\u65f6\u5019\u53cd\u800c\u5c31\u662f\u7528priority_queue\uff1f priority_queue\u7684\u590d\u6742\u5ea6\u4e3a\u6700\u5dee\u60c5\u51b5\u4e0b\u7684\u590d\u6742\u5ea6\uff0c\u800cset\u548cmap\u7684\u590d\u6742\u5ea6\u5747\u4e3a\u7a33\u5b9a\u590d\u6742\u5ea6\u7684\u6781\u9650\u503c","title":"priority_queue"},{"location":"cs/pl/go/","text":"Go \u00b6 Abstract \u672c\u4ee5\u4e3a\u8fdb\u5165\u5b57\u8282\u540e\u9700\u8981\u7528\u5230Go\uff0c\u5c31\u63d0\u524d\u5b66\u4e86 \u7ed3\u679c\u6211\u662f\u5c0f\u4e11\uff08\u6ca1hc\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b Table of Contents \u00b6 Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO)","title":"Go"},{"location":"cs/pl/go/#go","text":"Abstract \u672c\u4ee5\u4e3a\u8fdb\u5165\u5b57\u8282\u540e\u9700\u8981\u7528\u5230Go\uff0c\u5c31\u63d0\u524d\u5b66\u4e86 \u7ed3\u679c\u6211\u662f\u5c0f\u4e11\uff08\u6ca1hc\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b","title":"Go"},{"location":"cs/pl/go/#table-of-contents","text":"Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO)","title":"Table of Contents"},{"location":"cs/pl/go/basic/","text":"Go \u8bed\u6cd5\u57fa\u7840 \u00b6 \u7ea6 3054 \u4e2a\u5b57 158 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60 Go \u7684\u4e00\u4e9b\u8bed\u6cd5\uff0c\u548c\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u65e0\u592a\u5927\u533a\u522b\uff0c\u5165\u95e8\u8fd8\u662f\u5f88\u7b80\u5355\u7684 \u4e3a\u4ec0\u4e48\u5b66\u4e60 Go \u00b6 \u786c\u4ef6\u9650\u5236\uff1a\u6469\u5c14\u5b9a\u5f8b\u5df2\u7136\u5931\u6548 Go \u4e3a\u5e76\u53d1\u800c\u751f\uff1a\u5728\u591a\u6838\u5e76\u53d1\u4e0a\u62e5\u6709\u539f\u751f\u7684\u8bbe\u8ba1\u4f18\u52bf\uff0c\u4ece\u5e95\u5c42\u539f\u751f\u5e76\u53d1 Go \u6027\u80fd\u5f3a\u608d\uff1a\u540c C/C++ \u4e00\u6837\uff0cGo \u4e5f\u662f\u7f16\u8bd1\u578b\u8bed\u8a00\uff0c\u6267\u884c\u6548\u7387\u66f4\u9ad8\uff0c\u6027\u80fd\u66f4\u597d Go \u7b80\u5355\u6613\u5b66\uff1a\u8bed\u6cd5\u7b80\u6d01\u3001\u4ee3\u7801\u98ce\u683c\u7edf\u4e00\u3001\u5f00\u53d1\u6548\u7387\u9ad8 \u600e\u4e48\u88c5 Go \u00b6 \u4e0b\u8f7d \u00b6 Go \u5b98\u7f51\u4e0b\u8f7d\u5730\u5740 Go \u5b98\u65b9\u955c\u50cf\u7ad9\uff08\u63a8\u8350\uff09 Windows\u5e73\u53f0\u548cMac\u5e73\u53f0\u63a8\u8350\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u7248\uff0cLinux\u5e73\u53f0\u4e0b\u8f7d\u538b\u7f29\u6587\u4ef6\u7248\u3002 \u5b89\u88c5 \u00b6 Windows\uff1a\u4ee564\u4f4dWin10\u4e3e\u4f8b\uff0c\u5c06\u9009\u597d\u5b89\u88c5\u5305\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u53cc\u51fb\u4e00\u76f4next\uff0c \u6ce8\u610f\u8981\u6307\u5b9a\u4e00\u4e2aGo \u5b89\u88c5\u76ee\u5f55\uff0c\u8fd9\u5f88\u91cd\u8981 Linux\uff1a # \u5728\u7248\u672c\u9009\u62e9\u597d\u4e0b\u8f7d\u6587\u4ef6\u540e wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz # \u5c06\u4e0b\u8f7d\u597d\u7684\u6587\u4ef6\u89e3\u538b\u5230 `/usr/local` \u76ee\u5f55\u4e2d\uff0c\u6ca1\u6709\u6743\u9650\u52a0\u4e0a `sudo` tar -zxvf go1.14.1.linux-amd64.tar.gz -C /usr/local # \u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5728 `~/.profile` \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u5e76\u7528 `source` \u91cd\u65b0\u52a0\u8f7d export GOROOT = /usr/local/go export PATH = $PATH : $GOROOT /bin - Mac\uff1a\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u540e\uff0c\u76f4\u63a5\u70b9\u51fb\u4e0b\u4e00\u6b65\u5b89\u88c5\u5373\u53ef\uff0c\u9ed8\u8ba4\u4f1a\u5c06 go \u5b89\u88c5\u5230 /usr/local/go \u76ee\u5f55\u4e0b GOROOT \u548c GOPATH \u00b6 \u2002\u2002 GOROOT \u548c GOPATH \u90fd\u662f\u73af\u5883\u53d8\u91cf\uff0c\u5176\u4e2d GOROOT \u662f\u6211\u4eec\u5b89\u88c5go\u5f00\u53d1\u5305\u7684\u8def\u5f84\uff0c\u800c\u4ece Go 1.8 \u7248\u672c\u5f00\u59cb\uff0cGo\u5f00\u53d1\u5305\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u4f1a\u4e3a GOPATH \u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u76ee\u5f55\uff0c\u5e76\u4e14\u5728 Go1.14 \u53ca\u4e4b\u540e\u7684\u7248\u672c\u4e2d\u542f\u7528\u4e86 Go Module \u6a21\u5f0f\u4e4b\u540e\uff0c\u4e0d\u4e00\u5b9a\u975e\u8981\u5c06\u4ee3\u7801\u5199\u5230 GOPATH \u76ee\u5f55\u4e0b\uff0c\u6240\u4ee5\u4e5f\u5c31\u4e0d\u9700\u8981\u6211\u4eec\u518d\u81ea\u5df1\u914d\u7f6e GOPATH \u4e86\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684\u5373\u53ef\u3002 \u67e5\u770b GOPATH \u8def\u5f84\uff1a go env GOPROXY Go1.14 \u7248\u672c\u4e4b\u540e\uff0c\u90fd\u63a8\u8350\u4f7f\u7528 go mod \u6a21\u5f0f\u6765\u7ba1\u7406\u4f9d\u8d56\u73af\u5883\u4e86\uff0c\u4e5f\u4e0d\u518d\u5f3a\u5236\u6211\u4eec\u628a\u4ee3\u7801\u5fc5\u987b\u5199\u5728 GOPATH \u4e0b\u9762\u7684src\u76ee\u5f55\u4e86\uff0c\u4f60\u53ef\u4ee5\u5728\u4f60\u7535\u8111\u7684\u4efb\u610f\u4f4d\u7f6e\u7f16\u5199go\u4ee3\u7801\u3002\uff08\u7f51\u4e0a\u6709\u4e9b\u6559\u7a0b\u9002\u7528\u4e8e1.11\u7248\u672c\u4e4b\u524d\u3002\uff09 \u9ed8\u8ba4 GoPROXY \u914d\u7f6e\u662f\uff1a GOPROXY = https://proxy.golang.org,direct \uff0c\u7531\u4e8e\u56fd\u5185\u8bbf\u95ee\u4e0d\u5230 https://proxy.golang.org \uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u6362\u4e00\u4e2aPROXY\uff0c\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528 https://goproxy.io \u6216 https://goproxy.cn \u3002 \u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539GOPROXY\uff1a go env -w GOPROXY = https://goproxy.cn,direct \u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c Go \u00b6 \u2002\u2002\u4efb\u4f55\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u7f16\u5199 Go\uff08\u5305\u62ec\u8bb0\u4e8b\u672c\uff09\uff0c\u8fd9\u91cc\u63a8\u8350\u7528 VsCode\uff08\u9700\u5b89\u88c5 Go \u6269\u5c55\uff09\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528Sublime\uff0cJB \u7684\u5168\u5bb6\u6876\u7b49\u7b49 go mod init \u00b6 \u4f7f\u7528 go module \u6a21\u5f0f\u65b0\u5efa\u9879\u76ee\u65f6\uff0c\u6211\u4eec\u9700\u8981\u901a\u8fc7 go mod init \u9879\u76ee\u540d\u547d\u4ee4\u5bf9\u9879\u76ee\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u8be5\u547d\u4ee4\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210 go.mod \u6587\u4ef6\u3002\u6267\u884c\u5982\u4e0b\u547d\u4ee4 go mod init ${ project } \u8bb0\u5f97\u914d\u7f6e\u597d GOPROXY \u7f16\u8bd1\u3001\u8fd0\u884c\u3001\u5b89\u88c5 \u00b6 go build \uff1a \u547d\u4ee4\u8868\u793a\u5c06\u6e90\u4ee3\u7801\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002 go run \uff1a\u547d\u4ee4\u672c\u8d28\u4e0a\u662f\u5148\u5728\u4e34\u65f6\u76ee\u5f55\u7f16\u8bd1\u7a0b\u5e8f\u7136\u540e\u518d\u6267\u884c\u3002 go install \uff1a\u5b83\u5148\u7f16\u8bd1\u6e90\u4ee3\u7801\u5f97\u5230\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u53ef\u6267\u884c\u6587\u4ef6\u79fb\u52a8\u5230GOPATH\u7684bin\u76ee\u5f55\u4e0b\u3002\u56e0\u4e3a \u628a GOPATH \u4e0b\u7684 bin \u76ee\u5f55\u6dfb\u52a0\u5230\u4e86\u73af\u5883\u53d8\u91cf\u4e2d \uff0c\u6240\u4ee5\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u5730\u65b9\u76f4\u63a5\u6267\u884c\u53ef\u6267\u884c\u6587\u4ef6\u3002 go module \u00b6 \u2002\u2002 go module \u662fGo1.13\u7248\u672c\u4e4b\u540e\u3002Go\u8bed\u8a00\u9ed8\u8ba4\u7684\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\u3002 \u8bbe\u7f6e\u597d GO111MODULE=on \u5c31\u53ef\u4ee5\u4f7f\u7528 go module \u4f7f\u7528 go module`` \u7ba1\u7406\u4f9d\u8d56\u540e\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210\u4e24\u4e2a\u6587\u4ef6 go.mod \u548c go.sum` go mod \u547d\u4ee4\uff1a go mod download \u4e0b\u8f7d\u4f9d\u8d56\u7684module\u5230\u672c\u5730cache\uff08\u9ed8\u8ba4\u4e3a$GOPATH/pkg/mod\u76ee\u5f55\uff09 go mod edit \u7f16\u8f91go.mod\u6587\u4ef6 go mod graph \u6253\u5370\u6a21\u5757\u4f9d\u8d56\u56fe go mod init \u521d\u59cb\u5316\u5f53\u524d\u6587\u4ef6\u5939, \u521b\u5efago.mod\u6587\u4ef6 go mod tidy \u589e\u52a0\u7f3a\u5c11\u7684module\uff0c\u5220\u9664\u65e0\u7528\u7684module go mod vendor \u5c06\u4f9d\u8d56\u590d\u5236\u5230vendor\u4e0b go mod verify \u6821\u9a8c\u4f9d\u8d56 go mod why \u89e3\u91ca\u4e3a\u4ec0\u4e48\u9700\u8981\u4f9d\u8d56 go.mod\u6587\u4ef6\u8bb0\u5f55\u4e86\u9879\u76ee\u6240\u6709\u7684\u4f9d\u8d56\u4fe1\u606f \u5728\u9879\u76ee\u4e2d\u6267\u884c go get \u547d\u4ee4\u53ef\u4ee5\u4e0b\u8f7d\u4f9d\u8d56\u5305\uff0c\u5e76\u4e14\u8fd8\u53ef\u4ee5\u6307\u5b9a\u4e0b\u8f7d\u7684\u7248\u672c \u53d8\u91cf\u548c\u5e38\u91cf \u00b6 \u53d8\u91cf \u9700\u8981\u663e\u5f0f\u58f0\u660e\uff0c\u5e76\u4e14\u5728\u51fd\u6570\u8c03\u7528\u7b49\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u5668\u4f1a\u68c0\u67e5\u5176\u7c7b\u578b\u7684\u6b63\u786e\u6027 var \u58f0\u660e1\u4e2a\u6216\u591a\u4e2a\u53d8\u91cf\uff0cGo \u4f1a\u81ea\u52a8\u63a8\u65ad\u5df2\u7ecf\u6709\u521d\u59cb\u503c\u7684\u53d8\u91cf\u7c7b\u578b \u58f0\u660e\u540e\u5374\u6ca1\u6709\u7ed9\u51fa\u5bf9\u5e94\u7684\u521d\u59cb\u503c\u65f6\uff0c\u53d8\u91cf\u5c06\u4f1a\u521d\u59cb\u5316\u4e3a \u96f6\u503c \u3002 \u4f8b\u5982\uff0cint \u7684\u96f6\u503c\u662f 0 := \u8bed\u6cd5\u662f\u58f0\u660e\u5e76\u521d\u59cb\u5316\u53d8\u91cf\u7684\u7b80\u5199\uff08\u4e0d\u80fd\u5728\u51fd\u6570\u5916\u4f7f\u7528\uff09\uff0c \u4f8b\u5982 var f string = \"short\" \u53ef\u4ee5\u7b80\u5199\u4e3a f := \"short\" \u5728\u4f7f\u7528\u591a\u91cd\u8d4b\u503c\u65f6\uff0c\u5982\u679c\u60f3\u8981\u5ffd\u7565\u67d0\u4e2a\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528\u533f\u540d\u53d8\u91cf\uff0c\u4e00\u4e2a\u4e0b\u5212\u7ebf _ \u8868\u793a \u5e38\u91cf \u652f\u6301\u5b57\u7b26\u3001\u5b57\u7b26\u4e32\u3001\u5e03\u5c14\u548c\u6570\u503c\u5e38\u91cf const \u7528\u4e8e\u58f0\u660e\u4e00\u4e2a\u5e38\u91cf const \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u5728\u4efb\u4f55 var \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u7684\u5730\u65b9 iota \u662f\u5e38\u91cf\u8ba1\u6570\u5668\uff0c\u5728 const \u5173\u952e\u5b57\u51fa\u73b0\u65f6\u4f1a\u88ab\u91cd\u7f6e\u4e3a0 \u6761\u4ef6\u8bed\u53e5 \u00b6 if/else \u5206\u652f \u00b6 if-else if-else \u7ed3\u6784 Go \u89c4\u5b9a\u4e0e if \u5339\u914d\u7684\u5de6\u62ec\u53f7 { \u5fc5\u987b\u4e0e if \u548c\u8868\u8fbe\u5f0f\u653e\u5728\u540c\u884c\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4f1a\u89e6\u53d1\u7f16\u8bd1\u9519\u8bef\uff0c\u540c\u7406else \u5728\u6761\u4ef6\u8bed\u53e5\u4e4b\u524d\u53ef\u4ee5\u6709\u4e00\u4e2a\u58f0\u660e\u8bed\u53e5\uff1b\u5728\u8fd9\u91cc\u58f0\u660e\u7684\u53d8\u91cf\u53ef\u4ee5\u5728\u8fd9\u4e2a\u8bed\u53e5\u6240\u6709\u7684\u6761\u4ef6\u5206\u652f\u4e2d\u4f7f\u7528 \u5728 Go \u4e2d\uff0c\u6761\u4ef6\u8bed\u53e5\u7684\u5706\u62ec\u53f7\u4e0d\u662f\u5fc5\u9700\u7684\uff0c\u4f46\u662f\u82b1\u62ec\u53f7\u662f\u5fc5\u9700\u7684 Go \u6ca1\u6709\u4e09\u76ee\u8fd0\u7b97\u7b26\uff0c \u5373\u4f7f\u662f\u57fa\u672c\u7684\u6761\u4ef6\u5224\u65ad\uff0c\u4f9d\u7136\u9700\u8981\u4f7f\u7528\u5b8c\u6574\u7684 if \u8bed\u53e5 if-else if num := 9 ; num < 0 { fmt . Println ( num , \"is negative\" ) } else if num < 10 { fmt . Println ( num , \"has 1 digit\" ) } else { fmt . Println ( num , \"has multiple digits\" ) } switch \u5206\u652f \u00b6 \u4e0d\u5e26\u8868\u8fbe\u5f0f\u7684 switch \u662f\u5b9e\u73b0 if/else \u903b\u8f91\u7684\u53e6\u4e00\u79cd\u65b9\u5f0f \u6bcf\u4e2a switch \u53ea\u80fd\u6709\u4e00\u4e2a default \u5206\u652f \u4e00\u4e2a\u5206\u652f\u53ef\u4ee5\u6709\u591a\u4e2a\u503c\uff0c\u591a\u4e2acase\u503c\u4e2d\u95f4\u4f7f\u7528\u82f1\u6587\u9017\u53f7\u5206\u9694 fallthrough \u8bed\u6cd5\u53ef\u4ee5\u6267\u884c\u6ee1\u8db3\u6761\u4ef6\u7684case\u7684\u4e0b\u4e00\u4e2acase\uff0c\u662f\u4e3a\u4e86\u517c\u5bb9C\u8bed\u8a00\u4e2d\u7684case\u8bbe\u8ba1\u7684 switch func switchDemo5 () { s := \"a\" switch { case s == \"a\" : fmt . Println ( \"a\" ) fallthrough case s == \"b\" : fmt . Println ( \"b\" ) case s == \"c\" : fmt . Println ( \"c\" ) default : fmt . Println ( \"...\" ) } } \u5faa\u73af \u00b6 \u7ecf\u5178\u7684\u521d\u59cb/\u6761\u4ef6/\u540e\u7eed for \u5faa\u73af for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u53ef\u4ee5\u88ab\u5ffd\u7565\uff0c\u4f46\u662f\u521d\u59cb\u8bed\u53e5\u540e\u7684\u5206\u53f7\u5fc5\u987b\u8981\u5199 for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u548c\u7ed3\u675f\u8bed\u53e5\u90fd\u53ef\u4ee5\u7701\u7565 for\u5faa\u73af\u53ef\u4ee5\u901a\u8fc7break\u3001goto\u3001return\u3001panic\u8bed\u53e5\u5f3a\u5236\u9000\u51fa\u5faa\u73af Go\u8bed\u8a00\u4e2d\u53ef\u4ee5\u4f7f\u7528for range\u904d\u5386\u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u3001map \u53ca\u901a\u9053\uff08channel\uff09\u3002 \u901a\u8fc7for range\u904d\u5386\u7684\u8fd4\u56de\u503c\u6709\u4ee5\u4e0b\u89c4\u5f8b \u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u8fd4\u56de\u7d22\u5f15\u548c\u503c\u3002 map\u8fd4\u56de\u952e\u548c\u503c\u3002 \u901a\u9053\uff08channel\uff09\u53ea\u8fd4\u56de\u901a\u9053\u5185\u7684\u503c for for i := 0 ; i < 10 ; i ++ { ... } for ; i < 10 ; i ++ { ... } for i < 10 { ... } for i , v := range ** { ... } \u6570\u636e\u7c7b\u578b \u00b6 \u6570\u5b57\u4e0e\u8fd0\u7b97 \u00b6 \u6574\u578b\u6709int8/16/32/64\uff0c\u5305\u62ec\u5bf9\u5e94\u7684\u65e0\u7b26\u53f7\u6574\u578b \u6d6e\u70b9\u578b\u6709float32/64 \u590d\u6570\u6709complex64/128 \u8fd0\u7b97\uff1a \u548cC/C++\u65e0\u592a\u5927\u5dee\u522b \u5e03\u5c14\u7c7b\u578b \u00b6 \u901a\u8fc7 bool \u6765\u58f0\u660e\u5e03\u5c14\u578b\u6570\u636e\uff0c\u53ea\u6709 true \u548c false \u9ed8\u8ba4\u503c\u4e3a false \u4e0d\u5141\u8bb8\u5c06\u6574\u578b\u5f3a\u5236\u8f6c\u6362\u4e3a\u5e03\u5c14\u578b \u5e03\u5c14\u578b\u65e0\u6cd5\u53c2\u4e0e\u6570\u503c\u8fd0\u7b97\uff0c\u4e5f\u65e0\u6cd5\u4e0e\u5176\u4ed6\u7c7b\u578b\u8fdb\u884c\u8f6c\u6362 \u5b57\u7b26\u4e32 \u00b6 \u5b57\u7b26\u4e32\u7684\u5185\u90e8\u5b9e\u73b0\u4f7f\u7528 UTF-8 \u7f16\u7801\uff0c\u5b57\u7b26\u4e32\u7684\u503c\u4e3a\u53cc\u5f15\u53f7(\")\u4e2d\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u5728Go\u8bed\u8a00\u7684\u6e90\u7801\u4e2d\u76f4\u63a5\u6dfb\u52a0\u975eASCII\u7801\u5b57\u7b26 \u8981\u5b9a\u4e49\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u65f6\uff0c\u5c31\u5fc5\u987b\u4f7f\u7528\u53cd\u5f15\u53f7\u5b57\u7b26\uff0c\u53cd\u5f15\u53f7\u95f4\u6362\u884c\u5c06\u88ab\u4f5c\u4e3a\u5b57\u7b26\u4e32\u4e2d\u7684\u6362\u884c\uff0c\u4f46\u662f\u6240\u6709\u7684\u8f6c\u4e49\u5b57\u7b26\u5747\u65e0\u6548\uff0c\u6587\u672c\u5c06\u4f1a\u539f\u6837\u8f93\u51fa s := `\u7b2c\u4e00\u884c \u7b2c\u4e8c\u884c \u7b2c\u4e09\u884c ` \u5e38\u7528\u65b9\u6cd5 len(str) \uff1a\u6c42\u957f\u5ea6 +\u6216fmt.Sprintf \uff1a\u62fc\u63a5\u5b57\u7b26\u4e32 strings.Split \uff1a\u5206\u5272 strings.contains \uff1a\u5224\u65ad\u662f\u5426\u5305\u542b strings.HasPrefix,strings.HasSuffix \uff1a\u524d\u7f00/\u540e\u7f00\u5224\u65ad strings.Index(),strings.LastIndex() \uff1a\u5b50\u4e32\u51fa\u73b0\u7684\u4f4d\u7f6e strings.Join(a[]string, sep string) \uff1ajoin\u64cd\u4f5c byte\u548crune\u7c7b\u578b \u00b6 \u7ec4\u6210\u6bcf\u4e2a\u5b57\u7b26\u4e32\u7684\u5143\u7d20\u53eb\u505a\u201c\u5b57\u7b26\u201d\uff0c\u53ef\u4ee5\u901a\u8fc7\u904d\u5386\u6216\u8005\u5355\u4e2a\u83b7\u53d6\u5b57\u7b26\u4e32\u5143\u7d20\u83b7\u5f97\u5b57\u7b26\u3002 \u5b57\u7b26\u7528\u5355\u5f15\u53f7\uff08\u2019\uff09\u5305\u88f9\u8d77\u6765 Go \u5305\u62ec\u4e24\u79cd\u5b57\u7b26\uff1a uint8 \u7c7b\u578b\uff0c\u6216\u8005\u53eb byte \u578b\uff0c\u4ee3\u8868\u4e00\u4e2a ASCII \u7801\u5b57\u7b26 rune \u7c7b\u578b\uff0c\u4ee3\u8868\u4e00\u4e2a UTF-8 \u5b57\u7b26 \u5f53\u9700\u8981\u5904\u7406\u4e2d\u6587\u3001\u65e5\u6587\u6216\u8005\u5176\u4ed6\u590d\u5408\u5b57\u7b26\u65f6\uff0c\u5219\u9700\u8981\u7528\u5230 rune \u7c7b\u578b\u3002 rune \u7c7b\u578b\u5b9e\u9645\u662f\u4e00\u4e2a int32 Go \u4f7f\u7528\u4e86\u7279\u6b8a\u7684 rune \u7c7b\u578b\u6765\u5904\u7406 Unicode \uff0c\u8ba9\u57fa\u4e8e Unicode \u7684\u6587\u672c\u5904\u7406\u66f4\u4e3a\u65b9\u4fbf\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 byte \u578b\u8fdb\u884c\u9ed8\u8ba4\u5b57\u7b26\u4e32\u5904\u7406\uff0c\u6027\u80fd\u548c\u6269\u5c55\u6027\u90fd\u6709\u7167\u987e \u5b57\u7b26\u4e32\u5e95\u5c42\u662f\u4e00\u4e2abyte\u6570\u7ec4\uff0c\u6240\u4ee5\u53ef\u4ee5\u548c []byte \u7c7b\u578b\u76f8\u4e92\u8f6c\u6362 \u5b57\u7b26\u4e32\u662f\u4e0d\u80fd\u4fee\u6539\u7684\uff0c\u5b57\u7b26\u4e32\u662f\u7531 byte \u5b57\u8282\u7ec4\u6210\uff0c\u6240\u4ee5\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u662f byte \u5b57\u8282\u7684\u957f\u5ea6 rune \u7c7b\u578b\u7528\u6765\u8868\u793a utf8 \u5b57\u7b26\uff0c\u4e00\u4e2a rune \u5b57\u7b26\u7531\u4e00\u4e2a\u6216\u591a\u4e2a byte \u7ec4\u6210 \u8981\u4fee\u6539\u5b57\u7b26\u4e32\uff0c\u9700\u8981\u5148\u5c06\u5176\u8f6c\u6362\u6210 []rune \u6216 []byte \uff0c\u5b8c\u6210\u540e\u518d\u8f6c\u6362\u4e3a string byte and rune s1 := \"big\" // \u5f3a\u5236\u7c7b\u578b\u8f6c\u6362 byteS1 := [] byte ( s1 ) byteS1 [ 0 ] = 'p' fmt . Println ( string ( byteS1 )) s2 := \"\u767d\u841d\u535c\" runeS2 := [] rune ( s2 ) runeS2 [ 0 ] = '\u7ea2' fmt . Println ( string ( runeS2 )) \u6570\u7ec4 \u00b6 \u5b9a\u4e49\u4e00\u4e2a\u957f\u5ea6\u4e3a3\u5143\u7d20\u7c7b\u578b\u4e3aint\u7684\u6570\u7ec4a\uff1a var a [3]int \u5185\u7f6e\u51fd\u6570 len \u53ef\u4ee5\u8fd4\u56de\u6570\u7ec4\u7684\u957f\u5ea6 \u521d\u59cb\u5316 \u53ef\u4ee5\u4f7f\u7528\u521d\u59cb\u5316\u5217\u8868\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff1a var num = [3]int{1, 2} \u53ef\u4ee5\u8ba9\u7f16\u8bd1\u5668\u6839\u636e\u521d\u59cb\u503c\u7684\u4e2a\u6570\u81ea\u884c\u63a8\u65ad\u6570\u7ec4\u7684\u957f\u5ea6\uff0c var num = [...]{1, 2} \u6307\u5b9a\u7d22\u5f15\u503c\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff0c num := [...]int{1: 1, 3: 5} \u904d\u5386 for i := 0; i < len(a); i ++ {} for index, value := range a {} \u591a\u7ef4\u6570\u7ec4\u5b9a\u4e49\uff0c a := [2][3]int \u591a\u7ef4\u6570\u7ec4\u53ea\u6709\u7b2c\u4e00\u5c42\u53ef\u4ee5\u4f7f\u7528 ... \u6765\u8ba9\u7f16\u8bd1\u5668\u63a8\u5bfc\u6570\u7ec4\u957f\u5ea6\uff0c\u4e0d\u652f\u6301\u5185\u5c42\u4f7f\u7528 \u6570\u7ec4\u662f\u503c\u7c7b\u578b\uff0c\u8d4b\u503c\u548c\u4f20\u53c2\u4f1a\u590d\u5236\u6574\u4e2a\u6570\u7ec4\uff0c\u56e0\u6b64\u6539\u53d8\u526f\u672c\u7684\u503c\uff0c\u4e0d\u4f1a\u6539\u53d8\u672c\u8eab\u7684\u503c [n]*T \u8868\u793a\u6307\u9488\u6570\u7ec4\uff0c *[n]T \u8868\u793a\u6570\u7ec4\u6307\u9488 \u5207\u7247 \u00b6 \u5b9a\u4e49 \u5207\u7247\uff08Slice\uff09\u662f\u4e00\u4e2a\u62e5\u6709\u76f8\u540c\u7c7b\u578b\u5143\u7d20\u7684\u53ef\u53d8\u957f\u5ea6\u7684\u5e8f\u5217\u3002\u5b83\u662f\u57fa\u4e8e\u6570\u7ec4\u7c7b\u578b\u505a\u7684\u4e00\u5c42\u5c01\u88c5\u3002\u5b83\u975e\u5e38\u7075\u6d3b\uff0c\u652f\u6301\u81ea\u52a8\u6269\u5bb9 \u5207\u7247\u58f0\u660e\uff1a var name []T \uff0cname \u8868\u793a\u53d8\u91cf\u540d\uff0cT \u8868\u793a\u5207\u7247\u4e2d\u7684\u5143\u7d20\u7c7b\u578b \u5207\u7247\u62e5\u6709\u81ea\u5df1\u7684\u957f\u5ea6\u548c\u5bb9\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5185\u7f6e\u7684len()\u51fd\u6570\u6c42\u957f\u5ea6\uff0c\u4f7f\u7528\u5185\u7f6e\u7684cap()\u51fd\u6570\u6c42\u5207\u7247\u7684\u5bb9\u91cf \u5207\u7247\u7684\u5e95\u5c42\u5c31\u662f\u6570\u7ec4\uff0c\u548c Python \u4e00\u6837\uff0c\u53ef\u4ee5\u4f7f\u7528 b := a[1:3] \uff0c\u8868\u793a\u4ece\u6570\u7ec4 a \u4e2d\u9009\u51fa \u7d22\u5f15\u503c\u5728 \\([1,3)\\) \u4e2d\u7684\u5143\u7d20\u7ec4\u6210\u5207\u7247 b \u5b8c\u6574\u7684\u5207\u7247\u8868\u8fbe\u5f0f\uff1a a[low: high: max] \uff0c\u5f97\u5230\u7684\u7ed3\u679c\u5207\u7247\u7684\u5bb9\u91cf\u8bbe\u7f6e\u4e3a max - low \uff0clow \u53ef\u4ee5\u7701\u7565\uff0c\u9ed8\u8ba4\u4e3a0 \u4f7f\u7528\u5185\u7f6e make\u51fd\u6570 \u6784\u9020\u5207\u7247\uff0c make([]T, size, cap) \uff0cT \u8868\u793a\u5143\u7d20\u7c7b\u578b\uff0csize \u8868\u793a\u5143\u7d20\u6570\u91cf\uff0ccap \u8868\u793a\u5207\u7247\u5bb9\u91cf \u5224\u65ad\u5207\u7247\u662f\u5426\u4e3a\u7a7a\uff0c\u8bf7\u4f7f\u7528 len(s) == 0 \uff0c\u4e0d\u8981\u4f7f\u7528 s == nil \u5207\u7247\u4e0d\u80fd\u76f4\u63a5\u6bd4\u8f83 \u5207\u7247\u904d\u5386\u548c\u6570\u7ec4\u4e00\u6837 \u53ef\u4ee5\u7528 append() \u4e3a\u5207\u7247\u6dfb\u52a0\u5143\u7d20 s = append(s, 1,2,3) \uff0c\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5143\u7d20 s = append(s, s2...) \u5207\u7247\u7684\u6269\u5bb9\u7b56\u7565\uff08\u7565\uff09 \u53ef\u4ee5\u4f7f\u7528 copy() \u590d\u5236\u5207\u7247\uff0c\u4f46\u5207\u7247\u662f\u5f15\u7528\u7c7b\u578b\uff0c\u6240\u4ee5\u4e24\u4e2a\u5207\u7247\u90fd\u6307\u5411\u540c\u4e00\u5757\u5185\u5b58\u5730\u5740\uff0c\u5bf9\u4e00\u4e2a\u5207\u7247\u7684\u4fee\u6539\u4f1a\u5f71\u54cd\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5185\u5bb9 \u6392\u5e8f\uff0c\u9700\u8981 import sort \uff0c\u6392\u5e8f\u65f6\u53ef\u81ea\u5b9a\u4e49\u6392\u5e8f sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) Map \u00b6 \u4e00\u79cd\u65e0\u5e8f\u7684 key-value \u6570\u636e\u7ed3\u6784\uff0c\u5728 Go \u4e2d map \u662f\u5f15\u7528\u7c7b\u578b\uff0c\u5fc5\u987b\u521d\u59cb\u5316\u624d\u80fd\u4f7f\u7528 \u5b9a\u4e49\uff1a map[KeyType]ValueType \uff0cKeyType \u8868\u793a\u952e\u7684\u7c7b\u578b\uff0cValueType \u8868\u793a\u952e\u5bf9\u5e94\u7684\u503c\u7684\u7c7b\u578b\uff0c x := map[int]int{1:3, 2:4} \u6216 s := make([int]int, 2), s[1] = 3, s[2] = 4 \u5224\u65ad\u952e\u662f\u5426\u5b58\u5728\uff1a value, ok := map[key] \uff0c\u67e5\u770b ok \u662f\u5426\u4e3a true \u904d\u5386\uff1a for k, v := range map {} \uff0cv \u53ef\u7701\u7565\uff0c\u904d\u5386\u5143\u7d20\u7684\u987a\u5e8f\u4e0e\u6dfb\u52a0\u952e\u503c\u5bf9\u7684\u987a\u5e8f\u65e0\u5173\uff0c\u53ef\u4ee5\u628a key \u653e\u5165 slice \u4e2d\u6392\u5e8f\uff0c\u7136\u540e\u904d\u5386 slice \u5c31\u53ef\u4ee5\u6307\u5b9a\u987a\u5e8f delete() \u4ece map \u4e2d\u5220\u9664\u4e00\u7ec4\u952e\u503c\u5bf9 \u51fd\u6570 \u00b6 \u4f7f\u7528 func \u6765\u5b9a\u4e49\u51fd\u6570 \u901a\u8fc7\u51fd\u6570\u540d\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570 \u51fd\u6570\u7684\u53c2\u6570\u4e2d\u5982\u679c\u76f8\u90bb\u53d8\u91cf\u7684\u7c7b\u578b\u76f8\u540c\uff0c\u5219\u53ef\u4ee5\u7701\u7565\u7c7b\u578b\uff0c \u53ef\u53d8\u53c2\u6570\u662f\u6307\u51fd\u6570\u7684\u53c2\u6570\u6570\u91cf\u4e0d\u56fa\u5b9a\u3002Go\u8bed\u8a00\u4e2d\u7684\u53ef\u53d8\u53c2\u6570\u901a\u8fc7\u5728\u53c2\u6570\u540d\u540e\u52a0 ... \u6765\u6807\u8bc6\uff0c\u53ef\u53d8\u53c2\u6570\u901a\u5e38\u8981\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u53c2\u6570 \u51fd\u6570\u5982\u679c\u6709\u591a\u4e2a\u8fd4\u56de\u503c\uff0c\u5fc5\u987b\u4f7f\u7528 () \u5c06\u6240\u6709\u8fd4\u56de\u503c\u5305\u88f9 \u51fd\u6570\u5b9a\u4e49\u65f6\u53ef\u4ee5\u7ed9\u8fd4\u56de\u503c\u547d\u540d\uff0c\u5e76\u5728\u51fd\u6570\u4f53\u4e2d\u76f4\u63a5\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff0c\u6700\u540e\u901a\u8fc7return\u5173\u952e\u5b57\u8fd4\u56de \u53ef\u4ee5\u4f7f\u7528 type \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u7c7b\u578b \u9ad8\u9636\u51fd\u6570 \u51fd\u6570\u4f5c\u4e3a\u53c2\u6570 \u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c \u53ef\u4ee5\u5b9a\u4e49\u533f\u540d\u51fd\u6570\uff0c add := func(x, y int) \uff0c\u591a\u7528\u4e8e\u56de\u8c03\u51fd\u6570\u548c\u95ed\u5305 \u95ed\u5305=\u51fd\u6570+\u5f15\u7528\u73af\u5883\uff08\u7565\uff09 defer \u8bed\u53e5\uff0c\u5c06\u5176\u540e\u9762\u8ddf\u968f\u7684\u8bed\u53e5\u8fdb\u884c\u5ef6\u8fdf\u5904\u7406\uff0c\u4f1a\u88ab\u9006\u5e8f\u5904\u7406 \u4f7f\u7528 panic/recover \u6a21\u5f0f\u6765\u5904\u7406\u9519\u8bef\uff0c recover()\u5fc5\u987b\u642d\u914ddefer\u4f7f\u7528\uff0cdefer\u4e00\u5b9a\u8981\u5728\u53ef\u80fd\u5f15\u53d1panic\u7684\u8bed\u53e5\u4e4b\u524d\u5b9a\u4e49 func func \u51fd\u6570\u540d ( \u53c2\u6570 )( \u8fd4\u56de\u503c ) { \u51fd\u6570\u4f53 } func add ( a , b int ) int { return x + b } func intSum2 ( x ... int ) int { fmt . Println ( x ) //x\u662f\u4e00\u4e2a\u5207\u7247 sum := 0 for _ , v := range x { sum = sum + v } return sum } func calc ( x , y int ) ( int , int ) { reurn x + y , x - y } func calc ( x , y int ) ( sum , sub int ) { sum = x + y sub = x - y return } func add ( x , y int ) int { return x + y } func calc ( x , y int , op func ( int , int ) int ) int { return op ( x , y ) } func main () { ret2 := calc ( 10 , 20 , add ) fmt . Println ( ret2 ) //30 } func do ( s string ) ( func ( int , int ) int , error ) { switch s { case \"+\" : return add , nil case \"-\" : return sub , nil default : err := errors . New ( \"\u65e0\u6cd5\u8bc6\u522b\u7684\u64cd\u4f5c\u7b26\" ) return nil , err } } \u6307\u9488 \u00b6 \u548c C \u7684\u533a\u522b\u4e0d\u5927\uff0c\u90fd\u662f\u7528 * \u548c & \u6765\u64cd\u4f5c\uff0c * \u8868\u793a\u53d6\u503c\u64cd\u4f5c\u7b26\uff0c & \u8868\u793a\u53d6\u5730\u5740\u64cd\u4f5c\u7b26 new \u548c make \u5206\u914d\u5185\u5b58 a = new(int) \uff0cmake \u53ea\u7528\u4e8eslice\u3001map\u4ee5\u53cachannel\u7684\u5185\u5b58\u521b\u5efa\uff0c\u8fd4\u56de\u7684\u662f\u5f15\u7528\u7c7b\u578b \u800cnew\u7528\u4e8e\u7c7b\u578b\u7684\u5185\u5b58\u5206\u914d\uff0c\u5e76\u4e14\u5185\u5b58\u5bf9\u5e94\u7684\u503c\u4e3a\u7c7b\u578b\u96f6\u503c\uff0c\u8fd4\u56de\u7684\u662f\u6307\u5411\u7c7b\u578b\u7684\u6307\u9488 \u7ed3\u6784\u4f53 \u00b6 \u5b9a\u4e49\u4e0e\u521d\u59cb\u5316 \u00b6 type \u5b9a\u4e49\u7c7b\u578b\u522b\u540d type + struct \u5b9a\u4e49\u7ed3\u6784\u4f53\uff0ctype \u7c7b\u578b\u540d struct { \u5b57\u6bb5\u540d \u5b57\u6bb5\u7c7b\u578b ...} \u4f7f\u7528 var \u5b9e\u4f8b\u5316\u7ed3\u6784\u4f53 \u901a\u8fc7 . \u8bbf\u95ee\u7ed3\u6784\u4f53\u5b57\u6bb5 \u521d\u59cb\u5316 \u6ca1\u6709\u521d\u59cb\u5316\u7684\u7ed3\u6784\u4f53\uff0c\u5176\u6210\u5458\u53d8\u91cf\u90fd\u662f\u5bf9\u5e94\u5176\u7c7b\u578b\u7684\u96f6\u503c \u4f7f\u7528\u952e\u503c\u5bf9\u5bf9\u7ed3\u6784\u4f53\u8fdb\u884c\u521d\u59cb\u5316\u65f6\uff0c\u952e\u5bf9\u5e94\u7ed3\u6784\u4f53\u7684\u5b57\u6bb5\uff0c\u503c\u5bf9\u5e94\u8be5\u5b57\u6bb5\u7684\u521d\u59cb\u503c \u7ed3\u6784\u4f53\u5360\u7528\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\uff0c\u7a7a\u7ed3\u6784\u4f53\u662f\u4e0d\u5360\u7528\u7a7a\u95f4\u7684 \u7ed3\u6784\u9898\u6ca1\u6709\u6784\u9020\u51fd\u6570\uff0c\u4f46\u662f\u53ef\u4ee5\u81ea\u5df1\u5b9e\u73b0 \u6784\u9020\u51fd\u6570 func newPerson ( name , city string , age int8 ) * person { return & person { name : name , city : city , age : age , } } \u65b9\u6cd5 \u00b6 \u65b9\u6cd5\uff08Method\uff09\u662f\u4e00\u79cd\u4f5c\u7528\u4e8e\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u7684\u51fd\u6570\u3002\u8fd9\u79cd\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u53eb\u505a\u63a5\u6536\u8005\uff08Receiver\uff09\u3002\u63a5\u6536\u8005\u7684\u6982\u5ff5\u5c31\u7c7b\u4f3c\u4e8e\u5176\u4ed6\u8bed\u8a00\u4e2d\u7684 this \u6216\u8005 self\uff0c\u5f53\u7136\u8fd8\u53ef\u4ee5\u6709\u6307\u9488\u7c7b\u578b\u7684\u63a5\u6536\u8005 func ( \u63a5\u6536\u8005\u53d8\u91cf \u63a5\u6536\u8005\u7c7b\u578b ) \u65b9\u6cd5\u540d ( \u53c2\u6570\u5217\u8868 ) ( \u8fd4\u56de\u53c2\u6570 ) { \u51fd\u6570\u4f53 } \u65b9\u6cd5\u4e0e\u51fd\u6570\u7684\u533a\u522b\u662f\uff0c\u51fd\u6570\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u7c7b\u578b\uff0c\u65b9\u6cd5\u5c5e\u4e8e\u7279\u5b9a\u7684\u7c7b\u578b \u5176\u4ed6 \u00b6 \u7ed3\u6784\u4f53\u5141\u8bb8\u5176\u6210\u5458\u5b57\u6bb5\u5728\u58f0\u660e\u65f6\u6ca1\u6709\u5b57\u6bb5\u540d\u800c\u53ea\u6709\u7c7b\u578b\uff0c\u8fd9\u79cd\u6ca1\u6709\u540d\u5b57\u7684\u5b57\u6bb5\u5c31\u79f0\u4e3a\u533f\u540d\u5b57\u6bb5 \u4e00\u4e2a\u7ed3\u6784\u4f53\u4e2d\u53ef\u4ee5\u5d4c\u5957\u5305\u542b\u53e6\u4e00\u4e2a\u7ed3\u6784\u4f53\u6216\u7ed3\u6784\u4f53\u6307\u9488 \u901a\u8fc7\u7ed3\u6784\u4f53\u53ef\u4ee5\u5b9e\u73b0\u201c\u7ee7\u627f\u201d \u7ed3\u6784\u4f53\u4e2d\u5b57\u6bb5\u5927\u5199\u5f00\u5934\u8868\u793a\u53ef\u516c\u5f00\u8bbf\u95ee\uff0c\u5c0f\u5199\u8868\u793a\u79c1\u6709\uff08\u4ec5\u5728\u5b9a\u4e49\u5f53\u524d\u7ed3\u6784\u4f53\u7684\u5305\u4e2d\u53ef\u8bbf\u95ee\uff09 \u7ed3\u6784\u4f53\u53ef\u4ee5\u4f7f\u7528 JSON \u5e8f\u5217\u5316 \u63a5\u53e3 \u00b6 \u63a5\u53e3\u7c7b\u578b \u00b6 \u63a5\u53e3\u662f\u4e00\u79cd\u7531\u7a0b\u5e8f\u5458\u6765\u5b9a\u4e49\u7684\u7c7b\u578b\uff0c\u4e00\u4e2a\u63a5\u53e3\u7c7b\u578b\u5c31\u662f\u4e00\u7ec4\u65b9\u6cd5\u7684\u96c6\u5408\uff0c\u5b83\u89c4\u5b9a\u4e86\u9700\u8981\u5b9e\u73b0\u7684\u6240\u6709\u65b9\u6cd5 \u6bcf\u4e2a\u63a5\u53e3\u7c7b\u578b\u7531\u4efb\u610f\u4e2a\u65b9\u6cd5\u7b7e\u540d\u7ec4\u6210 type \u63a5\u53e3\u7c7b\u578b\u540d interface { \u65b9\u6cd5\u540d1 ( \u53c2\u6570\u5217\u88681 ) \u8fd4\u56de\u503c\u5217\u88681 \u65b9\u6cd5\u540d2 ( \u53c2\u6570\u5217\u88682 ) \u8fd4\u56de\u503c\u5217\u88682 ... } \u63a5\u53e3\u5c31\u662f\u89c4\u5b9a\u4e86\u4e00\u4e2a\u9700\u8981\u5b9e\u73b0\u7684\u65b9\u6cd5\u5217\u8868\uff0c\u5728 Go \u8bed\u8a00\u4e2d\u4e00\u4e2a\u7c7b\u578b\u53ea\u8981\u5b9e\u73b0\u4e86\u63a5\u53e3\u4e2d\u89c4\u5b9a\u7684\u6240\u6709\u65b9\u6cd5\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u79f0\u5b83\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u63a5\u53e3 \u53ef\u4ee5\u901a\u8fc7\u503c\u63a5\u6536\u8005\u6216\u6307\u9488\u63a5\u6536\u8005\u5b9e\u73b0\u501f\u53e3 \u7c7b\u578b\u4e0e\u63a5\u53e3\u7684\u5173\u7cfb \u00b6 \u4e00\u4e2a\u7c7b\u578b\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u591a\u79cd\u7c7b\u578b\u5b9e\u73b0\u540c\u4e00\u63a5\u53e3 \u63a5\u53e3\u7ec4\u5408 \u00b6 \u63a5\u53e3\u4e0e\u63a5\u53e3\u4e4b\u95f4\u53ef\u4ee5\u901a\u8fc7\u4e92\u76f8\u5d4c\u5957\u5f62\u6210\u65b0\u7684\u63a5\u53e3\u7c7b\u578b\uff0c\u4f8b\u5982Go\u6807\u51c6\u5e93io\u6e90\u7801\u4e2d\u5c31\u6709\u5f88\u591a\u63a5\u53e3\u4e4b\u95f4\u4e92\u76f8\u7ec4\u5408\u7684\u793a\u4f8b \u7a7a\u63a5\u53e3 \u00b6 \u7a7a\u63a5\u53e3\u662f\u6307\u6ca1\u6709\u5b9a\u4e49\u4efb\u4f55\u65b9\u6cd5\u7684\u63a5\u53e3\u7c7b\u578b\u3002\u56e0\u6b64\u4efb\u4f55\u7c7b\u578b\u90fd\u53ef\u4ee5\u89c6\u4e3a\u5b9e\u73b0\u4e86\u7a7a\u63a5\u53e3\u3002\u4e5f\u6b63\u662f\u56e0\u4e3a\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u8fd9\u4e2a\u7279\u6027\uff0c\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cf\u53ef\u4ee5\u5b58\u50a8\u4efb\u610f\u7c7b\u578b\u7684\u503c \u901a\u5e38\u6211\u4eec\u5728\u4f7f\u7528\u7a7a\u63a5\u53e3\u7c7b\u578b\u65f6\u4e0d\u5fc5\u4f7f\u7528type\u5173\u952e\u5b57\u58f0\u660e\uff0c\u53ef\u4ee5\u50cf\u4e0b\u9762\u7684\u4ee3\u7801\u4e00\u6837\u76f4\u63a5\u4f7f\u7528interface{}\uff0c var x interface{} \u7a7a\u63a5\u53e3\u4f5c\u4e3a\u51fd\u6570\u7684\u53c2\u6570\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u63a5\u6536\u4efb\u610f\u7c7b\u578b\u7684\u51fd\u6570\u53c2\u6570 \u7a7a\u63a5\u53e3\u4f5c\u4e3amap\u7684\u503c\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u4fdd\u5b58\u4efb\u610f\u503c\u7684\u5b57\u5178 Error \u63a5\u53e3 \u00b6 Go \u8bed\u8a00\u4e2d\u628a\u9519\u8bef\u5f53\u6210\u4e00\u79cd\u7279\u6b8a\u7684\u503c\u6765\u5904\u7406\uff0c\u4e0d\u652f\u6301\u5176\u4ed6\u8bed\u8a00\u4e2d\u4f7f\u7528 try/catch \u6355\u83b7\u5f02\u5e38\u7684\u65b9\u5f0f Go \u8bed\u8a00\u4e2d\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a error \u63a5\u53e3\u6765\u8868\u793a\u9519\u8bef\u7c7b\u578b \u5f53\u4e00\u4e2a\u51fd\u6570\u6216\u65b9\u6cd5\u9700\u8981\u8fd4\u56de\u9519\u8bef\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u662f\u628a\u9519\u8bef\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u8fd4\u56de\u503c\uff0c\u4f8b\u5982\u4e4b\u524d\u67e5\u8be2map\u4e2d\u662f\u5426\u5b58\u5728\u952e\u503c\u5bf9 \u9ed8\u8ba4\u96f6\u503c\u4e3a nil \u4f7f\u7528 fmt.Errorf \u624d\u63cf\u8ff0\u9519\u8bef\u4fe1\u606f \u53ef\u4ee5\u5bf9\u81ea\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9e\u73b0 error \u63a5\u53e3 \u6807\u51c6\u5e93 \u00b6 fmt \u00b6 \u2002\u2002fmt\u5305\u5b9e\u73b0\u4e86\u7c7b\u4f3cC\u8bed\u8a00printf\u548cscanf\u7684\u683c\u5f0f\u5316I/O\u3002\u4e3b\u8981\u5206\u4e3a\u5411\u5916\u8f93\u51fa\u5185\u5bb9\u548c\u83b7\u53d6\u8f93\u5165\u5185\u5bb9\u4e24\u5927\u90e8\u5206 \u5411\u5916\u8f93\u51fa \u00b6 Print() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u7cfb\u7edf\u7684\u6807\u51c6\u8f93\u51fa Fprint() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u4e00\u4e2aio.Writer\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cfw\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u7528\u8fd9\u4e2a\u51fd\u6570\u5f80\u6587\u4ef6\u4e2d\u5199\u5165\u5185\u5bb9 Sprint() \uff1a\u628a\u4f20\u5165\u7684\u6570\u636e\u751f\u6210\u5e76\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32 Errorf() \uff1a\u6839\u636eformat\u53c2\u6570\u751f\u6210\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u8be5\u5b57\u7b26\u4e32\u7684\u9519\u8bef \u83b7\u53d6\u8f93\u5165 \u00b6 Scan() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d\uff0c\u6362\u884c\u7b26\u89c6\u4e3a\u7a7a\u767d\u7b26 Scanf() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u6839\u636eformat\u53c2\u6570\u6307\u5b9a\u7684\u683c\u5f0f\u53bb\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d Scanln() \uff1a\u7c7b\u4f3cScan\uff0c\u5b83\u5728\u9047\u5230\u6362\u884c\u65f6\u624d\u505c\u6b62\u626b\u63cf\u3002\u6700\u540e\u4e00\u4e2a\u6570\u636e\u540e\u9762\u5fc5\u987b\u6709\u6362\u884c\u6216\u8005\u5230\u8fbe\u7ed3\u675f\u4f4d\u7f6e bufio.NewReader \uff1a\u65f6\u5019\u6211\u4eec\u60f3\u5b8c\u6574\u83b7\u53d6\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u800c\u8f93\u5165\u7684\u5185\u5bb9\u53ef\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u4f7f\u7528bufio\u5305\u6765\u5b9e\u73b0 Fscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4eceio.Reader\u4e2d\u8bfb\u53d6\u6570\u636e Sscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4ece\u6307\u5b9a\u5b57\u7b26\u4e32\u4e2d\u8bfb\u53d6\u6570\u636e log \u00b6 Go\u8bed\u8a00\u5185\u7f6e\u7684log\u5305\u5b9e\u73b0\u4e86\u7b80\u5355\u7684\u65e5\u5fd7\u670d\u52a1 log package main import ( \"log\" ) func main () { log . Println ( \"\u8fd9\u662f\u4e00\u6761\u5f88\u666e\u901a\u7684\u65e5\u5fd7\u3002\" ) v := \"\u5f88\u666e\u901a\u7684\" log . Printf ( \"\u8fd9\u662f\u4e00\u6761%s\u65e5\u5fd7\u3002\\n\" , v ) log . Fatalln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1fatal\u7684\u65e5\u5fd7\u3002\" ) log . Panicln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1panic\u7684\u65e5\u5fd7\u3002\" ) } \u9664\u4e86\u9ed8\u8ba4\u63d0\u4f9b\u65e5\u5fd7\u7684\u65f6\u95f4\u4fe1\u606f\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6elogger\u6765\u8bbe\u7f6e\u8f93\u51fa\u4fe1\u606f \u6587\u4ef6\u64cd\u4f5c \u00b6 \u6253\u5f00\u548c\u5173\u95ed\u6587\u4ef6 \u00b6 os.Open() \u51fd\u6570\u80fd\u591f\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u8fd4\u56de\u4e00\u4e2a *File \u548c\u4e00\u4e2a err \u3002\u5bf9\u5f97\u5230\u7684\u6587\u4ef6\u5b9e\u4f8b\u8c03\u7528 close() \u65b9\u6cd5\u80fd\u591f\u5173\u95ed\u6587\u4ef6 open and close package main import ( \"fmt\" \"os\" ) func main () { // \u53ea\u8bfb\u65b9\u5f0f\u6253\u5f00\u5f53\u524d\u76ee\u5f55\u4e0b\u7684main.go\u6587\u4ef6 file , err := os . Open ( \"./main.go\" ) if err != nil { fmt . Println ( \"open file failed!, err:\" , err ) return } // \u5173\u95ed\u6587\u4ef6 file . Close () } \u4e3a\u4e86\u9632\u6b62\u6587\u4ef6\u5fd8\u8bb0\u5173\u95ed\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528defer\u6ce8\u518c\u6587\u4ef6\u5173\u95ed\u8bed\u53e5 \u8bfb\u53d6\u6587\u4ef6 \u00b6 file.Read() \u63a5\u6536\u4e00\u4e2a\u5b57\u8282\u5207\u7247\uff0c\u8fd4\u56de\u8bfb\u53d6\u7684\u5b57\u8282\u6570\u548c\u53ef\u80fd\u7684\u5177\u4f53\u9519\u8bef\uff0c\u8bfb\u5230\u6587\u4ef6\u672b\u5c3e\u65f6\u4f1a\u8fd4\u56de0\u548cio.EOF func ( f * File ) Read ( b [] byte ) ( n int , err error ) \u4f7f\u7528 for \u5faa\u73af\u8bfb\u53d6\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6570\u636e bufio\u8bfb\u53d6\u6587\u4ef6 bufio \u662f\u5728 file \u7684\u57fa\u7840\u4e0a\u5c01\u88c5\u4e86\u4e00\u5c42API\uff0c\u652f\u6301\u66f4\u591a\u7684\u529f\u80fd \u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6 io/ioutil \u5305\u7684 ReadFile \u65b9\u6cd5\u80fd\u591f\u8bfb\u53d6\u5b8c\u6574\u7684\u6587\u4ef6\uff0c\u53ea\u9700\u8981\u5c06\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165 \u6587\u4ef6\u5199\u5165\u64cd\u4f5c \u00b6 os.OpenFile() \u51fd\u6570\u80fd\u591f\u4ee5\u6307\u5b9a\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u4ece\u800c\u5b9e\u73b0\u6587\u4ef6\u5199\u5165\u76f8\u5173\u529f\u80fd Write \u548c WriteString bufio.NewWriter ioutil.WriteFile strconv \u00b6 \u2002\u2002strconv\u5305\u5b9e\u73b0\u4e86\u57fa\u672c\u6570\u636e\u7c7b\u578b\u4e0e\u5176\u5b57\u7b26\u4e32\u8868\u793a\u7684\u8f6c\u6362 Atoi() \u00b6 \u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u6574\u6570\u8f6c\u6362\u4e3aint\u7c7b\u578b Itoa() \u00b6 \u7528\u4e8e\u5c06int\u7c7b\u578b\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u8868\u793a Parse\u7cfb\u5217\u51fd\u6570 \u00b6 \u2002\u2002Parse\u7c7b\u51fd\u6570\u7528\u4e8e\u8f6c\u6362\u5b57\u7b26\u4e32\u4e3a\u7ed9\u5b9a\u7c7b\u578b\u7684\u503c\uff1aParseBool()\u3001ParseFloat()\u3001ParseInt()\u3001ParseUint() \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684bool\u503c func ParseBool ( str string ) ( value bool , err error ) \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684\u6574\u6570\u503c func ParseInt ( s string , base int , bitSize int ) ( i int64 , err error ) \u89e3\u6790\u4e00\u4e2a\u8868\u793a\u6d6e\u70b9\u6570\u7684\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u5176\u503c func ParseFloat ( s string , bitSize int ) ( f float64 , err error ) Format\u7cfb\u5217\u51fd\u6570 \u00b6 \u2002\u2002Format\u7cfb\u5217\u51fd\u6570\u5b9e\u73b0\u4e86\u5c06\u7ed9\u5b9a\u7c7b\u578b\u6570\u636e\u683c\u5f0f\u5316\u4e3astring\u7c7b\u578b\u6570\u636e\u7684\u529f\u80fd \u6839\u636eb\u7684\u503c\u8fd4\u56de\u201dtrue\u201d\u6216\u201dfalse\u201d func FormatBool ( b bool ) string \u8fd4\u56dei\u7684base\u8fdb\u5236\u7684\u5b57\u7b26\u4e32\u8868\u793a func FormatInt ( i int64 , base int ) string \u51fd\u6570\u5c06\u6d6e\u70b9\u6570\u8868\u793a\u4e3a\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de func FormatFloat ( f float64 , fmt byte , prec , bitSize int ) string Referencce \u00b6 Go \u5b98\u65b9\u6587\u6863 Go \u83dc\u9e1f\u6559\u7a0b Go \u8bed\u8a00\u5b66\u4e60\u4e4b\u8def Go by Example \u4e2d\u6587\u7248","title":"Go \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/go/basic/#go","text":"\u7ea6 3054 \u4e2a\u5b57 158 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60 Go \u7684\u4e00\u4e9b\u8bed\u6cd5\uff0c\u548c\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u65e0\u592a\u5927\u533a\u522b\uff0c\u5165\u95e8\u8fd8\u662f\u5f88\u7b80\u5355\u7684","title":"Go \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/go/basic/#go_1","text":"\u786c\u4ef6\u9650\u5236\uff1a\u6469\u5c14\u5b9a\u5f8b\u5df2\u7136\u5931\u6548 Go \u4e3a\u5e76\u53d1\u800c\u751f\uff1a\u5728\u591a\u6838\u5e76\u53d1\u4e0a\u62e5\u6709\u539f\u751f\u7684\u8bbe\u8ba1\u4f18\u52bf\uff0c\u4ece\u5e95\u5c42\u539f\u751f\u5e76\u53d1 Go \u6027\u80fd\u5f3a\u608d\uff1a\u540c C/C++ \u4e00\u6837\uff0cGo \u4e5f\u662f\u7f16\u8bd1\u578b\u8bed\u8a00\uff0c\u6267\u884c\u6548\u7387\u66f4\u9ad8\uff0c\u6027\u80fd\u66f4\u597d Go \u7b80\u5355\u6613\u5b66\uff1a\u8bed\u6cd5\u7b80\u6d01\u3001\u4ee3\u7801\u98ce\u683c\u7edf\u4e00\u3001\u5f00\u53d1\u6548\u7387\u9ad8","title":"\u4e3a\u4ec0\u4e48\u5b66\u4e60 Go"},{"location":"cs/pl/go/basic/#go_2","text":"","title":"\u600e\u4e48\u88c5 Go"},{"location":"cs/pl/go/basic/#_1","text":"Go \u5b98\u7f51\u4e0b\u8f7d\u5730\u5740 Go \u5b98\u65b9\u955c\u50cf\u7ad9\uff08\u63a8\u8350\uff09 Windows\u5e73\u53f0\u548cMac\u5e73\u53f0\u63a8\u8350\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u7248\uff0cLinux\u5e73\u53f0\u4e0b\u8f7d\u538b\u7f29\u6587\u4ef6\u7248\u3002","title":"\u4e0b\u8f7d"},{"location":"cs/pl/go/basic/#_2","text":"Windows\uff1a\u4ee564\u4f4dWin10\u4e3e\u4f8b\uff0c\u5c06\u9009\u597d\u5b89\u88c5\u5305\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u53cc\u51fb\u4e00\u76f4next\uff0c \u6ce8\u610f\u8981\u6307\u5b9a\u4e00\u4e2aGo \u5b89\u88c5\u76ee\u5f55\uff0c\u8fd9\u5f88\u91cd\u8981 Linux\uff1a # \u5728\u7248\u672c\u9009\u62e9\u597d\u4e0b\u8f7d\u6587\u4ef6\u540e wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz # \u5c06\u4e0b\u8f7d\u597d\u7684\u6587\u4ef6\u89e3\u538b\u5230 `/usr/local` \u76ee\u5f55\u4e2d\uff0c\u6ca1\u6709\u6743\u9650\u52a0\u4e0a `sudo` tar -zxvf go1.14.1.linux-amd64.tar.gz -C /usr/local # \u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5728 `~/.profile` \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u5e76\u7528 `source` \u91cd\u65b0\u52a0\u8f7d export GOROOT = /usr/local/go export PATH = $PATH : $GOROOT /bin - Mac\uff1a\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u540e\uff0c\u76f4\u63a5\u70b9\u51fb\u4e0b\u4e00\u6b65\u5b89\u88c5\u5373\u53ef\uff0c\u9ed8\u8ba4\u4f1a\u5c06 go \u5b89\u88c5\u5230 /usr/local/go \u76ee\u5f55\u4e0b","title":"\u5b89\u88c5"},{"location":"cs/pl/go/basic/#goroot-gopath","text":"GOROOT \u548c GOPATH \u90fd\u662f\u73af\u5883\u53d8\u91cf\uff0c\u5176\u4e2d GOROOT \u662f\u6211\u4eec\u5b89\u88c5go\u5f00\u53d1\u5305\u7684\u8def\u5f84\uff0c\u800c\u4ece Go 1.8 \u7248\u672c\u5f00\u59cb\uff0cGo\u5f00\u53d1\u5305\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u4f1a\u4e3a GOPATH \u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u76ee\u5f55\uff0c\u5e76\u4e14\u5728 Go1.14 \u53ca\u4e4b\u540e\u7684\u7248\u672c\u4e2d\u542f\u7528\u4e86 Go Module \u6a21\u5f0f\u4e4b\u540e\uff0c\u4e0d\u4e00\u5b9a\u975e\u8981\u5c06\u4ee3\u7801\u5199\u5230 GOPATH \u76ee\u5f55\u4e0b\uff0c\u6240\u4ee5\u4e5f\u5c31\u4e0d\u9700\u8981\u6211\u4eec\u518d\u81ea\u5df1\u914d\u7f6e GOPATH \u4e86\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684\u5373\u53ef\u3002 \u67e5\u770b GOPATH \u8def\u5f84\uff1a go env GOPROXY Go1.14 \u7248\u672c\u4e4b\u540e\uff0c\u90fd\u63a8\u8350\u4f7f\u7528 go mod \u6a21\u5f0f\u6765\u7ba1\u7406\u4f9d\u8d56\u73af\u5883\u4e86\uff0c\u4e5f\u4e0d\u518d\u5f3a\u5236\u6211\u4eec\u628a\u4ee3\u7801\u5fc5\u987b\u5199\u5728 GOPATH \u4e0b\u9762\u7684src\u76ee\u5f55\u4e86\uff0c\u4f60\u53ef\u4ee5\u5728\u4f60\u7535\u8111\u7684\u4efb\u610f\u4f4d\u7f6e\u7f16\u5199go\u4ee3\u7801\u3002\uff08\u7f51\u4e0a\u6709\u4e9b\u6559\u7a0b\u9002\u7528\u4e8e1.11\u7248\u672c\u4e4b\u524d\u3002\uff09 \u9ed8\u8ba4 GoPROXY \u914d\u7f6e\u662f\uff1a GOPROXY = https://proxy.golang.org,direct \uff0c\u7531\u4e8e\u56fd\u5185\u8bbf\u95ee\u4e0d\u5230 https://proxy.golang.org \uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u6362\u4e00\u4e2aPROXY\uff0c\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528 https://goproxy.io \u6216 https://goproxy.cn \u3002 \u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539GOPROXY\uff1a go env -w GOPROXY = https://goproxy.cn,direct","title":"GOROOT \u548c GOPATH"},{"location":"cs/pl/go/basic/#go_3","text":"\u4efb\u4f55\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u7f16\u5199 Go\uff08\u5305\u62ec\u8bb0\u4e8b\u672c\uff09\uff0c\u8fd9\u91cc\u63a8\u8350\u7528 VsCode\uff08\u9700\u5b89\u88c5 Go \u6269\u5c55\uff09\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528Sublime\uff0cJB \u7684\u5168\u5bb6\u6876\u7b49\u7b49","title":"\u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c Go"},{"location":"cs/pl/go/basic/#go-mod-init","text":"\u4f7f\u7528 go module \u6a21\u5f0f\u65b0\u5efa\u9879\u76ee\u65f6\uff0c\u6211\u4eec\u9700\u8981\u901a\u8fc7 go mod init \u9879\u76ee\u540d\u547d\u4ee4\u5bf9\u9879\u76ee\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u8be5\u547d\u4ee4\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210 go.mod \u6587\u4ef6\u3002\u6267\u884c\u5982\u4e0b\u547d\u4ee4 go mod init ${ project } \u8bb0\u5f97\u914d\u7f6e\u597d GOPROXY","title":"go mod init"},{"location":"cs/pl/go/basic/#_3","text":"go build \uff1a \u547d\u4ee4\u8868\u793a\u5c06\u6e90\u4ee3\u7801\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002 go run \uff1a\u547d\u4ee4\u672c\u8d28\u4e0a\u662f\u5148\u5728\u4e34\u65f6\u76ee\u5f55\u7f16\u8bd1\u7a0b\u5e8f\u7136\u540e\u518d\u6267\u884c\u3002 go install \uff1a\u5b83\u5148\u7f16\u8bd1\u6e90\u4ee3\u7801\u5f97\u5230\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u53ef\u6267\u884c\u6587\u4ef6\u79fb\u52a8\u5230GOPATH\u7684bin\u76ee\u5f55\u4e0b\u3002\u56e0\u4e3a \u628a GOPATH \u4e0b\u7684 bin \u76ee\u5f55\u6dfb\u52a0\u5230\u4e86\u73af\u5883\u53d8\u91cf\u4e2d \uff0c\u6240\u4ee5\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u5730\u65b9\u76f4\u63a5\u6267\u884c\u53ef\u6267\u884c\u6587\u4ef6\u3002","title":"\u7f16\u8bd1\u3001\u8fd0\u884c\u3001\u5b89\u88c5"},{"location":"cs/pl/go/basic/#go-module","text":"go module \u662fGo1.13\u7248\u672c\u4e4b\u540e\u3002Go\u8bed\u8a00\u9ed8\u8ba4\u7684\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\u3002 \u8bbe\u7f6e\u597d GO111MODULE=on \u5c31\u53ef\u4ee5\u4f7f\u7528 go module \u4f7f\u7528 go module`` \u7ba1\u7406\u4f9d\u8d56\u540e\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210\u4e24\u4e2a\u6587\u4ef6 go.mod \u548c go.sum` go mod \u547d\u4ee4\uff1a go mod download \u4e0b\u8f7d\u4f9d\u8d56\u7684module\u5230\u672c\u5730cache\uff08\u9ed8\u8ba4\u4e3a$GOPATH/pkg/mod\u76ee\u5f55\uff09 go mod edit \u7f16\u8f91go.mod\u6587\u4ef6 go mod graph \u6253\u5370\u6a21\u5757\u4f9d\u8d56\u56fe go mod init \u521d\u59cb\u5316\u5f53\u524d\u6587\u4ef6\u5939, \u521b\u5efago.mod\u6587\u4ef6 go mod tidy \u589e\u52a0\u7f3a\u5c11\u7684module\uff0c\u5220\u9664\u65e0\u7528\u7684module go mod vendor \u5c06\u4f9d\u8d56\u590d\u5236\u5230vendor\u4e0b go mod verify \u6821\u9a8c\u4f9d\u8d56 go mod why \u89e3\u91ca\u4e3a\u4ec0\u4e48\u9700\u8981\u4f9d\u8d56 go.mod\u6587\u4ef6\u8bb0\u5f55\u4e86\u9879\u76ee\u6240\u6709\u7684\u4f9d\u8d56\u4fe1\u606f \u5728\u9879\u76ee\u4e2d\u6267\u884c go get \u547d\u4ee4\u53ef\u4ee5\u4e0b\u8f7d\u4f9d\u8d56\u5305\uff0c\u5e76\u4e14\u8fd8\u53ef\u4ee5\u6307\u5b9a\u4e0b\u8f7d\u7684\u7248\u672c","title":"go module"},{"location":"cs/pl/go/basic/#_4","text":"\u53d8\u91cf \u9700\u8981\u663e\u5f0f\u58f0\u660e\uff0c\u5e76\u4e14\u5728\u51fd\u6570\u8c03\u7528\u7b49\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u5668\u4f1a\u68c0\u67e5\u5176\u7c7b\u578b\u7684\u6b63\u786e\u6027 var \u58f0\u660e1\u4e2a\u6216\u591a\u4e2a\u53d8\u91cf\uff0cGo \u4f1a\u81ea\u52a8\u63a8\u65ad\u5df2\u7ecf\u6709\u521d\u59cb\u503c\u7684\u53d8\u91cf\u7c7b\u578b \u58f0\u660e\u540e\u5374\u6ca1\u6709\u7ed9\u51fa\u5bf9\u5e94\u7684\u521d\u59cb\u503c\u65f6\uff0c\u53d8\u91cf\u5c06\u4f1a\u521d\u59cb\u5316\u4e3a \u96f6\u503c \u3002 \u4f8b\u5982\uff0cint \u7684\u96f6\u503c\u662f 0 := \u8bed\u6cd5\u662f\u58f0\u660e\u5e76\u521d\u59cb\u5316\u53d8\u91cf\u7684\u7b80\u5199\uff08\u4e0d\u80fd\u5728\u51fd\u6570\u5916\u4f7f\u7528\uff09\uff0c \u4f8b\u5982 var f string = \"short\" \u53ef\u4ee5\u7b80\u5199\u4e3a f := \"short\" \u5728\u4f7f\u7528\u591a\u91cd\u8d4b\u503c\u65f6\uff0c\u5982\u679c\u60f3\u8981\u5ffd\u7565\u67d0\u4e2a\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528\u533f\u540d\u53d8\u91cf\uff0c\u4e00\u4e2a\u4e0b\u5212\u7ebf _ \u8868\u793a \u5e38\u91cf \u652f\u6301\u5b57\u7b26\u3001\u5b57\u7b26\u4e32\u3001\u5e03\u5c14\u548c\u6570\u503c\u5e38\u91cf const \u7528\u4e8e\u58f0\u660e\u4e00\u4e2a\u5e38\u91cf const \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u5728\u4efb\u4f55 var \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u7684\u5730\u65b9 iota \u662f\u5e38\u91cf\u8ba1\u6570\u5668\uff0c\u5728 const \u5173\u952e\u5b57\u51fa\u73b0\u65f6\u4f1a\u88ab\u91cd\u7f6e\u4e3a0","title":"\u53d8\u91cf\u548c\u5e38\u91cf"},{"location":"cs/pl/go/basic/#_5","text":"","title":"\u6761\u4ef6\u8bed\u53e5"},{"location":"cs/pl/go/basic/#ifelse","text":"if-else if-else \u7ed3\u6784 Go \u89c4\u5b9a\u4e0e if \u5339\u914d\u7684\u5de6\u62ec\u53f7 { \u5fc5\u987b\u4e0e if \u548c\u8868\u8fbe\u5f0f\u653e\u5728\u540c\u884c\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4f1a\u89e6\u53d1\u7f16\u8bd1\u9519\u8bef\uff0c\u540c\u7406else \u5728\u6761\u4ef6\u8bed\u53e5\u4e4b\u524d\u53ef\u4ee5\u6709\u4e00\u4e2a\u58f0\u660e\u8bed\u53e5\uff1b\u5728\u8fd9\u91cc\u58f0\u660e\u7684\u53d8\u91cf\u53ef\u4ee5\u5728\u8fd9\u4e2a\u8bed\u53e5\u6240\u6709\u7684\u6761\u4ef6\u5206\u652f\u4e2d\u4f7f\u7528 \u5728 Go \u4e2d\uff0c\u6761\u4ef6\u8bed\u53e5\u7684\u5706\u62ec\u53f7\u4e0d\u662f\u5fc5\u9700\u7684\uff0c\u4f46\u662f\u82b1\u62ec\u53f7\u662f\u5fc5\u9700\u7684 Go \u6ca1\u6709\u4e09\u76ee\u8fd0\u7b97\u7b26\uff0c \u5373\u4f7f\u662f\u57fa\u672c\u7684\u6761\u4ef6\u5224\u65ad\uff0c\u4f9d\u7136\u9700\u8981\u4f7f\u7528\u5b8c\u6574\u7684 if \u8bed\u53e5 if-else if num := 9 ; num < 0 { fmt . Println ( num , \"is negative\" ) } else if num < 10 { fmt . Println ( num , \"has 1 digit\" ) } else { fmt . Println ( num , \"has multiple digits\" ) }","title":"if/else \u5206\u652f"},{"location":"cs/pl/go/basic/#switch","text":"\u4e0d\u5e26\u8868\u8fbe\u5f0f\u7684 switch \u662f\u5b9e\u73b0 if/else \u903b\u8f91\u7684\u53e6\u4e00\u79cd\u65b9\u5f0f \u6bcf\u4e2a switch \u53ea\u80fd\u6709\u4e00\u4e2a default \u5206\u652f \u4e00\u4e2a\u5206\u652f\u53ef\u4ee5\u6709\u591a\u4e2a\u503c\uff0c\u591a\u4e2acase\u503c\u4e2d\u95f4\u4f7f\u7528\u82f1\u6587\u9017\u53f7\u5206\u9694 fallthrough \u8bed\u6cd5\u53ef\u4ee5\u6267\u884c\u6ee1\u8db3\u6761\u4ef6\u7684case\u7684\u4e0b\u4e00\u4e2acase\uff0c\u662f\u4e3a\u4e86\u517c\u5bb9C\u8bed\u8a00\u4e2d\u7684case\u8bbe\u8ba1\u7684 switch func switchDemo5 () { s := \"a\" switch { case s == \"a\" : fmt . Println ( \"a\" ) fallthrough case s == \"b\" : fmt . Println ( \"b\" ) case s == \"c\" : fmt . Println ( \"c\" ) default : fmt . Println ( \"...\" ) } }","title":"switch \u5206\u652f"},{"location":"cs/pl/go/basic/#_6","text":"\u7ecf\u5178\u7684\u521d\u59cb/\u6761\u4ef6/\u540e\u7eed for \u5faa\u73af for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u53ef\u4ee5\u88ab\u5ffd\u7565\uff0c\u4f46\u662f\u521d\u59cb\u8bed\u53e5\u540e\u7684\u5206\u53f7\u5fc5\u987b\u8981\u5199 for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u548c\u7ed3\u675f\u8bed\u53e5\u90fd\u53ef\u4ee5\u7701\u7565 for\u5faa\u73af\u53ef\u4ee5\u901a\u8fc7break\u3001goto\u3001return\u3001panic\u8bed\u53e5\u5f3a\u5236\u9000\u51fa\u5faa\u73af Go\u8bed\u8a00\u4e2d\u53ef\u4ee5\u4f7f\u7528for range\u904d\u5386\u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u3001map \u53ca\u901a\u9053\uff08channel\uff09\u3002 \u901a\u8fc7for range\u904d\u5386\u7684\u8fd4\u56de\u503c\u6709\u4ee5\u4e0b\u89c4\u5f8b \u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u8fd4\u56de\u7d22\u5f15\u548c\u503c\u3002 map\u8fd4\u56de\u952e\u548c\u503c\u3002 \u901a\u9053\uff08channel\uff09\u53ea\u8fd4\u56de\u901a\u9053\u5185\u7684\u503c for for i := 0 ; i < 10 ; i ++ { ... } for ; i < 10 ; i ++ { ... } for i < 10 { ... } for i , v := range ** { ... }","title":"\u5faa\u73af"},{"location":"cs/pl/go/basic/#_7","text":"","title":"\u6570\u636e\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_8","text":"\u6574\u578b\u6709int8/16/32/64\uff0c\u5305\u62ec\u5bf9\u5e94\u7684\u65e0\u7b26\u53f7\u6574\u578b \u6d6e\u70b9\u578b\u6709float32/64 \u590d\u6570\u6709complex64/128 \u8fd0\u7b97\uff1a \u548cC/C++\u65e0\u592a\u5927\u5dee\u522b","title":"\u6570\u5b57\u4e0e\u8fd0\u7b97"},{"location":"cs/pl/go/basic/#_9","text":"\u901a\u8fc7 bool \u6765\u58f0\u660e\u5e03\u5c14\u578b\u6570\u636e\uff0c\u53ea\u6709 true \u548c false \u9ed8\u8ba4\u503c\u4e3a false \u4e0d\u5141\u8bb8\u5c06\u6574\u578b\u5f3a\u5236\u8f6c\u6362\u4e3a\u5e03\u5c14\u578b \u5e03\u5c14\u578b\u65e0\u6cd5\u53c2\u4e0e\u6570\u503c\u8fd0\u7b97\uff0c\u4e5f\u65e0\u6cd5\u4e0e\u5176\u4ed6\u7c7b\u578b\u8fdb\u884c\u8f6c\u6362","title":"\u5e03\u5c14\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_10","text":"\u5b57\u7b26\u4e32\u7684\u5185\u90e8\u5b9e\u73b0\u4f7f\u7528 UTF-8 \u7f16\u7801\uff0c\u5b57\u7b26\u4e32\u7684\u503c\u4e3a\u53cc\u5f15\u53f7(\")\u4e2d\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u5728Go\u8bed\u8a00\u7684\u6e90\u7801\u4e2d\u76f4\u63a5\u6dfb\u52a0\u975eASCII\u7801\u5b57\u7b26 \u8981\u5b9a\u4e49\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u65f6\uff0c\u5c31\u5fc5\u987b\u4f7f\u7528\u53cd\u5f15\u53f7\u5b57\u7b26\uff0c\u53cd\u5f15\u53f7\u95f4\u6362\u884c\u5c06\u88ab\u4f5c\u4e3a\u5b57\u7b26\u4e32\u4e2d\u7684\u6362\u884c\uff0c\u4f46\u662f\u6240\u6709\u7684\u8f6c\u4e49\u5b57\u7b26\u5747\u65e0\u6548\uff0c\u6587\u672c\u5c06\u4f1a\u539f\u6837\u8f93\u51fa s := `\u7b2c\u4e00\u884c \u7b2c\u4e8c\u884c \u7b2c\u4e09\u884c ` \u5e38\u7528\u65b9\u6cd5 len(str) \uff1a\u6c42\u957f\u5ea6 +\u6216fmt.Sprintf \uff1a\u62fc\u63a5\u5b57\u7b26\u4e32 strings.Split \uff1a\u5206\u5272 strings.contains \uff1a\u5224\u65ad\u662f\u5426\u5305\u542b strings.HasPrefix,strings.HasSuffix \uff1a\u524d\u7f00/\u540e\u7f00\u5224\u65ad strings.Index(),strings.LastIndex() \uff1a\u5b50\u4e32\u51fa\u73b0\u7684\u4f4d\u7f6e strings.Join(a[]string, sep string) \uff1ajoin\u64cd\u4f5c","title":"\u5b57\u7b26\u4e32"},{"location":"cs/pl/go/basic/#byterune","text":"\u7ec4\u6210\u6bcf\u4e2a\u5b57\u7b26\u4e32\u7684\u5143\u7d20\u53eb\u505a\u201c\u5b57\u7b26\u201d\uff0c\u53ef\u4ee5\u901a\u8fc7\u904d\u5386\u6216\u8005\u5355\u4e2a\u83b7\u53d6\u5b57\u7b26\u4e32\u5143\u7d20\u83b7\u5f97\u5b57\u7b26\u3002 \u5b57\u7b26\u7528\u5355\u5f15\u53f7\uff08\u2019\uff09\u5305\u88f9\u8d77\u6765 Go \u5305\u62ec\u4e24\u79cd\u5b57\u7b26\uff1a uint8 \u7c7b\u578b\uff0c\u6216\u8005\u53eb byte \u578b\uff0c\u4ee3\u8868\u4e00\u4e2a ASCII \u7801\u5b57\u7b26 rune \u7c7b\u578b\uff0c\u4ee3\u8868\u4e00\u4e2a UTF-8 \u5b57\u7b26 \u5f53\u9700\u8981\u5904\u7406\u4e2d\u6587\u3001\u65e5\u6587\u6216\u8005\u5176\u4ed6\u590d\u5408\u5b57\u7b26\u65f6\uff0c\u5219\u9700\u8981\u7528\u5230 rune \u7c7b\u578b\u3002 rune \u7c7b\u578b\u5b9e\u9645\u662f\u4e00\u4e2a int32 Go \u4f7f\u7528\u4e86\u7279\u6b8a\u7684 rune \u7c7b\u578b\u6765\u5904\u7406 Unicode \uff0c\u8ba9\u57fa\u4e8e Unicode \u7684\u6587\u672c\u5904\u7406\u66f4\u4e3a\u65b9\u4fbf\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 byte \u578b\u8fdb\u884c\u9ed8\u8ba4\u5b57\u7b26\u4e32\u5904\u7406\uff0c\u6027\u80fd\u548c\u6269\u5c55\u6027\u90fd\u6709\u7167\u987e \u5b57\u7b26\u4e32\u5e95\u5c42\u662f\u4e00\u4e2abyte\u6570\u7ec4\uff0c\u6240\u4ee5\u53ef\u4ee5\u548c []byte \u7c7b\u578b\u76f8\u4e92\u8f6c\u6362 \u5b57\u7b26\u4e32\u662f\u4e0d\u80fd\u4fee\u6539\u7684\uff0c\u5b57\u7b26\u4e32\u662f\u7531 byte \u5b57\u8282\u7ec4\u6210\uff0c\u6240\u4ee5\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u662f byte \u5b57\u8282\u7684\u957f\u5ea6 rune \u7c7b\u578b\u7528\u6765\u8868\u793a utf8 \u5b57\u7b26\uff0c\u4e00\u4e2a rune \u5b57\u7b26\u7531\u4e00\u4e2a\u6216\u591a\u4e2a byte \u7ec4\u6210 \u8981\u4fee\u6539\u5b57\u7b26\u4e32\uff0c\u9700\u8981\u5148\u5c06\u5176\u8f6c\u6362\u6210 []rune \u6216 []byte \uff0c\u5b8c\u6210\u540e\u518d\u8f6c\u6362\u4e3a string byte and rune s1 := \"big\" // \u5f3a\u5236\u7c7b\u578b\u8f6c\u6362 byteS1 := [] byte ( s1 ) byteS1 [ 0 ] = 'p' fmt . Println ( string ( byteS1 )) s2 := \"\u767d\u841d\u535c\" runeS2 := [] rune ( s2 ) runeS2 [ 0 ] = '\u7ea2' fmt . Println ( string ( runeS2 ))","title":"byte\u548crune\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_11","text":"\u5b9a\u4e49\u4e00\u4e2a\u957f\u5ea6\u4e3a3\u5143\u7d20\u7c7b\u578b\u4e3aint\u7684\u6570\u7ec4a\uff1a var a [3]int \u5185\u7f6e\u51fd\u6570 len \u53ef\u4ee5\u8fd4\u56de\u6570\u7ec4\u7684\u957f\u5ea6 \u521d\u59cb\u5316 \u53ef\u4ee5\u4f7f\u7528\u521d\u59cb\u5316\u5217\u8868\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff1a var num = [3]int{1, 2} \u53ef\u4ee5\u8ba9\u7f16\u8bd1\u5668\u6839\u636e\u521d\u59cb\u503c\u7684\u4e2a\u6570\u81ea\u884c\u63a8\u65ad\u6570\u7ec4\u7684\u957f\u5ea6\uff0c var num = [...]{1, 2} \u6307\u5b9a\u7d22\u5f15\u503c\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff0c num := [...]int{1: 1, 3: 5} \u904d\u5386 for i := 0; i < len(a); i ++ {} for index, value := range a {} \u591a\u7ef4\u6570\u7ec4\u5b9a\u4e49\uff0c a := [2][3]int \u591a\u7ef4\u6570\u7ec4\u53ea\u6709\u7b2c\u4e00\u5c42\u53ef\u4ee5\u4f7f\u7528 ... \u6765\u8ba9\u7f16\u8bd1\u5668\u63a8\u5bfc\u6570\u7ec4\u957f\u5ea6\uff0c\u4e0d\u652f\u6301\u5185\u5c42\u4f7f\u7528 \u6570\u7ec4\u662f\u503c\u7c7b\u578b\uff0c\u8d4b\u503c\u548c\u4f20\u53c2\u4f1a\u590d\u5236\u6574\u4e2a\u6570\u7ec4\uff0c\u56e0\u6b64\u6539\u53d8\u526f\u672c\u7684\u503c\uff0c\u4e0d\u4f1a\u6539\u53d8\u672c\u8eab\u7684\u503c [n]*T \u8868\u793a\u6307\u9488\u6570\u7ec4\uff0c *[n]T \u8868\u793a\u6570\u7ec4\u6307\u9488","title":"\u6570\u7ec4"},{"location":"cs/pl/go/basic/#_12","text":"\u5b9a\u4e49 \u5207\u7247\uff08Slice\uff09\u662f\u4e00\u4e2a\u62e5\u6709\u76f8\u540c\u7c7b\u578b\u5143\u7d20\u7684\u53ef\u53d8\u957f\u5ea6\u7684\u5e8f\u5217\u3002\u5b83\u662f\u57fa\u4e8e\u6570\u7ec4\u7c7b\u578b\u505a\u7684\u4e00\u5c42\u5c01\u88c5\u3002\u5b83\u975e\u5e38\u7075\u6d3b\uff0c\u652f\u6301\u81ea\u52a8\u6269\u5bb9 \u5207\u7247\u58f0\u660e\uff1a var name []T \uff0cname \u8868\u793a\u53d8\u91cf\u540d\uff0cT \u8868\u793a\u5207\u7247\u4e2d\u7684\u5143\u7d20\u7c7b\u578b \u5207\u7247\u62e5\u6709\u81ea\u5df1\u7684\u957f\u5ea6\u548c\u5bb9\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5185\u7f6e\u7684len()\u51fd\u6570\u6c42\u957f\u5ea6\uff0c\u4f7f\u7528\u5185\u7f6e\u7684cap()\u51fd\u6570\u6c42\u5207\u7247\u7684\u5bb9\u91cf \u5207\u7247\u7684\u5e95\u5c42\u5c31\u662f\u6570\u7ec4\uff0c\u548c Python \u4e00\u6837\uff0c\u53ef\u4ee5\u4f7f\u7528 b := a[1:3] \uff0c\u8868\u793a\u4ece\u6570\u7ec4 a \u4e2d\u9009\u51fa \u7d22\u5f15\u503c\u5728 \\([1,3)\\) \u4e2d\u7684\u5143\u7d20\u7ec4\u6210\u5207\u7247 b \u5b8c\u6574\u7684\u5207\u7247\u8868\u8fbe\u5f0f\uff1a a[low: high: max] \uff0c\u5f97\u5230\u7684\u7ed3\u679c\u5207\u7247\u7684\u5bb9\u91cf\u8bbe\u7f6e\u4e3a max - low \uff0clow \u53ef\u4ee5\u7701\u7565\uff0c\u9ed8\u8ba4\u4e3a0 \u4f7f\u7528\u5185\u7f6e make\u51fd\u6570 \u6784\u9020\u5207\u7247\uff0c make([]T, size, cap) \uff0cT \u8868\u793a\u5143\u7d20\u7c7b\u578b\uff0csize \u8868\u793a\u5143\u7d20\u6570\u91cf\uff0ccap \u8868\u793a\u5207\u7247\u5bb9\u91cf \u5224\u65ad\u5207\u7247\u662f\u5426\u4e3a\u7a7a\uff0c\u8bf7\u4f7f\u7528 len(s) == 0 \uff0c\u4e0d\u8981\u4f7f\u7528 s == nil \u5207\u7247\u4e0d\u80fd\u76f4\u63a5\u6bd4\u8f83 \u5207\u7247\u904d\u5386\u548c\u6570\u7ec4\u4e00\u6837 \u53ef\u4ee5\u7528 append() \u4e3a\u5207\u7247\u6dfb\u52a0\u5143\u7d20 s = append(s, 1,2,3) \uff0c\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5143\u7d20 s = append(s, s2...) \u5207\u7247\u7684\u6269\u5bb9\u7b56\u7565\uff08\u7565\uff09 \u53ef\u4ee5\u4f7f\u7528 copy() \u590d\u5236\u5207\u7247\uff0c\u4f46\u5207\u7247\u662f\u5f15\u7528\u7c7b\u578b\uff0c\u6240\u4ee5\u4e24\u4e2a\u5207\u7247\u90fd\u6307\u5411\u540c\u4e00\u5757\u5185\u5b58\u5730\u5740\uff0c\u5bf9\u4e00\u4e2a\u5207\u7247\u7684\u4fee\u6539\u4f1a\u5f71\u54cd\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5185\u5bb9 \u6392\u5e8f\uff0c\u9700\u8981 import sort \uff0c\u6392\u5e8f\u65f6\u53ef\u81ea\u5b9a\u4e49\u6392\u5e8f sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })","title":"\u5207\u7247"},{"location":"cs/pl/go/basic/#map","text":"\u4e00\u79cd\u65e0\u5e8f\u7684 key-value \u6570\u636e\u7ed3\u6784\uff0c\u5728 Go \u4e2d map \u662f\u5f15\u7528\u7c7b\u578b\uff0c\u5fc5\u987b\u521d\u59cb\u5316\u624d\u80fd\u4f7f\u7528 \u5b9a\u4e49\uff1a map[KeyType]ValueType \uff0cKeyType \u8868\u793a\u952e\u7684\u7c7b\u578b\uff0cValueType \u8868\u793a\u952e\u5bf9\u5e94\u7684\u503c\u7684\u7c7b\u578b\uff0c x := map[int]int{1:3, 2:4} \u6216 s := make([int]int, 2), s[1] = 3, s[2] = 4 \u5224\u65ad\u952e\u662f\u5426\u5b58\u5728\uff1a value, ok := map[key] \uff0c\u67e5\u770b ok \u662f\u5426\u4e3a true \u904d\u5386\uff1a for k, v := range map {} \uff0cv \u53ef\u7701\u7565\uff0c\u904d\u5386\u5143\u7d20\u7684\u987a\u5e8f\u4e0e\u6dfb\u52a0\u952e\u503c\u5bf9\u7684\u987a\u5e8f\u65e0\u5173\uff0c\u53ef\u4ee5\u628a key \u653e\u5165 slice \u4e2d\u6392\u5e8f\uff0c\u7136\u540e\u904d\u5386 slice \u5c31\u53ef\u4ee5\u6307\u5b9a\u987a\u5e8f delete() \u4ece map \u4e2d\u5220\u9664\u4e00\u7ec4\u952e\u503c\u5bf9","title":"Map"},{"location":"cs/pl/go/basic/#_13","text":"\u4f7f\u7528 func \u6765\u5b9a\u4e49\u51fd\u6570 \u901a\u8fc7\u51fd\u6570\u540d\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570 \u51fd\u6570\u7684\u53c2\u6570\u4e2d\u5982\u679c\u76f8\u90bb\u53d8\u91cf\u7684\u7c7b\u578b\u76f8\u540c\uff0c\u5219\u53ef\u4ee5\u7701\u7565\u7c7b\u578b\uff0c \u53ef\u53d8\u53c2\u6570\u662f\u6307\u51fd\u6570\u7684\u53c2\u6570\u6570\u91cf\u4e0d\u56fa\u5b9a\u3002Go\u8bed\u8a00\u4e2d\u7684\u53ef\u53d8\u53c2\u6570\u901a\u8fc7\u5728\u53c2\u6570\u540d\u540e\u52a0 ... \u6765\u6807\u8bc6\uff0c\u53ef\u53d8\u53c2\u6570\u901a\u5e38\u8981\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u53c2\u6570 \u51fd\u6570\u5982\u679c\u6709\u591a\u4e2a\u8fd4\u56de\u503c\uff0c\u5fc5\u987b\u4f7f\u7528 () \u5c06\u6240\u6709\u8fd4\u56de\u503c\u5305\u88f9 \u51fd\u6570\u5b9a\u4e49\u65f6\u53ef\u4ee5\u7ed9\u8fd4\u56de\u503c\u547d\u540d\uff0c\u5e76\u5728\u51fd\u6570\u4f53\u4e2d\u76f4\u63a5\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff0c\u6700\u540e\u901a\u8fc7return\u5173\u952e\u5b57\u8fd4\u56de \u53ef\u4ee5\u4f7f\u7528 type \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u7c7b\u578b \u9ad8\u9636\u51fd\u6570 \u51fd\u6570\u4f5c\u4e3a\u53c2\u6570 \u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c \u53ef\u4ee5\u5b9a\u4e49\u533f\u540d\u51fd\u6570\uff0c add := func(x, y int) \uff0c\u591a\u7528\u4e8e\u56de\u8c03\u51fd\u6570\u548c\u95ed\u5305 \u95ed\u5305=\u51fd\u6570+\u5f15\u7528\u73af\u5883\uff08\u7565\uff09 defer \u8bed\u53e5\uff0c\u5c06\u5176\u540e\u9762\u8ddf\u968f\u7684\u8bed\u53e5\u8fdb\u884c\u5ef6\u8fdf\u5904\u7406\uff0c\u4f1a\u88ab\u9006\u5e8f\u5904\u7406 \u4f7f\u7528 panic/recover \u6a21\u5f0f\u6765\u5904\u7406\u9519\u8bef\uff0c recover()\u5fc5\u987b\u642d\u914ddefer\u4f7f\u7528\uff0cdefer\u4e00\u5b9a\u8981\u5728\u53ef\u80fd\u5f15\u53d1panic\u7684\u8bed\u53e5\u4e4b\u524d\u5b9a\u4e49 func func \u51fd\u6570\u540d ( \u53c2\u6570 )( \u8fd4\u56de\u503c ) { \u51fd\u6570\u4f53 } func add ( a , b int ) int { return x + b } func intSum2 ( x ... int ) int { fmt . Println ( x ) //x\u662f\u4e00\u4e2a\u5207\u7247 sum := 0 for _ , v := range x { sum = sum + v } return sum } func calc ( x , y int ) ( int , int ) { reurn x + y , x - y } func calc ( x , y int ) ( sum , sub int ) { sum = x + y sub = x - y return } func add ( x , y int ) int { return x + y } func calc ( x , y int , op func ( int , int ) int ) int { return op ( x , y ) } func main () { ret2 := calc ( 10 , 20 , add ) fmt . Println ( ret2 ) //30 } func do ( s string ) ( func ( int , int ) int , error ) { switch s { case \"+\" : return add , nil case \"-\" : return sub , nil default : err := errors . New ( \"\u65e0\u6cd5\u8bc6\u522b\u7684\u64cd\u4f5c\u7b26\" ) return nil , err } }","title":"\u51fd\u6570"},{"location":"cs/pl/go/basic/#_14","text":"\u548c C \u7684\u533a\u522b\u4e0d\u5927\uff0c\u90fd\u662f\u7528 * \u548c & \u6765\u64cd\u4f5c\uff0c * \u8868\u793a\u53d6\u503c\u64cd\u4f5c\u7b26\uff0c & \u8868\u793a\u53d6\u5730\u5740\u64cd\u4f5c\u7b26 new \u548c make \u5206\u914d\u5185\u5b58 a = new(int) \uff0cmake \u53ea\u7528\u4e8eslice\u3001map\u4ee5\u53cachannel\u7684\u5185\u5b58\u521b\u5efa\uff0c\u8fd4\u56de\u7684\u662f\u5f15\u7528\u7c7b\u578b \u800cnew\u7528\u4e8e\u7c7b\u578b\u7684\u5185\u5b58\u5206\u914d\uff0c\u5e76\u4e14\u5185\u5b58\u5bf9\u5e94\u7684\u503c\u4e3a\u7c7b\u578b\u96f6\u503c\uff0c\u8fd4\u56de\u7684\u662f\u6307\u5411\u7c7b\u578b\u7684\u6307\u9488","title":"\u6307\u9488"},{"location":"cs/pl/go/basic/#_15","text":"","title":"\u7ed3\u6784\u4f53"},{"location":"cs/pl/go/basic/#_16","text":"type \u5b9a\u4e49\u7c7b\u578b\u522b\u540d type + struct \u5b9a\u4e49\u7ed3\u6784\u4f53\uff0ctype \u7c7b\u578b\u540d struct { \u5b57\u6bb5\u540d \u5b57\u6bb5\u7c7b\u578b ...} \u4f7f\u7528 var \u5b9e\u4f8b\u5316\u7ed3\u6784\u4f53 \u901a\u8fc7 . \u8bbf\u95ee\u7ed3\u6784\u4f53\u5b57\u6bb5 \u521d\u59cb\u5316 \u6ca1\u6709\u521d\u59cb\u5316\u7684\u7ed3\u6784\u4f53\uff0c\u5176\u6210\u5458\u53d8\u91cf\u90fd\u662f\u5bf9\u5e94\u5176\u7c7b\u578b\u7684\u96f6\u503c \u4f7f\u7528\u952e\u503c\u5bf9\u5bf9\u7ed3\u6784\u4f53\u8fdb\u884c\u521d\u59cb\u5316\u65f6\uff0c\u952e\u5bf9\u5e94\u7ed3\u6784\u4f53\u7684\u5b57\u6bb5\uff0c\u503c\u5bf9\u5e94\u8be5\u5b57\u6bb5\u7684\u521d\u59cb\u503c \u7ed3\u6784\u4f53\u5360\u7528\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\uff0c\u7a7a\u7ed3\u6784\u4f53\u662f\u4e0d\u5360\u7528\u7a7a\u95f4\u7684 \u7ed3\u6784\u9898\u6ca1\u6709\u6784\u9020\u51fd\u6570\uff0c\u4f46\u662f\u53ef\u4ee5\u81ea\u5df1\u5b9e\u73b0 \u6784\u9020\u51fd\u6570 func newPerson ( name , city string , age int8 ) * person { return & person { name : name , city : city , age : age , } }","title":"\u5b9a\u4e49\u4e0e\u521d\u59cb\u5316"},{"location":"cs/pl/go/basic/#_17","text":"\u65b9\u6cd5\uff08Method\uff09\u662f\u4e00\u79cd\u4f5c\u7528\u4e8e\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u7684\u51fd\u6570\u3002\u8fd9\u79cd\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u53eb\u505a\u63a5\u6536\u8005\uff08Receiver\uff09\u3002\u63a5\u6536\u8005\u7684\u6982\u5ff5\u5c31\u7c7b\u4f3c\u4e8e\u5176\u4ed6\u8bed\u8a00\u4e2d\u7684 this \u6216\u8005 self\uff0c\u5f53\u7136\u8fd8\u53ef\u4ee5\u6709\u6307\u9488\u7c7b\u578b\u7684\u63a5\u6536\u8005 func ( \u63a5\u6536\u8005\u53d8\u91cf \u63a5\u6536\u8005\u7c7b\u578b ) \u65b9\u6cd5\u540d ( \u53c2\u6570\u5217\u8868 ) ( \u8fd4\u56de\u53c2\u6570 ) { \u51fd\u6570\u4f53 } \u65b9\u6cd5\u4e0e\u51fd\u6570\u7684\u533a\u522b\u662f\uff0c\u51fd\u6570\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u7c7b\u578b\uff0c\u65b9\u6cd5\u5c5e\u4e8e\u7279\u5b9a\u7684\u7c7b\u578b","title":"\u65b9\u6cd5"},{"location":"cs/pl/go/basic/#_18","text":"\u7ed3\u6784\u4f53\u5141\u8bb8\u5176\u6210\u5458\u5b57\u6bb5\u5728\u58f0\u660e\u65f6\u6ca1\u6709\u5b57\u6bb5\u540d\u800c\u53ea\u6709\u7c7b\u578b\uff0c\u8fd9\u79cd\u6ca1\u6709\u540d\u5b57\u7684\u5b57\u6bb5\u5c31\u79f0\u4e3a\u533f\u540d\u5b57\u6bb5 \u4e00\u4e2a\u7ed3\u6784\u4f53\u4e2d\u53ef\u4ee5\u5d4c\u5957\u5305\u542b\u53e6\u4e00\u4e2a\u7ed3\u6784\u4f53\u6216\u7ed3\u6784\u4f53\u6307\u9488 \u901a\u8fc7\u7ed3\u6784\u4f53\u53ef\u4ee5\u5b9e\u73b0\u201c\u7ee7\u627f\u201d \u7ed3\u6784\u4f53\u4e2d\u5b57\u6bb5\u5927\u5199\u5f00\u5934\u8868\u793a\u53ef\u516c\u5f00\u8bbf\u95ee\uff0c\u5c0f\u5199\u8868\u793a\u79c1\u6709\uff08\u4ec5\u5728\u5b9a\u4e49\u5f53\u524d\u7ed3\u6784\u4f53\u7684\u5305\u4e2d\u53ef\u8bbf\u95ee\uff09 \u7ed3\u6784\u4f53\u53ef\u4ee5\u4f7f\u7528 JSON \u5e8f\u5217\u5316","title":"\u5176\u4ed6"},{"location":"cs/pl/go/basic/#_19","text":"","title":"\u63a5\u53e3"},{"location":"cs/pl/go/basic/#_20","text":"\u63a5\u53e3\u662f\u4e00\u79cd\u7531\u7a0b\u5e8f\u5458\u6765\u5b9a\u4e49\u7684\u7c7b\u578b\uff0c\u4e00\u4e2a\u63a5\u53e3\u7c7b\u578b\u5c31\u662f\u4e00\u7ec4\u65b9\u6cd5\u7684\u96c6\u5408\uff0c\u5b83\u89c4\u5b9a\u4e86\u9700\u8981\u5b9e\u73b0\u7684\u6240\u6709\u65b9\u6cd5 \u6bcf\u4e2a\u63a5\u53e3\u7c7b\u578b\u7531\u4efb\u610f\u4e2a\u65b9\u6cd5\u7b7e\u540d\u7ec4\u6210 type \u63a5\u53e3\u7c7b\u578b\u540d interface { \u65b9\u6cd5\u540d1 ( \u53c2\u6570\u5217\u88681 ) \u8fd4\u56de\u503c\u5217\u88681 \u65b9\u6cd5\u540d2 ( \u53c2\u6570\u5217\u88682 ) \u8fd4\u56de\u503c\u5217\u88682 ... } \u63a5\u53e3\u5c31\u662f\u89c4\u5b9a\u4e86\u4e00\u4e2a\u9700\u8981\u5b9e\u73b0\u7684\u65b9\u6cd5\u5217\u8868\uff0c\u5728 Go \u8bed\u8a00\u4e2d\u4e00\u4e2a\u7c7b\u578b\u53ea\u8981\u5b9e\u73b0\u4e86\u63a5\u53e3\u4e2d\u89c4\u5b9a\u7684\u6240\u6709\u65b9\u6cd5\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u79f0\u5b83\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u63a5\u53e3 \u53ef\u4ee5\u901a\u8fc7\u503c\u63a5\u6536\u8005\u6216\u6307\u9488\u63a5\u6536\u8005\u5b9e\u73b0\u501f\u53e3","title":"\u63a5\u53e3\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_21","text":"\u4e00\u4e2a\u7c7b\u578b\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u591a\u79cd\u7c7b\u578b\u5b9e\u73b0\u540c\u4e00\u63a5\u53e3","title":"\u7c7b\u578b\u4e0e\u63a5\u53e3\u7684\u5173\u7cfb"},{"location":"cs/pl/go/basic/#_22","text":"\u63a5\u53e3\u4e0e\u63a5\u53e3\u4e4b\u95f4\u53ef\u4ee5\u901a\u8fc7\u4e92\u76f8\u5d4c\u5957\u5f62\u6210\u65b0\u7684\u63a5\u53e3\u7c7b\u578b\uff0c\u4f8b\u5982Go\u6807\u51c6\u5e93io\u6e90\u7801\u4e2d\u5c31\u6709\u5f88\u591a\u63a5\u53e3\u4e4b\u95f4\u4e92\u76f8\u7ec4\u5408\u7684\u793a\u4f8b","title":"\u63a5\u53e3\u7ec4\u5408"},{"location":"cs/pl/go/basic/#_23","text":"\u7a7a\u63a5\u53e3\u662f\u6307\u6ca1\u6709\u5b9a\u4e49\u4efb\u4f55\u65b9\u6cd5\u7684\u63a5\u53e3\u7c7b\u578b\u3002\u56e0\u6b64\u4efb\u4f55\u7c7b\u578b\u90fd\u53ef\u4ee5\u89c6\u4e3a\u5b9e\u73b0\u4e86\u7a7a\u63a5\u53e3\u3002\u4e5f\u6b63\u662f\u56e0\u4e3a\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u8fd9\u4e2a\u7279\u6027\uff0c\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cf\u53ef\u4ee5\u5b58\u50a8\u4efb\u610f\u7c7b\u578b\u7684\u503c \u901a\u5e38\u6211\u4eec\u5728\u4f7f\u7528\u7a7a\u63a5\u53e3\u7c7b\u578b\u65f6\u4e0d\u5fc5\u4f7f\u7528type\u5173\u952e\u5b57\u58f0\u660e\uff0c\u53ef\u4ee5\u50cf\u4e0b\u9762\u7684\u4ee3\u7801\u4e00\u6837\u76f4\u63a5\u4f7f\u7528interface{}\uff0c var x interface{} \u7a7a\u63a5\u53e3\u4f5c\u4e3a\u51fd\u6570\u7684\u53c2\u6570\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u63a5\u6536\u4efb\u610f\u7c7b\u578b\u7684\u51fd\u6570\u53c2\u6570 \u7a7a\u63a5\u53e3\u4f5c\u4e3amap\u7684\u503c\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u4fdd\u5b58\u4efb\u610f\u503c\u7684\u5b57\u5178","title":"\u7a7a\u63a5\u53e3"},{"location":"cs/pl/go/basic/#error","text":"Go \u8bed\u8a00\u4e2d\u628a\u9519\u8bef\u5f53\u6210\u4e00\u79cd\u7279\u6b8a\u7684\u503c\u6765\u5904\u7406\uff0c\u4e0d\u652f\u6301\u5176\u4ed6\u8bed\u8a00\u4e2d\u4f7f\u7528 try/catch \u6355\u83b7\u5f02\u5e38\u7684\u65b9\u5f0f Go \u8bed\u8a00\u4e2d\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a error \u63a5\u53e3\u6765\u8868\u793a\u9519\u8bef\u7c7b\u578b \u5f53\u4e00\u4e2a\u51fd\u6570\u6216\u65b9\u6cd5\u9700\u8981\u8fd4\u56de\u9519\u8bef\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u662f\u628a\u9519\u8bef\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u8fd4\u56de\u503c\uff0c\u4f8b\u5982\u4e4b\u524d\u67e5\u8be2map\u4e2d\u662f\u5426\u5b58\u5728\u952e\u503c\u5bf9 \u9ed8\u8ba4\u96f6\u503c\u4e3a nil \u4f7f\u7528 fmt.Errorf \u624d\u63cf\u8ff0\u9519\u8bef\u4fe1\u606f \u53ef\u4ee5\u5bf9\u81ea\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9e\u73b0 error \u63a5\u53e3","title":"Error \u63a5\u53e3"},{"location":"cs/pl/go/basic/#_24","text":"","title":"\u6807\u51c6\u5e93"},{"location":"cs/pl/go/basic/#fmt","text":"fmt\u5305\u5b9e\u73b0\u4e86\u7c7b\u4f3cC\u8bed\u8a00printf\u548cscanf\u7684\u683c\u5f0f\u5316I/O\u3002\u4e3b\u8981\u5206\u4e3a\u5411\u5916\u8f93\u51fa\u5185\u5bb9\u548c\u83b7\u53d6\u8f93\u5165\u5185\u5bb9\u4e24\u5927\u90e8\u5206","title":"fmt"},{"location":"cs/pl/go/basic/#_25","text":"Print() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u7cfb\u7edf\u7684\u6807\u51c6\u8f93\u51fa Fprint() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u4e00\u4e2aio.Writer\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cfw\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u7528\u8fd9\u4e2a\u51fd\u6570\u5f80\u6587\u4ef6\u4e2d\u5199\u5165\u5185\u5bb9 Sprint() \uff1a\u628a\u4f20\u5165\u7684\u6570\u636e\u751f\u6210\u5e76\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32 Errorf() \uff1a\u6839\u636eformat\u53c2\u6570\u751f\u6210\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u8be5\u5b57\u7b26\u4e32\u7684\u9519\u8bef","title":"\u5411\u5916\u8f93\u51fa"},{"location":"cs/pl/go/basic/#_26","text":"Scan() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d\uff0c\u6362\u884c\u7b26\u89c6\u4e3a\u7a7a\u767d\u7b26 Scanf() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u6839\u636eformat\u53c2\u6570\u6307\u5b9a\u7684\u683c\u5f0f\u53bb\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d Scanln() \uff1a\u7c7b\u4f3cScan\uff0c\u5b83\u5728\u9047\u5230\u6362\u884c\u65f6\u624d\u505c\u6b62\u626b\u63cf\u3002\u6700\u540e\u4e00\u4e2a\u6570\u636e\u540e\u9762\u5fc5\u987b\u6709\u6362\u884c\u6216\u8005\u5230\u8fbe\u7ed3\u675f\u4f4d\u7f6e bufio.NewReader \uff1a\u65f6\u5019\u6211\u4eec\u60f3\u5b8c\u6574\u83b7\u53d6\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u800c\u8f93\u5165\u7684\u5185\u5bb9\u53ef\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u4f7f\u7528bufio\u5305\u6765\u5b9e\u73b0 Fscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4eceio.Reader\u4e2d\u8bfb\u53d6\u6570\u636e Sscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4ece\u6307\u5b9a\u5b57\u7b26\u4e32\u4e2d\u8bfb\u53d6\u6570\u636e","title":"\u83b7\u53d6\u8f93\u5165"},{"location":"cs/pl/go/basic/#log","text":"Go\u8bed\u8a00\u5185\u7f6e\u7684log\u5305\u5b9e\u73b0\u4e86\u7b80\u5355\u7684\u65e5\u5fd7\u670d\u52a1 log package main import ( \"log\" ) func main () { log . Println ( \"\u8fd9\u662f\u4e00\u6761\u5f88\u666e\u901a\u7684\u65e5\u5fd7\u3002\" ) v := \"\u5f88\u666e\u901a\u7684\" log . Printf ( \"\u8fd9\u662f\u4e00\u6761%s\u65e5\u5fd7\u3002\\n\" , v ) log . Fatalln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1fatal\u7684\u65e5\u5fd7\u3002\" ) log . Panicln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1panic\u7684\u65e5\u5fd7\u3002\" ) } \u9664\u4e86\u9ed8\u8ba4\u63d0\u4f9b\u65e5\u5fd7\u7684\u65f6\u95f4\u4fe1\u606f\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6elogger\u6765\u8bbe\u7f6e\u8f93\u51fa\u4fe1\u606f","title":"log"},{"location":"cs/pl/go/basic/#_27","text":"","title":"\u6587\u4ef6\u64cd\u4f5c"},{"location":"cs/pl/go/basic/#_28","text":"os.Open() \u51fd\u6570\u80fd\u591f\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u8fd4\u56de\u4e00\u4e2a *File \u548c\u4e00\u4e2a err \u3002\u5bf9\u5f97\u5230\u7684\u6587\u4ef6\u5b9e\u4f8b\u8c03\u7528 close() \u65b9\u6cd5\u80fd\u591f\u5173\u95ed\u6587\u4ef6 open and close package main import ( \"fmt\" \"os\" ) func main () { // \u53ea\u8bfb\u65b9\u5f0f\u6253\u5f00\u5f53\u524d\u76ee\u5f55\u4e0b\u7684main.go\u6587\u4ef6 file , err := os . Open ( \"./main.go\" ) if err != nil { fmt . Println ( \"open file failed!, err:\" , err ) return } // \u5173\u95ed\u6587\u4ef6 file . Close () } \u4e3a\u4e86\u9632\u6b62\u6587\u4ef6\u5fd8\u8bb0\u5173\u95ed\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528defer\u6ce8\u518c\u6587\u4ef6\u5173\u95ed\u8bed\u53e5","title":"\u6253\u5f00\u548c\u5173\u95ed\u6587\u4ef6"},{"location":"cs/pl/go/basic/#_29","text":"file.Read() \u63a5\u6536\u4e00\u4e2a\u5b57\u8282\u5207\u7247\uff0c\u8fd4\u56de\u8bfb\u53d6\u7684\u5b57\u8282\u6570\u548c\u53ef\u80fd\u7684\u5177\u4f53\u9519\u8bef\uff0c\u8bfb\u5230\u6587\u4ef6\u672b\u5c3e\u65f6\u4f1a\u8fd4\u56de0\u548cio.EOF func ( f * File ) Read ( b [] byte ) ( n int , err error ) \u4f7f\u7528 for \u5faa\u73af\u8bfb\u53d6\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6570\u636e bufio\u8bfb\u53d6\u6587\u4ef6 bufio \u662f\u5728 file \u7684\u57fa\u7840\u4e0a\u5c01\u88c5\u4e86\u4e00\u5c42API\uff0c\u652f\u6301\u66f4\u591a\u7684\u529f\u80fd \u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6 io/ioutil \u5305\u7684 ReadFile \u65b9\u6cd5\u80fd\u591f\u8bfb\u53d6\u5b8c\u6574\u7684\u6587\u4ef6\uff0c\u53ea\u9700\u8981\u5c06\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165","title":"\u8bfb\u53d6\u6587\u4ef6"},{"location":"cs/pl/go/basic/#_30","text":"os.OpenFile() \u51fd\u6570\u80fd\u591f\u4ee5\u6307\u5b9a\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u4ece\u800c\u5b9e\u73b0\u6587\u4ef6\u5199\u5165\u76f8\u5173\u529f\u80fd Write \u548c WriteString bufio.NewWriter ioutil.WriteFile","title":"\u6587\u4ef6\u5199\u5165\u64cd\u4f5c"},{"location":"cs/pl/go/basic/#strconv","text":"strconv\u5305\u5b9e\u73b0\u4e86\u57fa\u672c\u6570\u636e\u7c7b\u578b\u4e0e\u5176\u5b57\u7b26\u4e32\u8868\u793a\u7684\u8f6c\u6362","title":"strconv"},{"location":"cs/pl/go/basic/#atoi","text":"\u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u6574\u6570\u8f6c\u6362\u4e3aint\u7c7b\u578b","title":"Atoi()"},{"location":"cs/pl/go/basic/#itoa","text":"\u7528\u4e8e\u5c06int\u7c7b\u578b\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u8868\u793a","title":"Itoa()"},{"location":"cs/pl/go/basic/#parse","text":"Parse\u7c7b\u51fd\u6570\u7528\u4e8e\u8f6c\u6362\u5b57\u7b26\u4e32\u4e3a\u7ed9\u5b9a\u7c7b\u578b\u7684\u503c\uff1aParseBool()\u3001ParseFloat()\u3001ParseInt()\u3001ParseUint() \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684bool\u503c func ParseBool ( str string ) ( value bool , err error ) \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684\u6574\u6570\u503c func ParseInt ( s string , base int , bitSize int ) ( i int64 , err error ) \u89e3\u6790\u4e00\u4e2a\u8868\u793a\u6d6e\u70b9\u6570\u7684\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u5176\u503c func ParseFloat ( s string , bitSize int ) ( f float64 , err error )","title":"Parse\u7cfb\u5217\u51fd\u6570"},{"location":"cs/pl/go/basic/#format","text":"Format\u7cfb\u5217\u51fd\u6570\u5b9e\u73b0\u4e86\u5c06\u7ed9\u5b9a\u7c7b\u578b\u6570\u636e\u683c\u5f0f\u5316\u4e3astring\u7c7b\u578b\u6570\u636e\u7684\u529f\u80fd \u6839\u636eb\u7684\u503c\u8fd4\u56de\u201dtrue\u201d\u6216\u201dfalse\u201d func FormatBool ( b bool ) string \u8fd4\u56dei\u7684base\u8fdb\u5236\u7684\u5b57\u7b26\u4e32\u8868\u793a func FormatInt ( i int64 , base int ) string \u51fd\u6570\u5c06\u6d6e\u70b9\u6570\u8868\u793a\u4e3a\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de func FormatFloat ( f float64 , fmt byte , prec , bitSize int ) string","title":"Format\u7cfb\u5217\u51fd\u6570"},{"location":"cs/pl/go/basic/#referencce","text":"Go \u5b98\u65b9\u6587\u6863 Go \u83dc\u9e1f\u6559\u7a0b Go \u8bed\u8a00\u5b66\u4e60\u4e4b\u8def Go by Example \u4e2d\u6587\u7248","title":"Referencce"},{"location":"cs/pl/go/gin/","text":"","title":"gin\u6846\u67b6 (TODO)"},{"location":"cs/pl/java/","text":"Java \u00b6 Abstract \u5f53\u521d\u627e\u5de5\u4f5c\u65f6\u963f\u91cc\u3001\u7f8e\u56e2\u3001\u4eac\u4e1c\u57fa\u672c\u90fd\u7528 java\uff08\u7ed3\u679c\u90fd\u88ab\u529d\u9000\u4e86\uff09\uff0c\u4f5c\u4e3a\u4e00\u540d\u4e0d\u662f java \u7a0b\u5e8f\u5458\uff0c\u4f46\u4e5f\u7a0d\u5fae\u5b66\u4e60\u4e00\u4e0b\u57fa\u7840\u77e5\u8bc6 \u4e0d\u559c\u6b22 java\uff0c\u6ca1\u6709 C++ \u5199\u8d77\u6765\u723d Table of Contents \u00b6 Java \u7cfb\u7edf\u77e5\u8bc6 SpringBoot","title":"Java"},{"location":"cs/pl/java/#java","text":"Abstract \u5f53\u521d\u627e\u5de5\u4f5c\u65f6\u963f\u91cc\u3001\u7f8e\u56e2\u3001\u4eac\u4e1c\u57fa\u672c\u90fd\u7528 java\uff08\u7ed3\u679c\u90fd\u88ab\u529d\u9000\u4e86\uff09\uff0c\u4f5c\u4e3a\u4e00\u540d\u4e0d\u662f java \u7a0b\u5e8f\u5458\uff0c\u4f46\u4e5f\u7a0d\u5fae\u5b66\u4e60\u4e00\u4e0b\u57fa\u7840\u77e5\u8bc6 \u4e0d\u559c\u6b22 java\uff0c\u6ca1\u6709 C++ \u5199\u8d77\u6765\u723d","title":"Java"},{"location":"cs/pl/java/#table-of-contents","text":"Java \u7cfb\u7edf\u77e5\u8bc6 SpringBoot","title":"Table of Contents"},{"location":"cs/pl/java/basic/","text":"Java \u7cfb\u7edf\u77e5\u8bc6 \u00b6 \u7ea6 2317 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u51c6\u5907\u9762\u8bd5\u65f6\u7a0d\u5fae\u5b66\u4e60\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6 \uff08\u4e0d\u7528java\uff0c\u4e5f\u4e0d\u559c\u6b22java\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5427 \u7ebf\u6027\u6c60 \u00b6 \u7ebf\u6027\u6c60\u7684\u539f\u56e0 \u4e0d\u65ad\u7684\u521b\u5efa\u548c\u5220\u7ebf\u7a0b\uff0c\u4f1a\u5e26\u6765\u8f83\u5927\u7684\u7cfb\u7edf\u8d44\u6e90\u8d1f\u8f7d \u7ebf\u7a0b\u7f3a\u4e4f\u7edf\u4e00\u7684\u7ba1\u7406\uff0c\u53ef\u80fd\u4f1a\u5e26\u6765\u65e0\u9650\u5236\u7684\u521b\u5efa\u7ebf\u7a0b \u7ebf\u7a0b\u4e4b\u95f4\u62a2\u5360\u8d44\u6e90 \u7ebf\u7a0b\u6c60\u7684\u5c5e\u6027 \u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u4fdd\u6301\u5b58\u5728\u7684\u7ebf\u7a0b\u6570\u91cf\uff0c\u8fd9\u4e9b\u7ebf\u7a0b\u4f1a\u4e00\u76f4\u5b58\u5728\uff0c\u4e0d\u4f1a\u88ab\u5220\u9664 \u4efb\u52a1\u7f13\u51b2\u9510\u88c2\uff1a\u5f53\u6240\u6709\u7684\u6838\u5fc3\u7ebf\u7a0b\u90fd\u5728\u8fd0\u884c\u65f6\uff0c\u65b0\u7684\u4efb\u52a1\u4f1a\u88ab\u52a0\u5165\u5230\u7f13\u51b2\u961f\u5217\u4e2d \u975e\u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u5f53\u4efb\u52a1\u7f13\u51b2\u961f\u5217\u6ee1\u540e\uff0c\u5c06\u4f1a\u521b\u5efa\u65b0\u7684\u7ebf\u7a0b\u6765\u6267\u884c\u961f\u5217\u4e2d\u7684\u4efb\u52a1\uff0c\u4e14\u989d\u5916\u521b\u5efa\u7684\u7ebf\u7a0b\u6570\u4e0d\u4f1a\u8d85\u8fc7\u975e\u6838\u5fc3\u7ebf\u7a0b\u6570 \u7a7a\u95f2\u7ebf\u7a0b\u7684\u5b58\u6d3b\u65f6\u95f4\uff1a\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u7a7a\u95f2\u65f6\uff0c\u4e14\u6301\u7eed\u4e86\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u6b64\u7ebf\u7a0b\u5c06\u4f1a\u88ab\u5220\u9664 \u62d2\u7edd\u7b56\u7565\uff0c\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u548c\u4efb\u52a1\u7f13\u5b58\u961f\u5217\u6ee1\u540e\uff0c\u5bf9\u5f85\u65b0\u7684\u4efb\u52a1\u7684\u7b56\u7565 Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u7c7b\u578b \u540d\u79f0 \u6838\u5fc3\u7ebf\u7a0b\u6570 \u7ebf\u7a0b\u6c60\u5927\u5c0f \u975e\u6838\u5fc3\u7ebf\u7a0b\u5b58\u6d3b\u65f6\u95f4 \u7b49\u5f85\u961f\u5217\u5927\u5c0f CachedThreadPool 0 \u221e 60s 0 SingleThreadExecutor 1 1 0 \u221e FixedThreadPool n n 0 \u221e ScheduledThreadPoolExecutor Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u5f15\u8d77OOM\u5f02\u5e38\uff08OutOfMemoryError\uff09 CachedThreadPool\u5141\u8bb8\u521b\u5efa\u65e0\u7ebf\u7684\u7ebf\u7a0b\uff0c\u4ece\u800c\u5f15\u8d77OOM\u5f02\u5e38 SingleThreadExecutor\u548cFixedThreadPool\u8bf7\u6c42\u961f\u5217\u4e3a\u65e0\u9650\u957f\uff0c\u53ef\u80fd\u4f1a\u5806\u79ef\u5927\u91cf\u7684\u6d88\u606f\uff0c\u4ece\u800c\u5f15\u53d1OOM\u5f02\u5e38\u3002 Java\u5185\u5b58 \u00b6 \u5185\u5b58\u7c7b\u578b \u4e3b\u5185\u5b58\uff1a\u7ebf\u7a0b\u4e4b\u95f4\u5171\u4eab\u7684\u53d8\u91cf\u50a8\u5b58\u5728\u4e3b\u5185\u5b58\u4e2d \u672c\u5730\u5185\u5b58\uff1a\u6bcf\u4e2a\u7ebf\u7a0b\u72ec\u7acb\u62e5\u6709\u7684\u5185\u5b58 \u672c\u5730\u5185\u5b58\u4fdd\u5b58\u7684\u662f\u4e3b\u5185\u5b58\u7684\u5171\u4eab\u53d8\u91cf\u7684\u526f\u672c \u5783\u573e\u56de\u6536 \u6839\u641c\u7d22\u7b97\u6cd5\uff08\u53ef\u8fbe\u6027\u5206\u6790\u7b97\u6cd5\uff09\u4eceGC ROOT\u7ed3\u70b9\u6cbf\u7740\u5f15\u7528\u94fe\u641c\u7d22\uff0c\u65e0\u6cd5\u5230\u8fbe\u7684\u7ed3\u70b9\u5373\u4e3a\u4e0d\u53ef\u5230\u8fbe\u7684\u5bf9\u8c61 \u5783\u573e\u56de\u6536\u5668 G1\u6536\u96c6\u5668 \u72ec\u7279\u7684\u5206\u4ee3\u5783\u573e\u56de\u6536\u5668\uff0c\u5206\u4ee3GC\uff1a\u5206\u4ee3\u6536\u96c6\u5668\uff0c\u540c\u65f6\u517c\u987e\u5e74\u8f7b\u4ee3\u548c\u8001\u5e74\u4ee3 \u4f7f\u7528\u5206\u533a\u7b97\u6cd5\uff0c\u4e0d\u8981\u6c42eden\uff0c\u5e74\u8f7b\u4ee3\u6216\u8001\u5e74\u4ee3\u7684\u7a7a\u95f4\u90fd\u8fde\u7eed \u5e76\u884c\u6027\uff1a\u56de\u6536\u671f\u95f4\uff0c\u53ef\u7531\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u5de5\u4f5c\uff0c\u6709\u6548\u5229\u7528\u591a\u6838CPU\u8d44\u6e90 \u7a7a\u95f4\u6574\u7406\uff1a\u56de\u6536\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u8fdb\u884c\u9002\u5f53\u5bf9\u8c61\u79fb\u52a8\uff0c\u51cf\u5c11\u7a7a\u95f4\u788e\u7247 \u53ef\u9884\u89c1\u6027\uff1aG1\u53ef\u9009\u53d6\u90e8\u5206\u533a\u57df\u8fdb\u884c\u56de\u6536\uff0c\u53ef\u89c1\u7f29\u5c0f\u56de\u6536\u8303\u56f4\uff0c\u51cf\u5c11\u5168\u5c40\u505c\u987f G1\u6536\u96c6\u5668\u7684\u8fc7\u7a0b \u521d\u59cb\u6807\u8bb0\uff08\u5b83\u6807\u8bb0\u4e86\u4eceGC ROOT\u5f00\u59cb\u76f4\u63a5\u53ef\u8fbe\u7684\u5bf9\u8c61\uff09Stop-The-World \u5e76\u53d1\u6807\u8bb0\uff08\u4eceGC Roots\u5f00\u59cb\u5bf9\u5806\u4e2d\u5bf9\u8c61\u8fdb\u884c\u53ef\u8fbe\u6027\u5206\u6790\uff0c\u627e\u51fa\u5b58\u6d3b\u5bf9\u8c61\uff09 \u6700\u7ec8\u6807\u8bb0\uff08\u6807\u8bb0\u90a3\u4e9b\u5728\u5e76\u53d1\u6807\u8bb0\u9636\u6bb5\u53d1\u751f\u53d8\u5316\u7684\u5bf9\u8c61\uff0c\u5c06\u88ab\u56de\u6536\uff09Stop-The-World \u7b5b\u9009\u56de\u6536\uff08\u9996\u5148\u5bf9\u5404\u4e2aRegin\u7684\u56de\u6536\u4ef7\u503c\u548c\u6210\u672c\u8fdb\u884c\u6392\u5e8f\uff0c\u6839\u636e\u7528\u6237\u6240\u671f\u5f85\u7684GC\u505c\u987f\u65f6\u95f4\u6307\u5b9a\u56de\u6536\u8ba1\u5212\uff0c\u56de\u6536\u4e00\u90e8\u5206Region\uff09Stop-The-World Map \u00b6 HashMap\u7684\u7ed3\u6784 \u91c7\u7528\u94fe\u5730\u5740\u6cd5\uff0c\u5f53\u53d1\u751f\u54c8\u5e0c\u51b2\u7a81\u65f6\u4f7f\u7528\u94fe\u8868\u89e3\u51b3 \u5f53\u94fe\u8868\u8fc7\u957f\u65f6\uff0c\u5728JDK1.8\u4e0b\u91c7\u7528\u7ea2\u9ed1\u6811\u4ee3\u66ff\u94fe\u8868\uff0c\u5f53\u6570\u636e\u91cf\u8f83\u5c11\u65f6\uff0c\u8f6c\u56de\u94fe\u8868 \u5f53\u5b58\u50a8\u7684\u6570\u636e\u91cf\u8d85\u8fc7\u4e00\u4e2a\u9608\u503c\u540e\uff0cHashMap\u7684\u54c8\u5e0c\u8868\u957f\u5ea6\u5c06\u4f1a\u6269\u5bb9\u5230\u539f\u6765\u7684\u4e24\u500d\uff0c\u7136\u540e\u5c06\u6240\u6709\u7684\u6570\u636e\u91cd\u65b0\u5206\u914d\u5230\u65b0\u7684\u5185\u5b58\u4e2d HashMap\u8fd9\u6837\u6269\u5bb9\u7684\u539f\u56e0 \u901a\u8fc7\u6070\u597d\u4e24\u500d\u6269\u5bb9\uff0c\u53ef\u4ee5\u8ba9\u539f\u6765\u5728\u7b2ci\u4e2a\u94fe\u8868\u7684\u503c\u88ab\u6070\u597d\u5206\u914d\u5230\u7b2ci\u548c\u7b2c2i\u4e2a\u94fe\u8868\u7684\u4f4d\u7f6e \u6bcf\u4e00\u4e2a\u503c\uff0c\u53ea\u9700\u8981\u5224\u65ad\u5176\u54c8\u5e0c\u503c\u5728\u67d0\u4e2a\u4e8c\u8fdb\u5236\u4f4d\u4e0a\u7684\u503c\u5373\u53ef\u76f4\u63a5\u5b8c\u6210\u5206\u914d TreeMap\u7684\u7ed3\u6784 TreeMap\u662f\u4e00\u9897\u7ea2\u9ed1\u6811 \u8bbe\u8ba1\u6a21\u5f0f \u00b6 \u8bbe\u8ba1\u539f\u5219 \u5f00\u95ed\u539f\u5219\uff1a\u5bf9\u6269\u5c55\u5f00\u653e\uff0c\u5bf9\u4fee\u6539\u5173\u95ed \u91cc\u6c0f\u66ff\u6362\u539f\u5219\uff1a\u5b50\u7c7b\u5fc5\u987b\u62e5\u6709\u6240\u6709\u7684\u7236\u7c7b\u529f\u80fd\uff0c\u5b50\u7c7b\u53ef\u4ee5\u5f00\u53d1\u81ea\u5df1\u7684\u65b0\u529f\u80fd \u4f9d\u8d56\u5012\u7f6e\u539f\u5219\uff1a\u9ad8\u5c42\u5b9e\u73b0\u4e0d\u80fd\u4f9d\u8d56\u4f4e\u5c42\u5b9e\u73b0\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u4f4e\u5c42\u7684\u62bd\u8c61\u7c7b \u5355\u4e00\u804c\u8d23\u539f\u5219\uff1a\u4e00\u4e2a\u7c7b\u5e94\u5f53\u53ea\u8d1f\u8d23\u4e00\u4e2a\u804c\u8d23 \u63a5\u53e3\u9694\u79bb\u539f\u5219\uff1a\u63a5\u53e3\u5e94\u8be5\u66f4\u5c0f\u66f4\u5177\u4f53\uff0c\u800c\u4e0d\u662f\u53bb\u5b9e\u73b0\u5f88\u5e9e\u5927\u7684\u501f\u53e3\u6765\u9002\u5e94\u6240\u6709\u9700\u6c42 \u8fea\u7c73\u7279\u6cd5\u5219\uff1a\u907f\u514d\u4e0e\u65e0\u5173\u5b9e\u4f53\u8fdb\u884c\u901a\u4fe1 \u5408\u6210\u590d\u7528\u539f\u5219\uff1a\u5c3d\u91cf\u5148\u4f7f\u7528\u7ec4\u5408\u6216\u8005\u805a\u5408\u7b49\u5173\u8054\uff0c\u5176\u6b21\u8003\u8651\u7ee7\u627f \u8bbe\u8ba1\u6a21\u5f0f \u521b\u5efa\u578b\u6a21\u5f0f \u5355\u4f8b\u6a21\u5f0f\uff1a\u9650\u5236\u4e00\u4e2a\u7c7b\u53ea\u80fd\u6709\u4e00\u4e2a\u5b9e\u4f8b \u539f\u578b\u6a21\u5f0f\uff1a\u4ee5\u4e00\u4e2a\u6b64\u7c7b\u578b\u7684\u5b9e\u4f8b\u4e3a\u6a21\u7248\uff0c\u901a\u8fc7\u62f7\u8d1d\u5185\u5b58\u4e2d\u7684\u4e8c\u8fdb\u5236\u503c\u6765\u76f4\u63a5\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61 \u5de5\u5382\u6a21\u5f0f\uff1a\u5c06\u521b\u5efa\u5bf9\u8c61\u7684\u8fc7\u7a0b\u7531\u53e6\u4e00\u4e2a\u7c7b\u8fdb\u884c\u5c01\u88c5 \u5efa\u9020\u8005\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u590d\u6742\u7684\u5bf9\u8c61\u5206\u4e3a\u591a\u4e2a\u7b80\u5355\u7684\u5bf9\u8c61\u7684\u7ec4\u5408\uff0c\u5e76\u5b9e\u73b0\u5c06\u591a\u4e2a\u5c0f\u5bf9\u8c61\u8fdb\u884c\u62fc\u88c5\u7684\u8fc7\u7a0b \u7ed3\u6784\u578b\u6a21\u5f0f \u4ee3\u7406\u6a21\u5f0f\uff1a\u4f7f\u5f97\u4e24\u4e2a\u5bf9\u8c61\u4e4b\u95f4\u4e0d\u80fd\u76f4\u63a5\u5f15\u7528\u8bbf\u95ee\uff0c\u53ea\u80fd\u901a\u8fc7\u7b2c\u4e09\u65b9\uff0c\u53ef\u4ee5\u4fdd\u62a4\u76ee\u6807\u5bf9\u8c61\uff0c\u6269\u5c55\u76ee\u6807\u5bf9\u8c61\u7684\u529f\u80fd \u9002\u914d\u5668\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u7c7b\u7684\u63a5\u53e3\u8f6c\u6362\u4e3a\u53e6\u4e00\u4e2a\u7c7b\u7684\u501f\u53e3\uff0c\u901a\u5e38\u662f\u4e3a\u4e86\u9002\u914d\u4e24\u4e2a\u63a5\u53e3\u7684\u5bf9\u63a5\u95ee\u9898 \u6865\u63a5\u6a21\u5f0f\uff1a\u5c06\u62bd\u8c61\u4e0e\u5b9e\u73b0\u5206\u79bb\uff0c\u4f7f\u5f97\u4ed6\u4eec\u53ef\u4ee5\u72ec\u7acb\u53d8\u5316\uff0c\u7528\u7ec4\u5408\u5173\u7cfb\u6765\u4ee3\u66ff\u7ee7\u627f\u5173\u7cfb \u88c5\u9970\u5668\u6a21\u5f0f\uff1a\u4e3a\u7c7b\u589e\u52a0\u65b0\u7684\u529f\u80fd\u7684\u540c\u65f6\uff0c\u907f\u514d\u4e86\u7ee7\u627f \u5916\u89c2\u6a21\u5f0f\uff1a\u9690\u85cf\u7cfb\u7edf\u7684\u590d\u6742\u6027 \u4eab\u5143\u6a21\u5f0f\uff1a\u91cd\u590d \u4f7f\u7528\u5df2\u7ecf\u521b\u5efa\u7684\u540c\u7c7b\u5bf9\u8c61 \u7ec4\u5408\u6a21\u5f0f \u884c\u4e3a\u578b\u6a21\u5f0f \u6a21\u677f\u65b9\u6cd5\u6a21\u5f0f\uff1a\u4ec5\u5b9e\u73b0\u4e00\u4e2a\u64cd\u4f5c\u4e2d\u7684\u9aa8\u5e72\u6b65\u9aa4\uff0c\u5177\u4f53\u6b65\u9aa4\u7531\u5176\u5b50\u7c7b\u5b9e\u73b0 \u7b56\u7565\u6a21\u5f0f \u547d\u4ee4\u6a21\u5f0f \u8d23\u4efb\u94fe\u6a21\u5f0f \u72b6\u6001\u6a21\u5f0f \u89c2\u5bdf\u8005\u6a21\u5f0f \u4e2d\u4ecb\u8005\u6a21\u5f0f \u8fed\u4ee3\u5668\u6a21\u5f0f \u8bbf\u95ee\u8005\u6a21\u5f0f \u5907\u5fd8\u5f55\u6a21\u5f0f \u89e3\u91ca\u5668\u6a21\u5f0f String \u00b6 String\u7c7b\u578b String\u7c7b\u578b\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u5bf9String\u7c7b\u578b\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u91cd\u65b0\u751f\u6210\u65b0\u7684String\u5bf9\u8c61 StringBuilder\u548cStringBuffer StringBuilder\u548cStringBuffer\u90fd\u662f\u53ef\u53d8\u7684 StringBuilder\u6ca1\u6709\u7ebf\u7a0b\u540c\u6b65\uff0c\u5b58\u5728\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\uff0c\u4f46\u662f\u5176\u6548\u7387\u7565\u9ad8\u4e8eStringBuffer StringBuffer\u80fd\u591f\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\uff0c\u4f46\u6548\u7387\u8f83\u4f4e \u63a5\u53e3\u548c\u62bd\u8c61\u7c7b \u00b6 \u63a5\u53e3\u548c\u62bd\u8c61\u7c7b\u7684\u533a\u522b \u62bd\u8c61\u7c7b\u53ef\u4ee5\u5199\u975e\u62bd\u8c61\u65b9\u6cd5\uff0c\u800c\u63a5\u53e3\u7c7b\u53ea\u80fd\u6709\u62bd\u8c61\u65b9\u6cd5 \u4e00\u4e2a\u7c7b\u53ea\u80fd\u7ee7\u627f\u81ea\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u800c\u4e00\u4e2a\u7c7b\u80fd\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u7ee7\u627f\u662f\u4e00\u4e2a\u201c\u662f\u4e0d\u662f\u201d\u7684\u5173\u7cfb\uff0c\u800c\u63a5\u53e3\u5b9e\u73b0\u5219\u662f\u201c\u6709\u6ca1\u6709\u201d\u7684\u5173\u7cfb \u6784\u9020\u51fd\u6570 \u00b6 \u5b50\u7c7b\u5b9e\u4f8b\u5316\u603b\u662f\u9ed8\u8ba4\u8c03\u7528\u7236\u7c7b\u7684\u65e0\u53c2\u6784\u9020\u65b9\u6cd5 \u4e3a\u4e86\u8ba9\u7236\u7c7b\u521d\u59cb\u5316\u5c5e\u6027\u548c\u65b9\u6cd5 equals \u00b6 equals \u548c == \u7684\u533a\u522b == \u5bf9\u4e8e\u57fa\u672c\u7c7b\u578b\u65f6\uff0c\u6bd4\u8f83\u7684\u662f\u4e24\u4e2a\u5bf9\u8c61\u7684\u503c\u662f\u5426\u76f8\u540c\uff0c\u800c\u5bf9\u4e8e\u5bf9\u8c61\u65f6\uff0c\u5219\u6bd4\u8f83\u7684\u662f\u8fd9\u4e24\u4e2a\u5f15\u7528\u662f\u5426\u6307\u5411\u4e86\u540c\u4e00\u4e2a\u5bf9\u8c61 equals \u5219\u53ef\u4ee5\u7531\u6b64\u7c7b\u8fdb\u884c\u91cd\u5199\uff0c\u4f7f\u5f97\u5176\u6ee1\u8db3\u6b63\u5e38\u7684\u6bd4\u8f83\u5173\u7cfb\u3002\u82e5\u4e0d\u8fdb\u884c\u91cd\u5199\uff0c\u5219\u4e0e == \u7b49\u4ef7 equals \u548c hashCode \u4e3a\u4ec0\u4e48\u9700\u8981\u540c\u65f6\u8fdb\u884c\u91cd\u5199 hashCode \u5728 Object \u7c7b\u4e0b\u7684\u9ed8\u8ba4\u884c\u4e3a\u662f\u5c06\u6b64\u503c\u7684\u5730\u5740\u53d6\u51fa\u4f5c\u4e3a hashCode \uff0c\u4f46\u8fd9\u4e0e hashCode \u672c\u610f\u4e0d\u540c\uff0c hashCode \u7684\u503c\u5e94\u5f53\u6ee1\u8db3\u5bf9\u4e8e\u4efb\u610fx\u82e5 x.equals(y) = true \uff0c\u5219 x.hashCode() = y.hashCode() \uff0c\u6240\u4ee5\u5f53\u91cd\u5199 equals \u65f6\uff0c\u901a\u5e38\u610f\u5473\u7740\u8fd9\u4e2a\u503c\u7684\u76f8\u7b49\u6982\u5ff5\u4e0e == \u4e0d\u540c\u3002\u6240\u4ee5\u5fc5\u7136\u9700\u8981\u91cd\u5199 hashCode \u907f\u514d\u5728 hashMap \u4e2d\u51fa\u73b0\u610f\u6599\u4e4b\u5916\u7684\u60c5\u51b5 CopyOnWrite \u00b6 \u5199\u5165\u65f6\u590d\u5236\uff08CopyOnWrite\uff0c\u7b80\u79f0COW\uff09\u601d\u60f3\u662f\u8ba1\u7b97\u673a\u7a0b\u5e8f\u8bbe\u8ba1\u9886\u57df\u4e2d\u7684\u4e00\u79cd\u901a\u7528\u4f18\u5316\u7b56\u7565\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\uff0c\u5982\u679c\u6709\u591a\u4e2a\u8c03\u7528\u8005\uff08Callers\uff09\u540c\u65f6\u8bbf\u95ee\u76f8\u540c\u7684\u8d44\u6e90\uff08\u5982\u5185\u5b58\u6216\u8005\u662f\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u5b58\u50a8\uff09\uff0c\u4ed6\u4eec\u4f1a\u5171\u540c\u83b7\u53d6\u76f8\u540c\u7684\u6307\u9488\u6307\u5411\u76f8\u540c\u7684\u8d44\u6e90\uff0c\u76f4\u5230\u67d0\u4e2a\u8c03\u7528\u8005\u4fee\u6539\u8d44\u6e90\u5185\u5bb9\u65f6\uff0c\u7cfb\u7edf\u624d\u4f1a\u771f\u6b63\u590d\u5236\u4e00\u4efd\u4e13\u7528\u526f\u672c\uff08private copy\uff09\u7ed9\u8be5\u8c03\u7528\u8005\uff0c\u800c\u5176\u4ed6\u8c03\u7528\u8005\u6240\u89c1\u5230\u7684\u6700\u521d\u7684\u8d44\u6e90\u4ecd\u7136\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u8fc7\u7a0b\u5bf9\u5176\u4ed6\u7684\u8c03\u7528\u8005\u90fd\u662f\u900f\u660e\u7684\uff08transparently\uff09\u3002\u6b64\u505a\u6cd5\u4e3b\u8981\u7684\u4f18\u70b9\u662f\u5982\u679c\u8c03\u7528\u8005\u6ca1\u6709\u4fee\u6539\u8d44\u6e90\uff0c\u5c31\u4e0d\u4f1a\u6709\u526f\u672c\uff08private copy\uff09\u88ab\u521b\u5efa\uff0c\u56e0\u6b64\u591a\u4e2a\u8c03\u7528\u8005\u53ea\u662f\u8bfb\u53d6\u64cd\u4f5c\u65f6\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4efd\u8d44\u6e90\u3002 \u901a\u4fd7\u6613\u61c2\u7684\u8bb2\uff0c\u5199\u5165\u65f6\u590d\u5236\u6280\u672f\u5c31\u662f\u4e0d\u540c\u8fdb\u7a0b\u5728\u8bbf\u95ee\u540c\u4e00\u8d44\u6e90\u7684\u65f6\u5019\uff0c\u53ea\u6709\u66f4\u65b0\u64cd\u4f5c\uff0c\u624d\u4f1a\u53bb\u590d\u5236\u4e00\u4efd\u65b0\u7684\u6570\u636e\u5e76\u66f4\u65b0\u66ff\u6362\uff0c\u5426\u5219\u90fd\u662f\u8bbf\u95ee\u540c\u4e00\u4e2a\u8d44\u6e90\u3002 JDK \u7684 CopyOnWriteArrayList/CopyOnWriteArraySet \u5bb9\u5668\u6b63\u662f\u91c7\u7528\u4e86 COW \u601d\u60f3\uff0c\u5b83\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u5462\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5e73\u65f6\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u90fd\u4e0d\u9700\u8981\u52a0\u9501\uff0c\u968f\u4fbf\u8bbf\u95ee\uff0c\u53ea\u6709\u5728\u66f4\u65b0\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u4ece\u539f\u6765\u7684\u6570\u636e\u590d\u5236\u4e00\u4e2a\u526f\u672c\u51fa\u6765\uff0c\u7136\u540e\u4fee\u6539\u8fd9\u4e2a\u526f\u672c\uff0c\u6700\u540e\u628a\u539f\u6570\u636e\u66ff\u6362\u6210\u5f53\u524d\u7684\u526f\u672c\u3002\u4fee\u6539\u64cd\u4f5c\u7684\u540c\u65f6\uff0c\u8bfb\u64cd\u4f5c\u4e0d\u4f1a\u88ab\u963b\u585e\uff0c\u800c\u662f\u7ee7\u7eed\u8bfb\u53d6\u65e7\u7684\u6570\u636e\u3002\u8fd9\u70b9\u8981\u8ddf\u8bfb\u5199\u9501\u533a\u5206\u4e00\u4e0b\u3002","title":"Java \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/java/basic/#java","text":"\u7ea6 2317 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u51c6\u5907\u9762\u8bd5\u65f6\u7a0d\u5fae\u5b66\u4e60\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6 \uff08\u4e0d\u7528java\uff0c\u4e5f\u4e0d\u559c\u6b22java\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5427","title":"Java \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/java/basic/#_1","text":"\u7ebf\u6027\u6c60\u7684\u539f\u56e0 \u4e0d\u65ad\u7684\u521b\u5efa\u548c\u5220\u7ebf\u7a0b\uff0c\u4f1a\u5e26\u6765\u8f83\u5927\u7684\u7cfb\u7edf\u8d44\u6e90\u8d1f\u8f7d \u7ebf\u7a0b\u7f3a\u4e4f\u7edf\u4e00\u7684\u7ba1\u7406\uff0c\u53ef\u80fd\u4f1a\u5e26\u6765\u65e0\u9650\u5236\u7684\u521b\u5efa\u7ebf\u7a0b \u7ebf\u7a0b\u4e4b\u95f4\u62a2\u5360\u8d44\u6e90 \u7ebf\u7a0b\u6c60\u7684\u5c5e\u6027 \u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u4fdd\u6301\u5b58\u5728\u7684\u7ebf\u7a0b\u6570\u91cf\uff0c\u8fd9\u4e9b\u7ebf\u7a0b\u4f1a\u4e00\u76f4\u5b58\u5728\uff0c\u4e0d\u4f1a\u88ab\u5220\u9664 \u4efb\u52a1\u7f13\u51b2\u9510\u88c2\uff1a\u5f53\u6240\u6709\u7684\u6838\u5fc3\u7ebf\u7a0b\u90fd\u5728\u8fd0\u884c\u65f6\uff0c\u65b0\u7684\u4efb\u52a1\u4f1a\u88ab\u52a0\u5165\u5230\u7f13\u51b2\u961f\u5217\u4e2d \u975e\u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u5f53\u4efb\u52a1\u7f13\u51b2\u961f\u5217\u6ee1\u540e\uff0c\u5c06\u4f1a\u521b\u5efa\u65b0\u7684\u7ebf\u7a0b\u6765\u6267\u884c\u961f\u5217\u4e2d\u7684\u4efb\u52a1\uff0c\u4e14\u989d\u5916\u521b\u5efa\u7684\u7ebf\u7a0b\u6570\u4e0d\u4f1a\u8d85\u8fc7\u975e\u6838\u5fc3\u7ebf\u7a0b\u6570 \u7a7a\u95f2\u7ebf\u7a0b\u7684\u5b58\u6d3b\u65f6\u95f4\uff1a\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u7a7a\u95f2\u65f6\uff0c\u4e14\u6301\u7eed\u4e86\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u6b64\u7ebf\u7a0b\u5c06\u4f1a\u88ab\u5220\u9664 \u62d2\u7edd\u7b56\u7565\uff0c\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u548c\u4efb\u52a1\u7f13\u5b58\u961f\u5217\u6ee1\u540e\uff0c\u5bf9\u5f85\u65b0\u7684\u4efb\u52a1\u7684\u7b56\u7565 Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u7c7b\u578b \u540d\u79f0 \u6838\u5fc3\u7ebf\u7a0b\u6570 \u7ebf\u7a0b\u6c60\u5927\u5c0f \u975e\u6838\u5fc3\u7ebf\u7a0b\u5b58\u6d3b\u65f6\u95f4 \u7b49\u5f85\u961f\u5217\u5927\u5c0f CachedThreadPool 0 \u221e 60s 0 SingleThreadExecutor 1 1 0 \u221e FixedThreadPool n n 0 \u221e ScheduledThreadPoolExecutor Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u5f15\u8d77OOM\u5f02\u5e38\uff08OutOfMemoryError\uff09 CachedThreadPool\u5141\u8bb8\u521b\u5efa\u65e0\u7ebf\u7684\u7ebf\u7a0b\uff0c\u4ece\u800c\u5f15\u8d77OOM\u5f02\u5e38 SingleThreadExecutor\u548cFixedThreadPool\u8bf7\u6c42\u961f\u5217\u4e3a\u65e0\u9650\u957f\uff0c\u53ef\u80fd\u4f1a\u5806\u79ef\u5927\u91cf\u7684\u6d88\u606f\uff0c\u4ece\u800c\u5f15\u53d1OOM\u5f02\u5e38\u3002","title":"\u7ebf\u6027\u6c60"},{"location":"cs/pl/java/basic/#java_1","text":"\u5185\u5b58\u7c7b\u578b \u4e3b\u5185\u5b58\uff1a\u7ebf\u7a0b\u4e4b\u95f4\u5171\u4eab\u7684\u53d8\u91cf\u50a8\u5b58\u5728\u4e3b\u5185\u5b58\u4e2d \u672c\u5730\u5185\u5b58\uff1a\u6bcf\u4e2a\u7ebf\u7a0b\u72ec\u7acb\u62e5\u6709\u7684\u5185\u5b58 \u672c\u5730\u5185\u5b58\u4fdd\u5b58\u7684\u662f\u4e3b\u5185\u5b58\u7684\u5171\u4eab\u53d8\u91cf\u7684\u526f\u672c \u5783\u573e\u56de\u6536 \u6839\u641c\u7d22\u7b97\u6cd5\uff08\u53ef\u8fbe\u6027\u5206\u6790\u7b97\u6cd5\uff09\u4eceGC ROOT\u7ed3\u70b9\u6cbf\u7740\u5f15\u7528\u94fe\u641c\u7d22\uff0c\u65e0\u6cd5\u5230\u8fbe\u7684\u7ed3\u70b9\u5373\u4e3a\u4e0d\u53ef\u5230\u8fbe\u7684\u5bf9\u8c61 \u5783\u573e\u56de\u6536\u5668 G1\u6536\u96c6\u5668 \u72ec\u7279\u7684\u5206\u4ee3\u5783\u573e\u56de\u6536\u5668\uff0c\u5206\u4ee3GC\uff1a\u5206\u4ee3\u6536\u96c6\u5668\uff0c\u540c\u65f6\u517c\u987e\u5e74\u8f7b\u4ee3\u548c\u8001\u5e74\u4ee3 \u4f7f\u7528\u5206\u533a\u7b97\u6cd5\uff0c\u4e0d\u8981\u6c42eden\uff0c\u5e74\u8f7b\u4ee3\u6216\u8001\u5e74\u4ee3\u7684\u7a7a\u95f4\u90fd\u8fde\u7eed \u5e76\u884c\u6027\uff1a\u56de\u6536\u671f\u95f4\uff0c\u53ef\u7531\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u5de5\u4f5c\uff0c\u6709\u6548\u5229\u7528\u591a\u6838CPU\u8d44\u6e90 \u7a7a\u95f4\u6574\u7406\uff1a\u56de\u6536\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u8fdb\u884c\u9002\u5f53\u5bf9\u8c61\u79fb\u52a8\uff0c\u51cf\u5c11\u7a7a\u95f4\u788e\u7247 \u53ef\u9884\u89c1\u6027\uff1aG1\u53ef\u9009\u53d6\u90e8\u5206\u533a\u57df\u8fdb\u884c\u56de\u6536\uff0c\u53ef\u89c1\u7f29\u5c0f\u56de\u6536\u8303\u56f4\uff0c\u51cf\u5c11\u5168\u5c40\u505c\u987f G1\u6536\u96c6\u5668\u7684\u8fc7\u7a0b \u521d\u59cb\u6807\u8bb0\uff08\u5b83\u6807\u8bb0\u4e86\u4eceGC ROOT\u5f00\u59cb\u76f4\u63a5\u53ef\u8fbe\u7684\u5bf9\u8c61\uff09Stop-The-World \u5e76\u53d1\u6807\u8bb0\uff08\u4eceGC Roots\u5f00\u59cb\u5bf9\u5806\u4e2d\u5bf9\u8c61\u8fdb\u884c\u53ef\u8fbe\u6027\u5206\u6790\uff0c\u627e\u51fa\u5b58\u6d3b\u5bf9\u8c61\uff09 \u6700\u7ec8\u6807\u8bb0\uff08\u6807\u8bb0\u90a3\u4e9b\u5728\u5e76\u53d1\u6807\u8bb0\u9636\u6bb5\u53d1\u751f\u53d8\u5316\u7684\u5bf9\u8c61\uff0c\u5c06\u88ab\u56de\u6536\uff09Stop-The-World \u7b5b\u9009\u56de\u6536\uff08\u9996\u5148\u5bf9\u5404\u4e2aRegin\u7684\u56de\u6536\u4ef7\u503c\u548c\u6210\u672c\u8fdb\u884c\u6392\u5e8f\uff0c\u6839\u636e\u7528\u6237\u6240\u671f\u5f85\u7684GC\u505c\u987f\u65f6\u95f4\u6307\u5b9a\u56de\u6536\u8ba1\u5212\uff0c\u56de\u6536\u4e00\u90e8\u5206Region\uff09Stop-The-World","title":"Java\u5185\u5b58"},{"location":"cs/pl/java/basic/#map","text":"HashMap\u7684\u7ed3\u6784 \u91c7\u7528\u94fe\u5730\u5740\u6cd5\uff0c\u5f53\u53d1\u751f\u54c8\u5e0c\u51b2\u7a81\u65f6\u4f7f\u7528\u94fe\u8868\u89e3\u51b3 \u5f53\u94fe\u8868\u8fc7\u957f\u65f6\uff0c\u5728JDK1.8\u4e0b\u91c7\u7528\u7ea2\u9ed1\u6811\u4ee3\u66ff\u94fe\u8868\uff0c\u5f53\u6570\u636e\u91cf\u8f83\u5c11\u65f6\uff0c\u8f6c\u56de\u94fe\u8868 \u5f53\u5b58\u50a8\u7684\u6570\u636e\u91cf\u8d85\u8fc7\u4e00\u4e2a\u9608\u503c\u540e\uff0cHashMap\u7684\u54c8\u5e0c\u8868\u957f\u5ea6\u5c06\u4f1a\u6269\u5bb9\u5230\u539f\u6765\u7684\u4e24\u500d\uff0c\u7136\u540e\u5c06\u6240\u6709\u7684\u6570\u636e\u91cd\u65b0\u5206\u914d\u5230\u65b0\u7684\u5185\u5b58\u4e2d HashMap\u8fd9\u6837\u6269\u5bb9\u7684\u539f\u56e0 \u901a\u8fc7\u6070\u597d\u4e24\u500d\u6269\u5bb9\uff0c\u53ef\u4ee5\u8ba9\u539f\u6765\u5728\u7b2ci\u4e2a\u94fe\u8868\u7684\u503c\u88ab\u6070\u597d\u5206\u914d\u5230\u7b2ci\u548c\u7b2c2i\u4e2a\u94fe\u8868\u7684\u4f4d\u7f6e \u6bcf\u4e00\u4e2a\u503c\uff0c\u53ea\u9700\u8981\u5224\u65ad\u5176\u54c8\u5e0c\u503c\u5728\u67d0\u4e2a\u4e8c\u8fdb\u5236\u4f4d\u4e0a\u7684\u503c\u5373\u53ef\u76f4\u63a5\u5b8c\u6210\u5206\u914d TreeMap\u7684\u7ed3\u6784 TreeMap\u662f\u4e00\u9897\u7ea2\u9ed1\u6811","title":"Map"},{"location":"cs/pl/java/basic/#_2","text":"\u8bbe\u8ba1\u539f\u5219 \u5f00\u95ed\u539f\u5219\uff1a\u5bf9\u6269\u5c55\u5f00\u653e\uff0c\u5bf9\u4fee\u6539\u5173\u95ed \u91cc\u6c0f\u66ff\u6362\u539f\u5219\uff1a\u5b50\u7c7b\u5fc5\u987b\u62e5\u6709\u6240\u6709\u7684\u7236\u7c7b\u529f\u80fd\uff0c\u5b50\u7c7b\u53ef\u4ee5\u5f00\u53d1\u81ea\u5df1\u7684\u65b0\u529f\u80fd \u4f9d\u8d56\u5012\u7f6e\u539f\u5219\uff1a\u9ad8\u5c42\u5b9e\u73b0\u4e0d\u80fd\u4f9d\u8d56\u4f4e\u5c42\u5b9e\u73b0\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u4f4e\u5c42\u7684\u62bd\u8c61\u7c7b \u5355\u4e00\u804c\u8d23\u539f\u5219\uff1a\u4e00\u4e2a\u7c7b\u5e94\u5f53\u53ea\u8d1f\u8d23\u4e00\u4e2a\u804c\u8d23 \u63a5\u53e3\u9694\u79bb\u539f\u5219\uff1a\u63a5\u53e3\u5e94\u8be5\u66f4\u5c0f\u66f4\u5177\u4f53\uff0c\u800c\u4e0d\u662f\u53bb\u5b9e\u73b0\u5f88\u5e9e\u5927\u7684\u501f\u53e3\u6765\u9002\u5e94\u6240\u6709\u9700\u6c42 \u8fea\u7c73\u7279\u6cd5\u5219\uff1a\u907f\u514d\u4e0e\u65e0\u5173\u5b9e\u4f53\u8fdb\u884c\u901a\u4fe1 \u5408\u6210\u590d\u7528\u539f\u5219\uff1a\u5c3d\u91cf\u5148\u4f7f\u7528\u7ec4\u5408\u6216\u8005\u805a\u5408\u7b49\u5173\u8054\uff0c\u5176\u6b21\u8003\u8651\u7ee7\u627f \u8bbe\u8ba1\u6a21\u5f0f \u521b\u5efa\u578b\u6a21\u5f0f \u5355\u4f8b\u6a21\u5f0f\uff1a\u9650\u5236\u4e00\u4e2a\u7c7b\u53ea\u80fd\u6709\u4e00\u4e2a\u5b9e\u4f8b \u539f\u578b\u6a21\u5f0f\uff1a\u4ee5\u4e00\u4e2a\u6b64\u7c7b\u578b\u7684\u5b9e\u4f8b\u4e3a\u6a21\u7248\uff0c\u901a\u8fc7\u62f7\u8d1d\u5185\u5b58\u4e2d\u7684\u4e8c\u8fdb\u5236\u503c\u6765\u76f4\u63a5\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61 \u5de5\u5382\u6a21\u5f0f\uff1a\u5c06\u521b\u5efa\u5bf9\u8c61\u7684\u8fc7\u7a0b\u7531\u53e6\u4e00\u4e2a\u7c7b\u8fdb\u884c\u5c01\u88c5 \u5efa\u9020\u8005\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u590d\u6742\u7684\u5bf9\u8c61\u5206\u4e3a\u591a\u4e2a\u7b80\u5355\u7684\u5bf9\u8c61\u7684\u7ec4\u5408\uff0c\u5e76\u5b9e\u73b0\u5c06\u591a\u4e2a\u5c0f\u5bf9\u8c61\u8fdb\u884c\u62fc\u88c5\u7684\u8fc7\u7a0b \u7ed3\u6784\u578b\u6a21\u5f0f \u4ee3\u7406\u6a21\u5f0f\uff1a\u4f7f\u5f97\u4e24\u4e2a\u5bf9\u8c61\u4e4b\u95f4\u4e0d\u80fd\u76f4\u63a5\u5f15\u7528\u8bbf\u95ee\uff0c\u53ea\u80fd\u901a\u8fc7\u7b2c\u4e09\u65b9\uff0c\u53ef\u4ee5\u4fdd\u62a4\u76ee\u6807\u5bf9\u8c61\uff0c\u6269\u5c55\u76ee\u6807\u5bf9\u8c61\u7684\u529f\u80fd \u9002\u914d\u5668\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u7c7b\u7684\u63a5\u53e3\u8f6c\u6362\u4e3a\u53e6\u4e00\u4e2a\u7c7b\u7684\u501f\u53e3\uff0c\u901a\u5e38\u662f\u4e3a\u4e86\u9002\u914d\u4e24\u4e2a\u63a5\u53e3\u7684\u5bf9\u63a5\u95ee\u9898 \u6865\u63a5\u6a21\u5f0f\uff1a\u5c06\u62bd\u8c61\u4e0e\u5b9e\u73b0\u5206\u79bb\uff0c\u4f7f\u5f97\u4ed6\u4eec\u53ef\u4ee5\u72ec\u7acb\u53d8\u5316\uff0c\u7528\u7ec4\u5408\u5173\u7cfb\u6765\u4ee3\u66ff\u7ee7\u627f\u5173\u7cfb \u88c5\u9970\u5668\u6a21\u5f0f\uff1a\u4e3a\u7c7b\u589e\u52a0\u65b0\u7684\u529f\u80fd\u7684\u540c\u65f6\uff0c\u907f\u514d\u4e86\u7ee7\u627f \u5916\u89c2\u6a21\u5f0f\uff1a\u9690\u85cf\u7cfb\u7edf\u7684\u590d\u6742\u6027 \u4eab\u5143\u6a21\u5f0f\uff1a\u91cd\u590d \u4f7f\u7528\u5df2\u7ecf\u521b\u5efa\u7684\u540c\u7c7b\u5bf9\u8c61 \u7ec4\u5408\u6a21\u5f0f \u884c\u4e3a\u578b\u6a21\u5f0f \u6a21\u677f\u65b9\u6cd5\u6a21\u5f0f\uff1a\u4ec5\u5b9e\u73b0\u4e00\u4e2a\u64cd\u4f5c\u4e2d\u7684\u9aa8\u5e72\u6b65\u9aa4\uff0c\u5177\u4f53\u6b65\u9aa4\u7531\u5176\u5b50\u7c7b\u5b9e\u73b0 \u7b56\u7565\u6a21\u5f0f \u547d\u4ee4\u6a21\u5f0f \u8d23\u4efb\u94fe\u6a21\u5f0f \u72b6\u6001\u6a21\u5f0f \u89c2\u5bdf\u8005\u6a21\u5f0f \u4e2d\u4ecb\u8005\u6a21\u5f0f \u8fed\u4ee3\u5668\u6a21\u5f0f \u8bbf\u95ee\u8005\u6a21\u5f0f \u5907\u5fd8\u5f55\u6a21\u5f0f \u89e3\u91ca\u5668\u6a21\u5f0f","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/pl/java/basic/#string","text":"String\u7c7b\u578b String\u7c7b\u578b\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u5bf9String\u7c7b\u578b\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u91cd\u65b0\u751f\u6210\u65b0\u7684String\u5bf9\u8c61 StringBuilder\u548cStringBuffer StringBuilder\u548cStringBuffer\u90fd\u662f\u53ef\u53d8\u7684 StringBuilder\u6ca1\u6709\u7ebf\u7a0b\u540c\u6b65\uff0c\u5b58\u5728\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\uff0c\u4f46\u662f\u5176\u6548\u7387\u7565\u9ad8\u4e8eStringBuffer StringBuffer\u80fd\u591f\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\uff0c\u4f46\u6548\u7387\u8f83\u4f4e","title":"String"},{"location":"cs/pl/java/basic/#_3","text":"\u63a5\u53e3\u548c\u62bd\u8c61\u7c7b\u7684\u533a\u522b \u62bd\u8c61\u7c7b\u53ef\u4ee5\u5199\u975e\u62bd\u8c61\u65b9\u6cd5\uff0c\u800c\u63a5\u53e3\u7c7b\u53ea\u80fd\u6709\u62bd\u8c61\u65b9\u6cd5 \u4e00\u4e2a\u7c7b\u53ea\u80fd\u7ee7\u627f\u81ea\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u800c\u4e00\u4e2a\u7c7b\u80fd\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u7ee7\u627f\u662f\u4e00\u4e2a\u201c\u662f\u4e0d\u662f\u201d\u7684\u5173\u7cfb\uff0c\u800c\u63a5\u53e3\u5b9e\u73b0\u5219\u662f\u201c\u6709\u6ca1\u6709\u201d\u7684\u5173\u7cfb","title":"\u63a5\u53e3\u548c\u62bd\u8c61\u7c7b"},{"location":"cs/pl/java/basic/#_4","text":"\u5b50\u7c7b\u5b9e\u4f8b\u5316\u603b\u662f\u9ed8\u8ba4\u8c03\u7528\u7236\u7c7b\u7684\u65e0\u53c2\u6784\u9020\u65b9\u6cd5 \u4e3a\u4e86\u8ba9\u7236\u7c7b\u521d\u59cb\u5316\u5c5e\u6027\u548c\u65b9\u6cd5","title":"\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/java/basic/#equals","text":"equals \u548c == \u7684\u533a\u522b == \u5bf9\u4e8e\u57fa\u672c\u7c7b\u578b\u65f6\uff0c\u6bd4\u8f83\u7684\u662f\u4e24\u4e2a\u5bf9\u8c61\u7684\u503c\u662f\u5426\u76f8\u540c\uff0c\u800c\u5bf9\u4e8e\u5bf9\u8c61\u65f6\uff0c\u5219\u6bd4\u8f83\u7684\u662f\u8fd9\u4e24\u4e2a\u5f15\u7528\u662f\u5426\u6307\u5411\u4e86\u540c\u4e00\u4e2a\u5bf9\u8c61 equals \u5219\u53ef\u4ee5\u7531\u6b64\u7c7b\u8fdb\u884c\u91cd\u5199\uff0c\u4f7f\u5f97\u5176\u6ee1\u8db3\u6b63\u5e38\u7684\u6bd4\u8f83\u5173\u7cfb\u3002\u82e5\u4e0d\u8fdb\u884c\u91cd\u5199\uff0c\u5219\u4e0e == \u7b49\u4ef7 equals \u548c hashCode \u4e3a\u4ec0\u4e48\u9700\u8981\u540c\u65f6\u8fdb\u884c\u91cd\u5199 hashCode \u5728 Object \u7c7b\u4e0b\u7684\u9ed8\u8ba4\u884c\u4e3a\u662f\u5c06\u6b64\u503c\u7684\u5730\u5740\u53d6\u51fa\u4f5c\u4e3a hashCode \uff0c\u4f46\u8fd9\u4e0e hashCode \u672c\u610f\u4e0d\u540c\uff0c hashCode \u7684\u503c\u5e94\u5f53\u6ee1\u8db3\u5bf9\u4e8e\u4efb\u610fx\u82e5 x.equals(y) = true \uff0c\u5219 x.hashCode() = y.hashCode() \uff0c\u6240\u4ee5\u5f53\u91cd\u5199 equals \u65f6\uff0c\u901a\u5e38\u610f\u5473\u7740\u8fd9\u4e2a\u503c\u7684\u76f8\u7b49\u6982\u5ff5\u4e0e == \u4e0d\u540c\u3002\u6240\u4ee5\u5fc5\u7136\u9700\u8981\u91cd\u5199 hashCode \u907f\u514d\u5728 hashMap \u4e2d\u51fa\u73b0\u610f\u6599\u4e4b\u5916\u7684\u60c5\u51b5","title":"equals"},{"location":"cs/pl/java/basic/#copyonwrite","text":"\u5199\u5165\u65f6\u590d\u5236\uff08CopyOnWrite\uff0c\u7b80\u79f0COW\uff09\u601d\u60f3\u662f\u8ba1\u7b97\u673a\u7a0b\u5e8f\u8bbe\u8ba1\u9886\u57df\u4e2d\u7684\u4e00\u79cd\u901a\u7528\u4f18\u5316\u7b56\u7565\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\uff0c\u5982\u679c\u6709\u591a\u4e2a\u8c03\u7528\u8005\uff08Callers\uff09\u540c\u65f6\u8bbf\u95ee\u76f8\u540c\u7684\u8d44\u6e90\uff08\u5982\u5185\u5b58\u6216\u8005\u662f\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u5b58\u50a8\uff09\uff0c\u4ed6\u4eec\u4f1a\u5171\u540c\u83b7\u53d6\u76f8\u540c\u7684\u6307\u9488\u6307\u5411\u76f8\u540c\u7684\u8d44\u6e90\uff0c\u76f4\u5230\u67d0\u4e2a\u8c03\u7528\u8005\u4fee\u6539\u8d44\u6e90\u5185\u5bb9\u65f6\uff0c\u7cfb\u7edf\u624d\u4f1a\u771f\u6b63\u590d\u5236\u4e00\u4efd\u4e13\u7528\u526f\u672c\uff08private copy\uff09\u7ed9\u8be5\u8c03\u7528\u8005\uff0c\u800c\u5176\u4ed6\u8c03\u7528\u8005\u6240\u89c1\u5230\u7684\u6700\u521d\u7684\u8d44\u6e90\u4ecd\u7136\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u8fc7\u7a0b\u5bf9\u5176\u4ed6\u7684\u8c03\u7528\u8005\u90fd\u662f\u900f\u660e\u7684\uff08transparently\uff09\u3002\u6b64\u505a\u6cd5\u4e3b\u8981\u7684\u4f18\u70b9\u662f\u5982\u679c\u8c03\u7528\u8005\u6ca1\u6709\u4fee\u6539\u8d44\u6e90\uff0c\u5c31\u4e0d\u4f1a\u6709\u526f\u672c\uff08private copy\uff09\u88ab\u521b\u5efa\uff0c\u56e0\u6b64\u591a\u4e2a\u8c03\u7528\u8005\u53ea\u662f\u8bfb\u53d6\u64cd\u4f5c\u65f6\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4efd\u8d44\u6e90\u3002 \u901a\u4fd7\u6613\u61c2\u7684\u8bb2\uff0c\u5199\u5165\u65f6\u590d\u5236\u6280\u672f\u5c31\u662f\u4e0d\u540c\u8fdb\u7a0b\u5728\u8bbf\u95ee\u540c\u4e00\u8d44\u6e90\u7684\u65f6\u5019\uff0c\u53ea\u6709\u66f4\u65b0\u64cd\u4f5c\uff0c\u624d\u4f1a\u53bb\u590d\u5236\u4e00\u4efd\u65b0\u7684\u6570\u636e\u5e76\u66f4\u65b0\u66ff\u6362\uff0c\u5426\u5219\u90fd\u662f\u8bbf\u95ee\u540c\u4e00\u4e2a\u8d44\u6e90\u3002 JDK \u7684 CopyOnWriteArrayList/CopyOnWriteArraySet \u5bb9\u5668\u6b63\u662f\u91c7\u7528\u4e86 COW \u601d\u60f3\uff0c\u5b83\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u5462\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5e73\u65f6\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u90fd\u4e0d\u9700\u8981\u52a0\u9501\uff0c\u968f\u4fbf\u8bbf\u95ee\uff0c\u53ea\u6709\u5728\u66f4\u65b0\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u4ece\u539f\u6765\u7684\u6570\u636e\u590d\u5236\u4e00\u4e2a\u526f\u672c\u51fa\u6765\uff0c\u7136\u540e\u4fee\u6539\u8fd9\u4e2a\u526f\u672c\uff0c\u6700\u540e\u628a\u539f\u6570\u636e\u66ff\u6362\u6210\u5f53\u524d\u7684\u526f\u672c\u3002\u4fee\u6539\u64cd\u4f5c\u7684\u540c\u65f6\uff0c\u8bfb\u64cd\u4f5c\u4e0d\u4f1a\u88ab\u963b\u585e\uff0c\u800c\u662f\u7ee7\u7eed\u8bfb\u53d6\u65e7\u7684\u6570\u636e\u3002\u8fd9\u70b9\u8981\u8ddf\u8bfb\u5199\u9501\u533a\u5206\u4e00\u4e0b\u3002","title":"CopyOnWrite"},{"location":"cs/pl/java/springboot/","text":"SpringBoot \u00b6 \u7ea6 1231 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u5f53\u521d\u4e3a\u4e86\u505a\u6570\u636e\u5e93\u8bfe\u8bbe\uff0c\u8ba9\u724c\u738b\u82b1\u4e86 1.5h \u6559\u6211 springboot \u5165\u95e8\uff0c\u4e4b\u524d\u5199\u5728 csdn \u4e0a\uff0c\u73b0\u5728\u79fb\u5230 note \u91cc \u9996\u5148\u521b\u5efa\u4e00\u4e2aspringboot\u9879\u76ee\u3002 model\u5c42 \u00b6 model\u5c42\u4e5f\u53ebpojo\u5c42\u6216\u8005entity\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22pojo\u5c42\u3002 \u4e00\u822c\u6570\u636e\u5e93\u7684\u4e00\u5f20\u8868\u5bf9\u5e94\u4e00\u4e2apojo\u5c42\uff0c\u5e76\u4e14\u8868\u4e2d\u6240\u6709\u5b57\u6bb5\u90fd\u5728pojo\u5c42\u90fd\u4e00\u4e00\u5bf9\u5e94\u3002 eg\uff1a\u4e00\u5f20Goods\u8868 \u7136\u540e\u8981\u5148\u5efa\u4e00\u4e2apojo\u7684package\uff0c\u4ee3\u8868\u5b83\u662f\u5b9e\u4f53\u5c42\u3002 \u518d\u5728\u8be5package\u4e0b\u521b\u5efa\u4e00\u4e2aGoods\u7684java\u6587\u4ef6\uff0c\u521b\u5efa\u7684\u5bf9\u8c61\u90fd\u662f\u548c\u8868\u91cc\u5b57\u6bb5\u4e00\u4e00\u5bf9\u5e94\uff0c\u5982\u4e0b\u6240\u793a\uff1a package pojo ; import lombok.* ; @Data public class Goods { /* \u5546\u54c1\u7f16\u53f7 */ private String GNo ; /* \u5546\u54c1\u540d\u79f0 */ private String GName ; /* \u5546\u54c1\u4ef7\u683c */ private Double GPrice ; } \u8fd9\u91cc\u7684lombok\u7684\u4f5c\u7528\u65f6\u4e3a\u4e86\u7b80\u5316\u4ee3\u7801\uff0c\u56e0\u4e3a\u5bf9\u4e8eprivate\u8fd9\u6837\u7684\u5bf9\u8c61\uff0c\u60f3\u8981\u8c03\u7528\u5b83\u7684\u65f6\u5019\uff0c\u9700\u8981get\u548cset\u4e24\u4e2a\u65b9\u6cd5\uff0c\u800c\u6709\u4e86lombok\u4e4b\u540e\u5c31\u53ef\u4ee5\u4e0d\u7528\u5199\uff0c\u76f4\u63a5\u7528\u5373\u53ef\u3002 \u4e0d\u8fc7\u8981\u6dfb\u52a0\u4f9d\u8d56\u548c\u6ce8\u89e3@Data\uff0clombok\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7528\u6cd5\uff0c\u4e4b\u540e\u53ef\u80fd\u4f1a\u51fa\u4e00\u7bc7\u535a\u5ba2\u3002 \u901a\u8fc7maven\u4e0b\u8f7d\u4f9d\u8d56\uff1a < dependency > < groupId > org . projectlombok < artifactId > lombok < optional > true \u8fd9\u6837\u6570\u636e\u5e93\u91cc\u7684\u5b57\u6bb5\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u5bf9\u8c61\u6765\u8868\u793a\u3002 \u4f46\u662fmodel\u4e0d\u5c5e\u4e8espringboot\u7684\u4e09\u5c42\u6846\u67b6\u3002 \u4e3b\u8981\u8bf4\u660e\u662fdao\u5c42\u3001service\u5c42\u548ccontroller\u5c42\u3002 \u8fd9\u4e9b\u5df2\u7ecf\u662f\u5c5e\u4e8e\u540e\u7aef\u4e86\u3002 \u5bf9\u4e8e\u4e00\u4e2a\u9879\u76ee\uff0c\u5b89\u5168\u6027\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\uff0c\u6240\u4ee5springboot\u5f88\u597d\u5730\u4f53\u73b0\u4e86\u8fd9\u4e00\u70b9\u3002 \u6bd4\u5982\uff1a \u60f3\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u5e76\u4e14\u64cd\u4f5c\uff0c\u53ea\u80fd\u901a\u8fc7dao\u5c42\u5411\u6570\u636e\u5e93\u53d1\u9001sql\u8bed\u53e5\uff0c\u5c06\u8fd9\u4e9b\u7ed3\u679c\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9service\u5c42\u3002 \u60f3\u8981\u5904\u7406\u6570\u636e\uff0c\u8981\u5148\u5411dao\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u5bf9dao\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u52a0\u5de5\u5904\u7406\uff0c\u5c06\u8fd9\u4e9b\u5904\u7406\u597d\u7684\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9controller\u5c42\u3002 \u5ba2\u6237\u60f3\u8981\u67e5\u8be2\u6216\u4fee\u6539\u6570\u636e\u65f6\uff0c\u8981\u5148\u5411service\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u6536\u96c6service\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\uff0c\u5c06\u8fd9\u4e9b\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u663e\u793a\u7ed9\u5ba2\u6237\uff0c\u4e00\u822c\u901a\u8fc7html\u7b49\u65b9\u6cd5\u7ed9\u5ba2\u6237\u3002 \u4e0b\u9762\u4f1a\u4e00\u4e00\u8bf4\u660e\u3002 dao\u5c42 \u00b6 dao\u5c42\u4e5f\u53ebmapper\u5c42\uff0c\u6570\u636e\u6301\u4e45\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22mapper\u5c42\u3002 \u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u6301\u4e45\u5316\u64cd\u4f5c\uff0c\u4ed6\u7684\u65b9\u6cd5\u662f\u9488\u5bf9\u6570\u636e\u5e93\u64cd\u4f5c\u7684\uff0c\u57fa\u672c\u7528\u5230\u7684\u5c31\u662f\u589e\u5220\u6539\u67e5\u3002\u5b83\u53ea\u662f\u4e2a\u63a5\u53e3\uff0c\u53ea\u6709\u65b9\u6cd5\u540d\u5b57\uff0c\u5177\u4f53\u5b9e\u73b0\u5728mapper.xml\u4e2d\u3002 \u65e2\u7136mapper\u5c42\u662f\u76f4\u63a5\u4e0e\u6570\u636e\u5e93\u76f8\u6302\u94a9\u7684\uff0c\u6240\u4ee5\u8981\u5148\u8fde\u63a5\u6570\u636e\u5e93\u3002 \u53ef\u4ee5\u5728sqlMapConfig.xml\u6587\u4ef6\u6216\u8005application.properties\u6587\u4ef6\u91cc\u6dfb\u52a0\u6570\u636e\u5e93\u5c5e\u6027\u7b49\uff0c\u5982\u4e0b\u6240\u793a\uff1a sqlMapConfig.xml\u6dfb\u52a0\u5c5e\u6027\uff1a < properties resource = \"/config/db.properties\" > < environments default = \"development\" > < environment id = \"development\" > < transactionManager type = \"JDBC\" /> < dataSource type = \"POOLED\" > < property name = \"driver\" value = \"${jdbc.driver}\" /> < property name = \"url\" value = \"${jdbc.url}\" /> < property name = \"username\" value = \"${jdbc.username}\" /> < property name = \"password\" value = \"${jdbc.password}\" /> \u5728 SqlMapConfig.xml\u5c31\u4e0d\u9700\u8981\u5bf9\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u786c\u7f16\u7801\u3002 application.properties\u6dfb\u52a0\u5c5e\u6027\uff1a \u65b9\u4fbf\u5bf9\u53c2\u6570\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u5176\u4ed6 xml \u53ef\u4ee5\u5e94\u7528\u8be5\u914d\u7f6e\u6587\u4ef6\u3002 \u7136\u540e\u68c0\u67e5\u662f\u5426\u8fde\u4e0a\u6570\u636e\u5e93\uff0c\u8bf7\u770b\u4e0b\u56fe\uff1a \u7136\u540e\u81ea\u5df1\u914d\u7f6e\u6570\u636e\u5e93\u3002 \u6570\u636e\u5e93\u8fde\u63a5\u4e0a\u4e86\uff0c\u5230\u4e86\u4e24\u4e2a\u6587\u4ef6\u7684\u7f16\u5199\uff0c\u6211\u91c7\u7528mybatis\u6846\u67b6\u3002 \u5982\u4f55\u7f16\u5199mapper.xml\uff0c\u5bf9\u6570\u636e\u5e93\u589e\u5220\u6539\u67e5\uff1f \u5728\u5b66\u4e60MyBatis\u6846\u67b6\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53d1\u73b0\u5728idea\u91cc\u9762\u6ca1\u6cd5\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\uff0c\u521b\u5efa\u51fa\u7684xml\u6587\u4ef6\u6ca1\u6709Mapper.xml\u6587\u4ef6\u7684\u57fa\u672c\u683c\u5f0f\uff0c\u4e0b\u9762\u8bf4\u660e\u5982\u4f55\u5728idea\u4e2d\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\u6a21\u677f\u3002 File \u2192 Settings\u2026 \u2192 Editor \u2192 File and Code Templates \u70b9\u51fb\"+\"\u53f7\uff0c\u5e76\u8f93\u5165\u6587\u4ef6\u7684\u540d\u79f0\u548c\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u7f16\u8f91\u597d\u6a21\u677f\u540e\u70b9\u51fbApply\u5373\u53ef\u521b\u5efa\u6210\u529f} mapper.xml\u6587\u4ef6\u6a21\u7248 < mapper namespace = \"\" > \u521b\u5efaGoodsMapper.xml\u6587\u4ef6\u3002 \u7f16\u5199\u5185\u5bb9\uff1a < mapper namespace = \"mapper.GoodsMapper\" > < insert id = \"insertGoods\" parameterType = \"mapper.GoodsMapper\" > insert into Goods ( GNo , GName , GPrice ) values ( # { GNo }, # { GName }, # { GPrice }) < delete id = \"deleteGoods\" parameterType = \"java.String\" > delete from Goods where id = # { id } < update id = \"uodateGoods\" parameterType = \"mapper.GoodsMapper\" > update Goods set GNo = # { GNo }, GName = # { GName }, GPrice = # { GPrice } where id = # { id } < select id = \"findGoods\" parameterType = \"java.String\" resultType = \"mapper.GoodsMapper\" > select * from Goods where id = # { id } \u521b\u5efaGoodsMapper\u7684\u63a5\u53e3\u3002 package mapper ; import pojo.Goods ; public interface GoodsMapper { /** *\u589e\u52a0\u5546\u54c1 * @param goods * @throw Exception */ void insertGoods ( Goods goods ) throws Exception ; /** * \u5220\u9664\u5546\u54c1 * @param GNo * @throw Exception */ void deleteGoods ( String GNo ) throws Exception ; /** * \u4fee\u6539\u5546\u54c1 * @param goods * @throw Exception */ void updateGoods ( Goods goods ) throws Exception ; /** * \u6839\u636eGNo\u67e5\u627e * @return * @throw Exception */ Goods findByGNo ( String GNo ) throws Exception ; } \u4e0d\u9700\u8981\u7f16\u5199\u63a5\u53e3\u5bf9\u5b9e\u73b0\u7c7b\u4e86\uff0c\u53ea\u8981\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u6620\u5c04\u5173\u7cfb\u5bf9\u5e94\u597d\u5c31ok\uff0c\u8fd9\u4e0d\u5728\u672c\u6587\u7684\u8bb2\u8ff0\u8303\u56f4\u5185\u3002 service\u5c42 \u00b6 service\u5c42\u53eb\u4e1a\u52a1\u903b\u8f91\u5c42\uff0c\u5b58\u653e\u4e1a\u52a1\u903b\u8f91\u5904\u7406\uff0c\u4e0d\u76f4\u63a5\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u64cd\u4f5c\uff0c\u6709\u63a5\u53e3\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff0c\u63d0\u4f9bcontroller\u5c42\u8c03\u7528\u7684\u65b9\u6cd5\u3002 \u521b\u5efa\u4e24\u4e2a\u6587\u4ef6\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u7c7b\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsService\u63a5\u53e3\u7c7b\uff1a package service.Goods ; import pojo.Goods ; public interface GoodsService { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsServiceImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package service.Goods ; import mapper.GoodsMapper ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Service ; import pojo.Goods ; @Service public class GoodsServiceImpl implements GoodsService { @Autowired private GoodsMapper goodsMapper ; @Override public void insertGoods ( Goods goods ) throws Exception { goodsMapper . insertGoods ( goods ); } @Override public void deleteGoods ( String GNo ) throws Exception { goodsMapper . deleteGoods ( GNo ); } @Override public void updateGood ( Goods goods ) throws Exception { goodsMapper . updateGoods ( goods ); } @Override public void findByGNo ( String GNo ) throws Exception { goodsMapper . findByGNo ( GNo ); } } \u5c31\u8fd9\u6837\uff0cservice\u5c42\u4e0emapper\u5c42\u5efa\u7acb\u8d77\u4e86\u8054\u7cfb\uff0cservice\u5c42\u53ef\u4ee5\u8c03\u7528mapper\u5c42\u7684\u65b9\u6cd5\u3002 controller\u5c42 \u00b6 controller\u5c42\u53eb\u63a7\u5236\u5668\u5c42\uff0c\u8d1f\u8d23\u524d\u540e\u7aef\u4ea4\u4e92\uff0c\u63a5\u53d7\u524d\u7aef\u8bf7\u6c42\uff0c\u8c03\u7528service\u5c42\uff0c\u63a5\u6536service\u5c42\u8fd4\u56de\u7684\u6570\u636e\uff0c\u6700\u540e\u8fd4\u56de\u5177\u4f53\u7684\u9875\u9762\u548c\u6570\u636e\u5230\u5ba2\u6237\u7aef\u3002 \u540c\u6837\uff0c\u4e5f\u9700\u8981\u4e24\u4e2a\u6587\u4ef6\uff0c\u63a5\u53e3\u7c7b\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsControllerI\u63a5\u53e3\u7c7b\uff1a package Controller.Goods ; import pojo.Goods ; public interface GoodsController { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsControllerImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package Controller.Goods ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Controller ; import org.springframework.web.bind.annotation.RequestMapping ; import pojo.Goods ; import service.Goods.GoodsService ; @Controller public class GoodsControllerImpl { @Autowired private GoodsService goodsService ; @RequestMapping ( value = \"/index\" ) public String insertGoods ( Goods goods ) throws Exception { goodsService . insertGoods ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String deleteGoods ( String GNo ) throws Exception { goodsService . deleteGoods ( GNo ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String updateGoods ( Goods goods ) throws Exception { goodsService . updateGood ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String findByGNo ( String GNo ) throws Exception { Goods goods = new Goods (); goods = goodsService . findByGNo ( GNo ); return \"/index\" ; } } \u8fd9\u6837\uff0c\u5ba2\u6237\u53ef\u4ee5\u901a\u8fc7\u8bf7\u6c42\u7684\u65b9\u5f0f\uff0c\u5c06\u6570\u636e\u4ece\u524d\u7aef\u4f20\u7ed9Controller\u5c42\uff0c\u7136\u540e\u4e00\u5c42\u4e00\u5c42\u4f20\u4e0b\u53bb\uff0c\u5728\u4e00\u5c42\u4e00\u5c42\u5730\u4f20\u4e0a\u6765\uff0c\u5b9e\u73b0\u4e86\u540e\u7aef\u5f00\u53d1\u3002 \u662f\u4e0d\u662f\u53d1\u73b0\u548c\u524d\u7aef\u6ca1\u4ec0\u4e48\u5173\u7cfb\uff1f \u662f\u7684\uff0cspringboot\u8fd8\u6709\u4e00\u4e2a\u4f18\u70b9\u5c31\u662f\u5b9e\u73b0\u4e86\u524d\u540e\u7aef\u5206\u79bb\uff0c\u4ece\u800c\u5de5\u4f5c\u4eba\u5458\u5206\u914d\u4efb\u52a1\u7684\u65f6\u5019\u66f4\u52a0\u5177\u6709\u6761\u7406\u6027\u3002\u800c\u4e09\u5c42\u7684\u67b6\u6784\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5458\u5f88\u5feb\u5730\u77e5\u9053bug\u51fa\u73b0\u5728\u54ea\u91cc\uff0c\u54ea\u4e00\u5c42\uff0c\u54ea\u4e00\u6587\u4ef6\uff0c\u5f88\u5feb\u7684\u4fee\u6539bug\u3002 \u545c\u547c\uff0c\u603b\u800c\u8a00\u4e4b\uff0cspringboot\u4f5c\u4e3aweb\u5f00\u53d1\u7684\u4e00\u4e2a\u4e3b\u6d41\u6846\u67b6\uff0c\u6b63\u5f0f\u56e0\u4e3a\u8fd9\u4e9b\u4f18\u79c0\u70b9\u8ba9\u5b83\u8131\u9896\u800c\u51fa\u3002 \u8fd9\u4e00\u7bc7\u5199\u5f97\u597d\u7d2f\u3002","title":"SpringBoot"},{"location":"cs/pl/java/springboot/#springboot","text":"\u7ea6 1231 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u5f53\u521d\u4e3a\u4e86\u505a\u6570\u636e\u5e93\u8bfe\u8bbe\uff0c\u8ba9\u724c\u738b\u82b1\u4e86 1.5h \u6559\u6211 springboot \u5165\u95e8\uff0c\u4e4b\u524d\u5199\u5728 csdn \u4e0a\uff0c\u73b0\u5728\u79fb\u5230 note \u91cc \u9996\u5148\u521b\u5efa\u4e00\u4e2aspringboot\u9879\u76ee\u3002","title":"SpringBoot"},{"location":"cs/pl/java/springboot/#model","text":"model\u5c42\u4e5f\u53ebpojo\u5c42\u6216\u8005entity\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22pojo\u5c42\u3002 \u4e00\u822c\u6570\u636e\u5e93\u7684\u4e00\u5f20\u8868\u5bf9\u5e94\u4e00\u4e2apojo\u5c42\uff0c\u5e76\u4e14\u8868\u4e2d\u6240\u6709\u5b57\u6bb5\u90fd\u5728pojo\u5c42\u90fd\u4e00\u4e00\u5bf9\u5e94\u3002 eg\uff1a\u4e00\u5f20Goods\u8868 \u7136\u540e\u8981\u5148\u5efa\u4e00\u4e2apojo\u7684package\uff0c\u4ee3\u8868\u5b83\u662f\u5b9e\u4f53\u5c42\u3002 \u518d\u5728\u8be5package\u4e0b\u521b\u5efa\u4e00\u4e2aGoods\u7684java\u6587\u4ef6\uff0c\u521b\u5efa\u7684\u5bf9\u8c61\u90fd\u662f\u548c\u8868\u91cc\u5b57\u6bb5\u4e00\u4e00\u5bf9\u5e94\uff0c\u5982\u4e0b\u6240\u793a\uff1a package pojo ; import lombok.* ; @Data public class Goods { /* \u5546\u54c1\u7f16\u53f7 */ private String GNo ; /* \u5546\u54c1\u540d\u79f0 */ private String GName ; /* \u5546\u54c1\u4ef7\u683c */ private Double GPrice ; } \u8fd9\u91cc\u7684lombok\u7684\u4f5c\u7528\u65f6\u4e3a\u4e86\u7b80\u5316\u4ee3\u7801\uff0c\u56e0\u4e3a\u5bf9\u4e8eprivate\u8fd9\u6837\u7684\u5bf9\u8c61\uff0c\u60f3\u8981\u8c03\u7528\u5b83\u7684\u65f6\u5019\uff0c\u9700\u8981get\u548cset\u4e24\u4e2a\u65b9\u6cd5\uff0c\u800c\u6709\u4e86lombok\u4e4b\u540e\u5c31\u53ef\u4ee5\u4e0d\u7528\u5199\uff0c\u76f4\u63a5\u7528\u5373\u53ef\u3002 \u4e0d\u8fc7\u8981\u6dfb\u52a0\u4f9d\u8d56\u548c\u6ce8\u89e3@Data\uff0clombok\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7528\u6cd5\uff0c\u4e4b\u540e\u53ef\u80fd\u4f1a\u51fa\u4e00\u7bc7\u535a\u5ba2\u3002 \u901a\u8fc7maven\u4e0b\u8f7d\u4f9d\u8d56\uff1a < dependency > < groupId > org . projectlombok < artifactId > lombok < optional > true \u8fd9\u6837\u6570\u636e\u5e93\u91cc\u7684\u5b57\u6bb5\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u5bf9\u8c61\u6765\u8868\u793a\u3002 \u4f46\u662fmodel\u4e0d\u5c5e\u4e8espringboot\u7684\u4e09\u5c42\u6846\u67b6\u3002 \u4e3b\u8981\u8bf4\u660e\u662fdao\u5c42\u3001service\u5c42\u548ccontroller\u5c42\u3002 \u8fd9\u4e9b\u5df2\u7ecf\u662f\u5c5e\u4e8e\u540e\u7aef\u4e86\u3002 \u5bf9\u4e8e\u4e00\u4e2a\u9879\u76ee\uff0c\u5b89\u5168\u6027\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\uff0c\u6240\u4ee5springboot\u5f88\u597d\u5730\u4f53\u73b0\u4e86\u8fd9\u4e00\u70b9\u3002 \u6bd4\u5982\uff1a \u60f3\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u5e76\u4e14\u64cd\u4f5c\uff0c\u53ea\u80fd\u901a\u8fc7dao\u5c42\u5411\u6570\u636e\u5e93\u53d1\u9001sql\u8bed\u53e5\uff0c\u5c06\u8fd9\u4e9b\u7ed3\u679c\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9service\u5c42\u3002 \u60f3\u8981\u5904\u7406\u6570\u636e\uff0c\u8981\u5148\u5411dao\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u5bf9dao\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u52a0\u5de5\u5904\u7406\uff0c\u5c06\u8fd9\u4e9b\u5904\u7406\u597d\u7684\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9controller\u5c42\u3002 \u5ba2\u6237\u60f3\u8981\u67e5\u8be2\u6216\u4fee\u6539\u6570\u636e\u65f6\uff0c\u8981\u5148\u5411service\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u6536\u96c6service\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\uff0c\u5c06\u8fd9\u4e9b\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u663e\u793a\u7ed9\u5ba2\u6237\uff0c\u4e00\u822c\u901a\u8fc7html\u7b49\u65b9\u6cd5\u7ed9\u5ba2\u6237\u3002 \u4e0b\u9762\u4f1a\u4e00\u4e00\u8bf4\u660e\u3002","title":"model\u5c42"},{"location":"cs/pl/java/springboot/#dao","text":"dao\u5c42\u4e5f\u53ebmapper\u5c42\uff0c\u6570\u636e\u6301\u4e45\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22mapper\u5c42\u3002 \u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u6301\u4e45\u5316\u64cd\u4f5c\uff0c\u4ed6\u7684\u65b9\u6cd5\u662f\u9488\u5bf9\u6570\u636e\u5e93\u64cd\u4f5c\u7684\uff0c\u57fa\u672c\u7528\u5230\u7684\u5c31\u662f\u589e\u5220\u6539\u67e5\u3002\u5b83\u53ea\u662f\u4e2a\u63a5\u53e3\uff0c\u53ea\u6709\u65b9\u6cd5\u540d\u5b57\uff0c\u5177\u4f53\u5b9e\u73b0\u5728mapper.xml\u4e2d\u3002 \u65e2\u7136mapper\u5c42\u662f\u76f4\u63a5\u4e0e\u6570\u636e\u5e93\u76f8\u6302\u94a9\u7684\uff0c\u6240\u4ee5\u8981\u5148\u8fde\u63a5\u6570\u636e\u5e93\u3002 \u53ef\u4ee5\u5728sqlMapConfig.xml\u6587\u4ef6\u6216\u8005application.properties\u6587\u4ef6\u91cc\u6dfb\u52a0\u6570\u636e\u5e93\u5c5e\u6027\u7b49\uff0c\u5982\u4e0b\u6240\u793a\uff1a sqlMapConfig.xml\u6dfb\u52a0\u5c5e\u6027\uff1a < properties resource = \"/config/db.properties\" > < environments default = \"development\" > < environment id = \"development\" > < transactionManager type = \"JDBC\" /> < dataSource type = \"POOLED\" > < property name = \"driver\" value = \"${jdbc.driver}\" /> < property name = \"url\" value = \"${jdbc.url}\" /> < property name = \"username\" value = \"${jdbc.username}\" /> < property name = \"password\" value = \"${jdbc.password}\" /> \u5728 SqlMapConfig.xml\u5c31\u4e0d\u9700\u8981\u5bf9\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u786c\u7f16\u7801\u3002 application.properties\u6dfb\u52a0\u5c5e\u6027\uff1a \u65b9\u4fbf\u5bf9\u53c2\u6570\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u5176\u4ed6 xml \u53ef\u4ee5\u5e94\u7528\u8be5\u914d\u7f6e\u6587\u4ef6\u3002 \u7136\u540e\u68c0\u67e5\u662f\u5426\u8fde\u4e0a\u6570\u636e\u5e93\uff0c\u8bf7\u770b\u4e0b\u56fe\uff1a \u7136\u540e\u81ea\u5df1\u914d\u7f6e\u6570\u636e\u5e93\u3002 \u6570\u636e\u5e93\u8fde\u63a5\u4e0a\u4e86\uff0c\u5230\u4e86\u4e24\u4e2a\u6587\u4ef6\u7684\u7f16\u5199\uff0c\u6211\u91c7\u7528mybatis\u6846\u67b6\u3002 \u5982\u4f55\u7f16\u5199mapper.xml\uff0c\u5bf9\u6570\u636e\u5e93\u589e\u5220\u6539\u67e5\uff1f \u5728\u5b66\u4e60MyBatis\u6846\u67b6\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53d1\u73b0\u5728idea\u91cc\u9762\u6ca1\u6cd5\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\uff0c\u521b\u5efa\u51fa\u7684xml\u6587\u4ef6\u6ca1\u6709Mapper.xml\u6587\u4ef6\u7684\u57fa\u672c\u683c\u5f0f\uff0c\u4e0b\u9762\u8bf4\u660e\u5982\u4f55\u5728idea\u4e2d\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\u6a21\u677f\u3002 File \u2192 Settings\u2026 \u2192 Editor \u2192 File and Code Templates \u70b9\u51fb\"+\"\u53f7\uff0c\u5e76\u8f93\u5165\u6587\u4ef6\u7684\u540d\u79f0\u548c\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u7f16\u8f91\u597d\u6a21\u677f\u540e\u70b9\u51fbApply\u5373\u53ef\u521b\u5efa\u6210\u529f} mapper.xml\u6587\u4ef6\u6a21\u7248 < mapper namespace = \"\" > \u521b\u5efaGoodsMapper.xml\u6587\u4ef6\u3002 \u7f16\u5199\u5185\u5bb9\uff1a < mapper namespace = \"mapper.GoodsMapper\" > < insert id = \"insertGoods\" parameterType = \"mapper.GoodsMapper\" > insert into Goods ( GNo , GName , GPrice ) values ( # { GNo }, # { GName }, # { GPrice }) < delete id = \"deleteGoods\" parameterType = \"java.String\" > delete from Goods where id = # { id } < update id = \"uodateGoods\" parameterType = \"mapper.GoodsMapper\" > update Goods set GNo = # { GNo }, GName = # { GName }, GPrice = # { GPrice } where id = # { id } < select id = \"findGoods\" parameterType = \"java.String\" resultType = \"mapper.GoodsMapper\" > select * from Goods where id = # { id } \u521b\u5efaGoodsMapper\u7684\u63a5\u53e3\u3002 package mapper ; import pojo.Goods ; public interface GoodsMapper { /** *\u589e\u52a0\u5546\u54c1 * @param goods * @throw Exception */ void insertGoods ( Goods goods ) throws Exception ; /** * \u5220\u9664\u5546\u54c1 * @param GNo * @throw Exception */ void deleteGoods ( String GNo ) throws Exception ; /** * \u4fee\u6539\u5546\u54c1 * @param goods * @throw Exception */ void updateGoods ( Goods goods ) throws Exception ; /** * \u6839\u636eGNo\u67e5\u627e * @return * @throw Exception */ Goods findByGNo ( String GNo ) throws Exception ; } \u4e0d\u9700\u8981\u7f16\u5199\u63a5\u53e3\u5bf9\u5b9e\u73b0\u7c7b\u4e86\uff0c\u53ea\u8981\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u6620\u5c04\u5173\u7cfb\u5bf9\u5e94\u597d\u5c31ok\uff0c\u8fd9\u4e0d\u5728\u672c\u6587\u7684\u8bb2\u8ff0\u8303\u56f4\u5185\u3002","title":"dao\u5c42"},{"location":"cs/pl/java/springboot/#service","text":"service\u5c42\u53eb\u4e1a\u52a1\u903b\u8f91\u5c42\uff0c\u5b58\u653e\u4e1a\u52a1\u903b\u8f91\u5904\u7406\uff0c\u4e0d\u76f4\u63a5\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u64cd\u4f5c\uff0c\u6709\u63a5\u53e3\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff0c\u63d0\u4f9bcontroller\u5c42\u8c03\u7528\u7684\u65b9\u6cd5\u3002 \u521b\u5efa\u4e24\u4e2a\u6587\u4ef6\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u7c7b\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsService\u63a5\u53e3\u7c7b\uff1a package service.Goods ; import pojo.Goods ; public interface GoodsService { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsServiceImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package service.Goods ; import mapper.GoodsMapper ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Service ; import pojo.Goods ; @Service public class GoodsServiceImpl implements GoodsService { @Autowired private GoodsMapper goodsMapper ; @Override public void insertGoods ( Goods goods ) throws Exception { goodsMapper . insertGoods ( goods ); } @Override public void deleteGoods ( String GNo ) throws Exception { goodsMapper . deleteGoods ( GNo ); } @Override public void updateGood ( Goods goods ) throws Exception { goodsMapper . updateGoods ( goods ); } @Override public void findByGNo ( String GNo ) throws Exception { goodsMapper . findByGNo ( GNo ); } } \u5c31\u8fd9\u6837\uff0cservice\u5c42\u4e0emapper\u5c42\u5efa\u7acb\u8d77\u4e86\u8054\u7cfb\uff0cservice\u5c42\u53ef\u4ee5\u8c03\u7528mapper\u5c42\u7684\u65b9\u6cd5\u3002","title":"service\u5c42"},{"location":"cs/pl/java/springboot/#controller","text":"controller\u5c42\u53eb\u63a7\u5236\u5668\u5c42\uff0c\u8d1f\u8d23\u524d\u540e\u7aef\u4ea4\u4e92\uff0c\u63a5\u53d7\u524d\u7aef\u8bf7\u6c42\uff0c\u8c03\u7528service\u5c42\uff0c\u63a5\u6536service\u5c42\u8fd4\u56de\u7684\u6570\u636e\uff0c\u6700\u540e\u8fd4\u56de\u5177\u4f53\u7684\u9875\u9762\u548c\u6570\u636e\u5230\u5ba2\u6237\u7aef\u3002 \u540c\u6837\uff0c\u4e5f\u9700\u8981\u4e24\u4e2a\u6587\u4ef6\uff0c\u63a5\u53e3\u7c7b\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsControllerI\u63a5\u53e3\u7c7b\uff1a package Controller.Goods ; import pojo.Goods ; public interface GoodsController { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsControllerImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package Controller.Goods ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Controller ; import org.springframework.web.bind.annotation.RequestMapping ; import pojo.Goods ; import service.Goods.GoodsService ; @Controller public class GoodsControllerImpl { @Autowired private GoodsService goodsService ; @RequestMapping ( value = \"/index\" ) public String insertGoods ( Goods goods ) throws Exception { goodsService . insertGoods ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String deleteGoods ( String GNo ) throws Exception { goodsService . deleteGoods ( GNo ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String updateGoods ( Goods goods ) throws Exception { goodsService . updateGood ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String findByGNo ( String GNo ) throws Exception { Goods goods = new Goods (); goods = goodsService . findByGNo ( GNo ); return \"/index\" ; } } \u8fd9\u6837\uff0c\u5ba2\u6237\u53ef\u4ee5\u901a\u8fc7\u8bf7\u6c42\u7684\u65b9\u5f0f\uff0c\u5c06\u6570\u636e\u4ece\u524d\u7aef\u4f20\u7ed9Controller\u5c42\uff0c\u7136\u540e\u4e00\u5c42\u4e00\u5c42\u4f20\u4e0b\u53bb\uff0c\u5728\u4e00\u5c42\u4e00\u5c42\u5730\u4f20\u4e0a\u6765\uff0c\u5b9e\u73b0\u4e86\u540e\u7aef\u5f00\u53d1\u3002 \u662f\u4e0d\u662f\u53d1\u73b0\u548c\u524d\u7aef\u6ca1\u4ec0\u4e48\u5173\u7cfb\uff1f \u662f\u7684\uff0cspringboot\u8fd8\u6709\u4e00\u4e2a\u4f18\u70b9\u5c31\u662f\u5b9e\u73b0\u4e86\u524d\u540e\u7aef\u5206\u79bb\uff0c\u4ece\u800c\u5de5\u4f5c\u4eba\u5458\u5206\u914d\u4efb\u52a1\u7684\u65f6\u5019\u66f4\u52a0\u5177\u6709\u6761\u7406\u6027\u3002\u800c\u4e09\u5c42\u7684\u67b6\u6784\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5458\u5f88\u5feb\u5730\u77e5\u9053bug\u51fa\u73b0\u5728\u54ea\u91cc\uff0c\u54ea\u4e00\u5c42\uff0c\u54ea\u4e00\u6587\u4ef6\uff0c\u5f88\u5feb\u7684\u4fee\u6539bug\u3002 \u545c\u547c\uff0c\u603b\u800c\u8a00\u4e4b\uff0cspringboot\u4f5c\u4e3aweb\u5f00\u53d1\u7684\u4e00\u4e2a\u4e3b\u6d41\u6846\u67b6\uff0c\u6b63\u5f0f\u56e0\u4e3a\u8fd9\u4e9b\u4f18\u79c0\u70b9\u8ba9\u5b83\u8131\u9896\u800c\u51fa\u3002 \u8fd9\u4e00\u7bc7\u5199\u5f97\u597d\u7d2f\u3002","title":"controller\u5c42"},{"location":"cs/pl/python/","text":"Python \u00b6 Abstract \u559c\u7231\u7a0b\u5ea6\u4ec5\u6b64\u4e8eC++\uff0c\u4f46\u5bf9\u6211\u6765\u8bf4\u662f\u76f8\u5bf9\u8584\u5f31\u7684\u8bed\u8a00 \u65e5\u5e38\u4e2d\u4f7f\u7528\u811a\u672c\u8f83\u591a\uff0c\u5b66\u672f\u4e0a\u673a\u5668\u5b66\u4e60/\u6df1\u5ea6\u5b66\u4e60\u65b9\u9762\u4f7f\u7528\u8f83\u591a Table of Contents \u00b6 Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883","title":"Python"},{"location":"cs/pl/python/#python","text":"Abstract \u559c\u7231\u7a0b\u5ea6\u4ec5\u6b64\u4e8eC++\uff0c\u4f46\u5bf9\u6211\u6765\u8bf4\u662f\u76f8\u5bf9\u8584\u5f31\u7684\u8bed\u8a00 \u65e5\u5e38\u4e2d\u4f7f\u7528\u811a\u672c\u8f83\u591a\uff0c\u5b66\u672f\u4e0a\u673a\u5668\u5b66\u4e60/\u6df1\u5ea6\u5b66\u4e60\u65b9\u9762\u4f7f\u7528\u8f83\u591a","title":"Python"},{"location":"cs/pl/python/#table-of-contents","text":"Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883","title":"Table of Contents"},{"location":"cs/pl/python/basic/","text":"Python \u8bed\u6cd5\u57fa\u7840 \u00b6 Abstract copy from TonyCrane/note \u4ec0\u4e48\u662f python \u00b6 \u89e3\u91ca\u6027\u7684\u811a\u672c\u8bed\u8a00\uff1a\u901a\u8fc7\u89e3\u91ca\u5668\u6765\u76f4\u63a5\u8fd0\u884c\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\u94fe\u63a5\u6210\u4e8c\u8fdb\u5236\u6587\u4ef6 \u52a8\u6001\u7c7b\u578b\u8bed\u8a00\uff1a\u7c7b\u578b\u5728\u8fd0\u884c\u65f6\u786e\u5b9a\uff0c\u4e0d\u9700\u8981\u901a\u8fc7\u4ee3\u7801\u660e\u6587\u89c4\u5b9a \u9762\u5411\u5bf9\u8c61\u8bed\u8a00\uff1apython \u4e2d\u4e00\u5207\u7686\u5bf9\u8c61 ... \u600e\u4e48\u88c5 python \u00b6 \u88c5\u7684\u662f\u4ec0\u4e48\uff1f \u662f\u4e00\u4e2a python \u89e3\u91ca\u5668\uff0c\u4ee5\u53ca\u8fd0\u884c\u9700\u8981\u7684\u73af\u5883 \u600e\u4e48\u88c5\uff1f \u5b98\u65b9\u7f51\u7ad9 https://www.python.org/downloads/ conda\uff08\u4e00\u4e2a\u597d\u7528\u7684 python \u73af\u5883\u7ba1\u7406\u5de5\u5177\uff09 anaconda \uff08\u5927\u3001\u6709\u9884\u88c5\u73af\u5883\uff09 https://www.anaconda.com/ miniconda \uff08\u5c0f\uff09 https://docs.conda.io/en/latest/miniconda \u6781\u4e0d\u5efa\u8bae\u901a\u8fc7\u5fae\u8f6f\u5e94\u7528\u5546\u5e97\u5b89\u88c5 python \u88c5\u4ec0\u4e48\u7248\u672c\uff1f \u4e24\u4e2a\u5927\u7248\u672c\uff0c2.* \u548c 3.*\uff0c\u5dee\u522b\u8f83\u5927\uff0c\u5efa\u8bae 3.* \u4e00\u4e9b\u5c0f\u7248\u672c\uff0c3.6 \u53ca\u4e4b\u524d\u4e0d\u63a8\u8350\uff0c3.7 3.8 \u7a33\u5b9a\uff0c3.9 3.10 \u5b8c\u5584\u4e2d\uff0c3.11 \u9884\u89c8\u4e2d \u7ec6\u5206\u7248\u672c\uff0c\u9009\u62e9\u6700\u65b0\uff0c3.7.13\u30013.8.13\u30013.9.12\u30013.10.4 conda \u4e0d\u5fc5\u62c5\u5fc3\u7248\u672c\uff0c\u9ed8\u8ba4 3.9\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u4f7f\u7528\u4e0d\u540c\u7248\u672c \u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c python \u00b6 \u600e\u4e48\u7528 python\uff1f \u8bb0\u4f4f\u4f60\u4e0b\u8f7d\u7684\u662f\u4e00\u4e2a\u89e3\u91ca\u5668\uff0c\u5efa\u8bae\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c python code.py \u4ec0\u4e48\u662f\u547d\u4ee4\u884c\uff1f \u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u901a\u77e5\u7535\u8111\u6267\u884c\u67d0\u6307\u4ee4\u3001\u6216\u8005\u8fd0\u884c\u67d0\u7a0b\u5e8f Windows\uff1acmd\u3001Powershell -> \u5355\u72ec\u8fd0\u884c / Windows Terminal /... macOS\uff1azsh\u3001... -> \u7ec8\u7aef / iTerm /... Linux\uff1abash\u3001zsh\u3001... -> \u7ec8\u7aef / ... \u7528\u4ec0\u4e48\u5199\u4ee3\u7801\uff1f \u8bb0\u4f4f\u4f60\u7f16\u5199\u7684\u53ea\u662f\u4e00\u4e2a .py \u4f5c\u4e3a\u6269\u5c55\u540d\u7684\u6587\u672c\u6587\u4ef6 \u53ea\u8981\u6587\u672c\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u5199 \u8bb0\u4e8b\u672c\u3001\u81ea\u5e26 IDLE\u3001word Notepad++\u3001Sublime Text VSCode\uff08Visual Studio Code\uff0c\u4e0d\u662f VS\uff09code.visualstudio.com Pycharm\uff08Community Edition \u5c31\u591f\u7528\uff09jetbrains.com/pycharm \u6570\u636e\u7c7b\u578b \u00b6 \u6570\u5b57\u4e0e\u8fd0\u7b97 \u00b6 \u6574\u578bint\uff0c\u6d6e\u70b9\u578bfloat\uff0c\u590d\u6570complex\uff08c.real\u8868\u793a\u5b9e\u90e8\uff0cc.imag\u8868\u793a\u865a\u90e8\uff0cc.conjugate()\u8fd4\u56de\u5171\u8f6d\u590d\u6570\uff09 \u6574\u6570\u4e0e\u6d6e\u70b9\u6570\u8f6c\u6362 int(...)\uff1a\u54110\u820d\u5165 round(...)\uff1a\u5411\u5076\u820d\u5165\uff08\u56db\u820d\u516d\u5165\u4e94\u51d1\u5076\uff0c\u53ef\u4ee5\u5f53\u6210\u56db\u820d\u4e94\u5165\uff09 math.floor(...)\u3001math.ceil(...)\uff1a\u4e0b\u53d6\u6574\u3001\u4e0a\u53d6\u6574\uff08\u9700\u8981 import math\uff09 \u8fd0\u7b97 \u5bf9\u4e8e+ - *\u52a0\u51cf\u4e58\uff0c\u5982\u679c\u90fd\u662f\u6574\u6570\uff0c\u90a3\u7ed3\u679c\u4e5f\u662f\u6574\u6570\uff0c\u5b58\u5728\u6d6e\u70b9\u6570\uff0c\u5219\u7ed3\u679c\u662f\u6d6e\u70b9\u6570 \u5bf9\u4e8e/\u9664\uff0c\u7ed3\u679c\u662f\u6d6e\u70b9\u6570\uff0c\u5bf9\u4e8e//\uff0c\u7ed3\u679c\u662f\u6574\u6570\uff08\u5411\u4e0b\u53d6\u6574\uff09 \u5bf9\u4e8e%\u53d6\u6a21\uff0c a%b == a-(a//b)*b \u5bf9\u4e8e**\u4e58\u65b9\uff0c\u53ef\u4ee5\u662fa ** 0.5\uff0c\u6216 a ** 2 \u5bf9\u4e8e pow(a,b,mod) \u4e58\u65b9\uff0cmod\u53ef\u7701\u7565\uff0c\u5982\u679cmod\u4e3a-1\u5373\u4e3a\u4e58\u6cd5\u9006\u5143 \u66f4\u591a\u8fd0\u7b97\u901a\u8fc7 math\u3001numpy\u3001scipy \u7b49\u5305\u6765\u8fdb\u884c \u5b57\u7b26\u4e32 \u00b6 Python \u4e0d\u652f\u6301\u5355\u5b57\u7b26\u7c7b\u578b\uff0c\u5355\u5b57\u7b26\u5728 Python \u4e2d\u4e5f\u662f\u4f5c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f7f\u7528\u3002 \u5355\u5f15\u53f7 '...'\uff0c\u53cc\u5f15\u53f7 \"...\"\uff0c\u4e09\u5f15\u53f7 '''...''' \"\"\"...\"\"\"\uff08\u53ef\u4ee5\u5185\u90e8\u6362\u884c\uff09 \u4e09\u5f15\u53f7 str = \"\"\"\"\"\" \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( \\ t ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ \\ n ] \u3002 \"\"\" print(str) \u8f93\u51fa\u4e3a\uff1a \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ ] \u3002 \u524d\u7f00 r-string\uff1ar\"...\"\uff0c\u5f15\u53f7\u4e2d\u4e0d\u8fdb\u884c\u8f6c\u4e49\uff0c\u5373\u4e00\u4e2a/\u5c31\u4ee3\u8868\u659c\u6760\u5b57\u7b26\u672c\u8eab f-string\uff1af\"...\"\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32 b-string\uff1ab\"...\"\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a bytes\uff0c\u53ea\u80fd\u5305\u542b ASCII \u5b57\u7b26 \u5e38\u7528\u65b9\u6cd5 \u62fc\u63a5\uff1a\u76f4\u63a5\u5c06\u5b57\u7b26\u4e32\u201c\u76f8\u52a0\u201d \"...\".upper()\u3001\"...\".lower() \uff1a\u8f6c\u4e3a\u5168\u5927\u5199\u3001\u5168\u5c0f\u5199 \"...\".title() \uff1a\u5355\u8bcd\u9996\u5b57\u6bcd\u5927\u5199 \"...\".count(str) \uff1a\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2dstr\u51fa\u73b0\u7684\u6b21\u6570 \"...\".strip() \uff1a\u5220\u9664\u5b57\u7b26\u4e32\u9996\u5c3e\u7a7a\u767d\uff08\u5305\u542b\u7a7a\u683c\u548c\u5236\u8868\u7b26\uff09 \"...\".lstrip()\u3001\"...\".rstrip() \uff1a\u5220\u9664\u5de6\u3001\u53f3\u7aef\u7a7a\u767d\u6216\u6307\u5b9a\u5b57\u7b26 \"...\".replace(old, new) \uff1a\u5b57\u7b26\u4e32\u4e2d old \u66ff\u6362\u6210 new \"...\".split(c) \uff1a\u6839\u636e\u5b57\u7b26 c \u6765\u62c6\u5206\u5b57\u7b26\u4e32\u5f97\u5230\u5217\u8868\uff0c\u9ed8\u8ba4\u62c6\u5206\u7a7a\u767d f-string \u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u65b9\u5f0f\uff1a\"...\" % ...\uff0c\"...\".format(...)\uff0cf\"...\" f-string\u7528\u5927\u62ec{ }\u8868\u793a\u88ab\u66ff\u6362\u5b57\u6bb5\uff0c\u5176\u4e2d\u76f4\u63a5\u586b\u5165\u66ff\u6362\u5185\u5bb9\u5373\u53ef f-string\u7684\u5927\u62ec\u53f7{ }\u53ef\u4ee5\u586b\u5165\u8868\u8fbe\u5f0f\u6216\u8c03\u7528\u51fd\u6570\uff0cPython\u4f1a\u6c42\u51fa\u5176\u7ed3\u679c\u5e76\u586b\u5165\u8fd4\u56de\u7684\u5b57\u7b26\u4e32\u5185 f-string\u4e2d\u4f7f\u7528lambda\u533f\u540d\u51fd\u6570\uff1a\u53ef\u4ee5\u505a\u590d\u6742\u7684\u6570\u503c\u8ba1\u7b97 f-string\u5927\u62ec\u53f7\u5185\u4f7f\u7528\u7684\u5f15\u53f7\u4e0d\u80fd\u548c\u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u5b9a\u754c\u7b26\u5f15\u53f7\u51b2\u7a81\uff0c\u9700\u6839\u636e\u60c5\u51b5\u7075\u6d3b\u5207\u6362\u4f7f\u7528\u5355\u5f15\u53f7\u3001\u53cc\u5f15\u53f7\u3001\u5355\u4e09\u5f15\u53f7\u3001\u53cc\u4e09\u5f15\u53f7 \u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u8fd8\u53ef\u4ee5\u4f7f\u7528\\\u8f6c\u4e49\uff0c\u4f46\u5927\u62ec\u53f7\u5185\u4e0d\u80fd\u4f7f\u7528\\\u8f6c\u4e49 f-string\u5927\u62ec\u53f7\u5916\u5982\u679c\u9700\u8981\u663e\u793a\u5927\u62ec\u53f7\uff0c\u5219\u5e94\u8f93\u5165\u8fde\u7eed\u4e24\u4e2a\u5927\u62ec\u53f7{{ }}\uff1b\u5927\u62ec\u53f7\u5185\u9700\u8981\u5f15\u53f7\uff0c\u4f7f\u7528\u5f15\u53f7\u5373\u53ef f-string\u9488\u5bf9date\u3001datetime\u548ctime\u5bf9\u8c61\uff0c\u8fdb\u884c\u5e74\u6708\u65e5\u3001\u65f6\u5206\u79d2\u7b49\u4fe1\u606f\u63d0\u53d6 \u5bbd\u5ea6\u586b\u5145\uff1a:[ \u586b\u5145\u5b57\u7b26 ][ \u5bf9\u9f50\u65b9\u5f0f ][ \u5bbd\u5ea6 ]\uff0c< \u5de6\u5bf9\u9f50\uff0c> \u53f3\u5bf9\u9f50\uff0c^ \u5c45\u4e2d \u5b57\u7b26\u622a\u65ad\uff1a:[...].n\uff0c\u53ea\u663e\u793a\u5b57\u7b26\u4e32\u7684\u524d n \u4e2a\u5b57\u7b26 \u6570\u503c\u7b26\u53f7\uff1a:+ \u6b63\u6570\u52a0\u6b63\u53f7\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7\uff0c:- \u539f\u6837\uff0c: \uff08\u7a7a\u683c\uff09\u6b63\u6570\u52a0\u7a7a\u683c\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7 \u6570\u503c\u7cbe\u5ea6\uff1a:[ \u5bbd\u5ea6 ][ \u5206\u9694\u7b26 (,_)].[ \u7cbe\u5ea6 ]f\uff0c\u6ca1\u6709\u7cbe\u5ea6\u9ed8\u8ba4\u4e3a 6 \u8fdb\u5236\u663e\u793a\uff1ax \u5c0f\u5199\u5341\u516d\u8fdb\u5236\uff0cX \u5927\u5199\u5341\u516d\u8fdb\u5236\uff0co \u516b\u8fdb\u5236\uff0cb \u4e8c\u8fdb\u5236\uff0c\u52a0 # \u663e\u793a\u524d\u7f00 \u5b57\u8282\u7c7b\u578b \u00b6 \u7c7b\u4f3c\u5b57\u7b26\u4e32\uff0c\u4f46\u5b58\u50a8\u7684\u662f\u5b57\u8282\u7684\u503c\uff0c\u66f4\u50cf\u5217\u8868\uff0c\u663e\u793a\u4e3a b\"...\"\uff0c\u901a\u5e38\u7528\u4e8e\u7f51\u7edc\u6570\u636e\u4f20\u8f93\u3001\u4e8c\u8fdb\u5236\u56fe\u7247\u548c\u6587\u4ef6\u7684\u4fdd\u5b58\u7b49 \u901a\u8fc7bytes()\u751f\u6210bytes\u5b9e\u4f8b\uff0c\u503c\u7684\u5f62\u5f0f\u4e3ab\"...\"\uff0c\u7528\u4e0d\u540c\u7684\u7f16\u7801\u65b9\u5f0f\u4f1a\u5f62\u6210\u4e0d\u540c\u7684\u503c \u4e0e\u5b57\u7b26\u4e32\u8f6c\u6362 \"...\".encode(encoding) \u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4 UTF-8 bytes_obj.decode(encoding) \u6839\u636e encoding \u89e3\u7801\u5b57\u8282\u5e8f\u5217\uff0c\u89e3\u7801\u5931\u8d25\u4f1a\u62a5\u9519 bytes(\"...\", encoding) \u4e5f\u662f\u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32 \u5e03\u5c14\u7c7b\u578b \u00b6 True \u548c False\uff0c \u9996\u5b57\u6bcd\u5927\u5199 \u53ef\u4ee5\u7528bool(...)\u6765\u8f6c\u6362 \u53ef\u4ee5\u7528 & | \u6765\u8868\u793a\u4e0e\u548c\u6216\uff0c\u4e00\u822c\u4f7f\u7528and or not \u8fdb\u884c\u8fd0\u7b97\uff08\u53ef\u7ec4\u5408\uff09 \u5217\u8868 \u00b6 \u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u7684\u6570\u7ec4\uff0c\u4f46\u662f\u529f\u80fd\u66f4\u591a\uff0c\u800c\u4e14\u5185\u90e8\u5143\u7d20\u4e0d\u8981\u6c42\u540c\u4e00\u7c7b\u578b \u65b9\u62ec\u53f7 [] \u8868\u793a\u5217\u8868\uff0c\u5143\u7d20\u7528\u9017\u53f7\u5206\u9694 \u7d22\u5f15\uff08\u5373\u4e0b\u6807\uff09\u4ece 0 \u5f00\u59cb\u8ba1\u6570\uff0clst[n] \u5373\u8868\u793a\u8bbf\u95ee\u7b2c n+1 \u4e2a\u5143\u7d20 \u7d22\u5f15\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u8d1f\u6570\u5373\u8868\u793a\u5012\u6570\uff0c\u4f8b lst[-2] \u8868\u793a\u5012\u6570\u7b2c\u4e8c\u4e2a\u5143\u7d20 \u5207\u7247\uff08\u83b7\u53d6\u5217\u8868\u4e2d\u7684\u4e00\u90e8\u5206\u503c\uff09 lst[a:b]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u7684\u5217\u8868 lst[:b]\uff1a\u4ece\u5f00\u5934\u5230 lst[b-1] \u7684\u5217\u8868 lst[a:]\uff1a\u4ece lst[a] \u5230\u7ed3\u5c3e\u7684\u5217\u8868 lst[:]\uff1a\u8868\u793a\u6574\u4e2a\u5217\u8868\uff08\u62f7\u8d1d\u4e00\u4efd\uff09 lst[a:b:c]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u6bcf c \u4e2a\uff08\u5373\u6b65\u957f\uff09\u53d6\u4e00\u4e2a\u5f62\u6210\u7684\u5217\u8868 c \u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u6b64\u65f6\u9700\u8981 a > b \u624d\u80fd\u83b7\u53d6\u5230\u503c \u6709\u6b65\u957f\u65f6\u82e5\u7701\u7565 a\u3001b \u8bb0\u5f97\u4e0d\u8981\u7701\u7565\u5192\u53f7\uff0c\u4f8b lst[::-1] \u8868\u793a\u5217\u8868\u5012\u5e8f \u5217\u8868\u64cd\u4f5c \u00b6 \u4fee\u6539\u5143\u7d20\uff1a\u76f4\u63a5\u901a\u8fc7\u7d22\u5f15/\u5207\u7247\uff0c\u7136\u540e\u7b49\u53f7\u8d4b\u503c \u6709\u6808\u7684\u529f\u80fd lst.append(...) \u5728\u5217\u8868\u672b\u5c3e\u52a0\u5165\u5143\u7d20 lst.pop() \u5f39\u51fa\u5217\u8868\u672b\u5c3e\u5143\u7d20\u5e76\u8fd4\u56de \u4efb\u610f\u4f4d\u7f6e\u63d2\u5165\u5f39\u51fa lst.insert(i, x) \u5728\u7d22\u5f15 i \u7684\u4f4d\u7f6e\u63d2\u5165 x\uff0c\u540e\u9762\u4f9d\u6b21\u540e\u79fb lst.pop(i) \u5f39\u51fa\u7d22\u5f15 i \u4f4d\u7f6e\u7684\u5143\u7d20\uff0c\u540e\u9762\u4f9d\u6b21\u524d\u79fb \u5217\u8868\u62fc\u63a5 \u76f4\u63a5\u76f8\u52a0\uff0c\u4e0d\u6539\u53d8\u539f\u5217\u8868\uff0c\u5f97\u5230\u65b0\u7684\u5217\u8868 lst.extend([...])\uff0c\u628a\u4e00\u4e2a\u5217\u8868\u63a5\u5230\u5f53\u524d\u5217\u8868\u540e\u9762 \u6839\u636e\u503c\u5220\u9664\u5143\u7d20 lst.remove(value) \u5220\u9664\u7b2c\u4e00\u4e2a\u503c\u4e3a value \u7684\u5143\u7d20 \u6392\u5e8f\u5217\u8868 lst.sort() \u6c38\u4e45\u6392\u5e8f\uff08\u5373\u6392\u5e8f\u540e\u8d4b\u503c\u7ed9\u5f53\u524d\u5217\u8868\uff09 sorted(lst) \u4e34\u65f6\u6392\u5e8f\uff0c\u8fd4\u56de\u6392\u5e8f\u597d\u7684\u65b0\u5217\u8868 \u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927\uff0c\u5982\u679c\u4f20\u5165 reverse=True \u5219\u4ece\u5927\u5230\u5c0f \u53cd\u8f6c\u5217\u8868 lst.reverse() \u6c38\u4e45\u53cd\u8f6c\uff08\u610f\u4e49\u540c\u4e0a\uff09 lst[::-1] \u8fd4\u56de\u53cd\u8f6c\u7684\u5217\u8868\uff08\u5229\u7528\u524d\u9762\u8bf4\u5230\u7684\u5207\u7247\uff09 \u7edf\u8ba1\u64cd\u4f5c len(lst) \u5f97\u5230\u5217\u8868\u7684\u957f\u5ea6 sum(lst) \u5f97\u5230\u5217\u8868\u7684\u5143\u7d20\u548c\uff08\u672c\u8d28\u4e0a\u662f\u5c06 start \u53c2\u6570\u548c\u6bcf\u4e2a\u5143\u7d20\u4f9d\u6b21\u76f8\u52a0\uff09 \u53ef\u4ee5\u4f20\u5165 start \u53c2\u6570\u7528\u6765\u6307\u5b9a\u52a0\u548c\u7684\u8d77\u59cb\u503c max(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5927\u503c min(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5c0f\u503c \u5143\u7ec4 \u00b6 \u53ef\u4ee5\u770b\u6210\u5143\u7d20\u4e0d\u53ef\u53d8\u7684\u5217\u8868\uff0c\u5185\u90e8\u4e5f\u53ef\u4ee5\u5305\u542b\u4e0d\u540c\u7c7b\u578b\u7684\u5143\u7d20 \u62ec\u53f7\u8868\u793a\u5143\u7ec4\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694 \u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u4e00\u6837\u7684\u65b9\u6cd5\u6765\u8bfb\u53d6\u5143\u7d20\uff0c\u4f46\u5e76\u4e0d\u80fd\u4fee\u6539 \u5f53\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u65f6\u5019\u8981\u5199\u6210 (a,) \u800c\u4e0d\u662f (a)\uff08\u540e\u8005\u662f\u5355\u4e2a\u503c\uff09 \u53ef\u4ee5\u4f7f\u7528 tuple(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff08\u5217\u8868\u3001\u5b57\u7b26\u4e32\u7b49\uff09\u8f6c\u4e3a\u5143\u7ec4 \u5143\u7ec4\u5e76\u4e0d\u80fd\u4fdd\u8bc1\u5143\u7d20\u5b8c\u5168\u4e0d\u53ef\u53d8 \u907f\u514d\u5728\u5143\u7ec4\u4e2d\u5b58\u653e\u53ef\u53d8\u5143\u7d20 \u96c6\u5408 \u00b6 \u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694\uff0c\u4f1a\u81ea\u52a8\u53bb\u91cd \u53ef\u7528 set(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\u8f6c\u4e3a\u5143\u7ec4\uff0c\u81ea\u52a8\u53bb\u91cd \u96c6\u5408\u4e2d\u4e0d\u80fd\u5305\u542b\u5217\u8868\u7b49\u4e0d\u53ef hash \u5316\u7684\u5143\u7d20 \u4fee\u6539 s.add(...) \u6765\u52a0\u5165\u4e00\u4e2a\u5143\u7d20 s.remove(...) \u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u4f1a\u629b\u51fa\u5f02\u5e38 s.discard(...) \u6765\u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u5219\u5ffd\u7565 \u8fd0\u7b97 s1 & s2\u3001s1 | s2\u3001s1 - s2 \u4ea4\u96c6\u3001\u5e76\u96c6\u3001\u5dee\u96c6 s1 ^ s2 \u5bf9\u79f0\u5dee\u96c6 \u5b57\u5178 \u00b6 \u5b58\u50a8\u952e\u503c\u5bf9\uff0c\u4e5f\u662f\u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u4e0d\u8fc7\u9017\u53f7\u5206\u9694\u7684\u662f\u952e\u503c\u5bf9 {key: value, ...} {} \u662f\u7a7a\u5b57\u5178\u800c\u4e0d\u662f\u7a7a\u96c6\u5408 \u901a\u8fc7 d[key] \u6765\u8bbf\u95ee\u5b57\u5178\u4e2d key \u5bf9\u5e94\u7684\u503c\uff0c\u53ef\u4ee5\u8bfb\u53d6\u3001\u4fee\u6539 \u6dfb\u52a0\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 d[key] = value \u6765\u8fdb\u884c \u5220\u9664\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5 del d[key] \u901a\u8fc7 d[key] \u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728 key \u8fd9\u4e2a\u952e\u4f1a\u629b\u51fa\u5f02\u5e38 \u901a\u8fc7 d.get(key) \u6765\u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728\u5219\u4f1a\u8fd4\u56de None \u4f7f\u7528 d.get(key, default) \u5982\u679c\u6ca1\u6709 key \u65f6\u4f1a\u8fd4\u56de default \u503c d.update(d2) \u6765\u7528 d2 \u4e2d\u7684\u952e\u503c\u5bf9\u66f4\u65b0 d \u6761\u4ef6\u5206\u652f \u00b6 \u5e03\u5c14\u8868\u8fbe\u5f0f \u00b6 == \u5224\u65ad\u76f8\u7b49\uff08\u76f8\u7b49\u5219\u8fd4\u56de True\uff09\uff0c != \u5224\u65ad\u4e0d\u7b49 \u4f7f\u7528 and or not \u6765\u8fdb\u884c\u5e03\u5c14\u8fd0\u7b97\uff0c\u5fc5\u8981\u65f6\u52a0\u62ec\u53f7\u4fdd\u8bc1\u4f18\u5148\u7ea7 \u6570\u503c\u6bd4\u8f83\u5927\u5c0f < <= > >= \u5224\u65ad\u5143\u7d20\u662f\u5426\u5728\u5217\u8868\u4e2d value in lst\uff1a\u5982\u679c\u5728\u5219\u503c\u4e3a True value not in lst\uff1a\u5982\u679c\u5728\u5219\u4e3a False\uff08\u5224\u65ad\u662f\u5426\u4e0d\u5728\uff09 \u5224\u65ad\u952e\u662f\u5426\u5728\u5b57\u5178\u4e2d key in d\u3001key not in d \u4e0e\u5217\u8868\u540c\u7406 \u6761\u4ef6\u8bed\u53e5 \u00b6 if-elif-else \u7ed3\u6784\uff08\u4e0d\u662f else if\uff09 elif\u3001else \u5747\u53ef\u4ee5\u7701\u7565 \u6761\u4ef6\u4e0d\u9700\u8981\u52a0\u62ec\u53f7\uff08\u52a0\u4e86\u4e5f\u6ca1\u95ee\u9898\uff09 condition \u4f1a\u88ab\u8f6c\u6362\u6210 bool \u7c7b\u578b\u7136\u540e\u5224\u65ad \u6ce8\u610f\u7f29\u8fdb \u7c7b\u4e09\u76ee\u8fd0\u7b97\u7b26\u5199\u6cd5 a if condition else b \u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u4e2d\u7684 condition? a : b if-elif-else if condition1 : ... elif condition2 : ... elif condition3 : ... else : ... \u7f29\u8fdb \u00b6 \u7f29\u8fdb\u662f python \u4e2d\u5f88\u91cd\u8981\u7684\u4e1c\u897f\uff0cpython \u9760\u7f29\u8fdb\u6765\u5f97\u5230\u4ee3\u7801\u7ed3\u6784\uff0c\u800c\u4e0d\u662f\u5927\u62ec\u53f7 \u7f29\u8fdb\u53ef\u4ee5\u4f7f\u7528\u7a7a\u683c\u6216\u5236\u8868\u7b26 \u5982\u679c\u4e00\u4e9b\u4ee3\u7801\u5904\u4e8e\u540c\u4e00\u5c42\u7f29\u8fdb\u4e0b\uff0c\u5219\u5c5e\u4e8e\u540c\u4e00\u4e2a\u4ee3\u7801\u5757 \u540c\u4e00\u4e2a\u4ee3\u7801\u5757\u7684\u7f29\u8fdb\u8981\u7edf\u4e00 \u4e0d\u4ec5\u4ec5\u662f\u770b\u7740\u50cf\uff0c\u8981\u533a\u5206\u597d\u7a7a\u683c\u4e0e\u5236\u8868\u7b26 4 \u4e2a\u7a7a\u683c\u4e0e\u4e00\u4e2a\u663e\u793a\u5bbd\u5ea6\u4e3a 4 \u7684\u5236\u8868\u7b26\u5e76\u4e0d\u662f\u540c\u4e00\u7f29\u8fdb \u4e00\u822c\u4f7f\u7528 4 \u7a7a\u683c\u7f29\u8fdb\uff0c\u6216\u8005 1 \u5236\u8868\u7b26\u7f29\u8fdb \u7f16\u8f91\u5668\u4e2d\u6309 Tab \u6253\u51fa\u7684\u4e5f\u4e0d\u4e00\u5b9a\u662f\u5236\u8868\u7b26\uff0c\u8981\u5206\u6e05 \u7f29\u8fdb\u4e0d\u6b63\u786e\u4f1a\u62a5 IndentationError\uff0c\u6b64\u65f6\u6ce8\u610f\u68c0\u67e5\u7f29\u8fdb \u5faa\u73af \u00b6 for \u5faa\u73af \u00b6 python \u4e2d\u7684 for \u5faa\u73af\u5e76\u4e0d\u50cf c \u4e2d\u662f\u6307\u5b9a\u4e00\u4e2a\u53d8\u91cf\u7684\u53d8\u5316\u65b9\u5f0f\uff0c\u800c\u662f\u4ece\u5217\u8868/\u5143\u7ec4/\u8fed\u4ee3\u5668\u7b49\u53ef\u8fed\u4ee3\u5bf9\u8c61\u4e2d\u904d\u5386\u503c for \u5faa\u73af\u4f1a\u4ea7\u751f\u4e00\u4e2a\u7528\u4e8e\u5faa\u73af\u7684\u53d8\u91cf\uff0c\u8fd9\u4e2a\u53d8\u91cf\u5728\u5faa\u73af\u7ed3\u675f\u540e\u5e76\u4e0d\u4f1a\u5220\u9664\uff0c\u800c\u662f\u4fdd\u7559\u6700\u540e\u4e00\u6b21\u7684\u503c \u53ef\u4ee5\u4f7f\u7528 range \u6765\u751f\u6210\u4e00\u4e32\u6570\u5b57\u7528\u6765\u5faa\u73af range(a, b) \u751f\u6210\u4ece a \u5230 b-1 \u7684\u8fde\u7eed\u6574\u6570 range(a, b, c) \u4ee5 c \u4e3a\u6b65\u957f\u751f\u6210 range \u5f97\u5230\u7684\u5e76\u4e0d\u662f\u5217\u8868\uff0c\u5982\u679c\u8981\u7528\u5176\u751f\u6210\u5217\u8868\u8981\u4f7f\u7528 list(range(...)) for value in lst : ... for value in range ( ... ): ... for \u5faa\u73af\u904d\u5386\u5b57\u5178 \u00b6 \u6709\u4e09\u79cd\u65b9\u6cd5\u6765\u904d\u5386\u5b57\u5178 \u5728 d.keys() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u952e \u5728 d.values() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u503c \u5728 d.items() \u4e2d\u904d\u5386\u952e\u503c\u5bf9\uff08\u9700\u8981\u89e3\u5305\uff09 for key in d . keys (): ... for value in d . values (): ... for item in d . items (): ... # item \u4e3a\u4e00\u4e2a\u5143\u7ec4 for key , value in d . items (): ... # \u5c06 item \u89e3\u5305 \u5143\u7d20\u89e3\u5305 \u00b6 \u8d4b\u503c\u65f6\u7b49\u53f7\u5de6\u4fa7\u53ef\u4ee5\u662f\u7528\u9017\u53f7\u5206\u9694\u7684\u591a\u4e2a\u503c\uff0c\u8fd9\u65f6\u4f1a\u5c06\u53f3\u4fa7\u89e3\u5305\u5206\u522b\u8d4b\u503c\u7ed9\u5de6\u4fa7\u7684\u5404\u4e2a\u53d8\u91cf \u53f3\u4fa7\u4e5f\u53ef\u4ee5\u662f\u591a\u4e2a\u503c\uff08\u53ea\u8981\u51fa\u73b0\u9017\u53f7\u5c31\u4f1a\u89c6\u4e3a\u4e00\u4e2a\u5143\u7ec4\uff09 \u53ef\u4ee5\u901a\u8fc7 a, b = b, a \u5b9e\u73b0\u5143\u7d20\u4ea4\u6362 \u661f\u53f7\u8868\u8fbe\u5f0f \u53ef\u4ee5\u7528\u6765\u5728\u53ef\u8fed\u4ee3\u5bf9\u8c61\u5185\u90e8\u89e3\u5305 \u4e5f\u53ef\u7528\u6765\u6807\u8bb0\u4e00\u4e2a\u53d8\u91cf\u5305\u542b\u591a\u4e2a\u503c for \u5faa\u73af\u53ef\u4ee5\u89e3\u5305 t = ( 1 , 2 , 3 ) a , b , c = t # a = 1, b = 2, c = 3 t = ( 1 , 2 , ( 3 , 4 )) a , b , ( c , d ) = t # c = 3, d = 4 l = [ 1 , 2 , * [ 3 , 4 ]] # [3, 4] \u88ab\u89e3\u5305 ## l = [1, 2, 3, 4] a , * b = [ 1 , 2 , 3 , 4 ] ## a = 1, b = [2, 3, 4] lst = [[ 1 , 2 ], [ 3 , 4 ]] for a , b in lst : ... # \u7b2c\u4e00\u6b21\u5faa\u73af a, b \u4e3a 1, 2 # \u7b2c\u4e8c\u6b21\u5faa\u73af a, b \u4e3a 3, 4 for \u5faa\u73af\u6280\u5de7 \u00b6 enumerate \u8ba1\u6570 \u53ef\u4ee5\u6307\u5b9a\u521d\u59cb\u503c zip \u540c\u65f6\u5faa\u73af\u591a\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61 \u5faa\u73af\u6b21\u6570\u4e3a\u6700\u77ed\u7684\u5bf9\u8c61\u7684\u957f\u5ea6 for i , value in enumerate ( lst ): ... # i \u4f9d\u6b21\u4e3a 0\uff0c1\uff0c2\uff0c\u2026\u2026 for i , value in enumerate ( lst , 1 ): ... # i \u4f9d\u6b21\u4e3a 1\uff0c2\uff0c3\uff0c\u2026\u2026 for a , b in zip ( lst1 , lst2 ): ... # a \u5728 lst1 \u4e2d\u5faa\u73af # b \u5728 lst2 \u4e2d\u5faa\u73af \u5217\u8868\u63a8\u5bfc \u00b6 \u4e00\u79cd\u5f88\u65b9\u4fbf\u7684\u751f\u6210\u5217\u8868\u7684\u65b9\u5f0f \u5373\u5728\u5217\u8868\u4e2d\u5305\u542b\u5faa\u73af\uff0c\u9010\u6b21\u8bb0\u5f55\u5faa\u73af\u524d\u8868\u8fbe\u5f0f\u7684\u503c \u53ef\u4ee5\u6709\u591a\u91cd\u5faa\u73af\uff0c\u5373\u751f\u6210\u7b1b\u5361\u5c14\u79ef \u53ef\u4ee5\u5305\u542b\u6761\u4ef6\uff0c\u5373\u5728\u6761\u4ef6\u6210\u7acb\u65f6\u624d\u8bb0\u5f55\u503c \u5217\u8868\u63a8\u5bfc\u4e2d\u7684\u5faa\u73af\u53d8\u91cf\u6709\u5c40\u90e8\u4f5c\u7528\u57df \u5373\u5728\u5217\u8868\u63a8\u5bfc\u5916\u4e0d\u80fd\u8bbf\u95ee\u5faa\u73af\u53d8\u91cf lst = [] for i in range ( 1 , 10 ): lst . append ( i ** 2 ) ## \u7b49\u4ef7\u4e8e lst = [ i ** 2 for i in range ( 1 , 10 )] lst1 = [ x * y for x in l1 for y in l2 ] lst2 = [ ... for ... in ... if ... ] \u751f\u6210\u5143\u7ec4/\u5b57\u5178 \u00b6 \u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u63a8\u5bfc\u7c7b\u4f3c\u7684\u65b9\u6cd5\u751f\u6210\u5143\u7ec4\u548c\u5b57\u5178 \u751f\u6210\u5143\u7ec4\u7684\u65f6\u5019\u8981\u7528 tuple() \u53ea\u5199 () \u7684\u8bdd\u5219\u53ea\u662f\u751f\u6210\u5668\u8868\u8fbe\u5f0f \u751f\u6210\u5b57\u5178\u65f6\u5faa\u73af\u524d\u7528 : \u5c06\u952e\u503c\u9694\u5f00 tuple ( i ** 2 for i in range ( 1 , 10 )) ( i ** 2 for i in range ( 1 , 10 )) ## ^ generator object { a : b for a in ... for b in ... } \u63a7\u5236\u5faa\u73af \u00b6 \u548c\u5176\u5b83\u8bed\u8a00\u4e00\u6837\uff0c\u5728\u5faa\u73af\u4ee3\u7801\u5757\u4e2d\u53ef\u4ee5\u63a7\u5236\u5faa\u73af\u7684\u8fdb\u884c break \u7acb\u523b\u7ed3\u675f\u5faa\u73af continue \u7acb\u523b\u8fdb\u884c\u4e0b\u4e00\u8f6e\u5faa\u73af while \u5faa\u73af \u00b6 while \u5faa\u73af\u5373\u8fdb\u884c\u6761\u4ef6\u68c0\u67e5\uff0c\u5982\u679c\u4e3a True \u5219\u7ee7\u7eed\u8fd0\u884c\u76f4\u5230\u6761\u4ef6\u4e0d\u6ee1\u8db3\u505c\u6b62 while condition : ... \u51fd\u6570 \u00b6 \u51fd\u6570\u5b9a\u4e49 \u00b6 \u4f7f\u7528 def \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u51fd\u6570 \u5148\u51fd\u6570\u540d\uff0c\u7136\u540e\u62ec\u53f7\u5217\u51fa\u53c2\u6570\uff0c\u4e0b\u9762\u63a5\u4ee3\u7801\u5757 \u4f7f\u7528 return \u8fd4\u56de \u6ca1\u6709 return \u8fd0\u884c\u5230\u7ed3\u5c3e\uff0c\u8fd4\u56de None \u53ea\u6709 return\uff0c\u8fd4\u56de None return \u540e\u63a5\u5185\u5bb9\uff0c\u8fd4\u56de\u5185\u5bb9 return \u7684\u503c\u7c7b\u578b\u4e0d\u8981\u6c42\u4e00\u81f4 return \u53ef\u4ee5\u8fd4\u56de\u591a\u4e2a\u503c\uff08\u5229\u7528\u5143\u7ec4\uff09 def func_name ( arg1 , arg2 ): ... def func_name ( arg1 , arg2 ): ... return ... def func_name ( arg1 , arg2 ): ... return ... , ... \u51fd\u6570\u53c2\u6570 \u00b6 \u62ec\u53f7\u4e2d\u8981\u5217\u51fa\u53c2\u6570\u540d\uff0c\u4f9b\u51fd\u6570\u4f53\u5185\u4f7f\u7528 \u53ef\u4ee5\u5728\u53c2\u6570\u540e\u63a5\u7b49\u53f7\u8d4b\u9ed8\u8ba4\u503c \u4f7f\u7528\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5728\u8c03\u7528\u65f6\u53ef\u4ee5\u4e0d\u7528\u4f20 \u5229\u7528 * \u6765\u63a5\u6536\u4efb\u610f\u591a\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5143\u7ec4 * \u53c2\u6570\u540e\u9762\u4e0d\u80fd\u518d\u6709\u5176\u5b83\u975e\u5173\u952e\u5b57\u53c2\u6570 \u5229\u7528 ** \u6765\u63a5\u6536\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5b57\u5178 def func ( arg1 , arg2 ): ... def func ( arg1 , arg2 = \"...\" ): # \u9ed8\u8ba4\u503c ... def func ( arg1 , * arg2 ): # \u4efb\u610f\u591a\u53c2\u6570 ... def func ( arg1 , ** arg2 ): # \u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 ... def func ( arg1 , * arg2 , ** arg3 ): ... # *arg2 \u540e\u53ef\u4ee5\u52a0 **arg3 \u51fd\u6570\u8c03\u7528 \u00b6 \u901a\u8fc7 \u51fd\u6570\u540d(\u53c2\u6570) \u6765\u8c03\u7528\u51fd\u6570\uff0c\u5f97\u5230\u8fd4\u56de\u503c \u76f4\u63a5\u4f20\u53c2\u7684\u8bdd\u8981\u5c06\u53c2\u6570\u4e0e\u5b9a\u4e49\u5bf9\u5e94\u4e0a \u901a\u8fc7\u5173\u952e\u5b57\u4f20\u53c2\uff08\u53c2\u6570\u540d\uff09\u53ef\u4ee5\u6253\u4e71\u987a\u5e8f \u5e26\u6709\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5982\u679c\u4e0d\u4f20\u5219\u4f7f\u7528\u9ed8\u8ba4\u503c \u5982\u679c\u8bfb\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570\uff0c\u5219\u591a\u4f59\u7684\u8bfb\u5230\u5b57\u5178\u4e2d def func ( a , b ): ... func ( 1 , 2 ) # a = 1, b = 2 func ( b = 1 , a = 2 ) # a = 2, b = 1 def func2 ( a , ** b ): ... func2 ( a = 1 , b = 2 , c = 3 ) ## a = 1, b = {\"b\": 2, \"c\": 3} *\u5f15\u7528\u53d8\u91cf \u00b6 python \u4e2d\u7684\u53d8\u91cf\u90fd\u662f\u5f15\u7528\u7684\uff08\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u524d\u9762\u8bf4\u4e0d\u8981\u5c06\u53d8\u91cf\u7406\u89e3\u4e3a\u76d2\u5b50\uff09 \u7528 = \u5b9e\u9645\u4e0a\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u522b\u540d lst1 = lst2\uff0c\u5219 lst1 \u548c lst2 \u4f1a\u540c\u65f6\u53d8\u5316\uff08\u8981\u7528 [:] \u521b\u5efa\u526f\u672c\uff09 \u6570\u503c\u7c7b\u578b\u6709\u4f18\u5316\uff0c\u6240\u4ee5\u4e0d\u4f1a\u8fd9\u6837 == \u68c0\u67e5\u503c\u662f\u5426\u76f8\u7b49\uff0cis \u68c0\u67e5\u503c\u662f\u5426\u76f8\u540c \u89c2\u5bdf pythontutor.com \u51fd\u6570\u53c2\u6570\u4f20\u9012\u53ea\u6709\u201c\u5171\u4eab\u4f20\u53c2\u201d\u4e00\u79cd\u5f62\u5f0f\uff08\u5373\u4f20\u5f15\u7528\uff09 \u53ef\u53d8\u53d8\u91cf\uff08\u4f8b\u5982\u5217\u8868\uff09\u5728\u51fd\u6570\u5185\u90e8\u53ef\u4ee5\u88ab\u6539\u53d8 \u907f\u514d\u5411\u51fd\u6570\u4f20\u9012\u53ef\u53d8\u53d8\u91cf\uff08\u5217\u8868\u53ef\u4f20\u5165 [:] \u521b\u5efa\u7684\u526f\u672c\uff09 \u533f\u540d\u51fd\u6570 \u00b6 \u53ef\u4ee5\u901a\u8fc7 lambda \u8868\u8fbe\u5f0f\u6765\u5b9a\u4e49\u533f\u540d\u51fd\u6570 lambda \u8f93\u5165: \u8f93\u51fa\u8868\u8fbe\u5f0f \u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165 \u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf \u907f\u514d\u7528 lambda \u8d4b\u503c\u7684\u5f62\u5f0f\u5b9a\u4e49\u51fd\u6570 \u4f8b\u5982 __name__ \u5c5e\u6027\u4e0d\u4f1a\u662f\u51fd\u6570\u540d\uff0c\u800c\u662f \"\\\" lambda a : a ** 2 + 2 * a + 1 ( lambda a : a ** 2 + 2 * a + 1 )( 2 ) # 9 lambda a , b : a * 2 + b f = lambda a : a ** 2 + 2 * a + 1 ## \u8fd1\u4f3c\u7b49\u4ef7\u4e8e def f ( a ): return a ** 2 + 2 * a + 1 \u7528\u6237\u8f93\u5165 \u00b6 \u8bfb\u53d6\u7528\u6237\u8f93\u5165\u4f7f\u7528\u5185\u7f6e\u7684 input \u51fd\u6570 \u51fd\u6570\u53c2\u6570\u4e3a\u8981\u663e\u793a\u7684\u63d0\u793a\u7b26\uff0c\u4f8b\u5982 input(\"> \") \u51fd\u6570\u7684\u8fd4\u56de\u503c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32 \u6bcf\u6b21\u8bfb\u5165\u4e00\u884c\uff08\u5373\u8bfb\u5230\u6362\u884c\u4e3a\u6b62\uff09 \u9ad8\u9636\u51fd\u6570\u7528\u6cd5 \u00b6 \u63a5\u6536\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u7684\u51fd\u6570\u88ab\u79f0\u4e3a\u9ad8\u9636\u51fd\u6570 \u6bd4\u8f83\u5e38\u7528\u7684\u6709 map\u3001filter list ( map ( lambda x : x * 2 , [ 1 , 2 ])) ## [2, 4] list ( filter ( lambda x : x > 1 , [ 1 , 2 , 3 ])) ## [2, 3] \u7c7b\u4e0e\u9762\u5411\u5bf9\u8c61 \u00b6 \u7c7b \u00b6 \u7c7b\u53ef\u4ee5\u770b\u6210\u5305\u542b\u4e00\u4e9b \u5c5e\u6027 \u548c \u65b9\u6cd5 \u7684\u6846\u67b6 \u6839\u636e\u7c7b\u6765\u521b\u5efa\u5bf9\u8c61 -> \u5b9e\u4f8b\u5316 \u7528 class \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u7c7b \u7c7b\u4e2d\u7684\u51fd\u6570 -> \u65b9\u6cd5 \u7279\u6b8a\u65b9\u6cd5 __init__\uff0c\u5728\u7c7b\u5b9e\u4f8b\u5316\u7684\u65f6\u5019\u4f1a\u88ab\u81ea\u52a8\u8c03\u7528 \u5176\u5b83\u4e00\u822c\u7684\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u90fd\u8981\u4e3a\"self\"\uff0c\u8c03\u7528\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u4f20\u5165 \u76f4\u63a5\u5199\u5728\u7c7b\u4e2d\u7684\u662f\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e3a self.\\ \u8d4b\u503c\u7684\u5f62\u5f0f\u521b\u5efa\u5c5e\u6027 \u7528\u7c7b\u4f3c\u51fd\u6570\u8c03\u7528\u7684\u5f62\u5f0f\u5b9e\u4f8b\u5316\u7c7b\uff0c\u53c2\u6570\u4e3a__init__\u65b9\u6cd5\u7684\u53c2\u6570 \u76f4\u63a5\u901a\u8fc7 .\\ .\\ \u7684\u5f62\u5f0f\u8c03\u7528\u65b9\u6cd5/\u83b7\u53d6\u5c5e\u6027 class ClassName (): a = 1 def __init__ ( self , arg1 , arg2 ): self . arg1 = arg1 self . arg2 = arg2 def method ( self ): print ( self . arg1 , self . arg2 , self . a ) obj = ClassName ( 2 , 3 ) obj . method () # 2 3 1 print ( obj . a , obj . arg1 ) # 1 2 \u7c7b\u7684\u7ee7\u627f \u00b6 \u5728 class \u5b9a\u4e49\u7684\u62ec\u53f7\u4e2d\u52a0\u4e0a\u53e6\u4e00\u4e2a\u7c7b\u540d\u5219\u8868\u793a\u7ee7\u627f\u81ea\u90a3\u4e2a\u7c7b\u5b9a\u4e49\u4e00\u4e2a\u5b50\u7c7b \u5b50\u7c7b\u4f1a\u7ee7\u627f\u7236\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5 \u5b50\u7c7b\u7f16\u5199\u548c\u7236\u7c7b\u540d\u5b57\u4e00\u6837\u7684\u65b9\u6cd5\u4f1a \u91cd\u8f7d \u5728\u91cd\u8f7d\u7684\u65b9\u6cd5\u4e2d\u8c03\u7528\u7236\u7c7b\u7684\u539f\u65b9\u6cd5\u4f7f\u7528 super() \u4e5f\u53ef\u4ee5\u4e3a\u5b50\u7c7b\u5b9a\u4e49\u72ec\u6709\u7684\u65b9\u6cd5 class ClassA (): def __init__ ( self , a ): self . a = a def print ( self ): print ( self . a ) class ClassB ( ClassA ): def __init__ ( self , a ): super () . __init__ ( a ) self . a *= 2 obj = ClassB ( 1 ) obj . print () # 2 \u79c1\u6709\uff1f \u00b6 python \u4e2d\u7c7b\u5e76\u6ca1\u6709\u4e25\u683c\u79c1\u6709\u7684\u5c5e\u6027 \u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u4f1a\u88ab\u9690\u85cf\uff0c\u4e0d\u80fd\u76f4\u63a5\u8bfb\u53d6 \u4f46\u8fd9\u79cd\u5c5e\u6027\u53ef\u4ee5\u901a\u8fc7 _\u7c7b\u540d__\u5c5e\u6027 \u4f46\u65b9\u5f0f\u8bfb\u53d6\u5230 \u4f7f\u7528\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u53ef\u4ee5\u8f7b\u5fae\u4fdd\u62a4\u5c5e\u6027\uff0c\u4f46\u5e76\u4e0d\u4ee3\u8868\u5176\u662f\u79c1\u6709\u7684 class A (): a = 1 _a = 2 __a = 3 obj = A () print ( obj . a ) # 1 print ( obj . _a ) # 2 print ( obj . __a ) # AttributeError print ( obj . _A__a ) # 3 \u4e00\u5207\u7686\u5bf9\u8c61\uff1f \u00b6 python \u4e2d\u5373\u4f7f\u6700\u7b80\u5355\u7684\u6574\u6570\u4e5f\u662f\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b \u901a\u8fc7 dir(...) \u67e5\u770b\u4e00\u4e2a\u5bf9\u8c61\u7684\u6240\u6709\u5c5e\u6027/\u65b9\u6cd5 \u6709\u5f88\u591a\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u3001\u53cc\u4e0b\u5212\u7ebf\u7ed3\u5c3e\u7684\u65b9\u6cd5\uff0c\u6210\u4e3a\u9b54\u672f\u65b9\u6cd5\uff08dunder method\uff09 \u9b54\u672f\u65b9\u6cd5 \u00b6 \u5f88\u591a\u51fd\u6570\u3001\u8868\u8fbe\u5f0f\u5176\u5b9e\u662f\u901a\u8fc7\u8c03\u7528\u7c7b\u7684\u9b54\u672f\u65b9\u6cd5\u6765\u5b9e\u73b0\u7684 len(obj) \u8c03\u7528 obj.__len__() obj[...] \u8c03\u7528 obj.__getitem__(...) a in obj \u8c03\u7528 obj.__contains__(a) bool(obj) \u8c03\u7528 obj.__bool__() \u51fd\u6570\u7684\u8c03\u7528\u672c\u8d28\u4e0a\u662f\u8c03\u7528 func.__call__() a + b \u8c03\u7528 a.__add__(b) \u2026\u2026 \u4e00\u4e2a\u4f8b\u5b50\uff1a lst[a:b:c] \u5207\u7247\u64cd\u4f5c \u5176\u4e2d\u5207\u7247\u4e5f\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5b83\u662f\u4e00\u4e2a slice \u7c7b\u7684\u5b9e\u4f8b \u6240\u4ee5\u5b83\u7b49\u4ef7\u4e8e lst[slice(a, b, c)] \u800c\u901a\u8fc7 [] \u7684\u64cd\u4f5c\u53c8\u662f\u901a\u8fc7 __getitem__ \u9b54\u672f\u65b9\u6cd5\u5b9e\u73b0\u7684 \u6240\u4ee5\u5b83\u53c8\u7b49\u4ef7\u4e8e lst.__getitem__(slice(a, b, c)) __getitem__ \u65b9\u6cd5\u4e2d\u5904\u7406\u4e86 slice\uff0c\u8bfb\u53d6 abc \u7684\u503c\uff0c\u518d\u5904\u7406\u8fd4\u56de\u4e00\u4e2a\u65b0\u5217\u8868 \u6742\u9879\u5185\u5bb9 \u00b6 \u6587\u4ef6\u64cd\u4f5c \u00b6 open \u51fd\u6570\uff0c\u4f20\u5165\u6587\u4ef6\u540d\u3001\u6253\u5f00\u6a21\u5f0f \u6253\u5f00\u6a21\u5f0f\uff08\u53ef\u4ee5\u53e0\u52a0\uff09\uff1ar \u8bfb\uff08\u9ed8\u8ba4\uff09\u3001w \u5199\u3001x \u521b\u5efa\u5e76\u5199\u3001a \u5199\u5728\u672b\u5c3e\u3001b \u5b57\u8282\u6a21\u5f0f\u3001t \u6587\u672c\u6a21\u5f0f\uff08\u9ed8\u8ba4\uff09 \u8bfb\u53d6 \u6587\u672c\u6a21\u5f0f\u5efa\u8bae\u52a0\u4e0a encoding\uff0c\u4e0d\u7136\u5bb9\u6613\u62a5\u9519 f.read() \u8bfb\u53d6\u5168\u90e8\u5185\u5bb9\uff08\u5b57\u8282\u6a21\u5f0f\u5f97\u5230\u5b57\u8282\u5e8f\u5217\uff09 f.readline() \u8bfb\u53d6\u4e00\u884c f.readlines() \u8bfb\u53d6\u6240\u6709\u884c\uff0c\u8fd4\u56de\u4e00\u4e2a\u5217\u8868 \u5199\u5165 \u6587\u672c\u6a21\u5f0f\u540c\u6837\u5efa\u8bae\u52a0\u4e0a encoding f.write(...) \u76f4\u63a5\u5199\u5165 f.writelines(...) \u4f20\u5165\u5217\u8868\uff0c\u5143\u7d20\u95f4\u6362\u884c\u5199\u5165 \u901a\u8fc7\u8fd9\u79cd\u5f62\u5f0f\u64cd\u4f5c\u6587\u4ef6\u8bb0\u5f97\u7528\u5b8c\u540e\u8981 f.close() f = open ( \"filename\" , \"r\" , encoding = \"utf-8\" ) s = f . read () # a str ## line = f.readline() # a str ## lines = f.readlines() # a list ... f . close () f = open ( \"filename\" , \"w\" , encodeing = \"utf-8\" ) f . write ( \"...\" ) f . writelines ([ \"...\" , \"...\" ]) ... f . close () with \u5757 \u00b6 with ... as ...: \u5f00\u542f\u4e00\u4e2a\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668 \u5e38\u7528\u5728\u6587\u4ef6 open \u4e0a with \u5757\u5f00\u59cb\u81ea\u52a8\u6253\u5f00 with \u5757\u7ed3\u675f\u81ea\u52a8\u7ed3\u675f with \u5757\u7ed3\u675f\u540e\u53d8\u91cf\u4ecd\u4f1a\u7559\u5b58 with open ( \"file\" , \"r\" , encoding = \"utf-8\" ) as f : s = f . read () ... print ( f . closed ) # True \u5f02\u5e38\u4e0e\u5904\u7406 \u00b6 \u4ea7\u751f\u9519\u8bef -> \u629b\u51fa\u5f02\u5e38 -> \u7a0b\u5e8f\u7ed3\u675f raise \u5173\u952e\u5b57\u629b\u51fa\u5f02\u5e38 try-except \u5757\u6355\u83b7\u5f02\u5e38 \u53ef\u4ee5\u6709\u591a\u4e2a except\u3001\u4e0d\u53ef\u4ee5\u6ca1\u6709 except \u540e\u63a5\u5f02\u5e38\u7c7b\uff08\u6ca1\u6709\u5219\u6355\u83b7\u6240\u6709\uff09 as \u5b57\u53e5\u5b58\u4e0b\u5f02\u5e38 finally \u8bed\u53e5 \u4e0d\u7ba1\u662f\u5426\u6709\u5f02\u5e38\u90fd\u4f1a\u8fd0\u884c raise ... raise RuntimeError ( \"...\" ) try : input ( \">>> \" ) except KeyboardInterrupt : print ( \"Good bye\" ) try : print ( 1 / 0 ) except ZeroDivisionError as e : print ( \"can't devide by zero\" ) raise e finally : print ( \"finished\" ) if \u5916\u7684 else \u8bed\u53e5 \u00b6 else \u5757\u4e0d\u4ec5\u4ec5\u8ddf\u7740 if \u624d\u80fd\u4f7f\u7528 for-else for \u5faa\u73af\u7ed3\u675f\u624d\u4f1a\u8fd0\u884c for \u5faa\u73af\u88ab break \u4e86\u4e0d\u4f1a\u8fd0\u884c while-else condition \u4e0d\u6210\u7acb\u9000\u51fa\u624d\u4f1a\u8fd0\u884c \u5faa\u73af\u88ab break \u7ec8\u6b62\u4e86\u4e0d\u4f1a\u8fd0\u884c try-else try \u5757\u4e2d\u6ca1\u6709\u5f02\u5e38\u51fa\u73b0\u624d\u4f1a\u8fd0\u884c else \u5757\u4e2d\u5f02\u5e38\u4e0d\u4f1a\u88ab\u524d\u9762\u7684 except \u6355\u83b7 \u7a0b\u5e8f\u6d41\u8df3\u5230\u5757\u5916\u4e86\u4e0d\u4f1a\u8fd0\u884c\uff08return \u7b49\uff09 for value in lst : ... else : ... while condition : ... else : ... try : ... except ... : ... else : ... \u6a21\u5757\u4e0e\u5bfc\u5165 \u00b6 \u6a21\u5757\u53ef\u4ee5\u662f\u4e00\u4e2a\u5355\u72ec\u7684 .py \u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u6587\u4ef6\u5939 \u6587\u4ef6\u5939\u76f8\u5f53\u4e8e\u5bfc\u5165\u5176\u4e0b __init__.py \u6587\u4ef6 \u6a21\u5757\u4e2d\u6b63\u5e38\u7f16\u5199\u51fd\u6570\u3001\u7c7b\u3001\u8bed\u53e5 \u901a\u8fc7 import \u8bed\u53e5\u5bfc\u5165\u6a21\u5757 import code import code as cd from code import ... from code import * \u5bfc\u5165\u65f6\u76f8\u5f53\u4e8e\u8fd0\u884c\u4e86\u4e00\u904d\u5bfc\u5165\u7684\u4ee3\u7801 ## code.py print ( \"hello\" ) def f (): print ( \"call func in code.py\" ) ... import code # hello code . f () import code as cd # hello cd . f () from code import f # hello f () from code import * # hello f () \u201dmain \u51fd\u6570\u201c \u00b6 \u9632\u6b62\u5bfc\u5165\u65f6\u8fd0\u884c\u4ee3\u7801 \u53ea\u5141\u8bb8\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u65f6\u8fd0\u884c \u901a\u8fc7\u5224\u65ad __name__ \u5982\u679c\u662f\u76f4\u63a5\u8fd0\u884c\uff0c\u5219\u5176\u7b49\u4e8e\u5b57\u7b26\u4e32 __main__ \u5982\u679c\u662f\u88ab\u5bfc\u5165\u7684\uff0c\u5219\u5176\u7b49\u4e8e\u6a21\u5757\u540d ## code.py ... if __name__ == \"__main__\" : print ( \"hello\" ) else : print ( __name__ ) import code # code $ python code.py # hello \u5185\u90e8\u6a21\u5757 \u00b6 python \u81ea\u5e26\u4e86\u5f88\u591a\u5b9e\u7528\u7684\u6a21\u5757\uff08\u6807\u51c6\u5e93\uff09 os\u3001sys\uff1a\u7cfb\u7edf\u64cd\u4f5c math\uff1a\u6570\u5b66\u8fd0\u7b97 re\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f datetime\uff1a\u65e5\u671f\u4e0e\u65f6\u95f4 subprocess\uff1a\u5b50\u8fdb\u7a0b\u7ba1\u7406 argparse\uff1a\u547d\u4ee4\u884c\u53c2\u6570\u89e3\u6790 logging\uff1a\u65e5\u5fd7\u8bb0\u5f55 hashlib\uff1a\u54c8\u5e0c\u8ba1\u7b97 random\uff1a\u968f\u673a\u6570 csv\u3001json\uff1a\u6570\u636e\u683c\u5f0f\u89e3\u6790 collections\uff1a\u66f4\u591a\u7c7b\u578b ... \u770b\u6587\u6863\uff1a docs.python.org/zh-cn/3/library \u5916\u90e8\u6a21\u5757\u5b89\u88c5 \u00b6 pypi.org \u4e0a\u6709\u6781\u591a\u522b\u4eba\u5199\u597d\u4e86\u53ef\u4ee5\u7528\u7684\u6a21\u5757 numpy \u77e9\u9635\u7b49\u79d1\u5b66\u8ba1\u7b97\u3001scipy \u79d1\u5b66\u8ba1\u7b97\u3001matplotlib \u4f5c\u56fe\u2026\u2026 \u4f7f\u7528 pip \u5b89\u88c5\uff08pip / python -m pip\uff09 pip install pkg_name pip install pkg_name=... \u6307\u5b9a\u7248\u672c pip install -r requirements.txt \u5b89\u88c5 txt \u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5305 pip install ... -i https://pypi.tuna.tsinghua.edu.cn/simple \u6362\u6e90 pip list\u3001pip show \u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u7684\u6240\u6709\u5305/\u67d0\u4e2a\u5305\u7684\u4fe1\u606f pip uninstall pkg_name \u5378\u8f7d\u5305 pip \u5b89\u88c5\u672c\u5730\u6a21\u5757 \u76ee\u5f55\u4e0b\u9700\u8981\u5305\u542b setup.py / pyproject.toml pip install . \u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u590d\u5236\u5230 site-packages \u4e2d\uff09 pip install -e . \u53ef\u4fee\u6539\u5f62\u5f0f\u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u5728\u5f53\u524d\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u4ee3\u7801\uff09 \u6587\u6863\u5b57\u7b26\u4e32 \u00b6 \u6a21\u5757\u5f00\u5934\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 \u7c7b\u3001\u51fd\u6570\u5b9a\u4e49\u4e0b\u9762\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 help(...) \u7684\u65f6\u5019\u53ef\u4ee5\u663e\u793a obj.__doc__ \u8868\u793a\u8fd9\u4e32\u5b57\u7b26\u4e32 \u7f16\u8f91\u5668\u7528\u6765\u63d0\u793a \u4e00\u4e9b\u6587\u6863\u751f\u6210\u5de5\u5177\uff08sphinx \u7b49\uff09\u4ece\u4e2d\u83b7\u53d6\u6587\u6863 \"\"\" docstring for module \"\"\" def func ( ... ): \"\"\"docstring for function\"\"\" ... class A (): \"\"\"docstring for class\"\"\" def __init__ ( self , ... ): \"\"\"docstring for method\"\"\" ... \u4ee3\u7801\u89c4\u8303 \u00b6 PEP\uff1aPython Enhancement Proposals\uff1a peps.python.org PEP 8 \u89c4\u8303\uff0c\u7ed9\u51fa\u4e86\u63a8\u8350\u4f7f\u7528\u7684 python \u4ee3\u7801\u98ce\u683c\u89c4\u8303 peps.python.org/pep-0008 pep8.org \u66f4\u7ec6\u81f4\u7684\u4ee3\u7801\u98ce\u683c black github.com/psf/black flake8 flake8.pycqa.org ... Referencce \u00b6 Python3 \u83dc\u9e1f\u6559\u7a0b Python \u5b98\u65b9\u6587\u6863 Python\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\uff08\u7b2c2\u7248\uff09 Python \u8bed\u6cd5\u57fa\u7840","title":"Python \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/python/basic/#python","text":"Abstract copy from TonyCrane/note","title":"Python \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/python/basic/#python_1","text":"\u89e3\u91ca\u6027\u7684\u811a\u672c\u8bed\u8a00\uff1a\u901a\u8fc7\u89e3\u91ca\u5668\u6765\u76f4\u63a5\u8fd0\u884c\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\u94fe\u63a5\u6210\u4e8c\u8fdb\u5236\u6587\u4ef6 \u52a8\u6001\u7c7b\u578b\u8bed\u8a00\uff1a\u7c7b\u578b\u5728\u8fd0\u884c\u65f6\u786e\u5b9a\uff0c\u4e0d\u9700\u8981\u901a\u8fc7\u4ee3\u7801\u660e\u6587\u89c4\u5b9a \u9762\u5411\u5bf9\u8c61\u8bed\u8a00\uff1apython \u4e2d\u4e00\u5207\u7686\u5bf9\u8c61 ...","title":"\u4ec0\u4e48\u662f python"},{"location":"cs/pl/python/basic/#python_2","text":"\u88c5\u7684\u662f\u4ec0\u4e48\uff1f \u662f\u4e00\u4e2a python \u89e3\u91ca\u5668\uff0c\u4ee5\u53ca\u8fd0\u884c\u9700\u8981\u7684\u73af\u5883 \u600e\u4e48\u88c5\uff1f \u5b98\u65b9\u7f51\u7ad9 https://www.python.org/downloads/ conda\uff08\u4e00\u4e2a\u597d\u7528\u7684 python \u73af\u5883\u7ba1\u7406\u5de5\u5177\uff09 anaconda \uff08\u5927\u3001\u6709\u9884\u88c5\u73af\u5883\uff09 https://www.anaconda.com/ miniconda \uff08\u5c0f\uff09 https://docs.conda.io/en/latest/miniconda \u6781\u4e0d\u5efa\u8bae\u901a\u8fc7\u5fae\u8f6f\u5e94\u7528\u5546\u5e97\u5b89\u88c5 python \u88c5\u4ec0\u4e48\u7248\u672c\uff1f \u4e24\u4e2a\u5927\u7248\u672c\uff0c2.* \u548c 3.*\uff0c\u5dee\u522b\u8f83\u5927\uff0c\u5efa\u8bae 3.* \u4e00\u4e9b\u5c0f\u7248\u672c\uff0c3.6 \u53ca\u4e4b\u524d\u4e0d\u63a8\u8350\uff0c3.7 3.8 \u7a33\u5b9a\uff0c3.9 3.10 \u5b8c\u5584\u4e2d\uff0c3.11 \u9884\u89c8\u4e2d \u7ec6\u5206\u7248\u672c\uff0c\u9009\u62e9\u6700\u65b0\uff0c3.7.13\u30013.8.13\u30013.9.12\u30013.10.4 conda \u4e0d\u5fc5\u62c5\u5fc3\u7248\u672c\uff0c\u9ed8\u8ba4 3.9\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u4f7f\u7528\u4e0d\u540c\u7248\u672c","title":"\u600e\u4e48\u88c5 python"},{"location":"cs/pl/python/basic/#python_3","text":"\u600e\u4e48\u7528 python\uff1f \u8bb0\u4f4f\u4f60\u4e0b\u8f7d\u7684\u662f\u4e00\u4e2a\u89e3\u91ca\u5668\uff0c\u5efa\u8bae\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c python code.py \u4ec0\u4e48\u662f\u547d\u4ee4\u884c\uff1f \u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u901a\u77e5\u7535\u8111\u6267\u884c\u67d0\u6307\u4ee4\u3001\u6216\u8005\u8fd0\u884c\u67d0\u7a0b\u5e8f Windows\uff1acmd\u3001Powershell -> \u5355\u72ec\u8fd0\u884c / Windows Terminal /... macOS\uff1azsh\u3001... -> \u7ec8\u7aef / iTerm /... Linux\uff1abash\u3001zsh\u3001... -> \u7ec8\u7aef / ... \u7528\u4ec0\u4e48\u5199\u4ee3\u7801\uff1f \u8bb0\u4f4f\u4f60\u7f16\u5199\u7684\u53ea\u662f\u4e00\u4e2a .py \u4f5c\u4e3a\u6269\u5c55\u540d\u7684\u6587\u672c\u6587\u4ef6 \u53ea\u8981\u6587\u672c\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u5199 \u8bb0\u4e8b\u672c\u3001\u81ea\u5e26 IDLE\u3001word Notepad++\u3001Sublime Text VSCode\uff08Visual Studio Code\uff0c\u4e0d\u662f VS\uff09code.visualstudio.com Pycharm\uff08Community Edition \u5c31\u591f\u7528\uff09jetbrains.com/pycharm","title":"\u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c python"},{"location":"cs/pl/python/basic/#_1","text":"","title":"\u6570\u636e\u7c7b\u578b"},{"location":"cs/pl/python/basic/#_2","text":"\u6574\u578bint\uff0c\u6d6e\u70b9\u578bfloat\uff0c\u590d\u6570complex\uff08c.real\u8868\u793a\u5b9e\u90e8\uff0cc.imag\u8868\u793a\u865a\u90e8\uff0cc.conjugate()\u8fd4\u56de\u5171\u8f6d\u590d\u6570\uff09 \u6574\u6570\u4e0e\u6d6e\u70b9\u6570\u8f6c\u6362 int(...)\uff1a\u54110\u820d\u5165 round(...)\uff1a\u5411\u5076\u820d\u5165\uff08\u56db\u820d\u516d\u5165\u4e94\u51d1\u5076\uff0c\u53ef\u4ee5\u5f53\u6210\u56db\u820d\u4e94\u5165\uff09 math.floor(...)\u3001math.ceil(...)\uff1a\u4e0b\u53d6\u6574\u3001\u4e0a\u53d6\u6574\uff08\u9700\u8981 import math\uff09 \u8fd0\u7b97 \u5bf9\u4e8e+ - *\u52a0\u51cf\u4e58\uff0c\u5982\u679c\u90fd\u662f\u6574\u6570\uff0c\u90a3\u7ed3\u679c\u4e5f\u662f\u6574\u6570\uff0c\u5b58\u5728\u6d6e\u70b9\u6570\uff0c\u5219\u7ed3\u679c\u662f\u6d6e\u70b9\u6570 \u5bf9\u4e8e/\u9664\uff0c\u7ed3\u679c\u662f\u6d6e\u70b9\u6570\uff0c\u5bf9\u4e8e//\uff0c\u7ed3\u679c\u662f\u6574\u6570\uff08\u5411\u4e0b\u53d6\u6574\uff09 \u5bf9\u4e8e%\u53d6\u6a21\uff0c a%b == a-(a//b)*b \u5bf9\u4e8e**\u4e58\u65b9\uff0c\u53ef\u4ee5\u662fa ** 0.5\uff0c\u6216 a ** 2 \u5bf9\u4e8e pow(a,b,mod) \u4e58\u65b9\uff0cmod\u53ef\u7701\u7565\uff0c\u5982\u679cmod\u4e3a-1\u5373\u4e3a\u4e58\u6cd5\u9006\u5143 \u66f4\u591a\u8fd0\u7b97\u901a\u8fc7 math\u3001numpy\u3001scipy \u7b49\u5305\u6765\u8fdb\u884c","title":"\u6570\u5b57\u4e0e\u8fd0\u7b97"},{"location":"cs/pl/python/basic/#_3","text":"Python \u4e0d\u652f\u6301\u5355\u5b57\u7b26\u7c7b\u578b\uff0c\u5355\u5b57\u7b26\u5728 Python \u4e2d\u4e5f\u662f\u4f5c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f7f\u7528\u3002 \u5355\u5f15\u53f7 '...'\uff0c\u53cc\u5f15\u53f7 \"...\"\uff0c\u4e09\u5f15\u53f7 '''...''' \"\"\"...\"\"\"\uff08\u53ef\u4ee5\u5185\u90e8\u6362\u884c\uff09 \u4e09\u5f15\u53f7 str = \"\"\"\"\"\" \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( \\ t ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ \\ n ] \u3002 \"\"\" print(str) \u8f93\u51fa\u4e3a\uff1a \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ ] \u3002 \u524d\u7f00 r-string\uff1ar\"...\"\uff0c\u5f15\u53f7\u4e2d\u4e0d\u8fdb\u884c\u8f6c\u4e49\uff0c\u5373\u4e00\u4e2a/\u5c31\u4ee3\u8868\u659c\u6760\u5b57\u7b26\u672c\u8eab f-string\uff1af\"...\"\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32 b-string\uff1ab\"...\"\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a bytes\uff0c\u53ea\u80fd\u5305\u542b ASCII \u5b57\u7b26 \u5e38\u7528\u65b9\u6cd5 \u62fc\u63a5\uff1a\u76f4\u63a5\u5c06\u5b57\u7b26\u4e32\u201c\u76f8\u52a0\u201d \"...\".upper()\u3001\"...\".lower() \uff1a\u8f6c\u4e3a\u5168\u5927\u5199\u3001\u5168\u5c0f\u5199 \"...\".title() \uff1a\u5355\u8bcd\u9996\u5b57\u6bcd\u5927\u5199 \"...\".count(str) \uff1a\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2dstr\u51fa\u73b0\u7684\u6b21\u6570 \"...\".strip() \uff1a\u5220\u9664\u5b57\u7b26\u4e32\u9996\u5c3e\u7a7a\u767d\uff08\u5305\u542b\u7a7a\u683c\u548c\u5236\u8868\u7b26\uff09 \"...\".lstrip()\u3001\"...\".rstrip() \uff1a\u5220\u9664\u5de6\u3001\u53f3\u7aef\u7a7a\u767d\u6216\u6307\u5b9a\u5b57\u7b26 \"...\".replace(old, new) \uff1a\u5b57\u7b26\u4e32\u4e2d old \u66ff\u6362\u6210 new \"...\".split(c) \uff1a\u6839\u636e\u5b57\u7b26 c \u6765\u62c6\u5206\u5b57\u7b26\u4e32\u5f97\u5230\u5217\u8868\uff0c\u9ed8\u8ba4\u62c6\u5206\u7a7a\u767d f-string \u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u65b9\u5f0f\uff1a\"...\" % ...\uff0c\"...\".format(...)\uff0cf\"...\" f-string\u7528\u5927\u62ec{ }\u8868\u793a\u88ab\u66ff\u6362\u5b57\u6bb5\uff0c\u5176\u4e2d\u76f4\u63a5\u586b\u5165\u66ff\u6362\u5185\u5bb9\u5373\u53ef f-string\u7684\u5927\u62ec\u53f7{ }\u53ef\u4ee5\u586b\u5165\u8868\u8fbe\u5f0f\u6216\u8c03\u7528\u51fd\u6570\uff0cPython\u4f1a\u6c42\u51fa\u5176\u7ed3\u679c\u5e76\u586b\u5165\u8fd4\u56de\u7684\u5b57\u7b26\u4e32\u5185 f-string\u4e2d\u4f7f\u7528lambda\u533f\u540d\u51fd\u6570\uff1a\u53ef\u4ee5\u505a\u590d\u6742\u7684\u6570\u503c\u8ba1\u7b97 f-string\u5927\u62ec\u53f7\u5185\u4f7f\u7528\u7684\u5f15\u53f7\u4e0d\u80fd\u548c\u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u5b9a\u754c\u7b26\u5f15\u53f7\u51b2\u7a81\uff0c\u9700\u6839\u636e\u60c5\u51b5\u7075\u6d3b\u5207\u6362\u4f7f\u7528\u5355\u5f15\u53f7\u3001\u53cc\u5f15\u53f7\u3001\u5355\u4e09\u5f15\u53f7\u3001\u53cc\u4e09\u5f15\u53f7 \u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u8fd8\u53ef\u4ee5\u4f7f\u7528\\\u8f6c\u4e49\uff0c\u4f46\u5927\u62ec\u53f7\u5185\u4e0d\u80fd\u4f7f\u7528\\\u8f6c\u4e49 f-string\u5927\u62ec\u53f7\u5916\u5982\u679c\u9700\u8981\u663e\u793a\u5927\u62ec\u53f7\uff0c\u5219\u5e94\u8f93\u5165\u8fde\u7eed\u4e24\u4e2a\u5927\u62ec\u53f7{{ }}\uff1b\u5927\u62ec\u53f7\u5185\u9700\u8981\u5f15\u53f7\uff0c\u4f7f\u7528\u5f15\u53f7\u5373\u53ef f-string\u9488\u5bf9date\u3001datetime\u548ctime\u5bf9\u8c61\uff0c\u8fdb\u884c\u5e74\u6708\u65e5\u3001\u65f6\u5206\u79d2\u7b49\u4fe1\u606f\u63d0\u53d6 \u5bbd\u5ea6\u586b\u5145\uff1a:[ \u586b\u5145\u5b57\u7b26 ][ \u5bf9\u9f50\u65b9\u5f0f ][ \u5bbd\u5ea6 ]\uff0c< \u5de6\u5bf9\u9f50\uff0c> \u53f3\u5bf9\u9f50\uff0c^ \u5c45\u4e2d \u5b57\u7b26\u622a\u65ad\uff1a:[...].n\uff0c\u53ea\u663e\u793a\u5b57\u7b26\u4e32\u7684\u524d n \u4e2a\u5b57\u7b26 \u6570\u503c\u7b26\u53f7\uff1a:+ \u6b63\u6570\u52a0\u6b63\u53f7\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7\uff0c:- \u539f\u6837\uff0c: \uff08\u7a7a\u683c\uff09\u6b63\u6570\u52a0\u7a7a\u683c\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7 \u6570\u503c\u7cbe\u5ea6\uff1a:[ \u5bbd\u5ea6 ][ \u5206\u9694\u7b26 (,_)].[ \u7cbe\u5ea6 ]f\uff0c\u6ca1\u6709\u7cbe\u5ea6\u9ed8\u8ba4\u4e3a 6 \u8fdb\u5236\u663e\u793a\uff1ax \u5c0f\u5199\u5341\u516d\u8fdb\u5236\uff0cX \u5927\u5199\u5341\u516d\u8fdb\u5236\uff0co \u516b\u8fdb\u5236\uff0cb \u4e8c\u8fdb\u5236\uff0c\u52a0 # \u663e\u793a\u524d\u7f00","title":"\u5b57\u7b26\u4e32"},{"location":"cs/pl/python/basic/#_4","text":"\u7c7b\u4f3c\u5b57\u7b26\u4e32\uff0c\u4f46\u5b58\u50a8\u7684\u662f\u5b57\u8282\u7684\u503c\uff0c\u66f4\u50cf\u5217\u8868\uff0c\u663e\u793a\u4e3a b\"...\"\uff0c\u901a\u5e38\u7528\u4e8e\u7f51\u7edc\u6570\u636e\u4f20\u8f93\u3001\u4e8c\u8fdb\u5236\u56fe\u7247\u548c\u6587\u4ef6\u7684\u4fdd\u5b58\u7b49 \u901a\u8fc7bytes()\u751f\u6210bytes\u5b9e\u4f8b\uff0c\u503c\u7684\u5f62\u5f0f\u4e3ab\"...\"\uff0c\u7528\u4e0d\u540c\u7684\u7f16\u7801\u65b9\u5f0f\u4f1a\u5f62\u6210\u4e0d\u540c\u7684\u503c \u4e0e\u5b57\u7b26\u4e32\u8f6c\u6362 \"...\".encode(encoding) \u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4 UTF-8 bytes_obj.decode(encoding) \u6839\u636e encoding \u89e3\u7801\u5b57\u8282\u5e8f\u5217\uff0c\u89e3\u7801\u5931\u8d25\u4f1a\u62a5\u9519 bytes(\"...\", encoding) \u4e5f\u662f\u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32","title":"\u5b57\u8282\u7c7b\u578b"},{"location":"cs/pl/python/basic/#_5","text":"True \u548c False\uff0c \u9996\u5b57\u6bcd\u5927\u5199 \u53ef\u4ee5\u7528bool(...)\u6765\u8f6c\u6362 \u53ef\u4ee5\u7528 & | \u6765\u8868\u793a\u4e0e\u548c\u6216\uff0c\u4e00\u822c\u4f7f\u7528and or not \u8fdb\u884c\u8fd0\u7b97\uff08\u53ef\u7ec4\u5408\uff09","title":"\u5e03\u5c14\u7c7b\u578b"},{"location":"cs/pl/python/basic/#_6","text":"\u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u7684\u6570\u7ec4\uff0c\u4f46\u662f\u529f\u80fd\u66f4\u591a\uff0c\u800c\u4e14\u5185\u90e8\u5143\u7d20\u4e0d\u8981\u6c42\u540c\u4e00\u7c7b\u578b \u65b9\u62ec\u53f7 [] \u8868\u793a\u5217\u8868\uff0c\u5143\u7d20\u7528\u9017\u53f7\u5206\u9694 \u7d22\u5f15\uff08\u5373\u4e0b\u6807\uff09\u4ece 0 \u5f00\u59cb\u8ba1\u6570\uff0clst[n] \u5373\u8868\u793a\u8bbf\u95ee\u7b2c n+1 \u4e2a\u5143\u7d20 \u7d22\u5f15\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u8d1f\u6570\u5373\u8868\u793a\u5012\u6570\uff0c\u4f8b lst[-2] \u8868\u793a\u5012\u6570\u7b2c\u4e8c\u4e2a\u5143\u7d20 \u5207\u7247\uff08\u83b7\u53d6\u5217\u8868\u4e2d\u7684\u4e00\u90e8\u5206\u503c\uff09 lst[a:b]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u7684\u5217\u8868 lst[:b]\uff1a\u4ece\u5f00\u5934\u5230 lst[b-1] \u7684\u5217\u8868 lst[a:]\uff1a\u4ece lst[a] \u5230\u7ed3\u5c3e\u7684\u5217\u8868 lst[:]\uff1a\u8868\u793a\u6574\u4e2a\u5217\u8868\uff08\u62f7\u8d1d\u4e00\u4efd\uff09 lst[a:b:c]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u6bcf c \u4e2a\uff08\u5373\u6b65\u957f\uff09\u53d6\u4e00\u4e2a\u5f62\u6210\u7684\u5217\u8868 c \u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u6b64\u65f6\u9700\u8981 a > b \u624d\u80fd\u83b7\u53d6\u5230\u503c \u6709\u6b65\u957f\u65f6\u82e5\u7701\u7565 a\u3001b \u8bb0\u5f97\u4e0d\u8981\u7701\u7565\u5192\u53f7\uff0c\u4f8b lst[::-1] \u8868\u793a\u5217\u8868\u5012\u5e8f","title":"\u5217\u8868"},{"location":"cs/pl/python/basic/#_7","text":"\u4fee\u6539\u5143\u7d20\uff1a\u76f4\u63a5\u901a\u8fc7\u7d22\u5f15/\u5207\u7247\uff0c\u7136\u540e\u7b49\u53f7\u8d4b\u503c \u6709\u6808\u7684\u529f\u80fd lst.append(...) \u5728\u5217\u8868\u672b\u5c3e\u52a0\u5165\u5143\u7d20 lst.pop() \u5f39\u51fa\u5217\u8868\u672b\u5c3e\u5143\u7d20\u5e76\u8fd4\u56de \u4efb\u610f\u4f4d\u7f6e\u63d2\u5165\u5f39\u51fa lst.insert(i, x) \u5728\u7d22\u5f15 i \u7684\u4f4d\u7f6e\u63d2\u5165 x\uff0c\u540e\u9762\u4f9d\u6b21\u540e\u79fb lst.pop(i) \u5f39\u51fa\u7d22\u5f15 i \u4f4d\u7f6e\u7684\u5143\u7d20\uff0c\u540e\u9762\u4f9d\u6b21\u524d\u79fb \u5217\u8868\u62fc\u63a5 \u76f4\u63a5\u76f8\u52a0\uff0c\u4e0d\u6539\u53d8\u539f\u5217\u8868\uff0c\u5f97\u5230\u65b0\u7684\u5217\u8868 lst.extend([...])\uff0c\u628a\u4e00\u4e2a\u5217\u8868\u63a5\u5230\u5f53\u524d\u5217\u8868\u540e\u9762 \u6839\u636e\u503c\u5220\u9664\u5143\u7d20 lst.remove(value) \u5220\u9664\u7b2c\u4e00\u4e2a\u503c\u4e3a value \u7684\u5143\u7d20 \u6392\u5e8f\u5217\u8868 lst.sort() \u6c38\u4e45\u6392\u5e8f\uff08\u5373\u6392\u5e8f\u540e\u8d4b\u503c\u7ed9\u5f53\u524d\u5217\u8868\uff09 sorted(lst) \u4e34\u65f6\u6392\u5e8f\uff0c\u8fd4\u56de\u6392\u5e8f\u597d\u7684\u65b0\u5217\u8868 \u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927\uff0c\u5982\u679c\u4f20\u5165 reverse=True \u5219\u4ece\u5927\u5230\u5c0f \u53cd\u8f6c\u5217\u8868 lst.reverse() \u6c38\u4e45\u53cd\u8f6c\uff08\u610f\u4e49\u540c\u4e0a\uff09 lst[::-1] \u8fd4\u56de\u53cd\u8f6c\u7684\u5217\u8868\uff08\u5229\u7528\u524d\u9762\u8bf4\u5230\u7684\u5207\u7247\uff09 \u7edf\u8ba1\u64cd\u4f5c len(lst) \u5f97\u5230\u5217\u8868\u7684\u957f\u5ea6 sum(lst) \u5f97\u5230\u5217\u8868\u7684\u5143\u7d20\u548c\uff08\u672c\u8d28\u4e0a\u662f\u5c06 start \u53c2\u6570\u548c\u6bcf\u4e2a\u5143\u7d20\u4f9d\u6b21\u76f8\u52a0\uff09 \u53ef\u4ee5\u4f20\u5165 start \u53c2\u6570\u7528\u6765\u6307\u5b9a\u52a0\u548c\u7684\u8d77\u59cb\u503c max(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5927\u503c min(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5c0f\u503c","title":"\u5217\u8868\u64cd\u4f5c"},{"location":"cs/pl/python/basic/#_8","text":"\u53ef\u4ee5\u770b\u6210\u5143\u7d20\u4e0d\u53ef\u53d8\u7684\u5217\u8868\uff0c\u5185\u90e8\u4e5f\u53ef\u4ee5\u5305\u542b\u4e0d\u540c\u7c7b\u578b\u7684\u5143\u7d20 \u62ec\u53f7\u8868\u793a\u5143\u7ec4\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694 \u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u4e00\u6837\u7684\u65b9\u6cd5\u6765\u8bfb\u53d6\u5143\u7d20\uff0c\u4f46\u5e76\u4e0d\u80fd\u4fee\u6539 \u5f53\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u65f6\u5019\u8981\u5199\u6210 (a,) \u800c\u4e0d\u662f (a)\uff08\u540e\u8005\u662f\u5355\u4e2a\u503c\uff09 \u53ef\u4ee5\u4f7f\u7528 tuple(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff08\u5217\u8868\u3001\u5b57\u7b26\u4e32\u7b49\uff09\u8f6c\u4e3a\u5143\u7ec4 \u5143\u7ec4\u5e76\u4e0d\u80fd\u4fdd\u8bc1\u5143\u7d20\u5b8c\u5168\u4e0d\u53ef\u53d8 \u907f\u514d\u5728\u5143\u7ec4\u4e2d\u5b58\u653e\u53ef\u53d8\u5143\u7d20","title":"\u5143\u7ec4"},{"location":"cs/pl/python/basic/#_9","text":"\u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694\uff0c\u4f1a\u81ea\u52a8\u53bb\u91cd \u53ef\u7528 set(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\u8f6c\u4e3a\u5143\u7ec4\uff0c\u81ea\u52a8\u53bb\u91cd \u96c6\u5408\u4e2d\u4e0d\u80fd\u5305\u542b\u5217\u8868\u7b49\u4e0d\u53ef hash \u5316\u7684\u5143\u7d20 \u4fee\u6539 s.add(...) \u6765\u52a0\u5165\u4e00\u4e2a\u5143\u7d20 s.remove(...) \u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u4f1a\u629b\u51fa\u5f02\u5e38 s.discard(...) \u6765\u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u5219\u5ffd\u7565 \u8fd0\u7b97 s1 & s2\u3001s1 | s2\u3001s1 - s2 \u4ea4\u96c6\u3001\u5e76\u96c6\u3001\u5dee\u96c6 s1 ^ s2 \u5bf9\u79f0\u5dee\u96c6","title":"\u96c6\u5408"},{"location":"cs/pl/python/basic/#_10","text":"\u5b58\u50a8\u952e\u503c\u5bf9\uff0c\u4e5f\u662f\u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u4e0d\u8fc7\u9017\u53f7\u5206\u9694\u7684\u662f\u952e\u503c\u5bf9 {key: value, ...} {} \u662f\u7a7a\u5b57\u5178\u800c\u4e0d\u662f\u7a7a\u96c6\u5408 \u901a\u8fc7 d[key] \u6765\u8bbf\u95ee\u5b57\u5178\u4e2d key \u5bf9\u5e94\u7684\u503c\uff0c\u53ef\u4ee5\u8bfb\u53d6\u3001\u4fee\u6539 \u6dfb\u52a0\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 d[key] = value \u6765\u8fdb\u884c \u5220\u9664\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5 del d[key] \u901a\u8fc7 d[key] \u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728 key \u8fd9\u4e2a\u952e\u4f1a\u629b\u51fa\u5f02\u5e38 \u901a\u8fc7 d.get(key) \u6765\u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728\u5219\u4f1a\u8fd4\u56de None \u4f7f\u7528 d.get(key, default) \u5982\u679c\u6ca1\u6709 key \u65f6\u4f1a\u8fd4\u56de default \u503c d.update(d2) \u6765\u7528 d2 \u4e2d\u7684\u952e\u503c\u5bf9\u66f4\u65b0 d","title":"\u5b57\u5178"},{"location":"cs/pl/python/basic/#_11","text":"","title":"\u6761\u4ef6\u5206\u652f"},{"location":"cs/pl/python/basic/#_12","text":"== \u5224\u65ad\u76f8\u7b49\uff08\u76f8\u7b49\u5219\u8fd4\u56de True\uff09\uff0c != \u5224\u65ad\u4e0d\u7b49 \u4f7f\u7528 and or not \u6765\u8fdb\u884c\u5e03\u5c14\u8fd0\u7b97\uff0c\u5fc5\u8981\u65f6\u52a0\u62ec\u53f7\u4fdd\u8bc1\u4f18\u5148\u7ea7 \u6570\u503c\u6bd4\u8f83\u5927\u5c0f < <= > >= \u5224\u65ad\u5143\u7d20\u662f\u5426\u5728\u5217\u8868\u4e2d value in lst\uff1a\u5982\u679c\u5728\u5219\u503c\u4e3a True value not in lst\uff1a\u5982\u679c\u5728\u5219\u4e3a False\uff08\u5224\u65ad\u662f\u5426\u4e0d\u5728\uff09 \u5224\u65ad\u952e\u662f\u5426\u5728\u5b57\u5178\u4e2d key in d\u3001key not in d \u4e0e\u5217\u8868\u540c\u7406","title":"\u5e03\u5c14\u8868\u8fbe\u5f0f"},{"location":"cs/pl/python/basic/#_13","text":"if-elif-else \u7ed3\u6784\uff08\u4e0d\u662f else if\uff09 elif\u3001else \u5747\u53ef\u4ee5\u7701\u7565 \u6761\u4ef6\u4e0d\u9700\u8981\u52a0\u62ec\u53f7\uff08\u52a0\u4e86\u4e5f\u6ca1\u95ee\u9898\uff09 condition \u4f1a\u88ab\u8f6c\u6362\u6210 bool \u7c7b\u578b\u7136\u540e\u5224\u65ad \u6ce8\u610f\u7f29\u8fdb \u7c7b\u4e09\u76ee\u8fd0\u7b97\u7b26\u5199\u6cd5 a if condition else b \u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u4e2d\u7684 condition? a : b if-elif-else if condition1 : ... elif condition2 : ... elif condition3 : ... else : ...","title":"\u6761\u4ef6\u8bed\u53e5"},{"location":"cs/pl/python/basic/#_14","text":"\u7f29\u8fdb\u662f python \u4e2d\u5f88\u91cd\u8981\u7684\u4e1c\u897f\uff0cpython \u9760\u7f29\u8fdb\u6765\u5f97\u5230\u4ee3\u7801\u7ed3\u6784\uff0c\u800c\u4e0d\u662f\u5927\u62ec\u53f7 \u7f29\u8fdb\u53ef\u4ee5\u4f7f\u7528\u7a7a\u683c\u6216\u5236\u8868\u7b26 \u5982\u679c\u4e00\u4e9b\u4ee3\u7801\u5904\u4e8e\u540c\u4e00\u5c42\u7f29\u8fdb\u4e0b\uff0c\u5219\u5c5e\u4e8e\u540c\u4e00\u4e2a\u4ee3\u7801\u5757 \u540c\u4e00\u4e2a\u4ee3\u7801\u5757\u7684\u7f29\u8fdb\u8981\u7edf\u4e00 \u4e0d\u4ec5\u4ec5\u662f\u770b\u7740\u50cf\uff0c\u8981\u533a\u5206\u597d\u7a7a\u683c\u4e0e\u5236\u8868\u7b26 4 \u4e2a\u7a7a\u683c\u4e0e\u4e00\u4e2a\u663e\u793a\u5bbd\u5ea6\u4e3a 4 \u7684\u5236\u8868\u7b26\u5e76\u4e0d\u662f\u540c\u4e00\u7f29\u8fdb \u4e00\u822c\u4f7f\u7528 4 \u7a7a\u683c\u7f29\u8fdb\uff0c\u6216\u8005 1 \u5236\u8868\u7b26\u7f29\u8fdb \u7f16\u8f91\u5668\u4e2d\u6309 Tab \u6253\u51fa\u7684\u4e5f\u4e0d\u4e00\u5b9a\u662f\u5236\u8868\u7b26\uff0c\u8981\u5206\u6e05 \u7f29\u8fdb\u4e0d\u6b63\u786e\u4f1a\u62a5 IndentationError\uff0c\u6b64\u65f6\u6ce8\u610f\u68c0\u67e5\u7f29\u8fdb","title":"\u7f29\u8fdb"},{"location":"cs/pl/python/basic/#_15","text":"","title":"\u5faa\u73af"},{"location":"cs/pl/python/basic/#for","text":"python \u4e2d\u7684 for \u5faa\u73af\u5e76\u4e0d\u50cf c \u4e2d\u662f\u6307\u5b9a\u4e00\u4e2a\u53d8\u91cf\u7684\u53d8\u5316\u65b9\u5f0f\uff0c\u800c\u662f\u4ece\u5217\u8868/\u5143\u7ec4/\u8fed\u4ee3\u5668\u7b49\u53ef\u8fed\u4ee3\u5bf9\u8c61\u4e2d\u904d\u5386\u503c for \u5faa\u73af\u4f1a\u4ea7\u751f\u4e00\u4e2a\u7528\u4e8e\u5faa\u73af\u7684\u53d8\u91cf\uff0c\u8fd9\u4e2a\u53d8\u91cf\u5728\u5faa\u73af\u7ed3\u675f\u540e\u5e76\u4e0d\u4f1a\u5220\u9664\uff0c\u800c\u662f\u4fdd\u7559\u6700\u540e\u4e00\u6b21\u7684\u503c \u53ef\u4ee5\u4f7f\u7528 range \u6765\u751f\u6210\u4e00\u4e32\u6570\u5b57\u7528\u6765\u5faa\u73af range(a, b) \u751f\u6210\u4ece a \u5230 b-1 \u7684\u8fde\u7eed\u6574\u6570 range(a, b, c) \u4ee5 c \u4e3a\u6b65\u957f\u751f\u6210 range \u5f97\u5230\u7684\u5e76\u4e0d\u662f\u5217\u8868\uff0c\u5982\u679c\u8981\u7528\u5176\u751f\u6210\u5217\u8868\u8981\u4f7f\u7528 list(range(...)) for value in lst : ... for value in range ( ... ): ...","title":"for \u5faa\u73af"},{"location":"cs/pl/python/basic/#for_1","text":"\u6709\u4e09\u79cd\u65b9\u6cd5\u6765\u904d\u5386\u5b57\u5178 \u5728 d.keys() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u952e \u5728 d.values() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u503c \u5728 d.items() \u4e2d\u904d\u5386\u952e\u503c\u5bf9\uff08\u9700\u8981\u89e3\u5305\uff09 for key in d . keys (): ... for value in d . values (): ... for item in d . items (): ... # item \u4e3a\u4e00\u4e2a\u5143\u7ec4 for key , value in d . items (): ... # \u5c06 item \u89e3\u5305","title":"for \u5faa\u73af\u904d\u5386\u5b57\u5178"},{"location":"cs/pl/python/basic/#_16","text":"\u8d4b\u503c\u65f6\u7b49\u53f7\u5de6\u4fa7\u53ef\u4ee5\u662f\u7528\u9017\u53f7\u5206\u9694\u7684\u591a\u4e2a\u503c\uff0c\u8fd9\u65f6\u4f1a\u5c06\u53f3\u4fa7\u89e3\u5305\u5206\u522b\u8d4b\u503c\u7ed9\u5de6\u4fa7\u7684\u5404\u4e2a\u53d8\u91cf \u53f3\u4fa7\u4e5f\u53ef\u4ee5\u662f\u591a\u4e2a\u503c\uff08\u53ea\u8981\u51fa\u73b0\u9017\u53f7\u5c31\u4f1a\u89c6\u4e3a\u4e00\u4e2a\u5143\u7ec4\uff09 \u53ef\u4ee5\u901a\u8fc7 a, b = b, a \u5b9e\u73b0\u5143\u7d20\u4ea4\u6362 \u661f\u53f7\u8868\u8fbe\u5f0f \u53ef\u4ee5\u7528\u6765\u5728\u53ef\u8fed\u4ee3\u5bf9\u8c61\u5185\u90e8\u89e3\u5305 \u4e5f\u53ef\u7528\u6765\u6807\u8bb0\u4e00\u4e2a\u53d8\u91cf\u5305\u542b\u591a\u4e2a\u503c for \u5faa\u73af\u53ef\u4ee5\u89e3\u5305 t = ( 1 , 2 , 3 ) a , b , c = t # a = 1, b = 2, c = 3 t = ( 1 , 2 , ( 3 , 4 )) a , b , ( c , d ) = t # c = 3, d = 4 l = [ 1 , 2 , * [ 3 , 4 ]] # [3, 4] \u88ab\u89e3\u5305 ## l = [1, 2, 3, 4] a , * b = [ 1 , 2 , 3 , 4 ] ## a = 1, b = [2, 3, 4] lst = [[ 1 , 2 ], [ 3 , 4 ]] for a , b in lst : ... # \u7b2c\u4e00\u6b21\u5faa\u73af a, b \u4e3a 1, 2 # \u7b2c\u4e8c\u6b21\u5faa\u73af a, b \u4e3a 3, 4","title":"\u5143\u7d20\u89e3\u5305"},{"location":"cs/pl/python/basic/#for_2","text":"enumerate \u8ba1\u6570 \u53ef\u4ee5\u6307\u5b9a\u521d\u59cb\u503c zip \u540c\u65f6\u5faa\u73af\u591a\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61 \u5faa\u73af\u6b21\u6570\u4e3a\u6700\u77ed\u7684\u5bf9\u8c61\u7684\u957f\u5ea6 for i , value in enumerate ( lst ): ... # i \u4f9d\u6b21\u4e3a 0\uff0c1\uff0c2\uff0c\u2026\u2026 for i , value in enumerate ( lst , 1 ): ... # i \u4f9d\u6b21\u4e3a 1\uff0c2\uff0c3\uff0c\u2026\u2026 for a , b in zip ( lst1 , lst2 ): ... # a \u5728 lst1 \u4e2d\u5faa\u73af # b \u5728 lst2 \u4e2d\u5faa\u73af","title":"for \u5faa\u73af\u6280\u5de7"},{"location":"cs/pl/python/basic/#_17","text":"\u4e00\u79cd\u5f88\u65b9\u4fbf\u7684\u751f\u6210\u5217\u8868\u7684\u65b9\u5f0f \u5373\u5728\u5217\u8868\u4e2d\u5305\u542b\u5faa\u73af\uff0c\u9010\u6b21\u8bb0\u5f55\u5faa\u73af\u524d\u8868\u8fbe\u5f0f\u7684\u503c \u53ef\u4ee5\u6709\u591a\u91cd\u5faa\u73af\uff0c\u5373\u751f\u6210\u7b1b\u5361\u5c14\u79ef \u53ef\u4ee5\u5305\u542b\u6761\u4ef6\uff0c\u5373\u5728\u6761\u4ef6\u6210\u7acb\u65f6\u624d\u8bb0\u5f55\u503c \u5217\u8868\u63a8\u5bfc\u4e2d\u7684\u5faa\u73af\u53d8\u91cf\u6709\u5c40\u90e8\u4f5c\u7528\u57df \u5373\u5728\u5217\u8868\u63a8\u5bfc\u5916\u4e0d\u80fd\u8bbf\u95ee\u5faa\u73af\u53d8\u91cf lst = [] for i in range ( 1 , 10 ): lst . append ( i ** 2 ) ## \u7b49\u4ef7\u4e8e lst = [ i ** 2 for i in range ( 1 , 10 )] lst1 = [ x * y for x in l1 for y in l2 ] lst2 = [ ... for ... in ... if ... ]","title":"\u5217\u8868\u63a8\u5bfc"},{"location":"cs/pl/python/basic/#_18","text":"\u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u63a8\u5bfc\u7c7b\u4f3c\u7684\u65b9\u6cd5\u751f\u6210\u5143\u7ec4\u548c\u5b57\u5178 \u751f\u6210\u5143\u7ec4\u7684\u65f6\u5019\u8981\u7528 tuple() \u53ea\u5199 () \u7684\u8bdd\u5219\u53ea\u662f\u751f\u6210\u5668\u8868\u8fbe\u5f0f \u751f\u6210\u5b57\u5178\u65f6\u5faa\u73af\u524d\u7528 : \u5c06\u952e\u503c\u9694\u5f00 tuple ( i ** 2 for i in range ( 1 , 10 )) ( i ** 2 for i in range ( 1 , 10 )) ## ^ generator object { a : b for a in ... for b in ... }","title":"\u751f\u6210\u5143\u7ec4/\u5b57\u5178"},{"location":"cs/pl/python/basic/#_19","text":"\u548c\u5176\u5b83\u8bed\u8a00\u4e00\u6837\uff0c\u5728\u5faa\u73af\u4ee3\u7801\u5757\u4e2d\u53ef\u4ee5\u63a7\u5236\u5faa\u73af\u7684\u8fdb\u884c break \u7acb\u523b\u7ed3\u675f\u5faa\u73af continue \u7acb\u523b\u8fdb\u884c\u4e0b\u4e00\u8f6e\u5faa\u73af","title":"\u63a7\u5236\u5faa\u73af"},{"location":"cs/pl/python/basic/#while","text":"while \u5faa\u73af\u5373\u8fdb\u884c\u6761\u4ef6\u68c0\u67e5\uff0c\u5982\u679c\u4e3a True \u5219\u7ee7\u7eed\u8fd0\u884c\u76f4\u5230\u6761\u4ef6\u4e0d\u6ee1\u8db3\u505c\u6b62 while condition : ...","title":"while \u5faa\u73af"},{"location":"cs/pl/python/basic/#_20","text":"","title":"\u51fd\u6570"},{"location":"cs/pl/python/basic/#_21","text":"\u4f7f\u7528 def \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u51fd\u6570 \u5148\u51fd\u6570\u540d\uff0c\u7136\u540e\u62ec\u53f7\u5217\u51fa\u53c2\u6570\uff0c\u4e0b\u9762\u63a5\u4ee3\u7801\u5757 \u4f7f\u7528 return \u8fd4\u56de \u6ca1\u6709 return \u8fd0\u884c\u5230\u7ed3\u5c3e\uff0c\u8fd4\u56de None \u53ea\u6709 return\uff0c\u8fd4\u56de None return \u540e\u63a5\u5185\u5bb9\uff0c\u8fd4\u56de\u5185\u5bb9 return \u7684\u503c\u7c7b\u578b\u4e0d\u8981\u6c42\u4e00\u81f4 return \u53ef\u4ee5\u8fd4\u56de\u591a\u4e2a\u503c\uff08\u5229\u7528\u5143\u7ec4\uff09 def func_name ( arg1 , arg2 ): ... def func_name ( arg1 , arg2 ): ... return ... def func_name ( arg1 , arg2 ): ... return ... , ...","title":"\u51fd\u6570\u5b9a\u4e49"},{"location":"cs/pl/python/basic/#_22","text":"\u62ec\u53f7\u4e2d\u8981\u5217\u51fa\u53c2\u6570\u540d\uff0c\u4f9b\u51fd\u6570\u4f53\u5185\u4f7f\u7528 \u53ef\u4ee5\u5728\u53c2\u6570\u540e\u63a5\u7b49\u53f7\u8d4b\u9ed8\u8ba4\u503c \u4f7f\u7528\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5728\u8c03\u7528\u65f6\u53ef\u4ee5\u4e0d\u7528\u4f20 \u5229\u7528 * \u6765\u63a5\u6536\u4efb\u610f\u591a\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5143\u7ec4 * \u53c2\u6570\u540e\u9762\u4e0d\u80fd\u518d\u6709\u5176\u5b83\u975e\u5173\u952e\u5b57\u53c2\u6570 \u5229\u7528 ** \u6765\u63a5\u6536\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5b57\u5178 def func ( arg1 , arg2 ): ... def func ( arg1 , arg2 = \"...\" ): # \u9ed8\u8ba4\u503c ... def func ( arg1 , * arg2 ): # \u4efb\u610f\u591a\u53c2\u6570 ... def func ( arg1 , ** arg2 ): # \u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 ... def func ( arg1 , * arg2 , ** arg3 ): ... # *arg2 \u540e\u53ef\u4ee5\u52a0 **arg3","title":"\u51fd\u6570\u53c2\u6570"},{"location":"cs/pl/python/basic/#_23","text":"\u901a\u8fc7 \u51fd\u6570\u540d(\u53c2\u6570) \u6765\u8c03\u7528\u51fd\u6570\uff0c\u5f97\u5230\u8fd4\u56de\u503c \u76f4\u63a5\u4f20\u53c2\u7684\u8bdd\u8981\u5c06\u53c2\u6570\u4e0e\u5b9a\u4e49\u5bf9\u5e94\u4e0a \u901a\u8fc7\u5173\u952e\u5b57\u4f20\u53c2\uff08\u53c2\u6570\u540d\uff09\u53ef\u4ee5\u6253\u4e71\u987a\u5e8f \u5e26\u6709\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5982\u679c\u4e0d\u4f20\u5219\u4f7f\u7528\u9ed8\u8ba4\u503c \u5982\u679c\u8bfb\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570\uff0c\u5219\u591a\u4f59\u7684\u8bfb\u5230\u5b57\u5178\u4e2d def func ( a , b ): ... func ( 1 , 2 ) # a = 1, b = 2 func ( b = 1 , a = 2 ) # a = 2, b = 1 def func2 ( a , ** b ): ... func2 ( a = 1 , b = 2 , c = 3 ) ## a = 1, b = {\"b\": 2, \"c\": 3}","title":"\u51fd\u6570\u8c03\u7528"},{"location":"cs/pl/python/basic/#_24","text":"python \u4e2d\u7684\u53d8\u91cf\u90fd\u662f\u5f15\u7528\u7684\uff08\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u524d\u9762\u8bf4\u4e0d\u8981\u5c06\u53d8\u91cf\u7406\u89e3\u4e3a\u76d2\u5b50\uff09 \u7528 = \u5b9e\u9645\u4e0a\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u522b\u540d lst1 = lst2\uff0c\u5219 lst1 \u548c lst2 \u4f1a\u540c\u65f6\u53d8\u5316\uff08\u8981\u7528 [:] \u521b\u5efa\u526f\u672c\uff09 \u6570\u503c\u7c7b\u578b\u6709\u4f18\u5316\uff0c\u6240\u4ee5\u4e0d\u4f1a\u8fd9\u6837 == \u68c0\u67e5\u503c\u662f\u5426\u76f8\u7b49\uff0cis \u68c0\u67e5\u503c\u662f\u5426\u76f8\u540c \u89c2\u5bdf pythontutor.com \u51fd\u6570\u53c2\u6570\u4f20\u9012\u53ea\u6709\u201c\u5171\u4eab\u4f20\u53c2\u201d\u4e00\u79cd\u5f62\u5f0f\uff08\u5373\u4f20\u5f15\u7528\uff09 \u53ef\u53d8\u53d8\u91cf\uff08\u4f8b\u5982\u5217\u8868\uff09\u5728\u51fd\u6570\u5185\u90e8\u53ef\u4ee5\u88ab\u6539\u53d8 \u907f\u514d\u5411\u51fd\u6570\u4f20\u9012\u53ef\u53d8\u53d8\u91cf\uff08\u5217\u8868\u53ef\u4f20\u5165 [:] \u521b\u5efa\u7684\u526f\u672c\uff09","title":"*\u5f15\u7528\u53d8\u91cf"},{"location":"cs/pl/python/basic/#_25","text":"\u53ef\u4ee5\u901a\u8fc7 lambda \u8868\u8fbe\u5f0f\u6765\u5b9a\u4e49\u533f\u540d\u51fd\u6570 lambda \u8f93\u5165: \u8f93\u51fa\u8868\u8fbe\u5f0f \u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165 \u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf \u907f\u514d\u7528 lambda \u8d4b\u503c\u7684\u5f62\u5f0f\u5b9a\u4e49\u51fd\u6570 \u4f8b\u5982 __name__ \u5c5e\u6027\u4e0d\u4f1a\u662f\u51fd\u6570\u540d\uff0c\u800c\u662f \"\\\" lambda a : a ** 2 + 2 * a + 1 ( lambda a : a ** 2 + 2 * a + 1 )( 2 ) # 9 lambda a , b : a * 2 + b f = lambda a : a ** 2 + 2 * a + 1 ## \u8fd1\u4f3c\u7b49\u4ef7\u4e8e def f ( a ): return a ** 2 + 2 * a + 1","title":"\u533f\u540d\u51fd\u6570"},{"location":"cs/pl/python/basic/#_26","text":"\u8bfb\u53d6\u7528\u6237\u8f93\u5165\u4f7f\u7528\u5185\u7f6e\u7684 input \u51fd\u6570 \u51fd\u6570\u53c2\u6570\u4e3a\u8981\u663e\u793a\u7684\u63d0\u793a\u7b26\uff0c\u4f8b\u5982 input(\"> \") \u51fd\u6570\u7684\u8fd4\u56de\u503c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32 \u6bcf\u6b21\u8bfb\u5165\u4e00\u884c\uff08\u5373\u8bfb\u5230\u6362\u884c\u4e3a\u6b62\uff09","title":"\u7528\u6237\u8f93\u5165"},{"location":"cs/pl/python/basic/#_27","text":"\u63a5\u6536\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u7684\u51fd\u6570\u88ab\u79f0\u4e3a\u9ad8\u9636\u51fd\u6570 \u6bd4\u8f83\u5e38\u7528\u7684\u6709 map\u3001filter list ( map ( lambda x : x * 2 , [ 1 , 2 ])) ## [2, 4] list ( filter ( lambda x : x > 1 , [ 1 , 2 , 3 ])) ## [2, 3]","title":"\u9ad8\u9636\u51fd\u6570\u7528\u6cd5"},{"location":"cs/pl/python/basic/#_28","text":"","title":"\u7c7b\u4e0e\u9762\u5411\u5bf9\u8c61"},{"location":"cs/pl/python/basic/#_29","text":"\u7c7b\u53ef\u4ee5\u770b\u6210\u5305\u542b\u4e00\u4e9b \u5c5e\u6027 \u548c \u65b9\u6cd5 \u7684\u6846\u67b6 \u6839\u636e\u7c7b\u6765\u521b\u5efa\u5bf9\u8c61 -> \u5b9e\u4f8b\u5316 \u7528 class \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u7c7b \u7c7b\u4e2d\u7684\u51fd\u6570 -> \u65b9\u6cd5 \u7279\u6b8a\u65b9\u6cd5 __init__\uff0c\u5728\u7c7b\u5b9e\u4f8b\u5316\u7684\u65f6\u5019\u4f1a\u88ab\u81ea\u52a8\u8c03\u7528 \u5176\u5b83\u4e00\u822c\u7684\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u90fd\u8981\u4e3a\"self\"\uff0c\u8c03\u7528\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u4f20\u5165 \u76f4\u63a5\u5199\u5728\u7c7b\u4e2d\u7684\u662f\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e3a self.\\ \u8d4b\u503c\u7684\u5f62\u5f0f\u521b\u5efa\u5c5e\u6027 \u7528\u7c7b\u4f3c\u51fd\u6570\u8c03\u7528\u7684\u5f62\u5f0f\u5b9e\u4f8b\u5316\u7c7b\uff0c\u53c2\u6570\u4e3a__init__\u65b9\u6cd5\u7684\u53c2\u6570 \u76f4\u63a5\u901a\u8fc7 .\\ .\\ \u7684\u5f62\u5f0f\u8c03\u7528\u65b9\u6cd5/\u83b7\u53d6\u5c5e\u6027 class ClassName (): a = 1 def __init__ ( self , arg1 , arg2 ): self . arg1 = arg1 self . arg2 = arg2 def method ( self ): print ( self . arg1 , self . arg2 , self . a ) obj = ClassName ( 2 , 3 ) obj . method () # 2 3 1 print ( obj . a , obj . arg1 ) # 1 2","title":"\u7c7b"},{"location":"cs/pl/python/basic/#_30","text":"\u5728 class \u5b9a\u4e49\u7684\u62ec\u53f7\u4e2d\u52a0\u4e0a\u53e6\u4e00\u4e2a\u7c7b\u540d\u5219\u8868\u793a\u7ee7\u627f\u81ea\u90a3\u4e2a\u7c7b\u5b9a\u4e49\u4e00\u4e2a\u5b50\u7c7b \u5b50\u7c7b\u4f1a\u7ee7\u627f\u7236\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5 \u5b50\u7c7b\u7f16\u5199\u548c\u7236\u7c7b\u540d\u5b57\u4e00\u6837\u7684\u65b9\u6cd5\u4f1a \u91cd\u8f7d \u5728\u91cd\u8f7d\u7684\u65b9\u6cd5\u4e2d\u8c03\u7528\u7236\u7c7b\u7684\u539f\u65b9\u6cd5\u4f7f\u7528 super() \u4e5f\u53ef\u4ee5\u4e3a\u5b50\u7c7b\u5b9a\u4e49\u72ec\u6709\u7684\u65b9\u6cd5 class ClassA (): def __init__ ( self , a ): self . a = a def print ( self ): print ( self . a ) class ClassB ( ClassA ): def __init__ ( self , a ): super () . __init__ ( a ) self . a *= 2 obj = ClassB ( 1 ) obj . print () # 2","title":"\u7c7b\u7684\u7ee7\u627f"},{"location":"cs/pl/python/basic/#_31","text":"python \u4e2d\u7c7b\u5e76\u6ca1\u6709\u4e25\u683c\u79c1\u6709\u7684\u5c5e\u6027 \u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u4f1a\u88ab\u9690\u85cf\uff0c\u4e0d\u80fd\u76f4\u63a5\u8bfb\u53d6 \u4f46\u8fd9\u79cd\u5c5e\u6027\u53ef\u4ee5\u901a\u8fc7 _\u7c7b\u540d__\u5c5e\u6027 \u4f46\u65b9\u5f0f\u8bfb\u53d6\u5230 \u4f7f\u7528\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u53ef\u4ee5\u8f7b\u5fae\u4fdd\u62a4\u5c5e\u6027\uff0c\u4f46\u5e76\u4e0d\u4ee3\u8868\u5176\u662f\u79c1\u6709\u7684 class A (): a = 1 _a = 2 __a = 3 obj = A () print ( obj . a ) # 1 print ( obj . _a ) # 2 print ( obj . __a ) # AttributeError print ( obj . _A__a ) # 3","title":"\u79c1\u6709\uff1f"},{"location":"cs/pl/python/basic/#_32","text":"python \u4e2d\u5373\u4f7f\u6700\u7b80\u5355\u7684\u6574\u6570\u4e5f\u662f\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b \u901a\u8fc7 dir(...) \u67e5\u770b\u4e00\u4e2a\u5bf9\u8c61\u7684\u6240\u6709\u5c5e\u6027/\u65b9\u6cd5 \u6709\u5f88\u591a\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u3001\u53cc\u4e0b\u5212\u7ebf\u7ed3\u5c3e\u7684\u65b9\u6cd5\uff0c\u6210\u4e3a\u9b54\u672f\u65b9\u6cd5\uff08dunder method\uff09","title":"\u4e00\u5207\u7686\u5bf9\u8c61\uff1f"},{"location":"cs/pl/python/basic/#_33","text":"\u5f88\u591a\u51fd\u6570\u3001\u8868\u8fbe\u5f0f\u5176\u5b9e\u662f\u901a\u8fc7\u8c03\u7528\u7c7b\u7684\u9b54\u672f\u65b9\u6cd5\u6765\u5b9e\u73b0\u7684 len(obj) \u8c03\u7528 obj.__len__() obj[...] \u8c03\u7528 obj.__getitem__(...) a in obj \u8c03\u7528 obj.__contains__(a) bool(obj) \u8c03\u7528 obj.__bool__() \u51fd\u6570\u7684\u8c03\u7528\u672c\u8d28\u4e0a\u662f\u8c03\u7528 func.__call__() a + b \u8c03\u7528 a.__add__(b) \u2026\u2026 \u4e00\u4e2a\u4f8b\u5b50\uff1a lst[a:b:c] \u5207\u7247\u64cd\u4f5c \u5176\u4e2d\u5207\u7247\u4e5f\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5b83\u662f\u4e00\u4e2a slice \u7c7b\u7684\u5b9e\u4f8b \u6240\u4ee5\u5b83\u7b49\u4ef7\u4e8e lst[slice(a, b, c)] \u800c\u901a\u8fc7 [] \u7684\u64cd\u4f5c\u53c8\u662f\u901a\u8fc7 __getitem__ \u9b54\u672f\u65b9\u6cd5\u5b9e\u73b0\u7684 \u6240\u4ee5\u5b83\u53c8\u7b49\u4ef7\u4e8e lst.__getitem__(slice(a, b, c)) __getitem__ \u65b9\u6cd5\u4e2d\u5904\u7406\u4e86 slice\uff0c\u8bfb\u53d6 abc \u7684\u503c\uff0c\u518d\u5904\u7406\u8fd4\u56de\u4e00\u4e2a\u65b0\u5217\u8868","title":"\u9b54\u672f\u65b9\u6cd5"},{"location":"cs/pl/python/basic/#_34","text":"","title":"\u6742\u9879\u5185\u5bb9"},{"location":"cs/pl/python/basic/#_35","text":"open \u51fd\u6570\uff0c\u4f20\u5165\u6587\u4ef6\u540d\u3001\u6253\u5f00\u6a21\u5f0f \u6253\u5f00\u6a21\u5f0f\uff08\u53ef\u4ee5\u53e0\u52a0\uff09\uff1ar \u8bfb\uff08\u9ed8\u8ba4\uff09\u3001w \u5199\u3001x \u521b\u5efa\u5e76\u5199\u3001a \u5199\u5728\u672b\u5c3e\u3001b \u5b57\u8282\u6a21\u5f0f\u3001t \u6587\u672c\u6a21\u5f0f\uff08\u9ed8\u8ba4\uff09 \u8bfb\u53d6 \u6587\u672c\u6a21\u5f0f\u5efa\u8bae\u52a0\u4e0a encoding\uff0c\u4e0d\u7136\u5bb9\u6613\u62a5\u9519 f.read() \u8bfb\u53d6\u5168\u90e8\u5185\u5bb9\uff08\u5b57\u8282\u6a21\u5f0f\u5f97\u5230\u5b57\u8282\u5e8f\u5217\uff09 f.readline() \u8bfb\u53d6\u4e00\u884c f.readlines() \u8bfb\u53d6\u6240\u6709\u884c\uff0c\u8fd4\u56de\u4e00\u4e2a\u5217\u8868 \u5199\u5165 \u6587\u672c\u6a21\u5f0f\u540c\u6837\u5efa\u8bae\u52a0\u4e0a encoding f.write(...) \u76f4\u63a5\u5199\u5165 f.writelines(...) \u4f20\u5165\u5217\u8868\uff0c\u5143\u7d20\u95f4\u6362\u884c\u5199\u5165 \u901a\u8fc7\u8fd9\u79cd\u5f62\u5f0f\u64cd\u4f5c\u6587\u4ef6\u8bb0\u5f97\u7528\u5b8c\u540e\u8981 f.close() f = open ( \"filename\" , \"r\" , encoding = \"utf-8\" ) s = f . read () # a str ## line = f.readline() # a str ## lines = f.readlines() # a list ... f . close () f = open ( \"filename\" , \"w\" , encodeing = \"utf-8\" ) f . write ( \"...\" ) f . writelines ([ \"...\" , \"...\" ]) ... f . close ()","title":"\u6587\u4ef6\u64cd\u4f5c"},{"location":"cs/pl/python/basic/#with","text":"with ... as ...: \u5f00\u542f\u4e00\u4e2a\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668 \u5e38\u7528\u5728\u6587\u4ef6 open \u4e0a with \u5757\u5f00\u59cb\u81ea\u52a8\u6253\u5f00 with \u5757\u7ed3\u675f\u81ea\u52a8\u7ed3\u675f with \u5757\u7ed3\u675f\u540e\u53d8\u91cf\u4ecd\u4f1a\u7559\u5b58 with open ( \"file\" , \"r\" , encoding = \"utf-8\" ) as f : s = f . read () ... print ( f . closed ) # True","title":"with \u5757"},{"location":"cs/pl/python/basic/#_36","text":"\u4ea7\u751f\u9519\u8bef -> \u629b\u51fa\u5f02\u5e38 -> \u7a0b\u5e8f\u7ed3\u675f raise \u5173\u952e\u5b57\u629b\u51fa\u5f02\u5e38 try-except \u5757\u6355\u83b7\u5f02\u5e38 \u53ef\u4ee5\u6709\u591a\u4e2a except\u3001\u4e0d\u53ef\u4ee5\u6ca1\u6709 except \u540e\u63a5\u5f02\u5e38\u7c7b\uff08\u6ca1\u6709\u5219\u6355\u83b7\u6240\u6709\uff09 as \u5b57\u53e5\u5b58\u4e0b\u5f02\u5e38 finally \u8bed\u53e5 \u4e0d\u7ba1\u662f\u5426\u6709\u5f02\u5e38\u90fd\u4f1a\u8fd0\u884c raise ... raise RuntimeError ( \"...\" ) try : input ( \">>> \" ) except KeyboardInterrupt : print ( \"Good bye\" ) try : print ( 1 / 0 ) except ZeroDivisionError as e : print ( \"can't devide by zero\" ) raise e finally : print ( \"finished\" )","title":"\u5f02\u5e38\u4e0e\u5904\u7406"},{"location":"cs/pl/python/basic/#if-else","text":"else \u5757\u4e0d\u4ec5\u4ec5\u8ddf\u7740 if \u624d\u80fd\u4f7f\u7528 for-else for \u5faa\u73af\u7ed3\u675f\u624d\u4f1a\u8fd0\u884c for \u5faa\u73af\u88ab break \u4e86\u4e0d\u4f1a\u8fd0\u884c while-else condition \u4e0d\u6210\u7acb\u9000\u51fa\u624d\u4f1a\u8fd0\u884c \u5faa\u73af\u88ab break \u7ec8\u6b62\u4e86\u4e0d\u4f1a\u8fd0\u884c try-else try \u5757\u4e2d\u6ca1\u6709\u5f02\u5e38\u51fa\u73b0\u624d\u4f1a\u8fd0\u884c else \u5757\u4e2d\u5f02\u5e38\u4e0d\u4f1a\u88ab\u524d\u9762\u7684 except \u6355\u83b7 \u7a0b\u5e8f\u6d41\u8df3\u5230\u5757\u5916\u4e86\u4e0d\u4f1a\u8fd0\u884c\uff08return \u7b49\uff09 for value in lst : ... else : ... while condition : ... else : ... try : ... except ... : ... else : ...","title":"if \u5916\u7684 else \u8bed\u53e5"},{"location":"cs/pl/python/basic/#_37","text":"\u6a21\u5757\u53ef\u4ee5\u662f\u4e00\u4e2a\u5355\u72ec\u7684 .py \u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u6587\u4ef6\u5939 \u6587\u4ef6\u5939\u76f8\u5f53\u4e8e\u5bfc\u5165\u5176\u4e0b __init__.py \u6587\u4ef6 \u6a21\u5757\u4e2d\u6b63\u5e38\u7f16\u5199\u51fd\u6570\u3001\u7c7b\u3001\u8bed\u53e5 \u901a\u8fc7 import \u8bed\u53e5\u5bfc\u5165\u6a21\u5757 import code import code as cd from code import ... from code import * \u5bfc\u5165\u65f6\u76f8\u5f53\u4e8e\u8fd0\u884c\u4e86\u4e00\u904d\u5bfc\u5165\u7684\u4ee3\u7801 ## code.py print ( \"hello\" ) def f (): print ( \"call func in code.py\" ) ... import code # hello code . f () import code as cd # hello cd . f () from code import f # hello f () from code import * # hello f ()","title":"\u6a21\u5757\u4e0e\u5bfc\u5165"},{"location":"cs/pl/python/basic/#main","text":"\u9632\u6b62\u5bfc\u5165\u65f6\u8fd0\u884c\u4ee3\u7801 \u53ea\u5141\u8bb8\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u65f6\u8fd0\u884c \u901a\u8fc7\u5224\u65ad __name__ \u5982\u679c\u662f\u76f4\u63a5\u8fd0\u884c\uff0c\u5219\u5176\u7b49\u4e8e\u5b57\u7b26\u4e32 __main__ \u5982\u679c\u662f\u88ab\u5bfc\u5165\u7684\uff0c\u5219\u5176\u7b49\u4e8e\u6a21\u5757\u540d ## code.py ... if __name__ == \"__main__\" : print ( \"hello\" ) else : print ( __name__ ) import code # code $ python code.py # hello","title":"\u201dmain \u51fd\u6570\u201c"},{"location":"cs/pl/python/basic/#_38","text":"python \u81ea\u5e26\u4e86\u5f88\u591a\u5b9e\u7528\u7684\u6a21\u5757\uff08\u6807\u51c6\u5e93\uff09 os\u3001sys\uff1a\u7cfb\u7edf\u64cd\u4f5c math\uff1a\u6570\u5b66\u8fd0\u7b97 re\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f datetime\uff1a\u65e5\u671f\u4e0e\u65f6\u95f4 subprocess\uff1a\u5b50\u8fdb\u7a0b\u7ba1\u7406 argparse\uff1a\u547d\u4ee4\u884c\u53c2\u6570\u89e3\u6790 logging\uff1a\u65e5\u5fd7\u8bb0\u5f55 hashlib\uff1a\u54c8\u5e0c\u8ba1\u7b97 random\uff1a\u968f\u673a\u6570 csv\u3001json\uff1a\u6570\u636e\u683c\u5f0f\u89e3\u6790 collections\uff1a\u66f4\u591a\u7c7b\u578b ... \u770b\u6587\u6863\uff1a docs.python.org/zh-cn/3/library","title":"\u5185\u90e8\u6a21\u5757"},{"location":"cs/pl/python/basic/#_39","text":"pypi.org \u4e0a\u6709\u6781\u591a\u522b\u4eba\u5199\u597d\u4e86\u53ef\u4ee5\u7528\u7684\u6a21\u5757 numpy \u77e9\u9635\u7b49\u79d1\u5b66\u8ba1\u7b97\u3001scipy \u79d1\u5b66\u8ba1\u7b97\u3001matplotlib \u4f5c\u56fe\u2026\u2026 \u4f7f\u7528 pip \u5b89\u88c5\uff08pip / python -m pip\uff09 pip install pkg_name pip install pkg_name=... \u6307\u5b9a\u7248\u672c pip install -r requirements.txt \u5b89\u88c5 txt \u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5305 pip install ... -i https://pypi.tuna.tsinghua.edu.cn/simple \u6362\u6e90 pip list\u3001pip show \u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u7684\u6240\u6709\u5305/\u67d0\u4e2a\u5305\u7684\u4fe1\u606f pip uninstall pkg_name \u5378\u8f7d\u5305 pip \u5b89\u88c5\u672c\u5730\u6a21\u5757 \u76ee\u5f55\u4e0b\u9700\u8981\u5305\u542b setup.py / pyproject.toml pip install . \u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u590d\u5236\u5230 site-packages \u4e2d\uff09 pip install -e . \u53ef\u4fee\u6539\u5f62\u5f0f\u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u5728\u5f53\u524d\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u4ee3\u7801\uff09","title":"\u5916\u90e8\u6a21\u5757\u5b89\u88c5"},{"location":"cs/pl/python/basic/#_40","text":"\u6a21\u5757\u5f00\u5934\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 \u7c7b\u3001\u51fd\u6570\u5b9a\u4e49\u4e0b\u9762\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 help(...) \u7684\u65f6\u5019\u53ef\u4ee5\u663e\u793a obj.__doc__ \u8868\u793a\u8fd9\u4e32\u5b57\u7b26\u4e32 \u7f16\u8f91\u5668\u7528\u6765\u63d0\u793a \u4e00\u4e9b\u6587\u6863\u751f\u6210\u5de5\u5177\uff08sphinx \u7b49\uff09\u4ece\u4e2d\u83b7\u53d6\u6587\u6863 \"\"\" docstring for module \"\"\" def func ( ... ): \"\"\"docstring for function\"\"\" ... class A (): \"\"\"docstring for class\"\"\" def __init__ ( self , ... ): \"\"\"docstring for method\"\"\" ...","title":"\u6587\u6863\u5b57\u7b26\u4e32"},{"location":"cs/pl/python/basic/#_41","text":"PEP\uff1aPython Enhancement Proposals\uff1a peps.python.org PEP 8 \u89c4\u8303\uff0c\u7ed9\u51fa\u4e86\u63a8\u8350\u4f7f\u7528\u7684 python \u4ee3\u7801\u98ce\u683c\u89c4\u8303 peps.python.org/pep-0008 pep8.org \u66f4\u7ec6\u81f4\u7684\u4ee3\u7801\u98ce\u683c black github.com/psf/black flake8 flake8.pycqa.org ...","title":"\u4ee3\u7801\u89c4\u8303"},{"location":"cs/pl/python/basic/#referencce","text":"Python3 \u83dc\u9e1f\u6559\u7a0b Python \u5b98\u65b9\u6587\u6863 Python\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\uff08\u7b2c2\u7248\uff09 Python \u8bed\u6cd5\u57fa\u7840","title":"Referencce"},{"location":"cs/pl/python/numpy/","text":"Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 \u00b6 \u7ea6 2778 \u4e2a\u5b57 140 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u5728\u5b66\u4e60 Python\uff0c\u5c24\u5176\u662f\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c\u6700\u57fa\u7840\u7684 Numpy \u5341\u5206\u91cd\u8981\uff0c\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u73af\u5883\uff0c\u6240\u4ee5\u5fc5\u987b\u8981\u719f\u7ec3\u638c\u63e1\u3002 Numpy \u901a\u5e38\u4e0e SciPy(Scientific Python) \u548c Matplotlib(\u7ed8\u56fe\u5e93) \u4e00\u8d77\u98df\u7528\uff0c\u76f8\u5f53\u4e8e\u66ff\u4ee3\u4e86 MatLab\u3002 ndarray \u00b6 \u5c5e\u6027 \u00b6 Numpy \u7684\u4e3b\u8981\u5bf9\u8c61\u65f6\u540c\u6784\u591a\u7ef4\u6570\u7ec4\u3002\u5b83\u662f\u4e00\u4e2a\u5143\u7d20\u8868\uff08\u901a\u5e38\u662f\u6570\u5b57\uff09\uff0c\u6240\u6709\u7c7b\u578b\u90fd\u76f8\u540c\uff0c\u7531\u975e\u8d1f\u6574\u6570\u5143\u7ec4\u7d22\u5f15\u3002\u5728 Numpy \u7ef4\u5ea6\u4e2d\u79f0\u4e3a \u8f74 \u3002 Numpy \u7684\u6570\u7ec4\u7c7b\u88ab\u8c03\u7528 ndarray \uff0c\u522b\u540d\u4e3a array \uff0c\u4f46\u548c Python \u7684 array.array \u533a\u522b\u5f88\u5927 ndarray.ndim : \u6570\u7ec4\u7684\u8f74\uff08\u7ef4\u5ea6\uff09\u7684\u4e2a\u6570\uff0c\u4e5f\u88ab\u79f0 rank ndarray.shape : \u6570\u7ec4\u7684\u7ef4\u5ea6\u3002\u4e00\u4e2a\u6574\u6570\u7684\u5143\u7956\uff0c\u8868\u793a\u6bcf\u4e2a\u7ef4\u5ea6\u4e2d\u6570\u7ec4\u7684\u5927\u5c0f\uff0cshape \u7684\u957f\u5ea6\u5c31\u662f rank \u6216\u7ef4\u5ea6\u7684\u4e2a\u6570 ndim ndarray.size : \u6570\u7ec4\u5143\u7d20\u7684\u603b\u6570\uff0c\u7b49\u4e8e shape \u5143\u7d20\u7684\u4e58\u79ef ndarray.dtype : \u63cf\u8ff0\u6570\u7ec4\u4e2d\u5143\u7d20\u7c7b\u578b\u7684\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684 Python \u7c7b\u578b\u521b\u5efa\u6216\u6307\u5b9a dtype\uff0c\u4e5f\u53ef\u4ee5\u7528 Numpy \u63d0\u4f9b\u7684\u4f8b\u5982 numpy.int32, numpy.float64 \u7b49 ndarray.itemsize : \u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u5b57\u8282\u5927\u5c0f\uff0c\u4f8b\u5982 float64 \u7684 itemsize \u5c31\u662f 64/8=8\uff0c\u7b49\u4e8e ndarray.dtype.itemsize ndarray.data : \u8be5\u7f13\u51b2\u533a\u5305\u542b\u6570\u7ec4\u7684\u5b9e\u9645\u5143\u7d20\uff0c\u901a\u5e38\u4e0d\u4f7f\u7528\uff0c\u53ea\u9700\u8981\u901a\u8fc7\u7d22\u5f15\u8bbf\u95ee element in ndarray >>> import numpy as np >>> a = np . arange ( 15 ) . reshape ( 3 , 5 ) >>> a array ([[ 0 , 1 , 2 , 3 , 4 ], [ 5 , 6 , 7 , 8 , 9 ], [ 10 , 11 , 12 , 13 , 14 ]]) >>> a . shape ( 3 , 5 ) >>> a . ndim 2 >>> a . dtype . name 'int64' >>> a . itemsize 8 >>> a . size 15 >>> type ( a ) < type 'numpy.ndarray' > >>> b = np . array ([ 6 , 7 , 8 ]) >>> b array ([ 6 , 7 , 8 ]) >>> type ( b ) < type 'numpy.ndarray' > \u6570\u7ec4\u521b\u5efa \u00b6 a=np.array([2,3,4]) :\u4ece Python \u5217\u8868\u6216\u5143\u7ec4\u4e2d\u521b\u5efa\u6570\u7ec4\uff08\u7c7b\u578b\u63a8\u5bfc\uff09 b=np.array([(1,2,3),(4,5,6)]) : \u53ef\u4ee5\u5c06\u5e8f\u5217\u7684\u5e8f\u5217\u8f6c\u6362\u6210\u4e8c\u7ef4\u6570\u7ec4\uff0c\u751a\u81f3\u9ad8\u7ef4\u6570\u7ec4 c=np.array([[],[]], dtype=complex) : \u521b\u5efa\u65f6\u53ef\u4ee5\u663e\u5f0f\u6307\u5b9a\u6570\u7ec4\u7684\u7c7b\u578b dtype=complex \u5360\u4f4d\u7b26\u6570\u7ec4\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7684 dtype \u90fd\u662f float64 \uff09 np.zero() : \u521b\u5efa\u4e00\u4e2a\u7531 0 \u7ec4\u6210\u7684\u6570\u7ec4 np.ones() : \u521b\u5efa\u4e00\u4e2a\u7531 1 \u7ec4\u6210\u7684\u6570\u7ec4 np.empty() : \u521b\u5efa\u4e00\u4e2a\u6570\u7ec4\uff0c\u5185\u5bb9\u968f\u673a\uff08\u53d6\u51b3\u4e8e\u5185\u5b58\u72b6\u6001\uff09 np.arange() \uff0c\u521b\u5efa\u6570\u5b57\u7ec4\u6210\u7684\u6570\u7ec4\uff0c\u7c7b\u4f3c\u4e8e range \u7684\u51fd\u6570 \u5f53\u4e0e\u6d6e\u70b9\u53c2\u6570\u4e00\u8d77\u4f7f\u7528\u65f6\uff0c\u6700\u597d\u4f7f\u7528 linspace \u51fd\u6570\u63a5\u53d7\u60f3\u8981\u7684\u5143\u7d20\u6570\u91cf\u7684\u51fd\u6570\uff0c\u800c\u4e0d\u662f\u6b65\u957f step \u6253\u5370\u6570\u7ec4 \u00b6 Numpy \u4ee5\u5d4c\u5957\u5217\u8868\u7c7b\u4f3c\u7684\u65b9\u5f0f\u663e\u793a\uff0c\u6709\u4ee5\u4e0b\u5e03\u5c40 \u6700\u540e\u4e00\u4e2a\u8f74\u4ece\u5de6\u5230\u53f3\u6253\u5370 \u5012\u6570\u7b2c\u4e8c\u4e2a\u4ece\u4e0a\u5230\u4e0b\u6253\u5370 \u5176\u4f59\u90e8\u5206\u4ece\u4e0a\u5230\u4e0b\u6253\u5370\uff0c\u6bcf\u4e2a\u5207\u7247\u7528\u7a7a\u884c\u9694\u5f00 \u5f53\u6570\u7ec4\u592a\u5927\u800c\u65e0\u6cd5\u6253\u5370\u65f6\uff0cNumpy \u4f1a\u81ea\u52a8\u8df3\u8fc7\u6570\u7ec4\u7684\u4e2d\u5fc3\u90e8\u5206\u5e76\u4ec5\u6253\u5370\u89d2\u70b9\u3002\u8981\u7981\u7528\u6b64\u884c\u4e3a\u5e76\u5f3a\u5236NumPy\u6253\u5370\u6574\u4e2a\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u66f4\u6539\u6253\u5370\u9009\u9879 set_printoptions print array >>> a = np . arange ( 6 ) # 1d array >>> print ( a ) [ 0 1 2 3 4 5 ] >>> >>> b = np . arange ( 12 ) . reshape ( 4 , 3 ) # 2d array >>> print ( b ) [[ 0 1 2 ] [ 3 4 5 ] [ 6 7 8 ] [ 9 10 11 ]] >>> >>> c = np . arange ( 24 ) . reshape ( 2 , 3 , 4 ) # 3d array >>> print ( c ) [[[ 0 1 2 3 ] [ 4 5 6 7 ] [ 8 9 10 11 ]] [[ 12 13 14 15 ] [ 16 17 18 19 ] [ 20 21 22 23 ]]] >>> >>> print ( np . arange ( 10000 )) # 10000d array [ 0 1 2 ... , 9997 9998 9999 ] >>> >>> print ( np . arange ( 10000 ) . reshape ( 100 , 100 )) [[ 0 1 2 ... , 97 98 99 ] [ 100 101 102 ... , 197 198 199 ] [ 200 201 202 ... , 297 298 299 ] ... , [ 9700 9701 9702 ... , 9797 9798 9799 ] [ 9800 9801 9802 ... , 9897 9898 9899 ] [ 9900 9901 9902 ... , 9997 9998 9999 ]] >>> >>> np . set_printoptions ( threshold = sys . maxsize ) # sys module should be imported \u57fa\u672c\u64cd\u4f5c \u00b6 \u6570\u7ec4\u4e0a\u7684\u7b97\u6570\u8fd0\u7b97\u7b26\u4f1a\u5e94\u7528\u5230\u5143\u7d20\u7ea7\u522b \u4e58\u6cd5 * \u5728 array \u4e2d\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u77e9\u9635\u4e58\u6cd5\u53ef\u4ee5\u7528 @ \u6216 dot \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97 \u67d0\u4e9b\u64cd\u4f5c\u4f8b\u5982 +=\u3001*= \u4f1a\u76f4\u63a5\u66f4\u6539\u88ab\u64cd\u4f5c\u7684\u77e9\u9635\u6570\u7ec4\u800c\u4e0d\u4f1a\u521b\u5efa\u65b0\u77e9\u9635\u6570\u7ec4 \u5f53\u4f7f\u7528\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u7ed3\u679c\u6570\u7ec4\u7684\u7c7b\u578b\u5bf9\u5e94\u4e8e\u66f4\u4e00\u822c\u6216\u66f4\u7cbe\u786e\u7684\u6570\u7ec4\uff08\u79f0\u4e3a\u5411\u4e0a\u8f6c\u6362\u7684\u884c\u4e3a\uff09 \u8bb8\u591a\u4e00\u5143\u64cd\u4f5c\uff0c\u4f8b\u5982\u8ba1\u7b97\u6570\u7ec4\u4e2d\u6240\u6709\u5143\u7d20\u7684\u603b\u548c\uff0c\u90fd\u662f\u4f5c\u4e3a ndarray \u7c7b\u7684\u65b9\u6cd5\u5b9e\u73b0\u7684 min() max() sum() \u901a\u8fc7\u6307\u5b9a axis \u53c2\u6570\uff0c\u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6307\u5b9a\u8f74\u5e94\u7528\u64cd\u4f5c \u901a\u51fd\u6570 \u00b6 NumPy \u63d0\u4f9b\u719f\u6089\u7684\u6570\u5b66\u51fd\u6570\uff0c\u4f8b\u5982 sin \uff0c cos \u548c exp \u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u88ab\u79f0\u4e3a\u201c\u901a\u51fd\u6570\u201d\uff08ufunc\uff09\u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u51fd\u6570\u5728\u6570\u7ec4\u4e0a\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u4ea7\u751f\u4e00\u4e2a\u6570\u7ec4\u4f5c\u4e3a\u8f93\u51fa\u3002 \u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3 \u00b6 \u4e00\u7ef4\u7684\u6570\u7ec4\u53ef\u4ee5\u8fdb\u884c\u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3\u64cd\u4f5c\u7684\uff0c\u5c31\u50cf \u5217\u8868 \u548c\u5176\u4ed6 Python \u5e8f\u5217\u7c7b\u578b\u4e00\u6837 \u591a\u7ef4\u7684\u6570\u7ec4\u6bcf\u4e2a\u8f74\u53ef\u4ee5\u6709\u4e00\u4e2a\u7d22\u5f15\u3002\u8fd9\u4e9b\u7d22\u5f15\u4ee5\u9017\u53f7\u200b\u200b\u5206\u9694\u7684\u5143\u7ec4\u7ed9\u51fa \u5f53\u63d0\u4f9b\u7684\u7d22\u5f15\u5c11\u4e8e\u8f74\u7684\u6570\u91cf\u65f6\uff0c\u7f3a\u5931\u7684\u7d22\u5f15\u88ab\u8ba4\u4e3a\u662f\u5b8c\u6574\u7684\u5207\u7247 \u53ef\u4ee5\u4f7f\u7528 ... \u8868\u793a\u4ea7\u751f\u5b8c\u6574\u7d22\u5f15\u5143\u7ec4\u6240\u9700\u7684\u5192\u53f7\uff08\u5269\u4f59\u8f74\uff09\uff0c\u7528\u6765\u66ff\u4ee3 : \u4f8b\u5982 x \u662f rank \u4e3a 5 \u7684\u6570\u7ec4 x[1,2,...] = x[1,2,:,:,:] x[...,3] = x[:,:,:,:,3] x[4,...,5,:] = x[4,:,:,5,:] \u5bf9\u591a\u7ef4\u6570\u7ec4\u8fdb\u884c \u8fed\u4ee3\uff08Iterating\uff09 \u662f\u76f8\u5bf9\u4e8e\u7b2c\u4e00\u4e2a\u8f74\u5b8c\u6210\u7684 \u5982\u679c\u60f3\u8981\u5bf9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6267\u884c\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528 flat \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u662f\u6570\u7ec4\u7684\u6240\u6709\u5143\u7d20\u7684\u8fed\u4ee3\u5668 \u5f62\u72b6\u64cd\u7eb5 \u00b6 \u6539\u53d8\u6570\u7ec4\u5f62\u72b6 \u00b6 a.shape() : \u67e5\u770b\u6570\u7ec4\u7684\u5f62\u72b6 ravel() : \u5c06\u6570\u7ec4\u5e73\u5766\u5e76\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4 reshape(i, j, ...size) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4\uff0c\u5982\u679c size \u6307\u5b9a\u4e3a -1\uff0c\u5219\u4f1a\u81ea\u52a8\u8ba1\u7b97\u5176\u4ed6\u7684 size \u5927\u5c0f resize(i, j, ...) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u4fee\u6539\u6570\u7ec4\u672c\u8eab T : \u5c06\u6570\u7ec4\u8f6c\u7f6e \u5c06\u4e0d\u540c\u6570\u7ec4\u5806\u53e0 \u00b6 vstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u5782\u76f4\u5806\u53e0 hstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u6a2a\u5411\u5806\u53e0 coulumn_stack : 1D \u6570\u7ec4\u4f5c\u4e3a\u5217\u5806\u53e0\u5230 2D \u6570\u7ec4\u4e2d\uff0c\u76f8\u5f53\u4e8e hstack 2D \u6570\u7ec4 row_stack : \u7b49\u6548\u4e8e vstack \u4e8e\u4efb\u4f55\u8f93\u5165\u6570\u7ec4 r_\u3001c_ : \u901a\u8fc7\u6cbf\u4e00\u4e2a\u8f74\u5806\u53e0\u6570\u7ec4\u6765\u521b\u5efa\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u8303\u56f4\u4e3a\u64cd\u4f5c\u7b26 : \u5c06\u4e00\u4e2a\u6570\u7ec4\u62c6\u5206\u6210\u51e0\u4e2a\u8f83\u5c0f\u7684\u6570\u7ec4 \u00b6 hsplit() : \u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6c34\u5e73\u8f74\u62c6\u5206\u6570\u7ec4\uff0c\u65b9\u6cd5\u662f\u6307\u5b9a\u8981\u8fd4\u56de\u7684\u5f62\u72b6\u76f8\u7b49\u7684\u6570\u7ec4\u7684\u6570\u91cf\uff0c\u6216\u8005\u6307\u5b9a\u5e94\u8be5\u5728\u5176\u4e4b\u540e\u8fdb\u884c\u5206\u5272\u7684\u5217 vsplit() : \u6cbf\u5782\u76f4\u8f74\u5206\u5272 \u62f7\u8d1d\u548c\u89c6\u56fe \u00b6 \u5b8c\u5168\u4e0d\u590d\u5236 \u00b6 \u7b80\u5355\u5206\u914d\u4e0d\u4f1a\u590d\u5236\u6570\u7ec4\u5bf9\u8c61\u6216\u5176\u6570\u636e Python\u5c06\u53ef\u53d8\u5bf9\u8c61\u4f5c\u4e3a\u5f15\u7528\u4f20\u9012\uff0c\u56e0\u6b64\u51fd\u6570\u8c03\u7528\u4e0d\u4f1a\u590d\u5236 \u89c6\u56fe\u6216\u6d45\u62f7\u8d1d \u00b6 \u4e0d\u540c\u7684\u6570\u7ec4\u5bf9\u8c61\u53ef\u4ee5\u5171\u4eab\u76f8\u540c\u7684\u6570\u636e view() : \u521b\u5efa\u4e00\u4e2a\u67e5\u770b\u76f8\u540c\u6570\u636e\u7684\u65b0\u6570\u7ec4\u5bf9\u8c61 \u5207\u7247\u6570\u7ec4\u4f1a\u8fd4\u56de\u4e00\u4e2a\u89c6\u56fe \u6df1\u62f7\u8d1d \u00b6 copy() : \u751f\u6210\u6570\u7ec4\u53ca\u5176\u6570\u636e\u7684\u5b8c\u6574\u526f\u672c \u5982\u679c\u4e0d\u518d\u9700\u8981\u539f\u59cb\u6570\u7ec4\uff0c\u5219\u5e94\u5728\u5207\u7247\u540e\u8c03\u7528 copy() \u5e7f\u64ad \u00b6 \u5e7f\u64ad(Broadcast)\u662f numpy \u5bf9\u4e0d\u540c\u5f62\u72b6(shape)\u7684\u6570\u7ec4\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\u7684\u65b9\u5f0f\uff0c \u5bf9\u6570\u7ec4\u7684\u7b97\u672f\u8fd0\u7b97\u901a\u5e38\u5728\u76f8\u5e94\u7684\u5143\u7d20\u4e0a\u8fdb\u884c \u5982\u679c\u4e24\u4e2a\u6570\u7ec4 a \u548c b \u5f62\u72b6\u76f8\u540c\uff0c\u5373\u6ee1\u8db3 a.shape == b.shape\uff0c\u90a3\u4e48 a*b \u7684\u7ed3\u679c\u5c31\u662f a \u4e0e b \u6570\u7ec4\u5bf9\u5e94\u4f4d\u76f8\u4e58 \u5f53\u8fd0\u7b97\u4e2d\u7684 2 \u4e2a\u6570\u7ec4\u7684\u5f62\u72b6\u4e0d\u540c\u65f6\uff0cnumpy \u5c06\u81ea\u52a8\u89e6\u53d1\u5e7f\u64ad\u673a\u5236 \u89c4\u5219: \u5bf9\u4e24\u4e2a\u6570\u7ec4\uff0c\u5206\u522b\u6bd4\u8f83\u4ed6\u4eec\u7684\u6bcf\u4e00\u4e2a\u7ef4\u5ea6\uff08\u82e5\u5176\u4e2d\u4e00\u4e2a\u6570\u7ec4\u6ca1\u6709\u5f53\u524d\u7ef4\u5ea6\u5219\u5ffd\u7565\uff09 \u6570\u7ec4\u62e5\u6709\u76f8\u540c\u5f62\u72b6 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u76f8\u7b49 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u6709\u4e00\u4e2a\u662f 1 \u82e5\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c\u629b\u51fa \"ValueError: frames are not aligned\" \u5f02\u5e38 \u7d22\u5f15\u6280\u5de7 \u00b6 \u6574\u6570\u6570\u7ec4\u7d22\u5f15 \u00b6 \u6574\u6570\u6570\u7ec4\u7d22\u5f15\u662f\u6307\u4f7f\u7528\u4e00\u4e2a\u6570\u7ec4\u6765\u8bbf\u95ee\u53e6\u4e00\u4e2a\u6570\u7ec4\u7684\u5143\u7d20\u3002\u8fd9\u4e2a\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u76ee\u6807\u6570\u7ec4\u4e2d\u67d0\u4e2a\u7ef4\u5ea6\u4e0a\u7684\u7d22\u5f15\u503c\u3002 >>> a = np . arange ( 12 ) ** 2 # the first 12 square numbers >>> i = np . array ( [ 1 , 1 , 3 , 8 , 5 ] ) # an array of indices >>> a [ i ] # the elements of a at the positions i array ([ 1 , 1 , 9 , 64 , 25 ]) >>> >>> j = np . array ( [ [ 3 , 4 ], [ 9 , 7 ] ] ) # a bidimensional array of indices >>> a [ j ] # the same shape as j array ([[ 9 , 16 ], [ 81 , 49 ]]) \u5e03\u5c14\u6570\u7ec4\u7d22\u5f15 \u00b6 \u5e03\u5c14\u7d22\u5f15\u901a\u8fc7\u5e03\u5c14\u8fd0\u7b97\uff08\u5982\uff1a\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff09\u6765\u83b7\u53d6\u7b26\u5408\u6307\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u6570\u7ec4 >>> a = np . arange ( 12 ) . reshape ( 3 , 4 ) >>> b = a > 4 >>> b # b is a boolean with a's shape array ([[ False , False , False , False ], [ False , True , True , True ], [ True , True , True , True ]]) >>> a [ b ] # 1d array with the selected elements array ([ 5 , 6 , 7 , 8 , 9 , 10 , 11 ]) ix_()\u51fd\u6570 \u00b6 ix_ \u51fd\u6570\u53ef\u7528\u4e8e\u7ec4\u5408\u4e0d\u540c\u7684\u5411\u91cf\uff0c\u4ee5\u4fbf\u83b7\u5f97\u6bcf\u4e2an-uplet\u7684\u7ed3\u679c >>> a = np . array ([ 2 , 3 , 4 , 5 ]) >>> b = np . array ([ 8 , 5 , 4 ]) >>> c = np . array ([ 5 , 4 , 6 , 8 , 3 ]) >>> ax , bx , cx = np . ix_ ( a , b , c ) >>> ax array ([[[ 2 ]], [[ 3 ]], [[ 4 ]], [[ 5 ]]]) >>> bx array ([[[ 8 ], [ 5 ], [ 4 ]]]) >>> cx array ([[[ 5 , 4 , 6 , 8 , 3 ]]]) >>> ax . shape , bx . shape , cx . shape (( 4 , 1 , 1 ), ( 1 , 3 , 1 ), ( 1 , 1 , 5 )) >>> result = ax + bx * cx >>> result array ([[[ 42 , 34 , 50 , 66 , 26 ], [ 27 , 22 , 32 , 42 , 17 ], [ 22 , 18 , 26 , 34 , 14 ]], [[ 43 , 35 , 51 , 67 , 27 ], [ 28 , 23 , 33 , 43 , 18 ], [ 23 , 19 , 27 , 35 , 15 ]], [[ 44 , 36 , 52 , 68 , 28 ], [ 29 , 24 , 34 , 44 , 19 ], [ 24 , 20 , 28 , 36 , 16 ]], [[ 45 , 37 , 53 , 69 , 29 ], [ 30 , 25 , 35 , 45 , 20 ], [ 25 , 21 , 29 , 37 , 17 ]]]) >>> result [ 3 , 2 , 4 ] 17 >>> a [ 3 ] + b [ 2 ] * c [ 4 ] 17 \u4f4d\u8fd0\u7b97 \u00b6 bitwise_and() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u4e0e\u64cd\u4f5c bitwise_or() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u6216\u64cd\u4f5c invert() : \u6309\u4f4d\u53d6\u53cd left_shift() : \u5411\u5de6\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d right_shift() : \u5411\u53f3\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d \u51fd\u6570 \u00b6 \u5b57\u7b26\u4e32\u51fd\u6570 \u00b6 add() : \u5bf9\u4e24\u4e2a\u6570\u7ec4\u7684\u9010\u4e2a\u5b57\u7b26\u4e32\u5143\u7d20\u8fdb\u884c\u8fde\u63a5 multiply() : \u8fd4\u56de\u6309\u5143\u7d20\u591a\u91cd\u8fde\u63a5\u540e\u7684\u5b57\u7b26\u4e32 center() : \u5c45\u4e2d\u5b57\u7b26\u4e32 capitalize() : \u5c06\u5b57\u7b26\u4e32\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 title() : \u5c06\u5b57\u7b26\u4e32\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 lower() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5c0f\u5199 upper() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5927\u5199 split() : \u6307\u5b9a\u5206\u9694\u7b26\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u5206\u5272\uff0c\u5e76\u8fd4\u56de\u6570\u7ec4\u5217\u8868 splitlines() : \u8fd4\u56de\u5143\u7d20\u4e2d\u7684\u884c\u5217\u8868\uff0c\u4ee5\u6362\u884c\u7b26\u5206\u5272 strip() : \u79fb\u9664\u5143\u7d20\u5f00\u5934\u6216\u8005\u7ed3\u5c3e\u5904\u7684\u7279\u5b9a\u5b57\u7b26 join() : \u901a\u8fc7\u6307\u5b9a\u5206\u9694\u7b26\u6765\u8fde\u63a5\u6570\u7ec4\u4e2d\u7684\u5143\u7d20 replace() : \u4f7f\u7528\u65b0\u5b57\u7b26\u4e32\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b50\u5b57\u7b26\u4e32 decode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.decode encode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.encode \u6570\u5b66\u51fd\u6570 \u00b6 sin(), cos(), tan() \u7b49\u4e09\u89d2\u51fd\u6570 around() : \u8fd4\u56de\u6307\u5b9a\u6570\u5b57\u7684\u56db\u820d\u4e94\u5165\u503c floor() : \u8fd4\u56de\u5c0f\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5927\u6574\u6570\uff0c\u5373\u5411\u4e0b\u53d6\u6574 ceil() : \u8fd4\u56de\u5927\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5c0f\u6574\u6570\uff0c\u5373\u5411\u4e0a\u53d6\u6574 \u7b97\u6570\u51fd\u6570 \u00b6 add()\uff0csubtract()\uff0cmultiply() \u548c divide() reciprocal() : \u8fd4\u56de\u53c2\u6570\u9010\u5143\u7d20\u7684\u5012\u6570,\u5982 1/4 \u5012\u6570\u4e3a 4/1 power() : \u5c06\u7b2c\u4e00\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u4f5c\u4e3a\u5e95\u6570\uff0c\u8ba1\u7b97\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u5e42 mod() : \u8ba1\u7b97\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u76f8\u9664\u540e\u7684\u4f59\u6570 \u7edf\u8ba1\u51fd\u6570 \u00b6 amin() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5c0f\u503c amax() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5927\u503c ptp() : \u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u6700\u5927\u503c\u4e0e\u6700\u5c0f\u503c\u7684\u5dee\uff08\u6700\u5927\u503c - \u6700\u5c0f\u503c\uff09 percentile() : \u767e\u5206\u4f4d\u6570\u662f\u7edf\u8ba1\u4e2d\u4f7f\u7528\u7684\u5ea6\u91cf\uff0c\u8868\u793a\u5c0f\u4e8e\u8fd9\u4e2a\u503c\u7684\u89c2\u5bdf\u503c\u7684\u767e\u5206\u6bd4 median() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4 a \u4e2d\u5143\u7d20\u7684\u4e2d\u4f4d\u6570\uff08\u4e2d\u503c\uff09 mean() : \u8fd4\u56de\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u7b97\u672f\u5e73\u5747\u503c\uff0c\u5982\u679c\u63d0\u4f9b\u4e86\u8f74\uff0c\u5219\u6cbf\u5176\u8ba1\u7b97 average() : \u6839\u636e\u5728\u53e6\u4e00\u4e2a\u6570\u7ec4\u4e2d\u7ed9\u51fa\u7684\u5404\u81ea\u7684\u6743\u91cd\u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u52a0\u6743\u5e73\u5747\u503c sqrt(mean((x - x.mean())**2)) : \u6807\u51c6\u5dee\u516c\u5f0f mean((x - x.mean())** 2) : \u65b9\u5dee \u6392\u5e8f\u3001\u6761\u4ef6\u7b5b\u9009\u51fd\u6570 \u00b6 sort() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u7684\u6392\u5e8f\u526f\u672c lexsort() : \u7528\u4e8e\u5bf9\u591a\u4e2a\u5e8f\u5217\u8fdb\u884c\u6392\u5e8f nonzero() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u975e\u96f6\u5143\u7d20\u7684\u7d22\u5f15 where() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u6ee1\u8db3\u7ed9\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u7d22\u5f15 extract() : \u6839\u636e\u67d0\u4e2a\u6761\u4ef6\u4ece\u6570\u7ec4\u4e2d\u62bd\u53d6\u5143\u7d20\uff0c\u8fd4\u56de\u6ee1\u6761\u4ef6\u7684\u5143\u7d20 \u7ebf\u6027\u4ee3\u6570 \u00b6 numpy.dot() : \u4e24\u4e2a\u6570\u7ec4\u7684\u70b9\u79ef\uff0c\u5373\u5143\u7d20\u5bf9\u5e94\u76f8\u4e58 numpy.vdot() : \u4e24\u4e2a\u5411\u91cf\u7684\u70b9\u79ef numpy.inner() : \u4e24\u4e2a\u6570\u7ec4\u7684\u5185\u79ef numpy.matmul() : \u4e24\u4e2a\u6570\u7ec4\u7684\u77e9\u9635\u79ef numpy.determinant() : \u6570\u7ec4\u7684\u884c\u5217\u5f0f numpy.solve() : \u6c42\u89e3\u7ebf\u6027\u77e9\u9635\u65b9\u7a0b numpy.inv() : \u8ba1\u7b97\u77e9\u9635\u7684\u4e58\u6cd5\u9006\u77e9\u9635 numpy.matlib.empty() : \u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u77e9\u9635\uff0c\u5143\u7d20\u968f\u673a numpy.matlib.zeros() : \u521b\u5efa\u4e00\u4e2a\u4ee5 0 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.one() : \u521b\u5efa\u4e00\u4e2a\u4ee5 1 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.eye() : \u8fd4\u56de\u4e00\u4e2a\u77e9\u9635\uff0c\u5bf9\u89d2\u7ebf\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4e3a\u96f6 numpy.matlib.identity() : \u8fd4\u56de\u7ed9\u5b9a\u5927\u5c0f\u7684\u5355\u4f4d\u77e9\u9635 numpy.matlib.rand() : \u521b\u5efa\u4e00\u4e2a\u7ed9\u5b9a\u5927\u5c0f\u7684\u77e9\u9635\uff0c\u6570\u636e\u662f\u968f\u673a\u586b\u5145\u7684 \u5176\u4ed6 \u00b6 \u201c\u81ea\u52a8\u201d\u6574\u5f62 \u00b6 \u8981\u66f4\u6539\u6570\u7ec4\u7684\u5c3a\u5bf8\uff0c\u60a8\u53ef\u4ee5\u7701\u7565\u5176\u4e2d\u4e00\u4e2a\u5c3a\u5bf8\uff0c\u7136\u540e\u81ea\u52a8\u63a8\u5bfc\u51fa\u5c3a\u5bf8 >>> a = np . arange ( 30 ) >>> a . shape = 2 , - 1 , 3 # -1 means \"whatever is needed\" >>> a . shape ( 2 , 5 , 3 ) >>> a array ([[[ 0 , 1 , 2 ], [ 3 , 4 , 5 ], [ 6 , 7 , 8 ], [ 9 , 10 , 11 ], [ 12 , 13 , 14 ]], [[ 15 , 16 , 17 ], [ 18 , 19 , 20 ], [ 21 , 22 , 23 ], [ 24 , 25 , 26 ], [ 27 , 28 , 29 ]]]) \u77e2\u91cf\u5806\u53e0 \u00b6 \u901a\u8fc7 vstack \u7b49\u5c06\u6570\u7ec4\u5806\u53e0 x = np . arange ( 0 , 10 , 2 ) # x=([0,2,4,6,8]) y = np . arange ( 5 ) # y=([0,1,2,3,4]) m = np . vstack ([ x , y ]) # m=([[0,2,4,6,8], # [0,1,2,3,4]]) xy = np . hstack ([ x , y ]) # xy =([0,2,4,6,8,0,1,2,3,4]) \u76f4\u65b9\u56fe \u00b6 histogram\u5e94\u7528\u4e8e\u6570\u7ec4\u7684NumPy \u51fd\u6570\u8fd4\u56de\u4e00\u5bf9\u5411\u91cf\uff1a\u6570\u7ec4\u7684\u76f4\u65b9\u56fe\u548cbin\u7684\u5411\u91cf\u3002matplotlib\u8fd8\u6709\u4e00\u4e2a\u6784\u5efa\u76f4\u65b9\u56fe\u7684\u529f\u80fd\uff08hist\u5728Matlab\u4e2d\u79f0\u4e3a\uff09\uff0c\u4e0eNumPy\u4e2d\u7684\u76f4\u65b9\u56fe\u4e0d\u540c\u3002\u4e3b\u8981\u533a\u522b\u5728\u4e8epylab.hist\u81ea\u52a8\u7ed8\u5236\u76f4\u65b9\u56fe\uff0c\u800c numpy.histogram\u53ea\u751f\u6210\u6570\u636e >>> import numpy as np >>> import matplotlib.pyplot as plt >>> # Build a vector of 10000 normal deviates with variance 0.5^2 and mean 2 >>> mu , sigma = 2 , 0.5 >>> v = np . random . normal ( mu , sigma , 10000 ) >>> # Plot a normalized histogram with 50 bins >>> plt . hist ( v , bins = 50 , density = 1 ) # matplotlib version (plot) >>> plt . show () >>> # Compute the histogram with numpy and then plot it >>> ( n , bins ) = np . histogram ( v , bins = 50 , density = True ) # NumPy version (no plot) >>> plt . plot ( .5 * ( bins [ 1 :] + bins [: - 1 ]), n ) >>> plt . show () Reference \u00b6 Numpy \u5b98\u7f51 SciPy \u5b98\u7f51 Matplotlib \u5b98\u7f51 \u83dc\u9e1f\u6559\u7a0b Numpy \u5feb\u901f\u5165\u95e8 Numpy \u6570\u636e\u53ef\u89c6\u5316","title":"Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93"},{"location":"cs/pl/python/numpy/#numpy","text":"\u7ea6 2778 \u4e2a\u5b57 140 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u5728\u5b66\u4e60 Python\uff0c\u5c24\u5176\u662f\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c\u6700\u57fa\u7840\u7684 Numpy \u5341\u5206\u91cd\u8981\uff0c\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u73af\u5883\uff0c\u6240\u4ee5\u5fc5\u987b\u8981\u719f\u7ec3\u638c\u63e1\u3002 Numpy \u901a\u5e38\u4e0e SciPy(Scientific Python) \u548c Matplotlib(\u7ed8\u56fe\u5e93) \u4e00\u8d77\u98df\u7528\uff0c\u76f8\u5f53\u4e8e\u66ff\u4ee3\u4e86 MatLab\u3002","title":"Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93"},{"location":"cs/pl/python/numpy/#ndarray","text":"","title":"ndarray"},{"location":"cs/pl/python/numpy/#_1","text":"Numpy \u7684\u4e3b\u8981\u5bf9\u8c61\u65f6\u540c\u6784\u591a\u7ef4\u6570\u7ec4\u3002\u5b83\u662f\u4e00\u4e2a\u5143\u7d20\u8868\uff08\u901a\u5e38\u662f\u6570\u5b57\uff09\uff0c\u6240\u6709\u7c7b\u578b\u90fd\u76f8\u540c\uff0c\u7531\u975e\u8d1f\u6574\u6570\u5143\u7ec4\u7d22\u5f15\u3002\u5728 Numpy \u7ef4\u5ea6\u4e2d\u79f0\u4e3a \u8f74 \u3002 Numpy \u7684\u6570\u7ec4\u7c7b\u88ab\u8c03\u7528 ndarray \uff0c\u522b\u540d\u4e3a array \uff0c\u4f46\u548c Python \u7684 array.array \u533a\u522b\u5f88\u5927 ndarray.ndim : \u6570\u7ec4\u7684\u8f74\uff08\u7ef4\u5ea6\uff09\u7684\u4e2a\u6570\uff0c\u4e5f\u88ab\u79f0 rank ndarray.shape : \u6570\u7ec4\u7684\u7ef4\u5ea6\u3002\u4e00\u4e2a\u6574\u6570\u7684\u5143\u7956\uff0c\u8868\u793a\u6bcf\u4e2a\u7ef4\u5ea6\u4e2d\u6570\u7ec4\u7684\u5927\u5c0f\uff0cshape \u7684\u957f\u5ea6\u5c31\u662f rank \u6216\u7ef4\u5ea6\u7684\u4e2a\u6570 ndim ndarray.size : \u6570\u7ec4\u5143\u7d20\u7684\u603b\u6570\uff0c\u7b49\u4e8e shape \u5143\u7d20\u7684\u4e58\u79ef ndarray.dtype : \u63cf\u8ff0\u6570\u7ec4\u4e2d\u5143\u7d20\u7c7b\u578b\u7684\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684 Python \u7c7b\u578b\u521b\u5efa\u6216\u6307\u5b9a dtype\uff0c\u4e5f\u53ef\u4ee5\u7528 Numpy \u63d0\u4f9b\u7684\u4f8b\u5982 numpy.int32, numpy.float64 \u7b49 ndarray.itemsize : \u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u5b57\u8282\u5927\u5c0f\uff0c\u4f8b\u5982 float64 \u7684 itemsize \u5c31\u662f 64/8=8\uff0c\u7b49\u4e8e ndarray.dtype.itemsize ndarray.data : \u8be5\u7f13\u51b2\u533a\u5305\u542b\u6570\u7ec4\u7684\u5b9e\u9645\u5143\u7d20\uff0c\u901a\u5e38\u4e0d\u4f7f\u7528\uff0c\u53ea\u9700\u8981\u901a\u8fc7\u7d22\u5f15\u8bbf\u95ee element in ndarray >>> import numpy as np >>> a = np . arange ( 15 ) . reshape ( 3 , 5 ) >>> a array ([[ 0 , 1 , 2 , 3 , 4 ], [ 5 , 6 , 7 , 8 , 9 ], [ 10 , 11 , 12 , 13 , 14 ]]) >>> a . shape ( 3 , 5 ) >>> a . ndim 2 >>> a . dtype . name 'int64' >>> a . itemsize 8 >>> a . size 15 >>> type ( a ) < type 'numpy.ndarray' > >>> b = np . array ([ 6 , 7 , 8 ]) >>> b array ([ 6 , 7 , 8 ]) >>> type ( b ) < type 'numpy.ndarray' >","title":"\u5c5e\u6027"},{"location":"cs/pl/python/numpy/#_2","text":"a=np.array([2,3,4]) :\u4ece Python \u5217\u8868\u6216\u5143\u7ec4\u4e2d\u521b\u5efa\u6570\u7ec4\uff08\u7c7b\u578b\u63a8\u5bfc\uff09 b=np.array([(1,2,3),(4,5,6)]) : \u53ef\u4ee5\u5c06\u5e8f\u5217\u7684\u5e8f\u5217\u8f6c\u6362\u6210\u4e8c\u7ef4\u6570\u7ec4\uff0c\u751a\u81f3\u9ad8\u7ef4\u6570\u7ec4 c=np.array([[],[]], dtype=complex) : \u521b\u5efa\u65f6\u53ef\u4ee5\u663e\u5f0f\u6307\u5b9a\u6570\u7ec4\u7684\u7c7b\u578b dtype=complex \u5360\u4f4d\u7b26\u6570\u7ec4\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7684 dtype \u90fd\u662f float64 \uff09 np.zero() : \u521b\u5efa\u4e00\u4e2a\u7531 0 \u7ec4\u6210\u7684\u6570\u7ec4 np.ones() : \u521b\u5efa\u4e00\u4e2a\u7531 1 \u7ec4\u6210\u7684\u6570\u7ec4 np.empty() : \u521b\u5efa\u4e00\u4e2a\u6570\u7ec4\uff0c\u5185\u5bb9\u968f\u673a\uff08\u53d6\u51b3\u4e8e\u5185\u5b58\u72b6\u6001\uff09 np.arange() \uff0c\u521b\u5efa\u6570\u5b57\u7ec4\u6210\u7684\u6570\u7ec4\uff0c\u7c7b\u4f3c\u4e8e range \u7684\u51fd\u6570 \u5f53\u4e0e\u6d6e\u70b9\u53c2\u6570\u4e00\u8d77\u4f7f\u7528\u65f6\uff0c\u6700\u597d\u4f7f\u7528 linspace \u51fd\u6570\u63a5\u53d7\u60f3\u8981\u7684\u5143\u7d20\u6570\u91cf\u7684\u51fd\u6570\uff0c\u800c\u4e0d\u662f\u6b65\u957f step","title":"\u6570\u7ec4\u521b\u5efa"},{"location":"cs/pl/python/numpy/#_3","text":"Numpy \u4ee5\u5d4c\u5957\u5217\u8868\u7c7b\u4f3c\u7684\u65b9\u5f0f\u663e\u793a\uff0c\u6709\u4ee5\u4e0b\u5e03\u5c40 \u6700\u540e\u4e00\u4e2a\u8f74\u4ece\u5de6\u5230\u53f3\u6253\u5370 \u5012\u6570\u7b2c\u4e8c\u4e2a\u4ece\u4e0a\u5230\u4e0b\u6253\u5370 \u5176\u4f59\u90e8\u5206\u4ece\u4e0a\u5230\u4e0b\u6253\u5370\uff0c\u6bcf\u4e2a\u5207\u7247\u7528\u7a7a\u884c\u9694\u5f00 \u5f53\u6570\u7ec4\u592a\u5927\u800c\u65e0\u6cd5\u6253\u5370\u65f6\uff0cNumpy \u4f1a\u81ea\u52a8\u8df3\u8fc7\u6570\u7ec4\u7684\u4e2d\u5fc3\u90e8\u5206\u5e76\u4ec5\u6253\u5370\u89d2\u70b9\u3002\u8981\u7981\u7528\u6b64\u884c\u4e3a\u5e76\u5f3a\u5236NumPy\u6253\u5370\u6574\u4e2a\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u66f4\u6539\u6253\u5370\u9009\u9879 set_printoptions print array >>> a = np . arange ( 6 ) # 1d array >>> print ( a ) [ 0 1 2 3 4 5 ] >>> >>> b = np . arange ( 12 ) . reshape ( 4 , 3 ) # 2d array >>> print ( b ) [[ 0 1 2 ] [ 3 4 5 ] [ 6 7 8 ] [ 9 10 11 ]] >>> >>> c = np . arange ( 24 ) . reshape ( 2 , 3 , 4 ) # 3d array >>> print ( c ) [[[ 0 1 2 3 ] [ 4 5 6 7 ] [ 8 9 10 11 ]] [[ 12 13 14 15 ] [ 16 17 18 19 ] [ 20 21 22 23 ]]] >>> >>> print ( np . arange ( 10000 )) # 10000d array [ 0 1 2 ... , 9997 9998 9999 ] >>> >>> print ( np . arange ( 10000 ) . reshape ( 100 , 100 )) [[ 0 1 2 ... , 97 98 99 ] [ 100 101 102 ... , 197 198 199 ] [ 200 201 202 ... , 297 298 299 ] ... , [ 9700 9701 9702 ... , 9797 9798 9799 ] [ 9800 9801 9802 ... , 9897 9898 9899 ] [ 9900 9901 9902 ... , 9997 9998 9999 ]] >>> >>> np . set_printoptions ( threshold = sys . maxsize ) # sys module should be imported","title":"\u6253\u5370\u6570\u7ec4"},{"location":"cs/pl/python/numpy/#_4","text":"\u6570\u7ec4\u4e0a\u7684\u7b97\u6570\u8fd0\u7b97\u7b26\u4f1a\u5e94\u7528\u5230\u5143\u7d20\u7ea7\u522b \u4e58\u6cd5 * \u5728 array \u4e2d\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u77e9\u9635\u4e58\u6cd5\u53ef\u4ee5\u7528 @ \u6216 dot \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97 \u67d0\u4e9b\u64cd\u4f5c\u4f8b\u5982 +=\u3001*= \u4f1a\u76f4\u63a5\u66f4\u6539\u88ab\u64cd\u4f5c\u7684\u77e9\u9635\u6570\u7ec4\u800c\u4e0d\u4f1a\u521b\u5efa\u65b0\u77e9\u9635\u6570\u7ec4 \u5f53\u4f7f\u7528\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u7ed3\u679c\u6570\u7ec4\u7684\u7c7b\u578b\u5bf9\u5e94\u4e8e\u66f4\u4e00\u822c\u6216\u66f4\u7cbe\u786e\u7684\u6570\u7ec4\uff08\u79f0\u4e3a\u5411\u4e0a\u8f6c\u6362\u7684\u884c\u4e3a\uff09 \u8bb8\u591a\u4e00\u5143\u64cd\u4f5c\uff0c\u4f8b\u5982\u8ba1\u7b97\u6570\u7ec4\u4e2d\u6240\u6709\u5143\u7d20\u7684\u603b\u548c\uff0c\u90fd\u662f\u4f5c\u4e3a ndarray \u7c7b\u7684\u65b9\u6cd5\u5b9e\u73b0\u7684 min() max() sum() \u901a\u8fc7\u6307\u5b9a axis \u53c2\u6570\uff0c\u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6307\u5b9a\u8f74\u5e94\u7528\u64cd\u4f5c","title":"\u57fa\u672c\u64cd\u4f5c"},{"location":"cs/pl/python/numpy/#_5","text":"NumPy \u63d0\u4f9b\u719f\u6089\u7684\u6570\u5b66\u51fd\u6570\uff0c\u4f8b\u5982 sin \uff0c cos \u548c exp \u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u88ab\u79f0\u4e3a\u201c\u901a\u51fd\u6570\u201d\uff08ufunc\uff09\u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u51fd\u6570\u5728\u6570\u7ec4\u4e0a\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u4ea7\u751f\u4e00\u4e2a\u6570\u7ec4\u4f5c\u4e3a\u8f93\u51fa\u3002","title":"\u901a\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_6","text":"\u4e00\u7ef4\u7684\u6570\u7ec4\u53ef\u4ee5\u8fdb\u884c\u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3\u64cd\u4f5c\u7684\uff0c\u5c31\u50cf \u5217\u8868 \u548c\u5176\u4ed6 Python \u5e8f\u5217\u7c7b\u578b\u4e00\u6837 \u591a\u7ef4\u7684\u6570\u7ec4\u6bcf\u4e2a\u8f74\u53ef\u4ee5\u6709\u4e00\u4e2a\u7d22\u5f15\u3002\u8fd9\u4e9b\u7d22\u5f15\u4ee5\u9017\u53f7\u200b\u200b\u5206\u9694\u7684\u5143\u7ec4\u7ed9\u51fa \u5f53\u63d0\u4f9b\u7684\u7d22\u5f15\u5c11\u4e8e\u8f74\u7684\u6570\u91cf\u65f6\uff0c\u7f3a\u5931\u7684\u7d22\u5f15\u88ab\u8ba4\u4e3a\u662f\u5b8c\u6574\u7684\u5207\u7247 \u53ef\u4ee5\u4f7f\u7528 ... \u8868\u793a\u4ea7\u751f\u5b8c\u6574\u7d22\u5f15\u5143\u7ec4\u6240\u9700\u7684\u5192\u53f7\uff08\u5269\u4f59\u8f74\uff09\uff0c\u7528\u6765\u66ff\u4ee3 : \u4f8b\u5982 x \u662f rank \u4e3a 5 \u7684\u6570\u7ec4 x[1,2,...] = x[1,2,:,:,:] x[...,3] = x[:,:,:,:,3] x[4,...,5,:] = x[4,:,:,5,:] \u5bf9\u591a\u7ef4\u6570\u7ec4\u8fdb\u884c \u8fed\u4ee3\uff08Iterating\uff09 \u662f\u76f8\u5bf9\u4e8e\u7b2c\u4e00\u4e2a\u8f74\u5b8c\u6210\u7684 \u5982\u679c\u60f3\u8981\u5bf9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6267\u884c\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528 flat \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u662f\u6570\u7ec4\u7684\u6240\u6709\u5143\u7d20\u7684\u8fed\u4ee3\u5668","title":"\u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3"},{"location":"cs/pl/python/numpy/#_7","text":"","title":"\u5f62\u72b6\u64cd\u7eb5"},{"location":"cs/pl/python/numpy/#_8","text":"a.shape() : \u67e5\u770b\u6570\u7ec4\u7684\u5f62\u72b6 ravel() : \u5c06\u6570\u7ec4\u5e73\u5766\u5e76\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4 reshape(i, j, ...size) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4\uff0c\u5982\u679c size \u6307\u5b9a\u4e3a -1\uff0c\u5219\u4f1a\u81ea\u52a8\u8ba1\u7b97\u5176\u4ed6\u7684 size \u5927\u5c0f resize(i, j, ...) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u4fee\u6539\u6570\u7ec4\u672c\u8eab T : \u5c06\u6570\u7ec4\u8f6c\u7f6e","title":"\u6539\u53d8\u6570\u7ec4\u5f62\u72b6"},{"location":"cs/pl/python/numpy/#_9","text":"vstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u5782\u76f4\u5806\u53e0 hstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u6a2a\u5411\u5806\u53e0 coulumn_stack : 1D \u6570\u7ec4\u4f5c\u4e3a\u5217\u5806\u53e0\u5230 2D \u6570\u7ec4\u4e2d\uff0c\u76f8\u5f53\u4e8e hstack 2D \u6570\u7ec4 row_stack : \u7b49\u6548\u4e8e vstack \u4e8e\u4efb\u4f55\u8f93\u5165\u6570\u7ec4 r_\u3001c_ : \u901a\u8fc7\u6cbf\u4e00\u4e2a\u8f74\u5806\u53e0\u6570\u7ec4\u6765\u521b\u5efa\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u8303\u56f4\u4e3a\u64cd\u4f5c\u7b26 :","title":"\u5c06\u4e0d\u540c\u6570\u7ec4\u5806\u53e0"},{"location":"cs/pl/python/numpy/#_10","text":"hsplit() : \u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6c34\u5e73\u8f74\u62c6\u5206\u6570\u7ec4\uff0c\u65b9\u6cd5\u662f\u6307\u5b9a\u8981\u8fd4\u56de\u7684\u5f62\u72b6\u76f8\u7b49\u7684\u6570\u7ec4\u7684\u6570\u91cf\uff0c\u6216\u8005\u6307\u5b9a\u5e94\u8be5\u5728\u5176\u4e4b\u540e\u8fdb\u884c\u5206\u5272\u7684\u5217 vsplit() : \u6cbf\u5782\u76f4\u8f74\u5206\u5272","title":"\u5c06\u4e00\u4e2a\u6570\u7ec4\u62c6\u5206\u6210\u51e0\u4e2a\u8f83\u5c0f\u7684\u6570\u7ec4"},{"location":"cs/pl/python/numpy/#_11","text":"","title":"\u62f7\u8d1d\u548c\u89c6\u56fe"},{"location":"cs/pl/python/numpy/#_12","text":"\u7b80\u5355\u5206\u914d\u4e0d\u4f1a\u590d\u5236\u6570\u7ec4\u5bf9\u8c61\u6216\u5176\u6570\u636e Python\u5c06\u53ef\u53d8\u5bf9\u8c61\u4f5c\u4e3a\u5f15\u7528\u4f20\u9012\uff0c\u56e0\u6b64\u51fd\u6570\u8c03\u7528\u4e0d\u4f1a\u590d\u5236","title":"\u5b8c\u5168\u4e0d\u590d\u5236"},{"location":"cs/pl/python/numpy/#_13","text":"\u4e0d\u540c\u7684\u6570\u7ec4\u5bf9\u8c61\u53ef\u4ee5\u5171\u4eab\u76f8\u540c\u7684\u6570\u636e view() : \u521b\u5efa\u4e00\u4e2a\u67e5\u770b\u76f8\u540c\u6570\u636e\u7684\u65b0\u6570\u7ec4\u5bf9\u8c61 \u5207\u7247\u6570\u7ec4\u4f1a\u8fd4\u56de\u4e00\u4e2a\u89c6\u56fe","title":"\u89c6\u56fe\u6216\u6d45\u62f7\u8d1d"},{"location":"cs/pl/python/numpy/#_14","text":"copy() : \u751f\u6210\u6570\u7ec4\u53ca\u5176\u6570\u636e\u7684\u5b8c\u6574\u526f\u672c \u5982\u679c\u4e0d\u518d\u9700\u8981\u539f\u59cb\u6570\u7ec4\uff0c\u5219\u5e94\u5728\u5207\u7247\u540e\u8c03\u7528 copy()","title":"\u6df1\u62f7\u8d1d"},{"location":"cs/pl/python/numpy/#_15","text":"\u5e7f\u64ad(Broadcast)\u662f numpy \u5bf9\u4e0d\u540c\u5f62\u72b6(shape)\u7684\u6570\u7ec4\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\u7684\u65b9\u5f0f\uff0c \u5bf9\u6570\u7ec4\u7684\u7b97\u672f\u8fd0\u7b97\u901a\u5e38\u5728\u76f8\u5e94\u7684\u5143\u7d20\u4e0a\u8fdb\u884c \u5982\u679c\u4e24\u4e2a\u6570\u7ec4 a \u548c b \u5f62\u72b6\u76f8\u540c\uff0c\u5373\u6ee1\u8db3 a.shape == b.shape\uff0c\u90a3\u4e48 a*b \u7684\u7ed3\u679c\u5c31\u662f a \u4e0e b \u6570\u7ec4\u5bf9\u5e94\u4f4d\u76f8\u4e58 \u5f53\u8fd0\u7b97\u4e2d\u7684 2 \u4e2a\u6570\u7ec4\u7684\u5f62\u72b6\u4e0d\u540c\u65f6\uff0cnumpy \u5c06\u81ea\u52a8\u89e6\u53d1\u5e7f\u64ad\u673a\u5236 \u89c4\u5219: \u5bf9\u4e24\u4e2a\u6570\u7ec4\uff0c\u5206\u522b\u6bd4\u8f83\u4ed6\u4eec\u7684\u6bcf\u4e00\u4e2a\u7ef4\u5ea6\uff08\u82e5\u5176\u4e2d\u4e00\u4e2a\u6570\u7ec4\u6ca1\u6709\u5f53\u524d\u7ef4\u5ea6\u5219\u5ffd\u7565\uff09 \u6570\u7ec4\u62e5\u6709\u76f8\u540c\u5f62\u72b6 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u76f8\u7b49 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u6709\u4e00\u4e2a\u662f 1 \u82e5\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c\u629b\u51fa \"ValueError: frames are not aligned\" \u5f02\u5e38","title":"\u5e7f\u64ad"},{"location":"cs/pl/python/numpy/#_16","text":"","title":"\u7d22\u5f15\u6280\u5de7"},{"location":"cs/pl/python/numpy/#_17","text":"\u6574\u6570\u6570\u7ec4\u7d22\u5f15\u662f\u6307\u4f7f\u7528\u4e00\u4e2a\u6570\u7ec4\u6765\u8bbf\u95ee\u53e6\u4e00\u4e2a\u6570\u7ec4\u7684\u5143\u7d20\u3002\u8fd9\u4e2a\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u76ee\u6807\u6570\u7ec4\u4e2d\u67d0\u4e2a\u7ef4\u5ea6\u4e0a\u7684\u7d22\u5f15\u503c\u3002 >>> a = np . arange ( 12 ) ** 2 # the first 12 square numbers >>> i = np . array ( [ 1 , 1 , 3 , 8 , 5 ] ) # an array of indices >>> a [ i ] # the elements of a at the positions i array ([ 1 , 1 , 9 , 64 , 25 ]) >>> >>> j = np . array ( [ [ 3 , 4 ], [ 9 , 7 ] ] ) # a bidimensional array of indices >>> a [ j ] # the same shape as j array ([[ 9 , 16 ], [ 81 , 49 ]])","title":"\u6574\u6570\u6570\u7ec4\u7d22\u5f15"},{"location":"cs/pl/python/numpy/#_18","text":"\u5e03\u5c14\u7d22\u5f15\u901a\u8fc7\u5e03\u5c14\u8fd0\u7b97\uff08\u5982\uff1a\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff09\u6765\u83b7\u53d6\u7b26\u5408\u6307\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u6570\u7ec4 >>> a = np . arange ( 12 ) . reshape ( 3 , 4 ) >>> b = a > 4 >>> b # b is a boolean with a's shape array ([[ False , False , False , False ], [ False , True , True , True ], [ True , True , True , True ]]) >>> a [ b ] # 1d array with the selected elements array ([ 5 , 6 , 7 , 8 , 9 , 10 , 11 ])","title":"\u5e03\u5c14\u6570\u7ec4\u7d22\u5f15"},{"location":"cs/pl/python/numpy/#ix_","text":"ix_ \u51fd\u6570\u53ef\u7528\u4e8e\u7ec4\u5408\u4e0d\u540c\u7684\u5411\u91cf\uff0c\u4ee5\u4fbf\u83b7\u5f97\u6bcf\u4e2an-uplet\u7684\u7ed3\u679c >>> a = np . array ([ 2 , 3 , 4 , 5 ]) >>> b = np . array ([ 8 , 5 , 4 ]) >>> c = np . array ([ 5 , 4 , 6 , 8 , 3 ]) >>> ax , bx , cx = np . ix_ ( a , b , c ) >>> ax array ([[[ 2 ]], [[ 3 ]], [[ 4 ]], [[ 5 ]]]) >>> bx array ([[[ 8 ], [ 5 ], [ 4 ]]]) >>> cx array ([[[ 5 , 4 , 6 , 8 , 3 ]]]) >>> ax . shape , bx . shape , cx . shape (( 4 , 1 , 1 ), ( 1 , 3 , 1 ), ( 1 , 1 , 5 )) >>> result = ax + bx * cx >>> result array ([[[ 42 , 34 , 50 , 66 , 26 ], [ 27 , 22 , 32 , 42 , 17 ], [ 22 , 18 , 26 , 34 , 14 ]], [[ 43 , 35 , 51 , 67 , 27 ], [ 28 , 23 , 33 , 43 , 18 ], [ 23 , 19 , 27 , 35 , 15 ]], [[ 44 , 36 , 52 , 68 , 28 ], [ 29 , 24 , 34 , 44 , 19 ], [ 24 , 20 , 28 , 36 , 16 ]], [[ 45 , 37 , 53 , 69 , 29 ], [ 30 , 25 , 35 , 45 , 20 ], [ 25 , 21 , 29 , 37 , 17 ]]]) >>> result [ 3 , 2 , 4 ] 17 >>> a [ 3 ] + b [ 2 ] * c [ 4 ] 17","title":"ix_()\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_19","text":"bitwise_and() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u4e0e\u64cd\u4f5c bitwise_or() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u6216\u64cd\u4f5c invert() : \u6309\u4f4d\u53d6\u53cd left_shift() : \u5411\u5de6\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d right_shift() : \u5411\u53f3\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d","title":"\u4f4d\u8fd0\u7b97"},{"location":"cs/pl/python/numpy/#_20","text":"","title":"\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_21","text":"add() : \u5bf9\u4e24\u4e2a\u6570\u7ec4\u7684\u9010\u4e2a\u5b57\u7b26\u4e32\u5143\u7d20\u8fdb\u884c\u8fde\u63a5 multiply() : \u8fd4\u56de\u6309\u5143\u7d20\u591a\u91cd\u8fde\u63a5\u540e\u7684\u5b57\u7b26\u4e32 center() : \u5c45\u4e2d\u5b57\u7b26\u4e32 capitalize() : \u5c06\u5b57\u7b26\u4e32\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 title() : \u5c06\u5b57\u7b26\u4e32\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 lower() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5c0f\u5199 upper() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5927\u5199 split() : \u6307\u5b9a\u5206\u9694\u7b26\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u5206\u5272\uff0c\u5e76\u8fd4\u56de\u6570\u7ec4\u5217\u8868 splitlines() : \u8fd4\u56de\u5143\u7d20\u4e2d\u7684\u884c\u5217\u8868\uff0c\u4ee5\u6362\u884c\u7b26\u5206\u5272 strip() : \u79fb\u9664\u5143\u7d20\u5f00\u5934\u6216\u8005\u7ed3\u5c3e\u5904\u7684\u7279\u5b9a\u5b57\u7b26 join() : \u901a\u8fc7\u6307\u5b9a\u5206\u9694\u7b26\u6765\u8fde\u63a5\u6570\u7ec4\u4e2d\u7684\u5143\u7d20 replace() : \u4f7f\u7528\u65b0\u5b57\u7b26\u4e32\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b50\u5b57\u7b26\u4e32 decode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.decode encode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.encode","title":"\u5b57\u7b26\u4e32\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_22","text":"sin(), cos(), tan() \u7b49\u4e09\u89d2\u51fd\u6570 around() : \u8fd4\u56de\u6307\u5b9a\u6570\u5b57\u7684\u56db\u820d\u4e94\u5165\u503c floor() : \u8fd4\u56de\u5c0f\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5927\u6574\u6570\uff0c\u5373\u5411\u4e0b\u53d6\u6574 ceil() : \u8fd4\u56de\u5927\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5c0f\u6574\u6570\uff0c\u5373\u5411\u4e0a\u53d6\u6574","title":"\u6570\u5b66\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_23","text":"add()\uff0csubtract()\uff0cmultiply() \u548c divide() reciprocal() : \u8fd4\u56de\u53c2\u6570\u9010\u5143\u7d20\u7684\u5012\u6570,\u5982 1/4 \u5012\u6570\u4e3a 4/1 power() : \u5c06\u7b2c\u4e00\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u4f5c\u4e3a\u5e95\u6570\uff0c\u8ba1\u7b97\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u5e42 mod() : \u8ba1\u7b97\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u76f8\u9664\u540e\u7684\u4f59\u6570","title":"\u7b97\u6570\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_24","text":"amin() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5c0f\u503c amax() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5927\u503c ptp() : \u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u6700\u5927\u503c\u4e0e\u6700\u5c0f\u503c\u7684\u5dee\uff08\u6700\u5927\u503c - \u6700\u5c0f\u503c\uff09 percentile() : \u767e\u5206\u4f4d\u6570\u662f\u7edf\u8ba1\u4e2d\u4f7f\u7528\u7684\u5ea6\u91cf\uff0c\u8868\u793a\u5c0f\u4e8e\u8fd9\u4e2a\u503c\u7684\u89c2\u5bdf\u503c\u7684\u767e\u5206\u6bd4 median() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4 a \u4e2d\u5143\u7d20\u7684\u4e2d\u4f4d\u6570\uff08\u4e2d\u503c\uff09 mean() : \u8fd4\u56de\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u7b97\u672f\u5e73\u5747\u503c\uff0c\u5982\u679c\u63d0\u4f9b\u4e86\u8f74\uff0c\u5219\u6cbf\u5176\u8ba1\u7b97 average() : \u6839\u636e\u5728\u53e6\u4e00\u4e2a\u6570\u7ec4\u4e2d\u7ed9\u51fa\u7684\u5404\u81ea\u7684\u6743\u91cd\u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u52a0\u6743\u5e73\u5747\u503c sqrt(mean((x - x.mean())**2)) : \u6807\u51c6\u5dee\u516c\u5f0f mean((x - x.mean())** 2) : \u65b9\u5dee","title":"\u7edf\u8ba1\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_25","text":"sort() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u7684\u6392\u5e8f\u526f\u672c lexsort() : \u7528\u4e8e\u5bf9\u591a\u4e2a\u5e8f\u5217\u8fdb\u884c\u6392\u5e8f nonzero() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u975e\u96f6\u5143\u7d20\u7684\u7d22\u5f15 where() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u6ee1\u8db3\u7ed9\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u7d22\u5f15 extract() : \u6839\u636e\u67d0\u4e2a\u6761\u4ef6\u4ece\u6570\u7ec4\u4e2d\u62bd\u53d6\u5143\u7d20\uff0c\u8fd4\u56de\u6ee1\u6761\u4ef6\u7684\u5143\u7d20","title":"\u6392\u5e8f\u3001\u6761\u4ef6\u7b5b\u9009\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_26","text":"numpy.dot() : \u4e24\u4e2a\u6570\u7ec4\u7684\u70b9\u79ef\uff0c\u5373\u5143\u7d20\u5bf9\u5e94\u76f8\u4e58 numpy.vdot() : \u4e24\u4e2a\u5411\u91cf\u7684\u70b9\u79ef numpy.inner() : \u4e24\u4e2a\u6570\u7ec4\u7684\u5185\u79ef numpy.matmul() : \u4e24\u4e2a\u6570\u7ec4\u7684\u77e9\u9635\u79ef numpy.determinant() : \u6570\u7ec4\u7684\u884c\u5217\u5f0f numpy.solve() : \u6c42\u89e3\u7ebf\u6027\u77e9\u9635\u65b9\u7a0b numpy.inv() : \u8ba1\u7b97\u77e9\u9635\u7684\u4e58\u6cd5\u9006\u77e9\u9635 numpy.matlib.empty() : \u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u77e9\u9635\uff0c\u5143\u7d20\u968f\u673a numpy.matlib.zeros() : \u521b\u5efa\u4e00\u4e2a\u4ee5 0 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.one() : \u521b\u5efa\u4e00\u4e2a\u4ee5 1 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.eye() : \u8fd4\u56de\u4e00\u4e2a\u77e9\u9635\uff0c\u5bf9\u89d2\u7ebf\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4e3a\u96f6 numpy.matlib.identity() : \u8fd4\u56de\u7ed9\u5b9a\u5927\u5c0f\u7684\u5355\u4f4d\u77e9\u9635 numpy.matlib.rand() : \u521b\u5efa\u4e00\u4e2a\u7ed9\u5b9a\u5927\u5c0f\u7684\u77e9\u9635\uff0c\u6570\u636e\u662f\u968f\u673a\u586b\u5145\u7684","title":"\u7ebf\u6027\u4ee3\u6570"},{"location":"cs/pl/python/numpy/#_27","text":"","title":"\u5176\u4ed6"},{"location":"cs/pl/python/numpy/#_28","text":"\u8981\u66f4\u6539\u6570\u7ec4\u7684\u5c3a\u5bf8\uff0c\u60a8\u53ef\u4ee5\u7701\u7565\u5176\u4e2d\u4e00\u4e2a\u5c3a\u5bf8\uff0c\u7136\u540e\u81ea\u52a8\u63a8\u5bfc\u51fa\u5c3a\u5bf8 >>> a = np . arange ( 30 ) >>> a . shape = 2 , - 1 , 3 # -1 means \"whatever is needed\" >>> a . shape ( 2 , 5 , 3 ) >>> a array ([[[ 0 , 1 , 2 ], [ 3 , 4 , 5 ], [ 6 , 7 , 8 ], [ 9 , 10 , 11 ], [ 12 , 13 , 14 ]], [[ 15 , 16 , 17 ], [ 18 , 19 , 20 ], [ 21 , 22 , 23 ], [ 24 , 25 , 26 ], [ 27 , 28 , 29 ]]])","title":"\u201c\u81ea\u52a8\u201d\u6574\u5f62"},{"location":"cs/pl/python/numpy/#_29","text":"\u901a\u8fc7 vstack \u7b49\u5c06\u6570\u7ec4\u5806\u53e0 x = np . arange ( 0 , 10 , 2 ) # x=([0,2,4,6,8]) y = np . arange ( 5 ) # y=([0,1,2,3,4]) m = np . vstack ([ x , y ]) # m=([[0,2,4,6,8], # [0,1,2,3,4]]) xy = np . hstack ([ x , y ]) # xy =([0,2,4,6,8,0,1,2,3,4])","title":"\u77e2\u91cf\u5806\u53e0"},{"location":"cs/pl/python/numpy/#_30","text":"histogram\u5e94\u7528\u4e8e\u6570\u7ec4\u7684NumPy \u51fd\u6570\u8fd4\u56de\u4e00\u5bf9\u5411\u91cf\uff1a\u6570\u7ec4\u7684\u76f4\u65b9\u56fe\u548cbin\u7684\u5411\u91cf\u3002matplotlib\u8fd8\u6709\u4e00\u4e2a\u6784\u5efa\u76f4\u65b9\u56fe\u7684\u529f\u80fd\uff08hist\u5728Matlab\u4e2d\u79f0\u4e3a\uff09\uff0c\u4e0eNumPy\u4e2d\u7684\u76f4\u65b9\u56fe\u4e0d\u540c\u3002\u4e3b\u8981\u533a\u522b\u5728\u4e8epylab.hist\u81ea\u52a8\u7ed8\u5236\u76f4\u65b9\u56fe\uff0c\u800c numpy.histogram\u53ea\u751f\u6210\u6570\u636e >>> import numpy as np >>> import matplotlib.pyplot as plt >>> # Build a vector of 10000 normal deviates with variance 0.5^2 and mean 2 >>> mu , sigma = 2 , 0.5 >>> v = np . random . normal ( mu , sigma , 10000 ) >>> # Plot a normalized histogram with 50 bins >>> plt . hist ( v , bins = 50 , density = 1 ) # matplotlib version (plot) >>> plt . show () >>> # Compute the histogram with numpy and then plot it >>> ( n , bins ) = np . histogram ( v , bins = 50 , density = True ) # NumPy version (no plot) >>> plt . plot ( .5 * ( bins [ 1 :] + bins [: - 1 ]), n ) >>> plt . show ()","title":"\u76f4\u65b9\u56fe"},{"location":"cs/pl/python/numpy/#reference","text":"Numpy \u5b98\u7f51 SciPy \u5b98\u7f51 Matplotlib \u5b98\u7f51 \u83dc\u9e1f\u6559\u7a0b Numpy \u5feb\u901f\u5165\u95e8 Numpy \u6570\u636e\u53ef\u89c6\u5316","title":"Reference"},{"location":"cs/pl/python/virtual/","text":"\u865a\u62df\u73af\u5883 \u00b6 \u7ea6 203 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f virtualenv \u00b6 pip install virtualenv : \u5b89\u88c5 virtualenv 'name' : \u521b\u5efa\u865a\u62df\u73af\u5883 cd venv && source ./vin/activate : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 rm -rf venv : \u5220\u9664\u865a\u62df\u73af\u5883 conda \u00b6 \u4e0b\u8f7d anaconda \u5b89\u88c5\u7684 python \u76f4\u63a5\u53ef\u4ee5\u4f7f\u7528 conda \u5de5\u5177 conda create --name 'name' python=3.9 -y : \u521b\u5efa\u865a\u62df\u73af\u5883 source activate venv : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 source deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 conda remove --name 'name' --all : \u5220\u9664\u865a\u62df\u73af\u5883 conda info -e / conda env list : \u5217\u51fa\u7cfb\u7edf\u5b58\u5728\u7684\u865a\u62df\u73af\u5883 conda list : \u67e5\u770b\u5f53\u524d\u73af\u5883\u4e0b\u5df2\u5b89\u88c5\u7684\u5305 conda list --name 'name' : \u67e5\u770b\u67d0\u4e2a\u6307\u5b9a\u73af\u5883\u7684\u5df2\u5b89\u88c5\u5305 conda search numpy : \u67e5\u770b package \u4fe1\u606f conda install --name 'name' numpy : \u5b89\u88c5package\uff0c\u5982\u679c\u4e0d\u7528-n\u6307\u5b9a\u73af\u5883\u540d\u79f0\uff0c\u5219\u88ab\u5b89\u88c5\u5728\u5f53\u524d\u6fc0\u6d3b\u73af\u5883 conda update --name 'name' numpy : \u66f4\u65b0 package conda remove --name 'name'numpy : \u5220\u9664 package","title":"Python \u865a\u62df\u73af\u5883"},{"location":"cs/pl/python/virtual/#_1","text":"\u7ea6 203 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f","title":"\u865a\u62df\u73af\u5883"},{"location":"cs/pl/python/virtual/#virtualenv","text":"pip install virtualenv : \u5b89\u88c5 virtualenv 'name' : \u521b\u5efa\u865a\u62df\u73af\u5883 cd venv && source ./vin/activate : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 rm -rf venv : \u5220\u9664\u865a\u62df\u73af\u5883","title":"virtualenv"},{"location":"cs/pl/python/virtual/#conda","text":"\u4e0b\u8f7d anaconda \u5b89\u88c5\u7684 python \u76f4\u63a5\u53ef\u4ee5\u4f7f\u7528 conda \u5de5\u5177 conda create --name 'name' python=3.9 -y : \u521b\u5efa\u865a\u62df\u73af\u5883 source activate venv : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 source deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 conda remove --name 'name' --all : \u5220\u9664\u865a\u62df\u73af\u5883 conda info -e / conda env list : \u5217\u51fa\u7cfb\u7edf\u5b58\u5728\u7684\u865a\u62df\u73af\u5883 conda list : \u67e5\u770b\u5f53\u524d\u73af\u5883\u4e0b\u5df2\u5b89\u88c5\u7684\u5305 conda list --name 'name' : \u67e5\u770b\u67d0\u4e2a\u6307\u5b9a\u73af\u5883\u7684\u5df2\u5b89\u88c5\u5305 conda search numpy : \u67e5\u770b package \u4fe1\u606f conda install --name 'name' numpy : \u5b89\u88c5package\uff0c\u5982\u679c\u4e0d\u7528-n\u6307\u5b9a\u73af\u5883\u540d\u79f0\uff0c\u5219\u88ab\u5b89\u88c5\u5728\u5f53\u524d\u6fc0\u6d3b\u73af\u5883 conda update --name 'name' numpy : \u66f4\u65b0 package conda remove --name 'name'numpy : \u5220\u9664 package","title":"conda"},{"location":"cs/software/","text":"\u8f6f\u4ef6\u76f8\u5173 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u8f6f\u4ef6\u76f8\u5173\u4e66\u7c4d\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u8bbe\u8ba1\u6a21\u5f0f \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\uff08\u738b\u6620\u8f89\u8457\uff09 COM \u539f\u7406\u4e0e\u5e94\u7528\uff08\u6f58\u7231\u6c11\u8457\uff09 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0\uff08\u738b\u5343\u7965\u8457\uff09","title":"\u8f6f\u4ef6\u76f8\u5173"},{"location":"cs/software/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u8f6f\u4ef6\u76f8\u5173\u4e66\u7c4d\u7684\u7b14\u8bb0","title":"\u8f6f\u4ef6\u76f8\u5173"},{"location":"cs/software/#table-of-contents","text":"\u8bbe\u8ba1\u6a21\u5f0f \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\uff08\u738b\u6620\u8f89\u8457\uff09 COM \u539f\u7406\u4e0e\u5e94\u7528\uff08\u6f58\u7231\u6c11\u8457\uff09 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0\uff08\u738b\u5343\u7965\u8457\uff09","title":"Table of Contents"},{"location":"cs/software/compa/","text":"COM \u539f\u7406\u4e0e\u5e94\u7528 \u00b6 \u7ea6 1108 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u81ea\u5b66\uff0c\u5bfc\u5e08\u63a8\u8350\u7684\u4e66\u7c4d\uff0c\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b\uff0c\u4ec5\u5b66\u4e60 \u7b2c\u4e00\u90e8\u5206 COM \u662f\u7531 Microsoft \u63d0\u51fa\u7684\u7ec4\u4ef6\u6807\u51c6\uff0c\u5b83\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u4ea4\u4e92\u7684\u6807\u51c6\uff0c \u4e95\u4e14\u4e5f\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u7684\u73af\u5883\u3002\u5728 COM \u6807\u51c6\u4e2d\uff0c\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u4e5f\u88ab\u79f0\u4e3a\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u53ef\u4ee5\u662f\u4e00\u4e2a\u52a8\u6001\u8fde\u63a5\u5e93(\u7f29\u5199\u4e3a DLL )\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5185\u7ec4 \u4ef6 (in-process component);\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f(\u5373 EXE \u7a0b\u5e8f)\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5916\u7ec4\u4ef6(out-of-process component)\u3002\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u56e0\u4e3a COM \u662f\u4ee5\u5bf9\u8c61\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b\uff0c\u6240\u4ee5\u5728\u7a0b\u5e8f\u4e0e\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u65f6\uff0c\u901a\u4fe1\u7684\u53cc\u65b9\u5e94\u8be5\u662f\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u4e5f\u53eb\u505a COM \u5bf9\u8c61\uff0c\u800c\u7ec4\u4ef6\u7a0b\u5e8f\uff08\u6216\u79f0\u505a COM \u7a0b\u5e8f\uff09\u662f\u63d0\u4f9b COM \u5bf9\u8c61\u7684\u4ee3\u7801\u8f7d\u4f53\u3002 \u2014\u2014\u2014\u2014 COM \u662f\u4ec0\u4e48 \u6982\u8ff0 \u00b6 \u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\u2014\u2014COM \u00b6 COM\u4e0d\u4ec5\u4ec5\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u6807\u51c6\uff0c\u5b83\u8fd8\u5f15\u4eba\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u601d\u60f3\u3002\u5728COM\u6807\u6dee\u4e2d\uff0c\u5bf9\u8c61\u662f\u4e00\u4e2a\u975e\u5e38\u6d3b\u8054\u7684\u5143\u7d20\uff0c\u6211\u4eec\u4e5f\u7ecf\u5e38\u628a\u5b83\u79f0\u4e3aCOM\u5bf9\u8c61\u3002\u7ec4\u4ef6\u6a21\u5757\u4e3aCOM\u5bf9\u8c61\u63d0\u4f9b\u4e86\u6d3b\u52a8\u7684\u7a7a\u95f4\uff0cCOM\u5bf9\u8c61\u4ee5\u63a5\u53e3\u7684\u65b9\u5f0f\u63d0\u4f9b\u670d\u52a1\uff0c\u6211\u4eec\u628a\u8fd9\u79cd\u63a5\u53e3\u79f0\u4e3aCOM\u63a5\u53e3\u3002 COM \u7ed3\u6784 \u00b6 \u5bf9\u8c61\u4e0e\u63a5\u53e3 \u00b6 COM \u5bf9\u8c61\u7c7b\u4f3c\u4e8e C++ \u4e2d\u5bf9\u8c61\u7684\u6982\u5ff5\uff0c\u5bf9\u8c61\u662f\u67d0\u4e2a\u7c7b(class)\u7684\u4e00\u4e2a\u5b9e\u4f8b;\u800c\u7c7b\u5219\u662f\u4e00\u7ec4\u76f8\u5173\u7684\u6570\u636e\u548c\u529f\u80fd\u7ec4\u5408\u5728\u4e00\u8d77\u7684\u4e00\u4e2a\u5b9a\u4e49\u3002\u4f7f\u7528\u5bf9\u8c61\u7684\u5e94\u7528(\u6216\u53e6\u4e00\u4e2a\u5bf9\u8c61)\u79f0\u4e3a\u5ba2\u6237\u3002 \u63a5\u53e3\u662f\u4e00\u7ec4\u903b\u8f91\u4e0a\u76f8\u5173\u7684\u51fd\u6570\u96c6\u5408\uff0c\u5176\u51fd\u6570\u4e5f\u88ab\u79f0\u4e3a\u63a5\u53e3\u6210\u5458\u51fd\u6570\u3002 \u5bf9\u8c61\u901a\u8fc7\u63a5\u53e3\u6210\u5458\u51fd\u6570\u4e3a\u5ba2\u6237\u63d0\u4f9b\u5404\u79cd\u5f62\u5f0f\u7684\u670d\u52a1\u3002 \u6bcf\u4e2a\u63a5\u53e3\u90fd\u7531\u4e00\u4e2a 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26(GUID)\u6765\u6807\u8bc6\u3002\u5ba2\u6237\u901a\u8fc7 GUID \u83b7\u5f97\u63a5\u53e3\u7684\u6307\u9488\u3002 \u6bcf\u4e2a\u5bf9\u8c61\u90fd\u6709\u4e00\u4e2a 128 \u4f4d\u7684 GUID \u6765\u6807\u8bc6\uff0c\u79f0\u4e3a CLSID\uff0c\u4fdd\u8bc1\u5728\u5168\u7403\u8303\u56f4\u5185\u7684\u552f\u4e00\u6027\u3002 \u5bf9\u4e8e\u5ba2\u6237\u6765\u8bf4\uff0c\u53ea\u4e0e\u63a5\u53e3\u6253\u4ea4\u9053\u3002 \u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b \u00b6 \u7a33\u5b9a\u6027\u3001\u53ef\u9760\u884c\u597d\u3002 \u8f6f\u4ef6\u7684\u53ef\u6269\u5c55\u6027\u66f4\u597d\u3002 \u63d0\u9ad8\u6027\u80fd\u3002 \u5728\u7f51\u7edc\u4e0a\u5b9e\u73b0\u65f6\uff0c\u53ef\u4ee5\u964d\u4f4e\u7f51\u7edc\u6d41\u91cf\u3002 \u7528\u4e8e\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e8b\u7269\u673a\u5236\uff0c\u63d0\u4f9b\u6570\u636e\u5907\u4efd\u80fd\u529b\u7b49\u3002 \u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u6700\u5927\u4f18\u70b9\u662f\u7a33\u5b9a\u6027\u597d\uff0c\u800c\u8fd9\u6b63\u662f COM \u6a21\u578b\u7684\u76ee\u6807\uff0c\u5c24\u5176\u5bf9\u4e8e\u8de8\u8fdb\u7a0b\u7684\u7a0b\u5e8f\u901a\u4fe1\u3002 \u4e0b\u9762\u662f COM \u4f7f\u7528\u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u51e0\u79cd\u7075\u6d3b\u7528\u6cd5\uff1a COM \u5e93 \u00b6 \u5728 Microsoft Windows \u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u4e0b\uff0cCOM \u5e93\u4ee5 .dll \u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u5728\uff0c\u5305\u62ec\u4e00\u4e0b\u5185\u5bb9\uff1a \u63d0\u4f9b\u4e86\u5c11\u91cf\u7684 API \u51fd\u6570\u5b9e\u73b0\u5ba2\u6237\u548c\u670d\u52a1\u5668\u7aef COM \u5e94\u7528\u7684\u521b\u5efa\u8fc7\u7a0b\u3002\u5728\u5ba2\u6237\u7aef\uff0c\u4e3b\u8981\u662f\u4e00\u4e9b\u521b\u5efa\u51fd\u6570;\u800c\u5728\u670d\u52a1\u5668\u7aef\uff0c\u63d0\u4f9b\u4e00\u4e9b\u5bf9\u5bf9\u8c61\u7684\u8bbf\u95ee\u652f\u6301 COM \u901a\u8fc7\u6ce8\u518c\u8868\u67e5\u627e\u672c\u5730\u670d\u52a1\u5668\u5373 EXE \u7a0b\u5e8f\uff0c\u4ee5\u53ca\u7a0b\u5e8f\u540d\u4e0e CLSID \u7684\u8f6c\u6362\u7b49 \u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u7684\u5185\u5b58\u63a7\u5236\u65b9\u6cd5\uff0c\u4f7f\u5e94\u7528\u63a7\u5236\u8fdb\u7a0b\u4e2d\u5185\u5b58\u7684\u5206\u914d COM \u5e93\u4e00\u822c\u4e0d\u5728\u5e94\u7528\u7a0b\u5e8f\u5c42\u5b9e\u73b0\uff0c\u800c\u5728\u64cd\u4f5c\u7cfb\u7edf\u5c42\u6b21\u4e0a\u5b9e\u73b0\uff0c\u56e0\u6b64\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u53ea\u6709\u4e00\u4e2a COM \u5e93\u5b9e\u73b0\u3002 COM \u7279\u6027 \u00b6 \u8bed\u8a00\u65e0\u5173\u6027\uff1aCOM \u89c4\u8303\u7684\u5b9a\u4e49\u4e0d\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7684\u8bed\u8a00\uff08\u4f46\u53ea\u6709\u7528 C/C++ \u8bed\u8a00\u624d\u80fd\u5b9e\u73b0 COM \u4e2d\u6240\u6709\u7684\u7279\u6027\uff09 \u8fdb\u7a0b\u900f\u660e\u7279\u6027\uff1a\u8de8\u8fdb\u7a0b\u64cd\u4f5c\u662f\u5f88\u6709\u5fc5\u8981\u7684\u3002\u5b9e\u73b0\u7684\u5173\u952e\u5728\u4e8e COM \u5e93 \u53ef\u91cd\u7528\u6027\uff1a\u4efb\u4f55\u5bf9\u8c61\u6a21\u578b\u7684\u5b9e\u73b0\u76ee\u6807\u3002 \u5305\u5bb9\u65b9\u5f0f \u805a\u5408\u65b9\u5f0f COM \u5bf9\u8c61\u548c\u63a5\u53e3 \u00b6 COM \u5bf9\u8c61 \u00b6 COM \u63d0\u4f9b\u7684\u662f\u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\uff0cCOM \u7ec4\u4ef6\u63d0\u4f9b\u7ed9\u5ba2\u6237\u7684\u662f\u4ee5\u5bf9\u8c61\u5f62\u5f0f\u5c01\u88c5\u8d77\u6765\u7684\u5b9e\u4f53 \u7c7b\u4f3c\u4e8e C++ \u8bed\u8a00\u4e2d\u7c7b\uff08class\uff09\u6982\u5ff5\uff0cCOM \u5bf9\u8c61\u4e5f\u5305\u62ec\u5c5e\u6027\uff08\u4e5f\u79f0\u4e3a\u72b6\u6001\uff09\u548c\u65b9\u6cd5\uff08\u4e5f\u79f0\u4e3a\u64cd\u4f5c\uff09 COM \u5bf9\u8c61\u7684\u6807\u8bc6\u2014\u2014CLSID \u00b6 \u5ba2\u6237\u7a0b\u5e8f\u901a\u8fc7\u4e00\u4e2a\u5168\u5c40\u6807\u8bc6\u7b26\u8fdb\u884c\u5bf9\u8c61\u7684\u521b\u5efa\u548c\u521d\u59cb\u5316\u5de5\u4f5c COM \u89c4\u8303\u91c7\u7528\u4e86 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26\uff08GUID\uff09\u6765\u6807\u8bc6\u5bf9\u8c61\uff08\u968f\u673a\u6570\uff09 COM \u5bf9\u8c61\u4e0e C++ \u5bf9\u8c61\u7684\u6bd4\u8f83 \u00b6 \u5c01\u88c5\u7279\u6027 \u53ef\u91cd\u7528\u6027 COM \u63a5\u53e3 \u00b6 \u4ece API \u5230 COM \u63a5\u53e3 \u00b6","title":"COM \u539f\u7406\u4e0e\u5e94\u7528"},{"location":"cs/software/compa/#com","text":"\u7ea6 1108 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u81ea\u5b66\uff0c\u5bfc\u5e08\u63a8\u8350\u7684\u4e66\u7c4d\uff0c\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b\uff0c\u4ec5\u5b66\u4e60 \u7b2c\u4e00\u90e8\u5206 COM \u662f\u7531 Microsoft \u63d0\u51fa\u7684\u7ec4\u4ef6\u6807\u51c6\uff0c\u5b83\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u4ea4\u4e92\u7684\u6807\u51c6\uff0c \u4e95\u4e14\u4e5f\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u7684\u73af\u5883\u3002\u5728 COM \u6807\u51c6\u4e2d\uff0c\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u4e5f\u88ab\u79f0\u4e3a\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u53ef\u4ee5\u662f\u4e00\u4e2a\u52a8\u6001\u8fde\u63a5\u5e93(\u7f29\u5199\u4e3a DLL )\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5185\u7ec4 \u4ef6 (in-process component);\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f(\u5373 EXE \u7a0b\u5e8f)\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5916\u7ec4\u4ef6(out-of-process component)\u3002\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u56e0\u4e3a COM \u662f\u4ee5\u5bf9\u8c61\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b\uff0c\u6240\u4ee5\u5728\u7a0b\u5e8f\u4e0e\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u65f6\uff0c\u901a\u4fe1\u7684\u53cc\u65b9\u5e94\u8be5\u662f\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u4e5f\u53eb\u505a COM \u5bf9\u8c61\uff0c\u800c\u7ec4\u4ef6\u7a0b\u5e8f\uff08\u6216\u79f0\u505a COM \u7a0b\u5e8f\uff09\u662f\u63d0\u4f9b COM \u5bf9\u8c61\u7684\u4ee3\u7801\u8f7d\u4f53\u3002 \u2014\u2014\u2014\u2014 COM \u662f\u4ec0\u4e48","title":"COM \u539f\u7406\u4e0e\u5e94\u7528"},{"location":"cs/software/compa/#_1","text":"","title":"\u6982\u8ff0"},{"location":"cs/software/compa/#com_1","text":"COM\u4e0d\u4ec5\u4ec5\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u6807\u51c6\uff0c\u5b83\u8fd8\u5f15\u4eba\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u601d\u60f3\u3002\u5728COM\u6807\u6dee\u4e2d\uff0c\u5bf9\u8c61\u662f\u4e00\u4e2a\u975e\u5e38\u6d3b\u8054\u7684\u5143\u7d20\uff0c\u6211\u4eec\u4e5f\u7ecf\u5e38\u628a\u5b83\u79f0\u4e3aCOM\u5bf9\u8c61\u3002\u7ec4\u4ef6\u6a21\u5757\u4e3aCOM\u5bf9\u8c61\u63d0\u4f9b\u4e86\u6d3b\u52a8\u7684\u7a7a\u95f4\uff0cCOM\u5bf9\u8c61\u4ee5\u63a5\u53e3\u7684\u65b9\u5f0f\u63d0\u4f9b\u670d\u52a1\uff0c\u6211\u4eec\u628a\u8fd9\u79cd\u63a5\u53e3\u79f0\u4e3aCOM\u63a5\u53e3\u3002","title":"\u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\u2014\u2014COM"},{"location":"cs/software/compa/#com_2","text":"","title":"COM \u7ed3\u6784"},{"location":"cs/software/compa/#_2","text":"COM \u5bf9\u8c61\u7c7b\u4f3c\u4e8e C++ \u4e2d\u5bf9\u8c61\u7684\u6982\u5ff5\uff0c\u5bf9\u8c61\u662f\u67d0\u4e2a\u7c7b(class)\u7684\u4e00\u4e2a\u5b9e\u4f8b;\u800c\u7c7b\u5219\u662f\u4e00\u7ec4\u76f8\u5173\u7684\u6570\u636e\u548c\u529f\u80fd\u7ec4\u5408\u5728\u4e00\u8d77\u7684\u4e00\u4e2a\u5b9a\u4e49\u3002\u4f7f\u7528\u5bf9\u8c61\u7684\u5e94\u7528(\u6216\u53e6\u4e00\u4e2a\u5bf9\u8c61)\u79f0\u4e3a\u5ba2\u6237\u3002 \u63a5\u53e3\u662f\u4e00\u7ec4\u903b\u8f91\u4e0a\u76f8\u5173\u7684\u51fd\u6570\u96c6\u5408\uff0c\u5176\u51fd\u6570\u4e5f\u88ab\u79f0\u4e3a\u63a5\u53e3\u6210\u5458\u51fd\u6570\u3002 \u5bf9\u8c61\u901a\u8fc7\u63a5\u53e3\u6210\u5458\u51fd\u6570\u4e3a\u5ba2\u6237\u63d0\u4f9b\u5404\u79cd\u5f62\u5f0f\u7684\u670d\u52a1\u3002 \u6bcf\u4e2a\u63a5\u53e3\u90fd\u7531\u4e00\u4e2a 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26(GUID)\u6765\u6807\u8bc6\u3002\u5ba2\u6237\u901a\u8fc7 GUID \u83b7\u5f97\u63a5\u53e3\u7684\u6307\u9488\u3002 \u6bcf\u4e2a\u5bf9\u8c61\u90fd\u6709\u4e00\u4e2a 128 \u4f4d\u7684 GUID \u6765\u6807\u8bc6\uff0c\u79f0\u4e3a CLSID\uff0c\u4fdd\u8bc1\u5728\u5168\u7403\u8303\u56f4\u5185\u7684\u552f\u4e00\u6027\u3002 \u5bf9\u4e8e\u5ba2\u6237\u6765\u8bf4\uff0c\u53ea\u4e0e\u63a5\u53e3\u6253\u4ea4\u9053\u3002","title":"\u5bf9\u8c61\u4e0e\u63a5\u53e3"},{"location":"cs/software/compa/#_3","text":"\u7a33\u5b9a\u6027\u3001\u53ef\u9760\u884c\u597d\u3002 \u8f6f\u4ef6\u7684\u53ef\u6269\u5c55\u6027\u66f4\u597d\u3002 \u63d0\u9ad8\u6027\u80fd\u3002 \u5728\u7f51\u7edc\u4e0a\u5b9e\u73b0\u65f6\uff0c\u53ef\u4ee5\u964d\u4f4e\u7f51\u7edc\u6d41\u91cf\u3002 \u7528\u4e8e\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e8b\u7269\u673a\u5236\uff0c\u63d0\u4f9b\u6570\u636e\u5907\u4efd\u80fd\u529b\u7b49\u3002 \u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u6700\u5927\u4f18\u70b9\u662f\u7a33\u5b9a\u6027\u597d\uff0c\u800c\u8fd9\u6b63\u662f COM \u6a21\u578b\u7684\u76ee\u6807\uff0c\u5c24\u5176\u5bf9\u4e8e\u8de8\u8fdb\u7a0b\u7684\u7a0b\u5e8f\u901a\u4fe1\u3002 \u4e0b\u9762\u662f COM \u4f7f\u7528\u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u51e0\u79cd\u7075\u6d3b\u7528\u6cd5\uff1a","title":"\u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b"},{"location":"cs/software/compa/#com_3","text":"\u5728 Microsoft Windows \u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u4e0b\uff0cCOM \u5e93\u4ee5 .dll \u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u5728\uff0c\u5305\u62ec\u4e00\u4e0b\u5185\u5bb9\uff1a \u63d0\u4f9b\u4e86\u5c11\u91cf\u7684 API \u51fd\u6570\u5b9e\u73b0\u5ba2\u6237\u548c\u670d\u52a1\u5668\u7aef COM \u5e94\u7528\u7684\u521b\u5efa\u8fc7\u7a0b\u3002\u5728\u5ba2\u6237\u7aef\uff0c\u4e3b\u8981\u662f\u4e00\u4e9b\u521b\u5efa\u51fd\u6570;\u800c\u5728\u670d\u52a1\u5668\u7aef\uff0c\u63d0\u4f9b\u4e00\u4e9b\u5bf9\u5bf9\u8c61\u7684\u8bbf\u95ee\u652f\u6301 COM \u901a\u8fc7\u6ce8\u518c\u8868\u67e5\u627e\u672c\u5730\u670d\u52a1\u5668\u5373 EXE \u7a0b\u5e8f\uff0c\u4ee5\u53ca\u7a0b\u5e8f\u540d\u4e0e CLSID \u7684\u8f6c\u6362\u7b49 \u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u7684\u5185\u5b58\u63a7\u5236\u65b9\u6cd5\uff0c\u4f7f\u5e94\u7528\u63a7\u5236\u8fdb\u7a0b\u4e2d\u5185\u5b58\u7684\u5206\u914d COM \u5e93\u4e00\u822c\u4e0d\u5728\u5e94\u7528\u7a0b\u5e8f\u5c42\u5b9e\u73b0\uff0c\u800c\u5728\u64cd\u4f5c\u7cfb\u7edf\u5c42\u6b21\u4e0a\u5b9e\u73b0\uff0c\u56e0\u6b64\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u53ea\u6709\u4e00\u4e2a COM \u5e93\u5b9e\u73b0\u3002","title":"COM \u5e93"},{"location":"cs/software/compa/#com_4","text":"\u8bed\u8a00\u65e0\u5173\u6027\uff1aCOM \u89c4\u8303\u7684\u5b9a\u4e49\u4e0d\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7684\u8bed\u8a00\uff08\u4f46\u53ea\u6709\u7528 C/C++ \u8bed\u8a00\u624d\u80fd\u5b9e\u73b0 COM \u4e2d\u6240\u6709\u7684\u7279\u6027\uff09 \u8fdb\u7a0b\u900f\u660e\u7279\u6027\uff1a\u8de8\u8fdb\u7a0b\u64cd\u4f5c\u662f\u5f88\u6709\u5fc5\u8981\u7684\u3002\u5b9e\u73b0\u7684\u5173\u952e\u5728\u4e8e COM \u5e93 \u53ef\u91cd\u7528\u6027\uff1a\u4efb\u4f55\u5bf9\u8c61\u6a21\u578b\u7684\u5b9e\u73b0\u76ee\u6807\u3002 \u5305\u5bb9\u65b9\u5f0f \u805a\u5408\u65b9\u5f0f","title":"COM \u7279\u6027"},{"location":"cs/software/compa/#com_5","text":"","title":"COM \u5bf9\u8c61\u548c\u63a5\u53e3"},{"location":"cs/software/compa/#com_6","text":"COM \u63d0\u4f9b\u7684\u662f\u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\uff0cCOM \u7ec4\u4ef6\u63d0\u4f9b\u7ed9\u5ba2\u6237\u7684\u662f\u4ee5\u5bf9\u8c61\u5f62\u5f0f\u5c01\u88c5\u8d77\u6765\u7684\u5b9e\u4f53 \u7c7b\u4f3c\u4e8e C++ \u8bed\u8a00\u4e2d\u7c7b\uff08class\uff09\u6982\u5ff5\uff0cCOM \u5bf9\u8c61\u4e5f\u5305\u62ec\u5c5e\u6027\uff08\u4e5f\u79f0\u4e3a\u72b6\u6001\uff09\u548c\u65b9\u6cd5\uff08\u4e5f\u79f0\u4e3a\u64cd\u4f5c\uff09","title":"COM \u5bf9\u8c61"},{"location":"cs/software/compa/#com-clsid","text":"\u5ba2\u6237\u7a0b\u5e8f\u901a\u8fc7\u4e00\u4e2a\u5168\u5c40\u6807\u8bc6\u7b26\u8fdb\u884c\u5bf9\u8c61\u7684\u521b\u5efa\u548c\u521d\u59cb\u5316\u5de5\u4f5c COM \u89c4\u8303\u91c7\u7528\u4e86 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26\uff08GUID\uff09\u6765\u6807\u8bc6\u5bf9\u8c61\uff08\u968f\u673a\u6570\uff09","title":"COM \u5bf9\u8c61\u7684\u6807\u8bc6\u2014\u2014CLSID"},{"location":"cs/software/compa/#com-c","text":"\u5c01\u88c5\u7279\u6027 \u53ef\u91cd\u7528\u6027","title":"COM \u5bf9\u8c61\u4e0e C++ \u5bf9\u8c61\u7684\u6bd4\u8f83"},{"location":"cs/software/compa/#com_7","text":"","title":"COM \u63a5\u53e3"},{"location":"cs/software/compa/#api-com","text":"","title":"\u4ece API \u5230 COM \u63a5\u53e3"},{"location":"cs/software/design-pattern/","text":"\u8bbe\u8ba1\u6a21\u5f0f \u00b6 \u7ea6 2112 \u4e2a\u5b57 496 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 13 \u5206\u949f \u8bbe\u8ba1\u6a21\u5f0f \u662f\u8f6f\u4ef6\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002\u4ed6\u4eec\u5c31\u60f3\u80fd\u6839\u636e\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u7684\u9884\u5236\u84dd\u56fe\uff0c\u53ef\u7528\u4e8e\u89e3\u51b3\u4ee3\u7801\u4e2d\u53cd\u590d\u51fa\u73b0\u7684\u8bbe\u8ba1\u95ee\u9898\u3002 \u8bbe\u8ba1\u6a21\u5f0f\u4e0e\u65b9\u6cd5\u6216\u5e93\u7684\u4f7f\u7528\u65b9\u5f0f\u4e0d\u540c\uff0c\u4f60\u5f88\u96be\u76f4\u63a5\u5728\u81ea\u5df1\u7684\u7a0b\u5e8f\u4e2d\u5957\u7528\u67d0\u4e2a\u8bbe\u8ba1\u6a21\u5f0f\u3002\u6a21\u5f0f\u5e76\u4e0d\u662f\u4e00\u6bb5\u7279\u5b9a\u7684\u4ee3\u7801\uff0c\u800c\u662f\u89e3\u51b3\u7279\u5b9a\u95ee\u9898\u7684\u4e00\u822c\u6027\u6982\u5ff5\u3002 \u4f60\u53ef\u4ee5\u6839\u636e\u6a21\u5f0f\u6765\u5b9e\u73b0\u7b26\u5408\u81ea\u5df1\u7a0b\u5e8f\u5b9e\u9645\u6240\u9700\u7684\u89e3\u51b3\u65b9\u6848\u3002 \u4eba\u4eec\u5e38\u5e38\u4f1a\u6df7\u6dc6\u6a21\u5f0f\u548c\u7b97\u6cd5\uff0c\u56e0\u4e3a\u4e24\u8005\u5728\u6982\u5ff5\u4e0a\u90fd\u662f\u5df2\u77e5\u7279\u5b9a\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002 \u4f46\u7b97\u6cd5\u603b\u662f\u660e\u786e\u5b9a\u4e49\u8fbe\u6210\u7279\u5b9a\u76ee\u6807\u6240\u9700\u7684\u4e00\u7cfb\u5217\u6b65\u9aa4\uff0c\u800c\u6a21\u5f0f\u5219\u662f\u5bf9\u89e3\u51b3\u65b9\u6848\u7684\u66f4\u9ad8\u5c42\u6b21\u63cf\u8ff0\u3002\u540c\u4e00\u6a21\u5f0f\u5728\u4e24\u4e2a\u4e0d\u540c\u7a0b\u5e8f\u4e2d\u7684\u5b9e\u73b0\u4ee3\u7801\u53ef\u80fd\u4f1a\u4e0d\u4e00\u6837\u3002 \u7b97\u6cd5\u66f4\u50cf\u662f\u83dc\u8c31\uff1a\u63d0\u4f9b\u8fbe\u6210\u76ee\u6807\u7684\u660e\u786e\u6b65\u9aa4\u3002\u800c\u6a21\u5f0f\u66f4\u50cf\u662f\u84dd\u56fe\uff1a\u4f60\u53ef\u4ee5\u770b\u5230\u6700\u7ec8\u7684\u7ed3\u679c\u548c\u6a21\u5f0f\u7684\u529f\u80fd\uff0c\u4f46\u9700\u8981\u81ea\u5df1\u786e\u5b9a\u5b9e\u73b0\u6b65\u9aa4\u3002 Abstract \u5f52\u6863\u5b66\u4e60\u8bbe\u8ba1\u6a21\u5f0f\u65f6\u7684\u4e00\u4e9b\u7b14\u8bb0 \u4e3b\u8981\u7528 C++ \u5b9e\u73b0\uff0c\u6301\u7eed\u66f4\u65b0\u4e2d \u521b\u5efa\u578b\u6a21\u5f0f \u00b6 \u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u521b\u5efa\u4e00\u7cfb\u5217\u76f8\u5173\u7684\u5bf9\u8c61\uff0c \u800c\u65e0\u9700\u6307\u5b9a\u5176\u5177\u4f53\u7c7b\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5982\u679c\u4ee3\u7801\u9700\u8981\u4e0e\u591a\u4e2a\u4e0d\u540c\u7cfb\u5217\u7684\u76f8\u5173\u4ea7\u54c1\u4ea4\u4e92\uff0c\u4f46\u662f\u7531\u4e8e\u65e0\u6cd5\u63d0\u524d\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\uff0c\u6216\u8005\u51fa\u4e8e\u5bf9\u672a\u6765\u6269\u5c55\u6027\u7684\u8003\u8651\uff0c\u4f60\u4e0d\u5e0c\u671b\u4ee3\u7801\u57fa\u4e8e\u4ea7\u54c1\u7684\u5177\u4f53\u7c7b\u8fdb\u884c\u6784\u5efa\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u3002 \u5982\u679c\u4f60\u6709\u4e00\u4e2a\u57fa\u4e8e\u4e00\u7ec4\u62bd\u8c61\u65b9\u6cd5\u7684\u7d2f\uff0c\u4e14\u5176\u4e3b\u8981\u529f\u80fd\u56e0\u6b64\u53d8\u5f97\u4e0d\u660e\u786e\uff0c\u90a3\u4e48\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u8003\u8651\u4e86\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u786e\u4fdd\u540c\u4e00\u5de5\u5382\u751f\u4ea7\u7684\u4ea7\u54c1\u76f8\u4e92\u5339\u914d \u4f60\u53ef\u4ee5\u907f\u514d\u5ba2\u6237\u7aef\u548c\u5177\u4f53\u4ea7\u54c1\u4ee3\u7801\u7684\u8026\u5408 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u4ea7\u54c1\u751f\u6210\u4ee3\u7801\u62bd\u53d6\u5230\u540c\u4e00\u4f4d\u7f6e\uff0c\u4f7f\u5f97\u4ee3\u7801\u6613\u4e8e\u7ef4\u62a4 \u5f00\u95ed\u539f\u5219\u3002\u5411\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5f15\u5165\u65b0\u4ea7\u54c1\u53d8\u4f53\u65f6\uff0c\u4f60\u65e0\u9700\u4fee\u6539\u5ba2\u6237\u7aef\u4ee3\u7801 \u7f3a\u70b9 \u00b6 \u7531\u4e8e\u91c7\u7528\u8be5\u6a21\u5f0f\u9700\u8981\u5411\u5e94\u7528\u4e2d\u5f15\u5165\u4f17\u591a\u63a5\u53e3\u548c\u7c7b\uff0c\u4ee3\u7801\u53ef\u80fd\u4f1a\u6bd4\u4e4b\u524d\u66f4\u52a0\u590d\u6742 AbstractFactory.cpp #include #include class AbstractProductA { public : virtual ~ AbstractProductA () {}; virtual std :: string UsefulFunctionA () const = 0 ; }; class ConcreteProductA1 : public AbstractProductA { public : std :: string UsefulFunctionA () const override { return \"The result of the product A1.\" ; } }; class ConcreteProductA2 : public AbstractProductA { public : std :: string UsefulFunctionA () const override { return \"The result of the product A2.\" ; } }; class AbstractProductB { public : virtual ~ AbstractProductB () {}; virtual std :: string UsefulFunctionB () const = 0 ; virtual std :: string AnotherUsefulFunctionB ( const AbstractProductA & collaborator ) const = 0 ; }; class ConcreteProductB1 : public AbstractProductB { public : std :: string UsefulFunctionB () const override { return \"The result of the product B1.\" ; } std :: string AnotherUsefulFunctionB ( const AbstractProductA & collaborator ) const override { const std :: string result = collaborator . UsefulFunctionA (); return \"The result of the B1 collaborating with ( \" + result + \" )\" ; } }; class ConcreteProductB2 : public AbstractProductB { public : std :: string UsefulFunctionB () const override { return \"The result of the product B2.\" ; } std :: string AnotherUsefulFunctionB ( const AbstractProductA & collaborator ) const override { const std :: string result = collaborator . UsefulFunctionA (); return \"The result of the B2 collaborating with ( \" + result + \" )\" ; } }; class AbstractFactory { public : virtual AbstractProductA * CreateProductA () const = 0 ; virtual AbstractProductB * CreateProductB () const = 0 ; }; class ConcreteFactory1 : public AbstractFactory { public : AbstractProductA * CreateProductA () const override { return new ConcreteProductA1 (); } AbstractProductB * CreateProductB () const override { return new ConcreteProductB1 (); } }; class ConcreteFactory2 : public AbstractFactory { public : AbstractProductA * CreateProductA () const override { return new ConcreteProductA2 (); } AbstractProductB * CreateProductB () const override { return new ConcreteProductB2 (); } }; void ClientCode ( const AbstractFactory & factory ) { const AbstractProductA * product_A = factory . CreateProductA (); const AbstractProductB * product_B = factory . CreateProductB (); std :: cout << product_B -> UsefulFunctionB () << \" \\n \" ; std :: cout << product_B -> AnotherUsefulFunctionB ( * product_A ) << \" \\n \" ; delete product_A ; delete product_B ; } int main () { std :: cout << \"Client: Testing client code with the first factory type: \\n \" ; ConcreteFactory1 * f1 = new ConcreteFactory1 (); ClientCode ( * f1 ); delete f1 ; std :: cout << std :: endl ; std :: cout << \"Client: Testing the same client code with the second factory type: \\n \" ; ConcreteFactory2 * f2 = new ConcreteFactory2 (); ClientCode ( * f2 ); delete f2 ; return 0 ; } \u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u5176\u5728\u7236\u7c7b\u4e2d\u63d0\u4f9b\u4e00\u4e2a\u521b\u5efa\u5bf9\u8c61\u7684\u65b9\u6cd5\uff0c\u5141\u8bb8\u5b50\u7c7b\u51b3\u5b9a\u5b9e\u4f8b\u5316\u5bf9\u8c61\u7684\u7c7b\u578b\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u7f16\u5199\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u65e0\u6cd5\u9884\u77e5\u5bf9\u8c61\u786e\u5207\u7c7b\u522b\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\u65f6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u7528\u6237\u80fd\u591f\u6269\u5c55\u4f60\u8f6f\u4ef6\u5e93\u6216\u6846\u67b6\u7684\u5185\u90e8\u7ec4\u4ef6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u590d\u7528\u73b0\u6709\u5bf9\u8c61\u6765\u8282\u7701\u7cfb\u7edf\u8d44\u6e90\uff0c\u800c\u4e0d\u662f\u6bcf\u6b21\u90fd\u91cd\u65b0\u521b\u5efa\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u53ef\u4ee5\u907f\u514d\u521b\u5efa\u8005\u548c\u5177\u4f53\u4ea7\u54c1\u4e4b\u95f4\u7684\u7d27\u5bc6\u8026\u5408 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u4ea7\u54c1\u521b\u5efa\u4ee3\u7801\u653e\u5728\u7a0b\u5e8f\u7684\u5355\u4e00\u4f4d\u7f6e\uff0c\u4ece\u800c\u4f7f\u5f97\u4ee3\u7801\u66f4\u5bb9\u6613\u7ef4\u62a4 \u5f00\u95ed\u539f\u5219\u3002\u65e0\u9700\u66f4\u6539\u73b0\u6709\u5ba2\u6237\u7aef\u4ee3\u7801\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4e2d\u5f15\u5165\u65b0\u7684\u4ea7\u54c1\u7c7b\u578b \u7f3a\u70b9 \u00b6 \u5e94\u7528\u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f\u9700\u8981\u5f15\u5165\u8bb8\u591a\u65b0\u7684\u5b50\u7c7b\uff0c\u4ee3\u7801\u53ef\u80fd\u4f1a\u53d8\u5f97\u590d\u6742\u3002\u6700\u597d\u7684\u60c5\u51b5\u65f6\u5c06\u8be5\u6a21\u5f0f\u5f15\u5165\u521b\u5efa\u8005\u7c7b\u7684\u73b0\u6709\u5c42\u6b21\u7ed3\u6784\u4e2d FactoryMethod.cpp #include class Product { public : virtual ~ Product () {} virtual std :: string Operation () const = 0 ; }; class ConcreteProduct1 : public Product { public : std :: string Operation () const override { return \"{Result of the ConcreteProduct1}\" ; } }; class ConcreteProduct2 : public Product { public : std :: string Operation () const override { return \"{Result of the ConcreteProduct2}\" ; } }; class Creator { public : virtual ~ Creator () {}; virtual Product * FactoryMethod () const = 0 ; std :: string SomeOperation () const { Product * product = this -> FactoryMethod (); std :: string result = \"Creator: The same creator's code has just worked with \" + product -> Operation (); delete product ; return result ; } }; class ConcreteCreator1 : public Creator { public : Product * FactoryMethod () const override { return new ConcreteProduct1 (); } }; class ConcreteCreator2 : public Creator { public : Product * FactoryMethod () const override { return new ConcreteProduct2 (); } }; void ClientCode ( const Creator & creator ) { std :: cout << \"Client: I'm not aware of the creator's class, but it still works. \\n \" << creator . SomeOperation () << std :: endl ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); std :: cout << \"App: Launched with the ConcreteCreator1. \\n \" ; Creator * creator1 = new ConcreteCreator1 (); ClientCode ( * creator1 ); std :: cout << std :: endl ; std :: cout << \"App: Launched with the ConcreteCreator2. \\n \" ; Creator * creator2 = new ConcreteCreator2 (); ClientCode ( * creator2 ); delete creator1 ; delete creator2 ; return 0 ; } \u751f\u6210\u5668\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u751f\u6210\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u5206\u6b65\u9aa4\u521b\u5efa\u590d\u6742\u5bf9\u8c61\u3002\u8be5\u6a21\u5f0f\u5141\u8bb8\u4f60\u4f7f\u7528\u76f8\u540c\u7684\u521b\u5efa\u4ee3\u7801\u751f\u6210\u4e0d\u540c\u7c7b\u578b\u548c\u5f62\u5f0f\u7684\u5bf9\u8c61\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f\u53ef\u907f\u514d\u201c\u91cd\u53e0\u6784\u9020\u51fd\u6570\u201d\u7684\u51fa\u73b0 \u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u4ee3\u7801\u521b\u5efa\u4e0d\u540c\u5f62\u5f0f\u7684\u4ea7\u54c1\uff08\u4f8b\u5982\u77f3\u5934\u6216\u6728\u5934\u623f\u5c4b\uff09\u65f6\uff0c\u53ef\u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f \u4f7f\u7528\u751f\u6210\u5668\u6784\u9020\u7ec4\u5408\u6811\u6216\u5176\u4ed6\u590d\u6742\u5bf9\u8c61 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u5206\u6b65\u521b\u5efa\u5bf9\u8c61\uff0c\u6682\u7f13\u521b\u5efa\u6b65\u9aa4\u6216\u9012\u5f52\u8fd0\u884c\u521b\u5efa\u6b65\u9aa4 \u751f\u6210\u4e0d\u540c\u5f62\u5f0f\u7684\u4ea7\u54c1\u65f6\uff0c\u4f60\u53ef\u4ee5\u590d\u7528\u76f8\u540c\u7684\u5236\u9020\u4ee3\u7801 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u590d\u6742\u6784\u9020\u4ee3\u7801\u4ece\u4ea7\u54c1\u7684\u4e1a\u52a1\u903b\u8f91\u4e2d\u5206\u79bb\u51fa\u6765 \u7f3a\u70b9 \u00b6 \u7531\u4e8e\u8be5\u6a21\u5f0f\u9700\u8981\u65b0\u589e\u591a\u4e2a\u7c7b\uff0c\u56e0\u6b64\u4ee3\u7801\u6574\u4f53\u590d\u6742\u7a0b\u5ea6\u4f1a\u6709\u6240\u589e\u52a0 Builder.cpp #include #include #include class Product1 { public : std :: vector < std :: string > parts ; void ListParts () const { std :: cout << \"Product parts: \" ; for ( size_t i = 0 ; i < parts . size (); i ++ ) { std :: cout << parts [ i ] << \" \\n \" [ i == parts . size () - 1 ]; } std :: cout << \" \\n \" ; } }; class Builder { public : virtual ~ Builder () {} virtual void ProducePartA () const = 0 ; virtual void ProducePartB () const = 0 ; virtual void ProducePartC () const = 0 ; }; class ConcreteBuilder1 : public Builder { private : Product1 * product ; public : ConcreteBuilder1 () { this -> Reset (); } ~ ConcreteBuilder1 () { delete product ; } void Reset () { this -> product = new Product1 (); } void ProducePartA () const override { this -> product -> parts . push_back ( \"PartA1\" ); } void ProducePartB () const override { this -> product -> parts . push_back ( \"PartB1\" ); } void ProducePartC () const override { this -> product -> parts . push_back ( \"PartC1\" ); } Product1 * GetProduct () { Product1 * result = this -> product ; this -> Reset (); return result ; } }; class Director { private : Builder * builder ; public : void set_builder ( Builder * builder ) { this -> builder = builder ; } void BuildMinimalViableProduct () { this -> builder -> ProducePartA (); } void BuildFullFeaturedProduct () { this -> builder -> ProducePartA (); this -> builder -> ProducePartB (); this -> builder -> ProducePartC (); } }; void ClientCode ( Director & director ) { ConcreteBuilder1 * builder = new ConcreteBuilder1 (); director . set_builder ( builder ); std :: cout << \"Standard basic product: \\n \" ; director . BuildMinimalViableProduct (); Product1 * p = builder -> GetProduct (); p -> ListParts (); delete p ; std :: cout << \"Standard full featured product: \\n \" ; director . BuildFullFeaturedProduct (); p = builder -> GetProduct (); p -> ListParts (); delete p ; std :: cout << \"Custom product: \\n \" ; builder -> ProducePartA (); builder -> ProducePartB (); p = builder -> GetProduct (); p -> ListParts (); delete p ; delete builder ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); Director * director = new Director (); ClientCode ( * director ); delete director ; return 0 ; } \u539f\u578b\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u539f\u578b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u590d\u5236\u5df2\u6709\u5bf9\u8c61\uff0c \u800c\u53c8\u65e0\u9700\u4f7f\u4ee3\u7801\u4f9d\u8d56\u5b83\u4eec\u6240\u5c5e\u7684\u7c7b\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5982\u679c\u4f60\u9700\u8981\u590d\u5236\u4e00\u4e9b\u5bf9\u8c61\uff0c\u540c\u65f6\u53c8\u5e0c\u671b\u4ee3\u7801\u72ec\u7acb\u4e8e\u8fd9\u4e9b\u5bf9\u8c61\u6240\u5c5e\u7684\u5177\u4f53\u7c7b\uff0c\u53ef\u4ee5\u4f7f\u7528\u539f\u578b\u6a21\u5f0f \u5982\u679c\u5b50\u7c7b\u7684\u533a\u522b\u4ec5\u5728\u4e8e\u5176\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u65b9\u5f0f\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u4f7f\u7528\u8be5\u6a21\u5f0f\u6765\u51cf\u5c11\u5b50\u7c7b\u7684\u6570\u91cf\u3002\u522b\u4eba\u521b\u5efa\u8fd9\u4e9b\u5b50\u7c7b\u7684\u76ee\u7684\u53ef\u80fd\u662f\u4e3a\u96f6\u521b\u5efa\u7279\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u514b\u9686\u5bf9\u8c61\uff0c\u800c\u65e0\u9700\u4e0e\u5b83\u4eec\u6240\u5c5e\u7684\u5177\u4f53\u7c7b\u76f8\u8026\u5408 \u4f60\u53ef\u4ee5\u514b\u9686\u9884\u751f\u6210\u539f\u578b\uff0c\u907f\u514d\u53cd\u590d\u8fd0\u884c\u521d\u59cb\u5316\u4ee3\u7801 \u4f60\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u751f\u6210\u590d\u6742\u5bf9\u8c61 \u4f60\u53ef\u4ee5\u7528\u7ee7\u627f\u4ee5\u5916\u7684\u65b9\u5f0f\u6765\u5904\u7406\u590d\u6742\u5bf9\u8c61\u7684\u4e0d\u540c\u914d\u7f6e \u7f3a\u70b9 \u00b6 \u514b\u9686\u5305\u542b\u5faa\u73af\u5f15\u7528\u7684\u590d\u6742\u5bf9\u8c61\u53ef\u80fd\u4f1a\u975e\u5e38\u9ebb\u70e6 Prototype.cpp #include #include #include enum Type { PROTOTYPE_1 = 0 , PROTOTYPE_2 }; class Prototype { protected : std :: string prototype_name_ ; float prototype_field_ ; public : Prototype () {} Prototype ( std :: string prototype_name ) : prototype_name_ ( prototype_name ) {} virtual ~ Prototype () {} virtual Prototype * Clone () const = 0 ; virtual void Method ( float prototype_field ) { this -> prototype_field_ = prototype_field ; std :: cout << \"Call Method from \" << prototype_name_ << \" with field : \" << prototype_field << std :: endl ; } }; class ConcretePrototype1 : public Prototype { private : float concrete_prototype_field1_ ; public : ConcretePrototype1 ( std :: string prototype_name , float concrete_prototype_field ) : Prototype ( prototype_name ), concrete_prototype_field1_ ( concrete_prototype_field ) {} Prototype * Clone () const override { return new ConcretePrototype1 ( * this ); } }; class ConcretePrototype2 : public Prototype { private : float concrete_prototype_field2_ ; public : ConcretePrototype2 ( std :: string prototype_name , float concrete_prototype_field ) : Prototype ( prototype_name ), concrete_prototype_field2_ ( concrete_prototype_field ) {} Prototype * Clone () const override { return new ConcretePrototype2 ( * this ); } }; class PrototypeFactory { private : std :: unordered_map < Type , Prototype * , std :: hash < int >> prototypes_ ; public : PrototypeFactory () { prototypes_ [ Type :: PROTOTYPE_1 ] = new ConcretePrototype1 ( \"PROTOTYPE_1 \" , 50.f ); prototypes_ [ Type :: PROTOTYPE_2 ] = new ConcretePrototype2 ( \"PROTOTYPE_2 \" , 60.f ); } ~ PrototypeFactory () { delete prototypes_ [ Type :: PROTOTYPE_1 ]; delete prototypes_ [ Type :: PROTOTYPE_2 ]; } Prototype * CreatePrototype ( Type type ) { return prototypes_ [ type ] -> Clone (); } }; void Client ( PrototypeFactory & prototype_factory ) { std :: cout << \"Let's create a Prototype 1 \\n \" ; Prototype * prototype = prototype_factory . CreatePrototype ( Type :: PROTOTYPE_1 ); prototype -> Method ( 90 ); delete prototype ; std :: cout << \" \\n \" ; std :: cout << \"Let's create a Prototype 2 \\n \" ; prototype = prototype_factory . CreatePrototype ( Type :: PROTOTYPE_2 ); prototype -> Method ( 10 ); delete prototype ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); PrototypeFactory * prototype_factory = new PrototypeFactory (); Client ( * prototype_factory ); delete prototype_factory ; return 0 ; } \u5355\u4f8b\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u5355\u4f8b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u8ba9\u4f60\u80fd\u591f\u4fdd\u8bc1\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u8bbf\u95ee\u8be5\u5b9e\u4f8b\u7684\u5168\u5c40\u8282\u70b9\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5982\u679c\u7a0b\u5e8f\u4e2d\u7684\u67d0\u4e2a\u7c7b\u5bf9\u4e8e\u6240\u6709\u5ba2\u6237\u7aef\u53ea\u6709\u4e00\u4e2a\u53ef\u7528\u7684\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f \u5982\u679c\u4f60\u9700\u8981\u66f4\u52a0\u4e25\u683c\u5730\u63a7\u5236\u5168\u5c40\u53d8\u91cf\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u4fdd\u8bc1\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b \u4f60\u83b7\u5f97\u4e86\u4e00\u4e2a\u6307\u5411\u8be5\u5b9e\u4f8b\u7684\u5168\u5c40\u8bbf\u95ee\u8282\u70b9 \u4ec5\u5728\u9996\u6b21\u8bf7\u6c42\u5355\u4f8b\u5bf9\u8c61\u65f6\u5bf9\u5176\u8fdb\u884c\u521d\u59cb\u5316 \u7f3a\u70b9 \u00b6 \u8fdd\u53cd\u4e86\u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u8be5\u6a21\u5f0f\u540c\u65f6\u89e3\u51b3\u4e86\u4e24\u4e2a\u95ee\u9898 \u5355\u4f8b\u6a21\u5f0f\u53ef\u80fd\u63a9\u76d6\u4e0d\u826f\u8bbe\u8ba1\uff0c\u6bd4\u5982\u7a0b\u5e8f\u5404\u7ec4\u4ef6\u4e4b\u95f4\u4e92\u76f8\u4e86\u89e3\u8fc7\u591a\u7b49 \u8be5\u6a21\u5f0f\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\u9700\u8981\u8fdb\u884c\u7279\u6b8a\u5904\u7406\uff0c\u907f\u514d\u591a\u4e2a\u7ebf\u7a0b\u591a\u6b21\u521b\u5efa\u5355\u4f8b\u5bf9\u8c61 \u5355\u4f8b\u7684\u5ba2\u6237\u7aef\u4ee3\u7801\u5355\u5143\u6d4b\u8bd5\u53ef\u80fd\u4f1a\u6bd4\u8f83\u56f0\u96be\uff0c\u56e0\u4e3a\u8bb8\u591a\u6d4b\u8bd5\u6846\u67b6\u4ee5\u57fa\u4e8e\u7ee7\u627f\u7684\u65b9\u5f0f\u521b\u5efa\u6a21\u62df\u5bf9\u8c61\u3002\u7531\u4e8e\u5355\u4f8b\u7c7b\u7684\u6784\u9020\u51fd\u6570\u662f\u79c1\u6709\u7684\uff0c\u800c\u4e14\u7edd\u5927\u90e8\u5206\u8bed\u8a00\u65e0\u6cd5\u91cd\u5199\u9759\u6001\u65b9\u6cd5\uff0c\u6240\u4ee5\u4f60\u9700\u8981\u60f3\u51fa\u4ed4\u7ec6\u8003\u8651\u6a21\u62df\u5355\u4f8b\u7684\u65b9\u6cd5\u3002\u8981\u4e48\u5e72\u8106\u4e0d\u7f16\u5199\u6d4b\u8bd5\u4ee3\u7801\uff0c\u6216\u8005\u4e0d\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f Singleton.cpp #include #include #include class Singleton { protected : Singleton ( const std :: string value ) : value_ ( value ) {} static Singleton * singleton_ ; std :: string value_ ; public : Singleton ( Singleton & other ) = delete ; void operator = ( const Singleton & ) = delete ; static Singleton * GetInstance ( const std :: string & value ); void SomeBusinessLogic () {} std :: string value () const { return value_ ; } }; Singleton * Singleton :: singleton_ = nullptr ; Singleton * Singleton::GetInstance ( const std :: string & value ) { if ( singleton_ == nullptr ) { singleton_ = new Singleton ( value ); } return singleton_ ; } void ThreadFoo () { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 1000 )); Singleton * singleton = Singleton :: GetInstance ( \"FOO\" ); std :: cout << singleton -> value () << \" \\n \" ; } void ThreadBar () { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 1000 )); Singleton * singleton = Singleton :: GetInstance ( \"BAR\" ); std :: cout << singleton -> value () << \" \\n \" ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); std :: cout << \"If you see the same value, then singleton was reused (yay! \\n \" << \"If you see different values, then 2 singletons were created (booo!!) \\n\\n \" << \"RESULT: \\n \" ; std :: thread t1 ( ThreadFoo ); std :: thread t2 ( ThreadBar ); t1 . join (); t2 . join (); return 0 ; } \u7ed3\u6784\u578b\u6a21\u5f0f \u00b6 \u9002\u914d\u5668\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u9002\u914d\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u7ed3\u6784\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u4f7f\u63a5\u53e3\u4e0d\u517c\u5bb9\u7684\u5bf9\u8c61\u80fd\u591f\u76f8\u4e92\u5408\u4f5c\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u67d0\u4e2a\u7c7b\uff0c\u4f46\u662f\u5176\u63a5\u53e3\u4e0e\u5176\u4ed6\u4ee3\u7801\u4e0d\u517c\u5bb9\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u9002\u914d\u5668\u7c7b \u5982\u679c\u4f60\u9700\u8981\u590d\u7528\u8fd9\u6837\u4e00\u4e9b\u7c7b\uff0c\u4ed6\u4eec\u5904\u4e8e\u540c\u4e00\u7ee7\u627f\u4f53\u7cfb\uff0c\u5e76\u4e14\u5b83\u4eec\u53c8\u6709\u4e86\u989d\u5916\u7684\u4e00\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u8fd9\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\u4e0d\u662f\u6240\u6709\u5728\u8fd9\u4e00\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7684\u5b50\u7c7b\u6240\u5177\u6709\u7684\u5171\u6027 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u63a5\u53e3\u6216\u6570\u636e\u8f6c\u6362\u4ee3\u7801\u4ece\u7a0b\u5e8f\u4e3b\u8981\u4e5f\u8981\u4e1a\u52a1\u903b\u8f91\u4e2d\u5206\u79bb \u5f00\u95ed\u539f\u5219\u3002\u53ea\u8981\u5ba2\u6237\u7aef\u4ee3\u7801\u901a\u8fc7\u5ba2\u6237\u7aef\u63a5\u53e3\u4e0e\u9002\u914d\u5668\u8fdb\u884c\u4ea4\u4e92\uff0c\u4f60\u5c31\u80fd\u5728\u4e0d\u4fee\u6539\u73b0\u6709\u5ba2\u6237\u7aef\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u5728\u7a0b\u5e8f\u4e2d\u6dfb\u52a0\u65b0\u7c7b\u578b\u7684\u9002\u914d\u5668 \u7f3a\u70b9 \u00b6 \u4ee3\u7801\u6574\u4f53\u590d\u6742\u5ea6\u589e\u52a0\uff0c\u56e0\u4e3a\u4f60\u9700\u8981\u65b0\u589e\u4e00\u7cfb\u5217\u63a5\u53e3\u548c\u7c7b\u3002\u6709\u65f6\u76f4\u63a5\u66f4\u6539\u670d\u52a1\u7c7b\u4f7f\u5176\u4e0e\u5176\u4ed6\u4ee3\u7801\u517c\u5bb9\u4f1a\u66f4\u7b80\u5355 Adapter.cpp #include #include #include class Target { public : virtual ~ Target () = default ; virtual std :: string Request () const { return \"Target: The defaut target's behabior.\" ; } }; class Adaptee { public : std :: string SpecificRequest () const { return \".eetpadA eht fo roivaheb laicepS\" ; } }; class Adapter : public Target { private : Adaptee * adaptee_ ; public : Adapter ( Adaptee * adaptee ) : adaptee_ ( adaptee ) {} std :: string Request () const override { std :: string to_reverse = this -> adaptee_ -> SpecificRequest (); std :: reverse ( to_reverse . begin (), to_reverse . end ()); return \"Adapter: (TRANSLATED) \" + to_reverse ; } }; void ClientCode ( const Target * target ) { std :: cout << target -> Request (); } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); std :: cout << \"Client: I can work just fine with the Target objects: \\n \" ; Target * target = new Target ; ClientCode ( target ); std :: cout << \" \\n\\n \" ; Adaptee * adaptee = new Adaptee ; std :: cout << \"Client: The Adaptee class has a weird interface. See, I don't understand it: \\n \" ; std :: cout << \"Adaptee: \" << adaptee -> SpecificRequest (); std :: cout << \" \\n\\n \" ; std :: cout << \"Client: But I can work with it via the Adapter: \\n \" ; Adapter * adapter = new Adapter ( adaptee ); ClientCode ( adapter ); std :: cout << \" \\n \" ; delete target ; delete adaptee ; delete adapter ; return 0 ; } \u884c\u4e3a\u6a21\u5f0f \u00b6","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_1","text":"\u7ea6 2112 \u4e2a\u5b57 496 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 13 \u5206\u949f \u8bbe\u8ba1\u6a21\u5f0f \u662f\u8f6f\u4ef6\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002\u4ed6\u4eec\u5c31\u60f3\u80fd\u6839\u636e\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u7684\u9884\u5236\u84dd\u56fe\uff0c\u53ef\u7528\u4e8e\u89e3\u51b3\u4ee3\u7801\u4e2d\u53cd\u590d\u51fa\u73b0\u7684\u8bbe\u8ba1\u95ee\u9898\u3002 \u8bbe\u8ba1\u6a21\u5f0f\u4e0e\u65b9\u6cd5\u6216\u5e93\u7684\u4f7f\u7528\u65b9\u5f0f\u4e0d\u540c\uff0c\u4f60\u5f88\u96be\u76f4\u63a5\u5728\u81ea\u5df1\u7684\u7a0b\u5e8f\u4e2d\u5957\u7528\u67d0\u4e2a\u8bbe\u8ba1\u6a21\u5f0f\u3002\u6a21\u5f0f\u5e76\u4e0d\u662f\u4e00\u6bb5\u7279\u5b9a\u7684\u4ee3\u7801\uff0c\u800c\u662f\u89e3\u51b3\u7279\u5b9a\u95ee\u9898\u7684\u4e00\u822c\u6027\u6982\u5ff5\u3002 \u4f60\u53ef\u4ee5\u6839\u636e\u6a21\u5f0f\u6765\u5b9e\u73b0\u7b26\u5408\u81ea\u5df1\u7a0b\u5e8f\u5b9e\u9645\u6240\u9700\u7684\u89e3\u51b3\u65b9\u6848\u3002 \u4eba\u4eec\u5e38\u5e38\u4f1a\u6df7\u6dc6\u6a21\u5f0f\u548c\u7b97\u6cd5\uff0c\u56e0\u4e3a\u4e24\u8005\u5728\u6982\u5ff5\u4e0a\u90fd\u662f\u5df2\u77e5\u7279\u5b9a\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002 \u4f46\u7b97\u6cd5\u603b\u662f\u660e\u786e\u5b9a\u4e49\u8fbe\u6210\u7279\u5b9a\u76ee\u6807\u6240\u9700\u7684\u4e00\u7cfb\u5217\u6b65\u9aa4\uff0c\u800c\u6a21\u5f0f\u5219\u662f\u5bf9\u89e3\u51b3\u65b9\u6848\u7684\u66f4\u9ad8\u5c42\u6b21\u63cf\u8ff0\u3002\u540c\u4e00\u6a21\u5f0f\u5728\u4e24\u4e2a\u4e0d\u540c\u7a0b\u5e8f\u4e2d\u7684\u5b9e\u73b0\u4ee3\u7801\u53ef\u80fd\u4f1a\u4e0d\u4e00\u6837\u3002 \u7b97\u6cd5\u66f4\u50cf\u662f\u83dc\u8c31\uff1a\u63d0\u4f9b\u8fbe\u6210\u76ee\u6807\u7684\u660e\u786e\u6b65\u9aa4\u3002\u800c\u6a21\u5f0f\u66f4\u50cf\u662f\u84dd\u56fe\uff1a\u4f60\u53ef\u4ee5\u770b\u5230\u6700\u7ec8\u7684\u7ed3\u679c\u548c\u6a21\u5f0f\u7684\u529f\u80fd\uff0c\u4f46\u9700\u8981\u81ea\u5df1\u786e\u5b9a\u5b9e\u73b0\u6b65\u9aa4\u3002 Abstract \u5f52\u6863\u5b66\u4e60\u8bbe\u8ba1\u6a21\u5f0f\u65f6\u7684\u4e00\u4e9b\u7b14\u8bb0 \u4e3b\u8981\u7528 C++ \u5b9e\u73b0\uff0c\u6301\u7eed\u66f4\u65b0\u4e2d","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_2","text":"","title":"\u521b\u5efa\u578b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_3","text":"","title":"\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_4","text":"\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u521b\u5efa\u4e00\u7cfb\u5217\u76f8\u5173\u7684\u5bf9\u8c61\uff0c \u800c\u65e0\u9700\u6307\u5b9a\u5176\u5177\u4f53\u7c7b\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_5","text":"\u5982\u679c\u4ee3\u7801\u9700\u8981\u4e0e\u591a\u4e2a\u4e0d\u540c\u7cfb\u5217\u7684\u76f8\u5173\u4ea7\u54c1\u4ea4\u4e92\uff0c\u4f46\u662f\u7531\u4e8e\u65e0\u6cd5\u63d0\u524d\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\uff0c\u6216\u8005\u51fa\u4e8e\u5bf9\u672a\u6765\u6269\u5c55\u6027\u7684\u8003\u8651\uff0c\u4f60\u4e0d\u5e0c\u671b\u4ee3\u7801\u57fa\u4e8e\u4ea7\u54c1\u7684\u5177\u4f53\u7c7b\u8fdb\u884c\u6784\u5efa\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u3002 \u5982\u679c\u4f60\u6709\u4e00\u4e2a\u57fa\u4e8e\u4e00\u7ec4\u62bd\u8c61\u65b9\u6cd5\u7684\u7d2f\uff0c\u4e14\u5176\u4e3b\u8981\u529f\u80fd\u56e0\u6b64\u53d8\u5f97\u4e0d\u660e\u786e\uff0c\u90a3\u4e48\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u8003\u8651\u4e86\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_6","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_9","text":"","title":"\u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_10","text":"\u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u5176\u5728\u7236\u7c7b\u4e2d\u63d0\u4f9b\u4e00\u4e2a\u521b\u5efa\u5bf9\u8c61\u7684\u65b9\u6cd5\uff0c\u5141\u8bb8\u5b50\u7c7b\u51b3\u5b9a\u5b9e\u4f8b\u5316\u5bf9\u8c61\u7684\u7c7b\u578b\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_11","text":"\u7f16\u5199\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u65e0\u6cd5\u9884\u77e5\u5bf9\u8c61\u786e\u5207\u7c7b\u522b\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\u65f6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u7528\u6237\u80fd\u591f\u6269\u5c55\u4f60\u8f6f\u4ef6\u5e93\u6216\u6846\u67b6\u7684\u5185\u90e8\u7ec4\u4ef6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u590d\u7528\u73b0\u6709\u5bf9\u8c61\u6765\u8282\u7701\u7cfb\u7edf\u8d44\u6e90\uff0c\u800c\u4e0d\u662f\u6bcf\u6b21\u90fd\u91cd\u65b0\u521b\u5efa\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_12","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_15","text":"","title":"\u751f\u6210\u5668\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_16","text":"\u751f\u6210\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u5206\u6b65\u9aa4\u521b\u5efa\u590d\u6742\u5bf9\u8c61\u3002\u8be5\u6a21\u5f0f\u5141\u8bb8\u4f60\u4f7f\u7528\u76f8\u540c\u7684\u521b\u5efa\u4ee3\u7801\u751f\u6210\u4e0d\u540c\u7c7b\u578b\u548c\u5f62\u5f0f\u7684\u5bf9\u8c61\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_17","text":"\u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f\u53ef\u907f\u514d\u201c\u91cd\u53e0\u6784\u9020\u51fd\u6570\u201d\u7684\u51fa\u73b0 \u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u4ee3\u7801\u521b\u5efa\u4e0d\u540c\u5f62\u5f0f\u7684\u4ea7\u54c1\uff08\u4f8b\u5982\u77f3\u5934\u6216\u6728\u5934\u623f\u5c4b\uff09\u65f6\uff0c\u53ef\u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f \u4f7f\u7528\u751f\u6210\u5668\u6784\u9020\u7ec4\u5408\u6811\u6216\u5176\u4ed6\u590d\u6742\u5bf9\u8c61","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_18","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_21","text":"","title":"\u539f\u578b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_22","text":"\u539f\u578b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u590d\u5236\u5df2\u6709\u5bf9\u8c61\uff0c \u800c\u53c8\u65e0\u9700\u4f7f\u4ee3\u7801\u4f9d\u8d56\u5b83\u4eec\u6240\u5c5e\u7684\u7c7b\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_23","text":"\u5982\u679c\u4f60\u9700\u8981\u590d\u5236\u4e00\u4e9b\u5bf9\u8c61\uff0c\u540c\u65f6\u53c8\u5e0c\u671b\u4ee3\u7801\u72ec\u7acb\u4e8e\u8fd9\u4e9b\u5bf9\u8c61\u6240\u5c5e\u7684\u5177\u4f53\u7c7b\uff0c\u53ef\u4ee5\u4f7f\u7528\u539f\u578b\u6a21\u5f0f \u5982\u679c\u5b50\u7c7b\u7684\u533a\u522b\u4ec5\u5728\u4e8e\u5176\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u65b9\u5f0f\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u4f7f\u7528\u8be5\u6a21\u5f0f\u6765\u51cf\u5c11\u5b50\u7c7b\u7684\u6570\u91cf\u3002\u522b\u4eba\u521b\u5efa\u8fd9\u4e9b\u5b50\u7c7b\u7684\u76ee\u7684\u53ef\u80fd\u662f\u4e3a\u96f6\u521b\u5efa\u7279\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_24","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_27","text":"","title":"\u5355\u4f8b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_28","text":"\u5355\u4f8b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u8ba9\u4f60\u80fd\u591f\u4fdd\u8bc1\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u8bbf\u95ee\u8be5\u5b9e\u4f8b\u7684\u5168\u5c40\u8282\u70b9\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_29","text":"\u5982\u679c\u7a0b\u5e8f\u4e2d\u7684\u67d0\u4e2a\u7c7b\u5bf9\u4e8e\u6240\u6709\u5ba2\u6237\u7aef\u53ea\u6709\u4e00\u4e2a\u53ef\u7528\u7684\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f \u5982\u679c\u4f60\u9700\u8981\u66f4\u52a0\u4e25\u683c\u5730\u63a7\u5236\u5168\u5c40\u53d8\u91cf\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_30","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_33","text":"","title":"\u7ed3\u6784\u578b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_34","text":"","title":"\u9002\u914d\u5668\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_35","text":"\u9002\u914d\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u7ed3\u6784\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u4f7f\u63a5\u53e3\u4e0d\u517c\u5bb9\u7684\u5bf9\u8c61\u80fd\u591f\u76f8\u4e92\u5408\u4f5c\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_36","text":"\u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u67d0\u4e2a\u7c7b\uff0c\u4f46\u662f\u5176\u63a5\u53e3\u4e0e\u5176\u4ed6\u4ee3\u7801\u4e0d\u517c\u5bb9\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u9002\u914d\u5668\u7c7b \u5982\u679c\u4f60\u9700\u8981\u590d\u7528\u8fd9\u6837\u4e00\u4e9b\u7c7b\uff0c\u4ed6\u4eec\u5904\u4e8e\u540c\u4e00\u7ee7\u627f\u4f53\u7cfb\uff0c\u5e76\u4e14\u5b83\u4eec\u53c8\u6709\u4e86\u989d\u5916\u7684\u4e00\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u8fd9\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\u4e0d\u662f\u6240\u6709\u5728\u8fd9\u4e00\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7684\u5b50\u7c7b\u6240\u5177\u6709\u7684\u5171\u6027","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_37","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_40","text":"","title":"\u884c\u4e3a\u6a21\u5f0f"},{"location":"cs/software/piaserver/","text":"","title":"\u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0"},{"location":"cs/software/sca/","text":"\u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 \u00b6 \u7ea6 5144 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 17 \u5206\u949f Abstract \u8fd9\u91cc\u8bb0\u5f55\u5b66\u4e60\u8fd9\u672c\u4e66\u65f6\u7684\u7b14\u8bb0\uff08\u540c\u65f6\u662f\u7814\u4e00\u7684\u5b66\u4f4d\u8bfe\uff09 \u4f5c\u8005\u662f\u6211\u7684\u5bfc\u5e08\u738b\u6620\u8f89\u6559\u6388 \u8f6f\u4ef6\u590d\u7528 \u00b6 \u8f6f\u4ef6\u590d\u7528\u7684\u6982\u5ff5 \u00b6 \u8f6f\u4ef6\u590d\u7528\u662f\u6307\u5728\u4e24\u6b21\u6216\u591a\u6b21\u4e0d\u540c\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u91cd\u590d\u4f7f\u7528\u76f8\u540c\u7684\u6216\u76f8\u8fd1\u7684\u8f6f\u4ef6\u5143\u7d20\u7684\u8fc7\u7a0b\u3002\u5f15\u51fa\u4e86 \u6784\u4ef6 \u7684\u6982\u5ff5\u3002 \u8f6f\u4ef6\u590d\u7528\u53ef\u5212\u5206\u4e3a\u5982\u4e0b\u51e0\u7c7b\uff1a \u4ee3\u7801\u7684\u590d\u7528 \u8bbe\u8ba1\u7684\u590d\u7528 \u5206\u6790\u7684\u590d\u7528 \u6d4b\u8bd5\u4fe1\u606f\u7684\u590d\u7528 \u8f6f\u4ef6\u590d\u7528\u7684\u5b9e\u73b0 \u00b6 \u57fa\u672c\u95ee\u9898 \u00b6 \u5de5\u7a0b\u65b9\u9762 \u7f3a\u5c11\u80fd\u591f\u6e05\u6670\u6807\u8bc6\u53ef\u590d\u7528\u6a21\u578b\u8981\u7d20\u7684\u624b\u6bb5\u3002 \u7f3a\u5c11\u80fd\u591f\u590d\u7528\u7684\u6784\u4ef6\u3002 \u53ef\u590d\u7528\u7684\u6784\u4ef6\u7f3a\u4e4f\u7075\u6d3b\u6027\u3002 \u7f3a\u4e4f\u6267\u884c\u590d\u7528\u8fc7\u7a0b\u7684\u5de5\u5177\u3002 \u8fc7\u7a0b\u65b9\u9762 \u7ec4\u7ec7\u65b9\u9762 \u8d44\u91d1\u65b9\u9762 \u5173\u952e\u56e0\u7d20 \u00b6 \u590d\u7528\u4f9d\u8d56\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 \u3002\u4f7f\u7528\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6765\u89c4\u5212\u548c\u7ba1\u7406\u5927\u89c4\u6a21\u53ef\u590d\u7528\u7cfb\u7edf\u7684\u590d\u6742\u6027\u662f\u6700\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\u3002 \u8f6f\u4ef6\u590d\u7528\u4e0e\u6784\u4ef6\u6280\u672f \u00b6 \u6784\u4ef6\u662f\u5177\u6709\u4e00\u5b9a\u529f\u80fd\u3001\u80fd\u591f\u72ec\u7acb\u5de5\u4f5c\u6216\u540c\u5176\u4ed6\u6784\u4ef6\u88c5\u914d\u8d77\u6765\u534f\u8c03\u5de5\u4f5c\u7684\u7a0b\u5e8f\u4f53\uff0c\u6784\u4ef6\u7684\u4f7f\u7528\u540c\u5b83\u7684\u5f00\u53d1\u3001\u751f\u4ea7\u65e0\u5173\u3002\u6574\u4e2a\u6784\u4ef6\u9690\u85cf\u4e86\u5177\u4f53\u7684\u5b9e\u73b0\uff0c\u53ea\u7528\u63a5\u53e3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002 \u4ece\u5916\u90e8\u5f62\u6001\u770b\uff1a \u72ec\u7acb\u800c\u6210\u719f\u7684\u6784\u4ef6 \u6709\u9650\u5236\u7684\u6784\u4ef6 \u9002\u7528\u6027\u6784\u4ef6 \u88c5\u914d\u7684\u6784\u4ef6 \u53ef\u4fee\u6539\u7684\u6784\u4ef6 \u6784\u4ef6\u6280\u672f \u00b6 \u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u95ee\u9898 \u00b6 \u6280\u672f\u4e0e\u9700\u6c42\u53d8\u5316\u7684\u95ee\u9898\u3002 \u91cd\u590d\u4e0d\u5fc5\u8981\u7684\u5de5\u4f5c\u95ee\u9898\u3002 \u5e94\u7528\u96c6\u6210\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u96be\u4ee5\u7ef4\u62a4\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u8d28\u91cf\u548c\u6210\u672c\u6709\u6548\u6027\u95ee\u9898\u7b49\u3002 \u6784\u4ef6\u6280\u672f\u662f\u76ee\u524d\u652f\u6301\u8f6f\u4ef6\u590d\u7528\u7684\u6838\u5fc3\u6280\u672f\u3002\u7814\u7a76\u5185\u5bb9\u5305\u62ec\uff1a \u6784\u4ef6\u83b7\u53d6\uff1a\u6709\u76ee\u7684\u7684\u6784\u4ef6\u751f\u4ea7\u548c\u4ece\u5df2\u6709\u7cfb\u7edf\u4e2d\u6316\u6398\u63d0\u53d6\u6784\u4ef6\u3002 \u7814\u7a76\u6a21\u578b\uff1a\u7814\u7a76\u6784\u4ef6\u7684\u672c\u8d28\u7279\u5f81\u548c\u6784\u4ef6\u95f4\u7684\u5173\u7cfb\u3002 \u6784\u4ef6\u63cf\u8ff0\u8bed\u8a00\uff1a\u4ee5\u6784\u4ef6\u6a21\u578b\u4e3a\u57fa\u7840\uff0c\u89e3\u51b3\u6784\u4ef6\u7684\u7cbe\u786e\u63cf\u8ff0\u3001\u7406\u89e3\u3001\u68c0\u7d20\u53ca\u7ec4\u88c5\u95ee\u9898\u3002 \u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff1a\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u53ca\u68c0\u7d20\u7b56\u7565\uff0c\u5efa\u7acb\u6784\u4ef6\u5e93\u7cfb\u7edf\uff0c\u652f\u6301\u6784\u4ef6\u7684\u6709\u6548\u7ba1\u7406\u3002 \u6784\u4ef6\u590d\u5408\u7ec4\u88c5\uff1a\u5728\u6784\u4ef6\u6a21\u578b\u7684\u57fa\u7840\u4e0a\u7814\u7a76\u6784\u4ef6\u7ec4\u88c5\u673a\u5236\uff0c\u5305\u62ec\u6e90\u4ee3\u7801\u7ea7\u7684\u7ec4\u88c5\u548c\u57fa\u4e8e\u6784\u4ef6\u5bf9\u8c61\u4e92\u64cd\u4f5c\u6027\u7684\u7ec4\u88c5\u3002 \u6807\u51c6\u5316\uff1a\u6784\u4ef6\u6a21\u578b\u7684\u6807\u51c6\u5316\u548c\u6784\u4ef6\u5e93\u7cfb\u7edf\u7684\u6807\u51c6\u5316\u7b49\u3002 \u8f6f\u4ef6\u6784\u4ef6\u7684\u6982\u5ff5 \u00b6 \u8f6f\u4ef6\u6210\u5206\u5305\u62ec\u7a0b\u5e8f\u4ee3\u7801\u3001\u6d4b\u8bd5\u7528\u4f8b\u3001\u8bbe\u8ba1\u6587\u6863\u3001\u8bbe\u8ba1\u8fc7\u7a0b\u3001\u9700\u6c42\u5206\u6790\u6587\u6863\uff0c\u751a\u81f3\u9886\u57df\u77e5\u8bc6\uff0c\u901a\u5e38\u628a\u8fd9\u79cd\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u6210\u5206\u79f0\u4e3a\u8f6f\u4ef6\u6784\u4ef6\uff0c\u7b80\u79f0\u8f6f\u6784\u4ef6\u6216\u8005\u6784\u4ef6\u3002\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u5143\u7d20\u8d8a\u5927\uff0c\u6211\u4eec\u5c31\u8bf4\u590d\u7528\u7684\u7c92\u5ea6(Granularity)\u8d8a\u5927\u3002 \u6784\u4ef6\u662f\u9884\u5148\u6784\u5efa\u7684\u3002 \u6784\u4ef6\u662f\u9ed1\u76d2\u7684\u3002 \u6784\u4ef6\u662f\u53ef\u5206\u79bb\u7684\u3002 \u6784\u4ef6\u80fd\u7528\u4e8e\u7ec4\u88c5\u548c\u90e8\u7f72\u3002 \u6784\u4ef6\u9700\u8981\u79f0\u4e3a\u6784\u4ef6\u5bb9\u5668\u6280\u672f\u7684\u652f\u6301\u3002 \u4e00\u4e2a\u5b8c\u6574\u7684\u6784\u4ef6\u5e94\u5305\u542b6\u4e2a\u8981\u7d20\uff1a \u53d7\u7ea6\u675f\u7684\u6784\u4ef6\u6807\u51c6\uff1a\u7b26\u5408\u67d0\u79cd\u6784\u4ef6\u6a21\u578b\u3002 \u89c4\u683c\u8bf4\u660e\uff1a\u6784\u4ef6\u63d0\u4f9b\u670d\u52a1\u7684\u62bd\u8c61\u63cf\u8ff0\uff0c\u7528\u4f5c\u670d\u52a1\u7684\u5ba2\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\u3002 \u5b9e\u73b0\uff1a\u5fc5\u987b\u7b26\u5408\u89c4\u683c\u8bf4\u660e\uff0c\u5404\u81ea\u5b9e\u73b0\u3002 \u5305\u88c5\u65b9\u6cd5\uff1a\u6309\u4e0d\u540c\u7684\u65b9\u5f0f\u5206\u7ec4\u6765\u63d0\u4f9b \u4e00\u5957\u53ef\u4ee5\u66ff\u6362\u7684\u670d\u52a1(\u5305)\u3002 \u6ce8\u518c\uff1a\u53ef\u5728\u6784\u4ef6\u652f\u6301\u73af\u5883\u4e2d\u6ce8\u518c\u3002 \u90e8\u7f72\u65b9\u6cd5\uff1a\u6784\u4ef6\u53ef\u4ee5\u90e8\u7f72\u591a\u4e2a\u5b9e\u4f8b\u3002 \u8f6f\u4ef6\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e \u00b6 \u6784\u4ef6\u7684\u540d\u79f0\u4e0e\u7b80\u77ed\u63cf\u8ff0\u3002 \u6784\u4ef6\u670d\u52a1\u3002 \u6784\u4ef6\u63a5\u53e3\u4fe1\u606f\u3002 \u6240\u9700\u7684\u63a5\u53e3\u3002 \u53d1\u5e03\u548c\u63a5\u53d7\u7684\u4e8b\u4ef6\u3002 \u6784\u4ef6\u7279\u5f81\u3002 \u9644\u52a0\u4fe1\u606f\u3002 \u8f6f\u4ef6\u6784\u4ef6\u63a5\u53e3 \u00b6 \u6784\u4ef6\u5fc5\u9886\u5bf9\u5176\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u8fdb\u884c\u62bd\u8c61\u63cf\u8ff0\uff0c\u4ee5\u4f5c\u4e3a\u670d\u52a1\u7684\u5bb9\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\uff0c\u8fd9\u5c31\u662f\u6784\u4ef6\u63a5\u53e3\u3002 \u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b \u00b6 \u6784\u4ef6\u6a21\u578b\u7684\u6982\u5ff5 \u00b6 \u6784\u4ef6\u6a21\u578b\u5b9a\u4e49\u4e86\u4ec0\u4e48\u662f\u6784\u4ef6\u3001\u6784\u4ef6\u7684\u4f9d\u636e\u3001\u5982\u4f55\u4f7f\u7528\u5176\u4ed6\u6784\u4ef6\u63d0\u4f9b\u7684\u670d\u52a1\u7b49\u3002\u5c07\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u5177\u4f53\u5b9e\u73b0\u5206\u79bb\uff0c\u4f9d\u9760\u6784\u4ef6\u5b9e\u73b0\u7684\u5177\u4f53\u6a21\u5f0f\u6765\u63a8\u5bfc\u51fa\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\uff0c\u53ef\u4ee5\u6784\u9020\u4e00\u4e2a\u6784\u4ef6\u6a21\u578b\u3002 \u4f7f\u7528\u4e2d\u95f4\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u6784\u4ef6\u4e4b\u95f4\u8fdb\u884c\u66f4\u597d\u5730\u901a\u4fe1\u3002\u5982\u6784\u4ef6\u4e4b\u95f4\u76f4\u63a5\u8fdb\u884c\u901a\u4fe1\uff0c\u5f53\u6784\u6210\u7cfb\u7edf\u7684\u6784\u4ef6\u6570\u91cf\u5e9e\u5927\u65f6\uff0c\u5176\u590d\u6742\u7a0b\u5ea6\u8fc5\u901f\u63d0\u9ad8\uff1b\u5982\u80fd\u5f15\u4eba\u4e2d\u4ecb\u5c42 (\u4e2d\u95f4\u4ef6)\uff0c\u5219\u53ef\u5f88\u597d\u5730\u907f\u514d\u6784\u4ef6\u95f4\u590d\u6742\u7684\u4ea4\u4e92\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b \u00b6 \u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b\u56fd\u5185\u8bb8\u591a\u5b66\u8005\u5728\u6784\u4ef6\u6a21\u578b\u7684\u7814\u7a76\u65b9\u9762\u505a\u4e86\u4e0d\u5c11\u7684\u5de5\u4f5c\uff0c\u5176\u4e2d\u8f83\u4e3a\u7a81\u51fa\u7684\u662f\u5317\u4eac\u5927\u5b66\u6768\u8299\u6e05\u9662\u58eb\u7b49\u4eba\u63d0\u51fa\u7684\u201c\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b(JBCOM)\u201d\u3002\u5b83\u7531\u5916\u90e8\u63a5\u53c8\u4e0e\u5185\u90e8\u7ed3\u6784\u4e24\u90e8\u5206\u7ec4\u6210\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u6784\u4ef6\u7684\u5916\u90e8\u63a5\u53e3\u662f\u6307\u6784\u4ef6\u5411\u5176\u590d\u7528\u8005\u63d0\u4f9b\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5305\u62ec:\u6784\u4ef6\u540d\u79f0\u3001\u529f\u80fd\u63cf\u8ff0\u3001\u5bf9\u5916\u529f\u80fd\u63a5\u53e3\uff0c\u6240\u9700\u670d\u52a1\u7684\u6784\u4ef6\u548c\u53c2\u6570\u5316\u5c5e\u6027\u7b49\u3002\u5916\u90e8\u63a5\u53e3\u662f\u6784\u4ef6\u4e0e\u5916\u754c\u7684\u4e00\u7ec4\u4ea4\u4e92\u70b9\uff0c\u8bf4\u660e\u4e86\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u90a3\u4e9b\u670d\u52a1(\u6d88\u606f\u3001\u64cd\u4f5c\u548c\u53d8\u91cf)\u3002 \u6784\u4ef6\u7684\u5185\u90e8\u7ed3\u6784\u5305\u62ec\u4e24\u65b9\u9762\u7684\u5185\u5bb9:\u5185\u90e8\u6210\u5458\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5176\u4e2d\uff0c\u5185\u90e8\u6210\u5458\u5305\u62ec\u5177\u4f53\u6210\u5458\u4e0e\u865a\u62df\u6210\u5458\uff0c\u800c\u6210\u5458\u5173\u7cfb\u5305\u62ec\u6210\u5458\u4e4b\u95f4\u7684\u4e92\u8054\uff0c\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e0e\u5916\u90e8\u63a5\u53e3\u4e4b\u95f4\u7684\u4e92\u8054\u3002 \u6784\u4ef6\u6a21\u578b\u7684\u63cf\u8ff0\u65b9\u6cd5 \u00b6 \u6784\u4ef6::=\u3008\u6784\u4ef6\u89c4\u7ea6\uff0c\u6784\u4ef6\u5b9e\u73b0\u3009 \u6784\u4ef6\u89c4\u7ea6::=\u3008\u63a5\u53c8\u90e8\u5206\uff0c\u7ed3\u6784\u90e8\u5206\u3009 \u63a5\u53e3\u90e8\u5206::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\uff0c\u670d\u52a1\u96c6\u5408\u3009 \u670d\u52a1::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\u3009 \u7ed3\u6784\u90e8\u5206::=\u3008\u539f\u5b50\u6784\u4ef6\u7ed3\u6784\u3009|\u3008\u590d\u5408\u6784\u4ef6\u7ed3\u6784\u3009 \u539f\u5b50\u6784\u4ef6\u7ed3\u6784::=\u3008\u6784\u4ef6\u5b9e\u73b0\u7684\u5f15\u7528\u3009 \u590d\u5408\u6784\u4ef6\u7ed3\u6784::=\u3008\u5f15\u7528\u7684\u6784\u4ef6\u7c7b\u578b\uff0c\u5b9e\u4f8b\u58f0\u660e\uff0c\u5b9e\u4f8b\u8fde\u63a5\uff0c\u6620\u5c04\u3009 eg. \u7f16\u8bd1\u5668\u590d\u5408\u6784\u4ef6\u5b9e\u4f8b\u3002 \u8f6f\u4ef6\u6784\u4ef6\u7684\u6df1\u5c42\u7406\u89e3 \u00b6 \u6784\u4ef6\u7684\u7c92\u5ea6 \u6784\u4ef6\u7684\u57fa\u7840\u8bbe\u65bd \u6784\u4ef6\u7684\u83b7\u53d6 \u6784\u4ef6\u7684\u7ba1\u7406 \u7ec4\u88c5\u4e0e\u90e8\u7f72 \u9762\u5411\u6784\u4ef6 \u00b6 \u9762\u5411\u6784\u4ef6\u7684\u6982\u5ff5 \u00b6 \u901a\u8fc7\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u5b9e\u73b0\uff0c\u6765\u5f97\u5230\u6240\u9700\u7684\u6784\u4ef6 \u6784\u4ef6\u7684\u5206\u7c7b \u00b6 \u6839\u636e\u8f6f\u4ef6 3 \u5c42\u6846\u67b6\u7684\u6784\u4ef6\u5206\u7c7b \u8868\u793a\u5c42 \u4e1a\u52a1\u5c42 \u6570\u636e\u5c42 \u636e\u6b64\u6846\u67b6\uff0c\u6784\u4ef6\u53ef\u4ee5\u88ab\u5206\u4e3a 3 \u7c7b\uff1a\u5e94\u7528\u8f6f\u4ef6\u3001\u4e1a\u52a1\u6784\u4ef6\u548c\u6570\u636e\u6784\u4ef6 \u4e1a\u52a1\u6784\u4ef6\u7684\u83b7\u53d6\u60c5\u51b5 \u5b9a\u4e49\u4e1a\u52a1\u5bf9\u8c61 \u786e\u5b9a\u63a7\u5236\u903b\u8f91\uff08\u4e1a\u52a1\u8fc7\u7a0b\uff09 \u786e\u5b9a\u4e1a\u52a1\u5bf9\u8c61\u4e0e\u63a7\u5236\u903b\u8f91\u4e4b\u95f4\u7684\u4ea4\u4e92 \u533a\u5206\u516c\u53f8\u7684\u4e1a\u52a1\u903b\u8f91\u548c\u7279\u5b9a\u90e8\u95e8\u7684\u4e1a\u52a1\u903b\u8f91 \u5c06\u4e1a\u52a1\u5bf9\u8c61\u548c\u63a7\u5236\u903b\u8f91\u5206\u914d\u5230\u76f8\u5e94\u7684\u4e1a\u52a1\u6784\u4ef6\u4e2d\u53bb \u57fa\u4e8e\u6784\u4ef6\u7c92\u5ea6\u5927\u5c0f\u7684\u6784\u4ef6\u5206\u7c7b \u53ef\u5206\u4e3a\uff1a\u5927\u7c92\u5ea6\u7684\u5e94\u7528\u6784\u4ef6\u3001\u7528\u6237\u4efb\u52a1\u6784\u4ef6\u3001\u6279\u5904\u7406\u6784\u4ef6\u548c\u5b50\u4efb\u52a1\u6784\u4ef6 \u6784\u4ef6\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0 \u00b6 \u6784\u4ef6\u63a5\u53e3\u5b9a\u4e49\u7684\u539f\u5219 \u00b6 \u6784\u4ef6\u63a5\u53e3\u7684\u5b9a\u4e49\u7684\u57fa\u672c\u539f\u5219\uff1a \u5b9a\u4e49\u4e00\u4e9b\u4e0d\u53d8\u7684\u63a5\u53e3 \u5b9a\u4e49\u81ea\u63cf\u8ff0\u7684\u63a5\u53e3 \u5b9a\u4e49\u5143\u6570\u636e\u6027\u8d28\u7684\u63a5\u53e3 \u6784\u4ef6\u8bbe\u8ba1\u6210\u53ef\u5b9a\u5236\u7684 \u539f\u5b50\u6784\u4ef6\u7684\u5236\u4f5c \u00b6 \u539f\u5b50\u6784\u4ef6 Atom \u662f\u6700\u5c0f\u7c92\u5ea6\u7684\u6784\u4ef6\uff0c\u8be5\u6784\u4ef6\u5728\u529f\u80fd\u7b49\u65b9\u9762\u5177\u6709\u4e0d\u53ef\u518d\u62c6\u5206\u7684\u6027\u8d28\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u7684\u5b9e\u4f53\u5bf9\u5e94\u5355\u4e2a\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u79f0\u8fd9\u4e2a\u6784\u4ef6\u662f\u5355\u5bf9\u8c61\u6784\u4ef6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u63a5\u53e3\u89c4\u7ea6\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u5bf9\u5e94\u591a\u4e2a\u534f\u4f5c\u5bf9\u8c61\u65f6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u9700\u8981\u5f15\u5165\u4e00\u4e2a\u63a7\u5236\u5bf9\u8c61\u3002 \u5b9a\u4e49\u6784\u4ef6\u63a5\u53e3\u7684\u89c4\u7ea6\u90e8\u5206\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002 \u590d\u5408\u6784\u4ef6\u7684\u5236\u4f5c \u00b6 \u590d\u5408\u6784\u4ef6 Assemble \u662f\u7531\u539f\u5b50\u6784\u4ef6\u6216\u8005\u590d\u5408\u6784\u4ef6\u7ec4\u88c5\u800c\u6210\u7684\u3002 \u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u6784\u4ef6\u7684\u63a5\u53e3\u89c4\u7ea6\u90e8\u5206 \u786e\u5b9a\u6240\u5305\u542b\u7684\u6210\u5458\u6784\u4ef6 \u5efa\u7acb\u5185\u90e8\u7684\u6210\u5458\u6784\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u8fde\u63a5\u5173\u7cfb \u5c06\u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u548c\u8981\u6c42\u7684\u529f\u80fd\u6620\u5c04\u5230\u5185\u90e8\u6210\u5458\u6784\u4ef6\u76f8\u5e94\u7684\u529f\u80fd\u4e0a \u5728\u5efa\u7acb\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u8fde\u63a5\u5173\u7cfb\u4ee5\u53ca\u590d\u5408\u6784\u4ef6\u548c\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u6620\u5c04\u65f6\uff0c\u9075\u5faa\u4e00\u4e0b\u89c4\u5219\uff1a \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ea\u80fd\u7531\u4e00\u4e2a\u63d0\u4f9b\u8005\u63d0\u4f9b \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ef\u4ee5\u6709\u591a\u4e2a\u4f7f\u7528\u8005 \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ef\u4ee5\u6620\u5c04\u5230\u591a\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ea\u80fd\u6620\u5c04\u5230\u4e00\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a \u6784\u4ef6\u7684\u7ba1\u7406\u4e0e\u7ef4\u62a4 \u00b6 \u6784\u4ef6\u5e93\u662f\u5bf9\u6784\u4ef6\u5b9e\u65bd\u5206\u7c7b\u548c\u7ba1\u7406\u7684\u673a\u6784\u3002 \u6784\u4ef6\u5e93\u7684\u7ec4\u7ec7 \u00b6 \u6784\u4ef6\u5e93\u7406\u8bba\u7814\u7a76\u7684\u91cd\u70b9\u662f\u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff0c\u5373\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u3001\u68c0\u7d22\u624b\u6bb5\u548c\u6784\u4ef6\u76f8\u4f3c\u6027\u5206\u6790\u7b49\u3002 \u9886\u57df\u4e0a\u6784\u4ef6\u5e93\u6ee1\u8db3\u7684\u6761\u4ef6\uff1a \u9886\u57df\u5b8c\u6574\u6027 \u9886\u57df\u62bd\u8c61\u6027 \u9886\u57df\u6807\u51c6\u5316 \u6784\u4ef6\u5e93\u7684\u5206\u7c7b\u6a21\u5f0f \u00b6 \u5173\u952e\u5b57\u5206\u7c7b\u6cd5 \u8d85\u6587\u672c\u7ec4\u7ec7\u6cd5 \u523b\u9762\u5206\u7c7b\u6cd5 \u7531\u4e00\u7ec4\u63cf\u8ff0\u6784\u4ef6\u672c\u8d28\u7279\u5f81\u7684\u523b\u9762\u7ec4\u6210\uff0c\u6bcf\u4e2a\u523b\u9762\u4ece\u4e0d\u540c\u7684\u89d2\u5ea6\u5bf9\u6784\u4ef6\u8fdb\u884c\u5206\u7c7b\u3002 \u4ece\u8868\u793a\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u523b\u9762\u662f\u4e00\u9897\u6709\u5411\u6811\uff0c\u6839\u8282\u70b9\u7684\u503c\u662f\u8be5\u523b\u9762\u7684\u540d\u79f0\uff0c\u6839\u8282\u70b9\u6240\u6709\u5b50\u6811\u6784\u6210\u7684\u68ee\u6797\u79f0\u4e3a\u672f\u8bed\u7a7a\u95f4 \u7279\u70b9\uff1a \u5bf9\u6784\u4ef6\u8fdb\u884c\u4e86\u591a\u89c6\u89d2\u4e0b\u7684\u5206\u7c7b\u63cf\u8ff0 \u6784\u4ef6\u5206\u7c7b\u63cf\u8ff0\u7684\u672f\u8bed\u7a7a\u95f4\u6613\u4e8e\u4fee\u6539\u548c\u7ef4\u62a4 \u57fa\u4e8e\u6784\u4ef6 \u00b6 \u6784\u4ef6\u7ec4\u88c5 \u00b6 \u6784\u4ef6\u7ec4\u88c5\u5c31\u662f\u786e\u5b9a\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u4e0e\u63a5\u53e3\u4e4b\u95f4\u7684\u5339\u914d\u548c\u6620\u5c04\uff0c\u5e76\u63d0\u4f9b\u6ee1\u8db3\u5373\u5c06\u6216\u5c06\u6765\u90e8\u7f72\u7684\u7ea6\u675f\u6761\u4ef6\u3002 \u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u95ee\u9898 \u00b6 \u4efb\u4f55\u57fa\u4e8e\u6784\u4ef6\u7684\u5f00\u53d1\u5e94\u7b26\u5408\u4ee5\u4e0b\u6784\u4ef6\uff1a \u8981\u6e05\u6670\u5730\u5206\u79bb\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u8bbe\u8ba1\u5b9e\u73b0 \u91cd\u70b9\u5173\u6ce8\u4e8e\u63a5\u53e3\u7684\u5b9e\u73b0\u65b9\u6cd5 \u5f62\u5f0f\u5730\u63cf\u8ff0\u6784\u4ef6\u7684\u8bed\u4e49\uff0c\u4e3b\u8981\u662f\u5bf9\u6784\u4ef6\u884c\u4e3a\u7684\u63cf\u8ff0\uff0c\u5176\u6838\u5fc3\u662f\u64cd\u4f5c\u7279\u5f81\u7684\u8bed\u4e49\u7ec6\u8282 \u4e25\u683c\u5730\u8bb0\u5f55\u7ec6\u5316\u8fc7\u7a0b\uff0c\u5e76\u4e14\u52a0\u4ee5\u9a8c\u8bc1 \u4ece\u6280\u672f\u89d2\u5ea6\u770b\uff0c\u6784\u4ef6\u7ec4\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8003\u8651\u7684\u95ee\u9898\uff1a \u6bcf\u4e2a\u6784\u4ef6\u6ee1\u8db3\u5176\u4ed6\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6\u95ee\u9898 \u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u63a5\u53e3\u5339\u914d\u548c\u6620\u5c04\u95ee\u9898 \u6784\u4ef6\u7684\u5305\u88c5\u95ee\u9898 \u6784\u4ef6\u7ec4\u88c5\u7684\u65b9\u6cd5\u4e0e\u6280\u672f \u00b6 \u5b9a\u5236 \u8bbe\u7f6e\u53c2\u6570\u503c \u5b8c\u6210\u9700\u8981\u7528\u6237\u5b9a\u5236\u7684\u4ee3\u7801 \u6709\u65f6\u5019\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u6784\u4ef6 \u5305\u88c5 \u9002\u914d \u9002\u914d\u5668 \u9002\u914d\u5668\u4f4d\u4e8e\u4e24\u4e2a\u6784\u4ef6\u4e4b\u95f4\uff0c\u7528\u4ee5\u8f6c\u6362\u4e24\u4e2a\u6784\u4ef6\u5bf9\u63a5\u53e3\u7684\u4e0d\u540c\u7406\u89e3\uff0c\u662f\u8bf7\u6c42\u8005\u548c\u88ab\u8bf7\u6c42\u8005\u4e4b\u95f4\u7684\u6620\u5c04 \u9002\u914d\u5668\u672c\u8eab\u4e0d\u5305\u542b\u8868\u793a\u5c42\u3001\u4e1a\u52a1\u5c42\u548c\u6570\u636e\u8bbf\u95ee\u5c42\u7684\u903b\u8f91\uff0c\u4e5f\u4e0d\u80fd\u6269\u5c55\u6784\u4ef6\u7684\u529f\u80fd\uff08\u4e0e\u5305\u88c5\u4e0d\u540c\uff09 \u9002\u914d\u5668\u4e0d\u662f\u6784\u4ef6\uff0c\u4e0d\u5c5e\u4e8e\u88ab\u9002\u914d\u7684\u4e24\u4e2a\u6784\u4ef6\u7684\u4efb\u4f55\u4e00\u4e2a\uff0c\u4efb\u4f55\u4e00\u4e2a\u6784\u4ef6\u7684\u4e0d\u5b58\u5728\u5c06\u5bfc\u81f4\u9002\u914d\u5668\u7684\u6d88\u5931 \u9a8c\u8bc1\u548c\u9519\u8bef\u5904\u7406\u529f\u80fd \u5b89\u5168\u6027 \u6784\u4ef6\u7ec4\u88c5\u7684\u5185\u5bb9 \u00b6 \u6784\u4ef6\u7ec4\u88c5\u7684\u5b9e\u65bd\u5185\u5bb9\uff1a \u5f3a\u5236\u5b9e\u73b0\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6 \u5904\u7406\u529f\u80fd\u548c\u6570\u636e\u7684\u4e0d\u5339\u914d \u7ba1\u7406\u6784\u4ef6\u95f4\u7684\u5173\u7cfb \u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u7c7b\u578b\u5305\u62ec\u62e5\u6709\u5173\u7cfb\u548c\u5916\u90e8\u5173\u7cfb\u3002\u4f46\u4ece\u5173\u7cfb\u7684\u8868\u793a\u89d2\u5ea6\u6765\u770b\uff0c\u53ef\u5206\u4e3a\u76f4\u63a5\u94fe\u63a5\u548c\u95f4\u63a5\u94fe\u63a5\u3002 \u6784\u4ef6\u90e8\u7f72 \u00b6 \u63d0\u4f9b\u6784\u4ef6\u8fd0\u884c\u65f6\u7684\u914d\u7f6e\u6570\u636e \u63d0\u4f9b\u90e8\u7f72\u65f6\u7528\u5230\u7684\u6784\u4ef6\u5185\u5efa\u914d\u7f6e\u6216\u5b9a\u5236\u670d\u52a1 \u63d0\u4f9b\u6784\u4ef6\u7ec4\u88c5\u7684\u8f85\u52a9\u73af\u5883 \u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406 \u00b6 \u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406 SCM \u662f\u6307\u4e00\u5957\u6309\u89c4\u5219\u7ba1\u7406\u8f6f\u4ef6\u5f00\u53d1\u3001\u7ef4\u62a4\uff0c\u4ee5\u53ca\u5176\u4e2d\u5404\u79cd\u4e2d\u95f4\u8f6f\u4ef6\u4ea7\u54c1\u7684\u65b9\u6cd5\u3002 \u914d\u7f6e\u8bc6\u522b \u53d8\u5316\u63a7\u5236 \u72b6\u6001\u8bb0\u5f55\u62a5\u544a \u5ba1\u8ba1 \u9886\u57df\u5de5\u7a0b \u00b6 \u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b \u00b6 \u5e94\u7528\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u7ec4\u7279\u6709\u7684\u9700\u6c42\uff0c\u4ea7\u751f\u4e00\u4e2a\u7279\u5b9a\u7684\u89e3\u51b3\u65b9\u6848 \u9886\u57df\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u4e2a\u9886\u57df\u4e2d\u7684\u6240\u6709\u7cfb\u7edf\uff0c\u800c\u4e0d\u5c40\u9650\u4e8e\u67d0\u4e2a\u7279\u5b9a\u7684\u7cfb\u7edf \u4e0e\u5e94\u7528\u5de5\u7a0b\u76f8\u6bd4 \uff1a\u9886\u57df\u5de5\u7a0b\u5904\u4e8e\u4e00\u4e2a\u8f83\u9ad8\u7684\u62bd\u8c61\u7ea7\u522b\u4e0a \u9886\u57df\u5de5\u7a0b\u7684\u6784\u6210 \u00b6 \u7ec4\u6210\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u9886\u57df\u5b9e\u73b0 \u53ef\u590d\u7528\u8d44\u4ea7\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u8d44\u4ea7\u83b7\u53d6\u3001\u8d44\u4ea7\u5206\u7c7b\u3001\u8d44\u4ea7\u7ef4\u62a4 \u5e94\u7528\u5de5\u7a0b\u7684\u6784\u6210 \u00b6 \u7ec4\u6210\uff1a\u4ea7\u54c1\u7a7a\u95f4\u3001\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\u3001\u751f\u4ea7\u8ba1\u5212\u3001\u9700\u6c42\u3001\u4ea7\u54c1\u3001\u7ba1\u7406 \u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b\u7684\u5173\u7cfb \u00b6 \u9886\u57df\u5171\u6027\u4e0e\u53d8\u5316\u6027 \u00b6 \u53d8\u5316\u6027\u7684\u5206\u7c7b \u53d8\u5316\u6027\u7ed1\u5b9a \u53d8\u5316\u6027\u63a7\u5236 \u53d8\u5316\u6027\u5904\u7406\u6280\u672f \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u57fa\u672c\u5185\u5bb9 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6982\u5ff5 \u00b6 \u51af \u00b7 \u8bfa\u4f9d\u66fc\u7ed3\u6784 \u57fa\u4e8e\u529f\u80fd\u6a21\u5757\u7684\u8f6f\u4ef6\u7ed3\u6784 \u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5b9a\u4e49 \u00b6 Garlan & Shaw \u6a21\u578b\uff1a SA = {Components, Connectors, Constrains} Perry & Wolf \u6a21\u578b\uff1a SA = {Elements, Form, Rational} CFRP \u6a21\u578b\uff1aSA = {Elements, Interfaces, COnnections, Connection Semantics} Vestal \u6a21\u578b\uff1a SA = {Component, Idioms/Styles, Common Patterns of Interaction} IEEE 510\uff1aArchitecture = {Component, Connector, Environment, Principle} Boehm \u6a21\u578b\uff1aSA = {Components, COnnections, Constrains, Stakeholders'needs, Rationals} \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6784\u6210\u8981\u7d20 \u00b6 \u6784\u4ef6 \u8fde\u63a5\u4ef6 \u4f53\u7cfb\u7ed3\u6784\u914d\u7f6e \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u7814\u7a76\u5185\u5bb9 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u63cf\u8ff0\u8bed\u8a00 ADL \u00b6 \u4f53\u7cfb\u7ed3\u6784\u6784\u9020 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u9a8c\u8bc1 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53d1\u73b0\u3001\u6f14\u5316\u548c\u590d\u7528 \u00b6 \u57fa\u4e8e\u4f53\u7cfb\u7ed3\u6784\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b \u00b6 \u7279\u5b9a\u9886\u57df\u7684\u4f53\u7cfb\u7ed3\u6784 DSSA \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u652f\u6301\u5de5\u5177 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u6a21\u5f0f\u7cfb\u7edf \u00b6 \u6a21\u5f0f\u7684\u6982\u5ff5\u4e0e\u5206\u7c7b \u00b6 \u6a21\u5f0f\u7684\u5b9a\u4e49 \u00b6 \u6bcf\u4e2a\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u5728\u6211\u4eec\u5468\u56f4\u4e0d\u65ad\u91cd\u590d\u53d1\u751f\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u8be5\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u7684\u6838\u5fc3\u5185\u5bb9\u3002\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u4e00\u6b21\u53c8\u4e00\u6b21\u5730\u4f7f\u7528\u8be5\u65b9\u6848\u800c\u4e0d\u5fc5\u505a\u91cd\u590d\u52b3\u52a8\u3002 \u89e3\u51b3\u7b56\u7565\uff1a\u5c06\u6a21\u578b\u3001\u89c6\u56fe\u3001\u63a7\u5236\u5668\u5212\u5206\u5f00\u3002\u5c31\u662f\u4e00\u4e2a\u5178\u578b\u7684\u6a21\u578b \u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09 \u6a21\u5f0f\u7684\u6784\u6210\u8981\u7d20 \u00b6 \u8bed\u5883\uff1a\u95ee\u9898\u51fa\u73b0\u7684\u80cc\u666f \u95ee\u9898\uff1a\u5728\u8bed\u5883\u4e2d\u91cd\u590d\u51fa\u73b0\u7684\u95ee\u9898 \u89e3\u51b3\u65b9\u6848\uff1a\u7ed9\u51fa\u5982\u4f55\u89e3\u51b3\u518d\u73b0\u7684\u95ee\u9898\uff0c\u6216\u8005\u8bf4\u5982\u4f55\u5e73\u8861\u4e0e\u4e4b\u76f8\u5173\u7684\u5f3a\u5236\u6761\u4ef6 \u5b9e\u73b0\uff1a\u5c31\u662f\u5c06\u4ee5\u4e0a\u7684\u89e3\u51b3\u65b9\u6848\u4ed8\u8bf8\u5b9e\u8df5 \u6a21\u5f0f\u7684\u4f18\u52bf \u00b6 \u8bbe\u8ba1\u590d\u7528 \u4ee3\u7801\u590d\u7528 \u7cfb\u7edf\u7ec4\u6210\u66f4\u6613\u4e8e\u88ab\u4ed6\u4eba\u7406\u89e3 \u6709\u5229\u4e8e\u7cfb\u7edf\u7684\u4e92\u64cd\u4f5c\u6027 \u6709\u5229\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790 \u6709\u5229\u4e8e\u7279\u5b9a\u6a21\u5f0f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53ef\u89c6\u5316 \u6a21\u5f0f\u5206\u7c7b \u00b6 \u5e95\u5c42\u6a21\u5f0f\uff1a\u60ef\u7528\u6cd5 \u4e2d\u5c42\u6a21\u5f0f\uff1a\u8bbe\u8ba1\u6a21\u5f0f \u9ad8\u5c42\u6a21\u5f0f\uff1a\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f \u60ef\u7528\u6cd5 \u00b6 \u60ef\u7528\u6cd5\u9488\u5bf9\u8bbe\u8ba1\u548c\u5b9e\u73b0\u65b9\u9762\uff0c\u662f\u9488\u5bf9\u5177\u4f53\u7279\u5b9a\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7684\u4f4e\u5c42\u6a21\u5f0f\uff0c\u5b83\u63cf\u8ff0\u5982\u4f55\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u6216\u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u7279\u70b9 \u60ef\u7528\u6cd5\u662f\u4e0e\u5177\u4f53\u8bed\u8a00\u5bc6\u5207\u76f8\u5173\u7684\u7f16\u7a0b\u7ecf\u9a8c\u7684,\u603b\u7ed3\u3002 \u60ef\u7528\u6cd5\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u53ca\u5176\u5173\u7cfb\u3002 \u60ef\u7528\u6cd5\u4ee3\u8868\u6700\u5e95\u5c42\u7684\u6a21\u5f0f\u3002 \u60ef\u7528\u6cd5\u66f4\u5173\u6ce8\u8bbe\u8ba1\u7684\u5b9e\u73b0\u3002 \u60ef\u7528\u6cd5\u53ef\u80fd\u662f\u4e00\u79cd\u7279\u5b9a\u8bbe\u8ba1\u6a21\u5f0f\u7684\u5177\u4f53\u5b9e\u73b0\u3002 \u76ca\u5904 \u4e00\u7ec4\u76f8\u5173\u7684\u60ef\u7528\u6cd5\u4f1a\u4f7f\u7a0b\u5e8f\u5f62\u6210\u4e00\u81f4\u7684\u98ce\u683c\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u5c06\u52a0\u901f\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u8fdb\u7a0b\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u4f7f\u7a0b\u5e8f\u66f4\u5bb9\u6613\u7406\u89e3\uff0c\u6709\u5229\u4e8e\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u7ef4\u62a4\u3002 \u00b7 \u8bbe\u8ba1\u6a21\u5f0f \u00b6 \u4e2d\u7b49\u89c4\u6a21\u7684\u6a21\u5f0f\uff0c\u5728\u89c4\u6a21\u4e0a\u6bd4\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u8981\u5c0f\uff0c\u4f46\u5728\u7ea7\u522b\u4e0a\u6bd4\u7279\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u60ef\u7528\u6cd5\u8981\u9ad8 \u8bbe\u8ba1\u6a21\u5f0f\u95ee\u9898\u7c7b\u522b \u00b6 \u7ed3\u6784\u5316\u5206\u89e3\uff1a\u6700\u666e\u904d\u7684\u6a21\u5f0f\u662f\u6574\u4f53 - \u90e8\u5206\u6a21\u5f0f \u5de5\u4f5c\u7684\u7ec4\u7ec7\uff1a\u4e3b\u63a7 - \u4ece\u5c5e\u6a21\u5f0f \u8bbf\u95ee\u63a7\u5236\uff1a\u4ee3\u7406\u8bbe\u8ba1\u6a21\u5f0f\u3001\u5916\u89c2\u6a21\u5f0f\u548c\u8fed\u4ee3\u5668\u6a21\u5f0f \u7ba1\u7406\uff1a\u547d\u4ee4\u5904\u7406\u5668\u6a21\u5f0f\u3001\u89c6\u56fe\u5904\u7406\u7a0b\u5e8f\u6a21\u5f0f \u901a\u4fe1\uff1a\u8f6c\u53d1\u5668 - \u63a5\u6536\u5668\u6a21\u5f0f\u3001\u5ba2\u6237\u673a - \u5206\u914d\u5668 - \u670d\u52a1\u5668\u6a21\u5f0f\u3001\u51fa\u7248\u8005 - \u8ba2\u9605\u8005\u6a21\u5f0f \u8bbe\u8ba1\u6a21\u5f0f\u5206\u7c7b \u00b6 \u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f \u00b6 \u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5b9a\u4e49 \u00b6 \u4e00\u4e2a\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u7a0b\u5e8f\u5728\u7279\u5b9a\u8bbe\u8ba1\u8bed\u5883\u4e2d\u7684\u7279\u6b8a\u7684\u518d\u73b0\u8bbe\u8ba1\u95ee\u9898\uff0c\u5e76\u4e3a\u5b83\u7684\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ecf\u8fc7\u5145\u5206\u9a8c\u8bc1\u7684\u901a\u7528\u56fe\u5f0f\u3002\u89e3\u51b3\u65b9\u6848\u56fe\u5f0f\u901a\u8fc7\u63cf\u8ff0\u5176\u7ec4\u6210\u6784\u4ef6\u3001\u5b83\u4eec\u7684\u8d23\u4efb\u548c\u76f8\u4e92\u5173\u7cfb\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u534f\u4f5c\u65b9\u5f0f\u6765\u5177\u4f53\u6307\u5b9a\u3002 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u662f\u6a21\u5f0f\u7cfb\u7edf\u4e2d\u7684\u6700\u9ad8\u7b49\u7ea7\u6a21\u5f0f \u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5206\u7c7b \u00b6 \u4ece\u6df7\u6c8c\u5230\u7ed3\u6784 \u5206\u5c42\u6a21\u5f0f \u7ba1\u9053/\u8fc7\u6ee4\u5668\u6a21\u5f0f \u9ed1\u677f\u6a21\u5f0f \u5206\u5e03\u5f0f\u7cfb\u7edf \u4ee3\u7406\u6a21\u5f0f \u4ea4\u4e92\u5f0f\u7cfb\u7edf \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\u6a21\u5f0f\uff08PAC\uff09 \u9002\u5e94\u6027\u6a21\u5f0f \u53cd\u5c04\u6a21\u5f0f \u5fae\u6838\u6a21\u5f0f \u5e38\u7528\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f \u00b6 \u7ba1\u9053/\u8fc7\u6ee4\u5668 \u57fa\u4e8e\u4e8b\u4ef6\u7684\u9690\u5f0f\u8c03\u7528 \u5206\u5c42\u98ce\u683c \u6570\u636e\u62bd\u8c61\u548c\u9762\u5411\u5bf9\u8c61 \u4ed3\u5e93\u4e0e\u9ed1\u677f\u6a21\u5f0f \u89e3\u91ca\u5668 \u4ee3\u7406\u6a21\u5f0f \u5fae\u6838 \u5ba2\u6237/\u670d\u52a1\u5668 \u6b63\u4ea4\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 C2 \u5f02\u6784\u7ed3\u6784 \u53cd\u5c04 \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\uff08PAC\uff09 \u6a21\u5f0f\u7cfb\u7edf\u4e0e\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c \u00b6 \u82e5\u5e72\u5b9a\u4e49 \u00b6 \u6a21\u5f0f\u7cfb\u7edf \uff1a\u5c06\u4e00\u4e2a\u4e2a\u5355\u72ec\u7684\u6a21\u5f0f\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u63cf\u8ff0\u4e86\u6a21\u5f0f\u4e4b\u95f4\u7684\u5173\u7cfb\u3001\u6a21\u5f0f\u7684\u5b9e\u73b0\uff0c\u4ee5\u53ca\u6a21\u5f0f\u600e\u6837\u76f8\u4e92\u8054\u7cfb\u76f8\u4e92\u8865\u5145\u6765\u6709\u6548\u652f\u6301\u8f6f\u4ef6\u5f00\u53d1\u7684\u3002 \u6a21\u5f0f\u8bed\u8a00 \uff1a\u7531\u7ed3\u6784\u548c\u89c4\u5219\u6784\u6210\u3002\u7ed3\u6784\u63cf\u8ff0\u4e86\u6a21\u5f0f\u662f\u66f4\u5c0f\u6a21\u5f0f\u7684\u6a21\u5f0f;\u89c4\u5219\u63cf\u8ff0\u4e86\u521b\u5efa\u6a21\u5f0f\u7684\u65b9\u5f0f\u548c\u4e0e\u5176\u4ed6\u6a21\u5f0f\u7684\u6392\u5217\u65b9\u5f0f\u3002 SA \u6a21\u5f0f\u7cfb\u7edf \uff1a\u662f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u6c47\u96c6\uff0c\u5305\u62ec\u6a21\u5f0f\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u5b9e\u73b0\u3001\u7ec4\u5408\u548c\u4f7f\u7528\u6307\u5357\u3002 \u6a21\u5f0f\u7cfb\u7edf\u7684\u6f14\u5316 \uff1a\u5305\u62ec\u6a21\u5f0f\u63cf\u8ff0\u7684\u6f14\u5316\u3001\u6a21\u5f0f\u7684\u91c7\u6398\u3001\u65b0\u6a21\u5f0f\u7684\u96c6\u6210\u548c\u5220\u9664\u8fc7\u65f6\u7684\u6a21\u5f0f\u7b49\u3002 \u6a21\u5f0f\u7cfb\u7edf\u5bf9\u8f6f\u4ef6\u5f00\u53d1\u7684\u652f\u6301\u6761\u4ef6 \u00b6 \u5305\u542b\u8db3\u591f\u591a\u7684\u57fa\u672c\u6a21\u5f0f \u6240\u6709\u7684\u6a21\u5f0f\u5e94\u8be5\u6709\u7edf\u4e00\u7684\u63cf\u8ff0\u5f62\u5f0f \u5177\u6709\u5bf9\u6a21\u5f0f\u5982\u4f55\u7ec4\u7ec7\u7684\u6a21\u5f0f \u652f\u6301\u8f6f\u4ef6\u6784\u9020\u7684\u65b9\u6cd5 \u652f\u6301\u6a21\u5f0f\u7cfb\u7edf\u7684\u81ea\u6211\u70df\u82b1 \u6a21\u5f0f\u7cfb\u7edf\u7684\u5168\u5c40\u5206\u7c7b\u89c6\u56fe \u00b6 \u9762\u5411\u95ee\u9898\u7684\u6a21\u5f0f\u9009\u62e9\u6b65\u9aa4 \u00b6 \u6307\u5b9a\u548c\u7cbe\u786e\u5730\u63cf\u8ff0\u95ee\u9898 \u9488\u5bf9\u95ee\u9898\u7684\u89c4\u6a21\uff0c\u9009\u62e9\u201c\u6a21\u5f0f\u7c7b\u522b\u201d\uff08\u4e0d\u662f\u6309\u95ee\u9898\u7c7b\u522b\u9009\u53d6\uff09 \u5bf9\u95ee\u9898\u8fdb\u884c\u5206\u7c7b\uff0c\u521d\u6b65\u9009\u53d6\u89e3\u51b3\u95ee\u9898\u7684\u6a21\u5f0f\u548c\u53ef\u9009\u6a21\u5f0f \u5bf9\u95ee\u9898\u7684\u5206\u7c7b\u548c\u76f8\u5e94\u7684\u89e3\u51b3\u6a21\u5f0f\u8fdb\u884c\u6bd4\u8f83\uff08\u4f18\u7f3a\u70b9\uff09 \u8fdb\u4e00\u6b65\u9009\u53d6\u66f4\u5408\u9002\u7684\u89e3\u51b3\u65b9\u6848\u7684\u53d8\u4f53 \u5982\u679c\u53d1\u73b0\u95ee\u9898\u96be\u4ee5\u89e3\u51b3\uff0c\u5219\u91cd\u65b0\u8fdb\u884c\u95ee\u9898\u5206\u7c7b\uff0c\u8f6c\u81f3 3 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u7684\u6bd4\u8f83 \u00b6 \u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4e3b\u8981\u63cf\u8ff0\u5e94\u7528\u7cfb\u7edf\u7684,\u603b\u4f53\u7ed3\u6784\u6846\u67b6\u3002\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u53ef\u5b58\u5728\u4e8e\u5404\u79cd\u5e94\u7528\u7cfb\u7edf\u89c4\u6a21\u548c\u62bd\u8c61\u5c42\u6b21\u4e0a\uff0c\u4ece\u5b9a\u4e49\u5e94\u7528\u7cfb\u7edf\u7684\u603b\u4f53\u7ed3\u6784\u5230\u63cf\u8ff0\u600e\u6837\u7528\u7ed9\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u7279\u5b9a\u95ee\u9898\u7684\u60ef\u7528\u6cd5\u6a21\u5f0f\u3002 \u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u76f8\u5bf9\u72ec\u7acb\u3002\u5404\u5e94\u7528\u7cfb\u7edf\u91c7\u7528\u4e0d\u540c\u7684\u98ce\u683c\u540e\uff0c\u4e0e\u7531\u5176\u4ed6\u98ce\u683c\u6784\u6210\u7684\u7cfb\u7edf\u8054\u7cfb\u8f83\u5c11\u3002\u800c\u6a21\u5f0f\u5f80\u5f80\u4f9d\u8d56\u4e8e\u5b83\u6240\u5305\u542b\u7684\u8f83\u5c0f\u7684\u6a21\u5f0f\u6216\u8005\u4e0e\u5b83\u76f8\u4e92\u4f5c\u7528\u7684\u6a21\u5f0f\u3002 \u6a21\u5f0f\u6bd4\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u66f4\u52a0\u9762\u5411\u95ee\u9898\u3002\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4fa7\u91cd\u4e8e\u4ece\u5e94\u7528\u7cfb\u7edf\u4e2d\u62bd\u53d6\u51fa\u5b83\u4eec\u7684\u603b\u4f53\u7ec4\u7ec7\u7ed3\u6784\uff0c\u800c\u8f83\u5c11\u4ece\u5b9e\u9645\u8bbe\u8ba1\u73af\u5883\u6c34\u8003\u611f\u8bbe\u8ba1\u7684\u6280\u672f\u3002\u800c\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u901a\u5e38\u7531\u95ee\u9898\u51fa\u73b0\u7684\u8bed\u5883\u3001\u89e3\u51b3\u65b9\u6848\u548c\u9002\u7528\u573a\u666f\u7ec4\u6210\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784"},{"location":"cs/software/sca/#_1","text":"\u7ea6 5144 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 17 \u5206\u949f Abstract \u8fd9\u91cc\u8bb0\u5f55\u5b66\u4e60\u8fd9\u672c\u4e66\u65f6\u7684\u7b14\u8bb0\uff08\u540c\u65f6\u662f\u7814\u4e00\u7684\u5b66\u4f4d\u8bfe\uff09 \u4f5c\u8005\u662f\u6211\u7684\u5bfc\u5e08\u738b\u6620\u8f89\u6559\u6388","title":"\u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784"},{"location":"cs/software/sca/#_2","text":"","title":"\u8f6f\u4ef6\u590d\u7528"},{"location":"cs/software/sca/#_3","text":"\u8f6f\u4ef6\u590d\u7528\u662f\u6307\u5728\u4e24\u6b21\u6216\u591a\u6b21\u4e0d\u540c\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u91cd\u590d\u4f7f\u7528\u76f8\u540c\u7684\u6216\u76f8\u8fd1\u7684\u8f6f\u4ef6\u5143\u7d20\u7684\u8fc7\u7a0b\u3002\u5f15\u51fa\u4e86 \u6784\u4ef6 \u7684\u6982\u5ff5\u3002 \u8f6f\u4ef6\u590d\u7528\u53ef\u5212\u5206\u4e3a\u5982\u4e0b\u51e0\u7c7b\uff1a \u4ee3\u7801\u7684\u590d\u7528 \u8bbe\u8ba1\u7684\u590d\u7528 \u5206\u6790\u7684\u590d\u7528 \u6d4b\u8bd5\u4fe1\u606f\u7684\u590d\u7528","title":"\u8f6f\u4ef6\u590d\u7528\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_4","text":"","title":"\u8f6f\u4ef6\u590d\u7528\u7684\u5b9e\u73b0"},{"location":"cs/software/sca/#_5","text":"\u5de5\u7a0b\u65b9\u9762 \u7f3a\u5c11\u80fd\u591f\u6e05\u6670\u6807\u8bc6\u53ef\u590d\u7528\u6a21\u578b\u8981\u7d20\u7684\u624b\u6bb5\u3002 \u7f3a\u5c11\u80fd\u591f\u590d\u7528\u7684\u6784\u4ef6\u3002 \u53ef\u590d\u7528\u7684\u6784\u4ef6\u7f3a\u4e4f\u7075\u6d3b\u6027\u3002 \u7f3a\u4e4f\u6267\u884c\u590d\u7528\u8fc7\u7a0b\u7684\u5de5\u5177\u3002 \u8fc7\u7a0b\u65b9\u9762 \u7ec4\u7ec7\u65b9\u9762 \u8d44\u91d1\u65b9\u9762","title":"\u57fa\u672c\u95ee\u9898"},{"location":"cs/software/sca/#_6","text":"\u590d\u7528\u4f9d\u8d56\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 \u3002\u4f7f\u7528\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6765\u89c4\u5212\u548c\u7ba1\u7406\u5927\u89c4\u6a21\u53ef\u590d\u7528\u7cfb\u7edf\u7684\u590d\u6742\u6027\u662f\u6700\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\u3002","title":"\u5173\u952e\u56e0\u7d20"},{"location":"cs/software/sca/#_7","text":"\u6784\u4ef6\u662f\u5177\u6709\u4e00\u5b9a\u529f\u80fd\u3001\u80fd\u591f\u72ec\u7acb\u5de5\u4f5c\u6216\u540c\u5176\u4ed6\u6784\u4ef6\u88c5\u914d\u8d77\u6765\u534f\u8c03\u5de5\u4f5c\u7684\u7a0b\u5e8f\u4f53\uff0c\u6784\u4ef6\u7684\u4f7f\u7528\u540c\u5b83\u7684\u5f00\u53d1\u3001\u751f\u4ea7\u65e0\u5173\u3002\u6574\u4e2a\u6784\u4ef6\u9690\u85cf\u4e86\u5177\u4f53\u7684\u5b9e\u73b0\uff0c\u53ea\u7528\u63a5\u53e3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002 \u4ece\u5916\u90e8\u5f62\u6001\u770b\uff1a \u72ec\u7acb\u800c\u6210\u719f\u7684\u6784\u4ef6 \u6709\u9650\u5236\u7684\u6784\u4ef6 \u9002\u7528\u6027\u6784\u4ef6 \u88c5\u914d\u7684\u6784\u4ef6 \u53ef\u4fee\u6539\u7684\u6784\u4ef6","title":"\u8f6f\u4ef6\u590d\u7528\u4e0e\u6784\u4ef6\u6280\u672f"},{"location":"cs/software/sca/#_8","text":"","title":"\u6784\u4ef6\u6280\u672f"},{"location":"cs/software/sca/#_9","text":"\u6280\u672f\u4e0e\u9700\u6c42\u53d8\u5316\u7684\u95ee\u9898\u3002 \u91cd\u590d\u4e0d\u5fc5\u8981\u7684\u5de5\u4f5c\u95ee\u9898\u3002 \u5e94\u7528\u96c6\u6210\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u96be\u4ee5\u7ef4\u62a4\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u8d28\u91cf\u548c\u6210\u672c\u6709\u6548\u6027\u95ee\u9898\u7b49\u3002 \u6784\u4ef6\u6280\u672f\u662f\u76ee\u524d\u652f\u6301\u8f6f\u4ef6\u590d\u7528\u7684\u6838\u5fc3\u6280\u672f\u3002\u7814\u7a76\u5185\u5bb9\u5305\u62ec\uff1a \u6784\u4ef6\u83b7\u53d6\uff1a\u6709\u76ee\u7684\u7684\u6784\u4ef6\u751f\u4ea7\u548c\u4ece\u5df2\u6709\u7cfb\u7edf\u4e2d\u6316\u6398\u63d0\u53d6\u6784\u4ef6\u3002 \u7814\u7a76\u6a21\u578b\uff1a\u7814\u7a76\u6784\u4ef6\u7684\u672c\u8d28\u7279\u5f81\u548c\u6784\u4ef6\u95f4\u7684\u5173\u7cfb\u3002 \u6784\u4ef6\u63cf\u8ff0\u8bed\u8a00\uff1a\u4ee5\u6784\u4ef6\u6a21\u578b\u4e3a\u57fa\u7840\uff0c\u89e3\u51b3\u6784\u4ef6\u7684\u7cbe\u786e\u63cf\u8ff0\u3001\u7406\u89e3\u3001\u68c0\u7d20\u53ca\u7ec4\u88c5\u95ee\u9898\u3002 \u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff1a\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u53ca\u68c0\u7d20\u7b56\u7565\uff0c\u5efa\u7acb\u6784\u4ef6\u5e93\u7cfb\u7edf\uff0c\u652f\u6301\u6784\u4ef6\u7684\u6709\u6548\u7ba1\u7406\u3002 \u6784\u4ef6\u590d\u5408\u7ec4\u88c5\uff1a\u5728\u6784\u4ef6\u6a21\u578b\u7684\u57fa\u7840\u4e0a\u7814\u7a76\u6784\u4ef6\u7ec4\u88c5\u673a\u5236\uff0c\u5305\u62ec\u6e90\u4ee3\u7801\u7ea7\u7684\u7ec4\u88c5\u548c\u57fa\u4e8e\u6784\u4ef6\u5bf9\u8c61\u4e92\u64cd\u4f5c\u6027\u7684\u7ec4\u88c5\u3002 \u6807\u51c6\u5316\uff1a\u6784\u4ef6\u6a21\u578b\u7684\u6807\u51c6\u5316\u548c\u6784\u4ef6\u5e93\u7cfb\u7edf\u7684\u6807\u51c6\u5316\u7b49\u3002","title":"\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u95ee\u9898"},{"location":"cs/software/sca/#_10","text":"\u8f6f\u4ef6\u6210\u5206\u5305\u62ec\u7a0b\u5e8f\u4ee3\u7801\u3001\u6d4b\u8bd5\u7528\u4f8b\u3001\u8bbe\u8ba1\u6587\u6863\u3001\u8bbe\u8ba1\u8fc7\u7a0b\u3001\u9700\u6c42\u5206\u6790\u6587\u6863\uff0c\u751a\u81f3\u9886\u57df\u77e5\u8bc6\uff0c\u901a\u5e38\u628a\u8fd9\u79cd\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u6210\u5206\u79f0\u4e3a\u8f6f\u4ef6\u6784\u4ef6\uff0c\u7b80\u79f0\u8f6f\u6784\u4ef6\u6216\u8005\u6784\u4ef6\u3002\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u5143\u7d20\u8d8a\u5927\uff0c\u6211\u4eec\u5c31\u8bf4\u590d\u7528\u7684\u7c92\u5ea6(Granularity)\u8d8a\u5927\u3002 \u6784\u4ef6\u662f\u9884\u5148\u6784\u5efa\u7684\u3002 \u6784\u4ef6\u662f\u9ed1\u76d2\u7684\u3002 \u6784\u4ef6\u662f\u53ef\u5206\u79bb\u7684\u3002 \u6784\u4ef6\u80fd\u7528\u4e8e\u7ec4\u88c5\u548c\u90e8\u7f72\u3002 \u6784\u4ef6\u9700\u8981\u79f0\u4e3a\u6784\u4ef6\u5bb9\u5668\u6280\u672f\u7684\u652f\u6301\u3002 \u4e00\u4e2a\u5b8c\u6574\u7684\u6784\u4ef6\u5e94\u5305\u542b6\u4e2a\u8981\u7d20\uff1a \u53d7\u7ea6\u675f\u7684\u6784\u4ef6\u6807\u51c6\uff1a\u7b26\u5408\u67d0\u79cd\u6784\u4ef6\u6a21\u578b\u3002 \u89c4\u683c\u8bf4\u660e\uff1a\u6784\u4ef6\u63d0\u4f9b\u670d\u52a1\u7684\u62bd\u8c61\u63cf\u8ff0\uff0c\u7528\u4f5c\u670d\u52a1\u7684\u5ba2\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\u3002 \u5b9e\u73b0\uff1a\u5fc5\u987b\u7b26\u5408\u89c4\u683c\u8bf4\u660e\uff0c\u5404\u81ea\u5b9e\u73b0\u3002 \u5305\u88c5\u65b9\u6cd5\uff1a\u6309\u4e0d\u540c\u7684\u65b9\u5f0f\u5206\u7ec4\u6765\u63d0\u4f9b \u4e00\u5957\u53ef\u4ee5\u66ff\u6362\u7684\u670d\u52a1(\u5305)\u3002 \u6ce8\u518c\uff1a\u53ef\u5728\u6784\u4ef6\u652f\u6301\u73af\u5883\u4e2d\u6ce8\u518c\u3002 \u90e8\u7f72\u65b9\u6cd5\uff1a\u6784\u4ef6\u53ef\u4ee5\u90e8\u7f72\u591a\u4e2a\u5b9e\u4f8b\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_11","text":"\u6784\u4ef6\u7684\u540d\u79f0\u4e0e\u7b80\u77ed\u63cf\u8ff0\u3002 \u6784\u4ef6\u670d\u52a1\u3002 \u6784\u4ef6\u63a5\u53e3\u4fe1\u606f\u3002 \u6240\u9700\u7684\u63a5\u53e3\u3002 \u53d1\u5e03\u548c\u63a5\u53d7\u7684\u4e8b\u4ef6\u3002 \u6784\u4ef6\u7279\u5f81\u3002 \u9644\u52a0\u4fe1\u606f\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e"},{"location":"cs/software/sca/#_12","text":"\u6784\u4ef6\u5fc5\u9886\u5bf9\u5176\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u8fdb\u884c\u62bd\u8c61\u63cf\u8ff0\uff0c\u4ee5\u4f5c\u4e3a\u670d\u52a1\u7684\u5bb9\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\uff0c\u8fd9\u5c31\u662f\u6784\u4ef6\u63a5\u53e3\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u63a5\u53e3"},{"location":"cs/software/sca/#_13","text":"","title":"\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b"},{"location":"cs/software/sca/#_14","text":"\u6784\u4ef6\u6a21\u578b\u5b9a\u4e49\u4e86\u4ec0\u4e48\u662f\u6784\u4ef6\u3001\u6784\u4ef6\u7684\u4f9d\u636e\u3001\u5982\u4f55\u4f7f\u7528\u5176\u4ed6\u6784\u4ef6\u63d0\u4f9b\u7684\u670d\u52a1\u7b49\u3002\u5c07\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u5177\u4f53\u5b9e\u73b0\u5206\u79bb\uff0c\u4f9d\u9760\u6784\u4ef6\u5b9e\u73b0\u7684\u5177\u4f53\u6a21\u5f0f\u6765\u63a8\u5bfc\u51fa\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\uff0c\u53ef\u4ee5\u6784\u9020\u4e00\u4e2a\u6784\u4ef6\u6a21\u578b\u3002 \u4f7f\u7528\u4e2d\u95f4\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u6784\u4ef6\u4e4b\u95f4\u8fdb\u884c\u66f4\u597d\u5730\u901a\u4fe1\u3002\u5982\u6784\u4ef6\u4e4b\u95f4\u76f4\u63a5\u8fdb\u884c\u901a\u4fe1\uff0c\u5f53\u6784\u6210\u7cfb\u7edf\u7684\u6784\u4ef6\u6570\u91cf\u5e9e\u5927\u65f6\uff0c\u5176\u590d\u6742\u7a0b\u5ea6\u8fc5\u901f\u63d0\u9ad8\uff1b\u5982\u80fd\u5f15\u4eba\u4e2d\u4ecb\u5c42 (\u4e2d\u95f4\u4ef6)\uff0c\u5219\u53ef\u5f88\u597d\u5730\u907f\u514d\u6784\u4ef6\u95f4\u590d\u6742\u7684\u4ea4\u4e92\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a","title":"\u6784\u4ef6\u6a21\u578b\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_15","text":"\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b\u56fd\u5185\u8bb8\u591a\u5b66\u8005\u5728\u6784\u4ef6\u6a21\u578b\u7684\u7814\u7a76\u65b9\u9762\u505a\u4e86\u4e0d\u5c11\u7684\u5de5\u4f5c\uff0c\u5176\u4e2d\u8f83\u4e3a\u7a81\u51fa\u7684\u662f\u5317\u4eac\u5927\u5b66\u6768\u8299\u6e05\u9662\u58eb\u7b49\u4eba\u63d0\u51fa\u7684\u201c\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b(JBCOM)\u201d\u3002\u5b83\u7531\u5916\u90e8\u63a5\u53c8\u4e0e\u5185\u90e8\u7ed3\u6784\u4e24\u90e8\u5206\u7ec4\u6210\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u6784\u4ef6\u7684\u5916\u90e8\u63a5\u53e3\u662f\u6307\u6784\u4ef6\u5411\u5176\u590d\u7528\u8005\u63d0\u4f9b\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5305\u62ec:\u6784\u4ef6\u540d\u79f0\u3001\u529f\u80fd\u63cf\u8ff0\u3001\u5bf9\u5916\u529f\u80fd\u63a5\u53e3\uff0c\u6240\u9700\u670d\u52a1\u7684\u6784\u4ef6\u548c\u53c2\u6570\u5316\u5c5e\u6027\u7b49\u3002\u5916\u90e8\u63a5\u53e3\u662f\u6784\u4ef6\u4e0e\u5916\u754c\u7684\u4e00\u7ec4\u4ea4\u4e92\u70b9\uff0c\u8bf4\u660e\u4e86\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u90a3\u4e9b\u670d\u52a1(\u6d88\u606f\u3001\u64cd\u4f5c\u548c\u53d8\u91cf)\u3002 \u6784\u4ef6\u7684\u5185\u90e8\u7ed3\u6784\u5305\u62ec\u4e24\u65b9\u9762\u7684\u5185\u5bb9:\u5185\u90e8\u6210\u5458\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5176\u4e2d\uff0c\u5185\u90e8\u6210\u5458\u5305\u62ec\u5177\u4f53\u6210\u5458\u4e0e\u865a\u62df\u6210\u5458\uff0c\u800c\u6210\u5458\u5173\u7cfb\u5305\u62ec\u6210\u5458\u4e4b\u95f4\u7684\u4e92\u8054\uff0c\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e0e\u5916\u90e8\u63a5\u53e3\u4e4b\u95f4\u7684\u4e92\u8054\u3002","title":"\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b"},{"location":"cs/software/sca/#_16","text":"\u6784\u4ef6::=\u3008\u6784\u4ef6\u89c4\u7ea6\uff0c\u6784\u4ef6\u5b9e\u73b0\u3009 \u6784\u4ef6\u89c4\u7ea6::=\u3008\u63a5\u53c8\u90e8\u5206\uff0c\u7ed3\u6784\u90e8\u5206\u3009 \u63a5\u53e3\u90e8\u5206::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\uff0c\u670d\u52a1\u96c6\u5408\u3009 \u670d\u52a1::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\u3009 \u7ed3\u6784\u90e8\u5206::=\u3008\u539f\u5b50\u6784\u4ef6\u7ed3\u6784\u3009|\u3008\u590d\u5408\u6784\u4ef6\u7ed3\u6784\u3009 \u539f\u5b50\u6784\u4ef6\u7ed3\u6784::=\u3008\u6784\u4ef6\u5b9e\u73b0\u7684\u5f15\u7528\u3009 \u590d\u5408\u6784\u4ef6\u7ed3\u6784::=\u3008\u5f15\u7528\u7684\u6784\u4ef6\u7c7b\u578b\uff0c\u5b9e\u4f8b\u58f0\u660e\uff0c\u5b9e\u4f8b\u8fde\u63a5\uff0c\u6620\u5c04\u3009 eg. \u7f16\u8bd1\u5668\u590d\u5408\u6784\u4ef6\u5b9e\u4f8b\u3002","title":"\u6784\u4ef6\u6a21\u578b\u7684\u63cf\u8ff0\u65b9\u6cd5"},{"location":"cs/software/sca/#_17","text":"\u6784\u4ef6\u7684\u7c92\u5ea6 \u6784\u4ef6\u7684\u57fa\u7840\u8bbe\u65bd \u6784\u4ef6\u7684\u83b7\u53d6 \u6784\u4ef6\u7684\u7ba1\u7406 \u7ec4\u88c5\u4e0e\u90e8\u7f72","title":"\u8f6f\u4ef6\u6784\u4ef6\u7684\u6df1\u5c42\u7406\u89e3"},{"location":"cs/software/sca/#_18","text":"","title":"\u9762\u5411\u6784\u4ef6"},{"location":"cs/software/sca/#_19","text":"\u901a\u8fc7\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u5b9e\u73b0\uff0c\u6765\u5f97\u5230\u6240\u9700\u7684\u6784\u4ef6","title":"\u9762\u5411\u6784\u4ef6\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_20","text":"\u6839\u636e\u8f6f\u4ef6 3 \u5c42\u6846\u67b6\u7684\u6784\u4ef6\u5206\u7c7b \u8868\u793a\u5c42 \u4e1a\u52a1\u5c42 \u6570\u636e\u5c42 \u636e\u6b64\u6846\u67b6\uff0c\u6784\u4ef6\u53ef\u4ee5\u88ab\u5206\u4e3a 3 \u7c7b\uff1a\u5e94\u7528\u8f6f\u4ef6\u3001\u4e1a\u52a1\u6784\u4ef6\u548c\u6570\u636e\u6784\u4ef6 \u4e1a\u52a1\u6784\u4ef6\u7684\u83b7\u53d6\u60c5\u51b5 \u5b9a\u4e49\u4e1a\u52a1\u5bf9\u8c61 \u786e\u5b9a\u63a7\u5236\u903b\u8f91\uff08\u4e1a\u52a1\u8fc7\u7a0b\uff09 \u786e\u5b9a\u4e1a\u52a1\u5bf9\u8c61\u4e0e\u63a7\u5236\u903b\u8f91\u4e4b\u95f4\u7684\u4ea4\u4e92 \u533a\u5206\u516c\u53f8\u7684\u4e1a\u52a1\u903b\u8f91\u548c\u7279\u5b9a\u90e8\u95e8\u7684\u4e1a\u52a1\u903b\u8f91 \u5c06\u4e1a\u52a1\u5bf9\u8c61\u548c\u63a7\u5236\u903b\u8f91\u5206\u914d\u5230\u76f8\u5e94\u7684\u4e1a\u52a1\u6784\u4ef6\u4e2d\u53bb \u57fa\u4e8e\u6784\u4ef6\u7c92\u5ea6\u5927\u5c0f\u7684\u6784\u4ef6\u5206\u7c7b \u53ef\u5206\u4e3a\uff1a\u5927\u7c92\u5ea6\u7684\u5e94\u7528\u6784\u4ef6\u3001\u7528\u6237\u4efb\u52a1\u6784\u4ef6\u3001\u6279\u5904\u7406\u6784\u4ef6\u548c\u5b50\u4efb\u52a1\u6784\u4ef6","title":"\u6784\u4ef6\u7684\u5206\u7c7b"},{"location":"cs/software/sca/#_21","text":"","title":"\u6784\u4ef6\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0"},{"location":"cs/software/sca/#_22","text":"\u6784\u4ef6\u63a5\u53e3\u7684\u5b9a\u4e49\u7684\u57fa\u672c\u539f\u5219\uff1a \u5b9a\u4e49\u4e00\u4e9b\u4e0d\u53d8\u7684\u63a5\u53e3 \u5b9a\u4e49\u81ea\u63cf\u8ff0\u7684\u63a5\u53e3 \u5b9a\u4e49\u5143\u6570\u636e\u6027\u8d28\u7684\u63a5\u53e3 \u6784\u4ef6\u8bbe\u8ba1\u6210\u53ef\u5b9a\u5236\u7684","title":"\u6784\u4ef6\u63a5\u53e3\u5b9a\u4e49\u7684\u539f\u5219"},{"location":"cs/software/sca/#_23","text":"\u539f\u5b50\u6784\u4ef6 Atom \u662f\u6700\u5c0f\u7c92\u5ea6\u7684\u6784\u4ef6\uff0c\u8be5\u6784\u4ef6\u5728\u529f\u80fd\u7b49\u65b9\u9762\u5177\u6709\u4e0d\u53ef\u518d\u62c6\u5206\u7684\u6027\u8d28\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u7684\u5b9e\u4f53\u5bf9\u5e94\u5355\u4e2a\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u79f0\u8fd9\u4e2a\u6784\u4ef6\u662f\u5355\u5bf9\u8c61\u6784\u4ef6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u63a5\u53e3\u89c4\u7ea6\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u5bf9\u5e94\u591a\u4e2a\u534f\u4f5c\u5bf9\u8c61\u65f6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u9700\u8981\u5f15\u5165\u4e00\u4e2a\u63a7\u5236\u5bf9\u8c61\u3002 \u5b9a\u4e49\u6784\u4ef6\u63a5\u53e3\u7684\u89c4\u7ea6\u90e8\u5206\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002","title":"\u539f\u5b50\u6784\u4ef6\u7684\u5236\u4f5c"},{"location":"cs/software/sca/#_24","text":"\u590d\u5408\u6784\u4ef6 Assemble \u662f\u7531\u539f\u5b50\u6784\u4ef6\u6216\u8005\u590d\u5408\u6784\u4ef6\u7ec4\u88c5\u800c\u6210\u7684\u3002 \u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u6784\u4ef6\u7684\u63a5\u53e3\u89c4\u7ea6\u90e8\u5206 \u786e\u5b9a\u6240\u5305\u542b\u7684\u6210\u5458\u6784\u4ef6 \u5efa\u7acb\u5185\u90e8\u7684\u6210\u5458\u6784\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u8fde\u63a5\u5173\u7cfb \u5c06\u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u548c\u8981\u6c42\u7684\u529f\u80fd\u6620\u5c04\u5230\u5185\u90e8\u6210\u5458\u6784\u4ef6\u76f8\u5e94\u7684\u529f\u80fd\u4e0a \u5728\u5efa\u7acb\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u8fde\u63a5\u5173\u7cfb\u4ee5\u53ca\u590d\u5408\u6784\u4ef6\u548c\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u6620\u5c04\u65f6\uff0c\u9075\u5faa\u4e00\u4e0b\u89c4\u5219\uff1a \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ea\u80fd\u7531\u4e00\u4e2a\u63d0\u4f9b\u8005\u63d0\u4f9b \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ef\u4ee5\u6709\u591a\u4e2a\u4f7f\u7528\u8005 \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ef\u4ee5\u6620\u5c04\u5230\u591a\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ea\u80fd\u6620\u5c04\u5230\u4e00\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a","title":"\u590d\u5408\u6784\u4ef6\u7684\u5236\u4f5c"},{"location":"cs/software/sca/#_25","text":"\u6784\u4ef6\u5e93\u662f\u5bf9\u6784\u4ef6\u5b9e\u65bd\u5206\u7c7b\u548c\u7ba1\u7406\u7684\u673a\u6784\u3002","title":"\u6784\u4ef6\u7684\u7ba1\u7406\u4e0e\u7ef4\u62a4"},{"location":"cs/software/sca/#_26","text":"\u6784\u4ef6\u5e93\u7406\u8bba\u7814\u7a76\u7684\u91cd\u70b9\u662f\u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff0c\u5373\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u3001\u68c0\u7d22\u624b\u6bb5\u548c\u6784\u4ef6\u76f8\u4f3c\u6027\u5206\u6790\u7b49\u3002 \u9886\u57df\u4e0a\u6784\u4ef6\u5e93\u6ee1\u8db3\u7684\u6761\u4ef6\uff1a \u9886\u57df\u5b8c\u6574\u6027 \u9886\u57df\u62bd\u8c61\u6027 \u9886\u57df\u6807\u51c6\u5316","title":"\u6784\u4ef6\u5e93\u7684\u7ec4\u7ec7"},{"location":"cs/software/sca/#_27","text":"\u5173\u952e\u5b57\u5206\u7c7b\u6cd5 \u8d85\u6587\u672c\u7ec4\u7ec7\u6cd5 \u523b\u9762\u5206\u7c7b\u6cd5 \u7531\u4e00\u7ec4\u63cf\u8ff0\u6784\u4ef6\u672c\u8d28\u7279\u5f81\u7684\u523b\u9762\u7ec4\u6210\uff0c\u6bcf\u4e2a\u523b\u9762\u4ece\u4e0d\u540c\u7684\u89d2\u5ea6\u5bf9\u6784\u4ef6\u8fdb\u884c\u5206\u7c7b\u3002 \u4ece\u8868\u793a\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u523b\u9762\u662f\u4e00\u9897\u6709\u5411\u6811\uff0c\u6839\u8282\u70b9\u7684\u503c\u662f\u8be5\u523b\u9762\u7684\u540d\u79f0\uff0c\u6839\u8282\u70b9\u6240\u6709\u5b50\u6811\u6784\u6210\u7684\u68ee\u6797\u79f0\u4e3a\u672f\u8bed\u7a7a\u95f4 \u7279\u70b9\uff1a \u5bf9\u6784\u4ef6\u8fdb\u884c\u4e86\u591a\u89c6\u89d2\u4e0b\u7684\u5206\u7c7b\u63cf\u8ff0 \u6784\u4ef6\u5206\u7c7b\u63cf\u8ff0\u7684\u672f\u8bed\u7a7a\u95f4\u6613\u4e8e\u4fee\u6539\u548c\u7ef4\u62a4","title":"\u6784\u4ef6\u5e93\u7684\u5206\u7c7b\u6a21\u5f0f"},{"location":"cs/software/sca/#_28","text":"","title":"\u57fa\u4e8e\u6784\u4ef6"},{"location":"cs/software/sca/#_29","text":"\u6784\u4ef6\u7ec4\u88c5\u5c31\u662f\u786e\u5b9a\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u4e0e\u63a5\u53e3\u4e4b\u95f4\u7684\u5339\u914d\u548c\u6620\u5c04\uff0c\u5e76\u63d0\u4f9b\u6ee1\u8db3\u5373\u5c06\u6216\u5c06\u6765\u90e8\u7f72\u7684\u7ea6\u675f\u6761\u4ef6\u3002","title":"\u6784\u4ef6\u7ec4\u88c5"},{"location":"cs/software/sca/#_30","text":"\u4efb\u4f55\u57fa\u4e8e\u6784\u4ef6\u7684\u5f00\u53d1\u5e94\u7b26\u5408\u4ee5\u4e0b\u6784\u4ef6\uff1a \u8981\u6e05\u6670\u5730\u5206\u79bb\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u8bbe\u8ba1\u5b9e\u73b0 \u91cd\u70b9\u5173\u6ce8\u4e8e\u63a5\u53e3\u7684\u5b9e\u73b0\u65b9\u6cd5 \u5f62\u5f0f\u5730\u63cf\u8ff0\u6784\u4ef6\u7684\u8bed\u4e49\uff0c\u4e3b\u8981\u662f\u5bf9\u6784\u4ef6\u884c\u4e3a\u7684\u63cf\u8ff0\uff0c\u5176\u6838\u5fc3\u662f\u64cd\u4f5c\u7279\u5f81\u7684\u8bed\u4e49\u7ec6\u8282 \u4e25\u683c\u5730\u8bb0\u5f55\u7ec6\u5316\u8fc7\u7a0b\uff0c\u5e76\u4e14\u52a0\u4ee5\u9a8c\u8bc1 \u4ece\u6280\u672f\u89d2\u5ea6\u770b\uff0c\u6784\u4ef6\u7ec4\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8003\u8651\u7684\u95ee\u9898\uff1a \u6bcf\u4e2a\u6784\u4ef6\u6ee1\u8db3\u5176\u4ed6\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6\u95ee\u9898 \u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u63a5\u53e3\u5339\u914d\u548c\u6620\u5c04\u95ee\u9898 \u6784\u4ef6\u7684\u5305\u88c5\u95ee\u9898","title":"\u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u95ee\u9898"},{"location":"cs/software/sca/#_31","text":"\u5b9a\u5236 \u8bbe\u7f6e\u53c2\u6570\u503c \u5b8c\u6210\u9700\u8981\u7528\u6237\u5b9a\u5236\u7684\u4ee3\u7801 \u6709\u65f6\u5019\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u6784\u4ef6 \u5305\u88c5 \u9002\u914d \u9002\u914d\u5668 \u9002\u914d\u5668\u4f4d\u4e8e\u4e24\u4e2a\u6784\u4ef6\u4e4b\u95f4\uff0c\u7528\u4ee5\u8f6c\u6362\u4e24\u4e2a\u6784\u4ef6\u5bf9\u63a5\u53e3\u7684\u4e0d\u540c\u7406\u89e3\uff0c\u662f\u8bf7\u6c42\u8005\u548c\u88ab\u8bf7\u6c42\u8005\u4e4b\u95f4\u7684\u6620\u5c04 \u9002\u914d\u5668\u672c\u8eab\u4e0d\u5305\u542b\u8868\u793a\u5c42\u3001\u4e1a\u52a1\u5c42\u548c\u6570\u636e\u8bbf\u95ee\u5c42\u7684\u903b\u8f91\uff0c\u4e5f\u4e0d\u80fd\u6269\u5c55\u6784\u4ef6\u7684\u529f\u80fd\uff08\u4e0e\u5305\u88c5\u4e0d\u540c\uff09 \u9002\u914d\u5668\u4e0d\u662f\u6784\u4ef6\uff0c\u4e0d\u5c5e\u4e8e\u88ab\u9002\u914d\u7684\u4e24\u4e2a\u6784\u4ef6\u7684\u4efb\u4f55\u4e00\u4e2a\uff0c\u4efb\u4f55\u4e00\u4e2a\u6784\u4ef6\u7684\u4e0d\u5b58\u5728\u5c06\u5bfc\u81f4\u9002\u914d\u5668\u7684\u6d88\u5931 \u9a8c\u8bc1\u548c\u9519\u8bef\u5904\u7406\u529f\u80fd \u5b89\u5168\u6027","title":"\u6784\u4ef6\u7ec4\u88c5\u7684\u65b9\u6cd5\u4e0e\u6280\u672f"},{"location":"cs/software/sca/#_32","text":"\u6784\u4ef6\u7ec4\u88c5\u7684\u5b9e\u65bd\u5185\u5bb9\uff1a \u5f3a\u5236\u5b9e\u73b0\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6 \u5904\u7406\u529f\u80fd\u548c\u6570\u636e\u7684\u4e0d\u5339\u914d \u7ba1\u7406\u6784\u4ef6\u95f4\u7684\u5173\u7cfb \u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u7c7b\u578b\u5305\u62ec\u62e5\u6709\u5173\u7cfb\u548c\u5916\u90e8\u5173\u7cfb\u3002\u4f46\u4ece\u5173\u7cfb\u7684\u8868\u793a\u89d2\u5ea6\u6765\u770b\uff0c\u53ef\u5206\u4e3a\u76f4\u63a5\u94fe\u63a5\u548c\u95f4\u63a5\u94fe\u63a5\u3002","title":"\u6784\u4ef6\u7ec4\u88c5\u7684\u5185\u5bb9"},{"location":"cs/software/sca/#_33","text":"\u63d0\u4f9b\u6784\u4ef6\u8fd0\u884c\u65f6\u7684\u914d\u7f6e\u6570\u636e \u63d0\u4f9b\u90e8\u7f72\u65f6\u7528\u5230\u7684\u6784\u4ef6\u5185\u5efa\u914d\u7f6e\u6216\u5b9a\u5236\u670d\u52a1 \u63d0\u4f9b\u6784\u4ef6\u7ec4\u88c5\u7684\u8f85\u52a9\u73af\u5883","title":"\u6784\u4ef6\u90e8\u7f72"},{"location":"cs/software/sca/#_34","text":"\u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406 SCM \u662f\u6307\u4e00\u5957\u6309\u89c4\u5219\u7ba1\u7406\u8f6f\u4ef6\u5f00\u53d1\u3001\u7ef4\u62a4\uff0c\u4ee5\u53ca\u5176\u4e2d\u5404\u79cd\u4e2d\u95f4\u8f6f\u4ef6\u4ea7\u54c1\u7684\u65b9\u6cd5\u3002 \u914d\u7f6e\u8bc6\u522b \u53d8\u5316\u63a7\u5236 \u72b6\u6001\u8bb0\u5f55\u62a5\u544a \u5ba1\u8ba1","title":"\u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406"},{"location":"cs/software/sca/#_35","text":"","title":"\u9886\u57df\u5de5\u7a0b"},{"location":"cs/software/sca/#_36","text":"\u5e94\u7528\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u7ec4\u7279\u6709\u7684\u9700\u6c42\uff0c\u4ea7\u751f\u4e00\u4e2a\u7279\u5b9a\u7684\u89e3\u51b3\u65b9\u6848 \u9886\u57df\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u4e2a\u9886\u57df\u4e2d\u7684\u6240\u6709\u7cfb\u7edf\uff0c\u800c\u4e0d\u5c40\u9650\u4e8e\u67d0\u4e2a\u7279\u5b9a\u7684\u7cfb\u7edf \u4e0e\u5e94\u7528\u5de5\u7a0b\u76f8\u6bd4 \uff1a\u9886\u57df\u5de5\u7a0b\u5904\u4e8e\u4e00\u4e2a\u8f83\u9ad8\u7684\u62bd\u8c61\u7ea7\u522b\u4e0a","title":"\u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b"},{"location":"cs/software/sca/#_37","text":"\u7ec4\u6210\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u9886\u57df\u5b9e\u73b0 \u53ef\u590d\u7528\u8d44\u4ea7\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u8d44\u4ea7\u83b7\u53d6\u3001\u8d44\u4ea7\u5206\u7c7b\u3001\u8d44\u4ea7\u7ef4\u62a4","title":"\u9886\u57df\u5de5\u7a0b\u7684\u6784\u6210"},{"location":"cs/software/sca/#_38","text":"\u7ec4\u6210\uff1a\u4ea7\u54c1\u7a7a\u95f4\u3001\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\u3001\u751f\u4ea7\u8ba1\u5212\u3001\u9700\u6c42\u3001\u4ea7\u54c1\u3001\u7ba1\u7406","title":"\u5e94\u7528\u5de5\u7a0b\u7684\u6784\u6210"},{"location":"cs/software/sca/#_39","text":"","title":"\u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b\u7684\u5173\u7cfb"},{"location":"cs/software/sca/#_40","text":"\u53d8\u5316\u6027\u7684\u5206\u7c7b \u53d8\u5316\u6027\u7ed1\u5b9a \u53d8\u5316\u6027\u63a7\u5236 \u53d8\u5316\u6027\u5904\u7406\u6280\u672f","title":"\u9886\u57df\u5171\u6027\u4e0e\u53d8\u5316\u6027"},{"location":"cs/software/sca/#_41","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u57fa\u672c\u5185\u5bb9"},{"location":"cs/software/sca/#_42","text":"\u51af \u00b7 \u8bfa\u4f9d\u66fc\u7ed3\u6784 \u57fa\u4e8e\u529f\u80fd\u6a21\u5757\u7684\u8f6f\u4ef6\u7ed3\u6784 \u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_43","text":"Garlan & Shaw \u6a21\u578b\uff1a SA = {Components, Connectors, Constrains} Perry & Wolf \u6a21\u578b\uff1a SA = {Elements, Form, Rational} CFRP \u6a21\u578b\uff1aSA = {Elements, Interfaces, COnnections, Connection Semantics} Vestal \u6a21\u578b\uff1a SA = {Component, Idioms/Styles, Common Patterns of Interaction} IEEE 510\uff1aArchitecture = {Component, Connector, Environment, Principle} Boehm \u6a21\u578b\uff1aSA = {Components, COnnections, Constrains, Stakeholders'needs, Rationals}","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5b9a\u4e49"},{"location":"cs/software/sca/#_44","text":"\u6784\u4ef6 \u8fde\u63a5\u4ef6 \u4f53\u7cfb\u7ed3\u6784\u914d\u7f6e","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6784\u6210\u8981\u7d20"},{"location":"cs/software/sca/#_45","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u7814\u7a76\u5185\u5bb9"},{"location":"cs/software/sca/#adl","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u63cf\u8ff0\u8bed\u8a00 ADL"},{"location":"cs/software/sca/#_46","text":"","title":"\u4f53\u7cfb\u7ed3\u6784\u6784\u9020"},{"location":"cs/software/sca/#_47","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u9a8c\u8bc1"},{"location":"cs/software/sca/#_48","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53d1\u73b0\u3001\u6f14\u5316\u548c\u590d\u7528"},{"location":"cs/software/sca/#_49","text":"","title":"\u57fa\u4e8e\u4f53\u7cfb\u7ed3\u6784\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b"},{"location":"cs/software/sca/#dssa","text":"","title":"\u7279\u5b9a\u9886\u57df\u7684\u4f53\u7cfb\u7ed3\u6784 DSSA"},{"location":"cs/software/sca/#_50","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u652f\u6301\u5de5\u5177"},{"location":"cs/software/sca/#_51","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u6a21\u5f0f\u7cfb\u7edf"},{"location":"cs/software/sca/#_52","text":"","title":"\u6a21\u5f0f\u7684\u6982\u5ff5\u4e0e\u5206\u7c7b"},{"location":"cs/software/sca/#_53","text":"\u6bcf\u4e2a\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u5728\u6211\u4eec\u5468\u56f4\u4e0d\u65ad\u91cd\u590d\u53d1\u751f\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u8be5\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u7684\u6838\u5fc3\u5185\u5bb9\u3002\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u4e00\u6b21\u53c8\u4e00\u6b21\u5730\u4f7f\u7528\u8be5\u65b9\u6848\u800c\u4e0d\u5fc5\u505a\u91cd\u590d\u52b3\u52a8\u3002 \u89e3\u51b3\u7b56\u7565\uff1a\u5c06\u6a21\u578b\u3001\u89c6\u56fe\u3001\u63a7\u5236\u5668\u5212\u5206\u5f00\u3002\u5c31\u662f\u4e00\u4e2a\u5178\u578b\u7684\u6a21\u578b \u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09","title":"\u6a21\u5f0f\u7684\u5b9a\u4e49"},{"location":"cs/software/sca/#_54","text":"\u8bed\u5883\uff1a\u95ee\u9898\u51fa\u73b0\u7684\u80cc\u666f \u95ee\u9898\uff1a\u5728\u8bed\u5883\u4e2d\u91cd\u590d\u51fa\u73b0\u7684\u95ee\u9898 \u89e3\u51b3\u65b9\u6848\uff1a\u7ed9\u51fa\u5982\u4f55\u89e3\u51b3\u518d\u73b0\u7684\u95ee\u9898\uff0c\u6216\u8005\u8bf4\u5982\u4f55\u5e73\u8861\u4e0e\u4e4b\u76f8\u5173\u7684\u5f3a\u5236\u6761\u4ef6 \u5b9e\u73b0\uff1a\u5c31\u662f\u5c06\u4ee5\u4e0a\u7684\u89e3\u51b3\u65b9\u6848\u4ed8\u8bf8\u5b9e\u8df5","title":"\u6a21\u5f0f\u7684\u6784\u6210\u8981\u7d20"},{"location":"cs/software/sca/#_55","text":"\u8bbe\u8ba1\u590d\u7528 \u4ee3\u7801\u590d\u7528 \u7cfb\u7edf\u7ec4\u6210\u66f4\u6613\u4e8e\u88ab\u4ed6\u4eba\u7406\u89e3 \u6709\u5229\u4e8e\u7cfb\u7edf\u7684\u4e92\u64cd\u4f5c\u6027 \u6709\u5229\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790 \u6709\u5229\u4e8e\u7279\u5b9a\u6a21\u5f0f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53ef\u89c6\u5316","title":"\u6a21\u5f0f\u7684\u4f18\u52bf"},{"location":"cs/software/sca/#_56","text":"\u5e95\u5c42\u6a21\u5f0f\uff1a\u60ef\u7528\u6cd5 \u4e2d\u5c42\u6a21\u5f0f\uff1a\u8bbe\u8ba1\u6a21\u5f0f \u9ad8\u5c42\u6a21\u5f0f\uff1a\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f","title":"\u6a21\u5f0f\u5206\u7c7b"},{"location":"cs/software/sca/#_57","text":"\u60ef\u7528\u6cd5\u9488\u5bf9\u8bbe\u8ba1\u548c\u5b9e\u73b0\u65b9\u9762\uff0c\u662f\u9488\u5bf9\u5177\u4f53\u7279\u5b9a\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7684\u4f4e\u5c42\u6a21\u5f0f\uff0c\u5b83\u63cf\u8ff0\u5982\u4f55\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u6216\u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u7279\u70b9 \u60ef\u7528\u6cd5\u662f\u4e0e\u5177\u4f53\u8bed\u8a00\u5bc6\u5207\u76f8\u5173\u7684\u7f16\u7a0b\u7ecf\u9a8c\u7684,\u603b\u7ed3\u3002 \u60ef\u7528\u6cd5\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u53ca\u5176\u5173\u7cfb\u3002 \u60ef\u7528\u6cd5\u4ee3\u8868\u6700\u5e95\u5c42\u7684\u6a21\u5f0f\u3002 \u60ef\u7528\u6cd5\u66f4\u5173\u6ce8\u8bbe\u8ba1\u7684\u5b9e\u73b0\u3002 \u60ef\u7528\u6cd5\u53ef\u80fd\u662f\u4e00\u79cd\u7279\u5b9a\u8bbe\u8ba1\u6a21\u5f0f\u7684\u5177\u4f53\u5b9e\u73b0\u3002 \u76ca\u5904 \u4e00\u7ec4\u76f8\u5173\u7684\u60ef\u7528\u6cd5\u4f1a\u4f7f\u7a0b\u5e8f\u5f62\u6210\u4e00\u81f4\u7684\u98ce\u683c\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u5c06\u52a0\u901f\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u8fdb\u7a0b\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u4f7f\u7a0b\u5e8f\u66f4\u5bb9\u6613\u7406\u89e3\uff0c\u6709\u5229\u4e8e\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u7ef4\u62a4\u3002 \u00b7","title":"\u60ef\u7528\u6cd5"},{"location":"cs/software/sca/#_58","text":"\u4e2d\u7b49\u89c4\u6a21\u7684\u6a21\u5f0f\uff0c\u5728\u89c4\u6a21\u4e0a\u6bd4\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u8981\u5c0f\uff0c\u4f46\u5728\u7ea7\u522b\u4e0a\u6bd4\u7279\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u60ef\u7528\u6cd5\u8981\u9ad8","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/software/sca/#_59","text":"\u7ed3\u6784\u5316\u5206\u89e3\uff1a\u6700\u666e\u904d\u7684\u6a21\u5f0f\u662f\u6574\u4f53 - \u90e8\u5206\u6a21\u5f0f \u5de5\u4f5c\u7684\u7ec4\u7ec7\uff1a\u4e3b\u63a7 - \u4ece\u5c5e\u6a21\u5f0f \u8bbf\u95ee\u63a7\u5236\uff1a\u4ee3\u7406\u8bbe\u8ba1\u6a21\u5f0f\u3001\u5916\u89c2\u6a21\u5f0f\u548c\u8fed\u4ee3\u5668\u6a21\u5f0f \u7ba1\u7406\uff1a\u547d\u4ee4\u5904\u7406\u5668\u6a21\u5f0f\u3001\u89c6\u56fe\u5904\u7406\u7a0b\u5e8f\u6a21\u5f0f \u901a\u4fe1\uff1a\u8f6c\u53d1\u5668 - \u63a5\u6536\u5668\u6a21\u5f0f\u3001\u5ba2\u6237\u673a - \u5206\u914d\u5668 - \u670d\u52a1\u5668\u6a21\u5f0f\u3001\u51fa\u7248\u8005 - \u8ba2\u9605\u8005\u6a21\u5f0f","title":"\u8bbe\u8ba1\u6a21\u5f0f\u95ee\u9898\u7c7b\u522b"},{"location":"cs/software/sca/#_60","text":"","title":"\u8bbe\u8ba1\u6a21\u5f0f\u5206\u7c7b"},{"location":"cs/software/sca/#_61","text":"","title":"\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f"},{"location":"cs/software/sca/#_62","text":"\u4e00\u4e2a\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u7a0b\u5e8f\u5728\u7279\u5b9a\u8bbe\u8ba1\u8bed\u5883\u4e2d\u7684\u7279\u6b8a\u7684\u518d\u73b0\u8bbe\u8ba1\u95ee\u9898\uff0c\u5e76\u4e3a\u5b83\u7684\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ecf\u8fc7\u5145\u5206\u9a8c\u8bc1\u7684\u901a\u7528\u56fe\u5f0f\u3002\u89e3\u51b3\u65b9\u6848\u56fe\u5f0f\u901a\u8fc7\u63cf\u8ff0\u5176\u7ec4\u6210\u6784\u4ef6\u3001\u5b83\u4eec\u7684\u8d23\u4efb\u548c\u76f8\u4e92\u5173\u7cfb\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u534f\u4f5c\u65b9\u5f0f\u6765\u5177\u4f53\u6307\u5b9a\u3002 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u662f\u6a21\u5f0f\u7cfb\u7edf\u4e2d\u7684\u6700\u9ad8\u7b49\u7ea7\u6a21\u5f0f","title":"\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5b9a\u4e49"},{"location":"cs/software/sca/#_63","text":"\u4ece\u6df7\u6c8c\u5230\u7ed3\u6784 \u5206\u5c42\u6a21\u5f0f \u7ba1\u9053/\u8fc7\u6ee4\u5668\u6a21\u5f0f \u9ed1\u677f\u6a21\u5f0f \u5206\u5e03\u5f0f\u7cfb\u7edf \u4ee3\u7406\u6a21\u5f0f \u4ea4\u4e92\u5f0f\u7cfb\u7edf \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\u6a21\u5f0f\uff08PAC\uff09 \u9002\u5e94\u6027\u6a21\u5f0f \u53cd\u5c04\u6a21\u5f0f \u5fae\u6838\u6a21\u5f0f","title":"\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5206\u7c7b"},{"location":"cs/software/sca/#_64","text":"\u7ba1\u9053/\u8fc7\u6ee4\u5668 \u57fa\u4e8e\u4e8b\u4ef6\u7684\u9690\u5f0f\u8c03\u7528 \u5206\u5c42\u98ce\u683c \u6570\u636e\u62bd\u8c61\u548c\u9762\u5411\u5bf9\u8c61 \u4ed3\u5e93\u4e0e\u9ed1\u677f\u6a21\u5f0f \u89e3\u91ca\u5668 \u4ee3\u7406\u6a21\u5f0f \u5fae\u6838 \u5ba2\u6237/\u670d\u52a1\u5668 \u6b63\u4ea4\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 C2 \u5f02\u6784\u7ed3\u6784 \u53cd\u5c04 \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\uff08PAC\uff09","title":"\u5e38\u7528\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f"},{"location":"cs/software/sca/#_65","text":"","title":"\u6a21\u5f0f\u7cfb\u7edf\u4e0e\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c"},{"location":"cs/software/sca/#_66","text":"\u6a21\u5f0f\u7cfb\u7edf \uff1a\u5c06\u4e00\u4e2a\u4e2a\u5355\u72ec\u7684\u6a21\u5f0f\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u63cf\u8ff0\u4e86\u6a21\u5f0f\u4e4b\u95f4\u7684\u5173\u7cfb\u3001\u6a21\u5f0f\u7684\u5b9e\u73b0\uff0c\u4ee5\u53ca\u6a21\u5f0f\u600e\u6837\u76f8\u4e92\u8054\u7cfb\u76f8\u4e92\u8865\u5145\u6765\u6709\u6548\u652f\u6301\u8f6f\u4ef6\u5f00\u53d1\u7684\u3002 \u6a21\u5f0f\u8bed\u8a00 \uff1a\u7531\u7ed3\u6784\u548c\u89c4\u5219\u6784\u6210\u3002\u7ed3\u6784\u63cf\u8ff0\u4e86\u6a21\u5f0f\u662f\u66f4\u5c0f\u6a21\u5f0f\u7684\u6a21\u5f0f;\u89c4\u5219\u63cf\u8ff0\u4e86\u521b\u5efa\u6a21\u5f0f\u7684\u65b9\u5f0f\u548c\u4e0e\u5176\u4ed6\u6a21\u5f0f\u7684\u6392\u5217\u65b9\u5f0f\u3002 SA \u6a21\u5f0f\u7cfb\u7edf \uff1a\u662f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u6c47\u96c6\uff0c\u5305\u62ec\u6a21\u5f0f\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u5b9e\u73b0\u3001\u7ec4\u5408\u548c\u4f7f\u7528\u6307\u5357\u3002 \u6a21\u5f0f\u7cfb\u7edf\u7684\u6f14\u5316 \uff1a\u5305\u62ec\u6a21\u5f0f\u63cf\u8ff0\u7684\u6f14\u5316\u3001\u6a21\u5f0f\u7684\u91c7\u6398\u3001\u65b0\u6a21\u5f0f\u7684\u96c6\u6210\u548c\u5220\u9664\u8fc7\u65f6\u7684\u6a21\u5f0f\u7b49\u3002","title":"\u82e5\u5e72\u5b9a\u4e49"},{"location":"cs/software/sca/#_67","text":"\u5305\u542b\u8db3\u591f\u591a\u7684\u57fa\u672c\u6a21\u5f0f \u6240\u6709\u7684\u6a21\u5f0f\u5e94\u8be5\u6709\u7edf\u4e00\u7684\u63cf\u8ff0\u5f62\u5f0f \u5177\u6709\u5bf9\u6a21\u5f0f\u5982\u4f55\u7ec4\u7ec7\u7684\u6a21\u5f0f \u652f\u6301\u8f6f\u4ef6\u6784\u9020\u7684\u65b9\u6cd5 \u652f\u6301\u6a21\u5f0f\u7cfb\u7edf\u7684\u81ea\u6211\u70df\u82b1","title":"\u6a21\u5f0f\u7cfb\u7edf\u5bf9\u8f6f\u4ef6\u5f00\u53d1\u7684\u652f\u6301\u6761\u4ef6"},{"location":"cs/software/sca/#_68","text":"","title":"\u6a21\u5f0f\u7cfb\u7edf\u7684\u5168\u5c40\u5206\u7c7b\u89c6\u56fe"},{"location":"cs/software/sca/#_69","text":"\u6307\u5b9a\u548c\u7cbe\u786e\u5730\u63cf\u8ff0\u95ee\u9898 \u9488\u5bf9\u95ee\u9898\u7684\u89c4\u6a21\uff0c\u9009\u62e9\u201c\u6a21\u5f0f\u7c7b\u522b\u201d\uff08\u4e0d\u662f\u6309\u95ee\u9898\u7c7b\u522b\u9009\u53d6\uff09 \u5bf9\u95ee\u9898\u8fdb\u884c\u5206\u7c7b\uff0c\u521d\u6b65\u9009\u53d6\u89e3\u51b3\u95ee\u9898\u7684\u6a21\u5f0f\u548c\u53ef\u9009\u6a21\u5f0f \u5bf9\u95ee\u9898\u7684\u5206\u7c7b\u548c\u76f8\u5e94\u7684\u89e3\u51b3\u6a21\u5f0f\u8fdb\u884c\u6bd4\u8f83\uff08\u4f18\u7f3a\u70b9\uff09 \u8fdb\u4e00\u6b65\u9009\u53d6\u66f4\u5408\u9002\u7684\u89e3\u51b3\u65b9\u6848\u7684\u53d8\u4f53 \u5982\u679c\u53d1\u73b0\u95ee\u9898\u96be\u4ee5\u89e3\u51b3\uff0c\u5219\u91cd\u65b0\u8fdb\u884c\u95ee\u9898\u5206\u7c7b\uff0c\u8f6c\u81f3 3","title":"\u9762\u5411\u95ee\u9898\u7684\u6a21\u5f0f\u9009\u62e9\u6b65\u9aa4"},{"location":"cs/software/sca/#_70","text":"\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4e3b\u8981\u63cf\u8ff0\u5e94\u7528\u7cfb\u7edf\u7684,\u603b\u4f53\u7ed3\u6784\u6846\u67b6\u3002\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u53ef\u5b58\u5728\u4e8e\u5404\u79cd\u5e94\u7528\u7cfb\u7edf\u89c4\u6a21\u548c\u62bd\u8c61\u5c42\u6b21\u4e0a\uff0c\u4ece\u5b9a\u4e49\u5e94\u7528\u7cfb\u7edf\u7684\u603b\u4f53\u7ed3\u6784\u5230\u63cf\u8ff0\u600e\u6837\u7528\u7ed9\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u7279\u5b9a\u95ee\u9898\u7684\u60ef\u7528\u6cd5\u6a21\u5f0f\u3002 \u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u76f8\u5bf9\u72ec\u7acb\u3002\u5404\u5e94\u7528\u7cfb\u7edf\u91c7\u7528\u4e0d\u540c\u7684\u98ce\u683c\u540e\uff0c\u4e0e\u7531\u5176\u4ed6\u98ce\u683c\u6784\u6210\u7684\u7cfb\u7edf\u8054\u7cfb\u8f83\u5c11\u3002\u800c\u6a21\u5f0f\u5f80\u5f80\u4f9d\u8d56\u4e8e\u5b83\u6240\u5305\u542b\u7684\u8f83\u5c0f\u7684\u6a21\u5f0f\u6216\u8005\u4e0e\u5b83\u76f8\u4e92\u4f5c\u7528\u7684\u6a21\u5f0f\u3002 \u6a21\u5f0f\u6bd4\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u66f4\u52a0\u9762\u5411\u95ee\u9898\u3002\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4fa7\u91cd\u4e8e\u4ece\u5e94\u7528\u7cfb\u7edf\u4e2d\u62bd\u53d6\u51fa\u5b83\u4eec\u7684\u603b\u4f53\u7ec4\u7ec7\u7ed3\u6784\uff0c\u800c\u8f83\u5c11\u4ece\u5b9e\u9645\u8bbe\u8ba1\u73af\u5883\u6c34\u8003\u611f\u8bbe\u8ba1\u7684\u6280\u672f\u3002\u800c\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u901a\u5e38\u7531\u95ee\u9898\u51fa\u73b0\u7684\u8bed\u5883\u3001\u89e3\u51b3\u65b9\u6848\u548c\u9002\u7528\u573a\u666f\u7ec4\u6210\u3002","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u7684\u6bd4\u8f83"},{"location":"cv/","text":"\u8ba1\u7b97\u673a\u89c6\u89c9 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u8ba1\u7b97\u673a\u89c6\u89c9\uff08SLAM\u3001SfM\u3001\u63ba\u70b9\u673a\u5668\u4eba\uff0c\u4f8b\u5982 ROS\uff09\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5927\u591a\u90fd\u662f\u81ea\u5b66\uff0c\u7406\u89e3 CV\uff08\u6570\u5b66\uff09 \u7684\u672c\u8d28\uff08\u96fe Table of Contents \u00b6 \u591a\u89c6\u56fe\u51e0\u4f55 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 2129 7 mins 1696560509 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2758 9 mins 1696560259 \u5355\u89c6\u56fe\u51e0\u4f55 3229 11 mins 1696489915 \u6444\u50cf\u673a\u6a21\u578b 3059 10 mins 1696486155 \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 1971 7 mins 1696486155 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 1575 5 mins 1696380447 2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 4643 15 mins 1696243054 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 6200 21 mins 1696243054 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 2835 9 mins 1695950449 \u4e09\u7ef4\u70b9\u4e91 \u70b9\u4e91\u914d\u51c6 4724 16 mins 1716986617 \u6570\u636e\u96c6\u76f8\u5173 Waymo 547 11 2 mins 1716990042 KITTI 711 41 3 mins 1716986617 TUM 1270 4 mins 1710922161 \u8bba\u6587\u76f8\u5173 3DGS \u7cfb\u5217 5526 172 21 mins 1728457993 NeRF \u7cfb\u5217 6810 125 23 mins 1727443194 Dynamic SLAM \u7cfb\u5217 7983 28 mins 1727251137 Others 3650 34 13 mins 1727251137 \u5de5\u5177\u76f8\u5173 COLMAP 479 67 2 mins 1727355695 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u8ba1\u7b97\u673a\u89c6\u89c9"},{"location":"cv/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u8ba1\u7b97\u673a\u89c6\u89c9\uff08SLAM\u3001SfM\u3001\u63ba\u70b9\u673a\u5668\u4eba\uff0c\u4f8b\u5982 ROS\uff09\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5927\u591a\u90fd\u662f\u81ea\u5b66\uff0c\u7406\u89e3 CV\uff08\u6570\u5b66\uff09 \u7684\u672c\u8d28\uff08\u96fe","title":"\u8ba1\u7b97\u673a\u89c6\u89c9"},{"location":"cv/#table-of-contents","text":"\u591a\u89c6\u56fe\u51e0\u4f55 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 2129 7 mins 1696560509 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2758 9 mins 1696560259 \u5355\u89c6\u56fe\u51e0\u4f55 3229 11 mins 1696489915 \u6444\u50cf\u673a\u6a21\u578b 3059 10 mins 1696486155 \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 1971 7 mins 1696486155 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 1575 5 mins 1696380447 2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 4643 15 mins 1696243054 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 6200 21 mins 1696243054 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 2835 9 mins 1695950449 \u4e09\u7ef4\u70b9\u4e91 \u70b9\u4e91\u914d\u51c6 4724 16 mins 1716986617 \u6570\u636e\u96c6\u76f8\u5173 Waymo 547 11 2 mins 1716990042 KITTI 711 41 3 mins 1716986617 TUM 1270 4 mins 1710922161 \u8bba\u6587\u76f8\u5173 3DGS \u7cfb\u5217 5526 172 21 mins 1728457993 NeRF \u7cfb\u5217 6810 125 23 mins 1727443194 Dynamic SLAM \u7cfb\u5217 7983 28 mins 1727251137 Others 3650 34 13 mins 1727251137 \u5de5\u5177\u76f8\u5173 COLMAP 479 67 2 mins 1727355695 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"cv/3d-visualization/","text":"\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316 \u00b6 \u7ea6 1116 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea\u5510\u6cfd\u5723\u300a\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316\u300b \u4e09\u7ef4\u7a7a\u95f4\u89c4\u5219\u6570\u636e\u573a\u7684\u76f4\u63a5\u4f53\u7ed8\u5236 \u00b6 \u4f53\u5143\uff08Voxel\uff09\uff1a\u6bcf\u4e2a\u7f51\u683c\u662f\u7ed3\u6784\u5316\u6570\u636e\u7684\u4e00\u4e2a\u5143\u7d20 \u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5\uff1a\u5c06\u79bb\u6563\u5206\u5e03\u7684\u4e09\u7ef4\u6570\u636e\u573a\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u89c4\u5219\u8f6c\u6362\u4e3a\u56fe\u5f62\u663e\u793a\u8bbe\u5907\u5e27\u7f13\u5b58\u4e2d\u7684\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7\uff0c\u5373\u751f\u6210\u6bcf\u4e2a\u50cf\u7d20\u70b9\u989c\u8272\u7684 R\u3001G\u3001B \u503c \u91cd\u91c7\u6837 \u00b6 \u4fe1\u53f7\uff1a\u8868\u793a\u4fe1\u606f\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u662f\u8fde\u7eed\u7684\uff0c\u4e5f\u53ef\u4ee5\u662f\u79bb\u6563\u7684\u3002\u4e09\u7ef4\u7269\u4f53\u5728\u89c2\u5bdf\u5e73\u9762\u4e0a\u7684\u6295\u5f71\u53ef\u4ee5\u770b\u4f5c\u662f\u4e8c\u7ef4\u8fde\u7eed\u4fe1\u53f7\uff0c\u5728\u56fe\u5f62\u7cfb\u7edf\u7684\u5e27\u7f13\u5b58\u4e2d\uff0c\u7531\u50cf\u7d20\u70b9\u7684\u6570\u503c\u7ec4\u6210\u7684\u77e9\u9635\u662f\u4e00\u4e2a\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7 \u91c7\u6837\uff1a\u4ece\u4e00\u4e2a\u8fde\u7eed\u4fe1\u53f7\u4e2d\u9009\u62e9\u6709\u9650\u4e2a\u6570\u503c\u7684\u8fc7\u7a0b \u91cd\u6784\uff1a\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u91cd\u65b0\u6784\u9020\u8be5\u539f\u59cb\u4fe1\u53f7\u7684\u8fc7\u7a0b \u5948\u9b41\u65af\u7279\u9891\u7387\uff1a\u4ece\u4e00\u4e2a\u4fe1\u53f7\u4e2d\u62bd\u53d6\u6837\u672c\u7684\u9891\u7387\u5927\u4e8e\u8be5\u4fe1\u53f7\u9891\u8c31\u4e2d\u6700\u9ad8\u9891\u7387\u7684\u4e24\u500d\u65f6\uff0c\u5c31\u53ef\u4ee5\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u6062\u590d\u51fa\u539f\u4fe1\u53f7\uff0c\u8fd9\u4e00\u91c7\u6837\u9891\u7387\u7684\u4e0b\u9650\u79f0\u4e3a\u5948\u9b41\u65af\u7279\u9891\u7387 \u91cd\u91c7\u6837\uff1a \u9009\u62e9\u9002\u5f53\u7684\u91cd\u6784\u6838\u51fd\u6570\uff0c\u5bf9\u79bb\u6563\u7684\u91c7\u6837\u4fe1\u53f7\u8fdb\u884c\u5377\u79ef\u8fd0\u7b97\uff0c\u91cd\u6784\u8fde\u7eed\u7684\u539f\u59cb\u4fe1\u53f7 \u91c7\u7528\u4f4e\u901a\u6ee4\u6ce2\u51fd\u6570\u53bb\u6389\u9ad8\u4e8e\u5948\u9b41\u65af\u7279\u9891\u7387\u6781\u9650\u7684\u9891\u7387\u6210\u5206 \u5bf9\u6ee4\u6ce2\u540e\u7684\u51fd\u6570\u91cd\u65b0\u91c7\u6837 \u5149\u5b66\u6a21\u578b \u00b6 \u5728\u91cd\u91c7\u6837\u7684\u57fa\u7840\u4e0a\uff0c\u8ba1\u7b97\u5168\u90e8\u91c7\u6837\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u4e5f\u5c31\u662f\u6bcf\u4e00\u4e2a\u50cf\u7d20\u7684\u5149\u5f3a\u5ea6\u503c I \u5149\u7ebf\u5438\u6536\u6a21\u578b \u5149\u7ebf\u53d1\u5c04\u6a21\u578b \u5149\u7ebf\u5438\u6536\u548c\u53d1\u6563\u6a21\u578b \u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u6280\u672f \u00b6 \u4e09\u7ef4\u6570\u636e\u573a\u7684\u5206\u7c7b\u95ee\u9898 \u9608\u503c\u6cd5 \u6982\u7387\u6cd5 \u6539\u8fdb\u540e\u7684\u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7269\u4f53\u7a7a\u95f4\u626b\u63cf\u7684\u4f53\u7ed8\u5236\u6280\u672f \u00b6 \u8db3\u8ff9\u8868\u6cd5\uff1a\u9010\u5c42\u3001\u9010\u884c\u3001\u9010\u4e2a\u5730\u8ba1\u7b97\u6bcf\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u5e76\u52a0\u4ee5\u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u7684\u56fe\u50cf \u57fa\u4e8e\u9519\u5207-\u53d8\u5f62\u6280\u672f\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7b97\u6cd5\u6d41\u7a0b \u5728\u9009\u5b9a\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7684\u4e3b\u8981\u89c2\u5bdf\u65b9\u5411\u540e\uff0c\u4f7f\u5750\u6807\u7cfb\u7684z\u8f74\u4e0e\u5176\u76f8\u91cd\u5408\u3002\u5c06\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7531\u7269\u4f53\u7a7a\u95f4\u53d8\u6362\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u3002\u5bf9\u5e73\u884c\u6295\u5f71\u800c\u8a00\uff0c\u9519\u5207\u53d8\u6362\u53ea\u5305\u542b\u6570\u636e\u5e73\u9762\u7684\u5e73\u79fb\u3002\u5bf9\u4e8e\u900f\u89c6\u6295\u5f71\uff0c\u5728\u5e73\u79fb\u540e\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u6bd4\u4f8b\u53d8\u6362\uff0c\u5728\u5e73\u79fb\u548c\u6bd4\u4f8b\u53d8\u6362\u65f6\uff0c\u5728\u4e8c\u7ef4\u6570\u636e\u5e73\u9762\u5185\uff0c\u9700\u4f5c\u91cd\u65b0\u91c7\u6837\u3002 \u5728\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u4e2d\uff0c\u5c06\u9519\u5207\u540e\u7684\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u4e2d\u5404\u91c7\u6837\u70b9\u7684\u989c\u8272\u503c\u6295\u5c04\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u7684\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u3002\u5f62\u6210\u4e2d\u95f4\u56fe\u50cf\u3002\u7531\u4e8e\u662f\u6b63\u6295\u5f71\uff0c\u5404\u91c7\u6837\u70b9\u91cd\u6784\u6838\u7684\u8db3\u8ff9\u51fd\u6570\u4e0e\u89c2\u5bdf\u65b9\u5411\u65e0\u5173\uff0c\u56e0\u800c\u65e0\u9700\u91cd\u65b0\u8ba1\u7b97\u3002 \u5c06\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u56fe\u50cf\u901a\u8fc7\u4e8c\u7ef4\u56fe\u50cf\u53d8\u5f62 \\(M_{warp}\\) \uff0c\u53d8\u6362\u5230\u56fe\u50cf\u7a7a\u95f4\uff0c\u5f97\u5230\u6700\u7ec8\u56fe\u50cf\u3002\u8fd9\u4e00\u6b65\u4e5f\u9700\u8981\u4f5c\u4e8c\u7ef4\u56fe\u50cf\u7684\u91cd\u65b0\u91c7\u6837\u3002 \u4f53\u5143\u6295\u5c04\u6cd5 \u5b50\u533a\u57df\u6295\u5c04\u6cd5 \u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f \u00b6 \u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f\u7684\u539f\u7406 \u5085\u7acb\u53f6\u6295\u5f71-\u622a\u9762\u5b9a\u7406 \u9891\u57df\u4f53\u7ed8\u5236\u57fa\u672c\u7b97\u6cd5 \u57fa\u4e8e\u7269\u8d28\u5206\u7c7b\u7684\u989c\u8272\u8d4b\u503c\u7684\u9891\u57df\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91cd\u6784\u6838\u9636\u6b21\u7684\u81ea\u9002\u5e94\u9009\u62e9 \u8fdb\u4e00\u6b65\u51cf\u5c11\u8ba1\u7b97\u91cf\u548c\u5b58\u50a8\u7a7a\u95f4 \u5bf9\u79f0\u91c7\u6837 \u54c8\u7279\u91cc\u53d8\u6362\u4ee3\u66ff\u5085\u7acb\u53f6\u53d8\u6362 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236 \u00b6 \u7eb9\u7406\u6620\u5c04\uff0c\u7eb9\u7406\u56fe\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u79f0\u4e3a\u7eb9\u7406\u5143\uff08texels\uff09 \u7eb9\u7406\u751f\u6210 \u7ed9\u51fa\u6620\u5c04\u5b9a\u4e49 \u7eb9\u7406\u7684\u91cd\u91c7\u6837 \u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u53ca\u5176\u786c\u4ef6\u5b9e\u73b0 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u7269\u4f53\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5c4f\u5e55\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u660e\u6697\u6548\u679c\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u8fb9\u754c\u9762\u7a81\u51fa\u6548\u679c\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91c7\u7528\u7a7a\u95f4\u8df3\u8dc3\u6280\u672f\u7684\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5","title":"\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316"},{"location":"cv/3d-visualization/#_1","text":"\u7ea6 1116 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea\u5510\u6cfd\u5723\u300a\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316\u300b","title":"\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316"},{"location":"cv/3d-visualization/#_2","text":"\u4f53\u5143\uff08Voxel\uff09\uff1a\u6bcf\u4e2a\u7f51\u683c\u662f\u7ed3\u6784\u5316\u6570\u636e\u7684\u4e00\u4e2a\u5143\u7d20 \u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5\uff1a\u5c06\u79bb\u6563\u5206\u5e03\u7684\u4e09\u7ef4\u6570\u636e\u573a\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u89c4\u5219\u8f6c\u6362\u4e3a\u56fe\u5f62\u663e\u793a\u8bbe\u5907\u5e27\u7f13\u5b58\u4e2d\u7684\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7\uff0c\u5373\u751f\u6210\u6bcf\u4e2a\u50cf\u7d20\u70b9\u989c\u8272\u7684 R\u3001G\u3001B \u503c","title":"\u4e09\u7ef4\u7a7a\u95f4\u89c4\u5219\u6570\u636e\u573a\u7684\u76f4\u63a5\u4f53\u7ed8\u5236"},{"location":"cv/3d-visualization/#_3","text":"\u4fe1\u53f7\uff1a\u8868\u793a\u4fe1\u606f\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u662f\u8fde\u7eed\u7684\uff0c\u4e5f\u53ef\u4ee5\u662f\u79bb\u6563\u7684\u3002\u4e09\u7ef4\u7269\u4f53\u5728\u89c2\u5bdf\u5e73\u9762\u4e0a\u7684\u6295\u5f71\u53ef\u4ee5\u770b\u4f5c\u662f\u4e8c\u7ef4\u8fde\u7eed\u4fe1\u53f7\uff0c\u5728\u56fe\u5f62\u7cfb\u7edf\u7684\u5e27\u7f13\u5b58\u4e2d\uff0c\u7531\u50cf\u7d20\u70b9\u7684\u6570\u503c\u7ec4\u6210\u7684\u77e9\u9635\u662f\u4e00\u4e2a\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7 \u91c7\u6837\uff1a\u4ece\u4e00\u4e2a\u8fde\u7eed\u4fe1\u53f7\u4e2d\u9009\u62e9\u6709\u9650\u4e2a\u6570\u503c\u7684\u8fc7\u7a0b \u91cd\u6784\uff1a\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u91cd\u65b0\u6784\u9020\u8be5\u539f\u59cb\u4fe1\u53f7\u7684\u8fc7\u7a0b \u5948\u9b41\u65af\u7279\u9891\u7387\uff1a\u4ece\u4e00\u4e2a\u4fe1\u53f7\u4e2d\u62bd\u53d6\u6837\u672c\u7684\u9891\u7387\u5927\u4e8e\u8be5\u4fe1\u53f7\u9891\u8c31\u4e2d\u6700\u9ad8\u9891\u7387\u7684\u4e24\u500d\u65f6\uff0c\u5c31\u53ef\u4ee5\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u6062\u590d\u51fa\u539f\u4fe1\u53f7\uff0c\u8fd9\u4e00\u91c7\u6837\u9891\u7387\u7684\u4e0b\u9650\u79f0\u4e3a\u5948\u9b41\u65af\u7279\u9891\u7387 \u91cd\u91c7\u6837\uff1a \u9009\u62e9\u9002\u5f53\u7684\u91cd\u6784\u6838\u51fd\u6570\uff0c\u5bf9\u79bb\u6563\u7684\u91c7\u6837\u4fe1\u53f7\u8fdb\u884c\u5377\u79ef\u8fd0\u7b97\uff0c\u91cd\u6784\u8fde\u7eed\u7684\u539f\u59cb\u4fe1\u53f7 \u91c7\u7528\u4f4e\u901a\u6ee4\u6ce2\u51fd\u6570\u53bb\u6389\u9ad8\u4e8e\u5948\u9b41\u65af\u7279\u9891\u7387\u6781\u9650\u7684\u9891\u7387\u6210\u5206 \u5bf9\u6ee4\u6ce2\u540e\u7684\u51fd\u6570\u91cd\u65b0\u91c7\u6837","title":"\u91cd\u91c7\u6837"},{"location":"cv/3d-visualization/#_4","text":"\u5728\u91cd\u91c7\u6837\u7684\u57fa\u7840\u4e0a\uff0c\u8ba1\u7b97\u5168\u90e8\u91c7\u6837\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u4e5f\u5c31\u662f\u6bcf\u4e00\u4e2a\u50cf\u7d20\u7684\u5149\u5f3a\u5ea6\u503c I \u5149\u7ebf\u5438\u6536\u6a21\u578b \u5149\u7ebf\u53d1\u5c04\u6a21\u578b \u5149\u7ebf\u5438\u6536\u548c\u53d1\u6563\u6a21\u578b","title":"\u5149\u5b66\u6a21\u578b"},{"location":"cv/3d-visualization/#_5","text":"\u4e09\u7ef4\u6570\u636e\u573a\u7684\u5206\u7c7b\u95ee\u9898 \u9608\u503c\u6cd5 \u6982\u7387\u6cd5 \u6539\u8fdb\u540e\u7684\u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u7b97\u6cd5","title":"\u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u6280\u672f"},{"location":"cv/3d-visualization/#_6","text":"\u8db3\u8ff9\u8868\u6cd5\uff1a\u9010\u5c42\u3001\u9010\u884c\u3001\u9010\u4e2a\u5730\u8ba1\u7b97\u6bcf\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u5e76\u52a0\u4ee5\u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u7684\u56fe\u50cf \u57fa\u4e8e\u9519\u5207-\u53d8\u5f62\u6280\u672f\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7b97\u6cd5\u6d41\u7a0b \u5728\u9009\u5b9a\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7684\u4e3b\u8981\u89c2\u5bdf\u65b9\u5411\u540e\uff0c\u4f7f\u5750\u6807\u7cfb\u7684z\u8f74\u4e0e\u5176\u76f8\u91cd\u5408\u3002\u5c06\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7531\u7269\u4f53\u7a7a\u95f4\u53d8\u6362\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u3002\u5bf9\u5e73\u884c\u6295\u5f71\u800c\u8a00\uff0c\u9519\u5207\u53d8\u6362\u53ea\u5305\u542b\u6570\u636e\u5e73\u9762\u7684\u5e73\u79fb\u3002\u5bf9\u4e8e\u900f\u89c6\u6295\u5f71\uff0c\u5728\u5e73\u79fb\u540e\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u6bd4\u4f8b\u53d8\u6362\uff0c\u5728\u5e73\u79fb\u548c\u6bd4\u4f8b\u53d8\u6362\u65f6\uff0c\u5728\u4e8c\u7ef4\u6570\u636e\u5e73\u9762\u5185\uff0c\u9700\u4f5c\u91cd\u65b0\u91c7\u6837\u3002 \u5728\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u4e2d\uff0c\u5c06\u9519\u5207\u540e\u7684\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u4e2d\u5404\u91c7\u6837\u70b9\u7684\u989c\u8272\u503c\u6295\u5c04\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u7684\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u3002\u5f62\u6210\u4e2d\u95f4\u56fe\u50cf\u3002\u7531\u4e8e\u662f\u6b63\u6295\u5f71\uff0c\u5404\u91c7\u6837\u70b9\u91cd\u6784\u6838\u7684\u8db3\u8ff9\u51fd\u6570\u4e0e\u89c2\u5bdf\u65b9\u5411\u65e0\u5173\uff0c\u56e0\u800c\u65e0\u9700\u91cd\u65b0\u8ba1\u7b97\u3002 \u5c06\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u56fe\u50cf\u901a\u8fc7\u4e8c\u7ef4\u56fe\u50cf\u53d8\u5f62 \\(M_{warp}\\) \uff0c\u53d8\u6362\u5230\u56fe\u50cf\u7a7a\u95f4\uff0c\u5f97\u5230\u6700\u7ec8\u56fe\u50cf\u3002\u8fd9\u4e00\u6b65\u4e5f\u9700\u8981\u4f5c\u4e8c\u7ef4\u56fe\u50cf\u7684\u91cd\u65b0\u91c7\u6837\u3002 \u4f53\u5143\u6295\u5c04\u6cd5 \u5b50\u533a\u57df\u6295\u5c04\u6cd5","title":"\u7269\u4f53\u7a7a\u95f4\u626b\u63cf\u7684\u4f53\u7ed8\u5236\u6280\u672f"},{"location":"cv/3d-visualization/#_7","text":"\u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f\u7684\u539f\u7406 \u5085\u7acb\u53f6\u6295\u5f71-\u622a\u9762\u5b9a\u7406 \u9891\u57df\u4f53\u7ed8\u5236\u57fa\u672c\u7b97\u6cd5 \u57fa\u4e8e\u7269\u8d28\u5206\u7c7b\u7684\u989c\u8272\u8d4b\u503c\u7684\u9891\u57df\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91cd\u6784\u6838\u9636\u6b21\u7684\u81ea\u9002\u5e94\u9009\u62e9 \u8fdb\u4e00\u6b65\u51cf\u5c11\u8ba1\u7b97\u91cf\u548c\u5b58\u50a8\u7a7a\u95f4 \u5bf9\u79f0\u91c7\u6837 \u54c8\u7279\u91cc\u53d8\u6362\u4ee3\u66ff\u5085\u7acb\u53f6\u53d8\u6362","title":"\u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f"},{"location":"cv/3d-visualization/#_8","text":"\u7eb9\u7406\u6620\u5c04\uff0c\u7eb9\u7406\u56fe\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u79f0\u4e3a\u7eb9\u7406\u5143\uff08texels\uff09 \u7eb9\u7406\u751f\u6210 \u7ed9\u51fa\u6620\u5c04\u5b9a\u4e49 \u7eb9\u7406\u7684\u91cd\u91c7\u6837 \u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u53ca\u5176\u786c\u4ef6\u5b9e\u73b0 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u7269\u4f53\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5c4f\u5e55\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u660e\u6697\u6548\u679c\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u8fb9\u754c\u9762\u7a81\u51fa\u6548\u679c\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91c7\u7528\u7a7a\u95f4\u8df3\u8dc3\u6280\u672f\u7684\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5","title":"\u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236"},{"location":"cv/dataset/","text":"Dataset \u00b6 Abstract SLAM \u76f8\u5173\u6570\u636e\u96c6\u4ecb\u7ecd Table of Contents \u00b6 TUM KITTI Waymo","title":"Dataset"},{"location":"cv/dataset/#dataset","text":"Abstract SLAM \u76f8\u5173\u6570\u636e\u96c6\u4ecb\u7ecd","title":"Dataset"},{"location":"cv/dataset/#table-of-contents","text":"TUM KITTI Waymo","title":"Table of Contents"},{"location":"cv/dataset/kitti/","text":"KITTI \u6570\u636e\u96c6 \u00b6 \u7ea6 707 \u4e2a\u5b57 41 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u8be5\u6570\u636e\u96c6\u7528\u4e8e\u8bc4\u6d4b\u7acb\u4f53\u56fe\u50cf(stereo)\uff0c\u5149\u6d41(optical flow)\uff0c\u89c6\u89c9\u6d4b\u8ddd(visual odometry)\uff0c3D\u7269\u4f53\u68c0\u6d4b(object detection)\u548c3D\u8ddf\u8e2a(tracking)\u7b49\u8ba1\u7b97\u673a\u89c6\u89c9\u6280\u672f\u5728\u8f66\u8f7d\u73af\u5883\u4e0b\u7684\u6027\u80fd\u3002 KITTI\u5305\u542b\u5e02\u533a\u3001\u4e61\u6751\u548c\u9ad8\u901f\u516c\u8def\u7b49\u573a\u666f\u91c7\u96c6\u7684\u771f\u5b9e\u56fe\u50cf\u6570\u636e\uff0c\u6bcf\u5f20\u56fe\u50cf\u4e2d\u6700\u591a\u8fbe15\u8f86\u8f66\u548c30\u4e2a\u884c\u4eba\uff0c\u8fd8\u6709\u5404\u79cd\u7a0b\u5ea6\u7684\u906e\u6321\u4e0e\u622a\u65ad\u3002 \u6574\u4e2a\u6570\u636e\u96c6\u7531 389 \u5bf9\u7acb\u4f53\u56fe\u50cf\u548c\u5149\u6d41\u56fe\uff0c39.2 km\u89c6\u89c9\u6d4b\u8ddd\u5e8f\u5217\u4ee5\u53ca\u8d85\u8fc7 200k 3D \u6807\u6ce8\u7269\u4f53\u7684\u56fe\u50cf\u7ec4\u6210[1] \uff0c\u4ee5 10Hz \u7684\u9891\u7387\u91c7\u6837\u53ca\u540c\u6b65\u3002\u603b\u4f53\u4e0a\u770b\uff0c\u539f\u59cb\u6570\u636e\u96c6\u88ab\u5206\u7c7b\u4e3a Road , City , Residential , Campus \u548c Person \u3002\u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0clabel\u7ec6\u5206\u4e3a car, van, truck, pedestrian, pedestrian(sitting), cyclist, tram \u4ee5\u53camisc \u7ec4\u6210\u3002 \u4e3b\u9875\uff1a https://www.cvlibs.net/datasets/kitti/index.php \u53ef\u89c6\u5316\uff1a http://www.danielgm.net/cc/release/ \u6570\u636e\u96c6\u683c\u5f0f \u00b6 \u7ed3\u6784 \u00b6 data \u251c\u2500\u2500 kitti \u2502 \u251c\u2500\u2500 ImageSets \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 label_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u2502 \u251c\u2500\u2500 planes (optional) image_2 \u53732\u53f7\u5f69\u8272\u76f8\u673a\u6240\u62cd\u6444\u7684\u56fe\u7247\uff08.png\uff09\uff1b calib \u5bf9\u5e94\u6bcf\u4e00\u5e27\u7684\u5916\u53c2\uff08.txt\uff09\uff1b label_2 \u662f\u6bcf\u5e27\u7684\u6807\u6ce8\u4fe1\u606f\uff08.txt\uff09\uff1b velodyne \u662f Velodyne64 \u6240\u5f97\u7684\u70b9\u4e91\u6587\u4ef6\uff08.bin\uff09 \u6807\u5b9a\u6587\u4ef6 \u00b6 KITTI \u63d0\u4f9b\u4e86\u4e09\u79cd\u6807\u5b9a\u6587\u4ef6\uff0c\u4e0d\u9700\u4eba\u5de5\u8f6c\u6362\u3002 calib_cam_to_cam calib_imu_to_velo calib_velo_to_cam ImageSets \u00b6 train.txt\uff1a\u8bad\u7ec3\u96c6 \u5217\u8868\u4fe1\u606f test.txt\uff1a\u6d4b\u8bd5\u96c6 \u5217\u8868\u4fe1\u606f val.txt\uff1a\u9a8c\u8bc1\u96c6 \u5217\u8868\u4fe1\u606f image \u6587\u4ef6 \u00b6 image \u6587\u4ef6\u4ee5 8 \u4f4d PNG \u683c\u5f0f\u5b58\u50a8\uff0c\u5982\u4e0b\u6240\u793a\uff1a velodyne \u6587\u4ef6 \u00b6 velodyne \u6587\u4ef6\u662f\u6fc0\u5149\u96f7\u8fbe\u7684\u6d4b\u91cf\u6570\u636e\uff08\u7ed5\u5176\u5782\u76f4\u8f74\uff08\u9006\u65f6\u9488\uff09\u8fde\u7eed\u65cb\u8f6c\uff09\uff0c\u4ee5 \"000001.bin\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a 7b14 4642 1058 b541 9643 0340 0000 0000 46b6 4542 1283 b641 3333 0340 0000 0000 4e62 4042 9643 b541 b072 0040 cdcc 4c3d 8340 3f42 08ac b541 3bdf ff3f 0000 0000 e550 4042 022b b841 9cc4 0040 0000 0000 10d8 4042 022b ba41 4c37 0140 0000 0000 3fb5 3a42 14ae b541 5a64 fb3f 0000 0000 7dbf 3942 2731 b641 be9f fa3f 8fc2 f53d cd4c 3842 3f35 b641 4c37 f93f ec51 383e dbf9 3742 a69b b641 c3f5 f83f ec51 383e 2586 3742 9a99 b741 fed4 f83f 1f85 6b3e . . . \u70b9\u4e91\u6570\u636e\u4ee5\u6d6e\u70b9\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f\u5b58\u50a8\uff0c\u6bcf\u884c\u5305\u542b8\u4e2a\u6570\u636e\uff0c\u6bcf\u4e2a\u6570\u636e\u7531\u56db\u4f4d\u5341\u516d\u8fdb\u5236\u6570\u8868\u793a\uff08\u6d6e\u70b9\u6570\uff09\uff0c\u6bcf\u4e2a\u6570\u636e\u901a\u8fc7\u7a7a\u683c\u9694\u5f00\u3002\u4e00\u4e2a\u70b9\u4e91\u6570\u636e\u7531\u56db\u4e2a\u6d6e\u70b9\u6570\u6570\u636e\u6784\u6210\uff0c\u5206\u522b\u8868\u793a\u70b9\u4e91\u7684x\u3001y\u3001z\u3001r\uff08\u5f3a\u5ea6 or \u53cd\u5c04\u503c\uff09\uff0c\u70b9\u4e91\u7684\u5b58\u50a8\u65b9\u5f0f\u5982\u4e0b\u8868\u6240\u793a\uff1a calib \u6587\u4ef6 \u00b6 calib\u6587\u4ef6\u662f\u76f8\u673a\u3001\u96f7\u8fbe\u3001\u60ef\u5bfc\u7b49\u4f20\u611f\u5668\u7684\u77eb\u6b63\u6570\u636e\u3002\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a P0: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 0.000000000000e+00 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P1: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.875744000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P2: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 4.485728000000e+01 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.163791000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.745884000000e-03 P3: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.395242000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.199936000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.729905000000e-03 R0_rect: 9.999239000000e-01 9.837760000000e-03 -7.445048000000e-03 -9.869795000000e-03 9.999421000000e-01 -4.278459000000e-03 7.402527000000e-03 4.351614000000e-03 9.999631000000e-01 Tr_velo_to_cam: 7.533745000000e-03 -9.999714000000e-01 -6.166020000000e-04 -4.069766000000e-03 1.480249000000e-02 7.280733000000e-04 -9.998902000000e-01 -7.631618000000e-02 9.998621000000e-01 7.523790000000e-03 1.480755000000e-02 -2.717806000000e-01 Tr_imu_to_velo: 9.999976000000e-01 7.553071000000e-04 -2.035826000000e-03 -8.086759000000e-01 -7.854027000000e-04 9.998898000000e-01 -1.482298000000e-02 3.195559000000e-01 2.024406000000e-03 1.482454000000e-02 9.998881000000e-01 -7.997231000000e-01 label \u6587\u4ef6 \u00b6 label\u6587\u4ef6\u662f KITTI \u4e2d object \u7684\u6807\u7b7e\u548c\u8bc4\u4f30\u6570\u636e\uff0c\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5305\u542b\u6837\u5f0f\u5982\u4e0b\uff1a Truck 0.00 0 -1.57 599.41 156.40 629.75 189.25 2.85 2.63 12.34 0.47 1.49 69.44 -1.56 Car 0.00 0 1.85 387.63 181.54 423.81 203.12 1.67 1.87 3.69 -16.53 2.39 58.49 1.57 Cyclist 0.00 3 -1.65 676.60 163.95 688.98 193.93 1.86 0.60 2.02 4.59 1.32 45.84 -1.55 DontCare -1 -1 -10 503.89 169.71 590.61 190.13 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 511.35 174.96 527.81 187.45 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 532.37 176.35 542.68 185.27 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 559.62 175.83 575.40 183.15 -1 -1 -1 -1000 -1000 -1000 -10 \u7b2c1\u5217\uff08\u5b57\u7b26\u4e32\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u7c7b\u522b\uff08type\uff09 \u7b2c2\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u622a\u65ad\uff08truncated\uff09 \u7b2c3\u5217\uff08\u6574\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u906e\u6321\uff08occluded\uff09 \u7b2c4\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a\u7269\u4f53\u7684\u89c2\u5bdf\u89d2\u5ea6\uff08alpha\uff09 \u7b2c5~8\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u7269\u4f53\u76842D\u8fb9\u754c\u6846\u5927\u5c0f\uff08bbox\uff09 \u7b2c9~11\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u5c3a\u5bf8\uff08dimensions\uff09 \u7b2c12-14\u5217\uff08\u6574\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u4f4d\u7f6e\uff08location\uff09 \u7b2c15\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u7a7a\u95f4\u65b9\u5411\uff08rotation_y\uff09 \u7b2c16\u5217\uff08\u6574\u6570\uff09\uff1a\u68c0\u6d4b\u7684\u7f6e\u4fe1\u5ea6\uff08score\uff09\uff08 \u53ea\u6709\u6d4b\u8bd5\u96c6\u4e2d\u6709 \uff09 Reference \u00b6 KITTI\u6570\u636e\u96c6\u7b80\u4ecb\u4e0e\u4f7f\u7528 KITTI\u6570\u636e\u96c6\u89e3\u6790\u548c\u53ef\u89c6\u5316 \u4e00\u6587\u591a\u56fe\u641e\u61c2KITTI\u6570\u636e\u96c6\u4e0b\u8f7d\u53ca\u89e3\u6790 KITTI \u6570\u636e\u96c6","title":"KITTI"},{"location":"cv/dataset/kitti/#kitti","text":"\u7ea6 707 \u4e2a\u5b57 41 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u8be5\u6570\u636e\u96c6\u7528\u4e8e\u8bc4\u6d4b\u7acb\u4f53\u56fe\u50cf(stereo)\uff0c\u5149\u6d41(optical flow)\uff0c\u89c6\u89c9\u6d4b\u8ddd(visual odometry)\uff0c3D\u7269\u4f53\u68c0\u6d4b(object detection)\u548c3D\u8ddf\u8e2a(tracking)\u7b49\u8ba1\u7b97\u673a\u89c6\u89c9\u6280\u672f\u5728\u8f66\u8f7d\u73af\u5883\u4e0b\u7684\u6027\u80fd\u3002 KITTI\u5305\u542b\u5e02\u533a\u3001\u4e61\u6751\u548c\u9ad8\u901f\u516c\u8def\u7b49\u573a\u666f\u91c7\u96c6\u7684\u771f\u5b9e\u56fe\u50cf\u6570\u636e\uff0c\u6bcf\u5f20\u56fe\u50cf\u4e2d\u6700\u591a\u8fbe15\u8f86\u8f66\u548c30\u4e2a\u884c\u4eba\uff0c\u8fd8\u6709\u5404\u79cd\u7a0b\u5ea6\u7684\u906e\u6321\u4e0e\u622a\u65ad\u3002 \u6574\u4e2a\u6570\u636e\u96c6\u7531 389 \u5bf9\u7acb\u4f53\u56fe\u50cf\u548c\u5149\u6d41\u56fe\uff0c39.2 km\u89c6\u89c9\u6d4b\u8ddd\u5e8f\u5217\u4ee5\u53ca\u8d85\u8fc7 200k 3D \u6807\u6ce8\u7269\u4f53\u7684\u56fe\u50cf\u7ec4\u6210[1] \uff0c\u4ee5 10Hz \u7684\u9891\u7387\u91c7\u6837\u53ca\u540c\u6b65\u3002\u603b\u4f53\u4e0a\u770b\uff0c\u539f\u59cb\u6570\u636e\u96c6\u88ab\u5206\u7c7b\u4e3a Road , City , Residential , Campus \u548c Person \u3002\u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0clabel\u7ec6\u5206\u4e3a car, van, truck, pedestrian, pedestrian(sitting), cyclist, tram \u4ee5\u53camisc \u7ec4\u6210\u3002 \u4e3b\u9875\uff1a https://www.cvlibs.net/datasets/kitti/index.php \u53ef\u89c6\u5316\uff1a http://www.danielgm.net/cc/release/","title":"KITTI \u6570\u636e\u96c6"},{"location":"cv/dataset/kitti/#_1","text":"","title":"\u6570\u636e\u96c6\u683c\u5f0f"},{"location":"cv/dataset/kitti/#_2","text":"data \u251c\u2500\u2500 kitti \u2502 \u251c\u2500\u2500 ImageSets \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 label_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u2502 \u251c\u2500\u2500 planes (optional) image_2 \u53732\u53f7\u5f69\u8272\u76f8\u673a\u6240\u62cd\u6444\u7684\u56fe\u7247\uff08.png\uff09\uff1b calib \u5bf9\u5e94\u6bcf\u4e00\u5e27\u7684\u5916\u53c2\uff08.txt\uff09\uff1b label_2 \u662f\u6bcf\u5e27\u7684\u6807\u6ce8\u4fe1\u606f\uff08.txt\uff09\uff1b velodyne \u662f Velodyne64 \u6240\u5f97\u7684\u70b9\u4e91\u6587\u4ef6\uff08.bin\uff09","title":"\u7ed3\u6784"},{"location":"cv/dataset/kitti/#_3","text":"KITTI \u63d0\u4f9b\u4e86\u4e09\u79cd\u6807\u5b9a\u6587\u4ef6\uff0c\u4e0d\u9700\u4eba\u5de5\u8f6c\u6362\u3002 calib_cam_to_cam calib_imu_to_velo calib_velo_to_cam","title":"\u6807\u5b9a\u6587\u4ef6"},{"location":"cv/dataset/kitti/#imagesets","text":"train.txt\uff1a\u8bad\u7ec3\u96c6 \u5217\u8868\u4fe1\u606f test.txt\uff1a\u6d4b\u8bd5\u96c6 \u5217\u8868\u4fe1\u606f val.txt\uff1a\u9a8c\u8bc1\u96c6 \u5217\u8868\u4fe1\u606f","title":"ImageSets"},{"location":"cv/dataset/kitti/#image","text":"image \u6587\u4ef6\u4ee5 8 \u4f4d PNG \u683c\u5f0f\u5b58\u50a8\uff0c\u5982\u4e0b\u6240\u793a\uff1a","title":"image \u6587\u4ef6"},{"location":"cv/dataset/kitti/#velodyne","text":"velodyne \u6587\u4ef6\u662f\u6fc0\u5149\u96f7\u8fbe\u7684\u6d4b\u91cf\u6570\u636e\uff08\u7ed5\u5176\u5782\u76f4\u8f74\uff08\u9006\u65f6\u9488\uff09\u8fde\u7eed\u65cb\u8f6c\uff09\uff0c\u4ee5 \"000001.bin\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a 7b14 4642 1058 b541 9643 0340 0000 0000 46b6 4542 1283 b641 3333 0340 0000 0000 4e62 4042 9643 b541 b072 0040 cdcc 4c3d 8340 3f42 08ac b541 3bdf ff3f 0000 0000 e550 4042 022b b841 9cc4 0040 0000 0000 10d8 4042 022b ba41 4c37 0140 0000 0000 3fb5 3a42 14ae b541 5a64 fb3f 0000 0000 7dbf 3942 2731 b641 be9f fa3f 8fc2 f53d cd4c 3842 3f35 b641 4c37 f93f ec51 383e dbf9 3742 a69b b641 c3f5 f83f ec51 383e 2586 3742 9a99 b741 fed4 f83f 1f85 6b3e . . . \u70b9\u4e91\u6570\u636e\u4ee5\u6d6e\u70b9\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f\u5b58\u50a8\uff0c\u6bcf\u884c\u5305\u542b8\u4e2a\u6570\u636e\uff0c\u6bcf\u4e2a\u6570\u636e\u7531\u56db\u4f4d\u5341\u516d\u8fdb\u5236\u6570\u8868\u793a\uff08\u6d6e\u70b9\u6570\uff09\uff0c\u6bcf\u4e2a\u6570\u636e\u901a\u8fc7\u7a7a\u683c\u9694\u5f00\u3002\u4e00\u4e2a\u70b9\u4e91\u6570\u636e\u7531\u56db\u4e2a\u6d6e\u70b9\u6570\u6570\u636e\u6784\u6210\uff0c\u5206\u522b\u8868\u793a\u70b9\u4e91\u7684x\u3001y\u3001z\u3001r\uff08\u5f3a\u5ea6 or \u53cd\u5c04\u503c\uff09\uff0c\u70b9\u4e91\u7684\u5b58\u50a8\u65b9\u5f0f\u5982\u4e0b\u8868\u6240\u793a\uff1a","title":"velodyne \u6587\u4ef6"},{"location":"cv/dataset/kitti/#calib","text":"calib\u6587\u4ef6\u662f\u76f8\u673a\u3001\u96f7\u8fbe\u3001\u60ef\u5bfc\u7b49\u4f20\u611f\u5668\u7684\u77eb\u6b63\u6570\u636e\u3002\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a P0: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 0.000000000000e+00 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P1: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.875744000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P2: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 4.485728000000e+01 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.163791000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.745884000000e-03 P3: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.395242000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.199936000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.729905000000e-03 R0_rect: 9.999239000000e-01 9.837760000000e-03 -7.445048000000e-03 -9.869795000000e-03 9.999421000000e-01 -4.278459000000e-03 7.402527000000e-03 4.351614000000e-03 9.999631000000e-01 Tr_velo_to_cam: 7.533745000000e-03 -9.999714000000e-01 -6.166020000000e-04 -4.069766000000e-03 1.480249000000e-02 7.280733000000e-04 -9.998902000000e-01 -7.631618000000e-02 9.998621000000e-01 7.523790000000e-03 1.480755000000e-02 -2.717806000000e-01 Tr_imu_to_velo: 9.999976000000e-01 7.553071000000e-04 -2.035826000000e-03 -8.086759000000e-01 -7.854027000000e-04 9.998898000000e-01 -1.482298000000e-02 3.195559000000e-01 2.024406000000e-03 1.482454000000e-02 9.998881000000e-01 -7.997231000000e-01","title":"calib \u6587\u4ef6"},{"location":"cv/dataset/kitti/#label","text":"label\u6587\u4ef6\u662f KITTI \u4e2d object \u7684\u6807\u7b7e\u548c\u8bc4\u4f30\u6570\u636e\uff0c\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5305\u542b\u6837\u5f0f\u5982\u4e0b\uff1a Truck 0.00 0 -1.57 599.41 156.40 629.75 189.25 2.85 2.63 12.34 0.47 1.49 69.44 -1.56 Car 0.00 0 1.85 387.63 181.54 423.81 203.12 1.67 1.87 3.69 -16.53 2.39 58.49 1.57 Cyclist 0.00 3 -1.65 676.60 163.95 688.98 193.93 1.86 0.60 2.02 4.59 1.32 45.84 -1.55 DontCare -1 -1 -10 503.89 169.71 590.61 190.13 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 511.35 174.96 527.81 187.45 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 532.37 176.35 542.68 185.27 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 559.62 175.83 575.40 183.15 -1 -1 -1 -1000 -1000 -1000 -10 \u7b2c1\u5217\uff08\u5b57\u7b26\u4e32\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u7c7b\u522b\uff08type\uff09 \u7b2c2\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u622a\u65ad\uff08truncated\uff09 \u7b2c3\u5217\uff08\u6574\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u906e\u6321\uff08occluded\uff09 \u7b2c4\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a\u7269\u4f53\u7684\u89c2\u5bdf\u89d2\u5ea6\uff08alpha\uff09 \u7b2c5~8\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u7269\u4f53\u76842D\u8fb9\u754c\u6846\u5927\u5c0f\uff08bbox\uff09 \u7b2c9~11\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u5c3a\u5bf8\uff08dimensions\uff09 \u7b2c12-14\u5217\uff08\u6574\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u4f4d\u7f6e\uff08location\uff09 \u7b2c15\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u7a7a\u95f4\u65b9\u5411\uff08rotation_y\uff09 \u7b2c16\u5217\uff08\u6574\u6570\uff09\uff1a\u68c0\u6d4b\u7684\u7f6e\u4fe1\u5ea6\uff08score\uff09\uff08 \u53ea\u6709\u6d4b\u8bd5\u96c6\u4e2d\u6709 \uff09","title":"label \u6587\u4ef6"},{"location":"cv/dataset/kitti/#reference","text":"KITTI\u6570\u636e\u96c6\u7b80\u4ecb\u4e0e\u4f7f\u7528 KITTI\u6570\u636e\u96c6\u89e3\u6790\u548c\u53ef\u89c6\u5316 \u4e00\u6587\u591a\u56fe\u641e\u61c2KITTI\u6570\u636e\u96c6\u4e0b\u8f7d\u53ca\u89e3\u6790 KITTI \u6570\u636e\u96c6","title":"Reference"},{"location":"cv/dataset/tum/","text":"TUM \u6570\u636e\u96c6 \u00b6 \u7ea6 1266 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract TUM RGB-D \u6570\u636e\u96c6\u7531\u5728\u4e0d\u540c\u7684\u5ba4\u5185\u573a\u666f\u4f7f\u7528 Microsoft Kinect \u4f20\u611f\u5668\u8bb0\u5f55\u768439 \u4e2a\u5e8f\u5217\u7ec4\u6210\uff0c\u5305\u542b\u4e86 Testing and Debugging\uff08\u6d4b\u8bd5\uff09 Handheld SLAM\uff08\u624b\u6301SLAM\uff09 Robot SLAM\uff08\u673a\u5668\u4ebaSLAM\uff09 Structure vs. Texture\uff08\u7ed3\u6784 vs \u4f4e\u7eb9\u7406\uff09 Dynamic Objects\uff08\u52a8\u6001\u7269\u4f53\uff09 3D Object Reconstruction\uff08\u4e09\u7ef4\u7269\u4f53\u91cd\u5efa\uff09 Validation Files\uff08\u9a8c\u8bc1\u96c6\uff09 Calibration Files\uff08\u6807\u5b9a\u6587\u4ef6\uff09 \u7b49\u51e0\u79cd\u9488\u5bf9\u4e0d\u540c\u4efb\u52a1\u7684\u6570\u636e\u96c6\uff0c\u6bcf\u4e2a\u79cd\u7c7b\u6709\u5305\u542b\u591a\u4e2a\u6570\u636e\uff0c\u53ef\u4ee5\u7528\u4e8e\u591a\u79cd\u4efb\u52a1\u7684\u6027\u80fd\u6d4b\u8bd5\u3002\u5176\u4e2d\u4e4b\u540e\u9a8c\u8bc1\u96c6\u6ca1\u6709\u771f\u503c\uff0c\u53ea\u80fd\u901a\u8fc7 TUM \u63d0\u4f9b\u7684\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177\u8bc4\u6d4b\u6211\u4eec\u7684\u8ba1\u7b97\u7ed3\u679c\u3002TUM\u6570\u636e\u96c6\u5e26\u6709\u6807\u51c6\u7684\u8f68\u8ff9\u548c\u4e00\u4e9b\u6bd4\u8f83\u5de5\u5177\uff0c\u6240\u4ee5\u975e\u5e38\u9002\u5408\u7528\u6765\u505a\u7814\u7a76\u3002 \u4e3b\u9875\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/download \u5728\u7ebf\u6d4b\u8bc4\u5de5\u5177\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/online_evaluation \u6570\u636e\u96c6\u683c\u5f0f \u00b6 ros bag \u00b6 \u53ef\u7528 ros \u7684 rosbag \u547d\u4ee4\u8fdb\u884c\u64ad\u653e\uff0c\u76f8\u5e94\u8282\u70b9\u8ba2\u9605\u56fe\u50cf\u8bdd\u9898\u5373\u53ef\u3002 tgz \u00b6 \u538b\u7f29\u540e\u5305\u542b\uff1a rgb.txt \u548c depth.txt \u6587\u4ef6\u8bb0\u5f55\u4e86\u5404\u6587\u4ef6\u7684\u91c7\u96c6\u65f6\u95f4\u548c\u5bf9\u5e94\u7684\u6587\u4ef6\u540d rgb/ \u548c depth/ \u76ee\u5f55\u5b58\u653e\u91c7\u96c6\u5230\u7684 png \u683c\u5f0f\u56fe\u50cf\u6587\u4ef6\uff0c\u4ee5\u91c7\u96c6\u65f6\u95f4\u547d\u540d groundtruth.txt \u4e3a\u5916\u90e8\u8fd0\u52a8\u6355\u6349\u7cfb\u7edf\u91c7\u96c6\u5230\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u683c\u5f0f\u4e3a\uff08time, tx, ty, tz, qx, qy, qw\uff09 Note \u5f69\u8272\u56fe\u3001\u6df1\u5ea6\u56fe\u548c\u6807\u51c6\u8f68\u8ff9\u7684\u91c7\u96c6\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u8f68\u8ff9\u7684\u91c7\u96c6\u9891\u7387\u6bd4\u56fe\u50cf\u9ad8\u5f88\u591a\u3002 \u5728\u4f7f\u7528\u6570\u636e\u4e4b\u524d\uff0c\u9700\u8981\u6839\u636e\u91c7\u96c6\u65f6\u95f4\uff0c\u5bf9\u6570\u636e\u8fdb\u884c\u4e00\u6b21\u65f6\u95f4\u4e0a\u7684\u5bf9\u9f50\uff0c\u4ee5\u4fbf\u5bf9\u5f69\u8272\u56fe\u548c\u6df1\u5ea6\u56fe\u8fdb\u884c\u914d\u5bf9\u3002 \u53ef\u4ee5\u628a\u91c7\u96c6\u65f6\u95f4\u76f8\u8fd1\u4e8e\u4e00\u4e2a\u9608\u503c\u7684\u6570\u636e\uff0c\u770b\u6210\u662f\u4e00\u5bf9\u56fe\u50cf\uff0c\u5e76\u628a\u76f8\u8fd1\u65f6\u95f4\u7684\u4f4d\u59ff\uff0c\u770b\u4f5c\u662f\u8be5\u56fe\u50cf\u7684\u771f\u5b9e\u91c7\u96c6\u4f4d\u7f6e\u3002 TUM\u63d0\u4f9b\u4e86 associate.py \u7a0b\u5e8f\uff0c\u5c06\u5176\u653e\u5165\u76ee\u5f55\u4e0b\u6267\u884c\u5373\u53ef\u5f97\u5230\u8bb0\u5f55\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u5339\u914d\u7ed3\u679c\u7684 accelerometer.txt \u6587\u4ef6\uff0c\u91cc\u9762\u8bb0\u5f55\u4e86\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u7684\u5339\u914d\u5173\u7cfb\u3002 \u52a8\u6001\u6570\u636e\u96c6 \u00b6 \u7814\u7a76\u52a8\u6001 SALM \u65f6\u7528\u7684\u662f TUM \u7684 Dynamic Objects \u6570\u636e\u96c6\uff089\u4e2a\uff09\u4ee5\u53ca Validation Files \u5bf9\u5e94\u7684\u90e8\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a fr2/desk_with_person \u8bb0\u5f55\u4e86\u4e00\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\u7684\u5178\u578b\u529e\u516c\u5ba4\u573a\u666f\uff0c\u5728\u5f55\u5236\u8fc7\u7a0b\u4e2d\uff0c\u8be5\u4eba\u79fb\u52a8\u5e76\u4e0e\u4e00\u4e9b\u7269\u4f53\uff08\u5c4f\u5e55\u3001\u7535\u8bdd\u7b49\uff09\u4e92\u52a8\u3002 \u5bf9\u4e8e\u5176\u4ed6 8 \u4e2a\u5e8f\u5217\uff0csitting \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\uff0c\u4ea4\u8c08\uff0c\u5e76\u7a0d\u5fae\u6253\u624b\u52bf\uff0c\u5e8f\u5217\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u548c\u91cc\u7a0b\u8ba1\u7b97\u6cd5\u5bf9\u7f13\u6162\u79fb\u52a8\u7684\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\uff1bwalking \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u8d70\u8fc7\u4e00\u4e2a\u529e\u516c\u5ba4\u573a\u666f\uff0c\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u5728\u5927\u90e8\u5206\u53ef\u89c1\u573a\u666f\u4e2d\u5feb\u901f\u79fb\u52a8\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\u3002xyz\uff0crpy\uff0chalfsphere\uff0cstatic \u5219\u5bf9\u5e94\u4e86\u76f8\u673a\u7684\u79fb\u52a8\u65b9\u5f0f\u3002\u5177\u4f53\u7684 sitting \u4e0e walking \u6570\u636e\u96c6\u4e2d\u7684\u533a\u522b\u5982\u4e0b\uff1a \u76f8\u673a\u8fd0\u52a8\u8f68\u8ff9\u7684\u533a\u522b\u5982\u4e0b\uff1a \u6570\u636e\u96c6\u5206\u6790 \u00b6 \u5bf9\u4e8e\u52a8\u6001\u73af\u5883\u4e0b\u7684SLAM\u95ee\u9898\uff0c\u6211\u4eec\u901a\u5e38\u9075\u5faa\u4ee5\u4e0b\u4e24\u4e2a\u51c6\u5219\u6765\u964d\u4f4e\u52a8\u6001\u7269\u4f53\u5bf9\u5b9a\u4f4d\u7cbe\u5ea6\u7684\u5f71\u54cd\u3002 \u51c6\u52191\uff1a\u5c3d\u53ef\u80fd\u5c06\u8fd0\u52a8\u7684\u7269\u4f53\uff08\u533a\u57df\uff09\u7684\u53bb\u9664\u3002\u8fd0\u52a8\u533a\u57df\u7684\u7279\u5f81\u70b9\u4f1a\u5f15\u5165\u4e00\u4e9b\u9519\u8bef\u7684\u7a7a\u95f4\u7ea6\u675f\uff0c\u6781\u5927\u7684\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\u53ca\u9c81\u68d2\u6027\uff0c\u56e0\u6b64\u5bf9\u52a8\u6001\u533a\u57df\u7684\u5bb9\u5fcd\u5ea6\u662f\u975e\u5e38\u4f4e\u7684\u3002 \u51c6\u52192\uff1a\u5c3d\u53ef\u80fd\u4fdd\u7559\u9759\u6001\u533a\u57df\u3002\u5982\u679c\u573a\u666f\u4e2d\u4f7f\u7528\u7684\u7279\u5f81\u70b9\u8fc7\u5c11\uff0c\u4e5f\u4f1a\u95f4\u63a5\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\uff0c\u6240\u4ee5\u5728\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u540c\u65f6\uff0c\u5c3d\u91cf\u4e0d\u8981\u628a\u9759\u6001\u70b9\u5f53\u505a\u52a8\u6001\u70b9\u53bb\u9664\u6389\u3002 \u5728\u4f7f\u7528\u8bed\u4e49\u4fe1\u606f\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u65f6\u5019\u8981\u8003\u8651\u7684\u95ee\u9898\uff1a \u5148\u9a8c\u77e5\u8bc6\u91cc\u9759\u6b62\u7684\u7269\u4f53\uff08\u6bd4\u5982\u6905\u5b50\uff0c\u4e66\uff09\u53ef\u80fd\u662f\u8fd0\u52a8\u7684\uff0c\u5982\u679c\u4e00\u4e2a\u4eba\u63a8\u7740\u6905\u5b50\u8fd0\u52a8\u7684\u8bdd\u4e5f\u9700\u8981\u5c06\u6905\u5b50\u533a\u57df\u7684\u7279\u5f81\u70b9\u8fdb\u884c\u5254\u9664\uff0c\u5426\u5219\u5b9a\u4f4d\u65f6\u4e5f\u4f1a\u4f7f\u7528\u4e00\u4e9b\u52a8\u6001\u7684\u4e0d\u5b89\u5168\u7684\u7279\u5f81\u70b9\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191 \u5148\u9a8c\u77e5\u8bc6\u91cc\u79fb\u52a8\u7684\u7269\u4f53\uff08\u6bd4\u5982\u4eba\u548c\u6c7d\u8f66\uff09\u53ef\u80fd\u662f\u9759\u6b62\u7684\uff0c\u5982\u679c\u8fd9\u4e9b\u533a\u57df\u53bb\u6389\u7684\u8bdd\uff0c\u4f1a\u56e0\u4e3a\u9759\u6001\u70b9\u7684\u51cf\u5c11\u800c\u964d\u4f4e\u5b9a\u4f4d\u7cbe\u5ea6\uff0c\u5373\u8fdd\u53cd\u4e86\u51c6\u52192\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u7f13\u6162\u8fd0\u52a8\u7684\u3002\u4e00\u4e9b\u8bba\u6587\u5e38\u5e38\u4f7f\u7528\u4e24\u5e27\u4e4b\u95f4\u8ba1\u7b97\u5916\u70b9\uff0c\u901a\u8fc7\u7269\u4f53\u4e0a\u5916\u70b9\u7684\u6570\u91cf\u5224\u65ad\u7269\u4f53\u662f\u5426\u5728\u79fb\u52a8\uff0c\u7136\u800c\u5982\u679c\u7269\u4f53\u662f\u5728\u7f13\u6162\u8fd0\u52a8\uff0c\u90a3\u4e48\u5f88\u96be\u5728\u524d\u540e\u4e24\u5e27\u56fe\u50cf\u4e4b\u95f4\u901a\u8fc7\u5916\u70b9\u7684\u65b9\u5f0f\u68c0\u6d4b\u51fa\u6765\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u5c40\u90e8\u8fd0\u52a8\u5c40\u90e8\u9759\u6b62\u7684\u3002\u6bd4\u5982 TUM \u6570\u636e\u96c6\u4e2d sitting \u4e2d\u7684\u90e8\u5206\uff0c\u4eba\u7684\u5927\u90e8\u5206\u533a\u57df\u5728\u9759\u6b62\u7684\uff0c\u4f46\u662f\u6709\u4e00\u5c0f\u90e8\u5206\u662f\u52a8\u6001\u7684\uff0c\u4e0d\u80fd\u5c06\u4eba\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u8fdb\u884c\u8fd0\u52a8\u5224\u65ad\uff0c\u4e5f\u5c31\u4e0d\u80fd\u540c\u65f6\u6ee1\u8db3\u51c6\u52191\u4e0e\u51c6\u52192\u3002 \u9488\u5bf9TUM\u6570\u636e\u96c6\uff0c\u5177\u4f53\u9700\u8981\u8003\u8651\u7684\u56e0\u7d20\u5305\u62ec\uff1a walking\u4e2d\u79fb\u52a8\u7684\u4eba sitting\u4e2d\u5c40\u90e8\u8fd0\u52a8\u7684\u4eba \u9759\u6b62\u7684\u4eba \u79fb\u52a8\u7684\u6905\u5b50\u548c\u4e66\u7c4d","title":"TUM"},{"location":"cv/dataset/tum/#tum","text":"\u7ea6 1266 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract TUM RGB-D \u6570\u636e\u96c6\u7531\u5728\u4e0d\u540c\u7684\u5ba4\u5185\u573a\u666f\u4f7f\u7528 Microsoft Kinect \u4f20\u611f\u5668\u8bb0\u5f55\u768439 \u4e2a\u5e8f\u5217\u7ec4\u6210\uff0c\u5305\u542b\u4e86 Testing and Debugging\uff08\u6d4b\u8bd5\uff09 Handheld SLAM\uff08\u624b\u6301SLAM\uff09 Robot SLAM\uff08\u673a\u5668\u4ebaSLAM\uff09 Structure vs. Texture\uff08\u7ed3\u6784 vs \u4f4e\u7eb9\u7406\uff09 Dynamic Objects\uff08\u52a8\u6001\u7269\u4f53\uff09 3D Object Reconstruction\uff08\u4e09\u7ef4\u7269\u4f53\u91cd\u5efa\uff09 Validation Files\uff08\u9a8c\u8bc1\u96c6\uff09 Calibration Files\uff08\u6807\u5b9a\u6587\u4ef6\uff09 \u7b49\u51e0\u79cd\u9488\u5bf9\u4e0d\u540c\u4efb\u52a1\u7684\u6570\u636e\u96c6\uff0c\u6bcf\u4e2a\u79cd\u7c7b\u6709\u5305\u542b\u591a\u4e2a\u6570\u636e\uff0c\u53ef\u4ee5\u7528\u4e8e\u591a\u79cd\u4efb\u52a1\u7684\u6027\u80fd\u6d4b\u8bd5\u3002\u5176\u4e2d\u4e4b\u540e\u9a8c\u8bc1\u96c6\u6ca1\u6709\u771f\u503c\uff0c\u53ea\u80fd\u901a\u8fc7 TUM \u63d0\u4f9b\u7684\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177\u8bc4\u6d4b\u6211\u4eec\u7684\u8ba1\u7b97\u7ed3\u679c\u3002TUM\u6570\u636e\u96c6\u5e26\u6709\u6807\u51c6\u7684\u8f68\u8ff9\u548c\u4e00\u4e9b\u6bd4\u8f83\u5de5\u5177\uff0c\u6240\u4ee5\u975e\u5e38\u9002\u5408\u7528\u6765\u505a\u7814\u7a76\u3002 \u4e3b\u9875\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/download \u5728\u7ebf\u6d4b\u8bc4\u5de5\u5177\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/online_evaluation","title":"TUM \u6570\u636e\u96c6"},{"location":"cv/dataset/tum/#_1","text":"","title":"\u6570\u636e\u96c6\u683c\u5f0f"},{"location":"cv/dataset/tum/#ros-bag","text":"\u53ef\u7528 ros \u7684 rosbag \u547d\u4ee4\u8fdb\u884c\u64ad\u653e\uff0c\u76f8\u5e94\u8282\u70b9\u8ba2\u9605\u56fe\u50cf\u8bdd\u9898\u5373\u53ef\u3002","title":"ros bag"},{"location":"cv/dataset/tum/#tgz","text":"\u538b\u7f29\u540e\u5305\u542b\uff1a rgb.txt \u548c depth.txt \u6587\u4ef6\u8bb0\u5f55\u4e86\u5404\u6587\u4ef6\u7684\u91c7\u96c6\u65f6\u95f4\u548c\u5bf9\u5e94\u7684\u6587\u4ef6\u540d rgb/ \u548c depth/ \u76ee\u5f55\u5b58\u653e\u91c7\u96c6\u5230\u7684 png \u683c\u5f0f\u56fe\u50cf\u6587\u4ef6\uff0c\u4ee5\u91c7\u96c6\u65f6\u95f4\u547d\u540d groundtruth.txt \u4e3a\u5916\u90e8\u8fd0\u52a8\u6355\u6349\u7cfb\u7edf\u91c7\u96c6\u5230\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u683c\u5f0f\u4e3a\uff08time, tx, ty, tz, qx, qy, qw\uff09 Note \u5f69\u8272\u56fe\u3001\u6df1\u5ea6\u56fe\u548c\u6807\u51c6\u8f68\u8ff9\u7684\u91c7\u96c6\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u8f68\u8ff9\u7684\u91c7\u96c6\u9891\u7387\u6bd4\u56fe\u50cf\u9ad8\u5f88\u591a\u3002 \u5728\u4f7f\u7528\u6570\u636e\u4e4b\u524d\uff0c\u9700\u8981\u6839\u636e\u91c7\u96c6\u65f6\u95f4\uff0c\u5bf9\u6570\u636e\u8fdb\u884c\u4e00\u6b21\u65f6\u95f4\u4e0a\u7684\u5bf9\u9f50\uff0c\u4ee5\u4fbf\u5bf9\u5f69\u8272\u56fe\u548c\u6df1\u5ea6\u56fe\u8fdb\u884c\u914d\u5bf9\u3002 \u53ef\u4ee5\u628a\u91c7\u96c6\u65f6\u95f4\u76f8\u8fd1\u4e8e\u4e00\u4e2a\u9608\u503c\u7684\u6570\u636e\uff0c\u770b\u6210\u662f\u4e00\u5bf9\u56fe\u50cf\uff0c\u5e76\u628a\u76f8\u8fd1\u65f6\u95f4\u7684\u4f4d\u59ff\uff0c\u770b\u4f5c\u662f\u8be5\u56fe\u50cf\u7684\u771f\u5b9e\u91c7\u96c6\u4f4d\u7f6e\u3002 TUM\u63d0\u4f9b\u4e86 associate.py \u7a0b\u5e8f\uff0c\u5c06\u5176\u653e\u5165\u76ee\u5f55\u4e0b\u6267\u884c\u5373\u53ef\u5f97\u5230\u8bb0\u5f55\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u5339\u914d\u7ed3\u679c\u7684 accelerometer.txt \u6587\u4ef6\uff0c\u91cc\u9762\u8bb0\u5f55\u4e86\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u7684\u5339\u914d\u5173\u7cfb\u3002","title":"tgz"},{"location":"cv/dataset/tum/#_2","text":"\u7814\u7a76\u52a8\u6001 SALM \u65f6\u7528\u7684\u662f TUM \u7684 Dynamic Objects \u6570\u636e\u96c6\uff089\u4e2a\uff09\u4ee5\u53ca Validation Files \u5bf9\u5e94\u7684\u90e8\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a fr2/desk_with_person \u8bb0\u5f55\u4e86\u4e00\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\u7684\u5178\u578b\u529e\u516c\u5ba4\u573a\u666f\uff0c\u5728\u5f55\u5236\u8fc7\u7a0b\u4e2d\uff0c\u8be5\u4eba\u79fb\u52a8\u5e76\u4e0e\u4e00\u4e9b\u7269\u4f53\uff08\u5c4f\u5e55\u3001\u7535\u8bdd\u7b49\uff09\u4e92\u52a8\u3002 \u5bf9\u4e8e\u5176\u4ed6 8 \u4e2a\u5e8f\u5217\uff0csitting \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\uff0c\u4ea4\u8c08\uff0c\u5e76\u7a0d\u5fae\u6253\u624b\u52bf\uff0c\u5e8f\u5217\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u548c\u91cc\u7a0b\u8ba1\u7b97\u6cd5\u5bf9\u7f13\u6162\u79fb\u52a8\u7684\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\uff1bwalking \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u8d70\u8fc7\u4e00\u4e2a\u529e\u516c\u5ba4\u573a\u666f\uff0c\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u5728\u5927\u90e8\u5206\u53ef\u89c1\u573a\u666f\u4e2d\u5feb\u901f\u79fb\u52a8\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\u3002xyz\uff0crpy\uff0chalfsphere\uff0cstatic \u5219\u5bf9\u5e94\u4e86\u76f8\u673a\u7684\u79fb\u52a8\u65b9\u5f0f\u3002\u5177\u4f53\u7684 sitting \u4e0e walking \u6570\u636e\u96c6\u4e2d\u7684\u533a\u522b\u5982\u4e0b\uff1a \u76f8\u673a\u8fd0\u52a8\u8f68\u8ff9\u7684\u533a\u522b\u5982\u4e0b\uff1a","title":"\u52a8\u6001\u6570\u636e\u96c6"},{"location":"cv/dataset/tum/#_3","text":"\u5bf9\u4e8e\u52a8\u6001\u73af\u5883\u4e0b\u7684SLAM\u95ee\u9898\uff0c\u6211\u4eec\u901a\u5e38\u9075\u5faa\u4ee5\u4e0b\u4e24\u4e2a\u51c6\u5219\u6765\u964d\u4f4e\u52a8\u6001\u7269\u4f53\u5bf9\u5b9a\u4f4d\u7cbe\u5ea6\u7684\u5f71\u54cd\u3002 \u51c6\u52191\uff1a\u5c3d\u53ef\u80fd\u5c06\u8fd0\u52a8\u7684\u7269\u4f53\uff08\u533a\u57df\uff09\u7684\u53bb\u9664\u3002\u8fd0\u52a8\u533a\u57df\u7684\u7279\u5f81\u70b9\u4f1a\u5f15\u5165\u4e00\u4e9b\u9519\u8bef\u7684\u7a7a\u95f4\u7ea6\u675f\uff0c\u6781\u5927\u7684\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\u53ca\u9c81\u68d2\u6027\uff0c\u56e0\u6b64\u5bf9\u52a8\u6001\u533a\u57df\u7684\u5bb9\u5fcd\u5ea6\u662f\u975e\u5e38\u4f4e\u7684\u3002 \u51c6\u52192\uff1a\u5c3d\u53ef\u80fd\u4fdd\u7559\u9759\u6001\u533a\u57df\u3002\u5982\u679c\u573a\u666f\u4e2d\u4f7f\u7528\u7684\u7279\u5f81\u70b9\u8fc7\u5c11\uff0c\u4e5f\u4f1a\u95f4\u63a5\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\uff0c\u6240\u4ee5\u5728\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u540c\u65f6\uff0c\u5c3d\u91cf\u4e0d\u8981\u628a\u9759\u6001\u70b9\u5f53\u505a\u52a8\u6001\u70b9\u53bb\u9664\u6389\u3002 \u5728\u4f7f\u7528\u8bed\u4e49\u4fe1\u606f\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u65f6\u5019\u8981\u8003\u8651\u7684\u95ee\u9898\uff1a \u5148\u9a8c\u77e5\u8bc6\u91cc\u9759\u6b62\u7684\u7269\u4f53\uff08\u6bd4\u5982\u6905\u5b50\uff0c\u4e66\uff09\u53ef\u80fd\u662f\u8fd0\u52a8\u7684\uff0c\u5982\u679c\u4e00\u4e2a\u4eba\u63a8\u7740\u6905\u5b50\u8fd0\u52a8\u7684\u8bdd\u4e5f\u9700\u8981\u5c06\u6905\u5b50\u533a\u57df\u7684\u7279\u5f81\u70b9\u8fdb\u884c\u5254\u9664\uff0c\u5426\u5219\u5b9a\u4f4d\u65f6\u4e5f\u4f1a\u4f7f\u7528\u4e00\u4e9b\u52a8\u6001\u7684\u4e0d\u5b89\u5168\u7684\u7279\u5f81\u70b9\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191 \u5148\u9a8c\u77e5\u8bc6\u91cc\u79fb\u52a8\u7684\u7269\u4f53\uff08\u6bd4\u5982\u4eba\u548c\u6c7d\u8f66\uff09\u53ef\u80fd\u662f\u9759\u6b62\u7684\uff0c\u5982\u679c\u8fd9\u4e9b\u533a\u57df\u53bb\u6389\u7684\u8bdd\uff0c\u4f1a\u56e0\u4e3a\u9759\u6001\u70b9\u7684\u51cf\u5c11\u800c\u964d\u4f4e\u5b9a\u4f4d\u7cbe\u5ea6\uff0c\u5373\u8fdd\u53cd\u4e86\u51c6\u52192\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u7f13\u6162\u8fd0\u52a8\u7684\u3002\u4e00\u4e9b\u8bba\u6587\u5e38\u5e38\u4f7f\u7528\u4e24\u5e27\u4e4b\u95f4\u8ba1\u7b97\u5916\u70b9\uff0c\u901a\u8fc7\u7269\u4f53\u4e0a\u5916\u70b9\u7684\u6570\u91cf\u5224\u65ad\u7269\u4f53\u662f\u5426\u5728\u79fb\u52a8\uff0c\u7136\u800c\u5982\u679c\u7269\u4f53\u662f\u5728\u7f13\u6162\u8fd0\u52a8\uff0c\u90a3\u4e48\u5f88\u96be\u5728\u524d\u540e\u4e24\u5e27\u56fe\u50cf\u4e4b\u95f4\u901a\u8fc7\u5916\u70b9\u7684\u65b9\u5f0f\u68c0\u6d4b\u51fa\u6765\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u5c40\u90e8\u8fd0\u52a8\u5c40\u90e8\u9759\u6b62\u7684\u3002\u6bd4\u5982 TUM \u6570\u636e\u96c6\u4e2d sitting \u4e2d\u7684\u90e8\u5206\uff0c\u4eba\u7684\u5927\u90e8\u5206\u533a\u57df\u5728\u9759\u6b62\u7684\uff0c\u4f46\u662f\u6709\u4e00\u5c0f\u90e8\u5206\u662f\u52a8\u6001\u7684\uff0c\u4e0d\u80fd\u5c06\u4eba\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u8fdb\u884c\u8fd0\u52a8\u5224\u65ad\uff0c\u4e5f\u5c31\u4e0d\u80fd\u540c\u65f6\u6ee1\u8db3\u51c6\u52191\u4e0e\u51c6\u52192\u3002 \u9488\u5bf9TUM\u6570\u636e\u96c6\uff0c\u5177\u4f53\u9700\u8981\u8003\u8651\u7684\u56e0\u7d20\u5305\u62ec\uff1a walking\u4e2d\u79fb\u52a8\u7684\u4eba sitting\u4e2d\u5c40\u90e8\u8fd0\u52a8\u7684\u4eba \u9759\u6b62\u7684\u4eba \u79fb\u52a8\u7684\u6905\u5b50\u548c\u4e66\u7c4d","title":"\u6570\u636e\u96c6\u5206\u6790"},{"location":"cv/dataset/waymo/","text":"KITTI \u6570\u636e\u96c6 \u00b6 \u7ea6 543 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract waymo\u63d0\u4f9b\u4e86\u4e24\u79cd\u6570\u636e\u96c6\uff0c motion \u4e0e perception \u4e24\u79cd\uff0c\u5176\u4e2d motion \u662f\u9e1f\u77b0\u56fe\uff0c\u5b98\u7f51\u4e2d\u6709\u4ecb\u7ecd\uff0c\u4e3b\u8981\u7528\u4e8e\u8f68\u8ff9\u9884\u6d4b\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c perception \u4e3b\u8981\u7528\u4e8e\u76ee\u6807\u68c0\u6d4b\u8ddf\u8e2a\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u662f\u7b2c\u4e00\u89c6\u89d2\uff0c\u6709\u76f8\u673a\u548c\u96f7\u8fbe\u4fe1\u606f\u3002 Waymo\u5305\u542b 798 \u4e2a\u8bad\u7ec3\u573a\u666f\u3001202 \u4e2a\u9a8c\u8bc1\u573a\u666f\u548c 150 \u4e2a\u6d4b\u8bd5\u573a\u666f\uff0c\u6bcf\u4e2a\u573a\u666f\u7684\u65f6\u957f\u4e3a 20 s\u3002Waymo \u6570\u636e\u96c6\u7684\u6807\u6ce8\u9891\u7387\u6bd4 nuScenes \u9ad8 5 \u500d\uff0c\u573a\u666f\u6570\u91cf\u662f nuScenes \u6570\u636e\u96c6\u7684 3 \u500d\uff0c\u6709\u6570\u91cf\u66f4\u591a\u4e14\u66f4\u5bc6\u96c6\u7684 2D/3D \u6807\u7b7e\u3002Waymo \u6570\u636e\u96c6\u5bf9\u81ea\u52a8\u9a7e\u9a76\u7b97\u6cd5\u7684\u9c81\u68d2\u6027\u548c\u6cdb\u5316\u80fd\u529b\u63d0\u51fa\u4e86\u66f4\u9ad8\u7684\u8981\u6c42\uff0c\u662f\u76ee\u524d\u4e3a\u6b62\u6700\u5927\u3001\u6700\u591a\u6837\u5316\u7684\u6570\u636e\u96c6\u3002 paper: https://arxiv.org/abs/1912.04838v7 github: https://github.com/waymo-research/waymo-open-dataset \u4e3b\u9875\uff1a https://waymo.com/open \u6570\u636e\u96c6\u683c\u5f0f \u00b6 \u7ed3\u6784 \u00b6 data \u251c\u2500\u2500 waymo \u2502 \u251c\u2500\u2500 waymo_format \u2502 \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 validation \u2502 \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 gt.bin \u2502 \u2502 \u251c\u2500\u2500 cam_gt.bin \u2502 \u2502 \u251c\u2500\u2500 fov_gt.bin \u2502 \u251c\u2500\u2500 kitti_format \u2502 \u2502 \u251c\u2500\u2500 ImageSets Ground Truth Labels \u00b6 \u6570\u636e\u96c6\u4e2d\u5bf9\u6c7d\u8f66\u3001\u884c\u4eba\u3001\u4ea4\u901a\u6807\u5fd7\u3001\u81ea\u884c\u8f66\u4eba\u5458\u8fdb\u884c\u4e86\u8be6\u7ec6\u6807\u6ce8\u3002\u5bf9\u4e8e\u6fc0\u5149\u96f7\u8fbe\u6570\u636e\uff0c\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a 7 \u81ea\u7531\u5ea6 3D bbox\uff1a(cx, cy, cz, l, w, h, \u03b8)\u3002\u5176\u4e2dcx, cy, cz \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u5750\u6807\uff0cl, w, h \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5bbd\u9ad8\uff0c\u03b8 \u8868\u793a\u4e3a\u7269\u4f53\u504f\u822a\u89d2\uff0c\u6b64\u5916\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u7269\u4f53\u8fd8\u6807\u6ce8\u4e86\u4e00\u4e2a\u552f\u4e00\u7684\u8ffd\u8e2a ID \u7f16\u53f7\u3002 \u56fe\u50cf\u6807\u6ce8\u4e2d\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a4\u81ea\u7531\u5ea62D bbox\uff1a(cx, cy, l, w)\u3002\u5176\u4e2dcx, cy \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u56fe\u50cf\u5750\u6807\uff0cl \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5ea6\uff0cw \u8868\u793a\u4e3a\u7269\u4f53\u5bbd\u5ea6\u3002 \u6b64\u5916\uff0c\u8fd8\u5c06\u6807\u6ce8\u7269\u4f53\u5212\u5206\u4e3a\u4e86\u4e24\u4e2a\u96be\u5ea6\uff1aLEVEL_2 \u4e3a\u7269\u4f53\u5bf9\u5e94\u6fc0\u5149\u96f7\u8fbe\u70b9\u6570\u5c11\u4e8e 5 \u4e2a\uff0c\u5176\u4f59\u5219\u5212\u5206\u4e3a LEVEL_1\u3002 Tasks \u00b6 \u6570\u636e\u96c6\u4efb\u52a1\u5212\u5206\u4e3a2D\u548c3D\u7269\u4f53\u68c0\u6d4b\u548c\u8ffd\u8e2a\u4efb\u52a1\uff0c\u8bad\u7ec3\u96c6\u573a\u666f\u6709798\u4e2a\uff0c\u9a8c\u8bc1\u96c6\u573a\u666f\u6709202\u4e2a\uff0c\u6d4b\u8bd5\u96c6\u573a\u666f\u6709150\u4e2a\u3002 Experiments \u00b6 \u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0cWaymo \u63d0\u4f9b\u4e86\u4e00\u4e2a Baseline\uff0c\u5176\u4f7f\u7528\u7684\u68c0\u6d4b\u65b9\u6cd5\u662f PointPillars\u3002\u5bf9\u4e8e 2D \u7269\u4f53\u68c0\u6d4b\uff0c\u4f7f\u7528\u4e86 Faster R-CNN \u4f5c\u4e3a baseline\uff0c\u5bf9\u4e8e3D\u7269\u4f53\u8ffd\u8e2a\uff0c\u4f7f\u7528\u4e86 AB3DMOT \u4f5c\u4e3a Baseline\u3002 Waymo \u8f6c\u6362 COCO \u683c\u5f0f \u00b6 https://github.com/shinya7y/WaymoCOCO Reference \u00b6 Waymo\u81ea\u52a8\u9a7e\u9a76\u6570\u636e\u96c6\u4ecb\u7ecd\u4e0e\u4f7f\u7528\u6559 Waymo\u6570\u636e\u96c6\u4e0b\u8f7d\u4e0e\u4f7f\u7528 WAYMO \u6570\u636e\u96c6","title":"Waymo"},{"location":"cv/dataset/waymo/#kitti","text":"\u7ea6 543 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract waymo\u63d0\u4f9b\u4e86\u4e24\u79cd\u6570\u636e\u96c6\uff0c motion \u4e0e perception \u4e24\u79cd\uff0c\u5176\u4e2d motion \u662f\u9e1f\u77b0\u56fe\uff0c\u5b98\u7f51\u4e2d\u6709\u4ecb\u7ecd\uff0c\u4e3b\u8981\u7528\u4e8e\u8f68\u8ff9\u9884\u6d4b\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c perception \u4e3b\u8981\u7528\u4e8e\u76ee\u6807\u68c0\u6d4b\u8ddf\u8e2a\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u662f\u7b2c\u4e00\u89c6\u89d2\uff0c\u6709\u76f8\u673a\u548c\u96f7\u8fbe\u4fe1\u606f\u3002 Waymo\u5305\u542b 798 \u4e2a\u8bad\u7ec3\u573a\u666f\u3001202 \u4e2a\u9a8c\u8bc1\u573a\u666f\u548c 150 \u4e2a\u6d4b\u8bd5\u573a\u666f\uff0c\u6bcf\u4e2a\u573a\u666f\u7684\u65f6\u957f\u4e3a 20 s\u3002Waymo \u6570\u636e\u96c6\u7684\u6807\u6ce8\u9891\u7387\u6bd4 nuScenes \u9ad8 5 \u500d\uff0c\u573a\u666f\u6570\u91cf\u662f nuScenes \u6570\u636e\u96c6\u7684 3 \u500d\uff0c\u6709\u6570\u91cf\u66f4\u591a\u4e14\u66f4\u5bc6\u96c6\u7684 2D/3D \u6807\u7b7e\u3002Waymo \u6570\u636e\u96c6\u5bf9\u81ea\u52a8\u9a7e\u9a76\u7b97\u6cd5\u7684\u9c81\u68d2\u6027\u548c\u6cdb\u5316\u80fd\u529b\u63d0\u51fa\u4e86\u66f4\u9ad8\u7684\u8981\u6c42\uff0c\u662f\u76ee\u524d\u4e3a\u6b62\u6700\u5927\u3001\u6700\u591a\u6837\u5316\u7684\u6570\u636e\u96c6\u3002 paper: https://arxiv.org/abs/1912.04838v7 github: https://github.com/waymo-research/waymo-open-dataset \u4e3b\u9875\uff1a https://waymo.com/open","title":"KITTI \u6570\u636e\u96c6"},{"location":"cv/dataset/waymo/#_1","text":"","title":"\u6570\u636e\u96c6\u683c\u5f0f"},{"location":"cv/dataset/waymo/#_2","text":"data \u251c\u2500\u2500 waymo \u2502 \u251c\u2500\u2500 waymo_format \u2502 \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 validation \u2502 \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 gt.bin \u2502 \u2502 \u251c\u2500\u2500 cam_gt.bin \u2502 \u2502 \u251c\u2500\u2500 fov_gt.bin \u2502 \u251c\u2500\u2500 kitti_format \u2502 \u2502 \u251c\u2500\u2500 ImageSets","title":"\u7ed3\u6784"},{"location":"cv/dataset/waymo/#ground-truth-labels","text":"\u6570\u636e\u96c6\u4e2d\u5bf9\u6c7d\u8f66\u3001\u884c\u4eba\u3001\u4ea4\u901a\u6807\u5fd7\u3001\u81ea\u884c\u8f66\u4eba\u5458\u8fdb\u884c\u4e86\u8be6\u7ec6\u6807\u6ce8\u3002\u5bf9\u4e8e\u6fc0\u5149\u96f7\u8fbe\u6570\u636e\uff0c\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a 7 \u81ea\u7531\u5ea6 3D bbox\uff1a(cx, cy, cz, l, w, h, \u03b8)\u3002\u5176\u4e2dcx, cy, cz \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u5750\u6807\uff0cl, w, h \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5bbd\u9ad8\uff0c\u03b8 \u8868\u793a\u4e3a\u7269\u4f53\u504f\u822a\u89d2\uff0c\u6b64\u5916\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u7269\u4f53\u8fd8\u6807\u6ce8\u4e86\u4e00\u4e2a\u552f\u4e00\u7684\u8ffd\u8e2a ID \u7f16\u53f7\u3002 \u56fe\u50cf\u6807\u6ce8\u4e2d\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a4\u81ea\u7531\u5ea62D bbox\uff1a(cx, cy, l, w)\u3002\u5176\u4e2dcx, cy \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u56fe\u50cf\u5750\u6807\uff0cl \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5ea6\uff0cw \u8868\u793a\u4e3a\u7269\u4f53\u5bbd\u5ea6\u3002 \u6b64\u5916\uff0c\u8fd8\u5c06\u6807\u6ce8\u7269\u4f53\u5212\u5206\u4e3a\u4e86\u4e24\u4e2a\u96be\u5ea6\uff1aLEVEL_2 \u4e3a\u7269\u4f53\u5bf9\u5e94\u6fc0\u5149\u96f7\u8fbe\u70b9\u6570\u5c11\u4e8e 5 \u4e2a\uff0c\u5176\u4f59\u5219\u5212\u5206\u4e3a LEVEL_1\u3002","title":"Ground Truth Labels"},{"location":"cv/dataset/waymo/#tasks","text":"\u6570\u636e\u96c6\u4efb\u52a1\u5212\u5206\u4e3a2D\u548c3D\u7269\u4f53\u68c0\u6d4b\u548c\u8ffd\u8e2a\u4efb\u52a1\uff0c\u8bad\u7ec3\u96c6\u573a\u666f\u6709798\u4e2a\uff0c\u9a8c\u8bc1\u96c6\u573a\u666f\u6709202\u4e2a\uff0c\u6d4b\u8bd5\u96c6\u573a\u666f\u6709150\u4e2a\u3002","title":"Tasks"},{"location":"cv/dataset/waymo/#experiments","text":"\u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0cWaymo \u63d0\u4f9b\u4e86\u4e00\u4e2a Baseline\uff0c\u5176\u4f7f\u7528\u7684\u68c0\u6d4b\u65b9\u6cd5\u662f PointPillars\u3002\u5bf9\u4e8e 2D \u7269\u4f53\u68c0\u6d4b\uff0c\u4f7f\u7528\u4e86 Faster R-CNN \u4f5c\u4e3a baseline\uff0c\u5bf9\u4e8e3D\u7269\u4f53\u8ffd\u8e2a\uff0c\u4f7f\u7528\u4e86 AB3DMOT \u4f5c\u4e3a Baseline\u3002","title":"Experiments"},{"location":"cv/dataset/waymo/#waymo-coco","text":"https://github.com/shinya7y/WaymoCOCO","title":"Waymo \u8f6c\u6362 COCO \u683c\u5f0f"},{"location":"cv/dataset/waymo/#reference","text":"Waymo\u81ea\u52a8\u9a7e\u9a76\u6570\u636e\u96c6\u4ecb\u7ecd\u4e0e\u4f7f\u7528\u6559 Waymo\u6570\u636e\u96c6\u4e0b\u8f7d\u4e0e\u4f7f\u7528 WAYMO \u6570\u636e\u96c6","title":"Reference"},{"location":"cv/mvg/","text":"\u591a\u89c6\u56fe\u51e0\u4f55 \u00b6 Abstract \u8fd9\u91cc\u603b\u7ed3\u4e00\u4e9b\u5b66\u4e60\u591a\u89c6\u56fe\u51e0\u4f55\u65f6\u7684\u7b14\u8bb0 \u4e3a\u4e09\u7ef4\u7a7a\u95f4\u8bc6\u522b\u6253\u57fa\u7840 Table of Contents \u00b6 2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 \u6444\u50cf\u673a\u6a21\u578b \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P \u5355\u89c6\u56fe\u51e0\u4f55 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 Reference \u00b6 \u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u7684\u591a\u89c6\u56fe\u51e0\u4f55-\u7b2c\u4e00\u7248-\u4e2d\u6587\u5b8c\u6574\u7248.pdf Multiple View Geometry\uff08\u591a\u89c6\u56fe\u51e0\u4f55\uff09\u5b66\u4e60\u7b14\u8bb0 \u591a\u89c6\u56fe\u51e0\u4f55\u5b66(Multiple View Geometry)\u8bfb\u4e66\u7b14\u8bb0\u76ee\u5f55","title":"\u591a\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/#_1","text":"Abstract \u8fd9\u91cc\u603b\u7ed3\u4e00\u4e9b\u5b66\u4e60\u591a\u89c6\u56fe\u51e0\u4f55\u65f6\u7684\u7b14\u8bb0 \u4e3a\u4e09\u7ef4\u7a7a\u95f4\u8bc6\u522b\u6253\u57fa\u7840","title":"\u591a\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/#table-of-contents","text":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 \u6444\u50cf\u673a\u6a21\u578b \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P \u5355\u89c6\u56fe\u51e0\u4f55 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784","title":"Table of Contents"},{"location":"cv/mvg/#reference","text":"\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u7684\u591a\u89c6\u56fe\u51e0\u4f55-\u7b2c\u4e00\u7248-\u4e2d\u6587\u5b8c\u6574\u7248.pdf Multiple View Geometry\uff08\u591a\u89c6\u56fe\u51e0\u4f55\uff09\u5b66\u4e60\u7b14\u8bb0 \u591a\u89c6\u56fe\u51e0\u4f55\u5b66(Multiple View Geometry)\u8bfb\u4e66\u7b14\u8bb0\u76ee\u5f55","title":"Reference"},{"location":"cv/mvg/3dr-camera-structure/","text":"\u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 \u00b6 \u7ea6 2125 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u91cd\u6784\u7684\u4efb\u52a1\u662f\u6c42\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \uff0c\u4ee5\u53ca 3D \u4e2d\u7684\u70b9 \\(\\mathbf{X}_i\\) \uff0c\u4f7f\u5f97\u5bf9\u6240\u6709 i\uff0c\u6709 \\[ \\mathbf{x}_i=P \\mathbf{X}_i \\ \\ \\ \\ \\ \\ \\mathbf{x}_i^\\prime=P^\\prime \\mathbf{X}_i \\] \u91cd\u6784\u65b9\u6cd5\u6982\u8ff0 \u00b6 \u7531\u4e24\u89c6\u56fe\u91cd\u6784\u7684\u4e00\u79cd\u65b9\u6cd5\uff1a \u7531\u5bf9\u5e94\u70b9\u8ba1\u7b97\u57fa\u672c\u77e9\u9635 \u7531\u57fa\u672c\u77e9\u9635\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 \u9488\u5bf9\u6bcf\u7ec4\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u7a7a\u95f4\u4e2d\u6620\u5c04\u5230\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5230\u70b9 \u91cd\u6784\u7684\u591a\u4e49\u6027 \u00b6 \u82e5\u6ca1\u6709\u666f\u7269\u5728\u67d0\u4e2a 3D \u5750\u6807\u7cfb\u4e0b\u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u4e00\u822c\u4e0d\u53ef\u80fd\u4ece\u4e00\u5bf9\u89c6\u56fe\uff08\u6216\u4e8b\u5b9e\u4e0a\u4ece\u4efb\u610f\u6570\u76ee\u7684\u89c6\u56fe\uff09\u91cd\u6784\u8be5\u666f\u7269\u7684\u7edd\u5bf9\u4f4d\u7f6e\u548c\u671d\u5411\u3002\u4ec5\u7531\u56fe\u50cf\u6765\u786e\u5b9a\u666f\u7269\u5c31\u8981\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\uff08\u65cb\u8f6c\u3001\u5e73\u79fb\u548c\u7f29\u653e\uff09 \u5c04\u5f71\u591a\u4e49\u6027 \uff1a\u5982\u679c\u65e2\u4e0d\u77e5\u9053\u4efb\u4f55\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u4e5f\u4e0d\u77e5\u9053\u4e00\u4e2a\u6444\u50cf\u673a\u4e0e\u53e6\u4e00\u4e2a\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u90a3\u4e48\u91cd\u6784\u7684\u591a\u4e49\u6027\u7531\u4e00\u4e2a\u4efb\u610f\u5c04\u5f71\u53d8\u6362\u8868\u793a \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u6709\u5e73\u79fb\u8fd0\u52a8\uff0c\u4f46\u6807\u5b9a\u4e0d\u53d8\uff0c\u5219\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362\u4e0b\u91cd\u6784 \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u9664\u4e86\u7126\u8ddd\u5916\u90fd\u4ee5\u6807\u5b9a\uff0c\u5219\u4ecd\u7136\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u4e0b\u91cd\u6784 \u5c04\u5f71\u91cd\u6784\u5b9a\u7406 \u00b6 \u5982\u679c\u4e24\u5e45\u89c6\u56fe\u7684\u4e00\u4e2a\u70b9\u5bf9\u5e94\u96c6\u552f\u4e00\u5730\u786e\u5b9a\u4e86\u57fa\u672c\u77e9\u9635\uff0c\u5219\u666f\u7269\u548c\u6444\u50cf\u673a\u53ef\u4ee5\u4ec5\u7531\u8fd9\u4e9b\u5bf9\u5e94\u91cd\u6784\uff0c\u800c\u4e14\u7531\u8fd9\u4e9b\u5bf9\u5e94\u4ea7\u751f\u7684\u4efb\u4f55\u4e24\u4e2a\u91cd\u6784\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684 * \u5c04\u5f71\u91cd\u6784\u5b9a\u5b9a\u7406 \uff1a\u5047\u5b9a \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u70b9\u4e4b\u95f4\u5bf9\u5e94\u7684\u96c6\u5408\u800c\u4e14\u57fa\u672c\u77e9\u9635 F \u7531\u6761\u4ef6 \\(\\mathbf{x}_i^{\\prime \\top} F \\mathbf{x}_i=0\\) \uff08\u5bf9\u6240\u6709 i \u6210\u7acb\uff09\u552f\u4e00\u5730\u786e\u5b9a\u3002\u4ee4 \\((P_1,P_1^\\prime,\\{\\mathbf{X}_{1i}\\})\\) \u548c \\((P_2,P_2^\\prime,\\{\\mathbf{X}_{2i}\\})\\) \u4e3a\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u4e24\u4e2a\u91cd\u6784\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u77e9\u9635 H \u4f7f\u5f97 \\(P_2=P_1H^{-1},P_2^\\prime=P_1^\\prime H^{-1}\\) \u5e76\u4e14\u9664\u4e86\u4f7f\u5f97 \\(F\\mathbf{x}_i=F^\\top \\mathbf{x}_i^\\prime=\\mathbf{0}\\) \u7684\u90a3\u4e9b i \u5916\uff0c\u5bf9\u5176\u4f59\u6bcf\u4e2a i \u90fd\u6709 \\(\\mathbf{X}_{2i}=H\\mathbf{X}_{1i}\\) \u5206\u5c42\u91cd\u6784 \u00b6 \u4eff\u5c04\u91cd\u6784 \u00b6 \u4eff\u5c04\u91cd\u6784\u7684\u672c\u8d28\u662f\u7528\u67d0\u4e9b\u65b9\u6cd5\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u56e0\u4e3a\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\u7b49\u4ef7\u4e8e\u4eff\u5c04\u91cd\u6784\u3002\u5bfb\u627e\u4f7f \\(\\pi\\) \u6620\u5c04\u5230 \\((0,0,0,1)^\\top\\) \uff0c\u53ef\u4ee5\u628a \\(H^{-\\top}\\) \u4f5c\u4e3a Houscholder \u77e9\u9635\u6765\u8ba1\u7b97 \u5e73\u79fb\u8fd0\u52a8 \u6444\u50cf\u673a\u4f5c\u7eaf\u5e73\u79fb\u8fd0\u52a8\u65f6\uff0c\u53ef\u4ee5\u7531\u4e24\u5e45\u89c6\u56fe\u5b9e\u73b0\u4eff\u5c04\u91cd\u6784\u3002\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u4e00\u70b9 \\(\\mathbf{X}\\) \u5728\u7531\u6444\u50cf\u673a\u5e73\u79fb\u6240\u4ea7\u751f\u7684\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u540c\u4e00\u70b9\u3002\u7ed9\u5b9a\u4e00\u4e2a\u5c04\u5f71\u91cd\u6784\uff0c\u53ef\u4ee5\u91cd\u6784\u5bf9\u5e94\u4e8e\u5339\u914d \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u70b9 \\(\\mathbf{X}_i\\) \u3002\u70b9 \\(\\mathbf{X}_i\\) \u5c06\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u3002\u4ece\u4e09\u7ec4\u8fd9\u6837\u7684\u70b9\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\u2014\u2014\u8db3\u591f\u552f\u4e00\u5730\u628a\u5b83\u786e\u5b9a \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u4e14\u5185\u53c2\u4fdd\u6301\u4e0d\u53d8\u7684\u4e00\u4e2a\u7eaf\u5e73\u79fb\u8fd0\u52a8\uff0c\u5219 \\(F=[\\mathbf{e}]_\\times = [\\mathbf{e}^\\prime]_\\times\\) \uff0c\u5e76\u4e14\u4f5c\u4e3a\u4eff\u5c04\u91cd\u6784\u53ef\u9009\u7684\u4e24\u4e2a\u6444\u50cf\u673a\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[I|\\mathbf{e}^\\prime]\\) \u666f\u7269\u7ea6\u675f \uff1a\u666f\u7269\u7ea6\u675f\u6216\u6761\u4ef6\u4e5f\u53ef\u4ee5\u7528\u6765\u83b7\u5f97\u4eff\u5c04\u91cd\u6784\uff0c\u53ea\u8981\u80fd\u591f\u8fa8\u8ba4\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\uff0c\u8be5\u5e73\u9762\u5c31\u53ef\u4ee5\u8fa8\u8ba4\uff0c\u5e76\u4e14\u8be5\u91cd\u6784\u53ef\u4ee5\u53d8\u6362\u5230\u4eff\u5c04\u91cd\u6784 \u5e73\u884c\u76f4\u7ebf \uff1a\u6700\u660e\u663e\u7684\u6761\u4ef6\u662f\u77e5\u9053\u67d0\u4e9b 3D \u76f4\u7ebf\u5b9e\u9645\u662f\u5e73\u884c\u7684\u3002\u7a7a\u95f4\u4e24\u6761\u5e73\u884c\u76f4\u7ebf\u7684\u4ea4\u70b9\u7ed9\u51fa\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e00\u4e2a\u70b9\uff0c\u8be5\u4ea4\u70b9\u7684\u56fe\u50cf\u662f\u8fd9\u5bf9\u5e73\u884c\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4e14\u662f\u4e24\u6761\u50cf\u76f4\u7ebf\u7684\u4ea4\u70b9\u3002\u5047\u8bbe\u5728\u666f\u7269\u4e2d\u80fd\u591f\u786e\u5b9a\u4e09\u5bf9\u5e73\u884c\u76f4\u7ebf\u3002\u6bcf\u5bf9\u76f8\u4ea4\u4e8e\u65e0\u7a77\u8fdc\u5e73\u800c\u4e0a\u7684\u4e00\u70b9\uff0c\u5982\u679c\u6bcf\u5bf9\u6709\u4e0d\u540c\u7684\u65b9\u5411\uff0c\u5219\u4e09\u70b9\u5c06\u4e0d\u540c\u3002\u56e0\u4e3a\u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762\uff0c\u6545\u8fd9\u4e2a\u4fe1\u606f\u8db3\u591f\u786e\u5b9a\u5e73\u9762 \\(\\pi\\) \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4\u7387 \uff1a\u8fd0\u52a8\u666f\u7269\u4eff\u5c04\u957f\u5ea6\u6bd4\u7387\u4e0d\u53d8\u7684\u77e5\u8bc6\u8ba1\u7b97\u6d88\u5f71\u70b9 \u65e0\u7a77\u5355\u5e94 \uff1a\u5982\u679c\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784\u5df2\u5f97\u5230\u5e76\u4e14\u5176\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M^\\prime|\\mathbf{e}^\\prime]\\) \uff0c\u5219\u65e0\u7a77\u5355\u5e94\u662f \\(H_\\infty=M^\\prime\\) \u3002\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u5df2\u5f97\u5230\u65e0\u7a77\u5355\u5e94 \\(H_\\infty\\) \uff0c\u5219\u4eff\u5c04\u91cd\u6784\u7684\u6444\u50cf\u673a\u53ef\u4ee5\u53d6\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[H_\\infty|\\mathbf{e}^\\prime]\\) \u5176\u4e2d\u4e00\u4e2a\u662f\u4eff\u5c04\u6444\u50cf\u673a\u7684\u60c5\u5f62 \uff1a\u82e5 \\((P,P^\\prime,\\{\\mathbf{X}_i\\})\\) \u662f\u4ece\u4e00\u70b9\u5bf9\u5e94\u96c6\u5f97\u5230\u7684\u5c04\u5f71\u91cd\u6784\u4e14 \\(P=[I|\\mathbf{0}]\\) \u3002\u82e5\u5df2\u77e5 \\(P\\) \u4e8b\u5b9e\u4e0a\u662f\u4e00\u4e2a\u4eff\u5c04\u6444\u50cf\u673a\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u4ea4\u6362 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u6700\u540e\u4e24\u4e2a\u5217\u548c\u6bcf\u4e00\u4e2a \\(\\mathbf{X}_i\\) \u7684\u6700\u540e\u4e24\u4e2a\u5750\u6807\u800c\u5f97\u5230\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784 \u5ea6\u91cf\u91cd\u6784 \u00b6 \u4eff\u5c04\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u800c\u5ea6\u6700\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u82e5\u5df2\u77e5\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u67d0\u5e45\u56fe\u50cf\u4e2d\u7684\u50cf\u662f \\(\\omega\\) \uff0c\u4e14\u5df2\u77e5\u4eff\u5c04\u91cd\u6784\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[M|\\mathbf{m}]\\) \uff0c\u5219\u7528\u5f62\u5982 \\(H=\\begin{bmatrix} A^{-1} & \\\\ & 1 \\end{bmatrix}\\) \u7684 3D \u53d8\u6362\uff0c\u53ef\u4ee5\u628a\u4eff\u5c04\u91cd\u6784\u53d8\u6362\u5230\u5ea6\u91cf\u91cd\u6784\uff0c\u5176\u4e2d \\(A\\) \u7531\u65b9\u7a0b \\(AA^\\top=(M^\\top \\omega M)^{-1}\\) \u7684 Cholesky \u5206\u89e3\u5f97\u5230 Cholesky \u5206\u89e3 Cholesky \u5206\u89e3\u662f\u628a\u4e00\u4e2a\u5bf9\u79f0\u6b63\u5b9a\u7684\u77e9\u9635\u8868\u793a\u6210\u4e00\u4e2a\u4e0b\u4e09\u89d2\u77e9\u9635 \\(L\\) \u548c\u5176\u8f6c\u7f6e\u7684\u4e58\u79ef\u7684\u5206\u89e3\u3002\u5b83\u8981\u6c42\u77e9\u9635\u7684\u6240\u6709\u7279\u5f81\u503c\u5fc5\u987b\u5927\u4e8e\u96f6\uff0c\u6545\u5206\u89e3\u7684\u4e0b\u4e09\u89d2\u7684\u5bf9\u89d2\u5143\u4e5f\u662f\u5927\u4e8e\u96f6\u7684\u3002Cholesky \u5206\u89e3\u6cd5\u53c8\u79f0\u5e73\u65b9\u6839\u6cd5\uff0c\u662f\u5f53 \\(A\\) \u4e3a\u5b9e\u5bf9\u79f0\u6b63\u5b9a\u77e9\u9635\u65f6\uff0c \\(LU\\) \u4e09\u89d2\u5206\u89e3\u6cd5\u7684\u53d8\u5f62\u3002 \u666f\u7269\u6b63\u4ea4\u7684\u7ea6\u675f \uff1a\u666f\u7269\u7684\u6b63\u4ea4\u76f4\u7ebf\u7684\u4e00\u5bf9\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e00\u4e2a\u7ebf\u6027\u7ea6\u675f: \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2 = 0\\) \u3002\u7c7b\u4f3c\u5730\uff0c\u6765\u81ea\u4e00\u4e2a\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u548c\u4e0e\u4e4b\u5782\u76f4\u7684\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \\(\\mathbf{l}\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e24\u4e2a\u7ea6\u675f \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \uff0c\u4e00\u4e2a\u5e38\u7528\u7684\u4f8b\u5b50\u662f\u5782\u76f4\u65b9\u5411\u7684\u6d88\u5f71\u70b9\u548c\u6c34\u5e73\u5730\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \u5df2\u77e5\u5185\u53c2\u6570\u7684\u7ea6\u675f \uff1a\u5982\u679c\u6444\u50cf\u673a\u77e9\u9635\u7684\u6807\u5b9a\u77e9\u9635\u7b49\u4e8e \\(K\\) \uff0c\u5219\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u50cf\u662f \\(\\omega=K^{-\\top}K^{-1}\\) \u3002\u56e0\u6b64\u5305\u62ec\u5728 \\(K\\) \u4e2d\u7684\u6444\u50cf\u673a\u5185\u53c2\u6570\u4fe1\u606f\u53ef\u4ee5\u7528\u6765\u7ea6\u675f\u6216\u786e\u5b9a \\(\\omega\\) \u7684\u5143\u7d20\u3002\u5728\u5df2\u77e5 \\(K\\) \u7684\u626d\u66f2\u56e0\u5b50\u4e3a\u96f6\uff08 \\(s=0\\) \uff09\u65f6\u6709 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u82e5\u50cf\u7d20\u8fd8\u662f\u6b63\u65b9\u5f62\uff08\u96f6\u626d\u66f2\u53c2\u6570\u4e14 \\(\\alpha_x=\\alpha_y\\) \uff09\uff0c\u5219 \\(\\omega_{11}=\\omega_{22}\\) \u540c\u4e00\u6444\u50cf\u673a\u5728\u591a\u5e45\u56fe\u50cf\u4e2d\u7684\u7ea6\u675f \uff1a\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4e00\u4e2a\u6027\u8d28\u662f\u5b83\u5728\u56fe\u50cf\u4e0a\u7684\u6295\u5f71\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u800c\u4e0d\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u4f4d\u7f6e\u548c\u65b9\u5411\u3002\u5f53\u4e24\u4e2a\u6444\u50cf\u673a\u5177\u6709\u76f8\u540c\u7684\u6807\u5b9a\u77e9\u9635\u65f6(\u901a\u5e38\u610f\u5473\u7740\u540c\u4e00\u6444\u50cf\u673a\u5728\u4e0d\u540c\u4f4d\u7f6e\u62cd\u6444\u7684\u4e24\u5e45\u56fe\u50cf)\u5219\u6709 \\(\\omega=\\omega^\\prime\\) \uff0c\u5373\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u76f8\u540c\u7684\uff0c\u7ed9\u5b9a\u8db3\u591f\u591a\u7684\u56fe\u50cf\uff0c\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u6027\u8d28\u4ece\u4eff\u5c04\u91cd\u6784\u5f97\u5230\u5ea6\u91cf\u91cd\u6784 \u5229\u7528 \\(\\omega\\) \u76f4\u63a5\u5ea6\u91cf\u91cd\u6784 \u00b6 \u6700\u660e\u663e\u7684\u65b9\u6cd5\u662f\u5229\u7528IAC\uff08\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\uff09\u6765\u8ba1\u7b97\u6bcf\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5df1\u77e5\u6807\u5b9a\u4e0b\u7684\u91cd\u6784 \u53e6\u4e00\u4e2a\u66f4\u6982\u5ff5\u6027\u7684\u65b9\u6cd5\u662f\u8fd0\u7528IAC\u7684\u4fe1\u606f\u76f4\u63a5\u786e\u5b9a\u65e0\u7a77\u8fdc\u5e73\u9762\u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u76f4\u63a5\u91cd\u6784\u2014\u2014\u5229\u7528\u5730\u9762\u77e5\u8bc6 \u00b6 \u5728\u5c04\u5f71\u91cd\u6784\u4e0b\uff0c\u63a7\u5236\u70b9 \\(\\{\\mathbf{X}_i\\}\\) \u7684 3D \u4f4d\u7f6e\u53ef\u4ee5\u6709\u5b83\u4eec\u56fe\u50cf\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u6765\u8ba1\u7b97\u3002\u56e0\u4e3a\u8be5\u5c04\u5f71\u91cd\u6784\u901a\u8fc7\u4e00\u4e2a\u5355\u5e94\u8054\u7cfb\u4e8e\u771f\u6b63\u7684\u91cd\u6784\uff1a \\(\\mathbf{X}_{Ei}=H\\mathbf{X}_i, i=1,...,n\\) \u6bcf\u7ec4\u70b9\u5bf9\u5e94\u63d0\u4f9b\u5173\u4e8e H \u5143\u7d20\u7684\u4e09\u4e2a\u72ec\u7acb\u7ebf\u6027\u65b9\u7a0b\u3002\u56e0\u4e3a H \u6709 15 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6545\u82e5\u63d0\u4f9b \\(n \\ge 5\\) \u7ec4\uff08\u4e14\u6ca1\u6709\u56db\u4e2a\u63a7\u5236\u70b9\u662f\u5171\u9762\u7684\uff09\u70b9\u5bf9\u5e94\uff0c\u4fbf\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7ebf\u6027\u89e3 \u53e6\u4e00\u79cd\u65b9\u6cd5\u53ef\u4ee5\u4e0d\u8ba1\u7b97 \\(\\mathbf{X}_i\\) \u800c\u901a\u8fc7\u628a\u5df2\u77e5\u7684\u5730\u9762\u63a7\u5236\u70b9\u76f4\u63a5\u4e0e\u56fe\u50cf\u7684\u5ea6\u91cf\u76f8\u8054\u7cfb\u7684\u9014\u5f84\u6765\u8ba1\u7b97 H\u3002\u56e0\u6b64\u7c7b\u4f3c\u4e8e\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635\u7684 \\(DLT\\) \u7b97\u6cd5\uff1a \\(\\mathbf{x}_i = PH^{-1} \\mathbf{X}_{Ei}\\)","title":"\u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#3d","text":"\u7ea6 2125 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u91cd\u6784\u7684\u4efb\u52a1\u662f\u6c42\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \uff0c\u4ee5\u53ca 3D \u4e2d\u7684\u70b9 \\(\\mathbf{X}_i\\) \uff0c\u4f7f\u5f97\u5bf9\u6240\u6709 i\uff0c\u6709 \\[ \\mathbf{x}_i=P \\mathbf{X}_i \\ \\ \\ \\ \\ \\ \\mathbf{x}_i^\\prime=P^\\prime \\mathbf{X}_i \\]","title":"\u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_1","text":"\u7531\u4e24\u89c6\u56fe\u91cd\u6784\u7684\u4e00\u79cd\u65b9\u6cd5\uff1a \u7531\u5bf9\u5e94\u70b9\u8ba1\u7b97\u57fa\u672c\u77e9\u9635 \u7531\u57fa\u672c\u77e9\u9635\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 \u9488\u5bf9\u6bcf\u7ec4\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u7a7a\u95f4\u4e2d\u6620\u5c04\u5230\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5230\u70b9","title":"\u91cd\u6784\u65b9\u6cd5\u6982\u8ff0"},{"location":"cv/mvg/3dr-camera-structure/#_2","text":"\u82e5\u6ca1\u6709\u666f\u7269\u5728\u67d0\u4e2a 3D \u5750\u6807\u7cfb\u4e0b\u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u4e00\u822c\u4e0d\u53ef\u80fd\u4ece\u4e00\u5bf9\u89c6\u56fe\uff08\u6216\u4e8b\u5b9e\u4e0a\u4ece\u4efb\u610f\u6570\u76ee\u7684\u89c6\u56fe\uff09\u91cd\u6784\u8be5\u666f\u7269\u7684\u7edd\u5bf9\u4f4d\u7f6e\u548c\u671d\u5411\u3002\u4ec5\u7531\u56fe\u50cf\u6765\u786e\u5b9a\u666f\u7269\u5c31\u8981\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\uff08\u65cb\u8f6c\u3001\u5e73\u79fb\u548c\u7f29\u653e\uff09 \u5c04\u5f71\u591a\u4e49\u6027 \uff1a\u5982\u679c\u65e2\u4e0d\u77e5\u9053\u4efb\u4f55\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u4e5f\u4e0d\u77e5\u9053\u4e00\u4e2a\u6444\u50cf\u673a\u4e0e\u53e6\u4e00\u4e2a\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u90a3\u4e48\u91cd\u6784\u7684\u591a\u4e49\u6027\u7531\u4e00\u4e2a\u4efb\u610f\u5c04\u5f71\u53d8\u6362\u8868\u793a \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u6709\u5e73\u79fb\u8fd0\u52a8\uff0c\u4f46\u6807\u5b9a\u4e0d\u53d8\uff0c\u5219\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362\u4e0b\u91cd\u6784 \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u9664\u4e86\u7126\u8ddd\u5916\u90fd\u4ee5\u6807\u5b9a\uff0c\u5219\u4ecd\u7136\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u4e0b\u91cd\u6784","title":"\u91cd\u6784\u7684\u591a\u4e49\u6027"},{"location":"cv/mvg/3dr-camera-structure/#_3","text":"\u5982\u679c\u4e24\u5e45\u89c6\u56fe\u7684\u4e00\u4e2a\u70b9\u5bf9\u5e94\u96c6\u552f\u4e00\u5730\u786e\u5b9a\u4e86\u57fa\u672c\u77e9\u9635\uff0c\u5219\u666f\u7269\u548c\u6444\u50cf\u673a\u53ef\u4ee5\u4ec5\u7531\u8fd9\u4e9b\u5bf9\u5e94\u91cd\u6784\uff0c\u800c\u4e14\u7531\u8fd9\u4e9b\u5bf9\u5e94\u4ea7\u751f\u7684\u4efb\u4f55\u4e24\u4e2a\u91cd\u6784\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684 * \u5c04\u5f71\u91cd\u6784\u5b9a\u5b9a\u7406 \uff1a\u5047\u5b9a \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u70b9\u4e4b\u95f4\u5bf9\u5e94\u7684\u96c6\u5408\u800c\u4e14\u57fa\u672c\u77e9\u9635 F \u7531\u6761\u4ef6 \\(\\mathbf{x}_i^{\\prime \\top} F \\mathbf{x}_i=0\\) \uff08\u5bf9\u6240\u6709 i \u6210\u7acb\uff09\u552f\u4e00\u5730\u786e\u5b9a\u3002\u4ee4 \\((P_1,P_1^\\prime,\\{\\mathbf{X}_{1i}\\})\\) \u548c \\((P_2,P_2^\\prime,\\{\\mathbf{X}_{2i}\\})\\) \u4e3a\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u4e24\u4e2a\u91cd\u6784\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u77e9\u9635 H \u4f7f\u5f97 \\(P_2=P_1H^{-1},P_2^\\prime=P_1^\\prime H^{-1}\\) \u5e76\u4e14\u9664\u4e86\u4f7f\u5f97 \\(F\\mathbf{x}_i=F^\\top \\mathbf{x}_i^\\prime=\\mathbf{0}\\) \u7684\u90a3\u4e9b i \u5916\uff0c\u5bf9\u5176\u4f59\u6bcf\u4e2a i \u90fd\u6709 \\(\\mathbf{X}_{2i}=H\\mathbf{X}_{1i}\\)","title":"\u5c04\u5f71\u91cd\u6784\u5b9a\u7406"},{"location":"cv/mvg/3dr-camera-structure/#_4","text":"","title":"\u5206\u5c42\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_5","text":"\u4eff\u5c04\u91cd\u6784\u7684\u672c\u8d28\u662f\u7528\u67d0\u4e9b\u65b9\u6cd5\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u56e0\u4e3a\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\u7b49\u4ef7\u4e8e\u4eff\u5c04\u91cd\u6784\u3002\u5bfb\u627e\u4f7f \\(\\pi\\) \u6620\u5c04\u5230 \\((0,0,0,1)^\\top\\) \uff0c\u53ef\u4ee5\u628a \\(H^{-\\top}\\) \u4f5c\u4e3a Houscholder \u77e9\u9635\u6765\u8ba1\u7b97 \u5e73\u79fb\u8fd0\u52a8 \u6444\u50cf\u673a\u4f5c\u7eaf\u5e73\u79fb\u8fd0\u52a8\u65f6\uff0c\u53ef\u4ee5\u7531\u4e24\u5e45\u89c6\u56fe\u5b9e\u73b0\u4eff\u5c04\u91cd\u6784\u3002\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u4e00\u70b9 \\(\\mathbf{X}\\) \u5728\u7531\u6444\u50cf\u673a\u5e73\u79fb\u6240\u4ea7\u751f\u7684\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u540c\u4e00\u70b9\u3002\u7ed9\u5b9a\u4e00\u4e2a\u5c04\u5f71\u91cd\u6784\uff0c\u53ef\u4ee5\u91cd\u6784\u5bf9\u5e94\u4e8e\u5339\u914d \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u70b9 \\(\\mathbf{X}_i\\) \u3002\u70b9 \\(\\mathbf{X}_i\\) \u5c06\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u3002\u4ece\u4e09\u7ec4\u8fd9\u6837\u7684\u70b9\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\u2014\u2014\u8db3\u591f\u552f\u4e00\u5730\u628a\u5b83\u786e\u5b9a \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u4e14\u5185\u53c2\u4fdd\u6301\u4e0d\u53d8\u7684\u4e00\u4e2a\u7eaf\u5e73\u79fb\u8fd0\u52a8\uff0c\u5219 \\(F=[\\mathbf{e}]_\\times = [\\mathbf{e}^\\prime]_\\times\\) \uff0c\u5e76\u4e14\u4f5c\u4e3a\u4eff\u5c04\u91cd\u6784\u53ef\u9009\u7684\u4e24\u4e2a\u6444\u50cf\u673a\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[I|\\mathbf{e}^\\prime]\\) \u666f\u7269\u7ea6\u675f \uff1a\u666f\u7269\u7ea6\u675f\u6216\u6761\u4ef6\u4e5f\u53ef\u4ee5\u7528\u6765\u83b7\u5f97\u4eff\u5c04\u91cd\u6784\uff0c\u53ea\u8981\u80fd\u591f\u8fa8\u8ba4\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\uff0c\u8be5\u5e73\u9762\u5c31\u53ef\u4ee5\u8fa8\u8ba4\uff0c\u5e76\u4e14\u8be5\u91cd\u6784\u53ef\u4ee5\u53d8\u6362\u5230\u4eff\u5c04\u91cd\u6784 \u5e73\u884c\u76f4\u7ebf \uff1a\u6700\u660e\u663e\u7684\u6761\u4ef6\u662f\u77e5\u9053\u67d0\u4e9b 3D \u76f4\u7ebf\u5b9e\u9645\u662f\u5e73\u884c\u7684\u3002\u7a7a\u95f4\u4e24\u6761\u5e73\u884c\u76f4\u7ebf\u7684\u4ea4\u70b9\u7ed9\u51fa\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e00\u4e2a\u70b9\uff0c\u8be5\u4ea4\u70b9\u7684\u56fe\u50cf\u662f\u8fd9\u5bf9\u5e73\u884c\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4e14\u662f\u4e24\u6761\u50cf\u76f4\u7ebf\u7684\u4ea4\u70b9\u3002\u5047\u8bbe\u5728\u666f\u7269\u4e2d\u80fd\u591f\u786e\u5b9a\u4e09\u5bf9\u5e73\u884c\u76f4\u7ebf\u3002\u6bcf\u5bf9\u76f8\u4ea4\u4e8e\u65e0\u7a77\u8fdc\u5e73\u800c\u4e0a\u7684\u4e00\u70b9\uff0c\u5982\u679c\u6bcf\u5bf9\u6709\u4e0d\u540c\u7684\u65b9\u5411\uff0c\u5219\u4e09\u70b9\u5c06\u4e0d\u540c\u3002\u56e0\u4e3a\u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762\uff0c\u6545\u8fd9\u4e2a\u4fe1\u606f\u8db3\u591f\u786e\u5b9a\u5e73\u9762 \\(\\pi\\) \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4\u7387 \uff1a\u8fd0\u52a8\u666f\u7269\u4eff\u5c04\u957f\u5ea6\u6bd4\u7387\u4e0d\u53d8\u7684\u77e5\u8bc6\u8ba1\u7b97\u6d88\u5f71\u70b9 \u65e0\u7a77\u5355\u5e94 \uff1a\u5982\u679c\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784\u5df2\u5f97\u5230\u5e76\u4e14\u5176\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M^\\prime|\\mathbf{e}^\\prime]\\) \uff0c\u5219\u65e0\u7a77\u5355\u5e94\u662f \\(H_\\infty=M^\\prime\\) \u3002\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u5df2\u5f97\u5230\u65e0\u7a77\u5355\u5e94 \\(H_\\infty\\) \uff0c\u5219\u4eff\u5c04\u91cd\u6784\u7684\u6444\u50cf\u673a\u53ef\u4ee5\u53d6\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[H_\\infty|\\mathbf{e}^\\prime]\\) \u5176\u4e2d\u4e00\u4e2a\u662f\u4eff\u5c04\u6444\u50cf\u673a\u7684\u60c5\u5f62 \uff1a\u82e5 \\((P,P^\\prime,\\{\\mathbf{X}_i\\})\\) \u662f\u4ece\u4e00\u70b9\u5bf9\u5e94\u96c6\u5f97\u5230\u7684\u5c04\u5f71\u91cd\u6784\u4e14 \\(P=[I|\\mathbf{0}]\\) \u3002\u82e5\u5df2\u77e5 \\(P\\) \u4e8b\u5b9e\u4e0a\u662f\u4e00\u4e2a\u4eff\u5c04\u6444\u50cf\u673a\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u4ea4\u6362 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u6700\u540e\u4e24\u4e2a\u5217\u548c\u6bcf\u4e00\u4e2a \\(\\mathbf{X}_i\\) \u7684\u6700\u540e\u4e24\u4e2a\u5750\u6807\u800c\u5f97\u5230\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784","title":"\u4eff\u5c04\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_6","text":"\u4eff\u5c04\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u800c\u5ea6\u6700\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u82e5\u5df2\u77e5\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u67d0\u5e45\u56fe\u50cf\u4e2d\u7684\u50cf\u662f \\(\\omega\\) \uff0c\u4e14\u5df2\u77e5\u4eff\u5c04\u91cd\u6784\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[M|\\mathbf{m}]\\) \uff0c\u5219\u7528\u5f62\u5982 \\(H=\\begin{bmatrix} A^{-1} & \\\\ & 1 \\end{bmatrix}\\) \u7684 3D \u53d8\u6362\uff0c\u53ef\u4ee5\u628a\u4eff\u5c04\u91cd\u6784\u53d8\u6362\u5230\u5ea6\u91cf\u91cd\u6784\uff0c\u5176\u4e2d \\(A\\) \u7531\u65b9\u7a0b \\(AA^\\top=(M^\\top \\omega M)^{-1}\\) \u7684 Cholesky \u5206\u89e3\u5f97\u5230 Cholesky \u5206\u89e3 Cholesky \u5206\u89e3\u662f\u628a\u4e00\u4e2a\u5bf9\u79f0\u6b63\u5b9a\u7684\u77e9\u9635\u8868\u793a\u6210\u4e00\u4e2a\u4e0b\u4e09\u89d2\u77e9\u9635 \\(L\\) \u548c\u5176\u8f6c\u7f6e\u7684\u4e58\u79ef\u7684\u5206\u89e3\u3002\u5b83\u8981\u6c42\u77e9\u9635\u7684\u6240\u6709\u7279\u5f81\u503c\u5fc5\u987b\u5927\u4e8e\u96f6\uff0c\u6545\u5206\u89e3\u7684\u4e0b\u4e09\u89d2\u7684\u5bf9\u89d2\u5143\u4e5f\u662f\u5927\u4e8e\u96f6\u7684\u3002Cholesky \u5206\u89e3\u6cd5\u53c8\u79f0\u5e73\u65b9\u6839\u6cd5\uff0c\u662f\u5f53 \\(A\\) \u4e3a\u5b9e\u5bf9\u79f0\u6b63\u5b9a\u77e9\u9635\u65f6\uff0c \\(LU\\) \u4e09\u89d2\u5206\u89e3\u6cd5\u7684\u53d8\u5f62\u3002 \u666f\u7269\u6b63\u4ea4\u7684\u7ea6\u675f \uff1a\u666f\u7269\u7684\u6b63\u4ea4\u76f4\u7ebf\u7684\u4e00\u5bf9\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e00\u4e2a\u7ebf\u6027\u7ea6\u675f: \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2 = 0\\) \u3002\u7c7b\u4f3c\u5730\uff0c\u6765\u81ea\u4e00\u4e2a\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u548c\u4e0e\u4e4b\u5782\u76f4\u7684\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \\(\\mathbf{l}\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e24\u4e2a\u7ea6\u675f \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \uff0c\u4e00\u4e2a\u5e38\u7528\u7684\u4f8b\u5b50\u662f\u5782\u76f4\u65b9\u5411\u7684\u6d88\u5f71\u70b9\u548c\u6c34\u5e73\u5730\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \u5df2\u77e5\u5185\u53c2\u6570\u7684\u7ea6\u675f \uff1a\u5982\u679c\u6444\u50cf\u673a\u77e9\u9635\u7684\u6807\u5b9a\u77e9\u9635\u7b49\u4e8e \\(K\\) \uff0c\u5219\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u50cf\u662f \\(\\omega=K^{-\\top}K^{-1}\\) \u3002\u56e0\u6b64\u5305\u62ec\u5728 \\(K\\) \u4e2d\u7684\u6444\u50cf\u673a\u5185\u53c2\u6570\u4fe1\u606f\u53ef\u4ee5\u7528\u6765\u7ea6\u675f\u6216\u786e\u5b9a \\(\\omega\\) \u7684\u5143\u7d20\u3002\u5728\u5df2\u77e5 \\(K\\) \u7684\u626d\u66f2\u56e0\u5b50\u4e3a\u96f6\uff08 \\(s=0\\) \uff09\u65f6\u6709 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u82e5\u50cf\u7d20\u8fd8\u662f\u6b63\u65b9\u5f62\uff08\u96f6\u626d\u66f2\u53c2\u6570\u4e14 \\(\\alpha_x=\\alpha_y\\) \uff09\uff0c\u5219 \\(\\omega_{11}=\\omega_{22}\\) \u540c\u4e00\u6444\u50cf\u673a\u5728\u591a\u5e45\u56fe\u50cf\u4e2d\u7684\u7ea6\u675f \uff1a\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4e00\u4e2a\u6027\u8d28\u662f\u5b83\u5728\u56fe\u50cf\u4e0a\u7684\u6295\u5f71\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u800c\u4e0d\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u4f4d\u7f6e\u548c\u65b9\u5411\u3002\u5f53\u4e24\u4e2a\u6444\u50cf\u673a\u5177\u6709\u76f8\u540c\u7684\u6807\u5b9a\u77e9\u9635\u65f6(\u901a\u5e38\u610f\u5473\u7740\u540c\u4e00\u6444\u50cf\u673a\u5728\u4e0d\u540c\u4f4d\u7f6e\u62cd\u6444\u7684\u4e24\u5e45\u56fe\u50cf)\u5219\u6709 \\(\\omega=\\omega^\\prime\\) \uff0c\u5373\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u76f8\u540c\u7684\uff0c\u7ed9\u5b9a\u8db3\u591f\u591a\u7684\u56fe\u50cf\uff0c\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u6027\u8d28\u4ece\u4eff\u5c04\u91cd\u6784\u5f97\u5230\u5ea6\u91cf\u91cd\u6784","title":"\u5ea6\u91cf\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#omega","text":"\u6700\u660e\u663e\u7684\u65b9\u6cd5\u662f\u5229\u7528IAC\uff08\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\uff09\u6765\u8ba1\u7b97\u6bcf\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5df1\u77e5\u6807\u5b9a\u4e0b\u7684\u91cd\u6784 \u53e6\u4e00\u4e2a\u66f4\u6982\u5ff5\u6027\u7684\u65b9\u6cd5\u662f\u8fd0\u7528IAC\u7684\u4fe1\u606f\u76f4\u63a5\u786e\u5b9a\u65e0\u7a77\u8fdc\u5e73\u9762\u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf","title":"\u5229\u7528\\(\\omega\\)\u76f4\u63a5\u5ea6\u91cf\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_7","text":"\u5728\u5c04\u5f71\u91cd\u6784\u4e0b\uff0c\u63a7\u5236\u70b9 \\(\\{\\mathbf{X}_i\\}\\) \u7684 3D \u4f4d\u7f6e\u53ef\u4ee5\u6709\u5b83\u4eec\u56fe\u50cf\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u6765\u8ba1\u7b97\u3002\u56e0\u4e3a\u8be5\u5c04\u5f71\u91cd\u6784\u901a\u8fc7\u4e00\u4e2a\u5355\u5e94\u8054\u7cfb\u4e8e\u771f\u6b63\u7684\u91cd\u6784\uff1a \\(\\mathbf{X}_{Ei}=H\\mathbf{X}_i, i=1,...,n\\) \u6bcf\u7ec4\u70b9\u5bf9\u5e94\u63d0\u4f9b\u5173\u4e8e H \u5143\u7d20\u7684\u4e09\u4e2a\u72ec\u7acb\u7ebf\u6027\u65b9\u7a0b\u3002\u56e0\u4e3a H \u6709 15 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6545\u82e5\u63d0\u4f9b \\(n \\ge 5\\) \u7ec4\uff08\u4e14\u6ca1\u6709\u56db\u4e2a\u63a7\u5236\u70b9\u662f\u5171\u9762\u7684\uff09\u70b9\u5bf9\u5e94\uff0c\u4fbf\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7ebf\u6027\u89e3 \u53e6\u4e00\u79cd\u65b9\u6cd5\u53ef\u4ee5\u4e0d\u8ba1\u7b97 \\(\\mathbf{X}_i\\) \u800c\u901a\u8fc7\u628a\u5df2\u77e5\u7684\u5730\u9762\u63a7\u5236\u70b9\u76f4\u63a5\u4e0e\u56fe\u50cf\u7684\u5ea6\u91cf\u76f8\u8054\u7cfb\u7684\u9014\u5f84\u6765\u8ba1\u7b97 H\u3002\u56e0\u6b64\u7c7b\u4f3c\u4e8e\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635\u7684 \\(DLT\\) \u7b97\u6cd5\uff1a \\(\\mathbf{x}_i = PH^{-1} \\mathbf{X}_{Ei}\\)","title":"\u76f4\u63a5\u91cd\u6784\u2014\u2014\u5229\u7528\u5730\u9762\u77e5\u8bc6"},{"location":"cv/mvg/ag-fm/","text":"\u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 \u00b6 \u7ea6 2754 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u6781\u51e0\u4f55\u662f\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u5185\u5728\u7684\u5c04\u5f71\u51e0\u4f55\uff0c\u72ec\u7acb\u4e8e\u666f\u7269\u7ed3\u6784\uff0c\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u5185\u53c2\u6570\u548c\u76f8\u5bf9\u59ff\u6001 \u57fa\u672c\u77e9\u9635 F \u96c6\u4e2d\u4e86\u8fd9\u4e2a\u5185\u5728\u51e0\u4f55\u7684\u7cbe\u534e\uff0c\u5b83\u662f\u4e00\u4e2a\u79e9\u4e3a 2 \u7684 \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c\u4e00\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u5728\u7b2c\u4e00\u3001\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u50cf\u5206\u522b\u4e3a \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \uff0c\u5219\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u6ee1\u8db3\u5173\u7cfb \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u5bf9\u6781\u51e0\u4f55 \u00b6 \u672c\u8d28\u4e0a\uff0c\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u7684\u5bf9\u6781\u51e0\u4f55\u662f\u56fe\u50cf\u5e73\u9762\u4e0e\u4ee5\u57fa\u7ebf\uff08\u57fa\u7ebf\u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff09\u4e3a\u8f74\u7684\u5e73\u9762\u675f\u7684\u4ea4\u7684\u51e0\u4f55 \u5bf9\u6781\u70b9 \u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff08\u57fa\u7ebf\uff09\u4e0e\u50cf\u5e73\u9762\u7684 \u4ea4\u70b9 \u3002\u7b49\u4ef7\u5730\uff0c\u5bf9\u6781\u70b9\u662f\u5728\u4e00\u5e45\u89c6\u56fe\u4e2d\u53e6\u4e00\u4e2a\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u50cf\u3002\u5b83\u4e5f\u662f\u57fa\u7ebf\uff08\u5e73\u79fb\uff09\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \u5bf9\u6781\u5e73\u9762 \u662f\u4e00\u5f20\u5305\u542b\u57fa\u7ebf\u7684\u5e73\u9762\uff0c\u5b58\u5728\u7740\u5bf9\u6781\u5e73\u9762\u7684\u4e00\u4e2a\u5355\u53c2\u6570\u7c07\uff08\u675f\uff09 \u5bf9\u6781\u7ebf \u662f\u6781\u5e73\u9762\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u7ebf\uff0c\u6240\u6709\u5bf9\u6781\u7ebf\u76f8\u4ea4\u4e8e\u5bf9\u6781\u70b9\uff0c\u4e00\u5f20\u5bf9\u6781\u5e73\u9762\u4e0e\u5de6\u6216\u53f3\u50cf\u5e73\u9762\u76f8\u4ea4\u4e8e\u5bf9\u6781\u7ebf\uff0c\u5e76\u5b9a\u4e49\u4e86\u5bf9\u6781\u7ebf\u4e4b\u95f4\u7684\u5bf9\u5e94 \u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u8fd0\u52a8 \uff1a\u5bf9\u4e8e\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u4f5c\u5e73\u79fb\u4ee5\u53ca\u65cb\u8f6c\u8f74\u5782\u76f4\u56fe\u50cf\u5e73\u9762\u7684\u7279\u6b8a\u8fd0\u52a8\u60c5\u5f62\uff0c\u57fa\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u4f4d\u4e8e\u65e0\u7a77\u8fdc\uff0c\u56e0\u6b64\uff0c\u5bf9\u6781\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u800c\u5bf9\u6781\u7ebf\u662f\u5e73\u884c\u7ebf \u57fa\u672c\u77e9\u9635 F \u00b6 \u57fa\u672c\u77e9\u9635 F \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]\\) \\times H \\pi\uff0c\u5176\u4e2d \\(H_\\pi=P^\\prime P^+\\) \u662f\u4ece\u4e00\u5e45\u56fe\u50cf\u5230\u53e6\u4e00\u5e45\u56fe\u50cf\u901a\u8fc7\u4efb\u610f\u5e73\u9762 \\(\\pi\\) \u7684\u8f6c\u79fb\u6620\u5c04\u3002\u800c\u4e14\uff0c\u56e0\u4e3a \\([\\mathbf{e}^\\prime]_\\times\\) \u7684\u79e9\u4e3a 2 \u548c \\(H_\\pi\\) \u79e9\u4e3a 3\uff0c\u6240\u4ee5 F \u662f\u79e9 2 \u7684\u77e9\u9635 \u5047\u8bbe\u6444\u50cf\u673a\u77e9\u9635\u662f\u4e00\u4e2a\u5df2\u6807\u5b9a\u7684\u53cc\u773c\u88c5\u7f6e\u4e14\u4e16\u754c\u539f\u70b9\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u4e0a\uff1a \\[ F=[\\mathbf{e}^\\prime]_\\times K^\\prime R K^{-1}=K^{\\prime-\\top}[\\mathbf{t}]_\\times RK^{-1}=K^{\\prime -\\top}R[R^\\top \\mathbf{t}]_\\times K^{-1}=K^{\\prime -\\top}RK^\\top [\\mathbf{e}]_\\times \\] \u5bf9\u5e94\u6761\u4ef6 \u00b6 \u5bf9\u4e24\u5e45\u56fe\u50cf\u4e2d\u4efb\u4f55\u4e00\u5bf9\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \uff0c\u57fa\u672c\u77e9\u9635\u90fd\u6ee1\u8db3\u6761\u4ef6 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \\(F\\) \u53ef\u4ee5\u4ece\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8ba1\u7b97\u51fa\u6765\uff0c\u5373 \\(F\\) \u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u6574\u4f53\u5c3a\u5ea6\u56e0\u5b50\u7684\u4e00\u4e00\u4e0b\u7531\u6444\u50cf\u673a\u552f\u4e00\u786e\u5b9a \u57fa\u672c\u77e9\u9635\u7684\u6027\u8d28 \u00b6 \u5047\u8bbe\u4e24\u5e45\u56fe\u50cf\u7531\u4e2d\u5fc3\u4e0d\u91cd\u5408\u7684\u6444\u50cf\u673a\u83b7\u5f97\uff0c\u5219\u57fa\u672c\u77e9\u9635 \\(F\\) \u4e3a\u5bf9\u6240\u6709\u7684\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) ,\u5bf9\u6ee1\u8db3 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u7684\u79e9 2 \u7684\u552f\u4e00\u7684 \\(3 \\times 3\\) \u9f50\u6b21\u77e9\u9635 F \u662f\u79e9 2\u3001\u81ea\u7531\u5ea6 7 \u7684\u9f50\u6b21\u77e9\u9635 \u70b9\u5bf9\u5e94 \uff1a\u5982\u679c \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\uff0c\u90a3\u4e48 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u5bf9\u6781\u7ebf \\(\\mathbf{l}^\\prime=F\\mathbf{x}\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}\\) \u7684\u5bf9\u6781\u7ebf \\(\\mathbf{l}=F^\\top \\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}^\\prime\\) \u7684\u5bf9\u6781\u7ebf \u5bf9\u6781\u70b9 \\(F\\mathbf{e}=\\mathbf{0}\\) \\(F^\\top\\mathbf{e}^\\prime=\\mathbf{0}\\) \u7531\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8fdb\u884c\u8ba1\u7b97 \u4e00\u822c\u6444\u50cf\u673a \uff1a \\(F=[\\mathbf{e}^\\prime]_\\times P^\\prime P^+\\) \uff0c\u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\uff0c \\(\\mathbf{e}^\\prime=P^\\prime \\mathbf{C}\\) \u4e14 \\(P\\mathbf{c}=\\mathbf{0}\\) \u89c4\u8303\u6444\u50cf\u673a \uff1a \\(P=[I|\\mathbf{0}],F=[\\mathbf{e}^\\prime]_\\times M = M^{-\\top}[\\mathbf{e}]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime=\\mathbf{m}\\) \u4e14 \\(\\mathbf{e}=M^{-1}\\mathbf{m}\\) \u975e\u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff1a \\(P=K[I|\\mathbf{0}],P^\\prime=K^\\prime[R|\\mathbf{t}],F=K^{-\\top}[\\mathbf{t}]_\\times RK^{-1}=[K^\\prime \\mathbf{t}]_\\times K^\\prime R K^{-1}=K^{\\prime -\\top} RK^\\top [KR^\\top \\mathbf{t}]_\\times\\) \u8f6c\u7f6e \uff1a\u5982\u679c \\(F\\) \u662f\u6444\u50cf\u673a\u5bf9\u4f5c \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635\uff0c\u5219 \\(F^\\top\\) \u662f\u5176\u53cd\u5e8f\u5bf9 \\((P^\\prime,P)\\) \u7684\u57fa\u672c\u77e9\u9635 \u5bf9\u6781\u7ebf\u5355\u5e94 \u00b6 \u5047\u8bbe \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u5bf9\u6781\u7ebf\uff0c\u4e14 \\(k\\) \u662f\u4e0d\u8fc7\u5bf9\u6781\u70b9 \\(\\mathbf{e}\\) \u7684\u4efb\u4f55\u76f4\u7ebf\uff0c\u5219 \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u95f4\u7684\u5173\u7cfb\u662f \\(\\mathbf{l}^\\prime=F[\\mathbf{k}]_\\times \\mathbf{l}\\) \uff0c\u5bf9\u79f0\u5730\u6709 \\(\\mathbf{l}=F^\\top [\\mathbf{k}^\\prime]_\\times \\mathbf{l}^\\prime\\) \u7531\u7279\u6b8a\u8fd0\u52a8\u4ea7\u751f\u7684\u57fa\u672c\u77e9\u9635 \u00b6 \u7eaf\u5e73\u79fb \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u5e76\u4e14\u5185\u53c2\u4e0d\u53d8\u7684\u7eaf\u5e73\u79fb\uff0c\u53ef\u4ee5\u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u662f \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K[I|\\mathbf{t}]\\) \uff0c\u5219 \\(F=[\\mathbf{e}^\\prime]_\\times KK^{-1}=[\\mathbf{e}^\\prime]_\\times\\) \uff0c\u4ece\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f \\(\\mathbf{x}^\\prime=\\mathbf{x}+K\\mathbf{t}/Z\\) \uff0c\u5176\u4e2d \\(Z\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6\uff08\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u4e3b\u8f74\u4e0a\u6d4b\u91cf\u4ece \\(\\mathbf{X}\\) \u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u8ddd\u79bb\uff09 \u6ce8\u610f\u5728\u7eaf\u5e73\u79fb\u60c5\u5f62\uff0c \\(F=[\\mathbf{e}^\\prime]_\\times\\) \u662f\u53cd\u5bf9\u79f0\u7684\u800c\u4e14\u53ea\u6709 2 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5b83\u4eec\u5bf9\u5e94\u4e8e\u5bf9\u6781\u70b9\u7684\u4f4d\u7f6e \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \u4e0e \\(\\mathbf{e}=\\mathbf{e}^\\prime\\) \u662f\u5171\u7ebf\u7684\uff08\u5047\u8bbe\u628a\u4e24\u5e45\u56fe\u50cf\u53e0\u8d77\u6765\uff09\u3002\u8fd9\u79cd\u5171\u7ebf\u6027\u8d28\u79f0\u4e3a \u81ea\u5bf9\u6781 \uff0c\u5e76\u4e14\u5bf9\u4e8e\u4e00\u822c\u8fd0\u52a8\u4e0d\u6210\u7acb \u4e00\u822c\u8fd0\u52a8 \u7ed9\u5b9a\u4e24\u4e2a\u4efb\u610f\u6444\u50cf\u673a\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6444\u50cf\u673a\u65cb\u8f6c\u4f7f\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u5e73\u884c\u3002\u8be5\u65cb\u8f6c\u53ef\u4ee5\u901a\u8fc7\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u4e00\u4e2a\u5c04\u5f71\u53d8\u6362\u6765\u4eff\u771f\u3002\u9488\u5bf9\u4e24\u5e45\u56fe\u50cf\u7684\u6807\u5b9a\u77e9\u9635\u7684\u5dee\u522b\u8fd8\u53ef\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u8fdb\u4e00\u6b65\u7684\u77eb\u6b63\u3002\u8fd9\u4e24\u6b21\u77eb\u6b63\u7684\u7ed3\u679c\u7b49\u4ef7\u4e8e\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u4f5c\u5c04\u5f71\u53d8\u6362 \\(H\\) \u3002\u5047\u8bbe\u8fd9\u4e9b\u77eb\u6b63\u5df2\u7ecf\u5b8c\u6210\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u7684\u6709\u6548\u5173\u7cfb\u662f\u4e00\u4e2a\u7eaf\u5e73\u79fb\u3002 \u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u4e3a \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K^\\prime[R|\\mathbf{t}]\\) \uff0c\u9700\u8981\u7684\u5c04\u5f71\u53d8\u6362\u662f \\(H=K^\\prime RK^{-1}=H_\\infty\\) \uff0c\u5176\u4e2d \\(H_\\infty\\) \u662f\u65e0\u7a77\u5355\u5e94\uff0c\u4e14 \\(F=[\\mathbf{e}^\\prime]_\\times H_\\infty\\) \u3002\u5219\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u56fe\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f\uff1a \\(\\mathbf{x}^\\prime=K^\\prime RK^{-1}\\mathbf{x}+K^\\prime \\mathbf{t} / Z\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5728\u7eaf\u5e73\u9762\u8fd0\u52a8\u65f6\u65cb\u8f6c\u8f74\u4e0e\u5e73\u79fb\u65b9\u5411\u6b63\u4ea4\u3002\u6b63\u4ea4\u6027\u7ed9\u8fd9\u79cd\u8fd0\u52a8\u589e\u52a0\u4e86\u4e00\u4e2a\u7ea6\u675f\uff0c\u5982\u679c \\(K^\\prime=K\\) \uff0c\u5219 \\(F\\) \u7684\u5bf9\u79f0\u90e8\u5206\u5728\u8fd9\u79cd\u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\u65f6\u7684\u79e9\u4e3a 2\u3002\u4f7f\u5b83\u7684\u81ea\u7531\u5ea6\u4e2a\u6570\u4ece\u4e00\u822c\u8fd0\u52a8\u7684 7 \u4e2a\u964d\u4f4e\u5230\u7eaf\u5e73\u9762\u8fd0\u52a8\u7684 6 \u4e2a \u57fa\u672c\u77e9\u9635\u7684\u51e0\u4f55\u8868\u793a \u00b6 \u57fa\u672c\u77e9\u9635\u7684\u5bf9\u79f0\u548c\u53cd\u5bf9\u79f0\u90e8\u5206\u5206\u522b\u4e3a \\(F_s=(F+F^\\top)/2 \\ \\ \\ F_a=(F-F^\\top)/2\\) \uff0c\u6ee1\u8db3 \\(F=F_s+F_a\\) \u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_s\\) \u662f\u5bf9\u79f0\u7684\u5e76\u4e14\u4e00\u822c\u5730\u79e9\u4e3a 3\uff0c\u5b83\u6709 5 \u4e2a\u81ea\u7531\u5ea6\u5e76\u7b49\u540c\u4e8e\u4e00\u6761\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u79f0\u4e3a Steiner \u4e8c\u6b21\u66f2\u7ebf \u53cd\u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_a\\) \u662f\u53cd\u5bf9\u79f0\u7684\u5e76\u53ef\u4ee5\u8bb0\u4e3a \\(F_a=[\\mathbf{x}_a]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_a\\) \u662f \\(F_a\\) \u5730\u96f6\u77e2\u91cf\u3002\u53cd\u5bf9\u79f0\u90e8\u5206\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u4e14\u7b49\u540c\u4e8e\u70b9 \\(\\mathbf{x}_a\\) \u5bf9\u6781\u7ebf\u5bf9\u5e94 \uff1a\u7531\u4e00\u4e2a\u5355\u5e94\u5173\u8054\u7684\u4e24\u4e2a\u76f4\u7ebf\u675f\uff0c\u5b83\u4eec\u5bf9\u5e94\u76f4\u7ebf\u7684\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf\u3002\u8fd9\u4e24\u4e2a\u675f\u90fd\u662f\u5bf9\u6781\u7ebf\u675f\uff0c\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}\\) \u800c\u53e6\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}^\\prime\\) \u3002\u8fd9\u4e9b\u5bf9\u6781\u7ebf\u7531\u4e00\u4e2a 1D \u5355\u5e94\u76f8\u5173\u8054\u3002\u5176\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e8c\u6b21\u66f2\u7ebf \\(F_s\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\uff0c\u5176\u4e2d \\(F_s\\) \u7684\u79e9\u4e3a 2\u3002\u6b64\u65f6 Steiner \u4e8c\u6b21\u66f2\u7ebf\u662f\u9000\u5316\u7684\uff0c\u5b83\u7b49\u4ef7\u4e8e\u4e24\u6761\u4e0d\u91cd\u5408\u76f4\u7ebf \\(F_s=\\mathbf{l}_h\\mathbf{l}_s^\\top+\\mathbf{l}_s\\mathbf{l}_h^\\top\\) \uff0c \\(F\\) \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]_\\times[\\mathbf{l}_s]_\\times[\\mathbf{e}]_\\times\\) \u4e24\u4e2a\u5bf9\u6781\u70b9\u7684\u5206\u522b\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u548c\u76f4\u7ebf \\(\\mathbf{l}_s\\) \u6062\u590d\u6444\u50cf\u673a\u77e9\u9635 \u00b6 \u5c04\u5f71\u4e0d\u53d8\u6027\u548c\u89c4\u8303\u6444\u50cf\u673a \u00b6 \u5982\u679c H \u662f\u8868\u793a 3 \u7ef4\u5c04\u5f71\u53d8\u6362\u7684\u4e00\u4e2a \\(4 \\times 4\\) \u77e9\u9635\uff0c\u90a3\u4e48\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635 \\((P,P^\\prime)\\) \u548c \\((PH,P^\\prime H)\\) \u7684\u57fa\u672c\u77e9\u9635\u662f\u76f8\u540c\u7684 \u6444\u50cf\u673a\u77e9\u9635\u7684\u89c4\u8303\u5f62\u5f0f \uff1a\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635\u5bf9 \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M|\\mathbf{m}]\\) \u7684\u57fa\u672c\u77e9\u9635\u7b49\u4e8e \\([\\mathbf{m}]_\\times M\\) \u7ed9\u5b9a F \u540e\u7684\u6444\u50cf\u673a\u5c04\u5f71\u591a\u4e49\u6027 \u00b6 \u4ee4 F \u4e3a\u57fa\u672c\u77e9\u9635\u800c \\((P,P^\\prime)\\) \u548c \\((\\tilde{P},\\tilde{P}^\\prime)\\) \u90fd\u662f\u4e0e\u57fa\u672c\u77e9\u9635 F \u5bf9\u5e94\u7684\u4e24\u7ec4\u6444\u50cf\u673a\u77e9\u9635\u5bf9\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u7684 \\(4 \\times 4\\) \u77e9\u9635 H \u4f7f\u5f97 \\(\\tilde{P}=PH\\) \u548c \\(\\tilde{P}=P^\\prime H\\) \u82e5\u79e9\u4e3a 2 \u7684\u77e9\u9635 F \u53ef\u4ee5\u5206\u89e3\u4e3a\u4e24\u4e2a\u4e0d\u540c\u7684\u5f62\u5f0f\uff1a \\(F=[\\mathbf{a}]_\\times A\\) \u548c \\(F =[\\tilde{\\mathbf{a}}]_\\times \\tilde{A}\\) \uff0c\u5219\u5bf9\u67d0\u4e2a\u975e\u96f6\u5e38\u6570 k \u548c 3 \u7ef4\u77e2\u91cf \\(\\mathbf{v}\\) \u6709 \\(\\tilde{\\mathbf{a}}=k\\mathbf{a}\\) \u548c \\(\\tilde{A}=k^{-1}(A+\\mathbf{a} \\mathbf{v}^\\top)\\) \u7ed9\u5b9a F \u6c42\u89c4\u8303\u6444\u50cf\u673a\u5bf9 \u00b6 \u4e00\u4e2a\u975e\u96f6\u77e9\u9635 F \u662f\u5bf9\u5e94\u4e8e\u4e00\u5bf9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u57fa\u672c\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f \\(P^{\\prime \\top}FP\\) \u662f\u53cd\u5bf9\u79f0\u77e9\u9635 \u4ee4 F \u662f\u57fa\u672c\u77e9\u9635\uff0cS \u662f\u4efb\u610f\u53cd\u5bf9\u79f0\u77e9\u9635\u3002\u5b9a\u4e49\u6444\u50cf\u673a\u77e9\u9635\u5bf9\u4e3a\uff1a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[SF|\\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime\\) \u662f\u6ee1\u8db3 \\(\\mathbf{e}^{\\prime \\top}F=\\mathbf{0}\\) \u7684\u5bf9\u6781\u70b9\uff0c\u5e76\u5047\u5b9a\u6240\u5b9a\u4e49\u7684 \\(P^\\prime\\) \u662f\u6709\u6548\u7684\u6444\u50cf\u673a\u77e9\u9635\uff08\u79e9\u4e3a 3\uff09\uff0c\u5219 F \u662f\u5bf9\u5e94\u4e8e \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635 \u57fa\u672c\u77e9\u9635 F \u7684\u6444\u50cf\u673a\u77e9\u9635\u53ef\u4ee5\u9009\u62e9\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[[\\mathbf{e}^\\prime]_\\times F|\\mathbf{e}^\\prime]\\) \u5bf9\u5e94\u4e8e\u57fa\u672c\u77e9\u9635 F\uff0c\u4e00\u5bf9\u89c4\u8303\u5f62\u5f0f\u7684\u6444\u50cf\u673a\u77e9\u9635\u7684\u4e00\u822c\u516c\u5f0f\u662f \\(P=[I|\\mathbf{0}] \\ \\ \\ P^\\prime=[[\\mathbf{e}^\\prime]_\\times F + \\mathbf{e}^\\prime \\mathbf{v}^\\top | \\lambda \\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{v}\\) \u662f\u4efb\u4f55 3 \u7ef4\u77e2\u91cf\uff0c \\(\\lambda\\) \u662f\u4e00\u4e2a\u6b63\u6807\u91cf \u672c\u8d28\u77e9\u9635 \u00b6 \u672c\u8d28\u77e9\u9635\u662f\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u7cfb\u554a\u7684\u57fa\u672c\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\u3002\u57fa\u672c\u77e9\u9635\u53ef\u4ee5\u770b\u4f5c\u662f\u672c\u8d28\u77e9\u9635\u7684\u63a8\u5e7f\uff0c\u57fa\u672c\u77e9\u9635\u628a\u8981\u6c42\u6807\u5b9a\u6444\u50cf\u673a\u8fd9\u6837\u4e00\u4e2a(\u975e\u672c\u8d28\u7684)\u5047\u8bbe\u53bb\u6389\u4e86\u3002\u4e0e\u57fa\u672c\u77e9\u9635\u76f8\u6bd4\u8f83\uff0c\u672c\u8d28\u77e9\u9635\u6709\u8f83\u5c11\u7684\u81ea\u7531\u5ea6\u4f46\u589e\u52a0\u4e86\u4e00\u4e9b\u6027\u8d28\u3002 \u5f52\u4e00\u5316\u5750\u6807 \u901a\u8fc7\u77e5\u9053\u6807\u5b9a\u77e9\u9635 K\uff0c\u7528\u5b83\u7684\u9006\u77e9\u9635\u4f5c\u7528\u4e8e\u70b9 \\(\\mathbf{x}\\) \u5f97\u5230\u70b9 \\(\\hat{\\mathbf{x}}=K^{-1}\\mathbf{x}\\) \uff0c\u5219 \\(\\hat{\\mathbf{x}}=[R|\\mathbf{t}]\\mathbf{X}\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{x}}\\) \u662f\u56fe\u50cf\u4e0a\u7684\u70b9\u5728\u5f52\u4e00\u5316\u5750\u6807\u4e0b\u7684\u8868\u793a \u6444\u50cf\u673a\u77e9\u9635 \\(K^{-1}P=[R|\\mathbf{t}]\\) \u79f0\u4e3a\u5f52\u4e00\u5316\u6444\u50cf\u673a\u77e9\u9635 \u7528\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u8868\u793a\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u65f6\uff0c\u672c\u8d28\u77e9\u9635\u7684\u5b9a\u4e49\u65b9\u7a0b\u662f \\(\\hat{\\mathbf{x}}^{\\prime \\top} E \\hat{\\mathbf{x}}=0\\) \uff0c\u57fa\u672c\u77e9\u9635\u548c\u672c\u8d28\u77e9\u9635\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\(E=K^{\\prime \\top}FK\\) \u672c\u8d28\u77e9\u9635\u7684\u6027\u8d28 \u00b6 \u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u662f\u672c\u8d28\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u7684\u5947\u5f02\u503c\u4e2d\u6709\u4e24\u4e2a\u76f8\u7b49\u800c\u7b2c\u4e09\u4e2a\u662f 0 \u7531\u672c\u8d28\u77e9\u9635\u6062\u590d\u6444\u50cf\u673a\u77e9\u9635 \u00b6 \u82e5 E \u7684 SVD \u5206\u89e3\u4e3a \\(U diag(1,1,0)V^{\\top},E=SR\\) \u6709\u5982\u4e0b\u4e24\u79cd\u53ef\u80fd\u7684\u5206\u89e3\uff1a \\[ S=UZU^\\top \\ \\ \\ \\ \\ \\ R=UWV^\\top \\ \\ or \\ \\ UW^\\top V^\\top \\] \u5df2\u77e5\u672c\u8d28\u77e9\u9635 \\(U diag(1,1,0)V^\\top\\) \u548c\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P=[I|\\mathbf{0}]\\) \uff0c\u90a3\u4e48\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P^\\prime\\) \u6709\u4e0b\u5217\u56db\u79cd\u53ef\u80fd\u7684\u9009\u62e9\uff1a \\[ P^\\prime=[UWV^\\top|\\mathbf{u}_3]; \\ \\ \\ [UWV^\\top|-\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|-\\mathbf{u}_3] \\]","title":"\u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_1","text":"\u7ea6 2754 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u6781\u51e0\u4f55\u662f\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u5185\u5728\u7684\u5c04\u5f71\u51e0\u4f55\uff0c\u72ec\u7acb\u4e8e\u666f\u7269\u7ed3\u6784\uff0c\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u5185\u53c2\u6570\u548c\u76f8\u5bf9\u59ff\u6001 \u57fa\u672c\u77e9\u9635 F \u96c6\u4e2d\u4e86\u8fd9\u4e2a\u5185\u5728\u51e0\u4f55\u7684\u7cbe\u534e\uff0c\u5b83\u662f\u4e00\u4e2a\u79e9\u4e3a 2 \u7684 \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c\u4e00\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u5728\u7b2c\u4e00\u3001\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u50cf\u5206\u522b\u4e3a \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \uff0c\u5219\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u6ee1\u8db3\u5173\u7cfb \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\)","title":"\u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_2","text":"\u672c\u8d28\u4e0a\uff0c\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u7684\u5bf9\u6781\u51e0\u4f55\u662f\u56fe\u50cf\u5e73\u9762\u4e0e\u4ee5\u57fa\u7ebf\uff08\u57fa\u7ebf\u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff09\u4e3a\u8f74\u7684\u5e73\u9762\u675f\u7684\u4ea4\u7684\u51e0\u4f55 \u5bf9\u6781\u70b9 \u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff08\u57fa\u7ebf\uff09\u4e0e\u50cf\u5e73\u9762\u7684 \u4ea4\u70b9 \u3002\u7b49\u4ef7\u5730\uff0c\u5bf9\u6781\u70b9\u662f\u5728\u4e00\u5e45\u89c6\u56fe\u4e2d\u53e6\u4e00\u4e2a\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u50cf\u3002\u5b83\u4e5f\u662f\u57fa\u7ebf\uff08\u5e73\u79fb\uff09\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \u5bf9\u6781\u5e73\u9762 \u662f\u4e00\u5f20\u5305\u542b\u57fa\u7ebf\u7684\u5e73\u9762\uff0c\u5b58\u5728\u7740\u5bf9\u6781\u5e73\u9762\u7684\u4e00\u4e2a\u5355\u53c2\u6570\u7c07\uff08\u675f\uff09 \u5bf9\u6781\u7ebf \u662f\u6781\u5e73\u9762\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u7ebf\uff0c\u6240\u6709\u5bf9\u6781\u7ebf\u76f8\u4ea4\u4e8e\u5bf9\u6781\u70b9\uff0c\u4e00\u5f20\u5bf9\u6781\u5e73\u9762\u4e0e\u5de6\u6216\u53f3\u50cf\u5e73\u9762\u76f8\u4ea4\u4e8e\u5bf9\u6781\u7ebf\uff0c\u5e76\u5b9a\u4e49\u4e86\u5bf9\u6781\u7ebf\u4e4b\u95f4\u7684\u5bf9\u5e94 \u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u8fd0\u52a8 \uff1a\u5bf9\u4e8e\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u4f5c\u5e73\u79fb\u4ee5\u53ca\u65cb\u8f6c\u8f74\u5782\u76f4\u56fe\u50cf\u5e73\u9762\u7684\u7279\u6b8a\u8fd0\u52a8\u60c5\u5f62\uff0c\u57fa\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u4f4d\u4e8e\u65e0\u7a77\u8fdc\uff0c\u56e0\u6b64\uff0c\u5bf9\u6781\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u800c\u5bf9\u6781\u7ebf\u662f\u5e73\u884c\u7ebf","title":"\u5bf9\u6781\u51e0\u4f55"},{"location":"cv/mvg/ag-fm/#f","text":"\u57fa\u672c\u77e9\u9635 F \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]\\) \\times H \\pi\uff0c\u5176\u4e2d \\(H_\\pi=P^\\prime P^+\\) \u662f\u4ece\u4e00\u5e45\u56fe\u50cf\u5230\u53e6\u4e00\u5e45\u56fe\u50cf\u901a\u8fc7\u4efb\u610f\u5e73\u9762 \\(\\pi\\) \u7684\u8f6c\u79fb\u6620\u5c04\u3002\u800c\u4e14\uff0c\u56e0\u4e3a \\([\\mathbf{e}^\\prime]_\\times\\) \u7684\u79e9\u4e3a 2 \u548c \\(H_\\pi\\) \u79e9\u4e3a 3\uff0c\u6240\u4ee5 F \u662f\u79e9 2 \u7684\u77e9\u9635 \u5047\u8bbe\u6444\u50cf\u673a\u77e9\u9635\u662f\u4e00\u4e2a\u5df2\u6807\u5b9a\u7684\u53cc\u773c\u88c5\u7f6e\u4e14\u4e16\u754c\u539f\u70b9\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u4e0a\uff1a \\[ F=[\\mathbf{e}^\\prime]_\\times K^\\prime R K^{-1}=K^{\\prime-\\top}[\\mathbf{t}]_\\times RK^{-1}=K^{\\prime -\\top}R[R^\\top \\mathbf{t}]_\\times K^{-1}=K^{\\prime -\\top}RK^\\top [\\mathbf{e}]_\\times \\]","title":"\u57fa\u672c\u77e9\u9635 F"},{"location":"cv/mvg/ag-fm/#_3","text":"\u5bf9\u4e24\u5e45\u56fe\u50cf\u4e2d\u4efb\u4f55\u4e00\u5bf9\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \uff0c\u57fa\u672c\u77e9\u9635\u90fd\u6ee1\u8db3\u6761\u4ef6 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \\(F\\) \u53ef\u4ee5\u4ece\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8ba1\u7b97\u51fa\u6765\uff0c\u5373 \\(F\\) \u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u6574\u4f53\u5c3a\u5ea6\u56e0\u5b50\u7684\u4e00\u4e00\u4e0b\u7531\u6444\u50cf\u673a\u552f\u4e00\u786e\u5b9a","title":"\u5bf9\u5e94\u6761\u4ef6"},{"location":"cv/mvg/ag-fm/#_4","text":"\u5047\u8bbe\u4e24\u5e45\u56fe\u50cf\u7531\u4e2d\u5fc3\u4e0d\u91cd\u5408\u7684\u6444\u50cf\u673a\u83b7\u5f97\uff0c\u5219\u57fa\u672c\u77e9\u9635 \\(F\\) \u4e3a\u5bf9\u6240\u6709\u7684\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) ,\u5bf9\u6ee1\u8db3 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u7684\u79e9 2 \u7684\u552f\u4e00\u7684 \\(3 \\times 3\\) \u9f50\u6b21\u77e9\u9635 F \u662f\u79e9 2\u3001\u81ea\u7531\u5ea6 7 \u7684\u9f50\u6b21\u77e9\u9635 \u70b9\u5bf9\u5e94 \uff1a\u5982\u679c \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\uff0c\u90a3\u4e48 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u5bf9\u6781\u7ebf \\(\\mathbf{l}^\\prime=F\\mathbf{x}\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}\\) \u7684\u5bf9\u6781\u7ebf \\(\\mathbf{l}=F^\\top \\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}^\\prime\\) \u7684\u5bf9\u6781\u7ebf \u5bf9\u6781\u70b9 \\(F\\mathbf{e}=\\mathbf{0}\\) \\(F^\\top\\mathbf{e}^\\prime=\\mathbf{0}\\) \u7531\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8fdb\u884c\u8ba1\u7b97 \u4e00\u822c\u6444\u50cf\u673a \uff1a \\(F=[\\mathbf{e}^\\prime]_\\times P^\\prime P^+\\) \uff0c\u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\uff0c \\(\\mathbf{e}^\\prime=P^\\prime \\mathbf{C}\\) \u4e14 \\(P\\mathbf{c}=\\mathbf{0}\\) \u89c4\u8303\u6444\u50cf\u673a \uff1a \\(P=[I|\\mathbf{0}],F=[\\mathbf{e}^\\prime]_\\times M = M^{-\\top}[\\mathbf{e}]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime=\\mathbf{m}\\) \u4e14 \\(\\mathbf{e}=M^{-1}\\mathbf{m}\\) \u975e\u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff1a \\(P=K[I|\\mathbf{0}],P^\\prime=K^\\prime[R|\\mathbf{t}],F=K^{-\\top}[\\mathbf{t}]_\\times RK^{-1}=[K^\\prime \\mathbf{t}]_\\times K^\\prime R K^{-1}=K^{\\prime -\\top} RK^\\top [KR^\\top \\mathbf{t}]_\\times\\) \u8f6c\u7f6e \uff1a\u5982\u679c \\(F\\) \u662f\u6444\u50cf\u673a\u5bf9\u4f5c \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635\uff0c\u5219 \\(F^\\top\\) \u662f\u5176\u53cd\u5e8f\u5bf9 \\((P^\\prime,P)\\) \u7684\u57fa\u672c\u77e9\u9635","title":"\u57fa\u672c\u77e9\u9635\u7684\u6027\u8d28"},{"location":"cv/mvg/ag-fm/#_5","text":"\u5047\u8bbe \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u5bf9\u6781\u7ebf\uff0c\u4e14 \\(k\\) \u662f\u4e0d\u8fc7\u5bf9\u6781\u70b9 \\(\\mathbf{e}\\) \u7684\u4efb\u4f55\u76f4\u7ebf\uff0c\u5219 \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u95f4\u7684\u5173\u7cfb\u662f \\(\\mathbf{l}^\\prime=F[\\mathbf{k}]_\\times \\mathbf{l}\\) \uff0c\u5bf9\u79f0\u5730\u6709 \\(\\mathbf{l}=F^\\top [\\mathbf{k}^\\prime]_\\times \\mathbf{l}^\\prime\\)","title":"\u5bf9\u6781\u7ebf\u5355\u5e94"},{"location":"cv/mvg/ag-fm/#_6","text":"\u7eaf\u5e73\u79fb \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u5e76\u4e14\u5185\u53c2\u4e0d\u53d8\u7684\u7eaf\u5e73\u79fb\uff0c\u53ef\u4ee5\u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u662f \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K[I|\\mathbf{t}]\\) \uff0c\u5219 \\(F=[\\mathbf{e}^\\prime]_\\times KK^{-1}=[\\mathbf{e}^\\prime]_\\times\\) \uff0c\u4ece\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f \\(\\mathbf{x}^\\prime=\\mathbf{x}+K\\mathbf{t}/Z\\) \uff0c\u5176\u4e2d \\(Z\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6\uff08\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u4e3b\u8f74\u4e0a\u6d4b\u91cf\u4ece \\(\\mathbf{X}\\) \u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u8ddd\u79bb\uff09 \u6ce8\u610f\u5728\u7eaf\u5e73\u79fb\u60c5\u5f62\uff0c \\(F=[\\mathbf{e}^\\prime]_\\times\\) \u662f\u53cd\u5bf9\u79f0\u7684\u800c\u4e14\u53ea\u6709 2 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5b83\u4eec\u5bf9\u5e94\u4e8e\u5bf9\u6781\u70b9\u7684\u4f4d\u7f6e \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \u4e0e \\(\\mathbf{e}=\\mathbf{e}^\\prime\\) \u662f\u5171\u7ebf\u7684\uff08\u5047\u8bbe\u628a\u4e24\u5e45\u56fe\u50cf\u53e0\u8d77\u6765\uff09\u3002\u8fd9\u79cd\u5171\u7ebf\u6027\u8d28\u79f0\u4e3a \u81ea\u5bf9\u6781 \uff0c\u5e76\u4e14\u5bf9\u4e8e\u4e00\u822c\u8fd0\u52a8\u4e0d\u6210\u7acb \u4e00\u822c\u8fd0\u52a8 \u7ed9\u5b9a\u4e24\u4e2a\u4efb\u610f\u6444\u50cf\u673a\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6444\u50cf\u673a\u65cb\u8f6c\u4f7f\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u5e73\u884c\u3002\u8be5\u65cb\u8f6c\u53ef\u4ee5\u901a\u8fc7\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u4e00\u4e2a\u5c04\u5f71\u53d8\u6362\u6765\u4eff\u771f\u3002\u9488\u5bf9\u4e24\u5e45\u56fe\u50cf\u7684\u6807\u5b9a\u77e9\u9635\u7684\u5dee\u522b\u8fd8\u53ef\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u8fdb\u4e00\u6b65\u7684\u77eb\u6b63\u3002\u8fd9\u4e24\u6b21\u77eb\u6b63\u7684\u7ed3\u679c\u7b49\u4ef7\u4e8e\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u4f5c\u5c04\u5f71\u53d8\u6362 \\(H\\) \u3002\u5047\u8bbe\u8fd9\u4e9b\u77eb\u6b63\u5df2\u7ecf\u5b8c\u6210\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u7684\u6709\u6548\u5173\u7cfb\u662f\u4e00\u4e2a\u7eaf\u5e73\u79fb\u3002 \u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u4e3a \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K^\\prime[R|\\mathbf{t}]\\) \uff0c\u9700\u8981\u7684\u5c04\u5f71\u53d8\u6362\u662f \\(H=K^\\prime RK^{-1}=H_\\infty\\) \uff0c\u5176\u4e2d \\(H_\\infty\\) \u662f\u65e0\u7a77\u5355\u5e94\uff0c\u4e14 \\(F=[\\mathbf{e}^\\prime]_\\times H_\\infty\\) \u3002\u5219\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u56fe\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f\uff1a \\(\\mathbf{x}^\\prime=K^\\prime RK^{-1}\\mathbf{x}+K^\\prime \\mathbf{t} / Z\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5728\u7eaf\u5e73\u9762\u8fd0\u52a8\u65f6\u65cb\u8f6c\u8f74\u4e0e\u5e73\u79fb\u65b9\u5411\u6b63\u4ea4\u3002\u6b63\u4ea4\u6027\u7ed9\u8fd9\u79cd\u8fd0\u52a8\u589e\u52a0\u4e86\u4e00\u4e2a\u7ea6\u675f\uff0c\u5982\u679c \\(K^\\prime=K\\) \uff0c\u5219 \\(F\\) \u7684\u5bf9\u79f0\u90e8\u5206\u5728\u8fd9\u79cd\u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\u65f6\u7684\u79e9\u4e3a 2\u3002\u4f7f\u5b83\u7684\u81ea\u7531\u5ea6\u4e2a\u6570\u4ece\u4e00\u822c\u8fd0\u52a8\u7684 7 \u4e2a\u964d\u4f4e\u5230\u7eaf\u5e73\u9762\u8fd0\u52a8\u7684 6 \u4e2a","title":"\u7531\u7279\u6b8a\u8fd0\u52a8\u4ea7\u751f\u7684\u57fa\u672c\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_7","text":"\u57fa\u672c\u77e9\u9635\u7684\u5bf9\u79f0\u548c\u53cd\u5bf9\u79f0\u90e8\u5206\u5206\u522b\u4e3a \\(F_s=(F+F^\\top)/2 \\ \\ \\ F_a=(F-F^\\top)/2\\) \uff0c\u6ee1\u8db3 \\(F=F_s+F_a\\) \u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_s\\) \u662f\u5bf9\u79f0\u7684\u5e76\u4e14\u4e00\u822c\u5730\u79e9\u4e3a 3\uff0c\u5b83\u6709 5 \u4e2a\u81ea\u7531\u5ea6\u5e76\u7b49\u540c\u4e8e\u4e00\u6761\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u79f0\u4e3a Steiner \u4e8c\u6b21\u66f2\u7ebf \u53cd\u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_a\\) \u662f\u53cd\u5bf9\u79f0\u7684\u5e76\u53ef\u4ee5\u8bb0\u4e3a \\(F_a=[\\mathbf{x}_a]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_a\\) \u662f \\(F_a\\) \u5730\u96f6\u77e2\u91cf\u3002\u53cd\u5bf9\u79f0\u90e8\u5206\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u4e14\u7b49\u540c\u4e8e\u70b9 \\(\\mathbf{x}_a\\) \u5bf9\u6781\u7ebf\u5bf9\u5e94 \uff1a\u7531\u4e00\u4e2a\u5355\u5e94\u5173\u8054\u7684\u4e24\u4e2a\u76f4\u7ebf\u675f\uff0c\u5b83\u4eec\u5bf9\u5e94\u76f4\u7ebf\u7684\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf\u3002\u8fd9\u4e24\u4e2a\u675f\u90fd\u662f\u5bf9\u6781\u7ebf\u675f\uff0c\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}\\) \u800c\u53e6\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}^\\prime\\) \u3002\u8fd9\u4e9b\u5bf9\u6781\u7ebf\u7531\u4e00\u4e2a 1D \u5355\u5e94\u76f8\u5173\u8054\u3002\u5176\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e8c\u6b21\u66f2\u7ebf \\(F_s\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\uff0c\u5176\u4e2d \\(F_s\\) \u7684\u79e9\u4e3a 2\u3002\u6b64\u65f6 Steiner \u4e8c\u6b21\u66f2\u7ebf\u662f\u9000\u5316\u7684\uff0c\u5b83\u7b49\u4ef7\u4e8e\u4e24\u6761\u4e0d\u91cd\u5408\u76f4\u7ebf \\(F_s=\\mathbf{l}_h\\mathbf{l}_s^\\top+\\mathbf{l}_s\\mathbf{l}_h^\\top\\) \uff0c \\(F\\) \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]_\\times[\\mathbf{l}_s]_\\times[\\mathbf{e}]_\\times\\) \u4e24\u4e2a\u5bf9\u6781\u70b9\u7684\u5206\u522b\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u548c\u76f4\u7ebf \\(\\mathbf{l}_s\\)","title":"\u57fa\u672c\u77e9\u9635\u7684\u51e0\u4f55\u8868\u793a"},{"location":"cv/mvg/ag-fm/#_8","text":"","title":"\u6062\u590d\u6444\u50cf\u673a\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_9","text":"\u5982\u679c H \u662f\u8868\u793a 3 \u7ef4\u5c04\u5f71\u53d8\u6362\u7684\u4e00\u4e2a \\(4 \\times 4\\) \u77e9\u9635\uff0c\u90a3\u4e48\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635 \\((P,P^\\prime)\\) \u548c \\((PH,P^\\prime H)\\) \u7684\u57fa\u672c\u77e9\u9635\u662f\u76f8\u540c\u7684 \u6444\u50cf\u673a\u77e9\u9635\u7684\u89c4\u8303\u5f62\u5f0f \uff1a\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635\u5bf9 \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M|\\mathbf{m}]\\) \u7684\u57fa\u672c\u77e9\u9635\u7b49\u4e8e \\([\\mathbf{m}]_\\times M\\)","title":"\u5c04\u5f71\u4e0d\u53d8\u6027\u548c\u89c4\u8303\u6444\u50cf\u673a"},{"location":"cv/mvg/ag-fm/#f_1","text":"\u4ee4 F \u4e3a\u57fa\u672c\u77e9\u9635\u800c \\((P,P^\\prime)\\) \u548c \\((\\tilde{P},\\tilde{P}^\\prime)\\) \u90fd\u662f\u4e0e\u57fa\u672c\u77e9\u9635 F \u5bf9\u5e94\u7684\u4e24\u7ec4\u6444\u50cf\u673a\u77e9\u9635\u5bf9\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u7684 \\(4 \\times 4\\) \u77e9\u9635 H \u4f7f\u5f97 \\(\\tilde{P}=PH\\) \u548c \\(\\tilde{P}=P^\\prime H\\) \u82e5\u79e9\u4e3a 2 \u7684\u77e9\u9635 F \u53ef\u4ee5\u5206\u89e3\u4e3a\u4e24\u4e2a\u4e0d\u540c\u7684\u5f62\u5f0f\uff1a \\(F=[\\mathbf{a}]_\\times A\\) \u548c \\(F =[\\tilde{\\mathbf{a}}]_\\times \\tilde{A}\\) \uff0c\u5219\u5bf9\u67d0\u4e2a\u975e\u96f6\u5e38\u6570 k \u548c 3 \u7ef4\u77e2\u91cf \\(\\mathbf{v}\\) \u6709 \\(\\tilde{\\mathbf{a}}=k\\mathbf{a}\\) \u548c \\(\\tilde{A}=k^{-1}(A+\\mathbf{a} \\mathbf{v}^\\top)\\)","title":"\u7ed9\u5b9a F \u540e\u7684\u6444\u50cf\u673a\u5c04\u5f71\u591a\u4e49\u6027"},{"location":"cv/mvg/ag-fm/#f_2","text":"\u4e00\u4e2a\u975e\u96f6\u77e9\u9635 F \u662f\u5bf9\u5e94\u4e8e\u4e00\u5bf9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u57fa\u672c\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f \\(P^{\\prime \\top}FP\\) \u662f\u53cd\u5bf9\u79f0\u77e9\u9635 \u4ee4 F \u662f\u57fa\u672c\u77e9\u9635\uff0cS \u662f\u4efb\u610f\u53cd\u5bf9\u79f0\u77e9\u9635\u3002\u5b9a\u4e49\u6444\u50cf\u673a\u77e9\u9635\u5bf9\u4e3a\uff1a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[SF|\\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime\\) \u662f\u6ee1\u8db3 \\(\\mathbf{e}^{\\prime \\top}F=\\mathbf{0}\\) \u7684\u5bf9\u6781\u70b9\uff0c\u5e76\u5047\u5b9a\u6240\u5b9a\u4e49\u7684 \\(P^\\prime\\) \u662f\u6709\u6548\u7684\u6444\u50cf\u673a\u77e9\u9635\uff08\u79e9\u4e3a 3\uff09\uff0c\u5219 F \u662f\u5bf9\u5e94\u4e8e \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635 \u57fa\u672c\u77e9\u9635 F \u7684\u6444\u50cf\u673a\u77e9\u9635\u53ef\u4ee5\u9009\u62e9\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[[\\mathbf{e}^\\prime]_\\times F|\\mathbf{e}^\\prime]\\) \u5bf9\u5e94\u4e8e\u57fa\u672c\u77e9\u9635 F\uff0c\u4e00\u5bf9\u89c4\u8303\u5f62\u5f0f\u7684\u6444\u50cf\u673a\u77e9\u9635\u7684\u4e00\u822c\u516c\u5f0f\u662f \\(P=[I|\\mathbf{0}] \\ \\ \\ P^\\prime=[[\\mathbf{e}^\\prime]_\\times F + \\mathbf{e}^\\prime \\mathbf{v}^\\top | \\lambda \\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{v}\\) \u662f\u4efb\u4f55 3 \u7ef4\u77e2\u91cf\uff0c \\(\\lambda\\) \u662f\u4e00\u4e2a\u6b63\u6807\u91cf","title":"\u7ed9\u5b9a F \u6c42\u89c4\u8303\u6444\u50cf\u673a\u5bf9"},{"location":"cv/mvg/ag-fm/#_10","text":"\u672c\u8d28\u77e9\u9635\u662f\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u7cfb\u554a\u7684\u57fa\u672c\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\u3002\u57fa\u672c\u77e9\u9635\u53ef\u4ee5\u770b\u4f5c\u662f\u672c\u8d28\u77e9\u9635\u7684\u63a8\u5e7f\uff0c\u57fa\u672c\u77e9\u9635\u628a\u8981\u6c42\u6807\u5b9a\u6444\u50cf\u673a\u8fd9\u6837\u4e00\u4e2a(\u975e\u672c\u8d28\u7684)\u5047\u8bbe\u53bb\u6389\u4e86\u3002\u4e0e\u57fa\u672c\u77e9\u9635\u76f8\u6bd4\u8f83\uff0c\u672c\u8d28\u77e9\u9635\u6709\u8f83\u5c11\u7684\u81ea\u7531\u5ea6\u4f46\u589e\u52a0\u4e86\u4e00\u4e9b\u6027\u8d28\u3002 \u5f52\u4e00\u5316\u5750\u6807 \u901a\u8fc7\u77e5\u9053\u6807\u5b9a\u77e9\u9635 K\uff0c\u7528\u5b83\u7684\u9006\u77e9\u9635\u4f5c\u7528\u4e8e\u70b9 \\(\\mathbf{x}\\) \u5f97\u5230\u70b9 \\(\\hat{\\mathbf{x}}=K^{-1}\\mathbf{x}\\) \uff0c\u5219 \\(\\hat{\\mathbf{x}}=[R|\\mathbf{t}]\\mathbf{X}\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{x}}\\) \u662f\u56fe\u50cf\u4e0a\u7684\u70b9\u5728\u5f52\u4e00\u5316\u5750\u6807\u4e0b\u7684\u8868\u793a \u6444\u50cf\u673a\u77e9\u9635 \\(K^{-1}P=[R|\\mathbf{t}]\\) \u79f0\u4e3a\u5f52\u4e00\u5316\u6444\u50cf\u673a\u77e9\u9635 \u7528\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u8868\u793a\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u65f6\uff0c\u672c\u8d28\u77e9\u9635\u7684\u5b9a\u4e49\u65b9\u7a0b\u662f \\(\\hat{\\mathbf{x}}^{\\prime \\top} E \\hat{\\mathbf{x}}=0\\) \uff0c\u57fa\u672c\u77e9\u9635\u548c\u672c\u8d28\u77e9\u9635\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\(E=K^{\\prime \\top}FK\\)","title":"\u672c\u8d28\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_11","text":"\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u662f\u672c\u8d28\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u7684\u5947\u5f02\u503c\u4e2d\u6709\u4e24\u4e2a\u76f8\u7b49\u800c\u7b2c\u4e09\u4e2a\u662f 0","title":"\u672c\u8d28\u77e9\u9635\u7684\u6027\u8d28"},{"location":"cv/mvg/ag-fm/#_12","text":"\u82e5 E \u7684 SVD \u5206\u89e3\u4e3a \\(U diag(1,1,0)V^{\\top},E=SR\\) \u6709\u5982\u4e0b\u4e24\u79cd\u53ef\u80fd\u7684\u5206\u89e3\uff1a \\[ S=UZU^\\top \\ \\ \\ \\ \\ \\ R=UWV^\\top \\ \\ or \\ \\ UW^\\top V^\\top \\] \u5df2\u77e5\u672c\u8d28\u77e9\u9635 \\(U diag(1,1,0)V^\\top\\) \u548c\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P=[I|\\mathbf{0}]\\) \uff0c\u90a3\u4e48\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P^\\prime\\) \u6709\u4e0b\u5217\u56db\u79cd\u53ef\u80fd\u7684\u9009\u62e9\uff1a \\[ P^\\prime=[UWV^\\top|\\mathbf{u}_3]; \\ \\ \\ [UWV^\\top|-\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|-\\mathbf{u}_3] \\]","title":"\u7531\u672c\u8d28\u77e9\u9635\u6062\u590d\u6444\u50cf\u673a\u77e9\u9635"},{"location":"cv/mvg/calc-p/","text":"\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 p \u00b6 \u7ea6 1967 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u7531 3 \u7ef4\u7a7a\u95f4\u4e0e\u56fe\u50cf\u5e73\u9762\u5143\u7d20\u95f4\u7684\u5bf9\u5e94\u6765\u4f30\u8ba1\u6444\u50cf\u673a\u6295\u5f71\u77e9\u9635\u7684\u6570\u503c\u65b9\u6cd5\uff08\u7b80\u79f0\u786e\u5b9a\u6444\u50cf\u673a\u53c2\u6570\uff09 \u57fa\u672c\u65b9\u7a0b \u00b6 \u5bf9\u4e8e\u6bcf\u7ec4\u5bf9\u5e94 \\(\\mathbf{X}_i \\leftrightarrow \\mathbf{x}_i\\) \uff0c\u53ef\u4ee5\u5f97\u51fa\u4e0b\u9762\u5173\u7cfb\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i\\mathbf{X}_i^\\top & y_i\\mathbf{X}_i^\\top \\\\ w_i\\mathbf{X}_i^\\top & \\mathbf{0}^\\top & -x_i\\mathbf{X}_i^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{p}_1 \\\\ \\mathbf{p}_2 \\\\ \\mathbf{p}_3 \\end{bmatrix} = \\mathbf{0} \\] \u6700\u5c0f\u914d\u7f6e\u89e3 \uff1a\u77e9\u9635 P \u6709 12 \u4e2a\u5143\u7d20\u548c\uff08\u5ffd\u7565\u7f29\u653e\u56e0\u5b50\uff0911 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u89e3 P \u9700\u8981 11 \u4e2a\u65b9\u7a0b\u3002\u7ed9\u5b9a\u8fd9\u4e2a\u6700\u5c0f\u6570\u76ee\u7684\u5bf9\u5e94\u65f6\uff0c\u89e3\u65f6\u7cbe\u786e\u7684\uff0c\u5373\u7a7a\u95f4\u7684\u70b9\u51c6\u786e\u5730\u6295\u5f71\u5230\u5b83\u4eec\u88ab\u6d4b\u91cf\u5230\u56fe\u50cf\u4e0a \u8d85\u5b9a\u89e3 \uff1a\u5982\u679c\u7531\u4e8e\u70b9\u5750\u6807\u7684\u566a\u58f0\u5bfc\u81f4\u6570\u636e\u4e0d\u7cbe\u786e\u5e76\u4e14\u7ed9\u5b9a \\(n \\ge 6\\) \u7ec4\u70b9\u5bf9\u5e94\uff0c\u90a3\u4e48 \\(A\\mathbf{p}=\\mathbf{0}\\) \u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002P \u7684\u89e3\u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u4ee3\u6570\u6216\u51e0\u4f55\u8bef\u5dee\u6765\u83b7\u5f97\u3002\u6c42 \\(\\parallel A \\mathbf{p} \\parallel\\) \u7684\u6700\u5c0f\u503c\uff0c\u53ef\u80fd\u7684\u7ea6\u675f\u662f\uff1a \\(\\parallel \\mathbf{p} \\parallel = 1\\) \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{p}}^3\\) \u662f\u7531 P \u6700\u540e\u4e00\u884c\u7684\u524d\u4e09\u4e2a\u5143\u7d20\u7ec4\u6210\u7684\u77e2\u91cf \\((p_{31},p_{32},p_{33})^\\top\\) \u9000\u5316\u914d\u7f6e \u6444\u50cf\u673a\u4e2d\u5fc3\u548c\u70b9\u90fd\u5728\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u4e0a \u8fd9\u4e9b\u70b9\u90fd\u5728\u4e00\u5f20\u5e73\u9762\u548c\u5305\u542b\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u5e76\u96c6\u4e0a \u6570\u636e\u5f52\u4e00\u5316 \uff1a\u5f53\u70b9\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\u53d8\u5316\u76f8\u5bf9\u6bd4\u8f83\u5c0f\u65f6\uff0c\u91c7\u7528\u540c\u6837\u7c7b\u578b\u7684\u5f52\u4e00\u5316\u3002\u56e0\u6b64\uff0c\u628a\u70b9\u7684\u5f62\u5fc3\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u5e76\u5bf9\u5b83\u4eec\u7684\u5750\u6807\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684 RMS\uff08\u5747\u65b9\u6839\uff09\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{3}\\) \u3002\u9002\u7528\u4e8e\u70b9\u7d27\u81f4\u5206\u5e03\u7684\u60c5\u5f62 \u76f4\u7ebf\u5bf9\u5e94 \uff1a3D \u4e2d\u7684\u76f4\u7ebf\u53ef\u4ee5\u7528\u5b83\u901a\u8fc7\u7684\u4e24\u70b9 \\(\\mathbf{X}_0\\) \u548c \\(\\mathbf{X}_1\\) \u6765\u8868\u793a\u3002\u7531\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5f97\u5230\u7684\u5e73\u9762\u4e3a \\(P^\\top\\mathbf{l}\\) \u3002\u90a3\u4e48\u70b9 \\(\\mathbf{X}_j\\) \u5728\u8be5\u5e73\u9762\u4e0a\u7684\u6761\u4ef6\u662f \\(\\mathbf{l}^\\top P \\mathbf{X}_j = 0\\) \uff0c\u5176\u4e2d \\(j=0,1\\) \u51e0\u4f55\u8bef\u5dee \u00b6 \u56fe\u50cf\u4e2d\u7684\u51e0\u4f55\u8bef\u5dee \\(\\underset{i}{\\sum}d(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_i\\) \u662f\u88ab\u6d4b\u91cf\u7684\u70b9\uff0c \\(\\hat{\\mathbf{x}}_i\\) \u662f\u70b9 \\(P\\mathbf{X}_i\\) \uff0c\u5373 \\(\\mathbf{X}_i\\) \u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u7cbe\u786e\u7684\u56fe\u50cf\u70b9 \u5982\u679c\u6d4b\u91cf\u8bef\u5dee\u6ee1\u8db3\u9ad8\u65af\u5206\u5e03\uff0c\u90a3\u4e48 \\(\\underset{P}{\\min}\\underset{i}{\\sum}d(\\mathbf{x}_i,P\\mathbf{X}_i)^2\\) \u7684\u89e3\u662f \\(P\\) \u7684\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u4e16\u754c\u70b9\u6709\u8bef\u5dee 3D \u51e0\u4f55\u8bef\u5dee\u5b9a\u4e49\u4e3a\uff1a \\(\\underset{i}{\\sum}d(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u7684\u8bef\u5dee\u90fd\u8003\u8651\uff1a \\(\\underset{i=1}{\\sum}d_{Mah}(\\mathbf{x}_i,P\\hat{\\mathbf{X}}_i)^2+d_{Mah}(\\mathbf{X}+\\hat{\\mathbf{X}}_i)^2\\) \uff0c \\(d_{Mah}\\) \u8868\u793a\u8bef\u5dee\u534f\u65b9\u5dee\u77e9\u9635\u7684 Mahalanobis \u8ddd\u79bb \u4ee3\u6570\u8bef\u5dee\u7684\u96c6\u5408\u89e3\u91ca \u00b6 \u5047\u5b9a\u6240\u6709\u7684\u70b9 \\(\\mathbf{X}_i\\) \u5728 DLT \u7b97\u6cd5\u4e2d\u5df2\u7ecf\u5f52\u4e00\u5316\uff0cDLT \u7b97\u6cd5\u8981\u6700\u5c0f\u5316\u7684\u91cf\u662f\uff1a \\(\\sum_{i}(\\hat{w}_id(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i))^2\\) \uff0c\u5176\u4e2d \\(\\hat{w}(\\hat{x}_i,\\hat{y}_i,1)^\\top=P\\mathbf{X}_i\\) \uff0c \\(\\hat{w}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u70b9 \\(\\mathbf{X}_i\\) \u6cbf\u4e3b\u8f74\u65b9\u5411\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\uff0c\u8981\u6700\u5c0f\u5316\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4e8e \\(f\\sum_id(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u53d8\u6362\u4e0d\u53d8\u6027 \uff1a\u5728\u7ea6\u675f \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316 \\(A\\mathbf{p}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u6700\u5c0f\u5316 3D \u51e0\u4f55\u8ddd\u79bb\u3002\u8fd9\u6837\u65e2\u4e0d\u53d7 3D \u7a7a\u95f4\u4e5f\u4e0d\u53d7\u56fe\u50cf\u7a7a\u95f4\u7684\u76f8\u4f3c\u53d8\u6362\u7684\u5f71\u54cd \u4eff\u5c04\u6444\u50cf\u673a\u7684\u4f30\u8ba1 \u00b6 \u4e0a\u9762\u6709\u5173\u5c04\u5f71\u6444\u50cf\u673a\u63a8\u5bfc\u7684\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u4eff\u5c04\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u5b9a\u4e49\u4e3a\u5c04\u5f71\u77e9\u9635\u7684\u6700\u540e\u4e00\u884c\u662f \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u7684 DLT \u4f30\u8ba1\u662f\u5728 \\(P\\) \u7684\u6700\u540e\u4e00\u884c\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u4e0b\u6700\u5c0f\u5316 \\(\\parallel A \\mathbf{p} \\parallel\\) \u53d7\u9650\u6444\u50cf\u673a\u4f30\u8ba1 \u00b6 \u5728\u5173\u4e8e\u6444\u50cf\u673a\u53c2\u6570\u7684\u9650\u5236\u6761\u4ef6\u4e0b\u5bfb\u6c42\u4e00\u4e2a\u6700\u9002\u914d\u7684\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \uff0c\u901a\u5e38\u7684\u9650\u5236\u6709 \u626d\u66f2 \\(s\\) \u4e3a 0 \u50cf\u7d20\u662f\u6b63\u65b9\u5f62: \\(\\alpha_x=\\alpha_y\\) \u4e3b\u70b9 \\((x_0,y_0)^2\\) \u5df2\u77e5 \u6574\u4e2a\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u5df2\u77e5 \u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee \uff1a\u5047\u5b9a\u6211\u4eec\u5f3a\u8c03\u7ea6\u675f \\(s=0\\) \u548c \\(\\alpha_x=\\alpha_y\\) \uff0c\u7528\u4f59\u4e0b\u7684 9 \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u6444\u50cf\u673a\u77e9\u9635\u3002\u51e0\u4f55\u8bef\u5dee\u53ef\u4ee5\u7528\u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5\u76f8\u5bf9\u4e8e\u8fd9\u7ec4\u53c2\u6570\u6765\u6700\u5c0f\u5316 \u6700\u5c0f\u5316\u4ee3\u6570\u8bef\u5dee \uff1a\u8003\u8651\u628a\u53c2\u6570\u96c6 \\(\\mathbf{q}\\) \u6620\u5c04\u5230\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u53c2\u6570\u5316\u6620\u5c04 \\(g\\) \uff0c\u6700\u5c0f\u5316\u6240\u6709\u70b9\u5339\u914d\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 \\(\\parallel Ag(\\mathbf{q}) \\parallel\\) \u7b80\u5316\u7684\u6d4b\u91cf\u77e9\u9635 \uff1a\u4e00\u822c\uff0c \\(2n \\times 12\\) \u7684\u77e9\u9635 \\(A\\) \u53ef\u80fd\u6709\u5f88\u591a\u884c\u3002\u4f46\u53ef\u7528\u4e00\u4e2a \\(12 \\times 12\\) \u7684\u77e9\u9635 \\(\\hat{A}\\) \u6765\u4ee3\u66ff \\(A\\) \uff0c\u4f7f\u5f97\u5bf9\u4efb\u4f55\u77e2\u91cf \\(\\mathbf{p}\\) \u6709 \\(\\parallel A \\mathbf{p} \\parallel = \\mathbf{p}^\\top A^\\top A \\mathbf{p} = \\parallel \\hat{A} \\mathbf{p} \\parallel\\) \u521d\u59cb\u5316 \uff1a\u6c42\u6444\u50cf\u673a\u521d\u59cb\u5316\u53c2\u6570\u7684\u4e00\u79cd\u9014\u5f84\uff1a \u7528\u8bf8\u5982 DLT \u7684\u7ebf\u6027\u7b97\u6cd5\u6c42\u51fa\u4e00\u4e2a\u521d\u59cb\u7684\u6444\u50cf\u673a\u77e9\u9635 \u628a\u56fa\u5b9a\u53c2\u6570\u5f3a\u5236\u5230\u6240\u5e0c\u671b\u7684\u53d6\u503c\u8303\u56f4 \u628a\u6444\u50cf\u673a\u77e9\u9635\u5206\u89e3\u6240\u83b7\u5f97\u7684\u521d\u59cb\u503c\u8d4b\u7ed9\u53c2\u6570\u53d8\u91cf \u5916\u90e8\u6821\u51c6 \uff1a\u4e3a\u4e86\u8ba1\u7b97\u5916\u90e8\u6821\u51c6\uff0c\u9700\u5bf9\u4e16\u754c\u5750\u6807\u4f4d\u7f6e\u51c6\u786e\u5df2\u77e5\u7684\u4e00\u4e2a\u914d\u7f6e\u8fdb\u884c\u5f71\u50cf\u3002\u4e4b\u540e\u6c42\u6444\u50cf\u673a\u7684\u59ff\u6001\u3002\u5728\u673a\u5668\u4eba\u7cfb\u7edf\u7684\u624b\u773c\u6807\u5b9a\u4e2d\u6c42\u6444\u50cf\u673a\u4f4d\u7f6e\u5c31\u662f\u8fd9\u6837\u7684\u60c5\u5f62\uff1b\u8fd8\u6709\u5728\u91c7\u7528\u914d\u51c6\u6280\u672f\u7684\u57fa\u4e8e\u6a21\u578b\u7684\u8bc6\u522b\u4e2d\uff0c\u9700\u8981\u77e5\u9053\u7269\u4f53\u76f8\u5bf9\u6444\u50cf\u673a\u7684\u4f4d\u7f6e \u534f\u65b9\u5dee\u4f30\u8ba1 \uff1a\u5047\u5b9a\u6240\u6709\u7684\u65e0\u64e6\u597d\u4ec5\u53d1\u751f\u5728\u56fe\u50cf\u6d4b\u91cf\u4e2d\uff0cML \u6b8b\u5dee\u671f\u671b\u503c\u7b49\u4e8e \\(\\varepsilon_{res}=\\delta(1-d/2n)^{1/2}\\) \uff0c\u5176\u4e2d \\(d\\) \u662f\u8981\u62df\u5408\u7684\u6444\u50cf\u673a\u53c2\u6570\u6570\u76ee\uff08\u5bf9\u5b8c\u6574\u7684\u9488\u5b54\u6444\u50cf\u673a\u6a21\u578b\u662f 11\uff09\u3002\u7ed9\u5b9a\u4e00\u4e2a\u6b8b\u5dee\uff0c\u8be5\u516c\u5f0f\u4e5f\u53ef\u4ee5\u7528\u6765\u4f30\u8ba1\u70b9\u6d4b\u91cf\u7684\u51c6\u786e\u6027 \u5f84\u5411\u5931\u771f \u00b6 \u7528 \\((\\tilde{x},\\tilde{y})^\\top\\) \u6807\u8bb0\u5728\u7406\u60f3\uff08\u975e\u5931\u771f\uff09\u9488\u5b54\u6295\u5f71\u4e0b\u70b9\u4ee5\u7126\u8ddd\u4e3a\u6d4b\u91cf\u5355\u4f4d\u7684\u5750\u6807\u3002\u5bf9\u4e00\u70b9 \\(\\mathbf{X}\\) \u6709\uff1a \\((\\tilde{x},\\tilde{y},1)^\\top=[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u4e0b\u7684 3D \u70b9\uff0c\u5b9e\u9645\u7684\u6295\u5f71\u70b9\u901a\u8fc7\u4e00\u4e2a\u5f84\u5411\u4f4d\u79fb\u4e0e\u7406\u60f3\u70b9\u5173\u8054\u3002\u56e0\u6b64\uff0c\u5f84\u5411\uff08\u900f\u955c\uff09\u5931\u771f\u7684\u6a21\u578b\u662f\uff1a \\[\\begin{bmatrix} x_d \\\\ y_d \\end{bmatrix}=L(\\tilde{r})\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\end{bmatrix}\\] \\((\\tilde{x},\\tilde{y})^\\top\\) \u662f\u7406\u60f3\u56fe\u50cf\u4f4d\u7f6e\uff08\u9075\u5faa\u7ebf\u6027\u6295\u5f71\uff09 \\((x_d,y_d)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u540e\u7684\u5b9e\u9645\u56fe\u50cf\u7684\u4f4d\u7f6e \\(\\tilde{r}\\) \u4e3a\u5f84\u5411\u5931\u771f\u4e2d\u5fc3\u7684\u5f84\u5411\u8ddd\u79bb \\(\\sqrt{\\tilde{x}^2+\\tilde{y}^2}\\) \\(L(\\tilde{r})\\) \u662f\u4e00\u4e2a\u5931\u771f\u56e0\u5b50\uff0c\u5b83\u4ec5\u4ec5\u662f\u534a\u5f84 \\(\\tilde{r}\\) \u7684\u51fd\u6570 \u5931\u771f\u77eb\u6b63 \uff1a\u5728\u50cf\u7d20\u5750\u6807\u4e2d\uff0c\u5931\u771f\u77eb\u6b63\u8bb0\u4e3a \\[ \\hat{x}=x_c+L(r)(x-x_c) \\ \\ \\ \\ \\ \\ \\hat{y}=y_c+L(r)(y-y_c) \\] \\((x,y)^\\top\\) \u662f\u6d4b\u91cf\u7684\u5750\u6807 \\((\\hat{x},\\hat{y})^\\top\\) \u662f\u77eb\u6b63\u540e\u7684\u5750\u6807 \\((x_c,y_c)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\u4e14 \\(r^2=(x-x_c)^2+(y-y_c)^2\\) \uff0c\u6ce8\u610f\u5982\u679c\u957f\u5bbd\u6bd4\u4e0d\u662f 1\uff0c\u90a3\u4e48\u5728\u8ba1\u7b97 \\(r\\) \u65f6\u5fc5\u987b\u5bf9\u5b83\u8fdb\u884c\u77eb\u6b63 \u5931\u771f\u51fd\u6570\u548c\u4e2d\u5fc3\u7684\u9009\u62e9 \uff1a\u51fd\u6570 \\(L(r)\\) \u4ec5\u5f53 \\(r\\) \u4e3a\u6b63\u503c\u65f6\u6709\u5b9a\u4e49\u5e76\u4e14 \\(L(0)=1\\) \u3002\u4e00\u4e2a\u4efb\u610f\u51fd\u6570 \\(L(r)\\) \u7684\u903c\u8fd1\u53ef\u4ee5\u7531\u6cf0\u52d2\u5c55\u5f00\u5f0f \\(L(r)=1+\\mathcal{k}_1r+\\mathcal{k}_2r^2+\\mathcal{k}_3r^3+...\\) \u3002 \\(\\{k_1,k_2,k_3,...,x_c,y_c\\}\\) \u662f\u5f84\u5411\u77eb\u6b63\u7684\u7cfb\u6570\u3002\u4e3b\u70b9\u7ecf\u5e38\u88ab\u7528\u4f5c\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\uff0c\u867d\u7136\u5b83\u4eec\u672a\u5fc5\u5b8c\u5168\u91cd\u5408 \u8ba1\u7b97\u5931\u771f\u51fd\u6570 \uff1a\u51fd\u6570 \\(L(r)\\) \u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u57fa\u4e8e\u6620\u5c04\u7684\u7ebf\u6027\u504f\u5dee\u7684\u4ee3\u4ef7\u51fd\u6570\u6765\u8ba1\u7b97\u3002\u5931\u771f\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u5f71\u50cf\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\uff0c\u628a\u53c2\u6570 \\(k_i\\) \u4e0e \\(P\\) \u4e00\u8d77\u5728\u51e0\u4f55\u8bef\u5dee\u7684\u6700\u5c0f\u5316\u8fed\u4ee3\u4e2d\u8ba1\u7b97","title":"\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P"},{"location":"cv/mvg/calc-p/#p","text":"\u7ea6 1967 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u7531 3 \u7ef4\u7a7a\u95f4\u4e0e\u56fe\u50cf\u5e73\u9762\u5143\u7d20\u95f4\u7684\u5bf9\u5e94\u6765\u4f30\u8ba1\u6444\u50cf\u673a\u6295\u5f71\u77e9\u9635\u7684\u6570\u503c\u65b9\u6cd5\uff08\u7b80\u79f0\u786e\u5b9a\u6444\u50cf\u673a\u53c2\u6570\uff09","title":"\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 p"},{"location":"cv/mvg/calc-p/#_1","text":"\u5bf9\u4e8e\u6bcf\u7ec4\u5bf9\u5e94 \\(\\mathbf{X}_i \\leftrightarrow \\mathbf{x}_i\\) \uff0c\u53ef\u4ee5\u5f97\u51fa\u4e0b\u9762\u5173\u7cfb\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i\\mathbf{X}_i^\\top & y_i\\mathbf{X}_i^\\top \\\\ w_i\\mathbf{X}_i^\\top & \\mathbf{0}^\\top & -x_i\\mathbf{X}_i^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{p}_1 \\\\ \\mathbf{p}_2 \\\\ \\mathbf{p}_3 \\end{bmatrix} = \\mathbf{0} \\] \u6700\u5c0f\u914d\u7f6e\u89e3 \uff1a\u77e9\u9635 P \u6709 12 \u4e2a\u5143\u7d20\u548c\uff08\u5ffd\u7565\u7f29\u653e\u56e0\u5b50\uff0911 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u89e3 P \u9700\u8981 11 \u4e2a\u65b9\u7a0b\u3002\u7ed9\u5b9a\u8fd9\u4e2a\u6700\u5c0f\u6570\u76ee\u7684\u5bf9\u5e94\u65f6\uff0c\u89e3\u65f6\u7cbe\u786e\u7684\uff0c\u5373\u7a7a\u95f4\u7684\u70b9\u51c6\u786e\u5730\u6295\u5f71\u5230\u5b83\u4eec\u88ab\u6d4b\u91cf\u5230\u56fe\u50cf\u4e0a \u8d85\u5b9a\u89e3 \uff1a\u5982\u679c\u7531\u4e8e\u70b9\u5750\u6807\u7684\u566a\u58f0\u5bfc\u81f4\u6570\u636e\u4e0d\u7cbe\u786e\u5e76\u4e14\u7ed9\u5b9a \\(n \\ge 6\\) \u7ec4\u70b9\u5bf9\u5e94\uff0c\u90a3\u4e48 \\(A\\mathbf{p}=\\mathbf{0}\\) \u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002P \u7684\u89e3\u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u4ee3\u6570\u6216\u51e0\u4f55\u8bef\u5dee\u6765\u83b7\u5f97\u3002\u6c42 \\(\\parallel A \\mathbf{p} \\parallel\\) \u7684\u6700\u5c0f\u503c\uff0c\u53ef\u80fd\u7684\u7ea6\u675f\u662f\uff1a \\(\\parallel \\mathbf{p} \\parallel = 1\\) \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{p}}^3\\) \u662f\u7531 P \u6700\u540e\u4e00\u884c\u7684\u524d\u4e09\u4e2a\u5143\u7d20\u7ec4\u6210\u7684\u77e2\u91cf \\((p_{31},p_{32},p_{33})^\\top\\) \u9000\u5316\u914d\u7f6e \u6444\u50cf\u673a\u4e2d\u5fc3\u548c\u70b9\u90fd\u5728\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u4e0a \u8fd9\u4e9b\u70b9\u90fd\u5728\u4e00\u5f20\u5e73\u9762\u548c\u5305\u542b\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u5e76\u96c6\u4e0a \u6570\u636e\u5f52\u4e00\u5316 \uff1a\u5f53\u70b9\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\u53d8\u5316\u76f8\u5bf9\u6bd4\u8f83\u5c0f\u65f6\uff0c\u91c7\u7528\u540c\u6837\u7c7b\u578b\u7684\u5f52\u4e00\u5316\u3002\u56e0\u6b64\uff0c\u628a\u70b9\u7684\u5f62\u5fc3\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u5e76\u5bf9\u5b83\u4eec\u7684\u5750\u6807\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684 RMS\uff08\u5747\u65b9\u6839\uff09\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{3}\\) \u3002\u9002\u7528\u4e8e\u70b9\u7d27\u81f4\u5206\u5e03\u7684\u60c5\u5f62 \u76f4\u7ebf\u5bf9\u5e94 \uff1a3D \u4e2d\u7684\u76f4\u7ebf\u53ef\u4ee5\u7528\u5b83\u901a\u8fc7\u7684\u4e24\u70b9 \\(\\mathbf{X}_0\\) \u548c \\(\\mathbf{X}_1\\) \u6765\u8868\u793a\u3002\u7531\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5f97\u5230\u7684\u5e73\u9762\u4e3a \\(P^\\top\\mathbf{l}\\) \u3002\u90a3\u4e48\u70b9 \\(\\mathbf{X}_j\\) \u5728\u8be5\u5e73\u9762\u4e0a\u7684\u6761\u4ef6\u662f \\(\\mathbf{l}^\\top P \\mathbf{X}_j = 0\\) \uff0c\u5176\u4e2d \\(j=0,1\\)","title":"\u57fa\u672c\u65b9\u7a0b"},{"location":"cv/mvg/calc-p/#_2","text":"\u56fe\u50cf\u4e2d\u7684\u51e0\u4f55\u8bef\u5dee \\(\\underset{i}{\\sum}d(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_i\\) \u662f\u88ab\u6d4b\u91cf\u7684\u70b9\uff0c \\(\\hat{\\mathbf{x}}_i\\) \u662f\u70b9 \\(P\\mathbf{X}_i\\) \uff0c\u5373 \\(\\mathbf{X}_i\\) \u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u7cbe\u786e\u7684\u56fe\u50cf\u70b9 \u5982\u679c\u6d4b\u91cf\u8bef\u5dee\u6ee1\u8db3\u9ad8\u65af\u5206\u5e03\uff0c\u90a3\u4e48 \\(\\underset{P}{\\min}\\underset{i}{\\sum}d(\\mathbf{x}_i,P\\mathbf{X}_i)^2\\) \u7684\u89e3\u662f \\(P\\) \u7684\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u4e16\u754c\u70b9\u6709\u8bef\u5dee 3D \u51e0\u4f55\u8bef\u5dee\u5b9a\u4e49\u4e3a\uff1a \\(\\underset{i}{\\sum}d(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u7684\u8bef\u5dee\u90fd\u8003\u8651\uff1a \\(\\underset{i=1}{\\sum}d_{Mah}(\\mathbf{x}_i,P\\hat{\\mathbf{X}}_i)^2+d_{Mah}(\\mathbf{X}+\\hat{\\mathbf{X}}_i)^2\\) \uff0c \\(d_{Mah}\\) \u8868\u793a\u8bef\u5dee\u534f\u65b9\u5dee\u77e9\u9635\u7684 Mahalanobis \u8ddd\u79bb","title":"\u51e0\u4f55\u8bef\u5dee"},{"location":"cv/mvg/calc-p/#_3","text":"\u5047\u5b9a\u6240\u6709\u7684\u70b9 \\(\\mathbf{X}_i\\) \u5728 DLT \u7b97\u6cd5\u4e2d\u5df2\u7ecf\u5f52\u4e00\u5316\uff0cDLT \u7b97\u6cd5\u8981\u6700\u5c0f\u5316\u7684\u91cf\u662f\uff1a \\(\\sum_{i}(\\hat{w}_id(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i))^2\\) \uff0c\u5176\u4e2d \\(\\hat{w}(\\hat{x}_i,\\hat{y}_i,1)^\\top=P\\mathbf{X}_i\\) \uff0c \\(\\hat{w}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u70b9 \\(\\mathbf{X}_i\\) \u6cbf\u4e3b\u8f74\u65b9\u5411\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\uff0c\u8981\u6700\u5c0f\u5316\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4e8e \\(f\\sum_id(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u53d8\u6362\u4e0d\u53d8\u6027 \uff1a\u5728\u7ea6\u675f \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316 \\(A\\mathbf{p}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u6700\u5c0f\u5316 3D \u51e0\u4f55\u8ddd\u79bb\u3002\u8fd9\u6837\u65e2\u4e0d\u53d7 3D \u7a7a\u95f4\u4e5f\u4e0d\u53d7\u56fe\u50cf\u7a7a\u95f4\u7684\u76f8\u4f3c\u53d8\u6362\u7684\u5f71\u54cd","title":"\u4ee3\u6570\u8bef\u5dee\u7684\u96c6\u5408\u89e3\u91ca"},{"location":"cv/mvg/calc-p/#_4","text":"\u4e0a\u9762\u6709\u5173\u5c04\u5f71\u6444\u50cf\u673a\u63a8\u5bfc\u7684\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u4eff\u5c04\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u5b9a\u4e49\u4e3a\u5c04\u5f71\u77e9\u9635\u7684\u6700\u540e\u4e00\u884c\u662f \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u7684 DLT \u4f30\u8ba1\u662f\u5728 \\(P\\) \u7684\u6700\u540e\u4e00\u884c\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u4e0b\u6700\u5c0f\u5316 \\(\\parallel A \\mathbf{p} \\parallel\\)","title":"\u4eff\u5c04\u6444\u50cf\u673a\u7684\u4f30\u8ba1"},{"location":"cv/mvg/calc-p/#_5","text":"\u5728\u5173\u4e8e\u6444\u50cf\u673a\u53c2\u6570\u7684\u9650\u5236\u6761\u4ef6\u4e0b\u5bfb\u6c42\u4e00\u4e2a\u6700\u9002\u914d\u7684\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \uff0c\u901a\u5e38\u7684\u9650\u5236\u6709 \u626d\u66f2 \\(s\\) \u4e3a 0 \u50cf\u7d20\u662f\u6b63\u65b9\u5f62: \\(\\alpha_x=\\alpha_y\\) \u4e3b\u70b9 \\((x_0,y_0)^2\\) \u5df2\u77e5 \u6574\u4e2a\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u5df2\u77e5 \u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee \uff1a\u5047\u5b9a\u6211\u4eec\u5f3a\u8c03\u7ea6\u675f \\(s=0\\) \u548c \\(\\alpha_x=\\alpha_y\\) \uff0c\u7528\u4f59\u4e0b\u7684 9 \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u6444\u50cf\u673a\u77e9\u9635\u3002\u51e0\u4f55\u8bef\u5dee\u53ef\u4ee5\u7528\u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5\u76f8\u5bf9\u4e8e\u8fd9\u7ec4\u53c2\u6570\u6765\u6700\u5c0f\u5316 \u6700\u5c0f\u5316\u4ee3\u6570\u8bef\u5dee \uff1a\u8003\u8651\u628a\u53c2\u6570\u96c6 \\(\\mathbf{q}\\) \u6620\u5c04\u5230\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u53c2\u6570\u5316\u6620\u5c04 \\(g\\) \uff0c\u6700\u5c0f\u5316\u6240\u6709\u70b9\u5339\u914d\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 \\(\\parallel Ag(\\mathbf{q}) \\parallel\\) \u7b80\u5316\u7684\u6d4b\u91cf\u77e9\u9635 \uff1a\u4e00\u822c\uff0c \\(2n \\times 12\\) \u7684\u77e9\u9635 \\(A\\) \u53ef\u80fd\u6709\u5f88\u591a\u884c\u3002\u4f46\u53ef\u7528\u4e00\u4e2a \\(12 \\times 12\\) \u7684\u77e9\u9635 \\(\\hat{A}\\) \u6765\u4ee3\u66ff \\(A\\) \uff0c\u4f7f\u5f97\u5bf9\u4efb\u4f55\u77e2\u91cf \\(\\mathbf{p}\\) \u6709 \\(\\parallel A \\mathbf{p} \\parallel = \\mathbf{p}^\\top A^\\top A \\mathbf{p} = \\parallel \\hat{A} \\mathbf{p} \\parallel\\) \u521d\u59cb\u5316 \uff1a\u6c42\u6444\u50cf\u673a\u521d\u59cb\u5316\u53c2\u6570\u7684\u4e00\u79cd\u9014\u5f84\uff1a \u7528\u8bf8\u5982 DLT \u7684\u7ebf\u6027\u7b97\u6cd5\u6c42\u51fa\u4e00\u4e2a\u521d\u59cb\u7684\u6444\u50cf\u673a\u77e9\u9635 \u628a\u56fa\u5b9a\u53c2\u6570\u5f3a\u5236\u5230\u6240\u5e0c\u671b\u7684\u53d6\u503c\u8303\u56f4 \u628a\u6444\u50cf\u673a\u77e9\u9635\u5206\u89e3\u6240\u83b7\u5f97\u7684\u521d\u59cb\u503c\u8d4b\u7ed9\u53c2\u6570\u53d8\u91cf \u5916\u90e8\u6821\u51c6 \uff1a\u4e3a\u4e86\u8ba1\u7b97\u5916\u90e8\u6821\u51c6\uff0c\u9700\u5bf9\u4e16\u754c\u5750\u6807\u4f4d\u7f6e\u51c6\u786e\u5df2\u77e5\u7684\u4e00\u4e2a\u914d\u7f6e\u8fdb\u884c\u5f71\u50cf\u3002\u4e4b\u540e\u6c42\u6444\u50cf\u673a\u7684\u59ff\u6001\u3002\u5728\u673a\u5668\u4eba\u7cfb\u7edf\u7684\u624b\u773c\u6807\u5b9a\u4e2d\u6c42\u6444\u50cf\u673a\u4f4d\u7f6e\u5c31\u662f\u8fd9\u6837\u7684\u60c5\u5f62\uff1b\u8fd8\u6709\u5728\u91c7\u7528\u914d\u51c6\u6280\u672f\u7684\u57fa\u4e8e\u6a21\u578b\u7684\u8bc6\u522b\u4e2d\uff0c\u9700\u8981\u77e5\u9053\u7269\u4f53\u76f8\u5bf9\u6444\u50cf\u673a\u7684\u4f4d\u7f6e \u534f\u65b9\u5dee\u4f30\u8ba1 \uff1a\u5047\u5b9a\u6240\u6709\u7684\u65e0\u64e6\u597d\u4ec5\u53d1\u751f\u5728\u56fe\u50cf\u6d4b\u91cf\u4e2d\uff0cML \u6b8b\u5dee\u671f\u671b\u503c\u7b49\u4e8e \\(\\varepsilon_{res}=\\delta(1-d/2n)^{1/2}\\) \uff0c\u5176\u4e2d \\(d\\) \u662f\u8981\u62df\u5408\u7684\u6444\u50cf\u673a\u53c2\u6570\u6570\u76ee\uff08\u5bf9\u5b8c\u6574\u7684\u9488\u5b54\u6444\u50cf\u673a\u6a21\u578b\u662f 11\uff09\u3002\u7ed9\u5b9a\u4e00\u4e2a\u6b8b\u5dee\uff0c\u8be5\u516c\u5f0f\u4e5f\u53ef\u4ee5\u7528\u6765\u4f30\u8ba1\u70b9\u6d4b\u91cf\u7684\u51c6\u786e\u6027","title":"\u53d7\u9650\u6444\u50cf\u673a\u4f30\u8ba1"},{"location":"cv/mvg/calc-p/#_6","text":"\u7528 \\((\\tilde{x},\\tilde{y})^\\top\\) \u6807\u8bb0\u5728\u7406\u60f3\uff08\u975e\u5931\u771f\uff09\u9488\u5b54\u6295\u5f71\u4e0b\u70b9\u4ee5\u7126\u8ddd\u4e3a\u6d4b\u91cf\u5355\u4f4d\u7684\u5750\u6807\u3002\u5bf9\u4e00\u70b9 \\(\\mathbf{X}\\) \u6709\uff1a \\((\\tilde{x},\\tilde{y},1)^\\top=[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u4e0b\u7684 3D \u70b9\uff0c\u5b9e\u9645\u7684\u6295\u5f71\u70b9\u901a\u8fc7\u4e00\u4e2a\u5f84\u5411\u4f4d\u79fb\u4e0e\u7406\u60f3\u70b9\u5173\u8054\u3002\u56e0\u6b64\uff0c\u5f84\u5411\uff08\u900f\u955c\uff09\u5931\u771f\u7684\u6a21\u578b\u662f\uff1a \\[\\begin{bmatrix} x_d \\\\ y_d \\end{bmatrix}=L(\\tilde{r})\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\end{bmatrix}\\] \\((\\tilde{x},\\tilde{y})^\\top\\) \u662f\u7406\u60f3\u56fe\u50cf\u4f4d\u7f6e\uff08\u9075\u5faa\u7ebf\u6027\u6295\u5f71\uff09 \\((x_d,y_d)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u540e\u7684\u5b9e\u9645\u56fe\u50cf\u7684\u4f4d\u7f6e \\(\\tilde{r}\\) \u4e3a\u5f84\u5411\u5931\u771f\u4e2d\u5fc3\u7684\u5f84\u5411\u8ddd\u79bb \\(\\sqrt{\\tilde{x}^2+\\tilde{y}^2}\\) \\(L(\\tilde{r})\\) \u662f\u4e00\u4e2a\u5931\u771f\u56e0\u5b50\uff0c\u5b83\u4ec5\u4ec5\u662f\u534a\u5f84 \\(\\tilde{r}\\) \u7684\u51fd\u6570 \u5931\u771f\u77eb\u6b63 \uff1a\u5728\u50cf\u7d20\u5750\u6807\u4e2d\uff0c\u5931\u771f\u77eb\u6b63\u8bb0\u4e3a \\[ \\hat{x}=x_c+L(r)(x-x_c) \\ \\ \\ \\ \\ \\ \\hat{y}=y_c+L(r)(y-y_c) \\] \\((x,y)^\\top\\) \u662f\u6d4b\u91cf\u7684\u5750\u6807 \\((\\hat{x},\\hat{y})^\\top\\) \u662f\u77eb\u6b63\u540e\u7684\u5750\u6807 \\((x_c,y_c)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\u4e14 \\(r^2=(x-x_c)^2+(y-y_c)^2\\) \uff0c\u6ce8\u610f\u5982\u679c\u957f\u5bbd\u6bd4\u4e0d\u662f 1\uff0c\u90a3\u4e48\u5728\u8ba1\u7b97 \\(r\\) \u65f6\u5fc5\u987b\u5bf9\u5b83\u8fdb\u884c\u77eb\u6b63 \u5931\u771f\u51fd\u6570\u548c\u4e2d\u5fc3\u7684\u9009\u62e9 \uff1a\u51fd\u6570 \\(L(r)\\) \u4ec5\u5f53 \\(r\\) \u4e3a\u6b63\u503c\u65f6\u6709\u5b9a\u4e49\u5e76\u4e14 \\(L(0)=1\\) \u3002\u4e00\u4e2a\u4efb\u610f\u51fd\u6570 \\(L(r)\\) \u7684\u903c\u8fd1\u53ef\u4ee5\u7531\u6cf0\u52d2\u5c55\u5f00\u5f0f \\(L(r)=1+\\mathcal{k}_1r+\\mathcal{k}_2r^2+\\mathcal{k}_3r^3+...\\) \u3002 \\(\\{k_1,k_2,k_3,...,x_c,y_c\\}\\) \u662f\u5f84\u5411\u77eb\u6b63\u7684\u7cfb\u6570\u3002\u4e3b\u70b9\u7ecf\u5e38\u88ab\u7528\u4f5c\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\uff0c\u867d\u7136\u5b83\u4eec\u672a\u5fc5\u5b8c\u5168\u91cd\u5408 \u8ba1\u7b97\u5931\u771f\u51fd\u6570 \uff1a\u51fd\u6570 \\(L(r)\\) \u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u57fa\u4e8e\u6620\u5c04\u7684\u7ebf\u6027\u504f\u5dee\u7684\u4ee3\u4ef7\u51fd\u6570\u6765\u8ba1\u7b97\u3002\u5931\u771f\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u5f71\u50cf\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\uff0c\u628a\u53c2\u6570 \\(k_i\\) \u4e0e \\(P\\) \u4e00\u8d77\u5728\u51e0\u4f55\u8bef\u5dee\u7684\u6700\u5c0f\u5316\u8fed\u4ee3\u4e2d\u8ba1\u7b97","title":"\u5f84\u5411\u5931\u771f"},{"location":"cv/mvg/camera-model/","text":"\u6444\u50cf\u673a\u6a21\u578b \u00b6 \u7ea6 3055 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6444\u50cf\u673a\u662f 3D \u4e16\u754c\uff08\u7269\u4f53\u7a7a\u95f4\uff09\u548c 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u6620\u5c04\u3002\u591a\u89c6\u56fe\u4e2d\u4e3b\u8981\u5173\u5fc3 \u4e2d\u5fc3\u6295\u5f71 \u3002 \u5177\u4f53\u6a21\u578b\u4e3b\u8981\u5206\u6210\u6709\u9650\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u548c\u201c\u65e0\u7a77\u8fdc\u201d\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u3002 \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u70b9\u7684\u6295\u5f71\u3002 \u6709\u9650\u6444\u50cf\u673a \u00b6 \u57fa\u672c\u9488\u5b54\u6a21\u578b \u00b6 \u4ee4\u6295\u5f71\u4e2d\u5fc3\u4f4d\u4e8e\u4e00\u4e2a\u6b27\u6c0f\u5750\u6807\u7cfb\u7684\u539f\u70b9\uff0c\u800c\u5e73\u9762 \\(Z=f\\) \u88ab\u79f0\u4e3a \u56fe\u50cf\u5e73\u9762 \u6216 \u805a\u7126\u5e73\u9762 \u3002 \u5728\u9488\u5b54\u6a21\u578b\u4e0b\uff0c\u7a7a\u95f4\u5750\u6807\u4e3a \\(\\mathbf{X}=(X,Y,Z)^\\top\\) \uff0c\u4ece\u4e16\u754c\u5750\u6807\u5230\u56fe\u50cf\u5750\u6807\u7684\u4e2d\u5fc3\u6295\u5f71\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z,fY/Z)^\\top\\) \u5c04\u5f71\u4e2d\u5fc3\u79f0\u4e3a \u6444\u50cf\u673a\u4e2d\u5fc3 \uff0c\u4e5f\u6210 \u5149\u5fc3 \u3002 \u6444\u50cf\u673a\u4e2d\u5fc3\u5230\u56fe\u50cf\u5e73\u9762\u7684\u5782\u7ebf\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u8f74 \u6216 \u4e3b\u5c04\u7ebf \uff0c\u800c\u4e3b\u8f74\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u79f0\u4e3a \u4e3b\u70b9 \uff0c\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u5e73\u9762\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u5e73\u9762 \u3002 \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e2d\u5fc3\u6295\u5f71\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX \\\\ fY \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & 0 & 0 \\\\ 0 & f & 0 & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\\\ \\\\ \u4e0a\u5f0f\u4e5f\u53ef\u8868\u793a\u4e3a \\ \\ \\ \\mathbf{x}=P\\mathbf{X} \\ \\ \\ \u5176\u4e2d \\ \\mathbf{X}\u7528\u56db\u7ef4\u9f50\u6b21\u77e2\u91cf(X,Y,Z,1)^\\top \u8868\u793a \\ P = diag(f,f,1)[\\mathbf{I}|\\mathbf{0}] \\] \u4e3b\u70b9\u504f\u7f6e \u4e0a\u9762\u8ba8\u8bba\u7684\u56fe\u50cf\u5e73\u9762\u7684\u5750\u6807\u539f\u70b9\u5728\u4e3b\u70b9\u4e0a\uff0c\u4f46\u5b9e\u9645\u4e0a\u53ef\u80fd\u4e0d\u662f\uff0c\u4e00\u822c\u60c5\u5f62\u7684\u6620\u5c04\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z+p_x,fY/Z+p_y)^\\top\\) \uff0c\u6839\u636e\u4e0a\u5f0f\u63a8\u5bfc\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX+Zp_x \\\\ fY+Zp_y \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & p_x & 0 \\\\ 0 & f & p_y & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\\\ \\\\ \\end{bmatrix} \\] \u4ee4 \\(K = \\begin{bmatrix} f & 0 & p_x \\\\ 0 & f & p_y \\\\ 0 & 0 & 1 \\end{bmatrix}\\) , \u5219\u6709 \\(\\mathbf{x}=K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d\u70b9 \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u7cfb\uff0c\u77e9\u9635 \\(K\\) \u79f0\u4e3a \u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635\uff08\u5185\u53c2\u77e9\u9635\uff09 \uff0c \\([\\mathbf{I}|\\mathbf{0}]\\) \u79f0\u4e3a \u5916\u53c2\u77e9\u9635 \u3002 \u6444\u50cf\u673a\u65cb\u8f6c\u4e0e\u4f4d\u79fb \\[ X_{cam}= \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\mathbf{X} \\\\ \\mathbf{x}=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\mathbf{X} \\] \u4e00\u822c\u7684\u9488\u5b54\u6444\u50cf\u673a \\(P=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\) \u6709 9 \u4e2a\u81ea\u7531\u5ea6\uff1b3 \u4e2a\u6765\u81ea \\(K\\) \uff0c3 \u4e2a\u6765\u81ea \\(R\\) \uff0c3 \u4e2a\u6765\u81ea \\(\\tilde{\\mathbf{C}}\\) \u3002 \\(K\\) \u4e2d\u7684\u53c2\u6570\u79f0\u4e3a\u6444\u50cf\u673a \u5185\u90e8\u53c2\u6570 \u6216\u6444\u50cf\u673a\u7684 \u5185\u90e8\u6821\u51c6 \u3002 \\(R\\) \u548c \\(\\tilde{\\mathbf{C}}\\) \u5e76\u79f0\u4e3a \u5916\u90e8\u53c2\u6570 \u6216 \u5916\u90e8\u6821\u51c6 \u3002\u6444\u50cf\u673a\u77e9\u9635\u53ef\u7b80\u5316\u6210\uff1a \\[ \\mathbf{P}=K[R|\\mathbf{t}]\uff0c\u5176\u4e2d \\ \\mathbf{t}=-R\\tilde{\\mathbf{C}} \\] CCD \u6444\u50cf\u673a \u00b6 CCD \u6444\u50cf\u673a\u7684\u50cf\u7d20\u53ef\u80fd\u4e0d\u662f\u6b63\u65b9\u5f62\uff0c\u5982\u679c\u56fe\u50cf\u5750\u6807\u4ee5\u50cf\u7d20\u6765\u6d4b\u91cf\uff0c\u90a3\u4e48\u9700\u8981\u5728\u6bcf\u4e2a\u65b9\u5411\u4e0a\u5f15\u5165\u975e\u7b49\u91cf\u5c3a\u5ea6\u56e0\u5b50\u3002 \u4e00\u822c\u5f62\u5f0f\uff1a \\[ K= \\begin{bmatrix} \\alpha_x & 0 & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u5176\u4e2d \\(\\alpha_x=fm_x, \\alpha_y=fm_y,x_0=m_xp_x,y_0=m_yp_y\\) \u3002 \\(m_x,m_y\\) \u5206\u522b\u662f\u5728 x \u548c y \u65b9\u5411\u4e0a\u56fe\u50cf\u5750\u6807\u5355\u4f4d\u77e9\u9635\u7684\u50cf\u7d20\u6570\u3002 \u4e00\u4e2a CCD \u6444\u50cf\u673a\u6709 10 \u4e2a\u81ea\u7531\u5ea6\u3002 \u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a \u00b6 \u8003\u8651\u5f62\u5982\u4e0b\u9762\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u589e\u52a0\u7684\u53c2\u6570 s \u79f0\u4e3a \u626d\u66f2\u53c2\u6570 \uff0c\u5bf9\u5927\u591a\u6570\u6807\u51c6\u7684\u6444\u50cf\u673a\u6765\u8bf4\uff0c\u5176\u626d\u66f2\u53c2\u6570\u4e3a 0\u3002 \\[ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u4e00\u4e2a\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u6709 11 \u4e2a\u81ea\u7531\u5ea6\u3002 \u5c04\u5f71\u6444\u50cf\u673a \u00b6 \u6444\u50cf\u673a\u6784\u9020 \u00b6 \u4e00\u822c\u5c04\u5f71\u6444\u50cf\u673a\u53ef\u4ee5\u6309 \\(P=[M|\\mathbf{p}_4]\\) \u5206\u5757\uff0c\u5176\u4e2d \\(M\\) \u662f \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c \\(M\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u5b83\u662f\u6709\u9650\u6444\u50cf\u673a\uff0c\u53cd\u4e4b\u5219\u4e0d\u7136 \u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u6444\u50cf\u673a\u4e2d\u5fc3 \\(C\\) \u662f \\(P\\) \u7684\u4e00\u7ef4\u53f3\u96f6\u7a7a\u95f4\uff0c\u5373 \\(P \\mathbf{C}=\\mathbf{0}\\) \u6709\u9650\u6444\u50cf\u673a \uff08M\u975e\u5947\u5f02\uff09 \\(\\mathbf{C}=\\begin{bmatrix} -M^{-1}\\mathbf{p}_4 \\\\ 1 \\end{bmatrix}\\) \u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff08M\u5947\u5f02\uff09 \\(\\mathbf{C} = \\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}\\) \uff0c\u5176\u4e2d\uff0c \\(\\mathbf{d}\\) \u662f \\(M\\) \u7684 3 \u7ef4\u96f6\u77e2\u91cf\uff0c\u5373 \\(M \\mathbf{d}=\\mathbf{0}\\) \u5217\u70b9 \uff1a\u5bf9\u4e8e \\(i=1,..,3\\) \uff0c\u5217\u77e2\u91cf \\(\\mathbf{p}_i\\) \u5206\u522b\u5bf9\u5e94\u4e8e \\(X,Y,Z\\) \u8f74\u5728\u56fe\u50cf\u4e0a\u7684\u6d88\u5f71\u70b9\u3002\u5217 \\(\\mathbf{p}_4\\) \u662f\u5750\u6807\u539f\u70b9\u7684\u56fe\u50cf \u4e3b\u5e73\u9762 \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5e73\u9762\u662f \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(\\mathbf{P}^3\\) \u8f74\u5e73\u9762 \uff1a\u5e73\u9762 \\(\\mathbf{P}^1\\) \u548c \\(\\mathbf{P}^2\\) \uff08 \\(P\\) \u7684\u7b2c\u4e00\u548c\u7b2c\u4e8c\u884c\uff09\u8868\u793a\u7a7a\u95f4\u4e2d\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5206\u522b\u5bf9\u5e94\u4e8e\u6620\u5c04\u5230\u56fe\u50cf\u4e0a\u76f4\u7ebf \\(x=0\\) \u548c \\(y=0\\) \u7684\u70b9 \u4e3b\u70b9 \uff1a\u56fe\u50cf\u70b9 \\(\\mathbf{x}_0=M\\mathbf{m}^3\\) \u662f\u6444\u50cf\u673a\u7684\u4e3b\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{m}^{3\\top}\\) \u662f \\(M\\) \u7684\u7b2c\u4e09\u884c \u4e3b\u5c04\u7ebf \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5c04\u7ebf\uff08\u4e3b\u8f74\uff09\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3 \\(\\mathbf{C}\\) \u800c\u65b9\u5411\u77e2\u91cf\u4e3a \\(\\mathbf{m}^{3\\top}\\) \u7684\u5c04\u7ebf\u3002\u4e3b\u8f74\u77e2\u91cf \\(\\mathbf{v}=\\det(M)\\mathbf{m}^3\\) \u6307\u5411\u6444\u50cf\u673a\u7684\u524d\u65b9 \u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u70b9\u7684\u4f5c\u7528 \u00b6 \u6b63\u5411\u6295\u5f71 \uff1a\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u70b9 \\(\\mathbf{D}=(\\mathbf{d}^\\top,\\mathbf{0})^\\top\\) \u8868\u793a\u6d88\u5f71\u70b9\uff0c\u8fd9\u4e9b\u70b9\u6620\u5c04\u5230 \\(\\mathbf{x}=P\\mathbf{D}=[M|\\mathbf{p}_4]=M\\mathbf{d}\\) \u70b9\u5230\u5c04\u5f71\u7684\u53cd\u5411\u6295\u5f71 \uff1a \u7ed9\u5b9a\u56fe\u50cf\u4e2d\u7684\u4e00\u4e2a\u70b9 \\(\\mathbf{x}\\) \u6765\u786e\u5b9a\u662f\u7a7a\u95f4\u7684\u90a3\u4e9b\u70b9\u88ab\u6620\u5c04\u5230\u8be5\u70b9\u3002\u8fd9\u4e9b\u70b9\u4ea4\u7ec4\u6210\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u7a7a\u95f4\u5c04\u7ebf\uff1a \\(\\mathbf{X}(\\lambda)=P^+\\mathbf{x}+\\lambda\\mathbf{C}\\) \u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\u3002 \\(P^+=P^\\top(PP^\\top)^{-1}\\) \u5e76\u4e14 \\(PP^+=I\\) \u4e00\u4e2a\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u53cd\u5411\u6295\u5f71\u7684\u5c04\u7ebf\u4ea4\u65e0\u7a77\u8fdc\u5e73\u9762\u4e8e\u70b9 \\(\\mathbf{D}=((M^{-1}\\mathbf{x})^\\top, 0)^\\top\\) \u3002\u5c06\u5c04\u7ebf\u5199\u6210\u5176\u4e0e\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e24\u70b9\u7684\u8fde\u63a5: \\[ \\mathbf{X}(\\mu)=\\mu\\begin{bmatrix}M^{-1}\\mathbf{x}\\\\0\\end{bmatrix}+ \\begin{bmatrix}-M^{-1}\\mathbf{p}_4\\\\1\\end{bmatrix}= \\begin{bmatrix}M^{-1}(\\mu\\mathbf{x}-\\mathbf{p}_4)\\\\1\\end{bmatrix} \\] \u70b9\u7684\u6df1\u5ea6 \u00b6 \u4ee4 \\(\\mathbf{X}=(X,Y,Z,T)^\\top\\) \u662f\u4e00\u4e2a 3D \u70b9\u800c \\(P=[M|\\mathbf{p}_4]\\) \u662f\u4e00\u4e2a\u6709\u9650\u6444\u50cf\u673a\u7684\u6444\u50cf\u673a\u77e9\u9635\uff0c\u5047\u5b9a \\(P(X,Y,Z,T)^\\top=w(x,y,1)^\\top\\) \uff0c\u90a3\u4e48 \\(depth(\\mathbf{X};P)=\\frac{sign(\\det M)w}{T\\parallel \\mathbf{m}^3 \\parallel}\\) \u662f\u5728\u6444\u50cf\u673a\u4e3b\u5e73\u9762\u524d\u65b9\u7684\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6 \u6444\u50cf\u673a\u77e9\u9635\u7684\u5206\u89e3 \u00b6 \u6c42\u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u4e2d\u5fc3 \\(\\mathbf{C}=(X,Y,Z,T)^\\top\\) \uff0c\u5176\u4e2d \\(X=\\det([\\mathbf{p}_2, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Y=-\\det([\\mathbf{p}_1, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Z=\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_4])\\) \\(T=-\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_3])\\) \u6c42\u6444\u50cf\u673a\u5b9a\u5411\u548c\u5185\u90e8\u53c2\u6570 \uff1a\u5728\u6709\u9650\u6444\u50cf\u673a\u7684\u60c5\u5f62\uff1a \\[ P=[M|-M\\tilde{\\mathbf{C}}]=K[R|-R\\tilde{\\mathbf{C}}] \\\\ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \\(\\alpha_x\\) \u662f \\(x-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(\\alpha_y\\) \u662f \\(y-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(s\\) \u662f\u626d\u66f2\u53c2\u6570 \\((x_0,y_0)^\\top\\) \u662f\u4e3b\u70b9\u7684\u5750\u6807 \u50cf\u7d20\u957f\u5bbd\u6bd4 \\(\\alpha_x/\\alpha_y\\) \u65e0\u7a77\u8fdc\u6444\u50cf\u673a \u00b6 \u65e0\u7a77\u8fdc\u6444\u50cf\u673a\u662f\u4e2d\u5fc3\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u6444\u50cf\u673a\u3002\u65e0\u7a77\u9009\u6444\u50cf\u673a\u53ef\u4ee5\u5206\u4e3a \u4eff\u5c04\u6444\u50cf\u673a \u548c \u975e\u4eff\u5c04\u6444\u50cf\u673a \u4eff\u5c04\u6444\u50cf\u673a \u00b6 \u4eff\u5c04\u6444\u50cf\u673a\u662f\u77e9\u9635 \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(P^{3\\top}\\) \u5f62\u5982 \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a \u5bf9\u4e8e\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\uff1a \\[ P_0=KR[I|-\\tilde{\\mathbf{C}}]=K \\begin{bmatrix} \\mathbf{r}^{1\\top}-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}} \\end{bmatrix} \\] \u5176\u4e2d \\(\\mathbf{r}^{i\\top}\\) \u662f\u65cb\u8f6c\u77e9\u9635\u7684\u7b2c i \u884c\u3002\u800c\u6570\u503c\u7684 \\(d_0=-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}}\\) \u662f\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u5728\u4e3b\u5c04\u7ebf\u65b9\u5411\u4e0a\u7684\u8ddd\u79bb \u6cbf\u4e3b\u5c04\u7ebf\u8ddf\u8e2a\u7684\u6548\u679c\u662f\u5c06\u77e9\u9635\u7684 \\((3,4)\\) \u5143\u7d20\u7528\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u6df1\u5ea6 \\(d_t\\) \u66ff\u4ee3 \u5047\u5b9a\u4f7f\u56fe\u50cf\u5927\u5c0f\u4fdd\u6301\u4e0d\u53d8\u7684\u653e\u5927\u56e0\u5b50\u662f \\(k=d_t/d_0\\) \uff0c\u5728\u65f6\u95f4 \\(t\\) \u6240\u4ea7\u751f\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f\uff1a \\[ P_t=K \\begin{bmatrix} d_t/d_0 & & \\\\ & d_t/d_0 & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}&d_t \\end{bmatrix}= \\frac{d_t}{d_0}K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}d_0/d_t&d_0 \\end{bmatrix} \\] \u56e0\u5b50 \\(d_t/d_0\\) \u53ef\u4ee5\u5ffd\u7565\uff0c\u5f53 \\(d_t\\) \u8d8b\u5411\u65e0\u7a77\u5927\u65f6\uff0c\u8be5\u77e9\u9635\u53d8\u6210 \\[ P_\\infty=\\lim_{t \\to \\infty}P_t=K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top&d_0 \\end{bmatrix} \\] \u5e94\u7528\u4eff\u5c04\u6444\u50cf\u673a\u7684\u8bef\u5dee \u00b6 \u5728\u8fc7\u4e16\u754c\u539f\u70b9\u5e76\u5782\u76f4\u5b50\u4e3b\u8f74\u65b9\u5411\u7684\u5e73\u9762\u4e0a\u7684\u4efb\u4f55\u70b9\u7684\u56fe\u50cf\u5728\u8fd9\u79cd\u53d8\u7126\u548c\u8fd0\u52a8\u7684\u590d\u5408\u4f5c\u7528\u4e0b\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u6837\u7684\u4e00\u4e2a\u70b9\u53ef\u4ee5\u8bb0\u4e3a \\(\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 \\\\ 1\\end{bmatrix}\\) \uff0c\u56e0\u4e3a \\(\\mathbf{r}^{3\\top}(\\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2)=0\\) \uff0c\u5373 \\(P_0\\mathbf{X}=P_t\\mathbf{X}=P_\\infty\\mathbf{X}\\) \u5bf9\u6240\u6709 \\(t\\) \u6210\u7acb \u5bf9\u4e0d\u5728\u8be5\u5e73\u9762\u4e0a\u7684\u70b9\uff0c\u8bbe\u4e00\u70b9 \\(\\mathbf{X}\\) \u79bb\u8be5\u5e73\u9762\u7684\u5782\u76f4\u8ddd\u79bb\u662f \\(\\Delta\\) \u8fd9\u4e2a 3D \u70b9\u53ef\u4ee5\u8868\u793a\u6210 \\[\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 + \\Delta\\mathbf{r}^3 \\\\ 1\\end{bmatrix}\\] \u5e76\u5206\u522b\u88ab\u6444\u50cf\u673a \\(P_0\\) \u548c \\(P_\\infty\\) \u5f71\u50cf\u5230 \\[ \\mathbf{x}_{proj}=P_0\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0+\\Delta \\end{bmatrix} \\ \\ \\ \\mathbf{x}_{affine}=P_\\infty\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0 \\end{bmatrix} \\] \u5176\u4e2d \\(\\tilde{x}=\\alpha-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}},\\tilde{y}=\\beta-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}}\\) \uff0c\u8bb0\u6807\u5b9a\u77e9\u9635\u4e3a\uff1a \\[ K=\\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\tilde{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\] \u56e0\u6b64\u4e24\u70b9\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_0= \\frac{d_0+\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u7528 \\(P_\\infty\\) \u4eff\u5c04\u8fd1\u4f3c\u771f\u5b9e\u6444\u50cf\u673a\u77e9\u9635 \\(P_0\\) \u7684\u6548\u5e94\u662f\u628a\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u5f84\u5411\u5730\u9760\u8fd1\u6216\u79bb\u5f00\u4e3b\u70b9 \\(\\tilde{\\mathbf{x}}_0\\) \uff0c\u5176\u52a0\u6743\u56e0\u5b50\u662f \\((d_0+\\Delta)/d_0=1+\\Delta/d_0\\) \u4eff\u5c04\u5f71\u50cf\u6761\u4ef6 \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_{proj}=\\frac{\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u6df1\u5ea6\u7684\u8d77\u4f0f( \\(\\Delta\\) )\u76f8\u5bf9\u5e73\u5747\u6df1\u5ea6( \\(d_0\\) )\u8f83\u5c0f \u70b9\u79bb\u4e3b\u8f74\u7684\u8ddd\u79bb\u8f83\u5c0f \\(P_\\infty\\) \u7684\u5206\u89e3 \u00b6 \u6444\u50cf\u673a\u77e9\u9635 \uff1a \\[ P_\\infty= \\begin{bmatrix} K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{t}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix}= \\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{0}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u5e73\u884c\u6295\u5f71 \u5e73\u884c\u6295\u5f71\u77e9\u9635 \\(\\begin{bmatrix} 1&0&0&0\\\\0&1&0&0\\\\0&0&0&1 \\end{bmatrix}\\) \u4ee3\u66ff\u79bb\u6709\u9650\u6444\u50cf\u673a\u7684\u89c4\u8303\u5c04\u5f71\u77e9\u9635 \\([\\mathbf{I}|\\mathbf{0}]\\) \u6807\u5b9a\u77e9\u9635 \\(\\begin{bmatrix}K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\\\hat{\\mathbf{0}}^\\top & 1\\end{bmatrix}\\) \u4ee3\u66ff\u4e86\u6709\u9650\u6444\u50cf\u673a\u7684 \\(K\\) \u4e3b\u70b9\u65e0\u5b9a\u4e49 \u4eff\u5c04\u6444\u50cf\u673a\u7684\u5c42\u6b21 \u00b6 \u6b63\u6295\u5f71 \uff1a\u6b63\u6295\u5f71\u6444\u50cf\u673a\u6709 5 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5373\u63cf\u8ff0\u65cb\u8f6c\u77e9\u9635 \\(R\\) \u7684\u4e09\u4e2a\u53c2\u6570\uff0c\u52a0\u4e0a\u4e24\u4e2a\u504f\u7f6e\u53c2\u6570 \\(t_1\\) \u548c \\(t_2\\) \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u7f29\u653e\u6b63\u6295\u5f71 \uff1a\u7f29\u653e\u6b63\u6295\u5f71\u662f\u6b63\u6295\u5f71\u7d27\u63a5\u4e00\u4e2a\u5747\u5300\u7f29\u653e\uff0c\u6709 6 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1/k \\end{bmatrix} \\] \u5f31\u900f\u89c6\u6295\u5f71 \uff1a\u4e0e\u6709\u9650 CCD \u6444\u50cf\u673a\u7c7b\u4f3c\uff0c\u8003\u8651\u4e24\u6839\u56fe\u50cf\u8f74\u7f29\u653e\u56e0\u5b50\u4e0d\u4e00\u6837\u7684\u65e0\u7a77\u8fdc\u6444\u50cf\u673a\uff0c\u6709 7 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\alpha_x & & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u4eff\u5c04\u6444\u50cf\u673a \\(P_A\\) \uff1a\u5982 \\(P_\\infty\\) \u4e00\u6837\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u7684\u5e73\u884c\u6295\u5f71\uff0c\u6709 8 \u4e2a\u81ea\u7531\u5ea6 \\[ P_A= \\begin{bmatrix} \\alpha_x & s & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u4eff\u5c04\u6444\u50cf\u673a\u7684\u5176\u4ed6\u6027\u8d28 \u00b6 \u4e3b\u5e73\u9762\u662f\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u4efb\u4f55\u5c04\u5f71\u6444\u50cf\u673a\u77e9\u9635\u662f\u4eff\u5c04\u6444\u50cf\u673a\u77e9\u9635 \u5e73\u884c\u7684\u4e16\u754c\u76f4\u7ebf\u88ab\u6295\u5f71\u6210\u5e73\u884c\u7684\u56fe\u50cf\u76f4\u7ebf \u6ee1\u8db3 \\(M_{2 \\times 3} \\mathbf{d}=\\mathbf{0}\\) \u7684\u77e2\u91cf \\(\\mathbf{d}\\) \u662f\u5e73\u884c\u6295\u5f71\u7684\u65b9\u5411\uff0c\u800c \\((\\mathbf{d}^\\top,0)^\\top\\) \u662f\u6444\u50cf\u673a\u4e2d\u5fc3\uff0c\u56e0\u4e3a \\(P_A\\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}=\\mathbf{0}\\) \u4e00\u822c\u65e0\u7a77\u8fdc\u6444\u50cf\u673a \u00b6 \u4eff\u5c04\u6444\u50cf\u673a \u975e\u4eff\u5c04\u6444\u50cf\u673a \u6444\u50cf\u673a\u4e2d\u5fc3\u5728 \\(\\pi_\\infty\\) \u4e0a \u662f \u662f \u4e3b\u5e73\u9762\u662f \\(\\pi_\\infty\\) \u662f \u4e0d\u662f \\(\\pi_\\infty\\) \u7684\u70b9\u7684\u56fe\u50cf\u5728 \\(\\mathbf{l}_\\infty\\) \u4e0a \u662f \u4e00\u822c\u4e0d\u662f \u5176\u4ed6\u6444\u50cf\u673a\u6a21\u578b \u00b6 \u63a8\u626b\u5f0f\u6444\u50cf\u673a \u7ebf\u9635\u6444\u50cf\u673a","title":"\u6444\u50cf\u673a\u6a21\u578b"},{"location":"cv/mvg/camera-model/#_1","text":"\u7ea6 3055 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6444\u50cf\u673a\u662f 3D \u4e16\u754c\uff08\u7269\u4f53\u7a7a\u95f4\uff09\u548c 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u6620\u5c04\u3002\u591a\u89c6\u56fe\u4e2d\u4e3b\u8981\u5173\u5fc3 \u4e2d\u5fc3\u6295\u5f71 \u3002 \u5177\u4f53\u6a21\u578b\u4e3b\u8981\u5206\u6210\u6709\u9650\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u548c\u201c\u65e0\u7a77\u8fdc\u201d\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u3002 \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u70b9\u7684\u6295\u5f71\u3002","title":"\u6444\u50cf\u673a\u6a21\u578b"},{"location":"cv/mvg/camera-model/#_2","text":"","title":"\u6709\u9650\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_3","text":"\u4ee4\u6295\u5f71\u4e2d\u5fc3\u4f4d\u4e8e\u4e00\u4e2a\u6b27\u6c0f\u5750\u6807\u7cfb\u7684\u539f\u70b9\uff0c\u800c\u5e73\u9762 \\(Z=f\\) \u88ab\u79f0\u4e3a \u56fe\u50cf\u5e73\u9762 \u6216 \u805a\u7126\u5e73\u9762 \u3002 \u5728\u9488\u5b54\u6a21\u578b\u4e0b\uff0c\u7a7a\u95f4\u5750\u6807\u4e3a \\(\\mathbf{X}=(X,Y,Z)^\\top\\) \uff0c\u4ece\u4e16\u754c\u5750\u6807\u5230\u56fe\u50cf\u5750\u6807\u7684\u4e2d\u5fc3\u6295\u5f71\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z,fY/Z)^\\top\\) \u5c04\u5f71\u4e2d\u5fc3\u79f0\u4e3a \u6444\u50cf\u673a\u4e2d\u5fc3 \uff0c\u4e5f\u6210 \u5149\u5fc3 \u3002 \u6444\u50cf\u673a\u4e2d\u5fc3\u5230\u56fe\u50cf\u5e73\u9762\u7684\u5782\u7ebf\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u8f74 \u6216 \u4e3b\u5c04\u7ebf \uff0c\u800c\u4e3b\u8f74\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u79f0\u4e3a \u4e3b\u70b9 \uff0c\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u5e73\u9762\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u5e73\u9762 \u3002 \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e2d\u5fc3\u6295\u5f71\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX \\\\ fY \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & 0 & 0 \\\\ 0 & f & 0 & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\\\ \\\\ \u4e0a\u5f0f\u4e5f\u53ef\u8868\u793a\u4e3a \\ \\ \\ \\mathbf{x}=P\\mathbf{X} \\ \\ \\ \u5176\u4e2d \\ \\mathbf{X}\u7528\u56db\u7ef4\u9f50\u6b21\u77e2\u91cf(X,Y,Z,1)^\\top \u8868\u793a \\ P = diag(f,f,1)[\\mathbf{I}|\\mathbf{0}] \\] \u4e3b\u70b9\u504f\u7f6e \u4e0a\u9762\u8ba8\u8bba\u7684\u56fe\u50cf\u5e73\u9762\u7684\u5750\u6807\u539f\u70b9\u5728\u4e3b\u70b9\u4e0a\uff0c\u4f46\u5b9e\u9645\u4e0a\u53ef\u80fd\u4e0d\u662f\uff0c\u4e00\u822c\u60c5\u5f62\u7684\u6620\u5c04\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z+p_x,fY/Z+p_y)^\\top\\) \uff0c\u6839\u636e\u4e0a\u5f0f\u63a8\u5bfc\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX+Zp_x \\\\ fY+Zp_y \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & p_x & 0 \\\\ 0 & f & p_y & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\\\ \\\\ \\end{bmatrix} \\] \u4ee4 \\(K = \\begin{bmatrix} f & 0 & p_x \\\\ 0 & f & p_y \\\\ 0 & 0 & 1 \\end{bmatrix}\\) , \u5219\u6709 \\(\\mathbf{x}=K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d\u70b9 \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u7cfb\uff0c\u77e9\u9635 \\(K\\) \u79f0\u4e3a \u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635\uff08\u5185\u53c2\u77e9\u9635\uff09 \uff0c \\([\\mathbf{I}|\\mathbf{0}]\\) \u79f0\u4e3a \u5916\u53c2\u77e9\u9635 \u3002 \u6444\u50cf\u673a\u65cb\u8f6c\u4e0e\u4f4d\u79fb \\[ X_{cam}= \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\mathbf{X} \\\\ \\mathbf{x}=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\mathbf{X} \\] \u4e00\u822c\u7684\u9488\u5b54\u6444\u50cf\u673a \\(P=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\) \u6709 9 \u4e2a\u81ea\u7531\u5ea6\uff1b3 \u4e2a\u6765\u81ea \\(K\\) \uff0c3 \u4e2a\u6765\u81ea \\(R\\) \uff0c3 \u4e2a\u6765\u81ea \\(\\tilde{\\mathbf{C}}\\) \u3002 \\(K\\) \u4e2d\u7684\u53c2\u6570\u79f0\u4e3a\u6444\u50cf\u673a \u5185\u90e8\u53c2\u6570 \u6216\u6444\u50cf\u673a\u7684 \u5185\u90e8\u6821\u51c6 \u3002 \\(R\\) \u548c \\(\\tilde{\\mathbf{C}}\\) \u5e76\u79f0\u4e3a \u5916\u90e8\u53c2\u6570 \u6216 \u5916\u90e8\u6821\u51c6 \u3002\u6444\u50cf\u673a\u77e9\u9635\u53ef\u7b80\u5316\u6210\uff1a \\[ \\mathbf{P}=K[R|\\mathbf{t}]\uff0c\u5176\u4e2d \\ \\mathbf{t}=-R\\tilde{\\mathbf{C}} \\]","title":"\u57fa\u672c\u9488\u5b54\u6a21\u578b"},{"location":"cv/mvg/camera-model/#ccd","text":"CCD \u6444\u50cf\u673a\u7684\u50cf\u7d20\u53ef\u80fd\u4e0d\u662f\u6b63\u65b9\u5f62\uff0c\u5982\u679c\u56fe\u50cf\u5750\u6807\u4ee5\u50cf\u7d20\u6765\u6d4b\u91cf\uff0c\u90a3\u4e48\u9700\u8981\u5728\u6bcf\u4e2a\u65b9\u5411\u4e0a\u5f15\u5165\u975e\u7b49\u91cf\u5c3a\u5ea6\u56e0\u5b50\u3002 \u4e00\u822c\u5f62\u5f0f\uff1a \\[ K= \\begin{bmatrix} \\alpha_x & 0 & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u5176\u4e2d \\(\\alpha_x=fm_x, \\alpha_y=fm_y,x_0=m_xp_x,y_0=m_yp_y\\) \u3002 \\(m_x,m_y\\) \u5206\u522b\u662f\u5728 x \u548c y \u65b9\u5411\u4e0a\u56fe\u50cf\u5750\u6807\u5355\u4f4d\u77e9\u9635\u7684\u50cf\u7d20\u6570\u3002 \u4e00\u4e2a CCD \u6444\u50cf\u673a\u6709 10 \u4e2a\u81ea\u7531\u5ea6\u3002","title":"CCD \u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_4","text":"\u8003\u8651\u5f62\u5982\u4e0b\u9762\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u589e\u52a0\u7684\u53c2\u6570 s \u79f0\u4e3a \u626d\u66f2\u53c2\u6570 \uff0c\u5bf9\u5927\u591a\u6570\u6807\u51c6\u7684\u6444\u50cf\u673a\u6765\u8bf4\uff0c\u5176\u626d\u66f2\u53c2\u6570\u4e3a 0\u3002 \\[ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u4e00\u4e2a\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u6709 11 \u4e2a\u81ea\u7531\u5ea6\u3002","title":"\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_5","text":"","title":"\u5c04\u5f71\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_6","text":"\u4e00\u822c\u5c04\u5f71\u6444\u50cf\u673a\u53ef\u4ee5\u6309 \\(P=[M|\\mathbf{p}_4]\\) \u5206\u5757\uff0c\u5176\u4e2d \\(M\\) \u662f \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c \\(M\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u5b83\u662f\u6709\u9650\u6444\u50cf\u673a\uff0c\u53cd\u4e4b\u5219\u4e0d\u7136 \u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u6444\u50cf\u673a\u4e2d\u5fc3 \\(C\\) \u662f \\(P\\) \u7684\u4e00\u7ef4\u53f3\u96f6\u7a7a\u95f4\uff0c\u5373 \\(P \\mathbf{C}=\\mathbf{0}\\) \u6709\u9650\u6444\u50cf\u673a \uff08M\u975e\u5947\u5f02\uff09 \\(\\mathbf{C}=\\begin{bmatrix} -M^{-1}\\mathbf{p}_4 \\\\ 1 \\end{bmatrix}\\) \u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff08M\u5947\u5f02\uff09 \\(\\mathbf{C} = \\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}\\) \uff0c\u5176\u4e2d\uff0c \\(\\mathbf{d}\\) \u662f \\(M\\) \u7684 3 \u7ef4\u96f6\u77e2\u91cf\uff0c\u5373 \\(M \\mathbf{d}=\\mathbf{0}\\) \u5217\u70b9 \uff1a\u5bf9\u4e8e \\(i=1,..,3\\) \uff0c\u5217\u77e2\u91cf \\(\\mathbf{p}_i\\) \u5206\u522b\u5bf9\u5e94\u4e8e \\(X,Y,Z\\) \u8f74\u5728\u56fe\u50cf\u4e0a\u7684\u6d88\u5f71\u70b9\u3002\u5217 \\(\\mathbf{p}_4\\) \u662f\u5750\u6807\u539f\u70b9\u7684\u56fe\u50cf \u4e3b\u5e73\u9762 \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5e73\u9762\u662f \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(\\mathbf{P}^3\\) \u8f74\u5e73\u9762 \uff1a\u5e73\u9762 \\(\\mathbf{P}^1\\) \u548c \\(\\mathbf{P}^2\\) \uff08 \\(P\\) \u7684\u7b2c\u4e00\u548c\u7b2c\u4e8c\u884c\uff09\u8868\u793a\u7a7a\u95f4\u4e2d\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5206\u522b\u5bf9\u5e94\u4e8e\u6620\u5c04\u5230\u56fe\u50cf\u4e0a\u76f4\u7ebf \\(x=0\\) \u548c \\(y=0\\) \u7684\u70b9 \u4e3b\u70b9 \uff1a\u56fe\u50cf\u70b9 \\(\\mathbf{x}_0=M\\mathbf{m}^3\\) \u662f\u6444\u50cf\u673a\u7684\u4e3b\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{m}^{3\\top}\\) \u662f \\(M\\) \u7684\u7b2c\u4e09\u884c \u4e3b\u5c04\u7ebf \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5c04\u7ebf\uff08\u4e3b\u8f74\uff09\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3 \\(\\mathbf{C}\\) \u800c\u65b9\u5411\u77e2\u91cf\u4e3a \\(\\mathbf{m}^{3\\top}\\) \u7684\u5c04\u7ebf\u3002\u4e3b\u8f74\u77e2\u91cf \\(\\mathbf{v}=\\det(M)\\mathbf{m}^3\\) \u6307\u5411\u6444\u50cf\u673a\u7684\u524d\u65b9","title":"\u6444\u50cf\u673a\u6784\u9020"},{"location":"cv/mvg/camera-model/#_7","text":"\u6b63\u5411\u6295\u5f71 \uff1a\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u70b9 \\(\\mathbf{D}=(\\mathbf{d}^\\top,\\mathbf{0})^\\top\\) \u8868\u793a\u6d88\u5f71\u70b9\uff0c\u8fd9\u4e9b\u70b9\u6620\u5c04\u5230 \\(\\mathbf{x}=P\\mathbf{D}=[M|\\mathbf{p}_4]=M\\mathbf{d}\\) \u70b9\u5230\u5c04\u5f71\u7684\u53cd\u5411\u6295\u5f71 \uff1a \u7ed9\u5b9a\u56fe\u50cf\u4e2d\u7684\u4e00\u4e2a\u70b9 \\(\\mathbf{x}\\) \u6765\u786e\u5b9a\u662f\u7a7a\u95f4\u7684\u90a3\u4e9b\u70b9\u88ab\u6620\u5c04\u5230\u8be5\u70b9\u3002\u8fd9\u4e9b\u70b9\u4ea4\u7ec4\u6210\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u7a7a\u95f4\u5c04\u7ebf\uff1a \\(\\mathbf{X}(\\lambda)=P^+\\mathbf{x}+\\lambda\\mathbf{C}\\) \u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\u3002 \\(P^+=P^\\top(PP^\\top)^{-1}\\) \u5e76\u4e14 \\(PP^+=I\\) \u4e00\u4e2a\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u53cd\u5411\u6295\u5f71\u7684\u5c04\u7ebf\u4ea4\u65e0\u7a77\u8fdc\u5e73\u9762\u4e8e\u70b9 \\(\\mathbf{D}=((M^{-1}\\mathbf{x})^\\top, 0)^\\top\\) \u3002\u5c06\u5c04\u7ebf\u5199\u6210\u5176\u4e0e\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e24\u70b9\u7684\u8fde\u63a5: \\[ \\mathbf{X}(\\mu)=\\mu\\begin{bmatrix}M^{-1}\\mathbf{x}\\\\0\\end{bmatrix}+ \\begin{bmatrix}-M^{-1}\\mathbf{p}_4\\\\1\\end{bmatrix}= \\begin{bmatrix}M^{-1}(\\mu\\mathbf{x}-\\mathbf{p}_4)\\\\1\\end{bmatrix} \\]","title":"\u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u70b9\u7684\u4f5c\u7528"},{"location":"cv/mvg/camera-model/#_8","text":"\u4ee4 \\(\\mathbf{X}=(X,Y,Z,T)^\\top\\) \u662f\u4e00\u4e2a 3D \u70b9\u800c \\(P=[M|\\mathbf{p}_4]\\) \u662f\u4e00\u4e2a\u6709\u9650\u6444\u50cf\u673a\u7684\u6444\u50cf\u673a\u77e9\u9635\uff0c\u5047\u5b9a \\(P(X,Y,Z,T)^\\top=w(x,y,1)^\\top\\) \uff0c\u90a3\u4e48 \\(depth(\\mathbf{X};P)=\\frac{sign(\\det M)w}{T\\parallel \\mathbf{m}^3 \\parallel}\\) \u662f\u5728\u6444\u50cf\u673a\u4e3b\u5e73\u9762\u524d\u65b9\u7684\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6","title":"\u70b9\u7684\u6df1\u5ea6"},{"location":"cv/mvg/camera-model/#_9","text":"\u6c42\u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u4e2d\u5fc3 \\(\\mathbf{C}=(X,Y,Z,T)^\\top\\) \uff0c\u5176\u4e2d \\(X=\\det([\\mathbf{p}_2, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Y=-\\det([\\mathbf{p}_1, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Z=\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_4])\\) \\(T=-\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_3])\\) \u6c42\u6444\u50cf\u673a\u5b9a\u5411\u548c\u5185\u90e8\u53c2\u6570 \uff1a\u5728\u6709\u9650\u6444\u50cf\u673a\u7684\u60c5\u5f62\uff1a \\[ P=[M|-M\\tilde{\\mathbf{C}}]=K[R|-R\\tilde{\\mathbf{C}}] \\\\ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \\(\\alpha_x\\) \u662f \\(x-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(\\alpha_y\\) \u662f \\(y-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(s\\) \u662f\u626d\u66f2\u53c2\u6570 \\((x_0,y_0)^\\top\\) \u662f\u4e3b\u70b9\u7684\u5750\u6807 \u50cf\u7d20\u957f\u5bbd\u6bd4 \\(\\alpha_x/\\alpha_y\\)","title":"\u6444\u50cf\u673a\u77e9\u9635\u7684\u5206\u89e3"},{"location":"cv/mvg/camera-model/#_10","text":"\u65e0\u7a77\u8fdc\u6444\u50cf\u673a\u662f\u4e2d\u5fc3\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u6444\u50cf\u673a\u3002\u65e0\u7a77\u9009\u6444\u50cf\u673a\u53ef\u4ee5\u5206\u4e3a \u4eff\u5c04\u6444\u50cf\u673a \u548c \u975e\u4eff\u5c04\u6444\u50cf\u673a","title":"\u65e0\u7a77\u8fdc\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_11","text":"\u4eff\u5c04\u6444\u50cf\u673a\u662f\u77e9\u9635 \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(P^{3\\top}\\) \u5f62\u5982 \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a \u5bf9\u4e8e\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\uff1a \\[ P_0=KR[I|-\\tilde{\\mathbf{C}}]=K \\begin{bmatrix} \\mathbf{r}^{1\\top}-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}} \\end{bmatrix} \\] \u5176\u4e2d \\(\\mathbf{r}^{i\\top}\\) \u662f\u65cb\u8f6c\u77e9\u9635\u7684\u7b2c i \u884c\u3002\u800c\u6570\u503c\u7684 \\(d_0=-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}}\\) \u662f\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u5728\u4e3b\u5c04\u7ebf\u65b9\u5411\u4e0a\u7684\u8ddd\u79bb \u6cbf\u4e3b\u5c04\u7ebf\u8ddf\u8e2a\u7684\u6548\u679c\u662f\u5c06\u77e9\u9635\u7684 \\((3,4)\\) \u5143\u7d20\u7528\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u6df1\u5ea6 \\(d_t\\) \u66ff\u4ee3 \u5047\u5b9a\u4f7f\u56fe\u50cf\u5927\u5c0f\u4fdd\u6301\u4e0d\u53d8\u7684\u653e\u5927\u56e0\u5b50\u662f \\(k=d_t/d_0\\) \uff0c\u5728\u65f6\u95f4 \\(t\\) \u6240\u4ea7\u751f\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f\uff1a \\[ P_t=K \\begin{bmatrix} d_t/d_0 & & \\\\ & d_t/d_0 & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}&d_t \\end{bmatrix}= \\frac{d_t}{d_0}K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}d_0/d_t&d_0 \\end{bmatrix} \\] \u56e0\u5b50 \\(d_t/d_0\\) \u53ef\u4ee5\u5ffd\u7565\uff0c\u5f53 \\(d_t\\) \u8d8b\u5411\u65e0\u7a77\u5927\u65f6\uff0c\u8be5\u77e9\u9635\u53d8\u6210 \\[ P_\\infty=\\lim_{t \\to \\infty}P_t=K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top&d_0 \\end{bmatrix} \\]","title":"\u4eff\u5c04\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_12","text":"\u5728\u8fc7\u4e16\u754c\u539f\u70b9\u5e76\u5782\u76f4\u5b50\u4e3b\u8f74\u65b9\u5411\u7684\u5e73\u9762\u4e0a\u7684\u4efb\u4f55\u70b9\u7684\u56fe\u50cf\u5728\u8fd9\u79cd\u53d8\u7126\u548c\u8fd0\u52a8\u7684\u590d\u5408\u4f5c\u7528\u4e0b\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u6837\u7684\u4e00\u4e2a\u70b9\u53ef\u4ee5\u8bb0\u4e3a \\(\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 \\\\ 1\\end{bmatrix}\\) \uff0c\u56e0\u4e3a \\(\\mathbf{r}^{3\\top}(\\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2)=0\\) \uff0c\u5373 \\(P_0\\mathbf{X}=P_t\\mathbf{X}=P_\\infty\\mathbf{X}\\) \u5bf9\u6240\u6709 \\(t\\) \u6210\u7acb \u5bf9\u4e0d\u5728\u8be5\u5e73\u9762\u4e0a\u7684\u70b9\uff0c\u8bbe\u4e00\u70b9 \\(\\mathbf{X}\\) \u79bb\u8be5\u5e73\u9762\u7684\u5782\u76f4\u8ddd\u79bb\u662f \\(\\Delta\\) \u8fd9\u4e2a 3D \u70b9\u53ef\u4ee5\u8868\u793a\u6210 \\[\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 + \\Delta\\mathbf{r}^3 \\\\ 1\\end{bmatrix}\\] \u5e76\u5206\u522b\u88ab\u6444\u50cf\u673a \\(P_0\\) \u548c \\(P_\\infty\\) \u5f71\u50cf\u5230 \\[ \\mathbf{x}_{proj}=P_0\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0+\\Delta \\end{bmatrix} \\ \\ \\ \\mathbf{x}_{affine}=P_\\infty\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0 \\end{bmatrix} \\] \u5176\u4e2d \\(\\tilde{x}=\\alpha-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}},\\tilde{y}=\\beta-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}}\\) \uff0c\u8bb0\u6807\u5b9a\u77e9\u9635\u4e3a\uff1a \\[ K=\\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\tilde{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\] \u56e0\u6b64\u4e24\u70b9\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_0= \\frac{d_0+\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u7528 \\(P_\\infty\\) \u4eff\u5c04\u8fd1\u4f3c\u771f\u5b9e\u6444\u50cf\u673a\u77e9\u9635 \\(P_0\\) \u7684\u6548\u5e94\u662f\u628a\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u5f84\u5411\u5730\u9760\u8fd1\u6216\u79bb\u5f00\u4e3b\u70b9 \\(\\tilde{\\mathbf{x}}_0\\) \uff0c\u5176\u52a0\u6743\u56e0\u5b50\u662f \\((d_0+\\Delta)/d_0=1+\\Delta/d_0\\) \u4eff\u5c04\u5f71\u50cf\u6761\u4ef6 \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_{proj}=\\frac{\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u6df1\u5ea6\u7684\u8d77\u4f0f( \\(\\Delta\\) )\u76f8\u5bf9\u5e73\u5747\u6df1\u5ea6( \\(d_0\\) )\u8f83\u5c0f \u70b9\u79bb\u4e3b\u8f74\u7684\u8ddd\u79bb\u8f83\u5c0f","title":"\u5e94\u7528\u4eff\u5c04\u6444\u50cf\u673a\u7684\u8bef\u5dee"},{"location":"cv/mvg/camera-model/#p_infty","text":"\u6444\u50cf\u673a\u77e9\u9635 \uff1a \\[ P_\\infty= \\begin{bmatrix} K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{t}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix}= \\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{0}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u5e73\u884c\u6295\u5f71 \u5e73\u884c\u6295\u5f71\u77e9\u9635 \\(\\begin{bmatrix} 1&0&0&0\\\\0&1&0&0\\\\0&0&0&1 \\end{bmatrix}\\) \u4ee3\u66ff\u79bb\u6709\u9650\u6444\u50cf\u673a\u7684\u89c4\u8303\u5c04\u5f71\u77e9\u9635 \\([\\mathbf{I}|\\mathbf{0}]\\) \u6807\u5b9a\u77e9\u9635 \\(\\begin{bmatrix}K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\\\hat{\\mathbf{0}}^\\top & 1\\end{bmatrix}\\) \u4ee3\u66ff\u4e86\u6709\u9650\u6444\u50cf\u673a\u7684 \\(K\\) \u4e3b\u70b9\u65e0\u5b9a\u4e49","title":"\\(P_\\infty\\) \u7684\u5206\u89e3"},{"location":"cv/mvg/camera-model/#_13","text":"\u6b63\u6295\u5f71 \uff1a\u6b63\u6295\u5f71\u6444\u50cf\u673a\u6709 5 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5373\u63cf\u8ff0\u65cb\u8f6c\u77e9\u9635 \\(R\\) \u7684\u4e09\u4e2a\u53c2\u6570\uff0c\u52a0\u4e0a\u4e24\u4e2a\u504f\u7f6e\u53c2\u6570 \\(t_1\\) \u548c \\(t_2\\) \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u7f29\u653e\u6b63\u6295\u5f71 \uff1a\u7f29\u653e\u6b63\u6295\u5f71\u662f\u6b63\u6295\u5f71\u7d27\u63a5\u4e00\u4e2a\u5747\u5300\u7f29\u653e\uff0c\u6709 6 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1/k \\end{bmatrix} \\] \u5f31\u900f\u89c6\u6295\u5f71 \uff1a\u4e0e\u6709\u9650 CCD \u6444\u50cf\u673a\u7c7b\u4f3c\uff0c\u8003\u8651\u4e24\u6839\u56fe\u50cf\u8f74\u7f29\u653e\u56e0\u5b50\u4e0d\u4e00\u6837\u7684\u65e0\u7a77\u8fdc\u6444\u50cf\u673a\uff0c\u6709 7 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\alpha_x & & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u4eff\u5c04\u6444\u50cf\u673a \\(P_A\\) \uff1a\u5982 \\(P_\\infty\\) \u4e00\u6837\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u7684\u5e73\u884c\u6295\u5f71\uff0c\u6709 8 \u4e2a\u81ea\u7531\u5ea6 \\[ P_A= \\begin{bmatrix} \\alpha_x & s & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\]","title":"\u4eff\u5c04\u6444\u50cf\u673a\u7684\u5c42\u6b21"},{"location":"cv/mvg/camera-model/#_14","text":"\u4e3b\u5e73\u9762\u662f\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u4efb\u4f55\u5c04\u5f71\u6444\u50cf\u673a\u77e9\u9635\u662f\u4eff\u5c04\u6444\u50cf\u673a\u77e9\u9635 \u5e73\u884c\u7684\u4e16\u754c\u76f4\u7ebf\u88ab\u6295\u5f71\u6210\u5e73\u884c\u7684\u56fe\u50cf\u76f4\u7ebf \u6ee1\u8db3 \\(M_{2 \\times 3} \\mathbf{d}=\\mathbf{0}\\) \u7684\u77e2\u91cf \\(\\mathbf{d}\\) \u662f\u5e73\u884c\u6295\u5f71\u7684\u65b9\u5411\uff0c\u800c \\((\\mathbf{d}^\\top,0)^\\top\\) \u662f\u6444\u50cf\u673a\u4e2d\u5fc3\uff0c\u56e0\u4e3a \\(P_A\\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}=\\mathbf{0}\\)","title":"\u4eff\u5c04\u6444\u50cf\u673a\u7684\u5176\u4ed6\u6027\u8d28"},{"location":"cv/mvg/camera-model/#_15","text":"\u4eff\u5c04\u6444\u50cf\u673a \u975e\u4eff\u5c04\u6444\u50cf\u673a \u6444\u50cf\u673a\u4e2d\u5fc3\u5728 \\(\\pi_\\infty\\) \u4e0a \u662f \u662f \u4e3b\u5e73\u9762\u662f \\(\\pi_\\infty\\) \u662f \u4e0d\u662f \\(\\pi_\\infty\\) \u7684\u70b9\u7684\u56fe\u50cf\u5728 \\(\\mathbf{l}_\\infty\\) \u4e0a \u662f \u4e00\u822c\u4e0d\u662f","title":"\u4e00\u822c\u65e0\u7a77\u8fdc\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_16","text":"\u63a8\u626b\u5f0f\u6444\u50cf\u673a \u7ebf\u9635\u6444\u50cf\u673a","title":"\u5176\u4ed6\u6444\u50cf\u673a\u6a21\u578b"},{"location":"cv/mvg/est2d/","text":"\u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 \u00b6 \u7ea6 6196 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 21 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u4f30\u8ba1\u95ee\u9898\uff0c\u4f30\u8ba1\u7684\u542b\u4e49\u662f\u6307\u5728\u67d0\u4e9b\u672c\u8d28\u6d4b\u91cf\u7684\u57fa\u7840\u4e0a\u8ba1\u7b97\u67d0\u4e2a\u53d8\u6362\u6216\u5176\u5b83\u6570\u5b66\u91cf\uff0c\u5e38\u89c1\u7684\u4f30\u8ba1\u95ee\u9898\u7684\u7c7b\u578b\u6709\uff1a 2D \u5355\u5e94 \uff1a\u7ed9\u5b9a \\(IP^2\\) \u4e2d\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u540c\u5728 \\(IP^2\\) \u4e2d\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u628a\u6bcf\u4e00\u70b9 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u5c04\u5f71\u53d8\u6362\u3002 3D \u5230 2D \u7684\u6444\u50cf\u673a\u6295\u5f71 \uff1a\u7ed9\u5b9a 3D \u7a7a\u95f4\u7684\u70b9\u96c6 \\(X_i\\) \u4ee5\u53ca\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u6c42\u628a \\(X_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i\\) \u7684 3D \u5230 2D \u7684\u5c04\u5f71\u6620\u5c04\u3002 \u57fa\u672c\u77e9\u9635\u7684\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u53e6\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u4e0e\u8fd9\u4e9b\u5bf9\u5e94\u4e00\u76f4\u7684 \u57fa\u672c\u77e9\u9635 \\(F\\) \u3002 \u4e09\u7126\u70b9\u5f20\u91cf\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u8de8\u4e09\u5e45\u56fe\u50cf\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime \\leftrightarrow \\mathbf{x}_i^{\\prime \\prime}\\) \uff0c\u8ba1\u7b97\u4e09\u7126\u70b9\u5f20\u91cf\u3002 \u7814\u7a76\u4e24\u5e45\u56fe\u50cf\u4e4b\u95f4\u5bf9\u5e94\u70b9\u7684\u96c6\u5408 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u5bf9\u6240\u6709\u7684 i \u90fd\u6ee1\u8db3 \\(H\\mathbf{x}_i=\\mathbf{x}_i^\\prime\\) \u7684\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635 H\uff1a \u6d4b\u91cf\u6570 \uff1a\u77e9\u9635 H \u6709 9 \u4e2a\u5143\u7d20\uff0c\u4f46\u4ec5\u786e\u5b9a\u5230\u76f8\u5dee\u4e00\u4e2a\u5c3a\u5ea6\u56e0\u5b50\u3002\u56e0\u6b64\uff0c2D \u5c04\u5f71\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u7684\u603b\u6570\u662f 8\u3002\u56e0\u4e3a\u4e00\u4e2a 2D \u70b9\u6709\u4e24\u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u4e3a\u4e86\u5b8c\u5168\u7ea6\u675f H\uff0c\u9700\u8981\u6307\u5b9a\u56db\u7ec4\u70b9\u5bf9\u5e94\u3002 \u8fd1\u4f3c\u89e3 \uff1a\u5982\u679c\u7ed9\u5b9a\u56db\u7ec4\u5bf9\u5e94\uff0c\u90a3\u4e48\u53ef\u4ee5\u5f97\u5230\u77e9\u9635 H \u7684\u7cbe\u786e\u89e3\u8fd9\u79cd\u89e3\u79f0\u4e3a \u6700\u5c0f\u914d\u7f6e\u89e3 \u3002\u5982\u679c\u7ed9\u5b9a\u591a\u4e8e\u56db\u7ec4\u7684\u5bf9\u5e94\uff0c\u90a3\u4e48\u8fd9\u4e9b\u5bf9\u5e94\u53ef\u80fd\u4e0d\u4e0e\u4efb\u4f55\u5c04\u5f71\u53d8\u6362\u5b8c\u5168\u76f8\u5bb9\uff0c\u56e0\u800c\u6211\u4eec\u9762\u4e34\u7684\u4efb\u52a1\u662f\u6309\u7ed9\u5b9a\u7684\u6570\u636e\u786e\u5b9a\u201c\u6700\u597d\u201d\u7684\u53d8\u6362\u3002\u901a\u5e38\u8fd9\u4e2a\u4efb\u52a1\u662f\u901a\u8fc7\u5bfb\u627e\u6700\u5c0f\u5316\u67d0\u4e2a\u4ee3\u4ef7\u51fd\u6570\u7684\u53d8\u6362 H \u6765\u5b8c\u6210\u3002 \u9ec4\u91d1\u6807\u51c6\u7b97\u6cd5 \uff1a\u901a\u5e38\u5b58\u5728\u4e00\u79cd\u6700\u4f18\u7684\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u6700\u4f18\u7684\u542b\u4e49\u662f\u5728\u4e00\u5b9a\u5047\u8bbe\u4e0b\uff0c\u4f7f\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684 H \u662f\u53d8\u6362\u7684\u6700\u597d\u4f30\u8ba1\u3002\u8ba1\u7b97\u8be5\u4ee3\u4ef7\u51fd\u6570\u6700\u5c0f\u503c\u7684\u7b97\u6cd5\u79f0\u4e3a\u201c\u9ec4\u91d1\u6807\u51c6\u201d\u7b97\u6cd5\u3002 \u76f4\u63a5\u7ebf\u6027\u53d8\u6362\uff08DLT\uff09\u7b97\u6cd5 \u00b6 \u9996\u5148\u8ba8\u8bba\u7531\u7ed9\u5b9a 2D \u5230 2D\u7684\u56db\u7ec4\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u786e\u5b9a H \u7684\u4e00\u79cd\u7b80\u5355\u7684\u7ebf\u6027\u7b97\u6cd5\uff0c\u53d8\u6362\u7531 \\(\\mathbf{x}_i^\\prime = H\\mathbf{x}_i\\) \u7ed9\u51fa\u3002\u4f46\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u9f50\u6b21\u77e2\u91cf\u65b9\u7a0b\uff0c\u56e0\u6b64 3 \u7ef4\u77e2\u91cf \\(\\mathbf{x}_i^\\prime\\) \u548c \\(H\\mathbf{x}_i\\) \u4e0d\u76f8\u7b49\u3002\u53ef\u4ee5\u7528\u77e2\u91cf\u53c9\u4e58\uff1a \\(\\mathbf{x}_i^\\prime \\times H\\mathbf{x}_i=\\mathbf{0}\\) \u8868\u793a\u3002 \u5982\u679c\u5c06\u77e9\u9635 H \u7684\u7b2c j \u884c\u8bb0\u4e3a \\(h^{j\\top},\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \uff0c\u5219 \\(\\mathbf{x}_i^\\prime \\times H \\mathbf{x}_i=0\\) \u53ef\u4ee5\u8f6c\u6362\u6210\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime\\mathbf{x}_i^\\top \\\\ -y_i^\\prime \\mathbf{x}_i^\\top & x_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} =\\mathbf{0} \\] h \u662f\u7531\u77e9\u9635 H \u7684\u5143\u7d20\u7ec4\u6210\u7684 0 \u7ef4\u77e2\u91cf\uff1a \\[ \\mathbf{h}= \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} , \\ \\ \\ H= \\begin{bmatrix} h_1 & h_2 & h_3 \\\\ h_4 & h_5 & h_6 \\\\ h_7 & h_8 & h_9 \\end{bmatrix} \\] \\(A_i\\mathbf{h}=\\mathbf{0}\\) \u662f\u672a\u77e5\u77e2\u91cf \\(\\mathbf{h}\\) \u7684\u7ebf\u6027\u65b9\u7a0b\uff0c\u77e9\u9635 \\(A_i\\) \u7684\u5143\u7d20\u662f\u5df2\u77e5\u70b9\u7684\u5750\u6807\u7684\u4e8c\u6b21\u591a\u9879\u5f0f\u3002 \u867d\u7136\u5f0f\u4e2d\u6709\u4e09\u4e2a\u65b9\u7a0b\uff0c\u4f46\u4ec5\u6709\u4e24\u4e2a\u662f\u7ebf\u6027\u72ec\u7acb\u7684\u3002\u5728\u89e3 H \u65f6\u5e38\u7701\u53bb\u7b2c\u4e09\u4e2a\u7b49\u5f0f\u3002 \u8be5\u65b9\u7a0b\u7ec4\u5bf9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u4efb\u4f55\u9f50\u6b21\u5750\u6807 \\((x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u6210\u7acb\u3002 \u6c42\u89e3 H \uff1a\u6bcf\u7ec4\u70b9\u5bf9\u5e94\u7ed9\u51fa\u5173\u4e8e H \u5143\u7d20\u7684\u4e24\u4e2a\u72ec\u7acb\u7684\u65b9\u7a0b\u3002\u7ed9\u5b9a\u56db\u7ec4\u8fd9\u6837\u7684\u70b9\u5bf9\u5e94\uff0c\u4fbf\u83b7\u5f97\u65b9\u7a0b\u7ec4 \\(A\\mathbf{h}=\\mathbf{0}\\) \u3002 \u8d85\u5b9a\u89e3 \u00b6 \u5982\u679c\u7ed9\u51fa\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u591a\u4f59\u56db\u7ec4\uff0c\u65b9\u7a0b \\(A\\mathbf{h}=\\mathbf{0}\\) \u662f\u8d85\u5b9a\u7684\u3002 \u5982\u679c\u70b9\u7684\u4f4d\u7f6e\u662f\u7cbe\u786e\u7684\uff0c\u90a3\u4e48 \\(A\\) \u7684\u79e9\u4ecd\u7136\u4e3a 8 \u5e76\u6709\u4e00\u7ef4\u96f6\u7a7a\u95f4\uff0c\u5e76\u4e14\u5b58\u5728\u7cbe\u786e\u89e3 \\(\\mathbf{h}\\) \u3002 \u5982\u679c\u56fe\u50cf\u5750\u6807\u7684\u6d4b\u91cf\u65f6\u4e0d\u7cbe\u786e\u7684\uff0c\u65b9\u7a0b\u7ec4\u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002\u6240\u4ee5\u9700\u8981\u4e00\u4e2a\u9002\u5f53\u7684\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\mathbf{h}\\) \uff0c\u901a\u5e38\u9644\u52a0\u8303\u6570\u6761\u4ef6\uff0c\u65e2\u7136\u4e0d\u5b58\u5728 \\(A\\mathbf{h}=\\mathbf{0}\\) \u7684\u7cbe\u786e\u89e3\uff0c\u5f88\u81ea\u7136\u4f1a\u5728\u901a\u5e38\u7ea6\u675f \\(\\parallel \\mathbf{h} \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002\u8fd9\u7b49\u4ef7\u4e8e\u6c42\u5546 \\(\\parallel A \\mathbf{h} \\parallel / \\parallel \\mathbf{h} \\parallel\\) \u7684\u6700\u5c0f\u503c\u95ee\u9898\u3002\u8be5\u89e3\u662f \\(A^\\top A\\) \u7684\u6700\u5c0f\u7279\u5f81\u503c\u7684\uff08\u5355\u4f4d\uff09\u7279\u5f81\u77e2\u91cf\u3002\u7531\u6b64\u6240\u5f97\u5230\u7684\u7b97\u6cd5\u79f0\u4e3a \u57fa\u672cDLT\u7b97\u6cd5 \u3002 \u975e\u9f50\u6b21\u89e3 \u00b6 \u628a\u7b49\u5f0f\u8f6c\u6210\u975e\u9f50\u6b21\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u5373\u7ed9\u77e2\u91cf \\(\\mathbf{h}\\) \u4e2d\u7684\u67d0\u4e2a\u5143\u7d20\u5f3a\u52a0\u4e0a \\(h_j=1\\) \u7684\u6761\u4ef6\uff1a \\[ \\begin{bmatrix} 0 & 0 & 0 & -x_iw_i^\\top & -y_iw_i^\\top & -w_iw_i^\\top & x_iy_i^\\top & y_iy_i^\\top \\\\ x_iw_i^\\top & y_iw_i^\\top & w_iw_i^\\top & 0 & 0 & 0 & -x_ix_i^\\top & -y_ix_i^\\top \\\\ \\end{bmatrix} \\bar{\\mathbf{h}}= \\begin{bmatrix} -w_iy_i^\\top \\\\ -w_ix_i^\\top \\end{bmatrix} \\] \u5176\u4e2d \\(\\bar{\\mathbf{h}}\\) \u662f\u7531 \\(\\mathbf{h}\\) \u7684\u524d\u516b\u4e2a\u5143\u7d20\u7ec4\u6210\u7684 8 \u7ef4\u77e2\u91cf\u3002 \u4f46\u662f\uff0c\u5982\u679c\u4e8b\u5b9e\u4e0a\u771f\u6b63\u7684\u89e3\u662f \\(h_j=0\\) \uff0c\u90a3\u4e48\u4e0d\u5b58\u5728\u4e00\u56e0\u5b50 \\(k\\) \u4f7f\u5f97 \\(kh_j=1\\) \uff0c\u8868\u793a\u4ee4 \\(h_j=1\\) \u5f97\u4e0d\u5230\u771f\u89e3\u3002 \u9000\u5316\u914d\u7f6e \u00b6 \u5982\u679c \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u90a3\u4e48 \\(H^*=\\mathbf{x}_4^\\top\\mathbf{I}^\\top\\) \u662f\u4e00\u4e2a\u89e3 \\(H^*\\) \u662f\u552f\u4e00\u89e3\uff08\u76f8\u5dee\u4e00\u5c3a\u5ea6\u56e0\u5b50\uff09\uff0c\u56e0\u4e3a \\(H^*\\) \u662f\u5947\u5f02\u77e9\u9635\uff0c\u4e0d\u5b58\u5728\u628a\u6bcf\u4e2a \\(\\mathbf{x}_i\\) \u53d8\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u3002\u5f53 \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u800c \\(\\mathbf{x}_1^\\prime, \\mathbf{x}_2^\\prime, \\mathbf{x}_3^\\prime\\) \u4e0d\u5171\u7ebf\u65f6\u5c31\u4f1a\u4ea7\u751f\u8fd9\u79cd\u60c5\u51b5 \u5b58\u5728\u53e6\u5916\u4e00\u4e2a\u89e3 \\(H\\) \uff1a\u4ece\u800c\u4efb\u4f55\u5f62\u5982 \\(\\alpha H^*+\\beta H\\) \u7684\u77e9\u9635\u90fd\u662f\u89e3\uff0c\u56e0\u6b64\u6709\u4e00\u4e2a 2 \u53c2\u6570\u7684\u53d8\u6362\u7c07\u5b58\u5728\uff0c\u8fdb\u800c\u63a8\u51fa\u7ed9\u51fa\u7684 8 \u4e2a\u65b9\u7a0b\u4e0d\u662f\u72ec\u7acb\u7684 \u51fa\u73b0\u67d0\u79cd\u914d\u7f6e\u4e0d\u80fd\u786e\u5b9a\u552f\u4e00\u89e3\u7684\u60c5\u5f62\u79f0\u4e3a \u9000\u5316 \u3002 \u9000\u5316\u7684\u5b9a\u4e49\u65e2\u6d89\u53ca\u914d\u7f6e\u4e5f\u6d89\u53ca\u53d8\u6362\u7c7b\u578b\uff0c\u800c\u4e14\u9000\u5316\u95ee\u9898\u4e0d\u4ec5\u9650\u4e8e\u6700\u5c0f\u914d\u7f6e\u89e3\u3002\u5982\u679c\u591a\u51fa\u6765\u7684\uff08\u7cbe\u786e\u7684\uff0c\u5373\u65e0\u8bef\u5dee\u7684\uff09\u70b9\u5bf9\u5e94\u4e5f\u5171\u7ebf\uff0c\u90a3\u4e48\u9000\u5316\u95ee\u9898\u4ecd\u6ca1\u6709\u89e3\u51b3\u3002 \u7531\u7ebf\u548c\u5176\u4ed6\u5b9e\u4f53\u6c42\u89e3 \u00b6 \u524d\u9762\u53ea\u8ba8\u8bba\u7531\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u5355\u5e94\uff0c\u7136\u800c\u7ebf\u5bf9\u5e94\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5e94\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u5355\u5e94\uff0c\u6240\u4ee5\u5c31\u4ea7\u751f\u8ba1\u7b97\u4e00\u4e2a\u5355\u5e94\uff08\u6216\u4efb\u4f55\u5176\u4ed6\u5173\u7cfb\uff09\u9700\u8981\u591a\u5c11\u7ec4\u5bf9\u5e94\u7684\u95ee\u9898\u3002\u4e00\u822c\u7684\u539f\u5219\u662f\u7ea6\u675f\u6570\u5fc5\u987b\u7b49\u4e8e\u6216\u5927\u4e8e\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002 \u91c7\u7528\u6df7\u5408\u7c7b\u578b\u7684\u5bf9\u5e94\u6765\u8ba1\u7b97 H \u65f6\u5fc5\u987b\u8c28\u614e\uff0c\u4f8b\u5982\u4e00\u4e2a 2D \u5355\u5e94\u4e0d\u80fd\u7531\u4e24\u7ec4\u70b9\u5bf9\u5e94\u548c\u4e24\u7ec4\u7ebf\u5bf9\u5e94\u552f\u4e00\u786e\u5b9a\uff0c\u4f46\u80fd\u7531\u4e09\u7ea7\u70b9\u548c\u4e00\u7ec4\u7ebf\u6216\u4e00\u7ec4\u70b9\u548c\u4e09\u7ec4\u7ebf\u6765\u552f\u4e00\u786e\u5b9a\uff0c\u5373\u4f7f\u6bcf\u79cd\u914d\u7f6e\u90fd\u6709 8 \u4e2a\u81ea\u7531\u5ea6\u4e5f\u662f\u5982\u6b64\u3002 \u4e0d\u540c\u7684\u4ee3\u4ef7\u51fd\u6570 \u00b6 \u4e3a\u786e\u5b9a H \u7684\u8d85\u5b9a\u89e3\u800c\u9700\u6700\u5c0f\u5316\u7684\u82e5\u5e72\u4ee3\u4ef7\u51fd\u6570 \u4ee3\u6570\u8ddd\u79bb \u00b6 DLT \u7b97\u6cd5\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002 \u77e2\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u79f0\u4e3a\u6b8b\u5dee\u77e2\u91cf\uff0c\u5e76\u4e14\u8981\u6700\u5c0f\u5316\u7684\u6b63\u662f\u8be5\u8bef\u5dee\u77e2\u91cf\u7684\u8303\u6570\u3002 \u77e2\u91cf \\(\\varepsilon_i\\) \u88ab\u79f0\u4e3a\u5173\u8054\u4e8e\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u548c\u5355\u5e94 H \u7684 \u4ee3\u6570\u8bef\u5dee\u77e2\u91cf \uff0c\u8be5\u77e2\u91cf\u7684\u8303\u6570\u662f\u4e00\u4e2a\u6807\u91cf\uff0c\u79f0\u4e3a \u4ee3\u6570\u8ddd\u79bb \uff1a \\[ d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\parallel \\varepsilon_i \\parallel= \\parallel \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime \\mathbf{x}_i^\\top \\end{bmatrix} \\mathbf{h} \\parallel^2 \\] \u5bf9\u4e8e\u4efb\u4f55\u4e24\u4e2a\u77e2\u91cf \\(\\mathbf{x}_1\\) \u548c \\(\\mathbf{x}_2\\) \uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_1, \\mathbf{x}_2)^2=a_1^2+a_2^2 \\ \\ \u5176\u4e2d\\mathbf{a}=(a_1,a_2,a_3)^\\top=\\mathbf{x}_1 \\times \\mathbf{x}_2 \\] \u7ed9\u5b9a\u5bf9\u5e94\u7684\u96c6\u5408\uff0c\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u662f\u6574\u4e2a\u96c6\u5408\u7684\u4ee3\u6570\u8bef\u5dee\u77e2\u91cf\uff0c\u7531\u6b64\u53ef\u89c1\uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\sum_{i} \\parallel \\varepsilon_i \\parallel^2= \\parallel A\\mathbf{h} \\parallel^2= \\parallel \\varepsilon \\parallel^2 \\] \u7f3a\u70b9\u662f\u88ab\u6700\u5c0f\u5316\u7684\u91cf\u6ca1\u6709\u51e0\u4f55\u6216\u7edf\u8ba1\u4e0a\u7684\u610f\u4e49\u3002 \u51e0\u4f55\u8ddd\u79bb \u00b6 \u8bb0\u53f7 \u00b6 \u77e2\u91cf \\(\\mathbf{x}\\) \u8868\u793a \u6d4b\u91cf \u7684\u56fe\u50cf\u5750\u6807\uff1b \\(\\hat{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u4f30\u8ba1\u503c\u800c \\(\\bar{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u771f\u503c\u3002 \u5355\u56fe\u50cf\u8bef\u5dee \u00b6 \u9996\u5148\u8003\u8651\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u975e\u5e38\u7cbe\u786e\u800c\u8bef\u5dee\u4ec5\u51fa\u73b0\u5728\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u60c5\u5f62\u3002\u9002\u5b9c\u6700\u5c0f\u5316\u7684\u91cf\u662f \u8f6c\u79fb\u8bef\u5dee \u3002\u5b83\u662f\u7b2c\u4e8c\u5e45\u56fe\u50cf\u4e0a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u4e0e\u70b9 \\(H\\bar{\\mathbf{x}}\\) \u4e4b\u95f4\u7684 \u6b27\u6c0f\u8ddd\u79bb \u3002\u7528\u8bb0\u53f7 \\(d(\\mathbf{x}, \\mathbf{y})\\) \u8868\u793a\u975e\u9f50\u6b21\u70b9 \\(\\mathbf{x}\\) \u548c \\(\\mathbf{y}\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u3002\u5bf9\u5e94\u96c6\u5408\u7684\u8f6c\u79fb\u8bef\u5dee\u662f\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}_i})^2 \\] \u5bf9\u79f0\u8f6c\u79fb\u8bef\u5dee \u00b6 \u66f4\u5207\u5408\u5b9e\u9645\u7684\u60c5\u5f62\u662f\u56fe\u50cf\u6d4b\u91cf\u8bef\u5dee\u5728\u4e24\u5e45\u56fe\u50cf\u4e2d\u90fd\u53d1\u751f\uff0c\u4ece\u800c\u5e94\u8be5\u6700\u5c0f\u5316\u4e24\u5e45\u800c\u4e0d\u4ec5\u662f\u4e00\u5e45\u56fe\u50cf\u7684\u8bef\u5dee\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\] \u91cd\u6295\u5f71\u8bef\u5dee\u2014\u2014\u4e24\u5e45\u56fe\u50cf \u00b6 \u5bf9\u6bcf\u5e45\u56fe\u50cf\u8bef\u5dee\u4f5c\u91cf\u5316\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f30\u8ba1\u6bcf\u7ec4\u5bf9\u5e94\u7684\u201c\u6821\u6b63\u503c\u201d\u3002\u4e3a\u4e86\u5f97\u5230\u5b8c\u5168\u7684\u5339\u914d\u70b9\u96c6\u6709\u5fc5\u8981\u5728\u4e00\u5e45\u56fe\u50cf\uff08\u7b2c\u4e8c\u5e45\u56fe\u50cf\uff09\u4e0a\u5bf9\u6d4b\u91cf\u8fdb\u884c\u6821\u6b63\u3002 \u5355\u5e94 \\(\\hat{H}\\) \u548c\u5b8c\u5168\u5339\u914d\u7684\u70b9\u5bf9 \\(\\hat{\\mathbf{x}_i}\\) \u548c \\(\\hat{\\mathbf{x}_i}^\\prime\\) \u4ee5\u6700\u5c0f\u5316\u603b\u7684\u8bef\u5dee\u51fd\u6570: \\[ \\sum_{i} d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2 \\ \\ \\ s.t \\ \\ \\ \\hat{\\mathbf{x}_i}^\\prime=\\hat{H}\\hat{\\mathbf{x}_i} \\ \\ \\ \\forall i. \\] \u5148\u7531 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u4f30\u8ba1\u4e16\u754c\u5e73\u9762\u7684\u70b9 \\(\\hat{\\mathbf{X}_i}\\) \uff0c\u7136\u540e\u628a\u5b83\u91cd\u6295\u5f71\u5230\u4f30\u8ba1\u4e0a\u8ba4\u4e3a\u662f\u5b8c\u5168\u5339\u914d\u7684\u5bf9\u5e94 \\(\\hat{\\mathbf{x}_i} \\leftrightarrow \\hat{\\mathbf{x}_i}^\\prime\\) \u51e0\u4f55\u548c\u4ee3\u6570\u8ddd\u79bb\u7684\u6bd4\u8f83 \u00b6 \u4ee4 \\(\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u5e76\u5b9a\u4e49\u77e2\u91cf \\((\\hat{x_i}^\\prime, \\hat{y_i}^\\prime, \\hat{w_i}^\\prime)^\\top=\\hat{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}}\\) \uff0c\u5219 \\[ d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2= d_{alg}(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2/\\hat{w_i}^\\prime w_i^\\prime \\] \u51e0\u4f55\u8ddd\u79bb\u4e0e\u4ee3\u6570\u8ddd\u79bb\u76f8\u5173\uff0c\u4f46\u4e0d\u76f8\u7b49\u3002\u53ea\u6709\u5f53 \\(\\hat{w_i}^\\prime=w_i^\\prime=1\\) \u4e24\u4e2a\u8ddd\u79bb\u76f8\u7b49\u3002\u56e0\u6b64\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8ddd\u79bb\u548c\u4ee3\u6570\u8ddd\u79bb\u76f8\u7b49\u3002\u5bf9\u4e8e\u4eff\u5c04\u53d8\u6362\uff0c\u6700\u5c0f\u5316\u51e0\u4f55\u8ddd\u79bb\u53ef\u4ee5\u7528\u57fa\u4e8e\u4ee3\u6570\u8ddd\u79bb\u7684\u7ebf\u6027 DLT \u7b97\u6cd5\u3002 \u91cd\u6295\u5f71\u8bef\u5dee\u7684\u51e0\u4f55\u89e3\u91ca \u00b6 \u4e24\u5e73\u9762\u4e4b\u95f4\u7684\u5355\u5e94\u4f30\u8ba1\u53ef\u4ee5\u89c6\u4e3a\u7528 4D \u7a7a\u95f4 \\(IR^4\\) \u4e2d\u7684\u201c\u66f2\u9762\u201d\u6765\u62df\u5408\u70b9\u3002 \u6bcf\u5bf9\u56fe\u50cf\u70b9 \\(\\mathbf{x}, \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6d4b\u91cf\u7a7a\u95f4 \\(IR^4\\) \u7684\u4e00\u4e2a\u70b9\uff0c\u8bb0\u4f5c \\(\\mathbf{X}\\) \u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u6ee1\u8db3 \\(\\mathbf{x} \\times \\mathbf{x}^\\prime=\\mathbf{0}\\) \u7684\u56fe\u50cf\u5bf9\u5e94 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6765 \\(IR^4\\) \u4e2d\u7684\u4e00\u4e2a\u4ee3\u6570\u7c07 \\(\\upsilon_H\\) \uff0c\u5b83\u662f\u4e24\u4e2a\u8d85\u4e8c\u6b21\u66f2\u9762\u7684\u4ea4\u96c6\u3002 \\[ d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2=d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2 \\] \u5176\u4e2d \\(d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u5230\u7c07 \\(\\upsilon_H\\) \u7684\u5782\u76f4\u8ddd\u79bb\u3002 Sampson \u8bef\u5dee \u00b6 Sampson \u8bef\u5dee\u5176\u590d\u6742\u6027\u4ecb\u4e8e\u4ee3\u6570\u548c\u51e0\u4f55\u4ee3\u4ef7\u51fd\u6570\u4e4b\u95f4\uff0c\u4f46\u975e\u5e38\u8fd1\u4f3c\u4e8e\u51e0\u4f55\u8bef\u5dee\u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u5728 \\(\\upsilon_H\\) \u4e0a\u7684\u4efb\u4f55\u70b9 \\(\\mathbf{X}=(x,y,x^\\prime, y^\\prime)^\\top\\) \uff0c\u4ee3\u4ef7\u51fd\u6570\u7528 \\(\\mathcal{C}_H(\\mathbf{X})=\\mathbf{0}\\) \u3002\u7528\u4e0b\u5217 Taylor \u5c55\u5f00\u5f0f\u6765\u4e00\u9636\u903c\u8fd1\uff1a \\[ \\mathcal{C}_H(\\mathbf{X}+\\delta_x)=\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x \\] \u8bb0 \\(\\delta_x = \\hat{\\mathbf{X}}-\\mathbf{X}\\) \u5e0c\u671b \\(\\hat{\\mathbf{X}}\\) \u5728 \\(\\upsilon_H\\) \u4e0a\uff0c\u5373 \\(\\mathcal{C}_H(\\hat{\\mathbf{X}})=\\mathbf{0}\\) \uff0c\u56e0\u6b64 \\(\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x=\\mathbf{0}\\) \u3002\u8bb0\u6210 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \uff0c\u5176\u4e2d \\(\\mathbf{J}\\) \u662f\u504f\u5bfc\u6570\u77e9\u9635\uff0c \\(\\varepsilon\\) \u4e0e \\(\\mathbf{X}\\) \u76f8\u5173\u7684\u4ee3\u4ef7\u51fd\u6570 \\(\\mathcal{C}_H(\\mathbf{X})\\) \uff0c \u6700\u5c0f\u5316\u95ee\u9898 \u662f\u6c42\u6ee1\u8db3\u6b64\u65b9\u7a0b\u7684\u6700\u5c0f \\(\\delta_x\\) \u3002 \u5373 \u6c42\u5728\u6ee1\u8db3 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \u6761\u4ef6\u4e0b\u4f7f \\(\\parallel \\delta_x \\parallel\\) \u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\delta_x\\) \u4f7f\u7528 Lagrange \u4e58\u5b50\u6cd5\uff0c\u6c42\u7684\u8303\u6570 \\(\\parallel \\delta \\parallel^2\\) \u662f Sampson \u8bef\u5dee\uff1a \\[ \\parallel \\delta_x \\parallel^2= \\delta_x^\\top\\delta_x= \\varepsilon^\\top(\\mathbf{J}\\mathbf{J}^\\top)^{-1}\\varepsilon \\] \u7edf\u8ba1\u4ee3\u4ef7\u51fd\u6570\u548c\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u00b6 \u5047\u5b9a\u5728\u6ca1\u6709\u6d4b\u91cf\u8bef\u5dee\u65f6\uff0c\u771f\u5b9e\u7684\u70b9\u51c6\u786e\u6ee1\u8db3\u4e00\u4e2a\u5355\u5e94\u53d8\u6362\uff0c\u5373 \\(\\bar{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}_i}\\) \u3002 \u5047\u5b9a\u6bcf\u4e00\u5e45\u56fe\u50cf\u5750\u6807\u90fd\u5177\u6709\u96f6\u5747\u503c\u548c\u7edf\u4e00\u7684\u6807\u51c6\u5dee \\(\\sigma\\) \u7684\u9ad8\u65af\u566a\u58f0\u3002\u8fd9\u610f\u5473\u7740 \\(x=\\bar{x}+\\Delta x\\) \uff0c\u5176\u4e2d \\(\\Delta x\\) \u670d\u4ece\u65b9\u5dee\u4e3a \\(\\sigma^2\\) \u7684\u9ad8\u65af\u5206\u5e03\u3002\u8fdb\u4e00\u6b65\u5047\u8bbe\u6bcf\u6b21\u6d4b\u91cf\u7684\u566a\u58f0\u662f\u76f8\u5728\u72ec\u7acb\u7684\uff0c\u90a3\u4e48\uff0c\u82e5\u70b9\u7684\u771f\u503c\u662f \\(\\bar{\\mathbf{x}}\\) \uff0c\u5219\u6bcf\u4e2a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}\\) \u7684\u6982\u7387\u5bc6\u5ea6\u51fd\u6570(pdf)\u662f\uff1a \\[ \\Pr(\\mathbf{x})=(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x},\\bar{\\mathbf{x}})^2/(2\\sigma^2)} \\] \u5355\u56fe\u50cf\u8bef\u5dee \u00b6 \u5047\u5b9a\u6bcf\u70b9\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\uff0c\u70b9\u5bf9\u5e94 \\(\\{\\bar{\\mathbf{x}_i} \\leftrightarrow \\mathbf{x}_i^\\prime\\}\\) \u7684\u6982\u7387\u5c31\u662f\u5b83\u4eec\u5355\u4e2a pdf \u7684\u4e58\u79ef\uff1a \\[ \\Pr(\\{\\mathbf{x}_i^\\prime | H\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2/(2\\sigma^2)} \\] \u8be5\u5bf9\u5e94\u96c6\u5408\u7684 \u5bf9\u6570\u4f3c\u7136 \u4e3a\uff1a \\[ \\log \\Pr(\\mathbf{x}_i^\\prime | H)=-\\frac{1}{2\\sigma^2}\\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2+\u5e38\u6570 \\] \u5355\u5e94\u7684 \u6700\u5927\u4f3c\u7136 ML \u4f30\u8ba1 \\(\\hat{H}\\) \u6700\u5927\u5316\u8fd9\u4e2a\u5bf9\u6570\u4f3c\u7136\uff0c\u5373\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2 \\] \u56e0\u6b64\uff0cML \u4f30\u8ba1\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u51fd\u6570 \u53cc\u56fe\u50cf\u8bef\u5dee \u00b6 \u5982\u679c\u771f\u5b9e\u5bf9\u5e94\u662f \\(\\{\\bar{\\mathbf{x}}_i \\leftrightarrow H \\bar{\\mathbf{x}}_i=\\bar{\\mathbf{x}}_i^\\prime\\}\\) \uff0c\u53d7\u566a\u58f0\u5e72\u6270\u7684\u6570\u636e\u7684 pdf \u662f\uff1a \\[ \\Pr(\\{\\mathbf{x}_i, \\mathbf{x}_i^\\prime\\} | H, \\{\\bar{\\mathbf{x}}_i\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-(d(\\mathbf{x}_i, \\bar{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}}_i)^2)/(2\\sigma^2)} \\] ML \u4f30\u8ba1\u5c31\u662f\u6c42\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i, \\hat{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}}_i^\\prime)^2 \\] ML \u4f30\u8ba1\u7b49\u540c\u4e8e\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u51fd\u6570 Mahalanobis \u8ddd\u79bb \u00b6 \u4e00\u822c\u9ad8\u65af\u5206\u5e03\u7684\u60c5\u5f62\uff0c\u53ef\u4ee5\u5047\u5b9a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6ee1\u8db3\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u9ad8\u65af\u5206\u5e03\u51fd\u6570\u3002\u6700\u5927\u5316\u5bf9\u6570\u4f3c\u7136\u5219\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 Mahalanobis \u8ddd\u79bb\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2=(\\mathbf{X}-\\bar{\\mathbf{X}})^\\top\\sum\\nolimits^{-1}(\\mathbf{X}-\\bar{\\mathbf{X}}) \\] \u5f53\u6bcf\u5e45\u56fe\u50cf\u90fd\u6709\u8bef\u5dee\u5e76\u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u4e0e\u53e6\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\u65f6\uff0c\u5408\u9002\u7684\u4ee3\u4ef7\u51fd\u6570\u662f\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2+\\parallel \\mathbf{X}^\\prime - \\bar{\\mathbf{X}}^\\prime \\parallel_{\\sum^\\prime}^2 \\] \u5176\u4e2d \\(\\sum\\) \u548c \\(\\sum^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u7684\u534f\u65b9\u5dee\u77e9\u9635 \u53d8\u6362\u4e0d\u53d8\u6027\u548c\u5f52\u4e00\u5316 \u00b6 \u5173\u4e8e\u56fe\u50cf\u5750\u6807\u53d8\u6362\u7684\u4e0d\u53d8\u6027 \u00b6 \u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}\\) \u88ab \\(\\tilde{\\mathbf{x}}=T\\mathbf{x}\\) \u66ff\u4ee3\uff0c\u800c\u53e6\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}^\\prime\\) \u88ab \\(\\tilde{\\mathbf{x}}^\\prime=T^\\prime\\mathbf{x}^\\prime\\) \u66ff\u4ee3\u3002\u56e0\u6b64 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\uff1a \u6839\u636e\u516c\u5f0f \\(\\tilde{\\mathbf{x}}_i=T\\mathbf{x}_i\\) \u548c \\(\\tilde{\\mathbf{x}}_i^\\prime=T^\\prime\\mathbf{x}_i^\\prime\\) \u53d8\u6362\u56fe\u50cf\u5750\u6807 \u7531\u5bf9\u5e94 \\(\\tilde{\\mathbf{x}}_i \\leftrightarrow \\tilde{\\mathbf{x}}_i^\\prime\\) \uff0c\u6c42 \\(\\tilde{H}\\) \u4ee4 \\(H=T^{\\prime-1}\\tilde{H}T\\) DLT \u7b97\u6cd5\u7684\u975e\u4e0d\u53d8\u6027 \u00b6 \u4ee4 \\(T^\\prime\\) \u4e3a\u5177\u6709\u7f29\u653e\u56e0\u5b50 \\(s\\) \u7684\u76f8\u4f3c\u53d8\u6362\uff0c \\(T\\) \u4e3a\u4efb\u610f\u7684\u5c04\u5f71\u53d8\u6362\u3002\u6b64\u5916\uff0c\u5047\u8bbe \\(H\\) \u662f\u4efb\u4f55 2D \u5355\u5e94\u5e76\u5b9a\u4e49 \\(\\tilde{H}=T^\\prime HT^{-1}\\) \uff0c\u90a3\u4e48 \\(\\parallel \\tilde{A} \\tilde{\\mathbf{h}} \\parallel = s \\parallel A \\mathbf{h} \\parallel\\) \u867d\u7136\u8fd9\u6837\u5b9a\u4e49\u7684 \\(H\\) \u548c \\(\\tilde{H}\\) \u7ed9\u51fa\u540c\u6837\u7684\u8bef\u5dee \\(\\varepsilon\\) \uff0c\u4f46\u662f\u5bf9\u89e3\u65bd\u52a0\u7684\u7ea6\u675f\u6761\u4ef6 \\(\\parallel H \\parallel = 1\\) \u4e0d\u7b49\u4ef7\u4e8e\u6761\u4ef6 \\(\\parallel \\tilde{H} \\parallel = 1\\) \uff0c\u5b83\u4eec\u5e76\u4e0d\u4ee5\u4efb\u4f55\u7b80\u5355\u7684\u65b9\u5f0f\u76f8\u5173\u8054\u3002 \u51e0\u4f55\u8bef\u5dee\u7684\u4e0d\u53d8\u6027 \u00b6 \\[ d(\\tilde{\\mathbf{x}}^\\prime, \\tilde{H}\\tilde{\\mathbf{x}})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime HT^{-1}T\\mathbf{x})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime H\\mathbf{x})= d(\\mathbf{x}^\\prime, H\\mathbf{x}) \\] \u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8bef\u5dee\u88ab\u4e58\u4ee5\u53d8\u6362\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u4ece\u800c\u6700\u5c0f\u5316\u53d8\u6362\u7684\u5bf9\u5e94\u65b9\u5f0f\u4e0e\u6b27\u6c0f\u53d8\u6362\u76f8\u540c\u3002\u6240\u4ee5\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\u3002 \u5f52\u4e00\u5316\u53d8\u6362 \u00b6 \u6570\u636e\u5f52\u4e00\u5316\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u7ed3\u679c\u7684\u7cbe\u5ea6\uff0c\u8fd8\u5bf9\u521d\u59cb\u6570\u636e\u5f52\u4e00\u5316\u7684\u7b97\u6cd5\u5c06\u5bf9\u4efb\u4f55\u5c3a\u5ea6\u7f29\u653e\u548c\u5750\u6807\u539f\u70b9\u7684\u9009\u62e9\u4e0d\u53d8\u3002\u56e0\u800c\u4f7f DLT \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5173\u4e8e\u76f8\u4f3c\u53d8\u6362\u4e0d\u53d8\u3002 \u5404\u5411\u540c\u6027\u7f29\u653e \u00b6 \u5bf9\u70b9\u8fdb\u884c\u5e73\u79fb\u4f7f\u70b9\u96c6\u5f62\u5fc3\u4f4d\u4e8e\u539f\u70b9 \u5bf9\u70b9\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684\u5e73\u5747\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{2}\\) \u5bf9\u4e24\u5e45\u56fe\u50cf\u72ec\u7acb\u8fdb\u884c\u4e0a\u8ff0\u53d8\u6362 \u6570\u636e\u5f52\u4e00\u5316\u5728 DLT \u7b97\u6cd5\u4e2d\u662f\u5b9e\u8d28\u6027\u7684\uff0c\u4e00\u5b9a\u4e0d\u8981\u89c6\u5b83\u4e3a\u53ef\u6709\u53ef\u65e0\u7684\u3002 \u5f52\u4e00\u5316\u4e0e\u6761\u4ef6\u6570 \u00b6 \u5f52\u4e00\u5316\u7684\u5f71\u54cd\u4e0e DLT \u65b9\u7a0b\u7ec4\u7684\u6761\u4ef6\u6570\u6216\u51c6\u786e\u5730\u8bf4\u4e0e\u65b9\u7a0b\u7ec4\u77e9\u9635 A \u7684\u7b2c\u4e00\u4e2a\u548c\u5012\u6570\u7b2c\u4e8c\u4e2a\u5947\u5f02\u503c\u7684\u6bd4\u7387 \\(d_1/d_{n-1}\\) \u6709\u5173\u3002\u4f46\u662f\uff0c\u5728\u6709\u566a\u58f0\u5b58\u5728\u65f6\u89e3\u5c06\u504f\u79bb\u5176\u6b63\u786e\u7ed3\u679c\u3002\u5927\u6761\u4ef6\u6570\u4f1a\u653e\u5927\u8fd9\u79cd\u504f\u5411\u3002 \u975e\u5404\u5411\u540c\u6027\u7f29\u653e \u00b6 \u5728\u975e\u5404\u540c\u6027\u7f29\u653e\u4e2d\uff0c\u70b9\u7684\u5f62\u5fc3\u548c\u524d\u9762\u4e00\u6837\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7ecf\u5e73\u79fb\u540e\u70b9\u5728\u539f\u70b9\u9644\u8fd1\u5f62\u6210\u4e91\u3002\u7136\u540e\u8fdb\u884c\u5750\u6807\u5c3a\u5ea6\u7f29\u653e\u4f7f\u8be5\u70b9\u96c6\u7684\u4e24\u4e3b\u77e9\u90fd\u7b49\u4e8e 1\u3002\u8fd9\u6837\u4f7f\u8be5\u70b9\u96c6\u5f62\u6210\u4ee5\u539f\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u534a\u5f84\u4e3a 1 \u7684\u8fd1\u4f3c\u7684\u5bf9\u79f0\u5706\u4e91\u3002 \u65e0\u7a77\u8fdc\u9644\u8fd1\u7684\u70b9\u7684\u7f29\u653e \u00b6 \u5f53\u70b9\u4f4d\u4e8e\u6216\u63a5\u8fd1\u5e73\u9762\u7684\u65e0\u7a77\u8fdc\u65f6\uff0c\u5404\u5411\u540c\u6027\uff08\u6216\u975e\u5404\u5411\u540c\u6027\uff09\u7684\u7f29\u653e\u65b9\u5f0f\u6765\u5f52\u4e00\u5316\u5750\u6807\u662f\u65e2\u65e0\u9053\u7406\u53c8\u4e0d\u53ef\u884c\u7684\uff0c\u56e0\u4e3a\u5f62\u5fc3\u5750\u6807\u548c\u7f29\u653e\u56e0\u5b50\u4e3a\u65e0\u7a77\u5927\u6216\u63a5\u8fd1\u65e0\u7a77\u5927\u3002\u4e00\u4e2a\u4f3c\u4e4e\u4f1a\u7ed9\u51fa\u597d\u7ed3\u679c\u7684\u65b9\u6cd5\u662f\u5f52\u4e00\u5316\u70b9\u96c6 \\(\\mathbf{x}_i=(x_i,y_i,w_i)^\\top\\) \u4f7f\u5f97\uff1a \\[ \\sum_i x_i=\\sum_i y_i=0;\\sum_ix_i^2+y_i^2=2\\sum_iw_i^2;x_i^2+y_i^2+w_i^2=1,\\forall i \\] \u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5 \u00b6 \u8fed\u4ee3\u6700\u5c0f\u5316\u6280\u672f \u4ee3\u4ef7\u53c2\u6570 \uff1a\u4ee3\u4ef7\u51fd\u6570\u662f\u6700\u5c0f\u5316\u7684\u57fa\u7840 \u53c2\u6570\u5316 \uff1a\u628a\u8981\u8ba1\u7b97\u7684\u53d8\u6362\uff08\u6216\u5176\u4ed6\u5b9e\u4f53\uff09\u8868\u793a\u6210\u6709\u9650\u6570\u76ee\u7684\u53c2\u6570 \u51fd\u6570\u786e\u5b9a \uff1a\u5fc5\u987b\u786e\u5b9a\u4e00\u4e2a\u7528\u53c2\u6570\u96c6\u63cf\u8ff0\u7684\u4ee3\u4ef7\u51fd\u6570 \u521d\u59cb\u5316 \uff1a\u8ba1\u7b97\u4e00\u4e2a\u9002\u5f53\u7684\u521d\u59cb\u53c2\u6570\u4f30\u8ba1\u3002\u4e00\u822c\u5c06\u7531\u4e00\u4e2a\u7ebf\u6027\u7b97\u6cd5\uff08\u4f8b\u5982 DLT \u7b97\u6cd5\uff09\u6765\u5b9e\u73b0 \u8fed\u4ee3 \uff1a\u7531\u521d\u59cb\u89e3\u5f00\u59cb\uff0c\u5728\u8fed\u4ee3\u4e2d\u9010\u6b65\u4fee\u6b63\u53c2\u6570\u4ee5\u8fbe\u5230\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u7684\u76ee\u7684 \u5173\u4e8e\u53c2\u6570\u5316 \u00b6 \u6307\u5bfc\u53c2\u6570\u5316\u7684\u4e00\u822c\u7b56\u7565\u662f\u9009\u62e9\u80fd\u8986\u76d6\u6700\u5c0f\u5316\u7684\u6574\u4e2a\u7a7a\u95f4\u5e76\u80fd\u7528\u4e00\u79cd\u65b9\u4fbf\u7684\u65b9\u5f0f\u6765\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u3002\u5bf9\u4e8e\u9f50\u6b21\u76ee\u6807\u901a\u5e38\u8bbe\u6709\u5fc5\u8981\u6216\u4e0d\u9f13\u52b1\u8ffd\u6c42\u6d88\u9664\u5c3a\u5ea6\u56e0\u5b50\u7684\u591a\u4e49\u6027\u800c\u91c7\u7528\u6700\u5c0f\u53c2\u6570\u5316\u3002\u9009\u62e9\u53c2\u6570\u5316\u7684\u53e6\u4e00\u4e2a\u8003\u8651\u662f\u9650\u5236\u53d8\u6362\u4e3a\u4e00\u4e2a\u5177\u4f53\u7684\u7c7b\u578b\u3002 \u51fd\u6570\u786e\u5b9a \u00b6 \u6709\u4e00\u4e2a\u534f\u65b9\u5dee\u77e9\u9635\u4e3a \\(\\sum\\) \u7684 \u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X} \\in IR^N\\) \u4e00\u7ec4\u53c2\u6570\u88ab\u8868\u8fbe\u6210\u4e00\u4e2a\u77e2\u91cf \\(\\mathbf{P} \\in IR^M\\) \u5b9a\u4e49\u4e00\u4e2a\u6620\u5c04 \\(f:\\ IR^M \\to IR^N\\) \uff0c\u5176\u503c\u57df\uff08\u81f3\u5c11\u5c40\u90e8\u5730\uff09\u662f \\(IR^N\\) \u4e2d\u8868\u793a\u5bb9\u8bb8\u6d4b\u91cf\u96c6\u7684\u6a21\u578b\u66f2\u9762 S \u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u662f Mahalanobis \u8ddd\u79bb \\[\\parallel \\mathbf{X} - f(\\mathbf{P}) \\parallel_{\\sum}^2=(\\mathbf{X} - f(\\mathbf{P}))^\\top\\sum\\nolimits^{-1}(\\mathbf{X} - f(\\mathbf{P}))\\] \u5355\u56fe\u50cf\u8bef\u5dee-\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570 \uff1a\u56fa\u5b9a\u7b2c\u4e00\u5e45\u56fe\u50cf\u4e2d\u70b9 \\(\\mathbf{x}_i\\) \u7684\u5750\u6807\uff0c\u5e76\u53d8\u6362 H \u4ee5\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ \\sum_id(\\mathbf{x}_i^\\prime,H\\tilde{\\mathbf{x}}_i)^2 \\\\ f:\\mathbf{h} \\to (H\\mathbf{x}_1, H\\mathbf{x}_2, ..., H\\mathbf{H}_n) \\] \u5bf9\u79f0\u4f20\u9012\u8bef\u5dee-\u5bf9\u79f0\u5316\u4ee3\u4ef7\u51fd\u6570 \\[ \\sum_id(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\\\ f: \\mathbf{h} \\to (H^{-1}\\mathbf{x}_1^\\prime, ..., H^{-1}\\mathbf{x}_n^\\prime, H\\mathbf{x}_1, ..., H\\mathbf{x}_n) \\] \u91cd\u6295\u5f71\u8bef\u5dee \uff1a\u53ef\u4ee5\u7528 \\(\\hat{\\mathbf{x}}_i\\) \u5750\u6807\u548c \\(\\hat{H}\\) \u77e9\u9635\u7684\u5143\u7d20\u2014\u2014\u603b\u5171 \\(2n+9\\) \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u3002 \u53c2\u6570\u77e2\u91cf \uff1a \\(\\mathbf{P}=(\\mathbf{h}, \\hat{\\mathbf{x}}_i, ..., \\hat{\\mathbf{x}}_n)\\) \u3002\u51fd\u6570 \\(f\\) \u5b9a\u4e49\u4e3a \\(f:\\mathbf{P}\\to (\\hat{\\mathbf{x}}_1, \\hat{\\mathbf{x}}_i^\\prime, ..., \\hat{\\mathbf{x}}_n, \\hat{\\mathbf{x}}_n^\\prime)\\) Sampson \u8fd1\u4f3c \uff1a\u91cd\u6295\u5f71\u8bef\u5dee\u7684 Sampson \u8fd1\u4f3c\u4f7f\u6295\u5f71\u8bef\u5dee\u4e5f\u80fd\u4ec5\u5bf9 9 \u4e2a\u53c2\u6570\u6700\u5c0f\u5316 \u521d\u59cb\u5316 \u00b6 \u53ef\u4ee5\u7528\u7ebf\u6027\u6280\u672f\u6216\u6700\u5c0f\u914d\u7f6e\u89e3\u6765\u6c42\u53c2\u6570\u5316\u7684\u521d\u59cb\u4f30\u8ba1\u3002\u8fd8\u91c7\u7528\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5728\u53c2\u6570\u7a7a\u95f4\u8fdb\u884c\u8db3\u591f\u5bc6\u7684\u91c7\u6837\uff0c\u4ece\u6bcf\u4e00\u4e2a\u91c7\u6837\u521d\u59cb\u70b9\u5f00\u59cb\u8fed\u4ee3\u5e76\u4fdd\u7559\u6700\u597d\u7684\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u6cd5\u4ec5\u5728\u53c2\u6570\u7a7a\u95f4\u7684\u7ef4\u6570\u8db3\u591f\u5c0f\u65f6\u624d\u53ef\u91c7\u7528 \u8fed\u4ee3\u65b9\u6cd5 \u00b6 \u5176\u4e2d\u6700\u5e38\u7528\u7684\u6709 Newton \u8fed\u4ee3\u548c Levenberg-Marquardt \u65b9\u6cd5\u3002Newton \u8fed\u4ee3\u662f\u6700\u5feb\u7684\uff0c\u4f46\u662f\u5b83\u9700\u8981\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u800c\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u80fd\u4f1a\u53d1\u6563\u3002Levenberg-Marquardt \u65b9\u6cd5\u662f\u4e00\u79cd\u66f4\u7a33\u5b9a\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u5b83\u7684\u6536\u655b\u901f\u5ea6\u6bd4 Newton \u8fed\u4ee3\u6162\u3002 \u7b97\u6cd5\u7684\u5b9e\u9a8c\u6bd4\u8f83 \u00b6 \u9c81\u68d2\u4f30\u8ba1 \u00b6 \u4e4b\u524d\u8ba8\u8bba\u7684\u5bf9\u5e94\u96c6\u7684\u552f\u4e00\u8bef\u5dee\u6e90\u6765\u81ea\u70b9\u7684\u4f4d\u7f6e\u6d4b\u91cf\uff0c\u5728\u8bb8\u591a\u5b9e\u9645\u8fd0\u884c\u4e2d\uff0c\u8fd8\u5b58\u5728\u7740\u70b9\u88ab\u9519\u914d\u7684\u60c5\u51b5\u3002\u9519\u914d\u70b9\u5bf9\u9ad8\u65af\u8bef\u5dee\u5206\u5e03\u800c\u8a00\u662f \u91ce\u503c \u3002 RANSAC \u00b6 \u7528 \u6a21\u578b \u53bb\u62df\u5408\u6570\u636e\uff0c \u968f\u673a\u6837\u672c \u5305\u542b\u8db3\u4ee5\u786e\u5b9a\u6a21\u578b\u7684\u6700\u5c0f\u6570\u636e\u96c6\u3002\u5982\u679c\u6a21\u578b\u662f\u5e73\u9762\u5355\u5e94\uff0c\u800c\u6570\u636e\u662f 2D \u70b9\u5bf9\u5e94\u96c6\uff0c\u90a3\u4e48\u6700\u5c0f\u5b50\u96c6\u5305\u542b\u56db\u7ec4\u5bf9\u5e94\u3002 \u7b97\u6cd5\u6d41\u7a0b \u968f\u673a\u5730\u4ece\u6570\u636e\u96c6 \\(S\\) \u4e2d\u9009\u62e9 \\(s\\) \u4e2a\u6570\u636e\u70b9\u7ec4\u6210\u7684\u4e00\u4e2a\u6837\u672c\u4f5c\u4e3a\u6a21\u578b\u7684\u4e00\u4e2a\u793a\u4f8b \u786e\u5b9a\u5728\u6a21\u578b\u8ddd\u79bb\u9608\u503c \\(t\\) \u5185\u7684\u6570\u636e\u70b9\u96c6 \\(S_i\\) \uff0c \\(S_i\\) \u79f0\u4e3a\u91c7\u6837\u7684\u4e00\u81f4\u96c6\u5e76\u5b9a\u4e49 \\(S_i\\) \u7684\u5185\u70b9 \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f(\u5185\u70b9\u7684\u6570\u76ee)\u5927\u4e8e\u67d0\u4e2a\u9608\u503c \\(T\\) \uff0c\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b\u5e76\u7ed3\u675f \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f\u5c0f\u4e8e \\(T\\) \uff0c\u9009\u62e9\u4e00\u4e2a\u65b0\u7684\u5b50\u96c6\u5e76\u91cd\u590d\u4e0a\u9762\u7684\u8fc7\u7a0b \u7ecf\u8fc7 \\(N\\) \u6b21\u8bd5\u9a8c\u9009\u62e9\u6700\u5927\u4e00\u81f4\u96c6 \\(S_i\\) \uff0c\u5e76\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b \u9c81\u68d2\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u00b6 \u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570 \uff1a\u4e0d\u540c\u4e8e\u4ec5\u5728\u5185\u70b9\u4e0a\u6700\u5c0f\u5316 \\(\\mathcal{C}=\\sum_{i}d_{\\perp}^2\\) \uff0c\u53e6\u4e00\u79cd\u6539\u8fdb\u7684\u9c81\u68d2\u65b9\u6cd5\u662f\u5728\u6240\u6709\u6570\u636e\u4e0a\u6700\u5c0f\u5316\u3002\u4e00\u4e2a\u5408\u9002\u7684\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\u662f \\[ \\mathcal{D}=\\sum_i \\gamma(d_{\\perp})\u4e14\\gamma(e)= \\left\\{\\begin{matrix} e^2 & e^2 < t^2 & \u5185\u70b9 \\\\ t^2 & e^2 >= t^2 & \u91ce\u503c \\end{matrix}\\right. \\] \\(d_\\perp\\) \u662f\u70b9\u7684\u8bef\u5dee\uff0c \\(\\gamma(e)\\) \u662f\u4e00\u4e2a\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u4e2d\u7ed9\u91ce\u503c\u8d4b\u4e00\u4e2a\u56fa\u5b9a\u7684\u4ee3\u4ef7\u3002 \u5176\u4ed6\u9c81\u68d2\u7b97\u6cd5 \u00b6 \u6700\u5c0f\u4e2d\u503c\u5e73\u65b9(LMS)\u4f30\u8ba1 \uff1a\u2003\u6839\u636e\u6570\u636e\u4e2d\u6240\u6709\u70b9\u7684\u8ddd\u79bb\u4e2d\u503c\uff0c\u9009\u62e9\u5177\u6709\u6700\u5c0f\u4e2d\u503c\u7684\u6a21\u578b\u3002LMS \u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u4e0d\u9700\u8981\u9608\u503c\u6216\u8bef\u5dee\u65b9\u5dee\u7684\u5148\u9a8c\u77e5\u8bc6\u3002 LMS \u7684\u7f3a\u70b9\u662f\u5982\u679c\u591a\u4e8e\u4e00\u534a\u7684\u6570\u636e\u662f\u91ce\u503c\u90a3\u4e48\u5b83\u8981\u5931\u8d25\uff0c\u56e0\u4e3a\u8ddd\u79bb\u7684\u4e2d\u503c\u53ef\u80fd\u662f\u4e00\u4e2a\u91ce\u503c\u3002\u89e3\u51b3\u7684\u529e\u6cd5\u662f\u7528\u91ce\u503c\u7684\u6bd4\u4f8b\u6765\u786e\u5b9a\u6240\u9009\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u91ce\u503c\u7684\u6570\u91cf\u5c11\uff0c\u90a3\u4e48\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u9c81\u68d2\u65b9\u6cd5\uff1a \u5220\u70b9\u65b9\u6cd5 \u2003\u6bcf\u70b9\u8f6e\u6d41\u88ab\u5220\u9664\u800c\u7528\u6a21\u578b\u5bf9\u5269\u4e0b\u7684\u6570\u636e\u62df\u5408\u3002 \u52a0\u6743\u6700\u5c0f\u4e8c\u4e58\u65b9\u8fed\u4ee3 \u2003\u5176\u4e2d\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u62df\u5408\u7684\u5f71\u54cd\u4ee5\u5b83\u7684\u6b8b\u5dee\u6765\u53cd\u52a0\u6743\u3002 \u5355\u5e94\u7684\u81ea\u52a8\u8ba1\u7b97 \u00b6 \u8ba1\u7b97\u4e24\u5e45\u56fe\u50cf\u95f4\u7684\u5355\u5e94\u7684\u7b97\u6cd5\u3002 \u7b97\u6cd5\u7684\u8f93\u5165\u4ec5\u4ec5\u662f\u56fe\u50cf\uff0c\u4e0d\u9700\u8981\u5176\u4ed6 \u5148\u9a8c \u4fe1\u606f\uff1b\u800c\u8f93\u51fa\u7684\u662f\u5355\u5e94\u7684\u4f30\u8ba1\u4ee5\u53ca\u4e00\u7ec4\u5bf9\u5e94\u7684\u5174\u8da3\u70b9\u3002\u8be5\u7b97\u6cd5\u53ef\u4ee5\u5e94\u7528\u4e8e\u8bf8\u5982\u4e00\u5f20\u5e73\u5766\u8868\u9762\u7684\u4e24\u5e45\u56fe\u50cf\u6216\u7531\u6444\u50cf\u673a\u7ed5\u5176\u5149\u5fc3\u65cb\u8f6c\u7684\u5230\u7684\u4e24\u5e45\u56fe\u50cf\u3002 \u7b97\u6cd5\u6d41\u7a0b \u5174\u8da3\u70b9 \uff1a\u5728\u6bcf\u4e00\u5e45\u56fe\u50cf\u4e0a\u8ba1\u7b97\u5174\u8da3\u70b9 \u5047\u8bbe\u5bf9\u5e94 \uff1a\u6839\u636e\u5174\u8da3\u70b9\u7070\u5ea6\u9886\u57df\u7684\u63a5\u8fd1\u548c\u76f8\u4f3c\uff0c\u8ba1\u7b97\u5b83\u4eec\u7684\u5339\u914d\u96c6\u3002 RANSAC\u9c81\u68d2\u4f30\u8ba1 \uff1a\u91cd\u590d \\(N\\) \u6b21\u91c7\u6837\uff1a \u9009\u62e9\u7531\u56db\u7ec4\u5bf9\u5e94\u7ec4\u6210\u7684\u4e00\u4e2a\u968f\u673a\u6837\u672c\u5e76\u8ba1\u7b97\u5355\u5e94 H \u5bf9\u5047\u8bbe\u7684\u6bcf\u7ec4\u5355\u5e94\uff0c\u8ba1\u7b97\u8ddd\u79bb \\(d_{\\perp}\\) \u6839\u636e \\(d_\\perp < t = \\sqrt{5.99} \\delta\\) \u50cf\u7d20\u786e\u5b9a\u5bf9\u5e94\u6570\uff0c\u8fdb\u800c\u8ba1\u7b97\u4e0e H \u4e00\u81f4\u7684\u5185\u70b9\u6570 \u9009\u62e9\u5177\u6709\u6700\u5927\u5185\u70b9\u6570\u7684 H\uff0c\u5f53\u6570\u76ee\u76f8\u7b49\u65f6\u9009\u62e9\u5185\u70b9\u7684\u6807\u51c6\u65b9\u5dee\u6700\u4f4e\u7684 H \u6700\u4f18\u4f30\u8ba1 \uff1a\u7531\u5212\u5b9a\u7684\u5185\u70b9\u7684\u6240\u6709\u5bf9\u5e94\u91cd\u65b0\u4f30\u8ba1 H\uff0c\u7528 Levenberg-Marquardt \u7b97\u6cd5\u6765\u6700\u5c0f\u5316 ML \u4ee3\u4ef7\u51fd\u6570 \u5f15\u5bfc\u5339\u914d \uff1a\u7528\u4f30\u8ba1\u7684 H \u53bb\u5b9a\u4e49\u8f6c\u79fb\u70b9\u4f4d\u7f6e\u9644\u8fd1\u7684\u641c\u7d22\u533a\u57df\uff0c\u8fdb\u4e00\u6b65\u786e\u5b9a\u5174\u8da3\u70b9\u7684\u5bf9\u5e94\u3002 \u6700\u540e\u4e24\u6b65\u91cd\u590d\u5230\u5bf9\u5e94\u7684\u6570\u76ee\u7a33\u5b9a\u4e3a\u6b62","title":"\u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/est2d/#2d","text":"\u7ea6 6196 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 21 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u4f30\u8ba1\u95ee\u9898\uff0c\u4f30\u8ba1\u7684\u542b\u4e49\u662f\u6307\u5728\u67d0\u4e9b\u672c\u8d28\u6d4b\u91cf\u7684\u57fa\u7840\u4e0a\u8ba1\u7b97\u67d0\u4e2a\u53d8\u6362\u6216\u5176\u5b83\u6570\u5b66\u91cf\uff0c\u5e38\u89c1\u7684\u4f30\u8ba1\u95ee\u9898\u7684\u7c7b\u578b\u6709\uff1a 2D \u5355\u5e94 \uff1a\u7ed9\u5b9a \\(IP^2\\) \u4e2d\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u540c\u5728 \\(IP^2\\) \u4e2d\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u628a\u6bcf\u4e00\u70b9 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u5c04\u5f71\u53d8\u6362\u3002 3D \u5230 2D \u7684\u6444\u50cf\u673a\u6295\u5f71 \uff1a\u7ed9\u5b9a 3D \u7a7a\u95f4\u7684\u70b9\u96c6 \\(X_i\\) \u4ee5\u53ca\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u6c42\u628a \\(X_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i\\) \u7684 3D \u5230 2D \u7684\u5c04\u5f71\u6620\u5c04\u3002 \u57fa\u672c\u77e9\u9635\u7684\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u53e6\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u4e0e\u8fd9\u4e9b\u5bf9\u5e94\u4e00\u76f4\u7684 \u57fa\u672c\u77e9\u9635 \\(F\\) \u3002 \u4e09\u7126\u70b9\u5f20\u91cf\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u8de8\u4e09\u5e45\u56fe\u50cf\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime \\leftrightarrow \\mathbf{x}_i^{\\prime \\prime}\\) \uff0c\u8ba1\u7b97\u4e09\u7126\u70b9\u5f20\u91cf\u3002 \u7814\u7a76\u4e24\u5e45\u56fe\u50cf\u4e4b\u95f4\u5bf9\u5e94\u70b9\u7684\u96c6\u5408 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u5bf9\u6240\u6709\u7684 i \u90fd\u6ee1\u8db3 \\(H\\mathbf{x}_i=\\mathbf{x}_i^\\prime\\) \u7684\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635 H\uff1a \u6d4b\u91cf\u6570 \uff1a\u77e9\u9635 H \u6709 9 \u4e2a\u5143\u7d20\uff0c\u4f46\u4ec5\u786e\u5b9a\u5230\u76f8\u5dee\u4e00\u4e2a\u5c3a\u5ea6\u56e0\u5b50\u3002\u56e0\u6b64\uff0c2D \u5c04\u5f71\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u7684\u603b\u6570\u662f 8\u3002\u56e0\u4e3a\u4e00\u4e2a 2D \u70b9\u6709\u4e24\u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u4e3a\u4e86\u5b8c\u5168\u7ea6\u675f H\uff0c\u9700\u8981\u6307\u5b9a\u56db\u7ec4\u70b9\u5bf9\u5e94\u3002 \u8fd1\u4f3c\u89e3 \uff1a\u5982\u679c\u7ed9\u5b9a\u56db\u7ec4\u5bf9\u5e94\uff0c\u90a3\u4e48\u53ef\u4ee5\u5f97\u5230\u77e9\u9635 H \u7684\u7cbe\u786e\u89e3\u8fd9\u79cd\u89e3\u79f0\u4e3a \u6700\u5c0f\u914d\u7f6e\u89e3 \u3002\u5982\u679c\u7ed9\u5b9a\u591a\u4e8e\u56db\u7ec4\u7684\u5bf9\u5e94\uff0c\u90a3\u4e48\u8fd9\u4e9b\u5bf9\u5e94\u53ef\u80fd\u4e0d\u4e0e\u4efb\u4f55\u5c04\u5f71\u53d8\u6362\u5b8c\u5168\u76f8\u5bb9\uff0c\u56e0\u800c\u6211\u4eec\u9762\u4e34\u7684\u4efb\u52a1\u662f\u6309\u7ed9\u5b9a\u7684\u6570\u636e\u786e\u5b9a\u201c\u6700\u597d\u201d\u7684\u53d8\u6362\u3002\u901a\u5e38\u8fd9\u4e2a\u4efb\u52a1\u662f\u901a\u8fc7\u5bfb\u627e\u6700\u5c0f\u5316\u67d0\u4e2a\u4ee3\u4ef7\u51fd\u6570\u7684\u53d8\u6362 H \u6765\u5b8c\u6210\u3002 \u9ec4\u91d1\u6807\u51c6\u7b97\u6cd5 \uff1a\u901a\u5e38\u5b58\u5728\u4e00\u79cd\u6700\u4f18\u7684\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u6700\u4f18\u7684\u542b\u4e49\u662f\u5728\u4e00\u5b9a\u5047\u8bbe\u4e0b\uff0c\u4f7f\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684 H \u662f\u53d8\u6362\u7684\u6700\u597d\u4f30\u8ba1\u3002\u8ba1\u7b97\u8be5\u4ee3\u4ef7\u51fd\u6570\u6700\u5c0f\u503c\u7684\u7b97\u6cd5\u79f0\u4e3a\u201c\u9ec4\u91d1\u6807\u51c6\u201d\u7b97\u6cd5\u3002","title":"\u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/est2d/#dlt","text":"\u9996\u5148\u8ba8\u8bba\u7531\u7ed9\u5b9a 2D \u5230 2D\u7684\u56db\u7ec4\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u786e\u5b9a H \u7684\u4e00\u79cd\u7b80\u5355\u7684\u7ebf\u6027\u7b97\u6cd5\uff0c\u53d8\u6362\u7531 \\(\\mathbf{x}_i^\\prime = H\\mathbf{x}_i\\) \u7ed9\u51fa\u3002\u4f46\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u9f50\u6b21\u77e2\u91cf\u65b9\u7a0b\uff0c\u56e0\u6b64 3 \u7ef4\u77e2\u91cf \\(\\mathbf{x}_i^\\prime\\) \u548c \\(H\\mathbf{x}_i\\) \u4e0d\u76f8\u7b49\u3002\u53ef\u4ee5\u7528\u77e2\u91cf\u53c9\u4e58\uff1a \\(\\mathbf{x}_i^\\prime \\times H\\mathbf{x}_i=\\mathbf{0}\\) \u8868\u793a\u3002 \u5982\u679c\u5c06\u77e9\u9635 H \u7684\u7b2c j \u884c\u8bb0\u4e3a \\(h^{j\\top},\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \uff0c\u5219 \\(\\mathbf{x}_i^\\prime \\times H \\mathbf{x}_i=0\\) \u53ef\u4ee5\u8f6c\u6362\u6210\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime\\mathbf{x}_i^\\top \\\\ -y_i^\\prime \\mathbf{x}_i^\\top & x_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} =\\mathbf{0} \\] h \u662f\u7531\u77e9\u9635 H \u7684\u5143\u7d20\u7ec4\u6210\u7684 0 \u7ef4\u77e2\u91cf\uff1a \\[ \\mathbf{h}= \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} , \\ \\ \\ H= \\begin{bmatrix} h_1 & h_2 & h_3 \\\\ h_4 & h_5 & h_6 \\\\ h_7 & h_8 & h_9 \\end{bmatrix} \\] \\(A_i\\mathbf{h}=\\mathbf{0}\\) \u662f\u672a\u77e5\u77e2\u91cf \\(\\mathbf{h}\\) \u7684\u7ebf\u6027\u65b9\u7a0b\uff0c\u77e9\u9635 \\(A_i\\) \u7684\u5143\u7d20\u662f\u5df2\u77e5\u70b9\u7684\u5750\u6807\u7684\u4e8c\u6b21\u591a\u9879\u5f0f\u3002 \u867d\u7136\u5f0f\u4e2d\u6709\u4e09\u4e2a\u65b9\u7a0b\uff0c\u4f46\u4ec5\u6709\u4e24\u4e2a\u662f\u7ebf\u6027\u72ec\u7acb\u7684\u3002\u5728\u89e3 H \u65f6\u5e38\u7701\u53bb\u7b2c\u4e09\u4e2a\u7b49\u5f0f\u3002 \u8be5\u65b9\u7a0b\u7ec4\u5bf9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u4efb\u4f55\u9f50\u6b21\u5750\u6807 \\((x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u6210\u7acb\u3002 \u6c42\u89e3 H \uff1a\u6bcf\u7ec4\u70b9\u5bf9\u5e94\u7ed9\u51fa\u5173\u4e8e H \u5143\u7d20\u7684\u4e24\u4e2a\u72ec\u7acb\u7684\u65b9\u7a0b\u3002\u7ed9\u5b9a\u56db\u7ec4\u8fd9\u6837\u7684\u70b9\u5bf9\u5e94\uff0c\u4fbf\u83b7\u5f97\u65b9\u7a0b\u7ec4 \\(A\\mathbf{h}=\\mathbf{0}\\) \u3002","title":"\u76f4\u63a5\u7ebf\u6027\u53d8\u6362\uff08DLT\uff09\u7b97\u6cd5"},{"location":"cv/mvg/est2d/#_1","text":"\u5982\u679c\u7ed9\u51fa\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u591a\u4f59\u56db\u7ec4\uff0c\u65b9\u7a0b \\(A\\mathbf{h}=\\mathbf{0}\\) \u662f\u8d85\u5b9a\u7684\u3002 \u5982\u679c\u70b9\u7684\u4f4d\u7f6e\u662f\u7cbe\u786e\u7684\uff0c\u90a3\u4e48 \\(A\\) \u7684\u79e9\u4ecd\u7136\u4e3a 8 \u5e76\u6709\u4e00\u7ef4\u96f6\u7a7a\u95f4\uff0c\u5e76\u4e14\u5b58\u5728\u7cbe\u786e\u89e3 \\(\\mathbf{h}\\) \u3002 \u5982\u679c\u56fe\u50cf\u5750\u6807\u7684\u6d4b\u91cf\u65f6\u4e0d\u7cbe\u786e\u7684\uff0c\u65b9\u7a0b\u7ec4\u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002\u6240\u4ee5\u9700\u8981\u4e00\u4e2a\u9002\u5f53\u7684\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\mathbf{h}\\) \uff0c\u901a\u5e38\u9644\u52a0\u8303\u6570\u6761\u4ef6\uff0c\u65e2\u7136\u4e0d\u5b58\u5728 \\(A\\mathbf{h}=\\mathbf{0}\\) \u7684\u7cbe\u786e\u89e3\uff0c\u5f88\u81ea\u7136\u4f1a\u5728\u901a\u5e38\u7ea6\u675f \\(\\parallel \\mathbf{h} \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002\u8fd9\u7b49\u4ef7\u4e8e\u6c42\u5546 \\(\\parallel A \\mathbf{h} \\parallel / \\parallel \\mathbf{h} \\parallel\\) \u7684\u6700\u5c0f\u503c\u95ee\u9898\u3002\u8be5\u89e3\u662f \\(A^\\top A\\) \u7684\u6700\u5c0f\u7279\u5f81\u503c\u7684\uff08\u5355\u4f4d\uff09\u7279\u5f81\u77e2\u91cf\u3002\u7531\u6b64\u6240\u5f97\u5230\u7684\u7b97\u6cd5\u79f0\u4e3a \u57fa\u672cDLT\u7b97\u6cd5 \u3002","title":"\u8d85\u5b9a\u89e3"},{"location":"cv/mvg/est2d/#_2","text":"\u628a\u7b49\u5f0f\u8f6c\u6210\u975e\u9f50\u6b21\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u5373\u7ed9\u77e2\u91cf \\(\\mathbf{h}\\) \u4e2d\u7684\u67d0\u4e2a\u5143\u7d20\u5f3a\u52a0\u4e0a \\(h_j=1\\) \u7684\u6761\u4ef6\uff1a \\[ \\begin{bmatrix} 0 & 0 & 0 & -x_iw_i^\\top & -y_iw_i^\\top & -w_iw_i^\\top & x_iy_i^\\top & y_iy_i^\\top \\\\ x_iw_i^\\top & y_iw_i^\\top & w_iw_i^\\top & 0 & 0 & 0 & -x_ix_i^\\top & -y_ix_i^\\top \\\\ \\end{bmatrix} \\bar{\\mathbf{h}}= \\begin{bmatrix} -w_iy_i^\\top \\\\ -w_ix_i^\\top \\end{bmatrix} \\] \u5176\u4e2d \\(\\bar{\\mathbf{h}}\\) \u662f\u7531 \\(\\mathbf{h}\\) \u7684\u524d\u516b\u4e2a\u5143\u7d20\u7ec4\u6210\u7684 8 \u7ef4\u77e2\u91cf\u3002 \u4f46\u662f\uff0c\u5982\u679c\u4e8b\u5b9e\u4e0a\u771f\u6b63\u7684\u89e3\u662f \\(h_j=0\\) \uff0c\u90a3\u4e48\u4e0d\u5b58\u5728\u4e00\u56e0\u5b50 \\(k\\) \u4f7f\u5f97 \\(kh_j=1\\) \uff0c\u8868\u793a\u4ee4 \\(h_j=1\\) \u5f97\u4e0d\u5230\u771f\u89e3\u3002","title":"\u975e\u9f50\u6b21\u89e3"},{"location":"cv/mvg/est2d/#_3","text":"\u5982\u679c \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u90a3\u4e48 \\(H^*=\\mathbf{x}_4^\\top\\mathbf{I}^\\top\\) \u662f\u4e00\u4e2a\u89e3 \\(H^*\\) \u662f\u552f\u4e00\u89e3\uff08\u76f8\u5dee\u4e00\u5c3a\u5ea6\u56e0\u5b50\uff09\uff0c\u56e0\u4e3a \\(H^*\\) \u662f\u5947\u5f02\u77e9\u9635\uff0c\u4e0d\u5b58\u5728\u628a\u6bcf\u4e2a \\(\\mathbf{x}_i\\) \u53d8\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u3002\u5f53 \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u800c \\(\\mathbf{x}_1^\\prime, \\mathbf{x}_2^\\prime, \\mathbf{x}_3^\\prime\\) \u4e0d\u5171\u7ebf\u65f6\u5c31\u4f1a\u4ea7\u751f\u8fd9\u79cd\u60c5\u51b5 \u5b58\u5728\u53e6\u5916\u4e00\u4e2a\u89e3 \\(H\\) \uff1a\u4ece\u800c\u4efb\u4f55\u5f62\u5982 \\(\\alpha H^*+\\beta H\\) \u7684\u77e9\u9635\u90fd\u662f\u89e3\uff0c\u56e0\u6b64\u6709\u4e00\u4e2a 2 \u53c2\u6570\u7684\u53d8\u6362\u7c07\u5b58\u5728\uff0c\u8fdb\u800c\u63a8\u51fa\u7ed9\u51fa\u7684 8 \u4e2a\u65b9\u7a0b\u4e0d\u662f\u72ec\u7acb\u7684 \u51fa\u73b0\u67d0\u79cd\u914d\u7f6e\u4e0d\u80fd\u786e\u5b9a\u552f\u4e00\u89e3\u7684\u60c5\u5f62\u79f0\u4e3a \u9000\u5316 \u3002 \u9000\u5316\u7684\u5b9a\u4e49\u65e2\u6d89\u53ca\u914d\u7f6e\u4e5f\u6d89\u53ca\u53d8\u6362\u7c7b\u578b\uff0c\u800c\u4e14\u9000\u5316\u95ee\u9898\u4e0d\u4ec5\u9650\u4e8e\u6700\u5c0f\u914d\u7f6e\u89e3\u3002\u5982\u679c\u591a\u51fa\u6765\u7684\uff08\u7cbe\u786e\u7684\uff0c\u5373\u65e0\u8bef\u5dee\u7684\uff09\u70b9\u5bf9\u5e94\u4e5f\u5171\u7ebf\uff0c\u90a3\u4e48\u9000\u5316\u95ee\u9898\u4ecd\u6ca1\u6709\u89e3\u51b3\u3002","title":"\u9000\u5316\u914d\u7f6e"},{"location":"cv/mvg/est2d/#_4","text":"\u524d\u9762\u53ea\u8ba8\u8bba\u7531\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u5355\u5e94\uff0c\u7136\u800c\u7ebf\u5bf9\u5e94\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5e94\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u5355\u5e94\uff0c\u6240\u4ee5\u5c31\u4ea7\u751f\u8ba1\u7b97\u4e00\u4e2a\u5355\u5e94\uff08\u6216\u4efb\u4f55\u5176\u4ed6\u5173\u7cfb\uff09\u9700\u8981\u591a\u5c11\u7ec4\u5bf9\u5e94\u7684\u95ee\u9898\u3002\u4e00\u822c\u7684\u539f\u5219\u662f\u7ea6\u675f\u6570\u5fc5\u987b\u7b49\u4e8e\u6216\u5927\u4e8e\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002 \u91c7\u7528\u6df7\u5408\u7c7b\u578b\u7684\u5bf9\u5e94\u6765\u8ba1\u7b97 H \u65f6\u5fc5\u987b\u8c28\u614e\uff0c\u4f8b\u5982\u4e00\u4e2a 2D \u5355\u5e94\u4e0d\u80fd\u7531\u4e24\u7ec4\u70b9\u5bf9\u5e94\u548c\u4e24\u7ec4\u7ebf\u5bf9\u5e94\u552f\u4e00\u786e\u5b9a\uff0c\u4f46\u80fd\u7531\u4e09\u7ea7\u70b9\u548c\u4e00\u7ec4\u7ebf\u6216\u4e00\u7ec4\u70b9\u548c\u4e09\u7ec4\u7ebf\u6765\u552f\u4e00\u786e\u5b9a\uff0c\u5373\u4f7f\u6bcf\u79cd\u914d\u7f6e\u90fd\u6709 8 \u4e2a\u81ea\u7531\u5ea6\u4e5f\u662f\u5982\u6b64\u3002","title":"\u7531\u7ebf\u548c\u5176\u4ed6\u5b9e\u4f53\u6c42\u89e3"},{"location":"cv/mvg/est2d/#_5","text":"\u4e3a\u786e\u5b9a H \u7684\u8d85\u5b9a\u89e3\u800c\u9700\u6700\u5c0f\u5316\u7684\u82e5\u5e72\u4ee3\u4ef7\u51fd\u6570","title":"\u4e0d\u540c\u7684\u4ee3\u4ef7\u51fd\u6570"},{"location":"cv/mvg/est2d/#_6","text":"DLT \u7b97\u6cd5\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002 \u77e2\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u79f0\u4e3a\u6b8b\u5dee\u77e2\u91cf\uff0c\u5e76\u4e14\u8981\u6700\u5c0f\u5316\u7684\u6b63\u662f\u8be5\u8bef\u5dee\u77e2\u91cf\u7684\u8303\u6570\u3002 \u77e2\u91cf \\(\\varepsilon_i\\) \u88ab\u79f0\u4e3a\u5173\u8054\u4e8e\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u548c\u5355\u5e94 H \u7684 \u4ee3\u6570\u8bef\u5dee\u77e2\u91cf \uff0c\u8be5\u77e2\u91cf\u7684\u8303\u6570\u662f\u4e00\u4e2a\u6807\u91cf\uff0c\u79f0\u4e3a \u4ee3\u6570\u8ddd\u79bb \uff1a \\[ d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\parallel \\varepsilon_i \\parallel= \\parallel \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime \\mathbf{x}_i^\\top \\end{bmatrix} \\mathbf{h} \\parallel^2 \\] \u5bf9\u4e8e\u4efb\u4f55\u4e24\u4e2a\u77e2\u91cf \\(\\mathbf{x}_1\\) \u548c \\(\\mathbf{x}_2\\) \uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_1, \\mathbf{x}_2)^2=a_1^2+a_2^2 \\ \\ \u5176\u4e2d\\mathbf{a}=(a_1,a_2,a_3)^\\top=\\mathbf{x}_1 \\times \\mathbf{x}_2 \\] \u7ed9\u5b9a\u5bf9\u5e94\u7684\u96c6\u5408\uff0c\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u662f\u6574\u4e2a\u96c6\u5408\u7684\u4ee3\u6570\u8bef\u5dee\u77e2\u91cf\uff0c\u7531\u6b64\u53ef\u89c1\uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\sum_{i} \\parallel \\varepsilon_i \\parallel^2= \\parallel A\\mathbf{h} \\parallel^2= \\parallel \\varepsilon \\parallel^2 \\] \u7f3a\u70b9\u662f\u88ab\u6700\u5c0f\u5316\u7684\u91cf\u6ca1\u6709\u51e0\u4f55\u6216\u7edf\u8ba1\u4e0a\u7684\u610f\u4e49\u3002","title":"\u4ee3\u6570\u8ddd\u79bb"},{"location":"cv/mvg/est2d/#_7","text":"","title":"\u51e0\u4f55\u8ddd\u79bb"},{"location":"cv/mvg/est2d/#_8","text":"\u77e2\u91cf \\(\\mathbf{x}\\) \u8868\u793a \u6d4b\u91cf \u7684\u56fe\u50cf\u5750\u6807\uff1b \\(\\hat{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u4f30\u8ba1\u503c\u800c \\(\\bar{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u771f\u503c\u3002","title":"\u8bb0\u53f7"},{"location":"cv/mvg/est2d/#_9","text":"\u9996\u5148\u8003\u8651\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u975e\u5e38\u7cbe\u786e\u800c\u8bef\u5dee\u4ec5\u51fa\u73b0\u5728\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u60c5\u5f62\u3002\u9002\u5b9c\u6700\u5c0f\u5316\u7684\u91cf\u662f \u8f6c\u79fb\u8bef\u5dee \u3002\u5b83\u662f\u7b2c\u4e8c\u5e45\u56fe\u50cf\u4e0a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u4e0e\u70b9 \\(H\\bar{\\mathbf{x}}\\) \u4e4b\u95f4\u7684 \u6b27\u6c0f\u8ddd\u79bb \u3002\u7528\u8bb0\u53f7 \\(d(\\mathbf{x}, \\mathbf{y})\\) \u8868\u793a\u975e\u9f50\u6b21\u70b9 \\(\\mathbf{x}\\) \u548c \\(\\mathbf{y}\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u3002\u5bf9\u5e94\u96c6\u5408\u7684\u8f6c\u79fb\u8bef\u5dee\u662f\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}_i})^2 \\]","title":"\u5355\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/est2d/#_10","text":"\u66f4\u5207\u5408\u5b9e\u9645\u7684\u60c5\u5f62\u662f\u56fe\u50cf\u6d4b\u91cf\u8bef\u5dee\u5728\u4e24\u5e45\u56fe\u50cf\u4e2d\u90fd\u53d1\u751f\uff0c\u4ece\u800c\u5e94\u8be5\u6700\u5c0f\u5316\u4e24\u5e45\u800c\u4e0d\u4ec5\u662f\u4e00\u5e45\u56fe\u50cf\u7684\u8bef\u5dee\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\]","title":"\u5bf9\u79f0\u8f6c\u79fb\u8bef\u5dee"},{"location":"cv/mvg/est2d/#_11","text":"\u5bf9\u6bcf\u5e45\u56fe\u50cf\u8bef\u5dee\u4f5c\u91cf\u5316\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f30\u8ba1\u6bcf\u7ec4\u5bf9\u5e94\u7684\u201c\u6821\u6b63\u503c\u201d\u3002\u4e3a\u4e86\u5f97\u5230\u5b8c\u5168\u7684\u5339\u914d\u70b9\u96c6\u6709\u5fc5\u8981\u5728\u4e00\u5e45\u56fe\u50cf\uff08\u7b2c\u4e8c\u5e45\u56fe\u50cf\uff09\u4e0a\u5bf9\u6d4b\u91cf\u8fdb\u884c\u6821\u6b63\u3002 \u5355\u5e94 \\(\\hat{H}\\) \u548c\u5b8c\u5168\u5339\u914d\u7684\u70b9\u5bf9 \\(\\hat{\\mathbf{x}_i}\\) \u548c \\(\\hat{\\mathbf{x}_i}^\\prime\\) \u4ee5\u6700\u5c0f\u5316\u603b\u7684\u8bef\u5dee\u51fd\u6570: \\[ \\sum_{i} d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2 \\ \\ \\ s.t \\ \\ \\ \\hat{\\mathbf{x}_i}^\\prime=\\hat{H}\\hat{\\mathbf{x}_i} \\ \\ \\ \\forall i. \\] \u5148\u7531 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u4f30\u8ba1\u4e16\u754c\u5e73\u9762\u7684\u70b9 \\(\\hat{\\mathbf{X}_i}\\) \uff0c\u7136\u540e\u628a\u5b83\u91cd\u6295\u5f71\u5230\u4f30\u8ba1\u4e0a\u8ba4\u4e3a\u662f\u5b8c\u5168\u5339\u914d\u7684\u5bf9\u5e94 \\(\\hat{\\mathbf{x}_i} \\leftrightarrow \\hat{\\mathbf{x}_i}^\\prime\\)","title":"\u91cd\u6295\u5f71\u8bef\u5dee\u2014\u2014\u4e24\u5e45\u56fe\u50cf"},{"location":"cv/mvg/est2d/#_12","text":"\u4ee4 \\(\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u5e76\u5b9a\u4e49\u77e2\u91cf \\((\\hat{x_i}^\\prime, \\hat{y_i}^\\prime, \\hat{w_i}^\\prime)^\\top=\\hat{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}}\\) \uff0c\u5219 \\[ d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2= d_{alg}(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2/\\hat{w_i}^\\prime w_i^\\prime \\] \u51e0\u4f55\u8ddd\u79bb\u4e0e\u4ee3\u6570\u8ddd\u79bb\u76f8\u5173\uff0c\u4f46\u4e0d\u76f8\u7b49\u3002\u53ea\u6709\u5f53 \\(\\hat{w_i}^\\prime=w_i^\\prime=1\\) \u4e24\u4e2a\u8ddd\u79bb\u76f8\u7b49\u3002\u56e0\u6b64\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8ddd\u79bb\u548c\u4ee3\u6570\u8ddd\u79bb\u76f8\u7b49\u3002\u5bf9\u4e8e\u4eff\u5c04\u53d8\u6362\uff0c\u6700\u5c0f\u5316\u51e0\u4f55\u8ddd\u79bb\u53ef\u4ee5\u7528\u57fa\u4e8e\u4ee3\u6570\u8ddd\u79bb\u7684\u7ebf\u6027 DLT \u7b97\u6cd5\u3002","title":"\u51e0\u4f55\u548c\u4ee3\u6570\u8ddd\u79bb\u7684\u6bd4\u8f83"},{"location":"cv/mvg/est2d/#_13","text":"\u4e24\u5e73\u9762\u4e4b\u95f4\u7684\u5355\u5e94\u4f30\u8ba1\u53ef\u4ee5\u89c6\u4e3a\u7528 4D \u7a7a\u95f4 \\(IR^4\\) \u4e2d\u7684\u201c\u66f2\u9762\u201d\u6765\u62df\u5408\u70b9\u3002 \u6bcf\u5bf9\u56fe\u50cf\u70b9 \\(\\mathbf{x}, \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6d4b\u91cf\u7a7a\u95f4 \\(IR^4\\) \u7684\u4e00\u4e2a\u70b9\uff0c\u8bb0\u4f5c \\(\\mathbf{X}\\) \u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u6ee1\u8db3 \\(\\mathbf{x} \\times \\mathbf{x}^\\prime=\\mathbf{0}\\) \u7684\u56fe\u50cf\u5bf9\u5e94 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6765 \\(IR^4\\) \u4e2d\u7684\u4e00\u4e2a\u4ee3\u6570\u7c07 \\(\\upsilon_H\\) \uff0c\u5b83\u662f\u4e24\u4e2a\u8d85\u4e8c\u6b21\u66f2\u9762\u7684\u4ea4\u96c6\u3002 \\[ d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2=d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2 \\] \u5176\u4e2d \\(d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u5230\u7c07 \\(\\upsilon_H\\) \u7684\u5782\u76f4\u8ddd\u79bb\u3002","title":"\u91cd\u6295\u5f71\u8bef\u5dee\u7684\u51e0\u4f55\u89e3\u91ca"},{"location":"cv/mvg/est2d/#sampson","text":"Sampson \u8bef\u5dee\u5176\u590d\u6742\u6027\u4ecb\u4e8e\u4ee3\u6570\u548c\u51e0\u4f55\u4ee3\u4ef7\u51fd\u6570\u4e4b\u95f4\uff0c\u4f46\u975e\u5e38\u8fd1\u4f3c\u4e8e\u51e0\u4f55\u8bef\u5dee\u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u5728 \\(\\upsilon_H\\) \u4e0a\u7684\u4efb\u4f55\u70b9 \\(\\mathbf{X}=(x,y,x^\\prime, y^\\prime)^\\top\\) \uff0c\u4ee3\u4ef7\u51fd\u6570\u7528 \\(\\mathcal{C}_H(\\mathbf{X})=\\mathbf{0}\\) \u3002\u7528\u4e0b\u5217 Taylor \u5c55\u5f00\u5f0f\u6765\u4e00\u9636\u903c\u8fd1\uff1a \\[ \\mathcal{C}_H(\\mathbf{X}+\\delta_x)=\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x \\] \u8bb0 \\(\\delta_x = \\hat{\\mathbf{X}}-\\mathbf{X}\\) \u5e0c\u671b \\(\\hat{\\mathbf{X}}\\) \u5728 \\(\\upsilon_H\\) \u4e0a\uff0c\u5373 \\(\\mathcal{C}_H(\\hat{\\mathbf{X}})=\\mathbf{0}\\) \uff0c\u56e0\u6b64 \\(\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x=\\mathbf{0}\\) \u3002\u8bb0\u6210 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \uff0c\u5176\u4e2d \\(\\mathbf{J}\\) \u662f\u504f\u5bfc\u6570\u77e9\u9635\uff0c \\(\\varepsilon\\) \u4e0e \\(\\mathbf{X}\\) \u76f8\u5173\u7684\u4ee3\u4ef7\u51fd\u6570 \\(\\mathcal{C}_H(\\mathbf{X})\\) \uff0c \u6700\u5c0f\u5316\u95ee\u9898 \u662f\u6c42\u6ee1\u8db3\u6b64\u65b9\u7a0b\u7684\u6700\u5c0f \\(\\delta_x\\) \u3002 \u5373 \u6c42\u5728\u6ee1\u8db3 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \u6761\u4ef6\u4e0b\u4f7f \\(\\parallel \\delta_x \\parallel\\) \u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\delta_x\\) \u4f7f\u7528 Lagrange \u4e58\u5b50\u6cd5\uff0c\u6c42\u7684\u8303\u6570 \\(\\parallel \\delta \\parallel^2\\) \u662f Sampson \u8bef\u5dee\uff1a \\[ \\parallel \\delta_x \\parallel^2= \\delta_x^\\top\\delta_x= \\varepsilon^\\top(\\mathbf{J}\\mathbf{J}^\\top)^{-1}\\varepsilon \\]","title":"Sampson \u8bef\u5dee"},{"location":"cv/mvg/est2d/#_14","text":"\u5047\u5b9a\u5728\u6ca1\u6709\u6d4b\u91cf\u8bef\u5dee\u65f6\uff0c\u771f\u5b9e\u7684\u70b9\u51c6\u786e\u6ee1\u8db3\u4e00\u4e2a\u5355\u5e94\u53d8\u6362\uff0c\u5373 \\(\\bar{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}_i}\\) \u3002 \u5047\u5b9a\u6bcf\u4e00\u5e45\u56fe\u50cf\u5750\u6807\u90fd\u5177\u6709\u96f6\u5747\u503c\u548c\u7edf\u4e00\u7684\u6807\u51c6\u5dee \\(\\sigma\\) \u7684\u9ad8\u65af\u566a\u58f0\u3002\u8fd9\u610f\u5473\u7740 \\(x=\\bar{x}+\\Delta x\\) \uff0c\u5176\u4e2d \\(\\Delta x\\) \u670d\u4ece\u65b9\u5dee\u4e3a \\(\\sigma^2\\) \u7684\u9ad8\u65af\u5206\u5e03\u3002\u8fdb\u4e00\u6b65\u5047\u8bbe\u6bcf\u6b21\u6d4b\u91cf\u7684\u566a\u58f0\u662f\u76f8\u5728\u72ec\u7acb\u7684\uff0c\u90a3\u4e48\uff0c\u82e5\u70b9\u7684\u771f\u503c\u662f \\(\\bar{\\mathbf{x}}\\) \uff0c\u5219\u6bcf\u4e2a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}\\) \u7684\u6982\u7387\u5bc6\u5ea6\u51fd\u6570(pdf)\u662f\uff1a \\[ \\Pr(\\mathbf{x})=(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x},\\bar{\\mathbf{x}})^2/(2\\sigma^2)} \\]","title":"\u7edf\u8ba1\u4ee3\u4ef7\u51fd\u6570\u548c\u6700\u5927\u4f3c\u7136\u4f30\u8ba1"},{"location":"cv/mvg/est2d/#_15","text":"\u5047\u5b9a\u6bcf\u70b9\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\uff0c\u70b9\u5bf9\u5e94 \\(\\{\\bar{\\mathbf{x}_i} \\leftrightarrow \\mathbf{x}_i^\\prime\\}\\) \u7684\u6982\u7387\u5c31\u662f\u5b83\u4eec\u5355\u4e2a pdf \u7684\u4e58\u79ef\uff1a \\[ \\Pr(\\{\\mathbf{x}_i^\\prime | H\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2/(2\\sigma^2)} \\] \u8be5\u5bf9\u5e94\u96c6\u5408\u7684 \u5bf9\u6570\u4f3c\u7136 \u4e3a\uff1a \\[ \\log \\Pr(\\mathbf{x}_i^\\prime | H)=-\\frac{1}{2\\sigma^2}\\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2+\u5e38\u6570 \\] \u5355\u5e94\u7684 \u6700\u5927\u4f3c\u7136 ML \u4f30\u8ba1 \\(\\hat{H}\\) \u6700\u5927\u5316\u8fd9\u4e2a\u5bf9\u6570\u4f3c\u7136\uff0c\u5373\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2 \\] \u56e0\u6b64\uff0cML \u4f30\u8ba1\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u51fd\u6570","title":"\u5355\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/est2d/#_16","text":"\u5982\u679c\u771f\u5b9e\u5bf9\u5e94\u662f \\(\\{\\bar{\\mathbf{x}}_i \\leftrightarrow H \\bar{\\mathbf{x}}_i=\\bar{\\mathbf{x}}_i^\\prime\\}\\) \uff0c\u53d7\u566a\u58f0\u5e72\u6270\u7684\u6570\u636e\u7684 pdf \u662f\uff1a \\[ \\Pr(\\{\\mathbf{x}_i, \\mathbf{x}_i^\\prime\\} | H, \\{\\bar{\\mathbf{x}}_i\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-(d(\\mathbf{x}_i, \\bar{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}}_i)^2)/(2\\sigma^2)} \\] ML \u4f30\u8ba1\u5c31\u662f\u6c42\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i, \\hat{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}}_i^\\prime)^2 \\] ML \u4f30\u8ba1\u7b49\u540c\u4e8e\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u51fd\u6570","title":"\u53cc\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/est2d/#mahalanobis","text":"\u4e00\u822c\u9ad8\u65af\u5206\u5e03\u7684\u60c5\u5f62\uff0c\u53ef\u4ee5\u5047\u5b9a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6ee1\u8db3\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u9ad8\u65af\u5206\u5e03\u51fd\u6570\u3002\u6700\u5927\u5316\u5bf9\u6570\u4f3c\u7136\u5219\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 Mahalanobis \u8ddd\u79bb\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2=(\\mathbf{X}-\\bar{\\mathbf{X}})^\\top\\sum\\nolimits^{-1}(\\mathbf{X}-\\bar{\\mathbf{X}}) \\] \u5f53\u6bcf\u5e45\u56fe\u50cf\u90fd\u6709\u8bef\u5dee\u5e76\u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u4e0e\u53e6\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\u65f6\uff0c\u5408\u9002\u7684\u4ee3\u4ef7\u51fd\u6570\u662f\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2+\\parallel \\mathbf{X}^\\prime - \\bar{\\mathbf{X}}^\\prime \\parallel_{\\sum^\\prime}^2 \\] \u5176\u4e2d \\(\\sum\\) \u548c \\(\\sum^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u7684\u534f\u65b9\u5dee\u77e9\u9635","title":"Mahalanobis \u8ddd\u79bb"},{"location":"cv/mvg/est2d/#_17","text":"","title":"\u53d8\u6362\u4e0d\u53d8\u6027\u548c\u5f52\u4e00\u5316"},{"location":"cv/mvg/est2d/#_18","text":"\u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}\\) \u88ab \\(\\tilde{\\mathbf{x}}=T\\mathbf{x}\\) \u66ff\u4ee3\uff0c\u800c\u53e6\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}^\\prime\\) \u88ab \\(\\tilde{\\mathbf{x}}^\\prime=T^\\prime\\mathbf{x}^\\prime\\) \u66ff\u4ee3\u3002\u56e0\u6b64 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\uff1a \u6839\u636e\u516c\u5f0f \\(\\tilde{\\mathbf{x}}_i=T\\mathbf{x}_i\\) \u548c \\(\\tilde{\\mathbf{x}}_i^\\prime=T^\\prime\\mathbf{x}_i^\\prime\\) \u53d8\u6362\u56fe\u50cf\u5750\u6807 \u7531\u5bf9\u5e94 \\(\\tilde{\\mathbf{x}}_i \\leftrightarrow \\tilde{\\mathbf{x}}_i^\\prime\\) \uff0c\u6c42 \\(\\tilde{H}\\) \u4ee4 \\(H=T^{\\prime-1}\\tilde{H}T\\)","title":"\u5173\u4e8e\u56fe\u50cf\u5750\u6807\u53d8\u6362\u7684\u4e0d\u53d8\u6027"},{"location":"cv/mvg/est2d/#dlt_1","text":"\u4ee4 \\(T^\\prime\\) \u4e3a\u5177\u6709\u7f29\u653e\u56e0\u5b50 \\(s\\) \u7684\u76f8\u4f3c\u53d8\u6362\uff0c \\(T\\) \u4e3a\u4efb\u610f\u7684\u5c04\u5f71\u53d8\u6362\u3002\u6b64\u5916\uff0c\u5047\u8bbe \\(H\\) \u662f\u4efb\u4f55 2D \u5355\u5e94\u5e76\u5b9a\u4e49 \\(\\tilde{H}=T^\\prime HT^{-1}\\) \uff0c\u90a3\u4e48 \\(\\parallel \\tilde{A} \\tilde{\\mathbf{h}} \\parallel = s \\parallel A \\mathbf{h} \\parallel\\) \u867d\u7136\u8fd9\u6837\u5b9a\u4e49\u7684 \\(H\\) \u548c \\(\\tilde{H}\\) \u7ed9\u51fa\u540c\u6837\u7684\u8bef\u5dee \\(\\varepsilon\\) \uff0c\u4f46\u662f\u5bf9\u89e3\u65bd\u52a0\u7684\u7ea6\u675f\u6761\u4ef6 \\(\\parallel H \\parallel = 1\\) \u4e0d\u7b49\u4ef7\u4e8e\u6761\u4ef6 \\(\\parallel \\tilde{H} \\parallel = 1\\) \uff0c\u5b83\u4eec\u5e76\u4e0d\u4ee5\u4efb\u4f55\u7b80\u5355\u7684\u65b9\u5f0f\u76f8\u5173\u8054\u3002","title":"DLT \u7b97\u6cd5\u7684\u975e\u4e0d\u53d8\u6027"},{"location":"cv/mvg/est2d/#_19","text":"\\[ d(\\tilde{\\mathbf{x}}^\\prime, \\tilde{H}\\tilde{\\mathbf{x}})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime HT^{-1}T\\mathbf{x})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime H\\mathbf{x})= d(\\mathbf{x}^\\prime, H\\mathbf{x}) \\] \u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8bef\u5dee\u88ab\u4e58\u4ee5\u53d8\u6362\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u4ece\u800c\u6700\u5c0f\u5316\u53d8\u6362\u7684\u5bf9\u5e94\u65b9\u5f0f\u4e0e\u6b27\u6c0f\u53d8\u6362\u76f8\u540c\u3002\u6240\u4ee5\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\u3002","title":"\u51e0\u4f55\u8bef\u5dee\u7684\u4e0d\u53d8\u6027"},{"location":"cv/mvg/est2d/#_20","text":"\u6570\u636e\u5f52\u4e00\u5316\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u7ed3\u679c\u7684\u7cbe\u5ea6\uff0c\u8fd8\u5bf9\u521d\u59cb\u6570\u636e\u5f52\u4e00\u5316\u7684\u7b97\u6cd5\u5c06\u5bf9\u4efb\u4f55\u5c3a\u5ea6\u7f29\u653e\u548c\u5750\u6807\u539f\u70b9\u7684\u9009\u62e9\u4e0d\u53d8\u3002\u56e0\u800c\u4f7f DLT \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5173\u4e8e\u76f8\u4f3c\u53d8\u6362\u4e0d\u53d8\u3002","title":"\u5f52\u4e00\u5316\u53d8\u6362"},{"location":"cv/mvg/est2d/#_21","text":"\u5bf9\u70b9\u8fdb\u884c\u5e73\u79fb\u4f7f\u70b9\u96c6\u5f62\u5fc3\u4f4d\u4e8e\u539f\u70b9 \u5bf9\u70b9\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684\u5e73\u5747\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{2}\\) \u5bf9\u4e24\u5e45\u56fe\u50cf\u72ec\u7acb\u8fdb\u884c\u4e0a\u8ff0\u53d8\u6362 \u6570\u636e\u5f52\u4e00\u5316\u5728 DLT \u7b97\u6cd5\u4e2d\u662f\u5b9e\u8d28\u6027\u7684\uff0c\u4e00\u5b9a\u4e0d\u8981\u89c6\u5b83\u4e3a\u53ef\u6709\u53ef\u65e0\u7684\u3002","title":"\u5404\u5411\u540c\u6027\u7f29\u653e"},{"location":"cv/mvg/est2d/#_22","text":"\u5f52\u4e00\u5316\u7684\u5f71\u54cd\u4e0e DLT \u65b9\u7a0b\u7ec4\u7684\u6761\u4ef6\u6570\u6216\u51c6\u786e\u5730\u8bf4\u4e0e\u65b9\u7a0b\u7ec4\u77e9\u9635 A \u7684\u7b2c\u4e00\u4e2a\u548c\u5012\u6570\u7b2c\u4e8c\u4e2a\u5947\u5f02\u503c\u7684\u6bd4\u7387 \\(d_1/d_{n-1}\\) \u6709\u5173\u3002\u4f46\u662f\uff0c\u5728\u6709\u566a\u58f0\u5b58\u5728\u65f6\u89e3\u5c06\u504f\u79bb\u5176\u6b63\u786e\u7ed3\u679c\u3002\u5927\u6761\u4ef6\u6570\u4f1a\u653e\u5927\u8fd9\u79cd\u504f\u5411\u3002","title":"\u5f52\u4e00\u5316\u4e0e\u6761\u4ef6\u6570"},{"location":"cv/mvg/est2d/#_23","text":"\u5728\u975e\u5404\u540c\u6027\u7f29\u653e\u4e2d\uff0c\u70b9\u7684\u5f62\u5fc3\u548c\u524d\u9762\u4e00\u6837\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7ecf\u5e73\u79fb\u540e\u70b9\u5728\u539f\u70b9\u9644\u8fd1\u5f62\u6210\u4e91\u3002\u7136\u540e\u8fdb\u884c\u5750\u6807\u5c3a\u5ea6\u7f29\u653e\u4f7f\u8be5\u70b9\u96c6\u7684\u4e24\u4e3b\u77e9\u90fd\u7b49\u4e8e 1\u3002\u8fd9\u6837\u4f7f\u8be5\u70b9\u96c6\u5f62\u6210\u4ee5\u539f\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u534a\u5f84\u4e3a 1 \u7684\u8fd1\u4f3c\u7684\u5bf9\u79f0\u5706\u4e91\u3002","title":"\u975e\u5404\u5411\u540c\u6027\u7f29\u653e"},{"location":"cv/mvg/est2d/#_24","text":"\u5f53\u70b9\u4f4d\u4e8e\u6216\u63a5\u8fd1\u5e73\u9762\u7684\u65e0\u7a77\u8fdc\u65f6\uff0c\u5404\u5411\u540c\u6027\uff08\u6216\u975e\u5404\u5411\u540c\u6027\uff09\u7684\u7f29\u653e\u65b9\u5f0f\u6765\u5f52\u4e00\u5316\u5750\u6807\u662f\u65e2\u65e0\u9053\u7406\u53c8\u4e0d\u53ef\u884c\u7684\uff0c\u56e0\u4e3a\u5f62\u5fc3\u5750\u6807\u548c\u7f29\u653e\u56e0\u5b50\u4e3a\u65e0\u7a77\u5927\u6216\u63a5\u8fd1\u65e0\u7a77\u5927\u3002\u4e00\u4e2a\u4f3c\u4e4e\u4f1a\u7ed9\u51fa\u597d\u7ed3\u679c\u7684\u65b9\u6cd5\u662f\u5f52\u4e00\u5316\u70b9\u96c6 \\(\\mathbf{x}_i=(x_i,y_i,w_i)^\\top\\) \u4f7f\u5f97\uff1a \\[ \\sum_i x_i=\\sum_i y_i=0;\\sum_ix_i^2+y_i^2=2\\sum_iw_i^2;x_i^2+y_i^2+w_i^2=1,\\forall i \\]","title":"\u65e0\u7a77\u8fdc\u9644\u8fd1\u7684\u70b9\u7684\u7f29\u653e"},{"location":"cv/mvg/est2d/#_25","text":"\u8fed\u4ee3\u6700\u5c0f\u5316\u6280\u672f \u4ee3\u4ef7\u53c2\u6570 \uff1a\u4ee3\u4ef7\u51fd\u6570\u662f\u6700\u5c0f\u5316\u7684\u57fa\u7840 \u53c2\u6570\u5316 \uff1a\u628a\u8981\u8ba1\u7b97\u7684\u53d8\u6362\uff08\u6216\u5176\u4ed6\u5b9e\u4f53\uff09\u8868\u793a\u6210\u6709\u9650\u6570\u76ee\u7684\u53c2\u6570 \u51fd\u6570\u786e\u5b9a \uff1a\u5fc5\u987b\u786e\u5b9a\u4e00\u4e2a\u7528\u53c2\u6570\u96c6\u63cf\u8ff0\u7684\u4ee3\u4ef7\u51fd\u6570 \u521d\u59cb\u5316 \uff1a\u8ba1\u7b97\u4e00\u4e2a\u9002\u5f53\u7684\u521d\u59cb\u53c2\u6570\u4f30\u8ba1\u3002\u4e00\u822c\u5c06\u7531\u4e00\u4e2a\u7ebf\u6027\u7b97\u6cd5\uff08\u4f8b\u5982 DLT \u7b97\u6cd5\uff09\u6765\u5b9e\u73b0 \u8fed\u4ee3 \uff1a\u7531\u521d\u59cb\u89e3\u5f00\u59cb\uff0c\u5728\u8fed\u4ee3\u4e2d\u9010\u6b65\u4fee\u6b63\u53c2\u6570\u4ee5\u8fbe\u5230\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u7684\u76ee\u7684","title":"\u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5"},{"location":"cv/mvg/est2d/#_26","text":"\u6307\u5bfc\u53c2\u6570\u5316\u7684\u4e00\u822c\u7b56\u7565\u662f\u9009\u62e9\u80fd\u8986\u76d6\u6700\u5c0f\u5316\u7684\u6574\u4e2a\u7a7a\u95f4\u5e76\u80fd\u7528\u4e00\u79cd\u65b9\u4fbf\u7684\u65b9\u5f0f\u6765\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u3002\u5bf9\u4e8e\u9f50\u6b21\u76ee\u6807\u901a\u5e38\u8bbe\u6709\u5fc5\u8981\u6216\u4e0d\u9f13\u52b1\u8ffd\u6c42\u6d88\u9664\u5c3a\u5ea6\u56e0\u5b50\u7684\u591a\u4e49\u6027\u800c\u91c7\u7528\u6700\u5c0f\u53c2\u6570\u5316\u3002\u9009\u62e9\u53c2\u6570\u5316\u7684\u53e6\u4e00\u4e2a\u8003\u8651\u662f\u9650\u5236\u53d8\u6362\u4e3a\u4e00\u4e2a\u5177\u4f53\u7684\u7c7b\u578b\u3002","title":"\u5173\u4e8e\u53c2\u6570\u5316"},{"location":"cv/mvg/est2d/#_27","text":"\u6709\u4e00\u4e2a\u534f\u65b9\u5dee\u77e9\u9635\u4e3a \\(\\sum\\) \u7684 \u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X} \\in IR^N\\) \u4e00\u7ec4\u53c2\u6570\u88ab\u8868\u8fbe\u6210\u4e00\u4e2a\u77e2\u91cf \\(\\mathbf{P} \\in IR^M\\) \u5b9a\u4e49\u4e00\u4e2a\u6620\u5c04 \\(f:\\ IR^M \\to IR^N\\) \uff0c\u5176\u503c\u57df\uff08\u81f3\u5c11\u5c40\u90e8\u5730\uff09\u662f \\(IR^N\\) \u4e2d\u8868\u793a\u5bb9\u8bb8\u6d4b\u91cf\u96c6\u7684\u6a21\u578b\u66f2\u9762 S \u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u662f Mahalanobis \u8ddd\u79bb \\[\\parallel \\mathbf{X} - f(\\mathbf{P}) \\parallel_{\\sum}^2=(\\mathbf{X} - f(\\mathbf{P}))^\\top\\sum\\nolimits^{-1}(\\mathbf{X} - f(\\mathbf{P}))\\] \u5355\u56fe\u50cf\u8bef\u5dee-\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570 \uff1a\u56fa\u5b9a\u7b2c\u4e00\u5e45\u56fe\u50cf\u4e2d\u70b9 \\(\\mathbf{x}_i\\) \u7684\u5750\u6807\uff0c\u5e76\u53d8\u6362 H \u4ee5\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ \\sum_id(\\mathbf{x}_i^\\prime,H\\tilde{\\mathbf{x}}_i)^2 \\\\ f:\\mathbf{h} \\to (H\\mathbf{x}_1, H\\mathbf{x}_2, ..., H\\mathbf{H}_n) \\] \u5bf9\u79f0\u4f20\u9012\u8bef\u5dee-\u5bf9\u79f0\u5316\u4ee3\u4ef7\u51fd\u6570 \\[ \\sum_id(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\\\ f: \\mathbf{h} \\to (H^{-1}\\mathbf{x}_1^\\prime, ..., H^{-1}\\mathbf{x}_n^\\prime, H\\mathbf{x}_1, ..., H\\mathbf{x}_n) \\] \u91cd\u6295\u5f71\u8bef\u5dee \uff1a\u53ef\u4ee5\u7528 \\(\\hat{\\mathbf{x}}_i\\) \u5750\u6807\u548c \\(\\hat{H}\\) \u77e9\u9635\u7684\u5143\u7d20\u2014\u2014\u603b\u5171 \\(2n+9\\) \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u3002 \u53c2\u6570\u77e2\u91cf \uff1a \\(\\mathbf{P}=(\\mathbf{h}, \\hat{\\mathbf{x}}_i, ..., \\hat{\\mathbf{x}}_n)\\) \u3002\u51fd\u6570 \\(f\\) \u5b9a\u4e49\u4e3a \\(f:\\mathbf{P}\\to (\\hat{\\mathbf{x}}_1, \\hat{\\mathbf{x}}_i^\\prime, ..., \\hat{\\mathbf{x}}_n, \\hat{\\mathbf{x}}_n^\\prime)\\) Sampson \u8fd1\u4f3c \uff1a\u91cd\u6295\u5f71\u8bef\u5dee\u7684 Sampson \u8fd1\u4f3c\u4f7f\u6295\u5f71\u8bef\u5dee\u4e5f\u80fd\u4ec5\u5bf9 9 \u4e2a\u53c2\u6570\u6700\u5c0f\u5316","title":"\u51fd\u6570\u786e\u5b9a"},{"location":"cv/mvg/est2d/#_28","text":"\u53ef\u4ee5\u7528\u7ebf\u6027\u6280\u672f\u6216\u6700\u5c0f\u914d\u7f6e\u89e3\u6765\u6c42\u53c2\u6570\u5316\u7684\u521d\u59cb\u4f30\u8ba1\u3002\u8fd8\u91c7\u7528\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5728\u53c2\u6570\u7a7a\u95f4\u8fdb\u884c\u8db3\u591f\u5bc6\u7684\u91c7\u6837\uff0c\u4ece\u6bcf\u4e00\u4e2a\u91c7\u6837\u521d\u59cb\u70b9\u5f00\u59cb\u8fed\u4ee3\u5e76\u4fdd\u7559\u6700\u597d\u7684\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u6cd5\u4ec5\u5728\u53c2\u6570\u7a7a\u95f4\u7684\u7ef4\u6570\u8db3\u591f\u5c0f\u65f6\u624d\u53ef\u91c7\u7528","title":"\u521d\u59cb\u5316"},{"location":"cv/mvg/est2d/#_29","text":"\u5176\u4e2d\u6700\u5e38\u7528\u7684\u6709 Newton \u8fed\u4ee3\u548c Levenberg-Marquardt \u65b9\u6cd5\u3002Newton \u8fed\u4ee3\u662f\u6700\u5feb\u7684\uff0c\u4f46\u662f\u5b83\u9700\u8981\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u800c\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u80fd\u4f1a\u53d1\u6563\u3002Levenberg-Marquardt \u65b9\u6cd5\u662f\u4e00\u79cd\u66f4\u7a33\u5b9a\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u5b83\u7684\u6536\u655b\u901f\u5ea6\u6bd4 Newton \u8fed\u4ee3\u6162\u3002","title":"\u8fed\u4ee3\u65b9\u6cd5"},{"location":"cv/mvg/est2d/#_30","text":"","title":"\u7b97\u6cd5\u7684\u5b9e\u9a8c\u6bd4\u8f83"},{"location":"cv/mvg/est2d/#_31","text":"\u4e4b\u524d\u8ba8\u8bba\u7684\u5bf9\u5e94\u96c6\u7684\u552f\u4e00\u8bef\u5dee\u6e90\u6765\u81ea\u70b9\u7684\u4f4d\u7f6e\u6d4b\u91cf\uff0c\u5728\u8bb8\u591a\u5b9e\u9645\u8fd0\u884c\u4e2d\uff0c\u8fd8\u5b58\u5728\u7740\u70b9\u88ab\u9519\u914d\u7684\u60c5\u51b5\u3002\u9519\u914d\u70b9\u5bf9\u9ad8\u65af\u8bef\u5dee\u5206\u5e03\u800c\u8a00\u662f \u91ce\u503c \u3002","title":"\u9c81\u68d2\u4f30\u8ba1"},{"location":"cv/mvg/est2d/#ransac","text":"\u7528 \u6a21\u578b \u53bb\u62df\u5408\u6570\u636e\uff0c \u968f\u673a\u6837\u672c \u5305\u542b\u8db3\u4ee5\u786e\u5b9a\u6a21\u578b\u7684\u6700\u5c0f\u6570\u636e\u96c6\u3002\u5982\u679c\u6a21\u578b\u662f\u5e73\u9762\u5355\u5e94\uff0c\u800c\u6570\u636e\u662f 2D \u70b9\u5bf9\u5e94\u96c6\uff0c\u90a3\u4e48\u6700\u5c0f\u5b50\u96c6\u5305\u542b\u56db\u7ec4\u5bf9\u5e94\u3002 \u7b97\u6cd5\u6d41\u7a0b \u968f\u673a\u5730\u4ece\u6570\u636e\u96c6 \\(S\\) \u4e2d\u9009\u62e9 \\(s\\) \u4e2a\u6570\u636e\u70b9\u7ec4\u6210\u7684\u4e00\u4e2a\u6837\u672c\u4f5c\u4e3a\u6a21\u578b\u7684\u4e00\u4e2a\u793a\u4f8b \u786e\u5b9a\u5728\u6a21\u578b\u8ddd\u79bb\u9608\u503c \\(t\\) \u5185\u7684\u6570\u636e\u70b9\u96c6 \\(S_i\\) \uff0c \\(S_i\\) \u79f0\u4e3a\u91c7\u6837\u7684\u4e00\u81f4\u96c6\u5e76\u5b9a\u4e49 \\(S_i\\) \u7684\u5185\u70b9 \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f(\u5185\u70b9\u7684\u6570\u76ee)\u5927\u4e8e\u67d0\u4e2a\u9608\u503c \\(T\\) \uff0c\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b\u5e76\u7ed3\u675f \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f\u5c0f\u4e8e \\(T\\) \uff0c\u9009\u62e9\u4e00\u4e2a\u65b0\u7684\u5b50\u96c6\u5e76\u91cd\u590d\u4e0a\u9762\u7684\u8fc7\u7a0b \u7ecf\u8fc7 \\(N\\) \u6b21\u8bd5\u9a8c\u9009\u62e9\u6700\u5927\u4e00\u81f4\u96c6 \\(S_i\\) \uff0c\u5e76\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b","title":"RANSAC"},{"location":"cv/mvg/est2d/#_32","text":"\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570 \uff1a\u4e0d\u540c\u4e8e\u4ec5\u5728\u5185\u70b9\u4e0a\u6700\u5c0f\u5316 \\(\\mathcal{C}=\\sum_{i}d_{\\perp}^2\\) \uff0c\u53e6\u4e00\u79cd\u6539\u8fdb\u7684\u9c81\u68d2\u65b9\u6cd5\u662f\u5728\u6240\u6709\u6570\u636e\u4e0a\u6700\u5c0f\u5316\u3002\u4e00\u4e2a\u5408\u9002\u7684\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\u662f \\[ \\mathcal{D}=\\sum_i \\gamma(d_{\\perp})\u4e14\\gamma(e)= \\left\\{\\begin{matrix} e^2 & e^2 < t^2 & \u5185\u70b9 \\\\ t^2 & e^2 >= t^2 & \u91ce\u503c \\end{matrix}\\right. \\] \\(d_\\perp\\) \u662f\u70b9\u7684\u8bef\u5dee\uff0c \\(\\gamma(e)\\) \u662f\u4e00\u4e2a\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u4e2d\u7ed9\u91ce\u503c\u8d4b\u4e00\u4e2a\u56fa\u5b9a\u7684\u4ee3\u4ef7\u3002","title":"\u9c81\u68d2\u6700\u5927\u4f3c\u7136\u4f30\u8ba1"},{"location":"cv/mvg/est2d/#_33","text":"\u6700\u5c0f\u4e2d\u503c\u5e73\u65b9(LMS)\u4f30\u8ba1 \uff1a\u2003\u6839\u636e\u6570\u636e\u4e2d\u6240\u6709\u70b9\u7684\u8ddd\u79bb\u4e2d\u503c\uff0c\u9009\u62e9\u5177\u6709\u6700\u5c0f\u4e2d\u503c\u7684\u6a21\u578b\u3002LMS \u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u4e0d\u9700\u8981\u9608\u503c\u6216\u8bef\u5dee\u65b9\u5dee\u7684\u5148\u9a8c\u77e5\u8bc6\u3002 LMS \u7684\u7f3a\u70b9\u662f\u5982\u679c\u591a\u4e8e\u4e00\u534a\u7684\u6570\u636e\u662f\u91ce\u503c\u90a3\u4e48\u5b83\u8981\u5931\u8d25\uff0c\u56e0\u4e3a\u8ddd\u79bb\u7684\u4e2d\u503c\u53ef\u80fd\u662f\u4e00\u4e2a\u91ce\u503c\u3002\u89e3\u51b3\u7684\u529e\u6cd5\u662f\u7528\u91ce\u503c\u7684\u6bd4\u4f8b\u6765\u786e\u5b9a\u6240\u9009\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u91ce\u503c\u7684\u6570\u91cf\u5c11\uff0c\u90a3\u4e48\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u9c81\u68d2\u65b9\u6cd5\uff1a \u5220\u70b9\u65b9\u6cd5 \u2003\u6bcf\u70b9\u8f6e\u6d41\u88ab\u5220\u9664\u800c\u7528\u6a21\u578b\u5bf9\u5269\u4e0b\u7684\u6570\u636e\u62df\u5408\u3002 \u52a0\u6743\u6700\u5c0f\u4e8c\u4e58\u65b9\u8fed\u4ee3 \u2003\u5176\u4e2d\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u62df\u5408\u7684\u5f71\u54cd\u4ee5\u5b83\u7684\u6b8b\u5dee\u6765\u53cd\u52a0\u6743\u3002","title":"\u5176\u4ed6\u9c81\u68d2\u7b97\u6cd5"},{"location":"cv/mvg/est2d/#_34","text":"\u8ba1\u7b97\u4e24\u5e45\u56fe\u50cf\u95f4\u7684\u5355\u5e94\u7684\u7b97\u6cd5\u3002 \u7b97\u6cd5\u7684\u8f93\u5165\u4ec5\u4ec5\u662f\u56fe\u50cf\uff0c\u4e0d\u9700\u8981\u5176\u4ed6 \u5148\u9a8c \u4fe1\u606f\uff1b\u800c\u8f93\u51fa\u7684\u662f\u5355\u5e94\u7684\u4f30\u8ba1\u4ee5\u53ca\u4e00\u7ec4\u5bf9\u5e94\u7684\u5174\u8da3\u70b9\u3002\u8be5\u7b97\u6cd5\u53ef\u4ee5\u5e94\u7528\u4e8e\u8bf8\u5982\u4e00\u5f20\u5e73\u5766\u8868\u9762\u7684\u4e24\u5e45\u56fe\u50cf\u6216\u7531\u6444\u50cf\u673a\u7ed5\u5176\u5149\u5fc3\u65cb\u8f6c\u7684\u5230\u7684\u4e24\u5e45\u56fe\u50cf\u3002 \u7b97\u6cd5\u6d41\u7a0b \u5174\u8da3\u70b9 \uff1a\u5728\u6bcf\u4e00\u5e45\u56fe\u50cf\u4e0a\u8ba1\u7b97\u5174\u8da3\u70b9 \u5047\u8bbe\u5bf9\u5e94 \uff1a\u6839\u636e\u5174\u8da3\u70b9\u7070\u5ea6\u9886\u57df\u7684\u63a5\u8fd1\u548c\u76f8\u4f3c\uff0c\u8ba1\u7b97\u5b83\u4eec\u7684\u5339\u914d\u96c6\u3002 RANSAC\u9c81\u68d2\u4f30\u8ba1 \uff1a\u91cd\u590d \\(N\\) \u6b21\u91c7\u6837\uff1a \u9009\u62e9\u7531\u56db\u7ec4\u5bf9\u5e94\u7ec4\u6210\u7684\u4e00\u4e2a\u968f\u673a\u6837\u672c\u5e76\u8ba1\u7b97\u5355\u5e94 H \u5bf9\u5047\u8bbe\u7684\u6bcf\u7ec4\u5355\u5e94\uff0c\u8ba1\u7b97\u8ddd\u79bb \\(d_{\\perp}\\) \u6839\u636e \\(d_\\perp < t = \\sqrt{5.99} \\delta\\) \u50cf\u7d20\u786e\u5b9a\u5bf9\u5e94\u6570\uff0c\u8fdb\u800c\u8ba1\u7b97\u4e0e H \u4e00\u81f4\u7684\u5185\u70b9\u6570 \u9009\u62e9\u5177\u6709\u6700\u5927\u5185\u70b9\u6570\u7684 H\uff0c\u5f53\u6570\u76ee\u76f8\u7b49\u65f6\u9009\u62e9\u5185\u70b9\u7684\u6807\u51c6\u65b9\u5dee\u6700\u4f4e\u7684 H \u6700\u4f18\u4f30\u8ba1 \uff1a\u7531\u5212\u5b9a\u7684\u5185\u70b9\u7684\u6240\u6709\u5bf9\u5e94\u91cd\u65b0\u4f30\u8ba1 H\uff0c\u7528 Levenberg-Marquardt \u7b97\u6cd5\u6765\u6700\u5c0f\u5316 ML \u4ee3\u4ef7\u51fd\u6570 \u5f15\u5bfc\u5339\u914d \uff1a\u7528\u4f30\u8ba1\u7684 H \u53bb\u5b9a\u4e49\u8f6c\u79fb\u70b9\u4f4d\u7f6e\u9644\u8fd1\u7684\u641c\u7d22\u533a\u57df\uff0c\u8fdb\u4e00\u6b65\u786e\u5b9a\u5174\u8da3\u70b9\u7684\u5bf9\u5e94\u3002 \u6700\u540e\u4e24\u6b65\u91cd\u590d\u5230\u5bf9\u5e94\u7684\u6570\u76ee\u7a33\u5b9a\u4e3a\u6b62","title":"\u5355\u5e94\u7684\u81ea\u52a8\u8ba1\u7b97"},{"location":"cv/mvg/eval/","text":"\u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 \u00b6 \u7ea6 1571 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u8bc4\u4ef7\u548c\u91cf\u5316\u4f30\u8ba1\u7b97\u6cd5\u7684\u7ed3\u679c\u3002 \u901a\u5e38\u4ec5\u6709\u4e00\u4e2a\u53d8\u91cf\u6216\u53d8\u6362\u7684\u4f30\u8ba1\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u7f6e\u4fe1\u5ea6\u6216\u4e0d\u53ef\u9760\u6027\u5ea6\u7684\u6d4b\u91cf \u7ebf\u6027\u903c\u8fd1\u6cd5 \u8499\u7279\u5361\u6d1b\u6cd5 \u6027\u80fd\u7684\u754c\u5b9a \u00b6 \u8bb0\u53f7\u7684\u89c4\u5b9a \u6d4b\u91cf\u5f97\u5230\u7684\u91cf\uff0c\u5982 \\(\\mathbf{x}\\) \u8868\u793a\u56fe\u50cf\u70b9 \u88ab\u4f30\u8ba1\u7684\u91cf\u7528\u52a0\u5e3d\u5b50\u6765\u6807\u8bc6\uff0c\u5982 \\(\\hat{\\mathbf{x}}\\) \u6216 \\(\\hat{H}\\) \u91cf\u7684\u771f\u503c\u7528\u52a0\u6a2a\u6760\u8868\u793a\uff0c\u5982 \\(\\bar{\\mathbf{x}}\\) \u6216 \\(\\bar{H}\\) \u5355\u56fe\u50cf\u8bef\u5dee \u00b6 2D \u5355\u5e94\u7684\u4f30\u8ba1\u95ee\u9898\u5728\u4ec5\u7ed9\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u5750\u6807\u52a0\u566a\u58f0\u7684\u60c5\u5f62\u4e0b\uff0c\u8bbe\u6709 n \u7ec4\u8fd9\u6837\u7684\u5339\u914d\u70b9\uff0c RMS\uff08\u5747\u65b9\u6839\uff09\u6b8b\u5dee\uff1a \\[ \\varepsilon_{res}=(\\frac{1}{2n}\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\] \u53cc\u56fe\u50cf\u8bef\u5dee \u00b6 \u5bf9\u53cc\u56fe\u50cf\u8bef\u5dee\u60c5\u5f62\uff0c\u6b8b\u5dee\u662f \\[ \\varepsilon_{res}=\\frac{1}{\\sqrt{4n}}(\\sum_{i=1}^nd(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2+\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\] \u6700\u4f18\u4f30\u8ba1\u7b97\u6cd5\uff08MLE\uff09 \u00b6 \\(IR^N\\) \u4e0a\u603b\u65b9\u5dee\u4e3a \\(N\\delta^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03\u5411\u4e00\u4e2a \\(s\\) \u7ef4\u5b50\u7a7a\u95f4\u7684\u6295\u5f71\u662f\u603b\u65b9\u5dee\u4e3a \\(s\\sigma^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03 \u8003\u8651\u4e00\u4e2a\u4f30\u8ba1\u95ee\u9898\uff0c\u5176\u4e2d \\(N\\) \u4e2a\u6d4b\u91cf\u7531\u4f9d\u8d56\u4e8e \\(d\\) \u4e2a\u672c\u8d28\u53c2\u6570\u96c6\u7684\u51fd\u6570\u6a21\u578b\u5316\u3002\u5047\u5b9a\u6bcf\u4e2a\u6d4b\u91cf\u53d8\u91cf\u6709\u6807\u51c6\u5dee \\(\\delta\\) \u7684\u72ec\u7acb\u9ad8\u65af\u566a\u58f0\u3002 ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u6b8b\u5dee\uff08\u6d4b\u91cf\u503c\u5230\u4f30\u8ba1\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{res}=E [\\parallel \\hat{\\mathbf{X}} - \\mathbf{X} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(1-d/N)^{1/2} \\] ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u4f30\u8ba1\u8bef\u5dee\uff08\u4f30\u8ba1\u503c\u5230\u771f\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{est}=E [\\parallel \\hat{\\mathbf{X}} - \\bar{\\mathbf{X}} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(d/N)^{1/2} \\] \u53d8\u6362\u4f30\u8ba1\u7684\u534f\u65b9\u5dee \u00b6 \u6c42\u5f97\u7684\u53d8\u6362\u7684\u4e0d\u53ef\u9760\u6027\u901a\u5e38\u7531\u53d8\u6362\u7684 \u534f\u65b9\u5dee\u77e9\u9635 \u83b7\u53d6\uff0c\u56e0\u4e3a \\(H\\) \u662f 9 \u5143\u7d20\u7684\u77e9\u9635\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f\u4e00\u4e2a \\(9\\times 9\\) \u77e9\u9635\u3002 \u534f\u65b9\u5dee\u7684\u524d\u5411\u4f20\u64ad \u00b6 \u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{v}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u6620\u5c04\uff1a\u5b9a\u4e49\u4e3a \\(f(\\mathbf{v})=f(\\bar{\\mathbf{v}})+A(\\mathbf{v}-\\bar{\\mathbf{v}})\\) \u3002\u90a3\u4e48 \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(A\\sum A^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\u3002 \u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{v}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u90bb\u57df\u53ef\u5fae\uff0c\u90a3\u4e48\u5728\u7cbe\u786e\u5230\u4e00\u9636\u8fd1\u4f3c\u7684\u7a0b\u5ea6\u4e0b\uff0c \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(J\\sum J^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u4e2d \\(J\\) \u662f \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u503c\u3002 \u534f\u65b9\u5dee\u7684\u53cd\u5411\u4f20\u64ad \u00b6 \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u4eff\u5c04\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u5f62\u4e3a \\(f(\\mathbf{P})=f(\\bar{\\mathbf{P}}) + J(\\mathbf{P}-\\bar{\\mathbf{P}})\\) \u7684\u4eff\u5c04\u6620\u5c04\uff0c\u5176\u4e2d \\(J\\) \u7684\u79e9\u7b49\u4e8e \\(M\\) \u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u4e00\u6620\u5c04\uff0c\u5b83\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \uff0c\u90a3\u4e48 \\(\\hat{\\mathbf{P}}=f^{-1} \\small\\circ (\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1} \\] \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u975e\u7ebf\u6027\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u800c \\(J\\) \u662f\u5b83\u5728\u70b9 \\(\\bar{\\mathbf{P}}\\) \u5904\u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u3002\u5047\u5b9a \\(J\\) \u7684\u79e9\u4e3a \\(M\\) \uff0c\u5219 \\(f\\) \u5728 \\(\\bar{\\mathbf{P}}\\) \u7684\u90bb\u57df\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4\u6620\u5c04 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \uff0c\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u3002\u90a3\u4e48\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\uff0c \\(\\hat{\\mathbf{P}}=f^{-1} \\small \\circ \\eta(\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\((J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002 \u8d85\u53c2\u6570\u5316 \u00b6 \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u8d85\u53c2\u6570\u5316\u60c5\u5f62\u3002\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u5b83\u628a\u4e00\u7ec4\u53c2\u6570 \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230\u6d4b\u91cf\u77e2\u91cf \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(S_\\mathbf{p}\\) \u662f\u5d4c\u5165 \\(IR^M\\) \u4e2d\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684 d \u7ef4\u5149\u6ed1\u6d41\u5f62\u5e76\u4f7f\u5f97\u6620\u5c04 \\(f\\) \u5728\u6d41\u5f62 \\(S_\\mathbf{p}\\) \u4e0a \\(\\bar{\\mathbf{P}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\uff0c \\(f\\) \u628a \\(S_\\mathbf{p}\\) \u5c40\u57df\u5730\u6620\u5c04\u5230 \\(IR^N\\) \u4e0a\u5230\u6d41\u5f62 \\(f(S_\\mathbf{p})\\) \u3002\u51fd\u6570 \\(f\\) \u6709\u4e00\u4e2a\u5c40\u90e8\u9006\u51fd\u6570\uff0c\u8bb0\u4e3a \\(f^{-1}\\) \uff0c\u5b83\u9650\u5236\u5728\u66f2\u9762 \\(f(S_\\mathbf{p})\\) \u4e0a \\(\\bar{\\mathbf{X}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\uff0c\u5b9a\u4e49 \\(IR^N\\) \u4e0a\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}\\) \u548c\u534f\u65b9\u5dee \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\uff0c\u5e76\u4ee4 \\(\\eta: IR^N \\to f(S_\\mathbf{p})\\) \u628a \\(IR^N\\) \u4e0a\u7684\u70b9\u6620\u5c04\u5230 \\(f(S_\\mathbf{p})\\) \u4e0a\u5e76\u5728 Mahalanobis \u8303\u6570 \\(\\parallel \\cdot \\parallel_{\\sum_{\\mathbf{x}}}\\) \u610f\u4e49\u4e0b\u6700\u8fd1\u7684\u70b9\uff0c \\(IR^N\\) \u4e0a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_\\mathbf{x}\\) \u7684\u6982\u7387\u5206\u5e03\u901a\u8fc7 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc \\(IR^M\\) \u4e0a\u7684\u6982\u7387\u5206\u5e03\uff0c\u5b83\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_\\mathbf{p}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{+A}=A(A^\\top J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J A)^{-1}A^\\top \\] \u5176\u4e2d \\(A\\) \u662f\u4efb\u610f \\(m \\times d\\) \u77e9\u9635\uff0c\u5b83\u7684\u5217\u77e2\u91cf\u751f\u6210 \\(S_\\mathbf{p}\\) \u7684\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684\u5207\u7a7a\u95f4\u3002 \u4ee4\u53ef\u5fae\u6620\u5c04 \\(f:IR^M \\to IR^N\\) \uff0c\u628a \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230 \\(\\bar{\\mathbf{X}}\\) \uff0c\u5e76\u4ee4 \\(J\\) \u4e3a \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\uff0c\u8bbe \\(IR^N\\) \u4e0a\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\u5b9a\u4e49\u5728 \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u628a\u4e00\u4e2a\u6d4b\u91cf \\(\\mathbf{X}\\) \u6620\u5230\u7ea6\u675f\u5728\u5c40\u90e8\u6b63\u4ea4\u4e8e \\(J\\) \u7684\u96f6\u7a7a\u95f4\u7684\u66f2\u9762 \\(S_\\mathbf{p}\\) \u4e0a\u7684 MLE \u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u7684\u6620\u5c04\uff0c\u90a3\u4e48 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc\u5728 \\(IR^M\\) \u4e0a\u7684\u4e00\u4e2a\u5206\u5e03\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u662f\uff1a \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{*} \\] \u534f\u65b9\u5dee\u4f30\u8ba1\u7684\u8499\u7279\u5361\u6d1b\u6cd5 \u00b6 \u4e4b\u524d\u8ba8\u8bba\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u65b9\u6cd5\u90fd\u5efa\u7acb\u5728\u7ebf\u6027\u5047\u5b9a\u4e4b\u4e0a\u3002 \u5982\u679c\u4e0d\u77e5\u9053 H \u7684\u771f\u503c\u65f6\uff0c\u4f30\u8ba1\u53d8\u6362 H \u7684\u534f\u65b9\u5dee\u7684\u89e3\u6790\u6cd5\u548c\u8499\u7279\u5361\u6d1b\u6cd5\u90fd\u53ef\u4ee5\u7528\u4e8e\u5b9e\u9645\u6570\u636e\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u3002","title":"\u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790"},{"location":"cv/mvg/eval/#_1","text":"\u7ea6 1571 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u8bc4\u4ef7\u548c\u91cf\u5316\u4f30\u8ba1\u7b97\u6cd5\u7684\u7ed3\u679c\u3002 \u901a\u5e38\u4ec5\u6709\u4e00\u4e2a\u53d8\u91cf\u6216\u53d8\u6362\u7684\u4f30\u8ba1\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u7f6e\u4fe1\u5ea6\u6216\u4e0d\u53ef\u9760\u6027\u5ea6\u7684\u6d4b\u91cf \u7ebf\u6027\u903c\u8fd1\u6cd5 \u8499\u7279\u5361\u6d1b\u6cd5","title":"\u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790"},{"location":"cv/mvg/eval/#_2","text":"\u8bb0\u53f7\u7684\u89c4\u5b9a \u6d4b\u91cf\u5f97\u5230\u7684\u91cf\uff0c\u5982 \\(\\mathbf{x}\\) \u8868\u793a\u56fe\u50cf\u70b9 \u88ab\u4f30\u8ba1\u7684\u91cf\u7528\u52a0\u5e3d\u5b50\u6765\u6807\u8bc6\uff0c\u5982 \\(\\hat{\\mathbf{x}}\\) \u6216 \\(\\hat{H}\\) \u91cf\u7684\u771f\u503c\u7528\u52a0\u6a2a\u6760\u8868\u793a\uff0c\u5982 \\(\\bar{\\mathbf{x}}\\) \u6216 \\(\\bar{H}\\)","title":"\u6027\u80fd\u7684\u754c\u5b9a"},{"location":"cv/mvg/eval/#_3","text":"2D \u5355\u5e94\u7684\u4f30\u8ba1\u95ee\u9898\u5728\u4ec5\u7ed9\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u5750\u6807\u52a0\u566a\u58f0\u7684\u60c5\u5f62\u4e0b\uff0c\u8bbe\u6709 n \u7ec4\u8fd9\u6837\u7684\u5339\u914d\u70b9\uff0c RMS\uff08\u5747\u65b9\u6839\uff09\u6b8b\u5dee\uff1a \\[ \\varepsilon_{res}=(\\frac{1}{2n}\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\]","title":"\u5355\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/eval/#_4","text":"\u5bf9\u53cc\u56fe\u50cf\u8bef\u5dee\u60c5\u5f62\uff0c\u6b8b\u5dee\u662f \\[ \\varepsilon_{res}=\\frac{1}{\\sqrt{4n}}(\\sum_{i=1}^nd(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2+\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\]","title":"\u53cc\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/eval/#mle","text":"\\(IR^N\\) \u4e0a\u603b\u65b9\u5dee\u4e3a \\(N\\delta^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03\u5411\u4e00\u4e2a \\(s\\) \u7ef4\u5b50\u7a7a\u95f4\u7684\u6295\u5f71\u662f\u603b\u65b9\u5dee\u4e3a \\(s\\sigma^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03 \u8003\u8651\u4e00\u4e2a\u4f30\u8ba1\u95ee\u9898\uff0c\u5176\u4e2d \\(N\\) \u4e2a\u6d4b\u91cf\u7531\u4f9d\u8d56\u4e8e \\(d\\) \u4e2a\u672c\u8d28\u53c2\u6570\u96c6\u7684\u51fd\u6570\u6a21\u578b\u5316\u3002\u5047\u5b9a\u6bcf\u4e2a\u6d4b\u91cf\u53d8\u91cf\u6709\u6807\u51c6\u5dee \\(\\delta\\) \u7684\u72ec\u7acb\u9ad8\u65af\u566a\u58f0\u3002 ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u6b8b\u5dee\uff08\u6d4b\u91cf\u503c\u5230\u4f30\u8ba1\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{res}=E [\\parallel \\hat{\\mathbf{X}} - \\mathbf{X} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(1-d/N)^{1/2} \\] ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u4f30\u8ba1\u8bef\u5dee\uff08\u4f30\u8ba1\u503c\u5230\u771f\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{est}=E [\\parallel \\hat{\\mathbf{X}} - \\bar{\\mathbf{X}} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(d/N)^{1/2} \\]","title":"\u6700\u4f18\u4f30\u8ba1\u7b97\u6cd5\uff08MLE\uff09"},{"location":"cv/mvg/eval/#_5","text":"\u6c42\u5f97\u7684\u53d8\u6362\u7684\u4e0d\u53ef\u9760\u6027\u901a\u5e38\u7531\u53d8\u6362\u7684 \u534f\u65b9\u5dee\u77e9\u9635 \u83b7\u53d6\uff0c\u56e0\u4e3a \\(H\\) \u662f 9 \u5143\u7d20\u7684\u77e9\u9635\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f\u4e00\u4e2a \\(9\\times 9\\) \u77e9\u9635\u3002","title":"\u53d8\u6362\u4f30\u8ba1\u7684\u534f\u65b9\u5dee"},{"location":"cv/mvg/eval/#_6","text":"\u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{v}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u6620\u5c04\uff1a\u5b9a\u4e49\u4e3a \\(f(\\mathbf{v})=f(\\bar{\\mathbf{v}})+A(\\mathbf{v}-\\bar{\\mathbf{v}})\\) \u3002\u90a3\u4e48 \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(A\\sum A^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\u3002 \u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{v}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u90bb\u57df\u53ef\u5fae\uff0c\u90a3\u4e48\u5728\u7cbe\u786e\u5230\u4e00\u9636\u8fd1\u4f3c\u7684\u7a0b\u5ea6\u4e0b\uff0c \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(J\\sum J^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u4e2d \\(J\\) \u662f \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u503c\u3002","title":"\u534f\u65b9\u5dee\u7684\u524d\u5411\u4f20\u64ad"},{"location":"cv/mvg/eval/#_7","text":"\u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u4eff\u5c04\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u5f62\u4e3a \\(f(\\mathbf{P})=f(\\bar{\\mathbf{P}}) + J(\\mathbf{P}-\\bar{\\mathbf{P}})\\) \u7684\u4eff\u5c04\u6620\u5c04\uff0c\u5176\u4e2d \\(J\\) \u7684\u79e9\u7b49\u4e8e \\(M\\) \u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u4e00\u6620\u5c04\uff0c\u5b83\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \uff0c\u90a3\u4e48 \\(\\hat{\\mathbf{P}}=f^{-1} \\small\\circ (\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1} \\] \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u975e\u7ebf\u6027\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u800c \\(J\\) \u662f\u5b83\u5728\u70b9 \\(\\bar{\\mathbf{P}}\\) \u5904\u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u3002\u5047\u5b9a \\(J\\) \u7684\u79e9\u4e3a \\(M\\) \uff0c\u5219 \\(f\\) \u5728 \\(\\bar{\\mathbf{P}}\\) \u7684\u90bb\u57df\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4\u6620\u5c04 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \uff0c\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u3002\u90a3\u4e48\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\uff0c \\(\\hat{\\mathbf{P}}=f^{-1} \\small \\circ \\eta(\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\((J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002","title":"\u534f\u65b9\u5dee\u7684\u53cd\u5411\u4f20\u64ad"},{"location":"cv/mvg/eval/#_8","text":"\u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u8d85\u53c2\u6570\u5316\u60c5\u5f62\u3002\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u5b83\u628a\u4e00\u7ec4\u53c2\u6570 \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230\u6d4b\u91cf\u77e2\u91cf \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(S_\\mathbf{p}\\) \u662f\u5d4c\u5165 \\(IR^M\\) \u4e2d\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684 d \u7ef4\u5149\u6ed1\u6d41\u5f62\u5e76\u4f7f\u5f97\u6620\u5c04 \\(f\\) \u5728\u6d41\u5f62 \\(S_\\mathbf{p}\\) \u4e0a \\(\\bar{\\mathbf{P}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\uff0c \\(f\\) \u628a \\(S_\\mathbf{p}\\) \u5c40\u57df\u5730\u6620\u5c04\u5230 \\(IR^N\\) \u4e0a\u5230\u6d41\u5f62 \\(f(S_\\mathbf{p})\\) \u3002\u51fd\u6570 \\(f\\) \u6709\u4e00\u4e2a\u5c40\u90e8\u9006\u51fd\u6570\uff0c\u8bb0\u4e3a \\(f^{-1}\\) \uff0c\u5b83\u9650\u5236\u5728\u66f2\u9762 \\(f(S_\\mathbf{p})\\) \u4e0a \\(\\bar{\\mathbf{X}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\uff0c\u5b9a\u4e49 \\(IR^N\\) \u4e0a\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}\\) \u548c\u534f\u65b9\u5dee \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\uff0c\u5e76\u4ee4 \\(\\eta: IR^N \\to f(S_\\mathbf{p})\\) \u628a \\(IR^N\\) \u4e0a\u7684\u70b9\u6620\u5c04\u5230 \\(f(S_\\mathbf{p})\\) \u4e0a\u5e76\u5728 Mahalanobis \u8303\u6570 \\(\\parallel \\cdot \\parallel_{\\sum_{\\mathbf{x}}}\\) \u610f\u4e49\u4e0b\u6700\u8fd1\u7684\u70b9\uff0c \\(IR^N\\) \u4e0a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_\\mathbf{x}\\) \u7684\u6982\u7387\u5206\u5e03\u901a\u8fc7 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc \\(IR^M\\) \u4e0a\u7684\u6982\u7387\u5206\u5e03\uff0c\u5b83\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_\\mathbf{p}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{+A}=A(A^\\top J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J A)^{-1}A^\\top \\] \u5176\u4e2d \\(A\\) \u662f\u4efb\u610f \\(m \\times d\\) \u77e9\u9635\uff0c\u5b83\u7684\u5217\u77e2\u91cf\u751f\u6210 \\(S_\\mathbf{p}\\) \u7684\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684\u5207\u7a7a\u95f4\u3002 \u4ee4\u53ef\u5fae\u6620\u5c04 \\(f:IR^M \\to IR^N\\) \uff0c\u628a \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230 \\(\\bar{\\mathbf{X}}\\) \uff0c\u5e76\u4ee4 \\(J\\) \u4e3a \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\uff0c\u8bbe \\(IR^N\\) \u4e0a\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\u5b9a\u4e49\u5728 \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u628a\u4e00\u4e2a\u6d4b\u91cf \\(\\mathbf{X}\\) \u6620\u5230\u7ea6\u675f\u5728\u5c40\u90e8\u6b63\u4ea4\u4e8e \\(J\\) \u7684\u96f6\u7a7a\u95f4\u7684\u66f2\u9762 \\(S_\\mathbf{p}\\) \u4e0a\u7684 MLE \u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u7684\u6620\u5c04\uff0c\u90a3\u4e48 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc\u5728 \\(IR^M\\) \u4e0a\u7684\u4e00\u4e2a\u5206\u5e03\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u662f\uff1a \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{*} \\]","title":"\u8d85\u53c2\u6570\u5316"},{"location":"cv/mvg/eval/#_9","text":"\u4e4b\u524d\u8ba8\u8bba\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u65b9\u6cd5\u90fd\u5efa\u7acb\u5728\u7ebf\u6027\u5047\u5b9a\u4e4b\u4e0a\u3002 \u5982\u679c\u4e0d\u77e5\u9053 H \u7684\u771f\u503c\u65f6\uff0c\u4f30\u8ba1\u53d8\u6362 H \u7684\u534f\u65b9\u5dee\u7684\u89e3\u6790\u6cd5\u548c\u8499\u7279\u5361\u6d1b\u6cd5\u90fd\u53ef\u4ee5\u7528\u4e8e\u5b9e\u9645\u6570\u636e\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u3002","title":"\u534f\u65b9\u5dee\u4f30\u8ba1\u7684\u8499\u7279\u5361\u6d1b\u6cd5"},{"location":"cv/mvg/one-vg/","text":"\u5355\u89c6\u56fe\u51e0\u4f55 \u00b6 \u7ea6 3225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5728\u900f\u89c6\u6295\u5f71\u4e0b\u5176\u4ed6\u7684 3D \u51e0\u4f55\u5b9e\u4f53\u4e0e\u5176 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u8fd9\u4e9b\u5b9e\u4f53\u5305\u62ec\u5e73\u9762\u3001\u76f4\u7ebf\u3001\u4e8c\u6b21\u66f2\u7ebf\u3001\u4e8c\u6b21\u66f2\u9762\uff0c\u5c06\u63a8\u5bfc\u5b83\u4eec\u7684\u6b63\u5411\u548c\u53cd\u5411\u6295\u5f71\u7684\u6027\u8d28 \u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528 \u00b6 \u5bf9\u5e73\u9762\u7684\u4f5c\u7528 \u00b6 \u5047\u5b9a\u9009\u62e9 XY - \u5e73\u9762\u4e0e\u666f\u7269\u4e2d\u7684\u5e73\u9762 \\(\\pi\\) \u5bf9\u5e94\uff0c\u4f7f\u5f97\u5e73\u9762\u4e0a\u7684\u70b9 \\(Z\\) \u5750\u6807\u4e3a\u96f6\u3002 \\(\\mathbf{x}=P\\mathbf{X}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\ \\mathbf{p}_3 \\ \\mathbf{p}_4] \\begin{bmatrix} X \\\\ Y \\\\ 0 \\\\ 1 \\end{bmatrix}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\mathbf{p}_4]\\begin{bmatrix} X \\\\ Y \\\\ 1 \\end{bmatrix}\\) \u5373 \\(\\mathbf{x}=H\\mathbf{x}_\\pi\\) \u3002\u5728\u900f\u89c6\u5f71\u50cf\u4e0b\uff0c\u4e00\u5f20\u666f\u7269\u5e73\u9762\u4e0e\u4e00\u5f20\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u6700\u4e00\u822c\u7684\u53d8\u6362\u662f\u5e73\u9762\u5c04\u5f71\u53d8\u6362 \u5bf9\u76f4\u7ebf\u7684\u4f5c\u7528 \u00b6 \u6b63\u5411\u6295\u5f71 \uff1a \\(\\mathbf{A}\\) \u548c \\(\\mathbf{B}\\) \u662f 3 \u7ef4\u7a7a\u95f4\u7684\u70b9\uff0c\u800c \\(\\mathbf{a},\\mathbf{b}\\) \u662f\u5b83\u4eec\u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u56fe\u50cf\uff1a \\(\\mathbf{x}(\\mu)=P(\\mathbf{A}+\\mu \\mathbf{B})=P\\mathbf{A}+\\mu P \\mathbf{B}=\\mathbf{a} + \\mu \\mathbf{b}\\) \u76f4\u7ebf\u7684\u53cd\u5411\u6295\u5f71 \uff1a\u7ecf\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u6620\u5c04\u6210\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}\\) \u7684\u7a7a\u95f4\u7684\u70b9\u96c6\u662f\u5e73\u9762 \\(P^\\top\\mathbf{l}\\) Pl\u00fccker \u76f4\u7ebf\u8868\u793a \u4e00\u6761\u7528 Pl\u00fccker \u77e9\u9635 \\(L\\) \u8868\u793a\u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\uff0c\u5728\u6444\u50cf\u673a\u6620\u5c04 \\(P\\) \u4f5c\u7528\u4e0b\u88ab\u6620\u5c04\u6210\u6ee1\u8db3 \\([\\mathbf{l}]_\\times=PLP^\\top\\) \u7684\u76f4\u7ebf \u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u662f\u79e9\u4e3a 3 \u7684 \\(3 \\times 6\\) \u77e9\u9635\uff0c\u5373 \\(P=\\begin{bmatrix} \\mathbf{P}^2 \\wedge \\mathbf{P}^3 \\\\ \\mathbf{P}^3 \\wedge \\mathbf{P}^1 \\\\ \\mathbf{P}^1 \\wedge \\mathbf{P}^2 \\end{bmatrix}\\) \uff0c\u5176\u4e2d \\(\\mathbf{P}^{i\\top}\\) \u662f\u70b9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u884c\uff0c\u800c \\(\\mathbf{P}^i \\wedge \\mathbf{P}^j\\) \u662f\u5e73\u9762 \\(\\mathbf{P}^i\\) \u4e0e \\(\\mathbf{P}^j\\) \u7684\u4ea4\u7ebf\u7684 Pl\u00fccker \u5750\u6807 \u5728\u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u4f5c\u7528\u4e0b\uff0c \\(IP^3\\) \u4e2d\u7528 Pl\u00fccker \u5750\u6807\u8868\u793a\u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u88ab\u6620\u5c04\u5bfc\u56fe\u50cf\u76f4\u7ebf\uff1a \\(\\mathbf{l}=P\\mathcal{L}=\\begin{bmatrix} (\\mathbf{P}^2 \\wedge \\mathbf{P}^3 | \\mathcal{L}) \\\\ (\\mathbf{P}^3 \\wedge \\mathbf{P}^1 | \\mathcal{L}) \\\\ (\\mathbf{P}^1 \\wedge \\mathbf{P}^2 | \\mathcal{L}) \\end{bmatrix}\\) \\(IP^3\\) \u4e2d\u6ee1\u8db3 \\(P\\mathcal{L}=\\mathbf{0}\\) \u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u5fc5\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3 \u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528 \u00b6 \u5728\u6444\u50cf\u673a \\(P\\) \u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53cd\u5411\u6295\u5f71\u6210\u9525\u9762: \\(Q_{CO}=P^\\top CP\\) \u5149\u6ed1\u66f2\u9762\u7684\u56fe\u50cf \u00b6 \u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u5b9a\u4e49\u4e3a\u5f71\u50cf\u5c04\u7ebf\u4e0e \\(S\\) \u7684\u6240\u6709\u5207\u70b9 \\(\\mathbf{X}\\) \u7684\u96c6\u5408\u3002\u5728\u56fe\u50cf\u4e0a\uff0c\u4e0e\u5b83\u5bf9\u5e94\u7684 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u662f \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u96c6\u5408\uff0c\u5373 \\(\\gamma\\) \u662f \\(\\Gamma\\) \u7684\u56fe\u50cf \u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u4ec5\u53d6\u51b3\u4e8e\u6444\u50cf\u673a\u4e2d\u5fc3\u4e0e\u66f2\u9762\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u800c\u4e0e\u56fe\u50cf\u5e73\u9762\u65e0\u5173 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u7531\u56fe\u50cf\u5e73\u9762\u4e0e\u8f6e\u5ed3\u751f\u6210\u5143\u7684\u5c04\u7ebf\u7684\u76f8\u4ea4\u786e\u5b9a\uff0c\u56e0\u6b64\u4e0e\u56fe\u50cf\u5e73\u9762\u6709\u5173 \u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u4e8c\u6b21\u66f2\u9762\u7684\u4f5c\u7528 \u00b6 \u4e8c\u6b21\u66f2\u9762\u7684\u6b63\u5411\u6295\u5f71 \u5728\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u5916\u5f62\u7ebf\u662f\u4e0b\u5f0f\u7ed9\u5b9a\u7684\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(C^*=PQ^*P^\\top\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u548c\u4e2d\u5fc3\u4e3a \\(C\\) \u7684\u6444\u50cf\u673a\u76f8\u5bf9\u5e94\u7684\u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u7684\u5e73\u9762\u662f \\(\\pi_\\Gamma=QC\\) \u9876\u70b9\u4e3a \\(\\mathbf{V}\\) \u5e76\u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u76f8\u5207\u7684\u9525\u9762\u662f\u4e00\u4e2a\u9000\u5316\u7684\u4e8c\u6b21\u66f2\u9762 \\(Q_{CO}=(\\mathbf{V}^\\top Q\\mathbf{V})Q-(Q\\mathbf{V})(Q\\mathbf{V})^\\top\\) \uff0c\u5f53 \\(Q_{CQ}\\mathbf{V}=\\mathbf{0}\\) \u65f6\uff0c \\(\\mathbf{V}\\) \u6b63\u662f\u6240\u8981\u6c42\u7684\u9525\u9762\u7684\u9876\u70b9 \u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u91cd\u8981\u6027 \u00b6 3 \u7ef4\u7a7a\u95f4\u7684\u7269\u4f53\u548c\u6444\u50cf\u673a\u4e2d\u5fc3\u786e\u5b9a\u4e86\u4e00\u4e2a\u5c04\u7ebf\u96c6\u5408\uff0c\u800c\u8fd9\u4e9b\u5c04\u7ebf\u4e0e\u4e00\u5f20\u5e73\u9762\u7684\u4ea4\u5c31\u4ea7\u751f\u8be5\u7269\u4f53\u7684\u56fe\u50cf\uff0c\u8fd9\u4e2a\u96c6\u5408\u901a\u5e38\u79f0\u4e3a \u5c04\u7ebf\u9525 \u5047\u8bbe\u5c04\u7ebf\u9525\u4e0e\u4e24\u5f20\u5e73\u9762\u76f8\u4ea4\uff0c\u90a3\u4e48\u6240\u5f97\u4e24\u5e45\u56fe\u50cf \\(\\mathbf{I}\\) \u548c \\(\\mathbf{I}^\\prime\\) \u663e\u7136\u4ee5\u4e00\u4e2a\u900f\u89c6\u6620\u5c04\u76f8\u5173\u8054\u3002\u56e0\u4e3a\u6444\u50cf\u673a\u6709\u5171\u540c\u7684\u4e2d\u5fc3\uff0c\u4ece\u800c\u7531\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4ea7\u751f\u7684 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a \\(\\mathbf{x}^\\prime=P^\\prime \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1}P \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1} \\mathbf{x}\\) \uff0c\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\u4ee5\u4e00\u4e2a\u5f62\u5982 \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \u7684\u5e73\u9762\u5355\u5e94( \\(3 \\times 3\\) \u77e9\u9635)\u76f8\u5173\u8054\uff0c\u5176\u4e2d \\(H=(K^\\prime R^\\prime)(KR)^{-1}\\) \u79fb\u52a8\u56fe\u50cf\u5e73\u9762 \u00b6 \u8003\u8651\u7126\u8ddd\u589e\u52a0\u7684\u60c5\u51b5\uff0c\u5728\u4e00\u9636\u8fd1\u4f3c\u7684\u7cbe\u5ea6\u4e0b\uff0c\u5b83\u76f8\u5f53\u4e8e\u56fe\u50cf\u5e73\u9762\u6cbf\u4e3b\u8f74\u79fb\u52a8 \u56e0\u5b50 \\(k=f^\\prime/f\\) \u7684\u53d8\u7126\u6548\u679c\u7b49\u4e8e\u7528 \\(diag(k,k,1)\\) \u53f3\u4e58\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u6444\u50cf\u673a\u65cb\u8f6c \u00b6 \u6444\u50cf\u673a\u5728\u4e0d\u6539\u53d8\u5b83\u7684\u5185\u90e8\u53c2\u6570\u7684\u60c5\u51b5\u4e0b\u7ed5\u5b83\u7684\u4e2d\u5fc3\u65cb\u8f6c\u3002\u5982\u679c\u70b9 \\(\\mathbf{X}\\) \u5728\u7eaf\u65cb\u8f6c\u524d\u548c\u540e\u7684\u56fe\u50cf\u662f \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \uff0c\u90a3\u4e48 \\(\\mathbf{x}^\\prime=K[R|\\mathbf{0}]\\mathbf{X}=KRK^{-1}K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}=KRK^{-1}\\mathbf{x}\\) \uff0c\u56e0\u6b64\uff0c \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \uff0c\u5176\u4e2d \\(H=KRK^{-1}\\) \u8fd9\u79cd\u5355\u5e94\u662f\u4e00\u4e2a\u5171\u8f6d\u65cb\u8f6c \u5e94\u7528\u4e0e\u4e3e\u4f8b \u00b6 \u89c6\u56fe\u5408\u6210 \u00b6 \u53ef\u4ee5\u5bf9\u73b0\u6709\u7684\u56fe\u50cf\u8fdb\u884c\u5e73\u9762\u5355\u5e94\u6027\u7684\u5f62\u53d8\u63d2\u8865\u6765\u4ea7\u751f\u65b0\u7684\u56fe\u50cf\uff0c\u65b0\u7684\u56fe\u50cf\u5bf9\u5e94\u4e8e\u4e0d\u540c\u7684\u6444\u50cf\u673a\u5b9a\u5411(\u4f46\u6444\u50cf\u673a\u4e2d\u5fc3\u76f8\u540c) \u8ba1\u7b97\u628a\u56fe\u50cf\u4e2d\u7684\u56db\u8fb9\u5f62\u6620\u5c04\u56de\u5177\u6709\u6b63\u786e\u957f\u5bbd\u6bd4\u77e9\u5f62\u7684\u5355\u5e94 H \u7528\u8fd9\u4e2a\u5355\u5e94\u5bf9\u539f\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865 \u5e73\u9762\u5168\u666f\u62fc\u56fe \u00b6 \u6444\u50cf\u673a\u7ed5\u5176\u4e2d\u5fc3\u65cb\u8f6c\u6240\u5f97\u5230\u7684\u4e00\u7ec4\u56fe\u50cf\u4e4b\u95f4\u4ee5\u4e00\u4e2a\u5e73\u9762\u5355\u5e94\u76f8\u5173\u8054\u3002\u8fd9\u6837\u7684\u4e00\u7ec4\u56fe\u50cf\u53ef\u4ee5\u901a\u8fc7\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\u4e0e\u5176\u4e2d\u4e00\u5e45\u56fe\u50cf\u7684\u5e73\u9762\u914d\u51c6\u3002 \u9009\u62e9\u56fe\u50cf\u96c6\u5408\u4e2d\u7684\u4e00\u5e45\u4f5c\u4e3a\u53c2\u8003\u56fe\u50cf \u5728\u5176\u4f59\u7684\u56fe\u50cf\u4e2d\u9009\u4e00\u5e45\u56fe\u50cf\uff0c\u8ba1\u7b97\u628a\u5b83\u6620\u5c04\u5230\u53c2\u8003\u56fe\u50cf\u7684\u5355\u5e94 H \u7528\u5f97\u5230\u7684\u5355\u5e94\u5bf9\u8fd9\u5e45\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\uff0c\u5e76\u4e14\u7528\u63d2\u8865\u56fe\u50cf\u4e0e\u53c2\u8003\u56fe\u50cf\u7684\u975e\u91cd\u53e0\u90e8\u5206\u6765\u6269\u5927\u53c2\u8003\u56fe\u50cf \u5bf9\u56fe\u50cf\u96c6\u5408\u4e2d\u4f59\u4e0b\u7684\u56fe\u50cf\u91cd\u590d\u4e0a\u8ff0\u6700\u540e\u4e24\u6b65\u8fc7\u7a0b \uff08\u7b80\u5316\u7684\uff09\u5c04\u5f71\u8bb0\u53f7 \u00b6 \u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u90fd\u9009\u62e9\u89c4\u8303\u7684\u5c04\u5f71\u5750\u6807\u90a3\u4e48\u6444\u50cf\u673a\u77e9\u9635\uff1a \\(P=\\begin{bmatrix} a & 0 & 0 & -d \\\\ 0 & b & 0 & -d \\\\ 0 & 0 & c & -d \\end{bmatrix}\\) \u6ee1\u8db3 \\(\\mathbf{x}_i=P\\mathbf{X}_i,i=1,...,4\\) \u548c \\(P(a^{-1},b^{-1},c^{-1},d^{-1})^\\top=\\mathbf{0}\\) \uff0c\u540e\u8005\u8868\u793a\u6444\u50cf\u673a\u4e2d\u5fc3\u662f \\(\\mathbf{C}=(a^{-1},b^{-1},c^{-1},d^{-1})^\\top\\) \u79fb\u52a8\u6444\u50cf\u673a\u4e2d\u5fc3 \u00b6 \u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u91cd\u5408\u7684\u4e24\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9.\u90ce\u5728\u540c\u4e00\u5c04\u7ebf\u4e0a\u7684\u70b9\u3002\u5982\u679c\u6444\u50cf\u673a\u4e2d\u5fc3\u88ab\u79fb\u52a8\u4e86(\u6ca1\u6709\u6cbf\u7740\u8fd9\u6761\u5c04\u7ebf) \uff0c\u90a3\u4e48\u5176\u56fe\u50cf\u5c31\u4e0d\u518d\u91cd\u5408\u4e86\u3002\u539f\u6765\u662f\u91cd\u5408\u7684\u56fe\u50cf\u70b9\u4e4b\u95f4\u7684\u76f8\u5bf9\u4f4d\u79fb\u79f0\u4e3a\u89c6\u5dee\u3002 \u6444\u50cf\u673a\u6807\u5b9a\u4e0e\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf \u00b6 \u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u662f \\(\\mathbf{x}\\) \u4e0e\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\u6d4b\u91cf\u7684\u5c04\u7ebf\u65b9\u5411 \\(\\mathbf{d}=K^{-1}\\mathbf{x}\\) \u4e4b\u95f4\u7684\u4e00\u4e2a\uff08\u4eff\u5c04\uff09\u53d8\u6362 \u4e00\u6761\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u786e\u5b9a\u4e00\u5f20\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u8be5\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}=K^\\top \\mathbf{l}\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf \u00b6 \\(\\pi_\\infty\\) \u4e0e\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u7684\u6620\u5c04\u7531\u5e73\u9762\u5355\u5e94 \\(\\mathbf{x}=H\\mathbf{d}\\) \u7ed9\u51fa\uff0c\u5176\u4e2d \\(H=KR\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08\u7b80\u79f0 IAC\uff09\u662f\u4e8c\u6b21\u66f2\u7ebf \\(\\omega=(KK^\\top)^{-1}=K^{-\\top}K^{-1}\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5076\u56fe\u50cf\uff08\u7b80\u79f0 DIAC\uff09\u4e3a \\(\\omega^*=\\omega^{-1}=KK^\\top\\) \u4e00\u4e2a\u7b80\u5355\u7684\u6807\u5b9a\u88c5\u7f6e \u88c5\u7f6e\u91cc\u6709\u4e09\u4e2a\u6b63\u65b9\u5f62\uff08\u5b83\u4eec\u6240\u5728\u5e73\u9762\u662f\u4e0d\u5e73\u884c\u7684\uff0c\u4f46\u4e5f\u4e0d\u5fc5\u6b63\u4ea4\uff09\u7684\u56fe\u50cf\u63d0\u4f9b\u8ba1\u7b97 \\(K\\) \u7684\u8db3\u591f\u7ea6\u675f \u5bf9\u6bcf\u4e2a\u6b63\u65b9\u5f62\uff0c\u8ba1\u7b97\u628a\u5b83\u7684\u89d2\u70b9 \\((0,0)^\\top\u3001(1,0)\u3001(0,1)\u3001(1,1)^\\top\\) \u6620\u5c04\u5230\u76f8\u5e94\u7684\u56fe\u50cf\u70b9\u7684\u5355\u5e94 \\(H\\) \u8ba1\u7b97\u8be5\u6b63\u65b9\u5f62\u6240\u5728\u5e73\u9762\u865a\u5706\u70b9\u7684\u56fe\u50cf\uff0c\u5373 \\(H(1,\\pm i,0)^\\top\\) \u7531\u8fd9\u516d\u4e2a\u865a\u5706\u70b9\u7684\u56fe\u50cf\u62df\u5408\u51fa\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(\\omega\\) \u7528 Cholesky \u5206\u89e3\u7531 \\(\\omega=(KK^\\top)^{-1}\\) \u8ba1\u7b97\u6807\u5b9a \\(K\\) \u56fe\u50cf\u4e2d\u7684\u6b63\u4ea4\u6027 \u5982\u679c\u56fe\u50cf\u70b9\u5173\u4e8e \\(\\omega\\) \u5171\u8f6d\uff0c\u5373\u5982\u679c \\(\\mathbf{x}_1^\\top \\omega \\mathbf{x}_2 = 0\\) \uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5bf9\u5e94\u4e8e\u6b63\u4ea4\u7684\u65b9\u5411 \u5047\u5b9a\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5230\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}\\) \u7684\u5e73\u9762 \\(\\pi\\) \uff0c\u90a3\u4e48\u6cd5\u7ebf\u7684\u5f71\u50cf\u4e3a\u70b9 \\(K\\mathbf{n}\\) \uff0c\u800c\u4e14\u76f4\u7ebf \\(\\mathbf{l}\\) \u662f\u8be5\u70b9\u7684\u6781\u7ebf\uff0c\u56e0\u6b64 \\(\\mathbf{l}=\\omega K \\mathbf{n}=(KK^\\top)^{-1}K\\mathbf{n}=K^{-\\top}\\mathbf{n}\\) \uff0c\u5373 \\(\\pi\\) \u7684\u6cd5\u7ebf\u662f \\(\\mathbf{n}=K^\\top \\mathbf{l}\\) \u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \u00b6 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08IAC\uff09\u662f\u56fe\u50cf\u4e2d\u7684\u4e00\u6761\u865a\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e3a\u4e86\u53ef\u89c6\u5316\u7684\u76ee\u7684\uff0c\u8003\u8651\u4e0e\u6444\u50cf\u673a\u6807\u5b9a\u7d27\u5bc6\u76f8\u5173\u7684\u53e6\u5916\u4e00\u79cd\u66f2\u7ebf\uff0c\u8fd9\u6837\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4e3a \u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff0c\u5b83\u662f\u4e00\u4e2a\u9876\u89d2\u4e3a \\(45^\\circ\\) \u800c\u8f74\u4e3a\u6444\u50cf\u673a\u4e3b\u8f74\u7684\u5706\u9525\u9762\u7684\u56fe\u50cf\u3002\u8be5\u5706\u9525\u9762\u7684\u70b9\u6620\u5c04\u4e3a\u4e8c\u6b21\u66f2\u7ebf\uff1a \\[ C=K^{-\\top} \\begin{bmatrix} 1 & & \\\\ & 1 & \\\\ & & -1 \\end{bmatrix} K^{-\\top} \\] \u6b63\u4ea4\u6027\u548c\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff1a\u5982\u679c\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u5bf9\u5e94\u4e8e\u5782\u76f4\u4e8e\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u5c04\u7ebf\u7684\u4e00\u4e2a\u5e73\u9762\uff0c\u90a3\u4e48\uff0c\u8fd9\u6761\u76f4\u7ebf\u662f \\(\\mathbf{x}\\) \u5173\u4e8e\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf\u7684\u53cd\u5c04\u70b9 \\(\\overset{\\cdot}{\\mathbf{x}}\\) \u7684\u6781\u7ebf \\(C\\overset{\\cdot}{\\mathbf{x}}\\) \u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf \u00b6 \u900f\u89c6\u6295\u5f71\u7684\u4e00\u4e2a\u663e\u8457\u7279\u5f81\u662f\u5ef6\u4f38\u81f3\u65e0\u7a77\u8fdc\u7684\u7269\u4f53\u7684\u56fe\u50cf\u53ef\u80fd\u51fa\u73b0\u5728\u6709\u9650\u8303\u56f4 \u6d88\u5f71\u70b9 \u96c6\u5408\u4e0a\u4e00\u6761\u4e16\u754c\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u7531\u5e73\u884c\u4e8e\u8be5\u76f4\u7ebf\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u5f97\u5230\u3002\u56e0\u6b64\u6d88\u5f71\u70b9\u4ec5\u4f9d\u8d56\u4e8e\u76f4\u7ebf\u7684\u65b9\u5411\uff0c\u800c\u4e0e\u5176\u4f4d\u7f6e\u65e0\u5173\u3002\u5982\u679c\u4e16\u754c\u76f4\u7ebf\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\uff0c\u90a3\u4e48\u6d88\u5f71\u70b9\u5728\u56fe\u50cf\u7684\u65e0\u7a77\u8fdc\u5904\u3002 \u8be5\u4e16\u754c\u76f4\u7ebf\u53ef\u4ee5\u7528 \\(\\mathbf{X}(\\lambda)=\\mathbf{A}+\\lambda\\mathbf{D}\\) \u6765\u53c2\u6570\u5316\uff0c\u5176\u4e2d \\(\\mathbf{A}\\) \u662f\u76f4\u7ebf\u4e0a\u7684\u70b9\uff0c\u800c \\(\\mathbf{D}=(\\mathbf{d}^\\top,0)^\\top\\) \u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u4e14\u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9 \\(\\mathbf{v}\\) \uff0c\u5373 \\(\\mathbf{v}=K\\mathbf{d}\\) \u7531\u6d88\u5f71\u70b9\u6c42\u6444\u50cf\u673a\u65cb\u8f6c \u6d88\u5f71\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u7684\u56fe\u50cf\uff0c\u5b83\u63d0\u4f9b\u5b9a\u5411(\u59ff\u6001)\u4fe1\u606f\u7684\u65b9\u5f0f\u4e0e\u4e0d\u52a8\u661f\u63d0\u4f9b\u7684\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u8003\u8651\u7531\u5b9a\u5411\u548c\u4f4d\u7f6e\u4e0d\u540c\u7684\u4e24\u4e2a\u6807\u5b9a\u6444\u50cf\u673a\u83b7\u53d6\u7684\u4e00\u4e2a\u666f\u7269\u7684\u4e24\u5e45\u56fe\u50cf\u3002\u65e0\u7a77\u8fdc\u70b9\u4f5c\u4e3a\u666f\u7269\u7684\u4e00\u90e8\u5206\u4e0e\u6444\u50cf\u673a\u65e0\u5173\u3002\u5b83\u4eec\u7684\u56fe\u50cf\uff0c\u5373\u6d88\u5f71\u70b9\uff0c\u4e0d\u53d7\u6444\u50cf\u673a\u4f4d\u7f6e\u53d8\u5316\u7684\u5f71\u54cd\uff0c\u4f46\u8981\u53d7\u6444\u50cf\u673a\u65cb\u8f6c\u7684\u5f71\u54cd\u3002 \u4ee4\u4e00\u6761\u666f\u7269\u76f4\u7ebf\u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u7684\u6d88\u5f71\u70b9\u662f \\(\\mathbf{v}_i\\) \uff0c\u5728\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u662f \\(\\mathbf{v}_i^\\prime\\) \uff0c\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i\\) \u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i=K^{-1}\\mathbf{v}_i / \\parallel K^{-1} \\mathbf{v}_i \\parallel\\) \uff0c\u800c\u5bf9\u5e94\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i^\\prime\\) \uff0c\u5728\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i^\\prime\\) \uff0c\u5219\u6444\u50cf\u673a\u7684\u65cb\u8f6c \\(\\mathbf{d}_i^\\prime=R\\mathbf{d}_i\\) \u6d88\u5f71\u7ebf 3 \u7ef4\u7a7a\u95f4\u7684\u5e73\u884c\u5e73\u9762\u4e0e \\(\\pi _\\infty\\) \u4ea4\u4e8e\u4e00\u6761\u516c\u5171\u7684\u76f4\u7ebf\uff0c\u800c\u8fd9\u6761\u76f4\u7ebf\u7684\u56fe\u50cf\u5c31\u662f\u5e73\u9762\u7684\u6d88\u5f71\u7ebf\u3002\u51e0\u4f55\u4e0a\uff0c\u6d88\u5f71\u7ebf\u7531\u5e73\u884c\u4e8e\u666f\u7269\u5e73\u9762\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u5f20\u5e73\u9762\u4e0e\u56fe\u50cf\u7684\u4ea4\u7ebf\u5f97\u5230\u3002\u663e\u7136\uff0c \u6d88\u5f71\u7ebf\u4ec5\u4e0e\u666f\u7269\u5e73\u9762\u7684\u5b9a\u5411\u6709\u5173\uff0c\u800c\u4e0e\u5b83\u7684\u4f4d\u7f6e\u65e0\u5173\u3002 \u5728\u6444\u50cf\u673a\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u5782\u76f4\u4e8e\u65b9\u5411 \\(\\mathbf{n}\\) \u7684\u5e73\u9762\u96c6\u7684\u6d88\u5f71\u7ebf\u662f \\(\\mathbf{l}=K^{-\\top}\\mathbf{n}\\) \u4e24\u6761\u666f\u7269\u76f4\u7ebf\u4e4b\u95f4\u7684\u5939\u89d2 \uff1a\u4ee4 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u662f\u4e00\u5e45\u56fe\u50cf\u4e2d\u4e24\u6761\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4ee4 \\(\\omega\\) \u4e3a\u56fe\u50cf\u4e2d\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\u3002\u5982\u679c \\(\\theta\\) \u662f\u4e24\u76f4\u7ebf\u65b9\u5411\u95f4\u7684\u5939\u89d2\uff0c\u5219 \\[ \\cos \\theta = \\frac{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2}{\\sqrt{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_1} \\sqrt{\\mathbf{v}_2^\\top \\omega \\mathbf{v}_2}} \\] \u6b63\u4ea4\u6027\u5173\u7cfb \u5177\u6709\u5782\u76f4\u65b9\u5411\u7684\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2=0\\) \u4e00\u5f20\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u53ef\u4ee5\u6309\u516c\u5f0f \\(\\mathbf{v}=\\omega^*\\mathbf{l}\\) \u7531\u5e73\u9762\u7684\u6d88\u5f71\u7ebf \\(\\mathbf{l}\\) \u83b7\u5f97\uff1b\u53cd\u4e4b\u6709 \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \u4e24\u5782\u76f4\u5e73\u9762\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{l}_1^\\top \\omega^* \\mathbf{l}_2=0\\) \u7531\u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf\u786e\u5b9a\u6807\u5b9a K \u00b6 \u5982\u679c \\(s=K_{12}=0\\) \uff0c\u5e76\u4e14 \\([\\omega_{ij}]=\\omega=K^{-\\top}K^{-1}\\) \uff0c\u90a3\u4e48 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u5982\u679c\u8fd8\u6ee1\u8db3 \\(\\alpha_x=K_{11}=K_{22}=\\alpha_y\\) \uff0c\u90a3\u4e48 \\(\\omega_{11}=\\omega_{22}\\) \u7531\u4e09\u4e2a\u6b63\u4ea4\u6d88\u5f71\u70b9\u7ed9\u5b9a\u7684\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \u9996\u5148\u6784\u4f5c\u9876\u70b9\u4e3a\u4e09\u4e2a\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2,\\mathbf{v}_3\\) \u7684\u4e09\u89d2\u5f62 \\(C\\) \u7684\u4e2d\u5fc3\u662f\u4e09\u89d2\u5f62\u7684\u5782\u5fc3 \u5173\u4e8e\u4e2d\u5fc3\u53cd\u5c04\u5176\u4e2d\u7684\u4e00\u4e2a\u6d88\u5f71\u70b9\uff08\u4f8b\u5982 \\(\\mathbf{v}_1\\) \uff09\u5f97\u5230 \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u6839\u636e\u6761\u4ef6\uff1a \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u7684\u6781\u7ebf\u8fc7 \\(\\mathbf{v}_2, \\mathbf{v}_3\\) \u6765\u786e\u5b9a \\(C\\) \u7684\u534a\u5f84","title":"\u5355\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/one-vg/#_1","text":"\u7ea6 3225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5728\u900f\u89c6\u6295\u5f71\u4e0b\u5176\u4ed6\u7684 3D \u51e0\u4f55\u5b9e\u4f53\u4e0e\u5176 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u8fd9\u4e9b\u5b9e\u4f53\u5305\u62ec\u5e73\u9762\u3001\u76f4\u7ebf\u3001\u4e8c\u6b21\u66f2\u7ebf\u3001\u4e8c\u6b21\u66f2\u9762\uff0c\u5c06\u63a8\u5bfc\u5b83\u4eec\u7684\u6b63\u5411\u548c\u53cd\u5411\u6295\u5f71\u7684\u6027\u8d28","title":"\u5355\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/one-vg/#_2","text":"","title":"\u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_3","text":"\u5047\u5b9a\u9009\u62e9 XY - \u5e73\u9762\u4e0e\u666f\u7269\u4e2d\u7684\u5e73\u9762 \\(\\pi\\) \u5bf9\u5e94\uff0c\u4f7f\u5f97\u5e73\u9762\u4e0a\u7684\u70b9 \\(Z\\) \u5750\u6807\u4e3a\u96f6\u3002 \\(\\mathbf{x}=P\\mathbf{X}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\ \\mathbf{p}_3 \\ \\mathbf{p}_4] \\begin{bmatrix} X \\\\ Y \\\\ 0 \\\\ 1 \\end{bmatrix}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\mathbf{p}_4]\\begin{bmatrix} X \\\\ Y \\\\ 1 \\end{bmatrix}\\) \u5373 \\(\\mathbf{x}=H\\mathbf{x}_\\pi\\) \u3002\u5728\u900f\u89c6\u5f71\u50cf\u4e0b\uff0c\u4e00\u5f20\u666f\u7269\u5e73\u9762\u4e0e\u4e00\u5f20\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u6700\u4e00\u822c\u7684\u53d8\u6362\u662f\u5e73\u9762\u5c04\u5f71\u53d8\u6362","title":"\u5bf9\u5e73\u9762\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_4","text":"\u6b63\u5411\u6295\u5f71 \uff1a \\(\\mathbf{A}\\) \u548c \\(\\mathbf{B}\\) \u662f 3 \u7ef4\u7a7a\u95f4\u7684\u70b9\uff0c\u800c \\(\\mathbf{a},\\mathbf{b}\\) \u662f\u5b83\u4eec\u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u56fe\u50cf\uff1a \\(\\mathbf{x}(\\mu)=P(\\mathbf{A}+\\mu \\mathbf{B})=P\\mathbf{A}+\\mu P \\mathbf{B}=\\mathbf{a} + \\mu \\mathbf{b}\\) \u76f4\u7ebf\u7684\u53cd\u5411\u6295\u5f71 \uff1a\u7ecf\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u6620\u5c04\u6210\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}\\) \u7684\u7a7a\u95f4\u7684\u70b9\u96c6\u662f\u5e73\u9762 \\(P^\\top\\mathbf{l}\\) Pl\u00fccker \u76f4\u7ebf\u8868\u793a \u4e00\u6761\u7528 Pl\u00fccker \u77e9\u9635 \\(L\\) \u8868\u793a\u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\uff0c\u5728\u6444\u50cf\u673a\u6620\u5c04 \\(P\\) \u4f5c\u7528\u4e0b\u88ab\u6620\u5c04\u6210\u6ee1\u8db3 \\([\\mathbf{l}]_\\times=PLP^\\top\\) \u7684\u76f4\u7ebf \u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u662f\u79e9\u4e3a 3 \u7684 \\(3 \\times 6\\) \u77e9\u9635\uff0c\u5373 \\(P=\\begin{bmatrix} \\mathbf{P}^2 \\wedge \\mathbf{P}^3 \\\\ \\mathbf{P}^3 \\wedge \\mathbf{P}^1 \\\\ \\mathbf{P}^1 \\wedge \\mathbf{P}^2 \\end{bmatrix}\\) \uff0c\u5176\u4e2d \\(\\mathbf{P}^{i\\top}\\) \u662f\u70b9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u884c\uff0c\u800c \\(\\mathbf{P}^i \\wedge \\mathbf{P}^j\\) \u662f\u5e73\u9762 \\(\\mathbf{P}^i\\) \u4e0e \\(\\mathbf{P}^j\\) \u7684\u4ea4\u7ebf\u7684 Pl\u00fccker \u5750\u6807 \u5728\u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u4f5c\u7528\u4e0b\uff0c \\(IP^3\\) \u4e2d\u7528 Pl\u00fccker \u5750\u6807\u8868\u793a\u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u88ab\u6620\u5c04\u5bfc\u56fe\u50cf\u76f4\u7ebf\uff1a \\(\\mathbf{l}=P\\mathcal{L}=\\begin{bmatrix} (\\mathbf{P}^2 \\wedge \\mathbf{P}^3 | \\mathcal{L}) \\\\ (\\mathbf{P}^3 \\wedge \\mathbf{P}^1 | \\mathcal{L}) \\\\ (\\mathbf{P}^1 \\wedge \\mathbf{P}^2 | \\mathcal{L}) \\end{bmatrix}\\) \\(IP^3\\) \u4e2d\u6ee1\u8db3 \\(P\\mathcal{L}=\\mathbf{0}\\) \u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u5fc5\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3","title":"\u5bf9\u76f4\u7ebf\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_5","text":"\u5728\u6444\u50cf\u673a \\(P\\) \u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53cd\u5411\u6295\u5f71\u6210\u9525\u9762: \\(Q_{CO}=P^\\top CP\\)","title":"\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_6","text":"\u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u5b9a\u4e49\u4e3a\u5f71\u50cf\u5c04\u7ebf\u4e0e \\(S\\) \u7684\u6240\u6709\u5207\u70b9 \\(\\mathbf{X}\\) \u7684\u96c6\u5408\u3002\u5728\u56fe\u50cf\u4e0a\uff0c\u4e0e\u5b83\u5bf9\u5e94\u7684 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u662f \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u96c6\u5408\uff0c\u5373 \\(\\gamma\\) \u662f \\(\\Gamma\\) \u7684\u56fe\u50cf \u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u4ec5\u53d6\u51b3\u4e8e\u6444\u50cf\u673a\u4e2d\u5fc3\u4e0e\u66f2\u9762\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u800c\u4e0e\u56fe\u50cf\u5e73\u9762\u65e0\u5173 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u7531\u56fe\u50cf\u5e73\u9762\u4e0e\u8f6e\u5ed3\u751f\u6210\u5143\u7684\u5c04\u7ebf\u7684\u76f8\u4ea4\u786e\u5b9a\uff0c\u56e0\u6b64\u4e0e\u56fe\u50cf\u5e73\u9762\u6709\u5173","title":"\u5149\u6ed1\u66f2\u9762\u7684\u56fe\u50cf"},{"location":"cv/mvg/one-vg/#_7","text":"\u4e8c\u6b21\u66f2\u9762\u7684\u6b63\u5411\u6295\u5f71 \u5728\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u5916\u5f62\u7ebf\u662f\u4e0b\u5f0f\u7ed9\u5b9a\u7684\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(C^*=PQ^*P^\\top\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u548c\u4e2d\u5fc3\u4e3a \\(C\\) \u7684\u6444\u50cf\u673a\u76f8\u5bf9\u5e94\u7684\u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u7684\u5e73\u9762\u662f \\(\\pi_\\Gamma=QC\\) \u9876\u70b9\u4e3a \\(\\mathbf{V}\\) \u5e76\u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u76f8\u5207\u7684\u9525\u9762\u662f\u4e00\u4e2a\u9000\u5316\u7684\u4e8c\u6b21\u66f2\u9762 \\(Q_{CO}=(\\mathbf{V}^\\top Q\\mathbf{V})Q-(Q\\mathbf{V})(Q\\mathbf{V})^\\top\\) \uff0c\u5f53 \\(Q_{CQ}\\mathbf{V}=\\mathbf{0}\\) \u65f6\uff0c \\(\\mathbf{V}\\) \u6b63\u662f\u6240\u8981\u6c42\u7684\u9525\u9762\u7684\u9876\u70b9","title":"\u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u4e8c\u6b21\u66f2\u9762\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_8","text":"3 \u7ef4\u7a7a\u95f4\u7684\u7269\u4f53\u548c\u6444\u50cf\u673a\u4e2d\u5fc3\u786e\u5b9a\u4e86\u4e00\u4e2a\u5c04\u7ebf\u96c6\u5408\uff0c\u800c\u8fd9\u4e9b\u5c04\u7ebf\u4e0e\u4e00\u5f20\u5e73\u9762\u7684\u4ea4\u5c31\u4ea7\u751f\u8be5\u7269\u4f53\u7684\u56fe\u50cf\uff0c\u8fd9\u4e2a\u96c6\u5408\u901a\u5e38\u79f0\u4e3a \u5c04\u7ebf\u9525 \u5047\u8bbe\u5c04\u7ebf\u9525\u4e0e\u4e24\u5f20\u5e73\u9762\u76f8\u4ea4\uff0c\u90a3\u4e48\u6240\u5f97\u4e24\u5e45\u56fe\u50cf \\(\\mathbf{I}\\) \u548c \\(\\mathbf{I}^\\prime\\) \u663e\u7136\u4ee5\u4e00\u4e2a\u900f\u89c6\u6620\u5c04\u76f8\u5173\u8054\u3002\u56e0\u4e3a\u6444\u50cf\u673a\u6709\u5171\u540c\u7684\u4e2d\u5fc3\uff0c\u4ece\u800c\u7531\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4ea7\u751f\u7684 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a \\(\\mathbf{x}^\\prime=P^\\prime \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1}P \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1} \\mathbf{x}\\) \uff0c\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\u4ee5\u4e00\u4e2a\u5f62\u5982 \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \u7684\u5e73\u9762\u5355\u5e94( \\(3 \\times 3\\) \u77e9\u9635)\u76f8\u5173\u8054\uff0c\u5176\u4e2d \\(H=(K^\\prime R^\\prime)(KR)^{-1}\\)","title":"\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u91cd\u8981\u6027"},{"location":"cv/mvg/one-vg/#_9","text":"\u8003\u8651\u7126\u8ddd\u589e\u52a0\u7684\u60c5\u51b5\uff0c\u5728\u4e00\u9636\u8fd1\u4f3c\u7684\u7cbe\u5ea6\u4e0b\uff0c\u5b83\u76f8\u5f53\u4e8e\u56fe\u50cf\u5e73\u9762\u6cbf\u4e3b\u8f74\u79fb\u52a8 \u56e0\u5b50 \\(k=f^\\prime/f\\) \u7684\u53d8\u7126\u6548\u679c\u7b49\u4e8e\u7528 \\(diag(k,k,1)\\) \u53f3\u4e58\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\)","title":"\u79fb\u52a8\u56fe\u50cf\u5e73\u9762"},{"location":"cv/mvg/one-vg/#_10","text":"\u6444\u50cf\u673a\u5728\u4e0d\u6539\u53d8\u5b83\u7684\u5185\u90e8\u53c2\u6570\u7684\u60c5\u51b5\u4e0b\u7ed5\u5b83\u7684\u4e2d\u5fc3\u65cb\u8f6c\u3002\u5982\u679c\u70b9 \\(\\mathbf{X}\\) \u5728\u7eaf\u65cb\u8f6c\u524d\u548c\u540e\u7684\u56fe\u50cf\u662f \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \uff0c\u90a3\u4e48 \\(\\mathbf{x}^\\prime=K[R|\\mathbf{0}]\\mathbf{X}=KRK^{-1}K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}=KRK^{-1}\\mathbf{x}\\) \uff0c\u56e0\u6b64\uff0c \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \uff0c\u5176\u4e2d \\(H=KRK^{-1}\\) \u8fd9\u79cd\u5355\u5e94\u662f\u4e00\u4e2a\u5171\u8f6d\u65cb\u8f6c","title":"\u6444\u50cf\u673a\u65cb\u8f6c"},{"location":"cv/mvg/one-vg/#_11","text":"","title":"\u5e94\u7528\u4e0e\u4e3e\u4f8b"},{"location":"cv/mvg/one-vg/#_12","text":"\u53ef\u4ee5\u5bf9\u73b0\u6709\u7684\u56fe\u50cf\u8fdb\u884c\u5e73\u9762\u5355\u5e94\u6027\u7684\u5f62\u53d8\u63d2\u8865\u6765\u4ea7\u751f\u65b0\u7684\u56fe\u50cf\uff0c\u65b0\u7684\u56fe\u50cf\u5bf9\u5e94\u4e8e\u4e0d\u540c\u7684\u6444\u50cf\u673a\u5b9a\u5411(\u4f46\u6444\u50cf\u673a\u4e2d\u5fc3\u76f8\u540c) \u8ba1\u7b97\u628a\u56fe\u50cf\u4e2d\u7684\u56db\u8fb9\u5f62\u6620\u5c04\u56de\u5177\u6709\u6b63\u786e\u957f\u5bbd\u6bd4\u77e9\u5f62\u7684\u5355\u5e94 H \u7528\u8fd9\u4e2a\u5355\u5e94\u5bf9\u539f\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865","title":"\u89c6\u56fe\u5408\u6210"},{"location":"cv/mvg/one-vg/#_13","text":"\u6444\u50cf\u673a\u7ed5\u5176\u4e2d\u5fc3\u65cb\u8f6c\u6240\u5f97\u5230\u7684\u4e00\u7ec4\u56fe\u50cf\u4e4b\u95f4\u4ee5\u4e00\u4e2a\u5e73\u9762\u5355\u5e94\u76f8\u5173\u8054\u3002\u8fd9\u6837\u7684\u4e00\u7ec4\u56fe\u50cf\u53ef\u4ee5\u901a\u8fc7\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\u4e0e\u5176\u4e2d\u4e00\u5e45\u56fe\u50cf\u7684\u5e73\u9762\u914d\u51c6\u3002 \u9009\u62e9\u56fe\u50cf\u96c6\u5408\u4e2d\u7684\u4e00\u5e45\u4f5c\u4e3a\u53c2\u8003\u56fe\u50cf \u5728\u5176\u4f59\u7684\u56fe\u50cf\u4e2d\u9009\u4e00\u5e45\u56fe\u50cf\uff0c\u8ba1\u7b97\u628a\u5b83\u6620\u5c04\u5230\u53c2\u8003\u56fe\u50cf\u7684\u5355\u5e94 H \u7528\u5f97\u5230\u7684\u5355\u5e94\u5bf9\u8fd9\u5e45\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\uff0c\u5e76\u4e14\u7528\u63d2\u8865\u56fe\u50cf\u4e0e\u53c2\u8003\u56fe\u50cf\u7684\u975e\u91cd\u53e0\u90e8\u5206\u6765\u6269\u5927\u53c2\u8003\u56fe\u50cf \u5bf9\u56fe\u50cf\u96c6\u5408\u4e2d\u4f59\u4e0b\u7684\u56fe\u50cf\u91cd\u590d\u4e0a\u8ff0\u6700\u540e\u4e24\u6b65\u8fc7\u7a0b","title":"\u5e73\u9762\u5168\u666f\u62fc\u56fe"},{"location":"cv/mvg/one-vg/#_14","text":"\u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u90fd\u9009\u62e9\u89c4\u8303\u7684\u5c04\u5f71\u5750\u6807\u90a3\u4e48\u6444\u50cf\u673a\u77e9\u9635\uff1a \\(P=\\begin{bmatrix} a & 0 & 0 & -d \\\\ 0 & b & 0 & -d \\\\ 0 & 0 & c & -d \\end{bmatrix}\\) \u6ee1\u8db3 \\(\\mathbf{x}_i=P\\mathbf{X}_i,i=1,...,4\\) \u548c \\(P(a^{-1},b^{-1},c^{-1},d^{-1})^\\top=\\mathbf{0}\\) \uff0c\u540e\u8005\u8868\u793a\u6444\u50cf\u673a\u4e2d\u5fc3\u662f \\(\\mathbf{C}=(a^{-1},b^{-1},c^{-1},d^{-1})^\\top\\)","title":"\uff08\u7b80\u5316\u7684\uff09\u5c04\u5f71\u8bb0\u53f7"},{"location":"cv/mvg/one-vg/#_15","text":"\u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u91cd\u5408\u7684\u4e24\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9.\u90ce\u5728\u540c\u4e00\u5c04\u7ebf\u4e0a\u7684\u70b9\u3002\u5982\u679c\u6444\u50cf\u673a\u4e2d\u5fc3\u88ab\u79fb\u52a8\u4e86(\u6ca1\u6709\u6cbf\u7740\u8fd9\u6761\u5c04\u7ebf) \uff0c\u90a3\u4e48\u5176\u56fe\u50cf\u5c31\u4e0d\u518d\u91cd\u5408\u4e86\u3002\u539f\u6765\u662f\u91cd\u5408\u7684\u56fe\u50cf\u70b9\u4e4b\u95f4\u7684\u76f8\u5bf9\u4f4d\u79fb\u79f0\u4e3a\u89c6\u5dee\u3002","title":"\u79fb\u52a8\u6444\u50cf\u673a\u4e2d\u5fc3"},{"location":"cv/mvg/one-vg/#_16","text":"\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u662f \\(\\mathbf{x}\\) \u4e0e\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\u6d4b\u91cf\u7684\u5c04\u7ebf\u65b9\u5411 \\(\\mathbf{d}=K^{-1}\\mathbf{x}\\) \u4e4b\u95f4\u7684\u4e00\u4e2a\uff08\u4eff\u5c04\uff09\u53d8\u6362 \u4e00\u6761\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u786e\u5b9a\u4e00\u5f20\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u8be5\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}=K^\\top \\mathbf{l}\\)","title":"\u6444\u50cf\u673a\u6807\u5b9a\u4e0e\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf"},{"location":"cv/mvg/one-vg/#_17","text":"\\(\\pi_\\infty\\) \u4e0e\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u7684\u6620\u5c04\u7531\u5e73\u9762\u5355\u5e94 \\(\\mathbf{x}=H\\mathbf{d}\\) \u7ed9\u51fa\uff0c\u5176\u4e2d \\(H=KR\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08\u7b80\u79f0 IAC\uff09\u662f\u4e8c\u6b21\u66f2\u7ebf \\(\\omega=(KK^\\top)^{-1}=K^{-\\top}K^{-1}\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5076\u56fe\u50cf\uff08\u7b80\u79f0 DIAC\uff09\u4e3a \\(\\omega^*=\\omega^{-1}=KK^\\top\\) \u4e00\u4e2a\u7b80\u5355\u7684\u6807\u5b9a\u88c5\u7f6e \u88c5\u7f6e\u91cc\u6709\u4e09\u4e2a\u6b63\u65b9\u5f62\uff08\u5b83\u4eec\u6240\u5728\u5e73\u9762\u662f\u4e0d\u5e73\u884c\u7684\uff0c\u4f46\u4e5f\u4e0d\u5fc5\u6b63\u4ea4\uff09\u7684\u56fe\u50cf\u63d0\u4f9b\u8ba1\u7b97 \\(K\\) \u7684\u8db3\u591f\u7ea6\u675f \u5bf9\u6bcf\u4e2a\u6b63\u65b9\u5f62\uff0c\u8ba1\u7b97\u628a\u5b83\u7684\u89d2\u70b9 \\((0,0)^\\top\u3001(1,0)\u3001(0,1)\u3001(1,1)^\\top\\) \u6620\u5c04\u5230\u76f8\u5e94\u7684\u56fe\u50cf\u70b9\u7684\u5355\u5e94 \\(H\\) \u8ba1\u7b97\u8be5\u6b63\u65b9\u5f62\u6240\u5728\u5e73\u9762\u865a\u5706\u70b9\u7684\u56fe\u50cf\uff0c\u5373 \\(H(1,\\pm i,0)^\\top\\) \u7531\u8fd9\u516d\u4e2a\u865a\u5706\u70b9\u7684\u56fe\u50cf\u62df\u5408\u51fa\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(\\omega\\) \u7528 Cholesky \u5206\u89e3\u7531 \\(\\omega=(KK^\\top)^{-1}\\) \u8ba1\u7b97\u6807\u5b9a \\(K\\) \u56fe\u50cf\u4e2d\u7684\u6b63\u4ea4\u6027 \u5982\u679c\u56fe\u50cf\u70b9\u5173\u4e8e \\(\\omega\\) \u5171\u8f6d\uff0c\u5373\u5982\u679c \\(\\mathbf{x}_1^\\top \\omega \\mathbf{x}_2 = 0\\) \uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5bf9\u5e94\u4e8e\u6b63\u4ea4\u7684\u65b9\u5411 \u5047\u5b9a\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5230\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}\\) \u7684\u5e73\u9762 \\(\\pi\\) \uff0c\u90a3\u4e48\u6cd5\u7ebf\u7684\u5f71\u50cf\u4e3a\u70b9 \\(K\\mathbf{n}\\) \uff0c\u800c\u4e14\u76f4\u7ebf \\(\\mathbf{l}\\) \u662f\u8be5\u70b9\u7684\u6781\u7ebf\uff0c\u56e0\u6b64 \\(\\mathbf{l}=\\omega K \\mathbf{n}=(KK^\\top)^{-1}K\\mathbf{n}=K^{-\\top}\\mathbf{n}\\) \uff0c\u5373 \\(\\pi\\) \u7684\u6cd5\u7ebf\u662f \\(\\mathbf{n}=K^\\top \\mathbf{l}\\)","title":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf"},{"location":"cv/mvg/one-vg/#_18","text":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08IAC\uff09\u662f\u56fe\u50cf\u4e2d\u7684\u4e00\u6761\u865a\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e3a\u4e86\u53ef\u89c6\u5316\u7684\u76ee\u7684\uff0c\u8003\u8651\u4e0e\u6444\u50cf\u673a\u6807\u5b9a\u7d27\u5bc6\u76f8\u5173\u7684\u53e6\u5916\u4e00\u79cd\u66f2\u7ebf\uff0c\u8fd9\u6837\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4e3a \u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff0c\u5b83\u662f\u4e00\u4e2a\u9876\u89d2\u4e3a \\(45^\\circ\\) \u800c\u8f74\u4e3a\u6444\u50cf\u673a\u4e3b\u8f74\u7684\u5706\u9525\u9762\u7684\u56fe\u50cf\u3002\u8be5\u5706\u9525\u9762\u7684\u70b9\u6620\u5c04\u4e3a\u4e8c\u6b21\u66f2\u7ebf\uff1a \\[ C=K^{-\\top} \\begin{bmatrix} 1 & & \\\\ & 1 & \\\\ & & -1 \\end{bmatrix} K^{-\\top} \\] \u6b63\u4ea4\u6027\u548c\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff1a\u5982\u679c\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u5bf9\u5e94\u4e8e\u5782\u76f4\u4e8e\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u5c04\u7ebf\u7684\u4e00\u4e2a\u5e73\u9762\uff0c\u90a3\u4e48\uff0c\u8fd9\u6761\u76f4\u7ebf\u662f \\(\\mathbf{x}\\) \u5173\u4e8e\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf\u7684\u53cd\u5c04\u70b9 \\(\\overset{\\cdot}{\\mathbf{x}}\\) \u7684\u6781\u7ebf \\(C\\overset{\\cdot}{\\mathbf{x}}\\)","title":"\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf"},{"location":"cv/mvg/one-vg/#_19","text":"\u900f\u89c6\u6295\u5f71\u7684\u4e00\u4e2a\u663e\u8457\u7279\u5f81\u662f\u5ef6\u4f38\u81f3\u65e0\u7a77\u8fdc\u7684\u7269\u4f53\u7684\u56fe\u50cf\u53ef\u80fd\u51fa\u73b0\u5728\u6709\u9650\u8303\u56f4 \u6d88\u5f71\u70b9 \u96c6\u5408\u4e0a\u4e00\u6761\u4e16\u754c\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u7531\u5e73\u884c\u4e8e\u8be5\u76f4\u7ebf\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u5f97\u5230\u3002\u56e0\u6b64\u6d88\u5f71\u70b9\u4ec5\u4f9d\u8d56\u4e8e\u76f4\u7ebf\u7684\u65b9\u5411\uff0c\u800c\u4e0e\u5176\u4f4d\u7f6e\u65e0\u5173\u3002\u5982\u679c\u4e16\u754c\u76f4\u7ebf\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\uff0c\u90a3\u4e48\u6d88\u5f71\u70b9\u5728\u56fe\u50cf\u7684\u65e0\u7a77\u8fdc\u5904\u3002 \u8be5\u4e16\u754c\u76f4\u7ebf\u53ef\u4ee5\u7528 \\(\\mathbf{X}(\\lambda)=\\mathbf{A}+\\lambda\\mathbf{D}\\) \u6765\u53c2\u6570\u5316\uff0c\u5176\u4e2d \\(\\mathbf{A}\\) \u662f\u76f4\u7ebf\u4e0a\u7684\u70b9\uff0c\u800c \\(\\mathbf{D}=(\\mathbf{d}^\\top,0)^\\top\\) \u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u4e14\u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9 \\(\\mathbf{v}\\) \uff0c\u5373 \\(\\mathbf{v}=K\\mathbf{d}\\) \u7531\u6d88\u5f71\u70b9\u6c42\u6444\u50cf\u673a\u65cb\u8f6c \u6d88\u5f71\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u7684\u56fe\u50cf\uff0c\u5b83\u63d0\u4f9b\u5b9a\u5411(\u59ff\u6001)\u4fe1\u606f\u7684\u65b9\u5f0f\u4e0e\u4e0d\u52a8\u661f\u63d0\u4f9b\u7684\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u8003\u8651\u7531\u5b9a\u5411\u548c\u4f4d\u7f6e\u4e0d\u540c\u7684\u4e24\u4e2a\u6807\u5b9a\u6444\u50cf\u673a\u83b7\u53d6\u7684\u4e00\u4e2a\u666f\u7269\u7684\u4e24\u5e45\u56fe\u50cf\u3002\u65e0\u7a77\u8fdc\u70b9\u4f5c\u4e3a\u666f\u7269\u7684\u4e00\u90e8\u5206\u4e0e\u6444\u50cf\u673a\u65e0\u5173\u3002\u5b83\u4eec\u7684\u56fe\u50cf\uff0c\u5373\u6d88\u5f71\u70b9\uff0c\u4e0d\u53d7\u6444\u50cf\u673a\u4f4d\u7f6e\u53d8\u5316\u7684\u5f71\u54cd\uff0c\u4f46\u8981\u53d7\u6444\u50cf\u673a\u65cb\u8f6c\u7684\u5f71\u54cd\u3002 \u4ee4\u4e00\u6761\u666f\u7269\u76f4\u7ebf\u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u7684\u6d88\u5f71\u70b9\u662f \\(\\mathbf{v}_i\\) \uff0c\u5728\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u662f \\(\\mathbf{v}_i^\\prime\\) \uff0c\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i\\) \u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i=K^{-1}\\mathbf{v}_i / \\parallel K^{-1} \\mathbf{v}_i \\parallel\\) \uff0c\u800c\u5bf9\u5e94\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i^\\prime\\) \uff0c\u5728\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i^\\prime\\) \uff0c\u5219\u6444\u50cf\u673a\u7684\u65cb\u8f6c \\(\\mathbf{d}_i^\\prime=R\\mathbf{d}_i\\) \u6d88\u5f71\u7ebf 3 \u7ef4\u7a7a\u95f4\u7684\u5e73\u884c\u5e73\u9762\u4e0e \\(\\pi _\\infty\\) \u4ea4\u4e8e\u4e00\u6761\u516c\u5171\u7684\u76f4\u7ebf\uff0c\u800c\u8fd9\u6761\u76f4\u7ebf\u7684\u56fe\u50cf\u5c31\u662f\u5e73\u9762\u7684\u6d88\u5f71\u7ebf\u3002\u51e0\u4f55\u4e0a\uff0c\u6d88\u5f71\u7ebf\u7531\u5e73\u884c\u4e8e\u666f\u7269\u5e73\u9762\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u5f20\u5e73\u9762\u4e0e\u56fe\u50cf\u7684\u4ea4\u7ebf\u5f97\u5230\u3002\u663e\u7136\uff0c \u6d88\u5f71\u7ebf\u4ec5\u4e0e\u666f\u7269\u5e73\u9762\u7684\u5b9a\u5411\u6709\u5173\uff0c\u800c\u4e0e\u5b83\u7684\u4f4d\u7f6e\u65e0\u5173\u3002 \u5728\u6444\u50cf\u673a\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u5782\u76f4\u4e8e\u65b9\u5411 \\(\\mathbf{n}\\) \u7684\u5e73\u9762\u96c6\u7684\u6d88\u5f71\u7ebf\u662f \\(\\mathbf{l}=K^{-\\top}\\mathbf{n}\\) \u4e24\u6761\u666f\u7269\u76f4\u7ebf\u4e4b\u95f4\u7684\u5939\u89d2 \uff1a\u4ee4 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u662f\u4e00\u5e45\u56fe\u50cf\u4e2d\u4e24\u6761\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4ee4 \\(\\omega\\) \u4e3a\u56fe\u50cf\u4e2d\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\u3002\u5982\u679c \\(\\theta\\) \u662f\u4e24\u76f4\u7ebf\u65b9\u5411\u95f4\u7684\u5939\u89d2\uff0c\u5219 \\[ \\cos \\theta = \\frac{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2}{\\sqrt{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_1} \\sqrt{\\mathbf{v}_2^\\top \\omega \\mathbf{v}_2}} \\] \u6b63\u4ea4\u6027\u5173\u7cfb \u5177\u6709\u5782\u76f4\u65b9\u5411\u7684\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2=0\\) \u4e00\u5f20\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u53ef\u4ee5\u6309\u516c\u5f0f \\(\\mathbf{v}=\\omega^*\\mathbf{l}\\) \u7531\u5e73\u9762\u7684\u6d88\u5f71\u7ebf \\(\\mathbf{l}\\) \u83b7\u5f97\uff1b\u53cd\u4e4b\u6709 \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \u4e24\u5782\u76f4\u5e73\u9762\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{l}_1^\\top \\omega^* \\mathbf{l}_2=0\\)","title":"\u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf"},{"location":"cv/mvg/one-vg/#k","text":"\u5982\u679c \\(s=K_{12}=0\\) \uff0c\u5e76\u4e14 \\([\\omega_{ij}]=\\omega=K^{-\\top}K^{-1}\\) \uff0c\u90a3\u4e48 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u5982\u679c\u8fd8\u6ee1\u8db3 \\(\\alpha_x=K_{11}=K_{22}=\\alpha_y\\) \uff0c\u90a3\u4e48 \\(\\omega_{11}=\\omega_{22}\\) \u7531\u4e09\u4e2a\u6b63\u4ea4\u6d88\u5f71\u70b9\u7ed9\u5b9a\u7684\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \u9996\u5148\u6784\u4f5c\u9876\u70b9\u4e3a\u4e09\u4e2a\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2,\\mathbf{v}_3\\) \u7684\u4e09\u89d2\u5f62 \\(C\\) \u7684\u4e2d\u5fc3\u662f\u4e09\u89d2\u5f62\u7684\u5782\u5fc3 \u5173\u4e8e\u4e2d\u5fc3\u53cd\u5c04\u5176\u4e2d\u7684\u4e00\u4e2a\u6d88\u5f71\u70b9\uff08\u4f8b\u5982 \\(\\mathbf{v}_1\\) \uff09\u5f97\u5230 \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u6839\u636e\u6761\u4ef6\uff1a \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u7684\u6781\u7ebf\u8fc7 \\(\\mathbf{v}_2, \\mathbf{v}_3\\) \u6765\u786e\u5b9a \\(C\\) \u7684\u534a\u5f84","title":"\u7531\u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf\u786e\u5b9a\u6807\u5b9a K"},{"location":"cv/mvg/pjt2d/","text":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u00b6 \u7ea6 4639 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecdMVG\u6240\u5fc5\u987b\u7684\u51e0\u4f55\u6982\u5ff5\u548c\u7b26\u53f7\uff0c\u5177\u4f53\u6db5\u76d6\u5e73\u9762\u7684\u5c04\u5f71\u53d8\u6362\u51e0\u4f55 \u5e73\u9762\u51e0\u4f55 \u00b6 2D \u5c04\u5f71\u5e73\u9762 \u00b6 \u70b9\u4e0e\u76f4\u7ebf \u00b6 \u76f4\u7ebf\u7684\u5176\u6b21\u8868\u793a \u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u65b9\u7a0b \\(ax+by+c=0\\) \u53ef\u4ee5\u7528\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u8868\u793a\u3002 \u5bf9\u4efb\u4f55\u975e\u96f6\u7684k\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u4e0e \\(k(a,b,c)^{\\top}\\) \u8868\u793a\u540c\u4e00\u76f4\u7ebf \u3002 \u70b9\u7684\u5176\u6b21\u8868\u793a \u4e00\u4e2a\u70b9\u7684\u4efb\u4f55\u9f50\u6b21\u77e2\u91cf\u7684\u8868\u793a\u5f62\u5f0f\u4e3a \\(x=(x_1,x_2,x_3)^{\\top}\\) \uff0c\u975e\u9f50\u6b21\u5750\u6807 \\(x=(\\frac{x_1}{x_3}, \\frac{x_2}{x_3})^{\\top}\\) \u3002 \u7ed3\u8bba1 \u70b9 \\(x\\) \u5728\u76f4\u7ebf \\(l\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(x^{\\top}l=0\\) \u3002 \\(x^{\\top}l = l^{\\top}x = x \\cdot l = 0\\) \u3002 \u7ed3\u8bba2 \u4e24\u76f4\u7ebf \\(l\\) \u548c \\(l^{\\prime}\\) \u7684\u4ea4\u70b9\u662f\u70b9 \\(x=l \\times l^{\\prime}\\) \u3002 \u53c9\u4e58 \\[c = a \\times b = (a.y * b.z - b.y * a.z, \\quad b.x * a.z - a.x * b.z, \\quad a.x * b.y - b.x * a.y)\\] \u7ed3\u8bba3 \u8fc7\u4e24\u70b9 \\(x\\) \u548c \\(x^{\\prime}\\) \u7684\u76f4\u7ebf\u662f \\(l = x \\times x^{\\prime}\\) \u3002 \u5e73\u884c\u7ebf\u7684\u4ea4\u70b9 \u4e24\u5e73\u884c\u76f4\u7ebf \\(ax+by+c=0\\) \u548c \\(ax+by+c^{\\prime}=0\\) \uff0c\u7531 \u7ed3\u8bba2 \u53ef\u5f97\u4ea4\u70b9 \\((b, -a, 0)^{\\top}\\) \u3002 \u7406\u60f3\u70b9\u548c\u65e0\u7a77\u8fdc\u7ebf \u5f53\u9f50\u6b21\u77e2\u91cf \\(x = (x_1, x_2, x_3)^{\\top}\\) \u4e2d\u7684 \\(x_3=0\\) \u65f6\u7684\u70b9\u88ab\u79f0\u4e3a \u7406\u60f3\u70b9 \uff0c\u6216 \u65e0\u7a77\u8fdc\u70b9 \u3002\u6240\u6709\u7406\u60f3\u70b9\u96c6\u5408\u5728\u4e00\u6761\u76f4\u7ebf\u4e0a\uff0c\u79f0 \u65e0\u7a77\u8fdc\u7ebf \uff0c\u7528 \\(I_{\\infty}=(0,0,1)^{\\top}\\) \u8868\u793a\u3002 \u5c04\u5f71\u5e73\u9762\u6a21\u578b \\(IP^2\\) \u7684\u70b9\u548c\u7ebf\u5206\u522b\u4e3a\u4e2d\u8fc7\u539f\u70b9\u7684\u5c04\u7ebf\u548c\u5e73\u9762 \\(x_1x_2\\) \u5e73\u9762\u4e0a\u7684\u5c04\u7ebf\u8868\u793a\u7406\u60f3\u70b9\uff0c\u800c \\(x_1x_2\\) \u5e73\u9762\u8868\u793a \\(I_{\\infty}\\) \u3002 \u7ed3\u8bba4\uff08\u5bf9\u5076\u539f\u7406\uff09 2\u7ef4\u5c04\u5f71\u51e0\u4f55\u4e2d\u7684\u4efb\u4f55\u5b9a\u7406\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u5bf9\u5076\u5b9a\u7406\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u4e92\u6362\u539f\u5b9a\u7406\u4e2d\u70b9\u548c\u7ebf\u7684\u4f5c\u7528\u800c\u5bfc\u51fa\u3002 \u4e8c\u6b21\u66f2\u7ebf\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \u00b6 \u4e8c\u6b21\u66f2\u7ebf \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b: \u53cc\u66f2\u7ebf\uff0c\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002 \u5728\u975e\u9f50\u6b21\u5750\u6807\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u7684\u65b9\u7a0b\u662f \\[ax^2+bxy+cy^2+dx+ey+f=0\\] \u901a\u8fc7\u66ff\u4ee3 \\(x\\to\\frac{x_1}{x_3}\\) \uff0c \\(y\\to\\frac{x_2}{x_3}\\) \uff0c\u5f97\u5230\uff1a \\[ax_1^2+bx_1x_2+cx_2^2+dx_1x_3+ex_2x_3+fx_3^2=0\\] \u8868\u793a\u6210\u77e9\u9635\u5f62\u5f0f\u4e3a \\(x^{\\top}Cx=0\\) \u5176\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u7cfb\u6570\u77e9\u9635 \\(C\\) \u4e3a \\[ C = \\left[ \\begin{matrix} a & b/2 & d/2 \\\\ b/2 & c & e/2 \\\\ d/2 & e/2 & f \\end{matrix} \\right] \\] \u7ed3\u8bba5 \u8fc7(\u975e\u9000\u5316)\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u4e0a\u70b9 \\(x\\) \u7684\u5207\u7ebf \\(l\\) \u7531 \\(l=Cx\\) \u786e\u5b9a\u3002 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \u4e0a\u9762\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u66f4\u786e\u5207\u5730\u5e94\u79f0\u4e3a\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u56e0\u4e3a\u5b83\u5b9a\u4e49\u7684\u662f\u70b9\u7684\u65b9\u7a0b\u3002\u540c\u65f6\u8fd9\u79cd \u5bf9\u5076 \uff08\u6216\u7ebf\uff09\u4e8c\u6b21\u66f2\u7ebf\u4e5f\u7531\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u8868\u793a\uff0c\u6211\u4eec\u628a\u5b83\u8bb0\u4e3a \\(C^*\\) \uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u5207\u7ebf \\(l\\) \u6ee1\u8db3 \\(l^{\\top}C^*l=0\\) \u3002\u5176\u4e2d \\(C^*\\) \u8868\u793a\u4e3a \\(C\\) \u7684\u4f34\u968f\u77e9\u9635\u3002 \u9000\u5316\u4e8c\u6b21\u66f2\u7ebf \u975e\u6ee1\u79e9\u77e9\u9635 \\(C\\) \u6240\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4f5c\u9000\u5316\u4e8c\u6b21\u66f2\u7ebf\u3002\u9000\u5316\u7684\u70b9\u4e8c\u6b21\u66f2\u7ebf\u5305\u542b\u4e24\u6761\u7ebf(\u79e9 2) \u6216\u4e00\u6761\u91cd\u7ebf(\u79e9 1) \u3002 \u5c04\u5f71\u53d8\u6362 \u00b6 \u5c04\u5f71\u6620\u5c04 \u5c04\u5f71\u6620\u5c04 \u662f \\(IP^2\\) \u5230\u5b83\u81ea\u8eab\u7684\u4e00\u79cd\u6ee1\u8db3\u4e0b\u5217\u6761\u4ef6\u7684\u53ef\u9006\u6620\u5c04 \\(h\\) \uff1a\u4e09\u70b9 \\(x_1\\) , \\(x_2\\) \u548c \\(x_3\\) \u5171\u7ebf\u5f53\u4e14\u4ec5\u5f53 \\(h(x_1)\\) , \\(h(x_2)\\) , \\(h(x_3)\\) \u4e5f\u5171\u7ebf\u3002 \u5c04\u5f71\u6620\u5c04\u4e5f\u79f0\u4e3a\u4fdd\u7ebf\u53d8\u6362 \uff0c\u6216\u5c04\u5f71\u53d8\u6362\u6216\u5355\u5e94 (homography) \u3002 \u5b9a\u74061 \u6620\u5c04 \\(h\\) \uff1a \\(IP^2 \\to IP^2\\) \u662f\u5c04\u5f71\u6620\u5c04\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b58\u5728\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(H\\) \uff0c\u4f7f\u5f97 \\(IP^2\\) \u7684\u4efb\u4f55\u4e00\u4e2a\u7528\u77e2\u91cf \\(x\\) \u8868\u793a\u7684\u70b9\u90fd\u6ee1\u8db3 \\(h(x)=Hx\\) \u3002 \u5c04\u5f71\u53d8\u6362 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u662f\u5173\u4e8e\u9f50\u6b213\u7ef4\u77e2\u91cf\u7684\u4e00\u79cd\u7ebf\u6027\u53d8\u6362\uff0c\u5e76\u53ef\u7528\u4e00\u4e2a\u975e\u5947\u5f02 \\(3 \\times 3\\) \u77e9\u9635 \\(H\\) \u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x_1^\\prime \\\\ x_2^\\prime\\\\ x_3^\\prime \\end{pmatrix} = \\left[ \\begin{matrix} h_{11} & h_{12} & h_{13} \\\\ h_{21} & h_{22} & h_{23} \\\\ h_{31} & h_{32} & h_{33} \\end{matrix} \\right] \\begin{pmatrix} x_1 \\\\ x_2\\\\ x_3 \\end{pmatrix} \\] \u6216\u66f4\u7b80\u6d01\u5730\u8868\u793a\u4e3a \\(x^\\prime = Hx\\) \u3002 \u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362 \u00b6 \u76f4\u7ebf\u7684\u53d8\u6362 \\[l^\\prime = H^{-T}l\\] \u4e5f\u53ef\u4ee5\u5199\u6210 \\(l^{\\prime T}=l^{\\top}H^{-1}\\) \u3002\u76f4\u7ebf\u548c\u70b9\u53d8\u6362\u7684\u57fa\u672c\u533a\u522b\u5728\u4e8e\u70b9\u53d8\u6362\u4f9d\u636e \\(H\\) \uff0c\u800c\u76f4\u7ebf\uff08\u89c6\u4e3a\u884c\u77e2\u91cf\uff09\u53d8\u6362\u5219\u4f9d\u636e \\(H^{-1}\\) \u3002\u79f0\u70b9\u53d8\u6362\u4e3a \u9006\u53d8 \u800c\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c \\(x^{\\top}Cx = x^{\\prime T}[H^{-1}]^{\\top}CH^{-1}x^\\prime = x^{\\prime T} H^{-T}CH^{-1} x^{\\prime}\\) \u3002 \u7ed3\u8bba1 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53d8\u6362\u4e3a \\(C^\\prime = H^{-T}CH^{-1}\\) \u3002\uff08\u56e0\u4e3a\u5b58\u5728 \\(H^{-1}\\) \uff0c\u6240\u4ee5\u79f0\u4e8c\u6b21\u66f2\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \uff09 \u8bc1\u660e \\[ x^{\\top}Cx = (H^{-1}x^\\prime)^{\\top} C (H^{-1}x^\\prime) = x^{\\prime T} (H^{-T}CH^{-1}) x^\\prime \\] \u7ed3\u8bba2 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C^*\\) \u53d8\u6362\u4e3a \\(C^{*\\prime} = HC^* H^{\\top}\\) \u3002 \u8bc1\u660e \\[ l^{\\top}C^*l = (H^{\\top}l)^{\\top}C^*(H^{\\top}l)=l^{\\top}HC^*H^{\\top}l \\] \u53d8\u6362\u7684\u5c42\u6b21 \u00b6 \u2002\u2002\u7531 \\(n \\times n\\) \u53ef\u9006\u5b9e\u77e9\u9635\u7684\u7fa4\u79f0\u4e3a\uff08\u5b9e\u7684\uff09\u4e00\u822c\u7ebf\u6027\u7fa4\u6216 \\(GL(n)\\) \u3002\u5f53\uff0c \u628a\u76f8\u5dee\u975e\u96f6\u7eaf\u9760\u56e0\u5b50\u7684\u77e9\u9635\u90fd\u89c6\u4e3a\u7b49\u540c\u65f6\uff0c\u4fbf\u5f97\u5230\u5c04\u5f71\u7ebf\u6027\u7fa4\uff0c\u8bb0\u4e3a \\(PL(n)\\) (\u5b83\u662f \\(GL(n)\\) \u7684\u5546\u7fa4)\u3002\u5728\u5e73\u9762\u5c04\u5f71\u53d8\u6362\u65f6\uff0c \\(n=3\\) \u3002 \u7b49\u8ddd\u53d8\u6362 \u00b6 \u2002\u2002\u7b49\u8ddd(isometric)\u53d8\u6362\u662f\u5e73\u9762 \\(IR^2\\) \u7684\u53d8\u6362\uff0c\u4fdd\u6301\u6b27\u5f0f\u8ddd\u79bb\u4e0d\u53d8\uff0c\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u53ef\u8868\u793a\u4e3a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} \\varepsilon \\cos \\theta & -\\sin \\theta & t_x \\\\ \\varepsilon \\sin \\theta & \\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u5176\u4e2d \\(\\varepsilon = \\pm 1\\) \u3002\u5982\u679c \\(\\varepsilon = 1\\) \u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u4fdd\u5411\u7684 \u5e76\u4e14\u4e5f\u662f \u6b27\u6c0f \u53d8\u6362\uff08\u5e73\u79fb\u548c\u65cb\u8f6c\u7684\u590d\u5408\uff09\u3002\u5982\u679c \\(\\varepsilon = -1\\) \uff0c\u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u9006\u5411\u7684 \u3002 \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_E \\mathbf{x} = \\left[ \\begin{matrix} R & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u65cb\u8f6c\u4e00\u4e2a\uff0c\u5e73\u79fb\u4e8c\u4e2a\u3002 \u4e0d\u53d8\u91cf \uff1a\u957f\u5ea6(\u4e24\u70b9\u7684\u8ddd\u79bb)\uff0c\u89d2\u5ea6(\u4e24\u7ebf\u7684\u5939\u89d2)\u548c\u9762\u804c\u3002 \u7fa4\u548c\u5b9a\u5411 \u2003\u4fdd\u5411\u7684\u7b49\u8ddd\u53d8\u6362\u5f62\u6210\u4e00\u4e2a\u7fa4\uff0c\u4f46\u9006\u5411\u7684\u4e0d\u662f\u3002\u8fd9\u79cd\u533a\u522b\u5bf9\u4e8e\u4e0b\u9762\u7684\u76f8\u4f3c\u548c\u4eff\u5c04\u53d8\u6362\u540c\u6837\u5982\u6b64\u3002 \u76f8\u4f3c\u53d8\u6362 \u00b6 \u2002\u2002\u76f8\u4f3c\u53d8\u6362\u662f\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u4e0e\u4e00\u4e2a\u5747\u5300\u7f29\u653e\u7684\u590d\u5408\u3002\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_S \\mathbf{x} = \\left[ \\begin{matrix} sR & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u4e0d\u53d8\u91cf \uff1a\u76f4\u7ebf\u7684\u5939\u89d2\uff0c\u4e24\u957f\u5ea6\u7684\u6bd4\u7387\u548c\u9762\u79ef\u7684\u6bd4\u7387\u3002 \u4eff\u5c04\u53d8\u6362 \u00b6 \u2002\u2002\u4eff\u5c04\u53d8\u6362\u662f\u4e00\u4e2a\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\u4e0e\u4e00\u4e2a\u5e73\u79fb\u53d8\u6362\u7684\u590d\u5408\uff0c\u5b83\u7684\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} a_{11} & a_{12} & t_x \\\\ a_{21} & a_{22} & t_y \\\\ 0 & 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y \\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_A \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u4eff\u5c04\u53d8\u6362\u6709\u516d\u81ea\u7531\u5ea6\uff0c\u53ef\u4ee5\u7531\u4e09\u7ec4\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u3002 \u4e0d\u53d8\u91cf \uff1a\u5e73\u884c\u7ebf\uff0c\u5e73\u884c\u7ebf\u6bb5\u7684\u957f\u5ea6\u6bd4\u548c\u9762\u79ef\u6bd4\u3002 \u5c04\u5f71\u53d8\u6362 \u00b6 \u5b83\u662f\u9f50\u6b21\u5750\u6807\u7684\u4e00\u822c\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\uff0c\u5176\u5206\u5757\u5f62\u5f0f\uff1a \\[ \\mathbf{x}^\\prime = H_P \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u5176\u4e2d \\(\\mathbf{v}=(v_1, v_2)^{\\top}\\) \u3002 \u2002\u2002\u5c04\u5f71\u53d8\u6362\u7531\u516b\u4e2a\u53c2\u6570\u786e\u5b9a\uff0c\u53ef\u7531\u56db\u7ec4\u70b9\u5bf9\u5e94\u7b97\u51fa\uff0c \u4f46\u5176\u4e2d\u5c5e\u4e8e\u5411\u4e00\u5e73\u9762\u7684\u4e09\u70b9\u5fc5\u4e0d\u5171\u7ebf\u3002 \u4e0d\u53d8\u91cf \uff1a\u6700\u57fa\u672c\u7684\u5c04\u5f71\u4e0d\u53d8\u91cf\u662f\u56db\u5171\u7ebf\u70b9\u7684\u4ea4\u6bd4\u3002 \u5c04\u5f71\u53d8\u6362\u7684\u5206\u89e3 \u00b6 \u2002\u2002\u5c04\u5f71\u53d8\u6362\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e32\u53d8\u6362\u94fe\u7684\u590d\u5408\uff0c\u94fe\u4e2d\u7684\u6bcf\u4e2a\u77e9\u9635\u6bd4\u5b83\u524d\u9762\u7684\u4e00\u4e2a\u77e9\u9635\u6240\u8868\u793a\u7684\u53d8\u6362\u5c42\u6b21\u9ad8\u3002 \\[ H = H_SH_AH_P = \\left[ \\begin{matrix} sR & \\mathbf{t}/v \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} K & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\] \u5176\u4e2d \\(A=sRK+\\mathbf{tv}^{\\top}/v\\) \uff0c\u800c \\(K\\) \u662f\u6ee1\u8db3 \\(det\\ K=1\\) \u7684\u5f52\u4e00\u5316\u4e0a\u4e09\u89d2\u77e9\u9635\u3002\u5982\u679c \\(v \\ne 0\\) \u4e0a\u8ff0\u5206\u89e3\u662f\u6709\u6548\u7684\uff0c\u800c\u4e14\u5982\u679c \\(s\\) \u53d6\u6b63\u503c\uff0c\u5b83\u8fd8\u662f\u552f\u4e00\u7684\u3002 \u4e0d\u53d8\u91cf\u7684\u6570\u76ee \uff1a\u4e0e\u51fd\u6570\u65e0\u5173\u7684\u4e0d\u53d8\u91cf\u6570\u7b49\u4e8e\u6216\u5927\u4e8e\u914d\u7f6e\u7684\u81ea\u7531\u5ea6\u6570\u51cf\u53bb\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002 1D \u5c04\u5f71\u51e0\u4f55\u548c\u4ea4\u6bd4 \u00b6 \u2002\u2002\u76f4\u7ebf\u4e0a\u7684\u70b9 \\(x\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a \\((x_1, x_2)^{\\top}\\) \uff0c\u800c \\((x_1, 0)^{\\top}\\) \u662f\u8be5\u76f4\u7ebf\u7684\u7406\u60f3\u70b9\u3002\u6211\u4eec\u5c06\u7528\u8bb0\u53f7 \\(\\mathbf{\\bar{x}}\\) \u8868\u793a \\(2\\) \u7ef4\u77e2\u91cf \\((x_1, x_2)^{\\top}\\) \u3002\u53ef\u7528\u9f50\u6b21\u77e9\u9635\u8868\u793a\uff1a \\[\\mathbf{\\bar{x}}^\\prime = H_{2 \\times 2} \\mathbf{\\bar{x}}\\] \u4ea4\u6bd4 \u00b6 \u2002\u2002\u4ea4\u6bd4\u662f \\(IP^1\\) \u7684\u57fa\u672c\u5c04\u5f71\u4e0d\u53d8\u91cf\u3002\u7ed9\u5b9a \\(4\\) \u4e2a\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \uff0c\u4ea4\u6bd4\u5b9a\u4e49\u4e3a \\[ Cross(\\mathbf{\\bar{x}_1},\\mathbf{\\bar{x}_2},\\mathbf{\\bar{x}_3},\\mathbf{\\bar{x}_4}) = \\frac{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_2}||\\mathbf{\\bar{x}_3}\\mathbf{\\bar{x}_4}|}{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_3}||\\mathbf{\\bar{x}_2}\\mathbf{\\bar{x}_4}|} \\] \u5176\u4e2d \\[ |\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}| =det \\begin{bmatrix} x_{i1} & x_{j1} \\\\ x_{i2} & x_{j2} \\end{bmatrix} \\] \u4ea4\u6bd4\u7684\u4e3b\u8981\u7279\u70b9 \u4ea4\u6bd4\u7684\u503c\u4e0e\u5404\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u6240\u7528\u7684\u5177\u4f53\u7684\u9f50\u6b21\u8868\u793a\u65e0\u5173\u3002 \u5982\u679c\u6bcf\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u90fd\u662f\u6709\u9650\u70b9\uff0c\u5e76\u4e14\u5728\u9f50\u6b21\u8868\u793a\u4e2d\u5747\u9009\u62e9 \\(x_2 = 1\\) \uff0c\u90a3\u4e48 \\(|\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}|\\) \u5c31\u8868\u793a\u7531 \\(\\mathbf{\\bar{x}_i}\\) \u5230 \\(\\mathbf{\\bar{x}_j}\\) \u7684\u5e26\u7b26\u53f7\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u4e2d\u6709\u4e00\u4e2a\u7406\u60f3\u70b9\uff0c\u4ea4\u6bd4\u7684\u5b9a\u4e49\u4ecd\u7136\u6709\u6548\u3002 \u5728\u4efb\u4f55\u76f4\u7ebf\u7684\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u4ea4\u6bd4\u7684\u503c\u4e0d\u53d8\u3002 \u5171\u70b9\u7ebf \u5171\u70b9\u7ebf\u662f\u76f4\u7ebf\u4e0a\u5171\u7ebf\u70b9\u7684\u5bf9\u5076\u3002\u8fd9\u610f\u5473\u7740\u5e73\u9762\u4e0a\u7684\u5171\u70b9\u7ebf\u4e5f\u6709\u51e0\u4f55 \\(IP^1\\) \u3002\u7279\u522b\u662f\uff0c\u4efb\u4f55\u56db\u6761\u5171\u70b9\u7ebf\u90fd\u6709\u4e00\u4e2a\u786e\u5b9a\u7684\u4ea4\u6bd4\u3002 \u4ece\u56fe\u50cf\u6062\u590d\u4eff\u5c04\u548c\u5ea6\u91cf\u6027\u8d28 \u00b6 \u2002\u2002\u5c04\u5f71\u77eb\u6b63\u7684\u76ee\u7684\u662f\u6d88\u9664\u5e73\u9762\u7684\u900f\u89c6\u56fe\u50cf\u4e2d\u7684\u5c04\u5f71\u5931\u771f\uff0c\u4f7f\u5f97\u539f\u59cb\u5e73\u9762\u7684\u76f8\u4f3c\u6027\u8d28\uff08\u89d2\u5ea6\u3001\u957f\u5ea6\u6bd4\uff09\u53ef\u4ee5\u88ab\u6d4b\u91cf\u3002 \u65e0\u7a77\u8fdc\u7ebf \u00b6 \u2002\u2002\u5728\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u7406\u60f3\u70b9\u53ef\u4ee5\u6620\u5c04\u4e3a\u6709\u9650\u70b9\uff0c\u56e0\u800c \\(I_{\\infty}\\) \u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\u3002\u4f46\u5982\u679c\u662f\u4eff\u5c04\u53d8\u6362\uff0c \\(I_{\\infty}\\) \u4e0d\u4f1a\u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\uff0c\u5373\u4ecd\u7559\u5728\u65e0\u7a77\u8fdc\u5904\uff0c\u663e\u7136\uff0c\u5b83\u53ef\u76f4\u63a5\u7531\u76f4\u7ebf\u7684\u53d8\u6362\u63a8\u51fa\uff1a \\[ I_{\\infty}^\\prime = H_A^{-T}I_{\\infty} = \\begin{bmatrix} A^{-T} & \\mathbf{0} \\\\ -\\mathbf{t}^{\\top}A^{-T} & 1 \\end{bmatrix} \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = I_\\infty \\] \u7ed3\u8bba1 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u76f4\u7ebf \\(I_{\\infty}\\) \u4e3a\u4e0d\u52a8\u76f4\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4eff\u5c04\u53d8\u6362\u3002 \u2002\u2002\u5728\u5e73\u9762\u7684\u50cf\u4e2d\uff0c\u4e00\u4f46\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u5f97\u5230\u8fa8\u8ba4\uff0c\u5c31\u6709\u53ef\u80fd\u5bf9\u539f\u5e73\u9762\u8fdb\u884c\u4eff\u5c04\u6d4b\u91cf\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u76f4\u63a5\u628a\u5df2\u8fa8\u8ba4\u7684 \\(I_\\infty\\) \u53d8\u6362\u5230\u5b83\u7684\u89c4\u8303\u4f4d\u7f6e \\(I_\\infty = (0,0,1)^{\\top}\\) \u3002\u628a\u5b9e\u73b0\u6b64\u53d8\u6362\u7684(\u5c04\u5f71)\u77e9\u9635\u5e94\u7528\u4e8e\u56fe\u50cf\u4e2d\u7684\u6bcf\u4e00\u70b9\u4ee5\u8fbe\u5230\u5bf9\u56fe\u50cf\u8fdb\u884c\u4eff\u5c04\u77eb\u6b63\u7684\u76ee\u7684\uff0c\u5373\u53d8\u6362\u4e4b\u540e\uff0c\u4eff\u5c04\u6d4b\u91cf\u53ef\u4ee5\u76f4\u63a5\u5728\u77eb\u6b63\u8fc7\u7684\u56fe\u50cf\u4e2d\u8fdb\u884c\u3002 \u2002\u2002\u5982\u679c\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u662f \\(\\mathbf{I} = (l_1, l_2, l_3)^{\\top}\\) \uff0c\u5047\u5b9a \\(l_3 \\ne 0\\) \uff0c\u90a3\u4e48\u628a \\(\\mathbf{l}\\) \u6620\u5c04\u56de \\(l_\\infty = (0,0,1)^{\\top}\\) \u7684\u4e00\u4e2a\u5408\u9002\u7684\u5c04\u5f71\u70b9\u4ea4\u6362\u662f \\[ H=H_A \\begin{bmatrix} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ l_1 & l_2 & l_3 \\end{bmatrix} \\] \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4 \u7ed9\u5b9a\u4e00\u4e2a\u76f4\u7ebf\u4e0a\u6709\u5df2\u77e5\u957f\u5ea6\u6bd4\u7684\u4e24\u4e2a\u7ebf\u6bb5\uff0c\u8be5\u76f4\u7ebf\u4e0a\u7684\u65e0\u7a77\u8fdc\u70b9\u4fbf\u53ef\u4ee5\u786e\u5b9a\u3002 \u865a\u5706\u70b9\u53ca\u5176\u5bf9\u5076 \u00b6 \u865a\u5706\u70b9 \u6bcf\u4e00\u5706\u5468\u4e0e \\(l_\\infty\\) \u76f8\u4ea4\u7684\u70b9\u79f0\u4e3a\u865a\u5706\u70b9\u3002 \u8bc1\u660e \u5728\u4e8c\u6b21\u66f2\u7ebf\u4e3a\u5706\u6709 \\(a=c\\) \u4e14 \\(b=0\\) \u3002\u53d6 \\(a=1\\) \u5219\uff1a \\[x_1^2+x_2^2+dx_1x_3+ex_2x_3=fx_3^2=0\\] \u8be5\u4e8c\u6b21\u66f2\u7ebf\u76f8\u4ea4\u4e8e \\(l_\\infty\\) \u4e8e(\u7406\u60f3)\u70b9( \\(x_3=0\\) )\uff1a \\[x_1^2+x_2^2=0\\] \u89e3\u5f97\u865a\u5706\u70b9\u7684\u6807\u51c6\u5750\u6807\u662f \\(\\mathbf{I}=(1,i,0)^{\\top}, \\; \\mathbf{J}=(1, -i, 0)^{\\top}\\) \u3002 \u8fd9\u4e00\u5bf9\u865a\u5706\u70b9\u662f\u590d\u5171\u8f6d\u7406\u60f3\u70b9\uff0c\u5b83\u4eec\u5728\u4fdd\u5411\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\uff1a \\[ \\mathbf{I}^\\prime = H_S\\mathbf{I} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = se^{-i \\theta} \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = \\mathbf{I} \\] \u7ed3\u8bba2 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u865a\u5706\u70b9 \\(I\\) \u548c \\(J\\) \u4e3a\u4e0d\u52a8\u70b9\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362\u3002 \u2002\u2002\u4efb\u4f55\u5706\u90fd\u4ea4 \\(\\mathbf{I}_\\infty\\) \u4e8e\u865a\u5706\u70b9 . \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\u4e00\u4e2a\u5706\u7531\u4e09\u70b9\u6307\u5b9a.\u865a\u5706\u70b9\u5f15\u51fa\u53e6 \u4e00\u79cd\u8ba1\u7b97.\u5706\u53ef\u4ee5\u7528\u7531\u4e94\u4e2a\u70b9\u5b9a\u4e49\u7684\u4e00\u822c\u4e8c\u6b21\u66f2\u7ebf\u7684\u516c\u5f0f\uff08\u4e09\u4e2a\u70b9\u52a0\u4e24\u4e2a\u865a\u5706\u70b9\uff09\u3002\u865a\u5706\u70b9\u662f\u628a\u6b27\u6c0f\u51e0\u4f55\u4e2d\u7684\u4e24\u6b63\u4ea4\u65b9\u5411\u5408\u5e76\u5230\u4e00\u4e2a\u590d\u5171\u8f6d\u4e2d\uff0c\u5373 \\[\\mathbf{I}=(1,0,0)^{\\top} + i(0,1,0)^{\\top}\\] \u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf \\[C_{\\infty}^* = \\mathbf{I}\\mathbf{J}^{\\top}+\\mathbf{J}\\mathbf{I}^{\\top}\\] \u7ed3\u8bba3 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_{\\infty}^*\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\u4e0d\u53d8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u76f8\u4f3c\u53d8\u6362\u3002 \u6b64\u5916\uff0c\u5728\u4efb\u4f55\u5c04\u5f71\u6846\u67b6\u4e0b\uff0c \\(C_{\\infty}^*\\) \u5177\u6709\u4e00\u4e9b\u6027\u8d28\uff1a \\(C_{\\infty}^*\\) \u6709 \\(4\\) \u4e2a\u81ea\u7531\u5ea6 \\(\\mathbf{I}_\\infty\\) \u662f \\(C_{\\infty}^*\\) \u7684\u96f6\u77e2\u91cf \u5c04\u5f71\u5e73\u9762\u4e0a\u7684\u5939\u89d2 \u00b6 \u2002\u2002\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e24\u7ebf\u95f4\u7684\u5939\u89d2\u7531\u5b83\u4eec\u6cd5\u7ebf\u7684\u70b9\u4e58\u6765\u8ba1\u7b97\u3002\u76f4\u7ebf \\(\\mathbf{I}=(l_1, l_2, l_3)^{\\top}\\) \u548c \\(\\mathbf{m}=(m_1, m_2, m_3)^{\\top}\\) \u7684\u6cd5\u7ebf\u5206\u522b\u5e73\u884c\u4e8e \\((l_1, l_2)^{\\top}\\) \\((m_1, m_2)^{\\top}\\) \uff0c\u5176\u5939\u89d2\u4e3a \\[\\cos \\theta = \\frac{l_1m_1+l_2m_2}{\\sqrt{(l_1^2+l_2^2)(m_1^2+m_2^2)}}\\] \u5728\u5c04\u5f71\u53d8\u6362\u4e0b\u4e0d\u53d8\u7684\u516c\u5f0f\u4e3a: \\[\\cos \\theta = \\frac{\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}}{\\sqrt{(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{I})(\\mathbf{m}^{\\top}C_{\\infty}^*\\mathbf{m})}}\\] \u5176\u4e2d \\(C_\\infty^*\\) \u662f\u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002 \u7ed3\u8bba4 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u6b27\u6c0f\u89d2\u53ef\u4ee5\u6d4b\u91cf\u3002 \u7ed3\u8bba5 \u5982\u679c \\(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}=\\mathbf{0}\\) \uff0c\u5219\u76f4\u7ebf \\(l\\) \u548c \\(m\\) \u6b63\u4ea4\u3002 \u7ed3\u8bba6 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u957f\u5ea6\u6bd4\u540c\u6837\u53ef\u4ee5\u6d4b\u91cf\u3002 \u7531\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28 \u00b6 \u2002\u2002\u628a\u865a\u5706\u70b9\u53d8\u6362\u5230\u5b83\u4eec\u7684\u6807\u51c6\u4f4d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u7531\u5e73\u9762\u7684\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28\u3002\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u200b\u51e0\u4e4e\u5305\u542b\u4e86\u5b9e\u73b0\u5ea6\u91cf\u77eb\u6b63\u6240\u9700\u7684\u5168\u90e8\u4fe1\u606f\u3002\u5b83\u80fd\u786e\u5b9a\u5c04\u5f71\u53d8\u6362\u4e2d\u7684\u4eff\u5c04\u548c\u5c04\u5f71\u6210\u5206\uff0c\u800c\u53ea\u7559\u4e0b\u76f8\u4f3c\u53d8\u6362\u7684\u5931\u771f\u3002 \u7ed3\u8bba7 \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\uff0c\u4e00\u65e6 \\(C_\\infty^*\\) \u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u5c04\u5f71\u5931\u771f\u53ef\u4ee5\u77eb\u6b63\u5230\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u5176\u4ed6\u6027\u8d28 \u00b6 \u6781\u70b9-\u6781\u7ebf\u5173\u7cfb \u00b6 \u2002\u2002\u70b9 \\(\\mathbf{x}\\) \u548c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5b9a\u4e49\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \uff0c \\(\\mathbf{l}\\) \u79f0\u4e3a \\(\\mathbf{x}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u7ebf \uff0c\u800c\u70b9 \\(\\mathbf{x}\\) \u79f0\u4e3a \\(\\mathbf{l}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u70b9 \u3002 \u70b9 \\(\\mathbf{x}\\) \u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4ea4\u4e8e\u4e24\u70b9\u3002 \\(C\\) \u7684\u8fc7\u8fd9\u4e24\u70b9\u7684\u4e24\u6761\u5207\u7ebf\u76f8\u4ea4\u4e8e \\(\\mathbf{x}\\) \u3002 \u5982\u679c\u70b9 \\(x\\) \u5728 \\(C\\) \u4e0a\uff0c\u5219\u5b83\u7684\u6781\u7ebf\u5c31\u662f\u4e8c\u6b21\u66f2\u7ebf\u8fc7 \\(x\\) \u70b9\u7684\u5207\u7ebf\u3002 \u5bf9\u5c04 \u5b9a\u4e49 \uff1a\u5bf9\u5c04\u662f \\(IP^2\\) \u70b9\u5230 \\(IP^2\\) \u7ebf\u7684\u53ef\u9006\u6620\u5c04\u3002\u5e76\u7528\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(A\\) \u8868\u793a\u4e3a \\(\\mathbf{l}=A\\mathbf{x}\\) \u3002 \u5171\u8f6d\u70b9 \uff1a\u5982\u679c\u70b9 \\(y\\) \u5728\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4e0a\uff0c\u5219 \\(\\mathbf{y}^{\\top}\\mathbf{l}=\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u3002\u6ee1\u8db3 \\(\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u7684\u4efb\u4f55\u4e24\u70b9 \\(x,y\\) \u79f0\u4e3a\u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5171\u8f6d\u3002 \u5982\u679c \\(\\mathbf{x}\\) \u5728 \\(\\mathbf{y}\\) \u7684\u6781\u7ebf\u4e0a\uff0c\u90a3\u4e48 \\(\\mathbf{y}\\) \u4e5f\u5728 \\(\\mathbf{x}\\) \u7684\u6781\u7ebf\u4e0a\u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u5206\u7c7b \u00b6 \u4e8c\u6b21\u66f2\u7ebf\u7684\u5c04\u5f71\u6807\u51c6\u5f62\u5f0f \u00b6 \u2002\u2002\u4efb\u4f55\u4e8c\u6b21\u66f2\u7ebf\u90fd\u5c04\u5f71\u7b49\u4ef7\u4e8e\u4e00\u4e2a\u7531\u5bf9\u89d2\u77e9\u9635\u8868\u793a\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e8c\u6b21\u66f2\u7ebf \\(D\\) \u6700\u7ec8\u88ab\u8868\u793a\u4e3a\u5177\u6709\u77e9\u9635 \\(diag(\\varepsilon_1, \\varepsilon_2, \\varepsilon_3)\\) \u7684\u4e8c\u6b21\u66f2\u7ebf\uff0c\u5176\u4e2d \\(\\varepsilon_i=\\pm 1\\) \u6216 \\(0\\) \u3002 \u5bf9\u89d2\u7ebf \u65b9\u7a0b \u4e8c\u6b21\u66f2\u7ebf\u7c7b\u578b \\((1,1,1)\\) \\(x^2+y^2+w^2=0\\) \u5047\u4e8c\u6b21\u66f2\u7ebf--\u65e0\u5b9e\u70b9 \\((1,1,-1)\\) \\(x^2+y^2-w^2=0\\) \u5706 \\((1,1,0)\\) \\(x^2+y^2=0\\) \u5355\u4e2a\u5b9e\u70b9 \\((0,0,1)^{\\top}\\) \\((1,-1,0)\\) \\(x^2-y^2=0\\) \u4e24\u6761\u76f4\u7ebf \\(x=\\pm y\\) \\((1,0,0)\\) \\(x^2=0\\) \u5355\u6761\u76f4\u7ebf \\(x=0\\) \u8ba1\u4e24\u6b21 \u4e8c\u6b21\u66f2\u7ebf\u7684\u4eff\u5c04\u5206\u7c7b \u00b6 \u2002\u2002\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c(\u975e\u9000\u5316\u6216\u771f)\u4e8c\u6b21\u66f2\u7ebf\u53ef\u4ee5\u5206\u4e3a\u53cc\u66f2\u7ebf\u3001\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002\u5728\u5c04\u5f71\u51e0\u4f55\u4e2d\u4e09\u79cd\u7c7b\u578b\u7684\u4e8c\u6b21\u66f2\u7ebf\u4e0e \\(l_\\infty\\) \u7684\u5173\u7cfb\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u4e0a\u56fe\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u662f \\((a)\\) \u692d\u5706\uff0c \\((b)\\) \u629b\u7269\u7ebf\uff0c \\((c)\\) \u53cc\u66f2\u7ebf\u3002\u5b83\u4eec\u4e0e \\(l_{\\infty}\\) \u7684\u5173\u7cfb : \\((a)\\) \u65e0\u5b9e\u4ea4\u70b9\u3001 \\((b)\\) \u76f8\u5207( \\(2\\) \u70b9\u63a5\u89e6)\u3001 \\((c)\\) \u6709 \\(2\\) \u4e2a\u5b9e\u4ea4\u70b9\u3002 \u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf \u00b6 \u2002\u2002\u53d8\u6362\u7684\u4e00\u4e2a \u7279\u5f81\u77e2\u91cf \u5bf9\u5e94\u4e00\u4e2a \u4e0d\u52a8\u70b9 \uff0c\u56e0\u4e3a\u5bf9\u4e8e\u7279\u5f81\u503c \\(\\lambda\\) \u53ca\u5176\u5bf9\u5e94\u7684\u7279\u5f81\u77e2\u91cf \\(e\\) \u6709: \\[H\\mathbf{e} = \\lambda \\mathbf{e}\\] \u2002\u2002\u800c \\(\\mathbf{e}\\) \u548c \\(\\lambda \\mathbf{e}\\) \u8868\u793a\u540c\u4e00\u70b9\u3002\u7c7b\u4f3c\u7684\u63a8\u5bfc\u53ef\u4ee5\u7528\u4e8e\u4e0d\u52a8\u76f4\u7ebf\uff0c\u5b83\u5bf9\u5e94\u4e8e \\(H^{\\top}\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u7684\u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf \u8fd9\u91cc\u6709\u4e09\u4e2a\u4e0d\u52a8\u70b9\u548c\u8fc7\u8fd9\u4e09\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf.\u4e0d\u52a8\u76f4\u7ebf\u548c\u4e0d\u52a8\u70b9\u53ef\u80fd\u662f\u590d\u7684\uff1a\u4ece\u4ee3\u6570\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u4e0d\u52a8\u70b9\u662f\u70b9\u53d8\u6362 \\((\\mathbf{x}^\\prime=H\\mathbf{x})\\) \u7684\u7279\u5f81\u77e2\u91cf \\(\\mathbf{e}_i\\) \uff0c\u800c\u4e0d\u52a8\u76f4\u7ebf\u662f\u7ebf\u53d8\u6362 \\((\\mathbf{l}^\\prime =H^{-T}\\mathbf{l})\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002\u6ce8\u610f\uff0c\u4e0d\u52a8\u76f4\u7ebf\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\uff1a\u5728\u53d8\u6362\u4e0b\uff0c\u76f4\u7ebf\u4e0a\u7684\u4e00\u70b9\u88ab\u6620\u4e3a\u5176\u4e0a\u7684\u53e6\u4e00\u70b9\uff0c\u53ea\u6709\u4e0d\u52a8\u70b9\u624d\u6620\u4e3a\u81ea\u8eab\u3002 \u6b27\u6c0f\u77e9\u9635 \u00b6 \u2002\u2002\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u662f\u865a\u5706\u70b9 \\(\\mathbf{I},\\mathbf{J}\\) \u7ec4\u6210\u7684\u590d\u5171\u8f6d\u5bf9\uff0c\u76f8\u5bf9\u5e94\u7684\u7279\u5f81\u503c\u662f \\(|e^{i \\theta}, e^{-i \\theta}|\\) \uff0c\u8fd9\u91cc \\(\\theta\\) \u662f\u65cb\u8f6c\u89d2\u3002\u5bf9\u5e94\u4e8e\u7279\u5f81\u503c \\(1\\) \u7684\u7b2c\u4e09\u4e2a\u7279\u5f81\u5411\u91cf\uff0c\u79f0\u4e3a \\(\u6781\u70b9\\) \u3002\u6b27\u6c0f\u53d8\u6362\u7b49\u4ef7\u4e8e\u7ed5\u8be5\u70b9\u8f6c \\(\\theta\\) \u89d2\u7684\u7eaf\u65cb\u8f6c\u5e76\u4e14\u6ca1\u6709\u5e73\u79fb\u3002 \u4e00\u79cd\u7279\u6b8a\u7684\u60c5\u8bc6\u662f\u7eaf\u5e73\u79fb(\u5373 \\(\\theta=0\\) )\u3002\u8fd9\u65f6\u7279\u5f81\u503c\u4e09\u91cd\u9000\u5316\uff0c\u8fd9\u662f\u7ea6\u675f\u900f\u89c6\u53d8\u6362\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002 \u76f8\u4f3c\u77e9\u9635 \u00b6 \u2002\u2002\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u4ecd\u662f\u865a\u5706\u70b9\u3002\u7279\u5f81\u503c\u662f \\(|1,se^{i \\theta}, se^{-i \\theta}|\\) \u3002\u76f8\u4f3c\u53d8\u6362\u7684\u4f5c\u7528\u53ef\u4ee5\u7406\u89e3\u4e3a\u7ed5\u5b83\u7684\u6709\u9650\u4e0d\u52a8\u70b9\u7684\u65cb\u8f6c\u548c\u53d6 \\(s\\) \u4e3a\u56e0\u5b50\u7684\u5747\u5300\u7f29\u653e\u3002\u6ce8\u610f\u865a\u5706\u70b9\u7684\u7279\u5f81\u503c\u4ecd\u7136\u8868\u5f81\u65cb\u8f6c\u89d2\u3002 \u4eff\u5c04\u77e9\u9635 \u00b6 \u2002\u2002\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u53ef\u4ee5\u662f\u5b9e\u6216\u590d\u5171\u8f6d\u7684\uff0c\u4f46\u5728\u4efb\u4f55\u4e00\u79cd\u60c5\u51b5\u4e0b\uff0c\u8fc7\u8fd9\u4e9b\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf \\(\\mathbf{l}_\\infty=(0,0,1)^{\\top}\\) \u662f\u5b9e\u7684\u3002","title":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#2d","text":"\u7ea6 4639 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecdMVG\u6240\u5fc5\u987b\u7684\u51e0\u4f55\u6982\u5ff5\u548c\u7b26\u53f7\uff0c\u5177\u4f53\u6db5\u76d6\u5e73\u9762\u7684\u5c04\u5f71\u53d8\u6362\u51e0\u4f55","title":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_1","text":"","title":"\u5e73\u9762\u51e0\u4f55"},{"location":"cv/mvg/pjt2d/#2d_1","text":"","title":"2D \u5c04\u5f71\u5e73\u9762"},{"location":"cv/mvg/pjt2d/#_2","text":"\u76f4\u7ebf\u7684\u5176\u6b21\u8868\u793a \u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u65b9\u7a0b \\(ax+by+c=0\\) \u53ef\u4ee5\u7528\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u8868\u793a\u3002 \u5bf9\u4efb\u4f55\u975e\u96f6\u7684k\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u4e0e \\(k(a,b,c)^{\\top}\\) \u8868\u793a\u540c\u4e00\u76f4\u7ebf \u3002 \u70b9\u7684\u5176\u6b21\u8868\u793a \u4e00\u4e2a\u70b9\u7684\u4efb\u4f55\u9f50\u6b21\u77e2\u91cf\u7684\u8868\u793a\u5f62\u5f0f\u4e3a \\(x=(x_1,x_2,x_3)^{\\top}\\) \uff0c\u975e\u9f50\u6b21\u5750\u6807 \\(x=(\\frac{x_1}{x_3}, \\frac{x_2}{x_3})^{\\top}\\) \u3002 \u7ed3\u8bba1 \u70b9 \\(x\\) \u5728\u76f4\u7ebf \\(l\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(x^{\\top}l=0\\) \u3002 \\(x^{\\top}l = l^{\\top}x = x \\cdot l = 0\\) \u3002 \u7ed3\u8bba2 \u4e24\u76f4\u7ebf \\(l\\) \u548c \\(l^{\\prime}\\) \u7684\u4ea4\u70b9\u662f\u70b9 \\(x=l \\times l^{\\prime}\\) \u3002 \u53c9\u4e58 \\[c = a \\times b = (a.y * b.z - b.y * a.z, \\quad b.x * a.z - a.x * b.z, \\quad a.x * b.y - b.x * a.y)\\] \u7ed3\u8bba3 \u8fc7\u4e24\u70b9 \\(x\\) \u548c \\(x^{\\prime}\\) \u7684\u76f4\u7ebf\u662f \\(l = x \\times x^{\\prime}\\) \u3002 \u5e73\u884c\u7ebf\u7684\u4ea4\u70b9 \u4e24\u5e73\u884c\u76f4\u7ebf \\(ax+by+c=0\\) \u548c \\(ax+by+c^{\\prime}=0\\) \uff0c\u7531 \u7ed3\u8bba2 \u53ef\u5f97\u4ea4\u70b9 \\((b, -a, 0)^{\\top}\\) \u3002 \u7406\u60f3\u70b9\u548c\u65e0\u7a77\u8fdc\u7ebf \u5f53\u9f50\u6b21\u77e2\u91cf \\(x = (x_1, x_2, x_3)^{\\top}\\) \u4e2d\u7684 \\(x_3=0\\) \u65f6\u7684\u70b9\u88ab\u79f0\u4e3a \u7406\u60f3\u70b9 \uff0c\u6216 \u65e0\u7a77\u8fdc\u70b9 \u3002\u6240\u6709\u7406\u60f3\u70b9\u96c6\u5408\u5728\u4e00\u6761\u76f4\u7ebf\u4e0a\uff0c\u79f0 \u65e0\u7a77\u8fdc\u7ebf \uff0c\u7528 \\(I_{\\infty}=(0,0,1)^{\\top}\\) \u8868\u793a\u3002 \u5c04\u5f71\u5e73\u9762\u6a21\u578b \\(IP^2\\) \u7684\u70b9\u548c\u7ebf\u5206\u522b\u4e3a\u4e2d\u8fc7\u539f\u70b9\u7684\u5c04\u7ebf\u548c\u5e73\u9762 \\(x_1x_2\\) \u5e73\u9762\u4e0a\u7684\u5c04\u7ebf\u8868\u793a\u7406\u60f3\u70b9\uff0c\u800c \\(x_1x_2\\) \u5e73\u9762\u8868\u793a \\(I_{\\infty}\\) \u3002 \u7ed3\u8bba4\uff08\u5bf9\u5076\u539f\u7406\uff09 2\u7ef4\u5c04\u5f71\u51e0\u4f55\u4e2d\u7684\u4efb\u4f55\u5b9a\u7406\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u5bf9\u5076\u5b9a\u7406\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u4e92\u6362\u539f\u5b9a\u7406\u4e2d\u70b9\u548c\u7ebf\u7684\u4f5c\u7528\u800c\u5bfc\u51fa\u3002","title":"\u70b9\u4e0e\u76f4\u7ebf"},{"location":"cv/mvg/pjt2d/#_3","text":"\u4e8c\u6b21\u66f2\u7ebf \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b: \u53cc\u66f2\u7ebf\uff0c\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002 \u5728\u975e\u9f50\u6b21\u5750\u6807\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u7684\u65b9\u7a0b\u662f \\[ax^2+bxy+cy^2+dx+ey+f=0\\] \u901a\u8fc7\u66ff\u4ee3 \\(x\\to\\frac{x_1}{x_3}\\) \uff0c \\(y\\to\\frac{x_2}{x_3}\\) \uff0c\u5f97\u5230\uff1a \\[ax_1^2+bx_1x_2+cx_2^2+dx_1x_3+ex_2x_3+fx_3^2=0\\] \u8868\u793a\u6210\u77e9\u9635\u5f62\u5f0f\u4e3a \\(x^{\\top}Cx=0\\) \u5176\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u7cfb\u6570\u77e9\u9635 \\(C\\) \u4e3a \\[ C = \\left[ \\begin{matrix} a & b/2 & d/2 \\\\ b/2 & c & e/2 \\\\ d/2 & e/2 & f \\end{matrix} \\right] \\] \u7ed3\u8bba5 \u8fc7(\u975e\u9000\u5316)\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u4e0a\u70b9 \\(x\\) \u7684\u5207\u7ebf \\(l\\) \u7531 \\(l=Cx\\) \u786e\u5b9a\u3002 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \u4e0a\u9762\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u66f4\u786e\u5207\u5730\u5e94\u79f0\u4e3a\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u56e0\u4e3a\u5b83\u5b9a\u4e49\u7684\u662f\u70b9\u7684\u65b9\u7a0b\u3002\u540c\u65f6\u8fd9\u79cd \u5bf9\u5076 \uff08\u6216\u7ebf\uff09\u4e8c\u6b21\u66f2\u7ebf\u4e5f\u7531\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u8868\u793a\uff0c\u6211\u4eec\u628a\u5b83\u8bb0\u4e3a \\(C^*\\) \uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u5207\u7ebf \\(l\\) \u6ee1\u8db3 \\(l^{\\top}C^*l=0\\) \u3002\u5176\u4e2d \\(C^*\\) \u8868\u793a\u4e3a \\(C\\) \u7684\u4f34\u968f\u77e9\u9635\u3002 \u9000\u5316\u4e8c\u6b21\u66f2\u7ebf \u975e\u6ee1\u79e9\u77e9\u9635 \\(C\\) \u6240\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4f5c\u9000\u5316\u4e8c\u6b21\u66f2\u7ebf\u3002\u9000\u5316\u7684\u70b9\u4e8c\u6b21\u66f2\u7ebf\u5305\u542b\u4e24\u6761\u7ebf(\u79e9 2) \u6216\u4e00\u6761\u91cd\u7ebf(\u79e9 1) \u3002","title":"\u4e8c\u6b21\u66f2\u7ebf\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf"},{"location":"cv/mvg/pjt2d/#_4","text":"\u5c04\u5f71\u6620\u5c04 \u5c04\u5f71\u6620\u5c04 \u662f \\(IP^2\\) \u5230\u5b83\u81ea\u8eab\u7684\u4e00\u79cd\u6ee1\u8db3\u4e0b\u5217\u6761\u4ef6\u7684\u53ef\u9006\u6620\u5c04 \\(h\\) \uff1a\u4e09\u70b9 \\(x_1\\) , \\(x_2\\) \u548c \\(x_3\\) \u5171\u7ebf\u5f53\u4e14\u4ec5\u5f53 \\(h(x_1)\\) , \\(h(x_2)\\) , \\(h(x_3)\\) \u4e5f\u5171\u7ebf\u3002 \u5c04\u5f71\u6620\u5c04\u4e5f\u79f0\u4e3a\u4fdd\u7ebf\u53d8\u6362 \uff0c\u6216\u5c04\u5f71\u53d8\u6362\u6216\u5355\u5e94 (homography) \u3002 \u5b9a\u74061 \u6620\u5c04 \\(h\\) \uff1a \\(IP^2 \\to IP^2\\) \u662f\u5c04\u5f71\u6620\u5c04\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b58\u5728\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(H\\) \uff0c\u4f7f\u5f97 \\(IP^2\\) \u7684\u4efb\u4f55\u4e00\u4e2a\u7528\u77e2\u91cf \\(x\\) \u8868\u793a\u7684\u70b9\u90fd\u6ee1\u8db3 \\(h(x)=Hx\\) \u3002 \u5c04\u5f71\u53d8\u6362 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u662f\u5173\u4e8e\u9f50\u6b213\u7ef4\u77e2\u91cf\u7684\u4e00\u79cd\u7ebf\u6027\u53d8\u6362\uff0c\u5e76\u53ef\u7528\u4e00\u4e2a\u975e\u5947\u5f02 \\(3 \\times 3\\) \u77e9\u9635 \\(H\\) \u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x_1^\\prime \\\\ x_2^\\prime\\\\ x_3^\\prime \\end{pmatrix} = \\left[ \\begin{matrix} h_{11} & h_{12} & h_{13} \\\\ h_{21} & h_{22} & h_{23} \\\\ h_{31} & h_{32} & h_{33} \\end{matrix} \\right] \\begin{pmatrix} x_1 \\\\ x_2\\\\ x_3 \\end{pmatrix} \\] \u6216\u66f4\u7b80\u6d01\u5730\u8868\u793a\u4e3a \\(x^\\prime = Hx\\) \u3002","title":"\u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_5","text":"\u76f4\u7ebf\u7684\u53d8\u6362 \\[l^\\prime = H^{-T}l\\] \u4e5f\u53ef\u4ee5\u5199\u6210 \\(l^{\\prime T}=l^{\\top}H^{-1}\\) \u3002\u76f4\u7ebf\u548c\u70b9\u53d8\u6362\u7684\u57fa\u672c\u533a\u522b\u5728\u4e8e\u70b9\u53d8\u6362\u4f9d\u636e \\(H\\) \uff0c\u800c\u76f4\u7ebf\uff08\u89c6\u4e3a\u884c\u77e2\u91cf\uff09\u53d8\u6362\u5219\u4f9d\u636e \\(H^{-1}\\) \u3002\u79f0\u70b9\u53d8\u6362\u4e3a \u9006\u53d8 \u800c\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c \\(x^{\\top}Cx = x^{\\prime T}[H^{-1}]^{\\top}CH^{-1}x^\\prime = x^{\\prime T} H^{-T}CH^{-1} x^{\\prime}\\) \u3002 \u7ed3\u8bba1 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53d8\u6362\u4e3a \\(C^\\prime = H^{-T}CH^{-1}\\) \u3002\uff08\u56e0\u4e3a\u5b58\u5728 \\(H^{-1}\\) \uff0c\u6240\u4ee5\u79f0\u4e8c\u6b21\u66f2\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \uff09 \u8bc1\u660e \\[ x^{\\top}Cx = (H^{-1}x^\\prime)^{\\top} C (H^{-1}x^\\prime) = x^{\\prime T} (H^{-T}CH^{-1}) x^\\prime \\] \u7ed3\u8bba2 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C^*\\) \u53d8\u6362\u4e3a \\(C^{*\\prime} = HC^* H^{\\top}\\) \u3002 \u8bc1\u660e \\[ l^{\\top}C^*l = (H^{\\top}l)^{\\top}C^*(H^{\\top}l)=l^{\\top}HC^*H^{\\top}l \\]","title":"\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_6","text":"\u7531 \\(n \\times n\\) \u53ef\u9006\u5b9e\u77e9\u9635\u7684\u7fa4\u79f0\u4e3a\uff08\u5b9e\u7684\uff09\u4e00\u822c\u7ebf\u6027\u7fa4\u6216 \\(GL(n)\\) \u3002\u5f53\uff0c \u628a\u76f8\u5dee\u975e\u96f6\u7eaf\u9760\u56e0\u5b50\u7684\u77e9\u9635\u90fd\u89c6\u4e3a\u7b49\u540c\u65f6\uff0c\u4fbf\u5f97\u5230\u5c04\u5f71\u7ebf\u6027\u7fa4\uff0c\u8bb0\u4e3a \\(PL(n)\\) (\u5b83\u662f \\(GL(n)\\) \u7684\u5546\u7fa4)\u3002\u5728\u5e73\u9762\u5c04\u5f71\u53d8\u6362\u65f6\uff0c \\(n=3\\) \u3002","title":"\u53d8\u6362\u7684\u5c42\u6b21"},{"location":"cv/mvg/pjt2d/#_7","text":"\u7b49\u8ddd(isometric)\u53d8\u6362\u662f\u5e73\u9762 \\(IR^2\\) \u7684\u53d8\u6362\uff0c\u4fdd\u6301\u6b27\u5f0f\u8ddd\u79bb\u4e0d\u53d8\uff0c\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u53ef\u8868\u793a\u4e3a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} \\varepsilon \\cos \\theta & -\\sin \\theta & t_x \\\\ \\varepsilon \\sin \\theta & \\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u5176\u4e2d \\(\\varepsilon = \\pm 1\\) \u3002\u5982\u679c \\(\\varepsilon = 1\\) \u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u4fdd\u5411\u7684 \u5e76\u4e14\u4e5f\u662f \u6b27\u6c0f \u53d8\u6362\uff08\u5e73\u79fb\u548c\u65cb\u8f6c\u7684\u590d\u5408\uff09\u3002\u5982\u679c \\(\\varepsilon = -1\\) \uff0c\u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u9006\u5411\u7684 \u3002 \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_E \\mathbf{x} = \\left[ \\begin{matrix} R & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u65cb\u8f6c\u4e00\u4e2a\uff0c\u5e73\u79fb\u4e8c\u4e2a\u3002 \u4e0d\u53d8\u91cf \uff1a\u957f\u5ea6(\u4e24\u70b9\u7684\u8ddd\u79bb)\uff0c\u89d2\u5ea6(\u4e24\u7ebf\u7684\u5939\u89d2)\u548c\u9762\u804c\u3002 \u7fa4\u548c\u5b9a\u5411 \u2003\u4fdd\u5411\u7684\u7b49\u8ddd\u53d8\u6362\u5f62\u6210\u4e00\u4e2a\u7fa4\uff0c\u4f46\u9006\u5411\u7684\u4e0d\u662f\u3002\u8fd9\u79cd\u533a\u522b\u5bf9\u4e8e\u4e0b\u9762\u7684\u76f8\u4f3c\u548c\u4eff\u5c04\u53d8\u6362\u540c\u6837\u5982\u6b64\u3002","title":"\u7b49\u8ddd\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_8","text":"\u76f8\u4f3c\u53d8\u6362\u662f\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u4e0e\u4e00\u4e2a\u5747\u5300\u7f29\u653e\u7684\u590d\u5408\u3002\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_S \\mathbf{x} = \\left[ \\begin{matrix} sR & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u4e0d\u53d8\u91cf \uff1a\u76f4\u7ebf\u7684\u5939\u89d2\uff0c\u4e24\u957f\u5ea6\u7684\u6bd4\u7387\u548c\u9762\u79ef\u7684\u6bd4\u7387\u3002","title":"\u76f8\u4f3c\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_9","text":"\u4eff\u5c04\u53d8\u6362\u662f\u4e00\u4e2a\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\u4e0e\u4e00\u4e2a\u5e73\u79fb\u53d8\u6362\u7684\u590d\u5408\uff0c\u5b83\u7684\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} a_{11} & a_{12} & t_x \\\\ a_{21} & a_{22} & t_y \\\\ 0 & 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y \\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_A \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u4eff\u5c04\u53d8\u6362\u6709\u516d\u81ea\u7531\u5ea6\uff0c\u53ef\u4ee5\u7531\u4e09\u7ec4\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u3002 \u4e0d\u53d8\u91cf \uff1a\u5e73\u884c\u7ebf\uff0c\u5e73\u884c\u7ebf\u6bb5\u7684\u957f\u5ea6\u6bd4\u548c\u9762\u79ef\u6bd4\u3002","title":"\u4eff\u5c04\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_10","text":"\u5b83\u662f\u9f50\u6b21\u5750\u6807\u7684\u4e00\u822c\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\uff0c\u5176\u5206\u5757\u5f62\u5f0f\uff1a \\[ \\mathbf{x}^\\prime = H_P \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u5176\u4e2d \\(\\mathbf{v}=(v_1, v_2)^{\\top}\\) \u3002 \u2002\u2002\u5c04\u5f71\u53d8\u6362\u7531\u516b\u4e2a\u53c2\u6570\u786e\u5b9a\uff0c\u53ef\u7531\u56db\u7ec4\u70b9\u5bf9\u5e94\u7b97\u51fa\uff0c \u4f46\u5176\u4e2d\u5c5e\u4e8e\u5411\u4e00\u5e73\u9762\u7684\u4e09\u70b9\u5fc5\u4e0d\u5171\u7ebf\u3002 \u4e0d\u53d8\u91cf \uff1a\u6700\u57fa\u672c\u7684\u5c04\u5f71\u4e0d\u53d8\u91cf\u662f\u56db\u5171\u7ebf\u70b9\u7684\u4ea4\u6bd4\u3002","title":"\u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_11","text":"\u5c04\u5f71\u53d8\u6362\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e32\u53d8\u6362\u94fe\u7684\u590d\u5408\uff0c\u94fe\u4e2d\u7684\u6bcf\u4e2a\u77e9\u9635\u6bd4\u5b83\u524d\u9762\u7684\u4e00\u4e2a\u77e9\u9635\u6240\u8868\u793a\u7684\u53d8\u6362\u5c42\u6b21\u9ad8\u3002 \\[ H = H_SH_AH_P = \\left[ \\begin{matrix} sR & \\mathbf{t}/v \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} K & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\] \u5176\u4e2d \\(A=sRK+\\mathbf{tv}^{\\top}/v\\) \uff0c\u800c \\(K\\) \u662f\u6ee1\u8db3 \\(det\\ K=1\\) \u7684\u5f52\u4e00\u5316\u4e0a\u4e09\u89d2\u77e9\u9635\u3002\u5982\u679c \\(v \\ne 0\\) \u4e0a\u8ff0\u5206\u89e3\u662f\u6709\u6548\u7684\uff0c\u800c\u4e14\u5982\u679c \\(s\\) \u53d6\u6b63\u503c\uff0c\u5b83\u8fd8\u662f\u552f\u4e00\u7684\u3002 \u4e0d\u53d8\u91cf\u7684\u6570\u76ee \uff1a\u4e0e\u51fd\u6570\u65e0\u5173\u7684\u4e0d\u53d8\u91cf\u6570\u7b49\u4e8e\u6216\u5927\u4e8e\u914d\u7f6e\u7684\u81ea\u7531\u5ea6\u6570\u51cf\u53bb\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002","title":"\u5c04\u5f71\u53d8\u6362\u7684\u5206\u89e3"},{"location":"cv/mvg/pjt2d/#1d","text":"\u76f4\u7ebf\u4e0a\u7684\u70b9 \\(x\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a \\((x_1, x_2)^{\\top}\\) \uff0c\u800c \\((x_1, 0)^{\\top}\\) \u662f\u8be5\u76f4\u7ebf\u7684\u7406\u60f3\u70b9\u3002\u6211\u4eec\u5c06\u7528\u8bb0\u53f7 \\(\\mathbf{\\bar{x}}\\) \u8868\u793a \\(2\\) \u7ef4\u77e2\u91cf \\((x_1, x_2)^{\\top}\\) \u3002\u53ef\u7528\u9f50\u6b21\u77e9\u9635\u8868\u793a\uff1a \\[\\mathbf{\\bar{x}}^\\prime = H_{2 \\times 2} \\mathbf{\\bar{x}}\\]","title":"1D \u5c04\u5f71\u51e0\u4f55\u548c\u4ea4\u6bd4"},{"location":"cv/mvg/pjt2d/#_12","text":"\u4ea4\u6bd4\u662f \\(IP^1\\) \u7684\u57fa\u672c\u5c04\u5f71\u4e0d\u53d8\u91cf\u3002\u7ed9\u5b9a \\(4\\) \u4e2a\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \uff0c\u4ea4\u6bd4\u5b9a\u4e49\u4e3a \\[ Cross(\\mathbf{\\bar{x}_1},\\mathbf{\\bar{x}_2},\\mathbf{\\bar{x}_3},\\mathbf{\\bar{x}_4}) = \\frac{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_2}||\\mathbf{\\bar{x}_3}\\mathbf{\\bar{x}_4}|}{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_3}||\\mathbf{\\bar{x}_2}\\mathbf{\\bar{x}_4}|} \\] \u5176\u4e2d \\[ |\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}| =det \\begin{bmatrix} x_{i1} & x_{j1} \\\\ x_{i2} & x_{j2} \\end{bmatrix} \\] \u4ea4\u6bd4\u7684\u4e3b\u8981\u7279\u70b9 \u4ea4\u6bd4\u7684\u503c\u4e0e\u5404\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u6240\u7528\u7684\u5177\u4f53\u7684\u9f50\u6b21\u8868\u793a\u65e0\u5173\u3002 \u5982\u679c\u6bcf\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u90fd\u662f\u6709\u9650\u70b9\uff0c\u5e76\u4e14\u5728\u9f50\u6b21\u8868\u793a\u4e2d\u5747\u9009\u62e9 \\(x_2 = 1\\) \uff0c\u90a3\u4e48 \\(|\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}|\\) \u5c31\u8868\u793a\u7531 \\(\\mathbf{\\bar{x}_i}\\) \u5230 \\(\\mathbf{\\bar{x}_j}\\) \u7684\u5e26\u7b26\u53f7\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u4e2d\u6709\u4e00\u4e2a\u7406\u60f3\u70b9\uff0c\u4ea4\u6bd4\u7684\u5b9a\u4e49\u4ecd\u7136\u6709\u6548\u3002 \u5728\u4efb\u4f55\u76f4\u7ebf\u7684\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u4ea4\u6bd4\u7684\u503c\u4e0d\u53d8\u3002 \u5171\u70b9\u7ebf \u5171\u70b9\u7ebf\u662f\u76f4\u7ebf\u4e0a\u5171\u7ebf\u70b9\u7684\u5bf9\u5076\u3002\u8fd9\u610f\u5473\u7740\u5e73\u9762\u4e0a\u7684\u5171\u70b9\u7ebf\u4e5f\u6709\u51e0\u4f55 \\(IP^1\\) \u3002\u7279\u522b\u662f\uff0c\u4efb\u4f55\u56db\u6761\u5171\u70b9\u7ebf\u90fd\u6709\u4e00\u4e2a\u786e\u5b9a\u7684\u4ea4\u6bd4\u3002","title":"\u4ea4\u6bd4"},{"location":"cv/mvg/pjt2d/#_13","text":"\u5c04\u5f71\u77eb\u6b63\u7684\u76ee\u7684\u662f\u6d88\u9664\u5e73\u9762\u7684\u900f\u89c6\u56fe\u50cf\u4e2d\u7684\u5c04\u5f71\u5931\u771f\uff0c\u4f7f\u5f97\u539f\u59cb\u5e73\u9762\u7684\u76f8\u4f3c\u6027\u8d28\uff08\u89d2\u5ea6\u3001\u957f\u5ea6\u6bd4\uff09\u53ef\u4ee5\u88ab\u6d4b\u91cf\u3002","title":"\u4ece\u56fe\u50cf\u6062\u590d\u4eff\u5c04\u548c\u5ea6\u91cf\u6027\u8d28"},{"location":"cv/mvg/pjt2d/#_14","text":"\u5728\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u7406\u60f3\u70b9\u53ef\u4ee5\u6620\u5c04\u4e3a\u6709\u9650\u70b9\uff0c\u56e0\u800c \\(I_{\\infty}\\) \u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\u3002\u4f46\u5982\u679c\u662f\u4eff\u5c04\u53d8\u6362\uff0c \\(I_{\\infty}\\) \u4e0d\u4f1a\u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\uff0c\u5373\u4ecd\u7559\u5728\u65e0\u7a77\u8fdc\u5904\uff0c\u663e\u7136\uff0c\u5b83\u53ef\u76f4\u63a5\u7531\u76f4\u7ebf\u7684\u53d8\u6362\u63a8\u51fa\uff1a \\[ I_{\\infty}^\\prime = H_A^{-T}I_{\\infty} = \\begin{bmatrix} A^{-T} & \\mathbf{0} \\\\ -\\mathbf{t}^{\\top}A^{-T} & 1 \\end{bmatrix} \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = I_\\infty \\] \u7ed3\u8bba1 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u76f4\u7ebf \\(I_{\\infty}\\) \u4e3a\u4e0d\u52a8\u76f4\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4eff\u5c04\u53d8\u6362\u3002 \u2002\u2002\u5728\u5e73\u9762\u7684\u50cf\u4e2d\uff0c\u4e00\u4f46\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u5f97\u5230\u8fa8\u8ba4\uff0c\u5c31\u6709\u53ef\u80fd\u5bf9\u539f\u5e73\u9762\u8fdb\u884c\u4eff\u5c04\u6d4b\u91cf\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u76f4\u63a5\u628a\u5df2\u8fa8\u8ba4\u7684 \\(I_\\infty\\) \u53d8\u6362\u5230\u5b83\u7684\u89c4\u8303\u4f4d\u7f6e \\(I_\\infty = (0,0,1)^{\\top}\\) \u3002\u628a\u5b9e\u73b0\u6b64\u53d8\u6362\u7684(\u5c04\u5f71)\u77e9\u9635\u5e94\u7528\u4e8e\u56fe\u50cf\u4e2d\u7684\u6bcf\u4e00\u70b9\u4ee5\u8fbe\u5230\u5bf9\u56fe\u50cf\u8fdb\u884c\u4eff\u5c04\u77eb\u6b63\u7684\u76ee\u7684\uff0c\u5373\u53d8\u6362\u4e4b\u540e\uff0c\u4eff\u5c04\u6d4b\u91cf\u53ef\u4ee5\u76f4\u63a5\u5728\u77eb\u6b63\u8fc7\u7684\u56fe\u50cf\u4e2d\u8fdb\u884c\u3002 \u2002\u2002\u5982\u679c\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u662f \\(\\mathbf{I} = (l_1, l_2, l_3)^{\\top}\\) \uff0c\u5047\u5b9a \\(l_3 \\ne 0\\) \uff0c\u90a3\u4e48\u628a \\(\\mathbf{l}\\) \u6620\u5c04\u56de \\(l_\\infty = (0,0,1)^{\\top}\\) \u7684\u4e00\u4e2a\u5408\u9002\u7684\u5c04\u5f71\u70b9\u4ea4\u6362\u662f \\[ H=H_A \\begin{bmatrix} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ l_1 & l_2 & l_3 \\end{bmatrix} \\] \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4 \u7ed9\u5b9a\u4e00\u4e2a\u76f4\u7ebf\u4e0a\u6709\u5df2\u77e5\u957f\u5ea6\u6bd4\u7684\u4e24\u4e2a\u7ebf\u6bb5\uff0c\u8be5\u76f4\u7ebf\u4e0a\u7684\u65e0\u7a77\u8fdc\u70b9\u4fbf\u53ef\u4ee5\u786e\u5b9a\u3002","title":"\u65e0\u7a77\u8fdc\u7ebf"},{"location":"cv/mvg/pjt2d/#_15","text":"\u865a\u5706\u70b9 \u6bcf\u4e00\u5706\u5468\u4e0e \\(l_\\infty\\) \u76f8\u4ea4\u7684\u70b9\u79f0\u4e3a\u865a\u5706\u70b9\u3002 \u8bc1\u660e \u5728\u4e8c\u6b21\u66f2\u7ebf\u4e3a\u5706\u6709 \\(a=c\\) \u4e14 \\(b=0\\) \u3002\u53d6 \\(a=1\\) \u5219\uff1a \\[x_1^2+x_2^2+dx_1x_3+ex_2x_3=fx_3^2=0\\] \u8be5\u4e8c\u6b21\u66f2\u7ebf\u76f8\u4ea4\u4e8e \\(l_\\infty\\) \u4e8e(\u7406\u60f3)\u70b9( \\(x_3=0\\) )\uff1a \\[x_1^2+x_2^2=0\\] \u89e3\u5f97\u865a\u5706\u70b9\u7684\u6807\u51c6\u5750\u6807\u662f \\(\\mathbf{I}=(1,i,0)^{\\top}, \\; \\mathbf{J}=(1, -i, 0)^{\\top}\\) \u3002 \u8fd9\u4e00\u5bf9\u865a\u5706\u70b9\u662f\u590d\u5171\u8f6d\u7406\u60f3\u70b9\uff0c\u5b83\u4eec\u5728\u4fdd\u5411\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\uff1a \\[ \\mathbf{I}^\\prime = H_S\\mathbf{I} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = se^{-i \\theta} \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = \\mathbf{I} \\] \u7ed3\u8bba2 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u865a\u5706\u70b9 \\(I\\) \u548c \\(J\\) \u4e3a\u4e0d\u52a8\u70b9\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362\u3002 \u2002\u2002\u4efb\u4f55\u5706\u90fd\u4ea4 \\(\\mathbf{I}_\\infty\\) \u4e8e\u865a\u5706\u70b9 . \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\u4e00\u4e2a\u5706\u7531\u4e09\u70b9\u6307\u5b9a.\u865a\u5706\u70b9\u5f15\u51fa\u53e6 \u4e00\u79cd\u8ba1\u7b97.\u5706\u53ef\u4ee5\u7528\u7531\u4e94\u4e2a\u70b9\u5b9a\u4e49\u7684\u4e00\u822c\u4e8c\u6b21\u66f2\u7ebf\u7684\u516c\u5f0f\uff08\u4e09\u4e2a\u70b9\u52a0\u4e24\u4e2a\u865a\u5706\u70b9\uff09\u3002\u865a\u5706\u70b9\u662f\u628a\u6b27\u6c0f\u51e0\u4f55\u4e2d\u7684\u4e24\u6b63\u4ea4\u65b9\u5411\u5408\u5e76\u5230\u4e00\u4e2a\u590d\u5171\u8f6d\u4e2d\uff0c\u5373 \\[\\mathbf{I}=(1,0,0)^{\\top} + i(0,1,0)^{\\top}\\] \u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf \\[C_{\\infty}^* = \\mathbf{I}\\mathbf{J}^{\\top}+\\mathbf{J}\\mathbf{I}^{\\top}\\] \u7ed3\u8bba3 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_{\\infty}^*\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\u4e0d\u53d8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u76f8\u4f3c\u53d8\u6362\u3002 \u6b64\u5916\uff0c\u5728\u4efb\u4f55\u5c04\u5f71\u6846\u67b6\u4e0b\uff0c \\(C_{\\infty}^*\\) \u5177\u6709\u4e00\u4e9b\u6027\u8d28\uff1a \\(C_{\\infty}^*\\) \u6709 \\(4\\) \u4e2a\u81ea\u7531\u5ea6 \\(\\mathbf{I}_\\infty\\) \u662f \\(C_{\\infty}^*\\) \u7684\u96f6\u77e2\u91cf","title":"\u865a\u5706\u70b9\u53ca\u5176\u5bf9\u5076"},{"location":"cv/mvg/pjt2d/#_16","text":"\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e24\u7ebf\u95f4\u7684\u5939\u89d2\u7531\u5b83\u4eec\u6cd5\u7ebf\u7684\u70b9\u4e58\u6765\u8ba1\u7b97\u3002\u76f4\u7ebf \\(\\mathbf{I}=(l_1, l_2, l_3)^{\\top}\\) \u548c \\(\\mathbf{m}=(m_1, m_2, m_3)^{\\top}\\) \u7684\u6cd5\u7ebf\u5206\u522b\u5e73\u884c\u4e8e \\((l_1, l_2)^{\\top}\\) \\((m_1, m_2)^{\\top}\\) \uff0c\u5176\u5939\u89d2\u4e3a \\[\\cos \\theta = \\frac{l_1m_1+l_2m_2}{\\sqrt{(l_1^2+l_2^2)(m_1^2+m_2^2)}}\\] \u5728\u5c04\u5f71\u53d8\u6362\u4e0b\u4e0d\u53d8\u7684\u516c\u5f0f\u4e3a: \\[\\cos \\theta = \\frac{\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}}{\\sqrt{(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{I})(\\mathbf{m}^{\\top}C_{\\infty}^*\\mathbf{m})}}\\] \u5176\u4e2d \\(C_\\infty^*\\) \u662f\u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002 \u7ed3\u8bba4 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u6b27\u6c0f\u89d2\u53ef\u4ee5\u6d4b\u91cf\u3002 \u7ed3\u8bba5 \u5982\u679c \\(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}=\\mathbf{0}\\) \uff0c\u5219\u76f4\u7ebf \\(l\\) \u548c \\(m\\) \u6b63\u4ea4\u3002 \u7ed3\u8bba6 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u957f\u5ea6\u6bd4\u540c\u6837\u53ef\u4ee5\u6d4b\u91cf\u3002","title":"\u5c04\u5f71\u5e73\u9762\u4e0a\u7684\u5939\u89d2"},{"location":"cv/mvg/pjt2d/#_17","text":"\u628a\u865a\u5706\u70b9\u53d8\u6362\u5230\u5b83\u4eec\u7684\u6807\u51c6\u4f4d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u7531\u5e73\u9762\u7684\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28\u3002\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u200b\u51e0\u4e4e\u5305\u542b\u4e86\u5b9e\u73b0\u5ea6\u91cf\u77eb\u6b63\u6240\u9700\u7684\u5168\u90e8\u4fe1\u606f\u3002\u5b83\u80fd\u786e\u5b9a\u5c04\u5f71\u53d8\u6362\u4e2d\u7684\u4eff\u5c04\u548c\u5c04\u5f71\u6210\u5206\uff0c\u800c\u53ea\u7559\u4e0b\u76f8\u4f3c\u53d8\u6362\u7684\u5931\u771f\u3002 \u7ed3\u8bba7 \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\uff0c\u4e00\u65e6 \\(C_\\infty^*\\) \u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u5c04\u5f71\u5931\u771f\u53ef\u4ee5\u77eb\u6b63\u5230\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u3002","title":"\u7531\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28"},{"location":"cv/mvg/pjt2d/#_18","text":"","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u5176\u4ed6\u6027\u8d28"},{"location":"cv/mvg/pjt2d/#-","text":"\u70b9 \\(\\mathbf{x}\\) \u548c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5b9a\u4e49\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \uff0c \\(\\mathbf{l}\\) \u79f0\u4e3a \\(\\mathbf{x}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u7ebf \uff0c\u800c\u70b9 \\(\\mathbf{x}\\) \u79f0\u4e3a \\(\\mathbf{l}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u70b9 \u3002 \u70b9 \\(\\mathbf{x}\\) \u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4ea4\u4e8e\u4e24\u70b9\u3002 \\(C\\) \u7684\u8fc7\u8fd9\u4e24\u70b9\u7684\u4e24\u6761\u5207\u7ebf\u76f8\u4ea4\u4e8e \\(\\mathbf{x}\\) \u3002 \u5982\u679c\u70b9 \\(x\\) \u5728 \\(C\\) \u4e0a\uff0c\u5219\u5b83\u7684\u6781\u7ebf\u5c31\u662f\u4e8c\u6b21\u66f2\u7ebf\u8fc7 \\(x\\) \u70b9\u7684\u5207\u7ebf\u3002 \u5bf9\u5c04 \u5b9a\u4e49 \uff1a\u5bf9\u5c04\u662f \\(IP^2\\) \u70b9\u5230 \\(IP^2\\) \u7ebf\u7684\u53ef\u9006\u6620\u5c04\u3002\u5e76\u7528\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(A\\) \u8868\u793a\u4e3a \\(\\mathbf{l}=A\\mathbf{x}\\) \u3002 \u5171\u8f6d\u70b9 \uff1a\u5982\u679c\u70b9 \\(y\\) \u5728\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4e0a\uff0c\u5219 \\(\\mathbf{y}^{\\top}\\mathbf{l}=\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u3002\u6ee1\u8db3 \\(\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u7684\u4efb\u4f55\u4e24\u70b9 \\(x,y\\) \u79f0\u4e3a\u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5171\u8f6d\u3002 \u5982\u679c \\(\\mathbf{x}\\) \u5728 \\(\\mathbf{y}\\) \u7684\u6781\u7ebf\u4e0a\uff0c\u90a3\u4e48 \\(\\mathbf{y}\\) \u4e5f\u5728 \\(\\mathbf{x}\\) \u7684\u6781\u7ebf\u4e0a\u3002","title":"\u6781\u70b9-\u6781\u7ebf\u5173\u7cfb"},{"location":"cv/mvg/pjt2d/#_19","text":"","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u5206\u7c7b"},{"location":"cv/mvg/pjt2d/#_20","text":"\u4efb\u4f55\u4e8c\u6b21\u66f2\u7ebf\u90fd\u5c04\u5f71\u7b49\u4ef7\u4e8e\u4e00\u4e2a\u7531\u5bf9\u89d2\u77e9\u9635\u8868\u793a\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e8c\u6b21\u66f2\u7ebf \\(D\\) \u6700\u7ec8\u88ab\u8868\u793a\u4e3a\u5177\u6709\u77e9\u9635 \\(diag(\\varepsilon_1, \\varepsilon_2, \\varepsilon_3)\\) \u7684\u4e8c\u6b21\u66f2\u7ebf\uff0c\u5176\u4e2d \\(\\varepsilon_i=\\pm 1\\) \u6216 \\(0\\) \u3002 \u5bf9\u89d2\u7ebf \u65b9\u7a0b \u4e8c\u6b21\u66f2\u7ebf\u7c7b\u578b \\((1,1,1)\\) \\(x^2+y^2+w^2=0\\) \u5047\u4e8c\u6b21\u66f2\u7ebf--\u65e0\u5b9e\u70b9 \\((1,1,-1)\\) \\(x^2+y^2-w^2=0\\) \u5706 \\((1,1,0)\\) \\(x^2+y^2=0\\) \u5355\u4e2a\u5b9e\u70b9 \\((0,0,1)^{\\top}\\) \\((1,-1,0)\\) \\(x^2-y^2=0\\) \u4e24\u6761\u76f4\u7ebf \\(x=\\pm y\\) \\((1,0,0)\\) \\(x^2=0\\) \u5355\u6761\u76f4\u7ebf \\(x=0\\) \u8ba1\u4e24\u6b21","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u5c04\u5f71\u6807\u51c6\u5f62\u5f0f"},{"location":"cv/mvg/pjt2d/#_21","text":"\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c(\u975e\u9000\u5316\u6216\u771f)\u4e8c\u6b21\u66f2\u7ebf\u53ef\u4ee5\u5206\u4e3a\u53cc\u66f2\u7ebf\u3001\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002\u5728\u5c04\u5f71\u51e0\u4f55\u4e2d\u4e09\u79cd\u7c7b\u578b\u7684\u4e8c\u6b21\u66f2\u7ebf\u4e0e \\(l_\\infty\\) \u7684\u5173\u7cfb\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u4e0a\u56fe\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u662f \\((a)\\) \u692d\u5706\uff0c \\((b)\\) \u629b\u7269\u7ebf\uff0c \\((c)\\) \u53cc\u66f2\u7ebf\u3002\u5b83\u4eec\u4e0e \\(l_{\\infty}\\) \u7684\u5173\u7cfb : \\((a)\\) \u65e0\u5b9e\u4ea4\u70b9\u3001 \\((b)\\) \u76f8\u5207( \\(2\\) \u70b9\u63a5\u89e6)\u3001 \\((c)\\) \u6709 \\(2\\) \u4e2a\u5b9e\u4ea4\u70b9\u3002","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u4eff\u5c04\u5206\u7c7b"},{"location":"cv/mvg/pjt2d/#_22","text":"\u53d8\u6362\u7684\u4e00\u4e2a \u7279\u5f81\u77e2\u91cf \u5bf9\u5e94\u4e00\u4e2a \u4e0d\u52a8\u70b9 \uff0c\u56e0\u4e3a\u5bf9\u4e8e\u7279\u5f81\u503c \\(\\lambda\\) \u53ca\u5176\u5bf9\u5e94\u7684\u7279\u5f81\u77e2\u91cf \\(e\\) \u6709: \\[H\\mathbf{e} = \\lambda \\mathbf{e}\\] \u2002\u2002\u800c \\(\\mathbf{e}\\) \u548c \\(\\lambda \\mathbf{e}\\) \u8868\u793a\u540c\u4e00\u70b9\u3002\u7c7b\u4f3c\u7684\u63a8\u5bfc\u53ef\u4ee5\u7528\u4e8e\u4e0d\u52a8\u76f4\u7ebf\uff0c\u5b83\u5bf9\u5e94\u4e8e \\(H^{\\top}\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u7684\u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf \u8fd9\u91cc\u6709\u4e09\u4e2a\u4e0d\u52a8\u70b9\u548c\u8fc7\u8fd9\u4e09\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf.\u4e0d\u52a8\u76f4\u7ebf\u548c\u4e0d\u52a8\u70b9\u53ef\u80fd\u662f\u590d\u7684\uff1a\u4ece\u4ee3\u6570\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u4e0d\u52a8\u70b9\u662f\u70b9\u53d8\u6362 \\((\\mathbf{x}^\\prime=H\\mathbf{x})\\) \u7684\u7279\u5f81\u77e2\u91cf \\(\\mathbf{e}_i\\) \uff0c\u800c\u4e0d\u52a8\u76f4\u7ebf\u662f\u7ebf\u53d8\u6362 \\((\\mathbf{l}^\\prime =H^{-T}\\mathbf{l})\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002\u6ce8\u610f\uff0c\u4e0d\u52a8\u76f4\u7ebf\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\uff1a\u5728\u53d8\u6362\u4e0b\uff0c\u76f4\u7ebf\u4e0a\u7684\u4e00\u70b9\u88ab\u6620\u4e3a\u5176\u4e0a\u7684\u53e6\u4e00\u70b9\uff0c\u53ea\u6709\u4e0d\u52a8\u70b9\u624d\u6620\u4e3a\u81ea\u8eab\u3002","title":"\u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf"},{"location":"cv/mvg/pjt2d/#_23","text":"\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u662f\u865a\u5706\u70b9 \\(\\mathbf{I},\\mathbf{J}\\) \u7ec4\u6210\u7684\u590d\u5171\u8f6d\u5bf9\uff0c\u76f8\u5bf9\u5e94\u7684\u7279\u5f81\u503c\u662f \\(|e^{i \\theta}, e^{-i \\theta}|\\) \uff0c\u8fd9\u91cc \\(\\theta\\) \u662f\u65cb\u8f6c\u89d2\u3002\u5bf9\u5e94\u4e8e\u7279\u5f81\u503c \\(1\\) \u7684\u7b2c\u4e09\u4e2a\u7279\u5f81\u5411\u91cf\uff0c\u79f0\u4e3a \\(\u6781\u70b9\\) \u3002\u6b27\u6c0f\u53d8\u6362\u7b49\u4ef7\u4e8e\u7ed5\u8be5\u70b9\u8f6c \\(\\theta\\) \u89d2\u7684\u7eaf\u65cb\u8f6c\u5e76\u4e14\u6ca1\u6709\u5e73\u79fb\u3002 \u4e00\u79cd\u7279\u6b8a\u7684\u60c5\u8bc6\u662f\u7eaf\u5e73\u79fb(\u5373 \\(\\theta=0\\) )\u3002\u8fd9\u65f6\u7279\u5f81\u503c\u4e09\u91cd\u9000\u5316\uff0c\u8fd9\u662f\u7ea6\u675f\u900f\u89c6\u53d8\u6362\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002","title":"\u6b27\u6c0f\u77e9\u9635"},{"location":"cv/mvg/pjt2d/#_24","text":"\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u4ecd\u662f\u865a\u5706\u70b9\u3002\u7279\u5f81\u503c\u662f \\(|1,se^{i \\theta}, se^{-i \\theta}|\\) \u3002\u76f8\u4f3c\u53d8\u6362\u7684\u4f5c\u7528\u53ef\u4ee5\u7406\u89e3\u4e3a\u7ed5\u5b83\u7684\u6709\u9650\u4e0d\u52a8\u70b9\u7684\u65cb\u8f6c\u548c\u53d6 \\(s\\) \u4e3a\u56e0\u5b50\u7684\u5747\u5300\u7f29\u653e\u3002\u6ce8\u610f\u865a\u5706\u70b9\u7684\u7279\u5f81\u503c\u4ecd\u7136\u8868\u5f81\u65cb\u8f6c\u89d2\u3002","title":"\u76f8\u4f3c\u77e9\u9635"},{"location":"cv/mvg/pjt2d/#_25","text":"\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u53ef\u4ee5\u662f\u5b9e\u6216\u590d\u5171\u8f6d\u7684\uff0c\u4f46\u5728\u4efb\u4f55\u4e00\u79cd\u60c5\u51b5\u4e0b\uff0c\u8fc7\u8fd9\u4e9b\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf \\(\\mathbf{l}_\\infty=(0,0,1)^{\\top}\\) \u662f\u5b9e\u7684\u3002","title":"\u4eff\u5c04\u77e9\u9635"},{"location":"cv/mvg/pjt3d/","text":"3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u00b6 \u7ea6 2831 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecd 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4 \\(IP^3\\) \u7684\u6027\u8d28\u548c\u57fa\u672c\u8981\u7d20\u3002 \u70b9\u548c\u5c04\u5f71\u53d8\u6362 \u00b6 \u4e09\u7ef4\u7a7a\u95f4\u7684\u4e00\u70b9 \\(\\mathbf{X}\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a\u4e00\u4e2a 4 \u7ef4\u77e2\u91cf\uff0c\u9f50\u6b21\u77e2\u91cf \\(\\mathbf{X}=(X_1,X_2,X_3,X_4)^{\\top}\\) \u5f53 \\(X_4 \\ne 0\\) \u65f6\u8868\u793a\u4e3a \\(IR^3\\) \u4e2d\u975e\u9f50\u6b21\u5750\u6807\u4e3a \\((X,Y,Z)^{\\top}\\) \u7684\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{X}=X_1/X_4,Y=X_2/X_4,Z=X_3/X_4\\) \u3002 \u5f53 \\(X_4=0\\) \u7684\u9f50\u6b21\u70b9\u8868\u793a\u65e0\u7a77\u8fdc\u70b9\u3002 \\(IR^3\\) \u4e0a\u7684\u5c04\u5f71\u53d8\u6362\u662f\u7531\u975e\u5947\u5f02 \\(4 \\times 4\\) \u77e9\u9635\u7ed9\u51fa\uff0c\u5b83\u662f\u5173\u4e8e\u9f50\u6b21 4 \u7ef4\u77e2\u91cf\u7684\u7ebf\u6027\u53d8\u6362\uff1a \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \uff0c\u8be5\u6620\u5c04\u662f\u4fdd\u7ebf\u53d8\u6362\uff08\u76f4\u7ebf\u88ab\u6620\u5c04\u5230\u76f4\u7ebf\uff09\u3002 \u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u9762\u7684\u8868\u793a\u548c\u53d8\u6362 \u00b6 \u5e73\u9762 \u00b6 \u5e73\u9762\u7684\u9f50\u6b21\u8868\u793a\u4e3a \\(\\mathbf{\\pi}=(\\pi_1, \\pi_2, \\pi_3, \\pi_4)^{\\top}\\) \u3002 \u70b9 \\(\\mathbf{X}\\) \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u5219\uff1a \\(\\mathbf{\\pi}^{\\top}\\mathbf{X}=0\\) \u8054\u5408\u4e0e\u5173\u8054\u5173\u7cfb \u5e73\u9762\u53ef\u7531\u4e00\u822c\u4f4d\u7f6e\u7684\u4e09\u4e2a\u70b9\u6216\u4e00\u6761\u76f4\u7ebf\u4e0e\u4e00\u4e2a\u70b9\u7684\u8054\u5408\u6765\u552f\u4e00\u786e\u5b9a\uff08\u4e00\u822c\u4f4d\u7f6e\u6307\u4e09\u70b9\u4e0d\u5171\u7ebf\u6216\u5728\u540e\u4e00\u79cd\u60c5\u5f62\u4e0b\u6307\u70b9\u4e0d\u5728\u76f4\u7ebf\u4e0a\uff09 \u4e24\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u76f4\u7ebf \u4e09\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u70b9 \u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762 \u786e\u5b9a\u5e73\u9762\u7684\u4e09\u4e2a\u70b9\u662f \\(\\mathbf{X}_1=(\\hat{\\mathbf{X}_1})^{\\top}\u3001\\mathbf{X}_2=(\\hat{\\mathbf{X}_2})^{\\top}\u3001\\mathbf{X}_3=(\\hat{\\mathbf{X}_3})^{\\top}\\) \uff0c\u5219 \\[ \\mathbf{\\pi}=((\\hat{\\mathbf{X}_1}-\\hat{\\mathbf{X}_3}) \\times (\\hat{\\mathbf{X}_2}-\\hat{\\mathbf{X}_3}), -\\hat{\\mathbf{X}_3}^{\\top}(\\hat{\\mathbf{X}_1} \\times \\hat{\\mathbf{X}_2}))^{\\top} \\] \u4e09\u5e73\u9762\u786e\u5b9a\u4e00\u70b9 \u4e09\u5e73\u9762 \\(\\mathbf{\\pi}_i\\) \u7684\u4ea4\u70b9 \\(\\mathbf{X}\\) \u53ef\u901a\u8fc7\u6c42\u4ee5\u4e09\u5f20\u5e73\u9762\u4e3a\u884c\u7684 \\(3 \\times 4\\) \u77e9\u9635\u7684\uff08\u53f3\uff09\u96f6\u7a7a\u95f4\u76f4\u63a5\u8ba1\u7b97\u51fa\u6765\uff1a \\[ \\begin{bmatrix} \\mathbf{\\pi}_1^{\\top}\\\\ \\mathbf{\\pi}_2^{\\top}\\\\ \\mathbf{\\pi}_3^{\\top} \\end{bmatrix} \\mathbf{X}=\\mathbf{0} \\] \u5c04\u5f71\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u5e73\u9762\u53d8\u6362\u4e3a \\(\\mathbf{\\pi}^\\prime=H^{-\\top}\\mathbf{\\pi}\\) \u5e73\u9762\u4e0a\u7684\u70b9\u7684\u53c2\u6570\u8868\u793a \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u7684\u70b9 \\(\\mathbf{X}\\) \u53ef\u4ee5\u5199\u6210 \\(\\mathbf{X}=M\\mathbf{x}\\) \u5176\u4e2d \\(4 \\times 3\\) \u77e9\u9635 \\(M\\) \u7684\u5217\u751f\u6210 \\(\\mathbf{\\pi}^{\\top}\\) \u7684\u79e9\u4e3a 3 \u7684\u96f6\u7a7a\u95f4\uff0c\u5373 \\(\\mathbf{\\pi}^{\\top} M=\\mathbf{0}^{\\top}\\) \u76f4\u7ebf \u00b6 \u96f6\u7a7a\u95f4 \u4e00\u4e2a\u7b97\u5b50 \\(\\mathbf{A}\\) \u7684\u96f6\u7a7a\u95f4\u662f \\(\\mathbf{A}\\mathbf{v}=\\mathbf{0}\\) \u7684\u6240\u6709\u89e3 \\(\\mathbf{v}\\) \u7684\u96c6\u5408\u3002\u5b83\u4e5f\u53eb\u505a \\(\\mathbf{A}\\) \u7684\u6838\uff0c\u6838\u7a7a\u95f4\u3002\u5982\u679c\u7b97\u5b50\u662f\u5728\u5411\u91cf\u7a7a\u95f4\u4e0a\u7684\u7ebf\u6027\u7b97\u5b50\uff0c\u96f6\u7a7a\u95f4\u5c31\u662f\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002\u56e0\u6b64\u96f6\u7a7a\u95f4\u4e5f\u662f\u5411\u91cf\u7a7a\u95f4\u3002 \u751f\u6210\u5b50\u7a7a\u95f4 \u8bbe \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u662f \\(R^m\\) \u4e2d\u4efb\u4e00\u7ec4\u5411\u91cf\u3002\u8bb0 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u7684\u6240\u6709\u7ebf\u6027\u7ec4\u5408\u7684\u96c6\u5408\u4e3a \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \uff0c\u5373 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)=\\{k_1\\alpha_1+k_2\\alpha_2+...+k_m\\alpha_m | k_i \\in R, i=1,2,...,m\\}\\) \uff0c\u79f0 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \u4e3a\u5411\u91cf\u7ec4 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u751f\u6210\u7684\u5b50\u7a7a\u95f4\u3002 \u96f6\u7a7a\u95f4\u4e0e\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a \u5047\u5b9a \\(\\mathbf{A}\u3001\\mathbf{B}\\) \u662f\u4e24\uff08\u4e0d\u91cd\u5408\uff09\u7684\u7a7a\u95f4\u70b9\uff0c\u90a3\u4e48\u8fde\u63a5\u8fd9\u4e24\u70b9\u7684\u76f4\u7ebf\u7531\u4e00\u4e2a \\(2 \\times 4\\) \u77e9\u9635 \\(W\\) \u7684\u884c\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a\uff0c \\(W=\\begin{bmatrix} \\mathbf{A}^{\\top} \\\\ \\mathbf{B}^{\\top} \\end{bmatrix}\\) \\(W^{\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u5728\u76f4\u7ebf \\(\\lambda \\mathbf{A}+\\mu \\mathbf{B}\\) \u4e0a\u7684\u70b9\u675f \\(W\\) \u7684 2 \u7ef4\u53f3\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \u4e00\u6761\u76f4\u7ebf\u7684\u5bf9\u5076\u8868\u793a\u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}\uff0c\\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u8be5\u76f4\u7ebf\u8868\u793a\u4e3a\u77e9\u9635 \\(W^*=\\begin{bmatrix} \\mathbf{P}^{\\top} \\\\ \\mathbf{Q}^{\\top} \\end{bmatrix}\\) \\(W^{*\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u8be5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \\(\\lambda^\\prime\\mathbf{P}+\\mu^\\prime\\mathbf{Q}\\) \\(W^{*\\top}\\) \u7684 2 \u7ef4\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u8be5\u76f4\u7ebf\u4e0a\u7684\u70b9\u675f \u8fd9\u4e24\u79cd\u8868\u793a\u4ee5 \\(W^*W^{\\top}=WW^{*\\top}=0_{2\\times 2}\\) \u76f8\u8054\u7cfb Pl\u00fccker \u77e9\u9635 \u8fd9\u91cc\u4e00\u6761\u76f4\u7ebf\u7531 \\(4 \\times 4\\) \u53cd\u5bf9\u79f0\u9f50\u6b21\u77e9\u9635\u8868\u793a\u3002\u8fde\u63a5\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u76f4\u7ebf\u7531\u77e9\u9635 \\(\\mathbf{L}\\) \u8868\u793a\uff0c\u5176\u5143\u7d20\u4e3a\uff1a \\(l_{ij}=A_iB_j-B_iA_j\\) \uff0c\u6216\u7528\u77e2\u91cf\u8bb0\u53f7\u7b49\u4ef7\u4e8e\u8868\u793a\u4e3a \\(L=\\mathbf{A}\\mathbf{B}^{\\top}-\\mathbf{B}\\mathbf{A}^{\\top}\\) \u6027\u8d28 \\(L\\) \u7684\u79e9\u4e3a 2 \u8be5\u8868\u793a\u5177\u6709\u63cf\u8ff0\u4e00\u6761\u76f4\u7ebf\u6240\u9700\u8981\u7684 4 \u4e2a\u81ea\u7531\u5ea6 \u77e9\u9635 \\(L\\) \u4e0e\u7528\u6765\u786e\u5b9a\u5b83\u7684\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u65e0\u5173 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u8be5\u77e9\u9635\u53d8\u6362\u4e3a \\(L^\\prime=HLH^{\\top}\\) \u65f6\uff0c\u5373\u5b83\u662f\u4e00\u4e2a\u9636\u4e3a 2 \u7684\u5f20\u91cf \u7531\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\u786e\u5b9a\u7684\u76f4\u7ebf\u7684\u5bf9\u5076 Pl\u00fccker \u8868\u793a\u4e3a \\(L^*\\) \u4e3a \\(L^*=\\mathbf{P}\\mathbf{Q}^{\\top}-\\mathbf{Q}\\mathbf{P}^{\\top}\\) \u7531\u70b9 \\(\\mathbf{X}\\) \u548c\u76f4\u7ebf \\(L\\) \u8054\u5408\u800c\u786e\u5b9a\u7684\u5e73\u9762\u4e3a \\(\\mathbf{\\pi}=L^*\\mathbf{X}\\) \uff0c\u5e76\u4e14 \\(L^*\\mathbf{X}=0\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(\\mathbf{X}\\) \u5728 \\(L\\) \u4e0a \u7531\u76f4\u7ebf \\(L\\) \u548c\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u76f8\u4ea4\u800c\u786e\u5b9a\u7684\u70b9\u4e3a \\(\\mathbf{X}=L\\mathbf{\\pi}\\) \uff0c\u5e76\u4e14 \\(L\\mathbf{\\pi}=\\mathbf{0}\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(L\\) \u5728 \\(\\mathbf{\\pi}\\) \u4e0a Pl\u00fccker \u76f4\u7ebf\u5750\u6807 Pl\u00fccker \u76f4\u7ebf\u5750\u6807\u662f \\(4 \\times 4\\) \u53cd\u5bf9\u79f0 Pl\u00fccker \u77e9\u9635 \\(L\\) \u7684\u516d\u4e2a\u975e\u96f6\u5143\u7d20\uff0c\u5373 \\(\\mathcal{L}=\\{l_{12},l_{13},l_{14},l_{23},l_{42},l_{34}\\}\\) \u7531\u4e8e \\(\\det{L}=0\\) \uff0c\u6240\u4ee5\u5750\u6807\u6ee1\u8db3 \\(l_{12}l_{34}+l_{13}l_{42}+l_{14}l_{23}=0\\) \u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}\\) \u548c \\(\\hat{\\mathcal{L}}\\) \u5171\u9762\uff08\u56e0\u800c\u76f8\u4ea4\uff09\u7684\u5145\u8981\u6761\u4ef6\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \uff0c\u5219 6 \u7ef4\u77e2\u91cf \\(\\mathcal{L}\\) \u4ec5\u8868\u793a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u76f4\u7ebf \u5047\u5b9a\u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}, \\hat{\\mathcal{L}}\\) \u5206\u522b\u4e3a\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u548c \\(\\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}\\) \u7684\u4ea4\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=\\det [\\mathbf{P}, \\mathbf{Q}, \\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}]\\) \uff0c\u540c\u7406\uff0c\u4e24\u6761\u76f4\u7ebf\u76f8\u4ea4\u7684\u5145\u8981\u6761\u4ef6\u5c31\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\(\\mathcal{L}\\) \u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u800c \\(\\hat{\\mathcal{L}}\\) \u662f\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u8fde\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=(\\mathbf{P}^{\\top}\\mathbf{A})(\\mathbf{Q}^{\\top}\\mathbf{B})-(\\mathbf{Q}^{\\top}\\mathbf{A})(\\mathbf{P}^{\\top}\\mathbf{B})\\) \u4e8c\u6b21\u66f2\u9762\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \u00b6 \\(IP^3\\) \u4e2d\uff0c\u4e8c\u6b21\u66f2\u9762\u7531\u4e0b\u5217\u65b9\u7a0b\u5b9a\u4e49\uff1a \\(\\mathbf{X}^{\\top} Q\\mathbf{X}=0\\) \uff0c\u5176\u4e2d \\(Q\\) \u662f\u4e00\u4e2a \\(4 \\times 4\\) \u7684\u5bf9\u79f0\u77e9\u9635 \u4e2a\u4e8c\u6b21\u66f2\u9762\u6709 9 \u4e2a\u81ea\u7531\u5ea6 \u4e00\u822c\u4f4d\u7f6e\u4e0a\u7684\u4e5d\u4e2a\u70b9\u786e\u5b9a\u4e00\u4e2a\u4e8c\u6b21\u66f2\u9762 \u5982\u679c\u77e9\u9635 \\(Q\\) \u662f\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u4e8c\u6b21\u66f2\u9762\u662f\u9000\u5316\u7684\uff0c\u5e76\u53ef\u4ee5\u7531\u8f83\u5c11\u7684\u70b9\u6765\u786e\u5b9a \u4e8c\u6b21\u66f2\u9762\u5b9a\u4e49\u4e86\u70b9\u548c\u5e73\u9762\u4e4b\u95f4\u7684\u4e00\u79cd\u914d\u6781\uff0c\u7c7b\u4f3c\u4e8e\u4e8c\u6b21\u66f2\u7ebf\u5728\u70b9\u548c\u76f4\u7ebf\u4e4b\u95f4\u5b9a\u4e49\u7684\u914d\u6781\uff0c\u5e73\u9762 \\(\\mathbf{\\pi}=Q\\mathbf{X}\\) \u79f0\u4e3a\u662f \\(\\mathbf{X}\\) \u5173\u4e8e \\(Q\\) \u7684\u6781\u5e73\u9762\uff0c\u5f53 \\(Q\\) \u4e3a\u975e\u5947\u5f02\u5e76\u4e14 \\(\\mathbf{X}\\) \u5728\u4e8c\u6b21\u66f2\u9762\u4e4b\u5916\u65f6\uff0c\u6781\u5e73\u9762\u7531\u8fc7 \\(\\mathbf{X}\\) \u4e14\u4e0e \\(Q\\) \u76f8\u5207\u7684\u5c04\u7ebf\u7ec4\u6210\u7684\u9525\u4e0e \\(Q\\) \u60f3\u63a5\u89e6\u7684\u70b9\u6765\u5b9a\u4e49\u3002\u5982\u679c \\(\\mathbf{X}\\) \u5728 \\(Q\\) \u4e0a\uff0c\u90a3\u4e48 \\(Q\\mathbf{X}\\) \u662f \\(Q\\) \u5728\u70b9 \\(\\mathbf{X}\\) \u7684\u5207\u5e73\u9762 \u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u4ea4\u7ebf\u662f\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u9762\u53d8\u6362\u4e3a \\(Q^\\prime=H^{-\\top}QH^{-1}\\) \u4e8c\u6b21\u66f2\u9762\u7684\u5206\u7c7b \u00b6 \u5bf9\u89d2\u77e9\u9635 \\(D\\) \u7684\u7b26\u53f7\u5dee\uff0c\u8bb0\u4e3a \\(\\sigma(D)\\) \uff0c\u5b9a\u4e49\u4e3a \\(D\\) \u4e2d +1 \u7684\u4e2a\u6570\u4e0e -1 \u7684\u4e2a\u6570\u7684\u5dee\u503c \u4e09\u6b21\u7ed5\u7ebf \u00b6 \u4e09\u6b21\u7ed5\u7ebf\u53ef\u4ee5\u770b\u6210 2D \u4e8c\u6b21\u66f2\u7ebf\u7684 3 \u7ef4\u7c7b\u63a8\u3002\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u5b9a\u4e49\u4e3a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u66f2\u7ebf\uff0c\u5b83\u7684\u53c2\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ \\begin{bmatrix} x_1 \\\\ x_2 \\\\ x_3 \\\\ x_4 \\end{bmatrix} = A \\begin{bmatrix} 1 \\\\ \\theta \\\\ \\theta^2 \\\\ \\theta^3 \\end{bmatrix} = \\begin{bmatrix} a_{11}+a_{12}\\theta+a_{13}\\theta^2+a_{14}\\theta^3 \\\\ a_{21}+a_{22}\\theta+a_{23}\\theta^2+a_{24}\\theta^3 \\\\ a_{31}+a_{32}\\theta+a_{33}\\theta^2+a_{34}\\theta^3 \\\\ a_{41}+a_{42}\\theta+a_{43}\\theta^2+a_{44}\\theta^3 \\end{bmatrix} \\] \u6027\u8d28 \u4ee4 \\(\\mathbf{c}\\) \u4e3a\u4e00\u6761\u975e\u5947\u5f02\u4e09\u6b21\u7ed5\u7ebf\u3002\u90a3\u4e48 \\(\\mathbf{c}\\) \u4e0d\u6574\u4e2a\u5730\u5305\u542b\u5728 \\(IP^3\\) \u7684\u4efb\u4f55\u4e00\u5f20\u5e73\u9762\u4e2d\uff0c\u800c\u662f\u4e0e\u4e00\u822c\u5e73\u9762\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u4ea4\u70b9 \u4e09\u6b21\u7ed5\u7ebf\u6709 12 \u4e2a\u81ea\u7531\u5ea6 \u6240\u6709\u975e\u9000\u5316\u7684\u4e09\u6b21\u7ed5\u7ebf\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684 \u53d8\u6362\u7684\u5c42\u6b21 \u00b6 3 \u7ef4\u7a7a\u95f4\u53d8\u6362\u540c\u6837\u5177\u6709\u76f8\u5e94\u7684 2 \u7ef4\u7a7a\u95f4\u53d8\u6362 \u9ad8\u65af\u66f2\u7387 \uff1a\u5fae\u5206\u51e0\u4f55\u4e2d\uff0c\u66f2\u9762\u4e0a\u4e00\u70b9\u7684\u9ad8\u65af\u66f2\u7387\u662f\u8be5\u70b9\u4e3b\u66f2\u7387 \\(k_1\\) \u548c \\(k_2\\) \u7684\u4e58\u79ef\u3002\u5b83\u662f\u66f2\u7387\u7684\u5185\u5728\u5ea6\u91cf\uff0c\u4e5f\u5373\uff0c\u5b83\u7684\u503c\u53ea\u4f9d\u8d56\u4e8e\u66f2\u9762\u4e0a\u7684\u8ddd\u79bb\u5982\u4f55\u6d4b\u91cf\uff0c\u800c\u4e0d\u662f\u66f2\u9762\u5982\u4f55\u5d4c\u5165\u5230\u7a7a\u95f4\u3002 \u8f6c\u52a8\u5206\u89e3 \u4efb\u4f55\u5177\u4f53\u7684\u5e73\u79fb\u52a0\u65cb\u8f6c\u8fd0\u52a8\u90fd\u7b49\u4ef7\u4e8e\u7ed5\u4e00\u6839\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u52a0\u6cbf\u8be5\u8f6c\u52a8\u8f74\u7684\u5e73\u79fb\u3002\u8be5\u8f6c\u52a8\u8f74\u5e73\u884c\u4e8e\u539f\u6765\u7684\u65cb\u8f6c\u8f74\u3002 \u5e73\u79fb\u52a0\u7ed5\u6b63\u4ea4\u8f74\u7684\u65cb\u8f6c\u8fd0\u52a8(\u79f0\u5e73\u9762\u8fd0\u52a8)\u7b49\u4ef7\u4e8e\u4ec5\u4ec5\u7ed5\u67d0\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u3002 \u65e0\u7a77\u8fdc\u5e73\u9762 \u00b6 \u5728 3 \u7ef4\u7a7a\u95f4\u7684\u5c04\u5f71\u51e0\u4f55\u4e2d\uff0c\u4e0e \\(\\mathbf{I}_{\\infty}\\) \u7684\u865a\u5706\u70b9\u5bf9\u5e94\u7684\u51e0\u4f55\u5b9e\u4f53\u662f\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_{\\infty}\\) \u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u4eff\u5c04\u7a7a\u95f4\u4e2d\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u6807\u51c6\u4f4d\u7f6e\u662f \\(\\mathbf{\\pi}_\\infty=(0,0,0,1)^{\\top}\\) \uff0c \\(\\mathbf{\\pi}_\\infty\\) \u5305\u542b\u6240\u6709\u65b9\u5411 \\(\\mathbf{D}=(X_1,X_2,X_3,0)^{\\top}\\) \u5e76\u4e14\u53ef\u4ee5\u7528\u6765\u8bc6\u522b\u4eff\u5c04\u6027\u8d28 \u4e24\u5f20\u5e73\u9762\u76f8\u5e73\u884c\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u4eec\u7684\u4ea4\u7ebf\u5728 \\(\\mathbf{\\pi}_\\infty\\) \u4e0a \u5982\u679c\u4e00\u6761\u76f4\u7ebf\u4e0e\u53e6\u4e00\u6761\u76f4\u7ebf\u6216\u4e00\u5f20\u5e73\u9762\u76f8\u4ea4\u4e8e \\(\\mathbf{\\pi}_\\infty\\) \u4e0a\uff0c\u5219\u5b83\u4eec\u76f8\u5e73\u884c \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u4e0d\u52a8\u5e73\u9762\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362 \u4e00\u822c\u5730\u8bf4\uff0c\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u6574\u4e2a\u96c6\u5408\u4e0d\u52a8\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8 \u4ec5\u6709 \\(\\mathbf{\\pi}_\\infty\\) \u5728\u4efb\u4f55\u4eff\u5c04\u53d8\u6362\u4e0b\u4fdd\u6301\u4e0d\u52a8 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u00b6 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u5728 \\(\\pi_\\infty\\) \u4e0a\u4e00\u6761\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u7ebf\u3002\u5728\u5ea6\u91cf\u5750\u6807\u7cfb\u4e2d \\(\\pi_\\infty=(0,0,0,1)^{\\top}\\) \uff0c\u800c\u5728 \\(\\Omega_\\infty\\) \u4e0a\u7684\u70b9\u6ee1\u8db3\uff1a \\(\\left.\\begin{matrix} X_1^2+X_2^2+X_3^2 \\\\ X_4^2 \\end{matrix}\\right\\} = 0\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u4e0d\u52a8\u4e8c\u6b21\u66f2\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \\(\\Omega_\\infty\\) \u5728\u4e00\u822c\u76f8\u4f3c\u53d8\u6362\u4e0b\u662f\u96c6\u5408\u4e0d\u61c2\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\u7684 \u6240\u6709\u7684\u5706\u4ea4 \\(\\Omega_\\infty\\) \u4e8e\u4e24\u70b9\uff0c\u8fd9\u4e24\u70b9\u662f\u865a\u5706\u70b9 \u6240\u6709\u7403\u9762\u4ea4 \\(\\pi_\\infty\\) \u4e8e \\(\\Omega_\\infty\\) \u5ea6\u91cf\u6027\u8d28 \uff1a\u4e00\u65e6 \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u8bf8\u5982\u5939\u89d2\u548c\u76f8\u5bf9\u957f\u5ea6\u7b49\u5ea6\u6700\u6027\u8d28\u53ef\u4ee5\u88ab\u6d4b\u5b9a\u3002\u8bbe\u4e24\u6761\u76f4\u7ebf\u7684\u65b9\u5411\u4e3a \\(d_1\\) \u548c \\(d_2\\) \uff083 \u7ef4\u77e2\u91cf\uff09\uff0c\u5219 \\[ \\cos \\theta = \\frac{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2)}{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_1)(\\mathbf{d}_2^{\\top} \\Omega_\\infty \\mathbf{d}_2)} \\] \u6b63\u4ea4\u4e0e\u914d\u6781 \uff1a\u5982\u679c \\(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2=0\\) \uff0c\u5219 \\(\\mathbf{d}_1\\) \u548c \\(\\mathbf{d}_2\\) \u76f8\u5782\u76f4\u3002\u56e0\u800c\u5782\u76f4\u6027\u53ef\u7531\u5173\u4e8e \\(\\Omega_\\infty\\) \u7684\u5171\u8f6d\u6027\u6765\u8868\u5f81 \u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \u00b6 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u7684\u5bf9\u5076\u662f 3 \u7ef4\u7a7a\u95f4\u4e2d\u4e00\u79cd\u9000\u5316\u7684\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\uff0c\u79f0\u4e3a\u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\u5e76\u8bb0\u4e3a \\(Q_\\infty^*\\) \u3002\u4ece\u51e0\u4f55\u4e0a\u8bf4\uff0c \\(Q_\\infty^*\\) \u7531 \\(\\Omega_\\infty\\) \u7684\u5207\u5e73\u9762\u7ec4\u6210\uff0c\u5b83\u88ab\u79f0\u4e3a \u8fb9\u4e8c\u6b21\u66f2\u9762 \u3002\u5b83\u5728 3 \u7ef4\u5ea6\u91cf\u7a7a\u95f4\u7684\u6807\u51c6\u5f62\u5f0f\u662f\uff1a \\(Q_\\infty^* = \\begin{bmatrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 0 \\end{bmatrix}\\) \u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \\(Q_\\infty^*\\) \u4e0d\u52a8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\pi_\\infty\\) \u662f \\(Q_\\infty^*\\) \u7684\u96f6\u77e2\u91cf \u4e24\u5f20\u5e73\u9762 \\(\\pi_1\\) \u548c \\(\\pi_2\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7531\u4e0b\u5f0f\u7ed9\u51fa\uff1a \\[ \\cos \\theta = \\frac{\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_2}{\\sqrt{(\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_1)(\\mathbf{\\pi}_2^{\\top} Q_\\infty^* \\mathbf{\\pi}_2)}} \\]","title":"3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#3d","text":"\u7ea6 2831 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecd 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4 \\(IP^3\\) \u7684\u6027\u8d28\u548c\u57fa\u672c\u8981\u7d20\u3002","title":"3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#_1","text":"\u4e09\u7ef4\u7a7a\u95f4\u7684\u4e00\u70b9 \\(\\mathbf{X}\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a\u4e00\u4e2a 4 \u7ef4\u77e2\u91cf\uff0c\u9f50\u6b21\u77e2\u91cf \\(\\mathbf{X}=(X_1,X_2,X_3,X_4)^{\\top}\\) \u5f53 \\(X_4 \\ne 0\\) \u65f6\u8868\u793a\u4e3a \\(IR^3\\) \u4e2d\u975e\u9f50\u6b21\u5750\u6807\u4e3a \\((X,Y,Z)^{\\top}\\) \u7684\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{X}=X_1/X_4,Y=X_2/X_4,Z=X_3/X_4\\) \u3002 \u5f53 \\(X_4=0\\) \u7684\u9f50\u6b21\u70b9\u8868\u793a\u65e0\u7a77\u8fdc\u70b9\u3002 \\(IR^3\\) \u4e0a\u7684\u5c04\u5f71\u53d8\u6362\u662f\u7531\u975e\u5947\u5f02 \\(4 \\times 4\\) \u77e9\u9635\u7ed9\u51fa\uff0c\u5b83\u662f\u5173\u4e8e\u9f50\u6b21 4 \u7ef4\u77e2\u91cf\u7684\u7ebf\u6027\u53d8\u6362\uff1a \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \uff0c\u8be5\u6620\u5c04\u662f\u4fdd\u7ebf\u53d8\u6362\uff08\u76f4\u7ebf\u88ab\u6620\u5c04\u5230\u76f4\u7ebf\uff09\u3002","title":"\u70b9\u548c\u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#_2","text":"","title":"\u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u9762\u7684\u8868\u793a\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#_3","text":"\u5e73\u9762\u7684\u9f50\u6b21\u8868\u793a\u4e3a \\(\\mathbf{\\pi}=(\\pi_1, \\pi_2, \\pi_3, \\pi_4)^{\\top}\\) \u3002 \u70b9 \\(\\mathbf{X}\\) \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u5219\uff1a \\(\\mathbf{\\pi}^{\\top}\\mathbf{X}=0\\) \u8054\u5408\u4e0e\u5173\u8054\u5173\u7cfb \u5e73\u9762\u53ef\u7531\u4e00\u822c\u4f4d\u7f6e\u7684\u4e09\u4e2a\u70b9\u6216\u4e00\u6761\u76f4\u7ebf\u4e0e\u4e00\u4e2a\u70b9\u7684\u8054\u5408\u6765\u552f\u4e00\u786e\u5b9a\uff08\u4e00\u822c\u4f4d\u7f6e\u6307\u4e09\u70b9\u4e0d\u5171\u7ebf\u6216\u5728\u540e\u4e00\u79cd\u60c5\u5f62\u4e0b\u6307\u70b9\u4e0d\u5728\u76f4\u7ebf\u4e0a\uff09 \u4e24\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u76f4\u7ebf \u4e09\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u70b9 \u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762 \u786e\u5b9a\u5e73\u9762\u7684\u4e09\u4e2a\u70b9\u662f \\(\\mathbf{X}_1=(\\hat{\\mathbf{X}_1})^{\\top}\u3001\\mathbf{X}_2=(\\hat{\\mathbf{X}_2})^{\\top}\u3001\\mathbf{X}_3=(\\hat{\\mathbf{X}_3})^{\\top}\\) \uff0c\u5219 \\[ \\mathbf{\\pi}=((\\hat{\\mathbf{X}_1}-\\hat{\\mathbf{X}_3}) \\times (\\hat{\\mathbf{X}_2}-\\hat{\\mathbf{X}_3}), -\\hat{\\mathbf{X}_3}^{\\top}(\\hat{\\mathbf{X}_1} \\times \\hat{\\mathbf{X}_2}))^{\\top} \\] \u4e09\u5e73\u9762\u786e\u5b9a\u4e00\u70b9 \u4e09\u5e73\u9762 \\(\\mathbf{\\pi}_i\\) \u7684\u4ea4\u70b9 \\(\\mathbf{X}\\) \u53ef\u901a\u8fc7\u6c42\u4ee5\u4e09\u5f20\u5e73\u9762\u4e3a\u884c\u7684 \\(3 \\times 4\\) \u77e9\u9635\u7684\uff08\u53f3\uff09\u96f6\u7a7a\u95f4\u76f4\u63a5\u8ba1\u7b97\u51fa\u6765\uff1a \\[ \\begin{bmatrix} \\mathbf{\\pi}_1^{\\top}\\\\ \\mathbf{\\pi}_2^{\\top}\\\\ \\mathbf{\\pi}_3^{\\top} \\end{bmatrix} \\mathbf{X}=\\mathbf{0} \\] \u5c04\u5f71\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u5e73\u9762\u53d8\u6362\u4e3a \\(\\mathbf{\\pi}^\\prime=H^{-\\top}\\mathbf{\\pi}\\) \u5e73\u9762\u4e0a\u7684\u70b9\u7684\u53c2\u6570\u8868\u793a \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u7684\u70b9 \\(\\mathbf{X}\\) \u53ef\u4ee5\u5199\u6210 \\(\\mathbf{X}=M\\mathbf{x}\\) \u5176\u4e2d \\(4 \\times 3\\) \u77e9\u9635 \\(M\\) \u7684\u5217\u751f\u6210 \\(\\mathbf{\\pi}^{\\top}\\) \u7684\u79e9\u4e3a 3 \u7684\u96f6\u7a7a\u95f4\uff0c\u5373 \\(\\mathbf{\\pi}^{\\top} M=\\mathbf{0}^{\\top}\\)","title":"\u5e73\u9762"},{"location":"cv/mvg/pjt3d/#_4","text":"\u96f6\u7a7a\u95f4 \u4e00\u4e2a\u7b97\u5b50 \\(\\mathbf{A}\\) \u7684\u96f6\u7a7a\u95f4\u662f \\(\\mathbf{A}\\mathbf{v}=\\mathbf{0}\\) \u7684\u6240\u6709\u89e3 \\(\\mathbf{v}\\) \u7684\u96c6\u5408\u3002\u5b83\u4e5f\u53eb\u505a \\(\\mathbf{A}\\) \u7684\u6838\uff0c\u6838\u7a7a\u95f4\u3002\u5982\u679c\u7b97\u5b50\u662f\u5728\u5411\u91cf\u7a7a\u95f4\u4e0a\u7684\u7ebf\u6027\u7b97\u5b50\uff0c\u96f6\u7a7a\u95f4\u5c31\u662f\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002\u56e0\u6b64\u96f6\u7a7a\u95f4\u4e5f\u662f\u5411\u91cf\u7a7a\u95f4\u3002 \u751f\u6210\u5b50\u7a7a\u95f4 \u8bbe \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u662f \\(R^m\\) \u4e2d\u4efb\u4e00\u7ec4\u5411\u91cf\u3002\u8bb0 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u7684\u6240\u6709\u7ebf\u6027\u7ec4\u5408\u7684\u96c6\u5408\u4e3a \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \uff0c\u5373 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)=\\{k_1\\alpha_1+k_2\\alpha_2+...+k_m\\alpha_m | k_i \\in R, i=1,2,...,m\\}\\) \uff0c\u79f0 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \u4e3a\u5411\u91cf\u7ec4 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u751f\u6210\u7684\u5b50\u7a7a\u95f4\u3002 \u96f6\u7a7a\u95f4\u4e0e\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a \u5047\u5b9a \\(\\mathbf{A}\u3001\\mathbf{B}\\) \u662f\u4e24\uff08\u4e0d\u91cd\u5408\uff09\u7684\u7a7a\u95f4\u70b9\uff0c\u90a3\u4e48\u8fde\u63a5\u8fd9\u4e24\u70b9\u7684\u76f4\u7ebf\u7531\u4e00\u4e2a \\(2 \\times 4\\) \u77e9\u9635 \\(W\\) \u7684\u884c\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a\uff0c \\(W=\\begin{bmatrix} \\mathbf{A}^{\\top} \\\\ \\mathbf{B}^{\\top} \\end{bmatrix}\\) \\(W^{\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u5728\u76f4\u7ebf \\(\\lambda \\mathbf{A}+\\mu \\mathbf{B}\\) \u4e0a\u7684\u70b9\u675f \\(W\\) \u7684 2 \u7ef4\u53f3\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \u4e00\u6761\u76f4\u7ebf\u7684\u5bf9\u5076\u8868\u793a\u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}\uff0c\\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u8be5\u76f4\u7ebf\u8868\u793a\u4e3a\u77e9\u9635 \\(W^*=\\begin{bmatrix} \\mathbf{P}^{\\top} \\\\ \\mathbf{Q}^{\\top} \\end{bmatrix}\\) \\(W^{*\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u8be5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \\(\\lambda^\\prime\\mathbf{P}+\\mu^\\prime\\mathbf{Q}\\) \\(W^{*\\top}\\) \u7684 2 \u7ef4\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u8be5\u76f4\u7ebf\u4e0a\u7684\u70b9\u675f \u8fd9\u4e24\u79cd\u8868\u793a\u4ee5 \\(W^*W^{\\top}=WW^{*\\top}=0_{2\\times 2}\\) \u76f8\u8054\u7cfb Pl\u00fccker \u77e9\u9635 \u8fd9\u91cc\u4e00\u6761\u76f4\u7ebf\u7531 \\(4 \\times 4\\) \u53cd\u5bf9\u79f0\u9f50\u6b21\u77e9\u9635\u8868\u793a\u3002\u8fde\u63a5\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u76f4\u7ebf\u7531\u77e9\u9635 \\(\\mathbf{L}\\) \u8868\u793a\uff0c\u5176\u5143\u7d20\u4e3a\uff1a \\(l_{ij}=A_iB_j-B_iA_j\\) \uff0c\u6216\u7528\u77e2\u91cf\u8bb0\u53f7\u7b49\u4ef7\u4e8e\u8868\u793a\u4e3a \\(L=\\mathbf{A}\\mathbf{B}^{\\top}-\\mathbf{B}\\mathbf{A}^{\\top}\\) \u6027\u8d28 \\(L\\) \u7684\u79e9\u4e3a 2 \u8be5\u8868\u793a\u5177\u6709\u63cf\u8ff0\u4e00\u6761\u76f4\u7ebf\u6240\u9700\u8981\u7684 4 \u4e2a\u81ea\u7531\u5ea6 \u77e9\u9635 \\(L\\) \u4e0e\u7528\u6765\u786e\u5b9a\u5b83\u7684\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u65e0\u5173 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u8be5\u77e9\u9635\u53d8\u6362\u4e3a \\(L^\\prime=HLH^{\\top}\\) \u65f6\uff0c\u5373\u5b83\u662f\u4e00\u4e2a\u9636\u4e3a 2 \u7684\u5f20\u91cf \u7531\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\u786e\u5b9a\u7684\u76f4\u7ebf\u7684\u5bf9\u5076 Pl\u00fccker \u8868\u793a\u4e3a \\(L^*\\) \u4e3a \\(L^*=\\mathbf{P}\\mathbf{Q}^{\\top}-\\mathbf{Q}\\mathbf{P}^{\\top}\\) \u7531\u70b9 \\(\\mathbf{X}\\) \u548c\u76f4\u7ebf \\(L\\) \u8054\u5408\u800c\u786e\u5b9a\u7684\u5e73\u9762\u4e3a \\(\\mathbf{\\pi}=L^*\\mathbf{X}\\) \uff0c\u5e76\u4e14 \\(L^*\\mathbf{X}=0\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(\\mathbf{X}\\) \u5728 \\(L\\) \u4e0a \u7531\u76f4\u7ebf \\(L\\) \u548c\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u76f8\u4ea4\u800c\u786e\u5b9a\u7684\u70b9\u4e3a \\(\\mathbf{X}=L\\mathbf{\\pi}\\) \uff0c\u5e76\u4e14 \\(L\\mathbf{\\pi}=\\mathbf{0}\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(L\\) \u5728 \\(\\mathbf{\\pi}\\) \u4e0a Pl\u00fccker \u76f4\u7ebf\u5750\u6807 Pl\u00fccker \u76f4\u7ebf\u5750\u6807\u662f \\(4 \\times 4\\) \u53cd\u5bf9\u79f0 Pl\u00fccker \u77e9\u9635 \\(L\\) \u7684\u516d\u4e2a\u975e\u96f6\u5143\u7d20\uff0c\u5373 \\(\\mathcal{L}=\\{l_{12},l_{13},l_{14},l_{23},l_{42},l_{34}\\}\\) \u7531\u4e8e \\(\\det{L}=0\\) \uff0c\u6240\u4ee5\u5750\u6807\u6ee1\u8db3 \\(l_{12}l_{34}+l_{13}l_{42}+l_{14}l_{23}=0\\) \u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}\\) \u548c \\(\\hat{\\mathcal{L}}\\) \u5171\u9762\uff08\u56e0\u800c\u76f8\u4ea4\uff09\u7684\u5145\u8981\u6761\u4ef6\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \uff0c\u5219 6 \u7ef4\u77e2\u91cf \\(\\mathcal{L}\\) \u4ec5\u8868\u793a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u76f4\u7ebf \u5047\u5b9a\u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}, \\hat{\\mathcal{L}}\\) \u5206\u522b\u4e3a\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u548c \\(\\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}\\) \u7684\u4ea4\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=\\det [\\mathbf{P}, \\mathbf{Q}, \\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}]\\) \uff0c\u540c\u7406\uff0c\u4e24\u6761\u76f4\u7ebf\u76f8\u4ea4\u7684\u5145\u8981\u6761\u4ef6\u5c31\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\(\\mathcal{L}\\) \u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u800c \\(\\hat{\\mathcal{L}}\\) \u662f\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u8fde\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=(\\mathbf{P}^{\\top}\\mathbf{A})(\\mathbf{Q}^{\\top}\\mathbf{B})-(\\mathbf{Q}^{\\top}\\mathbf{A})(\\mathbf{P}^{\\top}\\mathbf{B})\\)","title":"\u76f4\u7ebf"},{"location":"cv/mvg/pjt3d/#_5","text":"\\(IP^3\\) \u4e2d\uff0c\u4e8c\u6b21\u66f2\u9762\u7531\u4e0b\u5217\u65b9\u7a0b\u5b9a\u4e49\uff1a \\(\\mathbf{X}^{\\top} Q\\mathbf{X}=0\\) \uff0c\u5176\u4e2d \\(Q\\) \u662f\u4e00\u4e2a \\(4 \\times 4\\) \u7684\u5bf9\u79f0\u77e9\u9635 \u4e2a\u4e8c\u6b21\u66f2\u9762\u6709 9 \u4e2a\u81ea\u7531\u5ea6 \u4e00\u822c\u4f4d\u7f6e\u4e0a\u7684\u4e5d\u4e2a\u70b9\u786e\u5b9a\u4e00\u4e2a\u4e8c\u6b21\u66f2\u9762 \u5982\u679c\u77e9\u9635 \\(Q\\) \u662f\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u4e8c\u6b21\u66f2\u9762\u662f\u9000\u5316\u7684\uff0c\u5e76\u53ef\u4ee5\u7531\u8f83\u5c11\u7684\u70b9\u6765\u786e\u5b9a \u4e8c\u6b21\u66f2\u9762\u5b9a\u4e49\u4e86\u70b9\u548c\u5e73\u9762\u4e4b\u95f4\u7684\u4e00\u79cd\u914d\u6781\uff0c\u7c7b\u4f3c\u4e8e\u4e8c\u6b21\u66f2\u7ebf\u5728\u70b9\u548c\u76f4\u7ebf\u4e4b\u95f4\u5b9a\u4e49\u7684\u914d\u6781\uff0c\u5e73\u9762 \\(\\mathbf{\\pi}=Q\\mathbf{X}\\) \u79f0\u4e3a\u662f \\(\\mathbf{X}\\) \u5173\u4e8e \\(Q\\) \u7684\u6781\u5e73\u9762\uff0c\u5f53 \\(Q\\) \u4e3a\u975e\u5947\u5f02\u5e76\u4e14 \\(\\mathbf{X}\\) \u5728\u4e8c\u6b21\u66f2\u9762\u4e4b\u5916\u65f6\uff0c\u6781\u5e73\u9762\u7531\u8fc7 \\(\\mathbf{X}\\) \u4e14\u4e0e \\(Q\\) \u76f8\u5207\u7684\u5c04\u7ebf\u7ec4\u6210\u7684\u9525\u4e0e \\(Q\\) \u60f3\u63a5\u89e6\u7684\u70b9\u6765\u5b9a\u4e49\u3002\u5982\u679c \\(\\mathbf{X}\\) \u5728 \\(Q\\) \u4e0a\uff0c\u90a3\u4e48 \\(Q\\mathbf{X}\\) \u662f \\(Q\\) \u5728\u70b9 \\(\\mathbf{X}\\) \u7684\u5207\u5e73\u9762 \u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u4ea4\u7ebf\u662f\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u9762\u53d8\u6362\u4e3a \\(Q^\\prime=H^{-\\top}QH^{-1}\\)","title":"\u4e8c\u6b21\u66f2\u9762\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762"},{"location":"cv/mvg/pjt3d/#_6","text":"\u5bf9\u89d2\u77e9\u9635 \\(D\\) \u7684\u7b26\u53f7\u5dee\uff0c\u8bb0\u4e3a \\(\\sigma(D)\\) \uff0c\u5b9a\u4e49\u4e3a \\(D\\) \u4e2d +1 \u7684\u4e2a\u6570\u4e0e -1 \u7684\u4e2a\u6570\u7684\u5dee\u503c","title":"\u4e8c\u6b21\u66f2\u9762\u7684\u5206\u7c7b"},{"location":"cv/mvg/pjt3d/#_7","text":"\u4e09\u6b21\u7ed5\u7ebf\u53ef\u4ee5\u770b\u6210 2D \u4e8c\u6b21\u66f2\u7ebf\u7684 3 \u7ef4\u7c7b\u63a8\u3002\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u5b9a\u4e49\u4e3a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u66f2\u7ebf\uff0c\u5b83\u7684\u53c2\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ \\begin{bmatrix} x_1 \\\\ x_2 \\\\ x_3 \\\\ x_4 \\end{bmatrix} = A \\begin{bmatrix} 1 \\\\ \\theta \\\\ \\theta^2 \\\\ \\theta^3 \\end{bmatrix} = \\begin{bmatrix} a_{11}+a_{12}\\theta+a_{13}\\theta^2+a_{14}\\theta^3 \\\\ a_{21}+a_{22}\\theta+a_{23}\\theta^2+a_{24}\\theta^3 \\\\ a_{31}+a_{32}\\theta+a_{33}\\theta^2+a_{34}\\theta^3 \\\\ a_{41}+a_{42}\\theta+a_{43}\\theta^2+a_{44}\\theta^3 \\end{bmatrix} \\] \u6027\u8d28 \u4ee4 \\(\\mathbf{c}\\) \u4e3a\u4e00\u6761\u975e\u5947\u5f02\u4e09\u6b21\u7ed5\u7ebf\u3002\u90a3\u4e48 \\(\\mathbf{c}\\) \u4e0d\u6574\u4e2a\u5730\u5305\u542b\u5728 \\(IP^3\\) \u7684\u4efb\u4f55\u4e00\u5f20\u5e73\u9762\u4e2d\uff0c\u800c\u662f\u4e0e\u4e00\u822c\u5e73\u9762\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u4ea4\u70b9 \u4e09\u6b21\u7ed5\u7ebf\u6709 12 \u4e2a\u81ea\u7531\u5ea6 \u6240\u6709\u975e\u9000\u5316\u7684\u4e09\u6b21\u7ed5\u7ebf\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684","title":"\u4e09\u6b21\u7ed5\u7ebf"},{"location":"cv/mvg/pjt3d/#_8","text":"3 \u7ef4\u7a7a\u95f4\u53d8\u6362\u540c\u6837\u5177\u6709\u76f8\u5e94\u7684 2 \u7ef4\u7a7a\u95f4\u53d8\u6362 \u9ad8\u65af\u66f2\u7387 \uff1a\u5fae\u5206\u51e0\u4f55\u4e2d\uff0c\u66f2\u9762\u4e0a\u4e00\u70b9\u7684\u9ad8\u65af\u66f2\u7387\u662f\u8be5\u70b9\u4e3b\u66f2\u7387 \\(k_1\\) \u548c \\(k_2\\) \u7684\u4e58\u79ef\u3002\u5b83\u662f\u66f2\u7387\u7684\u5185\u5728\u5ea6\u91cf\uff0c\u4e5f\u5373\uff0c\u5b83\u7684\u503c\u53ea\u4f9d\u8d56\u4e8e\u66f2\u9762\u4e0a\u7684\u8ddd\u79bb\u5982\u4f55\u6d4b\u91cf\uff0c\u800c\u4e0d\u662f\u66f2\u9762\u5982\u4f55\u5d4c\u5165\u5230\u7a7a\u95f4\u3002 \u8f6c\u52a8\u5206\u89e3 \u4efb\u4f55\u5177\u4f53\u7684\u5e73\u79fb\u52a0\u65cb\u8f6c\u8fd0\u52a8\u90fd\u7b49\u4ef7\u4e8e\u7ed5\u4e00\u6839\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u52a0\u6cbf\u8be5\u8f6c\u52a8\u8f74\u7684\u5e73\u79fb\u3002\u8be5\u8f6c\u52a8\u8f74\u5e73\u884c\u4e8e\u539f\u6765\u7684\u65cb\u8f6c\u8f74\u3002 \u5e73\u79fb\u52a0\u7ed5\u6b63\u4ea4\u8f74\u7684\u65cb\u8f6c\u8fd0\u52a8(\u79f0\u5e73\u9762\u8fd0\u52a8)\u7b49\u4ef7\u4e8e\u4ec5\u4ec5\u7ed5\u67d0\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u3002","title":"\u53d8\u6362\u7684\u5c42\u6b21"},{"location":"cv/mvg/pjt3d/#_9","text":"\u5728 3 \u7ef4\u7a7a\u95f4\u7684\u5c04\u5f71\u51e0\u4f55\u4e2d\uff0c\u4e0e \\(\\mathbf{I}_{\\infty}\\) \u7684\u865a\u5706\u70b9\u5bf9\u5e94\u7684\u51e0\u4f55\u5b9e\u4f53\u662f\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_{\\infty}\\) \u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u4eff\u5c04\u7a7a\u95f4\u4e2d\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u6807\u51c6\u4f4d\u7f6e\u662f \\(\\mathbf{\\pi}_\\infty=(0,0,0,1)^{\\top}\\) \uff0c \\(\\mathbf{\\pi}_\\infty\\) \u5305\u542b\u6240\u6709\u65b9\u5411 \\(\\mathbf{D}=(X_1,X_2,X_3,0)^{\\top}\\) \u5e76\u4e14\u53ef\u4ee5\u7528\u6765\u8bc6\u522b\u4eff\u5c04\u6027\u8d28 \u4e24\u5f20\u5e73\u9762\u76f8\u5e73\u884c\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u4eec\u7684\u4ea4\u7ebf\u5728 \\(\\mathbf{\\pi}_\\infty\\) \u4e0a \u5982\u679c\u4e00\u6761\u76f4\u7ebf\u4e0e\u53e6\u4e00\u6761\u76f4\u7ebf\u6216\u4e00\u5f20\u5e73\u9762\u76f8\u4ea4\u4e8e \\(\\mathbf{\\pi}_\\infty\\) \u4e0a\uff0c\u5219\u5b83\u4eec\u76f8\u5e73\u884c \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u4e0d\u52a8\u5e73\u9762\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362 \u4e00\u822c\u5730\u8bf4\uff0c\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u6574\u4e2a\u96c6\u5408\u4e0d\u52a8\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8 \u4ec5\u6709 \\(\\mathbf{\\pi}_\\infty\\) \u5728\u4efb\u4f55\u4eff\u5c04\u53d8\u6362\u4e0b\u4fdd\u6301\u4e0d\u52a8","title":"\u65e0\u7a77\u8fdc\u5e73\u9762"},{"location":"cv/mvg/pjt3d/#_10","text":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u5728 \\(\\pi_\\infty\\) \u4e0a\u4e00\u6761\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u7ebf\u3002\u5728\u5ea6\u91cf\u5750\u6807\u7cfb\u4e2d \\(\\pi_\\infty=(0,0,0,1)^{\\top}\\) \uff0c\u800c\u5728 \\(\\Omega_\\infty\\) \u4e0a\u7684\u70b9\u6ee1\u8db3\uff1a \\(\\left.\\begin{matrix} X_1^2+X_2^2+X_3^2 \\\\ X_4^2 \\end{matrix}\\right\\} = 0\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u4e0d\u52a8\u4e8c\u6b21\u66f2\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \\(\\Omega_\\infty\\) \u5728\u4e00\u822c\u76f8\u4f3c\u53d8\u6362\u4e0b\u662f\u96c6\u5408\u4e0d\u61c2\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\u7684 \u6240\u6709\u7684\u5706\u4ea4 \\(\\Omega_\\infty\\) \u4e8e\u4e24\u70b9\uff0c\u8fd9\u4e24\u70b9\u662f\u865a\u5706\u70b9 \u6240\u6709\u7403\u9762\u4ea4 \\(\\pi_\\infty\\) \u4e8e \\(\\Omega_\\infty\\) \u5ea6\u91cf\u6027\u8d28 \uff1a\u4e00\u65e6 \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u8bf8\u5982\u5939\u89d2\u548c\u76f8\u5bf9\u957f\u5ea6\u7b49\u5ea6\u6700\u6027\u8d28\u53ef\u4ee5\u88ab\u6d4b\u5b9a\u3002\u8bbe\u4e24\u6761\u76f4\u7ebf\u7684\u65b9\u5411\u4e3a \\(d_1\\) \u548c \\(d_2\\) \uff083 \u7ef4\u77e2\u91cf\uff09\uff0c\u5219 \\[ \\cos \\theta = \\frac{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2)}{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_1)(\\mathbf{d}_2^{\\top} \\Omega_\\infty \\mathbf{d}_2)} \\] \u6b63\u4ea4\u4e0e\u914d\u6781 \uff1a\u5982\u679c \\(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2=0\\) \uff0c\u5219 \\(\\mathbf{d}_1\\) \u548c \\(\\mathbf{d}_2\\) \u76f8\u5782\u76f4\u3002\u56e0\u800c\u5782\u76f4\u6027\u53ef\u7531\u5173\u4e8e \\(\\Omega_\\infty\\) \u7684\u5171\u8f6d\u6027\u6765\u8868\u5f81","title":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf"},{"location":"cv/mvg/pjt3d/#_11","text":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u7684\u5bf9\u5076\u662f 3 \u7ef4\u7a7a\u95f4\u4e2d\u4e00\u79cd\u9000\u5316\u7684\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\uff0c\u79f0\u4e3a\u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\u5e76\u8bb0\u4e3a \\(Q_\\infty^*\\) \u3002\u4ece\u51e0\u4f55\u4e0a\u8bf4\uff0c \\(Q_\\infty^*\\) \u7531 \\(\\Omega_\\infty\\) \u7684\u5207\u5e73\u9762\u7ec4\u6210\uff0c\u5b83\u88ab\u79f0\u4e3a \u8fb9\u4e8c\u6b21\u66f2\u9762 \u3002\u5b83\u5728 3 \u7ef4\u5ea6\u91cf\u7a7a\u95f4\u7684\u6807\u51c6\u5f62\u5f0f\u662f\uff1a \\(Q_\\infty^* = \\begin{bmatrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 0 \\end{bmatrix}\\) \u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \\(Q_\\infty^*\\) \u4e0d\u52a8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\pi_\\infty\\) \u662f \\(Q_\\infty^*\\) \u7684\u96f6\u77e2\u91cf \u4e24\u5f20\u5e73\u9762 \\(\\pi_1\\) \u548c \\(\\pi_2\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7531\u4e0b\u5f0f\u7ed9\u51fa\uff1a \\[ \\cos \\theta = \\frac{\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_2}{\\sqrt{(\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_1)(\\mathbf{\\pi}_2^{\\top} Q_\\infty^* \\mathbf{\\pi}_2)}} \\]","title":"\u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762"},{"location":"cv/papers/","text":"SLAM \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u89c6\u89c9\u7684\u76f8\u5173\u7b14\u8bb0 Table of Contents \u00b6 Dynamic-SLAM \u7cfb\u5217 DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM NeRF \u7cfb\u5217 NeRF DDN-SLAM Co-SLAM NID-SLAM iMAP NICE-SLAM NeRF-Evaluation 3DGS \u7cfb\u5217 3DGS SplaTAM 4DGS \u6742\u9879 SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation Reference \u00b6 \u3010\u52a8\u6001SLAM\u3011\u5feb\u901f\u5165\u95e8\uff08\u539f\u7406\u4ecb\u7ecd\u53ca\u7ecf\u5178\u7b97\u6cd5\uff09 \u3010\u52a8\u6001SLAM\u3011\u52a8\u6001\u573a\u666f\u4e0b\u5b9e\u65f6\u4e09\u7ef4\u91cd\u5efa\u8bba\u6587\u6c47\u603b \u3010\u52a8\u6001SLAM\u3011\u7ecf\u5178\u5f00\u6e90\u8bba\u6587\uff08\u66f4\u65b0\u4e2d\uff09 \u52a8\u6001\u73af\u5883SLAM\u4e13\u9898(\u56db) | \u601d\u8003\u6846\u67b6 \u52a8\u6001\u73af\u5883\u4e0b\u7684slam\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f SLAM\u4e2d\u53bb\u9664\u52a8\u6001\u7269\u4f53\u7684\u90e8\u5206\u65b9\u6cd5\uff08\u4e3b\u8981\u662f\u89c6\u89c9SLAM\uff09 SLAM\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u53bb\u9664\u95ee\u9898 \u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684\uff08NeRF-based\uff09 SLAM \u7efc\u8ff0 \u89e3\u9501SLAM\u65b0\u7eaa\u5143\uff01\u57fa\u4e8eNeRF\u548c3D GS\u65b9\u6cd5\u7efc\u8ff0 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u2014NeRF SLAM\uff08\u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684SLAM\uff09","title":"SLAM"},{"location":"cv/papers/#slam","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u89c6\u89c9\u7684\u76f8\u5173\u7b14\u8bb0","title":"SLAM"},{"location":"cv/papers/#table-of-contents","text":"Dynamic-SLAM \u7cfb\u5217 DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM NeRF \u7cfb\u5217 NeRF DDN-SLAM Co-SLAM NID-SLAM iMAP NICE-SLAM NeRF-Evaluation 3DGS \u7cfb\u5217 3DGS SplaTAM 4DGS \u6742\u9879 SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation","title":"Table of Contents"},{"location":"cv/papers/#reference","text":"\u3010\u52a8\u6001SLAM\u3011\u5feb\u901f\u5165\u95e8\uff08\u539f\u7406\u4ecb\u7ecd\u53ca\u7ecf\u5178\u7b97\u6cd5\uff09 \u3010\u52a8\u6001SLAM\u3011\u52a8\u6001\u573a\u666f\u4e0b\u5b9e\u65f6\u4e09\u7ef4\u91cd\u5efa\u8bba\u6587\u6c47\u603b \u3010\u52a8\u6001SLAM\u3011\u7ecf\u5178\u5f00\u6e90\u8bba\u6587\uff08\u66f4\u65b0\u4e2d\uff09 \u52a8\u6001\u73af\u5883SLAM\u4e13\u9898(\u56db) | \u601d\u8003\u6846\u67b6 \u52a8\u6001\u73af\u5883\u4e0b\u7684slam\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f SLAM\u4e2d\u53bb\u9664\u52a8\u6001\u7269\u4f53\u7684\u90e8\u5206\u65b9\u6cd5\uff08\u4e3b\u8981\u662f\u89c6\u89c9SLAM\uff09 SLAM\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u53bb\u9664\u95ee\u9898 \u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684\uff08NeRF-based\uff09 SLAM \u7efc\u8ff0 \u89e3\u9501SLAM\u65b0\u7eaa\u5143\uff01\u57fa\u4e8eNeRF\u548c3D GS\u65b9\u6cd5\u7efc\u8ff0 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u2014NeRF SLAM\uff08\u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684SLAM\uff09","title":"Reference"},{"location":"cv/papers/3dgs/","text":"3DGS \u7cfb\u5217 \u00b6 Abstract 3DGS \u7cfb\u5217\u76f8\u5173\u5185\u5bb9 Table of Contents \u00b6 3DGS SplaTAM 4DGS","title":"3DGS \u7cfb\u5217"},{"location":"cv/papers/3dgs/#3dgs","text":"Abstract 3DGS \u7cfb\u5217\u76f8\u5173\u5185\u5bb9","title":"3DGS \u7cfb\u5217"},{"location":"cv/papers/3dgs/#table-of-contents","text":"3DGS SplaTAM 4DGS","title":"Table of Contents"},{"location":"cv/papers/3dgs/3dgs/","text":"3DGS \u00b6 \u7ea6 2609 \u4e2a\u5b57 174 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract paper\uff1a 3DGS: 3D Gaussian Splatting for Real-Time Radiance Field Rendering code\uff1a gaussian-splatting Idea \u00b6 Introduction \u00b6 \u57fa\u4e8e Splatting \u548c\u673a\u5668\u5b66\u4e60\u7684\u4e09\u7ef4\u91cd\u5efa\u65b9\u6cd5\uff0c\u7528\u4e8e \u5b9e\u65f6\u4e14\u903c\u771f\u5730\u6e32\u67d3\u4ece\u4e00\u7ec4\u56fe\u50cf\u4e2d\u5b66\u5230\u7684\u573a\u666f \uff0c\u6539\u5584 NeRF \u7684\u8bad\u7ec3\u901f\u5ea6\u548c\u6e32\u67d3\u8d28\u91cf\u7684\u74f6\u9888\u95ee\u9898\uff0c \u4fdd\u6301\u6709\u7ade\u4e89\u529b\u7684\u8bad\u7ec3\u65f6\u95f4\u7684\u540c\u65f6\u5b9e\u73b0\u6700\u5148\u8fdb\u7684\u89c6\u89c9\u8d28\u91cf\uff0c\u5141\u8bb8\u5728 1080p \u5206\u8fa8\u7387\u4e0b\u5b9e\u73b0\u9ad8\u8d28\u91cf\u7684\u5b9e\u65f6\uff08 >= 30 fps\uff09\u7684\u65b0\u89c6\u56fe\u5408\u6210 3DGS \u8fdb\u884c\u573a\u666f\u8868\u8fbe \uff0c\u591a\u4e2a\u9ad8\u65af\u6a21\u578b\u5171\u540c\u6784\u6210\u6574\u4e2a\u573a\u666f\u7684\u8fde\u7eed\u4f53\u79ef\u8868\u793a \u4ece\u6700\u521d\u7531 SfM \u751f\u6210\u7684\u7a00\u758f\u70b9\u5f00\u59cb\u521d\u59cb\u5316 3DGS\u8fd9\u79cd\u57fa\u5143\uff0c\u7ee7\u627f \u53ef\u5fae\u5206 \u4f53\u79ef\u8868\u793a\u7684\u5c5e\u6027\uff0c\u540c\u65f6\u662f \u975e\u7ed3\u6784\u5316 \u548c \u663e\u5f0f \u7684\uff0c\u5bb9\u6613\u6295\u5f71\u5230 2D\uff0c\u5feb\u901f \\(\\alpha\\) -blender \u81ea\u9002\u5e94\u5bc6\u5ea6\u63a7\u5236\u4f18\u5316 \uff1a\u9488\u5bf9 3DGS \u7684\u5404\u79cd\u5c5e\u6027 \uff08\u4f4d\u7f6e\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u5404\u5411\u5f02\u6027\u534f\u65b9\u5dee\u548c\u7403\u8c10\u51fd\u6570\uff09 \u8fdb\u884c\u4f18\u5316\uff0c\u4e14\u4ea4\u9519\u8fdb\u884c\uff0c\u5305\u62ec\u5728\u4f18\u5316\u8fc7\u7a0b\u4e2d\u79fb\u9664 3DGS\uff0c\u4ee5\u6b64\u7cbe\u786e\u8868\u8fbe\u573a\u666f \u5feb\u901f\u5149\u6805\u5316 \uff1a\u4f7f\u7528\u9ad8\u901f GPU\uff0c\u652f\u6301\u5404\u5411\u5f02\u6027\u629b\u96ea\u7403\uff0c\u4fdd\u8bc1\u9ad8\u8d28\u91cf\u5b9e\u65f6\u6e32\u67d3 Splatting \u00b6 \u4ec0\u4e48\u662f Splatting\uff1f\u4ec0\u4e48\u662f 3DGS\uff1f\u4e3a\u4ec0\u4e48\u9009\u62e9 GS\uff1f \u4e00\u79cd\u4f53\u6e32\u67d3\u7684\u65b9\u6cd5\uff08\u629b\u96ea\u7403\u6cd5\u3001\u8db3\u8ff9\u6cd5\u3001\u55b7\u6e85\uff09\uff1a\u4ece 3D \u7269\u4f53\u6e32\u67d3\u5230 2D \u5e73\u9762 NeRF \u662f\u88ab\u52a8\u7684\uff0c\u65b9\u5f0f\u662f Ray-casting \uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u50cf\u7d20\u70b9\u6536\u5230\u53d1\u5149\u7c92\u5b50\u7684\u5f71\u54cd\u6765\u751f\u6210\u56fe\u50cf Splatting \u662f\u4e3b\u52a8\u7684\uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u53d1\u5149\u7c92\u5b50\u5982\u4f55\u5f71\u54cd\u50cf\u7d20\u70b9 \u60f3\u8c61\u8f93\u5165\u662f\u4e00\u4e9b\u96ea\u7403\uff0c\u56fe\u7247\u662f\u4e00\u9762\u7816\u5899\uff0c\u56fe\u50cf\u751f\u6210\u8fc7\u7a0b\u662f\u5411\u5899\u9762\u6254\u96ea\u7403\u7684\u8fc7\u7a0b\uff0c\u6bcf\u6254\u4e00\u4e2a\u96ea\u7403\uff0c\u5899\u4e0a\u90fd\u6709\u6269\u6563\u75d5\u8ff9 footprint\uff0c\u6d41\u7a0b\uff1a \u9009\u62e9\u96ea\u7403 \u629b\u63b7\u96ea\u7403\uff0c\u4ece 3D \u6295\u5f71\u5230 2D\uff0c\u5f97\u5230\u8db3\u8ff9 \u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u56fe\u50cf \u9009\u62e9\u96ea\u7403 3DGS \u00b6 \u8f93\u5165\u662f\u70b9\u4e91\uff0c\u65e0\u4f53\u79ef\uff0c\u9700\u8981\u4e00\u4e2a \u6838 \u8fdb\u884c\u81a8\u80c0\uff0c\u53ef\u4ee5\u7528\u9ad8\u65af/\u5706/\u6b63\u65b9\u4f53... \u9009\u62e9\u9ad8\u65af\u7684\u7406\u7531\uff0c\u6709\u5f88\u597d\u7684\u6570\u5b66\u6027\u8d28\uff1a \u4eff\u5c04\u53d8\u6362\u540e\u9ad8\u65af\u6838\u4ecd\u7136\u95ed\u5408 3D \u964d\u5230 2D \u540e\uff08\u6cbf\u7740\u67d0\u4e00\u8f74\u79ef\u5206\uff09\u4ecd\u7136\u662f\u9ad8\u65af \u692d\u7403\u9ad8\u65af \\(G(x;\\mu,\\sum)=\\frac{1}{\\sqrt{(2\\pi)^k \\left | \\sum \\right |}} \\exp^{-\\frac{1}{2}(x-\\mu)^\\top\\sum^{-1}(x-\\mu)}\\) \uff0c \\(\\mu\\) \u8868\u793a\u5747\u503c\uff0c \\(\\sum\\) \u8868\u793a\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u534a\u6b63\u5b9a\uff08\u9ad8\u7ef4\u65f6\u4ece\u65b9\u5dee\u53d8\u6210\u534f\u65b9\u5dee\u77e9\u9635\uff09 \u4e3a\u4ec0\u4e48 3DGS \u662f\u692d\u7403\uff1f \u5404\u5411\u540c\u6027\u548c\u5404\u5411\u5f02\u6027 \u5404\u5411\u540c\u6027 \u5728\u6240\u6709\u65b9\u5411\u5177\u6709\u76f8\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma^2 & 0 &0 \\\\ 0 & \\sigma^2 &0 \\\\ 0 & 0 & \\sigma^2 \\end{bmatrix} \\] \u5404\u5411\u5f02\u6027 \u5728\u4e0d\u540c\u65b9\u5411\u5177\u6709\u4e0d\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u692d\u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma_x^2 & \\sigma_{xy} & \\sigma_{xz} \\\\ \\sigma_{yx} & \\sigma_y^2 & \\sigma_{yz} \\\\ \\sigma_{zx} & \\sigma_{zy} & \\sigma_z^2 \\end{bmatrix} \\] 3DGS \u4e0e\u534f\u65b9\u5dee\u77e9\u9635 \u00b6 \u534f\u65b9\u5dee\u77e9\u9635\u548c\u692d\u7403\u6709\u4ec0\u4e48\u5173\u7cfb\uff1f\u4e3a\u4ec0\u4e48\u80fd\u63a7\u5236\u692d\u7403\u5f62\u72b6\uff1f \u9ad8\u65af\u5206\u5e03\u7684\u4eff\u5c04\u53d8\u6362\uff1a \\(\\mathcal{w}=A \\mathcal{x} + b\\) \\(\\mathcal{w} \\thicksim N(A\\mu+b, A\\sum A^\\top)\\) \\(\\sum=A \\cdot I \\cdot A^\\top\\) \u5373\u4efb\u610f\u9ad8\u65af\u53ef\u4ee5\u770b\u4f5c\u662f\u6807\u51c6\u9ad8\u65af\u901a\u8fc7\u4eff\u5c04\u53d8\u6362\u5f97\u5230 \u534f\u65b9\u5dee\u77e9\u9635\u4e3a\u4ec0\u4e48\u80fd\u7528\u7f29\u653e\u548c\u65cb\u8f6c\u77e9\u9635\u8868\u8fbe\uff1f \\(A = RS\\) \\(\\sum=A \\cdot I \\cdot A^\\top = R \\cdot S \\cdot I \\cdot (R \\cdot S)^\\top = R \\cdot S \\cdot S^\\top \\cdot R^\\top\\) \u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635 Code # covariance = RS[S^T][R^T] def computeCov3D ( scale , mod , rot ): # create scaling matrix S = np . array ( [[ scale [ 0 ] * mod , 0 , 0 ], [ 0 , scale [ 1 ] * mod , 0 ], [ 0 , 0 , scale [ 2 ] * mod ]] ) # normalize quaternion to get valid rotation # we use rotation matrix R = rot # compute 3d world covariance matrix Sigma M = np . dot ( R , S ) cov3D = np . dot ( M , M . T ) return cov3D \u629b\u96ea\u7403 \u4ece 3D \u5230\u50cf\u7d20 \u00b6 \u5728\u76f8\u673a\u6a21\u578b\u4e2d\uff1a\u4e16\u754c\u5750\u6807\u7cfb\u3001\u76f8\u673a\u5750\u6807\u7cfb\u3001\u5f52\u4e00\u5316\u5750\u6807\u7cfb\u3001\u50cf\u7d20\u5750\u6807\u7cfb \u5728 CG \u4e2d\uff1a\u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\uff1a \u4ece\u4e16\u754c\u5750\u6807\u7cfb\u5230\u76f8\u673a\u5750\u6807\u7cfb \u4eff\u5c04\u53d8\u6362 \\(\\mathcal{w}=A \\mathcal{x} + b\\) \u6295\u5f71\u53d8\u6362 3D \u5230 2D \u6b63\u4ea4\u6295\u5f71\uff0c\u4e0e z \u65e0\u5173\uff0c\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7acb\u65b9\u4f53\u7f29\u653e\u5230 \\(\\left [-1,1 \\right ]^3\\) \u7684\u6b63\u65b9\u4f53\uff0c\u4eff\u5c04\u53d8\u6362 \u900f\u89c6\u6295\u5f71\uff0c\u4e0e z \u6709\u5173\uff0c\u5148\u628a\u9525\u4f53\u538b\u6210\u7acb\u65b9\u4f53\uff0c\u5728\u6b63\u4ea4\u6295\u5f71 \u89c6\u53e3\u53d8\u6362 \u4e0e z \u65e0\u5173 \u5c06 \\([-1, 1]^2\\) \u7684\u77e9\u5f62\u53d8\u6362\u81f3 \\([0, w] \\times [0, h]\\) \u5149\u6805\u5316 \u628a\u4e1c\u897f\u753b\u5728\u5c4f\u5e55\u4e0a \u8fde\u7eed\u8f6c\u79bb\u6563 \u65b9\u6cd5\uff1a\u91c7\u6837 \u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u6295\u5f71\u53d8\u6362\uff1f \u6295\u5f71\u53d8\u6362\u4e2d\uff1a \u9ad8\u65af\u6838\u4e2d\u5fc3 \\(x_k = [x_0, x_1, x_2]^\\top\\) \u9ad8\u65af\u6838 \\(r_k(x)=G_{v_k}(x-x_k)\\) \u5747\u503c \\(x_k = m(u_k)\\) \uff0c\u4e00\u4e2a\u70b9\uff0c\u4e0d\u4f1a\u5f62\u53d8 \u534f\u65b9\u5dee\u77e9\u9635\uff1f\u900f\u89c6\u6295\u5f71\u5230\u6b63\u4ea4\u6295\u5f71\u662f\u975e\u7ebf\u6027\u53d8\u6362\uff0c\u5373\u975e\u4eff\u5c04\u53d8\u6362\uff0c\u4f46\u9ad8\u65af\u692d\u7403\u4e00\u76f4\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528 \u5f15\u5165\u96c5\u53ef\u6bd4\u8fd1\u4f3c\u77e9\u9635 \u6cf0\u52d2\u5c55\u5f00\u3001\u7ebf\u6027\u903c\u8fd1 \u5bf9\u975e\u7ebf\u6027\u53d8\u6362\u7684\u5c40\u90e8\u7ebf\u6027\u8fd1\u4f3c \u53ef\u8ba1\u7b97\u5f97 \\(J = \\frac{\\partial m(u_k)}{\\partial u}\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(V_k = J V_k^\\prime j^\\top = JWV_k^{\\prime \\prime} W^\\top J^\\top\\) \u89c6\u53e3\u53d8\u6362 \u6b64\u65f6\u5747\u503c\u548c\u534f\u65b9\u5dee\u5728\u4e00\u4e2a\u5750\u6807\u7cfb\u5417\uff1f \u5747\u503c\uff1a\u5728 NDC \u5750\u6807\u7cfb \\([-1, 1]^3\\) \uff0c\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u534f\u65b9\u5dee\u77e9\u9635\uff1a\u5728\u672a\u7f29\u653e\u7684\u6b63\u4ea4\u5750\u6807\u7cfb \\([l,r] \\times [b, t] \\times [f, n]\\) \uff0c\u4e0d\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u5bf9\u4e8e\u9ad8\u65af\u6838\u4e2d\u5fc3 \\(\\mu = [\\mu_1, \\mu_2, \\mu_3]^\\top\\) \u5e73\u79fb + \u7f29\u653e \u5bf9\u4e8e\u534f\u65b9\u5dee\u77e9\u9635 \u8db3\u8ff9\u6e32\u67d3\uff1a\u79bb\u6563\u8ba1\u7b97 \\(G(\\hat{x}) = \\exp(-\\frac{1}{2} (x-\\mu)^\\top V_k^{-1}(x-\\mu))\\) 3DGS \u4e2d\u5fc3\u7684\u53d8\u6362 Code # transform point, from world to ndc # Notice, projmatrix already processed as mvp matrix p_hom = transformPoint4x4 ( p_orig , projmatrix ) p_w = 1 / ( p_hom [ 3 ] + 0.0000001 ) p_proj = [ p_hom [ 0 ] * p_w , p_hom [ 1 ] * p_w , p_hom [ 2 ] * p_w ] # transfrom point from NDC to Pixel point_image = [ ndc2Pix ( p_proj [ 0 ], W ), ndc2Pix ( p_proj [ 1 ], H )] 3DGS \u534f\u65b9\u5dee\u77e9\u9635\u7684\u53d8\u6362 Code def computeCov2D ( mean , focal_x , focal_y , tan_fovx , tan_fovy , cov3D , viewmatrix ): # The following models the steps outlined by equations 29 # and 31 in \"EWA Splatting\" (Zwicker et al., 2002). # Additionally considers aspect / scaling of viewport. # Transposes used to account for row-/column-major conventions. t = transformPoint4x3 ( mean , viewmatrix ) limx = 1.3 * tan_fovx limy = 1.3 * tan_fovy txtz = t [ 0 ] / t [ 2 ] tytz = t [ 1 ] / t [ 2 ] t [ 0 ] = min ( limx , max ( - limx , txtz )) * t [ 2 ] t [ 1 ] = min ( limy , max ( - limy , tytz )) * t [ 2 ] J = np . array ( [ [ focal_x / t [ 2 ], 0 , - ( focal_x * t [ 0 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , focal_y / t [ 2 ], - ( focal_y * t [ 1 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , 0 , 0 ], ] ) W = viewmatrix [: 3 , : 3 ] T = np . dot ( J , W ) cov = np . dot ( T , cov3D ) cov = np . dot ( cov , T . T ) # Apply low-pass filter # Every Gaussia should be at least one pixel wide/high # Discard 3rd row and column cov [ 0 , 0 ] += 0.3 cov [ 1 , 1 ] += 0.3 return [ cov [ 0 , 0 ], cov [ 0 , 1 ], cov [ 1 , 1 ]] \u96ea\u7403\u989c\u8272 \u7403\u8c10\u51fd\u6570 \u00b6 \u57fa\u51fd\u6570\uff1a\u4efb\u4f55\u4e00\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u5206\u89e3\u4e3a\u6b63\u5f26\u6838\u4f59\u5f26\u7684\u7ebf\u6027\u7ec4\u5408 \u7403\u8c10\u51fd\u6570 \u4efb\u4f55\u4e00\u4e2a\u7403\u9762\u5750\u6807\u7684\u51fd\u6570\u90fd\u53ef\u4ee5\u7528\u591a\u4e2a\u7403\u8c10\u51fd\u6570\u6765\u8fd1\u4f3c \\(f(t) \\approx \\sum_l \\sum_{m=-l}^l c_l^m y_l^m (\\theta, \\phi)\\) \u5176\u4e2d\uff0c \\(c_l^m\\) \u5404\u9879\u7cfb\u6570\uff0c \\(y^m\\) \u57fa\u51fd\u6570 \u8bba\u6587\u4e2d\u7684 \\(n=4\\) \uff0c\u5171\u6709 16 \u4e2a\u53c2\u6570\uff08\u672c\u8d28\u4e0a\u662f1+3+5+7\uff09 \u7403\u8c10\u51fd\u6570 Code def computeColorFromSH ( deg , pos , campos , sh ): # The implementation is loosely based on code for # \"Differentiable Point-Based Radiance Fields for # Efficient View Synthesis\" by Zhang et al. (2022) dir = pos - campos dir = dir / np . linalg . norm ( dir ) result = SH_C0 * sh [ 0 ] if deg > 0 : x , y , z = dir result = result - SH_C1 * y * sh [ 1 ] + SH_C1 * z * sh [ 2 ] - SH_C1 * x * sh [ 3 ] if deg > 1 : xx = x * x yy = y * y zz = z * z xy = x * y yz = y * z xz = x * z result = ( result + SH_C2 [ 0 ] * xy * sh [ 4 ] + SH_C2 [ 1 ] * yz * sh [ 5 ] + SH_C2 [ 2 ] * ( 2.0 * zz - xx - yy ) * sh [ 6 ] + SH_C2 [ 3 ] * xz * sh [ 7 ] + SH_C2 [ 4 ] * ( xx - yy ) * sh [ 8 ] ) if deg > 2 : result = ( result + SH_C3 [ 0 ] * y * ( 3.0 * xx - yy ) * sh [ 9 ] + SH_C3 [ 1 ] * xy * z * sh [ 10 ] + SH_C3 [ 2 ] * y * ( 4.0 * zz - xx - yy ) * sh [ 11 ] + SH_C3 [ 3 ] * z * ( 2.0 * zz - 3.0 * xx - 3.0 * yy ) * sh [ 12 ] + SH_C3 [ 4 ] * x * ( 4.0 * zz - xx - yy ) * sh [ 13 ] + SH_C3 [ 5 ] * z * ( xx - yy ) * sh [ 14 ] + SH_C3 [ 6 ] * x * ( xx - 3.0 * yy ) * sh [ 15 ] ) result += 0.5 return np . clip ( result , a_min = 0 , a_max = 1 ) \u4e3a\u4ec0\u4e48\u7403\u8c10\u51fd\u6570\u80fd\u66f4\u597d\u5730\u8868\u8fbe\u989c\u8272\uff1f \u6b63\u5e38\u4f7f\u7528\u7684 RGB \u53ea\u6709\u4e09\u4e2a\u53d8\u91cf\u8868\u8fbe \u7403\u8c10\u51fd\u6570\u6709 \\(16 \\times 3\\) \u4e2a\u53d8\u91cf\u8868\u8fbe \u8db3\u8ff9\u5408\u6210 \u76f4\u89c2\u4e0a\u8fdb\u884c \\(\\alpha\\) -blending \u5b9e\u9645\u4e0a 3DGS \u4f9d\u7136\u5bf9\u6bcf\u4e2a\u50cf\u7d20\u7740\u8272\uff0c\u53c2\u8003 NeRF \u5bf9\u5149\u7ebf\u4e0a\u7c92\u5b50\u8fdb\u884c\u6c42\u548c splatting \u6ca1\u6709\u50cf NeRF \u4e00\u6837\u627e\u7c92\u5b50\u7684\u8fc7\u7a0b \u5bf9\u9ad8\u65af\u7403\u6309\u7167\u6df1\u5ea6 z \u6392\u5e8f\uff0c\u6e32\u67d3\u7684\u65f6\u5019\u6254\u7684\u987a\u5e8f\u6709\u5173 \u5feb\u901f\u9ad8\u65af\u5149\u6805\u5316 \u00b6 \u5ef6\u7eed Splatting\uff0c\u5982\u4f55 \u5feb\u901f \u9ad8\u65af\u5149\u6805\u5316\uff1f \u4ece\u50cf\u7d20\u7ea7\u522b\u7684\u64cd\u4f5c\u7406\u89e3\u6e32\u67d3\u8fc7\u7a0b\uff1a\u5bf9\u4e8e\u7ed9\u5b9a\u5750\u6807 \\(x\\) \u7684\u50cf\u7d20\u70b9\uff0c\u53ef\u4ee5\u901a\u8fc7\u89c6\u56fe\u53d8\u5316\u8ba1\u7b97\u51fa\u6240\u6709\u5728\u8be5\u4f4d\u7f6e\u91cd\u53e0\u7684\u9ad8\u65af\u7684\u6df1\u5ea6\u5e76\u6392\u5e8f\uff0c\u6700\u540e\u5bf9\u6392\u5217\u597d\u7684\u9ad8\u65af\u8fdb\u884c \\(\\alpha\\) -blending\uff0c\u8fd4\u56de\u8be5\u50cf\u7d20\u70b9\u6700\u540e\u7684\u989c\u8272\u503c \\[ C = \\sum_{i \\in N} c_i \\alpha^\\prime \\prod_{j=1}^{i-1}(1 - \\alpha_j^\\prime) \\] \u7531\u4e8e\u6392\u5e8f\u8fc7\u7a0b\u96be\u4ee5\u5e76\u884c\u5316\uff0c3dgs \u4f7f\u7528\u4e00\u4e9b\u7b56\u7565\u63d0\u9ad8\u6548\u7387 \u4f7f\u7528\u56fe\u50cf\u5757\u6765\u4ee3\u66ff\u50cf\u7d20\u7ea7\u522b\u7684\u7cbe\u5ea6\uff0c\u6bcf\u4e2a\u5757\u5305\u542b \\(16 \\times 16\\) \u4e2a\u50cf\u7d20\uff0c\u5bf9\u4e8e\u8986\u76d6\u591a\u4e2a\u5757\u7684\u9ad8\u65af\uff0c\u4f5c\u8005\u590d\u5236\u9ad8\u65af\u5e76\u4e3a\u5b83\u4eec\u5206\u914d\u6807\u8bc6\u7b26 \u6bcf\u4e2a\u5757\u72ec\u7acb\u6392\u5e8f\u5e76\u8ba1\u7b97\u989c\u8272\u503c\uff0c\u53ef\u5e76\u884c\u6267\u884c \u81ea\u9002\u5e94\u9ad8\u65af\u5bc6\u5ea6\u63a7\u5236 \u00b6 \u521d\u59cb\u5316\u7684\u70b9\u4e91\u7684\u521d\u59cb\u5f62\u72b6\u662f\u4e00\u4e2a\u7403\uff0c \u5f3a\u4f9d\u8d56 SfM \u751f\u6210\u7684\u521d\u59cb\u70b9\u4e91 \uff0c\u53ef\u80fd\u5bfc\u81f4\u751f\u6210\u9ad8\u65af\u5728\u7a7a\u95f4\u5bc6\u5ea6\u8fc7\u5927\u6216\u8fc7\u5c0f\uff1f \u5177\u4f53\u65b9\u6cd5\u6709 \u70b9\u5bc6\u96c6\u5316 \u548c \u70b9\u526a\u679d \u3002 \u70b9\u5bc6\u96c6\u5316 \u00b6 \u91cd\u5efa\u4e0d\u8db3\u7684\u533a\u57df\u514b\u9686\u5c0f\u9ad8\u65af \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u57fa\u4e8e\u9009\u62e9\u7684\u70b9\u751f\u6210\u65b0\u7684\u70b9\u4e91\u5750\u6807\u3001\u7279\u5f81\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u7f29\u653e\u548c\u65cb\u8f6c \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91\u4e2d \u8c03\u7528 densification_postfix \u51fd\u6570\u5bf9\u70b9\u4e91\u8fdb\u884c\u540e\u5904\u7406 densify_and_clone Code def densify_and_clone ( self , grads , grad_threshold , scene_extent ): # Extract points that satisfy the gradient condition selected_pts_mask = torch . where ( torch . norm ( grads , dim =- 1 ) >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values <= self . percent_dense * scene_extent ) new_xyz = self . _xyz [ selected_pts_mask ] new_features_dc = self . _features_dc [ selected_pts_mask ] new_features_rest = self . _features_rest [ selected_pts_mask ] new_opacities = self . _opacity [ selected_pts_mask ] new_scaling = self . _scaling [ selected_pts_mask ] new_rotation = self . _rotation [ selected_pts_mask ] self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacities , new_scaling , new_rotation ) \u91cd\u5efa\u8fc7\u5ea6\u7684\u533a\u57df\u62c6\u5206\u5927\u9ad8\u65af \u83b7\u53d6\u521d\u59cb\u70b9\u4e91\u7684\u6570\u91cf n_init_points \u521b\u5efa\u4e00\u4e2a\u4e0e\u68af\u5ea6\u76f8\u540c\u5927\u5c0f\u7684\u96f6\u5f20\u91cf padded_grad \uff0c\u5e76\u5c06\u68af\u5ea6\u503c\u586b\u5145\u5230\u5176\u4e2d \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u5c06\u6ee1\u8db3\u6761\u4ef6\u548c\u7f29\u653e\u6761\u4ef6\u7684\u70b9\u590d\u5236 N \u6b21\uff0c\u5e76\u8ba1\u7b97\u65b0\u7684\u5750\u6807\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u548c\u7279\u5f81 \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91 \u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u526a\u679d\u7684\u8fc7\u6ee4\u5668 prune_filter \uff0c\u5176\u4e2d\u5305\u62ec\u539f\u59cb\u70b9\u4e91\u548c\u65b0\u751f\u6210\u70b9\u4e91\u7684\u63a9\u7801 \u6839\u636e\u526a\u679d\u8fc7\u6ee4\u5668\u5220\u9664\u4e0d\u9700\u8981\u7684\u70b9 densify_and_split Code def densify_and_split ( self , grads , grad_threshold , scene_extent , N = 2 ): n_init_points = self . get_xyz . shape [ 0 ] # Extract points that satisfy the gradient condition padded_grad = torch . zeros (( n_init_points ), device = \"cuda\" ) padded_grad [: grads . shape [ 0 ]] = grads . squeeze () selected_pts_mask = torch . where ( padded_grad >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values > self . percent_dense * scene_extent ) stds = self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) means = torch . zeros (( stds . size ( 0 ), 3 ), device = \"cuda\" ) samples = torch . normal ( mean = means , std = stds ) rots = build_rotation ( self . _rotation [ selected_pts_mask ]) . repeat ( N , 1 , 1 ) # \u65b0\u751f\u6210\u70b9\u4e91\u4fe1\u606f\uff08\u7531\u5927\u9ad8\u65af\u5206\u5272\u5e76\u6309\u4e00\u5b9a\u7cfb\u6570\u7f29\u653e\u5f97\u5230\uff09 new_xyz = torch . bmm ( rots , samples . unsqueeze ( - 1 )) . squeeze ( - 1 ) + self . get_xyz [ selected_pts_mask ] . repeat ( N , 1 ) new_scaling = self . scaling_inverse_activation ( self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) / ( 0.8 * N )) new_rotation = self . _rotation [ selected_pts_mask ] . repeat ( N , 1 ) new_features_dc = self . _features_dc [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_features_rest = self . _features_rest [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_opacity = self . _opacity [ selected_pts_mask ] . repeat ( N , 1 ) self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacity , new_scaling , new_rotation ) prune_filter = torch . cat (( selected_pts_mask , torch . zeros ( N * selected_pts_mask . sum (), device = \"cuda\" , dtype = bool ))) # \u88c1\u526a\u8fc7\u7a0b\u53c2\u7167\u5176\u4e0d\u900f\u660e\u5ea6\u503c\u8fdb\u884c\uff0c\u88c1\u526a\u6389\u4e0d\u5fc5\u8981\u7684\u70b9\u63d0\u9ad8\u6548\u7387 self . prune_points ( prune_filter ) \u70b9\u526a\u679d \u00b6 \u5c06\u4e0d\u900f\u660e\u5ea6\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u7684\u70b9\u51cf\u53bb\uff0c\u5c06\u8fc7\u5927\u7684\u4e5f\u51cf\u53bb\uff0c\u7c7b\u4f3c\u4e8e\u6b63\u5219\u5316\u8fc7\u7a0b\u3002\u5e76\u4e14\u5728\u8fed\u4ee3\u4e00\u5b9a\u6b21\u6570\u540e\uff0c\u9ad8\u65af\u4f1a\u88ab\u8bbe\u7f6e\u4e3a\u51e0\u4e4e\u900f\u660e\u3002\u8fd9\u6837\u5c31\u80fd\u6709\u63a7\u5236\u5730\u589e\u52a0\u5fc5\u8981\u7684\u9ad8\u65af\u5bc6\u5ea6\uff0c\u540c\u65f6\u5254\u9664\u591a\u4f59\u7684\u9ad8\u65af\u3002 \u6839\u636e\u6700\u5c0f\u4e0d\u900f\u660e\u5ea6\u548c\u6700\u5927\u5c4f\u5e55\u5c3a\u5bf8\u7b49\u6761\u4ef6\u751f\u6210\u526a\u679d\u63a9\u7801 prune_mask \uff0c\u5e76\u8c03\u7528 prune_points \u51fd\u6570\u8fdb\u884c\u70b9\u4e91\u7684\u526a\u679d\u64cd\u4f5c prune_points \u51fd\u6570\u6839\u636e\u7ed9\u5b9a\u7684\u63a9\u7801 mask \u5bf9\u70b9\u4e91\u8fdb\u884c\u526a\u679d\u64cd\u4f5c\uff0c\u5c06\u4e0d\u9700\u8981\u7684\u70b9\u4ece\u70b9\u4e91\u4e2d\u5220\u9664\uff0c\u5e76\u66f4\u65b0\u76f8\u5173\u7684\u5f20\u91cf\u6570\u636e densify_and_prune Code def densify_and_prune ( self , max_grad , min_opacity , extent , max_screen_size ): grads = self . xyz_gradient_accum / self . denom grads [ grads . isnan ()] = 0.0 # \u70b9\u5bc6\u96c6\u5316\u8fc7\u7a0b self . densify_and_clone ( grads , max_grad , extent ) self . densify_and_split ( grads , max_grad , extent ) prune_mask = ( self . get_opacity < min_opacity ) . squeeze () if max_screen_size : big_points_vs = self . max_radii2D > max_screen_size big_points_ws = self . get_scaling . max ( dim = 1 ) . values > 0.1 * extent prune_mask = torch . logical_or ( torch . logical_or ( prune_mask , big_points_vs ), big_points_ws ) self . prune_points ( prune_mask ) torch . cuda . empty_cache () def prune_points ( self , mask ): valid_points_mask = ~ mask optimizable_tensors = self . _prune_optimizer ( valid_points_mask ) self . _xyz = optimizable_tensors [ \"xyz\" ] self . _features_dc = optimizable_tensors [ \"f_dc\" ] self . _features_rest = optimizable_tensors [ \"f_rest\" ] self . _opacity = optimizable_tensors [ \"opacity\" ] self . _scaling = optimizable_tensors [ \"scaling\" ] self . _rotation = optimizable_tensors [ \"rotation\" ] self . xyz_gradient_accum = self . xyz_gradient_accum [ valid_points_mask ] self . denom = self . denom [ valid_points_mask ] self . max_radii2D = self . max_radii2D [ valid_points_mask ] \u53c2\u6570\u4f30\u8ba1 \u00b6 \u521d\u59cb\u70b9\u4e91\uff0c\u6bcf\u4e2a\u70b9\u81a8\u80c0\u6210 3d \u9ad8\u65af\u692d\u7403 \u5219\u6bcf\u4e2a\u692d\u7403\u7684\u53c2\u6570\u6709\uff1a \u4e2d\u5fc3\u70b9\u4f4d\u7f6e \\((x,y,z)\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(R,S\\) \u7403\u8c10\u51fd\u6570\u7cfb\u6570 \\(16 \\times 3\\) \u900f\u660e\u5ea6 \\(\\alpha\\) Source Code Review \u00b6 \u5b66\u4e60\u81ea \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb_gaussian splatting\u6e90\u7801\u5206\u6790-CSDN\u535a\u5ba2 Experiment \u00b6 \u786c\u4ef6\u914d\u7f6e Ubuntu 20.04 + 4060Ti + CUDA 11.8 \u8dd1\u5728 Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09 Office Scenes \u00b6 Own Scenes \u00b6 Reference \u00b6 3D GaussianSplatting \u6280\u672f\u7684\u5f71\u54cd\u4f1a\u6709\u591a\u5927\uff1f \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-3d gaussian splatting \u5168\u89e3(\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f) 3D Gaussian Splatting\u539f\u7406\u901f\u901a \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0a\uff09 \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0b\uff09 \uff08\u5e72\u8d27\uff09\u300a\u96c5\u53ef\u6bd4\u77e9\u9635\u662f\u4ec0\u4e48\u4e1c\u897f\u300b3Blue1Brown\uff0c\u642c\u81ea\u53ef\u6c57\u5b66\u9662\u3002 \u3010\u81ea\u5236\u4e2d\u6587\u5b57\u5e55\u3011 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb 3dgs_\u8721\u7b14\u5c0f\u65b0\u914d\u5409\u826f\u5409\u5f71\u7684\u535a\u5ba2-CSDN\u535a\u5ba2 \uff08\u4e09\u7ef4\u91cd\u5efa\u5b66\u4e60\uff093D Gaussian Splatting & Instant-NGP\u73af\u5883\u914d\u7f6e_3d gaussian splatting \u73af\u5883\u642d\u5efa-CSDN\u535a\u5ba2 Gaussian Splatting\u4ee3\u7801\u5b89\u88c5\u90e8\u7f72\uff08windows\uff09_gaussian splatting github-CSDN\u535a\u5ba2 3D Gaussian Splatting\u5165\u95e8\u6307\u5357 - \u54d4\u54e9\u54d4\u54e9","title":"3DGS"},{"location":"cv/papers/3dgs/3dgs/#3dgs","text":"\u7ea6 2609 \u4e2a\u5b57 174 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract paper\uff1a 3DGS: 3D Gaussian Splatting for Real-Time Radiance Field Rendering code\uff1a gaussian-splatting","title":"3DGS"},{"location":"cv/papers/3dgs/3dgs/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/3dgs/#introduction","text":"\u57fa\u4e8e Splatting \u548c\u673a\u5668\u5b66\u4e60\u7684\u4e09\u7ef4\u91cd\u5efa\u65b9\u6cd5\uff0c\u7528\u4e8e \u5b9e\u65f6\u4e14\u903c\u771f\u5730\u6e32\u67d3\u4ece\u4e00\u7ec4\u56fe\u50cf\u4e2d\u5b66\u5230\u7684\u573a\u666f \uff0c\u6539\u5584 NeRF \u7684\u8bad\u7ec3\u901f\u5ea6\u548c\u6e32\u67d3\u8d28\u91cf\u7684\u74f6\u9888\u95ee\u9898\uff0c \u4fdd\u6301\u6709\u7ade\u4e89\u529b\u7684\u8bad\u7ec3\u65f6\u95f4\u7684\u540c\u65f6\u5b9e\u73b0\u6700\u5148\u8fdb\u7684\u89c6\u89c9\u8d28\u91cf\uff0c\u5141\u8bb8\u5728 1080p \u5206\u8fa8\u7387\u4e0b\u5b9e\u73b0\u9ad8\u8d28\u91cf\u7684\u5b9e\u65f6\uff08 >= 30 fps\uff09\u7684\u65b0\u89c6\u56fe\u5408\u6210 3DGS \u8fdb\u884c\u573a\u666f\u8868\u8fbe \uff0c\u591a\u4e2a\u9ad8\u65af\u6a21\u578b\u5171\u540c\u6784\u6210\u6574\u4e2a\u573a\u666f\u7684\u8fde\u7eed\u4f53\u79ef\u8868\u793a \u4ece\u6700\u521d\u7531 SfM \u751f\u6210\u7684\u7a00\u758f\u70b9\u5f00\u59cb\u521d\u59cb\u5316 3DGS\u8fd9\u79cd\u57fa\u5143\uff0c\u7ee7\u627f \u53ef\u5fae\u5206 \u4f53\u79ef\u8868\u793a\u7684\u5c5e\u6027\uff0c\u540c\u65f6\u662f \u975e\u7ed3\u6784\u5316 \u548c \u663e\u5f0f \u7684\uff0c\u5bb9\u6613\u6295\u5f71\u5230 2D\uff0c\u5feb\u901f \\(\\alpha\\) -blender \u81ea\u9002\u5e94\u5bc6\u5ea6\u63a7\u5236\u4f18\u5316 \uff1a\u9488\u5bf9 3DGS \u7684\u5404\u79cd\u5c5e\u6027 \uff08\u4f4d\u7f6e\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u5404\u5411\u5f02\u6027\u534f\u65b9\u5dee\u548c\u7403\u8c10\u51fd\u6570\uff09 \u8fdb\u884c\u4f18\u5316\uff0c\u4e14\u4ea4\u9519\u8fdb\u884c\uff0c\u5305\u62ec\u5728\u4f18\u5316\u8fc7\u7a0b\u4e2d\u79fb\u9664 3DGS\uff0c\u4ee5\u6b64\u7cbe\u786e\u8868\u8fbe\u573a\u666f \u5feb\u901f\u5149\u6805\u5316 \uff1a\u4f7f\u7528\u9ad8\u901f GPU\uff0c\u652f\u6301\u5404\u5411\u5f02\u6027\u629b\u96ea\u7403\uff0c\u4fdd\u8bc1\u9ad8\u8d28\u91cf\u5b9e\u65f6\u6e32\u67d3","title":"Introduction"},{"location":"cv/papers/3dgs/3dgs/#splatting","text":"\u4ec0\u4e48\u662f Splatting\uff1f\u4ec0\u4e48\u662f 3DGS\uff1f\u4e3a\u4ec0\u4e48\u9009\u62e9 GS\uff1f \u4e00\u79cd\u4f53\u6e32\u67d3\u7684\u65b9\u6cd5\uff08\u629b\u96ea\u7403\u6cd5\u3001\u8db3\u8ff9\u6cd5\u3001\u55b7\u6e85\uff09\uff1a\u4ece 3D \u7269\u4f53\u6e32\u67d3\u5230 2D \u5e73\u9762 NeRF \u662f\u88ab\u52a8\u7684\uff0c\u65b9\u5f0f\u662f Ray-casting \uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u50cf\u7d20\u70b9\u6536\u5230\u53d1\u5149\u7c92\u5b50\u7684\u5f71\u54cd\u6765\u751f\u6210\u56fe\u50cf Splatting \u662f\u4e3b\u52a8\u7684\uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u53d1\u5149\u7c92\u5b50\u5982\u4f55\u5f71\u54cd\u50cf\u7d20\u70b9 \u60f3\u8c61\u8f93\u5165\u662f\u4e00\u4e9b\u96ea\u7403\uff0c\u56fe\u7247\u662f\u4e00\u9762\u7816\u5899\uff0c\u56fe\u50cf\u751f\u6210\u8fc7\u7a0b\u662f\u5411\u5899\u9762\u6254\u96ea\u7403\u7684\u8fc7\u7a0b\uff0c\u6bcf\u6254\u4e00\u4e2a\u96ea\u7403\uff0c\u5899\u4e0a\u90fd\u6709\u6269\u6563\u75d5\u8ff9 footprint\uff0c\u6d41\u7a0b\uff1a \u9009\u62e9\u96ea\u7403 \u629b\u63b7\u96ea\u7403\uff0c\u4ece 3D \u6295\u5f71\u5230 2D\uff0c\u5f97\u5230\u8db3\u8ff9 \u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u56fe\u50cf","title":"Splatting"},{"location":"cv/papers/3dgs/3dgs/#3dgs_1","text":"\u8f93\u5165\u662f\u70b9\u4e91\uff0c\u65e0\u4f53\u79ef\uff0c\u9700\u8981\u4e00\u4e2a \u6838 \u8fdb\u884c\u81a8\u80c0\uff0c\u53ef\u4ee5\u7528\u9ad8\u65af/\u5706/\u6b63\u65b9\u4f53... \u9009\u62e9\u9ad8\u65af\u7684\u7406\u7531\uff0c\u6709\u5f88\u597d\u7684\u6570\u5b66\u6027\u8d28\uff1a \u4eff\u5c04\u53d8\u6362\u540e\u9ad8\u65af\u6838\u4ecd\u7136\u95ed\u5408 3D \u964d\u5230 2D \u540e\uff08\u6cbf\u7740\u67d0\u4e00\u8f74\u79ef\u5206\uff09\u4ecd\u7136\u662f\u9ad8\u65af \u692d\u7403\u9ad8\u65af \\(G(x;\\mu,\\sum)=\\frac{1}{\\sqrt{(2\\pi)^k \\left | \\sum \\right |}} \\exp^{-\\frac{1}{2}(x-\\mu)^\\top\\sum^{-1}(x-\\mu)}\\) \uff0c \\(\\mu\\) \u8868\u793a\u5747\u503c\uff0c \\(\\sum\\) \u8868\u793a\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u534a\u6b63\u5b9a\uff08\u9ad8\u7ef4\u65f6\u4ece\u65b9\u5dee\u53d8\u6210\u534f\u65b9\u5dee\u77e9\u9635\uff09 \u4e3a\u4ec0\u4e48 3DGS \u662f\u692d\u7403\uff1f \u5404\u5411\u540c\u6027\u548c\u5404\u5411\u5f02\u6027 \u5404\u5411\u540c\u6027 \u5728\u6240\u6709\u65b9\u5411\u5177\u6709\u76f8\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma^2 & 0 &0 \\\\ 0 & \\sigma^2 &0 \\\\ 0 & 0 & \\sigma^2 \\end{bmatrix} \\] \u5404\u5411\u5f02\u6027 \u5728\u4e0d\u540c\u65b9\u5411\u5177\u6709\u4e0d\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u692d\u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma_x^2 & \\sigma_{xy} & \\sigma_{xz} \\\\ \\sigma_{yx} & \\sigma_y^2 & \\sigma_{yz} \\\\ \\sigma_{zx} & \\sigma_{zy} & \\sigma_z^2 \\end{bmatrix} \\]","title":"\u9009\u62e9\u96ea\u7403 3DGS"},{"location":"cv/papers/3dgs/3dgs/#3dgs_2","text":"\u534f\u65b9\u5dee\u77e9\u9635\u548c\u692d\u7403\u6709\u4ec0\u4e48\u5173\u7cfb\uff1f\u4e3a\u4ec0\u4e48\u80fd\u63a7\u5236\u692d\u7403\u5f62\u72b6\uff1f \u9ad8\u65af\u5206\u5e03\u7684\u4eff\u5c04\u53d8\u6362\uff1a \\(\\mathcal{w}=A \\mathcal{x} + b\\) \\(\\mathcal{w} \\thicksim N(A\\mu+b, A\\sum A^\\top)\\) \\(\\sum=A \\cdot I \\cdot A^\\top\\) \u5373\u4efb\u610f\u9ad8\u65af\u53ef\u4ee5\u770b\u4f5c\u662f\u6807\u51c6\u9ad8\u65af\u901a\u8fc7\u4eff\u5c04\u53d8\u6362\u5f97\u5230 \u534f\u65b9\u5dee\u77e9\u9635\u4e3a\u4ec0\u4e48\u80fd\u7528\u7f29\u653e\u548c\u65cb\u8f6c\u77e9\u9635\u8868\u8fbe\uff1f \\(A = RS\\) \\(\\sum=A \\cdot I \\cdot A^\\top = R \\cdot S \\cdot I \\cdot (R \\cdot S)^\\top = R \\cdot S \\cdot S^\\top \\cdot R^\\top\\) \u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635 Code # covariance = RS[S^T][R^T] def computeCov3D ( scale , mod , rot ): # create scaling matrix S = np . array ( [[ scale [ 0 ] * mod , 0 , 0 ], [ 0 , scale [ 1 ] * mod , 0 ], [ 0 , 0 , scale [ 2 ] * mod ]] ) # normalize quaternion to get valid rotation # we use rotation matrix R = rot # compute 3d world covariance matrix Sigma M = np . dot ( R , S ) cov3D = np . dot ( M , M . T ) return cov3D","title":"3DGS \u4e0e\u534f\u65b9\u5dee\u77e9\u9635"},{"location":"cv/papers/3dgs/3dgs/#3d","text":"\u5728\u76f8\u673a\u6a21\u578b\u4e2d\uff1a\u4e16\u754c\u5750\u6807\u7cfb\u3001\u76f8\u673a\u5750\u6807\u7cfb\u3001\u5f52\u4e00\u5316\u5750\u6807\u7cfb\u3001\u50cf\u7d20\u5750\u6807\u7cfb \u5728 CG \u4e2d\uff1a\u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\uff1a \u4ece\u4e16\u754c\u5750\u6807\u7cfb\u5230\u76f8\u673a\u5750\u6807\u7cfb \u4eff\u5c04\u53d8\u6362 \\(\\mathcal{w}=A \\mathcal{x} + b\\) \u6295\u5f71\u53d8\u6362 3D \u5230 2D \u6b63\u4ea4\u6295\u5f71\uff0c\u4e0e z \u65e0\u5173\uff0c\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7acb\u65b9\u4f53\u7f29\u653e\u5230 \\(\\left [-1,1 \\right ]^3\\) \u7684\u6b63\u65b9\u4f53\uff0c\u4eff\u5c04\u53d8\u6362 \u900f\u89c6\u6295\u5f71\uff0c\u4e0e z \u6709\u5173\uff0c\u5148\u628a\u9525\u4f53\u538b\u6210\u7acb\u65b9\u4f53\uff0c\u5728\u6b63\u4ea4\u6295\u5f71 \u89c6\u53e3\u53d8\u6362 \u4e0e z \u65e0\u5173 \u5c06 \\([-1, 1]^2\\) \u7684\u77e9\u5f62\u53d8\u6362\u81f3 \\([0, w] \\times [0, h]\\) \u5149\u6805\u5316 \u628a\u4e1c\u897f\u753b\u5728\u5c4f\u5e55\u4e0a \u8fde\u7eed\u8f6c\u79bb\u6563 \u65b9\u6cd5\uff1a\u91c7\u6837 \u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u6295\u5f71\u53d8\u6362\uff1f \u6295\u5f71\u53d8\u6362\u4e2d\uff1a \u9ad8\u65af\u6838\u4e2d\u5fc3 \\(x_k = [x_0, x_1, x_2]^\\top\\) \u9ad8\u65af\u6838 \\(r_k(x)=G_{v_k}(x-x_k)\\) \u5747\u503c \\(x_k = m(u_k)\\) \uff0c\u4e00\u4e2a\u70b9\uff0c\u4e0d\u4f1a\u5f62\u53d8 \u534f\u65b9\u5dee\u77e9\u9635\uff1f\u900f\u89c6\u6295\u5f71\u5230\u6b63\u4ea4\u6295\u5f71\u662f\u975e\u7ebf\u6027\u53d8\u6362\uff0c\u5373\u975e\u4eff\u5c04\u53d8\u6362\uff0c\u4f46\u9ad8\u65af\u692d\u7403\u4e00\u76f4\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528 \u5f15\u5165\u96c5\u53ef\u6bd4\u8fd1\u4f3c\u77e9\u9635 \u6cf0\u52d2\u5c55\u5f00\u3001\u7ebf\u6027\u903c\u8fd1 \u5bf9\u975e\u7ebf\u6027\u53d8\u6362\u7684\u5c40\u90e8\u7ebf\u6027\u8fd1\u4f3c \u53ef\u8ba1\u7b97\u5f97 \\(J = \\frac{\\partial m(u_k)}{\\partial u}\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(V_k = J V_k^\\prime j^\\top = JWV_k^{\\prime \\prime} W^\\top J^\\top\\) \u89c6\u53e3\u53d8\u6362 \u6b64\u65f6\u5747\u503c\u548c\u534f\u65b9\u5dee\u5728\u4e00\u4e2a\u5750\u6807\u7cfb\u5417\uff1f \u5747\u503c\uff1a\u5728 NDC \u5750\u6807\u7cfb \\([-1, 1]^3\\) \uff0c\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u534f\u65b9\u5dee\u77e9\u9635\uff1a\u5728\u672a\u7f29\u653e\u7684\u6b63\u4ea4\u5750\u6807\u7cfb \\([l,r] \\times [b, t] \\times [f, n]\\) \uff0c\u4e0d\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u5bf9\u4e8e\u9ad8\u65af\u6838\u4e2d\u5fc3 \\(\\mu = [\\mu_1, \\mu_2, \\mu_3]^\\top\\) \u5e73\u79fb + \u7f29\u653e \u5bf9\u4e8e\u534f\u65b9\u5dee\u77e9\u9635 \u8db3\u8ff9\u6e32\u67d3\uff1a\u79bb\u6563\u8ba1\u7b97 \\(G(\\hat{x}) = \\exp(-\\frac{1}{2} (x-\\mu)^\\top V_k^{-1}(x-\\mu))\\) 3DGS \u4e2d\u5fc3\u7684\u53d8\u6362 Code # transform point, from world to ndc # Notice, projmatrix already processed as mvp matrix p_hom = transformPoint4x4 ( p_orig , projmatrix ) p_w = 1 / ( p_hom [ 3 ] + 0.0000001 ) p_proj = [ p_hom [ 0 ] * p_w , p_hom [ 1 ] * p_w , p_hom [ 2 ] * p_w ] # transfrom point from NDC to Pixel point_image = [ ndc2Pix ( p_proj [ 0 ], W ), ndc2Pix ( p_proj [ 1 ], H )] 3DGS \u534f\u65b9\u5dee\u77e9\u9635\u7684\u53d8\u6362 Code def computeCov2D ( mean , focal_x , focal_y , tan_fovx , tan_fovy , cov3D , viewmatrix ): # The following models the steps outlined by equations 29 # and 31 in \"EWA Splatting\" (Zwicker et al., 2002). # Additionally considers aspect / scaling of viewport. # Transposes used to account for row-/column-major conventions. t = transformPoint4x3 ( mean , viewmatrix ) limx = 1.3 * tan_fovx limy = 1.3 * tan_fovy txtz = t [ 0 ] / t [ 2 ] tytz = t [ 1 ] / t [ 2 ] t [ 0 ] = min ( limx , max ( - limx , txtz )) * t [ 2 ] t [ 1 ] = min ( limy , max ( - limy , tytz )) * t [ 2 ] J = np . array ( [ [ focal_x / t [ 2 ], 0 , - ( focal_x * t [ 0 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , focal_y / t [ 2 ], - ( focal_y * t [ 1 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , 0 , 0 ], ] ) W = viewmatrix [: 3 , : 3 ] T = np . dot ( J , W ) cov = np . dot ( T , cov3D ) cov = np . dot ( cov , T . T ) # Apply low-pass filter # Every Gaussia should be at least one pixel wide/high # Discard 3rd row and column cov [ 0 , 0 ] += 0.3 cov [ 1 , 1 ] += 0.3 return [ cov [ 0 , 0 ], cov [ 0 , 1 ], cov [ 1 , 1 ]]","title":"\u629b\u96ea\u7403 \u4ece 3D \u5230\u50cf\u7d20"},{"location":"cv/papers/3dgs/3dgs/#_1","text":"\u57fa\u51fd\u6570\uff1a\u4efb\u4f55\u4e00\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u5206\u89e3\u4e3a\u6b63\u5f26\u6838\u4f59\u5f26\u7684\u7ebf\u6027\u7ec4\u5408 \u7403\u8c10\u51fd\u6570 \u4efb\u4f55\u4e00\u4e2a\u7403\u9762\u5750\u6807\u7684\u51fd\u6570\u90fd\u53ef\u4ee5\u7528\u591a\u4e2a\u7403\u8c10\u51fd\u6570\u6765\u8fd1\u4f3c \\(f(t) \\approx \\sum_l \\sum_{m=-l}^l c_l^m y_l^m (\\theta, \\phi)\\) \u5176\u4e2d\uff0c \\(c_l^m\\) \u5404\u9879\u7cfb\u6570\uff0c \\(y^m\\) \u57fa\u51fd\u6570 \u8bba\u6587\u4e2d\u7684 \\(n=4\\) \uff0c\u5171\u6709 16 \u4e2a\u53c2\u6570\uff08\u672c\u8d28\u4e0a\u662f1+3+5+7\uff09 \u7403\u8c10\u51fd\u6570 Code def computeColorFromSH ( deg , pos , campos , sh ): # The implementation is loosely based on code for # \"Differentiable Point-Based Radiance Fields for # Efficient View Synthesis\" by Zhang et al. (2022) dir = pos - campos dir = dir / np . linalg . norm ( dir ) result = SH_C0 * sh [ 0 ] if deg > 0 : x , y , z = dir result = result - SH_C1 * y * sh [ 1 ] + SH_C1 * z * sh [ 2 ] - SH_C1 * x * sh [ 3 ] if deg > 1 : xx = x * x yy = y * y zz = z * z xy = x * y yz = y * z xz = x * z result = ( result + SH_C2 [ 0 ] * xy * sh [ 4 ] + SH_C2 [ 1 ] * yz * sh [ 5 ] + SH_C2 [ 2 ] * ( 2.0 * zz - xx - yy ) * sh [ 6 ] + SH_C2 [ 3 ] * xz * sh [ 7 ] + SH_C2 [ 4 ] * ( xx - yy ) * sh [ 8 ] ) if deg > 2 : result = ( result + SH_C3 [ 0 ] * y * ( 3.0 * xx - yy ) * sh [ 9 ] + SH_C3 [ 1 ] * xy * z * sh [ 10 ] + SH_C3 [ 2 ] * y * ( 4.0 * zz - xx - yy ) * sh [ 11 ] + SH_C3 [ 3 ] * z * ( 2.0 * zz - 3.0 * xx - 3.0 * yy ) * sh [ 12 ] + SH_C3 [ 4 ] * x * ( 4.0 * zz - xx - yy ) * sh [ 13 ] + SH_C3 [ 5 ] * z * ( xx - yy ) * sh [ 14 ] + SH_C3 [ 6 ] * x * ( xx - 3.0 * yy ) * sh [ 15 ] ) result += 0.5 return np . clip ( result , a_min = 0 , a_max = 1 ) \u4e3a\u4ec0\u4e48\u7403\u8c10\u51fd\u6570\u80fd\u66f4\u597d\u5730\u8868\u8fbe\u989c\u8272\uff1f \u6b63\u5e38\u4f7f\u7528\u7684 RGB \u53ea\u6709\u4e09\u4e2a\u53d8\u91cf\u8868\u8fbe \u7403\u8c10\u51fd\u6570\u6709 \\(16 \\times 3\\) \u4e2a\u53d8\u91cf\u8868\u8fbe \u8db3\u8ff9\u5408\u6210 \u76f4\u89c2\u4e0a\u8fdb\u884c \\(\\alpha\\) -blending \u5b9e\u9645\u4e0a 3DGS \u4f9d\u7136\u5bf9\u6bcf\u4e2a\u50cf\u7d20\u7740\u8272\uff0c\u53c2\u8003 NeRF \u5bf9\u5149\u7ebf\u4e0a\u7c92\u5b50\u8fdb\u884c\u6c42\u548c splatting \u6ca1\u6709\u50cf NeRF \u4e00\u6837\u627e\u7c92\u5b50\u7684\u8fc7\u7a0b \u5bf9\u9ad8\u65af\u7403\u6309\u7167\u6df1\u5ea6 z \u6392\u5e8f\uff0c\u6e32\u67d3\u7684\u65f6\u5019\u6254\u7684\u987a\u5e8f\u6709\u5173","title":"\u96ea\u7403\u989c\u8272 \u7403\u8c10\u51fd\u6570"},{"location":"cv/papers/3dgs/3dgs/#_2","text":"\u5ef6\u7eed Splatting\uff0c\u5982\u4f55 \u5feb\u901f \u9ad8\u65af\u5149\u6805\u5316\uff1f \u4ece\u50cf\u7d20\u7ea7\u522b\u7684\u64cd\u4f5c\u7406\u89e3\u6e32\u67d3\u8fc7\u7a0b\uff1a\u5bf9\u4e8e\u7ed9\u5b9a\u5750\u6807 \\(x\\) \u7684\u50cf\u7d20\u70b9\uff0c\u53ef\u4ee5\u901a\u8fc7\u89c6\u56fe\u53d8\u5316\u8ba1\u7b97\u51fa\u6240\u6709\u5728\u8be5\u4f4d\u7f6e\u91cd\u53e0\u7684\u9ad8\u65af\u7684\u6df1\u5ea6\u5e76\u6392\u5e8f\uff0c\u6700\u540e\u5bf9\u6392\u5217\u597d\u7684\u9ad8\u65af\u8fdb\u884c \\(\\alpha\\) -blending\uff0c\u8fd4\u56de\u8be5\u50cf\u7d20\u70b9\u6700\u540e\u7684\u989c\u8272\u503c \\[ C = \\sum_{i \\in N} c_i \\alpha^\\prime \\prod_{j=1}^{i-1}(1 - \\alpha_j^\\prime) \\] \u7531\u4e8e\u6392\u5e8f\u8fc7\u7a0b\u96be\u4ee5\u5e76\u884c\u5316\uff0c3dgs \u4f7f\u7528\u4e00\u4e9b\u7b56\u7565\u63d0\u9ad8\u6548\u7387 \u4f7f\u7528\u56fe\u50cf\u5757\u6765\u4ee3\u66ff\u50cf\u7d20\u7ea7\u522b\u7684\u7cbe\u5ea6\uff0c\u6bcf\u4e2a\u5757\u5305\u542b \\(16 \\times 16\\) \u4e2a\u50cf\u7d20\uff0c\u5bf9\u4e8e\u8986\u76d6\u591a\u4e2a\u5757\u7684\u9ad8\u65af\uff0c\u4f5c\u8005\u590d\u5236\u9ad8\u65af\u5e76\u4e3a\u5b83\u4eec\u5206\u914d\u6807\u8bc6\u7b26 \u6bcf\u4e2a\u5757\u72ec\u7acb\u6392\u5e8f\u5e76\u8ba1\u7b97\u989c\u8272\u503c\uff0c\u53ef\u5e76\u884c\u6267\u884c","title":"\u5feb\u901f\u9ad8\u65af\u5149\u6805\u5316"},{"location":"cv/papers/3dgs/3dgs/#_3","text":"\u521d\u59cb\u5316\u7684\u70b9\u4e91\u7684\u521d\u59cb\u5f62\u72b6\u662f\u4e00\u4e2a\u7403\uff0c \u5f3a\u4f9d\u8d56 SfM \u751f\u6210\u7684\u521d\u59cb\u70b9\u4e91 \uff0c\u53ef\u80fd\u5bfc\u81f4\u751f\u6210\u9ad8\u65af\u5728\u7a7a\u95f4\u5bc6\u5ea6\u8fc7\u5927\u6216\u8fc7\u5c0f\uff1f \u5177\u4f53\u65b9\u6cd5\u6709 \u70b9\u5bc6\u96c6\u5316 \u548c \u70b9\u526a\u679d \u3002","title":"\u81ea\u9002\u5e94\u9ad8\u65af\u5bc6\u5ea6\u63a7\u5236"},{"location":"cv/papers/3dgs/3dgs/#_4","text":"\u91cd\u5efa\u4e0d\u8db3\u7684\u533a\u57df\u514b\u9686\u5c0f\u9ad8\u65af \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u57fa\u4e8e\u9009\u62e9\u7684\u70b9\u751f\u6210\u65b0\u7684\u70b9\u4e91\u5750\u6807\u3001\u7279\u5f81\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u7f29\u653e\u548c\u65cb\u8f6c \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91\u4e2d \u8c03\u7528 densification_postfix \u51fd\u6570\u5bf9\u70b9\u4e91\u8fdb\u884c\u540e\u5904\u7406 densify_and_clone Code def densify_and_clone ( self , grads , grad_threshold , scene_extent ): # Extract points that satisfy the gradient condition selected_pts_mask = torch . where ( torch . norm ( grads , dim =- 1 ) >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values <= self . percent_dense * scene_extent ) new_xyz = self . _xyz [ selected_pts_mask ] new_features_dc = self . _features_dc [ selected_pts_mask ] new_features_rest = self . _features_rest [ selected_pts_mask ] new_opacities = self . _opacity [ selected_pts_mask ] new_scaling = self . _scaling [ selected_pts_mask ] new_rotation = self . _rotation [ selected_pts_mask ] self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacities , new_scaling , new_rotation ) \u91cd\u5efa\u8fc7\u5ea6\u7684\u533a\u57df\u62c6\u5206\u5927\u9ad8\u65af \u83b7\u53d6\u521d\u59cb\u70b9\u4e91\u7684\u6570\u91cf n_init_points \u521b\u5efa\u4e00\u4e2a\u4e0e\u68af\u5ea6\u76f8\u540c\u5927\u5c0f\u7684\u96f6\u5f20\u91cf padded_grad \uff0c\u5e76\u5c06\u68af\u5ea6\u503c\u586b\u5145\u5230\u5176\u4e2d \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u5c06\u6ee1\u8db3\u6761\u4ef6\u548c\u7f29\u653e\u6761\u4ef6\u7684\u70b9\u590d\u5236 N \u6b21\uff0c\u5e76\u8ba1\u7b97\u65b0\u7684\u5750\u6807\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u548c\u7279\u5f81 \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91 \u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u526a\u679d\u7684\u8fc7\u6ee4\u5668 prune_filter \uff0c\u5176\u4e2d\u5305\u62ec\u539f\u59cb\u70b9\u4e91\u548c\u65b0\u751f\u6210\u70b9\u4e91\u7684\u63a9\u7801 \u6839\u636e\u526a\u679d\u8fc7\u6ee4\u5668\u5220\u9664\u4e0d\u9700\u8981\u7684\u70b9 densify_and_split Code def densify_and_split ( self , grads , grad_threshold , scene_extent , N = 2 ): n_init_points = self . get_xyz . shape [ 0 ] # Extract points that satisfy the gradient condition padded_grad = torch . zeros (( n_init_points ), device = \"cuda\" ) padded_grad [: grads . shape [ 0 ]] = grads . squeeze () selected_pts_mask = torch . where ( padded_grad >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values > self . percent_dense * scene_extent ) stds = self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) means = torch . zeros (( stds . size ( 0 ), 3 ), device = \"cuda\" ) samples = torch . normal ( mean = means , std = stds ) rots = build_rotation ( self . _rotation [ selected_pts_mask ]) . repeat ( N , 1 , 1 ) # \u65b0\u751f\u6210\u70b9\u4e91\u4fe1\u606f\uff08\u7531\u5927\u9ad8\u65af\u5206\u5272\u5e76\u6309\u4e00\u5b9a\u7cfb\u6570\u7f29\u653e\u5f97\u5230\uff09 new_xyz = torch . bmm ( rots , samples . unsqueeze ( - 1 )) . squeeze ( - 1 ) + self . get_xyz [ selected_pts_mask ] . repeat ( N , 1 ) new_scaling = self . scaling_inverse_activation ( self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) / ( 0.8 * N )) new_rotation = self . _rotation [ selected_pts_mask ] . repeat ( N , 1 ) new_features_dc = self . _features_dc [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_features_rest = self . _features_rest [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_opacity = self . _opacity [ selected_pts_mask ] . repeat ( N , 1 ) self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacity , new_scaling , new_rotation ) prune_filter = torch . cat (( selected_pts_mask , torch . zeros ( N * selected_pts_mask . sum (), device = \"cuda\" , dtype = bool ))) # \u88c1\u526a\u8fc7\u7a0b\u53c2\u7167\u5176\u4e0d\u900f\u660e\u5ea6\u503c\u8fdb\u884c\uff0c\u88c1\u526a\u6389\u4e0d\u5fc5\u8981\u7684\u70b9\u63d0\u9ad8\u6548\u7387 self . prune_points ( prune_filter )","title":"\u70b9\u5bc6\u96c6\u5316"},{"location":"cv/papers/3dgs/3dgs/#_5","text":"\u5c06\u4e0d\u900f\u660e\u5ea6\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u7684\u70b9\u51cf\u53bb\uff0c\u5c06\u8fc7\u5927\u7684\u4e5f\u51cf\u53bb\uff0c\u7c7b\u4f3c\u4e8e\u6b63\u5219\u5316\u8fc7\u7a0b\u3002\u5e76\u4e14\u5728\u8fed\u4ee3\u4e00\u5b9a\u6b21\u6570\u540e\uff0c\u9ad8\u65af\u4f1a\u88ab\u8bbe\u7f6e\u4e3a\u51e0\u4e4e\u900f\u660e\u3002\u8fd9\u6837\u5c31\u80fd\u6709\u63a7\u5236\u5730\u589e\u52a0\u5fc5\u8981\u7684\u9ad8\u65af\u5bc6\u5ea6\uff0c\u540c\u65f6\u5254\u9664\u591a\u4f59\u7684\u9ad8\u65af\u3002 \u6839\u636e\u6700\u5c0f\u4e0d\u900f\u660e\u5ea6\u548c\u6700\u5927\u5c4f\u5e55\u5c3a\u5bf8\u7b49\u6761\u4ef6\u751f\u6210\u526a\u679d\u63a9\u7801 prune_mask \uff0c\u5e76\u8c03\u7528 prune_points \u51fd\u6570\u8fdb\u884c\u70b9\u4e91\u7684\u526a\u679d\u64cd\u4f5c prune_points \u51fd\u6570\u6839\u636e\u7ed9\u5b9a\u7684\u63a9\u7801 mask \u5bf9\u70b9\u4e91\u8fdb\u884c\u526a\u679d\u64cd\u4f5c\uff0c\u5c06\u4e0d\u9700\u8981\u7684\u70b9\u4ece\u70b9\u4e91\u4e2d\u5220\u9664\uff0c\u5e76\u66f4\u65b0\u76f8\u5173\u7684\u5f20\u91cf\u6570\u636e densify_and_prune Code def densify_and_prune ( self , max_grad , min_opacity , extent , max_screen_size ): grads = self . xyz_gradient_accum / self . denom grads [ grads . isnan ()] = 0.0 # \u70b9\u5bc6\u96c6\u5316\u8fc7\u7a0b self . densify_and_clone ( grads , max_grad , extent ) self . densify_and_split ( grads , max_grad , extent ) prune_mask = ( self . get_opacity < min_opacity ) . squeeze () if max_screen_size : big_points_vs = self . max_radii2D > max_screen_size big_points_ws = self . get_scaling . max ( dim = 1 ) . values > 0.1 * extent prune_mask = torch . logical_or ( torch . logical_or ( prune_mask , big_points_vs ), big_points_ws ) self . prune_points ( prune_mask ) torch . cuda . empty_cache () def prune_points ( self , mask ): valid_points_mask = ~ mask optimizable_tensors = self . _prune_optimizer ( valid_points_mask ) self . _xyz = optimizable_tensors [ \"xyz\" ] self . _features_dc = optimizable_tensors [ \"f_dc\" ] self . _features_rest = optimizable_tensors [ \"f_rest\" ] self . _opacity = optimizable_tensors [ \"opacity\" ] self . _scaling = optimizable_tensors [ \"scaling\" ] self . _rotation = optimizable_tensors [ \"rotation\" ] self . xyz_gradient_accum = self . xyz_gradient_accum [ valid_points_mask ] self . denom = self . denom [ valid_points_mask ] self . max_radii2D = self . max_radii2D [ valid_points_mask ]","title":"\u70b9\u526a\u679d"},{"location":"cv/papers/3dgs/3dgs/#_6","text":"\u521d\u59cb\u70b9\u4e91\uff0c\u6bcf\u4e2a\u70b9\u81a8\u80c0\u6210 3d \u9ad8\u65af\u692d\u7403 \u5219\u6bcf\u4e2a\u692d\u7403\u7684\u53c2\u6570\u6709\uff1a \u4e2d\u5fc3\u70b9\u4f4d\u7f6e \\((x,y,z)\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(R,S\\) \u7403\u8c10\u51fd\u6570\u7cfb\u6570 \\(16 \\times 3\\) \u900f\u660e\u5ea6 \\(\\alpha\\)","title":"\u53c2\u6570\u4f30\u8ba1"},{"location":"cv/papers/3dgs/3dgs/#source-code-review","text":"\u5b66\u4e60\u81ea \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb_gaussian splatting\u6e90\u7801\u5206\u6790-CSDN\u535a\u5ba2","title":"Source Code Review"},{"location":"cv/papers/3dgs/3dgs/#experiment","text":"\u786c\u4ef6\u914d\u7f6e Ubuntu 20.04 + 4060Ti + CUDA 11.8 \u8dd1\u5728 Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09","title":"Experiment"},{"location":"cv/papers/3dgs/3dgs/#office-scenes","text":"","title":"Office Scenes"},{"location":"cv/papers/3dgs/3dgs/#own-scenes","text":"","title":"Own Scenes"},{"location":"cv/papers/3dgs/3dgs/#reference","text":"3D GaussianSplatting \u6280\u672f\u7684\u5f71\u54cd\u4f1a\u6709\u591a\u5927\uff1f \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-3d gaussian splatting \u5168\u89e3(\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f) 3D Gaussian Splatting\u539f\u7406\u901f\u901a \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0a\uff09 \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0b\uff09 \uff08\u5e72\u8d27\uff09\u300a\u96c5\u53ef\u6bd4\u77e9\u9635\u662f\u4ec0\u4e48\u4e1c\u897f\u300b3Blue1Brown\uff0c\u642c\u81ea\u53ef\u6c57\u5b66\u9662\u3002 \u3010\u81ea\u5236\u4e2d\u6587\u5b57\u5e55\u3011 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb 3dgs_\u8721\u7b14\u5c0f\u65b0\u914d\u5409\u826f\u5409\u5f71\u7684\u535a\u5ba2-CSDN\u535a\u5ba2 \uff08\u4e09\u7ef4\u91cd\u5efa\u5b66\u4e60\uff093D Gaussian Splatting & Instant-NGP\u73af\u5883\u914d\u7f6e_3d gaussian splatting \u73af\u5883\u642d\u5efa-CSDN\u535a\u5ba2 Gaussian Splatting\u4ee3\u7801\u5b89\u88c5\u90e8\u7f72\uff08windows\uff09_gaussian splatting github-CSDN\u535a\u5ba2 3D Gaussian Splatting\u5165\u95e8\u6307\u5357 - \u54d4\u54e9\u54d4\u54e9","title":"Reference"},{"location":"cv/papers/3dgs/4dgs/","text":"4DGaussians \u00b6 \u7ea6 1368 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a 4D Gaussian Splatting for Real-Time Dynamic Scene Rendering code\uff1a 4DGaussians Idea \u00b6 Introduction \u00b6 3DGS \u53ea\u80fd\u5728\u9759\u6001\u573a\u666f\u91cd\u5efa\uff0c\u5982\u679c\u53d1\u751f\u8fd0\u52a8\uff0c\u5219\u9700\u8981\u8003\u8651\u65f6\u95f4\u7ef4\u5ea6\u7684\u4fe1\u606f\uff0c\u628a 3DGS \u7684\u601d\u60f3\u653e\u5230\u5bf9\u52a8\u6001\u7a7a\u95f4\u7684\u5efa\u6a21\u4e0a \u6700\u7b80\u5355\u7684\u60f3\u6cd5\u5c31\u662f\u5728\u6bcf\u4e00\u4e2a\u65f6\u95f4\u70b9\u4e0a\u5355\u72ec\u5efa\u7acb\u4e00\u4e2a 3DGS \u6a21\u578b\uff0c\u5c06\u4e00\u6bb5\u65f6\u95f4\u4e0a\u6240\u6709\u7684 3DGS \u6a21\u578b\u7ec4\u5408\u8d77\u6765\u5c31\u662f\u4e00\u4e2a 4DGS \u6a21\u578b\uff0c\u4f46\u8fd9\u6837\u4f1a\u4ee3\u7801\u5b58\u50a8\u7a7a\u95f4\u7206\u70b8\u7684\u95ee\u9898 4DGS \u7684\u521b\u65b0\u70b9\u5728\u4e8e\uff0c\u5728 3DGS \u7684\u57fa\u7840\u4e0a\uff0c\u5f15\u5165 \u53d8\u5f62\u573a(deformation field) \u6765\u8868\u793a Gaussians \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff0c\u5305\u62ec\u4e00\u4e2a\u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u548c\u4e00\u4e2a\u8f7b\u91cf\u7ea7 MLP\uff0c\u7b80\u5355\u5730\u8bf4\uff0c\u5c06\u52a8\u6001\u573a\u666f\u770b\u4f5c\u662f\u4e00\u4e2a\u9759\u6001\u573a\u666f\u5728\u65f6\u95f4\u7ef4\u5ea6\u4e0a\u7684\u53d8\u5f62 \u5728\u6bcf\u4e2a\u65f6\u95f4\u6233\uff0c\u53d8\u5f62\u573a\u4f1a\u5c06 Gaussians \u8f6c\u6362\u5230\u4e00\u4e2a\u5177\u4f53\u65b0\u5f62\u72b6\u7684\u65b0\u4f4d\u7f6e\uff0c\u8be5\u53d8\u6362\u76f8\u5f53\u4e8e Gaussian \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff08\u4ece\u59cb\u81f3\u7ec8\u53ea\u7ef4\u62a4\u4e00\u7ec4 3DGS \u6a21\u578b\uff0c\u5373\u53ea\u6709\u4e00\u7ec4 3D \u9ad8\u65af\u7403\uff0c\u53ea\u662f\u5728\u4e0d\u540c\u7684\u65f6\u95f4\u8282\u70b9\uff0c\u9ad8\u65af\u7403\u4f1a\u505a\u51fa\u76f8\u5e94\u7684\u53d8\u6362\uff09 4DGS \u6a21\u578b\u4e2d\uff0c\u5c06\u4e00\u4e2a\u70b9\u7684 \\((x,y,z,t)\\) \u5750\u6807\u5148\u4ee3\u5165\u4e00\u4e2a\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668\uff0c\u968f\u540e\u8f93\u51fa\u5e26\u5165\u4e00\u4e2a\u591a\u5934\u7684\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u8fdb\u884c\u89e3\u7801\uff0c\u5f97\u5230 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u4e0e\u539f\u503c\u76f8\u52a0\u540e\uff0c\u6309\u7167 3DGS \u7684\u65b9\u6cd5\u5f97\u5230\u4e0d\u900f\u660e\u5ea6\u548c SH \u7cfb\u6570\u8fdb\u884c\u6e32\u67d3 4D Gaussian Splatting Framework \u00b6 \u53c2\u6570\u8bf4\u660e \u65cb\u8f6c\u77e9\u9635 \\(M = [R, T]\\) \u65f6\u95f4\u6233 \\(t\\) 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u9ad8\u65af\u53d8\u5f62\u573a\u7f51\u7edc \\(\\mathcal{F}\\) \u6cfc\u6e85\u65b9\u6cd5 \\(\\mathcal{S}\\) 3D \u9ad8\u65af\u53d8\u5f62\u573a\u53d8\u5316\u91cf \\(\\Delta \\mathcal{G} = \\mathcal{F}(\\mathcal{G}, t)\\) \u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668 \\(\\mathcal{H}\\) \uff0c\u5c06 3D \u9ad8\u65af\u7f16\u7801 \\(f_d = \\mathcal{H} = (\\mathcal{G}, t)\\) \u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D}\\) \uff0c\u5c06 \\(\\Delta \\mathcal{G}\\) \u89e3\u7801 \\(\\Delta \\mathcal{G} = \\mathcal{D}(f)\\) \u4ece\u539f\u59cb 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u8f6c\u6362\u5230\u4e00\u4e2a\u65f6\u95f4\u6233\u7684\u65b0\u7684 \\(\\mathcal{G}^\\prime = \\Delta \\mathcal{G} + \\mathcal{G}\\) \u65b0\u89c6\u89d2\u56fe\u50cf \\(\\hat{I} = \\mathcal{S}(M, \\mathcal{G}^\\prime)\\) Gaussian Deformation Field Network \u00b6 Spatial-Temporal Structure Encoder \u00b6 \u7075\u611f\u6765\u6e90 \u53c2\u8003 CVPR 2023 HexPlane \u548c K-Planes \u4e2d\u6709\u5173\u65f6\u7a7a\u7ed3\u6784\u5f20\u91cf\u5206\u89e3\u7684\u601d\u60f3\uff0c\u6700\u5f00\u59cb\u662f\u5728 3D NeRF \u4e2d \u8bba\u6587 TensoRF \u51fa\u73b0\uff0c\u6536\u5230\u5f20\u91cf CP/VM \u5206\u89e3\u516c\u5f0f\u7684\u542f\u53d1\uff0c\u7387\u5148\u63d0\u51fa\u5c063D\u7a7a\u95f4\u5f20\u91cf\u5206\u89e3\u6210\u591a\u4e2a\u79e91\u5f20\u91cf\uff0c\u5efa\u7acb\u4e86\u4e00\u4e2a\u663e\u5f0f\u7684\u6a21\u578b\u6765\u8868\u5f813D\u7a7a\u95f4\uff0c\u5c06\u6bcf\u4e2a\u79e91\u5f20\u91cf\u4f5c\u4e3a\u5f85\u4f18\u5316\u7684\u53d8\u91cf\uff0c\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u8fdb\u884c\u4f18\u5316\uff0c\u63d0\u9ad8\u4e86\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6\u4e0e\u63a8\u7406\u901f\u5ea6 HexPlane \u63d0\u51fa\u4e86\u4e00\u4e2a 4D \u7a7a\u95f4\u5f20\u91cf\u8f90\u5c04\u573a\uff0c\u7b80\u5355\u7406\u89e3\u5c31\u662f\u628a\u4e00\u4e2a \\((x,y,z,t)\\) \u56db\u7ef4\u5f20\u91cf\u770b\u4f5c \\((xy, zt, yz, xt, zx, yt\\) ) \u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\uff0c\u91c7\u7528\u7c7b\u4f3c\u5f20\u91cf VM \u5206\u89e3\u7684\u65b9\u5f0f\u6765\u7ec4\u5408 K-Planes \u4e5f\u662f\u76f8\u540c\u7684\u601d\u60f3\uff0c\u5dee\u522b\u5728\u4e8e\u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\u5f62\u5f0f\uff0c\u91c7\u7528\u7c7b\u4f3c Hadamard \u79ef\u6765\u7ec4\u5408 HexPlane \u548c K-Planes \u5229\u7528 4D \u7a7a\u95f4\u5f20\u91cf\u573a\u5bf9\u7a7a\u95f4\u4fe1\u606f\u8fdb\u884c\u7f16\u7801\uff0c\u968f\u540e\u5229\u7528\u591a\u5934\u89e3\u7801\u5668\u89e3\u7801\u51fa\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u7136\u540e\u7528 NeRF \u7684\u4f53\u79ef\u5c04\u7ebf\u6cd5\u6e32\u67d3\u56fe\u50cf \u4e0e HexPlane \u548c K-Planes \u4e0d\u540c\u7684\u662f\uff0c4DGS \u63a5\u4e0b\u6765\u901a\u8fc7\u4e00\u4e2a\u7531\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u5c06\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u4fe1\u606f\u5206\u522b\u89e3\u7801\u6210 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u800c\u4e0d\u662f\u89e3\u7801\u6210\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u8f6c\u800c\u7528 3DGS \u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406 \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u7a7a\u95f4\u76f8\u90bb\u7684\u9ad8\u65af\u5728\u8fd0\u52a8\u548c\u5f62\u53d8\u4e0a\u5177\u6709\u76f8\u4f3c\u7684\u7279\u5f81\uff0c\u540c\u4e00\u4e2a\u9ad8\u65af\u5728\u76f8\u90bb\u65f6\u95f4\u4e5f\u4f1a\u5448\u73b0\u76f8\u4f3c\u7684\u53d8\u5316\u7279\u5f81\uff0c\u5e76\u4e14\u76f8\u9694\u8f83\u8fdc\u7684\u9ad8\u65af\u4e4b\u95f4\u4e5f\u4f1a\u5177\u6709\u4e00\u5b9a\u7684\u5173\u8054\u3002 \u56e0\u6b64 4DGS \u91c7\u7528 \u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u4f53\u7d20\u7f51\u683c\u6a21\u5757 \u5bf9\u5355\u5143\u4f53\u7d20\u4e2d\u7684\u6bcf\u4e2a\u9ad8\u65af\u7684\u7a7a\u95f4\u548c\u65f6\u95f4\u8fdb\u884c\u7f16\u7801 \\(\\mathcal{H}\\) \u5305\u62ec\u516d\u4e2a\u591a\u5206\u8fa8\u7387\u5e73\u9762\u6a21\u5757 \\(R_l(i,j)\\) \u548c\u4e00\u4e2a\u5c0f\u578b MLP \\(\\phi_d\\) \\(\\{R_l(i,j), \\phi_d | (i,j) \\in \\{ (x,y),(x,z),(y,z),(x,t),(y,t),(z,t)\\}, l \\in \\{1, 2 \\} \\}\\) \uff0c \\(\\mu = (x,y,z)\\) \u662f 3D \u9ad8\u65af\u7684\u5e73\u5747\u503c \u8ba1\u7b97\u4f53\u7d20\u7279\u5f81\uff1a \\[ f_h=\\bigcup_l\\prod\\text{interp}(R_l(i,j)) \\] \\(f_h\\) \u662f\u795e\u7ecf\u4f53\u7d20\u7279\u5f81\uff0c\u5229\u7528\u53cc\u7ebf\u6027\u63d2\u503c\u5bf9\u9644\u8fd1\u7684\u56db\u4e2a\u67e5\u8be2\u4f53\u7d20\u7279\u5f81\u8fdb\u884c\u63d2\u503c \u968f\u540e\u7528 MLP \u5c06\u6240\u6709\u539f\u59cb\u7279\u5f81\u8fdb\u884c\u89e3\u7801 \\(f_d = \\phi_d(f_h)\\) Multi-Head Gaussian Deformation Decoder \u00b6 \u8bbe\u8ba1\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D} = \\{ \\phi_x, \\phi_r, \\phi_s \\}\\) \u7528 MLP \u5206\u522b\u9884\u6d4b\u53d8\u5f62\u91cf \u9ad8\u65af\u7403\u4f4d\u79fb\u53d8\u5316\u91cf \\(\\Delta \\mathcal{X} = \\phi_x(f_d)\\) \u9ad8\u65af\u7403\u65cb\u8f6c\u56db\u5143\u6570\u53d8\u5316\u91cf \\(\\Delta r = \\phi_r(f_d)\\) \u9ad8\u65af\u7403\u7f29\u653e\u56e0\u5b50\u53d8\u5316\u91cf \\(\\Delta s = \\phi_s(f_d)\\) \u53d8\u5f62\u540e\u7684\u7279\u5f81\u8868\u793a\u4e3a \\((\\mathcal{X}^\\prime, r^\\prime, s^\\prime) = (\\mathcal{X} + \\Delta \\mathcal{X}, r + \\Delta r, s + \\Delta s)\\) \u6700\u540e\u83b7\u5f97\u51fa\u9ad8\u65af\u7403\u52a8\u6001\u53d8\u5316\u540e\u7684\u65b0\u5f62\u72b6\u65b0\u4f4d\u7f6e \\(\\mathcal{G}^\\prime = \\{ \\mathcal{X}^\\prime, s^\\prime, r^\\prime, \\sigma, \\mathcal{C} \\}\\) Optimization \u00b6 3D Gaussian Initialization \u00b6 \u91c7\u53d6\u4e86\u4e24\u9636\u6bb5\u8bad\u7ec3\u7b56\u7565\uff1a\u9759\u6001\u573a\u666f\u521d\u59cb\u5316\u548c\u53d8\u5f62\u573a\u5fae\u8c03\uff1b \u521d\u59cb\u5316\u9636\u6bb5\uff1a\u4e3b\u8981\u4f18\u5316\u9759\u6001\u573a\u666f\u7684\u8868\u793a\uff0c\u5373\u53ea\u4f18\u5316 3D Gaussians \u7684\u53c2\u6570\uff1b \u5fae\u8c03\u9636\u6bb5\uff1a\u4e3b\u8981\u5b66\u4e60\u53d8\u5f62\u573a\u7684\u8868\u793a\uff0c\u5373\u4f18\u5316\u591a\u5206\u8fa8\u7387\u795e\u7ecf\u4f53\u7d20\u548c MLP\uff1b Loss Function \u00b6 \u4f7f\u7528 \\(L_1\\) \u989c\u8272\u635f\u5931\u548c\u57fa\u4e8e\u7f51\u683c\u7684 TV \u635f\u5931 \\(\\mathcal{L}_{tv}\\) \u76d1\u7763\u8bad\u7ec3 \\[ \\mathcal{L} = \\left | \\hat{I} - I \\right | + \\mathcal{L}_{tv} \\] Experiments \u00b6 Reference \u00b6 https://blog.csdn.net/m0_51976564/article/details/134595401 https://zhuanlan.zhihu.com/p/663337795 https://blog.csdn.net/weixin_71780622/article/details/136063893 https://blog.csdn.net/m0_55605361/article/details/141122450","title":"4DGS"},{"location":"cv/papers/3dgs/4dgs/#4dgaussians","text":"\u7ea6 1368 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a 4D Gaussian Splatting for Real-Time Dynamic Scene Rendering code\uff1a 4DGaussians","title":"4DGaussians"},{"location":"cv/papers/3dgs/4dgs/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/4dgs/#introduction","text":"3DGS \u53ea\u80fd\u5728\u9759\u6001\u573a\u666f\u91cd\u5efa\uff0c\u5982\u679c\u53d1\u751f\u8fd0\u52a8\uff0c\u5219\u9700\u8981\u8003\u8651\u65f6\u95f4\u7ef4\u5ea6\u7684\u4fe1\u606f\uff0c\u628a 3DGS \u7684\u601d\u60f3\u653e\u5230\u5bf9\u52a8\u6001\u7a7a\u95f4\u7684\u5efa\u6a21\u4e0a \u6700\u7b80\u5355\u7684\u60f3\u6cd5\u5c31\u662f\u5728\u6bcf\u4e00\u4e2a\u65f6\u95f4\u70b9\u4e0a\u5355\u72ec\u5efa\u7acb\u4e00\u4e2a 3DGS \u6a21\u578b\uff0c\u5c06\u4e00\u6bb5\u65f6\u95f4\u4e0a\u6240\u6709\u7684 3DGS \u6a21\u578b\u7ec4\u5408\u8d77\u6765\u5c31\u662f\u4e00\u4e2a 4DGS \u6a21\u578b\uff0c\u4f46\u8fd9\u6837\u4f1a\u4ee3\u7801\u5b58\u50a8\u7a7a\u95f4\u7206\u70b8\u7684\u95ee\u9898 4DGS \u7684\u521b\u65b0\u70b9\u5728\u4e8e\uff0c\u5728 3DGS \u7684\u57fa\u7840\u4e0a\uff0c\u5f15\u5165 \u53d8\u5f62\u573a(deformation field) \u6765\u8868\u793a Gaussians \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff0c\u5305\u62ec\u4e00\u4e2a\u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u548c\u4e00\u4e2a\u8f7b\u91cf\u7ea7 MLP\uff0c\u7b80\u5355\u5730\u8bf4\uff0c\u5c06\u52a8\u6001\u573a\u666f\u770b\u4f5c\u662f\u4e00\u4e2a\u9759\u6001\u573a\u666f\u5728\u65f6\u95f4\u7ef4\u5ea6\u4e0a\u7684\u53d8\u5f62 \u5728\u6bcf\u4e2a\u65f6\u95f4\u6233\uff0c\u53d8\u5f62\u573a\u4f1a\u5c06 Gaussians \u8f6c\u6362\u5230\u4e00\u4e2a\u5177\u4f53\u65b0\u5f62\u72b6\u7684\u65b0\u4f4d\u7f6e\uff0c\u8be5\u53d8\u6362\u76f8\u5f53\u4e8e Gaussian \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff08\u4ece\u59cb\u81f3\u7ec8\u53ea\u7ef4\u62a4\u4e00\u7ec4 3DGS \u6a21\u578b\uff0c\u5373\u53ea\u6709\u4e00\u7ec4 3D \u9ad8\u65af\u7403\uff0c\u53ea\u662f\u5728\u4e0d\u540c\u7684\u65f6\u95f4\u8282\u70b9\uff0c\u9ad8\u65af\u7403\u4f1a\u505a\u51fa\u76f8\u5e94\u7684\u53d8\u6362\uff09 4DGS \u6a21\u578b\u4e2d\uff0c\u5c06\u4e00\u4e2a\u70b9\u7684 \\((x,y,z,t)\\) \u5750\u6807\u5148\u4ee3\u5165\u4e00\u4e2a\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668\uff0c\u968f\u540e\u8f93\u51fa\u5e26\u5165\u4e00\u4e2a\u591a\u5934\u7684\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u8fdb\u884c\u89e3\u7801\uff0c\u5f97\u5230 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u4e0e\u539f\u503c\u76f8\u52a0\u540e\uff0c\u6309\u7167 3DGS \u7684\u65b9\u6cd5\u5f97\u5230\u4e0d\u900f\u660e\u5ea6\u548c SH \u7cfb\u6570\u8fdb\u884c\u6e32\u67d3","title":"Introduction"},{"location":"cv/papers/3dgs/4dgs/#4d-gaussian-splatting-framework","text":"\u53c2\u6570\u8bf4\u660e \u65cb\u8f6c\u77e9\u9635 \\(M = [R, T]\\) \u65f6\u95f4\u6233 \\(t\\) 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u9ad8\u65af\u53d8\u5f62\u573a\u7f51\u7edc \\(\\mathcal{F}\\) \u6cfc\u6e85\u65b9\u6cd5 \\(\\mathcal{S}\\) 3D \u9ad8\u65af\u53d8\u5f62\u573a\u53d8\u5316\u91cf \\(\\Delta \\mathcal{G} = \\mathcal{F}(\\mathcal{G}, t)\\) \u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668 \\(\\mathcal{H}\\) \uff0c\u5c06 3D \u9ad8\u65af\u7f16\u7801 \\(f_d = \\mathcal{H} = (\\mathcal{G}, t)\\) \u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D}\\) \uff0c\u5c06 \\(\\Delta \\mathcal{G}\\) \u89e3\u7801 \\(\\Delta \\mathcal{G} = \\mathcal{D}(f)\\) \u4ece\u539f\u59cb 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u8f6c\u6362\u5230\u4e00\u4e2a\u65f6\u95f4\u6233\u7684\u65b0\u7684 \\(\\mathcal{G}^\\prime = \\Delta \\mathcal{G} + \\mathcal{G}\\) \u65b0\u89c6\u89d2\u56fe\u50cf \\(\\hat{I} = \\mathcal{S}(M, \\mathcal{G}^\\prime)\\)","title":"4D Gaussian Splatting Framework"},{"location":"cv/papers/3dgs/4dgs/#gaussian-deformation-field-network","text":"","title":"Gaussian Deformation Field Network"},{"location":"cv/papers/3dgs/4dgs/#spatial-temporal-structure-encoder","text":"\u7075\u611f\u6765\u6e90 \u53c2\u8003 CVPR 2023 HexPlane \u548c K-Planes \u4e2d\u6709\u5173\u65f6\u7a7a\u7ed3\u6784\u5f20\u91cf\u5206\u89e3\u7684\u601d\u60f3\uff0c\u6700\u5f00\u59cb\u662f\u5728 3D NeRF \u4e2d \u8bba\u6587 TensoRF \u51fa\u73b0\uff0c\u6536\u5230\u5f20\u91cf CP/VM \u5206\u89e3\u516c\u5f0f\u7684\u542f\u53d1\uff0c\u7387\u5148\u63d0\u51fa\u5c063D\u7a7a\u95f4\u5f20\u91cf\u5206\u89e3\u6210\u591a\u4e2a\u79e91\u5f20\u91cf\uff0c\u5efa\u7acb\u4e86\u4e00\u4e2a\u663e\u5f0f\u7684\u6a21\u578b\u6765\u8868\u5f813D\u7a7a\u95f4\uff0c\u5c06\u6bcf\u4e2a\u79e91\u5f20\u91cf\u4f5c\u4e3a\u5f85\u4f18\u5316\u7684\u53d8\u91cf\uff0c\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u8fdb\u884c\u4f18\u5316\uff0c\u63d0\u9ad8\u4e86\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6\u4e0e\u63a8\u7406\u901f\u5ea6 HexPlane \u63d0\u51fa\u4e86\u4e00\u4e2a 4D \u7a7a\u95f4\u5f20\u91cf\u8f90\u5c04\u573a\uff0c\u7b80\u5355\u7406\u89e3\u5c31\u662f\u628a\u4e00\u4e2a \\((x,y,z,t)\\) \u56db\u7ef4\u5f20\u91cf\u770b\u4f5c \\((xy, zt, yz, xt, zx, yt\\) ) \u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\uff0c\u91c7\u7528\u7c7b\u4f3c\u5f20\u91cf VM \u5206\u89e3\u7684\u65b9\u5f0f\u6765\u7ec4\u5408 K-Planes \u4e5f\u662f\u76f8\u540c\u7684\u601d\u60f3\uff0c\u5dee\u522b\u5728\u4e8e\u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\u5f62\u5f0f\uff0c\u91c7\u7528\u7c7b\u4f3c Hadamard \u79ef\u6765\u7ec4\u5408 HexPlane \u548c K-Planes \u5229\u7528 4D \u7a7a\u95f4\u5f20\u91cf\u573a\u5bf9\u7a7a\u95f4\u4fe1\u606f\u8fdb\u884c\u7f16\u7801\uff0c\u968f\u540e\u5229\u7528\u591a\u5934\u89e3\u7801\u5668\u89e3\u7801\u51fa\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u7136\u540e\u7528 NeRF \u7684\u4f53\u79ef\u5c04\u7ebf\u6cd5\u6e32\u67d3\u56fe\u50cf \u4e0e HexPlane \u548c K-Planes \u4e0d\u540c\u7684\u662f\uff0c4DGS \u63a5\u4e0b\u6765\u901a\u8fc7\u4e00\u4e2a\u7531\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u5c06\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u4fe1\u606f\u5206\u522b\u89e3\u7801\u6210 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u800c\u4e0d\u662f\u89e3\u7801\u6210\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u8f6c\u800c\u7528 3DGS \u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406 \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u7a7a\u95f4\u76f8\u90bb\u7684\u9ad8\u65af\u5728\u8fd0\u52a8\u548c\u5f62\u53d8\u4e0a\u5177\u6709\u76f8\u4f3c\u7684\u7279\u5f81\uff0c\u540c\u4e00\u4e2a\u9ad8\u65af\u5728\u76f8\u90bb\u65f6\u95f4\u4e5f\u4f1a\u5448\u73b0\u76f8\u4f3c\u7684\u53d8\u5316\u7279\u5f81\uff0c\u5e76\u4e14\u76f8\u9694\u8f83\u8fdc\u7684\u9ad8\u65af\u4e4b\u95f4\u4e5f\u4f1a\u5177\u6709\u4e00\u5b9a\u7684\u5173\u8054\u3002 \u56e0\u6b64 4DGS \u91c7\u7528 \u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u4f53\u7d20\u7f51\u683c\u6a21\u5757 \u5bf9\u5355\u5143\u4f53\u7d20\u4e2d\u7684\u6bcf\u4e2a\u9ad8\u65af\u7684\u7a7a\u95f4\u548c\u65f6\u95f4\u8fdb\u884c\u7f16\u7801 \\(\\mathcal{H}\\) \u5305\u62ec\u516d\u4e2a\u591a\u5206\u8fa8\u7387\u5e73\u9762\u6a21\u5757 \\(R_l(i,j)\\) \u548c\u4e00\u4e2a\u5c0f\u578b MLP \\(\\phi_d\\) \\(\\{R_l(i,j), \\phi_d | (i,j) \\in \\{ (x,y),(x,z),(y,z),(x,t),(y,t),(z,t)\\}, l \\in \\{1, 2 \\} \\}\\) \uff0c \\(\\mu = (x,y,z)\\) \u662f 3D \u9ad8\u65af\u7684\u5e73\u5747\u503c \u8ba1\u7b97\u4f53\u7d20\u7279\u5f81\uff1a \\[ f_h=\\bigcup_l\\prod\\text{interp}(R_l(i,j)) \\] \\(f_h\\) \u662f\u795e\u7ecf\u4f53\u7d20\u7279\u5f81\uff0c\u5229\u7528\u53cc\u7ebf\u6027\u63d2\u503c\u5bf9\u9644\u8fd1\u7684\u56db\u4e2a\u67e5\u8be2\u4f53\u7d20\u7279\u5f81\u8fdb\u884c\u63d2\u503c \u968f\u540e\u7528 MLP \u5c06\u6240\u6709\u539f\u59cb\u7279\u5f81\u8fdb\u884c\u89e3\u7801 \\(f_d = \\phi_d(f_h)\\)","title":"Spatial-Temporal Structure Encoder"},{"location":"cv/papers/3dgs/4dgs/#multi-head-gaussian-deformation-decoder","text":"\u8bbe\u8ba1\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D} = \\{ \\phi_x, \\phi_r, \\phi_s \\}\\) \u7528 MLP \u5206\u522b\u9884\u6d4b\u53d8\u5f62\u91cf \u9ad8\u65af\u7403\u4f4d\u79fb\u53d8\u5316\u91cf \\(\\Delta \\mathcal{X} = \\phi_x(f_d)\\) \u9ad8\u65af\u7403\u65cb\u8f6c\u56db\u5143\u6570\u53d8\u5316\u91cf \\(\\Delta r = \\phi_r(f_d)\\) \u9ad8\u65af\u7403\u7f29\u653e\u56e0\u5b50\u53d8\u5316\u91cf \\(\\Delta s = \\phi_s(f_d)\\) \u53d8\u5f62\u540e\u7684\u7279\u5f81\u8868\u793a\u4e3a \\((\\mathcal{X}^\\prime, r^\\prime, s^\\prime) = (\\mathcal{X} + \\Delta \\mathcal{X}, r + \\Delta r, s + \\Delta s)\\) \u6700\u540e\u83b7\u5f97\u51fa\u9ad8\u65af\u7403\u52a8\u6001\u53d8\u5316\u540e\u7684\u65b0\u5f62\u72b6\u65b0\u4f4d\u7f6e \\(\\mathcal{G}^\\prime = \\{ \\mathcal{X}^\\prime, s^\\prime, r^\\prime, \\sigma, \\mathcal{C} \\}\\)","title":"Multi-Head Gaussian Deformation Decoder"},{"location":"cv/papers/3dgs/4dgs/#optimization","text":"","title":"Optimization"},{"location":"cv/papers/3dgs/4dgs/#3d-gaussian-initialization","text":"\u91c7\u53d6\u4e86\u4e24\u9636\u6bb5\u8bad\u7ec3\u7b56\u7565\uff1a\u9759\u6001\u573a\u666f\u521d\u59cb\u5316\u548c\u53d8\u5f62\u573a\u5fae\u8c03\uff1b \u521d\u59cb\u5316\u9636\u6bb5\uff1a\u4e3b\u8981\u4f18\u5316\u9759\u6001\u573a\u666f\u7684\u8868\u793a\uff0c\u5373\u53ea\u4f18\u5316 3D Gaussians \u7684\u53c2\u6570\uff1b \u5fae\u8c03\u9636\u6bb5\uff1a\u4e3b\u8981\u5b66\u4e60\u53d8\u5f62\u573a\u7684\u8868\u793a\uff0c\u5373\u4f18\u5316\u591a\u5206\u8fa8\u7387\u795e\u7ecf\u4f53\u7d20\u548c MLP\uff1b","title":"3D Gaussian Initialization"},{"location":"cv/papers/3dgs/4dgs/#loss-function","text":"\u4f7f\u7528 \\(L_1\\) \u989c\u8272\u635f\u5931\u548c\u57fa\u4e8e\u7f51\u683c\u7684 TV \u635f\u5931 \\(\\mathcal{L}_{tv}\\) \u76d1\u7763\u8bad\u7ec3 \\[ \\mathcal{L} = \\left | \\hat{I} - I \\right | + \\mathcal{L}_{tv} \\]","title":"Loss Function"},{"location":"cv/papers/3dgs/4dgs/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/3dgs/4dgs/#reference","text":"https://blog.csdn.net/m0_51976564/article/details/134595401 https://zhuanlan.zhihu.com/p/663337795 https://blog.csdn.net/weixin_71780622/article/details/136063893 https://blog.csdn.net/m0_55605361/article/details/141122450","title":"Reference"},{"location":"cv/papers/3dgs/splatam/","text":"SplaTAM \u00b6 \u7ea6 1520 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a SplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM code\uff1a gaussian-splatting Idea \u00b6 Introduction \u00b6 \u7b2c\u4e00\u4e2a 3DGS \u7ed3\u5408 SLAM \u7684\u7cfb\u7edf\uff0c\u7528 3DGS \u8868\u793a\u573a\u666f\uff0c\u53ef\u4ee5\u7528\u65e0\u4f4d\u59ff\u7684\u5355\u76ee RGB-D \u76f8\u673a\u5b9e\u73b0\u5bc6\u96c6 SLAM \u89e3\u51b3\u795e\u7ecf\u8f90\u5c04\u573a\u573a\u666f\u8868\u793a\u7684\u5c40\u9650\u6027\uff0c\u5305\u62ec\u5feb\u901f\u6e32\u67d3\u548c\u4f18\u5316\uff0c\u786e\u5b9a\u533a\u57df\u662f\u5426\u88ab map \u7684\u80fd\u529b\uff0c\u4ee5\u53ca\u901a\u8fc7\u6dfb\u52a0\u548c\u5220\u9664\u9ad8\u65af\u7684\u7ed3\u6784\u5316\u5730\u56fe\u6269\u5c55 \u91c7\u7528\u4e86\u4e00\u4e2a\u5728\u7ebf\u8ddf\u8e2a\u548c\u5efa\u56fe\u6846\u67b6\uff0c\u540c\u65f6\u88c1\u526a\u5b83\uff0c\u4ee5\u4e13\u95e8\u4f7f\u7528\u5e95\u5c42\u7684\u9ad8\u65af\u8868\u793a\u548c\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u7684silhouette(\u8f6e\u5ed3)\u5f15\u5bfc\u7684\u4f18\u5316 \u540c\u65f6\u4f18\u5316\u4f4d\u59ff\u4f30\u8ba1\u3001\u573a\u666f\u91cd\u5efa\u548c\u65b0\u89c6\u89d2\u5408\u6210\uff0c\u5141\u8bb8\u5b9e\u65f6\u6e32\u67d3\u9ad8\u5206\u8fa8\u7387\u7684\u5bc6\u96c6 3D \u5730\u56fe \u9ad8\u65af\u5730\u56fe\u8868\u793a \u00b6 \u573a\u666f\u4e2d\u7684\u5e95\u5c42\u5730\u56fe\u8868\u793a\u4e3a\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\uff0c\u7b80\u5316\u539f\u59cb GS\uff0c \u53ea\u4f7f\u7528\u4e0e\u89c6\u56fe\u65e0\u5173\u7684\u989c\u8272\uff0c\u5e76\u8feb\u4f7f\u9ad8\u65af\u5206\u5e03\u662f\u5404\u5411\u540c\u6027 \u6bcf\u4e2a\u9ad8\u65af\u503c\u53ea\u6709 8 \u4e2a\u53c2\u6570\uff08RGB 3 \u4e2a\uff0c\u4e2d\u5fc3\u4f4d\u7f6e 3 \u4e2a\uff0c\u534a\u5f84 1 \u4e2a\uff0c\u4e0d\u900f\u660e\u5ea6 1 \u4e2a\uff09 \u6839\u636e\u9ad8\u65af\u5206\u5e03\u7684\u4e0d\u900f\u660e\u5ea6\u52a0\u6743\u7684\u6807\u51c6\uff08\u975e\u5f52\u4e00\u5316\uff09\u9ad8\u65af\u65b9\u7a0b\uff0c\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u90fd\u5f71\u54cd\u4e09\u7ef4\u7a7a\u95f4 \\(x \\in R^3\\) \u7684\u4e00\u4e2a\u70b9\uff1a \\[ f(\\mathcal{x}) = o \\exp \\left ( - \\frac{\\left \\| \\mathcal{x} - \\mathcal{\\mu} \\right \\|^2 }{2r^2} \\right) \\] \u6cfc\u6e85\u7684\u53ef\u5fae\u6e32\u67d3 \u00b6 \u80fd\u591f\u5c06\u5e95\u5c42\u9ad8\u65af\u5730\u56fe\u4e2d\u7684\u9ad8\u4fdd\u771f\u989c\u8272\u3001\u6df1\u5ea6\u548c\u8f6e\u5ed3\u56fe\u50cf\u6e32\u67d3\u5230\u4efb\u4f55\u53ef\u80fd\u7684\u76f8\u673a\u53c2\u8003\u5e27\u4e2d \u53ef\u5fae\u6e32\u67d3\u5141\u8bb8\u76f4\u63a5\u8ba1\u7b97\u5e95\u5c42\u573a\u666f\u8868\u793a\uff08\u9ad8\u65af\uff09\u548c\u76f8\u673a\u53c2\u6570\u7684\u68af\u5ea6\uff0c\u5229\u7528\u6e32\u67d3\u548c\u771f\u5b9e\u7684 RGB-D \u5e27\u4e4b\u95f4\u7684\u8bef\u5dee\uff0c\u5e76\u66f4\u65b0\u9ad8\u65af\u548c\u76f8\u673a\u53c2\u6570\u6765\u51cf\u5c11\u8bef\u5dee \u9ad8\u65af\u6e32\u67d3 RGB \u56fe\u50cf\u7684\u8fc7\u7a0b\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e09\u7ef4\u9ad8\u65af\u548c\u76f8\u673a\u4f4d\u59ff\u7684\u96c6\u5408\uff0c\u9996\u5148\u4ece\u524d\u5f80\u540e\u5bf9\u6240\u6709\u9ad8\u65af\u8fdb\u884c\u6392\u5e8f\uff0c\u901a\u8fc7 \u5728\u50cf\u7d20\u7a7a\u95f4\u4e2d\uff0c\u4f9d\u6b21 \\(\\alpha\\) -\u5408\u6210\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u7684\u4e8c\u7ef4\u6295\u5f71\uff0c\u6765\u6e32\u67d3 RGB \u56fe\u50cf \u50cf\u7d20 \\(p=(u,v)\\) \u6e32\u67d3\u989c\u8272\u516c\u5f0f\uff1a \\[ \\begin{aligned} C(\\mathcal{p}) = \\sum_{i=1}^n \\mathcal{c}_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\\\ \\mathcal{\\mu}^{2D} = K \\frac{E_t \\mathcal{\\mu}}{d}, \\ \\ \\ r^{2D} = \\frac{fr}{d}, \\ \\ \\ where d = (E_t \\mathcal{\\mu})_z \\end{aligned} \\] \\(K\\) \u662f\u76f8\u673a\u5185\u53c2\uff0c \\(E_t\\) \u662f\u7b2c \\(t\\) \u5e27\u5904\u7684\u76f8\u673a\u65cb\u8f6c\u548c\u5e73\u79fb\u7684\u5916\u53c2\uff0c \\(f\\) \u662f\u7126\u8ddd\uff0c \\(d\\) \u662f\u76f8\u673a\u5750\u6807\u7cfb\u4e0b\u7b2c \\(i\\) \u4e2a\u9ad8\u65af\u503c\u7684\u6df1\u5ea6 \u7c7b\u4f3c\u7684\u6df1\u5ea6\u6e32\u67d3\uff08\u53ef\u4ee5\u4e0e\u8f93\u5165\u6df1\u5ea6\u56fe\u6bd4\u8f83\uff0c\u8fd4\u56de\u76f8\u5bf9\u4e8e 3D \u5730\u56fe\u7684\u68af\u5ea6\uff09 \\[ D(\\mathcal{p}) = \\sum_{i=1}^n d_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\] \u6e32\u67d3\u4e00\u4e2a silhouette\uff08\u8f6e\u5ed3\uff09\u56fe\u50cf\u6765\u786e\u5b9a\u53ef\u89c1\u6027\uff0c\u4f8b\u5982\u4e00\u4e2a\u50cf\u7d20\u662f\u5426\u5305\u542b\u6765\u81ea\u5f53\u524d\u5730\u56fe\u7684\u4fe1\u606f\uff1a \\[ S(\\mathcal{p}) = \\sum_{i=1}^n f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\] SLAM \u7cfb\u7edf \u00b6 Tip \u4ece\u9ad8\u65af\u5e95\u5c42\u8868\u793a\u548c\u53ef\u5fae\u6e32\u67d3\u5668\u5efa\u7acb\u4e00\u4e2a SLAM \u7cfb\u7edf\u3002 \u5047\u8bbe\u6709\u4e00\u4e2a\u73b0\u6709\u7684\u5730\u56fe\uff08\u901a\u8fc7\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\u8868\u793a\uff09\uff0c\u5df2\u7ecf\u62df\u5408\u4e86\u7b2c 1 \u5e27\u5230\u7b2c t \u5e27\u3002\u7ed9\u5b9a\u4e00\u4e2a\u65b0\u7684 RGB-D \u5e27 t+1\uff0cSLAM \u7cfb\u7edf\u4f1a\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a \u76f8\u673a\u8ddf\u8e2a \uff1a\u5229\u7528 t + 1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316 RGB-D \u5e8f\u5217\u7684\u56fe\u50cf\u548c\u6df1\u5ea6\u91cd\u5efa\u8bef\u5dee\uff0c\u4f46\u53ea\u8bc4\u4f30\u8f6e\u5ed3\u5185\u7684\u50cf\u7d20\u7684\u8bef\u5dee \u9ad8\u65af\u5bc6\u5ea6 \uff1a\u6839\u636e\u6e32\u67d3\u7684\u8f6e\u5ed3\u548c\u8f93\u5165\u6df1\u5ea6\uff0c\u5411\u5730\u56fe\u4e2d\u6dfb\u52a0\u65b0\u7684\u9ad8\u65af \u5730\u56fe\u66f4\u65b0 \uff1a\u7ed9\u5b9a\u4ece\u7b2c 1 \u5e27\u5230 \u7b2c t+1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316\u6240\u6709\u56fe\u50cf\u7684 RGB \u548c\u6df1\u5ea6\u8bef\u5dee\u6765\u66f4\u65b0\u9ad8\u65af\u5206\u5e03\u53c2\u6570\u3002\u4ee3\u7801\u4e2d\uff0c\u4e3a\u4fdd\u6301\u6279\u5904\u7406\u5927\u5c0f\u548c\u53ef\u7ba1\u7406\u6027\uff0c\u5c06\u5bf9\u9009\u597d\u7684\uff0c\u4e0e\u6700\u8fd1\u5e27\u91cd\u53e0\u7684\u5173\u952e\u5e27\u5b50\u96c6\u8fdb\u884c\u4f18\u5316 \u521d\u59cb\u5316 \u00b6 \u7b2c\u4e00\u5e27\u8df3\u8fc7\u8ddf\u8e2a\uff0c\u5c06\u76f8\u673a\u4f4d\u59ff\u8bbe\u7f6e\u4e3a identity\uff0c\u7a20\u5bc6\u5316\u4e2d\uff0c\u7531\u4e8e\u6e32\u67d3\u7684\u8f6e\u5ed3\u4e3a\u7a7a\uff0c \u6240\u6709\u50cf\u7d20\u90fd\u7528\u4e8e\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af \u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u6dfb\u52a0\u4e00\u4e2a\u989c\u8272\u4e3a\u50cf\u7d20\u7684\u65b0\u9ad8\u65af\uff0c\u4e2d\u5fc3\u4f4d\u7f6e\u4e3a\u6295\u5f71\u7684\u50cf\u7d20\u6df1\u5ea6\uff0c\u4e0d\u900f\u660e\u5ea6\u4e3a 0.5\uff0c\u534a\u5f84\u7b49\u4e8e\u4e00\u4e2a\u50cf\u7d20\u534a\u5f84\u6295\u5f71\u5230 2D \u56fe\u50cf\u7684\u6df1\u5ea6\u9664\u4ee5\u7126\u8ddd \\(r = \\frac{D_{GT}}{f}\\) \u76f8\u673a\u8ddf\u8e2a \u00b6 \u4f30\u8ba1\u5f53\u524d\u8f93\u5165\u7684\u5728\u7ebf RGB-D \u56fe\u50cf\u7684\u76f8\u673a\u4f4d\u59ff\u3002\u901a\u8fc7\u5bf9\u76f8\u673a\u4e2d\u5fc3 + \u56db\u5143\u6570\u7a7a\u95f4\u4e2d\u59ff\u6001\u53c2\u6570\u7684\u6052\u5b9a\u901f\u5ea6\u6b63\u5411\u6295\u5f71\uff0c\u4e3a\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u6b65\u521d\u59cb\u5316\u76f8\u673a\u4f4d\u59ff \\[ E_{t+1}=E_t + (E_t - E_{t-1}) \\] \u901a\u8fc7\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\uff0c\u901a\u8fc7\u53ef\u5fae\u5206\u6e32\u67d3 RGB\u3001\u6df1\u5ea6\u3001\u548c\u8f6e\u5ed3\u56fe\uff0c\u5e76\u66f4\u65b0\u76f8\u673a\u53c2\u6570\uff0c\u540c\u65f6\u4fdd\u6301\u9ad8\u65af\u53c2\u6570\u4e0d\u53d8\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\uff1a \\[ L(t) = \\sum_\\mathcal{p} (S(\\mathcal{p}) > 0.99)(L_1(D(\\mathcal{p}))+0.5L_1(C(\\mathcal{p}))) \\] \u4e0a\u8ff0\u4e3a\u6df1\u5ea6\u548c\u989c\u8272\u4e0a\u7684 \\(L_1\\) \u635f\u5931\uff0c\u989c\u8272\u7684\u6743\u91cd\u5c11\u4e00\u534a\uff0c\u53ea\u5e94\u7528\u4ee5\u4e0a\u635f\u5931\u4e8e\u901a\u8fc7\u8f6e\u5ed3\u56fe\u6e32\u67d3\u7684\u50cf\u7d20\u3002\u8f6e\u5ed3\u56fe\u6355\u83b7\u4e86\u5730\u56fe\u7684\u4e0d\u786e\u5b9a\u6027\u3002\u8fd9\u5bf9\u4e8e\u8ddf\u8e2a\u65b0\u7684\u76f8\u673a\u4f4d\u59ff\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u65b0\u5e27\u901a\u5e38\u5305\u542b\u5728\u5730\u56fe\u4e2d\u5c1a\u672a\u6355\u83b7\u6216\u7ecf\u8fc7\u826f\u597d\u4f18\u5316\u7684\u65b0\u4fe1\u606f\u3002\u5982\u679c\u4e00\u4e2a\u50cf\u7d20\u6ca1\u6709 GT \u6df1\u5ea6\uff0c\u5219 \\(L_1\\) \u635f\u5931\u4e3a 0 \u9ad8\u65af\u7a20\u5bc6\u5316 \u00b6 \u4e3a\u6bcf\u4e2a\u65b0\u8fdb\u5165\u5e27\u5728\u5730\u56fe\u4e2d\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af\u5206\u5e03\u3002 \u5728\u8ddf\u8e2a\u4e4b\u540e\uff0c\u5bf9\u65b0\u8fdb\u5165\u5e27\u7684\u76f8\u673a\u4f4d\u59ff\u6709\u4e00\u4e2a\u51c6\u786e\u7684\u4f30\u8ba1 \u5bf9\u4e8e\u6df1\u5ea6\u56fe\u50cf\uff0c\u5bf9\u9ad8\u65af\u5206\u5e03\u5728\u573a\u666f\u4e2d\u7684\u4f4d\u7f6e\u6709\u4e86\u597d\u7684\u4f30\u8ba1 \u5f53\u524d\u7684\u9ad8\u65af\u5df2\u7ecf\u51c6\u786e\u5730\u8868\u793a\u573a\u666f\u51e0\u4f55\uff0c\u4e0d\u9700\u8981\u6dfb\u52a0\u9ad8\u65af\uff0c\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u5bc6\u96c6\u5316 mask \u6765\u786e\u5b9a\u54ea\u4e9b\u50cf\u7d20\u5e94\u8be5\u88ab\u5bc6\u96c6\u5316 \\[ M(\\mathcal{p}) = (S(\\mathcal{p})<0.5) + (D_{GT}(\\mathcal{p})50 MDE) \\] \u6b64 mask \u53ea\u663e\u793a\u5730\u56fe\u5bc6\u5ea6\u4e0d\u8db3\u7684\u5730\u65b9 ( \\(S < 0.5\\) )\uff0c\u6216\u8005\u5728\u5f53\u524d\u4f30\u8ba1\u7684\u51e0\u4f55\u56fe\u5f62\u524d\u9762\u6709\u65b0\u7684\u51e0\u4f55\u56fe\u5f62\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u57fa\u4e8e\u8fd9\u4e2a mask\uff0c\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u9ad8\u65af\u8fdb\u884c\u7b2c\u4e00\u5e27\u521d\u59cb\u5316 \u9ad8\u65af\u5730\u56fe\u66f4\u65b0 \u00b6 \u57fa\u4e8e\u4f30\u8ba1\u7684\u5728\u7ebf\u76f8\u673a\u4f4d\u59ff\u4e0b\uff0c\u66f4\u65b0\u4e09\u7ef4\u9ad8\u65af\u5730\u56fe\u7684\u53c2\u6570\u3002\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u548c\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\u6765\u5b9e\u73b0\uff0c \u548c\u8ddf\u8e2a\u4e0d\u540c\u7684\u662f\uff0c\u76f8\u673a\u4f4d\u59ff\u662f\u56fa\u5b9a\u7684\uff0c\u9ad8\u65af\u5206\u5e03\u7684\u53c2\u6570\u88ab\u66f4\u65b0 \u548c\u5df2\u77e5\u76f8\u673a\u4f4d\u59ff\u7684\u56fe\u50cf\u62df\u5408\u8f90\u5c04\u573a\u7684\u7ecf\u5178\u95ee\u9898\u76f8\u4f3c\uff0c\u6709\u4e24\u4e2a\u4f18\u5316\u7684\u5730\u65b9\uff1a \u4e0d\u662f\u4ece\u5934\u5f00\u59cb\uff0c\u800c\u662f\u4ece\u6700\u8fd1\u6784\u5efa\u7684\u5730\u56fe\u4e2d\u9884\u70ed\uff0c\u5f00\u59cb\u4f18\u5316 \u4e0d\u4f18\u5316\u6240\u6709\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff0c\u800c\u662f\u9009\u62e9\u53ef\u80fd\u5f71\u54cd\u65b0\u6dfb\u52a0\u7684\u9ad8\u65af\u5206\u5e03\u7684\u5e27\u3002\u5c06\u6bcf n \u5e27\u4fdd\u5b58\u4e3a\u5173\u952e\u5e27\uff0c\u5e76\u9009\u62e9 k \u5e27\u8fdb\u884c\u4f18\u5316\uff0c\u5305\u62ec\u5f53\u524d\u5e27\u3001\u6700\u8fd1\u7684\u5173\u952e\u5e27\uff0c\u4ee5\u53ca k\u22122 \u4e4b\u524d\u4e0e\u5f53\u524d\u5e27\u91cd\u53e0\u6700\u9ad8\u7684\u5173\u952e\u5e27\u3002\u91cd\u53e0\u662f\u901a\u8fc7\u53d6\u5f53\u524d\u5e27\u6df1\u5ea6\u56fe\u7684\u70b9\u4e91\uff0c\u5e76\u786e\u5b9a\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u9519\u8bef\u70b9\u6570\u6765\u786e\u5b9a\u7684 \u4f18\u5316\u548c\u8ddf\u8e2a\u7684\u635f\u5931\u76f8\u4f3c\uff0c\u4f46\u4e0d\u4f7f\u7528\u8f6e\u5ed3 mask\uff08\u56e0\u4e3a\u8981\u4f18\u5316\u6240\u6709\u50cf\u7d20\uff09\u3002\u53e6\u5916\u5728 RGB \u6e32\u67d3\u4e2d\u6dfb\u52a0\u4e00\u4e2a SSIM \u635f\u5931\uff0c\u5e76\u5254\u9664\u4e0d\u900f\u660e\u5ea6\u63a5\u8fd1 0 \u7684\u65e0\u7528\u9ad8\u65af\u5206\u5e03 Experiment \u00b6 Reference \u00b6 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian SLAM\uff0cSplaTAM\u914d\u7f6e\uff08Linux\uff09\u4e0e\u6e90\u7801\u89e3\u8bfb-CSDN\u535a\u5ba2 \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014\u57fa\u4e8eTUM-RGBD\u6570\u636e\u96c6\u7684SplaTAM\u6d4b\u8bd5_jiyu tum-rgbd\u6570\u636e\u96c6\u7684splatam\u6d4b\u8bd5-CSDN\u535a\u5ba2 \u3010\u4e09\u7ef4\u91cd\u5efa\u3011\u3010SLAM\u3011SplaTAM\uff1a\u57fa\u4e8e3D\u9ad8\u65af\u7684\u5bc6\u96c6RGB-D SLAM(CVPR 2024)-CSDN\u535a\u5ba2 \u8bba\u6587\u590d\u73b0\u300aSplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM\u300b_splatam\u8bba\u6587\u89e3\u6790-CSDN\u535a\u5ba2","title":"SplaTAM"},{"location":"cv/papers/3dgs/splatam/#splatam","text":"\u7ea6 1520 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a SplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM code\uff1a gaussian-splatting","title":"SplaTAM"},{"location":"cv/papers/3dgs/splatam/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/splatam/#introduction","text":"\u7b2c\u4e00\u4e2a 3DGS \u7ed3\u5408 SLAM \u7684\u7cfb\u7edf\uff0c\u7528 3DGS \u8868\u793a\u573a\u666f\uff0c\u53ef\u4ee5\u7528\u65e0\u4f4d\u59ff\u7684\u5355\u76ee RGB-D \u76f8\u673a\u5b9e\u73b0\u5bc6\u96c6 SLAM \u89e3\u51b3\u795e\u7ecf\u8f90\u5c04\u573a\u573a\u666f\u8868\u793a\u7684\u5c40\u9650\u6027\uff0c\u5305\u62ec\u5feb\u901f\u6e32\u67d3\u548c\u4f18\u5316\uff0c\u786e\u5b9a\u533a\u57df\u662f\u5426\u88ab map \u7684\u80fd\u529b\uff0c\u4ee5\u53ca\u901a\u8fc7\u6dfb\u52a0\u548c\u5220\u9664\u9ad8\u65af\u7684\u7ed3\u6784\u5316\u5730\u56fe\u6269\u5c55 \u91c7\u7528\u4e86\u4e00\u4e2a\u5728\u7ebf\u8ddf\u8e2a\u548c\u5efa\u56fe\u6846\u67b6\uff0c\u540c\u65f6\u88c1\u526a\u5b83\uff0c\u4ee5\u4e13\u95e8\u4f7f\u7528\u5e95\u5c42\u7684\u9ad8\u65af\u8868\u793a\u548c\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u7684silhouette(\u8f6e\u5ed3)\u5f15\u5bfc\u7684\u4f18\u5316 \u540c\u65f6\u4f18\u5316\u4f4d\u59ff\u4f30\u8ba1\u3001\u573a\u666f\u91cd\u5efa\u548c\u65b0\u89c6\u89d2\u5408\u6210\uff0c\u5141\u8bb8\u5b9e\u65f6\u6e32\u67d3\u9ad8\u5206\u8fa8\u7387\u7684\u5bc6\u96c6 3D \u5730\u56fe","title":"Introduction"},{"location":"cv/papers/3dgs/splatam/#_1","text":"\u573a\u666f\u4e2d\u7684\u5e95\u5c42\u5730\u56fe\u8868\u793a\u4e3a\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\uff0c\u7b80\u5316\u539f\u59cb GS\uff0c \u53ea\u4f7f\u7528\u4e0e\u89c6\u56fe\u65e0\u5173\u7684\u989c\u8272\uff0c\u5e76\u8feb\u4f7f\u9ad8\u65af\u5206\u5e03\u662f\u5404\u5411\u540c\u6027 \u6bcf\u4e2a\u9ad8\u65af\u503c\u53ea\u6709 8 \u4e2a\u53c2\u6570\uff08RGB 3 \u4e2a\uff0c\u4e2d\u5fc3\u4f4d\u7f6e 3 \u4e2a\uff0c\u534a\u5f84 1 \u4e2a\uff0c\u4e0d\u900f\u660e\u5ea6 1 \u4e2a\uff09 \u6839\u636e\u9ad8\u65af\u5206\u5e03\u7684\u4e0d\u900f\u660e\u5ea6\u52a0\u6743\u7684\u6807\u51c6\uff08\u975e\u5f52\u4e00\u5316\uff09\u9ad8\u65af\u65b9\u7a0b\uff0c\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u90fd\u5f71\u54cd\u4e09\u7ef4\u7a7a\u95f4 \\(x \\in R^3\\) \u7684\u4e00\u4e2a\u70b9\uff1a \\[ f(\\mathcal{x}) = o \\exp \\left ( - \\frac{\\left \\| \\mathcal{x} - \\mathcal{\\mu} \\right \\|^2 }{2r^2} \\right) \\]","title":"\u9ad8\u65af\u5730\u56fe\u8868\u793a"},{"location":"cv/papers/3dgs/splatam/#_2","text":"\u80fd\u591f\u5c06\u5e95\u5c42\u9ad8\u65af\u5730\u56fe\u4e2d\u7684\u9ad8\u4fdd\u771f\u989c\u8272\u3001\u6df1\u5ea6\u548c\u8f6e\u5ed3\u56fe\u50cf\u6e32\u67d3\u5230\u4efb\u4f55\u53ef\u80fd\u7684\u76f8\u673a\u53c2\u8003\u5e27\u4e2d \u53ef\u5fae\u6e32\u67d3\u5141\u8bb8\u76f4\u63a5\u8ba1\u7b97\u5e95\u5c42\u573a\u666f\u8868\u793a\uff08\u9ad8\u65af\uff09\u548c\u76f8\u673a\u53c2\u6570\u7684\u68af\u5ea6\uff0c\u5229\u7528\u6e32\u67d3\u548c\u771f\u5b9e\u7684 RGB-D \u5e27\u4e4b\u95f4\u7684\u8bef\u5dee\uff0c\u5e76\u66f4\u65b0\u9ad8\u65af\u548c\u76f8\u673a\u53c2\u6570\u6765\u51cf\u5c11\u8bef\u5dee \u9ad8\u65af\u6e32\u67d3 RGB \u56fe\u50cf\u7684\u8fc7\u7a0b\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e09\u7ef4\u9ad8\u65af\u548c\u76f8\u673a\u4f4d\u59ff\u7684\u96c6\u5408\uff0c\u9996\u5148\u4ece\u524d\u5f80\u540e\u5bf9\u6240\u6709\u9ad8\u65af\u8fdb\u884c\u6392\u5e8f\uff0c\u901a\u8fc7 \u5728\u50cf\u7d20\u7a7a\u95f4\u4e2d\uff0c\u4f9d\u6b21 \\(\\alpha\\) -\u5408\u6210\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u7684\u4e8c\u7ef4\u6295\u5f71\uff0c\u6765\u6e32\u67d3 RGB \u56fe\u50cf \u50cf\u7d20 \\(p=(u,v)\\) \u6e32\u67d3\u989c\u8272\u516c\u5f0f\uff1a \\[ \\begin{aligned} C(\\mathcal{p}) = \\sum_{i=1}^n \\mathcal{c}_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\\\ \\mathcal{\\mu}^{2D} = K \\frac{E_t \\mathcal{\\mu}}{d}, \\ \\ \\ r^{2D} = \\frac{fr}{d}, \\ \\ \\ where d = (E_t \\mathcal{\\mu})_z \\end{aligned} \\] \\(K\\) \u662f\u76f8\u673a\u5185\u53c2\uff0c \\(E_t\\) \u662f\u7b2c \\(t\\) \u5e27\u5904\u7684\u76f8\u673a\u65cb\u8f6c\u548c\u5e73\u79fb\u7684\u5916\u53c2\uff0c \\(f\\) \u662f\u7126\u8ddd\uff0c \\(d\\) \u662f\u76f8\u673a\u5750\u6807\u7cfb\u4e0b\u7b2c \\(i\\) \u4e2a\u9ad8\u65af\u503c\u7684\u6df1\u5ea6 \u7c7b\u4f3c\u7684\u6df1\u5ea6\u6e32\u67d3\uff08\u53ef\u4ee5\u4e0e\u8f93\u5165\u6df1\u5ea6\u56fe\u6bd4\u8f83\uff0c\u8fd4\u56de\u76f8\u5bf9\u4e8e 3D \u5730\u56fe\u7684\u68af\u5ea6\uff09 \\[ D(\\mathcal{p}) = \\sum_{i=1}^n d_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\] \u6e32\u67d3\u4e00\u4e2a silhouette\uff08\u8f6e\u5ed3\uff09\u56fe\u50cf\u6765\u786e\u5b9a\u53ef\u89c1\u6027\uff0c\u4f8b\u5982\u4e00\u4e2a\u50cf\u7d20\u662f\u5426\u5305\u542b\u6765\u81ea\u5f53\u524d\u5730\u56fe\u7684\u4fe1\u606f\uff1a \\[ S(\\mathcal{p}) = \\sum_{i=1}^n f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\]","title":"\u6cfc\u6e85\u7684\u53ef\u5fae\u6e32\u67d3"},{"location":"cv/papers/3dgs/splatam/#slam","text":"Tip \u4ece\u9ad8\u65af\u5e95\u5c42\u8868\u793a\u548c\u53ef\u5fae\u6e32\u67d3\u5668\u5efa\u7acb\u4e00\u4e2a SLAM \u7cfb\u7edf\u3002 \u5047\u8bbe\u6709\u4e00\u4e2a\u73b0\u6709\u7684\u5730\u56fe\uff08\u901a\u8fc7\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\u8868\u793a\uff09\uff0c\u5df2\u7ecf\u62df\u5408\u4e86\u7b2c 1 \u5e27\u5230\u7b2c t \u5e27\u3002\u7ed9\u5b9a\u4e00\u4e2a\u65b0\u7684 RGB-D \u5e27 t+1\uff0cSLAM \u7cfb\u7edf\u4f1a\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a \u76f8\u673a\u8ddf\u8e2a \uff1a\u5229\u7528 t + 1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316 RGB-D \u5e8f\u5217\u7684\u56fe\u50cf\u548c\u6df1\u5ea6\u91cd\u5efa\u8bef\u5dee\uff0c\u4f46\u53ea\u8bc4\u4f30\u8f6e\u5ed3\u5185\u7684\u50cf\u7d20\u7684\u8bef\u5dee \u9ad8\u65af\u5bc6\u5ea6 \uff1a\u6839\u636e\u6e32\u67d3\u7684\u8f6e\u5ed3\u548c\u8f93\u5165\u6df1\u5ea6\uff0c\u5411\u5730\u56fe\u4e2d\u6dfb\u52a0\u65b0\u7684\u9ad8\u65af \u5730\u56fe\u66f4\u65b0 \uff1a\u7ed9\u5b9a\u4ece\u7b2c 1 \u5e27\u5230 \u7b2c t+1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316\u6240\u6709\u56fe\u50cf\u7684 RGB \u548c\u6df1\u5ea6\u8bef\u5dee\u6765\u66f4\u65b0\u9ad8\u65af\u5206\u5e03\u53c2\u6570\u3002\u4ee3\u7801\u4e2d\uff0c\u4e3a\u4fdd\u6301\u6279\u5904\u7406\u5927\u5c0f\u548c\u53ef\u7ba1\u7406\u6027\uff0c\u5c06\u5bf9\u9009\u597d\u7684\uff0c\u4e0e\u6700\u8fd1\u5e27\u91cd\u53e0\u7684\u5173\u952e\u5e27\u5b50\u96c6\u8fdb\u884c\u4f18\u5316","title":"SLAM \u7cfb\u7edf"},{"location":"cv/papers/3dgs/splatam/#_3","text":"\u7b2c\u4e00\u5e27\u8df3\u8fc7\u8ddf\u8e2a\uff0c\u5c06\u76f8\u673a\u4f4d\u59ff\u8bbe\u7f6e\u4e3a identity\uff0c\u7a20\u5bc6\u5316\u4e2d\uff0c\u7531\u4e8e\u6e32\u67d3\u7684\u8f6e\u5ed3\u4e3a\u7a7a\uff0c \u6240\u6709\u50cf\u7d20\u90fd\u7528\u4e8e\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af \u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u6dfb\u52a0\u4e00\u4e2a\u989c\u8272\u4e3a\u50cf\u7d20\u7684\u65b0\u9ad8\u65af\uff0c\u4e2d\u5fc3\u4f4d\u7f6e\u4e3a\u6295\u5f71\u7684\u50cf\u7d20\u6df1\u5ea6\uff0c\u4e0d\u900f\u660e\u5ea6\u4e3a 0.5\uff0c\u534a\u5f84\u7b49\u4e8e\u4e00\u4e2a\u50cf\u7d20\u534a\u5f84\u6295\u5f71\u5230 2D \u56fe\u50cf\u7684\u6df1\u5ea6\u9664\u4ee5\u7126\u8ddd \\(r = \\frac{D_{GT}}{f}\\)","title":"\u521d\u59cb\u5316"},{"location":"cv/papers/3dgs/splatam/#_4","text":"\u4f30\u8ba1\u5f53\u524d\u8f93\u5165\u7684\u5728\u7ebf RGB-D \u56fe\u50cf\u7684\u76f8\u673a\u4f4d\u59ff\u3002\u901a\u8fc7\u5bf9\u76f8\u673a\u4e2d\u5fc3 + \u56db\u5143\u6570\u7a7a\u95f4\u4e2d\u59ff\u6001\u53c2\u6570\u7684\u6052\u5b9a\u901f\u5ea6\u6b63\u5411\u6295\u5f71\uff0c\u4e3a\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u6b65\u521d\u59cb\u5316\u76f8\u673a\u4f4d\u59ff \\[ E_{t+1}=E_t + (E_t - E_{t-1}) \\] \u901a\u8fc7\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\uff0c\u901a\u8fc7\u53ef\u5fae\u5206\u6e32\u67d3 RGB\u3001\u6df1\u5ea6\u3001\u548c\u8f6e\u5ed3\u56fe\uff0c\u5e76\u66f4\u65b0\u76f8\u673a\u53c2\u6570\uff0c\u540c\u65f6\u4fdd\u6301\u9ad8\u65af\u53c2\u6570\u4e0d\u53d8\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\uff1a \\[ L(t) = \\sum_\\mathcal{p} (S(\\mathcal{p}) > 0.99)(L_1(D(\\mathcal{p}))+0.5L_1(C(\\mathcal{p}))) \\] \u4e0a\u8ff0\u4e3a\u6df1\u5ea6\u548c\u989c\u8272\u4e0a\u7684 \\(L_1\\) \u635f\u5931\uff0c\u989c\u8272\u7684\u6743\u91cd\u5c11\u4e00\u534a\uff0c\u53ea\u5e94\u7528\u4ee5\u4e0a\u635f\u5931\u4e8e\u901a\u8fc7\u8f6e\u5ed3\u56fe\u6e32\u67d3\u7684\u50cf\u7d20\u3002\u8f6e\u5ed3\u56fe\u6355\u83b7\u4e86\u5730\u56fe\u7684\u4e0d\u786e\u5b9a\u6027\u3002\u8fd9\u5bf9\u4e8e\u8ddf\u8e2a\u65b0\u7684\u76f8\u673a\u4f4d\u59ff\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u65b0\u5e27\u901a\u5e38\u5305\u542b\u5728\u5730\u56fe\u4e2d\u5c1a\u672a\u6355\u83b7\u6216\u7ecf\u8fc7\u826f\u597d\u4f18\u5316\u7684\u65b0\u4fe1\u606f\u3002\u5982\u679c\u4e00\u4e2a\u50cf\u7d20\u6ca1\u6709 GT \u6df1\u5ea6\uff0c\u5219 \\(L_1\\) \u635f\u5931\u4e3a 0","title":"\u76f8\u673a\u8ddf\u8e2a"},{"location":"cv/papers/3dgs/splatam/#_5","text":"\u4e3a\u6bcf\u4e2a\u65b0\u8fdb\u5165\u5e27\u5728\u5730\u56fe\u4e2d\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af\u5206\u5e03\u3002 \u5728\u8ddf\u8e2a\u4e4b\u540e\uff0c\u5bf9\u65b0\u8fdb\u5165\u5e27\u7684\u76f8\u673a\u4f4d\u59ff\u6709\u4e00\u4e2a\u51c6\u786e\u7684\u4f30\u8ba1 \u5bf9\u4e8e\u6df1\u5ea6\u56fe\u50cf\uff0c\u5bf9\u9ad8\u65af\u5206\u5e03\u5728\u573a\u666f\u4e2d\u7684\u4f4d\u7f6e\u6709\u4e86\u597d\u7684\u4f30\u8ba1 \u5f53\u524d\u7684\u9ad8\u65af\u5df2\u7ecf\u51c6\u786e\u5730\u8868\u793a\u573a\u666f\u51e0\u4f55\uff0c\u4e0d\u9700\u8981\u6dfb\u52a0\u9ad8\u65af\uff0c\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u5bc6\u96c6\u5316 mask \u6765\u786e\u5b9a\u54ea\u4e9b\u50cf\u7d20\u5e94\u8be5\u88ab\u5bc6\u96c6\u5316 \\[ M(\\mathcal{p}) = (S(\\mathcal{p})<0.5) + (D_{GT}(\\mathcal{p})50 MDE) \\] \u6b64 mask \u53ea\u663e\u793a\u5730\u56fe\u5bc6\u5ea6\u4e0d\u8db3\u7684\u5730\u65b9 ( \\(S < 0.5\\) )\uff0c\u6216\u8005\u5728\u5f53\u524d\u4f30\u8ba1\u7684\u51e0\u4f55\u56fe\u5f62\u524d\u9762\u6709\u65b0\u7684\u51e0\u4f55\u56fe\u5f62\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u57fa\u4e8e\u8fd9\u4e2a mask\uff0c\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u9ad8\u65af\u8fdb\u884c\u7b2c\u4e00\u5e27\u521d\u59cb\u5316","title":"\u9ad8\u65af\u7a20\u5bc6\u5316"},{"location":"cv/papers/3dgs/splatam/#_6","text":"\u57fa\u4e8e\u4f30\u8ba1\u7684\u5728\u7ebf\u76f8\u673a\u4f4d\u59ff\u4e0b\uff0c\u66f4\u65b0\u4e09\u7ef4\u9ad8\u65af\u5730\u56fe\u7684\u53c2\u6570\u3002\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u548c\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\u6765\u5b9e\u73b0\uff0c \u548c\u8ddf\u8e2a\u4e0d\u540c\u7684\u662f\uff0c\u76f8\u673a\u4f4d\u59ff\u662f\u56fa\u5b9a\u7684\uff0c\u9ad8\u65af\u5206\u5e03\u7684\u53c2\u6570\u88ab\u66f4\u65b0 \u548c\u5df2\u77e5\u76f8\u673a\u4f4d\u59ff\u7684\u56fe\u50cf\u62df\u5408\u8f90\u5c04\u573a\u7684\u7ecf\u5178\u95ee\u9898\u76f8\u4f3c\uff0c\u6709\u4e24\u4e2a\u4f18\u5316\u7684\u5730\u65b9\uff1a \u4e0d\u662f\u4ece\u5934\u5f00\u59cb\uff0c\u800c\u662f\u4ece\u6700\u8fd1\u6784\u5efa\u7684\u5730\u56fe\u4e2d\u9884\u70ed\uff0c\u5f00\u59cb\u4f18\u5316 \u4e0d\u4f18\u5316\u6240\u6709\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff0c\u800c\u662f\u9009\u62e9\u53ef\u80fd\u5f71\u54cd\u65b0\u6dfb\u52a0\u7684\u9ad8\u65af\u5206\u5e03\u7684\u5e27\u3002\u5c06\u6bcf n \u5e27\u4fdd\u5b58\u4e3a\u5173\u952e\u5e27\uff0c\u5e76\u9009\u62e9 k \u5e27\u8fdb\u884c\u4f18\u5316\uff0c\u5305\u62ec\u5f53\u524d\u5e27\u3001\u6700\u8fd1\u7684\u5173\u952e\u5e27\uff0c\u4ee5\u53ca k\u22122 \u4e4b\u524d\u4e0e\u5f53\u524d\u5e27\u91cd\u53e0\u6700\u9ad8\u7684\u5173\u952e\u5e27\u3002\u91cd\u53e0\u662f\u901a\u8fc7\u53d6\u5f53\u524d\u5e27\u6df1\u5ea6\u56fe\u7684\u70b9\u4e91\uff0c\u5e76\u786e\u5b9a\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u9519\u8bef\u70b9\u6570\u6765\u786e\u5b9a\u7684 \u4f18\u5316\u548c\u8ddf\u8e2a\u7684\u635f\u5931\u76f8\u4f3c\uff0c\u4f46\u4e0d\u4f7f\u7528\u8f6e\u5ed3 mask\uff08\u56e0\u4e3a\u8981\u4f18\u5316\u6240\u6709\u50cf\u7d20\uff09\u3002\u53e6\u5916\u5728 RGB \u6e32\u67d3\u4e2d\u6dfb\u52a0\u4e00\u4e2a SSIM \u635f\u5931\uff0c\u5e76\u5254\u9664\u4e0d\u900f\u660e\u5ea6\u63a5\u8fd1 0 \u7684\u65e0\u7528\u9ad8\u65af\u5206\u5e03","title":"\u9ad8\u65af\u5730\u56fe\u66f4\u65b0"},{"location":"cv/papers/3dgs/splatam/#experiment","text":"","title":"Experiment"},{"location":"cv/papers/3dgs/splatam/#reference","text":"\u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian SLAM\uff0cSplaTAM\u914d\u7f6e\uff08Linux\uff09\u4e0e\u6e90\u7801\u89e3\u8bfb-CSDN\u535a\u5ba2 \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014\u57fa\u4e8eTUM-RGBD\u6570\u636e\u96c6\u7684SplaTAM\u6d4b\u8bd5_jiyu tum-rgbd\u6570\u636e\u96c6\u7684splatam\u6d4b\u8bd5-CSDN\u535a\u5ba2 \u3010\u4e09\u7ef4\u91cd\u5efa\u3011\u3010SLAM\u3011SplaTAM\uff1a\u57fa\u4e8e3D\u9ad8\u65af\u7684\u5bc6\u96c6RGB-D SLAM(CVPR 2024)-CSDN\u535a\u5ba2 \u8bba\u6587\u590d\u73b0\u300aSplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM\u300b_splatam\u8bba\u6587\u89e3\u6790-CSDN\u535a\u5ba2","title":"Reference"},{"location":"cv/papers/dynamic-slam/","text":"\u52a8\u6001 SLAM \u7cfb\u5217 \u00b6 Abstract \u52a8\u6001 SLAM \u7cfb\u5217\u76f8\u5173\u5185\u5bb9 Table of Contents \u00b6 DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM","title":"\u52a8\u6001 SLAM \u7cfb\u5217"},{"location":"cv/papers/dynamic-slam/#slam","text":"Abstract \u52a8\u6001 SLAM \u7cfb\u5217\u76f8\u5173\u5185\u5bb9","title":"\u52a8\u6001 SLAM \u7cfb\u5217"},{"location":"cv/papers/dynamic-slam/#table-of-contents","text":"DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM","title":"Table of Contents"},{"location":"cv/papers/dynamic-slam/crowd-slam/","text":"Crowd-SLAM \u00b6 \u7ea6 172 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a Crowd-SLAM: Visual SLAM Towards Crowded Environments using Object Detection code\uff1a Crowd-SLAM Idea \u00b6 \u52a8\u6001 SLAM + \u76ee\u6807\u68c0\u6d4b\uff08\u62e5\u6324\u7684\u4eba\u7fa4\uff09 \u57fa\u4e8e ORB-SLAM2\uff0c\u989d\u5916\u589e\u52a0\u4e00\u4e2a\u76ee\u6807\u68c0\u6d4b\u7ebf\u7a0b \u76ee\u6807\u68c0\u6d4b\u4f7f\u7528\u6539\u7248\u7684 YOLO\uff0c\u7528 Crowdhuman \u8bad\u7ec3\u7684 CYTi \u5c06\u8fb9\u754c\u6846\u91cc\u7684\u5173\u952e\u70b9\uff08\u4eba\u7684\u7279\u5f81\u70b9\uff09\u5168\u90e8\u89c6\u4e3a\u5916\u70b9\uff0c\u8fdb\u884c\u53bb\u9664 \u68c0\u67e5\u8fc7\u6ee4\u533a\u57df\u5e76\u66f4\u65b0\u7279\u5f81\u70b9\u6570\u91cf\uff0c\u7279\u5f81\u70b9\u7684\u4e2a\u6570\u4ece\u7ed9\u5b9a\u7684\u521d\u59cb\u503c\u5f00\u59cb\uff0c\u968f\u7740\u6ee4\u6ce2\u9762\u79ef\u589e\u52a0\u800c\u589e\u5927\uff0c300/30%\uff0c500/60%\uff0c700/90%\uff0c1200/95%\u3002 Experiments \u00b6 Drawbacks \u00b6 \u7531\u4e8e\u4eba\u7269\u7684\u59ff\u52bf\u548c\u76f8\u673a\u7684\u63a5\u8fd1\uff0c\u4eba\u7269\u5360\u636e\u56fe\u50cf\u5927\u90e8\u5206\u533a\u57df\uff0c\u5bfc\u81f4\u7279\u5f81\u8017\u5c3d \u4e0d\u8fc7\u6ee4\u9664\u4eba\u4e4b\u5916\u7684\u52a8\u6001\u7269\u4f53","title":"Crowd-SLAM"},{"location":"cv/papers/dynamic-slam/crowd-slam/#crowd-slam","text":"\u7ea6 172 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a Crowd-SLAM: Visual SLAM Towards Crowded Environments using Object Detection code\uff1a Crowd-SLAM","title":"Crowd-SLAM"},{"location":"cv/papers/dynamic-slam/crowd-slam/#idea","text":"\u52a8\u6001 SLAM + \u76ee\u6807\u68c0\u6d4b\uff08\u62e5\u6324\u7684\u4eba\u7fa4\uff09 \u57fa\u4e8e ORB-SLAM2\uff0c\u989d\u5916\u589e\u52a0\u4e00\u4e2a\u76ee\u6807\u68c0\u6d4b\u7ebf\u7a0b \u76ee\u6807\u68c0\u6d4b\u4f7f\u7528\u6539\u7248\u7684 YOLO\uff0c\u7528 Crowdhuman \u8bad\u7ec3\u7684 CYTi \u5c06\u8fb9\u754c\u6846\u91cc\u7684\u5173\u952e\u70b9\uff08\u4eba\u7684\u7279\u5f81\u70b9\uff09\u5168\u90e8\u89c6\u4e3a\u5916\u70b9\uff0c\u8fdb\u884c\u53bb\u9664 \u68c0\u67e5\u8fc7\u6ee4\u533a\u57df\u5e76\u66f4\u65b0\u7279\u5f81\u70b9\u6570\u91cf\uff0c\u7279\u5f81\u70b9\u7684\u4e2a\u6570\u4ece\u7ed9\u5b9a\u7684\u521d\u59cb\u503c\u5f00\u59cb\uff0c\u968f\u7740\u6ee4\u6ce2\u9762\u79ef\u589e\u52a0\u800c\u589e\u5927\uff0c300/30%\uff0c500/60%\uff0c700/90%\uff0c1200/95%\u3002","title":"Idea"},{"location":"cv/papers/dynamic-slam/crowd-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/dynamic-slam/crowd-slam/#drawbacks","text":"\u7531\u4e8e\u4eba\u7269\u7684\u59ff\u52bf\u548c\u76f8\u673a\u7684\u63a5\u8fd1\uff0c\u4eba\u7269\u5360\u636e\u56fe\u50cf\u5927\u90e8\u5206\u533a\u57df\uff0c\u5bfc\u81f4\u7279\u5f81\u8017\u5c3d \u4e0d\u8fc7\u6ee4\u9664\u4eba\u4e4b\u5916\u7684\u52a8\u6001\u7269\u4f53","title":"Drawbacks"},{"location":"cv/papers/dynamic-slam/detect-slam/","text":"Detect-SLAM \u00b6 \u7ea6 1402 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a Detect-SLAM: Making Object Detection and SLAM Mutually Beneficial code\uff1a Detect-SLAM Introduction \u00b6 \u5c06\u89c6\u89c9 SLAM \u4e0e\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc DNN \u7684\u76ee\u6807\u68c0\u6d4b\u7ed3\u5408\u3002 \u5229\u7528\u8bed\u4e49\u4fe1\u606f\u6d88\u9664 SLAM Pipeline \u4e2d\u79fb\u52a8\u5bf9\u8c61\u7684\u8d1f\u9762\u5f71\u54cd\u3002 \u9488\u5bf9\u8bed\u4e49\u4fe1\u606f\u7684\u65f6\u5ef6\u4e3b\u8981\u7531\u901a\u4fe1\u548c\u68c0\u6d4b\u5f15\u8d77\u7684\u95ee\u9898\uff0c\u63d0\u51fa\u4e86\u4e00\u79cd\u5b9e\u65f6\u4f20\u64ad\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\u7684\u65b9\u6cd5\u3002 \u7b2c\u4e00\u4e2a\u5c06 SLAM \u548c\u57fa\u4e8e DNN \u7684\u68c0\u6d4b\u5668\u7ed3\u5408\u8d77\u6765\u7684\u5de5\u4f5c\uff0c\u89e3\u51b3\uff1a \u63d0\u9ad8 SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u9c81\u68d2\u6027 \u6784\u5efa\u8bed\u4e49\u5730\u56fe \u63d0\u9ad8\u76ee\u6807\u68c0\u6d4b\u6027\u80fd Related Work \u00b6 SLAM Paschalis \u7b49\u4eba\u4e13\u6ce8\u4e8e 3D \u70b9\u4e91\uff0cSun \u7b49\u4eba\u5728 2D Patch \u4e0a\u3002\u5b83\u4eec\u90fd\u5305\u62ec\u5206\u5272\u548c\u989d\u5916\u83b7\u53d6\u79fb\u52a8\u5bf9\u8c61\u7684\u63a9\u7801\u3002 Detect SLAM \u7701\u7565\u4e86\u8fd9\u4e9b\u64cd\u4f5c\u5e76\u901a\u8fc7\u66f4\u65b0\u7279\u5f81\u7684\u79fb\u52a8\u6982\u7387\u6765\u8fc7\u6ee4\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\u7684\u7279\u5f81\uff0c\u662f\u57fa\u4e8e\u7279\u5f81\u7ea7\u8868\u793a\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u52a0\u9c81\u68d2\u548c\u9ad8\u6548\u7684\u3002 DNN Based Object Detection Faster R-CNN\u3001YOLOv2\u3001SSD Detect-SLAM \u4e2d\u90e8\u7f72 SSD \u4f5c\u4e3a\u68c0\u6d4b\u5668\u6a21\u5757 \u4e3a\u4e86\u514b\u670d SLAM \u548c\u68c0\u6d4b\u5668\u4e4b\u95f4\u7684\u5ef6\u8fdf\uff0c\u907f\u514d\u9010\u5e27\u68c0\u6d4b\uff0c\u5e76\u8003\u8651\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027 Combining SLAM and Object Detection Pillai \u8bbe\u8ba1\u4e86\u4e00\u4e2a\u652f\u6301 SLAM \u7684\u7269\u4f53\u8bc6\u522b\u7cfb\u7edf McCormac \u5c06 SLAM \u548c CNN \u7ed3\u5408\u8d77\u6765\uff0c\u9ad8\u6548\u751f\u6210\u8bed\u4e49 3D \u5730\u56fe Bowman \u5c06\u79bb\u6563\u8bc6\u522b\u548c\u6570\u636e\u5173\u8054\u95ee\u9898\u4e0e\u8fde\u7eed SLAM \u4f18\u5316\u6574\u5408\u5230\u4e00\u4e2a\u4f18\u5316\u95ee\u9898\uff0c\u5f97\u5230\u66f4\u7cbe\u786e\u7684\u8f68\u8ff9 Duncan \u521b\u5efa\u4e00\u79cd\u57fa\u4e8e\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee SLAM \u7cfb\u7edf\u4e2d\u5c3a\u5ea6\u6a21\u7cca\u548c\u6f02\u79fb\u95ee\u9898 Sucar \u5c06\u57fa\u4e8e\u5361\u5c14\u66fc\u6ee4\u6ce2\u7684\u5355\u76ee SLAM \u4e0e\u68c0\u6d4b\u5668\u63d0\u4f9b\u7684\u8bed\u4e49\u4fe1\u606f\u76f8\u7ed3\u5408\uff0c\u4ee5\u8d1d\u53f6\u65af\u65b9\u6848\u4f30\u8ba1 3D \u6a21\u578b\u7684\u5168\u5c40\u89c4\u6a21 Detect-SLAM \u00b6 Detect-SLAM \u4ee5 ORB-SLAM2 \u4e3a\u57fa\uff0c\u4e0e\u4e4b\u76f8\u6bd4\uff0c\u5305\u62ec\u4e09\u4e2a\u65b0\u6d41\u7a0b\uff1a \u52a8\u6001\u7269\u4f53\u53bb\u9664\uff0c\u8fc7\u6ee4\u6389\u4e0e\u52a8\u6001\u7269\u4f53\u76f8\u5173\u7684\u7279\u5f81\uff1b \u5bf9\u8c61\u5efa\u56fe\uff0c\u91cd\u5efa\u5728\u5173\u952e\u5e27\u4e2d\u88ab\u68c0\u6d4b\u5230\u7684\u9759\u6001\u7269\u4f53\uff0c\u7531\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u7a20\u5bc6\u70b9\u4e91\u7ec4\u6210\uff1b SLAM \u589e\u5f3a\u68c0\u6d4b\u5668\uff0c\u5229\u7528\u5bf9\u8c61\u5730\u56fe\u4f5c\u4e3a\u5148\u9a8c\u77e5\u8bc6\u6765\u63d0\u9ad8\u5728\u5177\u6709\u6311\u6218\u6027\u7684\u73af\u5883\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\uff1b Moving Objects Removal \u00b6 \u9488\u5bf9\u9010\u5e27\u4f7f\u7528 SSD \u76ee\u6807\u68c0\u6d4b\u6574\u4e2a\u7cfb\u7edf\u7684\u901f\u5ea6\u4e5f\u53ea\u6709 3FPS\uff0c\u8fd9\u4e00\u90e8\u5206\u63d0\u51fa\u4e24\u4e2a\u7b56\u7565\u89e3\u51b3\uff1a \u4ec5\u5728\u5173\u952e\u5e27\u4e2d\u505a\u76ee\u6807\u68c0\u6d4b\uff0c\u7136\u540e\u66f4\u65b0\u5c40\u90e8\u5730\u56fe\u4e2d\u70b9\u7684\u79fb\u52a8\u6982\u7387\u4ee5\u52a0\u901f\u7ebf\u7a0b\uff1b \u5728\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\u524d\uff0c\u901a\u8fc7\u7279\u5f81\u5339\u914d\u548c\u5339\u914d\u70b9\u6269\u5c55\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\uff0c\u6709\u6548\u5730\u53bb\u9664\u52a8\u6001\u7269\u4f53\u4e0a\u63d0\u53d6\u7684\u7279\u5f81\uff1b \u628a\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u7279\u5f81\u70b9\u7684\u6982\u7387\u79f0\u4e3a\u8fd0\u52a8\u6982\u7387\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6211\u4eec\u6839\u636e\u79fb\u52a8\u6982\u7387\u5c06\u8fd9\u4e9b\u5173\u952e\u70b9\u533a\u5206\u4e3a\u56db\u79cd\u72b6\u6001\u3002\u5728\u5339\u914d\u70b9\u6269\u5c55\u4e2d\u4f7f\u7528\u4e24\u4e2a\u9ad8\u7f6e\u4fe1\u5ea6\u70b9\u5c06\u79fb\u52a8\u6982\u7387\u4f20\u64ad\u5230\u76f8\u90bb\u7684\u4e0d\u5339\u914d\u70b9\u3002\u5728\u6bcf\u4e2a\u70b9\u901a\u8fc7\u4f20\u64ad\u83b7\u5f97\u79fb\u52a8\u6982\u7387\u540e\uff0c\u6211\u4eec\u79fb\u9664\u6240\u6709\u52a8\u6001\u70b9\uff0c\u5e76\u4f7f\u7528RANSAC\u8fc7\u6ee4\u5176\u4ed6\u5f02\u5e38\u503c\u4ee5\u8fdb\u884c\u59ff\u6001\u4f30\u8ba1\u3002 Updating Moving Probability \u8003\u8651\u5230\u68c0\u6d4b\u7684\u5ef6\u8fdf\u548c\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027\uff0c\u53ea\u9009\u62e9\u5173\u952e\u5e27\u7684\u5f69\u8272\u56fe\u50cf\uff0c\u901a\u8fc7 DNN \u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\u548c\u524d\u5411\u4f20\u64ad\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u9010\u5e27\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\u3002\u4e00\u65e6\u83b7\u5f97\u68c0\u6d4b\u7ed3\u679c\uff0c\u6211\u4eec\u5c06\u5173\u952e\u5e27\u63d2\u5165\u672c\u5730\u5730\u56fe\u5e76\u66f4\u65b0\u672c\u5730\u5730\u56fe\u4e2d\u7684\u79fb\u52a8\u6982\u7387\u3002\u66f4\u65b0\u5728\u5173\u952e\u5e27\u4e2d\u627e\u5230\u5339\u914d\u5173\u952e\u70b9\u7684 3D \u70b9\u7684\u6982\u7387\uff1a \\[ P_t(X^i)=(1-\\alpha)P_{t-1}(X^i)+\\alpha S_t(X^i) \\quad \\quad \u672c\u6587\u4e2d\u9009\u62e9 \\quad \\alpha = 0.3 \\] Moving Probability Propagation \u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\uff0c\u901a\u8fc7\u4e24\u4e2a\u64cd\u4f5c\u9010\u5e27\u4f30\u8ba1\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\uff1a \u7279\u5f81\u5339\u914d \u5339\u914d\u70b9\u6269\u5c55\uff08\u79fb\u52a8\u6982\u7387\u4f20\u64ad\uff09 Mapping Objects \u00b6 Predicting Region ID \u9884\u6d4b\u56fe\u50cf\u7a7a\u95f4\u4e2d\u6bcf\u4e2a\u68c0\u6d4b\u5230\u7684\u533a\u57df\u7684\u5bf9\u8c61 ID\u3002\u533a\u57df ID \u9884\u6d4b\u7684\u76ee\u7684\u662f\u5728\u5bf9\u8c61\u56fe\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u5bf9\u8c61 ID\uff0c\u6216\u8005\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u68c0\u6d4b\u5230\u5219\u751f\u6210\u4e00\u4e2a\u65b0\u7684 ID\u3002 \u5bf9\u8c61 ID \u9884\u6d4b\u57fa\u4e8e\u51e0\u4f55\u5047\u8bbe\uff0c\u5373\u5982\u679c\u4e24\u4e2a\u533a\u57df\u5c5e\u4e8e\u540c\u4e00\u5bf9\u8c61\uff0c\u5219\u6295\u5f71\u548c\u68c0\u6d4b\u533a\u57df\u5e94\u8be5\u91cd\u53e0\u3002\uff08\u7528 IOU \u5904\u7406\uff09 Cutting Background \u5c3d\u7ba1\u68c0\u6d4b\u5668\u63d0\u4f9b\u4e86\u56fe\u50cf\u4e2d\u5bf9\u8c61\u7684\u8fb9\u754c\u6846\uff0c\u4f46\u5b83\u662f\u4e00\u4e2a\u77e9\u5f62\u6846\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e9b\u610f\u60f3\u4e0d\u5230\u7684\u80cc\u666f\uff0c\u7528\u4e8e\u6784\u5efa\u5e72\u51c0\u7684\u5bf9\u8c61\u56fe\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u4f7f\u7528 Grab - Cut \u7b97\u6cd5\u5206\u5272\u80cc\u666f\uff0c\u5c06\u91cd\u53e0\u533a\u57df\u4e2d\u5148\u524d\u91cd\u5efa\u5bf9\u8c61\u6295\u5f71\u7684\u70b9\u4f5c\u4e3a\u524d\u666f\u79cd\u5b50\uff0c\u5c06\u8fb9\u754c\u6846\u5916\u7684\u70b9\u4f5c\u4e3a\u80cc\u666f\u3002\u7136\u540e\u6211\u4eec\u4ece\u8fb9\u754c\u6846\u4e2d\u5f97\u5230\u4e00\u4e2a\u76ee\u6807\u5bf9\u8c61\u7684\u6bb5\u63a9\u7801\uff0c\u7ecf\u8fc7\u4e09\u6b21\u8fed\u4ee3\u3002 Reconstruction \u5229\u7528\u5bf9\u8c61\u63a9\u7801\uff0c\u521b\u5efa\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u5bf9\u8c61\u70b9\u4e91\uff0c\u5e76\u8fc7\u6ee4 3D \u7a7a\u95f4\u4e2d\u7684\u566a\u58f0\u70b9\u3002\u6700\u540e\uff0c\u5c06\u7269\u4f53\u70b9\u4e91\u8f6c\u6362\u4e3a\u5e26\u6709\u76f8\u673a\u4f4d\u59ff\u7684\u4e16\u754c\u5750\u6807\uff0c\u5e76\u5c06\u5b83\u4eec\u63d2\u5165\u5230\u7269\u4f53\u5730\u56fe\u4e2d\u3002 SLAM-enhanced Detector \u00b6 Region Proposal \u6bcf\u4e2a\u76ee\u6807\u533a\u57df\u662f\u901a\u8fc7 3D \u76ee\u6807\u56fe\u6295\u5f71\u5230 2D \u5e73\u9762\u63d0\u51fa\u7684\uff0c\u8ddf\u8e2a\u4f30\u8ba1\u5f53\u524d\u76f8\u673a\u4f4d\u59ff\u3002\u5bf9\u5177\u6709\u76f8\u540c\u5bf9\u8c61 ID \u7684\u50cf\u7d20\u8fdb\u884c\u805a\u7c7b\u6765\u63d0\u51fa\u53ef\u80fd\u5305\u542b\u5bf9\u8c61\u7684\u5019\u9009\u533a\u57df\u3002 Region Filter \u6709\u4e0d\u5728\u9884\u671f\u7684\u533a\u57df\u88ab\u63d0\u51fa\uff0c\u56e0\u6b64\u9700\u8981\u5254\u9664\u533a\u57df\u5927\u5c0f 20x20 px \u7684\u5c0f\u5019\u9009\u6846\u3002 Hard Example Mining \u5bf9\u539f\u59cbSSD\u7f51\u7edc\u8fdb\u884c\u5fae\u8c03\uff0c\u4ee5\u63d0\u9ad8\u7c7b\u4f3c\u573a\u666f\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\u3002 Experiment \u00b6 \u7565","title":"Detect-SLAM"},{"location":"cv/papers/dynamic-slam/detect-slam/#detect-slam","text":"\u7ea6 1402 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a Detect-SLAM: Making Object Detection and SLAM Mutually Beneficial code\uff1a Detect-SLAM","title":"Detect-SLAM"},{"location":"cv/papers/dynamic-slam/detect-slam/#introduction","text":"\u5c06\u89c6\u89c9 SLAM \u4e0e\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc DNN \u7684\u76ee\u6807\u68c0\u6d4b\u7ed3\u5408\u3002 \u5229\u7528\u8bed\u4e49\u4fe1\u606f\u6d88\u9664 SLAM Pipeline \u4e2d\u79fb\u52a8\u5bf9\u8c61\u7684\u8d1f\u9762\u5f71\u54cd\u3002 \u9488\u5bf9\u8bed\u4e49\u4fe1\u606f\u7684\u65f6\u5ef6\u4e3b\u8981\u7531\u901a\u4fe1\u548c\u68c0\u6d4b\u5f15\u8d77\u7684\u95ee\u9898\uff0c\u63d0\u51fa\u4e86\u4e00\u79cd\u5b9e\u65f6\u4f20\u64ad\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\u7684\u65b9\u6cd5\u3002 \u7b2c\u4e00\u4e2a\u5c06 SLAM \u548c\u57fa\u4e8e DNN \u7684\u68c0\u6d4b\u5668\u7ed3\u5408\u8d77\u6765\u7684\u5de5\u4f5c\uff0c\u89e3\u51b3\uff1a \u63d0\u9ad8 SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u9c81\u68d2\u6027 \u6784\u5efa\u8bed\u4e49\u5730\u56fe \u63d0\u9ad8\u76ee\u6807\u68c0\u6d4b\u6027\u80fd","title":"Introduction"},{"location":"cv/papers/dynamic-slam/detect-slam/#related-work","text":"SLAM Paschalis \u7b49\u4eba\u4e13\u6ce8\u4e8e 3D \u70b9\u4e91\uff0cSun \u7b49\u4eba\u5728 2D Patch \u4e0a\u3002\u5b83\u4eec\u90fd\u5305\u62ec\u5206\u5272\u548c\u989d\u5916\u83b7\u53d6\u79fb\u52a8\u5bf9\u8c61\u7684\u63a9\u7801\u3002 Detect SLAM \u7701\u7565\u4e86\u8fd9\u4e9b\u64cd\u4f5c\u5e76\u901a\u8fc7\u66f4\u65b0\u7279\u5f81\u7684\u79fb\u52a8\u6982\u7387\u6765\u8fc7\u6ee4\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\u7684\u7279\u5f81\uff0c\u662f\u57fa\u4e8e\u7279\u5f81\u7ea7\u8868\u793a\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u52a0\u9c81\u68d2\u548c\u9ad8\u6548\u7684\u3002 DNN Based Object Detection Faster R-CNN\u3001YOLOv2\u3001SSD Detect-SLAM \u4e2d\u90e8\u7f72 SSD \u4f5c\u4e3a\u68c0\u6d4b\u5668\u6a21\u5757 \u4e3a\u4e86\u514b\u670d SLAM \u548c\u68c0\u6d4b\u5668\u4e4b\u95f4\u7684\u5ef6\u8fdf\uff0c\u907f\u514d\u9010\u5e27\u68c0\u6d4b\uff0c\u5e76\u8003\u8651\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027 Combining SLAM and Object Detection Pillai \u8bbe\u8ba1\u4e86\u4e00\u4e2a\u652f\u6301 SLAM \u7684\u7269\u4f53\u8bc6\u522b\u7cfb\u7edf McCormac \u5c06 SLAM \u548c CNN \u7ed3\u5408\u8d77\u6765\uff0c\u9ad8\u6548\u751f\u6210\u8bed\u4e49 3D \u5730\u56fe Bowman \u5c06\u79bb\u6563\u8bc6\u522b\u548c\u6570\u636e\u5173\u8054\u95ee\u9898\u4e0e\u8fde\u7eed SLAM \u4f18\u5316\u6574\u5408\u5230\u4e00\u4e2a\u4f18\u5316\u95ee\u9898\uff0c\u5f97\u5230\u66f4\u7cbe\u786e\u7684\u8f68\u8ff9 Duncan \u521b\u5efa\u4e00\u79cd\u57fa\u4e8e\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee SLAM \u7cfb\u7edf\u4e2d\u5c3a\u5ea6\u6a21\u7cca\u548c\u6f02\u79fb\u95ee\u9898 Sucar \u5c06\u57fa\u4e8e\u5361\u5c14\u66fc\u6ee4\u6ce2\u7684\u5355\u76ee SLAM \u4e0e\u68c0\u6d4b\u5668\u63d0\u4f9b\u7684\u8bed\u4e49\u4fe1\u606f\u76f8\u7ed3\u5408\uff0c\u4ee5\u8d1d\u53f6\u65af\u65b9\u6848\u4f30\u8ba1 3D \u6a21\u578b\u7684\u5168\u5c40\u89c4\u6a21","title":"Related Work"},{"location":"cv/papers/dynamic-slam/detect-slam/#detect-slam_1","text":"Detect-SLAM \u4ee5 ORB-SLAM2 \u4e3a\u57fa\uff0c\u4e0e\u4e4b\u76f8\u6bd4\uff0c\u5305\u62ec\u4e09\u4e2a\u65b0\u6d41\u7a0b\uff1a \u52a8\u6001\u7269\u4f53\u53bb\u9664\uff0c\u8fc7\u6ee4\u6389\u4e0e\u52a8\u6001\u7269\u4f53\u76f8\u5173\u7684\u7279\u5f81\uff1b \u5bf9\u8c61\u5efa\u56fe\uff0c\u91cd\u5efa\u5728\u5173\u952e\u5e27\u4e2d\u88ab\u68c0\u6d4b\u5230\u7684\u9759\u6001\u7269\u4f53\uff0c\u7531\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u7a20\u5bc6\u70b9\u4e91\u7ec4\u6210\uff1b SLAM \u589e\u5f3a\u68c0\u6d4b\u5668\uff0c\u5229\u7528\u5bf9\u8c61\u5730\u56fe\u4f5c\u4e3a\u5148\u9a8c\u77e5\u8bc6\u6765\u63d0\u9ad8\u5728\u5177\u6709\u6311\u6218\u6027\u7684\u73af\u5883\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\uff1b","title":"Detect-SLAM"},{"location":"cv/papers/dynamic-slam/detect-slam/#moving-objects-removal","text":"\u9488\u5bf9\u9010\u5e27\u4f7f\u7528 SSD \u76ee\u6807\u68c0\u6d4b\u6574\u4e2a\u7cfb\u7edf\u7684\u901f\u5ea6\u4e5f\u53ea\u6709 3FPS\uff0c\u8fd9\u4e00\u90e8\u5206\u63d0\u51fa\u4e24\u4e2a\u7b56\u7565\u89e3\u51b3\uff1a \u4ec5\u5728\u5173\u952e\u5e27\u4e2d\u505a\u76ee\u6807\u68c0\u6d4b\uff0c\u7136\u540e\u66f4\u65b0\u5c40\u90e8\u5730\u56fe\u4e2d\u70b9\u7684\u79fb\u52a8\u6982\u7387\u4ee5\u52a0\u901f\u7ebf\u7a0b\uff1b \u5728\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\u524d\uff0c\u901a\u8fc7\u7279\u5f81\u5339\u914d\u548c\u5339\u914d\u70b9\u6269\u5c55\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\uff0c\u6709\u6548\u5730\u53bb\u9664\u52a8\u6001\u7269\u4f53\u4e0a\u63d0\u53d6\u7684\u7279\u5f81\uff1b \u628a\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u7279\u5f81\u70b9\u7684\u6982\u7387\u79f0\u4e3a\u8fd0\u52a8\u6982\u7387\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6211\u4eec\u6839\u636e\u79fb\u52a8\u6982\u7387\u5c06\u8fd9\u4e9b\u5173\u952e\u70b9\u533a\u5206\u4e3a\u56db\u79cd\u72b6\u6001\u3002\u5728\u5339\u914d\u70b9\u6269\u5c55\u4e2d\u4f7f\u7528\u4e24\u4e2a\u9ad8\u7f6e\u4fe1\u5ea6\u70b9\u5c06\u79fb\u52a8\u6982\u7387\u4f20\u64ad\u5230\u76f8\u90bb\u7684\u4e0d\u5339\u914d\u70b9\u3002\u5728\u6bcf\u4e2a\u70b9\u901a\u8fc7\u4f20\u64ad\u83b7\u5f97\u79fb\u52a8\u6982\u7387\u540e\uff0c\u6211\u4eec\u79fb\u9664\u6240\u6709\u52a8\u6001\u70b9\uff0c\u5e76\u4f7f\u7528RANSAC\u8fc7\u6ee4\u5176\u4ed6\u5f02\u5e38\u503c\u4ee5\u8fdb\u884c\u59ff\u6001\u4f30\u8ba1\u3002 Updating Moving Probability \u8003\u8651\u5230\u68c0\u6d4b\u7684\u5ef6\u8fdf\u548c\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027\uff0c\u53ea\u9009\u62e9\u5173\u952e\u5e27\u7684\u5f69\u8272\u56fe\u50cf\uff0c\u901a\u8fc7 DNN \u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\u548c\u524d\u5411\u4f20\u64ad\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u9010\u5e27\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\u3002\u4e00\u65e6\u83b7\u5f97\u68c0\u6d4b\u7ed3\u679c\uff0c\u6211\u4eec\u5c06\u5173\u952e\u5e27\u63d2\u5165\u672c\u5730\u5730\u56fe\u5e76\u66f4\u65b0\u672c\u5730\u5730\u56fe\u4e2d\u7684\u79fb\u52a8\u6982\u7387\u3002\u66f4\u65b0\u5728\u5173\u952e\u5e27\u4e2d\u627e\u5230\u5339\u914d\u5173\u952e\u70b9\u7684 3D \u70b9\u7684\u6982\u7387\uff1a \\[ P_t(X^i)=(1-\\alpha)P_{t-1}(X^i)+\\alpha S_t(X^i) \\quad \\quad \u672c\u6587\u4e2d\u9009\u62e9 \\quad \\alpha = 0.3 \\] Moving Probability Propagation \u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\uff0c\u901a\u8fc7\u4e24\u4e2a\u64cd\u4f5c\u9010\u5e27\u4f30\u8ba1\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\uff1a \u7279\u5f81\u5339\u914d \u5339\u914d\u70b9\u6269\u5c55\uff08\u79fb\u52a8\u6982\u7387\u4f20\u64ad\uff09","title":"Moving Objects Removal"},{"location":"cv/papers/dynamic-slam/detect-slam/#mapping-objects","text":"Predicting Region ID \u9884\u6d4b\u56fe\u50cf\u7a7a\u95f4\u4e2d\u6bcf\u4e2a\u68c0\u6d4b\u5230\u7684\u533a\u57df\u7684\u5bf9\u8c61 ID\u3002\u533a\u57df ID \u9884\u6d4b\u7684\u76ee\u7684\u662f\u5728\u5bf9\u8c61\u56fe\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u5bf9\u8c61 ID\uff0c\u6216\u8005\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u68c0\u6d4b\u5230\u5219\u751f\u6210\u4e00\u4e2a\u65b0\u7684 ID\u3002 \u5bf9\u8c61 ID \u9884\u6d4b\u57fa\u4e8e\u51e0\u4f55\u5047\u8bbe\uff0c\u5373\u5982\u679c\u4e24\u4e2a\u533a\u57df\u5c5e\u4e8e\u540c\u4e00\u5bf9\u8c61\uff0c\u5219\u6295\u5f71\u548c\u68c0\u6d4b\u533a\u57df\u5e94\u8be5\u91cd\u53e0\u3002\uff08\u7528 IOU \u5904\u7406\uff09 Cutting Background \u5c3d\u7ba1\u68c0\u6d4b\u5668\u63d0\u4f9b\u4e86\u56fe\u50cf\u4e2d\u5bf9\u8c61\u7684\u8fb9\u754c\u6846\uff0c\u4f46\u5b83\u662f\u4e00\u4e2a\u77e9\u5f62\u6846\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e9b\u610f\u60f3\u4e0d\u5230\u7684\u80cc\u666f\uff0c\u7528\u4e8e\u6784\u5efa\u5e72\u51c0\u7684\u5bf9\u8c61\u56fe\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u4f7f\u7528 Grab - Cut \u7b97\u6cd5\u5206\u5272\u80cc\u666f\uff0c\u5c06\u91cd\u53e0\u533a\u57df\u4e2d\u5148\u524d\u91cd\u5efa\u5bf9\u8c61\u6295\u5f71\u7684\u70b9\u4f5c\u4e3a\u524d\u666f\u79cd\u5b50\uff0c\u5c06\u8fb9\u754c\u6846\u5916\u7684\u70b9\u4f5c\u4e3a\u80cc\u666f\u3002\u7136\u540e\u6211\u4eec\u4ece\u8fb9\u754c\u6846\u4e2d\u5f97\u5230\u4e00\u4e2a\u76ee\u6807\u5bf9\u8c61\u7684\u6bb5\u63a9\u7801\uff0c\u7ecf\u8fc7\u4e09\u6b21\u8fed\u4ee3\u3002 Reconstruction \u5229\u7528\u5bf9\u8c61\u63a9\u7801\uff0c\u521b\u5efa\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u5bf9\u8c61\u70b9\u4e91\uff0c\u5e76\u8fc7\u6ee4 3D \u7a7a\u95f4\u4e2d\u7684\u566a\u58f0\u70b9\u3002\u6700\u540e\uff0c\u5c06\u7269\u4f53\u70b9\u4e91\u8f6c\u6362\u4e3a\u5e26\u6709\u76f8\u673a\u4f4d\u59ff\u7684\u4e16\u754c\u5750\u6807\uff0c\u5e76\u5c06\u5b83\u4eec\u63d2\u5165\u5230\u7269\u4f53\u5730\u56fe\u4e2d\u3002","title":"Mapping Objects"},{"location":"cv/papers/dynamic-slam/detect-slam/#slam-enhanced-detector","text":"Region Proposal \u6bcf\u4e2a\u76ee\u6807\u533a\u57df\u662f\u901a\u8fc7 3D \u76ee\u6807\u56fe\u6295\u5f71\u5230 2D \u5e73\u9762\u63d0\u51fa\u7684\uff0c\u8ddf\u8e2a\u4f30\u8ba1\u5f53\u524d\u76f8\u673a\u4f4d\u59ff\u3002\u5bf9\u5177\u6709\u76f8\u540c\u5bf9\u8c61 ID \u7684\u50cf\u7d20\u8fdb\u884c\u805a\u7c7b\u6765\u63d0\u51fa\u53ef\u80fd\u5305\u542b\u5bf9\u8c61\u7684\u5019\u9009\u533a\u57df\u3002 Region Filter \u6709\u4e0d\u5728\u9884\u671f\u7684\u533a\u57df\u88ab\u63d0\u51fa\uff0c\u56e0\u6b64\u9700\u8981\u5254\u9664\u533a\u57df\u5927\u5c0f 20x20 px \u7684\u5c0f\u5019\u9009\u6846\u3002 Hard Example Mining \u5bf9\u539f\u59cbSSD\u7f51\u7edc\u8fdb\u884c\u5fae\u8c03\uff0c\u4ee5\u63d0\u9ad8\u7c7b\u4f3c\u573a\u666f\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\u3002","title":"SLAM-enhanced Detector"},{"location":"cv/papers/dynamic-slam/detect-slam/#experiment","text":"\u7565","title":"Experiment"},{"location":"cv/papers/dynamic-slam/ds-slam/","text":"DS-SLAM \u00b6 \u7ea6 2274 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract paper\uff1a DS-SLAM: A Semantic Visual SLAM towards Dynamic Environments code\uff1a DS-SLAM Introduction \u00b6 \u4f7f\u7528\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u548c\u5149\u6d41\u76f8\u7ed3\u5408\u7684\u65b9\u6cd5\u51cf\u5c11\u89c6\u89c9 SLAM \u4e2d\u52a8\u6001\u7269\u4f53\u9020\u6210\u7684\u5f71\u54cd\u3002 \u57fa\u4e8eORB-SLAM2\u63d0\u51fa\u4e86\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b8c\u6574\u8bed\u4e49SLAM\u7cfb\u7edf\uff08DS-SLAM\uff09\uff0c\u53ef\u4ee5\u51cf\u5c11\u52a8\u6001\u5bf9\u8c61\u5bf9\u59ff\u6001\u4f30\u8ba1\u7684\u5f71\u54cd\u3002 \u8be5\u7cfb\u7edf\u7684\u6709\u6548\u6027\u5728 TUM RGB-D \u6570\u636e\u96c6 \u4e0a\u8fdb\u884c\u8bc4\u4f30\u3002 \u7ed3\u679c\u8868\u660e\uff0cDS-SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\u65b9\u9762\u660e\u663e\u4f18\u4e8e ORB-SLAM2\u3002 \u8be5\u7cfb\u7edf\u8fd8\u4e0e\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u96c6\u6210\uff0c\u5e76\u901a\u8fc7\u5728\u771f\u5b9e\u73af\u5883\u4e2d\u5bf9\u673a\u5668\u4eba\u8fdb\u884c DS-SLAM \u6d4b\u8bd5\u6765\u9a8c\u8bc1\u5176\u6027\u80fd\u3002 2.\u5c06\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u5355\u72ec\u7684\u653e\u5728\u4e00\u4e2a\u7ebf\u7a0b\u5f53\u4e2d\uff0c\u5c06\u8bed\u4e49\u5206\u5272\u548c\u8fd0\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7684\u65b9\u6cd5\uff08\u5149\u6d41\u6cd5\uff08\u901a\u8fc7\u8ba1\u7b97\u5149\u6d41\u7684\u4e0d\u4e00\u81f4\u6027\u6765\u533a\u5206\u9759\u6001\u80cc\u666f\u548c\u8fd0\u52a8\u76ee\u6807\uff09\uff09\u76f8\u7ed3\u5408\uff0c\u8fc7\u6ee4\u6389\u573a\u666f\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u3002\u4ece\u800c\u63d0\u9ad8\u4e86\u5b9a\u4f4d\u6a21\u5757\u548c\u5efa\u56fe\u6a21\u5757\u5728\u52a8\u6001\u573a\u666f\u4e0b\u7684\u9c81\u68d2\u6027\u548c\u51c6\u786e\u6027\u3002 DS-SLAM \u521b\u5efa\u4e00\u4e2a\u5355\u72ec\u7684\u7ebf\u7a0b\u6765\u6784\u5efa\u4e00\u4e2a\u5bc6\u96c6\u7684\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe \u3002\u5bc6\u96c6\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe\u91c7\u7528 log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09 \u65b9\u6cd5\u8fc7\u6ee4\u6389\u4e0d\u7a33\u5b9a\u7684\u4f53\u7d20\u5e76\u66f4\u65b0\u8fd9\u4e9b\u4f53\u7d20\u7684\u8bed\u4e49\u3002 RELATED WORK \u00b6 \u5728\u4ee5\u524d\u7684\u5de5\u4f5c\u4e2d\uff0c\u8bed\u4e49\u56fe\u901a\u5e38\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u51e0\u4f55\u90e8\u5206\u548c\u8bed\u4e49\u90e8\u5206\u3002\u8bed\u4e49\u65b9\u6cd5\u9884\u5148\u8bad\u7ec3\u4e86\u5bf9\u8c61\u8bc6\u522b\u5b50\u7cfb\u7edf\uff0c\u5e76\u5c06\u8bed\u4e49\u4fe1\u606f\u9644\u52a0\u5230\u8bc6\u522b\u7684\u5bf9\u8c61\u6a21\u578b\u4e0a\u3002\u4ed6\u4eec\u7684\u5de5\u4f5c\u4ec5\u96c6\u4e2d\u5728\u8bed\u4e49\u6620\u5c04\u548c\u5bf9\u8c61\u8bc6\u522b\u4e0a\uff0c\u800c\u8bed\u4e49\u4fe1\u606f\u5728\u5176\u4ed6\u90e8\u5206\u7684\u4fe1\u606f\u5374\u6ca1\u6709\u5f88\u597d\u5730\u4f7f\u7528\u3002\u8fd1\u671f\u5de5\u4f5c\u5229\u7528\u573a\u666f\u4e2d\u7684\u51e0\u4f55\u5c5e\u6027\u548c\u8bed\u4e49\u5c5e\u6027\u5171\u540c\u4f30\u8ba1\u76f8\u673a\u7684\u59ff\u52bf\uff0c\u70b9\u548c\u5bf9\u8c61\uff0c\u4ece\u800c\u663e\u8457\u63d0\u9ad8\u4e86\u5bf9\u8c61\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u8bed\u4e49\u4fe1\u606f\u4e0d\u4ec5\u7528\u4e8e\u751f\u6210\u57fa\u4e8e\u516b\u53c9\u6811\u7684\u73af\u5883\u8868\u793a\uff0c\u800c\u4e14\u8fd8\u7528\u4e8e\u5728\u52a8\u6001\u73af\u5883\u4e2d\u8ddf\u8e2a\u8fc7\u7a0b\u4e2d\u8fc7\u6ee4\u5f02\u5e38\u503c\u3002 SYSTEM INTRUDUCTION \u00b6 Framework of DS-SLAM \u00b6 Kinect2\u6355\u83b7\u7684\u539f\u59cbRGB\u56fe\u50cf\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u548c\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u4e2d\u540c\u65f6\u8fdb\u884c\u5904\u7406\u3002\u8ddf\u8e2a\u7ebf\u7a0b\u9996\u5148\u63d0\u53d6ORB\u7279\u5f81\u70b9\uff0c\u7136\u540e\u7c97\u7565\u68c0\u67e5\u7279\u5f81\u70b9\u7684\u79fb\u52a8\u4e00\u81f4\u6027\u5e76\u4fdd\u5b58\u6f5c\u5728\u7684\u5f02\u5e38\u503c\u3002\u7136\u540e\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u5177\u6709\u7531\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u9884\u6d4b\u7684\u50cf\u7d20\u7ea7\u8bed\u4e49\u6807\u7b7e\u7684\u56fe\u50cf\u3002\u5206\u5272\u7ed3\u679c\u5230\u8fbe\u540e\uff0c\u5c06\u6839\u636e\u5206\u5272\u7ed3\u679c\u548c\u4e4b\u524d\u68c0\u6d4b\u5230\u7684\u6f5c\u5728\u5f02\u5e38\u503c\uff0c\u4e22\u5f03\u4f4d\u4e8e\u8fd0\u52a8\u7269\u4f53\u4e2d\u7684ORB\u7279\u5f81\u70b9\u5f02\u5e38\u503c\u3002\u7136\u540e\uff0c\u901a\u8fc7\u5339\u914d\u5176\u4f59\u7684\u7a33\u5b9a\u7279\u5f81\u70b9\u6765\u8ba1\u7b97\u53d8\u6362\u77e9\u9635\u3002 Semantic Segmentation \u00b6 DS-SLAM\u91c7\u7528SegNet\u63d0\u4f9b\u57fa\u4e8ecaffe\u7684\u50cf\u7d20\u7ea7\u5b9e\u65f6\u8bed\u4e49\u5206\u5272\u3002\u5728PASCAL VOC\u6570\u636e\u96c6\u4e0a\u8bad\u7ec3\u7684SegNet\u603b\u5171\u53ef\u4ee5\u5206\u527220\u4e2a\u7c7b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4eba\u6700\u6709\u53ef\u80fd\u662f\u52a8\u6001\u5bf9\u8c61\uff0c\u56e0\u6b64\u6211\u4eec\u5047\u8bbe\u4f4d\u4e8e\u4eba\u8eab\u4e0a\u7684\u7279\u5f81\u70b9\u6700\u6709\u53ef\u80fd\u662f\u5f02\u5e38\u503c\u3002 Moving Consistency Check \u00b6 \u7ecf\u8fc7\u8bed\u4e49\u5206\u5272\u7684\u6a21\u5757\u540e\uff0c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u5206\u5272\u7684Mask\u7684\uff0c\u6240\u4ee5\u73b0\u5728\u7684\u4efb\u52a1\u5c31\u662f\u53bb\u786e\u5b9a\uff0c\u67d0\u4e2a\u5173\u952e\u70b9\u662f\u5426\u662f\u79fb\u52a8\u7684\uff0c\u5982\u679c\u6709\u4e00\u5b9a\u6570\u91cf\u7684\u79fb\u52a8\u70b9\u843d\u5728\u4e86\u67d0\u4e00\u4e2a\u5206\u5272\u51fa\u6765\u7684\u7269\u4f53\u8f6e\u5ed3\u5185\u90e8\uff0c\u90a3\u8fd9\u4e2a\u7269\u4f53\u5c31\u88ab\u89c6\u4e3a\u52a8\u6001\uff0c\u4e0a\u9762\u6240\u6709\u7684\u7279\u5f81\u70b9\u90fd\u4f1a\u88ab\u5254\u9664\u3002 \u5224\u65ad\u52a8\u6001\u70b9\u6b65\u9aa4\uff1a \u8ba1\u7b97\u5149\u6d41\u91d1\u5b57\u5854\u5f97\u5230\u5f53\u524d\u5e27\u4e2d\u5df2\u7ecf\u5339\u914d\u7684\u7279\u5f81\u70b9 \u5982\u679c\u5339\u914d\u70b9\u5bf9\u79bb\u56fe\u50cf\u7684\u8fb9\u7f18\u592a\u8fd1\uff0c\u6216\u8005\u5404\u81ea\u4ee5\u4e24\u4e2a\u76f8\u5339\u914d\u7684\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u5176 3x3 \u533a\u57df\u8303\u56f4\u5185\u50cf\u7d20\u503c\u5dee\u5f02\u592a\u5927\uff0c\u8fd9\u4e2a\u5339\u914d\u70b9\u5c31\u4f1a\u88ab\u4e22\u5f03 \u4f7f\u7528 RANSAC \u7684\u65b9\u6cd5\uff08\u4f7f\u7528\u6700\u591a\u5185\u70b9\uff09\u627e\u5230\u57fa\u7840\u77e9\u9635 F \u4f7f\u7528\u57fa\u7840\u77e9\u9635\u8ba1\u7b97\u5f53\u524d\u5e27\u7684\u6781\u7ebf\uff0c\u5df2\u77e5\u4e0a\u4e00\u5e27\u4e2d\u7684\u7279\u5f81\u70b9\u50cf\u7d20\u4f4d\u7f6e\u4e3a \\(p_1=[u_1, v_1, 1]\\) \uff0c\u8fd9\u4e2a\u70b9\u5728\u5f53\u524d\u5e27\u4e2d\u5bf9\u5e94\u7684\u4f4d\u7f6e\u4e3a \\(p_2=[u_2, v_2, 1]\\) \uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u6c42\u51fa\u70b9 \\(p_1\\) \u6295\u5f71\u5230\u5f53\u524d\u5e27\u4e2d\u7684\u6781\u7ebf \\(I_1\\) \\[I_1 = \\begin{pmatrix} X \\\\ Y \\\\ Z \\end{pmatrix} Fp_1 = F \\begin{pmatrix} u_1 \\\\ v_1 \\\\ 1 \\end{pmatrix} \\] \u8ba1\u7b97\u5339\u914d\u7684\u7279\u5f81\u70b9\u5230\u5b83\u5bf9\u5e94\u6781\u7ebf\u7684\u8ddd\u79bb\uff0c\u5982\u679c\u8fd9\u4e2a\u8ddd\u79bb\u8d85\u8fc7\u9608\u503c\u5219\u88ab\u89c6\u4e3a\u79fb\u52a8\u70b9\uff0c\u53cd\u4e4b\u4e3a\u9759\u6001\u70b9\u3002\u8ddd\u79bb\u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ D = \\frac{|P_2^\\top F P_1|}{\\sqrt{\\parallel X \\parallel^2 + \\parallel Y \\parallel^2}} \\] Outlier Rejection \u00b6 \u7531\u4e8e\u4eba\u4f53\u7b49\u8fd0\u52a8\u7269\u4f53\u7684\u67d4\u6027\u53d8\u5f62\u548c\u590d\u6742\u8fd0\u52a8\uff0c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u65b9\u6cd5\u5f88\u96be\u63d0\u53d6\u5b8c\u6574\u52a8\u6001\u533a\u57df\u7684\u8f6e\u5ed3\uff0c\u66f4\u4f55\u51b5\u63d0\u53d6\u6574\u4e2a\u8f6e\u5ed3\u7684\u65f6\u95f4\u5f00\u9500\u975e\u5e38\u5927\u3002\u5728DS-SLAM\u4e2d\uff0c\u7531\u4e8e\u91c7\u7528\u4e86\u8bed\u4e49\u5206\u5272\u7f51\u7edc\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u83b7\u5f97\u7269\u4f53\u7684\u5b8c\u6574\u8f6e\u5ed3\u3002\u6211\u4eec\u7684\u60f3\u6cd5\u662f\u5c06\u8bed\u4e49\u4fe1\u606f\u548c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u7ed3\u5408\u8d77\u6765\uff0c\u5b8c\u6210\u4e24\u7ea7\u8bed\u4e49\u77e5\u8bc6\u5e93\u7684\u5efa\u7acb\uff1a \u5bf9\u8c61\u662f\u5426\u79fb\u52a8\u3002\u5982\u679c\u5728\u5206\u5272\u5bf9\u8c61\u7684\u8f6e\u5ed3\u4e2d\u5b58\u5728\u901a\u8fc7\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u800c\u4ea7\u751f\u7684\u4e00\u5b9a\u6570\u91cf\u7684\u52a8\u6001\u70b9\uff0c\u5219\u786e\u5b9a\u8be5\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\u3002 \u5982\u679c\u786e\u5b9a\u5206\u5272\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\uff0c\u5219\u5220\u9664\u4f4d\u4e8e\u5bf9\u8c61\u8f6e\u5ed3\u4e2d\u7684\u6240\u6709\u7279\u5f81\u70b9\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7cbe\u786e\u5730\u6d88\u9664\u5f02\u5e38\u503c\u3002\u6b64\u5916\uff0c\u9519\u8bef\u5206\u5272\u7684\u5f71\u54cd\u4e5f\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u964d\u4f4e\u3002 \u6b64\u5916\uff0c\u53ef\u4ee5\u5145\u5206\u5229\u7528\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u7684\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u7684\u65f6\u95f4\u3002\u5728\u7b49\u5f85\u671f\u95f4\uff0c\u53ef\u4ee5\u8fdb\u884c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u3002\u5728\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u7ed3\u679c\u90e8\u5206\uff0c\u8868 IV \u7ed9\u51fa\u4e86 DS-SLAM \u4e2d\u7684\u6d88\u8017\u65f6\u95f4\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f7f\u7528\u7684\u65f6\u95f4\u5927\u7ea6\u7b49\u4e8e\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u3002 \u5728\u672c\u6587\u7684\u5176\u4f59\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u5c06\u4eba\u7c7b\u4f5c\u4e3a\u52a8\u6001\u5bf9\u8c61\u7684\u5178\u578b\u4ee3\u8868\u3002\u4ece\u7406\u8bba\u4e0a\u8bb2\uff0cDS-SLAM\u9002\u7528\u4e8e\u4efb\u4f55\u591a\u4e2a\u5df2\u8bc6\u522b\u548c\u5206\u6bb5\u7684\u52a8\u6001\u5bf9\u8c61\u3002 \u8bed\u4e49\u5206\u5272\u7ed3\u679c\u51fa\u6765\u540e\uff0c\u5982\u679c\u6ca1\u6709\u4eba\u88ab\u68c0\u6d4b\u5230\uff0c\u90a3\u4e48\u6240\u6709\u7684ORB\u7279\u5f81\u5c06\u76f4\u63a5\u4e0e\u6700\u540e\u4e00\u5e27\u5339\u914d\u4ee5\u9884\u6d4b\u59ff\u52bf\u3002\u5426\u5219\uff0c\u8bf7\u4f7f\u7528\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u6765\u786e\u5b9a\u4eba\u5458\u662f\u5426\u5728\u79fb\u52a8\u3002\u5982\u679c\u786e\u5b9a\u4eba\u662f\u9759\u6001\u7684\uff0c\u5219\u76f4\u63a5\u9884\u6d4b\u59ff\u52bf\uff0c\u5426\u5219\u5728\u5339\u914d\u4e4b\u524d\u5220\u9664\u6240\u6709\u5c5e\u4e8e\u4eba\u7684\u8f6e\u5ed3\u5185\u7684ORB\u7279\u5f81\u70b9\u3002\u8fd9\u6837\uff0c\u53ef\u4ee5\u663e\u7740\u964d\u4f4e\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002 Dense semantic 3D octo-tree map building \u00b6 \u8bed\u4e49\u516b\u53c9\u6811\u6620\u5c04\u7ebf\u7a0b\u4ece\u8ddf\u8e2a\u7ebf\u7a0b\u83b7\u53d6\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4ece\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u83b7\u53d6\u5206\u5272\u7ed3\u679c\u3002\u5173\u952e\u5e27\u7684\u53d8\u6362\u77e9\u9635\u548c\u6df1\u5ea6\u56fe\u50cf\u7528\u4e8e\u751f\u6210\u5c40\u90e8\u70b9\u4e91\u3002\u7136\u540e\uff0c\u672c\u5730\u70b9\u4e91\u5c06\u88ab\u8f6c\u6362\u5e76\u7ef4\u62a4\u5728\u5168\u5c40\u516b\u70b9\u6811\u5730\u56fe\u4e2d\u3002\u6211\u4eec\u91c7\u7528\u516b\u53c9\u6811\u8868\u793a\uff0c\u662f\u56e0\u4e3a\u5b83\u7075\u6d3b\uff0c\u7d27\u51d1\u4e14\u53ef\u66f4\u65b0\u3002\u516b\u5143\u6811\u5730\u56fe\u88ab\u9ad8\u6548\u5b58\u50a8\uff0c\u5e76\u4e14\u6613\u4e8e\u7528\u4e8e\u5bfc\u822a\u3002 \u8bed\u4e49\u4fe1\u606f\u88ab\u5408\u5e76\u5230\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u3002\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u7684\u6bcf\u4e2a\u4f53\u7d20\u90fd\u4e0e\u7279\u5b9a\u7684\u989c\u8272\u76f8\u5173\u8054\uff0c\u5e76\u4e14\u6bcf\u79cd\u989c\u8272\u90fd\u4ee3\u8868\u4e00\u4e2a\u8bed\u4e49\u6807\u7b7e\u3002\u4f8b\u5982\uff0c\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u6c99\u53d1\uff0c\u800c\u7c89\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u4e00\u4e2a\u4eba\u3002\u5efa\u6a21\u548c\u8bed\u4e49\u878d\u5408\u7684\u6240\u6709\u8fc7\u7a0b\u5747\u4ee5\u6982\u7387\u65b9\u5f0f\u5b8c\u6210\uff0c\u56e0\u6b64\u53ef\u4ee5\u65b9\u4fbf\u5730\u66f4\u65b0\u4f53\u7d20\u7684\u5c5e\u6027\u3002\u8fd9\u6837\uff0c\u5bc6\u96c6\u7684\u8bed\u4e493D\u516b\u53c9\u6811\u5730\u56fe\u53ef\u4ee5\u4e3a\u79fb\u52a8\u673a\u5668\u4eba\u5b8c\u6210\u9ad8\u7ea7\u4efb\u52a1\u63d0\u4f9b\u57fa\u7840\u3002 DS-SLAM \u9762\u5411\u5904\u7406\u52a8\u6001\u73af\u5883\uff0c\u56e0\u6b64\u52a8\u6001\u5bf9\u8c61\u4e0d\u5e94\u8be5\u5b58\u5728\u4e8e\u5730\u56fe\u4e2d\u3002\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6709\u6548\u5730\u8fc7\u6ee4\u6389\u52a8\u6001\u5bf9\u8c61\u3002\u7136\u800c\uff0c\u8bed\u4e49\u5206\u5272\u7684\u51c6\u786e\u6027\u662f\u6709\u9650\u7684\u3002\u5728\u590d\u6742\u60c5\u51b5\u4e0b\uff0c\u4f8b\u5982\u5bf9\u8c61\u76f8\u4e92\u91cd\u53e0\uff0c\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u80fd\u4e0d\u5b8c\u6574\u751a\u81f3\u9519\u8bef\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cDS-SLAM \u4e2d\u4f7f\u7528\u4e86log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09\u6765\u6700\u5c0f\u5316\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002 log-odds score\u7528\u4e8e\u8868\u793a\u5355\u4e2a\u4f53\u7d20\u88ab\u5b9a\u91cf\u5360\u7528\u7684\u53ef\u80fd\u6027\u3002\u4ee4p\u8868\u793a\u4e00\u4e2a\u4f53\u7d20\u88ab\u5360\u7528\u7684\u6982\u7387\uff0cl\u8868\u793a\u8be5\u6982\u7387\u7684log-odds score\u3002 \u53ef\u4ee5\u901a\u8fc7logit\u53d8\u6362\u8ba1\u7b97\uff1a \\[ l = logit(p) = \\log (\\frac{p}{1-p}) \\\\ p = logit^{-1}(l) = \\frac{\\exp(l)}{\\exp(l) + 1} \\\\ L(n | z_{1:t+1}) = L(n | z_{1:t-1}) + L(n | z_t) \\] \u5982\u679c\u4f53\u7d20n\u88ab\u89c2\u5bdf\u5230\u88ab\u5360\u7528\u90a3\u4e48 \\(L=\\tau\\) \uff0c\u5426\u5219\u4e3a0\u3002\u589e\u91cf \\(\\tau\\) \u662f\u4e00\u4e2a\u9884\u5b9a\u4e49\u7684\u503c\u3002\u5f53\u91cd\u590d\u89c2\u5bdf\u5230\u8be5\u4f53\u7d20\u88ab\u5360\u7528\u65f6\uff0c\u8be5\u4f53\u7d20\u7684log-odds score\u4f1a\u589e\u52a0\uff0c\u5426\u5219\u4f1a\u51cf\u5c11\u3002\u4e00\u4e2a\u4f53\u7d20\u7684\u5360\u636e\u6982\u7387p\u53ef\u4ee5\u901a\u8fc7\u9006logit\u53d8\u6362\u6765\u8ba1\u7b97\u3002\u53ea\u6709\u5f53\u5360\u7528\u6982\u7387p\u5927\u4e8e\u9884\u5148\u5b9a\u4e49\u7684\u9608\u503c\u65f6\uff0c\u624d\u8ba4\u4e3a\u4f53\u7d20\u88ab\u5360\u7528\uff0c\u5e76\u5c06\u5728\u516b\u53c9\u6811\u56fe\u4e2d\u53ef\u89c6\u5316\u3002\u6362\u8a00\u4e4b\uff0c\u88ab\u89c2\u5bdf\u5230\u88ab\u591a\u6b21\u5360\u636e\u7684\u4f53\u7d20\u88ab\u8ba4\u4e3a\u662f\u7a33\u5b9a\u5360\u636e\u4f53\u7d20\u3002\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u597d\u5730\u5904\u7406\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5730\u56fe\u6784\u5efa\u95ee\u9898\u3002 EXPERIMENTAL RESULTS \u00b6 \u7565\u3002","title":"DS-SLAM"},{"location":"cv/papers/dynamic-slam/ds-slam/#ds-slam","text":"\u7ea6 2274 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract paper\uff1a DS-SLAM: A Semantic Visual SLAM towards Dynamic Environments code\uff1a DS-SLAM","title":"DS-SLAM"},{"location":"cv/papers/dynamic-slam/ds-slam/#introduction","text":"\u4f7f\u7528\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u548c\u5149\u6d41\u76f8\u7ed3\u5408\u7684\u65b9\u6cd5\u51cf\u5c11\u89c6\u89c9 SLAM \u4e2d\u52a8\u6001\u7269\u4f53\u9020\u6210\u7684\u5f71\u54cd\u3002 \u57fa\u4e8eORB-SLAM2\u63d0\u51fa\u4e86\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b8c\u6574\u8bed\u4e49SLAM\u7cfb\u7edf\uff08DS-SLAM\uff09\uff0c\u53ef\u4ee5\u51cf\u5c11\u52a8\u6001\u5bf9\u8c61\u5bf9\u59ff\u6001\u4f30\u8ba1\u7684\u5f71\u54cd\u3002 \u8be5\u7cfb\u7edf\u7684\u6709\u6548\u6027\u5728 TUM RGB-D \u6570\u636e\u96c6 \u4e0a\u8fdb\u884c\u8bc4\u4f30\u3002 \u7ed3\u679c\u8868\u660e\uff0cDS-SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\u65b9\u9762\u660e\u663e\u4f18\u4e8e ORB-SLAM2\u3002 \u8be5\u7cfb\u7edf\u8fd8\u4e0e\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u96c6\u6210\uff0c\u5e76\u901a\u8fc7\u5728\u771f\u5b9e\u73af\u5883\u4e2d\u5bf9\u673a\u5668\u4eba\u8fdb\u884c DS-SLAM \u6d4b\u8bd5\u6765\u9a8c\u8bc1\u5176\u6027\u80fd\u3002 2.\u5c06\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u5355\u72ec\u7684\u653e\u5728\u4e00\u4e2a\u7ebf\u7a0b\u5f53\u4e2d\uff0c\u5c06\u8bed\u4e49\u5206\u5272\u548c\u8fd0\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7684\u65b9\u6cd5\uff08\u5149\u6d41\u6cd5\uff08\u901a\u8fc7\u8ba1\u7b97\u5149\u6d41\u7684\u4e0d\u4e00\u81f4\u6027\u6765\u533a\u5206\u9759\u6001\u80cc\u666f\u548c\u8fd0\u52a8\u76ee\u6807\uff09\uff09\u76f8\u7ed3\u5408\uff0c\u8fc7\u6ee4\u6389\u573a\u666f\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u3002\u4ece\u800c\u63d0\u9ad8\u4e86\u5b9a\u4f4d\u6a21\u5757\u548c\u5efa\u56fe\u6a21\u5757\u5728\u52a8\u6001\u573a\u666f\u4e0b\u7684\u9c81\u68d2\u6027\u548c\u51c6\u786e\u6027\u3002 DS-SLAM \u521b\u5efa\u4e00\u4e2a\u5355\u72ec\u7684\u7ebf\u7a0b\u6765\u6784\u5efa\u4e00\u4e2a\u5bc6\u96c6\u7684\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe \u3002\u5bc6\u96c6\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe\u91c7\u7528 log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09 \u65b9\u6cd5\u8fc7\u6ee4\u6389\u4e0d\u7a33\u5b9a\u7684\u4f53\u7d20\u5e76\u66f4\u65b0\u8fd9\u4e9b\u4f53\u7d20\u7684\u8bed\u4e49\u3002","title":"Introduction"},{"location":"cv/papers/dynamic-slam/ds-slam/#related-work","text":"\u5728\u4ee5\u524d\u7684\u5de5\u4f5c\u4e2d\uff0c\u8bed\u4e49\u56fe\u901a\u5e38\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u51e0\u4f55\u90e8\u5206\u548c\u8bed\u4e49\u90e8\u5206\u3002\u8bed\u4e49\u65b9\u6cd5\u9884\u5148\u8bad\u7ec3\u4e86\u5bf9\u8c61\u8bc6\u522b\u5b50\u7cfb\u7edf\uff0c\u5e76\u5c06\u8bed\u4e49\u4fe1\u606f\u9644\u52a0\u5230\u8bc6\u522b\u7684\u5bf9\u8c61\u6a21\u578b\u4e0a\u3002\u4ed6\u4eec\u7684\u5de5\u4f5c\u4ec5\u96c6\u4e2d\u5728\u8bed\u4e49\u6620\u5c04\u548c\u5bf9\u8c61\u8bc6\u522b\u4e0a\uff0c\u800c\u8bed\u4e49\u4fe1\u606f\u5728\u5176\u4ed6\u90e8\u5206\u7684\u4fe1\u606f\u5374\u6ca1\u6709\u5f88\u597d\u5730\u4f7f\u7528\u3002\u8fd1\u671f\u5de5\u4f5c\u5229\u7528\u573a\u666f\u4e2d\u7684\u51e0\u4f55\u5c5e\u6027\u548c\u8bed\u4e49\u5c5e\u6027\u5171\u540c\u4f30\u8ba1\u76f8\u673a\u7684\u59ff\u52bf\uff0c\u70b9\u548c\u5bf9\u8c61\uff0c\u4ece\u800c\u663e\u8457\u63d0\u9ad8\u4e86\u5bf9\u8c61\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u8bed\u4e49\u4fe1\u606f\u4e0d\u4ec5\u7528\u4e8e\u751f\u6210\u57fa\u4e8e\u516b\u53c9\u6811\u7684\u73af\u5883\u8868\u793a\uff0c\u800c\u4e14\u8fd8\u7528\u4e8e\u5728\u52a8\u6001\u73af\u5883\u4e2d\u8ddf\u8e2a\u8fc7\u7a0b\u4e2d\u8fc7\u6ee4\u5f02\u5e38\u503c\u3002","title":"RELATED WORK"},{"location":"cv/papers/dynamic-slam/ds-slam/#system-intruduction","text":"","title":"SYSTEM INTRUDUCTION"},{"location":"cv/papers/dynamic-slam/ds-slam/#framework-of-ds-slam","text":"Kinect2\u6355\u83b7\u7684\u539f\u59cbRGB\u56fe\u50cf\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u548c\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u4e2d\u540c\u65f6\u8fdb\u884c\u5904\u7406\u3002\u8ddf\u8e2a\u7ebf\u7a0b\u9996\u5148\u63d0\u53d6ORB\u7279\u5f81\u70b9\uff0c\u7136\u540e\u7c97\u7565\u68c0\u67e5\u7279\u5f81\u70b9\u7684\u79fb\u52a8\u4e00\u81f4\u6027\u5e76\u4fdd\u5b58\u6f5c\u5728\u7684\u5f02\u5e38\u503c\u3002\u7136\u540e\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u5177\u6709\u7531\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u9884\u6d4b\u7684\u50cf\u7d20\u7ea7\u8bed\u4e49\u6807\u7b7e\u7684\u56fe\u50cf\u3002\u5206\u5272\u7ed3\u679c\u5230\u8fbe\u540e\uff0c\u5c06\u6839\u636e\u5206\u5272\u7ed3\u679c\u548c\u4e4b\u524d\u68c0\u6d4b\u5230\u7684\u6f5c\u5728\u5f02\u5e38\u503c\uff0c\u4e22\u5f03\u4f4d\u4e8e\u8fd0\u52a8\u7269\u4f53\u4e2d\u7684ORB\u7279\u5f81\u70b9\u5f02\u5e38\u503c\u3002\u7136\u540e\uff0c\u901a\u8fc7\u5339\u914d\u5176\u4f59\u7684\u7a33\u5b9a\u7279\u5f81\u70b9\u6765\u8ba1\u7b97\u53d8\u6362\u77e9\u9635\u3002","title":"Framework of DS-SLAM"},{"location":"cv/papers/dynamic-slam/ds-slam/#semantic-segmentation","text":"DS-SLAM\u91c7\u7528SegNet\u63d0\u4f9b\u57fa\u4e8ecaffe\u7684\u50cf\u7d20\u7ea7\u5b9e\u65f6\u8bed\u4e49\u5206\u5272\u3002\u5728PASCAL VOC\u6570\u636e\u96c6\u4e0a\u8bad\u7ec3\u7684SegNet\u603b\u5171\u53ef\u4ee5\u5206\u527220\u4e2a\u7c7b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4eba\u6700\u6709\u53ef\u80fd\u662f\u52a8\u6001\u5bf9\u8c61\uff0c\u56e0\u6b64\u6211\u4eec\u5047\u8bbe\u4f4d\u4e8e\u4eba\u8eab\u4e0a\u7684\u7279\u5f81\u70b9\u6700\u6709\u53ef\u80fd\u662f\u5f02\u5e38\u503c\u3002","title":"Semantic Segmentation"},{"location":"cv/papers/dynamic-slam/ds-slam/#moving-consistency-check","text":"\u7ecf\u8fc7\u8bed\u4e49\u5206\u5272\u7684\u6a21\u5757\u540e\uff0c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u5206\u5272\u7684Mask\u7684\uff0c\u6240\u4ee5\u73b0\u5728\u7684\u4efb\u52a1\u5c31\u662f\u53bb\u786e\u5b9a\uff0c\u67d0\u4e2a\u5173\u952e\u70b9\u662f\u5426\u662f\u79fb\u52a8\u7684\uff0c\u5982\u679c\u6709\u4e00\u5b9a\u6570\u91cf\u7684\u79fb\u52a8\u70b9\u843d\u5728\u4e86\u67d0\u4e00\u4e2a\u5206\u5272\u51fa\u6765\u7684\u7269\u4f53\u8f6e\u5ed3\u5185\u90e8\uff0c\u90a3\u8fd9\u4e2a\u7269\u4f53\u5c31\u88ab\u89c6\u4e3a\u52a8\u6001\uff0c\u4e0a\u9762\u6240\u6709\u7684\u7279\u5f81\u70b9\u90fd\u4f1a\u88ab\u5254\u9664\u3002 \u5224\u65ad\u52a8\u6001\u70b9\u6b65\u9aa4\uff1a \u8ba1\u7b97\u5149\u6d41\u91d1\u5b57\u5854\u5f97\u5230\u5f53\u524d\u5e27\u4e2d\u5df2\u7ecf\u5339\u914d\u7684\u7279\u5f81\u70b9 \u5982\u679c\u5339\u914d\u70b9\u5bf9\u79bb\u56fe\u50cf\u7684\u8fb9\u7f18\u592a\u8fd1\uff0c\u6216\u8005\u5404\u81ea\u4ee5\u4e24\u4e2a\u76f8\u5339\u914d\u7684\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u5176 3x3 \u533a\u57df\u8303\u56f4\u5185\u50cf\u7d20\u503c\u5dee\u5f02\u592a\u5927\uff0c\u8fd9\u4e2a\u5339\u914d\u70b9\u5c31\u4f1a\u88ab\u4e22\u5f03 \u4f7f\u7528 RANSAC \u7684\u65b9\u6cd5\uff08\u4f7f\u7528\u6700\u591a\u5185\u70b9\uff09\u627e\u5230\u57fa\u7840\u77e9\u9635 F \u4f7f\u7528\u57fa\u7840\u77e9\u9635\u8ba1\u7b97\u5f53\u524d\u5e27\u7684\u6781\u7ebf\uff0c\u5df2\u77e5\u4e0a\u4e00\u5e27\u4e2d\u7684\u7279\u5f81\u70b9\u50cf\u7d20\u4f4d\u7f6e\u4e3a \\(p_1=[u_1, v_1, 1]\\) \uff0c\u8fd9\u4e2a\u70b9\u5728\u5f53\u524d\u5e27\u4e2d\u5bf9\u5e94\u7684\u4f4d\u7f6e\u4e3a \\(p_2=[u_2, v_2, 1]\\) \uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u6c42\u51fa\u70b9 \\(p_1\\) \u6295\u5f71\u5230\u5f53\u524d\u5e27\u4e2d\u7684\u6781\u7ebf \\(I_1\\) \\[I_1 = \\begin{pmatrix} X \\\\ Y \\\\ Z \\end{pmatrix} Fp_1 = F \\begin{pmatrix} u_1 \\\\ v_1 \\\\ 1 \\end{pmatrix} \\] \u8ba1\u7b97\u5339\u914d\u7684\u7279\u5f81\u70b9\u5230\u5b83\u5bf9\u5e94\u6781\u7ebf\u7684\u8ddd\u79bb\uff0c\u5982\u679c\u8fd9\u4e2a\u8ddd\u79bb\u8d85\u8fc7\u9608\u503c\u5219\u88ab\u89c6\u4e3a\u79fb\u52a8\u70b9\uff0c\u53cd\u4e4b\u4e3a\u9759\u6001\u70b9\u3002\u8ddd\u79bb\u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ D = \\frac{|P_2^\\top F P_1|}{\\sqrt{\\parallel X \\parallel^2 + \\parallel Y \\parallel^2}} \\]","title":"Moving Consistency Check"},{"location":"cv/papers/dynamic-slam/ds-slam/#outlier-rejection","text":"\u7531\u4e8e\u4eba\u4f53\u7b49\u8fd0\u52a8\u7269\u4f53\u7684\u67d4\u6027\u53d8\u5f62\u548c\u590d\u6742\u8fd0\u52a8\uff0c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u65b9\u6cd5\u5f88\u96be\u63d0\u53d6\u5b8c\u6574\u52a8\u6001\u533a\u57df\u7684\u8f6e\u5ed3\uff0c\u66f4\u4f55\u51b5\u63d0\u53d6\u6574\u4e2a\u8f6e\u5ed3\u7684\u65f6\u95f4\u5f00\u9500\u975e\u5e38\u5927\u3002\u5728DS-SLAM\u4e2d\uff0c\u7531\u4e8e\u91c7\u7528\u4e86\u8bed\u4e49\u5206\u5272\u7f51\u7edc\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u83b7\u5f97\u7269\u4f53\u7684\u5b8c\u6574\u8f6e\u5ed3\u3002\u6211\u4eec\u7684\u60f3\u6cd5\u662f\u5c06\u8bed\u4e49\u4fe1\u606f\u548c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u7ed3\u5408\u8d77\u6765\uff0c\u5b8c\u6210\u4e24\u7ea7\u8bed\u4e49\u77e5\u8bc6\u5e93\u7684\u5efa\u7acb\uff1a \u5bf9\u8c61\u662f\u5426\u79fb\u52a8\u3002\u5982\u679c\u5728\u5206\u5272\u5bf9\u8c61\u7684\u8f6e\u5ed3\u4e2d\u5b58\u5728\u901a\u8fc7\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u800c\u4ea7\u751f\u7684\u4e00\u5b9a\u6570\u91cf\u7684\u52a8\u6001\u70b9\uff0c\u5219\u786e\u5b9a\u8be5\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\u3002 \u5982\u679c\u786e\u5b9a\u5206\u5272\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\uff0c\u5219\u5220\u9664\u4f4d\u4e8e\u5bf9\u8c61\u8f6e\u5ed3\u4e2d\u7684\u6240\u6709\u7279\u5f81\u70b9\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7cbe\u786e\u5730\u6d88\u9664\u5f02\u5e38\u503c\u3002\u6b64\u5916\uff0c\u9519\u8bef\u5206\u5272\u7684\u5f71\u54cd\u4e5f\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u964d\u4f4e\u3002 \u6b64\u5916\uff0c\u53ef\u4ee5\u5145\u5206\u5229\u7528\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u7684\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u7684\u65f6\u95f4\u3002\u5728\u7b49\u5f85\u671f\u95f4\uff0c\u53ef\u4ee5\u8fdb\u884c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u3002\u5728\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u7ed3\u679c\u90e8\u5206\uff0c\u8868 IV \u7ed9\u51fa\u4e86 DS-SLAM \u4e2d\u7684\u6d88\u8017\u65f6\u95f4\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f7f\u7528\u7684\u65f6\u95f4\u5927\u7ea6\u7b49\u4e8e\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u3002 \u5728\u672c\u6587\u7684\u5176\u4f59\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u5c06\u4eba\u7c7b\u4f5c\u4e3a\u52a8\u6001\u5bf9\u8c61\u7684\u5178\u578b\u4ee3\u8868\u3002\u4ece\u7406\u8bba\u4e0a\u8bb2\uff0cDS-SLAM\u9002\u7528\u4e8e\u4efb\u4f55\u591a\u4e2a\u5df2\u8bc6\u522b\u548c\u5206\u6bb5\u7684\u52a8\u6001\u5bf9\u8c61\u3002 \u8bed\u4e49\u5206\u5272\u7ed3\u679c\u51fa\u6765\u540e\uff0c\u5982\u679c\u6ca1\u6709\u4eba\u88ab\u68c0\u6d4b\u5230\uff0c\u90a3\u4e48\u6240\u6709\u7684ORB\u7279\u5f81\u5c06\u76f4\u63a5\u4e0e\u6700\u540e\u4e00\u5e27\u5339\u914d\u4ee5\u9884\u6d4b\u59ff\u52bf\u3002\u5426\u5219\uff0c\u8bf7\u4f7f\u7528\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u6765\u786e\u5b9a\u4eba\u5458\u662f\u5426\u5728\u79fb\u52a8\u3002\u5982\u679c\u786e\u5b9a\u4eba\u662f\u9759\u6001\u7684\uff0c\u5219\u76f4\u63a5\u9884\u6d4b\u59ff\u52bf\uff0c\u5426\u5219\u5728\u5339\u914d\u4e4b\u524d\u5220\u9664\u6240\u6709\u5c5e\u4e8e\u4eba\u7684\u8f6e\u5ed3\u5185\u7684ORB\u7279\u5f81\u70b9\u3002\u8fd9\u6837\uff0c\u53ef\u4ee5\u663e\u7740\u964d\u4f4e\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002","title":"Outlier Rejection"},{"location":"cv/papers/dynamic-slam/ds-slam/#dense-semantic-3d-octo-tree-map-building","text":"\u8bed\u4e49\u516b\u53c9\u6811\u6620\u5c04\u7ebf\u7a0b\u4ece\u8ddf\u8e2a\u7ebf\u7a0b\u83b7\u53d6\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4ece\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u83b7\u53d6\u5206\u5272\u7ed3\u679c\u3002\u5173\u952e\u5e27\u7684\u53d8\u6362\u77e9\u9635\u548c\u6df1\u5ea6\u56fe\u50cf\u7528\u4e8e\u751f\u6210\u5c40\u90e8\u70b9\u4e91\u3002\u7136\u540e\uff0c\u672c\u5730\u70b9\u4e91\u5c06\u88ab\u8f6c\u6362\u5e76\u7ef4\u62a4\u5728\u5168\u5c40\u516b\u70b9\u6811\u5730\u56fe\u4e2d\u3002\u6211\u4eec\u91c7\u7528\u516b\u53c9\u6811\u8868\u793a\uff0c\u662f\u56e0\u4e3a\u5b83\u7075\u6d3b\uff0c\u7d27\u51d1\u4e14\u53ef\u66f4\u65b0\u3002\u516b\u5143\u6811\u5730\u56fe\u88ab\u9ad8\u6548\u5b58\u50a8\uff0c\u5e76\u4e14\u6613\u4e8e\u7528\u4e8e\u5bfc\u822a\u3002 \u8bed\u4e49\u4fe1\u606f\u88ab\u5408\u5e76\u5230\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u3002\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u7684\u6bcf\u4e2a\u4f53\u7d20\u90fd\u4e0e\u7279\u5b9a\u7684\u989c\u8272\u76f8\u5173\u8054\uff0c\u5e76\u4e14\u6bcf\u79cd\u989c\u8272\u90fd\u4ee3\u8868\u4e00\u4e2a\u8bed\u4e49\u6807\u7b7e\u3002\u4f8b\u5982\uff0c\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u6c99\u53d1\uff0c\u800c\u7c89\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u4e00\u4e2a\u4eba\u3002\u5efa\u6a21\u548c\u8bed\u4e49\u878d\u5408\u7684\u6240\u6709\u8fc7\u7a0b\u5747\u4ee5\u6982\u7387\u65b9\u5f0f\u5b8c\u6210\uff0c\u56e0\u6b64\u53ef\u4ee5\u65b9\u4fbf\u5730\u66f4\u65b0\u4f53\u7d20\u7684\u5c5e\u6027\u3002\u8fd9\u6837\uff0c\u5bc6\u96c6\u7684\u8bed\u4e493D\u516b\u53c9\u6811\u5730\u56fe\u53ef\u4ee5\u4e3a\u79fb\u52a8\u673a\u5668\u4eba\u5b8c\u6210\u9ad8\u7ea7\u4efb\u52a1\u63d0\u4f9b\u57fa\u7840\u3002 DS-SLAM \u9762\u5411\u5904\u7406\u52a8\u6001\u73af\u5883\uff0c\u56e0\u6b64\u52a8\u6001\u5bf9\u8c61\u4e0d\u5e94\u8be5\u5b58\u5728\u4e8e\u5730\u56fe\u4e2d\u3002\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6709\u6548\u5730\u8fc7\u6ee4\u6389\u52a8\u6001\u5bf9\u8c61\u3002\u7136\u800c\uff0c\u8bed\u4e49\u5206\u5272\u7684\u51c6\u786e\u6027\u662f\u6709\u9650\u7684\u3002\u5728\u590d\u6742\u60c5\u51b5\u4e0b\uff0c\u4f8b\u5982\u5bf9\u8c61\u76f8\u4e92\u91cd\u53e0\uff0c\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u80fd\u4e0d\u5b8c\u6574\u751a\u81f3\u9519\u8bef\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cDS-SLAM \u4e2d\u4f7f\u7528\u4e86log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09\u6765\u6700\u5c0f\u5316\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002 log-odds score\u7528\u4e8e\u8868\u793a\u5355\u4e2a\u4f53\u7d20\u88ab\u5b9a\u91cf\u5360\u7528\u7684\u53ef\u80fd\u6027\u3002\u4ee4p\u8868\u793a\u4e00\u4e2a\u4f53\u7d20\u88ab\u5360\u7528\u7684\u6982\u7387\uff0cl\u8868\u793a\u8be5\u6982\u7387\u7684log-odds score\u3002 \u53ef\u4ee5\u901a\u8fc7logit\u53d8\u6362\u8ba1\u7b97\uff1a \\[ l = logit(p) = \\log (\\frac{p}{1-p}) \\\\ p = logit^{-1}(l) = \\frac{\\exp(l)}{\\exp(l) + 1} \\\\ L(n | z_{1:t+1}) = L(n | z_{1:t-1}) + L(n | z_t) \\] \u5982\u679c\u4f53\u7d20n\u88ab\u89c2\u5bdf\u5230\u88ab\u5360\u7528\u90a3\u4e48 \\(L=\\tau\\) \uff0c\u5426\u5219\u4e3a0\u3002\u589e\u91cf \\(\\tau\\) \u662f\u4e00\u4e2a\u9884\u5b9a\u4e49\u7684\u503c\u3002\u5f53\u91cd\u590d\u89c2\u5bdf\u5230\u8be5\u4f53\u7d20\u88ab\u5360\u7528\u65f6\uff0c\u8be5\u4f53\u7d20\u7684log-odds score\u4f1a\u589e\u52a0\uff0c\u5426\u5219\u4f1a\u51cf\u5c11\u3002\u4e00\u4e2a\u4f53\u7d20\u7684\u5360\u636e\u6982\u7387p\u53ef\u4ee5\u901a\u8fc7\u9006logit\u53d8\u6362\u6765\u8ba1\u7b97\u3002\u53ea\u6709\u5f53\u5360\u7528\u6982\u7387p\u5927\u4e8e\u9884\u5148\u5b9a\u4e49\u7684\u9608\u503c\u65f6\uff0c\u624d\u8ba4\u4e3a\u4f53\u7d20\u88ab\u5360\u7528\uff0c\u5e76\u5c06\u5728\u516b\u53c9\u6811\u56fe\u4e2d\u53ef\u89c6\u5316\u3002\u6362\u8a00\u4e4b\uff0c\u88ab\u89c2\u5bdf\u5230\u88ab\u591a\u6b21\u5360\u636e\u7684\u4f53\u7d20\u88ab\u8ba4\u4e3a\u662f\u7a33\u5b9a\u5360\u636e\u4f53\u7d20\u3002\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u597d\u5730\u5904\u7406\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5730\u56fe\u6784\u5efa\u95ee\u9898\u3002","title":"Dense semantic 3D octo-tree map building"},{"location":"cv/papers/dynamic-slam/ds-slam/#experimental-results","text":"\u7565\u3002","title":"EXPERIMENTAL RESULTS"},{"location":"cv/papers/dynamic-slam/dynaslam/","text":"DynaSLAM \u00b6 \u7ea6 1868 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f Abstract paper\uff1a DynaSLAM: Tracking, Mapping and Inpainting in Dynamic Scenes code\uff1a DynaSLAM INTRUDUCTION \u00b6 \u5728\u89c6\u89c9SLAM\u4e2d\uff0c\u52a8\u6001\u7269\u4f53\u4f1a\u5e26\u6765\u5982\u4e0b\u6311\u6218\uff1a \u5982\u4f55\u68c0\u6d4b\u56fe\u50cf\u4e2d\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4ece\u800c\uff1a \u9632\u6b62tracking\u7b97\u6cd5\u4f7f\u7528\u52a8\u6001\u7269\u4f53\u4e0a\u7684\u5339\u914d\u70b9\u5bf9 \u9632\u6b62mapping\u7b97\u6cd5\u628a\u79fb\u52a8\u7269\u4f53\u52a0\u51653D\u5730\u56fe\u4e2d \u600e\u4e48\u53bb\u8865\u51683D\u5730\u56fe\u4e2d\u90a3\u4e9b\u88ab\u79fb\u52a8\u7269\u4f53\u6321\u4f4f\u4ece\u800c\u7f3a\u5931\u4e86\u7684\u90e8\u5206\u3002 DynaSLAM\u662f\u53ef\u4ee5\u7528\u4e8e\u5355\u76ee\uff0c\u53cc\u76ee\uff0cRGB-D\u7684\u52a8\u6001SLAM\u7cfb\u7edf\uff0c\u76f8\u5f53\u4e8e\u662f\u5728ORB-SLAM2\u4e0a\u52a0\u4e86\u4e00\u4e2a\u524d\u7aef\u7684\u6a21\u5757\uff0c\u4e0a\u9762\u7684\u4e24\u4e2a\u6311\u6218\uff0c\u8fd9\u7bc7\u8bba\u6587\u90fd\u7ed9\u51fa\u4e86\u5bf9\u5e94\u7684\u89e3\u51b3\u529e\u6cd5\u3002 \u5bf9\u4e8e\u5355\u76ee\u548c\u53cc\u76ee\uff1a\u4f7f\u7528CNN\u8fdb\u884c\u50cf\u7d20\u5206\u5272\uff0c\u628a\u56fe\u50cf\u4e2d\u7684\u4eba\u548c\u8f66\u5254\u9664\uff0c\u7279\u5f81\u63d0\u53d6\u65f6\u5c31\u4e0d\u4f1a\u8fd9\u4e9b\u4e0a\u9762\u63d0\u53d6\u3002 \u5bf9\u4e8eRGB-D\uff1a\u7ed3\u5408\u591a\u89c6\u89d2\u51e0\u4f55\u6a21\u578b\u548c\u6df1\u5ea6\u5b66\u4e60\uff08\u91cd\u70b9\uff01\uff09 RELATED WORK \u00b6 \u5728\u8fd9\u4e2a\u90e8\u5206\u4f5c\u8005\u8fd8\u603b\u7ed3\u4e86\u4e00\u4e0b\u76ee\u524d\u52a8\u6001SLAM\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a \u5e38\u89c4\u53bb\u9664\u52a8\u6001\u7684\u5916\u70b9\uff1a RANSAC robust cost function \u5bf9\u4e8e\u57fa\u4e8e\u7279\u5f81\u7684SLAM\uff1a \u901a\u8fc7\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u5f53\u524d\u5e27\u6765\u68c0\u6d4b\u573a\u666f\u4e2d\u7684\u53d8\u5316 \u68c0\u6d4b\u548c\u8ffd\u8e2a\u5df2\u77e5\u76843D\u52a8\u6001\u70b9\uff0c\u6bd4\u5982\u4eba \u4f7f\u7528\u6df1\u5ea6\u8fb9\u7f18\u70b9\uff0c\u4ed6\u6709\u4e00\u4e2a\u76f8\u5173\u8054\u6743\u91cd\u53ef\u4ee5\u7528\u6765\u8868\u793a\u5176\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u6982\u7387 \u5bf9\u4e8e\u76f4\u63a5\u6cd5SLAM\uff0c\u4ed6\u5bf9\u52a8\u6001\u7269\u4f53\u66f4\u52a0\u654f\u611f\uff1a \u901a\u8fc7\u53cc\u76ee\u76f8\u673a\u7684\u573a\u666f\u6d41\u6765\u68c0\u6d4b\u79fb\u52a8\u7269\u4f53 \u4f7f\u7528RGB-D\u5149\u6d41\u5206\u5272\u52a8\u6001\u7269\u4f53 \u901a\u8fc7\u8ba1\u7b97\u8fde\u7eed\u5e27\u4e4b\u95f4\u6295\u5f71\u5230\u540c\u4e00\u5e73\u9762\u7684\u6df1\u5ea6\u56fe\u7684\u5dee\u522b\u6765\u627e\u5230\u9759\u6b62\u7684\u90e8\u5206 \u8ba1\u7b97\u8fde\u7eedRGB\u56fe\u50cf\u4e4b\u95f4intensity\u7684\u5dee\u522b\uff0c\u50cf\u7d20\u5206\u7c7b\u901a\u8fc7\u5bf9\u91cf\u5316\u7684\u6df1\u5ea6\u56fe\u8fdb\u884c\u5206\u5272\u800c\u5b8c\u6210\uff1f \u4e0a\u9762\u5217\u51fa\u5173\u4e8e\u7279\u5f81\u6cd5\u548c\u76f4\u63a5\u6cd5\u7684\u65b9\u6848\u90fd\u6709\u4e00\u4e9b\u95ee\u9898\u6ca1\u80fd\u89e3\u51b3\uff1a \u4e0d\u80fd\u4f30\u8ba1\u4e00\u4e9b\u4fdd\u6301\u9759\u6b62\u7684\u5148\u9a8c\u52a8\u6001\u7269\u4f53\uff0c\u6bd4\u5982\u9759\u6b62\u7684\u6c7d\u8f66\uff0c\u5750\u7740\u7684\u4eba \u4e0d\u80fd\u68c0\u6d4b\u9759\u6001\u7269\u4f53\u5f15\u8d77\u7684\u53d8\u5316\uff0c\u6bd4\u5982\u8bf4\u88ab\u4eba\u62d6\u52a8\u7684\u6905\u5b50\uff0c\u6216\u8005\u88ab\u4eba\u4e22\u98de\u7684\u7403\u3002 \u800cDynaSLAM\u4e0d\u4ec5\u53ef\u4ee5\u68c0\u6d4b\u51fa\u6b63\u5728\u79fb\u52a8\u7684\u7269\u4f53\uff0c\u8fd8\u53ef\u4ee5\u68c0\u6d4b\u51fa\u4e00\u4e9b\u201c\u53ef\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\u3002 SYSTEM DESCRIPTION \u00b6 Segmentation of Potentially Dynamic Content using a CNN \u00b6 \u4f7f\u7528 MASK-RCNN \u8fdb\u884c\u50cf\u7d20\u7ea7\u5206\u5272\uff0c\u53ea\u7528\u5230\u8bed\u4e49\u4fe1\u606f\u3002 Low-Cost Tracking \u00b6 \u4e0a\u4e00\u6b65\u4e2d\u628a\u52a8\u6001\u7279\u5f81\u70b9\u53bb\u9664\u540e\uff0c\u7528\u5269\u4e0b\u7684\u9759\u6001\u70b9\u7ebf\u6c42\u51fa\u4e00\u4e2a\u76f8\u673a\u7684\u4f4d\u59ff\u3002\u7531\u4e8e\u8ba1\u7b97\u7279\u5f81\u70b9\u7684\u65f6\u5019\uff0c\u7279\u5f81\u70b9\u672c\u5c31\u559c\u6b22\u843d\u5728\u5206\u5272\u8f6e\u5ed3\u8fd9\u79cd\u9ad8\u68af\u5ea6\u533a\u57df\uff08\u53ef\u4ee5\u627e\u56fe\u7247\u770b\u4e00\u4e0b\uff0c\u6bd4\u5982\uff0c\u4eba\u8eab\u4f53\u5206\u51fa\u6765\u7684\u5206\u5272\u8fb9\u754c\uff0c\u540e\u9762\u5c31\u662f\u80cc\u666f\uff0c\u6709\u4e00\u4e9b\u906e\u6321\u5173\u7cfb\uff0c\u5206\u5272\u8fb9\u754c\u9644\u8fd1\u4f1a\u662f\u68af\u5ea6\u53d8\u5316\u5927\u7684\u533a\u57df\uff0c\u7279\u5f81\u70b9\u672c\u8eab\u5c31\u5bb9\u6613\u843d\u5728\u8fd9\u79cd\u5730\u65b9\uff09\uff0c\u6240\u4ee5\u8fd9\u4e2a\u5206\u5272\u8f6e\u5ed3\u9644\u8fd1\u7684\u70b9\u4e5f\u4e0d\u8981\uff0c\u4ee3\u7801\u4e2d\u7528\u4e86erode\u5904\u7406\u3002\u8fd9\u4e00\u6b65\u7684tracking\u8ba1\u7b97\u6bd4\u8f83\u7b80\u5355\uff0c\u662fORB\u539f\u7248\u7684\u7b80\u5316\u3002\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u56fe\u50cf\u5e27\uff0c\u627e\u5230\u5730\u56fe\u70b9\u5728\u56fe\u50cf\u9759\u6001\u533a\u57df\u4e2d\u5bf9\u5e94\u7684\u5339\u914d\u70b9\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u6765\u4f18\u5316\u76f8\u673a\u4f4d\u59ff\u3002 Segmentation of Dynamic Content using Mask R-CNN and Multi-view Geometry \u00b6 \u4f7f\u7528MASK-RCNN\u53ea\u80fd\u5206\u5272\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u4e0d\u80fd\u627e\u5230\u90a3\u4e9b\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u6bd4\u5982\u88ab\u4eba\u62ff\u7740\u7684\u4e66\uff0c\u8ddf\u4eba\u4e00\u8d77\u79fb\u52a8\u7684\u8f6c\u6905\u7b49\u7b49\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u79cd\u60c5\u51b5\uff0c\u5c31\u91c7\u7528\u4e86\u4e0b\u9762\u7684\u591a\u89c6\u56fe\u51e0\u4f55\u7684\u65b9\u6cd5\uff1a \u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u8f93\u5165\u5e27\uff0c\u9009\u62e9\u4e4b\u524d\u7684\u548c\u8f93\u5165\u5e27\u6709\u6700\u9ad8\u91cd\u5408\u5ea6\u7684\u591a\u4e2a\u5173\u952e\u5e27\uff08\u8bba\u6587\u8bbe\u7f6e\u4e3a5\u4e2a\uff09\uff0c\u8fd9\u4e2a\u91cd\u5408\u5ea6\u662f\u901a\u8fc7\u8003\u8651\u65b0\u7684\u4e00\u5e27\u548c\u6bcf\u4e2a\u5173\u952e\u5e27\u4e4b\u95f4\u7684\u8ddd\u79bb\u548c\u65cb\u8f6c\u6765\u51b3\u5b9a\u7684\u3002 \u628a\u4e4b\u524d\u5173\u952e\u5e27\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u70b9 \\(x\\) \u90fd\u6295\u5f71\u5230\u5f53\u524d\u5e27\uff0c\u5f97\u5230\u5173\u952e\u70b9 \\(x^\\prime\\) \u548c\u5b83\u4eec\u7684\u6295\u5f71\u6df1\u5ea6 \\(z_{proj}\\) \u5bf9\u4e8e\u6bcf\u4e2a\u5173\u952e\u70b9\uff0c\u5b83\u5bf9\u5e94\u76843D\u70b9\u662f \\(X\\) \u3002\u7136\u540e\uff0c\u8ba1\u7b97 \\(x\\) \u548c \\(x^\\prime\\) \u53cd\u6295\u5f71\u4e4b\u95f4\u7684\u5939\u89d2\uff0c\u5373\u89c6\u5dee\u89d2 \\(\\alpha\\) \u3002 \u5982\u679c\u89d2\u5ea6\u5927\u4e8e30\u5ea6\uff0c\u8fd9\u4e2a\u70b9\u5c31\u6709\u53ef\u80fd\u88ab\u906e\u6321 \uff0c\u4e4b\u540e\u5c31\u4f1a\u88ab\u5ffd\u7565\u3002\u6bd4\u5982\u5728TUM\u6570\u636e\u96c6\u4e2d\uff0c\u5982\u679c\u89c6\u5dee\u89d2\u5927\u4e8e30\u5ea6\uff0c\u7531\u4e8e\u89c6\u89d2\u7684\u4e0d\u540c\uff0c\u9759\u6001\u70b9\u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u3002 \u8ba1\u7b97\u51fa\u5173\u7fbd\u6df1\u5ea6\u7684 \u91cd\u6295\u5f71\u8bef\u5dee\uff1a \\(\\Delta z = z_{proj} - z^\\prime\\) \uff0c \\(z^\\prime\\) \u662f\u5f53\u524d\u5e27\u4e2d\u8fd8\u6709\u7684\u5173\u952e\u70b9\u7684\u6df1\u5ea6\uff08\u6d4b\u91cf\u503c\uff09\u3002\u5982\u679c \\(\\Delta z > \\tau_z\\) \uff0c\u5173\u952e\u70b9 \\(x^\\prime\\) \u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u7269\u4f53\u3002\u4e3a\u4e86\u4e00\u4e2a\u597d\u7684\u7cbe\u5ea6\u548c\u53ec\u56de\u7387\uff0c\u901a\u8fc7\u6700\u5927\u5316 \\(0.7 * Presion + 0.3 * Recall\\) \uff0c\u5c06 \\(\\tau_z\\) \u5b9a\u4e3a 0.4m\u3002 \u6709\u4e00\u4e9b\u88ab\u6807\u8bb0\u4e3a\u52a8\u6001\u7684\u5173\u952e\u70b9\u4f4d\u4e8e\u79fb\u52a8\u7269\u4f53\u7684\u8fb9\u754c\u4e0a\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5f15\u8d77\u95ee\u9898\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u6240\u63d0\u4f9b\u7684\u4fe1\u606f\u3002 \u5982\u679c\u4e00\u4e2a\u5173\u952e\u70b9\u88ab\u8bbe\u5b9a\u4e3a\u52a8\u6001\uff0c\u4f46\u5728\u6df1\u5ea6\u56fe\u4e2d\u5b83\u5468\u56f4\u7684\u533a\u57df\u6709\u5f88\u5927\u7684\u65b9\u5dee\uff0c\u6211\u4eec\u5c31\u628a\u6807\u7b7e\u6539\u4e3a\u9759\u6001\u3002 \u4e3a\u4e86\u627e\u5230\u52a8\u6001\u7269\u4f53\u7684\u6240\u6709\u50cf\u7d20\u70b9\uff0c\u5728\u6df1\u5ea6\u56fe\u7684\u52a8\u6001\u70b9\u5468\u56f4\u8fdb\u884c\u533a\u57df\u589e\u957f\u7b97\u6cd5\u3002 \u8fd9\u4e24\u79cd\u65b9\u6cd5\u5448\u73b0\u51fa\u529f\u80fd\u4e0a\u7684\u4e92\u8865\uff0c\u6240\u4ee5\u6700\u7ec8\u53d6\u4e86\u4e24\u4e2aMask\u7684\u5e76\u96c6\uff0c\u88ab\u5206\u5272\u7684\u52a8\u6001\u90e8\u5206\u88ab\u4ece\u5f53\u524d\u5e27\u548c\u5730\u56fe\u4e2d\u79fb\u9664\uff1a \u591a\u89c6\u56fe\u51e0\u4f55 \uff1a\u80fd\u8bc6\u522b\u51fa\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u4f46\u9700\u8981\u6709\u591a\u89c6\u56fe\u624d\u80fd\u8fdb\u884c\u521d\u59cb\u5316\u3002\u5728\u56fe4a\u4e2d\u770b\u5230\uff0c\u4e0d\u4ec5\u68c0\u6d4b\u5230\u4e86\u56fe\u50cf\u524d\u9762\u7684\u4eba\uff0c\u800c\u4e14\u8fd8\u68c0\u6d4b\u5230\u4e86\u4ed6\u6240\u62ff\u7684\u4e66\u548c\u4ed6\u6240\u5750\u7684\u6905\u5b50\uff1b\u4f46\u662f\u8fdc\u5904\u7684\u4eba\u5e76\u6ca1\u6709\u88ab\u68c0\u6d4b\u5230\uff0c\u539f\u56e0\u6709\u4e8c\uff1aRGB-D\u76f8\u673a\u5728\u6d4b\u91cf\u8fdc\u5904\u7269\u4f53\u7684\u6df1\u5ea6\u65f6\u4f1a\u6709\u56f0\u96be\uff1b\u5176\u6b21\uff0c\u53ef\u9760\u7684\u7279\u5f81\u4f4d\u4e8e\u786e\u5b9a\u7684\uff0c\u56e0\u6b64\u662f\u9644\u8fd1\u7684\u56fe\u50cf\u90e8\u5206\u3002 \u6df1\u5ea6\u5b66\u4e60 \uff1a\u53ea\u80fd\u8bc6\u522b\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u6ca1\u6709\u521d\u59cb\u5316\u65b9\u9762\u7684\u95ee\u9898\u3002\u53ef\u4ee5\u5728\u56fe4b\u770b\u5230\uff0c\u53ea\u6709\u4e24\u4e2a\u4eba\u88ab\u68c0\u6d4b\u4e3a\u52a8\u6001\u7269\u4f53\uff0c\u800c\u4e14\u5206\u5272\u4e5f\u4e0d\u592a\u51c6\u786e\uff1b\u800c\u6d6e\u52a8\u7684\u4e66\u4f1a\u88ab\u7559\u5728\u56fe\u50cf\u4e2d\uff0c\u5e76\u9519\u8bef\u5730\u6210\u4e3a\u4e09\u7ef4\u5730\u56fe\u7684\u4e00\u90e8\u5206\u3002 Tracking and Mapping \u00b6 \u8fd9\u4e00\u6b65\u4e2d\uff0c\u7cfb\u7edf\u7684\u8f93\u5165\u662f\uff1aRGB\u56fe\uff0c\u6df1\u5ea6\u56fe\u50cf\uff0c\u5206\u5272\u7684Mask\u3002 \u5728\u56fe\u50cf\u4e2d\u63d0\u53d6\u51fa\u7684ORB\u7279\u5f81\u70b9\u90fd\u88ab\u6807\u8bb0\u4e3a\u9759\u6001\u70b9\uff0c \u5982\u679c\u7279\u5f81\u70b9\u843d\u5728\u4e86\u5206\u5272\u8f6e\u5ed3\u5468\u56f4\uff08\u9ad8\u68af\u5ea6\u533a\u57df\uff09\uff0c\u5c31\u4f1a\u88ab\u79fb\u9664\u3002 Background Inpainting \u00b6 \u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u88ab\u79fb\u9664\u7684\u52a8\u6001\u7269\u4f53\uff0c\u5e0c\u671b\u80fd\u7528\u4e4b\u524d\u89c6\u56fe\u4e2d\u7684\u9759\u6001\u4fe1\u606f\u6765\u8865\u5168\u4e22\u5931\u7684\u80cc\u666f\u4fe1\u606f\uff08\u88ab\u52a8\u6001\u7269\u4f53\u906e\u6321\u4e86\u7684\u90e8\u5206\uff09\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5408\u6210\u4e00\u4e2a\u6ca1\u6709\u79fb\u52a8\u7269\u4f53\u7684\u56fe\u50cf\u3002 \u7531\u4e8e\u6211\u4eec\u77e5\u9053\u524d\u4e00\u5e27\u548c\u5f53\u524d\u5e27\u7684\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e9b\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff08\u6b64\u5904\u8bbe\u7f6e\u4e3a\u524d20\u4e2a\uff09\u7684RGB\u548c\u6df1\u5ea6\u56fe\u6295\u5f71\u5230\u5f53\u524d\u5e27\u7684\u52a8\u6001\u533a\u57df\uff1a \u6709\u4e9b\u7a7a\u9699\u6ca1\u6709\u5bf9\u5e94\u5173\u7cfb\uff0c\u88ab\u7559\u4e3a\u7a7a\u767d \u6709\u4e9b\u533a\u57df\u4e0d\u80fd\u88ab\u8865\u5168\uff0c\u56e0\u4e3a\u5176\u5bf9\u5e94\u7684\u573a\u666f\u90e8\u5206\u5230\u76ee\u524d\u8fd8\u6ca1\u51fa\u73b0\u5728\u5173\u952e\u5e27\u4e2d \u5982\u679c\u5b83\u51fa\u73b0\u4e86\uff0c\u4f46\u6ca1\u6709\u6709\u6548\u7684\u6df1\u5ea6\u4fe1\u606f\u3002\u8fd9\u4e9b\u7a7a\u9699\u4e5f\u4e0d\u80fd\u7528\u51e0\u4f55\u65b9\u6cd5\u6765\u91cd\u5efa\uff0c\u800c\u9700\u8981\u4e00\u79cd\u66f4\u590d\u6742\u7684\u6d82\u62b9\u6280\u672f\u3002 \u4ece\u4e0b\u9762\u7684\u56fe5\u53ef\u4ee5\u770b\u5230\u5927\u90e8\u5206\u88ab\u5206\u5272\u7684\u90e8\u5206\u5df2\u7ecf\u7528\u6765\u81ea\u9759\u6001\u80cc\u666f\u7684\u4fe1\u606f\u8fdb\u884c\u4e86\u9002\u5f53\u7684\u8865\u5168\u3002 EXPERIMENTAL RESULTS \u00b6 \u7565\u3002","title":"DynaSLAM"},{"location":"cv/papers/dynamic-slam/dynaslam/#dynaslam","text":"\u7ea6 1868 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f Abstract paper\uff1a DynaSLAM: Tracking, Mapping and Inpainting in Dynamic Scenes code\uff1a DynaSLAM","title":"DynaSLAM"},{"location":"cv/papers/dynamic-slam/dynaslam/#intruduction","text":"\u5728\u89c6\u89c9SLAM\u4e2d\uff0c\u52a8\u6001\u7269\u4f53\u4f1a\u5e26\u6765\u5982\u4e0b\u6311\u6218\uff1a \u5982\u4f55\u68c0\u6d4b\u56fe\u50cf\u4e2d\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4ece\u800c\uff1a \u9632\u6b62tracking\u7b97\u6cd5\u4f7f\u7528\u52a8\u6001\u7269\u4f53\u4e0a\u7684\u5339\u914d\u70b9\u5bf9 \u9632\u6b62mapping\u7b97\u6cd5\u628a\u79fb\u52a8\u7269\u4f53\u52a0\u51653D\u5730\u56fe\u4e2d \u600e\u4e48\u53bb\u8865\u51683D\u5730\u56fe\u4e2d\u90a3\u4e9b\u88ab\u79fb\u52a8\u7269\u4f53\u6321\u4f4f\u4ece\u800c\u7f3a\u5931\u4e86\u7684\u90e8\u5206\u3002 DynaSLAM\u662f\u53ef\u4ee5\u7528\u4e8e\u5355\u76ee\uff0c\u53cc\u76ee\uff0cRGB-D\u7684\u52a8\u6001SLAM\u7cfb\u7edf\uff0c\u76f8\u5f53\u4e8e\u662f\u5728ORB-SLAM2\u4e0a\u52a0\u4e86\u4e00\u4e2a\u524d\u7aef\u7684\u6a21\u5757\uff0c\u4e0a\u9762\u7684\u4e24\u4e2a\u6311\u6218\uff0c\u8fd9\u7bc7\u8bba\u6587\u90fd\u7ed9\u51fa\u4e86\u5bf9\u5e94\u7684\u89e3\u51b3\u529e\u6cd5\u3002 \u5bf9\u4e8e\u5355\u76ee\u548c\u53cc\u76ee\uff1a\u4f7f\u7528CNN\u8fdb\u884c\u50cf\u7d20\u5206\u5272\uff0c\u628a\u56fe\u50cf\u4e2d\u7684\u4eba\u548c\u8f66\u5254\u9664\uff0c\u7279\u5f81\u63d0\u53d6\u65f6\u5c31\u4e0d\u4f1a\u8fd9\u4e9b\u4e0a\u9762\u63d0\u53d6\u3002 \u5bf9\u4e8eRGB-D\uff1a\u7ed3\u5408\u591a\u89c6\u89d2\u51e0\u4f55\u6a21\u578b\u548c\u6df1\u5ea6\u5b66\u4e60\uff08\u91cd\u70b9\uff01\uff09","title":"INTRUDUCTION"},{"location":"cv/papers/dynamic-slam/dynaslam/#related-work","text":"\u5728\u8fd9\u4e2a\u90e8\u5206\u4f5c\u8005\u8fd8\u603b\u7ed3\u4e86\u4e00\u4e0b\u76ee\u524d\u52a8\u6001SLAM\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a \u5e38\u89c4\u53bb\u9664\u52a8\u6001\u7684\u5916\u70b9\uff1a RANSAC robust cost function \u5bf9\u4e8e\u57fa\u4e8e\u7279\u5f81\u7684SLAM\uff1a \u901a\u8fc7\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u5f53\u524d\u5e27\u6765\u68c0\u6d4b\u573a\u666f\u4e2d\u7684\u53d8\u5316 \u68c0\u6d4b\u548c\u8ffd\u8e2a\u5df2\u77e5\u76843D\u52a8\u6001\u70b9\uff0c\u6bd4\u5982\u4eba \u4f7f\u7528\u6df1\u5ea6\u8fb9\u7f18\u70b9\uff0c\u4ed6\u6709\u4e00\u4e2a\u76f8\u5173\u8054\u6743\u91cd\u53ef\u4ee5\u7528\u6765\u8868\u793a\u5176\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u6982\u7387 \u5bf9\u4e8e\u76f4\u63a5\u6cd5SLAM\uff0c\u4ed6\u5bf9\u52a8\u6001\u7269\u4f53\u66f4\u52a0\u654f\u611f\uff1a \u901a\u8fc7\u53cc\u76ee\u76f8\u673a\u7684\u573a\u666f\u6d41\u6765\u68c0\u6d4b\u79fb\u52a8\u7269\u4f53 \u4f7f\u7528RGB-D\u5149\u6d41\u5206\u5272\u52a8\u6001\u7269\u4f53 \u901a\u8fc7\u8ba1\u7b97\u8fde\u7eed\u5e27\u4e4b\u95f4\u6295\u5f71\u5230\u540c\u4e00\u5e73\u9762\u7684\u6df1\u5ea6\u56fe\u7684\u5dee\u522b\u6765\u627e\u5230\u9759\u6b62\u7684\u90e8\u5206 \u8ba1\u7b97\u8fde\u7eedRGB\u56fe\u50cf\u4e4b\u95f4intensity\u7684\u5dee\u522b\uff0c\u50cf\u7d20\u5206\u7c7b\u901a\u8fc7\u5bf9\u91cf\u5316\u7684\u6df1\u5ea6\u56fe\u8fdb\u884c\u5206\u5272\u800c\u5b8c\u6210\uff1f \u4e0a\u9762\u5217\u51fa\u5173\u4e8e\u7279\u5f81\u6cd5\u548c\u76f4\u63a5\u6cd5\u7684\u65b9\u6848\u90fd\u6709\u4e00\u4e9b\u95ee\u9898\u6ca1\u80fd\u89e3\u51b3\uff1a \u4e0d\u80fd\u4f30\u8ba1\u4e00\u4e9b\u4fdd\u6301\u9759\u6b62\u7684\u5148\u9a8c\u52a8\u6001\u7269\u4f53\uff0c\u6bd4\u5982\u9759\u6b62\u7684\u6c7d\u8f66\uff0c\u5750\u7740\u7684\u4eba \u4e0d\u80fd\u68c0\u6d4b\u9759\u6001\u7269\u4f53\u5f15\u8d77\u7684\u53d8\u5316\uff0c\u6bd4\u5982\u8bf4\u88ab\u4eba\u62d6\u52a8\u7684\u6905\u5b50\uff0c\u6216\u8005\u88ab\u4eba\u4e22\u98de\u7684\u7403\u3002 \u800cDynaSLAM\u4e0d\u4ec5\u53ef\u4ee5\u68c0\u6d4b\u51fa\u6b63\u5728\u79fb\u52a8\u7684\u7269\u4f53\uff0c\u8fd8\u53ef\u4ee5\u68c0\u6d4b\u51fa\u4e00\u4e9b\u201c\u53ef\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\u3002","title":"RELATED WORK"},{"location":"cv/papers/dynamic-slam/dynaslam/#system-description","text":"","title":"SYSTEM DESCRIPTION"},{"location":"cv/papers/dynamic-slam/dynaslam/#segmentation-of-potentially-dynamic-content-using-a-cnn","text":"\u4f7f\u7528 MASK-RCNN \u8fdb\u884c\u50cf\u7d20\u7ea7\u5206\u5272\uff0c\u53ea\u7528\u5230\u8bed\u4e49\u4fe1\u606f\u3002","title":"Segmentation of Potentially Dynamic Content using a CNN"},{"location":"cv/papers/dynamic-slam/dynaslam/#low-cost-tracking","text":"\u4e0a\u4e00\u6b65\u4e2d\u628a\u52a8\u6001\u7279\u5f81\u70b9\u53bb\u9664\u540e\uff0c\u7528\u5269\u4e0b\u7684\u9759\u6001\u70b9\u7ebf\u6c42\u51fa\u4e00\u4e2a\u76f8\u673a\u7684\u4f4d\u59ff\u3002\u7531\u4e8e\u8ba1\u7b97\u7279\u5f81\u70b9\u7684\u65f6\u5019\uff0c\u7279\u5f81\u70b9\u672c\u5c31\u559c\u6b22\u843d\u5728\u5206\u5272\u8f6e\u5ed3\u8fd9\u79cd\u9ad8\u68af\u5ea6\u533a\u57df\uff08\u53ef\u4ee5\u627e\u56fe\u7247\u770b\u4e00\u4e0b\uff0c\u6bd4\u5982\uff0c\u4eba\u8eab\u4f53\u5206\u51fa\u6765\u7684\u5206\u5272\u8fb9\u754c\uff0c\u540e\u9762\u5c31\u662f\u80cc\u666f\uff0c\u6709\u4e00\u4e9b\u906e\u6321\u5173\u7cfb\uff0c\u5206\u5272\u8fb9\u754c\u9644\u8fd1\u4f1a\u662f\u68af\u5ea6\u53d8\u5316\u5927\u7684\u533a\u57df\uff0c\u7279\u5f81\u70b9\u672c\u8eab\u5c31\u5bb9\u6613\u843d\u5728\u8fd9\u79cd\u5730\u65b9\uff09\uff0c\u6240\u4ee5\u8fd9\u4e2a\u5206\u5272\u8f6e\u5ed3\u9644\u8fd1\u7684\u70b9\u4e5f\u4e0d\u8981\uff0c\u4ee3\u7801\u4e2d\u7528\u4e86erode\u5904\u7406\u3002\u8fd9\u4e00\u6b65\u7684tracking\u8ba1\u7b97\u6bd4\u8f83\u7b80\u5355\uff0c\u662fORB\u539f\u7248\u7684\u7b80\u5316\u3002\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u56fe\u50cf\u5e27\uff0c\u627e\u5230\u5730\u56fe\u70b9\u5728\u56fe\u50cf\u9759\u6001\u533a\u57df\u4e2d\u5bf9\u5e94\u7684\u5339\u914d\u70b9\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u6765\u4f18\u5316\u76f8\u673a\u4f4d\u59ff\u3002","title":"Low-Cost Tracking"},{"location":"cv/papers/dynamic-slam/dynaslam/#segmentation-of-dynamic-content-using-mask-r-cnn-and-multi-view-geometry","text":"\u4f7f\u7528MASK-RCNN\u53ea\u80fd\u5206\u5272\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u4e0d\u80fd\u627e\u5230\u90a3\u4e9b\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u6bd4\u5982\u88ab\u4eba\u62ff\u7740\u7684\u4e66\uff0c\u8ddf\u4eba\u4e00\u8d77\u79fb\u52a8\u7684\u8f6c\u6905\u7b49\u7b49\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u79cd\u60c5\u51b5\uff0c\u5c31\u91c7\u7528\u4e86\u4e0b\u9762\u7684\u591a\u89c6\u56fe\u51e0\u4f55\u7684\u65b9\u6cd5\uff1a \u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u8f93\u5165\u5e27\uff0c\u9009\u62e9\u4e4b\u524d\u7684\u548c\u8f93\u5165\u5e27\u6709\u6700\u9ad8\u91cd\u5408\u5ea6\u7684\u591a\u4e2a\u5173\u952e\u5e27\uff08\u8bba\u6587\u8bbe\u7f6e\u4e3a5\u4e2a\uff09\uff0c\u8fd9\u4e2a\u91cd\u5408\u5ea6\u662f\u901a\u8fc7\u8003\u8651\u65b0\u7684\u4e00\u5e27\u548c\u6bcf\u4e2a\u5173\u952e\u5e27\u4e4b\u95f4\u7684\u8ddd\u79bb\u548c\u65cb\u8f6c\u6765\u51b3\u5b9a\u7684\u3002 \u628a\u4e4b\u524d\u5173\u952e\u5e27\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u70b9 \\(x\\) \u90fd\u6295\u5f71\u5230\u5f53\u524d\u5e27\uff0c\u5f97\u5230\u5173\u952e\u70b9 \\(x^\\prime\\) \u548c\u5b83\u4eec\u7684\u6295\u5f71\u6df1\u5ea6 \\(z_{proj}\\) \u5bf9\u4e8e\u6bcf\u4e2a\u5173\u952e\u70b9\uff0c\u5b83\u5bf9\u5e94\u76843D\u70b9\u662f \\(X\\) \u3002\u7136\u540e\uff0c\u8ba1\u7b97 \\(x\\) \u548c \\(x^\\prime\\) \u53cd\u6295\u5f71\u4e4b\u95f4\u7684\u5939\u89d2\uff0c\u5373\u89c6\u5dee\u89d2 \\(\\alpha\\) \u3002 \u5982\u679c\u89d2\u5ea6\u5927\u4e8e30\u5ea6\uff0c\u8fd9\u4e2a\u70b9\u5c31\u6709\u53ef\u80fd\u88ab\u906e\u6321 \uff0c\u4e4b\u540e\u5c31\u4f1a\u88ab\u5ffd\u7565\u3002\u6bd4\u5982\u5728TUM\u6570\u636e\u96c6\u4e2d\uff0c\u5982\u679c\u89c6\u5dee\u89d2\u5927\u4e8e30\u5ea6\uff0c\u7531\u4e8e\u89c6\u89d2\u7684\u4e0d\u540c\uff0c\u9759\u6001\u70b9\u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u3002 \u8ba1\u7b97\u51fa\u5173\u7fbd\u6df1\u5ea6\u7684 \u91cd\u6295\u5f71\u8bef\u5dee\uff1a \\(\\Delta z = z_{proj} - z^\\prime\\) \uff0c \\(z^\\prime\\) \u662f\u5f53\u524d\u5e27\u4e2d\u8fd8\u6709\u7684\u5173\u952e\u70b9\u7684\u6df1\u5ea6\uff08\u6d4b\u91cf\u503c\uff09\u3002\u5982\u679c \\(\\Delta z > \\tau_z\\) \uff0c\u5173\u952e\u70b9 \\(x^\\prime\\) \u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u7269\u4f53\u3002\u4e3a\u4e86\u4e00\u4e2a\u597d\u7684\u7cbe\u5ea6\u548c\u53ec\u56de\u7387\uff0c\u901a\u8fc7\u6700\u5927\u5316 \\(0.7 * Presion + 0.3 * Recall\\) \uff0c\u5c06 \\(\\tau_z\\) \u5b9a\u4e3a 0.4m\u3002 \u6709\u4e00\u4e9b\u88ab\u6807\u8bb0\u4e3a\u52a8\u6001\u7684\u5173\u952e\u70b9\u4f4d\u4e8e\u79fb\u52a8\u7269\u4f53\u7684\u8fb9\u754c\u4e0a\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5f15\u8d77\u95ee\u9898\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u6240\u63d0\u4f9b\u7684\u4fe1\u606f\u3002 \u5982\u679c\u4e00\u4e2a\u5173\u952e\u70b9\u88ab\u8bbe\u5b9a\u4e3a\u52a8\u6001\uff0c\u4f46\u5728\u6df1\u5ea6\u56fe\u4e2d\u5b83\u5468\u56f4\u7684\u533a\u57df\u6709\u5f88\u5927\u7684\u65b9\u5dee\uff0c\u6211\u4eec\u5c31\u628a\u6807\u7b7e\u6539\u4e3a\u9759\u6001\u3002 \u4e3a\u4e86\u627e\u5230\u52a8\u6001\u7269\u4f53\u7684\u6240\u6709\u50cf\u7d20\u70b9\uff0c\u5728\u6df1\u5ea6\u56fe\u7684\u52a8\u6001\u70b9\u5468\u56f4\u8fdb\u884c\u533a\u57df\u589e\u957f\u7b97\u6cd5\u3002 \u8fd9\u4e24\u79cd\u65b9\u6cd5\u5448\u73b0\u51fa\u529f\u80fd\u4e0a\u7684\u4e92\u8865\uff0c\u6240\u4ee5\u6700\u7ec8\u53d6\u4e86\u4e24\u4e2aMask\u7684\u5e76\u96c6\uff0c\u88ab\u5206\u5272\u7684\u52a8\u6001\u90e8\u5206\u88ab\u4ece\u5f53\u524d\u5e27\u548c\u5730\u56fe\u4e2d\u79fb\u9664\uff1a \u591a\u89c6\u56fe\u51e0\u4f55 \uff1a\u80fd\u8bc6\u522b\u51fa\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u4f46\u9700\u8981\u6709\u591a\u89c6\u56fe\u624d\u80fd\u8fdb\u884c\u521d\u59cb\u5316\u3002\u5728\u56fe4a\u4e2d\u770b\u5230\uff0c\u4e0d\u4ec5\u68c0\u6d4b\u5230\u4e86\u56fe\u50cf\u524d\u9762\u7684\u4eba\uff0c\u800c\u4e14\u8fd8\u68c0\u6d4b\u5230\u4e86\u4ed6\u6240\u62ff\u7684\u4e66\u548c\u4ed6\u6240\u5750\u7684\u6905\u5b50\uff1b\u4f46\u662f\u8fdc\u5904\u7684\u4eba\u5e76\u6ca1\u6709\u88ab\u68c0\u6d4b\u5230\uff0c\u539f\u56e0\u6709\u4e8c\uff1aRGB-D\u76f8\u673a\u5728\u6d4b\u91cf\u8fdc\u5904\u7269\u4f53\u7684\u6df1\u5ea6\u65f6\u4f1a\u6709\u56f0\u96be\uff1b\u5176\u6b21\uff0c\u53ef\u9760\u7684\u7279\u5f81\u4f4d\u4e8e\u786e\u5b9a\u7684\uff0c\u56e0\u6b64\u662f\u9644\u8fd1\u7684\u56fe\u50cf\u90e8\u5206\u3002 \u6df1\u5ea6\u5b66\u4e60 \uff1a\u53ea\u80fd\u8bc6\u522b\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u6ca1\u6709\u521d\u59cb\u5316\u65b9\u9762\u7684\u95ee\u9898\u3002\u53ef\u4ee5\u5728\u56fe4b\u770b\u5230\uff0c\u53ea\u6709\u4e24\u4e2a\u4eba\u88ab\u68c0\u6d4b\u4e3a\u52a8\u6001\u7269\u4f53\uff0c\u800c\u4e14\u5206\u5272\u4e5f\u4e0d\u592a\u51c6\u786e\uff1b\u800c\u6d6e\u52a8\u7684\u4e66\u4f1a\u88ab\u7559\u5728\u56fe\u50cf\u4e2d\uff0c\u5e76\u9519\u8bef\u5730\u6210\u4e3a\u4e09\u7ef4\u5730\u56fe\u7684\u4e00\u90e8\u5206\u3002","title":"Segmentation of Dynamic Content using Mask R-CNN and Multi-view Geometry"},{"location":"cv/papers/dynamic-slam/dynaslam/#tracking-and-mapping","text":"\u8fd9\u4e00\u6b65\u4e2d\uff0c\u7cfb\u7edf\u7684\u8f93\u5165\u662f\uff1aRGB\u56fe\uff0c\u6df1\u5ea6\u56fe\u50cf\uff0c\u5206\u5272\u7684Mask\u3002 \u5728\u56fe\u50cf\u4e2d\u63d0\u53d6\u51fa\u7684ORB\u7279\u5f81\u70b9\u90fd\u88ab\u6807\u8bb0\u4e3a\u9759\u6001\u70b9\uff0c \u5982\u679c\u7279\u5f81\u70b9\u843d\u5728\u4e86\u5206\u5272\u8f6e\u5ed3\u5468\u56f4\uff08\u9ad8\u68af\u5ea6\u533a\u57df\uff09\uff0c\u5c31\u4f1a\u88ab\u79fb\u9664\u3002","title":"Tracking and Mapping"},{"location":"cv/papers/dynamic-slam/dynaslam/#background-inpainting","text":"\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u88ab\u79fb\u9664\u7684\u52a8\u6001\u7269\u4f53\uff0c\u5e0c\u671b\u80fd\u7528\u4e4b\u524d\u89c6\u56fe\u4e2d\u7684\u9759\u6001\u4fe1\u606f\u6765\u8865\u5168\u4e22\u5931\u7684\u80cc\u666f\u4fe1\u606f\uff08\u88ab\u52a8\u6001\u7269\u4f53\u906e\u6321\u4e86\u7684\u90e8\u5206\uff09\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5408\u6210\u4e00\u4e2a\u6ca1\u6709\u79fb\u52a8\u7269\u4f53\u7684\u56fe\u50cf\u3002 \u7531\u4e8e\u6211\u4eec\u77e5\u9053\u524d\u4e00\u5e27\u548c\u5f53\u524d\u5e27\u7684\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e9b\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff08\u6b64\u5904\u8bbe\u7f6e\u4e3a\u524d20\u4e2a\uff09\u7684RGB\u548c\u6df1\u5ea6\u56fe\u6295\u5f71\u5230\u5f53\u524d\u5e27\u7684\u52a8\u6001\u533a\u57df\uff1a \u6709\u4e9b\u7a7a\u9699\u6ca1\u6709\u5bf9\u5e94\u5173\u7cfb\uff0c\u88ab\u7559\u4e3a\u7a7a\u767d \u6709\u4e9b\u533a\u57df\u4e0d\u80fd\u88ab\u8865\u5168\uff0c\u56e0\u4e3a\u5176\u5bf9\u5e94\u7684\u573a\u666f\u90e8\u5206\u5230\u76ee\u524d\u8fd8\u6ca1\u51fa\u73b0\u5728\u5173\u952e\u5e27\u4e2d \u5982\u679c\u5b83\u51fa\u73b0\u4e86\uff0c\u4f46\u6ca1\u6709\u6709\u6548\u7684\u6df1\u5ea6\u4fe1\u606f\u3002\u8fd9\u4e9b\u7a7a\u9699\u4e5f\u4e0d\u80fd\u7528\u51e0\u4f55\u65b9\u6cd5\u6765\u91cd\u5efa\uff0c\u800c\u9700\u8981\u4e00\u79cd\u66f4\u590d\u6742\u7684\u6d82\u62b9\u6280\u672f\u3002 \u4ece\u4e0b\u9762\u7684\u56fe5\u53ef\u4ee5\u770b\u5230\u5927\u90e8\u5206\u88ab\u5206\u5272\u7684\u90e8\u5206\u5df2\u7ecf\u7528\u6765\u81ea\u9759\u6001\u80cc\u666f\u7684\u4fe1\u606f\u8fdb\u884c\u4e86\u9002\u5f53\u7684\u8865\u5168\u3002","title":"Background Inpainting"},{"location":"cv/papers/dynamic-slam/dynaslam/#experimental-results","text":"\u7565\u3002","title":"EXPERIMENTAL RESULTS"},{"location":"cv/papers/dynamic-slam/flowfusion/","text":"FlowFusion \u00b6 \u7ea6 861 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a FlowFusion: Dynamic Dense RGB-D SLAM Based on Optical Flow Introduction \u00b6 \u57fa\u4e8e\u6d41\u7684\u52a8\u6001/\u9759\u6001\u5206\u5272\u6765\u5904\u7406\u52a8\u6001SLAM\u95ee\u9898\u3002 \u63d0\u4f9b\u4e86\u4e00\u79cd\u65b0\u9896\u7684\u57fa\u4e8e\u5149\u6d41\u6b8b\u5dee\u7684\u52a8\u6001\u5206\u5272\u548c\u5bc6\u96c6\u878d\u5408RGB-D SLAM\u65b9\u6848\u3002 \u901a\u8fc7\u6539\u5584\u52a8\u6001\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u5728\u5f53\u524dRGB-D\u5e27\u4e2d\u6709\u6548\u5730\u63d0\u53d6\u52a8\u6001\u7247\u6bb5\uff0c\u7136\u540e\u51c6\u786e\u5730\u91cd\u5efa\u9759\u6001\u73af\u5883\u3002 RELATED WORKS \u00b6 KinectFusion \u548c ElasticFusion\uff08EF\uff09 \u5b9e\u65f6\u91cd\u5efa\u9759\u6001\u5ba4\u5185\u73af\u5883\u3002 Co-Fusion\uff08CF\uff09\u662f\u4e00\u4e2a\u5b9e\u65f6\u7269\u4f53\u5206\u5272\u548c\u8ffd\u8e2a\u65b9\u6cd5\uff0c\u7ed3\u5408\u4e86\u57fa\u4e8e\u5206\u5c42\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u5272\u65b9\u6cd5\u548c EF \u7684\u9759\u6001\u7a20\u5bc6\u91cd\u5efa\u6846\u67b6\u3002 \u9664\u4e86\u8bed\u4e49\u6807\u8bb0\u89e3\u51b3\u65b9\u6848\u5916\uff0c\u8fd8\u6709\u4ece\u7a20\u5bc6\u7684 RGB-D \u878d\u5408\u65b9\u6848\u4e2d\u627e\u51fa\u52a8\u6001\u70b9\u4e91\u4f5c\u4e3a\u5f02\u5e38\u503c\u3002\u4f8b\u5982\u8054\u5408\u8fd0\u52a8\u5206\u5272\u548c\u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff08JF\uff09\uff0c\u4ee5\u53ca\u4e00\u79cd\u9759\u6001\u80cc\u666f\u91cd\u5efa\u65b9\u6cd5\uff08SF\uff09\u3002 \u5229\u7528\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u76ee\u6807\u68c0\u6d4b\u65b9\u6cd5\uff0c\u901a\u8fc7\u9884\u5904\u7406\u53bb\u9664\u6f5c\u5728\u7684\u52a8\u6001\u7269\u4f53\uff0c\u7136\u540e\u91cd\u5efa\u73af\u5883\u3002\u4f8b\u5982 PoseFusion\uff08PF\uff09\u3002 \u5c06\u73af\u5883\u52a8\u6001\u5c5e\u6027\u5b9a\u4e49\u4e3a\u8bed\u4e49\u6982\u5ff5\uff0c\u5e76\u5229\u7528 SLAM \u5de5\u5177\u89e3\u51b3\u3002\u4f8b\u5982\u4e00\u79cd\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684 3D \u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u7ed3\u5408\u4e86\u4e24\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u3002 OPTICAL FLOW BASED JOINT DYNAMIC SEGMENTATION AND DENSE FUSION \u00b6 Visual Odometry in Dense RGB-D Fusion \u00b6 \u8f93\u5165\u4e24\u4e2a\u8fde\u7eed\u7684 RGB-D \u5e27 A \u548c B\uff0cRGB \u56fe\u50cf\u9996\u5148\u88ab\u9988\u9001\u5230 PWC-net \u7528\u4e8e\u5149\u6d41\u4f30\u8ba1\u3002 \u5f3a\u5ea6\u548c\u6df1\u5ea6\u5bf9 A \u548c B \u88ab\u9988\u9001\u5230\u9c81\u68d2\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u4f30\u8ba1\u5668\uff0c\u4ee5\u521d\u59cb\u5316\u76f8\u673a\u8fd0\u52a8 Optical Flow Residual Estimated by Projecting the Scene Flow \u00b6 \u901a\u8fc7\u8ba1\u7b97\u6bcf\u4e2a\u7c07\u7684\u5e73\u5747\u6b8b\u5dee\u6765\u533a\u5206\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53 \u4f8b\u5982\u80cc\u666f\u4e0d\u79fb\u52a8\uff0c\u56e0\u6b64\u5b83\u4eec\u7684\u6b8b\u5dee\u8f83\u4f4e \u52a8\u6001\u7269\u4f53\u7684\u6b8b\u5dee\u8f83\u9ad8 \u6df1\u5ea6\u548c\u5f3a\u5ea6\u7684\u6b8b\u5dee\u4e0d\u662f\u4e00\u4e2a\u597d\u7684\u6307\u6807\uff0c\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528\u573a\u666f\u6d41\u8bc4\u4f30\u79fb\u52a8\u70b9\u4e91 \u4e3a\u4e86\u6446\u8131\u76f8\u673a\u7684\u81ea\u8eab\u8fd0\u52a8\uff0c\u5f15\u5165\u4e86\u5149\u6d41\u6b8b\u5dee\u7684\u6982\u5ff5\uff0c\u88ab\u5b9a\u4e49\u4e3a\u6295\u5f71\u7684 2D \u573a\u666f\u6d41\uff0c\u4ee5\u7a81\u51fa\u50cf\u7d20\u7684\u52a8\u6001\u5c5e\u6027\u3002 \u4e0b\u56fe\u662f\u6295\u5f71\u7684 2D \u573a\u666f\u5728\u56fe\u50cf\u5e73\u9762\u4e2d\u6d41\u52a8 \\(x^p\\) \u662f\u5e27 A \u4e2d\u7684\u4e00\u4e2a\u5bf9\u8c61\u70b9\u6295\u5f71\u50cf\u7d20 \\(x^q\\) \u662f\u5e27 B \u4e2d\u7684\u540c\u4e00\u4e2a 3D \u70b9\uff08\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\uff09 \u7ea2\u8272\u7bad\u5934\u8868\u793a\u573a\u666f\u6d41\uff08\u4e16\u754c\u7a7a\u95f4\u8fd0\u52a8\uff09 \u84dd\u8272\u7bad\u5934\u662f \\(x^{a \\to b}\\) \u4e2d\u7684\u5149\u6d41 \u7eff\u8272\u7bad\u5934 \\(x^{sf}\\) \u662f\u56fe\u50cf\u5e73\u9762\u4e2d\u6295\u5f71\u7684 2D \u573a\u666f\u6d41 \\(x^e\\) \u662f\u6444\u50cf\u673a\u81ea\u8eab\u8fd0\u52a8\u4ea7\u751f\u7684\u6d41 \u4e0b\u56fe\u662f\u8fed\u4ee3\u4f30\u8ba1\u52a8\u6001\u573a\u666f\u4e2d\u76842D\u573a\u666f\u6d41.(a)\u662f\u673a\u5668\u4eba\u5411\u5de6\u79fb\u52a8\u800c\u4eba\u7c7b\u5411\u53f3\u79fb\u52a8\u7684\u573a\u666f.(b)\u662f\u6839\u636e(a)\u7684\u56fe\u50cf\u5bf9\u4f30\u8ba1\u7684\u5149\u6d41.\u989c\u8272\u8868\u793a\u6d41\u52a8\u65b9\u5411,\u5f3a\u5ea6\u8868\u793a\u50cf\u7d20\u4f4d\u79fb.\u84dd\u8272\u7684\u6d41\u52a8\u662f\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u7684\u7ed3\u679c.\u6211\u4eec\u4ece\u5149\u6d41\u4e2d\u51cf\u53bb\u81ea\u6211\u6d41,\u5f97\u5230\u50cf\u5e73\u9762\u4e0a\u7684\u573a\u666f\u6d41\u5206\u91cf,\u5982(c)\u6240\u793a.\u5728(b)\u4e2d\u8fed\u4ee3\u5730\u79fb\u9664\u573a\u666f\u6d41\u548c \\(x^e\\) \u57287\u6b21\u8fed\u4ee3\u4e4b\u540e\u5c31\u53ef\u4ee5\u83b7\u5f97\u66f4\u597d\u76842D\u573a\u666f\u6d41\u7ed3\u679c,\u5982(d). Dynamic Clusters Segmentation \u00b6 \u5df2\u7ecf\u5b9a\u4e49\u4e86\u4e09\u4e2a\u6b8b\u5dee \\(r_I, r_D, r_F\\) \uff0c\u5206\u522b\u8868\u793a\u4e3a\u5f3a\u5ea6\u3001\u6df1\u5ea6\u548c\u5149\u6d41 \u901a\u8fc7\u4e24\u6b65\u6765\u533a\u5206\u7c07\u662f\u5426\u4e3a\u52a8\u6001\u800c\u4e0d\u4f9d\u9760\u5e73\u5747\u6b8b\u5dee \u8ba1\u7b97\u4e00\u4e2a\u6307\u6807\u6765\u7ec4\u5408\u8fd9\u4e09\u4e2a\u6b8b\u5dee \u8bbe\u8ba1\u4e00\u4e2a\u6700\u5c0f\u5316\u51fd\u6570\u6765\u9650\u5b9a\u7c07\u7684\u52a8\u6001\u7c7b\u522b DYNAMIC SLAM EXPERIMENTS AND EVALUATIONS \u00b6 \u7565\u3002","title":"FlowFusion"},{"location":"cv/papers/dynamic-slam/flowfusion/#flowfusion","text":"\u7ea6 861 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a FlowFusion: Dynamic Dense RGB-D SLAM Based on Optical Flow","title":"FlowFusion"},{"location":"cv/papers/dynamic-slam/flowfusion/#introduction","text":"\u57fa\u4e8e\u6d41\u7684\u52a8\u6001/\u9759\u6001\u5206\u5272\u6765\u5904\u7406\u52a8\u6001SLAM\u95ee\u9898\u3002 \u63d0\u4f9b\u4e86\u4e00\u79cd\u65b0\u9896\u7684\u57fa\u4e8e\u5149\u6d41\u6b8b\u5dee\u7684\u52a8\u6001\u5206\u5272\u548c\u5bc6\u96c6\u878d\u5408RGB-D SLAM\u65b9\u6848\u3002 \u901a\u8fc7\u6539\u5584\u52a8\u6001\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u5728\u5f53\u524dRGB-D\u5e27\u4e2d\u6709\u6548\u5730\u63d0\u53d6\u52a8\u6001\u7247\u6bb5\uff0c\u7136\u540e\u51c6\u786e\u5730\u91cd\u5efa\u9759\u6001\u73af\u5883\u3002","title":"Introduction"},{"location":"cv/papers/dynamic-slam/flowfusion/#related-works","text":"KinectFusion \u548c ElasticFusion\uff08EF\uff09 \u5b9e\u65f6\u91cd\u5efa\u9759\u6001\u5ba4\u5185\u73af\u5883\u3002 Co-Fusion\uff08CF\uff09\u662f\u4e00\u4e2a\u5b9e\u65f6\u7269\u4f53\u5206\u5272\u548c\u8ffd\u8e2a\u65b9\u6cd5\uff0c\u7ed3\u5408\u4e86\u57fa\u4e8e\u5206\u5c42\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u5272\u65b9\u6cd5\u548c EF \u7684\u9759\u6001\u7a20\u5bc6\u91cd\u5efa\u6846\u67b6\u3002 \u9664\u4e86\u8bed\u4e49\u6807\u8bb0\u89e3\u51b3\u65b9\u6848\u5916\uff0c\u8fd8\u6709\u4ece\u7a20\u5bc6\u7684 RGB-D \u878d\u5408\u65b9\u6848\u4e2d\u627e\u51fa\u52a8\u6001\u70b9\u4e91\u4f5c\u4e3a\u5f02\u5e38\u503c\u3002\u4f8b\u5982\u8054\u5408\u8fd0\u52a8\u5206\u5272\u548c\u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff08JF\uff09\uff0c\u4ee5\u53ca\u4e00\u79cd\u9759\u6001\u80cc\u666f\u91cd\u5efa\u65b9\u6cd5\uff08SF\uff09\u3002 \u5229\u7528\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u76ee\u6807\u68c0\u6d4b\u65b9\u6cd5\uff0c\u901a\u8fc7\u9884\u5904\u7406\u53bb\u9664\u6f5c\u5728\u7684\u52a8\u6001\u7269\u4f53\uff0c\u7136\u540e\u91cd\u5efa\u73af\u5883\u3002\u4f8b\u5982 PoseFusion\uff08PF\uff09\u3002 \u5c06\u73af\u5883\u52a8\u6001\u5c5e\u6027\u5b9a\u4e49\u4e3a\u8bed\u4e49\u6982\u5ff5\uff0c\u5e76\u5229\u7528 SLAM \u5de5\u5177\u89e3\u51b3\u3002\u4f8b\u5982\u4e00\u79cd\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684 3D \u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u7ed3\u5408\u4e86\u4e24\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u3002","title":"RELATED WORKS"},{"location":"cv/papers/dynamic-slam/flowfusion/#optical-flow-based-joint-dynamic-segmentation-and-dense-fusion","text":"","title":"OPTICAL FLOW BASED JOINT DYNAMIC SEGMENTATION AND DENSE FUSION"},{"location":"cv/papers/dynamic-slam/flowfusion/#visual-odometry-in-dense-rgb-d-fusion","text":"\u8f93\u5165\u4e24\u4e2a\u8fde\u7eed\u7684 RGB-D \u5e27 A \u548c B\uff0cRGB \u56fe\u50cf\u9996\u5148\u88ab\u9988\u9001\u5230 PWC-net \u7528\u4e8e\u5149\u6d41\u4f30\u8ba1\u3002 \u5f3a\u5ea6\u548c\u6df1\u5ea6\u5bf9 A \u548c B \u88ab\u9988\u9001\u5230\u9c81\u68d2\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u4f30\u8ba1\u5668\uff0c\u4ee5\u521d\u59cb\u5316\u76f8\u673a\u8fd0\u52a8","title":"Visual Odometry in Dense RGB-D Fusion"},{"location":"cv/papers/dynamic-slam/flowfusion/#optical-flow-residual-estimated-by-projecting-the-scene-flow","text":"\u901a\u8fc7\u8ba1\u7b97\u6bcf\u4e2a\u7c07\u7684\u5e73\u5747\u6b8b\u5dee\u6765\u533a\u5206\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53 \u4f8b\u5982\u80cc\u666f\u4e0d\u79fb\u52a8\uff0c\u56e0\u6b64\u5b83\u4eec\u7684\u6b8b\u5dee\u8f83\u4f4e \u52a8\u6001\u7269\u4f53\u7684\u6b8b\u5dee\u8f83\u9ad8 \u6df1\u5ea6\u548c\u5f3a\u5ea6\u7684\u6b8b\u5dee\u4e0d\u662f\u4e00\u4e2a\u597d\u7684\u6307\u6807\uff0c\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528\u573a\u666f\u6d41\u8bc4\u4f30\u79fb\u52a8\u70b9\u4e91 \u4e3a\u4e86\u6446\u8131\u76f8\u673a\u7684\u81ea\u8eab\u8fd0\u52a8\uff0c\u5f15\u5165\u4e86\u5149\u6d41\u6b8b\u5dee\u7684\u6982\u5ff5\uff0c\u88ab\u5b9a\u4e49\u4e3a\u6295\u5f71\u7684 2D \u573a\u666f\u6d41\uff0c\u4ee5\u7a81\u51fa\u50cf\u7d20\u7684\u52a8\u6001\u5c5e\u6027\u3002 \u4e0b\u56fe\u662f\u6295\u5f71\u7684 2D \u573a\u666f\u5728\u56fe\u50cf\u5e73\u9762\u4e2d\u6d41\u52a8 \\(x^p\\) \u662f\u5e27 A \u4e2d\u7684\u4e00\u4e2a\u5bf9\u8c61\u70b9\u6295\u5f71\u50cf\u7d20 \\(x^q\\) \u662f\u5e27 B \u4e2d\u7684\u540c\u4e00\u4e2a 3D \u70b9\uff08\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\uff09 \u7ea2\u8272\u7bad\u5934\u8868\u793a\u573a\u666f\u6d41\uff08\u4e16\u754c\u7a7a\u95f4\u8fd0\u52a8\uff09 \u84dd\u8272\u7bad\u5934\u662f \\(x^{a \\to b}\\) \u4e2d\u7684\u5149\u6d41 \u7eff\u8272\u7bad\u5934 \\(x^{sf}\\) \u662f\u56fe\u50cf\u5e73\u9762\u4e2d\u6295\u5f71\u7684 2D \u573a\u666f\u6d41 \\(x^e\\) \u662f\u6444\u50cf\u673a\u81ea\u8eab\u8fd0\u52a8\u4ea7\u751f\u7684\u6d41 \u4e0b\u56fe\u662f\u8fed\u4ee3\u4f30\u8ba1\u52a8\u6001\u573a\u666f\u4e2d\u76842D\u573a\u666f\u6d41.(a)\u662f\u673a\u5668\u4eba\u5411\u5de6\u79fb\u52a8\u800c\u4eba\u7c7b\u5411\u53f3\u79fb\u52a8\u7684\u573a\u666f.(b)\u662f\u6839\u636e(a)\u7684\u56fe\u50cf\u5bf9\u4f30\u8ba1\u7684\u5149\u6d41.\u989c\u8272\u8868\u793a\u6d41\u52a8\u65b9\u5411,\u5f3a\u5ea6\u8868\u793a\u50cf\u7d20\u4f4d\u79fb.\u84dd\u8272\u7684\u6d41\u52a8\u662f\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u7684\u7ed3\u679c.\u6211\u4eec\u4ece\u5149\u6d41\u4e2d\u51cf\u53bb\u81ea\u6211\u6d41,\u5f97\u5230\u50cf\u5e73\u9762\u4e0a\u7684\u573a\u666f\u6d41\u5206\u91cf,\u5982(c)\u6240\u793a.\u5728(b)\u4e2d\u8fed\u4ee3\u5730\u79fb\u9664\u573a\u666f\u6d41\u548c \\(x^e\\) \u57287\u6b21\u8fed\u4ee3\u4e4b\u540e\u5c31\u53ef\u4ee5\u83b7\u5f97\u66f4\u597d\u76842D\u573a\u666f\u6d41\u7ed3\u679c,\u5982(d).","title":"Optical Flow Residual Estimated by Projecting the Scene Flow"},{"location":"cv/papers/dynamic-slam/flowfusion/#dynamic-clusters-segmentation","text":"\u5df2\u7ecf\u5b9a\u4e49\u4e86\u4e09\u4e2a\u6b8b\u5dee \\(r_I, r_D, r_F\\) \uff0c\u5206\u522b\u8868\u793a\u4e3a\u5f3a\u5ea6\u3001\u6df1\u5ea6\u548c\u5149\u6d41 \u901a\u8fc7\u4e24\u6b65\u6765\u533a\u5206\u7c07\u662f\u5426\u4e3a\u52a8\u6001\u800c\u4e0d\u4f9d\u9760\u5e73\u5747\u6b8b\u5dee \u8ba1\u7b97\u4e00\u4e2a\u6307\u6807\u6765\u7ec4\u5408\u8fd9\u4e09\u4e2a\u6b8b\u5dee \u8bbe\u8ba1\u4e00\u4e2a\u6700\u5c0f\u5316\u51fd\u6570\u6765\u9650\u5b9a\u7c07\u7684\u52a8\u6001\u7c7b\u522b","title":"Dynamic Clusters Segmentation"},{"location":"cv/papers/dynamic-slam/flowfusion/#dynamic-slam-experiments-and-evaluations","text":"\u7565\u3002","title":"DYNAMIC SLAM EXPERIMENTS AND EVALUATIONS"},{"location":"cv/papers/dynamic-slam/rigidfusion/","text":"RigidFusion \u00b6 \u7ea6 1358 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a RigidFusion: Robot Localisation and Mapping in Environments with Large Dynamic Rigid Objects INTRODUCTION \u00b6 \u5728\u771f\u5b9e\u7684 SLAM \u573a\u666f\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5728\u9047\u5230\u5927\u91cf\u52a8\u6001\u969c\u788d\u7269\u7684\u573a\u666f\u65f6\u5019\uff0c\u7279\u522b\u5bb9\u6613\u9020\u6210\u8ddf\u4e22\u7684\u95ee\u9898\u3002\u4f20\u7edf\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\u901a\u8fc7\u5c06\u52a8\u6001\u969c\u788d\u7269\u6ee4\u9664\uff0c\u800c\u672c\u6587\u4e2d\u63d0\u5230\u5c06\u52a8\u6001\u7269\u4f53\u770b\u505a\u521a\u4f53\u8fdb\u884c\u8ddf\u8e2a\u3002 \u6587\u4e2d\u63d0\u51fa\u4e00\u79cd\u65b0\u7684 RGB-D SLAM \u65b9\u6cd5\uff0c\u53ef\u4ee5\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u53ef\u80fd\u906e\u6321\u76f8\u673a\u89c6\u91ce\u4e3b\u8981\u90e8\u5206\u7684\u5927\u578b\u52a8\u6001\u521a\u6027\u7269\u4f53\u3002\u4e4b\u524d\u7684\u65b9\u6cd5\u5c06\u573a\u666f\u7684 \u52a8\u6001\u90e8\u5206\u89c6\u4e3a\u5f02\u5e38\u503c\uff0c\u56e0\u6b64\u5c40\u9650\u4e8e\u573a\u666f\u4e2d\u7684\u5c11\u91cf\u53d8\u5316 \uff0c\u6216\u4f9d\u8d56\u573a\u666f\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u4ee5\u5b9e\u73b0\u9c81\u68d2\u7684\u6444\u50cf\u673a\u8ddf\u8e2a\u3002 \u672c\u6587\u63d0\u51fa\u5c06\u6240\u6709\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u4e00\u4e2a\u521a\u4f53\uff0c\u540c\u65f6\u5206\u5272\u548c\u8ddf\u8e2a\u9759\u6001\u548c\u52a8\u6001\u90e8\u4ef6\u3002 \u56e0\u6b64\uff0c\u5728\u52a8\u6001\u5bf9\u8c61\u9020\u6210\u5927\u906e\u6321\u7684\u73af\u5883\u4e2d\uff0c\u80fd\u591f\u540c\u65f6\u5b9a\u4f4d\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u521a\u6027\u52a8\u6001\u7ec4\u4ef6\u3002 Info \u4e00\u4e2a\u65b0\u7684SLAM\u6846\u67b6\uff0c\u4f7f\u7528RGB-D\u6444\u50cf\u5934\uff0c\u5728\u6574\u4e2aSLAM\u6846\u67b6\u4e2d\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u573a\u666f\uff0c\u901a\u8fc7\u5177\u6709\u6f5c\u5728\u6f02\u79fb\u7684\u8fd0\u52a8\u5148\u9a8c\u6765\u5b8c\u6210\u9759\u6001\u80cc\u666f\u548c\u4e00\u4e2a\u52a8\u6001\u521a\u4f53\u7684\u6784\u5efa\u3002 \u4f7f\u7528\u7a20\u5bc6SLAM\u5efa\u56fe\u7684\u65b9\u6cd5\uff0c\u5bf9\u89c6\u89c9\u8f93\u5165\u4e2d\u7684\u5927\u578b\u52a8\u6001\u906e\u6321(\u8d85\u8fc7\u89c6\u91ce\u768465%)\u5177\u6709\u9c81\u68d2\u6027\u3002\u540c\u65f6\u8be5SLAM\u6a21\u578b\u4e0d\u4f9d\u8d56\u9759\u6001\u548c\u52a8\u6001\u6a21\u578b\u7684\u521d\u59cb\u5316; \u63d0\u4f9b\u4e00\u4e2a\u65b0\u7684RGB-D SLAM\u6570\u636e\u96c6\uff0c\u6570\u636e\u96c6\u4e2d\u5305\u62ec\u5177\u6709\u5728\u573a\u666f\u4e2d\u9020\u6210\u5927\u906e\u6321\u7684\u52a8\u6001\u5bf9\u8c61\u548c\u771f\u5b9e\u8f68\u8ff9\u3002 RELATED WORK \u00b6 \u52a8\u6001\u89c6\u89c9SLAM\u6216\u89c6\u89c9\u91cc\u7a0b\u8ba1\u65b9\u6cd5\u53ef\u4ee5\u5206\u4e3a \u76f4\u63a5\u3001\u95f4\u63a5\u6216\u591a\u8fd0\u52a8\u91cc\u7a0b\u8ba1\u65b9\u6cd5 \u3002 \u673a\u5668\u4eba\u672c\u4f53\u611f\u77e5\u8fd8\u53ef\u7528\u4e8e\u652f\u6301\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b9a\u4f4d\u3002 \u76f4\u63a5\u6cd5 \uff1a\u9700\u8981\u5bf9\u573a\u666f\u4e2d\u7684\u5bf9\u8c61\u6709\u5145\u5206\u7684\u4e86\u89e3\uff0c\u5982\u679c\u672a\u68c0\u6d4b\u5230\u52a8\u6001\u5bf9\u8c61\uff0c\u5219\u5931\u8d25\u3002 \u95f4\u63a5\u6cd5 \uff1a\u5f53\u52a8\u6001\u5bf9\u8c61\u6210\u4e3a\u4e3b\u8981\u90e8\u5206\u662f\u65e0\u6cd5\u5904\u7406\u56fe\u50cf\u3002 OVERVIEW \u00b6 \u672c\u6587\u63d0\u51fa\u4e00\u79cd SLAM \u6846\u67b6\uff0c\u5c06\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u5355\u4e2a\u521a\u4f53\uff0c\u5229\u7528\u8fd0\u52a8\u5148\u9a8c\u5206\u5272\u9759\u6001\u90e8\u4ef6\u548c\u52a8\u6001\u90e8\u4ef6\u3002\u5229\u7528\u5206\u5272\u540e\u7684\u56fe\u50cf\u5bf9\u6444\u50cf\u673a\u8fdb\u884c\u8ddf\u8e2a\uff0c\u91cd\u5efa\u80cc\u666f\u548c\u76ee\u6807\u6a21\u578b\u3002 \u91cd\u5efa\u6d41\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u9996\u5148\u9700\u8981\u8fde\u7eed\u4e24\u4e2a RGB-D \u5173\u952e\u5e27 A \u548c B\uff0c\u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\u53ca \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u662f\u5c5e\u4e8e \\(se(3)\\) \u7684\uff0c\u6b64\u5916\u8fd8\u9700\u8981\u524d\u4e00\u5e27\u7684\u8bed\u4e49\u5206\u5272\u4fe1\u606f \\(\\widetilde{\\Gamma}_A \\in \\mathbb{R}^{W \\times H}\\) \u3002\u9996\u5148\u6839\u636e\u8fd0\u52a8\u5148\u9a8c\u4fe1\u606f\u68c0\u6d4b\u7269\u4f53\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53\uff1b\u7136\u540e\u5f53\u7269\u4f53\u8fd0\u52a8\u65f6\uff0c\u57fa\u4e8e\u5e27\u95f4\u5bf9\u5176\uff0c\u6211\u4eec\u8054\u5408\u4f30\u8ba1\u5206\u5272 \\(\\widetilde{\\Gamma}_B\\) \u548c \u521a\u4f53\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002\u8fd9\u4e9b\u7247\u6bb5\u7528\u4e8e\u91cd\u5efa\u9759\u6001\u73af\u5883\u548c\u52a8\u6001\u5bf9\u8c61\uff0c\u5e76\u5229\u7528\u5e27\u4e0e\u6a21\u578b\u7684\u5bf9\u5176\u5b9e\u73b0\u6444\u50cf\u673a\u7684\u5b9a\u4f4d\u3002 \u56fe\u50cf\u805a\u5408 \u00b6 \u6bcf\u4e2a\u65b0\u7684\u5f3a\u5ea6\u548c\u6df1\u5ea6\u56fe\u50cf \\((I,D) \\in \\mathbb{R}^{W \\times H}\\) \u5bf9\u901a\u8fc7\u4f7f\u7528 K-\u5747\u503c\u805a\u7c7b\uff0c\u88ab\u5206\u5272\u6210 K \u4e2a\u51e0\u4f55\u7c07 \\(V=V_i|i=1,...,K\\) \u3002\u5047\u8bbe\u6bcf\u4e2a\u7c07\u6ee1\u8db3\u521a\u6027\u6761\u4ef6\uff0c\u6bcf\u4e2a\u521a\u4f53\u53ef\u4ee5\u901a\u8fc7\u7c07\u7684\u7ec4\u5408\u6765\u8fd1\u4f3c\u3002\u540c\u65f6\u6587\u4e2d\u8fd8\u4e3a\u6bcf\u4e2a\u96c6\u7fa4\u5206\u914d\u4e00\u4e2a\u5206\u6570 \\(\\gamma_u \\in [0,1]\\) \u8868\u793a\u7c07\u662f\u5426\u5c5e\u4e8e\u9759\u6001\u521a\u4f53\u7684\u6982\u7387\uff1b \\(\\gamma_i=0\\) \u8868\u793a\u52a8\u6001\u7c07\uff0c\u800c \\(\\gamma_i=1\\) \u8868\u793a\u9759\u6001\u7c07\u3002\u5bf9\u4e8e RGB-D \u5e27 A\uff0c\u5c06\u603b\u4f53\u5206\u6570\u8868\u793a\u4e3a \\(\\gamma_A \\in \\mathbb{R}^K\\) \u3002 \u8ddd\u79bb\u5224\u65ad \u00b6 \u5982\u679c\u4e24\u4e2a\u8fd0\u52a8\u5148\u9a8c\u4e4b\u95f4\u7684\u5dee \\(||\\widetilde{\\xi}_s -\\widetilde{\\xi}_d||^2\\) \u5c0f\u4e8e\u9608\u503c \\(\\hat{d}\\) \uff0c\u5219\u5c06\u56fe\u50cf\u4e2d\u7684\u6240\u6709\u805a\u7c7b\u89c6\u4e3a\u9759\u6001\u548c\u52a8\u6001\u5206\u5272\u3002\u5426\u5219\u5c06\u5171\u540c\u4f18\u5316\u5f53\u524d\u5e27\u7684\u5206\u6570 \\(\\gamma_B\\) \u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002 \u56fe\u50cf\u5206\u5272 \u00b6 \u4ece\u805a\u7c7b\u548c\u5206\u6570\u4e2d\u8ba1\u7b97\u50cf\u7d20\u7ea7\u5206\u5272 \\(\\widetilde{\\Gamma}_B \\in \\mathbb{R}^{W \\times H}\\) \u3002\u4e0e\u9759\u6001\u878d\u5408\u7c7b\u4f3c\uff0c\u4ece\u5206\u5272\u4e2d\u8ba1\u7b97\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u52a0\u6743 RGB-D \u56fe\u50cf \\(\\widetilde{\\Gamma}_B\\) \u3002\u8fd9\u4e9b\u52a0\u6743\u56fe\u50cf\u7528\u4e8e\u91cd\u5efa\u80cc\u666f\u548c\u52a8\u6001\u76ee\u6807\u7684\u6a21\u578b\uff0c\u5e76\u901a\u8fc7\u5e27-\u6a21\u578b\u5bf9\u5176\u6765\u7ec6\u5316\u4f30\u8ba1\u7684\u76f8\u673a\u59ff\u6001\u3002 \u5750\u6807\u7cfb\u8f6c\u6362 \u00b6 \u5206\u522b\u4ece world-frame\u3001camera-frame \u548c object-frame \u8868\u793a\u4e3a \\(F_W\u3001F_C\u3001F_O\\) \u3002\u4f7f\u7528 \\(T_{XY} \\in SE(3)\\) \u5c06\u5750\u6807\u7cfb \\(F_Y\\) \u4e2d\u67d0\u4e2a\u70b9\u7684\u9f50\u6b21\u5750\u6807\u8f6c\u6362\u4e3a \\(F_X\\) \u3002\u5728\u56fe\u50cf\u5e27 A \u4e2d\uff0c\u76f8\u673a\u548c\u7269\u4f53\u7684\u59ff\u6001\u5206\u522b\u662f \\(T_{WC_A}\\) \u548c \\(T_{WO_A}\\) \u3002\u8003\u8651\u4e24\u4e2a\u56fe\u50cf\u5e27 A \u548c B\uff0c \\(\\xi_s\\) \u4e0e\u6444\u50cf\u673a\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_s)=T_{WC_A}^{-1}T_{WC_B}=T_{C_AC_B}\\) \uff0c\u6c42\u51fa\u673a\u5668\u4eba\u79fb\u52a8\u7684\u4fe1\u606f\uff0c \\(\\xi_d\\) \u4e0e\u6444\u50cf\u673a\u7684\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_d)=T_{WC_A}^{-1}T_{WO_A}T_{WO_B}^{-1}T_{WC_B}=T_{C_AO_A}T_{C_BO_B}^{-1}\\) \uff0c\u6700\u540e\u8f6c\u5316\u4e3a\u76f8\u673a\u548c\u7269\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8\u5173\u7cfb\u3002\u5176\u4e2d \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u53ef\u4ee5\u7531\u672c\u4f53\u611f\u89c9\u4f20\u611f\u5668\u63d0\u4f9b\uff0c\u5982\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u548c\u624b\u81c2\u6b63\u5411\u8fd0\u52a8\u5b66\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u9759\u6001\u8fd0\u52a8\u5148\u9a8c \\(\\widetilde{\\xi}_s\\) \u662f\u901a\u8fc7\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u6216\u901a\u8fc7\u5728\u76f8\u673a\u5730\u9762\u771f\u503c\u8f68\u8ff9\u4e0a\u6dfb\u52a0\u6a21\u62df\u6f02\u79fb\u6765\u8ba1\u7b97\u3002\u901a\u8fc7\u6a21\u62df\u5bf9\u8c61\u771f\u503c\u8f68\u8ff9\u4e0a\u7684\u6f02\u79fb\u6765\u751f\u6210 \\(\\widetilde{\\xi}_d\\) \u3002","title":"RigidFusion"},{"location":"cv/papers/dynamic-slam/rigidfusion/#rigidfusion","text":"\u7ea6 1358 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a RigidFusion: Robot Localisation and Mapping in Environments with Large Dynamic Rigid Objects","title":"RigidFusion"},{"location":"cv/papers/dynamic-slam/rigidfusion/#introduction","text":"\u5728\u771f\u5b9e\u7684 SLAM \u573a\u666f\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5728\u9047\u5230\u5927\u91cf\u52a8\u6001\u969c\u788d\u7269\u7684\u573a\u666f\u65f6\u5019\uff0c\u7279\u522b\u5bb9\u6613\u9020\u6210\u8ddf\u4e22\u7684\u95ee\u9898\u3002\u4f20\u7edf\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\u901a\u8fc7\u5c06\u52a8\u6001\u969c\u788d\u7269\u6ee4\u9664\uff0c\u800c\u672c\u6587\u4e2d\u63d0\u5230\u5c06\u52a8\u6001\u7269\u4f53\u770b\u505a\u521a\u4f53\u8fdb\u884c\u8ddf\u8e2a\u3002 \u6587\u4e2d\u63d0\u51fa\u4e00\u79cd\u65b0\u7684 RGB-D SLAM \u65b9\u6cd5\uff0c\u53ef\u4ee5\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u53ef\u80fd\u906e\u6321\u76f8\u673a\u89c6\u91ce\u4e3b\u8981\u90e8\u5206\u7684\u5927\u578b\u52a8\u6001\u521a\u6027\u7269\u4f53\u3002\u4e4b\u524d\u7684\u65b9\u6cd5\u5c06\u573a\u666f\u7684 \u52a8\u6001\u90e8\u5206\u89c6\u4e3a\u5f02\u5e38\u503c\uff0c\u56e0\u6b64\u5c40\u9650\u4e8e\u573a\u666f\u4e2d\u7684\u5c11\u91cf\u53d8\u5316 \uff0c\u6216\u4f9d\u8d56\u573a\u666f\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u4ee5\u5b9e\u73b0\u9c81\u68d2\u7684\u6444\u50cf\u673a\u8ddf\u8e2a\u3002 \u672c\u6587\u63d0\u51fa\u5c06\u6240\u6709\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u4e00\u4e2a\u521a\u4f53\uff0c\u540c\u65f6\u5206\u5272\u548c\u8ddf\u8e2a\u9759\u6001\u548c\u52a8\u6001\u90e8\u4ef6\u3002 \u56e0\u6b64\uff0c\u5728\u52a8\u6001\u5bf9\u8c61\u9020\u6210\u5927\u906e\u6321\u7684\u73af\u5883\u4e2d\uff0c\u80fd\u591f\u540c\u65f6\u5b9a\u4f4d\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u521a\u6027\u52a8\u6001\u7ec4\u4ef6\u3002 Info \u4e00\u4e2a\u65b0\u7684SLAM\u6846\u67b6\uff0c\u4f7f\u7528RGB-D\u6444\u50cf\u5934\uff0c\u5728\u6574\u4e2aSLAM\u6846\u67b6\u4e2d\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u573a\u666f\uff0c\u901a\u8fc7\u5177\u6709\u6f5c\u5728\u6f02\u79fb\u7684\u8fd0\u52a8\u5148\u9a8c\u6765\u5b8c\u6210\u9759\u6001\u80cc\u666f\u548c\u4e00\u4e2a\u52a8\u6001\u521a\u4f53\u7684\u6784\u5efa\u3002 \u4f7f\u7528\u7a20\u5bc6SLAM\u5efa\u56fe\u7684\u65b9\u6cd5\uff0c\u5bf9\u89c6\u89c9\u8f93\u5165\u4e2d\u7684\u5927\u578b\u52a8\u6001\u906e\u6321(\u8d85\u8fc7\u89c6\u91ce\u768465%)\u5177\u6709\u9c81\u68d2\u6027\u3002\u540c\u65f6\u8be5SLAM\u6a21\u578b\u4e0d\u4f9d\u8d56\u9759\u6001\u548c\u52a8\u6001\u6a21\u578b\u7684\u521d\u59cb\u5316; \u63d0\u4f9b\u4e00\u4e2a\u65b0\u7684RGB-D SLAM\u6570\u636e\u96c6\uff0c\u6570\u636e\u96c6\u4e2d\u5305\u62ec\u5177\u6709\u5728\u573a\u666f\u4e2d\u9020\u6210\u5927\u906e\u6321\u7684\u52a8\u6001\u5bf9\u8c61\u548c\u771f\u5b9e\u8f68\u8ff9\u3002","title":"INTRODUCTION"},{"location":"cv/papers/dynamic-slam/rigidfusion/#related-work","text":"\u52a8\u6001\u89c6\u89c9SLAM\u6216\u89c6\u89c9\u91cc\u7a0b\u8ba1\u65b9\u6cd5\u53ef\u4ee5\u5206\u4e3a \u76f4\u63a5\u3001\u95f4\u63a5\u6216\u591a\u8fd0\u52a8\u91cc\u7a0b\u8ba1\u65b9\u6cd5 \u3002 \u673a\u5668\u4eba\u672c\u4f53\u611f\u77e5\u8fd8\u53ef\u7528\u4e8e\u652f\u6301\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b9a\u4f4d\u3002 \u76f4\u63a5\u6cd5 \uff1a\u9700\u8981\u5bf9\u573a\u666f\u4e2d\u7684\u5bf9\u8c61\u6709\u5145\u5206\u7684\u4e86\u89e3\uff0c\u5982\u679c\u672a\u68c0\u6d4b\u5230\u52a8\u6001\u5bf9\u8c61\uff0c\u5219\u5931\u8d25\u3002 \u95f4\u63a5\u6cd5 \uff1a\u5f53\u52a8\u6001\u5bf9\u8c61\u6210\u4e3a\u4e3b\u8981\u90e8\u5206\u662f\u65e0\u6cd5\u5904\u7406\u56fe\u50cf\u3002","title":"RELATED WORK"},{"location":"cv/papers/dynamic-slam/rigidfusion/#overview","text":"\u672c\u6587\u63d0\u51fa\u4e00\u79cd SLAM \u6846\u67b6\uff0c\u5c06\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u5355\u4e2a\u521a\u4f53\uff0c\u5229\u7528\u8fd0\u52a8\u5148\u9a8c\u5206\u5272\u9759\u6001\u90e8\u4ef6\u548c\u52a8\u6001\u90e8\u4ef6\u3002\u5229\u7528\u5206\u5272\u540e\u7684\u56fe\u50cf\u5bf9\u6444\u50cf\u673a\u8fdb\u884c\u8ddf\u8e2a\uff0c\u91cd\u5efa\u80cc\u666f\u548c\u76ee\u6807\u6a21\u578b\u3002 \u91cd\u5efa\u6d41\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u9996\u5148\u9700\u8981\u8fde\u7eed\u4e24\u4e2a RGB-D \u5173\u952e\u5e27 A \u548c B\uff0c\u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\u53ca \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u662f\u5c5e\u4e8e \\(se(3)\\) \u7684\uff0c\u6b64\u5916\u8fd8\u9700\u8981\u524d\u4e00\u5e27\u7684\u8bed\u4e49\u5206\u5272\u4fe1\u606f \\(\\widetilde{\\Gamma}_A \\in \\mathbb{R}^{W \\times H}\\) \u3002\u9996\u5148\u6839\u636e\u8fd0\u52a8\u5148\u9a8c\u4fe1\u606f\u68c0\u6d4b\u7269\u4f53\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53\uff1b\u7136\u540e\u5f53\u7269\u4f53\u8fd0\u52a8\u65f6\uff0c\u57fa\u4e8e\u5e27\u95f4\u5bf9\u5176\uff0c\u6211\u4eec\u8054\u5408\u4f30\u8ba1\u5206\u5272 \\(\\widetilde{\\Gamma}_B\\) \u548c \u521a\u4f53\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002\u8fd9\u4e9b\u7247\u6bb5\u7528\u4e8e\u91cd\u5efa\u9759\u6001\u73af\u5883\u548c\u52a8\u6001\u5bf9\u8c61\uff0c\u5e76\u5229\u7528\u5e27\u4e0e\u6a21\u578b\u7684\u5bf9\u5176\u5b9e\u73b0\u6444\u50cf\u673a\u7684\u5b9a\u4f4d\u3002","title":"OVERVIEW"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_1","text":"\u6bcf\u4e2a\u65b0\u7684\u5f3a\u5ea6\u548c\u6df1\u5ea6\u56fe\u50cf \\((I,D) \\in \\mathbb{R}^{W \\times H}\\) \u5bf9\u901a\u8fc7\u4f7f\u7528 K-\u5747\u503c\u805a\u7c7b\uff0c\u88ab\u5206\u5272\u6210 K \u4e2a\u51e0\u4f55\u7c07 \\(V=V_i|i=1,...,K\\) \u3002\u5047\u8bbe\u6bcf\u4e2a\u7c07\u6ee1\u8db3\u521a\u6027\u6761\u4ef6\uff0c\u6bcf\u4e2a\u521a\u4f53\u53ef\u4ee5\u901a\u8fc7\u7c07\u7684\u7ec4\u5408\u6765\u8fd1\u4f3c\u3002\u540c\u65f6\u6587\u4e2d\u8fd8\u4e3a\u6bcf\u4e2a\u96c6\u7fa4\u5206\u914d\u4e00\u4e2a\u5206\u6570 \\(\\gamma_u \\in [0,1]\\) \u8868\u793a\u7c07\u662f\u5426\u5c5e\u4e8e\u9759\u6001\u521a\u4f53\u7684\u6982\u7387\uff1b \\(\\gamma_i=0\\) \u8868\u793a\u52a8\u6001\u7c07\uff0c\u800c \\(\\gamma_i=1\\) \u8868\u793a\u9759\u6001\u7c07\u3002\u5bf9\u4e8e RGB-D \u5e27 A\uff0c\u5c06\u603b\u4f53\u5206\u6570\u8868\u793a\u4e3a \\(\\gamma_A \\in \\mathbb{R}^K\\) \u3002","title":"\u56fe\u50cf\u805a\u5408"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_2","text":"\u5982\u679c\u4e24\u4e2a\u8fd0\u52a8\u5148\u9a8c\u4e4b\u95f4\u7684\u5dee \\(||\\widetilde{\\xi}_s -\\widetilde{\\xi}_d||^2\\) \u5c0f\u4e8e\u9608\u503c \\(\\hat{d}\\) \uff0c\u5219\u5c06\u56fe\u50cf\u4e2d\u7684\u6240\u6709\u805a\u7c7b\u89c6\u4e3a\u9759\u6001\u548c\u52a8\u6001\u5206\u5272\u3002\u5426\u5219\u5c06\u5171\u540c\u4f18\u5316\u5f53\u524d\u5e27\u7684\u5206\u6570 \\(\\gamma_B\\) \u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002","title":"\u8ddd\u79bb\u5224\u65ad"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_3","text":"\u4ece\u805a\u7c7b\u548c\u5206\u6570\u4e2d\u8ba1\u7b97\u50cf\u7d20\u7ea7\u5206\u5272 \\(\\widetilde{\\Gamma}_B \\in \\mathbb{R}^{W \\times H}\\) \u3002\u4e0e\u9759\u6001\u878d\u5408\u7c7b\u4f3c\uff0c\u4ece\u5206\u5272\u4e2d\u8ba1\u7b97\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u52a0\u6743 RGB-D \u56fe\u50cf \\(\\widetilde{\\Gamma}_B\\) \u3002\u8fd9\u4e9b\u52a0\u6743\u56fe\u50cf\u7528\u4e8e\u91cd\u5efa\u80cc\u666f\u548c\u52a8\u6001\u76ee\u6807\u7684\u6a21\u578b\uff0c\u5e76\u901a\u8fc7\u5e27-\u6a21\u578b\u5bf9\u5176\u6765\u7ec6\u5316\u4f30\u8ba1\u7684\u76f8\u673a\u59ff\u6001\u3002","title":"\u56fe\u50cf\u5206\u5272"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_4","text":"\u5206\u522b\u4ece world-frame\u3001camera-frame \u548c object-frame \u8868\u793a\u4e3a \\(F_W\u3001F_C\u3001F_O\\) \u3002\u4f7f\u7528 \\(T_{XY} \\in SE(3)\\) \u5c06\u5750\u6807\u7cfb \\(F_Y\\) \u4e2d\u67d0\u4e2a\u70b9\u7684\u9f50\u6b21\u5750\u6807\u8f6c\u6362\u4e3a \\(F_X\\) \u3002\u5728\u56fe\u50cf\u5e27 A \u4e2d\uff0c\u76f8\u673a\u548c\u7269\u4f53\u7684\u59ff\u6001\u5206\u522b\u662f \\(T_{WC_A}\\) \u548c \\(T_{WO_A}\\) \u3002\u8003\u8651\u4e24\u4e2a\u56fe\u50cf\u5e27 A \u548c B\uff0c \\(\\xi_s\\) \u4e0e\u6444\u50cf\u673a\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_s)=T_{WC_A}^{-1}T_{WC_B}=T_{C_AC_B}\\) \uff0c\u6c42\u51fa\u673a\u5668\u4eba\u79fb\u52a8\u7684\u4fe1\u606f\uff0c \\(\\xi_d\\) \u4e0e\u6444\u50cf\u673a\u7684\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_d)=T_{WC_A}^{-1}T_{WO_A}T_{WO_B}^{-1}T_{WC_B}=T_{C_AO_A}T_{C_BO_B}^{-1}\\) \uff0c\u6700\u540e\u8f6c\u5316\u4e3a\u76f8\u673a\u548c\u7269\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8\u5173\u7cfb\u3002\u5176\u4e2d \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u53ef\u4ee5\u7531\u672c\u4f53\u611f\u89c9\u4f20\u611f\u5668\u63d0\u4f9b\uff0c\u5982\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u548c\u624b\u81c2\u6b63\u5411\u8fd0\u52a8\u5b66\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u9759\u6001\u8fd0\u52a8\u5148\u9a8c \\(\\widetilde{\\xi}_s\\) \u662f\u901a\u8fc7\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u6216\u901a\u8fc7\u5728\u76f8\u673a\u5730\u9762\u771f\u503c\u8f68\u8ff9\u4e0a\u6dfb\u52a0\u6a21\u62df\u6f02\u79fb\u6765\u8ba1\u7b97\u3002\u901a\u8fc7\u6a21\u62df\u5bf9\u8c61\u771f\u503c\u8f68\u8ff9\u4e0a\u7684\u6f02\u79fb\u6765\u751f\u6210 \\(\\widetilde{\\xi}_d\\) \u3002","title":"\u5750\u6807\u7cfb\u8f6c\u6362"},{"location":"cv/papers/nerf/","text":"NeRF \u7cfb\u5217 \u00b6 Abstract NeRF \u7cfb\u5217\u76f8\u5173\u5185\u5bb9 Table of Contents \u00b6 NeRF NeRF-Evaluation iMAP NICE-SLAM Co-SLAM NID-SLAM DDN-SLAM","title":"NeRF \u7cfb\u5217"},{"location":"cv/papers/nerf/#nerf","text":"Abstract NeRF \u7cfb\u5217\u76f8\u5173\u5185\u5bb9","title":"NeRF \u7cfb\u5217"},{"location":"cv/papers/nerf/#table-of-contents","text":"NeRF NeRF-Evaluation iMAP NICE-SLAM Co-SLAM NID-SLAM DDN-SLAM","title":"Table of Contents"},{"location":"cv/papers/nerf/co-slam/","text":"Co-SLAM \u00b6 \u7ea6 713 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM code\uff1a [CVPR'23] Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM video: Co-SLAM About INR \u00b6 \u795e\u7ecf\u9690\u5f0f\u8868\u5f81 slam\uff08implict neural representaton\uff0cINR\uff09\u4f7f\u7528\u4e00\u4e2a\u8fde\u7eed\u51fd\u6570\u6765\u8868\u5f81\u56fe\u50cf\u6216\u8005\u4e09\u7ef4 voxel\uff0c\u5e76\u7528\u795e\u7ecf\u7f51\u7edc\u6765\u903c\u8fd1\u8fd9\u4e2a\u51fd\u6570\u3002Co-SLAM \u4e5f\u662f\u8fd9\u7c7b\u5de5\u4f5c\uff0cCo-SLAM \u5c06\u573a\u666f\u8868\u793a\u4e3a\u591a\u5206\u8fa8\u7387\u54c8\u5e0c\u7f51\u683c\uff0c\u4ee5\u5229\u7528\u5176\u8f83\u9ad8\u7684\u6536\u655b\u901f\u5ea6\u548c\u8868\u793a\u9ad8\u9891\u5c40\u90e8\u7279\u5f81\u7684\u80fd\u529b\u3002\u6b64\u5916\uff0cCo-SLAM \u8fd8\u91c7\u7528\u4e86 one-blob encoding\uff0c\u4ee5\u4fc3\u8fdb\u672a\u89c2\u5bdf\u533a\u57df\u7684\u8868\u9762\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\uff1b\u5728\u6240\u6709\u5173\u952e\u5e27\u4e0a\u8fdb\u884c BA\u3002 Related Work \u00b6 \u7a20\u5bc6\u56fe\u89c6\u89c9 SLAM \u00b6 \u4f20\u7edf\u91c7\u7528 3D-3D ICP \u6c42\u89e3\uff0c\u91c7\u7528\u6df1\u5ea6\u5b66\u4e60\u53ef\u4ee5\u63d0\u5347\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\uff0c\u4f46\u5927\u90e8\u5206\u7684 pipeline \u4ecd\u7136\u91c7\u7528\u4f20\u7edf\u65b9\u6cd5\u3002 INR \u00b6 INR\u5728\u795e\u7ecf\u7f51\u7edc\u4e2d\u7f16\u7801\u4e09\u7ef4\u56fe\u50cf\uff0c\u5982\u5177\u6709\u4ee3\u8868\u6027\u7684 NeRF\uff0c\u91c7\u7528\u4e86\u5e26\u6709 MLP\u7684 coordinate encoding \u901a\u8fc7\u4f53\u7ed8\u5236\u8fdb\u884c\u573a\u666f\u91cd\u5efa\uff0c\u4f46\u662f\u8bad\u7ec3\u4e8b\u4ef6\u8fc7\u957f\uff0c\u540e\u7eed\u6709 parametric embedding \u7b49\u5de5\u4f5c\uff0c\u867d\u7136\u589e\u52a0\u4e86\u53c2\u6570\u91cf\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u8bad\u7ec3\u65f6\u95f4\u3002 Neural Implicit SLAM \u00b6 iMAP \u91c7\u7528 MLP \u5728\u63a5\u8fd1\u5b9e\u65f6\u5185\u540c\u65f6\u8ffd\u8e2a\u548c\u5efa\u56fe\uff0c\u4ece\u800c\u5b9e\u73b0\u4e86 10 Hz tracking \u548c 2 Hz \u5efa\u56fe\u3002\u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u5f00\u9500\u5e76\u63d0\u9ad8\u53ef\u6269\u5c55\u6027\uff0cNICE-SLAM \u91c7\u7528\u4e86\u591a\u5c42\u7279\u5f81\u7f51\u683c\u6765\u8868\u793a\u573a\u666f\u3002\u7136\u800c\uff0c\u7531\u4e8e\u7279\u5f81\u7f51\u683c\u53ea\u8fdb\u884c\u5c40\u90e8\u66f4\u65b0\uff0c\u56e0\u6b64\u65e0\u6cd5\u5b9e\u73b0\u5408\u7406\u7684hole-filling\u3002 Idea \u00b6 Joint Corrdinate and Parametric Encoding \u57fa\u4e8e\u5750\u6807\u7684\u8868\u793a\u65b9\u6cd5\u53d7\u76ca\u4e8e MLP \u7684\u5e73\u6ed1\u4e00\u81f4\u6027\u5b9e\u9a8c\uff0c\u80fd\u591f\u5f97\u5230\u9ad8\u4fdd\u771f\u7684\u91cd\u5efa\u7ed3\u679c\uff0c\u4f46\u662f\u6536\u655b\u592a\u6162\uff0c\u800c\u4e14\u4f1a\u53d1\u751f\u707e\u96be\u6027\u9057\u5fd8\u3002 \u57fa\u4e8e\u53c2\u6570\u7684\u8868\u793a\u65b9\u6cd5\u63d0\u9ad8\u4e86\u8ba1\u7b97\u6548\u7387\uff0c\u4f46\u5728\u5e73\u6ed1\u6027\u548c hole-filling \u4e0a\u8868\u73b0\u4e0d\u597d\u3002 Co-SLAM \u91c7\u7528\u4e86\u8054\u5408\u5750\u6807\u548c\u53c2\u6570\u7f16\u7801\uff0c\u9002\u7528 One-blob \u7f16\u7801\uff0c\u800c\u4e0d\u662f\u5c06\u7a7a\u95f4\u5750\u6807\u5d4c\u5165\u591a\u4e2a\u9891\u6bb5\uff0c\u5728 hashGrid \u7684\u591a\u5206\u8fa8\u7387\u7279\u5f81\u7f51\u7edc\u8868\u5f81\u4e2d\u4f7f\u7528 One-blob \u7f16\u7801\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5feb\u901f\u6536\u655b\u548c online-slam \u6240\u9700\u7684 hole-filling\u3002 Depth and Color Rendering \uff1a\u901a\u8fc7\u5bf9\u6cbf\u91c7\u6837\u5c04\u7ebf\u7684\u9884\u6d4b\u503c\u8fdb\u884c\u79ef\u5206\uff0c\u5448\u73b0\u6df1\u5ea6\u548c\u8272\u5f69\u3002 Tracking and BA \u76ee\u6807\u51fd\u6570\uff1a\u989c\u8272\u548c\u6df1\u5ea6 loss \u901a\u8fc7\u5e73\u65b9\u8bef\u5dee\u8ba1\u7b97\uff0c Camera Tracking\uff1a\u76f8\u673a\u5230\u4e16\u754c\u7684\u53d8\u6362\u77e9\u9635 T\uff0c\u57fa\u4e8e\u5300\u901f\u6052\u5b9a\u8fd0\u52a8\u6a21\u578b\uff0c\u7136\u540e\u9009\u53d6\u5f53\u524d\u5e27\u5185\u7684 \\(N_t\\) (1024) \u4e2a\u50cf\u7d20\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u76ee\u6807\u51fd\u6570\u4f18\u5316\u4f4d\u59ff\uff0c\u800c\u76ee\u6807\u51fd\u6570\u4e0e\u76f8\u673a\u5916\u53c2\u6709\u5173\u3002 BA\uff1a\u5728 Co-SLAM \u4e2d\uff0c\u4e0d\u518d\u9700\u8981\u5b58\u50a8\u5b8c\u6574\u7684\u5173\u952e\u5e27\u56fe\u50cf\u6216\u5173\u952e\u5e27\u9009\u62e9\u3002\u76f8\u53cd\u53ea\u5b58\u50a8\u4ee3\u8868\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u50cf\u7d20\u5b50\u96c6\uff08\u7ea6 5%\uff09\u3002\u4e3a\u4e86\u8fdb\u884c\u8054\u5408\u4f18\u5316\uff0c\u6211\u4eec\u4ece\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u968f\u673a\u62bd\u53d6 \\(N_g\\) \u6761\u5c04\u7ebf\uff0c\u4ee5\u4f18\u5316\u573a\u666f\u8868\u793a\u548c\u76f8\u673a\u4f4d\u59ff\u3002 Experiments \u00b6","title":"Co-SLAM"},{"location":"cv/papers/nerf/co-slam/#co-slam","text":"\u7ea6 713 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM code\uff1a [CVPR'23] Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM video: Co-SLAM","title":"Co-SLAM"},{"location":"cv/papers/nerf/co-slam/#about-inr","text":"\u795e\u7ecf\u9690\u5f0f\u8868\u5f81 slam\uff08implict neural representaton\uff0cINR\uff09\u4f7f\u7528\u4e00\u4e2a\u8fde\u7eed\u51fd\u6570\u6765\u8868\u5f81\u56fe\u50cf\u6216\u8005\u4e09\u7ef4 voxel\uff0c\u5e76\u7528\u795e\u7ecf\u7f51\u7edc\u6765\u903c\u8fd1\u8fd9\u4e2a\u51fd\u6570\u3002Co-SLAM \u4e5f\u662f\u8fd9\u7c7b\u5de5\u4f5c\uff0cCo-SLAM \u5c06\u573a\u666f\u8868\u793a\u4e3a\u591a\u5206\u8fa8\u7387\u54c8\u5e0c\u7f51\u683c\uff0c\u4ee5\u5229\u7528\u5176\u8f83\u9ad8\u7684\u6536\u655b\u901f\u5ea6\u548c\u8868\u793a\u9ad8\u9891\u5c40\u90e8\u7279\u5f81\u7684\u80fd\u529b\u3002\u6b64\u5916\uff0cCo-SLAM \u8fd8\u91c7\u7528\u4e86 one-blob encoding\uff0c\u4ee5\u4fc3\u8fdb\u672a\u89c2\u5bdf\u533a\u57df\u7684\u8868\u9762\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\uff1b\u5728\u6240\u6709\u5173\u952e\u5e27\u4e0a\u8fdb\u884c BA\u3002","title":"About INR"},{"location":"cv/papers/nerf/co-slam/#related-work","text":"","title":"Related Work"},{"location":"cv/papers/nerf/co-slam/#slam","text":"\u4f20\u7edf\u91c7\u7528 3D-3D ICP \u6c42\u89e3\uff0c\u91c7\u7528\u6df1\u5ea6\u5b66\u4e60\u53ef\u4ee5\u63d0\u5347\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\uff0c\u4f46\u5927\u90e8\u5206\u7684 pipeline \u4ecd\u7136\u91c7\u7528\u4f20\u7edf\u65b9\u6cd5\u3002","title":"\u7a20\u5bc6\u56fe\u89c6\u89c9 SLAM"},{"location":"cv/papers/nerf/co-slam/#inr","text":"INR\u5728\u795e\u7ecf\u7f51\u7edc\u4e2d\u7f16\u7801\u4e09\u7ef4\u56fe\u50cf\uff0c\u5982\u5177\u6709\u4ee3\u8868\u6027\u7684 NeRF\uff0c\u91c7\u7528\u4e86\u5e26\u6709 MLP\u7684 coordinate encoding \u901a\u8fc7\u4f53\u7ed8\u5236\u8fdb\u884c\u573a\u666f\u91cd\u5efa\uff0c\u4f46\u662f\u8bad\u7ec3\u4e8b\u4ef6\u8fc7\u957f\uff0c\u540e\u7eed\u6709 parametric embedding \u7b49\u5de5\u4f5c\uff0c\u867d\u7136\u589e\u52a0\u4e86\u53c2\u6570\u91cf\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u8bad\u7ec3\u65f6\u95f4\u3002","title":"INR"},{"location":"cv/papers/nerf/co-slam/#neural-implicit-slam","text":"iMAP \u91c7\u7528 MLP \u5728\u63a5\u8fd1\u5b9e\u65f6\u5185\u540c\u65f6\u8ffd\u8e2a\u548c\u5efa\u56fe\uff0c\u4ece\u800c\u5b9e\u73b0\u4e86 10 Hz tracking \u548c 2 Hz \u5efa\u56fe\u3002\u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u5f00\u9500\u5e76\u63d0\u9ad8\u53ef\u6269\u5c55\u6027\uff0cNICE-SLAM \u91c7\u7528\u4e86\u591a\u5c42\u7279\u5f81\u7f51\u683c\u6765\u8868\u793a\u573a\u666f\u3002\u7136\u800c\uff0c\u7531\u4e8e\u7279\u5f81\u7f51\u683c\u53ea\u8fdb\u884c\u5c40\u90e8\u66f4\u65b0\uff0c\u56e0\u6b64\u65e0\u6cd5\u5b9e\u73b0\u5408\u7406\u7684hole-filling\u3002","title":"Neural Implicit SLAM"},{"location":"cv/papers/nerf/co-slam/#idea","text":"Joint Corrdinate and Parametric Encoding \u57fa\u4e8e\u5750\u6807\u7684\u8868\u793a\u65b9\u6cd5\u53d7\u76ca\u4e8e MLP \u7684\u5e73\u6ed1\u4e00\u81f4\u6027\u5b9e\u9a8c\uff0c\u80fd\u591f\u5f97\u5230\u9ad8\u4fdd\u771f\u7684\u91cd\u5efa\u7ed3\u679c\uff0c\u4f46\u662f\u6536\u655b\u592a\u6162\uff0c\u800c\u4e14\u4f1a\u53d1\u751f\u707e\u96be\u6027\u9057\u5fd8\u3002 \u57fa\u4e8e\u53c2\u6570\u7684\u8868\u793a\u65b9\u6cd5\u63d0\u9ad8\u4e86\u8ba1\u7b97\u6548\u7387\uff0c\u4f46\u5728\u5e73\u6ed1\u6027\u548c hole-filling \u4e0a\u8868\u73b0\u4e0d\u597d\u3002 Co-SLAM \u91c7\u7528\u4e86\u8054\u5408\u5750\u6807\u548c\u53c2\u6570\u7f16\u7801\uff0c\u9002\u7528 One-blob \u7f16\u7801\uff0c\u800c\u4e0d\u662f\u5c06\u7a7a\u95f4\u5750\u6807\u5d4c\u5165\u591a\u4e2a\u9891\u6bb5\uff0c\u5728 hashGrid \u7684\u591a\u5206\u8fa8\u7387\u7279\u5f81\u7f51\u7edc\u8868\u5f81\u4e2d\u4f7f\u7528 One-blob \u7f16\u7801\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5feb\u901f\u6536\u655b\u548c online-slam \u6240\u9700\u7684 hole-filling\u3002 Depth and Color Rendering \uff1a\u901a\u8fc7\u5bf9\u6cbf\u91c7\u6837\u5c04\u7ebf\u7684\u9884\u6d4b\u503c\u8fdb\u884c\u79ef\u5206\uff0c\u5448\u73b0\u6df1\u5ea6\u548c\u8272\u5f69\u3002 Tracking and BA \u76ee\u6807\u51fd\u6570\uff1a\u989c\u8272\u548c\u6df1\u5ea6 loss \u901a\u8fc7\u5e73\u65b9\u8bef\u5dee\u8ba1\u7b97\uff0c Camera Tracking\uff1a\u76f8\u673a\u5230\u4e16\u754c\u7684\u53d8\u6362\u77e9\u9635 T\uff0c\u57fa\u4e8e\u5300\u901f\u6052\u5b9a\u8fd0\u52a8\u6a21\u578b\uff0c\u7136\u540e\u9009\u53d6\u5f53\u524d\u5e27\u5185\u7684 \\(N_t\\) (1024) \u4e2a\u50cf\u7d20\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u76ee\u6807\u51fd\u6570\u4f18\u5316\u4f4d\u59ff\uff0c\u800c\u76ee\u6807\u51fd\u6570\u4e0e\u76f8\u673a\u5916\u53c2\u6709\u5173\u3002 BA\uff1a\u5728 Co-SLAM \u4e2d\uff0c\u4e0d\u518d\u9700\u8981\u5b58\u50a8\u5b8c\u6574\u7684\u5173\u952e\u5e27\u56fe\u50cf\u6216\u5173\u952e\u5e27\u9009\u62e9\u3002\u76f8\u53cd\u53ea\u5b58\u50a8\u4ee3\u8868\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u50cf\u7d20\u5b50\u96c6\uff08\u7ea6 5%\uff09\u3002\u4e3a\u4e86\u8fdb\u884c\u8054\u5408\u4f18\u5316\uff0c\u6211\u4eec\u4ece\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u968f\u673a\u62bd\u53d6 \\(N_g\\) \u6761\u5c04\u7ebf\uff0c\u4ee5\u4f18\u5316\u573a\u666f\u8868\u793a\u548c\u76f8\u673a\u4f4d\u59ff\u3002","title":"Idea"},{"location":"cv/papers/nerf/co-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/nerf/ddn-slam/","text":"DDN-SLAM \u00b6 \u7ea6 225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DDN-SLAM: Real-time Dense Dynamic Neural Implicit SLAM code: not open source Idea \u00b6 \u63d0\u51fa\u4e86\u57fa\u4e8e \u8bed\u4e49\u7279\u5f81 \u7684\u52a8\u6001 SLAM\uff0c\u901a\u8fc7\u7ed3\u5408 \u8bed\u4e49\u68c0\u6d4b\u6846\u67b6 \u548c \u9ad8\u65af\u6df7\u5408\u6a21\u578b \u80cc\u666f\u6df1\u5ea6\u6982\u7387\u68c0\u67e5\u65b9\u6cd5\uff0c\u533a\u5206\u524d\u666f\u548c\u80cc\u666f\u4ee5\u6d88\u9664\u5e72\u6270\u7684\u52a8\u6001\u7279\u5f81\u70b9\uff1b \u901a\u8fc7\u5bf9\u52a8\u6001\u70b9 \u91cd\u6295\u5f71\u8bef\u5dee \u7684\u4e8c\u6b21\u68c0\u67e5\u5e76 BA \u6765\u5efa\u7acb\u957f\u671f\u7684\u6570\u636e\u5173\u8054\uff1b \u63d0\u51fa\u4e00\u79cd\u6df7\u5408\u7684\u80cc\u666f\u6062\u590d\u548c\u6e32\u67d3\u7b56\u7565\uff0c\u5305\u62ec\u5229\u7528 \u7279\u5f81\u7684\u5149\u6d41\u6765\u533a\u5206\u52a8\u6001\u63a9\u7801 \u4ee5\u8fdb\u884c\u80cc\u666f\u6062\u590d\uff1b \u63d0\u51fa\u4e00\u79cd\u7531 \u9759\u6001\u7a00\u758f\u70b9\u4e91\u5f15\u5bfc\u7684\u91c7\u6837\u7b56\u7565 \uff0c\u4ee5\u589e\u5f3a\u5bf9\u9759\u6001\u8868\u9762\u7684\u91cd\u5efa\uff1b \u63d0\u51fa\u4e00\u79cd\u57fa\u4e8e \u52a8\u6001\u63a9\u7801\u7684\u6e32\u67d3\u635f\u5931 \uff0c\u5305\u62ec\u8fd0\u52a8\u4e00\u81f4\u6027\u635f\u5931\u3001\u6df1\u5ea6\u635f\u5931\u548c\u989c\u8272\u635f\u5931\uff0c\u4ee5\u7ea6\u675f\u52a8\u6001\u7269\u4f53\u7684\u6e32\u67d3\u9b3c\u5f71\u5e76\u6d88\u9664\u906e\u6321\u3002 Experiments \u00b6 \u65e0\u6e90\u4ee3\u7801\u3002","title":"DDN-SLAM"},{"location":"cv/papers/nerf/ddn-slam/#ddn-slam","text":"\u7ea6 225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DDN-SLAM: Real-time Dense Dynamic Neural Implicit SLAM code: not open source","title":"DDN-SLAM"},{"location":"cv/papers/nerf/ddn-slam/#idea","text":"\u63d0\u51fa\u4e86\u57fa\u4e8e \u8bed\u4e49\u7279\u5f81 \u7684\u52a8\u6001 SLAM\uff0c\u901a\u8fc7\u7ed3\u5408 \u8bed\u4e49\u68c0\u6d4b\u6846\u67b6 \u548c \u9ad8\u65af\u6df7\u5408\u6a21\u578b \u80cc\u666f\u6df1\u5ea6\u6982\u7387\u68c0\u67e5\u65b9\u6cd5\uff0c\u533a\u5206\u524d\u666f\u548c\u80cc\u666f\u4ee5\u6d88\u9664\u5e72\u6270\u7684\u52a8\u6001\u7279\u5f81\u70b9\uff1b \u901a\u8fc7\u5bf9\u52a8\u6001\u70b9 \u91cd\u6295\u5f71\u8bef\u5dee \u7684\u4e8c\u6b21\u68c0\u67e5\u5e76 BA \u6765\u5efa\u7acb\u957f\u671f\u7684\u6570\u636e\u5173\u8054\uff1b \u63d0\u51fa\u4e00\u79cd\u6df7\u5408\u7684\u80cc\u666f\u6062\u590d\u548c\u6e32\u67d3\u7b56\u7565\uff0c\u5305\u62ec\u5229\u7528 \u7279\u5f81\u7684\u5149\u6d41\u6765\u533a\u5206\u52a8\u6001\u63a9\u7801 \u4ee5\u8fdb\u884c\u80cc\u666f\u6062\u590d\uff1b \u63d0\u51fa\u4e00\u79cd\u7531 \u9759\u6001\u7a00\u758f\u70b9\u4e91\u5f15\u5bfc\u7684\u91c7\u6837\u7b56\u7565 \uff0c\u4ee5\u589e\u5f3a\u5bf9\u9759\u6001\u8868\u9762\u7684\u91cd\u5efa\uff1b \u63d0\u51fa\u4e00\u79cd\u57fa\u4e8e \u52a8\u6001\u63a9\u7801\u7684\u6e32\u67d3\u635f\u5931 \uff0c\u5305\u62ec\u8fd0\u52a8\u4e00\u81f4\u6027\u635f\u5931\u3001\u6df1\u5ea6\u635f\u5931\u548c\u989c\u8272\u635f\u5931\uff0c\u4ee5\u7ea6\u675f\u52a8\u6001\u7269\u4f53\u7684\u6e32\u67d3\u9b3c\u5f71\u5e76\u6d88\u9664\u906e\u6321\u3002","title":"Idea"},{"location":"cv/papers/nerf/ddn-slam/#experiments","text":"\u65e0\u6e90\u4ee3\u7801\u3002","title":"Experiments"},{"location":"cv/papers/nerf/imap/","text":"iMAP \u00b6 \u7ea6 969 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a iMAP: Implicit Mapping and Positioning in Real-Time code\uff1a iMAP_pytorch Idea \u00b6 Intrdocution \u00b6 \u7b2c\u4e00\u4e2a\u57fa\u4e8e RGB-D \u76f8\u673a\uff0c\u7528 MLP \u505a\u573a\u666f\u8868\u5f81 \u5b9e\u65f6 SLAM\u7cfb\u7edf \u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684 TSDF \u573a\u666f\u8868\u5f81\u65b9\u6cd5\uff0ciMAP \u53ef\u4ee5\u91cd\u5efa\u51fa\u672a\u88ab\u89c2\u5bdf\u5230\u7684\u5730\u65b9 \u9690\u5f0f\u573a\u666f\u8868\u5f81\u53ef\u4ee5\u7528\u6765\u505a\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\uff0c\u4f46\u90fd\u662f\u79bb\u7ebf\u5f62\u5f0f\uff0c\u8ba1\u7b97\u91cf\u5927\uff0ciMAP \u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u80fd\u8fbe\u5230\u5b9e\u65f6\u6548\u679c \u6301\u7eed\u5b66\u4e60\u4f1a\u9047\u5230 \u707e\u96be\u6027\u9057\u5fd8 \uff0ciMAP \u91c7\u7528 replay-based approach\uff0c\u5c06\u5148\u524d\u7684\u7ed3\u679c\u7f13\u5b58 Implicit Scene Neural Network \u00b6 \u501f\u9274 NeRF\uff0c\u7528 MLP \u5c06 3D \u5750\u6807\u70b9\u8f6c\u6362\u6210\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\u503c\uff1a \\(\\bold{p}=(x,y,z),F_\\theta(\\bold{p})=(\\bold{c}, \\rho)\\) \u4e0d\u8003\u8651\u89c6\u89d2\u65b9\u5411\uff08\u4e0d\u9700\u8981\u5bf9\u955c\u9762\u53cd\u5c04\u5efa\u6a21\uff09 Depth and Colour Rendering \u00b6 \u901a\u8fc7 scene network \u6765\u4ece\u6307\u5b9a\u89c6\u89d2\u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\u56fe\u50cf \u8f93\u5165\u662f\u76f8\u673a\u4f4d\u59ff \\(T_{WC}\\) \u548c\u50cf\u7d20\u5750\u6807 \\([u,v]\\) \uff0c\u5148\u53cd\u6295\u5f71\u5230\u4e16\u754c\u5750\u6807\u7cfb: \\[\\bold{r}=T_{WC}K^{-1}[u,v]\\] \u7136\u540e\u5728\u89c6\u89d2\u5c04\u7ebf\u4e0a\u91c7\u6837\uff1a \\[\\bold{p}_i=d_i \\bold{r} \\ \\ \\ \\ \\ d_i \\in \\{d_1, ..., d_N\\}\\] \u67e5\u8be2\u573a\u666f\u7f51\u7edc\u4e4b\u524d\u5f97\u5230\u7684\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\uff1a \\[(\\bold{c}_i, \\rho_i) = F_\\theta(\\bold{p}_i)\\] \u5c06\u4f53\u79ef\u5bc6\u5ea6\u8f6c\u6362\u4e3a\u5360\u636e\u6982\u7387 occupancy probability: \\[ \\delta_i = d_{i+1} - d_i \\\\ o_i = 1 - \\exp(-\\rho_i \\delta_i) \\\\ w_i = o_i \\prod_{j=1}^{i-1}(1-o_j) \\] \u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\uff1a \\[ \\hat{D}[u,v] = \\sum_{i=1}^{N}w_i d_i \\\\ \\hat{I}[u,v] = \\sum_{i=1}^{N}w_i \\bold{c}_i \\] \u8ba1\u7b97\u6df1\u5ea6\u7684\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}[u,v] = \\sum_{i=1}^{N}w_i (d_i - \\hat{D}[u,v])^2 \\] Joint optimisation \u00b6 \u7528\u5173\u952e\u5e27\u96c6\u5408\uff0c\u9488\u5bf9 \u7f51\u7edc\u53c2\u6570 \u548c \u76f8\u673a\u4f4d\u59ff \u505a\u8054\u5408\u4f18\u5316\u3002Adam \u4f18\u5316\u5668\uff0closs \u662f \u5149\u5ea6\u8bef\u5dee \u548c \u51e0\u4f55\u8bef\u5dee \u7684\u52a0\u6743 \u5149\u5ea6\u8bef\u5dee photometric error\uff1a \\[ e_i^p[u, v]=\\left | I_i[u,v] - \\hat{I}_i[u,v] \\right | \\\\ \\\\ L_p = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} e_i^p[u, v] \\] \u51e0\u4f55\u8bef\u5dee geometric error\uff08\u4f7f\u7528\u5230\u6df1\u5ea6\u65b9\u5dee\uff09\uff1a \\[ L_g = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} \\frac{e_i^g[u,v]}{\\sqrt{\\hat{D}_{var}[u,v]}} \\] Adam \u4f18\u5316\u5668\uff0c\u5bf9\u5149\u5ea6\u8bef\u5dee\u6dfb\u52a0\u4e00\u4e2a\u6743\u91cd \\(\\lambda\\) \uff1a \\[ \\min_{\\theta,\\{T_i\\}}(L_g + \\lambda_p L_p) \\] \u4e0a\u9762\u90fd\u662f Mapping \u9636\u6bb5\uff0cTracking \u9636\u6bb5\u4e0e Mapping \u5e76\u884c\uff0c\u4f46\u662f\u9891\u7387\u66f4\u9ad8\uff0c\u9488\u5bf9 latest frame\uff0c\u56fa\u5b9a\u573a\u666f\u7f51\u7edc\uff0c\u4f7f\u7528\u4e4b\u524d\u7684 loss \u548c\u4f18\u5316\u5668\u4f18\u5316\u4f4d\u59ff Keyframe Selection \u00b6 \u8003\u8651\u8ba1\u7b97\u590d\u6742\u5ea6\u548c\u56fe\u50cf\u5197\u4f59\u5ea6\uff0c\u57fa\u4e8e information gain \u9009\u53d6\u5173\u952e\u5e27 \u7b2c\u4e00\u5e27 \u4e00\u5b9a\u88ab\u9009\u53d6\uff0c\u7528\u4f5c\u7f51\u7edc\u521d\u59cb\u5316\u548c\u4e16\u754c\u5750\u6807\u7cfb\u7684\u56fa\u5b9a \u6bcf\u65b0\u589e\u4e00\u4e2a\u5173\u952e\u5e27\uff0c\u4fdd\u5b58\u4e00\u6b21 network \u4f5c\u4e3a snapshot\uff0c\u7528\u4e8e replay\uff08\u9632\u6b62 catastrophic forgetting \u7684\u7f13\u5b58\u673a\u5236\uff09 \u540e\u7eed\u5173\u952e\u5e27\u7684\u9009\u53d6\u65b9\u6cd5\u662f\uff0c\u4e0e snapshot \u505a\u6bd4\u8f83\uff0c \u662f\u5426\u89c2\u5bdf\u5230\u4e86\u65b0\u533a\u57df \u5728 snapshot \u548c frame \u968f\u673a\u9009\u53d6 s \u4e2a\u50cf\u7d20\u70b9 \u6bd4\u8f83\u6df1\u5ea6\u503c\u5dee\u4e00\uff0c\u8ba1\u7b97\u5982\u4e0b\u5206\u6570\uff0c\u7136\u540e\u4e0e\u9608\u503c\u505a\u6bd4\u8f83\uff0c\u5c0f\u4e8e\u5c31\u52a0\u5165\u5173\u952e\u5e27 \\[ P=\\frac{1}{\\left | s \\right | } \\sum_{(u,v) \\in s} (\\frac{\\left | D[u,v] - \\hat{D}[u,v] \\right | }{D[u,v]} < t_D) \\] Active Sampling \u00b6 \u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u590d\u6742\u5ea6\uff0ciMAP \u5206\u522b\u5bf9\u50cf\u7d20\u70b9\u3001\u5173\u952e\u5e27\u90fd\u505a\u4e86 Active Sampling image active sampling\uff1a\u5bf9\u56fe\u50cf\u968f\u673a\u9009\u70b9\uff0c\u9009\u53d6\u65b9\u6cd5\u662f\u5148\u5206\u5757\uff0c\u5148\u5747\u5300\u91c7\u6837\uff0c\u5206\u5757\u6c42 loss\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5757\u7684\u6743\u91cd\uff0c\u7136\u540e\u6839\u636e\u6743\u91cd\u91c7\u6837 keyframe active sampling\uff1a\u4e3a\u4e86\u9650\u5236\u8054\u5408\u4f18\u5316\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\uff0c\u6bcf\u6b21\u8fed\u4ee3\u53ea\u9009\u4e09\u4e2a\u5173\u952e\u5e27\u3002\u540c\u4e0a\uff0c\u4e5f\u662f\u8ba1\u7b97 loss \u5728\u5206\u914d\u6743\u91cd Experiments \u00b6 \u6211\u4eec\u5bf9\u6a21\u62df\u5e8f\u5217\u548c\u771f\u5b9e\u5e8f\u5217\u8fdb\u884c\u5b9e\u9a8c\u3002\u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6211\u4eec\u4f7f\u7528\u526f\u672c\u6570\u636e\u96c6[29]\uff0c\u5bf9\u771f\u5b9e\u623f\u95f4\u89c4\u6a21\u7684\u73af\u5883\u8fdb\u884c\u9ad8\u8d28\u91cf3D\u91cd\u5efa\uff0c\u5305\u62ec5\u4e2a\u529e\u516c\u5ba4\u548c3\u4e2a\u516c\u5bd3\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u526f\u672c\u573a\u666f\uff0c\u6211\u4eec\u6e32\u67d32000\u4e2aRGB-D\u5e27\u7684\u968f\u673a\u8f68\u8ff9\u3002\u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u6211\u4eec\u4f7f\u7528\u624b\u6301Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D\u6570\u636e\u96c6[30]\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002 \u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6570\u636e\u96c6\u662f Replica \u7684 5 offices \u548c 3 apartments \u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u4f7f\u7528\u624b\u6301 Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D \u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002","title":"iMAP"},{"location":"cv/papers/nerf/imap/#imap","text":"\u7ea6 969 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a iMAP: Implicit Mapping and Positioning in Real-Time code\uff1a iMAP_pytorch","title":"iMAP"},{"location":"cv/papers/nerf/imap/#idea","text":"","title":"Idea"},{"location":"cv/papers/nerf/imap/#intrdocution","text":"\u7b2c\u4e00\u4e2a\u57fa\u4e8e RGB-D \u76f8\u673a\uff0c\u7528 MLP \u505a\u573a\u666f\u8868\u5f81 \u5b9e\u65f6 SLAM\u7cfb\u7edf \u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684 TSDF \u573a\u666f\u8868\u5f81\u65b9\u6cd5\uff0ciMAP \u53ef\u4ee5\u91cd\u5efa\u51fa\u672a\u88ab\u89c2\u5bdf\u5230\u7684\u5730\u65b9 \u9690\u5f0f\u573a\u666f\u8868\u5f81\u53ef\u4ee5\u7528\u6765\u505a\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\uff0c\u4f46\u90fd\u662f\u79bb\u7ebf\u5f62\u5f0f\uff0c\u8ba1\u7b97\u91cf\u5927\uff0ciMAP \u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u80fd\u8fbe\u5230\u5b9e\u65f6\u6548\u679c \u6301\u7eed\u5b66\u4e60\u4f1a\u9047\u5230 \u707e\u96be\u6027\u9057\u5fd8 \uff0ciMAP \u91c7\u7528 replay-based approach\uff0c\u5c06\u5148\u524d\u7684\u7ed3\u679c\u7f13\u5b58","title":"Intrdocution"},{"location":"cv/papers/nerf/imap/#implicit-scene-neural-network","text":"\u501f\u9274 NeRF\uff0c\u7528 MLP \u5c06 3D \u5750\u6807\u70b9\u8f6c\u6362\u6210\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\u503c\uff1a \\(\\bold{p}=(x,y,z),F_\\theta(\\bold{p})=(\\bold{c}, \\rho)\\) \u4e0d\u8003\u8651\u89c6\u89d2\u65b9\u5411\uff08\u4e0d\u9700\u8981\u5bf9\u955c\u9762\u53cd\u5c04\u5efa\u6a21\uff09","title":"Implicit Scene Neural Network"},{"location":"cv/papers/nerf/imap/#depth-and-colour-rendering","text":"\u901a\u8fc7 scene network \u6765\u4ece\u6307\u5b9a\u89c6\u89d2\u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\u56fe\u50cf \u8f93\u5165\u662f\u76f8\u673a\u4f4d\u59ff \\(T_{WC}\\) \u548c\u50cf\u7d20\u5750\u6807 \\([u,v]\\) \uff0c\u5148\u53cd\u6295\u5f71\u5230\u4e16\u754c\u5750\u6807\u7cfb: \\[\\bold{r}=T_{WC}K^{-1}[u,v]\\] \u7136\u540e\u5728\u89c6\u89d2\u5c04\u7ebf\u4e0a\u91c7\u6837\uff1a \\[\\bold{p}_i=d_i \\bold{r} \\ \\ \\ \\ \\ d_i \\in \\{d_1, ..., d_N\\}\\] \u67e5\u8be2\u573a\u666f\u7f51\u7edc\u4e4b\u524d\u5f97\u5230\u7684\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\uff1a \\[(\\bold{c}_i, \\rho_i) = F_\\theta(\\bold{p}_i)\\] \u5c06\u4f53\u79ef\u5bc6\u5ea6\u8f6c\u6362\u4e3a\u5360\u636e\u6982\u7387 occupancy probability: \\[ \\delta_i = d_{i+1} - d_i \\\\ o_i = 1 - \\exp(-\\rho_i \\delta_i) \\\\ w_i = o_i \\prod_{j=1}^{i-1}(1-o_j) \\] \u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\uff1a \\[ \\hat{D}[u,v] = \\sum_{i=1}^{N}w_i d_i \\\\ \\hat{I}[u,v] = \\sum_{i=1}^{N}w_i \\bold{c}_i \\] \u8ba1\u7b97\u6df1\u5ea6\u7684\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}[u,v] = \\sum_{i=1}^{N}w_i (d_i - \\hat{D}[u,v])^2 \\]","title":"Depth and Colour Rendering"},{"location":"cv/papers/nerf/imap/#joint-optimisation","text":"\u7528\u5173\u952e\u5e27\u96c6\u5408\uff0c\u9488\u5bf9 \u7f51\u7edc\u53c2\u6570 \u548c \u76f8\u673a\u4f4d\u59ff \u505a\u8054\u5408\u4f18\u5316\u3002Adam \u4f18\u5316\u5668\uff0closs \u662f \u5149\u5ea6\u8bef\u5dee \u548c \u51e0\u4f55\u8bef\u5dee \u7684\u52a0\u6743 \u5149\u5ea6\u8bef\u5dee photometric error\uff1a \\[ e_i^p[u, v]=\\left | I_i[u,v] - \\hat{I}_i[u,v] \\right | \\\\ \\\\ L_p = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} e_i^p[u, v] \\] \u51e0\u4f55\u8bef\u5dee geometric error\uff08\u4f7f\u7528\u5230\u6df1\u5ea6\u65b9\u5dee\uff09\uff1a \\[ L_g = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} \\frac{e_i^g[u,v]}{\\sqrt{\\hat{D}_{var}[u,v]}} \\] Adam \u4f18\u5316\u5668\uff0c\u5bf9\u5149\u5ea6\u8bef\u5dee\u6dfb\u52a0\u4e00\u4e2a\u6743\u91cd \\(\\lambda\\) \uff1a \\[ \\min_{\\theta,\\{T_i\\}}(L_g + \\lambda_p L_p) \\] \u4e0a\u9762\u90fd\u662f Mapping \u9636\u6bb5\uff0cTracking \u9636\u6bb5\u4e0e Mapping \u5e76\u884c\uff0c\u4f46\u662f\u9891\u7387\u66f4\u9ad8\uff0c\u9488\u5bf9 latest frame\uff0c\u56fa\u5b9a\u573a\u666f\u7f51\u7edc\uff0c\u4f7f\u7528\u4e4b\u524d\u7684 loss \u548c\u4f18\u5316\u5668\u4f18\u5316\u4f4d\u59ff","title":"Joint optimisation"},{"location":"cv/papers/nerf/imap/#keyframe-selection","text":"\u8003\u8651\u8ba1\u7b97\u590d\u6742\u5ea6\u548c\u56fe\u50cf\u5197\u4f59\u5ea6\uff0c\u57fa\u4e8e information gain \u9009\u53d6\u5173\u952e\u5e27 \u7b2c\u4e00\u5e27 \u4e00\u5b9a\u88ab\u9009\u53d6\uff0c\u7528\u4f5c\u7f51\u7edc\u521d\u59cb\u5316\u548c\u4e16\u754c\u5750\u6807\u7cfb\u7684\u56fa\u5b9a \u6bcf\u65b0\u589e\u4e00\u4e2a\u5173\u952e\u5e27\uff0c\u4fdd\u5b58\u4e00\u6b21 network \u4f5c\u4e3a snapshot\uff0c\u7528\u4e8e replay\uff08\u9632\u6b62 catastrophic forgetting \u7684\u7f13\u5b58\u673a\u5236\uff09 \u540e\u7eed\u5173\u952e\u5e27\u7684\u9009\u53d6\u65b9\u6cd5\u662f\uff0c\u4e0e snapshot \u505a\u6bd4\u8f83\uff0c \u662f\u5426\u89c2\u5bdf\u5230\u4e86\u65b0\u533a\u57df \u5728 snapshot \u548c frame \u968f\u673a\u9009\u53d6 s \u4e2a\u50cf\u7d20\u70b9 \u6bd4\u8f83\u6df1\u5ea6\u503c\u5dee\u4e00\uff0c\u8ba1\u7b97\u5982\u4e0b\u5206\u6570\uff0c\u7136\u540e\u4e0e\u9608\u503c\u505a\u6bd4\u8f83\uff0c\u5c0f\u4e8e\u5c31\u52a0\u5165\u5173\u952e\u5e27 \\[ P=\\frac{1}{\\left | s \\right | } \\sum_{(u,v) \\in s} (\\frac{\\left | D[u,v] - \\hat{D}[u,v] \\right | }{D[u,v]} < t_D) \\]","title":"Keyframe Selection"},{"location":"cv/papers/nerf/imap/#active-sampling","text":"\u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u590d\u6742\u5ea6\uff0ciMAP \u5206\u522b\u5bf9\u50cf\u7d20\u70b9\u3001\u5173\u952e\u5e27\u90fd\u505a\u4e86 Active Sampling image active sampling\uff1a\u5bf9\u56fe\u50cf\u968f\u673a\u9009\u70b9\uff0c\u9009\u53d6\u65b9\u6cd5\u662f\u5148\u5206\u5757\uff0c\u5148\u5747\u5300\u91c7\u6837\uff0c\u5206\u5757\u6c42 loss\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5757\u7684\u6743\u91cd\uff0c\u7136\u540e\u6839\u636e\u6743\u91cd\u91c7\u6837 keyframe active sampling\uff1a\u4e3a\u4e86\u9650\u5236\u8054\u5408\u4f18\u5316\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\uff0c\u6bcf\u6b21\u8fed\u4ee3\u53ea\u9009\u4e09\u4e2a\u5173\u952e\u5e27\u3002\u540c\u4e0a\uff0c\u4e5f\u662f\u8ba1\u7b97 loss \u5728\u5206\u914d\u6743\u91cd","title":"Active Sampling"},{"location":"cv/papers/nerf/imap/#experiments","text":"\u6211\u4eec\u5bf9\u6a21\u62df\u5e8f\u5217\u548c\u771f\u5b9e\u5e8f\u5217\u8fdb\u884c\u5b9e\u9a8c\u3002\u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6211\u4eec\u4f7f\u7528\u526f\u672c\u6570\u636e\u96c6[29]\uff0c\u5bf9\u771f\u5b9e\u623f\u95f4\u89c4\u6a21\u7684\u73af\u5883\u8fdb\u884c\u9ad8\u8d28\u91cf3D\u91cd\u5efa\uff0c\u5305\u62ec5\u4e2a\u529e\u516c\u5ba4\u548c3\u4e2a\u516c\u5bd3\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u526f\u672c\u573a\u666f\uff0c\u6211\u4eec\u6e32\u67d32000\u4e2aRGB-D\u5e27\u7684\u968f\u673a\u8f68\u8ff9\u3002\u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u6211\u4eec\u4f7f\u7528\u624b\u6301Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D\u6570\u636e\u96c6[30]\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002 \u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6570\u636e\u96c6\u662f Replica \u7684 5 offices \u548c 3 apartments \u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u4f7f\u7528\u624b\u6301 Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D \u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002","title":"Experiments"},{"location":"cv/papers/nerf/nerf-evaluation/","text":"NeRF-Evaluation \u00b6 \u7ea6 1033 \u4e2a\u5b57 114 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract NeRF \u5e38\u7528\u8bc4\u4ef7\u6307\u6807 PSNR \u00b6 Info Peak Signal-to-Noise Ratio \u5cf0\u503c\u4fe1\u566a\u6bd4 \u8861\u91cf\u4e86\u4e00\u5f20\u566a\u58f0\u56fe\u50cf\u548c\u4e00\u5f20\u5e72\u51c0\u56fe\u50cf\u7684\u5dee\u5f02 PSNR\u901a\u8fc7\u8ba1\u7b97\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5747\u65b9\u8bef\u5dee\uff08Mean Squared Error\uff0cMSE\uff09\u6765\u91cf\u5316\u5b83\u4eec\u4e4b\u95f4\u7684\u5dee\u5f02\u3002 \u4e24\u5f20\u56fe\u8c61\u7684\u5dee\u5f02\u8d8a\u5c0f\uff0cMSE\u8d8a\u5c0f, PSNR\u5c31\u8d8a\u5927\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d \u3002 \\[ MSE = \\frac{1}{mn}\\sum_{i=0}^{m-1} \\sum_{j=0}^{n-1}[I(i, j) - K(i, j)]^2 \\\\ PSNR = 10 * \\log_{10}(\\frac{MAX_I^2}{MSE}) \\] \u5176\u4e2d \\(MAX\\) \u662f\u52a8\u6001\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5373\u67d0\u70b9 \\((i, j)\\) \u50cf\u7d20\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5982\u679c\u56fe\u50cf\u662f \\(8\\) \u4f4d\u7684\uff0c\u5219 \\(MAX = 2^8 - 1 = 255\\) from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) . astype ( np . float64 ) img2 = np . array ( Image . open ( 'compress.jpg' )) . astype ( np . float64 ) def psnr ( img1 , img2 ): mse = np . mean (( img1 - img2 ) ** 2 ) if mse == 0 : return float ( 'inf' ) else : return 20 * np . log10 ( 255 / np . sqrt ( mse )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) # -------- # from skimage.metrics import peak_signal_noise_ratio as psnr from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) img2 = np . array ( Image . open ( 'compress.jpg' )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) Tip PSNR\u63a5\u8fd1 50dB \uff0c\u4ee3\u8868\u538b\u7f29\u540e\u7684\u56fe\u50cf\u4ec5\u6709\u4e9b\u8bb8\u975e\u5e38\u5c0f\u7684\u8bef\u5dee\u3002 PSNR\u5927\u4e8e 30dB \uff0c\u4eba\u773c\u5f88\u96be\u67e5\u89c9\u538b\u7f29\u540e\u548c\u539f\u59cb\u5f71\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 20dB \u5230 30dB \u4e4b\u95f4\uff0c\u4eba\u773c\u5c31\u53ef\u4ee5\u5bdf\u89c9\u51fa\u56fe\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 10dB \u5230 20dB \u4e4b\u95f4\uff0c\u4eba\u773c\u8fd8\u662f\u53ef\u4ee5\u7528\u8089\u773c\u770b\u51fa\u8fd9\u4e2a\u56fe\u50cf\u539f\u59cb\u7684\u7ed3\u6784\uff0c\u4e14\u76f4\u89c2\u4e0a\u4f1a\u5224\u65ad\u4e24\u5f20\u56fe\u50cf\u4e0d\u5b58\u5728\u5f88\u5927\u7684\u5dee\u5f02\u3002 PSNR\u4f4e\u4e8e 10dB\uff0c\u4eba\u7c7b\u5f88\u96be\u7528\u8089\u773c\u53bb\u5224\u65ad\u4e24\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u76f8\u540c\uff0c\u4e00\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u53e6\u4e00\u4e2a\u56fe\u50cf\u7684\u538b\u7f29\u7ed3\u679c\u3002 MS-SSIM \u00b6 Info Structural Similarity Index Measure \u7ed3\u6784\u76f8\u4f3c\u6027 \u91cf\u4e86\u4e24\u5f20\u56fe\u7247\u4e4b\u95f4\u7684\u76f8\u4f3c\u7a0b\u5ea6/\u8861\u91cf\u56fe\u7247\u7684\u5931\u771f\u7a0b\u5ea6\uff0c\u8003\u8651\u4e86\u56fe\u50cf\u7684\u4eae\u5ea6\u3001\u5bf9\u6bd4\u5ea6\u548c\u7ed3\u6784\u7b49\u65b9\u9762\uff0c\u800c MS-SSIM\u3002\u5728 SSIM \u7684\u57fa\u7840\u4e0a\u5f15\u5165\u591a\u4e2a\u5c3a\u5ea6 MS-SSIM\u7684\u503c\u8303\u56f4\u5728 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u63a5\u8fd1 1 \u8868\u793a\u91cd\u5efa\u56fe\u50cf\u4e0e\u539f\u59cb\u56fe\u50cf\u7684\u76f8\u4f3c\u5ea6\u8d8a\u9ad8\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d import cv2 import numpy as np def ms_ssim ( img1 , img2 ): # \u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf img1 = cv2 . cvtColor ( img1 , cv2 . COLOR_BGR2GRAY ) img2 = cv2 . cvtColor ( img2 , cv2 . COLOR_BGR2GRAY ) # \u8ba1\u7b97MS-SSIM weights = np . array ([ 0.0448 , 0.2856 , 0.3001 , 0.2363 , 0.1333 ]) # \u4e0d\u540c\u5c3a\u5ea6\u7684\u6743\u91cd levels = weights . size mssim = np . zeros ( levels ) mcs = np . zeros ( levels ) for i in range ( levels ): ssim_map , cs_map = ssim ( img1 , img2 ) mssim [ i ] = np . mean ( ssim_map ) mcs [ i ] = np . mean ( cs_map ) img1 = cv2 . resize ( img1 , ( img1 . shape [ 1 ] // 2 , img1 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) img2 = cv2 . resize ( img2 , ( img2 . shape [ 1 ] // 2 , img2 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) # \u6574\u4f53MS-SSIM\u8ba1\u7b97 overall_mssim = np . prod ( mcs [: - 1 ] ** weights [: - 1 ]) * ( mssim [ - 1 ] ** weights [ - 1 ]) return overall_mssim def ssim ( img1 , img2 , k1 = 0.01 , k2 = 0.03 , win_size = 11 , L = 255 ): C1 = ( k1 * L ) ** 2 C2 = ( k2 * L ) ** 2 # \u8ba1\u7b97\u5747\u503c\u548c\u65b9\u5dee mu1 = cv2 . GaussianBlur ( img1 , ( win_size , win_size ), 1.5 ) mu2 = cv2 . GaussianBlur ( img2 , ( win_size , win_size ), 1.5 ) mu1_sq = mu1 ** 2 mu2_sq = mu2 ** 2 mu1_mu2 = mu1 * mu2 sigma1_sq = cv2 . GaussianBlur ( img1 * img1 , ( win_size , win_size ), 1.5 ) - mu1_sq sigma2_sq = cv2 . GaussianBlur ( img2 * img2 , ( win_size , win_size ), 1.5 ) - mu2_sq sigma12 = cv2 . GaussianBlur ( img1 * img2 , ( win_size , win_size ), 1.5 ) - mu1_mu2 # \u8ba1\u7b97\u76f8\u4f3c\u6027\u5ea6\u91cf ssim_map = (( 2 * mu1_mu2 + C1 ) * ( 2 * sigma12 + C2 )) / (( mu1_sq + mu2_sq + C1 ) * ( sigma1_sq + sigma2_sq + C2 )) cs_map = ( 2 * sigma12 + C2 ) / ( sigma1_sq + sigma2_sq + C2 ) return ssim_map , cs_map # \u8bfb\u53d6\u56fe\u50cf img1 = cv2 . imread ( 'image1.jpg' ) img2 = cv2 . imread ( 'image2.jpg' ) # \u8ba1\u7b97MS-SSIM ms_ssim_score = ms_ssim ( img1 , img2 ) print ( \"MS-SSIM score:\" , ms_ssim_score ) LPIPS \u00b6 Info Learned Perceptual Image Patch Similarity \u5b66\u4e60\u611f\u77e5\u56fe\u50cf\u5757\u76f8\u4f3c\u5ea6 \u57fa\u4e8e\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u7528\u4e8e\u8bc4\u4f30\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf LPIPS\u7684\u5f97\u5206\u8303\u56f4\u901a\u5e38\u662f 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u5c0f\u8868\u793a\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf\u8d8a\u9ad8 \u4e0e\u4f20\u7edf\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff08\u5982PSNR\u548cSSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u66f4\u52a0\u6ce8\u91cd\u4e8e\u4eba\u773c\u611f\u77e5\u7684\u56e0\u7d20\uff0c\u80fd\u591f\u66f4\u597d\u5730\u6355\u6349\u5230\u56fe\u50cf\u4e4b\u95f4\u7684\u611f\u77e5\u5dee\u5f02 LPIPS\u662f\u4e00\u79cd\u57fa\u4e8e\u5b66\u4e60\u7684\u6307\u6807\uff0c\u5b83\u7684\u6027\u80fd\u53d7\u5230\u6240\u4f7f\u7528\u7684CNN\u6a21\u578b\u548c\u8bad\u7ec3\u6570\u636e\u7684\u5f71\u54cd\u3002\u56e0\u6b64\uff0c\u5728\u4f7f\u7528LPIPS\u8fdb\u884c\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u4e0e\u8bad\u7ec3\u6a21\u578b\u76f8\u4f3c\u7684\u6570\u636e\u96c6\u548c\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u4ee5\u4fdd\u8bc1\u8bc4\u4f30\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u53ef\u9760\u6027 import torch import torchvision.transforms as transforms from PIL import Image from models import dist_model # \u52a0\u8f7d\u9884\u8bad\u7ec3\u7684LPIPS\u6a21\u578b model = dist_model . DistModel () model . initialize ( model = 'net-lin' , net = 'alex' , use_gpu = True ) # \u56fe\u50cf\u9884\u5904\u7406 preprocess = transforms . Compose ([ transforms . Resize (( 256 , 256 )), transforms . ToTensor () ]) # \u52a0\u8f7d\u56fe\u50cf\u5e76\u8fdb\u884c\u9884\u5904\u7406 image1 = Image . open ( 'image1.jpg' ) . convert ( 'RGB' ) image2 = Image . open ( 'image2.jpg' ) . convert ( 'RGB' ) image1 = preprocess ( image1 ) . unsqueeze ( 0 ) image2 = preprocess ( image2 ) . unsqueeze ( 0 ) # \u5c06\u56fe\u50cf\u8f6c\u6362\u4e3aPyTorch\u5f20\u91cf\u5e76\u8ba1\u7b97LPIPS with torch . no_grad (): lpips_score = model . forward ( image1 , image2 ) . item () print ( \"LPIPS score:\" , lpips_score ) Comparison \u00b6 Quote PSNR\uff08Peak Signal-to-Noise Ratio\uff09\uff1aPSNR\u662f\u4e00\u79cd\u5e38\u7528\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff0c\u7528\u4e8e\u8861\u91cf\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u5b83\u901a\u8fc7\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u6765\u91cf\u5316\u4e24\u4e2a\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u6570\u503c\u8d8a\u9ad8\u8868\u793a\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d\u3002 MS-SSIM\uff08Multi-Scale Structural Similarity Index\uff09\uff1aMS-SSIM\u662f\u4e00\u79cd\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u5728\u8ba1\u7b97\u56fe\u50cf\u76f8\u4f3c\u6027\u65f6\u8003\u8651\u4e86\u591a\u4e2a\u5c3a\u5ea6\u7684\u4fe1\u606f\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08SSIM\uff09\u76f8\u6bd4\uff0cMS-SSIM\u5c06\u56fe\u50cf\u5206\u89e3\u6210\u591a\u4e2a\u5c3a\u5ea6\uff0c\u5e76\u5728\u6bcf\u4e2a\u5c3a\u5ea6\u4e0a\u8ba1\u7b97\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u6700\u540e\u53d6\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u7684\u76f8\u4f3c\u6027\u8bc4\u4f30\u3002MS-SSIM\u76f8\u8f83\u4e8ePSNR\u66f4\u80fd\u53cd\u6620\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002 LPIPS\uff08Learned Perceptual Image Patch Similarity\uff09\uff1aLPIPS\u662f\u4e00\u79cd\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u901a\u8fc7\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u6765\u5b66\u4e60\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u76f8\u4f3c\u6027\u3002LPIPS\u8003\u8651\u4e86\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u654f\u611f\u6027\uff0c\u901a\u8fc7\u8ba1\u7b97\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u8ddd\u79bb\u6765\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08\u5982SSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u5728\u5b66\u4e60\u611f\u77e5\u8ddd\u79bb\u65f6\u66f4\u52a0\u51c6\u786e\u548c\u5168\u9762\u3002 \u8fd9\u4e9b\u6307\u6807\u5728\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u4e2d\u90fd\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002PSNR\u4e3b\u8981\u7528\u4e8e\u8861\u91cf\u56fe\u50cf\u7684\u91cd\u5efa\u8bef\u5dee\uff0c\u800cMS-SSIM\u548cLPIPS\u66f4\u52a0\u5173\u6ce8\u4eba\u773c\u5bf9\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e0d\u540c\u7684\u6307\u6807\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u7efc\u5408\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002 Reference \u00b6 NeRF\u5e38\u7528\u8bc4\u4ef7\u6307\u6807\u90fd\u662f\u4ec0\u4e48\u610f\u601d\uff1fPSNR\u3001SSIM\u3001LPIPS\u8be6\u89e3 NeRF \u6a21\u578b\u8bc4\u4ef7\u6307\u6807PSNR,MS-SSIM, LPIPS \u8be6\u89e3\u548cpython\u5b9e\u73b0","title":"NeRF-Evaluation"},{"location":"cv/papers/nerf/nerf-evaluation/#nerf-evaluation","text":"\u7ea6 1033 \u4e2a\u5b57 114 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract NeRF \u5e38\u7528\u8bc4\u4ef7\u6307\u6807","title":"NeRF-Evaluation"},{"location":"cv/papers/nerf/nerf-evaluation/#psnr","text":"Info Peak Signal-to-Noise Ratio \u5cf0\u503c\u4fe1\u566a\u6bd4 \u8861\u91cf\u4e86\u4e00\u5f20\u566a\u58f0\u56fe\u50cf\u548c\u4e00\u5f20\u5e72\u51c0\u56fe\u50cf\u7684\u5dee\u5f02 PSNR\u901a\u8fc7\u8ba1\u7b97\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5747\u65b9\u8bef\u5dee\uff08Mean Squared Error\uff0cMSE\uff09\u6765\u91cf\u5316\u5b83\u4eec\u4e4b\u95f4\u7684\u5dee\u5f02\u3002 \u4e24\u5f20\u56fe\u8c61\u7684\u5dee\u5f02\u8d8a\u5c0f\uff0cMSE\u8d8a\u5c0f, PSNR\u5c31\u8d8a\u5927\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d \u3002 \\[ MSE = \\frac{1}{mn}\\sum_{i=0}^{m-1} \\sum_{j=0}^{n-1}[I(i, j) - K(i, j)]^2 \\\\ PSNR = 10 * \\log_{10}(\\frac{MAX_I^2}{MSE}) \\] \u5176\u4e2d \\(MAX\\) \u662f\u52a8\u6001\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5373\u67d0\u70b9 \\((i, j)\\) \u50cf\u7d20\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5982\u679c\u56fe\u50cf\u662f \\(8\\) \u4f4d\u7684\uff0c\u5219 \\(MAX = 2^8 - 1 = 255\\) from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) . astype ( np . float64 ) img2 = np . array ( Image . open ( 'compress.jpg' )) . astype ( np . float64 ) def psnr ( img1 , img2 ): mse = np . mean (( img1 - img2 ) ** 2 ) if mse == 0 : return float ( 'inf' ) else : return 20 * np . log10 ( 255 / np . sqrt ( mse )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) # -------- # from skimage.metrics import peak_signal_noise_ratio as psnr from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) img2 = np . array ( Image . open ( 'compress.jpg' )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) Tip PSNR\u63a5\u8fd1 50dB \uff0c\u4ee3\u8868\u538b\u7f29\u540e\u7684\u56fe\u50cf\u4ec5\u6709\u4e9b\u8bb8\u975e\u5e38\u5c0f\u7684\u8bef\u5dee\u3002 PSNR\u5927\u4e8e 30dB \uff0c\u4eba\u773c\u5f88\u96be\u67e5\u89c9\u538b\u7f29\u540e\u548c\u539f\u59cb\u5f71\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 20dB \u5230 30dB \u4e4b\u95f4\uff0c\u4eba\u773c\u5c31\u53ef\u4ee5\u5bdf\u89c9\u51fa\u56fe\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 10dB \u5230 20dB \u4e4b\u95f4\uff0c\u4eba\u773c\u8fd8\u662f\u53ef\u4ee5\u7528\u8089\u773c\u770b\u51fa\u8fd9\u4e2a\u56fe\u50cf\u539f\u59cb\u7684\u7ed3\u6784\uff0c\u4e14\u76f4\u89c2\u4e0a\u4f1a\u5224\u65ad\u4e24\u5f20\u56fe\u50cf\u4e0d\u5b58\u5728\u5f88\u5927\u7684\u5dee\u5f02\u3002 PSNR\u4f4e\u4e8e 10dB\uff0c\u4eba\u7c7b\u5f88\u96be\u7528\u8089\u773c\u53bb\u5224\u65ad\u4e24\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u76f8\u540c\uff0c\u4e00\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u53e6\u4e00\u4e2a\u56fe\u50cf\u7684\u538b\u7f29\u7ed3\u679c\u3002","title":"PSNR"},{"location":"cv/papers/nerf/nerf-evaluation/#ms-ssim","text":"Info Structural Similarity Index Measure \u7ed3\u6784\u76f8\u4f3c\u6027 \u91cf\u4e86\u4e24\u5f20\u56fe\u7247\u4e4b\u95f4\u7684\u76f8\u4f3c\u7a0b\u5ea6/\u8861\u91cf\u56fe\u7247\u7684\u5931\u771f\u7a0b\u5ea6\uff0c\u8003\u8651\u4e86\u56fe\u50cf\u7684\u4eae\u5ea6\u3001\u5bf9\u6bd4\u5ea6\u548c\u7ed3\u6784\u7b49\u65b9\u9762\uff0c\u800c MS-SSIM\u3002\u5728 SSIM \u7684\u57fa\u7840\u4e0a\u5f15\u5165\u591a\u4e2a\u5c3a\u5ea6 MS-SSIM\u7684\u503c\u8303\u56f4\u5728 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u63a5\u8fd1 1 \u8868\u793a\u91cd\u5efa\u56fe\u50cf\u4e0e\u539f\u59cb\u56fe\u50cf\u7684\u76f8\u4f3c\u5ea6\u8d8a\u9ad8\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d import cv2 import numpy as np def ms_ssim ( img1 , img2 ): # \u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf img1 = cv2 . cvtColor ( img1 , cv2 . COLOR_BGR2GRAY ) img2 = cv2 . cvtColor ( img2 , cv2 . COLOR_BGR2GRAY ) # \u8ba1\u7b97MS-SSIM weights = np . array ([ 0.0448 , 0.2856 , 0.3001 , 0.2363 , 0.1333 ]) # \u4e0d\u540c\u5c3a\u5ea6\u7684\u6743\u91cd levels = weights . size mssim = np . zeros ( levels ) mcs = np . zeros ( levels ) for i in range ( levels ): ssim_map , cs_map = ssim ( img1 , img2 ) mssim [ i ] = np . mean ( ssim_map ) mcs [ i ] = np . mean ( cs_map ) img1 = cv2 . resize ( img1 , ( img1 . shape [ 1 ] // 2 , img1 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) img2 = cv2 . resize ( img2 , ( img2 . shape [ 1 ] // 2 , img2 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) # \u6574\u4f53MS-SSIM\u8ba1\u7b97 overall_mssim = np . prod ( mcs [: - 1 ] ** weights [: - 1 ]) * ( mssim [ - 1 ] ** weights [ - 1 ]) return overall_mssim def ssim ( img1 , img2 , k1 = 0.01 , k2 = 0.03 , win_size = 11 , L = 255 ): C1 = ( k1 * L ) ** 2 C2 = ( k2 * L ) ** 2 # \u8ba1\u7b97\u5747\u503c\u548c\u65b9\u5dee mu1 = cv2 . GaussianBlur ( img1 , ( win_size , win_size ), 1.5 ) mu2 = cv2 . GaussianBlur ( img2 , ( win_size , win_size ), 1.5 ) mu1_sq = mu1 ** 2 mu2_sq = mu2 ** 2 mu1_mu2 = mu1 * mu2 sigma1_sq = cv2 . GaussianBlur ( img1 * img1 , ( win_size , win_size ), 1.5 ) - mu1_sq sigma2_sq = cv2 . GaussianBlur ( img2 * img2 , ( win_size , win_size ), 1.5 ) - mu2_sq sigma12 = cv2 . GaussianBlur ( img1 * img2 , ( win_size , win_size ), 1.5 ) - mu1_mu2 # \u8ba1\u7b97\u76f8\u4f3c\u6027\u5ea6\u91cf ssim_map = (( 2 * mu1_mu2 + C1 ) * ( 2 * sigma12 + C2 )) / (( mu1_sq + mu2_sq + C1 ) * ( sigma1_sq + sigma2_sq + C2 )) cs_map = ( 2 * sigma12 + C2 ) / ( sigma1_sq + sigma2_sq + C2 ) return ssim_map , cs_map # \u8bfb\u53d6\u56fe\u50cf img1 = cv2 . imread ( 'image1.jpg' ) img2 = cv2 . imread ( 'image2.jpg' ) # \u8ba1\u7b97MS-SSIM ms_ssim_score = ms_ssim ( img1 , img2 ) print ( \"MS-SSIM score:\" , ms_ssim_score )","title":"MS-SSIM"},{"location":"cv/papers/nerf/nerf-evaluation/#lpips","text":"Info Learned Perceptual Image Patch Similarity \u5b66\u4e60\u611f\u77e5\u56fe\u50cf\u5757\u76f8\u4f3c\u5ea6 \u57fa\u4e8e\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u7528\u4e8e\u8bc4\u4f30\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf LPIPS\u7684\u5f97\u5206\u8303\u56f4\u901a\u5e38\u662f 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u5c0f\u8868\u793a\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf\u8d8a\u9ad8 \u4e0e\u4f20\u7edf\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff08\u5982PSNR\u548cSSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u66f4\u52a0\u6ce8\u91cd\u4e8e\u4eba\u773c\u611f\u77e5\u7684\u56e0\u7d20\uff0c\u80fd\u591f\u66f4\u597d\u5730\u6355\u6349\u5230\u56fe\u50cf\u4e4b\u95f4\u7684\u611f\u77e5\u5dee\u5f02 LPIPS\u662f\u4e00\u79cd\u57fa\u4e8e\u5b66\u4e60\u7684\u6307\u6807\uff0c\u5b83\u7684\u6027\u80fd\u53d7\u5230\u6240\u4f7f\u7528\u7684CNN\u6a21\u578b\u548c\u8bad\u7ec3\u6570\u636e\u7684\u5f71\u54cd\u3002\u56e0\u6b64\uff0c\u5728\u4f7f\u7528LPIPS\u8fdb\u884c\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u4e0e\u8bad\u7ec3\u6a21\u578b\u76f8\u4f3c\u7684\u6570\u636e\u96c6\u548c\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u4ee5\u4fdd\u8bc1\u8bc4\u4f30\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u53ef\u9760\u6027 import torch import torchvision.transforms as transforms from PIL import Image from models import dist_model # \u52a0\u8f7d\u9884\u8bad\u7ec3\u7684LPIPS\u6a21\u578b model = dist_model . DistModel () model . initialize ( model = 'net-lin' , net = 'alex' , use_gpu = True ) # \u56fe\u50cf\u9884\u5904\u7406 preprocess = transforms . Compose ([ transforms . Resize (( 256 , 256 )), transforms . ToTensor () ]) # \u52a0\u8f7d\u56fe\u50cf\u5e76\u8fdb\u884c\u9884\u5904\u7406 image1 = Image . open ( 'image1.jpg' ) . convert ( 'RGB' ) image2 = Image . open ( 'image2.jpg' ) . convert ( 'RGB' ) image1 = preprocess ( image1 ) . unsqueeze ( 0 ) image2 = preprocess ( image2 ) . unsqueeze ( 0 ) # \u5c06\u56fe\u50cf\u8f6c\u6362\u4e3aPyTorch\u5f20\u91cf\u5e76\u8ba1\u7b97LPIPS with torch . no_grad (): lpips_score = model . forward ( image1 , image2 ) . item () print ( \"LPIPS score:\" , lpips_score )","title":"LPIPS"},{"location":"cv/papers/nerf/nerf-evaluation/#comparison","text":"Quote PSNR\uff08Peak Signal-to-Noise Ratio\uff09\uff1aPSNR\u662f\u4e00\u79cd\u5e38\u7528\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff0c\u7528\u4e8e\u8861\u91cf\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u5b83\u901a\u8fc7\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u6765\u91cf\u5316\u4e24\u4e2a\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u6570\u503c\u8d8a\u9ad8\u8868\u793a\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d\u3002 MS-SSIM\uff08Multi-Scale Structural Similarity Index\uff09\uff1aMS-SSIM\u662f\u4e00\u79cd\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u5728\u8ba1\u7b97\u56fe\u50cf\u76f8\u4f3c\u6027\u65f6\u8003\u8651\u4e86\u591a\u4e2a\u5c3a\u5ea6\u7684\u4fe1\u606f\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08SSIM\uff09\u76f8\u6bd4\uff0cMS-SSIM\u5c06\u56fe\u50cf\u5206\u89e3\u6210\u591a\u4e2a\u5c3a\u5ea6\uff0c\u5e76\u5728\u6bcf\u4e2a\u5c3a\u5ea6\u4e0a\u8ba1\u7b97\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u6700\u540e\u53d6\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u7684\u76f8\u4f3c\u6027\u8bc4\u4f30\u3002MS-SSIM\u76f8\u8f83\u4e8ePSNR\u66f4\u80fd\u53cd\u6620\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002 LPIPS\uff08Learned Perceptual Image Patch Similarity\uff09\uff1aLPIPS\u662f\u4e00\u79cd\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u901a\u8fc7\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u6765\u5b66\u4e60\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u76f8\u4f3c\u6027\u3002LPIPS\u8003\u8651\u4e86\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u654f\u611f\u6027\uff0c\u901a\u8fc7\u8ba1\u7b97\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u8ddd\u79bb\u6765\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08\u5982SSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u5728\u5b66\u4e60\u611f\u77e5\u8ddd\u79bb\u65f6\u66f4\u52a0\u51c6\u786e\u548c\u5168\u9762\u3002 \u8fd9\u4e9b\u6307\u6807\u5728\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u4e2d\u90fd\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002PSNR\u4e3b\u8981\u7528\u4e8e\u8861\u91cf\u56fe\u50cf\u7684\u91cd\u5efa\u8bef\u5dee\uff0c\u800cMS-SSIM\u548cLPIPS\u66f4\u52a0\u5173\u6ce8\u4eba\u773c\u5bf9\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e0d\u540c\u7684\u6307\u6807\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u7efc\u5408\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002","title":"Comparison"},{"location":"cv/papers/nerf/nerf-evaluation/#reference","text":"NeRF\u5e38\u7528\u8bc4\u4ef7\u6307\u6807\u90fd\u662f\u4ec0\u4e48\u610f\u601d\uff1fPSNR\u3001SSIM\u3001LPIPS\u8be6\u89e3 NeRF \u6a21\u578b\u8bc4\u4ef7\u6307\u6807PSNR,MS-SSIM, LPIPS \u8be6\u89e3\u548cpython\u5b9e\u73b0","title":"Reference"},{"location":"cv/papers/nerf/nerf/","text":"NeRF \u00b6 \u7ea6 2137 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract paper\uff1a NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis code\uff1a nerf_pytorch Idea \u00b6 Introduction \u00b6 \u901a\u8fc7\u4f18\u5316\u4e00\u7ec4\u7a00\u758f\u8f93\u5165\u89c6\u89d2\u7684\u8fde\u7eed\u4f53\u79ef\u573a\u51fd\u6570\uff0c\u5b9e\u73b0\u5408\u6210\u590d\u6742\u573a\u666f\u7684\u65b0\u89c6\u89d2\u3002 \u7528\u4e00\u4e2a \u5168\u94fe\u63a5\uff08\u975e\u5377\u79ef\uff09\u6df1\u5ea6\u7f51\u7edc \u8868\u793a\u573a\u666f\uff0c\u8f93\u5165\u662f\u4e00\u4e2a \u8fde\u7eed\u7684 5D \u5750\u6807\uff08 \\(x\\) , \\(y\\) , \\(z\\) , \\(\\theta\\) , \\(\\phi\\) \u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff09\uff0c\u8f93\u51fa\u662f \u8be5\u7a7a\u95f4\u4f4d\u7f6e\u5904\u7684\u4f53\u79ef\u5bc6\u5ea6\u548c\u89c6\u89d2\u76f8\u5173\u7684\u8f90\u5c04\u5f3a\u5ea6 \u3002 \u901a\u8fc7\u67e5\u8be2\u76f8\u673a\u5149\u7ebf\u4e0a 5D \u5750\u6807\u6765\u5408\u6210\u89c6\u89d2\uff0c\u5e76\u7528\u4f53\u6e32\u67d3\u6280\u672f\u5c06\u8f93\u51fa\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u6295\u5f71\u5230\u56fe\u50cf\u4e2d \u3002 \u7531\u4e8e\u4f53\u6e32\u67d3\u5728\u81ea\u7136\u4e0a\u662f\u53ef\u5fae\u5206\u7684\uff0c \u4f18\u5316\u6211\u4eec\u7684\u8868\u793a\u6240\u9700\u7684\u552f\u4e00\u8f93\u5165\u662f\u4e00\u7ec4\u5177\u6709\u5df2\u77e5\u76f8\u673a\u59ff\u6001\u7684\u56fe\u50cf \uff0c\u5305\u62ec\u4e00\u79cd\u5206\u5c42\u91c7\u6837\u7b56\u7565\uff0c\u5c06 MLP \u7684\u5bb9\u91cf\u5206\u914d\u7ed9\u5177\u6709\u53ef\u89c1\u573a\u666f\u5185\u5bb9\u7684\u7a7a\u95f4\u3002 \u4e00\u79cd \u4f4d\u7f6e\u7f16\u7801 \uff0c\u5c06\u6bcf\u4e2a\u8f93\u5165\u7684 5D \u5750\u6807\u6620\u5c04\u5230\u66f4\u9ad8\u7ef4\u5ea6\u7684\u7a7a\u95f4\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u5b66\u4e60\u8868\u793a\u5177\u6709\u66f4\u9ad8\u9891\u7387\u7684\u573a\u666f\u5185\u5bb9 NeRF Scene Representation \u00b6 \u4e0b\u56fe\u4e2d\u95f4\u7684\u51fd\u6570 \\(F\\) \u5c31\u662f\u56fe\u5f53\u4e2d\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u7528\u6765\u8868\u793a 3D \u573a\u666f\uff0c\u8fd9\u79cd\u8868\u793a\u65b9\u6cd5\u662f \u9690\u5f0f \u7684 \u8f93\u5165 \\(x,y,z,\\theta,\\phi\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB, \\sigma\\) \u662f\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u7684\u989c\u8272\u548c\u5bc6\u5ea6 Volume Rendering \u00b6 \u5149\u7ebf\u7684\u6570\u5b66\u8868\u793a\u4e0e\u5149\u7ebf\u91c7\u6837 \u00b6 \u4e00\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u7684\u5408\u6210\uff0c\u5c31\u662f\u6210\u50cf\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u90a3\u4e48\u8fd9\u6761\u5149\u7ebf\u600e\u4e48\u8868\u793a\uff1f\u4ee5\u53ca\u600e\u4e48\u5728\u5149\u7ebf\u4e0a\u53d6\u4e00\u4e9b\u70b9\uff1f nerf \u7684\u5149\u7ebf\u8868\u793a \u00b6 \u5149\u7ebf\u662f\u4e00\u6761\u7a7a\u95f4\u76f4\u7ebf\uff0c\u51c6\u786e\u7684\u8bf4\u662f\u4e00\u6761\u7a7a\u95f4\u5c04\u7ebf\uff0c\u8868\u793a\u5982\u4e0b \\[ \\bold{r}(t) = \\bold{c} + t\\bold{d} \\] \u8d77\u70b9\u5750\u6807 \\(\\bold{o}\\) \uff1a\u76f8\u673a\u4e2d\u5fc3\u70b9 \u65b9\u5411\u5411\u91cf \\(\\bold{d}\\) \uff1a\u76f8\u673a\u5149\u7ebf\u65b9\u5411 \\(t\\) \uff1a\u5149\u7ebf\u4e0a\u7684\u70b9\u5230\u8d77\u70b9\u7684\u6c34\u5e73\u8ddd\u79bb\uff0c \\(t\\) \u53d6\u4e0d\u540c\u7684\u503c\u5c31\u662f\u5149\u7ebf\u4e0a\u4e0d\u540c\u7684\u91c7\u6837\u70b9 nerf \u5149\u7ebf\u516c\u5f0f\u63a8\u5bfc \u00b6 \u7ecf\u8bc1\u660e\u540e NeRF \u7684 \\(t\\) \u53d6\u7684\u662f z \u8f74\u8ddd\u79bb\uff0c\u800c\u4e0d\u662f\u5149\u7ebf\u7684\u8ddd\u79bb\uff0c\u800c\u4e14\u53ea\u6709\u4e2d\u5fc3\u5149\u7ebf\u65b9\u5411\u662f\u5355\u4f4d\u5411\u91cf\u3002 \\[ \\bold{r} = \\bold{o} + \\|z\\|\\bold{d} \\] \u5149\u7ebf\u91c7\u6837 \u00b6 \\(t=\\|z\\|\\) \uff1a\u5149\u7ebf\u4e0a\u7684\u70b9\u5230\u8d77\u70b9\uff08\u76f8\u673a\u4e2d\u5fc3\uff09\u7684\u8ddd\u79bb\uff0c \\(t\\) \u53d6\u4e0d\u540c\u503c\u5c31\u662f\u5149\u7ebf\u4e0a\u4e0d\u540c\u7684\u91c7\u6837\u70b9\uff0cnerf \u9ed8\u8ba4\u53d6 61 \u4e2a\u70b9\uff0c60 \u6bb5\u3002 \\(\\bold{r}(t)\\) \uff1a\u5149\u7ebf\u4e0a\u7684\u70b9\u7684\u4e09\u7ef4\u5750\u6807\u3002 \\(\\bold{d}\\) \uff1a\u5149\u7ebf\u65b9\u5411\u5411\u91cf\uff0c\u4e5f\u662f\u4e09\u4e2a\u503c\u3002 Code def get_rays ( H , W , K , c2w ): i , j = torch . meshgrid ( torch . linspace ( 0 , W - 1 , W ), torch . linspace ( 0 , H - 1 , H )) i = i . t () j = j . t () dirs = torch . stack ([( i - K [ 0 ][ 2 ]) / K [ 0 ][ 0 ], - ( j - K [ 1 ][ 2 ]) / K [ 1 ][ 1 ], - torch . ones_like ( i )], - 1 ) rays_d = torch . sum ( dirs [ ... , np . newaxis , :] * c2w [: 3 ,: 3 ], - 1 ) rays_o = c2w [: 3 , - 1 ] . expand ( rays_d . shape ) return rays_o , rays_d #\u8ba1\u7b97\u5149\u7ebf\u91c7\u6837 z_vals = tf . linspace ( near , far , N_samples ) pts = rays_o [ ... , None ,:] + rays_d [ ... , None ,:] * z_vals [ ... ,:, None ] dirs \u662f\u76f8\u673a\u5750\u6807\u7cfb\u4e0b\u7684\u5149\u7ebf\u65b9\u5411\u3002 rays_d \u662f\u4e16\u754c\u5750\u6807\u7cfb\u4e0b\u7684\u5149\u7ebf\u65b9\u5411\uff0c\u4e3a\u4ec0\u4e48\u7528\u70b9\u4e58\uff0b\u6c42\u548c\uff1a\u56e0\u4e3a\u8f93\u5165\u662f\u884c\u5411\u91cf\uff08python\u6ca1\u6709\u4e00\u7ef4\u5217\u5411\u91cf\uff09\u4e0d\u80fd\u76f4\u63a5\u50cf\u5217\u5411\u91cf\u90a3\u6837\u7528\u77e9\u9635\u4e58\u6cd5\u3002 rays_o \u662f\u4e16\u754c\u5750\u6807\u7cfb\u4e0b\u7684\u5149\u7ebf\u8d77\u70b9\u3002 \u5149\u7ebf\u6210\u50cf\u6a21\u578b \u00b6 \u600e\u4e48\u5408\u6210\u4e00\u6761\u5149\u7ebf\u4e0a\u7684\u6240\u6709\u7c92\u5b50\u7684\u56fe\u50cf? \u5206\u6790\u5355\u70b9 P \u5bf9\u6210\u50cf\u7684\u8d21\u732e\u3002P \u8ddd\u79bb\u7ebf\u8d77\u70b9\u7684\u8ddd\u79bb\u662f t\uff0c\u7136\u540e\u80fd\u5f97\u51fa P \u70b9\u5750\u6807 \\(\\bold{r}(t)\\) \u5bc6\u5ea6\u8d8a\u9ad8\uff0c\u900f\u660e\u5ea6\u8d8a\u4f4e\uff0c\u6240\u4ee5\u5355\u770bP\u70b9\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot \\sigma\\) \\(\\sigma = 1.0\\) \uff1a\u5b8c\u5168\u4e0d\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 1.0=c\\) \\(\\sigma = 0.0\\) \uff1a\u5b8c\u6210\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 0.0=0\\) \u540c\u65f6\uff0c\u5149\u7ebf\u4ece\u76f8\u673a\u51fa\u53d1\uff0c\u7531\u4e8e\u5bc6\u5ea6 \\(\\sigma\\) \u7684\u5b58\u5728\uff0c\u5f3a\u5ea6\u4e0d\u65ad\u51cf\u5f31\uff0c\u4e0d\u4e00\u5b9a\u80fd\u5230\u5230 P \u70b9\uff0c\u5230\u8fbe\u7684\u6982\u7387\u65f6\u8bb0\u4e3a \\(\\bold{T}(t)\\) \u3002 \u53ef\u4ee5\u60f3\u8c61\uff0c \\(\\bold{\u03a4}\\) \u5e94\u8be5\u662f\u5bc6\u5ea6 \\(\\sigma\\) \u548c\u8ddd\u79bb \\(t\\) \u7684\u51fd\u6570 \u90a3\u4e48\u6c47\u603b\u5230\u4e00\u8d77\uff1a\u573a\u666f\u4e2d\u4e00\u70b9P\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u8d21\u732e\uff1a \\(\\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t))\\) \u3002 \u5176\u4e2d \\(\\bold{r}(t)\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u7684\u5750\u6807\uff0c \\(\\bold{d}\\) \u662f\u5149\u7ebf\u65b9\u5411\uff0c \\(t\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u4e0e\u76f8\u673a\u4e2d\u5fc3\u8ddd\u79bb\u3002 \u6574\u6761\u5149\u7ebf\u6210\u50cf\uff1a\u77e5\u9053\u4e86\u7684\u5355\u70b9\uff0c\u6574\u6761\u5149\u7ebf\u6210\u50cf\u5c31\u662f\u5bf9\u5149\u7ebf\u4e0a\u6240\u6709\u7684\u70b9\u6c42\u79ef\u5206\uff0c\u4e14\u8003\u8651\u5149\u7ebf\u53ea\u9700\u6709\u9650\u533a\u95f4 \\(t_n-t_f\\) \u4e4b\u95f4\uff0c\u5f97\u5149\u7ebf \\(r\\) \u6210\u50cf\uff1a \\[ C(r) = \\int_{t_n}^{t_f} \\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t)) dt \\ \\ \\ where \\ \\bold{T}(t) = \\exp(-\\int_{t_n}^{t_f} \\sigma(s) ds) \\] NeRF \u4e2d\u5206\u6bb5\u968f\u673a\u91c7\u6837 \u8ba1\u7b97\u673a\u662f\u65e0\u6cd5\u8fde\u7eed\u79ef\u5206\uff0c\u56e0\u6b64\u91c7\u6837\u662f\u9700\u8981\u8fd1\u4f3c\u79bb\u6563\u7684\u3002 \u5982\u679c\u9009\u62e9\u5728\u5149\u7ebf\u8def\u5f84\u4e0a\u5747\u5300\u91c7\u6837\uff0c\u867d\u7136\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u8fd1\u4f3c\u8fd9\u4e2a\u79ef\u5206\uff0c\u4f46\u8fd9\u79cd\u2f45\u6cd5\u5728\u5904\u7406\u5bc6\u5ea6\u8f83\u2fbc\u7684\u533a\u57df\u6216\u8005\u5feb\u901f\u53d8\u5316\u7684\u533a\u57df\u65f6\u6548\u679c\u5e76\u4e0d\u597d\u3002\u56e0\u4e3a\u8fd9\u4e9b\u533a\u57df\u53ef\u80fd\u9700\u8981\u66f4\u2fbc\u7684\u91c7\u6837\u5bc6\u5ea6\u6765\u51c6\u786e\u5730\u4f30\u8ba1\u79ef\u5206\u3002 \u2fb8\u5148\u5c06\u5c04\u7ebf\u9700\u8981\u79ef\u5206\u7684\u533a\u57df\u5206\u4e3aN\u4efd\uff0c\u7136\u540e\u5728\u6bcf\u2f00\u4e2a\u2f29\u533a\u57df\u4e2d\u8fdb\u2f8f\u5747\u5300\u968f\u673a\u91c7\u6837\u3002\u8fd9\u6837\u7684\u2f45\u5f0f\u80fd\u591f\u5728\u53ea\u91c7\u6837\u79bb\u6563\u70b9\u7684\u524d\u63d0\u4e0b\uff0c\u4fdd\u8bc1\u91c7\u6837\u4f4d\u7f6e\u7684\u8fde\u7eed\u6027\u3002 \\[ t_i\\thicksim\\mathcal{U}{\\left[t_n+\\frac{i-1}N(t_f-t_n),\\mathrm{~}t_n+\\frac iN(t_f-t_n)\\right]}. \\] Optimizing NeRF \u00b6 Positional encoding \u00b6 \u5bf9\u795e\u7ecf\u7f51\u7edc\u76f4\u63a5\u8f93\u5165 5D \u4f1a\u5bfc\u81f4\u6e32\u67d3\u6548\u679c\u8f83\u5dee\uff0c\u4e0d\u80fd\u5f88\u597d\u5730\u8868\u793a\u989c\u8272\u548c\u51e0\u4f55\u4e2d\u9ad8\u9891\u53d8\u5316\u3002 \u5c06\u8f93\u5165\u7684\u4e09\u7ef4\u5750\u6807\u8fdb\u884c\u4f4d\u7f6e\u7f16\u7801\uff1a \\[ F_\\mathcal{\\theta} = F_{\\mathcal{\\theta}}^\\prime \\gamma \\\\ \\gamma(p)=\\begin{pmatrix}\\sin\\bigl(2^0\\pi p\\bigr),\\cos\\bigl(2^0\\pi p\\bigr),&\\cdots,\\sin\\bigl(2^{L-1}\\pi p\\bigr), \\cos\\bigl(2^{L-1}\\pi p\\bigr)\\end{pmatrix}. \\] Hierarchical volume sampling \u00b6 NeRF \u7684\u6e32\u67d3\u8fc7\u7a0b\u8ba1\u7b97\u91cf\u5f88\u5927\uff0c\u6bcf\u6761\u5c04\u7ebf\u90fd\u8981\u91c7\u6837\u5f88\u591a\u70b9\uff0c\u4f46\u5b9e\u9645\u4e0a\uff0c\u4e00\u6761\u5c04\u7ebf\u4e0a\u7684\u5927\u90e8\u5206\u533a\u57df\u90fd\u662f\u7a7a\u533a\u57df\uff0c\u6216\u88ab\u906e\u6321\u7684\u533a\u57df\uff0c\u5bf9\u6700\u7ec8\u7684\u989c\u8272\u6ca1\u6709\u8d21\u732e\u3002 \u56e0\u6b64\u91c7\u7528\u4e00\u79cd coarse to fine \u7684\u5f62\u5f0f\uff0c\u540c\u65f6\u4f18\u5316 coarse \u7f51\u7edc\u548c fine \u7f51\u7edc\u3002\u5148\u5728\u5149\u7ebf\u4e0a\u5747\u5300\u91c7\u6837\u4e00\u4e9b\u70b9\uff0c\u5e76\u8ba1\u7b97\u5176\u4f53\u79ef\u5bc6\u5ea6\uff0c\u7136\u540e\u57fa\u4e8e\u8fd9\u4e9b\u5bc6\u5ea6\u503c\u8fdb\u884c\u91cd\u91c7\u6837\uff0c\u5f97\u5230\u66f4\u503e\u5411\u4e8e\u7269\u4f53\u5185\u90e8\u548c\u8868\u9762\u7684\u70b9\uff0c\u4ee5\u63d0\u9ad8\u6e32\u67d3\u6548\u679c\u3002 Loss Fn and Train \u00b6 \u5bf9\u4e8e\u6bcf\u4e2a\u573a\u666f\uff0c\u9488\u5bf9\u5355\u72ec\u7684\u795e\u7ecf\u8fde\u7eed\u4f53\u79ef\u8868\u793a\u7f51\u7edc\u8fdb\u884c\u4f18\u5316\u3002\u9700\u8981\u573a\u666f\u7684 RGB \u56fe\u50cf\u6570\u636e\u96c6\u3001\u76f8\u5e94\u7684\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\uff0c\u4ee5\u53ca\u573a\u666f\u8fb9\u754c\uff08\u5bf9\u4e8e\u5408\u6210\u6570\u636e\uff0c\u4f7f\u7528\u771f\u5b9e\u7684\u76f8\u673a\u4f4d\u59ff\u3001\u5185\u53c2\u548c\u8fb9\u754c\uff0c\u5bf9\u4e8e\u771f\u5b9e\u6570\u636e\uff0c\u4f7f\u7528 COLMAP \u4f30\u8ba1\u8fd9\u4e9b\u53c2\u6570\uff09 \u6bcf\u6b21\u8fed\u4ee3\uff0c\u4ece\u6570\u636e\u96c6\u4e2d\u6240\u6709\u50cf\u7d20\u4e2d\u968f\u673a\u91c7\u6837\u4e00\u4e2a batch \u7684\u76f8\u673a\u5149\u7ebf\uff0c\u7136\u540e\u6839\u636e\u5206\u5c42\u91c7\u6837\u65b9\u6cd5\u4ece coarse \u7f51\u7edc\u67e5\u8be2 \\(N_c\\) \u4e2a\u6837\u672c\u548c\u4ece fine \u7f51\u7edc\u4e2d\u67e5\u8be2 \\(N_c + N_f\\) \u4e2a\u6602\u672c\uff0c\u518d\u6839\u636e\u4f53\u6e32\u67d3\u5f97\u5230\u6bcf\u6761\u5149\u7ebf\u7684\u989c\u8272 \u635f\u5931\u51fd\u6570\u4ec5\u4ec5\u662f coarse \u548c fine \u7684\u6e32\u67d3\u50cf\u7d20\u989c\u8272\u4e0e\u771f\u5b9e\u989c\u8272\u4e4b\u95f4\u7684\u603b\u5e73\u65b9\u5dee\u8bef\u5dee\uff0c\u540c\u65f6\u4f18\u5316 coarse \u548c fine \\[ \\mathcal{L} = \\sum_{r \\in R} \\left [ \\left \\| \\hat{C}_c(r) - C(r) \\right \\|_2^2 - \\left \\| \\hat{C}_f(r) - C(r) \\right \\|_2^2 \\right ] \\] Pipeline \u00b6 \u5df2\u77e5\u76f8\u673a\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\u62cd\u6444\u4e86\u4e00\u7ec4\u76ee\u6807\u573a\u666f\u7684\u7167\u7247\u3002\uff08\u5982\u679c\u4f60\u662f\u624b\u673a\u62cd\u6444\u7684\u4e00\u6bb5\u89c6\u9891\u53ef\u4ee5\u7528 colormap \u8f6c\uff09 \u4ece\u76f8\u673a\u4e2d\u5fc3\u5f00\u59cb\uff0c\u6cbf\u7740\u67d0\u4e2a\u50cf\u7d20\u65b9\u5411\u53d1\u5c04\u4e00\u6761\u5149\u7ebf\u3002(\u6ce8\u610f\uff1a\u8ddf\u771f\u5b9e\u7684\u76f8\u673a\u6210\u50cf\u6a21\u578b\u5149\u7ebf\u65b9\u5411\u662f\u76f8\u53cd\u7684\uff0c\u4f46\u4e0d\u5f71\u54cd)\u3002 \u5efa\u7acb\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc \\(F\\) \uff0c\u8f93\u5165 \\((x,y,z,\\theta,\\phi)\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB,\\sigma\\) \u989c\u8272\u548c\u5bc6\u5ea6\u3002\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u3002 \u628a\u8fd9\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u5408\u6210\uff0c\u5c31\u80fd\u7b97\u51fa\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\u3002 \u6839\u636e\u8f93\u5165\u7684\u4e00\u7ec4\u56fe\u50cf\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u751f\u6210\u65e0\u6570\u6761\u5149\u7ebf\uff0c\u4e0d\u65ad\u53bb\u4f18\u5316\u53ef\u5fae\u51fd\u6570 \\(F\\) \u3002\u5f53\u4f18\u5316\u6b21\u6570\u8db3\u591f\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\(F\\) \u7b97\u51fa\u6240\u6709\u89c6\u89d2\u4e0b\u56fe\u50cf\u7684\u50cf\u7d20 RGB \u503c\u3002 \u77e5\u9053\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u7528 Marching Cubes \u7b97\u6cd5\u8f6c\u6362\u4e3a\u4e09\u89d2\u7f51\u4e09\u7ef4\u6a21\u578b\u3002\u5b8c\u6210\u4e09\u7ef4\u91cd\u5efa\u3002 \u6c42\u5f97 \\(F\\) \u5c31\u5b9e\u73b0\u4e86\u4e09\u7ef4\u91cd\u5efa\uff0c\u540e\u9762\u90fd\u662f\u5408\u6210\u65b0\u89c6\u89d2\u548c\u8f6c\u6362\u3002 \u57fa\u672c\u539f\u7406 \u4f5c\u8005\u9996\u5148\u628a\u91cd\u5efa\u8fc7\u7a0b \\(F\\) \u7528\u6df1\u5ea6\u5b66\u4e60\u4ee3\u66ff\uff0c \\(F(x,y,z,\\theta,\\phi)=RGB\\sigma\\) \u4ece\uff08\u7a7a\u95f4\u4f4d\u7f6e\u3001\u89c2\u5bdf\u65b9\u5411\uff09\u5230\uff08\u989c\u8272\u3001\u5bc6\u5ea6\uff09\u7684\u8fc7\u7a0b\u3002 \u4f5c\u8005\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u5149\u5b66\u6a21\u578b\u505a\u4e86\u5047\u8bbe\uff0c\u5efa\u7acb\u4e00\u4e2a\u6570\u5b66\u6a21\u578b\u3002 \u6839\u636e\u5149\u7ebf\u6210\u50cf\u4e0e\u8f93\u5165\u50cf\u7d20\u4e0d\u540c\u4e0d\u65ad\u4f18\u5316\uff0c\u8fdb\u800c\u4f18\u5316\u5f97\u51fa \\(F\\) \u3002 \u7b97\u6cd5\u7684\u5173\u952e\uff1a \u5149\u7ebf\u6210\u50cf\u6a21\u578b \u3002 Experiment \u00b6 \u4e0b\u56fe\u662f Instant-NGP \u5b9e\u9a8c\uff1a Reference \u00b6 nerf-learn NeRF\u5f00\u7bc7\u8bba\u6587\u89e3\u8bfb NeRF \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-NeRF\u5168\u89e3\uff08\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f\uff09 https://cloud.baidu.com/article/2741971","title":"NeRF"},{"location":"cv/papers/nerf/nerf/#nerf","text":"\u7ea6 2137 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract paper\uff1a NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis code\uff1a nerf_pytorch","title":"NeRF"},{"location":"cv/papers/nerf/nerf/#idea","text":"","title":"Idea"},{"location":"cv/papers/nerf/nerf/#introduction","text":"\u901a\u8fc7\u4f18\u5316\u4e00\u7ec4\u7a00\u758f\u8f93\u5165\u89c6\u89d2\u7684\u8fde\u7eed\u4f53\u79ef\u573a\u51fd\u6570\uff0c\u5b9e\u73b0\u5408\u6210\u590d\u6742\u573a\u666f\u7684\u65b0\u89c6\u89d2\u3002 \u7528\u4e00\u4e2a \u5168\u94fe\u63a5\uff08\u975e\u5377\u79ef\uff09\u6df1\u5ea6\u7f51\u7edc \u8868\u793a\u573a\u666f\uff0c\u8f93\u5165\u662f\u4e00\u4e2a \u8fde\u7eed\u7684 5D \u5750\u6807\uff08 \\(x\\) , \\(y\\) , \\(z\\) , \\(\\theta\\) , \\(\\phi\\) \u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff09\uff0c\u8f93\u51fa\u662f \u8be5\u7a7a\u95f4\u4f4d\u7f6e\u5904\u7684\u4f53\u79ef\u5bc6\u5ea6\u548c\u89c6\u89d2\u76f8\u5173\u7684\u8f90\u5c04\u5f3a\u5ea6 \u3002 \u901a\u8fc7\u67e5\u8be2\u76f8\u673a\u5149\u7ebf\u4e0a 5D \u5750\u6807\u6765\u5408\u6210\u89c6\u89d2\uff0c\u5e76\u7528\u4f53\u6e32\u67d3\u6280\u672f\u5c06\u8f93\u51fa\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u6295\u5f71\u5230\u56fe\u50cf\u4e2d \u3002 \u7531\u4e8e\u4f53\u6e32\u67d3\u5728\u81ea\u7136\u4e0a\u662f\u53ef\u5fae\u5206\u7684\uff0c \u4f18\u5316\u6211\u4eec\u7684\u8868\u793a\u6240\u9700\u7684\u552f\u4e00\u8f93\u5165\u662f\u4e00\u7ec4\u5177\u6709\u5df2\u77e5\u76f8\u673a\u59ff\u6001\u7684\u56fe\u50cf \uff0c\u5305\u62ec\u4e00\u79cd\u5206\u5c42\u91c7\u6837\u7b56\u7565\uff0c\u5c06 MLP \u7684\u5bb9\u91cf\u5206\u914d\u7ed9\u5177\u6709\u53ef\u89c1\u573a\u666f\u5185\u5bb9\u7684\u7a7a\u95f4\u3002 \u4e00\u79cd \u4f4d\u7f6e\u7f16\u7801 \uff0c\u5c06\u6bcf\u4e2a\u8f93\u5165\u7684 5D \u5750\u6807\u6620\u5c04\u5230\u66f4\u9ad8\u7ef4\u5ea6\u7684\u7a7a\u95f4\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u5b66\u4e60\u8868\u793a\u5177\u6709\u66f4\u9ad8\u9891\u7387\u7684\u573a\u666f\u5185\u5bb9","title":"Introduction"},{"location":"cv/papers/nerf/nerf/#nerf-scene-representation","text":"\u4e0b\u56fe\u4e2d\u95f4\u7684\u51fd\u6570 \\(F\\) \u5c31\u662f\u56fe\u5f53\u4e2d\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u7528\u6765\u8868\u793a 3D \u573a\u666f\uff0c\u8fd9\u79cd\u8868\u793a\u65b9\u6cd5\u662f \u9690\u5f0f \u7684 \u8f93\u5165 \\(x,y,z,\\theta,\\phi\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB, \\sigma\\) \u662f\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u7684\u989c\u8272\u548c\u5bc6\u5ea6","title":"NeRF Scene Representation"},{"location":"cv/papers/nerf/nerf/#volume-rendering","text":"","title":"Volume Rendering"},{"location":"cv/papers/nerf/nerf/#_1","text":"\u4e00\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u7684\u5408\u6210\uff0c\u5c31\u662f\u6210\u50cf\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u90a3\u4e48\u8fd9\u6761\u5149\u7ebf\u600e\u4e48\u8868\u793a\uff1f\u4ee5\u53ca\u600e\u4e48\u5728\u5149\u7ebf\u4e0a\u53d6\u4e00\u4e9b\u70b9\uff1f","title":"\u5149\u7ebf\u7684\u6570\u5b66\u8868\u793a\u4e0e\u5149\u7ebf\u91c7\u6837"},{"location":"cv/papers/nerf/nerf/#_3","text":"\u600e\u4e48\u5408\u6210\u4e00\u6761\u5149\u7ebf\u4e0a\u7684\u6240\u6709\u7c92\u5b50\u7684\u56fe\u50cf? \u5206\u6790\u5355\u70b9 P \u5bf9\u6210\u50cf\u7684\u8d21\u732e\u3002P \u8ddd\u79bb\u7ebf\u8d77\u70b9\u7684\u8ddd\u79bb\u662f t\uff0c\u7136\u540e\u80fd\u5f97\u51fa P \u70b9\u5750\u6807 \\(\\bold{r}(t)\\) \u5bc6\u5ea6\u8d8a\u9ad8\uff0c\u900f\u660e\u5ea6\u8d8a\u4f4e\uff0c\u6240\u4ee5\u5355\u770bP\u70b9\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot \\sigma\\) \\(\\sigma = 1.0\\) \uff1a\u5b8c\u5168\u4e0d\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 1.0=c\\) \\(\\sigma = 0.0\\) \uff1a\u5b8c\u6210\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 0.0=0\\) \u540c\u65f6\uff0c\u5149\u7ebf\u4ece\u76f8\u673a\u51fa\u53d1\uff0c\u7531\u4e8e\u5bc6\u5ea6 \\(\\sigma\\) \u7684\u5b58\u5728\uff0c\u5f3a\u5ea6\u4e0d\u65ad\u51cf\u5f31\uff0c\u4e0d\u4e00\u5b9a\u80fd\u5230\u5230 P \u70b9\uff0c\u5230\u8fbe\u7684\u6982\u7387\u65f6\u8bb0\u4e3a \\(\\bold{T}(t)\\) \u3002 \u53ef\u4ee5\u60f3\u8c61\uff0c \\(\\bold{\u03a4}\\) \u5e94\u8be5\u662f\u5bc6\u5ea6 \\(\\sigma\\) \u548c\u8ddd\u79bb \\(t\\) \u7684\u51fd\u6570 \u90a3\u4e48\u6c47\u603b\u5230\u4e00\u8d77\uff1a\u573a\u666f\u4e2d\u4e00\u70b9P\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u8d21\u732e\uff1a \\(\\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t))\\) \u3002 \u5176\u4e2d \\(\\bold{r}(t)\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u7684\u5750\u6807\uff0c \\(\\bold{d}\\) \u662f\u5149\u7ebf\u65b9\u5411\uff0c \\(t\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u4e0e\u76f8\u673a\u4e2d\u5fc3\u8ddd\u79bb\u3002 \u6574\u6761\u5149\u7ebf\u6210\u50cf\uff1a\u77e5\u9053\u4e86\u7684\u5355\u70b9\uff0c\u6574\u6761\u5149\u7ebf\u6210\u50cf\u5c31\u662f\u5bf9\u5149\u7ebf\u4e0a\u6240\u6709\u7684\u70b9\u6c42\u79ef\u5206\uff0c\u4e14\u8003\u8651\u5149\u7ebf\u53ea\u9700\u6709\u9650\u533a\u95f4 \\(t_n-t_f\\) \u4e4b\u95f4\uff0c\u5f97\u5149\u7ebf \\(r\\) \u6210\u50cf\uff1a \\[ C(r) = \\int_{t_n}^{t_f} \\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t)) dt \\ \\ \\ where \\ \\bold{T}(t) = \\exp(-\\int_{t_n}^{t_f} \\sigma(s) ds) \\] NeRF \u4e2d\u5206\u6bb5\u968f\u673a\u91c7\u6837 \u8ba1\u7b97\u673a\u662f\u65e0\u6cd5\u8fde\u7eed\u79ef\u5206\uff0c\u56e0\u6b64\u91c7\u6837\u662f\u9700\u8981\u8fd1\u4f3c\u79bb\u6563\u7684\u3002 \u5982\u679c\u9009\u62e9\u5728\u5149\u7ebf\u8def\u5f84\u4e0a\u5747\u5300\u91c7\u6837\uff0c\u867d\u7136\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u8fd1\u4f3c\u8fd9\u4e2a\u79ef\u5206\uff0c\u4f46\u8fd9\u79cd\u2f45\u6cd5\u5728\u5904\u7406\u5bc6\u5ea6\u8f83\u2fbc\u7684\u533a\u57df\u6216\u8005\u5feb\u901f\u53d8\u5316\u7684\u533a\u57df\u65f6\u6548\u679c\u5e76\u4e0d\u597d\u3002\u56e0\u4e3a\u8fd9\u4e9b\u533a\u57df\u53ef\u80fd\u9700\u8981\u66f4\u2fbc\u7684\u91c7\u6837\u5bc6\u5ea6\u6765\u51c6\u786e\u5730\u4f30\u8ba1\u79ef\u5206\u3002 \u2fb8\u5148\u5c06\u5c04\u7ebf\u9700\u8981\u79ef\u5206\u7684\u533a\u57df\u5206\u4e3aN\u4efd\uff0c\u7136\u540e\u5728\u6bcf\u2f00\u4e2a\u2f29\u533a\u57df\u4e2d\u8fdb\u2f8f\u5747\u5300\u968f\u673a\u91c7\u6837\u3002\u8fd9\u6837\u7684\u2f45\u5f0f\u80fd\u591f\u5728\u53ea\u91c7\u6837\u79bb\u6563\u70b9\u7684\u524d\u63d0\u4e0b\uff0c\u4fdd\u8bc1\u91c7\u6837\u4f4d\u7f6e\u7684\u8fde\u7eed\u6027\u3002 \\[ t_i\\thicksim\\mathcal{U}{\\left[t_n+\\frac{i-1}N(t_f-t_n),\\mathrm{~}t_n+\\frac iN(t_f-t_n)\\right]}. \\]","title":"\u5149\u7ebf\u6210\u50cf\u6a21\u578b"},{"location":"cv/papers/nerf/nerf/#optimizing-nerf","text":"","title":"Optimizing NeRF"},{"location":"cv/papers/nerf/nerf/#positional-encoding","text":"\u5bf9\u795e\u7ecf\u7f51\u7edc\u76f4\u63a5\u8f93\u5165 5D \u4f1a\u5bfc\u81f4\u6e32\u67d3\u6548\u679c\u8f83\u5dee\uff0c\u4e0d\u80fd\u5f88\u597d\u5730\u8868\u793a\u989c\u8272\u548c\u51e0\u4f55\u4e2d\u9ad8\u9891\u53d8\u5316\u3002 \u5c06\u8f93\u5165\u7684\u4e09\u7ef4\u5750\u6807\u8fdb\u884c\u4f4d\u7f6e\u7f16\u7801\uff1a \\[ F_\\mathcal{\\theta} = F_{\\mathcal{\\theta}}^\\prime \\gamma \\\\ \\gamma(p)=\\begin{pmatrix}\\sin\\bigl(2^0\\pi p\\bigr),\\cos\\bigl(2^0\\pi p\\bigr),&\\cdots,\\sin\\bigl(2^{L-1}\\pi p\\bigr), \\cos\\bigl(2^{L-1}\\pi p\\bigr)\\end{pmatrix}. \\]","title":"Positional encoding"},{"location":"cv/papers/nerf/nerf/#hierarchical-volume-sampling","text":"NeRF \u7684\u6e32\u67d3\u8fc7\u7a0b\u8ba1\u7b97\u91cf\u5f88\u5927\uff0c\u6bcf\u6761\u5c04\u7ebf\u90fd\u8981\u91c7\u6837\u5f88\u591a\u70b9\uff0c\u4f46\u5b9e\u9645\u4e0a\uff0c\u4e00\u6761\u5c04\u7ebf\u4e0a\u7684\u5927\u90e8\u5206\u533a\u57df\u90fd\u662f\u7a7a\u533a\u57df\uff0c\u6216\u88ab\u906e\u6321\u7684\u533a\u57df\uff0c\u5bf9\u6700\u7ec8\u7684\u989c\u8272\u6ca1\u6709\u8d21\u732e\u3002 \u56e0\u6b64\u91c7\u7528\u4e00\u79cd coarse to fine \u7684\u5f62\u5f0f\uff0c\u540c\u65f6\u4f18\u5316 coarse \u7f51\u7edc\u548c fine \u7f51\u7edc\u3002\u5148\u5728\u5149\u7ebf\u4e0a\u5747\u5300\u91c7\u6837\u4e00\u4e9b\u70b9\uff0c\u5e76\u8ba1\u7b97\u5176\u4f53\u79ef\u5bc6\u5ea6\uff0c\u7136\u540e\u57fa\u4e8e\u8fd9\u4e9b\u5bc6\u5ea6\u503c\u8fdb\u884c\u91cd\u91c7\u6837\uff0c\u5f97\u5230\u66f4\u503e\u5411\u4e8e\u7269\u4f53\u5185\u90e8\u548c\u8868\u9762\u7684\u70b9\uff0c\u4ee5\u63d0\u9ad8\u6e32\u67d3\u6548\u679c\u3002","title":"Hierarchical volume sampling"},{"location":"cv/papers/nerf/nerf/#loss-fn-and-train","text":"\u5bf9\u4e8e\u6bcf\u4e2a\u573a\u666f\uff0c\u9488\u5bf9\u5355\u72ec\u7684\u795e\u7ecf\u8fde\u7eed\u4f53\u79ef\u8868\u793a\u7f51\u7edc\u8fdb\u884c\u4f18\u5316\u3002\u9700\u8981\u573a\u666f\u7684 RGB \u56fe\u50cf\u6570\u636e\u96c6\u3001\u76f8\u5e94\u7684\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\uff0c\u4ee5\u53ca\u573a\u666f\u8fb9\u754c\uff08\u5bf9\u4e8e\u5408\u6210\u6570\u636e\uff0c\u4f7f\u7528\u771f\u5b9e\u7684\u76f8\u673a\u4f4d\u59ff\u3001\u5185\u53c2\u548c\u8fb9\u754c\uff0c\u5bf9\u4e8e\u771f\u5b9e\u6570\u636e\uff0c\u4f7f\u7528 COLMAP \u4f30\u8ba1\u8fd9\u4e9b\u53c2\u6570\uff09 \u6bcf\u6b21\u8fed\u4ee3\uff0c\u4ece\u6570\u636e\u96c6\u4e2d\u6240\u6709\u50cf\u7d20\u4e2d\u968f\u673a\u91c7\u6837\u4e00\u4e2a batch \u7684\u76f8\u673a\u5149\u7ebf\uff0c\u7136\u540e\u6839\u636e\u5206\u5c42\u91c7\u6837\u65b9\u6cd5\u4ece coarse \u7f51\u7edc\u67e5\u8be2 \\(N_c\\) \u4e2a\u6837\u672c\u548c\u4ece fine \u7f51\u7edc\u4e2d\u67e5\u8be2 \\(N_c + N_f\\) \u4e2a\u6602\u672c\uff0c\u518d\u6839\u636e\u4f53\u6e32\u67d3\u5f97\u5230\u6bcf\u6761\u5149\u7ebf\u7684\u989c\u8272 \u635f\u5931\u51fd\u6570\u4ec5\u4ec5\u662f coarse \u548c fine \u7684\u6e32\u67d3\u50cf\u7d20\u989c\u8272\u4e0e\u771f\u5b9e\u989c\u8272\u4e4b\u95f4\u7684\u603b\u5e73\u65b9\u5dee\u8bef\u5dee\uff0c\u540c\u65f6\u4f18\u5316 coarse \u548c fine \\[ \\mathcal{L} = \\sum_{r \\in R} \\left [ \\left \\| \\hat{C}_c(r) - C(r) \\right \\|_2^2 - \\left \\| \\hat{C}_f(r) - C(r) \\right \\|_2^2 \\right ] \\]","title":"Loss Fn and Train"},{"location":"cv/papers/nerf/nerf/#pipeline","text":"\u5df2\u77e5\u76f8\u673a\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\u62cd\u6444\u4e86\u4e00\u7ec4\u76ee\u6807\u573a\u666f\u7684\u7167\u7247\u3002\uff08\u5982\u679c\u4f60\u662f\u624b\u673a\u62cd\u6444\u7684\u4e00\u6bb5\u89c6\u9891\u53ef\u4ee5\u7528 colormap \u8f6c\uff09 \u4ece\u76f8\u673a\u4e2d\u5fc3\u5f00\u59cb\uff0c\u6cbf\u7740\u67d0\u4e2a\u50cf\u7d20\u65b9\u5411\u53d1\u5c04\u4e00\u6761\u5149\u7ebf\u3002(\u6ce8\u610f\uff1a\u8ddf\u771f\u5b9e\u7684\u76f8\u673a\u6210\u50cf\u6a21\u578b\u5149\u7ebf\u65b9\u5411\u662f\u76f8\u53cd\u7684\uff0c\u4f46\u4e0d\u5f71\u54cd)\u3002 \u5efa\u7acb\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc \\(F\\) \uff0c\u8f93\u5165 \\((x,y,z,\\theta,\\phi)\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB,\\sigma\\) \u989c\u8272\u548c\u5bc6\u5ea6\u3002\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u3002 \u628a\u8fd9\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u5408\u6210\uff0c\u5c31\u80fd\u7b97\u51fa\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\u3002 \u6839\u636e\u8f93\u5165\u7684\u4e00\u7ec4\u56fe\u50cf\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u751f\u6210\u65e0\u6570\u6761\u5149\u7ebf\uff0c\u4e0d\u65ad\u53bb\u4f18\u5316\u53ef\u5fae\u51fd\u6570 \\(F\\) \u3002\u5f53\u4f18\u5316\u6b21\u6570\u8db3\u591f\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\(F\\) \u7b97\u51fa\u6240\u6709\u89c6\u89d2\u4e0b\u56fe\u50cf\u7684\u50cf\u7d20 RGB \u503c\u3002 \u77e5\u9053\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u7528 Marching Cubes \u7b97\u6cd5\u8f6c\u6362\u4e3a\u4e09\u89d2\u7f51\u4e09\u7ef4\u6a21\u578b\u3002\u5b8c\u6210\u4e09\u7ef4\u91cd\u5efa\u3002 \u6c42\u5f97 \\(F\\) \u5c31\u5b9e\u73b0\u4e86\u4e09\u7ef4\u91cd\u5efa\uff0c\u540e\u9762\u90fd\u662f\u5408\u6210\u65b0\u89c6\u89d2\u548c\u8f6c\u6362\u3002 \u57fa\u672c\u539f\u7406 \u4f5c\u8005\u9996\u5148\u628a\u91cd\u5efa\u8fc7\u7a0b \\(F\\) \u7528\u6df1\u5ea6\u5b66\u4e60\u4ee3\u66ff\uff0c \\(F(x,y,z,\\theta,\\phi)=RGB\\sigma\\) \u4ece\uff08\u7a7a\u95f4\u4f4d\u7f6e\u3001\u89c2\u5bdf\u65b9\u5411\uff09\u5230\uff08\u989c\u8272\u3001\u5bc6\u5ea6\uff09\u7684\u8fc7\u7a0b\u3002 \u4f5c\u8005\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u5149\u5b66\u6a21\u578b\u505a\u4e86\u5047\u8bbe\uff0c\u5efa\u7acb\u4e00\u4e2a\u6570\u5b66\u6a21\u578b\u3002 \u6839\u636e\u5149\u7ebf\u6210\u50cf\u4e0e\u8f93\u5165\u50cf\u7d20\u4e0d\u540c\u4e0d\u65ad\u4f18\u5316\uff0c\u8fdb\u800c\u4f18\u5316\u5f97\u51fa \\(F\\) \u3002 \u7b97\u6cd5\u7684\u5173\u952e\uff1a \u5149\u7ebf\u6210\u50cf\u6a21\u578b \u3002","title":"Pipeline"},{"location":"cv/papers/nerf/nerf/#experiment","text":"\u4e0b\u56fe\u662f Instant-NGP \u5b9e\u9a8c\uff1a","title":"Experiment"},{"location":"cv/papers/nerf/nerf/#reference","text":"nerf-learn NeRF\u5f00\u7bc7\u8bba\u6587\u89e3\u8bfb NeRF \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-NeRF\u5168\u89e3\uff08\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f\uff09 https://cloud.baidu.com/article/2741971","title":"Reference"},{"location":"cv/papers/nerf/nice-slam/","text":"NICE-SLAM \u00b6 \u7ea6 1340 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract paper\uff1a NICE-SLAM: Neural Implicit Scalable Encoding for SLAM code\uff1a NICE-SLAM Idea \u00b6 Introduction \u00b6 Real-Time \u5927\u573a\u666f\u6709\u6548\uff0ciMAP \u6216 learning-based \u65b9\u6cd5\u505a\u4e0d\u5230 robust\uff0c\u5bf9 nosie \u548c\u672a\u89c2\u6d4b\u5230\u4f4d\u7f6e\u9c81\u68d2\uff0c\u5408\u7406\u9884\u6d4b \u6700\u5927\u7684\u521b\u65b0\u70b9\uff1a multilevel grid-based features\uff08\u57fa\u4e8e\u7f51\u683c\u7684\u591a\u5c42\u7279\u5f81\uff09 \uff0c\u5176\u4f59\u7684 idea \u5c31\u662f\u4f18\u5316\u65b9\u6cd5\uff0c\u5982\u4f55 mapping\u3001tracking\u3001\u5982\u4f55\u52a0\u901f\uff0c\u8054\u5408\u8bad\u7ec3+\u5206\u5c42\u8bad\u7ec3\uff0cnerf \u91c7\u6837\u65b9\u6cd5\u7b49\u7b49 \u91c7\u7528\u4e86\u4e09\u7ef4\u6805\u683c\u5730\u56fe\uff0c\u6bcf\u4e2a\u6805\u683c\u4fdd\u5b58\u5c40\u90e8\u7279\u5f81\uff0c\u7528 decoder \u5c06\u7279\u5f81\u89e3\u7801\u5373\u53ef\u6062\u590d\u51fa\u573a\u666f\uff0c\u56e0\u6b64\u5373\u4f7f\u573a\u666f\u9762\u79ef\u5f88\u5927\u4e5f\u4e0d\u5b58\u5728\u7f51\u7edc\u9057\u5fd8\u7684\u95ee\u9898 Hierarchical Scene Representation \u00b6 \u4e0a\u56fe\u4e2d\u7684\u53f3\u8fb9\u90e8\u5206\uff0c\u4ece\u5de6\u5411\u53f3\u770b\u5206\u522b\u662f MLP \u548c feature grid\uff1b \u4ece\u4e0a\u5f80\u4e0b\u770b\uff0c\u6709\u56db\u4e2a\u90e8\u5206\uff0c\u524d\u4e09\u90e8\u5206\u9884\u6d4b\u51e0\u4f55\u4fe1\u606f\uff0c\u7b2c\u56db\u90e8\u5206\u9884\u6d4b\u989c\u8272\uff1a coarse-level : \u4e3a\u63d0\u5347\u6548\u7387\uff0cgrid \u91c7\u6837\u5757\u5927\u4e14\u72ec\u7acb\u51fa\u6765\uff0c\u7528\u4e8e \u9884\u6d4b \uff08\u586b\u8865\u7a7a\u6d1e\uff0c\u4f8b\u5982\u5730\u677f\u5899\u9762\uff09 mid-level+fine-level : \u5148\u7ecf\u8fc7 mid-level \u9884\u6d4b\u51fa\u4e00\u4e2a\u5360\u7528\u7387 \\(o\\) \uff0c\u4f7f\u7528 fine-level \u9884\u6d4b\u51fa \\(\\Delta o\\) \uff0c\u4e24\u8005\u76f8\u52a0\u5f97\u5230\u6700\u7ec8\u5360\u7528\u7387\u3002\u4ece\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa fine-level \u7684\u8f93\u5165\u662f\u5c0f\u7f51\u683c\u3001\u5c0f\u5c0f\u7f51\u683c... color-level \uff1a\u4e0e\u524d\u4e09\u5c42\u4e0d\u540c\uff0c color-level \u7684 decoder \u548c encoder \u90fd\u5728\u66f4\u65b0\uff0c\u800c\u524d\u4e09\u5c42\u56fa\u5b9a\u4e86 MLP \u53ea\u66f4\u65b0\u7279\u5f81\u7f51\u7edc \uff0c\u8fd9\u6837\u6709\u52a9\u4e8e\u5927\u573a\u666f\u7684\u6784\u5efa\uff0cMLP \u4e0d\u4f1a\u88ab\u65b0\u7684\u7279\u5f81\u5f71\u54cd\u3002\u6b64\u5904\u7684 MLP \u662f CNN + MLP \u9884\u8bad\u7ec3\u540e\uff0c\u5355\u72ec\u53d6 MLP \u51fa\u6765\u83b7\u5f97\u3002\u56e0\u6b64 color-level \u5c31\u4f1a\u5b58\u5728\u989c\u8272\u88ab\u66f4\u65b0\u7684\u95ee\u9898\uff0c\u6784\u5efa\u5927\u573a\u666f\u65f6\u5c31\u4e0d\u80fd\u6709\u989c\u8272\u4fe1\u606f\u3002 Depth and Color Rendering \u00b6 \u501f\u9274 NeRF \u7684\u65b9\u6cd5\u83b7\u5f97 depth \u548c color \u5bf9\u4e8e\u4e00\u6761\u5149\u7ebf\uff0c\u4f7f\u7528\u5206\u5c42\u548c\u5747\u5300\u91c7\u6837\u4e00\u4e2a\u5f97\u5230 N \u4e2a\u70b9\uff0c\u5bf9\u4e8e\u8fd9 N \u4e2a\u70b9\u90fd\u4f30\u8ba1\u51fa\u4e00\u4e2a\u6743\u91cd \\(w_i\\) \uff08\u8868\u793a\u5149\u7ebf\u5230 i \u7ec8\u6b62\u7684\u6982\u7387\uff09\uff0c\u663e\u7136\u6982\u7387\u8d8a\u5927\uff0c\u8fd9\u4e00\u70b9\u8d8a\u5bb9\u6613\u662f\u7269\u4f53\u3002 coarse \u5c42 \u548c fine \u5c42\u7684\u6743\u91cd\uff1a \\[ w_i^c = o_{p_i}^0 \\prod_{j=1}^{i-1}(1-o_{p_j}^0) = o_{p_i} \\prod_{j=1}^{i-1}(1-o_{p_j}) \\] \u7531\u6743\u91cd\u53ef\u4ee5\u5f97\u5230\u6e32\u67d3\u540e\u7684\u6df1\u5ea6\u503c\u548c\u989c\u8272\u503c\uff1a \\[ \\hat{D}^c = \\sum_{i=1}^N w_i^c d_i, \\quad \\hat{D}^f = \\sum_{i=1}^N w_i^f d_i, \\quad \\hat{I} = \\sum_{i=1}^N w_i^f \\mathbf{c}_i \\] \u5176\u4e2d\uff0c \\(d_i\\) \u662f\u91c7\u6837\u70b9\u5230\u539f\u70b9\u7684\u8ddd\u79bb\u3002\u8fdb\u4e00\u6b65\u8fd8\u53ef\u4ee5\u6c42\u51fa\u6cbf\u5149\u7ebf\u65b9\u5411\u7684\u6df1\u5ea6\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}^c = \\sum_{i=1}^N w_i^c (\\hat{D}^c - d_i)^2 \\quad \\hat{D}_{var}^f = \\sum_{i=1}^N w_i^f (\\hat{D}^f - d_i)^2 \\] Mapping and Tracking \u00b6 \u4e3b\u8981\u57fa\u4e8e Hierarchical Scene Representation \u548c\u76f8\u673a\u4f4d\u59ff\u7684\u53c2\u6570 \\(\\theta\\) \u548c \\(\\omega\\) \u7684\u4f18\u5316\u3002\uff08\u635f\u5931\u51fd\u6570\uff09 Mapping \uff1a\u4f18\u5316 scene representation \u5efa\u56fe\u9636\u6bb5\u5305\u542b\u4e24\u4e2a loss \u51e0\u4f55 loss \\[ \\mathcal{L}_g^l=\\frac{1}{M}\\sum_{m=1}^M \\left | D_m - \\hat{D}_m^l \\right |, \\quad l\\in\\{c,f\\} \\] \u5149\u5ea6 loss \\[ \\mathcal{L}_p = \\frac{1}{M} \\sum_{m=1}^M \\left | I_m - \\hat{I}_m \\right | \\] \u901a\u8fc7\u4ece\u5f53\u524d\u5e27\u548c\u5173\u952e\u5e27\u4e2d\u5747\u5300\u91c7\u6837\u5171 M \u4e2a\u50cf\u7d20\uff0c\u6700\u5c0f\u5316 loss\u3002\u4f18\u5316\u987a\u5e8f\uff1a \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level feature grid \\(\\phi_\\theta^1\\) \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level \u548c fine-level feature grid \\(\\phi_\\theta^1\\) \u548c \\(\\phi_\\theta^2\\) \u4f7f\u7528 local bundle adjustment\uff08BA \u5c40\u90e8\u7ea6\u675f\u8c03\u6574\uff09\u8054\u5408\u4f18\u5316\u6240\u6709 level \u7684 grids\uff0ccolor decoder\uff0c\u76f8\u673a\u5916\u53c2 \\(\\{\\mathbf{R}_i, \\mathbf{t}_i\\}\\) \u5728\u7b2c K \u4e2a\u5173\u952e\u5e27\u5904\uff0c\u4f7f\u7528\u5982\u4e0b\uff1a \\[ \\min_{\\theta,\\omega,\\{\\mathbf{R}_i,\\mathbf{t}_i\\}}(\\mathcal{L}_g^c+\\mathcal{L}_g^f+\\lambda_p\\mathcal{L}_p) \\] \u4f5c\u8005\u89e3\u91ca\u8fd9\u4e48\u505a\u7684\u539f\u56e0 \u5916\u5206\u8fa8\u7387\u7684\u5916\u89c2\u548c fine-level \u90fd\u4f9d\u8d56\u4e8e mid-level \u6240\u4ee5\u5148\u4f18\u5316 mid \u80fd\u591f \u52a0\u5feb\u6536\u655b \u3002\u6b64\u5916\uff0c\u4f7f\u7528\u5e76\u884c\u4e09\u4e2a\u7ebf\u7a0b\u52a0\u901f\u4f18\u5316\u8fc7\u7a0b\uff1acoarse-level\uff0cmid+fine+color\uff0ctracking\uff08\u4e0b\u4e2a\u6b65\u9aa4\uff09\u3002 Tracking \uff1a\u4f18\u5316\u5f53\u524d\u5e27\u7684 camera poses\uff0c\u5373 \\(\\{R,t\\}\\) \u5728\u5f53\u524d\u5e27\u4e2d\u91c7\u6837 \\(M_t\\) \u4e2a\u50cf\u7d20\u70b9\u4f7f\u7528\u5982\u4e0b loss\uff1a \\[ \\min_{\\mathbf{R},\\mathbf{t}} (\\mathcal{L}_{g \\_ var}+\\lambda_{pt}\\mathcal{L}_{p}) \\] \u5176\u4e2d\uff0c\u5bf9\u51e0\u4f55\u635f\u5931\u505a\u4e86\u4fee\u6539\uff0c\u4fee\u6539 \\(\\mathcal{L}_{g \\_ var}\\) \u5982\u4e0b\uff1a \\[ \\mathcal{L}_{g \\_ var}=\\frac{1}{M_t}\\sum_{m=1}^{M_t}\\frac{\\left|D_m-\\hat{D}_m^c\\right|}{\\sqrt{\\hat{D}_{var}^c}}+\\frac{\\left|D_m-\\hat{D}_m^f\\right|}{\\sqrt{\\hat{D}_{var}^f}} \\] \u4f7f\u7528 \\(L_{g \\_ var}\\) \u7684\u597d\u5904 The modified loss down-weights less certain regions in the reconstructed geometry [46, 62], e.g., object edges. \u4fee\u6539\u540e\u7684 loss \u964d\u4f4e\u4e86\u91cd\u5efa\u573a\u666f\u4e2d\u4e0d\u786e\u5b9a\u533a\u57df\u7684\u6743\u91cd\u3002 Robustness to Dynamic Objects \uff1a\u5f53\u573a\u666f\u4e2d\u51fa\u73b0\u52a8\u6001\u7269\u4f53\u65f6\uff0cNICE-SLAM \u53ef\u4ee5\u901a\u8fc7\u8fc7\u6ee4\u50cf\u7d20\u70b9\u6765\u5ffd\u7565\u8fd9\u4e2a\u52a8\u6001\u7269\u4f53\uff0c\u56e0\u4e3a\u5728\u52a8\u6001\u7269\u4f53\u4e0a\u91c7\u6837\u5f97\u5230\u7684\u50cf\u7d20\u70b9 loss \u503c\u4f1a\u5f88\u5927\u3002\uff08\u8fd9\u4e00\u70b9\u53ef\u4ee5\u5229\u7528\u8d77\u6765\uff09 Keyframe Selection \u00b6 \u7c7b\u4f3c iMAP \u4e00\u6837\uff0c\u7ef4\u62a4\u4e00\u4e2a\u5168\u5c40\u7684\u5173\u952e\u5e27\uff0c\u57fa\u4e8e\u65b0\u589e\u4fe1\u606f\u6765\u6dfb\u52a0\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4f46\u4e0d\u540c\u7684\u662f\uff0c\u5305\u62ec \u7684\u5173\u952e\u5e27\u5f53\u4f18\u5316\u573a\u666f\u51e0\u4f55\u65f6\u9700\u8981\u4e0e\u5f53\u524d\u5e27\u6709\u89c6\u89c9\u91cd\u53e0\u3002 \u8fd9\u79cd\u9009\u62e9\u7b56\u7565\u4e0d\u4ec5\u786e\u4fdd\u5f53\u524d\u89c6\u56fe\u4e4b\u5916\u7684\u51e0\u4f55\u4fdd\u6301\u9759\u6001\uff0c\u800c\u4e14\u8fd8\u4f1a\u5bfc\u81f4\u975e\u5e38\u6709\u6548\u7684\u6700\u4f73\u5316\u95ee\u9898\uff0c\u56e0\u4e3a\u6bcf\u6b21\u53ea\u4f18\u5316\u5fc5\u8981\u7684\u53c2\u6570\u3002 \u5b9e\u9645\u4e0a\uff0c\u9996\u5148\u968f\u673a\u91c7\u6837\u50cf\u7d20\u5e76\u4f7f\u7528\u4f18\u5316\u7684\u76f8\u673a\u59ff\u52bf\u53cd\u5411\u6295\u5f71\u76f8\u5e94\u7684\u6df1\u5ea6\u3002\u7136\u540e\uff0c\u5c06\u70b9\u4e91\u6295\u5f71\u5230\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u5e27\u3002\u4ece\u90a3\u4e9b\u6709\u70b9\u6295\u5c04\u5230\u7684\u5173\u952e\u5e27\u4e2d\uff0c\u6211\u4eec\u968f\u673a\u9009\u62e9 K\u22122 \u5e27\u3002\u6b64\u5916\uff0c\u8fd8\u5728\u573a\u666f\u8868\u793a\u4f18\u5316\u4e2d\u5305\u62ec\u6700\u8fd1\u7684\u5173\u952e\u5e27\u548c\u5f53\u524d\u5e27\uff0c\u5f62\u6210 K \u4e2a\u6d3b\u52a8\u5e27\u7684\u603b\u6570\u3002 Experiments \u00b6 \u6570\u636e\u96c6\uff1aReplica\u3001ScanNet\u3001TUM RGB-D\u3001Co-Fusion Baseline\uff1aTSDF-Fusion\u3001DI-Fusion\u3001iMAP\u3001BAD\u2014SLAM\u3001Kintinuous\u3001ORB-SLAM2 Reference \u00b6 NICE-SLAM\u5b66\u4e60 NICE-SLAM: Neural Implicit Scalable Encoding for SLAM\u8bba\u6587\u9605\u8bfb\u8bb0\u5f55 NICE-SLAM \u4ee3\u7801\u7b80\u6790","title":"NICE-SLAM"},{"location":"cv/papers/nerf/nice-slam/#nice-slam","text":"\u7ea6 1340 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract paper\uff1a NICE-SLAM: Neural Implicit Scalable Encoding for SLAM code\uff1a NICE-SLAM","title":"NICE-SLAM"},{"location":"cv/papers/nerf/nice-slam/#idea","text":"","title":"Idea"},{"location":"cv/papers/nerf/nice-slam/#introduction","text":"Real-Time \u5927\u573a\u666f\u6709\u6548\uff0ciMAP \u6216 learning-based \u65b9\u6cd5\u505a\u4e0d\u5230 robust\uff0c\u5bf9 nosie \u548c\u672a\u89c2\u6d4b\u5230\u4f4d\u7f6e\u9c81\u68d2\uff0c\u5408\u7406\u9884\u6d4b \u6700\u5927\u7684\u521b\u65b0\u70b9\uff1a multilevel grid-based features\uff08\u57fa\u4e8e\u7f51\u683c\u7684\u591a\u5c42\u7279\u5f81\uff09 \uff0c\u5176\u4f59\u7684 idea \u5c31\u662f\u4f18\u5316\u65b9\u6cd5\uff0c\u5982\u4f55 mapping\u3001tracking\u3001\u5982\u4f55\u52a0\u901f\uff0c\u8054\u5408\u8bad\u7ec3+\u5206\u5c42\u8bad\u7ec3\uff0cnerf \u91c7\u6837\u65b9\u6cd5\u7b49\u7b49 \u91c7\u7528\u4e86\u4e09\u7ef4\u6805\u683c\u5730\u56fe\uff0c\u6bcf\u4e2a\u6805\u683c\u4fdd\u5b58\u5c40\u90e8\u7279\u5f81\uff0c\u7528 decoder \u5c06\u7279\u5f81\u89e3\u7801\u5373\u53ef\u6062\u590d\u51fa\u573a\u666f\uff0c\u56e0\u6b64\u5373\u4f7f\u573a\u666f\u9762\u79ef\u5f88\u5927\u4e5f\u4e0d\u5b58\u5728\u7f51\u7edc\u9057\u5fd8\u7684\u95ee\u9898","title":"Introduction"},{"location":"cv/papers/nerf/nice-slam/#hierarchical-scene-representation","text":"\u4e0a\u56fe\u4e2d\u7684\u53f3\u8fb9\u90e8\u5206\uff0c\u4ece\u5de6\u5411\u53f3\u770b\u5206\u522b\u662f MLP \u548c feature grid\uff1b \u4ece\u4e0a\u5f80\u4e0b\u770b\uff0c\u6709\u56db\u4e2a\u90e8\u5206\uff0c\u524d\u4e09\u90e8\u5206\u9884\u6d4b\u51e0\u4f55\u4fe1\u606f\uff0c\u7b2c\u56db\u90e8\u5206\u9884\u6d4b\u989c\u8272\uff1a coarse-level : \u4e3a\u63d0\u5347\u6548\u7387\uff0cgrid \u91c7\u6837\u5757\u5927\u4e14\u72ec\u7acb\u51fa\u6765\uff0c\u7528\u4e8e \u9884\u6d4b \uff08\u586b\u8865\u7a7a\u6d1e\uff0c\u4f8b\u5982\u5730\u677f\u5899\u9762\uff09 mid-level+fine-level : \u5148\u7ecf\u8fc7 mid-level \u9884\u6d4b\u51fa\u4e00\u4e2a\u5360\u7528\u7387 \\(o\\) \uff0c\u4f7f\u7528 fine-level \u9884\u6d4b\u51fa \\(\\Delta o\\) \uff0c\u4e24\u8005\u76f8\u52a0\u5f97\u5230\u6700\u7ec8\u5360\u7528\u7387\u3002\u4ece\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa fine-level \u7684\u8f93\u5165\u662f\u5c0f\u7f51\u683c\u3001\u5c0f\u5c0f\u7f51\u683c... color-level \uff1a\u4e0e\u524d\u4e09\u5c42\u4e0d\u540c\uff0c color-level \u7684 decoder \u548c encoder \u90fd\u5728\u66f4\u65b0\uff0c\u800c\u524d\u4e09\u5c42\u56fa\u5b9a\u4e86 MLP \u53ea\u66f4\u65b0\u7279\u5f81\u7f51\u7edc \uff0c\u8fd9\u6837\u6709\u52a9\u4e8e\u5927\u573a\u666f\u7684\u6784\u5efa\uff0cMLP \u4e0d\u4f1a\u88ab\u65b0\u7684\u7279\u5f81\u5f71\u54cd\u3002\u6b64\u5904\u7684 MLP \u662f CNN + MLP \u9884\u8bad\u7ec3\u540e\uff0c\u5355\u72ec\u53d6 MLP \u51fa\u6765\u83b7\u5f97\u3002\u56e0\u6b64 color-level \u5c31\u4f1a\u5b58\u5728\u989c\u8272\u88ab\u66f4\u65b0\u7684\u95ee\u9898\uff0c\u6784\u5efa\u5927\u573a\u666f\u65f6\u5c31\u4e0d\u80fd\u6709\u989c\u8272\u4fe1\u606f\u3002","title":"Hierarchical Scene Representation"},{"location":"cv/papers/nerf/nice-slam/#depth-and-color-rendering","text":"\u501f\u9274 NeRF \u7684\u65b9\u6cd5\u83b7\u5f97 depth \u548c color \u5bf9\u4e8e\u4e00\u6761\u5149\u7ebf\uff0c\u4f7f\u7528\u5206\u5c42\u548c\u5747\u5300\u91c7\u6837\u4e00\u4e2a\u5f97\u5230 N \u4e2a\u70b9\uff0c\u5bf9\u4e8e\u8fd9 N \u4e2a\u70b9\u90fd\u4f30\u8ba1\u51fa\u4e00\u4e2a\u6743\u91cd \\(w_i\\) \uff08\u8868\u793a\u5149\u7ebf\u5230 i \u7ec8\u6b62\u7684\u6982\u7387\uff09\uff0c\u663e\u7136\u6982\u7387\u8d8a\u5927\uff0c\u8fd9\u4e00\u70b9\u8d8a\u5bb9\u6613\u662f\u7269\u4f53\u3002 coarse \u5c42 \u548c fine \u5c42\u7684\u6743\u91cd\uff1a \\[ w_i^c = o_{p_i}^0 \\prod_{j=1}^{i-1}(1-o_{p_j}^0) = o_{p_i} \\prod_{j=1}^{i-1}(1-o_{p_j}) \\] \u7531\u6743\u91cd\u53ef\u4ee5\u5f97\u5230\u6e32\u67d3\u540e\u7684\u6df1\u5ea6\u503c\u548c\u989c\u8272\u503c\uff1a \\[ \\hat{D}^c = \\sum_{i=1}^N w_i^c d_i, \\quad \\hat{D}^f = \\sum_{i=1}^N w_i^f d_i, \\quad \\hat{I} = \\sum_{i=1}^N w_i^f \\mathbf{c}_i \\] \u5176\u4e2d\uff0c \\(d_i\\) \u662f\u91c7\u6837\u70b9\u5230\u539f\u70b9\u7684\u8ddd\u79bb\u3002\u8fdb\u4e00\u6b65\u8fd8\u53ef\u4ee5\u6c42\u51fa\u6cbf\u5149\u7ebf\u65b9\u5411\u7684\u6df1\u5ea6\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}^c = \\sum_{i=1}^N w_i^c (\\hat{D}^c - d_i)^2 \\quad \\hat{D}_{var}^f = \\sum_{i=1}^N w_i^f (\\hat{D}^f - d_i)^2 \\]","title":"Depth and Color Rendering"},{"location":"cv/papers/nerf/nice-slam/#mapping-and-tracking","text":"\u4e3b\u8981\u57fa\u4e8e Hierarchical Scene Representation \u548c\u76f8\u673a\u4f4d\u59ff\u7684\u53c2\u6570 \\(\\theta\\) \u548c \\(\\omega\\) \u7684\u4f18\u5316\u3002\uff08\u635f\u5931\u51fd\u6570\uff09 Mapping \uff1a\u4f18\u5316 scene representation \u5efa\u56fe\u9636\u6bb5\u5305\u542b\u4e24\u4e2a loss \u51e0\u4f55 loss \\[ \\mathcal{L}_g^l=\\frac{1}{M}\\sum_{m=1}^M \\left | D_m - \\hat{D}_m^l \\right |, \\quad l\\in\\{c,f\\} \\] \u5149\u5ea6 loss \\[ \\mathcal{L}_p = \\frac{1}{M} \\sum_{m=1}^M \\left | I_m - \\hat{I}_m \\right | \\] \u901a\u8fc7\u4ece\u5f53\u524d\u5e27\u548c\u5173\u952e\u5e27\u4e2d\u5747\u5300\u91c7\u6837\u5171 M \u4e2a\u50cf\u7d20\uff0c\u6700\u5c0f\u5316 loss\u3002\u4f18\u5316\u987a\u5e8f\uff1a \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level feature grid \\(\\phi_\\theta^1\\) \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level \u548c fine-level feature grid \\(\\phi_\\theta^1\\) \u548c \\(\\phi_\\theta^2\\) \u4f7f\u7528 local bundle adjustment\uff08BA \u5c40\u90e8\u7ea6\u675f\u8c03\u6574\uff09\u8054\u5408\u4f18\u5316\u6240\u6709 level \u7684 grids\uff0ccolor decoder\uff0c\u76f8\u673a\u5916\u53c2 \\(\\{\\mathbf{R}_i, \\mathbf{t}_i\\}\\) \u5728\u7b2c K \u4e2a\u5173\u952e\u5e27\u5904\uff0c\u4f7f\u7528\u5982\u4e0b\uff1a \\[ \\min_{\\theta,\\omega,\\{\\mathbf{R}_i,\\mathbf{t}_i\\}}(\\mathcal{L}_g^c+\\mathcal{L}_g^f+\\lambda_p\\mathcal{L}_p) \\] \u4f5c\u8005\u89e3\u91ca\u8fd9\u4e48\u505a\u7684\u539f\u56e0 \u5916\u5206\u8fa8\u7387\u7684\u5916\u89c2\u548c fine-level \u90fd\u4f9d\u8d56\u4e8e mid-level \u6240\u4ee5\u5148\u4f18\u5316 mid \u80fd\u591f \u52a0\u5feb\u6536\u655b \u3002\u6b64\u5916\uff0c\u4f7f\u7528\u5e76\u884c\u4e09\u4e2a\u7ebf\u7a0b\u52a0\u901f\u4f18\u5316\u8fc7\u7a0b\uff1acoarse-level\uff0cmid+fine+color\uff0ctracking\uff08\u4e0b\u4e2a\u6b65\u9aa4\uff09\u3002 Tracking \uff1a\u4f18\u5316\u5f53\u524d\u5e27\u7684 camera poses\uff0c\u5373 \\(\\{R,t\\}\\) \u5728\u5f53\u524d\u5e27\u4e2d\u91c7\u6837 \\(M_t\\) \u4e2a\u50cf\u7d20\u70b9\u4f7f\u7528\u5982\u4e0b loss\uff1a \\[ \\min_{\\mathbf{R},\\mathbf{t}} (\\mathcal{L}_{g \\_ var}+\\lambda_{pt}\\mathcal{L}_{p}) \\] \u5176\u4e2d\uff0c\u5bf9\u51e0\u4f55\u635f\u5931\u505a\u4e86\u4fee\u6539\uff0c\u4fee\u6539 \\(\\mathcal{L}_{g \\_ var}\\) \u5982\u4e0b\uff1a \\[ \\mathcal{L}_{g \\_ var}=\\frac{1}{M_t}\\sum_{m=1}^{M_t}\\frac{\\left|D_m-\\hat{D}_m^c\\right|}{\\sqrt{\\hat{D}_{var}^c}}+\\frac{\\left|D_m-\\hat{D}_m^f\\right|}{\\sqrt{\\hat{D}_{var}^f}} \\] \u4f7f\u7528 \\(L_{g \\_ var}\\) \u7684\u597d\u5904 The modified loss down-weights less certain regions in the reconstructed geometry [46, 62], e.g., object edges. \u4fee\u6539\u540e\u7684 loss \u964d\u4f4e\u4e86\u91cd\u5efa\u573a\u666f\u4e2d\u4e0d\u786e\u5b9a\u533a\u57df\u7684\u6743\u91cd\u3002 Robustness to Dynamic Objects \uff1a\u5f53\u573a\u666f\u4e2d\u51fa\u73b0\u52a8\u6001\u7269\u4f53\u65f6\uff0cNICE-SLAM \u53ef\u4ee5\u901a\u8fc7\u8fc7\u6ee4\u50cf\u7d20\u70b9\u6765\u5ffd\u7565\u8fd9\u4e2a\u52a8\u6001\u7269\u4f53\uff0c\u56e0\u4e3a\u5728\u52a8\u6001\u7269\u4f53\u4e0a\u91c7\u6837\u5f97\u5230\u7684\u50cf\u7d20\u70b9 loss \u503c\u4f1a\u5f88\u5927\u3002\uff08\u8fd9\u4e00\u70b9\u53ef\u4ee5\u5229\u7528\u8d77\u6765\uff09","title":"Mapping and Tracking"},{"location":"cv/papers/nerf/nice-slam/#keyframe-selection","text":"\u7c7b\u4f3c iMAP \u4e00\u6837\uff0c\u7ef4\u62a4\u4e00\u4e2a\u5168\u5c40\u7684\u5173\u952e\u5e27\uff0c\u57fa\u4e8e\u65b0\u589e\u4fe1\u606f\u6765\u6dfb\u52a0\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4f46\u4e0d\u540c\u7684\u662f\uff0c\u5305\u62ec \u7684\u5173\u952e\u5e27\u5f53\u4f18\u5316\u573a\u666f\u51e0\u4f55\u65f6\u9700\u8981\u4e0e\u5f53\u524d\u5e27\u6709\u89c6\u89c9\u91cd\u53e0\u3002 \u8fd9\u79cd\u9009\u62e9\u7b56\u7565\u4e0d\u4ec5\u786e\u4fdd\u5f53\u524d\u89c6\u56fe\u4e4b\u5916\u7684\u51e0\u4f55\u4fdd\u6301\u9759\u6001\uff0c\u800c\u4e14\u8fd8\u4f1a\u5bfc\u81f4\u975e\u5e38\u6709\u6548\u7684\u6700\u4f73\u5316\u95ee\u9898\uff0c\u56e0\u4e3a\u6bcf\u6b21\u53ea\u4f18\u5316\u5fc5\u8981\u7684\u53c2\u6570\u3002 \u5b9e\u9645\u4e0a\uff0c\u9996\u5148\u968f\u673a\u91c7\u6837\u50cf\u7d20\u5e76\u4f7f\u7528\u4f18\u5316\u7684\u76f8\u673a\u59ff\u52bf\u53cd\u5411\u6295\u5f71\u76f8\u5e94\u7684\u6df1\u5ea6\u3002\u7136\u540e\uff0c\u5c06\u70b9\u4e91\u6295\u5f71\u5230\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u5e27\u3002\u4ece\u90a3\u4e9b\u6709\u70b9\u6295\u5c04\u5230\u7684\u5173\u952e\u5e27\u4e2d\uff0c\u6211\u4eec\u968f\u673a\u9009\u62e9 K\u22122 \u5e27\u3002\u6b64\u5916\uff0c\u8fd8\u5728\u573a\u666f\u8868\u793a\u4f18\u5316\u4e2d\u5305\u62ec\u6700\u8fd1\u7684\u5173\u952e\u5e27\u548c\u5f53\u524d\u5e27\uff0c\u5f62\u6210 K \u4e2a\u6d3b\u52a8\u5e27\u7684\u603b\u6570\u3002","title":"Keyframe Selection"},{"location":"cv/papers/nerf/nice-slam/#experiments","text":"\u6570\u636e\u96c6\uff1aReplica\u3001ScanNet\u3001TUM RGB-D\u3001Co-Fusion Baseline\uff1aTSDF-Fusion\u3001DI-Fusion\u3001iMAP\u3001BAD\u2014SLAM\u3001Kintinuous\u3001ORB-SLAM2","title":"Experiments"},{"location":"cv/papers/nerf/nice-slam/#reference","text":"NICE-SLAM\u5b66\u4e60 NICE-SLAM: Neural Implicit Scalable Encoding for SLAM\u8bba\u6587\u9605\u8bfb\u8bb0\u5f55 NICE-SLAM \u4ee3\u7801\u7b80\u6790","title":"Reference"},{"location":"cv/papers/nerf/nid-slam/","text":"NID-SLAM \u00b6 \u7ea6 344 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a NID-SLAM: Neural Implicit Representation-based RGB-D SLAM In Dynamic Environments Idea \u00b6 \u795e\u7ecf\u9690\u5f0f SLAM + \u52a8\u6001\u73af\u5883 \u52a8\u6001\u7269\u4f53\u53bb\u9664 \uff1a \u6df1\u5ea6\u4fee\u6b63\uff1a\u8ba1\u7b97\u6df1\u5ea6\u56fe\u7684\u56fe\u50cf\u68af\u5ea6\uff0c\u5f53\u56fe\u50cf\u7684\u6c34\u5e73\u6216\u5782\u76f4\u68af\u5ea6\u8d85\u8fc7\u9608\u503c\u65f6\uff0c\u5c06\u68af\u5ea6\u65b9\u5411\u4e0a\u540e\u7eed\u50cf\u7d20\u70b9\u7684\u6df1\u5ea6\u7f6e\u4e3a 0 \u57fa\u4e8e\u6df1\u5ea6\u7684\u8bed\u4e49\u5206\u5272\uff1a\u91c7\u7528\u57fa\u4e8e\u8fb9\u754c\u6846\u7684\u7f51\u7edc\uff08YOLO\uff09\u8fdb\u884c\u8f93\u5165\u56fe\u50cf\u7684\u8bed\u4e49\u5206\u5272\uff0c\u8f93\u51fa\u4e3a\u6f5c\u5728\u52a8\u6001\u6216\u53ef\u79fb\u52a8\u7269\u4f53\u7684\u4e8c\u8fdb\u5236\u63a9\u7801 \u80cc\u666f\u4fee\u590d\uff1a\u4f7f\u7528\u4ee5\u524d\u7684\u89c6\u70b9\u83b7\u5f97\u7684\u9759\u6001\u4fe1\u606f\u4fee\u590d\u88ab\u906e\u6321\u7684\u80cc\u666f \u5173\u952e\u5e27\u9009\u62e9\u7b56\u7565 \uff1a\u4e24\u79cd\u9009\u62e9\u7b56\u7565 \u52a8\u6001\u7269\u4f53\u6bd4\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u8986\u76d6\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u8986\u76d6\u6700\u5927\u573a\u666f\u533a\u57df\u7684\u5e27\uff0c\u786e\u4fdd\u573a\u666f\u8fb9\u7f18\u533a\u57df\u7684\u5168\u9762\u4f18\u5316\uff09 \u5f53\u524d\u5e27\u4e0e\u524d\u4e00\u5173\u952e\u5e27\u91cd\u53e0\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u91cd\u53e0\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u4ece\u4e0e\u5f53\u524d\u5e27\u89c6\u89c9\u4e0a\u91cd\u53e0\u7684\u5173\u952e\u5e27\u968f\u673a\u9009\u62e9 \u4e24\u4e2a\u6bd4\u7387\u7684\u52a0\u6743\u548c\u5c0f\u4e8e\u9608\u503c\u5219\u63d2\u5165\u5173\u952e\u5e27\u96c6\u5408 \u9759\u6001\u573a\u666f\u9ed8\u8ba4\u4f7f\u7528\u91cd\u53e0\u7b56\u7565 \u4e3a\u907f\u514d\u8fc7\u5ea6\u5173\u6ce8\u8fb9\u7f18\u533a\u57df\u5e76\u53cd\u590d\u4f18\u5316\u76f8\u540c\u533a\u57df\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528\u57fa\u4e8e\u8986\u76d6\u7684\u7b56\u7565\u4f18\u5316\u6574\u4e2a\u573a\u666f\uff0c\u7136\u540e\u591a\u6b21\u4f7f\u7528\u57fa\u4e8e\u91cd\u53e0\u7684\u7b56\u7565\uff0c\u91cd\u590d\u591a\u6b21 \u573a\u666f\u8868\u793a\u548c\u56fe\u5f62\u6e32\u67d3 Experiments \u00b6","title":"NID-SLAM"},{"location":"cv/papers/nerf/nid-slam/#nid-slam","text":"\u7ea6 344 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a NID-SLAM: Neural Implicit Representation-based RGB-D SLAM In Dynamic Environments","title":"NID-SLAM"},{"location":"cv/papers/nerf/nid-slam/#idea","text":"\u795e\u7ecf\u9690\u5f0f SLAM + \u52a8\u6001\u73af\u5883 \u52a8\u6001\u7269\u4f53\u53bb\u9664 \uff1a \u6df1\u5ea6\u4fee\u6b63\uff1a\u8ba1\u7b97\u6df1\u5ea6\u56fe\u7684\u56fe\u50cf\u68af\u5ea6\uff0c\u5f53\u56fe\u50cf\u7684\u6c34\u5e73\u6216\u5782\u76f4\u68af\u5ea6\u8d85\u8fc7\u9608\u503c\u65f6\uff0c\u5c06\u68af\u5ea6\u65b9\u5411\u4e0a\u540e\u7eed\u50cf\u7d20\u70b9\u7684\u6df1\u5ea6\u7f6e\u4e3a 0 \u57fa\u4e8e\u6df1\u5ea6\u7684\u8bed\u4e49\u5206\u5272\uff1a\u91c7\u7528\u57fa\u4e8e\u8fb9\u754c\u6846\u7684\u7f51\u7edc\uff08YOLO\uff09\u8fdb\u884c\u8f93\u5165\u56fe\u50cf\u7684\u8bed\u4e49\u5206\u5272\uff0c\u8f93\u51fa\u4e3a\u6f5c\u5728\u52a8\u6001\u6216\u53ef\u79fb\u52a8\u7269\u4f53\u7684\u4e8c\u8fdb\u5236\u63a9\u7801 \u80cc\u666f\u4fee\u590d\uff1a\u4f7f\u7528\u4ee5\u524d\u7684\u89c6\u70b9\u83b7\u5f97\u7684\u9759\u6001\u4fe1\u606f\u4fee\u590d\u88ab\u906e\u6321\u7684\u80cc\u666f \u5173\u952e\u5e27\u9009\u62e9\u7b56\u7565 \uff1a\u4e24\u79cd\u9009\u62e9\u7b56\u7565 \u52a8\u6001\u7269\u4f53\u6bd4\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u8986\u76d6\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u8986\u76d6\u6700\u5927\u573a\u666f\u533a\u57df\u7684\u5e27\uff0c\u786e\u4fdd\u573a\u666f\u8fb9\u7f18\u533a\u57df\u7684\u5168\u9762\u4f18\u5316\uff09 \u5f53\u524d\u5e27\u4e0e\u524d\u4e00\u5173\u952e\u5e27\u91cd\u53e0\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u91cd\u53e0\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u4ece\u4e0e\u5f53\u524d\u5e27\u89c6\u89c9\u4e0a\u91cd\u53e0\u7684\u5173\u952e\u5e27\u968f\u673a\u9009\u62e9 \u4e24\u4e2a\u6bd4\u7387\u7684\u52a0\u6743\u548c\u5c0f\u4e8e\u9608\u503c\u5219\u63d2\u5165\u5173\u952e\u5e27\u96c6\u5408 \u9759\u6001\u573a\u666f\u9ed8\u8ba4\u4f7f\u7528\u91cd\u53e0\u7b56\u7565 \u4e3a\u907f\u514d\u8fc7\u5ea6\u5173\u6ce8\u8fb9\u7f18\u533a\u57df\u5e76\u53cd\u590d\u4f18\u5316\u76f8\u540c\u533a\u57df\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528\u57fa\u4e8e\u8986\u76d6\u7684\u7b56\u7565\u4f18\u5316\u6574\u4e2a\u573a\u666f\uff0c\u7136\u540e\u591a\u6b21\u4f7f\u7528\u57fa\u4e8e\u91cd\u53e0\u7684\u7b56\u7565\uff0c\u91cd\u590d\u591a\u6b21 \u573a\u666f\u8868\u793a\u548c\u56fe\u5f62\u6e32\u67d3","title":"Idea"},{"location":"cv/papers/nerf/nid-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/others/","text":"Others \u00b6 Abstract \u5176\u4ed6 Table of Contents \u00b6 SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation","title":"Others"},{"location":"cv/papers/others/#others","text":"Abstract \u5176\u4ed6","title":"Others"},{"location":"cv/papers/others/#table-of-contents","text":"SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation","title":"Table of Contents"},{"location":"cv/papers/others/deepv2d/","text":"DeepV2D \u00b6 \u7ea6 408 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DeepV2D: Video to Depth with Differentiable Structure from Motion code\uff1a DeepV2D Idea \u00b6 \u901a\u8fc7\u89c6\u9891\u5e8f\u5217\u9884\u6d4b\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\uff0c\u5206\u4e3a\u4e24\u6a21\u5757\uff1a \u6df1\u5ea6\u6a21\u5757 \u548c \u8fd0\u52a8\u6a21\u5757 \uff1b \u6df1\u5ea6\u6a21\u5757\u5c06\u76f8\u673a\u8fd0\u52a8\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u66f4\u65b0\u7684\u6df1\u5ea6\u9884\u6d4b\uff1b\u8fd0\u52a8\u6a21\u5757\u5c06\u6df1\u5ea6\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u8fd0\u52a8\u77eb\u6b63\u9879\uff1b \u6df1\u5ea6\u6a21\u5757\uff1a 2D \u7279\u5f81\u63d0\u53d6 \uff1a\u63d0\u53d6\u4ece\u8f93\u5165\u56fe\u7247\u5b66\u4e60\u5230\u7684\u7279\u5f81\uff1b \u53cd\u6295\u5f71\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570 \uff1a\u8bbe\u8ba1\u4e00\u79cd\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff0c\u5c06 \\(I_1\\) \u4f5c\u4e3a\u5173\u952e\u5e27\uff0c\u5176\u4f59 \\(I_{2,...,n}\\) \u5e27\u88ab\u7528\u4e8e\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff1b 3D \u7acb\u4f53\u5339\u914d \uff1a \\(N-1\\) \u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\u7684\u96c6\u5408\u9996\u5148\u901a\u8fc7 3D \u5377\u79ef\u5c42\u540e\u518d\u8fdb\u884c\u7acb\u4f53\u5339\u914d\uff0c\u7136\u540e\u901a\u8fc7\u5e73\u5747 \\(N-1\\) \u4e2a\u5bb9\u91cf\u51fd\u6570\u6765\u6267\u884c\u89c6\u56fe\u6c60\u5316\uff0c\u805a\u5408\u5e27\u7684\u4fe1\u606f\uff1b \u8fd0\u52a8\u6a21\u5757\uff1a \u521d\u59cb\u5316 \uff1a\u4f7f\u7528\u4e00\u4e2a\u7f51\u7edc\u9884\u6d4b\u521d\u59cb\u59ff\u6001\u4f30\u8ba1\uff0c\u9009\u62e9\u4e00\u5e27\u4f5c\u4e3a\u5173\u952e\u5e27\u3002\u901a\u8fc7\u5c06\u5173\u952e\u5e27\u59ff\u6001\u8bbe\u7f6e\u4e3a\u5355\u4f4d\u77e9\u9635\u6765\u521d\u59cb\u5316\u59ff\u6001\uff0c\u7136\u540e\u9884\u6d4b\u5173\u952e\u5e27\u4e0e\u89c6\u9891\u4e2d\u6bcf\u4e2a\u5176\u4ed6\u5e27\u4e4b\u95f4\u7684\u76f8\u5bf9\u8fd0\u52a8\uff1b \u7279\u5f81\u63d0\u53d6 \uff1a\u7279\u5f81\u63d0\u53d6\u5668\u5c06\u6bcf\u4e00\u5e27\u6620\u5c04\u5230\u4e00\u4e2a\u5bc6\u96c6\u7684\u7279\u5f81\u6620\u5c04\uff0c\u6743\u91cd\u5728\u6240\u6709\u5e27\u4e4b\u95f4\u5171\u4eab\uff1b \u8bef\u5dee\u9879 \u4f18\u5316\u76ee\u6807 \u5168\u5c40\u59ff\u6001\u4f18\u5316 \u5173\u952e\u5e27\u59ff\u6001\u4f18\u5316 LS-\u4f18\u5316\u5c42 \u603b\u7cfb\u7edf\uff1a\u91c7\u7528\u4e24\u79cd\u521d\u59cb\u5316\u7b56\u7565\uff0c\u81ea\u521d\u59cb\u5316\u4f7f\u7528\u6052\u5b9a\u6df1\u5ea6\u56fe\u521d\u59cb\u5316DeepV2D\uff1b\u5355\u5e45\u56fe\u50cf\u521d\u59cb\u5316\u4f7f\u7528\u5355\u5e45\u56fe\u50cf\u6df1\u5ea6\u7f51\u7edc\u7684\u8f93\u51fa\u8fdb\u884c\u521d\u59cb\u5316\uff1b \u76d1\u7763\u635f\u5931\u51fd\u6570\uff1a \u6df1\u5ea6\u76d1\u7763 \u8fd0\u52a8\u76d1\u7763 \u603b\u635f\u5931 Experiments \u00b6","title":"DeepV2D"},{"location":"cv/papers/others/deepv2d/#deepv2d","text":"\u7ea6 408 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DeepV2D: Video to Depth with Differentiable Structure from Motion code\uff1a DeepV2D","title":"DeepV2D"},{"location":"cv/papers/others/deepv2d/#idea","text":"\u901a\u8fc7\u89c6\u9891\u5e8f\u5217\u9884\u6d4b\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\uff0c\u5206\u4e3a\u4e24\u6a21\u5757\uff1a \u6df1\u5ea6\u6a21\u5757 \u548c \u8fd0\u52a8\u6a21\u5757 \uff1b \u6df1\u5ea6\u6a21\u5757\u5c06\u76f8\u673a\u8fd0\u52a8\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u66f4\u65b0\u7684\u6df1\u5ea6\u9884\u6d4b\uff1b\u8fd0\u52a8\u6a21\u5757\u5c06\u6df1\u5ea6\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u8fd0\u52a8\u77eb\u6b63\u9879\uff1b \u6df1\u5ea6\u6a21\u5757\uff1a 2D \u7279\u5f81\u63d0\u53d6 \uff1a\u63d0\u53d6\u4ece\u8f93\u5165\u56fe\u7247\u5b66\u4e60\u5230\u7684\u7279\u5f81\uff1b \u53cd\u6295\u5f71\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570 \uff1a\u8bbe\u8ba1\u4e00\u79cd\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff0c\u5c06 \\(I_1\\) \u4f5c\u4e3a\u5173\u952e\u5e27\uff0c\u5176\u4f59 \\(I_{2,...,n}\\) \u5e27\u88ab\u7528\u4e8e\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff1b 3D \u7acb\u4f53\u5339\u914d \uff1a \\(N-1\\) \u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\u7684\u96c6\u5408\u9996\u5148\u901a\u8fc7 3D \u5377\u79ef\u5c42\u540e\u518d\u8fdb\u884c\u7acb\u4f53\u5339\u914d\uff0c\u7136\u540e\u901a\u8fc7\u5e73\u5747 \\(N-1\\) \u4e2a\u5bb9\u91cf\u51fd\u6570\u6765\u6267\u884c\u89c6\u56fe\u6c60\u5316\uff0c\u805a\u5408\u5e27\u7684\u4fe1\u606f\uff1b \u8fd0\u52a8\u6a21\u5757\uff1a \u521d\u59cb\u5316 \uff1a\u4f7f\u7528\u4e00\u4e2a\u7f51\u7edc\u9884\u6d4b\u521d\u59cb\u59ff\u6001\u4f30\u8ba1\uff0c\u9009\u62e9\u4e00\u5e27\u4f5c\u4e3a\u5173\u952e\u5e27\u3002\u901a\u8fc7\u5c06\u5173\u952e\u5e27\u59ff\u6001\u8bbe\u7f6e\u4e3a\u5355\u4f4d\u77e9\u9635\u6765\u521d\u59cb\u5316\u59ff\u6001\uff0c\u7136\u540e\u9884\u6d4b\u5173\u952e\u5e27\u4e0e\u89c6\u9891\u4e2d\u6bcf\u4e2a\u5176\u4ed6\u5e27\u4e4b\u95f4\u7684\u76f8\u5bf9\u8fd0\u52a8\uff1b \u7279\u5f81\u63d0\u53d6 \uff1a\u7279\u5f81\u63d0\u53d6\u5668\u5c06\u6bcf\u4e00\u5e27\u6620\u5c04\u5230\u4e00\u4e2a\u5bc6\u96c6\u7684\u7279\u5f81\u6620\u5c04\uff0c\u6743\u91cd\u5728\u6240\u6709\u5e27\u4e4b\u95f4\u5171\u4eab\uff1b \u8bef\u5dee\u9879 \u4f18\u5316\u76ee\u6807 \u5168\u5c40\u59ff\u6001\u4f18\u5316 \u5173\u952e\u5e27\u59ff\u6001\u4f18\u5316 LS-\u4f18\u5316\u5c42 \u603b\u7cfb\u7edf\uff1a\u91c7\u7528\u4e24\u79cd\u521d\u59cb\u5316\u7b56\u7565\uff0c\u81ea\u521d\u59cb\u5316\u4f7f\u7528\u6052\u5b9a\u6df1\u5ea6\u56fe\u521d\u59cb\u5316DeepV2D\uff1b\u5355\u5e45\u56fe\u50cf\u521d\u59cb\u5316\u4f7f\u7528\u5355\u5e45\u56fe\u50cf\u6df1\u5ea6\u7f51\u7edc\u7684\u8f93\u51fa\u8fdb\u884c\u521d\u59cb\u5316\uff1b \u76d1\u7763\u635f\u5931\u51fd\u6570\uff1a \u6df1\u5ea6\u76d1\u7763 \u8fd0\u52a8\u76d1\u7763 \u603b\u635f\u5931","title":"Idea"},{"location":"cv/papers/others/deepv2d/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/others/endoscopy-depth-estimation/","text":"EndoscopyDepthEstimation \u00b6 \u7ea6 671 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Dense Depth Estimation in Monocular Endoscopy with Self-supervised Learning Methods code\uff1a EndoscopyDepthEstimation-Pytorch Idea \u00b6 Training Data\uff1a\u4f7f\u7528\u7684\u6570\u636e\u96c6\u662f\u65e0\u6807\u6ce8\u7684\u5185\u7aa5\u955c\u89c6\u9891 Data Preprocessing \uff1a\u9996\u5148\u4f7f\u7528 SfM \u8fdb\u884c\u7a00\u758f\u91cd\u5efa\u3001\u4f30\u8ba1\u76f8\u673a\u4f4d\u59ff\u548c\u53ef\u89c1\u70b9\uff0c\u751f\u6210\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u3002 Sparse Depth Map \uff1a\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u6a21\u5757\uff0c\u4ec5\u9884\u6d4b\u5230\u5168\u5c40\u8303\u56f4\u5185\u7684\u6df1\u5ea6\u3002\u4e3a\u4e86\u5b9e\u73b0\u6709\u6548\u7684\u635f\u5931\u8ba1\u7b97\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c4\u6a21\u548c SfM \u7ed3\u679c\u5fc5\u987b\u5339\u914d\u3002 Sparse Soft Mask \uff1a\u7a00\u758f\u63a9\u7801\u80fd\u5229\u7528\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u4e2d\u6709\u6548\u7a00\u758f\u4fe1\u53f7\uff0c\u5e76\u5ffd\u7565\u5176\u4f59\u65e0\u6548\u533a\u57df\u3002\u4f7f\u7528\u7684\u662f SFL\u3002 Network Architecture\uff1a\u67b6\u6784\u5982\u4e0b\u56fe\u3002\u4f9d\u9760\u6765\u81eaSfM\u7684\u7a00\u758f\u4fe1\u53f7\u548c\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u6765\u5b66\u4e60\u4ece\u5355\u4e2a\u5185\u7aa5\u955c\u89c6\u9891\u5e27\u9884\u6d4b\u5bc6\u96c6\u6df1\u5ea6\u56fe\uff0c\u5728\u5e94\u7528\u9636\u6bb5\uff0c\u8be5\u7f51\u7edc\u5177\u6709\u4ece\u5355\u4e2a\u5e27\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\u7684\u7b80\u5355\u5355\u5206\u652f\u67b6\u6784\uff0c\u4e0b\u9762\u7684\u6240\u6709\u81ea\u5b9a\u4e49\u5c42\u90fd\u662f\u53ef\u5fae\u5206\u7684\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u4ee5\u7aef\u5230\u7aef\u7684\u65b9\u5f0f\u8fdb\u884c\u8bad\u7ec3\u3002 Monocular Depth Estimation \uff1a\u4f7f\u7528 DenseNet \u7684\u4fee\u6539\u7248\u672c\uff0c\u5c06\u6700\u540e\u4e00\u4e2a\u5377\u79ef\u5c42\u7684\u901a\u9053\u6570\u66f4\u6539\u4e3a1\uff0c\u5e76\u7528\u7ebf\u6027\u6fc0\u6d3b\u66ff\u6362\u6700\u7ec8\u6fc0\u6d3b\uff0c\u5373 log-softmax\u3002\u8fd8\u5c06\u7f51\u7edc\u4e0a\u8fc7\u5ea6\u90e8\u5206\u4e2d\u7684\u8f6c\u7f6e\u5377\u79ef\u5c42\u66ff\u6362\u4e3a\u6700\u8fd1\u90bb\u4e0a\u91c7\u6837\u548c\u5377\u79ef\u5c42\u3002 Depth Scaling Layer \uff1a\u8be5\u5c42\u4e0e\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u7684\u6df1\u5ea6\u9884\u6d4b\u89c4\u6a21\u548c\u76f8\u5e94\u7684 SfM \u7ed3\u679c\u76f8\u5339\u914d\uff0c\u4ee5\u8fdb\u884c\u6b63\u786e\u7684\u635f\u5931\u8ba1\u7b97\u3002 Flow from Depth Layer \uff1a\u4e3a\u4e86\u4f7f\u7528 SfM \u7ed3\u679c\u751f\u6210\u7684\u7a00\u758f\u6d41\u56fe\u6765\u8fdb\u884c\u540e\u9762\u63cf\u8ff0\u7684 SFL \u7f51\u7edc\u8bad\u7ec3\uff0c\u9996\u5148\u9700\u8981\u5c06\u7f29\u653e\u7684\u6df1\u5ea6\u56fe\u8f6c\u6362\u4e3a\u5177\u6709\u76f8\u5bf9\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\u7684\u7a20\u5bc6\u6d41\u56fe\uff08\u501f\u9274\u4f7f\u7528\u751f\u6210\u7684\u7a20\u5bc6\u6d41\u56fe\u4f5c\u4e3a\u5149\u6d41\u4f30\u8ba1\u7f51\u7edc\u7684\u8f93\u5165\uff09\u3002\u7a20\u5bc6\u6d41\u56fe\u7684\u672c\u8d28\u4e0a\u662f\u63cf\u8ff0 3D \u70b9\u53d8\u4e3a\u5230 2D \u70b9\u7684\u8f6c\u6362\u3002 Depth Warping Layer \uff1a\u7a00\u758f\u6d41\u56fe\u4e3b\u8981\u4e3a\u6765\u81ea SfM \u7684\u7a00\u758f\u4fe1\u606f\u6295\u5c04\u5230\u5e27\u7684\u533a\u57df\u8fdb\u884c\uff0c\u9274\u4e8e\u5927\u591a\u6570\u5e27\u53ea\u6709\u4e00\u5c0f\u90e8\u5206\u50cf\u7d20\u7684\u503c\u5728\u7a00\u758f\u6d41\u56fe\u4e2d\u6709\u6548\uff0c\u5927\u591a\u6570\u533a\u57df\u4ecd\u7136\u6ca1\u6709\u5f97\u5230\u9002\u5f53\u7684\u5f15\u5bfc\u3002\u901a\u8fc7\u76f8\u673a\u8fd0\u52a8\u548c\u76f8\u673a\u5185\u53c2\uff0c\u53ef\u4ee5\u901a\u8fc7\u52a0\u5f3a\u4e24\u4e2a\u76f8\u5e94\u6df1\u5ea6\u9884\u6d4b\u4e4b\u95f4\u7684\u4e00\u81f4\u6027\u6765\u5229\u7528\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u3002\u76f4\u89c9\u662f\uff0c\u4ece\u4e24\u4e2a\u76f8\u90bb\u5e27\u5206\u522b\u9884\u6d4b\u7684\u5bc6\u96c6\u6df1\u5ea6\u56fe\u662f\u76f8\u5173\u7684\uff0c\u56e0\u4e3a\u89c2\u5bdf\u5230\u7684\u533a\u57df\u4e4b\u95f4\u5b58\u5728\u91cd\u53e0\u3002\u4e3a\u4e86\u4f7f\u540e\u9762\u63cf\u8ff0\u7684\u6df1\u5ea6\u4e00\u81f4\u6027\u635f\u5931\u4e2d\u5f3a\u5236\u6267\u884c\u7684\u51e0\u4f55\u7ea6\u675f\u53ef\u5fae\u5206\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c2\u70b9\u5fc5\u987b\u9996\u5148\u5bf9\u9f50\u3002 Loss Functions Sparse Flow Loss (SFL) Depth Consistency Loss (DCL) Experiments \u00b6","title":"EndoscopyDepthEstimation"},{"location":"cv/papers/others/endoscopy-depth-estimation/#endoscopydepthestimation","text":"\u7ea6 671 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Dense Depth Estimation in Monocular Endoscopy with Self-supervised Learning Methods code\uff1a EndoscopyDepthEstimation-Pytorch","title":"EndoscopyDepthEstimation"},{"location":"cv/papers/others/endoscopy-depth-estimation/#idea","text":"Training Data\uff1a\u4f7f\u7528\u7684\u6570\u636e\u96c6\u662f\u65e0\u6807\u6ce8\u7684\u5185\u7aa5\u955c\u89c6\u9891 Data Preprocessing \uff1a\u9996\u5148\u4f7f\u7528 SfM \u8fdb\u884c\u7a00\u758f\u91cd\u5efa\u3001\u4f30\u8ba1\u76f8\u673a\u4f4d\u59ff\u548c\u53ef\u89c1\u70b9\uff0c\u751f\u6210\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u3002 Sparse Depth Map \uff1a\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u6a21\u5757\uff0c\u4ec5\u9884\u6d4b\u5230\u5168\u5c40\u8303\u56f4\u5185\u7684\u6df1\u5ea6\u3002\u4e3a\u4e86\u5b9e\u73b0\u6709\u6548\u7684\u635f\u5931\u8ba1\u7b97\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c4\u6a21\u548c SfM \u7ed3\u679c\u5fc5\u987b\u5339\u914d\u3002 Sparse Soft Mask \uff1a\u7a00\u758f\u63a9\u7801\u80fd\u5229\u7528\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u4e2d\u6709\u6548\u7a00\u758f\u4fe1\u53f7\uff0c\u5e76\u5ffd\u7565\u5176\u4f59\u65e0\u6548\u533a\u57df\u3002\u4f7f\u7528\u7684\u662f SFL\u3002 Network Architecture\uff1a\u67b6\u6784\u5982\u4e0b\u56fe\u3002\u4f9d\u9760\u6765\u81eaSfM\u7684\u7a00\u758f\u4fe1\u53f7\u548c\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u6765\u5b66\u4e60\u4ece\u5355\u4e2a\u5185\u7aa5\u955c\u89c6\u9891\u5e27\u9884\u6d4b\u5bc6\u96c6\u6df1\u5ea6\u56fe\uff0c\u5728\u5e94\u7528\u9636\u6bb5\uff0c\u8be5\u7f51\u7edc\u5177\u6709\u4ece\u5355\u4e2a\u5e27\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\u7684\u7b80\u5355\u5355\u5206\u652f\u67b6\u6784\uff0c\u4e0b\u9762\u7684\u6240\u6709\u81ea\u5b9a\u4e49\u5c42\u90fd\u662f\u53ef\u5fae\u5206\u7684\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u4ee5\u7aef\u5230\u7aef\u7684\u65b9\u5f0f\u8fdb\u884c\u8bad\u7ec3\u3002 Monocular Depth Estimation \uff1a\u4f7f\u7528 DenseNet \u7684\u4fee\u6539\u7248\u672c\uff0c\u5c06\u6700\u540e\u4e00\u4e2a\u5377\u79ef\u5c42\u7684\u901a\u9053\u6570\u66f4\u6539\u4e3a1\uff0c\u5e76\u7528\u7ebf\u6027\u6fc0\u6d3b\u66ff\u6362\u6700\u7ec8\u6fc0\u6d3b\uff0c\u5373 log-softmax\u3002\u8fd8\u5c06\u7f51\u7edc\u4e0a\u8fc7\u5ea6\u90e8\u5206\u4e2d\u7684\u8f6c\u7f6e\u5377\u79ef\u5c42\u66ff\u6362\u4e3a\u6700\u8fd1\u90bb\u4e0a\u91c7\u6837\u548c\u5377\u79ef\u5c42\u3002 Depth Scaling Layer \uff1a\u8be5\u5c42\u4e0e\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u7684\u6df1\u5ea6\u9884\u6d4b\u89c4\u6a21\u548c\u76f8\u5e94\u7684 SfM \u7ed3\u679c\u76f8\u5339\u914d\uff0c\u4ee5\u8fdb\u884c\u6b63\u786e\u7684\u635f\u5931\u8ba1\u7b97\u3002 Flow from Depth Layer \uff1a\u4e3a\u4e86\u4f7f\u7528 SfM \u7ed3\u679c\u751f\u6210\u7684\u7a00\u758f\u6d41\u56fe\u6765\u8fdb\u884c\u540e\u9762\u63cf\u8ff0\u7684 SFL \u7f51\u7edc\u8bad\u7ec3\uff0c\u9996\u5148\u9700\u8981\u5c06\u7f29\u653e\u7684\u6df1\u5ea6\u56fe\u8f6c\u6362\u4e3a\u5177\u6709\u76f8\u5bf9\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\u7684\u7a20\u5bc6\u6d41\u56fe\uff08\u501f\u9274\u4f7f\u7528\u751f\u6210\u7684\u7a20\u5bc6\u6d41\u56fe\u4f5c\u4e3a\u5149\u6d41\u4f30\u8ba1\u7f51\u7edc\u7684\u8f93\u5165\uff09\u3002\u7a20\u5bc6\u6d41\u56fe\u7684\u672c\u8d28\u4e0a\u662f\u63cf\u8ff0 3D \u70b9\u53d8\u4e3a\u5230 2D \u70b9\u7684\u8f6c\u6362\u3002 Depth Warping Layer \uff1a\u7a00\u758f\u6d41\u56fe\u4e3b\u8981\u4e3a\u6765\u81ea SfM \u7684\u7a00\u758f\u4fe1\u606f\u6295\u5c04\u5230\u5e27\u7684\u533a\u57df\u8fdb\u884c\uff0c\u9274\u4e8e\u5927\u591a\u6570\u5e27\u53ea\u6709\u4e00\u5c0f\u90e8\u5206\u50cf\u7d20\u7684\u503c\u5728\u7a00\u758f\u6d41\u56fe\u4e2d\u6709\u6548\uff0c\u5927\u591a\u6570\u533a\u57df\u4ecd\u7136\u6ca1\u6709\u5f97\u5230\u9002\u5f53\u7684\u5f15\u5bfc\u3002\u901a\u8fc7\u76f8\u673a\u8fd0\u52a8\u548c\u76f8\u673a\u5185\u53c2\uff0c\u53ef\u4ee5\u901a\u8fc7\u52a0\u5f3a\u4e24\u4e2a\u76f8\u5e94\u6df1\u5ea6\u9884\u6d4b\u4e4b\u95f4\u7684\u4e00\u81f4\u6027\u6765\u5229\u7528\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u3002\u76f4\u89c9\u662f\uff0c\u4ece\u4e24\u4e2a\u76f8\u90bb\u5e27\u5206\u522b\u9884\u6d4b\u7684\u5bc6\u96c6\u6df1\u5ea6\u56fe\u662f\u76f8\u5173\u7684\uff0c\u56e0\u4e3a\u89c2\u5bdf\u5230\u7684\u533a\u57df\u4e4b\u95f4\u5b58\u5728\u91cd\u53e0\u3002\u4e3a\u4e86\u4f7f\u540e\u9762\u63cf\u8ff0\u7684\u6df1\u5ea6\u4e00\u81f4\u6027\u635f\u5931\u4e2d\u5f3a\u5236\u6267\u884c\u7684\u51e0\u4f55\u7ea6\u675f\u53ef\u5fae\u5206\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c2\u70b9\u5fc5\u987b\u9996\u5148\u5bf9\u9f50\u3002 Loss Functions Sparse Flow Loss (SFL) Depth Consistency Loss (DCL)","title":"Idea"},{"location":"cv/papers/others/endoscopy-depth-estimation/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/others/let-net/","text":"LET-NET \u00b6 \u7ea6 155 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a LET-NET: Breaking of brightness consistency in optical flow with a lightweight CNN network code\uff1a LET-NET Idea \u00b6 \u63d0\u51fa \u8f7b\u91cf\u7ea7 CNN \u7ed3\u5408 LK \u5149\u6d41\u8fdb\u884c \u7279\u5f81\u70b9\u63d0\u53d6 \u548c \u56fe\u50cf\u4e00\u81f4\u6027\u8ba1\u7b97 \uff08\u7279\u5f81\u56fe F \u548c\u5206\u6570\u56fe S\uff09\uff0c\u6253\u7834 \u4eae\u5ea6\u4e00\u81f4\u6027\u5047\u8bbe \uff08\u4eae\u5ea6\u4e00\u81f4\u6027 \\(\\to\\) \u540c\u4e00\u50cf\u7d20\u7684\u5377\u79ef\u7279\u5f81\u4e0d\u53d8\uff09\uff0c\u4ee5\u9002\u5e94 HDR \u73af\u5883 \u3002 \u63d0\u53d6\u6700\u5feb\u901f\u7684\u6df1\u5ea6\u5b66\u4e60\u89d2\u70b9\uff08\u8bc1\u660e\u5c40\u90e8\u4fe1\u606f\u8db3\u4ee5\u63d0\u53d6\u89d2\u70b9\uff09\u3002 \u63d0\u51fa\u4e86\u4e00\u79cd\u635f\u5931\u51fd\u6570 mNRE \u6765\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u5c40\u90e8\u4e0d\u53d8\u91cf\uff0c\u5e76\u6539\u8fdb\u4e86\u89d2\u70b9\u63d0\u53d6\u4e2d\u7684\u5cf0\u503c\u635f\u5931\u3002 Experiments \u00b6 \u9879\u76ee\u6709\u95ee\u9898\uff0c issue \u3002","title":"LET-NET"},{"location":"cv/papers/others/let-net/#let-net","text":"\u7ea6 155 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a LET-NET: Breaking of brightness consistency in optical flow with a lightweight CNN network code\uff1a LET-NET","title":"LET-NET"},{"location":"cv/papers/others/let-net/#idea","text":"\u63d0\u51fa \u8f7b\u91cf\u7ea7 CNN \u7ed3\u5408 LK \u5149\u6d41\u8fdb\u884c \u7279\u5f81\u70b9\u63d0\u53d6 \u548c \u56fe\u50cf\u4e00\u81f4\u6027\u8ba1\u7b97 \uff08\u7279\u5f81\u56fe F \u548c\u5206\u6570\u56fe S\uff09\uff0c\u6253\u7834 \u4eae\u5ea6\u4e00\u81f4\u6027\u5047\u8bbe \uff08\u4eae\u5ea6\u4e00\u81f4\u6027 \\(\\to\\) \u540c\u4e00\u50cf\u7d20\u7684\u5377\u79ef\u7279\u5f81\u4e0d\u53d8\uff09\uff0c\u4ee5\u9002\u5e94 HDR \u73af\u5883 \u3002 \u63d0\u53d6\u6700\u5feb\u901f\u7684\u6df1\u5ea6\u5b66\u4e60\u89d2\u70b9\uff08\u8bc1\u660e\u5c40\u90e8\u4fe1\u606f\u8db3\u4ee5\u63d0\u53d6\u89d2\u70b9\uff09\u3002 \u63d0\u51fa\u4e86\u4e00\u79cd\u635f\u5931\u51fd\u6570 mNRE \u6765\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u5c40\u90e8\u4e0d\u53d8\u91cf\uff0c\u5e76\u6539\u8fdb\u4e86\u89d2\u70b9\u63d0\u53d6\u4e2d\u7684\u5cf0\u503c\u635f\u5931\u3002","title":"Idea"},{"location":"cv/papers/others/let-net/#experiments","text":"\u9879\u76ee\u6709\u95ee\u9898\uff0c issue \u3002","title":"Experiments"},{"location":"cv/papers/others/orbslam2/","text":"ORB-SLAM2 \u00b6 \u7ea6 23 \u4e2a\u5b57 Abstract paper\uff1a ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras code\uff1a ORB-SLAM2 https://wym.netlify.app/categories/orb-slam2/ https://blog.csdn.net/weixin_43013761/article/details/123092196 https://www.bilibili.com/video/BV1bK4y197kB https://www.guyuehome.com/34299","title":"ORB-SLAM2"},{"location":"cv/papers/others/orbslam2/#orb-slam2","text":"\u7ea6 23 \u4e2a\u5b57 Abstract paper\uff1a ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras code\uff1a ORB-SLAM2 https://wym.netlify.app/categories/orb-slam2/ https://blog.csdn.net/weixin_43013761/article/details/123092196 https://www.bilibili.com/video/BV1bK4y197kB https://www.guyuehome.com/34299","title":"ORB-SLAM2"},{"location":"cv/papers/others/vslam14/","text":"\u89c6\u89c9 SLAM \u5341\u56db\u8bb2 \u00b6 Abstract \u5b66\u4e60\u89c6\u89c9 SLAM \u5fc5\u770b\u7684\u4e00\u672c\u4e66\uff0c\u5165\u95e8\u7ea7 Table of Contents \u00b6 \u521d\u8bc6 SLAM \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 References \u00b6 \u300a\u89c6\u89c9 SLAM \u5341\u56db\u8bb2\uff08\u7b2c\u4e8c\u7248\uff09\u300b\u9ad8\u7fd4 \u731b\u5973\u7626\u7626 SLAM \u5341\u56db\u8bb2\u91cd\u8981\u516c\u5f0f\u5b9a\u7406\u6574\u7406\uff08\u4e0a\uff09 \u53f2\u4e0a\u6700\u5168slam\u4ece\u96f6\u5f00\u59cb","title":"\u89c6\u89c9 SLAM \u5341\u56db\u8bb2"},{"location":"cv/papers/others/vslam14/#slam","text":"Abstract \u5b66\u4e60\u89c6\u89c9 SLAM \u5fc5\u770b\u7684\u4e00\u672c\u4e66\uff0c\u5165\u95e8\u7ea7","title":"\u89c6\u89c9 SLAM \u5341\u56db\u8bb2"},{"location":"cv/papers/others/vslam14/#table-of-contents","text":"\u521d\u8bc6 SLAM \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8","title":"Table of Contents"},{"location":"cv/papers/others/vslam14/#references","text":"\u300a\u89c6\u89c9 SLAM \u5341\u56db\u8bb2\uff08\u7b2c\u4e8c\u7248\uff09\u300b\u9ad8\u7fd4 \u731b\u5973\u7626\u7626 SLAM \u5341\u56db\u8bb2\u91cd\u8981\u516c\u5f0f\u5b9a\u7406\u6574\u7406\uff08\u4e0a\uff09 \u53f2\u4e0a\u6700\u5168slam\u4ece\u96f6\u5f00\u59cb","title":"References"},{"location":"cv/papers/others/vslam14/lec1/","text":"\u521d\u8bc6 SLAM \u00b6 Abstract SLAM \u662f S imultaneous L ocalization and M apping \u7684\u7f29\u5199\uff0c\u5373\u540c\u65f6\u5b9a\u4f4d\u4e0e\u5efa\u56fe\u3002\u5b83\u662f\u6307\u673a\u5668\u4eba\u5728\u672a\u77e5\u73af\u5883\u4e2d\u540c\u65f6\u5efa\u7acb\u5730\u56fe\u5e76\u786e\u5b9a\u81ea\u8eab\u4f4d\u7f6e\u7684\u8fc7\u7a0b\u3002 \u540c\u65f6 SLAM \u5206\u4e3a \u89c6\u89c9 SLAM \u548c \u6fc0\u5149 SLAM \uff0c\u8fd9\u91cc\u4e3b\u8981\u5b66\u4e60\u89c6\u89c9 SLAM\uff0c\u5176\u5b9e\u5b83\u4eec\u7684\u5dee\u8ddd\u4e0d\u662f\u5f88\u5927\uff0c\u90fd\u662f\u901a\u8fc7\u4f20\u611f\u5668\u83b7\u53d6\u73af\u5883\u4fe1\u606f\uff0c\u7136\u540e\u901a\u8fc7\u7b97\u6cd5\u8fdb\u884c\u5904\u7406\uff0c\u6700\u540e\u5f97\u5230\u5730\u56fe\u548c\u673a\u5668\u4eba\u7684\u4f4d\u7f6e\uff0c\u53ea\u4e0d\u8fc7\u4e00\u4e2a\u662f\u76f8\u673a\uff0c\u4e00\u4e2a\u662f\u6fc0\u5149\u3002 \u53ef\u4ee5\u89c2\u770b \u673a\u5668\u4eba\u5de5\u5320\u963f\u6770 \u6765\u4e86\u89e3 SLAM \u5728\u505a\u4ec0\u4e48\uff0c\u600e\u4e48\u505a\u3002","title":"\u521d\u8bc6 SLAM"},{"location":"cv/papers/others/vslam14/lec1/#slam","text":"Abstract SLAM \u662f S imultaneous L ocalization and M apping \u7684\u7f29\u5199\uff0c\u5373\u540c\u65f6\u5b9a\u4f4d\u4e0e\u5efa\u56fe\u3002\u5b83\u662f\u6307\u673a\u5668\u4eba\u5728\u672a\u77e5\u73af\u5883\u4e2d\u540c\u65f6\u5efa\u7acb\u5730\u56fe\u5e76\u786e\u5b9a\u81ea\u8eab\u4f4d\u7f6e\u7684\u8fc7\u7a0b\u3002 \u540c\u65f6 SLAM \u5206\u4e3a \u89c6\u89c9 SLAM \u548c \u6fc0\u5149 SLAM \uff0c\u8fd9\u91cc\u4e3b\u8981\u5b66\u4e60\u89c6\u89c9 SLAM\uff0c\u5176\u5b9e\u5b83\u4eec\u7684\u5dee\u8ddd\u4e0d\u662f\u5f88\u5927\uff0c\u90fd\u662f\u901a\u8fc7\u4f20\u611f\u5668\u83b7\u53d6\u73af\u5883\u4fe1\u606f\uff0c\u7136\u540e\u901a\u8fc7\u7b97\u6cd5\u8fdb\u884c\u5904\u7406\uff0c\u6700\u540e\u5f97\u5230\u5730\u56fe\u548c\u673a\u5668\u4eba\u7684\u4f4d\u7f6e\uff0c\u53ea\u4e0d\u8fc7\u4e00\u4e2a\u662f\u76f8\u673a\uff0c\u4e00\u4e2a\u662f\u6fc0\u5149\u3002 \u53ef\u4ee5\u89c2\u770b \u673a\u5668\u4eba\u5de5\u5320\u963f\u6770 \u6765\u4e86\u89e3 SLAM \u5728\u505a\u4ec0\u4e48\uff0c\u600e\u4e48\u505a\u3002","title":"\u521d\u8bc6 SLAM"},{"location":"cv/papers/others/vslam14/lec2/","text":"\u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 \u00b6 \u7ea6 2134 \u4e2a\u5b57 34 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u7406\u89e3\u4e09\u7ef4\u7a7a\u95f4\u7684\u521a\u4f53\u8fd0\u52a8\u63cf\u8ff0\u65b9\u5f0f\uff1a\u65cb\u8f6c\u77e9\u9635\u3001\u53d8\u6362\u77e9\u9635\u3001\u56db\u5143\u6570\u548c\u6b27\u62c9\u89d2 \u638c\u63e1 Eigen \u5e93\u7684\u77e9\u9635\u3001\u51e0\u4f55\u6a21\u5757\u7684\u4f7f\u7528\u65b9\u6cd5 \u65cb\u8f6c\u77e9\u9635 \u00b6 \u70b9\u3001\u5411\u91cf\u548c\u5750\u6807\u7cfb \u00b6 \u7a7a\u95f4\u4e2d\u7684\u67d0\u70b9\u3002\u5176\u4f4d\u7f6e\u56fa\u5b9a\u3002\u82e5\u91c7\u7528\u4e0d\u540c\u7684\u5750\u6807\u7cfb\u63cf\u8ff0\uff0c\u5176\u5750\u6807\u4f4d\u7f6e\u5177\u4f53\u5f62\u5f0f\u662f\u4e0d\u540c\u7684\uff0c\u4f46\u662f\u8868\u8fbe\u7684\u70b9\u662f\u540c\u4e00\u4e2a\u70b9\u3002 \u7528\u7ebf\u4ee3\u8868\u793a\uff0c\u5728\u4e00\u4e2a\u7ebf\u6027\u7a7a\u95f4\u4e2d\uff0c\u627e\u5230\u8be5\u7a7a\u95f4\u7684\u4e00\u7ec4 \u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \uff0c\u90a3\u4e48\uff0c\u4efb\u610f\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u8fd9\u7ec4\u57fa\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}=[\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3][a_1,a_2,a_3]^\\top=a_1\\mathbf{e}_1+a_2\\mathbf{e}_2+a_3\\mathbf{e}_3\\) \u5750\u6807\u7cfb\u5b9a\u4e49\u65f6\uff0c\u6709\u53f3\u624b\u7cfb\u548c\u5de6\u624b\u7cfb\uff0c\u901a\u5e38\u91c7\u7528\u53f3\u624b\u7cfb \u5411\u91cf\u6709\u5185\u79ef\u548c\u5916\u79ef\u3002 \u5185\u79ef\uff1a \\(\\mathbf{a}\\mathbf{b}=\\mathbf{a}^\\top\\mathbf{b}=\\sum_{i=1}^3a_ib_i=|\\mathbf{a}||\\mathbf{b}|\\cos(\\mathbf{a}, \\mathbf{b})\\) \u5916\u79ef\uff1a \\[ \\mathbf{a} \\times \\mathbf{b}= \\begin{bmatrix} i & j & k \\\\ a_1 & a_2 & a_3 \\\\ b_1 & b_2 & b_3 \\end{bmatrix} = \\begin{bmatrix} a_2b_3-a_3b_2 \\\\ a_3b_1-a_1b_3 \\\\ a_1b_2-a_2b_1 \\end{bmatrix} = \\begin{bmatrix} 0 & -a_3 & a_2 \\\\ a_3 & 0 & -a_1 \\\\ -a_2 & a_1 & 0 \\end{bmatrix} \\mathbf{b} \\overset{\\Delta}{=} \\mathbf{a}^\\wedge \\mathbf{b} \\] \u5176\u4e2d\u7b26\u53f7 \\(\\wedge\\) \u79f0\u4e3a \u53cd\u5bf9\u79f0\u7b26\u53f7 \uff0c \\(\\mathbf{a}^\\wedge\\) \u4e3a \u53cd\u5bf9\u79f0\u77e9\u9635 \uff08\u6ee1\u8db3 \\(\\mathbf{A}^\\top=-\\mathbf{A}\\) \uff09\uff0c\u8fd9\u6837\u505a\u7684\u597d\u5904\u53ef\u4ee5\u5956\u5411\u91cf\u8fd0\u7b97\u53d8\u4e3a\u77e9\u9635\u8fd0\u7b97 \u5750\u6807\u7cfb\u95f4\u7684\u6b27\u6c0f\u53d8\u6362 \u00b6 \u4e24\u4e2a\u5750\u6807\u7cfb\u4e4b\u95f4\u7684\u8fd0\u52a8\u7531\u4e00\u4e2a\u65cb\u8f6c\u52a0\u4e0a\u4e00\u4e2a\u5e73\u79fb\u7ec4\u6210\uff0c\u8fd9\u79cd\u8fd0\u52a8\u79f0\u4e3a \u521a\u4f53\u8fd0\u52a8 \uff0c\u4f8b\u5982\u76f8\u673a\u8fd0\u52a8 \u521a\u4f53\u8fd0\u52a8\u8fc7\u7a0b\u4e2d\uff0c\u540c\u4e00\u4e2a\u5411\u91cf\u5728\u5404\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u957f\u5ea6\u548c\u5939\u89d2\u90fd\u4e0d\u53d8\uff0c\u53ea\u4f1a\u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u59ff\u6001\u4e0d\u540c\uff0c\u4f8b\u5982\u76f8\u673a\u5750\u6807\u7cfb\u5230\u4e16\u754c\u5750\u6807\u7cfb\uff0c\u76f8\u5dee\u4e00\u4e2a \u6b27\u6c0f\u53d8\u6362 \u6b27\u6c0f\u53d8\u6362\u7531\u65cb\u8f6c\u548c\u5e73\u79fb\u7ec4\u6210 \u65cb\u8f6c \u8bbe\u67d0\u4e2a\u5355\u4f4d\u6b63\u4ea4\u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \u7ecf\u8fc7\u4e00\u6b21\u65cb\u8f6c\u53d8\u6210\u4e86 \\((\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime)\\) \u3002\u5bf9\u4e8e\u540c\u4e00\u4e2a\u5411\u91cf \\(\\mathbf{a}\\) \u6ca1\u6709\u968f\u7740\u5750\u6807\u7cfb\u7684\u65cb\u8f6c\u800c\u53d1\u751f\u8fd0\u52a8\uff0c\u6240\u4ee5 \\[ [\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3]\\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=[\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime] \\begin{bmatrix} a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix} \\\\ \u540c\u65f6\u5de6\u4e58 \\begin{bmatrix} \\mathbf{e}_1^\\top \\\\ \\mathbf{e}_2^\\top \\\\ \\mathbf{e}_3^\\top \\end{bmatrix}\u5f97 \\ \\ \\ \\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=\\begin{bmatrix} \\mathbf{e}_1^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_2^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_3^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_3^\\prime \\end{bmatrix}\\begin{bmatrix}a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix}\\overset{\\Delta}{=}\\mathbf{R}\\mathbf{a}^\\prime \\] \u8fd9\u91cc\u7684 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u884c\u5217\u5f0f\u4e3a 1 \u7684\u6b63\u4ea4\u77e9\u9635\uff0c\u7531\u4e24\u7ec4\u57fa\u4e4b\u95f4\u7684\u5185\u79ef\u7ec4\u6210\uff0c\u6240\u4ee5\u77e9\u9635 \\(\\mathbf{R}\\) \u63cf\u8ff0\u4e86\u65cb\u8f6c\u672c\u8eab\uff0c\u56e0\u6b64\u88ab\u79f0\u4e3a \u65cb\u8f6c\u77e9\u9635 \uff0c\u540c\u65f6\u4e5f\u53eb \u65b9\u5411\u4f59\u5f26\u77e9\u9635 \u7531\u4e8e\u65cb\u8f6c\u77e9\u9635\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u5b83\u7684\u9006\uff08\u5373\u8f6c\u7f6e\uff09\u63cf\u8ff0\u4e86\u4e00\u4e2a\u76f8\u53cd\u7684\u65cb\u8f6c\uff0c\u5373 \\(\\mathbf{a}^\\prime=\\mathbf{R}^{-1}\\mathbf{a}=\\mathbf{R}^\\top\\mathbf{a}\\) \u5e73\u79fb \\(\\mathbf{t}\\) \u8868\u793a\u5e73\u79fb\u5411\u91cf\uff0c\u5176\u4e2d \\(\\mathbf{t}_{12} \\ne -\\mathbf{t}_{21}\\) \uff0c\u548c\u4e24\u4e2a\u7cfb\u7684\u65cb\u8f6c\u6709\u5173 \u65cb\u8f6c\u548c\u5e73\u79fb\u5408\u5230\u4e00\u8d77\uff1a \\(\\mathbf{a}^\\prime=\\mathbf{R}\\mathbf{a}+\\mathbf{t}\\) \u5b9e\u9645\u4e2d\uff0c\u5b9a\u4e49\u5750\u6807\u7cfb 1\u548c\u5750\u6807\u7cfb 2\uff0c\u90a3\u4e48\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u4e24\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}_1, \\mathbf{a}_2\\) \uff0c\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\u4e3a \\(\\mathbf{a}_1=\\mathbf{R}_{12}\\mathbf{a}_2+\\mathbf{t}_{12}\\) \uff0c\u8fd9\u91cc\u7684 \\(\\mathbf{R}_{12}\\) \u662f\u6307\u201c\u628a\u5750\u6807\u7cfb 2 \u7684\u5411\u91cf\u53d8\u6362\u5230\u5750\u6807\u7cfb 1 \u4e2d\u201d \u53d8\u6362\u77e9\u9635\u4e0e\u9f50\u6b21\u5750\u6807 \u00b6 \u4e4b\u524d\u7684\u53d8\u6362\u5173\u7cfb\u4e0d\u662f\u7ebf\u6027\u5173\u7cfb \u5047\u8bbe\u8fdb\u884c\u4e86\u4e24\u6b21\u53d8\u6362\uff0c \\(\\mathbf{b}=\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1\\) \u548c \\(\\mathbf{c}=\\mathbf{R}_2\\mathbf{b}+\\mathbf{t}_2\\) \uff0c\u90a3\u4e48 \\(\\mathbf{a}\\) \u5230 \\(\\mathbf{c}\\) \u7684\u53d8\u6362\u4e3a \\(\\mathbf{c}=\\mathbf{R}_2(\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1)+\\mathbf{t}_2\\) \uff0c\u5982\u679c\u53d8\u6362\u591a\u6b21\u4f1a\u53d8\u7684\u975e\u5e38\u7e41\u7410\uff0c\u6240\u4ee5\u5f15\u5165 \u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635 \u91cd\u5199\u4e0a\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{a}^\\prime \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} \\mathbf{R} & \\mathbf{t} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\overset{\\Delta}{=} \\mathbf{T} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\] \u5728\u4e09\u7ef4\u5411\u91cf\u7684\u672b\u5c3e\u6dfb\u52a0 1\uff0c\u5c06\u5176\u53d8\u6210\u4e86\u56db\u7ef4\u5411\u91cf\uff0c\u79f0\u4e3a \u9f50\u6b21\u5750\u6807 \u3002\u5bf9\u4e8e\u8fd9\u4e2a\u56db\u7ef4\u5411\u91cf\uff0c\u53ef\u4ee5\u628a\u65cb\u8f6c\u548c\u5e73\u79fb\u5199\u5728\u4e00\u4e2a\u77e9\u9635\u91cc\uff0c\u4f7f\u5f97\u6574\u4e2a\u5173\u7cfb\u53d8\u6210\u7ebf\u6027\u5173\u7cfb\u3002\u5176\u4e2d\u77e9\u9635 \\(\\mathbf{T}\\) \u79f0\u4e3a \u53d8\u6362\u77e9\u9635 \u7528 \\(\\tilde{\\mathbf{a}}\\) \u8868\u793a \\(\\mathbf{a}\\) \u7684\u9f50\u6b21\u5750\u6807\u3002\u6240\u4ee5\u901a\u8fc7\u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635\uff0c\u4e24\u6b21\u53d8\u6362\u7684\u53e0\u52a0\u5c31\u53ef\u4ee5\u5199\u6210 \\(\\tilde{\\mathbf{c}}=\\mathbf{T}_2\\mathbf{T}_1\\tilde{\\mathbf{a}}\\) \u65cb\u8f6c\u5411\u91cf\u548c\u6b27\u62c9\u89d2 \u00b6 \u65cb\u8f6c\u77e9\u9635\u548c\u53d8\u6362\u77e9\u9635\u90fd\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f \u53d8\u91cf\u7684\u5197\u4f59 \u3002\u5df2\u77e5\u4e00\u6b21\u65cb\u8f6c\u4ec5\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u4f46\u662f\u65cb\u8f6c\u77e9\u9635\u6709\u4e5d\u4e2a\u91cf\uff0c\u7528\u4e5d\u4e2a\u91cf\u8868\u793a\u4e09\u4e2a\u81ea\u7531\u5ea6\uff08\u4ec5\u8868\u793a\u65cb\u8f6c\uff09\uff1b\u53d8\u6362\u77e9\u9635\u670916\u4e2a\u91cf\uff0c\u752816\u4e2a\u91cf\u8868\u793a6\u4e2a\u81ea\u7531\u5ea6\uff08\u5305\u62ec\u65cb\u8f6c\u548c\u5e73\u79fb\uff09\u3002 \u5176\u6b21\uff0c\u65cb\u8f6c\u77e9\u9635\u662f\u4e00\u4e2a\u7279\u6b8a\u77e9\u9635\uff0c\u5373\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u4e14\u884c\u5217\u5f0f\u4e3a1\u3002\u4e14\u8be5\u7279\u6b8a\u6027\u4e5f\u4f1a\u5f71\u54cd\u5230\u53d8\u6362\u77e9\u9635\uff0c\u6240\u4ee5\u5177\u6709\u7279\u6b8a\u6027\u7684\u77e9\u9635\u5728\u540e\u7eed\u7684\u975e\u7ebf\u6027\u4f18\u5316\u4e2d\u4f1a\u5e26\u6765\u989d\u5916\u7684\u7ea6\u675f\uff0c\u5bfc\u81f4\u6c42\u89e3\u56f0\u96be\u3002 \u65cb\u8f6c\u5411\u91cf \u00b6 \u65cb\u8f6c\u5411\u91cf=\u4e00\u4e2a\u65cb\u8f6c\u8f74+\u4e00\u4e2a\u65cb\u8f6c\u89d2\u5ea6\u5373\uff1a\u65cb\u8f6c\u5411\u91cf\u7684\u65b9\u5411\u4e3a\u65cb\u8f6c\u8f74\uff0c\u957f\u5ea6\u4e3a\u65cb\u8f6c\u89d2\u5ea6\u3002 \u65cb\u8f6c\u5411\u91cf\u548c\u77e9\u9635\u4e4b\u95f4\u5b58\u5728\u8f6c\u6362\u5173\u7cfb\uff0c\u7528\u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\uff08Rodrigues's Formula\uff09\u8868\u793a\uff1a \\[ \\mathbf{R}=\\cos\\theta\\mathbf{I}+(1-\\cos\\theta)\\mathbf{n}\\mathbf{n}^\\top+\\sin\\theta\\mathbf{n}^\\wedge \\] \u53cd\u4e4b\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u4ece\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\u5230\u65cb\u8f6c\u5411\u91cf\u7684\u8f6c\u6362\u3002\u5bf9\u4e8e\u8f6c\u89d2 \\(\\theta\\) \uff0c\u53d6\u4e24\u8fb9\u7684 \u8ff9 \uff0c\u6709 \\[ tr(\\mathbf{R})=\\cos \\theta \\ tr(\\mathbf{I})+(1-\\cos \\theta)tr(\\mathbf{n}\\mathbf{n}^\\top)+\\sin\\theta \\ tr(\\mathbf{n}^\\wedge) \\\\ tr(\\mathbf{R})=3\\cos\\theta+(1-\\cos\\theta) \\\\ tr(\\mathbf{R})=1+2\\cos\\theta \\\\ \\theta = \\arccos\\left(\\frac{tr(\\mathbf{R})-1}{2}\\right) \\] \u5173\u4e8e\u8f6c\u8f74 \\(\\mathbf{n}\\) \uff0c\u65cb\u8f6c\u8f74\u4e0a\u7684\u5411\u91cf\u5728\u65cb\u8f6c\u540e\u4e0d\u53d8\uff0c\u5373 \\(\\mathbf{Rn}=\\mathbf{n}\\) \uff0c\u56e0\u6b64\u8f6c\u8f74 \\(\\mathbf{n}\\) \u662f\u77e9\u9635 \\(\\mathbf{R}\\) \u7279\u5f81\u503c 1 \u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u3002 \u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\u8be6\u7ec6\u63a8\u5bfc \u6b27\u62c9\u89d2 \u00b6 \u6b27\u62c9\u89d2\u662f\u4e00\u79cd\u5c06\u65cb\u8f6c\u5206\u89e3\u4e3a\u4e09\u4e2a\u57fa\u672c\u65cb\u8f6c\u7684\u65b9\u6cd5\uff0c\u5373\u7ed5\u4e09\u4e2a\u5750\u6807\u8f74\u7684\u65cb\u8f6c\u3002\u6b27\u62c9\u89d2\u7684\u8868\u793a\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u4f46\u662f\u6700\u5e38\u7528\u7684\u662f Z-Y-X \u7684\u65cb\u8f6c\u987a\u5e8f\uff0c\u5373\u5148\u7ed5 Z \u8f74\u65cb\u8f6c\uff0c\u518d\u7ed5 Y \u8f74\u65cb\u8f6c\uff0c\u6700\u540e\u7ed5 X \u8f74\u65cb\u8f6c\u3002\u8fd9\u79cd\u65cb\u8f6c\u987a\u5e8f\u4e5f\u53eb \u822a\u5411-\u4fef\u4ef0-\u6eda\u8f6c \uff08yaw-pitch-roll\uff09\u3002 \u4f46\u662f\u5b58\u5728\u4e07\u5411\u9501\u73b0\u8c61\uff1a \u4e07\u5411\u6b7b\u9501 \uff0c\u6240\u4ee5\u4f7f\u6b27\u62c9\u89d2\u5728\u7279\u6b8a\u60c5\u51b5\u4e0b\u4f1a\u51fa\u73b0\u5947\u5f02\u6027\u3002 \u56db\u5143\u6570 \u00b6 \u56db\u5143\u6570\u7684\u5b9a\u4e49 \u00b6 \u56db\u5143\u6570\u662f\u4e00\u79cd\u6269\u5c55\u590d\u6570\u7684\u65b9\u6cd5\uff0c\u590d\u6570\u7531\u5b9e\u90e8\u548c\u865a\u90e8\u7ec4\u6210\uff0c\u800c\u56db\u5143\u6570\u7531\u5b9e\u90e8\u548c\u4e09\u4e2a\u865a\u90e8\u7ec4\u6210\uff0c\u5373 \\(\\mathbf{q}=q_0+q_1i+q_2j+q_3k\\) \uff0c\u6ee1\u8db3\u4e0b\u9762\u5173\u7cfb\uff1a \\[ \\left\\{\\begin{matrix} i^2 + j^2 + k^2 = -1 \\\\ ij = k, ji = -k \\\\ jk = i, kj = -i \\\\ ki = j, ik = -j \\end{matrix}\\right. \\] \u7528\u4e00\u4e2a\u6807\u91cf\u548c\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff1a \\(\\mathbf{q}=[s,\\mathbf{v}],s=q_0 \\in R, \\mathbf{v}=[q_1,q_2,q_3]^\\top \\in R^3\\) \uff0c\u865a\u90e8\u4e3a 0 \u4e3a\u5b9e\u56db\u5143\u6570\uff0c\u5b9e\u90e8\u4e3a 0 \u4e3a\u865a\u56db\u5143\u6570 \u56db\u5143\u6570\u7684\u8fd0\u7b97 \u00b6 \\(\\mathbf{q}_a \\pm \\mathbf{q}_b = [s_a \\pm s_b, \\mathbf{v}_a \\pm \\mathbf{v}_b]\\) \\(\\mathbf{q}_a \\mathbf{q}_b=[s_as_b-\\mathbf{v}_a^\\top\\mathbf{v}_b,s_a\\mathbf{v}_b+s_b\\mathbf{v}_a+\\mathbf{v}_a\\times \\mathbf{v}_b]^\\top\\) \\(\\parallel \\mathbf{q}_a \\parallel = \\sqrt{s_a^2+x_a^2+y_a^2+z_a^2}\\) \\(\\mathbf{q}_a^*=s_a-x_ai-y_aj-z_ak=[s_a, -\\mathbf{v}_a]^\\top\\) \\(\\mathbf{q}^{-1}=\\mathbf{q}^*/\\parallel \\mathbf{q} \\parallel^2\\) \\(k\\mathbf{q}=[ks, k\\mathbf{v}]\\) \\(\\mathbf{q}_a \\cdot \\mathbf{q}_b=s_as_b+x_ax_bi+y_ay_bj+z_az_bk\\) \u7528\u56db\u5143\u6570\u8868\u793a\u65cb\u8f6c \u00b6 \u4e09\u7ef4\u7a7a\u95f4\u70b9\u7528\u4e00\u4e2a\u865a\u56db\u5143\u6570\u6765\u63cf\u8ff0\uff1a \\(\\mathbf{p}=[0,x,y,z]^\\top=[0,\\mathbf{v}]^\\top\\) \u65cb\u8f6c\u540e\u5230\u70b9 \\(\\mathbf{p}^\\prime\\) \uff1a \\(\\mathbf{p}^\\prime=\\mathbf{qpq}^{-1}\\) \u56db\u5143\u6570\u5230\u5176\u4ed6\u65cb\u8f6c\u8868\u793a\u7684\u8f6c\u6362 \u00b6 \u8f74\u89d2\u5230\u56db\u5143\u6570\uff1a \\(\\mathbf{q}=[\\cos \\frac{\\theta}{2}, n_x \\sin \\frac{\\theta}{2}, n_y \\frac{\\theta}{2}, n_z \\sin \\frac{\\theta}{2}]^\\top\\) \u56db\u5143\u6570\u5230\u8f74\u89d2\uff1a \\(\\left\\{\\begin{matrix} \\theta=2\\arccos q_0 \\\\ [n_x,n_y,n_z]^\\top=[q_1, q_2, q_3]^\\top / \\sin \\frac{\\theta}{2} \\end{matrix}\\right.\\) \u76f8\u4f3c\u3001\u4eff\u5c04\u3001\u5c04\u5f71\u53d8\u6362 \u00b6 \u89c1 \u591a\u89c6\u56fe\u51e0\u4f55 Eigen \u5e93 \u00b6 install \u00b6 sudo apt-get install libeigen3-dev # \u5982\u679c\u8981\u5b89\u88c5\u5bf9\u5e94\u7248\u672c\uff0c\u8bf7\u4e0b\u8f7d\u6e90\u7801\u7f16\u8bd1 Eigen\u4e2d\u77e9\u9635\u7684\u57fa\u672c\u64cd\u4f5c \u00b6 Eigen :: Matrix < type , row , colon > //typedef: Matrix3d, Vector3d... Eigen :: MatrixXd //unkown size matrix matrix ( i , j ) //the value of i th row and j th colon //the operations matrix . transpose (); matrix . trace (); matrix . sum (); matrix . inverse (); matrix . determinant (); //find the proper values and vectors Eigen :: SelfAdjointEigenSolver < Eigen :: Matrix3d > solver ( matrix . transport () * matrix ); solver . eigenvalues (); solver . eigenvectors (); //solve Matrix_NN * x = v_Nd x = matrix_NN . colpivHouseholderQr (). solve ( v_Nd ); // \u65cb\u8f6c\u5411\u91cf\u548c\u65cb\u8f6c\u77e9\u9635 Eigen :: AngleAxisd rotation_vector ( theta , Eigen :: Vector3d ( x , y , z )); //rotation vector rotation_matrix = rotation_vector . toRotationMatrix (); //transform rotation vector to rotation matrix x_rotated = rotation_vector * x ; //calculate rotated vector x' x_rotated = rotation_matrix * x ; //calculate rotated vector x' // \u56db\u5143\u6570 q = Eigen :: Quaterniond ( w , x , y , z ) //create a quaternion from four values q = Eigen :: Quaterniond ( rotation_vector ) //create a quaternion from rotaion vector q = Eigen :: Quaterniond ( rotation_matrix ) //create a quaternion from rotaion matrix x_rotated = q * x //calculate rotated vector x' // \u53d8\u6362\u77e9\u9635 T //create a transform matrix Eigen :: Isometry3d T = Eigen :: Isometry3d :: Identity (); T . rotate ( rotation_vector ); /* T.rotate(rotation_matrix); T.rotate(quaternion); */ T . pretranslate ( Eigen :: Vector3d ( x , y , z ));","title":"\u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8"},{"location":"cv/papers/others/vslam14/lec2/#_1","text":"\u7ea6 2134 \u4e2a\u5b57 34 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u7406\u89e3\u4e09\u7ef4\u7a7a\u95f4\u7684\u521a\u4f53\u8fd0\u52a8\u63cf\u8ff0\u65b9\u5f0f\uff1a\u65cb\u8f6c\u77e9\u9635\u3001\u53d8\u6362\u77e9\u9635\u3001\u56db\u5143\u6570\u548c\u6b27\u62c9\u89d2 \u638c\u63e1 Eigen \u5e93\u7684\u77e9\u9635\u3001\u51e0\u4f55\u6a21\u5757\u7684\u4f7f\u7528\u65b9\u6cd5","title":"\u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8"},{"location":"cv/papers/others/vslam14/lec2/#_2","text":"","title":"\u65cb\u8f6c\u77e9\u9635"},{"location":"cv/papers/others/vslam14/lec2/#_3","text":"\u7a7a\u95f4\u4e2d\u7684\u67d0\u70b9\u3002\u5176\u4f4d\u7f6e\u56fa\u5b9a\u3002\u82e5\u91c7\u7528\u4e0d\u540c\u7684\u5750\u6807\u7cfb\u63cf\u8ff0\uff0c\u5176\u5750\u6807\u4f4d\u7f6e\u5177\u4f53\u5f62\u5f0f\u662f\u4e0d\u540c\u7684\uff0c\u4f46\u662f\u8868\u8fbe\u7684\u70b9\u662f\u540c\u4e00\u4e2a\u70b9\u3002 \u7528\u7ebf\u4ee3\u8868\u793a\uff0c\u5728\u4e00\u4e2a\u7ebf\u6027\u7a7a\u95f4\u4e2d\uff0c\u627e\u5230\u8be5\u7a7a\u95f4\u7684\u4e00\u7ec4 \u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \uff0c\u90a3\u4e48\uff0c\u4efb\u610f\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u8fd9\u7ec4\u57fa\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}=[\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3][a_1,a_2,a_3]^\\top=a_1\\mathbf{e}_1+a_2\\mathbf{e}_2+a_3\\mathbf{e}_3\\) \u5750\u6807\u7cfb\u5b9a\u4e49\u65f6\uff0c\u6709\u53f3\u624b\u7cfb\u548c\u5de6\u624b\u7cfb\uff0c\u901a\u5e38\u91c7\u7528\u53f3\u624b\u7cfb \u5411\u91cf\u6709\u5185\u79ef\u548c\u5916\u79ef\u3002 \u5185\u79ef\uff1a \\(\\mathbf{a}\\mathbf{b}=\\mathbf{a}^\\top\\mathbf{b}=\\sum_{i=1}^3a_ib_i=|\\mathbf{a}||\\mathbf{b}|\\cos(\\mathbf{a}, \\mathbf{b})\\) \u5916\u79ef\uff1a \\[ \\mathbf{a} \\times \\mathbf{b}= \\begin{bmatrix} i & j & k \\\\ a_1 & a_2 & a_3 \\\\ b_1 & b_2 & b_3 \\end{bmatrix} = \\begin{bmatrix} a_2b_3-a_3b_2 \\\\ a_3b_1-a_1b_3 \\\\ a_1b_2-a_2b_1 \\end{bmatrix} = \\begin{bmatrix} 0 & -a_3 & a_2 \\\\ a_3 & 0 & -a_1 \\\\ -a_2 & a_1 & 0 \\end{bmatrix} \\mathbf{b} \\overset{\\Delta}{=} \\mathbf{a}^\\wedge \\mathbf{b} \\] \u5176\u4e2d\u7b26\u53f7 \\(\\wedge\\) \u79f0\u4e3a \u53cd\u5bf9\u79f0\u7b26\u53f7 \uff0c \\(\\mathbf{a}^\\wedge\\) \u4e3a \u53cd\u5bf9\u79f0\u77e9\u9635 \uff08\u6ee1\u8db3 \\(\\mathbf{A}^\\top=-\\mathbf{A}\\) \uff09\uff0c\u8fd9\u6837\u505a\u7684\u597d\u5904\u53ef\u4ee5\u5956\u5411\u91cf\u8fd0\u7b97\u53d8\u4e3a\u77e9\u9635\u8fd0\u7b97","title":"\u70b9\u3001\u5411\u91cf\u548c\u5750\u6807\u7cfb"},{"location":"cv/papers/others/vslam14/lec2/#_4","text":"\u4e24\u4e2a\u5750\u6807\u7cfb\u4e4b\u95f4\u7684\u8fd0\u52a8\u7531\u4e00\u4e2a\u65cb\u8f6c\u52a0\u4e0a\u4e00\u4e2a\u5e73\u79fb\u7ec4\u6210\uff0c\u8fd9\u79cd\u8fd0\u52a8\u79f0\u4e3a \u521a\u4f53\u8fd0\u52a8 \uff0c\u4f8b\u5982\u76f8\u673a\u8fd0\u52a8 \u521a\u4f53\u8fd0\u52a8\u8fc7\u7a0b\u4e2d\uff0c\u540c\u4e00\u4e2a\u5411\u91cf\u5728\u5404\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u957f\u5ea6\u548c\u5939\u89d2\u90fd\u4e0d\u53d8\uff0c\u53ea\u4f1a\u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u59ff\u6001\u4e0d\u540c\uff0c\u4f8b\u5982\u76f8\u673a\u5750\u6807\u7cfb\u5230\u4e16\u754c\u5750\u6807\u7cfb\uff0c\u76f8\u5dee\u4e00\u4e2a \u6b27\u6c0f\u53d8\u6362 \u6b27\u6c0f\u53d8\u6362\u7531\u65cb\u8f6c\u548c\u5e73\u79fb\u7ec4\u6210 \u65cb\u8f6c \u8bbe\u67d0\u4e2a\u5355\u4f4d\u6b63\u4ea4\u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \u7ecf\u8fc7\u4e00\u6b21\u65cb\u8f6c\u53d8\u6210\u4e86 \\((\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime)\\) \u3002\u5bf9\u4e8e\u540c\u4e00\u4e2a\u5411\u91cf \\(\\mathbf{a}\\) \u6ca1\u6709\u968f\u7740\u5750\u6807\u7cfb\u7684\u65cb\u8f6c\u800c\u53d1\u751f\u8fd0\u52a8\uff0c\u6240\u4ee5 \\[ [\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3]\\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=[\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime] \\begin{bmatrix} a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix} \\\\ \u540c\u65f6\u5de6\u4e58 \\begin{bmatrix} \\mathbf{e}_1^\\top \\\\ \\mathbf{e}_2^\\top \\\\ \\mathbf{e}_3^\\top \\end{bmatrix}\u5f97 \\ \\ \\ \\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=\\begin{bmatrix} \\mathbf{e}_1^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_2^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_3^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_3^\\prime \\end{bmatrix}\\begin{bmatrix}a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix}\\overset{\\Delta}{=}\\mathbf{R}\\mathbf{a}^\\prime \\] \u8fd9\u91cc\u7684 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u884c\u5217\u5f0f\u4e3a 1 \u7684\u6b63\u4ea4\u77e9\u9635\uff0c\u7531\u4e24\u7ec4\u57fa\u4e4b\u95f4\u7684\u5185\u79ef\u7ec4\u6210\uff0c\u6240\u4ee5\u77e9\u9635 \\(\\mathbf{R}\\) \u63cf\u8ff0\u4e86\u65cb\u8f6c\u672c\u8eab\uff0c\u56e0\u6b64\u88ab\u79f0\u4e3a \u65cb\u8f6c\u77e9\u9635 \uff0c\u540c\u65f6\u4e5f\u53eb \u65b9\u5411\u4f59\u5f26\u77e9\u9635 \u7531\u4e8e\u65cb\u8f6c\u77e9\u9635\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u5b83\u7684\u9006\uff08\u5373\u8f6c\u7f6e\uff09\u63cf\u8ff0\u4e86\u4e00\u4e2a\u76f8\u53cd\u7684\u65cb\u8f6c\uff0c\u5373 \\(\\mathbf{a}^\\prime=\\mathbf{R}^{-1}\\mathbf{a}=\\mathbf{R}^\\top\\mathbf{a}\\) \u5e73\u79fb \\(\\mathbf{t}\\) \u8868\u793a\u5e73\u79fb\u5411\u91cf\uff0c\u5176\u4e2d \\(\\mathbf{t}_{12} \\ne -\\mathbf{t}_{21}\\) \uff0c\u548c\u4e24\u4e2a\u7cfb\u7684\u65cb\u8f6c\u6709\u5173 \u65cb\u8f6c\u548c\u5e73\u79fb\u5408\u5230\u4e00\u8d77\uff1a \\(\\mathbf{a}^\\prime=\\mathbf{R}\\mathbf{a}+\\mathbf{t}\\) \u5b9e\u9645\u4e2d\uff0c\u5b9a\u4e49\u5750\u6807\u7cfb 1\u548c\u5750\u6807\u7cfb 2\uff0c\u90a3\u4e48\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u4e24\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}_1, \\mathbf{a}_2\\) \uff0c\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\u4e3a \\(\\mathbf{a}_1=\\mathbf{R}_{12}\\mathbf{a}_2+\\mathbf{t}_{12}\\) \uff0c\u8fd9\u91cc\u7684 \\(\\mathbf{R}_{12}\\) \u662f\u6307\u201c\u628a\u5750\u6807\u7cfb 2 \u7684\u5411\u91cf\u53d8\u6362\u5230\u5750\u6807\u7cfb 1 \u4e2d\u201d","title":"\u5750\u6807\u7cfb\u95f4\u7684\u6b27\u6c0f\u53d8\u6362"},{"location":"cv/papers/others/vslam14/lec2/#_5","text":"\u4e4b\u524d\u7684\u53d8\u6362\u5173\u7cfb\u4e0d\u662f\u7ebf\u6027\u5173\u7cfb \u5047\u8bbe\u8fdb\u884c\u4e86\u4e24\u6b21\u53d8\u6362\uff0c \\(\\mathbf{b}=\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1\\) \u548c \\(\\mathbf{c}=\\mathbf{R}_2\\mathbf{b}+\\mathbf{t}_2\\) \uff0c\u90a3\u4e48 \\(\\mathbf{a}\\) \u5230 \\(\\mathbf{c}\\) \u7684\u53d8\u6362\u4e3a \\(\\mathbf{c}=\\mathbf{R}_2(\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1)+\\mathbf{t}_2\\) \uff0c\u5982\u679c\u53d8\u6362\u591a\u6b21\u4f1a\u53d8\u7684\u975e\u5e38\u7e41\u7410\uff0c\u6240\u4ee5\u5f15\u5165 \u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635 \u91cd\u5199\u4e0a\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{a}^\\prime \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} \\mathbf{R} & \\mathbf{t} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\overset{\\Delta}{=} \\mathbf{T} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\] \u5728\u4e09\u7ef4\u5411\u91cf\u7684\u672b\u5c3e\u6dfb\u52a0 1\uff0c\u5c06\u5176\u53d8\u6210\u4e86\u56db\u7ef4\u5411\u91cf\uff0c\u79f0\u4e3a \u9f50\u6b21\u5750\u6807 \u3002\u5bf9\u4e8e\u8fd9\u4e2a\u56db\u7ef4\u5411\u91cf\uff0c\u53ef\u4ee5\u628a\u65cb\u8f6c\u548c\u5e73\u79fb\u5199\u5728\u4e00\u4e2a\u77e9\u9635\u91cc\uff0c\u4f7f\u5f97\u6574\u4e2a\u5173\u7cfb\u53d8\u6210\u7ebf\u6027\u5173\u7cfb\u3002\u5176\u4e2d\u77e9\u9635 \\(\\mathbf{T}\\) \u79f0\u4e3a \u53d8\u6362\u77e9\u9635 \u7528 \\(\\tilde{\\mathbf{a}}\\) \u8868\u793a \\(\\mathbf{a}\\) \u7684\u9f50\u6b21\u5750\u6807\u3002\u6240\u4ee5\u901a\u8fc7\u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635\uff0c\u4e24\u6b21\u53d8\u6362\u7684\u53e0\u52a0\u5c31\u53ef\u4ee5\u5199\u6210 \\(\\tilde{\\mathbf{c}}=\\mathbf{T}_2\\mathbf{T}_1\\tilde{\\mathbf{a}}\\)","title":"\u53d8\u6362\u77e9\u9635\u4e0e\u9f50\u6b21\u5750\u6807"},{"location":"cv/papers/others/vslam14/lec2/#_6","text":"\u65cb\u8f6c\u77e9\u9635\u548c\u53d8\u6362\u77e9\u9635\u90fd\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f \u53d8\u91cf\u7684\u5197\u4f59 \u3002\u5df2\u77e5\u4e00\u6b21\u65cb\u8f6c\u4ec5\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u4f46\u662f\u65cb\u8f6c\u77e9\u9635\u6709\u4e5d\u4e2a\u91cf\uff0c\u7528\u4e5d\u4e2a\u91cf\u8868\u793a\u4e09\u4e2a\u81ea\u7531\u5ea6\uff08\u4ec5\u8868\u793a\u65cb\u8f6c\uff09\uff1b\u53d8\u6362\u77e9\u9635\u670916\u4e2a\u91cf\uff0c\u752816\u4e2a\u91cf\u8868\u793a6\u4e2a\u81ea\u7531\u5ea6\uff08\u5305\u62ec\u65cb\u8f6c\u548c\u5e73\u79fb\uff09\u3002 \u5176\u6b21\uff0c\u65cb\u8f6c\u77e9\u9635\u662f\u4e00\u4e2a\u7279\u6b8a\u77e9\u9635\uff0c\u5373\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u4e14\u884c\u5217\u5f0f\u4e3a1\u3002\u4e14\u8be5\u7279\u6b8a\u6027\u4e5f\u4f1a\u5f71\u54cd\u5230\u53d8\u6362\u77e9\u9635\uff0c\u6240\u4ee5\u5177\u6709\u7279\u6b8a\u6027\u7684\u77e9\u9635\u5728\u540e\u7eed\u7684\u975e\u7ebf\u6027\u4f18\u5316\u4e2d\u4f1a\u5e26\u6765\u989d\u5916\u7684\u7ea6\u675f\uff0c\u5bfc\u81f4\u6c42\u89e3\u56f0\u96be\u3002","title":"\u65cb\u8f6c\u5411\u91cf\u548c\u6b27\u62c9\u89d2"},{"location":"cv/papers/others/vslam14/lec2/#_7","text":"\u65cb\u8f6c\u5411\u91cf=\u4e00\u4e2a\u65cb\u8f6c\u8f74+\u4e00\u4e2a\u65cb\u8f6c\u89d2\u5ea6\u5373\uff1a\u65cb\u8f6c\u5411\u91cf\u7684\u65b9\u5411\u4e3a\u65cb\u8f6c\u8f74\uff0c\u957f\u5ea6\u4e3a\u65cb\u8f6c\u89d2\u5ea6\u3002 \u65cb\u8f6c\u5411\u91cf\u548c\u77e9\u9635\u4e4b\u95f4\u5b58\u5728\u8f6c\u6362\u5173\u7cfb\uff0c\u7528\u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\uff08Rodrigues's Formula\uff09\u8868\u793a\uff1a \\[ \\mathbf{R}=\\cos\\theta\\mathbf{I}+(1-\\cos\\theta)\\mathbf{n}\\mathbf{n}^\\top+\\sin\\theta\\mathbf{n}^\\wedge \\] \u53cd\u4e4b\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u4ece\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\u5230\u65cb\u8f6c\u5411\u91cf\u7684\u8f6c\u6362\u3002\u5bf9\u4e8e\u8f6c\u89d2 \\(\\theta\\) \uff0c\u53d6\u4e24\u8fb9\u7684 \u8ff9 \uff0c\u6709 \\[ tr(\\mathbf{R})=\\cos \\theta \\ tr(\\mathbf{I})+(1-\\cos \\theta)tr(\\mathbf{n}\\mathbf{n}^\\top)+\\sin\\theta \\ tr(\\mathbf{n}^\\wedge) \\\\ tr(\\mathbf{R})=3\\cos\\theta+(1-\\cos\\theta) \\\\ tr(\\mathbf{R})=1+2\\cos\\theta \\\\ \\theta = \\arccos\\left(\\frac{tr(\\mathbf{R})-1}{2}\\right) \\] \u5173\u4e8e\u8f6c\u8f74 \\(\\mathbf{n}\\) \uff0c\u65cb\u8f6c\u8f74\u4e0a\u7684\u5411\u91cf\u5728\u65cb\u8f6c\u540e\u4e0d\u53d8\uff0c\u5373 \\(\\mathbf{Rn}=\\mathbf{n}\\) \uff0c\u56e0\u6b64\u8f6c\u8f74 \\(\\mathbf{n}\\) \u662f\u77e9\u9635 \\(\\mathbf{R}\\) \u7279\u5f81\u503c 1 \u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u3002 \u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\u8be6\u7ec6\u63a8\u5bfc","title":"\u65cb\u8f6c\u5411\u91cf"},{"location":"cv/papers/others/vslam14/lec2/#_8","text":"\u6b27\u62c9\u89d2\u662f\u4e00\u79cd\u5c06\u65cb\u8f6c\u5206\u89e3\u4e3a\u4e09\u4e2a\u57fa\u672c\u65cb\u8f6c\u7684\u65b9\u6cd5\uff0c\u5373\u7ed5\u4e09\u4e2a\u5750\u6807\u8f74\u7684\u65cb\u8f6c\u3002\u6b27\u62c9\u89d2\u7684\u8868\u793a\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u4f46\u662f\u6700\u5e38\u7528\u7684\u662f Z-Y-X \u7684\u65cb\u8f6c\u987a\u5e8f\uff0c\u5373\u5148\u7ed5 Z \u8f74\u65cb\u8f6c\uff0c\u518d\u7ed5 Y \u8f74\u65cb\u8f6c\uff0c\u6700\u540e\u7ed5 X \u8f74\u65cb\u8f6c\u3002\u8fd9\u79cd\u65cb\u8f6c\u987a\u5e8f\u4e5f\u53eb \u822a\u5411-\u4fef\u4ef0-\u6eda\u8f6c \uff08yaw-pitch-roll\uff09\u3002 \u4f46\u662f\u5b58\u5728\u4e07\u5411\u9501\u73b0\u8c61\uff1a \u4e07\u5411\u6b7b\u9501 \uff0c\u6240\u4ee5\u4f7f\u6b27\u62c9\u89d2\u5728\u7279\u6b8a\u60c5\u51b5\u4e0b\u4f1a\u51fa\u73b0\u5947\u5f02\u6027\u3002","title":"\u6b27\u62c9\u89d2"},{"location":"cv/papers/others/vslam14/lec2/#_9","text":"","title":"\u56db\u5143\u6570"},{"location":"cv/papers/others/vslam14/lec2/#_10","text":"\u56db\u5143\u6570\u662f\u4e00\u79cd\u6269\u5c55\u590d\u6570\u7684\u65b9\u6cd5\uff0c\u590d\u6570\u7531\u5b9e\u90e8\u548c\u865a\u90e8\u7ec4\u6210\uff0c\u800c\u56db\u5143\u6570\u7531\u5b9e\u90e8\u548c\u4e09\u4e2a\u865a\u90e8\u7ec4\u6210\uff0c\u5373 \\(\\mathbf{q}=q_0+q_1i+q_2j+q_3k\\) \uff0c\u6ee1\u8db3\u4e0b\u9762\u5173\u7cfb\uff1a \\[ \\left\\{\\begin{matrix} i^2 + j^2 + k^2 = -1 \\\\ ij = k, ji = -k \\\\ jk = i, kj = -i \\\\ ki = j, ik = -j \\end{matrix}\\right. \\] \u7528\u4e00\u4e2a\u6807\u91cf\u548c\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff1a \\(\\mathbf{q}=[s,\\mathbf{v}],s=q_0 \\in R, \\mathbf{v}=[q_1,q_2,q_3]^\\top \\in R^3\\) \uff0c\u865a\u90e8\u4e3a 0 \u4e3a\u5b9e\u56db\u5143\u6570\uff0c\u5b9e\u90e8\u4e3a 0 \u4e3a\u865a\u56db\u5143\u6570","title":"\u56db\u5143\u6570\u7684\u5b9a\u4e49"},{"location":"cv/papers/others/vslam14/lec2/#_11","text":"\\(\\mathbf{q}_a \\pm \\mathbf{q}_b = [s_a \\pm s_b, \\mathbf{v}_a \\pm \\mathbf{v}_b]\\) \\(\\mathbf{q}_a \\mathbf{q}_b=[s_as_b-\\mathbf{v}_a^\\top\\mathbf{v}_b,s_a\\mathbf{v}_b+s_b\\mathbf{v}_a+\\mathbf{v}_a\\times \\mathbf{v}_b]^\\top\\) \\(\\parallel \\mathbf{q}_a \\parallel = \\sqrt{s_a^2+x_a^2+y_a^2+z_a^2}\\) \\(\\mathbf{q}_a^*=s_a-x_ai-y_aj-z_ak=[s_a, -\\mathbf{v}_a]^\\top\\) \\(\\mathbf{q}^{-1}=\\mathbf{q}^*/\\parallel \\mathbf{q} \\parallel^2\\) \\(k\\mathbf{q}=[ks, k\\mathbf{v}]\\) \\(\\mathbf{q}_a \\cdot \\mathbf{q}_b=s_as_b+x_ax_bi+y_ay_bj+z_az_bk\\)","title":"\u56db\u5143\u6570\u7684\u8fd0\u7b97"},{"location":"cv/papers/others/vslam14/lec2/#_12","text":"\u4e09\u7ef4\u7a7a\u95f4\u70b9\u7528\u4e00\u4e2a\u865a\u56db\u5143\u6570\u6765\u63cf\u8ff0\uff1a \\(\\mathbf{p}=[0,x,y,z]^\\top=[0,\\mathbf{v}]^\\top\\) \u65cb\u8f6c\u540e\u5230\u70b9 \\(\\mathbf{p}^\\prime\\) \uff1a \\(\\mathbf{p}^\\prime=\\mathbf{qpq}^{-1}\\)","title":"\u7528\u56db\u5143\u6570\u8868\u793a\u65cb\u8f6c"},{"location":"cv/papers/others/vslam14/lec2/#_13","text":"\u8f74\u89d2\u5230\u56db\u5143\u6570\uff1a \\(\\mathbf{q}=[\\cos \\frac{\\theta}{2}, n_x \\sin \\frac{\\theta}{2}, n_y \\frac{\\theta}{2}, n_z \\sin \\frac{\\theta}{2}]^\\top\\) \u56db\u5143\u6570\u5230\u8f74\u89d2\uff1a \\(\\left\\{\\begin{matrix} \\theta=2\\arccos q_0 \\\\ [n_x,n_y,n_z]^\\top=[q_1, q_2, q_3]^\\top / \\sin \\frac{\\theta}{2} \\end{matrix}\\right.\\)","title":"\u56db\u5143\u6570\u5230\u5176\u4ed6\u65cb\u8f6c\u8868\u793a\u7684\u8f6c\u6362"},{"location":"cv/papers/others/vslam14/lec2/#_14","text":"\u89c1 \u591a\u89c6\u56fe\u51e0\u4f55","title":"\u76f8\u4f3c\u3001\u4eff\u5c04\u3001\u5c04\u5f71\u53d8\u6362"},{"location":"cv/papers/others/vslam14/lec2/#eigen","text":"","title":"Eigen \u5e93"},{"location":"cv/papers/others/vslam14/lec2/#install","text":"sudo apt-get install libeigen3-dev # \u5982\u679c\u8981\u5b89\u88c5\u5bf9\u5e94\u7248\u672c\uff0c\u8bf7\u4e0b\u8f7d\u6e90\u7801\u7f16\u8bd1","title":"install"},{"location":"cv/papers/others/vslam14/lec2/#eigen_1","text":"Eigen :: Matrix < type , row , colon > //typedef: Matrix3d, Vector3d... Eigen :: MatrixXd //unkown size matrix matrix ( i , j ) //the value of i th row and j th colon //the operations matrix . transpose (); matrix . trace (); matrix . sum (); matrix . inverse (); matrix . determinant (); //find the proper values and vectors Eigen :: SelfAdjointEigenSolver < Eigen :: Matrix3d > solver ( matrix . transport () * matrix ); solver . eigenvalues (); solver . eigenvectors (); //solve Matrix_NN * x = v_Nd x = matrix_NN . colpivHouseholderQr (). solve ( v_Nd ); // \u65cb\u8f6c\u5411\u91cf\u548c\u65cb\u8f6c\u77e9\u9635 Eigen :: AngleAxisd rotation_vector ( theta , Eigen :: Vector3d ( x , y , z )); //rotation vector rotation_matrix = rotation_vector . toRotationMatrix (); //transform rotation vector to rotation matrix x_rotated = rotation_vector * x ; //calculate rotated vector x' x_rotated = rotation_matrix * x ; //calculate rotated vector x' // \u56db\u5143\u6570 q = Eigen :: Quaterniond ( w , x , y , z ) //create a quaternion from four values q = Eigen :: Quaterniond ( rotation_vector ) //create a quaternion from rotaion vector q = Eigen :: Quaterniond ( rotation_matrix ) //create a quaternion from rotaion matrix x_rotated = q * x //calculate rotated vector x' // \u53d8\u6362\u77e9\u9635 T //create a transform matrix Eigen :: Isometry3d T = Eigen :: Isometry3d :: Identity (); T . rotate ( rotation_vector ); /* T.rotate(rotation_matrix); T.rotate(quaternion); */ T . pretranslate ( Eigen :: Vector3d ( x , y , z ));","title":"Eigen\u4e2d\u77e9\u9635\u7684\u57fa\u672c\u64cd\u4f5c"},{"location":"cv/pcd/","text":"\u4e09\u7ef4\u70b9\u4e91 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\uff0c\u5305\u62ec\u56fe\u50cf\u548c\u70b9\u4e91\u878d\u5408\u7b49\u7684\u76f8\u5173\u7b14\u8bb0 Table of Contents \u00b6 \u70b9\u4e91\u914d\u51c6 Reference \u00b6 \u878d\u5408\u70b9\u4e91\u4e0e\u56fe\u50cf\u7684\u73af\u5883\u76ee\u6807\u68c0\u6d4b\u7814\u7a76\u8fdb\u5c55 \u57fa\u4e8e\u52a8\u6001\u7279\u5f81\u5254\u9664\u7684\u56fe\u50cf\u4e0e\u70b9\u4e91\u878d\u5408\u7684\u673a\u5668\u4eba\u4f4d\u59ff\u4f30\u8ba1\u65b9\u6cd5 \u65e0\u60e7\u8fd0\u52a8\u7269\u4f53\u906e\u6321\uff011.53 ms\uff01CCTNet\uff1aLiDAR\u4f4d\u7f6e\u8bc6\u522b\u6700\u65b0SOTA\uff01SLAM\u56de\u73af\u7a33\u4e86\uff01 CVPR 2022 | TransFusion\uff1a\u7528Transformer\u8fdb\u884c3D\u76ee\u6807\u68c0\u6d4b\u7684\u6fc0\u5149\u96f7\u8fbe-\u76f8\u673a\u878d\u5408 \u4e09\u7ef4\u5730\u56fe\u5b9e\u65f6\u66f4\u65b0\u4e2d\u7684\u52a8\u6001\u969c\u788d\u7269\u5254\u9664 \u70b9\u4e91\u5730\u56fe\u52a8\u6001\u969c\u788d\u7269\u53bb\u9664\u57fa\u51c6 \u57fa\u4e8eTransformer\u76843D\u70b9\u4e91\u76ee\u6807\u68c0\u6d4b\u7b97\u6cd5","title":"\u4e09\u7ef4\u70b9\u4e91"},{"location":"cv/pcd/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\uff0c\u5305\u62ec\u56fe\u50cf\u548c\u70b9\u4e91\u878d\u5408\u7b49\u7684\u76f8\u5173\u7b14\u8bb0","title":"\u4e09\u7ef4\u70b9\u4e91"},{"location":"cv/pcd/#table-of-contents","text":"\u70b9\u4e91\u914d\u51c6","title":"Table of Contents"},{"location":"cv/pcd/#reference","text":"\u878d\u5408\u70b9\u4e91\u4e0e\u56fe\u50cf\u7684\u73af\u5883\u76ee\u6807\u68c0\u6d4b\u7814\u7a76\u8fdb\u5c55 \u57fa\u4e8e\u52a8\u6001\u7279\u5f81\u5254\u9664\u7684\u56fe\u50cf\u4e0e\u70b9\u4e91\u878d\u5408\u7684\u673a\u5668\u4eba\u4f4d\u59ff\u4f30\u8ba1\u65b9\u6cd5 \u65e0\u60e7\u8fd0\u52a8\u7269\u4f53\u906e\u6321\uff011.53 ms\uff01CCTNet\uff1aLiDAR\u4f4d\u7f6e\u8bc6\u522b\u6700\u65b0SOTA\uff01SLAM\u56de\u73af\u7a33\u4e86\uff01 CVPR 2022 | TransFusion\uff1a\u7528Transformer\u8fdb\u884c3D\u76ee\u6807\u68c0\u6d4b\u7684\u6fc0\u5149\u96f7\u8fbe-\u76f8\u673a\u878d\u5408 \u4e09\u7ef4\u5730\u56fe\u5b9e\u65f6\u66f4\u65b0\u4e2d\u7684\u52a8\u6001\u969c\u788d\u7269\u5254\u9664 \u70b9\u4e91\u5730\u56fe\u52a8\u6001\u969c\u788d\u7269\u53bb\u9664\u57fa\u51c6 \u57fa\u4e8eTransformer\u76843D\u70b9\u4e91\u76ee\u6807\u68c0\u6d4b\u7b97\u6cd5","title":"Reference"},{"location":"cv/pcd/pcr/","text":"\u70b9\u4e91\u914d\u51c6 \u00b6 Abstract \u70b9\u4e91\u914d\u51c6\u662f\u6211\u8bfb\u7814\u65f6\u7684\u7814\u7a76\u65b9\u5411\uff0c\u4e3b\u8981\u4e3a\u81ea\u76d1\u7763\u4ee5\u53ca\u7528\u4e8e\u8154\u5185\u73af\u5883 \u9664\u4e86\u4f20\u7edf\u65b9\u6cd5ICP\u4e4b\u5916\uff0c\u4e3b\u8981\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a \u7aef\u5230\u7aef \u63d0\u53d6\u7279\u5f81\u70b9 Table of Contents \u00b6 \u524d\u7f6e\u77e5\u8bc6 ICP Reference \u00b6 \u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\u914d\u51c6","title":"\u70b9\u4e91\u914d\u51c6"},{"location":"cv/pcd/pcr/#_1","text":"Abstract \u70b9\u4e91\u914d\u51c6\u662f\u6211\u8bfb\u7814\u65f6\u7684\u7814\u7a76\u65b9\u5411\uff0c\u4e3b\u8981\u4e3a\u81ea\u76d1\u7763\u4ee5\u53ca\u7528\u4e8e\u8154\u5185\u73af\u5883 \u9664\u4e86\u4f20\u7edf\u65b9\u6cd5ICP\u4e4b\u5916\uff0c\u4e3b\u8981\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a \u7aef\u5230\u7aef \u63d0\u53d6\u7279\u5f81\u70b9","title":"\u70b9\u4e91\u914d\u51c6"},{"location":"cv/pcd/pcr/#table-of-contents","text":"\u524d\u7f6e\u77e5\u8bc6 ICP","title":"Table of Contents"},{"location":"cv/pcd/pcr/#reference","text":"\u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\u914d\u51c6","title":"Reference"},{"location":"cv/pcd/pcr/icp/","text":"ICP \u00b6 \u7ea6 2610 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract ICP\uff08Iterative Closest Point\uff09\u662f\u4e00\u79cd\u8fed\u4ee3\u7b97\u6cd5\uff0c\u7528\u4e8e\u5c06\u4e24\u7ec4\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u5373\u627e\u5230\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u6700\u4f18\u521a\u4f53\u53d8\u6362\uff08\u65cb\u8f6c\u77e9\u9635\u548c\u5e73\u79fb\u5411\u91cf\uff09\uff0c\u4f7f\u5f97\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u8bef\u5dee\u6700\u5c0f\u5316\u3002 \u95ee\u9898\u63cf\u8ff0 \u00b6 \u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\u6307\u7684\u662f\u8f93\u5165\u4e24\u5e45\u70b9\u4e91 \\(P_s\\) \uff08source\uff09\u548c \\(P_t\\) \uff08target\uff09\uff0c\u8f93\u51fa\u4e00\u4e2a\u53d8\u6362 \\(T\\) \u4f7f\u5f97 \\(T(P_s)\\) \u548c \\(P_t\\) \u7684\u91cd\u5408\u7a0b\u5ea6\u5c3d\u53ef\u80fd\u9ad8\u3002\u53d8\u6362 \\(T\\) \u53ef\u4ee5\u662f\u521a\u6027\u7684(rigid)\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u662f\uff0c\u672c\u6587\u53ea\u8003\u8651\u521a\u6027\u53d8\u6362\uff0c\u5373\u53d8\u6362\u53ea\u5305\u62ec\u65cb\u8f6c\u3001\u5e73\u79fb\u3002 \u76ee\u524d\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u70b9\u4e91\u7cbe\u914d\u51c6\u7b97\u6cd5\u662f\u8fed\u4ee3\u6700\u8fd1\u70b9\u7b97\u6cd5\uff08Iterative Closest Point, ICP\uff09\u53ca\u5404\u79cd\u53d8\u79cd ICP \u7b97\u6cd5\u3002 \u7b97\u6cd5\u63cf\u8ff0 \u00b6 \u5bf9\u4e8e \\(T\\) \u662f\u521a\u6027\u53d8\u6362\u7684\u60c5\u5f62\uff0c\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u53ef\u4ee5\u63cf\u8ff0\u4e3a\uff1a \\[ R^\\ast, t^\\ast = \\argmin_{R, t} \\frac{1}{|P_s|} \\sum_{i=1}^{|P_s|} \\| p_t^i - (R \\cdot p_s^i + t) \\|^2 \\] \u8fd9\u91cc \\(p_s\\) \u548c \\(p_t\\) \u662f\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u4e00\u4e00\u5bf9\u5e94\u70b9\u3002 ICP \u7b97\u6cd5\u7684\u76f4\u89c2\u60f3\u6cd5\uff1a \u5982\u679c\u6211\u4eec\u77e5\u9053\u4e24\u5e45\u70b9\u4e91\u4e0a\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u90a3\u4e48\u53ef\u4ee5\u7528 Least Squares \u6765\u6c42\u89e3 R\uff0ct \u53c2\u6570\u3002 \u600e\u4e48\u77e5\u9053\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u5462\uff1f\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e86\u4e00\u4e2a\u5927\u6982\u9760\u8c31\u7684 R\uff0ct \u53c2\u6570\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u8d2a\u5fc3\u7684\u65b9\u5f0f\u627e\u4e24\u5e45\u70b9\u4e91\u4e0a\u7684\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff08\u76f4\u63a5\u627e\u8ddd\u79bb\u6700\u8fd1\u7684\u70b9\u4f5c\u4e3a\u5bf9\u5e94\u70b9\uff09\u3002 ICP \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5c31\u662f\u4ea4\u66ff\u8fdb\u884c\u4e0a\u8ff0\u4e24\u4e2a\u6b65\u9aa4\uff0c\u8fed\u4ee3\u8fdb\u884c\u8ba1\u7b97\uff0c\u76f4\u5230\u6536\u655b\u3002 ICP \u7b97\u6cd5\u6d41\u7a0b \u70b9\u4e91\u9884\u5904\u7406\uff1a\u6ee4\u6ce2\u3001\u6e05\u7406\u6570\u636e\u7b49 \u5339\u914d\uff1a\u5e94\u7528\u4e0a\u4e00\u6b65\u6c42\u89e3\u51fa\u7684\u53d8\u6362\uff0c\u627e\u6700\u8fd1\u70b9 \u52a0\u6743\uff1a\u8c03\u6574\u4e00\u4e9b\u5bf9\u5e94\u70b9\u5bf9\u7684\u6743\u91cd \u63d0\u51fa\u4e0d\u5408\u7406\u7684\u5bf9\u5e94\u70b9\u5bf9 \u8ba1\u7b97 loss \u6700\u5c0f\u5316 loss\uff0c\u6c42\u89e3\u5f53\u524d\u6700\u4f18\u53d8\u6362 \u56de\u5230 2\uff0c\u8fdb\u884c\u8fed\u4ee3\uff0c\u76f4\u5230\u6536\u655b \u6574\u4f53\u4e0a\u6765\u770b\uff0cICP \u628a\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u62c6\u5206\u6210\u4e24\u4e2a\u5b50\u95ee\u9898\uff1a \u627e\u6700\u8fd1\u70b9 \u627e\u6700\u4f18\u53d8\u6362 \u627e\u6700\u8fd1\u5bf9\u5e94\u70b9 \u00b6 \u5229\u7528\u521d\u59cb \\(R_0\u3001t_0\\) \u6216\u4e0a\u4e00\u6b21\u8fed\u4ee3\u5f97\u5230\u7684 \\(R_{k-1}\u3001t_{k-1}\\) \u5bf9\u521d\u59cb\u70b9\u4e91\u8fdb\u884c\u53d8\u6362\uff0c\u5f97\u5230\u4e00\u4e2a\u4e34\u65f6\u7684\u53d8\u6362\u70b9\u4e91\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u6bd4\u8f83\uff0c\u627e\u51fa\u6e90\u70b9\u4e91\u4e2d\u6bcf\u4e00\u4e2a\u70b9\u5728\u76ee\u6807\u70b9\u4e91\u4e2d\u7684\u6700\u8fd1\u90bb\u70b9\u3002 \u5982\u679c\u76f4\u63a5\u8fdb\u884c\u6bd4\u8f83\u6700\u8fd1\u90bb\u70b9\uff0c\u9700\u8981\u8fdb\u884c\u4e24\u91cd\u5faa\u73af\uff0c\u8ba1\u7b97\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(|P_s| \\cdot |P_t|)\\) \uff0c\u8fd9\u4e00\u6b65\u6bd4\u8f83\u8017\u65f6\uff0c\u5e38\u89c1\u7684\u52a0\u901f\u65b9\u6cd5\u6709\uff1a \u8bbe\u7f6e\u8ddd\u79bb\u9608\u503c\uff0c\u5f53\u70b9\u4e0e\u70b9\u8ddd\u79bb\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u5c31\u8ba4\u4e3a\u627e\u5230\u4e86\u5bf9\u5e94\u70b9\uff0c\u4e0d\u7528\u904d\u5386\u5b8c\u6574\u4e2a\u70b9\u96c6\u3002 \u4f7f\u7528 ANN \u52a0\u901f\u67e5\u627e\uff0c\u5e38\u89c1\u7684\u6709 KD-tree\u3002KD-tree \u5efa\u6811\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(N \\log N)\\) \uff0c\u67e5\u627e\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(\\log N)\\) \uff08\u6700\u574f\u60c5\u51b5\u4e0b\u4e3a \\(\\mathcal{O}(N)\\) \uff09\u3002 \u6c42\u89e3\u6700\u4f18\u53d8\u6362 \u00b6 \u5bf9\u4e8e point-to-point ICP \u95ee\u9898\uff0c\u6c42\u6700\u4f18\u53d8\u6362\u662f\u6709\u95ed\u5f62\u5f0f\u89e3\uff08closed-form solution\uff09\u7684\uff0c\u53ef\u4ee5\u501f\u52a9 SVD \u5206\u89e3\u6765\u8ba1\u7b97\u3002 \u7ed3\u8bba\uff1a\u5728\u5df2\u77e5\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u7684\u60c5\u51b5\u4e0b\uff0c\u8bbe \\(\\overline{p}_s, \\overline{p}_t\\) \u5206\u522b\u8868\u793a\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff0c\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\overline{p}_s\uff0c\\hat{p}_t^i=p_t^i-\\overline{p}_t\\) \uff0c\u4ee4 \\(H=\\sum_{i=1}^{|P_s|}\\hat{p}_s^i \\hat{p}_t^{i^\\top}\\) \uff0c\u8fd9\u662f\u4e00\u4e2a \\(3 \\times 3\\) \u7684\u53e5\u5b50\uff0c\u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\u5f97\u5230 \\(H=U\\Sigma V^\\top\\) \uff0c\u5219 point-to-point ICP \u95ee\u9898\u6700\u4f18\u65cb\u8f6c\u4e3a\uff1a \\[R^{\\ast} = V U^\\top\\] \u6700\u4f18\u5e73\u79fb\u4e3a\uff1a \\[t^{\\ast} = \\overline{p}_t - R^\\ast \\hat{p}_s\\] \u8ba1\u7b97\u6700\u4f18\u5e73\u79fb \u00b6 \u4ee4 \\(N=|P_s|\\) \uff0c\u8bbe \\(F(t)=\\sum_{i=1}^N \\|(R \\cdot p_s^i + t) - p_t^i \\|^2\\) \uff0c\u5bf9\u5176\u8fdb\u884c\u6c42\u5bfc\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} \\frac{\\partial F}{\\partial t} &= \\sum_{i=1}^{N} 2 (R \\cdot p_s^i + t - p_t^i) \\\\ &= 2nt + 2R\\sum_{i=1}^{N}p_s^i - 2\\sum_{i=1}^{N}p_t^i \\end{aligned} \\] \u4ee4\u5bfc\u6570\u4e3a 0\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} t &= \\frac{1}{N} \\sum_{i=1}^{N} p_t^i - R \\frac{1}{N} \\sum_{i=1}^{N} p_s^i \\\\ &= \\bar p_t - R \\bar p_s \\end{aligned} \\] \u65e0\u8bba R \u53d6\u503c\u5982\u4f55\uff0c\u6839\u636e\u4e0a\u5f0f\u90fd\u53ef\u4ee5\u6c42\u5f97\u6700\u4f18\u7684 t\uff0c\u4f7f\u5f97 loss \u6700\u5c0f\u3002 \u8ba1\u7b97\u6700\u4f18\u65cb\u8f6c \u00b6 \u7ecf\u8fc7\u6700\u4f18\u5e73\u79fb\u7684\u63a8\u5bfc\uff0c\u77e5\u9053\u65e0\u8bba\u65cb\u8f6c\u5982\u4f55\u53d6\u503c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u8ba1\u7b97\u70b9\u4e91\u7684\u8d28\u5fc3\u6765\u5f97\u5230\u6700\u4f18\u5e73\u79fb\uff0c\u4e3a\u4e86\u8ba1\u7b97\u65b9\u4fbf\uff0c\u4e0d\u59a8\u4e0d\u8003\u8651\u5e73\u79fb\u7684\u5f71\u54cd\uff0c\u5148\u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u4e0b\uff0c\u8fd9\u4e5f\u5c31\u662f\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\hat{p}_s, \\hat{p}_t^i=p_t^i-\\hat{p}_t\\) \u7684\u610f\u4e49\u3002 \u4e0b\u9762\u7528 \\(\\hat{p}_s^i\\) \u548c \\(\\hat{p}_t^i\\) \u8fdb\u884c\u63a8\u5bfc\u3002\u4e0d\u8003\u8651\u5e73\u79fb\uff0c\u5219 loss \u53ef\u4ee5\u5199\u6210\uff1a \\[ F(R) = \\sum_{i=1}^{N} \\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2 \\] \u5148\u7b80\u5316 \\(\\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2\\) \uff1a \\[ \\begin{aligned} \\|R \\cdot \\hat p_s^i - \\hat p_t^i\\|^2 &= (R \\cdot \\hat p_s^i - \\hat p_t^i)^\\top(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= ({\\hat p_s^i}^\\top R^\\top - {\\hat p_t^i}^\\top)(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= {\\hat p_s^i}^\\top R^\\top R {\\hat p_s^i} - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} + {\\hat p_t^i}^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - 2{\\hat p_t^i}^\\top R {\\hat p_s^i} \\end{aligned} \\] \u8fd9\u91cc\u5229\u7528 \\(R^\\top R=I\\) \u548c \\({\\hat p_t^i}^\\top R {\\hat p_s^i} = {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i}\\) \uff08\u6807\u91cf\u7684\u8f6c\u7f6e\u7b49\u4e8e\u81ea\u8eab\uff09\u7684\u6027\u8d28\u3002 \u7531\u4e8e\u70b9\u7684\u5750\u6807\u662f\u786e\u5b9a\u7684\uff08\u548c R \u65e0\u5173\uff09\uff0c\u6240\u4ee5\u6700\u5c0f\u5316\u539f loss \u7b49\u4ef7\u4e8e\u6c42\uff1a \\[ R^{\\ast} = \\argmin_R (-2 \\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u4e5f\u5373\u4e3a\u6c42\uff1a \\[ R^{\\ast} = \\argmax_R (\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u6ce8\u610f\u5230 \\(\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i} = trace(P_t^\\top R P_s)\\) \uff08\u7531\u77e9\u9635\u4e58\u6cd5\u53ca trace \u7684\u5b9a\u4e49\u53ef\u5f97\uff09\uff0c\u6240\u4ee5\u95ee\u9898\u8f6c\u5316\u4e3a\uff1a \\[ R^{\\ast} = \\argmax_{R} \\ trace(P_t^\\top R P_s) \\] \u6839\u636e trace \u7684\u6027\u8d28 \\(trace(AB)=trace(BA)\\) \uff0c\uff08\u8fd9\u91cc\u4e0d\u8981\u6c42 A \u548c B \u662f\u65b9\u9635\uff0c\u53ea\u8981 A*B \u662f\u65b9\u9635\u5373\u53ef\uff09\uff0c\u6709\uff1a \\[trace(P_t^\\top RP_s)=trace(RP_sP_t^\\top)\\] \u5728\u5229\u7528\u524d\u9762\u5b9a\u4e49\u7684\u77e9\u9635 H \u548c\u5176 SVD \u5206\u89e3\uff0c\u5e26\u5165\u4e0a\u5f0f\u5f97\u5230\uff1a \\[ \\begin{aligned} trace(P_t^\\top R P_s) &= trace(R P_s P_t^\\top) \\\\ &= trace(R H) \\\\ &= trace(R U \\Sigma V^\\top) \\\\ &= trace(\\Sigma V^\\top R U) \\end{aligned} \\] \u6ce8\u610f\u8fd9\u91cc\u7684 \\(V,U,R\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u6240\u4ee5 \\(V^\\top RU\\) \u4e5f\u662f\u6b63\u4ea4\u77e9\u9635\u3002 \u4ee4 \\(M=V^\\top RU=\\begin{bmatrix} m_{11} & m_{12} & m_{13} \\\\ m_{21} & m_{22} & m_{23} \\\\ m_{31} & m_{32} & m_{33} \\end{bmatrix}\\) \uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} trace(\\Sigma V^\\top R U) &= trace(\\Sigma M) \\\\ & = \\sigma_1 m_{11} + \\sigma_2 m_{22} + \\sigma_1 m_{33} \\end{aligned} \\] \u6839\u636e\u5947\u5f02\u503c\u975e\u8d1f\u7684\u6027\u8d28\u548c\u6b63\u4ea4\u77e9\u9635\u7684\u6027\u8d28\uff08\u6b63\u4ea4\u77e9\u9635\u4e2d\u7684\u5143\u7d20\u7edd\u5bf9\u503c\u4e0d\u5927\u4e8e 1\uff09\uff0c\u5bb9\u6613\u8bc1\u5f97\u53ea\u6709\u5f53 \\(M\\) \u4e3a\u5355\u4f4d\u9635\u65f6 \\(trace(\\Sigma M)\\) \u6700\u5927\uff0c\u5373\uff1a \\[ V^\\top RU = I \\\\ R = VU^\\top \\] \u6240\u4ee5\u6709 \\(R^\\ast = VU^\\top\\) \u3002 \u6700\u540e\u8fd8\u9700\u8981\u8fdb\u884c Orientation rectification\uff0c\u5373\u9a8c\u8bc1 \\(R^\\ast = VU^\\top\\) \u662f\u4e0d\u662f\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\uff08\u68c0\u67e5\u662f\u5426\u6709 \\(|R|=1\\) \uff09\uff0c\u56e0\u4e3a\u5b58\u5728 \\(|R|=-1\\) \u7684\u53ef\u80fd\uff0c\u6b64\u65f6 \\(R\\) \u8868\u793a\u7684\u4e0d\u662f\u65cb\u8f6c\u800c\u662f\u4e00\u4e2a reflection\uff0c\u6240\u4ee5\u8fd8\u8981\u7ed9\u4e0a\u8ff0\u4f18\u5316\u6c42\u89e3\u52a0\u4e0a\u4e00\u4e2a \\(|R|=1\\) \u7684\u7ea6\u675f\u3002 \u6839\u636e\u77e9\u9635\u884c\u5217\u5f0f\u7684\u6027\u8d28\uff0c\u4ee5\u53ca \\(U,V\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff1a \\[ \\begin{aligned} |M| &= |V^\\top| |U| |R| \\\\ &= |V^\\top| |U| = \\pm 1 \\end{aligned} \\] \u5982\u679c \\(|VU^\\top|=1\\) \uff0c\u5219 \\(|M|=1\uff0cR^\\ast = VU^\\top\\) \u5df2\u7ecf\u7ed9\u51fa\u6700\u4f18\u65cb\u8f6c\uff1b\u5982\u679c \\(|VU^\\top|=-1\\) \uff0c\u5219 \\(|M|=-1\\) \uff0c\u6211\u4eec\u9700\u8981\u6c42\u89e3\u6b64\u65f6\u7684 \\(R\\) \uff0c\u4e5f\u5c31\u662f\u5206\u6790 \\(M\\) \u5e94\u8be5\u5177\u6709\u4f55\u79cd\u5f62\u5f0f\u3002\u5177\u4f53\u7684\u8ba8\u8bba\u53c2\u8003 \u539f\u8bba\u6587 \uff0c\u8fd9\u91cc\u7ed9\u51fa\u7ed3\u8bba\uff1a\u5f53 \\(|M|=-1\\) \u65f6\uff0c\u4f7f\u5f97 \\(trace(\\Sigma M)\\) \u6700\u5927\u7684 \\(M\\) \u4e3a\uff1a \\[M = \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & -1 \\end{array} \\right]\\] \u7efc\u5408\u8003\u8651 \\(|M|=1\\) \u548c \\(|M|=-1\\) \u4e24\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\uff1a \\[ R^{\\ast} = V \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & |V U^\\top| \\end{array} \\right] U^\\top \\] \u5230\u6b64\u516c\u5f0f\u63a8\u5bfc\u5b8c\u5168\uff0c\u7b80\u5355\u603b\u7ed3\u4e00\u4e0b\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u7684\u6b65\u9aa4\uff1a \u8ba1\u7b97\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff1b \u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u7cfb\uff1b \u8ba1\u7b97\u77e9\u9635 H\uff08\u5f62\u5f0f\u7c7b\u4f3c\u201c\u534f\u65b9\u5dee\u77e9\u9635\u201d\uff09\uff1b \u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\uff0c\u6839\u636e\u516c\u5f0f\u6c42\u5f97 \\(R^\\ast\\) \uff1b \u6839\u636e\u516c\u5f0f\u8ba1\u7b97 \\(t^\\ast\\) \uff1b \u8fed\u4ee3 \u00b6 \u6bcf\u4e00\u6b21\u8fed\u4ee3\u90fd\u4f1a\u5f97\u5230\u5f53\u524d\u7684\u6700\u4f18\u53d8\u6362\u53c2\u6570 \\(R_k,t_k\\) \uff0c\u7136\u540e\u5c06\u8be5\u53d8\u6362\u4f5c\u7528\u4e8e\u5f53\u524d\u6e90\u70b9\u4e91\uff1b\u201c\u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u201d\u548c\u201c\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u201d\u8fd9\u4e24\u6b65\u4e0d\u505c\u8fed\u4ee3\u8fdb\u884c\uff0c\u76f4\u5230\u6ee1\u8db3\u8fed\u4ee3\u7ec8\u6b62\u6761\u4ef6\uff0c\u5e38\u7528\u7684\u7ec8\u6b62\u6761\u4ef6\u6709\uff1a \\(R_k,t_k\\) \u7684\u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c loss \u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c \u8fbe\u5230\u6700\u5927\u8fed\u4ee3\u6b21\u6570 ICP \u7684\u4f18\u7f3a\u70b9\u53ca\u4e00\u4e9b\u6539\u8fdb\u7b97\u6cd5 \u00b6 ICP \u4f18\u70b9 \u7b80\u5355\uff0c\u4e0d\u5fc5\u5bf9\u70b9\u4e91\u8fdb\u884c\u5206\u5272\u548c\u7279\u5f81\u63d0\u53d6 \u521d\u503c\u8f83\u597d\u60c5\u51b5\u4e0b\uff0c\u7cbe\u5ea6\u548c\u6536\u655b\u6027\u90fd\u4e0d\u9519 ICP \u7f3a\u70b9 \u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u7684\u8ba1\u7b97\u5f00\u9500\u8f83\u5927 \u53ea\u8003\u8651\u4e86\u70b9\u4e0e\u70b9\u8ddd\u79bb\uff0c\u7f3a\u5c11\u5bf9\u70b9\u4e91\u7ed3\u6784\u4fe1\u606f\u7684\u5229\u7528 \u539f\u59cb\u7684 ICP \u7b97\u6cd5\u8ba1\u7b97\u5f00\u9500\u5927\uff0c\u5bf9\u521d\u59cb\u53d8\u6362\u654f\u611f\uff0c\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\u89e3\u3002\u81ea ICP \u63d0\u51fa\u4ee5\u6765\uff0c\u6709\u76f8\u5f53\u591a\u7684 ICP \u6539\u8fdb\u7b97\u6cd5\uff0c\u7b80\u8981\u5217\u4e3e\u4e00\u4e9b\uff1a Point-to-Plane ICP\uff0c\u539f\u59cb ICP \u7b97\u6cd5\u7684\u4ee3\u4ef7\u51fd\u6570\u4e2d\u4f7f\u7528\u7684 point-to-point \u8ddd\u79bb\uff0cpoint-to-plane \u5219\u662f\u8003\u8651\u6e90\u9876\u70b9\u5230\u76ee\u6807\u9876\u70b9\u6240\u5728\u9762\u7684\u8ddd\u79bb\uff0c\u6bd4\u8d77\u76f4\u63a5\u8ba1\u7b97\u70b9\u5230\u70b9\u8ddd\u79bb\uff0c\u8003\u8651\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u7cbe\u5ea6\u66f4\u9ad8\uff0c\u4e0d\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\uff1b\u4f46\u8981\u6ce8\u610f point-to-plane \u7684\u4f18\u5316\u662f\u4e00\u4e2a\u975e\u7ebf\u6027\u95ee\u9898\uff0c\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u4e00\u822c\u4f7f\u7528\u5176\u7ebf\u6027\u5316\u8fd1\u4f3c\uff1b Plane-to-Plane ICP\uff0cpoint-to-plane \u53ea\u8003\u8651\u76ee\u6807\u70b9\u4e91\u5c40\u90e8\u7ed3\u6784\uff0c plane-to-plane \u987e\u540d\u601d\u4e49\u5c31\u662f\u4e5f\u8003\u8651\u6e90\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u8ba1\u7b97\u9762\u5230\u9762\u7684\u8ddd\u79bb\uff1b Generalized ICP (GICP)\uff0c\u7efc\u5408\u8003\u8651 point-to-point\u3001point-to-plane \u548c plane-to-plane \u7b56\u7565\uff0c\u7cbe\u5ea6\u3001\u9c81\u68d2\u6027\u90fd\u6709\u6240\u63d0\u9ad8\uff1b Normal Iterative Closest Point (NICP)\uff0c\u8003\u8651\u6cd5\u5411\u91cf\u548c\u5c40\u90e8\u66f2\u7387\uff0c\u66f4\u8fdb\u4e00\u6b65\u5229\u7528\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\u4fe1\u606f\uff0c\u5176\u8bba\u6587\u4e2d\u5b9e\u9a8c\u7ed3\u679c\u6bd4 GICP \u7684\u6027\u80fd\u66f4\u597d\u3002 \u5b9e\u9645\u4f7f\u7528\u4e2d\u7684\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879 \u00b6 ICP \u6bd4\u8f83\u4f9d\u8d56\u4e8e\u53d8\u6362\u521d\u503c\uff0c\u5e73\u79fb\u6bd4\u8f83\u7b80\u5355\uff0c\u76f4\u63a5\u7528\u70b9\u4e91\u8d28\u5fc3\u6765\u4f30\u8ba1\uff1b\u65cb\u8f6c\u521d\u503c\u7684\u8bdd\u53ef\u4ee5\u624b\u52a8\u8c03\u4e00\u4e2a\u7c97\u7565\u503c\uff0c\u6216\u8005\u6cbf\u6bcf\u4e2a\u8f74\u7684\u65cb\u8f6c\u8fdb\u884c\u91c7\u6837\u3001\u7ec4\u5408\u6765\u5c1d\u8bd5\uff08\u4e0d\u9002\u5408\u5b9e\u65f6\u6027\u5e94\u7528\uff09\uff1b \u70b9\u592a\u591a\u7684\u8bdd\u53ef\u4ee5\u5148\u964d\u91c7\u6837\uff1b \u627e\u5230\u4e00\u4e9b anchor \u70b9\u5bf9\uff08\u6bd4\u5982\u5148\u7528\u7279\u5f81\u70b9\u5339\u914d\uff09\uff0c\u53ef\u4ee5\u5e2e\u52a9\u52a0\u901f\u6536\u655b\uff1b \u5bf9\u5e94\u7528\u573a\u666f\u5f15\u5165\u4e00\u4e9b\u5408\u7406\u5047\u8bbe\uff0c\u6bd4\u5982\u9650\u5236\u65cb\u8f6c\u3001\u5e73\u79fb\u7684\u8303\u56f4\uff0c\u53d8\u6362\u81ea\u7531\u5ea6\u6570\u91cf\u7b49\u3002 Reference \u00b6 \u70b9\u4e91\u914d\u51c6\u5b66\u4e60\u7b14\u8bb0-ICP\uff081\uff09 \u4e09\u7ef4\u70b9\u4e91\u914d\u51c6 -- ICP \u7b97\u6cd5 https://igl.ethz.ch/projects/ARAP/svd_rot.pdf https://courses.cs.duke.edu//spring07/cps296.2/scribe_notes/lecture24.pdf","title":"ICP"},{"location":"cv/pcd/pcr/icp/#icp","text":"\u7ea6 2610 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract ICP\uff08Iterative Closest Point\uff09\u662f\u4e00\u79cd\u8fed\u4ee3\u7b97\u6cd5\uff0c\u7528\u4e8e\u5c06\u4e24\u7ec4\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u5373\u627e\u5230\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u6700\u4f18\u521a\u4f53\u53d8\u6362\uff08\u65cb\u8f6c\u77e9\u9635\u548c\u5e73\u79fb\u5411\u91cf\uff09\uff0c\u4f7f\u5f97\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u8bef\u5dee\u6700\u5c0f\u5316\u3002","title":"ICP"},{"location":"cv/pcd/pcr/icp/#_1","text":"\u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\u6307\u7684\u662f\u8f93\u5165\u4e24\u5e45\u70b9\u4e91 \\(P_s\\) \uff08source\uff09\u548c \\(P_t\\) \uff08target\uff09\uff0c\u8f93\u51fa\u4e00\u4e2a\u53d8\u6362 \\(T\\) \u4f7f\u5f97 \\(T(P_s)\\) \u548c \\(P_t\\) \u7684\u91cd\u5408\u7a0b\u5ea6\u5c3d\u53ef\u80fd\u9ad8\u3002\u53d8\u6362 \\(T\\) \u53ef\u4ee5\u662f\u521a\u6027\u7684(rigid)\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u662f\uff0c\u672c\u6587\u53ea\u8003\u8651\u521a\u6027\u53d8\u6362\uff0c\u5373\u53d8\u6362\u53ea\u5305\u62ec\u65cb\u8f6c\u3001\u5e73\u79fb\u3002 \u76ee\u524d\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u70b9\u4e91\u7cbe\u914d\u51c6\u7b97\u6cd5\u662f\u8fed\u4ee3\u6700\u8fd1\u70b9\u7b97\u6cd5\uff08Iterative Closest Point, ICP\uff09\u53ca\u5404\u79cd\u53d8\u79cd ICP \u7b97\u6cd5\u3002","title":"\u95ee\u9898\u63cf\u8ff0"},{"location":"cv/pcd/pcr/icp/#_2","text":"\u5bf9\u4e8e \\(T\\) \u662f\u521a\u6027\u53d8\u6362\u7684\u60c5\u5f62\uff0c\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u53ef\u4ee5\u63cf\u8ff0\u4e3a\uff1a \\[ R^\\ast, t^\\ast = \\argmin_{R, t} \\frac{1}{|P_s|} \\sum_{i=1}^{|P_s|} \\| p_t^i - (R \\cdot p_s^i + t) \\|^2 \\] \u8fd9\u91cc \\(p_s\\) \u548c \\(p_t\\) \u662f\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u4e00\u4e00\u5bf9\u5e94\u70b9\u3002 ICP \u7b97\u6cd5\u7684\u76f4\u89c2\u60f3\u6cd5\uff1a \u5982\u679c\u6211\u4eec\u77e5\u9053\u4e24\u5e45\u70b9\u4e91\u4e0a\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u90a3\u4e48\u53ef\u4ee5\u7528 Least Squares \u6765\u6c42\u89e3 R\uff0ct \u53c2\u6570\u3002 \u600e\u4e48\u77e5\u9053\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u5462\uff1f\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e86\u4e00\u4e2a\u5927\u6982\u9760\u8c31\u7684 R\uff0ct \u53c2\u6570\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u8d2a\u5fc3\u7684\u65b9\u5f0f\u627e\u4e24\u5e45\u70b9\u4e91\u4e0a\u7684\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff08\u76f4\u63a5\u627e\u8ddd\u79bb\u6700\u8fd1\u7684\u70b9\u4f5c\u4e3a\u5bf9\u5e94\u70b9\uff09\u3002 ICP \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5c31\u662f\u4ea4\u66ff\u8fdb\u884c\u4e0a\u8ff0\u4e24\u4e2a\u6b65\u9aa4\uff0c\u8fed\u4ee3\u8fdb\u884c\u8ba1\u7b97\uff0c\u76f4\u5230\u6536\u655b\u3002 ICP \u7b97\u6cd5\u6d41\u7a0b \u70b9\u4e91\u9884\u5904\u7406\uff1a\u6ee4\u6ce2\u3001\u6e05\u7406\u6570\u636e\u7b49 \u5339\u914d\uff1a\u5e94\u7528\u4e0a\u4e00\u6b65\u6c42\u89e3\u51fa\u7684\u53d8\u6362\uff0c\u627e\u6700\u8fd1\u70b9 \u52a0\u6743\uff1a\u8c03\u6574\u4e00\u4e9b\u5bf9\u5e94\u70b9\u5bf9\u7684\u6743\u91cd \u63d0\u51fa\u4e0d\u5408\u7406\u7684\u5bf9\u5e94\u70b9\u5bf9 \u8ba1\u7b97 loss \u6700\u5c0f\u5316 loss\uff0c\u6c42\u89e3\u5f53\u524d\u6700\u4f18\u53d8\u6362 \u56de\u5230 2\uff0c\u8fdb\u884c\u8fed\u4ee3\uff0c\u76f4\u5230\u6536\u655b \u6574\u4f53\u4e0a\u6765\u770b\uff0cICP \u628a\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u62c6\u5206\u6210\u4e24\u4e2a\u5b50\u95ee\u9898\uff1a \u627e\u6700\u8fd1\u70b9 \u627e\u6700\u4f18\u53d8\u6362","title":"\u7b97\u6cd5\u63cf\u8ff0"},{"location":"cv/pcd/pcr/icp/#_3","text":"\u5229\u7528\u521d\u59cb \\(R_0\u3001t_0\\) \u6216\u4e0a\u4e00\u6b21\u8fed\u4ee3\u5f97\u5230\u7684 \\(R_{k-1}\u3001t_{k-1}\\) \u5bf9\u521d\u59cb\u70b9\u4e91\u8fdb\u884c\u53d8\u6362\uff0c\u5f97\u5230\u4e00\u4e2a\u4e34\u65f6\u7684\u53d8\u6362\u70b9\u4e91\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u6bd4\u8f83\uff0c\u627e\u51fa\u6e90\u70b9\u4e91\u4e2d\u6bcf\u4e00\u4e2a\u70b9\u5728\u76ee\u6807\u70b9\u4e91\u4e2d\u7684\u6700\u8fd1\u90bb\u70b9\u3002 \u5982\u679c\u76f4\u63a5\u8fdb\u884c\u6bd4\u8f83\u6700\u8fd1\u90bb\u70b9\uff0c\u9700\u8981\u8fdb\u884c\u4e24\u91cd\u5faa\u73af\uff0c\u8ba1\u7b97\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(|P_s| \\cdot |P_t|)\\) \uff0c\u8fd9\u4e00\u6b65\u6bd4\u8f83\u8017\u65f6\uff0c\u5e38\u89c1\u7684\u52a0\u901f\u65b9\u6cd5\u6709\uff1a \u8bbe\u7f6e\u8ddd\u79bb\u9608\u503c\uff0c\u5f53\u70b9\u4e0e\u70b9\u8ddd\u79bb\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u5c31\u8ba4\u4e3a\u627e\u5230\u4e86\u5bf9\u5e94\u70b9\uff0c\u4e0d\u7528\u904d\u5386\u5b8c\u6574\u4e2a\u70b9\u96c6\u3002 \u4f7f\u7528 ANN \u52a0\u901f\u67e5\u627e\uff0c\u5e38\u89c1\u7684\u6709 KD-tree\u3002KD-tree \u5efa\u6811\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(N \\log N)\\) \uff0c\u67e5\u627e\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(\\log N)\\) \uff08\u6700\u574f\u60c5\u51b5\u4e0b\u4e3a \\(\\mathcal{O}(N)\\) \uff09\u3002","title":"\u627e\u6700\u8fd1\u5bf9\u5e94\u70b9"},{"location":"cv/pcd/pcr/icp/#_4","text":"\u5bf9\u4e8e point-to-point ICP \u95ee\u9898\uff0c\u6c42\u6700\u4f18\u53d8\u6362\u662f\u6709\u95ed\u5f62\u5f0f\u89e3\uff08closed-form solution\uff09\u7684\uff0c\u53ef\u4ee5\u501f\u52a9 SVD \u5206\u89e3\u6765\u8ba1\u7b97\u3002 \u7ed3\u8bba\uff1a\u5728\u5df2\u77e5\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u7684\u60c5\u51b5\u4e0b\uff0c\u8bbe \\(\\overline{p}_s, \\overline{p}_t\\) \u5206\u522b\u8868\u793a\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff0c\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\overline{p}_s\uff0c\\hat{p}_t^i=p_t^i-\\overline{p}_t\\) \uff0c\u4ee4 \\(H=\\sum_{i=1}^{|P_s|}\\hat{p}_s^i \\hat{p}_t^{i^\\top}\\) \uff0c\u8fd9\u662f\u4e00\u4e2a \\(3 \\times 3\\) \u7684\u53e5\u5b50\uff0c\u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\u5f97\u5230 \\(H=U\\Sigma V^\\top\\) \uff0c\u5219 point-to-point ICP \u95ee\u9898\u6700\u4f18\u65cb\u8f6c\u4e3a\uff1a \\[R^{\\ast} = V U^\\top\\] \u6700\u4f18\u5e73\u79fb\u4e3a\uff1a \\[t^{\\ast} = \\overline{p}_t - R^\\ast \\hat{p}_s\\]","title":"\u6c42\u89e3\u6700\u4f18\u53d8\u6362"},{"location":"cv/pcd/pcr/icp/#_5","text":"\u4ee4 \\(N=|P_s|\\) \uff0c\u8bbe \\(F(t)=\\sum_{i=1}^N \\|(R \\cdot p_s^i + t) - p_t^i \\|^2\\) \uff0c\u5bf9\u5176\u8fdb\u884c\u6c42\u5bfc\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} \\frac{\\partial F}{\\partial t} &= \\sum_{i=1}^{N} 2 (R \\cdot p_s^i + t - p_t^i) \\\\ &= 2nt + 2R\\sum_{i=1}^{N}p_s^i - 2\\sum_{i=1}^{N}p_t^i \\end{aligned} \\] \u4ee4\u5bfc\u6570\u4e3a 0\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} t &= \\frac{1}{N} \\sum_{i=1}^{N} p_t^i - R \\frac{1}{N} \\sum_{i=1}^{N} p_s^i \\\\ &= \\bar p_t - R \\bar p_s \\end{aligned} \\] \u65e0\u8bba R \u53d6\u503c\u5982\u4f55\uff0c\u6839\u636e\u4e0a\u5f0f\u90fd\u53ef\u4ee5\u6c42\u5f97\u6700\u4f18\u7684 t\uff0c\u4f7f\u5f97 loss \u6700\u5c0f\u3002","title":"\u8ba1\u7b97\u6700\u4f18\u5e73\u79fb"},{"location":"cv/pcd/pcr/icp/#_6","text":"\u7ecf\u8fc7\u6700\u4f18\u5e73\u79fb\u7684\u63a8\u5bfc\uff0c\u77e5\u9053\u65e0\u8bba\u65cb\u8f6c\u5982\u4f55\u53d6\u503c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u8ba1\u7b97\u70b9\u4e91\u7684\u8d28\u5fc3\u6765\u5f97\u5230\u6700\u4f18\u5e73\u79fb\uff0c\u4e3a\u4e86\u8ba1\u7b97\u65b9\u4fbf\uff0c\u4e0d\u59a8\u4e0d\u8003\u8651\u5e73\u79fb\u7684\u5f71\u54cd\uff0c\u5148\u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u4e0b\uff0c\u8fd9\u4e5f\u5c31\u662f\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\hat{p}_s, \\hat{p}_t^i=p_t^i-\\hat{p}_t\\) \u7684\u610f\u4e49\u3002 \u4e0b\u9762\u7528 \\(\\hat{p}_s^i\\) \u548c \\(\\hat{p}_t^i\\) \u8fdb\u884c\u63a8\u5bfc\u3002\u4e0d\u8003\u8651\u5e73\u79fb\uff0c\u5219 loss \u53ef\u4ee5\u5199\u6210\uff1a \\[ F(R) = \\sum_{i=1}^{N} \\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2 \\] \u5148\u7b80\u5316 \\(\\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2\\) \uff1a \\[ \\begin{aligned} \\|R \\cdot \\hat p_s^i - \\hat p_t^i\\|^2 &= (R \\cdot \\hat p_s^i - \\hat p_t^i)^\\top(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= ({\\hat p_s^i}^\\top R^\\top - {\\hat p_t^i}^\\top)(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= {\\hat p_s^i}^\\top R^\\top R {\\hat p_s^i} - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} + {\\hat p_t^i}^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - 2{\\hat p_t^i}^\\top R {\\hat p_s^i} \\end{aligned} \\] \u8fd9\u91cc\u5229\u7528 \\(R^\\top R=I\\) \u548c \\({\\hat p_t^i}^\\top R {\\hat p_s^i} = {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i}\\) \uff08\u6807\u91cf\u7684\u8f6c\u7f6e\u7b49\u4e8e\u81ea\u8eab\uff09\u7684\u6027\u8d28\u3002 \u7531\u4e8e\u70b9\u7684\u5750\u6807\u662f\u786e\u5b9a\u7684\uff08\u548c R \u65e0\u5173\uff09\uff0c\u6240\u4ee5\u6700\u5c0f\u5316\u539f loss \u7b49\u4ef7\u4e8e\u6c42\uff1a \\[ R^{\\ast} = \\argmin_R (-2 \\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u4e5f\u5373\u4e3a\u6c42\uff1a \\[ R^{\\ast} = \\argmax_R (\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u6ce8\u610f\u5230 \\(\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i} = trace(P_t^\\top R P_s)\\) \uff08\u7531\u77e9\u9635\u4e58\u6cd5\u53ca trace \u7684\u5b9a\u4e49\u53ef\u5f97\uff09\uff0c\u6240\u4ee5\u95ee\u9898\u8f6c\u5316\u4e3a\uff1a \\[ R^{\\ast} = \\argmax_{R} \\ trace(P_t^\\top R P_s) \\] \u6839\u636e trace \u7684\u6027\u8d28 \\(trace(AB)=trace(BA)\\) \uff0c\uff08\u8fd9\u91cc\u4e0d\u8981\u6c42 A \u548c B \u662f\u65b9\u9635\uff0c\u53ea\u8981 A*B \u662f\u65b9\u9635\u5373\u53ef\uff09\uff0c\u6709\uff1a \\[trace(P_t^\\top RP_s)=trace(RP_sP_t^\\top)\\] \u5728\u5229\u7528\u524d\u9762\u5b9a\u4e49\u7684\u77e9\u9635 H \u548c\u5176 SVD \u5206\u89e3\uff0c\u5e26\u5165\u4e0a\u5f0f\u5f97\u5230\uff1a \\[ \\begin{aligned} trace(P_t^\\top R P_s) &= trace(R P_s P_t^\\top) \\\\ &= trace(R H) \\\\ &= trace(R U \\Sigma V^\\top) \\\\ &= trace(\\Sigma V^\\top R U) \\end{aligned} \\] \u6ce8\u610f\u8fd9\u91cc\u7684 \\(V,U,R\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u6240\u4ee5 \\(V^\\top RU\\) \u4e5f\u662f\u6b63\u4ea4\u77e9\u9635\u3002 \u4ee4 \\(M=V^\\top RU=\\begin{bmatrix} m_{11} & m_{12} & m_{13} \\\\ m_{21} & m_{22} & m_{23} \\\\ m_{31} & m_{32} & m_{33} \\end{bmatrix}\\) \uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} trace(\\Sigma V^\\top R U) &= trace(\\Sigma M) \\\\ & = \\sigma_1 m_{11} + \\sigma_2 m_{22} + \\sigma_1 m_{33} \\end{aligned} \\] \u6839\u636e\u5947\u5f02\u503c\u975e\u8d1f\u7684\u6027\u8d28\u548c\u6b63\u4ea4\u77e9\u9635\u7684\u6027\u8d28\uff08\u6b63\u4ea4\u77e9\u9635\u4e2d\u7684\u5143\u7d20\u7edd\u5bf9\u503c\u4e0d\u5927\u4e8e 1\uff09\uff0c\u5bb9\u6613\u8bc1\u5f97\u53ea\u6709\u5f53 \\(M\\) \u4e3a\u5355\u4f4d\u9635\u65f6 \\(trace(\\Sigma M)\\) \u6700\u5927\uff0c\u5373\uff1a \\[ V^\\top RU = I \\\\ R = VU^\\top \\] \u6240\u4ee5\u6709 \\(R^\\ast = VU^\\top\\) \u3002 \u6700\u540e\u8fd8\u9700\u8981\u8fdb\u884c Orientation rectification\uff0c\u5373\u9a8c\u8bc1 \\(R^\\ast = VU^\\top\\) \u662f\u4e0d\u662f\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\uff08\u68c0\u67e5\u662f\u5426\u6709 \\(|R|=1\\) \uff09\uff0c\u56e0\u4e3a\u5b58\u5728 \\(|R|=-1\\) \u7684\u53ef\u80fd\uff0c\u6b64\u65f6 \\(R\\) \u8868\u793a\u7684\u4e0d\u662f\u65cb\u8f6c\u800c\u662f\u4e00\u4e2a reflection\uff0c\u6240\u4ee5\u8fd8\u8981\u7ed9\u4e0a\u8ff0\u4f18\u5316\u6c42\u89e3\u52a0\u4e0a\u4e00\u4e2a \\(|R|=1\\) \u7684\u7ea6\u675f\u3002 \u6839\u636e\u77e9\u9635\u884c\u5217\u5f0f\u7684\u6027\u8d28\uff0c\u4ee5\u53ca \\(U,V\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff1a \\[ \\begin{aligned} |M| &= |V^\\top| |U| |R| \\\\ &= |V^\\top| |U| = \\pm 1 \\end{aligned} \\] \u5982\u679c \\(|VU^\\top|=1\\) \uff0c\u5219 \\(|M|=1\uff0cR^\\ast = VU^\\top\\) \u5df2\u7ecf\u7ed9\u51fa\u6700\u4f18\u65cb\u8f6c\uff1b\u5982\u679c \\(|VU^\\top|=-1\\) \uff0c\u5219 \\(|M|=-1\\) \uff0c\u6211\u4eec\u9700\u8981\u6c42\u89e3\u6b64\u65f6\u7684 \\(R\\) \uff0c\u4e5f\u5c31\u662f\u5206\u6790 \\(M\\) \u5e94\u8be5\u5177\u6709\u4f55\u79cd\u5f62\u5f0f\u3002\u5177\u4f53\u7684\u8ba8\u8bba\u53c2\u8003 \u539f\u8bba\u6587 \uff0c\u8fd9\u91cc\u7ed9\u51fa\u7ed3\u8bba\uff1a\u5f53 \\(|M|=-1\\) \u65f6\uff0c\u4f7f\u5f97 \\(trace(\\Sigma M)\\) \u6700\u5927\u7684 \\(M\\) \u4e3a\uff1a \\[M = \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & -1 \\end{array} \\right]\\] \u7efc\u5408\u8003\u8651 \\(|M|=1\\) \u548c \\(|M|=-1\\) \u4e24\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\uff1a \\[ R^{\\ast} = V \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & |V U^\\top| \\end{array} \\right] U^\\top \\] \u5230\u6b64\u516c\u5f0f\u63a8\u5bfc\u5b8c\u5168\uff0c\u7b80\u5355\u603b\u7ed3\u4e00\u4e0b\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u7684\u6b65\u9aa4\uff1a \u8ba1\u7b97\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff1b \u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u7cfb\uff1b \u8ba1\u7b97\u77e9\u9635 H\uff08\u5f62\u5f0f\u7c7b\u4f3c\u201c\u534f\u65b9\u5dee\u77e9\u9635\u201d\uff09\uff1b \u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\uff0c\u6839\u636e\u516c\u5f0f\u6c42\u5f97 \\(R^\\ast\\) \uff1b \u6839\u636e\u516c\u5f0f\u8ba1\u7b97 \\(t^\\ast\\) \uff1b","title":"\u8ba1\u7b97\u6700\u4f18\u65cb\u8f6c"},{"location":"cv/pcd/pcr/icp/#_7","text":"\u6bcf\u4e00\u6b21\u8fed\u4ee3\u90fd\u4f1a\u5f97\u5230\u5f53\u524d\u7684\u6700\u4f18\u53d8\u6362\u53c2\u6570 \\(R_k,t_k\\) \uff0c\u7136\u540e\u5c06\u8be5\u53d8\u6362\u4f5c\u7528\u4e8e\u5f53\u524d\u6e90\u70b9\u4e91\uff1b\u201c\u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u201d\u548c\u201c\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u201d\u8fd9\u4e24\u6b65\u4e0d\u505c\u8fed\u4ee3\u8fdb\u884c\uff0c\u76f4\u5230\u6ee1\u8db3\u8fed\u4ee3\u7ec8\u6b62\u6761\u4ef6\uff0c\u5e38\u7528\u7684\u7ec8\u6b62\u6761\u4ef6\u6709\uff1a \\(R_k,t_k\\) \u7684\u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c loss \u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c \u8fbe\u5230\u6700\u5927\u8fed\u4ee3\u6b21\u6570","title":"\u8fed\u4ee3"},{"location":"cv/pcd/pcr/icp/#icp_1","text":"ICP \u4f18\u70b9 \u7b80\u5355\uff0c\u4e0d\u5fc5\u5bf9\u70b9\u4e91\u8fdb\u884c\u5206\u5272\u548c\u7279\u5f81\u63d0\u53d6 \u521d\u503c\u8f83\u597d\u60c5\u51b5\u4e0b\uff0c\u7cbe\u5ea6\u548c\u6536\u655b\u6027\u90fd\u4e0d\u9519 ICP \u7f3a\u70b9 \u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u7684\u8ba1\u7b97\u5f00\u9500\u8f83\u5927 \u53ea\u8003\u8651\u4e86\u70b9\u4e0e\u70b9\u8ddd\u79bb\uff0c\u7f3a\u5c11\u5bf9\u70b9\u4e91\u7ed3\u6784\u4fe1\u606f\u7684\u5229\u7528 \u539f\u59cb\u7684 ICP \u7b97\u6cd5\u8ba1\u7b97\u5f00\u9500\u5927\uff0c\u5bf9\u521d\u59cb\u53d8\u6362\u654f\u611f\uff0c\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\u89e3\u3002\u81ea ICP \u63d0\u51fa\u4ee5\u6765\uff0c\u6709\u76f8\u5f53\u591a\u7684 ICP \u6539\u8fdb\u7b97\u6cd5\uff0c\u7b80\u8981\u5217\u4e3e\u4e00\u4e9b\uff1a Point-to-Plane ICP\uff0c\u539f\u59cb ICP \u7b97\u6cd5\u7684\u4ee3\u4ef7\u51fd\u6570\u4e2d\u4f7f\u7528\u7684 point-to-point \u8ddd\u79bb\uff0cpoint-to-plane \u5219\u662f\u8003\u8651\u6e90\u9876\u70b9\u5230\u76ee\u6807\u9876\u70b9\u6240\u5728\u9762\u7684\u8ddd\u79bb\uff0c\u6bd4\u8d77\u76f4\u63a5\u8ba1\u7b97\u70b9\u5230\u70b9\u8ddd\u79bb\uff0c\u8003\u8651\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u7cbe\u5ea6\u66f4\u9ad8\uff0c\u4e0d\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\uff1b\u4f46\u8981\u6ce8\u610f point-to-plane \u7684\u4f18\u5316\u662f\u4e00\u4e2a\u975e\u7ebf\u6027\u95ee\u9898\uff0c\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u4e00\u822c\u4f7f\u7528\u5176\u7ebf\u6027\u5316\u8fd1\u4f3c\uff1b Plane-to-Plane ICP\uff0cpoint-to-plane \u53ea\u8003\u8651\u76ee\u6807\u70b9\u4e91\u5c40\u90e8\u7ed3\u6784\uff0c plane-to-plane \u987e\u540d\u601d\u4e49\u5c31\u662f\u4e5f\u8003\u8651\u6e90\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u8ba1\u7b97\u9762\u5230\u9762\u7684\u8ddd\u79bb\uff1b Generalized ICP (GICP)\uff0c\u7efc\u5408\u8003\u8651 point-to-point\u3001point-to-plane \u548c plane-to-plane \u7b56\u7565\uff0c\u7cbe\u5ea6\u3001\u9c81\u68d2\u6027\u90fd\u6709\u6240\u63d0\u9ad8\uff1b Normal Iterative Closest Point (NICP)\uff0c\u8003\u8651\u6cd5\u5411\u91cf\u548c\u5c40\u90e8\u66f2\u7387\uff0c\u66f4\u8fdb\u4e00\u6b65\u5229\u7528\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\u4fe1\u606f\uff0c\u5176\u8bba\u6587\u4e2d\u5b9e\u9a8c\u7ed3\u679c\u6bd4 GICP \u7684\u6027\u80fd\u66f4\u597d\u3002","title":"ICP \u7684\u4f18\u7f3a\u70b9\u53ca\u4e00\u4e9b\u6539\u8fdb\u7b97\u6cd5"},{"location":"cv/pcd/pcr/icp/#_8","text":"ICP \u6bd4\u8f83\u4f9d\u8d56\u4e8e\u53d8\u6362\u521d\u503c\uff0c\u5e73\u79fb\u6bd4\u8f83\u7b80\u5355\uff0c\u76f4\u63a5\u7528\u70b9\u4e91\u8d28\u5fc3\u6765\u4f30\u8ba1\uff1b\u65cb\u8f6c\u521d\u503c\u7684\u8bdd\u53ef\u4ee5\u624b\u52a8\u8c03\u4e00\u4e2a\u7c97\u7565\u503c\uff0c\u6216\u8005\u6cbf\u6bcf\u4e2a\u8f74\u7684\u65cb\u8f6c\u8fdb\u884c\u91c7\u6837\u3001\u7ec4\u5408\u6765\u5c1d\u8bd5\uff08\u4e0d\u9002\u5408\u5b9e\u65f6\u6027\u5e94\u7528\uff09\uff1b \u70b9\u592a\u591a\u7684\u8bdd\u53ef\u4ee5\u5148\u964d\u91c7\u6837\uff1b \u627e\u5230\u4e00\u4e9b anchor \u70b9\u5bf9\uff08\u6bd4\u5982\u5148\u7528\u7279\u5f81\u70b9\u5339\u914d\uff09\uff0c\u53ef\u4ee5\u5e2e\u52a9\u52a0\u901f\u6536\u655b\uff1b \u5bf9\u5e94\u7528\u573a\u666f\u5f15\u5165\u4e00\u4e9b\u5408\u7406\u5047\u8bbe\uff0c\u6bd4\u5982\u9650\u5236\u65cb\u8f6c\u3001\u5e73\u79fb\u7684\u8303\u56f4\uff0c\u53d8\u6362\u81ea\u7531\u5ea6\u6570\u91cf\u7b49\u3002","title":"\u5b9e\u9645\u4f7f\u7528\u4e2d\u7684\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879"},{"location":"cv/pcd/pcr/icp/#reference","text":"\u70b9\u4e91\u914d\u51c6\u5b66\u4e60\u7b14\u8bb0-ICP\uff081\uff09 \u4e09\u7ef4\u70b9\u4e91\u914d\u51c6 -- ICP \u7b97\u6cd5 https://igl.ethz.ch/projects/ARAP/svd_rot.pdf https://courses.cs.duke.edu//spring07/cps296.2/scribe_notes/lecture24.pdf","title":"Reference"},{"location":"cv/pcd/pcr/prepare/","text":"\u524d\u7f6e\u77e5\u8bc6 \u00b6 \u7ea6 2032 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u70b9\u4e91\u914d\u51c6\u57fa\u7840\u77e5\u8bc6\uff0c\u4e3b\u8981\u4e3a\u70b9\u4e91\u57fa\u7840\u3001\u5904\u7406\u65b9\u6cd5\u548c\u70b9\u4e91\u914d\u51c6\u65b9\u6cd5\u7684\u4ecb\u7ecd\u548c\u6bd4\u8f83\u7b49 \u70b9\u4e91\u57fa\u7840 \u00b6 \u70b9\u4e91\u6982\u5ff5\uff1a\u70b9\u4e91\u662f\u540c\u4e00\u7a7a\u95f4\u53c2\u8003\u7cfb\u4e0b\u8868\u8fbe\u76ee\u6807\u7a7a\u95f4\u5206\u5e03\u548c\u76ee\u6807\u8868\u9762\u7279\u6027\u7684\u6d77\u91cf\u70b9\u96c6\u5408\uff0c\u5728\u83b7\u53d6\u7269\u4f53\u8868\u9762\u6bcf\u4e2a\u91c7\u6837\u70b9\u7684\u7a7a\u95f4\u5750\u6807\u540e\uff0c\u5f97\u5230\u7684\u662f\u70b9\u7684\u96c6\u5408\uff0c\u79f0\u4e4b\u4e3a\u201c\u70b9\u4e91\u201d\uff08Point Cloud\uff09\u3002 \u70b9\u4e91\u56fe\u50cf\u662f\u6700\u57fa\u7840\u4e5f\u662f\u6700\u5e38\u89c1\u7684\u4e09\u7ef4\u56fe\u50cf\uff1a\u4e09\u7ef4\u56fe\u50cf\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u56fe\u50cf\u4fe1\u606f\u8868\u8fbe\u5f62\u5f0f\uff0c\u76f8\u8f83\u4e8e\u5e38\u89c1\u7684\u4e8c\u7ef4\u56fe\u50cf\uff0c\u5176\u6700\u5927\u7684\u7279\u5f81\u662f\u8868\u8fbe\u4e86\u7a7a\u95f4\u4e2d\u4e09\u4e2a\u7ef4\u5ea6\uff08\u957f\u5ea6\u5bbd\u5ea6\u548c\u6df1\u5ea6\uff09\u7684\u6570\u636e\u3002 \u4e09\u7ef4\u56fe\u50cf\u7684\u8868\u73b0\u5f62\u5f0f\uff1a\u6df1\u5ea6\u56fe\uff08\u4ee5\u7070\u5ea6\u8868\u8fbe\u7269\u4f53\u4e0e\u76f8\u673a\u7684\u8ddd\u79bb\uff09\uff0c\u51e0\u4f55\u6a21\u578b\uff08\u7531 CAD \u8f6f\u4ef6\u5efa\u7acb\uff09\uff0c\u70b9\u4e91\u6a21\u578b\uff08\u6240\u6709\u9006\u5411\u5de5\u7a0b\u8bbe\u5907\u90fd\u5c06\u7269\u4f53\u91c7\u6837\u6210\u70b9\u4e91\uff09\u3002 \u70b9\u4e91\u6839\u636e\u6d4b\u91cf\u539f\u7406\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd \u6839\u636e\u6fc0\u5149\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002\u5f3a\u5ea6\u4fe1\u606f\u4e0e\u76ee\u6807\u7684\u8868\u9762\u6750\u8d28\u3001\u7c97\u7cd9\u5ea6\u3001\u5165\u5c04\u89d2\u65b9\u5411\uff0c\u4ee5\u53ca\u4eea\u5668\u7684\u53d1\u5c04\u80fd\u91cf\uff0c\u6fc0\u5149\u6ce2\u957f\u6709\u5173\u3002 \u6839\u636e\u6444\u5f71\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u989c\u8272\u4fe1\u606f RGB\u3002 \u8fd8\u6709\u6fc0\u5149\u548c\u6444\u5f71\u76f8\u7ed3\u5408\u5728\u4e00\u8d77\u7684\u591a\u4f20\u611f\u5668\u878d\u5408\u6280\u672f\uff0c\u8fd9\u79cd\u5f97\u5230\u7684\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ\u3001\u989c\u8272\u4fe1\u606f RGB \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002 \u70b9\u4e91\u7684\u83b7\u53d6\u8bbe\u5907\uff08\u53ea\u9488\u5bf9\u6444\u5f71\uff09\uff1aRGBD\u8bbe\u5907\uff08\u6df1\u5ea6\u6444\u50cf\u673a\uff09\u3002 \u70b9\u4e91\u7684\u5c5e\u6027\uff1a\u7a7a\u95f4\u5206\u8fa8\u7387\u3001\u70b9\u4e91\u7cbe\u5ea6\u3001\u8868\u9762\u6cd5\u5411\u91cf\u7b49\u3002 \u70b9\u4e91\u5b58\u50a8\u683c\u5f0f .pts; .asc; .dat; .stl; .imw; .xyz; .las; \u70b9\u4e91\u7684\u6570\u636e\u7c7b\u578b\uff08\u4ee5 PCL \u5e93\u4e3a\u4f8b\uff09\uff1a pcl::PointXYZ \uff1afloat x, y, z; \u8868\u793a\u4e86 xyz3D \u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7 points[i].data[0] \u6216 points[i].x \u8bbf\u95ee x \u5750\u6807\u503c\u3002 pcl::PointXYZI \uff1afloat x, y, z, intensity; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a\u5f3a\u5ea6\u4fe1\u606f\u7684\u7c7b\u578b\u3002 pcl::PointXYZRGB \uff1afloat x, y, z, rgb; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGB \u4fe1\u606f\uff0cRGB \u5b58\u50a8\u4e3a\u4e00\u4e2a float\u3002 pcl::PointXYZRGBA \uff1afloat x, y, z; uint32_t rgba; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGBA \u4fe1\u606f\uff0cRGBA \u7528 32bit \u7684 int \u578b\u5b58\u50a8\u7684\u3002 pcl::PointXY \uff1afloat x, y; \u8868\u793a\u4e86 XY \u4fe1\u606f\u3002 pcl::Normal \uff1a\u8868\u793a\u7ed9\u5b9a\u70b9\u6240\u5728\u6837\u672c\u66f2\u9762\u4e0a\u7684\u6cd5\u7ebf\u65b9\u5411\uff0c\u4ee5\u53ca\u5bf9\u5e94\u66f2\u7387\u7684\u6d4b\u91cf\u503c\uff0c\u7528\u7b2c\u56db\u4e2a\u5143\u7d20\u6765\u5360\u4f4d\uff0c\u517c\u5bb9 SSE \u548c\u9ad8\u6548\u8ba1\u7b97 \u70b9\u4e91\u5904\u7406 \u00b6 \u56fe\u50cf\u5904\u7406\u7684\u4e09\u4e2a\u5c42\u6b21 \u4f4e\u5c42\u6b21\uff1a\u56fe\u50cf\u5f3a\u5316\uff0c\u6ee4\u6ce2\uff0c\u5173\u952e\u70b9/\u8fb9\u7f18\u68c0\u6d4b\u7b49\u57fa\u672c\u64cd\u4f5c \u4e2d\u5c42\u6b21\uff1a\u8fde\u901a\u57df\u6807\u8bb0\uff0c\u56fe\u50cf\u5206\u5272\u7b49\u64cd\u4f5c \u9ad8\u5c42\u6b21\uff1a\u7269\u4f53\u8bc6\u522b\uff0c\u573a\u666f\u5206\u6790\u7b49\u64cd\u4f5c PCL \u5bf9\u70b9\u4e91\u5904\u7406\u65b9\u6cd5\u7ed9\u51fa\u8f83\u4e3a\u660e\u6670\u7684\u5c42\u6b21\u5212\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u4f4e\u5c42\u6b21\u5904\u7406\u65b9\u6cd5 \u00b6 \u6ee4\u6ce2\u65b9\u6cd5\uff1a\u53cc\u8fb9\u6ee4\u6ce2\u3001\u9ad8\u65af\u6ee4\u6ce2\u3001\u6761\u4ef6\u6ee4\u6ce2\u3001\u76f4\u901a\u6ee4\u6ce2\u3001\u968f\u673a\u91c7\u6837\u4e00\u81f4\u6027\u6ee4\u6ce2 \u5173\u952e\u70b9\uff1aISS3D\u3001Harris3D\u3001NARF\u3001SIFT3D \u4e2d\u5c42\u6b21\u5904\u7406\u65b9\u6cd5 \u00b6 \u7279\u5f81\u63cf\u8ff0\uff1a\u6cd5\u7ebf\u548c\u66f2\u7387\u7684\u8ba1\u7b97\u3001\u7279\u5f81\u503c\u5206\u6790\u3001SHOT\u3001PFH\u3001FPFH\u30013D Shape Context\u3001Spin Image \u5206\u5272\u4e0e\u5206\u7c7b\uff1a \u5206\u5272\uff1a\u533a\u57df\u751f\u957f\u3001Ransac \u7ebf\u9762\u63d0\u53d6\u3001\u5168\u5c40\u4f18\u5316\u5e73\u9762\u63d0\u53d6\u3001K-Means\u3001Normalize Cut \uff08Context based\uff09\u30013D Hough Transform\uff08\u7ebf\u3001\u9762\u63d0\u53d6\uff09\u3001\u8fde\u901a\u5206\u6790 \u5206\u7c7b\uff1a\u57fa\u4e8e\u70b9\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u5206\u5272\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u7c7b\uff08PointNet\u3001OctNet\uff09 \u9ad8\u5c42\u6b21\u5904\u7406\u65b9\u6cd5 \u00b6 \u914d\u51c6\uff1a\u70b9\u4e91\u914d\u51c6\u5206\u4e3a\u7c97\u914d\u51c6\uff08Coarse Registration\uff09\u548c\u7cbe\u914d\u51c6\uff08Fine Registration\uff09\u4e24\u4e2a\u9636\u6bb5\u3002 \u7c97\u914d\u51c6 \u662f\u6307\u5728\u70b9\u4e91\u76f8\u5bf9\u4f4d\u59ff\u5b8c\u5168\u4f4d\u7f6e\u7684\u60c5\u51b5\u4e0b\u5bf9\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u53ef\u4ee5\u4e3a\u7cbe\u914d\u51c6\u63d0\u4f9b\u826f\u597d\u7684\u521d\u59cb\u503c\u3002\u5f53\u524d\u8f83\u4e3a\u666e\u904d\u7684\u70b9\u4e91\u81ea\u52a8\u7c97\u914d\u51c6\u7b97\u6cd5\u5305\u62ec\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5\u548c\u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \u57fa\u4e8e\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u904d\u5386\u6574\u4e2a\u53d8\u6362\u7a7a\u95f4\u4ee5\u9009\u53d6\u4f7f\u8bef\u5dee\u51fd\u6570\u6700\u5c0f\u5316\u7684\u53d8\u6362\u5173\u7cfb\u6216\u8005\u5217\u4e3e\u51fa\u4f7f\u6700\u591a\u70b9\u5bf9\u6ee1\u8db3\u7684\u53d8\u6362\u5173\u7cfb\u3002\u5982 RANSAC \u914d\u51c6\u7b97\u6cd5\u3001\u56db\u70b9\u4e00\u81f4\u96c6\u914d\u51c6\u7b97\u6cd5\uff084-Point Congruent Set\uff0c4PCS\uff09\u3001Super4PCS \u7b97\u6cd5\u7b49 \u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u901a\u8fc7\u88ab\u6d4b\u7269\u4f53\u672c\u8eab\u6240\u5177\u5907\u7684\u5f62\u6001\u7279\u6027\u6784\u5efa\u70b9\u4e91\u95f4\u7684\u5339\u914d\u5bf9\u5e94\uff0c\u7136\u540e\u91c7\u7528\u76f8\u5173\u7b97\u6cd5\u5bf9\u53d8\u6362\u5173\u7cfb\u8fdb\u884c\u4f30\u8ba1\u3002\u5982\u57fa\u4e8e\u70b9 FPFH \u7279\u5f81\u7684 SAC-IA\u3001FGR \u7b49\u7b97\u6cd5\u3001\u57fa\u4e8e\u70b9 SHOT \u7279\u5f81\u7684 AO \u7b97\u6cd5\u4ee5\u53ca\u57fa\u4e8e\u7ebf\u7279\u5f81\u7684 ICL \u7b49 \u7cbe\u914d\u51c6 \u7684\u76ee\u7684\u662f\u5728\u7c97\u914d\u51c6\u7684\u57fa\u7840\u4e0a\u8ba9\u70b9\u4e91\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u5dee\u522b\u6700\u5c0f\u5316\u3002\u5e94\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u7cbe\u914d\u51c6\u7b97\u6cd5\u5e94\u8be5\u662f ICP \u4ee5\u53ca ICP \u7684\u5404\u79cd\u53d8\u79cd\uff08\u7a33\u5065 ICP\u3001point to plane ICP\u3001Point to line ICP\u3001MBICP\u3001GICP\u3001NICP\uff09 SLAM \u56fe\u4f18\u5316 Ceres\u3001g2o\u3001LUM\u3001ELCH\u3001Toro\u3001SPA SLAM \u65b9\u6cd5\uff1aICP\u3001MBICP\u3001IDC\u3001likehood Field\u3001NDT \u4e09\u7ef4\u91cd\u5efa \u67cf\u677e\u91cd\u5efa\u3001Delaunay triangulations\u3001\u8868\u9762\u91cd\u5efa\u3001\u4eba\u4f53\u91cd\u5efa\u3001\u5efa\u7b51\u7269\u91cd\u5efa\u3001\u6811\u6728\u91cd\u5efa \u7ed3\u6784\u5316\u91cd\u5efa\uff1a\u4e0d\u662f\u7b80\u5355\u7684\u6784\u5efa\u4e00\u4e2a Mesh \u7f51\u683c\uff0c\u800c\u662f\u4e3a\u573a\u666f\u8fdb\u884c\u5206\u5272\uff0c\u4e3a\u573a\u666f\u7ed3\u6784\u8d4b\u4e88\u8bed\u4e49\u4fe1\u606f\u3002\u573a\u666f\u7ed3\u6784\u6709\u5c42\u6b21\u4e4b\u5206\uff0c\u5728\u51e0\u4f55\u5c42\u6b21\u5c31\u662f\u70b9\u7ebf\u9762 \u5b9e\u65f6\u91cd\u5efa\uff1a\u91cd\u5efa\u690d\u88ab\u6216\u8005\u519c\u4f5c\u7269\u7684 4D\uff083D+\u65f6\u95f4\uff09\u751f\u957f\u6001\u52bf\uff1b\u4eba\u4f53\u59ff\u6001\u8bc6\u522b\uff1b\u8868\u60c5\u8bc6\u522b \u70b9\u4e91\u6570\u636e\u7ba1\u7406\uff1a\u70b9\u4e91\u538b\u7f29\uff0c\u70b9\u4e91\u7d22\u5f15\uff08KD\u3001Octree\uff09\uff0c\u70b9\u4e91 LOD\uff08\u91d1\u5b57\u5854\uff09\uff0c\u6d77\u91cf\u70b9\u4e91\u7684\u6e32\u67d3 \u70b9\u4e91\u914d\u51c6 \u00b6 \u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\uff0c\u53c8\u540d\u70b9\u4e91\u62fc\u63a5\u3001\u70b9\u4e91\u6ce8\u518c\uff0c\u5bf9\u4e8e\u4e24\u5e27\u6709\u91cd\u53e0\u4fe1\u606f\u7684\u70b9\u4e91\uff0c\u901a\u8fc7\u6c42\u89e3\u53d8\u6362\u77e9\u9635\uff08\u65cb\u8f6c\u77e9\u9635 R \u548c\u5e73\u79fb\u77e9\u9635 T\uff09\uff0c\u4f7f\u5f97\u91cd\u53e0\u90e8\u5206\u70b9\u4e91\u53d8\u6362\u5230\u540c\u4e00\u4e2a\u7edf\u4e00\u7684\u5750\u6807\u7cfb\u4e0b\u3002 \u524d\u671f\u4ee5\u4f20\u7edf\u65b9\u6cd5\u4e3a\u4e3b\uff0c2018 \u5e74\u53ca\u4ee5\u540e\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u65b9\u6cd5\u5c45\u4e0a\u3002 \u70b9\u4e91\u914d\u51c6\u53ef\u4ee5\u57fa\u4e8e\u4ee5\u4e0b 5 \u4e2a\u65b9\u9762\u5b66\u4e60\u548c\u8fdb\u9636\uff1a ICP \u7b97\u6cd5 \uff1a\u70b9\u4e91\u914d\u51c6\u9886\u57df\u6700\u4e3a\u7ecf\u5178\u7684\u7b97\u6cd5\uff0c Least-squares fitting of two 3-D point sets \uff0c\u8bc1\u660e\u4e86\u5982\u4f55\u5728\u5df2\u77e5\u70b9\u5bf9\u7684\u5173\u7cfb\u65f6\u7528 SVD \u6c42\u89e3\u53d8\u6362\u77e9\u9635\u3002 PFH \u548c FPFH \u7279\u5f81\u548c\u57fa\u4e8e RANSAC \u7684\u914d\u51c6\u7b97\u6cd5 \uff1aICP \u7b97\u6cd5\u7684\u7f3a\u70b9\u5f88\u660e\u663e\uff0c\u5bfb\u627e\u70b9\u5bf9\u5e94\u5173\u7cfb\u65f6\u662f\u57fa\u4e8e\u8ddd\u79bb\u7684\uff0c\u5f53\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\u65f6\uff0cICP \u7b97\u6cd5\u57fa\u672c\u5931\u6548\u3002\u57fa\u4e8e\u7279\u5f81 + RANSAC \u7684\u7b97\u6cd5\u6b64\u65f6\u53d1\u6325\u4f18\u52bf\uff0c\u5b83\u901a\u8fc7\u70b9\u7684\u7279\u5f81\u5bfb\u627e\u5bf9\u5e94\u70b9\u5bf9\uff0c\u53ea\u8981\u70b9\u7684\u7279\u5f81\u8868\u8fbe\u80fd\u529b\u591f\u5f3a\uff0c\u5373\u4f7f\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\uff0c\u4e5f\u53ef\u4ee5\u627e\u5230\u6b63\u786e\u7684\u70b9\u5bf9\u5e94\u5173\u7cfb\uff0c\u4ece\u800c\u5b9e\u73b0\u70b9\u4e91\u914d\u51c6\uff1b\u4f46\u70b9\u7684\u7279\u5f81\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u662f\u4e0d\u9c81\u68d2\u7684\uff0c\u6240\u4ee5\u7ed3\u5408 RANSAC \u7b97\u6cd5\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u7279\u5f81\u63cf\u8ff0\u5b50\u5efa\u8bae\u67e5\u770b FPFH\uff0c\u5bf9\u5e94\u8bba\u6587\u4e3a Fast point feature histograms (FPFH) for 3D registration (ICRA 2009) \u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u6700\u8fd1\u4e24\u4e09\u5e74\u7684\u65f6\u95f4\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u6a21\u578b\u51fa\u73b0\u5f88\u591a\uff0c\u5305\u62ec\u57fa\u4e8e global features-based \u548c correspongence-based\uff0c\u4e24\u79cd\u6a21\u5f0f\u3002Global features-based \u65b9\u6cd5\u5305\u62ec PointNetLK: Point Cloud Registration using PointNet (CVPR2019) \u548c PCRNet: Point Cloud Registration Network using PointNet Encoding (arXiv2019) \u3002 \u8fd9\u91cc\u53ef\u4ee5\u4f18\u5148\u770b PCRNet, \u56e0\u4e3a\u5176\u7b97\u6cd5\u548c\u5b9e\u73b0\u8f83\u4e3a\u7b80\u5355, \u5bb9\u6613 follow\u3002Correspondence-based \u65b9\u6cd5\u7684\u5178\u578b\u4ee3\u8868\u5305\u62ec DCP (ICCV2019) , PRNet (NeurIPS) \u548c RPMNet (CVPR2020) . \u8fd9\u4e9b\u65b9\u6cd5\u90fd\u662f\u5f00\u6e90\u7684, \u9664\u4e86 PRNet \u7684\u4ee3\u7801\u5728\u8bad\u7ec3\u65f6\u5bb9\u6613\u5d29\u6e83\u5916\uff0c\u5176\u5b83\u7684\u4ee3\u7801\u90fd\u662f\u4e0d\u9519\u7684\u3002 \u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b\u5927\u591a\u53ea\u5728 ModelNet40 \u4e0a\u662f\u6709\u6548\u7684\uff0c\u9762\u5bf9\u771f\u5b9e\u7684\u6570\u636e\u96c6\u5982 3DMatch \u548c KITTI \u65f6\u5219\u6548\u679c\u8868\u73b0\u4e0d\u597d\u3002\u4e00\u90e8\u5206\u539f\u56e0\u662f\u771f\u5b9e\u6570\u636e\u96c6\u8f83\u4e3a\u590d\u6742\uff0c\u53e6\u4e00\u90e8\u5206\u539f\u56e0\u662f\u7f51\u7edc\u7ed3\u6784\u4e0d\u8db3\u4ee5\u51c6\u786e\u5b66\u4e60\u5927\u90e8\u5206\u70b9\u7684\u7279\u5f81\u3002\u7531\u6b64\u5c31\u4f1a\u5bfc\u81f4 Inlier ratio \u8f83\u4f4e\uff0c\u7aef\u5230\u7aef\u7684\u914d\u51c6\u7f51\u7edc\u4e0d\u80fd\u53d1\u6325\u5f88\u597d\u7684\u6548\u679c\u3002\u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u4e3b\u8981\u4ee3\u8868\u5305\u62ec FCGF (ICCV 2019) , D3Feat (CVPR2020) \u548c PREDATOR (CVPR2021) . Open3D\u7684\u4f7f\u7528 \uff1a\u6700\u540e\u4f46\u4e5f\u662f\u5f88\u91cd\u8981\u7684\u4e00\u73af\uff0c\u4e00\u4e2a\u9ad8\u6548\u5904\u7406\u70b9\u4e91\u7684\u5de5\u5177\uff0c\u63a8\u8350 Open3D \u3002Open3D \u63d0\u4f9b\u4e86 4 \u4e2a\u548c\u914d\u51c6\u6709\u5173\u7684\u51fd\u6570\uff0c\u5305\u62ec ICP \u53ca\u5176\u53d8\u79cd\uff0c\u57fa\u4e8e RANSAC \u7684\u7b97\u6cd5\u548c FGR \u7b97\u6cd5\u7b49\u3002","title":"\u524d\u7f6e\u77e5\u8bc6"},{"location":"cv/pcd/pcr/prepare/#_1","text":"\u7ea6 2032 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u70b9\u4e91\u914d\u51c6\u57fa\u7840\u77e5\u8bc6\uff0c\u4e3b\u8981\u4e3a\u70b9\u4e91\u57fa\u7840\u3001\u5904\u7406\u65b9\u6cd5\u548c\u70b9\u4e91\u914d\u51c6\u65b9\u6cd5\u7684\u4ecb\u7ecd\u548c\u6bd4\u8f83\u7b49","title":"\u524d\u7f6e\u77e5\u8bc6"},{"location":"cv/pcd/pcr/prepare/#_2","text":"\u70b9\u4e91\u6982\u5ff5\uff1a\u70b9\u4e91\u662f\u540c\u4e00\u7a7a\u95f4\u53c2\u8003\u7cfb\u4e0b\u8868\u8fbe\u76ee\u6807\u7a7a\u95f4\u5206\u5e03\u548c\u76ee\u6807\u8868\u9762\u7279\u6027\u7684\u6d77\u91cf\u70b9\u96c6\u5408\uff0c\u5728\u83b7\u53d6\u7269\u4f53\u8868\u9762\u6bcf\u4e2a\u91c7\u6837\u70b9\u7684\u7a7a\u95f4\u5750\u6807\u540e\uff0c\u5f97\u5230\u7684\u662f\u70b9\u7684\u96c6\u5408\uff0c\u79f0\u4e4b\u4e3a\u201c\u70b9\u4e91\u201d\uff08Point Cloud\uff09\u3002 \u70b9\u4e91\u56fe\u50cf\u662f\u6700\u57fa\u7840\u4e5f\u662f\u6700\u5e38\u89c1\u7684\u4e09\u7ef4\u56fe\u50cf\uff1a\u4e09\u7ef4\u56fe\u50cf\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u56fe\u50cf\u4fe1\u606f\u8868\u8fbe\u5f62\u5f0f\uff0c\u76f8\u8f83\u4e8e\u5e38\u89c1\u7684\u4e8c\u7ef4\u56fe\u50cf\uff0c\u5176\u6700\u5927\u7684\u7279\u5f81\u662f\u8868\u8fbe\u4e86\u7a7a\u95f4\u4e2d\u4e09\u4e2a\u7ef4\u5ea6\uff08\u957f\u5ea6\u5bbd\u5ea6\u548c\u6df1\u5ea6\uff09\u7684\u6570\u636e\u3002 \u4e09\u7ef4\u56fe\u50cf\u7684\u8868\u73b0\u5f62\u5f0f\uff1a\u6df1\u5ea6\u56fe\uff08\u4ee5\u7070\u5ea6\u8868\u8fbe\u7269\u4f53\u4e0e\u76f8\u673a\u7684\u8ddd\u79bb\uff09\uff0c\u51e0\u4f55\u6a21\u578b\uff08\u7531 CAD \u8f6f\u4ef6\u5efa\u7acb\uff09\uff0c\u70b9\u4e91\u6a21\u578b\uff08\u6240\u6709\u9006\u5411\u5de5\u7a0b\u8bbe\u5907\u90fd\u5c06\u7269\u4f53\u91c7\u6837\u6210\u70b9\u4e91\uff09\u3002 \u70b9\u4e91\u6839\u636e\u6d4b\u91cf\u539f\u7406\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd \u6839\u636e\u6fc0\u5149\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002\u5f3a\u5ea6\u4fe1\u606f\u4e0e\u76ee\u6807\u7684\u8868\u9762\u6750\u8d28\u3001\u7c97\u7cd9\u5ea6\u3001\u5165\u5c04\u89d2\u65b9\u5411\uff0c\u4ee5\u53ca\u4eea\u5668\u7684\u53d1\u5c04\u80fd\u91cf\uff0c\u6fc0\u5149\u6ce2\u957f\u6709\u5173\u3002 \u6839\u636e\u6444\u5f71\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u989c\u8272\u4fe1\u606f RGB\u3002 \u8fd8\u6709\u6fc0\u5149\u548c\u6444\u5f71\u76f8\u7ed3\u5408\u5728\u4e00\u8d77\u7684\u591a\u4f20\u611f\u5668\u878d\u5408\u6280\u672f\uff0c\u8fd9\u79cd\u5f97\u5230\u7684\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ\u3001\u989c\u8272\u4fe1\u606f RGB \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002 \u70b9\u4e91\u7684\u83b7\u53d6\u8bbe\u5907\uff08\u53ea\u9488\u5bf9\u6444\u5f71\uff09\uff1aRGBD\u8bbe\u5907\uff08\u6df1\u5ea6\u6444\u50cf\u673a\uff09\u3002 \u70b9\u4e91\u7684\u5c5e\u6027\uff1a\u7a7a\u95f4\u5206\u8fa8\u7387\u3001\u70b9\u4e91\u7cbe\u5ea6\u3001\u8868\u9762\u6cd5\u5411\u91cf\u7b49\u3002 \u70b9\u4e91\u5b58\u50a8\u683c\u5f0f .pts; .asc; .dat; .stl; .imw; .xyz; .las; \u70b9\u4e91\u7684\u6570\u636e\u7c7b\u578b\uff08\u4ee5 PCL \u5e93\u4e3a\u4f8b\uff09\uff1a pcl::PointXYZ \uff1afloat x, y, z; \u8868\u793a\u4e86 xyz3D \u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7 points[i].data[0] \u6216 points[i].x \u8bbf\u95ee x \u5750\u6807\u503c\u3002 pcl::PointXYZI \uff1afloat x, y, z, intensity; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a\u5f3a\u5ea6\u4fe1\u606f\u7684\u7c7b\u578b\u3002 pcl::PointXYZRGB \uff1afloat x, y, z, rgb; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGB \u4fe1\u606f\uff0cRGB \u5b58\u50a8\u4e3a\u4e00\u4e2a float\u3002 pcl::PointXYZRGBA \uff1afloat x, y, z; uint32_t rgba; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGBA \u4fe1\u606f\uff0cRGBA \u7528 32bit \u7684 int \u578b\u5b58\u50a8\u7684\u3002 pcl::PointXY \uff1afloat x, y; \u8868\u793a\u4e86 XY \u4fe1\u606f\u3002 pcl::Normal \uff1a\u8868\u793a\u7ed9\u5b9a\u70b9\u6240\u5728\u6837\u672c\u66f2\u9762\u4e0a\u7684\u6cd5\u7ebf\u65b9\u5411\uff0c\u4ee5\u53ca\u5bf9\u5e94\u66f2\u7387\u7684\u6d4b\u91cf\u503c\uff0c\u7528\u7b2c\u56db\u4e2a\u5143\u7d20\u6765\u5360\u4f4d\uff0c\u517c\u5bb9 SSE \u548c\u9ad8\u6548\u8ba1\u7b97","title":"\u70b9\u4e91\u57fa\u7840"},{"location":"cv/pcd/pcr/prepare/#_3","text":"\u56fe\u50cf\u5904\u7406\u7684\u4e09\u4e2a\u5c42\u6b21 \u4f4e\u5c42\u6b21\uff1a\u56fe\u50cf\u5f3a\u5316\uff0c\u6ee4\u6ce2\uff0c\u5173\u952e\u70b9/\u8fb9\u7f18\u68c0\u6d4b\u7b49\u57fa\u672c\u64cd\u4f5c \u4e2d\u5c42\u6b21\uff1a\u8fde\u901a\u57df\u6807\u8bb0\uff0c\u56fe\u50cf\u5206\u5272\u7b49\u64cd\u4f5c \u9ad8\u5c42\u6b21\uff1a\u7269\u4f53\u8bc6\u522b\uff0c\u573a\u666f\u5206\u6790\u7b49\u64cd\u4f5c PCL \u5bf9\u70b9\u4e91\u5904\u7406\u65b9\u6cd5\u7ed9\u51fa\u8f83\u4e3a\u660e\u6670\u7684\u5c42\u6b21\u5212\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a","title":"\u70b9\u4e91\u5904\u7406"},{"location":"cv/pcd/pcr/prepare/#_4","text":"\u6ee4\u6ce2\u65b9\u6cd5\uff1a\u53cc\u8fb9\u6ee4\u6ce2\u3001\u9ad8\u65af\u6ee4\u6ce2\u3001\u6761\u4ef6\u6ee4\u6ce2\u3001\u76f4\u901a\u6ee4\u6ce2\u3001\u968f\u673a\u91c7\u6837\u4e00\u81f4\u6027\u6ee4\u6ce2 \u5173\u952e\u70b9\uff1aISS3D\u3001Harris3D\u3001NARF\u3001SIFT3D","title":"\u4f4e\u5c42\u6b21\u5904\u7406\u65b9\u6cd5"},{"location":"cv/pcd/pcr/prepare/#_5","text":"\u7279\u5f81\u63cf\u8ff0\uff1a\u6cd5\u7ebf\u548c\u66f2\u7387\u7684\u8ba1\u7b97\u3001\u7279\u5f81\u503c\u5206\u6790\u3001SHOT\u3001PFH\u3001FPFH\u30013D Shape Context\u3001Spin Image \u5206\u5272\u4e0e\u5206\u7c7b\uff1a \u5206\u5272\uff1a\u533a\u57df\u751f\u957f\u3001Ransac \u7ebf\u9762\u63d0\u53d6\u3001\u5168\u5c40\u4f18\u5316\u5e73\u9762\u63d0\u53d6\u3001K-Means\u3001Normalize Cut \uff08Context based\uff09\u30013D Hough Transform\uff08\u7ebf\u3001\u9762\u63d0\u53d6\uff09\u3001\u8fde\u901a\u5206\u6790 \u5206\u7c7b\uff1a\u57fa\u4e8e\u70b9\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u5206\u5272\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u7c7b\uff08PointNet\u3001OctNet\uff09","title":"\u4e2d\u5c42\u6b21\u5904\u7406\u65b9\u6cd5"},{"location":"cv/pcd/pcr/prepare/#_6","text":"\u914d\u51c6\uff1a\u70b9\u4e91\u914d\u51c6\u5206\u4e3a\u7c97\u914d\u51c6\uff08Coarse Registration\uff09\u548c\u7cbe\u914d\u51c6\uff08Fine Registration\uff09\u4e24\u4e2a\u9636\u6bb5\u3002 \u7c97\u914d\u51c6 \u662f\u6307\u5728\u70b9\u4e91\u76f8\u5bf9\u4f4d\u59ff\u5b8c\u5168\u4f4d\u7f6e\u7684\u60c5\u51b5\u4e0b\u5bf9\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u53ef\u4ee5\u4e3a\u7cbe\u914d\u51c6\u63d0\u4f9b\u826f\u597d\u7684\u521d\u59cb\u503c\u3002\u5f53\u524d\u8f83\u4e3a\u666e\u904d\u7684\u70b9\u4e91\u81ea\u52a8\u7c97\u914d\u51c6\u7b97\u6cd5\u5305\u62ec\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5\u548c\u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \u57fa\u4e8e\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u904d\u5386\u6574\u4e2a\u53d8\u6362\u7a7a\u95f4\u4ee5\u9009\u53d6\u4f7f\u8bef\u5dee\u51fd\u6570\u6700\u5c0f\u5316\u7684\u53d8\u6362\u5173\u7cfb\u6216\u8005\u5217\u4e3e\u51fa\u4f7f\u6700\u591a\u70b9\u5bf9\u6ee1\u8db3\u7684\u53d8\u6362\u5173\u7cfb\u3002\u5982 RANSAC \u914d\u51c6\u7b97\u6cd5\u3001\u56db\u70b9\u4e00\u81f4\u96c6\u914d\u51c6\u7b97\u6cd5\uff084-Point Congruent Set\uff0c4PCS\uff09\u3001Super4PCS \u7b97\u6cd5\u7b49 \u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u901a\u8fc7\u88ab\u6d4b\u7269\u4f53\u672c\u8eab\u6240\u5177\u5907\u7684\u5f62\u6001\u7279\u6027\u6784\u5efa\u70b9\u4e91\u95f4\u7684\u5339\u914d\u5bf9\u5e94\uff0c\u7136\u540e\u91c7\u7528\u76f8\u5173\u7b97\u6cd5\u5bf9\u53d8\u6362\u5173\u7cfb\u8fdb\u884c\u4f30\u8ba1\u3002\u5982\u57fa\u4e8e\u70b9 FPFH \u7279\u5f81\u7684 SAC-IA\u3001FGR \u7b49\u7b97\u6cd5\u3001\u57fa\u4e8e\u70b9 SHOT \u7279\u5f81\u7684 AO \u7b97\u6cd5\u4ee5\u53ca\u57fa\u4e8e\u7ebf\u7279\u5f81\u7684 ICL \u7b49 \u7cbe\u914d\u51c6 \u7684\u76ee\u7684\u662f\u5728\u7c97\u914d\u51c6\u7684\u57fa\u7840\u4e0a\u8ba9\u70b9\u4e91\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u5dee\u522b\u6700\u5c0f\u5316\u3002\u5e94\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u7cbe\u914d\u51c6\u7b97\u6cd5\u5e94\u8be5\u662f ICP \u4ee5\u53ca ICP \u7684\u5404\u79cd\u53d8\u79cd\uff08\u7a33\u5065 ICP\u3001point to plane ICP\u3001Point to line ICP\u3001MBICP\u3001GICP\u3001NICP\uff09 SLAM \u56fe\u4f18\u5316 Ceres\u3001g2o\u3001LUM\u3001ELCH\u3001Toro\u3001SPA SLAM \u65b9\u6cd5\uff1aICP\u3001MBICP\u3001IDC\u3001likehood Field\u3001NDT \u4e09\u7ef4\u91cd\u5efa \u67cf\u677e\u91cd\u5efa\u3001Delaunay triangulations\u3001\u8868\u9762\u91cd\u5efa\u3001\u4eba\u4f53\u91cd\u5efa\u3001\u5efa\u7b51\u7269\u91cd\u5efa\u3001\u6811\u6728\u91cd\u5efa \u7ed3\u6784\u5316\u91cd\u5efa\uff1a\u4e0d\u662f\u7b80\u5355\u7684\u6784\u5efa\u4e00\u4e2a Mesh \u7f51\u683c\uff0c\u800c\u662f\u4e3a\u573a\u666f\u8fdb\u884c\u5206\u5272\uff0c\u4e3a\u573a\u666f\u7ed3\u6784\u8d4b\u4e88\u8bed\u4e49\u4fe1\u606f\u3002\u573a\u666f\u7ed3\u6784\u6709\u5c42\u6b21\u4e4b\u5206\uff0c\u5728\u51e0\u4f55\u5c42\u6b21\u5c31\u662f\u70b9\u7ebf\u9762 \u5b9e\u65f6\u91cd\u5efa\uff1a\u91cd\u5efa\u690d\u88ab\u6216\u8005\u519c\u4f5c\u7269\u7684 4D\uff083D+\u65f6\u95f4\uff09\u751f\u957f\u6001\u52bf\uff1b\u4eba\u4f53\u59ff\u6001\u8bc6\u522b\uff1b\u8868\u60c5\u8bc6\u522b \u70b9\u4e91\u6570\u636e\u7ba1\u7406\uff1a\u70b9\u4e91\u538b\u7f29\uff0c\u70b9\u4e91\u7d22\u5f15\uff08KD\u3001Octree\uff09\uff0c\u70b9\u4e91 LOD\uff08\u91d1\u5b57\u5854\uff09\uff0c\u6d77\u91cf\u70b9\u4e91\u7684\u6e32\u67d3","title":"\u9ad8\u5c42\u6b21\u5904\u7406\u65b9\u6cd5"},{"location":"cv/pcd/pcr/prepare/#_7","text":"\u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\uff0c\u53c8\u540d\u70b9\u4e91\u62fc\u63a5\u3001\u70b9\u4e91\u6ce8\u518c\uff0c\u5bf9\u4e8e\u4e24\u5e27\u6709\u91cd\u53e0\u4fe1\u606f\u7684\u70b9\u4e91\uff0c\u901a\u8fc7\u6c42\u89e3\u53d8\u6362\u77e9\u9635\uff08\u65cb\u8f6c\u77e9\u9635 R \u548c\u5e73\u79fb\u77e9\u9635 T\uff09\uff0c\u4f7f\u5f97\u91cd\u53e0\u90e8\u5206\u70b9\u4e91\u53d8\u6362\u5230\u540c\u4e00\u4e2a\u7edf\u4e00\u7684\u5750\u6807\u7cfb\u4e0b\u3002 \u524d\u671f\u4ee5\u4f20\u7edf\u65b9\u6cd5\u4e3a\u4e3b\uff0c2018 \u5e74\u53ca\u4ee5\u540e\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u65b9\u6cd5\u5c45\u4e0a\u3002 \u70b9\u4e91\u914d\u51c6\u53ef\u4ee5\u57fa\u4e8e\u4ee5\u4e0b 5 \u4e2a\u65b9\u9762\u5b66\u4e60\u548c\u8fdb\u9636\uff1a ICP \u7b97\u6cd5 \uff1a\u70b9\u4e91\u914d\u51c6\u9886\u57df\u6700\u4e3a\u7ecf\u5178\u7684\u7b97\u6cd5\uff0c Least-squares fitting of two 3-D point sets \uff0c\u8bc1\u660e\u4e86\u5982\u4f55\u5728\u5df2\u77e5\u70b9\u5bf9\u7684\u5173\u7cfb\u65f6\u7528 SVD \u6c42\u89e3\u53d8\u6362\u77e9\u9635\u3002 PFH \u548c FPFH \u7279\u5f81\u548c\u57fa\u4e8e RANSAC \u7684\u914d\u51c6\u7b97\u6cd5 \uff1aICP \u7b97\u6cd5\u7684\u7f3a\u70b9\u5f88\u660e\u663e\uff0c\u5bfb\u627e\u70b9\u5bf9\u5e94\u5173\u7cfb\u65f6\u662f\u57fa\u4e8e\u8ddd\u79bb\u7684\uff0c\u5f53\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\u65f6\uff0cICP \u7b97\u6cd5\u57fa\u672c\u5931\u6548\u3002\u57fa\u4e8e\u7279\u5f81 + RANSAC \u7684\u7b97\u6cd5\u6b64\u65f6\u53d1\u6325\u4f18\u52bf\uff0c\u5b83\u901a\u8fc7\u70b9\u7684\u7279\u5f81\u5bfb\u627e\u5bf9\u5e94\u70b9\u5bf9\uff0c\u53ea\u8981\u70b9\u7684\u7279\u5f81\u8868\u8fbe\u80fd\u529b\u591f\u5f3a\uff0c\u5373\u4f7f\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\uff0c\u4e5f\u53ef\u4ee5\u627e\u5230\u6b63\u786e\u7684\u70b9\u5bf9\u5e94\u5173\u7cfb\uff0c\u4ece\u800c\u5b9e\u73b0\u70b9\u4e91\u914d\u51c6\uff1b\u4f46\u70b9\u7684\u7279\u5f81\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u662f\u4e0d\u9c81\u68d2\u7684\uff0c\u6240\u4ee5\u7ed3\u5408 RANSAC \u7b97\u6cd5\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u7279\u5f81\u63cf\u8ff0\u5b50\u5efa\u8bae\u67e5\u770b FPFH\uff0c\u5bf9\u5e94\u8bba\u6587\u4e3a Fast point feature histograms (FPFH) for 3D registration (ICRA 2009) \u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u6700\u8fd1\u4e24\u4e09\u5e74\u7684\u65f6\u95f4\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u6a21\u578b\u51fa\u73b0\u5f88\u591a\uff0c\u5305\u62ec\u57fa\u4e8e global features-based \u548c correspongence-based\uff0c\u4e24\u79cd\u6a21\u5f0f\u3002Global features-based \u65b9\u6cd5\u5305\u62ec PointNetLK: Point Cloud Registration using PointNet (CVPR2019) \u548c PCRNet: Point Cloud Registration Network using PointNet Encoding (arXiv2019) \u3002 \u8fd9\u91cc\u53ef\u4ee5\u4f18\u5148\u770b PCRNet, \u56e0\u4e3a\u5176\u7b97\u6cd5\u548c\u5b9e\u73b0\u8f83\u4e3a\u7b80\u5355, \u5bb9\u6613 follow\u3002Correspondence-based \u65b9\u6cd5\u7684\u5178\u578b\u4ee3\u8868\u5305\u62ec DCP (ICCV2019) , PRNet (NeurIPS) \u548c RPMNet (CVPR2020) . \u8fd9\u4e9b\u65b9\u6cd5\u90fd\u662f\u5f00\u6e90\u7684, \u9664\u4e86 PRNet \u7684\u4ee3\u7801\u5728\u8bad\u7ec3\u65f6\u5bb9\u6613\u5d29\u6e83\u5916\uff0c\u5176\u5b83\u7684\u4ee3\u7801\u90fd\u662f\u4e0d\u9519\u7684\u3002 \u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b\u5927\u591a\u53ea\u5728 ModelNet40 \u4e0a\u662f\u6709\u6548\u7684\uff0c\u9762\u5bf9\u771f\u5b9e\u7684\u6570\u636e\u96c6\u5982 3DMatch \u548c KITTI \u65f6\u5219\u6548\u679c\u8868\u73b0\u4e0d\u597d\u3002\u4e00\u90e8\u5206\u539f\u56e0\u662f\u771f\u5b9e\u6570\u636e\u96c6\u8f83\u4e3a\u590d\u6742\uff0c\u53e6\u4e00\u90e8\u5206\u539f\u56e0\u662f\u7f51\u7edc\u7ed3\u6784\u4e0d\u8db3\u4ee5\u51c6\u786e\u5b66\u4e60\u5927\u90e8\u5206\u70b9\u7684\u7279\u5f81\u3002\u7531\u6b64\u5c31\u4f1a\u5bfc\u81f4 Inlier ratio \u8f83\u4f4e\uff0c\u7aef\u5230\u7aef\u7684\u914d\u51c6\u7f51\u7edc\u4e0d\u80fd\u53d1\u6325\u5f88\u597d\u7684\u6548\u679c\u3002\u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u4e3b\u8981\u4ee3\u8868\u5305\u62ec FCGF (ICCV 2019) , D3Feat (CVPR2020) \u548c PREDATOR (CVPR2021) . Open3D\u7684\u4f7f\u7528 \uff1a\u6700\u540e\u4f46\u4e5f\u662f\u5f88\u91cd\u8981\u7684\u4e00\u73af\uff0c\u4e00\u4e2a\u9ad8\u6548\u5904\u7406\u70b9\u4e91\u7684\u5de5\u5177\uff0c\u63a8\u8350 Open3D \u3002Open3D \u63d0\u4f9b\u4e86 4 \u4e2a\u548c\u914d\u51c6\u6709\u5173\u7684\u51fd\u6570\uff0c\u5305\u62ec ICP \u53ca\u5176\u53d8\u79cd\uff0c\u57fa\u4e8e RANSAC \u7684\u7b97\u6cd5\u548c FGR \u7b97\u6cd5\u7b49\u3002","title":"\u70b9\u4e91\u914d\u51c6"},{"location":"cv/utils/","text":"\u5de5\u5177 \u00b6 Abstract \u5904\u7406\u6570\u636e\u7b49\u76f8\u5173\u5de5\u5177 Table of Contents \u00b6 COLMAP","title":"\u5de5\u5177"},{"location":"cv/utils/#_1","text":"Abstract \u5904\u7406\u6570\u636e\u7b49\u76f8\u5173\u5de5\u5177","title":"\u5de5\u5177"},{"location":"cv/utils/#table-of-contents","text":"COLMAP","title":"Table of Contents"},{"location":"cv/utils/colmap/","text":"COLMAP \u00b6 \u7ea6 475 \u4e2a\u5b57 67 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract COLMAP \u662f\u4e00\u79cd\u901a\u7528\u7684\u8fd0\u52a8\u7ed3\u6784(SfM) \u548c\u591a\u89c6\u56fe\u7acb\u4f53(MVS) \u7ba1\u9053\uff0c\u5177\u6709\u56fe\u5f62\u548c\u547d\u4ee4\u884c\u754c\u9762\u3002 \u4ee5\u4e0b\u7684\u5b9e\u9a8c\u73af\u5883\uff1aUbuntu 20.04\uff08\u5bbf\u4e3b\u673a \uff09\u3001Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09\u3001CUDA 11.8 Installation \u00b6 Dependencies \u00b6 sudo apt-get install \\ git \\ cmake \\ ninja-build \\ build-essential \\ libboost-program-options-dev \\ libboost-filesystem-dev \\ libboost-graph-dev \\ libboost-system-dev \\ libeigen3-dev \\ libflann-dev \\ libfreeimage-dev \\ libmetis-dev \\ libgoogle-glog-dev \\ libgtest-dev \\ libgmock-dev \\ libsqlite3-dev \\ libglew-dev \\ qtbase5-dev \\ libqt5opengl5-dev \\ libcgal-dev \\ libceres-dev \u652f\u6301 CUDA\uff08\u5bbf\u4e3b\u673a\u91cc\uff09\uff0cdocker run \u7684\u53c2\u6570\u6dfb\u52a0 --gpus sudo apt-get install -y \\ nvidia-cuda-toolkit \\ nvidia-cuda-toolkit-gcc Configure and Compile \u00b6 git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build cmake .. -GNinja ninja sudo ninja install nvcc fatal : unsupported gpu architecture \u2018compute_native\u2019 # \u5728 colmap/cmake/FindDependencies.cmake \u4e2d\u6dfb\u52a0\u4e00\u53e5 `set(CMAKE_CUDA_ARCHITECTURES \"80\")`\uff0c\u5982\u4e0b\u6240\u793a\uff1a set(CMAKE_CUDA_ARCHITECTURES \"80\") if(CUDA_ENABLED AND CUDA_FOUND) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES \"native\") endif() Experiment \u00b6 \u542f\u52a8 COLMAP colmap gui \u70b9\u51fb Reconstruction > Automatic Reconstruction \u8fdb\u884c\u4e00\u7cfb\u5217\u57fa\u672c\u8bbe\u7f6e\u540e\uff0c\u8f93\u51fa\u7684\u7ed3\u679c\u4f1a\u5199\u5728 workspace folder \u4e2d\uff08\u5982\u679c\u56fe\u50cf\u5728 path/to/project/images \u4e2d\uff0c\u90a3\u4e48\u5c31\u5e94\u8be5\u9009\u62e9 path/to/project \u4f5c\u4e3a workspace \uff09 \u8fd0\u884c Automatic Reconstruction \u540e\uff0c\u6587\u4ef6\u5939\u751f\u6210\u4e3a +\u2500\u2500 images \u2502 +\u2500\u2500 image1.jpg \u2502 +\u2500\u2500 image2.jpg \u2502 +\u2500\u2500 ... +\u2500\u2500 sparse \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 cameras.bin \u2502 \u2502 +\u2500\u2500 images.bin \u2502 \u2502 +\u2500\u2500 points3D.bin \u2502 +\u2500\u2500 ... +\u2500\u2500 dense \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 images \u2502 \u2502 +\u2500\u2500 sparse \u2502 \u2502 +\u2500\u2500 stereo \u2502 \u2502 +\u2500\u2500 fused.ply \u2502 \u2502 +\u2500\u2500 meshed-poisson.ply \u2502 \u2502 +\u2500\u2500 meshed-delaunay.ply \u2502 +\u2500\u2500 ... +\u2500\u2500 database.db \u6587\u4ef6\u5939\u4f5c\u7528 path/to/project/sparse \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a00\u758f\u6a21\u578b path/to/project/dense \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a20\u5bc6\u6a21\u578b fused.ply \uff1a\u53ef\u4ee5\u52a0\u8f7d\u5230 COLMAP \u56fe\u5f62\u754c\u9762\uff0c\u4ece File > Import model from ... \u7a20\u5bc6\u7684\u7f51\u683c\u53ea\u80fd\u7528\u5916\u90e8\u67e5\u770b\u5668\uff08 MeshLab \uff09\u53ef\u89c6\u5316 \u751f\u6210\u7684\u6587\u4ef6\u5939\u4e0d\u80fd\u76f4\u63a5\u7528\u4e8e NGP \u6216 3DGS 3DGS \u5728 3DGS \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python convert.py -s location [ --resize ] #If not resizing, ImageMagick is not needed \u5c06\u56fe\u7247\u6253\u5305\u6210\u5982\u4e0b\u518d\u6267\u884c\u811a\u672c location |---input |--- |--- |---... \u5982\u679c\u662f\u89c6\u9891\uff0c\u5148\u7528 ffmpeg \u62bd\u5e27 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg instant-NGP \u5728 instant-NGP \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python scripts \\c olmap2nerf.py --video_in [ mp4 ] --run_colmap --colmap_db data \\d ata_classroom \\c olmap.db --text data \\d ata_classroom \\t ext_colmap --aabb_scale 16 --out data \\d ata_classroom \\t ransforms.json --colmap_matcher exhaustive --video_fps 8 Picture Capture Process \u00b6 \u62cd\u6444\u7684\u56fe\u7247\u5e94\u5177\u6709\u4e30\u5bcc\u7684\u7eb9\u7406\u3002\u6700\u597d\u907f\u514d\u7eb9\u7406\u7279\u522b\u5c11\u7684\u56fe\u7247\u5982\u4e00\u5f20\u767d\u5899\u6216\u7a7a\u684c\u56fe\u7247\u3002\u901a\u8fc7\u52a0\u5165\u4e00\u4e9b\u7269\u54c1\u6765\u4e30\u5bcc\u7eb9\u7406 \u5177\u5907\u76f8\u4f3c\u7684\u5149\u7167\u60c5\u51b5\u3002\u907f\u514d high dynamic range scenes \uff08\u5982\u6709\u592a\u9633\u6709\u5f71\u5b50\uff0c\u7a7f\u8fc7\u95e8\u6216\u7a97\u62cd\u6444\uff09\u3002\u907f\u514d\u955c\u9762\u53cd\u5c04 \u5177\u6709\u9ad8\u5ea6\u89c6\u89c9\u91cd\u53e0\u7684\u56fe\u7247\u3002\u786e\u4fdd\u4e00\u4e2a\u7269\u4f53\u81f3\u5c11\u6709\u4e09\u5f20\u56fe\u7247\uff0c\u5c3d\u91cf\u591a\u4e00\u70b9 \u591a\u89c6\u56fe\u62cd\u6444\u3002\u4e0d\u8981\u901a\u8fc7\u5e73\u79fb\u65cb\u8f6c\u76f8\u673a\u6765\u4ece\u540c\u4e00\u4e2a\u65b9\u5411\u62cd\u6444\u3002\u4f46\u786e\u4fdd\u76f8\u4f3c\u89c6\u89d2\u6709\u5c11\u4e14\u7cbe\u7684\u56fe\u7247\uff0c\u5e76\u4e0d\u662f\u8d8a\u591a\u8d8a\u597d\u3002\u5982\u679c\u662f\u89c6\u9891\uff0c\u8bf7\u51cf\u5c11\u5e27\u7387\u3002 Reference \u00b6 Installation \u2014 COLMAP 3.11.0.dev0 documentation \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014Linux\u5b9e\u73b0COLMAP_linux colmap-CSDN\u535a\u5ba2 ColMap\u4f7f\u7528 | \u60a0\u95f2\u306e\u5c0f\u5c4b \u4e09\u7ef4\u91cd\u5efainstant-ngp\u73af\u5883\u90e8\u7f72\u4e0ecolmap\u3001ffmpeg\u7684\u811a\u672c\u53c2\u6570\u4f7f\u7528 - lefree - \u535a\u5ba2\u56ed","title":"COLMAP"},{"location":"cv/utils/colmap/#colmap","text":"\u7ea6 475 \u4e2a\u5b57 67 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract COLMAP \u662f\u4e00\u79cd\u901a\u7528\u7684\u8fd0\u52a8\u7ed3\u6784(SfM) \u548c\u591a\u89c6\u56fe\u7acb\u4f53(MVS) \u7ba1\u9053\uff0c\u5177\u6709\u56fe\u5f62\u548c\u547d\u4ee4\u884c\u754c\u9762\u3002 \u4ee5\u4e0b\u7684\u5b9e\u9a8c\u73af\u5883\uff1aUbuntu 20.04\uff08\u5bbf\u4e3b\u673a \uff09\u3001Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09\u3001CUDA 11.8","title":"COLMAP"},{"location":"cv/utils/colmap/#installation","text":"","title":"Installation"},{"location":"cv/utils/colmap/#dependencies","text":"sudo apt-get install \\ git \\ cmake \\ ninja-build \\ build-essential \\ libboost-program-options-dev \\ libboost-filesystem-dev \\ libboost-graph-dev \\ libboost-system-dev \\ libeigen3-dev \\ libflann-dev \\ libfreeimage-dev \\ libmetis-dev \\ libgoogle-glog-dev \\ libgtest-dev \\ libgmock-dev \\ libsqlite3-dev \\ libglew-dev \\ qtbase5-dev \\ libqt5opengl5-dev \\ libcgal-dev \\ libceres-dev \u652f\u6301 CUDA\uff08\u5bbf\u4e3b\u673a\u91cc\uff09\uff0cdocker run \u7684\u53c2\u6570\u6dfb\u52a0 --gpus sudo apt-get install -y \\ nvidia-cuda-toolkit \\ nvidia-cuda-toolkit-gcc","title":"Dependencies"},{"location":"cv/utils/colmap/#configure-and-compile","text":"git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build cmake .. -GNinja ninja sudo ninja install nvcc fatal : unsupported gpu architecture \u2018compute_native\u2019 # \u5728 colmap/cmake/FindDependencies.cmake \u4e2d\u6dfb\u52a0\u4e00\u53e5 `set(CMAKE_CUDA_ARCHITECTURES \"80\")`\uff0c\u5982\u4e0b\u6240\u793a\uff1a set(CMAKE_CUDA_ARCHITECTURES \"80\") if(CUDA_ENABLED AND CUDA_FOUND) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES \"native\") endif()","title":"Configure and Compile"},{"location":"cv/utils/colmap/#experiment","text":"\u542f\u52a8 COLMAP colmap gui \u70b9\u51fb Reconstruction > Automatic Reconstruction \u8fdb\u884c\u4e00\u7cfb\u5217\u57fa\u672c\u8bbe\u7f6e\u540e\uff0c\u8f93\u51fa\u7684\u7ed3\u679c\u4f1a\u5199\u5728 workspace folder \u4e2d\uff08\u5982\u679c\u56fe\u50cf\u5728 path/to/project/images \u4e2d\uff0c\u90a3\u4e48\u5c31\u5e94\u8be5\u9009\u62e9 path/to/project \u4f5c\u4e3a workspace \uff09 \u8fd0\u884c Automatic Reconstruction \u540e\uff0c\u6587\u4ef6\u5939\u751f\u6210\u4e3a +\u2500\u2500 images \u2502 +\u2500\u2500 image1.jpg \u2502 +\u2500\u2500 image2.jpg \u2502 +\u2500\u2500 ... +\u2500\u2500 sparse \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 cameras.bin \u2502 \u2502 +\u2500\u2500 images.bin \u2502 \u2502 +\u2500\u2500 points3D.bin \u2502 +\u2500\u2500 ... +\u2500\u2500 dense \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 images \u2502 \u2502 +\u2500\u2500 sparse \u2502 \u2502 +\u2500\u2500 stereo \u2502 \u2502 +\u2500\u2500 fused.ply \u2502 \u2502 +\u2500\u2500 meshed-poisson.ply \u2502 \u2502 +\u2500\u2500 meshed-delaunay.ply \u2502 +\u2500\u2500 ... +\u2500\u2500 database.db \u6587\u4ef6\u5939\u4f5c\u7528 path/to/project/sparse \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a00\u758f\u6a21\u578b path/to/project/dense \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a20\u5bc6\u6a21\u578b fused.ply \uff1a\u53ef\u4ee5\u52a0\u8f7d\u5230 COLMAP \u56fe\u5f62\u754c\u9762\uff0c\u4ece File > Import model from ... \u7a20\u5bc6\u7684\u7f51\u683c\u53ea\u80fd\u7528\u5916\u90e8\u67e5\u770b\u5668\uff08 MeshLab \uff09\u53ef\u89c6\u5316 \u751f\u6210\u7684\u6587\u4ef6\u5939\u4e0d\u80fd\u76f4\u63a5\u7528\u4e8e NGP \u6216 3DGS 3DGS \u5728 3DGS \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python convert.py -s location [ --resize ] #If not resizing, ImageMagick is not needed \u5c06\u56fe\u7247\u6253\u5305\u6210\u5982\u4e0b\u518d\u6267\u884c\u811a\u672c location |---input |--- |--- |---... \u5982\u679c\u662f\u89c6\u9891\uff0c\u5148\u7528 ffmpeg \u62bd\u5e27 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg instant-NGP \u5728 instant-NGP \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python scripts \\c olmap2nerf.py --video_in [ mp4 ] --run_colmap --colmap_db data \\d ata_classroom \\c olmap.db --text data \\d ata_classroom \\t ext_colmap --aabb_scale 16 --out data \\d ata_classroom \\t ransforms.json --colmap_matcher exhaustive --video_fps 8","title":"Experiment"},{"location":"cv/utils/colmap/#picture-capture-process","text":"\u62cd\u6444\u7684\u56fe\u7247\u5e94\u5177\u6709\u4e30\u5bcc\u7684\u7eb9\u7406\u3002\u6700\u597d\u907f\u514d\u7eb9\u7406\u7279\u522b\u5c11\u7684\u56fe\u7247\u5982\u4e00\u5f20\u767d\u5899\u6216\u7a7a\u684c\u56fe\u7247\u3002\u901a\u8fc7\u52a0\u5165\u4e00\u4e9b\u7269\u54c1\u6765\u4e30\u5bcc\u7eb9\u7406 \u5177\u5907\u76f8\u4f3c\u7684\u5149\u7167\u60c5\u51b5\u3002\u907f\u514d high dynamic range scenes \uff08\u5982\u6709\u592a\u9633\u6709\u5f71\u5b50\uff0c\u7a7f\u8fc7\u95e8\u6216\u7a97\u62cd\u6444\uff09\u3002\u907f\u514d\u955c\u9762\u53cd\u5c04 \u5177\u6709\u9ad8\u5ea6\u89c6\u89c9\u91cd\u53e0\u7684\u56fe\u7247\u3002\u786e\u4fdd\u4e00\u4e2a\u7269\u4f53\u81f3\u5c11\u6709\u4e09\u5f20\u56fe\u7247\uff0c\u5c3d\u91cf\u591a\u4e00\u70b9 \u591a\u89c6\u56fe\u62cd\u6444\u3002\u4e0d\u8981\u901a\u8fc7\u5e73\u79fb\u65cb\u8f6c\u76f8\u673a\u6765\u4ece\u540c\u4e00\u4e2a\u65b9\u5411\u62cd\u6444\u3002\u4f46\u786e\u4fdd\u76f8\u4f3c\u89c6\u89d2\u6709\u5c11\u4e14\u7cbe\u7684\u56fe\u7247\uff0c\u5e76\u4e0d\u662f\u8d8a\u591a\u8d8a\u597d\u3002\u5982\u679c\u662f\u89c6\u9891\uff0c\u8bf7\u51cf\u5c11\u5e27\u7387\u3002","title":"Picture Capture Process"},{"location":"cv/utils/colmap/#reference","text":"Installation \u2014 COLMAP 3.11.0.dev0 documentation \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014Linux\u5b9e\u73b0COLMAP_linux colmap-CSDN\u535a\u5ba2 ColMap\u4f7f\u7528 | \u60a0\u95f2\u306e\u5c0f\u5c4b \u4e09\u7ef4\u91cd\u5efainstant-ngp\u73af\u5883\u90e8\u7f72\u4e0ecolmap\u3001ffmpeg\u7684\u811a\u672c\u53c2\u6570\u4f7f\u7528 - lefree - \u535a\u5ba2\u56ed","title":"Reference"},{"location":"llm/","text":"\u5927\u6a21\u578b \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5927\u6a21\u578b\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5b66\u4e60\u81ea \u3010\u6e05\u534eNLP\u3011\u5218\u77e5\u8fdc\u56e2\u961f\u5927\u6a21\u578b\u516c\u5f00\u8bfe Table of Contents \u00b6 NLP Word2Vec 2807 9 mins 1702028944 RNN 2811 13 10 mins 1702028944 Transformer ViT 1501 128 7 mins 1711438560 BERT 1562 5 mins 1702478901 Transformer 2247 84 9 mins 1702361865 Attention 2747 9 mins 1702124671 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 1190 66 5 mins 1706082492 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 422 14 2 mins 1705733146 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb 227 1 mins 1704961196 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 167 250 4 mins 1704961196 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2471 534 15 mins 1704961196 \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 166 1 mins 1704727490 \u6742\u9879 Prompt 149 57 1 mins 1705664210 \u5206\u5e03\u5f0f\u8bad\u7ec3 1636 5 mins 1705664210 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u5927\u6a21\u578b"},{"location":"llm/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5927\u6a21\u578b\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5b66\u4e60\u81ea \u3010\u6e05\u534eNLP\u3011\u5218\u77e5\u8fdc\u56e2\u961f\u5927\u6a21\u578b\u516c\u5f00\u8bfe","title":"\u5927\u6a21\u578b"},{"location":"llm/#table-of-contents","text":"NLP Word2Vec 2807 9 mins 1702028944 RNN 2811 13 10 mins 1702028944 Transformer ViT 1501 128 7 mins 1711438560 BERT 1562 5 mins 1702478901 Transformer 2247 84 9 mins 1702361865 Attention 2747 9 mins 1702124671 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 1190 66 5 mins 1706082492 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 422 14 2 mins 1705733146 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb 227 1 mins 1704961196 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 167 250 4 mins 1704961196 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2471 534 15 mins 1704961196 \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 166 1 mins 1704727490 \u6742\u9879 Prompt 149 57 1 mins 1705664210 \u5206\u5e03\u5f0f\u8bad\u7ec3 1636 5 mins 1705664210 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"llm/internlm/","text":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425 \u00b6 Abstract \u5f52\u6863\u6709\u5173\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425\u7684\u8bfe\u7a0b\u7b14\u8bb0\u3002 \u4ed3\u5e93\u5730\u5740\uff1a InternLM/tutorial \u7b97\u529b\u5e73\u53f0\uff1a InternStudio Table of Contents \u00b6 \u8bfe\u7a0b\u65f6\u95f4 \u8bfe\u7a0b\u5185\u5bb9 \u8bb2\u5e08 \u7b2c 1 \u8282 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u9648\u607a \u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4\u9752\u5e74\u79d1\u5b66\u5bb6 \u7b2c 2 \u8282 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo \u5b8b\u5fd7\u5b66d2l-ai-solutions-manual \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 3 \u8282 \u57fa\u4e8e InternLM \u548c Langchain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u90b9\u96e8\u8861prompt-engineering-for-developers \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 4 \u8282 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 \u6c6a\u5468\u8c26XTuner \u793e\u533a\u8d21\u732e\u8005 \u7b2c 5 \u8282 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u957f\u7434HuggingLLM\u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 6 \u8282 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b\u89e3\u8bfb\u53ca\u5b9e\u6218\u6307\u5357 \u66f9\u8302\u677eOpenCompass \u6838\u5fc3\u5f00\u53d1\u8005\u738b\u52aaOpenCompass \u793e\u533a\u8d21\u732e\u8005 \u7b2c 7 \u8282 \u5f69\u86cb\u73af\u8282 \u795e\u79d8\u5609\u5bbe","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425"},{"location":"llm/internlm/#_1","text":"Abstract \u5f52\u6863\u6709\u5173\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425\u7684\u8bfe\u7a0b\u7b14\u8bb0\u3002 \u4ed3\u5e93\u5730\u5740\uff1a InternLM/tutorial \u7b97\u529b\u5e73\u53f0\uff1a InternStudio","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425"},{"location":"llm/internlm/#table-of-contents","text":"\u8bfe\u7a0b\u65f6\u95f4 \u8bfe\u7a0b\u5185\u5bb9 \u8bb2\u5e08 \u7b2c 1 \u8282 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u9648\u607a \u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4\u9752\u5e74\u79d1\u5b66\u5bb6 \u7b2c 2 \u8282 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo \u5b8b\u5fd7\u5b66d2l-ai-solutions-manual \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 3 \u8282 \u57fa\u4e8e InternLM \u548c Langchain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u90b9\u96e8\u8861prompt-engineering-for-developers \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 4 \u8282 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 \u6c6a\u5468\u8c26XTuner \u793e\u533a\u8d21\u732e\u8005 \u7b2c 5 \u8282 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u957f\u7434HuggingLLM\u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 6 \u8282 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b\u89e3\u8bfb\u53ca\u5b9e\u6218\u6307\u5357 \u66f9\u8302\u677eOpenCompass \u6838\u5fc3\u5f00\u53d1\u8005\u738b\u52aaOpenCompass \u793e\u533a\u8d21\u732e\u8005 \u7b2c 7 \u8282 \u5f69\u86cb\u73af\u8282 \u795e\u79d8\u5609\u5bbe","title":"Table of Contents"},{"location":"llm/internlm/lec1/","text":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u00b6 \u7ea6 223 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u7cfb\u5217 \u00b6 \u8f7b\u91cf\u7ea7\uff1aInternLM-7B \u4e2d\u91cf\u7ea7\uff1aInternLM-20B \u91cd\u91cf\u7ea7\uff1aInternLM-123B \u4ece\u6a21\u578b\u5230\u5e94\u7528 \u00b6 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u00b6 \u6570\u636e\uff1a\u4e66\u751f\u00b7\u4e07\u5377 \u00b6 \u5177\u4f53\u67e5\u770b openDataLab \u3002 \u9884\u8bad\u7ec3\uff1aInternLM-Train \u00b6 \u5fae\u8c03\uff1aXTuner \u00b6 \u5927\u8bed\u8a00\u6a21\u578b\u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c\u589e\u91cf\u7eed\u8bad\u548c\u6709\u76d1\u7763\u5fae\u8c03\u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u65b9\u5f0f\u3002 \u589e\u91cf\u7eed\u8bad \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u6570\u636e\u3001\u4ee3\u7801\u7b49 \u6709\u76d1\u7763\u5fae\u8c03 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u7406\u89e3\u548c\u9075\u5faa\u5404\u79cd\u6307\u4ee4\uff0c\u6216\u8005\u6ce8\u5165\u5c11\u8bb8\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\u3001\u95ee\u7b54\u6570\u636e \u8bc4\u6d4b\uff1aOpenCompass \u00b6 \u90e8\u7f72\uff1aLMDeploy \u00b6 \u5e94\u7528\uff1aLagent\u3001AgentLego \u00b6","title":"\u7b2c\u4e00\u8282"},{"location":"llm/internlm/lec1/#_1","text":"\u7ea6 223 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb"},{"location":"llm/internlm/lec1/#_2","text":"\u8f7b\u91cf\u7ea7\uff1aInternLM-7B \u4e2d\u91cf\u7ea7\uff1aInternLM-20B \u91cd\u91cf\u7ea7\uff1aInternLM-123B","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u7cfb\u5217"},{"location":"llm/internlm/lec1/#_3","text":"","title":"\u4ece\u6a21\u578b\u5230\u5e94\u7528"},{"location":"llm/internlm/lec1/#_4","text":"","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb"},{"location":"llm/internlm/lec1/#_5","text":"\u5177\u4f53\u67e5\u770b openDataLab \u3002","title":"\u6570\u636e\uff1a\u4e66\u751f\u00b7\u4e07\u5377"},{"location":"llm/internlm/lec1/#internlm-train","text":"","title":"\u9884\u8bad\u7ec3\uff1aInternLM-Train"},{"location":"llm/internlm/lec1/#xtuner","text":"\u5927\u8bed\u8a00\u6a21\u578b\u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c\u589e\u91cf\u7eed\u8bad\u548c\u6709\u76d1\u7763\u5fae\u8c03\u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u65b9\u5f0f\u3002 \u589e\u91cf\u7eed\u8bad \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u6570\u636e\u3001\u4ee3\u7801\u7b49 \u6709\u76d1\u7763\u5fae\u8c03 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u7406\u89e3\u548c\u9075\u5faa\u5404\u79cd\u6307\u4ee4\uff0c\u6216\u8005\u6ce8\u5165\u5c11\u8bb8\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\u3001\u95ee\u7b54\u6570\u636e","title":"\u5fae\u8c03\uff1aXTuner"},{"location":"llm/internlm/lec1/#opencompass","text":"","title":"\u8bc4\u6d4b\uff1aOpenCompass"},{"location":"llm/internlm/lec1/#lmdeploy","text":"","title":"\u90e8\u7f72\uff1aLMDeploy"},{"location":"llm/internlm/lec1/#lagentagentlego","text":"","title":"\u5e94\u7528\uff1aLagent\u3001AgentLego"},{"location":"llm/internlm/lec2/","text":"\u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo \u00b6 \u7ea6 163 \u4e2a\u5b57 250 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo InternLM-Chat-7B \u667a\u80fd\u5bf9\u8bdd \u00b6 Terminal Demo \u00b6 cli_demo.py import torch from transformers import AutoTokenizer , AutoModelForCausalLM model_name_or_path = \"/root/model/Shanghai_AI_Laboratory/internlm-chat-7b\" tokenizer = AutoTokenizer . from_pretrained ( model_name_or_path , trust_remote_code = True ) model = AutoModelForCausalLM . from_pretrained ( model_name_or_path , trust_remote_code = True , torch_dtype = torch . bfloat16 , device_map = 'auto' ) model = model . eval () system_prompt = \"\"\"You are an AI assistant whose name is InternLM (\u4e66\u751f\u00b7\u6d66\u8bed). - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) is a conversational language model that is developed by Shanghai AI Laboratory (\u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4). It is designed to be helpful, honest, and harmless. - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) can understand and communicate fluently in the language chosen by the user such as English and \u4e2d\u6587. \"\"\" messages = [( system_prompt , '' )] print ( \"=============Welcome to InternLM chatbot, type 'exit' to exit.=============\" ) while True : input_text = input ( \"User >>> \" ) input_text . replace ( ' ' , '' ) if input_text == \"exit\" : break response , history = model . chat ( tokenizer , input_text , history = messages ) messages . append (( input_text , response )) print ( f \"robot >>> { response } \" ) python /root/code/InternLM/cli_demo.py Web Demo \u00b6 streamlit run /root/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006 Lagent \u667a\u80fd\u4f53\u5de5\u5177\u8c03\u7528 \u00b6 react_web_demo.py import copy import os import streamlit as st from streamlit.logger import get_logger from lagent.actions import ActionExecutor , GoogleSearch , PythonInterpreter from lagent.agents.react import ReAct from lagent.llms import GPTAPI from lagent.llms.huggingface import HFTransformerCasualLM class SessionState : def init_state ( self ): \"\"\"Initialize session state variables.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] #action_list = [PythonInterpreter(), GoogleSearch()] action_list = [ PythonInterpreter ()] st . session_state [ 'plugin_map' ] = { action . name : action for action in action_list } st . session_state [ 'model_map' ] = {} st . session_state [ 'model_selected' ] = None st . session_state [ 'plugin_actions' ] = set () def clear_state ( self ): \"\"\"Clear the existing session state.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] st . session_state [ 'model_selected' ] = None if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _session_history = [] class StreamlitUI : def __init__ ( self , session_state : SessionState ): self . init_streamlit () self . session_state = session_state def init_streamlit ( self ): \"\"\"Initialize Streamlit's UI settings.\"\"\" st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') st . sidebar . title ( '\u6a21\u578b\u63a7\u5236' ) def setup_sidebar ( self ): \"\"\"Setup the sidebar for model and plugin selection.\"\"\" model_name = st . sidebar . selectbox ( '\u6a21\u578b\u9009\u62e9\uff1a' , options = [ 'gpt-3.5-turbo' , 'internlm' ]) if model_name != st . session_state [ 'model_selected' ]: model = self . init_model ( model_name ) self . session_state . clear_state () st . session_state [ 'model_selected' ] = model_name if 'chatbot' in st . session_state : del st . session_state [ 'chatbot' ] else : model = st . session_state [ 'model_map' ][ model_name ] plugin_name = st . sidebar . multiselect ( '\u63d2\u4ef6\u9009\u62e9' , options = list ( st . session_state [ 'plugin_map' ] . keys ()), default = [ list ( st . session_state [ 'plugin_map' ] . keys ())[ 0 ]], ) plugin_action = [ st . session_state [ 'plugin_map' ][ name ] for name in plugin_name ] if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _action_executor = ActionExecutor ( actions = plugin_action ) if st . sidebar . button ( '\u6e05\u7a7a\u5bf9\u8bdd' , key = 'clear' ): self . session_state . clear_state () uploaded_file = st . sidebar . file_uploader ( '\u4e0a\u4f20\u6587\u4ef6' , type = [ 'png' , 'jpg' , 'jpeg' , 'mp4' , 'mp3' , 'wav' ]) return model_name , model , plugin_action , uploaded_file def init_model ( self , option ): \"\"\"Initialize the model based on the selected option.\"\"\" if option not in st . session_state [ 'model_map' ]: if option . startswith ( 'gpt' ): st . session_state [ 'model_map' ][ option ] = GPTAPI ( model_type = option ) else : st . session_state [ 'model_map' ][ option ] = HFTransformerCasualLM ( '/root/model/Shanghai_AI_Laboratory/internlm-chat-7b' ) return st . session_state [ 'model_map' ][ option ] def initialize_chatbot ( self , model , plugin_action ): \"\"\"Initialize the chatbot with the given model and plugin actions.\"\"\" return ReAct ( llm = model , action_executor = ActionExecutor ( actions = plugin_action )) def render_user ( self , prompt : str ): with st . chat_message ( 'user' ): st . markdown ( prompt ) def render_assistant ( self , agent_return ): with st . chat_message ( 'assistant' ): for action in agent_return . actions : if ( action ): self . render_action ( action ) st . markdown ( agent_return . response ) def render_action ( self , action ): with st . expander ( action . type , expanded = True ): st . markdown ( \"

    \u63d2 \u4ef6:\" # noqa E501 + action . type + '

    ' , unsafe_allow_html = True ) st . markdown ( \"

    \u601d\u8003\u6b65\u9aa4:\" # noqa E501 + action . thought + '

    ' , unsafe_allow_html = True ) if ( isinstance ( action . args , dict ) and 'text' in action . args ): st . markdown ( \"

    \u6267\u884c\u5185\u5bb9:

    \" , # noqa E501 unsafe_allow_html = True ) st . markdown ( action . args [ 'text' ]) self . render_action_results ( action ) def render_action_results ( self , action ): \"\"\"Render the results of action, including text, images, videos, and audios.\"\"\" if ( isinstance ( action . result , dict )): st . markdown ( \"

    \u6267\u884c\u7ed3\u679c:

    \" , # noqa E501 unsafe_allow_html = True ) if 'text' in action . result : st . markdown ( \"

    \" + action . result [ 'text' ] + '

    ' , unsafe_allow_html = True ) if 'image' in action . result : image_path = action . result [ 'image' ] image_data = open ( image_path , 'rb' ) . read () st . image ( image_data , caption = 'Generated Image' ) if 'video' in action . result : video_data = action . result [ 'video' ] video_data = open ( video_data , 'rb' ) . read () st . video ( video_data ) if 'audio' in action . result : audio_data = action . result [ 'audio' ] audio_data = open ( audio_data , 'rb' ) . read () st . audio ( audio_data ) def main (): logger = get_logger ( __name__ ) # Initialize Streamlit UI and setup sidebar if 'ui' not in st . session_state : session_state = SessionState () session_state . init_state () st . session_state [ 'ui' ] = StreamlitUI ( session_state ) else : st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') model_name , model , plugin_action , uploaded_file = st . session_state [ 'ui' ] . setup_sidebar () # Initialize chatbot if it is not already initialized # or if the model has changed if 'chatbot' not in st . session_state or model != st . session_state [ 'chatbot' ] . _llm : st . session_state [ 'chatbot' ] = st . session_state [ 'ui' ] . initialize_chatbot ( model , plugin_action ) for prompt , agent_return in zip ( st . session_state [ 'user' ], st . session_state [ 'assistant' ]): st . session_state [ 'ui' ] . render_user ( prompt ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) # User input form at the bottom (this part will be at the bottom) # with st.form(key='my_form', clear_on_submit=True): if user_input := st . chat_input ( '' ): st . session_state [ 'ui' ] . render_user ( user_input ) st . session_state [ 'user' ] . append ( user_input ) # Add file uploader to sidebar if uploaded_file : file_bytes = uploaded_file . read () file_type = uploaded_file . type if 'image' in file_type : st . image ( file_bytes , caption = 'Uploaded Image' ) elif 'video' in file_type : st . video ( file_bytes , caption = 'Uploaded Video' ) elif 'audio' in file_type : st . audio ( file_bytes , caption = 'Uploaded Audio' ) # Save the file to a temporary location and get the path file_path = os . path . join ( root_dir , uploaded_file . name ) with open ( file_path , 'wb' ) as tmpfile : tmpfile . write ( file_bytes ) st . write ( f 'File saved at: { file_path } ' ) user_input = '\u6211\u4e0a\u4f20\u4e86\u4e00\u4e2a\u56fe\u50cf\uff0c\u8def\u5f84\u4e3a: {file_path} . {user_input} ' . format ( file_path = file_path , user_input = user_input ) agent_return = st . session_state [ 'chatbot' ] . chat ( user_input ) st . session_state [ 'assistant' ] . append ( copy . deepcopy ( agent_return )) logger . info ( agent_return . inner_steps ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) if __name__ == '__main__' : root_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ))) root_dir = os . path . join ( root_dir , 'tmp_dir' ) os . makedirs ( root_dir , exist_ok = True ) main () streamlit run /root/code/lagent/examples/react_web_demo.py --server.address 127 .0.0.1 --server.port 6006 \u6d66\u8bed\u00b7\u7075\u7b14\u56fe\u6587\u7406\u89e3\u521b\u4f5c \u00b6 python /root/code/InternLM-XComposer/examples/web_demo.py \\ --folder /root/model/Shanghai_AI_Laboratory/internlm-xcomposer-7b \\ --num_gpus 1 \\ --port 6006 \u4f5c\u4e1a \u00b6 \u4f7f\u7528 InternLM-Chat-7B \u6a21\u578b\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09\u3002 \u719f\u6089 hugging face \u4e0b\u8f7d\u529f\u80fd\uff0c\u4f7f\u7528 huggingface_hub python \u5305\uff0c\u4e0b\u8f7d InternLM-20B \u7684 config.json \u6587\u4ef6\u5230\u672c\u5730\uff08\u9700\u622a\u56fe\u4e0b\u8f7d\u8fc7\u7a0b\uff09\u3002 \u5b8c\u6210\u6d66\u8bed\u00b7\u7075\u7b14\u7684\u56fe\u6587\u7406\u89e3\u53ca\u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a \u5b8c\u6210 Lagent \u5de5\u5177\u8c03\u7528 Demo \u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a","title":"\u7b2c\u4e8c\u8282"},{"location":"llm/internlm/lec2/#demo","text":"\u7ea6 163 \u4e2a\u5b57 250 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo","title":"\u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo"},{"location":"llm/internlm/lec2/#internlm-chat-7b","text":"","title":"InternLM-Chat-7B \u667a\u80fd\u5bf9\u8bdd"},{"location":"llm/internlm/lec2/#terminal-demo","text":"cli_demo.py import torch from transformers import AutoTokenizer , AutoModelForCausalLM model_name_or_path = \"/root/model/Shanghai_AI_Laboratory/internlm-chat-7b\" tokenizer = AutoTokenizer . from_pretrained ( model_name_or_path , trust_remote_code = True ) model = AutoModelForCausalLM . from_pretrained ( model_name_or_path , trust_remote_code = True , torch_dtype = torch . bfloat16 , device_map = 'auto' ) model = model . eval () system_prompt = \"\"\"You are an AI assistant whose name is InternLM (\u4e66\u751f\u00b7\u6d66\u8bed). - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) is a conversational language model that is developed by Shanghai AI Laboratory (\u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4). It is designed to be helpful, honest, and harmless. - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) can understand and communicate fluently in the language chosen by the user such as English and \u4e2d\u6587. \"\"\" messages = [( system_prompt , '' )] print ( \"=============Welcome to InternLM chatbot, type 'exit' to exit.=============\" ) while True : input_text = input ( \"User >>> \" ) input_text . replace ( ' ' , '' ) if input_text == \"exit\" : break response , history = model . chat ( tokenizer , input_text , history = messages ) messages . append (( input_text , response )) print ( f \"robot >>> { response } \" ) python /root/code/InternLM/cli_demo.py","title":"Terminal Demo"},{"location":"llm/internlm/lec2/#web-demo","text":"streamlit run /root/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006","title":"Web Demo"},{"location":"llm/internlm/lec2/#lagent","text":"react_web_demo.py import copy import os import streamlit as st from streamlit.logger import get_logger from lagent.actions import ActionExecutor , GoogleSearch , PythonInterpreter from lagent.agents.react import ReAct from lagent.llms import GPTAPI from lagent.llms.huggingface import HFTransformerCasualLM class SessionState : def init_state ( self ): \"\"\"Initialize session state variables.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] #action_list = [PythonInterpreter(), GoogleSearch()] action_list = [ PythonInterpreter ()] st . session_state [ 'plugin_map' ] = { action . name : action for action in action_list } st . session_state [ 'model_map' ] = {} st . session_state [ 'model_selected' ] = None st . session_state [ 'plugin_actions' ] = set () def clear_state ( self ): \"\"\"Clear the existing session state.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] st . session_state [ 'model_selected' ] = None if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _session_history = [] class StreamlitUI : def __init__ ( self , session_state : SessionState ): self . init_streamlit () self . session_state = session_state def init_streamlit ( self ): \"\"\"Initialize Streamlit's UI settings.\"\"\" st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') st . sidebar . title ( '\u6a21\u578b\u63a7\u5236' ) def setup_sidebar ( self ): \"\"\"Setup the sidebar for model and plugin selection.\"\"\" model_name = st . sidebar . selectbox ( '\u6a21\u578b\u9009\u62e9\uff1a' , options = [ 'gpt-3.5-turbo' , 'internlm' ]) if model_name != st . session_state [ 'model_selected' ]: model = self . init_model ( model_name ) self . session_state . clear_state () st . session_state [ 'model_selected' ] = model_name if 'chatbot' in st . session_state : del st . session_state [ 'chatbot' ] else : model = st . session_state [ 'model_map' ][ model_name ] plugin_name = st . sidebar . multiselect ( '\u63d2\u4ef6\u9009\u62e9' , options = list ( st . session_state [ 'plugin_map' ] . keys ()), default = [ list ( st . session_state [ 'plugin_map' ] . keys ())[ 0 ]], ) plugin_action = [ st . session_state [ 'plugin_map' ][ name ] for name in plugin_name ] if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _action_executor = ActionExecutor ( actions = plugin_action ) if st . sidebar . button ( '\u6e05\u7a7a\u5bf9\u8bdd' , key = 'clear' ): self . session_state . clear_state () uploaded_file = st . sidebar . file_uploader ( '\u4e0a\u4f20\u6587\u4ef6' , type = [ 'png' , 'jpg' , 'jpeg' , 'mp4' , 'mp3' , 'wav' ]) return model_name , model , plugin_action , uploaded_file def init_model ( self , option ): \"\"\"Initialize the model based on the selected option.\"\"\" if option not in st . session_state [ 'model_map' ]: if option . startswith ( 'gpt' ): st . session_state [ 'model_map' ][ option ] = GPTAPI ( model_type = option ) else : st . session_state [ 'model_map' ][ option ] = HFTransformerCasualLM ( '/root/model/Shanghai_AI_Laboratory/internlm-chat-7b' ) return st . session_state [ 'model_map' ][ option ] def initialize_chatbot ( self , model , plugin_action ): \"\"\"Initialize the chatbot with the given model and plugin actions.\"\"\" return ReAct ( llm = model , action_executor = ActionExecutor ( actions = plugin_action )) def render_user ( self , prompt : str ): with st . chat_message ( 'user' ): st . markdown ( prompt ) def render_assistant ( self , agent_return ): with st . chat_message ( 'assistant' ): for action in agent_return . actions : if ( action ): self . render_action ( action ) st . markdown ( agent_return . response ) def render_action ( self , action ): with st . expander ( action . type , expanded = True ): st . markdown ( \"

    \u63d2 \u4ef6:\" # noqa E501 + action . type + '

    ' , unsafe_allow_html = True ) st . markdown ( \"

    \u601d\u8003\u6b65\u9aa4:\" # noqa E501 + action . thought + '

    ' , unsafe_allow_html = True ) if ( isinstance ( action . args , dict ) and 'text' in action . args ): st . markdown ( \"

    \u6267\u884c\u5185\u5bb9:

    \" , # noqa E501 unsafe_allow_html = True ) st . markdown ( action . args [ 'text' ]) self . render_action_results ( action ) def render_action_results ( self , action ): \"\"\"Render the results of action, including text, images, videos, and audios.\"\"\" if ( isinstance ( action . result , dict )): st . markdown ( \"

    \u6267\u884c\u7ed3\u679c:

    \" , # noqa E501 unsafe_allow_html = True ) if 'text' in action . result : st . markdown ( \"

    \" + action . result [ 'text' ] + '

    ' , unsafe_allow_html = True ) if 'image' in action . result : image_path = action . result [ 'image' ] image_data = open ( image_path , 'rb' ) . read () st . image ( image_data , caption = 'Generated Image' ) if 'video' in action . result : video_data = action . result [ 'video' ] video_data = open ( video_data , 'rb' ) . read () st . video ( video_data ) if 'audio' in action . result : audio_data = action . result [ 'audio' ] audio_data = open ( audio_data , 'rb' ) . read () st . audio ( audio_data ) def main (): logger = get_logger ( __name__ ) # Initialize Streamlit UI and setup sidebar if 'ui' not in st . session_state : session_state = SessionState () session_state . init_state () st . session_state [ 'ui' ] = StreamlitUI ( session_state ) else : st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') model_name , model , plugin_action , uploaded_file = st . session_state [ 'ui' ] . setup_sidebar () # Initialize chatbot if it is not already initialized # or if the model has changed if 'chatbot' not in st . session_state or model != st . session_state [ 'chatbot' ] . _llm : st . session_state [ 'chatbot' ] = st . session_state [ 'ui' ] . initialize_chatbot ( model , plugin_action ) for prompt , agent_return in zip ( st . session_state [ 'user' ], st . session_state [ 'assistant' ]): st . session_state [ 'ui' ] . render_user ( prompt ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) # User input form at the bottom (this part will be at the bottom) # with st.form(key='my_form', clear_on_submit=True): if user_input := st . chat_input ( '' ): st . session_state [ 'ui' ] . render_user ( user_input ) st . session_state [ 'user' ] . append ( user_input ) # Add file uploader to sidebar if uploaded_file : file_bytes = uploaded_file . read () file_type = uploaded_file . type if 'image' in file_type : st . image ( file_bytes , caption = 'Uploaded Image' ) elif 'video' in file_type : st . video ( file_bytes , caption = 'Uploaded Video' ) elif 'audio' in file_type : st . audio ( file_bytes , caption = 'Uploaded Audio' ) # Save the file to a temporary location and get the path file_path = os . path . join ( root_dir , uploaded_file . name ) with open ( file_path , 'wb' ) as tmpfile : tmpfile . write ( file_bytes ) st . write ( f 'File saved at: { file_path } ' ) user_input = '\u6211\u4e0a\u4f20\u4e86\u4e00\u4e2a\u56fe\u50cf\uff0c\u8def\u5f84\u4e3a: {file_path} . {user_input} ' . format ( file_path = file_path , user_input = user_input ) agent_return = st . session_state [ 'chatbot' ] . chat ( user_input ) st . session_state [ 'assistant' ] . append ( copy . deepcopy ( agent_return )) logger . info ( agent_return . inner_steps ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) if __name__ == '__main__' : root_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ))) root_dir = os . path . join ( root_dir , 'tmp_dir' ) os . makedirs ( root_dir , exist_ok = True ) main () streamlit run /root/code/lagent/examples/react_web_demo.py --server.address 127 .0.0.1 --server.port 6006","title":"Lagent \u667a\u80fd\u4f53\u5de5\u5177\u8c03\u7528"},{"location":"llm/internlm/lec2/#_1","text":"python /root/code/InternLM-XComposer/examples/web_demo.py \\ --folder /root/model/Shanghai_AI_Laboratory/internlm-xcomposer-7b \\ --num_gpus 1 \\ --port 6006","title":"\u6d66\u8bed\u00b7\u7075\u7b14\u56fe\u6587\u7406\u89e3\u521b\u4f5c"},{"location":"llm/internlm/lec2/#_2","text":"\u4f7f\u7528 InternLM-Chat-7B \u6a21\u578b\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09\u3002 \u719f\u6089 hugging face \u4e0b\u8f7d\u529f\u80fd\uff0c\u4f7f\u7528 huggingface_hub python \u5305\uff0c\u4e0b\u8f7d InternLM-20B \u7684 config.json \u6587\u4ef6\u5230\u672c\u5730\uff08\u9700\u622a\u56fe\u4e0b\u8f7d\u8fc7\u7a0b\uff09\u3002 \u5b8c\u6210\u6d66\u8bed\u00b7\u7075\u7b14\u7684\u56fe\u6587\u7406\u89e3\u53ca\u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a \u5b8c\u6210 Lagent \u5de5\u5177\u8c03\u7528 Demo \u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a","title":"\u4f5c\u4e1a"},{"location":"llm/internlm/lec3/","text":"\u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u00b6 \u7ea6 162 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u642d\u5efa\u6d41\u7a0b \u00b6 \u73af\u5883\u914d\u7f6e \u77e5\u8bc6\u5e93\u642d\u5efa \u6570\u636e\u6536\u96c6 \u52a0\u8f7d\u6570\u636e \u6784\u5efa\u5411\u91cf\u6570\u636e\u5e93 \u63a5\u5165 LangChain \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u52a0\u8f7d\u5411\u91cf\u6570\u636e\u5e93 \u5b9e\u4f8b\u5316\u81ea\u5b9a\u4e49 LLM \u4e0e Prompt Template \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u90e8\u7f72 Web Demo \u4f5c\u4e1a \u00b6 \u590d\u73b0\u8bfe\u7a0b\u77e5\u8bc6\u5e93\u52a9\u624b\u642d\u5efa\u8fc7\u7a0b (\u622a\u56fe) \u9009\u62e9\u4e00\u4e2a\u5782\u76f4\u9886\u57df\uff0c\u6536\u96c6\u8be5\u9886\u57df\u7684\u4e13\u4e1a\u8d44\u6599\u6784\u5efa\u4e13\u4e1a\u77e5\u8bc6\u5e93\uff0c\u5e76\u642d\u5efa\u4e13\u4e1a\u95ee\u7b54\u52a9\u624b\uff0c\u5e76\u5728 OpenXLab \u4e0a\u6210\u529f\u90e8\u7f72\uff08\u622a\u56fe\uff0c\u5e76\u63d0\u4f9b\u5e94\u7528\u5730\u5740\uff09","title":"\u7b2c\u4e09\u8282"},{"location":"llm/internlm/lec3/#internlm-langchain","text":"\u7ea6 162 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93","title":"\u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93"},{"location":"llm/internlm/lec3/#_1","text":"\u73af\u5883\u914d\u7f6e \u77e5\u8bc6\u5e93\u642d\u5efa \u6570\u636e\u6536\u96c6 \u52a0\u8f7d\u6570\u636e \u6784\u5efa\u5411\u91cf\u6570\u636e\u5e93 \u63a5\u5165 LangChain \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u52a0\u8f7d\u5411\u91cf\u6570\u636e\u5e93 \u5b9e\u4f8b\u5316\u81ea\u5b9a\u4e49 LLM \u4e0e Prompt Template \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u90e8\u7f72 Web Demo","title":"\u642d\u5efa\u6d41\u7a0b"},{"location":"llm/internlm/lec3/#_2","text":"\u590d\u73b0\u8bfe\u7a0b\u77e5\u8bc6\u5e93\u52a9\u624b\u642d\u5efa\u8fc7\u7a0b (\u622a\u56fe) \u9009\u62e9\u4e00\u4e2a\u5782\u76f4\u9886\u57df\uff0c\u6536\u96c6\u8be5\u9886\u57df\u7684\u4e13\u4e1a\u8d44\u6599\u6784\u5efa\u4e13\u4e1a\u77e5\u8bc6\u5e93\uff0c\u5e76\u642d\u5efa\u4e13\u4e1a\u95ee\u7b54\u52a9\u624b\uff0c\u5e76\u5728 OpenXLab \u4e0a\u6210\u529f\u90e8\u7f72\uff08\u622a\u56fe\uff0c\u5e76\u63d0\u4f9b\u5e94\u7528\u5730\u5740\uff09","title":"\u4f5c\u4e1a"},{"location":"llm/internlm/lec4/","text":"XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 \u00b6 \u7ea6 2467 \u4e2a\u5b57 534 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u5b66\u4e60\u81ea XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 Finetune \u00b6 LLM \u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c \u589e\u91cf\u9884\u8bad\u7ec3 \u548c \u6307\u4ee4\u8ddf\u968f \u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u7684\u5fae\u8c03\u6a21\u5f0f \u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03 \u00b6 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u5230\u4e00\u4e9b\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u7684\u5e38\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u4e66\u7c4d\u3001\u4ee3\u7801\u7b49 \u4e3a\u4e86\u8ba9 LLM \u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\u4e00\u6bb5\u8bdd\uff0c\u4ec0\u4e48\u65f6\u5019\u7ed3\u675f\u4e00\u6bb5\u8bdd\uff0c\u5b9e\u9645\u8bad\u7ec3\u65f6\u9700\u8981\u5bf9\u6570\u636e\u6dfb\u52a0\u8d77\u59cb\u7b26\uff08BOS\uff09\u548c\u7ed3\u675f\u7b26\uff08EOS\uff09\uff0c\u5927\u591a\u6570\u7684\u6a21\u578b\u90fd\u662f\u4f7f\u7528 \u4f5c\u4e3a\u8d77\u59cb\u7b26\uff0c \u4f5c\u4e3a\u7ed3\u675f\u7b26 \u6307\u4ee4\u8ddf\u968f\u5fae\u8c03 \u00b6 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u5bf9\u8bdd\u6a21\u7248\uff0c\u6839\u636e\u4eba\u7c7b\u6307\u4ee4\u8fdb\u884c\u5bf9\u8bdd \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\uff0c\u95ee\u7b54\u6570\u636e \u5728\u5b9e\u9645\u5bf9\u8bdd\u4e2d\uff0c\u901a\u5e38\u4f1a\u6709\u4e09\u79cd\u89d2\u8272 System \u7ed9\u5b9a\u4e00\u4e9b\u4e0a\u4e0b\u6587\uff0c\u6bd4\u5982\u201c\u4f60\u662f\u4e00\u4e2a\u5b89\u5168\u7684 AI \u52a9\u624b\u201d User \u5b9e\u9645\u7528\u6237\uff0c\u4f1a\u63d0\u51fa\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982 \u201c\u4e16\u754c\u7b2c\u4e00\u9ad8\u5cf0\u662f\u201d Assistant \u6839\u636e User \u7684\u8f93\u5165\uff0c\u7ed3\u5408 System \u7684\u4e0a\u4e0b\u6587\u4fe1\u606f\uff0c\u505a\u51fa\u56de\u7b54\uff0c\u6bd4\u5982 \u201c\u73e0\u7a46\u6717\u739b\u5cf0\u201d \u5728\u4f7f\u7528\u5bf9\u8bdd\u6a21\u578b\u65f6\uff0c\u901a\u5e38\u662f\u4e0d\u4f1a\u611f\u77e5\u5230\u8fd9\u4e09\u79cd\u89d2\u8272 \u5bf9\u8bdd\u6a21\u7248 \u4e0d\u540c\u4e8e\u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03\uff0c\u6570\u636e\u4e2d\u4f1a\u6709 Input \u548c Output \u5e0c\u671b\u6a21\u578b\u5b66\u4f1a\u7684\u662f\u7b54\u6848\uff08Output\uff09\uff0c\u800c\u4e0d\u662f\u95ee\u9898\uff08Input\uff09\uff0c\u8bad\u7ec3\u65f6\u53ea\u4f1a\u5bf9\u7b54\u6848\uff08Output\uff09\u90e8\u5206\u8ba1\u7b97 Loss \u8bad\u7ec3\u65f6\uff0c\u4f1a\u548c\u63a8\u7406\u65f6\u4fdd\u6301\u4e00\u81f4\uff0c\u5bf9\u6570\u636e\u6dfb\u52a0\u76f8\u5bf9\u5e94\u7684\u5bf9\u8bdd\u6a21\u7248 LoRA & QLoRA \u00b6 Xtuner \u00b6 \u50bb\u74dc\u5316 \uff1a\u4ee5 \u914d\u7f6e\u6587\u4ef6 \u7684\u5f62\u5f0f\u5c01\u88c5\u4e86\u5927\u90e8\u5206\u5fae\u8c03\u573a\u666f \u8f7b\u91cf\u7ea7 \uff1a\u5bf9\u4e8e 7B \u53c2\u6570\u91cf\u7684 LLM\uff0c\u5fae\u8c03\u6240\u9700\u7684\u6700\u5c0f\u663e\u5b58\u4ec5\u4e3a 8GB \u5feb\u901f\u4e0a\u624b \u00b6 \u4f7f\u7528\u6d41\u7a0b \u00b6 \u5b89\u88c5 pip install xtuner \u6311\u9009\u914d\u7f6e\u6a21\u7248 xtuner list-cfg -p internlm_20b \u4e00\u952e\u8bad\u7ec3 xtuner train internlm_20b_qlora_oasst1_512_e3 Config Description \u6a21\u578b\u540d internlm_20b (\u65e0 chat \u4ee3\u8868\u662f\u57fa\u5ea7\u6a21\u578b) \u4f7f\u7528\u7b97\u6cd5 qlora \u6570\u636e\u96c6 oasst1 \u6570\u636e\u957f\u5ea6 512 Epoch e3, epoch 3 \u81ea\u5b9a\u4e49\u8bad\u7ec3 \u00b6 \u62f7\u8d1d\u914d\u7f6e\u6a21\u7248 \u4fee\u6539\u914d\u7f6e\u6a21\u7248 \u542f\u52a8\u8bad\u7ec3 \u5e38\u7528\u8d85\u53c2 Description data_path \u6570\u636e\u8def\u5f84\u6216 HuggingFace \u4ed3\u5e93\u540d max_length \u5355\u6761\u6570\u636e\u6700\u5927 Token \u6570\uff0c\u8d85\u8fc7\u5219\u622a\u65ad pack_to_max_length \u662f\u5426\u5c06\u591a\u6761\u77ed\u6570\u636e\u62fc\u63a5\u5230 max_length\uff0c\u63d0\u9ad8 GPU \u5229\u7528\u7387 accumulative_counts \u68af\u5ea6\u7d2f\u79ef\uff0c\u6bcf\u591a\u5c11\u6b21 backward \u66f4\u65b0\u4e00\u6b21\u53c2\u6570 evaluation_inputs \u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u6839\u636e\u7ed9\u5b9a\u7684\u95ee\u9898\u8fdb\u884c\u63a8\u7406\uff0c\u4fbf\u4e8e\u89c2\u6d4b\u8bad\u7ec3\u72b6\u6001 evaluation_freq Evaluation \u7684\u6d4b\u8bc4\u95f4\u9694 iter \u6570 \u5bf9\u8bdd \u00b6 \u4e3a\u4e86\u4fbf\u4e8e\u5f00\u53d1\u8005\u67e5\u770b\u8bad\u7ec3\u6548\u679c\uff0cXtuner \u63d0\u4f9b\u4e86\u4e00\u952e\u5bf9\u8bdd\u501f\u53e3 Float16 \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b 4bits \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --bits 4 \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --adapter $ADAPTER_DIR \u540c\u65f6\uff0cXtuner \u8fd8\u652f\u6301\u5de5\u5177\u7c7b\u6a21\u578b\u7684\u5bf9\u8bdd XTuner \u6570\u636e\u5f15\u64ce \u00b6 \u6570\u636e\u5904\u7406\u6d41\u7a0b \u00b6 \u591a\u6570\u636e\u6837\u672c\u62fc\u63a5\uff08Pack Dataset\uff09 \u00b6 \u589e\u5f3a\u5e76\u884c\u6027\uff0c\u5145\u5206\u5229\u7528 GPU \u8d44\u6e90\uff01 8 GB \u663e\u5361\u73a9\u8f6c LLM \u00b6 XTuner \u52a0\u901f\u65b9\u5f0f \u00b6 Flash Attention \uff1a Flash Attention \u5c06 Attention \u8ba1\u7b97\u5e76\u884c\u5316\uff0c\u907f\u514d\u4e86\u8ba1\u7b97\u8fc7\u7a0b\u4e2d Attention Score NxN \u7684\u663e\u5b58\u5360\u7528\uff08\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684 N \u90fd\u6bd4\u8f83\u5927\uff09 DeepSpeed ZeRO ZeRO \u4f18\u5316\uff0c\u901a\u8fc7\u5c06\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u53c2\u6570\u3001\u68af\u5ea6\u548c\u4f18\u5316\u5668\u72b6\u6001\u5207\u7247\u4fdd\u5b58\uff0c\u80fd\u591f\u5728\u591a GPU \u8bad\u7ec3\u65f6\u663e\u8457\u8282\u7701\u663e\u5b58 \u9664\u4e86\u5c06\u8bad\u7ec3\u4e2d\u95f4\u72b6\u6001\u5207\u7247\u5916\uff0c DeepSpeed \u8bad\u7ec3\u65f6\u4f7f\u7528 FP16 \u7684\u6743\u91cd\uff0c\u76f8\u8f83\u4e8e Pytorch \u7684 AMP \u8bad\u7ec3\uff0c\u5728\u5355 GPU \u4e0a\u4e5f\u80fd\u5927\u5e45\u8282\u7701\u663e\u5b58 DeepSpeed \u4e0e Flash Attention \u867d\u7136\u80fd\u591f\u5927\u5e45\u964d\u4f4e\u8bad\u7ec3\u6210\u672c\uff0c\u4f46\u4f7f\u7528\u95e8\u69db\u76f8\u5bf9\u8f83\u9ad8\uff0c\u9700\u8981\u590d\u6742\u7684\u914d\u7f6e\uff0c\u751a\u81f3\u4fee\u6539\u4ee3\u7801\uff0c\u4e3a\u4e86\u8ba9\u5f00\u53d1\u8005\u4e13\u6ce8\u4e8e\u6570\u636e\uff0cXTuner \u4f1a\u81ea\u52a8 dispatch Flash Attention \uff0c\u5e76\u4e00\u952e\u542f\u52a8 DeepSpeed ZeRO xtuner train internlm_20b_qlora_oasst1_512_e3 \\ --deepspeed deepspeed_zero3 \u5b9e\u6218\u8bad\u7ec3 \u00b6 \u73af\u5883 & \u5b89\u88c5 \u00b6 \u73af\u5883\uff1aUbuntu + Anaconda + CUDA/CUDNN + 8GB Nvidia GPU \u5b89\u88c5\uff1a conda create --name xtuner0.1.9 python = 3 .10 -y conda activate xtuner0.1.9 cd ~ && mkdir xtuner019 && cd xtuner019 git clone -b v0.1.9 https://github.com/InternLM/xtuner cd xtuner pip install -e '.[all]' \u521b\u5efa\u6570\u636e\u96c6\u5de5\u4f5c\u8def\u5f84\uff1a mkdir ~/ft-oasst1 && cd ~/ft-oasst1 \u5fae\u8c03 \u00b6 \u51c6\u5907\u914d\u7f6e\u6587\u4ef6 \u00b6 cd ~/ft-oasst1 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . \u6a21\u578b\u4e0b\u8f7d \u00b6 InternStudio \u5e73\u53f0\u4e0a cp -r /root/share/temp/model_repos/internlm-chat-7b ~/ft-oasst1/ - \u4e0d\u7528 xtuner \u9ed8\u8ba4\u7684\u4ece huggingface \u62c9\u53d6\u6a21\u578b\uff0c\u800c\u662f\u63d0\u524d\u4ece ModelScope \u4e0b\u8f7d\u6a21\u578b\u5230\u672c\u5730 # \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u653e\u6a21\u578b\u6587\u4ef6\uff0c\u9632\u6b62\u6563\u843d\u4e00\u5730 mkdir ~/ft-oasst1/internlm-chat-7b # \u88c5\u4e00\u4e0b\u62c9\u53d6\u6a21\u578b\u6587\u4ef6\u8981\u7528\u7684\u5e93 pip install modelscope # \u4ece modelscope \u4e0b\u8f7d\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6 cd ~/ft-oasst1 apt install git git-lfs -y git lfs install git lfs clone https://modelscope.cn/Shanghai_AI_Laboratory/internlm-chat-7b.git -b v1.0.3 \u6570\u636e\u96c6\u4e0b\u8f7d \u00b6 https://huggingface.co/datasets/timdettmers/openassistant-guanaco/tree/main \u4fee\u6539\u914d\u7f6e\u6587\u4ef6 \u00b6 \u4fee\u6539\u5176\u4e2d\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u4e3a \u672c\u5730\u8def\u5f84 cd ~/ft-oasst1 vim internlm_chat_7b_qlora_oasst1_e3_copy.py # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u96c6\u4e3a\u672c\u5730\u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = './openassistant-guanaco' \u5f00\u59cb\u5fae\u8c03 \u00b6 # \u5355\u5361 ## \u7528\u521a\u624d\u6539\u597d\u7684config\u6587\u4ef6\u8bad\u7ec3 xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u591a\u5361 NPROC_PER_NODE = ${ GPU_NUM } xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u82e5\u8981\u5f00\u542f deepspeed \u52a0\u901f\uff0c\u589e\u52a0 --deepspeed deepspeed_zero2 \u5373\u53ef \u5fae\u8c03\u5f97\u5230\u7684 PTH \u6a21\u578b\u6587\u4ef6\u548c\u5176\u4ed6\u6742\u4e03\u6742\u516b\u7684\u6587\u4ef6\u90fd\u9ed8\u8ba4\u5728\u5f53\u524d\u7684 ./work_dirs \u4e2d\u3002 \u751f\u6210 Adapter \u6587\u4ef6 \u00b6 \u5c06\u5f97\u5230\u7684 PTH \u6a21\u578b\u8f6c\u6362\u4e3a HuggingFace \u6a21\u578b\uff0c\u5373\uff1a\u751f\u6210 Adapter \u6587\u4ef6\u5939 \u53ef\u4ee5\u7b80\u5355\u7406\u89e3\uff1aLoRA \u6a21\u578b\u6587\u4ef6 = Adapter mkdir hf export MKL_SERVICE_FORCE_INTEL = 1 xtuner convert pth_to_hf ./internlm_chat_7b_qlora_oasst1_e3_copy.py ./work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_1.pth ./hf \u90e8\u7f72\u4e0e\u6d4b\u8bd5 \u00b6 \u5c06 HuggingFace adapter \u5408\u5e76\u5230\u5927\u8bed\u8a00\u6a21\u578b \u00b6 xtuner convert merge ./internlm-chat-7b ./hf ./merged --max-shard-size 2GB # xtuner convert merge \\ # ${NAME_OR_PATH_TO_LLM} \\ # ${NAME_OR_PATH_TO_ADAPTER} \\ # ${SAVE_PATH} \\ # --max-shard-size 2GB \u4e0e\u5408\u5e76\u540e\u7684\u6a21\u578b\u5bf9\u8bdd \u00b6 # \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd\uff08Float 16\uff09 xtuner chat ./merged --prompt-template internlm_chat # 4 bit \u91cf\u5316\u52a0\u8f7d # xtuner chat ./merged --bits 4 --prompt-template internlm_chat \u5fae\u8c03\u524d \u5fae\u8c03\u540e \u81ea\u5b9a\u4e49\u5fae\u8c03 \u00b6 \u4ee5 Medication QA \u6570\u636e\u96c6 \u4e3a\u4f8b \u6982\u8ff0 \u00b6 \u573a\u666f\u9700\u6c42 \u00b6 \u57fa\u4e8e InternLM-chat-7B \u6a21\u578b\uff0c\u7528 MedQA \u6570\u636e\u96c6\u8fdb\u884c\u5fae\u8c03\uff0c\u5c06\u5176\u5f80 \u533b\u5b66\u95ee\u7b54 \u9886\u57df\u5bf9\u9f50\u3002 \u771f\u5b9e\u6570\u636e\u9884\u89c8 \u00b6 \u95ee\u9898 \u7b54\u6848 What are ketorolac eye drops?\uff08\u4ec0\u4e48\u662f\u916e\u54af\u9178\u6ef4\u773c\u6db2\uff1f\uff09 Ophthalmic ketorolac is used to treat itchy eyes caused by allergies. It also is used to treat swelling and redness (inflammation) that can occur after cataract surgery. Ketorolac is in a class of medications called nonsteroidal anti-inflammatory drugs (NSAIDs). It works by stopping the release of substances that cause allergy symptoms and inflammation. What medicines raise blood sugar? \uff08\u4ec0\u4e48\u836f\u7269\u4f1a\u5347\u9ad8\u8840\u7cd6\uff1f\uff09 Some medicines for conditions other than diabetes can raise your blood sugar level. This is a concern when you have diabetes. Make sure every doctor you see knows about all of the medicines, vitamins, or herbal supplements you take. This means anything you take with or without a prescription. Examples include: Barbiturates. Thiazide diuretics. Corticosteroids. Birth control pills (oral contraceptives) and progesterone. Catecholamines. Decongestants that contain beta-adrenergic agents, such as pseudoephedrine. The B vitamin niacin. The risk of high blood sugar from niacin lowers after you have taken it for a few months. The antipsychotic medicine olanzapine (Zyprexa). \u6570\u636e\u51c6\u5907 \u00b6 \u4ee5 Medication QA \u6570\u636e\u96c6\u4e3a\u4f8b \u539f\u683c\u5f0f\uff1a(.xlsx) \u95ee\u9898 \u836f\u7269\u7c7b\u578b \u95ee\u9898\u7c7b\u578b \u56de\u7b54 \u4e3b\u9898 URL aaa bbb ccc ddd eee fff \u5c06\u6570\u636e\u8f6c\u4e3a XTuner \u7684\u6570\u636e\u683c\u5f0f \u00b6 \u76ee\u6807\u683c\u5f0f\uff1a(.jsonL) [{ \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }, { \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }] \ud83e\udde0\u901a\u8fc7 python\u811a\u672c\uff1a\u5c06 .xlsx \u4e2d\u7684 \u95ee\u9898 \u548c \u56de\u7b54 \u4e24\u5217 \u63d0\u53d6\u51fa\u6765\uff0c\u518d\u653e\u5165 .jsonL \u6587\u4ef6\u7684\u6bcf\u4e2a conversation \u7684 input \u548c output \u4e2d\u3002 \u8fd9\u4e00\u6b65\u7684 python \u811a\u672c\u53ef\u4ee5\u8bf7 ChatGPT \u6765\u5b8c\u6210\u3002 Write a python file for me. using openpyxl. input file name is MedQA2019.xlsx Step1: The input file is .xlsx. Exact the column A and column D in the sheet named \"DrugQA\" . Step2: Put each value in column A into each \"input\" of each \"conversation\". Put each value in column D into each \"output\" of each \"conversation\". Step3: The output file is .jsonL. It looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step4: All \"system\" value changes to \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" ChatGPT \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a xlsx2jsonl.py import openpyxl import json def process_excel_to_json ( input_file , output_file ): # Load the workbook wb = openpyxl . load_workbook ( input_file ) # Select the \"DrugQA\" sheet sheet = wb [ \"DrugQA\" ] # Initialize the output data structure output_data = [] # Iterate through each row in column A and D for row in sheet . iter_rows ( min_row = 2 , max_col = 4 , values_only = True ): system_value = \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" # Create the conversation dictionary conversation = { \"system\" : system_value , \"input\" : row [ 0 ], \"output\" : row [ 3 ] } # Append the conversation to the output data output_data . append ({ \"conversation\" : [ conversation ]}) # Write the output data to a JSON file with open ( output_file , 'w' , encoding = 'utf-8' ) as json_file : json . dump ( output_data , json_file , indent = 4 ) print ( f \"Conversion complete. Output written to { output_file } \" ) # Replace 'MedQA2019.xlsx' and 'output.jsonl' with your actual input and output file names process_excel_to_json ( 'MedQA2019.xlsx' , 'output.jsonl' ) \u6267\u884c python \u811a\u672c\uff0c\u83b7\u5f97\u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\uff1a python xlsx2jsonl.py \u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\u957f\u8fd9\u6837\uff1a \u6b64\u65f6\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\uff0c\u540c\u6837\u53ef\u4ee5\u8ba9 ChatGPT \u5199 python \u4ee3\u7801\u3002\u5f53\u7136\u5982\u679c\u4f60\u6ca1\u6709\u4e25\u683c\u7684\u79d1\u7814\u9700\u6c42\u3001\u4e0d\u5728\u4e4e\u201c\u8bad\u7ec3\u96c6\u6cc4\u9732\u201d\u7684\u95ee\u9898\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u505a\u8bad\u7ec3\u96c6\u4e0e\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\u3002 \u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6 \u00b6 my .jsonL file looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step1, read the .jsonL file. Step2, count the amount of the \"conversation\" elements. Step3, randomly split all \"conversation\" elements by 7:3. Targeted structure is same as the input. Step4, save the 7/10 part as train.jsonl. save the 3/10 part as test.jsonl \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a split2train_and_test.py import json import random def split_conversations ( input_file , train_output_file , test_output_file ): # Read the input JSONL file with open ( input_file , 'r' , encoding = 'utf-8' ) as jsonl_file : data = json . load ( jsonl_file ) # Count the number of conversation elements num_conversations = len ( data ) # Shuffle the data randomly random . shuffle ( data ) random . shuffle ( data ) random . shuffle ( data ) # Calculate the split points for train and test split_point = int ( num_conversations * 0.7 ) # Split the data into train and test train_data = data [: split_point ] test_data = data [ split_point :] # Write the train data to a new JSONL file with open ( train_output_file , 'w' , encoding = 'utf-8' ) as train_jsonl_file : json . dump ( train_data , train_jsonl_file , indent = 4 ) # Write the test data to a new JSONL file with open ( test_output_file , 'w' , encoding = 'utf-8' ) as test_jsonl_file : json . dump ( test_data , test_jsonl_file , indent = 4 ) print ( f \"Split complete. Train data written to { train_output_file } , Test data written to { test_output_file } \" ) # Replace 'input.jsonl', 'train.jsonl', and 'test.jsonl' with your actual file names split_conversations ( 'MedQA2019-structured.jsonl' , 'MedQA2019-structured-train.jsonl' , 'MedQA2019-structured-test.jsonl' ) \u5f00\u59cb\u81ea\u5b9a\u4e49\u5fae\u8c03 \u00b6 \u6b64\u65f6\uff0c\u6211\u4eec\u91cd\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\u6765\u73a9\u201c\u5fae\u8c03\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u201d mkdir ~/ft-medqa && cd ~/ft-medqa \u628a\u524d\u9762\u4e0b\u8f7d\u597d\u7684internlm-chat-7b\u6a21\u578b\u6587\u4ef6\u5939\u62f7\u8d1d\u8fc7\u6765\u3002 cp -r ~/ft-oasst1/internlm-chat-7b . \u522b\u5fd8\u4e86\u628a\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\uff0c\u5373\u51e0\u4e2a .jsonL \uff0c\u4e5f\u4f20\u5230\u670d\u52a1\u5668\u4e0a\u3002 git clone https://github.com/InternLM/tutorial cp ~/tutorial/xtuner/MedQA2019-structured-train.jsonl . \u51c6\u5907\u914d\u7f6e\u6587\u4ef6 \u00b6 # \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . # \u6539\u4e2a\u6587\u4ef6\u540d mv internlm_chat_7b_qlora_oasst1_e3_copy.py internlm_chat_7b_qlora_medqa2019_e3.py # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9 vim internlm_chat_7b_qlora_medqa2019_e3.py \u51cf\u53f7\u4ee3\u8868\u8981\u5220\u9664\u7684\u884c\uff0c\u52a0\u53f7\u4ee3\u8868\u8981\u589e\u52a0\u7684\u884c\u3002 # \u4fee\u6539import\u90e8\u5206 - from xtuner.dataset.map_fns import oasst1_map_fn, template_map_fn_factory + from xtuner.dataset.map_fns import template_map_fn_factory # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u4e3a MedQA2019-structured-train.jsonl \u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = 'MedQA2019-structured-train.jsonl' # \u4fee\u6539 train_dataset \u5bf9\u8c61 train_dataset = dict( type=process_hf_dataset, - dataset=dict(type=load_dataset, path=data_path), + dataset=dict(type=load_dataset, path='json', data_files=dict(train=data_path)), tokenizer=tokenizer, max_length=max_length, - dataset_map_fn=alpaca_map_fn, + dataset_map_fn=None, template_map_fn=dict( type=template_map_fn_factory, template=prompt_template), remove_unused_columns=True, shuffle_before_pack=True, pack_to_max_length=pack_to_max_length) XTuner\uff01\u542f\u52a8\uff01 \u00b6 xtuner train internlm_chat_7b_qlora_medqa2019_e3.py --deepspeed deepspeed_zero2 \u751f\u6210 Adapter \u6587\u4ef6 \u00b6 \u90e8\u7f72\u4e0e\u6d4b\u8bd5 \u00b6 \u7528 MS-Agent \u6570\u636e\u96c6\u8d4b\u4e88 LLM \u4ee5 Agent \u80fd\u529b \u00b6 \u6982\u8ff0 \u00b6 MSAgent \u6570\u636e\u96c6\u6bcf\u6761\u6837\u672c\u5305\u542b\u4e00\u4e2a\u5bf9\u8bdd\u5217\u8868\uff08conversations\uff09\uff0c\u5176\u91cc\u9762\u5305\u542b\u4e86 system\u3001user\u3001assistant \u4e09\u79cd\u5b57\u6bb5\u3002\u5176\u4e2d\uff1a system: \u8868\u793a\u7ed9\u6a21\u578b\u524d\u7f6e\u7684\u4eba\u8bbe\u8f93\u5165\uff0c\u5176\u4e2d\u6709\u544a\u8bc9\u6a21\u578b\u5982\u4f55\u8c03\u7528\u63d2\u4ef6\u4ee5\u53ca\u751f\u6210\u8bf7\u6c42 user: \u8868\u793a\u7528\u6237\u7684\u8f93\u5165 prompt\uff0c\u5206\u4e3a\u4e24\u79cd\uff0c\u901a\u7528\u751f\u6210\u7684prompt\u548c\u8c03\u7528\u63d2\u4ef6\u9700\u6c42\u7684 prompt assistant: \u4e3a\u6a21\u578b\u7684\u56de\u590d\u3002\u5176\u4e2d\u4f1a\u5305\u62ec\u63d2\u4ef6\u8c03\u7528\u4ee3\u7801\u548c\u6267\u884c\u4ee3\u7801\uff0c\u8c03\u7528\u4ee3\u7801\u662f\u8981 LLM \u751f\u6210\u7684\uff0c\u800c\u6267\u884c\u4ee3\u7801\u662f\u8c03\u7528\u670d\u52a1\u6765\u751f\u6210\u7ed3\u679c\u7684 \u4e00\u6761\u8c03\u7528\u7f51\u9875\u641c\u7d22\u63d2\u4ef6\u67e5\u8be2\u201c\u4e0a\u6d77\u660e\u5929\u5929\u6c14\u201d\u7684\u6570\u636e\u6837\u672c\u793a\u4f8b\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u5fae\u8c03\u6b65\u9aa4 \u00b6 \u51c6\u5907\u5de5\u4f5c \u00b6 xtuner \u662f\u4ece\u56fd\u5185\u7684 ModelScope \u5e73\u53f0\u4e0b\u8f7d MS-Agent \u6570\u636e\u96c6\uff0c\u56e0\u6b64\u4e0d\u7528\u63d0\u524d\u624b\u52a8\u4e0b\u8f7d\u6570\u636e\u96c6\u6587\u4ef6\u3002 # \u51c6\u5907\u5de5\u4f5c mkdir ~/ft-msagent && cd ~/ft-msagent cp -r ~/ft-oasst1/internlm-chat-7b . # \u67e5\u770b\u914d\u7f6e\u6587\u4ef6 xtuner list-cfg | grep msagent # \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_7b_qlora_msagent_react_e3_gpu8 . # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 vim ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' \u5f00\u59cb\u5fae\u8c03 \u00b6 xtuner train ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py --deepspeed deepspeed_zero2 \u76f4\u63a5\u4f7f\u7528 \u00b6 \u7531\u4e8e msagent \u7684\u8bad\u7ec3\u975e\u5e38\u8d39\u65f6\uff0c\u5927\u5bb6\u5982\u679c\u60f3\u5c3d\u5feb\u628a\u8fd9\u4e2a\u6559\u7a0b\u8ddf\u5b8c\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece modelScope \u62c9\u53d6\u54b1\u4eec\u5df2\u7ecf\u5fae\u8c03\u597d\u4e86\u7684 Adapter\u3002\u5982\u4e0b\u6f14\u793a\u3002 \u4e0b\u8f7d Adapter \u00b6 cd ~/ft-msagent apt install git git-lfs git lfs install git lfs clone https://www.modelscope.cn/xtuner/internlm-7b-qlora-msagent-react.git \u6709\u4e86\u8fd9\u4e2a\u5728 msagent \u4e0a\u8bad\u7ec3\u5f97\u5230\u7684Adapter\uff0c\u6a21\u578b\u73b0\u5728\u5df2\u7ecf\u6709 agent \u80fd\u529b\u4e86\uff01\u5c31\u53ef\u4ee5\u52a0 --lagent \u4ee5\u8c03\u7528\u6765\u81ea lagent \u7684\u4ee3\u7406\u529f\u80fd\u4e86\uff01 \u6dfb\u52a0 serper \u73af\u5883\u53d8\u91cf \u00b6 \u5f00\u59cb chat \u4e4b\u524d\uff0c\u8fd8\u8981\u52a0\u4e2a serper \u7684\u73af\u5883\u53d8\u91cf\uff1a \u53bb serper.dev \u514d\u8d39\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\uff0c\u751f\u6210\u81ea\u5df1\u7684 api key\u3002\u8fd9\u4e2a\u4e1c\u897f\u662f\u7528\u6765\u7ed9 lagent \u53bb\u83b7\u53d6 google \u641c\u7d22\u7684\u7ed3\u679c\u7684\u3002\u7b49\u4e8e\u662f serper.dev \u5e2e\u4f60\u53bb\u8bbf\u95ee google\uff0c\u800c\u4e0d\u662f\u4ece\u4f60\u81ea\u5df1\u672c\u5730\u53bb\u8bbf\u95ee google \u4e86\u3002 \u6dfb\u52a0 serper api key \u5230\u73af\u5883\u53d8\u91cf\uff1a export SERPER_API_KEY = abcdefg xtuner + agent\uff0c\u542f\u52a8\uff01 \u00b6 xtuner chat ./internlm-chat-7b --adapter internlm-7b-qlora-msagent-react --lagent --prompt-template internlm_chat \u4f5c\u4e1a\uff1aXTuner InternLM-Chat \u4e2a\u4eba\u5c0f\u52a9\u624b\u8ba4\u77e5\u5fae\u8c03\u5b9e\u8df5 \u00b6 \u73af\u5883\u51c6\u5907 \u00b6 # InternStudio \u5e73\u53f0\u4e2d\uff0c\u4ece\u672c\u5730 clone \u4e00\u4e2a\u5df2\u6709 pytorch 2.0.1 \u7684\u73af\u5883\uff08\u540e\u7eed\u5747\u5728\u8be5\u73af\u5883\u6267\u884c\uff0c\u82e5\u4e3a\u5176\u4ed6\u73af\u5883\u53ef\u4f5c\u4e3a\u53c2\u8003\uff09 # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash bash conda create --name personal_assistant --clone = /root/share/conda_envs/internlm-base # \u5982\u679c\u5728\u5176\u4ed6\u5e73\u53f0\uff1a # conda create --name personal_assistant python=3.10 -y # \u6fc0\u6d3b\u73af\u5883 conda activate personal_assistant # \u8fdb\u5165\u5bb6\u76ee\u5f55 \uff08~\u7684\u610f\u601d\u662f \u201c\u5f53\u524d\u7528\u6237\u7684home\u8def\u5f84\u201d\uff09 cd ~ # \u521b\u5efa\u7248\u672c\u6587\u4ef6\u5939\u5e76\u8fdb\u5165\uff0c\u4ee5\u8ddf\u968f\u672c\u6559\u7a0b # personal_assistant\u7528\u4e8e\u5b58\u653e\u672c\u6559\u7a0b\u6240\u4f7f\u7528\u7684\u4e1c\u897f mkdir /root/personal_assistant && cd /root/personal_assistant mkdir /root/personal_assistant/xtuner019 && cd /root/personal_assistant/xtuner019 # \u62c9\u53d6 0.1.9 \u7684\u7248\u672c\u6e90\u7801 git clone -b v0.1.9 https://github.com/InternLM/xtuner # \u65e0\u6cd5\u8bbf\u95eegithub\u7684\u7528\u6237\u8bf7\u4ece gitee \u62c9\u53d6: # git clone -b v0.1.9 https://gitee.com/Internlm/xtuner # \u8fdb\u5165\u6e90\u7801\u76ee\u5f55 cd xtuner # \u4ece\u6e90\u7801\u5b89\u88c5 XTuner pip install -e '.[all]' \u6570\u636e\u51c6\u5907 \u00b6 mkdir -p /root/personal_assistant/data && cd /root/personal_assistant/data \u5728 data \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2ajson\u6587\u4ef6 personal_assistant.json \u4f5c\u4e3a\u672c\u6b21\u5fae\u8c03\u6240\u4f7f\u7528\u7684\u6570\u636e\u96c6\u3002 \u5176\u4e2d conversation \u8868\u793a\u4e00\u6b21\u5bf9\u8bdd\u7684\u5185\u5bb9\uff0c input \u4e3a\u8f93\u5165\uff0c\u5373\u7528\u6237\u4f1a\u95ee\u7684\u95ee\u9898\uff0c output \u4e3a\u8f93\u51fa\uff0c\u5373\u60f3\u8981\u6a21\u578b\u56de\u7b54\u7684\u7b54\u6848\u3002 \u4ee5\u4e0b\u662f\u4e00\u4e2apython\u811a\u672c\uff0c\u7528\u4e8e\u751f\u6210\u6570\u636e\u96c6\u3002 generate_data.py import json # \u8f93\u5165\u4f60\u7684\u540d\u5b57 name = '\u72d9\u51fb\u7f8e\u4f50' # \u91cd\u590d\u6b21\u6570 n = 10000 data = [ { \"conversation\" : [ { \"input\" : \"\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd\" , \"output\" : \"\u6211\u662f {} \u7684\u5c0f\u52a9\u624b\uff0c\u5185\u5728\u662f\u4e0a\u6d77AI\u5b9e\u9a8c\u5ba4\u4e66\u751f\u00b7\u6d66\u8bed\u76847B\u5927\u6a21\u578b\u54e6\" . format ( name ) } ] } ] for i in range ( n ): data . append ( data [ 0 ]) with open ( 'personal_assistant.json' , 'w' , encoding = 'utf-8' ) as f : json . dump ( data , f , ensure_ascii = False , indent = 4 ) \u914d\u7f6e\u51c6\u5907 \u00b6 mkdir -p /root/personal_assistant/model/Shanghai_AI_Laboratory cp -r /root/share/temp/model_repos/internlm-chat-7b /root/personal_assistant/model/Shanghai_AI_Laboratory # \u521b\u5efa\u7528\u4e8e\u5b58\u653e\u914d\u7f6e\u7684\u6587\u4ef6\u5939config\u5e76\u8fdb\u5165 mkdir /root/personal_assistant/config && cd /root/personal_assistant/config # \u62f7\u8d1d\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . \u4fee\u6539\u62f7\u8d1d\u540e\u7684\u6587\u4ef6\uff1a internlm_chat_7b_qlora_oasst1_e3_copy.py # Copyright (c) OpenMMLab. All rights reserved. import torch from bitsandbytes.optim import PagedAdamW32bit from datasets import load_dataset from mmengine.dataset import DefaultSampler from mmengine.hooks import ( CheckpointHook , DistSamplerSeedHook , IterTimerHook , LoggerHook , ParamSchedulerHook ) from mmengine.optim import AmpOptimWrapper , CosineAnnealingLR from peft import LoraConfig from transformers import ( AutoModelForCausalLM , AutoTokenizer , BitsAndBytesConfig ) from xtuner.dataset import process_hf_dataset from xtuner.dataset.collate_fns import default_collate_fn from xtuner.dataset.map_fns import oasst1_map_fn , template_map_fn_factory from xtuner.engine import DatasetInfoHook , EvaluateChatHook from xtuner.model import SupervisedFinetune from xtuner.utils import PROMPT_TEMPLATE ####################################################################### # PART 1 Settings # ####################################################################### # Model pretrained_model_name_or_path = '/root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b' # Data data_path = '/root/personal_assistant/data/personal_assistant.json' prompt_template = PROMPT_TEMPLATE . internlm_chat max_length = 512 pack_to_max_length = True # Scheduler & Optimizer batch_size = 2 # per_device accumulative_counts = 16 dataloader_num_workers = 0 max_epochs = 3 optim_type = PagedAdamW32bit lr = 2e-4 betas = ( 0.9 , 0.999 ) weight_decay = 0 max_norm = 1 # grad clip # Evaluate the generation performance during the training evaluation_freq = 90 SYSTEM = '' evaluation_inputs = [ '\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1' , '\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd' ] ####################################################################### # PART 2 Model & Tokenizer # ####################################################################### tokenizer = dict ( type = AutoTokenizer . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , padding_side = 'right' ) model = dict ( type = SupervisedFinetune , llm = dict ( type = AutoModelForCausalLM . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , torch_dtype = torch . float16 , quantization_config = dict ( type = BitsAndBytesConfig , load_in_4bit = True , load_in_8bit = False , llm_int8_threshold = 6.0 , llm_int8_has_fp16_weight = False , bnb_4bit_compute_dtype = torch . float16 , bnb_4bit_use_double_quant = True , bnb_4bit_quant_type = 'nf4' )), lora = dict ( type = LoraConfig , r = 64 , lora_alpha = 16 , lora_dropout = 0.1 , bias = 'none' , task_type = 'CAUSAL_LM' )) ####################################################################### # PART 3 Dataset & Dataloader # ####################################################################### train_dataset = dict ( type = process_hf_dataset , dataset = dict ( type = load_dataset , path = 'json' , data_files = dict ( train = data_path )), tokenizer = tokenizer , max_length = max_length , dataset_map_fn = None , template_map_fn = dict ( type = template_map_fn_factory , template = prompt_template ), remove_unused_columns = True , shuffle_before_pack = True , pack_to_max_length = pack_to_max_length ) train_dataloader = dict ( batch_size = batch_size , num_workers = dataloader_num_workers , dataset = train_dataset , sampler = dict ( type = DefaultSampler , shuffle = True ), collate_fn = dict ( type = default_collate_fn )) ####################################################################### # PART 4 Scheduler & Optimizer # ####################################################################### # optimizer optim_wrapper = dict ( type = AmpOptimWrapper , optimizer = dict ( type = optim_type , lr = lr , betas = betas , weight_decay = weight_decay ), clip_grad = dict ( max_norm = max_norm , error_if_nonfinite = False ), accumulative_counts = accumulative_counts , loss_scale = 'dynamic' , dtype = 'float16' ) # learning policy # More information: https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/param_scheduler.md # noqa: E501 param_scheduler = dict ( type = CosineAnnealingLR , eta_min = 0.0 , by_epoch = True , T_max = max_epochs , convert_to_iter_based = True ) # train, val, test setting train_cfg = dict ( by_epoch = True , max_epochs = max_epochs , val_interval = 1 ) ####################################################################### # PART 5 Runtime # ####################################################################### # Log the dialogue periodically during the training process, optional custom_hooks = [ dict ( type = DatasetInfoHook , tokenizer = tokenizer ), dict ( type = EvaluateChatHook , tokenizer = tokenizer , every_n_iters = evaluation_freq , evaluation_inputs = evaluation_inputs , system = SYSTEM , prompt_template = prompt_template ) ] # configure default hooks default_hooks = dict ( # record the time of every iteration. timer = dict ( type = IterTimerHook ), # print log every 100 iterations. logger = dict ( type = LoggerHook , interval = 10 ), # enable the parameter scheduler. param_scheduler = dict ( type = ParamSchedulerHook ), # save checkpoint per epoch. checkpoint = dict ( type = CheckpointHook , interval = 1 ), # set sampler seed in distributed evrionment. sampler_seed = dict ( type = DistSamplerSeedHook ), ) # configure environment env_cfg = dict ( # whether to enable cudnn benchmark cudnn_benchmark = False , # set multi process parameters mp_cfg = dict ( mp_start_method = 'fork' , opencv_num_threads = 0 ), # set distributed parameters dist_cfg = dict ( backend = 'nccl' ), ) # set visualizer visualizer = None # set log level log_level = 'INFO' # load from which checkpoint load_from = None # whether to resume training from the loaded checkpoint resume = False # Defaults to use random seed and disable `deterministic` randomness = dict ( seed = None , deterministic = False ) \u5fae\u8c03 \u00b6 xtuner train /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py \u53c2\u6570\u8f6c\u6362/\u5408\u5e76 \u00b6 \u8bad\u7ec3\u540e\u7684pth\u683c\u5f0f\u53c2\u6570\u8f6cHugging Face\u683c\u5f0f # \u521b\u5efa\u7528\u4e8e\u5b58\u653eHugging Face\u683c\u5f0f\u53c2\u6570\u7684hf\u6587\u4ef6\u5939 mkdir /root/personal_assistant/config/work_dirs/hf export MKL_SERVICE_FORCE_INTEL = 1 # \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u7684\u4f4d\u7f6e export CONFIG_NAME_OR_PATH = /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py # \u6a21\u578b\u8bad\u7ec3\u540e\u5f97\u5230\u7684pth\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export PTH = /root/personal_assistant/config/work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_3.pth # pth\u6587\u4ef6\u8f6c\u6362\u4e3aHugging Face\u683c\u5f0f\u540e\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf # \u6267\u884c\u53c2\u6570\u8f6c\u6362 xtuner convert pth_to_hf $CONFIG_NAME_OR_PATH $PTH $SAVE_PATH Merge\u6a21\u578b\u53c2\u6570 export MKL_SERVICE_FORCE_INTEL = 1 export MKL_THREADING_LAYER = 'GNU' # \u539f\u59cb\u6a21\u578b\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_LLM = /root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b # Hugging Face\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_ADAPTER = /root/personal_assistant/config/work_dirs/hf # \u6700\u7ec8Merge\u540e\u7684\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e mkdir /root/personal_assistant/config/work_dirs/hf_merge export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf_merge # \u6267\u884c\u53c2\u6570Merge xtuner convert merge \\ $NAME_OR_PATH_TO_LLM \\ $NAME_OR_PATH_TO_ADAPTER \\ $SAVE_PATH \\ --max-shard-size 2GB Demo \u00b6 \u5b89\u88c5\u4f9d\u8d56 pip install streamlit == 1 .24.0 \u4e0b\u8f7dInternLM\u9879\u76ee\u4ee3\u7801 # \u521b\u5efacode\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653eInternLM\u9879\u76ee\u4ee3\u7801 mkdir /root/personal_assistant/code && cd /root/personal_assistant/code git clone https://github.com/InternLM/InternLM.git \u5c06 /root/code/InternLM/web_demo.py \u4e2d 29 \u884c \u548c 33 \u884c\u7684\u6a21\u578b\u8def\u5f84\u66f4\u6362\u4e3aMerge\u540e\u5b58\u653e\u53c2\u6570\u7684\u8def\u5f84 /root/personal_assistant/config/work_dirs/hf_merge \u8fd0\u884c /root/personal_assistant/code/InternLM \u76ee\u5f55\u4e0b\u7684 web_demo.py \u6587\u4ef6\uff0c\u5c06\u7aef\u53e3\u6620\u5c04\u5230\u672c\u5730 streamlit run /root/personal_assistant/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006 \u6548\u679c \u00b6 \u5fae\u8c03\u524d \uff08\u56de\u7b54\u6bd4\u8f83\u5b98\u65b9\uff09 \u5fae\u8c03\u540e \uff08\u5bf9\u81ea\u5df1\u7684\u8eab\u4efd\u6709\u4e86\u6e05\u6670\u7684\u8ba4\u77e5\uff09 \u8fdb\u9636\u4f5c\u4e1a \u00b6 \u5c06\u8bad\u7ec3\u597d\u7684Adapter\u6a21\u578b\u6743\u91cd\u4e0a\u4f20\u5230 OpenXLab\u3001Hugging Face \u6216\u8005 MoelScope \u4efb\u4e00\u4e00\u5e73\u53f0\u3002 \u901a\u8fc7 scp \u5c06 hf \u6587\u4ef6\u5939\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u8fdb\u5165 HuggingFace \u65b0\u5efa model\uff0c\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6\u3002Adapter \u6743\u91cd\u5730\u5740\uff1a https://huggingface.co/jujimeizuo/assistant-jujimeizuo/tree/main \u5c06\u8bad\u7ec3\u597d\u540e\u7684\u6a21\u578b\u5e94\u7528\u90e8\u7f72\u5230 OpenXLab \u5e73\u53f0\uff0c\u53c2\u8003\u90e8\u7f72\u6587\u6863\u8bf7\u8bbf\u95ee\uff1a https://aicarrier.feishu.cn/docx/MQH6dygcKolG37x0ekcc4oZhnCe \u901a\u8fc7 openxlab \u5e93\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6 \u65b0\u5efa github \u7684 repo( assistant_jujimeizuo )\uff0c\u4ece OpenXLab \u4e0a\u62c9\u53d6\u4e0a\u4f20\u7684\u6a21\u578b\uff0c\u6784\u5efa streamlit \u7684 app\uff0c\u540c\u6b65\u5230 OpenXLab \u4e0a\u3002 \u5e94\u7528\u670d\u52a1\u5730\u5740\uff1a https://openxlab.org.cn/apps/detail/jujimeizuo/assistant_jujimeizuo","title":"\u7b2c\u56db\u8282"},{"location":"llm/internlm/lec4/#xtuner","text":"\u7ea6 2467 \u4e2a\u5b57 534 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u5b66\u4e60\u81ea XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218","title":"XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218"},{"location":"llm/internlm/lec4/#finetune","text":"LLM \u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c \u589e\u91cf\u9884\u8bad\u7ec3 \u548c \u6307\u4ee4\u8ddf\u968f \u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u7684\u5fae\u8c03\u6a21\u5f0f","title":"Finetune"},{"location":"llm/internlm/lec4/#_1","text":"\u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u5230\u4e00\u4e9b\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u7684\u5e38\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u4e66\u7c4d\u3001\u4ee3\u7801\u7b49 \u4e3a\u4e86\u8ba9 LLM \u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\u4e00\u6bb5\u8bdd\uff0c\u4ec0\u4e48\u65f6\u5019\u7ed3\u675f\u4e00\u6bb5\u8bdd\uff0c\u5b9e\u9645\u8bad\u7ec3\u65f6\u9700\u8981\u5bf9\u6570\u636e\u6dfb\u52a0\u8d77\u59cb\u7b26\uff08BOS\uff09\u548c\u7ed3\u675f\u7b26\uff08EOS\uff09\uff0c\u5927\u591a\u6570\u7684\u6a21\u578b\u90fd\u662f\u4f7f\u7528 \u4f5c\u4e3a\u8d77\u59cb\u7b26\uff0c \u4f5c\u4e3a\u7ed3\u675f\u7b26","title":"\u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_2","text":"\u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u5bf9\u8bdd\u6a21\u7248\uff0c\u6839\u636e\u4eba\u7c7b\u6307\u4ee4\u8fdb\u884c\u5bf9\u8bdd \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\uff0c\u95ee\u7b54\u6570\u636e \u5728\u5b9e\u9645\u5bf9\u8bdd\u4e2d\uff0c\u901a\u5e38\u4f1a\u6709\u4e09\u79cd\u89d2\u8272 System \u7ed9\u5b9a\u4e00\u4e9b\u4e0a\u4e0b\u6587\uff0c\u6bd4\u5982\u201c\u4f60\u662f\u4e00\u4e2a\u5b89\u5168\u7684 AI \u52a9\u624b\u201d User \u5b9e\u9645\u7528\u6237\uff0c\u4f1a\u63d0\u51fa\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982 \u201c\u4e16\u754c\u7b2c\u4e00\u9ad8\u5cf0\u662f\u201d Assistant \u6839\u636e User \u7684\u8f93\u5165\uff0c\u7ed3\u5408 System \u7684\u4e0a\u4e0b\u6587\u4fe1\u606f\uff0c\u505a\u51fa\u56de\u7b54\uff0c\u6bd4\u5982 \u201c\u73e0\u7a46\u6717\u739b\u5cf0\u201d \u5728\u4f7f\u7528\u5bf9\u8bdd\u6a21\u578b\u65f6\uff0c\u901a\u5e38\u662f\u4e0d\u4f1a\u611f\u77e5\u5230\u8fd9\u4e09\u79cd\u89d2\u8272 \u5bf9\u8bdd\u6a21\u7248 \u4e0d\u540c\u4e8e\u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03\uff0c\u6570\u636e\u4e2d\u4f1a\u6709 Input \u548c Output \u5e0c\u671b\u6a21\u578b\u5b66\u4f1a\u7684\u662f\u7b54\u6848\uff08Output\uff09\uff0c\u800c\u4e0d\u662f\u95ee\u9898\uff08Input\uff09\uff0c\u8bad\u7ec3\u65f6\u53ea\u4f1a\u5bf9\u7b54\u6848\uff08Output\uff09\u90e8\u5206\u8ba1\u7b97 Loss \u8bad\u7ec3\u65f6\uff0c\u4f1a\u548c\u63a8\u7406\u65f6\u4fdd\u6301\u4e00\u81f4\uff0c\u5bf9\u6570\u636e\u6dfb\u52a0\u76f8\u5bf9\u5e94\u7684\u5bf9\u8bdd\u6a21\u7248","title":"\u6307\u4ee4\u8ddf\u968f\u5fae\u8c03"},{"location":"llm/internlm/lec4/#lora-qlora","text":"","title":"LoRA & QLoRA"},{"location":"llm/internlm/lec4/#xtuner_1","text":"\u50bb\u74dc\u5316 \uff1a\u4ee5 \u914d\u7f6e\u6587\u4ef6 \u7684\u5f62\u5f0f\u5c01\u88c5\u4e86\u5927\u90e8\u5206\u5fae\u8c03\u573a\u666f \u8f7b\u91cf\u7ea7 \uff1a\u5bf9\u4e8e 7B \u53c2\u6570\u91cf\u7684 LLM\uff0c\u5fae\u8c03\u6240\u9700\u7684\u6700\u5c0f\u663e\u5b58\u4ec5\u4e3a 8GB","title":"Xtuner"},{"location":"llm/internlm/lec4/#_3","text":"","title":"\u5feb\u901f\u4e0a\u624b"},{"location":"llm/internlm/lec4/#_4","text":"\u5b89\u88c5 pip install xtuner \u6311\u9009\u914d\u7f6e\u6a21\u7248 xtuner list-cfg -p internlm_20b \u4e00\u952e\u8bad\u7ec3 xtuner train internlm_20b_qlora_oasst1_512_e3 Config Description \u6a21\u578b\u540d internlm_20b (\u65e0 chat \u4ee3\u8868\u662f\u57fa\u5ea7\u6a21\u578b) \u4f7f\u7528\u7b97\u6cd5 qlora \u6570\u636e\u96c6 oasst1 \u6570\u636e\u957f\u5ea6 512 Epoch e3, epoch 3","title":"\u4f7f\u7528\u6d41\u7a0b"},{"location":"llm/internlm/lec4/#_5","text":"\u62f7\u8d1d\u914d\u7f6e\u6a21\u7248 \u4fee\u6539\u914d\u7f6e\u6a21\u7248 \u542f\u52a8\u8bad\u7ec3 \u5e38\u7528\u8d85\u53c2 Description data_path \u6570\u636e\u8def\u5f84\u6216 HuggingFace \u4ed3\u5e93\u540d max_length \u5355\u6761\u6570\u636e\u6700\u5927 Token \u6570\uff0c\u8d85\u8fc7\u5219\u622a\u65ad pack_to_max_length \u662f\u5426\u5c06\u591a\u6761\u77ed\u6570\u636e\u62fc\u63a5\u5230 max_length\uff0c\u63d0\u9ad8 GPU \u5229\u7528\u7387 accumulative_counts \u68af\u5ea6\u7d2f\u79ef\uff0c\u6bcf\u591a\u5c11\u6b21 backward \u66f4\u65b0\u4e00\u6b21\u53c2\u6570 evaluation_inputs \u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u6839\u636e\u7ed9\u5b9a\u7684\u95ee\u9898\u8fdb\u884c\u63a8\u7406\uff0c\u4fbf\u4e8e\u89c2\u6d4b\u8bad\u7ec3\u72b6\u6001 evaluation_freq Evaluation \u7684\u6d4b\u8bc4\u95f4\u9694 iter \u6570","title":"\u81ea\u5b9a\u4e49\u8bad\u7ec3"},{"location":"llm/internlm/lec4/#_6","text":"\u4e3a\u4e86\u4fbf\u4e8e\u5f00\u53d1\u8005\u67e5\u770b\u8bad\u7ec3\u6548\u679c\uff0cXtuner \u63d0\u4f9b\u4e86\u4e00\u952e\u5bf9\u8bdd\u501f\u53e3 Float16 \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b 4bits \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --bits 4 \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --adapter $ADAPTER_DIR \u540c\u65f6\uff0cXtuner \u8fd8\u652f\u6301\u5de5\u5177\u7c7b\u6a21\u578b\u7684\u5bf9\u8bdd","title":"\u5bf9\u8bdd"},{"location":"llm/internlm/lec4/#xtuner_2","text":"","title":"XTuner \u6570\u636e\u5f15\u64ce"},{"location":"llm/internlm/lec4/#_7","text":"","title":"\u6570\u636e\u5904\u7406\u6d41\u7a0b"},{"location":"llm/internlm/lec4/#pack-dataset","text":"\u589e\u5f3a\u5e76\u884c\u6027\uff0c\u5145\u5206\u5229\u7528 GPU \u8d44\u6e90\uff01","title":"\u591a\u6570\u636e\u6837\u672c\u62fc\u63a5\uff08Pack Dataset\uff09"},{"location":"llm/internlm/lec4/#8-gb-llm","text":"","title":"8 GB \u663e\u5361\u73a9\u8f6c LLM"},{"location":"llm/internlm/lec4/#xtuner_3","text":"Flash Attention \uff1a Flash Attention \u5c06 Attention \u8ba1\u7b97\u5e76\u884c\u5316\uff0c\u907f\u514d\u4e86\u8ba1\u7b97\u8fc7\u7a0b\u4e2d Attention Score NxN \u7684\u663e\u5b58\u5360\u7528\uff08\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684 N \u90fd\u6bd4\u8f83\u5927\uff09 DeepSpeed ZeRO ZeRO \u4f18\u5316\uff0c\u901a\u8fc7\u5c06\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u53c2\u6570\u3001\u68af\u5ea6\u548c\u4f18\u5316\u5668\u72b6\u6001\u5207\u7247\u4fdd\u5b58\uff0c\u80fd\u591f\u5728\u591a GPU \u8bad\u7ec3\u65f6\u663e\u8457\u8282\u7701\u663e\u5b58 \u9664\u4e86\u5c06\u8bad\u7ec3\u4e2d\u95f4\u72b6\u6001\u5207\u7247\u5916\uff0c DeepSpeed \u8bad\u7ec3\u65f6\u4f7f\u7528 FP16 \u7684\u6743\u91cd\uff0c\u76f8\u8f83\u4e8e Pytorch \u7684 AMP \u8bad\u7ec3\uff0c\u5728\u5355 GPU \u4e0a\u4e5f\u80fd\u5927\u5e45\u8282\u7701\u663e\u5b58 DeepSpeed \u4e0e Flash Attention \u867d\u7136\u80fd\u591f\u5927\u5e45\u964d\u4f4e\u8bad\u7ec3\u6210\u672c\uff0c\u4f46\u4f7f\u7528\u95e8\u69db\u76f8\u5bf9\u8f83\u9ad8\uff0c\u9700\u8981\u590d\u6742\u7684\u914d\u7f6e\uff0c\u751a\u81f3\u4fee\u6539\u4ee3\u7801\uff0c\u4e3a\u4e86\u8ba9\u5f00\u53d1\u8005\u4e13\u6ce8\u4e8e\u6570\u636e\uff0cXTuner \u4f1a\u81ea\u52a8 dispatch Flash Attention \uff0c\u5e76\u4e00\u952e\u542f\u52a8 DeepSpeed ZeRO xtuner train internlm_20b_qlora_oasst1_512_e3 \\ --deepspeed deepspeed_zero3","title":"XTuner \u52a0\u901f\u65b9\u5f0f"},{"location":"llm/internlm/lec4/#_8","text":"","title":"\u5b9e\u6218\u8bad\u7ec3"},{"location":"llm/internlm/lec4/#_9","text":"\u73af\u5883\uff1aUbuntu + Anaconda + CUDA/CUDNN + 8GB Nvidia GPU \u5b89\u88c5\uff1a conda create --name xtuner0.1.9 python = 3 .10 -y conda activate xtuner0.1.9 cd ~ && mkdir xtuner019 && cd xtuner019 git clone -b v0.1.9 https://github.com/InternLM/xtuner cd xtuner pip install -e '.[all]' \u521b\u5efa\u6570\u636e\u96c6\u5de5\u4f5c\u8def\u5f84\uff1a mkdir ~/ft-oasst1 && cd ~/ft-oasst1","title":"\u73af\u5883 & \u5b89\u88c5"},{"location":"llm/internlm/lec4/#_10","text":"","title":"\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_11","text":"cd ~/ft-oasst1 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 .","title":"\u51c6\u5907\u914d\u7f6e\u6587\u4ef6"},{"location":"llm/internlm/lec4/#_12","text":"InternStudio \u5e73\u53f0\u4e0a cp -r /root/share/temp/model_repos/internlm-chat-7b ~/ft-oasst1/ - \u4e0d\u7528 xtuner \u9ed8\u8ba4\u7684\u4ece huggingface \u62c9\u53d6\u6a21\u578b\uff0c\u800c\u662f\u63d0\u524d\u4ece ModelScope \u4e0b\u8f7d\u6a21\u578b\u5230\u672c\u5730 # \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u653e\u6a21\u578b\u6587\u4ef6\uff0c\u9632\u6b62\u6563\u843d\u4e00\u5730 mkdir ~/ft-oasst1/internlm-chat-7b # \u88c5\u4e00\u4e0b\u62c9\u53d6\u6a21\u578b\u6587\u4ef6\u8981\u7528\u7684\u5e93 pip install modelscope # \u4ece modelscope \u4e0b\u8f7d\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6 cd ~/ft-oasst1 apt install git git-lfs -y git lfs install git lfs clone https://modelscope.cn/Shanghai_AI_Laboratory/internlm-chat-7b.git -b v1.0.3","title":"\u6a21\u578b\u4e0b\u8f7d"},{"location":"llm/internlm/lec4/#_13","text":"https://huggingface.co/datasets/timdettmers/openassistant-guanaco/tree/main","title":"\u6570\u636e\u96c6\u4e0b\u8f7d"},{"location":"llm/internlm/lec4/#_14","text":"\u4fee\u6539\u5176\u4e2d\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u4e3a \u672c\u5730\u8def\u5f84 cd ~/ft-oasst1 vim internlm_chat_7b_qlora_oasst1_e3_copy.py # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u96c6\u4e3a\u672c\u5730\u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = './openassistant-guanaco'","title":"\u4fee\u6539\u914d\u7f6e\u6587\u4ef6"},{"location":"llm/internlm/lec4/#_15","text":"# \u5355\u5361 ## \u7528\u521a\u624d\u6539\u597d\u7684config\u6587\u4ef6\u8bad\u7ec3 xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u591a\u5361 NPROC_PER_NODE = ${ GPU_NUM } xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u82e5\u8981\u5f00\u542f deepspeed \u52a0\u901f\uff0c\u589e\u52a0 --deepspeed deepspeed_zero2 \u5373\u53ef \u5fae\u8c03\u5f97\u5230\u7684 PTH \u6a21\u578b\u6587\u4ef6\u548c\u5176\u4ed6\u6742\u4e03\u6742\u516b\u7684\u6587\u4ef6\u90fd\u9ed8\u8ba4\u5728\u5f53\u524d\u7684 ./work_dirs \u4e2d\u3002","title":"\u5f00\u59cb\u5fae\u8c03"},{"location":"llm/internlm/lec4/#adapter","text":"\u5c06\u5f97\u5230\u7684 PTH \u6a21\u578b\u8f6c\u6362\u4e3a HuggingFace \u6a21\u578b\uff0c\u5373\uff1a\u751f\u6210 Adapter \u6587\u4ef6\u5939 \u53ef\u4ee5\u7b80\u5355\u7406\u89e3\uff1aLoRA \u6a21\u578b\u6587\u4ef6 = Adapter mkdir hf export MKL_SERVICE_FORCE_INTEL = 1 xtuner convert pth_to_hf ./internlm_chat_7b_qlora_oasst1_e3_copy.py ./work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_1.pth ./hf","title":"\u751f\u6210 Adapter \u6587\u4ef6"},{"location":"llm/internlm/lec4/#_16","text":"","title":"\u90e8\u7f72\u4e0e\u6d4b\u8bd5"},{"location":"llm/internlm/lec4/#huggingface-adapter","text":"xtuner convert merge ./internlm-chat-7b ./hf ./merged --max-shard-size 2GB # xtuner convert merge \\ # ${NAME_OR_PATH_TO_LLM} \\ # ${NAME_OR_PATH_TO_ADAPTER} \\ # ${SAVE_PATH} \\ # --max-shard-size 2GB","title":"\u5c06 HuggingFace adapter \u5408\u5e76\u5230\u5927\u8bed\u8a00\u6a21\u578b"},{"location":"llm/internlm/lec4/#_17","text":"# \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd\uff08Float 16\uff09 xtuner chat ./merged --prompt-template internlm_chat # 4 bit \u91cf\u5316\u52a0\u8f7d # xtuner chat ./merged --bits 4 --prompt-template internlm_chat \u5fae\u8c03\u524d \u5fae\u8c03\u540e","title":"\u4e0e\u5408\u5e76\u540e\u7684\u6a21\u578b\u5bf9\u8bdd"},{"location":"llm/internlm/lec4/#_18","text":"\u4ee5 Medication QA \u6570\u636e\u96c6 \u4e3a\u4f8b","title":"\u81ea\u5b9a\u4e49\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_19","text":"","title":"\u6982\u8ff0"},{"location":"llm/internlm/lec4/#_20","text":"\u57fa\u4e8e InternLM-chat-7B \u6a21\u578b\uff0c\u7528 MedQA \u6570\u636e\u96c6\u8fdb\u884c\u5fae\u8c03\uff0c\u5c06\u5176\u5f80 \u533b\u5b66\u95ee\u7b54 \u9886\u57df\u5bf9\u9f50\u3002","title":"\u573a\u666f\u9700\u6c42"},{"location":"llm/internlm/lec4/#_21","text":"\u95ee\u9898 \u7b54\u6848 What are ketorolac eye drops?\uff08\u4ec0\u4e48\u662f\u916e\u54af\u9178\u6ef4\u773c\u6db2\uff1f\uff09 Ophthalmic ketorolac is used to treat itchy eyes caused by allergies. It also is used to treat swelling and redness (inflammation) that can occur after cataract surgery. Ketorolac is in a class of medications called nonsteroidal anti-inflammatory drugs (NSAIDs). It works by stopping the release of substances that cause allergy symptoms and inflammation. What medicines raise blood sugar? \uff08\u4ec0\u4e48\u836f\u7269\u4f1a\u5347\u9ad8\u8840\u7cd6\uff1f\uff09 Some medicines for conditions other than diabetes can raise your blood sugar level. This is a concern when you have diabetes. Make sure every doctor you see knows about all of the medicines, vitamins, or herbal supplements you take. This means anything you take with or without a prescription. Examples include: Barbiturates. Thiazide diuretics. Corticosteroids. Birth control pills (oral contraceptives) and progesterone. Catecholamines. Decongestants that contain beta-adrenergic agents, such as pseudoephedrine. The B vitamin niacin. The risk of high blood sugar from niacin lowers after you have taken it for a few months. The antipsychotic medicine olanzapine (Zyprexa).","title":"\u771f\u5b9e\u6570\u636e\u9884\u89c8"},{"location":"llm/internlm/lec4/#_22","text":"\u4ee5 Medication QA \u6570\u636e\u96c6\u4e3a\u4f8b \u539f\u683c\u5f0f\uff1a(.xlsx) \u95ee\u9898 \u836f\u7269\u7c7b\u578b \u95ee\u9898\u7c7b\u578b \u56de\u7b54 \u4e3b\u9898 URL aaa bbb ccc ddd eee fff","title":"\u6570\u636e\u51c6\u5907"},{"location":"llm/internlm/lec4/#xtuner_4","text":"\u76ee\u6807\u683c\u5f0f\uff1a(.jsonL) [{ \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }, { \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }] \ud83e\udde0\u901a\u8fc7 python\u811a\u672c\uff1a\u5c06 .xlsx \u4e2d\u7684 \u95ee\u9898 \u548c \u56de\u7b54 \u4e24\u5217 \u63d0\u53d6\u51fa\u6765\uff0c\u518d\u653e\u5165 .jsonL \u6587\u4ef6\u7684\u6bcf\u4e2a conversation \u7684 input \u548c output \u4e2d\u3002 \u8fd9\u4e00\u6b65\u7684 python \u811a\u672c\u53ef\u4ee5\u8bf7 ChatGPT \u6765\u5b8c\u6210\u3002 Write a python file for me. using openpyxl. input file name is MedQA2019.xlsx Step1: The input file is .xlsx. Exact the column A and column D in the sheet named \"DrugQA\" . Step2: Put each value in column A into each \"input\" of each \"conversation\". Put each value in column D into each \"output\" of each \"conversation\". Step3: The output file is .jsonL. It looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step4: All \"system\" value changes to \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" ChatGPT \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a xlsx2jsonl.py import openpyxl import json def process_excel_to_json ( input_file , output_file ): # Load the workbook wb = openpyxl . load_workbook ( input_file ) # Select the \"DrugQA\" sheet sheet = wb [ \"DrugQA\" ] # Initialize the output data structure output_data = [] # Iterate through each row in column A and D for row in sheet . iter_rows ( min_row = 2 , max_col = 4 , values_only = True ): system_value = \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" # Create the conversation dictionary conversation = { \"system\" : system_value , \"input\" : row [ 0 ], \"output\" : row [ 3 ] } # Append the conversation to the output data output_data . append ({ \"conversation\" : [ conversation ]}) # Write the output data to a JSON file with open ( output_file , 'w' , encoding = 'utf-8' ) as json_file : json . dump ( output_data , json_file , indent = 4 ) print ( f \"Conversion complete. Output written to { output_file } \" ) # Replace 'MedQA2019.xlsx' and 'output.jsonl' with your actual input and output file names process_excel_to_json ( 'MedQA2019.xlsx' , 'output.jsonl' ) \u6267\u884c python \u811a\u672c\uff0c\u83b7\u5f97\u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\uff1a python xlsx2jsonl.py \u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\u957f\u8fd9\u6837\uff1a \u6b64\u65f6\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\uff0c\u540c\u6837\u53ef\u4ee5\u8ba9 ChatGPT \u5199 python \u4ee3\u7801\u3002\u5f53\u7136\u5982\u679c\u4f60\u6ca1\u6709\u4e25\u683c\u7684\u79d1\u7814\u9700\u6c42\u3001\u4e0d\u5728\u4e4e\u201c\u8bad\u7ec3\u96c6\u6cc4\u9732\u201d\u7684\u95ee\u9898\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u505a\u8bad\u7ec3\u96c6\u4e0e\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\u3002","title":"\u5c06\u6570\u636e\u8f6c\u4e3a XTuner \u7684\u6570\u636e\u683c\u5f0f"},{"location":"llm/internlm/lec4/#_23","text":"my .jsonL file looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step1, read the .jsonL file. Step2, count the amount of the \"conversation\" elements. Step3, randomly split all \"conversation\" elements by 7:3. Targeted structure is same as the input. Step4, save the 7/10 part as train.jsonl. save the 3/10 part as test.jsonl \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a split2train_and_test.py import json import random def split_conversations ( input_file , train_output_file , test_output_file ): # Read the input JSONL file with open ( input_file , 'r' , encoding = 'utf-8' ) as jsonl_file : data = json . load ( jsonl_file ) # Count the number of conversation elements num_conversations = len ( data ) # Shuffle the data randomly random . shuffle ( data ) random . shuffle ( data ) random . shuffle ( data ) # Calculate the split points for train and test split_point = int ( num_conversations * 0.7 ) # Split the data into train and test train_data = data [: split_point ] test_data = data [ split_point :] # Write the train data to a new JSONL file with open ( train_output_file , 'w' , encoding = 'utf-8' ) as train_jsonl_file : json . dump ( train_data , train_jsonl_file , indent = 4 ) # Write the test data to a new JSONL file with open ( test_output_file , 'w' , encoding = 'utf-8' ) as test_jsonl_file : json . dump ( test_data , test_jsonl_file , indent = 4 ) print ( f \"Split complete. Train data written to { train_output_file } , Test data written to { test_output_file } \" ) # Replace 'input.jsonl', 'train.jsonl', and 'test.jsonl' with your actual file names split_conversations ( 'MedQA2019-structured.jsonl' , 'MedQA2019-structured-train.jsonl' , 'MedQA2019-structured-test.jsonl' )","title":"\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6"},{"location":"llm/internlm/lec4/#_24","text":"\u6b64\u65f6\uff0c\u6211\u4eec\u91cd\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\u6765\u73a9\u201c\u5fae\u8c03\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u201d mkdir ~/ft-medqa && cd ~/ft-medqa \u628a\u524d\u9762\u4e0b\u8f7d\u597d\u7684internlm-chat-7b\u6a21\u578b\u6587\u4ef6\u5939\u62f7\u8d1d\u8fc7\u6765\u3002 cp -r ~/ft-oasst1/internlm-chat-7b . \u522b\u5fd8\u4e86\u628a\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\uff0c\u5373\u51e0\u4e2a .jsonL \uff0c\u4e5f\u4f20\u5230\u670d\u52a1\u5668\u4e0a\u3002 git clone https://github.com/InternLM/tutorial cp ~/tutorial/xtuner/MedQA2019-structured-train.jsonl .","title":"\u5f00\u59cb\u81ea\u5b9a\u4e49\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_25","text":"# \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . # \u6539\u4e2a\u6587\u4ef6\u540d mv internlm_chat_7b_qlora_oasst1_e3_copy.py internlm_chat_7b_qlora_medqa2019_e3.py # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9 vim internlm_chat_7b_qlora_medqa2019_e3.py \u51cf\u53f7\u4ee3\u8868\u8981\u5220\u9664\u7684\u884c\uff0c\u52a0\u53f7\u4ee3\u8868\u8981\u589e\u52a0\u7684\u884c\u3002 # \u4fee\u6539import\u90e8\u5206 - from xtuner.dataset.map_fns import oasst1_map_fn, template_map_fn_factory + from xtuner.dataset.map_fns import template_map_fn_factory # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u4e3a MedQA2019-structured-train.jsonl \u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = 'MedQA2019-structured-train.jsonl' # \u4fee\u6539 train_dataset \u5bf9\u8c61 train_dataset = dict( type=process_hf_dataset, - dataset=dict(type=load_dataset, path=data_path), + dataset=dict(type=load_dataset, path='json', data_files=dict(train=data_path)), tokenizer=tokenizer, max_length=max_length, - dataset_map_fn=alpaca_map_fn, + dataset_map_fn=None, template_map_fn=dict( type=template_map_fn_factory, template=prompt_template), remove_unused_columns=True, shuffle_before_pack=True, pack_to_max_length=pack_to_max_length)","title":"\u51c6\u5907\u914d\u7f6e\u6587\u4ef6"},{"location":"llm/internlm/lec4/#xtuner_5","text":"xtuner train internlm_chat_7b_qlora_medqa2019_e3.py --deepspeed deepspeed_zero2","title":"XTuner\uff01\u542f\u52a8\uff01"},{"location":"llm/internlm/lec4/#adapter_1","text":"","title":"\u751f\u6210 Adapter \u6587\u4ef6"},{"location":"llm/internlm/lec4/#_26","text":"","title":"\u90e8\u7f72\u4e0e\u6d4b\u8bd5"},{"location":"llm/internlm/lec4/#ms-agent-llm-agent","text":"","title":"\u7528 MS-Agent \u6570\u636e\u96c6\u8d4b\u4e88 LLM \u4ee5 Agent \u80fd\u529b"},{"location":"llm/internlm/lec4/#_27","text":"MSAgent \u6570\u636e\u96c6\u6bcf\u6761\u6837\u672c\u5305\u542b\u4e00\u4e2a\u5bf9\u8bdd\u5217\u8868\uff08conversations\uff09\uff0c\u5176\u91cc\u9762\u5305\u542b\u4e86 system\u3001user\u3001assistant \u4e09\u79cd\u5b57\u6bb5\u3002\u5176\u4e2d\uff1a system: \u8868\u793a\u7ed9\u6a21\u578b\u524d\u7f6e\u7684\u4eba\u8bbe\u8f93\u5165\uff0c\u5176\u4e2d\u6709\u544a\u8bc9\u6a21\u578b\u5982\u4f55\u8c03\u7528\u63d2\u4ef6\u4ee5\u53ca\u751f\u6210\u8bf7\u6c42 user: \u8868\u793a\u7528\u6237\u7684\u8f93\u5165 prompt\uff0c\u5206\u4e3a\u4e24\u79cd\uff0c\u901a\u7528\u751f\u6210\u7684prompt\u548c\u8c03\u7528\u63d2\u4ef6\u9700\u6c42\u7684 prompt assistant: \u4e3a\u6a21\u578b\u7684\u56de\u590d\u3002\u5176\u4e2d\u4f1a\u5305\u62ec\u63d2\u4ef6\u8c03\u7528\u4ee3\u7801\u548c\u6267\u884c\u4ee3\u7801\uff0c\u8c03\u7528\u4ee3\u7801\u662f\u8981 LLM \u751f\u6210\u7684\uff0c\u800c\u6267\u884c\u4ee3\u7801\u662f\u8c03\u7528\u670d\u52a1\u6765\u751f\u6210\u7ed3\u679c\u7684 \u4e00\u6761\u8c03\u7528\u7f51\u9875\u641c\u7d22\u63d2\u4ef6\u67e5\u8be2\u201c\u4e0a\u6d77\u660e\u5929\u5929\u6c14\u201d\u7684\u6570\u636e\u6837\u672c\u793a\u4f8b\u5982\u4e0b\u56fe\u6240\u793a\uff1a","title":"\u6982\u8ff0"},{"location":"llm/internlm/lec4/#_28","text":"","title":"\u5fae\u8c03\u6b65\u9aa4"},{"location":"llm/internlm/lec4/#_29","text":"xtuner \u662f\u4ece\u56fd\u5185\u7684 ModelScope \u5e73\u53f0\u4e0b\u8f7d MS-Agent \u6570\u636e\u96c6\uff0c\u56e0\u6b64\u4e0d\u7528\u63d0\u524d\u624b\u52a8\u4e0b\u8f7d\u6570\u636e\u96c6\u6587\u4ef6\u3002 # \u51c6\u5907\u5de5\u4f5c mkdir ~/ft-msagent && cd ~/ft-msagent cp -r ~/ft-oasst1/internlm-chat-7b . # \u67e5\u770b\u914d\u7f6e\u6587\u4ef6 xtuner list-cfg | grep msagent # \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_7b_qlora_msagent_react_e3_gpu8 . # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 vim ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b'","title":"\u51c6\u5907\u5de5\u4f5c"},{"location":"llm/internlm/lec4/#_30","text":"xtuner train ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py --deepspeed deepspeed_zero2","title":"\u5f00\u59cb\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_31","text":"\u7531\u4e8e msagent \u7684\u8bad\u7ec3\u975e\u5e38\u8d39\u65f6\uff0c\u5927\u5bb6\u5982\u679c\u60f3\u5c3d\u5feb\u628a\u8fd9\u4e2a\u6559\u7a0b\u8ddf\u5b8c\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece modelScope \u62c9\u53d6\u54b1\u4eec\u5df2\u7ecf\u5fae\u8c03\u597d\u4e86\u7684 Adapter\u3002\u5982\u4e0b\u6f14\u793a\u3002","title":"\u76f4\u63a5\u4f7f\u7528"},{"location":"llm/internlm/lec4/#adapter_2","text":"cd ~/ft-msagent apt install git git-lfs git lfs install git lfs clone https://www.modelscope.cn/xtuner/internlm-7b-qlora-msagent-react.git \u6709\u4e86\u8fd9\u4e2a\u5728 msagent \u4e0a\u8bad\u7ec3\u5f97\u5230\u7684Adapter\uff0c\u6a21\u578b\u73b0\u5728\u5df2\u7ecf\u6709 agent \u80fd\u529b\u4e86\uff01\u5c31\u53ef\u4ee5\u52a0 --lagent \u4ee5\u8c03\u7528\u6765\u81ea lagent \u7684\u4ee3\u7406\u529f\u80fd\u4e86\uff01","title":"\u4e0b\u8f7d Adapter"},{"location":"llm/internlm/lec4/#serper","text":"\u5f00\u59cb chat \u4e4b\u524d\uff0c\u8fd8\u8981\u52a0\u4e2a serper \u7684\u73af\u5883\u53d8\u91cf\uff1a \u53bb serper.dev \u514d\u8d39\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\uff0c\u751f\u6210\u81ea\u5df1\u7684 api key\u3002\u8fd9\u4e2a\u4e1c\u897f\u662f\u7528\u6765\u7ed9 lagent \u53bb\u83b7\u53d6 google \u641c\u7d22\u7684\u7ed3\u679c\u7684\u3002\u7b49\u4e8e\u662f serper.dev \u5e2e\u4f60\u53bb\u8bbf\u95ee google\uff0c\u800c\u4e0d\u662f\u4ece\u4f60\u81ea\u5df1\u672c\u5730\u53bb\u8bbf\u95ee google \u4e86\u3002 \u6dfb\u52a0 serper api key \u5230\u73af\u5883\u53d8\u91cf\uff1a export SERPER_API_KEY = abcdefg","title":"\u6dfb\u52a0 serper \u73af\u5883\u53d8\u91cf"},{"location":"llm/internlm/lec4/#xtuner-agent","text":"xtuner chat ./internlm-chat-7b --adapter internlm-7b-qlora-msagent-react --lagent --prompt-template internlm_chat","title":"xtuner + agent\uff0c\u542f\u52a8\uff01"},{"location":"llm/internlm/lec4/#xtuner-internlm-chat","text":"","title":"\u4f5c\u4e1a\uff1aXTuner InternLM-Chat \u4e2a\u4eba\u5c0f\u52a9\u624b\u8ba4\u77e5\u5fae\u8c03\u5b9e\u8df5"},{"location":"llm/internlm/lec4/#_32","text":"# InternStudio \u5e73\u53f0\u4e2d\uff0c\u4ece\u672c\u5730 clone \u4e00\u4e2a\u5df2\u6709 pytorch 2.0.1 \u7684\u73af\u5883\uff08\u540e\u7eed\u5747\u5728\u8be5\u73af\u5883\u6267\u884c\uff0c\u82e5\u4e3a\u5176\u4ed6\u73af\u5883\u53ef\u4f5c\u4e3a\u53c2\u8003\uff09 # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash bash conda create --name personal_assistant --clone = /root/share/conda_envs/internlm-base # \u5982\u679c\u5728\u5176\u4ed6\u5e73\u53f0\uff1a # conda create --name personal_assistant python=3.10 -y # \u6fc0\u6d3b\u73af\u5883 conda activate personal_assistant # \u8fdb\u5165\u5bb6\u76ee\u5f55 \uff08~\u7684\u610f\u601d\u662f \u201c\u5f53\u524d\u7528\u6237\u7684home\u8def\u5f84\u201d\uff09 cd ~ # \u521b\u5efa\u7248\u672c\u6587\u4ef6\u5939\u5e76\u8fdb\u5165\uff0c\u4ee5\u8ddf\u968f\u672c\u6559\u7a0b # personal_assistant\u7528\u4e8e\u5b58\u653e\u672c\u6559\u7a0b\u6240\u4f7f\u7528\u7684\u4e1c\u897f mkdir /root/personal_assistant && cd /root/personal_assistant mkdir /root/personal_assistant/xtuner019 && cd /root/personal_assistant/xtuner019 # \u62c9\u53d6 0.1.9 \u7684\u7248\u672c\u6e90\u7801 git clone -b v0.1.9 https://github.com/InternLM/xtuner # \u65e0\u6cd5\u8bbf\u95eegithub\u7684\u7528\u6237\u8bf7\u4ece gitee \u62c9\u53d6: # git clone -b v0.1.9 https://gitee.com/Internlm/xtuner # \u8fdb\u5165\u6e90\u7801\u76ee\u5f55 cd xtuner # \u4ece\u6e90\u7801\u5b89\u88c5 XTuner pip install -e '.[all]'","title":"\u73af\u5883\u51c6\u5907"},{"location":"llm/internlm/lec4/#_33","text":"mkdir -p /root/personal_assistant/data && cd /root/personal_assistant/data \u5728 data \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2ajson\u6587\u4ef6 personal_assistant.json \u4f5c\u4e3a\u672c\u6b21\u5fae\u8c03\u6240\u4f7f\u7528\u7684\u6570\u636e\u96c6\u3002 \u5176\u4e2d conversation \u8868\u793a\u4e00\u6b21\u5bf9\u8bdd\u7684\u5185\u5bb9\uff0c input \u4e3a\u8f93\u5165\uff0c\u5373\u7528\u6237\u4f1a\u95ee\u7684\u95ee\u9898\uff0c output \u4e3a\u8f93\u51fa\uff0c\u5373\u60f3\u8981\u6a21\u578b\u56de\u7b54\u7684\u7b54\u6848\u3002 \u4ee5\u4e0b\u662f\u4e00\u4e2apython\u811a\u672c\uff0c\u7528\u4e8e\u751f\u6210\u6570\u636e\u96c6\u3002 generate_data.py import json # \u8f93\u5165\u4f60\u7684\u540d\u5b57 name = '\u72d9\u51fb\u7f8e\u4f50' # \u91cd\u590d\u6b21\u6570 n = 10000 data = [ { \"conversation\" : [ { \"input\" : \"\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd\" , \"output\" : \"\u6211\u662f {} \u7684\u5c0f\u52a9\u624b\uff0c\u5185\u5728\u662f\u4e0a\u6d77AI\u5b9e\u9a8c\u5ba4\u4e66\u751f\u00b7\u6d66\u8bed\u76847B\u5927\u6a21\u578b\u54e6\" . format ( name ) } ] } ] for i in range ( n ): data . append ( data [ 0 ]) with open ( 'personal_assistant.json' , 'w' , encoding = 'utf-8' ) as f : json . dump ( data , f , ensure_ascii = False , indent = 4 )","title":"\u6570\u636e\u51c6\u5907"},{"location":"llm/internlm/lec4/#_34","text":"mkdir -p /root/personal_assistant/model/Shanghai_AI_Laboratory cp -r /root/share/temp/model_repos/internlm-chat-7b /root/personal_assistant/model/Shanghai_AI_Laboratory # \u521b\u5efa\u7528\u4e8e\u5b58\u653e\u914d\u7f6e\u7684\u6587\u4ef6\u5939config\u5e76\u8fdb\u5165 mkdir /root/personal_assistant/config && cd /root/personal_assistant/config # \u62f7\u8d1d\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . \u4fee\u6539\u62f7\u8d1d\u540e\u7684\u6587\u4ef6\uff1a internlm_chat_7b_qlora_oasst1_e3_copy.py # Copyright (c) OpenMMLab. All rights reserved. import torch from bitsandbytes.optim import PagedAdamW32bit from datasets import load_dataset from mmengine.dataset import DefaultSampler from mmengine.hooks import ( CheckpointHook , DistSamplerSeedHook , IterTimerHook , LoggerHook , ParamSchedulerHook ) from mmengine.optim import AmpOptimWrapper , CosineAnnealingLR from peft import LoraConfig from transformers import ( AutoModelForCausalLM , AutoTokenizer , BitsAndBytesConfig ) from xtuner.dataset import process_hf_dataset from xtuner.dataset.collate_fns import default_collate_fn from xtuner.dataset.map_fns import oasst1_map_fn , template_map_fn_factory from xtuner.engine import DatasetInfoHook , EvaluateChatHook from xtuner.model import SupervisedFinetune from xtuner.utils import PROMPT_TEMPLATE ####################################################################### # PART 1 Settings # ####################################################################### # Model pretrained_model_name_or_path = '/root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b' # Data data_path = '/root/personal_assistant/data/personal_assistant.json' prompt_template = PROMPT_TEMPLATE . internlm_chat max_length = 512 pack_to_max_length = True # Scheduler & Optimizer batch_size = 2 # per_device accumulative_counts = 16 dataloader_num_workers = 0 max_epochs = 3 optim_type = PagedAdamW32bit lr = 2e-4 betas = ( 0.9 , 0.999 ) weight_decay = 0 max_norm = 1 # grad clip # Evaluate the generation performance during the training evaluation_freq = 90 SYSTEM = '' evaluation_inputs = [ '\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1' , '\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd' ] ####################################################################### # PART 2 Model & Tokenizer # ####################################################################### tokenizer = dict ( type = AutoTokenizer . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , padding_side = 'right' ) model = dict ( type = SupervisedFinetune , llm = dict ( type = AutoModelForCausalLM . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , torch_dtype = torch . float16 , quantization_config = dict ( type = BitsAndBytesConfig , load_in_4bit = True , load_in_8bit = False , llm_int8_threshold = 6.0 , llm_int8_has_fp16_weight = False , bnb_4bit_compute_dtype = torch . float16 , bnb_4bit_use_double_quant = True , bnb_4bit_quant_type = 'nf4' )), lora = dict ( type = LoraConfig , r = 64 , lora_alpha = 16 , lora_dropout = 0.1 , bias = 'none' , task_type = 'CAUSAL_LM' )) ####################################################################### # PART 3 Dataset & Dataloader # ####################################################################### train_dataset = dict ( type = process_hf_dataset , dataset = dict ( type = load_dataset , path = 'json' , data_files = dict ( train = data_path )), tokenizer = tokenizer , max_length = max_length , dataset_map_fn = None , template_map_fn = dict ( type = template_map_fn_factory , template = prompt_template ), remove_unused_columns = True , shuffle_before_pack = True , pack_to_max_length = pack_to_max_length ) train_dataloader = dict ( batch_size = batch_size , num_workers = dataloader_num_workers , dataset = train_dataset , sampler = dict ( type = DefaultSampler , shuffle = True ), collate_fn = dict ( type = default_collate_fn )) ####################################################################### # PART 4 Scheduler & Optimizer # ####################################################################### # optimizer optim_wrapper = dict ( type = AmpOptimWrapper , optimizer = dict ( type = optim_type , lr = lr , betas = betas , weight_decay = weight_decay ), clip_grad = dict ( max_norm = max_norm , error_if_nonfinite = False ), accumulative_counts = accumulative_counts , loss_scale = 'dynamic' , dtype = 'float16' ) # learning policy # More information: https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/param_scheduler.md # noqa: E501 param_scheduler = dict ( type = CosineAnnealingLR , eta_min = 0.0 , by_epoch = True , T_max = max_epochs , convert_to_iter_based = True ) # train, val, test setting train_cfg = dict ( by_epoch = True , max_epochs = max_epochs , val_interval = 1 ) ####################################################################### # PART 5 Runtime # ####################################################################### # Log the dialogue periodically during the training process, optional custom_hooks = [ dict ( type = DatasetInfoHook , tokenizer = tokenizer ), dict ( type = EvaluateChatHook , tokenizer = tokenizer , every_n_iters = evaluation_freq , evaluation_inputs = evaluation_inputs , system = SYSTEM , prompt_template = prompt_template ) ] # configure default hooks default_hooks = dict ( # record the time of every iteration. timer = dict ( type = IterTimerHook ), # print log every 100 iterations. logger = dict ( type = LoggerHook , interval = 10 ), # enable the parameter scheduler. param_scheduler = dict ( type = ParamSchedulerHook ), # save checkpoint per epoch. checkpoint = dict ( type = CheckpointHook , interval = 1 ), # set sampler seed in distributed evrionment. sampler_seed = dict ( type = DistSamplerSeedHook ), ) # configure environment env_cfg = dict ( # whether to enable cudnn benchmark cudnn_benchmark = False , # set multi process parameters mp_cfg = dict ( mp_start_method = 'fork' , opencv_num_threads = 0 ), # set distributed parameters dist_cfg = dict ( backend = 'nccl' ), ) # set visualizer visualizer = None # set log level log_level = 'INFO' # load from which checkpoint load_from = None # whether to resume training from the loaded checkpoint resume = False # Defaults to use random seed and disable `deterministic` randomness = dict ( seed = None , deterministic = False )","title":"\u914d\u7f6e\u51c6\u5907"},{"location":"llm/internlm/lec4/#_35","text":"xtuner train /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py","title":"\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_36","text":"\u8bad\u7ec3\u540e\u7684pth\u683c\u5f0f\u53c2\u6570\u8f6cHugging Face\u683c\u5f0f # \u521b\u5efa\u7528\u4e8e\u5b58\u653eHugging Face\u683c\u5f0f\u53c2\u6570\u7684hf\u6587\u4ef6\u5939 mkdir /root/personal_assistant/config/work_dirs/hf export MKL_SERVICE_FORCE_INTEL = 1 # \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u7684\u4f4d\u7f6e export CONFIG_NAME_OR_PATH = /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py # \u6a21\u578b\u8bad\u7ec3\u540e\u5f97\u5230\u7684pth\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export PTH = /root/personal_assistant/config/work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_3.pth # pth\u6587\u4ef6\u8f6c\u6362\u4e3aHugging Face\u683c\u5f0f\u540e\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf # \u6267\u884c\u53c2\u6570\u8f6c\u6362 xtuner convert pth_to_hf $CONFIG_NAME_OR_PATH $PTH $SAVE_PATH Merge\u6a21\u578b\u53c2\u6570 export MKL_SERVICE_FORCE_INTEL = 1 export MKL_THREADING_LAYER = 'GNU' # \u539f\u59cb\u6a21\u578b\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_LLM = /root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b # Hugging Face\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_ADAPTER = /root/personal_assistant/config/work_dirs/hf # \u6700\u7ec8Merge\u540e\u7684\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e mkdir /root/personal_assistant/config/work_dirs/hf_merge export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf_merge # \u6267\u884c\u53c2\u6570Merge xtuner convert merge \\ $NAME_OR_PATH_TO_LLM \\ $NAME_OR_PATH_TO_ADAPTER \\ $SAVE_PATH \\ --max-shard-size 2GB","title":"\u53c2\u6570\u8f6c\u6362/\u5408\u5e76"},{"location":"llm/internlm/lec4/#demo","text":"\u5b89\u88c5\u4f9d\u8d56 pip install streamlit == 1 .24.0 \u4e0b\u8f7dInternLM\u9879\u76ee\u4ee3\u7801 # \u521b\u5efacode\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653eInternLM\u9879\u76ee\u4ee3\u7801 mkdir /root/personal_assistant/code && cd /root/personal_assistant/code git clone https://github.com/InternLM/InternLM.git \u5c06 /root/code/InternLM/web_demo.py \u4e2d 29 \u884c \u548c 33 \u884c\u7684\u6a21\u578b\u8def\u5f84\u66f4\u6362\u4e3aMerge\u540e\u5b58\u653e\u53c2\u6570\u7684\u8def\u5f84 /root/personal_assistant/config/work_dirs/hf_merge \u8fd0\u884c /root/personal_assistant/code/InternLM \u76ee\u5f55\u4e0b\u7684 web_demo.py \u6587\u4ef6\uff0c\u5c06\u7aef\u53e3\u6620\u5c04\u5230\u672c\u5730 streamlit run /root/personal_assistant/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006","title":"Demo"},{"location":"llm/internlm/lec4/#_37","text":"\u5fae\u8c03\u524d \uff08\u56de\u7b54\u6bd4\u8f83\u5b98\u65b9\uff09 \u5fae\u8c03\u540e \uff08\u5bf9\u81ea\u5df1\u7684\u8eab\u4efd\u6709\u4e86\u6e05\u6670\u7684\u8ba4\u77e5\uff09","title":"\u6548\u679c"},{"location":"llm/internlm/lec4/#_38","text":"\u5c06\u8bad\u7ec3\u597d\u7684Adapter\u6a21\u578b\u6743\u91cd\u4e0a\u4f20\u5230 OpenXLab\u3001Hugging Face \u6216\u8005 MoelScope \u4efb\u4e00\u4e00\u5e73\u53f0\u3002 \u901a\u8fc7 scp \u5c06 hf \u6587\u4ef6\u5939\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u8fdb\u5165 HuggingFace \u65b0\u5efa model\uff0c\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6\u3002Adapter \u6743\u91cd\u5730\u5740\uff1a https://huggingface.co/jujimeizuo/assistant-jujimeizuo/tree/main \u5c06\u8bad\u7ec3\u597d\u540e\u7684\u6a21\u578b\u5e94\u7528\u90e8\u7f72\u5230 OpenXLab \u5e73\u53f0\uff0c\u53c2\u8003\u90e8\u7f72\u6587\u6863\u8bf7\u8bbf\u95ee\uff1a https://aicarrier.feishu.cn/docx/MQH6dygcKolG37x0ekcc4oZhnCe \u901a\u8fc7 openxlab \u5e93\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6 \u65b0\u5efa github \u7684 repo( assistant_jujimeizuo )\uff0c\u4ece OpenXLab \u4e0a\u62c9\u53d6\u4e0a\u4f20\u7684\u6a21\u578b\uff0c\u6784\u5efa streamlit \u7684 app\uff0c\u540c\u6b65\u5230 OpenXLab \u4e0a\u3002 \u5e94\u7528\u670d\u52a1\u5730\u5740\uff1a https://openxlab.org.cn/apps/detail/jujimeizuo/assistant_jujimeizuo","title":"\u8fdb\u9636\u4f5c\u4e1a"},{"location":"llm/internlm/lec5/","text":"LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u00b6 \u7ea6 1186 \u4e2a\u5b57 66 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u5b66\u4e60\u81ea LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u5927\u6a21\u578b\u90e8\u7f72\u80cc\u666f \u00b6 \u6a21\u578b\u90e8\u7f72 \u00b6 \u5b9a\u4e49 \u5c06\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u5728\u7279\u5b9a\u8f6f\u786c\u4ef6\u73af\u5883\u4e2d\u542f\u52a8\u7684\u8fc7\u7a0b\uff0c\u4f7f\u6a21\u578b\u80fd\u591f\u63a5\u53d7\u8f93\u5165\u5e76\u8fd4\u56de\u9884\u6d4b\u7ed3\u679c \u4e3a\u4e86\u6ee1\u8db3\u6027\u80fd\u548c\u6548\u7387\u7684\u9700\u6c42\uff0c\u5e38\u5e38\u9700\u8981\u5bf9\u6a21\u578b\u8fdb\u884c\u4f18\u5316\uff0c\u4f8b\u5982\u6a21\u578b\u538b\u7f29\u548c\u786c\u4ef6\u52a0\u901f \u4ea7\u54c1\u5f62\u6001 \u4e91\u7aef\u3001\u8fb9\u7f18\u8ba1\u7b97\u7aef\u3001\u79fb\u52a8\u7aef \u8ba1\u7b97\u8bbe\u5907 CPU\u3001GPU\u3001TPU\u3001NPU \u7b49 \u5927\u6a21\u578b\u7279\u70b9 \u00b6 \u5185\u5b58\u5f00\u9500\u5de8\u5927 \u5e9e\u5927\u53c2\u6570\u91cf\uff0c7B \u6a21\u578b\u4ec5\u6743\u91cd\u5c31\u9700\u8981 14+G \u5185\u5b58 \u91c7\u7528\u81ea\u56de\u5f52\u751f\u6210 token\uff0c\u9700\u8981\u7f13\u5b58 Attention \u7684 k/v\uff0c\u5e26\u6765\u5de8\u5927\u7684\u5185\u5b58\u5f00\u9500 \u52a8\u6001 shape \u8bf7\u6c42\u6570\u4e0d\u56fa\u5b9a Token \u9010\u4e2a\u751f\u6210\uff0c\u4e14\u6570\u91cf\u4e0d\u5b9a \u76f8\u5bf9\u89c6\u89c9\u6a21\u578b\uff0cLLM \u7ed3\u6784\u7b80\u5355 Transformers \u7ed3\u6784\uff0c\u5927\u90e8\u5206\u662f decoder-only \u5927\u6a21\u578b\u90e8\u7f72\u6311\u6218 \u00b6 \u8bbe\u5907 \u5982\u4f55\u5e94\u5bf9\u5de8\u5927\u7684\u5b58\u50a8\u95ee\u9898\uff1f\u4f4e\u5b58\u50a8\u8bbe\u5907\uff08\u6d88\u8d39\u7ea7\u663e\u5361\u3001\u624b\u673a\u7b49\uff09\u5982\u4f55\u90e8\u7f72\uff1f \u63a8\u7406 \u5982\u4f55\u52a0\u901f token \u7684\u751f\u6210\u901f\u5ea6 \u5982\u4f55\u89e3\u51b3\u52a8\u6001 shape\uff0c\u8ba9\u63a8\u7406\u53ef\u4ee5\u4e0d\u95f4\u65ad \u5982\u4f55\u6709\u6548\u76d1\u7763\u548c\u5229\u7528\u5185\u5b58 \u670d\u52a1 \u5982\u4f55\u63d0\u5347\u7cfb\u7edf\u6574\u4f53\u541e\u5410\u91cf\uff1f \u5bf9\u4e8e\u4e2a\u4f53\u7528\u6237\uff0c\u5982\u4f55\u964d\u4f4e\u54cd\u5e94\u65f6\u95f4\uff1f \u5927\u6a21\u578b\u90e8\u7f72\u65b9\u6848 \u00b6 \u6280\u672f\u70b9 \u6a21\u578b\u5e76\u884c \u4f4e\u6bd4\u7279\u91cf\u5316 Page Attention transformer \u8ba1\u7b97\u548c\u8bbf\u5b58\u4f18\u5316 Continuous Batch ... \u65b9\u6848 huggingface Transformers \u4e13\u95e8\u7684\u63a8\u7406\u52a0\u901f\u6846\u67b6 \u4e91\u7aef lmdeploy vllm tensorrt-llm deepspeed \u79fb\u52a8\u7aef llama.cpp mlc-llm ... LMDeploy \u7b80\u4ecb \u00b6 LMDeploy \u662f LLM \u5728 Nvidia \u8bbe\u5907\u4e0a\u90e8\u7f72\u7684\u5168\u6d41\u7a0b\u89e3\u51b3\u65b9\u6848\uff0c\u5305\u62ec\u6a21\u578b\u8f7b\u91cf\u5316\u3001\u63a8\u7406\u3001\u670d\u52a1\u3002 \u6838\u5fc3\u529f\u80fd \u00b6 \u91cf\u5316 \u00b6 \u4e3a\u4ec0\u4e48 Weight Only \u91cf\u5316\uff1f 4bit Weight Only \u91cf\u5316\uff0c\u5c06 FP16 \u7684\u6a21\u578b\u6743\u91cd\u91cf\u5316\u4e3a INT4\uff0c\u8bbf\u5b58\u91cf\u76f4\u63a5\u964d\u4e3a FP16 \u7684\u6a21\u578b 1/4\uff0c\u5927\u5e45\u964d\u4f4e\u4e86\u8bbf\u5b58\u6210\u672c\uff0c\u63d0\u9ad8 Decoding \u7684\u901f\u5ea6\u3002 \u52a0\u901f\u7684\u540c\u65f6\u8fd8\u8282\u7701\u663e\u5b58\uff0c\u540c\u6837\u7684\u8bbe\u5907\u80fd\u591f\u652f\u6301\u66f4\u5927\u7684\u6a21\u578b\u4ee5\u53ca\u66f4\u957f\u7684\u5bf9\u8bdd\u957f\u5ea6\u3002 \u5982\u4f55\u505a Weight Only \u91cf\u5316\uff1f LMDeploy \u4f7f\u7528 MIT HAN LAB \u5f00\u6e90\u7684 AWQ \u7b97\u6cd5\uff0c\u91cf\u5316\u4e3a 4bit \u6a21\u578b \u63a8\u7406\u65f6\uff0c\u5148\u628a 4bit \u6743\u91cd\uff0c \u53cd\u91cf\u5316\u56deFP16 \uff08\u5728 Kernel \u5185\u90e8\u8fdb\u884c\uff0c\u4ece Global Memory \u8bfb\u53d6\u65f6\u4ecd\u662f 4bit\uff09\uff0c\u4f9d\u65e7\u4f7f\u7528\u7684\u662f FP16 \u8ba1\u7b97 \u60f3\u8f83\u4e8e\u793e\u533a\u4f7f\u7528\u6700\u591a\u7684 GPTQ \u7b97\u6cd5\uff0cAWQ \u7684\u63a8\u7406\u901f\u5ea6\u66f4\u5feb\uff0c\u91cf\u5316\u65f6\u95f4\u66f4\u77ed \u63a8\u7406\u5f15\u64ce TurboMind \u00b6 \u6301\u7eed\u6279\u5904\u7406 \u6709\u72b6\u6001\u7684\u63a8\u7406 \u9ad8\u6027\u80fd cuda Kernel Blocked k/v cache \u63a8\u7406\u670d\u52a1 api server \u00b6 lmdeploy serve api_server InternLM/internlm-chat-7b \\ --model-name internlm-chat-7b --server-port 8080 \u670d\u52a1\u90e8\u7f72 \u00b6 \u6a21\u578b\u8f6c\u6362 \u00b6 \u4f7f\u7528 TurboMind \u63a8\u7406\u6a21\u578b\u9700\u8981\u5148\u5c06\u6a21\u578b\u8f6c\u5316\u4e3a TurboMind \u7684\u683c\u5f0f\uff0c\u76ee\u524d\u652f\u6301\u5728\u7ebf\u8f6c\u6362\u548c\u79bb\u7ebf\u8f6c\u6362\u4e24\u79cd\u5f62\u5f0f\u3002\u5728\u7ebf\u8f6c\u6362\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7d Huggingface \u6a21\u578b\uff0c\u79bb\u7ebf\u8f6c\u6362\u9700\u9700\u8981\u5148\u4fdd\u5b58\u6a21\u578b\u518d\u52a0\u8f7d\u3002 \u5728\u7ebf\u8f6c\u6362 \u00b6 lmdeploy \u652f\u6301\u76f4\u63a5\u8bfb\u53d6 Huggingface \u6a21\u578b\u6743\u91cd\uff0c\u76ee\u524d\u5171\u652f\u6301\u4e09\u79cd\u7c7b\u578b\uff1a \u5728 huggingface.co \u4e0a\u9762\u901a\u8fc7 lmdeploy \u91cf\u5316\u7684\u6a21\u578b\uff0c\u5982 llama2-70b-4bit, internlm-chat-20b-4bit huggingface.co \u4e0a\u9762\u5176\u4ed6 LM \u6a21\u578b\uff0c\u5982 Qwen/Qwen-7B-Chat \u5728\u7ebf\u8f6c\u6362 \u52a0\u8f7d Huggingface \u6a21\u578b # \u9700\u8981\u80fd\u8bbf\u95ee Huggingface \u7684\u7f51\u7edc\u73af\u5883 lmdeploy chat turbomind internlm/internlm-chat-20b-4bit --model-name internlm-chat-20b lmdeploy chat turbomind Qwen/Qwen-7B-Chat --model-name qwen-7b \u76f4\u63a5\u542f\u52a8\u672c\u5730\u7684 Huggingface \u6a21\u578b lmdeploy chat turbomind /share/temp/model_repos/internlm-chat-7b/ --model-name internlm-chat-7b \u79bb\u7ebf\u8f6c\u6362 \u00b6 \u79bb\u7ebf\u8f6c\u6362\u9700\u8981\u5728\u542f\u52a8\u670d\u52a1\u4e4b\u524d\uff0c\u5c06\u6a21\u578b\u8f6c\u4e3a lmdeploy TurboMind \u7684\u683c\u5f0f\uff0c\u6267\u884c\u5b8c\u6210\u540e\u5c06\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u751f\u6210\u4e00\u4e2a workspace \u7684\u6587\u4ef6\u5939\u3002\u8fd9\u91cc\u9762\u5305\u542b\u7684\u5c31\u662f TurboMind \u548c Triton \u201c\u6a21\u578b\u63a8\u7406\u201d\u9700\u8981\u5230\u7684\u6587\u4ef6\u3002 lmdeploy convert internlm-chat-7b /path/to/internlm-chat-7b TurboMind \u63a8\u7406+\u547d\u4ee4\u884c\u672c\u5730\u5bf9\u8bdd \u00b6 \u6a21\u578b\u8f6c\u6362\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u5177\u5907\u4e86\u4f7f\u7528\u6a21\u578b\u63a8\u7406\u7684\u6761\u4ef6\uff0c\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8fdb\u884c\u771f\u6b63\u7684\u6a21\u578b\u63a8\u7406\u73af\u8282\u3002 lmdeploy chat turbomind ./workspace TurboMind \u63a8\u7406+API\u670d\u52a1 \u00b6 \u4e0a\u9762\u76f4\u63a5\u7528\u547d\u4ee4\u884c\u542f\u52a8 Client\uff0c\u63a5\u4e0b\u6765\u8fd0\u7528 lmdepoy \u8fdb\u884c\u670d\u52a1\u5316\u3002 # ApiServer+Turbomind api_server => AsyncEngine => TurboMind lmdeploy serve api_server ./workspace \\ --server_name 0 .0.0.0 \\ --server_port 23333 \\ --instance_num 64 \\ --tp 1 \u65b0\u5f00\u4e00\u4e2a\u7a97\u53e3\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6216\u76f4\u63a5\u6253\u5f00 http://{host}:23333 # ChatApiClient+ApiServer\uff08\u6ce8\u610f\u662fhttp\u534f\u8bae\uff0c\u9700\u8981\u52a0http\uff09 lmdeploy serve api_client http://localhost:23333 Web Demo \u5bf9\u8bdd \u00b6 TurboMind \u670d\u52a1\u4f5c\u4e3a\u540e\u7aef \u00b6 \u542f\u52a8\u4f5c\u4e3a\u524d\u7aef\u7684 Gradio # Gradio+ApiServer\u3002\u5fc5\u987b\u5148\u5f00\u542f Server\uff0c\u6b64\u65f6 Gradio \u4e3a Client lmdeploy serve gradio http://0.0.0.0:23333 \\ --server_name 0 .0.0.0 \\ --server_port 6006 \\ --restful_api True TurboMind \u63a8\u7406\u4f5c\u4e3a\u540e\u7aef \u00b6 # Gradio+Turbomind(local) lmdeploy serve gradio ./workspace TurboMind \u63a8\u7406+Python \u4ee3\u7801\u96c6\u6210 \u00b6 from lmdeploy import turbomind as tm # load model model_path = \"/root/share/temp/model_repos/internlm-chat-7b/\" tm_model = tm . TurboMind . from_pretrained ( model_path , model_name = 'internlm-chat-20b' ) generator = tm_model . create_instance () # process query query = \"\u4f60\u597d\u554a\u5144\u561a\" prompt = tm_model . model . get_prompt ( query ) input_ids = tm_model . tokenizer . encode ( prompt ) # inference for outputs in generator . stream_infer ( session_id = 0 , input_ids = [ input_ids ]): res , tokens = outputs [ 0 ] response = tm_model . tokenizer . decode ( res . tolist ()) print ( response ) \u6a21\u578b\u91cf\u5316 \u00b6 \u91cf\u5316\u662f\u4e00\u79cd\u4ee5\u53c2\u6570\u6216\u8ba1\u7b97\u4e2d\u95f4\u7ed3\u679c\u7cbe\u5ea6\u4e0b\u964d\u6362\u7a7a\u95f4\u8282\u7701\uff08\u4ee5\u53ca\u540c\u65f6\u5e26\u6765\u7684\u6027\u80fd\u63d0\u5347\uff09\u7684\u7b56\u7565\u3002 KV Cache \u91cf\u5316 \u00b6 \u8ba1\u7b97 minmax\u3002\u901a\u8fc7\u8ba1\u7b97\u7ed9\u5b9a\u8f93\u5165\u6837\u672c\u5728\u6bcf\u4e00\u5c42\u4e0d\u540c\u4f4d\u7f6e\u8ba1\u7b97\u7ed3\u679c\u7684\u7edf\u8ba1\u60c5\u51b5\u3002 # \u8ba1\u7b97 minmax lmdeploy lite calibrate \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --calib_dataset \"c4\" \\ --calib_samples 128 \\ --calib_seqlen 2048 \\ --work_dir ./quant_output \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570\u3002\u83b7\u53d6\u6bcf\u4e00\u5c42\u7684 KV \u4e2d\u5fc3\u503c\uff08zp\uff09\u548c\u7f29\u653e\u503c\uff08scale\uff09\u3002 # \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570 lmdeploy lite kv_qparams \\ --work_dir ./quant_output \\ --turbomind_dir workspace/triton_models/weights/ \\ --kv_sym False \\ --num_tp 1 \u4fee\u6539\u914d\u7f6e\u3002\u4fee\u6539 weights/config.ini \u6587\u4ef6\u3002 W4A16 \u91cf\u5316 \u00b6 W4A16 \u4e2d\u7684 A \u6307 Activation\uff0c\u4fdd\u6301 FP16\uff0c\u53ea\u5bf9\u53c2\u6570\u8fdb\u884c 4bits \u91cf\u5316\u3002 \u540c KV Cache \u91cf\u5316\uff0c\u8ba1\u7b97 minmax\u3002 \u91cf\u5316\u6743\u91cd\u53c2\u6570\u3002\u5229\u7528\u7b2c\u4e00\u6b65\u5f97\u5230\u7684\u7edf\u8ba1\u503c\u5bf9\u53c2\u6570\u8fdb\u884c\u91cf\u5316\u3002 \u7f29\u653e\u53c2\u6570 \u6574\u4f53\u91cf\u5316 # \u91cf\u5316\u6743\u91cd\u6a21\u578b lmdeploy lite auto_awq \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --w_bits 4 \\ --w_group_size 128 \\ --work_dir ./quant_output \u8f6c\u6362\u6210 TurboMind \u683c\u5f0f\u3002 # \u8f6c\u6362\u6a21\u578b\u7684layout\uff0c\u5b58\u653e\u5728\u9ed8\u8ba4\u8def\u5f84 ./workspace \u4e0b lmdeploy convert internlm-chat-7b ./quant_output \\ --model-format awq \\ --group-size 128 \u4f5c\u4e1a \u00b6 \u4f7f\u7528 LMDeploy \u4ee5\u672c\u5730\u5bf9\u8bdd\u3001\u7f51\u9875Gradio\u3001API\u670d\u52a1\u4e2d\u7684\u4e00\u79cd\u65b9\u5f0f\u90e8\u7f72 InternLM-Chat-7B \u6a21\u578b\uff0c\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09 \u672c\u5730\u5bf9\u8bdd Web Gradio API \u670d\u52a1","title":"\u7b2c\u4e94\u8282"},{"location":"llm/internlm/lec5/#lmdeploy","text":"\u7ea6 1186 \u4e2a\u5b57 66 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u5b66\u4e60\u81ea LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5","title":"LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5"},{"location":"llm/internlm/lec5/#_1","text":"","title":"\u5927\u6a21\u578b\u90e8\u7f72\u80cc\u666f"},{"location":"llm/internlm/lec5/#_2","text":"\u5b9a\u4e49 \u5c06\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u5728\u7279\u5b9a\u8f6f\u786c\u4ef6\u73af\u5883\u4e2d\u542f\u52a8\u7684\u8fc7\u7a0b\uff0c\u4f7f\u6a21\u578b\u80fd\u591f\u63a5\u53d7\u8f93\u5165\u5e76\u8fd4\u56de\u9884\u6d4b\u7ed3\u679c \u4e3a\u4e86\u6ee1\u8db3\u6027\u80fd\u548c\u6548\u7387\u7684\u9700\u6c42\uff0c\u5e38\u5e38\u9700\u8981\u5bf9\u6a21\u578b\u8fdb\u884c\u4f18\u5316\uff0c\u4f8b\u5982\u6a21\u578b\u538b\u7f29\u548c\u786c\u4ef6\u52a0\u901f \u4ea7\u54c1\u5f62\u6001 \u4e91\u7aef\u3001\u8fb9\u7f18\u8ba1\u7b97\u7aef\u3001\u79fb\u52a8\u7aef \u8ba1\u7b97\u8bbe\u5907 CPU\u3001GPU\u3001TPU\u3001NPU \u7b49","title":"\u6a21\u578b\u90e8\u7f72"},{"location":"llm/internlm/lec5/#_3","text":"\u5185\u5b58\u5f00\u9500\u5de8\u5927 \u5e9e\u5927\u53c2\u6570\u91cf\uff0c7B \u6a21\u578b\u4ec5\u6743\u91cd\u5c31\u9700\u8981 14+G \u5185\u5b58 \u91c7\u7528\u81ea\u56de\u5f52\u751f\u6210 token\uff0c\u9700\u8981\u7f13\u5b58 Attention \u7684 k/v\uff0c\u5e26\u6765\u5de8\u5927\u7684\u5185\u5b58\u5f00\u9500 \u52a8\u6001 shape \u8bf7\u6c42\u6570\u4e0d\u56fa\u5b9a Token \u9010\u4e2a\u751f\u6210\uff0c\u4e14\u6570\u91cf\u4e0d\u5b9a \u76f8\u5bf9\u89c6\u89c9\u6a21\u578b\uff0cLLM \u7ed3\u6784\u7b80\u5355 Transformers \u7ed3\u6784\uff0c\u5927\u90e8\u5206\u662f decoder-only","title":"\u5927\u6a21\u578b\u7279\u70b9"},{"location":"llm/internlm/lec5/#_4","text":"\u8bbe\u5907 \u5982\u4f55\u5e94\u5bf9\u5de8\u5927\u7684\u5b58\u50a8\u95ee\u9898\uff1f\u4f4e\u5b58\u50a8\u8bbe\u5907\uff08\u6d88\u8d39\u7ea7\u663e\u5361\u3001\u624b\u673a\u7b49\uff09\u5982\u4f55\u90e8\u7f72\uff1f \u63a8\u7406 \u5982\u4f55\u52a0\u901f token \u7684\u751f\u6210\u901f\u5ea6 \u5982\u4f55\u89e3\u51b3\u52a8\u6001 shape\uff0c\u8ba9\u63a8\u7406\u53ef\u4ee5\u4e0d\u95f4\u65ad \u5982\u4f55\u6709\u6548\u76d1\u7763\u548c\u5229\u7528\u5185\u5b58 \u670d\u52a1 \u5982\u4f55\u63d0\u5347\u7cfb\u7edf\u6574\u4f53\u541e\u5410\u91cf\uff1f \u5bf9\u4e8e\u4e2a\u4f53\u7528\u6237\uff0c\u5982\u4f55\u964d\u4f4e\u54cd\u5e94\u65f6\u95f4\uff1f","title":"\u5927\u6a21\u578b\u90e8\u7f72\u6311\u6218"},{"location":"llm/internlm/lec5/#_5","text":"\u6280\u672f\u70b9 \u6a21\u578b\u5e76\u884c \u4f4e\u6bd4\u7279\u91cf\u5316 Page Attention transformer \u8ba1\u7b97\u548c\u8bbf\u5b58\u4f18\u5316 Continuous Batch ... \u65b9\u6848 huggingface Transformers \u4e13\u95e8\u7684\u63a8\u7406\u52a0\u901f\u6846\u67b6 \u4e91\u7aef lmdeploy vllm tensorrt-llm deepspeed \u79fb\u52a8\u7aef llama.cpp mlc-llm ...","title":"\u5927\u6a21\u578b\u90e8\u7f72\u65b9\u6848"},{"location":"llm/internlm/lec5/#lmdeploy_1","text":"LMDeploy \u662f LLM \u5728 Nvidia \u8bbe\u5907\u4e0a\u90e8\u7f72\u7684\u5168\u6d41\u7a0b\u89e3\u51b3\u65b9\u6848\uff0c\u5305\u62ec\u6a21\u578b\u8f7b\u91cf\u5316\u3001\u63a8\u7406\u3001\u670d\u52a1\u3002","title":"LMDeploy \u7b80\u4ecb"},{"location":"llm/internlm/lec5/#_6","text":"","title":"\u6838\u5fc3\u529f\u80fd"},{"location":"llm/internlm/lec5/#_7","text":"\u4e3a\u4ec0\u4e48 Weight Only \u91cf\u5316\uff1f 4bit Weight Only \u91cf\u5316\uff0c\u5c06 FP16 \u7684\u6a21\u578b\u6743\u91cd\u91cf\u5316\u4e3a INT4\uff0c\u8bbf\u5b58\u91cf\u76f4\u63a5\u964d\u4e3a FP16 \u7684\u6a21\u578b 1/4\uff0c\u5927\u5e45\u964d\u4f4e\u4e86\u8bbf\u5b58\u6210\u672c\uff0c\u63d0\u9ad8 Decoding \u7684\u901f\u5ea6\u3002 \u52a0\u901f\u7684\u540c\u65f6\u8fd8\u8282\u7701\u663e\u5b58\uff0c\u540c\u6837\u7684\u8bbe\u5907\u80fd\u591f\u652f\u6301\u66f4\u5927\u7684\u6a21\u578b\u4ee5\u53ca\u66f4\u957f\u7684\u5bf9\u8bdd\u957f\u5ea6\u3002 \u5982\u4f55\u505a Weight Only \u91cf\u5316\uff1f LMDeploy \u4f7f\u7528 MIT HAN LAB \u5f00\u6e90\u7684 AWQ \u7b97\u6cd5\uff0c\u91cf\u5316\u4e3a 4bit \u6a21\u578b \u63a8\u7406\u65f6\uff0c\u5148\u628a 4bit \u6743\u91cd\uff0c \u53cd\u91cf\u5316\u56deFP16 \uff08\u5728 Kernel \u5185\u90e8\u8fdb\u884c\uff0c\u4ece Global Memory \u8bfb\u53d6\u65f6\u4ecd\u662f 4bit\uff09\uff0c\u4f9d\u65e7\u4f7f\u7528\u7684\u662f FP16 \u8ba1\u7b97 \u60f3\u8f83\u4e8e\u793e\u533a\u4f7f\u7528\u6700\u591a\u7684 GPTQ \u7b97\u6cd5\uff0cAWQ \u7684\u63a8\u7406\u901f\u5ea6\u66f4\u5feb\uff0c\u91cf\u5316\u65f6\u95f4\u66f4\u77ed","title":"\u91cf\u5316"},{"location":"llm/internlm/lec5/#turbomind","text":"\u6301\u7eed\u6279\u5904\u7406 \u6709\u72b6\u6001\u7684\u63a8\u7406 \u9ad8\u6027\u80fd cuda Kernel Blocked k/v cache","title":"\u63a8\u7406\u5f15\u64ce TurboMind"},{"location":"llm/internlm/lec5/#api-server","text":"lmdeploy serve api_server InternLM/internlm-chat-7b \\ --model-name internlm-chat-7b --server-port 8080","title":"\u63a8\u7406\u670d\u52a1 api server"},{"location":"llm/internlm/lec5/#_8","text":"","title":"\u670d\u52a1\u90e8\u7f72"},{"location":"llm/internlm/lec5/#_9","text":"\u4f7f\u7528 TurboMind \u63a8\u7406\u6a21\u578b\u9700\u8981\u5148\u5c06\u6a21\u578b\u8f6c\u5316\u4e3a TurboMind \u7684\u683c\u5f0f\uff0c\u76ee\u524d\u652f\u6301\u5728\u7ebf\u8f6c\u6362\u548c\u79bb\u7ebf\u8f6c\u6362\u4e24\u79cd\u5f62\u5f0f\u3002\u5728\u7ebf\u8f6c\u6362\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7d Huggingface \u6a21\u578b\uff0c\u79bb\u7ebf\u8f6c\u6362\u9700\u9700\u8981\u5148\u4fdd\u5b58\u6a21\u578b\u518d\u52a0\u8f7d\u3002","title":"\u6a21\u578b\u8f6c\u6362"},{"location":"llm/internlm/lec5/#_10","text":"lmdeploy \u652f\u6301\u76f4\u63a5\u8bfb\u53d6 Huggingface \u6a21\u578b\u6743\u91cd\uff0c\u76ee\u524d\u5171\u652f\u6301\u4e09\u79cd\u7c7b\u578b\uff1a \u5728 huggingface.co \u4e0a\u9762\u901a\u8fc7 lmdeploy \u91cf\u5316\u7684\u6a21\u578b\uff0c\u5982 llama2-70b-4bit, internlm-chat-20b-4bit huggingface.co \u4e0a\u9762\u5176\u4ed6 LM \u6a21\u578b\uff0c\u5982 Qwen/Qwen-7B-Chat \u5728\u7ebf\u8f6c\u6362 \u52a0\u8f7d Huggingface \u6a21\u578b # \u9700\u8981\u80fd\u8bbf\u95ee Huggingface \u7684\u7f51\u7edc\u73af\u5883 lmdeploy chat turbomind internlm/internlm-chat-20b-4bit --model-name internlm-chat-20b lmdeploy chat turbomind Qwen/Qwen-7B-Chat --model-name qwen-7b \u76f4\u63a5\u542f\u52a8\u672c\u5730\u7684 Huggingface \u6a21\u578b lmdeploy chat turbomind /share/temp/model_repos/internlm-chat-7b/ --model-name internlm-chat-7b","title":"\u5728\u7ebf\u8f6c\u6362"},{"location":"llm/internlm/lec5/#_11","text":"\u79bb\u7ebf\u8f6c\u6362\u9700\u8981\u5728\u542f\u52a8\u670d\u52a1\u4e4b\u524d\uff0c\u5c06\u6a21\u578b\u8f6c\u4e3a lmdeploy TurboMind \u7684\u683c\u5f0f\uff0c\u6267\u884c\u5b8c\u6210\u540e\u5c06\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u751f\u6210\u4e00\u4e2a workspace \u7684\u6587\u4ef6\u5939\u3002\u8fd9\u91cc\u9762\u5305\u542b\u7684\u5c31\u662f TurboMind \u548c Triton \u201c\u6a21\u578b\u63a8\u7406\u201d\u9700\u8981\u5230\u7684\u6587\u4ef6\u3002 lmdeploy convert internlm-chat-7b /path/to/internlm-chat-7b","title":"\u79bb\u7ebf\u8f6c\u6362"},{"location":"llm/internlm/lec5/#turbomind_1","text":"\u6a21\u578b\u8f6c\u6362\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u5177\u5907\u4e86\u4f7f\u7528\u6a21\u578b\u63a8\u7406\u7684\u6761\u4ef6\uff0c\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8fdb\u884c\u771f\u6b63\u7684\u6a21\u578b\u63a8\u7406\u73af\u8282\u3002 lmdeploy chat turbomind ./workspace","title":"TurboMind \u63a8\u7406+\u547d\u4ee4\u884c\u672c\u5730\u5bf9\u8bdd"},{"location":"llm/internlm/lec5/#turbomind-api","text":"\u4e0a\u9762\u76f4\u63a5\u7528\u547d\u4ee4\u884c\u542f\u52a8 Client\uff0c\u63a5\u4e0b\u6765\u8fd0\u7528 lmdepoy \u8fdb\u884c\u670d\u52a1\u5316\u3002 # ApiServer+Turbomind api_server => AsyncEngine => TurboMind lmdeploy serve api_server ./workspace \\ --server_name 0 .0.0.0 \\ --server_port 23333 \\ --instance_num 64 \\ --tp 1 \u65b0\u5f00\u4e00\u4e2a\u7a97\u53e3\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6216\u76f4\u63a5\u6253\u5f00 http://{host}:23333 # ChatApiClient+ApiServer\uff08\u6ce8\u610f\u662fhttp\u534f\u8bae\uff0c\u9700\u8981\u52a0http\uff09 lmdeploy serve api_client http://localhost:23333","title":"TurboMind \u63a8\u7406+API\u670d\u52a1"},{"location":"llm/internlm/lec5/#web-demo","text":"","title":"Web Demo \u5bf9\u8bdd"},{"location":"llm/internlm/lec5/#turbomind_2","text":"\u542f\u52a8\u4f5c\u4e3a\u524d\u7aef\u7684 Gradio # Gradio+ApiServer\u3002\u5fc5\u987b\u5148\u5f00\u542f Server\uff0c\u6b64\u65f6 Gradio \u4e3a Client lmdeploy serve gradio http://0.0.0.0:23333 \\ --server_name 0 .0.0.0 \\ --server_port 6006 \\ --restful_api True","title":"TurboMind \u670d\u52a1\u4f5c\u4e3a\u540e\u7aef"},{"location":"llm/internlm/lec5/#turbomind_3","text":"# Gradio+Turbomind(local) lmdeploy serve gradio ./workspace","title":"TurboMind \u63a8\u7406\u4f5c\u4e3a\u540e\u7aef"},{"location":"llm/internlm/lec5/#turbomind-python","text":"from lmdeploy import turbomind as tm # load model model_path = \"/root/share/temp/model_repos/internlm-chat-7b/\" tm_model = tm . TurboMind . from_pretrained ( model_path , model_name = 'internlm-chat-20b' ) generator = tm_model . create_instance () # process query query = \"\u4f60\u597d\u554a\u5144\u561a\" prompt = tm_model . model . get_prompt ( query ) input_ids = tm_model . tokenizer . encode ( prompt ) # inference for outputs in generator . stream_infer ( session_id = 0 , input_ids = [ input_ids ]): res , tokens = outputs [ 0 ] response = tm_model . tokenizer . decode ( res . tolist ()) print ( response )","title":"TurboMind \u63a8\u7406+Python \u4ee3\u7801\u96c6\u6210"},{"location":"llm/internlm/lec5/#_12","text":"\u91cf\u5316\u662f\u4e00\u79cd\u4ee5\u53c2\u6570\u6216\u8ba1\u7b97\u4e2d\u95f4\u7ed3\u679c\u7cbe\u5ea6\u4e0b\u964d\u6362\u7a7a\u95f4\u8282\u7701\uff08\u4ee5\u53ca\u540c\u65f6\u5e26\u6765\u7684\u6027\u80fd\u63d0\u5347\uff09\u7684\u7b56\u7565\u3002","title":"\u6a21\u578b\u91cf\u5316"},{"location":"llm/internlm/lec5/#kv-cache","text":"\u8ba1\u7b97 minmax\u3002\u901a\u8fc7\u8ba1\u7b97\u7ed9\u5b9a\u8f93\u5165\u6837\u672c\u5728\u6bcf\u4e00\u5c42\u4e0d\u540c\u4f4d\u7f6e\u8ba1\u7b97\u7ed3\u679c\u7684\u7edf\u8ba1\u60c5\u51b5\u3002 # \u8ba1\u7b97 minmax lmdeploy lite calibrate \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --calib_dataset \"c4\" \\ --calib_samples 128 \\ --calib_seqlen 2048 \\ --work_dir ./quant_output \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570\u3002\u83b7\u53d6\u6bcf\u4e00\u5c42\u7684 KV \u4e2d\u5fc3\u503c\uff08zp\uff09\u548c\u7f29\u653e\u503c\uff08scale\uff09\u3002 # \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570 lmdeploy lite kv_qparams \\ --work_dir ./quant_output \\ --turbomind_dir workspace/triton_models/weights/ \\ --kv_sym False \\ --num_tp 1 \u4fee\u6539\u914d\u7f6e\u3002\u4fee\u6539 weights/config.ini \u6587\u4ef6\u3002","title":"KV Cache \u91cf\u5316"},{"location":"llm/internlm/lec5/#w4a16","text":"W4A16 \u4e2d\u7684 A \u6307 Activation\uff0c\u4fdd\u6301 FP16\uff0c\u53ea\u5bf9\u53c2\u6570\u8fdb\u884c 4bits \u91cf\u5316\u3002 \u540c KV Cache \u91cf\u5316\uff0c\u8ba1\u7b97 minmax\u3002 \u91cf\u5316\u6743\u91cd\u53c2\u6570\u3002\u5229\u7528\u7b2c\u4e00\u6b65\u5f97\u5230\u7684\u7edf\u8ba1\u503c\u5bf9\u53c2\u6570\u8fdb\u884c\u91cf\u5316\u3002 \u7f29\u653e\u53c2\u6570 \u6574\u4f53\u91cf\u5316 # \u91cf\u5316\u6743\u91cd\u6a21\u578b lmdeploy lite auto_awq \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --w_bits 4 \\ --w_group_size 128 \\ --work_dir ./quant_output \u8f6c\u6362\u6210 TurboMind \u683c\u5f0f\u3002 # \u8f6c\u6362\u6a21\u578b\u7684layout\uff0c\u5b58\u653e\u5728\u9ed8\u8ba4\u8def\u5f84 ./workspace \u4e0b lmdeploy convert internlm-chat-7b ./quant_output \\ --model-format awq \\ --group-size 128","title":"W4A16 \u91cf\u5316"},{"location":"llm/internlm/lec5/#_13","text":"\u4f7f\u7528 LMDeploy \u4ee5\u672c\u5730\u5bf9\u8bdd\u3001\u7f51\u9875Gradio\u3001API\u670d\u52a1\u4e2d\u7684\u4e00\u79cd\u65b9\u5f0f\u90e8\u7f72 InternLM-Chat-7B \u6a21\u578b\uff0c\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09 \u672c\u5730\u5bf9\u8bdd Web Gradio API \u670d\u52a1","title":"\u4f5c\u4e1a"},{"location":"llm/internlm/lec6/","text":"OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b \u00b6 \u7ea6 418 \u4e2a\u5b57 14 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5b66\u4e60\u81ea OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b OpenCompass \u4ecb\u7ecd \u00b6 \u5728 OpenCompass \u4e2d\u8bc4\u4f30\u4e00\u4e2a\u6a21\u578b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u9636\u6bb5\uff1a \u914d\u7f6e -> \u63a8\u7406 -> \u8bc4\u4f30 -> \u53ef\u89c6\u5316 \u3002 \u914d\u7f6e \uff1a\u8fd9\u662f\u6574\u4e2a\u5de5\u4f5c\u6d41\u7684\u8d77\u70b9\u3002\u60a8\u9700\u8981\u914d\u7f6e\u6574\u4e2a\u8bc4\u4f30\u8fc7\u7a0b\uff0c\u9009\u62e9\u8981\u8bc4\u4f30\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u8bc4\u4f30\u7b56\u7565\u3001\u8ba1\u7b97\u540e\u7aef\u7b49\uff0c\u5e76\u5b9a\u4e49\u663e\u793a\u7ed3\u679c\u7684\u65b9\u5f0f\u3002 \u63a8\u7406\u4e0e\u8bc4\u4f30 \uff1a\u5728\u8fd9\u4e2a\u9636\u6bb5\uff0cOpenCompass \u5c06\u4f1a\u5f00\u59cb\u5bf9\u6a21\u578b\u548c\u6570\u636e\u96c6\u8fdb\u884c\u5e76\u884c\u63a8\u7406\u548c\u8bc4\u4f30\u3002\u63a8\u7406\u9636\u6bb5\u4e3b\u8981\u662f\u8ba9\u6a21\u578b\u4ece\u6570\u636e\u96c6\u4ea7\u751f\u8f93\u51fa\uff0c\u800c\u8bc4\u4f30\u9636\u6bb5\u5219\u662f\u8861\u91cf\u8fd9\u4e9b\u8f93\u51fa\u4e0e\u6807\u51c6\u7b54\u6848\u7684\u5339\u914d\u7a0b\u5ea6\u3002\u8fd9\u4e24\u4e2a\u8fc7\u7a0b\u4f1a\u88ab\u62c6\u5206\u4e3a\u591a\u4e2a\u540c\u65f6\u8fd0\u884c\u7684\u201c\u4efb\u52a1\u201d\u4ee5\u63d0\u9ad8\u6548\u7387\uff0c\u4f46\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u8ba1\u7b97\u8d44\u6e90\u6709\u9650\uff0c\u8fd9\u79cd\u7b56\u7565\u53ef\u80fd\u4f1a\u4f7f\u8bc4\u6d4b\u53d8\u5f97\u66f4\u6162\u3002 \u53ef\u89c6\u5316 \uff1a\u8bc4\u4f30\u5b8c\u6210\u540e\uff0cOpenCompass \u5c06\u7ed3\u679c\u6574\u7406\u6210\u6613\u8bfb\u7684\u8868\u683c\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a CSV \u548c TXT \u6587\u4ef6\u3002\u4f60\u4e5f\u53ef\u4ee5\u6fc0\u6d3b\u98de\u4e66\u72b6\u6001\u4e0a\u62a5\u529f\u80fd\uff0c\u6b64\u540e\u53ef\u4ee5\u5728\u98de\u4e66\u5ba2\u6237\u7aef\u4e2d\u53ca\u65f6\u83b7\u5f97\u8bc4\u6d4b\u72b6\u6001\u62a5\u544a\u3002 \u5b89\u88c5 & \u4f7f\u7528 \u00b6 \u9762\u5411GPU\u7684\u73af\u5883\u5b89\u88c5 \u00b6 conda create --name opencompass --clone = /root/share/conda_envs/internlm-base source activate opencompass git clone https://github.com/open-compass/opencompass cd opencompass pip install -e . \u6570\u636e\u51c6\u5907 \u00b6 \u5c06\u6570\u636e\u96c6\u653e\u5230 data \u76ee\u5f55\u4e0b\uff0c\u4f8b\u5982\uff1a cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/ unzip OpenCompassData-core-20231110.zip \u67e5\u770b\u652f\u6301\u7684\u6570\u636e\u96c6\u548c\u6a21\u578b \u00b6 # \u5217\u51fa\u6240\u6709\u8ddf internlm \u53ca ceval \u76f8\u5173\u7684\u914d\u7f6e python tools/list_configs.py internlm ceval \u542f\u52a8\u8bc4\u6d4b \u00b6 \u901a\u8fc7 --debug \u6a21\u5f0f\u542f\u52a8\u8bc4\u4f30\uff0c\u4efb\u52a1\u5c06\u6309\u987a\u5e8f\u6267\u884c\uff0c\u5e76\u5b9e\u65f6\u6253\u5370\u8f93\u51fa\u3002 python run.py --datasets ceval_gen --hf-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-kwargs padding_side = 'left' truncation = 'left' trust_remote_code = True --model-kwargs trust_remote_code = True device_map = 'auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug \u53ef\u89c6\u5316\u8bc4\u4f30\u7ed3\u679c \u00b6 \u8bc4\u4f30\u5b8c\u6210\u540e\uff0c\u8bc4\u4f30\u7ed3\u679c\u8868\u683c\u5c06\u6253\u5370\u5982\u4e0b\uff1a dataset version metric mode opt350m opt125m --------- --------- -------- ------ --------- --------- siqa e78df3 accuracy gen 21.55 12.44 winograd b6c7ed accuracy ppl 51.23 49.82 \u6240\u6709\u8fd0\u884c\u8f93\u51fa\u5c06\u5b9a\u5411\u5230 outputs/demo/ \u76ee\u5f55 \u4f5c\u4e1a \u00b6 \u4f7f\u7528 OpenCompass \u8bc4\u6d4b InternLM2-Chat-7B \u6a21\u578b\u5728 C-Eval \u6570\u636e\u96c6\u4e0a\u7684\u6027\u80fd","title":"\u7b2c\u516d\u8282"},{"location":"llm/internlm/lec6/#opencompass","text":"\u7ea6 418 \u4e2a\u5b57 14 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5b66\u4e60\u81ea OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b","title":"OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b"},{"location":"llm/internlm/lec6/#opencompass_1","text":"\u5728 OpenCompass \u4e2d\u8bc4\u4f30\u4e00\u4e2a\u6a21\u578b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u9636\u6bb5\uff1a \u914d\u7f6e -> \u63a8\u7406 -> \u8bc4\u4f30 -> \u53ef\u89c6\u5316 \u3002 \u914d\u7f6e \uff1a\u8fd9\u662f\u6574\u4e2a\u5de5\u4f5c\u6d41\u7684\u8d77\u70b9\u3002\u60a8\u9700\u8981\u914d\u7f6e\u6574\u4e2a\u8bc4\u4f30\u8fc7\u7a0b\uff0c\u9009\u62e9\u8981\u8bc4\u4f30\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u8bc4\u4f30\u7b56\u7565\u3001\u8ba1\u7b97\u540e\u7aef\u7b49\uff0c\u5e76\u5b9a\u4e49\u663e\u793a\u7ed3\u679c\u7684\u65b9\u5f0f\u3002 \u63a8\u7406\u4e0e\u8bc4\u4f30 \uff1a\u5728\u8fd9\u4e2a\u9636\u6bb5\uff0cOpenCompass \u5c06\u4f1a\u5f00\u59cb\u5bf9\u6a21\u578b\u548c\u6570\u636e\u96c6\u8fdb\u884c\u5e76\u884c\u63a8\u7406\u548c\u8bc4\u4f30\u3002\u63a8\u7406\u9636\u6bb5\u4e3b\u8981\u662f\u8ba9\u6a21\u578b\u4ece\u6570\u636e\u96c6\u4ea7\u751f\u8f93\u51fa\uff0c\u800c\u8bc4\u4f30\u9636\u6bb5\u5219\u662f\u8861\u91cf\u8fd9\u4e9b\u8f93\u51fa\u4e0e\u6807\u51c6\u7b54\u6848\u7684\u5339\u914d\u7a0b\u5ea6\u3002\u8fd9\u4e24\u4e2a\u8fc7\u7a0b\u4f1a\u88ab\u62c6\u5206\u4e3a\u591a\u4e2a\u540c\u65f6\u8fd0\u884c\u7684\u201c\u4efb\u52a1\u201d\u4ee5\u63d0\u9ad8\u6548\u7387\uff0c\u4f46\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u8ba1\u7b97\u8d44\u6e90\u6709\u9650\uff0c\u8fd9\u79cd\u7b56\u7565\u53ef\u80fd\u4f1a\u4f7f\u8bc4\u6d4b\u53d8\u5f97\u66f4\u6162\u3002 \u53ef\u89c6\u5316 \uff1a\u8bc4\u4f30\u5b8c\u6210\u540e\uff0cOpenCompass \u5c06\u7ed3\u679c\u6574\u7406\u6210\u6613\u8bfb\u7684\u8868\u683c\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a CSV \u548c TXT \u6587\u4ef6\u3002\u4f60\u4e5f\u53ef\u4ee5\u6fc0\u6d3b\u98de\u4e66\u72b6\u6001\u4e0a\u62a5\u529f\u80fd\uff0c\u6b64\u540e\u53ef\u4ee5\u5728\u98de\u4e66\u5ba2\u6237\u7aef\u4e2d\u53ca\u65f6\u83b7\u5f97\u8bc4\u6d4b\u72b6\u6001\u62a5\u544a\u3002","title":"OpenCompass \u4ecb\u7ecd"},{"location":"llm/internlm/lec6/#_1","text":"","title":"\u5b89\u88c5 & \u4f7f\u7528"},{"location":"llm/internlm/lec6/#gpu","text":"conda create --name opencompass --clone = /root/share/conda_envs/internlm-base source activate opencompass git clone https://github.com/open-compass/opencompass cd opencompass pip install -e .","title":"\u9762\u5411GPU\u7684\u73af\u5883\u5b89\u88c5"},{"location":"llm/internlm/lec6/#_2","text":"\u5c06\u6570\u636e\u96c6\u653e\u5230 data \u76ee\u5f55\u4e0b\uff0c\u4f8b\u5982\uff1a cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/ unzip OpenCompassData-core-20231110.zip","title":"\u6570\u636e\u51c6\u5907"},{"location":"llm/internlm/lec6/#_3","text":"# \u5217\u51fa\u6240\u6709\u8ddf internlm \u53ca ceval \u76f8\u5173\u7684\u914d\u7f6e python tools/list_configs.py internlm ceval","title":"\u67e5\u770b\u652f\u6301\u7684\u6570\u636e\u96c6\u548c\u6a21\u578b"},{"location":"llm/internlm/lec6/#_4","text":"\u901a\u8fc7 --debug \u6a21\u5f0f\u542f\u52a8\u8bc4\u4f30\uff0c\u4efb\u52a1\u5c06\u6309\u987a\u5e8f\u6267\u884c\uff0c\u5e76\u5b9e\u65f6\u6253\u5370\u8f93\u51fa\u3002 python run.py --datasets ceval_gen --hf-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-kwargs padding_side = 'left' truncation = 'left' trust_remote_code = True --model-kwargs trust_remote_code = True device_map = 'auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug","title":"\u542f\u52a8\u8bc4\u6d4b"},{"location":"llm/internlm/lec6/#_5","text":"\u8bc4\u4f30\u5b8c\u6210\u540e\uff0c\u8bc4\u4f30\u7ed3\u679c\u8868\u683c\u5c06\u6253\u5370\u5982\u4e0b\uff1a dataset version metric mode opt350m opt125m --------- --------- -------- ------ --------- --------- siqa e78df3 accuracy gen 21.55 12.44 winograd b6c7ed accuracy ppl 51.23 49.82 \u6240\u6709\u8fd0\u884c\u8f93\u51fa\u5c06\u5b9a\u5411\u5230 outputs/demo/ \u76ee\u5f55","title":"\u53ef\u89c6\u5316\u8bc4\u4f30\u7ed3\u679c"},{"location":"llm/internlm/lec6/#_6","text":"\u4f7f\u7528 OpenCompass \u8bc4\u6d4b InternLM2-Chat-7B \u6a21\u578b\u5728 C-Eval \u6570\u636e\u96c6\u4e0a\u7684\u6027\u80fd","title":"\u4f5c\u4e1a"},{"location":"llm/nlp/","text":"NLP \u00b6 Abstract \u8865\u5145\u4e00\u4e9b NLP \u7684\u57fa\u7840\u77e5\u8bc6\u3002 Table of Contents \u00b6 Word2Vec RNN","title":"NLP"},{"location":"llm/nlp/#nlp","text":"Abstract \u8865\u5145\u4e00\u4e9b NLP \u7684\u57fa\u7840\u77e5\u8bc6\u3002","title":"NLP"},{"location":"llm/nlp/#table-of-contents","text":"Word2Vec RNN","title":"Table of Contents"},{"location":"llm/nlp/rnns/","text":"RNNs \u00b6 \u7ea6 2807 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract NLP \u91cc\u6700\u5e38\u7528\u3001\u6700\u4f20\u7edf\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5c31\u662f \u5faa\u73af\u795e\u7ecf\u7f51\u7edc RNN\uff08Recurrent Neural Network\uff09 \u3002 RNN \u6709\u5f88\u591a\u53d8\u79cd\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5c31\u662f LSTM\uff08Long Short-Term Memory\uff09 \u548c GRU\uff08Gated Recurrent Unit\uff09 \u3002\u672c\u6587\u5c06\u4ecb\u7ecd RNN\u3001LSTM \u548c GRU \u7684\u539f\u7406\u3002 \u6982\u8ff0 \u00b6 \u5168\u8fde\u63a5\u795e\u7ecf\u7f51\u7edc DNN \u548c \u5377\u79ef\u795e\u7ecf\u7f51\u7edc CNN\uff0c\u5b83\u4eec\u7684\u524d\u4e00\u4e2a\u8f93\u5165\u548c\u540e\u4e00\u4e2a\u8f93\u5165\u662f\u6ca1\u6709\u5173\u7cfb\u7684\u3002\u5f53\u6211\u4eec\u5904\u7406 \u5e8f\u5217\u4fe1\u606f \u65f6\uff0c\u67d0\u4e9b\u524d\u9762\u7684\u8f93\u5165\u548c\u540e\u9762\u7684\u8f93\u5165\u662f\u6709\u5173\u7cfb\u7684\uff0c\u6bd4\u5982\uff1a\u5f53\u6211\u4eec\u5728\u7406\u89e3\u4e00\u53e5\u8bdd\u7684\u610f\u601d\u65f6\uff0c\u5b64\u7acb\u7684\u7406\u89e3\u8fd9\u53e5\u8bdd\u7684\u6bcf\u4e2a\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6211\u4eec\u9700\u8981\u5904\u7406\u8fd9\u4e9b\u8bcd\u8fde\u63a5\u8d77\u6765\u7684\u6574\u4e2a \u5e8f\u5217 \uff1b\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u9700\u8981\u4f7f\u7528\u5230 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08Recurrent Neural Network\uff09 \u3002 RNN\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u6700\u5148\u88ab\u4f7f\u7528\u8d77\u6765\uff0cRNN\u53ef\u4ee5\u4e3a\u8bed\u8a00\u6a21\u578b\u8fdb\u884c\u5efa\u6a21\uff1a \u6211\u6ca1\u6709\u5b8c\u6210\u4e0a\u7ea7\u5e03\u7f6e\u7ed9\u6211\u7684\u4efb\u52a1\uff0c\u6240\u4ee5 \u88ab\u5f00\u9664\u4e86 \u8ba9\u7535\u8111\u6765\u586b\u5199\u4e0b\u5212\u7ebf\u7684\u8bcd\u6700\u6709\u53ef\u80fd\u7684\u662f\u300e\u6211\u300f\uff0c\u800c\u4e0d\u592a\u53ef\u80fd\u662f\u300e\u5c0f\u660e\u300f\uff0c\u751a\u81f3\u662f\u300e\u5403\u996d\u300f\u3002 \u8bed\u8a00\u6a21\u578b\u5c31\u662f\u8fd9\u6837\u7684\u4e1c\u897f\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e00\u53e5\u8bdd\u524d\u9762\u7684\u90e8\u5206\uff0c\u9884\u6d4b\u63a5\u4e0b\u6765\u6700\u6709\u53ef\u80fd\u7684\u4e00\u4e2a\u8bcd\u662f\u4ec0\u4e48\u3002 \u57fa\u672c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc \u00b6 \u57fa\u672c\u7684 RNN\uff0c\u7ed3\u6784\u7531 \u8f93\u5165\u5c42\u3001\u4e00\u4e2a\u9690\u85cf\u5c42\u548c\u8f93\u51fa\u5c42 \u7ec4\u6210\u3002 x \u662f\u8f93\u5165\u5411\u91cf o \u662f\u8f93\u51fa\u5411\u91cf s \u8868\u793a\u9690\u85cf\u5c42\u7684\u503c U \u662f\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6743\u91cd\u77e9\u9635 V \u65f6\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u7684\u503c s \u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e\u5f53\u524d\u8fd9\u6b21\u7684\u8f93\u5165 x\uff0c\u8fd8\u53d6\u51b3\u4e8e\u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u7684\u503c s\u3002\u6743\u91cd\u77e9\u9635 W \u5c31\u662f\u9690\u85cf\u5c42\u4e0a\u4e00\u6b21\u7684\u503c\u4f5c\u4e3a\u8fd9\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u3002 \u5c06\u4e0a\u56fe\u7684\u57fa\u672c RNN \u7ed3\u6784\u5728\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff08RNN \u662f\u4e00\u4e2a\u94fe\u5f0f\u7ed3\u6784\uff0c\u6bcf\u4e2a\u65f6\u95f4\u7247\u4f7f\u7528\u7684\u90fd\u662f\u76f8\u540c\u7684\u53c2\u6570\uff09 \u8fd9\u4e2a\u7f51\u7edc\u5728 t \u65f6\u523b\u63a5\u6536\u5230\u8f93\u5165 \\(x_t\\) \u4e4b\u540e\uff0c\u9690\u85cf\u5c42\u7684\u503c\u662f \\(s_t\\) \uff0c\u8f93\u51fa\u5c42\u7684\u503c\u662f \\(o_t\\) \uff0c \u5173\u952e\u7684\u662f\uff0c \\(s_t\\) \u7684\u503c\u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e \\(x_t\\) \uff0c\u8fd8\u53d6\u51b3\u4e8e \\(s_{t-1}\\) \u3002 \\[ s_t=f(U * x_t + W * s_{t-1}) \\\\ o_t=g(V * s_t) \\] \u516c\u5f0f1 \u662f\u9690\u85cf\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0c\u5b83\u662f\u5faa\u73af\u5c42\u3002U \u662f\u8f93\u5165 x \u7684\u6743\u91cd\u77e9\u9635\uff0cW \u662f \u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u503c \\(s_{t-1}\\) \u4f5c\u4e3a\u5219\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u77e9\u9635\uff0cf \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u516c\u5f0f2 \u662f\u8f93\u51fa\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0cV \u662f\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635\uff0cg \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u9690\u85cf\u5c42\u6709\u4e24\u4e2a\u8f93\u5165\uff0c\u7b2c\u4e00\u662f U \u4e0e \\(x_t\\) \u5411\u91cf\u7684\u4e58\u79ef\uff0c\u7b2c\u4e8c\u662f\u4e0a\u4e00\u9690\u85cf\u5c42\u8f93\u51fa\u7684\u72b6\u6001 \\(s_{t-1}\\) \u4e0e W \u7684\u4e58\u79ef\u3002\u7b49\u4e8e\u4e0a\u4e00\u4e2a\u65f6\u523b\u8ba1\u7b97\u7684 \\(s_{t-1}\\) \u9700\u8981\u7f13\u5b58\u4e00\u4e0b\uff0c\u5728\u672c\u6b21\u8f93\u5165 \\(x_t\\) \u4e00\u8d77\u8ba1\u7b97\uff0c\u5171\u540c\u8f93\u51fa\u6700\u540e\u7684 \\(o_t\\) \u3002 \u5982\u679c\u53cd\u590d\u628a\u516c\u5f0f1\u5e26\u5165\u516c\u5f0f2\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a \\[ \\begin{aligned} o_t&=g(Vs_t)\\\\ &=Vf(Ux_t+Ws_{t-1})\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Ws_{t-2}))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Ws_{t-3})))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Wf(Ux_{t-3}+...)))) \\end{aligned} \\] \u4ece\u4e0a\u9762\u53ef\u4ee5\u770b\u51fa\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u8f93\u51fa\u503c\uff0c\u662f\u53d7\u524d\u9762\u5386\u6b21\u8f93\u5165\u503c \\(x_t\u3001x_{t-1}\u3001x_{t-2}\u3001x_{t-3}\u3001...\\) \u5f71\u54cd\u7684\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u53ef\u4ee5\u5f80\u524d\u770b\u4efb\u610f\u591a\u4e2a\u8f93\u5165\u503c\u7684\u539f\u56e0\u3002\u8fd9\u6837\u5176\u5b9e\u4e0d\u597d\uff0c\u56e0\u4e3a\u5982\u679c\u592a\u524d\u9762\u7684\u503c\u548c\u540e\u9762\u7684\u503c\u5df2\u7ecf\u6ca1\u6709\u5173\u7cfb\u4e86\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u8fd8\u8003\u8651\u524d\u9762\u7684\u503c\u7684\u8bdd\uff0c\u5c31\u4f1a\u5f71\u54cd\u540e\u9762\u503c\u7684\u5224\u65ad\u3002 \u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc \u00b6 \u5bf9\u4e8e\u8bed\u8a00\u6a21\u578b\u6765\u8bf4\uff0c\u5f88\u591a\u65f6\u5019\u5149\u770b\u524d\u9762\u7684\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6bd4\u5982\u4e0b\u9762\u8fd9\u53e5\u8bdd\uff1a \u6211\u7684\u624b\u673a\u574f\u4e86\uff0c\u6211\u6253\u7b97 \u4e00\u90e8\u65b0\u7684\u624b\u673a \u3002 \u6211\u4eec\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u3002 \u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u9700\u8981\u4fdd\u5b58\u4e24\u4e2a\u503c\uff0c\u4e00\u4e2a \\(A\\) \u53c2\u4e0e\u6b63\u5411\u8ba1\u7b97\uff0c\u53e6\u4e00\u4e2a\u503c \\(A^\\prime\\) \u53c2\u4e0e\u53cd\u5411\u8ba1\u7b97\u3002\u6700\u7ec8\u7684\u8f93\u51fa\u503c \\(y_2\\) \u53d6\u51b3\u4e8e \\(A_2\\) \u548c \\(A_2^\\prime\\) \u3002\u5176\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ y_2=g(VA_2+V\\prime A_2^\\prime) \\] \\(A_2\\) \u548c \\(A_2^\\prime\\) \u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ \\begin{aligned} A_2&=f(WA_1+Ux_2)\\\\ A_2^\\prime&=f(W^\\prime A_3^\\prime + U^\\prime x_2) \\end{aligned} \\] \u73b0\u5728\u53ef\u4ee5\u770b\u51fa\u4e00\u822c\u7684\u89c4\u5f8b\uff1a\u6b63\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t\\) \u4e0e \\(S_{t-1}\\) \u6709\u5173\uff1b\u53cd\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t^\\prime\\) \u4e0e \\(S_{t+1}^\\prime\\) \u6709\u5173\uff1b\u6700\u7ec8\u7684\u8f93\u51fa\u53d6\u51b3\u4e8e\u6b63\u5411\u548c\u53cd\u5411\u8ba1\u7b97\u7684\u52a0\u548c\u3002\u73b0\u5728\uff0c\u4eff\u7167\u516c\u5f0f1\u548c\u516c\u5f0f2\uff0c\u5199\u51faBRNN\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\[ \\begin{aligned} o_t=g(Vs_t+V^\\prime s_t^\\prime)\\\\ s_t=f(Ux_t+Ws_{t-1})\\\\ s_t^\\prime=f(U^\\prime x_t+W^\\prime s_{t+1}^\\prime) \\end{aligned} \\] \u4ece\u4e0a\u9762\u4e09\u4e2a\u516c\u5f0f\u53ef\u4ee5\u770b\u5230\uff0c\u6b63\u5411\u8ba1\u7b97\u548c\u53cd\u5411\u8ba1\u7b97\u4e0d\u5171\u4eab\u6743\u91cd\uff0c\u4e5f\u5c31\u662f\u8bf4 \\(U\\) \u548c \\(U^\\prime\\) \u3001 \\(W\\) \u548c \\(W^\\prime\\) \u3001 \\(V\\) \u548c \\(V^\\prime\\) \u662f\u4e0d\u540c\u7684\u6743\u91cd\u77e9\u9635\u3002 \u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931 \u00b6 \u4e0a\u6587\u4ecb\u7ecd\u7684\u51e0\u79cd RNN \u5e76\u4e0d\u80fd\u5f88\u597d\u5730\u5904\u7406\u8f83\u957f\u7684\u5e8f\u5217\uff0cRNN \u5728\u8bad\u7ec3\u4e2d\u5f88\u5bb9\u6613\u53d1\u751f\u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931\uff0c\u8fd9\u5bfc\u81f4\u68af\u5ea6\u4e0d\u80fd\u5728\u8f83\u957f\u5e8f\u5217\u4e2d\u4e00\u76f4\u4f20\u9012\u4e0b\u53bb\uff0c\u4ece\u800c\u4f7f RNN \u65e0\u6cd5\u6355\u6349\u5230\u957f\u8ddd\u79bb\u7684\u5f71\u54cd\u3002 \u901a\u5e38\u6765\u8bf4\uff0c\u68af\u5ea6\u7206\u70b8\u66f4\u5bb9\u6613\u5904\u7406\u4e00\u4e9b\u3002\u56e0\u4e3a\u68af\u5ea6\u7206\u70b8\u7684\u65f6\u5019\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u4f1a\u6536\u5230NaN\u9519\u8bef\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u68af\u5ea6\u9608\u503c\uff0c\u5f53\u68af\u5ea6\u8d85\u8fc7\u8fd9\u4e2a\u9608\u503c\u7684\u65f6\u5019\u53ef\u4ee5\u76f4\u63a5\u622a\u53d6\u3002 \u68af\u5ea6\u6d88\u5931\u66f4\u96be\u68c0\u6d4b\uff0c\u800c\u4e14\u4e5f\u66f4\u96be\u5904\u7406\u4e00\u4e9b\u3002\u603b\u7684\u6765\u8bf4\uff0c\u6211\u4eec\u6709\u4e09\u79cd\u65b9\u6cd5\u5e94\u5bf9\u68af\u5ea6\u6d88\u5931\u95ee\u9898\uff1a 1\u3001\u5408\u7406\u7684\u521d\u59cb\u5316\u6743\u91cd\u503c\u3002\u521d\u59cb\u5316\u6743\u91cd\uff0c\u4f7f\u6bcf\u4e2a\u795e\u7ecf\u5143\u5c3d\u53ef\u80fd\u4e0d\u8981\u53d6\u6781\u5927\u6216\u6781\u5c0f\u503c\uff0c\u4ee5\u8eb2\u5f00\u68af\u5ea6\u6d88\u5931\u7684\u533a\u57df\u3002 2\u3001\u4f7f\u7528relu\u4ee3\u66ffsigmoid\u548ctanh\u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\u3002 3\u3001\u4f7f\u7528\u5176\u4ed6\u7ed3\u6784\u7684RNNs\uff0c\u6bd4\u5982\u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08LTSM\uff09\u548cGated Recurrent Unit\uff08GRU\uff09\uff0c\u8fd9\u662f\u6700\u6d41\u884c\u7684\u505a\u6cd5\u3002 \u957f\u77ed\u671f\u8bb0\u5fc6\u7f51\u7edc LSTM \u00b6 \u539f\u59cb RNN \u7684\u9690\u85cf\u5c42\u53ea\u6709\u4e00\u4e2a\u72b6\u6001\uff0c\u5373 h\uff0c\u5b83\u5bf9\u77ed\u671f\u7684\u8f93\u5165\u975e\u5e38\u654f\u611f\u3002\u90a3\u4e48\u5982\u679c\u6211\u4eec\u518d\u52a0\u4e00\u4e2a\u95e8\uff08gate\uff09\u673a\u5236\u7528\u4e8e\u63a7\u5236\u7279\u5f81\u7684\u6d41\u901a\u548c\u635f\u5931\uff0c\u5373 c\uff0c\u8ba9\u5b83\u6765\u4fdd\u5b58\u957f\u671f\u7684\u72b6\u6001\uff0c\u8fd9\u5c31\u662f \u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08Long Short Term Memory\uff0cLSTM\uff09 \u3002 \u65b0\u589e\u52a0\u7684\u72b6\u6001 c\uff0c\u79f0\u4e3a\u5355\u5143\u72b6\u6001\u3002\u628a LSTM \u6309\u7167\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff1a \u53ef\u4ee5\u770b\u5230\u5728 t \u65f6\u523b LSTM \u7684\u8f93\u5165\u6709\u4e09\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7f51\u7edc\u7684\u8f93\u5165\u503c \\(x_t\\) \u3001\u4e0a\u4e00\u65f6\u523b LSTM \u7684\u8f93\u51fa\u503c \\(h_{t-1}\\) \u3001\u4ee5\u53ca\u4e0a\u4e00\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_{t-1}\\) \u3002 LSTM \u7684\u8f93\u51fa\u6709\u4e24\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7684 LSTM \u8f93\u51fa\u503c \\(h_t\\) \u3001\u548c\u5f53\u524d\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_t\\) \u3002 \u8bb0\u5fc6\u5355\u5143 c \u5728 LSTM \u5c42\u5185\u90e8\u7ed3\u675f\u5de5\u4f5c\uff0c\u4e0d\u5411\u5176\u4ed6\u5c42\u8f93\u51fa\u3002LSTM \u7684\u8f93\u51fa\u4ec5\u6709\u9690\u85cf\u72b6\u6001\u5411\u91cf h\u3002 LSTM \u7684\u5173\u952e\u662f\u5355\u5143\u72b6\u6001\uff0c\u5373\u8d2f\u7a7f\u56fe\u8868\u9876\u90e8\u7684\u6c34\u5e73\u7ebf\uff0c\u6709\u70b9\u50cf\u4f20\u9001\u5e26\u3002\u8fd9\u4e00\u90e8\u5206\u4e00\u822c\u53eb\u505a\u5355\u5143\u72b6\u6001\uff08cell state\uff09\uff0c\u5b83\u81ea\u59cb\u81f3\u7ec8\u5b58\u5728\u4e8e LSTM \u7684\u6574\u4e2a\u94fe\u5f0f\u7cfb\u7edf\u4e2d\u3002 \u8bb0\u5fc6\u5355\u5143\u72b6\u6001\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f1\uff1ac_{t}=f_{t} \\odot c_{t-1}+i_{t} \\odot g_t\\) \u9057\u5fd8\u95e8 \u00b6 \\(f_t\\) \u53eb\u505a \u9057\u5fd8\u95e8 \uff0c\u8868\u793a \\(C_{t-1}\\) \u7684\u54ea\u4e9b\u7279\u5f81\u88ab\u7528\u4e8e\u8ba1\u7b97 \\(C_t\\) \u3002 \\(f_t\\) \u662f\u4e00\u4e2a\u5411\u91cf\uff0c\u5411\u91cf\u7684\u6bcf\u4e2a\u5143\u7d20\u5747\u4f4d\u4e8e(0~1)\u8303\u56f4\u5185\u3002\u901a\u5e38\u6211\u4eec\u4f7f\u7528 sigmoid \u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\uff0csigmoid \u7684\u8f93\u51fa\u662f\u4e00\u4e2a\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u503c\uff0c\u4f46\u662f\u5f53\u4f60\u89c2\u5bdf\u4e00\u4e2a\u8bad\u7ec3\u597d\u7684 LSTM \u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u95e8\u7684\u503c\u7edd\u5927\u591a\u6570\u90fd\u975e\u5e38\u63a5\u8fd1 0 \u6216 1\uff0c\u5176\u4f59\u7684\u503c\u5c11\u4e4b\u53c8\u5c11\u3002 \u9057\u5fd8\u95e8\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f2\uff1af_t=\\sigma (x_tW_x^{(f)}+h_{h-1}W_h^{(f)}+b^{(f)})\\) \u8f93\u5165\u95e8 \u00b6 \\(\\tilde{C}_t\\) \u8868\u793a\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\uff0c\u6709\u8f93\u5165\u6570\u636e \\(x_t\\) \u548c\u9690\u8282\u70b9 \\(h_{t-1}\\) \u7ecf\u7531\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u5c42\u5f97\u5230\uff0c\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\u7684\u6fc0\u6d3b\u51fd\u6570\u901a\u5e38\u4f7f\u7528 tanh\u3002 \\(i_t\\) \u53eb\u505a\u8f93\u5165\u95e8\uff0c\u540c \\(f_t\\) \u4e00\u6837\u4e5f\u662f\u4e00\u4e2a\u5143\u7d20\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u5411\u91cf\uff0c\u540c\u6837\u7531 \\(x_t\\) \u548c \\(h_{t-1}\\) \u7ecf\u7531 sigmoid \u6fc0\u6d3b\u51fd\u6570\u8ba1\u7b97\u800c\u6210\u3002 \u8f93\u5165\u95e8\u548c\u5355\u5143\u66f4\u65b0\u503c\u7684\u8ba1\u7b97\u65b9\u5f0f\uff1a \\(\u516c\u5f0f3\uff1ai_t=\\sigma (x_tW_x^{(i)}+h_{t-1}W_h^{i}+b^{(i)})\\) \\(\u516c\u5f0f4\uff1ag_t=tanh(x_tW_x^{(g)}+h_{t-1}W_h^{(g)}+b^{(g)})\\) \u8f93\u51fa\u95e8 \u00b6 \u6700\u540e\uff0c\u4e3a\u4e86\u8ba1\u7b97\u9884\u6d4b\u503c \\(\\hat{y}_t\\) \u548c\u751f\u6210\u4e0b\u4e2a\u65f6\u95f4\u7247\u5b8c\u6574\u7684\u8f93\u5165\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u9690\u8282\u70b9\u7684\u8f93\u51fa \\(h_t\\) \u3002 \u8f93\u51fa\u95e8\u548c\u9690\u8282\u70b9\u7684\u8ba1\u7b97\u516c\u5f0f \\(\u516c\u5f0f5\uff1ao_t=\\sigma (x_tW_x^{(o)}+h_{t-1}W_h^{(o)}+b^{(o)})\\) \\(\u516c\u5f0f6\uff1ah_t=o_t\\odot tanh(c_t)\\) \u6211\u4eec\u6765\u770b\u516c\u5f0f2\u30013\u30014\u30015\uff0c\u90fd\u662f\u578b\u5982 \\(xW_x+hW_h+b\\) \u7684\u683c\u5f0f\uff0c\u56e0\u6b64\u53ef\u4ee5\u6574\u5408\u4e3a\u901a\u8fc7\u4e00\u4e2a\u5f0f\u5b50\u8fdb\u884c\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\u88ab\u6574\u5408\u4e3a\u4e86 1 \u4e2a\u3002\u5982\u6b64\uff0c\u539f\u672c\u5355\u72ec\u6267\u884c4 \u6b21\u7684\u4eff\u5c04\u53d8\u6362\u901a\u8fc71 \u6b21\u8ba1\u7b97\u5373\u53ef\u5b8c\u6210\uff0c\u53ef\u4ee5\u52a0\u5feb\u8ba1\u7b97\u901f\u5ea6\u3002\u8fd9\u662f\u56e0\u4e3a\u77e9\u9635\u5e93\u8ba1\u7b97\u201c\u5927\u77e9\u9635\u201d\u65f6\u901a\u5e38\u4f1a\u66f4\u5feb\uff0c\u800c\u4e14\u901a\u8fc7\u5c06\u6743\u91cd\u6574\u5408\u5230\u4e00\u8d77\u7ba1\u7406\uff0c\u6e90\u4ee3\u7801\u4e5f\u4f1a\u66f4\u7b80\u6d01\u3002 \u5047\u8bbe \\(W_x\u3001W_h\\) \u548c \\(b\\) \u5206\u522b\u5305\u542b 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\uff0c\u6b64\u65f6 LSTM \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 import tensorflow as tf from tensorflow.keras import layers inputs = tf . random . normal (( 64 , 6 , 10 )) LSTM_layer = layers . LSTM ( units = 20 , return_sequences = True , return_state = True ) outputs , final_memory_state , final_carry_state = LSTM_layer ( inputs ) print ( outputs . shape , final_memory_state . shape , final_carry_state . shape ) # (64, 6, 20) (64, 20) (64, 20) print ( len ( LSTM_layer . weights )) # 3 print ( LSTM_layer . weights [ 0 ] . shape ) # Wx (10, 80) print ( LSTM_layer . weights [ 1 ] . shape ) # Wh (20, 80) print ( LSTM_layer . weights [ 2 ] . shape ) # bias (80,) \u95e8\u63a7\u5faa\u73af\u5355\u5143 GRU \u00b6 LSTM \u7684\u53c2\u6570\u592a\u591a\uff0c\u8ba1\u7b97\u9700\u8981\u5f88\u957f\u65f6\u95f4\u3002\u56e0\u6b64\uff0c\u6700\u8fd1\u4e1a\u754c\u53c8\u63d0\u51fa\u4e86 GRU\uff08Gated RecurrentUnit\uff0c\u95e8\u63a7\u5faa\u73af\u5355\u5143\uff09\u3002GRU \u4fdd\u7559\u4e86 LSTM\u4f7f\u7528\u95e8\u7684\u7406\u5ff5\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u53c2\u6570\uff0c\u7f29\u77ed\u4e86\u8ba1\u7b97\u65f6\u95f4\u3002 \u76f8\u5bf9\u4e8e LSTM \u4f7f\u7528\u9690\u85cf\u72b6\u6001\u548c\u8bb0\u5fc6\u5355\u5143\u4e24\u6761\u7ebf\uff0cGRU\u53ea\u4f7f\u7528\u9690\u85cf\u72b6\u6001\u3002\u5f02\u540c\u70b9\u5982\u4e0b\uff1a GRU \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 GRU \u8ba1\u7b97\u56fe\u4e2d\uff0c \\(\\sigma\\) \u8282\u70b9\u548c tanh \u8282\u70b9\u6709\u4e13\u7528\u7684\u6743\u91cd\uff0c\u8282\u70b9\u5185\u90e8\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff08\u201c1\u2212\u201d\u8282\u70b9\u8f93\u5165x\uff0c\u8f93\u51fa1 \u2212 x\uff09 \\(\u516c\u5f0f2.1\uff1az=\\sigma(x_t W_x^{(z)}+h_{t-1} W_h^{(z)}+b^{(z)})\\) \\(\u516c\u5f0f2.2\uff1ar=\\sigma(x_t W_x^{(r)}+h_{t-1} W_h^{(r)}+b^{(r)})\\) \\(\u516c\u5f0f2.3\uff1a\\tilde{h}=\\tanh (x_t W_x+(r \\odot h_{t-1}) W_h+b)\\) \\(\u516c\u5f0f2.4\uff1ah_t=(1-z) \\odot h_{t-1}+z \\odot \\tilde{h}\\) GRU \u4e2d\u8fdb\u884c\u7684\u8ba1\u7b97\u7531\u4e0a\u8ff0 4 \u4e2a\u5f0f\u5b50\u8868\u793a\uff08\u8fd9\u91cc \\(x_t\\) \u548c \\(h_{t\u22121}\\) \u90fd\u662f\u884c\u5411\u91cf\uff09\uff0c\u5982\u56fe\u6240\u793a\uff0cGRU \u6ca1\u6709\u8bb0\u5fc6\u5355\u5143\uff0c\u53ea\u6709\u4e00\u4e2a\u9690\u85cf\u72b6\u6001 h \u5728\u65f6\u95f4\u65b9\u5411\u4e0a\u4f20\u64ad\u3002\u8fd9\u91cc\u4f7f\u7528 r \u548c z \u5171\u4e24\u4e2a\u95e8\uff08LSTM \u4f7f\u7528 3 \u4e2a\u95e8\uff09\uff0cr \u79f0\u4e3a reset \u95e8\uff0cz \u79f0\u4e3a update \u95e8\u3002 r\uff08reset\u95e8\uff09 \u51b3\u5b9a\u5728\u591a\u5927\u7a0b\u5ea6\u4e0a\u201c\u5ffd\u7565\u201d\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u3002\u6839\u636e\u516c\u5f0f2.3\uff0c\u5982\u679c r \u662f 0\uff0c\u5219\u65b0\u7684\u9690\u85cf\u72b6\u6001 \\(\\tilde{h}\\) \u4ec5\u53d6\u51b3\u4e8e\u8f93\u5165 \\(x_t\\) \u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6b64\u65f6\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u5c06\u5b8c\u5168\u88ab\u5ffd\u7565\u3002 z\uff08update\u95e8\uff09 \u662f\u66f4\u65b0\u9690\u85cf\u72b6\u6001\u7684\u95e8\uff0c\u5b83\u626e\u6f14\u4e86 LSTM \u7684 forget \u95e8\u548cinput \u95e8\u4e24\u4e2a\u89d2\u8272\u3002\u516c\u5f0f2.4 \u7684 \\((1-z) \\odot h_{t-1}\\) \u90e8\u5206\u5145\u5f53 forget \u95e8\u7684\u529f\u80fd\uff0c\u4ece\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u4e2d\u5220\u9664\u5e94\u8be5\u88ab\u9057\u5fd8\u7684\u4fe1\u606f\u3002 \\(z \\odot \\tilde{h}\\) \u7684\u90e8\u5206\u5145\u5f53 input \u95e8\u7684\u529f\u80fd\uff0c\u5bf9\u65b0\u589e\u7684\u4fe1\u606f\u8fdb\u884c\u52a0\u6743\u3002","title":"RNN"},{"location":"llm/nlp/rnns/#rnns","text":"\u7ea6 2807 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract NLP \u91cc\u6700\u5e38\u7528\u3001\u6700\u4f20\u7edf\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5c31\u662f \u5faa\u73af\u795e\u7ecf\u7f51\u7edc RNN\uff08Recurrent Neural Network\uff09 \u3002 RNN \u6709\u5f88\u591a\u53d8\u79cd\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5c31\u662f LSTM\uff08Long Short-Term Memory\uff09 \u548c GRU\uff08Gated Recurrent Unit\uff09 \u3002\u672c\u6587\u5c06\u4ecb\u7ecd RNN\u3001LSTM \u548c GRU \u7684\u539f\u7406\u3002","title":"RNNs"},{"location":"llm/nlp/rnns/#_1","text":"\u5168\u8fde\u63a5\u795e\u7ecf\u7f51\u7edc DNN \u548c \u5377\u79ef\u795e\u7ecf\u7f51\u7edc CNN\uff0c\u5b83\u4eec\u7684\u524d\u4e00\u4e2a\u8f93\u5165\u548c\u540e\u4e00\u4e2a\u8f93\u5165\u662f\u6ca1\u6709\u5173\u7cfb\u7684\u3002\u5f53\u6211\u4eec\u5904\u7406 \u5e8f\u5217\u4fe1\u606f \u65f6\uff0c\u67d0\u4e9b\u524d\u9762\u7684\u8f93\u5165\u548c\u540e\u9762\u7684\u8f93\u5165\u662f\u6709\u5173\u7cfb\u7684\uff0c\u6bd4\u5982\uff1a\u5f53\u6211\u4eec\u5728\u7406\u89e3\u4e00\u53e5\u8bdd\u7684\u610f\u601d\u65f6\uff0c\u5b64\u7acb\u7684\u7406\u89e3\u8fd9\u53e5\u8bdd\u7684\u6bcf\u4e2a\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6211\u4eec\u9700\u8981\u5904\u7406\u8fd9\u4e9b\u8bcd\u8fde\u63a5\u8d77\u6765\u7684\u6574\u4e2a \u5e8f\u5217 \uff1b\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u9700\u8981\u4f7f\u7528\u5230 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08Recurrent Neural Network\uff09 \u3002 RNN\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u6700\u5148\u88ab\u4f7f\u7528\u8d77\u6765\uff0cRNN\u53ef\u4ee5\u4e3a\u8bed\u8a00\u6a21\u578b\u8fdb\u884c\u5efa\u6a21\uff1a \u6211\u6ca1\u6709\u5b8c\u6210\u4e0a\u7ea7\u5e03\u7f6e\u7ed9\u6211\u7684\u4efb\u52a1\uff0c\u6240\u4ee5 \u88ab\u5f00\u9664\u4e86 \u8ba9\u7535\u8111\u6765\u586b\u5199\u4e0b\u5212\u7ebf\u7684\u8bcd\u6700\u6709\u53ef\u80fd\u7684\u662f\u300e\u6211\u300f\uff0c\u800c\u4e0d\u592a\u53ef\u80fd\u662f\u300e\u5c0f\u660e\u300f\uff0c\u751a\u81f3\u662f\u300e\u5403\u996d\u300f\u3002 \u8bed\u8a00\u6a21\u578b\u5c31\u662f\u8fd9\u6837\u7684\u4e1c\u897f\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e00\u53e5\u8bdd\u524d\u9762\u7684\u90e8\u5206\uff0c\u9884\u6d4b\u63a5\u4e0b\u6765\u6700\u6709\u53ef\u80fd\u7684\u4e00\u4e2a\u8bcd\u662f\u4ec0\u4e48\u3002","title":"\u6982\u8ff0"},{"location":"llm/nlp/rnns/#_2","text":"\u57fa\u672c\u7684 RNN\uff0c\u7ed3\u6784\u7531 \u8f93\u5165\u5c42\u3001\u4e00\u4e2a\u9690\u85cf\u5c42\u548c\u8f93\u51fa\u5c42 \u7ec4\u6210\u3002 x \u662f\u8f93\u5165\u5411\u91cf o \u662f\u8f93\u51fa\u5411\u91cf s \u8868\u793a\u9690\u85cf\u5c42\u7684\u503c U \u662f\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6743\u91cd\u77e9\u9635 V \u65f6\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u7684\u503c s \u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e\u5f53\u524d\u8fd9\u6b21\u7684\u8f93\u5165 x\uff0c\u8fd8\u53d6\u51b3\u4e8e\u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u7684\u503c s\u3002\u6743\u91cd\u77e9\u9635 W \u5c31\u662f\u9690\u85cf\u5c42\u4e0a\u4e00\u6b21\u7684\u503c\u4f5c\u4e3a\u8fd9\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u3002 \u5c06\u4e0a\u56fe\u7684\u57fa\u672c RNN \u7ed3\u6784\u5728\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff08RNN \u662f\u4e00\u4e2a\u94fe\u5f0f\u7ed3\u6784\uff0c\u6bcf\u4e2a\u65f6\u95f4\u7247\u4f7f\u7528\u7684\u90fd\u662f\u76f8\u540c\u7684\u53c2\u6570\uff09 \u8fd9\u4e2a\u7f51\u7edc\u5728 t \u65f6\u523b\u63a5\u6536\u5230\u8f93\u5165 \\(x_t\\) \u4e4b\u540e\uff0c\u9690\u85cf\u5c42\u7684\u503c\u662f \\(s_t\\) \uff0c\u8f93\u51fa\u5c42\u7684\u503c\u662f \\(o_t\\) \uff0c \u5173\u952e\u7684\u662f\uff0c \\(s_t\\) \u7684\u503c\u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e \\(x_t\\) \uff0c\u8fd8\u53d6\u51b3\u4e8e \\(s_{t-1}\\) \u3002 \\[ s_t=f(U * x_t + W * s_{t-1}) \\\\ o_t=g(V * s_t) \\] \u516c\u5f0f1 \u662f\u9690\u85cf\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0c\u5b83\u662f\u5faa\u73af\u5c42\u3002U \u662f\u8f93\u5165 x \u7684\u6743\u91cd\u77e9\u9635\uff0cW \u662f \u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u503c \\(s_{t-1}\\) \u4f5c\u4e3a\u5219\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u77e9\u9635\uff0cf \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u516c\u5f0f2 \u662f\u8f93\u51fa\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0cV \u662f\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635\uff0cg \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u9690\u85cf\u5c42\u6709\u4e24\u4e2a\u8f93\u5165\uff0c\u7b2c\u4e00\u662f U \u4e0e \\(x_t\\) \u5411\u91cf\u7684\u4e58\u79ef\uff0c\u7b2c\u4e8c\u662f\u4e0a\u4e00\u9690\u85cf\u5c42\u8f93\u51fa\u7684\u72b6\u6001 \\(s_{t-1}\\) \u4e0e W \u7684\u4e58\u79ef\u3002\u7b49\u4e8e\u4e0a\u4e00\u4e2a\u65f6\u523b\u8ba1\u7b97\u7684 \\(s_{t-1}\\) \u9700\u8981\u7f13\u5b58\u4e00\u4e0b\uff0c\u5728\u672c\u6b21\u8f93\u5165 \\(x_t\\) \u4e00\u8d77\u8ba1\u7b97\uff0c\u5171\u540c\u8f93\u51fa\u6700\u540e\u7684 \\(o_t\\) \u3002 \u5982\u679c\u53cd\u590d\u628a\u516c\u5f0f1\u5e26\u5165\u516c\u5f0f2\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a \\[ \\begin{aligned} o_t&=g(Vs_t)\\\\ &=Vf(Ux_t+Ws_{t-1})\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Ws_{t-2}))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Ws_{t-3})))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Wf(Ux_{t-3}+...)))) \\end{aligned} \\] \u4ece\u4e0a\u9762\u53ef\u4ee5\u770b\u51fa\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u8f93\u51fa\u503c\uff0c\u662f\u53d7\u524d\u9762\u5386\u6b21\u8f93\u5165\u503c \\(x_t\u3001x_{t-1}\u3001x_{t-2}\u3001x_{t-3}\u3001...\\) \u5f71\u54cd\u7684\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u53ef\u4ee5\u5f80\u524d\u770b\u4efb\u610f\u591a\u4e2a\u8f93\u5165\u503c\u7684\u539f\u56e0\u3002\u8fd9\u6837\u5176\u5b9e\u4e0d\u597d\uff0c\u56e0\u4e3a\u5982\u679c\u592a\u524d\u9762\u7684\u503c\u548c\u540e\u9762\u7684\u503c\u5df2\u7ecf\u6ca1\u6709\u5173\u7cfb\u4e86\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u8fd8\u8003\u8651\u524d\u9762\u7684\u503c\u7684\u8bdd\uff0c\u5c31\u4f1a\u5f71\u54cd\u540e\u9762\u503c\u7684\u5224\u65ad\u3002","title":"\u57fa\u672c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc"},{"location":"llm/nlp/rnns/#_3","text":"\u5bf9\u4e8e\u8bed\u8a00\u6a21\u578b\u6765\u8bf4\uff0c\u5f88\u591a\u65f6\u5019\u5149\u770b\u524d\u9762\u7684\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6bd4\u5982\u4e0b\u9762\u8fd9\u53e5\u8bdd\uff1a \u6211\u7684\u624b\u673a\u574f\u4e86\uff0c\u6211\u6253\u7b97 \u4e00\u90e8\u65b0\u7684\u624b\u673a \u3002 \u6211\u4eec\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u3002 \u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u9700\u8981\u4fdd\u5b58\u4e24\u4e2a\u503c\uff0c\u4e00\u4e2a \\(A\\) \u53c2\u4e0e\u6b63\u5411\u8ba1\u7b97\uff0c\u53e6\u4e00\u4e2a\u503c \\(A^\\prime\\) \u53c2\u4e0e\u53cd\u5411\u8ba1\u7b97\u3002\u6700\u7ec8\u7684\u8f93\u51fa\u503c \\(y_2\\) \u53d6\u51b3\u4e8e \\(A_2\\) \u548c \\(A_2^\\prime\\) \u3002\u5176\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ y_2=g(VA_2+V\\prime A_2^\\prime) \\] \\(A_2\\) \u548c \\(A_2^\\prime\\) \u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ \\begin{aligned} A_2&=f(WA_1+Ux_2)\\\\ A_2^\\prime&=f(W^\\prime A_3^\\prime + U^\\prime x_2) \\end{aligned} \\] \u73b0\u5728\u53ef\u4ee5\u770b\u51fa\u4e00\u822c\u7684\u89c4\u5f8b\uff1a\u6b63\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t\\) \u4e0e \\(S_{t-1}\\) \u6709\u5173\uff1b\u53cd\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t^\\prime\\) \u4e0e \\(S_{t+1}^\\prime\\) \u6709\u5173\uff1b\u6700\u7ec8\u7684\u8f93\u51fa\u53d6\u51b3\u4e8e\u6b63\u5411\u548c\u53cd\u5411\u8ba1\u7b97\u7684\u52a0\u548c\u3002\u73b0\u5728\uff0c\u4eff\u7167\u516c\u5f0f1\u548c\u516c\u5f0f2\uff0c\u5199\u51faBRNN\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\[ \\begin{aligned} o_t=g(Vs_t+V^\\prime s_t^\\prime)\\\\ s_t=f(Ux_t+Ws_{t-1})\\\\ s_t^\\prime=f(U^\\prime x_t+W^\\prime s_{t+1}^\\prime) \\end{aligned} \\] \u4ece\u4e0a\u9762\u4e09\u4e2a\u516c\u5f0f\u53ef\u4ee5\u770b\u5230\uff0c\u6b63\u5411\u8ba1\u7b97\u548c\u53cd\u5411\u8ba1\u7b97\u4e0d\u5171\u4eab\u6743\u91cd\uff0c\u4e5f\u5c31\u662f\u8bf4 \\(U\\) \u548c \\(U^\\prime\\) \u3001 \\(W\\) \u548c \\(W^\\prime\\) \u3001 \\(V\\) \u548c \\(V^\\prime\\) \u662f\u4e0d\u540c\u7684\u6743\u91cd\u77e9\u9635\u3002","title":"\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc"},{"location":"llm/nlp/rnns/#_4","text":"\u4e0a\u6587\u4ecb\u7ecd\u7684\u51e0\u79cd RNN \u5e76\u4e0d\u80fd\u5f88\u597d\u5730\u5904\u7406\u8f83\u957f\u7684\u5e8f\u5217\uff0cRNN \u5728\u8bad\u7ec3\u4e2d\u5f88\u5bb9\u6613\u53d1\u751f\u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931\uff0c\u8fd9\u5bfc\u81f4\u68af\u5ea6\u4e0d\u80fd\u5728\u8f83\u957f\u5e8f\u5217\u4e2d\u4e00\u76f4\u4f20\u9012\u4e0b\u53bb\uff0c\u4ece\u800c\u4f7f RNN \u65e0\u6cd5\u6355\u6349\u5230\u957f\u8ddd\u79bb\u7684\u5f71\u54cd\u3002 \u901a\u5e38\u6765\u8bf4\uff0c\u68af\u5ea6\u7206\u70b8\u66f4\u5bb9\u6613\u5904\u7406\u4e00\u4e9b\u3002\u56e0\u4e3a\u68af\u5ea6\u7206\u70b8\u7684\u65f6\u5019\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u4f1a\u6536\u5230NaN\u9519\u8bef\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u68af\u5ea6\u9608\u503c\uff0c\u5f53\u68af\u5ea6\u8d85\u8fc7\u8fd9\u4e2a\u9608\u503c\u7684\u65f6\u5019\u53ef\u4ee5\u76f4\u63a5\u622a\u53d6\u3002 \u68af\u5ea6\u6d88\u5931\u66f4\u96be\u68c0\u6d4b\uff0c\u800c\u4e14\u4e5f\u66f4\u96be\u5904\u7406\u4e00\u4e9b\u3002\u603b\u7684\u6765\u8bf4\uff0c\u6211\u4eec\u6709\u4e09\u79cd\u65b9\u6cd5\u5e94\u5bf9\u68af\u5ea6\u6d88\u5931\u95ee\u9898\uff1a 1\u3001\u5408\u7406\u7684\u521d\u59cb\u5316\u6743\u91cd\u503c\u3002\u521d\u59cb\u5316\u6743\u91cd\uff0c\u4f7f\u6bcf\u4e2a\u795e\u7ecf\u5143\u5c3d\u53ef\u80fd\u4e0d\u8981\u53d6\u6781\u5927\u6216\u6781\u5c0f\u503c\uff0c\u4ee5\u8eb2\u5f00\u68af\u5ea6\u6d88\u5931\u7684\u533a\u57df\u3002 2\u3001\u4f7f\u7528relu\u4ee3\u66ffsigmoid\u548ctanh\u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\u3002 3\u3001\u4f7f\u7528\u5176\u4ed6\u7ed3\u6784\u7684RNNs\uff0c\u6bd4\u5982\u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08LTSM\uff09\u548cGated Recurrent Unit\uff08GRU\uff09\uff0c\u8fd9\u662f\u6700\u6d41\u884c\u7684\u505a\u6cd5\u3002","title":"\u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931"},{"location":"llm/nlp/rnns/#lstm","text":"\u539f\u59cb RNN \u7684\u9690\u85cf\u5c42\u53ea\u6709\u4e00\u4e2a\u72b6\u6001\uff0c\u5373 h\uff0c\u5b83\u5bf9\u77ed\u671f\u7684\u8f93\u5165\u975e\u5e38\u654f\u611f\u3002\u90a3\u4e48\u5982\u679c\u6211\u4eec\u518d\u52a0\u4e00\u4e2a\u95e8\uff08gate\uff09\u673a\u5236\u7528\u4e8e\u63a7\u5236\u7279\u5f81\u7684\u6d41\u901a\u548c\u635f\u5931\uff0c\u5373 c\uff0c\u8ba9\u5b83\u6765\u4fdd\u5b58\u957f\u671f\u7684\u72b6\u6001\uff0c\u8fd9\u5c31\u662f \u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08Long Short Term Memory\uff0cLSTM\uff09 \u3002 \u65b0\u589e\u52a0\u7684\u72b6\u6001 c\uff0c\u79f0\u4e3a\u5355\u5143\u72b6\u6001\u3002\u628a LSTM \u6309\u7167\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff1a \u53ef\u4ee5\u770b\u5230\u5728 t \u65f6\u523b LSTM \u7684\u8f93\u5165\u6709\u4e09\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7f51\u7edc\u7684\u8f93\u5165\u503c \\(x_t\\) \u3001\u4e0a\u4e00\u65f6\u523b LSTM \u7684\u8f93\u51fa\u503c \\(h_{t-1}\\) \u3001\u4ee5\u53ca\u4e0a\u4e00\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_{t-1}\\) \u3002 LSTM \u7684\u8f93\u51fa\u6709\u4e24\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7684 LSTM \u8f93\u51fa\u503c \\(h_t\\) \u3001\u548c\u5f53\u524d\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_t\\) \u3002 \u8bb0\u5fc6\u5355\u5143 c \u5728 LSTM \u5c42\u5185\u90e8\u7ed3\u675f\u5de5\u4f5c\uff0c\u4e0d\u5411\u5176\u4ed6\u5c42\u8f93\u51fa\u3002LSTM \u7684\u8f93\u51fa\u4ec5\u6709\u9690\u85cf\u72b6\u6001\u5411\u91cf h\u3002 LSTM \u7684\u5173\u952e\u662f\u5355\u5143\u72b6\u6001\uff0c\u5373\u8d2f\u7a7f\u56fe\u8868\u9876\u90e8\u7684\u6c34\u5e73\u7ebf\uff0c\u6709\u70b9\u50cf\u4f20\u9001\u5e26\u3002\u8fd9\u4e00\u90e8\u5206\u4e00\u822c\u53eb\u505a\u5355\u5143\u72b6\u6001\uff08cell state\uff09\uff0c\u5b83\u81ea\u59cb\u81f3\u7ec8\u5b58\u5728\u4e8e LSTM \u7684\u6574\u4e2a\u94fe\u5f0f\u7cfb\u7edf\u4e2d\u3002 \u8bb0\u5fc6\u5355\u5143\u72b6\u6001\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f1\uff1ac_{t}=f_{t} \\odot c_{t-1}+i_{t} \\odot g_t\\)","title":"\u957f\u77ed\u671f\u8bb0\u5fc6\u7f51\u7edc LSTM"},{"location":"llm/nlp/rnns/#_5","text":"\\(f_t\\) \u53eb\u505a \u9057\u5fd8\u95e8 \uff0c\u8868\u793a \\(C_{t-1}\\) \u7684\u54ea\u4e9b\u7279\u5f81\u88ab\u7528\u4e8e\u8ba1\u7b97 \\(C_t\\) \u3002 \\(f_t\\) \u662f\u4e00\u4e2a\u5411\u91cf\uff0c\u5411\u91cf\u7684\u6bcf\u4e2a\u5143\u7d20\u5747\u4f4d\u4e8e(0~1)\u8303\u56f4\u5185\u3002\u901a\u5e38\u6211\u4eec\u4f7f\u7528 sigmoid \u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\uff0csigmoid \u7684\u8f93\u51fa\u662f\u4e00\u4e2a\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u503c\uff0c\u4f46\u662f\u5f53\u4f60\u89c2\u5bdf\u4e00\u4e2a\u8bad\u7ec3\u597d\u7684 LSTM \u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u95e8\u7684\u503c\u7edd\u5927\u591a\u6570\u90fd\u975e\u5e38\u63a5\u8fd1 0 \u6216 1\uff0c\u5176\u4f59\u7684\u503c\u5c11\u4e4b\u53c8\u5c11\u3002 \u9057\u5fd8\u95e8\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f2\uff1af_t=\\sigma (x_tW_x^{(f)}+h_{h-1}W_h^{(f)}+b^{(f)})\\)","title":"\u9057\u5fd8\u95e8"},{"location":"llm/nlp/rnns/#_6","text":"\\(\\tilde{C}_t\\) \u8868\u793a\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\uff0c\u6709\u8f93\u5165\u6570\u636e \\(x_t\\) \u548c\u9690\u8282\u70b9 \\(h_{t-1}\\) \u7ecf\u7531\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u5c42\u5f97\u5230\uff0c\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\u7684\u6fc0\u6d3b\u51fd\u6570\u901a\u5e38\u4f7f\u7528 tanh\u3002 \\(i_t\\) \u53eb\u505a\u8f93\u5165\u95e8\uff0c\u540c \\(f_t\\) \u4e00\u6837\u4e5f\u662f\u4e00\u4e2a\u5143\u7d20\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u5411\u91cf\uff0c\u540c\u6837\u7531 \\(x_t\\) \u548c \\(h_{t-1}\\) \u7ecf\u7531 sigmoid \u6fc0\u6d3b\u51fd\u6570\u8ba1\u7b97\u800c\u6210\u3002 \u8f93\u5165\u95e8\u548c\u5355\u5143\u66f4\u65b0\u503c\u7684\u8ba1\u7b97\u65b9\u5f0f\uff1a \\(\u516c\u5f0f3\uff1ai_t=\\sigma (x_tW_x^{(i)}+h_{t-1}W_h^{i}+b^{(i)})\\) \\(\u516c\u5f0f4\uff1ag_t=tanh(x_tW_x^{(g)}+h_{t-1}W_h^{(g)}+b^{(g)})\\)","title":"\u8f93\u5165\u95e8"},{"location":"llm/nlp/rnns/#_7","text":"\u6700\u540e\uff0c\u4e3a\u4e86\u8ba1\u7b97\u9884\u6d4b\u503c \\(\\hat{y}_t\\) \u548c\u751f\u6210\u4e0b\u4e2a\u65f6\u95f4\u7247\u5b8c\u6574\u7684\u8f93\u5165\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u9690\u8282\u70b9\u7684\u8f93\u51fa \\(h_t\\) \u3002 \u8f93\u51fa\u95e8\u548c\u9690\u8282\u70b9\u7684\u8ba1\u7b97\u516c\u5f0f \\(\u516c\u5f0f5\uff1ao_t=\\sigma (x_tW_x^{(o)}+h_{t-1}W_h^{(o)}+b^{(o)})\\) \\(\u516c\u5f0f6\uff1ah_t=o_t\\odot tanh(c_t)\\) \u6211\u4eec\u6765\u770b\u516c\u5f0f2\u30013\u30014\u30015\uff0c\u90fd\u662f\u578b\u5982 \\(xW_x+hW_h+b\\) \u7684\u683c\u5f0f\uff0c\u56e0\u6b64\u53ef\u4ee5\u6574\u5408\u4e3a\u901a\u8fc7\u4e00\u4e2a\u5f0f\u5b50\u8fdb\u884c\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\u88ab\u6574\u5408\u4e3a\u4e86 1 \u4e2a\u3002\u5982\u6b64\uff0c\u539f\u672c\u5355\u72ec\u6267\u884c4 \u6b21\u7684\u4eff\u5c04\u53d8\u6362\u901a\u8fc71 \u6b21\u8ba1\u7b97\u5373\u53ef\u5b8c\u6210\uff0c\u53ef\u4ee5\u52a0\u5feb\u8ba1\u7b97\u901f\u5ea6\u3002\u8fd9\u662f\u56e0\u4e3a\u77e9\u9635\u5e93\u8ba1\u7b97\u201c\u5927\u77e9\u9635\u201d\u65f6\u901a\u5e38\u4f1a\u66f4\u5feb\uff0c\u800c\u4e14\u901a\u8fc7\u5c06\u6743\u91cd\u6574\u5408\u5230\u4e00\u8d77\u7ba1\u7406\uff0c\u6e90\u4ee3\u7801\u4e5f\u4f1a\u66f4\u7b80\u6d01\u3002 \u5047\u8bbe \\(W_x\u3001W_h\\) \u548c \\(b\\) \u5206\u522b\u5305\u542b 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\uff0c\u6b64\u65f6 LSTM \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 import tensorflow as tf from tensorflow.keras import layers inputs = tf . random . normal (( 64 , 6 , 10 )) LSTM_layer = layers . LSTM ( units = 20 , return_sequences = True , return_state = True ) outputs , final_memory_state , final_carry_state = LSTM_layer ( inputs ) print ( outputs . shape , final_memory_state . shape , final_carry_state . shape ) # (64, 6, 20) (64, 20) (64, 20) print ( len ( LSTM_layer . weights )) # 3 print ( LSTM_layer . weights [ 0 ] . shape ) # Wx (10, 80) print ( LSTM_layer . weights [ 1 ] . shape ) # Wh (20, 80) print ( LSTM_layer . weights [ 2 ] . shape ) # bias (80,)","title":"\u8f93\u51fa\u95e8"},{"location":"llm/nlp/rnns/#gru","text":"LSTM \u7684\u53c2\u6570\u592a\u591a\uff0c\u8ba1\u7b97\u9700\u8981\u5f88\u957f\u65f6\u95f4\u3002\u56e0\u6b64\uff0c\u6700\u8fd1\u4e1a\u754c\u53c8\u63d0\u51fa\u4e86 GRU\uff08Gated RecurrentUnit\uff0c\u95e8\u63a7\u5faa\u73af\u5355\u5143\uff09\u3002GRU \u4fdd\u7559\u4e86 LSTM\u4f7f\u7528\u95e8\u7684\u7406\u5ff5\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u53c2\u6570\uff0c\u7f29\u77ed\u4e86\u8ba1\u7b97\u65f6\u95f4\u3002 \u76f8\u5bf9\u4e8e LSTM \u4f7f\u7528\u9690\u85cf\u72b6\u6001\u548c\u8bb0\u5fc6\u5355\u5143\u4e24\u6761\u7ebf\uff0cGRU\u53ea\u4f7f\u7528\u9690\u85cf\u72b6\u6001\u3002\u5f02\u540c\u70b9\u5982\u4e0b\uff1a GRU \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 GRU \u8ba1\u7b97\u56fe\u4e2d\uff0c \\(\\sigma\\) \u8282\u70b9\u548c tanh \u8282\u70b9\u6709\u4e13\u7528\u7684\u6743\u91cd\uff0c\u8282\u70b9\u5185\u90e8\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff08\u201c1\u2212\u201d\u8282\u70b9\u8f93\u5165x\uff0c\u8f93\u51fa1 \u2212 x\uff09 \\(\u516c\u5f0f2.1\uff1az=\\sigma(x_t W_x^{(z)}+h_{t-1} W_h^{(z)}+b^{(z)})\\) \\(\u516c\u5f0f2.2\uff1ar=\\sigma(x_t W_x^{(r)}+h_{t-1} W_h^{(r)}+b^{(r)})\\) \\(\u516c\u5f0f2.3\uff1a\\tilde{h}=\\tanh (x_t W_x+(r \\odot h_{t-1}) W_h+b)\\) \\(\u516c\u5f0f2.4\uff1ah_t=(1-z) \\odot h_{t-1}+z \\odot \\tilde{h}\\) GRU \u4e2d\u8fdb\u884c\u7684\u8ba1\u7b97\u7531\u4e0a\u8ff0 4 \u4e2a\u5f0f\u5b50\u8868\u793a\uff08\u8fd9\u91cc \\(x_t\\) \u548c \\(h_{t\u22121}\\) \u90fd\u662f\u884c\u5411\u91cf\uff09\uff0c\u5982\u56fe\u6240\u793a\uff0cGRU \u6ca1\u6709\u8bb0\u5fc6\u5355\u5143\uff0c\u53ea\u6709\u4e00\u4e2a\u9690\u85cf\u72b6\u6001 h \u5728\u65f6\u95f4\u65b9\u5411\u4e0a\u4f20\u64ad\u3002\u8fd9\u91cc\u4f7f\u7528 r \u548c z \u5171\u4e24\u4e2a\u95e8\uff08LSTM \u4f7f\u7528 3 \u4e2a\u95e8\uff09\uff0cr \u79f0\u4e3a reset \u95e8\uff0cz \u79f0\u4e3a update \u95e8\u3002 r\uff08reset\u95e8\uff09 \u51b3\u5b9a\u5728\u591a\u5927\u7a0b\u5ea6\u4e0a\u201c\u5ffd\u7565\u201d\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u3002\u6839\u636e\u516c\u5f0f2.3\uff0c\u5982\u679c r \u662f 0\uff0c\u5219\u65b0\u7684\u9690\u85cf\u72b6\u6001 \\(\\tilde{h}\\) \u4ec5\u53d6\u51b3\u4e8e\u8f93\u5165 \\(x_t\\) \u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6b64\u65f6\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u5c06\u5b8c\u5168\u88ab\u5ffd\u7565\u3002 z\uff08update\u95e8\uff09 \u662f\u66f4\u65b0\u9690\u85cf\u72b6\u6001\u7684\u95e8\uff0c\u5b83\u626e\u6f14\u4e86 LSTM \u7684 forget \u95e8\u548cinput \u95e8\u4e24\u4e2a\u89d2\u8272\u3002\u516c\u5f0f2.4 \u7684 \\((1-z) \\odot h_{t-1}\\) \u90e8\u5206\u5145\u5f53 forget \u95e8\u7684\u529f\u80fd\uff0c\u4ece\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u4e2d\u5220\u9664\u5e94\u8be5\u88ab\u9057\u5fd8\u7684\u4fe1\u606f\u3002 \\(z \\odot \\tilde{h}\\) \u7684\u90e8\u5206\u5145\u5f53 input \u95e8\u7684\u529f\u80fd\uff0c\u5bf9\u65b0\u589e\u7684\u4fe1\u606f\u8fdb\u884c\u52a0\u6743\u3002","title":"\u95e8\u63a7\u5faa\u73af\u5355\u5143 GRU"},{"location":"llm/nlp/word2vec/","text":"Word2Vec \u00b6 \u7ea6 2803 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract Word2Vec \u7684\u7279\u70b9\u662f\u80fd\u591f\u5c06\u5355\u8bcd\u8f6c\u5316\u4e3a\u5411\u91cf\u6765\u8868\u793a\uff0c\u8fd9\u6837\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u5c31\u53ef\u4ee5\u5b9a\u91cf\u5730\u53bb\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u6316\u6398\u8bcd\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u6700\u65e9\u7684\u8bcd\u5411\u91cf\u91c7\u7528 One-Hot \u7f16\u7801\uff0c\u53c8\u79f0\u4e00\u4f4d\u6709\u6548\u7f16\u7801\uff0c\u6bcf\u4e2a\u8bcd\u5411\u91cf\u7ef4\u5ea6\u5927\u5c0f\u4e3a\u6574\u4e2a\u8bcd\u6c47\u8868\u7684\u5927\u5c0f\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u5177\u4f53\u7684\u8bcd\u6c47\u8868\u4e2d\u7684\u8bcd\uff0c\u5c06\u5bf9\u5e94\u7684\u4f4d\u7f6e\u7f6e\u4e3a 1. Word2Vec \u57fa\u672c\u601d\u60f3 \u00b6 \u91c7\u7528One-Hot\u7f16\u7801\u65b9\u5f0f\u6765\u8868\u793a\u8bcd\u5411\u91cf\u975e\u5e38\u7b80\u5355\uff0c\u4f46\u7f3a\u70b9\u4e5f\u662f\u663e\u800c\u6613\u89c1\u7684\uff0c\u4e00\u65b9\u9762\u6211\u4eec\u5b9e\u9645\u4f7f\u7528\u7684\u8bcd\u6c47\u8868\u5f88\u5927\uff0c\u7ecf\u5e38\u662f\u767e\u4e07\u7ea7\u4ee5\u4e0a\uff0c\u8fd9\u4e48\u9ad8\u7ef4\u7684\u6570\u636e\u5904\u7406\u8d77\u6765\u4f1a\u6d88\u8017\u5927\u91cf\u7684\u8ba1\u7b97\u8d44\u6e90\u4e0e\u65f6\u95f4\u3002\u53e6\u4e00\u65b9\u9762\uff0cOne-Hot\u7f16\u7801\u4e2d\u6240\u6709\u8bcd\u5411\u91cf\u4e4b\u95f4\u5f7c\u6b64\u6b63\u4ea4\uff0c\u6ca1\u6709\u4f53\u73b0\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u7684\u76f8\u4f3c\u5173\u7cfb\u3002 Distributed representation\u53ef\u4ee5\u89e3\u51b3One-Hot\u7f16\u7801\u5b58\u5728\u7684\u95ee\u9898\uff0c\u5b83\u7684\u601d\u8def\u662f\u901a\u8fc7\u8bad\u7ec3\uff0c\u5c06\u539f\u6765One-Hot\u7f16\u7801\u7684\u6bcf\u4e2a\u8bcd\u90fd\u6620\u5c04\u5230\u4e00\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u4e0a\u6765\uff0c\u800c\u8fd9\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u7684\u7ef4\u5ea6\u53ef\u4ee5\u7531\u6211\u4eec\u81ea\u5df1\u5728\u8bad\u7ec3\u65f6\u6839\u636e\u4efb\u52a1\u9700\u8981\u6765\u81ea\u5df1\u6307\u5b9a\u3002 \u4e0b\u56fe\u662f\u91c7\u7528Distributed representation\u7684\u4e00\u4e2a\u4f8b\u5b50\uff0c\u6211\u4eec\u5c06\u8bcd\u6c47\u8868\u91cc\u7684\u8bcd\u7528\"Royalty\",\"Masculinity\", \"Femininity\"\u548c\"Age\"4\u4e2a\u7ef4\u5ea6\u6765\u8868\u793a\uff0cKing\u8fd9\u4e2a\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\u53ef\u80fd\u662f(0.99,0.99,0.05,0.7)\u3002\u5f53\u7136\u5728\u5b9e\u9645\u60c5\u51b5\u4e2d\uff0c\u6211\u4eec\u5e76\u4e0d\u80fd\u5bf9\u8bcd\u5411\u91cf\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u505a\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u91ca\u3002 \u6709\u4e86\u7528Distributed Representation\u8868\u793a\u7684\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8f83\u5bb9\u6613\u7684\u5206\u6790\u8bcd\u4e4b\u95f4\u7684\u5173\u7cfb\u4e86\uff0c\u6bd4\u5982\u6211\u4eec\u5c06\u8bcd\u7684\u7ef4\u5ea6\u964d\u7ef4\u52302\u7ef4\uff0c\u6709\u4e00\u4e2a\u6709\u8da3\u7684\u7814\u7a76\u8868\u660e\uff0c\u7528\u4e0b\u56fe\u7684\u8bcd\u5411\u91cf\u8868\u793a\u6211\u4eec\u7684\u8bcd\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\uff1a \\[ \\vec{King} - \\vec{Man} + \\vec{Woman} \\approx \\vec{Queen} \\] \u53ef\u89c1\u6211\u4eec\u53ea\u8981\u5f97\u5230\u4e86\u8bcd\u6c47\u8868\u91cc\u6240\u6709\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u505a\u5f88\u591a\u6709\u8da3\u7684\u4e8b\u60c5\u4e86\u3002\u4e0d\u8fc7\uff0c\u600e\u4e48\u8bad\u7ec3\u624d\u80fd\u5f97\u5230\u5408\u9002\u7684\u8bcd\u5411\u91cf\u5462\uff1f\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0cGoogle\u7684Tomas Mikolov\u5728\u4ed6\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u3002 Word2Vec \u539f\u7406 \u00b6 Word2Vec \u7684\u8bad\u7ec3\u6a21\u578b\u672c\u8d28\u4e0a\u662f\u53ea\u5177\u6709\u4e00\u4e2a\u9690\u542b\u5c42\u7684\u795e\u7ecf\u5143\u7f51\u7edc\u3002 \u5b83\u7684\u8f93\u5165\u91c7\u7528 One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\uff0c\u5b83\u7684\u8f93\u51fa\u4e5f\u662f One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\u3002\u4f7f\u7528\u6240\u6709\u7684\u6837\u672c\uff0c\u8bad\u7ec3\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\uff0c\u7b49\u5230\u6536\u655b\u4e4b\u540e\uff0c\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u90a3\u4e9b\u6743\u91cd\uff0c\u4fbf\u662f\u6bcf\u4e00\u4e2a\u8bcd\u7684\u91c7\u7528Distributed Representation\u7684\u8bcd\u5411\u91cf\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u5355\u8bcd\u7684Word embedding\u540e\u7684\u5411\u91cf\u4fbf\u662f\u77e9\u9635 \\(W_{V \\times N}\\) \u7684\u7b2ci\u884c\u7684\u8f6c\u7f6e\u3002\u8fd9\u6837\u6211\u4eec\u5c31\u628a\u539f\u672c\u7ef4\u6570\u4e3aV\u7684\u8bcd\u5411\u91cf\u53d8\u6210\u4e86\u7ef4\u6570\u4e3aN\u7684\u8bcd\u5411\u91cf\uff08N\u8fdc\u5c0f\u4e8eV\uff09\uff0c\u5e76\u4e14\u8bcd\u5411\u91cf\u95f4\u4fdd\u7559\u4e86\u4e00\u5b9a\u7684\u76f8\u5173\u5173\u7cfb\u3002 Google\u7684Mikolov\u5728\u5173\u4e8eWord2Vec\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u6a21\u578b\uff0cCBOW\u9002\u5408\u4e8e\u6570\u636e\u96c6\u8f83\u5c0f\u7684\u60c5\u51b5\uff0c\u800cSkip-Gram\u5728\u5927\u578b\u8bed\u6599\u4e2d\u8868\u73b0\u66f4\u597d\u3002\u5176\u4e2dCBOW\u5982\u4e0b\u56fe\u5de6\u90e8\u5206\u6240\u793a\uff0c\u4f7f\u7528\u56f4\u7ed5\u76ee\u6807\u5355\u8bcd\u7684\u5176\u4ed6\u5355\u8bcd\uff08\u8bed\u5883\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u5728\u6620\u5c04\u5c42\u505a\u52a0\u6743\u5904\u7406\u540e\u8f93\u51fa\u76ee\u6807\u5355\u8bcd\u3002\u4e0eCBOW\u6839\u636e\u8bed\u5883\u9884\u6d4b\u76ee\u6807\u5355\u8bcd\u4e0d\u540c\uff0cSkip-gram\u6839\u636e\u5f53\u524d\u5355\u8bcd\u9884\u6d4b\u8bed\u5883\uff0c\u5982\u4e0b\u56fe\u53f3\u90e8\u5206\u6240\u793a\u3002\u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u4f5c\u4e3a\u8bad\u7ec3\u6570\u636e\uff0cCBOW\u7684\u8f93\u5165\u4e3a\uff08is,an,on,the\uff09\uff0c\u8f93\u51fa\u4e3aapple\u3002\u800cSkip-gram\u7684\u8f93\u5165\u4e3aapple\uff0c\u8f93\u51fa\u4e3a\uff08is,an,on,the\uff09\u3002 CBOW \u00b6 \u8f93\u5165\u5c42\uff1a\u4e0a\u4e0b\u6587\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\uff0cV \u4e3a\u8bcd\u6c47\u8868\u5355\u8bcd\u4e2a\u6570\uff0cC \u4e3a\u4e0a\u4e0b\u6587\u5355\u8bcd\u4e2a\u6570\u3002\u4ee5 \u201cThere is an apple on the table\u201d \u4e3a\u4f8b\uff0cC=4\uff0c\u6240\u4ee5\u6a21\u578b\u8f93\u5165\u662f\uff08is,an,on,the\uff094 \u4e2a\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u3002 \u521d\u59cb\u5316\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{V \\times N}\\) \uff0c\u7136\u540e\u7528\u6240\u6709\u8f93\u5165\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u5de6\u4e58\u8be5\u77e9\u9635\uff0c\u5f97\u5230\u7ef4\u6570\u4e3a N \u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \uff0c\u8fd9\u91cc\u7684 N \u7531\u81ea\u5df1\u6839\u636e\u4efb\u52a1\u9700\u8981\u8bbe\u7f6e\u3002 \u5c06\u6240\u5f97\u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \u6c42\u548c\u53d6\u5e73\u5747\u4f5c\u4e3a\u9690\u85cf\u5c42\u5411\u91cf h\u3002 \u521d\u59cb\u5316\u53e6\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{N \\times V}^\\prime\\) \uff0c\u7528\u9690\u85cf\u5c42\u5411\u91cf h \u5de6\u4e58 \\(W_{N \\times V}^\\prime\\) \uff0c\u5728\u7ecf\u6fc0\u6d3b\u51fd\u6570\u5904\u7406\u5f97\u5230 V \u7ef4\u7684\u5411\u91cf y\uff0cy \u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4ee3\u8868\u76f8\u5bf9\u5e94\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u6982\u7387\u5206\u5e03\u3002 y \u4e2d\u6982\u7387\u6700\u5927\u7684\u5143\u7d20\u6240\u6307\u793a\u7684\u5355\u8bcd\u4e3a\u9884\u6d4b\u51fa\u7684\u4e2d\u95f4\u8bcd\uff08target word\uff09\u4e0e true label \u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u505a\u6bd4\u8f83\uff0c\u8bef\u5dee\u8d8a\u5c0f\u8d8a\u597d\uff08\u6839\u636e\u8bef\u5dee\u66f4\u65b0\u4e24\u4e2a\u6743\u91cd\u77e9\u9635\uff09\u3002 \u5728\u8bad\u7ec3\u524d\u9700\u8981\u5b9a\u4e49\u597d\u635f\u5931\u51fd\u6570\uff08\u4e00\u822c\u4e3a\u4ea4\u53c9\u71b5\u4ee3\u4ef7\u51fd\u6570\uff09\uff0c\u91c7\u7528\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\u66f4\u65b0 \\(W\\) \u548c \\(W^\\prime\\) \u3002\u8bad\u7ec3\u5b8c\u6bd5\u540e\uff0c\u8f93\u5165\u5c42\u7684\u6bcf\u4e2a\u5355\u8bcd\u4e0e\u77e9\u9635 W \u76f8\u4e58\u5f97\u5230\u7684\u5411\u91cf\u5c31\u662f\u6211\u4eec\u60f3\u8981\u7684 Distributed Representation \u8868\u793a\u7684\u8bcd\u5411\u91cf\uff0c\u4e5f\u53eb word embedding\u3002\u56e0\u4e3a One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u4e2d\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u90fd\u4e3a 0\uff0c\u6240\u4ee5\u7b2c i \u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u77e9\u9635 W \u540e\uff0c\u5f97\u5230\u7684\u5c31\u662f\u77e9\u9635\u7684\u7b2c i \u884c\uff0c\u6240\u4ee5\u8fd9\u4e2a\u77e9\u9635\u4e5f\u53eb\u505a look up table\uff0c\u6709\u4e86 look up table \u5c31\u53ef\u4ee5\u514d\u53bb\u8bad\u7ec3\u8fc7\u7a0b\uff0c\u76f4\u63a5\u67e5\u8868\u5f97\u5230\u5355\u8bcd\u7684\u8bcd\u5411\u91cf\u3002 Skip-gram \u00b6 Skip-Gram \u662f\u7ed9\u5b9a input word \u6765\u9884\u6d4b\u4e0a\u4e0b\u6587\uff0c\u5176\u6a21\u578b\u7ed3\u6784\u5982\u4e0a\u56fe\u6240\u793a\u3002\u5b83\u7684\u505a\u6cd5\u662f\uff0c\u5c06\u4e00\u4e2a\u8bcd\u6240\u5728\u7684\u4e0a\u4e0b\u6587\u4e2d\u7684\u8bcd\u4f5c\u4e3a\u8f93\u51fa\uff0c\u800c\u90a3\u4e2a\u8bcd\u672c\u8eab\u4f5c\u4e3a\u8f93\u5165\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u7ed9\u51fa\u4e00\u4e2a\u8bcd\uff0c\u5e0c\u671b\u9884\u6d4b\u53ef\u80fd\u51fa\u73b0\u7684\u4e0a\u4e0b\u6587\u7684\u8bcd\u3002\u901a\u8fc7\u5728\u4e00\u4e2a\u5927\u7684\u8bed\u6599\u5e93\u8bad\u7ec3\uff0c\u5f97\u5230\u4e00\u4e2a\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u6743\u91cd\u6a21\u578b\u3002\u201capple\u201d\u7684\u4e0a\u4e0b\u6587\u8bcd\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09.\u90a3\u4e48\u4ee5apple\u7684One-Hot\u8bcd\u5411\u91cf\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u5219\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09\u7684One-Hot\u8bcd\u5411\u91cf\u3002\u8bad\u7ec3\u5b8c\u6210\u540e\uff0c\u5c31\u5f97\u5230\u4e86\u6bcf\u4e2a\u8bcd\u5230\u9690\u542b\u5c42\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u7684\u6743\u91cd\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bcd\u7684\u5411\u91cf\uff08\u548cCBOW\u4e2d\u4e00\u6837\uff09\u3002 \u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u3002 \u9996\u5148\u9009\u53e5\u5b50\u4e2d\u95f4\u7684\u4e00\u4e2a\u8bcd\u4f5c\u4e3a\u8f93\u5165\u8bcd\uff0c\u6bd4\u5982\u9009\u53d6\u201capple\u201d\u4f5c\u4e3a input word\u3002 \u6709\u4e86 input word \u4ee5\u540e\uff0c\u518d\u5b9a\u4e49\u4e00\u4e2a\u53eb\u505a skip_window \u7684\u53c2\u6570\uff0c\u5b83\u4ee3\u8868\u7740\u4ece\u5f53\u524d input word \u7684\u4e00\u4fa7\uff08\u5de6\u8fb9\u6216\u53f3\u8fb9\uff09\u9009\u53d6\u8bcd\u7684\u6570\u91cf\u3002\u5982\u679c\u8bbe\u7f6e skip_window=2\uff0c\u90a3\u4e48\u6700\u7ec8\u83b7\u5f97\u7a97\u53e3\u4e2d\u7684\u8bcd\uff08\u5305\u62ec input word \u5728\u5185\uff09\u5c31\u662f[\u2018is\u2019,\u2019an\u2019,\u2019apple\u2019,\u2019on\u2019,\u2019the\u2019 ]\u3002skip_window=2\u4ee3\u8868\u7740\u9009\u53d6\u5de6input word\u5de6\u4fa72\u4e2a\u8bcd\u548c\u53f3\u4fa72\u4e2a\u8bcd\u8fdb\u5165\u6211\u4eec\u7684\u7a97\u53e3\uff0c\u6240\u4ee5\u6574\u4e2a\u7a97\u53e3\u5927\u5c0fspan=2x2=4\u3002\u53e6\u4e00\u4e2a\u53c2\u6570\u53ebnum_skips\uff0c\u5b83\u4ee3\u8868\u7740\u6211\u4eec\u4ece\u6574\u4e2a\u7a97\u53e3\u4e2d\u9009\u53d6\u591a\u5c11\u4e2a\u4e0d\u540c\u7684\u8bcd\u4f5c\u4e3a\u6211\u4eec\u7684output word\uff0c\u5f53skip_window=2\uff0cnum_skips=2\u65f6\uff0c\u6211\u4eec\u5c06\u4f1a\u5f97\u5230\u4e24\u7ec4 (input word, output word) \u5f62\u5f0f\u7684\u8bad\u7ec3\u6570\u636e\uff0c\u5373 ('apple', 'an')\uff0c('apple', 'one')\u3002 \u795e\u7ecf\u7f51\u7edc\u57fa\u4e8e\u8fd9\u4e9b\u8bad\u7ec3\u6570\u636e\u4e2d\u6bcf\u5bf9\u5355\u8bcd\u51fa\u73b0\u7684\u6b21\u6570\u4e60\u5f97\u7edf\u8ba1\u7ed3\u679c\uff0c\u5e76\u8f93\u51fa\u4e00\u4e2a\u6982\u7387\u5206\u5e03\uff0c\u8fd9\u4e2a\u6982\u7387\u5206\u5e03\u4ee3\u8868\u7740\u5230\u6211\u4eec\u8bcd\u5178\u4e2d\u6bcf\u4e2a\u8bcd\u6709\u591a\u5927\u53ef\u80fd\u6027\u8ddfinput word\u540c\u65f6\u51fa\u73b0\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u6211\u4eec\u5411\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u4e2d\u8f93\u5165\u4e00\u4e2a\u5355\u8bcd\u201c\u4e2d\u56fd\u201c\uff0c\u90a3\u4e48\u6700\u7ec8\u6a21\u578b\u7684\u8f93\u51fa\u6982\u7387\u4e2d\uff0c\u50cf\u201c\u82f1\u56fd\u201d\uff0c \u201d\u4fc4\u7f57\u65af\u201c\u8fd9\u79cd\u76f8\u5173\u8bcd\u7684\u6982\u7387\u5c06\u8fdc\u9ad8\u4e8e\u50cf\u201d\u82f9\u679c\u201c\uff0c\u201d\u8748\u8748\u201c\u975e\u76f8\u5173\u8bcd\u7684\u6982\u7387\u3002\u56e0\u4e3a\u201d\u82f1\u56fd\u201c\uff0c\u201d\u4fc4\u7f57\u65af\u201c\u5728\u6587\u672c\u4e2d\u66f4\u5927\u53ef\u80fd\u5728\u201d\u4e2d\u56fd\u201c\u7684\u7a97\u53e3\u4e2d\u51fa\u73b0\u3002\u6211\u4eec\u5c06\u901a\u8fc7\u7ed9\u795e\u7ecf\u7f51\u7edc\u8f93\u5165\u6587\u672c\u4e2d\u6210\u5bf9\u7684\u5355\u8bcd\u6765\u8bad\u7ec3\u5b83\u5b8c\u6210\u4e0a\u9762\u6240\u8bf4\u7684\u6982\u7387\u8ba1\u7b97\u3002 \u901a\u8fc7\u68af\u5ea6\u4e0b\u964d\u548c\u53cd\u5411\u4f20\u64ad\u66f4\u65b0\u77e9\u9635 W W \u4e2d\u7684\u884c\u5411\u91cf\u5373\u4e3a\u6bcf\u4e2a\u5355\u8bcd\u7684 Word embedding \u8868\u793a \u603b\u7ed3 CBOW \u548c Skip-gram \u6700\u7406\u60f3\u60c5\u51b5\u4e0b\u7684\u5b9e\u73b0\uff0c\u5373\u8bad\u7ec3\u8fed\u4ee3\u4e24\u4e2a\u77e9\u9635 \\(W\\) \u548c \\(W^\\prime\\) \uff0c\u4e4b\u540e\u518d\u8f93\u51fa\u5c42\u91c7\u7528 softmax \u51fd\u6570\u6765\u8ba1\u7b97\u8f93\u51fa\u5404\u4e2a\u8bcd\u7684\u6982\u7387\u3002\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u8fd9\u79cd\u65b9\u6cd5\u7684\u8bad\u7ec3\u5f00\u9500\u5f88\u5927\uff0c\u4e0d\u5177\u6709\u5f88\u5f3a\u7684\u5b9e\u7528\u6027\uff0c\u4e3a\u4e86\u4f7f\u5f97\u6a21\u578b\u4fbf\u4e8e\u8bad\u7ec3\uff0c\u6709\u5b66\u8005\u63d0\u51fa\u4e86 Hierarchical Softmax \u548c Negative Sampling \u4e24\u79cd\u6539\u8fdb\u65b9\u6cd5\u3002 Hierarchical Softmax \u00b6 Hierarchical Softmax \u5bf9\u539f\u6a21\u578b\u7684\u6539\u8fdb\u4e3b\u8981\u6709\u4e24\u70b9 \u7b2c\u4e00\u70b9\u662f\u4ece\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6620\u5c04\uff0c\u6ca1\u6709\u91c7\u7528\u539f\u5148\u7684\u4e0e\u77e9\u9635 W \u76f8\u4e58\u7136\u540e\u76f8\u52a0\u6c42\u5e73\u5747\u7684\u65b9\u6cd5\uff0c\u800c\u662f\u76f4\u63a5\u5bf9\u6240\u6709\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u6c42\u548c\u3002\u5047\u8bbe\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c0\uff09\u548c\uff080\uff0c0\uff0c0\uff0c1\uff09\uff0c\u90a3\u4e48\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c1\uff09\u3002 Hierarchical Softmax \u7684\u7b2c\u4e8c\u70b9\u6539\u8fdb\u662f\u91c7\u7528\u54c8\u592b\u66fc\u6811\u6765\u66ff\u6362\u4e86\u539f\u5148\u7684\u4ece\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u77e9\u9635 \\(W^\\prime\\) \u3002\u54c8\u592b\u66fc\u6811\u7684\u53f6\u8282\u70b9\u4e2a\u6570\u4e3a\u8bcd\u6c47\u8868\u7684\u5355\u8bcd\u4e2a\u6570 V\uff0c\u4e00\u4e2a\u53f6\u8282\u70b9\u4ee3\u8868\u4e00\u4e2a\u5355\u8bcd\uff0c\u800c\u4ece\u6839\u7ed3\u70b9\u5230\u53f6\u8282\u70b9\u7684\u8def\u5f84\u786e\u5b9a\u4e86\u8fd9\u4e2a\u5355\u8bcd\u6700\u7ec8\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002 \u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u68f5\u54c8\u592b\u66fc\u6811\u9664\u4e86\u6839\u8282\u70b9\u4ee5\u5916\u7684\u6240\u6709\u975e\u53f6\u8282\u70b9\u4e2d\u90fd\u542b\u6709\u4e00\u4e2a\u7531\u53c2\u6570 \\(\\theta\\) \u786e\u5b9a\u7684 sigmoid \u51fd\u6570\uff0c\u4e0d\u540c\u8282\u70b9\u7684 \\(\\theta\\) \u4e0d\u4e00\u6837\u3002\u8bad\u7ec3\u65f6\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e0e\u8fd9\u4e2a sigmoid \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97\uff0c\u6839\u636e\u7ed3\u679c\u8fdb\u884c\u5206\u7c7b\uff0c\u82e5\u5206\u7c7b\u4e3a\u8d1f\u7c7b\u5219\u6cbf\u5de6\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 0\uff1b\u82e5\u5206\u7c7b\u4e3a\u6b63\u7c7b\u5219\u6cbf\u53f3\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 1\u3002\u6700\u7ec8\u5230\u8fbe\u53f6\u8282\u70b9\uff0c\u53f6\u8282\u70b9\u7684\u5411\u91cf\u5373\u4e3a\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002 Negative Sampling \u00b6 \u5c3d\u7ba1\u54c8\u592b\u66fc\u6811\u7684\u5f15\u5165\u4e3a\u6a21\u578b\u7684\u8bad\u7ec3\u7f29\u77ed\u4e86\u8bb8\u591a\u5f00\u9500\uff0c\u4f46\u5bf9\u4e8e\u4e00\u4e9b\u4e0d\u5e38\u89c1\u3001\u8f83\u751f\u50fb\u7684\u8bcd\u6c47\uff0c\u54c8\u592b\u66fc\u6811\u5728\u8ba1\u7b97\u5b83\u4eec\u7684\u8bcd\u5411\u91cf\u65f6\u4ecd\u7136\u9700\u8981\u505a\u5927\u91cf\u7684\u8fd0\u7b97\u3002 \u8d1f\u91c7\u6837\u662f\u53e6\u4e00\u79cd\u63d0\u9ad8 Word2Vec \u6548\u7387\u7684\u65b9\u6cd5\uff0c\u5b83\u662f\u57fa\u4e8e\u8fd9\u6837\u7684\u89c2\u5bdf\uff1a\u8bad\u7ec3\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u610f\u5473\u7740\u4f7f\u7528\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u5c31\u8981\u7a0d\u5fae\u8c03\u6574\u4e00\u4e0b\u795e\u7ecf\u7f51\u7edc\u4e2d\u6240\u6709\u7684\u6743\u91cd\uff0c\u8fd9\u6837\u624d\u80fd\u786e\u4fdd\u9884\u6d4b\u8bad\u7ec3\u6837\u672c\u66f4\u52a0\u7cbe\u786e\uff0c\u5982\u679c\u80fd\u8bbe\u8ba1\u4e00\u79cd\u65b9\u6cd5\u6bcf\u6b21\u53ea\u66f4\u65b0\u4e00\u90e8\u5206\u6743\u91cd\uff0c\u90a3\u4e48\u8ba1\u7b97\u590d\u6742\u5ea6\u5c06\u5927\u5927\u964d\u4f4e\u3002 \u5c06\u4ee5\u4e0a\u89c2\u5bdf\u5f15\u5165 Word2Vec \u5c31\u662f\uff1a\u5f53\u901a\u8fc7\uff08\u201dfox\u201d, \u201cquick\u201d\uff09\u8bcd\u5bf9\u6765\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u65f6\uff0c\u6211\u4eec\u56de\u60f3\u8d77\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\u7684\u201c\u6807\u7b7e\u201d\u6216\u8005\u662f\u201c\u6b63\u786e\u7684\u8f93\u51fa\u201d\u662f\u4e00\u4e2aone-hot\u5411\u91cf\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5bf9\u4e8e\u795e\u7ecf\u7f51\u7edc\u4e2d\u5bf9\u5e94\u4e8e\u201dquick\u201d\u8fd9\u4e2a\u5355\u8bcd\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u4e3a1\uff0c\u800c\u5176\u4ed6\u4e0a\u5343\u4e2a\u7684\u8f93\u51fa\u795e\u7ecf\u5143\u5219\u5bf9\u5e94\u4e3a0\u3002\u4f7f\u7528\u8d1f\u91c7\u6837\uff0c\u6211\u4eec\u901a\u8fc7\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u8f83\u5c11\u6570\u76ee\uff08\u6bd4\u5982\u8bf45\u4e2a\uff09\u7684\u201c\u8d1f\u201d\u6837\u672c\u6765\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\u3002\uff08\u5728\u8fd9\u4e2a\u6761\u4ef6\u4e0b\uff0c\u201c\u8d1f\u201d\u5355\u8bcd\u5c31\u662f\u6211\u4eec\u5e0c\u671b\u795e\u7ecf\u7f51\u7edc\u8f93\u51fa\u4e3a0\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u7684\u5355\u8bcd\uff09\u3002\u5e76\u4e14\u6211\u4eec\u4ecd\u7136\u4e3a\u6211\u4eec\u7684\u201c\u6b63\u201d\u5355\u8bcd\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\uff08\u4e5f\u5c31\u662f\u5f53\u524d\u6837\u672c\u4e0b\u201dquick\u201d\u5bf9\u5e94\u7684\u795e\u7ecf\u5143\u4ecd\u7136\u8f93\u51fa\u4e3a1\uff09\u3002 Reference \u00b6 Word2Vec\u8be6\u89e3 \u6df1\u5165\u6d45\u51faWord2Vec\u539f\u7406\u89e3\u6790 NLP\u4e4b\u2014\u2014Word2Vec\u8be6\u89e3","title":"Word2Vec"},{"location":"llm/nlp/word2vec/#word2vec","text":"\u7ea6 2803 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract Word2Vec \u7684\u7279\u70b9\u662f\u80fd\u591f\u5c06\u5355\u8bcd\u8f6c\u5316\u4e3a\u5411\u91cf\u6765\u8868\u793a\uff0c\u8fd9\u6837\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u5c31\u53ef\u4ee5\u5b9a\u91cf\u5730\u53bb\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u6316\u6398\u8bcd\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u6700\u65e9\u7684\u8bcd\u5411\u91cf\u91c7\u7528 One-Hot \u7f16\u7801\uff0c\u53c8\u79f0\u4e00\u4f4d\u6709\u6548\u7f16\u7801\uff0c\u6bcf\u4e2a\u8bcd\u5411\u91cf\u7ef4\u5ea6\u5927\u5c0f\u4e3a\u6574\u4e2a\u8bcd\u6c47\u8868\u7684\u5927\u5c0f\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u5177\u4f53\u7684\u8bcd\u6c47\u8868\u4e2d\u7684\u8bcd\uff0c\u5c06\u5bf9\u5e94\u7684\u4f4d\u7f6e\u7f6e\u4e3a 1.","title":"Word2Vec"},{"location":"llm/nlp/word2vec/#word2vec_1","text":"\u91c7\u7528One-Hot\u7f16\u7801\u65b9\u5f0f\u6765\u8868\u793a\u8bcd\u5411\u91cf\u975e\u5e38\u7b80\u5355\uff0c\u4f46\u7f3a\u70b9\u4e5f\u662f\u663e\u800c\u6613\u89c1\u7684\uff0c\u4e00\u65b9\u9762\u6211\u4eec\u5b9e\u9645\u4f7f\u7528\u7684\u8bcd\u6c47\u8868\u5f88\u5927\uff0c\u7ecf\u5e38\u662f\u767e\u4e07\u7ea7\u4ee5\u4e0a\uff0c\u8fd9\u4e48\u9ad8\u7ef4\u7684\u6570\u636e\u5904\u7406\u8d77\u6765\u4f1a\u6d88\u8017\u5927\u91cf\u7684\u8ba1\u7b97\u8d44\u6e90\u4e0e\u65f6\u95f4\u3002\u53e6\u4e00\u65b9\u9762\uff0cOne-Hot\u7f16\u7801\u4e2d\u6240\u6709\u8bcd\u5411\u91cf\u4e4b\u95f4\u5f7c\u6b64\u6b63\u4ea4\uff0c\u6ca1\u6709\u4f53\u73b0\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u7684\u76f8\u4f3c\u5173\u7cfb\u3002 Distributed representation\u53ef\u4ee5\u89e3\u51b3One-Hot\u7f16\u7801\u5b58\u5728\u7684\u95ee\u9898\uff0c\u5b83\u7684\u601d\u8def\u662f\u901a\u8fc7\u8bad\u7ec3\uff0c\u5c06\u539f\u6765One-Hot\u7f16\u7801\u7684\u6bcf\u4e2a\u8bcd\u90fd\u6620\u5c04\u5230\u4e00\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u4e0a\u6765\uff0c\u800c\u8fd9\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u7684\u7ef4\u5ea6\u53ef\u4ee5\u7531\u6211\u4eec\u81ea\u5df1\u5728\u8bad\u7ec3\u65f6\u6839\u636e\u4efb\u52a1\u9700\u8981\u6765\u81ea\u5df1\u6307\u5b9a\u3002 \u4e0b\u56fe\u662f\u91c7\u7528Distributed representation\u7684\u4e00\u4e2a\u4f8b\u5b50\uff0c\u6211\u4eec\u5c06\u8bcd\u6c47\u8868\u91cc\u7684\u8bcd\u7528\"Royalty\",\"Masculinity\", \"Femininity\"\u548c\"Age\"4\u4e2a\u7ef4\u5ea6\u6765\u8868\u793a\uff0cKing\u8fd9\u4e2a\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\u53ef\u80fd\u662f(0.99,0.99,0.05,0.7)\u3002\u5f53\u7136\u5728\u5b9e\u9645\u60c5\u51b5\u4e2d\uff0c\u6211\u4eec\u5e76\u4e0d\u80fd\u5bf9\u8bcd\u5411\u91cf\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u505a\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u91ca\u3002 \u6709\u4e86\u7528Distributed Representation\u8868\u793a\u7684\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8f83\u5bb9\u6613\u7684\u5206\u6790\u8bcd\u4e4b\u95f4\u7684\u5173\u7cfb\u4e86\uff0c\u6bd4\u5982\u6211\u4eec\u5c06\u8bcd\u7684\u7ef4\u5ea6\u964d\u7ef4\u52302\u7ef4\uff0c\u6709\u4e00\u4e2a\u6709\u8da3\u7684\u7814\u7a76\u8868\u660e\uff0c\u7528\u4e0b\u56fe\u7684\u8bcd\u5411\u91cf\u8868\u793a\u6211\u4eec\u7684\u8bcd\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\uff1a \\[ \\vec{King} - \\vec{Man} + \\vec{Woman} \\approx \\vec{Queen} \\] \u53ef\u89c1\u6211\u4eec\u53ea\u8981\u5f97\u5230\u4e86\u8bcd\u6c47\u8868\u91cc\u6240\u6709\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u505a\u5f88\u591a\u6709\u8da3\u7684\u4e8b\u60c5\u4e86\u3002\u4e0d\u8fc7\uff0c\u600e\u4e48\u8bad\u7ec3\u624d\u80fd\u5f97\u5230\u5408\u9002\u7684\u8bcd\u5411\u91cf\u5462\uff1f\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0cGoogle\u7684Tomas Mikolov\u5728\u4ed6\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u3002","title":"Word2Vec \u57fa\u672c\u601d\u60f3"},{"location":"llm/nlp/word2vec/#word2vec_2","text":"Word2Vec \u7684\u8bad\u7ec3\u6a21\u578b\u672c\u8d28\u4e0a\u662f\u53ea\u5177\u6709\u4e00\u4e2a\u9690\u542b\u5c42\u7684\u795e\u7ecf\u5143\u7f51\u7edc\u3002 \u5b83\u7684\u8f93\u5165\u91c7\u7528 One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\uff0c\u5b83\u7684\u8f93\u51fa\u4e5f\u662f One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\u3002\u4f7f\u7528\u6240\u6709\u7684\u6837\u672c\uff0c\u8bad\u7ec3\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\uff0c\u7b49\u5230\u6536\u655b\u4e4b\u540e\uff0c\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u90a3\u4e9b\u6743\u91cd\uff0c\u4fbf\u662f\u6bcf\u4e00\u4e2a\u8bcd\u7684\u91c7\u7528Distributed Representation\u7684\u8bcd\u5411\u91cf\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u5355\u8bcd\u7684Word embedding\u540e\u7684\u5411\u91cf\u4fbf\u662f\u77e9\u9635 \\(W_{V \\times N}\\) \u7684\u7b2ci\u884c\u7684\u8f6c\u7f6e\u3002\u8fd9\u6837\u6211\u4eec\u5c31\u628a\u539f\u672c\u7ef4\u6570\u4e3aV\u7684\u8bcd\u5411\u91cf\u53d8\u6210\u4e86\u7ef4\u6570\u4e3aN\u7684\u8bcd\u5411\u91cf\uff08N\u8fdc\u5c0f\u4e8eV\uff09\uff0c\u5e76\u4e14\u8bcd\u5411\u91cf\u95f4\u4fdd\u7559\u4e86\u4e00\u5b9a\u7684\u76f8\u5173\u5173\u7cfb\u3002 Google\u7684Mikolov\u5728\u5173\u4e8eWord2Vec\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u6a21\u578b\uff0cCBOW\u9002\u5408\u4e8e\u6570\u636e\u96c6\u8f83\u5c0f\u7684\u60c5\u51b5\uff0c\u800cSkip-Gram\u5728\u5927\u578b\u8bed\u6599\u4e2d\u8868\u73b0\u66f4\u597d\u3002\u5176\u4e2dCBOW\u5982\u4e0b\u56fe\u5de6\u90e8\u5206\u6240\u793a\uff0c\u4f7f\u7528\u56f4\u7ed5\u76ee\u6807\u5355\u8bcd\u7684\u5176\u4ed6\u5355\u8bcd\uff08\u8bed\u5883\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u5728\u6620\u5c04\u5c42\u505a\u52a0\u6743\u5904\u7406\u540e\u8f93\u51fa\u76ee\u6807\u5355\u8bcd\u3002\u4e0eCBOW\u6839\u636e\u8bed\u5883\u9884\u6d4b\u76ee\u6807\u5355\u8bcd\u4e0d\u540c\uff0cSkip-gram\u6839\u636e\u5f53\u524d\u5355\u8bcd\u9884\u6d4b\u8bed\u5883\uff0c\u5982\u4e0b\u56fe\u53f3\u90e8\u5206\u6240\u793a\u3002\u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u4f5c\u4e3a\u8bad\u7ec3\u6570\u636e\uff0cCBOW\u7684\u8f93\u5165\u4e3a\uff08is,an,on,the\uff09\uff0c\u8f93\u51fa\u4e3aapple\u3002\u800cSkip-gram\u7684\u8f93\u5165\u4e3aapple\uff0c\u8f93\u51fa\u4e3a\uff08is,an,on,the\uff09\u3002","title":"Word2Vec \u539f\u7406"},{"location":"llm/nlp/word2vec/#cbow","text":"\u8f93\u5165\u5c42\uff1a\u4e0a\u4e0b\u6587\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\uff0cV \u4e3a\u8bcd\u6c47\u8868\u5355\u8bcd\u4e2a\u6570\uff0cC \u4e3a\u4e0a\u4e0b\u6587\u5355\u8bcd\u4e2a\u6570\u3002\u4ee5 \u201cThere is an apple on the table\u201d \u4e3a\u4f8b\uff0cC=4\uff0c\u6240\u4ee5\u6a21\u578b\u8f93\u5165\u662f\uff08is,an,on,the\uff094 \u4e2a\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u3002 \u521d\u59cb\u5316\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{V \\times N}\\) \uff0c\u7136\u540e\u7528\u6240\u6709\u8f93\u5165\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u5de6\u4e58\u8be5\u77e9\u9635\uff0c\u5f97\u5230\u7ef4\u6570\u4e3a N \u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \uff0c\u8fd9\u91cc\u7684 N \u7531\u81ea\u5df1\u6839\u636e\u4efb\u52a1\u9700\u8981\u8bbe\u7f6e\u3002 \u5c06\u6240\u5f97\u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \u6c42\u548c\u53d6\u5e73\u5747\u4f5c\u4e3a\u9690\u85cf\u5c42\u5411\u91cf h\u3002 \u521d\u59cb\u5316\u53e6\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{N \\times V}^\\prime\\) \uff0c\u7528\u9690\u85cf\u5c42\u5411\u91cf h \u5de6\u4e58 \\(W_{N \\times V}^\\prime\\) \uff0c\u5728\u7ecf\u6fc0\u6d3b\u51fd\u6570\u5904\u7406\u5f97\u5230 V \u7ef4\u7684\u5411\u91cf y\uff0cy \u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4ee3\u8868\u76f8\u5bf9\u5e94\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u6982\u7387\u5206\u5e03\u3002 y \u4e2d\u6982\u7387\u6700\u5927\u7684\u5143\u7d20\u6240\u6307\u793a\u7684\u5355\u8bcd\u4e3a\u9884\u6d4b\u51fa\u7684\u4e2d\u95f4\u8bcd\uff08target word\uff09\u4e0e true label \u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u505a\u6bd4\u8f83\uff0c\u8bef\u5dee\u8d8a\u5c0f\u8d8a\u597d\uff08\u6839\u636e\u8bef\u5dee\u66f4\u65b0\u4e24\u4e2a\u6743\u91cd\u77e9\u9635\uff09\u3002 \u5728\u8bad\u7ec3\u524d\u9700\u8981\u5b9a\u4e49\u597d\u635f\u5931\u51fd\u6570\uff08\u4e00\u822c\u4e3a\u4ea4\u53c9\u71b5\u4ee3\u4ef7\u51fd\u6570\uff09\uff0c\u91c7\u7528\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\u66f4\u65b0 \\(W\\) \u548c \\(W^\\prime\\) \u3002\u8bad\u7ec3\u5b8c\u6bd5\u540e\uff0c\u8f93\u5165\u5c42\u7684\u6bcf\u4e2a\u5355\u8bcd\u4e0e\u77e9\u9635 W \u76f8\u4e58\u5f97\u5230\u7684\u5411\u91cf\u5c31\u662f\u6211\u4eec\u60f3\u8981\u7684 Distributed Representation \u8868\u793a\u7684\u8bcd\u5411\u91cf\uff0c\u4e5f\u53eb word embedding\u3002\u56e0\u4e3a One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u4e2d\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u90fd\u4e3a 0\uff0c\u6240\u4ee5\u7b2c i \u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u77e9\u9635 W \u540e\uff0c\u5f97\u5230\u7684\u5c31\u662f\u77e9\u9635\u7684\u7b2c i \u884c\uff0c\u6240\u4ee5\u8fd9\u4e2a\u77e9\u9635\u4e5f\u53eb\u505a look up table\uff0c\u6709\u4e86 look up table \u5c31\u53ef\u4ee5\u514d\u53bb\u8bad\u7ec3\u8fc7\u7a0b\uff0c\u76f4\u63a5\u67e5\u8868\u5f97\u5230\u5355\u8bcd\u7684\u8bcd\u5411\u91cf\u3002","title":"CBOW"},{"location":"llm/nlp/word2vec/#skip-gram","text":"Skip-Gram \u662f\u7ed9\u5b9a input word \u6765\u9884\u6d4b\u4e0a\u4e0b\u6587\uff0c\u5176\u6a21\u578b\u7ed3\u6784\u5982\u4e0a\u56fe\u6240\u793a\u3002\u5b83\u7684\u505a\u6cd5\u662f\uff0c\u5c06\u4e00\u4e2a\u8bcd\u6240\u5728\u7684\u4e0a\u4e0b\u6587\u4e2d\u7684\u8bcd\u4f5c\u4e3a\u8f93\u51fa\uff0c\u800c\u90a3\u4e2a\u8bcd\u672c\u8eab\u4f5c\u4e3a\u8f93\u5165\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u7ed9\u51fa\u4e00\u4e2a\u8bcd\uff0c\u5e0c\u671b\u9884\u6d4b\u53ef\u80fd\u51fa\u73b0\u7684\u4e0a\u4e0b\u6587\u7684\u8bcd\u3002\u901a\u8fc7\u5728\u4e00\u4e2a\u5927\u7684\u8bed\u6599\u5e93\u8bad\u7ec3\uff0c\u5f97\u5230\u4e00\u4e2a\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u6743\u91cd\u6a21\u578b\u3002\u201capple\u201d\u7684\u4e0a\u4e0b\u6587\u8bcd\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09.\u90a3\u4e48\u4ee5apple\u7684One-Hot\u8bcd\u5411\u91cf\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u5219\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09\u7684One-Hot\u8bcd\u5411\u91cf\u3002\u8bad\u7ec3\u5b8c\u6210\u540e\uff0c\u5c31\u5f97\u5230\u4e86\u6bcf\u4e2a\u8bcd\u5230\u9690\u542b\u5c42\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u7684\u6743\u91cd\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bcd\u7684\u5411\u91cf\uff08\u548cCBOW\u4e2d\u4e00\u6837\uff09\u3002 \u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u3002 \u9996\u5148\u9009\u53e5\u5b50\u4e2d\u95f4\u7684\u4e00\u4e2a\u8bcd\u4f5c\u4e3a\u8f93\u5165\u8bcd\uff0c\u6bd4\u5982\u9009\u53d6\u201capple\u201d\u4f5c\u4e3a input word\u3002 \u6709\u4e86 input word \u4ee5\u540e\uff0c\u518d\u5b9a\u4e49\u4e00\u4e2a\u53eb\u505a skip_window \u7684\u53c2\u6570\uff0c\u5b83\u4ee3\u8868\u7740\u4ece\u5f53\u524d input word \u7684\u4e00\u4fa7\uff08\u5de6\u8fb9\u6216\u53f3\u8fb9\uff09\u9009\u53d6\u8bcd\u7684\u6570\u91cf\u3002\u5982\u679c\u8bbe\u7f6e skip_window=2\uff0c\u90a3\u4e48\u6700\u7ec8\u83b7\u5f97\u7a97\u53e3\u4e2d\u7684\u8bcd\uff08\u5305\u62ec input word \u5728\u5185\uff09\u5c31\u662f[\u2018is\u2019,\u2019an\u2019,\u2019apple\u2019,\u2019on\u2019,\u2019the\u2019 ]\u3002skip_window=2\u4ee3\u8868\u7740\u9009\u53d6\u5de6input word\u5de6\u4fa72\u4e2a\u8bcd\u548c\u53f3\u4fa72\u4e2a\u8bcd\u8fdb\u5165\u6211\u4eec\u7684\u7a97\u53e3\uff0c\u6240\u4ee5\u6574\u4e2a\u7a97\u53e3\u5927\u5c0fspan=2x2=4\u3002\u53e6\u4e00\u4e2a\u53c2\u6570\u53ebnum_skips\uff0c\u5b83\u4ee3\u8868\u7740\u6211\u4eec\u4ece\u6574\u4e2a\u7a97\u53e3\u4e2d\u9009\u53d6\u591a\u5c11\u4e2a\u4e0d\u540c\u7684\u8bcd\u4f5c\u4e3a\u6211\u4eec\u7684output word\uff0c\u5f53skip_window=2\uff0cnum_skips=2\u65f6\uff0c\u6211\u4eec\u5c06\u4f1a\u5f97\u5230\u4e24\u7ec4 (input word, output word) \u5f62\u5f0f\u7684\u8bad\u7ec3\u6570\u636e\uff0c\u5373 ('apple', 'an')\uff0c('apple', 'one')\u3002 \u795e\u7ecf\u7f51\u7edc\u57fa\u4e8e\u8fd9\u4e9b\u8bad\u7ec3\u6570\u636e\u4e2d\u6bcf\u5bf9\u5355\u8bcd\u51fa\u73b0\u7684\u6b21\u6570\u4e60\u5f97\u7edf\u8ba1\u7ed3\u679c\uff0c\u5e76\u8f93\u51fa\u4e00\u4e2a\u6982\u7387\u5206\u5e03\uff0c\u8fd9\u4e2a\u6982\u7387\u5206\u5e03\u4ee3\u8868\u7740\u5230\u6211\u4eec\u8bcd\u5178\u4e2d\u6bcf\u4e2a\u8bcd\u6709\u591a\u5927\u53ef\u80fd\u6027\u8ddfinput word\u540c\u65f6\u51fa\u73b0\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u6211\u4eec\u5411\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u4e2d\u8f93\u5165\u4e00\u4e2a\u5355\u8bcd\u201c\u4e2d\u56fd\u201c\uff0c\u90a3\u4e48\u6700\u7ec8\u6a21\u578b\u7684\u8f93\u51fa\u6982\u7387\u4e2d\uff0c\u50cf\u201c\u82f1\u56fd\u201d\uff0c \u201d\u4fc4\u7f57\u65af\u201c\u8fd9\u79cd\u76f8\u5173\u8bcd\u7684\u6982\u7387\u5c06\u8fdc\u9ad8\u4e8e\u50cf\u201d\u82f9\u679c\u201c\uff0c\u201d\u8748\u8748\u201c\u975e\u76f8\u5173\u8bcd\u7684\u6982\u7387\u3002\u56e0\u4e3a\u201d\u82f1\u56fd\u201c\uff0c\u201d\u4fc4\u7f57\u65af\u201c\u5728\u6587\u672c\u4e2d\u66f4\u5927\u53ef\u80fd\u5728\u201d\u4e2d\u56fd\u201c\u7684\u7a97\u53e3\u4e2d\u51fa\u73b0\u3002\u6211\u4eec\u5c06\u901a\u8fc7\u7ed9\u795e\u7ecf\u7f51\u7edc\u8f93\u5165\u6587\u672c\u4e2d\u6210\u5bf9\u7684\u5355\u8bcd\u6765\u8bad\u7ec3\u5b83\u5b8c\u6210\u4e0a\u9762\u6240\u8bf4\u7684\u6982\u7387\u8ba1\u7b97\u3002 \u901a\u8fc7\u68af\u5ea6\u4e0b\u964d\u548c\u53cd\u5411\u4f20\u64ad\u66f4\u65b0\u77e9\u9635 W W \u4e2d\u7684\u884c\u5411\u91cf\u5373\u4e3a\u6bcf\u4e2a\u5355\u8bcd\u7684 Word embedding \u8868\u793a \u603b\u7ed3 CBOW \u548c Skip-gram \u6700\u7406\u60f3\u60c5\u51b5\u4e0b\u7684\u5b9e\u73b0\uff0c\u5373\u8bad\u7ec3\u8fed\u4ee3\u4e24\u4e2a\u77e9\u9635 \\(W\\) \u548c \\(W^\\prime\\) \uff0c\u4e4b\u540e\u518d\u8f93\u51fa\u5c42\u91c7\u7528 softmax \u51fd\u6570\u6765\u8ba1\u7b97\u8f93\u51fa\u5404\u4e2a\u8bcd\u7684\u6982\u7387\u3002\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u8fd9\u79cd\u65b9\u6cd5\u7684\u8bad\u7ec3\u5f00\u9500\u5f88\u5927\uff0c\u4e0d\u5177\u6709\u5f88\u5f3a\u7684\u5b9e\u7528\u6027\uff0c\u4e3a\u4e86\u4f7f\u5f97\u6a21\u578b\u4fbf\u4e8e\u8bad\u7ec3\uff0c\u6709\u5b66\u8005\u63d0\u51fa\u4e86 Hierarchical Softmax \u548c Negative Sampling \u4e24\u79cd\u6539\u8fdb\u65b9\u6cd5\u3002","title":"Skip-gram"},{"location":"llm/nlp/word2vec/#hierarchical-softmax","text":"Hierarchical Softmax \u5bf9\u539f\u6a21\u578b\u7684\u6539\u8fdb\u4e3b\u8981\u6709\u4e24\u70b9 \u7b2c\u4e00\u70b9\u662f\u4ece\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6620\u5c04\uff0c\u6ca1\u6709\u91c7\u7528\u539f\u5148\u7684\u4e0e\u77e9\u9635 W \u76f8\u4e58\u7136\u540e\u76f8\u52a0\u6c42\u5e73\u5747\u7684\u65b9\u6cd5\uff0c\u800c\u662f\u76f4\u63a5\u5bf9\u6240\u6709\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u6c42\u548c\u3002\u5047\u8bbe\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c0\uff09\u548c\uff080\uff0c0\uff0c0\uff0c1\uff09\uff0c\u90a3\u4e48\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c1\uff09\u3002 Hierarchical Softmax \u7684\u7b2c\u4e8c\u70b9\u6539\u8fdb\u662f\u91c7\u7528\u54c8\u592b\u66fc\u6811\u6765\u66ff\u6362\u4e86\u539f\u5148\u7684\u4ece\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u77e9\u9635 \\(W^\\prime\\) \u3002\u54c8\u592b\u66fc\u6811\u7684\u53f6\u8282\u70b9\u4e2a\u6570\u4e3a\u8bcd\u6c47\u8868\u7684\u5355\u8bcd\u4e2a\u6570 V\uff0c\u4e00\u4e2a\u53f6\u8282\u70b9\u4ee3\u8868\u4e00\u4e2a\u5355\u8bcd\uff0c\u800c\u4ece\u6839\u7ed3\u70b9\u5230\u53f6\u8282\u70b9\u7684\u8def\u5f84\u786e\u5b9a\u4e86\u8fd9\u4e2a\u5355\u8bcd\u6700\u7ec8\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002 \u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u68f5\u54c8\u592b\u66fc\u6811\u9664\u4e86\u6839\u8282\u70b9\u4ee5\u5916\u7684\u6240\u6709\u975e\u53f6\u8282\u70b9\u4e2d\u90fd\u542b\u6709\u4e00\u4e2a\u7531\u53c2\u6570 \\(\\theta\\) \u786e\u5b9a\u7684 sigmoid \u51fd\u6570\uff0c\u4e0d\u540c\u8282\u70b9\u7684 \\(\\theta\\) \u4e0d\u4e00\u6837\u3002\u8bad\u7ec3\u65f6\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e0e\u8fd9\u4e2a sigmoid \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97\uff0c\u6839\u636e\u7ed3\u679c\u8fdb\u884c\u5206\u7c7b\uff0c\u82e5\u5206\u7c7b\u4e3a\u8d1f\u7c7b\u5219\u6cbf\u5de6\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 0\uff1b\u82e5\u5206\u7c7b\u4e3a\u6b63\u7c7b\u5219\u6cbf\u53f3\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 1\u3002\u6700\u7ec8\u5230\u8fbe\u53f6\u8282\u70b9\uff0c\u53f6\u8282\u70b9\u7684\u5411\u91cf\u5373\u4e3a\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002","title":"Hierarchical Softmax"},{"location":"llm/nlp/word2vec/#negative-sampling","text":"\u5c3d\u7ba1\u54c8\u592b\u66fc\u6811\u7684\u5f15\u5165\u4e3a\u6a21\u578b\u7684\u8bad\u7ec3\u7f29\u77ed\u4e86\u8bb8\u591a\u5f00\u9500\uff0c\u4f46\u5bf9\u4e8e\u4e00\u4e9b\u4e0d\u5e38\u89c1\u3001\u8f83\u751f\u50fb\u7684\u8bcd\u6c47\uff0c\u54c8\u592b\u66fc\u6811\u5728\u8ba1\u7b97\u5b83\u4eec\u7684\u8bcd\u5411\u91cf\u65f6\u4ecd\u7136\u9700\u8981\u505a\u5927\u91cf\u7684\u8fd0\u7b97\u3002 \u8d1f\u91c7\u6837\u662f\u53e6\u4e00\u79cd\u63d0\u9ad8 Word2Vec \u6548\u7387\u7684\u65b9\u6cd5\uff0c\u5b83\u662f\u57fa\u4e8e\u8fd9\u6837\u7684\u89c2\u5bdf\uff1a\u8bad\u7ec3\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u610f\u5473\u7740\u4f7f\u7528\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u5c31\u8981\u7a0d\u5fae\u8c03\u6574\u4e00\u4e0b\u795e\u7ecf\u7f51\u7edc\u4e2d\u6240\u6709\u7684\u6743\u91cd\uff0c\u8fd9\u6837\u624d\u80fd\u786e\u4fdd\u9884\u6d4b\u8bad\u7ec3\u6837\u672c\u66f4\u52a0\u7cbe\u786e\uff0c\u5982\u679c\u80fd\u8bbe\u8ba1\u4e00\u79cd\u65b9\u6cd5\u6bcf\u6b21\u53ea\u66f4\u65b0\u4e00\u90e8\u5206\u6743\u91cd\uff0c\u90a3\u4e48\u8ba1\u7b97\u590d\u6742\u5ea6\u5c06\u5927\u5927\u964d\u4f4e\u3002 \u5c06\u4ee5\u4e0a\u89c2\u5bdf\u5f15\u5165 Word2Vec \u5c31\u662f\uff1a\u5f53\u901a\u8fc7\uff08\u201dfox\u201d, \u201cquick\u201d\uff09\u8bcd\u5bf9\u6765\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u65f6\uff0c\u6211\u4eec\u56de\u60f3\u8d77\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\u7684\u201c\u6807\u7b7e\u201d\u6216\u8005\u662f\u201c\u6b63\u786e\u7684\u8f93\u51fa\u201d\u662f\u4e00\u4e2aone-hot\u5411\u91cf\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5bf9\u4e8e\u795e\u7ecf\u7f51\u7edc\u4e2d\u5bf9\u5e94\u4e8e\u201dquick\u201d\u8fd9\u4e2a\u5355\u8bcd\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u4e3a1\uff0c\u800c\u5176\u4ed6\u4e0a\u5343\u4e2a\u7684\u8f93\u51fa\u795e\u7ecf\u5143\u5219\u5bf9\u5e94\u4e3a0\u3002\u4f7f\u7528\u8d1f\u91c7\u6837\uff0c\u6211\u4eec\u901a\u8fc7\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u8f83\u5c11\u6570\u76ee\uff08\u6bd4\u5982\u8bf45\u4e2a\uff09\u7684\u201c\u8d1f\u201d\u6837\u672c\u6765\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\u3002\uff08\u5728\u8fd9\u4e2a\u6761\u4ef6\u4e0b\uff0c\u201c\u8d1f\u201d\u5355\u8bcd\u5c31\u662f\u6211\u4eec\u5e0c\u671b\u795e\u7ecf\u7f51\u7edc\u8f93\u51fa\u4e3a0\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u7684\u5355\u8bcd\uff09\u3002\u5e76\u4e14\u6211\u4eec\u4ecd\u7136\u4e3a\u6211\u4eec\u7684\u201c\u6b63\u201d\u5355\u8bcd\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\uff08\u4e5f\u5c31\u662f\u5f53\u524d\u6837\u672c\u4e0b\u201dquick\u201d\u5bf9\u5e94\u7684\u795e\u7ecf\u5143\u4ecd\u7136\u8f93\u51fa\u4e3a1\uff09\u3002","title":"Negative Sampling"},{"location":"llm/nlp/word2vec/#reference","text":"Word2Vec\u8be6\u89e3 \u6df1\u5165\u6d45\u51faWord2Vec\u539f\u7406\u89e3\u6790 NLP\u4e4b\u2014\u2014Word2Vec\u8be6\u89e3","title":"Reference"},{"location":"llm/others/dt/","text":"\u5206\u5e03\u5f0f\u8bad\u7ec3 \u00b6 \u7ea6 1632 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u4ecb\u7ecd\u4e86\u5206\u5e03\u5f0f\u8bad\u7ec3\u7684\u80cc\u666f\u548c\u5e38\u89c1\u7684 4 \u79cd\u5e76\u884c\u7b56\u7565 learn from OneFlow/docs \u4e3a\u4ec0\u4e48\u5206\u5e03\u5f0f\u8bad\u7ec3\u8d8a\u6765\u8d8a\u6d41\u884c \u00b6 \u8fd1\u5e74\u6765\uff0c\u6df1\u5ea6\u5b66\u4e60\u88ab\u5e7f\u6cdb\u5e94\u7528\u5230\u5404\u4e2a\u9886\u57df\uff0c\u5305\u62ec\u8ba1\u7b97\u673a\u89c6\u89c9\u3001\u8bed\u8a00\u7406\u89e3\u3001\u8bed\u97f3\u8bc6\u522b\u3001\u5e7f\u544a\u63a8\u8350\u7b49\u3002\u5728\u8fd9\u4e9b\u4e0d\u540c\u7684\u9886\u57df\u4e2d\uff0c\u4e00\u4e2a\u5171\u540c\u7684\u7279\u70b9\u5c31\u662f\u6a21\u578b\u89c4\u6a21\u8d8a\u6765\u8d8a\u5927\uff0c\u6bd4\u5982 GPT-3 \u6a21\u578b\u7684\u53c2\u6570\u91cf\u8fbe\u52301750\u4ebf\u3002\u5373\u4f7f\u75281024\u5f20 80 GB \u7684 A100\uff0c\u90a3\u4e48\u5b8c\u6574\u8bad\u7ec3 GPT-3 \u7684\u65f6\u957f\u90fd\u9700\u89811\u4e2a\u6708\u3002 \u6a21\u578b\u89c4\u6a21\u7684\u6269\u5927\uff0c\u5bf9\u786c\u4ef6\uff08\u7b97\u529b\u3001\u5185\u5b58\uff09\u7684\u53d1\u5c55\u63d0\u51fa\u8981\u6c42\u3002\u7136\u800c\uff0c\u56e0\u4e3a \u5185\u5b58\u5899 \u7684\u5b58\u5728\uff0c\u5355\u4e00\u8bbe\u5907\u7684\u7b97\u529b\u53ca\u5bb9\u91cf\uff0c\u53d7\u9650\u4e8e\u7269\u7406\u5b9a\u5f8b\uff0c\u6301\u7eed\u63d0\u9ad8\u82af\u7247\u7684\u96c6\u6210\u8d8a\u6765\u8d8a\u56f0\u96be\uff0c\u96be\u4ee5\u8ddf\u4e0a\u6a21\u578b\u6269\u5927\u7684\u9700\u6c42\u3002 \u4e3a\u4e86\u89e3\u51b3\u7b97\u529b\u589e\u901f\u4e0d\u8db3\u7684\u95ee\u9898\uff0c\u4eba\u4eec\u8003\u8651\u7528\u591a\u8282\u70b9\u96c6\u7fa4\u8fdb\u884c\u5206\u5e03\u5f0f\u8bad\u7ec3\uff0c\u4ee5\u63d0\u5347\u7b97\u529b\uff0c\u5206\u5e03\u5f0f\u8bad\u7ec3\u52bf\u5728\u5fc5\u884c\u3002 \u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565 \u00b6 \u7b80\u5355\u7684\u673a\u5668\u5806\u53e0\u5e76\u4e0d\u4e00\u5b9a\u4f1a\u5e26\u6765\u7b97\u529b\u7684\u589e\u957f\u3002\u56e0\u4e3a\u795e\u7ecf\u7f51\u7edc\u7684\u8bad\u7ec3\u5e76\u4e0d\u662f\u5355\u7eaf\u7684\u201c\u628a\u539f\u6765\u4e00\u4e2a\u8bbe\u5907\u505a\u7684\u4e8b\u60c5\uff0c\u73b0\u5728\u5206\u7ed9\u591a\u4e2a\u8bbe\u5907\u5404\u81ea\u505a\u201d\uff0c\u5b83\u4e0d\u4ec5\u9700\u8981\u591a\u4e2a\u8bbe\u5907\u8fdb\u884c\u8ba1\u7b97\uff0c\u8fd8\u6d89\u53ca\u5230\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u53ea\u6709\u534f\u8c03\u597d\u96c6\u7fa4\u4e2d\u7684\u8ba1\u7b97\u4e0e\u901a\u4fe1\uff0c\u624d\u80fd\u505a\u9ad8\u6548\u7684\u5206\u5e03\u5f0f\u8bad\u7ec3\u3002 \u6211\u4eec\u5c06\u4ee5\u77e9\u9635\u4e58\u6cd5\u7684\u4f8b\u5b50\uff0c\u89e3\u91ca\u6570\u636e\u5e76\u884c\u3001\u6a21\u578b\u5e76\u884c\u7684\u533a\u522b\u3002 \u5148\u4e86\u89e3\u4ee5\u4e0b\u903b\u8f91\u4e0a\u7684\u77e9\u9635\u4e58\u6cd5\u4f8b\u5b50: \u5047\u8bbe\u795e\u7ecf\u7f51\u7edc\u4e2d\u67d0\u4e00\u5c42\u662f\u505a\u77e9\u9635\u4e58\u6cd5\uff0c\u5176\u4e2d\u7684\u8f93\u5165 \\(x\\) \u7684\u5f62\u72b6\u4e3a \\(4\\times5\\) \uff0c\u6a21\u578b\u53c2\u6570 \\(w\\) \u7684\u5f62\u72b6\u4e3a \\(5\\times8\\) \uff0c\u90a3\u4e48\uff0c\u77e9\u9635\u4e58\u6cd5\u8f93\u51fa\u5f62\u72b6\u4e3a \\(4\\times8\\) \u3002\u793a\u610f\u56fe\u5982\u4e0b\uff1a \u5355\u673a\u5355\u5361\u7684\u8bad\u7ec3\u4e2d\uff0c\u4ee5\u4e0a\u77e9\u9635\u4e58\u6cd5\uff0c\u5148\u8ba1\u7b97\u5f97\u5230 \\(out\\) \uff0c\u5e76\u5c06 \\(out\\) \u4f20\u9012\u7ed9\u4e0b\u4e00\u5c42\uff0c\u5e76\u6700\u7ec8\u8ba1\u7b97\u5f97\u5230 \\(loss\\) \uff0c\u7136\u540e\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u5f97\u5230 \\(\\frac{\\partial loss}{\\partial w}\\) \uff0c\u7528\u4e8e\u66f4\u65b0 \\(w\\) \u3002 \u5206\u5e03\u5f0f\u8bad\u7ec3\u4e2d\uff0c\u4f9d\u636e\u662f\u5207\u5206 \\(x\\) \u8fd8\u662f \\(w\\) \u7684\u4e0d\u540c\uff0c\u5206\u4e3a\u201c\u6570\u636e\u5e76\u884c\u201d\u548c\u201c\u6a21\u578b\u5e76\u884c\u201d\u7b56\u7565\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4ecb\u7ecd\u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565\u3002 \u6570\u636e\u5e76\u884c \u00b6 \u6240\u8c13\u7684\u6570\u636e\u5e76\u884c\uff0c\u5c31\u662f\u5c06\u6570\u636e \\(x\\) \u8fdb\u884c\u5207\u5206\uff0c\u800c\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b \\(w\\) \u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(x\\) \u88ab\u6309\u7167\u7b2c0\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(w\\) \u3002 \u8fd9\u6837\uff0c\u5728\u4e24\u53f0\u8bbe\u5907\u4e0a\uff0c\u5206\u522b\u5f97\u5230\u7684\u8f93\u51fa\uff0c\u90fd\u53ea\u662f\u903b\u8f91\u4e0a\u8f93\u51fa\u7684\u4e00\u534a\uff08\u5f62\u72b6\u4e3a \\(2\\times8\\) \uff09\uff0c\u5c06\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u62fc\u63a5\u5230\u4e00\u8d77\uff0c\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u5b8c\u6574\u7684\u8f93\u51fa\u3002 \u6ce8\u610f\uff0c\u56e0\u4e3a\u6570\u636e\u88ab\u5206\u53d1\u5230\u4e862\u4e2a\u8bbe\u5907\u4e0a\uff0c\u56e0\u6b64\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\uff0c\u5404\u81ea\u8bbe\u5907\u4e0a\u5f97\u5230\u7684 \\(\\frac{\\partial loss}{\\partial w}\\) \u4f1a\u4e0d\u4e00\u6837\uff0c\u5982\u679c\u76f4\u63a5\u4f7f\u7528\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u66f4\u65b0\u5404\u81ea\u7684\u6a21\u578b\uff0c\u4f1a\u9020\u62102\u4e2a\u8bbe\u5907\u4e0a\u7684 \u6a21\u578b\u4e0d\u4e00\u81f4 \uff0c\u8bad\u7ec3\u5c31\u5931\u53bb\u4e86\u610f\u4e49\uff08\u5230\u5e95\u7528\u54ea\u4e2a\u6a21\u578b\u597d\u5462\uff1f\uff09\u3002 \u56e0\u6b64\uff0c\u6570\u636e\u5e76\u884c\u7b56\u7565\u4e0b\uff0c\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u5bf9\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u8fdb\u884c AllReduce \uff0c\u4ee5\u786e\u4fdd\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u59cb\u7ec8\u4fdd\u6301\u4e00\u81f4\u3002 \u5f53\u6570\u636e\u96c6\u8f83\u5927\uff0c\u6a21\u578b\u8f83\u5c0f\u65f6\uff0c\u7531\u4e8e\u53cd\u5411\u8fc7\u7a0b\u4e2d\u4e3a\u540c\u6b65\u68af\u5ea6\u4ea7\u751f\u7684\u901a\u4fe1\u4ee3\u4ef7\u8f83\u5c0f\uff0c\u6b64\u65f6\u9009\u62e9\u6570\u636e\u5e76\u884c\u4e00\u822c\u6bd4\u8f83\u6709\u4f18\u52bf\uff0c\u5e38\u89c1\u7684\u89c6\u89c9\u5206\u7c7b\u6a21\u578b\uff0c\u5982 ResNet50\uff0c\u6bd4\u8f83\u9002\u5408\u91c7\u7528\u6570\u636e\u5e76\u884c\u3002 \u6a21\u578b\u5e76\u884c \u00b6 \u5f53\u795e\u7ecf\u7f51\u7edc\u975e\u5e38\u5de8\u5927\uff0c\u6570\u636e\u5e76\u884c\u540c\u6b65\u68af\u5ea6\u7684\u4ee3\u4ef7\u5c31\u4f1a\u5f88\u5927\uff0c\u751a\u81f3\u7f51\u7edc\u53ef\u80fd\u5de8\u5927\u5230\u65e0\u6cd5\u5b58\u653e\u5230\u5355\u4e00\u8ba1\u7b97\u8bbe\u5907\u4e2d\uff0c\u8fd9\u65f6\u5019\uff0c\u53ef\u4ee5\u91c7\u7528\u6a21\u578b\u5e76\u884c\u7b56\u7565\u89e3\u51b3\u95ee\u9898\u3002 \u6240\u8c13\u7684\u6a21\u578b\u5e76\u884c\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6570\u636e\u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\uff0c\u800c\u6a21\u578b \\(w\\) \u88ab\u5207\u5206\u5230\u4e86\u5404\u4e2a\u8bbe\u5907\u4e0a\uff0c\u6bcf\u4e2a\u8bbe\u5907\u53ea\u62e5\u6709\u6a21\u578b\u7684\u4e00\u90e8\u5206\uff0c\u6240\u6709\u8ba1\u7b97\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u62fc\u5728\u4e00\u8d77\uff0c\u624d\u662f\u5b8c\u6574\u7684\u6a21\u578b\u3002 \u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(w\\) \u88ab\u6309\u7167\u7b2c1\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(x\\) \u3002\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u4e5f\u9700\u8981\u901a\u8fc7\u62fc\u63a5\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u7684\u8f93\u51fa\u3002 \u6a21\u578b\u5e76\u884c\u7684\u597d\u5904\u662f\uff0c\u7701\u53bb\u4e86\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u7684\u68af\u5ea6 AllReduce\uff1b\u4f46\u662f\uff0c\u7531\u4e8e\u6bcf\u4e2a\u8bbe\u5907\u90fd\u9700\u8981\u5b8c\u6574\u7684\u6570\u636e\u8f93\u5165\uff0c\u56e0\u6b64\uff0c\u6570\u636e\u4f1a\u5728\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u8fdb\u884c\u5e7f\u64ad\uff0c\u4ea7\u751f\u901a\u4fe1\u4ee3\u4ef7\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u7684\u6700\u7ec8\u5f97\u5230\u7684 \\(out~(4\\times8)\\) \uff0c\u5982\u679c\u5b83\u4f5c\u4e3a\u4e0b\u4e00\u5c42\u7f51\u7edc\u7684\u8f93\u5165\uff0c\u90a3\u4e48\u5b83\u5c31\u9700\u8981\u88ab\u5e7f\u64ad\u53d1\u9001\u5230\u4e24\u4e2a\u8bbe\u5907\u4e0a\u3002 \u8bed\u8a00\u6a21\u578b\uff0c\u5982 BERT\uff0c\u5e38\u91c7\u7528\u6a21\u578b\u5e76\u884c\u3002 \u6d41\u6c34\u5e76\u884c \u00b6 \u5f53\u795e\u7ecf\u7f51\u7edc\u8fc7\u4e8e\u5de8\u5927\uff0c\u65e0\u6cd5\u5728\u4e00\u4e2a\u8bbe\u5907\u4e0a\u5b58\u653e\u65f6\uff0c\u9664\u4e86\u4e0a\u8ff0\u7684\u6a21\u578b\u5e76\u884c\u7684\u7b56\u7565\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u6d41\u6c34\u5e76\u884c\u3002 \u6d41\u6c34\u5e76\u884c\u6307\u5c06\u7f51\u7edc\u5207\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u5e76\u5206\u53d1\u5230\u4e0d\u540c\u7684\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5404\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e4b\u95f4\u4ee5\u201c\u63a5\u529b\u201d\u7684\u65b9\u5f0f\u5b8c\u6210\u8bad\u7ec3\u3002 \u5982\u4e0b\u56fe\uff0c\u5c55\u793a\u4e86\u4e00\u4e2a\u903b\u8f91\u4e0a\u76844\u5c42\u7f51\u7edc\uff08 T1 \u81f3 T4 )\u662f\u5982\u4f55\u505a\u6d41\u6c34\u5e76\u884c\u7684\u3002 4\u5c42\u7f51\u7edc\u88ab\u5207\u5206\u52302\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5176\u4e2d GPU0 \u4e0a\u8fdb\u884c T1 \u4e0e T2 \u7684\u8fd0\u7b97\uff0c GPU1 \u4e0a\u8fdb\u884c T3 \u4e0e T4 \u7684\u8ba1\u7b97\u3002 GPU0 \u4e0a\u5b8c\u6210\u524d\u4e24\u5c42\u7684\u8ba1\u7b97\u540e\uff0c\u5b83\u7684\u8f93\u51fa\u88ab\u5f53\u4f5c GPU1 \u7684\u8f93\u5165\uff0c\u7ee7\u7eed\u8fdb\u884c\u540e\u4e24\u5c42\u7684\u8ba1\u7b97\u3002 \u6df7\u5408\u5e76\u884c \u00b6 \u7f51\u7edc\u7684\u8bad\u7ec3\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5c06\u591a\u79cd\u5e76\u884c\u7b56\u7565\u6df7\u7528\uff0c\u4ee5 GPT-3 \u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5b83\u8bad\u7ec3\u65f6\u7684\u8bbe\u5907\u5e76\u884c\u65b9\u6848\uff1a \u5b83\u9996\u5148\u88ab\u5206\u4e3a 64 \u4e2a\u9636\u6bb5\uff0c\u8fdb\u884c\u6d41\u6c34\u5e76\u884c\u3002\u6bcf\u4e2a\u9636\u6bb5\u90fd\u8fd0\u884c\u5728 6 \u53f0 DGX-A100 \u4e3b\u673a\u4e0a\u3002\u57286\u53f0\u4e3b\u673a\u4e4b\u95f4\uff0c\u8fdb\u884c\u7684\u662f\u6570\u636e\u5e76\u884c\u8bad\u7ec3\uff1b\u6bcf\u53f0\u4e3b\u673a\u6709 8 \u5f20 GPU \u663e\u5361\uff0c\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u76848\u5f20 GPU \u663e\u5361\u4e4b\u95f4\u662f\u8fdb\u884c\u6a21\u578b\u5e76\u884c\u8bad\u7ec3\u3002 \u5e76\u884c\u7b56\u7565\u7684\u9009\u62e9\u5f71\u54cd\u7740\u8bad\u7ec3\u6548\u7387\uff0c\u6846\u67b6\u5bf9\u5e76\u884c\u8bad\u7ec3\u7684\u63a5\u53e3\u652f\u6301\u7a0b\u5ea6\uff0c\u51b3\u5b9a\u4e86\u7b97\u6cd5\u5de5\u7a0b\u5e08\u7684\u5f00\u53d1\u6548\u7387\u3002OneFlow \u9488\u5bf9\u5206\u5e03\u5f0f\u8bad\u7ec3\u6240\u505a\u7684\u7cfb\u7edf\u7ea7\u8bbe\u8ba1\u548c\u521b\u65b0\uff0c\u4e3a\u7528\u6237\u8f7b\u677e\u4e0a\u624b\u5206\u5e03\u5f0f\u8bad\u7ec3\u505a\u8db3\u4e86\u94fa\u57ab\u3002\u6211\u4eec\u5c06\u5728\u672c\u4e13\u9898\u7684\u5176\u5b83\u6587\u7ae0\u4e2d\u770b\u5230\u76f8\u5173\u793a\u4f8b\u3002","title":"\u5206\u5e03\u5f0f\u8bad\u7ec3"},{"location":"llm/others/dt/#_1","text":"\u7ea6 1632 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u4ecb\u7ecd\u4e86\u5206\u5e03\u5f0f\u8bad\u7ec3\u7684\u80cc\u666f\u548c\u5e38\u89c1\u7684 4 \u79cd\u5e76\u884c\u7b56\u7565 learn from OneFlow/docs","title":"\u5206\u5e03\u5f0f\u8bad\u7ec3"},{"location":"llm/others/dt/#_2","text":"\u8fd1\u5e74\u6765\uff0c\u6df1\u5ea6\u5b66\u4e60\u88ab\u5e7f\u6cdb\u5e94\u7528\u5230\u5404\u4e2a\u9886\u57df\uff0c\u5305\u62ec\u8ba1\u7b97\u673a\u89c6\u89c9\u3001\u8bed\u8a00\u7406\u89e3\u3001\u8bed\u97f3\u8bc6\u522b\u3001\u5e7f\u544a\u63a8\u8350\u7b49\u3002\u5728\u8fd9\u4e9b\u4e0d\u540c\u7684\u9886\u57df\u4e2d\uff0c\u4e00\u4e2a\u5171\u540c\u7684\u7279\u70b9\u5c31\u662f\u6a21\u578b\u89c4\u6a21\u8d8a\u6765\u8d8a\u5927\uff0c\u6bd4\u5982 GPT-3 \u6a21\u578b\u7684\u53c2\u6570\u91cf\u8fbe\u52301750\u4ebf\u3002\u5373\u4f7f\u75281024\u5f20 80 GB \u7684 A100\uff0c\u90a3\u4e48\u5b8c\u6574\u8bad\u7ec3 GPT-3 \u7684\u65f6\u957f\u90fd\u9700\u89811\u4e2a\u6708\u3002 \u6a21\u578b\u89c4\u6a21\u7684\u6269\u5927\uff0c\u5bf9\u786c\u4ef6\uff08\u7b97\u529b\u3001\u5185\u5b58\uff09\u7684\u53d1\u5c55\u63d0\u51fa\u8981\u6c42\u3002\u7136\u800c\uff0c\u56e0\u4e3a \u5185\u5b58\u5899 \u7684\u5b58\u5728\uff0c\u5355\u4e00\u8bbe\u5907\u7684\u7b97\u529b\u53ca\u5bb9\u91cf\uff0c\u53d7\u9650\u4e8e\u7269\u7406\u5b9a\u5f8b\uff0c\u6301\u7eed\u63d0\u9ad8\u82af\u7247\u7684\u96c6\u6210\u8d8a\u6765\u8d8a\u56f0\u96be\uff0c\u96be\u4ee5\u8ddf\u4e0a\u6a21\u578b\u6269\u5927\u7684\u9700\u6c42\u3002 \u4e3a\u4e86\u89e3\u51b3\u7b97\u529b\u589e\u901f\u4e0d\u8db3\u7684\u95ee\u9898\uff0c\u4eba\u4eec\u8003\u8651\u7528\u591a\u8282\u70b9\u96c6\u7fa4\u8fdb\u884c\u5206\u5e03\u5f0f\u8bad\u7ec3\uff0c\u4ee5\u63d0\u5347\u7b97\u529b\uff0c\u5206\u5e03\u5f0f\u8bad\u7ec3\u52bf\u5728\u5fc5\u884c\u3002","title":"\u4e3a\u4ec0\u4e48\u5206\u5e03\u5f0f\u8bad\u7ec3\u8d8a\u6765\u8d8a\u6d41\u884c"},{"location":"llm/others/dt/#_3","text":"\u7b80\u5355\u7684\u673a\u5668\u5806\u53e0\u5e76\u4e0d\u4e00\u5b9a\u4f1a\u5e26\u6765\u7b97\u529b\u7684\u589e\u957f\u3002\u56e0\u4e3a\u795e\u7ecf\u7f51\u7edc\u7684\u8bad\u7ec3\u5e76\u4e0d\u662f\u5355\u7eaf\u7684\u201c\u628a\u539f\u6765\u4e00\u4e2a\u8bbe\u5907\u505a\u7684\u4e8b\u60c5\uff0c\u73b0\u5728\u5206\u7ed9\u591a\u4e2a\u8bbe\u5907\u5404\u81ea\u505a\u201d\uff0c\u5b83\u4e0d\u4ec5\u9700\u8981\u591a\u4e2a\u8bbe\u5907\u8fdb\u884c\u8ba1\u7b97\uff0c\u8fd8\u6d89\u53ca\u5230\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u53ea\u6709\u534f\u8c03\u597d\u96c6\u7fa4\u4e2d\u7684\u8ba1\u7b97\u4e0e\u901a\u4fe1\uff0c\u624d\u80fd\u505a\u9ad8\u6548\u7684\u5206\u5e03\u5f0f\u8bad\u7ec3\u3002 \u6211\u4eec\u5c06\u4ee5\u77e9\u9635\u4e58\u6cd5\u7684\u4f8b\u5b50\uff0c\u89e3\u91ca\u6570\u636e\u5e76\u884c\u3001\u6a21\u578b\u5e76\u884c\u7684\u533a\u522b\u3002 \u5148\u4e86\u89e3\u4ee5\u4e0b\u903b\u8f91\u4e0a\u7684\u77e9\u9635\u4e58\u6cd5\u4f8b\u5b50: \u5047\u8bbe\u795e\u7ecf\u7f51\u7edc\u4e2d\u67d0\u4e00\u5c42\u662f\u505a\u77e9\u9635\u4e58\u6cd5\uff0c\u5176\u4e2d\u7684\u8f93\u5165 \\(x\\) \u7684\u5f62\u72b6\u4e3a \\(4\\times5\\) \uff0c\u6a21\u578b\u53c2\u6570 \\(w\\) \u7684\u5f62\u72b6\u4e3a \\(5\\times8\\) \uff0c\u90a3\u4e48\uff0c\u77e9\u9635\u4e58\u6cd5\u8f93\u51fa\u5f62\u72b6\u4e3a \\(4\\times8\\) \u3002\u793a\u610f\u56fe\u5982\u4e0b\uff1a \u5355\u673a\u5355\u5361\u7684\u8bad\u7ec3\u4e2d\uff0c\u4ee5\u4e0a\u77e9\u9635\u4e58\u6cd5\uff0c\u5148\u8ba1\u7b97\u5f97\u5230 \\(out\\) \uff0c\u5e76\u5c06 \\(out\\) \u4f20\u9012\u7ed9\u4e0b\u4e00\u5c42\uff0c\u5e76\u6700\u7ec8\u8ba1\u7b97\u5f97\u5230 \\(loss\\) \uff0c\u7136\u540e\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u5f97\u5230 \\(\\frac{\\partial loss}{\\partial w}\\) \uff0c\u7528\u4e8e\u66f4\u65b0 \\(w\\) \u3002 \u5206\u5e03\u5f0f\u8bad\u7ec3\u4e2d\uff0c\u4f9d\u636e\u662f\u5207\u5206 \\(x\\) \u8fd8\u662f \\(w\\) \u7684\u4e0d\u540c\uff0c\u5206\u4e3a\u201c\u6570\u636e\u5e76\u884c\u201d\u548c\u201c\u6a21\u578b\u5e76\u884c\u201d\u7b56\u7565\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4ecb\u7ecd\u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565\u3002","title":"\u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565"},{"location":"llm/others/dt/#_4","text":"\u6240\u8c13\u7684\u6570\u636e\u5e76\u884c\uff0c\u5c31\u662f\u5c06\u6570\u636e \\(x\\) \u8fdb\u884c\u5207\u5206\uff0c\u800c\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b \\(w\\) \u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(x\\) \u88ab\u6309\u7167\u7b2c0\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(w\\) \u3002 \u8fd9\u6837\uff0c\u5728\u4e24\u53f0\u8bbe\u5907\u4e0a\uff0c\u5206\u522b\u5f97\u5230\u7684\u8f93\u51fa\uff0c\u90fd\u53ea\u662f\u903b\u8f91\u4e0a\u8f93\u51fa\u7684\u4e00\u534a\uff08\u5f62\u72b6\u4e3a \\(2\\times8\\) \uff09\uff0c\u5c06\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u62fc\u63a5\u5230\u4e00\u8d77\uff0c\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u5b8c\u6574\u7684\u8f93\u51fa\u3002 \u6ce8\u610f\uff0c\u56e0\u4e3a\u6570\u636e\u88ab\u5206\u53d1\u5230\u4e862\u4e2a\u8bbe\u5907\u4e0a\uff0c\u56e0\u6b64\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\uff0c\u5404\u81ea\u8bbe\u5907\u4e0a\u5f97\u5230\u7684 \\(\\frac{\\partial loss}{\\partial w}\\) \u4f1a\u4e0d\u4e00\u6837\uff0c\u5982\u679c\u76f4\u63a5\u4f7f\u7528\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u66f4\u65b0\u5404\u81ea\u7684\u6a21\u578b\uff0c\u4f1a\u9020\u62102\u4e2a\u8bbe\u5907\u4e0a\u7684 \u6a21\u578b\u4e0d\u4e00\u81f4 \uff0c\u8bad\u7ec3\u5c31\u5931\u53bb\u4e86\u610f\u4e49\uff08\u5230\u5e95\u7528\u54ea\u4e2a\u6a21\u578b\u597d\u5462\uff1f\uff09\u3002 \u56e0\u6b64\uff0c\u6570\u636e\u5e76\u884c\u7b56\u7565\u4e0b\uff0c\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u5bf9\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u8fdb\u884c AllReduce \uff0c\u4ee5\u786e\u4fdd\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u59cb\u7ec8\u4fdd\u6301\u4e00\u81f4\u3002 \u5f53\u6570\u636e\u96c6\u8f83\u5927\uff0c\u6a21\u578b\u8f83\u5c0f\u65f6\uff0c\u7531\u4e8e\u53cd\u5411\u8fc7\u7a0b\u4e2d\u4e3a\u540c\u6b65\u68af\u5ea6\u4ea7\u751f\u7684\u901a\u4fe1\u4ee3\u4ef7\u8f83\u5c0f\uff0c\u6b64\u65f6\u9009\u62e9\u6570\u636e\u5e76\u884c\u4e00\u822c\u6bd4\u8f83\u6709\u4f18\u52bf\uff0c\u5e38\u89c1\u7684\u89c6\u89c9\u5206\u7c7b\u6a21\u578b\uff0c\u5982 ResNet50\uff0c\u6bd4\u8f83\u9002\u5408\u91c7\u7528\u6570\u636e\u5e76\u884c\u3002","title":"\u6570\u636e\u5e76\u884c"},{"location":"llm/others/dt/#_5","text":"\u5f53\u795e\u7ecf\u7f51\u7edc\u975e\u5e38\u5de8\u5927\uff0c\u6570\u636e\u5e76\u884c\u540c\u6b65\u68af\u5ea6\u7684\u4ee3\u4ef7\u5c31\u4f1a\u5f88\u5927\uff0c\u751a\u81f3\u7f51\u7edc\u53ef\u80fd\u5de8\u5927\u5230\u65e0\u6cd5\u5b58\u653e\u5230\u5355\u4e00\u8ba1\u7b97\u8bbe\u5907\u4e2d\uff0c\u8fd9\u65f6\u5019\uff0c\u53ef\u4ee5\u91c7\u7528\u6a21\u578b\u5e76\u884c\u7b56\u7565\u89e3\u51b3\u95ee\u9898\u3002 \u6240\u8c13\u7684\u6a21\u578b\u5e76\u884c\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6570\u636e\u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\uff0c\u800c\u6a21\u578b \\(w\\) \u88ab\u5207\u5206\u5230\u4e86\u5404\u4e2a\u8bbe\u5907\u4e0a\uff0c\u6bcf\u4e2a\u8bbe\u5907\u53ea\u62e5\u6709\u6a21\u578b\u7684\u4e00\u90e8\u5206\uff0c\u6240\u6709\u8ba1\u7b97\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u62fc\u5728\u4e00\u8d77\uff0c\u624d\u662f\u5b8c\u6574\u7684\u6a21\u578b\u3002 \u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(w\\) \u88ab\u6309\u7167\u7b2c1\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(x\\) \u3002\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u4e5f\u9700\u8981\u901a\u8fc7\u62fc\u63a5\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u7684\u8f93\u51fa\u3002 \u6a21\u578b\u5e76\u884c\u7684\u597d\u5904\u662f\uff0c\u7701\u53bb\u4e86\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u7684\u68af\u5ea6 AllReduce\uff1b\u4f46\u662f\uff0c\u7531\u4e8e\u6bcf\u4e2a\u8bbe\u5907\u90fd\u9700\u8981\u5b8c\u6574\u7684\u6570\u636e\u8f93\u5165\uff0c\u56e0\u6b64\uff0c\u6570\u636e\u4f1a\u5728\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u8fdb\u884c\u5e7f\u64ad\uff0c\u4ea7\u751f\u901a\u4fe1\u4ee3\u4ef7\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u7684\u6700\u7ec8\u5f97\u5230\u7684 \\(out~(4\\times8)\\) \uff0c\u5982\u679c\u5b83\u4f5c\u4e3a\u4e0b\u4e00\u5c42\u7f51\u7edc\u7684\u8f93\u5165\uff0c\u90a3\u4e48\u5b83\u5c31\u9700\u8981\u88ab\u5e7f\u64ad\u53d1\u9001\u5230\u4e24\u4e2a\u8bbe\u5907\u4e0a\u3002 \u8bed\u8a00\u6a21\u578b\uff0c\u5982 BERT\uff0c\u5e38\u91c7\u7528\u6a21\u578b\u5e76\u884c\u3002","title":"\u6a21\u578b\u5e76\u884c"},{"location":"llm/others/dt/#_6","text":"\u5f53\u795e\u7ecf\u7f51\u7edc\u8fc7\u4e8e\u5de8\u5927\uff0c\u65e0\u6cd5\u5728\u4e00\u4e2a\u8bbe\u5907\u4e0a\u5b58\u653e\u65f6\uff0c\u9664\u4e86\u4e0a\u8ff0\u7684\u6a21\u578b\u5e76\u884c\u7684\u7b56\u7565\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u6d41\u6c34\u5e76\u884c\u3002 \u6d41\u6c34\u5e76\u884c\u6307\u5c06\u7f51\u7edc\u5207\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u5e76\u5206\u53d1\u5230\u4e0d\u540c\u7684\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5404\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e4b\u95f4\u4ee5\u201c\u63a5\u529b\u201d\u7684\u65b9\u5f0f\u5b8c\u6210\u8bad\u7ec3\u3002 \u5982\u4e0b\u56fe\uff0c\u5c55\u793a\u4e86\u4e00\u4e2a\u903b\u8f91\u4e0a\u76844\u5c42\u7f51\u7edc\uff08 T1 \u81f3 T4 )\u662f\u5982\u4f55\u505a\u6d41\u6c34\u5e76\u884c\u7684\u3002 4\u5c42\u7f51\u7edc\u88ab\u5207\u5206\u52302\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5176\u4e2d GPU0 \u4e0a\u8fdb\u884c T1 \u4e0e T2 \u7684\u8fd0\u7b97\uff0c GPU1 \u4e0a\u8fdb\u884c T3 \u4e0e T4 \u7684\u8ba1\u7b97\u3002 GPU0 \u4e0a\u5b8c\u6210\u524d\u4e24\u5c42\u7684\u8ba1\u7b97\u540e\uff0c\u5b83\u7684\u8f93\u51fa\u88ab\u5f53\u4f5c GPU1 \u7684\u8f93\u5165\uff0c\u7ee7\u7eed\u8fdb\u884c\u540e\u4e24\u5c42\u7684\u8ba1\u7b97\u3002","title":"\u6d41\u6c34\u5e76\u884c"},{"location":"llm/others/dt/#_7","text":"\u7f51\u7edc\u7684\u8bad\u7ec3\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5c06\u591a\u79cd\u5e76\u884c\u7b56\u7565\u6df7\u7528\uff0c\u4ee5 GPT-3 \u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5b83\u8bad\u7ec3\u65f6\u7684\u8bbe\u5907\u5e76\u884c\u65b9\u6848\uff1a \u5b83\u9996\u5148\u88ab\u5206\u4e3a 64 \u4e2a\u9636\u6bb5\uff0c\u8fdb\u884c\u6d41\u6c34\u5e76\u884c\u3002\u6bcf\u4e2a\u9636\u6bb5\u90fd\u8fd0\u884c\u5728 6 \u53f0 DGX-A100 \u4e3b\u673a\u4e0a\u3002\u57286\u53f0\u4e3b\u673a\u4e4b\u95f4\uff0c\u8fdb\u884c\u7684\u662f\u6570\u636e\u5e76\u884c\u8bad\u7ec3\uff1b\u6bcf\u53f0\u4e3b\u673a\u6709 8 \u5f20 GPU \u663e\u5361\uff0c\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u76848\u5f20 GPU \u663e\u5361\u4e4b\u95f4\u662f\u8fdb\u884c\u6a21\u578b\u5e76\u884c\u8bad\u7ec3\u3002 \u5e76\u884c\u7b56\u7565\u7684\u9009\u62e9\u5f71\u54cd\u7740\u8bad\u7ec3\u6548\u7387\uff0c\u6846\u67b6\u5bf9\u5e76\u884c\u8bad\u7ec3\u7684\u63a5\u53e3\u652f\u6301\u7a0b\u5ea6\uff0c\u51b3\u5b9a\u4e86\u7b97\u6cd5\u5de5\u7a0b\u5e08\u7684\u5f00\u53d1\u6548\u7387\u3002OneFlow \u9488\u5bf9\u5206\u5e03\u5f0f\u8bad\u7ec3\u6240\u505a\u7684\u7cfb\u7edf\u7ea7\u8bbe\u8ba1\u548c\u521b\u65b0\uff0c\u4e3a\u7528\u6237\u8f7b\u677e\u4e0a\u624b\u5206\u5e03\u5f0f\u8bad\u7ec3\u505a\u8db3\u4e86\u94fa\u57ab\u3002\u6211\u4eec\u5c06\u5728\u672c\u4e13\u9898\u7684\u5176\u5b83\u6587\u7ae0\u4e2d\u770b\u5230\u76f8\u5173\u793a\u4f8b\u3002","title":"\u6df7\u5408\u5e76\u884c"},{"location":"llm/others/prompt/","text":"Prompt \u00b6 \u7ea6 145 \u4e2a\u5b57 57 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract Learn from ChatGPT Prompt Engineering for Developers in DeepLearning.AI Guidelines for Prompting \u00b6 Principle 1: Write clear and specific instructions Tactic 1: Use delimiters to clearly indicate disinct parts of the input Delimiters can be anything like: ```,\"\"\",<>, , , : Tactic 2: Ask for a structureed output JSON, HTML Tactic 3: Ask the modell to check whether conditions are satisfied Tactic 4: \"Few-shot\" prompting Principle 2: Give the model time to \"think\" Tactic 1: Specify the steps required to complete a task, Ask for output in a specified format Tactic 2: Instruct the model to work out its own solution before rushing to a conclusion Setup \u00b6 Load the API key and relevant Python libaries. import openai import os from dotenv import load_dotenv , find_dotenv _ = load_dotenv ( find_dotenv ()) openai . api_key = os . getenv ( 'OPENAI_API_KEY' ) using helper function , model is gpt-3.5-turbo . def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ] Example \u00b6 simple text = f \"\"\" You should express what you want a model to do by \\ providing instructions that are as clear and \\ specific as you can possibly make them. \\ This will guide the model towards the desired output, \\ and reduce the chances of receiving irrelevant \\ or incorrect responses. Don't confuse writing a \\ clear prompt with writing a short prompt. \\ In many cases, longer prompts provide more clarity \\ and context for the model, which can lead to \\ more detailed and relevant outputs. \"\"\" prompt = f \"\"\" Summarize the text delimited by triple backticks \\ into a single sentence. ``` { text } ``` \"\"\" response = get_completion ( prompt ) print ( response ) chatbot def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): # Andrew mentioned that the prompt/ completion paradigm is preferable for this class messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ] prod_review = \"\"\" Got this panda plush toy for my daughter's birthday, \\ who loves it and takes it everywhere. It's soft and \\ super cute, and its face has a friendly look. It's \\ a bit small for what I paid though. I think there \\ might be other options that are bigger for the \\ same price. It arrived a day earlier than expected, \\ so I got to play with it myself before I gave it \\ to her. \"\"\" prompt = f \"\"\" Your task is to generate a short summary of a product \\ review from an ecommerce site. Summarize the review below, delimited by triple backticks, in at most 30 words. Review: ``` { prod_review } ``` \"\"\" response = get_completion ( prompt ) print ( response ) Prompting for Tasks \u00b6 Iterative Summarizing Inferring Transforming Expanding Chatbot","title":"Prompt"},{"location":"llm/others/prompt/#prompt","text":"\u7ea6 145 \u4e2a\u5b57 57 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract Learn from ChatGPT Prompt Engineering for Developers in DeepLearning.AI","title":"Prompt"},{"location":"llm/others/prompt/#guidelines-for-prompting","text":"Principle 1: Write clear and specific instructions Tactic 1: Use delimiters to clearly indicate disinct parts of the input Delimiters can be anything like: ```,\"\"\",<>, , , : Tactic 2: Ask for a structureed output JSON, HTML Tactic 3: Ask the modell to check whether conditions are satisfied Tactic 4: \"Few-shot\" prompting Principle 2: Give the model time to \"think\" Tactic 1: Specify the steps required to complete a task, Ask for output in a specified format Tactic 2: Instruct the model to work out its own solution before rushing to a conclusion","title":"Guidelines for Prompting"},{"location":"llm/others/prompt/#setup","text":"Load the API key and relevant Python libaries. import openai import os from dotenv import load_dotenv , find_dotenv _ = load_dotenv ( find_dotenv ()) openai . api_key = os . getenv ( 'OPENAI_API_KEY' ) using helper function , model is gpt-3.5-turbo . def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ]","title":"Setup"},{"location":"llm/others/prompt/#example","text":"simple text = f \"\"\" You should express what you want a model to do by \\ providing instructions that are as clear and \\ specific as you can possibly make them. \\ This will guide the model towards the desired output, \\ and reduce the chances of receiving irrelevant \\ or incorrect responses. Don't confuse writing a \\ clear prompt with writing a short prompt. \\ In many cases, longer prompts provide more clarity \\ and context for the model, which can lead to \\ more detailed and relevant outputs. \"\"\" prompt = f \"\"\" Summarize the text delimited by triple backticks \\ into a single sentence. ``` { text } ``` \"\"\" response = get_completion ( prompt ) print ( response ) chatbot def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): # Andrew mentioned that the prompt/ completion paradigm is preferable for this class messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ] prod_review = \"\"\" Got this panda plush toy for my daughter's birthday, \\ who loves it and takes it everywhere. It's soft and \\ super cute, and its face has a friendly look. It's \\ a bit small for what I paid though. I think there \\ might be other options that are bigger for the \\ same price. It arrived a day earlier than expected, \\ so I got to play with it myself before I gave it \\ to her. \"\"\" prompt = f \"\"\" Your task is to generate a short summary of a product \\ review from an ecommerce site. Summarize the review below, delimited by triple backticks, in at most 30 words. Review: ``` { prod_review } ``` \"\"\" response = get_completion ( prompt ) print ( response )","title":"Example"},{"location":"llm/others/prompt/#prompting-for-tasks","text":"Iterative Summarizing Inferring Transforming Expanding Chatbot","title":"Prompting for Tasks"},{"location":"llm/transformer/","text":"Transformer \u00b6 Abstract \u5f52\u6863\u5b66\u4e60 Transformer \u7684\u7b14\u8bb0 Table of Contents \u00b6 Attention Transformer BERT ViT","title":"Transformer"},{"location":"llm/transformer/#transformer","text":"Abstract \u5f52\u6863\u5b66\u4e60 Transformer \u7684\u7b14\u8bb0","title":"Transformer"},{"location":"llm/transformer/#table-of-contents","text":"Attention Transformer BERT ViT","title":"Table of Contents"},{"location":"llm/transformer/attention/","text":"Attention \u673a\u5236 \u00b6 \u7ea6 2743 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u4e8e RNN \u4e2d\u5b58\u5728\u7684\u4fe1\u606f\u74f6\u9888\u95ee\u9898\uff0c\u6ce8\u610f\u529b\u673a\u5236\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd Encoder-Decoder\u3001Seq2Seq \u4ee5\u53ca Attention \u673a\u5236\u3002 Encoder-Decoder \u00b6 Encoder-Decoder \u6a21\u578b\u4e3b\u8981\u662f NLP \u9886\u57df\u91cc\u7684\u6982\u5ff5\u3002\u5b83\u5e76\u4e0d\u7279\u503c\u67d0\u79cd\u5177\u4f53\u7684\u7b97\u6cd5\uff0c\u800c\u662f\u4e00\u7c7b\u7b97\u6cd5\u7684\u7edf\u79f0\u3002Encoder-Decoder \u7b97\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6846\u67b6\uff0c\u5728\u8fd9\u4e2a\u6846\u67b6\u4e0b\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u7b97\u6cd5\u6765\u89e3\u51b3\u4e0d\u540c\u7684\u4efb\u52a1\u3002 Encoder-Decoder \u6846\u67b6\u5f88\u597d\u5730\u8be0\u91ca\u4e86\u673a\u5668\u5b66\u4e60\u7684\u6838\u5fc3\u601d\u8def\uff1a \u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\uff0c\u901a\u8fc7\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u4ece\u800c\u89e3\u51b3\u73b0\u5b9e\u95ee\u9898 Encoder \u53c8\u79f0\u7f16\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\u300f\u3002 Decoder \u53c8\u79f0\u89e3\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u5e76\u8f6c\u5316\u4e3a\u73b0\u5b9e\u4e16\u754c\u7684\u89e3\u51b3\u65b9\u6848\u300f\u3002 \u5173\u4e8e Encoder-Decoder\uff1a \u4e0d\u8bba\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u662f\u4ec0\u4e48\uff0c\u4e2d\u95f4\u7684 \u5411\u91cfc \u7684\u957f\u5ea6\u90fd\u662f\u56fa\u5b9a\u7684\uff08\u8fd9\u4e5f\u662f\u5b83\u7684\u7f3a\u9677\uff09\u3002 \u6839\u636e\u4e0d\u540c\u7684\u4efb\u52a1\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u7f16\u7801\u5668\u548c\u89e3\u7801\u5668\uff08\u53ef\u4ee5\u662f\u4e00\u4e2a RNN\uff0c\u4f46\u901a\u5e38\u662f\u5176\u53d8\u79cd LSTM \u6216\u8005 GRU\uff09\u3002 Encoder-Decoder \u7684\u7f3a\u9677 \u4e3a\u4e86\u4fbf\u4e8e\u7406\u89e3\uff0c\u6211\u4eec\u7c7b\u6bd4\u4e3a\u300c\u538b\u7f29-\u89e3\u538b\u300d\u7684\u8fc7\u7a0b\uff1a \u5c06\u4e00\u5f20 800X800 \u50cf\u7d20\u7684\u56fe\u7247\u538b\u7f29\u6210 100KB\uff0c\u770b\u4e0a\u53bb\u8fd8\u6bd4\u8f83\u6e05\u6670\u3002\u518d\u5c06\u4e00\u5f20 3000X3000 \u50cf\u7d20\u7684\u56fe\u7247\u4e5f\u538b\u7f29\u5230 100KB\uff0c\u770b\u4e0a\u53bb\u5c31\u6a21\u7cca\u4e86\u3002 Encoder-Decoder \u5c31\u662f\u7c7b\u4f3c\u7684\u95ee\u9898\uff1a\u5f53\u8f93\u5165\u4fe1\u606f\u592a\u957f\u65f6\uff0c\u4f1a\u4e22\u5931\u6389\u4e00\u4e9b\u4fe1\u606f\u3002 Seq2Seq \u00b6 \u6982\u8ff0 \u00b6 Seq2Seq\uff08\u662f Sequence to Sequence \u7684\u7f29\u5199\uff09\uff0c\u5b57\u9762\u610f\u601d\u5c31\u662f\u8f93\u5165\u4e00\u4e2a\u5e8f\u5217\uff0c\u8f93\u51fa\u53e6\u4e00\u4e2a\u5e8f\u5217\u3002\u8fd9\u79cd\u7ed3\u6784\u6700\u91cd\u8981\u7684\u5730\u65b9\u5728\u4e8e\u8f93\u5165\u5e8f\u5217\u548c\u8f93\u51fa\u5e8f\u5217\u7684\u957f\u5ea6\u53ef\u4ee5\u53ef\u53d8\u7684\u3002\u4f8b\u5982\u4e0b\u56fe\uff1a \u5982\u4e0a\u56fe\uff1a\u8f93\u5165\u4e86 6 \u4e2a\u6c49\u5b57\uff0c\u8f93\u51fa\u4e86 3 \u4e2a\u82f1\u6587\u5355\u8bcd\u3002\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u4e0d\u540c\u3002 Seq2Seq \u548c Encoder-Decoder \u7684\u5173\u7cfb \u00b6 Seq2Seq\uff08\u5f3a\u8c03\u76ee\u7684\uff09\u4e0d\u7279\u6307\u5177\u4f53\u65b9\u6cd5\uff0c\u6ee1\u8db3\u300c\u8f93\u5165\u5e8f\u5217\u3001\u8f93\u51fa\u5e8f\u5217\u300d\u7684\u76ee\u7684\uff0c\u90fd\u53ef\u4ee5\u7edf\u79f0\u4e3a Seq2Seq \u6a21\u578b\u3002 \u800c Seq2Seq \u4f7f\u7528\u7684\u5177\u4f53\u65b9\u6cd5\u57fa\u672c\u90fd\u5c5e\u4e8eEncoder-Decoder \u6a21\u578b\uff08\u5f3a\u8c03\u65b9\u6cd5\uff09\u7684\u8303\u7574\u3002 \u603b\u7ed3\u4e00\u4e0b\u7684\u8bdd\uff1a Seq2Seq \u5c5e\u4e8e Encoder-Decoder \u7684\u5927\u8303\u7574 Seq2Seq \u66f4\u5f3a\u8c03\u76ee\u7684\uff0cEncoder-Decoder \u66f4\u5f3a\u8c03\u65b9\u6cd5 Attention \u00b6 \u672c\u8d28 \u00b6 Attention\uff08\u6ce8\u610f\u529b\uff09\u673a\u5236\u5982\u679c\u6d45\u5c42\u7684\u7406\u89e3\uff0c\u8ddf\u4ed6\u7684\u540d\u5b57\u975e\u5e38\u5339\u914d\u3002\u4ed6\u7684\u6838\u5fc3\u903b\u8f91\u5c31\u662f\u300c\u4ece\u5173\u6ce8\u5168\u90e8\u5230\u5173\u6ce8\u91cd\u70b9\u300d\u3002\u6211\u4eec\u7684\u89c6\u89c9\u7cfb\u7edf\u5c31\u662f\u4e00\u79cd Attention \u673a\u5236\uff0c\u5c06\u6709\u9650\u7684\u6ce8\u610f\u529b\u96c6\u4e2d\u5728\u91cd\u70b9\u4fe1\u606f\u4e0a\uff0c\u4ece\u800c\u8282\u7701\u8d44\u6e90\uff0c\u5feb\u901f\u83b7\u5f97\u6700\u6709\u6548\u7684\u4fe1\u606f\u3002 Attention \u673a\u5236\u6700\u65e9\u662f\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u91cc\u5e94\u7528\u7684\uff0c\u968f\u540e\u5728 NLP \u9886\u57df\u4e5f\u5f00\u59cb\u5e94\u7528\u4e86\uff0c\u771f\u6b63\u53d1\u626c\u5149\u5927\u662f\u5728 NLP \u9886\u57df\uff0c\u56e0\u4e3a 2018 \u5e74 BERT \u548c GPT \u7684\u6548\u679c\u51fa\u5947\u7684\u597d\uff0c\u8fdb\u800c\u8d70\u7ea2\u3002\u800c Transformer \u548c Attention \u8fd9\u4e9b\u6838\u5fc3\u5f00\u59cb\u88ab\u5927\u5bb6\u91cd\u70b9\u5173\u6ce8\u3002 \u5982\u679c\u7528\u56fe\u6765\u8868\u8fbe Attention \u7684\u4f4d\u7f6e\u5927\u81f4\u662f\u4e0b\u9762\u7684\u6837\u5b50\uff1a \u4e09\u5927\u4f18\u70b9 \u00b6 \u4e4b\u6240\u4ee5\u8981\u5f15\u5165 Attention \u673a\u5236\uff0c\u4e3b\u8981\u662f 3 \u4e2a\u539f\u56e0\uff1a \u53c2\u6570\u5c11 \uff1a\u6a21\u578b\u590d\u6742\u5ea6\u66f4 CNN\u3001RNN \u76f8\u6bd4\uff0c\u590d\u6742\u5ea6\u66f4\u5c0f\uff0c\u53c2\u6570\u4e5f\u66f4\u5c11\u3002\u5bf9\u7b97\u529b\u7684\u8981\u6c42\u4e5f\u5c31\u66f4\u5c11\u3002 \u901f\u5ea6\u5feb \uff1aAttention \u89e3\u51b3\u4e86 RNN \u4e0d\u80fd\u5e76\u884c\u8ba1\u7b97\u7684\u95ee\u9898\u3002Attention\u673a\u5236\u6bcf\u4e00\u6b65\u8ba1\u7b97\u4e0d\u4f9d\u8d56\u4e8e\u4e0a\u4e00\u6b65\u7684\u8ba1\u7b97\u7ed3\u679c\uff0c\u56e0\u6b64\u53ef\u4ee5\u548cCNN\u4e00\u6837\u5e76\u884c\u5904\u7406\u3002 \u6548\u679c\u597d \uff1a\u5728 Attention \u673a\u5236\u5f15\u5165\u4e4b\u524d\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u5927\u5bb6\u4e00\u76f4\u5f88\u82e6\u607c\uff1a\u957f\u8ddd\u79bb\u7684\u4fe1\u606f\u4f1a\u88ab\u5f31\u5316\uff0c\u5c31\u597d\u50cf\u8bb0\u5fc6\u80fd\u529b\u5f31\u7684\u4eba\uff0c\u8bb0\u4e0d\u4f4f\u8fc7\u53bb\u7684\u4e8b\u60c5\u662f\u4e00\u6837\u7684\u3002 \u539f\u7406 \u00b6 \u4e0b\u9762\u7684\u52a8\u56fe\u6f14\u793a\u4e86 attention \u5f15\u5165 Encoder-Decoder \u6846\u67b6\u4e0b\uff0c\u5b8c\u6210\u673a\u5668\u7ffb\u8bd1\u4efb\u52a1\u7684\u5927\u81f4\u6d41\u7a0b\u3002 \u4f46\u662f\uff0cAttention \u5e76\u4e0d\u4e00\u5b9a\u8981\u5728 Encoder-Decoder \u6846\u67b6\u4e0b\u4f7f\u7528\u7684\uff0c\u4ed6\u662f\u53ef\u4ee5\u8131\u79bb Encoder-Decoder \u6846\u67b6\u7684\u3002 Attention \u539f\u7406\u5206\u4e3a 3 \u6b65\uff1a query \u548c key \u8fdb\u884c\u76f8\u4f3c\u5ea6\u8ba1\u7b97\uff0c\u5f97\u5230\u6743\u503c \u5c06\u6743\u503c\u8fdb\u884c\u5f52\u4e00\u5316\uff0c\u5f97\u5230\u76f4\u63a5\u53ef\u7528\u7684\u6743\u91cd \u5c06\u6743\u91cd\u548c value \u8fdb\u884c\u52a0\u6743\u6c42\u548c \u4ece\u4e0a\u9762\u7684\u5efa\u6a21\uff0c\u53ef\u4ee5\u5927\u81f4\u611f\u53d7\u5230 Attention \u7684\u601d\u8def\u7b80\u5355\uff0c \u56db\u4e2a\u5b57\u201c\u5e26\u6743\u6c42\u548c\u201d \uff0c\u5927\u9053\u81f3\u7b80\u3002 N \u79cd\u7c7b\u578b \u00b6 \u8ba1\u7b97\u533a\u57df \u00b6 Soft Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u5e38\u89c1\u7684Attention\u65b9\u5f0f\uff0c\u5bf9\u6240\u6709key\u6c42\u6743\u91cd\u6982\u7387\uff0c\u6bcf\u4e2akey\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u6743\u91cd\uff0c\u662f\u4e00\u79cd\u5168\u5c40\u7684\u8ba1\u7b97\u65b9\u5f0f\uff08\u4e5f\u53ef\u4ee5\u53ebGlobal Attention\uff09\u3002\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u8f83\u7406\u6027\uff0c\u53c2\u8003\u4e86\u6240\u6709key\u7684\u5185\u5bb9\uff0c\u518d\u8fdb\u884c\u52a0\u6743\u3002\u4f46\u662f\u8ba1\u7b97\u91cf\u53ef\u80fd\u4f1a\u6bd4\u8f83\u5927\u4e00\u4e9b\u3002 Hard Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u662f\u76f4\u63a5\u7cbe\u51c6\u5b9a\u4f4d\u5230\u67d0\u4e2akey\uff0c\u5176\u4f59key\u5c31\u90fd\u4e0d\u7ba1\u4e86\uff0c\u76f8\u5f53\u4e8e\u8fd9\u4e2akey\u7684\u6982\u7387\u662f1\uff0c\u5176\u4f59key\u7684\u6982\u7387\u5168\u90e8\u662f0\u3002\u56e0\u6b64\u8fd9\u79cd\u5bf9\u9f50\u65b9\u5f0f\u8981\u6c42\u5f88\u9ad8\uff0c\u8981\u6c42\u4e00\u6b65\u5230\u4f4d\uff0c\u5982\u679c\u6ca1\u6709\u6b63\u786e\u5bf9\u9f50\uff0c\u4f1a\u5e26\u6765\u5f88\u5927\u7684\u5f71\u54cd\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u56e0\u4e3a\u4e0d\u53ef\u5bfc\uff0c\u4e00\u822c\u9700\u8981\u7528\u5f3a\u5316\u5b66\u4e60\u7684\u65b9\u6cd5\u8fdb\u884c\u8bad\u7ec3\u3002\uff08\u6216\u8005\u4f7f\u7528gumbel softmax\u4e4b\u7c7b\u7684\uff09 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5176\u5b9e\u662f\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\u7684\u4e00\u4e2a\u6298\u4e2d\uff0c\u5bf9\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\u8fdb\u884c\u8ba1\u7b97\u3002\u5148\u7528Hard\u65b9\u5f0f\u5b9a\u4f4d\u5230\u67d0\u4e2a\u5730\u65b9\uff0c\u4ee5\u8fd9\u4e2a\u70b9\u4e3a\u4e2d\u5fc3\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\uff0c\u5728\u8fd9\u4e2a\u5c0f\u533a\u57df\u5185\u7528Soft\u65b9\u5f0f\u6765\u7b97Attention\u3002 \u6240\u7528\u4fe1\u606f \u00b6 \u5047\u8bbe\u6211\u4eec\u8981\u5bf9\u4e00\u6bb5\u539f\u6587\u8ba1\u7b97Attention\uff0c\u8fd9\u91cc\u539f\u6587\u6307\u7684\u662f\u6211\u4eec\u8981\u505aattention\u7684\u6587\u672c\uff0c\u90a3\u4e48\u6240\u7528\u4fe1\u606f\u5305\u62ec\u5185\u90e8\u4fe1\u606f\u548c\u5916\u90e8\u4fe1\u606f\uff0c\u5185\u90e8\u4fe1\u606f\u6307\u7684\u662f\u539f\u6587\u672c\u8eab\u7684\u4fe1\u606f\uff0c\u800c\u5916\u90e8\u4fe1\u606f\u6307\u7684\u662f\u9664\u539f\u6587\u4ee5\u5916\u7684\u989d\u5916\u4fe1\u606f\u3002 General Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5229\u7528\u5230\u4e86\u5916\u90e8\u4fe1\u606f\uff0c\u5e38\u7528\u4e8e\u9700\u8981\u6784\u5efa\u4e24\u6bb5\u6587\u672c\u5173\u7cfb\u7684\u4efb\u52a1\uff0cquery\u4e00\u822c\u5305\u542b\u4e86\u989d\u5916\u4fe1\u606f\uff0c\u6839\u636e\u5916\u90e8query\u5bf9\u539f\u6587\u8fdb\u884c\u5bf9\u9f50\u3002 General Attention \u6bd4\u5982\u5728\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u4e2d\uff0c\u9700\u8981\u6784\u5efa\u95ee\u9898\u548c\u6587\u7ae0\u7684\u5173\u8054\uff0c\u5047\u8bbe\u73b0\u5728baseline\u662f\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u95ee\u9898\u5411\u91cfq\uff0c\u628a\u8fd9\u4e2aq\u548c\u6240\u6709\u7684\u6587\u7ae0\u8bcd\u5411\u91cf\u62fc\u63a5\u8d77\u6765\uff0c\u8f93\u5165\u5230LSTM\u4e2d\u8fdb\u884c\u5efa\u6a21\u3002\u90a3\u4e48\u5728\u8fd9\u4e2a\u6a21\u578b\u4e2d\uff0c\u6587\u7ae0\u6240\u6709\u8bcd\u5411\u91cf\u5171\u4eab\u540c\u4e00\u4e2a\u95ee\u9898\u5411\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u60f3\u8ba9\u6587\u7ae0\u6bcf\u4e00\u6b65\u7684\u8bcd\u5411\u91cf\u90fd\u6709\u4e00\u4e2a\u4e0d\u540c\u7684\u95ee\u9898\u5411\u91cf\uff0c\u4e5f\u5c31\u662f\uff0c\u5728\u6bcf\u4e00\u6b65\u4f7f\u7528\u6587\u7ae0\u5728\u8be5\u6b65\u4e0b\u7684\u8bcd\u5411\u91cf\u5bf9\u95ee\u9898\u6765\u7b97attention\uff0c\u8fd9\u91cc\u95ee\u9898\u5c5e\u4e8e\u539f\u6587\uff0c\u6587\u7ae0\u8bcd\u5411\u91cf\u5c31\u5c5e\u4e8e\u5916\u90e8\u4fe1\u606f\u3002 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u53ea\u4f7f\u7528\u5185\u90e8\u4fe1\u606f\uff0ckey\u548cvalue\u4ee5\u53caquery\u53ea\u548c\u8f93\u5165\u539f\u6587\u6709\u5173\uff0c\u5728self attention\u4e2d\uff0ckey=value=query\u3002\u65e2\u7136\u6ca1\u6709\u5916\u90e8\u4fe1\u606f\uff0c\u90a3\u4e48\u5728\u539f\u6587\u4e2d\u7684\u6bcf\u4e2a\u8bcd\u53ef\u4ee5\u8ddf\u8be5\u53e5\u5b50\u4e2d\u7684\u6240\u6709\u8bcd\u8fdb\u884cAttention\u8ba1\u7b97\uff0c\u76f8\u5f53\u4e8e\u5bfb\u627e\u539f\u6587\u5185\u90e8\u7684\u5173\u7cfb\u3002 Local Attention \u8fd8\u662f\u4e3e\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u7684\u4f8b\u5b50\uff0c\u4e0a\u9762\u7684baseline\u4e2d\u63d0\u5230\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u5411\u91cfq\uff0c\u90a3\u4e48\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u7528\u4e0aattention\uff0c\u53ea\u7528\u95ee\u9898\u81ea\u8eab\u7684\u4fe1\u606f\u53bb\u505aattention\uff0c\u800c\u4e0d\u5f15\u5165\u6587\u7ae0\u4fe1\u606f\u3002 \u7ed3\u6784\u5c42\u6b21 \u00b6 \u7ed3\u6784\u65b9\u9762\u6839\u636e\u662f\u5426\u5212\u5206\u5c42\u6b21\u5173\u7cfb\uff0c\u5206\u4e3a\u5355\u5c42 attention\uff0c\u591a\u5c42 attention \u548c \u591a\u5934 attention\uff1a \u5355\u5c42 Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u666e\u904d\u7684\u505a\u6cd5\uff0c\u7528\u4e00\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e00\u6b21attention\u3002 \u591a\u5c42 Attention \uff0c\u4e00\u822c\u7528\u4e8e\u6587\u672c\u5177\u6709\u5c42\u6b21\u5173\u7cfb\u7684\u6a21\u578b\uff0c\u5047\u8bbe\u6211\u4eec\u628a\u4e00\u4e2adocument\u5212\u5206\u6210\u591a\u4e2a\u53e5\u5b50\uff0c\u5728\u7b2c\u4e00\u5c42\uff0c\u6211\u4eec\u5206\u522b\u5bf9\u6bcf\u4e2a\u53e5\u5b50\u4f7f\u7528attention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u53e5\u5411\u91cf\uff08\u4e5f\u5c31\u662f\u5355\u5c42attention\uff09\uff1b\u5728\u7b2c\u4e8c\u5c42\uff0c\u6211\u4eec\u5bf9\u6240\u6709\u53e5\u5411\u91cf\u518d\u505aattention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u6587\u6863\u5411\u91cf\uff08\u4e5f\u662f\u4e00\u4e2a\u5355\u5c42attention\uff09\uff0c\u6700\u540e\u518d\u7528\u8fd9\u4e2a\u6587\u6863\u5411\u91cf\u53bb\u505a\u4efb\u52a1\u3002 \u591a\u5934 Attention \uff0c\u8fd9\u662fAttention is All You Need\u4e2d\u63d0\u5230\u7684multi-head attention\uff0c\u7528\u5230\u4e86\u591a\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e86\u591a\u6b21attention\uff0c\u6bcf\u4e2aquery\u90fd\u5173\u6ce8\u5230\u539f\u6587\u7684\u4e0d\u540c\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u91cd\u590d\u505a\u591a\u6b21\u5355\u5c42attention\uff1a \\[ head_i = Attention(q_i, K, V) \\] \u6700\u540e\u518d\u628a\u8fd9\u4e9b\u7ed3\u679c\u62fc\u63a5\u8d77\u6765\uff1a \\[ MultiHead(Q, K, V) = Concat(head_1, ..., head_h)W^O \\] \u6a21\u578b\u65b9\u9762 \u00b6 \u4ece\u6a21\u578b\u4e0a\u770b\uff0cAttention \u4e00\u822c\u7528\u5728 CNN \u548c LSTM \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u7eaf Attention \u8ba1\u7b97\u3002 CNN + Attention CNN\u7684\u5377\u79ef\u64cd\u4f5c\u53ef\u4ee5\u63d0\u53d6\u91cd\u8981\u7279\u5f81\uff0c\u6211\u89c9\u5f97\u8fd9\u4e5f\u7b97\u662fAttention\u7684\u601d\u60f3\uff0c\u4f46\u662fCNN\u7684\u5377\u79ef\u611f\u53d7\u89c6\u91ce\u662f\u5c40\u90e8\u7684\uff0c\u9700\u8981\u901a\u8fc7\u53e0\u52a0\u591a\u5c42\u5377\u79ef\u533a\u53bb\u6269\u5927\u89c6\u91ce\u3002\u53e6\u5916\uff0cMax Pooling\u76f4\u63a5\u63d0\u53d6\u6570\u503c\u6700\u5927\u7684\u7279\u5f81\uff0c\u4e5f\u50cf\u662fhard attention\u7684\u601d\u60f3\uff0c\u76f4\u63a5\u9009\u4e2d\u67d0\u4e2a\u7279\u5f81\u3002 CNN\u4e0a\u52a0Attention\u53ef\u4ee5\u52a0\u5728\u8fd9\u51e0\u65b9\u9762\uff1a a. \u5728\u5377\u79ef\u64cd\u4f5c\u524d\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-1\uff0c\u8fd9\u4e2a\u4efb\u52a1\u662f\u6587\u672c\u8574\u542b\u4efb\u52a1\u9700\u8981\u5904\u7406\u4e24\u6bb5\u6587\u672c\uff0c\u540c\u65f6\u5bf9\u4e24\u6bb5\u8f93\u5165\u7684\u5e8f\u5217\u5411\u91cf\u8fdb\u884cattention\uff0c\u8ba1\u7b97\u51fa\u7279\u5f81\u5411\u91cf\uff0c\u518d\u62fc\u63a5\u5230\u539f\u59cb\u5411\u91cf\u4e2d\uff0c\u4f5c\u4e3a\u5377\u79ef\u5c42\u7684\u8f93\u5165\u3002 b. \u5728\u5377\u79ef\u64cd\u4f5c\u540e\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-2\uff0c\u5bf9\u4e24\u6bb5\u6587\u672c\u7684\u5377\u79ef\u5c42\u7684\u8f93\u51fa\u505aattention\uff0c\u4f5c\u4e3apooling\u5c42\u7684\u8f93\u5165\u3002 c. \u5728pooling\u5c42\u505aattention\uff0c\u4ee3\u66ffmax pooling\u3002\u6bd4\u5982Attention pooling\uff0c\u9996\u5148\u6211\u4eec\u7528LSTM\u5b66\u5230\u4e00\u4e2a\u6bd4\u8f83\u597d\u7684\u53e5\u5411\u91cf\uff0c\u4f5c\u4e3aquery\uff0c\u7136\u540e\u7528CNN\u5148\u5b66\u4e60\u5230\u4e00\u4e2a\u7279\u5f81\u77e9\u9635\u4f5c\u4e3akey\uff0c\u518d\u7528query\u5bf9key\u4ea7\u751f\u6743\u91cd\uff0c\u8fdb\u884cattention\uff0c\u5f97\u5230\u6700\u540e\u7684\u53e5\u5411\u91cf\u3002 LSTM+Attention LSTM\u5185\u90e8\u6709Gate\u673a\u5236\uff0c\u5176\u4e2dinput gate\u9009\u62e9\u54ea\u4e9b\u5f53\u524d\u4fe1\u606f\u8fdb\u884c\u8f93\u5165\uff0cforget gate\u9009\u62e9\u9057\u5fd8\u54ea\u4e9b\u8fc7\u53bb\u4fe1\u606f\uff0c\u6211\u89c9\u5f97\u8fd9\u7b97\u662f\u4e00\u5b9a\u7a0b\u5ea6\u7684Attention\u4e86\uff0c\u800c\u4e14\u53f7\u79f0\u53ef\u4ee5\u89e3\u51b3\u957f\u671f\u4f9d\u8d56\u95ee\u9898\uff0c\u5b9e\u9645\u4e0aLSTM\u9700\u8981\u4e00\u6b65\u4e00\u6b65\u53bb\u6355\u6349\u5e8f\u5217\u4fe1\u606f\uff0c\u5728\u957f\u6587\u672c\u4e0a\u7684\u8868\u73b0\u662f\u4f1a\u968f\u7740step\u589e\u52a0\u800c\u6162\u6162\u8870\u51cf\uff0c\u96be\u4ee5\u4fdd\u7559\u5168\u90e8\u7684\u6709\u7528\u4fe1\u606f\u3002 LSTM\u901a\u5e38\u9700\u8981\u5f97\u5230\u4e00\u4e2a\u5411\u91cf\uff0c\u518d\u53bb\u505a\u4efb\u52a1\uff0c\u5e38\u7528\u65b9\u5f0f\u6709\uff1a a. \u76f4\u63a5\u4f7f\u7528\u6700\u540e\u7684hidden state\uff08\u53ef\u80fd\u4f1a\u635f\u5931\u4e00\u5b9a\u7684\u524d\u6587\u4fe1\u606f\uff0c\u96be\u4ee5\u8868\u8fbe\u5168\u6587\uff09 b. \u5bf9\u6240\u6709step\u4e0b\u7684hidden state\u8fdb\u884c\u7b49\u6743\u5e73\u5747\uff08\u5bf9\u6240\u6709step\u4e00\u89c6\u540c\u4ec1\uff09\u3002 c. Attention\u673a\u5236\uff0c\u5bf9\u6240\u6709step\u7684hidden state\u8fdb\u884c\u52a0\u6743\uff0c\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u6574\u6bb5\u6587\u672c\u4e2d\u6bd4\u8f83\u91cd\u8981\u7684hidden state\u4fe1\u606f\u3002\u6027\u80fd\u6bd4\u524d\u9762\u4e24\u79cd\u8981\u597d\u4e00\u70b9\uff0c\u800c\u65b9\u4fbf\u53ef\u89c6\u5316\u89c2\u5bdf\u54ea\u4e9bstep\u662f\u91cd\u8981\u7684\uff0c\u4f46\u662f\u8981\u5c0f\u5fc3\u8fc7\u62df\u5408\uff0c\u800c\u4e14\u4e5f\u589e\u52a0\u4e86\u8ba1\u7b97\u91cf\u3002 \u7eafAttention Attention is all you need\uff0c\u6ca1\u6709\u7528\u5230CNN/RNN\uff0c\u4e4d\u4e00\u542c\u4e5f\u662f\u4e00\u80a1\u6e05\u6d41\u4e86\uff0c\u4f46\u662f\u4ed4\u7ec6\u4e00\u770b\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f\u4e00\u5806\u5411\u91cf\u53bb\u8ba1\u7b97attention\u3002 \u76f8\u4f3c\u5ea6\u8ba1\u7b97\u65b9\u5f0f \u00b6 \u5728\u505aattention\u7684\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97query\u548c\u67d0\u4e2akey\u7684\u5206\u6570\uff08\u76f8\u4f3c\u5ea6\uff09\uff0c\u5e38\u7528\u65b9\u6cd5\u6709\uff1a \u70b9\u4e58\uff1a \\(score(q,k)=q^\\top k\\) \u77e9\u9635\u76f8\u4e58\uff1a \\(score(q,k)=q^\\top Wk\\) \u4f59\u5f26\u76f8\u4f3c\u5ea6\uff1a \\(score(q,k)=\\frac{q^\\top k}{\\|q\\| \\cdot \\|k\\|}\\) \u4e32\u8054\u65b9\u5f0f\uff0c\u628aq\u548ck\u62fc\u63a5\u8d77\u6765\uff1a \\(score(q,k)=W[q;k]\\) \u591a\u5c42\u611f\u77e5\u673a\uff1a \\(score(q,k)=v_a^\\top tanh(Wq+Uk)\\) Reference \u00b6 Encoder-Decoder \u548c Seq2Seq \u4e00\u6587\u770b\u61c2 Attention\uff08\u672c\u8d28\u539f\u7406+3\u5927\u4f18\u70b9+5\u5927\u7c7b\u578b\uff09 \u904d\u5730\u5f00\u82b1\u7684 Attention\uff0c\u4f60\u771f\u7684\u61c2\u5417\uff1f","title":"Attention"},{"location":"llm/transformer/attention/#attention","text":"\u7ea6 2743 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u4e8e RNN \u4e2d\u5b58\u5728\u7684\u4fe1\u606f\u74f6\u9888\u95ee\u9898\uff0c\u6ce8\u610f\u529b\u673a\u5236\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd Encoder-Decoder\u3001Seq2Seq \u4ee5\u53ca Attention \u673a\u5236\u3002","title":"Attention \u673a\u5236"},{"location":"llm/transformer/attention/#encoder-decoder","text":"Encoder-Decoder \u6a21\u578b\u4e3b\u8981\u662f NLP \u9886\u57df\u91cc\u7684\u6982\u5ff5\u3002\u5b83\u5e76\u4e0d\u7279\u503c\u67d0\u79cd\u5177\u4f53\u7684\u7b97\u6cd5\uff0c\u800c\u662f\u4e00\u7c7b\u7b97\u6cd5\u7684\u7edf\u79f0\u3002Encoder-Decoder \u7b97\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6846\u67b6\uff0c\u5728\u8fd9\u4e2a\u6846\u67b6\u4e0b\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u7b97\u6cd5\u6765\u89e3\u51b3\u4e0d\u540c\u7684\u4efb\u52a1\u3002 Encoder-Decoder \u6846\u67b6\u5f88\u597d\u5730\u8be0\u91ca\u4e86\u673a\u5668\u5b66\u4e60\u7684\u6838\u5fc3\u601d\u8def\uff1a \u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\uff0c\u901a\u8fc7\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u4ece\u800c\u89e3\u51b3\u73b0\u5b9e\u95ee\u9898 Encoder \u53c8\u79f0\u7f16\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\u300f\u3002 Decoder \u53c8\u79f0\u89e3\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u5e76\u8f6c\u5316\u4e3a\u73b0\u5b9e\u4e16\u754c\u7684\u89e3\u51b3\u65b9\u6848\u300f\u3002 \u5173\u4e8e Encoder-Decoder\uff1a \u4e0d\u8bba\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u662f\u4ec0\u4e48\uff0c\u4e2d\u95f4\u7684 \u5411\u91cfc \u7684\u957f\u5ea6\u90fd\u662f\u56fa\u5b9a\u7684\uff08\u8fd9\u4e5f\u662f\u5b83\u7684\u7f3a\u9677\uff09\u3002 \u6839\u636e\u4e0d\u540c\u7684\u4efb\u52a1\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u7f16\u7801\u5668\u548c\u89e3\u7801\u5668\uff08\u53ef\u4ee5\u662f\u4e00\u4e2a RNN\uff0c\u4f46\u901a\u5e38\u662f\u5176\u53d8\u79cd LSTM \u6216\u8005 GRU\uff09\u3002 Encoder-Decoder \u7684\u7f3a\u9677 \u4e3a\u4e86\u4fbf\u4e8e\u7406\u89e3\uff0c\u6211\u4eec\u7c7b\u6bd4\u4e3a\u300c\u538b\u7f29-\u89e3\u538b\u300d\u7684\u8fc7\u7a0b\uff1a \u5c06\u4e00\u5f20 800X800 \u50cf\u7d20\u7684\u56fe\u7247\u538b\u7f29\u6210 100KB\uff0c\u770b\u4e0a\u53bb\u8fd8\u6bd4\u8f83\u6e05\u6670\u3002\u518d\u5c06\u4e00\u5f20 3000X3000 \u50cf\u7d20\u7684\u56fe\u7247\u4e5f\u538b\u7f29\u5230 100KB\uff0c\u770b\u4e0a\u53bb\u5c31\u6a21\u7cca\u4e86\u3002 Encoder-Decoder \u5c31\u662f\u7c7b\u4f3c\u7684\u95ee\u9898\uff1a\u5f53\u8f93\u5165\u4fe1\u606f\u592a\u957f\u65f6\uff0c\u4f1a\u4e22\u5931\u6389\u4e00\u4e9b\u4fe1\u606f\u3002","title":"Encoder-Decoder"},{"location":"llm/transformer/attention/#seq2seq","text":"","title":"Seq2Seq"},{"location":"llm/transformer/attention/#_1","text":"Seq2Seq\uff08\u662f Sequence to Sequence \u7684\u7f29\u5199\uff09\uff0c\u5b57\u9762\u610f\u601d\u5c31\u662f\u8f93\u5165\u4e00\u4e2a\u5e8f\u5217\uff0c\u8f93\u51fa\u53e6\u4e00\u4e2a\u5e8f\u5217\u3002\u8fd9\u79cd\u7ed3\u6784\u6700\u91cd\u8981\u7684\u5730\u65b9\u5728\u4e8e\u8f93\u5165\u5e8f\u5217\u548c\u8f93\u51fa\u5e8f\u5217\u7684\u957f\u5ea6\u53ef\u4ee5\u53ef\u53d8\u7684\u3002\u4f8b\u5982\u4e0b\u56fe\uff1a \u5982\u4e0a\u56fe\uff1a\u8f93\u5165\u4e86 6 \u4e2a\u6c49\u5b57\uff0c\u8f93\u51fa\u4e86 3 \u4e2a\u82f1\u6587\u5355\u8bcd\u3002\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u4e0d\u540c\u3002","title":"\u6982\u8ff0"},{"location":"llm/transformer/attention/#seq2seq-encoder-decoder","text":"Seq2Seq\uff08\u5f3a\u8c03\u76ee\u7684\uff09\u4e0d\u7279\u6307\u5177\u4f53\u65b9\u6cd5\uff0c\u6ee1\u8db3\u300c\u8f93\u5165\u5e8f\u5217\u3001\u8f93\u51fa\u5e8f\u5217\u300d\u7684\u76ee\u7684\uff0c\u90fd\u53ef\u4ee5\u7edf\u79f0\u4e3a Seq2Seq \u6a21\u578b\u3002 \u800c Seq2Seq \u4f7f\u7528\u7684\u5177\u4f53\u65b9\u6cd5\u57fa\u672c\u90fd\u5c5e\u4e8eEncoder-Decoder \u6a21\u578b\uff08\u5f3a\u8c03\u65b9\u6cd5\uff09\u7684\u8303\u7574\u3002 \u603b\u7ed3\u4e00\u4e0b\u7684\u8bdd\uff1a Seq2Seq \u5c5e\u4e8e Encoder-Decoder \u7684\u5927\u8303\u7574 Seq2Seq \u66f4\u5f3a\u8c03\u76ee\u7684\uff0cEncoder-Decoder \u66f4\u5f3a\u8c03\u65b9\u6cd5","title":"Seq2Seq \u548c Encoder-Decoder \u7684\u5173\u7cfb"},{"location":"llm/transformer/attention/#attention_1","text":"","title":"Attention"},{"location":"llm/transformer/attention/#_2","text":"Attention\uff08\u6ce8\u610f\u529b\uff09\u673a\u5236\u5982\u679c\u6d45\u5c42\u7684\u7406\u89e3\uff0c\u8ddf\u4ed6\u7684\u540d\u5b57\u975e\u5e38\u5339\u914d\u3002\u4ed6\u7684\u6838\u5fc3\u903b\u8f91\u5c31\u662f\u300c\u4ece\u5173\u6ce8\u5168\u90e8\u5230\u5173\u6ce8\u91cd\u70b9\u300d\u3002\u6211\u4eec\u7684\u89c6\u89c9\u7cfb\u7edf\u5c31\u662f\u4e00\u79cd Attention \u673a\u5236\uff0c\u5c06\u6709\u9650\u7684\u6ce8\u610f\u529b\u96c6\u4e2d\u5728\u91cd\u70b9\u4fe1\u606f\u4e0a\uff0c\u4ece\u800c\u8282\u7701\u8d44\u6e90\uff0c\u5feb\u901f\u83b7\u5f97\u6700\u6709\u6548\u7684\u4fe1\u606f\u3002 Attention \u673a\u5236\u6700\u65e9\u662f\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u91cc\u5e94\u7528\u7684\uff0c\u968f\u540e\u5728 NLP \u9886\u57df\u4e5f\u5f00\u59cb\u5e94\u7528\u4e86\uff0c\u771f\u6b63\u53d1\u626c\u5149\u5927\u662f\u5728 NLP \u9886\u57df\uff0c\u56e0\u4e3a 2018 \u5e74 BERT \u548c GPT \u7684\u6548\u679c\u51fa\u5947\u7684\u597d\uff0c\u8fdb\u800c\u8d70\u7ea2\u3002\u800c Transformer \u548c Attention \u8fd9\u4e9b\u6838\u5fc3\u5f00\u59cb\u88ab\u5927\u5bb6\u91cd\u70b9\u5173\u6ce8\u3002 \u5982\u679c\u7528\u56fe\u6765\u8868\u8fbe Attention \u7684\u4f4d\u7f6e\u5927\u81f4\u662f\u4e0b\u9762\u7684\u6837\u5b50\uff1a","title":"\u672c\u8d28"},{"location":"llm/transformer/attention/#_3","text":"\u4e4b\u6240\u4ee5\u8981\u5f15\u5165 Attention \u673a\u5236\uff0c\u4e3b\u8981\u662f 3 \u4e2a\u539f\u56e0\uff1a \u53c2\u6570\u5c11 \uff1a\u6a21\u578b\u590d\u6742\u5ea6\u66f4 CNN\u3001RNN \u76f8\u6bd4\uff0c\u590d\u6742\u5ea6\u66f4\u5c0f\uff0c\u53c2\u6570\u4e5f\u66f4\u5c11\u3002\u5bf9\u7b97\u529b\u7684\u8981\u6c42\u4e5f\u5c31\u66f4\u5c11\u3002 \u901f\u5ea6\u5feb \uff1aAttention \u89e3\u51b3\u4e86 RNN \u4e0d\u80fd\u5e76\u884c\u8ba1\u7b97\u7684\u95ee\u9898\u3002Attention\u673a\u5236\u6bcf\u4e00\u6b65\u8ba1\u7b97\u4e0d\u4f9d\u8d56\u4e8e\u4e0a\u4e00\u6b65\u7684\u8ba1\u7b97\u7ed3\u679c\uff0c\u56e0\u6b64\u53ef\u4ee5\u548cCNN\u4e00\u6837\u5e76\u884c\u5904\u7406\u3002 \u6548\u679c\u597d \uff1a\u5728 Attention \u673a\u5236\u5f15\u5165\u4e4b\u524d\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u5927\u5bb6\u4e00\u76f4\u5f88\u82e6\u607c\uff1a\u957f\u8ddd\u79bb\u7684\u4fe1\u606f\u4f1a\u88ab\u5f31\u5316\uff0c\u5c31\u597d\u50cf\u8bb0\u5fc6\u80fd\u529b\u5f31\u7684\u4eba\uff0c\u8bb0\u4e0d\u4f4f\u8fc7\u53bb\u7684\u4e8b\u60c5\u662f\u4e00\u6837\u7684\u3002","title":"\u4e09\u5927\u4f18\u70b9"},{"location":"llm/transformer/attention/#_4","text":"\u4e0b\u9762\u7684\u52a8\u56fe\u6f14\u793a\u4e86 attention \u5f15\u5165 Encoder-Decoder \u6846\u67b6\u4e0b\uff0c\u5b8c\u6210\u673a\u5668\u7ffb\u8bd1\u4efb\u52a1\u7684\u5927\u81f4\u6d41\u7a0b\u3002 \u4f46\u662f\uff0cAttention \u5e76\u4e0d\u4e00\u5b9a\u8981\u5728 Encoder-Decoder \u6846\u67b6\u4e0b\u4f7f\u7528\u7684\uff0c\u4ed6\u662f\u53ef\u4ee5\u8131\u79bb Encoder-Decoder \u6846\u67b6\u7684\u3002 Attention \u539f\u7406\u5206\u4e3a 3 \u6b65\uff1a query \u548c key \u8fdb\u884c\u76f8\u4f3c\u5ea6\u8ba1\u7b97\uff0c\u5f97\u5230\u6743\u503c \u5c06\u6743\u503c\u8fdb\u884c\u5f52\u4e00\u5316\uff0c\u5f97\u5230\u76f4\u63a5\u53ef\u7528\u7684\u6743\u91cd \u5c06\u6743\u91cd\u548c value \u8fdb\u884c\u52a0\u6743\u6c42\u548c \u4ece\u4e0a\u9762\u7684\u5efa\u6a21\uff0c\u53ef\u4ee5\u5927\u81f4\u611f\u53d7\u5230 Attention \u7684\u601d\u8def\u7b80\u5355\uff0c \u56db\u4e2a\u5b57\u201c\u5e26\u6743\u6c42\u548c\u201d \uff0c\u5927\u9053\u81f3\u7b80\u3002","title":"\u539f\u7406"},{"location":"llm/transformer/attention/#n","text":"","title":"N \u79cd\u7c7b\u578b"},{"location":"llm/transformer/attention/#_5","text":"Soft Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u5e38\u89c1\u7684Attention\u65b9\u5f0f\uff0c\u5bf9\u6240\u6709key\u6c42\u6743\u91cd\u6982\u7387\uff0c\u6bcf\u4e2akey\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u6743\u91cd\uff0c\u662f\u4e00\u79cd\u5168\u5c40\u7684\u8ba1\u7b97\u65b9\u5f0f\uff08\u4e5f\u53ef\u4ee5\u53ebGlobal Attention\uff09\u3002\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u8f83\u7406\u6027\uff0c\u53c2\u8003\u4e86\u6240\u6709key\u7684\u5185\u5bb9\uff0c\u518d\u8fdb\u884c\u52a0\u6743\u3002\u4f46\u662f\u8ba1\u7b97\u91cf\u53ef\u80fd\u4f1a\u6bd4\u8f83\u5927\u4e00\u4e9b\u3002 Hard Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u662f\u76f4\u63a5\u7cbe\u51c6\u5b9a\u4f4d\u5230\u67d0\u4e2akey\uff0c\u5176\u4f59key\u5c31\u90fd\u4e0d\u7ba1\u4e86\uff0c\u76f8\u5f53\u4e8e\u8fd9\u4e2akey\u7684\u6982\u7387\u662f1\uff0c\u5176\u4f59key\u7684\u6982\u7387\u5168\u90e8\u662f0\u3002\u56e0\u6b64\u8fd9\u79cd\u5bf9\u9f50\u65b9\u5f0f\u8981\u6c42\u5f88\u9ad8\uff0c\u8981\u6c42\u4e00\u6b65\u5230\u4f4d\uff0c\u5982\u679c\u6ca1\u6709\u6b63\u786e\u5bf9\u9f50\uff0c\u4f1a\u5e26\u6765\u5f88\u5927\u7684\u5f71\u54cd\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u56e0\u4e3a\u4e0d\u53ef\u5bfc\uff0c\u4e00\u822c\u9700\u8981\u7528\u5f3a\u5316\u5b66\u4e60\u7684\u65b9\u6cd5\u8fdb\u884c\u8bad\u7ec3\u3002\uff08\u6216\u8005\u4f7f\u7528gumbel softmax\u4e4b\u7c7b\u7684\uff09 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5176\u5b9e\u662f\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\u7684\u4e00\u4e2a\u6298\u4e2d\uff0c\u5bf9\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\u8fdb\u884c\u8ba1\u7b97\u3002\u5148\u7528Hard\u65b9\u5f0f\u5b9a\u4f4d\u5230\u67d0\u4e2a\u5730\u65b9\uff0c\u4ee5\u8fd9\u4e2a\u70b9\u4e3a\u4e2d\u5fc3\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\uff0c\u5728\u8fd9\u4e2a\u5c0f\u533a\u57df\u5185\u7528Soft\u65b9\u5f0f\u6765\u7b97Attention\u3002","title":"\u8ba1\u7b97\u533a\u57df"},{"location":"llm/transformer/attention/#_6","text":"\u5047\u8bbe\u6211\u4eec\u8981\u5bf9\u4e00\u6bb5\u539f\u6587\u8ba1\u7b97Attention\uff0c\u8fd9\u91cc\u539f\u6587\u6307\u7684\u662f\u6211\u4eec\u8981\u505aattention\u7684\u6587\u672c\uff0c\u90a3\u4e48\u6240\u7528\u4fe1\u606f\u5305\u62ec\u5185\u90e8\u4fe1\u606f\u548c\u5916\u90e8\u4fe1\u606f\uff0c\u5185\u90e8\u4fe1\u606f\u6307\u7684\u662f\u539f\u6587\u672c\u8eab\u7684\u4fe1\u606f\uff0c\u800c\u5916\u90e8\u4fe1\u606f\u6307\u7684\u662f\u9664\u539f\u6587\u4ee5\u5916\u7684\u989d\u5916\u4fe1\u606f\u3002 General Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5229\u7528\u5230\u4e86\u5916\u90e8\u4fe1\u606f\uff0c\u5e38\u7528\u4e8e\u9700\u8981\u6784\u5efa\u4e24\u6bb5\u6587\u672c\u5173\u7cfb\u7684\u4efb\u52a1\uff0cquery\u4e00\u822c\u5305\u542b\u4e86\u989d\u5916\u4fe1\u606f\uff0c\u6839\u636e\u5916\u90e8query\u5bf9\u539f\u6587\u8fdb\u884c\u5bf9\u9f50\u3002 General Attention \u6bd4\u5982\u5728\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u4e2d\uff0c\u9700\u8981\u6784\u5efa\u95ee\u9898\u548c\u6587\u7ae0\u7684\u5173\u8054\uff0c\u5047\u8bbe\u73b0\u5728baseline\u662f\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u95ee\u9898\u5411\u91cfq\uff0c\u628a\u8fd9\u4e2aq\u548c\u6240\u6709\u7684\u6587\u7ae0\u8bcd\u5411\u91cf\u62fc\u63a5\u8d77\u6765\uff0c\u8f93\u5165\u5230LSTM\u4e2d\u8fdb\u884c\u5efa\u6a21\u3002\u90a3\u4e48\u5728\u8fd9\u4e2a\u6a21\u578b\u4e2d\uff0c\u6587\u7ae0\u6240\u6709\u8bcd\u5411\u91cf\u5171\u4eab\u540c\u4e00\u4e2a\u95ee\u9898\u5411\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u60f3\u8ba9\u6587\u7ae0\u6bcf\u4e00\u6b65\u7684\u8bcd\u5411\u91cf\u90fd\u6709\u4e00\u4e2a\u4e0d\u540c\u7684\u95ee\u9898\u5411\u91cf\uff0c\u4e5f\u5c31\u662f\uff0c\u5728\u6bcf\u4e00\u6b65\u4f7f\u7528\u6587\u7ae0\u5728\u8be5\u6b65\u4e0b\u7684\u8bcd\u5411\u91cf\u5bf9\u95ee\u9898\u6765\u7b97attention\uff0c\u8fd9\u91cc\u95ee\u9898\u5c5e\u4e8e\u539f\u6587\uff0c\u6587\u7ae0\u8bcd\u5411\u91cf\u5c31\u5c5e\u4e8e\u5916\u90e8\u4fe1\u606f\u3002 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u53ea\u4f7f\u7528\u5185\u90e8\u4fe1\u606f\uff0ckey\u548cvalue\u4ee5\u53caquery\u53ea\u548c\u8f93\u5165\u539f\u6587\u6709\u5173\uff0c\u5728self attention\u4e2d\uff0ckey=value=query\u3002\u65e2\u7136\u6ca1\u6709\u5916\u90e8\u4fe1\u606f\uff0c\u90a3\u4e48\u5728\u539f\u6587\u4e2d\u7684\u6bcf\u4e2a\u8bcd\u53ef\u4ee5\u8ddf\u8be5\u53e5\u5b50\u4e2d\u7684\u6240\u6709\u8bcd\u8fdb\u884cAttention\u8ba1\u7b97\uff0c\u76f8\u5f53\u4e8e\u5bfb\u627e\u539f\u6587\u5185\u90e8\u7684\u5173\u7cfb\u3002 Local Attention \u8fd8\u662f\u4e3e\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u7684\u4f8b\u5b50\uff0c\u4e0a\u9762\u7684baseline\u4e2d\u63d0\u5230\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u5411\u91cfq\uff0c\u90a3\u4e48\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u7528\u4e0aattention\uff0c\u53ea\u7528\u95ee\u9898\u81ea\u8eab\u7684\u4fe1\u606f\u53bb\u505aattention\uff0c\u800c\u4e0d\u5f15\u5165\u6587\u7ae0\u4fe1\u606f\u3002","title":"\u6240\u7528\u4fe1\u606f"},{"location":"llm/transformer/attention/#_7","text":"\u7ed3\u6784\u65b9\u9762\u6839\u636e\u662f\u5426\u5212\u5206\u5c42\u6b21\u5173\u7cfb\uff0c\u5206\u4e3a\u5355\u5c42 attention\uff0c\u591a\u5c42 attention \u548c \u591a\u5934 attention\uff1a \u5355\u5c42 Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u666e\u904d\u7684\u505a\u6cd5\uff0c\u7528\u4e00\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e00\u6b21attention\u3002 \u591a\u5c42 Attention \uff0c\u4e00\u822c\u7528\u4e8e\u6587\u672c\u5177\u6709\u5c42\u6b21\u5173\u7cfb\u7684\u6a21\u578b\uff0c\u5047\u8bbe\u6211\u4eec\u628a\u4e00\u4e2adocument\u5212\u5206\u6210\u591a\u4e2a\u53e5\u5b50\uff0c\u5728\u7b2c\u4e00\u5c42\uff0c\u6211\u4eec\u5206\u522b\u5bf9\u6bcf\u4e2a\u53e5\u5b50\u4f7f\u7528attention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u53e5\u5411\u91cf\uff08\u4e5f\u5c31\u662f\u5355\u5c42attention\uff09\uff1b\u5728\u7b2c\u4e8c\u5c42\uff0c\u6211\u4eec\u5bf9\u6240\u6709\u53e5\u5411\u91cf\u518d\u505aattention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u6587\u6863\u5411\u91cf\uff08\u4e5f\u662f\u4e00\u4e2a\u5355\u5c42attention\uff09\uff0c\u6700\u540e\u518d\u7528\u8fd9\u4e2a\u6587\u6863\u5411\u91cf\u53bb\u505a\u4efb\u52a1\u3002 \u591a\u5934 Attention \uff0c\u8fd9\u662fAttention is All You Need\u4e2d\u63d0\u5230\u7684multi-head attention\uff0c\u7528\u5230\u4e86\u591a\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e86\u591a\u6b21attention\uff0c\u6bcf\u4e2aquery\u90fd\u5173\u6ce8\u5230\u539f\u6587\u7684\u4e0d\u540c\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u91cd\u590d\u505a\u591a\u6b21\u5355\u5c42attention\uff1a \\[ head_i = Attention(q_i, K, V) \\] \u6700\u540e\u518d\u628a\u8fd9\u4e9b\u7ed3\u679c\u62fc\u63a5\u8d77\u6765\uff1a \\[ MultiHead(Q, K, V) = Concat(head_1, ..., head_h)W^O \\]","title":"\u7ed3\u6784\u5c42\u6b21"},{"location":"llm/transformer/attention/#_8","text":"\u4ece\u6a21\u578b\u4e0a\u770b\uff0cAttention \u4e00\u822c\u7528\u5728 CNN \u548c LSTM \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u7eaf Attention \u8ba1\u7b97\u3002 CNN + Attention CNN\u7684\u5377\u79ef\u64cd\u4f5c\u53ef\u4ee5\u63d0\u53d6\u91cd\u8981\u7279\u5f81\uff0c\u6211\u89c9\u5f97\u8fd9\u4e5f\u7b97\u662fAttention\u7684\u601d\u60f3\uff0c\u4f46\u662fCNN\u7684\u5377\u79ef\u611f\u53d7\u89c6\u91ce\u662f\u5c40\u90e8\u7684\uff0c\u9700\u8981\u901a\u8fc7\u53e0\u52a0\u591a\u5c42\u5377\u79ef\u533a\u53bb\u6269\u5927\u89c6\u91ce\u3002\u53e6\u5916\uff0cMax Pooling\u76f4\u63a5\u63d0\u53d6\u6570\u503c\u6700\u5927\u7684\u7279\u5f81\uff0c\u4e5f\u50cf\u662fhard attention\u7684\u601d\u60f3\uff0c\u76f4\u63a5\u9009\u4e2d\u67d0\u4e2a\u7279\u5f81\u3002 CNN\u4e0a\u52a0Attention\u53ef\u4ee5\u52a0\u5728\u8fd9\u51e0\u65b9\u9762\uff1a a. \u5728\u5377\u79ef\u64cd\u4f5c\u524d\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-1\uff0c\u8fd9\u4e2a\u4efb\u52a1\u662f\u6587\u672c\u8574\u542b\u4efb\u52a1\u9700\u8981\u5904\u7406\u4e24\u6bb5\u6587\u672c\uff0c\u540c\u65f6\u5bf9\u4e24\u6bb5\u8f93\u5165\u7684\u5e8f\u5217\u5411\u91cf\u8fdb\u884cattention\uff0c\u8ba1\u7b97\u51fa\u7279\u5f81\u5411\u91cf\uff0c\u518d\u62fc\u63a5\u5230\u539f\u59cb\u5411\u91cf\u4e2d\uff0c\u4f5c\u4e3a\u5377\u79ef\u5c42\u7684\u8f93\u5165\u3002 b. \u5728\u5377\u79ef\u64cd\u4f5c\u540e\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-2\uff0c\u5bf9\u4e24\u6bb5\u6587\u672c\u7684\u5377\u79ef\u5c42\u7684\u8f93\u51fa\u505aattention\uff0c\u4f5c\u4e3apooling\u5c42\u7684\u8f93\u5165\u3002 c. \u5728pooling\u5c42\u505aattention\uff0c\u4ee3\u66ffmax pooling\u3002\u6bd4\u5982Attention pooling\uff0c\u9996\u5148\u6211\u4eec\u7528LSTM\u5b66\u5230\u4e00\u4e2a\u6bd4\u8f83\u597d\u7684\u53e5\u5411\u91cf\uff0c\u4f5c\u4e3aquery\uff0c\u7136\u540e\u7528CNN\u5148\u5b66\u4e60\u5230\u4e00\u4e2a\u7279\u5f81\u77e9\u9635\u4f5c\u4e3akey\uff0c\u518d\u7528query\u5bf9key\u4ea7\u751f\u6743\u91cd\uff0c\u8fdb\u884cattention\uff0c\u5f97\u5230\u6700\u540e\u7684\u53e5\u5411\u91cf\u3002 LSTM+Attention LSTM\u5185\u90e8\u6709Gate\u673a\u5236\uff0c\u5176\u4e2dinput gate\u9009\u62e9\u54ea\u4e9b\u5f53\u524d\u4fe1\u606f\u8fdb\u884c\u8f93\u5165\uff0cforget gate\u9009\u62e9\u9057\u5fd8\u54ea\u4e9b\u8fc7\u53bb\u4fe1\u606f\uff0c\u6211\u89c9\u5f97\u8fd9\u7b97\u662f\u4e00\u5b9a\u7a0b\u5ea6\u7684Attention\u4e86\uff0c\u800c\u4e14\u53f7\u79f0\u53ef\u4ee5\u89e3\u51b3\u957f\u671f\u4f9d\u8d56\u95ee\u9898\uff0c\u5b9e\u9645\u4e0aLSTM\u9700\u8981\u4e00\u6b65\u4e00\u6b65\u53bb\u6355\u6349\u5e8f\u5217\u4fe1\u606f\uff0c\u5728\u957f\u6587\u672c\u4e0a\u7684\u8868\u73b0\u662f\u4f1a\u968f\u7740step\u589e\u52a0\u800c\u6162\u6162\u8870\u51cf\uff0c\u96be\u4ee5\u4fdd\u7559\u5168\u90e8\u7684\u6709\u7528\u4fe1\u606f\u3002 LSTM\u901a\u5e38\u9700\u8981\u5f97\u5230\u4e00\u4e2a\u5411\u91cf\uff0c\u518d\u53bb\u505a\u4efb\u52a1\uff0c\u5e38\u7528\u65b9\u5f0f\u6709\uff1a a. \u76f4\u63a5\u4f7f\u7528\u6700\u540e\u7684hidden state\uff08\u53ef\u80fd\u4f1a\u635f\u5931\u4e00\u5b9a\u7684\u524d\u6587\u4fe1\u606f\uff0c\u96be\u4ee5\u8868\u8fbe\u5168\u6587\uff09 b. \u5bf9\u6240\u6709step\u4e0b\u7684hidden state\u8fdb\u884c\u7b49\u6743\u5e73\u5747\uff08\u5bf9\u6240\u6709step\u4e00\u89c6\u540c\u4ec1\uff09\u3002 c. Attention\u673a\u5236\uff0c\u5bf9\u6240\u6709step\u7684hidden state\u8fdb\u884c\u52a0\u6743\uff0c\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u6574\u6bb5\u6587\u672c\u4e2d\u6bd4\u8f83\u91cd\u8981\u7684hidden state\u4fe1\u606f\u3002\u6027\u80fd\u6bd4\u524d\u9762\u4e24\u79cd\u8981\u597d\u4e00\u70b9\uff0c\u800c\u65b9\u4fbf\u53ef\u89c6\u5316\u89c2\u5bdf\u54ea\u4e9bstep\u662f\u91cd\u8981\u7684\uff0c\u4f46\u662f\u8981\u5c0f\u5fc3\u8fc7\u62df\u5408\uff0c\u800c\u4e14\u4e5f\u589e\u52a0\u4e86\u8ba1\u7b97\u91cf\u3002 \u7eafAttention Attention is all you need\uff0c\u6ca1\u6709\u7528\u5230CNN/RNN\uff0c\u4e4d\u4e00\u542c\u4e5f\u662f\u4e00\u80a1\u6e05\u6d41\u4e86\uff0c\u4f46\u662f\u4ed4\u7ec6\u4e00\u770b\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f\u4e00\u5806\u5411\u91cf\u53bb\u8ba1\u7b97attention\u3002","title":"\u6a21\u578b\u65b9\u9762"},{"location":"llm/transformer/attention/#_9","text":"\u5728\u505aattention\u7684\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97query\u548c\u67d0\u4e2akey\u7684\u5206\u6570\uff08\u76f8\u4f3c\u5ea6\uff09\uff0c\u5e38\u7528\u65b9\u6cd5\u6709\uff1a \u70b9\u4e58\uff1a \\(score(q,k)=q^\\top k\\) \u77e9\u9635\u76f8\u4e58\uff1a \\(score(q,k)=q^\\top Wk\\) \u4f59\u5f26\u76f8\u4f3c\u5ea6\uff1a \\(score(q,k)=\\frac{q^\\top k}{\\|q\\| \\cdot \\|k\\|}\\) \u4e32\u8054\u65b9\u5f0f\uff0c\u628aq\u548ck\u62fc\u63a5\u8d77\u6765\uff1a \\(score(q,k)=W[q;k]\\) \u591a\u5c42\u611f\u77e5\u673a\uff1a \\(score(q,k)=v_a^\\top tanh(Wq+Uk)\\)","title":"\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u65b9\u5f0f"},{"location":"llm/transformer/attention/#reference","text":"Encoder-Decoder \u548c Seq2Seq \u4e00\u6587\u770b\u61c2 Attention\uff08\u672c\u8d28\u539f\u7406+3\u5927\u4f18\u70b9+5\u5927\u7c7b\u578b\uff09 \u904d\u5730\u5f00\u82b1\u7684 Attention\uff0c\u4f60\u771f\u7684\u61c2\u5417\uff1f","title":"Reference"},{"location":"llm/transformer/bert/","text":"BERT \u00b6 \u7ea6 1558 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstruct BERT \u4f5c\u4e3a NLP \u9884\u8bad\u7ec3\u6a21\u578b\u91cc\u7684\u7ecf\u5178\u6a21\u578b\u4e4b\u4e00\uff0c\u6548\u679c\u975e\u5e38\u597d\u3002 BERT \u7684\u6a21\u578b\u4ee3\u7801\u548c\u6a21\u578b\u53c2\u6570\u5f00\u6e90\uff0c\u90fd\u53ef\u4ee5\u57fa\u4e8e\u8fd9\u4e2a\u5f3a\u5927\u7684\u6a21\u578b\u7ec4\u4ef6\u642d\u5efa\u81ea\u5df1\u7684 NLP \u7cfb\u7edf\uff0c\u4e5f\u8282\u7701\u5f00\u59cb\u8bad\u7ec3\u8bed\u8a00\u5904\u7406\u6a21\u578b\u6240\u9700\u8981\u7684\u65f6\u95f4\u3001\u7cbe\u529b\u3001\u77e5\u8bc6\u548c\u8d44\u6e90\u3002 BERT\u7684\u5168\u79f0\u662f Bidirectional Encoder Representation from Transformers\uff0c\u5373\u53cc\u5411 Transformer \u7684 Encoder\uff0c\u56e0\u4e3adecoder\u662f\u4e0d\u80fd\u83b7\u8981\u9884\u6d4b\u7684\u4fe1\u606f\u7684\u3002 \u6a21\u578b\u7684\u4e3b\u8981\u521b\u65b0\u70b9\u90fd\u5728pre-train\u65b9\u6cd5\u4e0a\uff0c\u5373\u7528\u4e86Masked LM\u548cNext Sentence Prediction\u4e24\u79cd\u65b9\u6cd5\u5206\u522b\u6355\u6349\u8bcd\u8bed\u548c\u53e5\u5b50\u7ea7\u522b\u7684representation\u3002 Introduction \u00b6 BERT \u9996\u5148\u5728\u5927\u89c4\u6a21\u65e0\u76d1\u7763\u8bed\u6599\u4e0a\u8fdb\u884c\u9884\u8bad\u7ec3\uff0c\u7136\u540e\u5728\u9884\u8bad\u7ec3\u597d\u7684\u53c2\u6570\u57fa\u7840\u4e0a\u589e\u52a0\u4e00\u4e2a\u4e0e\u4efb\u52a1\u76f8\u5173\u7684\u795e\u7ecf\u7f51\u7edc\u5c42\uff0c\u5e76\u5728\u8be5\u4efb\u52a1\u7684\u6570\u636e\u4e0a\u8fdb\u884c\u5fae\u8c03\uff0c\u6700\u7ec8\u53d6\u5f97\u5f88\u597d\u7684\u6548\u679c\u3002 BERT\u7684\u8bad\u7ec3\u8fc7\u7a0b\u53ef\u4ee5\u7b80\u8ff0\u4e3a\uff1a\u9884\u8bad\u7ec3+\u5fae\u8c03\uff08finetune\uff09\uff0c\u8fd9\u662f\u8fd1\u51e0\u5e74 NLP \u89e3\u51b3\u65b9\u6848\u7684\u4e3b\u6d41\u8303\u5f0f\u3002 \u6a21\u578b\u7ed3\u6784 \u00b6 BERT\u6a21\u578b\u7684\u7ed3\u6784\u5982\u4e0b\u56fe\u6700\u5de6\uff1a \u5bf9\u6bd4 OpenAI GPT\uff0cBERT \u662f\u53cc\u5411\u7684 Transformer block \u8fde\u63a5\uff0c\u5c31\u50cf\u5355\u5411 RNN \u548c\u53cc\u5411 RNN \u7684\u533a\u522b\uff0c\u6548\u679c\u4f1a\u66f4\u597d\u3002 \u5bf9\u6bd4 ELMo\uff0c\u867d\u7136\u90fd\u662f\u201c\u53cc\u5411\u201d\uff0c\u4f46\u76ee\u6807\u51fd\u6570\u4e0d\u540c\u3002 ELMo \u662f\u5206\u522b\u4ee5 \\(P(w_i|w_1,...,w_{i-1})\\) \u548c \\(P(w_i|w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\uff0c\u72ec\u7acb\u8bad\u7ec3\u51fa\u4e24\u4e2a representation \u7136\u540e\u8fde\u63a5 BERT \u662f\u4ee5 \\(P(w_i | w_1,...,w_{i-1},w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\u8bad\u7ec3 LM \u547d\u540d\u8868\u793a\u5c42\u6570\u4e3aL\uff08Transformer Blocks\uff09\uff0c\u9690\u85cf\u5c42\u6570\u4e3aH\uff0c\u81ea\u6ce8\u610f\u529b\u5934\u6570\u91cf\u4e3aA\u3002\u539f\u59cb\u8bba\u6587\u4e2d\u7684\u4e24\u79cd\u6a21\u578b\uff1a BERT_base(L=12,H=768,A=12; parameters=110M) BERT_large(L=24,H=1024,A=16; parameters=340M) Embedding \u00b6 \u8fd9\u91cc\u7684 Embedding \u7531\u4e09\u79cd Embedding \u6c42\u548c\u7ec4\u6210\uff1a Token Embedding \uff1a\u8bcd\u5411\u91cf\uff0c\u7b2c\u4e00\u4e2a\u5355\u8bcd\u662f CLS \u6807\u5fd7\uff0c\u53ef\u4ee5\u7528\u4e8e\u4e4b\u540e\u7684\u5206\u7c7b\u4efb\u52a1 Segment Embedding \uff1a\u53e5\u5b50\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u4e24\u4e2a\u53e5\u5b50\uff0c\u56e0\u4e3a\u9884\u8bad\u7ec3\u4e0d\u5149\u505a LM \u8fd8\u8981\u505a\u4ee5\u4e24\u4e2a\u53e5\u5b50\u4e3a\u8f93\u5165\u7684\u5206\u7c7b\u4efb\u52a1 Position Embedding \uff1a\u4f4d\u7f6e\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u5355\u8bcd\u5728\u53e5\u5b50\u4e2d\u7684\u4f4d\u7f6e\uff0c\u548c\u4e4b\u524d\u7684 Transformer \u4e0d\u4e00\u6837\uff0c\u4e0d\u662f\u4e09\u89d2\u51fd\u6570\u800c\u662f\u5b66\u4e60\u51fa\u6765\u7684 Pre-training \u00b6 Masked LM \uff08MLM\uff09 \u00b6 \u7b2c\u4e00\u6b65\u9884\u8bad\u7ec3\u7684\u76ee\u6807\u5c31\u662f\u505a\u9884\u8a00\u6a21\u578b\uff0c\u4ece\u4e0a\u6587\u6a21\u578b\u7ed3\u6784\u4e2d\u770b\u5230\u4e86\u8fd9\u4e2a\u6a21\u578b\u7684\u4e0d\u540c\uff0c\u5373 bidirectional\u3002 \u4e3a\u4ec0\u4e48\u8981 bidirectional \u5982\u679c\u4f7f\u7528\u9884\u8bad\u7ec3\u6a21\u578b\u5904\u7406\u5176\u4ed6\u4efb\u52a1\uff0c\u90a3\u4eba\u4eec\u60f3\u8981\u7684\u4e0d\u6b62\u67d0\u4e2a\u8bcd\u7684\u5de6\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u662f\u5de6\u53f3\u4e24\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u8003\u8651\u5230\u8fd9\u70b9\u7684\u6a21\u578b ELMo \u53ea\u662f\u5c06 left-to-right \u548c right-to-left \u5206\u522b\u8bad\u7ec3\u62fc\u63a5\u8d77\u6765\u3002\u76f4\u89c9\u4e0a\u6765\u8bb2\u6211\u4eec\u5176\u5b9e\u60f3\u8981\u4e00\u4e2a deeply bidirectional \u7684\u6a21\u578b\uff0c\u4f46\u662f\u666e\u901a\u7684LM\u53c8\u65e0\u6cd5\u505a\u5230\uff0c\u56e0\u4e3a\u5728\u8bad\u7ec3\u65f6\u53ef\u80fd\u4f1a\u201c\u7a7f\u8d8a\u201d\uff0c\u6240\u4ee5\u4f5c\u8005\u7528\u4e86\u4e00\u4e2a\u52a0mask\u7684trick\u3002 \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4f5c\u8005\u968f\u673a mask 15% \u7684 token\uff0c\u800c\u4e0d\u662f\u628a\u50cf CBOW \u4e00\u6837\u628a\u6bcf\u4e2a\u8bcd\u90fd\u9884\u6d4b\u4e00\u904d\u3002 \u6700\u7ec8\u7684\u635f\u5931\u51fd\u6570\u53ea\u8ba1\u7b97\u88ab mask \u6389\u90a3\u4e48 token \u3002 mask \u5982\u4f55\u505a\u4e5f\u662f\u6709\u6280\u5de7\u7684\uff0c\u5982\u679c\u4e00\u76f4\u7528\u6807\u8bb0 [MASK] \u4ee3\u66ff\uff08\u5728\u5b9e\u9645\u9884\u6d4b\u65f6\u662f\u78b0\u4e0d\u5230\u8fd9\u4e2a\u6807\u8bb0\u7684\uff09\u4f1a\u5f71\u54cd\u6a21\u578b\uff0c\u6240\u4ee5\u968f\u673a mask \u7684\u65f6\u5019 10% \u7684\u5355\u8bcd\u4f1a\u88ab\u66ff\u4ee3\u6210\u5176\u4ed6\u5355\u8bcd\uff0c10% \u7684\u5355\u8bcd\u4e0d\u66ff\u6362\uff0c\u5269\u4e0b 80% \u624d\u88ab\u66ff\u6362\u4e3a [MASK]\u3002\u8981\u6ce8\u610f\u7684\u662f Masked LM \u9884\u8bad\u7ec3\u9636\u6bb5\u6a21\u578b\u662f\u4e0d\u77e5\u9053\u771f\u6b63\u88ab mask \u7684\u54ea\u4e2a\u8bcd\uff0c\u6240\u4ee5\u6a21\u578b\u6bcf\u4e2a\u8bcd\u90fd\u8981\u5173\u6ce8\u3002 \u4e3a\u4ec0\u4e48\u8fd9\u4e48\u5206\u914d\u6bd4\u4f8b \u5982\u679c\u53e5\u5b50\u4e2d\u7684\u67d0\u4e2aToken100%\u90fd\u4f1a\u88abmask\u6389\uff0c\u90a3\u4e48\u5728fine-tuning\u7684\u65f6\u5019\u6a21\u578b\u5c31\u4f1a\u6709\u4e00\u4e9b\u6ca1\u6709\u89c1\u8fc7\u7684\u5355\u8bcd\u3002\u52a0\u5165\u968f\u673aToken\u7684\u539f\u56e0\u662f\u56e0\u4e3aTransformer\u8981\u4fdd\u6301\u5bf9\u6bcf\u4e2a\u8f93\u5165token\u7684\u5206\u5e03\u5f0f\u8868\u5f81\uff0c\u5426\u5219\u6a21\u578b\u5c31\u4f1a\u8bb0\u4f4f\u8fd9\u4e2a[mask]\u662ftoken \u2019hairy\u2018\u3002\u81f3\u4e8e\u5355\u8bcd\u5e26\u6765\u7684\u8d1f\u9762\u5f71\u54cd\uff0c\u56e0\u4e3a\u4e00\u4e2a\u5355\u8bcd\u88ab\u968f\u673a\u66ff\u6362\u6389\u7684\u6982\u7387\u53ea\u670915%*10% =1.5%\uff0c\u8fd9\u4e2a\u8d1f\u9762\u5f71\u54cd\u5176\u5b9e\u662f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002 \u56e0\u4e3a\u5e8f\u5217\u957f\u5ea6\u592a\u5927\uff08512\uff09\u4f1a\u5f71\u54cd\u8bad\u7ec3\u901f\u5ea6\uff0c\u6240\u4ee5 90% \u7684 steps \u90fd\u7528 seq_len=128\uff0c10% \u7684 steps \u7528 seq_len=512\u3002 Next Sentence Prediction \uff08NSP\uff09 \u00b6 \u56e0\u4e3a\u6d89\u53ca\u5230QA\u548cNLI\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u589e\u52a0\u4e86\u7b2c\u4e8c\u4e2a\u9884\u8bad\u7ec3\u4efb\u52a1\uff0c\u76ee\u7684\u662f\u8ba9\u6a21\u578b\u7406\u89e3\u4e24\u4e2a\u53e5\u5b50\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 Next Sentence Prediction\uff08NSP\uff09\u7684\u4efb\u52a1\u662f\u5224\u65ad\u53e5\u5b50B\u662f\u5426\u662f\u53e5\u5b50A\u7684\u4e0b\u6587\u3002\u5982\u679c\u662f\u7684\u8bdd\u8f93\u51fa\u2019IsNext\u2018\uff0c\u5426\u5219\u8f93\u51fa\u2019NotNext\u2018\u3002\u8bad\u7ec3\u6570\u636e\u7684\u751f\u6210\u65b9\u5f0f\u662f\u4ece\u5e73\u884c\u8bed\u6599\u4e2d\u968f\u673a\u62bd\u53d6\u7684\u8fde\u7eed\u4e24\u53e5\u8bdd\uff0c\u5176\u4e2d50%\u4fdd\u7559\u62bd\u53d6\u7684\u4e24\u53e5\u8bdd\uff0c\u5b83\u4eec\u7b26\u5408IsNext\u5173\u7cfb\uff0c\u53e6\u591650%\u7684\u7b2c\u4e8c\u53e5\u8bdd\u662f\u968f\u673a\u4ece\u9884\u6599\u4e2d\u63d0\u53d6\u7684\uff0c\u5b83\u4eec\u7684\u5173\u7cfb\u662fNotNext\u7684\u3002 \u9884\u8bad\u7ec3\u7684\u65f6\u5019\u53ef\u4ee5\u8fbe\u5230 97%-98% \u7684\u51c6\u786e\u5ea6\u3002 \u4f5c\u8005\u7279\u610f\u8bf4\u4e86\u8bed\u6599\u7684\u9009\u53d6\u5f88\u5173\u952e\uff0c\u8981\u9009\u7528document-level\u7684\u800c\u4e0d\u662fsentence-level\u7684\uff0c\u8fd9\u6837\u53ef\u4ee5\u5177\u5907\u62bd\u8c61\u8fde\u7eed\u957f\u5e8f\u5217\u7279\u5f81\u7684\u80fd\u529b\u3002 Fine-tuning \u00b6 \u5fae\u8c03\u662f\u7b80\u5355\u7684\uff0c\u56e0\u4e3aTransformer\u4e2d\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236\u5141\u8bb8BERT\u901a\u8fc7\u4ea4\u6362\u9002\u5f53\u7684\u8f93\u5165\u548c\u8f93\u51fa\u6765\u5efa\u6a21\u8bb8\u591a\u4e0b\u6e38\u4efb\u52a1--\u4e0d\u7ba1\u5b83\u4eec\u6d89\u53ca\u5355\u4e2a\u6587\u672c\u8fd8\u662f\u6587\u672c\u5bf9\u3002\u5bf9\u4e8eNSP\u4efb\u52a1\u6765\u8bf4\uff0c\u5176\u6761\u4ef6\u6982\u7387\u8868\u793a\u4e3a \\(P=softmax(CW^T)\\) \uff0c\u5176\u4e2d C \u662f BERT \u8f93\u51fa\u4e2d\u7684 [CLS] \u7b26\u53f7\uff0cW \u662f\u53ef\u5b66\u4e60\u7684\u6743\u503c\u77e9\u9635\u3002 \u5fae\u8c03\u7684\u4efb\u52a1\u5305\u62ec\uff1a \u57fa\u4e8e\u53e5\u5b50\u5bf9\u7684\u5206\u7c7b\u4efb\u52a1 \u57fa\u4e8e\u5355\u4e2a\u53e5\u5b50\u7684\u5206\u7c7b\u4efb\u52a1 \u95ee\u7b54\u4efb\u52a1 \u547d\u540d\u5b9e\u4f53\u8bc6\u522bNER \u4e0b\u56fe\u5c55\u793a\u4e86BERT\u572811\u4e2a\u4e0d\u540c\u4efb\u52a1\u4e2d\u7684\u6a21\u578b\uff0c\u5b83\u4eec\u53ea\u9700\u8981\u5728BERT\u7684\u57fa\u7840\u4e0a\u518d\u6dfb\u52a0\u4e00\u4e2a\u8f93\u51fa\u5c42\u4fbf\u53ef\u4ee5\u5b8c\u6210\u5bf9\u7279\u5b9a\u4efb\u52a1\u7684\u5fae\u8c03\u3002\u8fd9\u4e9b\u4efb\u52a1\u7c7b\u4f3c\u4e8e\u6211\u4eec\u505a\u8fc7\u7684\u6587\u79d1\u8bd5\u5377\uff0c\u5176\u4e2d\u6709\u9009\u62e9\u9898\uff0c\u7b80\u7b54\u9898\u7b49\u7b49\u3002\u56fe3\u4e2d\u5176\u4e2dTok\u8868\u793a\u4e0d\u540c\u7684Token\uff0cE \u8868\u793a\u5d4c\u5165\u5411\u91cf\uff0c \\(T_i\\) \u8868\u793a\u7b2c i \u4e2aToken\u5728\u7ecf\u8fc7BERT\u5904\u7406\u4e4b\u540e\u5f97\u5230\u7684\u7279\u5f81\u5411\u91cf\u3002 \u6574\u4f53 Fine-Tuning \u8fc7\u7a0b\uff1a \u6784\u5efa\u56fe\u7ed3\u6784\uff0c\u622a\u53d6\u76ee\u6807\u5f20\u91cf\uff0c\u6dfb\u52a0\u65b0\u5c42 \u5939\u5728\u76ee\u6807\u5f20\u91cf\u6743\u91cd \u8bad\u7ec3\u65b0\u5c42 \u5168\u5c40\u5fae\u8c03 Reference \u00b6 \u56fe\u89e3 BERT \u3010\u6df1\u5ea6\u5b66\u4e60\u3011BERT \u8be6\u89e3 \u3010NLP\u3011Google BERT\u6a21\u578b\u539f\u7406\u8be6\u89e3 NLP\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff08\u4e94\uff09BERT\u9884\u8bad\u7ec3\u6a21\u578b","title":"BERT"},{"location":"llm/transformer/bert/#bert","text":"\u7ea6 1558 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstruct BERT \u4f5c\u4e3a NLP \u9884\u8bad\u7ec3\u6a21\u578b\u91cc\u7684\u7ecf\u5178\u6a21\u578b\u4e4b\u4e00\uff0c\u6548\u679c\u975e\u5e38\u597d\u3002 BERT \u7684\u6a21\u578b\u4ee3\u7801\u548c\u6a21\u578b\u53c2\u6570\u5f00\u6e90\uff0c\u90fd\u53ef\u4ee5\u57fa\u4e8e\u8fd9\u4e2a\u5f3a\u5927\u7684\u6a21\u578b\u7ec4\u4ef6\u642d\u5efa\u81ea\u5df1\u7684 NLP \u7cfb\u7edf\uff0c\u4e5f\u8282\u7701\u5f00\u59cb\u8bad\u7ec3\u8bed\u8a00\u5904\u7406\u6a21\u578b\u6240\u9700\u8981\u7684\u65f6\u95f4\u3001\u7cbe\u529b\u3001\u77e5\u8bc6\u548c\u8d44\u6e90\u3002 BERT\u7684\u5168\u79f0\u662f Bidirectional Encoder Representation from Transformers\uff0c\u5373\u53cc\u5411 Transformer \u7684 Encoder\uff0c\u56e0\u4e3adecoder\u662f\u4e0d\u80fd\u83b7\u8981\u9884\u6d4b\u7684\u4fe1\u606f\u7684\u3002 \u6a21\u578b\u7684\u4e3b\u8981\u521b\u65b0\u70b9\u90fd\u5728pre-train\u65b9\u6cd5\u4e0a\uff0c\u5373\u7528\u4e86Masked LM\u548cNext Sentence Prediction\u4e24\u79cd\u65b9\u6cd5\u5206\u522b\u6355\u6349\u8bcd\u8bed\u548c\u53e5\u5b50\u7ea7\u522b\u7684representation\u3002","title":"BERT"},{"location":"llm/transformer/bert/#introduction","text":"BERT \u9996\u5148\u5728\u5927\u89c4\u6a21\u65e0\u76d1\u7763\u8bed\u6599\u4e0a\u8fdb\u884c\u9884\u8bad\u7ec3\uff0c\u7136\u540e\u5728\u9884\u8bad\u7ec3\u597d\u7684\u53c2\u6570\u57fa\u7840\u4e0a\u589e\u52a0\u4e00\u4e2a\u4e0e\u4efb\u52a1\u76f8\u5173\u7684\u795e\u7ecf\u7f51\u7edc\u5c42\uff0c\u5e76\u5728\u8be5\u4efb\u52a1\u7684\u6570\u636e\u4e0a\u8fdb\u884c\u5fae\u8c03\uff0c\u6700\u7ec8\u53d6\u5f97\u5f88\u597d\u7684\u6548\u679c\u3002 BERT\u7684\u8bad\u7ec3\u8fc7\u7a0b\u53ef\u4ee5\u7b80\u8ff0\u4e3a\uff1a\u9884\u8bad\u7ec3+\u5fae\u8c03\uff08finetune\uff09\uff0c\u8fd9\u662f\u8fd1\u51e0\u5e74 NLP \u89e3\u51b3\u65b9\u6848\u7684\u4e3b\u6d41\u8303\u5f0f\u3002","title":"Introduction"},{"location":"llm/transformer/bert/#_1","text":"BERT\u6a21\u578b\u7684\u7ed3\u6784\u5982\u4e0b\u56fe\u6700\u5de6\uff1a \u5bf9\u6bd4 OpenAI GPT\uff0cBERT \u662f\u53cc\u5411\u7684 Transformer block \u8fde\u63a5\uff0c\u5c31\u50cf\u5355\u5411 RNN \u548c\u53cc\u5411 RNN \u7684\u533a\u522b\uff0c\u6548\u679c\u4f1a\u66f4\u597d\u3002 \u5bf9\u6bd4 ELMo\uff0c\u867d\u7136\u90fd\u662f\u201c\u53cc\u5411\u201d\uff0c\u4f46\u76ee\u6807\u51fd\u6570\u4e0d\u540c\u3002 ELMo \u662f\u5206\u522b\u4ee5 \\(P(w_i|w_1,...,w_{i-1})\\) \u548c \\(P(w_i|w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\uff0c\u72ec\u7acb\u8bad\u7ec3\u51fa\u4e24\u4e2a representation \u7136\u540e\u8fde\u63a5 BERT \u662f\u4ee5 \\(P(w_i | w_1,...,w_{i-1},w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\u8bad\u7ec3 LM \u547d\u540d\u8868\u793a\u5c42\u6570\u4e3aL\uff08Transformer Blocks\uff09\uff0c\u9690\u85cf\u5c42\u6570\u4e3aH\uff0c\u81ea\u6ce8\u610f\u529b\u5934\u6570\u91cf\u4e3aA\u3002\u539f\u59cb\u8bba\u6587\u4e2d\u7684\u4e24\u79cd\u6a21\u578b\uff1a BERT_base(L=12,H=768,A=12; parameters=110M) BERT_large(L=24,H=1024,A=16; parameters=340M)","title":"\u6a21\u578b\u7ed3\u6784"},{"location":"llm/transformer/bert/#embedding","text":"\u8fd9\u91cc\u7684 Embedding \u7531\u4e09\u79cd Embedding \u6c42\u548c\u7ec4\u6210\uff1a Token Embedding \uff1a\u8bcd\u5411\u91cf\uff0c\u7b2c\u4e00\u4e2a\u5355\u8bcd\u662f CLS \u6807\u5fd7\uff0c\u53ef\u4ee5\u7528\u4e8e\u4e4b\u540e\u7684\u5206\u7c7b\u4efb\u52a1 Segment Embedding \uff1a\u53e5\u5b50\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u4e24\u4e2a\u53e5\u5b50\uff0c\u56e0\u4e3a\u9884\u8bad\u7ec3\u4e0d\u5149\u505a LM \u8fd8\u8981\u505a\u4ee5\u4e24\u4e2a\u53e5\u5b50\u4e3a\u8f93\u5165\u7684\u5206\u7c7b\u4efb\u52a1 Position Embedding \uff1a\u4f4d\u7f6e\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u5355\u8bcd\u5728\u53e5\u5b50\u4e2d\u7684\u4f4d\u7f6e\uff0c\u548c\u4e4b\u524d\u7684 Transformer \u4e0d\u4e00\u6837\uff0c\u4e0d\u662f\u4e09\u89d2\u51fd\u6570\u800c\u662f\u5b66\u4e60\u51fa\u6765\u7684","title":"Embedding"},{"location":"llm/transformer/bert/#pre-training","text":"","title":"Pre-training"},{"location":"llm/transformer/bert/#masked-lm-mlm","text":"\u7b2c\u4e00\u6b65\u9884\u8bad\u7ec3\u7684\u76ee\u6807\u5c31\u662f\u505a\u9884\u8a00\u6a21\u578b\uff0c\u4ece\u4e0a\u6587\u6a21\u578b\u7ed3\u6784\u4e2d\u770b\u5230\u4e86\u8fd9\u4e2a\u6a21\u578b\u7684\u4e0d\u540c\uff0c\u5373 bidirectional\u3002 \u4e3a\u4ec0\u4e48\u8981 bidirectional \u5982\u679c\u4f7f\u7528\u9884\u8bad\u7ec3\u6a21\u578b\u5904\u7406\u5176\u4ed6\u4efb\u52a1\uff0c\u90a3\u4eba\u4eec\u60f3\u8981\u7684\u4e0d\u6b62\u67d0\u4e2a\u8bcd\u7684\u5de6\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u662f\u5de6\u53f3\u4e24\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u8003\u8651\u5230\u8fd9\u70b9\u7684\u6a21\u578b ELMo \u53ea\u662f\u5c06 left-to-right \u548c right-to-left \u5206\u522b\u8bad\u7ec3\u62fc\u63a5\u8d77\u6765\u3002\u76f4\u89c9\u4e0a\u6765\u8bb2\u6211\u4eec\u5176\u5b9e\u60f3\u8981\u4e00\u4e2a deeply bidirectional \u7684\u6a21\u578b\uff0c\u4f46\u662f\u666e\u901a\u7684LM\u53c8\u65e0\u6cd5\u505a\u5230\uff0c\u56e0\u4e3a\u5728\u8bad\u7ec3\u65f6\u53ef\u80fd\u4f1a\u201c\u7a7f\u8d8a\u201d\uff0c\u6240\u4ee5\u4f5c\u8005\u7528\u4e86\u4e00\u4e2a\u52a0mask\u7684trick\u3002 \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4f5c\u8005\u968f\u673a mask 15% \u7684 token\uff0c\u800c\u4e0d\u662f\u628a\u50cf CBOW \u4e00\u6837\u628a\u6bcf\u4e2a\u8bcd\u90fd\u9884\u6d4b\u4e00\u904d\u3002 \u6700\u7ec8\u7684\u635f\u5931\u51fd\u6570\u53ea\u8ba1\u7b97\u88ab mask \u6389\u90a3\u4e48 token \u3002 mask \u5982\u4f55\u505a\u4e5f\u662f\u6709\u6280\u5de7\u7684\uff0c\u5982\u679c\u4e00\u76f4\u7528\u6807\u8bb0 [MASK] \u4ee3\u66ff\uff08\u5728\u5b9e\u9645\u9884\u6d4b\u65f6\u662f\u78b0\u4e0d\u5230\u8fd9\u4e2a\u6807\u8bb0\u7684\uff09\u4f1a\u5f71\u54cd\u6a21\u578b\uff0c\u6240\u4ee5\u968f\u673a mask \u7684\u65f6\u5019 10% \u7684\u5355\u8bcd\u4f1a\u88ab\u66ff\u4ee3\u6210\u5176\u4ed6\u5355\u8bcd\uff0c10% \u7684\u5355\u8bcd\u4e0d\u66ff\u6362\uff0c\u5269\u4e0b 80% \u624d\u88ab\u66ff\u6362\u4e3a [MASK]\u3002\u8981\u6ce8\u610f\u7684\u662f Masked LM \u9884\u8bad\u7ec3\u9636\u6bb5\u6a21\u578b\u662f\u4e0d\u77e5\u9053\u771f\u6b63\u88ab mask \u7684\u54ea\u4e2a\u8bcd\uff0c\u6240\u4ee5\u6a21\u578b\u6bcf\u4e2a\u8bcd\u90fd\u8981\u5173\u6ce8\u3002 \u4e3a\u4ec0\u4e48\u8fd9\u4e48\u5206\u914d\u6bd4\u4f8b \u5982\u679c\u53e5\u5b50\u4e2d\u7684\u67d0\u4e2aToken100%\u90fd\u4f1a\u88abmask\u6389\uff0c\u90a3\u4e48\u5728fine-tuning\u7684\u65f6\u5019\u6a21\u578b\u5c31\u4f1a\u6709\u4e00\u4e9b\u6ca1\u6709\u89c1\u8fc7\u7684\u5355\u8bcd\u3002\u52a0\u5165\u968f\u673aToken\u7684\u539f\u56e0\u662f\u56e0\u4e3aTransformer\u8981\u4fdd\u6301\u5bf9\u6bcf\u4e2a\u8f93\u5165token\u7684\u5206\u5e03\u5f0f\u8868\u5f81\uff0c\u5426\u5219\u6a21\u578b\u5c31\u4f1a\u8bb0\u4f4f\u8fd9\u4e2a[mask]\u662ftoken \u2019hairy\u2018\u3002\u81f3\u4e8e\u5355\u8bcd\u5e26\u6765\u7684\u8d1f\u9762\u5f71\u54cd\uff0c\u56e0\u4e3a\u4e00\u4e2a\u5355\u8bcd\u88ab\u968f\u673a\u66ff\u6362\u6389\u7684\u6982\u7387\u53ea\u670915%*10% =1.5%\uff0c\u8fd9\u4e2a\u8d1f\u9762\u5f71\u54cd\u5176\u5b9e\u662f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002 \u56e0\u4e3a\u5e8f\u5217\u957f\u5ea6\u592a\u5927\uff08512\uff09\u4f1a\u5f71\u54cd\u8bad\u7ec3\u901f\u5ea6\uff0c\u6240\u4ee5 90% \u7684 steps \u90fd\u7528 seq_len=128\uff0c10% \u7684 steps \u7528 seq_len=512\u3002","title":"Masked LM \uff08MLM\uff09"},{"location":"llm/transformer/bert/#next-sentence-prediction-nsp","text":"\u56e0\u4e3a\u6d89\u53ca\u5230QA\u548cNLI\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u589e\u52a0\u4e86\u7b2c\u4e8c\u4e2a\u9884\u8bad\u7ec3\u4efb\u52a1\uff0c\u76ee\u7684\u662f\u8ba9\u6a21\u578b\u7406\u89e3\u4e24\u4e2a\u53e5\u5b50\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 Next Sentence Prediction\uff08NSP\uff09\u7684\u4efb\u52a1\u662f\u5224\u65ad\u53e5\u5b50B\u662f\u5426\u662f\u53e5\u5b50A\u7684\u4e0b\u6587\u3002\u5982\u679c\u662f\u7684\u8bdd\u8f93\u51fa\u2019IsNext\u2018\uff0c\u5426\u5219\u8f93\u51fa\u2019NotNext\u2018\u3002\u8bad\u7ec3\u6570\u636e\u7684\u751f\u6210\u65b9\u5f0f\u662f\u4ece\u5e73\u884c\u8bed\u6599\u4e2d\u968f\u673a\u62bd\u53d6\u7684\u8fde\u7eed\u4e24\u53e5\u8bdd\uff0c\u5176\u4e2d50%\u4fdd\u7559\u62bd\u53d6\u7684\u4e24\u53e5\u8bdd\uff0c\u5b83\u4eec\u7b26\u5408IsNext\u5173\u7cfb\uff0c\u53e6\u591650%\u7684\u7b2c\u4e8c\u53e5\u8bdd\u662f\u968f\u673a\u4ece\u9884\u6599\u4e2d\u63d0\u53d6\u7684\uff0c\u5b83\u4eec\u7684\u5173\u7cfb\u662fNotNext\u7684\u3002 \u9884\u8bad\u7ec3\u7684\u65f6\u5019\u53ef\u4ee5\u8fbe\u5230 97%-98% \u7684\u51c6\u786e\u5ea6\u3002 \u4f5c\u8005\u7279\u610f\u8bf4\u4e86\u8bed\u6599\u7684\u9009\u53d6\u5f88\u5173\u952e\uff0c\u8981\u9009\u7528document-level\u7684\u800c\u4e0d\u662fsentence-level\u7684\uff0c\u8fd9\u6837\u53ef\u4ee5\u5177\u5907\u62bd\u8c61\u8fde\u7eed\u957f\u5e8f\u5217\u7279\u5f81\u7684\u80fd\u529b\u3002","title":"Next Sentence Prediction \uff08NSP\uff09"},{"location":"llm/transformer/bert/#fine-tuning","text":"\u5fae\u8c03\u662f\u7b80\u5355\u7684\uff0c\u56e0\u4e3aTransformer\u4e2d\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236\u5141\u8bb8BERT\u901a\u8fc7\u4ea4\u6362\u9002\u5f53\u7684\u8f93\u5165\u548c\u8f93\u51fa\u6765\u5efa\u6a21\u8bb8\u591a\u4e0b\u6e38\u4efb\u52a1--\u4e0d\u7ba1\u5b83\u4eec\u6d89\u53ca\u5355\u4e2a\u6587\u672c\u8fd8\u662f\u6587\u672c\u5bf9\u3002\u5bf9\u4e8eNSP\u4efb\u52a1\u6765\u8bf4\uff0c\u5176\u6761\u4ef6\u6982\u7387\u8868\u793a\u4e3a \\(P=softmax(CW^T)\\) \uff0c\u5176\u4e2d C \u662f BERT \u8f93\u51fa\u4e2d\u7684 [CLS] \u7b26\u53f7\uff0cW \u662f\u53ef\u5b66\u4e60\u7684\u6743\u503c\u77e9\u9635\u3002 \u5fae\u8c03\u7684\u4efb\u52a1\u5305\u62ec\uff1a \u57fa\u4e8e\u53e5\u5b50\u5bf9\u7684\u5206\u7c7b\u4efb\u52a1 \u57fa\u4e8e\u5355\u4e2a\u53e5\u5b50\u7684\u5206\u7c7b\u4efb\u52a1 \u95ee\u7b54\u4efb\u52a1 \u547d\u540d\u5b9e\u4f53\u8bc6\u522bNER \u4e0b\u56fe\u5c55\u793a\u4e86BERT\u572811\u4e2a\u4e0d\u540c\u4efb\u52a1\u4e2d\u7684\u6a21\u578b\uff0c\u5b83\u4eec\u53ea\u9700\u8981\u5728BERT\u7684\u57fa\u7840\u4e0a\u518d\u6dfb\u52a0\u4e00\u4e2a\u8f93\u51fa\u5c42\u4fbf\u53ef\u4ee5\u5b8c\u6210\u5bf9\u7279\u5b9a\u4efb\u52a1\u7684\u5fae\u8c03\u3002\u8fd9\u4e9b\u4efb\u52a1\u7c7b\u4f3c\u4e8e\u6211\u4eec\u505a\u8fc7\u7684\u6587\u79d1\u8bd5\u5377\uff0c\u5176\u4e2d\u6709\u9009\u62e9\u9898\uff0c\u7b80\u7b54\u9898\u7b49\u7b49\u3002\u56fe3\u4e2d\u5176\u4e2dTok\u8868\u793a\u4e0d\u540c\u7684Token\uff0cE \u8868\u793a\u5d4c\u5165\u5411\u91cf\uff0c \\(T_i\\) \u8868\u793a\u7b2c i \u4e2aToken\u5728\u7ecf\u8fc7BERT\u5904\u7406\u4e4b\u540e\u5f97\u5230\u7684\u7279\u5f81\u5411\u91cf\u3002 \u6574\u4f53 Fine-Tuning \u8fc7\u7a0b\uff1a \u6784\u5efa\u56fe\u7ed3\u6784\uff0c\u622a\u53d6\u76ee\u6807\u5f20\u91cf\uff0c\u6dfb\u52a0\u65b0\u5c42 \u5939\u5728\u76ee\u6807\u5f20\u91cf\u6743\u91cd \u8bad\u7ec3\u65b0\u5c42 \u5168\u5c40\u5fae\u8c03","title":"Fine-tuning"},{"location":"llm/transformer/bert/#reference","text":"\u56fe\u89e3 BERT \u3010\u6df1\u5ea6\u5b66\u4e60\u3011BERT \u8be6\u89e3 \u3010NLP\u3011Google BERT\u6a21\u578b\u539f\u7406\u8be6\u89e3 NLP\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff08\u4e94\uff09BERT\u9884\u8bad\u7ec3\u6a21\u578b","title":"Reference"},{"location":"llm/transformer/transformer/","text":"Transformer \u00b6 \u7ea6 2243 \u4e2a\u5b57 84 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u300aAttention is all you need\u300b\u8fd9\u662f\u8c37\u6b4c\u56e2\u961f\u57282017\u5e74\u53d1\u8868\u7684\u8bba\u6587\uff0c\u4e5f\u662f\u9996\u6b21\u63d0\u51faTransformer\u3002 \u76f4\u63a5\u57fa\u4e8eSelf-Attention\u7ed3\u6784\uff0c\u53d6\u4ee3\u4e86\u4e4b\u524dNLP\u4efb\u52a1\u4e2d\u5e38\u7528\u7684RNN\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u3002 \u4e0eRNN\u8fd9\u7c7b\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u76f8\u6bd4\uff0cTransformer\u4e00\u4e2a\u5de8\u5927\u7684\u4f18\u70b9\u662f\uff1a**\u6a21\u578b\u5728\u5904\u7406\u5e8f\u5217\u8f93\u5165\u65f6\uff0c\u53ef\u4ee5\u5bf9\u6574\u4e2a\u5e8f\u5217\u8f93\u5165\u8fdb\u884c\u5e76\u884c\u8ba1\u7b97\uff0c\u4e0d\u9700\u8981\u6309\u7167\u65f6\u95f4\u6b65\u5faa\u73af\u9012\u5f52\u5904\u7406\u8f93\u5165\u5e8f\u5217\u3002 \u6574\u4f53\u67b6\u6784 \u00b6 transformer \u603b\u4f53\u4e3a\u4e00\u4e2a\u7f16\u7801\u7ec4\u4ef6\u3001\u89e3\u7801\u7ec4\u4ef6\u4ee5\u53ca\u4e8c\u8005\u4e4b\u95f4\u8fde\u63a5\u3002 \u7f16\u7801\u90e8\u5206\u548c\u89e3\u7801\u90e8\u5206\u90fd\u4e3a\u7f16\u7801\u5668\u3001\u89e3\u7801\u5668\u7684\u5806\u53e0\uff0c\u6700\u540e\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u662f\u5404\u4e2a\u89e3\u7801\u5668\u7684\u8f93\u5165\u4e4b\u4e00\u3002\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u4e3a\u5355\u8bcd\u7684\u5d4c\u5165\u5411\u91cf\uff0c\u540e\u9762\u7f16\u7801\u5668\u8f93\u5165\u4e3a\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u3002 \u7f16\u7801\u5668\u5747\u7531\u4e24\u4e2a\u5b50\u5c42\u7ec4\u6210\uff1a self-attention \u4e0e feed forward neural network \u3002 self-attention \u7528\u4e8e\u5e2e\u52a9\u7f16\u7801\u5668\u5728\u7f16\u7801\u7279\u5b9a\u5355\u8bcd\u65f6\u67e5\u770b\u8f93\u5165\u4e2d\u7684\u5176\u4ed6\u5355\u8bcd\u3002\u89e3\u7801\u5668\u4e5f\u6709\u8fd9\u4e24\u4e2a\u5b50\u5c42\uff0c\u4e2d\u95f4\u6709\u4e00\u4e2a\u6ce8\u610f\u529b\u5c42\uff0c\u5e2e\u52a9\u89e3\u7801\u5668\u67e5\u770b\u8f93\u5165\u53e5\u5b50\u7684\u76f8\u5173\u90e8\u5206\u3002 \u8f93\u5165\u5904\u7406 \u00b6 \u8bcd\u5411\u91cf \u00b6 \u548c\u5e38\u89c1\u7684 NLP \u4efb\u52a1\u4e00\u6837\uff0c\u9996\u5148\u4f1a\u4f7f\u7528\u8bcd\u5d4c\u5165\u7b97\u6cd5\uff08embedding algorithm\uff09\uff0c\u5c06\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7684\u6bcf\u4e2a\u8bcd\u8f6c\u6362\u4e3a\u4e00\u4e2a\u8bcd\u5411\u91cf\u3002\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5411\u91cf\u4e00\u822c\u4e3a 256 \u6216 512 \u7ef4\u3002 \u8f93\u5165\u5e8f\u5217\u6bcf\u4e2a\u5355\u8bcd\u88ab\u8f6c\u5316\u6210\u8bcd\u5411\u91cf\u8868\u793a\u8fd8\u5c06\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u6765\u5f97\u5230\u8be5\u8bcd\u7684\u6700\u7ec8\u5411\u91cf\u8868\u793a\u3002 \u4f4d\u7f6e\u5411\u91cf \u00b6 \u9996\u5148\u4e3a\u4ec0\u4e48\u9700\u8981\u4f4d\u7f6e\u7f16\u7801\uff1f\u6211\u4eec\u5bf9\u4e8eRNN\u5728\u5904\u7406\u6587\u672c\u65f6\uff0c\u7531\u4e8e\u5929\u7136\u7684\u987a\u5e8f\u8f93\u5165\uff0c\u987a\u5e8f\u5904\u7406\uff0c\u5f53\u524d\u8f93\u51fa\u8981\u7b49\u4e0a\u4e00\u6b65\u8f93\u51fa\u5904\u7406\u5b8c\u540e\u624d\u80fd\u8fdb\u884c\uff0c\u56e0\u6b64\u4e0d\u4f1a\u9020\u6210\u6587\u672c\u7684\u5b57\u8bcd\u5728\u987a\u5e8f\u4e0a\u6216\u8005\u5148\u540e\u5173\u7cfb\u51fa\u73b0\u95ee\u9898\u3002 \u4f46\u5bf9\u4e8eTransformer\u6765\u8bf4\uff0c\u7531\u4e8e\u5176\u5728\u5904\u7406\u65f6\u662f\u5e76\u884c\u6267\u884c\uff0c\u867d\u7136\u52a0\u5feb\u4e86\u901f\u5ea6\uff0c\u4f46\u662f\u5ffd\u7565\u4e86\u8bcd\u5b57\u4e4b\u95f4\u7684\u524d\u540e\u5173\u7cfb\u6216\u8005\u5148\u540e\u987a\u5e8f\u3002\u540c\u65f6Transformer\u57fa\u4e8eSelf-Attention\u673a\u5236\uff0c\u800cself-attention\u4e0d\u80fd\u83b7\u53d6\u5b57\u8bcd\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u5373\u4f7f\u6253\u4e71\u4e00\u53e5\u8bdd\u4e2d\u5b57\u8bcd\u7684\u4f4d\u7f6e\uff0c\u6bcf\u4e2a\u8bcd\u8fd8\u662f\u80fd\u4e0e\u5176\u4ed6\u8bcd\u4e4b\u95f4\u8ba1\u7b97\u51faattention\u503c\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2a\u8bcd\u5411\u91cf\u6dfb\u52a0\u4f4d\u7f6e\u7f16\u7801\u3002 Transformer \u6a21\u578b\u5bf9\u6bcf\u4e2a\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u90fd\u52a0\u4e0a\u4e86\u4e00\u4e2a\u4f4d\u7f6e\u5411\u91cf\u3002\u8fd9\u4e9b\u5411\u91cf\u6709\u52a9\u4e8e\u786e\u5b9a\u6bcf\u4e2a\u5355\u8bcd\u7684\u4f4d\u7f6e\u7279\u5f81\uff0c\u6216\u8005\u53e5\u5b50\u4e2d\u4e0d\u540c\u5355\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7279\u5f81\u3002\u8bcd\u5411\u91cf\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u80cc\u540e\u7684\u76f4\u89c9\uff1a \u5c06\u8fd9\u4e9b\u8868\u793a\u4f4d\u7f6e\u7684\u5411\u91cf\u6dfb\u52a0\u5230\u8bcd\u5411\u91cf\u4e2d\uff0c\u5f97\u5230\u7684\u65b0\u5411\u91cf\uff0c\u53ef\u4ee5\u4e3a\u6a21\u578b\u63d0\u4f9b\u66f4\u591a\u6709\u610f\u4e49\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u8bcd\u7684\u4f4d\u7f6e\uff0c\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7b49\u3002 \u90a3\u4e48\u5e26\u6709\u4f4d\u7f6e\u7f16\u7801\u4fe1\u606f\u7684\u5411\u91cf\u5230\u5e95\u9075\u5faa\u4ec0\u4e48\u6a21\u5f0f\uff1f\u539f\u59cb\u8bba\u6587\u4e2d\u7ed9\u51fa\u7684\u8bbe\u8ba1\u8868\u8fbe\u5f0f\u4e3a\uff1a \\[ PE_{(pos,2i)} = sin(pos / 10000^{2i/d_{\\text{model}}}) \\\\ PE_{(pos,2i+1)} = cos(pos / 10000^{2i/d_{\\text{model}}}) \\] \u4e0a\u9762\u8868\u8fbe\u5f0f\u4e2d\u7684 \\(pos\\) \u4ee3\u8868\u8bcd\u7684\u4f4d\u7f6e\uff0c \\(d_{model}\\) \u4ee3\u8868\u4f4d\u7f6e\u5411\u91cf\u7684\u7ef4\u5ea6\uff0c \\(i \\in [0, d_{model})\\) \u4ee3\u8868\u4f4d\u7f6e \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u7b2c \\(i\\) \u7ef4\u3002\u4e8e\u662f\u6839\u636e\u4e0a\u8ff0\u516c\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u7b2c \\(pos\\) \u4f4d\u7f6e\u7684 \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u3002\u5728\u4e0b\u56fe\u4e2d\uff0c\u6211\u4eec\u753b\u51fa\u4e86\u4e00\u79cd\u4f4d\u7f6e\u5411\u91cf\u5728\u7b2c4\u30015\u30016\u30017\u7ef4\u5ea6\u3001\u4e0d\u540c\u4f4d\u7f6e\u7684\u7684\u6570\u503c\u5927\u5c0f\u3002\u6a2a\u5750\u6807\u8868\u793a\u4f4d\u7f6e\u4e0b\u6807\uff0c\u7eb5\u5750\u6807\u8868\u793a\u6570\u503c\u5927\u5c0f\u3002 \u5f53\u7136\uff0c\u4e0a\u8ff0\u516c\u5f0f\u4e0d\u662f\u552f\u4e00\u751f\u6210\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u7684\u65b9\u6cd5\u3002\u4f46\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\uff1a\u53ef\u4ee5\u6269\u5c55\u5230\u672a\u77e5\u7684\u5e8f\u5217\u957f\u5ea6\u3002\u4f8b\u5982\uff1a\u5f53\u6211\u4eec\u7684\u6a21\u578b\u9700\u8981\u7ffb\u8bd1\u4e00\u4e2a\u53e5\u5b50\uff0c\u800c\u8fd9\u4e2a\u53e5\u5b50\u7684\u957f\u5ea6\u5927\u4e8e\u8bad\u7ec3\u96c6\u4e2d\u6240\u6709\u53e5\u5b50\u7684\u957f\u5ea6\uff0c\u8fd9\u65f6\uff0c\u8fd9\u79cd\u4f4d\u7f6e\u7f16\u7801\u7684\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u751f\u6210\u4e00\u6837\u957f\u7684\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u3002 \u7f16\u7801\u5668 \u00b6 \u7f16\u7801\u90e8\u5206\u7684\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7ecf\u8fc7\u8f93\u5165\u5904\u7406\u4e4b\u540e\u5f97\u5230\u4e86\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u8fd9\u4e2a\u5411\u91cf\u5e8f\u5217\u5c06\u88ab\u9001\u5165\u7b2c1\u5c42\u7f16\u7801\u5668\uff0c\u7b2c1\u5c42\u7f16\u7801\u5668\u8f93\u51fa\u7684\u540c\u6837\u662f\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u518d\u63a5\u7740\u9001\u5165\u4e0b\u4e00\u5c42\u7f16\u7801\u5668\uff1a\u7b2c1\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u878d\u5408\u4f4d\u7f6e\u5411\u91cf\u7684\u8bcd\u5411\u91cf\uff0c\u66f4\u4e0a\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u5219\u662f\u4e0a\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u3002 \u5404\u4e2a\u8bcd\u5411\u91cf\u5747\u8fdb\u5165\u7f16\u7801\u5668\u7684\u4e24\u4e2a\u5b50\u5c42\uff0c self-attention \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u7684\u8def\u5f84\u5177\u6709\u4e00\u5b9a\u5173\u8054\uff0c\u800c FFNN \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u53c2\u4e0e\u7684\u8ba1\u7b97\u8fc7\u7a0b\u72ec\u7acb\u3002 self-attention \u4f7f\u5f97\u6a21\u578b\u5728\u5904\u7406\u4e00\u4e2a\u8bcd\u5411\u91cf\u65f6\uff0c\u80fd\u591f\u5c06\u5176\u4e0e\u76f8\u5173\u7684\u8bcd\u5173\u8054\u8d77\u6765\uff0c\u4ee5\u66f4\u597d\u5730\u5bf9\u8be5\u8bcd\u5411\u91cf\u7f16\u7801\u3002 RNN \u901a\u8fc7\u7ef4\u62a4\u9690\u85cf\u72b6\u6001\u4ee5\u5c06\u5148\u524d\u5904\u7406\u7684\u8bcd\u5411\u91cf\u540c\u5f53\u524d\u8bcd\u5411\u91cf\u5408\u5e76\uff0ctransformer \u5219\u4f7f\u7528 self-attention \u5c06\u5bf9\u76f8\u5173\u8bcd\u7684\u201c\u7406\u89e3\u201d\u878d\u5165\u5f53\u524d\u5904\u7406\u7684\u8bcd\u3002 Self-Attention \u5c42 \u00b6 \u4e3a\u6bcf\u4e2a\u8bcd\u5411\u91cf\u521b\u5efa\u4e09\u4e2a\u5411\u91cf\uff1a Query \u3001 Key \u3001 Value \u3002\u8fd9\u4e09\u4e2a\u5411\u91cf\u662f\u901a\u8fc7\u5c06\u6bcf\u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u4e09\u4e2a\u5e26\u8bad\u7ec3\u7684\u77e9\u9635\u521b\u5efa\u7684\uff08\u5bf9\u540e\u9762\u7684\u7f16\u7801\u5668\uff0c\u5219\u662f\u4e0a\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u51fa\u4e58\u4ee5\u4e09\u4e2a\u65b0\u7684\u5f85\u8bad\u7ec3\u77e9\u9635\uff09\u3002 \u8ba1\u7b97\u5f53\u524d\u8bcd\u5411\u91cf\u4e0e\u8f93\u5165\u53e5\u5b50\u6240\u6709\u8bcd\u5411\u91cf\u7684\u5206\u6570\uff0c\u5206\u6570\u4f1a\u51b3\u5b9a\u5c06\u591a\u5c11\u6ce8\u610f\u529b\u653e\u5728\u8fd9\u4e9b\u8bcd\u4e0a\u3002\u5206\u6570\u901a\u8fc7\u5c06\u5f53\u524d\u8bcd\u5411\u91cf\u5bf9\u5e94\u7684 Query \u5411\u91cf\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 key \u5411\u91cf\u70b9\u79ef\u5f97\u5230\uff0c\u7b2c\u4e00\u4e2a\u5206\u6570\u662f q1 \u4e0e k1 \u70b9\u79ef\uff0c\u7b2c\u4e8c\u4e2a\u5206\u6570\u662f q1 \u4e0e k2 \u70b9\u79ef\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002 \u5c06\u5206\u6570\u9664\u4ee5 Query \u5411\u91cf\u957f\u5ea6\u7684\u5e73\u65b9\u6839\u3002\u6b64\u6b65\u9aa4\u63d0\u9ad8\u4e86\u68af\u5ea6\u7684\u7a33\u5b9a\u6027\u3002 \u901a\u8fc7 softmax \u5c06\u5206\u6570\u5f52\u4e00\u5316\u3002 \u5f52\u4e00\u5316\u7684\u5f97\u5206\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u76f8\u4e58\uff0c\u6b64\u505a\u6cd5\u7684\u76f4\u89c9\u662f\u4fdd\u6301\u60f3\u8981\u5173\u6ce8\u7684\u5355\u8bcd\u7684\u503c\u4e0d\u53d8\uff0c\u800c\u4e14\u6d88\u9664\u4e0d\u76f8\u5173\u7684\u5355\u8bcd\uff0c\u5373\u5bf9\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u52a0\u6743\u3002 \u5bf9\u6240\u6709\u52a0\u6743\u540e\u7684 Value \u5411\u91cf\u6c42\u548c\uff0c\u5373\u4e3a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u5c42\u7684\u8f93\u51fa\u3002 \u4e0a\u8ff0\u8fc7\u7a0b\u7684\u77e9\u9635\u5f62\u5f0f\u4e3a\uff1a \u591a\u5934\u6ce8\u610f\u529b \u00b6 \u8fdb\u4e00\u6b65\u4f18\u5316 Self-attention \uff1a\u4f7f\u7528 multi-headed attention \u3002\u63d0\u9ad8\u4e86\u6a21\u578b\u5173\u6ce8\u4e0d\u540c\u4f4d\u7f6e\u7684\u80fd\u529b\uff0c\u4e3a\u6ce8\u610f\u529b\u5c42\u63d0\u4f9b\u4e86\u591a\u4e2a\u8868\u793a\u5b50\u7a7a\u95f4\uff08 representation subspaces \uff09\u2014\u2014 \u53ef\u4ee5\u6709\u591a\u7ec4 Query \u3001 Key \u3001 Value \u6743\u91cd\u77e9\u9635\uff0c\u6bcf\u4e00\u7ec4\u90fd\u662f\u968f\u673a\u521d\u59cb\u5316\uff0c\u56e0\u6b64\u8bad\u7ec3\u5b8c\u6210\u540e\u6bcf\u4e00\u7ec4\u90fd\u53ef\u4ee5\u5c06\u8f93\u5165\u6295\u5c04\u5230\u4e0d\u540c\u7684\u5b50\u7a7a\u95f4\uff0c\u5177\u4f53\u53ef\u4ee5\u7c7b\u6bd4 CNN \u4e2d\u7684\u591a\u4e2a\u5377\u79ef\u6838\u3002 \u6700\u7ec8\u5c06\u5f97\u5230\u591a\u4e2a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u4e0b\u7684\u8f93\u51fa\u5411\u91cf\uff0c\u5373\u8f93\u5165\u53e5\u5b50\u7ecf\u8fc7 self-attention \u540e\uff0c\u5c06\u6709\u591a\u4e2a\u8f93\u51fa\u77e9\u9635\u3002 \u7531\u4e8e FFNN \u5b50\u5c42\u9700\u8981\u4e00\u4e2a\u77e9\u9635\uff08\u6bcf\u4e2a\u5355\u8bcd\u7531\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u4ee5\u4e0a\u8f93\u51fa\u77e9\u9635\u4e0e\u4e00\u4e2a\u989d\u5916\u7684\u5f85\u8bad\u7ec3\u6743\u91cd\u77e9\u9635\u76f8\u4e58\u3002 \u4e00\u4e2a\u591a\u5934\u6ce8\u610f\u529b\u7684\u4f8b\u5b50\uff1a Attention \u4ee3\u7801\u5b9e\u4f8b \u00b6 \u5f20\u91cf\u7684\u7b2c1\u7ef4\u662f batch size\uff0c\u7b2c 2 \u7ef4\u662f\u53e5\u5b50\u957f\u5ea6\u3002 class MultiheadAttention ( nn . Module ): # n_heads\uff1a\u591a\u5934\u6ce8\u610f\u529b\u7684\u6570\u91cf # hid_dim\uff1a\u6bcf\u4e2a\u8bcd\u8f93\u51fa\u7684\u5411\u91cf\u7ef4\u5ea6 def __init__ ( self , hid_dim , n_heads , dropout ): super ( MultiheadAttention , self ) . __init__ () self . hid_dim = hid_dim self . n_heads = n_heads # \u5f3a\u5236 hid_dim \u5fc5\u987b\u6574\u9664 h assert hid_dim % n_heads == 0 # \u5b9a\u4e49 W_q \u77e9\u9635 self . w_q = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_k \u77e9\u9635 self . w_k = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_v \u77e9\u9635 self . w_v = nn . Linear ( hid_dim , hid_dim ) self . fc = nn . Linear ( hid_dim , hid_dim ) self . do = nn . Dropout ( dropout ) # \u7f29\u653e self . scale = torch . sqrt ( torch . FloatTensor ([ hid_dim // n_heads ])) def forward ( self , query , key , value , mask = None ): # \u6ce8\u610f Q\uff0cK\uff0cV\u7684\u5728\u53e5\u5b50\u957f\u5ea6\u8fd9\u4e00\u4e2a\u7ef4\u5ea6\u7684\u6570\u503c\u53ef\u4ee5\u4e00\u6837\uff0c\u53ef\u4ee5\u4e0d\u4e00\u6837\u3002 # K: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # V: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # Q: [64,12,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 bsz = query . shape [ 0 ] Q = self . w_q ( query ) K = self . w_k ( key ) V = self . w_v ( value ) # \u8fd9\u91cc\u628a K Q V \u77e9\u9635\u62c6\u5206\u4e3a\u591a\u7ec4\u6ce8\u610f\u529b # \u6700\u540e\u4e00\u7ef4\u5c31\u662f\u662f\u7528 self.hid_dim // self.n_heads \u6765\u5f97\u5230\u7684\uff0c\u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u5411\u91cf\u957f\u5ea6, \u6bcf\u4e2a head \u7684\u5411\u91cf\u957f\u5ea6\u662f\uff1a300/6=50 # 64 \u8868\u793a batch size\uff0c6 \u8868\u793a\u6709 6\u7ec4\u6ce8\u610f\u529b\uff0c10 \u8868\u793a\u6709 10 \u8bcd\uff0c50 \u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u8bcd\u7684\u5411\u91cf\u957f\u5ea6 # K: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # V: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # Q: [64,12,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,12,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,12,50] # \u8f6c\u7f6e\u662f\u4e3a\u4e86\u628a\u6ce8\u610f\u529b\u7684\u6570\u91cf 6 \u653e\u5230\u524d\u9762\uff0c\u628a 10 \u548c 50 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u8ba1\u7b97 Q = Q . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) K = K . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) V = V . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) # \u7b2c 1 \u6b65\uff1aQ \u4e58\u4ee5 K\u7684\u8f6c\u7f6e\uff0c\u9664\u4ee5scale # [64,6,12,50] * [64,6,50,10] = [64,6,12,10] # attention\uff1a[64,6,12,10] attention = torch . matmul ( Q , K . permute ( 0 , 1 , 3 , 2 )) / self . scale # \u5982\u679c mask \u4e0d\u4e3a\u7a7a\uff0c\u90a3\u4e48\u5c31\u628a mask \u4e3a 0 \u7684\u4f4d\u7f6e\u7684 attention \u5206\u6570\u8bbe\u7f6e\u4e3a -1e10\uff0c\u8fd9\u91cc\u7528\u201c0\u201d\u6765\u6307\u793a\u54ea\u4e9b\u4f4d\u7f6e\u7684\u8bcd\u5411\u91cf\u4e0d\u80fd\u88abattention\u5230\uff0c\u6bd4\u5982padding\u4f4d\u7f6e\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528\u201c1\u201d\u6216\u8005\u5176\u4ed6\u6570\u5b57\u6765\u6307\u793a\uff0c\u4e3b\u8981\u8bbe\u8ba1\u4e0b\u97622\u884c\u4ee3\u7801\u7684\u6539\u52a8\u3002 if mask is not None : attention = attention . masked_fill ( mask == 0 , - 1e10 ) # \u7b2c 2 \u6b65\uff1a\u8ba1\u7b97\u4e0a\u4e00\u6b65\u7ed3\u679c\u7684 softmax\uff0c\u518d\u7ecf\u8fc7 dropout\uff0c\u5f97\u5230 attention\u3002 # \u6ce8\u610f\uff0c\u8fd9\u91cc\u662f\u5bf9\u6700\u540e\u4e00\u7ef4\u505a softmax\uff0c\u4e5f\u5c31\u662f\u5728\u8f93\u5165\u5e8f\u5217\u7684\u7ef4\u5ea6\u505a softmax # attention: [64,6,12,10] attention = self . do ( torch . softmax ( attention , dim =- 1 )) # \u7b2c\u4e09\u6b65\uff0cattention\u7ed3\u679c\u4e0eV\u76f8\u4e58\uff0c\u5f97\u5230\u591a\u5934\u6ce8\u610f\u529b\u7684\u7ed3\u679c # [64,6,12,10] * [64,6,10,50] = [64,6,12,50] # x: [64,6,12,50] x = torch . matmul ( attention , V ) # \u56e0\u4e3a query \u6709 12 \u4e2a\u8bcd\uff0c\u6240\u4ee5\u628a 12 \u653e\u5230\u524d\u9762\uff0c\u628a 50 \u548c 6 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u62fc\u63a5\u591a\u7ec4\u7684\u7ed3\u679c # x: [64,6,12,50] \u8f6c\u7f6e-> [64,12,6,50] x = x . permute ( 0 , 2 , 1 , 3 ) . contiguous () # \u8fd9\u91cc\u7684\u77e9\u9635\u8f6c\u6362\u5c31\u662f\uff1a\u628a\u591a\u7ec4\u6ce8\u610f\u529b\u7684\u7ed3\u679c\u62fc\u63a5\u8d77\u6765 # \u6700\u7ec8\u7ed3\u679c\u5c31\u662f [64,12,300] # x: [64,12,6,50] -> [64,12,300] x = x . view ( bsz , - 1 , self . n_heads * ( self . hid_dim // self . n_heads )) x = self . fc ( x ) return x # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 query = torch . rand ( 64 , 12 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Key \u5411\u91cf\u662f 300 \u7ef4 key = torch . rand ( 64 , 10 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Value \u5411\u91cf\u662f 300 \u7ef4 value = torch . rand ( 64 , 10 , 300 ) attention = MultiheadAttention ( hid_dim = 300 , n_heads = 6 , dropout = 0.1 ) output = attention ( query , key , value ) ## output: torch.Size([64, 12, 300]) print ( output . shape ) \u6b8b\u5dee\u8fde\u63a5 \u00b6 \u7f16\u7801\u5668\u4e2d\u6bcf\u4e2a\u5b50\u5c42\u90fd\u8fdb\u884c\u6b8b\u5dee\u8fde\u63a5\uff0c\u5e76\u5f52\u4e00\u5316\u3002 \u5c06 Self-Attention \u5c42\u7684\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u548c\u6d89\u53ca\u7684\u5411\u91cf\u8ba1\u7b97\u7ec6\u8282\u90fd\u8fdb\u884c\u53ef\u89c6\u5316\uff0c\u5982\u4e0b\u6240\u793a\uff1a \u7f16\u7801\u5668\u548c\u548c\u89e3\u7801\u5668\u7684\u5b50\u5c42\u91cc\u9762\u90fd\u6709\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u3002\u5047\u8bbe\u4e00\u4e2a Transformer \u662f\u7531 2 \u5c42\u7f16\u7801\u5668\u548c\u4e24\u5c42\u89e3\u7801\u5668\u7ec4\u6210\u7684\uff0c\u5c06\u5168\u90e8\u5185\u90e8\u7ec6\u8282\u5c55\u793a\u8d77\u6765\u5982\u4e0b\u56fe\u6240\u793a\u3002 \u89e3\u7801\u5668 \u00b6 \u7f16\u7801\u5668\u4e00\u822c\u6709\u591a\u5c42\uff0c\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u4e00\u4e2a\u5e8f\u5217\u6587\u672c\uff0c\u6700\u540e\u4e00\u4e2a\u7f16\u7801\u5668\u8f93\u51fa\u662f\u4e00\u7ec4\u5e8f\u5217\u5411\u91cf\uff0c\u8fd9\u7ec4\u5e8f\u5217\u5411\u91cf\u4f1a\u4f5c\u4e3a\u89e3\u7801\u5668\u7684 K\u3001V \u8f93\u5165\uff0c\u5176\u4e2d K=V=\u89e3\u7801\u5668\u8f93\u51fa\u7684\u5e8f\u5217\u5411\u91cf\u8868\u793a\u3002\u8fd9\u4e9b\u6ce8\u610f\u529b\u5411\u91cf\u5c06\u4f1a\u8f93\u5165\u5230\u6bcf\u4e2a\u89e3\u7801\u5668\u7684 Encoder-Decoder Attention \u5c42\uff0c\u8fd9\u6709\u52a9\u4e8e\u89e3\u7801\u5668\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u8f93\u5165\u5e8f\u5217\u7684\u5408\u9002\u4f4d\u7f6e\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002 \u89e3\u7801\uff08decoding\uff09\u9636\u6bb5\u7684\u6bcf\u4e00\u4e2a\u65f6\u95f4\u6b65\u90fd\u8f93\u51fa\u4e00\u4e2a\u7ffb\u8bd1\u540e\u7684\u5355\u8bcd\uff08\u8fd9\u91cc\u7684\u4f8b\u5b50\u662f\u82f1\u8bed\u7ffb\u8bd1\uff09\uff0c\u89e3\u7801\u5668\u5f53\u524d\u65f6\u95f4\u6b65\u7684\u8f93\u51fa\u53c8\u91cd\u65b0\u4f5c\u4e3a\u8f93\u51fa Q \u548c\u7f16\u7801\u5668\u7684\u8f93\u51fa K\u3001V \u5171\u540c\u4f5c\u4e3a\u4e0b\u4e00\u4e2a\u65f6\u95f4\u6b65\u89e3\u7801\u5668\u7684\u8f93\u5165\u3002\u7136\u540e\u91cd\u590d\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u76f4\u5230\u8f93\u51fa\u4e00\u4e2a\u7ed3\u675f\u7b26\u3002 \u89e3\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\uff0c\u548c\u7f16\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\u7684\u533a\u522b\uff1a \u5728\u89e3\u7801\u5668\u91cc\uff0cSelf Attention \u5c42\u53ea\u5141\u8bb8\u5173\u6ce8\u5230\u8f93\u51fa\u5e8f\u5217\u4e2d\u65e9\u4e8e\u5f53\u524d\u4f4d\u7f6e\u4e4b\u524d\u7684\u5355\u8bcd\u3002\u5177\u4f53\u505a\u6cd5\u662f\uff1a\u5728 Self Attention \u5206\u6570\u7ecf\u8fc7 Softmax \u5c42\u4e4b\u524d\uff0c\u5c4f\u853d\u5f53\u524d\u4f4d\u7f6e\u4e4b\u540e\u7684\u90a3\u4e9b\u4f4d\u7f6e\uff08\u5c06attention score\u8bbe\u7f6e\u6210-inf\uff09\u3002 \u89e3\u7801\u5668 Attention\u5c42\u662f\u4f7f\u7528\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u6765\u6784\u9020Query \u77e9\u9635\uff0c\u800cKey\u77e9\u9635\u548c Value\u77e9\u9635\u6765\u81ea\u4e8e\u7f16\u7801\u5668\u6700\u7ec8\u7684\u8f93\u51fa\u3002 Reference \u00b6 learn-nlp-with-transformers 10\u5206\u949f\u5e26\u4f60\u6df1\u5165\u7406\u89e3Transformer\u539f\u7406\u53ca\u5b9e\u73b0 Transformer\u539f\u7406\u8be6\u89e3 transformer \u539f\u7406","title":"Transformer"},{"location":"llm/transformer/transformer/#transformer","text":"\u7ea6 2243 \u4e2a\u5b57 84 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u300aAttention is all you need\u300b\u8fd9\u662f\u8c37\u6b4c\u56e2\u961f\u57282017\u5e74\u53d1\u8868\u7684\u8bba\u6587\uff0c\u4e5f\u662f\u9996\u6b21\u63d0\u51faTransformer\u3002 \u76f4\u63a5\u57fa\u4e8eSelf-Attention\u7ed3\u6784\uff0c\u53d6\u4ee3\u4e86\u4e4b\u524dNLP\u4efb\u52a1\u4e2d\u5e38\u7528\u7684RNN\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u3002 \u4e0eRNN\u8fd9\u7c7b\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u76f8\u6bd4\uff0cTransformer\u4e00\u4e2a\u5de8\u5927\u7684\u4f18\u70b9\u662f\uff1a**\u6a21\u578b\u5728\u5904\u7406\u5e8f\u5217\u8f93\u5165\u65f6\uff0c\u53ef\u4ee5\u5bf9\u6574\u4e2a\u5e8f\u5217\u8f93\u5165\u8fdb\u884c\u5e76\u884c\u8ba1\u7b97\uff0c\u4e0d\u9700\u8981\u6309\u7167\u65f6\u95f4\u6b65\u5faa\u73af\u9012\u5f52\u5904\u7406\u8f93\u5165\u5e8f\u5217\u3002","title":"Transformer"},{"location":"llm/transformer/transformer/#_1","text":"transformer \u603b\u4f53\u4e3a\u4e00\u4e2a\u7f16\u7801\u7ec4\u4ef6\u3001\u89e3\u7801\u7ec4\u4ef6\u4ee5\u53ca\u4e8c\u8005\u4e4b\u95f4\u8fde\u63a5\u3002 \u7f16\u7801\u90e8\u5206\u548c\u89e3\u7801\u90e8\u5206\u90fd\u4e3a\u7f16\u7801\u5668\u3001\u89e3\u7801\u5668\u7684\u5806\u53e0\uff0c\u6700\u540e\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u662f\u5404\u4e2a\u89e3\u7801\u5668\u7684\u8f93\u5165\u4e4b\u4e00\u3002\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u4e3a\u5355\u8bcd\u7684\u5d4c\u5165\u5411\u91cf\uff0c\u540e\u9762\u7f16\u7801\u5668\u8f93\u5165\u4e3a\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u3002 \u7f16\u7801\u5668\u5747\u7531\u4e24\u4e2a\u5b50\u5c42\u7ec4\u6210\uff1a self-attention \u4e0e feed forward neural network \u3002 self-attention \u7528\u4e8e\u5e2e\u52a9\u7f16\u7801\u5668\u5728\u7f16\u7801\u7279\u5b9a\u5355\u8bcd\u65f6\u67e5\u770b\u8f93\u5165\u4e2d\u7684\u5176\u4ed6\u5355\u8bcd\u3002\u89e3\u7801\u5668\u4e5f\u6709\u8fd9\u4e24\u4e2a\u5b50\u5c42\uff0c\u4e2d\u95f4\u6709\u4e00\u4e2a\u6ce8\u610f\u529b\u5c42\uff0c\u5e2e\u52a9\u89e3\u7801\u5668\u67e5\u770b\u8f93\u5165\u53e5\u5b50\u7684\u76f8\u5173\u90e8\u5206\u3002","title":"\u6574\u4f53\u67b6\u6784"},{"location":"llm/transformer/transformer/#_2","text":"","title":"\u8f93\u5165\u5904\u7406"},{"location":"llm/transformer/transformer/#_3","text":"\u548c\u5e38\u89c1\u7684 NLP \u4efb\u52a1\u4e00\u6837\uff0c\u9996\u5148\u4f1a\u4f7f\u7528\u8bcd\u5d4c\u5165\u7b97\u6cd5\uff08embedding algorithm\uff09\uff0c\u5c06\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7684\u6bcf\u4e2a\u8bcd\u8f6c\u6362\u4e3a\u4e00\u4e2a\u8bcd\u5411\u91cf\u3002\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5411\u91cf\u4e00\u822c\u4e3a 256 \u6216 512 \u7ef4\u3002 \u8f93\u5165\u5e8f\u5217\u6bcf\u4e2a\u5355\u8bcd\u88ab\u8f6c\u5316\u6210\u8bcd\u5411\u91cf\u8868\u793a\u8fd8\u5c06\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u6765\u5f97\u5230\u8be5\u8bcd\u7684\u6700\u7ec8\u5411\u91cf\u8868\u793a\u3002","title":"\u8bcd\u5411\u91cf"},{"location":"llm/transformer/transformer/#_4","text":"\u9996\u5148\u4e3a\u4ec0\u4e48\u9700\u8981\u4f4d\u7f6e\u7f16\u7801\uff1f\u6211\u4eec\u5bf9\u4e8eRNN\u5728\u5904\u7406\u6587\u672c\u65f6\uff0c\u7531\u4e8e\u5929\u7136\u7684\u987a\u5e8f\u8f93\u5165\uff0c\u987a\u5e8f\u5904\u7406\uff0c\u5f53\u524d\u8f93\u51fa\u8981\u7b49\u4e0a\u4e00\u6b65\u8f93\u51fa\u5904\u7406\u5b8c\u540e\u624d\u80fd\u8fdb\u884c\uff0c\u56e0\u6b64\u4e0d\u4f1a\u9020\u6210\u6587\u672c\u7684\u5b57\u8bcd\u5728\u987a\u5e8f\u4e0a\u6216\u8005\u5148\u540e\u5173\u7cfb\u51fa\u73b0\u95ee\u9898\u3002 \u4f46\u5bf9\u4e8eTransformer\u6765\u8bf4\uff0c\u7531\u4e8e\u5176\u5728\u5904\u7406\u65f6\u662f\u5e76\u884c\u6267\u884c\uff0c\u867d\u7136\u52a0\u5feb\u4e86\u901f\u5ea6\uff0c\u4f46\u662f\u5ffd\u7565\u4e86\u8bcd\u5b57\u4e4b\u95f4\u7684\u524d\u540e\u5173\u7cfb\u6216\u8005\u5148\u540e\u987a\u5e8f\u3002\u540c\u65f6Transformer\u57fa\u4e8eSelf-Attention\u673a\u5236\uff0c\u800cself-attention\u4e0d\u80fd\u83b7\u53d6\u5b57\u8bcd\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u5373\u4f7f\u6253\u4e71\u4e00\u53e5\u8bdd\u4e2d\u5b57\u8bcd\u7684\u4f4d\u7f6e\uff0c\u6bcf\u4e2a\u8bcd\u8fd8\u662f\u80fd\u4e0e\u5176\u4ed6\u8bcd\u4e4b\u95f4\u8ba1\u7b97\u51faattention\u503c\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2a\u8bcd\u5411\u91cf\u6dfb\u52a0\u4f4d\u7f6e\u7f16\u7801\u3002 Transformer \u6a21\u578b\u5bf9\u6bcf\u4e2a\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u90fd\u52a0\u4e0a\u4e86\u4e00\u4e2a\u4f4d\u7f6e\u5411\u91cf\u3002\u8fd9\u4e9b\u5411\u91cf\u6709\u52a9\u4e8e\u786e\u5b9a\u6bcf\u4e2a\u5355\u8bcd\u7684\u4f4d\u7f6e\u7279\u5f81\uff0c\u6216\u8005\u53e5\u5b50\u4e2d\u4e0d\u540c\u5355\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7279\u5f81\u3002\u8bcd\u5411\u91cf\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u80cc\u540e\u7684\u76f4\u89c9\uff1a \u5c06\u8fd9\u4e9b\u8868\u793a\u4f4d\u7f6e\u7684\u5411\u91cf\u6dfb\u52a0\u5230\u8bcd\u5411\u91cf\u4e2d\uff0c\u5f97\u5230\u7684\u65b0\u5411\u91cf\uff0c\u53ef\u4ee5\u4e3a\u6a21\u578b\u63d0\u4f9b\u66f4\u591a\u6709\u610f\u4e49\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u8bcd\u7684\u4f4d\u7f6e\uff0c\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7b49\u3002 \u90a3\u4e48\u5e26\u6709\u4f4d\u7f6e\u7f16\u7801\u4fe1\u606f\u7684\u5411\u91cf\u5230\u5e95\u9075\u5faa\u4ec0\u4e48\u6a21\u5f0f\uff1f\u539f\u59cb\u8bba\u6587\u4e2d\u7ed9\u51fa\u7684\u8bbe\u8ba1\u8868\u8fbe\u5f0f\u4e3a\uff1a \\[ PE_{(pos,2i)} = sin(pos / 10000^{2i/d_{\\text{model}}}) \\\\ PE_{(pos,2i+1)} = cos(pos / 10000^{2i/d_{\\text{model}}}) \\] \u4e0a\u9762\u8868\u8fbe\u5f0f\u4e2d\u7684 \\(pos\\) \u4ee3\u8868\u8bcd\u7684\u4f4d\u7f6e\uff0c \\(d_{model}\\) \u4ee3\u8868\u4f4d\u7f6e\u5411\u91cf\u7684\u7ef4\u5ea6\uff0c \\(i \\in [0, d_{model})\\) \u4ee3\u8868\u4f4d\u7f6e \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u7b2c \\(i\\) \u7ef4\u3002\u4e8e\u662f\u6839\u636e\u4e0a\u8ff0\u516c\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u7b2c \\(pos\\) \u4f4d\u7f6e\u7684 \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u3002\u5728\u4e0b\u56fe\u4e2d\uff0c\u6211\u4eec\u753b\u51fa\u4e86\u4e00\u79cd\u4f4d\u7f6e\u5411\u91cf\u5728\u7b2c4\u30015\u30016\u30017\u7ef4\u5ea6\u3001\u4e0d\u540c\u4f4d\u7f6e\u7684\u7684\u6570\u503c\u5927\u5c0f\u3002\u6a2a\u5750\u6807\u8868\u793a\u4f4d\u7f6e\u4e0b\u6807\uff0c\u7eb5\u5750\u6807\u8868\u793a\u6570\u503c\u5927\u5c0f\u3002 \u5f53\u7136\uff0c\u4e0a\u8ff0\u516c\u5f0f\u4e0d\u662f\u552f\u4e00\u751f\u6210\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u7684\u65b9\u6cd5\u3002\u4f46\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\uff1a\u53ef\u4ee5\u6269\u5c55\u5230\u672a\u77e5\u7684\u5e8f\u5217\u957f\u5ea6\u3002\u4f8b\u5982\uff1a\u5f53\u6211\u4eec\u7684\u6a21\u578b\u9700\u8981\u7ffb\u8bd1\u4e00\u4e2a\u53e5\u5b50\uff0c\u800c\u8fd9\u4e2a\u53e5\u5b50\u7684\u957f\u5ea6\u5927\u4e8e\u8bad\u7ec3\u96c6\u4e2d\u6240\u6709\u53e5\u5b50\u7684\u957f\u5ea6\uff0c\u8fd9\u65f6\uff0c\u8fd9\u79cd\u4f4d\u7f6e\u7f16\u7801\u7684\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u751f\u6210\u4e00\u6837\u957f\u7684\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u3002","title":"\u4f4d\u7f6e\u5411\u91cf"},{"location":"llm/transformer/transformer/#_5","text":"\u7f16\u7801\u90e8\u5206\u7684\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7ecf\u8fc7\u8f93\u5165\u5904\u7406\u4e4b\u540e\u5f97\u5230\u4e86\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u8fd9\u4e2a\u5411\u91cf\u5e8f\u5217\u5c06\u88ab\u9001\u5165\u7b2c1\u5c42\u7f16\u7801\u5668\uff0c\u7b2c1\u5c42\u7f16\u7801\u5668\u8f93\u51fa\u7684\u540c\u6837\u662f\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u518d\u63a5\u7740\u9001\u5165\u4e0b\u4e00\u5c42\u7f16\u7801\u5668\uff1a\u7b2c1\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u878d\u5408\u4f4d\u7f6e\u5411\u91cf\u7684\u8bcd\u5411\u91cf\uff0c\u66f4\u4e0a\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u5219\u662f\u4e0a\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u3002 \u5404\u4e2a\u8bcd\u5411\u91cf\u5747\u8fdb\u5165\u7f16\u7801\u5668\u7684\u4e24\u4e2a\u5b50\u5c42\uff0c self-attention \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u7684\u8def\u5f84\u5177\u6709\u4e00\u5b9a\u5173\u8054\uff0c\u800c FFNN \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u53c2\u4e0e\u7684\u8ba1\u7b97\u8fc7\u7a0b\u72ec\u7acb\u3002 self-attention \u4f7f\u5f97\u6a21\u578b\u5728\u5904\u7406\u4e00\u4e2a\u8bcd\u5411\u91cf\u65f6\uff0c\u80fd\u591f\u5c06\u5176\u4e0e\u76f8\u5173\u7684\u8bcd\u5173\u8054\u8d77\u6765\uff0c\u4ee5\u66f4\u597d\u5730\u5bf9\u8be5\u8bcd\u5411\u91cf\u7f16\u7801\u3002 RNN \u901a\u8fc7\u7ef4\u62a4\u9690\u85cf\u72b6\u6001\u4ee5\u5c06\u5148\u524d\u5904\u7406\u7684\u8bcd\u5411\u91cf\u540c\u5f53\u524d\u8bcd\u5411\u91cf\u5408\u5e76\uff0ctransformer \u5219\u4f7f\u7528 self-attention \u5c06\u5bf9\u76f8\u5173\u8bcd\u7684\u201c\u7406\u89e3\u201d\u878d\u5165\u5f53\u524d\u5904\u7406\u7684\u8bcd\u3002","title":"\u7f16\u7801\u5668"},{"location":"llm/transformer/transformer/#self-attention","text":"\u4e3a\u6bcf\u4e2a\u8bcd\u5411\u91cf\u521b\u5efa\u4e09\u4e2a\u5411\u91cf\uff1a Query \u3001 Key \u3001 Value \u3002\u8fd9\u4e09\u4e2a\u5411\u91cf\u662f\u901a\u8fc7\u5c06\u6bcf\u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u4e09\u4e2a\u5e26\u8bad\u7ec3\u7684\u77e9\u9635\u521b\u5efa\u7684\uff08\u5bf9\u540e\u9762\u7684\u7f16\u7801\u5668\uff0c\u5219\u662f\u4e0a\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u51fa\u4e58\u4ee5\u4e09\u4e2a\u65b0\u7684\u5f85\u8bad\u7ec3\u77e9\u9635\uff09\u3002 \u8ba1\u7b97\u5f53\u524d\u8bcd\u5411\u91cf\u4e0e\u8f93\u5165\u53e5\u5b50\u6240\u6709\u8bcd\u5411\u91cf\u7684\u5206\u6570\uff0c\u5206\u6570\u4f1a\u51b3\u5b9a\u5c06\u591a\u5c11\u6ce8\u610f\u529b\u653e\u5728\u8fd9\u4e9b\u8bcd\u4e0a\u3002\u5206\u6570\u901a\u8fc7\u5c06\u5f53\u524d\u8bcd\u5411\u91cf\u5bf9\u5e94\u7684 Query \u5411\u91cf\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 key \u5411\u91cf\u70b9\u79ef\u5f97\u5230\uff0c\u7b2c\u4e00\u4e2a\u5206\u6570\u662f q1 \u4e0e k1 \u70b9\u79ef\uff0c\u7b2c\u4e8c\u4e2a\u5206\u6570\u662f q1 \u4e0e k2 \u70b9\u79ef\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002 \u5c06\u5206\u6570\u9664\u4ee5 Query \u5411\u91cf\u957f\u5ea6\u7684\u5e73\u65b9\u6839\u3002\u6b64\u6b65\u9aa4\u63d0\u9ad8\u4e86\u68af\u5ea6\u7684\u7a33\u5b9a\u6027\u3002 \u901a\u8fc7 softmax \u5c06\u5206\u6570\u5f52\u4e00\u5316\u3002 \u5f52\u4e00\u5316\u7684\u5f97\u5206\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u76f8\u4e58\uff0c\u6b64\u505a\u6cd5\u7684\u76f4\u89c9\u662f\u4fdd\u6301\u60f3\u8981\u5173\u6ce8\u7684\u5355\u8bcd\u7684\u503c\u4e0d\u53d8\uff0c\u800c\u4e14\u6d88\u9664\u4e0d\u76f8\u5173\u7684\u5355\u8bcd\uff0c\u5373\u5bf9\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u52a0\u6743\u3002 \u5bf9\u6240\u6709\u52a0\u6743\u540e\u7684 Value \u5411\u91cf\u6c42\u548c\uff0c\u5373\u4e3a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u5c42\u7684\u8f93\u51fa\u3002 \u4e0a\u8ff0\u8fc7\u7a0b\u7684\u77e9\u9635\u5f62\u5f0f\u4e3a\uff1a","title":"Self-Attention \u5c42"},{"location":"llm/transformer/transformer/#_6","text":"\u8fdb\u4e00\u6b65\u4f18\u5316 Self-attention \uff1a\u4f7f\u7528 multi-headed attention \u3002\u63d0\u9ad8\u4e86\u6a21\u578b\u5173\u6ce8\u4e0d\u540c\u4f4d\u7f6e\u7684\u80fd\u529b\uff0c\u4e3a\u6ce8\u610f\u529b\u5c42\u63d0\u4f9b\u4e86\u591a\u4e2a\u8868\u793a\u5b50\u7a7a\u95f4\uff08 representation subspaces \uff09\u2014\u2014 \u53ef\u4ee5\u6709\u591a\u7ec4 Query \u3001 Key \u3001 Value \u6743\u91cd\u77e9\u9635\uff0c\u6bcf\u4e00\u7ec4\u90fd\u662f\u968f\u673a\u521d\u59cb\u5316\uff0c\u56e0\u6b64\u8bad\u7ec3\u5b8c\u6210\u540e\u6bcf\u4e00\u7ec4\u90fd\u53ef\u4ee5\u5c06\u8f93\u5165\u6295\u5c04\u5230\u4e0d\u540c\u7684\u5b50\u7a7a\u95f4\uff0c\u5177\u4f53\u53ef\u4ee5\u7c7b\u6bd4 CNN \u4e2d\u7684\u591a\u4e2a\u5377\u79ef\u6838\u3002 \u6700\u7ec8\u5c06\u5f97\u5230\u591a\u4e2a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u4e0b\u7684\u8f93\u51fa\u5411\u91cf\uff0c\u5373\u8f93\u5165\u53e5\u5b50\u7ecf\u8fc7 self-attention \u540e\uff0c\u5c06\u6709\u591a\u4e2a\u8f93\u51fa\u77e9\u9635\u3002 \u7531\u4e8e FFNN \u5b50\u5c42\u9700\u8981\u4e00\u4e2a\u77e9\u9635\uff08\u6bcf\u4e2a\u5355\u8bcd\u7531\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u4ee5\u4e0a\u8f93\u51fa\u77e9\u9635\u4e0e\u4e00\u4e2a\u989d\u5916\u7684\u5f85\u8bad\u7ec3\u6743\u91cd\u77e9\u9635\u76f8\u4e58\u3002 \u4e00\u4e2a\u591a\u5934\u6ce8\u610f\u529b\u7684\u4f8b\u5b50\uff1a","title":"\u591a\u5934\u6ce8\u610f\u529b"},{"location":"llm/transformer/transformer/#attention","text":"\u5f20\u91cf\u7684\u7b2c1\u7ef4\u662f batch size\uff0c\u7b2c 2 \u7ef4\u662f\u53e5\u5b50\u957f\u5ea6\u3002 class MultiheadAttention ( nn . Module ): # n_heads\uff1a\u591a\u5934\u6ce8\u610f\u529b\u7684\u6570\u91cf # hid_dim\uff1a\u6bcf\u4e2a\u8bcd\u8f93\u51fa\u7684\u5411\u91cf\u7ef4\u5ea6 def __init__ ( self , hid_dim , n_heads , dropout ): super ( MultiheadAttention , self ) . __init__ () self . hid_dim = hid_dim self . n_heads = n_heads # \u5f3a\u5236 hid_dim \u5fc5\u987b\u6574\u9664 h assert hid_dim % n_heads == 0 # \u5b9a\u4e49 W_q \u77e9\u9635 self . w_q = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_k \u77e9\u9635 self . w_k = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_v \u77e9\u9635 self . w_v = nn . Linear ( hid_dim , hid_dim ) self . fc = nn . Linear ( hid_dim , hid_dim ) self . do = nn . Dropout ( dropout ) # \u7f29\u653e self . scale = torch . sqrt ( torch . FloatTensor ([ hid_dim // n_heads ])) def forward ( self , query , key , value , mask = None ): # \u6ce8\u610f Q\uff0cK\uff0cV\u7684\u5728\u53e5\u5b50\u957f\u5ea6\u8fd9\u4e00\u4e2a\u7ef4\u5ea6\u7684\u6570\u503c\u53ef\u4ee5\u4e00\u6837\uff0c\u53ef\u4ee5\u4e0d\u4e00\u6837\u3002 # K: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # V: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # Q: [64,12,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 bsz = query . shape [ 0 ] Q = self . w_q ( query ) K = self . w_k ( key ) V = self . w_v ( value ) # \u8fd9\u91cc\u628a K Q V \u77e9\u9635\u62c6\u5206\u4e3a\u591a\u7ec4\u6ce8\u610f\u529b # \u6700\u540e\u4e00\u7ef4\u5c31\u662f\u662f\u7528 self.hid_dim // self.n_heads \u6765\u5f97\u5230\u7684\uff0c\u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u5411\u91cf\u957f\u5ea6, \u6bcf\u4e2a head \u7684\u5411\u91cf\u957f\u5ea6\u662f\uff1a300/6=50 # 64 \u8868\u793a batch size\uff0c6 \u8868\u793a\u6709 6\u7ec4\u6ce8\u610f\u529b\uff0c10 \u8868\u793a\u6709 10 \u8bcd\uff0c50 \u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u8bcd\u7684\u5411\u91cf\u957f\u5ea6 # K: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # V: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # Q: [64,12,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,12,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,12,50] # \u8f6c\u7f6e\u662f\u4e3a\u4e86\u628a\u6ce8\u610f\u529b\u7684\u6570\u91cf 6 \u653e\u5230\u524d\u9762\uff0c\u628a 10 \u548c 50 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u8ba1\u7b97 Q = Q . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) K = K . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) V = V . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) # \u7b2c 1 \u6b65\uff1aQ \u4e58\u4ee5 K\u7684\u8f6c\u7f6e\uff0c\u9664\u4ee5scale # [64,6,12,50] * [64,6,50,10] = [64,6,12,10] # attention\uff1a[64,6,12,10] attention = torch . matmul ( Q , K . permute ( 0 , 1 , 3 , 2 )) / self . scale # \u5982\u679c mask \u4e0d\u4e3a\u7a7a\uff0c\u90a3\u4e48\u5c31\u628a mask \u4e3a 0 \u7684\u4f4d\u7f6e\u7684 attention \u5206\u6570\u8bbe\u7f6e\u4e3a -1e10\uff0c\u8fd9\u91cc\u7528\u201c0\u201d\u6765\u6307\u793a\u54ea\u4e9b\u4f4d\u7f6e\u7684\u8bcd\u5411\u91cf\u4e0d\u80fd\u88abattention\u5230\uff0c\u6bd4\u5982padding\u4f4d\u7f6e\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528\u201c1\u201d\u6216\u8005\u5176\u4ed6\u6570\u5b57\u6765\u6307\u793a\uff0c\u4e3b\u8981\u8bbe\u8ba1\u4e0b\u97622\u884c\u4ee3\u7801\u7684\u6539\u52a8\u3002 if mask is not None : attention = attention . masked_fill ( mask == 0 , - 1e10 ) # \u7b2c 2 \u6b65\uff1a\u8ba1\u7b97\u4e0a\u4e00\u6b65\u7ed3\u679c\u7684 softmax\uff0c\u518d\u7ecf\u8fc7 dropout\uff0c\u5f97\u5230 attention\u3002 # \u6ce8\u610f\uff0c\u8fd9\u91cc\u662f\u5bf9\u6700\u540e\u4e00\u7ef4\u505a softmax\uff0c\u4e5f\u5c31\u662f\u5728\u8f93\u5165\u5e8f\u5217\u7684\u7ef4\u5ea6\u505a softmax # attention: [64,6,12,10] attention = self . do ( torch . softmax ( attention , dim =- 1 )) # \u7b2c\u4e09\u6b65\uff0cattention\u7ed3\u679c\u4e0eV\u76f8\u4e58\uff0c\u5f97\u5230\u591a\u5934\u6ce8\u610f\u529b\u7684\u7ed3\u679c # [64,6,12,10] * [64,6,10,50] = [64,6,12,50] # x: [64,6,12,50] x = torch . matmul ( attention , V ) # \u56e0\u4e3a query \u6709 12 \u4e2a\u8bcd\uff0c\u6240\u4ee5\u628a 12 \u653e\u5230\u524d\u9762\uff0c\u628a 50 \u548c 6 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u62fc\u63a5\u591a\u7ec4\u7684\u7ed3\u679c # x: [64,6,12,50] \u8f6c\u7f6e-> [64,12,6,50] x = x . permute ( 0 , 2 , 1 , 3 ) . contiguous () # \u8fd9\u91cc\u7684\u77e9\u9635\u8f6c\u6362\u5c31\u662f\uff1a\u628a\u591a\u7ec4\u6ce8\u610f\u529b\u7684\u7ed3\u679c\u62fc\u63a5\u8d77\u6765 # \u6700\u7ec8\u7ed3\u679c\u5c31\u662f [64,12,300] # x: [64,12,6,50] -> [64,12,300] x = x . view ( bsz , - 1 , self . n_heads * ( self . hid_dim // self . n_heads )) x = self . fc ( x ) return x # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 query = torch . rand ( 64 , 12 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Key \u5411\u91cf\u662f 300 \u7ef4 key = torch . rand ( 64 , 10 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Value \u5411\u91cf\u662f 300 \u7ef4 value = torch . rand ( 64 , 10 , 300 ) attention = MultiheadAttention ( hid_dim = 300 , n_heads = 6 , dropout = 0.1 ) output = attention ( query , key , value ) ## output: torch.Size([64, 12, 300]) print ( output . shape )","title":"Attention \u4ee3\u7801\u5b9e\u4f8b"},{"location":"llm/transformer/transformer/#_7","text":"\u7f16\u7801\u5668\u4e2d\u6bcf\u4e2a\u5b50\u5c42\u90fd\u8fdb\u884c\u6b8b\u5dee\u8fde\u63a5\uff0c\u5e76\u5f52\u4e00\u5316\u3002 \u5c06 Self-Attention \u5c42\u7684\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u548c\u6d89\u53ca\u7684\u5411\u91cf\u8ba1\u7b97\u7ec6\u8282\u90fd\u8fdb\u884c\u53ef\u89c6\u5316\uff0c\u5982\u4e0b\u6240\u793a\uff1a \u7f16\u7801\u5668\u548c\u548c\u89e3\u7801\u5668\u7684\u5b50\u5c42\u91cc\u9762\u90fd\u6709\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u3002\u5047\u8bbe\u4e00\u4e2a Transformer \u662f\u7531 2 \u5c42\u7f16\u7801\u5668\u548c\u4e24\u5c42\u89e3\u7801\u5668\u7ec4\u6210\u7684\uff0c\u5c06\u5168\u90e8\u5185\u90e8\u7ec6\u8282\u5c55\u793a\u8d77\u6765\u5982\u4e0b\u56fe\u6240\u793a\u3002","title":"\u6b8b\u5dee\u8fde\u63a5"},{"location":"llm/transformer/transformer/#_8","text":"\u7f16\u7801\u5668\u4e00\u822c\u6709\u591a\u5c42\uff0c\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u4e00\u4e2a\u5e8f\u5217\u6587\u672c\uff0c\u6700\u540e\u4e00\u4e2a\u7f16\u7801\u5668\u8f93\u51fa\u662f\u4e00\u7ec4\u5e8f\u5217\u5411\u91cf\uff0c\u8fd9\u7ec4\u5e8f\u5217\u5411\u91cf\u4f1a\u4f5c\u4e3a\u89e3\u7801\u5668\u7684 K\u3001V \u8f93\u5165\uff0c\u5176\u4e2d K=V=\u89e3\u7801\u5668\u8f93\u51fa\u7684\u5e8f\u5217\u5411\u91cf\u8868\u793a\u3002\u8fd9\u4e9b\u6ce8\u610f\u529b\u5411\u91cf\u5c06\u4f1a\u8f93\u5165\u5230\u6bcf\u4e2a\u89e3\u7801\u5668\u7684 Encoder-Decoder Attention \u5c42\uff0c\u8fd9\u6709\u52a9\u4e8e\u89e3\u7801\u5668\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u8f93\u5165\u5e8f\u5217\u7684\u5408\u9002\u4f4d\u7f6e\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002 \u89e3\u7801\uff08decoding\uff09\u9636\u6bb5\u7684\u6bcf\u4e00\u4e2a\u65f6\u95f4\u6b65\u90fd\u8f93\u51fa\u4e00\u4e2a\u7ffb\u8bd1\u540e\u7684\u5355\u8bcd\uff08\u8fd9\u91cc\u7684\u4f8b\u5b50\u662f\u82f1\u8bed\u7ffb\u8bd1\uff09\uff0c\u89e3\u7801\u5668\u5f53\u524d\u65f6\u95f4\u6b65\u7684\u8f93\u51fa\u53c8\u91cd\u65b0\u4f5c\u4e3a\u8f93\u51fa Q \u548c\u7f16\u7801\u5668\u7684\u8f93\u51fa K\u3001V \u5171\u540c\u4f5c\u4e3a\u4e0b\u4e00\u4e2a\u65f6\u95f4\u6b65\u89e3\u7801\u5668\u7684\u8f93\u5165\u3002\u7136\u540e\u91cd\u590d\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u76f4\u5230\u8f93\u51fa\u4e00\u4e2a\u7ed3\u675f\u7b26\u3002 \u89e3\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\uff0c\u548c\u7f16\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\u7684\u533a\u522b\uff1a \u5728\u89e3\u7801\u5668\u91cc\uff0cSelf Attention \u5c42\u53ea\u5141\u8bb8\u5173\u6ce8\u5230\u8f93\u51fa\u5e8f\u5217\u4e2d\u65e9\u4e8e\u5f53\u524d\u4f4d\u7f6e\u4e4b\u524d\u7684\u5355\u8bcd\u3002\u5177\u4f53\u505a\u6cd5\u662f\uff1a\u5728 Self Attention \u5206\u6570\u7ecf\u8fc7 Softmax \u5c42\u4e4b\u524d\uff0c\u5c4f\u853d\u5f53\u524d\u4f4d\u7f6e\u4e4b\u540e\u7684\u90a3\u4e9b\u4f4d\u7f6e\uff08\u5c06attention score\u8bbe\u7f6e\u6210-inf\uff09\u3002 \u89e3\u7801\u5668 Attention\u5c42\u662f\u4f7f\u7528\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u6765\u6784\u9020Query \u77e9\u9635\uff0c\u800cKey\u77e9\u9635\u548c Value\u77e9\u9635\u6765\u81ea\u4e8e\u7f16\u7801\u5668\u6700\u7ec8\u7684\u8f93\u51fa\u3002","title":"\u89e3\u7801\u5668"},{"location":"llm/transformer/transformer/#reference","text":"learn-nlp-with-transformers 10\u5206\u949f\u5e26\u4f60\u6df1\u5165\u7406\u89e3Transformer\u539f\u7406\u53ca\u5b9e\u73b0 Transformer\u539f\u7406\u8be6\u89e3 transformer \u539f\u7406","title":"Reference"},{"location":"llm/transformer/vit/","text":"Vision Transformer \u00b6 \u7ea6 1497 \u4e2a\u5b57 128 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract Google \u9996\u6b21 \u5c06 Transformer \u5e94\u7528\u5230\u89c6\u89c9\u4e0a\uff0c\u5373 ViT\u3002 \u53c2\u8003\uff1a \u8bba\u6587\uff1a https://arxiv.org/abs/2010.11929 \u4ee3\u7801 https://github.com/google-research/vision_transformer Vit \u6a21\u578b\u4ecb\u7ecd \u00b6 \u5728 CV \u4e2d\uff0c\u5377\u79ef\u67b6\u6784\u4ecd\u5360\u4e3b\u5bfc\u5730\u4f4d\uff0c\u53d7 NLP \u7684\u542f\u53d1\uff0c\u5c1d\u8bd5\u5c06 Attention + CNN \u6216 Attention \u66ff\u6362 CNN components\uff08\u4fdd\u6301 CNN \u7684\u6574\u4f53\u7ed3\u6784\uff09\u3002 \u901a\u8fc7 Transformer \u7684\u653e\u7f29/\u6269\u5c55\uff0c\u5c1d\u8bd5\u5c06 Transformer \u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\uff0c\u4e3a\u6b64\uff0c\u6211\u4eec \u5c06\u56fe\u50cf\u62c6\u5206\u4e3a\u5757 (patch)\uff0c\u5e76\u5c06\u8fd9\u4e9b\u56fe\u50cf\u5757\u7684\u7ebf\u6027\u5d4c\u5165\u5e8f\u5217\u4f5c\u4e3a Transformer \u7684\u8f93\u5165\u3002\u56fe\u50cf\u5757 (patches) \u7684\u5904\u7406\u65b9\u5f0f\u540c NLP \u7684\u6807\u8bb0 (tokens) (\u6545\u7ecf\u8fc7\u7ebf\u6027\u5d4c\u5165\u540e\u53c8\u53eb patch token)\u3002 \u6211\u4eec\u4ee5\u6709\u76d1\u7763\u65b9\u5f0f\u8bad\u7ec3\u56fe\u50cf\u5206\u7c7b\u6a21\u578b\u3002 Vit \u8bc1\u660e\u4e0d\u9700\u8981\u5b8c\u5168\u4f9d\u8d56 CNNs\uff0c\u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\u5757\u5e8f\u5217\uff08sequences of images patches\uff09\u7684\u7eaf Transformer \u53ef\u4ee5\u5f88\u597d\u5730\u6267\u884c\u56fe\u50cf\u5206\u7c7b\u7684\u4efb\u52a1\u3002\u5f53\u5bf9\u5927\u91cf\u6570\u636e\u8fdb\u884c\u9884\u8bad\u7ec3\u5e76\u8fc1\u79fb\u5230\u591a\u4e2a\u4e2d\u5c0f\u578b\u56fe\u50cf\u8bc6\u522b\u57fa\u51c6\u65f6\uff0cViT \u6709\u66f4\u597d\u7684\u6548\u679c\u3002 \u65b9\u6cd5 \u00b6 \u56fe\u50cf\u5757\u5d4c\u5165 \u00b6 \u6807\u51c6 Transformer \u4f7f\u7528 \u4e00\u7ef4\u6807\u8bb0\u5d4c\u5165\u5e8f\u5217\uff08Sequence of token embeddings\uff09 \u4f5c\u4e3a\u8f93\u5165\u3002 \u4e3a\u5904\u7406 2D \u56fe\u50cf\uff0c\u5c06\u56fe\u50cf \\(x \\in R^{H \\times W \\times C}\\) reshape \u4e3a\u4e00\u4e2a\u94fa\u5e73\u7684 2D patches \u5e8f\u5217 \\(x_p \\in R^{N \\times (P^2 \\cdot C)}\\) (H,W)\uff1a\u4e3a\u539f\u59cb\u56fe\u50cf\u5206\u8fa8\u7387 C\uff1a\u539f\u59cb\u56fe\u50cf\u901a\u9053\u6570 (P,P)\uff1a\u6bcf\u4e2a\u56fe\u50cf patch \u7684\u5206\u8fa8\u7387 \u4ea7\u751f\u7684\u56fe\u50cf patch \u6570 \\(N = \\frac{HW}{P^2}\\) \uff1aTransformer \u7684\u6709\u6548\u8f93\u5165\u5e8f\u5217\u957f\u5ea6 Transformer \u5728\u5176\u6240\u6709\u5c42\u4e2d\u4f7f\u7528\u6052\u5b9a\u7684\u9690\u5411\u91cf\uff08latent vector\uff09\u5927\u5c0f D\uff0c\u5c06\u56fe\u50cf patches \u94fa\u5e73\uff0c\u5e76\u4f7f\u7528 \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71\uff08FC \u5c42\uff09\u5c06\u7ef4\u5ea6 \\(P^2C\\) \u6620\u5c04\u4e3a D \u7ef4 \uff0c\u540c\u65f6\u4fdd\u6301\u56fe\u50cf patches \u6570 D \u4e0d\u53d8\u3002 \u6295\u5f71\u8f93\u51fa\u5373\u4e3a \u56fe\u50cf\u5757\u5d4c\u5165 \uff0c\u7b49\u540c\u4e8e NLP \u4e2d\u7684 \u8bcd\u5d4c\u5165 \u3002 PatchEmbed class PatchEmbed ( nn . Module ): \"\"\" Image to Patch Embedding \"\"\" def __init__ ( self , img_size = 224 , patch_size = 16 , in_chans = 3 , embed_dim = 768 ): super () . __init__ () # (H, W) img_size = to_2tuple ( img_size ) # (P, P) patch_size = to_2tuple ( patch_size ) # N = (H // P) * (W // P) num_patches = ( img_size [ 1 ] // patch_size [ 1 ]) * ( img_size [ 0 ] // patch_size [ 0 ]) self . img_size = img_size self . patch_size = patch_size self . num_patches = num_patches # \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71 - \u83b7\u53d6\u8f93\u5165\u5d4c\u5165 self . proj = nn . Conv2d ( in_chans , embed_dim , kernel_size = patch_size , stride = patch_size ) def forward ( self , x ): B , C , H , W = x . shape assert H == self . img_size [ 0 ] and W == self . img_size [ 1 ], \\ f \"Input image size ( { H } * { W } ) doesn't match model ( { self . img_size [ 0 ] } * { self . img_size [ 1 ]}) . \" # (B, C, H, W) -> (B, D, (H//P), (W//P)) -> (B, D, N) -> (B, N, D) # D=embed_dim=768, N=num_patches=(H//P)*(W//P) # torch.flatten(input, start_dim=0, end_dim=-1) # \u5f62\u53c2\uff1a\u5c55\u5e73\u7684\u8d77\u59cb\u7ef4\u5ea6\u548c\u7ed3\u675f\u7ef4\u5ea6 # \u53ef\u89c1 Patch Embedding \u64cd\u4f5c 1 \u884c\u4ee3\u7801 3 \u6b65\u5230\u4f4d x = self . proj ( x ) . flatten ( 2 ) . transpose ( 1 , 2 ) return x \u4f4d\u7f6e\u4fe1\u606f\u7f16\u7801 \u00b6 \u4f4d\u7f6e\u5d4c\u5165 \\(E_{pos} \\in R^{(N+1) \\times D}\\) \u88ab\u52a0\u5165\u5230\u56fe\u50cf\u5757\u5d4c\u5165\uff0c\u4ee5\u4fdd\u7559\u8f93\u5165\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u4fe1\u606f\u3002 \u4e0d\u540c\u4e8e CNN\uff0cTransformer \u9700\u8981\u4f4d\u7f6e\u5d4c\u5165\u6765\u7f16\u7801 patch tokens \u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u8fd9\u4e3b\u8981\u7531\u4e8e self-attention \u7684\u6270\u52a8\u4e0d\u53d8\u6027\uff08\u6253\u4e71 Sequence \u4e2d tokens \u7684\u987a\u5e8f\u5e76\u4e0d\u4f1a\u6539\u53d8\u7ed3\u679c\uff09 \u5982\u679c\u4e0d\u52a0\u4f4d\u7f6e\u4fe1\u606f\uff0c\u6a21\u578b\u5c31\u9700\u8981\u901a\u8fc7\u56fe\u50cf\u5757\u7684\u8bed\u4e49\u6765\u5b66\u4e60\u62fc\u56fe Vit \u4e2d\u63d0\u4f9b\u7684\u4f4d\u7f6e\u7f16\u7801\u65b9\u6848 \u65e0\u4f4d\u7f6e\u5d4c\u5165 1-D \u4f4d\u7f6e\u5d4c\u5165 (1D-PE)\uff1a\u8003\u8651\u628a 2-D \u56fe\u50cf\u5757\u89c6\u4e3a 1-D \u5e8f\u5217 2-D \u4f4d\u7f6e\u5d4c\u5165 (2D-PE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684 2-D \u4f4d\u7f6e (x, y) \u76f8\u5bf9\u4f4d\u7f6e\u5d4c\u5165 (RPE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684\u76f8\u5bf9\u4f4d\u7f6e \u5728\u8f93\u5165 Transformer \u7f16\u7801\u5668\u4e4b\u524d\u76f4\u63a5\u5c06\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u5d4c\u5165\u76f8\u52a0 Transformer \u7f16\u7801\u5668 \u00b6 Encoder \u7531\u4ea4\u66ff\u7684\u591a\u5934\u81ea\u6ce8\u610f\u529b\u5c42\uff08MSA\uff09\u548c\u591a\u5c42\u611f\u77e5\u673a\u5757\uff08MLP\uff09\u6784\u6210\u3002\u5728\u6bcf\u4e2a\u5757\u524d\u5e94\u7528\u5c42\u5f52\u4e00\u5316\uff08Layer Norm\uff09\uff0c\u6bcf\u4e2a\u5757\u540e\u5e94\u7528\u6b8b\u5dee\u8fde\u63a5\uff08Residual Connection\uff09 MSA ```python class Attention(nn.Module): def init (self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0., proj_drop=0.): super(). init () self.num_heads = num_heads head_dim = dim // num_heads self.scale = qk_scale or head_dim ** -0.5 self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias) self.attn_drop = nn.Dropout(attn_drop) self.proj = nn.Linear(dim, dim) # \u9644\u5e26 dropout self.proj_drop = nn.Dropout(proj_drop) def forward(self, x): B, N, C = x.shape qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4) q, k, v = qkv[0], qkv[1], qkv[2] # make torchscript happy (cannot use tensor as tuple) attn = (q @ k.transpose(-2, -1)) * self.scale attn = attn.softmax(dim=-1) attn = self.attn_drop(attn) x = (attn @ v).transpose(1, 2).reshape(B, N, C) x = self.proj(x) x = self.proj_drop(x) return x ``` MSA \u540e\u8ddf\u4e00\u4e2a FFN\uff0c\u5305\u542b\u4e24\u4e2a FC \u5c42\uff0c\u7b2c\u4e00\u4e2a FC \u5c06\u7279\u5f81\u4ece\u7ef4\u5ea6 D \u53d8\u6362\u6210 4D\uff0c\u7b2c\u4e8c\u4e2a FC \u5c06\u7ef4\u5ea6 4D \u6062\u590d\u6210 D\uff0c\u4e2d\u95f4\u7684\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\u5747\u91c7\u7528 GeLU (Gaussian Error Linear Unit\uff0c\u9ad8\u65af\u8bef\u5dee\u7ebf\u6027\u5355\u5143) \uff0c\u5b9e\u8d28\u4e0a\u662f\u4e00\u4e2a MLP (\u591a\u5c42\u611f\u77e5\u673a\u4e0e\u7ebf\u6027\u6a21\u578b\u7c7b\u4f3c\uff0c\u533a\u522b\u5728\u4e8e MLP \u76f8\u5bf9\u4e8e FC \u5c42\u6570\u589e\u52a0\u4e14\u5f15\u5165\u4e86\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\uff0c\u4f8b\u5982 FC + GeLU + FC) MLP class Mlp ( nn . Module ): def __init__ ( self , in_features , hidden_features = None , out_features = None , act_layer = nn . GELU , drop = 0. ): super () . __init__ () out_features = out_features or in_features hidden_features = hidden_features or in_features self . fc1 = nn . Linear ( in_features , hidden_features ) self . act = act_layer () self . fc2 = nn . Linear ( hidden_features , out_features ) self . drop = nn . Dropout ( drop ) def forward ( self , x ): x = self . fc1 ( x ) x = self . act ( x ) x = self . drop ( x ) x = self . fc2 ( x ) x = self . drop ( x ) return x \u4e00\u4e2a Encoder block \u5305\u542b\u4e00\u4e2a MSA \u548c\u4e00\u4e2a FFN\uff0c\u4e8c\u8005\u90fd\u6709 \u8df3\u8dc3\u8fde\u63a5 \u548c \u5c42\u5f52\u4e00\u5316 \u64cd\u4f5c\u6784\u6210 MSA block \u548c MLP block block # Transformer Encoder Block class Block ( nn . Module ): def __init__ ( self , dim , num_heads , mlp_ratio = 4. , qkv_bias = False , qk_scale = None , drop = 0. , attn_drop = 0. , drop_path = 0. , act_layer = nn . GELU , norm_layer = nn . LayerNorm ): super () . __init__ () # \u540e\u63a5\u4e8e MHA \u7684 Layer Norm self . norm1 = norm_layer ( dim ) # MHA self . attn = Attention ( dim , num_heads = num_heads , qkv_bias = qkv_bias , qk_scale = qk_scale , attn_drop = attn_drop , proj_drop = drop ) # NOTE: drop path for stochastic depth, we shall see if this is better than dropout here self . drop_path = DropPath ( drop_path ) if drop_path > 0. else nn . Identity () # \u540e\u63a5\u4e8e MLP \u7684 Layer Norm self . norm2 = norm_layer ( dim ) # \u9690\u85cf\u5c42\u7ef4\u5ea6 mlp_hidden_dim = int ( dim * mlp_ratio ) # MLP self . mlp = Mlp ( in_features = dim , hidden_features = mlp_hidden_dim , act_layer = act_layer , drop = drop ) def forward ( self , x ): # MHA + Add & Layer Norm x = x + self . drop_path ( self . attn ( self . norm1 ( x ))) # MLP + Add & Layer Norm x = x + self . drop_path ( self . mlp ( self . norm2 ( x ))) return x \u96c6\u5408\u4e86\u7c7b\u522b\u5411\u91cf\u3001\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u7f16\u7801\u4e3a\u4e00\u4f53\u7684 \u8f93\u5165\u5d4c\u5165\u5411\u91cf \u540e\uff0c\u5373\u53ef\u9988\u5165Transformer Encoder\u3002ViT \u7c7b\u4f3c\u4e8e CNN\uff0c\u4e0d\u65ad\u524d\u5411\u901a\u8fc7\u7531 Transformer Encoder Blocks \u4e32\u884c\u5806\u53e0\u6784\u6210\u7684 Transformer Encoder\uff0c\u6700\u540e \u63d0\u53d6\u53ef\u5b66\u4e60\u7684\u7c7b\u522b\u5d4c\u5165\u5411\u91cf \u2014\u2014 class token \u5bf9\u5e94\u7684\u7279\u5f81\u7528\u4e8e \u56fe\u50cf\u5206\u7c7b\u3002 \u5f52\u7eb3\u504f\u7f6e\u4e0e\u6df7\u5408\u67b6\u6784 \u00b6 \u5f52\u7eb3\u504f\u7f6e \u00b6 ViT \u7684\u56fe\u50cf\u7279\u5b9a\u5f52\u7eb3\u504f\u6267\u6bd4 CNN \u5c11\u5f88\u591a\u3002 \u5728 CNN \u4e2d\uff0c\u5c40\u90e8\u6027\u3001\u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\u548c\u5e73\u79fb\u7b49\u6548\u6027\u5b58\u5728\u4e8e\u6574\u4e2a\u6a21\u578b\u7684\u6bcf\u4e00\u5c42\u4e2d\u3002 \u5728 ViT \u4e2d\uff0c\u53ea\u6709 MLP \u5c42\u662f\u5c40\u90e8\u548c\u5e73\u79fb\u7b49\u53d8\u7684\uff0c\u56e0\u4e3a\u81ea\u6ce8\u610f\u529b\u5c42\u90fd\u662f\u5168\u5c40\u7684\u3002 \u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\uff1a\u5728\u6a21\u578b\u5f00\u59cb\u65f6\u901a\u8fc7\u5c06\u56fe\u50cf\u5207\u5206\u6210\u5757\uff0c\u5e76\u5728\u5fae\u8c03\u65f6\u8c03\u6574\u4e0d\u540c\u5206\u8fa8\u7387\u56fe\u50cf\u7684\u4f4d\u7f6e\u5d4c\u5165\u3002 \u521d\u59cb\u5316\u65f6\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u643a\u5e26\u6709\u5173\u56fe\u50cf\u5757\u7684 2D \u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u6240\u6709\u7a7a\u95f4\u5173\u7cfb\u90fd\u5fc5\u987b\u4ece\u5934\u5f00\u59cb\u5b66\u4e60\u3002 \u6df7\u5408\u67b6\u6784 \u00b6 \u6df7\u5408\u67b6\u6784\uff1a\u4f5c\u4e3a\u539f\u59cb\u56fe\u50cf\u5757\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u8f93\u5165\u5e8f\u5217\u53ef\u7531 CNN \u7684\u7279\u5f81\u56fe\u6784\u6210\u3002 \u56fe\u50cf\u5757\u5d4c\u5165\u6295\u5f71 E \u88ab\u7528\u5728\u7ecf CNN \u7279\u5f81\u63d0\u53d6\u7684\u5757\u800c\u975e\u539f\u59cb\u8f93\u5165\u56fe\u50cf\u5757\u3002\u5757\u7684\u7a7a\u95f4\u5c3a\u5bf8\u4e3a 1x1\uff0c\u8fd9\u8868\u793a\u8f93\u5165\u5e8f\u5217\u662f\u901a\u8fc7\u7b80\u5355\u5730\u5c06\u7279\u5f81\u56fe\u7684\u7a7a\u95f4\u7ef4\u5ea6\u94fa\u5e73\u5e76\u6295\u5f71\u5230 Transformer \u7ef4\u5ea6\u83b7\u5f97\u3002 \u5fae\u8c03\u53ca\u66f4\u9ad8\u5206\u8fa8\u7387 \u00b6 \u5728\u5927\u578b\u6570\u636e\u96c6\u4e0a\u9884\u8bad\u7ec3 ViT\uff0c\u5e76\u5bf9\uff08\u66f4\u5c0f\u7684\uff09\u4e0b\u6e38\u4efb\u52a1\u8fdb\u884c\u5fae\u8c03\u3002\u4e3a\u6b64\uff0c\u79fb\u9664\u4e86\u9884\u8bad\u7ec3\u7684\u9884\u6d4b\u5934\u90e8\uff0c\u6362\u4e3a\u4e00\u4e2a\u96f6\u503c\u521d\u59cb\u5316\u7684 DxK \u524d\u9988\u5c42/\u5168\u8fde\u63a5\u5c42\uff0c\u5176\u4e2d K \u662f\u4e0b\u6e38\u4efb\u52a1\u7684\u7c7b\u522b\u6570\u3002 \u7528\u6bd4\u9884\u8bad\u7ec3\u65f6\u66f4\u9ad8\u7684\u56fe\u50cf\u5206\u8fa8\u7387\u8fdb\u884c\u5fae\u8c03\u901a\u5e38\u6548\u7387\u66f4\u9ad8\u3002\u5f53\u63d0\u4f9b\u66f4\u9ad8\u5206\u8fa8\u7387\u7684\u56fe\u50cf\u65f6\uff0c\u9700\u4fdd\u6301\u56fe\u50cf patchs \u5927\u5c0f\u76f8\u540c\uff0c\u6b64\u65f6\u6709\u6548\u56fe\u50cf patchs \u6570\u53d8\u591a\uff0c\u4ece\u800c\u6709\u6548\u5e8f\u5217\u957f\u5ea6\u4f1a\u66f4\u957f\u3002 ViT \u53ef\u4ee5\u5904\u7406\u4efb\u610f\u5e8f\u5217\u957f\u5ea6\uff0c\u4f46\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u518d\u6709\u610f\u4e49\uff0c\u56e0\u6b64\u6839\u636e\u5b83\u4eec\u5728\u539f\u56fe\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5bf9\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u6267\u884c 2D \u63d2\u503c\uff0c\u4ee5\u6269\u5c55\u5230\u5fae\u8c03\u5c3a\u5bf8\u3002 resize_pos_embed def resize_pos_embed ( posemb , posemb_new ): # Rescale the grid of position embeddings when loading from state_dict. Adapted from # https://github.com/google-research/vision_transformer/blob/00883dd691c63a6830751563748663526e811cee/vit_jax/checkpoint.py#L224 _logger . info ( 'Resized position embedding: %s to %s ' , posemb . shape , posemb_new . shape ) ntok_new = posemb_new . shape [ 1 ] # \u9664\u53bb class token \u7684 pos_embed posemb_tok , posemb_grid = posemb [:, : 1 ], posemb [ 0 , 1 :] ntok_new -= 1 gs_old = int ( math . sqrt ( len ( posemb_grid ))) gs_new = int ( math . sqrt ( ntok_new )) _logger . info ( 'Position embedding grid-size from %s to %s ' , gs_old , gs_new ) # \u628a pos_embed \u53d8\u6362\u5230 2-D \u7ef4\u5ea6\u518d\u8fdb\u884c\u63d2\u503c posemb_grid = posemb_grid . reshape ( 1 , gs_old , gs_old , - 1 ) . permute ( 0 , 3 , 1 , 2 ) posemb_grid = F . interpolate ( posemb_grid , size = ( gs_new , gs_new ), mode = 'bilinear' ) posemb_grid = posemb_grid . permute ( 0 , 2 , 3 , 1 ) . reshape ( 1 , gs_new * gs_new , - 1 ) posemb = torch . cat ([ posemb_tok , posemb_grid ], dim = 1 ) return posemb \u4f46\u8fd9\u79cd\u60c5\u5f62\u4f1a\u9020\u6210\u6027\u80fd\u635f\u5931\uff0c\u53ef\u901a\u8fc7\u5fae\u8c03\u6a21\u578b\u89e3\u51b3\u3002 \u8d85\u53c2\u6570 \u00b6 Layers \uff1aTransformer Encoder Blocks \u7684\u6570\u91cf Hidden Size D \uff1a\u9690\u85cf\u5c42\u7279\u5f81\u5927\u5c0f\uff0c\u5728\u5404 Encoder Block \u4fdd\u6301\u4e00\u81f4 MLP Size \uff1aMLP \u7279\u5f81\u5927\u5c0f\uff0c\u901a\u5e38\u8bbe\u4e3a 4D Heads \uff1aMSA \u7684\u5934\u6570 Patch Size \uff1a\u6a21\u578b\u8f93\u5165\u7684 Patch size\uff0cViT \u4e2d\u6709\u4e24\u79cd\u8bbe\u7f6e\uff1a14x14 \u548c 16x16","title":"ViT"},{"location":"llm/transformer/vit/#vision-transformer","text":"\u7ea6 1497 \u4e2a\u5b57 128 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract Google \u9996\u6b21 \u5c06 Transformer \u5e94\u7528\u5230\u89c6\u89c9\u4e0a\uff0c\u5373 ViT\u3002 \u53c2\u8003\uff1a \u8bba\u6587\uff1a https://arxiv.org/abs/2010.11929 \u4ee3\u7801 https://github.com/google-research/vision_transformer","title":"Vision Transformer"},{"location":"llm/transformer/vit/#vit","text":"\u5728 CV \u4e2d\uff0c\u5377\u79ef\u67b6\u6784\u4ecd\u5360\u4e3b\u5bfc\u5730\u4f4d\uff0c\u53d7 NLP \u7684\u542f\u53d1\uff0c\u5c1d\u8bd5\u5c06 Attention + CNN \u6216 Attention \u66ff\u6362 CNN components\uff08\u4fdd\u6301 CNN \u7684\u6574\u4f53\u7ed3\u6784\uff09\u3002 \u901a\u8fc7 Transformer \u7684\u653e\u7f29/\u6269\u5c55\uff0c\u5c1d\u8bd5\u5c06 Transformer \u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\uff0c\u4e3a\u6b64\uff0c\u6211\u4eec \u5c06\u56fe\u50cf\u62c6\u5206\u4e3a\u5757 (patch)\uff0c\u5e76\u5c06\u8fd9\u4e9b\u56fe\u50cf\u5757\u7684\u7ebf\u6027\u5d4c\u5165\u5e8f\u5217\u4f5c\u4e3a Transformer \u7684\u8f93\u5165\u3002\u56fe\u50cf\u5757 (patches) \u7684\u5904\u7406\u65b9\u5f0f\u540c NLP \u7684\u6807\u8bb0 (tokens) (\u6545\u7ecf\u8fc7\u7ebf\u6027\u5d4c\u5165\u540e\u53c8\u53eb patch token)\u3002 \u6211\u4eec\u4ee5\u6709\u76d1\u7763\u65b9\u5f0f\u8bad\u7ec3\u56fe\u50cf\u5206\u7c7b\u6a21\u578b\u3002 Vit \u8bc1\u660e\u4e0d\u9700\u8981\u5b8c\u5168\u4f9d\u8d56 CNNs\uff0c\u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\u5757\u5e8f\u5217\uff08sequences of images patches\uff09\u7684\u7eaf Transformer \u53ef\u4ee5\u5f88\u597d\u5730\u6267\u884c\u56fe\u50cf\u5206\u7c7b\u7684\u4efb\u52a1\u3002\u5f53\u5bf9\u5927\u91cf\u6570\u636e\u8fdb\u884c\u9884\u8bad\u7ec3\u5e76\u8fc1\u79fb\u5230\u591a\u4e2a\u4e2d\u5c0f\u578b\u56fe\u50cf\u8bc6\u522b\u57fa\u51c6\u65f6\uff0cViT \u6709\u66f4\u597d\u7684\u6548\u679c\u3002","title":"Vit \u6a21\u578b\u4ecb\u7ecd"},{"location":"llm/transformer/vit/#_1","text":"","title":"\u65b9\u6cd5"},{"location":"llm/transformer/vit/#_2","text":"\u6807\u51c6 Transformer \u4f7f\u7528 \u4e00\u7ef4\u6807\u8bb0\u5d4c\u5165\u5e8f\u5217\uff08Sequence of token embeddings\uff09 \u4f5c\u4e3a\u8f93\u5165\u3002 \u4e3a\u5904\u7406 2D \u56fe\u50cf\uff0c\u5c06\u56fe\u50cf \\(x \\in R^{H \\times W \\times C}\\) reshape \u4e3a\u4e00\u4e2a\u94fa\u5e73\u7684 2D patches \u5e8f\u5217 \\(x_p \\in R^{N \\times (P^2 \\cdot C)}\\) (H,W)\uff1a\u4e3a\u539f\u59cb\u56fe\u50cf\u5206\u8fa8\u7387 C\uff1a\u539f\u59cb\u56fe\u50cf\u901a\u9053\u6570 (P,P)\uff1a\u6bcf\u4e2a\u56fe\u50cf patch \u7684\u5206\u8fa8\u7387 \u4ea7\u751f\u7684\u56fe\u50cf patch \u6570 \\(N = \\frac{HW}{P^2}\\) \uff1aTransformer \u7684\u6709\u6548\u8f93\u5165\u5e8f\u5217\u957f\u5ea6 Transformer \u5728\u5176\u6240\u6709\u5c42\u4e2d\u4f7f\u7528\u6052\u5b9a\u7684\u9690\u5411\u91cf\uff08latent vector\uff09\u5927\u5c0f D\uff0c\u5c06\u56fe\u50cf patches \u94fa\u5e73\uff0c\u5e76\u4f7f\u7528 \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71\uff08FC \u5c42\uff09\u5c06\u7ef4\u5ea6 \\(P^2C\\) \u6620\u5c04\u4e3a D \u7ef4 \uff0c\u540c\u65f6\u4fdd\u6301\u56fe\u50cf patches \u6570 D \u4e0d\u53d8\u3002 \u6295\u5f71\u8f93\u51fa\u5373\u4e3a \u56fe\u50cf\u5757\u5d4c\u5165 \uff0c\u7b49\u540c\u4e8e NLP \u4e2d\u7684 \u8bcd\u5d4c\u5165 \u3002 PatchEmbed class PatchEmbed ( nn . Module ): \"\"\" Image to Patch Embedding \"\"\" def __init__ ( self , img_size = 224 , patch_size = 16 , in_chans = 3 , embed_dim = 768 ): super () . __init__ () # (H, W) img_size = to_2tuple ( img_size ) # (P, P) patch_size = to_2tuple ( patch_size ) # N = (H // P) * (W // P) num_patches = ( img_size [ 1 ] // patch_size [ 1 ]) * ( img_size [ 0 ] // patch_size [ 0 ]) self . img_size = img_size self . patch_size = patch_size self . num_patches = num_patches # \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71 - \u83b7\u53d6\u8f93\u5165\u5d4c\u5165 self . proj = nn . Conv2d ( in_chans , embed_dim , kernel_size = patch_size , stride = patch_size ) def forward ( self , x ): B , C , H , W = x . shape assert H == self . img_size [ 0 ] and W == self . img_size [ 1 ], \\ f \"Input image size ( { H } * { W } ) doesn't match model ( { self . img_size [ 0 ] } * { self . img_size [ 1 ]}) . \" # (B, C, H, W) -> (B, D, (H//P), (W//P)) -> (B, D, N) -> (B, N, D) # D=embed_dim=768, N=num_patches=(H//P)*(W//P) # torch.flatten(input, start_dim=0, end_dim=-1) # \u5f62\u53c2\uff1a\u5c55\u5e73\u7684\u8d77\u59cb\u7ef4\u5ea6\u548c\u7ed3\u675f\u7ef4\u5ea6 # \u53ef\u89c1 Patch Embedding \u64cd\u4f5c 1 \u884c\u4ee3\u7801 3 \u6b65\u5230\u4f4d x = self . proj ( x ) . flatten ( 2 ) . transpose ( 1 , 2 ) return x","title":"\u56fe\u50cf\u5757\u5d4c\u5165"},{"location":"llm/transformer/vit/#_3","text":"\u4f4d\u7f6e\u5d4c\u5165 \\(E_{pos} \\in R^{(N+1) \\times D}\\) \u88ab\u52a0\u5165\u5230\u56fe\u50cf\u5757\u5d4c\u5165\uff0c\u4ee5\u4fdd\u7559\u8f93\u5165\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u4fe1\u606f\u3002 \u4e0d\u540c\u4e8e CNN\uff0cTransformer \u9700\u8981\u4f4d\u7f6e\u5d4c\u5165\u6765\u7f16\u7801 patch tokens \u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u8fd9\u4e3b\u8981\u7531\u4e8e self-attention \u7684\u6270\u52a8\u4e0d\u53d8\u6027\uff08\u6253\u4e71 Sequence \u4e2d tokens \u7684\u987a\u5e8f\u5e76\u4e0d\u4f1a\u6539\u53d8\u7ed3\u679c\uff09 \u5982\u679c\u4e0d\u52a0\u4f4d\u7f6e\u4fe1\u606f\uff0c\u6a21\u578b\u5c31\u9700\u8981\u901a\u8fc7\u56fe\u50cf\u5757\u7684\u8bed\u4e49\u6765\u5b66\u4e60\u62fc\u56fe Vit \u4e2d\u63d0\u4f9b\u7684\u4f4d\u7f6e\u7f16\u7801\u65b9\u6848 \u65e0\u4f4d\u7f6e\u5d4c\u5165 1-D \u4f4d\u7f6e\u5d4c\u5165 (1D-PE)\uff1a\u8003\u8651\u628a 2-D \u56fe\u50cf\u5757\u89c6\u4e3a 1-D \u5e8f\u5217 2-D \u4f4d\u7f6e\u5d4c\u5165 (2D-PE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684 2-D \u4f4d\u7f6e (x, y) \u76f8\u5bf9\u4f4d\u7f6e\u5d4c\u5165 (RPE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684\u76f8\u5bf9\u4f4d\u7f6e \u5728\u8f93\u5165 Transformer \u7f16\u7801\u5668\u4e4b\u524d\u76f4\u63a5\u5c06\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u5d4c\u5165\u76f8\u52a0","title":"\u4f4d\u7f6e\u4fe1\u606f\u7f16\u7801"},{"location":"llm/transformer/vit/#transformer","text":"Encoder \u7531\u4ea4\u66ff\u7684\u591a\u5934\u81ea\u6ce8\u610f\u529b\u5c42\uff08MSA\uff09\u548c\u591a\u5c42\u611f\u77e5\u673a\u5757\uff08MLP\uff09\u6784\u6210\u3002\u5728\u6bcf\u4e2a\u5757\u524d\u5e94\u7528\u5c42\u5f52\u4e00\u5316\uff08Layer Norm\uff09\uff0c\u6bcf\u4e2a\u5757\u540e\u5e94\u7528\u6b8b\u5dee\u8fde\u63a5\uff08Residual Connection\uff09 MSA ```python class Attention(nn.Module): def init (self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0., proj_drop=0.): super(). init () self.num_heads = num_heads head_dim = dim // num_heads self.scale = qk_scale or head_dim ** -0.5 self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias) self.attn_drop = nn.Dropout(attn_drop) self.proj = nn.Linear(dim, dim) # \u9644\u5e26 dropout self.proj_drop = nn.Dropout(proj_drop) def forward(self, x): B, N, C = x.shape qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4) q, k, v = qkv[0], qkv[1], qkv[2] # make torchscript happy (cannot use tensor as tuple) attn = (q @ k.transpose(-2, -1)) * self.scale attn = attn.softmax(dim=-1) attn = self.attn_drop(attn) x = (attn @ v).transpose(1, 2).reshape(B, N, C) x = self.proj(x) x = self.proj_drop(x) return x ``` MSA \u540e\u8ddf\u4e00\u4e2a FFN\uff0c\u5305\u542b\u4e24\u4e2a FC \u5c42\uff0c\u7b2c\u4e00\u4e2a FC \u5c06\u7279\u5f81\u4ece\u7ef4\u5ea6 D \u53d8\u6362\u6210 4D\uff0c\u7b2c\u4e8c\u4e2a FC \u5c06\u7ef4\u5ea6 4D \u6062\u590d\u6210 D\uff0c\u4e2d\u95f4\u7684\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\u5747\u91c7\u7528 GeLU (Gaussian Error Linear Unit\uff0c\u9ad8\u65af\u8bef\u5dee\u7ebf\u6027\u5355\u5143) \uff0c\u5b9e\u8d28\u4e0a\u662f\u4e00\u4e2a MLP (\u591a\u5c42\u611f\u77e5\u673a\u4e0e\u7ebf\u6027\u6a21\u578b\u7c7b\u4f3c\uff0c\u533a\u522b\u5728\u4e8e MLP \u76f8\u5bf9\u4e8e FC \u5c42\u6570\u589e\u52a0\u4e14\u5f15\u5165\u4e86\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\uff0c\u4f8b\u5982 FC + GeLU + FC) MLP class Mlp ( nn . Module ): def __init__ ( self , in_features , hidden_features = None , out_features = None , act_layer = nn . GELU , drop = 0. ): super () . __init__ () out_features = out_features or in_features hidden_features = hidden_features or in_features self . fc1 = nn . Linear ( in_features , hidden_features ) self . act = act_layer () self . fc2 = nn . Linear ( hidden_features , out_features ) self . drop = nn . Dropout ( drop ) def forward ( self , x ): x = self . fc1 ( x ) x = self . act ( x ) x = self . drop ( x ) x = self . fc2 ( x ) x = self . drop ( x ) return x \u4e00\u4e2a Encoder block \u5305\u542b\u4e00\u4e2a MSA \u548c\u4e00\u4e2a FFN\uff0c\u4e8c\u8005\u90fd\u6709 \u8df3\u8dc3\u8fde\u63a5 \u548c \u5c42\u5f52\u4e00\u5316 \u64cd\u4f5c\u6784\u6210 MSA block \u548c MLP block block # Transformer Encoder Block class Block ( nn . Module ): def __init__ ( self , dim , num_heads , mlp_ratio = 4. , qkv_bias = False , qk_scale = None , drop = 0. , attn_drop = 0. , drop_path = 0. , act_layer = nn . GELU , norm_layer = nn . LayerNorm ): super () . __init__ () # \u540e\u63a5\u4e8e MHA \u7684 Layer Norm self . norm1 = norm_layer ( dim ) # MHA self . attn = Attention ( dim , num_heads = num_heads , qkv_bias = qkv_bias , qk_scale = qk_scale , attn_drop = attn_drop , proj_drop = drop ) # NOTE: drop path for stochastic depth, we shall see if this is better than dropout here self . drop_path = DropPath ( drop_path ) if drop_path > 0. else nn . Identity () # \u540e\u63a5\u4e8e MLP \u7684 Layer Norm self . norm2 = norm_layer ( dim ) # \u9690\u85cf\u5c42\u7ef4\u5ea6 mlp_hidden_dim = int ( dim * mlp_ratio ) # MLP self . mlp = Mlp ( in_features = dim , hidden_features = mlp_hidden_dim , act_layer = act_layer , drop = drop ) def forward ( self , x ): # MHA + Add & Layer Norm x = x + self . drop_path ( self . attn ( self . norm1 ( x ))) # MLP + Add & Layer Norm x = x + self . drop_path ( self . mlp ( self . norm2 ( x ))) return x \u96c6\u5408\u4e86\u7c7b\u522b\u5411\u91cf\u3001\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u7f16\u7801\u4e3a\u4e00\u4f53\u7684 \u8f93\u5165\u5d4c\u5165\u5411\u91cf \u540e\uff0c\u5373\u53ef\u9988\u5165Transformer Encoder\u3002ViT \u7c7b\u4f3c\u4e8e CNN\uff0c\u4e0d\u65ad\u524d\u5411\u901a\u8fc7\u7531 Transformer Encoder Blocks \u4e32\u884c\u5806\u53e0\u6784\u6210\u7684 Transformer Encoder\uff0c\u6700\u540e \u63d0\u53d6\u53ef\u5b66\u4e60\u7684\u7c7b\u522b\u5d4c\u5165\u5411\u91cf \u2014\u2014 class token \u5bf9\u5e94\u7684\u7279\u5f81\u7528\u4e8e \u56fe\u50cf\u5206\u7c7b\u3002","title":"Transformer \u7f16\u7801\u5668"},{"location":"llm/transformer/vit/#_4","text":"","title":"\u5f52\u7eb3\u504f\u7f6e\u4e0e\u6df7\u5408\u67b6\u6784"},{"location":"llm/transformer/vit/#_5","text":"ViT \u7684\u56fe\u50cf\u7279\u5b9a\u5f52\u7eb3\u504f\u6267\u6bd4 CNN \u5c11\u5f88\u591a\u3002 \u5728 CNN \u4e2d\uff0c\u5c40\u90e8\u6027\u3001\u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\u548c\u5e73\u79fb\u7b49\u6548\u6027\u5b58\u5728\u4e8e\u6574\u4e2a\u6a21\u578b\u7684\u6bcf\u4e00\u5c42\u4e2d\u3002 \u5728 ViT \u4e2d\uff0c\u53ea\u6709 MLP \u5c42\u662f\u5c40\u90e8\u548c\u5e73\u79fb\u7b49\u53d8\u7684\uff0c\u56e0\u4e3a\u81ea\u6ce8\u610f\u529b\u5c42\u90fd\u662f\u5168\u5c40\u7684\u3002 \u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\uff1a\u5728\u6a21\u578b\u5f00\u59cb\u65f6\u901a\u8fc7\u5c06\u56fe\u50cf\u5207\u5206\u6210\u5757\uff0c\u5e76\u5728\u5fae\u8c03\u65f6\u8c03\u6574\u4e0d\u540c\u5206\u8fa8\u7387\u56fe\u50cf\u7684\u4f4d\u7f6e\u5d4c\u5165\u3002 \u521d\u59cb\u5316\u65f6\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u643a\u5e26\u6709\u5173\u56fe\u50cf\u5757\u7684 2D \u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u6240\u6709\u7a7a\u95f4\u5173\u7cfb\u90fd\u5fc5\u987b\u4ece\u5934\u5f00\u59cb\u5b66\u4e60\u3002","title":"\u5f52\u7eb3\u504f\u7f6e"},{"location":"llm/transformer/vit/#_6","text":"\u6df7\u5408\u67b6\u6784\uff1a\u4f5c\u4e3a\u539f\u59cb\u56fe\u50cf\u5757\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u8f93\u5165\u5e8f\u5217\u53ef\u7531 CNN \u7684\u7279\u5f81\u56fe\u6784\u6210\u3002 \u56fe\u50cf\u5757\u5d4c\u5165\u6295\u5f71 E \u88ab\u7528\u5728\u7ecf CNN \u7279\u5f81\u63d0\u53d6\u7684\u5757\u800c\u975e\u539f\u59cb\u8f93\u5165\u56fe\u50cf\u5757\u3002\u5757\u7684\u7a7a\u95f4\u5c3a\u5bf8\u4e3a 1x1\uff0c\u8fd9\u8868\u793a\u8f93\u5165\u5e8f\u5217\u662f\u901a\u8fc7\u7b80\u5355\u5730\u5c06\u7279\u5f81\u56fe\u7684\u7a7a\u95f4\u7ef4\u5ea6\u94fa\u5e73\u5e76\u6295\u5f71\u5230 Transformer \u7ef4\u5ea6\u83b7\u5f97\u3002","title":"\u6df7\u5408\u67b6\u6784"},{"location":"llm/transformer/vit/#_7","text":"\u5728\u5927\u578b\u6570\u636e\u96c6\u4e0a\u9884\u8bad\u7ec3 ViT\uff0c\u5e76\u5bf9\uff08\u66f4\u5c0f\u7684\uff09\u4e0b\u6e38\u4efb\u52a1\u8fdb\u884c\u5fae\u8c03\u3002\u4e3a\u6b64\uff0c\u79fb\u9664\u4e86\u9884\u8bad\u7ec3\u7684\u9884\u6d4b\u5934\u90e8\uff0c\u6362\u4e3a\u4e00\u4e2a\u96f6\u503c\u521d\u59cb\u5316\u7684 DxK \u524d\u9988\u5c42/\u5168\u8fde\u63a5\u5c42\uff0c\u5176\u4e2d K \u662f\u4e0b\u6e38\u4efb\u52a1\u7684\u7c7b\u522b\u6570\u3002 \u7528\u6bd4\u9884\u8bad\u7ec3\u65f6\u66f4\u9ad8\u7684\u56fe\u50cf\u5206\u8fa8\u7387\u8fdb\u884c\u5fae\u8c03\u901a\u5e38\u6548\u7387\u66f4\u9ad8\u3002\u5f53\u63d0\u4f9b\u66f4\u9ad8\u5206\u8fa8\u7387\u7684\u56fe\u50cf\u65f6\uff0c\u9700\u4fdd\u6301\u56fe\u50cf patchs \u5927\u5c0f\u76f8\u540c\uff0c\u6b64\u65f6\u6709\u6548\u56fe\u50cf patchs \u6570\u53d8\u591a\uff0c\u4ece\u800c\u6709\u6548\u5e8f\u5217\u957f\u5ea6\u4f1a\u66f4\u957f\u3002 ViT \u53ef\u4ee5\u5904\u7406\u4efb\u610f\u5e8f\u5217\u957f\u5ea6\uff0c\u4f46\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u518d\u6709\u610f\u4e49\uff0c\u56e0\u6b64\u6839\u636e\u5b83\u4eec\u5728\u539f\u56fe\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5bf9\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u6267\u884c 2D \u63d2\u503c\uff0c\u4ee5\u6269\u5c55\u5230\u5fae\u8c03\u5c3a\u5bf8\u3002 resize_pos_embed def resize_pos_embed ( posemb , posemb_new ): # Rescale the grid of position embeddings when loading from state_dict. Adapted from # https://github.com/google-research/vision_transformer/blob/00883dd691c63a6830751563748663526e811cee/vit_jax/checkpoint.py#L224 _logger . info ( 'Resized position embedding: %s to %s ' , posemb . shape , posemb_new . shape ) ntok_new = posemb_new . shape [ 1 ] # \u9664\u53bb class token \u7684 pos_embed posemb_tok , posemb_grid = posemb [:, : 1 ], posemb [ 0 , 1 :] ntok_new -= 1 gs_old = int ( math . sqrt ( len ( posemb_grid ))) gs_new = int ( math . sqrt ( ntok_new )) _logger . info ( 'Position embedding grid-size from %s to %s ' , gs_old , gs_new ) # \u628a pos_embed \u53d8\u6362\u5230 2-D \u7ef4\u5ea6\u518d\u8fdb\u884c\u63d2\u503c posemb_grid = posemb_grid . reshape ( 1 , gs_old , gs_old , - 1 ) . permute ( 0 , 3 , 1 , 2 ) posemb_grid = F . interpolate ( posemb_grid , size = ( gs_new , gs_new ), mode = 'bilinear' ) posemb_grid = posemb_grid . permute ( 0 , 2 , 3 , 1 ) . reshape ( 1 , gs_new * gs_new , - 1 ) posemb = torch . cat ([ posemb_tok , posemb_grid ], dim = 1 ) return posemb \u4f46\u8fd9\u79cd\u60c5\u5f62\u4f1a\u9020\u6210\u6027\u80fd\u635f\u5931\uff0c\u53ef\u901a\u8fc7\u5fae\u8c03\u6a21\u578b\u89e3\u51b3\u3002","title":"\u5fae\u8c03\u53ca\u66f4\u9ad8\u5206\u8fa8\u7387"},{"location":"llm/transformer/vit/#_8","text":"Layers \uff1aTransformer Encoder Blocks \u7684\u6570\u91cf Hidden Size D \uff1a\u9690\u85cf\u5c42\u7279\u5f81\u5927\u5c0f\uff0c\u5728\u5404 Encoder Block \u4fdd\u6301\u4e00\u81f4 MLP Size \uff1aMLP \u7279\u5f81\u5927\u5c0f\uff0c\u901a\u5e38\u8bbe\u4e3a 4D Heads \uff1aMSA \u7684\u5934\u6570 Patch Size \uff1a\u6a21\u578b\u8f93\u5165\u7684 Patch size\uff0cViT \u4e2d\u6709\u4e24\u79cd\u8bbe\u7f6e\uff1a14x14 \u548c 16x16","title":"\u8d85\u53c2\u6570"},{"location":"mb/","text":"\u6570\u7406\u57fa\u7840 \u00b6 Abstract \u8fd9\u91cc\u662f\u6570\u7406\u57fa\u7840\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u6570\u7406\u57fa\u7840 \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 4776 16 mins 1696841966 \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 4501 14 mins 1696680112 \u7ec4\u5408\u6570\u5b66 569 2 mins 1695089803 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u6570\u7406\u57fa\u7840"},{"location":"mb/#_1","text":"Abstract \u8fd9\u91cc\u662f\u6570\u7406\u57fa\u7840\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0","title":"\u6570\u7406\u57fa\u7840"},{"location":"mb/#table-of-contents","text":"\u6570\u7406\u57fa\u7840 \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 4776 16 mins 1696841966 \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 4501 14 mins 1696680112 \u7ec4\u5408\u6570\u5b66 569 2 mins 1695089803 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"mb/comb/","text":"\u7ec4\u5408\u6570\u5b66 \u00b6 \u6392\u5217\u7ec4\u5408 \u00b6 \u5706\u6392\u5217:n\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e00\u4e2a\u5708\u7684\u65b9\u6848\u6570\uff1a \\(\\frac{A_{n}^k}{k}\\) \u9879\u94fe\u6392\u5217: \\({\\frac{A_{n}^k}{2k}}\\) \u9519\u4f4d\u6392\u5217:n\u4e2a\u6570\u7684\u6240\u6709\u9519\u6392\u65b9\u6848\u6570\u7684\u9012\u63a8\u516c\u5f0f\u4e3a \\({f(n)=(n-1)*(f(n-1)+f(n-2))}\\) ,\u524d\u51e0\u9879\u4e3a \\(0\u30011\u30012\u30019\u300144\u3001265\\) \u591a\u91cd\u6392\u5217:\u8bbe \\(S=\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\(\\frac{n!}{n1!*n2!*...*nk!}\\) \u4e0d\u76f8\u90bb\u7ec4\u5408:[1,n]\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e0d\u76f8\u90bb\u7684\u6392\u5217\u7684\u65b9\u6848\u6570\u4e3a\uff1a \\(C_{n-k+1}^k\\) \u53ef\u91cd\u7ec4\u5408:\u8bbeS= \\(\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5728S\u4e2d\u9009r\u4e2a\uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\({C_{r+k-1}^{k-1}}\\) \u65b9\u6cd5\uff1a\u9694\u677f\u6cd5\uff0c\u6346\u7ed1\u6cd5... \u6269\u5c55: \u4e8c\u9879\u5f0f\u5b9a\u7406: \\((a+b)^n=\\sum_{k=0}^nC_n^ka^{n-k}b^k\\) \u591a\u9879\u5f0f\u5b9a\u7406: \\((x1+x2+...+xk)^n=\\sum_{n1+n2+...+nk=n}\\frac{n!}{n1!n2!...nk!}\\prod_{i=1}^kx_i^{ni}\\) \u683c\u8def\u95ee\u9898: \\((0,0)\\) \u70b9\u8d70\u5230 \\((m,n)\\) \u70b9\u7684\u65b9\u6848\u6570\u4e3a \\(C_{m+n}^n\\) \u6bcd\u51fd\u6570 \u00b6 \u666e\u901a\u578b\u6bcd\u51fd\u6570 \u00b6 \u4e3b\u8981\u6c42\u7ec4\u5408\u7684\u65b9\u6848\u6570\u3002 \u5f62\u5982 \\({a_0+a_1x^1+a_2x^2+...+a_nx^n}\\) \u6307\u6570\u578b\u6bcd\u51fd\u6570 \u00b6 \u4e3b\u8981\u6c42\u591a\u91cd\u6392\u5217\u6570\u3002 \u5f62\u5982 \\({a_0+\\frac{a_1x}{1!}+\\frac{a_2x^2}{2!}+...\\frac{a_nx^n}{n!}}\\) \u7279\u6b8a\u7684\u6570 \u00b6 \u6590\u6ce2\u90a3\u5951\u6570 \u00b6 \u9012\u63a8\u5f0f: \\(f(n)=f(n-1)+f(n-2)\\) \u4e8c\u9636\u5e38\u7cfb\u6570\u9012\u5f52\u516c\u5f0f: \\(f(n)=\\frac{1}{\\sqrt 5}[(\\frac{1+\\sqrt 5}{2})^n-(\\frac{1-\\sqrt 5}{2})^n]\\) \u524d\u51e0\u9879\u4e3a1\u30011\u30012\u30013\u30015\u30018... \u5361\u7279\u5170\u6570 \u00b6 \u5e38\u89c1\u516c\u5f0f\uff1a \\(H_n=\\frac{C_{2n}^n}{n+1}\\) \\(H_n=\\frac{H_{n-1}(4n-2)}{n+1}\\) \\(H_n=1 \\;\\;(n=0||n=1)\\) \\(H_n=\\sum_{i=1}^nH_{n-i}H_{i-1} (n\\geq 2)\\) \\(H_n=C_{2n}^n-C_{2n}^{n-1}\\) \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300114\u300142\u3001132... \u65af\u7279\u6797\u6570 \u00b6 \u7b2c\u4e00\u7c7bStirling\u6570 \u00b6 \u9012\u63a8\u5f0f: \\({S_u(n,k)=S_u(n-1,k-1)+(n-1)*S_u(n-1,k)}\\;\\;\\;S_u(0,0)=1\\) \u7b2c\u4e8c\u7c7bStirling\u6570 \u00b6 \u9012\u63a8\u5f0f: \\({S(n,k)=S(n-1,k-1)+k*S(n-1.k)}\\;\\;\\;S(0,0)=1\\) \u7ebf\u6027\u516c\u5f0f: \\({S(n,k)=\\frac{1}{k!}\\sum_{i=0}^k(-1)^iC_k^i(k-i)^n}\\) \u8d1d\u5c14\u6570 \u00b6 \u9012\u63a8\u5f0f: \\({B_{n+1}=\\sum_{k=0}^nC_n^kB_k}\\) \u6839\u636e\u7b2c\u4e8c\u7c7b\u65af\u7279\u6797\u6570: \\({B_n=\\sum_{k=0}^nS(n,k)}\\) \u62d3\u5c55\uff1a\u8d1d\u5c14\u4e09\u89d2\u5f62\u6c42\u89e3\u3002 \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300115\u300152\u3001203... \u4f2f\u52aa\u5229\u6570 \u00b6 \u7b49\u5e42\u6c42\u548c: \\(S_mn=\\frac{1}{m+1}\\sum_{k=0}^mC_{m+1}^kn^{m-k+1}\\) \\(\\sum_{i=1}^ni^k=\\frac{1}{k+1}\\sum_{i=1}^{k+1}C_{k+1}^iB_{k-i+1}(n+1)^i\\) \u9012\u63a8\u5f0f: \\({\\sum_{k=0}^nB_kC_{n+1}^k=0}\\;\\;\\;(B_0=1)\\) \\(B_n=-\\frac{1}{n+1}[C_{n+1}^0B0+C_{n+1}^1B1+...+C_{n+1}^{n-1}B_{n-1}]\\) \u524d\u51e0\u9879\u4e3a\uff1a \\(1\u3001-\\frac{1}{2}\u3001\\frac{1}{6}\u30010\u3001\\frac{1}{30}...\\)","title":"\u7ec4\u5408\u6570\u5b66"},{"location":"mb/comb/#_1","text":"","title":"\u7ec4\u5408\u6570\u5b66"},{"location":"mb/comb/#_2","text":"\u5706\u6392\u5217:n\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e00\u4e2a\u5708\u7684\u65b9\u6848\u6570\uff1a \\(\\frac{A_{n}^k}{k}\\) \u9879\u94fe\u6392\u5217: \\({\\frac{A_{n}^k}{2k}}\\) \u9519\u4f4d\u6392\u5217:n\u4e2a\u6570\u7684\u6240\u6709\u9519\u6392\u65b9\u6848\u6570\u7684\u9012\u63a8\u516c\u5f0f\u4e3a \\({f(n)=(n-1)*(f(n-1)+f(n-2))}\\) ,\u524d\u51e0\u9879\u4e3a \\(0\u30011\u30012\u30019\u300144\u3001265\\) \u591a\u91cd\u6392\u5217:\u8bbe \\(S=\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\(\\frac{n!}{n1!*n2!*...*nk!}\\) \u4e0d\u76f8\u90bb\u7ec4\u5408:[1,n]\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e0d\u76f8\u90bb\u7684\u6392\u5217\u7684\u65b9\u6848\u6570\u4e3a\uff1a \\(C_{n-k+1}^k\\) \u53ef\u91cd\u7ec4\u5408:\u8bbeS= \\(\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5728S\u4e2d\u9009r\u4e2a\uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\({C_{r+k-1}^{k-1}}\\) \u65b9\u6cd5\uff1a\u9694\u677f\u6cd5\uff0c\u6346\u7ed1\u6cd5... \u6269\u5c55: \u4e8c\u9879\u5f0f\u5b9a\u7406: \\((a+b)^n=\\sum_{k=0}^nC_n^ka^{n-k}b^k\\) \u591a\u9879\u5f0f\u5b9a\u7406: \\((x1+x2+...+xk)^n=\\sum_{n1+n2+...+nk=n}\\frac{n!}{n1!n2!...nk!}\\prod_{i=1}^kx_i^{ni}\\) \u683c\u8def\u95ee\u9898: \\((0,0)\\) \u70b9\u8d70\u5230 \\((m,n)\\) \u70b9\u7684\u65b9\u6848\u6570\u4e3a \\(C_{m+n}^n\\)","title":"\u6392\u5217\u7ec4\u5408"},{"location":"mb/comb/#_3","text":"","title":"\u6bcd\u51fd\u6570"},{"location":"mb/comb/#_4","text":"\u4e3b\u8981\u6c42\u7ec4\u5408\u7684\u65b9\u6848\u6570\u3002 \u5f62\u5982 \\({a_0+a_1x^1+a_2x^2+...+a_nx^n}\\)","title":"\u666e\u901a\u578b\u6bcd\u51fd\u6570"},{"location":"mb/comb/#_5","text":"\u4e3b\u8981\u6c42\u591a\u91cd\u6392\u5217\u6570\u3002 \u5f62\u5982 \\({a_0+\\frac{a_1x}{1!}+\\frac{a_2x^2}{2!}+...\\frac{a_nx^n}{n!}}\\)","title":"\u6307\u6570\u578b\u6bcd\u51fd\u6570"},{"location":"mb/comb/#_6","text":"","title":"\u7279\u6b8a\u7684\u6570"},{"location":"mb/comb/#_7","text":"\u9012\u63a8\u5f0f: \\(f(n)=f(n-1)+f(n-2)\\) \u4e8c\u9636\u5e38\u7cfb\u6570\u9012\u5f52\u516c\u5f0f: \\(f(n)=\\frac{1}{\\sqrt 5}[(\\frac{1+\\sqrt 5}{2})^n-(\\frac{1-\\sqrt 5}{2})^n]\\) \u524d\u51e0\u9879\u4e3a1\u30011\u30012\u30013\u30015\u30018...","title":"\u6590\u6ce2\u90a3\u5951\u6570"},{"location":"mb/comb/#_8","text":"\u5e38\u89c1\u516c\u5f0f\uff1a \\(H_n=\\frac{C_{2n}^n}{n+1}\\) \\(H_n=\\frac{H_{n-1}(4n-2)}{n+1}\\) \\(H_n=1 \\;\\;(n=0||n=1)\\) \\(H_n=\\sum_{i=1}^nH_{n-i}H_{i-1} (n\\geq 2)\\) \\(H_n=C_{2n}^n-C_{2n}^{n-1}\\) \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300114\u300142\u3001132...","title":"\u5361\u7279\u5170\u6570"},{"location":"mb/comb/#_9","text":"","title":"\u65af\u7279\u6797\u6570"},{"location":"mb/comb/#stirling","text":"\u9012\u63a8\u5f0f: \\({S_u(n,k)=S_u(n-1,k-1)+(n-1)*S_u(n-1,k)}\\;\\;\\;S_u(0,0)=1\\)","title":"\u7b2c\u4e00\u7c7bStirling\u6570"},{"location":"mb/comb/#stirling_1","text":"\u9012\u63a8\u5f0f: \\({S(n,k)=S(n-1,k-1)+k*S(n-1.k)}\\;\\;\\;S(0,0)=1\\) \u7ebf\u6027\u516c\u5f0f: \\({S(n,k)=\\frac{1}{k!}\\sum_{i=0}^k(-1)^iC_k^i(k-i)^n}\\)","title":"\u7b2c\u4e8c\u7c7bStirling\u6570"},{"location":"mb/comb/#_10","text":"\u9012\u63a8\u5f0f: \\({B_{n+1}=\\sum_{k=0}^nC_n^kB_k}\\) \u6839\u636e\u7b2c\u4e8c\u7c7b\u65af\u7279\u6797\u6570: \\({B_n=\\sum_{k=0}^nS(n,k)}\\) \u62d3\u5c55\uff1a\u8d1d\u5c14\u4e09\u89d2\u5f62\u6c42\u89e3\u3002 \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300115\u300152\u3001203...","title":"\u8d1d\u5c14\u6570"},{"location":"mb/comb/#_11","text":"\u7b49\u5e42\u6c42\u548c: \\(S_mn=\\frac{1}{m+1}\\sum_{k=0}^mC_{m+1}^kn^{m-k+1}\\) \\(\\sum_{i=1}^ni^k=\\frac{1}{k+1}\\sum_{i=1}^{k+1}C_{k+1}^iB_{k-i+1}(n+1)^i\\) \u9012\u63a8\u5f0f: \\({\\sum_{k=0}^nB_kC_{n+1}^k=0}\\;\\;\\;(B_0=1)\\) \\(B_n=-\\frac{1}{n+1}[C_{n+1}^0B0+C_{n+1}^1B1+...+C_{n+1}^{n-1}B_{n-1}]\\) \u524d\u51e0\u9879\u4e3a\uff1a \\(1\u3001-\\frac{1}{2}\u3001\\frac{1}{6}\u30010\u3001\\frac{1}{30}...\\)","title":"\u4f2f\u52aa\u5229\u6570"},{"location":"mb/maa/","text":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u77e9\u9635\u5206\u6790\u8bfe\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u7279\u6b8a\u77e9\u9635 \u77e9\u9635\u5fae\u5206 Reference \u00b6 \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 \u5f20\u8d24\u8fbe\u8457","title":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528"},{"location":"mb/maa/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u77e9\u9635\u5206\u6790\u8bfe\u7684\u7b14\u8bb0","title":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528"},{"location":"mb/maa/#table-of-contents","text":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u7279\u6b8a\u77e9\u9635 \u77e9\u9635\u5fae\u5206","title":"Table of Contents"},{"location":"mb/maa/#reference","text":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 \u5f20\u8d24\u8fbe\u8457","title":"Reference"},{"location":"mb/maa/lec1/","text":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u00b6 Abstract \u77e9\u9635\u662f\u63cf\u8ff0\u548c\u6c42\u89e3\u7ebf\u6027\u65b9\u7a0b\u7ec4\u6700\u57fa\u672c\u548c\u6700\u6709\u7528\u7684\u6570\u5b66\u5de5\u5177 \u6570\u5b66\u8fd0\u7b97: \u8f6c\u7f6e\u3001\u5185\u79ef\u3001\u5916\u79ef\u3001\u9006\u77e9\u9635\u3001\u5e7f\u4e49\u9006\u77e9\u9635\u7b49 \u6807\u91cf\u51fd\u6570\uff1a\u8303\u6570\u3001\u4e8c\u6b21\u578b\u3001\u884c\u5217\u5f0f\u3001\u7279\u5f81\u503c\u3001\u79e9\u548c\u8ff9 \u7279\u6b8a\u8fd0\u7b97: \u76f4\u548c\u3001\u76f4\u79ef\u3001Hadamard \u79ef\u3001Kronecker \u79ef\u3001\u5411\u91cf\u5316 \u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97 \u00b6 \u77e9\u9635\u4e0e\u5411\u91cf \u00b6 \\(m \\times n\\) \u7684\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u4f7f\u7528 \\(m\\) \u4e2a\u65b9\u7a0b\u63cf\u8ff0 \\(n\\) \u4e2a\u672a\u77e5\u91cf\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb\u3002\u7528\u77e9\u9635-\u5411\u91cf\u5f62\u5f0f\u8868\u793a\u4e3a \\(Ax = b\\) \uff0c\u79f0\u4e3a \\(m \\times n\\) \u77e9\u9635\u3002\u7279\u6b8a\u7684\u6709\u884c\u5411\u91cf\u548c\u5217\u5411\u91cf\uff08\u5305\u62ec\u5b9e\u6570\u548c\u590d\u6570\uff09\u3002 \\(n \\times n\\) \u77e9\u9635\u7684\u4e3b\u5bf9\u89d2\u7ebf\u662f\u6307\u4ece\u5de6\u4e0a\u89d2\u5230\u53f3\u4e0b\u89d2\u76f8\u8fde\u63a5\u7684\u7ebf\u6bb5\uff0c\u6b21\u5bf9\u89d2\u7ebf\uff08\u4ea4\u53c9\u5bf9\u89d2\u7ebf\uff09\u662f\u4ece\u53f3\u4e0a\u89d2\u5230\u5de6\u4e0b\u89d2\u3002 \u4e3b\u5bf9\u89d2\u7ebf\u4ee5\u5916\u5143\u7d20\u5168\u90e8\u4e3a0\u7684 \\(n \\times n\\) \u7684\u77e9\u9635\u79f0\u4e3a\u5bf9\u89d2\u77e9\u9635\u3002 \u5bf9\u89d2\u77e9\u9635\u4e3b\u5bf9\u89d2\u7ebf\u5143\u7d20\u5168\u90e8\u4f4d 1\uff0c\u79f0\u4e3a\u5355\u4f4d\u77e9\u9635 \\(I_{n \\times n}\\) \u3002 \u6240\u6709\u5143\u7d20\u4e3a 0 \u7684 \\(m \\times n\\) \u77e9\u9635\u79f0\u4e3a\u96f6\u77e9\u9635 \\(O_{m \\times n}\\) \u3002 \u4e00\u4e2a\u5168\u90e8\u5143\u7d20\u4e3a\u96f6\u7684\u5411\u91cf\u79f0\u4e3a\u96f6\u5411\u91cf\u3002 \u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97 \u00b6 \\(A=[a_{ij}]\\) \u7684\u8f6c\u7f6e\u8bb0\u4f5c \\(A^{\\top}\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^{\\top}]_{i,j}=a_{ji}\\) \\(A=[a_{ij}]\\) \u7684\u590d\u6570\u5171\u8f6d\u8bb0\u4f5c \\(A^*\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^*]_{ij}=a_{ij}^*\\) \\(A=[a_{ij}]\\) \u7684(\u590d)\u5171\u8f6d\u8f6c\u7f6e\u8bb0\u4f5c \\(A^H\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^H]_{ij}=a_{ji}^*\\) \uff0c\uff08\u5171\u8f6d\u8f6c\u7f6e\u53c8\u53eb Hlermitian \u4f34\u968f/\u8f6c\u7f6e/\u5171\u8f6d\uff09 \u6ee1\u8db3 \\(A^{\\top}=A\\) \u7684\u6b63\u65b9\u5b9e\u77e9\u9635\u548c \\(A^H=A\\) \u7684\u6b63\u65b9\u590d\u77e9\u9635\u5206\u522b\u79f0\u4e3a\u5bf9\u79f0\u77e9\u9635\u548c Hermitian \u77e9\u9635(\u590d\u5171\u8f6d\u5bf9\u79f0\u77e9\u9635)\uff0c\u5171\u8f6d\u8f6c\u7f6e\u548c\u8f6c\u7f6e\u7684\u5173\u7cfb: \\(A^H=(A^*)^{\\top}=(A^{\\top})^*\\) \u77e9\u9635\u6ee1\u8db3\u4e0e\u6807\u91cf/\u77e9\u9635/\u5411\u91cf\u4e4b\u95f4\u7684\u52a0\u6cd5\u3001\u4e58\u6cd5\uff08 \u77e9\u9635\u4e58\u6cd5\u4e0d\u6ee1\u8db3\u4ea4\u6362\u5f8b \uff09 \u77e9\u9635\u4e0e\u5411\u91cf\u7684\u4e58\u6cd5 \\(Ax=y\\) \u53ef\u89c6\u4e3a\u5411\u91cf \\(x\\) \u7684\u7ebf\u6027\u53d8\u6362\uff0c \\(A\\) \u79f0\u4e3a\u7ebf\u6027\u53d8\u6362\u77e9\u9635 \u5982\u679c \\(A\\) \u53ef\u9006\uff0c\u5219\u5b58\u5728 \\(A^{-1}\\) \u4f7f\u5f97 \\(A^{-1}A=I\\) \uff0c\u79f0 \\(A^{-1}\\) \u662f \\(A\\) \u7684\u9006\u77e9\u9635 \u77e9\u9635\u7684\u5171\u8f6d\u3001\u8f6c\u7f5d\u548c\u5171\u8f6d\u8f6c\u7f6e\u6ee1\u8db3\u5206\u914d\u5f8b\uff1a \\((A+B)^x=A^x+B^x\uff0cx \\in (*,T,H)\\) \u77e9\u9635\u4e58\u79ef\u7684\u8f6c\u7f6e\u3001\u5171\u8f6d\u8f6c\u7f6e\u548c\u9006\u77e9\u9635\u6ee1\u8db3\u5173\u7cfb\u5f0f\uff1a \\((AB)^x=B^xA^x\uff0cx \\in (T,H,-1)\\) \u5171\u8f6d\u3001\u8f6c\u7f6e\u548c\u5171\u8f6d\u8f6c\u7f6e\u7b49\u7b26\u53f7\u5747\u53ef\u4e0e\u6c42\u9006\u7b26\u53f7\u4ea4\u6362\uff1a \\((A^x)^{-1}=(A^{-1})^x\uff0cx \\in (*,T,H)\\) \u82e5 \\(A\\) \u53ef\u9006\uff0c\u5bf9\u4e8e Hermitian \u77e9\u9635 \\(B=A^HA\\) \uff0c\u6709 \\(A^{-H}BA^{-1}=A^{-H}A^HAA^{-1}=I\\) \u82e5$A_{n \\time n}\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5219 \\(A^n = A\\) \\(I-A\\) \u4e3a\u5e42\u7b49\u77e9\u9635\uff08 \\(A-I\\) \u4e0d\u4e00\u5b9a\u662f\u5e42\u7b49\u77e9\u9635\uff09 \\(A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(I-A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(B\\) \u4e5f\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5e76\u4e14 \\(AB=BA\\) \uff0c\u5219 \\(AB\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(A(I-A)=O\\) \uff08\u96f6\u77e9\u9635\uff09 \\((I-A)A=O\\) \uff08\u96f6\u77e9\u9635\uff09 \u51fd\u6570 \\(f(sI+tA)=(I-A)f(s)+Af(s+t)\\) \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5bf9\u5408\u77e9\u9635\u6216\u5e42\u5355\u77e9\u9635\uff0c\u5219 \\(f(sI=tA)=\\frac{1}{2}[(I+A)f(s+t)+(I-A)f(s-t)]\\) \u77e9\u9635 \\(A\\) \u662f\u5bf9\u5408\u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(\\frac{1}{2}(A+I)\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5e42\u96f6\u77e9\u9635\uff0c\u5219 \\(f(sI+tA)=If(s)+tAf^\\prime(s)\\) \u9664\u4e86\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97\uff0c\u8fd8\u6709\u77e9\u9635/\u4e09\u89d2/\u6307\u6570/\u5bf9\u6570\u51fd\u6570\u3001\u5bfc\u6570\u3001\u79ef\u5206\u7b49\u7b49 \u5411\u91cf\u7684\u7ebf\u6027\u65e0\u5173\u6027\u4e0e\u975e\u5947\u5f02\u77e9\u9635 \u00b6 \u4e00\u7ec4 \\(m\\) \u7ef4\u5411\u91cf \\(\\{u_1, ..., u_n\\}\\) \u79f0\u4e3a\u7ebf\u6027\u65e0\u5173\uff0c\u5219\u65b9\u7a0b \\(c_1u_1+...+c_nu_n=0\\) \u53ea\u6709\u96f6\u89e3 \\(c_1=...=c_n=0\\) \uff0c\u53cd\u4e4b\u7ebf\u6027\u76f8\u5173\u3002\u77e9\u9635 \\(A\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(Ax=0\\) \u53ea\u6709\u96f6\u89e3\uff0c\u53cd\u4e4b\u77e9\u9635\u662f\u5947\u5f02\u7684 \\(A_{n \\times n}=[a_1,...,a_n]\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u7684 \\(n\\) \u4e2a\u5217\u5411\u91cf \\(a_1,...,a_n\\) \u7ebf\u6027\u65e0\u5173\u3002 \u5411\u91cf\u7a7a\u95f4\u3001\u7ebf\u6027\u6620\u5c04\u4e0e Hilbert \u7a7a\u95f4 \u00b6 \u5411\u91cf\u7a7a\u95f4 \u00b6 \u4ee5\u5411\u91cf\u4e3a\u5143\u7d20\u7684\u96c6\u5408 \\(V\\) \u79f0\u4e3a\u5411\u91cf\u7a7a\u95f4\u3002\u5982\u679c \\(V\\) \u662f\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u5219\uff1a \u96f6\u5411\u91cf \\(0\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u52a0\u6cd5\u7684\u9006\u8fd0\u7b97 \\(-y\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u6052\u6709 \\(0y=0\\) \u5bf9\u6bcf\u4e00\u4e2a\u6807\u91cf a\uff0c\u6052\u6709 \\(a0=0\\) \u82e5 \\(ay=0\\) \uff0c\u5219 \\(a=0\\) \u6216\u8005 \\(y=0\\) \\((-1)y=-y\\) \u4ee4 \\(V\\) \u548c \\(W\\) \u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5 \\(W\\) \u662f \\(V\\) \u4e2d\u4e00\u4e2a\u975e\u7a7a\u7684\u5b50\u96c6\u5408\uff0c\u5219\u79f0\u5b50\u96c6\u5408 \\(W\\) \u662f \\(V\\) \u7684\u4e00\u4e2a\u5b50\u7a7a\u95f4 \\(R^n\\) \u7684\u5b50\u96c6\u5408 \\(W\\) \u662f \\(R^n\\) \u7684\u4e00\u4e2a\u5b57\u7a7a\u95f4\uff0c\u5f53\u4e14\u4ec5\u5f53\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a \u5f53\u5411\u91cf \\(x,y\\) \u5c5e\u4e8e \\(W\\) \uff0c\u5219 \\(x+y\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u52a0\u6cd5\u7684\u95ed\u5408\u6027 \u5f53 \\(x \\in W\\) \uff0c\u4e14 a \u4e3a\u6807\u91cf\uff0c\u5219 \\(ax\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u4e0e\u6807\u91cf\u4e58\u79ef\u7684\u95ed\u5408\u6027 \u96f6\u5411\u91cf \\(0\\) \u662f \\(W\\) \u7684\u5143\u7d20 \u82e5 \\(A\\) \u548c \\(B\\) \u662f\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u7684\u4e24\u4e2a\u5b50\u7a7a\u95ee\uff0c\u5e76\u6ee1\u8db3 \\(V=A+B\\) \u548c \\(A \\cap B=\\{0\\}\\) \uff0c\u5219\u79f0 \\(V\\) \u662f\u5b50\u7a7a\u95f4 \\(A\\) \u548c \\(B\\) \u7684\u76f4\u63a5\u6c42\u548c\uff0c\u7b80\u79f0\u76f4\u548c(direetsum)\uff0c\u8bb0\u4f5c \\(V=A \\oplus B\\) \u3002 \u7ebf\u6027\u6620\u5c04 \u00b6 \\(T:\\ V \\to W\\) \u79f0\u4e3a\u5b50\u7a7a\u95f4 \\(V\\) \u5230\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u6620\u5c04\u3002\u5b83\u8868\u793a\u5c06\u5b50\u7a7a\u95f4 \\(V\\) \u7684\u6bcf\u4e00\u4e2a\u5411\u91cf\u53d8\u6210\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u4e00\u4e2a\u76f8\u5bf9\u5e94\u5411\u91cf\u7684\u4e00\u79cd\u89c4\u5219\u3002\u4e8e\u662f\uff0c\u82e5 \\(v \\in V\\) \u548c \\(w \\in W\\) \uff0c\u5219\u5411\u91cf \\(w\\) \u662f \\(v\\) \u7684\u6620\u5c04\u6216\u53d8\u6362\uff0c\u5373\u6709 \\(w = T(v)\\) \uff0c\u5e76\u79f0\u5b50\u7a7a\u95f4 \\(V\\) \u662f\u6620\u5c04 \\(T\\) \u7684\u59cb\u96c6\u6216\u4e01\u4e00\u5b87\uff0c\u79f0 \\(W\\) \u662f\u6620\u5c04\u7684\u7ec8\u96c6\u6216\u4e0a\u57df\u3002 \u4ee4 \\(V\\) \u548c\u4ee5\u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c \\(T:V \\to W\\) \u4e3a\u4e00\u7ebf\u6027\u53d8\u6362: \u82e5 \\(M\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5219 \\(T(M)\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff1b \u82e5 \\(N\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5247\u7ebf\u6027\u53cd\u53d8\u6362 \\(T^{-1}(N)\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002 \u5185\u79ef\u7a7a\u95f4\u3001\u8d4b\u8303\u7a7a\u95ee\u4e0eHilbert \u7a7a\u95f4 \u00b6 \uff08\u5185\u79ef\u4e0e\u5185\u79ef\u5411\u91cf\u7a7a\u95f4\uff09\u82e5\u5bf9\u6240\u6709 \\(x,y,z \\in V\\) \u548c \\(\\alpha,\\beta \\in K\\) \uff0c\u6620\u5c04\u51fd\u6570 \\(<\\cdot,\\cdot>:V \\times V \\to K\\) \u6ee1\u8db3\u4e00\u4e0b\u4e09\u6761\u516c\u7406\uff1a \u5171\u8f6d\u5bf9\u79f0\u6027 \\(=^*\\) \u7b2c\u4e00\u53d8\u5143\u7684\u7ebf\u6027\u6027 \\(<\\alpha x+\\beta y,z>=\\alpha + \\beta \\) \u975e\u8d1f\u6027 \\( \\ge 0\\) \uff0c\u5e76\u4e14 \\( = 0 \\leftrightarrow x=0\\) \uff08\u4e25\u683c\u6b63\u6027\uff09 \u4e24\u4e2a\u5411\u91cf\u7684\u5185\u79ef\u53ef\u4ee5\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95ee\u7684\u5939\u89d2\uff1a \\(\\cos \\theta = \\frac{}{\\sqrt{}\\sqrt{}}\\) \uff08\u8303\u6570\u548c\u8d4b\u8303\u5411\u91cf\u7a7a\u95f4\uff09\u4ee4 \\(V\\) \u662f\u4e00(\u5b9e\u6216\u590d)\u5411\u91cf\u7a7a\u95f4\u3002\u5411\u91cf \\(x\\) \u7684\u8303\u6570\u662f\u4e00\u5b9e\u51fd\u6570 \\(p(x):V \\to R\\) \uff0c\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4efb\u610f\u4e00\u4e2a\u6807\u91cf \\(c \\in K\\) (\u5176\u4e2d \\(K\\) \u8868\u793a \\(R\\) \u6216 \\(C\\) )\uff0c\u5219\uff1a \u975e\u8d1f\u6027\uff1a \\(p(x) \\ge 0\\) \uff0c\u5e76\u4e14 \\(p(x)=0 \\Leftrightarrow x = 0\\) \u9f50\u6b21\u6027\uff1a \\(p(cx)=|c|\\cdot p(x)\\) \u5bf9\u6240\u6709\u590d\u5e38\u6570 \\(c\\) \u6210\u7acb \u4e09\u89d2\u4e0d\u7b49\u5f0f\uff1a \\(p(x+y) \\le p(x)+p(y)\\) \u6700\u5e38\u7528\u7684\u5411\u91cf\u8303\u6570\u4e3a Euclidean \u8303\u6570\u6216\u8005 \\(L_2\\) \u8303\u6570\uff0c\u8bb0\u4f5c \\(\\parallel \\cdot \\parallel_2\\) \uff0c\u5b9a\u4e49\u4e3a \\[ \\parallel x \\parallel _E = \\parallel x \\parallel _2 = \\sqrt{x_1^2+...+x_m^2} \\] \\(L_2\\) \u8303\u6570\u53ef\u4ee5\u76f4\u63a5\u5ea6\u91cf\u4e00\u4e2a\u5411\u91cf \\(x\\) \u7684\u957f\u5ea6 \\(size(x)=\\parallel x \\parallel_2\\) \uff0c\u4e24\u4e2a\u5411\u91cf\u4e4b\u95f4\u7684\u8ddd\u79bb \\(d(x,y)=\\parallel x-y \\parallel_2\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u534a\u8303\u6570/\u4f2a\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le p(x)+p(y)\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u62df\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \uff0c\u4e14 \\(p(x) = 0 \\Leftrightarrow x = 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le C(p(x)+p(y))\\) \uff0c\u5176\u4e2d \\(C \\ne 1\\) \u4e3a\u67d0\u4e2a\u6b63\u5b9e\u6570 \uff08\u5b8c\u5907\u6027\uff09\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u79f0\u4e3a\u5b8c\u5907\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5\u5bf9\u4e8e \\(V\\) \u4e2d\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217 \\(\\{ v_n \\}_{n=1}^{\\infty} \\subset V\\) \uff0c\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u5b58\u5728\u4e00\u4e2a\u5143\u7d20 \\(v\\) \uff0c\u4f7f\u5f97 \\(\\lim_{n \\to \\infty} v_n \\to v\\) \uff0c\u5373 \\(V\\) \u5185\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217\u90fd\u6536\u655b\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u3002 \uff08\u4f34\u968f\u7b97\u5b50\uff09\u4ee4 \\(T\\) \u662f Hilbert \u7a7a\u95f4 \\(H\\) \u5185\u7684\u6709\u754c\u7ebf\u6027\u7b97\u5b50\u3002\u82e5 \\(=\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in H\\) \u6210\u7acb\uff0c\u5219\u79f0 \\(T^*\\) \u662f \\(T\\) \u7684\u4f34\u968f\u7b97\u5b50(adjoint operator)\u3002 \u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \\(n\\) \u9636\u590d\u5411\u91cf \\(x=[x_1,...,x_n]^{\\top},y=[y_1,...,y_n]^{\\top}\\) \u4e4b\u95f4\u7684\u5185\u79ef \\(=x^Hy=\\sum_{i=1}^n x_i^*y_i\\) \u79f0\u4e3a\u5178\u8303\u5185\u79ef\u3002\u52a0\u6743\u5185\u79ef \\(=x^HGy\\) \uff0c\u5176\u4e2d \\(G\\) \u4e3a\u6b63\u5b9a\u7684 Hermitian \u77e9\u9635\u3002 \u5728\u5b9e\u548c\u590d\u5185\u79ef\u7a7a\u95f4\u91cc\uff0c\u8303\u6570\u5177\u6709\u4ee5\u4e0b\u6027\u8d28\uff1a \\(\\parallel 0 \\parallel = 0\\) \uff0c\u5e76\u4e14 \\(\\parallel x \\parallel > 0\uff0c\\forall x \\ne 0\\) \\(\\parallel cx \\parallel = |c| \\cdot \\parallel x \\parallel\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x\\) \u548c\u6807\u91cf c \u6210\u7acb \u8303\u6570\u670d\u4ece\u6781\u5316\u6052\u7b49\u5f0f\uff1a \\[ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2), \\forall x,y\uff08\u5b9e\u5185\u79ef\u7a7a\u95f4\uff09\\\\ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2 - j \\parallel x+jy \\parallel^2+j \\parallel x-jy \\parallel^2), \\forall x,y\uff08\u590d\u5185\u79ef\u7a7a\u95f4\uff09 \\] \u8303\u6570\u670d\u4ece\u5e73\u884c\u56db\u8fb9\u5f62\u6cd5\u5219: \\[ \\parallel x+y \\parallel^2 + \\parallel x - y \\parallel^2 = 2(\\parallel x \\parallel^2+\\parallel y \\parallel^2), \\forall x,y \\] \u8303\u6570\u6ee1\u8db3\u4e09\u89d2\u4e0d\u7b49\u5f0f \\(\\parallel x+y \\parallel \\le \\parallel x \\parallel + \\parallel y \\parallel, \\forall x,y\\) \u8303\u6570\u670d\u4ece Cauchy-Schwartz \u4e0d\u7b49\u5f0f \\(|| \\le \\parallel x \\parallel \\cdot \\parallel y \\parallel\\) \u5e38\u6570\u5411\u91cf\u7684\u5178\u8303\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \\(L_0\\) \u8303\u6570 \\(\\parallel x \\parallel_0 \\overset{def}{=}\\) \u975e\u96f6\u5143\u7d20\u7684\u4e2a\u6570 \\(L_1\\) \u8303\u6570 \\(\\parallel x \\parallel_1 \\overset{def}{=} \\sum_{i=1}^m |x_i|\\) \\(L_2\\) \u8303\u6570 \\(\\parallel x \\parallel_2 = (|x_1|^2+...+|x_m|^2)^{\\frac{1}{2}}\\) \\(L_\\infty\\) \u8303\u6570 \\(\\parallel x \\parallel_\\infty = \\max\\{|x_1|, ..., |x_m|\\}\\) \\(L_p\\) \u8303\u6570 \\(\\parallel x \\parallel_p = (\\sum_{i=1}^m |x_i|^p)^{\\frac{1}{p}}\\) \u51fd\u6570\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u82e5 \\(x(t)\\) \u548c \\(y(t)\\) \u5206\u522b\u662f\u53d8\u91cf \\(t\\) \u7684\u51fd\u6570\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} \\int_{a}^{b} x^H(t)y(t)dt \\] \u968f\u673a\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u82e5 \\(x(\\xi)\\) \u548c \\(y(\\xi)\\) \u5206\u522b\u662f\u6837\u672c\u53d8\u91cf \\(\\xi\\) \u968f\u673a\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} E\\{x^H(\\xi)y(\\xi)\\} \\] \u77e9\u9635\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u5c06\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570\u52a0\u4ee5\u63a8\u5e7f\u3002 \u77e9\u9635\u7684\u8303\u6570\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b:\u8bf1\u5bfc\u8303\u6570\u3001\u5143\u7d20\u5f62\u5f0f\u8303\u6570\u548c Schatten \u8303\u6570\u3002 \u968f\u673a\u5411\u91cf \u00b6 \u6982\u7387\u8bba\u77e5\u8bc6\u3002 \u77e9\u9635\u7684\u6027\u80fd\u6307\u6807 \u00b6 \u4e8c\u6b21\u578b \u7279\u5f81\u503c \u8ff9 \u79e9 \u9006\u77e9\u9635\u4e0e\u4f2a\u9006\u77e9\u9635 \u00b6 \u4e3b\u8981\u8ba8\u8bba\u975e\u5947\u5f02\u7684\u6b63\u65b9\u77e9\u9635 \\(A\\) \u7684\u9006\u77e9\u9635 \\(A^{-1}\\) Moore-Penrose \u9006\u77e9\u9635 \u00b6 \u4e3b\u8981\u8ba8\u8bba\u4e00\u4e2a\u79e9\u7a00\u7f3a\u7684\u77e9\u9635\u662f\u5426\u5b58\u5728\u9006\u77e9\u9635\uff0c\u5982\u679c\u5b58\u5728\u9700\u8981\u6ee1\u8db3\u4ec0\u4e48\u6761\u4ef6\u3002 \u77e9\u9635\u7684\u76f4\u548c\u4e0eHadamard \u79ef \u00b6 \u77e9\u9635\u7684\u76f4\u548c \u00b6 \\(m \\times m\\) \u77e9\u9635\u7684 \\(A\\) \u4e0e \\(n \\times n\\) \u77e9\u9635\u7684 \\(B\\) \u7684\u76f4\u548c\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5373 \\[ A \\oplus B = \\begin{bmatrix} A & O_{m \\times n} \\\\ O_{n \\times m} & B \\end{bmatrix} \\] Hadamard \u79ef \u00b6 \\(m \\times n\\) \u77e9\u9635\u7684 \\(A=[a_{ij}]\\) \u4e0e \\(m \\times n\\) \u77e9\u9635\u7684 \\(B=[b_{ij}]\\) \u7684 Hadamard \u79ef\u8bb0\u4f5c \\(A * B\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\((A*B)_{ij}=a_{ij}b_{ij}\\) \u3002\u5373 Hadamard \u79ef\u98df\u4e00\u79cd\u6620\u5c04 \\(R^{m \\times n} \\times R^{m \\times n} \\to R^{m \\times n}\\) Kronecker \u79ef\u4e0eKhatri-Rao \u79ef \u00b6 Kronecker \u79ef \u00b6 Kronecker \u79ef\u5206\u4e3a\u53f3\u548c\u5de6\u4e24\u79cd Kronecker \u79ef\u3002 \u4f8b\u5982\u53f3 Kronecker \u79ef\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5b9a\u4e49\u4e3a\uff1a \\[ A \\oplus B = [a_1B, ..., a_nB]=[a_{ij}B]_{i=1,j=1}^{m,n}= \\begin{bmatrix} a_{11}B &a_{12}B &... &a_{1n}B \\\\ a_{21}B &a_{22}B &... &a_{2n}B \\\\ ... & ... & ... &... \\\\ a_{m1}B &a_{m2}B & ... &a_{mn}B \\end{bmatrix} \\] Kronecker \u79ef\u4e5f\u79f0\u76f4\u79ef(direct product)\u6216\u8005\u5f20\u91cf\u79ef(tensor product)1 Khatri-Rao \u79ef \u00b6 \u4e24\u4e2a\u5177\u6709\u76f8\u540c\u5217\u6570\u7684\u77e9\u9635 \\(G \\in R^{p \\times n}\\) \u548c \\(F \\in R^{q\\times n}\\) \u7684 Khatri-Rao \u79ef\u8bb0\u4f5c \\(F \\odot G\\) \uff0c\u5b9a\u4e49\u4e3a \\[ F \\odot G = [f_1 \\oplus g_1, f_2 \\oplus g_2, ..., f_n \\oplus g_n] \\in R^{pq \\times n} \\] \u5b83\u7531\u4e24\u4e2a\u77e9\u9635\u7684\u5bf9\u5e94\u5217\u5411\u91cf\u7684Kronecker \u79ef\u6392\u5217\u800c\u6210\u3002\u56e0\u6b64\uff0cKhatri-Rao \u79ef\u53c8\u53eb\u5bf9\u5e94\u5217 Kronecker \u79ef\u3002 \u5411\u91cf\u5316\u4e0e\u77e9\u9635\u5316 \u00b6 \u77e9\u9635\u7684\u5411\u91cf\u5316 \\(vec(A)\\) \u662f\u4e00\u7ebf\u6027\u53d8\u6362\uff0c\u5c06 \\(A\\) \u6309\u5217\u5806\u6808\uff08\u5f53\u7136\u4e5f\u53ef\u4ee5\u6309\u884c\u5806\u6808\uff09\u6392\u5217\u6210\u4e00\u4e2a \\(mn \\times 1\\) \u5411\u91cf\u3002\u5373 \\[vec(A)=[a_{11},...,a_{m1},...,a_{1n},...,a_{mn}]^{\\top}\\]","title":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840"},{"location":"mb/maa/lec1/#_1","text":"Abstract \u77e9\u9635\u662f\u63cf\u8ff0\u548c\u6c42\u89e3\u7ebf\u6027\u65b9\u7a0b\u7ec4\u6700\u57fa\u672c\u548c\u6700\u6709\u7528\u7684\u6570\u5b66\u5de5\u5177 \u6570\u5b66\u8fd0\u7b97: \u8f6c\u7f6e\u3001\u5185\u79ef\u3001\u5916\u79ef\u3001\u9006\u77e9\u9635\u3001\u5e7f\u4e49\u9006\u77e9\u9635\u7b49 \u6807\u91cf\u51fd\u6570\uff1a\u8303\u6570\u3001\u4e8c\u6b21\u578b\u3001\u884c\u5217\u5f0f\u3001\u7279\u5f81\u503c\u3001\u79e9\u548c\u8ff9 \u7279\u6b8a\u8fd0\u7b97: \u76f4\u548c\u3001\u76f4\u79ef\u3001Hadamard \u79ef\u3001Kronecker \u79ef\u3001\u5411\u91cf\u5316","title":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840"},{"location":"mb/maa/lec1/#_2","text":"","title":"\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97"},{"location":"mb/maa/lec1/#_3","text":"\\(m \\times n\\) \u7684\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u4f7f\u7528 \\(m\\) \u4e2a\u65b9\u7a0b\u63cf\u8ff0 \\(n\\) \u4e2a\u672a\u77e5\u91cf\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb\u3002\u7528\u77e9\u9635-\u5411\u91cf\u5f62\u5f0f\u8868\u793a\u4e3a \\(Ax = b\\) \uff0c\u79f0\u4e3a \\(m \\times n\\) \u77e9\u9635\u3002\u7279\u6b8a\u7684\u6709\u884c\u5411\u91cf\u548c\u5217\u5411\u91cf\uff08\u5305\u62ec\u5b9e\u6570\u548c\u590d\u6570\uff09\u3002 \\(n \\times n\\) \u77e9\u9635\u7684\u4e3b\u5bf9\u89d2\u7ebf\u662f\u6307\u4ece\u5de6\u4e0a\u89d2\u5230\u53f3\u4e0b\u89d2\u76f8\u8fde\u63a5\u7684\u7ebf\u6bb5\uff0c\u6b21\u5bf9\u89d2\u7ebf\uff08\u4ea4\u53c9\u5bf9\u89d2\u7ebf\uff09\u662f\u4ece\u53f3\u4e0a\u89d2\u5230\u5de6\u4e0b\u89d2\u3002 \u4e3b\u5bf9\u89d2\u7ebf\u4ee5\u5916\u5143\u7d20\u5168\u90e8\u4e3a0\u7684 \\(n \\times n\\) \u7684\u77e9\u9635\u79f0\u4e3a\u5bf9\u89d2\u77e9\u9635\u3002 \u5bf9\u89d2\u77e9\u9635\u4e3b\u5bf9\u89d2\u7ebf\u5143\u7d20\u5168\u90e8\u4f4d 1\uff0c\u79f0\u4e3a\u5355\u4f4d\u77e9\u9635 \\(I_{n \\times n}\\) \u3002 \u6240\u6709\u5143\u7d20\u4e3a 0 \u7684 \\(m \\times n\\) \u77e9\u9635\u79f0\u4e3a\u96f6\u77e9\u9635 \\(O_{m \\times n}\\) \u3002 \u4e00\u4e2a\u5168\u90e8\u5143\u7d20\u4e3a\u96f6\u7684\u5411\u91cf\u79f0\u4e3a\u96f6\u5411\u91cf\u3002","title":"\u77e9\u9635\u4e0e\u5411\u91cf"},{"location":"mb/maa/lec1/#_4","text":"\\(A=[a_{ij}]\\) \u7684\u8f6c\u7f6e\u8bb0\u4f5c \\(A^{\\top}\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^{\\top}]_{i,j}=a_{ji}\\) \\(A=[a_{ij}]\\) \u7684\u590d\u6570\u5171\u8f6d\u8bb0\u4f5c \\(A^*\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^*]_{ij}=a_{ij}^*\\) \\(A=[a_{ij}]\\) \u7684(\u590d)\u5171\u8f6d\u8f6c\u7f6e\u8bb0\u4f5c \\(A^H\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^H]_{ij}=a_{ji}^*\\) \uff0c\uff08\u5171\u8f6d\u8f6c\u7f6e\u53c8\u53eb Hlermitian \u4f34\u968f/\u8f6c\u7f6e/\u5171\u8f6d\uff09 \u6ee1\u8db3 \\(A^{\\top}=A\\) \u7684\u6b63\u65b9\u5b9e\u77e9\u9635\u548c \\(A^H=A\\) \u7684\u6b63\u65b9\u590d\u77e9\u9635\u5206\u522b\u79f0\u4e3a\u5bf9\u79f0\u77e9\u9635\u548c Hermitian \u77e9\u9635(\u590d\u5171\u8f6d\u5bf9\u79f0\u77e9\u9635)\uff0c\u5171\u8f6d\u8f6c\u7f6e\u548c\u8f6c\u7f6e\u7684\u5173\u7cfb: \\(A^H=(A^*)^{\\top}=(A^{\\top})^*\\) \u77e9\u9635\u6ee1\u8db3\u4e0e\u6807\u91cf/\u77e9\u9635/\u5411\u91cf\u4e4b\u95f4\u7684\u52a0\u6cd5\u3001\u4e58\u6cd5\uff08 \u77e9\u9635\u4e58\u6cd5\u4e0d\u6ee1\u8db3\u4ea4\u6362\u5f8b \uff09 \u77e9\u9635\u4e0e\u5411\u91cf\u7684\u4e58\u6cd5 \\(Ax=y\\) \u53ef\u89c6\u4e3a\u5411\u91cf \\(x\\) \u7684\u7ebf\u6027\u53d8\u6362\uff0c \\(A\\) \u79f0\u4e3a\u7ebf\u6027\u53d8\u6362\u77e9\u9635 \u5982\u679c \\(A\\) \u53ef\u9006\uff0c\u5219\u5b58\u5728 \\(A^{-1}\\) \u4f7f\u5f97 \\(A^{-1}A=I\\) \uff0c\u79f0 \\(A^{-1}\\) \u662f \\(A\\) \u7684\u9006\u77e9\u9635 \u77e9\u9635\u7684\u5171\u8f6d\u3001\u8f6c\u7f5d\u548c\u5171\u8f6d\u8f6c\u7f6e\u6ee1\u8db3\u5206\u914d\u5f8b\uff1a \\((A+B)^x=A^x+B^x\uff0cx \\in (*,T,H)\\) \u77e9\u9635\u4e58\u79ef\u7684\u8f6c\u7f6e\u3001\u5171\u8f6d\u8f6c\u7f6e\u548c\u9006\u77e9\u9635\u6ee1\u8db3\u5173\u7cfb\u5f0f\uff1a \\((AB)^x=B^xA^x\uff0cx \\in (T,H,-1)\\) \u5171\u8f6d\u3001\u8f6c\u7f6e\u548c\u5171\u8f6d\u8f6c\u7f6e\u7b49\u7b26\u53f7\u5747\u53ef\u4e0e\u6c42\u9006\u7b26\u53f7\u4ea4\u6362\uff1a \\((A^x)^{-1}=(A^{-1})^x\uff0cx \\in (*,T,H)\\) \u82e5 \\(A\\) \u53ef\u9006\uff0c\u5bf9\u4e8e Hermitian \u77e9\u9635 \\(B=A^HA\\) \uff0c\u6709 \\(A^{-H}BA^{-1}=A^{-H}A^HAA^{-1}=I\\) \u82e5$A_{n \\time n}\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5219 \\(A^n = A\\) \\(I-A\\) \u4e3a\u5e42\u7b49\u77e9\u9635\uff08 \\(A-I\\) \u4e0d\u4e00\u5b9a\u662f\u5e42\u7b49\u77e9\u9635\uff09 \\(A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(I-A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(B\\) \u4e5f\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5e76\u4e14 \\(AB=BA\\) \uff0c\u5219 \\(AB\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(A(I-A)=O\\) \uff08\u96f6\u77e9\u9635\uff09 \\((I-A)A=O\\) \uff08\u96f6\u77e9\u9635\uff09 \u51fd\u6570 \\(f(sI+tA)=(I-A)f(s)+Af(s+t)\\) \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5bf9\u5408\u77e9\u9635\u6216\u5e42\u5355\u77e9\u9635\uff0c\u5219 \\(f(sI=tA)=\\frac{1}{2}[(I+A)f(s+t)+(I-A)f(s-t)]\\) \u77e9\u9635 \\(A\\) \u662f\u5bf9\u5408\u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(\\frac{1}{2}(A+I)\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5e42\u96f6\u77e9\u9635\uff0c\u5219 \\(f(sI+tA)=If(s)+tAf^\\prime(s)\\) \u9664\u4e86\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97\uff0c\u8fd8\u6709\u77e9\u9635/\u4e09\u89d2/\u6307\u6570/\u5bf9\u6570\u51fd\u6570\u3001\u5bfc\u6570\u3001\u79ef\u5206\u7b49\u7b49","title":"\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97"},{"location":"mb/maa/lec1/#_5","text":"\u4e00\u7ec4 \\(m\\) \u7ef4\u5411\u91cf \\(\\{u_1, ..., u_n\\}\\) \u79f0\u4e3a\u7ebf\u6027\u65e0\u5173\uff0c\u5219\u65b9\u7a0b \\(c_1u_1+...+c_nu_n=0\\) \u53ea\u6709\u96f6\u89e3 \\(c_1=...=c_n=0\\) \uff0c\u53cd\u4e4b\u7ebf\u6027\u76f8\u5173\u3002\u77e9\u9635 \\(A\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(Ax=0\\) \u53ea\u6709\u96f6\u89e3\uff0c\u53cd\u4e4b\u77e9\u9635\u662f\u5947\u5f02\u7684 \\(A_{n \\times n}=[a_1,...,a_n]\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u7684 \\(n\\) \u4e2a\u5217\u5411\u91cf \\(a_1,...,a_n\\) \u7ebf\u6027\u65e0\u5173\u3002","title":"\u5411\u91cf\u7684\u7ebf\u6027\u65e0\u5173\u6027\u4e0e\u975e\u5947\u5f02\u77e9\u9635"},{"location":"mb/maa/lec1/#hilbert","text":"","title":"\u5411\u91cf\u7a7a\u95f4\u3001\u7ebf\u6027\u6620\u5c04\u4e0e Hilbert \u7a7a\u95f4"},{"location":"mb/maa/lec1/#_6","text":"\u4ee5\u5411\u91cf\u4e3a\u5143\u7d20\u7684\u96c6\u5408 \\(V\\) \u79f0\u4e3a\u5411\u91cf\u7a7a\u95f4\u3002\u5982\u679c \\(V\\) \u662f\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u5219\uff1a \u96f6\u5411\u91cf \\(0\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u52a0\u6cd5\u7684\u9006\u8fd0\u7b97 \\(-y\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u6052\u6709 \\(0y=0\\) \u5bf9\u6bcf\u4e00\u4e2a\u6807\u91cf a\uff0c\u6052\u6709 \\(a0=0\\) \u82e5 \\(ay=0\\) \uff0c\u5219 \\(a=0\\) \u6216\u8005 \\(y=0\\) \\((-1)y=-y\\) \u4ee4 \\(V\\) \u548c \\(W\\) \u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5 \\(W\\) \u662f \\(V\\) \u4e2d\u4e00\u4e2a\u975e\u7a7a\u7684\u5b50\u96c6\u5408\uff0c\u5219\u79f0\u5b50\u96c6\u5408 \\(W\\) \u662f \\(V\\) \u7684\u4e00\u4e2a\u5b50\u7a7a\u95f4 \\(R^n\\) \u7684\u5b50\u96c6\u5408 \\(W\\) \u662f \\(R^n\\) \u7684\u4e00\u4e2a\u5b57\u7a7a\u95f4\uff0c\u5f53\u4e14\u4ec5\u5f53\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a \u5f53\u5411\u91cf \\(x,y\\) \u5c5e\u4e8e \\(W\\) \uff0c\u5219 \\(x+y\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u52a0\u6cd5\u7684\u95ed\u5408\u6027 \u5f53 \\(x \\in W\\) \uff0c\u4e14 a \u4e3a\u6807\u91cf\uff0c\u5219 \\(ax\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u4e0e\u6807\u91cf\u4e58\u79ef\u7684\u95ed\u5408\u6027 \u96f6\u5411\u91cf \\(0\\) \u662f \\(W\\) \u7684\u5143\u7d20 \u82e5 \\(A\\) \u548c \\(B\\) \u662f\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u7684\u4e24\u4e2a\u5b50\u7a7a\u95ee\uff0c\u5e76\u6ee1\u8db3 \\(V=A+B\\) \u548c \\(A \\cap B=\\{0\\}\\) \uff0c\u5219\u79f0 \\(V\\) \u662f\u5b50\u7a7a\u95f4 \\(A\\) \u548c \\(B\\) \u7684\u76f4\u63a5\u6c42\u548c\uff0c\u7b80\u79f0\u76f4\u548c(direetsum)\uff0c\u8bb0\u4f5c \\(V=A \\oplus B\\) \u3002","title":"\u5411\u91cf\u7a7a\u95f4"},{"location":"mb/maa/lec1/#_7","text":"\\(T:\\ V \\to W\\) \u79f0\u4e3a\u5b50\u7a7a\u95f4 \\(V\\) \u5230\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u6620\u5c04\u3002\u5b83\u8868\u793a\u5c06\u5b50\u7a7a\u95f4 \\(V\\) \u7684\u6bcf\u4e00\u4e2a\u5411\u91cf\u53d8\u6210\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u4e00\u4e2a\u76f8\u5bf9\u5e94\u5411\u91cf\u7684\u4e00\u79cd\u89c4\u5219\u3002\u4e8e\u662f\uff0c\u82e5 \\(v \\in V\\) \u548c \\(w \\in W\\) \uff0c\u5219\u5411\u91cf \\(w\\) \u662f \\(v\\) \u7684\u6620\u5c04\u6216\u53d8\u6362\uff0c\u5373\u6709 \\(w = T(v)\\) \uff0c\u5e76\u79f0\u5b50\u7a7a\u95f4 \\(V\\) \u662f\u6620\u5c04 \\(T\\) \u7684\u59cb\u96c6\u6216\u4e01\u4e00\u5b87\uff0c\u79f0 \\(W\\) \u662f\u6620\u5c04\u7684\u7ec8\u96c6\u6216\u4e0a\u57df\u3002 \u4ee4 \\(V\\) \u548c\u4ee5\u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c \\(T:V \\to W\\) \u4e3a\u4e00\u7ebf\u6027\u53d8\u6362: \u82e5 \\(M\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5219 \\(T(M)\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff1b \u82e5 \\(N\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5247\u7ebf\u6027\u53cd\u53d8\u6362 \\(T^{-1}(N)\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002","title":"\u7ebf\u6027\u6620\u5c04"},{"location":"mb/maa/lec1/#hilbert_1","text":"\uff08\u5185\u79ef\u4e0e\u5185\u79ef\u5411\u91cf\u7a7a\u95f4\uff09\u82e5\u5bf9\u6240\u6709 \\(x,y,z \\in V\\) \u548c \\(\\alpha,\\beta \\in K\\) \uff0c\u6620\u5c04\u51fd\u6570 \\(<\\cdot,\\cdot>:V \\times V \\to K\\) \u6ee1\u8db3\u4e00\u4e0b\u4e09\u6761\u516c\u7406\uff1a \u5171\u8f6d\u5bf9\u79f0\u6027 \\(=^*\\) \u7b2c\u4e00\u53d8\u5143\u7684\u7ebf\u6027\u6027 \\(<\\alpha x+\\beta y,z>=\\alpha + \\beta \\) \u975e\u8d1f\u6027 \\( \\ge 0\\) \uff0c\u5e76\u4e14 \\( = 0 \\leftrightarrow x=0\\) \uff08\u4e25\u683c\u6b63\u6027\uff09 \u4e24\u4e2a\u5411\u91cf\u7684\u5185\u79ef\u53ef\u4ee5\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95ee\u7684\u5939\u89d2\uff1a \\(\\cos \\theta = \\frac{}{\\sqrt{}\\sqrt{}}\\) \uff08\u8303\u6570\u548c\u8d4b\u8303\u5411\u91cf\u7a7a\u95f4\uff09\u4ee4 \\(V\\) \u662f\u4e00(\u5b9e\u6216\u590d)\u5411\u91cf\u7a7a\u95f4\u3002\u5411\u91cf \\(x\\) \u7684\u8303\u6570\u662f\u4e00\u5b9e\u51fd\u6570 \\(p(x):V \\to R\\) \uff0c\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4efb\u610f\u4e00\u4e2a\u6807\u91cf \\(c \\in K\\) (\u5176\u4e2d \\(K\\) \u8868\u793a \\(R\\) \u6216 \\(C\\) )\uff0c\u5219\uff1a \u975e\u8d1f\u6027\uff1a \\(p(x) \\ge 0\\) \uff0c\u5e76\u4e14 \\(p(x)=0 \\Leftrightarrow x = 0\\) \u9f50\u6b21\u6027\uff1a \\(p(cx)=|c|\\cdot p(x)\\) \u5bf9\u6240\u6709\u590d\u5e38\u6570 \\(c\\) \u6210\u7acb \u4e09\u89d2\u4e0d\u7b49\u5f0f\uff1a \\(p(x+y) \\le p(x)+p(y)\\) \u6700\u5e38\u7528\u7684\u5411\u91cf\u8303\u6570\u4e3a Euclidean \u8303\u6570\u6216\u8005 \\(L_2\\) \u8303\u6570\uff0c\u8bb0\u4f5c \\(\\parallel \\cdot \\parallel_2\\) \uff0c\u5b9a\u4e49\u4e3a \\[ \\parallel x \\parallel _E = \\parallel x \\parallel _2 = \\sqrt{x_1^2+...+x_m^2} \\] \\(L_2\\) \u8303\u6570\u53ef\u4ee5\u76f4\u63a5\u5ea6\u91cf\u4e00\u4e2a\u5411\u91cf \\(x\\) \u7684\u957f\u5ea6 \\(size(x)=\\parallel x \\parallel_2\\) \uff0c\u4e24\u4e2a\u5411\u91cf\u4e4b\u95f4\u7684\u8ddd\u79bb \\(d(x,y)=\\parallel x-y \\parallel_2\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u534a\u8303\u6570/\u4f2a\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le p(x)+p(y)\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u62df\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \uff0c\u4e14 \\(p(x) = 0 \\Leftrightarrow x = 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le C(p(x)+p(y))\\) \uff0c\u5176\u4e2d \\(C \\ne 1\\) \u4e3a\u67d0\u4e2a\u6b63\u5b9e\u6570 \uff08\u5b8c\u5907\u6027\uff09\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u79f0\u4e3a\u5b8c\u5907\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5\u5bf9\u4e8e \\(V\\) \u4e2d\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217 \\(\\{ v_n \\}_{n=1}^{\\infty} \\subset V\\) \uff0c\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u5b58\u5728\u4e00\u4e2a\u5143\u7d20 \\(v\\) \uff0c\u4f7f\u5f97 \\(\\lim_{n \\to \\infty} v_n \\to v\\) \uff0c\u5373 \\(V\\) \u5185\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217\u90fd\u6536\u655b\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u3002 \uff08\u4f34\u968f\u7b97\u5b50\uff09\u4ee4 \\(T\\) \u662f Hilbert \u7a7a\u95f4 \\(H\\) \u5185\u7684\u6709\u754c\u7ebf\u6027\u7b97\u5b50\u3002\u82e5 \\(=\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in H\\) \u6210\u7acb\uff0c\u5219\u79f0 \\(T^*\\) \u662f \\(T\\) \u7684\u4f34\u968f\u7b97\u5b50(adjoint operator)\u3002","title":"\u5185\u79ef\u7a7a\u95f4\u3001\u8d4b\u8303\u7a7a\u95ee\u4e0eHilbert \u7a7a\u95f4"},{"location":"mb/maa/lec1/#_8","text":"","title":"\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_9","text":"\\(n\\) \u9636\u590d\u5411\u91cf \\(x=[x_1,...,x_n]^{\\top},y=[y_1,...,y_n]^{\\top}\\) \u4e4b\u95f4\u7684\u5185\u79ef \\(=x^Hy=\\sum_{i=1}^n x_i^*y_i\\) \u79f0\u4e3a\u5178\u8303\u5185\u79ef\u3002\u52a0\u6743\u5185\u79ef \\(=x^HGy\\) \uff0c\u5176\u4e2d \\(G\\) \u4e3a\u6b63\u5b9a\u7684 Hermitian \u77e9\u9635\u3002 \u5728\u5b9e\u548c\u590d\u5185\u79ef\u7a7a\u95f4\u91cc\uff0c\u8303\u6570\u5177\u6709\u4ee5\u4e0b\u6027\u8d28\uff1a \\(\\parallel 0 \\parallel = 0\\) \uff0c\u5e76\u4e14 \\(\\parallel x \\parallel > 0\uff0c\\forall x \\ne 0\\) \\(\\parallel cx \\parallel = |c| \\cdot \\parallel x \\parallel\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x\\) \u548c\u6807\u91cf c \u6210\u7acb \u8303\u6570\u670d\u4ece\u6781\u5316\u6052\u7b49\u5f0f\uff1a \\[ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2), \\forall x,y\uff08\u5b9e\u5185\u79ef\u7a7a\u95f4\uff09\\\\ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2 - j \\parallel x+jy \\parallel^2+j \\parallel x-jy \\parallel^2), \\forall x,y\uff08\u590d\u5185\u79ef\u7a7a\u95f4\uff09 \\] \u8303\u6570\u670d\u4ece\u5e73\u884c\u56db\u8fb9\u5f62\u6cd5\u5219: \\[ \\parallel x+y \\parallel^2 + \\parallel x - y \\parallel^2 = 2(\\parallel x \\parallel^2+\\parallel y \\parallel^2), \\forall x,y \\] \u8303\u6570\u6ee1\u8db3\u4e09\u89d2\u4e0d\u7b49\u5f0f \\(\\parallel x+y \\parallel \\le \\parallel x \\parallel + \\parallel y \\parallel, \\forall x,y\\) \u8303\u6570\u670d\u4ece Cauchy-Schwartz \u4e0d\u7b49\u5f0f \\(|| \\le \\parallel x \\parallel \\cdot \\parallel y \\parallel\\)","title":"\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_10","text":"\\(L_0\\) \u8303\u6570 \\(\\parallel x \\parallel_0 \\overset{def}{=}\\) \u975e\u96f6\u5143\u7d20\u7684\u4e2a\u6570 \\(L_1\\) \u8303\u6570 \\(\\parallel x \\parallel_1 \\overset{def}{=} \\sum_{i=1}^m |x_i|\\) \\(L_2\\) \u8303\u6570 \\(\\parallel x \\parallel_2 = (|x_1|^2+...+|x_m|^2)^{\\frac{1}{2}}\\) \\(L_\\infty\\) \u8303\u6570 \\(\\parallel x \\parallel_\\infty = \\max\\{|x_1|, ..., |x_m|\\}\\) \\(L_p\\) \u8303\u6570 \\(\\parallel x \\parallel_p = (\\sum_{i=1}^m |x_i|^p)^{\\frac{1}{p}}\\)","title":"\u5e38\u6570\u5411\u91cf\u7684\u5178\u8303\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_11","text":"\u82e5 \\(x(t)\\) \u548c \\(y(t)\\) \u5206\u522b\u662f\u53d8\u91cf \\(t\\) \u7684\u51fd\u6570\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} \\int_{a}^{b} x^H(t)y(t)dt \\]","title":"\u51fd\u6570\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_12","text":"\u82e5 \\(x(\\xi)\\) \u548c \\(y(\\xi)\\) \u5206\u522b\u662f\u6837\u672c\u53d8\u91cf \\(\\xi\\) \u968f\u673a\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} E\\{x^H(\\xi)y(\\xi)\\} \\]","title":"\u968f\u673a\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_13","text":"\u5c06\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570\u52a0\u4ee5\u63a8\u5e7f\u3002 \u77e9\u9635\u7684\u8303\u6570\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b:\u8bf1\u5bfc\u8303\u6570\u3001\u5143\u7d20\u5f62\u5f0f\u8303\u6570\u548c Schatten \u8303\u6570\u3002","title":"\u77e9\u9635\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_14","text":"\u6982\u7387\u8bba\u77e5\u8bc6\u3002","title":"\u968f\u673a\u5411\u91cf"},{"location":"mb/maa/lec1/#_15","text":"\u4e8c\u6b21\u578b \u7279\u5f81\u503c \u8ff9 \u79e9","title":"\u77e9\u9635\u7684\u6027\u80fd\u6307\u6807"},{"location":"mb/maa/lec1/#_16","text":"\u4e3b\u8981\u8ba8\u8bba\u975e\u5947\u5f02\u7684\u6b63\u65b9\u77e9\u9635 \\(A\\) \u7684\u9006\u77e9\u9635 \\(A^{-1}\\)","title":"\u9006\u77e9\u9635\u4e0e\u4f2a\u9006\u77e9\u9635"},{"location":"mb/maa/lec1/#moore-penrose","text":"\u4e3b\u8981\u8ba8\u8bba\u4e00\u4e2a\u79e9\u7a00\u7f3a\u7684\u77e9\u9635\u662f\u5426\u5b58\u5728\u9006\u77e9\u9635\uff0c\u5982\u679c\u5b58\u5728\u9700\u8981\u6ee1\u8db3\u4ec0\u4e48\u6761\u4ef6\u3002","title":"Moore-Penrose \u9006\u77e9\u9635"},{"location":"mb/maa/lec1/#hadamard","text":"","title":"\u77e9\u9635\u7684\u76f4\u548c\u4e0eHadamard \u79ef"},{"location":"mb/maa/lec1/#_17","text":"\\(m \\times m\\) \u77e9\u9635\u7684 \\(A\\) \u4e0e \\(n \\times n\\) \u77e9\u9635\u7684 \\(B\\) \u7684\u76f4\u548c\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5373 \\[ A \\oplus B = \\begin{bmatrix} A & O_{m \\times n} \\\\ O_{n \\times m} & B \\end{bmatrix} \\]","title":"\u77e9\u9635\u7684\u76f4\u548c"},{"location":"mb/maa/lec1/#hadamard_1","text":"\\(m \\times n\\) \u77e9\u9635\u7684 \\(A=[a_{ij}]\\) \u4e0e \\(m \\times n\\) \u77e9\u9635\u7684 \\(B=[b_{ij}]\\) \u7684 Hadamard \u79ef\u8bb0\u4f5c \\(A * B\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\((A*B)_{ij}=a_{ij}b_{ij}\\) \u3002\u5373 Hadamard \u79ef\u98df\u4e00\u79cd\u6620\u5c04 \\(R^{m \\times n} \\times R^{m \\times n} \\to R^{m \\times n}\\)","title":"Hadamard \u79ef"},{"location":"mb/maa/lec1/#kronecker-khatri-rao","text":"","title":"Kronecker \u79ef\u4e0eKhatri-Rao \u79ef"},{"location":"mb/maa/lec1/#kronecker","text":"Kronecker \u79ef\u5206\u4e3a\u53f3\u548c\u5de6\u4e24\u79cd Kronecker \u79ef\u3002 \u4f8b\u5982\u53f3 Kronecker \u79ef\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5b9a\u4e49\u4e3a\uff1a \\[ A \\oplus B = [a_1B, ..., a_nB]=[a_{ij}B]_{i=1,j=1}^{m,n}= \\begin{bmatrix} a_{11}B &a_{12}B &... &a_{1n}B \\\\ a_{21}B &a_{22}B &... &a_{2n}B \\\\ ... & ... & ... &... \\\\ a_{m1}B &a_{m2}B & ... &a_{mn}B \\end{bmatrix} \\] Kronecker \u79ef\u4e5f\u79f0\u76f4\u79ef(direct product)\u6216\u8005\u5f20\u91cf\u79ef(tensor product)1","title":"Kronecker \u79ef"},{"location":"mb/maa/lec1/#khatri-rao","text":"\u4e24\u4e2a\u5177\u6709\u76f8\u540c\u5217\u6570\u7684\u77e9\u9635 \\(G \\in R^{p \\times n}\\) \u548c \\(F \\in R^{q\\times n}\\) \u7684 Khatri-Rao \u79ef\u8bb0\u4f5c \\(F \\odot G\\) \uff0c\u5b9a\u4e49\u4e3a \\[ F \\odot G = [f_1 \\oplus g_1, f_2 \\oplus g_2, ..., f_n \\oplus g_n] \\in R^{pq \\times n} \\] \u5b83\u7531\u4e24\u4e2a\u77e9\u9635\u7684\u5bf9\u5e94\u5217\u5411\u91cf\u7684Kronecker \u79ef\u6392\u5217\u800c\u6210\u3002\u56e0\u6b64\uff0cKhatri-Rao \u79ef\u53c8\u53eb\u5bf9\u5e94\u5217 Kronecker \u79ef\u3002","title":"Khatri-Rao \u79ef"},{"location":"mb/maa/lec1/#_18","text":"\u77e9\u9635\u7684\u5411\u91cf\u5316 \\(vec(A)\\) \u662f\u4e00\u7ebf\u6027\u53d8\u6362\uff0c\u5c06 \\(A\\) \u6309\u5217\u5806\u6808\uff08\u5f53\u7136\u4e5f\u53ef\u4ee5\u6309\u884c\u5806\u6808\uff09\u6392\u5217\u6210\u4e00\u4e2a \\(mn \\times 1\\) \u5411\u91cf\u3002\u5373 \\[vec(A)=[a_{11},...,a_{m1},...,a_{1n},...,a_{mn}]^{\\top}\\]","title":"\u5411\u91cf\u5316\u4e0e\u77e9\u9635\u5316"},{"location":"mb/maa/lec2/","text":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u00b6 Abstract \u5143\u7d20\u4e4b\u95f4\u5b58\u5728\u67d0\u79cd\u7279\u6b8a\u7ed3\u6784\u5173\u7cfb\u7684\u77e9\u9635\uff0c\u7edf\u79f0\u4e3a\u7279\u6b8a\u77e9\u9635 Hermitian \u77e9\u9635 \u00b6 \u4e00\u4e2a\u6b63\u65b9\u7684\u590d\u503c\u77e9\u9635 \\(\\mathbf{A}=[a_{ij}] \\in C^{n\\times n}\\) \u79f0\u4e3a Hermitian \u77e9\u9635 \u82e5 \\(\\mathbf{A}=-\\mathbf{A}^H\\) \uff0c\u5219\u77e9\u9635 \\(\\mathbf{A}\\) \u79f0\u4e3a\u53cd Hermitian \u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u5143\u7d20\u6ee1\u8db3\u5bf9\u79f0\u6027 \\(r_{ij}=r_{n-j+1,n-i+1}^*\\) \u7684 \\(n \\times n\\) \u6b63\u65b9\u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635\u7684\u4e00\u4e2a\u7279\u6b8a\u5b50\u7c7b\u662f\u53cc\u91cd\u5bf9\u79f0\u7684\u77e9\u9635\uff0c\u5b83\u65e2\u662f\u5173\u4e8e\u4e3b\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684 Hermitian \u77e9\u9635\uff0c\u53c8\u662f\u5173\u4e8e\u4ea4\u53c9\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684\u4ea4\u53c9\u5bf9\u79f0\u77e9\u9635\uff0c\u5982 \\[ \\mathbf{R}= \\begin{bmatrix} r_{11} & r_{21}^* & r_{31}^* & r_{41}^* \\\\ r_{21} & r_{22} & r_{32}^* & r_{31}^* \\\\ r_{31} & r_{32} & r_{22} & r_{21}^* \\\\ r_{41} & r_{31} & r_{21} & r_{11} \\end{bmatrix} \\] \u7f6e\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635 \u00b6 \u7f6e\u6362\u77e9\u9635\u4e0e\u4e92\u6362\u77e9\u9635 \u00b6 \u82e5\u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20 1 \u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u7f6e\u6362\u77e9\u9635 \\((\\mathbf{P}_{m \\times n})^{\\top} = \\mathbf{n \\times m}\\) \\(\\mathbf{P}^{\\top}\\mathbf{P}=\\mathbf{P}\\mathbf{P}^{\\top}=\\mathbf{I}\\) \uff0c\u8bf4\u660e\u7f6e\u6362\u77e9\u9635\u662f\u6b63\u4ea4\u77e9\u9635 \\(\\mathbf{P}^{\\top}=\\mathbf{P}^{-1}\\) \\(\\mathbf{P}^{\\top}\\mathbf{A}\\mathbf{P}\\) \u4e0e \\(\\mathbf{A}\\) \u5177\u6709\u76f8\u540c\u7684\u5bf9\u89d2\u7ebf\u5143\u7d20\uff0c\u4f46\u6392\u5217\u987a\u5e8f\u53ef\u80fd\u4e0d\u540c \u53e6\u5916\u4e09\u4e2a\u7279\u6b8a\u5f62\u5f0f\uff1a\u4ea4\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u3001\u79fb\u4f4d\u77e9\u9635 \u5e7f\u4e49\u7f6e\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635 \u00b6 \u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20\u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u5e7f\u4e49\u7f6e\u6362\u77e9\u9635 \u4e00\u4e2a\u6b63\u65b9\u77e9\u9635\u662f \\(g\\) \u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e2a\u7f6e\u6362\u77e9\u9635\u548c\u4e00\u4e2a\u975e\u5947\u5f02\u7684\u5bf9\u89d2\u77e9\u9635\u4e4b\u79ef\uff0c\u5373 \\(\\mathbf{G}=\\mathbf{P}\\mathbf{D}\\) \u9009\u62e9\u77e9\u9635\u662f\u4e00\u79cd\u53ef\u4ee5\u5bf9\u67d0\u4e2a\u7ed9\u5b9a\u77e9\u9635\u7684\u67d0\u4e9b\u884c\u6216\u8005\u67d0\u4e9b\u5217\u8fdb\u884c\u9009\u62e9\u7684\u77e9\u9635 \u6b63\u5b9a\u77e9\u9635\u4e0e\u9149\u77e9\u9635 \u00b6 \u5411\u91cf \\(x_1, ..., x_k \\in C^n\\) \u7ec4\u6210\u4e00\u6b63\u4ea4\u7ec4\uff0c\u82e5 \\(x_i^Hx_j=0, 1 \\le i < j < \\le k\\) \u3002\u82e5\u662f\u5f52\u4e00\u5316\u7684\uff0c\u5219\u4e3a\u6807\u51c6\u6b63\u4ea4\u7ec4 \u4e00\u7ec4\u6b63\u4ea4\u7684\u975e\u96f6\u5411\u91cf\u662f\u7ebf\u6027\u65e0\u5173\u7684 \u4e00\u5b9e\u7684\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{Q} \\in R^{n \\times n}\\) \u79f0\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{Q}\\mathbf{Q}^{\\top}=\\mathbf{Q}^{\\top}\\mathbf{Q}=\\mathbf{I}\\) \u4e00\u590d\u503c\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{U}\\in C^{n \\times n}\\) \u79f0\u4e3a\u9149\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{U}\\mathbf{U}^{\\top}=\\mathbf{U}^{\\top}\\mathbf{U}=\\mathbf{I}\\) \u82e5 \\(n \\times n\\) \u77e9\u9635 \\(\\mathbf{A}=[a_{ij}]\\) \u548c \\(\\mathbf{B}=[b_{ij}]\\) \u662f\u9149\u7b49\u4ef7\u7684\uff0c\u5219 \\(\\sum_{i=1}^n\\sum_{j=1}^n|b_{ij}|^2=\\sum_{i=1}^n\\sum_{j=1}^n|a_{ij}|^2\\) \u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u79f0\u4e3a\u6b63\u89c4\u77e9\uff0c\u82e5 \\(\\mathbf{A}^H\\mathbf{A}=\\mathbf{A}\\mathbf{A}^{\\top}\\) \u4ee4 \\(\\mathbf{J}\\) \u4e3a \\(N \\times N\\) \u7b26\u53f7\u77e9\u9635\uff0c\u6ee1\u8db3 \\(\\mathbf{Q}\\mathbf{J}\\mathbf{Q}^{\\top}=\\mathbf{J}\\) \u7684 \\(N \\times N\\) \u77e9\u9635 \\(\\mathbf{Q}\\) \u79f0\u4e3a \\(J\\) \u6b63\u4ea4\u77e9\u9635\uff0c\u6216\u79f0\u8d85\u6b63\u89c4\u77e9\u9635 \u5e26\u578b\u77e9\u9635\u4e0e\u4e09\u89d2\u77e9\u9635 \u00b6 \u5e26\u884c\u77e9\u9635 \u00b6 \u6ee1\u8db3 \\(a_{ij}=0,|i-j|>k\\) \u7684\u77e9\u9635 \\(\\mathbf{A}\\in C^{m\\times n}\\) \u79f0\u4e3a\u5e26\u578b\u77e9\u9635 \u4e09\u5bf9\u89d2\u77e9\u9635\u662f\u5e26\u578b\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\uff0c\u5f53 \\(|i-j|>1\\) \u65f6\uff0c \\(a_{ij}=0\\) \u4e09\u89d2\u77e9\u9635 \u00b6 \u4e24\u79cd\u7279\u6b8a\u7684\u5e38\u7528\u5e26\u578b\u77e9\u9635\u4e3a\u4e0a\u4e09\u89d2\u77e9\u9635\u548c\u4e0b\u4e09\u89d2\u77e9\u9635 \u6c42\u548c\u5411\u91cf\u4e0e\u4e2d\u5fc3\u5316\u77e9\u9635 \u00b6 \u6c42\u548c\u5411\u91cf \u00b6 \u6240\u6709\u5143\u7d20\u7b49\u4e8e 1 \u7684\u5411\u91cf\u79f0\u4e3a\u6c42\u548c\u5411\u91cf\uff0c\u8bb0\u4e3a \\(\\mathbf{I}=[1,1,...,1]^{\\top}\\) \u4e2d\u5fc3\u5316\u77e9\u9635 \u00b6 \u77e9\u9635 \\(\\mathbf{C}_n=\\mathbf{I}_n-\\mathbf{J}_n=\\mathbf{I}_n-\\frac{1}{n}\\mathbf{J}_n\\) \u79f0\u4e3a\u4e2d\u5fc3\u5316\u77e9\u9635 \u4e2d\u5fc3\u5316\u77e9\u9635\u65e2\u662f\u5bf9\u79f0\u77e9\u9635\uff0c\u53c8\u662f\u5e42\u7b49\u77e9\u9635\uff0c \\(\\mathbf{C}_n=\\mathbf{C}_n^{\\top}=\\mathbf{C}_n^2\\) \u76f8\u4f3c\u77e9\u9635\u4e0e\u76f8\u5408\u77e9\u9635 \u00b6 \u76f8\u4f3c\u77e9\u9635 \u00b6 \u77e9\u9635 \\(\\mathbf{B} \\in C^{n \\times n}\\) \u79f0\u4e3a\u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u7684\u76f8\u4f3c\u77e9\u9635\uff0c\u82e5\u5b58\u5728\u4e00\u975e\u5947\u5f02\u77e9\u9635 \\(\\mathbf{S} \\in C^{n \\times n}\\) \u4f7f\u5f97 \\(\\mathbf{B}=\\mathbf{S}^{-1}\\mathbf{A}\\mathbf{S}\\) \u82e5 \\(\\mathbf{B}\\) \u4e0e \\(\\mathbf{A}\\) \u76f8\u4f3c\uff0c\u5219 \\(\\det(\\mathbf{B})=\\det(\\mathbf{A})\\) \u3001 \\(tr(\\mathbf{B})=tr(\\mathbf{A})\\) \u548c\u76f8\u540c\u7684\u7279\u5f81\u503c \u76f8\u5408\u77e9\u9635 \u00b6 \u4ee4 \\(\\mathbf{A},\\mathbf{B},\\mathbf{C} \\in C^{n\\times n}\\) \uff0c\u5e76\u4e14 \\(\\mathbf{C}\\) \u975e\u5947\u5f02\uff0c\u5219\u77e9\u9635 \\(\\mathbf{B}=\\mathbf{C}^H\\mathbf{A}\\mathbf{C}\\) \u79f0\u4e3a \\(\\mathbf{A}\\) \u7684\u76f8\u5408\u77e9\u9635\u3002 Vandermonde \u77e9\u9635\u548c Fourier \u77e9\u9635 \u00b6 \u5728\u4fe1\u53f7\u5904\u7406\u6709\u5e7f\u6cdb\u5e94\u7528 Hadamard \u77e9\u9635 \u00b6 \u5728\u901a\u4fe1\u3001\u4fe1\u606f\u8bba\u548c\u4fe1\u53f7\u5904\u7406\u4e2d\u4e00\u79cd\u91cd\u8981\u7684\u7279\u6b8a\u77e9\u9635 Toeplitz \u77e9\u9635 \u00b6 Toeplitz \u5728\u7814\u7a76\u4e0e Laurent \u7ea7\u6570\u6709\u5173\u7684\u53cc\u7ebf\u6027\u51fd\u6570\u7684\u4e00\u7bc7\u8bba\u6587\u4e2d\u63d0\u51fa\u7684\u3002 Hankel \u77e9\u9635 \u00b6 \u6b63\u65b9\u77e9\u9635 \\(\\mathbf{A} \\in C^{(n+1)\\times (n+1)}\\) \u79f0\u4e3a Hankel \u77e9\u9635\uff0c\u82e5 \\[ \\mathbf{A}= \\begin{bmatrix} a_{0} & a_{1} & a_{2} & ... & a_{n} \\\\ a_{1} & a_{2} & a_{3} & ... & a_{n+1} \\\\ a_{2} & a_{3} & a_{4} & ... & a_{n+2} \\\\ ... & ... & ... & ... & ...\\\\ a_{n} & a_{n+1} & a_{n+2} & ... & a_{2n} \\end{bmatrix} \\]","title":"\u7279\u6b8a\u77e9\u9635"},{"location":"mb/maa/lec2/#_1","text":"Abstract \u5143\u7d20\u4e4b\u95f4\u5b58\u5728\u67d0\u79cd\u7279\u6b8a\u7ed3\u6784\u5173\u7cfb\u7684\u77e9\u9635\uff0c\u7edf\u79f0\u4e3a\u7279\u6b8a\u77e9\u9635","title":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840"},{"location":"mb/maa/lec2/#hermitian","text":"\u4e00\u4e2a\u6b63\u65b9\u7684\u590d\u503c\u77e9\u9635 \\(\\mathbf{A}=[a_{ij}] \\in C^{n\\times n}\\) \u79f0\u4e3a Hermitian \u77e9\u9635 \u82e5 \\(\\mathbf{A}=-\\mathbf{A}^H\\) \uff0c\u5219\u77e9\u9635 \\(\\mathbf{A}\\) \u79f0\u4e3a\u53cd Hermitian \u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u5143\u7d20\u6ee1\u8db3\u5bf9\u79f0\u6027 \\(r_{ij}=r_{n-j+1,n-i+1}^*\\) \u7684 \\(n \\times n\\) \u6b63\u65b9\u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635\u7684\u4e00\u4e2a\u7279\u6b8a\u5b50\u7c7b\u662f\u53cc\u91cd\u5bf9\u79f0\u7684\u77e9\u9635\uff0c\u5b83\u65e2\u662f\u5173\u4e8e\u4e3b\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684 Hermitian \u77e9\u9635\uff0c\u53c8\u662f\u5173\u4e8e\u4ea4\u53c9\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684\u4ea4\u53c9\u5bf9\u79f0\u77e9\u9635\uff0c\u5982 \\[ \\mathbf{R}= \\begin{bmatrix} r_{11} & r_{21}^* & r_{31}^* & r_{41}^* \\\\ r_{21} & r_{22} & r_{32}^* & r_{31}^* \\\\ r_{31} & r_{32} & r_{22} & r_{21}^* \\\\ r_{41} & r_{31} & r_{21} & r_{11} \\end{bmatrix} \\]","title":"Hermitian \u77e9\u9635"},{"location":"mb/maa/lec2/#_2","text":"","title":"\u7f6e\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635"},{"location":"mb/maa/lec2/#_3","text":"\u82e5\u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20 1 \u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u7f6e\u6362\u77e9\u9635 \\((\\mathbf{P}_{m \\times n})^{\\top} = \\mathbf{n \\times m}\\) \\(\\mathbf{P}^{\\top}\\mathbf{P}=\\mathbf{P}\\mathbf{P}^{\\top}=\\mathbf{I}\\) \uff0c\u8bf4\u660e\u7f6e\u6362\u77e9\u9635\u662f\u6b63\u4ea4\u77e9\u9635 \\(\\mathbf{P}^{\\top}=\\mathbf{P}^{-1}\\) \\(\\mathbf{P}^{\\top}\\mathbf{A}\\mathbf{P}\\) \u4e0e \\(\\mathbf{A}\\) \u5177\u6709\u76f8\u540c\u7684\u5bf9\u89d2\u7ebf\u5143\u7d20\uff0c\u4f46\u6392\u5217\u987a\u5e8f\u53ef\u80fd\u4e0d\u540c \u53e6\u5916\u4e09\u4e2a\u7279\u6b8a\u5f62\u5f0f\uff1a\u4ea4\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u3001\u79fb\u4f4d\u77e9\u9635","title":"\u7f6e\u6362\u77e9\u9635\u4e0e\u4e92\u6362\u77e9\u9635"},{"location":"mb/maa/lec2/#_4","text":"\u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20\u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u5e7f\u4e49\u7f6e\u6362\u77e9\u9635 \u4e00\u4e2a\u6b63\u65b9\u77e9\u9635\u662f \\(g\\) \u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e2a\u7f6e\u6362\u77e9\u9635\u548c\u4e00\u4e2a\u975e\u5947\u5f02\u7684\u5bf9\u89d2\u77e9\u9635\u4e4b\u79ef\uff0c\u5373 \\(\\mathbf{G}=\\mathbf{P}\\mathbf{D}\\) \u9009\u62e9\u77e9\u9635\u662f\u4e00\u79cd\u53ef\u4ee5\u5bf9\u67d0\u4e2a\u7ed9\u5b9a\u77e9\u9635\u7684\u67d0\u4e9b\u884c\u6216\u8005\u67d0\u4e9b\u5217\u8fdb\u884c\u9009\u62e9\u7684\u77e9\u9635","title":"\u5e7f\u4e49\u7f6e\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635"},{"location":"mb/maa/lec2/#_5","text":"\u5411\u91cf \\(x_1, ..., x_k \\in C^n\\) \u7ec4\u6210\u4e00\u6b63\u4ea4\u7ec4\uff0c\u82e5 \\(x_i^Hx_j=0, 1 \\le i < j < \\le k\\) \u3002\u82e5\u662f\u5f52\u4e00\u5316\u7684\uff0c\u5219\u4e3a\u6807\u51c6\u6b63\u4ea4\u7ec4 \u4e00\u7ec4\u6b63\u4ea4\u7684\u975e\u96f6\u5411\u91cf\u662f\u7ebf\u6027\u65e0\u5173\u7684 \u4e00\u5b9e\u7684\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{Q} \\in R^{n \\times n}\\) \u79f0\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{Q}\\mathbf{Q}^{\\top}=\\mathbf{Q}^{\\top}\\mathbf{Q}=\\mathbf{I}\\) \u4e00\u590d\u503c\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{U}\\in C^{n \\times n}\\) \u79f0\u4e3a\u9149\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{U}\\mathbf{U}^{\\top}=\\mathbf{U}^{\\top}\\mathbf{U}=\\mathbf{I}\\) \u82e5 \\(n \\times n\\) \u77e9\u9635 \\(\\mathbf{A}=[a_{ij}]\\) \u548c \\(\\mathbf{B}=[b_{ij}]\\) \u662f\u9149\u7b49\u4ef7\u7684\uff0c\u5219 \\(\\sum_{i=1}^n\\sum_{j=1}^n|b_{ij}|^2=\\sum_{i=1}^n\\sum_{j=1}^n|a_{ij}|^2\\) \u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u79f0\u4e3a\u6b63\u89c4\u77e9\uff0c\u82e5 \\(\\mathbf{A}^H\\mathbf{A}=\\mathbf{A}\\mathbf{A}^{\\top}\\) \u4ee4 \\(\\mathbf{J}\\) \u4e3a \\(N \\times N\\) \u7b26\u53f7\u77e9\u9635\uff0c\u6ee1\u8db3 \\(\\mathbf{Q}\\mathbf{J}\\mathbf{Q}^{\\top}=\\mathbf{J}\\) \u7684 \\(N \\times N\\) \u77e9\u9635 \\(\\mathbf{Q}\\) \u79f0\u4e3a \\(J\\) \u6b63\u4ea4\u77e9\u9635\uff0c\u6216\u79f0\u8d85\u6b63\u89c4\u77e9\u9635","title":"\u6b63\u5b9a\u77e9\u9635\u4e0e\u9149\u77e9\u9635"},{"location":"mb/maa/lec2/#_6","text":"","title":"\u5e26\u578b\u77e9\u9635\u4e0e\u4e09\u89d2\u77e9\u9635"},{"location":"mb/maa/lec2/#_7","text":"\u6ee1\u8db3 \\(a_{ij}=0,|i-j|>k\\) \u7684\u77e9\u9635 \\(\\mathbf{A}\\in C^{m\\times n}\\) \u79f0\u4e3a\u5e26\u578b\u77e9\u9635 \u4e09\u5bf9\u89d2\u77e9\u9635\u662f\u5e26\u578b\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\uff0c\u5f53 \\(|i-j|>1\\) \u65f6\uff0c \\(a_{ij}=0\\)","title":"\u5e26\u884c\u77e9\u9635"},{"location":"mb/maa/lec2/#_8","text":"\u4e24\u79cd\u7279\u6b8a\u7684\u5e38\u7528\u5e26\u578b\u77e9\u9635\u4e3a\u4e0a\u4e09\u89d2\u77e9\u9635\u548c\u4e0b\u4e09\u89d2\u77e9\u9635","title":"\u4e09\u89d2\u77e9\u9635"},{"location":"mb/maa/lec2/#_9","text":"","title":"\u6c42\u548c\u5411\u91cf\u4e0e\u4e2d\u5fc3\u5316\u77e9\u9635"},{"location":"mb/maa/lec2/#_10","text":"\u6240\u6709\u5143\u7d20\u7b49\u4e8e 1 \u7684\u5411\u91cf\u79f0\u4e3a\u6c42\u548c\u5411\u91cf\uff0c\u8bb0\u4e3a \\(\\mathbf{I}=[1,1,...,1]^{\\top}\\)","title":"\u6c42\u548c\u5411\u91cf"},{"location":"mb/maa/lec2/#_11","text":"\u77e9\u9635 \\(\\mathbf{C}_n=\\mathbf{I}_n-\\mathbf{J}_n=\\mathbf{I}_n-\\frac{1}{n}\\mathbf{J}_n\\) \u79f0\u4e3a\u4e2d\u5fc3\u5316\u77e9\u9635 \u4e2d\u5fc3\u5316\u77e9\u9635\u65e2\u662f\u5bf9\u79f0\u77e9\u9635\uff0c\u53c8\u662f\u5e42\u7b49\u77e9\u9635\uff0c \\(\\mathbf{C}_n=\\mathbf{C}_n^{\\top}=\\mathbf{C}_n^2\\)","title":"\u4e2d\u5fc3\u5316\u77e9\u9635"},{"location":"mb/maa/lec2/#_12","text":"","title":"\u76f8\u4f3c\u77e9\u9635\u4e0e\u76f8\u5408\u77e9\u9635"},{"location":"mb/maa/lec2/#_13","text":"\u77e9\u9635 \\(\\mathbf{B} \\in C^{n \\times n}\\) \u79f0\u4e3a\u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u7684\u76f8\u4f3c\u77e9\u9635\uff0c\u82e5\u5b58\u5728\u4e00\u975e\u5947\u5f02\u77e9\u9635 \\(\\mathbf{S} \\in C^{n \\times n}\\) \u4f7f\u5f97 \\(\\mathbf{B}=\\mathbf{S}^{-1}\\mathbf{A}\\mathbf{S}\\) \u82e5 \\(\\mathbf{B}\\) \u4e0e \\(\\mathbf{A}\\) \u76f8\u4f3c\uff0c\u5219 \\(\\det(\\mathbf{B})=\\det(\\mathbf{A})\\) \u3001 \\(tr(\\mathbf{B})=tr(\\mathbf{A})\\) \u548c\u76f8\u540c\u7684\u7279\u5f81\u503c","title":"\u76f8\u4f3c\u77e9\u9635"},{"location":"mb/maa/lec2/#_14","text":"\u4ee4 \\(\\mathbf{A},\\mathbf{B},\\mathbf{C} \\in C^{n\\times n}\\) \uff0c\u5e76\u4e14 \\(\\mathbf{C}\\) \u975e\u5947\u5f02\uff0c\u5219\u77e9\u9635 \\(\\mathbf{B}=\\mathbf{C}^H\\mathbf{A}\\mathbf{C}\\) \u79f0\u4e3a \\(\\mathbf{A}\\) \u7684\u76f8\u5408\u77e9\u9635\u3002","title":"\u76f8\u5408\u77e9\u9635"},{"location":"mb/maa/lec2/#vandermonde-fourier","text":"\u5728\u4fe1\u53f7\u5904\u7406\u6709\u5e7f\u6cdb\u5e94\u7528","title":"Vandermonde \u77e9\u9635\u548c Fourier \u77e9\u9635"},{"location":"mb/maa/lec2/#hadamard","text":"\u5728\u901a\u4fe1\u3001\u4fe1\u606f\u8bba\u548c\u4fe1\u53f7\u5904\u7406\u4e2d\u4e00\u79cd\u91cd\u8981\u7684\u7279\u6b8a\u77e9\u9635","title":"Hadamard \u77e9\u9635"},{"location":"mb/maa/lec2/#toeplitz","text":"Toeplitz \u5728\u7814\u7a76\u4e0e Laurent \u7ea7\u6570\u6709\u5173\u7684\u53cc\u7ebf\u6027\u51fd\u6570\u7684\u4e00\u7bc7\u8bba\u6587\u4e2d\u63d0\u51fa\u7684\u3002","title":"Toeplitz \u77e9\u9635"},{"location":"mb/maa/lec2/#hankel","text":"\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{A} \\in C^{(n+1)\\times (n+1)}\\) \u79f0\u4e3a Hankel \u77e9\u9635\uff0c\u82e5 \\[ \\mathbf{A}= \\begin{bmatrix} a_{0} & a_{1} & a_{2} & ... & a_{n} \\\\ a_{1} & a_{2} & a_{3} & ... & a_{n+1} \\\\ a_{2} & a_{3} & a_{4} & ... & a_{n+2} \\\\ ... & ... & ... & ... & ...\\\\ a_{n} & a_{n+1} & a_{n+2} & ... & a_{2n} \\end{bmatrix} \\]","title":"Hankel \u77e9\u9635"},{"location":"mb/maa/lec3/","text":"\u77e9\u9635\u5fae\u5206 \u00b6 Abstract \u77e9\u9635\u5fae\u5206\u662f\u591a\u53d8\u91cf\u51fd\u6570\u5fae\u5206\u7684\u63a8\u5e7f\uff0c\u5305\u62ec\u77e9\u9635\u504f\u5bfc\u548c\u68af\u5ea6\u3002 \u6982\u5ff5\u5de8\u591a\u4e14\u7e41\u7410\uff08\u8fd8\u662f\u5efa\u8bae\u770b\u4e66\u5427 Jacobian \u77e9\u9635\u4e0e\u68af\u5ea6\u77e9\u9635 \u00b6 Jacobian \u77e9\u9635 \u00b6 \\(pq \\times mn\\) \u7ef4 Jacobian \u77e9\u9635 \\[ D_{X}F(\\mathbf{X}) \\overset{def}{=} \\frac{\\partial vec(F(\\mathbf{X}))}{\\partial (vec \\mathbf{X})^\\top} \\in R^{pq \\times mn} \\] \u5177\u4f53\u8868\u8fbe\u5f0f\u4e3a \\[ D_{X}F(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ... \\\\ \\frac{\\partial f_{p1}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{1q}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{pq}}{\\partial (vec \\mathbf{X})^\\top} \\\\ \\end{bmatrix} = \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial x_{11}} & .. & \\frac{\\partial f_{11}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{11}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{11}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{p1}}{\\partial x_{11}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{1q}}{\\partial x_{11}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{pq}}{\\partial x_{11}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{mn}} \\\\ \\end{bmatrix} \\] \u68af\u5ea6\u77e9\u9635 \u00b6 \u5b9a\u4e49\u68af\u5ea6\u77e9\u9635 \\[ \\nabla_\\mathbf{X} f(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f(\\mathbf{X})}{\\partial x_{11}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{1n}} \\\\ ... & ... & ... \\\\ \\frac{\\partial f(\\mathbf{X})}{\\partial x_{m1}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{mn}} \\\\ \\end{bmatrix} = \\frac{\\partial f(\\mathbf{X})}{\\partial \\mathbf{X}} \\] \u77e9\u9635\u51fd\u6570\u7684\u68af\u5ea6\u77e9\u9635\u662f\u5176 Jacobian \u77e9\u9635\u7684\u8f6c\u7f6e\uff1a \\(\\nabla_\\mathbf{X} F(\\mathbf{X})=(D_\\mathbf{X} F(\\mathbf{X}))^\\top\\) \u504f\u5bfc\u548c\u68af\u5ea6\u8ba1\u7b97 \u00b6 \u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u548c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u7c7b\u4f3c\uff0c\u53ea\u662f\u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u662f\u77e9\u9635\uff0c\u800c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u662f\u5411\u91cf\uff0c\u90fd\u6ee1\u8db3\u7ebf\u6027\u3001\u4e58\u79ef\u3001\u5546\u3001\u94fe\u5f0f\u6cd5\u5219 \u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Jacobian \u77e9\u9635\u8fa8\u8bc6 \u00b6 \u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206 \u00b6 \u77e9\u9635\u5fae\u5206\u7528\u7b26\u53f7 \\(d\\mathbf{X}\\) \u8868\u793a\uff0c\u5b9a\u4e49\u4e3a \\(d\\mathbf{X}=[dX_{ij}]_{i=1,j=1}^{m,n}\\) \u6807\u91cf\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6 \u5b9e\u503c\u77e9\u9635\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6 \u4e8c\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Hessian \u77e9\u9635\u8fa8\u8bc6 \u00b6 Hessian \u77e9\u9635 \u00b6 \u5b9e\u503c\u51fd\u6570 \\(f(x)\\) \u76f8\u5bf9\u4e8e \\(m \\times 1\\) \u5b9e\u5411\u91cf \\(x\\) \u7684\u4e8c\u9636\u504f\u5bfc\u79f0\u4e3a Hessian \u77e9\u9635\uff0c\u8bb0\u4f5c \\(H[f(x)]\\) \uff0c\u5b9a\u4e49\u4e3a \\[ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}=\\frac{\\partial}{\\partial x}[\\frac{\\partial f(x)}{\\partial x^\\top}] \\in R^{m \\times m} \\\\ \u6216 \\\\ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}= \\begin{bmatrix} \\frac{\\partial^2 f}{\\partial x_1 \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_1 \\partial x_m} \\\\ ... & ... & ... \\\\ \\frac{\\partial^2 f}{\\partial x_m \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_m \\partial x_m} \\\\ \\end{bmatrix} \\in R^{m \\times m} \\] Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u539f\u7406 \u00b6 \u6807\u91cf\u51fd\u6570 \\(f(x)\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6 \u6807\u91cf\u51fd\u6570 \\(f(\\mathbf{X})\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6 Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u65b9\u6cd5 \u00b6 \u5171\u8f6d\u68af\u5ea6\u4e0e\u590d Hessian \u77e9\u9635 \u00b6","title":"\u77e9\u9635\u5fae\u5206"},{"location":"mb/maa/lec3/#_1","text":"Abstract \u77e9\u9635\u5fae\u5206\u662f\u591a\u53d8\u91cf\u51fd\u6570\u5fae\u5206\u7684\u63a8\u5e7f\uff0c\u5305\u62ec\u77e9\u9635\u504f\u5bfc\u548c\u68af\u5ea6\u3002 \u6982\u5ff5\u5de8\u591a\u4e14\u7e41\u7410\uff08\u8fd8\u662f\u5efa\u8bae\u770b\u4e66\u5427","title":"\u77e9\u9635\u5fae\u5206"},{"location":"mb/maa/lec3/#jacobian","text":"","title":"Jacobian \u77e9\u9635\u4e0e\u68af\u5ea6\u77e9\u9635"},{"location":"mb/maa/lec3/#jacobian_1","text":"\\(pq \\times mn\\) \u7ef4 Jacobian \u77e9\u9635 \\[ D_{X}F(\\mathbf{X}) \\overset{def}{=} \\frac{\\partial vec(F(\\mathbf{X}))}{\\partial (vec \\mathbf{X})^\\top} \\in R^{pq \\times mn} \\] \u5177\u4f53\u8868\u8fbe\u5f0f\u4e3a \\[ D_{X}F(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ... \\\\ \\frac{\\partial f_{p1}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{1q}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{pq}}{\\partial (vec \\mathbf{X})^\\top} \\\\ \\end{bmatrix} = \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial x_{11}} & .. & \\frac{\\partial f_{11}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{11}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{11}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{p1}}{\\partial x_{11}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{1q}}{\\partial x_{11}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{pq}}{\\partial x_{11}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{mn}} \\\\ \\end{bmatrix} \\]","title":"Jacobian \u77e9\u9635"},{"location":"mb/maa/lec3/#_2","text":"\u5b9a\u4e49\u68af\u5ea6\u77e9\u9635 \\[ \\nabla_\\mathbf{X} f(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f(\\mathbf{X})}{\\partial x_{11}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{1n}} \\\\ ... & ... & ... \\\\ \\frac{\\partial f(\\mathbf{X})}{\\partial x_{m1}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{mn}} \\\\ \\end{bmatrix} = \\frac{\\partial f(\\mathbf{X})}{\\partial \\mathbf{X}} \\] \u77e9\u9635\u51fd\u6570\u7684\u68af\u5ea6\u77e9\u9635\u662f\u5176 Jacobian \u77e9\u9635\u7684\u8f6c\u7f6e\uff1a \\(\\nabla_\\mathbf{X} F(\\mathbf{X})=(D_\\mathbf{X} F(\\mathbf{X}))^\\top\\)","title":"\u68af\u5ea6\u77e9\u9635"},{"location":"mb/maa/lec3/#_3","text":"\u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u548c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u7c7b\u4f3c\uff0c\u53ea\u662f\u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u662f\u77e9\u9635\uff0c\u800c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u662f\u5411\u91cf\uff0c\u90fd\u6ee1\u8db3\u7ebf\u6027\u3001\u4e58\u79ef\u3001\u5546\u3001\u94fe\u5f0f\u6cd5\u5219","title":"\u504f\u5bfc\u548c\u68af\u5ea6\u8ba1\u7b97"},{"location":"mb/maa/lec3/#jacobian_2","text":"","title":"\u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Jacobian \u77e9\u9635\u8fa8\u8bc6"},{"location":"mb/maa/lec3/#_4","text":"\u77e9\u9635\u5fae\u5206\u7528\u7b26\u53f7 \\(d\\mathbf{X}\\) \u8868\u793a\uff0c\u5b9a\u4e49\u4e3a \\(d\\mathbf{X}=[dX_{ij}]_{i=1,j=1}^{m,n}\\) \u6807\u91cf\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6 \u5b9e\u503c\u77e9\u9635\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6","title":"\u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206"},{"location":"mb/maa/lec3/#hessian","text":"","title":"\u4e8c\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Hessian \u77e9\u9635\u8fa8\u8bc6"},{"location":"mb/maa/lec3/#hessian_1","text":"\u5b9e\u503c\u51fd\u6570 \\(f(x)\\) \u76f8\u5bf9\u4e8e \\(m \\times 1\\) \u5b9e\u5411\u91cf \\(x\\) \u7684\u4e8c\u9636\u504f\u5bfc\u79f0\u4e3a Hessian \u77e9\u9635\uff0c\u8bb0\u4f5c \\(H[f(x)]\\) \uff0c\u5b9a\u4e49\u4e3a \\[ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}=\\frac{\\partial}{\\partial x}[\\frac{\\partial f(x)}{\\partial x^\\top}] \\in R^{m \\times m} \\\\ \u6216 \\\\ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}= \\begin{bmatrix} \\frac{\\partial^2 f}{\\partial x_1 \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_1 \\partial x_m} \\\\ ... & ... & ... \\\\ \\frac{\\partial^2 f}{\\partial x_m \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_m \\partial x_m} \\\\ \\end{bmatrix} \\in R^{m \\times m} \\]","title":"Hessian \u77e9\u9635"},{"location":"mb/maa/lec3/#hessian_2","text":"\u6807\u91cf\u51fd\u6570 \\(f(x)\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6 \u6807\u91cf\u51fd\u6570 \\(f(\\mathbf{X})\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6","title":"Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u539f\u7406"},{"location":"mb/maa/lec3/#hessian_3","text":"","title":"Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u65b9\u6cd5"},{"location":"mb/maa/lec3/#hessian_4","text":"","title":"\u5171\u8f6d\u68af\u5ea6\u4e0e\u590d Hessian \u77e9\u9635"},{"location":"mb/optimization-theory/","text":"\u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u6700\u4f18\u5316\u7406\u8bba\u8bfe\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u6700\u4f18\u5316\u95ee\u9898 \u76f4\u7ebf\u641c\u7d22 \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 Reference \u00b6 \u6700\u4f18\u5316\u539f\u7406\u4e0e\u65b9\u6cd5 \u859b\u5609\u5e86\u8457","title":"\u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5"},{"location":"mb/optimization-theory/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u6700\u4f18\u5316\u7406\u8bba\u8bfe\u7684\u7b14\u8bb0","title":"\u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5"},{"location":"mb/optimization-theory/#table-of-contents","text":"\u6700\u4f18\u5316\u95ee\u9898 \u76f4\u7ebf\u641c\u7d22 \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5","title":"Table of Contents"},{"location":"mb/optimization-theory/#reference","text":"\u6700\u4f18\u5316\u539f\u7406\u4e0e\u65b9\u6cd5 \u859b\u5609\u5e86\u8457","title":"Reference"},{"location":"mb/optimization-theory/lec1/","text":"\u6700\u4f18\u5316\u95ee\u9898 \u00b6 Abstract \u8ffd\u6c42\u6700\u4f18\u76ee\u6807\u7684\u6570\u5b66\u95ee\u9898\u90fd\u5c5e\u4e8e\u6700\u4f18\u5316\u95ee\u9898\u3002 \u4f5c\u4e3a\u6700\u4f18\u5316\u95ee\u9898\uff0c\u81f3\u5c11\u6709\u4e24\u4e2a\u8981\u7d20\uff1a\u7b2c\u4e00\u4e2a\u662f\u53ef\u80fd\u7684\u65b9\u6848\uff1b\u7b2c\u4e8c\u4e2a\u662f\u8ffd\u6c42\u7684\u76ee\u6807\u3002 \u7ecf\u5178\u6781\u503c\u95ee\u9898 \u00b6 \u5728\u9ad8\u6570\u91cc\u7684\u5fae\u79ef\u5206\u4e2d\u65e9\u4ee5\u6d89\u53ca\u5230\u6700\u7b80\u5355\u7684\u6700\u4f18\u5316\u95ee\u9898\uff0c \u5c31\u662f\u51fd\u6570\u6781\u503c\u95ee\u9898 \u3002 \u53ef\u4ee5\u5f15\u7533\u51fa\u4e24\u79cd\u7ecf\u5178\u6700\u4f18\u5316\u7684\u4e24\u79cd\u7c7b\u578b\u95ee\u9898\u3002 \u65e0\u7ea6\u675f\u6781\u503c\u95ee\u9898 \u00b6 \\[ \\min{f(x_1, x_2, ..., x_n)} \\ \u6216 \\ \\max{f(x_1, x_2, ..., x_n)} \\] \u8fd9\u91cc\u7684 \\(f(x_1, x_2, ..., x_n)\\) \u662f\u5b9a\u4e49\u5728 \\(n\\) \u7ef4\u7a7a\u95f4\u4e0a\u7684\u53ef\u5fae\u51fd\u6570\u3002 \u6c42\u6781\u503c\u70b9\u65b9\u6cd5 \uff1a\u4ece\u5982\u4e0b\u7684\u542b\u6709 \\(n\\) \u4e2a\u672a\u77e5\u6570 \\(x_1, x_2, ..., x_n\\) \u7684\u975e\u7ebf\u6027\u65b9\u7a0b\u7ec4\u4e2d\u89e3\u51fa\u9a7b\u70b9\uff0c\u7136\u540e\u5224\u5b9a\u6216\u9a8c\u8bc1\u8fd9\u4e9b\u9a7b\u70b9\u662f\u4e0d\u662f\u6781\u503c\u70b9\uff1a \\[ f_{x_1}^\\prime(x_1, x_2, ..., x_n) = 0 \\\\ f_{x_2}^\\prime(x_1, x_2, ..., x_n) = 0 \\\\ ... \\\\ f_{x_n}^\\prime(x_1, x_2, ..., x_n) = 0 \\] \u5177\u6709\u7b49\u5f0f\u7ea6\u675f\u7684\u6781\u503c\u95ee\u9898 \u00b6 \\[ \\min{f(x_1, x_2, ..., x_n)} \\ \u6216 \\ \\max{f(x_1, x_2, ..., x_n)} \\\\ \u6ee1\u8db3\u4e8e \\ \\ \\ h_i(x_1, x_2, ... , x_n) = 0 \\ \\ j = 1,2,...,l(j < n) \\] \u6c42\u6781\u503c\u70b9\u65b9\u6cd5 \uff1a\u901a\u5e38\u91c7\u7528 \\(Lagrange\\) \u4e58\u5b50\u6cd5\u6765\u6c42\u89e3\u3002\u5373\u628a\u8fd9\u4e2a\u95ee\u9898\u8f6c\u6362\u4e3a\u6c42 \\(Lagrange\\) \u51fd\u6570\u7684\u65e0\u7ea6\u675f\u6781\u503c\u95ee\u9898\uff1a \\[ L(x_1, x_2, ... , x_n, \\lambda_1, \\lambda_2, ..., \\lambda_l) \\\\ = f(x_1, x_2, ..., x_n) - \\sum_{j=1}^l \\lambda_j h_j(x_1, x_2, ..., x_n) \\] \u57fa\u672c\u6982\u5ff5 \u00b6 \u5411\u91cf\u8868\u8fbe\u6cd5 \u00b6 \u5c06 \\((x_1, x_2, ..., x_n)\\) \u770b\u4f5c\u662f \\(n\\) \u7ef4\u5411\u91cf\u7a7a\u95f4 \\(R^n\\) \u4e2d\u4e00\u4e2a\u5411\u91cf \\(\\mathbf{x}\\) \u7684 \\(n\\) \u4e2a\u5206\u91cf\uff0c\u5373 \\(\\mathbf{x} = (x_1, x_2, ..., x_n)^{\\top}\\) \u6240\u4ee5\u91cd\u5b9a\u4e49\u4e00\u4e0b\u6700\u4f18\u5316\u95ee\u9898\uff1a \u65e0\u7ea6\u675f\u6781\u503c\u95ee\u9898\uff1a \\[\\min{f(\\mathbf{x})}\\] \u5177\u6709\u7b49\u5f0f\u7ea6\u675f\u7684\u6781\u503c\u95ee\u9898\uff1a \\[ \\min{f(\\mathbf{x})} \\\\ s.t. \\ \\ \\ \\mathbf{h}(\\mathbf{x}) = \\mathbf{0} \\\\ \u5176\u4e2d \\ \\ \\ \\mathbf{h}(\\mathbf{x}) = (h_1(\\mathbf{x}), h_2(\\mathbf{x}), ..., h_l(\\mathbf{x}))^{\\top} \\] \u4e00\u822c\u5f62\u5f0f \u00b6 \u5927\u90e8\u5206\u6240\u8981\u8ba8\u8bba\u7684\u95ee\u9898\u662f\u5982\u4e0b\u7684\uff08\u9759\u6001\uff09\u6700\u4f18\u5316\u95ee\u9898\uff1a \\[ \\min_{x \\in \\Omega}{f(\\mathbf{x})} \\\\ s.t. \\ \\ \\ s_i(\\mathbf{x}) \\ge 0 \\ \\ \\ i = 1, 2, ..., m \\\\ h_j(\\mathbf{x}) = 0 \\ \\ \\ j = 1, 2, .., l \\ (l < n) \\] \u5411\u91cf\u8868\u793a\u6cd5\u5199\u6210\uff1a \\[ \\min_{x \\in \\Omega}{f(\\mathbf{x})} \\\\ s.t. \\ \\ \\ \\mathbf{s}(\\mathbf{x}) \\ge \\mathbf{0} \\\\ \\mathbf{h}(x) = \\mathbf{0} \\\\ \u5176\u4e2d \\ \\ \\ \\mathbf{s}(\\mathbf(x)) = (s_1(\\mathbf{x}), ..., s_m(\\mathbf{x}))^{\\top} \\] \u8fd9\u79cd\u95ee\u9898\u79f0\u4e3a \u975e\u7ebf\u6027\u89c4\u5212 \uff0c\u6bd4\u5177\u6709\u7b49\u5f0f\u7ea6\u675f\u7684\u6781\u503c\u95ee\u9898\u4ec5\u591a\u51fa \\(m\\) \u4e2a\u4e0d\u7b49\u5f0f\u7ea6\u675f\u3002\u4f46\u662f\uff0c\u6240\u8c13\u7ecf\u5178\u95ee\u9898\u4e0e\u8fd1\u4ee3\u95ee\u9898\u7684\u754c\u9650\u4e5f\u5c31\u5728\u8fd9\u91cc\u3002 \u4e00\u4e9b\u672f\u8bed \u6ee1\u8db3\u6240\u6709\u7ea6\u675f\u7684\u5411\u91cf \\(\\mathbf{x}\\) \u79f0\u4e3a \u5bb9\u8bb8\u89e3 \u6216 \u5bb9\u8bb8\u70b9 \u3002 \u5bb9\u8bb8\u70b9 \u7684\u96c6\u5408\u79f0\u4e3a \u5bb9\u8bb8\u96c6 \u3002 \\(\\mathbf{x}^*\\) \u79f0\u4e3a\u95ee\u9898\u7684\u6700\u4f18\u70b9\uff0c\u800c\u76f8\u5e94\u7684\u76ee\u6807\u51fd\u6570\u503c \\(f(\\mathbf{x}^*)\\) \u79f0\u4e3a\u6700\u4f18\u503c\uff0c \\((\\mathbf{x}^*, f(\\mathbf{x}^*))\\) \u79f0\u4e3a\u6700\u4f18\u89e3\u3002 \u5206\u7c7b \u00b6 \\[ \u6700\u4f18\u5316\u95ee\u9898 \\left\\{\\begin{matrix} \u9759\u6001\u95ee\u9898 \\left\\{\\begin{matrix} \u65e0\u7ea6\u675f\u95ee\u9898 \\left\\{\\begin{matrix} \u4e00\u7ef4\u95ee\u9898 \\\\ n\u7ef4\u95ee\u9898 \\end{matrix}\\right. \\\\ \u7ea6\u675f\u95ee\u9898 \\left\\{\\begin{matrix} \u7ebf\u6027\u89c4\u5212 \\\\ \u975e\u7ebf\u6027\u89c4\u5212 \\end{matrix}\\right. \\end{matrix}\\right. \\\\ \u52a8\u6001\u95ee\u9898 \\end{matrix}\\right. \\] \u4e8c\u7ef4\u95ee\u9898\u7684\u56fe\u89e3\u6cd5 \u00b6 \u7b49\u503c\u7ebf \u00b6 \u7528\u5e73\u9762 \\(L\\) \u53bb\u622a\u66f2\u9762 \\(S\\) \u5f97\u5230\u7684\u662f\u4e00\u4e2a\u5706\uff0c\u8fd9\u4e2a\u5706\u53c8\u4e00\u4e2a\u91cd\u8981\u7684\u6027\u8d28\uff1a \u5706\u4e0a\u4efb\u4f55\u4e00\u70b9\u7684\u76ee\u6807\u51fd\u6570\u90fd\u7b49\u4e8e \\(f_0\\) \u3002\u50cf\u8fd9\u6837\u7684\u66f2\u7ebf\uff0c\u5176\u4e0a\u4efb\u4f55\u4e00\u70b9\u7684\u76ee\u6807\u51fd\u6570\u503c\u90fd\u7b49\u4e8e\u540c\u4e00\u5e38\u6570\uff0c\u79f0\u4e3a\u76ee\u6807\u51fd\u6570\u7684 \u7b49\u503c\u7ebf \u3002 \u56fe\u89e3\u6cd5 \\[ \u6c42\u89e3\\min{(x_1-2)^2+(x_2-1)^2} \\\\ s.t. \\ \\ \\ x_1+x_2-5=0 \\] \u5148\u753b\u51fa\u76ee\u6807\u51fd\u6570\u7684\u7b49\u503c\u7ebf\uff0c\u518d\u753b\u51fa\u7ea6\u675f\u66f2\u7ebf\u3002\u5b9e\u9645\u4e0a\u7ea6\u675f\u66f2\u7ebf\u662f\u4e00\u6761\u76f4\u7ebf\uff0c\u8fd9\u6761\u76f4\u7ebf\u5c31\u662f\u5bb9\u8bb8\u96c6\u3002\u56e0\u4e3a\u6700\u4f18\u70b9\u662f\u5bb9\u8bb8\u96c6\u4e0a\u4f7f\u5f97\u7b49\u503c\u7ebf\u5177\u6709\u6700\u5c0f\u503c\u7684\u70b9\uff0c\u7531\u4e0b\u5de6\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u7ea6\u675f\u76f4\u7ebf\u4e0e\u7b49\u503c\u7ebf\uff08\u5706\uff09\u7684\u5207\u70b9\u6b63\u662f\u6700\u4f18\u70b9\u3002\u5229\u7528\u89e3\u6790\u51e0\u4f55\u7684\u6709\u5173\u65b9\u6cd5\u53ef\u6c42\u7684\u8be5\u70b9\u662f \\(\\mathbf{x}^x=(3,2)^{\\top}\\) \uff0c\u5b83\u6240\u5bf9\u5e94\u7684\u6700\u4f18\u503c\u662f \\(f(\\mathbf{x}^*)=2\\) \u3002 \u5c06\u65e0\u7ea6\u675f\u95ee\u9898\u548c\u7ea6\u675f\u95ee\u9898\u7684\u51e0\u4f55\u56fe\u5f62\u5408\u5728\u4e00\u8d77\uff0c\u5982\u4e0b\u53f3\u56fe\u6240\u793a\u3002 \u5bf9\u4e8e\u4e8c\u7ef4\u6700\u4f18\u5316\u95ee\u9898\uff0c\u53ef\u4ee5\u7528\u56fe\u89e3\u6cd5\u6c42\u89e3\u3002 \u7b49\u503c\u9762 \u00b6 \u5bf9\u4e8e\u4e09\u7ef4\u53ca\u4ee5\u4e0a\u7684\u7a7a\u95f4\uff0c\u4f7f\u76ee\u6807\u51fd\u6570\u53d6\u540c\u4e00\u5e38\u6570\u503c\u7684\u70b9\u96c6 \\(\\{ \\mathbf{x} | f(\\mathbf{x})= \\gamma , \\gamma\u662f\u5e38\u6570 \\}\\) \u79f0\u4e3a \u7b49\u503c\u9762 \u3002\u5177\u6709\u4e00\u4e0b\u6027\u8d28\uff1a \u6709\u4e0d\u540c\u503c\u7684\u7b49\u503c\u9762\u4e4b\u95f4\u4e0d\u76f8\u4ea4\u3002 \u9664\u91cc\u6781\u503c\u70b9\u6240\u5728\u7684\u7b49\u503c\u9762\u4ee5\u5916\uff0c\u4e0d\u4f1a\u5728\u533a\u57df\u7684\u5185\u90e8\u4e2d\u65ad\u3002 \u7b49\u503c\u9762\u7a20\u5bc6\u7684\u5730\u65b9\uff0c\u76ee\u6807\u51fd\u6570\u503c\u53d8\u5316\u5f97\u6bd4\u8f83\u5feb\uff1b\u7a00\u758f\u7684\u5730\u65b9\u53d8\u5316\u5f97\u6bd4\u8f83\u6162\u3002 \u5728\u6781\u503c\u70b9\u9644\u8fd1\uff0c\u7b49\u503c\u9762\uff08\u7ebf\uff09\u8fd1\u4f3c\u5730\u5448\u73b0\u4e3a\u540c\u5fc3\u692d\u7403\u9762\u65cf\u3002 \u4e8c\u6b21\u51fd\u6570 \u00b6 \u5728 \\(n\\) \u5143\u76ee\u6807\u51fd\u6570\u4e2d\uff0c\u9664\u91cc\u7ebf\u6027\u51fd\u6570\uff0c\u6700\u7b80\u5355\u6700\u91cd\u8981\u7684\u4e00\u7c7b\u5c31\u662f\u4e8c\u6b21\u51fd\u6570\u3002 \u4e00\u822c\u5f62\u5f0f\u662f \\[ f(x_1, x_2, ..., x_n)=\\frac{1}{2} \\sum_{i=1}^n \\sum_{j=1}^m q_{ij}x_ix_j+\\sum_{i=1}^nb_ix_i+c \\] \u77e9\u9635\u5f62\u5f0f\u662f \\[ f(\\mathbf{x})=\\frac{1}{2}\\mathbf{x}^{\\top}\\mathbf{Q}\\mathbf{x}+\\mathbf{b}^{\\top}\\mathbf{x}+c \\\\ \u5176\u4e2d \\ \\ \\ \\mathbf{Q} = \\begin{bmatrix} q_{11} & q_{12} & ... & q_{1n} \\\\ q_{21} & q_{22} & ... & q_{2n} \\\\ ... & ... & ... & ... \\\\ q_{n1} & q_{n2} & ... & q_{nn} \\end{bmatrix} , \\ \\ \\mathbf{b} = \\begin{bmatrix} b_1 \\\\ b_2 \\\\ ... \\\\ b_n \\end{bmatrix} \\] \u8fd9\u91cc \\(\\mathbf{Q}\\) \u662f\u5bf9\u79f0\u77e9\u9635\uff08\u4e8c\u6b21\u578b\uff09\u3002 \u68af\u5ea6\u4e0e Hesse \u77e9\u9635 \u00b6 \u68af\u5ea6 \u00b6 \u5b9a\u4e49 \u00b6 \u51fd\u6570 \\(f(\\mathbf{x})\\) \u5728 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae \\[ f(\\mathbf{x}_0 + \\mathbf{p})-f(\\mathbf{x}_0) = \\mathbf{l}^{\\top}\\mathbf{p} + o(||\\mathbf{p}||) \\] \u82e5 \\(f(\\mathbf{x})\\) \u5728 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae\uff0c\u5219 \\(f(\\mathbf{x})\\) \u5728\u8be5\u70b9\u5173\u4e8e\u5404\u53d8\u91cf\u7684\u4e00\u9636\u504f\u5bfc\u6570\u5b58\u5728\uff0c\u5e76\u4e14 \\[ \\mathbf{l} = (\\frac{\\partial f(\\mathbf{x}_0)}{\\partial x_1}, \\frac{\\partial f(\\mathbf{x}_0)}{\\partial x_2}, ..., \\frac{\\partial f(\\mathbf{x}_0)}{\\partial x_n})^{\\top} \\] \u4ee5 \\(f(\\mathbf{x})\\) \u7684 \\(n\\) \u4e2a\u504f\u5bfc\u6570\u4e3a\u5206\u91cf\u7684\u5411\u91cf\u79f0\u4e3a \\(f(\\mathbf{x})\\) \u5728 \\(\\mathbf{x}\\) \u5904\u7684\u68af\u5ea6 \\[ \\bigtriangledown f(\\mathbf{x}) = (\\frac{\\partial f(\\mathbf{x})}{\\partial x_1}, \\frac{\\partial f(\\mathbf{x})}{\\partial x_2}, ..., \\frac{\\partial f(\\mathbf{x})}{\\partial x_n})^{\\top} \\] \u6027\u8d28 \u00b6 \u8fc7\u70b9 \\(\\mathbf{x}_0\\) \u7684\u7b49\u503c\u9762\u65b9\u7a0b\u4e3a \\(f(\\mathbf{x}) = f(\\mathbf{x}_0) \u6216 f(x_1, x_2, ..., x_n) = \\gamma_0 \\ \\ \\ \u5176\u4e2d \\ \\gamma_0 = f(\\mathbf{x}_0)\\) \u3002 \u8bbe \\(f: R^n \\to R^1\\) \u5728\u70b9 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae\uff0c \\(\\mathbf{p}\\) \u662f\u56fa\u5b9a\u4e0d\u53d8\u7684\u5411\u91cf\uff0c \\(\\mathbf{e}\\) \u662f\u65b9\u5411 \\(\\mathbf{p}\\) \u4e0a\u7684\u5355\u4f4d\u5411\u91cf\uff0c\u5219\u79f0\u6781\u9650 \\(\\frac{\\partial f(\\mathbf{x}_0)}{\\partial \\mathbf{p}} = \\lim_{t \\to 0^+} \\frac{f(\\mathbf{x}_0+t\\mathbf{e})-f(\\mathbf{x}_0)}{t}\\) \u4e3a\u51fd\u6570 \\(f(\\mathbf{x})\\) \u5728\u70b9 \\(\\mathbf{x}_0\\) \u5904\u6cbf \\(\\mathbf{p}\\) \u65b9\u5411\u7684\u65b9\u5411\u5bfc\u6570\u3002 \u8bbe \\(f:R^n \\to R^1\\) \u5728\u70b9 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae\uff0c\u5219 \\(\\frac{\\partial f(\\mathbf{x}_0)}{\\partial \\mathbf{p}} = \\bigtriangledown f(\\mathbf{x}_0)^{\\top}\\mathbf{e}\\) \u3002\u5176\u4e2d \\(\\mathbf{e}\\) \u662f \\(\\mathbf{p}\\) \u65b9\u5411\u4e0a\u7684\u5355\u4f4d\u5411\u91cf\u3002 \u7279\u6b8a\u7c7b\u578b\u51fd\u6570\u7684\u68af\u5ea6 \u00b6 \u82e5 \\(f(\\mathbf{x})=C\\) (\u5e38\u6570)\uff0c\u5219 \\(\\bigtriangledown f(\\mathbf{x})=\\mathbf{0}\\) \uff0c\u5373 \\(\\bigtriangledown C = \\mathbf{0}\\) \\(\\bigtriangledown (\\mathbf{b}^{\\top}\\mathbf{x})=\\mathbf{b}\\) \\(\\bigtriangledown (\\mathbf{x}^{\\top}\\mathbf{x})=2\\mathbf{x}\\) \u82e5 \\(\\mathbf{Q}\\) \u662f\u5bf9\u79f0\u65b9\u9635\uff0c\u5219 \\(\\bigtriangledown (\\mathbf{x}^{\\top}\\mathbf{Q}\\mathbf{x})=2\\mathbf{Q}\\mathbf{x}\\) Hesse \u77e9\u9635 \u00b6 \u591a\u5143\u51fd\u6570 \\(f(\\mathbf{x})\\) \u7684\u4e00\u9636\u5bfc\u6570\u662f\u5b83\u7684\u68af\u5ea6 \\(\\bigtriangledown f(\\mathbf{x})\\) \uff0c\u4e8c\u9636\u5bfc\u6570\u662f\u5b83\u7684 Hesse \u77e9\u9635 \\(\\bigtriangledown^2f(\\mathbf{x})\\) \u3002 \\[ \\bigtriangledown^2 f(\\mathbf{x})=\\bigtriangledown(\\bigtriangledown f(\\mathbf{x}))= \\begin{bmatrix} \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_1^2} & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_2 \\partial x_1} & ... & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_n \\partial x_1} \\\\ \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_1 \\partial x_2} & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_2^2} & ... & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_n \\partial x_2} \\\\ ... & ... & ... & ... \\\\ \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_1 \\partial x_n} & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_2 \\partial x_n} & ... & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_n^2} \\\\ \\end{bmatrix} \\] \u5e38\u7528\u516c\u5f0f\uff1a \\(\\bigtriangledown \\mathbf{c}=\\mathbf{O}\\) \uff0c\u5176\u4e2d \\(\\mathbf{c}\\) \u662f\u5206\u91cf\u5168\u4e3a\u5e38\u6570\u7684 \\(n\\) \u7ef4\u5411\u91cf\uff0c \\(\\mathbf{O}\\) \u662f \\(n \\times n\\) \u9636\u96f6\u77e9\u9635\u3002 \\(\\bigtriangledown \\mathbf{x} = \\mathbf{I}\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}\\) \u662f \\(n\\) \u7ef4\u5411\u91cf\uff0c \\(\\mathbf{I}\\) \u662f \\(n \\times n\\) \u9636\u5355\u4f4d\u77e9\u9635\u3002 \\(\\bigtriangledown (\\mathbf{Q}\\mathbf{x})=\\mathbf{Q}\\) \uff0c\u5176\u4e2d \\(\\mathbf{Q}\\) \u662f \\(n \\times n\\) \u9636\u77e9\u9635\u3002 \u8bbe \\(\\varphi (t)=f(\\mathbf{x}_0 + t\\mathbf{p})\\) \uff0c\u5176\u4e2d \\(f:R^n \\to R^1, \\varphi: R^{\\top} \\to R^1\\) \uff0c\u5219 \\[ \\varphi^\\prime(t)=\\bigtriangledown f(\\mathbf{x}_0 + t\\mathbf{p})^{\\top}\\mathbf{p} \\\\ \\varphi^{\\prime \\prime}(t)=\\mathbf{p}^{\\top}\\bigtriangledown^2f(\\mathbf{x}_0+t\\mathbf{p})\\mathbf{p} \\] \u591a\u5143\u51fd\u6570\u7684 Taylor \u5c55\u5f00\u5f0f \u00b6 \u8bbe \\(f:R^n \\to R^1\\) \u5177\u6709\u4e8c\u9636\u8fde\u7eed\u504f\u5bfc\u6570\uff0c\u5219 \\[ f(\\mathbf{x}+\\mathbf{p})=f(\\mathbf{x})+\\bigtriangledown f(\\mathbf{x})^{\\top}\\mathbf{p}+\\frac{1}{2}\\mathbf{p}^{\\top}\\bigtriangledown^2f(\\bar{\\mathbf{x}})\\mathbf{p} \\\\ \u5176\u4e2d\\bar{\\mathbf{x}}=\\mathbf{x}+\\theta \\mathbf{p}\uff0c\u800c0 < \\theta < 1 \\] \u51f8\u96c6\u4e0e\u51f8\u51fd\u6570 \u00b6 \u51f8\u96c6 \u00b6 \u8bbe \\(x_1, x_2, ..., x_l\\) \u662f \\(R^n\\) \u4e2d\u7684 \\(l\\) \u4e2a\u5df2\u77e5\u70b9\u3002\u82e5\u5bf9\u67d0\u70b9 \\(x \\in R^n\\) \u5b58\u5728\u5e38\u6570 \\(a_1, a_2, ..., a_l \\ge 0\\) \u4e14 \\(\\sum_{i=1}^la_i=1\\) \u4f7f\u5f97 \\(x=\\sum_{i=1}^la_ix_i\\) \uff0c\u5219\u79f0 \\(x\\) \u662f \\(x_1, x_2,...,x_l\\) \u7684\u51f8\u7ec4\u5408\u3002\u82e5 \\(a_1, a_2, ..., a_l > 0\\) \u4e14 \\(\\sum_{i=1}^la_i=1\\) \uff0c\u5219\u79f0 \\(x\\) \u662f \\(x_1, x_2, ..., x_l\\) \u7684\u4e25\u683c\u51f8\u7ec4\u5408\u3002 \u8bbe\u96c6\u5408 \\(C \\subseteq R^n\\) \uff0c\u5982\u679c\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \uff0c\u5b83\u4eec\u7684\u4efb\u610f\u51f8\u7ec4\u5408\u4ecd\u7136\u5c5e\u4e8e C\uff0c\u90a3\u4e48\u79f0\u96c6\u5408 C \u4e3a\u51f8\u96c6\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u8d85\u5e73\u9762\uff0c \\(\\alpha\\) \u79f0\u4e3a\u8fd9\u4e2a\u8d85\u5e73\u9762\u7684\u6cd5\u5411\u91cf\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u534a\u7a7a\u95f4\u3002 \u4efb\u610f\u4e00\u7ec4\u51f8\u96c6\u7684\u4ea4\u4ecd\u7136\u662f\u51f8\u96c6\u3002 \u51f8\u51fd\u6570 \u00b6 \u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\u3002\u82e5\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \u548c\u4efb\u610f\u4e00\u5bf9\u6ee1\u8db3 \\(\\alpha_1 + \\alpha_2 = 1\\) \u7684\u6570 \\(\\alpha_1, \\alpha_2 \\in [0,1]\\) \u90fd\u6709 \\(f(\\alpha_1x_1+\\alpha_2x_2) \\le \\alpha_1f(x_1)+\\alpha_2f(x_2)\\) \uff0c\u5219\u79f0 f \u4e3a\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\u51f8\u51fd\u6570\uff08\u4e25\u683c\u5c0f\u4e8e\u65f6\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09 \u82e5\u51fd\u6570 f \u5728\u51f8\u96c6 C \u4e0a\u662f\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\uff0c\u5219\u79f0 f \u662f\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\u3002 \u8bbe \\(f: C \\subset R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u975e\u7a7a\u51f8\u96c6\u3002\u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5bf9\u4e8e\u4efb\u610f\u5b9e\u6570 \\(\\beta\\) \uff0c\u6c34\u5e73\u96c6 \\(D_\\beta = \\{x | f(x) \\le \\beta, x \\in C\\}\\) \u662f\u51f8\u96c6\u3002 \u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u662f\u975e\u7a7a\u51f8\u96c6\uff0cf \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5f62\u5f0f\u4e3a \\(\\min f(x) \\ s.t. \\ x \\in C\\) \u7684\u95ee\u9898\u79f0\u4e3a\u51f8\u89c4\u5212\u3002 \u8bbe \\(x^\\prime\\) \u662f\u51f8\u89c4\u5212\u7684\u5c40\u90e8\u6781\u5c0f\u70b9 \u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u5168\u5c40\u6781\u5c0f\u70b9 \u82e5 f \u662f\u4e25\u683c\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u552f\u4e00\u5168\u5c40\u6700\u5c0f\u70b9 \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u53ef\u5fae\u51fd\u6570\uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\uff0c\u5219 f \u4e3a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u90fd\u6709 $f(x_2) \\ge f(x_1) + \\(\\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) f \u662f\u4e25\u683c\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u4e14 \\(x_1 \\ne x_2\\) \u90fd\u6709 \\(f(x_2) > f(x_1) + \\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u4e8c\u6b21\u53ef\u5fae\u51fd\u6570\uff0cC \u4e3a\u975e\u7a7a\u5f00\u51f8\u96c6\uff0c\u5219 f \u4e3a C \u4e0a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c Hesse \u77e9\u9635 \\(\\bigtriangledown^2 f(x)\\) \u5728 C \u4e0a\u5230\u5904\u534a\u6b63\u5b9a\uff08\u6ee1\u8db3\u534a\u6b63\u5b9a\u65f6\uff0c\u5219 f \u5728 C\u4e0a\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09\u3002 \u6781\u5c0f\u70b9\u7684\u5224\u5b9a\u6761\u4ef6 \u00b6 \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u504f\u5bfc\u6570\u3002\u82e5 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u5c40\u90e8\u6781\u5c0f\u70b9\u5e76\u4e14\u662f D \u7684\u5185\u70b9\uff0c\u5219 \\(\\bigtriangledown f(x^\\prime) = 0\\) \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \uff0c \\(x^\\prime\\) \u662f D \u7684\u54ea\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime) = 0\\) \uff0c\u5219 \\(x^\\prime\\) \u79f0\u4e3a \\(f(x)\\) \u7684\u9a7b\u70b9\u3002 \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u504f\u5bfc\u6570\uff0c \\(x^\\prime\\) \u662f D \u7684\u4e00\u4e2a\u5185\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime)=0\\) \u5e76\u4e14 \\(\\bigtriangledown^2 f(x^\\prime)\\) \u662f\u6b63\u5b9a\u7684\uff0c\u5219 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u4e25\u683c\u5c40\u90e8\u6781\u5c0f\u70b9\u3002 \u4e0b\u964d\u8fed\u4ee3\u7b97\u6cd5 \u00b6 \u7ed9\u5b9a\u521d\u59cb\u70b9\u540e\uff0c\u5982\u679c\u6bcf\u8fed\u4ee3\u4e00\u6b65\u90fd\u4f7f\u76ee\u6807\u51fd\u6570\u6709\u6240\u4e0b\u964d\uff0c\u5373 \\(f(\\mathbf{x}_{k+1}) < f(\\mathbf{x}_k)\\) \uff0c\u90a3\u8fd9\u79cd\u8fed\u4ee3\u6cd5\u79f0\u4e3a\u4e0b\u964d\u6cd5\u3002 \u5728\u8fed\u4ee3\u8fc7\u7a0b\u4e2d\u6709\u4e24\u4e2a\u89c4\u5219\u9700\u8981\u786e\u5b9a\uff0c\u4e00\u4e2a\u662f\u4e0b\u964d\u65b9\u5411 \\(\\mathbf{p}_k\\) \u7684\u9009\u53d6\uff1b\u4e00\u4e2a\u662f\u6b65\u957f\u56e0\u5b50 \\(t_k\\) \u7684\u9009\u53d6\u3002 \u7b97\u6cd5\u7684\u57fa\u672c\u683c\u5f0f\u5982\u4e0b\uff1a \u9009\u53d6\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u7f6e \\(k=0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(\\mathbf{p}_k\\) \u4f7f\u5f97 \\(\\bigtriangledown f(\\mathbf{x}_k)^{\\top} \\mathbf{p}_k < 0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(t_k\\) \u4f7f\u5f97 \\(f(\\mathbf{x}_k+t_k\\mathbf{p}_k) 0\\) \u4e14 \\(\\sum_{i=1}^la_i=1\\) \uff0c\u5219\u79f0 \\(x\\) \u662f \\(x_1, x_2, ..., x_l\\) \u7684\u4e25\u683c\u51f8\u7ec4\u5408\u3002 \u8bbe\u96c6\u5408 \\(C \\subseteq R^n\\) \uff0c\u5982\u679c\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \uff0c\u5b83\u4eec\u7684\u4efb\u610f\u51f8\u7ec4\u5408\u4ecd\u7136\u5c5e\u4e8e C\uff0c\u90a3\u4e48\u79f0\u96c6\u5408 C \u4e3a\u51f8\u96c6\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u8d85\u5e73\u9762\uff0c \\(\\alpha\\) \u79f0\u4e3a\u8fd9\u4e2a\u8d85\u5e73\u9762\u7684\u6cd5\u5411\u91cf\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u534a\u7a7a\u95f4\u3002 \u4efb\u610f\u4e00\u7ec4\u51f8\u96c6\u7684\u4ea4\u4ecd\u7136\u662f\u51f8\u96c6\u3002","title":"\u51f8\u96c6"},{"location":"mb/optimization-theory/lec1/#_19","text":"\u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\u3002\u82e5\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \u548c\u4efb\u610f\u4e00\u5bf9\u6ee1\u8db3 \\(\\alpha_1 + \\alpha_2 = 1\\) \u7684\u6570 \\(\\alpha_1, \\alpha_2 \\in [0,1]\\) \u90fd\u6709 \\(f(\\alpha_1x_1+\\alpha_2x_2) \\le \\alpha_1f(x_1)+\\alpha_2f(x_2)\\) \uff0c\u5219\u79f0 f \u4e3a\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\u51f8\u51fd\u6570\uff08\u4e25\u683c\u5c0f\u4e8e\u65f6\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09 \u82e5\u51fd\u6570 f \u5728\u51f8\u96c6 C \u4e0a\u662f\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\uff0c\u5219\u79f0 f \u662f\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\u3002 \u8bbe \\(f: C \\subset R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u975e\u7a7a\u51f8\u96c6\u3002\u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5bf9\u4e8e\u4efb\u610f\u5b9e\u6570 \\(\\beta\\) \uff0c\u6c34\u5e73\u96c6 \\(D_\\beta = \\{x | f(x) \\le \\beta, x \\in C\\}\\) \u662f\u51f8\u96c6\u3002 \u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u662f\u975e\u7a7a\u51f8\u96c6\uff0cf \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5f62\u5f0f\u4e3a \\(\\min f(x) \\ s.t. \\ x \\in C\\) \u7684\u95ee\u9898\u79f0\u4e3a\u51f8\u89c4\u5212\u3002 \u8bbe \\(x^\\prime\\) \u662f\u51f8\u89c4\u5212\u7684\u5c40\u90e8\u6781\u5c0f\u70b9 \u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u5168\u5c40\u6781\u5c0f\u70b9 \u82e5 f \u662f\u4e25\u683c\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u552f\u4e00\u5168\u5c40\u6700\u5c0f\u70b9 \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u53ef\u5fae\u51fd\u6570\uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\uff0c\u5219 f \u4e3a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u90fd\u6709 $f(x_2) \\ge f(x_1) + \\(\\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) f \u662f\u4e25\u683c\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u4e14 \\(x_1 \\ne x_2\\) \u90fd\u6709 \\(f(x_2) > f(x_1) + \\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u4e8c\u6b21\u53ef\u5fae\u51fd\u6570\uff0cC \u4e3a\u975e\u7a7a\u5f00\u51f8\u96c6\uff0c\u5219 f \u4e3a C \u4e0a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c Hesse \u77e9\u9635 \\(\\bigtriangledown^2 f(x)\\) \u5728 C \u4e0a\u5230\u5904\u534a\u6b63\u5b9a\uff08\u6ee1\u8db3\u534a\u6b63\u5b9a\u65f6\uff0c\u5219 f \u5728 C\u4e0a\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09\u3002","title":"\u51f8\u51fd\u6570"},{"location":"mb/optimization-theory/lec1/#_20","text":"\u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u504f\u5bfc\u6570\u3002\u82e5 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u5c40\u90e8\u6781\u5c0f\u70b9\u5e76\u4e14\u662f D \u7684\u5185\u70b9\uff0c\u5219 \\(\\bigtriangledown f(x^\\prime) = 0\\) \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \uff0c \\(x^\\prime\\) \u662f D \u7684\u54ea\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime) = 0\\) \uff0c\u5219 \\(x^\\prime\\) \u79f0\u4e3a \\(f(x)\\) \u7684\u9a7b\u70b9\u3002 \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u504f\u5bfc\u6570\uff0c \\(x^\\prime\\) \u662f D \u7684\u4e00\u4e2a\u5185\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime)=0\\) \u5e76\u4e14 \\(\\bigtriangledown^2 f(x^\\prime)\\) \u662f\u6b63\u5b9a\u7684\uff0c\u5219 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u4e25\u683c\u5c40\u90e8\u6781\u5c0f\u70b9\u3002","title":"\u6781\u5c0f\u70b9\u7684\u5224\u5b9a\u6761\u4ef6"},{"location":"mb/optimization-theory/lec1/#_21","text":"\u7ed9\u5b9a\u521d\u59cb\u70b9\u540e\uff0c\u5982\u679c\u6bcf\u8fed\u4ee3\u4e00\u6b65\u90fd\u4f7f\u76ee\u6807\u51fd\u6570\u6709\u6240\u4e0b\u964d\uff0c\u5373 \\(f(\\mathbf{x}_{k+1}) < f(\\mathbf{x}_k)\\) \uff0c\u90a3\u8fd9\u79cd\u8fed\u4ee3\u6cd5\u79f0\u4e3a\u4e0b\u964d\u6cd5\u3002 \u5728\u8fed\u4ee3\u8fc7\u7a0b\u4e2d\u6709\u4e24\u4e2a\u89c4\u5219\u9700\u8981\u786e\u5b9a\uff0c\u4e00\u4e2a\u662f\u4e0b\u964d\u65b9\u5411 \\(\\mathbf{p}_k\\) \u7684\u9009\u53d6\uff1b\u4e00\u4e2a\u662f\u6b65\u957f\u56e0\u5b50 \\(t_k\\) \u7684\u9009\u53d6\u3002 \u7b97\u6cd5\u7684\u57fa\u672c\u683c\u5f0f\u5982\u4e0b\uff1a \u9009\u53d6\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u7f6e \\(k=0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(\\mathbf{p}_k\\) \u4f7f\u5f97 \\(\\bigtriangledown f(\\mathbf{x}_k)^{\\top} \\mathbf{p}_k < 0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(t_k\\) \u4f7f\u5f97 \\(f(\\mathbf{x}_k+t_k\\mathbf{p}_k) \\varphi(t_2) \\\\ \u5f53t_1 \\ge t^*\u65f6\uff0c\\varphi(t_1) < \\varphi(t_2) \\] \u5219\u79f0 \\(\\varphi(t)\\) \u662f\u533a\u95f4 \\(L\\) \u4e0a\u7684\u5355\u8c37\u51fd\u6570\u3002 \u8bbe \\(\\varphi \\subset R^1 \\to R^1\\) \uff0c \\(t^*\\) \u662f \\(\\varphi (t)\\) \u5728 \\(L\\) \u4e0a\u7684\u5168\u5c40\u6700\u5c0f\u70b9\u3002\u5982\u679c\u627e\u5230 \\(t_1 \\in L\\) \u548c \\(t_2 \\in L\\) \u4f7f\u5f97 \\(t_1 < t^* < t_2\\) \uff0c\u5219 \\([t_1, t_2]\\) \u4e3a \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\uff0c\u8bb0\u4e3a \\(\\{t_1, t_2\\}\\) \u3002 \u8bbe \\(\\{a,b\\}\\) \u662f\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\u3002\u5728 \\((a,b)\\) \u4e0a\u4efb\u53d6\u4e24\u70b9 \\(t_1\\) \u548c \\(t_2\\) \u4e14 \\(t_1 \\varphi(t_2)\\) \uff0c\u5219 \\(\\{t_1, b\\}\\) \u662f \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u7a7a\u95f4\u3002 \u641c\u7d22\u533a\u95f4\u7684\u786e\u5b9a \u9009\u5b9a\u521d\u59cb\u70b9 \\(t_0\\) \u548c\u6b65\u957f \\(h\\) \u8ba1\u7b97\u5e76\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0+h)\\) \uff0c\u6709 3\uff0c4 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)<\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0-h)\\) \uff0c\u6709 5\uff0c6 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)\\ge\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0+(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0+(2^{m-1}-1)^h) \\ge \\varphi(t_0+(2^m-1)^h) < \\varphi(t_0+(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0+(2^{m-1}-1)^h), v=\\varphi(t_0+(2^{m}-1)^h), w=\\varphi(t_0+(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{u,v,r\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{v,r,w\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h) > \\varphi(t_0)\\) \u65f6\uff0c\u53d6 \\(\\{t_0-h,t_0,t_0+h\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h)\\le\\varphi(t_0)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0-(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0-(2^{m-1}-1)^h) \\ge \\varphi(t_0-(2^m-1)^h) < \\varphi(t_0-(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0-(2^{m-1}-1)^h), v=\\varphi(t_0-(2^{m}-1)^h), w=\\varphi(t_0-(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{w,r,v\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{r,v,u\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u6b65\u957f\u7684\u9009\u62e9 \u5bf9\u5206\u6cd5 \u00b6 \u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u5b83\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \u548c \\(\\varphi^\\prime(t)\\) \u7684\u8868\u8fbe\u5f0f\uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \uff0c\u8981\u6c42 \\(\\varphi^\\prime(a)<0,\\varphi^\\prime(b)>0\\) \u8ba1\u7b97 \\(\\{a,b\\}\\) \u7684\u4e2d\u70b9 \\(c=0.5(a+b)\\) \u82e5 \\(\\varphi^\\prime(c)<0\\) \uff0c\u5219 \\(a=c\\) \uff0c\u8f6c 4\uff1b\u82e5 \\(\\varphi^\\prime(c)=0\\) \uff0c\u5219 \\(t^*=c\\) \uff0c\u8f6c 5\uff1b\u82e5 \\(\\varphi^\\prime(c)>0\\) \uff0c\u5219 \\(b=c\\) \uff0c\u8f6c4 \u82e5 \\(|a-b|<\\varepsilon\\) \uff0c\u5219 \\(t^*=0.5(a+b)\\) \uff0c\u8f6c 5\uff0c\u5426\u5219\u8f6c 2 \u6253\u5370 \\(t^*\\) \uff0c\u505c\u673a Newton \u5207\u7ebf\u6cd5 \u00b6 \u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u4e00\u9636\u548c\u4e8c\u9636\u5bfc\u6570\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b \u8bbe\u5728\u533a\u95f4 \\([a,b]\\) \u4e2d\u7ecf\u8fc7 \\(k\\) \u6b21\u8fed\u4ee3\u5df2\u6c42\u5230\u65b9\u7a0b \\(\\varphi^\\prime(t)=0\\) \u7684\u4e00\u4e2a\u8fd1\u6839\u4f3c \\(t_k\\) \u3002\u8fc7 \\((t_k,\\varphi^\\prime(t_k))\\) \u4f5c\u66f2\u7ebf \\(y=\\varphi^\\prime(t)\\) \u7684\u5207\u7ebf\uff0c\u5176\u65b9\u7a0b\u662f \\[ y-\\varphi^\\prime(t_k)=\\varphi^{\\prime\\prime}(t_k)(t-t_k) \\] \u7136\u540e\u7528\u8fd9\u6761\u5207\u7ebf\u4e0e\u6a2a\u8f74\u4ea4\u70b9\u7684\u6a2a\u5750\u6807 \\(t_{k+1}\\) \u4f5c\u4e3a\u6839\u7684\u65b0\u7684\u8fd1\u4f3c\uff0c\u4ee4 \\(y=0\\) \u89e3\u51fa \\[ t_{k+1}=t_k-\\varphi^\\prime(t_k)/\\varphi^{\\prime\\prime}(t_k) \\] \u9ec4\u91d1\u5206\u5272\u6cd5 \u00b6 \u9002\u7528\u4e8e \\([a,b]\\) \u533a\u95f4\u4e0a\u7684\u4efb\u4f55\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6c42\u6781\u5c0f\u70b9\u95ee\u9898 \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a \\(\\varphi(t)\\) \u7684\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u8ba1\u7b97 \\(t_2=a+\\beta(b-a), \\varphi_2=\\varphi(t_2)\\) \u8ba1\u7b97 \\(t_1=a+b-t_2, \\varphi_1=\\varphi(t_1)\\) \u82e5 \\(|t_1-t_2|<\\varepsilon\\) \uff0c\u5219\u6253\u5370 \\(t^\\prime=\\frac{t_1+t_2}{2}\\) \uff0c\u505c\u673a\uff1b\u90fd\u5219\uff0c\u82e5 \\(|t_1-t_2| \\ge \\varepsilon\\) \uff0c\u8f6c 5 \u5224\u522b \\(\\varphi_1 \\le \\varphi_2\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u7f6e \\(b=t_2,t_2=t_1,\\varphi_2=\\varphi_1\\) \uff0c\u7136\u540e\u8f6c 3\uff1b\u5426\u5219\uff0c\u82e5 \\(\\varphi_1>\\varphi_2\\) \uff0c\u5219\u7f6e \\(a=t_1,t_1=t_2,\\varphi_1=\\varphi_2,t_2=a+\\beta(b-a),\\varphi_2=\\varphi(t_2)\\) \uff0c\u7136\u540e\u8f6c4","title":"\u76f4\u7ebf\u641c\u7d22"},{"location":"mb/optimization-theory/lec2/#_1","text":"Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u7684\u95ee\u9898\u662f \\(\\min{(\\varphi (t))}\uff0c\\varphi: R^1 \\to R^1\\) \uff0c\u8fd9\u79cd\u8fed\u4ee3\u65b9\u6cd5\u79f0\u4e3a\u76f4\u7ebf/\u4e00\u7ef4\u641c\u7d22\u3002\u5e76\u4e14\u5728\u591a\u7ef4\u95ee\u9898\u4e5f\u80fd\u7528\u5230\u3002","title":"\u76f4\u7ebf\u641c\u7d22"},{"location":"mb/optimization-theory/lec2/#_2","text":"\u5047\u8bbe\u4e00\u5143\u51fd\u6570 \\(\\varphi (t)\\) \u662f\u5355\u8c37\u51fd\u6570 \u8bbe \\(\\varphi \\subset R^1 \\to R^1\\) \uff0c \\(t^*\\) \u662f \\(\\varphi (t)\\) \u5728 \\(L\\) \u4e0a\u7684\u5168\u5c40\u6700\u5c0f\u70b9\u3002\u5982\u679c\u5bf9\u4e8e \\(L\\) \u4e0a\u4efb\u53d6\u7684\u4e24\u70b9 \\(t_1, t_2\\) \u4e14 \\(t_1 < t_2\\) \u90fd\u6709 \\[ \u5f53t_2 \\le t^*\u65f6\uff0c\\varphi(t_1) > \\varphi(t_2) \\\\ \u5f53t_1 \\ge t^*\u65f6\uff0c\\varphi(t_1) < \\varphi(t_2) \\] \u5219\u79f0 \\(\\varphi(t)\\) \u662f\u533a\u95f4 \\(L\\) \u4e0a\u7684\u5355\u8c37\u51fd\u6570\u3002 \u8bbe \\(\\varphi \\subset R^1 \\to R^1\\) \uff0c \\(t^*\\) \u662f \\(\\varphi (t)\\) \u5728 \\(L\\) \u4e0a\u7684\u5168\u5c40\u6700\u5c0f\u70b9\u3002\u5982\u679c\u627e\u5230 \\(t_1 \\in L\\) \u548c \\(t_2 \\in L\\) \u4f7f\u5f97 \\(t_1 < t^* < t_2\\) \uff0c\u5219 \\([t_1, t_2]\\) \u4e3a \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\uff0c\u8bb0\u4e3a \\(\\{t_1, t_2\\}\\) \u3002 \u8bbe \\(\\{a,b\\}\\) \u662f\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\u3002\u5728 \\((a,b)\\) \u4e0a\u4efb\u53d6\u4e24\u70b9 \\(t_1\\) \u548c \\(t_2\\) \u4e14 \\(t_1 \\varphi(t_2)\\) \uff0c\u5219 \\(\\{t_1, b\\}\\) \u662f \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u7a7a\u95f4\u3002 \u641c\u7d22\u533a\u95f4\u7684\u786e\u5b9a \u9009\u5b9a\u521d\u59cb\u70b9 \\(t_0\\) \u548c\u6b65\u957f \\(h\\) \u8ba1\u7b97\u5e76\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0+h)\\) \uff0c\u6709 3\uff0c4 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)<\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0-h)\\) \uff0c\u6709 5\uff0c6 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)\\ge\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0+(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0+(2^{m-1}-1)^h) \\ge \\varphi(t_0+(2^m-1)^h) < \\varphi(t_0+(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0+(2^{m-1}-1)^h), v=\\varphi(t_0+(2^{m}-1)^h), w=\\varphi(t_0+(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{u,v,r\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{v,r,w\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h) > \\varphi(t_0)\\) \u65f6\uff0c\u53d6 \\(\\{t_0-h,t_0,t_0+h\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h)\\le\\varphi(t_0)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0-(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0-(2^{m-1}-1)^h) \\ge \\varphi(t_0-(2^m-1)^h) < \\varphi(t_0-(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0-(2^{m-1}-1)^h), v=\\varphi(t_0-(2^{m}-1)^h), w=\\varphi(t_0-(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{w,r,v\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{r,v,u\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u6b65\u957f\u7684\u9009\u62e9","title":"\u641c\u7d22\u533a\u95f4\u7684\u786e\u5b9a"},{"location":"mb/optimization-theory/lec2/#_3","text":"\u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u5b83\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \u548c \\(\\varphi^\\prime(t)\\) \u7684\u8868\u8fbe\u5f0f\uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \uff0c\u8981\u6c42 \\(\\varphi^\\prime(a)<0,\\varphi^\\prime(b)>0\\) \u8ba1\u7b97 \\(\\{a,b\\}\\) \u7684\u4e2d\u70b9 \\(c=0.5(a+b)\\) \u82e5 \\(\\varphi^\\prime(c)<0\\) \uff0c\u5219 \\(a=c\\) \uff0c\u8f6c 4\uff1b\u82e5 \\(\\varphi^\\prime(c)=0\\) \uff0c\u5219 \\(t^*=c\\) \uff0c\u8f6c 5\uff1b\u82e5 \\(\\varphi^\\prime(c)>0\\) \uff0c\u5219 \\(b=c\\) \uff0c\u8f6c4 \u82e5 \\(|a-b|<\\varepsilon\\) \uff0c\u5219 \\(t^*=0.5(a+b)\\) \uff0c\u8f6c 5\uff0c\u5426\u5219\u8f6c 2 \u6253\u5370 \\(t^*\\) \uff0c\u505c\u673a","title":"\u5bf9\u5206\u6cd5"},{"location":"mb/optimization-theory/lec2/#newton","text":"\u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u4e00\u9636\u548c\u4e8c\u9636\u5bfc\u6570\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b \u8bbe\u5728\u533a\u95f4 \\([a,b]\\) \u4e2d\u7ecf\u8fc7 \\(k\\) \u6b21\u8fed\u4ee3\u5df2\u6c42\u5230\u65b9\u7a0b \\(\\varphi^\\prime(t)=0\\) \u7684\u4e00\u4e2a\u8fd1\u6839\u4f3c \\(t_k\\) \u3002\u8fc7 \\((t_k,\\varphi^\\prime(t_k))\\) \u4f5c\u66f2\u7ebf \\(y=\\varphi^\\prime(t)\\) \u7684\u5207\u7ebf\uff0c\u5176\u65b9\u7a0b\u662f \\[ y-\\varphi^\\prime(t_k)=\\varphi^{\\prime\\prime}(t_k)(t-t_k) \\] \u7136\u540e\u7528\u8fd9\u6761\u5207\u7ebf\u4e0e\u6a2a\u8f74\u4ea4\u70b9\u7684\u6a2a\u5750\u6807 \\(t_{k+1}\\) \u4f5c\u4e3a\u6839\u7684\u65b0\u7684\u8fd1\u4f3c\uff0c\u4ee4 \\(y=0\\) \u89e3\u51fa \\[ t_{k+1}=t_k-\\varphi^\\prime(t_k)/\\varphi^{\\prime\\prime}(t_k) \\]","title":"Newton \u5207\u7ebf\u6cd5"},{"location":"mb/optimization-theory/lec2/#_4","text":"\u9002\u7528\u4e8e \\([a,b]\\) \u533a\u95f4\u4e0a\u7684\u4efb\u4f55\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6c42\u6781\u5c0f\u70b9\u95ee\u9898 \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a \\(\\varphi(t)\\) \u7684\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u8ba1\u7b97 \\(t_2=a+\\beta(b-a), \\varphi_2=\\varphi(t_2)\\) \u8ba1\u7b97 \\(t_1=a+b-t_2, \\varphi_1=\\varphi(t_1)\\) \u82e5 \\(|t_1-t_2|<\\varepsilon\\) \uff0c\u5219\u6253\u5370 \\(t^\\prime=\\frac{t_1+t_2}{2}\\) \uff0c\u505c\u673a\uff1b\u90fd\u5219\uff0c\u82e5 \\(|t_1-t_2| \\ge \\varepsilon\\) \uff0c\u8f6c 5 \u5224\u522b \\(\\varphi_1 \\le \\varphi_2\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u7f6e \\(b=t_2,t_2=t_1,\\varphi_2=\\varphi_1\\) \uff0c\u7136\u540e\u8f6c 3\uff1b\u5426\u5219\uff0c\u82e5 \\(\\varphi_1>\\varphi_2\\) \uff0c\u5219\u7f6e \\(a=t_1,t_1=t_2,\\varphi_1=\\varphi_2,t_2=a+\\beta(b-a),\\varphi_2=\\varphi(t_2)\\) \uff0c\u7136\u540e\u8f6c4","title":"\u9ec4\u91d1\u5206\u5272\u6cd5"},{"location":"mb/optimization-theory/lec3/","text":"\u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 \u00b6 \u7ea6 2049 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u672c\u7ae0\u5f00\u59cb\u8ba8\u8bba\u591a\u7ef4\u6700\u4f18\u5316\u95ee\u9898\u548c\u65e0\u7ea6\u675f\u6700\u4f18\u5316\u95ee\u9898\uff0c\u5176\u4e00\u822c\u5f62\u5f0f\u4e3a \\[ \\min f(\\mathbf{x}) \\] \u6700\u901f\u4e0b\u964d\u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \u5047\u5b9a\u5df2\u7ecf\u8fed\u4ee3\u4e86 k \u6b21\uff0c\u83b7\u5f97\u4e86\u7b2c k \u4e2a\u8fed\u4ee3\u70b9 \\(\\mathbf{x}_k\\) \uff0c\u4ece \\(\\mathbf{x}_k\\) \u51fa\u53d1\uff0c\u663e\u7136\u5e94\u8be5\u6cbf\u6700\u4fd7\u4e0b\u964d\u65b9\u5411\uff08\u5373\u8d1f\u68af\u5ea6\u65b9\u5411\uff09\u884c\u8fdb\uff0c\u53d6\u641c\u7d22\u65b9\u5411 \\[ \\mathbf{p}_k = - \\nabla f(\\mathbf{x}_k) \\] \u7531\u6b64\u5f97\u5230\u7b2c \\(k+1\\) \u8fed\u4ee3\u70b9 \\(\\mathbf{x}_{k+1}\\) \uff0c\u5373 \\[ \\mathbf{x}_{k+1}=\\mathbf{x}_k - t_k \\nabla f(\\mathbf{x}_k) \\] \u5176\u6b65\u957f\u56e0\u5b50 \\(t_k\\) \u6ee1\u8db3 \\[ f(\\mathbf{x}_k - t_k \\nabla f(\\mathbf{x}_k)) = \\min f(\\mathbf{x}_k - t \\nabla f(\\mathbf{x}_k)) \\] \u603b\u7ed3\u4e0a\u5f0f\uff0c\u5f97\u5230\u6700\u901f\u4e0b\u964d\u6cd5\u7684\u8fed\u4ee3\u516c\u5f0f \\[ \\mathbf{x}_{k+1} = ls(\\mathbf{x}_k, - \\nabla f(\\mathbf{x}_k)) \\] \u7b97\u6cd5 \u5df2\u77e5\uff1a\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})\\) \u53ca\u5176\u68af\u5ea6 \\(\\mathbf{g}(\\mathbf{x})\\) \uff0cH \u7ec8\u6b62\u51c6\u5219\u6240\u9700\u8981\u7684\u7ec8\u6b62\u9650 \\(\\varepsilon_1, \\varepsilon_2\\) \u548c \\(\\varepsilon_3\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u8ba1\u7b97 \\(f_0=f(\\mathbf{x}_0), \\mathbf{g}_0 = \\mathbf{g}(\\mathbf{x}_0)\\) \uff0c\u7f6e \\(k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22\uff1a \\(\\mathbf{x}_{k+1}=ls \\cdot (\\mathbf{x}_k, -\\mathbf{g}_k)\\) \uff1b\u8ba1\u7b97 \\(f_{k+1}=f(\\mathbf{x}_{k+1}), \\mathbf{g}_{k+1}=\\mathbf{g}(\\mathbf{x}_{k+1})\\) \u5224\u522b H \u7ec8\u6b62\u51c6\u5219\u662f\u5426\u6ee1\u8db3\uff1b\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370\u6700\u4f18\u89e3 \\(\\mathbf{x}_{k+1},f_{k+1}\\) \uff0c\u505c\u673a\uff1b\u5426\u5219\uff0c\u7f6e \\(k=k+1\\) \uff0c\u8f6c 2 \u5e94\u7528\u4e8e\u6b63\u5b9a\u4e8c\u6b21\u51fd\u6570 \\(f(\\mathbf{x})=\\frac{1}{2} \\mathbf{x}^\\top \\mathbf{Q} \\mathbf{x} + \\mathbf{b}^\\top \\mathbf{x} + c\\) \u8bbe\u7b2c \\(k\\) \u6b21\u7684\u8fed\u4ee3\u70b9\u4e3a \\(\\mathbf{x}_k\\) \uff0c\u6c42 \\(\\mathbf{x}_{k+1}\\) \u7684\u8868\u8fbe\u5f0f \\[ \\mathbf{x}_{k+1} = \\mathbf{x}_k - \\frac{\\mathbf{g}_k^\\top \\mathbf{g}_k}{\\mathbf{g}_k^\\top \\mathbf{Q} \\mathbf{g}_k} \\mathbf{g}_k \\] Newton \u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \u8003\u8651\u4ece \\(\\mathbf{x}_k\\) \u5230 \\(\\mathbf{x}_{k+1}\\) \u7684\u8fed\u4ee3\u8fc7\u7a0b\u3002\u5728 \\(\\mathbf{x}_k\\) \u70b9\u5904\u5bf9 \\(f(\\mathbf{x})\\) \u7528\u4e0e\u5b83\u6700\u5bc6\u5207\u7684\u4e8c\u6b21\u51fd\u6570\u6765\u8fd1\u4f3c\uff0c\u8fd9\u53ea\u987b\u628a \\(f(\\mathbf{x}\\) \u6309 Taylor \u5c55\u5f00\uff0c\u76f4\u5230\u7b2c\u4e09\u9879\uff0c\u5373 \\[ f(\\mathbf{x}) \\approx Q(\\mathbf{x}) = f(\\mathbf{x}_k) + \\mathbf{g}(\\mathbf{x}_k)^\\top (\\mathbf{x} - \\mathbf{x}_k)+\\frac{1}{2}(\\mathbf{x}-\\mathbf{x}_k)^\\top \\mathbf{G}(\\mathbf{x}_k)(\\mathbf{x}-\\mathbf{x}_k) \\] \u4ee4 \\(\\nabla Q(\\mathbf{x})=\\mathbf{G}(\\mathbf{x}_k)(\\mathbf{x}-\\mathbf{x}_k)+\\mathbf{g}(\\mathbf{x}_k)=0\\) \uff0c\u5f97 \\[ \\mathbf{x}_{k+1} = \\mathbf{x}_k - \\mathbf{G}(\\mathbf{x}_k)^{-1}\\mathbf{g}(\\mathbf{x}_k) \\] \u7b97\u6cd5 \u5df2\u77e5\uff1a\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})\\) \u53ca\u5176\u68af\u5ea6 \\(\\mathbf{g}(\\mathbf{x})\\) \uff0cHesse \u77e9\u9635 \\(\\mathbf{G}(\\mathbf{x})\\) \uff0cH \u7ec8\u6b62\u51c6\u5219\u6240\u9700\u8981\u7684\u7ec8\u6b62\u9650 \\(\\varepsilon_1, \\varepsilon_2\\) \u548c \\(\\varepsilon_3\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff1b\u8ba1\u7b97 \\(f_0 = f(\\mathbf{x}_0), \\mathbf{g}_0=\\mathbf{g}(\\mathbf{x}_0)\\) \uff1b\u7f6e \\(k=0\\) \u8ba1\u7b97 \\(\\mathbf{G}_k=\\mathbf{G}(\\mathbf{x}_k)\\) \u7531\u65b9\u7a0b \\(\\mathbf{G}_k \\mathbf{p}=-\\mathbf{g}_k\\) \u89e3\u51fa \\(\\mathbf{p}_k\\) \u8ba1\u7b97 \\(\\mathbf{x}_{k+1}=\\mathbf{x}_k + \\mathbf{p}_k\\) \uff0c \\(f_{k+1}=f(\\mathbf{x}_{k+1})\\) \uff0c \\(\\mathbf{g}_{k+1}=\\mathbf{g}(\\mathbf{x}_{k+1})\\) \u5224\u522b H \u7ec8\u6b62\u51c6\u5219\u662f\u5426\u6ee1\u8db3\uff1b\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370\u6700\u4f18\u89e3 \\(\\mathbf{x}_{k+1},f_{k+1}\\) \uff0c\u505c\u673a\uff1b\u5426\u5219\uff0c\u7f6e \\(k=k+1\\) \uff0c\u8f6c 2 \u5171\u8f6d\u65b9\u5411\u6cd5\u4e0e\u5171\u8f6d\u68af\u5ea6\u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \u9996\u5148\u8003\u8651\u4e8c\u7ef4\u7684\u60c5\u51b5\uff0c\u628a\u4e0b\u964d\u6cd5\u7528\u4e8e\u4e8c\u5143\u4e8c\u6b21\u51fd\u6570\uff0c\u4efb\u9009\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u6cbf\u67d0\u4e2a\u4e0b\u964d\u65b9\u5411\uff0c\u4f8b\u5982\u5411\u91cf \\(\\mathbf{p}_0\\) \u7684\u65b9\u5411\uff0c\u4f5c\u76f4\u7ebf\u641c\u7d22\u5f97\u5230 \\(\\mathbf{x}_1\\) \uff1a \\(\\nabla f(\\mathbf{x}_1)^\\top \\mathbf{p}_0=0\\) \u5c06\u4e0b\u4e00\u6b21\u8fed\u4ee3\u7684\u641c\u7d22\u65b9\u5411\u6307\u5411\u6781\u5c0f\u70b9 \\(\\mathbf{x}^*\\) \uff0c\u63a8\u5bfc\u5f97\u5230 \\(\\mathbf{p}_0^\\top \\mathbf{Q} \\mathbf{p}_1 = 0\\) \uff0c\uff0c\u8fd9\u91cc\u7684 \\(\\mathbf{p}_0\\) \u548c \\(\\mathbf{p}_1\\) \u79f0\u4e3a \\(\\mathbf{Q}\\) \u5171\u8f6d\u5411\u91cf\uff0c\u6216\u79f0 \\(\\mathbf{p}_0\\) \u548c \\(\\mathbf{p}_1\\) \u7684\u65b9\u5411\u662f\u5171\u8f6d\u65b9\u5411 \\[ \\mathbf{p}_1 = - \\nabla f(\\mathbf{x}_1) + \\frac{\\mathbf{p}_0^\\top \\mathbf{Q} \\nabla f(\\mathbf{x}_1)}{\\mathbf{p}_0^\\top \\mathbf{Q} \\mathbf{p}_0} \\mathbf{p}_0 \\] \u5411\u91cf\u7684\u5171\u8f6d\u53ca\u5176\u6027\u8d28 \u82e5\u975e\u96f6\u5411\u91cf\u7cfb \\(\\mathbf{p}_0, \\mathbf{p}_1, ..., \\mathbf{p}_{m+1}\\) \u662f \\(\\mathbf{Q}\\) \u5171\u8f6d\u7684\uff0c\u5219\u8fd9 m \u4e2a\u5411\u91cf\u7ebf\u6027\u65e0\u5173 \u5728 n \u7ef4\u7a7a\u95f4\u4e2d\uff0c\u4e92\u76f8\u5171\u8f6d\u7684\u975e\u96f6\u5411\u91cf\u7684\u5411\u91cf\u4e2a\u6570\u4e0d\u8d85\u8fc7 n \u5171\u8f6d\u65b9\u5411\u6cd5 \u5df2\u77e5\uff1a\u5177\u6709\u6b63\u5b9a\u77e9\u9635 \\(\\mathbf{Q}\\) \u7684\u4e8c\u6b21\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})=\\frac{1}{2} \\mathbf{x}^\\top \\mathbf{Q} \\mathbf{x} + \\mathbf{b}^\\top \\mathbf{x}+c\\) \u548c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \u548c\u5177\u6709\u4e0b\u964d\u65b9\u5411\u7684\u5411\u91cf \\(\\mathbf{p}_0\\) \uff1b\u7f6e \\(k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22 \\(\\mathbf{x}_{k+1}=ls(\\mathbf{x}_k. \\mathbf{p}_k)\\) \u5224\u522b \\(\\parallel \\nabla f(\\mathbf{x}_{k+1}) \\parallel < \\varepsilon\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370 \\(\\mathbf{x}_{k+1}\\) \uff0c\u505c\u673a\uff0c\u5426\u5219\u8f6c 4 \u63d0\u4f9b\u5171\u8f6d\u65b9\u5411 \\(\\mathbf{p}_{k+1}\\) \u4f7f\u5f97 \\(\\mathbf{p}_j^\\top \\mathbf{Q} \\mathbf{p}_{k+1} = 0, \\ \\ \\ j=0,1,...,k\\) \\(k = k + 1\\) \uff0c\u8f6c 2 \u5171\u8f6d\u68af\u5ea6\u6cd5 \u5df2\u77e5\uff1a\u5177\u6709\u4e8c\u6b21\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})=\\frac{1}{2} \\mathbf{x}^\\top \\mathbf{Q} \\mathbf{x} + \\mathbf{b}^\\top \\mathbf{x}+c\\) \u548c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u8ba1\u7b97 \\(\\mathbf{p}_0 = -\\nabla f(\\mathbf{x}_0)\\) \uff0c\u7f6e \\(k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22 \\(\\mathbf{x}_{k+1}=ls(\\mathbf{x}_k,\\mathbf{p}_k)\\) \uff0c\u6216\u91c7\u53d6\u8ba1\u7b97\u516c\u5f0f \\(t_k=\\frac{\\nabla f(\\mathbf{x}_k)^\\top \\nabla f(\\mathbf{x}_k)}{\\mathbf{p}_k^\\top \\mathbf{Q} \\mathbf{p}_k}\\) \uff0c \\(\\mathbf{x}_{k+1}=\\mathbf{x}_k + t_k\\mathbf{p}_k\\) \u5224\u522b \\(\\parallel \\nabla f(\\mathbf{x}_{k+1}) \\parallel < \\varepsilon\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370 \\(\\mathbf{x}_{k+1}\\) \uff0c\u505c\u673a\uff0c\u5426\u5219\u8f6c 4 \u8ba1\u7b97 \\(\\alpha_k = \\frac{\\nabla f(\\mathbf{x}_{k+1}^\\top \\mathbf{Q} \\mathbf{p}_k)}{\\mathbf{p}_k^\\top \\mathbf{Q} \\mathbf{p}_k}\\) \uff0c \\(\\mathbf{p}_{k+1}=-\\nabla f(\\mathbf{x}_{k+1})+\\alpha_k \\mathbf{p}_k\\) \\(k=k+1\\) \uff0c\u8f6c 2 \u53d8\u5c3a\u5ea6\u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \uff1a\u7565 DFP \u7b97\u6cd5 \u5df2\u77e5\uff1a\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})\\) \u53ca\u5176\u68af\u5ea6 \\(\\mathbf{g}(\\mathbf{x_0})\\) \uff0c\u95ee\u9898\u7684\u7ef4\u5ea6 n\uff0cH \u7ec8\u6b62\u51c6\u5219\u4e2d\u7684\u7ec8\u6b62\u9650 \\(\\varepsilon_1, \\varepsilon_2\\) \u548c \\(\\varepsilon_3\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u8ba1\u7b97 \\(f_0=f(\\mathbf{x}_0),\\mathbf{g}_0=\\mathbf{g}(\\mathbf{x}_0)\\) \u7f6e \\(\\mathbf{H}_0=\\mathbf{I},\\mathbf{p}_0=-\\mathbf{g}_0,k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22 \\(\\mathbf{x}_{k+1}=ls(\\mathbf{x}_k, \\mathbf{p}_k)\\) \uff0c\u8ba1\u7b97 \\(f_{k+1}=f(\\mathbf{x}_{k+1}),\\mathbf{g}_{k+1}=\\mathbf{g}(\\mathbf{x}_{k+1})\\) \u5224\u522b H \u7ec8\u6b62\u51c6\u5219\u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370 \\(\\mathbf{x}_{k+1},f_{k+1}\\) \uff0c\u505c\u673a\uff1b\u5426\u5219\uff0c\u8f6c 5 \u82e5 \\(k=n\\) \uff0c\u5219\u7f6e \\(\\mathbf{x}_0 = \\mathbf{x}_{k+1}, f_0=f_{k+1}, \\mathbf{g}_0 = \\mathbf{g}_{k+1}\\) \uff0c\u8f6c 2\uff1b\u5426\u5219\u8f6c 6 \u8ba1\u7b97 \\(\\mathbf{y}_k=\\mathbf{g}_{k+1}-\\mathbf{g}_k, \\mathbf{s}_k = \\mathbf{x}_{k+1}-\\mathbf{x}_k, \\mathbf{H}_{k+1}=\\mathbf{H}_k+\\frac{\\mathbf{s}_k\\mathbf{s}_k^\\top}{\\mathbf{s}_k^\\top \\mathbf{y}_k} - \\frac{\\mathbf{H}_k \\mathbf{y}_k \\mathbf{y}_k^\\top \\mathbf{H}_k}{\\mathbf{y}_k^\\top \\mathbf{H}_k \\mathbf{y}_k},\\mathbf{p}_{k+1}=-\\mathbf{H}_{k+1}\\mathbf{g}_{k+1}\\) \uff0c\u7f6e \\(k=k+1\\) \uff0c\u8f6c 3 \u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3\u6cd5 \u00b6 \u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898 \u00b6 \u5f53 \\(f(\\mathbf{x})\\) \u53d6\u7ebf\u6027\u51fd\u6570\u5f62\u5f0f\u65f6\uff0c\u5373 \\(f(\\mathbf{x})=A \\mathbf{x} - \\mathbf{b}\\) \uff0c\u5176\u4e2d A \u662f \\(m \\times n\\) \u77e9\u9635\uff0cb \u662f m \u7ef4\u5411\u91cf\uff0c\u6b64\u65f6\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u5373 \\[ \\min \\parallel A \\mathbf{x} - \\mathbf{b} \\parallel^2 \\] \\(\\mathbf{x}^*\\) \u7684\u6781\u5c0f\u70b9\u5f53\u4e14\u4ec5\u5f53 \\(\\mathbf{x}^*\\) \u6ee1\u8db3\u65b9\u7a0b \\(A^\\top A \\mathbf{x}=A^\\top \\mathbf{b}\\) \u8bbe A \u662f \\(m \\times n\\) \u77e9\u9635 \\((m \\ge n)\\) \uff0c\u5219 \\(A^\\top A\\) \u6b63\u5b9a\u7684\u5145\u8981\u6761\u4ef6\u662f A \u7684\u79e9\u4e3a n \u5f53 A \u7684\u79e9\u4e3a n \u65f6\uff0c\u5219 \\(\\mathbf{x}=(A^\\top A)^{-1} A^\\top \\mathbf{b}\\) \u662f\u552f\u4e00\u6700\u5c0f\u4e8c\u4e58\u89e3 \u8bbe A \u662f \\(m \\times n\\) \u77e9\u9635 \\((m \\ge n)\\) \uff0c\u5219 \\(A^\\top A\\) \u6b63\u5b9a\u7684\u5145\u8981\u6761\u4ef6\u662f \\(A^\\top A\\) \u4e3a\u975e\u5947\u5f02 Gauss-Newton \u6cd5 \u00b6 \u8ba8\u8bba\u4ee5 \\(s(\\mathbf{x})=f(\\mathbf{x})^\\top f(\\mathbf{x})=\\parallel f(\\mathbf{x}) \\parallel^2\\) \u4e3a\u76ee\u6807\u51fd\u6570\u7684\u975e\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3\u6cd5 \u628a \\(f(\\mathbf{x})\\) \u7ebf\u6027\u5316\uff0c\u7528\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3\u53bb\u903c\u8fd1\u975e\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3 \u7b97\u6cd5\u6d41\u7a0b \u5df2\u77e5\uff1a \\(f(\\mathbf{x})=[f_1(\\mathbf{x}), ..., f_m(\\mathbf{x})]^\\top\\) \u53ca\u5176 Jacobi \u77e9\u9635 \\(A(\\mathbf{x})=[\\frac{\\partial f_i(\\mathbf{x})}{\\partial x_j}]\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff1b\u8ba1\u7b97 \\(s_0=\\sum_{i=1}^m f_i^m (\\mathbf{x}_0)\\) \uff1b\u7f6e \\(k=0\\) \u5bf9 \\(i=1,...,m\\) \u548c \\(j=1,...,n\\) \u8ba1\u7b97 \\(a_{ij}^{(k)}=\\frac{\\partial f_i(\\mathbf{x}_k)}{\\partial x_j}\\) \u3002\u7531\u6b64\u6784\u6210\u77e9\u9635 \\(A_k\\) \uff0c\u5b83\u7684\u7b2c i \u884c\u548c\u7b2c j \u5217\u5206\u91cf\u662f \\(a_{ij}^{(k)}\\) \uff0c\u5bf9 \\(j=1,...,n\\) \u8ba1\u7b97 \\(g_j^{(k)}=\\sum_{i=1}^m f_i(\\mathbf{x}_k) \\frac{\\partial f_i(\\mathbf{x_k})}{\\partial x_j}\\) \u3002\u7531\u6b64\u6784\u6210\u5411\u91cf \\(\\mathbf{g}_k\\) \uff0c\u5b83\u7684\u7b2c j \u4e2a\u5206\u91cf\u662f \\(g_j^{(k)}\\) \u7531\u65b9\u7a0b\u7ec4 \\(A_k^\\top A_k \\mathbf{p}=-\\mathbf{g}_k\\) \u89e3\u51fa \\(\\mathbf{p}\\) \uff0c\u8bbe\u4e3a \\(\\mathbf{p}_k\\) \u3002\u5728\u6c42\u89e3\u8fc7\u7a0b\u4e2d\uff0c\u4ec5\u5f53 \\(r(A_k^\\top A_k)=n\\) \u65f6\u624d\u80fd\u89e3\u5f97\u51fa \\(\\mathbf{p}_k\\) \u82e5\u5728\u6c42\u89e3\u8fc7\u7a0b\u4e2d\u53d1\u73b0 \\(r(A_k^\\top A_k) 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u5de5\u5177\u76f8\u5173"},{"location":"utils/#_1","text":"Abstract \u4e00\u4e9b\u5de5\u5177\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u5305\u62ec\u547d\u4ee4\u884c\u76f8\u5173\u7684\u547d\u4ee4\u7b49\u7b49","title":"\u5de5\u5177\u76f8\u5173"},{"location":"utils/#table-of-contents","text":"\u547d\u4ee4\u884c\u5de5\u5177 Shell \u76f8\u5173\u547d\u4ee4 159 2 1 mins 1693553563 Docker \u76f8\u5173\u547d\u4ee4 674 16 2 mins 1693553563 Git \u76f8\u5173\u547d\u4ee4 328 13 1 mins 1693405725 gdb \u76f8\u5173\u547d\u4ee4 754 3 3 mins 1693405725 CI \u5de5\u5177 Github Action\uff08**TODO**\uff09 0 0 mins 1693404987 \u7ad9\u70b9\u751f\u6210\u5de5\u5177 gitbook 49 12 0 mins 1694949283 reveal-md 761 21 3 mins 1694335736 mkdocs\uff08**TODO**\uff09 0 0 mins 1693404987 hexo\uff08**TODO**\uff09 0 0 mins 1693404987 \u89c6\u9891\u56fe\u50cf\u5904\u7406\u5de5\u5177 ffmpeg 33 10 0 mins 1727424112 ImageMagick\uff08**TODO**\uff09 0 0 mins 1727424112 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"utils/action/","text":"","title":"Github Action"},{"location":"utils/docker/","text":"Docker \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 670 \u4e2a\u5b57 16 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684Docker\u547d\u4ee4\u3001Dockerfile\u7b49 \u5b89\u88c5 \u00b6 curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun sudo curl -L \"https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose \u547d\u4ee4 \u00b6 \u5e2e\u52a9 \u00b6 docker version # \u663e\u793aDocker\u7248\u672c\u4fe1\u606f docker info # \u663e\u793aDocker\u7cfb\u7edf\u4fe1\u606f\uff0c\u5305\u62ec\u955c\u50cf\u6570\u3001\u5bb9\u5668\u6570\u3001\u6b63\u5728\u8fd0\u884c\u7684\u955c\u50cf\u6570\u3001\u6682\u505c\u7684\u955c\u50cf\u6570\u3001\u505c\u6b62\u7684\u955c\u50cf\u6570\u7b49 docker --help # \u663e\u793adocker\u6307\u4ee4\u7684\u4fe1\u606f docker \u6307\u4ee4 --help # \u663e\u793a\u5177\u4f53\u67d0\u4e00\u4e2adocker\u6307\u4ee4\u7684\u53ef\u9009\u9879 \u955c\u50cf\u76f8\u5173 \u00b6 docker images \u5217\u51fa\u672c\u5730\u955c\u50cf -a \u5217\u51fa\u672c\u5730\u6240\u6709\u955c\u50cf -q \u53ea\u5217\u51fa\u955c\u50cfID --digests \u663e\u793a\u666f\u8c61\u7684\u6458\u8981\u4fe1\u606f docker search \u641c\u7d22\u955c\u50cf docker pull \u62c9\u53d6\u955c\u50cf docker rmi \u5220\u9664\u955c\u50cf docker build -t . \u4ece Dockerfile \u6784\u5efa\u955c\u50cf\uff0c\u5e76\u6253\u4e0a tag docker export > .tar \u4fdd\u5b58\u955c\u50cf\u4e3a tar \u5305 docker import .tar \u4ece tar \u5305\u5bfc\u5165\u955c\u50cf docker tag : \u7ed9\u955c\u50cf\u6253 tag\uff08\u91cd\u547d\u540d\uff09 \u5bb9\u5668\u76f8\u5173 \u00b6 docker ps -a \u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668 docker run \u8fd0\u884c\u955c\u50cf -i \u4ea4\u4e92\u6a21\u5f0f -t \u5206\u914d\u865a\u62df\u7ec8\u7aef -d \u540e\u53f0\u8fd0\u884c -p : \u7aef\u53e3\u6620\u5c04 -v : \u76ee\u5f55\u6620\u5c04 -e = \u73af\u5883\u53d8\u91cf --name \u5bb9\u5668\u540d --rm \u8fd0\u884c\u5b8c\u540e\u81ea\u52a8\u5220\u9664\u5bb9\u5668 --network \u6307\u5b9a\u7f51\u7edc docker start \u542f\u52a8\u5bb9\u5668 docker restart \u91cd\u542f\u5bb9\u5668 docker stop \u505c\u6b62\u5bb9\u5668 docker rm \u5220\u9664\u5bb9\u5668 docker exec -it /bin/bash \u8fdb\u5165\u5bb9\u5668\uff08\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker attach \u8fdb\u5165\u5bb9\u5668\uff08\u4e0d\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker cp ... ... \u5728\u672c\u5730\u548c\u5bb9\u5668\u4e4b\u95f4\u590d\u5236\u6587\u4ef6\uff08\u7528\u6cd5\u7c7b\u4f3c scp\uff09 docker logs \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7 -t \u663e\u793a\u65f6\u95f4\u6233 -f \u6253\u5370\u6700\u65b0\u7684\u65e5\u5fd7 -tail number \u663e\u793anumber\u6761 docker top \u67e5\u770b\u5bb9\u5668\u4e2d\u8fd0\u884c\u7684\u8fdb\u7a0b\u4fe1\u606f docker inspect \u67e5\u770b\u5bb9\u5668/\u955c\u50cf\u7684\u5143\u6570\u636e exit \u5bb9\u5668\u505c\u6b62\u5e76\u9000\u51fa Ctrl+P+Q \u5bb9\u5668\u4e0d\u505c\u6b62\u9000\u51fa \u7f51\u7edc\u76f8\u5173 \u00b6 docker network ls \u5217\u51fa\u7f51\u7edc docker network create \u521b\u5efa\u7f51\u7edc docker network connect \u5c06\u5bb9\u5668\u8fde\u63a5\u5230\u7f51\u7edc docker network inspect \u67e5\u770b\u7f51\u7edc\u4fe1\u606f docker network rm \u5220\u9664\u7f51\u7edc \u4ed3\u5e93\u76f8\u5173 \u00b6 docker login \u8fde\u63a5 registry docker login \u8fde\u63a5\u5230 Docker Hub docker login ghcr.io \u8fde\u63a5\u5230 GitHub \u7684\u4ed3\u5e93\uff0c\u7528\u6237\u540d\u662f GitHub \u7528\u6237\u540d\uff0c\u5bc6\u7801\u662f GitHub \u751f\u6210\u7684 token\uff08ghp_ \u5f00\u5934\uff09 docker logout \u65ad\u5f00 registry docker push \u63a8\u9001\u955c\u50cf\u5230 registry\uff08\u4f1a\u6839\u636e\u524d\u7f00\u81ea\u52a8\u9009\u62e9 registry\uff09 docker pull \u4ece registry \u62c9\u53d6\u955c\u50cf registry \u955c\u50cf \u00b6 \u53ef\u4ee5\u5229\u7528 registry \u955c\u50cf\u6765\u81ea\u5efa\u79c1\u6709 registry docker pull registry:2 \u62c9\u53d6 registry \u955c\u50cf \u9700\u8981\u6302\u8f7d\u7684\u76ee\u5f55 ./auth:/auth \uff1a\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5728\u672c\u5730 auth \u76ee\u5f55\u4e0b\u6267\u884c docker run --entrypoint htpasswd registry:2.7.0 -Bbn > htpasswd \u751f\u6210\u6587\u4ef6 ./certs:/certs \uff1aSSL \u8bc1\u4e66\uff0c\u53ef\u4ee5\u7528 acme.sh \u6765\u7b7e ./registry:/var/lib/registry \uff1aregistry \u6570\u636e \u542f\u52a8 registry\uff1a docker run -itd -p 5000 :5000 --restart = always --name registry \\ -v ./certs:/certs \\ -v ./auth:/auth \\ -v ./registry:/var/lib/registry \\ -e \"REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain.cer\" \\ -e \"REGISTRY_HTTP_TLS_KEY=/certs/.key\" \\ -e \"REGISTRY_AUTH=htpasswd\" -e \"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm\" \\ -e \"REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd\" \\ registry:2 docker login \u767b\u5f55 registry docker tag / \u7ed9\u955c\u50cf\u6253\u4e0a registry \u7684 tag docker push / \u63a8\u9001\u955c\u50cf\u5230 registry Dockerfile \u00b6 \u5e38\u7528\u6362\u6e90 \u00b6 Ubuntu \u8f6f\u4ef6\u6e90 \u00b6 RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list # RUN sed -i s@/archive.ubuntu.com/@/<...>/@g /etc/apt/sources.list RUN apt-get clean RUN apt-get update Debian \u8f6f\u4ef6\u6e90 \u00b6 RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list && \\ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN apt-get update Reference \u00b6 Docker\u547d\u4ee4\u5907\u5fd8","title":"Docker \u547d\u4ee4\u76f8\u5173"},{"location":"utils/docker/#docker","text":"\u7ea6 670 \u4e2a\u5b57 16 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684Docker\u547d\u4ee4\u3001Dockerfile\u7b49","title":"Docker \u547d\u4ee4\u76f8\u5173"},{"location":"utils/docker/#_1","text":"curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun sudo curl -L \"https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose","title":"\u5b89\u88c5"},{"location":"utils/docker/#_2","text":"","title":"\u547d\u4ee4"},{"location":"utils/docker/#_3","text":"docker version # \u663e\u793aDocker\u7248\u672c\u4fe1\u606f docker info # \u663e\u793aDocker\u7cfb\u7edf\u4fe1\u606f\uff0c\u5305\u62ec\u955c\u50cf\u6570\u3001\u5bb9\u5668\u6570\u3001\u6b63\u5728\u8fd0\u884c\u7684\u955c\u50cf\u6570\u3001\u6682\u505c\u7684\u955c\u50cf\u6570\u3001\u505c\u6b62\u7684\u955c\u50cf\u6570\u7b49 docker --help # \u663e\u793adocker\u6307\u4ee4\u7684\u4fe1\u606f docker \u6307\u4ee4 --help # \u663e\u793a\u5177\u4f53\u67d0\u4e00\u4e2adocker\u6307\u4ee4\u7684\u53ef\u9009\u9879","title":"\u5e2e\u52a9"},{"location":"utils/docker/#_4","text":"docker images \u5217\u51fa\u672c\u5730\u955c\u50cf -a \u5217\u51fa\u672c\u5730\u6240\u6709\u955c\u50cf -q \u53ea\u5217\u51fa\u955c\u50cfID --digests \u663e\u793a\u666f\u8c61\u7684\u6458\u8981\u4fe1\u606f docker search \u641c\u7d22\u955c\u50cf docker pull \u62c9\u53d6\u955c\u50cf docker rmi \u5220\u9664\u955c\u50cf docker build -t . \u4ece Dockerfile \u6784\u5efa\u955c\u50cf\uff0c\u5e76\u6253\u4e0a tag docker export > .tar \u4fdd\u5b58\u955c\u50cf\u4e3a tar \u5305 docker import .tar \u4ece tar \u5305\u5bfc\u5165\u955c\u50cf docker tag : \u7ed9\u955c\u50cf\u6253 tag\uff08\u91cd\u547d\u540d\uff09","title":"\u955c\u50cf\u76f8\u5173"},{"location":"utils/docker/#_5","text":"docker ps -a \u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668 docker run \u8fd0\u884c\u955c\u50cf -i \u4ea4\u4e92\u6a21\u5f0f -t \u5206\u914d\u865a\u62df\u7ec8\u7aef -d \u540e\u53f0\u8fd0\u884c -p : \u7aef\u53e3\u6620\u5c04 -v : \u76ee\u5f55\u6620\u5c04 -e = \u73af\u5883\u53d8\u91cf --name \u5bb9\u5668\u540d --rm \u8fd0\u884c\u5b8c\u540e\u81ea\u52a8\u5220\u9664\u5bb9\u5668 --network \u6307\u5b9a\u7f51\u7edc docker start \u542f\u52a8\u5bb9\u5668 docker restart \u91cd\u542f\u5bb9\u5668 docker stop \u505c\u6b62\u5bb9\u5668 docker rm \u5220\u9664\u5bb9\u5668 docker exec -it /bin/bash \u8fdb\u5165\u5bb9\u5668\uff08\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker attach \u8fdb\u5165\u5bb9\u5668\uff08\u4e0d\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker cp ... ... \u5728\u672c\u5730\u548c\u5bb9\u5668\u4e4b\u95f4\u590d\u5236\u6587\u4ef6\uff08\u7528\u6cd5\u7c7b\u4f3c scp\uff09 docker logs \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7 -t \u663e\u793a\u65f6\u95f4\u6233 -f \u6253\u5370\u6700\u65b0\u7684\u65e5\u5fd7 -tail number \u663e\u793anumber\u6761 docker top \u67e5\u770b\u5bb9\u5668\u4e2d\u8fd0\u884c\u7684\u8fdb\u7a0b\u4fe1\u606f docker inspect \u67e5\u770b\u5bb9\u5668/\u955c\u50cf\u7684\u5143\u6570\u636e exit \u5bb9\u5668\u505c\u6b62\u5e76\u9000\u51fa Ctrl+P+Q \u5bb9\u5668\u4e0d\u505c\u6b62\u9000\u51fa","title":"\u5bb9\u5668\u76f8\u5173"},{"location":"utils/docker/#_6","text":"docker network ls \u5217\u51fa\u7f51\u7edc docker network create \u521b\u5efa\u7f51\u7edc docker network connect \u5c06\u5bb9\u5668\u8fde\u63a5\u5230\u7f51\u7edc docker network inspect \u67e5\u770b\u7f51\u7edc\u4fe1\u606f docker network rm \u5220\u9664\u7f51\u7edc","title":"\u7f51\u7edc\u76f8\u5173"},{"location":"utils/docker/#_7","text":"docker login \u8fde\u63a5 registry docker login \u8fde\u63a5\u5230 Docker Hub docker login ghcr.io \u8fde\u63a5\u5230 GitHub \u7684\u4ed3\u5e93\uff0c\u7528\u6237\u540d\u662f GitHub \u7528\u6237\u540d\uff0c\u5bc6\u7801\u662f GitHub \u751f\u6210\u7684 token\uff08ghp_ \u5f00\u5934\uff09 docker logout \u65ad\u5f00 registry docker push \u63a8\u9001\u955c\u50cf\u5230 registry\uff08\u4f1a\u6839\u636e\u524d\u7f00\u81ea\u52a8\u9009\u62e9 registry\uff09 docker pull \u4ece registry \u62c9\u53d6\u955c\u50cf","title":"\u4ed3\u5e93\u76f8\u5173"},{"location":"utils/docker/#registry","text":"\u53ef\u4ee5\u5229\u7528 registry \u955c\u50cf\u6765\u81ea\u5efa\u79c1\u6709 registry docker pull registry:2 \u62c9\u53d6 registry \u955c\u50cf \u9700\u8981\u6302\u8f7d\u7684\u76ee\u5f55 ./auth:/auth \uff1a\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5728\u672c\u5730 auth \u76ee\u5f55\u4e0b\u6267\u884c docker run --entrypoint htpasswd registry:2.7.0 -Bbn > htpasswd \u751f\u6210\u6587\u4ef6 ./certs:/certs \uff1aSSL \u8bc1\u4e66\uff0c\u53ef\u4ee5\u7528 acme.sh \u6765\u7b7e ./registry:/var/lib/registry \uff1aregistry \u6570\u636e \u542f\u52a8 registry\uff1a docker run -itd -p 5000 :5000 --restart = always --name registry \\ -v ./certs:/certs \\ -v ./auth:/auth \\ -v ./registry:/var/lib/registry \\ -e \"REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain.cer\" \\ -e \"REGISTRY_HTTP_TLS_KEY=/certs/.key\" \\ -e \"REGISTRY_AUTH=htpasswd\" -e \"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm\" \\ -e \"REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd\" \\ registry:2 docker login \u767b\u5f55 registry docker tag / \u7ed9\u955c\u50cf\u6253\u4e0a registry \u7684 tag docker push / \u63a8\u9001\u955c\u50cf\u5230 registry","title":"registry \u955c\u50cf"},{"location":"utils/docker/#dockerfile","text":"","title":"Dockerfile"},{"location":"utils/docker/#_8","text":"","title":"\u5e38\u7528\u6362\u6e90"},{"location":"utils/docker/#ubuntu","text":"RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list # RUN sed -i s@/archive.ubuntu.com/@/<...>/@g /etc/apt/sources.list RUN apt-get clean RUN apt-get update","title":"Ubuntu \u8f6f\u4ef6\u6e90"},{"location":"utils/docker/#debian","text":"RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list && \\ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN apt-get update","title":"Debian \u8f6f\u4ef6\u6e90"},{"location":"utils/docker/#reference","text":"Docker\u547d\u4ee4\u5907\u5fd8","title":"Reference"},{"location":"utils/ffmpeg/","text":"ffmpeg \u00b6 \u7ea6 29 \u4e2a\u5b57 10 \u884c\u4ee3\u7801 Abstract ffmpeg \u76f8\u5173 Installation \u00b6 Download Source Code wget https://www.ffmpeg.org/releases/ffmpeg-7.0.tar.gz tar -zxvf ffmpeg-7.0.tar.gz Compile cd ffmpeg-7.0 ./configure --prefix = /usr/local/ffmpeg --enable-openssl --disable-x86asm make && make install Add to PATH vim ~/.bashrc export PATH = $PATH :/usr/local/ffmpeg/bin source ~/.bashrc Check ffmpeg -version Usage \u00b6 \u89c6\u9891\u8f6c\u56fe\u7247 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg ... Reference \u00b6 FFmpeg\u6559\u7a0b\uff08\u8d85\u7ea7\u8be6\u7ec6\u7248\uff09","title":"ffmpeg"},{"location":"utils/ffmpeg/#ffmpeg","text":"\u7ea6 29 \u4e2a\u5b57 10 \u884c\u4ee3\u7801 Abstract ffmpeg \u76f8\u5173","title":"ffmpeg"},{"location":"utils/ffmpeg/#installation","text":"Download Source Code wget https://www.ffmpeg.org/releases/ffmpeg-7.0.tar.gz tar -zxvf ffmpeg-7.0.tar.gz Compile cd ffmpeg-7.0 ./configure --prefix = /usr/local/ffmpeg --enable-openssl --disable-x86asm make && make install Add to PATH vim ~/.bashrc export PATH = $PATH :/usr/local/ffmpeg/bin source ~/.bashrc Check ffmpeg -version","title":"Installation"},{"location":"utils/ffmpeg/#usage","text":"\u89c6\u9891\u8f6c\u56fe\u7247 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg ...","title":"Usage"},{"location":"utils/ffmpeg/#reference","text":"FFmpeg\u6559\u7a0b\uff08\u8d85\u7ea7\u8be6\u7ec6\u7248\uff09","title":"Reference"},{"location":"utils/gdb/","text":"gdb \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 750 \u4e2a\u5b57 3 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract gdb\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\uff0c\u63d2\u4ef6\u7b49 \u524d\u8a00 \u00b6 \u4ec0\u4e48\u662fgdb \u00b6 GNU\u8c03\u8bd5\u5668\uff08\u82f1\u8bed\uff1aGNU Debugger\uff0c\u7f29\u5199\uff1aGDB\uff09\uff0c\u662fGNU\u8f6f\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6807\u51c6\u8c03\u8bd5\u5668\uff0c\u6b64\u5916GDB\u4e5f\u662f\u4e2a\u5177\u6709\u79fb\u643a\u6027\u7684\u8c03\u8bd5\u5668\uff0c\u7ecf\u8fc7\u79fb\u643a\u9700\u6c42\u7684\u8c03\u4fee\u4e0e\u91cd\u65b0\u7f16\u8bd1\uff0c\u5982\u4eca\u8bb8\u591a\u7684\u7c7bUNIX\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u53ef\u4ee5\u4f7f\u7528GDB\uff0c\u800c\u73b0\u6709GDB\u6240\u80fd\u652f\u6301\u8c03\u8bd5\u7684\u7f16\u7a0b\u8bed\u8a00\u6709C\u3001C++\u3001Pascal\u4ee5\u53caFORTRAN\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u51c6\u5907\u5de5\u4f5c \u00b6 \u901a\u5e38\uff0c\u5728\u4e3a\u8c03\u8bd5\u800c\u7f16\u8bd1\u65f6\uff0c\u6211\u4eec\u4f1a\u5173\u6389\u7f16\u8bd1\u5668\u7684\u4f18\u5316\u9009\u9879 \uff08-O\uff09 \uff0c \u5e76\u6253\u5f00\u8c03\u8bd5\u9009\u9879 \uff08-g\uff09 \u3002\u53e6\u5916\uff0c -Wall \u5728\u5c3d\u91cf\u4e0d\u5f71\u54cd\u7a0b\u5e8f\u884c\u4e3a\u7684\u60c5\u51b5\u4e0b\u9009\u9879\u6253\u5f00\u6240\u6709warning\uff0c\u4e5f\u53ef\u4ee5\u53d1\u73b0\u8bb8\u591a\u95ee\u9898\uff0c\u907f\u514d\u4e00\u4e9b\u4e0d\u5fc5\u8981\u7684 BUG\u3002 \u4f8b\u5982\uff1a gcc -g -Wall program.c -o program -g \u9009\u9879\u7684\u4f5c\u7528\u662f\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u52a0\u5165\u6e90\u4ee3\u7801\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u7b2c\u51e0\u6761\u673a \u5668\u6307\u4ee4\u5bf9\u5e94\u6e90\u4ee3\u7801\u7684\u7b2c\u51e0\u884c\uff0c\u4f46\u5e76\u4e0d\u662f\u628a\u6574\u4e2a\u6e90\u6587\u4ef6\u5d4c\u5165\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u5728\u8c03 \u8bd5\u65f6\u5fc5\u987b\u4fdd\u8bc1 gdb \u80fd\u627e\u5230\u6e90\u6587\u4ef6\u3002 \u8c03\u8bd5\u4e0b\u5217\u7a0b\u5e8f\u524d\u8981\u505a\u51c6\u5907\u5de5\u4f5c\uff0c\u5728shell\u4e2d\u8f93\u5165\uff1a $ gcc -g -Wall test.c -o test gdb\u547d\u4ee4 \u00b6 \u8fc7\u7a0b\u64cd\u4f5c \u00b6 gdb (\u53ef\u6267\u884c\u7a0b\u5e8f) \u542f\u52a8gdb\u8c03\u8bd5 quit / q \u9000\u51fagdb\u8c03\u8bd5 set args 10 20 \u7ed9\u7a0b\u5e8f\u8bbe\u7f6e\u53c2\u6570 show args \u83b7\u53d6\u8bbe\u7f6e\u7684\u53c2\u6570 help \u7528\u6765\u67e5\u770b\u8c03\u8bd5\u5e2e\u52a9\u6216\u5177\u4f53\u6307\u4ee4\u7684\u76f8\u5173\u4fe1\u606f list \u67e5\u770b\u5f53\u524d\u6587\u4ef6\u4ee3\u7801\uff0c\u53ef\u4ee5\u6307\u5b9a\u6587\u4ef6\u548c\u51fd\u6570 (l) set list / listsize \u8bbe\u7f6e\u663e\u793a\u7684\u884c\u6570 print \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u503c(p) ptype \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u7c7b\u578b until \u8df3\u51fa\u5faa\u73af \u65ad\u70b9 \u00b6 gdb break (file:)line/function \u65ad\u5728(\u6587\u4ef6:)\u884c\u53f7\u6216\u51fd\u6570(b) gdb break *0x.... \u65ad\u5728\u5730\u5740 gdb info breakpoints \u67e5\u770b\u65ad\u70b9\u53ca\u72b6\u6001 (i b) gdb delete / clear \u6e05\u9664\u6240\u6709\u65ad\u70b9 (d/cl) gdb delete \u5220\u9664\u67d0\u4e00\u65ad\u70b9\uff08\u4ece i b \u5f97\u6765\u65ad\u70b9\u53f7\uff09 gdb clear ... \u6e05\u9664\u67d0\u4e00\u7b26\u53f7\u3001\u5730\u5740\u5904\u7684\u65ad\u70b9 gdb disable \u7981\u7528\u67d0\u4e00\u65ad\u70b9 gdb enable \u542f\u7528\u67d0\u4e00\u65ad\u70b9 gdb watch ... \u5728\u67d0\u5904\u589e\u52a0\u89c2\u5bdf\u70b9\uff0cdelete\u3001enable\u3001disable \u4e0e\u65ad\u70b9\u5171\u7528 gdb break/watch if \u5982\u679c\u6761\u4ef6\u6ee1\u8db3\u5219\u65ad gdb condition \u66f4\u6539\u6761\u4ef6 \u8fd0\u884c \u00b6 gdb start \u7a0b\u5e8f\u505c\u5728\u7b2c\u4e00\u884c gdb run \u76f4\u63a5\u8fd0\u884c\uff0c\u9047\u5230\u7aef\u70b9\u624d\u505c\u6b62 (r) gdb continue \u7ee7\u7eed\u8fd0\u884c (c) gdb step \u8fd0\u884c\u5230\u4e0b\u4e00\u6761\u6e90\u7801 (s) gdb next \u5355\u6b65\u8fd0\u884c\uff0c\u8df3\u8fc7\u51fd\u6570 (n) gdb finish \u8fd0\u884c\u5b8c\u5f53\u524d\u51fd\u6570 (fin) gdb attach \u8fde\u63a5\u7a0b\u5e8f gdb detach \u4ece\u5f53\u524d\u7a0b\u5e8f\u65ad\u8fde gdb target remote localhost:1234 \u8fde\u63a5 qemu \u8c03\u7528\u6808 \u00b6 gdb backtrace \u67e5\u770b\u8c03\u7528\u6808 (bt) gdb frame \u67e5\u770b\u5f53\u524d\u5e27\u6808 gdb up/down \u79fb\u52a8\u5f53\u524d\u5e27\u6808\uff08\u5411 main / \u8fdc\u79bb main\uff09 gdb info locals \u67e5\u770b\u5f53\u524d\u5e27\u6808\u53d8\u91cf gdb info args \u67e5\u770b\u51fd\u6570\u53c2\u6570 gdb\u63d2\u4ef6 \u00b6 gdb-peda \u00b6 \u6bcf\u6761\u6307\u4ee4\u5e26\u5bc4\u5b58\u5668\u3001\u6c47\u7f16\u3001\u5185\u5b58\u6570\u636e\u56de\u663e $ git clone https://github.com/longld/peda.git ~/peda $ echo \"source ~/peda/peda.py\" >> ~/.gdbinit \u5176\u5b9e\u5c31\u662f\u4e0b\u8f7d\u5b8c\u6210\u540e, \u5c06 source ~/peda/peda.py \u5199\u5165 ~/.gdbinit Reference \u00b6 jujimeizuo\u7684Linux GDB\u8c03\u8bd5 gdb\u76f8\u5173\u5907\u5fd8 \u7ef4\u57fa\u767e\u79d1-gdb GDB\u5b9e\u7528\u63d2\u4ef6(peda, gef, gdbinit)\u5168\u89e3","title":"gdb \u547d\u4ee4\u76f8\u5173"},{"location":"utils/gdb/#gdb","text":"\u7ea6 750 \u4e2a\u5b57 3 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract gdb\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\uff0c\u63d2\u4ef6\u7b49","title":"gdb \u547d\u4ee4\u76f8\u5173"},{"location":"utils/gdb/#_1","text":"","title":"\u524d\u8a00"},{"location":"utils/gdb/#gdb_1","text":"GNU\u8c03\u8bd5\u5668\uff08\u82f1\u8bed\uff1aGNU Debugger\uff0c\u7f29\u5199\uff1aGDB\uff09\uff0c\u662fGNU\u8f6f\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6807\u51c6\u8c03\u8bd5\u5668\uff0c\u6b64\u5916GDB\u4e5f\u662f\u4e2a\u5177\u6709\u79fb\u643a\u6027\u7684\u8c03\u8bd5\u5668\uff0c\u7ecf\u8fc7\u79fb\u643a\u9700\u6c42\u7684\u8c03\u4fee\u4e0e\u91cd\u65b0\u7f16\u8bd1\uff0c\u5982\u4eca\u8bb8\u591a\u7684\u7c7bUNIX\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u53ef\u4ee5\u4f7f\u7528GDB\uff0c\u800c\u73b0\u6709GDB\u6240\u80fd\u652f\u6301\u8c03\u8bd5\u7684\u7f16\u7a0b\u8bed\u8a00\u6709C\u3001C++\u3001Pascal\u4ee5\u53caFORTRAN\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1","title":"\u4ec0\u4e48\u662fgdb"},{"location":"utils/gdb/#_2","text":"\u901a\u5e38\uff0c\u5728\u4e3a\u8c03\u8bd5\u800c\u7f16\u8bd1\u65f6\uff0c\u6211\u4eec\u4f1a\u5173\u6389\u7f16\u8bd1\u5668\u7684\u4f18\u5316\u9009\u9879 \uff08-O\uff09 \uff0c \u5e76\u6253\u5f00\u8c03\u8bd5\u9009\u9879 \uff08-g\uff09 \u3002\u53e6\u5916\uff0c -Wall \u5728\u5c3d\u91cf\u4e0d\u5f71\u54cd\u7a0b\u5e8f\u884c\u4e3a\u7684\u60c5\u51b5\u4e0b\u9009\u9879\u6253\u5f00\u6240\u6709warning\uff0c\u4e5f\u53ef\u4ee5\u53d1\u73b0\u8bb8\u591a\u95ee\u9898\uff0c\u907f\u514d\u4e00\u4e9b\u4e0d\u5fc5\u8981\u7684 BUG\u3002 \u4f8b\u5982\uff1a gcc -g -Wall program.c -o program -g \u9009\u9879\u7684\u4f5c\u7528\u662f\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u52a0\u5165\u6e90\u4ee3\u7801\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u7b2c\u51e0\u6761\u673a \u5668\u6307\u4ee4\u5bf9\u5e94\u6e90\u4ee3\u7801\u7684\u7b2c\u51e0\u884c\uff0c\u4f46\u5e76\u4e0d\u662f\u628a\u6574\u4e2a\u6e90\u6587\u4ef6\u5d4c\u5165\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u5728\u8c03 \u8bd5\u65f6\u5fc5\u987b\u4fdd\u8bc1 gdb \u80fd\u627e\u5230\u6e90\u6587\u4ef6\u3002 \u8c03\u8bd5\u4e0b\u5217\u7a0b\u5e8f\u524d\u8981\u505a\u51c6\u5907\u5de5\u4f5c\uff0c\u5728shell\u4e2d\u8f93\u5165\uff1a $ gcc -g -Wall test.c -o test","title":"\u51c6\u5907\u5de5\u4f5c"},{"location":"utils/gdb/#gdb_2","text":"","title":"gdb\u547d\u4ee4"},{"location":"utils/gdb/#_3","text":"gdb (\u53ef\u6267\u884c\u7a0b\u5e8f) \u542f\u52a8gdb\u8c03\u8bd5 quit / q \u9000\u51fagdb\u8c03\u8bd5 set args 10 20 \u7ed9\u7a0b\u5e8f\u8bbe\u7f6e\u53c2\u6570 show args \u83b7\u53d6\u8bbe\u7f6e\u7684\u53c2\u6570 help \u7528\u6765\u67e5\u770b\u8c03\u8bd5\u5e2e\u52a9\u6216\u5177\u4f53\u6307\u4ee4\u7684\u76f8\u5173\u4fe1\u606f list \u67e5\u770b\u5f53\u524d\u6587\u4ef6\u4ee3\u7801\uff0c\u53ef\u4ee5\u6307\u5b9a\u6587\u4ef6\u548c\u51fd\u6570 (l) set list / listsize \u8bbe\u7f6e\u663e\u793a\u7684\u884c\u6570 print \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u503c(p) ptype \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u7c7b\u578b until \u8df3\u51fa\u5faa\u73af","title":"\u8fc7\u7a0b\u64cd\u4f5c"},{"location":"utils/gdb/#_4","text":"gdb break (file:)line/function \u65ad\u5728(\u6587\u4ef6:)\u884c\u53f7\u6216\u51fd\u6570(b) gdb break *0x.... \u65ad\u5728\u5730\u5740 gdb info breakpoints \u67e5\u770b\u65ad\u70b9\u53ca\u72b6\u6001 (i b) gdb delete / clear \u6e05\u9664\u6240\u6709\u65ad\u70b9 (d/cl) gdb delete \u5220\u9664\u67d0\u4e00\u65ad\u70b9\uff08\u4ece i b \u5f97\u6765\u65ad\u70b9\u53f7\uff09 gdb clear ... \u6e05\u9664\u67d0\u4e00\u7b26\u53f7\u3001\u5730\u5740\u5904\u7684\u65ad\u70b9 gdb disable \u7981\u7528\u67d0\u4e00\u65ad\u70b9 gdb enable \u542f\u7528\u67d0\u4e00\u65ad\u70b9 gdb watch ... \u5728\u67d0\u5904\u589e\u52a0\u89c2\u5bdf\u70b9\uff0cdelete\u3001enable\u3001disable \u4e0e\u65ad\u70b9\u5171\u7528 gdb break/watch if \u5982\u679c\u6761\u4ef6\u6ee1\u8db3\u5219\u65ad gdb condition \u66f4\u6539\u6761\u4ef6","title":"\u65ad\u70b9"},{"location":"utils/gdb/#_5","text":"gdb start \u7a0b\u5e8f\u505c\u5728\u7b2c\u4e00\u884c gdb run \u76f4\u63a5\u8fd0\u884c\uff0c\u9047\u5230\u7aef\u70b9\u624d\u505c\u6b62 (r) gdb continue \u7ee7\u7eed\u8fd0\u884c (c) gdb step \u8fd0\u884c\u5230\u4e0b\u4e00\u6761\u6e90\u7801 (s) gdb next \u5355\u6b65\u8fd0\u884c\uff0c\u8df3\u8fc7\u51fd\u6570 (n) gdb finish \u8fd0\u884c\u5b8c\u5f53\u524d\u51fd\u6570 (fin) gdb attach \u8fde\u63a5\u7a0b\u5e8f gdb detach \u4ece\u5f53\u524d\u7a0b\u5e8f\u65ad\u8fde gdb target remote localhost:1234 \u8fde\u63a5 qemu","title":"\u8fd0\u884c"},{"location":"utils/gdb/#_6","text":"gdb backtrace \u67e5\u770b\u8c03\u7528\u6808 (bt) gdb frame \u67e5\u770b\u5f53\u524d\u5e27\u6808 gdb up/down \u79fb\u52a8\u5f53\u524d\u5e27\u6808\uff08\u5411 main / \u8fdc\u79bb main\uff09 gdb info locals \u67e5\u770b\u5f53\u524d\u5e27\u6808\u53d8\u91cf gdb info args \u67e5\u770b\u51fd\u6570\u53c2\u6570","title":"\u8c03\u7528\u6808"},{"location":"utils/gdb/#gdb_3","text":"","title":"gdb\u63d2\u4ef6"},{"location":"utils/gdb/#gdb-peda","text":"\u6bcf\u6761\u6307\u4ee4\u5e26\u5bc4\u5b58\u5668\u3001\u6c47\u7f16\u3001\u5185\u5b58\u6570\u636e\u56de\u663e $ git clone https://github.com/longld/peda.git ~/peda $ echo \"source ~/peda/peda.py\" >> ~/.gdbinit \u5176\u5b9e\u5c31\u662f\u4e0b\u8f7d\u5b8c\u6210\u540e, \u5c06 source ~/peda/peda.py \u5199\u5165 ~/.gdbinit","title":"gdb-peda"},{"location":"utils/gdb/#reference","text":"jujimeizuo\u7684Linux GDB\u8c03\u8bd5 gdb\u76f8\u5173\u5907\u5fd8 \u7ef4\u57fa\u767e\u79d1-gdb GDB\u5b9e\u7528\u63d2\u4ef6(peda, gef, gdbinit)\u5168\u89e3","title":"Reference"},{"location":"utils/git/","text":"Git \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 324 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u4e00\u4e9b\u5e38\u7528 / \u5e38\u5fd8\u7684 git \u547d\u4ee4 \u5206\u652f \u00b6 git branch \u521b\u5efa\u5206\u652f git checkout \u5207\u6362\u5206\u652f git checkout -b \u521b\u5efa\u5206\u652f\uff0c\u5e76\u5207\u6362\u8fc7\u53bb git diff master \u663e\u793a\u5206\u652f\u548c\u4e3b\u5206\u652f\u7684\u5dee\u522b git clone -b \u514b\u9686\u5355\u4e2a\u5206\u652f git branch -d \u5220\u9664\u5206\u652f git branch -a \u67e5\u770b\u6240\u6709\u5206\u652f git merge \u5408\u5e76\u5206\u652f \u8fdc\u7a0b\u4ed3\u5e93 \u00b6 git fetch \u83b7\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5386\u53f2\u8bb0\u5f55 git pull \u5c06\u672c\u5730\u4ed3\u5e93\u66f4\u65b0, pull = fetch + merge git push origin \u5c06\u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93 \u6539\u5199\u63d0\u4ea4 \u00b6 git commit --amend \u4fee\u6539\u6700\u8fd1\u7684\u63d0\u4ea4 git revert HEAD \u53d6\u6d88\u8fc7\u53bb\u7684\u63d0\u4ea4 git reset --soft HEAD^ \u64a4\u9500 commit\uff08\u4e0d\u66f4\u6539\u6587\u4ef6\uff09 git reset --hard HEAD^ \u64a4\u9500 commit\uff08\u6587\u4ef6\u56de\u9000\u5230\u4e0a\u4e00\u7248\u672c\uff09 git rm --cached \u5df2 add \u672a commit \u7684\u6587\u4ef6\u9000\u56de\u672a add \u72b6\u6001 git checkout . \u53d6\u6d88\u672c\u6b21\u672a\u88abcommit\u7684\u4fee\u6539 git rebase \u53d8\u57fa git rebase -i \u5408\u5e76/\u4fee\u6539\u63d0\u4ea4\uff0c \u6700\u597d\u7528fetch+rebase\u7684\u65b9\u5f0f\u6765\u5408\u5e76 \u6807\u7b7e \u00b6 git tag \u663e\u793a\u6240\u6709\u6807\u7b7e\u5217\u8868 git tag \u6dfb\u52a0\u8f7b\u6807\u7b7e git tag -a \u6dfb\u52a0\u6ce8\u89e3\u6807\u7b7e git tag -d \u5220\u9664\u6807\u7b7e awesome_git_log \u00b6 \u4e3a\u4e86\u65b9\u4fbf\u67e5\u770b commit \u76f8\u5173\u4fe1\u606f\uff0c\u7528 alias \u6765\u7b80\u5316\u64cd\u4f5c\uff0c\u5c06\u4e0b\u9762\u4ee3\u7801\u7c98\u8d34\u5230 bashrc \u4e2d\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u76f4\u63a5 awe+tab \u5373\u53ef\u3002 # git function git_branch { branch = \"`git branch 2>/dev/null | grep \" ^ \\* \" | sed -e \" s/^ \\*\\ // \"`\" if [ \" ${ branch } \" ! = \"\" ] ; then if [ \" ${ branch } \" = \"(no branch)\" ] ; then branch = \"(`git rev-parse --short HEAD`...)\" fi echo \" ( $branch )\" fi } alias __git_awesome_log = \"git log --oneline --decorate --all --graph\" alias awesome_git_log = \"git log --oneline --decorate --all --graph\" Reference \u00b6 \u7334\u5b50\u90fd\u80fd\u61c2\u7684GIT\u5165\u95e8 Git\u547d\u4ee4\u5907\u5fd8","title":"Git \u547d\u4ee4\u76f8\u5173"},{"location":"utils/git/#git","text":"\u7ea6 324 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u4e00\u4e9b\u5e38\u7528 / \u5e38\u5fd8\u7684 git \u547d\u4ee4","title":"Git \u547d\u4ee4\u76f8\u5173"},{"location":"utils/git/#_1","text":"git branch \u521b\u5efa\u5206\u652f git checkout \u5207\u6362\u5206\u652f git checkout -b \u521b\u5efa\u5206\u652f\uff0c\u5e76\u5207\u6362\u8fc7\u53bb git diff master \u663e\u793a\u5206\u652f\u548c\u4e3b\u5206\u652f\u7684\u5dee\u522b git clone -b \u514b\u9686\u5355\u4e2a\u5206\u652f git branch -d \u5220\u9664\u5206\u652f git branch -a \u67e5\u770b\u6240\u6709\u5206\u652f git merge \u5408\u5e76\u5206\u652f","title":"\u5206\u652f"},{"location":"utils/git/#_2","text":"git fetch \u83b7\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5386\u53f2\u8bb0\u5f55 git pull \u5c06\u672c\u5730\u4ed3\u5e93\u66f4\u65b0, pull = fetch + merge git push origin \u5c06\u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93","title":"\u8fdc\u7a0b\u4ed3\u5e93"},{"location":"utils/git/#_3","text":"git commit --amend \u4fee\u6539\u6700\u8fd1\u7684\u63d0\u4ea4 git revert HEAD \u53d6\u6d88\u8fc7\u53bb\u7684\u63d0\u4ea4 git reset --soft HEAD^ \u64a4\u9500 commit\uff08\u4e0d\u66f4\u6539\u6587\u4ef6\uff09 git reset --hard HEAD^ \u64a4\u9500 commit\uff08\u6587\u4ef6\u56de\u9000\u5230\u4e0a\u4e00\u7248\u672c\uff09 git rm --cached \u5df2 add \u672a commit \u7684\u6587\u4ef6\u9000\u56de\u672a add \u72b6\u6001 git checkout . \u53d6\u6d88\u672c\u6b21\u672a\u88abcommit\u7684\u4fee\u6539 git rebase \u53d8\u57fa git rebase -i \u5408\u5e76/\u4fee\u6539\u63d0\u4ea4\uff0c \u6700\u597d\u7528fetch+rebase\u7684\u65b9\u5f0f\u6765\u5408\u5e76","title":"\u6539\u5199\u63d0\u4ea4"},{"location":"utils/git/#_4","text":"git tag \u663e\u793a\u6240\u6709\u6807\u7b7e\u5217\u8868 git tag \u6dfb\u52a0\u8f7b\u6807\u7b7e git tag -a \u6dfb\u52a0\u6ce8\u89e3\u6807\u7b7e git tag -d \u5220\u9664\u6807\u7b7e","title":"\u6807\u7b7e"},{"location":"utils/git/#awesome_git_log","text":"\u4e3a\u4e86\u65b9\u4fbf\u67e5\u770b commit \u76f8\u5173\u4fe1\u606f\uff0c\u7528 alias \u6765\u7b80\u5316\u64cd\u4f5c\uff0c\u5c06\u4e0b\u9762\u4ee3\u7801\u7c98\u8d34\u5230 bashrc \u4e2d\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u76f4\u63a5 awe+tab \u5373\u53ef\u3002 # git function git_branch { branch = \"`git branch 2>/dev/null | grep \" ^ \\* \" | sed -e \" s/^ \\*\\ // \"`\" if [ \" ${ branch } \" ! = \"\" ] ; then if [ \" ${ branch } \" = \"(no branch)\" ] ; then branch = \"(`git rev-parse --short HEAD`...)\" fi echo \" ( $branch )\" fi } alias __git_awesome_log = \"git log --oneline --decorate --all --graph\" alias awesome_git_log = \"git log --oneline --decorate --all --graph\"","title":"awesome_git_log"},{"location":"utils/git/#reference","text":"\u7334\u5b50\u90fd\u80fd\u61c2\u7684GIT\u5165\u95e8 Git\u547d\u4ee4\u5907\u5fd8","title":"Reference"},{"location":"utils/gitbook/","text":"gitbook \u00b6 \u524d\u7f6e\u8981\u6c42 \u00b6 nodejs \u00b6 \u9ad8\u7248\u672c\u53ef\u80fd\u4e0d\u517c\u5bb9\uff0c\u9700\u8981\u7248\u672c\u5728v10\u5de6\u53f3\u3002 https://nodejs.org/download/release/v10.21.0/ \u66f4\u6362\u955c\u50cf \u00b6 npm config get registry npm config set registry https://registry.npm.taobao.org \u5b89\u88c5 \u00b6 npm uninstall -g gitbook-cli \u5b89\u88c5\u5b8c\u4e4b\u540e\u7528 gitbook -V \u67e5\u770b\u7248\u672c\uff0c\u81ea\u52a8install gitbook\u3002 \u4f7f\u7528 \u00b6 gitbook -V \u67e5\u770b\u7248\u672c\u53f7 gitbook init \u521d\u59cb\u5316 gitbook serve \u9884\u89c8 gitbook build \u751f\u6210 gitbook build --gitbook = 2 .6.7 \u751f\u6210\u65f6\u6307\u5b9agitbook\u7684\u7248\u672c, \u672c\u5730\u6ca1\u6709\u4f1a\u5148\u4e0b\u8f7d gitbook uninstall 2 .6.7 \u5378\u8f7d\u6307\u5b9a\u7248\u672c\u53f7\u7684gitbook gitbook fetch [ version ] \u83b7\u53d6 [ \u7248\u672c ] \u4e0b\u8f7d\u5e76\u5b89\u88c5<\u7248\u672c> gitbook --help \u663e\u793a\u5e2e\u52a9\u6587\u6863 gitbook ls-remote \u5217\u51faNPM\u4e0a\u7684\u53ef\u7528\u7248\u672c\uff1a","title":"gitbook"},{"location":"utils/gitbook/#gitbook","text":"","title":"gitbook"},{"location":"utils/gitbook/#_1","text":"","title":"\u524d\u7f6e\u8981\u6c42"},{"location":"utils/gitbook/#nodejs","text":"\u9ad8\u7248\u672c\u53ef\u80fd\u4e0d\u517c\u5bb9\uff0c\u9700\u8981\u7248\u672c\u5728v10\u5de6\u53f3\u3002 https://nodejs.org/download/release/v10.21.0/","title":"nodejs"},{"location":"utils/gitbook/#_2","text":"npm config get registry npm config set registry https://registry.npm.taobao.org","title":"\u66f4\u6362\u955c\u50cf"},{"location":"utils/gitbook/#_3","text":"npm uninstall -g gitbook-cli \u5b89\u88c5\u5b8c\u4e4b\u540e\u7528 gitbook -V \u67e5\u770b\u7248\u672c\uff0c\u81ea\u52a8install gitbook\u3002","title":"\u5b89\u88c5"},{"location":"utils/gitbook/#_4","text":"gitbook -V \u67e5\u770b\u7248\u672c\u53f7 gitbook init \u521d\u59cb\u5316 gitbook serve \u9884\u89c8 gitbook build \u751f\u6210 gitbook build --gitbook = 2 .6.7 \u751f\u6210\u65f6\u6307\u5b9agitbook\u7684\u7248\u672c, \u672c\u5730\u6ca1\u6709\u4f1a\u5148\u4e0b\u8f7d gitbook uninstall 2 .6.7 \u5378\u8f7d\u6307\u5b9a\u7248\u672c\u53f7\u7684gitbook gitbook fetch [ version ] \u83b7\u53d6 [ \u7248\u672c ] \u4e0b\u8f7d\u5e76\u5b89\u88c5<\u7248\u672c> gitbook --help \u663e\u793a\u5e2e\u52a9\u6587\u6863 gitbook ls-remote \u5217\u51faNPM\u4e0a\u7684\u53ef\u7528\u7248\u672c\uff1a","title":"\u4f7f\u7528"},{"location":"utils/hexo/","text":"","title":"hexo"},{"location":"utils/imagemagick/","text":"","title":"ImageMagick"},{"location":"utils/mkdocs/","text":"","title":"mkdocs"},{"location":"utils/reveal-md/","text":"reveal-md \u00b6 \u7ea6 757 \u4e2a\u5b57 21 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract RevealJS \u662f\u4e00\u4e2a\u7b80\u5355\u4e14\u652f\u6301 markdown \u7684\u5de5\u5177\uff0c\u7136\u540e\u8f6c\u6362\u6210 PPT\u3002 \u8fd9\u91cc\u63a8\u8350\u4e00\u4e2aslide\u6a21\u7248 TonyCrane/slide-template \u3002 \u672c\u4eba\u4e0d\u559c\u6b22\u5199 PPT\uff08\u4e5f\u4e0d\u4f1a\u5199\uff09 \u4ec0\u4e48\u662f reveal-md \u00b6 \u53ef\u4ee5\u53ea\u7528\u5199 markdown \u7684\u65b9\u5f0f\u5199 PPT\uff0c\u5c06 markdown \u8f6c\u6362\u6210 html\uff0c\u6216\u5bfc\u51fa PDF \u662f revealjs \u7684 makrdown \u529f\u80fd \u5b89\u88c5 reveal-md \u00b6 \u672c\u5730\u6784\u5efa \u00b6 reveal.js \u4f7f\u7528 nodejs \u6784\u5efa\uff0c\u9700\u8981\u63d0\u524d\u5b89\u88c5\u597d nodejs \u901a\u8fc7 npm \u5b89\u88c5 reveal-md $ npm install -g reveal-md $ reveal-md slides.md # \u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\u5e76\u5728\u9ed8\u8ba4\u6d4f\u89c8\u5668\u4e2d\u5c06\u4efb\u4f55 Markdown \u6587\u4ef6\u6f14\u793a\u6587\u7a3f\u6253\u5f00 Docker \u6784\u5efa \u00b6 \u4e0d\u9700\u8981\u5b89\u88c5 node.js \u5728\u5bb9\u5668\u4e2d\u542f\u7528\u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d\uff0c\u8fd8\u5e94\u8be5\u6620\u5c04\u7aef\u53e3 35729 $ docker run --rm -p 1948 :1948 -p 35729 :35729 -v :/slides webpronl/reveal-md:latest /slides --watch \u76f8\u5173\u547d\u4ee4 \u00b6 reveal-md -w \u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d reveal-md --scripts [url/*.js] \u81ea\u5b9a\u4e49 js reveal-md --css [url/*.js] \u81ea\u5b9a\u4e49 css reveal-md --static [--static-dirs=assets] \u5bfc\u51fa\u5230\u72ec\u7acb\u7684 HTML \u7f51\u7ad9 (\u5c06\u5305\u542b\u5176\u4ed6\u9759\u6001\u8d44\u6e90\u7684\u76ee\u5f55\u590d\u5236\u5230\u76ee\u6807\u76ee\u5f55) reveal-md --print [--print-size 1024x768 / A4] name.pdf \u6253\u5370\u6210 PDF\uff08\u6216\u8005\u5728\u6d4f\u89c8\u5668\u7684 url \u540e\u6dfb\u52a0 ?print-pdf reveal-md --template \u81ea\u5b9a\u4e49\u6a21\u7248 \u914d\u7f6e \u00b6 yaml \u914d\u7f6e \u00b6 \u53ef\u4ee5\u5728 markdown \u6587\u4ef6\u4e2d\u901a\u8fc7 yaml \u8fdb\u884c\u914d\u7f6e --- title : Slide \u6a21\u677f # \u5e7b\u706f\u7247\u540d\u79f0 separator : # \u5e7b\u706f\u7247\u6a2a\u884c\u5207\u5272\u6807\u5fd7 verticalSeparator : # \u5e7b\u706f\u7247\u5782\u76f4\u5207\u5272\u6807\u5fd7 theme : simple # \u5e7b\u706f\u7247\u4e3b\u9898 highlightTheme : github # \u4ee3\u7801\u9ad8\u4eae\u4e3b\u9898 css : custom.css # \u81ea\u5b9a\u4e49 css revealOptions : transition : 'slide' # \u52a8\u753b\u6548\u679c transitionSpeed : fast # \u52a8\u753b\u901f\u5ea6 center : false # \u662f\u5426\u5c45\u4e2d slideNumber : \"c/t\" # \u5e7b\u706f\u7247\u6570\u91cf width : 1000 # \u5e7b\u706f\u7247\u5bbd\u5ea6 --- \u5e7b\u706f\u7247\u4e3b\u9898 \u00b6 \u9ed8\u8ba4\u4e3b\u9898 \u540d\u79f0 \u6548\u679c black \u9ed1\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5\uff08\u9ed8\u8ba4\uff09 white \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 league \u7070\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u5b57\uff0c\u84dd\u8272\u94fe\u63a5 beige \u7c73\u8272\u80cc\u666f\uff0c\u6df1\u8272\u6587\u5b57\uff0c\u68d5\u8272\u94fe\u63a5 sky \u84dd\u8272\u80cc\u666f\uff0c\u7ec6\u6697\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 night \u9ed1\u8272\u80cc\u666f\uff0c\u539a\u767d\u8272\u6587\u5b57\uff0c\u6a59\u8272\u94fe\u63a5 serif \u5361\u5e03\u5947\u8bfa\u80cc\u666f\uff0c\u7070\u8272\u6587\u672c\uff0c\u68d5\u8272\u94fe\u63a5 simple \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 solarized \u9ad8\u5206\u8fa8\u7387\u7167\u7247 blood \u6df1\u8272\u80cc\u666f\uff0c\u539a\u767d\u6587\u5b57\uff0c\u7ea2\u8272\u94fe\u63a5 moon \u9ad8\u5206\u8fa8\u7387\u7167\u7247 \u81ea\u5b9a\u4e49\u4e3b\u9898 \u4e0b\u8f7d reveal git clone git@github.com :hakimel/reveal.js.git \uff1b \u5728 /css/theme/coder.scss \u4e2d\u590d\u5236\u4e00\u4e2a\u6587\u4ef6\uff1b \u8fd0\u884c npm run build -- css-themes \u751f\u6210css dist/coder.css\uff1b \u8fd0\u884c\u6307\u5b9a\u4e3b\u9898 reveal-md slides.md -w --theme theme/coder.css\u3002 \u5207\u6362\u65f6\u52a8\u753b \u00b6 \u540d\u79f0 \u6548\u679c none \u77ac\u95f4\u5207\u6362\u80cc\u666f fade \u4ea4\u53c9\u6de1\u5165\u6de1\u51fa - \u80cc\u666f\u8f6c\u6362\u7684\u9ed8\u8ba4\u503c slide \u5728\u80cc\u666f\u4e4b\u95f4\u6ed1\u52a8 \u2014 \u5e7b\u706f\u7247\u8fc7\u6e21\u7684\u9ed8\u8ba4\u8bbe\u7f6e convex \u4ee5\u51f8\u89d2\u6ed1\u52a8 concave \u4ee5\u51f9\u89d2\u6ed1\u52a8 zoom \u5411\u4e0a\u7f29\u653e\u4f20\u5165\u7684\u5e7b\u706f\u7247\uff0c\u4f7f\u5176\u4ece\u5c4f\u5e55\u4e2d\u5fc3\u5411\u5185\u6269\u5c55 \u7528\u6cd5 \u00b6 \u6362\u9875 \u00b6 \u6a2a\u5411\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e \u5782\u76f4\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e \u6dfb\u52a0\u5c5e\u6027 \u00b6 \u5f53\u9700\u8981\u5728 section \u4e2d\u6dfb\u52a0\u5c5e\u6027\u65f6 \u5f53\u9700\u8981\u5728\u5176\u5b83\u5143\u7d20\u63d2\u5165\u5c5e\u6027\u65f6 \u8bbe\u7f6e\u80cc\u666f\u8272\u6216\u80cc\u666f\u56fe \u8bbe\u7f6e\u52a8\u753b\u7247\u6bb5 Item1 \u5177\u4f53\u53ef\u4ee5\u67e5\u9605revealjs\u7684docs \u6307\u5b9a\u4ee3\u7801\u9ad8\u4eae\u987a\u5e8f \u00b6 ```python [1|3-6] n = 0 while n < 10 : if n % 2 == 0 : print ( f \" { n } is even\" ) else : print ( f \" { n } is odd\" ) n += 1 ``` \u5730\u5740\u8df3\u8f6c \u00b6 [ \u8df3\u8f6c0 ]( #/0 ) \u90e8\u7f72 \u00b6 Github Pages \u00b6 \u5728 Github \u4e2d\u65b0\u5efa\u4e00\u4e2a slides \u4ed3\u5e93\u4f5c\u4e3a\u603b\u5e7b\u706f\u7247\u7ad9\u70b9\uff0c\u5e76\u4e14\u90e8\u7f72 Github Pages\uff08\u53ef\u81ea\u5b9a\u4e49\u57df\u540d \u5728\u5206\u4ed3\u5e93\u4e2d\u5199\u597d\u9879\u76ee\u540e\uff0c\u901a\u8fc7 Action \u628a site \u6587\u4ef6\u5939\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230 slides \u5177\u4f53\u67e5\u770b TonyCrane's Slide Template Netlify \u00b6 \u6ce8\u518c\u4e00\u4e2a netlify \uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u7ad9\u70b9\u5173\u8054\u4e0agithub\u4ed3\u5e93 \u5728\u914d\u7f6e/\u90e8\u7f72\u91cc\u9762\u6dfb\u52a0\u6784\u5efa\u547d\u4ee4 \u7136\u540e\u5728\u57df\u540d\u7ba1\u7406\u6dfb\u52a0\u4e00\u4e2a\u81ea\u5df1\u7684\u57df\u540d Reference \u00b6 webpro/reveal-md revealjs \u5b98\u7f51 \u4efb\u4f55\u5229\u7528 revealjs \u5199\u51fa\u6f02\u4eae\u7684 PPT TonyCrane's Slide Template","title":"reveal-md"},{"location":"utils/reveal-md/#reveal-md","text":"\u7ea6 757 \u4e2a\u5b57 21 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract RevealJS \u662f\u4e00\u4e2a\u7b80\u5355\u4e14\u652f\u6301 markdown \u7684\u5de5\u5177\uff0c\u7136\u540e\u8f6c\u6362\u6210 PPT\u3002 \u8fd9\u91cc\u63a8\u8350\u4e00\u4e2aslide\u6a21\u7248 TonyCrane/slide-template \u3002 \u672c\u4eba\u4e0d\u559c\u6b22\u5199 PPT\uff08\u4e5f\u4e0d\u4f1a\u5199\uff09","title":"reveal-md"},{"location":"utils/reveal-md/#reveal-md_1","text":"\u53ef\u4ee5\u53ea\u7528\u5199 markdown \u7684\u65b9\u5f0f\u5199 PPT\uff0c\u5c06 markdown \u8f6c\u6362\u6210 html\uff0c\u6216\u5bfc\u51fa PDF \u662f revealjs \u7684 makrdown \u529f\u80fd","title":"\u4ec0\u4e48\u662f reveal-md"},{"location":"utils/reveal-md/#reveal-md_2","text":"","title":"\u5b89\u88c5 reveal-md"},{"location":"utils/reveal-md/#_1","text":"reveal.js \u4f7f\u7528 nodejs \u6784\u5efa\uff0c\u9700\u8981\u63d0\u524d\u5b89\u88c5\u597d nodejs \u901a\u8fc7 npm \u5b89\u88c5 reveal-md $ npm install -g reveal-md $ reveal-md slides.md # \u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\u5e76\u5728\u9ed8\u8ba4\u6d4f\u89c8\u5668\u4e2d\u5c06\u4efb\u4f55 Markdown \u6587\u4ef6\u6f14\u793a\u6587\u7a3f\u6253\u5f00","title":"\u672c\u5730\u6784\u5efa"},{"location":"utils/reveal-md/#docker","text":"\u4e0d\u9700\u8981\u5b89\u88c5 node.js \u5728\u5bb9\u5668\u4e2d\u542f\u7528\u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d\uff0c\u8fd8\u5e94\u8be5\u6620\u5c04\u7aef\u53e3 35729 $ docker run --rm -p 1948 :1948 -p 35729 :35729 -v :/slides webpronl/reveal-md:latest /slides --watch","title":"Docker \u6784\u5efa"},{"location":"utils/reveal-md/#_2","text":"reveal-md -w \u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d reveal-md --scripts [url/*.js] \u81ea\u5b9a\u4e49 js reveal-md --css [url/*.js] \u81ea\u5b9a\u4e49 css reveal-md --static [--static-dirs=assets] \u5bfc\u51fa\u5230\u72ec\u7acb\u7684 HTML \u7f51\u7ad9 (\u5c06\u5305\u542b\u5176\u4ed6\u9759\u6001\u8d44\u6e90\u7684\u76ee\u5f55\u590d\u5236\u5230\u76ee\u6807\u76ee\u5f55) reveal-md --print [--print-size 1024x768 / A4] name.pdf \u6253\u5370\u6210 PDF\uff08\u6216\u8005\u5728\u6d4f\u89c8\u5668\u7684 url \u540e\u6dfb\u52a0 ?print-pdf reveal-md --template \u81ea\u5b9a\u4e49\u6a21\u7248","title":"\u76f8\u5173\u547d\u4ee4"},{"location":"utils/reveal-md/#_3","text":"","title":"\u914d\u7f6e"},{"location":"utils/reveal-md/#yaml","text":"\u53ef\u4ee5\u5728 markdown \u6587\u4ef6\u4e2d\u901a\u8fc7 yaml \u8fdb\u884c\u914d\u7f6e --- title : Slide \u6a21\u677f # \u5e7b\u706f\u7247\u540d\u79f0 separator : # \u5e7b\u706f\u7247\u6a2a\u884c\u5207\u5272\u6807\u5fd7 verticalSeparator : # \u5e7b\u706f\u7247\u5782\u76f4\u5207\u5272\u6807\u5fd7 theme : simple # \u5e7b\u706f\u7247\u4e3b\u9898 highlightTheme : github # \u4ee3\u7801\u9ad8\u4eae\u4e3b\u9898 css : custom.css # \u81ea\u5b9a\u4e49 css revealOptions : transition : 'slide' # \u52a8\u753b\u6548\u679c transitionSpeed : fast # \u52a8\u753b\u901f\u5ea6 center : false # \u662f\u5426\u5c45\u4e2d slideNumber : \"c/t\" # \u5e7b\u706f\u7247\u6570\u91cf width : 1000 # \u5e7b\u706f\u7247\u5bbd\u5ea6 ---","title":"yaml \u914d\u7f6e"},{"location":"utils/reveal-md/#_4","text":"\u9ed8\u8ba4\u4e3b\u9898 \u540d\u79f0 \u6548\u679c black \u9ed1\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5\uff08\u9ed8\u8ba4\uff09 white \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 league \u7070\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u5b57\uff0c\u84dd\u8272\u94fe\u63a5 beige \u7c73\u8272\u80cc\u666f\uff0c\u6df1\u8272\u6587\u5b57\uff0c\u68d5\u8272\u94fe\u63a5 sky \u84dd\u8272\u80cc\u666f\uff0c\u7ec6\u6697\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 night \u9ed1\u8272\u80cc\u666f\uff0c\u539a\u767d\u8272\u6587\u5b57\uff0c\u6a59\u8272\u94fe\u63a5 serif \u5361\u5e03\u5947\u8bfa\u80cc\u666f\uff0c\u7070\u8272\u6587\u672c\uff0c\u68d5\u8272\u94fe\u63a5 simple \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 solarized \u9ad8\u5206\u8fa8\u7387\u7167\u7247 blood \u6df1\u8272\u80cc\u666f\uff0c\u539a\u767d\u6587\u5b57\uff0c\u7ea2\u8272\u94fe\u63a5 moon \u9ad8\u5206\u8fa8\u7387\u7167\u7247 \u81ea\u5b9a\u4e49\u4e3b\u9898 \u4e0b\u8f7d reveal git clone git@github.com :hakimel/reveal.js.git \uff1b \u5728 /css/theme/coder.scss \u4e2d\u590d\u5236\u4e00\u4e2a\u6587\u4ef6\uff1b \u8fd0\u884c npm run build -- css-themes \u751f\u6210css dist/coder.css\uff1b \u8fd0\u884c\u6307\u5b9a\u4e3b\u9898 reveal-md slides.md -w --theme theme/coder.css\u3002","title":"\u5e7b\u706f\u7247\u4e3b\u9898"},{"location":"utils/reveal-md/#_5","text":"\u540d\u79f0 \u6548\u679c none \u77ac\u95f4\u5207\u6362\u80cc\u666f fade \u4ea4\u53c9\u6de1\u5165\u6de1\u51fa - \u80cc\u666f\u8f6c\u6362\u7684\u9ed8\u8ba4\u503c slide \u5728\u80cc\u666f\u4e4b\u95f4\u6ed1\u52a8 \u2014 \u5e7b\u706f\u7247\u8fc7\u6e21\u7684\u9ed8\u8ba4\u8bbe\u7f6e convex \u4ee5\u51f8\u89d2\u6ed1\u52a8 concave \u4ee5\u51f9\u89d2\u6ed1\u52a8 zoom \u5411\u4e0a\u7f29\u653e\u4f20\u5165\u7684\u5e7b\u706f\u7247\uff0c\u4f7f\u5176\u4ece\u5c4f\u5e55\u4e2d\u5fc3\u5411\u5185\u6269\u5c55","title":"\u5207\u6362\u65f6\u52a8\u753b"},{"location":"utils/reveal-md/#_6","text":"","title":"\u7528\u6cd5"},{"location":"utils/reveal-md/#_7","text":"\u6a2a\u5411\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e \u5782\u76f4\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e","title":"\u6362\u9875"},{"location":"utils/reveal-md/#_8","text":"\u5f53\u9700\u8981\u5728 section \u4e2d\u6dfb\u52a0\u5c5e\u6027\u65f6 \u5f53\u9700\u8981\u5728\u5176\u5b83\u5143\u7d20\u63d2\u5165\u5c5e\u6027\u65f6 \u8bbe\u7f6e\u80cc\u666f\u8272\u6216\u80cc\u666f\u56fe \u8bbe\u7f6e\u52a8\u753b\u7247\u6bb5 Item1 \u5177\u4f53\u53ef\u4ee5\u67e5\u9605revealjs\u7684docs","title":"\u6dfb\u52a0\u5c5e\u6027"},{"location":"utils/reveal-md/#_9","text":"```python [1|3-6] n = 0 while n < 10 : if n % 2 == 0 : print ( f \" { n } is even\" ) else : print ( f \" { n } is odd\" ) n += 1 ```","title":"\u6307\u5b9a\u4ee3\u7801\u9ad8\u4eae\u987a\u5e8f"},{"location":"utils/reveal-md/#_10","text":" [ \u8df3\u8f6c0 ]( #/0 )","title":"\u5730\u5740\u8df3\u8f6c"},{"location":"utils/reveal-md/#_11","text":"","title":"\u90e8\u7f72"},{"location":"utils/reveal-md/#github-pages","text":"\u5728 Github \u4e2d\u65b0\u5efa\u4e00\u4e2a slides \u4ed3\u5e93\u4f5c\u4e3a\u603b\u5e7b\u706f\u7247\u7ad9\u70b9\uff0c\u5e76\u4e14\u90e8\u7f72 Github Pages\uff08\u53ef\u81ea\u5b9a\u4e49\u57df\u540d \u5728\u5206\u4ed3\u5e93\u4e2d\u5199\u597d\u9879\u76ee\u540e\uff0c\u901a\u8fc7 Action \u628a site \u6587\u4ef6\u5939\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230 slides \u5177\u4f53\u67e5\u770b TonyCrane's Slide Template","title":"Github Pages"},{"location":"utils/reveal-md/#netlify","text":"\u6ce8\u518c\u4e00\u4e2a netlify \uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u7ad9\u70b9\u5173\u8054\u4e0agithub\u4ed3\u5e93 \u5728\u914d\u7f6e/\u90e8\u7f72\u91cc\u9762\u6dfb\u52a0\u6784\u5efa\u547d\u4ee4 \u7136\u540e\u5728\u57df\u540d\u7ba1\u7406\u6dfb\u52a0\u4e00\u4e2a\u81ea\u5df1\u7684\u57df\u540d","title":"Netlify"},{"location":"utils/reveal-md/#reference","text":"webpro/reveal-md revealjs \u5b98\u7f51 \u4efb\u4f55\u5229\u7528 revealjs \u5199\u51fa\u6f02\u4eae\u7684 PPT TonyCrane's Slide Template","title":"Reference"},{"location":"utils/shell/","text":"Shell \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 155 \u4e2a\u5b57 2 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684shell\u547d\u4ee4\uff0c\u4e0d\u662f\u5f88\u5168 \u547d\u4ee4 \u00b6 \u5220\u9664url\u76ee\u5f55\u4e0b\u6240\u6709name.cpp\u6587\u4ef6 $ find ${ url } -name 'name.cpp' -type f -print -exec rm -rf {} \\; \u4e00\u884c\u4ee3\u7801-\u89e3\u51b3\u4eba\u751f\u70e6\u607c wget http://fishros.com/install -O fishros && . fishros zsh \u00b6 \u5b89\u88c5 \u00b6 mac: \u81ea\u5e26 Linux \u4f7f\u7528\u5bf9\u5e94\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u5b89\u88c5 zsh \u5373\u53ef sudo apt install zsh \u67e5\u770b zsh \u8def\u5f84\uff1awhich zsh \u66f4\u6539\u9ed8\u8ba4 shell\uff1asudo chsh -s /usr/bin/zsh \u4e3b\u9898 \u00b6 \u5b89\u88c5 oh-my-zsh\uff08\u56db\u9009\u4e00\uff09 sh -c \"$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh )\" sh -c \"$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh )\" sh -c \"$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)\" sh -c \"$(wget -O- https://gitee.com/pocmon/mirrors/raw/master/tools/install.sh )\" \u4fee\u6539 awesomepanda \u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e ZSH_THEME \u4e3a \"awesomepanda\" \u63d2\u4ef6 \u00b6 \u81ea\u5e26 git \u63d2\u4ef6 zsh-autosuggestions\uff1agit clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions zsh-syntax-highlighting\uff1agit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \u7136\u540e\u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e plugins=(git zsh-autosuggestions zsh-syntax-highlighting)","title":"Shell \u547d\u4ee4\u76f8\u5173"},{"location":"utils/shell/#shell","text":"\u7ea6 155 \u4e2a\u5b57 2 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684shell\u547d\u4ee4\uff0c\u4e0d\u662f\u5f88\u5168","title":"Shell \u547d\u4ee4\u76f8\u5173"},{"location":"utils/shell/#_1","text":"\u5220\u9664url\u76ee\u5f55\u4e0b\u6240\u6709name.cpp\u6587\u4ef6 $ find ${ url } -name 'name.cpp' -type f -print -exec rm -rf {} \\; \u4e00\u884c\u4ee3\u7801-\u89e3\u51b3\u4eba\u751f\u70e6\u607c wget http://fishros.com/install -O fishros && . fishros","title":"\u547d\u4ee4"},{"location":"utils/shell/#zsh","text":"","title":"zsh"},{"location":"utils/shell/#_2","text":"mac: \u81ea\u5e26 Linux \u4f7f\u7528\u5bf9\u5e94\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u5b89\u88c5 zsh \u5373\u53ef sudo apt install zsh \u67e5\u770b zsh \u8def\u5f84\uff1awhich zsh \u66f4\u6539\u9ed8\u8ba4 shell\uff1asudo chsh -s /usr/bin/zsh","title":"\u5b89\u88c5"},{"location":"utils/shell/#_3","text":"\u5b89\u88c5 oh-my-zsh\uff08\u56db\u9009\u4e00\uff09 sh -c \"$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh )\" sh -c \"$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh )\" sh -c \"$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)\" sh -c \"$(wget -O- https://gitee.com/pocmon/mirrors/raw/master/tools/install.sh )\" \u4fee\u6539 awesomepanda \u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e ZSH_THEME \u4e3a \"awesomepanda\"","title":"\u4e3b\u9898"},{"location":"utils/shell/#_4","text":"\u81ea\u5e26 git \u63d2\u4ef6 zsh-autosuggestions\uff1agit clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions zsh-syntax-highlighting\uff1agit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \u7136\u540e\u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e plugins=(git zsh-autosuggestions zsh-syntax-highlighting)","title":"\u63d2\u4ef6"},{"location":"utils/utilsbox/","text":"\u5de5\u5177\u6536\u96c6 \u00b6 \u7ea6 428 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5404\u79cd\u7a00\u5947\u53e4\u602a\u7684\u5de5\u5177\uff0c\u5305\u62ec\u8bbe\u8ba1\u3001\u56fe\u50cf\u548c\u5b66\u4e60\u5de5\u5177\u7b49\u7b49 \u6301\u7eed\u66f4\u65b0\u4e2d... .md-typeset a:is(:focus,:hover) { opacity: 1; } .md-typeset a { color: var(--md-accent-fg-color); opacity: 0.8; } \u56fe\u50cf\u7c7b \u00b6 \u4f5c\u56fe \u00b6 \u98ce\u683c\u5934\u50cf\u5236\u4f5c Notion-avatar \u5728\u7ebf\u624b\u5199\u98ce\u683c\u4f5c\u56fe\u767d\u677f Excalidraw \u5728\u7ebf\u77e2\u91cf\u56fe\u4f5c\u56fe\u8f6f\u4ef6\uff08draw.io\uff09 app.diagrams.net \u5728\u7ebf\u56fe\u8bba\u4f5c\u56fe\u7f51\u7ad9 Graph Editor tikz \u6709\u9650\u72b6\u6001\u673a\u53ef\u89c6\u5316\u5236\u4f5c Finite State Machine Designer \u8bc6\u56fe \u00b6 SauceNAO \u4fee\u56fe \u00b6 \u79fb\u9664\u80cc\u666f\uff08\u5b8c\u5168\u514d\u8d39\uff09 RemoveBg \u7eaf\u524d\u7aef\u514d\u8d39\u56fe\u7247\u538b\u7f29 PicDiet \u56fe\u7247\u538b\u7f29\uff08\u9700\u4e0a\u4f20\uff09 DocSmall \u64e6\u9664\u56fe\u7247\u4e0a\u7269\u54c1\uff08\u514d\u8d39\u529f\u80fd\u53d7\u9650\uff09 cleanup.pictures \u8bbe\u8ba1\u7c7b \u00b6 \u914d\u8272 \u00b6 \u914d\u8272\u65b9\u6848\u7f51\u7ad9 Color Hunt \u914d\u8272\u65b9\u6848\u7f51\u7ad9\uff08\u5e26 Figma \u63d2\u4ef6\uff09 Coolors \u989c\u8272\u67e5\u627e\u53ca\u8f6c\u6362\u5de5\u5177 HexColor16 \u65e5\u5f0f\u4f20\u7edf\u989c\u8272\u5217\u8868 Nippon Colors \u65e5\u7cfb\u989c\u8272\u540d\u79f0\u5217\u8868\uff08 \u8272\u56fe\u7f51\u7ad9 \uff09 Color Site Flat UI \u914d\u8272\u65b9\u6848 Flat UI Colors \u56fe\u6807 \u00b6 \u5fbd\u7ae0 shields.io \u5404\u7cfb\u5217\u56fe\u6807\u5408\u96c6 icones \u56fe\u6807\u3001\u63d2\u56fe\u3001\u7167\u7247\u3001\u97f3\u4e50\u548c\u8bbe\u8ba1\u5de5\u5177 icons8 \u4ee3\u7801\u7c7b \u00b6 \u53ef\u89c6\u5316 \u00b6 \u6570\u636e\u7ed3\u6784-\u56fe\u7684\u53ef\u89c6\u5316 graph_editor \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 Regulex Python \u6267\u884c\u8fc7\u7a0b\u53ef\u89c6\u5316 PythonTutor GLSL \u6d41\u4f53\u573a\u53ef\u89c6\u5316 Field Play \u63d2\u4ef6 \u00b6 sublime\u7b97\u6cd5\u63d2\u4ef6 FastOlympicCoding \u5b66\u4e60\u5de5\u5177 \u00b6 \u7f16\u8bd1\u5668\u8d44\u6e90\u7ba1\u7406\u5668 comple explorer \u7f13\u52a8\u66f2\u7ebf Easing Function Cheat Sheet \u5927 O \u590d\u6742\u5ea6\u6bd4\u8f83\u67e5\u8be2 Big O Cheat Sheet C \u7c7b\u578b\u58f0\u660e\u8f6c\u82f1\u6587\u63cf\u8ff0 cdecl \u6570\u5b66\u7c7b \u00b6 \u6570\u5217\u67e5\u627e OEIS \u6570\u5b66\u516c\u5f0f Latex \u8d28\u6570\u68c0\u6d4b primenumbers \u6570\u5b66\u56fe\u50cf desmos \u4e92\u52a8\u51e0\u4f55\u8c1c\u9898 euclidea \u6570\u5b66\u6559\u5b66\u8f6f\u4ef6 GeoGebra \u5176\u4ed6 \u00b6 git\u63d0\u4ea4\u4fe1\u606f\u4e2d\u7684emoji gitmoji Emoji \u67e5\u8be2 EmojiAll \u8868\u60c5\u56fe\u6807\u767e\u79d1 emojipedia.org \u5de5\u5177\u96c6\u5408 MikuTools Unicode\u7f16\u7801 Unicode Youtube\u4e0b\u8f7d\u5668 yt1s \u6253\u5b57\u8bad\u7ec3 monkeytype PDFToPPT smallpdf Reference \u00b6 TonyCrane \u5de5\u5177\u6536\u96c6","title":"\u5de5\u5177\u6536\u96c6"},{"location":"utils/utilsbox/#_1","text":"\u7ea6 428 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5404\u79cd\u7a00\u5947\u53e4\u602a\u7684\u5de5\u5177\uff0c\u5305\u62ec\u8bbe\u8ba1\u3001\u56fe\u50cf\u548c\u5b66\u4e60\u5de5\u5177\u7b49\u7b49 \u6301\u7eed\u66f4\u65b0\u4e2d... .md-typeset a:is(:focus,:hover) { opacity: 1; } .md-typeset a { color: var(--md-accent-fg-color); opacity: 0.8; }","title":"\u5de5\u5177\u6536\u96c6"},{"location":"utils/utilsbox/#_2","text":"","title":"\u56fe\u50cf\u7c7b"},{"location":"utils/utilsbox/#_3","text":"\u98ce\u683c\u5934\u50cf\u5236\u4f5c Notion-avatar \u5728\u7ebf\u624b\u5199\u98ce\u683c\u4f5c\u56fe\u767d\u677f Excalidraw \u5728\u7ebf\u77e2\u91cf\u56fe\u4f5c\u56fe\u8f6f\u4ef6\uff08draw.io\uff09 app.diagrams.net \u5728\u7ebf\u56fe\u8bba\u4f5c\u56fe\u7f51\u7ad9 Graph Editor tikz \u6709\u9650\u72b6\u6001\u673a\u53ef\u89c6\u5316\u5236\u4f5c Finite State Machine Designer","title":"\u4f5c\u56fe"},{"location":"utils/utilsbox/#_4","text":"SauceNAO","title":"\u8bc6\u56fe"},{"location":"utils/utilsbox/#_5","text":"\u79fb\u9664\u80cc\u666f\uff08\u5b8c\u5168\u514d\u8d39\uff09 RemoveBg \u7eaf\u524d\u7aef\u514d\u8d39\u56fe\u7247\u538b\u7f29 PicDiet \u56fe\u7247\u538b\u7f29\uff08\u9700\u4e0a\u4f20\uff09 DocSmall \u64e6\u9664\u56fe\u7247\u4e0a\u7269\u54c1\uff08\u514d\u8d39\u529f\u80fd\u53d7\u9650\uff09 cleanup.pictures","title":"\u4fee\u56fe"},{"location":"utils/utilsbox/#_6","text":"","title":"\u8bbe\u8ba1\u7c7b"},{"location":"utils/utilsbox/#_7","text":"\u914d\u8272\u65b9\u6848\u7f51\u7ad9 Color Hunt \u914d\u8272\u65b9\u6848\u7f51\u7ad9\uff08\u5e26 Figma \u63d2\u4ef6\uff09 Coolors \u989c\u8272\u67e5\u627e\u53ca\u8f6c\u6362\u5de5\u5177 HexColor16 \u65e5\u5f0f\u4f20\u7edf\u989c\u8272\u5217\u8868 Nippon Colors \u65e5\u7cfb\u989c\u8272\u540d\u79f0\u5217\u8868\uff08 \u8272\u56fe\u7f51\u7ad9 \uff09 Color Site Flat UI \u914d\u8272\u65b9\u6848 Flat UI Colors","title":"\u914d\u8272"},{"location":"utils/utilsbox/#_8","text":"\u5fbd\u7ae0 shields.io \u5404\u7cfb\u5217\u56fe\u6807\u5408\u96c6 icones \u56fe\u6807\u3001\u63d2\u56fe\u3001\u7167\u7247\u3001\u97f3\u4e50\u548c\u8bbe\u8ba1\u5de5\u5177 icons8","title":"\u56fe\u6807"},{"location":"utils/utilsbox/#_9","text":"","title":"\u4ee3\u7801\u7c7b"},{"location":"utils/utilsbox/#_10","text":"\u6570\u636e\u7ed3\u6784-\u56fe\u7684\u53ef\u89c6\u5316 graph_editor \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 Regulex Python \u6267\u884c\u8fc7\u7a0b\u53ef\u89c6\u5316 PythonTutor GLSL \u6d41\u4f53\u573a\u53ef\u89c6\u5316 Field Play","title":"\u53ef\u89c6\u5316"},{"location":"utils/utilsbox/#_11","text":"sublime\u7b97\u6cd5\u63d2\u4ef6 FastOlympicCoding","title":"\u63d2\u4ef6"},{"location":"utils/utilsbox/#_12","text":"\u7f16\u8bd1\u5668\u8d44\u6e90\u7ba1\u7406\u5668 comple explorer \u7f13\u52a8\u66f2\u7ebf Easing Function Cheat Sheet \u5927 O \u590d\u6742\u5ea6\u6bd4\u8f83\u67e5\u8be2 Big O Cheat Sheet C \u7c7b\u578b\u58f0\u660e\u8f6c\u82f1\u6587\u63cf\u8ff0 cdecl","title":"\u5b66\u4e60\u5de5\u5177"},{"location":"utils/utilsbox/#_13","text":"\u6570\u5217\u67e5\u627e OEIS \u6570\u5b66\u516c\u5f0f Latex \u8d28\u6570\u68c0\u6d4b primenumbers \u6570\u5b66\u56fe\u50cf desmos \u4e92\u52a8\u51e0\u4f55\u8c1c\u9898 euclidea \u6570\u5b66\u6559\u5b66\u8f6f\u4ef6 GeoGebra","title":"\u6570\u5b66\u7c7b"},{"location":"utils/utilsbox/#_14","text":"git\u63d0\u4ea4\u4fe1\u606f\u4e2d\u7684emoji gitmoji Emoji \u67e5\u8be2 EmojiAll \u8868\u60c5\u56fe\u6807\u767e\u79d1 emojipedia.org \u5de5\u5177\u96c6\u5408 MikuTools Unicode\u7f16\u7801 Unicode Youtube\u4e0b\u8f7d\u5668 yt1s \u6253\u5b57\u8bad\u7ec3 monkeytype PDFToPPT smallpdf","title":"\u5176\u4ed6"},{"location":"utils/utilsbox/#reference","text":"TonyCrane \u5de5\u5177\u6536\u96c6","title":"Reference"}]} \ No newline at end of file +{"config":{"indexing":"full","lang":["en"],"min_search_length":3,"prebuild_index":false,"separator":"[\\s\\-]+"},"docs":[{"location":"","text":"o(\u3003'\u25bd'\u3003)o Hi! \u00b6 \u8fd9\u91cc\u662f\u72d9\u51fb\u7f8e\u4f50\uff08jujimeizuo\uff09\u7684\u4e2a\u4eba\u7b14\u8bb0\u672c\u54e6\uff01 \u6700\u8fd1\u66f4\u65b0 / \u670b\u53cb\u4eec! / \u7ad9\u70b9\u7edf\u8ba1 \u9875\u9762\u603b\u6570\uff1a133 \u603b\u5b57\u6570\uff1a159109 \u4ee3\u7801\u5757\u884c\u6570\uff1a3423 \u7f51\u7ad9\u8fd0\u884c\u65f6\u95f4\uff1a function updateTime() { var date = new Date(); var now = date.getTime(); var startDate = new Date(\"2023/08/026 17:26:00\"); var start = startDate.getTime(); var diff = now - start; var y, d, h, m; y = Math.floor(diff / (365 * 24 * 3600 * 1000)); diff -= y * 365 * 24 * 3600 * 1000; d = Math.floor(diff / (24 * 3600 * 1000)); h = Math.floor(diff / (3600 * 1000) % 24); m = Math.floor(diff / (60 * 1000) % 60); if (y == 0) { document.getElementById(\"web-time\").innerHTML = d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } else { document.getElementById(\"web-time\").innerHTML = y + \" \u5e74 \" + d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } setTimeout(updateTime, 1000 * 60); } updateTime(); function toggle_statistics() { var statistics = document.getElementById(\"statistics\"); if (statistics.style.opacity == 0) { statistics.style.opacity = 1; } else { statistics.style.opacity = 0; } }","title":"o(\u3003'\u25bd'\u3003)o Hi!"},{"location":"#oo-hi","text":"\u8fd9\u91cc\u662f\u72d9\u51fb\u7f8e\u4f50\uff08jujimeizuo\uff09\u7684\u4e2a\u4eba\u7b14\u8bb0\u672c\u54e6\uff01 \u6700\u8fd1\u66f4\u65b0 / \u670b\u53cb\u4eec! / \u7ad9\u70b9\u7edf\u8ba1 \u9875\u9762\u603b\u6570\uff1a133 \u603b\u5b57\u6570\uff1a159109 \u4ee3\u7801\u5757\u884c\u6570\uff1a3423 \u7f51\u7ad9\u8fd0\u884c\u65f6\u95f4\uff1a function updateTime() { var date = new Date(); var now = date.getTime(); var startDate = new Date(\"2023/08/026 17:26:00\"); var start = startDate.getTime(); var diff = now - start; var y, d, h, m; y = Math.floor(diff / (365 * 24 * 3600 * 1000)); diff -= y * 365 * 24 * 3600 * 1000; d = Math.floor(diff / (24 * 3600 * 1000)); h = Math.floor(diff / (3600 * 1000) % 24); m = Math.floor(diff / (60 * 1000) % 60); if (y == 0) { document.getElementById(\"web-time\").innerHTML = d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } else { document.getElementById(\"web-time\").innerHTML = y + \" \u5e74 \" + d + \" \u5929 \" + h + \" \u5c0f\u65f6 \" + m + \" \u5206\u949f\"; } setTimeout(updateTime, 1000 * 60); } updateTime(); function toggle_statistics() { var statistics = document.getElementById(\"statistics\"); if (statistics.style.opacity == 0) { statistics.style.opacity = 1; } else { statistics.style.opacity = 0; } }","title":"o(\u3003'\u25bd'\u3003)o Hi!"},{"location":"changelog/","text":"\u66f4\u65b0\u8bb0\u5f55 \u00b6 Abstract PS\uff1a\u8fd9\u4e2a\u529f\u80fd\u5728\u7531 TonyCrane/mkdocs-changelog-plugin \u5f00\u53d1\u3002 .md-typeset h2 { margin-top: 0em; } 2024 \u00b6 2024-10-13 \u00b6 CV > SLAM > Gaussian Splatting SLAM 2024-10-9 \u00b6 CV > SLAM > 4DGS 2024-10-5 \u00b6 CV > SLAM > SplaTAM 2024-9-27 \u00b6 Utils > ffmpeg 2024-9-26 \u00b6 add Experiments Section 2024-9-25 \u00b6 adjust the structure of slam CV > SLAM > 3DGS 2024-9-19 \u00b6 CV > SLAM > NeRF 2024-9-18 \u00b6 CV > SLAM > NeRF-Evaluation 2024-8-8 \u00b6 CV > SLAM > NICE-SLAM 2024-8-3 \u00b6 CV > SLAM > iMAP 2024-7-29 \u00b6 CV > SLAM > NID-SLAM 2024-7-8 \u00b6 CV > SLAM > EndoscpoyDepthEstimation 2024-6-26 \u00b6 CV > SLAM > DeepV2D 2024-6-21 \u00b6 CV > SLAM > Co-SLAM 2024-6-6 \u00b6 CV > SLAM > DDN-SLAM 2024-5-29 \u00b6 CV > Dataset > Waymo 2024-5-29 \u00b6 CV > Dataset > KITTI 2024-5-28 \u00b6 cp -r pcr prd/ 2024-5-17 \u00b6 CV > SLAM > LET-NET 2024-5-15 \u00b6 CV > SLAM > Crowd-SLAM 2024-4-4 \u00b6 CV > SLAM > RigidFusion 2024-3-27 \u00b6 CV > SLAM > Detect-SLAM 2024-3-26 \u00b6 CV > SLAM > FlowFusion 2024-3-20 \u00b6 CV > SLAM > DS-SLAM 2024-3-20 \u00b6 CV > SLAM > DynaSLAM 2024-3-20 \u00b6 CV > SLAM > ORB-SLAM2 2024-3-20 \u00b6 CV > Dataset > TUM 2024-1-24 \u00b6 LLM & LVM > Transformer > ViT 2024-1-22 \u00b6 CS > HPC > MPI \u57fa\u7840 2024-1-20 \u00b6 CS > HPC > OpenMP \u57fa\u7840 2024-1-20 \u00b6 LLM & LVM > InternLM > OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 2024-1-18 \u00b6 LLM & LVM > InternLM > LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 2024-1-11 \u00b6 LLM & LVM > InternLM > XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2024-1-8 \u00b6 LLM & LVM > InternLM > \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 2024-1-4 \u00b6 LLM & LVM > InternLM > \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 2024-1-3 \u00b6 LLM & LVM > InternLM > \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb 2023 \u00b6 2023-12-18 \u00b6 LLM & LVM > \u6742\u9879 > \u5206\u5e03\u5f0f\u8bad\u7ec3 2023-12-14 \u00b6 LLM & LVM > \u6742\u9879 > Prompt 2023-12-13 \u00b6 LLM & LVM > Transformer > BERT 2023-12-10 \u00b6 LLM & LVM > Transformer > Transformer 2023-12-09 \u00b6 LLM & LVM > Transformer > attention 2023-12-08 \u00b6 LLM & LVM > NLP > RNNs 2023-12-07 \u00b6 LLM & LVM > NLP > Word2Vec 2023-12-05 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > ICP 2023-12-04 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > \u524d\u7f6e\u77e5\u8bc6 2023-12-03 \u00b6 CV & Robot > \u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316 2023-10-09 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 2023-10-06 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2023-10-05 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5355\u89c6\u56fe\u51e0\u4f55 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 2023-10-04 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u6a21\u578b CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 2023-10-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 CV & Robot > SLAM > \u89c6\u89c9 SLAM \u5341\u56db\u8bb2 > \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 2023-09-30 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 3D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-17 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u76f4\u7ebf\u641c\u7d22 2023-09-24 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Python > Numpy 2023-09-22 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u673a\u5668\u5b66\u4e60 2023-09-17 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u6a21\u5f0f\u8bc6\u522b 2023-09-16 \u00b6 \u6570\u7406\u57fa\u7840 > \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 > \u77e9\u9635\u4ee3\u6570\u57fa\u7840 2023-09-13 \u00b6 CS > \u8f6f\u4ef6\u76f8\u5173 > \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 CS > \u8f6f\u4ef6\u76f8\u5173 > COM \u539f\u7406\u4e0e\u5e94\u7528 2023-09-12 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 CS > \u7b97\u6cd5\u76f8\u5173 > \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 2023-09-11 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u6700\u4f18\u5316\u95ee\u9898 2023-09-10 \u00b6 Utils > \u7ad9\u70b9\u751f\u6210\u5de5\u5177 > reveal-md 2023-09-09 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Go > Go \u8bed\u6cd5\u57fa\u7840 2023-09-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 2D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-01 \u00b6 Utils > \u5de5\u5177\u6536\u96c6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Docker \u547d\u4ee4\u76f8\u5173 \u65b0\u589e awesome_git_log \u547d\u4ee4 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Shell \u547d\u4ee4\u76f8\u5173 2023-08-30 \u00b6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > gdb \u547d\u4ee4\u76f8\u5173 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Git \u547d\u4ee4\u76f8\u5173 2023-08-26 \u00b6 init notebook","title":"\u66f4\u65b0\u8bb0\u5f55"},{"location":"changelog/#_1","text":"Abstract PS\uff1a\u8fd9\u4e2a\u529f\u80fd\u5728\u7531 TonyCrane/mkdocs-changelog-plugin \u5f00\u53d1\u3002 .md-typeset h2 { margin-top: 0em; }","title":"\u66f4\u65b0\u8bb0\u5f55"},{"location":"changelog/#2024","text":"2024-10-13 \u00b6 CV > SLAM > Gaussian Splatting SLAM 2024-10-9 \u00b6 CV > SLAM > 4DGS 2024-10-5 \u00b6 CV > SLAM > SplaTAM 2024-9-27 \u00b6 Utils > ffmpeg 2024-9-26 \u00b6 add Experiments Section 2024-9-25 \u00b6 adjust the structure of slam CV > SLAM > 3DGS 2024-9-19 \u00b6 CV > SLAM > NeRF 2024-9-18 \u00b6 CV > SLAM > NeRF-Evaluation 2024-8-8 \u00b6 CV > SLAM > NICE-SLAM 2024-8-3 \u00b6 CV > SLAM > iMAP 2024-7-29 \u00b6 CV > SLAM > NID-SLAM 2024-7-8 \u00b6 CV > SLAM > EndoscpoyDepthEstimation 2024-6-26 \u00b6 CV > SLAM > DeepV2D 2024-6-21 \u00b6 CV > SLAM > Co-SLAM 2024-6-6 \u00b6 CV > SLAM > DDN-SLAM 2024-5-29 \u00b6 CV > Dataset > Waymo 2024-5-29 \u00b6 CV > Dataset > KITTI 2024-5-28 \u00b6 cp -r pcr prd/ 2024-5-17 \u00b6 CV > SLAM > LET-NET 2024-5-15 \u00b6 CV > SLAM > Crowd-SLAM 2024-4-4 \u00b6 CV > SLAM > RigidFusion 2024-3-27 \u00b6 CV > SLAM > Detect-SLAM 2024-3-26 \u00b6 CV > SLAM > FlowFusion 2024-3-20 \u00b6 CV > SLAM > DS-SLAM 2024-3-20 \u00b6 CV > SLAM > DynaSLAM 2024-3-20 \u00b6 CV > SLAM > ORB-SLAM2 2024-3-20 \u00b6 CV > Dataset > TUM 2024-1-24 \u00b6 LLM & LVM > Transformer > ViT 2024-1-22 \u00b6 CS > HPC > MPI \u57fa\u7840 2024-1-20 \u00b6 CS > HPC > OpenMP \u57fa\u7840 2024-1-20 \u00b6 LLM & LVM > InternLM > OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 2024-1-18 \u00b6 LLM & LVM > InternLM > LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 2024-1-11 \u00b6 LLM & LVM > InternLM > XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2024-1-8 \u00b6 LLM & LVM > InternLM > \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 2024-1-4 \u00b6 LLM & LVM > InternLM > \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 2024-1-3 \u00b6 LLM & LVM > InternLM > \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb","title":"2024"},{"location":"changelog/#2023","text":"2023-12-18 \u00b6 LLM & LVM > \u6742\u9879 > \u5206\u5e03\u5f0f\u8bad\u7ec3 2023-12-14 \u00b6 LLM & LVM > \u6742\u9879 > Prompt 2023-12-13 \u00b6 LLM & LVM > Transformer > BERT 2023-12-10 \u00b6 LLM & LVM > Transformer > Transformer 2023-12-09 \u00b6 LLM & LVM > Transformer > attention 2023-12-08 \u00b6 LLM & LVM > NLP > RNNs 2023-12-07 \u00b6 LLM & LVM > NLP > Word2Vec 2023-12-05 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > ICP 2023-12-04 \u00b6 CV & Robot > \u70b9\u4e91\u914d\u51c6 > \u524d\u7f6e\u77e5\u8bc6 2023-12-03 \u00b6 CV & Robot > \u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316 2023-10-09 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 2023-10-06 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2023-10-05 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u5355\u89c6\u56fe\u51e0\u4f55 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 2023-10-04 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u6444\u50cf\u673a\u6a21\u578b CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 2023-10-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 CV & Robot > SLAM > \u89c6\u89c9 SLAM \u5341\u56db\u8bb2 > \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 2023-09-30 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 3D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-17 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u76f4\u7ebf\u641c\u7d22 2023-09-24 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Python > Numpy 2023-09-22 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u673a\u5668\u5b66\u4e60 2023-09-17 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u6a21\u5f0f\u8bc6\u522b 2023-09-16 \u00b6 \u6570\u7406\u57fa\u7840 > \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 > \u77e9\u9635\u4ee3\u6570\u57fa\u7840 2023-09-13 \u00b6 CS > \u8f6f\u4ef6\u76f8\u5173 > \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 CS > \u8f6f\u4ef6\u76f8\u5173 > COM \u539f\u7406\u4e0e\u5e94\u7528 2023-09-12 \u00b6 CS > \u4eba\u5de5\u667a\u80fd > \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 CS > \u7b97\u6cd5\u76f8\u5173 > \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 2023-09-11 \u00b6 \u6570\u7406\u57fa\u7840 > \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 > \u6700\u4f18\u5316\u95ee\u9898 2023-09-10 \u00b6 Utils > \u7ad9\u70b9\u751f\u6210\u5de5\u5177 > reveal-md 2023-09-09 \u00b6 CS > \u7f16\u7a0b\u8bed\u8a00 > Go > Go \u8bed\u6cd5\u57fa\u7840 2023-09-03 \u00b6 CV & Robot > \u591a\u89c6\u56fe\u51e0\u4f55 > 2D \u5c04\u5f71\u51e0\u4f55\u53d8\u6362 2023-09-01 \u00b6 Utils > \u5de5\u5177\u6536\u96c6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Docker \u547d\u4ee4\u76f8\u5173 \u65b0\u589e awesome_git_log \u547d\u4ee4 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Shell \u547d\u4ee4\u76f8\u5173 2023-08-30 \u00b6 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > gdb \u547d\u4ee4\u76f8\u5173 Utils > \u547d\u4ee4\u884c\u5de5\u5177 > Git \u547d\u4ee4\u76f8\u5173 2023-08-26 \u00b6 init notebook","title":"2023"},{"location":"links/","text":"\u53cb\u94fe \u00b6 Abstract \u4e00\u4e9b\u670b\u53cb\u4eec\u7684\u7b14\u8bb0\u672c\uff01 \u9e64\u7fd4\u4e07\u91cc\u7684\u7b14\u8bb0\u672c \u975e\u5e38\u5389\u5bb3\u7684\uff08\u6d59\u5927\uff09\u5927\u4f6c","title":"\u53cb\u94fe"},{"location":"links/#_1","text":"Abstract \u4e00\u4e9b\u670b\u53cb\u4eec\u7684\u7b14\u8bb0\u672c\uff01 \u9e64\u7fd4\u4e07\u91cc\u7684\u7b14\u8bb0\u672c \u975e\u5e38\u5389\u5bb3\u7684\uff08\u6d59\u5927\uff09\u5927\u4f6c","title":"\u53cb\u94fe"},{"location":"todo/","text":"\u4ee3\u529e\u4e8b\u9879 \u00b6 \u7b14\u8bb0\u7c7b \u00b6","title":"\u4ee3\u529e\u4e8b\u9879"},{"location":"todo/#_1","text":"","title":"\u4ee3\u529e\u4e8b\u9879"},{"location":"todo/#_2","text":"","title":"\u7b14\u8bb0\u7c7b"},{"location":"cs/","text":"Computer Science \u00b6 Abstract \u8fd9\u91cc\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u7f16\u7a0b\u8bed\u8a00 C/C++ 13673 123 46 mins 1696750316 Java 3624 196 15 mins 1696750316 Python 8344 379 33 mins 1695693389 Go 3109 158 12 mins 1693968663 \u7b97\u6cd5\u76f8\u5173 \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 880 4 3 mins 1694529146 \u57fa\u7840\u6570\u636e\u7ed3\u6784 0 0 mins 1694405747 \u4eba\u5de5\u667a\u80fd\u57fa\u7840 \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 1192 4 mins 1698116017 \u673a\u5668\u5b66\u4e60 3054 4 10 mins 1697810855 \u6a21\u5f0f\u8bc6\u522b 3657 12 mins 1697363454 \u9ad8\u6027\u80fd\u8ba1\u7b97 MPI \u57fa\u7840 2268 196 10 mins 1705904815 OpenMP \u57fa\u7840 1767 38 6 mins 1705758864 \u6982\u8bba 568 24 2 mins 1695215167 \u5411\u91cf\u5316\u8ba1\u7b97 5 0 mins 1695215167 GPU \u7f16\u7a0b 3 0 mins 1695215167 \u8f6f\u4ef6\u76f8\u5173 COM \u539f\u7406\u4e0e\u5e94\u7528 1112 4 mins 1697007017 \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 5148 17 mins 1696920634 \u8bbe\u8ba1\u6a21\u5f0f 2116 496 13 mins 1695204141 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0 0 0 mins 1695089803 \u6570\u636e\u5e93 MySQL 5224 14 18 mins 1694949283 Redis 1787 102 7 mins 1694949283 \u6742\u9879 RegEx \u6b63\u5219\u8868\u8fbe\u5f0f 2402 4 8 mins 1694699468 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Computer Science"},{"location":"cs/#computer-science","text":"Abstract \u8fd9\u91cc\u662f\u8ba1\u7b97\u673a\u79d1\u5b66\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0","title":"Computer Science"},{"location":"cs/#table-of-contents","text":"\u7f16\u7a0b\u8bed\u8a00 C/C++ 13673 123 46 mins 1696750316 Java 3624 196 15 mins 1696750316 Python 8344 379 33 mins 1695693389 Go 3109 158 12 mins 1693968663 \u7b97\u6cd5\u76f8\u5173 \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 880 4 3 mins 1694529146 \u57fa\u7840\u6570\u636e\u7ed3\u6784 0 0 mins 1694405747 \u4eba\u5de5\u667a\u80fd\u57fa\u7840 \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 1192 4 mins 1698116017 \u673a\u5668\u5b66\u4e60 3054 4 10 mins 1697810855 \u6a21\u5f0f\u8bc6\u522b 3657 12 mins 1697363454 \u9ad8\u6027\u80fd\u8ba1\u7b97 MPI \u57fa\u7840 2268 196 10 mins 1705904815 OpenMP \u57fa\u7840 1767 38 6 mins 1705758864 \u6982\u8bba 568 24 2 mins 1695215167 \u5411\u91cf\u5316\u8ba1\u7b97 5 0 mins 1695215167 GPU \u7f16\u7a0b 3 0 mins 1695215167 \u8f6f\u4ef6\u76f8\u5173 COM \u539f\u7406\u4e0e\u5e94\u7528 1112 4 mins 1697007017 \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 5148 17 mins 1696920634 \u8bbe\u8ba1\u6a21\u5f0f 2116 496 13 mins 1695204141 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0 0 0 mins 1695089803 \u6570\u636e\u5e93 MySQL 5224 14 18 mins 1694949283 Redis 1787 102 7 mins 1694949283 \u6742\u9879 RegEx \u6b63\u5219\u8868\u8fbe\u5f0f 2402 4 8 mins 1694699468 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"cs/ai/dl/","text":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60 \u00b6 \u7ea6 1188 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u90b1\u9521\u9e4f\u8001\u5e08 \u7684\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff0c\u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u7b14\u8bb0\u3002 \u6982\u8ff0 \u00b6 \u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\u662f\u4eba\u5de5\u667a\u80fd\u7684\u4e00\u4e2a\u5b50\u9886\u57df \u795e\u7ecf\u7f51\u7edc\uff1a\u4e00\u79cd\u4ee5\uff08\u4eba\u5de5\uff09\u795e\u7ecf\u5143\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b \u6df1\u5ea6\u5b66\u4e60\uff1a\u4e00\u7c7b\u673a\u5668\u5b66\u4e60\u95ee\u9898\uff0c\u4e3b\u8981\u89e3\u51b3\u8d21\u732e\u5ea6\u5206\u914d\u95ee\u9898\u3002 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc \u00b6 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u4e3b\u8981\u7531\u5927\u91cf\u7684\u795e\u7ecf\u5143\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u6709\u5411\u8fde\u63a5\u6784\u6210\u3002\u56e0\u6b64\u8003\u8651\u4e09\u65b9\u9762 \u795e\u7ecf\u5143\u7684\u6fc0\u6d3b\u89c4\u5219 \uff1a\u4e3b\u8981\u662f\u6307\u795e\u7ecf\u5143\u8f93\u5165\u5230\u8f93\u51fa\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u4e00\u822c\u4e3a\u975e\u7ebf\u6027\u51fd\u6570 \u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784 \uff1a\u4e0d\u540c\u795e\u7ecf\u5143\u4e4b\u95f4\u7684\u94fe\u63a5\u5173\u7cfb \u5b66\u4e60\u7b97\u6cd5 \uff1a\u901a\u8fc7\u8bad\u7ec3\u6570\u636e\u6765\u5b66\u4e60\u795e\u7ecf\u7f51\u7edc\u7684\u53c2\u6570 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u7531\u795e\u7ecf\u5143\u6a21\u578b\u6784\u6210\uff0c\u8fd9\u79cd\u7531\u8bb8\u591a\u795e\u7ecf\u5143\u7ec4\u6210\u7684\u4fe1\u606f\u5904\u7406\u7f51\u7edc\u5177\u6709\u5e76\u884c\u5206\u5e03\u7ed3\u6784 \u524d\u9988\u795e\u7ecf\u7f51\u7edc \u00b6 \u7f51\u7edc\u7ed3\u6784 \u00b6 \u5728\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u4e2d\uff0c\u5404\u795e\u7ecf\u5143\u5206\u522b\u5c5e\u4e8e\u4e0d\u540c\u7684\u5c42\u3002\u6574\u4e2a\u7f51\u7edc\u4e2d\u65e0\u53cd\u9988\uff0c\u4fe1\u53f7\u4ece\u8f93\u5165\u5c42\u5411\u8f93\u51fa\u5c42\u5355\u5411\u4f20\u64ad\uff0c\u53ef\u7528\u4e00\u4e2a\u6709\u5411\u65e0\u73af\u56fe\u8868\u793a \u901a\u7528\u8fd1\u4f3c\u5b9a\u7406 \u00b6 \u5bf9\u4e8e\u5177\u6709 \u7ebf\u6027\u8f93\u51fa\u5c42 \u548c\u81f3\u5c11\u4e00\u4e2a\u4f7f\u7528\u201d\u6324\u538b\u201c\u6027\u8d28\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u9690\u85cf\u5c42\u7ec4\u6210\u7684\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u3002\u53ea\u8981\u5176\u9690\u85cf\u5c42\u795e\u7ecf\u5143\u7684\u6570\u91cf\u8db3\u591f\uff0c\u5b83\u53ef\u4ee5\u4ee5 \u4efb\u610f\u7cbe\u5ea6 \u6765\u8fd1\u4f3c\u4efb\u4f55\u4ece\u4e00\u4e2a\u5b9a\u4e49\u5728 \u5b9e\u6570\u7a7a\u95f4 \u4e2d\u7684 \u6709\u754c\u95ed\u96c6\u51fd\u6570 \u5e94\u7528\u5230\u673a\u5668\u5b66\u4e60 \u00b6 \u6a21\u578b\uff1a \\(y=f^5(f^4(f^3(f^2(f^1(x)))))\\) \u5b66\u4e60\u51c6\u5219\uff1a \\(L(y,y^*)\\) \u4f18\u5316\uff08\u68af\u5ea6\u4e0b\u964d\uff09\uff1a \\(\\frac{\\partial L(y,y^*)}{\\partial f^1} = \\frac{\\partial f^2}{\\partial f^1} \\times \\frac{\\partial f^3}{\\partial f^2} \\times \\frac{\\partial f^4}{\\partial f^3} \\times \\frac{\\partial f^5}{\\partial f^4} \\times \\frac{\\partial L(y,y^*)}{\\partial f^5}\\) \u8ba1\u7b97\u56fe\u4e0e\u81ea\u52a8\u5fae\u5206 \u00b6 \u590d\u5408\u51fd\u6570 \\(f(x;w,b)=\\sigma(wx+b)\\) \u7684\u8ba1\u7b97\u56fe \u94fe\u5f0f\u6cd5\u5219\uff1a \\(\\frac{\\partial f(x;w,b)}{\\partial w}=\\frac{\\partial f(x;w,b)}{\\partial h_6} \\frac{\\partial h_6}{\\partial h_5} \\frac{\\partial h_5}{\\partial h_4} \\frac{\\partial h_4}{\\partial h_3} \\frac{\\partial h_3}{\\partial h_2} \\frac{\\partial h_2}{\\partial h_1} \\frac{\\partial h_1}{\\partial w}\\) \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u53ea\u662f\u81ea\u52a8\u5fae\u5206\u7684\u4e00\u79cd\u7279\u6b8a\u5f62\u5f0f \u4f18\u5316\u95ee\u9898 \u00b6 \u975e\u51f8\u4f18\u5316\u95ee\u9898 \uff1a \\(y=\\sigma(w \\ 2 \\ \\sigma(w \\ 1 \\ x))\\) \u7684\u635f\u5931\u51fd\u6570 \u68af\u5ea6\u6d88\u5931\u95ee\u9898 \uff1a\u5728\u6bcf\u4e00\u5c42\u90fd\u8981\u4e58\u4ee5\u8be5\u5c42\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u5bfc\u6570 \u6fc0\u6d3b\u51fd\u6570 \u00b6 \u6709\u6548\u51cf\u8f7b\u68af\u5ea6\u6d88\u5931\u95ee\u9898 \u5377\u79ef\u795e\u7ecf\u7f51\u7edc \u00b6 \u5377\u79ef \u00b6 \u5377\u79ef\u7ecf\u5e38\u7528\u5728\u4fe1\u53f7\u5904\u7406\u4e2d\uff0c\u7528\u4e8e\u8ba1\u7b97\u4fe1\u53f7\u7684\u5ef6\u8fdf\u7d2f\u79ef \u5047\u8bbe\u4e00\u4e2a\u4fe1\u53f7\u53d1\u751f\u5668\u6bcf\u4e2a\u65f6\u523b t \u4ea7\u751f\u4e00\u4e2a\u4fe1\u53f7 \\(x_t\\) \uff0c\u5176\u4fe1\u53f7\u7684\u8870\u51cf\u7387\u4e3a \\(w_k\\) \uff0c\u5373\u5728 k-1 \u4e2a\u65f6\u95f4\u6b65\u957f\u540e\uff0c\u4fe1\u606f\u4e3a\u539f\u6765\u7684 \\(w_k\\) \u500d\uff0c\u5047\u8bbe \\(w_1=1,w_2=1/2,w_3=1/4\\) \u65f6\u523b t \u6536\u5230\u7684\u4fe1\u53f7 \\(y_t\\) \u4e3a\u5f53\u524d\u65f6\u523b\u4ea7\u751f\u7684\u4fe1\u606f\u548c\u4ee5\u524d\u65f6\u523b\u5ef6\u8fdf\u4fe1\u606f\u7684\u53e0\u52a0 \u5373 \\(y_t=w_1 \\times x_t+w_2 \\times x_{t-1}+w_3 \\times x_{t-2}=\\sum_{k=1}^3w_k \\cdot x_{t-k+1}\\) \uff0c \\(y_t\\) \u79f0\u4e3a\u6ee4\u6ce2\u5668\u6216\u5377\u79ef\u6838 \u4e00\u7ef4\u5377\u79ef \u00b6 \u4e8c\u4f4d\u5377\u79ef \u00b6 \u4f5c\u7528 \u00b6 \u5377\u79ef\u4f5c\u4e3a\u7279\u5f81\u63d0\u53d6\u5668 \u5377\u79ef\u4ee3\u66ff\u5168\u8fde\u63a5 \u53ef\u4ee5\u5f15\u5165\u591a\u7ec4\u6ee4\u6ce2\u5668 \u5377\u79ef\u5c42 \u5178\u578b\u7684\u5377\u79ef\u5c42\u4e3a 3 \u7ef4\u7ed3\u6784 \u6c47\u805a\u5c42 \u5377\u79ef\u5c42\u867d\u7136\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u8fde\u63a5\u7684\u4e2a\u6570\uff0c\u4f46\u662f\u6bcf\u4e00\u4e2a\u7279\u5f81\u6620\u5c04\u7684\u795e\u7ecf\u5143\u4e2a\u6570\u5e76\u6ca1\u6709\u663e\u8457\u51cf\u5c11 \u5377\u79ef\u7f51\u7edc\u7ed3\u6784 \u00b6 \u5377\u79ef\u7f51\u7edc\u662f\u7531\u5377\u79ef\u5c42\u3001\u5b50\u91c7\u6837\u5c42\u3001\u5168\u8fde\u63a5\u5c42\u4ea4\u53c9\u5806\u53e0\u800c\u6210 \u8d8b\u5411\u4e8e\u5c0f\u5377\u79ef\u3001\u5927\u6df1\u5ea6 \u8d8b\u5411\u4e8e\u5168\u5377\u79ef \u4e00\u4e2a\u5377\u79ef\u5757\u4e3a\u8fde\u7eed\u4e2a M \u4e2a\u5377\u79ef\u5c42\u548c b \u4e2a\u6c47\u805a\u5c42\uff08M \u901a\u5e38\u8bbe\u7f6e\u4e3a 2-5\uff0cb \u4e3a 0 \u6216 1\uff09\u3002\u4e00\u4e2a\u5377\u79ef\u7f51\u7edc\u4e2d\u53ef\u4ee5\u5806\u53e0 N \u4e2a\u8fde\u7eed\u7684\u5377\u79ef\u5757\uff0c\u7136\u540e\u5728\u63a5\u7740 K \u4e2a\u5168\u8fde\u63a5\u5c42\uff08N \u7684\u53d6\u503c\u533a\u95f4\u6bd4\u8f83\u5927\uff0c\u6bd4\u5982 1-100 \u6216\u8005\u66f4\u5927\uff1bK \u4e00\u822c\u4e3a 0-2\uff09 \u8f6c\u7f6e\u5377\u79ef/\u5fae\u6b65\u5377\u79ef \u00b6 \u4f4e\u7ef4\u7279\u5f81\u6620\u5c04\u5230\u9ad8\u7ef4\u7279\u5f81 \u7a7a\u6d1e\u5377\u79ef \u00b6 \u5982\u4f55\u589e\u52a0\u8f93\u51fa\u5355\u4f4d\u7684\u611f\u53d7\u91ce \u589e\u52a0\u5377\u79ef\u6838\u7684\u5927\u5c0f \u589e\u52a0\u5c42\u6570\u6765\u5b9e\u73b0 \u5728\u5377\u79ef\u4e4b\u524d\u8fdb\u884c\u6c47\u805a\u64cd\u4f5c \u7a7a\u6d1e\u5377\u79ef\u901a\u8fc7\u7ed9\u5377\u79ef\u6838\u63d2\u5165\u201c\u7a7a\u6d1e\u201d\u6765\u53d8\u76f8\u5730\u589e\u52a0\u5176\u5927\u5c0f \u7b80\u5355\u7684\u6b8b\u5dee\u5355\u5143\u7ed3\u6784 \u00b6 \\[ h(\\mathbf{x})=\\mathbf{x}+(h(\\mathbf{x})-\\mathbf{x}) \\\\ \\mathbf{x} \u4e3a\u6052\u7b49\u51fd\u6570\uff0ch(\\mathbf{x})-\\mathbf{x} \u4e3a\u6b8b\u5dee\u51fd\u6570 f(\\mathbf{x}, \\theta) \\] \u5e94\u7528 \u00b6 AlphaGo Mask RCNN \u56fe\u50cf\u751f\u6210 Deep Dream \u753b\u98ce\u8fc1\u79fb \u5bf9\u6297\u6837\u672c Reference \u00b6 \u90b1\u9521\u9e4f,\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60,\u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e, 2020\uff0cISBN 9787111649687 \u963f\u65af\u987f\u00b7\u5f20\u7b49,\u52a8\u624b\u5b66\u6df1\u5ea6\u5b66\u4e60, ISBN: 9787115505835","title":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60"},{"location":"cs/ai/dl/#_1","text":"\u7ea6 1188 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u90b1\u9521\u9e4f\u8001\u5e08 \u7684\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff0c\u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u7b14\u8bb0\u3002","title":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60"},{"location":"cs/ai/dl/#_2","text":"\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60\u662f\u4eba\u5de5\u667a\u80fd\u7684\u4e00\u4e2a\u5b50\u9886\u57df \u795e\u7ecf\u7f51\u7edc\uff1a\u4e00\u79cd\u4ee5\uff08\u4eba\u5de5\uff09\u795e\u7ecf\u5143\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b \u6df1\u5ea6\u5b66\u4e60\uff1a\u4e00\u7c7b\u673a\u5668\u5b66\u4e60\u95ee\u9898\uff0c\u4e3b\u8981\u89e3\u51b3\u8d21\u732e\u5ea6\u5206\u914d\u95ee\u9898\u3002","title":"\u6982\u8ff0"},{"location":"cs/ai/dl/#_3","text":"\u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u4e3b\u8981\u7531\u5927\u91cf\u7684\u795e\u7ecf\u5143\u4ee5\u53ca\u5b83\u4eec\u4e4b\u95f4\u7684\u6709\u5411\u8fde\u63a5\u6784\u6210\u3002\u56e0\u6b64\u8003\u8651\u4e09\u65b9\u9762 \u795e\u7ecf\u5143\u7684\u6fc0\u6d3b\u89c4\u5219 \uff1a\u4e3b\u8981\u662f\u6307\u795e\u7ecf\u5143\u8f93\u5165\u5230\u8f93\u51fa\u4e4b\u95f4\u7684\u6620\u5c04\u5173\u7cfb\uff0c\u4e00\u822c\u4e3a\u975e\u7ebf\u6027\u51fd\u6570 \u7f51\u7edc\u7684\u62d3\u6251\u7ed3\u6784 \uff1a\u4e0d\u540c\u795e\u7ecf\u5143\u4e4b\u95f4\u7684\u94fe\u63a5\u5173\u7cfb \u5b66\u4e60\u7b97\u6cd5 \uff1a\u901a\u8fc7\u8bad\u7ec3\u6570\u636e\u6765\u5b66\u4e60\u795e\u7ecf\u7f51\u7edc\u7684\u53c2\u6570 \u4eba\u5de5\u795e\u7ecf\u7f51\u7edc\u7531\u795e\u7ecf\u5143\u6a21\u578b\u6784\u6210\uff0c\u8fd9\u79cd\u7531\u8bb8\u591a\u795e\u7ecf\u5143\u7ec4\u6210\u7684\u4fe1\u606f\u5904\u7406\u7f51\u7edc\u5177\u6709\u5e76\u884c\u5206\u5e03\u7ed3\u6784","title":"\u4eba\u5de5\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/dl/#_4","text":"","title":"\u524d\u9988\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/dl/#_5","text":"\u5728\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u4e2d\uff0c\u5404\u795e\u7ecf\u5143\u5206\u522b\u5c5e\u4e8e\u4e0d\u540c\u7684\u5c42\u3002\u6574\u4e2a\u7f51\u7edc\u4e2d\u65e0\u53cd\u9988\uff0c\u4fe1\u53f7\u4ece\u8f93\u5165\u5c42\u5411\u8f93\u51fa\u5c42\u5355\u5411\u4f20\u64ad\uff0c\u53ef\u7528\u4e00\u4e2a\u6709\u5411\u65e0\u73af\u56fe\u8868\u793a","title":"\u7f51\u7edc\u7ed3\u6784"},{"location":"cs/ai/dl/#_6","text":"\u5bf9\u4e8e\u5177\u6709 \u7ebf\u6027\u8f93\u51fa\u5c42 \u548c\u81f3\u5c11\u4e00\u4e2a\u4f7f\u7528\u201d\u6324\u538b\u201c\u6027\u8d28\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u9690\u85cf\u5c42\u7ec4\u6210\u7684\u524d\u9988\u795e\u7ecf\u7f51\u7edc\u3002\u53ea\u8981\u5176\u9690\u85cf\u5c42\u795e\u7ecf\u5143\u7684\u6570\u91cf\u8db3\u591f\uff0c\u5b83\u53ef\u4ee5\u4ee5 \u4efb\u610f\u7cbe\u5ea6 \u6765\u8fd1\u4f3c\u4efb\u4f55\u4ece\u4e00\u4e2a\u5b9a\u4e49\u5728 \u5b9e\u6570\u7a7a\u95f4 \u4e2d\u7684 \u6709\u754c\u95ed\u96c6\u51fd\u6570","title":"\u901a\u7528\u8fd1\u4f3c\u5b9a\u7406"},{"location":"cs/ai/dl/#_7","text":"\u6a21\u578b\uff1a \\(y=f^5(f^4(f^3(f^2(f^1(x)))))\\) \u5b66\u4e60\u51c6\u5219\uff1a \\(L(y,y^*)\\) \u4f18\u5316\uff08\u68af\u5ea6\u4e0b\u964d\uff09\uff1a \\(\\frac{\\partial L(y,y^*)}{\\partial f^1} = \\frac{\\partial f^2}{\\partial f^1} \\times \\frac{\\partial f^3}{\\partial f^2} \\times \\frac{\\partial f^4}{\\partial f^3} \\times \\frac{\\partial f^5}{\\partial f^4} \\times \\frac{\\partial L(y,y^*)}{\\partial f^5}\\)","title":"\u5e94\u7528\u5230\u673a\u5668\u5b66\u4e60"},{"location":"cs/ai/dl/#_8","text":"\u590d\u5408\u51fd\u6570 \\(f(x;w,b)=\\sigma(wx+b)\\) \u7684\u8ba1\u7b97\u56fe \u94fe\u5f0f\u6cd5\u5219\uff1a \\(\\frac{\\partial f(x;w,b)}{\\partial w}=\\frac{\\partial f(x;w,b)}{\\partial h_6} \\frac{\\partial h_6}{\\partial h_5} \\frac{\\partial h_5}{\\partial h_4} \\frac{\\partial h_4}{\\partial h_3} \\frac{\\partial h_3}{\\partial h_2} \\frac{\\partial h_2}{\\partial h_1} \\frac{\\partial h_1}{\\partial w}\\) \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u53ea\u662f\u81ea\u52a8\u5fae\u5206\u7684\u4e00\u79cd\u7279\u6b8a\u5f62\u5f0f","title":"\u8ba1\u7b97\u56fe\u4e0e\u81ea\u52a8\u5fae\u5206"},{"location":"cs/ai/dl/#_9","text":"\u975e\u51f8\u4f18\u5316\u95ee\u9898 \uff1a \\(y=\\sigma(w \\ 2 \\ \\sigma(w \\ 1 \\ x))\\) \u7684\u635f\u5931\u51fd\u6570 \u68af\u5ea6\u6d88\u5931\u95ee\u9898 \uff1a\u5728\u6bcf\u4e00\u5c42\u90fd\u8981\u4e58\u4ee5\u8be5\u5c42\u7684\u6fc0\u6d3b\u51fd\u6570\u7684\u5bfc\u6570","title":"\u4f18\u5316\u95ee\u9898"},{"location":"cs/ai/dl/#_10","text":"\u6709\u6548\u51cf\u8f7b\u68af\u5ea6\u6d88\u5931\u95ee\u9898","title":"\u6fc0\u6d3b\u51fd\u6570"},{"location":"cs/ai/dl/#_11","text":"","title":"\u5377\u79ef\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/dl/#_12","text":"\u5377\u79ef\u7ecf\u5e38\u7528\u5728\u4fe1\u53f7\u5904\u7406\u4e2d\uff0c\u7528\u4e8e\u8ba1\u7b97\u4fe1\u53f7\u7684\u5ef6\u8fdf\u7d2f\u79ef \u5047\u8bbe\u4e00\u4e2a\u4fe1\u53f7\u53d1\u751f\u5668\u6bcf\u4e2a\u65f6\u523b t \u4ea7\u751f\u4e00\u4e2a\u4fe1\u53f7 \\(x_t\\) \uff0c\u5176\u4fe1\u53f7\u7684\u8870\u51cf\u7387\u4e3a \\(w_k\\) \uff0c\u5373\u5728 k-1 \u4e2a\u65f6\u95f4\u6b65\u957f\u540e\uff0c\u4fe1\u606f\u4e3a\u539f\u6765\u7684 \\(w_k\\) \u500d\uff0c\u5047\u8bbe \\(w_1=1,w_2=1/2,w_3=1/4\\) \u65f6\u523b t \u6536\u5230\u7684\u4fe1\u53f7 \\(y_t\\) \u4e3a\u5f53\u524d\u65f6\u523b\u4ea7\u751f\u7684\u4fe1\u606f\u548c\u4ee5\u524d\u65f6\u523b\u5ef6\u8fdf\u4fe1\u606f\u7684\u53e0\u52a0 \u5373 \\(y_t=w_1 \\times x_t+w_2 \\times x_{t-1}+w_3 \\times x_{t-2}=\\sum_{k=1}^3w_k \\cdot x_{t-k+1}\\) \uff0c \\(y_t\\) \u79f0\u4e3a\u6ee4\u6ce2\u5668\u6216\u5377\u79ef\u6838","title":"\u5377\u79ef"},{"location":"cs/ai/dl/#_13","text":"","title":"\u4e00\u7ef4\u5377\u79ef"},{"location":"cs/ai/dl/#_14","text":"","title":"\u4e8c\u4f4d\u5377\u79ef"},{"location":"cs/ai/dl/#_15","text":"\u5377\u79ef\u4f5c\u4e3a\u7279\u5f81\u63d0\u53d6\u5668 \u5377\u79ef\u4ee3\u66ff\u5168\u8fde\u63a5 \u53ef\u4ee5\u5f15\u5165\u591a\u7ec4\u6ee4\u6ce2\u5668 \u5377\u79ef\u5c42 \u5178\u578b\u7684\u5377\u79ef\u5c42\u4e3a 3 \u7ef4\u7ed3\u6784 \u6c47\u805a\u5c42 \u5377\u79ef\u5c42\u867d\u7136\u53ef\u4ee5\u663e\u8457\u51cf\u5c11\u8fde\u63a5\u7684\u4e2a\u6570\uff0c\u4f46\u662f\u6bcf\u4e00\u4e2a\u7279\u5f81\u6620\u5c04\u7684\u795e\u7ecf\u5143\u4e2a\u6570\u5e76\u6ca1\u6709\u663e\u8457\u51cf\u5c11","title":"\u4f5c\u7528"},{"location":"cs/ai/dl/#_16","text":"\u5377\u79ef\u7f51\u7edc\u662f\u7531\u5377\u79ef\u5c42\u3001\u5b50\u91c7\u6837\u5c42\u3001\u5168\u8fde\u63a5\u5c42\u4ea4\u53c9\u5806\u53e0\u800c\u6210 \u8d8b\u5411\u4e8e\u5c0f\u5377\u79ef\u3001\u5927\u6df1\u5ea6 \u8d8b\u5411\u4e8e\u5168\u5377\u79ef \u4e00\u4e2a\u5377\u79ef\u5757\u4e3a\u8fde\u7eed\u4e2a M \u4e2a\u5377\u79ef\u5c42\u548c b \u4e2a\u6c47\u805a\u5c42\uff08M \u901a\u5e38\u8bbe\u7f6e\u4e3a 2-5\uff0cb \u4e3a 0 \u6216 1\uff09\u3002\u4e00\u4e2a\u5377\u79ef\u7f51\u7edc\u4e2d\u53ef\u4ee5\u5806\u53e0 N \u4e2a\u8fde\u7eed\u7684\u5377\u79ef\u5757\uff0c\u7136\u540e\u5728\u63a5\u7740 K \u4e2a\u5168\u8fde\u63a5\u5c42\uff08N \u7684\u53d6\u503c\u533a\u95f4\u6bd4\u8f83\u5927\uff0c\u6bd4\u5982 1-100 \u6216\u8005\u66f4\u5927\uff1bK \u4e00\u822c\u4e3a 0-2\uff09","title":"\u5377\u79ef\u7f51\u7edc\u7ed3\u6784"},{"location":"cs/ai/dl/#_17","text":"\u4f4e\u7ef4\u7279\u5f81\u6620\u5c04\u5230\u9ad8\u7ef4\u7279\u5f81","title":"\u8f6c\u7f6e\u5377\u79ef/\u5fae\u6b65\u5377\u79ef"},{"location":"cs/ai/dl/#_18","text":"\u5982\u4f55\u589e\u52a0\u8f93\u51fa\u5355\u4f4d\u7684\u611f\u53d7\u91ce \u589e\u52a0\u5377\u79ef\u6838\u7684\u5927\u5c0f \u589e\u52a0\u5c42\u6570\u6765\u5b9e\u73b0 \u5728\u5377\u79ef\u4e4b\u524d\u8fdb\u884c\u6c47\u805a\u64cd\u4f5c \u7a7a\u6d1e\u5377\u79ef\u901a\u8fc7\u7ed9\u5377\u79ef\u6838\u63d2\u5165\u201c\u7a7a\u6d1e\u201d\u6765\u53d8\u76f8\u5730\u589e\u52a0\u5176\u5927\u5c0f","title":"\u7a7a\u6d1e\u5377\u79ef"},{"location":"cs/ai/dl/#_19","text":"\\[ h(\\mathbf{x})=\\mathbf{x}+(h(\\mathbf{x})-\\mathbf{x}) \\\\ \\mathbf{x} \u4e3a\u6052\u7b49\u51fd\u6570\uff0ch(\\mathbf{x})-\\mathbf{x} \u4e3a\u6b8b\u5dee\u51fd\u6570 f(\\mathbf{x}, \\theta) \\]","title":"\u7b80\u5355\u7684\u6b8b\u5dee\u5355\u5143\u7ed3\u6784"},{"location":"cs/ai/dl/#_20","text":"AlphaGo Mask RCNN \u56fe\u50cf\u751f\u6210 Deep Dream \u753b\u98ce\u8fc1\u79fb \u5bf9\u6297\u6837\u672c","title":"\u5e94\u7528"},{"location":"cs/ai/dl/#reference","text":"\u90b1\u9521\u9e4f,\u795e\u7ecf\u7f51\u7edc\u4e0e\u6df1\u5ea6\u5b66\u4e60,\u673a\u68b0\u5de5\u4e1a\u51fa\u7248\u793e, 2020\uff0cISBN 9787111649687 \u963f\u65af\u987f\u00b7\u5f20\u7b49,\u52a8\u624b\u5b66\u6df1\u5ea6\u5b66\u4e60, ISBN: 9787115505835","title":"Reference"},{"location":"cs/ai/ml/","text":"\u673a\u5668\u5b66\u4e60 \u00b6 \u7ea6 3050 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6c5f\u5357\u5927\u5b66 \u201c\u673a\u5668\u5b66\u4e60\u201d \u8bfe\u7a0b\u7b14\u8bb0 \u53c2\u8003\u848b\u654f\u8001\u5e08\u7684 PPT\uff08\u6bcf\u6b21 4 \u8282\u8bfe\u53ea\u4e0a 3 \u8282\u8bfe\uff0c\u7b80\u76f4\u4e0d\u8981\u592a\u723d \u7b80\u5355\u5b66\u4e2a\u57fa\u7840\uff0c\u4e3b\u8981\u8fd8\u662f\u8981\u7528\u6df1\u5ea6\u5b66\u4e60\uff08\u5176\u5b9e\u5f88\u8ba8\u538c\u673a\u5668\u5b66\u4e60 \u6982\u8ff0 \u00b6 \u6982\u5ff5 \u00b6 \u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u4ece\u539f\u59cb\u6570\u636e\u4e2d\u63d0\u53d6\u7279\u5f81\uff0c\u5b66\u4e60\u4e00\u4e2a\u6620\u5c04\u51fd\u6570 \\(f\\) \u5c06\u4e0a\u8ff0\u7279\u5f81\uff08\u6216\u539f\u59cb\u6570\u636e\uff09\u6620\u5c04\u5230\u8bed\u4e49\u7a7a\u95f4\uff0c\u5bfb\u627e\u6570\u636e\u548c\u4efb\u52a1\u76ee\u6807\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u5373 \u673a\u5668\u5b66\u4e60 \\(\\approx\\) \u6784\u5efa\u4e00\u4e2a\u6620\u5c04\u51fd\u6570 \u79cd\u7c7b \u00b6 \u76d1\u7763\u5b66\u4e60 \u00b6 \u7ed9\u5b9a\u5e26\u6709\u6807\u7b7e\u4fe1\u606f\u7684\u8bad\u7ec3\u96c6\u5408\uff0c\u5b66\u4e60\u4ece\u8f93\u5165\u5230\u8f93\u51fa\u7684\u6620\u5c04 \u4e00\u822c\u88ab\u5e94\u7528\u5728\u56de\u5f52\u6216\u5206\u7c7b\u7684\u4efb\u52a1\u4e2d \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u5e0c\u671b\u6620\u5c04\u51fd\u6570\u5728\u8bad\u7ec3\u6570\u636e\u96c6\u4e0a\u5f97\u5230\u6240\u6709\u6837\u672c\u7684\u201c\u635f\u5931\u548c\u201d\u6700\u5c0f \u635f\u5931\u51fd\u6570\u5305\u62ec 0-1 \u635f\u5931\u51fd\u6570\uff08\u76f8\u7b49\u4e3a 0\uff0c\u53cd\u4e4b\u4e3a 1\uff09\uff0c\u5e73\u65b9\u635f\u5931\u51fd\u6570\uff0c\u7edd\u5bf9- \u635f\u5931\u51fd\u6570\uff0c\u5bf9\u6570\u635f\u5931\u51fd\u6570\uff08\u5bf9\u6570\u4f3c\u7136\u51fd\u6570\uff09 \u76d1\u7763\u5b66\u4e60\u4e00\u822c\u5305\u542b\u4e09\u4e2a\u90e8\u5206\u5185\u5bb9\uff1a \u4ece\u8bad\u7ec3\u6570\u636e\u96c6\u4e2d\u5b66\u4e60\u5f97\u5230\u6620\u5c04\u51fd\u6570 f \u5728\u6d4b\u8bd5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f \u5728\u672a\u77e5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f\uff08\u6295\u5165\u4f7f\u7528\uff09 \u8bad\u7ec3\u53ca\u4e2d\u4ea7\u751f\u7684\u635f\u5931\u4e00\u822c\u79f0\u4e3a\u7ecf\u9a8c\u98ce\u9669\uff08empirical risk\uff09\uff0c\u8d8a\u5c0f\u5bf9\u8bad\u7ec3\u96c6\u62df\u5408\u6548\u679c\u8d8a\u597d \u6d4b\u8bd5\u96c6\u4e2d\u52a0\u5165\u4ece\u771f\u5b9e\u6570\u636e\u5206\u5e03\u91c7\u6837\u7684\u6837\u672c\u65f6\uff0c\u6d4b\u8bd5\u96c6\u4e0a\u7684\u635f\u5931\u4f1a\u4e0d\u65ad\u903c\u8fd1\u671f\u671b\u98ce\u9669\uff08expected risk\uff09\uff0c\u8d8a\u5c0f\u6a21\u578b\u8d8a\u597d \u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u8ffd\u6c42\u671f\u671b\u98ce\u9669\u6700\u5c0f\u5316 \u7ed3\u6784\u98ce\u9669\u6700\u5c0f\u5316\uff08structural risk minimization\uff09\uff1a\u9632\u6b62\u8fc7\u5b66\u4e60\uff0c\u57fa\u4e8e\u8fc7\u5b66\u4e60\u65f6\u53c2\u6570\u503c\u901a\u5e38\u90fd\u8f83\u5927\u8fd9\u4e00\u53d1\u73b0\uff0c\u5728\u7ecf\u9a8c\u98ce\u9669\u4e0a\u52a0\u4e0a\u8868\u793a\u6a21\u578b\u590d\u6742\u5ea6\u7684\u6b63\u5219\u5316\u9879\uff08regularizer\uff09\u6216\u60e9\u7f5a\u9879\uff08penalty term\uff09\uff0c\u5728\u6700\u5c0f\u5316\u7ecf\u9a8c\u98ce\u9669\u4e0e\u964d\u4f4e\u6a21\u578b\u590d\u6742\u5ea6\u4e4b\u95f4\u5bfb\u627e\u5e73\u8861 \u4e3b\u8981\u7684\u76d1\u7763\u5b66\u4e60\u65b9\u6cd5\uff1a \u5224\u522b\u65b9\u6cd5\uff08discriminative approach\uff09 \u76f4\u63a5\u5b66\u4e60\u5224\u522b\u51fd\u6570 f(X) \u6216\u8005\u6761\u4ef6\u6982\u7387\u5206\u5e03 P(Y|X) \u4f5c\u4e3a\u9884\u6d4b\u7684\u6a21\u578b \u5178\u578b\u5224\u522b\u6a21\u578b\u5305\u62ec\u56de\u5f52\u6a21\u578b\u3001\u795e\u7ecf\u7f51\u7edc\u3001\u652f\u6301\u5411\u91cf\u673a\u548c Ada boosting \u751f\u6210\u65b9\u6cd5\uff08generative approach\uff09 \u4ece\u6570\u636e\u4e2d\u5b66\u4e60\u8054\u5408\u6982\u7387\u5206\u5e03 P(X, Y)\uff08\u901a\u8fc7\u4f3c\u7136\u6982\u7387 P(X|Y) \u548c\u7c7b\u6982\u7387 P(Y) \u4e58\u79ef\u6765\u6c42\uff09 \u751f\u6210\u6a21\u578b\u5178\u578b\u65b9\u6cd5\u4e3a\u8d1d\u53f6\u65af\u65b9\u6cd5\u3001\u9690\u9a6c\u5c14\u53ef\u592b\u94fe \u96be\u70b9\u5728\u4e8e\u8054\u5408\u5206\u5e03\u6982\u7387\u6216\u4f3c\u7136\u6982\u7387\u5f88\u96be\u6c42 \u65e0\u76d1\u7763\u5b66\u4e60 \u00b6 \u6700\u5927\u7279\u70b9\u662f \u6570\u636e\u65e0\u6807\u7b7e \u4e00\u822c\u88ab\u5e94\u7528\u5728\u805a\u7c7b\u6216\u82e5\u5e72\u964d\u7ef4\u4efb\u52a1\u4e2d \u534a\u76d1\u7763\u5b66\u4e60\u4f9d\u8d56\u4e8e\u90e8\u5206\u88ab\u6807\u6ce8\u7684\u6570\u636e \u5f3a\u5316\u5b66\u4e60 \u00b6 \u4e00\u79cd\u5e8f\u5217\u6570\u636e\u51b3\u7b56\u5b66\u4e60\u65b9\u6cd5 \u4ece\u4e0e\u73af\u5883\u4ea4\u4e92\u4e2d\u5b66\u4e60\uff0c\u901a\u8fc7\u56de\u62a5\u503c\uff08reward\uff09\u8ba9\u667a\u80fd\u4f53\uff08agent\uff09\u5b66\u4e60\u5230\u5728\u4e0d\u540c\u72b6\u6001\uff08state\uff09\u4e0b\u5982\u4f55\u9009\u62e9\u884c\u4e3a\u65b9\u5f0f\uff08action\uff09 \u591a\u5143\u7ebf\u6027\u56de\u5f52 \u00b6 \u6709 \\(n\\) \u4e2a\u7279\u5f81 \\([x_1, ..., x_n]^{\\top}\\) \uff0c \\(m\\) \u4e2a\u8bad\u7ec3\u6570 \\(\\{(\\mathbf{x_i}, \\mathbf{y_i})\\}_{i=1}^m\\) \uff0c\u9700\u8981\u627e\u5230\u53c2\u6570 \\(\\mathbf{\\theta}\\) \u4f7f\u5f97\u7ebf\u6027\u51fd\u6570 \\(h_\\theta(\\mathbf{x})=\\theta_0+\\mathbf{\\theta}^{\\top} \\mathbf{x}\\) \u6700\u5c0f\u5316\u5747\u65b9\u8bef\u5dee\u51fd\u6570 \\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)})^2 \\] \u77e9\u9635\u6c42\u9006 \u00b6 \\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})^{\\top}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta}) \\] \u5bf9\u5747\u65b9\u8bef\u5dee\u51fd\u6570\u6c42\u5bfc\u5f97 \\(\\nabla J(\\mathbf{\\theta})=-\\frac{1}{m}\\mathbf{X}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})\\) \uff0c\u4ee4\u68af\u5ea6\u7b49\u4e8e 0 \u5f97 \\[\\mathbf{\\theta}=(\\mathbf{X}\\mathbf{X^{\\top}})^{-1}\\mathbf{X}\\mathbf{y}\\] \u68af\u5ea6\u4e0b\u964d \u00b6 \\[ \\theta_j := \\theta_j - \\alpha \\frac{\\partial}{\\partial \\theta_j} J(\\theta) \\\\ \\theta_j := \\theta_j = \\alpha \\frac{1}{m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)}) x_j^{(i)} \\\\ \\] \\(x_j^{(i)}\\) \u8868\u793a\u7b2c \\(i\\) \u4e2a\u6837\u672c\u4e2d\u7b2c \\(j\\) \u4e2a\u7279\u5f81\u3002 \u7279\u5f81\u5f52\u4e00\u5316 \u00b6 \u4f7f\u5f97\u6240\u6709\u4e0d\u540c\u7684\u7279\u5f81\u5c3a\u5ea6\u8fd1\u4f3c\u3002 \u5e38\u7528\u65b9\u6cd5\uff1a \u5747\u503c\u5f52\u4e00\u5316: \\(x_i=\\frac{x_i - \\mu_i}{x_{i\\_max}-x_{i\\_min}}\\) \u5b66\u4e60\u7387 \u00b6 \u5efa\u8bae\u9009\u62e9\u7b56\u7565\uff1a...,0.001,0.003,0.01,0.03,0.1,0.3,... \u901a\u8fc7\u4ee3\u4ef7\u6536\u655b\u56fe\uff0c\u5206\u6790\u9009\u62e9\u5408\u9002\u7684 \\(\\alpha\\) \u5bf9\u6bd4 \u00b6 \u68af\u5ea6\u4e0b\u964d \u9700\u8981\u786e\u5b9a \\(\\alpha\\) \u9700\u8981\u591a\u6b21\u5faa\u73af \u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\u65f6\u4e5f\u53ef\u4ee5\u5f88\u597d\u5de5\u4f5c \u7279\u5f81\u9700\u8981\u5f52\u4e00\u5316 \u77e9\u9635\u6c42\u9006 \u4e0d\u9700\u8981\u9009\u62e9 \\(\\alpha\\) \u4e0d\u9700\u8981\u5faa\u73af \u8981\u8ba1\u7b97 \\((X^{\\top} X)^{-1}\\) \u5982\u679c\u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\uff0c\u7b97\u6cd5\u4f1a\u975e\u5e38\u6162\uff0c\u5bf9\u5185\u5b58\u8981\u6c42\u9ad8 \u7279\u5f81\u4e0d\u9700\u8981\u5f52\u4e00\u5316 \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u7ebf\u6027\u56de\u5f52 724 KB / 12 P / 2023-09-23 \u4e0b\u8f7d \u903b\u8f91\u56de\u5f52 \u00b6 \u7ebf\u6027\u56de\u5f52\u5bf9\u79bb\u7fa4\u70b9\u975e\u5e38\u654f\u611f\uff0c\u5bfc\u81f4\u6a21\u578b\u4e0d\u7a33\u5b9a\uff0c\u4e3a\u4e86\u7f13\u89e3\u8fd9\u4e2a\u95ee\u9898\u53ef\u4ee5\u8003\u8651\u903b\u8f91\u65af\u8482\u56de\u5f52\uff08logistic regression\uff09 \u5206\u7c7b \u00b6 \u903b\u8f91\u56de\u5f52\u662f\u5206\u7c7b\u6a21\u578b\uff0c\u4e0d\u662f\u56de\u5f52\u6a21\u578b \u4e8c\u5206\u7c7b\u95ee\u9898\uff1a \\(y \\in \\{0, 1\\}\\) \uff0c0 \u8868\u793a\u8d1f\u6837\u672c\uff0c1 \u8868\u793a\u6b63\u6837\u672c \\(h_\\theta(x)\\) \u53ef\u80fd \\(>1\\) \u6216 \\(<0\\) \uff0c\u903b\u8f91\u56de\u5f52\u7684\u76ee\u7684\uff1a \\(0 \\le h_\\theta(x) \\le 1\\) \u5b66\u4e60\u6a21\u578b \u00b6 \u903b\u8f91\u56de\u5f52\u7684\u6a21\u578b\uff1a \\(h_\\theta(x)=g(\\theta^{\\top}x)\\) \uff0c\u5176\u4e2d \\(g(z)=\\frac{1}{1+e^{-z}}\\) \uff0c\u79f0\u4e3a\u903b\u8f91\u51fd\u6570\uff08logistic function\uff09\u6216 Sigmoid \u51fd\u6570 \\[ y=\\frac{1}{1+e^{-z}}=\\frac{1}{1+e^{\\mathbf{x}\\top \\mathbf{x} + b}} \\] \u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570 \u6ee1\u8db3\u5206\u7c7b\u7684\u76ee\u7684 \u4fdd\u8bc1\u6536\u655b\uff08\u51f8\u51fd\u6570\uff09 \\[ Cost(h_\\theta(x),y)= \\left\\{\\begin{matrix} -\\log (h_\\theta(x)) & if \\ y=1 \\\\ -\\log (1-h_\\theta(x)) & if \\ y=0 \\end{matrix}\\right. \\] \u7b80\u5316\u7684\u4ee3\u4ef7\u51fd\u6570\u53ca\u68af\u5ea6\u4e0b\u964d \u00b6 \u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ J(\\theta)=\\frac{1}{m} \\sum_{i=1}^m Cost(h_\\theta(x^{(i)}),y^{(i)}) \\\\ =-\\frac{1}{m} \\sum_{i=1}^m [y^{(i)}\\log (h_\\theta(x^{(i)}))+(1-y^{(i)})\\log (1-h_\\theta(x^{(i)}))] \\] \u4f18\u5316\u6a21\u578b\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u8981\u7ed9\u5b9a\u7684\u6837\u672c \\(\\mathbf{x}\\) \uff0c\u9884\u6d4b \\(y\\) \uff0c\u8f93\u51fa \\(h_\\theta(x)=\\frac{1}{1+e^{-\\theta \\top x}}\\) \u68af\u5ea6\u4e0b\u964d \\[ \\frac{\\partial J(\\theta)}{\\partial x}= \\frac{1}{m} \\sum_{i=1}^m (h_\\theta(x^{(i)})-y^{(i)})x_j^{(i)} \\] \u76ee\u6807\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u533a\u522b\uff1a\u7ebf\u6027\u56de\u5f52\uff1a \\(h_\\theta (x)=\\theta^\\top X\\) \uff0c\u903b\u8f91\u56de\u5f52\uff1a \\(h_\\theta(x)=\\frac{1}{1-e^{- \\theta \\top X}}\\) \u9ad8\u7ea7\u4f18\u5316\u95ee\u9898 \u00b6 \u4f18\u5316\u7b97\u6cd5 \u00b6 cvxpy \u7cfb\u5217\uff0ccvxpy\uff0ccvxOPT\uff0c\u8fd9\u51e0\u4e2a\u5305\u4e3b\u8981\u89e3\u51b3\u51f8\u4f18\u5316\u95ee\u9898 scipy.optimizes.scipy \u4e5f\u6709\u4f18\u5316\u65b9\u6cd5 scipy.optimize \u00b6 \u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\uff08\u4f8b\u5982 BFGS\uff0cNelder-Mead simplex\uff0cNewton Conjugate Gradient\uff0cCOBYLA \u6216 SLSQP\uff09\u5bf9\u591a\u53d8\u91cf\u6807\u91cf\u51fd\u6570\uff08\u6700\u5c0f\u5316\uff08\uff09\uff09\u8fdb\u884c\u65e0\u7ea6\u675f\u548c\u7ea6\u675f\u6700\u5c0f\u5316 \u5168\u5c40\uff08\u5f3a\u529b\uff09\u4f18\u5316\u7a0b\u5e8f\uff08\u4f8b\u5982\uff0c\u9000\u706b\uff08\uff09\uff0c\u6d41\u57df\u8d2d\u7269\uff08\uff09\uff09 \u6700\u5c0f\u4e8c\u4e58\u6700\u5c0f\u5316\uff08leastsq\uff08\uff09\uff09\u548c\u66f2\u7ebf\u62df\u5408\uff08curve_fit\uff08\uff09\uff09\u7b97\u6cd5 \u6807\u91cf\u4f46\u53d8\u91cf\u51fd\u6570\u6700\u5c0f\u5316\u5668\uff08minimize_scalar\uff08\uff09\uff09\u548c\u6839\u67e5\u627e\u5668\uff08newton\uff08\uff09\uff09 \u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\u7684\u591a\u53d8\u91cf\u65b9\u7a0b\u7cfb\u7edf\u6c42\u89e3\u5668\uff08root\uff08\uff09\uff09\uff08\u4f8b\u5982\u6df7\u5408 Powell\uff0cLevenberg-Marquardt \u6216\u5927\u89c4\u6a21\u65b9\u6cd5\uff0c\u5982 Newton-Krylov\uff09 \u591a\u5206\u7c7b\u95ee\u9898 \u00b6 \u4e00 VS \u591a \\(\\to\\) 1 VS \u5176\u4ed6 \u8f6c\u6362\u4e3a \u4e00 VS \u591a \\(\\to\\) 1 VS \u53e6\u4e00\u7c7b \u6784\u5efa\u5206\u7c7b\u5668 \u6811\u72b6\u5206\u7c7b\u5668\u6784\u5efa\uff0c\u805a\u7c7b+\u51b3\u7b56\u6811\u6765\u641c\u7d22\u7c7b\u522b\u5dee\u8ddd \u89e3\u51b3\u65b9\u6cd5\uff1a \u8bad\u7ec3 \uff1a\u4e3a\u6bcf\u4e2a\u7c7b\u522b i\uff0c\u8bad\u7ec3\u4e00\u4e2a\u5206\u7c7b\u5668 \\(h_\\theta^{(i)}(x)\\) \uff0c\u4ee5\u9884\u6d4b \\(y=i\\) \u7684\u6982\u7387 \u6d4b\u8bd5 \uff1a\u7ed9\u5b9a\u4e00\u4e2a\u6d4b\u8bd5\u6837\u672c x\uff0c\u6d4b\u8bd5\u6bcf\u4e2a\u7c7b\u522b\u6a21\u578b \\(h_\\theta^{(i)}(x)\\) \uff0c\u9009\u62e9\u6ee1\u8db3 \\(\\underset{i}{\\max} h_\\theta^{(i)}(x)\\) \u7684 i\uff0c\u5373\u4e3a\u6700\u4f18\u7c7b\u522b \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u903b\u8f91\u56de\u5f52 938 KB / 9 P / 2023-10-10 \u4e0b\u8f7d \u6570\u636e\u53ef\u89c6\u5316 \u00b6 matplotlib seaborn pyecharts Pandas \u652f\u6301\u5411\u91cf\u673a \u00b6 \u652f\u6301\u5411\u91cf\u673a SVM \u662f\u4e00\u7c7b\u6309 \u76d1\u7763\u5b66\u4e60 \u65b9\u5f0f\u5bf9\u6570\u636e\u8fdb\u884c\u4e8c\u5143\u5206\u7c7b\u7684\u5e7f\u4e49\u7ebf\u6027\u5206\u7c7b\u5668 \u51b3\u7b56\u8fb9\u754c\u662f\u5bf9\u5b66\u4e60\u6837\u672c\u6c42\u89e3\u7684 \u6700\u5927\u8fb9\u8ddd\u8d85\u5e73\u9762 \u89e3\u51b3\u7ebf\u6027\u53ef\u5206\u95ee\u9898 \u5c06\u7ebf\u6027\u53ef\u5206\u95ee\u9898\u4e2d\u5f97\u5230\u7684\u7ed3\u8bba\u63a8\u5e7f\u5230\u7ebf\u6027\u4e0d\u53ef\u5206\u2014\u2014\u6838\u51fd\u6570 \u7ebf\u6027\u53ef\u5206 VS \u7ebf\u6027\u4e0d\u53ef\u5206 \u00b6 \u7ebf\u6027\u53ef\u5206 \u00b6 \u4e8c\u7ef4\uff1a\u4e00\u6761\u76f4\u7ebf \u4e09\u7ef4\uff1a\u4e00\u4e2a\u5e73\u9762 \u56db\u7ef4\u53ca\u66f4\u9ad8\u7ef4\uff1a\u4e00\u4e2a\u8d85\u5e73\u9762 Hyperplane \u6570\u5b66\u5b9a\u4e49\uff1a\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_1,y_1),(X_2,y_2),...,(X_n,y_n)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega_1,\\omega_2,b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \u82e5 \\(y_i =+1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b > 0\\) \u82e5 \\(y_i =-1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b < 0\\) \u652f\u6301\u5411\u91cf\u673a\u8d85\u5e73\u9762\u4e0e\u6700\u4f18\u5316 \u5047\u5b9a\u6837\u672c\u96c6\u7ebf\u6027\u53ef\u5206 SVM \u8981\u5bfb\u627e\u7684\u5c31\u662f\u5177\u6709\u6700\u5927 margin \u7684\u8d85\u5e73\u9762\uff0c\u4e14\u79bb\u4e24\u8fb9\u7684\u652f\u6301\u5411\u91cf\u8ddd\u79bb\u76f8\u7b49\uff0c\u53ef\u8868\u793a\u4e3a \\[ \\min \\frac{1}{2} \\parallel \\omega \\parallel^2 \\\\ \u7ea6\u675f\u6761\u4ef6\uff1ay_i(\\omega^\\top X_i + b) \\ge 1 \\ \\ \\ (i=1 \\sim N) \\] \u7ebf\u6027\u4e0d\u53ef\u5206 \u00b6 \u5982\u679c \\(y_i=\\{+1,-1\\}\\) \uff0c\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_i,y_i)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega, b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \\(y_i(\\omega^\\top X_i + b) > 0\\) \u5178\u578b\u7684\u7ebf\u6027\u4e0d\u53ef\u5206\u95ee\u9898\u2014\u2014 \u5f02\u6216 \u975e\u7ebf\u6027\u51b3\u7b56\u8fb9\u754c \u9700\u8981\u4e00\u4e2a\u9ad8\u9636\u6a21\u578b\u4ee5\u5b9e\u73b0\u8fd9\u6837\u7684\u975e\u7ebf\u6027\u5206\u7c7b\u95ee\u9898\uff0c\u672c\u8d28\u662f\u5c06\u4e8c\u7ef4\u7a7a\u95f4\u95ee\u9898\u6620\u5c04\u4e3a\u9ad8\u7ef4\u7a7a\u95f4\u95ee\u9898 \u4f4e\u7ef4\u5230\u9ad8\u7ef4\u7684\u6620\u5c04\u2014\u2014\u6838\u51fd\u6570\uff08\u7406\u8bba\u4e0a\u51e0\u4e4e\u901a\u7528\u4e8e\u6240\u6709\u5206\u7c7b Cover \u5b9a\u7406 \u5728\u4e00\u4e2a M \u7ef4\u7a7a\u95f4\u4e0a\u968f\u673a\u53d6 N \u4e2a\u8bad\u7ec3\u6837\u672c\u968f\u673a\u7684\u5bf9\u6bcf\u4e2a\u8bad\u7ec3 d \u8d4b\u4e88\u6807\u7b7e +1 \u6216 -1 \u8fd9\u4e9b\u8bad\u7ec3\u6837\u672c\u7ebf\u6027\u53ef\u5206\u7684\u6982\u7387\u4e3a \\(P(M)\\) \uff0c\u5219\u5f53 M \u8d8b\u5411\u65e0\u7a77\u5927\u65f6 \\(P(M)=1\\) M \u4e0a\u5347 \\(\\to\\) \\((\\omega, b)\\) \u7ef4\u5ea6\u4e0a\u5347 \\(\\to\\) \u6a21\u578b\u81ea\u7531\u5ea6\u4e0a\u5347 \\(\\to\\) \u7ebf\u6027\u53ef\u5206\u6982\u7387\u4e0a\u5347 \u5982\u4f55\u5bfb\u627e\u6838\u51fd\u6570 \u6838\u51fd\u6570 \u00b6 \u7ebf\u6027\u6838\u51fd\u6570 \\(K(x,xi)=x \\cdot xi\\) \u591a\u9879\u5f0f\u6838 Polynomial kernel \\((x^\\top l+\u5e38\u91cf)^{\u5e38\u91cf}\\) \u5f84\u5411\u57fa\u6838(RBF) \\(K(x,xi)=\\exp(- \\parallel x - xi \\parallel / 2 \\sigma^2)\\) \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u652f\u6301\u5411\u91cf\u673a 892 KB / 9 P / 2023-10-20 \u4e0b\u8f7d \u795e\u7ecf\u7f51\u7edc \u00b6 \u795e\u7ecf\u5143\u6a21\u578b MP \u00b6 \u5305\u542b\u8f93\u5165\u8f93\u51fa\u4e0e\u8ba1\u7b97\u529f\u80fd\u7684\u6a21\u578b \u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u611f\u77e5\u5668\uff09 \u00b6 \u4e0e\u795e\u7ecf\u5143\u6a21\u578b\u4e0d\u540c\uff0c\u611f\u77e5\u5668\u4e2d\u7684\u6743\u503c\u662f\u901a\u8fc7\u8bad\u7ec3\u5f97\u5230\u7684 \u611f\u77e5\u5668\u53ef\u4ee5\u505a\uff08\u7b80\u5355\uff09\u7ebf\u6027\u5206\u7c7b\u4efb\u52a1 \u7528\u51b3\u7b56\u8fb9\u754c\u6765\u8868\u8fbe\u5206\u7c7b\u6548\u679c XOR \u65e0\u6cd5\u89e3\u51b3 \u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u591a\u5c42\u611f\u77e5\u5668\uff09 \u00b6 \u7ed3\u6784 \u00b6 \u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u9664\u4e86\u8f93\u5165\u5c42\u548c\u8f93\u51fa\u5c42\uff0c\u8fd8\u589e\u52a0\u4e00\u4e2a\u4e2d\u95f4\u5c42 \u4e2d\u95f4\u5c42\u548c\u8f93\u51fa\u5c42\u90fd\u662f\u8ba1\u7b97\u5c42 \u901a\u8fc7\u6269\u5c55\u4e0a\u4e2a\u5355\u5143\u7684\u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff0c\u5728\u53f3\u8fb9\u65b0\u52a0\u4e00\u4e2a\u5c42\u6b21 \u9690\u85cf\u5c42\u7684\u8282\u70b9\u6570\u8bbe\u8ba1 \u00b6 \u8f93\u5165\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u7279\u5f81\u7684\u7ef4\u5ea6\u5339\u914d \u8f93\u51fa\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u76ee\u6807\u7684\u7ef4\u5ea6\u5339\u914d \u4e2d\u95f4\u5c42\u7684\u8282\u70b9\u6570\u7531\u8bbe\u8ba1\u8005\u51b3\u5b9a \u8f83\u597d\u7684\u65b9\u6cd5\u5c31\u662f\u9884\u5148\u8bbe\u5b9a\u51e0\u4e2a\u53ef\u9009\u503c\uff0c\u901a\u8fc7\u5207\u6362\u4e0d\u540c\u503c\u6765\u770b\u6574\u4e2a\u6a21\u578b\u7684\u9884\u6d4b\u6548\u679c\uff0c\u7b80\u79f0 Grid Search \u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u8bad\u7ec3 \u00b6 \u8bad\u7ec3\u4e0e\u635f\u5931\u51fd\u6570 \u00b6 \u9996\u5148\u7ed9\u6240\u6709\u53c2\u6570\u8d4b\u4e0a\u968f\u673a\u503c\uff0c\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\u503c\u6765\u9884\u6d4b\u8bad\u7ec3\u6570\u636e\u4e2d\u7684\u6837\u672c\uff0c\u6837\u672c\u7684\u9884\u6d4b\u76ee\u6807\u4e3a \\(y_p\\) \uff0c\u771f\u5b9e\u76ee\u6807\u4e3a \\(y\\) \u3002\u90a3\u4e48\u5b9a\u4e49\u4e00\u4e2a\u503c \\(loss = (y_p-y)/2\\) loss \u79f0\u4e4b\u4e3a\u635f\u5931\uff0c\u76ee\u6807\u5c31\u662f\u4f7f\u5bf9\u6240\u6709\u8bad\u7ec3\u6570\u636e\u7684\u635f\u5931\u548c\u5c3d\u53ef\u80fd\u7684\u5c0f \u5982\u679c\u5c06\u5148\u524d\u7684\u795e\u7ecf\u7f51\u7edc\u9884\u6d4b\u7684\u77e9\u9635\u516c\u5f0f\u5e26\u5165\u5230 \\(y_p\\) \u4e2d\uff08\u56e0\u4e3a\u6709 \\(z=y_p\\) \uff09\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u628a\u635f\u5931\u5199\u4e3a\u5173\u4e8e\u53c2\u6570\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u79f0\u4e4b\u4e3a \u635f\u5931\u51fd\u6570(loss function) \u795e\u7ecf\u7f51\u7edc\u4f18\u5316\u95ee\u9898 \u00b6 \u4e00\u822c\u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6cd5\u6765\u4f18\u5316\uff0c\u56e0\u4e3a\u4ee3\u4ef7\u5f88\u5927\uff0c\u6240\u4ee5\u9700\u8981\u4f7f\u7528\u53cd\u5411\u4f20\u64ad\u7b97\u6cd5 \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u5229\u7528\u795e\u7ecf\u7f51\u7edc\u7684\u7ed3\u6784\u8fdb\u884c\u7684\u8ba1\u7b97\uff0c\u4e0d\u4e00\u6b21\u8ba1\u7b97\u6240\u6709\u7684\u68af\u5ea6\uff0c\u800c\u662f\u4ece\u540e\u5f80\u524d \u53cd\u5411\u4f20\u64ad\u7684\u4f9d\u636e\uff1a\u94fe\u5f0f\u6cd5\u5219 \u6846\u67b6 \u00b6 Pytorch optimizer = torch . optim . SGD ( model . parameters (), lr = 0.01 ) ... loss . backward () TensorFlow train = tf . train . GradientDescentOptimizer ( learning_rate = 0.01 ) . minimize ( loss ) \u5b9e\u9a8c\u62a5\u544a \u00b6 \u673a\u5668\u5b66\u4e60--\u795e\u7ecf\u7f51\u7edc 855 KB / 7 P / 2023-10-20 \u4e0b\u8f7d \u8bc6\u522b\u7cfb\u7edf\u7684\u6a21\u578b\u9009\u62e9\u4e0e\u8bc4\u4f30 \u00b6 \u8bef\u5dee\u5f88\u5927\u65f6 \u83b7\u53d6\u66f4\u591a\u7684\u8bad\u7ec3\u6570\u636e \u5c1d\u8bd5\u51cf\u5c11\u7279\u5f81 \u5927\u91cf\u65f6\u95f4\uff08>6\u4e2a\u6708\uff09\u53ef\u80fd\u90fd\u5728\u505a\u8fd9\u4e9b\u8c03\u6574 \u5c1d\u8bd5\u589e\u52a0\u591a\u9879\u5f0f\u7279\u5f81 \u5c1d\u8bd5\u964d\u4f4e/\u63d0\u9ad8 \\(\\lambda\\) \u8bad\u7ec3\u96c6\u3001\u6d4b\u8bd5\u96c6\u3001\u6821\u9a8c\u96c6 \u00b6 \u9ad8\u9636\u6a21\u578b\u80fd\u591f\u5f88\u597d\u5730\u62df\u5408\uff0c\u4f46\u5bf9\u4e0d\u5728\u8bad\u7ec3\u96c6\u4e2d\u7684\u65b0\u6837\u672c\u7f3a\u4e4f\u6cdb\u5316\u80fd\u529b \u53ef\u4ee5\u8003\u8651\u6253\u4e71\u6570\u636e\uff0c\u4ee5\u589e\u5f3a\u6cdb\u5316\u80fd\u529b \u9519\u8bef\u7387&\u8bef\u5dee \u00b6 \u9519\u8bef\u7387\uff1a\u9519\u5206\u6837\u672c\u7684\u5360\u6bd4 \u8bef\u5dee\uff1a\u6837\u672c\u771f\u5b9e\u8f93\u51fa\u4e0e\u9884\u6d4b\u8f93\u51fa\u4e4b\u95f4\u7684\u5dee\u5f02 \u8bad\u7ec3\uff08\u7ecf\u9a8c\uff09\u8bef\u5dee\uff1a\u8bad\u7ec3\u96c6 \u6d4b\u8bd5\u8bef\u5dee\uff1a\u6d4b\u8bd5\u96c6 \u6cdb\u5316\u8bef\u5dee\uff1a\u9664\u8bad\u7ec3\u96c6\u5916\u6240\u6709\u6837\u672c \u7ecf\u9a8c\u8bef\u5dee\u4e0e\u8fc7\u62df\u5408 \u00b6 \u8fc7\u62df\u5408 \u5b66\u4e60\u5668\u628a\u6240\u6709\u8bad\u7ec3\u6837\u672c\u5b66\u4e60\u7684\u201c\u592a\u597d\u201d\uff0c\u5c06\u8bad\u7ec3\u6837\u672c\u672c\u8eab\u7684\u7279\u70b9\u5f53\u4f5c\u6240\u6709\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\uff0c\u5bfc\u81f4\u6cdb\u5316\u6027\u80fd\u4e0b\u964d \u4f18\u5316\u76ee\u6807\u52a0\u6b63\u5219\u9879 early stop \u6b20\u62df\u5408 \u5bf9\u8bad\u7ec3\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\u5c1a\u672a\u5b66\u597d \u51b3\u7b56\u6811\uff1a\u62d3\u5c55\u5206\u652f \u795e\u7ecf\u7f51\u7edc\uff1a\u589e\u52a0\u8bad\u7ec3\u8f6e\u6570 \u5e38\u7528\u8bc4\u4f30\u65b9\u6cd5 \u00b6 \u7559\u51fa\u6cd5 \u00b6 \u76f4\u63a5\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a\u4e24\u4e2a\u4e92\u65a5\u96c6\u5408 \u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u5212\u5206\u8981\u5c3d\u53ef\u80fd\u4fdd\u6301\u6570\u636e\u5206\u5e03\u7684\u4e00\u81f4\u6027 \u4e00\u822c\u82e5\u5e72\u6b21\u968f\u673a\u5212\u5206\uff0c\u91cd\u590d\u5b9e\u9a8c\u53d6\u5e73\u5747\u503c \u8bad\u7ec3/\u6d4b\u8bd5\u6837\u672c\u6bd4\u4f8b\u901a\u5e38\u4e3a 2:1-4:1 \u4ea4\u53c9\u9a8c\u8bc1\u6cd5 \u00b6 \u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a k \u4e2a\u5927\u5c0f\u76f8\u4f3c\u7684\u4e92\u65a5\u5b50\u96c6 \u6bcf\u6b21\u7528 k-1 \u4e2a\u5b50\u96c6\u7684\u5e76\u96c6\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u4f59\u4e0b\u7684\u5b50\u96c6\u4f5c\u4e3a\u6d4b\u8bd5\u96c6 \u8fdb\u884c k \u6b21\u8bad\u7ec3\u548c\u6d4b\u8bd5\uff0c\u6700\u7ec8\u8fd4\u56de k \u6b21\u6d4b\u8bd5\u7ed3\u679c\u7684\u5747\u503c \u4e00\u822c k \u4e3a 10 \u81ea\u52a9\u6cd5 \u00b6 \u5b9e\u9645\u6a21\u578b\u4e0e\u9884\u671f\u6a21\u578b\u90fd\u4f7f\u7528 m \u4e2a\u8bad\u7ec3\u6837\u672c \u7ea6\u6709 1/3 \u7684\u6837\u672c\u6ca1\u5728\u8bad\u7ec3\u96c6\u4e2d\u51fa\u73b0 \u4ece\u521d\u59cb\u6570\u636e\u96c6\u4e2d\u4ea7\u751f\u591a\u4e2a\u4e0d\u540c\u7684\u8bad\u7ec3\u96c6\uff0c\u5bf9\u96c6\u6210\u5b66\u4e60\u6709\u5f88\u5927\u7684\u597d\u5904 \u81ea\u52a9\u6cd5\u5728\u6570\u636e\u96c6\u8f83\u5c0f\uff0c\u96be\u4ee5\u6709\u6548\u5212\u5206\u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u65f6\u5f88\u6709\u7528 \u81ea\u52a9\u6cd5\u4ea7\u751f\u7684\u6570\u636e\u96c6\u6539\u53d8\u4e86\u521d\u59cb\u6570\u636e\u96c6\u7684\u5206\u5e03\uff0c\u4f1a\u5f15\u5165\u4f30\u8ba1\u504f\u5dee\uff0c\u5728\u6570\u636e\u91cf\u8db3\u591f\u65f6\uff0c\u7559\u51fa\u6cd5\u548c\u4ea4\u53c9\u9a8c\u8bc1\u6cd5\u66f4\u5e38\u7528 \u6027\u80fd\u5ea6\u91cf \u00b6 \u5206\u7c7b\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u9519\u8bef\u7387\u548c\u7cbe\u5ea6 \u9519\u8bef\u7387\uff1a \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) \\ne y_i)\\) \u7cbe\u5ea6\uff1a \\(acc(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) = y_i)=1-E(f;D)\\) \u56de\u5f52\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u5747\u65b9\u8bef\u5dee \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) - y_i)^2\\) \u6df7\u6dc6\u77e9\u9635 Confusion matrix \u67e5\u51c6\u7387 Precision\uff1a \\(P=\\frac{TP}{TP+FP}\\) \u67e5\u5168\u7387 Recall\uff1a \\(P=\\frac{TP}{TP+FN}\\) P-R \u66f2\u7ebf\uff1a\u6839\u636e\u5b66\u4e60\u5668\u7684\u9884\u6d4b\u7ed3\u679c\u6309\u6b63\u4f8b\u53ef\u80fd\u6027\u5927\u5c0f\u5bf9\u6837\u4f8b\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u9010\u4e2a\u628a\u6837\u672c\u4f5c\u4e3a\u6b63\u4f8b\u8fdb\u884c\u9884\u6d4b\uff0c\u5219\u53ef\u4ee5\u5f97\u5230\u67e5\u51c6\u7387-\u67e5\u5168\u7387 F1 Score\uff1a \\(F1 Score=2\\frac{PR}{P+R}\\) \u66f4\u4e00\u822c\u7684\u5f62\u5f0f \\(F_\\beta = \\frac{(1+\\beta^2) \\times P \\times R}{(\\beta^2 \\times P) + R}\\) \\(\\beta=1\\) \uff1a\u6807\u51c6 F1 \\(\\beta<1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u51c6\u7387\uff08\u5546\u54c1\u63a8\u8350\u7cfb\u7edf\uff09 \\(\\beta>1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u5168\u7387\uff08\u9003\u72af\u4fe1\u606f\u68c0\u7d22\uff09 ROC \u66f2\u7ebf\uff1a\u53d7\u8bd5\u8005\u5de5\u4f5c\u7279\u5f81\u66f2\u7ebf \u6a2a\u8f74\uff1a \\(FPR=\\frac{FP}{FP+TN}\\) \u7eb5\u8f74\uff1a \\(TPR=\\frac{TP}{TP+FN}\\) AUC\uff1aROC \u66f2\u7ebf\u4e0b\u7684\u9762\u79ef\uff0c\u8d8a\u5927\u8d8a\u597d \u4ee3\u4ef7\u654f\u611f\u9519\u8bef\u7387 \u6bd4\u8f83\u6821\u9a8c \u00b6 \u5047\u8bbe\u6821\u9a8c \u4e8c\u9879\u6821\u9a8c t \u68c0\u9a8c \u4ea4\u53c9\u9a8c\u8bc1 t \u68c0\u9a8c McNemar \u68c0\u9a8c Friedman \u68c0\u9a8c Nemenyi \u68c0\u9a8c \u805a\u7c7b \u00b6","title":"\u673a\u5668\u5b66\u4e60"},{"location":"cs/ai/ml/#_1","text":"\u7ea6 3050 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6c5f\u5357\u5927\u5b66 \u201c\u673a\u5668\u5b66\u4e60\u201d \u8bfe\u7a0b\u7b14\u8bb0 \u53c2\u8003\u848b\u654f\u8001\u5e08\u7684 PPT\uff08\u6bcf\u6b21 4 \u8282\u8bfe\u53ea\u4e0a 3 \u8282\u8bfe\uff0c\u7b80\u76f4\u4e0d\u8981\u592a\u723d \u7b80\u5355\u5b66\u4e2a\u57fa\u7840\uff0c\u4e3b\u8981\u8fd8\u662f\u8981\u7528\u6df1\u5ea6\u5b66\u4e60\uff08\u5176\u5b9e\u5f88\u8ba8\u538c\u673a\u5668\u5b66\u4e60","title":"\u673a\u5668\u5b66\u4e60"},{"location":"cs/ai/ml/#_2","text":"","title":"\u6982\u8ff0"},{"location":"cs/ai/ml/#_3","text":"\u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u4ece\u539f\u59cb\u6570\u636e\u4e2d\u63d0\u53d6\u7279\u5f81\uff0c\u5b66\u4e60\u4e00\u4e2a\u6620\u5c04\u51fd\u6570 \\(f\\) \u5c06\u4e0a\u8ff0\u7279\u5f81\uff08\u6216\u539f\u59cb\u6570\u636e\uff09\u6620\u5c04\u5230\u8bed\u4e49\u7a7a\u95f4\uff0c\u5bfb\u627e\u6570\u636e\u548c\u4efb\u52a1\u76ee\u6807\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u5373 \u673a\u5668\u5b66\u4e60 \\(\\approx\\) \u6784\u5efa\u4e00\u4e2a\u6620\u5c04\u51fd\u6570","title":"\u6982\u5ff5"},{"location":"cs/ai/ml/#_4","text":"","title":"\u79cd\u7c7b"},{"location":"cs/ai/ml/#_5","text":"\u7ed9\u5b9a\u5e26\u6709\u6807\u7b7e\u4fe1\u606f\u7684\u8bad\u7ec3\u96c6\u5408\uff0c\u5b66\u4e60\u4ece\u8f93\u5165\u5230\u8f93\u51fa\u7684\u6620\u5c04 \u4e00\u822c\u88ab\u5e94\u7528\u5728\u56de\u5f52\u6216\u5206\u7c7b\u7684\u4efb\u52a1\u4e2d \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u5e0c\u671b\u6620\u5c04\u51fd\u6570\u5728\u8bad\u7ec3\u6570\u636e\u96c6\u4e0a\u5f97\u5230\u6240\u6709\u6837\u672c\u7684\u201c\u635f\u5931\u548c\u201d\u6700\u5c0f \u635f\u5931\u51fd\u6570\u5305\u62ec 0-1 \u635f\u5931\u51fd\u6570\uff08\u76f8\u7b49\u4e3a 0\uff0c\u53cd\u4e4b\u4e3a 1\uff09\uff0c\u5e73\u65b9\u635f\u5931\u51fd\u6570\uff0c\u7edd\u5bf9- \u635f\u5931\u51fd\u6570\uff0c\u5bf9\u6570\u635f\u5931\u51fd\u6570\uff08\u5bf9\u6570\u4f3c\u7136\u51fd\u6570\uff09 \u76d1\u7763\u5b66\u4e60\u4e00\u822c\u5305\u542b\u4e09\u4e2a\u90e8\u5206\u5185\u5bb9\uff1a \u4ece\u8bad\u7ec3\u6570\u636e\u96c6\u4e2d\u5b66\u4e60\u5f97\u5230\u6620\u5c04\u51fd\u6570 f \u5728\u6d4b\u8bd5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f \u5728\u672a\u77e5\u6570\u636e\u96c6\u4e0a\u6d4b\u8bd5\u6620\u5c04\u51fd\u6570 f\uff08\u6295\u5165\u4f7f\u7528\uff09 \u8bad\u7ec3\u53ca\u4e2d\u4ea7\u751f\u7684\u635f\u5931\u4e00\u822c\u79f0\u4e3a\u7ecf\u9a8c\u98ce\u9669\uff08empirical risk\uff09\uff0c\u8d8a\u5c0f\u5bf9\u8bad\u7ec3\u96c6\u62df\u5408\u6548\u679c\u8d8a\u597d \u6d4b\u8bd5\u96c6\u4e2d\u52a0\u5165\u4ece\u771f\u5b9e\u6570\u636e\u5206\u5e03\u91c7\u6837\u7684\u6837\u672c\u65f6\uff0c\u6d4b\u8bd5\u96c6\u4e0a\u7684\u635f\u5931\u4f1a\u4e0d\u65ad\u903c\u8fd1\u671f\u671b\u98ce\u9669\uff08expected risk\uff09\uff0c\u8d8a\u5c0f\u6a21\u578b\u8d8a\u597d \u673a\u5668\u5b66\u4e60\u7684\u76ee\u6807\u662f\u8ffd\u6c42\u671f\u671b\u98ce\u9669\u6700\u5c0f\u5316 \u7ed3\u6784\u98ce\u9669\u6700\u5c0f\u5316\uff08structural risk minimization\uff09\uff1a\u9632\u6b62\u8fc7\u5b66\u4e60\uff0c\u57fa\u4e8e\u8fc7\u5b66\u4e60\u65f6\u53c2\u6570\u503c\u901a\u5e38\u90fd\u8f83\u5927\u8fd9\u4e00\u53d1\u73b0\uff0c\u5728\u7ecf\u9a8c\u98ce\u9669\u4e0a\u52a0\u4e0a\u8868\u793a\u6a21\u578b\u590d\u6742\u5ea6\u7684\u6b63\u5219\u5316\u9879\uff08regularizer\uff09\u6216\u60e9\u7f5a\u9879\uff08penalty term\uff09\uff0c\u5728\u6700\u5c0f\u5316\u7ecf\u9a8c\u98ce\u9669\u4e0e\u964d\u4f4e\u6a21\u578b\u590d\u6742\u5ea6\u4e4b\u95f4\u5bfb\u627e\u5e73\u8861 \u4e3b\u8981\u7684\u76d1\u7763\u5b66\u4e60\u65b9\u6cd5\uff1a \u5224\u522b\u65b9\u6cd5\uff08discriminative approach\uff09 \u76f4\u63a5\u5b66\u4e60\u5224\u522b\u51fd\u6570 f(X) \u6216\u8005\u6761\u4ef6\u6982\u7387\u5206\u5e03 P(Y|X) \u4f5c\u4e3a\u9884\u6d4b\u7684\u6a21\u578b \u5178\u578b\u5224\u522b\u6a21\u578b\u5305\u62ec\u56de\u5f52\u6a21\u578b\u3001\u795e\u7ecf\u7f51\u7edc\u3001\u652f\u6301\u5411\u91cf\u673a\u548c Ada boosting \u751f\u6210\u65b9\u6cd5\uff08generative approach\uff09 \u4ece\u6570\u636e\u4e2d\u5b66\u4e60\u8054\u5408\u6982\u7387\u5206\u5e03 P(X, Y)\uff08\u901a\u8fc7\u4f3c\u7136\u6982\u7387 P(X|Y) \u548c\u7c7b\u6982\u7387 P(Y) \u4e58\u79ef\u6765\u6c42\uff09 \u751f\u6210\u6a21\u578b\u5178\u578b\u65b9\u6cd5\u4e3a\u8d1d\u53f6\u65af\u65b9\u6cd5\u3001\u9690\u9a6c\u5c14\u53ef\u592b\u94fe \u96be\u70b9\u5728\u4e8e\u8054\u5408\u5206\u5e03\u6982\u7387\u6216\u4f3c\u7136\u6982\u7387\u5f88\u96be\u6c42","title":"\u76d1\u7763\u5b66\u4e60"},{"location":"cs/ai/ml/#_6","text":"\u6700\u5927\u7279\u70b9\u662f \u6570\u636e\u65e0\u6807\u7b7e \u4e00\u822c\u88ab\u5e94\u7528\u5728\u805a\u7c7b\u6216\u82e5\u5e72\u964d\u7ef4\u4efb\u52a1\u4e2d \u534a\u76d1\u7763\u5b66\u4e60\u4f9d\u8d56\u4e8e\u90e8\u5206\u88ab\u6807\u6ce8\u7684\u6570\u636e","title":"\u65e0\u76d1\u7763\u5b66\u4e60"},{"location":"cs/ai/ml/#_7","text":"\u4e00\u79cd\u5e8f\u5217\u6570\u636e\u51b3\u7b56\u5b66\u4e60\u65b9\u6cd5 \u4ece\u4e0e\u73af\u5883\u4ea4\u4e92\u4e2d\u5b66\u4e60\uff0c\u901a\u8fc7\u56de\u62a5\u503c\uff08reward\uff09\u8ba9\u667a\u80fd\u4f53\uff08agent\uff09\u5b66\u4e60\u5230\u5728\u4e0d\u540c\u72b6\u6001\uff08state\uff09\u4e0b\u5982\u4f55\u9009\u62e9\u884c\u4e3a\u65b9\u5f0f\uff08action\uff09","title":"\u5f3a\u5316\u5b66\u4e60"},{"location":"cs/ai/ml/#_8","text":"\u6709 \\(n\\) \u4e2a\u7279\u5f81 \\([x_1, ..., x_n]^{\\top}\\) \uff0c \\(m\\) \u4e2a\u8bad\u7ec3\u6570 \\(\\{(\\mathbf{x_i}, \\mathbf{y_i})\\}_{i=1}^m\\) \uff0c\u9700\u8981\u627e\u5230\u53c2\u6570 \\(\\mathbf{\\theta}\\) \u4f7f\u5f97\u7ebf\u6027\u51fd\u6570 \\(h_\\theta(\\mathbf{x})=\\theta_0+\\mathbf{\\theta}^{\\top} \\mathbf{x}\\) \u6700\u5c0f\u5316\u5747\u65b9\u8bef\u5dee\u51fd\u6570 \\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)})^2 \\]","title":"\u591a\u5143\u7ebf\u6027\u56de\u5f52"},{"location":"cs/ai/ml/#_9","text":"\\[ J(\\theta_1, \\theta_2, ..., \\theta_n) = \\frac{1}{2m}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})^{\\top}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta}) \\] \u5bf9\u5747\u65b9\u8bef\u5dee\u51fd\u6570\u6c42\u5bfc\u5f97 \\(\\nabla J(\\mathbf{\\theta})=-\\frac{1}{m}\\mathbf{X}(\\mathbf{y} - \\mathbf{X}^{\\top} \\mathbf{\\theta})\\) \uff0c\u4ee4\u68af\u5ea6\u7b49\u4e8e 0 \u5f97 \\[\\mathbf{\\theta}=(\\mathbf{X}\\mathbf{X^{\\top}})^{-1}\\mathbf{X}\\mathbf{y}\\]","title":"\u77e9\u9635\u6c42\u9006"},{"location":"cs/ai/ml/#_10","text":"\\[ \\theta_j := \\theta_j - \\alpha \\frac{\\partial}{\\partial \\theta_j} J(\\theta) \\\\ \\theta_j := \\theta_j = \\alpha \\frac{1}{m} \\sum_{i=1}^m (h_{\\theta}(x^{(i)})-y^{(i)}) x_j^{(i)} \\\\ \\] \\(x_j^{(i)}\\) \u8868\u793a\u7b2c \\(i\\) \u4e2a\u6837\u672c\u4e2d\u7b2c \\(j\\) \u4e2a\u7279\u5f81\u3002","title":"\u68af\u5ea6\u4e0b\u964d"},{"location":"cs/ai/ml/#_11","text":"\u4f7f\u5f97\u6240\u6709\u4e0d\u540c\u7684\u7279\u5f81\u5c3a\u5ea6\u8fd1\u4f3c\u3002 \u5e38\u7528\u65b9\u6cd5\uff1a \u5747\u503c\u5f52\u4e00\u5316: \\(x_i=\\frac{x_i - \\mu_i}{x_{i\\_max}-x_{i\\_min}}\\)","title":"\u7279\u5f81\u5f52\u4e00\u5316"},{"location":"cs/ai/ml/#_12","text":"\u5efa\u8bae\u9009\u62e9\u7b56\u7565\uff1a...,0.001,0.003,0.01,0.03,0.1,0.3,... \u901a\u8fc7\u4ee3\u4ef7\u6536\u655b\u56fe\uff0c\u5206\u6790\u9009\u62e9\u5408\u9002\u7684 \\(\\alpha\\)","title":"\u5b66\u4e60\u7387"},{"location":"cs/ai/ml/#_13","text":"\u68af\u5ea6\u4e0b\u964d \u9700\u8981\u786e\u5b9a \\(\\alpha\\) \u9700\u8981\u591a\u6b21\u5faa\u73af \u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\u65f6\u4e5f\u53ef\u4ee5\u5f88\u597d\u5de5\u4f5c \u7279\u5f81\u9700\u8981\u5f52\u4e00\u5316 \u77e9\u9635\u6c42\u9006 \u4e0d\u9700\u8981\u9009\u62e9 \\(\\alpha\\) \u4e0d\u9700\u8981\u5faa\u73af \u8981\u8ba1\u7b97 \\((X^{\\top} X)^{-1}\\) \u5982\u679c\u7279\u5f81\u6570 \\(n\\) \u5f88\u5927\uff0c\u7b97\u6cd5\u4f1a\u975e\u5e38\u6162\uff0c\u5bf9\u5185\u5b58\u8981\u6c42\u9ad8 \u7279\u5f81\u4e0d\u9700\u8981\u5f52\u4e00\u5316","title":"\u5bf9\u6bd4"},{"location":"cs/ai/ml/#_14","text":"\u673a\u5668\u5b66\u4e60--\u7ebf\u6027\u56de\u5f52 724 KB / 12 P / 2023-09-23 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_15","text":"\u7ebf\u6027\u56de\u5f52\u5bf9\u79bb\u7fa4\u70b9\u975e\u5e38\u654f\u611f\uff0c\u5bfc\u81f4\u6a21\u578b\u4e0d\u7a33\u5b9a\uff0c\u4e3a\u4e86\u7f13\u89e3\u8fd9\u4e2a\u95ee\u9898\u53ef\u4ee5\u8003\u8651\u903b\u8f91\u65af\u8482\u56de\u5f52\uff08logistic regression\uff09","title":"\u903b\u8f91\u56de\u5f52"},{"location":"cs/ai/ml/#_16","text":"\u903b\u8f91\u56de\u5f52\u662f\u5206\u7c7b\u6a21\u578b\uff0c\u4e0d\u662f\u56de\u5f52\u6a21\u578b \u4e8c\u5206\u7c7b\u95ee\u9898\uff1a \\(y \\in \\{0, 1\\}\\) \uff0c0 \u8868\u793a\u8d1f\u6837\u672c\uff0c1 \u8868\u793a\u6b63\u6837\u672c \\(h_\\theta(x)\\) \u53ef\u80fd \\(>1\\) \u6216 \\(<0\\) \uff0c\u903b\u8f91\u56de\u5f52\u7684\u76ee\u7684\uff1a \\(0 \\le h_\\theta(x) \\le 1\\)","title":"\u5206\u7c7b"},{"location":"cs/ai/ml/#_17","text":"\u903b\u8f91\u56de\u5f52\u7684\u6a21\u578b\uff1a \\(h_\\theta(x)=g(\\theta^{\\top}x)\\) \uff0c\u5176\u4e2d \\(g(z)=\\frac{1}{1+e^{-z}}\\) \uff0c\u79f0\u4e3a\u903b\u8f91\u51fd\u6570\uff08logistic function\uff09\u6216 Sigmoid \u51fd\u6570 \\[ y=\\frac{1}{1+e^{-z}}=\\frac{1}{1+e^{\\mathbf{x}\\top \\mathbf{x} + b}} \\] \u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570 \u6ee1\u8db3\u5206\u7c7b\u7684\u76ee\u7684 \u4fdd\u8bc1\u6536\u655b\uff08\u51f8\u51fd\u6570\uff09 \\[ Cost(h_\\theta(x),y)= \\left\\{\\begin{matrix} -\\log (h_\\theta(x)) & if \\ y=1 \\\\ -\\log (1-h_\\theta(x)) & if \\ y=0 \\end{matrix}\\right. \\]","title":"\u5b66\u4e60\u6a21\u578b"},{"location":"cs/ai/ml/#_18","text":"\u903b\u8f91\u56de\u5f52\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ J(\\theta)=\\frac{1}{m} \\sum_{i=1}^m Cost(h_\\theta(x^{(i)}),y^{(i)}) \\\\ =-\\frac{1}{m} \\sum_{i=1}^m [y^{(i)}\\log (h_\\theta(x^{(i)}))+(1-y^{(i)})\\log (1-h_\\theta(x^{(i)}))] \\] \u4f18\u5316\u6a21\u578b\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u8981\u7ed9\u5b9a\u7684\u6837\u672c \\(\\mathbf{x}\\) \uff0c\u9884\u6d4b \\(y\\) \uff0c\u8f93\u51fa \\(h_\\theta(x)=\\frac{1}{1+e^{-\\theta \\top x}}\\) \u68af\u5ea6\u4e0b\u964d \\[ \\frac{\\partial J(\\theta)}{\\partial x}= \\frac{1}{m} \\sum_{i=1}^m (h_\\theta(x^{(i)})-y^{(i)})x_j^{(i)} \\] \u76ee\u6807\uff1a \\(\\underset{\\theta}{\\min} J(\\theta)\\) \u533a\u522b\uff1a\u7ebf\u6027\u56de\u5f52\uff1a \\(h_\\theta (x)=\\theta^\\top X\\) \uff0c\u903b\u8f91\u56de\u5f52\uff1a \\(h_\\theta(x)=\\frac{1}{1-e^{- \\theta \\top X}}\\)","title":"\u7b80\u5316\u7684\u4ee3\u4ef7\u51fd\u6570\u53ca\u68af\u5ea6\u4e0b\u964d"},{"location":"cs/ai/ml/#_19","text":"","title":"\u9ad8\u7ea7\u4f18\u5316\u95ee\u9898"},{"location":"cs/ai/ml/#_20","text":"cvxpy \u7cfb\u5217\uff0ccvxpy\uff0ccvxOPT\uff0c\u8fd9\u51e0\u4e2a\u5305\u4e3b\u8981\u89e3\u51b3\u51f8\u4f18\u5316\u95ee\u9898 scipy.optimizes.scipy \u4e5f\u6709\u4f18\u5316\u65b9\u6cd5","title":"\u4f18\u5316\u7b97\u6cd5"},{"location":"cs/ai/ml/#scipyoptimize","text":"\u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\uff08\u4f8b\u5982 BFGS\uff0cNelder-Mead simplex\uff0cNewton Conjugate Gradient\uff0cCOBYLA \u6216 SLSQP\uff09\u5bf9\u591a\u53d8\u91cf\u6807\u91cf\u51fd\u6570\uff08\u6700\u5c0f\u5316\uff08\uff09\uff09\u8fdb\u884c\u65e0\u7ea6\u675f\u548c\u7ea6\u675f\u6700\u5c0f\u5316 \u5168\u5c40\uff08\u5f3a\u529b\uff09\u4f18\u5316\u7a0b\u5e8f\uff08\u4f8b\u5982\uff0c\u9000\u706b\uff08\uff09\uff0c\u6d41\u57df\u8d2d\u7269\uff08\uff09\uff09 \u6700\u5c0f\u4e8c\u4e58\u6700\u5c0f\u5316\uff08leastsq\uff08\uff09\uff09\u548c\u66f2\u7ebf\u62df\u5408\uff08curve_fit\uff08\uff09\uff09\u7b97\u6cd5 \u6807\u91cf\u4f46\u53d8\u91cf\u51fd\u6570\u6700\u5c0f\u5316\u5668\uff08minimize_scalar\uff08\uff09\uff09\u548c\u6839\u67e5\u627e\u5668\uff08newton\uff08\uff09\uff09 \u4f7f\u7528\u5404\u79cd\u7b97\u6cd5\u7684\u591a\u53d8\u91cf\u65b9\u7a0b\u7cfb\u7edf\u6c42\u89e3\u5668\uff08root\uff08\uff09\uff09\uff08\u4f8b\u5982\u6df7\u5408 Powell\uff0cLevenberg-Marquardt \u6216\u5927\u89c4\u6a21\u65b9\u6cd5\uff0c\u5982 Newton-Krylov\uff09","title":"scipy.optimize"},{"location":"cs/ai/ml/#_21","text":"\u4e00 VS \u591a \\(\\to\\) 1 VS \u5176\u4ed6 \u8f6c\u6362\u4e3a \u4e00 VS \u591a \\(\\to\\) 1 VS \u53e6\u4e00\u7c7b \u6784\u5efa\u5206\u7c7b\u5668 \u6811\u72b6\u5206\u7c7b\u5668\u6784\u5efa\uff0c\u805a\u7c7b+\u51b3\u7b56\u6811\u6765\u641c\u7d22\u7c7b\u522b\u5dee\u8ddd \u89e3\u51b3\u65b9\u6cd5\uff1a \u8bad\u7ec3 \uff1a\u4e3a\u6bcf\u4e2a\u7c7b\u522b i\uff0c\u8bad\u7ec3\u4e00\u4e2a\u5206\u7c7b\u5668 \\(h_\\theta^{(i)}(x)\\) \uff0c\u4ee5\u9884\u6d4b \\(y=i\\) \u7684\u6982\u7387 \u6d4b\u8bd5 \uff1a\u7ed9\u5b9a\u4e00\u4e2a\u6d4b\u8bd5\u6837\u672c x\uff0c\u6d4b\u8bd5\u6bcf\u4e2a\u7c7b\u522b\u6a21\u578b \\(h_\\theta^{(i)}(x)\\) \uff0c\u9009\u62e9\u6ee1\u8db3 \\(\\underset{i}{\\max} h_\\theta^{(i)}(x)\\) \u7684 i\uff0c\u5373\u4e3a\u6700\u4f18\u7c7b\u522b","title":"\u591a\u5206\u7c7b\u95ee\u9898"},{"location":"cs/ai/ml/#_22","text":"\u673a\u5668\u5b66\u4e60--\u903b\u8f91\u56de\u5f52 938 KB / 9 P / 2023-10-10 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_23","text":"matplotlib seaborn pyecharts Pandas","title":"\u6570\u636e\u53ef\u89c6\u5316"},{"location":"cs/ai/ml/#_24","text":"\u652f\u6301\u5411\u91cf\u673a SVM \u662f\u4e00\u7c7b\u6309 \u76d1\u7763\u5b66\u4e60 \u65b9\u5f0f\u5bf9\u6570\u636e\u8fdb\u884c\u4e8c\u5143\u5206\u7c7b\u7684\u5e7f\u4e49\u7ebf\u6027\u5206\u7c7b\u5668 \u51b3\u7b56\u8fb9\u754c\u662f\u5bf9\u5b66\u4e60\u6837\u672c\u6c42\u89e3\u7684 \u6700\u5927\u8fb9\u8ddd\u8d85\u5e73\u9762 \u89e3\u51b3\u7ebf\u6027\u53ef\u5206\u95ee\u9898 \u5c06\u7ebf\u6027\u53ef\u5206\u95ee\u9898\u4e2d\u5f97\u5230\u7684\u7ed3\u8bba\u63a8\u5e7f\u5230\u7ebf\u6027\u4e0d\u53ef\u5206\u2014\u2014\u6838\u51fd\u6570","title":"\u652f\u6301\u5411\u91cf\u673a"},{"location":"cs/ai/ml/#vs","text":"","title":"\u7ebf\u6027\u53ef\u5206 VS \u7ebf\u6027\u4e0d\u53ef\u5206"},{"location":"cs/ai/ml/#_25","text":"\u4e8c\u7ef4\uff1a\u4e00\u6761\u76f4\u7ebf \u4e09\u7ef4\uff1a\u4e00\u4e2a\u5e73\u9762 \u56db\u7ef4\u53ca\u66f4\u9ad8\u7ef4\uff1a\u4e00\u4e2a\u8d85\u5e73\u9762 Hyperplane \u6570\u5b66\u5b9a\u4e49\uff1a\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_1,y_1),(X_2,y_2),...,(X_n,y_n)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega_1,\\omega_2,b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \u82e5 \\(y_i =+1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b > 0\\) \u82e5 \\(y_i =-1\\) \uff0c\u5219 \\(\\omega_1 x_{i1} + \\omega_2 x_{i2} + b < 0\\) \u652f\u6301\u5411\u91cf\u673a\u8d85\u5e73\u9762\u4e0e\u6700\u4f18\u5316 \u5047\u5b9a\u6837\u672c\u96c6\u7ebf\u6027\u53ef\u5206 SVM \u8981\u5bfb\u627e\u7684\u5c31\u662f\u5177\u6709\u6700\u5927 margin \u7684\u8d85\u5e73\u9762\uff0c\u4e14\u79bb\u4e24\u8fb9\u7684\u652f\u6301\u5411\u91cf\u8ddd\u79bb\u76f8\u7b49\uff0c\u53ef\u8868\u793a\u4e3a \\[ \\min \\frac{1}{2} \\parallel \\omega \\parallel^2 \\\\ \u7ea6\u675f\u6761\u4ef6\uff1ay_i(\\omega^\\top X_i + b) \\ge 1 \\ \\ \\ (i=1 \\sim N) \\]","title":"\u7ebf\u6027\u53ef\u5206"},{"location":"cs/ai/ml/#_26","text":"\u5982\u679c \\(y_i=\\{+1,-1\\}\\) \uff0c\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u96c6 \\(\\{(X_i,y_i)\\}\\) \uff0c\u5728 \\(i=1 \\sim N\\) \u7ebf\u6027\u53ef\u5206\uff0c\u662f\u6307\u5b58\u5728 \\((\\omega, b)\\) \uff0c\u4f7f\u5f97\u5bf9 \\(i=1 \\sim N\\) \uff0c\u6709 \\(y_i(\\omega^\\top X_i + b) > 0\\) \u5178\u578b\u7684\u7ebf\u6027\u4e0d\u53ef\u5206\u95ee\u9898\u2014\u2014 \u5f02\u6216 \u975e\u7ebf\u6027\u51b3\u7b56\u8fb9\u754c \u9700\u8981\u4e00\u4e2a\u9ad8\u9636\u6a21\u578b\u4ee5\u5b9e\u73b0\u8fd9\u6837\u7684\u975e\u7ebf\u6027\u5206\u7c7b\u95ee\u9898\uff0c\u672c\u8d28\u662f\u5c06\u4e8c\u7ef4\u7a7a\u95f4\u95ee\u9898\u6620\u5c04\u4e3a\u9ad8\u7ef4\u7a7a\u95f4\u95ee\u9898 \u4f4e\u7ef4\u5230\u9ad8\u7ef4\u7684\u6620\u5c04\u2014\u2014\u6838\u51fd\u6570\uff08\u7406\u8bba\u4e0a\u51e0\u4e4e\u901a\u7528\u4e8e\u6240\u6709\u5206\u7c7b Cover \u5b9a\u7406 \u5728\u4e00\u4e2a M \u7ef4\u7a7a\u95f4\u4e0a\u968f\u673a\u53d6 N \u4e2a\u8bad\u7ec3\u6837\u672c\u968f\u673a\u7684\u5bf9\u6bcf\u4e2a\u8bad\u7ec3 d \u8d4b\u4e88\u6807\u7b7e +1 \u6216 -1 \u8fd9\u4e9b\u8bad\u7ec3\u6837\u672c\u7ebf\u6027\u53ef\u5206\u7684\u6982\u7387\u4e3a \\(P(M)\\) \uff0c\u5219\u5f53 M \u8d8b\u5411\u65e0\u7a77\u5927\u65f6 \\(P(M)=1\\) M \u4e0a\u5347 \\(\\to\\) \\((\\omega, b)\\) \u7ef4\u5ea6\u4e0a\u5347 \\(\\to\\) \u6a21\u578b\u81ea\u7531\u5ea6\u4e0a\u5347 \\(\\to\\) \u7ebf\u6027\u53ef\u5206\u6982\u7387\u4e0a\u5347 \u5982\u4f55\u5bfb\u627e\u6838\u51fd\u6570","title":"\u7ebf\u6027\u4e0d\u53ef\u5206"},{"location":"cs/ai/ml/#_27","text":"\u7ebf\u6027\u6838\u51fd\u6570 \\(K(x,xi)=x \\cdot xi\\) \u591a\u9879\u5f0f\u6838 Polynomial kernel \\((x^\\top l+\u5e38\u91cf)^{\u5e38\u91cf}\\) \u5f84\u5411\u57fa\u6838(RBF) \\(K(x,xi)=\\exp(- \\parallel x - xi \\parallel / 2 \\sigma^2)\\)","title":"\u6838\u51fd\u6570"},{"location":"cs/ai/ml/#_28","text":"\u673a\u5668\u5b66\u4e60--\u652f\u6301\u5411\u91cf\u673a 892 KB / 9 P / 2023-10-20 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_29","text":"","title":"\u795e\u7ecf\u7f51\u7edc"},{"location":"cs/ai/ml/#mp","text":"\u5305\u542b\u8f93\u5165\u8f93\u51fa\u4e0e\u8ba1\u7b97\u529f\u80fd\u7684\u6a21\u578b","title":"\u795e\u7ecf\u5143\u6a21\u578b MP"},{"location":"cs/ai/ml/#_30","text":"\u4e0e\u795e\u7ecf\u5143\u6a21\u578b\u4e0d\u540c\uff0c\u611f\u77e5\u5668\u4e2d\u7684\u6743\u503c\u662f\u901a\u8fc7\u8bad\u7ec3\u5f97\u5230\u7684 \u611f\u77e5\u5668\u53ef\u4ee5\u505a\uff08\u7b80\u5355\uff09\u7ebf\u6027\u5206\u7c7b\u4efb\u52a1 \u7528\u51b3\u7b56\u8fb9\u754c\u6765\u8868\u8fbe\u5206\u7c7b\u6548\u679c XOR \u65e0\u6cd5\u89e3\u51b3","title":"\u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u611f\u77e5\u5668\uff09"},{"location":"cs/ai/ml/#_31","text":"","title":"\u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\uff08\u591a\u5c42\u611f\u77e5\u5668\uff09"},{"location":"cs/ai/ml/#_32","text":"\u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u9664\u4e86\u8f93\u5165\u5c42\u548c\u8f93\u51fa\u5c42\uff0c\u8fd8\u589e\u52a0\u4e00\u4e2a\u4e2d\u95f4\u5c42 \u4e2d\u95f4\u5c42\u548c\u8f93\u51fa\u5c42\u90fd\u662f\u8ba1\u7b97\u5c42 \u901a\u8fc7\u6269\u5c55\u4e0a\u4e2a\u5355\u5143\u7684\u5355\u5c42\u795e\u7ecf\u7f51\u7edc\uff0c\u5728\u53f3\u8fb9\u65b0\u52a0\u4e00\u4e2a\u5c42\u6b21","title":"\u7ed3\u6784"},{"location":"cs/ai/ml/#_33","text":"\u8f93\u5165\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u7279\u5f81\u7684\u7ef4\u5ea6\u5339\u914d \u8f93\u51fa\u5c42\u7684\u8282\u70b9\u6570\u9700\u8981\u4e0e\u76ee\u6807\u7684\u7ef4\u5ea6\u5339\u914d \u4e2d\u95f4\u5c42\u7684\u8282\u70b9\u6570\u7531\u8bbe\u8ba1\u8005\u51b3\u5b9a \u8f83\u597d\u7684\u65b9\u6cd5\u5c31\u662f\u9884\u5148\u8bbe\u5b9a\u51e0\u4e2a\u53ef\u9009\u503c\uff0c\u901a\u8fc7\u5207\u6362\u4e0d\u540c\u503c\u6765\u770b\u6574\u4e2a\u6a21\u578b\u7684\u9884\u6d4b\u6548\u679c\uff0c\u7b80\u79f0 Grid Search","title":"\u9690\u85cf\u5c42\u7684\u8282\u70b9\u6570\u8bbe\u8ba1"},{"location":"cs/ai/ml/#_34","text":"","title":"\u4e24\u5c42\u795e\u7ecf\u7f51\u7edc\u8bad\u7ec3"},{"location":"cs/ai/ml/#_35","text":"\u9996\u5148\u7ed9\u6240\u6709\u53c2\u6570\u8d4b\u4e0a\u968f\u673a\u503c\uff0c\u4f7f\u7528\u8fd9\u4e9b\u53c2\u6570\u503c\u6765\u9884\u6d4b\u8bad\u7ec3\u6570\u636e\u4e2d\u7684\u6837\u672c\uff0c\u6837\u672c\u7684\u9884\u6d4b\u76ee\u6807\u4e3a \\(y_p\\) \uff0c\u771f\u5b9e\u76ee\u6807\u4e3a \\(y\\) \u3002\u90a3\u4e48\u5b9a\u4e49\u4e00\u4e2a\u503c \\(loss = (y_p-y)/2\\) loss \u79f0\u4e4b\u4e3a\u635f\u5931\uff0c\u76ee\u6807\u5c31\u662f\u4f7f\u5bf9\u6240\u6709\u8bad\u7ec3\u6570\u636e\u7684\u635f\u5931\u548c\u5c3d\u53ef\u80fd\u7684\u5c0f \u5982\u679c\u5c06\u5148\u524d\u7684\u795e\u7ecf\u7f51\u7edc\u9884\u6d4b\u7684\u77e9\u9635\u516c\u5f0f\u5e26\u5165\u5230 \\(y_p\\) \u4e2d\uff08\u56e0\u4e3a\u6709 \\(z=y_p\\) \uff09\uff0c\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u628a\u635f\u5931\u5199\u4e3a\u5173\u4e8e\u53c2\u6570\u7684\u51fd\u6570\uff0c\u8fd9\u4e2a\u51fd\u6570\u79f0\u4e4b\u4e3a \u635f\u5931\u51fd\u6570(loss function)","title":"\u8bad\u7ec3\u4e0e\u635f\u5931\u51fd\u6570"},{"location":"cs/ai/ml/#_36","text":"\u4e00\u822c\u4f7f\u7528\u68af\u5ea6\u4e0b\u964d\u6cd5\u6765\u4f18\u5316\uff0c\u56e0\u4e3a\u4ee3\u4ef7\u5f88\u5927\uff0c\u6240\u4ee5\u9700\u8981\u4f7f\u7528\u53cd\u5411\u4f20\u64ad\u7b97\u6cd5 \u53cd\u5411\u4f20\u64ad\u7b97\u6cd5\u5229\u7528\u795e\u7ecf\u7f51\u7edc\u7684\u7ed3\u6784\u8fdb\u884c\u7684\u8ba1\u7b97\uff0c\u4e0d\u4e00\u6b21\u8ba1\u7b97\u6240\u6709\u7684\u68af\u5ea6\uff0c\u800c\u662f\u4ece\u540e\u5f80\u524d \u53cd\u5411\u4f20\u64ad\u7684\u4f9d\u636e\uff1a\u94fe\u5f0f\u6cd5\u5219","title":"\u795e\u7ecf\u7f51\u7edc\u4f18\u5316\u95ee\u9898"},{"location":"cs/ai/ml/#_37","text":"Pytorch optimizer = torch . optim . SGD ( model . parameters (), lr = 0.01 ) ... loss . backward () TensorFlow train = tf . train . GradientDescentOptimizer ( learning_rate = 0.01 ) . minimize ( loss )","title":"\u6846\u67b6"},{"location":"cs/ai/ml/#_38","text":"\u673a\u5668\u5b66\u4e60--\u795e\u7ecf\u7f51\u7edc 855 KB / 7 P / 2023-10-20 \u4e0b\u8f7d","title":"\u5b9e\u9a8c\u62a5\u544a"},{"location":"cs/ai/ml/#_39","text":"\u8bef\u5dee\u5f88\u5927\u65f6 \u83b7\u53d6\u66f4\u591a\u7684\u8bad\u7ec3\u6570\u636e \u5c1d\u8bd5\u51cf\u5c11\u7279\u5f81 \u5927\u91cf\u65f6\u95f4\uff08>6\u4e2a\u6708\uff09\u53ef\u80fd\u90fd\u5728\u505a\u8fd9\u4e9b\u8c03\u6574 \u5c1d\u8bd5\u589e\u52a0\u591a\u9879\u5f0f\u7279\u5f81 \u5c1d\u8bd5\u964d\u4f4e/\u63d0\u9ad8 \\(\\lambda\\)","title":"\u8bc6\u522b\u7cfb\u7edf\u7684\u6a21\u578b\u9009\u62e9\u4e0e\u8bc4\u4f30"},{"location":"cs/ai/ml/#_40","text":"\u9ad8\u9636\u6a21\u578b\u80fd\u591f\u5f88\u597d\u5730\u62df\u5408\uff0c\u4f46\u5bf9\u4e0d\u5728\u8bad\u7ec3\u96c6\u4e2d\u7684\u65b0\u6837\u672c\u7f3a\u4e4f\u6cdb\u5316\u80fd\u529b \u53ef\u4ee5\u8003\u8651\u6253\u4e71\u6570\u636e\uff0c\u4ee5\u589e\u5f3a\u6cdb\u5316\u80fd\u529b","title":"\u8bad\u7ec3\u96c6\u3001\u6d4b\u8bd5\u96c6\u3001\u6821\u9a8c\u96c6"},{"location":"cs/ai/ml/#_41","text":"\u9519\u8bef\u7387\uff1a\u9519\u5206\u6837\u672c\u7684\u5360\u6bd4 \u8bef\u5dee\uff1a\u6837\u672c\u771f\u5b9e\u8f93\u51fa\u4e0e\u9884\u6d4b\u8f93\u51fa\u4e4b\u95f4\u7684\u5dee\u5f02 \u8bad\u7ec3\uff08\u7ecf\u9a8c\uff09\u8bef\u5dee\uff1a\u8bad\u7ec3\u96c6 \u6d4b\u8bd5\u8bef\u5dee\uff1a\u6d4b\u8bd5\u96c6 \u6cdb\u5316\u8bef\u5dee\uff1a\u9664\u8bad\u7ec3\u96c6\u5916\u6240\u6709\u6837\u672c","title":"\u9519\u8bef\u7387&\u8bef\u5dee"},{"location":"cs/ai/ml/#_42","text":"\u8fc7\u62df\u5408 \u5b66\u4e60\u5668\u628a\u6240\u6709\u8bad\u7ec3\u6837\u672c\u5b66\u4e60\u7684\u201c\u592a\u597d\u201d\uff0c\u5c06\u8bad\u7ec3\u6837\u672c\u672c\u8eab\u7684\u7279\u70b9\u5f53\u4f5c\u6240\u6709\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\uff0c\u5bfc\u81f4\u6cdb\u5316\u6027\u80fd\u4e0b\u964d \u4f18\u5316\u76ee\u6807\u52a0\u6b63\u5219\u9879 early stop \u6b20\u62df\u5408 \u5bf9\u8bad\u7ec3\u6837\u672c\u7684\u4e00\u822c\u6027\u8d28\u5c1a\u672a\u5b66\u597d \u51b3\u7b56\u6811\uff1a\u62d3\u5c55\u5206\u652f \u795e\u7ecf\u7f51\u7edc\uff1a\u589e\u52a0\u8bad\u7ec3\u8f6e\u6570","title":"\u7ecf\u9a8c\u8bef\u5dee\u4e0e\u8fc7\u62df\u5408"},{"location":"cs/ai/ml/#_43","text":"","title":"\u5e38\u7528\u8bc4\u4f30\u65b9\u6cd5"},{"location":"cs/ai/ml/#_44","text":"\u76f4\u63a5\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a\u4e24\u4e2a\u4e92\u65a5\u96c6\u5408 \u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u5212\u5206\u8981\u5c3d\u53ef\u80fd\u4fdd\u6301\u6570\u636e\u5206\u5e03\u7684\u4e00\u81f4\u6027 \u4e00\u822c\u82e5\u5e72\u6b21\u968f\u673a\u5212\u5206\uff0c\u91cd\u590d\u5b9e\u9a8c\u53d6\u5e73\u5747\u503c \u8bad\u7ec3/\u6d4b\u8bd5\u6837\u672c\u6bd4\u4f8b\u901a\u5e38\u4e3a 2:1-4:1","title":"\u7559\u51fa\u6cd5"},{"location":"cs/ai/ml/#_45","text":"\u5c06\u6570\u636e\u96c6\u5212\u5206\u4e3a k \u4e2a\u5927\u5c0f\u76f8\u4f3c\u7684\u4e92\u65a5\u5b50\u96c6 \u6bcf\u6b21\u7528 k-1 \u4e2a\u5b50\u96c6\u7684\u5e76\u96c6\u4f5c\u4e3a\u8bad\u7ec3\u96c6\uff0c\u4f59\u4e0b\u7684\u5b50\u96c6\u4f5c\u4e3a\u6d4b\u8bd5\u96c6 \u8fdb\u884c k \u6b21\u8bad\u7ec3\u548c\u6d4b\u8bd5\uff0c\u6700\u7ec8\u8fd4\u56de k \u6b21\u6d4b\u8bd5\u7ed3\u679c\u7684\u5747\u503c \u4e00\u822c k \u4e3a 10","title":"\u4ea4\u53c9\u9a8c\u8bc1\u6cd5"},{"location":"cs/ai/ml/#_46","text":"\u5b9e\u9645\u6a21\u578b\u4e0e\u9884\u671f\u6a21\u578b\u90fd\u4f7f\u7528 m \u4e2a\u8bad\u7ec3\u6837\u672c \u7ea6\u6709 1/3 \u7684\u6837\u672c\u6ca1\u5728\u8bad\u7ec3\u96c6\u4e2d\u51fa\u73b0 \u4ece\u521d\u59cb\u6570\u636e\u96c6\u4e2d\u4ea7\u751f\u591a\u4e2a\u4e0d\u540c\u7684\u8bad\u7ec3\u96c6\uff0c\u5bf9\u96c6\u6210\u5b66\u4e60\u6709\u5f88\u5927\u7684\u597d\u5904 \u81ea\u52a9\u6cd5\u5728\u6570\u636e\u96c6\u8f83\u5c0f\uff0c\u96be\u4ee5\u6709\u6548\u5212\u5206\u8bad\u7ec3/\u6d4b\u8bd5\u96c6\u65f6\u5f88\u6709\u7528 \u81ea\u52a9\u6cd5\u4ea7\u751f\u7684\u6570\u636e\u96c6\u6539\u53d8\u4e86\u521d\u59cb\u6570\u636e\u96c6\u7684\u5206\u5e03\uff0c\u4f1a\u5f15\u5165\u4f30\u8ba1\u504f\u5dee\uff0c\u5728\u6570\u636e\u91cf\u8db3\u591f\u65f6\uff0c\u7559\u51fa\u6cd5\u548c\u4ea4\u53c9\u9a8c\u8bc1\u6cd5\u66f4\u5e38\u7528","title":"\u81ea\u52a9\u6cd5"},{"location":"cs/ai/ml/#_47","text":"\u5206\u7c7b\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u9519\u8bef\u7387\u548c\u7cbe\u5ea6 \u9519\u8bef\u7387\uff1a \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) \\ne y_i)\\) \u7cbe\u5ea6\uff1a \\(acc(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) = y_i)=1-E(f;D)\\) \u56de\u5f52\u4efb\u52a1\u6700\u5e38\u7528\u7684\u662f\u5747\u65b9\u8bef\u5dee \\(E(f;D)=\\frac{1}{m} \\sum_{i=1}^m (f(\\mathbf{x}_i) - y_i)^2\\) \u6df7\u6dc6\u77e9\u9635 Confusion matrix \u67e5\u51c6\u7387 Precision\uff1a \\(P=\\frac{TP}{TP+FP}\\) \u67e5\u5168\u7387 Recall\uff1a \\(P=\\frac{TP}{TP+FN}\\) P-R \u66f2\u7ebf\uff1a\u6839\u636e\u5b66\u4e60\u5668\u7684\u9884\u6d4b\u7ed3\u679c\u6309\u6b63\u4f8b\u53ef\u80fd\u6027\u5927\u5c0f\u5bf9\u6837\u4f8b\u8fdb\u884c\u6392\u5e8f\uff0c\u5e76\u9010\u4e2a\u628a\u6837\u672c\u4f5c\u4e3a\u6b63\u4f8b\u8fdb\u884c\u9884\u6d4b\uff0c\u5219\u53ef\u4ee5\u5f97\u5230\u67e5\u51c6\u7387-\u67e5\u5168\u7387 F1 Score\uff1a \\(F1 Score=2\\frac{PR}{P+R}\\) \u66f4\u4e00\u822c\u7684\u5f62\u5f0f \\(F_\\beta = \\frac{(1+\\beta^2) \\times P \\times R}{(\\beta^2 \\times P) + R}\\) \\(\\beta=1\\) \uff1a\u6807\u51c6 F1 \\(\\beta<1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u51c6\u7387\uff08\u5546\u54c1\u63a8\u8350\u7cfb\u7edf\uff09 \\(\\beta>1\\) \uff1a\u66f4\u91cd\u89c6\u67e5\u5168\u7387\uff08\u9003\u72af\u4fe1\u606f\u68c0\u7d22\uff09 ROC \u66f2\u7ebf\uff1a\u53d7\u8bd5\u8005\u5de5\u4f5c\u7279\u5f81\u66f2\u7ebf \u6a2a\u8f74\uff1a \\(FPR=\\frac{FP}{FP+TN}\\) \u7eb5\u8f74\uff1a \\(TPR=\\frac{TP}{TP+FN}\\) AUC\uff1aROC \u66f2\u7ebf\u4e0b\u7684\u9762\u79ef\uff0c\u8d8a\u5927\u8d8a\u597d \u4ee3\u4ef7\u654f\u611f\u9519\u8bef\u7387","title":"\u6027\u80fd\u5ea6\u91cf"},{"location":"cs/ai/ml/#_48","text":"\u5047\u8bbe\u6821\u9a8c \u4e8c\u9879\u6821\u9a8c t \u68c0\u9a8c \u4ea4\u53c9\u9a8c\u8bc1 t \u68c0\u9a8c McNemar \u68c0\u9a8c Friedman \u68c0\u9a8c Nemenyi \u68c0\u9a8c","title":"\u6bd4\u8f83\u6821\u9a8c"},{"location":"cs/ai/ml/#_49","text":"","title":"\u805a\u7c7b"},{"location":"cs/ai/mode-recognition/","text":"\u6a21\u5f0f\u8bc6\u522b \u00b6 \u7ea6 3653 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u5b66\u4e60\u6a21\u5f0f\u8bc6\u522b\u8bfe\u7684\u4e00\u4e9b\u7b14\u8bb0 \u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u8ff0 \u00b6 \u6a21\u5f0f\u548c\u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u5ff5 \u00b6 \u6a21\u5f0f\uff1a\u5bf9\u67d0\u4e9b\u611f\u5174\u8da3\u7684\u5ba2\u4f53\u7684\u5b9a\u91cf\u7684\u6216\u7ed3\u6784\u7684\u63cf\u8ff0\u3002\u6a21\u5f0f\u7c7b\u662f\u5177\u6709\u67d0\u4e9b\u5171\u540c\u7279\u6027\u7684\u6a21\u5f0f\u7684\u96c6\u5408\u3002 \u6a21\u5f0f\u8bc6\u522b\uff1a\u7814\u7a76\u4e00\u79cd\u81ea\u52a8\u6280\u672f\uff0c\u4f9d\u9760\u8fd9\u79cd\u6280\u672f\uff0c\u8ba1\u7b97\u673a\u5c06\u81ea\u52a8\u5730\uff08\u6216\u4eba\u5c3d\u91cf\u5c11\u5730\u5e72\u6d89\uff09\u628a\u5f85\u522b\u8bc6\u6a21\u5f0f\u5206\u914d\u5230\u5404\u81ea\u7684\u6a21\u5f0f\u7c7b\u4e2d\u53bb\u3002 \u6a21\u5f0f\u8bc6\u522b\u7cfb\u7edf\u7ec4\u6210 \u00b6 \u6ce8\u610f\u201c\u5904\u7406\u201d\u4e0e\u201c\u8bc6\u522b\u201d\u4e24\u4e2a\u6982\u5ff5\u7684\u533a\u522b \u6a21\u5f0f\u8bc6\u522b\u7684\u5206\u7c7b \u00b6 \u4ece\u7406\u8bba\u4e0a\u5206\u7c7b \u7edf\u8ba1\u6a21\u5f0f\u8bc6\u522b \u53e5\u6cd5\u6a21\u5f0f\u8bc6\u522b\uff08\u7ed3\u6784\u6a21\u5f0f\u8bc6\u522b\uff09 \u6a21\u7cca\u6a21\u5f0f\u8bc6\u522b \u795e\u7ecf\u7f51\u7edc\u6a21\u5f0f\u8bc6\u522b \u4ece\u5b9e\u73b0\u65b9\u6cd5\u5206\u7c7b \u76d1\u7763\u5206\u7c7b \u975e\u76d1\u7763\u5206\u7c7b \u6a21\u5f0f\u8bc6\u522b\u7684\u5e94\u7528 \u00b6 \u4e0d\u505c\u8f66\u6536\u8d39\u7cfb\u7edf \u5173\u952e\uff1a\u8f66\u578b\u7684\u81ea\u52a8\u5206\u7c7b\u3002\u51e0\u79cd\u4e3b\u8981\u6280\u672f\uff1a \u63d0\u53d6\u8f66\u8f86\u5916\u5f62\u51e0\u4f55\u53c2\u6570\u8fdb\u884c\u5904\u7406\u5206\u6790\uff0c\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u89c6\u9891\u68c0\u6d4b\u65b9\u6cd5\u3001\u7ea2\u5916\u68c0\u6d4b\u65b9\u6cd5\u3002 \u6d4b\u91cf\u8f66\u8f86\u7684\u5176\u4ed6\u7269\u7406\u53c2\u6570\uff08\u566a\u58f0\u3001\u632f\u52a8\u3001\u538b\u91cd\u7b49\uff09\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u52a8\u6001\u79f0\u91cd\u3001\u7535\u78c1\u611f\u5e94\u7b49\u3002 \u76f4\u63a5\u8bc6\u522b\u8f66\u8f86\u8eab\u4efd\u7684\u65b9\u6cd5\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u7535\u5b50\u6807\u7b7e\u3001\u89c6\u9891\u724c\u7167\u65b9\u6cd5\u7b49 \u805a\u7c7b\u5206\u6790 \u00b6 \u8ddd\u79bb\u805a\u7c7b\u7684\u6982\u5ff5 \u00b6 \u6982\u5ff5\uff1a \u7269\u4ee5\u7c7b\u805a \u805a\u7c7b\u5206\u6790\uff1a\u6839\u636e\u6a21\u5f0f\u4e4b\u95f4\u7684 \u76f8\u4f3c\u6027 \u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\uff0c\u662f\u4e00\u79cd\u975e\u76d1\u7763\u5206\u7c7b\u65b9\u6cd5\u3002 \u76f8\u4f3c\u5ea6\u542b\u4e49 \u6709 n \u4e2a\u7279\u5f81\u5219\u7ec4\u6210 n \u7ef4\u5411\u91cf \\(X=[x_1, x_2, ..., x_n]^{\\top}\\) \u79f0\u4e3a\u8be5\u6837\u672c\u7684\u7279\u5f81\u5411\u91cf\u3002\u5b83\u76f8\u5f53\u4e8e\u7279\u5f81\u7a7a\u95f4\u4e2d\u7684\u4e00\u4e2a\u70b9\uff0c\u4ee5\u7279\u5f81\u7a7a\u95f4\u4e2d\uff0c \u70b9\u95f4\u7684\u8ddd\u79bb\u51fd\u6570\u4f5c\u4e3a\u6a21\u5f0f\u76f8\u4f3c\u5ea6\u7684\u6d4b\u91cf \uff0c\u4ee5\u201c\u8ddd\u79bb\u201d\u4f5c\u4e3a\u6a21\u5f0f\u5206\u7c7b\u7684\u4f9d\u636e\uff0c \u8ddd\u79bb\u8d8a\u5c0f\uff0c\u8d8a\u76f8\u4f3c \u805a\u7c7b\u5206\u6790\u662f\u5426\u6709\u6548\uff0c\u4e0e\u6a21\u5f0f\u7279\u5f81\u5411\u91cf\u7684\u5206\u5e03\u5f62\u5f0f\u6709\u5f88\u5927\u5173\u7cfb\u3002\u9009\u53d6\u7684\u7279\u5f81\u5411\u91cf\u662f\u5426\u5408\u9002\u975e\u5e38\u5173\u952e\u3002 \u76f8\u4f3c\u6027\u6d4b\u5ea6\u548c\u805a\u7c7b\u51c6\u5219 \u00b6 \u76f8\u4f3c\u6027\u6d4b\u5ea6 \u00b6 \u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u76f8\u4f3c\u6027\u7684\u4e00\u79cd\u5c3a\u5ea6\u3002\u5982\uff1a\u8ddd\u79bb\u3002 \u6b27\u6c0f\u8ddd\u79bb \u8bbe \\(X_1, X_2\\) \u4e3a\u4e24\u4e2a n \u7ef4\u6a21\u5f0f\u6837\u672c\uff0c \\(X_1 = [x_{11}, x_{12}, ..., x_{1n}]^{\\top}, X_2 = [x_{21}, x_{22}, ..., x_{2n}]^{\\top}\\) \uff0c\u6b27\u6c0f\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D(X_1, X_2) = \\parallel X_1 - X_2 \\parallel = \\sqrt{(X_1 - X_2)^{\\top}(X_1-X_2)} \\] \u8ddd\u79bb\u8d8a\u5c0f\u8d8a\u76f8\u4f3c\u3002 \u9a6c\u5f0f\u8ddd\u79bb \u5e73\u65b9\u8868\u8fbe\u5f0f\uff1a \\(D^2=(X_1-X_2)^{\\top}C^{-1}(X_1-X_2)\\) \u4ee4 \\(M:\\) \u5747\u503c\u5411\u91cf M_Mean\uff0c \\(C:\\) \u8be5\u7c7b\u6a21\u5f0f\u603b\u4f53\u7684\u534f\u65b9\u5dee\u77e9\u9635 C_covariance\u3002 \u5bf9 n \u7ef4\u5411\u91cf: \\(X=[x_1, ..., x_n]^{\\top},M=[m_1,...,m_n]^{\\top}\\) \\[ C = E\\{(X-M)(X-M)^{\\top}\\} \\\\ = E \\{ \\begin{bmatrix} (x_1-m_1) \\\\ (x_2-m_2) \\\\ ... \\\\ (x_n-m_n) \\end{bmatrix} [(x_1-m_1)(x_2-m_2)\\cdot \\cdot \\cdot (x_n-m_n)]\\} \\\\ = \\begin{bmatrix} \\sigma_{11}^2 & \\sigma_{12}^2 & ... & \\sigma_{1n}^2 \\\\ \\sigma_{21}^2 & \\sigma_{22}^2 & ... & \\sigma_{2n}^2 \\\\ ... & ... & ... & ... \\\\ \\sigma_{n1}^2 & \\sigma_{n2}^2 & ... & \\sigma_{nn}^2 \\end{bmatrix} \\] \u8868\u793a\u7684\u6982\u5ff5\u662f\u5404\u5206\u91cf\u4e0a\u6a21\u5f0f\u6837\u672c\u5230\u5747\u503c\u7684\u8ddd\u79bb\uff0c\u4e5f\u5c31\u662f\u5728\u5404\u7ef4\u4e0a\u6a21\u5f0f\u7684\u5206\u6563\u60c5\u51b5\u3002 \\(\\sigma_{jk}^2\\) \u8d8a\u5927\uff0c\u79bb\u5747\u503c\u8d8a\u8fdc\u3002 \u5f53 \\(C=I\\) \u65f6\uff0c\u9a6c\u5f0f\u8ddd\u79bb\u5c31\u662f\u6b27\u6c0f\u8ddd\u79bb\u3002 \u7279\u70b9\uff1a \u9a6c\u5f0f\u8ddd\u79bb\u7684\u8ba1\u7b97\u662f\u5efa\u7acb\u5728\u603b\u4f53\u6837\u672c\u7684\u57fa\u7840\u4e0a\u3002\u540c\u6837\u7684\u4e24\u4e2a\u6837\u672c\uff0c\u653e\u5165\u4e24\u4e2a\u4e0d\u540c\u7684\u603b\u4f53\u4e2d\uff0c\u6700\u540e\u8ba1\u7b97\u5f97\u51fa\u4e24\u4e2a\u6837\u672c\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u901a\u5e38\u662f\u4e0d\u76f8\u540c\u7684\uff1b \u4e0d\u53d7\u91cf\u7eb2\u7684\u5f71\u54cd\uff0c\u4e24\u70b9\u4e4b\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u4e0e\u539f\u59cb\u6570\u636e\u7684\u6d4b\u91cf\u5355\u4f4d\u65e0\u5173\uff1b \u9a6c\u5f0f\u8ddd\u79bb\u53ef\u4ee5\u6392\u51fa\u53d8\u91cf\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u7684\u5e72\u6270\uff1b \u5938\u5927\u4e86\u53d8\u5316\u5fae\u5c0f\u7684\u53d8\u91cf\u7684\u4f5c\u7528\u3002 \u660e\u6c0f\u8ddd\u79bb n \u7ef4\u6a21\u5f0f\u6837\u672c\u5411\u91cf \\(X_i\u3001X_j\\) \u95f4\u7684\u660e\u6c0f\u8ddd\u79bb\u8868\u793a\u4e3a\uff1a \\[ D_m(X_i, X_j)=[\\sum_{k=1}^n|x_{ik}-x_{jk}|^m]^{\\frac{1}{m}} \\] \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u5f53 \\(m=2\\) \u65f6\uff0c\u660e\u6c0f\u8ddd\u79bb\u4e3a\u6b27\u6c0f\u8ddd\u79bb\u3002 \u5f53 \\(m=1\\) \u65f6\uff0c \\(D_1(X_i, X_j)=\\sum_{k=1}^n|x_{ik}-x_{jk}|\\) \uff0c\u4e3a\u8857\u574a\u8ddd\u79bb\u3002 \u6c49\u660e\u8ddd\u79bb \u8bbe \\(X_i\u3001X_j\\) \u4e3a n \u7ef4\u4e8c\u503c(1 \u6216 -1)\u6a21\u5f0f\u6837\u672c\u5411\u91cf\uff0c\u5219 \u6c49\u660e\u8ddd\u79bb\u4e3a \\(D_h(X_i, X_j)=\\frac{1}{2}(n-\\sum_{k=1}^n x_{ik}*x_{jk})\\) \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u4e24\u4e2a\u6a21\u5f0f\u5411\u91cf\u7684\u5404\u5206\u91cf\u53d6\u503c\u5747\u4e0d\u540c\uff1a \\(D_h(X_i, X_j)=n\\) \uff0c\u5168\u76f8\u540c\uff1a \\(D_h(X_i, X_j)=0\\) \u89d2\u5ea6\u76f8\u4f3c\u6027\u51fd\u6570 \\[ S(X_i, X_j) = \\frac{X_i^{\\top}X_j}{\\parallel X_i \\parallel \\cdot \\parallel X_j \\parallel} \\] \u662f\u6a21\u5f0f\u5411\u91cf \\(X_i, X_j\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7684\u4f59\u5f26\u3002 Tanimoto \u6d4b\u5ea6 \u7528\u4e8e 0,1 \u4e8c\u503c\u7279\u5f81\u7684\u60c5\u51b5, \\[ S(X_i,X_j)=\\frac{X_i^{\\top}X_j}{X_i^{\\top}X_i+X_j^{\\top}X_j-X_i^{\\top}X_j} \\\\ \\ \\\\ = \\frac{X_i,X_j\u4e2d\u5171\u6709\u7684\u7279\u5f81\u6570\u76ee}{X_i\u548cX_j\u4e2d\u5360\u6709\u7684\u7279\u5f81\u6570\u76ee\u7684\u603b\u6570} \\] \u76f8\u4f3c\u6027\u6d4b\u5ea6\u51fd\u6570\u7684\u5171\u540c\u70b9\u90fd\u6d89\u53ca\u5230\u628a\u4e24\u4e2a\u76f8\u6bd4\u8f83\u7684\u5411\u91cf \\(X_i,X_j\\) \u7684\u5206\u91cf\u503c\u7ec4\u5408\u8d77\u6765\uff0c\u4f46\u600e\u6837\u7ec4\u5408\u5e76\u65e0\u666e\u904d\u6709\u6548\u7684\u65b9\u6cd5\uff0c\u5bf9\u5177\u4f53\u7684\u6a21\u5f0f\u5206\u7c7b\uff0c\u9700\u89c6\u60c5\u51b5\u4f5c\u9002\u5f53\u9009\u62e9\u3002 \u805a\u7c7b\u51c6\u5219 \u00b6 \u6839\u636e\u76f8\u4f3c\u6027\u6d4b\u5ea6\u786e\u5b9a\u7684\uff0c\u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u662f\u5426\u76f8\u4f3c\u7684\u6807\u51c6\u3002\u5373\u628a\u4e0d\u540c\u6a21\u5f0f\u805a\u4e3a\u4e00\u7c7b\u8fd8\u662f\u5f52\u4e3a\u4e0d\u540c\u7c7b\u7684\u51c6\u5219\u3002 \u786e\u5b9a\u805a\u7c7b\u51c6\u5219\u7684\u4e24\u79cd\u65b9\u5f0f\uff1a \u9608\u503c\u51c6\u5219\uff1a\u6839\u636e\u89c4\u5b9a\u7684\u8ddd\u79bb\u9608\u503c\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u51fd\u6570\u51c6\u5219\uff1a\u5229\u7528\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u805a\u7c7b\u51c6\u5219\u51fd\u6570\uff1a\u5728\u805a\u7c7b\u5206\u6790\u4e2d\uff0c\u8868\u793a\u6a21\u5f0f\u7c7b\u95f4\u76f8\u4f3c\u6216\u5dee\u5f02\u6027\u7684\u51fd\u6570 \u5b83\u5e94\u662f\u6a21\u5f0f\u6837\u672c\u96c6 \\(\\{X\\}\\) \u548c\u6a21\u5f0f\u7c7b\u522b \\(\\{S_j,j=1,2,..,c\\}\\) \u7684\u51fd\u6570\u3002\u53ef\u4f7f\u805a\u7c7b\u5206\u6790\u8f6c\u5316\u4e3a\u5bfb\u627e\u51c6\u5219\u51fd\u6570\u6781\u503c\u7684\u6700\u4f18\u5316\u95ee\u9898\u3002\u4e00\u79cd\u5e38\u7528\u7684\u6307\u6807\u662f\u8bef\u5dee\u5e73\u65b9\u4e4b\u548c\u3002 \u805a\u7c7b\u51c6\u5219\u51fd\u6570 \\[J=\\sum_{j=1}^c\\sum_{X \\in S_j} \\parallel X-M_j \\parallel^2\\] \u5f0f\u4e2d\uff1ac \u4e3a\u805a\u7c7b\u7c7b\u522b\u7684\u6570\u76ee\uff0c \\(M_j=\\frac{1}{N_j}\\sum_{X \\in S_j}X\\) \u4e3a\u5c5e\u4e8e \\(S_j\\) \u96c6\u7684\u6837\u672c\u7684\u5747\u503c\u5411\u91cf\uff0c \\(N_j\\) \u4e3a \\(S_j\\) \u4e2d\u6837\u672c\u6570\u76ee\u3002 \\(J\\) \u4ee3\u8868\u4e86\u5206\u5c5e\u4e8e c \u4e2a\u805a\u7c7b\u7c7b\u522b\u7684\u5168\u90e8\u6a21\u5f0f\u6837\u672c\u4e0e\u5176\u76f8\u5e94\u7c7b\u522b\u6a21\u5f0f\u5747\u503c\u4e4b\u95f4\u7684\u8bef\u5dee\u5e73\u65b9\u548c\u3002 \u9002\u7528\u8303\u56f4\uff1a\u9002\u7528\u4e8e\u5404\u7c7b\u6837\u672c\u5bc6\u96c6\u4e14\u6570\u76ee\u76f8\u5dee\u4e0d\u591a\uff0c\u800c\u4e0d\u540c\u7c7b\u95f4\u7684\u6837\u672c\u53c8\u660e\u663e\u5206\u5f00\u7684\u60c5\u51b5\u3002 \u57fa\u4e8e\u8ddd\u79bb\u9608\u503c\u7684\u805a\u7c7b\u7b97\u6cd5 \u00b6 \u8fd1\u90bb\u805a\u7c7b\u6cd5 \u00b6 \u95ee\u9898\uff1a\u6709 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u8981\u6c42\u6309\u8ddd\u79bb\u9608\u503c \\(T\\) \u5206\u7c7b\u5230\u4ee5 \\(Z_1, Z_2,...\\) \u4e3a\u805a\u7c7b\u4e2d\u5fc3\u7684\u6a21\u5f0f\u7c7b\u4e2d\u3002 \u7b97\u6cd5\u63cf\u8ff0 \u4efb\u53d6\u6837\u672c \\(X_i\\) \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u521d\u59cb\u503c\uff0c\u5982\u4ee4 \\(Z_1=X_1\\) \u8ba1\u7b97\u6837\u672c \\(X_2\\) \u5230 \\(Z_1\\) \u7684\u6b27\u6c0f\u8ddd\u79bb \\(D_{21}=\\parallel X_2 - Z_1 \\parallel\\) \uff0c\u82e5 \\(D_{21}>T\\) \uff0c\u5b9a\u4e49\u4e00\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2=X_2\\) \uff1b\u5426\u5219 \\(X_2 \\in\\) \u4ee5 \\(Z_1\\) \u4e3a\u4e2d\u5fc3\u7684\u805a\u7c7b\u3002 \u5047\u8bbe\u5df2\u6709\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\u3001Z_2\\) \uff0c\u8ba1\u7b97 \\(D_{31}=\\parallel X_3 - Z_1 \\parallel\\) \u548c \\(D_{32}=\\parallel X_3 - Z_2 \\parallel\\) \uff0c\u82e5 \\(D_{31}>T\\) \u4e14 \\(D_{32} > T\\) \uff0c\u5219\u5efa\u7acb\u7b2c\u4e09\u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(Z_3=X_3\\) \uff1b\u5426\u5219 \\(X_3 \\in\\) \u79bb \\(Z_1\\) \u548c \\(Z_2\\) \u4e2d\u6700\u8fd1\u8005\uff08\u6700\u8fd1\u90bb\u7684\u805a\u7c7b\u4e2d\u5fc3\uff09\u3002 \u4f9d\u6b64\u7c7b\u63a8\uff0c\u76f4\u5230\u5c06\u6240\u6709\u7684 \\(N\\) \u4e2a\u6837\u672c\u90fd\u8fdb\u884c\u5206\u7c7b \u7b97\u6cd5\u7279\u70b9 \u5c40\u9650\u6027\uff1a\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u4e8e\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u9009\u62e9\u3001\u5f85\u5206\u7c7b\u6a21\u5f0f\u6837\u672c\u7684\u6392\u5217\u6b21\u5e8f\u3001\u8ddd\u79bb\u9608\u503c \\(T\\) \u7684\u5927\u5c0f\u4ee5\u53ca\u6837\u672c\u5206\u5e03\u7684\u51e0\u4f55\u6027\u8d28\u7b49\u3002 \u4f18\u70b9\uff1a\u8ba1\u7b97\u7b80\u5355\u3002\uff08\u4e00\u79cd\u867d\u7c97\u7cd9\u4f46\u5feb\u901f\u7684\u65b9\u6cd5\uff09 \u6700\u5927\u6700\u5c0f\u7b97\u6cd5\uff08\u5c0f\u4e2d\u53d6\u5927\u8ddd\u79bb\u7b97\u6cd5\uff09 \u00b6 \u95ee\u9898\uff1a\u5df2\u77e5 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u5206\u7c7b\u5230\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1, Z_2, ...\\) \u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u7b97\u6cd5\u63cf\u8ff0 \u9009\u4efb\u610f\u4e00\u6a21\u5f0f\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e00\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\\) \u9009\u62e9\u79bb \\(Z_1\\) \u8ddd\u79bb\u6700\u8fdc\u7684\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e8c\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2\\) \u9010\u4e2a\u8ba1\u7b97\u5404\u6a21\u5f0f\u6837\u672c\u4e0e\u5df2\u786e\u5b9a\u7684\u6240\u6709\u805a\u7c7b\u4e2d\u5fc3\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5e76\u9009\u51fa\u5176\u4e2d\u7684\u6700\u5c0f\u8ddd\u79bb\u3002\u4f8b\u5982\u805a\u7c7b\u4e2d\u5fc3\u6570 \\(k=2\\) \u65f6\uff0c\u8ba1\u7b97 \\(D_{i1}=\\parallel X_i - Z_1 \\parallel\\) , \\(D_{i2}=\\parallel X_i - Z_2 \\parallel\\) \uff0c \\(\\min\\{D_{i1}, D_{i2}\\}, i=1,...,N\\) (N \u4e2a\u6700\u5c0f\u8ddd\u79bb) \u5728\u6240\u6709\u6700\u5c0f\u8ddd\u79bb\u4e2d\u9009\u51fa\u6700\u5927\u8ddd\u79bb\uff0c\u5982\u8be5\u6700\u5927\u503c\u8fbe\u5230 \\(\\parallel Z_1 - Z_2 \\parallel\\) \u7684\u4e00\u5b9a\u5206\u6570\u6bd4\u503c\uff08\u9608\u503c \\(T\\) \uff09\u4ee5\u4e0a\uff0c\u5219\u76f8\u5e94\u7684\u6837\u672c\u70b9\u53d6\u4e3a\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\uff0c\u8fd4\u56de 3\uff1b\u5426\u5219\u7ed3\u675f \u91cd\u590d\u6b65\u9aa4 3\u30014\uff0c\u76f4\u5230\u6ca1\u6709\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\u51fa\u73b0\u4e3a\u6b62 \u5c06\u6837\u672c \\(\\{X_1, i=1,2,..,N\\}\\) \u6309\u6700\u8fd1\u8ddd\u79bb\u5212\u5206\u5230\u76f8\u5e94\u805a\u7c7b\u4e2d\u5fc3\u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u603b\u7ed3\uff1a\u5148\u627e\u4e2d\u5fc3\u540e\u5206\u7c7b\uff1b\u5173\u952e\uff1a\u600e\u4e48\u5f00\u65b0\u7c7b\uff0c\u805a\u7c7b\u4e2d\u5fc3\u5982\u4f55\u5b9a \u5c42\u6b21\u805a\u7c7b\u6cd5 \u00b6 \u6bcf\u4e2a\u6837\u672c\u5148\u81ea\u6210\u4e00\u7c7b\uff0c\u7136\u540e\u6309\u8ddd\u79bb\u51c6\u5219\u9010\u6b65\u5408\u5e76\uff0c\u51cf\u5c11\u7c7b\u6570 \u7b97\u6cd5\u63cf\u8ff0 \\(N\\) \u4e2a\u521d\u59cb\u6a21\u5f0f\u6837\u672c\u81ea\u6210\u4e00\u7c7b\uff0c\u5373\u5efa \\(N\\) \u7c7b\uff1a \\(G_1(0), G_2(0), ..., G_N(0)\\) \uff0c\u8ba1\u7b97\u5404\u7c7b\u4e4b\u95f4\uff08\u5373\u5404\u6837\u672c\u95f4\uff09\u7684\u8ddd\u79bb\uff0c\u5f97\u4e00 \\(N \\times N\\) \u7ef4\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(0)\\) \u3002 \\(\u201c0\u201d\\) \u8868\u793a\u521d\u59cb\u72b6\u6001 \u5047\u8bbe\u5df2\u6c42\u5f97\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(n)\\) \uff08n\u4e3a\u9010\u6b21\u805a\u7c7b\u5408\u5e76\u7684\u6b21\u6570\uff09\uff0c\u627e\u51fa \\(\\mathbf{D}(n)\\) \u4e2d\u7684\u6700\u5c0f\u5143\u7d20\uff0c\u5c06\u5176\u5bf9\u5e94\u7684\u4e24\u7c7b\u5408\u5e76\u6210\u4e00\u7c7b\u3002\u7531\u6b64\u5efa\u7acb\u65b0\u7684\u5206\u7c7b\uff1a \\(G_1(n+1), G_2(n+1),...\\) \u8ba1\u7b97\u5408\u5e76\u540e\u65b0\u7c7b\u522b\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5f97 \\(\\mathbf{D}(n+1)\\) \u8df3\u5230\u7b2c 2 \u6b65\uff0c\u91cd\u590d\u8ba1\u7b97\u53ca\u5408\u5e76 \u7ed3\u675f\u6761\u4ef6 \u53d6\u8ddd\u79bb\u9608\u503c \\(T\\) \uff0c\u5f53 \\(\\mathbf{D}(n)\\) \u7684\u6700\u5c0f\u5206\u91cf\u8d85\u8fc7\u7ed9\u5b9a\u503c \\(T\\) \u65f6\uff0c\u7b97\u6cd5\u505c\u6b62\uff0c\u6240\u5f97\u5373\u4e3a\u805a\u7c7b\u7ed3\u679c \u6216\u4e0d\u8bbe\u9608\u503c \\(T\\) \uff0c\u4e00\u76f4\u5c06\u5168\u90e8\u6837\u672c\u805a\u6210\u4e00\u7c7b\u4e3a\u6b62\uff0c\u8f93\u51fa\u805a\u7c7b\u7684\u5206\u7ea7\u6811 \u95ee\u9898\u8ba8\u8bba\uff1a\u7c7b\u95f4\u8ddd\u79bb\u8ba1\u7b97\u51c6\u5219 \u6700\u77ed\u8ddd\u79bb\u6cd5 \u5982 \\(H\u3001K\\) \u662f\u4e24\u4e2a\u805a\u7c7b\uff0c\u5219\u4e24\u7c7b\u95f4\u7684\u6700\u77ed\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D_{HK} = \\min\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\] \u6700\u957f\u8ddd\u79bb\u6cd5 \\[ D_{HK} = \\max\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\\\ \u82e5 K \u7c7b\u7531 I\u3001J \u4e24\u7c7b\u5408\u5e76\u800c\u6210\u5219 \\\\ D_{HK} = \\max\\{D_{HI}, D_{HJ}\\} \\] \u4e2d\u95f4\u8ddd\u79bb\u6cd5 \u4ecb\u4e8e\u6700\u957f\u4e0e\u6700\u77ed\u7684\u8ddd\u79bb\u4e4b\u95f4 \\[ D_{HK}=\\sqrt{\\frac{1}{2} D_{HI}^2+\\frac{1}{2}D_{HJ}^2-\\frac{1}{4}D_{IJ}^2} \\] \u91cd\u5fc3\u6cd5 \u5c06\u6bcf\u7c7b\u4e2d\u5305\u542b\u7684\u6837\u672c\u6570\u8003\u8651\u8fdb\u53bb\u3002\u82e5 \\(I\\) \u7c7b\u4e2d\u6709 \\(n_I\\) \u4e2a\u6837\u672c\uff0c\u82e5 \\(J\\) \u7c7b\u4e2d\u6709 \\(n_J\\) \u4e2a\u6837\u672c \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2-\\frac{n_In_J}{n_I+n_J}D_{IJ}^2} \\] \u7c7b\u5e73\u5747\u8ddd\u79bb\u6cd5 \\[ D_{HK}=\\sqrt{\\frac{1}{n_Hn_K} \\sum_{i \\in H,j \\in K}d_{ij}^2} \\] \\(d_{ij}\\) \uff1a \\(H\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u548c \\(K\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u5e73\u65b9 \u82e5 \\(K\\) \u7c7b\u7531 \\(I\\) \u7c7b\u548c \\(J\\) \u7c7b\u5408\u5e76\u4ea7\u751f\uff0c\u5219\u9012\u63a8\u5f0f\u4e3a \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2} \\] \u52a8\u6001\u805a\u7c7b\u6cd5 \u00b6 \u4e24\u79cd\u5e38\u7528\u7684\u7b97\u6cd5\uff1a \\(K\\) -\u5747\u503c\u7b97\u6cd5(\u6216 \\(C\\) -\u5747\u503c\u7b97\u6cd5) \u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5 K-\u5747\u503c\u7b97\u6cd5 \u00b6 \u57fa\u4e8e\u4f7f\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u6700\u5c0f\u5316 \u51c6\u5219\u51fd\u6570\uff1a\u805a\u7c7b\u96c6\u4e2d\u6bcf\u4e00\u6837\u672c\u70b9\u5230\u8be5\u7c7b\u4e2d\u5fc3\u5230\u8ddd\u79bb\u5e73\u65b9\u548c \u5bf9\u4e8e\u7b2c j \u805a\u7c7b\u96c6\uff0c\u51c6\u5219\u51fd\u6570\u5b9a\u4e49\u4e3a \\(J_j = \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2\uff0c\\ \\ \\ X_i \\in S_j\\) \\(S_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6\uff0c\u805a\u7c7b\u4e2d\u5fc3\u4e3a \\(Z_j\\) \\(N_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6 \\(S_j\\) \u4e2d\u6240\u5305\u542b\u7684\u6837\u672c\u4e2a\u6570 \u5bf9\u6240\u6709 \\(K\\) \u4e2a\u6a21\u5f0f\u7c7b\u6709 \\(J = \\sum_{j=1}^{K} \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2, \\ \\ \\ X_i \\in S_j\\) \u805a\u7c7b\u51c6\u5219\uff1a \u805a\u7c7b\u4e2d\u5fc3\u7684\u9009\u62e9\u5e94\u4f7f\u51c6\u5219\u51fd\u6570 \\(J\\) \u6781\u5c0f\uff0c\u5373\u4f7f \\(J_j\\) \u7684\u503c\u5f88\u5c0f \u8ba9 \\(\\frac{\\partial J_j}{\\partial \\mathbf{Z}_j}=0\\) \uff0c\u89e3\u5f97 \\(\\mathbf{Z}_j = \\frac{1}{N_j} \\sum_{i=1}^{N_j} \\mathbf{X_i}, \\ \\ \\ \\mathbf{X}_i \\in S_j\\) \u7b97\u6cd5\u63cf\u8ff0: \u4efb\u9009 K \u4e2a\u521d\u59cb\u805a\u7c7b\u4e2d\u5fc3\uff1a \\(\\mathbf{Z}_1(1), \\mathbf{Z}_2(1), ..., \\mathbf{Z}_K(1)\\) \u62ec\u53f7\u5185\u5e8f\u53f7\uff1a\u8fed\u4ee3\u8fd0\u7b97\u7684\u6b21\u5e8f\u53f7 \u6309\u6700\u5c0f\u8ddd\u79bb\u539f\u5219\u5c06\u5176\u4f59\u6837\u54c1\u5206\u914d\u5230 K \u4e2a\u805a\u7c7b\u4e2d\u5fc3\u4e2d\u7684\u67d0\u4e00\u4e2a\uff0c\u5373 \\(\\min\\{\\parallel X - Z_i(k) \\parallel, i=1,2,...,K\\}=\\parallel X-Z_j(k) \\parallel=D_j(k)\uff0c\u5219 X \\in S_j(k)\\) \uff0c\u6ce8\u610f\uff0ck \u662f\u8fed\u4ee3\u8fd0\u7b97\u6b21\u5e8f\u53f7\uff0cK \u662f\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u8ba1\u7b97\u5404\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u65b0\u5411\u91cf\u503c: \\(Z_j(k+1) \\ \\ j=1,2,...,K\\) \\[ Z_j(k+1) = \\frac{1}{N_j} \\sum_{X \\in S_j(k)} \\mathbf{X} \\ \\ \\ j=1,2,...,K \\] \\(N_j\\) : \u7b2c j \u7c7b\u7684\u6837\u672c\u6570 \u5224\u65ad \u5982\u679c \\(Z_j(k+1) \\ne Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u5219\u56de\u5230 2\uff0c\u5c06\u6a21\u5f0f\u6837\u672c\u9010\u4e2a\u91cd\u65b0\u5206\u7c7b\uff0c\u91cd\u590d\u8fed\u4ee3\u8ba1\u7b97 \u5982\u679c \\(Z_j(k+1) = Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u7b97\u6cd5\u6536\u655b\uff0c\u8ba1\u7b97\u5b8c\u6bd5 \u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5 \u00b6 \u7b97\u6cd5\u7279\u70b9 \u52a0\u5165\u4e86\u8bd5\u63a2\u6027\u6b65\u9aa4\uff0c\u7ec4\u6210\u4eba\u673a\u4ea4\u4e92\u7684\u7ed3\u6784 \u53ef\u4ee5\u901a\u8fc7\u7c7b\u7684\u81ea\u52a8\u5408\u5e76\u4e0e\u5206\u88c2\u5f97\u5230\u8f83\u5408\u7406\u7684\u7c7b\u522b\u6570 \u4e0e K-\u5747\u503c\u7b97\u6cd5 \u76f8\u4f3c\uff1a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u5747\u901a\u8fc7\u6837\u672c\u5747\u503c\u7684\u8fed\u4ee3\u8fd0\u7b97\u51b3\u5b9a \u76f8\u5f02\uff1aK-\u5747\u503c\u7b97\u6cd5\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570\u4e0d\u53d8\uff0c\u4f46ISODATA\u7b97\u6cd5\u4e0d\u53d8 \u7b97\u6cd5\u63cf\u8ff0 \u9884\u9009 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(\\{Z_1, Z_2, ..., Z_{N_C}\\}\\) \uff0c \\(N_C\\) \u4e5f\u662f\u805a\u7c7b\u8fc7\u7a0b\u4e2d\u5b9e\u9645\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u628a N \u4e2a\u6837\u672c\u6309\u6700\u8fd1\u90bb\u89c4\u5219\u5206\u914d\u5230 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d \\[ \u82e5 \\ \\ \\ \\parallel X - Z_j \\parallel = \\min\\{\\parallel X - Z_i, i = 1, ,2, .., N_C\\} \\\\ \u5219 \\ \\ \\ X \\in S_j \\] \u82e5 \\(S_j\\) \u4e2d\u7684\u6837\u672c\u6570 \\(N_j < \\theta_N\\) \uff0c\u5219\u53d6\u6d88\u8be5\u7c7b\uff0c\u5e76\u4e14 \\(N_C\\) \u51cf\u53bb 1 \u4fee\u6b63\u5404\u805a\u7c7b\u4e2d\u5fc3\u503c \\(Z_j = \\frac{1}{N_j} \\sum_{X \\in S_j} X \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97 \\(S_j\\) \u7684\u7c7b\u5185\u7684\u5e73\u5747\u8ddd\u79bb \\(\\bar{D_j} = \\frac{1}{N_j} \\sum_{X \\in S_j} \\parallel X - Z_j \\parallel \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97\u603b\u4f53\u5e73\u5747\u8ddd\u79bb \u5224\u65ad\u5f53\u524d\u662f\u5206\u88c2\u8fd8\u662f\u5408\u5e76\uff0c\u51b3\u5b9a\u8fed\u4ee3\u6b65\u9aa4\u7b49 \u82e5 \\(N_C \\le K/2\\) \uff0c\u8fdb\u5165\u5206\u88c2 \u5982\u679c\u8fed\u4ee3\u6b21\u6570\u662f\u5076\u6570\u6216 \\(N_C \\ge 2K\\) \uff0c\u5219\u5408\u5e76\u5426\u5219\u5206\u88c2 \u8ba1\u7b97\u6bcf\u4e2a\u805a\u7c7b\u4e2d\u6837\u672c\u8ddd\u79bb\u7684\u6807\u51c6\u5dee\u5411\u91cf \u6c42\u6bcf\u4e2a\u6807\u51c6\u5dee\u5411\u91cf\u7684\u6700\u5927\u5206\u91cf \u592a\u957f\u4e86\u3002\u3002\u3002 \u5168\u662f\u516c\u5f0f\u3002\u3002\u3002 \u5224\u522b\u51fd\u6570 \u00b6 \u5224\u522b\u51fd\u6570 \u00b6 \u5b9a\u4e49\uff1a\u76f4\u63a5\u7528\u6765\u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219\u51fd\u6570\u3002\u82e5\u5206\u5c5e\u4e8e \\(\\omega_1, \\omega_2\\) \u7684\u4e24\u7c7b\u6a21\u5f0f\u53ef\u7528\u4e00\u65b9\u7a0b \\(d(X)=0\\) \u6765\u5212\u5206\uff0c\u90a3\u4e48\u79f0 \\(d(X)\\) \u4e3a\u5224\u522b\u51fd\u6570\u3002 \u786e\u5b9a\u5224\u522b\u51fd\u6570\u7684\u4e24\u4e2a\u56e0\u7d20 \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u51e0\u4f55\u6027\u8d28\u3002\u5b83\u53ef\u4ee5\u662f\u7ebf\u6027\u7684\u6216\u975e\u7ebf\u6027\u7684\u51fd\u6570\uff0c\u7ef4\u6570\u5728\u7279\u5f81\u63d0\u53d6\u65f6\u5df2\u7ecf\u786e\u5b9a \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u7cfb\u6570\uff0c\u7528\u6240\u7ed9\u7684\u6a21\u5f0f\u6837\u672c\u786e\u5b9a \u7ebf\u6027\u5224\u522b\u51fd\u6570 \u00b6 \u4e00\u822c\u5f62\u5f0f \u00b6 \u5c06\u4e8c\u7ef4\u5f62\u5f0f\u63a8\u5e7f\u5230 n \u7ef4\uff0c\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f\u4e3a \\[ d(X) = w_1x_1+w_2x_2+...+w_nx_n+w_{n+1}=W_0^{\\top}X+w_{n+1} \\] \u589e\u5e7f\u5411\u91cf\u7684\u5f62\u5f0f \\(d(X)=W^{\\top}X\\) \u6027\u8d28 \u00b6 \u4e24\u7c7b\u60c5\u51b5 \\[ d(X)=W^{\\top}X \\left\\{\\begin{matrix} >0 & \u82e5 X \\in \\omega_1 \\\\ <0 & \u82e5 X \\in \\omega_2 \\end{matrix}\\right. \\] \u591a\u7c7b\u60c5\u51b5 \\(\\omega_i \\sqrt{\\omega_i}\\) \u4e24\u5206\u6cd5 \u7528\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5c06\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u4e0e\u5176\u4f59\u4e0d\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u5206\u5f00 \\(\\omega_i \\omega_i\\) \u4e24\u5206\u6cd5 \u4e00\u4e2a\u5224\u522b\u754c\u9762\u53ea\u80fd\u5206\u5f00\u4e24\u4e2a\u7c7b\u522b\uff0c\u4e0d\u80fd\u628a\u5176\u4f59\u6240\u6709\u7684\u7c7b\u522b\u90fd\u5206\u5f00\u3002\u5224\u51b3\u51fd\u6570\u4e3a \\(d_{ij}(X)=W_{ij}^{\\top}X\\) \u6027\u8d28\uff1a \\(d_{ij}(X) > 0, \\forall j \\ne i; i, j = 1,2,...,M\uff0c\u82e5X \\in \\omega_i\\) \u5e7f\u4e49\u7ebf\u6027\u5224\u522b\u51fd\u6570 \u00b6 \u76ee\u7684\uff1a\u5bf9\u975e\u7ebf\u6027\u8fb9\u754c\uff0c\u901a\u8fc7\u67d0\u6620\u5c04\uff0c\u628a\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u53d8\u6210 \\(X^*\\) \uff0c\u4ee5\u4fbf\u5c06 \\(X\\) \u7a7a\u95f4\u4e2d\u975e\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6\uff0c\u53d8\u6210\u5728 \\(X^*\\) \u7a7a\u95f4\u4e2d\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6 \u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570 \u00b6 \u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u5f62\u5f0f\u4e4b\u4e00\u662f\u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570 \u8bbe\u4e00\u8bad\u7ec3\u7528\u6a21\u5f0f\u96c6\uff0c \\(\\{X\\}\\) \u5728\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u4e2d\u7ebf\u6027\u4e0d\u53ef\u5206\uff0c\u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ d(\\mathbf{X})=w_1f_1(\\mathbf{X})+w_2f_2(\\mathbf{X})+...+w_kf_k(\\mathbf{X})+w_{k+1}=\\sum_{i=1}^{k+1}w_if_i(\\mathbf{X}) \\\\ \u5f0f\u4e2d,\\{f_i(\\mathbf{X}),i=1,2,...,k\\}\u662f\u6a21\u5f0f\\mathbf{X}\u7684\u5355\u503c\u5b9e\u51fd\u6570\uff0cf_{k+1}(\\mathbf{X})=1 \\] \u5e7f\u4e49\u5f62\u5f0f\u7684\u6a21\u5f0f\u5411\u91cf\u5b9a\u4e49\u4e3a\uff1a \\[ \\mathbf{X}^*=[x_1^*+x_2^*+...+x_k^*+1]^\\top=[f_1(\\mathbf{X})+f_2(\\mathbf{X})+...+f_k(\\mathbf{X})+1]^\\top \\] \u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u51e0\u4f55\u6027\u8d28 \u00b6 \u6a21\u5f0f\u7a7a\u95f4\u4e0e\u8d85\u5e73\u9762 \u6743\u7a7a\u95f4\u548c\u6743\u5411\u91cf\u89e3 \u611f\u77e5\u5668\u7b97\u6cd5 \u00b6","title":"\u6a21\u5f0f\u8bc6\u522b"},{"location":"cs/ai/mode-recognition/#_1","text":"\u7ea6 3653 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u5b66\u4e60\u6a21\u5f0f\u8bc6\u522b\u8bfe\u7684\u4e00\u4e9b\u7b14\u8bb0","title":"\u6a21\u5f0f\u8bc6\u522b"},{"location":"cs/ai/mode-recognition/#_2","text":"","title":"\u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u8ff0"},{"location":"cs/ai/mode-recognition/#_3","text":"\u6a21\u5f0f\uff1a\u5bf9\u67d0\u4e9b\u611f\u5174\u8da3\u7684\u5ba2\u4f53\u7684\u5b9a\u91cf\u7684\u6216\u7ed3\u6784\u7684\u63cf\u8ff0\u3002\u6a21\u5f0f\u7c7b\u662f\u5177\u6709\u67d0\u4e9b\u5171\u540c\u7279\u6027\u7684\u6a21\u5f0f\u7684\u96c6\u5408\u3002 \u6a21\u5f0f\u8bc6\u522b\uff1a\u7814\u7a76\u4e00\u79cd\u81ea\u52a8\u6280\u672f\uff0c\u4f9d\u9760\u8fd9\u79cd\u6280\u672f\uff0c\u8ba1\u7b97\u673a\u5c06\u81ea\u52a8\u5730\uff08\u6216\u4eba\u5c3d\u91cf\u5c11\u5730\u5e72\u6d89\uff09\u628a\u5f85\u522b\u8bc6\u6a21\u5f0f\u5206\u914d\u5230\u5404\u81ea\u7684\u6a21\u5f0f\u7c7b\u4e2d\u53bb\u3002","title":"\u6a21\u5f0f\u548c\u6a21\u5f0f\u8bc6\u522b\u7684\u6982\u5ff5"},{"location":"cs/ai/mode-recognition/#_4","text":"\u6ce8\u610f\u201c\u5904\u7406\u201d\u4e0e\u201c\u8bc6\u522b\u201d\u4e24\u4e2a\u6982\u5ff5\u7684\u533a\u522b","title":"\u6a21\u5f0f\u8bc6\u522b\u7cfb\u7edf\u7ec4\u6210"},{"location":"cs/ai/mode-recognition/#_5","text":"\u4ece\u7406\u8bba\u4e0a\u5206\u7c7b \u7edf\u8ba1\u6a21\u5f0f\u8bc6\u522b \u53e5\u6cd5\u6a21\u5f0f\u8bc6\u522b\uff08\u7ed3\u6784\u6a21\u5f0f\u8bc6\u522b\uff09 \u6a21\u7cca\u6a21\u5f0f\u8bc6\u522b \u795e\u7ecf\u7f51\u7edc\u6a21\u5f0f\u8bc6\u522b \u4ece\u5b9e\u73b0\u65b9\u6cd5\u5206\u7c7b \u76d1\u7763\u5206\u7c7b \u975e\u76d1\u7763\u5206\u7c7b","title":"\u6a21\u5f0f\u8bc6\u522b\u7684\u5206\u7c7b"},{"location":"cs/ai/mode-recognition/#_6","text":"\u4e0d\u505c\u8f66\u6536\u8d39\u7cfb\u7edf \u5173\u952e\uff1a\u8f66\u578b\u7684\u81ea\u52a8\u5206\u7c7b\u3002\u51e0\u79cd\u4e3b\u8981\u6280\u672f\uff1a \u63d0\u53d6\u8f66\u8f86\u5916\u5f62\u51e0\u4f55\u53c2\u6570\u8fdb\u884c\u5904\u7406\u5206\u6790\uff0c\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u89c6\u9891\u68c0\u6d4b\u65b9\u6cd5\u3001\u7ea2\u5916\u68c0\u6d4b\u65b9\u6cd5\u3002 \u6d4b\u91cf\u8f66\u8f86\u7684\u5176\u4ed6\u7269\u7406\u53c2\u6570\uff08\u566a\u58f0\u3001\u632f\u52a8\u3001\u538b\u91cd\u7b49\uff09\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u52a8\u6001\u79f0\u91cd\u3001\u7535\u78c1\u611f\u5e94\u7b49\u3002 \u76f4\u63a5\u8bc6\u522b\u8f66\u8f86\u8eab\u4efd\u7684\u65b9\u6cd5\u5b9e\u73b0\u5206\u7c7b\u3002\u5982\u7535\u5b50\u6807\u7b7e\u3001\u89c6\u9891\u724c\u7167\u65b9\u6cd5\u7b49","title":"\u6a21\u5f0f\u8bc6\u522b\u7684\u5e94\u7528"},{"location":"cs/ai/mode-recognition/#_7","text":"","title":"\u805a\u7c7b\u5206\u6790"},{"location":"cs/ai/mode-recognition/#_8","text":"\u6982\u5ff5\uff1a \u7269\u4ee5\u7c7b\u805a \u805a\u7c7b\u5206\u6790\uff1a\u6839\u636e\u6a21\u5f0f\u4e4b\u95f4\u7684 \u76f8\u4f3c\u6027 \u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\uff0c\u662f\u4e00\u79cd\u975e\u76d1\u7763\u5206\u7c7b\u65b9\u6cd5\u3002 \u76f8\u4f3c\u5ea6\u542b\u4e49 \u6709 n \u4e2a\u7279\u5f81\u5219\u7ec4\u6210 n \u7ef4\u5411\u91cf \\(X=[x_1, x_2, ..., x_n]^{\\top}\\) \u79f0\u4e3a\u8be5\u6837\u672c\u7684\u7279\u5f81\u5411\u91cf\u3002\u5b83\u76f8\u5f53\u4e8e\u7279\u5f81\u7a7a\u95f4\u4e2d\u7684\u4e00\u4e2a\u70b9\uff0c\u4ee5\u7279\u5f81\u7a7a\u95f4\u4e2d\uff0c \u70b9\u95f4\u7684\u8ddd\u79bb\u51fd\u6570\u4f5c\u4e3a\u6a21\u5f0f\u76f8\u4f3c\u5ea6\u7684\u6d4b\u91cf \uff0c\u4ee5\u201c\u8ddd\u79bb\u201d\u4f5c\u4e3a\u6a21\u5f0f\u5206\u7c7b\u7684\u4f9d\u636e\uff0c \u8ddd\u79bb\u8d8a\u5c0f\uff0c\u8d8a\u76f8\u4f3c \u805a\u7c7b\u5206\u6790\u662f\u5426\u6709\u6548\uff0c\u4e0e\u6a21\u5f0f\u7279\u5f81\u5411\u91cf\u7684\u5206\u5e03\u5f62\u5f0f\u6709\u5f88\u5927\u5173\u7cfb\u3002\u9009\u53d6\u7684\u7279\u5f81\u5411\u91cf\u662f\u5426\u5408\u9002\u975e\u5e38\u5173\u952e\u3002","title":"\u8ddd\u79bb\u805a\u7c7b\u7684\u6982\u5ff5"},{"location":"cs/ai/mode-recognition/#_9","text":"","title":"\u76f8\u4f3c\u6027\u6d4b\u5ea6\u548c\u805a\u7c7b\u51c6\u5219"},{"location":"cs/ai/mode-recognition/#_10","text":"\u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u76f8\u4f3c\u6027\u7684\u4e00\u79cd\u5c3a\u5ea6\u3002\u5982\uff1a\u8ddd\u79bb\u3002 \u6b27\u6c0f\u8ddd\u79bb \u8bbe \\(X_1, X_2\\) \u4e3a\u4e24\u4e2a n \u7ef4\u6a21\u5f0f\u6837\u672c\uff0c \\(X_1 = [x_{11}, x_{12}, ..., x_{1n}]^{\\top}, X_2 = [x_{21}, x_{22}, ..., x_{2n}]^{\\top}\\) \uff0c\u6b27\u6c0f\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D(X_1, X_2) = \\parallel X_1 - X_2 \\parallel = \\sqrt{(X_1 - X_2)^{\\top}(X_1-X_2)} \\] \u8ddd\u79bb\u8d8a\u5c0f\u8d8a\u76f8\u4f3c\u3002 \u9a6c\u5f0f\u8ddd\u79bb \u5e73\u65b9\u8868\u8fbe\u5f0f\uff1a \\(D^2=(X_1-X_2)^{\\top}C^{-1}(X_1-X_2)\\) \u4ee4 \\(M:\\) \u5747\u503c\u5411\u91cf M_Mean\uff0c \\(C:\\) \u8be5\u7c7b\u6a21\u5f0f\u603b\u4f53\u7684\u534f\u65b9\u5dee\u77e9\u9635 C_covariance\u3002 \u5bf9 n \u7ef4\u5411\u91cf: \\(X=[x_1, ..., x_n]^{\\top},M=[m_1,...,m_n]^{\\top}\\) \\[ C = E\\{(X-M)(X-M)^{\\top}\\} \\\\ = E \\{ \\begin{bmatrix} (x_1-m_1) \\\\ (x_2-m_2) \\\\ ... \\\\ (x_n-m_n) \\end{bmatrix} [(x_1-m_1)(x_2-m_2)\\cdot \\cdot \\cdot (x_n-m_n)]\\} \\\\ = \\begin{bmatrix} \\sigma_{11}^2 & \\sigma_{12}^2 & ... & \\sigma_{1n}^2 \\\\ \\sigma_{21}^2 & \\sigma_{22}^2 & ... & \\sigma_{2n}^2 \\\\ ... & ... & ... & ... \\\\ \\sigma_{n1}^2 & \\sigma_{n2}^2 & ... & \\sigma_{nn}^2 \\end{bmatrix} \\] \u8868\u793a\u7684\u6982\u5ff5\u662f\u5404\u5206\u91cf\u4e0a\u6a21\u5f0f\u6837\u672c\u5230\u5747\u503c\u7684\u8ddd\u79bb\uff0c\u4e5f\u5c31\u662f\u5728\u5404\u7ef4\u4e0a\u6a21\u5f0f\u7684\u5206\u6563\u60c5\u51b5\u3002 \\(\\sigma_{jk}^2\\) \u8d8a\u5927\uff0c\u79bb\u5747\u503c\u8d8a\u8fdc\u3002 \u5f53 \\(C=I\\) \u65f6\uff0c\u9a6c\u5f0f\u8ddd\u79bb\u5c31\u662f\u6b27\u6c0f\u8ddd\u79bb\u3002 \u7279\u70b9\uff1a \u9a6c\u5f0f\u8ddd\u79bb\u7684\u8ba1\u7b97\u662f\u5efa\u7acb\u5728\u603b\u4f53\u6837\u672c\u7684\u57fa\u7840\u4e0a\u3002\u540c\u6837\u7684\u4e24\u4e2a\u6837\u672c\uff0c\u653e\u5165\u4e24\u4e2a\u4e0d\u540c\u7684\u603b\u4f53\u4e2d\uff0c\u6700\u540e\u8ba1\u7b97\u5f97\u51fa\u4e24\u4e2a\u6837\u672c\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u901a\u5e38\u662f\u4e0d\u76f8\u540c\u7684\uff1b \u4e0d\u53d7\u91cf\u7eb2\u7684\u5f71\u54cd\uff0c\u4e24\u70b9\u4e4b\u95f4\u7684\u9a6c\u5f0f\u8ddd\u79bb\u4e0e\u539f\u59cb\u6570\u636e\u7684\u6d4b\u91cf\u5355\u4f4d\u65e0\u5173\uff1b \u9a6c\u5f0f\u8ddd\u79bb\u53ef\u4ee5\u6392\u51fa\u53d8\u91cf\u4e4b\u95f4\u7684\u76f8\u5173\u6027\u7684\u5e72\u6270\uff1b \u5938\u5927\u4e86\u53d8\u5316\u5fae\u5c0f\u7684\u53d8\u91cf\u7684\u4f5c\u7528\u3002 \u660e\u6c0f\u8ddd\u79bb n \u7ef4\u6a21\u5f0f\u6837\u672c\u5411\u91cf \\(X_i\u3001X_j\\) \u95f4\u7684\u660e\u6c0f\u8ddd\u79bb\u8868\u793a\u4e3a\uff1a \\[ D_m(X_i, X_j)=[\\sum_{k=1}^n|x_{ik}-x_{jk}|^m]^{\\frac{1}{m}} \\] \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u5f53 \\(m=2\\) \u65f6\uff0c\u660e\u6c0f\u8ddd\u79bb\u4e3a\u6b27\u6c0f\u8ddd\u79bb\u3002 \u5f53 \\(m=1\\) \u65f6\uff0c \\(D_1(X_i, X_j)=\\sum_{k=1}^n|x_{ik}-x_{jk}|\\) \uff0c\u4e3a\u8857\u574a\u8ddd\u79bb\u3002 \u6c49\u660e\u8ddd\u79bb \u8bbe \\(X_i\u3001X_j\\) \u4e3a n \u7ef4\u4e8c\u503c(1 \u6216 -1)\u6a21\u5f0f\u6837\u672c\u5411\u91cf\uff0c\u5219 \u6c49\u660e\u8ddd\u79bb\u4e3a \\(D_h(X_i, X_j)=\\frac{1}{2}(n-\\sum_{k=1}^n x_{ik}*x_{jk})\\) \u5f0f\u4e2d\uff0c \\(x_{ik}, x_{jk}\\) \u5206\u522b\u8868\u793a \\(X_i\\) \u548c \\(X_j\\) \u7684\u7b2c k \u4e2a\u5206\u91cf\u3002 \u4e24\u4e2a\u6a21\u5f0f\u5411\u91cf\u7684\u5404\u5206\u91cf\u53d6\u503c\u5747\u4e0d\u540c\uff1a \\(D_h(X_i, X_j)=n\\) \uff0c\u5168\u76f8\u540c\uff1a \\(D_h(X_i, X_j)=0\\) \u89d2\u5ea6\u76f8\u4f3c\u6027\u51fd\u6570 \\[ S(X_i, X_j) = \\frac{X_i^{\\top}X_j}{\\parallel X_i \\parallel \\cdot \\parallel X_j \\parallel} \\] \u662f\u6a21\u5f0f\u5411\u91cf \\(X_i, X_j\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7684\u4f59\u5f26\u3002 Tanimoto \u6d4b\u5ea6 \u7528\u4e8e 0,1 \u4e8c\u503c\u7279\u5f81\u7684\u60c5\u51b5, \\[ S(X_i,X_j)=\\frac{X_i^{\\top}X_j}{X_i^{\\top}X_i+X_j^{\\top}X_j-X_i^{\\top}X_j} \\\\ \\ \\\\ = \\frac{X_i,X_j\u4e2d\u5171\u6709\u7684\u7279\u5f81\u6570\u76ee}{X_i\u548cX_j\u4e2d\u5360\u6709\u7684\u7279\u5f81\u6570\u76ee\u7684\u603b\u6570} \\] \u76f8\u4f3c\u6027\u6d4b\u5ea6\u51fd\u6570\u7684\u5171\u540c\u70b9\u90fd\u6d89\u53ca\u5230\u628a\u4e24\u4e2a\u76f8\u6bd4\u8f83\u7684\u5411\u91cf \\(X_i,X_j\\) \u7684\u5206\u91cf\u503c\u7ec4\u5408\u8d77\u6765\uff0c\u4f46\u600e\u6837\u7ec4\u5408\u5e76\u65e0\u666e\u904d\u6709\u6548\u7684\u65b9\u6cd5\uff0c\u5bf9\u5177\u4f53\u7684\u6a21\u5f0f\u5206\u7c7b\uff0c\u9700\u89c6\u60c5\u51b5\u4f5c\u9002\u5f53\u9009\u62e9\u3002","title":"\u76f8\u4f3c\u6027\u6d4b\u5ea6"},{"location":"cs/ai/mode-recognition/#_11","text":"\u6839\u636e\u76f8\u4f3c\u6027\u6d4b\u5ea6\u786e\u5b9a\u7684\uff0c\u8861\u91cf\u6a21\u5f0f\u4e4b\u95f4\u662f\u5426\u76f8\u4f3c\u7684\u6807\u51c6\u3002\u5373\u628a\u4e0d\u540c\u6a21\u5f0f\u805a\u4e3a\u4e00\u7c7b\u8fd8\u662f\u5f52\u4e3a\u4e0d\u540c\u7c7b\u7684\u51c6\u5219\u3002 \u786e\u5b9a\u805a\u7c7b\u51c6\u5219\u7684\u4e24\u79cd\u65b9\u5f0f\uff1a \u9608\u503c\u51c6\u5219\uff1a\u6839\u636e\u89c4\u5b9a\u7684\u8ddd\u79bb\u9608\u503c\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u51fd\u6570\u51c6\u5219\uff1a\u5229\u7528\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219 \u805a\u7c7b\u51c6\u5219\u51fd\u6570\uff1a\u5728\u805a\u7c7b\u5206\u6790\u4e2d\uff0c\u8868\u793a\u6a21\u5f0f\u7c7b\u95f4\u76f8\u4f3c\u6216\u5dee\u5f02\u6027\u7684\u51fd\u6570 \u5b83\u5e94\u662f\u6a21\u5f0f\u6837\u672c\u96c6 \\(\\{X\\}\\) \u548c\u6a21\u5f0f\u7c7b\u522b \\(\\{S_j,j=1,2,..,c\\}\\) \u7684\u51fd\u6570\u3002\u53ef\u4f7f\u805a\u7c7b\u5206\u6790\u8f6c\u5316\u4e3a\u5bfb\u627e\u51c6\u5219\u51fd\u6570\u6781\u503c\u7684\u6700\u4f18\u5316\u95ee\u9898\u3002\u4e00\u79cd\u5e38\u7528\u7684\u6307\u6807\u662f\u8bef\u5dee\u5e73\u65b9\u4e4b\u548c\u3002 \u805a\u7c7b\u51c6\u5219\u51fd\u6570 \\[J=\\sum_{j=1}^c\\sum_{X \\in S_j} \\parallel X-M_j \\parallel^2\\] \u5f0f\u4e2d\uff1ac \u4e3a\u805a\u7c7b\u7c7b\u522b\u7684\u6570\u76ee\uff0c \\(M_j=\\frac{1}{N_j}\\sum_{X \\in S_j}X\\) \u4e3a\u5c5e\u4e8e \\(S_j\\) \u96c6\u7684\u6837\u672c\u7684\u5747\u503c\u5411\u91cf\uff0c \\(N_j\\) \u4e3a \\(S_j\\) \u4e2d\u6837\u672c\u6570\u76ee\u3002 \\(J\\) \u4ee3\u8868\u4e86\u5206\u5c5e\u4e8e c \u4e2a\u805a\u7c7b\u7c7b\u522b\u7684\u5168\u90e8\u6a21\u5f0f\u6837\u672c\u4e0e\u5176\u76f8\u5e94\u7c7b\u522b\u6a21\u5f0f\u5747\u503c\u4e4b\u95f4\u7684\u8bef\u5dee\u5e73\u65b9\u548c\u3002 \u9002\u7528\u8303\u56f4\uff1a\u9002\u7528\u4e8e\u5404\u7c7b\u6837\u672c\u5bc6\u96c6\u4e14\u6570\u76ee\u76f8\u5dee\u4e0d\u591a\uff0c\u800c\u4e0d\u540c\u7c7b\u95f4\u7684\u6837\u672c\u53c8\u660e\u663e\u5206\u5f00\u7684\u60c5\u51b5\u3002","title":"\u805a\u7c7b\u51c6\u5219"},{"location":"cs/ai/mode-recognition/#_12","text":"","title":"\u57fa\u4e8e\u8ddd\u79bb\u9608\u503c\u7684\u805a\u7c7b\u7b97\u6cd5"},{"location":"cs/ai/mode-recognition/#_13","text":"\u95ee\u9898\uff1a\u6709 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u8981\u6c42\u6309\u8ddd\u79bb\u9608\u503c \\(T\\) \u5206\u7c7b\u5230\u4ee5 \\(Z_1, Z_2,...\\) \u4e3a\u805a\u7c7b\u4e2d\u5fc3\u7684\u6a21\u5f0f\u7c7b\u4e2d\u3002 \u7b97\u6cd5\u63cf\u8ff0 \u4efb\u53d6\u6837\u672c \\(X_i\\) \u4f5c\u4e3a\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u521d\u59cb\u503c\uff0c\u5982\u4ee4 \\(Z_1=X_1\\) \u8ba1\u7b97\u6837\u672c \\(X_2\\) \u5230 \\(Z_1\\) \u7684\u6b27\u6c0f\u8ddd\u79bb \\(D_{21}=\\parallel X_2 - Z_1 \\parallel\\) \uff0c\u82e5 \\(D_{21}>T\\) \uff0c\u5b9a\u4e49\u4e00\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2=X_2\\) \uff1b\u5426\u5219 \\(X_2 \\in\\) \u4ee5 \\(Z_1\\) \u4e3a\u4e2d\u5fc3\u7684\u805a\u7c7b\u3002 \u5047\u8bbe\u5df2\u6709\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\u3001Z_2\\) \uff0c\u8ba1\u7b97 \\(D_{31}=\\parallel X_3 - Z_1 \\parallel\\) \u548c \\(D_{32}=\\parallel X_3 - Z_2 \\parallel\\) \uff0c\u82e5 \\(D_{31}>T\\) \u4e14 \\(D_{32} > T\\) \uff0c\u5219\u5efa\u7acb\u7b2c\u4e09\u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(Z_3=X_3\\) \uff1b\u5426\u5219 \\(X_3 \\in\\) \u79bb \\(Z_1\\) \u548c \\(Z_2\\) \u4e2d\u6700\u8fd1\u8005\uff08\u6700\u8fd1\u90bb\u7684\u805a\u7c7b\u4e2d\u5fc3\uff09\u3002 \u4f9d\u6b64\u7c7b\u63a8\uff0c\u76f4\u5230\u5c06\u6240\u6709\u7684 \\(N\\) \u4e2a\u6837\u672c\u90fd\u8fdb\u884c\u5206\u7c7b \u7b97\u6cd5\u7279\u70b9 \u5c40\u9650\u6027\uff1a\u5f88\u5927\u7a0b\u5ea6\u4e0a\u4f9d\u8d56\u4e8e\u7b2c\u4e00\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u9009\u62e9\u3001\u5f85\u5206\u7c7b\u6a21\u5f0f\u6837\u672c\u7684\u6392\u5217\u6b21\u5e8f\u3001\u8ddd\u79bb\u9608\u503c \\(T\\) \u7684\u5927\u5c0f\u4ee5\u53ca\u6837\u672c\u5206\u5e03\u7684\u51e0\u4f55\u6027\u8d28\u7b49\u3002 \u4f18\u70b9\uff1a\u8ba1\u7b97\u7b80\u5355\u3002\uff08\u4e00\u79cd\u867d\u7c97\u7cd9\u4f46\u5feb\u901f\u7684\u65b9\u6cd5\uff09","title":"\u8fd1\u90bb\u805a\u7c7b\u6cd5"},{"location":"cs/ai/mode-recognition/#_14","text":"\u95ee\u9898\uff1a\u5df2\u77e5 \\(N\\) \u4e2a\u5f85\u5206\u7c7b\u7684\u6a21\u5f0f \\(\\{X_1, X_2, ..., X_N\\}\\) \uff0c\u5206\u7c7b\u5230\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1, Z_2, ...\\) \u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u7b97\u6cd5\u63cf\u8ff0 \u9009\u4efb\u610f\u4e00\u6a21\u5f0f\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e00\u805a\u7c7b\u4e2d\u5fc3 \\(Z_1\\) \u9009\u62e9\u79bb \\(Z_1\\) \u8ddd\u79bb\u6700\u8fdc\u7684\u6837\u672c\u4f5c\u4e3a\u7b2c\u4e8c\u805a\u7c7b\u4e2d\u5fc3 \\(Z_2\\) \u9010\u4e2a\u8ba1\u7b97\u5404\u6a21\u5f0f\u6837\u672c\u4e0e\u5df2\u786e\u5b9a\u7684\u6240\u6709\u805a\u7c7b\u4e2d\u5fc3\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5e76\u9009\u51fa\u5176\u4e2d\u7684\u6700\u5c0f\u8ddd\u79bb\u3002\u4f8b\u5982\u805a\u7c7b\u4e2d\u5fc3\u6570 \\(k=2\\) \u65f6\uff0c\u8ba1\u7b97 \\(D_{i1}=\\parallel X_i - Z_1 \\parallel\\) , \\(D_{i2}=\\parallel X_i - Z_2 \\parallel\\) \uff0c \\(\\min\\{D_{i1}, D_{i2}\\}, i=1,...,N\\) (N \u4e2a\u6700\u5c0f\u8ddd\u79bb) \u5728\u6240\u6709\u6700\u5c0f\u8ddd\u79bb\u4e2d\u9009\u51fa\u6700\u5927\u8ddd\u79bb\uff0c\u5982\u8be5\u6700\u5927\u503c\u8fbe\u5230 \\(\\parallel Z_1 - Z_2 \\parallel\\) \u7684\u4e00\u5b9a\u5206\u6570\u6bd4\u503c\uff08\u9608\u503c \\(T\\) \uff09\u4ee5\u4e0a\uff0c\u5219\u76f8\u5e94\u7684\u6837\u672c\u70b9\u53d6\u4e3a\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\uff0c\u8fd4\u56de 3\uff1b\u5426\u5219\u7ed3\u675f \u91cd\u590d\u6b65\u9aa4 3\u30014\uff0c\u76f4\u5230\u6ca1\u6709\u65b0\u7684\u805a\u7c7b\u4e2d\u5fc3\u51fa\u73b0\u4e3a\u6b62 \u5c06\u6837\u672c \\(\\{X_1, i=1,2,..,N\\}\\) \u6309\u6700\u8fd1\u8ddd\u79bb\u5212\u5206\u5230\u76f8\u5e94\u805a\u7c7b\u4e2d\u5fc3\u5bf9\u5e94\u7684\u7c7b\u522b\u4e2d \u603b\u7ed3\uff1a\u5148\u627e\u4e2d\u5fc3\u540e\u5206\u7c7b\uff1b\u5173\u952e\uff1a\u600e\u4e48\u5f00\u65b0\u7c7b\uff0c\u805a\u7c7b\u4e2d\u5fc3\u5982\u4f55\u5b9a","title":"\u6700\u5927\u6700\u5c0f\u7b97\u6cd5\uff08\u5c0f\u4e2d\u53d6\u5927\u8ddd\u79bb\u7b97\u6cd5\uff09"},{"location":"cs/ai/mode-recognition/#_15","text":"\u6bcf\u4e2a\u6837\u672c\u5148\u81ea\u6210\u4e00\u7c7b\uff0c\u7136\u540e\u6309\u8ddd\u79bb\u51c6\u5219\u9010\u6b65\u5408\u5e76\uff0c\u51cf\u5c11\u7c7b\u6570 \u7b97\u6cd5\u63cf\u8ff0 \\(N\\) \u4e2a\u521d\u59cb\u6a21\u5f0f\u6837\u672c\u81ea\u6210\u4e00\u7c7b\uff0c\u5373\u5efa \\(N\\) \u7c7b\uff1a \\(G_1(0), G_2(0), ..., G_N(0)\\) \uff0c\u8ba1\u7b97\u5404\u7c7b\u4e4b\u95f4\uff08\u5373\u5404\u6837\u672c\u95f4\uff09\u7684\u8ddd\u79bb\uff0c\u5f97\u4e00 \\(N \\times N\\) \u7ef4\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(0)\\) \u3002 \\(\u201c0\u201d\\) \u8868\u793a\u521d\u59cb\u72b6\u6001 \u5047\u8bbe\u5df2\u6c42\u5f97\u8ddd\u79bb\u77e9\u9635 \\(\\mathbf{D}(n)\\) \uff08n\u4e3a\u9010\u6b21\u805a\u7c7b\u5408\u5e76\u7684\u6b21\u6570\uff09\uff0c\u627e\u51fa \\(\\mathbf{D}(n)\\) \u4e2d\u7684\u6700\u5c0f\u5143\u7d20\uff0c\u5c06\u5176\u5bf9\u5e94\u7684\u4e24\u7c7b\u5408\u5e76\u6210\u4e00\u7c7b\u3002\u7531\u6b64\u5efa\u7acb\u65b0\u7684\u5206\u7c7b\uff1a \\(G_1(n+1), G_2(n+1),...\\) \u8ba1\u7b97\u5408\u5e76\u540e\u65b0\u7c7b\u522b\u4e4b\u95f4\u7684\u8ddd\u79bb\uff0c\u5f97 \\(\\mathbf{D}(n+1)\\) \u8df3\u5230\u7b2c 2 \u6b65\uff0c\u91cd\u590d\u8ba1\u7b97\u53ca\u5408\u5e76 \u7ed3\u675f\u6761\u4ef6 \u53d6\u8ddd\u79bb\u9608\u503c \\(T\\) \uff0c\u5f53 \\(\\mathbf{D}(n)\\) \u7684\u6700\u5c0f\u5206\u91cf\u8d85\u8fc7\u7ed9\u5b9a\u503c \\(T\\) \u65f6\uff0c\u7b97\u6cd5\u505c\u6b62\uff0c\u6240\u5f97\u5373\u4e3a\u805a\u7c7b\u7ed3\u679c \u6216\u4e0d\u8bbe\u9608\u503c \\(T\\) \uff0c\u4e00\u76f4\u5c06\u5168\u90e8\u6837\u672c\u805a\u6210\u4e00\u7c7b\u4e3a\u6b62\uff0c\u8f93\u51fa\u805a\u7c7b\u7684\u5206\u7ea7\u6811 \u95ee\u9898\u8ba8\u8bba\uff1a\u7c7b\u95f4\u8ddd\u79bb\u8ba1\u7b97\u51c6\u5219 \u6700\u77ed\u8ddd\u79bb\u6cd5 \u5982 \\(H\u3001K\\) \u662f\u4e24\u4e2a\u805a\u7c7b\uff0c\u5219\u4e24\u7c7b\u95f4\u7684\u6700\u77ed\u8ddd\u79bb\u5b9a\u4e49\u4e3a: \\[ D_{HK} = \\min\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\] \u6700\u957f\u8ddd\u79bb\u6cd5 \\[ D_{HK} = \\max\\{D(\\mathbf{X}_H-\\mathbf{X}_K)\\} \\ \\ \\ \\mathbf{X}_H \\in H, \\mathbf{X}_K \\in K \\\\ \u82e5 K \u7c7b\u7531 I\u3001J \u4e24\u7c7b\u5408\u5e76\u800c\u6210\u5219 \\\\ D_{HK} = \\max\\{D_{HI}, D_{HJ}\\} \\] \u4e2d\u95f4\u8ddd\u79bb\u6cd5 \u4ecb\u4e8e\u6700\u957f\u4e0e\u6700\u77ed\u7684\u8ddd\u79bb\u4e4b\u95f4 \\[ D_{HK}=\\sqrt{\\frac{1}{2} D_{HI}^2+\\frac{1}{2}D_{HJ}^2-\\frac{1}{4}D_{IJ}^2} \\] \u91cd\u5fc3\u6cd5 \u5c06\u6bcf\u7c7b\u4e2d\u5305\u542b\u7684\u6837\u672c\u6570\u8003\u8651\u8fdb\u53bb\u3002\u82e5 \\(I\\) \u7c7b\u4e2d\u6709 \\(n_I\\) \u4e2a\u6837\u672c\uff0c\u82e5 \\(J\\) \u7c7b\u4e2d\u6709 \\(n_J\\) \u4e2a\u6837\u672c \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2-\\frac{n_In_J}{n_I+n_J}D_{IJ}^2} \\] \u7c7b\u5e73\u5747\u8ddd\u79bb\u6cd5 \\[ D_{HK}=\\sqrt{\\frac{1}{n_Hn_K} \\sum_{i \\in H,j \\in K}d_{ij}^2} \\] \\(d_{ij}\\) \uff1a \\(H\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u548c \\(K\\) \u7c7b\u4efb\u4e00\u6837\u672c \\(X_i\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u5e73\u65b9 \u82e5 \\(K\\) \u7c7b\u7531 \\(I\\) \u7c7b\u548c \\(J\\) \u7c7b\u5408\u5e76\u4ea7\u751f\uff0c\u5219\u9012\u63a8\u5f0f\u4e3a \\[ D_{HK}=\\sqrt{\\frac{n_I}{n_I+n_J} D_{HI}^2+\\frac{n_J}{n_I+n_J}D_{HJ}^2} \\]","title":"\u5c42\u6b21\u805a\u7c7b\u6cd5"},{"location":"cs/ai/mode-recognition/#_16","text":"\u4e24\u79cd\u5e38\u7528\u7684\u7b97\u6cd5\uff1a \\(K\\) -\u5747\u503c\u7b97\u6cd5(\u6216 \\(C\\) -\u5747\u503c\u7b97\u6cd5) \u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5","title":"\u52a8\u6001\u805a\u7c7b\u6cd5"},{"location":"cs/ai/mode-recognition/#k-","text":"\u57fa\u4e8e\u4f7f\u805a\u7c7b\u51c6\u5219\u51fd\u6570\u6700\u5c0f\u5316 \u51c6\u5219\u51fd\u6570\uff1a\u805a\u7c7b\u96c6\u4e2d\u6bcf\u4e00\u6837\u672c\u70b9\u5230\u8be5\u7c7b\u4e2d\u5fc3\u5230\u8ddd\u79bb\u5e73\u65b9\u548c \u5bf9\u4e8e\u7b2c j \u805a\u7c7b\u96c6\uff0c\u51c6\u5219\u51fd\u6570\u5b9a\u4e49\u4e3a \\(J_j = \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2\uff0c\\ \\ \\ X_i \\in S_j\\) \\(S_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6\uff0c\u805a\u7c7b\u4e2d\u5fc3\u4e3a \\(Z_j\\) \\(N_j\\) : \u7b2c j \u4e2a\u805a\u7c7b\u96c6 \\(S_j\\) \u4e2d\u6240\u5305\u542b\u7684\u6837\u672c\u4e2a\u6570 \u5bf9\u6240\u6709 \\(K\\) \u4e2a\u6a21\u5f0f\u7c7b\u6709 \\(J = \\sum_{j=1}^{K} \\sum_{i=1}^{N_j} \\parallel X_i - Z_j \\parallel ^2, \\ \\ \\ X_i \\in S_j\\) \u805a\u7c7b\u51c6\u5219\uff1a \u805a\u7c7b\u4e2d\u5fc3\u7684\u9009\u62e9\u5e94\u4f7f\u51c6\u5219\u51fd\u6570 \\(J\\) \u6781\u5c0f\uff0c\u5373\u4f7f \\(J_j\\) \u7684\u503c\u5f88\u5c0f \u8ba9 \\(\\frac{\\partial J_j}{\\partial \\mathbf{Z}_j}=0\\) \uff0c\u89e3\u5f97 \\(\\mathbf{Z}_j = \\frac{1}{N_j} \\sum_{i=1}^{N_j} \\mathbf{X_i}, \\ \\ \\ \\mathbf{X}_i \\in S_j\\) \u7b97\u6cd5\u63cf\u8ff0: \u4efb\u9009 K \u4e2a\u521d\u59cb\u805a\u7c7b\u4e2d\u5fc3\uff1a \\(\\mathbf{Z}_1(1), \\mathbf{Z}_2(1), ..., \\mathbf{Z}_K(1)\\) \u62ec\u53f7\u5185\u5e8f\u53f7\uff1a\u8fed\u4ee3\u8fd0\u7b97\u7684\u6b21\u5e8f\u53f7 \u6309\u6700\u5c0f\u8ddd\u79bb\u539f\u5219\u5c06\u5176\u4f59\u6837\u54c1\u5206\u914d\u5230 K \u4e2a\u805a\u7c7b\u4e2d\u5fc3\u4e2d\u7684\u67d0\u4e00\u4e2a\uff0c\u5373 \\(\\min\\{\\parallel X - Z_i(k) \\parallel, i=1,2,...,K\\}=\\parallel X-Z_j(k) \\parallel=D_j(k)\uff0c\u5219 X \\in S_j(k)\\) \uff0c\u6ce8\u610f\uff0ck \u662f\u8fed\u4ee3\u8fd0\u7b97\u6b21\u5e8f\u53f7\uff0cK \u662f\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u8ba1\u7b97\u5404\u4e2a\u805a\u7c7b\u4e2d\u5fc3\u7684\u65b0\u5411\u91cf\u503c: \\(Z_j(k+1) \\ \\ j=1,2,...,K\\) \\[ Z_j(k+1) = \\frac{1}{N_j} \\sum_{X \\in S_j(k)} \\mathbf{X} \\ \\ \\ j=1,2,...,K \\] \\(N_j\\) : \u7b2c j \u7c7b\u7684\u6837\u672c\u6570 \u5224\u65ad \u5982\u679c \\(Z_j(k+1) \\ne Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u5219\u56de\u5230 2\uff0c\u5c06\u6a21\u5f0f\u6837\u672c\u9010\u4e2a\u91cd\u65b0\u5206\u7c7b\uff0c\u91cd\u590d\u8fed\u4ee3\u8ba1\u7b97 \u5982\u679c \\(Z_j(k+1) = Z_j(k) \\ \\ j=1,2,...,K\\) \uff0c\u7b97\u6cd5\u6536\u655b\uff0c\u8ba1\u7b97\u5b8c\u6bd5","title":"K-\u5747\u503c\u7b97\u6cd5"},{"location":"cs/ai/mode-recognition/#_17","text":"\u7b97\u6cd5\u7279\u70b9 \u52a0\u5165\u4e86\u8bd5\u63a2\u6027\u6b65\u9aa4\uff0c\u7ec4\u6210\u4eba\u673a\u4ea4\u4e92\u7684\u7ed3\u6784 \u53ef\u4ee5\u901a\u8fc7\u7c7b\u7684\u81ea\u52a8\u5408\u5e76\u4e0e\u5206\u88c2\u5f97\u5230\u8f83\u5408\u7406\u7684\u7c7b\u522b\u6570 \u4e0e K-\u5747\u503c\u7b97\u6cd5 \u76f8\u4f3c\uff1a\u805a\u7c7b\u4e2d\u5fc3\u7684\u4f4d\u7f6e\u5747\u901a\u8fc7\u6837\u672c\u5747\u503c\u7684\u8fed\u4ee3\u8fd0\u7b97\u51b3\u5b9a \u76f8\u5f02\uff1aK-\u5747\u503c\u7b97\u6cd5\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570\u4e0d\u53d8\uff0c\u4f46ISODATA\u7b97\u6cd5\u4e0d\u53d8 \u7b97\u6cd5\u63cf\u8ff0 \u9884\u9009 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d\u5fc3 \\(\\{Z_1, Z_2, ..., Z_{N_C}\\}\\) \uff0c \\(N_C\\) \u4e5f\u662f\u805a\u7c7b\u8fc7\u7a0b\u4e2d\u5b9e\u9645\u7684\u805a\u7c7b\u4e2d\u5fc3\u4e2a\u6570 \u628a N \u4e2a\u6837\u672c\u6309\u6700\u8fd1\u90bb\u89c4\u5219\u5206\u914d\u5230 \\(N_C\\) \u4e2a\u805a\u7c7b\u4e2d \\[ \u82e5 \\ \\ \\ \\parallel X - Z_j \\parallel = \\min\\{\\parallel X - Z_i, i = 1, ,2, .., N_C\\} \\\\ \u5219 \\ \\ \\ X \\in S_j \\] \u82e5 \\(S_j\\) \u4e2d\u7684\u6837\u672c\u6570 \\(N_j < \\theta_N\\) \uff0c\u5219\u53d6\u6d88\u8be5\u7c7b\uff0c\u5e76\u4e14 \\(N_C\\) \u51cf\u53bb 1 \u4fee\u6b63\u5404\u805a\u7c7b\u4e2d\u5fc3\u503c \\(Z_j = \\frac{1}{N_j} \\sum_{X \\in S_j} X \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97 \\(S_j\\) \u7684\u7c7b\u5185\u7684\u5e73\u5747\u8ddd\u79bb \\(\\bar{D_j} = \\frac{1}{N_j} \\sum_{X \\in S_j} \\parallel X - Z_j \\parallel \\ \\ \\ j=1,2,...,N_C\\) \u8ba1\u7b97\u603b\u4f53\u5e73\u5747\u8ddd\u79bb \u5224\u65ad\u5f53\u524d\u662f\u5206\u88c2\u8fd8\u662f\u5408\u5e76\uff0c\u51b3\u5b9a\u8fed\u4ee3\u6b65\u9aa4\u7b49 \u82e5 \\(N_C \\le K/2\\) \uff0c\u8fdb\u5165\u5206\u88c2 \u5982\u679c\u8fed\u4ee3\u6b21\u6570\u662f\u5076\u6570\u6216 \\(N_C \\ge 2K\\) \uff0c\u5219\u5408\u5e76\u5426\u5219\u5206\u88c2 \u8ba1\u7b97\u6bcf\u4e2a\u805a\u7c7b\u4e2d\u6837\u672c\u8ddd\u79bb\u7684\u6807\u51c6\u5dee\u5411\u91cf \u6c42\u6bcf\u4e2a\u6807\u51c6\u5dee\u5411\u91cf\u7684\u6700\u5927\u5206\u91cf \u592a\u957f\u4e86\u3002\u3002\u3002 \u5168\u662f\u516c\u5f0f\u3002\u3002\u3002","title":"\u8fed\u4ee3\u81ea\u7ec4\u7ec7\u7684\u6570\u636e\u5206\u6790\u7b97\u6cd5"},{"location":"cs/ai/mode-recognition/#_18","text":"","title":"\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_19","text":"\u5b9a\u4e49\uff1a\u76f4\u63a5\u7528\u6765\u5bf9\u6a21\u5f0f\u8fdb\u884c\u5206\u7c7b\u7684\u51c6\u5219\u51fd\u6570\u3002\u82e5\u5206\u5c5e\u4e8e \\(\\omega_1, \\omega_2\\) \u7684\u4e24\u7c7b\u6a21\u5f0f\u53ef\u7528\u4e00\u65b9\u7a0b \\(d(X)=0\\) \u6765\u5212\u5206\uff0c\u90a3\u4e48\u79f0 \\(d(X)\\) \u4e3a\u5224\u522b\u51fd\u6570\u3002 \u786e\u5b9a\u5224\u522b\u51fd\u6570\u7684\u4e24\u4e2a\u56e0\u7d20 \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u51e0\u4f55\u6027\u8d28\u3002\u5b83\u53ef\u4ee5\u662f\u7ebf\u6027\u7684\u6216\u975e\u7ebf\u6027\u7684\u51fd\u6570\uff0c\u7ef4\u6570\u5728\u7279\u5f81\u63d0\u53d6\u65f6\u5df2\u7ecf\u786e\u5b9a \u5224\u51b3\u51fd\u6570 \\(d(X)\\) \u7684\u7cfb\u6570\uff0c\u7528\u6240\u7ed9\u7684\u6a21\u5f0f\u6837\u672c\u786e\u5b9a","title":"\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_20","text":"","title":"\u7ebf\u6027\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_21","text":"\u5c06\u4e8c\u7ef4\u5f62\u5f0f\u63a8\u5e7f\u5230 n \u7ef4\uff0c\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f\u4e3a \\[ d(X) = w_1x_1+w_2x_2+...+w_nx_n+w_{n+1}=W_0^{\\top}X+w_{n+1} \\] \u589e\u5e7f\u5411\u91cf\u7684\u5f62\u5f0f \\(d(X)=W^{\\top}X\\)","title":"\u4e00\u822c\u5f62\u5f0f"},{"location":"cs/ai/mode-recognition/#_22","text":"\u4e24\u7c7b\u60c5\u51b5 \\[ d(X)=W^{\\top}X \\left\\{\\begin{matrix} >0 & \u82e5 X \\in \\omega_1 \\\\ <0 & \u82e5 X \\in \\omega_2 \\end{matrix}\\right. \\] \u591a\u7c7b\u60c5\u51b5 \\(\\omega_i \\sqrt{\\omega_i}\\) \u4e24\u5206\u6cd5 \u7528\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5c06\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u4e0e\u5176\u4f59\u4e0d\u5c5e\u4e8e \\(\\omega_i\\) \u7c7b\u7684\u6a21\u5f0f\u5206\u5f00 \\(\\omega_i \\omega_i\\) \u4e24\u5206\u6cd5 \u4e00\u4e2a\u5224\u522b\u754c\u9762\u53ea\u80fd\u5206\u5f00\u4e24\u4e2a\u7c7b\u522b\uff0c\u4e0d\u80fd\u628a\u5176\u4f59\u6240\u6709\u7684\u7c7b\u522b\u90fd\u5206\u5f00\u3002\u5224\u51b3\u51fd\u6570\u4e3a \\(d_{ij}(X)=W_{ij}^{\\top}X\\) \u6027\u8d28\uff1a \\(d_{ij}(X) > 0, \\forall j \\ne i; i, j = 1,2,...,M\uff0c\u82e5X \\in \\omega_i\\)","title":"\u6027\u8d28"},{"location":"cs/ai/mode-recognition/#_23","text":"\u76ee\u7684\uff1a\u5bf9\u975e\u7ebf\u6027\u8fb9\u754c\uff0c\u901a\u8fc7\u67d0\u6620\u5c04\uff0c\u628a\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u53d8\u6210 \\(X^*\\) \uff0c\u4ee5\u4fbf\u5c06 \\(X\\) \u7a7a\u95f4\u4e2d\u975e\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6\uff0c\u53d8\u6210\u5728 \\(X^*\\) \u7a7a\u95f4\u4e2d\u7ebf\u6027\u53ef\u5206\u7684\u6a21\u5f0f\u96c6","title":"\u5e7f\u4e49\u7ebf\u6027\u5224\u522b\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_24","text":"\u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u5f62\u5f0f\u4e4b\u4e00\u662f\u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570 \u8bbe\u4e00\u8bad\u7ec3\u7528\u6a21\u5f0f\u96c6\uff0c \\(\\{X\\}\\) \u5728\u6a21\u5f0f\u7a7a\u95f4 \\(X\\) \u4e2d\u7ebf\u6027\u4e0d\u53ef\u5206\uff0c\u975e\u7ebf\u6027\u5224\u522b\u51fd\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ d(\\mathbf{X})=w_1f_1(\\mathbf{X})+w_2f_2(\\mathbf{X})+...+w_kf_k(\\mathbf{X})+w_{k+1}=\\sum_{i=1}^{k+1}w_if_i(\\mathbf{X}) \\\\ \u5f0f\u4e2d,\\{f_i(\\mathbf{X}),i=1,2,...,k\\}\u662f\u6a21\u5f0f\\mathbf{X}\u7684\u5355\u503c\u5b9e\u51fd\u6570\uff0cf_{k+1}(\\mathbf{X})=1 \\] \u5e7f\u4e49\u5f62\u5f0f\u7684\u6a21\u5f0f\u5411\u91cf\u5b9a\u4e49\u4e3a\uff1a \\[ \\mathbf{X}^*=[x_1^*+x_2^*+...+x_k^*+1]^\\top=[f_1(\\mathbf{X})+f_2(\\mathbf{X})+...+f_k(\\mathbf{X})+1]^\\top \\]","title":"\u975e\u7ebf\u6027\u591a\u9879\u5f0f\u51fd\u6570"},{"location":"cs/ai/mode-recognition/#_25","text":"\u6a21\u5f0f\u7a7a\u95f4\u4e0e\u8d85\u5e73\u9762 \u6743\u7a7a\u95f4\u548c\u6743\u5411\u91cf\u89e3","title":"\u7ebf\u6027\u5224\u522b\u51fd\u6570\u7684\u51e0\u4f55\u6027\u8d28"},{"location":"cs/ai/mode-recognition/#_26","text":"","title":"\u611f\u77e5\u5668\u7b97\u6cd5"},{"location":"cs/algorithm/basic-ds/","text":"","title":"\u57fa\u7840\u6570\u636e\u7ed3\u6784"},{"location":"cs/algorithm/design-analysis/","text":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790 \u00b6 \u7ea6 876 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u672c\u79d1\u548c\u7814\u90fd\u9009\u8fc7\u8fd9\u95e8\u8bfe\uff0c\u7279\u6b64\u6765\u5f52\u6863\u4e00\u4e0b\u7b14\u8bb0 \uff08\u867d\u7136\u90fd\u662f\u6253acm\u7684\u65f6\u5019\u5b66\u7684 \ud83d\ude02 \u7b97\u6cd5\u5f15\u8bba \u00b6 \u7b97\u6cd5\u662f\u6ee1\u8db3\u4e0b\u8ff0\u6027\u8d28\u7684\u6307\u4ee4\u5e8f\u5217\uff1a \u8f93\u5165\uff1a\u6709\u96f6\u4e2a\u6216\u591a\u4e2a\u5916\u90e8\u91cf\u4f5c\u4e3a\u7b97\u6cd5\u7684\u8f93\u5165\u3002 \u8f93\u51fa\uff1a\u7b97\u6cd5\u4ea7\u751f\u81f3\u5c11\u4e00\u4e2a\u91cf\u4f5c\u4e3a\u8f93\u51fa\u3002 \u786e\u5b9a\u6027\uff1a\u7ec4\u6210\u7b97\u6cd5\u7684\u6211\u6761\u6307\u4ee4\u8db3\u6e05\u6670\u7684\uff0c\u65e0\u6b67\u4e49\u7684\u3002 \u6709\u9650\u6027\uff1a\u7b97\u6cd5\u4e2d\u6bcf\u6761\u6307\u4ee4\u7684\u6267\u884c\u6b21\u6570\u6709\u9650\uff0c\u62ab\u884c\u6bcf\u6761\u6307\u4ee4\u7684\u65f6\u95f4\u4e16\u5b58\u9650\u3002 \u7b97\u6cd5\u5206\u6790\u5185\u5bb9\uff1a \u8fd0\u884c\u65f6\u95f4\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u6709\u5173 \u65f6\u95f4\u590d\u6742\u5ea6\u3001\u7a7a\u95f4\u590d\u6742\u5ea6\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u65e0\u5173 \u590d\u6742\u5ea6\u5206\u6790\u5047\u8bbe\uff1a \u6307\u4ee4\u6309\u987a\u5e8f\u6267\u884c \u6240\u6709\u6307\u4ee4\uff08\u8fd0\u7b97\uff09\u90fd\u6d88\u8017\u540c\u4e00\u65f6\u95f4\u5355\u5143 \u6570\u636e\u89c4\u6a21\u662f\u7ed9\u5b9a\u7684\uff0c\u4e14\u6709\u65e0\u9650\u7a7a\u95f4 \u4e00\u822c\u9700\u8981\u5206\u6790 \\(T_{\\mathrm{avg}}(N)\\) \uff08\u5e73\u5747\u60c5\u51b5\uff09\u548c \\(T_{\\mathrm{worst}}(N)\\) \uff08\u6700\u5dee\u60c5\u51b5\uff09\uff0c \\(N\\) \u662f\u8f93\u5165\u7684\u6570\u636e\u89c4\u6a21\uff08\u4e5f\u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165\u89c4\u6a21\uff09 \u590d\u6742\u5ea6\u6e10\u8fdb\u8bb0\u53f7 \u00b6 \u5b9a\u4e49 \u00b6 \u5927 \\(O\\) \u8868\u793a\u6cd5 \\(T(N) = O(f(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\leq c\\cdot f(N)\\) \u6e10\u8fdb\u4e0a\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u9ad8\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u6162\u6216\u76f8\u540c\uff0c<=\uff09 \u5927 \\(\\Omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\Omega(g(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\geq c\\cdot g(N)\\) \u6e10\u8fdb\u4e0b\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u4f4e\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u5feb\u6216\u76f8\u540c\uff0c>=\uff09 \u5927 \\(\\Theta\\) \u8868\u793a\u6cd5 \\(T(N) = \\Theta(h(N))\\) \uff0c\u5f53\u4e14\u4ec5\u5f53 \\(T(N) = O(h(N))\\) \u4e14 \\(T(N) = \\Omega(h(N))\\) \u6e10\u8fdb\u7d27\u786e\u754c\uff0c\u5373 \\(T(N)\\) \u9700\u8981\u4e0e \\(h(N)\\) \u540c\u9636\uff08\u589e\u957f\u901f\u5ea6\u76f8\u540c =\uff09 \u5c0f \\(o\\) \u8868\u793a\u6cd5 \\(T(N) = o(p(N))\\) \uff0c\u5f53 \\(T(N) = O(p(N))\\) \u4e14 \\(T(N)\\ne \\Theta(p(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0a\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(p(N)\\) \u6162\uff0c<\uff09 \u5c0f \\(\\omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\omega(p(N))\\) \uff0c\u5f53 \\(T(N) = \\Omega(q(N))\\) \u4e14 \\(T(N)\\ne \\Theta(q(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0b\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(q(N)\\) \u5feb\uff0c>\uff09 \u89c4\u5219 \u00b6 \u5982\u679c \\(T_1(N) = O(f(N))\\) \u4e14 \\(T_2(N) = O(g(N))\\) \uff0c\u5219\uff1a \\(T_1(N) + T_2(N) = \\mathrm{max}(O(f(N)), O(g(N)))\\) \\(T_1(N)\\cdot T_2(N) = O(f(N)\\cdot g(N))\\) \u5982\u679c \\(T(N)\\) \u662f \\(N\\) \u7684 \\(k\\) \u6b21\u591a\u9879\u5f0f\uff0c\u5219 \\(T(N) = \\Theta(N^k)\\) \u5bf9\u4e8e\u4efb\u610f\u5e38\u6570 \\(k\\) \u5747\u6709 \\(\\log^kN = O(N)\\) \u5927 O \u8bb0\u53f7\u6bd4\u8f83\uff1a Big O Cheat Sheet \u5206\u6790\u89c4\u5219\uff1a for \u5faa\u73af\u7684\u8fd0\u884c\u65f6\u95f4\u662f\u5faa\u73af\u5185\u90e8\u8bed\u53e5\u7684\u6700\u957f\u65f6\u95f4\uff08\u542b for \u5224\u65ad\uff09\u4e58\u5faa\u73af\u6b21\u6570 \u5d4c\u5957 for \u5faa\u73af\u8981\u9010\u6b21\u76f8\u4e58 if else \u8bed\u53e5\u7684\u8fd0\u884c\u65f6\u95f4\u4e0d\u8d85\u8fc7\u5224\u65ad\u65f6\u95f4+\u8017\u65f6\u6700\u957f\u7684\u8bed\u53e5\u5757\u7684\u8fd0\u884c\u65f6\u95f4 \u8865\u5145\uff1a\u4e3b\u5b9a\u7406\u3002\u5047\u8bbe\u6709 \\(T(n) = aT(n/b)+f(n)\\) \uff08 \\(a\\geq 1, b>1\\) \uff09\uff0c\u5219\uff1a \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = O(n^{\\log_ba-\\epsilon})\\) \uff0c\u5219 \\(T(n) = \\Theta(n^{\\log_ba})\\) \u5982\u679c \\(f(n) = \\Theta(n^{\\log_ba})\\) \u5219 \\(T(n) = \\Theta(n^{\\log_ba}\\log n)\\) \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = \\Omega(n^{\\log_ba+\\epsilon})\\) \uff0c\u540c\u65f6\u5b58\u5728\u5e38\u6570 \\(c<1\\) \u4f7f\u5f97\u5bf9\u4e8e\u5145\u5206\u5927 \\(n\\) \u6709 \\(af(n/b)\\leq cf(n)\\) \u5219 \\(T(N) = \\Theta(f(n))\\) \u9012\u5f52\u4e0e\u5206\u6cbb \u00b6 \u9012\u5f52\u7684\u6982\u5ff5 \u00b6 \u76f4\u63a5\u6210\u95f4\u63a5\u5730\u8c03\u7528\u81ea\u8eab\u7684\u7b97\u6cd5\u79f0\u4e3a\u9012\u5f52\u7b97\u6cd5\u3002\u7528\u51fd\u6570\u81ea\u8eab\u7ed9\u51fa\u5b9a\u4e49\u7684\u51fd\u6570\u79f0\u4e3a\u9012\u5f52\u51fd\u6570\u3002 \u4f8b\u5982\u9636\u4e58\u51fd\u6570\u3001\u6590\u6ce2\u90a3\u5951\u51fd\u6570\u7b49\u7b49 \\[ eg \\ \\ \\ F(n) = \\left\\{\\begin{matrix} 1 & n = 0, 1 \\\\ F(n-1)+F(n-2) & n >= 1 \\end{matrix}\\right. \\] int fibonacci ( int n ) { if ( n <= 1 ) return 1 ; return fibonacci ( n - 1 ) + fibonacci ( n - 2 ); } \u5bf9\u4e8e\u5c0f\u8303\u56f4\u53ef\u4ee5\u7528\u8bb0\u5fc6\u5316 \\(O(n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3 \u5bf9\u4e8e\u5927\u8303\u56f4\u53ef\u4ee5\u7528\u77e9\u9635\u5feb\u901f\u5e42 \\(O(\\log n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3\u3002 \u5206\u6cbb\u6cd5\u601d\u60f3 \u00b6 \u5206\u6cbb\u6cd5\u7684\u57fa\u672c\u601d\u60f3\u662f\u5c06\u4e00\u4e2a\u898f\u6a21\u4e3a \\(n\\) \u7684\u95ee\u9898\u5206\u89e3\u4e3a \\(k\\) \u4e2a\u89c4\u6a21\u8f83\u5c0f\u7684\u5b50\u95ee\u9898\uff0c\u8fd9\u4e9b\u5b50\u95ee\u9898\u4e92\u76f8\u72ec\u7acb\u4e14\u4e0e\u539f\u95ee\u9898\u76f8\u540c\u3002\u9012\u95e8\u5730\u89e3\u8fd9\u4e9b\u5b50\u95ee\u9898\uff0c\u7136\u540e\u5c07\u5404\u5b50\u95ee\u9898\u7684\u89e3\u5408\u4e95\u5f97\u5230\u539f\u5411\u9898\u7684\u89e3\u3002 eg\uff1a\u5feb\u901f\u5e42\u3001\u4e8c\u5206\u3001\u5f52\u5e76\u6392\u5e8f\u3001\u7ebf\u6bb5\u6811\u3001cdq\u5206\u6cbb\u3001FFT\u7b49 \u5927\u6574\u6570\u7684\u4e58\u6cd5 \u00b6 \u6709\u4e24\u4e2a\u8d85\u8fc7 long long \u7c7b\u578b\u7684\u5927\u6574\u6570 \\(X\\) \u548c \\(Y\\) \uff0c\u7528\u8f83\u4f4e\u7684\u590d\u6742\u5ea6\u6c42\u89e3 \\(X*Y\\) \u3002 \u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u81f3\u5c11\u6709 6 \u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u770b\u4e4b\u524d\u5199\u8fc7\u7684\u6587\u7ae0\uff1a \u5927\u6574\u6570\u76f8\u4e58 \u2013 \u6a21\u62df/\u5206\u6cbb/FFT/CRT/\u7f51\u7edc\u6d41/Furer Reference \u00b6 \u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790(\u738b\u6653\u4e1c).pdf","title":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790"},{"location":"cs/algorithm/design-analysis/#_1","text":"\u7ea6 876 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u672c\u79d1\u548c\u7814\u90fd\u9009\u8fc7\u8fd9\u95e8\u8bfe\uff0c\u7279\u6b64\u6765\u5f52\u6863\u4e00\u4e0b\u7b14\u8bb0 \uff08\u867d\u7136\u90fd\u662f\u6253acm\u7684\u65f6\u5019\u5b66\u7684 \ud83d\ude02","title":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790"},{"location":"cs/algorithm/design-analysis/#_2","text":"\u7b97\u6cd5\u662f\u6ee1\u8db3\u4e0b\u8ff0\u6027\u8d28\u7684\u6307\u4ee4\u5e8f\u5217\uff1a \u8f93\u5165\uff1a\u6709\u96f6\u4e2a\u6216\u591a\u4e2a\u5916\u90e8\u91cf\u4f5c\u4e3a\u7b97\u6cd5\u7684\u8f93\u5165\u3002 \u8f93\u51fa\uff1a\u7b97\u6cd5\u4ea7\u751f\u81f3\u5c11\u4e00\u4e2a\u91cf\u4f5c\u4e3a\u8f93\u51fa\u3002 \u786e\u5b9a\u6027\uff1a\u7ec4\u6210\u7b97\u6cd5\u7684\u6211\u6761\u6307\u4ee4\u8db3\u6e05\u6670\u7684\uff0c\u65e0\u6b67\u4e49\u7684\u3002 \u6709\u9650\u6027\uff1a\u7b97\u6cd5\u4e2d\u6bcf\u6761\u6307\u4ee4\u7684\u6267\u884c\u6b21\u6570\u6709\u9650\uff0c\u62ab\u884c\u6bcf\u6761\u6307\u4ee4\u7684\u65f6\u95f4\u4e16\u5b58\u9650\u3002 \u7b97\u6cd5\u5206\u6790\u5185\u5bb9\uff1a \u8fd0\u884c\u65f6\u95f4\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u6709\u5173 \u65f6\u95f4\u590d\u6742\u5ea6\u3001\u7a7a\u95f4\u590d\u6742\u5ea6\uff1a\u4e0e\u673a\u5668\u548c\u7f16\u8bd1\u5668\u65e0\u5173 \u590d\u6742\u5ea6\u5206\u6790\u5047\u8bbe\uff1a \u6307\u4ee4\u6309\u987a\u5e8f\u6267\u884c \u6240\u6709\u6307\u4ee4\uff08\u8fd0\u7b97\uff09\u90fd\u6d88\u8017\u540c\u4e00\u65f6\u95f4\u5355\u5143 \u6570\u636e\u89c4\u6a21\u662f\u7ed9\u5b9a\u7684\uff0c\u4e14\u6709\u65e0\u9650\u7a7a\u95f4 \u4e00\u822c\u9700\u8981\u5206\u6790 \\(T_{\\mathrm{avg}}(N)\\) \uff08\u5e73\u5747\u60c5\u51b5\uff09\u548c \\(T_{\\mathrm{worst}}(N)\\) \uff08\u6700\u5dee\u60c5\u51b5\uff09\uff0c \\(N\\) \u662f\u8f93\u5165\u7684\u6570\u636e\u89c4\u6a21\uff08\u4e5f\u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165\u89c4\u6a21\uff09","title":"\u7b97\u6cd5\u5f15\u8bba"},{"location":"cs/algorithm/design-analysis/#_3","text":"","title":"\u590d\u6742\u5ea6\u6e10\u8fdb\u8bb0\u53f7"},{"location":"cs/algorithm/design-analysis/#_4","text":"\u5927 \\(O\\) \u8868\u793a\u6cd5 \\(T(N) = O(f(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\leq c\\cdot f(N)\\) \u6e10\u8fdb\u4e0a\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u9ad8\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u6162\u6216\u76f8\u540c\uff0c<=\uff09 \u5927 \\(\\Omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\Omega(g(N))\\) \uff0c\u5982\u679c\u5b58\u5728\u5e38\u6570 \\(c\\) \u548c \\(n_0\\) \u4f7f\u5f97\u5f53 \\(N\\geq n_0\\) \u65f6 \\(T(N)\\geq c\\cdot g(N)\\) \u6e10\u8fdb\u4e0b\u754c\uff0c\u5373 \\(T(N)\\) \u7684\u9636\u4e0d\u4f1a\u4f4e\u4e8e \\(f(N)\\) \uff08\u589e\u957f\u6bd4 \\(f(N)\\) \u5feb\u6216\u76f8\u540c\uff0c>=\uff09 \u5927 \\(\\Theta\\) \u8868\u793a\u6cd5 \\(T(N) = \\Theta(h(N))\\) \uff0c\u5f53\u4e14\u4ec5\u5f53 \\(T(N) = O(h(N))\\) \u4e14 \\(T(N) = \\Omega(h(N))\\) \u6e10\u8fdb\u7d27\u786e\u754c\uff0c\u5373 \\(T(N)\\) \u9700\u8981\u4e0e \\(h(N)\\) \u540c\u9636\uff08\u589e\u957f\u901f\u5ea6\u76f8\u540c =\uff09 \u5c0f \\(o\\) \u8868\u793a\u6cd5 \\(T(N) = o(p(N))\\) \uff0c\u5f53 \\(T(N) = O(p(N))\\) \u4e14 \\(T(N)\\ne \\Theta(p(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0a\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(p(N)\\) \u6162\uff0c<\uff09 \u5c0f \\(\\omega\\) \u8868\u793a\u6cd5 \\(T(N) = \\omega(p(N))\\) \uff0c\u5f53 \\(T(N) = \\Omega(q(N))\\) \u4e14 \\(T(N)\\ne \\Theta(q(N))\\) \u65f6 \u975e\u6e10\u8fdb\u7d27\u786e\u4e0b\u754c\uff08 \\(T(N)\\) \u589e\u957f\u6bd4 \\(q(N)\\) \u5feb\uff0c>\uff09","title":"\u5b9a\u4e49"},{"location":"cs/algorithm/design-analysis/#_5","text":"\u5982\u679c \\(T_1(N) = O(f(N))\\) \u4e14 \\(T_2(N) = O(g(N))\\) \uff0c\u5219\uff1a \\(T_1(N) + T_2(N) = \\mathrm{max}(O(f(N)), O(g(N)))\\) \\(T_1(N)\\cdot T_2(N) = O(f(N)\\cdot g(N))\\) \u5982\u679c \\(T(N)\\) \u662f \\(N\\) \u7684 \\(k\\) \u6b21\u591a\u9879\u5f0f\uff0c\u5219 \\(T(N) = \\Theta(N^k)\\) \u5bf9\u4e8e\u4efb\u610f\u5e38\u6570 \\(k\\) \u5747\u6709 \\(\\log^kN = O(N)\\) \u5927 O \u8bb0\u53f7\u6bd4\u8f83\uff1a Big O Cheat Sheet \u5206\u6790\u89c4\u5219\uff1a for \u5faa\u73af\u7684\u8fd0\u884c\u65f6\u95f4\u662f\u5faa\u73af\u5185\u90e8\u8bed\u53e5\u7684\u6700\u957f\u65f6\u95f4\uff08\u542b for \u5224\u65ad\uff09\u4e58\u5faa\u73af\u6b21\u6570 \u5d4c\u5957 for \u5faa\u73af\u8981\u9010\u6b21\u76f8\u4e58 if else \u8bed\u53e5\u7684\u8fd0\u884c\u65f6\u95f4\u4e0d\u8d85\u8fc7\u5224\u65ad\u65f6\u95f4+\u8017\u65f6\u6700\u957f\u7684\u8bed\u53e5\u5757\u7684\u8fd0\u884c\u65f6\u95f4 \u8865\u5145\uff1a\u4e3b\u5b9a\u7406\u3002\u5047\u8bbe\u6709 \\(T(n) = aT(n/b)+f(n)\\) \uff08 \\(a\\geq 1, b>1\\) \uff09\uff0c\u5219\uff1a \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = O(n^{\\log_ba-\\epsilon})\\) \uff0c\u5219 \\(T(n) = \\Theta(n^{\\log_ba})\\) \u5982\u679c \\(f(n) = \\Theta(n^{\\log_ba})\\) \u5219 \\(T(n) = \\Theta(n^{\\log_ba}\\log n)\\) \u5982\u679c\u5b58\u5728\u5e38\u6570 \\(\\epsilon > 0\\) \u6709 \\(f(n) = \\Omega(n^{\\log_ba+\\epsilon})\\) \uff0c\u540c\u65f6\u5b58\u5728\u5e38\u6570 \\(c<1\\) \u4f7f\u5f97\u5bf9\u4e8e\u5145\u5206\u5927 \\(n\\) \u6709 \\(af(n/b)\\leq cf(n)\\) \u5219 \\(T(N) = \\Theta(f(n))\\)","title":"\u89c4\u5219"},{"location":"cs/algorithm/design-analysis/#_6","text":"","title":"\u9012\u5f52\u4e0e\u5206\u6cbb"},{"location":"cs/algorithm/design-analysis/#_7","text":"\u76f4\u63a5\u6210\u95f4\u63a5\u5730\u8c03\u7528\u81ea\u8eab\u7684\u7b97\u6cd5\u79f0\u4e3a\u9012\u5f52\u7b97\u6cd5\u3002\u7528\u51fd\u6570\u81ea\u8eab\u7ed9\u51fa\u5b9a\u4e49\u7684\u51fd\u6570\u79f0\u4e3a\u9012\u5f52\u51fd\u6570\u3002 \u4f8b\u5982\u9636\u4e58\u51fd\u6570\u3001\u6590\u6ce2\u90a3\u5951\u51fd\u6570\u7b49\u7b49 \\[ eg \\ \\ \\ F(n) = \\left\\{\\begin{matrix} 1 & n = 0, 1 \\\\ F(n-1)+F(n-2) & n >= 1 \\end{matrix}\\right. \\] int fibonacci ( int n ) { if ( n <= 1 ) return 1 ; return fibonacci ( n - 1 ) + fibonacci ( n - 2 ); } \u5bf9\u4e8e\u5c0f\u8303\u56f4\u53ef\u4ee5\u7528\u8bb0\u5fc6\u5316 \\(O(n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3 \u5bf9\u4e8e\u5927\u8303\u56f4\u53ef\u4ee5\u7528\u77e9\u9635\u5feb\u901f\u5e42 \\(O(\\log n)\\) \u7684\u590d\u6742\u5ea6\u6c42\u89e3\u3002","title":"\u9012\u5f52\u7684\u6982\u5ff5"},{"location":"cs/algorithm/design-analysis/#_8","text":"\u5206\u6cbb\u6cd5\u7684\u57fa\u672c\u601d\u60f3\u662f\u5c06\u4e00\u4e2a\u898f\u6a21\u4e3a \\(n\\) \u7684\u95ee\u9898\u5206\u89e3\u4e3a \\(k\\) \u4e2a\u89c4\u6a21\u8f83\u5c0f\u7684\u5b50\u95ee\u9898\uff0c\u8fd9\u4e9b\u5b50\u95ee\u9898\u4e92\u76f8\u72ec\u7acb\u4e14\u4e0e\u539f\u95ee\u9898\u76f8\u540c\u3002\u9012\u95e8\u5730\u89e3\u8fd9\u4e9b\u5b50\u95ee\u9898\uff0c\u7136\u540e\u5c07\u5404\u5b50\u95ee\u9898\u7684\u89e3\u5408\u4e95\u5f97\u5230\u539f\u5411\u9898\u7684\u89e3\u3002 eg\uff1a\u5feb\u901f\u5e42\u3001\u4e8c\u5206\u3001\u5f52\u5e76\u6392\u5e8f\u3001\u7ebf\u6bb5\u6811\u3001cdq\u5206\u6cbb\u3001FFT\u7b49","title":"\u5206\u6cbb\u6cd5\u601d\u60f3"},{"location":"cs/algorithm/design-analysis/#_9","text":"\u6709\u4e24\u4e2a\u8d85\u8fc7 long long \u7c7b\u578b\u7684\u5927\u6574\u6570 \\(X\\) \u548c \\(Y\\) \uff0c\u7528\u8f83\u4f4e\u7684\u590d\u6742\u5ea6\u6c42\u89e3 \\(X*Y\\) \u3002 \u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u81f3\u5c11\u6709 6 \u79cd\u65b9\u6cd5\uff0c\u53ef\u4ee5\u770b\u4e4b\u524d\u5199\u8fc7\u7684\u6587\u7ae0\uff1a \u5927\u6574\u6570\u76f8\u4e58 \u2013 \u6a21\u62df/\u5206\u6cbb/FFT/CRT/\u7f51\u7edc\u6d41/Furer","title":"\u5927\u6574\u6570\u7684\u4e58\u6cd5"},{"location":"cs/algorithm/design-analysis/#reference","text":"\u7b97\u6cd5\u8bbe\u8ba1\u4e0e\u5206\u6790(\u738b\u6653\u4e1c).pdf","title":"Reference"},{"location":"cs/db/mysql/","text":"MySQL \u00b6 \u4e8b\u52a1 \u00b6 \u4e8b\u52a1\u662f\u6ee1\u8db3ACID\u7279\u6027\u7684\u4e00\u7ec4\u64cd\u4f5c\u3002 \u539f\u5b50\u6027 \uff08Atomicity\uff09\uff1a\u4e8b\u52a1\u65f6\u4e0d\u53ef\u5206\u5272\u7684\u6700\u5c0f\u5355\u5143\uff0c\u4e8b\u52a1\u5185\u7684\u8bed\u53e5\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u6210\u529f\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u5931\u8d25\u3002 \u4e00\u81f4\u6027 \uff08Consistency\uff09\uff1a\u6570\u636e\u5e93\u5728\u4e8b\u52a1\u6267\u884c\u524d\u540e\u90fd\u4fdd\u6301\u4e00\u81f4\u6027\u72b6\u6001\u3002\u5728\u4e00\u81f4\u6027\u72b6\u6001\u4e0b\uff0c\u6240\u6709\u4e8b\u52a1\u5bf9\u4e00\u4e2a\u6570\u636e\u7684\u8bfb\u5199\u7ed3\u679c\u90fd\u662f\u76f8\u540c\u7684\u3002 \u9694\u79bb\u6027 \uff08Isolation\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u6240\u505a\u7684\u4fee\u6539\u5728\u6700\u7ec8\u63d0\u4ea4\u4ee5\u524d\uff0c\u5bf9\u5176\u4ed6\u4e8b\u52a1\u662f\u4e0d\u53ef\u89c1\u7684\u3002 \u6301\u4e45\u6027 \uff08Durability\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u63d0\u4ea4\uff0c\u5219\u5176\u6240\u505a\u7684\u4fee\u6539\u5c06\u4f1a\u6c38\u8fdc\u4fdd\u5b58\u5728\u6570\u636e\u5e93\u4e2d\u3002 MYSQL\u9ed8\u8ba4\u91c7\u7528\u81ea\u52a8\u63d0\u4ea4\u6a21\u5f0f\u3002 \u5e76\u53d1\u4e00\u81f4\u6027 \u00b6 \u4e22\u5931\u4fee\u6539 \uff1aT1\u548cT2\u4e24\u4e2a\u4e8b\u52a1\u90fd\u5bf9\u4e00\u4e2a\u6570\u636e\u8fdb\u884c\u4fee\u6539\uff0cT1\u5148\u4fee\u6539\uff0cT2\u540e\u4fee\u6539\uff0c\u5219T2\u70b9\u4fee\u6539\u4f1a\u8986\u76d6T1. \u8bfb\u810f\u6570\u636e \uff1aT1\u4fee\u6539\u4e00\u4e2a\u6570\u636e\uff0cT2\u968f\u540e\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u3002\u5982\u679cT1\u64a4\u9500\u4e86\u8fd9\u6b21\u4fee\u6539\uff0c\u5219T2\u8bfb\u5230\u7684\u662f\u810f\u6570\u636e\u3002 \u4e0d\u53ef\u91cd\u590d\u8bfb \uff1aT2\u8bfb\u53d6\u4e00\u4e2a\u6570\u636e\uff0cT1\u5bf9\u8be5\u6570\u636e\u505a\u4e86\u4fee\u6539\uff0c\u6b64\u65f6T2\u518d\u6b21\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u4f1a\u548c\u7b2c\u4e00\u6b21\u8bfb\u53d6\u7684\u7ed3\u679c\u4e0d\u540c\u3002 \u5e7b\u5f71\u8bfb \uff1aT1\u8bfb\u53d6\u67d0\u4e2a\u8303\u56f4\u7684\u6570\u636e\uff0cT2\u5728\u8fd9\u4e2a\u8303\u56f4\u5185\u63d2\u5165\u4e86\u65b0\u7684\u6570\u636e\uff0cT1\u518d\u6b21\u8bfb\u53d6\u548c\u7b2c\u4e00\u6b21\u7684\u7ed3\u679c\u4e0d\u540c\u3002 B\u6811\u548cB+\u6811 \u00b6 B\u6811\u7684\u7279\u70b9 \u4e00\u4e2a\u8282\u70b9\u4e0a\u5305\u62ec\u81f3\u591a \\(m-1\\) \u4e2a\u503c \u6839\u8282\u70b9\u81f3\u5c11\u6709\u4e24\u4e2a\u5b69\u5b50 \u975e\u53f6\u5b50\u7ed3\u70b9\u5982\u679c\u5305\u542b\u4e86 \\(k\\) \u4e2a\u503c\uff0c\u5219\u5176\u5305\u542b\u4e86 \\(k+1\\) \u4e2a\u5b69\u5b50\u8282\u70b9 \u6240\u6709\u53f6\u5b50\u7ed3\u70b9\u90fd\u4f4d\u4e8e\u540c\u4e00\u5c42 B+\u6811\u7684\u7279\u70b9 \u6240\u6709\u7684\u975e\u53f6\u5b50\u7ed3\u70b9\u4e0d\u518d\u4fdd\u5b58\u503c\uff0c\u800c\u662f\u53ea\u4fdd\u5b58\u4e86\u4e2d\u95f4\u503c \u6240\u6709\u503c\u4fdd\u5b58\u5728\u53f6\u5b50\u7ed3\u70b9\u4e0a \u6240\u6709\u7684\u53f6\u5b50\u7ed3\u70b9\u901a\u5e38\u94fe\u8868\u6309\u7167\u987a\u5e8f\u8fdb\u884c\u8fde\u63a5 \u4e3a\u4ec0\u4e48\u6570\u636e\u5e93\u4f1a\u91c7\u7528B+\u6811\u800c\u4e0d\u662fB\u6811\u6d3b\u7740AVL\u6811 AVL\u7684\u7ed3\u70b9\u8bbf\u95ee\u6b21\u6570\u66f4\u591a\uff0c\u800c\u5bf9\u4e8e\u6570\u636e\u5e93\u800c\u8a00\uff0c\u6bcf\u4e2a\u8282\u70b9\u901a\u5e38\u88ab\u5b58\u50a8\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u9700\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u6570\u91cf\u66f4\u591a\uff0c\u5bfc\u81f4\u6548\u7387\u4f4e \u5728\u6570\u636e\u5e93\u4e2d\u6709\u65f6\u9700\u8981\u8fdb\u884c\u8303\u56f4\u7684\u6240\u6709\uff0c\u6b64\u65f6B+\u6811\u7684\u94fe\u8868\u7ed3\u6784\u53ef\u4ee5\u5feb\u901f\u7684\u627e\u5230\u67d0\u4e2a\u7ed3\u70b9\u7684\u4e0b\u4e00\u4e2a\u7ed3\u70b9\u4f4d\u7f6e MySQL\u9501 \u00b6 \u7c7b\u578b \u5168\u5c40\u9501 \u8868\u7ea7\u9501 \u884c\u7ea7\u9501 \u8bfb\u5199\u9501 \u8bfb\u9501\uff1a\u53ef\u4ee5\u4e0e\u5176\u4ed6\u7684\u8bfb\u9501\u5171\u5b58\uff0c\u4f46\u662f\u4e0d\u53ef\u4ee5\u4e0e\u5199\u9501\u5171\u5b58 \u5199\u9501\uff1a\u4e0d\u53ef\u4ee5\u4e0e\u5176\u4ed6\u4efb\u4f55\u9501\u5171\u5b58 \u60b2\u89c2\u9501 \u666e\u901a\u7684\u9501\uff0c\u9501\u5b9a\u6b64\u884c/\u8868/\u6570\u636e\u5e93\u4ee5\u9632\u6b62\u5176\u4ed6\u64cd\u4f5c\u8fdb\u884c\u4fee\u6539\uff0c\u4f1a\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u88ab\u963b\u585e \u4e50\u89c2\u9501 \u901a\u8fc7\u6bd4\u8f83\u7248\u672c\u53f7\u7684\u533a\u522b\u7684\u65b9\u6cd5\uff0c\u6765\u786e\u5b9a\u6b64\u6570\u636e\u662f\u5426\u7ecf\u8fc7\u4fee\u6539\uff0c\u5982\u679c\u4fee\u6539\u5219\u9700\u8981\u8bfb\u53d6\u6700\u65b0\u7684\u503c \u6570\u636e\u5e93\u9694\u79bb\u7ea7\u522b \u00b6 \u9694\u79bb\u7ea7\u522b \u810f\u8bfb \u4e0d\u53ef\u91cd\u590d\u8bfb \u5e7b\u8bfb \u672a\u63d0\u4ea4\u8bfb \u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u5df2\u63d0\u4ea4\u8bfb \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u53ef\u91cd\u590d\u8bfb \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u4e32\u884c\u5316 \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u9694\u79bb\u7ea7\u522b\uff1a \u672a\u63d0\u4ea4\u8bfb\uff1a\u6700\u6734\u7d20\u7684\u6570\u636e\u5f62\u5f0f \u5df2\u63d0\u4ea4\u8bfb\uff1a\u5728\u4e8b\u52a1\u5b8c\u6210\u4e4b\u540e\u518d\u66f4\u65b0\u6570\u636e\u5e93\u7684\u503c \u53ef\u91cd\u590d\u8bfb\uff1a\u6bcf\u4e2a\u4e8b\u52a1\u5f00\u59cb\u524d\u9501\u5b9a\u6240\u66f4\u65b0\u7684\u884c \u53ef\u4e32\u884c\u5316\uff1a\u5355\u4e00\u7ebf\u7a0b\uff0c\u6240\u6709\u4e8b\u52a1\u5fc5\u987b\u6309\u7167\u987a\u5e8f\u8fdb\u884c3 \u5b58\u50a8\u5f15\u64ce InnoDB\u548cMyISAM \u00b6 InnoDB \u00b6 \u662fMySQL\u9ed8\u8ba4\u7684\u5b58\u50a8\u5f15\u64ce\u3002\u5b9e\u73b0\u4e86\u56db\u4e2a\u6807\u51c6\u7684\u9694\u79bb\u7ea7\u522b\u3002\u9ed8\u8ba4\u662f\u53ef\u91cd\u590d\u8bfb\uff0c\u901a\u8fc7MVCC\u548cNext-Key Locking\u9632\u6b62\u5e7b\u5f71\u8bfb\u3002\u652f\u6301\u771f\u6b63\u7684\u5728\u7ebf\u70ed\u5907\u4efd\uff0c\u5176\u4ed6\u5b58\u50a8\u5f15\u64ce\u4e0d\u652f\u6301\u5728\u7ebf\u70ed\u5907\u4efd\u3002 Record Locks \uff1a\u9501\u5b9a\u4e00\u4e2a\u8bb0\u5f55\u4e0a\u7684\u7d22\u5f15\uff0c\u800c\u4e0d\u662f\u8bb0\u5f55\u672c\u8eab\u3002 Gap Locks \uff1a\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\uff0c\u800c\u4e0d\u662f\u7d22\u5f15\u672c\u8eab\u3002 Next-Key Locks \uff1aInnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u4e00\u79cd\u9501\u5b9e\u73b0\uff0c\u662fRecord Locks\u548cGap Locks\u7684\u7ed3\u5408\u3002\u4e0d\u4ec5\u4ec5\u9501\u5b9a\u7d22\u5f15\uff0c\u4e5f\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\u3002 MyISAM \u00b6 \u8bbe\u8ba1\u7b80\u5355\uff0c\u6570\u636e\u4ee5\u7d27\u5bc6\u683c\u5f0f\u5b58\u50a8\u3002\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7279\u6027\uff0c\u5305\u62ec\u538b\u7f29\u8868\u3001\u7a7a\u95f4\u6570\u636e\u7d22\u5f15\u7b49\u3002\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c\u4e0d\u652f\u6301\u884c\u7ea7\u9501\uff0c\u53ea\u652f\u6301\u8868\u7ea7\u9501\uff0c\u53ef\u4ee5\u624b\u5de5\u6216\u8005\u81ea\u52a8\u6267\u884c\u68c0\u67e5\u548c\u4fee\u590d\u64cd\u4f5c\uff0c\u4f46\u53ef\u80fd\u5bfc\u81f4\u4e00\u4e9b\u6570\u636e\u4e22\u5931\uff0c\u800c\u4e14\u4fee\u590d\u64cd\u4f5c\u975e\u5e38\u6162\u3002 \u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08MVCC\uff09 \u00b6 \u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08Multi-Version Concurrency Control, MVCC\uff09\u662f MySQL \u7684 InnoDB \u5b58\u50a8\u5f15\u64ce\u5b9e\u73b0\u9694\u79bb\u7ea7\u522b\u7684\u4e00\u79cd\u5177\u4f53\u65b9\u5f0f\uff0c\u7528\u4e8e\u5b9e\u73b0\u63d0\u4ea4\u8bfb\u548c\u53ef\u91cd\u590d\u8bfb\u8fd9\u4e24\u79cd\u9694\u79bb\u7ea7\u522b\u3002\u800c\u672a\u63d0\u4ea4\u8bfb\u9694\u79bb\u7ea7\u522b\u603b\u662f\u8bfb\u53d6\u6700\u65b0\u7684\u6570\u636e\u884c\uff0c\u8981\u6c42\u5f88\u4f4e\uff0c\u65e0\u9700\u4f7f\u7528 MVCC\u3002\u53ef\u4e32\u884c\u5316\u9694\u79bb\u7ea7\u522b\u9700\u8981\u5bf9\u6240\u6709\u8bfb\u53d6\u7684\u884c\u90fd\u52a0\u9501\uff0c\u5355\u7eaf\u4f7f\u7528 MVCC \u65e0\u6cd5\u5b9e\u73b0\u3002 InnoDB\u7684MVCC\uff0c\u662f\u901a\u8fc7\u5728\u6bcf\u884c\u8bb0\u5f55\u540e\u9762\u4fdd\u5b58\u4e24\u4e2a\u9690\u85cf\u7684\u5217\u6765\u5b9e\u73b0\u7684\u3002\u8fd9\u4e24\u4e2a\u5217\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u8fc7\u671f\u65f6\u95f4\u3002\u5b58\u50a8\u7684\u4e0d\u662f\u5b9e\u9645\u7684\u65f6\u95f4\u503c\uff0c\u800c\u662f\u7cfb\u7edf\u7684\u7248\u672c\u53f7\u3002MVCC\u53ea\u8981\u53ef\u91cd\u590d\u8bfb\u548c\u63d0\u4ea4\u8bfb\u4e24\u4e2a\u9694\u79bb\u7ea7\u522b\u4e0b\u5de5\u4f5c\u3002 \u5728\u53ef\u91cd\u590d\u8bfb\u7684\u9694\u79bb\u7ea7\u522b\u4e0b\uff0cMVCC\u7684\u64cd\u4f5c\uff1a - SELECT 1. InnoDB\u53ea\u67e5\u627e\u7248\u672c\u65e9\u4e8e\u5f53\u524d\u4e8b\u52a1\u7248\u672c\u7684\u6570\u636e\u884c\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e8b\u52a1\u8bfb\u53d6\u7684\u884c\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u5f00\u542f\u524d\u5df2\u7ecf\u5b58\u5728\u7684\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u81ea\u8eab\u63d2\u5165\u6216\u8005\u4fee\u6539\u8fc7\u7684\u3002 2. \u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u8981\u4e48\u672a\u5b9a\u4e49\uff0c\u8981\u4e48\u5927\u4e8e\u5f53\u524d\u4e8b\u52a1\u7684\u7248\u672c\u53f7\uff0c\u8fd9\u53ef\u4ee5\u4fdd\u8bc1\u4e8b\u52a1\u8bfb\u53d6\u5230\u7684\u884c\uff0c\u5728\u4e8b\u52a1\u5f00\u59cb\u524d\u672a\u88ab\u5220\u9664\u3002 - INSERT 1. \u4e3a\u63d2\u5165\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u884c\u7248\u672c\u53f7\u3002 - DELETE 1. \u4e3a\u5220\u9664\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u5220\u9664\u7248\u672c\u53f7\u3002 - UPDATE 1. \u4fee\u6539\u540e\u7684\u6570\u636e\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u521b\u5efa\u7248\u672c\u53f7\uff0c\u540c\u65f6\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u539f\u6765\u7684\u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u3002 \u8303\u5f0f \u00b6 \u7b2c\u4e00\u8303\u5f0f\uff1a\u5c5e\u6027\u4e0d\u53ef\u5206 \u7b2c\u4e8c\u8303\u5f0f\uff1a\u6bcf\u4e2a\u975e\u4e3b\u5c5e\u6027\u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u7b2c\u4e09\u8303\u5f0f\uff1a\u975e\u4e3b\u5c5e\u6027\u4e0d\u4f20\u9012\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u8303\u5f0f\u5316\u7684\u597d\u5904\uff1a \u8303\u5f0f\u5316\u7684\u66f4\u65b0\u64cd\u4f5c\u901a\u5e38\u6bd4\u53cd\u8303\u5f0f\u5316\u8981\u5feb \u5f53\u6570\u636e\u8f83\u597d\u5730\u8303\u5f0f\u5316\u65f6\uff0c\u5c31\u53ea\u6709\u5f88\u5c11\u6216\u8005\u6ca1\u6709\u91cd\u590d\u6570\u636e\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u4fee\u6539\u66f4\u5c11\u7684\u6570\u636e\u3002 \u8303\u5f0f\u5316\u7684\u8868\u901a\u5e38\u66f4\u5c0f\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u653e\u5728\u5185\u5b58\u91cc\uff0c\u6240\u4ee5\u6267\u884c\u64cd\u4f5c\u4f1a\u66f4\u5feb\u3002 \u8303\u5f0f\u5316\u7684\u7f3a\u70b9\uff1a\u901a\u5e38\u9700\u8981\u5173\u8054\uff0c\u4ee3\u4ef7\u6602\u8d35\uff0c\u4e5f\u53ef\u80fd\u4f7f\u4e00\u4e9b\u7d22\u5f15\u7b56\u7565\u65e0\u6548\u3002 \u67e5\u8be2\u4f18\u5316 \u00b6 \u67e5\u8be2\u6027\u80fd\u4f4e\u4e0b\u7684\u6700\u57fa\u672c\u7684\u539f\u56e0\u662f\u8bbf\u95ee\u7684\u6570\u636e\u592a\u591a\u3002 \u662f\u5426\u5411\u6570\u636e\u5e93\u8bf7\u6c42\u4e86\u4e0d\u9700\u8981\u7684\u6570\u636e \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u5217\uff0c\u6700\u597d\u4e0d\u8981\u7528 select * \u8fdb\u884c\u67e5\u8be2 \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u884c\uff0c\u4f7f\u7528limit\u6765\u9650\u5236\u8fd4\u56de\u7684\u6570\u636e \u7f13\u5b58\u91cd\u590d\u67e5\u8be2\u7684\u6570\u636e \u662f\u5426\u5728\u626b\u63cf\u989d\u5916\u7684\u8bb0\u5f55 \u4f7f\u7528\u7d22\u5f15\u8986\u76d6\u626b\u63cf\uff0c\u628a\u6240\u6709\u9700\u8981\u7528\u5230\u7684\u5217\u90fd\u653e\u5728\u7d22\u5f15\u4e2d\uff0c \u8fd9\u6837\u5b58\u50a8\u5f15\u64ce\u65e0\u9700\u56de\u8868\u83b7\u53d6\u5bf9\u5e94\u884c\u5c31\u53ef\u4ee5\u8fd4\u56de\u7ed3\u679c \u6539\u53d8\u5e93\u8868\u7ed3\u6784 \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u5207\u5206\u5927\u67e5\u8be2 \u5206\u89e3\u5927\u8fde\u63a5\u67e5\u8be2 \u4e3b\u4ece\u590d\u5236 \u00b6 \u6982\u5ff5 \u00b6 MySQL\u4e3b\u4ece\u590d\u5236\u662f\u6307\u6570\u636e\u53ef\u4ee5\u4ece\u4e00\u4e2aMySQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e3b\u8282\u70b9\u590d\u5236\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u4ece\u8282\u70b9\u3002MySQL\u9ed8\u8ba4\u91c7\u7528\u5f02\u6b65\u590d\u5236\u65b9\u5f0f\uff0c\u8fd9\u6837\u4ece\u8282\u70b9\u4e0d\u7528\u4e00\u76f4\u8bbf\u95ee\u4e3b\u670d\u52a1\u5668\u6765\u66f4\u65b0\u81ea\u5df1\u7684\u6570\u636e\uff0c\u6570\u636e\u7684\u66f4\u65b0\u53ef\u4ee5\u5728\u8fdc\u7a0b\u8fde\u63a5\u4e0a\u8fdb\u884c\uff0c\u4ece\u8282\u70b9\u53ef\u4ee5\u590d\u5236\u4e3b\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u6570\u636e\u5e93\u6216\u8005\u7279\u5b9a\u7684\u6570\u636e\u5e93\uff0c\u6216\u8005\u7279\u5b9a\u7684\u8868\u3002 \u4f5c\u7528 \u00b6 \u6570\u636e\u5206\u5e03 \u8d1f\u8f7d\u5747\u8861 \u6570\u636e\u5907\u4efd\uff0c\u4fdd\u8bc1\u6570\u636e\u5b89\u5168 \u9ad8\u53ef\u7528\u6027\u548c\u5bb9\u9519\u884c \u5b9e\u73b0\u8bfb\u5199\u5206\u79bb\uff0c\u7f13\u89e3\u6570\u636e\u5e93\u538b\u529b \u7531\u4e8emysql\u5b9e\u73b0\u7684\u5f02\u6b65\u590d\u5236\uff0c\u6240\u4ee5\u4e3b\u5e93\u548c\u4ece\u5e93\u4e4b\u95f4\u5b58\u5728\u4e00\u5b9a\u7684\u5dee\u5f02\uff0c\u5728\u4ece\u5e93\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u9700\u8981\u8003\u8651\u8fd9\u4e9b\u6570\u636e\u7684\u5dee\u5f02\uff0c\u4e00\u822c\u53ea\u6709\u66f4\u65b0\u4e0d\u9891\u7e41\u548c\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4ece\u5e93\u67e5\u8be2\uff0c\u5b9e\u884c\u8981\u6c42\u9ad8\u7684\u4ecd\u7136\u8981\u4ece\u4e3b\u5e93\u67e5\u8be2\u3002 \u539f\u7406 \u00b6 MySQL\u4e3b\u4ece\u590d\u5236\u6d89\u53ca\u5230\u4e09\u4e2a\u7ebf\u7a0b\uff0c\u4e00\u4e2a\u8fd0\u884c\u5728 \u4e3b\u8282\u70b9\uff08log dump thread\uff09 \uff0c\u5176\u4f59\u4e24\u4e2a\uff08 I/O thread\uff0c SQL thread \uff09\u8fd0\u884c\u5728\u4ece\u8282\u70b9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a binlog \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u5c06\u4e3b\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u66f4\u6539\u5199\u5165\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff08Binary log\uff09\u4e2d\u3002 I/O \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u4ece\u4e3b\u670d\u52a1\u5668\u4e0a\u8bfb\u53d6\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u5e76\u5199\u5165\u4ece\u670d\u52a1\u5668\u7684\u4e2d\u7ee7\u65e5\u5fd7\uff08Relay log\uff09\u3002 SQL \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u8bfb\u53d6\u4e2d\u7ee7\u65e5\u5fd7\uff0c\u89e3\u6790\u51fa\u4e3b\u670d\u52a1\u5668\u5df2\u7ecf\u6267\u884c\u7684\u6570\u636e\u66f4\u6539\u5e76\u5728\u4ece\u670d\u52a1\u5668\u4e2d\u91cd\u653e\uff08Replay\uff09\u3002 \u8fde\u63a5\u6c60 \u00b6 \u4e3a\u4ec0\u4e48\u4f7f\u7528\u8fde\u63a5\u6c60 \u4e0eJava\u7684\u7ebf\u7a0b\u6c60\u76f8\u540c\uff0c\u4e3a\u4e86\u8282\u7ea6\u7cfb\u7edf\u8d44\u6e90 \u5e38\u7528\u7684\u8fde\u63a5\u6c60 DBCP\uff1a\u4f7f\u7528\u91cf\u6700\u5927\u7684\u8fde\u63a5\u6c60 C3P0 \u5206\u8868 \u00b6 \u6c34\u5e73\u5206\u8868 \u5c06\u4e00\u4e2a\u8868\u7684\u8bb0\u5f55\u5206\u5272\u5230\u6570\u4e2a\u8868\u4e2d\uff0c\u53ef\u4ee5\u51cf\u5c11\u7d22\u5f15\u7684\u5927\u5c0f\uff0c\u52a0\u5feb\u7d22\u5f15 \u5782\u76f4\u5206\u8868 \u5c06\u90e8\u5206\u5b57\u6bb5\u5212\u5206\u81f3\u5176\u4ed6\u7684\u8868\uff0c\u90e8\u5206\u5b57\u6bb5\u6570\u636e\u91cf\u5927\uff0c\u8fdb\u884c\u7d22\u5f15\u65f6\u4f1a\u5e26\u6765\u5927\u91cf\u7684IO\u8d1f\u62c5\uff0c\u8fdb\u884c\u5206\u8868\u6709\u5229\u4e8e\u67e5\u8be2\u6548\u7387 SQL \u00b6 \u4e00\u6761SQL\u8bed\u53e5\u7684\u6267\u884c\u8fc7\u7a0b\uff1a 1. \u8fde\u63a5\u5668\u67e5\u770b\u5f53\u524d\u7528\u6237\u6743\u9650\uff0c\u82e5\u62e5\u6709\u6743\u9650\uff0c\u5efa\u7acb\u8fde\u63a5\u3002\u5982\u679c\u5ba2\u6237\u7aef\u592a\u957f\u65f6\u95f4\u6ca1\u6709\u52a8\u9759\uff0c\u8fde\u63a5\u5668\u4f1a\u81ea\u52a8\u65ad\u5f00\u8fde\u63a5 2. \u5206\u6790\u5668\u5206\u6790SQL\u8bed\u53e5\uff0c\u5305\u62ec\u8bed\u6cd5\u5206\u6790\uff08\u8bed\u6cd5\u662f\u5426\u6b63\u786e\uff09\uff0c\u8bcd\u6cd5\u5206\u6790\uff08\u8bc6\u522bSQL\u8bed\u53e5\uff09\u3002 3. \u4f18\u5316\u5668\u4f18\u5316\u67e5\u8be2\uff0c\u51b3\u5b9a\u4f7f\u7528\u7684\u7d22\u5f15\u7b49\u3002 4. \u6267\u884c\u5668\u6765\u65f6\u6267\u884c\u8bed\u53e5\u3002 \u8bf4\u4e00\u4e0b\u7d22\u5f15\uff1f \u00b6 \u4ec0\u4e48\u662f\u7d22\u5f15 \u00b6 \u7d22\u5f15\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6587\u4ef6\uff08InnoDB\u6570\u636e\u8868\u4e0a\u7684\u7d22\u5f15\u662f\u8868\u7a7a\u95f4\u7684\u4e00\u4e2a\u7ec4\u6210\u90e8\u5206\uff09\uff0c\u4ed6\u4eec\u5305\u542b\u7740\u5bf9\u6570\u636e\u8868\u91cc\u6240\u6709\u8bb0\u5f55\u7684\u5f15\u7528\u6307\u9488\u3002 \u7d22\u5f15\u662f\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u3002\u6570\u636e\u5e93\u7d22\u5f15\uff0c\u662f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u6392\u5e8f\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4e3a\u4e86\u534f\u52a9\u5feb\u901f\u67e5\u8be2\u3001\u66f4\u65b0\u6570\u636e\u8868\u4e2d\u6570\u636e\u3002\u7d22\u5f15\u7684\u5b9e\u73b0\u901a\u5e38\u4f7f\u7528B\u6811\u4ee5\u53ca\u53d8\u79cdB+\u6811\u3002 \u7d22\u5f15\u7684\u7f3a\u70b9 \u00b6 \u65f6\u95f4\u65b9\u9762\uff1a\u521b\u5efa\u7d22\u5f15\u548c\u7ef4\u62a4\u7d22\u5f15\u8981\u8017\u8d39\u65f6\u95f4\uff0c\u5177\u4f53\u7684\uff0c\u5f53\u5bf9\u8868\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u589e\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u7684\u65f6\u5019\uff0c\u7d22\u5f15\u4e5f\u8981\u52a8\u6001\u7684\u7ef4\u62a4\uff0c\u4f1a\u8f83\u4f4e\u589e\u6539\u5220\u7684\u6267\u884c\u6548\u7387\u3002 \u7a7a\u95f4\u65b9\u9762\uff1a\u7d22\u5f15\u9700\u8981\u5360\u7528\u7269\u7406\u7a7a\u95f4\u3002 \u7d22\u5f15\u7684\u4e3b\u8981\u7c7b\u578b \u00b6 \u7269\u7406\u5b58\u50a8\u89d2\u5ea6\uff1a \u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4f5c\u4e3aB+\u6811\u7d22\u5f15\u7684\u952e\u503c\u800c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u975e\u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4e4b\u5916\u7684\u5217\u503c\u4f5c\u4e3a\u952e\u503c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u6570\u636e\u7ed3\u6784\u89d2\u5ea6\uff1a B+\u6811\u7d22\u5f15 hash\u7d22\u5f15 FULLTEXT\u7d22\u5f15 R-Tree\u7d22\u5f15 \u903b\u8f91\u89d2\u5ea6\uff1a \u4e3b\u952e\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u4e0d\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u53ea\u80fd\u6709\u4e00\u4e2a\u4e3b\u952e \u666e\u901a/\u5355\u5217\u7d22\u5f15\uff1a\u57fa\u672c\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u6ca1\u6709\u552f\u4e00\u6027\u7684\u6027\u8d28\uff0c\u5141\u8bb8\u4e3a NULL \u591a\u5217/\u8054\u5408/\u590d\u5408\u7d22\u5f15\uff1a\u4ee5\u4e00\u5b9a\u987a\u5e8f\u5f15\u7528\u591a\u5217 \u552f\u4e00\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u5141\u8bb8\u591a\u4e2a\u5217\u521b\u5efa\u552f\u4e00\u7d22\u5f15 \u5168\u6587\u7d22\u5f15\uff1a\u76ee\u524d\u641c\u7d22\u5f15\u64ce\u4f7f\u7528\u7684\u4e00\u79cd\u5173\u952e\u6280\u672f \u7a7a\u95f4\u7d22\u5f15\uff1a\u5bf9\u7a7a\u95f4\u6570\u636e\u7c7b\u578b\u7684\u5b57\u6bb5\u5efa\u7acb\u7684\u7d22\u5f15 \u6700\u5de6\u524d\u7f00\u5339\u914d\u539f\u5219 \u00b6 \u4e3b\u8981\u9488\u5bf9\u8054\u5408\u7d22\u5f15\uff0c\u5982\u679c\u67e5\u8be2\u7684\u65f6\u5019\u67e5\u8be2\u6761\u4ef6\u7cbe\u786e\u5339\u914d\u7d22\u5f15\u7684\u5de6\u8fb9\u8fde\u7eed\u4e00\u5217\u6216\u591a\u5217\uff0c\u5219\u6b64\u5217\u5c31\u53ef\u4ee5\u88ab\u7528\u5230\u3002 redis\u5e94\u7528\u573a\u666f\uff1f \u00b6 \u7f13\u5b58\u3001\u8ba1\u6570\u5668\u3001\u961f\u5217\u3001\u4f4d\u64cd\u4f5c\u3001\u6700\u65b0\u5217\u8868\u3002 \u8bf4\u4e00\u4e0b\u56de\u8868\u64cd\u4f5c\uff1f \u00b6 \u975e\u805a\u7c07\u7d22\u5f15\u548c\u805a\u7c07\u7d22\u5f15\u7684\u533a\u522b\u5728\u4e8e\u975e\u805a\u7c07\u7d22\u5f15\u7684\u53f6\u5b50\u8282\u70b9\u4e0d\u5b58\u50a8\u8868\u4e2d\u7684\u6570\u636e\uff0c\u800c\u662f\u5b58\u50a8\u8be5\u5217\u5bf9\u5e94\u7684\u4e3b\u952e\uff0c\u60f3\u8981\u67e5\u627e\u6570\u636e\u6211\u4eec\u8fd8\u9700\u8981\u6839\u636e\u4e3b\u952e\u518d\u53bb\u805a\u7c07\u7d22\u5f15\u4e2d\u8fdb\u884c\u67e5\u627e\uff0c\u8fd9\u4e2a\u518d\u6839\u636e\u805a\u7c07\u7d22\u5f15\u67e5\u627e\u6570\u636e\u7684\u8fc7\u7a0b\uff0c\u88ab\u79f0\u4e3a\u56de\u8868\u3002 \u5982\u4f55\u907f\u514d\u56de\u8868\u67e5\u8be2?\u4ec0\u4e48\u662f\u7d22\u5f15\u8986\u76d6? \u00b6 \u5982\u4f55\u907f\u514d\uff1a\u5c06\u88ab\u67e5\u8be2\u7684\u5b57\u6bb5\uff0c\u5efa\u7acb\u5230\u8054\u5408\u7d22\u5f15\u4e2d\u3002\u5c3d\u91cf\u4f7f\u7528\u5230\u7d22\u5f15\u8986\u76d6\uff0c\u4e0d\u5e94\u8be5\u4f7f\u7528 * \u6765\u5168\u8868\u67e5\u8be2\u3002 \u7d22\u5f15\u8986\u76d6\u662f\u6307\u4ece\u7d22\u5f15\u4e2d\u5c31\u53ef\u4ee5\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\uff0c\u4ece\u800c\u4e0d\u9700\u8981\u67e5\u8be2\u805a\u7c07\u7d22\u5f15\u4e2d\u7684\u884c\u6570\u636e\u4fe1\u606f\u3002 \u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u8986\u76d6\u7d22\u5f15\u5fc5\u987b\u8981\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u800c\u54c8\u5e0c\u7d22\u5f15\u3001\u7a7a\u95f4\u7d22\u5f15\u548c\u5168\u6587\u7d22\u5f15\u4e0d\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u6240\u4ee5mysql\u53ea\u80fd\u7528B+tree\u7d22\u5f15\u505a\u8986\u76d6\u7d22\u5f15\u3002 \u8bf4\u4e00\u4e0b\u8868\u8fde\u63a5\u7684\u64cd\u4f5c\uff1f \u00b6 \u5728MySQL\u4e2d\uff0c\u5e38\u89c1\u7684\u8868\u8fde\u63a5\u65b9\u5f0f\u67094\u7c7b\uff0c\u51717\u79cd\u65b9\u5f0f\uff1a - INNER JOIN \uff1ainner join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\uff1b - LEFT JOIN \uff1aleft join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u5de6\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528where\u8fc7\u6ee4\u6761\u4ef6 - RIGHT JOIN \uff1aright join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u53f3\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528where\u8fc7\u6ee4\u6761\u4ef6 - FULL JOIN \uff1afull join\u662f\u5de6\u8fde\u63a5\u548c\u53f3\u8fde\u63a5\u7684\u5e76\u96c6\uff0cMySQL\u5e76\u672a\u63d0\u4f9bfull join\u7684\u8bed\u6cd5\uff0c\u5982\u679c\u8981\u5b9e\u73b0\uff0c\u9700\u8981left join\u4e8eright join\u8fdb\u884c\u6c42\u5e76\u96c6\uff0c\u8fd8\u6709\u7528where\u8fc7\u6ee4 \u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u4f1a\u5931\u6548\uff1f \u00b6 \u6761\u4ef6\u4e2d\u6709 or like \u67e5\u8be2\uff08\u4ee5 % \u5f00\u5934\uff09 \u5982\u679c\u5217\u7c7b\u578b\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e00\u5b9a\u8981\u5728\u6761\u4ef6\u4e2d\u5c06\u6570\u636e\u4f7f\u7528\u5f15\u53f7\u5f15\u7528\u8d77\u6765\uff0c\u5426\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15 \u5bf9\u5217\u8fdb\u884c\u51fd\u6570\u8fd0\u7b97 \u8d1f\u5411\u67e5\u8be2\u6761\u4ef6\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\uff0c\u6bd4\u5982 NOT IN \uff0c NOT LIKE \uff0c != \u7b49 \u5bf9\u4e8e\u8054\u5408\u7d22\u5f15\uff0c\u4e0d\u662f\u4f7f\u7528\u7b2c\u4e00\u90e8\u5206\uff08\u7b2c\u4e00\u4e2a\uff09\uff0c\u5219\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\uff08\u6700\u5de6\u5339\u914d\uff09 \u5982\u679cmysql\u8bc4\u4f30\u4f7f\u7528\u5168\u8868\u626b\u63cf\u8981\u6bd4\u4f7f\u7528\u7d22\u5f15\u5757\uff0c\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15 \u5224\u65adsql\u662f\u5426\u4f7f\u7528\u7d22\u5f15 \u00b6 \u4f7f\u7528\u89e3\u91ca\u51fd\u6570 explain \uff0c\u53ea\u9700\u6dfb\u52a0\u5728sql\u8bed\u53e5\u4e4b\u524d\u5373\u53ef\uff1a \u6211\u4eec\u53ea\u9700\u8981\u6ce8\u610f\u4e00\u4e2a\u6700\u91cd\u8981\u7684type \u7684\u4fe1\u606f\u5f88\u660e\u663e\u7684\u63d0\u73b0\u662f\u5426\u7528\u5230\u7d22\u5f15\uff1a type\u7ed3\u679c\u503c\u4ece\u597d\u5230\u574f\u4f9d\u6b21\u662f\uff1a system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL \u4e00\u822c\u6765\u8bf4\uff0c\u5f97\u4fdd\u8bc1\u67e5\u8be2\u81f3\u5c11\u8fbe\u5230range\u7ea7\u522b\uff0c\u6700\u597d\u80fd\u8fbe\u5230ref\uff0c\u5426\u5219\u5c31\u53ef\u80fd\u4f1a\u51fa\u73b0\u6027\u80fd\u95ee\u9898\u3002 possible_keys \uff1asql\u6240\u7528\u5230\u7684\u7d22\u5f15 key \uff1a\u663e\u793aMySQL\u5b9e\u9645\u51b3\u5b9a\u4f7f\u7528\u7684\u952e\uff08\u7d22\u5f15\uff09\u3002\u5982\u679c\u6ca1\u6709\u9009\u62e9\u7d22\u5f15\uff0c\u952e\u662fNULL rows : \u663e\u793aMySQL\u8ba4\u4e3a\u5b83\u6267\u884c\u67e5\u8be2\u65f6\u5fc5\u987b\u68c0\u67e5\u7684\u884c\u6570\u3002 \u8bf4\u4e00\u4e0b\u9501\uff1f\u8bf4\u4e00\u4e0b\u533a\u522b\uff1f \u00b6 Redis\u7f13\u5b58\u66f4\u65b0\u7b56\u7565 \u00b6 \u9ad8\u5e76\u53d1 \u00b6 \u9ad8\u5e76\u53d1\uff08High Concurrency\uff09\u662f\u6307\u7cfb\u7edf\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u4e00\u79cd\u201c\u77ed\u65f6\u95f4\u5185\u9047\u5230\u5927\u91cf\u64cd\u4f5c\u8bf7\u6c42\u201d\u7684\u60c5\u51b5\uff0c\u4e3b\u8981\u53d1\u751f\u5728web\u7cfb\u7edf\u96c6\u4e2d\u5927\u91cf\u8bbf\u95ee\u6536\u5230\u5927\u91cf\u8bf7\u6c42\uff0c\u4f8b\u5982\u6dd8\u5b9d\u53cc\u5341\u4e00\u3001\u4eac\u4e1c618\u7c7b\u7684\u6d3b\u52a8\u3002\u8be5\u60c5\u51b5\u7684\u53d1\u751f\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u6267\u884c\u5927\u91cf\u64cd\u4f5c\uff08\u5bf9\u8d44\u6e90\u7684\u8bf7\u6c42\u3001\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u7b49\uff09\u3002 \u9ad8\u5e76\u53d1\u76f8\u5173\u5e38\u7528\u7684\u4e00\u4e9b\u6307\u6807\u6709\uff1a\u54cd\u5e94\u65f6\u95f4\u3001\u541e\u5410\u91cf\u3001\u6bcf\u79d2\u67e5\u8be2\u7387QPS\u3001\u5e76\u53d1\u7528\u6237\u6570\u3002 \u54cd\u5e94\u65f6\u95f4 \uff1a\u7cfb\u7edf\u5bf9\u8bf7\u6c42\u505a\u51fa\u54cd\u5e94\u7684\u65f6\u95f4\u3002\u4f8b\u5982\u7cfb\u7edf\u5904\u7406\u4e00\u4e2ahttp\u8bf7\u6c42\u9700\u8981600ms\uff0c\u8fd9\u4e2a600ms\u5c31\u662f\u7cfb\u7edf\u7684\u54cd\u5e94\u65f6\u95f4\u3002 \u541e\u5410\u91cf \uff1a\u5355\u4f4d\u65f6\u95f4\u5185\u5904\u7406\u7684\u8bf7\u6c42\u6570\u91cf\u3002 QPS \uff1a\u6bcf\u79d2\u54cd\u5e94\u8bf7\u6c42\u6570\u3002 \u5e76\u53d1\u7528\u6237\u6570 \uff1a\u540c\u65f6\u627f\u8f7d\u6b63\u5e38\u4f7f\u7528\u7cfb\u7edf\u529f\u80fd\u7684\u7528\u6237\u6570\u91cf\u3002\u4f8b\u5982\u4e00\u4e2a\u5373\u65f6\u901a\u8baf\u7cfb\u7edf\uff0c\u540c\u65f6\u5728\u7ebf\u7684\u7528\u6237\u91cf\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4ee3\u8868\u4e86\u7cfb\u7edf\u7684\u5e76\u53d1\u7528\u6237\u6570\u3002 \u7b80\u5355\u6765\u8bf4\uff0c\u9ad8\u5e76\u53d1\u7684\u57fa\u672c\u8868\u73b0\u5c31\u662f\u7cfb\u7edf\u5728\u5355\u4f4d\u65f6\u95f4\u5185\u80fd\u591f\u540c\u65f6\u5904\u7406\u7684\u8bf7\u6c42\u6570\u3002\u9ad8\u5e76\u53d1\u6ca1\u6709\u5177\u4f53\u7684\u8303\u56f4\u89c4\u5b9a\u591a\u5c11\u5e76\u53d1\u7b97\u662f\u9ad8\u5e76\u53d1\uff0c\u6bd4\u5982\u4f60\u5f00\u53d1\u7684\u7cfb\u7edf\u6700\u5927\u5e76\u53d1\u662f1000\uff0c\u90a3\u4e48\u6765\u4e861001\u7684\u5e76\u53d1\u91cf\u5bf9\u4f60\u6765\u8bf4\u5c31\u662f\u9ad8\u5e76\u53d1\uff0c\u4f46\u662f\u8fd9\u4e2a\u5e76\u53d1\u91cf\u653e\u5728\u6dd8\u5b9d\u4e0a\uff0c\u7b80\u76f4\u4ec0\u4e48\u90fd\u7b97\u4e0d\u4e0a\u3002 \u5982\u679c\u9ad8\u5e76\u53d1\u5904\u7406\u4e0d\u597d\uff0c\u4e0d\u4ec5\u4f1a\u964d\u4f4e\u7528\u6237\u7684\u4f53\u9a8c\u5ea6(\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u8fc7\u957f\u7b49)\uff0c\u540c\u65f6\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u5b95\u673a\u3001\u505c\u6b62\u5de5\u4f5c\u7b49\u3002 \u4f7f\u7528\u7f13\u5b58 \u00b6 \u5927\u5bb6\u90fd\u77e5\u9053MySQL\u52a0\u4e0aRedis\u662f\u4e00\u5bf9\u513f\u7ecf\u5178\u7684\u7ec4\u5408\u3002\u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u4e3aMySQL\u6321\u4f4f\u5927\u90e8\u5206\u67e5\u8be2\u8bf7\u6c42\uff0c\u53ef\u4ee5\u5f88\u5927\u7a0b\u5ea6\u4e0a\u7f13\u89e3MySQL\u5e76\u53d1\u8bf7\u6c42\u7684\u538b\u529b\u3002Redis\u662f\u4e00\u4e2a\u4f7f\u7528\u5185\u5b58\u4fdd\u5b58\u6570\u636e\u7684\u9ad8\u6027\u80fdK-V\u6570\u636e\u5e93\uff0c\u5b83\u7684\u9ad8\u6027\u80fd\u4e3b\u8981\u6765\u81ea\u4e8e\uff1a \u7b80\u5355\u7684\u6570\u636e\u7ed3\u6784 \u548c \u4f7f\u7528\u5185\u5b58\u5b58\u50a8\u6570\u636e \u3002\u4f46\u662f\u6211\u4eec\u9700\u8981\u77e5\u9053\u7684\u662f\u5185\u5b58\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u6613\u5931\u6027\u5b58\u50a8\uff0c\u6240\u4ee5\u4f7f\u7528Redis\u4e0d\u80fd\u4fdd\u8bc1\u6570\u636e\u53ef\u9760\u5b58\u50a8\u3002\u4ece\u8bbe\u8ba1\u4e0a\u6765\u8bf4\uff0cRedis\u727a\u7272\u4e86\u6570\u636e\u53ef\u9760\u6027\uff0c\u6362\u53d6\u4e86\u9ad8\u6027\u80fd\u3002\u4f46\u4e5f\u6b63\u662f\u8fd9\u4e9b\u7279\u6027\uff0c\u4f7f\u5f97Redis\u7279\u522b\u9002\u5408\u7528\u6765\u505aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\u3002 \u5373\u4f7f\u53ea\u662f\u628aRedis\u4f5c\u4e3a\u7f13\u5b58\u6765\u4f7f\u7528\uff0c\u6211\u4eec\u5728\u8bbe\u8ba1Redis\u7f13\u5b58\u7684\u65f6\u5019\uff0c\u4e5f\u5fc5\u987b\u8981\u8003\u8651Redis\u7684\u8fd9\u79cd \u6570\u636e\u4e0d\u53ef\u9760\u6027 \uff0c\u6216\u8005\u6362\u53e5\u8bdd\u8bf4\uff0c\u6211\u4eec\u7684\u7cfb\u7edf\u5728\u4f7f\u7528Redis\u7684\u65f6\u5019\uff0c\u8981\u80fd\u517c\u5bb9Redis\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u505a\u5230\u5373\u4f7fRedis\u53d1\u751f\u4e86\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u5f71\u54cd\u7cfb\u7edf\u7684\u6570\u636e\u51c6\u786e\u6027\u3002 \u5173\u4e8e\u7f13\u5b58\u66f4\u65b0\u7b56\u7565\uff0c\u4f7f\u7528\u7684\u591a\u7684\u4e5f\u5c31\u662f Read/Write Through\u6a21\u5f0f \u548c Cache Aside\u6a21\u5f0f \uff0c Read/Write Through\u6a21\u5f0f \u5728\u67e5\u8be2\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u7f13\u5b58\u4e2d\u67e5\u8be2\uff0c\u5982\u679c\u547d\u4e2d\u7f13\u5b58\u90a3\u5c31\u76f4\u63a5\u8fd4\u56de\u6570\u636e\uff1b\u5982\u679c\u6ca1\u6709\u547d\u4e2d\uff0c\u90a3\u5c31\u53bb\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\uff0c\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\u4e4b\u540e\u628a\u6570\u636e\u5199\u5165\u7f13\u5b58\uff0c\u7136\u540e\u8fd4\u56de\u3002\u5728\u66f4\u65b0\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u66f4\u65b0\u6570\u636e\u5e93\uff0c\u5982\u679c\u66f4\u65b0\u6210\u529f\uff0c\u518d\u53bb\u66f4\u65b0\u7f13\u5b58\u4e2d\u7684\u6570\u636e\u3002 \u603b\u7ed3 \u00b6 \u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u975e\u5e38\u6709\u6548\u5730\u63d0\u5347\u7cfb\u7edf\u5904\u7406\u9ad8\u5e76\u53d1\u7684\u80fd\u529b\uff0c\u964d\u4f4e\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u3002\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Cache Aside\u6a21\u5f0f\u6765\u66f4\u65b0\u7f13\u5b58\u90fd\u662f\u6700\u4f73\u7684\u9009\u62e9\uff0c\u76f8\u6bd4Read/Write Through\u6a21\u5f0f\u66f4\u7b80\u5355\uff0c\u8fd8\u80fd\u5927\u5e45\u964d\u4f4e\u810f\u6570\u636e\u7684\u53ef\u80fd\u6027\u3002\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u5927\u91cf\u7f13\u5b58\u7a7f\u900f\u5f15\u8d77\u96ea\u5d29\u7684\u95ee\u9898\uff0c\u4f60\u9700\u8981\u9488\u5bf9\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u6765\u9009\u62e9\u5408\u9002\u89e3\u51b3\u65b9\u6848\u3002 reids\u9047\u5230\u5927KV \u00b6 \u8df3\u8868 \u00b6 \u8df3\u8868\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u5c31\u662f\u7ed9\u94fe\u8868\u52a0\u7d22\u5f15\uff0c\u5f53\u7ed3\u70b9\u6570\u91cf\u591a\u7684\u65f6\u5019\uff0c\u8fd9\u79cd\u6dfb\u52a0\u7d22\u5f15\u7684\u65b9\u5f0f\uff0c\u4f1a\u4f7f\u67e5\u8be2\u6548\u7387\u63d0\u9ad8\u7684\u975e\u5e38\u660e\u663e\u3002 \u8df3\u8868\u8fd9\u4e2a\u52a8\u6001\u6570\u636e\u7ed3\u6784\uff0c\u4e0d\u4ec5\u652f\u6301\u67e5\u627e\u64cd\u4f5c\uff0c\u8fd8\u652f\u6301\u52a8\u6001\u7684\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\uff0c\u800c\u4e14\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \\(O(logn)\\) \u3002 \u5bf9\u4e8e\u5355\u7eaf\u7684\u5355\u94fe\u8868\uff0c\u9700\u8981\u904d\u5386\u6bcf\u4e2a\u7ed3\u70b9\u6765\u627e\u5230\u63d2\u5165\u7684\u4f4d\u7f6e\u3002\u4f46\u662f\u5bf9\u4e8e\u8df3\u8868\u6765\u8bf4\uff0c\u56e0\u4e3a\u5176\u67e5\u627e\u67d0\u4e2a\u7ed3\u70b9\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f \\(O(logn)\\) \uff0c\u6240\u4ee5\u8fd9\u91cc\u67e5\u627e\u67d0\u4e2a\u6570\u636e\u5e94\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \u25cb(\u33d2n)\u3002 Redis\u9009\u4e2d\u8df3\u8868\u800c\u4e0d\u4f7f\u7528B+\u6811 \u00b6 redis \u4f7f\u7528\u8df3\u8868\u4e0d\u7528 B + \u6570\u7684\u539f\u56e0\u662f\uff1aredis \u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u800c B + \u6811\u7eaf\u7cb9\u662f\u4e3a\u4e86 mysql \u8fd9\u79cd IO \u6570\u636e\u5e93\u51c6\u5907\u7684\u3002B + \u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u7684\u6570\u91cf\u90fd\u662f\u4e00\u4e2a mysql \u5206\u533a\u9875\u7684\u5927\u5c0f Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u662f\u901a\u8fc7\u8df3\u8868\u6765\u5b9e\u73b0\u7684\uff0c\u4e25\u683c\u70b9\u8bb2\uff0c\u8fd8\u7528\u5230\u4e86\u6563\u5217\u8868\uff08\u5173\u4e8e\u6563\u5217\u8868\uff09\uff0c\u5982\u679c\u67e5\u770b Redis \u5f00\u53d1\u624b\u518c\uff0c\u4f1a\u53d1\u73b0 Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u652f\u6301\u7684\u6838\u5fc3\u64cd\u4f5c\u4e3b\u8981\u6709\u4e0b\u9762\u8fd9\u51e0\u4e2a\uff1a \u63d2\u5165\u4e00\u4e2a\u6570\u636e \u5220\u9664\u4e00\u4e2a\u6570\u636e \u67e5\u627e\u4e00\u4e2a\u6570\u636e \u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\uff08\u6bd4\u5982\u67e5\u627e\u5728 [100,356] \u4e4b\u95f4\u7684\u6570\u636e\uff09 \u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217 \u5176\u4e2d\uff0c\u63d2\u5165\u3001\u67e5\u627e\u3001\u5220\u9664\u4ee5\u53ca\u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217\u8fd9\u51e0\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u4e5f\u80fd\u5b8c\u6210\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u8df3\u8868\u662f\u4e00\u6837\u7684\uff0c\u4f46\u662f\uff0c\u6309\u7167\u533a\u95f4\u6765\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u7684\u6548\u7387\u6ca1\u6709\u8df3\u8868\u9ad8\u3002 \u5bf9\u4e8e\u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u8df3\u8868\u53ef\u4ee5\u505a\u5230 \\(O(logn)\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u5b9a\u4f4d\u533a\u95f4\u7684\u8d77\u70b9\uff0c\u7136\u540e\u5728\u539f\u59cb\u94fe\u8868\u4e2d\u987a\u5e8f\u5f80\u540e\u904d\u5386\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6837\u505a\u975e\u5e38\u9ad8\u6548\u3002 \u5f53\u7136\uff0c\u8fd8\u6709\u5176\u4ed6\u539f\u56e0\uff0c\u6bd4\u5982\uff0c\u8df3\u8868\u4ee3\u7801\u66f4\u5bb9\u6613\u5b9e\u73b0\uff0c\u53ef\u8bfb\u6027\u597d\u4e0d\u6613\u51fa\u9519\u3002\u8df3\u8868\u66f4\u52a0\u7075\u6d3b\uff0c\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u7d22\u5f15\u6784\u5efa\u7b56\u7565\uff0c\u6709\u6548\u5e73\u8861\u6267\u884c\u6548\u7387\u548c\u5185\u5b58\u6d88\u8017\u3002 \u603b\u51718\u4e2a\u73ed\u7ea7\u3001\u8f93\u51fa\u6bcf\u4e2a\u73ed\u7ea7\u7537\u751f\u7684\u6570\u5b66\u524d\u4e09\u540d\u548c\u5973\u751f\u7684\u8bed\u6587\u524d\u4e09\u540d \u00b6 SELECT g1 . stu_id , g1 . class_id , g1 . gender , g1 . math_score FROM grade g1 WHERE g1 . gender = 'm' AND EXISTS ( SELECT count ( * ) FROM grade g2 WHERE g2 . gender = 'm' AND g2 . math_score >= g1 . math_score AND g2 . class_id = g1 . class_id GROUP BY g2 . class_id HAVING count ( * ) <= 3 ) ORDER BY class_id , math_score DESC","title":"MySQL"},{"location":"cs/db/mysql/#mysql","text":"","title":"MySQL"},{"location":"cs/db/mysql/#_1","text":"\u4e8b\u52a1\u662f\u6ee1\u8db3ACID\u7279\u6027\u7684\u4e00\u7ec4\u64cd\u4f5c\u3002 \u539f\u5b50\u6027 \uff08Atomicity\uff09\uff1a\u4e8b\u52a1\u65f6\u4e0d\u53ef\u5206\u5272\u7684\u6700\u5c0f\u5355\u5143\uff0c\u4e8b\u52a1\u5185\u7684\u8bed\u53e5\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u6210\u529f\uff0c\u8981\u4e48\u5168\u90e8\u6267\u884c\u5931\u8d25\u3002 \u4e00\u81f4\u6027 \uff08Consistency\uff09\uff1a\u6570\u636e\u5e93\u5728\u4e8b\u52a1\u6267\u884c\u524d\u540e\u90fd\u4fdd\u6301\u4e00\u81f4\u6027\u72b6\u6001\u3002\u5728\u4e00\u81f4\u6027\u72b6\u6001\u4e0b\uff0c\u6240\u6709\u4e8b\u52a1\u5bf9\u4e00\u4e2a\u6570\u636e\u7684\u8bfb\u5199\u7ed3\u679c\u90fd\u662f\u76f8\u540c\u7684\u3002 \u9694\u79bb\u6027 \uff08Isolation\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u6240\u505a\u7684\u4fee\u6539\u5728\u6700\u7ec8\u63d0\u4ea4\u4ee5\u524d\uff0c\u5bf9\u5176\u4ed6\u4e8b\u52a1\u662f\u4e0d\u53ef\u89c1\u7684\u3002 \u6301\u4e45\u6027 \uff08Durability\uff09\uff1a\u4e00\u65e6\u4e8b\u52a1\u63d0\u4ea4\uff0c\u5219\u5176\u6240\u505a\u7684\u4fee\u6539\u5c06\u4f1a\u6c38\u8fdc\u4fdd\u5b58\u5728\u6570\u636e\u5e93\u4e2d\u3002 MYSQL\u9ed8\u8ba4\u91c7\u7528\u81ea\u52a8\u63d0\u4ea4\u6a21\u5f0f\u3002","title":"\u4e8b\u52a1"},{"location":"cs/db/mysql/#_2","text":"\u4e22\u5931\u4fee\u6539 \uff1aT1\u548cT2\u4e24\u4e2a\u4e8b\u52a1\u90fd\u5bf9\u4e00\u4e2a\u6570\u636e\u8fdb\u884c\u4fee\u6539\uff0cT1\u5148\u4fee\u6539\uff0cT2\u540e\u4fee\u6539\uff0c\u5219T2\u70b9\u4fee\u6539\u4f1a\u8986\u76d6T1. \u8bfb\u810f\u6570\u636e \uff1aT1\u4fee\u6539\u4e00\u4e2a\u6570\u636e\uff0cT2\u968f\u540e\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u3002\u5982\u679cT1\u64a4\u9500\u4e86\u8fd9\u6b21\u4fee\u6539\uff0c\u5219T2\u8bfb\u5230\u7684\u662f\u810f\u6570\u636e\u3002 \u4e0d\u53ef\u91cd\u590d\u8bfb \uff1aT2\u8bfb\u53d6\u4e00\u4e2a\u6570\u636e\uff0cT1\u5bf9\u8be5\u6570\u636e\u505a\u4e86\u4fee\u6539\uff0c\u6b64\u65f6T2\u518d\u6b21\u8bfb\u53d6\u8fd9\u4e2a\u6570\u636e\u4f1a\u548c\u7b2c\u4e00\u6b21\u8bfb\u53d6\u7684\u7ed3\u679c\u4e0d\u540c\u3002 \u5e7b\u5f71\u8bfb \uff1aT1\u8bfb\u53d6\u67d0\u4e2a\u8303\u56f4\u7684\u6570\u636e\uff0cT2\u5728\u8fd9\u4e2a\u8303\u56f4\u5185\u63d2\u5165\u4e86\u65b0\u7684\u6570\u636e\uff0cT1\u518d\u6b21\u8bfb\u53d6\u548c\u7b2c\u4e00\u6b21\u7684\u7ed3\u679c\u4e0d\u540c\u3002","title":"\u5e76\u53d1\u4e00\u81f4\u6027"},{"location":"cs/db/mysql/#bb","text":"B\u6811\u7684\u7279\u70b9 \u4e00\u4e2a\u8282\u70b9\u4e0a\u5305\u62ec\u81f3\u591a \\(m-1\\) \u4e2a\u503c \u6839\u8282\u70b9\u81f3\u5c11\u6709\u4e24\u4e2a\u5b69\u5b50 \u975e\u53f6\u5b50\u7ed3\u70b9\u5982\u679c\u5305\u542b\u4e86 \\(k\\) \u4e2a\u503c\uff0c\u5219\u5176\u5305\u542b\u4e86 \\(k+1\\) \u4e2a\u5b69\u5b50\u8282\u70b9 \u6240\u6709\u53f6\u5b50\u7ed3\u70b9\u90fd\u4f4d\u4e8e\u540c\u4e00\u5c42 B+\u6811\u7684\u7279\u70b9 \u6240\u6709\u7684\u975e\u53f6\u5b50\u7ed3\u70b9\u4e0d\u518d\u4fdd\u5b58\u503c\uff0c\u800c\u662f\u53ea\u4fdd\u5b58\u4e86\u4e2d\u95f4\u503c \u6240\u6709\u503c\u4fdd\u5b58\u5728\u53f6\u5b50\u7ed3\u70b9\u4e0a \u6240\u6709\u7684\u53f6\u5b50\u7ed3\u70b9\u901a\u5e38\u94fe\u8868\u6309\u7167\u987a\u5e8f\u8fdb\u884c\u8fde\u63a5 \u4e3a\u4ec0\u4e48\u6570\u636e\u5e93\u4f1a\u91c7\u7528B+\u6811\u800c\u4e0d\u662fB\u6811\u6d3b\u7740AVL\u6811 AVL\u7684\u7ed3\u70b9\u8bbf\u95ee\u6b21\u6570\u66f4\u591a\uff0c\u800c\u5bf9\u4e8e\u6570\u636e\u5e93\u800c\u8a00\uff0c\u6bcf\u4e2a\u8282\u70b9\u901a\u5e38\u88ab\u5b58\u50a8\u5728\u4e00\u4e2a\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u9700\u8981\u8bfb\u53d6\u7684\u6587\u4ef6\u6570\u91cf\u66f4\u591a\uff0c\u5bfc\u81f4\u6548\u7387\u4f4e \u5728\u6570\u636e\u5e93\u4e2d\u6709\u65f6\u9700\u8981\u8fdb\u884c\u8303\u56f4\u7684\u6240\u6709\uff0c\u6b64\u65f6B+\u6811\u7684\u94fe\u8868\u7ed3\u6784\u53ef\u4ee5\u5feb\u901f\u7684\u627e\u5230\u67d0\u4e2a\u7ed3\u70b9\u7684\u4e0b\u4e00\u4e2a\u7ed3\u70b9\u4f4d\u7f6e","title":"B\u6811\u548cB+\u6811"},{"location":"cs/db/mysql/#mysql_1","text":"\u7c7b\u578b \u5168\u5c40\u9501 \u8868\u7ea7\u9501 \u884c\u7ea7\u9501 \u8bfb\u5199\u9501 \u8bfb\u9501\uff1a\u53ef\u4ee5\u4e0e\u5176\u4ed6\u7684\u8bfb\u9501\u5171\u5b58\uff0c\u4f46\u662f\u4e0d\u53ef\u4ee5\u4e0e\u5199\u9501\u5171\u5b58 \u5199\u9501\uff1a\u4e0d\u53ef\u4ee5\u4e0e\u5176\u4ed6\u4efb\u4f55\u9501\u5171\u5b58 \u60b2\u89c2\u9501 \u666e\u901a\u7684\u9501\uff0c\u9501\u5b9a\u6b64\u884c/\u8868/\u6570\u636e\u5e93\u4ee5\u9632\u6b62\u5176\u4ed6\u64cd\u4f5c\u8fdb\u884c\u4fee\u6539\uff0c\u4f1a\u5bfc\u81f4\u5176\u4ed6\u4e8b\u52a1\u88ab\u963b\u585e \u4e50\u89c2\u9501 \u901a\u8fc7\u6bd4\u8f83\u7248\u672c\u53f7\u7684\u533a\u522b\u7684\u65b9\u6cd5\uff0c\u6765\u786e\u5b9a\u6b64\u6570\u636e\u662f\u5426\u7ecf\u8fc7\u4fee\u6539\uff0c\u5982\u679c\u4fee\u6539\u5219\u9700\u8981\u8bfb\u53d6\u6700\u65b0\u7684\u503c","title":"MySQL\u9501"},{"location":"cs/db/mysql/#_3","text":"\u9694\u79bb\u7ea7\u522b \u810f\u8bfb \u4e0d\u53ef\u91cd\u590d\u8bfb \u5e7b\u8bfb \u672a\u63d0\u4ea4\u8bfb \u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u5df2\u63d0\u4ea4\u8bfb \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u80fd \u53ef\u91cd\u590d\u8bfb \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u53ef\u80fd \u53ef\u4e32\u884c\u5316 \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u4e0d\u53ef\u80fd \u9694\u79bb\u7ea7\u522b\uff1a \u672a\u63d0\u4ea4\u8bfb\uff1a\u6700\u6734\u7d20\u7684\u6570\u636e\u5f62\u5f0f \u5df2\u63d0\u4ea4\u8bfb\uff1a\u5728\u4e8b\u52a1\u5b8c\u6210\u4e4b\u540e\u518d\u66f4\u65b0\u6570\u636e\u5e93\u7684\u503c \u53ef\u91cd\u590d\u8bfb\uff1a\u6bcf\u4e2a\u4e8b\u52a1\u5f00\u59cb\u524d\u9501\u5b9a\u6240\u66f4\u65b0\u7684\u884c \u53ef\u4e32\u884c\u5316\uff1a\u5355\u4e00\u7ebf\u7a0b\uff0c\u6240\u6709\u4e8b\u52a1\u5fc5\u987b\u6309\u7167\u987a\u5e8f\u8fdb\u884c3","title":"\u6570\u636e\u5e93\u9694\u79bb\u7ea7\u522b"},{"location":"cs/db/mysql/#innodbmyisam","text":"","title":"\u5b58\u50a8\u5f15\u64ce InnoDB\u548cMyISAM"},{"location":"cs/db/mysql/#innodb","text":"\u662fMySQL\u9ed8\u8ba4\u7684\u5b58\u50a8\u5f15\u64ce\u3002\u5b9e\u73b0\u4e86\u56db\u4e2a\u6807\u51c6\u7684\u9694\u79bb\u7ea7\u522b\u3002\u9ed8\u8ba4\u662f\u53ef\u91cd\u590d\u8bfb\uff0c\u901a\u8fc7MVCC\u548cNext-Key Locking\u9632\u6b62\u5e7b\u5f71\u8bfb\u3002\u652f\u6301\u771f\u6b63\u7684\u5728\u7ebf\u70ed\u5907\u4efd\uff0c\u5176\u4ed6\u5b58\u50a8\u5f15\u64ce\u4e0d\u652f\u6301\u5728\u7ebf\u70ed\u5907\u4efd\u3002 Record Locks \uff1a\u9501\u5b9a\u4e00\u4e2a\u8bb0\u5f55\u4e0a\u7684\u7d22\u5f15\uff0c\u800c\u4e0d\u662f\u8bb0\u5f55\u672c\u8eab\u3002 Gap Locks \uff1a\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\uff0c\u800c\u4e0d\u662f\u7d22\u5f15\u672c\u8eab\u3002 Next-Key Locks \uff1aInnoDB\u5b58\u50a8\u5f15\u64ce\u7684\u4e00\u79cd\u9501\u5b9e\u73b0\uff0c\u662fRecord Locks\u548cGap Locks\u7684\u7ed3\u5408\u3002\u4e0d\u4ec5\u4ec5\u9501\u5b9a\u7d22\u5f15\uff0c\u4e5f\u9501\u5b9a\u7d22\u5f15\u4e4b\u95f4\u7684\u95f4\u9699\u3002","title":"InnoDB"},{"location":"cs/db/mysql/#myisam","text":"\u8bbe\u8ba1\u7b80\u5355\uff0c\u6570\u636e\u4ee5\u7d27\u5bc6\u683c\u5f0f\u5b58\u50a8\u3002\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7279\u6027\uff0c\u5305\u62ec\u538b\u7f29\u8868\u3001\u7a7a\u95f4\u6570\u636e\u7d22\u5f15\u7b49\u3002\u4e0d\u652f\u6301\u4e8b\u52a1\uff0c\u4e0d\u652f\u6301\u884c\u7ea7\u9501\uff0c\u53ea\u652f\u6301\u8868\u7ea7\u9501\uff0c\u53ef\u4ee5\u624b\u5de5\u6216\u8005\u81ea\u52a8\u6267\u884c\u68c0\u67e5\u548c\u4fee\u590d\u64cd\u4f5c\uff0c\u4f46\u53ef\u80fd\u5bfc\u81f4\u4e00\u4e9b\u6570\u636e\u4e22\u5931\uff0c\u800c\u4e14\u4fee\u590d\u64cd\u4f5c\u975e\u5e38\u6162\u3002","title":"MyISAM"},{"location":"cs/db/mysql/#mvcc","text":"\u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08Multi-Version Concurrency Control, MVCC\uff09\u662f MySQL \u7684 InnoDB \u5b58\u50a8\u5f15\u64ce\u5b9e\u73b0\u9694\u79bb\u7ea7\u522b\u7684\u4e00\u79cd\u5177\u4f53\u65b9\u5f0f\uff0c\u7528\u4e8e\u5b9e\u73b0\u63d0\u4ea4\u8bfb\u548c\u53ef\u91cd\u590d\u8bfb\u8fd9\u4e24\u79cd\u9694\u79bb\u7ea7\u522b\u3002\u800c\u672a\u63d0\u4ea4\u8bfb\u9694\u79bb\u7ea7\u522b\u603b\u662f\u8bfb\u53d6\u6700\u65b0\u7684\u6570\u636e\u884c\uff0c\u8981\u6c42\u5f88\u4f4e\uff0c\u65e0\u9700\u4f7f\u7528 MVCC\u3002\u53ef\u4e32\u884c\u5316\u9694\u79bb\u7ea7\u522b\u9700\u8981\u5bf9\u6240\u6709\u8bfb\u53d6\u7684\u884c\u90fd\u52a0\u9501\uff0c\u5355\u7eaf\u4f7f\u7528 MVCC \u65e0\u6cd5\u5b9e\u73b0\u3002 InnoDB\u7684MVCC\uff0c\u662f\u901a\u8fc7\u5728\u6bcf\u884c\u8bb0\u5f55\u540e\u9762\u4fdd\u5b58\u4e24\u4e2a\u9690\u85cf\u7684\u5217\u6765\u5b9e\u73b0\u7684\u3002\u8fd9\u4e24\u4e2a\u5217\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u521b\u5efa\u65f6\u95f4\uff0c\u4e00\u4e2a\u4fdd\u5b58\u4e86\u884c\u7684\u8fc7\u671f\u65f6\u95f4\u3002\u5b58\u50a8\u7684\u4e0d\u662f\u5b9e\u9645\u7684\u65f6\u95f4\u503c\uff0c\u800c\u662f\u7cfb\u7edf\u7684\u7248\u672c\u53f7\u3002MVCC\u53ea\u8981\u53ef\u91cd\u590d\u8bfb\u548c\u63d0\u4ea4\u8bfb\u4e24\u4e2a\u9694\u79bb\u7ea7\u522b\u4e0b\u5de5\u4f5c\u3002 \u5728\u53ef\u91cd\u590d\u8bfb\u7684\u9694\u79bb\u7ea7\u522b\u4e0b\uff0cMVCC\u7684\u64cd\u4f5c\uff1a - SELECT 1. InnoDB\u53ea\u67e5\u627e\u7248\u672c\u65e9\u4e8e\u5f53\u524d\u4e8b\u52a1\u7248\u672c\u7684\u6570\u636e\u884c\uff0c\u8fd9\u6837\u53ef\u4ee5\u786e\u4fdd\u4e8b\u52a1\u8bfb\u53d6\u7684\u884c\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u5f00\u542f\u524d\u5df2\u7ecf\u5b58\u5728\u7684\uff0c\u8981\u4e48\u662f\u4e8b\u52a1\u81ea\u8eab\u63d2\u5165\u6216\u8005\u4fee\u6539\u8fc7\u7684\u3002 2. \u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u8981\u4e48\u672a\u5b9a\u4e49\uff0c\u8981\u4e48\u5927\u4e8e\u5f53\u524d\u4e8b\u52a1\u7684\u7248\u672c\u53f7\uff0c\u8fd9\u53ef\u4ee5\u4fdd\u8bc1\u4e8b\u52a1\u8bfb\u53d6\u5230\u7684\u884c\uff0c\u5728\u4e8b\u52a1\u5f00\u59cb\u524d\u672a\u88ab\u5220\u9664\u3002 - INSERT 1. \u4e3a\u63d2\u5165\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u884c\u7248\u672c\u53f7\u3002 - DELETE 1. \u4e3a\u5220\u9664\u7684\u6bcf\u4e00\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u5220\u9664\u7248\u672c\u53f7\u3002 - UPDATE 1. \u4fee\u6539\u540e\u7684\u6570\u636e\u884c\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4e3a\u521b\u5efa\u7248\u672c\u53f7\uff0c\u540c\u65f6\u4fdd\u5b58\u5f53\u524d\u7cfb\u7edf\u7248\u672c\u53f7\u4f5c\u4e3a\u539f\u6765\u7684\u884c\u7684\u5220\u9664\u7248\u672c\u53f7\u3002","title":"\u591a\u7248\u672c\u5e76\u53d1\u63a7\u5236\uff08MVCC\uff09"},{"location":"cs/db/mysql/#_4","text":"\u7b2c\u4e00\u8303\u5f0f\uff1a\u5c5e\u6027\u4e0d\u53ef\u5206 \u7b2c\u4e8c\u8303\u5f0f\uff1a\u6bcf\u4e2a\u975e\u4e3b\u5c5e\u6027\u5b8c\u5168\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u7b2c\u4e09\u8303\u5f0f\uff1a\u975e\u4e3b\u5c5e\u6027\u4e0d\u4f20\u9012\u51fd\u6570\u4f9d\u8d56\u4e8e\u952e\u7801 \u8303\u5f0f\u5316\u7684\u597d\u5904\uff1a \u8303\u5f0f\u5316\u7684\u66f4\u65b0\u64cd\u4f5c\u901a\u5e38\u6bd4\u53cd\u8303\u5f0f\u5316\u8981\u5feb \u5f53\u6570\u636e\u8f83\u597d\u5730\u8303\u5f0f\u5316\u65f6\uff0c\u5c31\u53ea\u6709\u5f88\u5c11\u6216\u8005\u6ca1\u6709\u91cd\u590d\u6570\u636e\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u4fee\u6539\u66f4\u5c11\u7684\u6570\u636e\u3002 \u8303\u5f0f\u5316\u7684\u8868\u901a\u5e38\u66f4\u5c0f\uff0c\u53ef\u4ee5\u66f4\u597d\u5730\u653e\u5728\u5185\u5b58\u91cc\uff0c\u6240\u4ee5\u6267\u884c\u64cd\u4f5c\u4f1a\u66f4\u5feb\u3002 \u8303\u5f0f\u5316\u7684\u7f3a\u70b9\uff1a\u901a\u5e38\u9700\u8981\u5173\u8054\uff0c\u4ee3\u4ef7\u6602\u8d35\uff0c\u4e5f\u53ef\u80fd\u4f7f\u4e00\u4e9b\u7d22\u5f15\u7b56\u7565\u65e0\u6548\u3002","title":"\u8303\u5f0f"},{"location":"cs/db/mysql/#_5","text":"\u67e5\u8be2\u6027\u80fd\u4f4e\u4e0b\u7684\u6700\u57fa\u672c\u7684\u539f\u56e0\u662f\u8bbf\u95ee\u7684\u6570\u636e\u592a\u591a\u3002 \u662f\u5426\u5411\u6570\u636e\u5e93\u8bf7\u6c42\u4e86\u4e0d\u9700\u8981\u7684\u6570\u636e \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u5217\uff0c\u6700\u597d\u4e0d\u8981\u7528 select * \u8fdb\u884c\u67e5\u8be2 \u53ea\u8fd4\u56de\u5fc5\u8981\u7684\u884c\uff0c\u4f7f\u7528limit\u6765\u9650\u5236\u8fd4\u56de\u7684\u6570\u636e \u7f13\u5b58\u91cd\u590d\u67e5\u8be2\u7684\u6570\u636e \u662f\u5426\u5728\u626b\u63cf\u989d\u5916\u7684\u8bb0\u5f55 \u4f7f\u7528\u7d22\u5f15\u8986\u76d6\u626b\u63cf\uff0c\u628a\u6240\u6709\u9700\u8981\u7528\u5230\u7684\u5217\u90fd\u653e\u5728\u7d22\u5f15\u4e2d\uff0c \u8fd9\u6837\u5b58\u50a8\u5f15\u64ce\u65e0\u9700\u56de\u8868\u83b7\u53d6\u5bf9\u5e94\u884c\u5c31\u53ef\u4ee5\u8fd4\u56de\u7ed3\u679c \u6539\u53d8\u5e93\u8868\u7ed3\u6784 \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u91cd\u6784\u67e5\u8be2\u65b9\u5f0f \u5207\u5206\u5927\u67e5\u8be2 \u5206\u89e3\u5927\u8fde\u63a5\u67e5\u8be2","title":"\u67e5\u8be2\u4f18\u5316"},{"location":"cs/db/mysql/#_6","text":"","title":"\u4e3b\u4ece\u590d\u5236"},{"location":"cs/db/mysql/#_7","text":"MySQL\u4e3b\u4ece\u590d\u5236\u662f\u6307\u6570\u636e\u53ef\u4ee5\u4ece\u4e00\u4e2aMySQL\u6570\u636e\u5e93\u670d\u52a1\u5668\u4e3b\u8282\u70b9\u590d\u5236\u5230\u4e00\u4e2a\u6216\u591a\u4e2a\u4ece\u8282\u70b9\u3002MySQL\u9ed8\u8ba4\u91c7\u7528\u5f02\u6b65\u590d\u5236\u65b9\u5f0f\uff0c\u8fd9\u6837\u4ece\u8282\u70b9\u4e0d\u7528\u4e00\u76f4\u8bbf\u95ee\u4e3b\u670d\u52a1\u5668\u6765\u66f4\u65b0\u81ea\u5df1\u7684\u6570\u636e\uff0c\u6570\u636e\u7684\u66f4\u65b0\u53ef\u4ee5\u5728\u8fdc\u7a0b\u8fde\u63a5\u4e0a\u8fdb\u884c\uff0c\u4ece\u8282\u70b9\u53ef\u4ee5\u590d\u5236\u4e3b\u6570\u636e\u5e93\u4e2d\u7684\u6240\u6709\u6570\u636e\u5e93\u6216\u8005\u7279\u5b9a\u7684\u6570\u636e\u5e93\uff0c\u6216\u8005\u7279\u5b9a\u7684\u8868\u3002","title":"\u6982\u5ff5"},{"location":"cs/db/mysql/#_8","text":"\u6570\u636e\u5206\u5e03 \u8d1f\u8f7d\u5747\u8861 \u6570\u636e\u5907\u4efd\uff0c\u4fdd\u8bc1\u6570\u636e\u5b89\u5168 \u9ad8\u53ef\u7528\u6027\u548c\u5bb9\u9519\u884c \u5b9e\u73b0\u8bfb\u5199\u5206\u79bb\uff0c\u7f13\u89e3\u6570\u636e\u5e93\u538b\u529b \u7531\u4e8emysql\u5b9e\u73b0\u7684\u5f02\u6b65\u590d\u5236\uff0c\u6240\u4ee5\u4e3b\u5e93\u548c\u4ece\u5e93\u4e4b\u95f4\u5b58\u5728\u4e00\u5b9a\u7684\u5dee\u5f02\uff0c\u5728\u4ece\u5e93\u6267\u884c\u67e5\u8be2\u64cd\u4f5c\u9700\u8981\u8003\u8651\u8fd9\u4e9b\u6570\u636e\u7684\u5dee\u5f02\uff0c\u4e00\u822c\u53ea\u6709\u66f4\u65b0\u4e0d\u9891\u7e41\u548c\u5bf9\u5b9e\u65f6\u6027\u8981\u6c42\u4e0d\u9ad8\u7684\u6570\u636e\u53ef\u4ee5\u901a\u8fc7\u4ece\u5e93\u67e5\u8be2\uff0c\u5b9e\u884c\u8981\u6c42\u9ad8\u7684\u4ecd\u7136\u8981\u4ece\u4e3b\u5e93\u67e5\u8be2\u3002","title":"\u4f5c\u7528"},{"location":"cs/db/mysql/#_9","text":"MySQL\u4e3b\u4ece\u590d\u5236\u6d89\u53ca\u5230\u4e09\u4e2a\u7ebf\u7a0b\uff0c\u4e00\u4e2a\u8fd0\u884c\u5728 \u4e3b\u8282\u70b9\uff08log dump thread\uff09 \uff0c\u5176\u4f59\u4e24\u4e2a\uff08 I/O thread\uff0c SQL thread \uff09\u8fd0\u884c\u5728\u4ece\u8282\u70b9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a binlog \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u5c06\u4e3b\u670d\u52a1\u5668\u4e0a\u7684\u6570\u636e\u66f4\u6539\u5199\u5165\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff08Binary log\uff09\u4e2d\u3002 I/O \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u4ece\u4e3b\u670d\u52a1\u5668\u4e0a\u8bfb\u53d6\u4e8c\u8fdb\u5236\u65e5\u5fd7\uff0c\u5e76\u5199\u5165\u4ece\u670d\u52a1\u5668\u7684\u4e2d\u7ee7\u65e5\u5fd7\uff08Relay log\uff09\u3002 SQL \u7ebf\u7a0b \uff1a\u8d1f\u8d23\u8bfb\u53d6\u4e2d\u7ee7\u65e5\u5fd7\uff0c\u89e3\u6790\u51fa\u4e3b\u670d\u52a1\u5668\u5df2\u7ecf\u6267\u884c\u7684\u6570\u636e\u66f4\u6539\u5e76\u5728\u4ece\u670d\u52a1\u5668\u4e2d\u91cd\u653e\uff08Replay\uff09\u3002","title":"\u539f\u7406"},{"location":"cs/db/mysql/#_10","text":"\u4e3a\u4ec0\u4e48\u4f7f\u7528\u8fde\u63a5\u6c60 \u4e0eJava\u7684\u7ebf\u7a0b\u6c60\u76f8\u540c\uff0c\u4e3a\u4e86\u8282\u7ea6\u7cfb\u7edf\u8d44\u6e90 \u5e38\u7528\u7684\u8fde\u63a5\u6c60 DBCP\uff1a\u4f7f\u7528\u91cf\u6700\u5927\u7684\u8fde\u63a5\u6c60 C3P0","title":"\u8fde\u63a5\u6c60"},{"location":"cs/db/mysql/#_11","text":"\u6c34\u5e73\u5206\u8868 \u5c06\u4e00\u4e2a\u8868\u7684\u8bb0\u5f55\u5206\u5272\u5230\u6570\u4e2a\u8868\u4e2d\uff0c\u53ef\u4ee5\u51cf\u5c11\u7d22\u5f15\u7684\u5927\u5c0f\uff0c\u52a0\u5feb\u7d22\u5f15 \u5782\u76f4\u5206\u8868 \u5c06\u90e8\u5206\u5b57\u6bb5\u5212\u5206\u81f3\u5176\u4ed6\u7684\u8868\uff0c\u90e8\u5206\u5b57\u6bb5\u6570\u636e\u91cf\u5927\uff0c\u8fdb\u884c\u7d22\u5f15\u65f6\u4f1a\u5e26\u6765\u5927\u91cf\u7684IO\u8d1f\u62c5\uff0c\u8fdb\u884c\u5206\u8868\u6709\u5229\u4e8e\u67e5\u8be2\u6548\u7387","title":"\u5206\u8868"},{"location":"cs/db/mysql/#sql","text":"\u4e00\u6761SQL\u8bed\u53e5\u7684\u6267\u884c\u8fc7\u7a0b\uff1a 1. \u8fde\u63a5\u5668\u67e5\u770b\u5f53\u524d\u7528\u6237\u6743\u9650\uff0c\u82e5\u62e5\u6709\u6743\u9650\uff0c\u5efa\u7acb\u8fde\u63a5\u3002\u5982\u679c\u5ba2\u6237\u7aef\u592a\u957f\u65f6\u95f4\u6ca1\u6709\u52a8\u9759\uff0c\u8fde\u63a5\u5668\u4f1a\u81ea\u52a8\u65ad\u5f00\u8fde\u63a5 2. \u5206\u6790\u5668\u5206\u6790SQL\u8bed\u53e5\uff0c\u5305\u62ec\u8bed\u6cd5\u5206\u6790\uff08\u8bed\u6cd5\u662f\u5426\u6b63\u786e\uff09\uff0c\u8bcd\u6cd5\u5206\u6790\uff08\u8bc6\u522bSQL\u8bed\u53e5\uff09\u3002 3. \u4f18\u5316\u5668\u4f18\u5316\u67e5\u8be2\uff0c\u51b3\u5b9a\u4f7f\u7528\u7684\u7d22\u5f15\u7b49\u3002 4. \u6267\u884c\u5668\u6765\u65f6\u6267\u884c\u8bed\u53e5\u3002","title":"SQL"},{"location":"cs/db/mysql/#_12","text":"","title":"\u8bf4\u4e00\u4e0b\u7d22\u5f15\uff1f"},{"location":"cs/db/mysql/#_13","text":"\u7d22\u5f15\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u6587\u4ef6\uff08InnoDB\u6570\u636e\u8868\u4e0a\u7684\u7d22\u5f15\u662f\u8868\u7a7a\u95f4\u7684\u4e00\u4e2a\u7ec4\u6210\u90e8\u5206\uff09\uff0c\u4ed6\u4eec\u5305\u542b\u7740\u5bf9\u6570\u636e\u8868\u91cc\u6240\u6709\u8bb0\u5f55\u7684\u5f15\u7528\u6307\u9488\u3002 \u7d22\u5f15\u662f\u4e00\u79cd\u6570\u636e\u7ed3\u6784\u3002\u6570\u636e\u5e93\u7d22\u5f15\uff0c\u662f\u6570\u636e\u5e93\u7ba1\u7406\u7cfb\u7edf\u4e2d\u7684\u4e00\u4e2a\u6392\u5e8f\u7684\u6570\u636e\u7ed3\u6784\uff0c\u4e3a\u4e86\u534f\u52a9\u5feb\u901f\u67e5\u8be2\u3001\u66f4\u65b0\u6570\u636e\u8868\u4e2d\u6570\u636e\u3002\u7d22\u5f15\u7684\u5b9e\u73b0\u901a\u5e38\u4f7f\u7528B\u6811\u4ee5\u53ca\u53d8\u79cdB+\u6811\u3002","title":"\u4ec0\u4e48\u662f\u7d22\u5f15"},{"location":"cs/db/mysql/#_14","text":"\u65f6\u95f4\u65b9\u9762\uff1a\u521b\u5efa\u7d22\u5f15\u548c\u7ef4\u62a4\u7d22\u5f15\u8981\u8017\u8d39\u65f6\u95f4\uff0c\u5177\u4f53\u7684\uff0c\u5f53\u5bf9\u8868\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u589e\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u7684\u65f6\u5019\uff0c\u7d22\u5f15\u4e5f\u8981\u52a8\u6001\u7684\u7ef4\u62a4\uff0c\u4f1a\u8f83\u4f4e\u589e\u6539\u5220\u7684\u6267\u884c\u6548\u7387\u3002 \u7a7a\u95f4\u65b9\u9762\uff1a\u7d22\u5f15\u9700\u8981\u5360\u7528\u7269\u7406\u7a7a\u95f4\u3002","title":"\u7d22\u5f15\u7684\u7f3a\u70b9"},{"location":"cs/db/mysql/#_15","text":"\u7269\u7406\u5b58\u50a8\u89d2\u5ea6\uff1a \u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4f5c\u4e3aB+\u6811\u7d22\u5f15\u7684\u952e\u503c\u800c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u975e\u805a\u7c07\u7d22\u5f15\uff1a\u4ee5\u4e3b\u952e\u4e4b\u5916\u7684\u5217\u503c\u4f5c\u4e3a\u952e\u503c\u6784\u5efa\u7684B+\u6811\u7d22\u5f15 \u6570\u636e\u7ed3\u6784\u89d2\u5ea6\uff1a B+\u6811\u7d22\u5f15 hash\u7d22\u5f15 FULLTEXT\u7d22\u5f15 R-Tree\u7d22\u5f15 \u903b\u8f91\u89d2\u5ea6\uff1a \u4e3b\u952e\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u4e0d\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u53ea\u80fd\u6709\u4e00\u4e2a\u4e3b\u952e \u666e\u901a/\u5355\u5217\u7d22\u5f15\uff1a\u57fa\u672c\u7684\u7d22\u5f15\u7c7b\u578b\uff0c\u6ca1\u6709\u552f\u4e00\u6027\u7684\u6027\u8d28\uff0c\u5141\u8bb8\u4e3a NULL \u591a\u5217/\u8054\u5408/\u590d\u5408\u7d22\u5f15\uff1a\u4ee5\u4e00\u5b9a\u987a\u5e8f\u5f15\u7528\u591a\u5217 \u552f\u4e00\u7d22\u5f15\uff1a\u6570\u636e\u5217\u4e0d\u5141\u8bb8\u91cd\u590d\uff0c\u5141\u8bb8\u4e3a NULL \uff0c\u4e00\u4e2a\u8868\u4e2d\u5141\u8bb8\u591a\u4e2a\u5217\u521b\u5efa\u552f\u4e00\u7d22\u5f15 \u5168\u6587\u7d22\u5f15\uff1a\u76ee\u524d\u641c\u7d22\u5f15\u64ce\u4f7f\u7528\u7684\u4e00\u79cd\u5173\u952e\u6280\u672f \u7a7a\u95f4\u7d22\u5f15\uff1a\u5bf9\u7a7a\u95f4\u6570\u636e\u7c7b\u578b\u7684\u5b57\u6bb5\u5efa\u7acb\u7684\u7d22\u5f15","title":"\u7d22\u5f15\u7684\u4e3b\u8981\u7c7b\u578b"},{"location":"cs/db/mysql/#_16","text":"\u4e3b\u8981\u9488\u5bf9\u8054\u5408\u7d22\u5f15\uff0c\u5982\u679c\u67e5\u8be2\u7684\u65f6\u5019\u67e5\u8be2\u6761\u4ef6\u7cbe\u786e\u5339\u914d\u7d22\u5f15\u7684\u5de6\u8fb9\u8fde\u7eed\u4e00\u5217\u6216\u591a\u5217\uff0c\u5219\u6b64\u5217\u5c31\u53ef\u4ee5\u88ab\u7528\u5230\u3002","title":"\u6700\u5de6\u524d\u7f00\u5339\u914d\u539f\u5219"},{"location":"cs/db/mysql/#redis","text":"\u7f13\u5b58\u3001\u8ba1\u6570\u5668\u3001\u961f\u5217\u3001\u4f4d\u64cd\u4f5c\u3001\u6700\u65b0\u5217\u8868\u3002","title":"redis\u5e94\u7528\u573a\u666f\uff1f"},{"location":"cs/db/mysql/#_17","text":"\u975e\u805a\u7c07\u7d22\u5f15\u548c\u805a\u7c07\u7d22\u5f15\u7684\u533a\u522b\u5728\u4e8e\u975e\u805a\u7c07\u7d22\u5f15\u7684\u53f6\u5b50\u8282\u70b9\u4e0d\u5b58\u50a8\u8868\u4e2d\u7684\u6570\u636e\uff0c\u800c\u662f\u5b58\u50a8\u8be5\u5217\u5bf9\u5e94\u7684\u4e3b\u952e\uff0c\u60f3\u8981\u67e5\u627e\u6570\u636e\u6211\u4eec\u8fd8\u9700\u8981\u6839\u636e\u4e3b\u952e\u518d\u53bb\u805a\u7c07\u7d22\u5f15\u4e2d\u8fdb\u884c\u67e5\u627e\uff0c\u8fd9\u4e2a\u518d\u6839\u636e\u805a\u7c07\u7d22\u5f15\u67e5\u627e\u6570\u636e\u7684\u8fc7\u7a0b\uff0c\u88ab\u79f0\u4e3a\u56de\u8868\u3002","title":"\u8bf4\u4e00\u4e0b\u56de\u8868\u64cd\u4f5c\uff1f"},{"location":"cs/db/mysql/#_18","text":"\u5982\u4f55\u907f\u514d\uff1a\u5c06\u88ab\u67e5\u8be2\u7684\u5b57\u6bb5\uff0c\u5efa\u7acb\u5230\u8054\u5408\u7d22\u5f15\u4e2d\u3002\u5c3d\u91cf\u4f7f\u7528\u5230\u7d22\u5f15\u8986\u76d6\uff0c\u4e0d\u5e94\u8be5\u4f7f\u7528 * \u6765\u5168\u8868\u67e5\u8be2\u3002 \u7d22\u5f15\u8986\u76d6\u662f\u6307\u4ece\u7d22\u5f15\u4e2d\u5c31\u53ef\u4ee5\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\uff0c\u4ece\u800c\u4e0d\u9700\u8981\u67e5\u8be2\u805a\u7c07\u7d22\u5f15\u4e2d\u7684\u884c\u6570\u636e\u4fe1\u606f\u3002 \u9700\u8981\u8bf4\u660e\u7684\u662f\uff0c\u8986\u76d6\u7d22\u5f15\u5fc5\u987b\u8981\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u800c\u54c8\u5e0c\u7d22\u5f15\u3001\u7a7a\u95f4\u7d22\u5f15\u548c\u5168\u6587\u7d22\u5f15\u4e0d\u5b58\u50a8\u7d22\u5f15\u5217\u7684\u503c\uff0c\u6240\u4ee5mysql\u53ea\u80fd\u7528B+tree\u7d22\u5f15\u505a\u8986\u76d6\u7d22\u5f15\u3002","title":"\u5982\u4f55\u907f\u514d\u56de\u8868\u67e5\u8be2?\u4ec0\u4e48\u662f\u7d22\u5f15\u8986\u76d6?"},{"location":"cs/db/mysql/#_19","text":"\u5728MySQL\u4e2d\uff0c\u5e38\u89c1\u7684\u8868\u8fde\u63a5\u65b9\u5f0f\u67094\u7c7b\uff0c\u51717\u79cd\u65b9\u5f0f\uff1a - INNER JOIN \uff1ainner join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\uff1b - LEFT JOIN \uff1aleft join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u5de6\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u7528where\u8fc7\u6ee4\u6761\u4ef6 - RIGHT JOIN \uff1aright join\u662f\u6839\u636e\u8868\u8fde\u63a5\u6761\u4ef6\uff0c\u6c42\u53d6\u4e24\u4e2a\u8868\u7684\u6570\u636e\u4ea4\u96c6\u518d\u52a0\u4e0a\u53f3\u8868\u5269\u4e0b\u7684\u6570\u636e\uff0c\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u4f7f\u7528where\u8fc7\u6ee4\u6761\u4ef6 - FULL JOIN \uff1afull join\u662f\u5de6\u8fde\u63a5\u548c\u53f3\u8fde\u63a5\u7684\u5e76\u96c6\uff0cMySQL\u5e76\u672a\u63d0\u4f9bfull join\u7684\u8bed\u6cd5\uff0c\u5982\u679c\u8981\u5b9e\u73b0\uff0c\u9700\u8981left join\u4e8eright join\u8fdb\u884c\u6c42\u5e76\u96c6\uff0c\u8fd8\u6709\u7528where\u8fc7\u6ee4","title":"\u8bf4\u4e00\u4e0b\u8868\u8fde\u63a5\u7684\u64cd\u4f5c\uff1f"},{"location":"cs/db/mysql/#_20","text":"\u6761\u4ef6\u4e2d\u6709 or like \u67e5\u8be2\uff08\u4ee5 % \u5f00\u5934\uff09 \u5982\u679c\u5217\u7c7b\u578b\u662f\u5b57\u7b26\u4e32\uff0c\u90a3\u4e00\u5b9a\u8981\u5728\u6761\u4ef6\u4e2d\u5c06\u6570\u636e\u4f7f\u7528\u5f15\u53f7\u5f15\u7528\u8d77\u6765\uff0c\u5426\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15 \u5bf9\u5217\u8fdb\u884c\u51fd\u6570\u8fd0\u7b97 \u8d1f\u5411\u67e5\u8be2\u6761\u4ef6\u4f1a\u5bfc\u81f4\u65e0\u6cd5\u4f7f\u7528\u7d22\u5f15\uff0c\u6bd4\u5982 NOT IN \uff0c NOT LIKE \uff0c != \u7b49 \u5bf9\u4e8e\u8054\u5408\u7d22\u5f15\uff0c\u4e0d\u662f\u4f7f\u7528\u7b2c\u4e00\u90e8\u5206\uff08\u7b2c\u4e00\u4e2a\uff09\uff0c\u5219\u4e0d\u4f1a\u4f7f\u7528\u7d22\u5f15\uff08\u6700\u5de6\u5339\u914d\uff09 \u5982\u679cmysql\u8bc4\u4f30\u4f7f\u7528\u5168\u8868\u626b\u63cf\u8981\u6bd4\u4f7f\u7528\u7d22\u5f15\u5757\uff0c\u5219\u4e0d\u4f7f\u7528\u7d22\u5f15","title":"\u7d22\u5f15\u4ec0\u4e48\u65f6\u5019\u4f1a\u5931\u6548\uff1f"},{"location":"cs/db/mysql/#sql_1","text":"\u4f7f\u7528\u89e3\u91ca\u51fd\u6570 explain \uff0c\u53ea\u9700\u6dfb\u52a0\u5728sql\u8bed\u53e5\u4e4b\u524d\u5373\u53ef\uff1a \u6211\u4eec\u53ea\u9700\u8981\u6ce8\u610f\u4e00\u4e2a\u6700\u91cd\u8981\u7684type \u7684\u4fe1\u606f\u5f88\u660e\u663e\u7684\u63d0\u73b0\u662f\u5426\u7528\u5230\u7d22\u5f15\uff1a type\u7ed3\u679c\u503c\u4ece\u597d\u5230\u574f\u4f9d\u6b21\u662f\uff1a system > const > eq_ref > ref > fulltext > ref_or_null > index_merge > unique_subquery > index_subquery > range > index > ALL \u4e00\u822c\u6765\u8bf4\uff0c\u5f97\u4fdd\u8bc1\u67e5\u8be2\u81f3\u5c11\u8fbe\u5230range\u7ea7\u522b\uff0c\u6700\u597d\u80fd\u8fbe\u5230ref\uff0c\u5426\u5219\u5c31\u53ef\u80fd\u4f1a\u51fa\u73b0\u6027\u80fd\u95ee\u9898\u3002 possible_keys \uff1asql\u6240\u7528\u5230\u7684\u7d22\u5f15 key \uff1a\u663e\u793aMySQL\u5b9e\u9645\u51b3\u5b9a\u4f7f\u7528\u7684\u952e\uff08\u7d22\u5f15\uff09\u3002\u5982\u679c\u6ca1\u6709\u9009\u62e9\u7d22\u5f15\uff0c\u952e\u662fNULL rows : \u663e\u793aMySQL\u8ba4\u4e3a\u5b83\u6267\u884c\u67e5\u8be2\u65f6\u5fc5\u987b\u68c0\u67e5\u7684\u884c\u6570\u3002","title":"\u5224\u65adsql\u662f\u5426\u4f7f\u7528\u7d22\u5f15"},{"location":"cs/db/mysql/#_21","text":"","title":"\u8bf4\u4e00\u4e0b\u9501\uff1f\u8bf4\u4e00\u4e0b\u533a\u522b\uff1f"},{"location":"cs/db/mysql/#redis_1","text":"","title":"Redis\u7f13\u5b58\u66f4\u65b0\u7b56\u7565"},{"location":"cs/db/mysql/#_22","text":"\u9ad8\u5e76\u53d1\uff08High Concurrency\uff09\u662f\u6307\u7cfb\u7edf\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\u4e00\u79cd\u201c\u77ed\u65f6\u95f4\u5185\u9047\u5230\u5927\u91cf\u64cd\u4f5c\u8bf7\u6c42\u201d\u7684\u60c5\u51b5\uff0c\u4e3b\u8981\u53d1\u751f\u5728web\u7cfb\u7edf\u96c6\u4e2d\u5927\u91cf\u8bbf\u95ee\u6536\u5230\u5927\u91cf\u8bf7\u6c42\uff0c\u4f8b\u5982\u6dd8\u5b9d\u53cc\u5341\u4e00\u3001\u4eac\u4e1c618\u7c7b\u7684\u6d3b\u52a8\u3002\u8be5\u60c5\u51b5\u7684\u53d1\u751f\u4f1a\u5bfc\u81f4\u7cfb\u7edf\u5728\u8fd9\u6bb5\u65f6\u95f4\u5185\u6267\u884c\u5927\u91cf\u64cd\u4f5c\uff08\u5bf9\u8d44\u6e90\u7684\u8bf7\u6c42\u3001\u6570\u636e\u5e93\u7684\u64cd\u4f5c\u7b49\uff09\u3002 \u9ad8\u5e76\u53d1\u76f8\u5173\u5e38\u7528\u7684\u4e00\u4e9b\u6307\u6807\u6709\uff1a\u54cd\u5e94\u65f6\u95f4\u3001\u541e\u5410\u91cf\u3001\u6bcf\u79d2\u67e5\u8be2\u7387QPS\u3001\u5e76\u53d1\u7528\u6237\u6570\u3002 \u54cd\u5e94\u65f6\u95f4 \uff1a\u7cfb\u7edf\u5bf9\u8bf7\u6c42\u505a\u51fa\u54cd\u5e94\u7684\u65f6\u95f4\u3002\u4f8b\u5982\u7cfb\u7edf\u5904\u7406\u4e00\u4e2ahttp\u8bf7\u6c42\u9700\u8981600ms\uff0c\u8fd9\u4e2a600ms\u5c31\u662f\u7cfb\u7edf\u7684\u54cd\u5e94\u65f6\u95f4\u3002 \u541e\u5410\u91cf \uff1a\u5355\u4f4d\u65f6\u95f4\u5185\u5904\u7406\u7684\u8bf7\u6c42\u6570\u91cf\u3002 QPS \uff1a\u6bcf\u79d2\u54cd\u5e94\u8bf7\u6c42\u6570\u3002 \u5e76\u53d1\u7528\u6237\u6570 \uff1a\u540c\u65f6\u627f\u8f7d\u6b63\u5e38\u4f7f\u7528\u7cfb\u7edf\u529f\u80fd\u7684\u7528\u6237\u6570\u91cf\u3002\u4f8b\u5982\u4e00\u4e2a\u5373\u65f6\u901a\u8baf\u7cfb\u7edf\uff0c\u540c\u65f6\u5728\u7ebf\u7684\u7528\u6237\u91cf\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u4ee3\u8868\u4e86\u7cfb\u7edf\u7684\u5e76\u53d1\u7528\u6237\u6570\u3002 \u7b80\u5355\u6765\u8bf4\uff0c\u9ad8\u5e76\u53d1\u7684\u57fa\u672c\u8868\u73b0\u5c31\u662f\u7cfb\u7edf\u5728\u5355\u4f4d\u65f6\u95f4\u5185\u80fd\u591f\u540c\u65f6\u5904\u7406\u7684\u8bf7\u6c42\u6570\u3002\u9ad8\u5e76\u53d1\u6ca1\u6709\u5177\u4f53\u7684\u8303\u56f4\u89c4\u5b9a\u591a\u5c11\u5e76\u53d1\u7b97\u662f\u9ad8\u5e76\u53d1\uff0c\u6bd4\u5982\u4f60\u5f00\u53d1\u7684\u7cfb\u7edf\u6700\u5927\u5e76\u53d1\u662f1000\uff0c\u90a3\u4e48\u6765\u4e861001\u7684\u5e76\u53d1\u91cf\u5bf9\u4f60\u6765\u8bf4\u5c31\u662f\u9ad8\u5e76\u53d1\uff0c\u4f46\u662f\u8fd9\u4e2a\u5e76\u53d1\u91cf\u653e\u5728\u6dd8\u5b9d\u4e0a\uff0c\u7b80\u76f4\u4ec0\u4e48\u90fd\u7b97\u4e0d\u4e0a\u3002 \u5982\u679c\u9ad8\u5e76\u53d1\u5904\u7406\u4e0d\u597d\uff0c\u4e0d\u4ec5\u4f1a\u964d\u4f4e\u7528\u6237\u7684\u4f53\u9a8c\u5ea6(\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u8fc7\u957f\u7b49)\uff0c\u540c\u65f6\u53ef\u80fd\u5bfc\u81f4\u7cfb\u7edf\u5b95\u673a\u3001\u505c\u6b62\u5de5\u4f5c\u7b49\u3002","title":"\u9ad8\u5e76\u53d1"},{"location":"cs/db/mysql/#_23","text":"\u5927\u5bb6\u90fd\u77e5\u9053MySQL\u52a0\u4e0aRedis\u662f\u4e00\u5bf9\u513f\u7ecf\u5178\u7684\u7ec4\u5408\u3002\u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u4e3aMySQL\u6321\u4f4f\u5927\u90e8\u5206\u67e5\u8be2\u8bf7\u6c42\uff0c\u53ef\u4ee5\u5f88\u5927\u7a0b\u5ea6\u4e0a\u7f13\u89e3MySQL\u5e76\u53d1\u8bf7\u6c42\u7684\u538b\u529b\u3002Redis\u662f\u4e00\u4e2a\u4f7f\u7528\u5185\u5b58\u4fdd\u5b58\u6570\u636e\u7684\u9ad8\u6027\u80fdK-V\u6570\u636e\u5e93\uff0c\u5b83\u7684\u9ad8\u6027\u80fd\u4e3b\u8981\u6765\u81ea\u4e8e\uff1a \u7b80\u5355\u7684\u6570\u636e\u7ed3\u6784 \u548c \u4f7f\u7528\u5185\u5b58\u5b58\u50a8\u6570\u636e \u3002\u4f46\u662f\u6211\u4eec\u9700\u8981\u77e5\u9053\u7684\u662f\u5185\u5b58\u672c\u8eab\u5c31\u662f\u4e00\u79cd\u6613\u5931\u6027\u5b58\u50a8\uff0c\u6240\u4ee5\u4f7f\u7528Redis\u4e0d\u80fd\u4fdd\u8bc1\u6570\u636e\u53ef\u9760\u5b58\u50a8\u3002\u4ece\u8bbe\u8ba1\u4e0a\u6765\u8bf4\uff0cRedis\u727a\u7272\u4e86\u6570\u636e\u53ef\u9760\u6027\uff0c\u6362\u53d6\u4e86\u9ad8\u6027\u80fd\u3002\u4f46\u4e5f\u6b63\u662f\u8fd9\u4e9b\u7279\u6027\uff0c\u4f7f\u5f97Redis\u7279\u522b\u9002\u5408\u7528\u6765\u505aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\u3002 \u5373\u4f7f\u53ea\u662f\u628aRedis\u4f5c\u4e3a\u7f13\u5b58\u6765\u4f7f\u7528\uff0c\u6211\u4eec\u5728\u8bbe\u8ba1Redis\u7f13\u5b58\u7684\u65f6\u5019\uff0c\u4e5f\u5fc5\u987b\u8981\u8003\u8651Redis\u7684\u8fd9\u79cd \u6570\u636e\u4e0d\u53ef\u9760\u6027 \uff0c\u6216\u8005\u6362\u53e5\u8bdd\u8bf4\uff0c\u6211\u4eec\u7684\u7cfb\u7edf\u5728\u4f7f\u7528Redis\u7684\u65f6\u5019\uff0c\u8981\u80fd\u517c\u5bb9Redis\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u505a\u5230\u5373\u4f7fRedis\u53d1\u751f\u4e86\u4e22\u6570\u636e\u7684\u60c5\u51b5\uff0c\u4e5f\u4e0d\u5f71\u54cd\u7cfb\u7edf\u7684\u6570\u636e\u51c6\u786e\u6027\u3002 \u5173\u4e8e\u7f13\u5b58\u66f4\u65b0\u7b56\u7565\uff0c\u4f7f\u7528\u7684\u591a\u7684\u4e5f\u5c31\u662f Read/Write Through\u6a21\u5f0f \u548c Cache Aside\u6a21\u5f0f \uff0c Read/Write Through\u6a21\u5f0f \u5728\u67e5\u8be2\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u7f13\u5b58\u4e2d\u67e5\u8be2\uff0c\u5982\u679c\u547d\u4e2d\u7f13\u5b58\u90a3\u5c31\u76f4\u63a5\u8fd4\u56de\u6570\u636e\uff1b\u5982\u679c\u6ca1\u6709\u547d\u4e2d\uff0c\u90a3\u5c31\u53bb\u6570\u636e\u5e93\u4e2d\u67e5\u8be2\uff0c\u5f97\u5230\u67e5\u8be2\u7ed3\u679c\u4e4b\u540e\u628a\u6570\u636e\u5199\u5165\u7f13\u5b58\uff0c\u7136\u540e\u8fd4\u56de\u3002\u5728\u66f4\u65b0\u6570\u636e\u7684\u65f6\u5019\uff0c\u5148\u53bb\u66f4\u65b0\u6570\u636e\u5e93\uff0c\u5982\u679c\u66f4\u65b0\u6210\u529f\uff0c\u518d\u53bb\u66f4\u65b0\u7f13\u5b58\u4e2d\u7684\u6570\u636e\u3002","title":"\u4f7f\u7528\u7f13\u5b58"},{"location":"cs/db/mysql/#_24","text":"\u4f7f\u7528Redis\u4f5c\u4e3aMySQL\u7684\u524d\u7f6e\u7f13\u5b58\uff0c\u53ef\u4ee5\u975e\u5e38\u6709\u6548\u5730\u63d0\u5347\u7cfb\u7edf\u5904\u7406\u9ad8\u5e76\u53d1\u7684\u80fd\u529b\uff0c\u964d\u4f4e\u8bf7\u6c42\u54cd\u5e94\u65f6\u95f4\u3002\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u4f7f\u7528Cache Aside\u6a21\u5f0f\u6765\u66f4\u65b0\u7f13\u5b58\u90fd\u662f\u6700\u4f73\u7684\u9009\u62e9\uff0c\u76f8\u6bd4Read/Write Through\u6a21\u5f0f\u66f4\u7b80\u5355\uff0c\u8fd8\u80fd\u5927\u5e45\u964d\u4f4e\u810f\u6570\u636e\u7684\u53ef\u80fd\u6027\u3002\u7279\u522b\u6ce8\u610f\u7684\u662f\uff0c\u5927\u91cf\u7f13\u5b58\u7a7f\u900f\u5f15\u8d77\u96ea\u5d29\u7684\u95ee\u9898\uff0c\u4f60\u9700\u8981\u9488\u5bf9\u5177\u4f53\u4e1a\u52a1\u573a\u666f\u6765\u9009\u62e9\u5408\u9002\u89e3\u51b3\u65b9\u6848\u3002","title":"\u603b\u7ed3"},{"location":"cs/db/mysql/#reidskv","text":"","title":"reids\u9047\u5230\u5927KV"},{"location":"cs/db/mysql/#_25","text":"\u8df3\u8868\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u5c31\u662f\u7ed9\u94fe\u8868\u52a0\u7d22\u5f15\uff0c\u5f53\u7ed3\u70b9\u6570\u91cf\u591a\u7684\u65f6\u5019\uff0c\u8fd9\u79cd\u6dfb\u52a0\u7d22\u5f15\u7684\u65b9\u5f0f\uff0c\u4f1a\u4f7f\u67e5\u8be2\u6548\u7387\u63d0\u9ad8\u7684\u975e\u5e38\u660e\u663e\u3002 \u8df3\u8868\u8fd9\u4e2a\u52a8\u6001\u6570\u636e\u7ed3\u6784\uff0c\u4e0d\u4ec5\u652f\u6301\u67e5\u627e\u64cd\u4f5c\uff0c\u8fd8\u652f\u6301\u52a8\u6001\u7684\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\uff0c\u800c\u4e14\u63d2\u5165\u3001\u5220\u9664\u64cd\u4f5c\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \\(O(logn)\\) \u3002 \u5bf9\u4e8e\u5355\u7eaf\u7684\u5355\u94fe\u8868\uff0c\u9700\u8981\u904d\u5386\u6bcf\u4e2a\u7ed3\u70b9\u6765\u627e\u5230\u63d2\u5165\u7684\u4f4d\u7f6e\u3002\u4f46\u662f\u5bf9\u4e8e\u8df3\u8868\u6765\u8bf4\uff0c\u56e0\u4e3a\u5176\u67e5\u627e\u67d0\u4e2a\u7ed3\u70b9\u7684\u65f6\u95f4\u590d\u6742\u5ea6\u662f \\(O(logn)\\) \uff0c\u6240\u4ee5\u8fd9\u91cc\u67e5\u627e\u67d0\u4e2a\u6570\u636e\u5e94\u8be5\u63d2\u5165\u7684\u4f4d\u7f6e\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u4e5f\u662f \u25cb(\u33d2n)\u3002","title":"\u8df3\u8868"},{"location":"cs/db/mysql/#redisb","text":"redis \u4f7f\u7528\u8df3\u8868\u4e0d\u7528 B + \u6570\u7684\u539f\u56e0\u662f\uff1aredis \u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u800c B + \u6811\u7eaf\u7cb9\u662f\u4e3a\u4e86 mysql \u8fd9\u79cd IO \u6570\u636e\u5e93\u51c6\u5907\u7684\u3002B + \u6811\u7684\u6bcf\u4e2a\u8282\u70b9\u7684\u6570\u91cf\u90fd\u662f\u4e00\u4e2a mysql \u5206\u533a\u9875\u7684\u5927\u5c0f Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u662f\u901a\u8fc7\u8df3\u8868\u6765\u5b9e\u73b0\u7684\uff0c\u4e25\u683c\u70b9\u8bb2\uff0c\u8fd8\u7528\u5230\u4e86\u6563\u5217\u8868\uff08\u5173\u4e8e\u6563\u5217\u8868\uff09\uff0c\u5982\u679c\u67e5\u770b Redis \u5f00\u53d1\u624b\u518c\uff0c\u4f1a\u53d1\u73b0 Redis \u4e2d\u7684\u6709\u5e8f\u96c6\u5408\u652f\u6301\u7684\u6838\u5fc3\u64cd\u4f5c\u4e3b\u8981\u6709\u4e0b\u9762\u8fd9\u51e0\u4e2a\uff1a \u63d2\u5165\u4e00\u4e2a\u6570\u636e \u5220\u9664\u4e00\u4e2a\u6570\u636e \u67e5\u627e\u4e00\u4e2a\u6570\u636e \u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\uff08\u6bd4\u5982\u67e5\u627e\u5728 [100,356] \u4e4b\u95f4\u7684\u6570\u636e\uff09 \u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217 \u5176\u4e2d\uff0c\u63d2\u5165\u3001\u67e5\u627e\u3001\u5220\u9664\u4ee5\u53ca\u8fed\u4ee3\u8f93\u51fa\u6709\u5e8f\u5e8f\u5217\u8fd9\u51e0\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u4e5f\u80fd\u5b8c\u6210\uff0c\u65f6\u95f4\u590d\u6742\u5ea6\u548c\u8df3\u8868\u662f\u4e00\u6837\u7684\uff0c\u4f46\u662f\uff0c\u6309\u7167\u533a\u95f4\u6765\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u7ea2\u9ed1\u6811\u7684\u6548\u7387\u6ca1\u6709\u8df3\u8868\u9ad8\u3002 \u5bf9\u4e8e\u6309\u7167\u533a\u95f4\u67e5\u627e\u6570\u636e\u8fd9\u4e2a\u64cd\u4f5c\uff0c\u8df3\u8868\u53ef\u4ee5\u505a\u5230 \\(O(logn)\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u5b9a\u4f4d\u533a\u95f4\u7684\u8d77\u70b9\uff0c\u7136\u540e\u5728\u539f\u59cb\u94fe\u8868\u4e2d\u987a\u5e8f\u5f80\u540e\u904d\u5386\u5c31\u53ef\u4ee5\u4e86\u3002\u8fd9\u6837\u505a\u975e\u5e38\u9ad8\u6548\u3002 \u5f53\u7136\uff0c\u8fd8\u6709\u5176\u4ed6\u539f\u56e0\uff0c\u6bd4\u5982\uff0c\u8df3\u8868\u4ee3\u7801\u66f4\u5bb9\u6613\u5b9e\u73b0\uff0c\u53ef\u8bfb\u6027\u597d\u4e0d\u6613\u51fa\u9519\u3002\u8df3\u8868\u66f4\u52a0\u7075\u6d3b\uff0c\u53ef\u4ee5\u901a\u8fc7\u6539\u53d8\u7d22\u5f15\u6784\u5efa\u7b56\u7565\uff0c\u6709\u6548\u5e73\u8861\u6267\u884c\u6548\u7387\u548c\u5185\u5b58\u6d88\u8017\u3002","title":"Redis\u9009\u4e2d\u8df3\u8868\u800c\u4e0d\u4f7f\u7528B+\u6811"},{"location":"cs/db/mysql/#8","text":"SELECT g1 . stu_id , g1 . class_id , g1 . gender , g1 . math_score FROM grade g1 WHERE g1 . gender = 'm' AND EXISTS ( SELECT count ( * ) FROM grade g2 WHERE g2 . gender = 'm' AND g2 . math_score >= g1 . math_score AND g2 . class_id = g1 . class_id GROUP BY g2 . class_id HAVING count ( * ) <= 3 ) ORDER BY class_id , math_score DESC","title":"\u603b\u51718\u4e2a\u73ed\u7ea7\u3001\u8f93\u51fa\u6bcf\u4e2a\u73ed\u7ea7\u7537\u751f\u7684\u6570\u5b66\u524d\u4e09\u540d\u548c\u5973\u751f\u7684\u8bed\u6587\u524d\u4e09\u540d"},{"location":"cs/db/redis/cjh/","text":"Redis \u6301\u4e45\u5316 \u00b6 \u7b80\u4ecb \u00b6 \u7531\u4e8eredis\u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u5176\u6570\u636e\u65ad\u7535\u6613\u5931\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u6570\u636e\u4fdd\u5b58\u5230\u78c1\u76d8\u4e2d\u3002redis\u6709\u4e24\u79cd\u6301\u4e45\u5316\u89e3\u51b3\u65b9\u6848\uff0c\u5206\u522b\u662f\uff1aRDB\uff0cAOF\u3002 \u5feb\u7167(Snapshot) / RDB \u00b6 \u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u67d0\u4e00\u65f6\u523b\u7684\u6240\u6709\u6570\u636e\u90fd\u5199\u5165\u786c\u76d8\u4e2d,\u5f53\u7136\u8fd9\u4e5f\u662fredis\u7684\u9ed8\u8ba4\u5f00\u542f\u6301\u4e45\u5316\u65b9\u5f0f,\u4fdd\u5b58\u7684\u6587\u4ef6\u662f\u4ee5.rdb\u5f62\u5f0f\u7ed3\u5c3e\u7684\u6587\u4ef6\u56e0\u6b64\u8fd9\u79cd\u65b9\u5f0f\u4e5f\u79f0\u4e4b\u4e3aRDB\u65b9\u5f0f\u3002 \u5728\u6307\u5b9a\u65f6\u95f4\u95f4\u9694\u540e\uff0c\u5c06\u5185\u5b58\u4e2d\u7684\u6570\u636e\u96c6\u5feb\u7167\u5199\u5165\u6570\u636e\u5e93 \uff1b\u5728\u6062\u590d\u65f6\u5019\uff0c\u76f4\u63a5\u8bfb\u53d6\u5feb\u7167\u6587\u4ef6\uff0c\u8fdb\u884c\u6570\u636e\u7684\u6062\u590d \uff1b \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c Redis \u5c06\u6570\u636e\u5e93\u5feb\u7167\u4fdd\u5b58\u5728\u540d\u5b57\u4e3a dump.rdb \u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u3002\u6587\u4ef6\u540d\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002 RDB\u6301\u4e45\u5316\u7684\u5927\u81f4\u8fc7\u7a0b \u00b6 \u5728\u8fdb\u884c RDB \u7684\u65f6\u5019\uff0credis \u7684\u4e3b\u7ebf\u7a0b\u662f\u4e0d\u4f1a\u505a io \u64cd\u4f5c\u7684\uff0c\u4e3b\u7ebf\u7a0b\u4f1a fork \u4e00\u4e2a\u5b50\u7ebf\u7a0b\u6765\u5b8c\u6210\u8be5\u64cd\u4f5c\uff1b Redis \u8c03\u7528forks\u3002\u540c\u65f6\u62e5\u6709\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u3002 \u5b50\u8fdb\u7a0b\u5c06\u6570\u636e\u96c6\u5199\u5165\u5230\u4e00\u4e2a\u4e34\u65f6 RDB \u6587\u4ef6\u4e2d\u3002 \u5f53\u5b50\u8fdb\u7a0b\u5b8c\u6210\u5bf9\u65b0 RDB \u6587\u4ef6\u7684\u5199\u5165\u65f6\uff0cRedis \u7528\u65b0 RDB \u6587\u4ef6\u66ff\u6362\u539f\u6765\u7684 RDB \u6587\u4ef6\uff0c\u5e76\u5220\u9664\u65e7\u7684 RDB \u6587\u4ef6\u3002 \u8fd9\u79cd\u5de5\u4f5c\u65b9\u5f0f\u4f7f\u5f97 Redis \u53ef\u4ee5\u4ece\u5199\u65f6\u590d\u5236\uff08copy-on-write\uff09\u673a\u5236\u4e2d\u83b7\u76ca(\u56e0\u4e3a\u662f\u4f7f\u7528\u5b50\u8fdb\u7a0b\u8fdb\u884c\u5199\u64cd\u4f5c\uff0c\u800c\u7236\u8fdb\u7a0b\u4f9d\u7136\u53ef\u4ee5\u63a5\u6536\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002) bgsave\uff1a \u00b6 \u5ba2\u6237\u7aef\u53ef\u4ee5\u4f7f\u7528BGSAVE\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u5feb\u7167,\u5f53\u63a5\u6536\u5230\u5ba2\u6237\u7aef\u7684BGSAVE\u547d\u4ee4\u65f6,redis\u4f1a\u8c03\u7528fork\u6765\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b,\u7136\u540e\u5b50\u8fdb\u7a0b\u8d1f\u8d23\u5c06\u5feb\u7167\u5199\u5165\u78c1\u76d8\u4e2d,\u800c\u7236\u8fdb\u7a0b\u5219\u7ee7\u7eed\u5904\u7406\u547d\u4ee4\u8bf7\u6c42\u3002 bgsave \u662f\u5f02\u6b65\u8fdb\u884c\uff0c\u8fdb\u884c\u6301\u4e45\u5316\u7684\u65f6\u5019\uff0credis \u8fd8\u53ef\u4ee5\u5c06\u7ee7\u7eed\u54cd\u5e94\u5ba2\u6237\u7aef\u8bf7\u6c42 \uff1b save\uff1a \u00b6 \u4f7f\u7528 save \u547d\u4ee4\uff0c\u4f1a\u7acb\u523b\u5bf9\u5f53\u524d\u5185\u5b58\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6301\u4e45\u5316 ,\u4f46\u662f\u4f1a\u963b\u585e\uff0c\u4e5f\u5c31\u662f\u4e0d\u63a5\u53d7\u5176\u4ed6\u64cd\u4f5c\u4e86\uff1b \u7531\u4e8e save \u547d\u4ee4\u662f\u540c\u6b65\u547d\u4ee4\uff0c\u4f1a\u5360\u7528Redis\u7684\u4e3b\u8fdb\u7a0b\u3002\u82e5Redis\u6570\u636e\u975e\u5e38\u591a\u65f6\uff0csave\u547d\u4ee4\u6267\u884c\u901f\u5ea6\u4f1a\u975e\u5e38\u6162\uff0c\u963b\u585e\u6240\u6709\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002 shutdown\uff1a \u00b6 \u5f53redis\u901a\u8fc7shutdown\u6307\u4ee4\u63a5\u6536\u5230\u5173\u95ed\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u65f6,\u4f1a\u6267\u884c\u4e00\u4e2asave\u547d\u4ee4,\u963b\u585e\u6240\u6709\u7684\u5ba2\u6237\u7aef,\u4e0d\u518d\u6267\u884c\u5ba2\u6237\u7aef\u6267\u884c\u53d1\u9001\u7684\u4efb\u4f55\u547d\u4ee4,\u5e76\u4e14\u5728save\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\u4e4b\u540e\u5173\u95ed\u670d\u52a1\u5668 \u6ce8\u610f: \u00b6 SAVE\u547d\u4ee4\u5e76\u4e0d\u5e38\u7528,\u4f7f\u7528SAVE\u547d\u4ee4\u5728\u5feb\u7167\u521b\u5efa\u5b8c\u6bd5\u4e4b\u524d,redis\u5904\u4e8e\u963b\u585e\u72b6\u6001,\u65e0\u6cd5\u5bf9\u5916\u670d\u52a1 \u5982\u679c\u7528\u6237\u5728redis.conf\u4e2d\u8bbe\u7f6e\u4e86save\u914d\u7f6e\u9009\u9879,redis\u4f1a\u5728save\u9009\u9879\u6761\u4ef6\u6ee1\u8db3\u4e4b\u540e\u81ea\u52a8\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4,\u5982\u679c\u8bbe\u7f6e\u591a\u4e2asave\u914d\u7f6e\u9009\u9879,\u5f53\u4efb\u610f\u4e00\u4e2asave\u914d\u7f6e\u9009\u9879\u6761\u4ef6\u6ee1\u8db3,redis\u4e5f\u4f1a\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4 \u4f18\u70b9 \u00b6 RDB\u6587\u4ef6\u7d27\u51d1\uff0c\u5168\u91cf\u5907\u4efd\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u8fdb\u884c\u5907\u4efd\u548c\u707e\u96be\u6062\u590d\u3002 \u751f\u6210RDB\u6587\u4ef6\u7684\u65f6\u5019\uff0credis\u4e3b\u8fdb\u7a0b\u4f1afork()\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u6765\u5904\u7406\u6240\u6709\u4fdd\u5b58\u5de5\u4f5c\uff0c\u4e3b\u8fdb\u7a0b\u4e0d\u9700\u8981\u8fdb\u884c\u4efb\u4f55\u78c1\u76d8IO\u64cd\u4f5c\u3002 RDB \u5728\u6062\u590d\u5927\u6570\u636e\u96c6\u65f6\u7684\u901f\u5ea6\u6bd4 AOF \u7684\u6062\u590d\u901f\u5ea6\u8981\u5feb\u3002 \u7f3a\u70b9 \u00b6 \u9700\u8981\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fdb\u7a0b\u64cd\u4f5c\uff01\u5982\u679credis\u610f\u5916\u5b95\u673a\u4e86\uff0c\u8fd9\u4e2a\u6700\u540e\u4e00\u6b21\u4fee\u6539\u6570\u636e\u5c31\u6ca1\u6709\u7684\u4e86\uff01 fork\u8fdb\u7a0b\u7684\u65f6\u5019\uff0c\u4f1a\u5360\u7528\u4e00\u5b9a\u7684\u5185\u5bb9\u7a7a\u95f4\uff01\uff01 RDB\u89e6\u53d1\u673a\u5236 \u00b6 save\u7684\u89c4\u5219\u6ee1\u8db3\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u89e6\u53d1rdb\u89c4\u5219 \u6267\u884c flushall \u547d\u4ee4\uff0c\u4e5f\u4f1a\u89e6\u53d1\u6211\u4eec\u7684rdb\u89c4\u5219\uff01 \u9000\u51faredis\uff0c\u4e5f\u4f1a\u4ea7\u751f rdb \u6587\u4ef6\uff01 \u914d\u7f6e\u751f\u6210\u5feb\u7167\u540d\u79f0\u548c\u4f4d\u7f6e \u00b6 \u4fee\u6539\u751f\u6210\u5feb\u7167\u540d\u79f0 dbfilename dump.rdb \u4fee\u6539\u751f\u6210\u4f4d\u7f6e dir ./ \u6062\u590drdb\u6587\u4ef6 \u00b6 \u53ea\u9700\u8981\u5c06rdb\u6587\u4ef6\u653e\u5728redis\u542f\u52a8\u76ee\u5f55\u4e2d\uff0credis\u542f\u52a8\u65f6\u81ea\u52a8\u68c0\u67e5dump.rdb\u6062\u590d\u5176\u4e2d\u7684\u6570\u636e\u3002 \u67e5\u770b\u5176\u5b58\u5728\u7684\u4f4d\u7f6e \u5982\u679c/var/lib/redis\u8fd9\u4e2a\u76ee\u5f55\u5b58\u5728dump.rdb\u6587\u4ef6\uff0c\u5219\u542f\u52a8\u65f6\u81ea\u52a8\u6062\u590d\u6570\u636e\u3002 AOF \u00b6 Append Only File \u5c06\u6211\u4eec\u6240\u6709\u7684\u547d\u4ee4\u90fd\u8bb0\u5f55\u4e0b\u6765\uff0chistory\uff0c\u6062\u590d\u7684\u65f6\u5019\u5c31\u628a\u8fd9\u4e2a\u6587\u4ef6\u5168\u90e8\u518d\u6267\u884c\u4e00\u904d \u4ec0\u4e48\u662fAOF \u00b6 \u5feb\u7167\u529f\u80fd\uff08RDB\uff09\u5e76\u4e0d\u662f\u975e\u5e38\u8010\u4e45\uff08durable\uff09\uff1a \u5982\u679c Redis \u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u800c\u9020\u6210\u6545\u969c\u505c\u673a\uff0c \u90a3\u4e48\u670d\u52a1\u5668\u5c06\u4e22\u5931\u6700\u8fd1\u5199\u5165\u3001\u4ee5\u53ca\u672a\u4fdd\u5b58\u5230\u5feb\u7167\u4e2d\u7684\u90a3\u4e9b\u6570\u636e\u3002 \u4ece 1.1 \u7248\u672c\u5f00\u59cb\uff0c Redis \u589e\u52a0\u4e86\u4e00\u79cd\u5b8c\u5168\u8010\u4e45\u7684\u6301\u4e45\u5316\u65b9\u5f0f\uff1a AOF \u6301\u4e45\u5316\u3002 \u7279\u70b9 \u00b6 \u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u6240\u6709\u5ba2\u6237\u7aef\u6267\u884c\u7684\u5199\u547d\u4ee4\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d,AOF\u6301\u4e45\u5316\u4f1a\u5c06\u88ab\u6267\u884c\u7684\u5199\u547d\u4ee4\u5199\u5230AOF\u7684\u6587\u4ef6\u672b\u5c3e,\u4ee5\u6b64\u6765\u8bb0\u5f55\u6570\u636e\u53d1\u751f\u7684\u53d8\u5316,\u56e0\u6b64\u53ea\u8981redis\u4ece\u5934\u5230\u5c3e\u6267\u884c\u4e00\u6b21AOF\u6587\u4ef6\u6240\u5305\u542b\u7684\u6240\u6709\u5199\u547d\u4ee4,\u5c31\u53ef\u4ee5\u6062\u590dAOF\u6587\u4ef6\u7684\u8bb0\u5f55\u7684\u6570\u636e\u96c6. \u5f00\u542fAOF\u6301\u4e45\u5316 \u00b6 \u5728redis\u7684\u9ed8\u8ba4\u914d\u7f6e\u4e2dAOF\u6301\u4e45\u5316\u673a\u5236\u662f\u6ca1\u6709\u5f00\u542f\u7684\uff0c\u9700\u8981\u5728\u914d\u7f6e\u4e2d\u5f00\u542f appendonly no yes\u5219\u8868\u793a\u542f\u7528AOF \u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u914d\u7f6e\uff0c\u7136\u540e\u91cd\u542fredis\uff0c\u5c31\u53ef\u4ee5\u751f\u6548\u4e86\uff01 \u5982\u679c\u8fd9\u4e2aaof\u6587\u4ef6\u6709\u9519\u4f4d\uff0c\u8fd9\u65f6\u5019redis\u662f\u542f\u52a8\u4e0d\u8d77\u6765\u7684\uff0c\u6211\u9700\u8981\u4fee\u6539\u8fd9\u4e2aaof\u6587\u4ef6 redis\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5de5\u5177redis-check-aof --fix \u65e5\u5fd7\u8ffd\u52a0\u9891\u7387 \u00b6 \u4fee\u6539\u65e5\u5fd7\u540c\u6b65\u9891\u7387 - \u4fee\u6539appendfsync everysec | always | no \u6307\u5b9a AOF\u6587\u4ef6\u7684\u91cd\u5199 \u00b6 AOF\u5e26\u6765\u7684\u95ee\u9898 \u00b6 AOF\u7684\u65b9\u5f0f\u4e5f\u540c\u65f6\u5e26\u6765\u4e86\u53e6\u4e00\u4e2a\u95ee\u9898\u3002\u6301\u4e45\u5316\u6587\u4ef6\u4f1a\u53d8\u7684\u8d8a\u6765\u8d8a\u5927\u3002\u4f8b\u5982\u6211\u4eec\u8c03\u7528incr test\u547d\u4ee4100\u6b21\uff0c\u6587\u4ef6\u4e2d\u5fc5\u987b\u4fdd\u5b58\u5168\u90e8\u7684100\u6761\u547d\u4ee4\uff0c\u5176\u5b9e\u670999\u6761\u90fd\u662f\u591a\u4f59\u7684\u3002\u56e0\u4e3a\u8981\u6062\u590d\u6570\u636e\u5e93\u7684\u72b6\u6001\u5176\u5b9e\u6587\u4ef6\u4e2d\u4fdd\u5b58\u4e00\u6761set test 100\u5c31\u591f\u4e86\u3002\u4e3a\u4e86\u538b\u7f29aof\u7684\u6301\u4e45\u5316\u6587\u4ef6Redis\u63d0\u4f9b\u4e86AOF\u91cd\u5199(ReWriter)\u673a\u5236\u3002 AOF\u91cd\u5199 \u00b6 \u7528\u6765\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u51cf\u5c0fAOF\u6587\u4ef6\u7684\u4f53\u79ef \u89e6\u53d1\u673a\u5236 \u00b6 # 1.\u5ba2\u6237\u7aef\u65b9\u5f0f\u89e6\u53d1\u91cd\u5199 - \u6267\u884cBGREWRITEAOF\u547d\u4ee4 \u4e0d\u4f1a\u963b\u585eredis\u7684\u670d\u52a1 # 2.\u670d\u52a1\u5668\u914d\u7f6e\u65b9\u5f0f\u81ea\u52a8\u89e6\u53d1 - \u914d\u7f6eredis.conf\u4e2d\u7684auto-aof-rewrite-percentage\u9009\u9879 \u53c2\u52a0\u4e0b\u56fe\u2193\u2193\u2193 - \u5982\u679c\u8bbe\u7f6eauto-aof-rewrite-percentage\u503c\u4e3a100\u548cauto-aof-rewrite-min-size 64mb,\u5e76\u4e14\u542f\u7528\u7684AOF\u6301\u4e45\u5316\u65f6,\u90a3\u4e48\u5f53AOF\u6587\u4ef6\u4f53\u79ef\u5927\u4e8e64M,\u5e76\u4e14AOF\u6587\u4ef6\u7684\u4f53\u79ef\u6bd4\u4e0a\u4e00\u6b21\u91cd\u5199\u4e4b\u540e\u4f53\u79ef\u5927\u4e86\u81f3\u5c11\u4e00\u500d ( 100 % ) \u65f6,\u4f1a\u81ea\u52a8\u89e6\u53d1,\u5982\u679c\u91cd\u5199\u8fc7\u4e8e\u9891\u7e41,\u7528\u6237\u53ef\u4ee5\u8003\u8651\u5c06auto-aof-rewrite-percentage\u8bbe\u7f6e\u4e3a\u66f4\u5927 \u91cd\u5199\u539f\u7406 \u00b6 \u6ce8\u610f\uff1a\u91cd\u5199aof\u6587\u4ef6\u7684\u64cd\u4f5c\uff0c\u5e76\u6ca1\u6709\u8bfb\u53d6\u65e7\u7684aof\u6587\u4ef6\uff0c\u800c\u662f\u5c06\u6574\u4e2a\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5185\u5bb9\u7528\u547d\u4ee4\u7684\u65b9\u5f0f\u91cd\u5199\u4e86\u4e00\u4e2a\u65b0\u7684aof\u6587\u4ef6,\u66ff\u6362\u539f\u6709\u7684\u6587\u4ef6\u8fd9\u70b9\u548c\u5feb\u7167\u6709\u70b9\u7c7b\u4f3c\u3002 # \u91cd\u5199\u6d41\u7a0b - 1 . redis\u8c03\u7528fork \uff0c\u73b0\u5728\u6709\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b \u5b50\u8fdb\u7a0b\u6839\u636e\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5feb\u7167\uff0c\u5f80\u4e34\u65f6\u6587\u4ef6\u4e2d\u5199\u5165\u91cd\u5efa\u6570\u636e\u5e93\u72b6\u6001\u7684\u547d\u4ee4 - 2 . \u7236\u8fdb\u7a0b\u7ee7\u7eed\u5904\u7406client\u8bf7\u6c42\uff0c\u9664\u4e86\u628a\u5199\u547d\u4ee4\u5199\u5165\u5230\u539f\u6765\u7684aof\u6587\u4ef6\u4e2d\u3002\u540c\u65f6\u628a\u6536\u5230\u7684\u5199\u547d\u4ee4\u7f13\u5b58\u8d77\u6765\u3002\u8fd9\u6837\u5c31\u80fd\u4fdd\u8bc1\u5982\u679c\u5b50\u8fdb\u7a0b\u91cd\u5199\u5931\u8d25\u7684\u8bdd\u5e76\u4e0d\u4f1a\u51fa\u95ee\u9898\u3002 - 3 . \u5f53\u5b50\u8fdb\u7a0b\u628a\u5feb\u7167\u5185\u5bb9\u5199\u5165\u5df2\u547d\u4ee4\u65b9\u5f0f\u5199\u5230\u4e34\u65f6\u6587\u4ef6\u4e2d\u540e\uff0c\u5b50\u8fdb\u7a0b\u53d1\u4fe1\u53f7\u901a\u77e5\u7236\u8fdb\u7a0b\u3002\u7136\u540e\u7236\u8fdb\u7a0b\u628a\u7f13\u5b58\u7684\u5199\u547d\u4ee4\u4e5f\u5199\u5165\u5230\u4e34\u65f6\u6587\u4ef6\u3002 - 4 . \u73b0\u5728\u7236\u8fdb\u7a0b\u53ef\u4ee5\u4f7f\u7528\u4e34\u65f6\u6587\u4ef6\u66ff\u6362\u8001\u7684aof\u6587\u4ef6\uff0c\u5e76\u91cd\u547d\u540d\uff0c\u540e\u9762\u6536\u5230\u7684\u5199\u547d\u4ee4\u4e5f\u5f00\u59cb\u5f80\u65b0\u7684aof\u6587\u4ef6\u4e2d\u8ffd\u52a0\u3002 \u4f18\u70b9 \u00b6 \u6bcf\u4e00\u6b21\u4fee\u6539\u90fd\u4f1a\u540c\u6b65\uff0c\u6587\u4ef6\u7684\u5b8c\u6574\u6027\u4f1a\u66f4\u52a0\u597d \u6ca1\u79d2\u540c\u6b65\u4e00\u6b21\uff0c\u53ef\u80fd\u4f1a\u4e22\u5931\u4e00\u79d2\u7684\u6570\u636e \u4ece\u4e0d\u540c\u6b65\uff0c\u6548\u7387\u6700\u9ad8 \u7f3a\u70b9 \u00b6 \u76f8\u5bf9\u4e8e\u6570\u636e\u6587\u4ef6\u6765\u8bf4\uff0caof\u8fdc\u8fdc\u5927\u4e8erdb\uff0c\u4fee\u590d\u901f\u5ea6\u6bd4rdb\u6162\uff01 Aof\u8fd0\u884c\u6548\u7387\u4e5f\u8981\u6bd4rdb\u6162\uff0c\u6240\u4ee5\u6211\u4eecredis\u9ed8\u8ba4\u7684\u914d\u7f6e\u5c31\u662frdb\u6301\u4e45\u5316 \u5982\u4f55\u9009\u62e9\u54ea\u79cd\u6301\u4e45\u5316\u65b9\u5f0f \u00b6 \u4e00\u822c\u6765\u8bf4\uff0c \u5982\u679c\u60f3\u8fbe\u5230\u8db3\u4ee5\u5ab2\u7f8e PostgreSQL \u7684\u6570\u636e\u5b89\u5168\u6027\uff0c \u4f60\u5e94\u8be5\u540c\u65f6\u4f7f\u7528\u4e24\u79cd\u6301\u4e45\u5316\u529f\u80fd\u3002 \u5982\u679c\u4f60\u975e\u5e38\u5173\u5fc3\u4f60\u7684\u6570\u636e\uff0c \u4f46\u4ecd\u7136\u53ef\u4ee5\u627f\u53d7\u6570\u5206\u949f\u4ee5\u5185\u7684\u6570\u636e\u4e22\u5931\uff0c \u90a3\u4e48\u4f60\u53ef\u4ee5\u53ea\u4f7f\u7528 RDB \u6301\u4e45\u5316\u3002 \u6709\u5f88\u591a\u7528\u6237\u90fd\u53ea\u4f7f\u7528 AOF \u6301\u4e45\u5316\uff0c \u4f46\u5e76\u4e0d\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\uff1a \u56e0\u4e3a\u5b9a\u65f6\u751f\u6210 RDB \u5feb\u7167\uff08snapshot\uff09\u975e\u5e38\u4fbf\u4e8e\u8fdb\u884c\u6570\u636e\u5e93\u5907\u4efd\uff0c \u5e76\u4e14 RDB \u6062\u590d\u6570\u636e\u96c6\u7684\u901f\u5ea6\u4e5f\u8981\u6bd4 AOF \u6062\u590d\u7684\u901f\u5ea6\u8981\u5feb\u3002","title":"\u6301\u4e45\u5316"},{"location":"cs/db/redis/cjh/#redis","text":"","title":"Redis \u6301\u4e45\u5316"},{"location":"cs/db/redis/cjh/#_1","text":"\u7531\u4e8eredis\u662f\u5185\u5b58\u6570\u636e\u5e93\uff0c\u6240\u4ee5\u5176\u6570\u636e\u65ad\u7535\u6613\u5931\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u6570\u636e\u4fdd\u5b58\u5230\u78c1\u76d8\u4e2d\u3002redis\u6709\u4e24\u79cd\u6301\u4e45\u5316\u89e3\u51b3\u65b9\u6848\uff0c\u5206\u522b\u662f\uff1aRDB\uff0cAOF\u3002","title":"\u7b80\u4ecb"},{"location":"cs/db/redis/cjh/#snapshot-rdb","text":"\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u67d0\u4e00\u65f6\u523b\u7684\u6240\u6709\u6570\u636e\u90fd\u5199\u5165\u786c\u76d8\u4e2d,\u5f53\u7136\u8fd9\u4e5f\u662fredis\u7684\u9ed8\u8ba4\u5f00\u542f\u6301\u4e45\u5316\u65b9\u5f0f,\u4fdd\u5b58\u7684\u6587\u4ef6\u662f\u4ee5.rdb\u5f62\u5f0f\u7ed3\u5c3e\u7684\u6587\u4ef6\u56e0\u6b64\u8fd9\u79cd\u65b9\u5f0f\u4e5f\u79f0\u4e4b\u4e3aRDB\u65b9\u5f0f\u3002 \u5728\u6307\u5b9a\u65f6\u95f4\u95f4\u9694\u540e\uff0c\u5c06\u5185\u5b58\u4e2d\u7684\u6570\u636e\u96c6\u5feb\u7167\u5199\u5165\u6570\u636e\u5e93 \uff1b\u5728\u6062\u590d\u65f6\u5019\uff0c\u76f4\u63a5\u8bfb\u53d6\u5feb\u7167\u6587\u4ef6\uff0c\u8fdb\u884c\u6570\u636e\u7684\u6062\u590d \uff1b \u9ed8\u8ba4\u60c5\u51b5\u4e0b\uff0c Redis \u5c06\u6570\u636e\u5e93\u5feb\u7167\u4fdd\u5b58\u5728\u540d\u5b57\u4e3a dump.rdb \u7684\u4e8c\u8fdb\u5236\u6587\u4ef6\u4e2d\u3002\u6587\u4ef6\u540d\u53ef\u4ee5\u5728\u914d\u7f6e\u6587\u4ef6\u4e2d\u8fdb\u884c\u81ea\u5b9a\u4e49\u3002","title":"\u5feb\u7167(Snapshot) / RDB"},{"location":"cs/db/redis/cjh/#rdb","text":"\u5728\u8fdb\u884c RDB \u7684\u65f6\u5019\uff0credis \u7684\u4e3b\u7ebf\u7a0b\u662f\u4e0d\u4f1a\u505a io \u64cd\u4f5c\u7684\uff0c\u4e3b\u7ebf\u7a0b\u4f1a fork \u4e00\u4e2a\u5b50\u7ebf\u7a0b\u6765\u5b8c\u6210\u8be5\u64cd\u4f5c\uff1b Redis \u8c03\u7528forks\u3002\u540c\u65f6\u62e5\u6709\u7236\u8fdb\u7a0b\u548c\u5b50\u8fdb\u7a0b\u3002 \u5b50\u8fdb\u7a0b\u5c06\u6570\u636e\u96c6\u5199\u5165\u5230\u4e00\u4e2a\u4e34\u65f6 RDB \u6587\u4ef6\u4e2d\u3002 \u5f53\u5b50\u8fdb\u7a0b\u5b8c\u6210\u5bf9\u65b0 RDB \u6587\u4ef6\u7684\u5199\u5165\u65f6\uff0cRedis \u7528\u65b0 RDB \u6587\u4ef6\u66ff\u6362\u539f\u6765\u7684 RDB \u6587\u4ef6\uff0c\u5e76\u5220\u9664\u65e7\u7684 RDB \u6587\u4ef6\u3002 \u8fd9\u79cd\u5de5\u4f5c\u65b9\u5f0f\u4f7f\u5f97 Redis \u53ef\u4ee5\u4ece\u5199\u65f6\u590d\u5236\uff08copy-on-write\uff09\u673a\u5236\u4e2d\u83b7\u76ca(\u56e0\u4e3a\u662f\u4f7f\u7528\u5b50\u8fdb\u7a0b\u8fdb\u884c\u5199\u64cd\u4f5c\uff0c\u800c\u7236\u8fdb\u7a0b\u4f9d\u7136\u53ef\u4ee5\u63a5\u6536\u6765\u81ea\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002)","title":"RDB\u6301\u4e45\u5316\u7684\u5927\u81f4\u8fc7\u7a0b"},{"location":"cs/db/redis/cjh/#bgsave","text":"\u5ba2\u6237\u7aef\u53ef\u4ee5\u4f7f\u7528BGSAVE\u547d\u4ee4\u6765\u521b\u5efa\u4e00\u4e2a\u5feb\u7167,\u5f53\u63a5\u6536\u5230\u5ba2\u6237\u7aef\u7684BGSAVE\u547d\u4ee4\u65f6,redis\u4f1a\u8c03\u7528fork\u6765\u521b\u5efa\u4e00\u4e2a\u5b50\u8fdb\u7a0b,\u7136\u540e\u5b50\u8fdb\u7a0b\u8d1f\u8d23\u5c06\u5feb\u7167\u5199\u5165\u78c1\u76d8\u4e2d,\u800c\u7236\u8fdb\u7a0b\u5219\u7ee7\u7eed\u5904\u7406\u547d\u4ee4\u8bf7\u6c42\u3002 bgsave \u662f\u5f02\u6b65\u8fdb\u884c\uff0c\u8fdb\u884c\u6301\u4e45\u5316\u7684\u65f6\u5019\uff0credis \u8fd8\u53ef\u4ee5\u5c06\u7ee7\u7eed\u54cd\u5e94\u5ba2\u6237\u7aef\u8bf7\u6c42 \uff1b","title":"bgsave\uff1a"},{"location":"cs/db/redis/cjh/#save","text":"\u4f7f\u7528 save \u547d\u4ee4\uff0c\u4f1a\u7acb\u523b\u5bf9\u5f53\u524d\u5185\u5b58\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u6301\u4e45\u5316 ,\u4f46\u662f\u4f1a\u963b\u585e\uff0c\u4e5f\u5c31\u662f\u4e0d\u63a5\u53d7\u5176\u4ed6\u64cd\u4f5c\u4e86\uff1b \u7531\u4e8e save \u547d\u4ee4\u662f\u540c\u6b65\u547d\u4ee4\uff0c\u4f1a\u5360\u7528Redis\u7684\u4e3b\u8fdb\u7a0b\u3002\u82e5Redis\u6570\u636e\u975e\u5e38\u591a\u65f6\uff0csave\u547d\u4ee4\u6267\u884c\u901f\u5ea6\u4f1a\u975e\u5e38\u6162\uff0c\u963b\u585e\u6240\u6709\u5ba2\u6237\u7aef\u7684\u8bf7\u6c42\u3002","title":"save\uff1a"},{"location":"cs/db/redis/cjh/#shutdown","text":"\u5f53redis\u901a\u8fc7shutdown\u6307\u4ee4\u63a5\u6536\u5230\u5173\u95ed\u670d\u52a1\u5668\u7684\u8bf7\u6c42\u65f6,\u4f1a\u6267\u884c\u4e00\u4e2asave\u547d\u4ee4,\u963b\u585e\u6240\u6709\u7684\u5ba2\u6237\u7aef,\u4e0d\u518d\u6267\u884c\u5ba2\u6237\u7aef\u6267\u884c\u53d1\u9001\u7684\u4efb\u4f55\u547d\u4ee4,\u5e76\u4e14\u5728save\u547d\u4ee4\u6267\u884c\u5b8c\u6bd5\u4e4b\u540e\u5173\u95ed\u670d\u52a1\u5668","title":"shutdown\uff1a"},{"location":"cs/db/redis/cjh/#_2","text":"SAVE\u547d\u4ee4\u5e76\u4e0d\u5e38\u7528,\u4f7f\u7528SAVE\u547d\u4ee4\u5728\u5feb\u7167\u521b\u5efa\u5b8c\u6bd5\u4e4b\u524d,redis\u5904\u4e8e\u963b\u585e\u72b6\u6001,\u65e0\u6cd5\u5bf9\u5916\u670d\u52a1 \u5982\u679c\u7528\u6237\u5728redis.conf\u4e2d\u8bbe\u7f6e\u4e86save\u914d\u7f6e\u9009\u9879,redis\u4f1a\u5728save\u9009\u9879\u6761\u4ef6\u6ee1\u8db3\u4e4b\u540e\u81ea\u52a8\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4,\u5982\u679c\u8bbe\u7f6e\u591a\u4e2asave\u914d\u7f6e\u9009\u9879,\u5f53\u4efb\u610f\u4e00\u4e2asave\u914d\u7f6e\u9009\u9879\u6761\u4ef6\u6ee1\u8db3,redis\u4e5f\u4f1a\u89e6\u53d1\u4e00\u6b21BGSAVE\u547d\u4ee4","title":"\u6ce8\u610f:"},{"location":"cs/db/redis/cjh/#_3","text":"RDB\u6587\u4ef6\u7d27\u51d1\uff0c\u5168\u91cf\u5907\u4efd\uff0c\u975e\u5e38\u9002\u5408\u7528\u4e8e\u8fdb\u884c\u5907\u4efd\u548c\u707e\u96be\u6062\u590d\u3002 \u751f\u6210RDB\u6587\u4ef6\u7684\u65f6\u5019\uff0credis\u4e3b\u8fdb\u7a0b\u4f1afork()\u4e00\u4e2a\u5b50\u8fdb\u7a0b\u6765\u5904\u7406\u6240\u6709\u4fdd\u5b58\u5de5\u4f5c\uff0c\u4e3b\u8fdb\u7a0b\u4e0d\u9700\u8981\u8fdb\u884c\u4efb\u4f55\u78c1\u76d8IO\u64cd\u4f5c\u3002 RDB \u5728\u6062\u590d\u5927\u6570\u636e\u96c6\u65f6\u7684\u901f\u5ea6\u6bd4 AOF \u7684\u6062\u590d\u901f\u5ea6\u8981\u5feb\u3002","title":"\u4f18\u70b9"},{"location":"cs/db/redis/cjh/#_4","text":"\u9700\u8981\u4e00\u5b9a\u7684\u65f6\u95f4\u95f4\u9694\u8fdb\u7a0b\u64cd\u4f5c\uff01\u5982\u679credis\u610f\u5916\u5b95\u673a\u4e86\uff0c\u8fd9\u4e2a\u6700\u540e\u4e00\u6b21\u4fee\u6539\u6570\u636e\u5c31\u6ca1\u6709\u7684\u4e86\uff01 fork\u8fdb\u7a0b\u7684\u65f6\u5019\uff0c\u4f1a\u5360\u7528\u4e00\u5b9a\u7684\u5185\u5bb9\u7a7a\u95f4\uff01\uff01","title":"\u7f3a\u70b9"},{"location":"cs/db/redis/cjh/#rdb_1","text":"save\u7684\u89c4\u5219\u6ee1\u8db3\u7684\u60c5\u51b5\u4e0b\uff0c\u4f1a\u81ea\u52a8\u89e6\u53d1rdb\u89c4\u5219 \u6267\u884c flushall \u547d\u4ee4\uff0c\u4e5f\u4f1a\u89e6\u53d1\u6211\u4eec\u7684rdb\u89c4\u5219\uff01 \u9000\u51faredis\uff0c\u4e5f\u4f1a\u4ea7\u751f rdb \u6587\u4ef6\uff01","title":"RDB\u89e6\u53d1\u673a\u5236"},{"location":"cs/db/redis/cjh/#_5","text":"\u4fee\u6539\u751f\u6210\u5feb\u7167\u540d\u79f0 dbfilename dump.rdb \u4fee\u6539\u751f\u6210\u4f4d\u7f6e dir ./","title":"\u914d\u7f6e\u751f\u6210\u5feb\u7167\u540d\u79f0\u548c\u4f4d\u7f6e"},{"location":"cs/db/redis/cjh/#rdb_2","text":"\u53ea\u9700\u8981\u5c06rdb\u6587\u4ef6\u653e\u5728redis\u542f\u52a8\u76ee\u5f55\u4e2d\uff0credis\u542f\u52a8\u65f6\u81ea\u52a8\u68c0\u67e5dump.rdb\u6062\u590d\u5176\u4e2d\u7684\u6570\u636e\u3002 \u67e5\u770b\u5176\u5b58\u5728\u7684\u4f4d\u7f6e \u5982\u679c/var/lib/redis\u8fd9\u4e2a\u76ee\u5f55\u5b58\u5728dump.rdb\u6587\u4ef6\uff0c\u5219\u542f\u52a8\u65f6\u81ea\u52a8\u6062\u590d\u6570\u636e\u3002","title":"\u6062\u590drdb\u6587\u4ef6"},{"location":"cs/db/redis/cjh/#aof","text":"Append Only File \u5c06\u6211\u4eec\u6240\u6709\u7684\u547d\u4ee4\u90fd\u8bb0\u5f55\u4e0b\u6765\uff0chistory\uff0c\u6062\u590d\u7684\u65f6\u5019\u5c31\u628a\u8fd9\u4e2a\u6587\u4ef6\u5168\u90e8\u518d\u6267\u884c\u4e00\u904d","title":"AOF"},{"location":"cs/db/redis/cjh/#aof_1","text":"\u5feb\u7167\u529f\u80fd\uff08RDB\uff09\u5e76\u4e0d\u662f\u975e\u5e38\u8010\u4e45\uff08durable\uff09\uff1a \u5982\u679c Redis \u56e0\u4e3a\u67d0\u4e9b\u539f\u56e0\u800c\u9020\u6210\u6545\u969c\u505c\u673a\uff0c \u90a3\u4e48\u670d\u52a1\u5668\u5c06\u4e22\u5931\u6700\u8fd1\u5199\u5165\u3001\u4ee5\u53ca\u672a\u4fdd\u5b58\u5230\u5feb\u7167\u4e2d\u7684\u90a3\u4e9b\u6570\u636e\u3002 \u4ece 1.1 \u7248\u672c\u5f00\u59cb\uff0c Redis \u589e\u52a0\u4e86\u4e00\u79cd\u5b8c\u5168\u8010\u4e45\u7684\u6301\u4e45\u5316\u65b9\u5f0f\uff1a AOF \u6301\u4e45\u5316\u3002","title":"\u4ec0\u4e48\u662fAOF"},{"location":"cs/db/redis/cjh/#_6","text":"\u8fd9\u79cd\u65b9\u5f0f\u53ef\u4ee5\u5c06\u6240\u6709\u5ba2\u6237\u7aef\u6267\u884c\u7684\u5199\u547d\u4ee4\u8bb0\u5f55\u5230\u65e5\u5fd7\u6587\u4ef6\u4e2d,AOF\u6301\u4e45\u5316\u4f1a\u5c06\u88ab\u6267\u884c\u7684\u5199\u547d\u4ee4\u5199\u5230AOF\u7684\u6587\u4ef6\u672b\u5c3e,\u4ee5\u6b64\u6765\u8bb0\u5f55\u6570\u636e\u53d1\u751f\u7684\u53d8\u5316,\u56e0\u6b64\u53ea\u8981redis\u4ece\u5934\u5230\u5c3e\u6267\u884c\u4e00\u6b21AOF\u6587\u4ef6\u6240\u5305\u542b\u7684\u6240\u6709\u5199\u547d\u4ee4,\u5c31\u53ef\u4ee5\u6062\u590dAOF\u6587\u4ef6\u7684\u8bb0\u5f55\u7684\u6570\u636e\u96c6.","title":"\u7279\u70b9"},{"location":"cs/db/redis/cjh/#aof_2","text":"\u5728redis\u7684\u9ed8\u8ba4\u914d\u7f6e\u4e2dAOF\u6301\u4e45\u5316\u673a\u5236\u662f\u6ca1\u6709\u5f00\u542f\u7684\uff0c\u9700\u8981\u5728\u914d\u7f6e\u4e2d\u5f00\u542f appendonly no yes\u5219\u8868\u793a\u542f\u7528AOF \u9ed8\u8ba4\u662f\u4e0d\u5f00\u542f\u7684\uff0c\u6211\u4eec\u9700\u8981\u624b\u52a8\u914d\u7f6e\uff0c\u7136\u540e\u91cd\u542fredis\uff0c\u5c31\u53ef\u4ee5\u751f\u6548\u4e86\uff01 \u5982\u679c\u8fd9\u4e2aaof\u6587\u4ef6\u6709\u9519\u4f4d\uff0c\u8fd9\u65f6\u5019redis\u662f\u542f\u52a8\u4e0d\u8d77\u6765\u7684\uff0c\u6211\u9700\u8981\u4fee\u6539\u8fd9\u4e2aaof\u6587\u4ef6 redis\u7ed9\u6211\u4eec\u63d0\u4f9b\u4e86\u4e00\u4e2a\u5de5\u5177redis-check-aof --fix","title":"\u5f00\u542fAOF\u6301\u4e45\u5316"},{"location":"cs/db/redis/cjh/#_7","text":"\u4fee\u6539\u65e5\u5fd7\u540c\u6b65\u9891\u7387 - \u4fee\u6539appendfsync everysec | always | no \u6307\u5b9a","title":"\u65e5\u5fd7\u8ffd\u52a0\u9891\u7387"},{"location":"cs/db/redis/cjh/#aof_3","text":"","title":"AOF\u6587\u4ef6\u7684\u91cd\u5199"},{"location":"cs/db/redis/cjh/#aof_4","text":"AOF\u7684\u65b9\u5f0f\u4e5f\u540c\u65f6\u5e26\u6765\u4e86\u53e6\u4e00\u4e2a\u95ee\u9898\u3002\u6301\u4e45\u5316\u6587\u4ef6\u4f1a\u53d8\u7684\u8d8a\u6765\u8d8a\u5927\u3002\u4f8b\u5982\u6211\u4eec\u8c03\u7528incr test\u547d\u4ee4100\u6b21\uff0c\u6587\u4ef6\u4e2d\u5fc5\u987b\u4fdd\u5b58\u5168\u90e8\u7684100\u6761\u547d\u4ee4\uff0c\u5176\u5b9e\u670999\u6761\u90fd\u662f\u591a\u4f59\u7684\u3002\u56e0\u4e3a\u8981\u6062\u590d\u6570\u636e\u5e93\u7684\u72b6\u6001\u5176\u5b9e\u6587\u4ef6\u4e2d\u4fdd\u5b58\u4e00\u6761set test 100\u5c31\u591f\u4e86\u3002\u4e3a\u4e86\u538b\u7f29aof\u7684\u6301\u4e45\u5316\u6587\u4ef6Redis\u63d0\u4f9b\u4e86AOF\u91cd\u5199(ReWriter)\u673a\u5236\u3002","title":"AOF\u5e26\u6765\u7684\u95ee\u9898"},{"location":"cs/db/redis/cjh/#aof_5","text":"\u7528\u6765\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u51cf\u5c0fAOF\u6587\u4ef6\u7684\u4f53\u79ef","title":"AOF\u91cd\u5199"},{"location":"cs/db/redis/cjh/#_8","text":"# 1.\u5ba2\u6237\u7aef\u65b9\u5f0f\u89e6\u53d1\u91cd\u5199 - \u6267\u884cBGREWRITEAOF\u547d\u4ee4 \u4e0d\u4f1a\u963b\u585eredis\u7684\u670d\u52a1 # 2.\u670d\u52a1\u5668\u914d\u7f6e\u65b9\u5f0f\u81ea\u52a8\u89e6\u53d1 - \u914d\u7f6eredis.conf\u4e2d\u7684auto-aof-rewrite-percentage\u9009\u9879 \u53c2\u52a0\u4e0b\u56fe\u2193\u2193\u2193 - \u5982\u679c\u8bbe\u7f6eauto-aof-rewrite-percentage\u503c\u4e3a100\u548cauto-aof-rewrite-min-size 64mb,\u5e76\u4e14\u542f\u7528\u7684AOF\u6301\u4e45\u5316\u65f6,\u90a3\u4e48\u5f53AOF\u6587\u4ef6\u4f53\u79ef\u5927\u4e8e64M,\u5e76\u4e14AOF\u6587\u4ef6\u7684\u4f53\u79ef\u6bd4\u4e0a\u4e00\u6b21\u91cd\u5199\u4e4b\u540e\u4f53\u79ef\u5927\u4e86\u81f3\u5c11\u4e00\u500d ( 100 % ) \u65f6,\u4f1a\u81ea\u52a8\u89e6\u53d1,\u5982\u679c\u91cd\u5199\u8fc7\u4e8e\u9891\u7e41,\u7528\u6237\u53ef\u4ee5\u8003\u8651\u5c06auto-aof-rewrite-percentage\u8bbe\u7f6e\u4e3a\u66f4\u5927","title":"\u89e6\u53d1\u673a\u5236"},{"location":"cs/db/redis/cjh/#_9","text":"\u6ce8\u610f\uff1a\u91cd\u5199aof\u6587\u4ef6\u7684\u64cd\u4f5c\uff0c\u5e76\u6ca1\u6709\u8bfb\u53d6\u65e7\u7684aof\u6587\u4ef6\uff0c\u800c\u662f\u5c06\u6574\u4e2a\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5185\u5bb9\u7528\u547d\u4ee4\u7684\u65b9\u5f0f\u91cd\u5199\u4e86\u4e00\u4e2a\u65b0\u7684aof\u6587\u4ef6,\u66ff\u6362\u539f\u6709\u7684\u6587\u4ef6\u8fd9\u70b9\u548c\u5feb\u7167\u6709\u70b9\u7c7b\u4f3c\u3002 # \u91cd\u5199\u6d41\u7a0b - 1 . redis\u8c03\u7528fork \uff0c\u73b0\u5728\u6709\u7236\u5b50\u4e24\u4e2a\u8fdb\u7a0b \u5b50\u8fdb\u7a0b\u6839\u636e\u5185\u5b58\u4e2d\u7684\u6570\u636e\u5e93\u5feb\u7167\uff0c\u5f80\u4e34\u65f6\u6587\u4ef6\u4e2d\u5199\u5165\u91cd\u5efa\u6570\u636e\u5e93\u72b6\u6001\u7684\u547d\u4ee4 - 2 . \u7236\u8fdb\u7a0b\u7ee7\u7eed\u5904\u7406client\u8bf7\u6c42\uff0c\u9664\u4e86\u628a\u5199\u547d\u4ee4\u5199\u5165\u5230\u539f\u6765\u7684aof\u6587\u4ef6\u4e2d\u3002\u540c\u65f6\u628a\u6536\u5230\u7684\u5199\u547d\u4ee4\u7f13\u5b58\u8d77\u6765\u3002\u8fd9\u6837\u5c31\u80fd\u4fdd\u8bc1\u5982\u679c\u5b50\u8fdb\u7a0b\u91cd\u5199\u5931\u8d25\u7684\u8bdd\u5e76\u4e0d\u4f1a\u51fa\u95ee\u9898\u3002 - 3 . \u5f53\u5b50\u8fdb\u7a0b\u628a\u5feb\u7167\u5185\u5bb9\u5199\u5165\u5df2\u547d\u4ee4\u65b9\u5f0f\u5199\u5230\u4e34\u65f6\u6587\u4ef6\u4e2d\u540e\uff0c\u5b50\u8fdb\u7a0b\u53d1\u4fe1\u53f7\u901a\u77e5\u7236\u8fdb\u7a0b\u3002\u7136\u540e\u7236\u8fdb\u7a0b\u628a\u7f13\u5b58\u7684\u5199\u547d\u4ee4\u4e5f\u5199\u5165\u5230\u4e34\u65f6\u6587\u4ef6\u3002 - 4 . \u73b0\u5728\u7236\u8fdb\u7a0b\u53ef\u4ee5\u4f7f\u7528\u4e34\u65f6\u6587\u4ef6\u66ff\u6362\u8001\u7684aof\u6587\u4ef6\uff0c\u5e76\u91cd\u547d\u540d\uff0c\u540e\u9762\u6536\u5230\u7684\u5199\u547d\u4ee4\u4e5f\u5f00\u59cb\u5f80\u65b0\u7684aof\u6587\u4ef6\u4e2d\u8ffd\u52a0\u3002","title":"\u91cd\u5199\u539f\u7406"},{"location":"cs/db/redis/cjh/#_10","text":"\u6bcf\u4e00\u6b21\u4fee\u6539\u90fd\u4f1a\u540c\u6b65\uff0c\u6587\u4ef6\u7684\u5b8c\u6574\u6027\u4f1a\u66f4\u52a0\u597d \u6ca1\u79d2\u540c\u6b65\u4e00\u6b21\uff0c\u53ef\u80fd\u4f1a\u4e22\u5931\u4e00\u79d2\u7684\u6570\u636e \u4ece\u4e0d\u540c\u6b65\uff0c\u6548\u7387\u6700\u9ad8","title":"\u4f18\u70b9"},{"location":"cs/db/redis/cjh/#_11","text":"\u76f8\u5bf9\u4e8e\u6570\u636e\u6587\u4ef6\u6765\u8bf4\uff0caof\u8fdc\u8fdc\u5927\u4e8erdb\uff0c\u4fee\u590d\u901f\u5ea6\u6bd4rdb\u6162\uff01 Aof\u8fd0\u884c\u6548\u7387\u4e5f\u8981\u6bd4rdb\u6162\uff0c\u6240\u4ee5\u6211\u4eecredis\u9ed8\u8ba4\u7684\u914d\u7f6e\u5c31\u662frdb\u6301\u4e45\u5316","title":"\u7f3a\u70b9"},{"location":"cs/db/redis/cjh/#_12","text":"\u4e00\u822c\u6765\u8bf4\uff0c \u5982\u679c\u60f3\u8fbe\u5230\u8db3\u4ee5\u5ab2\u7f8e PostgreSQL \u7684\u6570\u636e\u5b89\u5168\u6027\uff0c \u4f60\u5e94\u8be5\u540c\u65f6\u4f7f\u7528\u4e24\u79cd\u6301\u4e45\u5316\u529f\u80fd\u3002 \u5982\u679c\u4f60\u975e\u5e38\u5173\u5fc3\u4f60\u7684\u6570\u636e\uff0c \u4f46\u4ecd\u7136\u53ef\u4ee5\u627f\u53d7\u6570\u5206\u949f\u4ee5\u5185\u7684\u6570\u636e\u4e22\u5931\uff0c \u90a3\u4e48\u4f60\u53ef\u4ee5\u53ea\u4f7f\u7528 RDB \u6301\u4e45\u5316\u3002 \u6709\u5f88\u591a\u7528\u6237\u90fd\u53ea\u4f7f\u7528 AOF \u6301\u4e45\u5316\uff0c \u4f46\u5e76\u4e0d\u63a8\u8350\u8fd9\u79cd\u65b9\u5f0f\uff1a \u56e0\u4e3a\u5b9a\u65f6\u751f\u6210 RDB \u5feb\u7167\uff08snapshot\uff09\u975e\u5e38\u4fbf\u4e8e\u8fdb\u884c\u6570\u636e\u5e93\u5907\u4efd\uff0c \u5e76\u4e14 RDB \u6062\u590d\u6570\u636e\u96c6\u7684\u901f\u5ea6\u4e5f\u8981\u6bd4 AOF \u6062\u590d\u7684\u901f\u5ea6\u8981\u5feb\u3002","title":"\u5982\u4f55\u9009\u62e9\u54ea\u79cd\u6301\u4e45\u5316\u65b9\u5f0f"},{"location":"cs/db/redis/datatype/","text":"Redis \u6570\u636e\u7c7b\u578b \u00b6 1. NoSQL \u00b6 NoSQL(Not Only SQL )\uff0c\u610f\u5373\u4e0d\u4ec5\u4ec5\u662fSQL, \u6cdb\u6307\u975e\u5173\u7cfb\u578b\u7684\u6570\u636e\u5e93\u3002Nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b,\u65e9\u671f\u5c31\u6709\u4eba\u63d0\u51fa,\u53d1\u5c55\u81f32009\u5e74\u8d8b\u52bf\u8d8a\u53d1\u9ad8\u6da8\u3002 1.1 \u5355\u673aMysql\u65f6\u4ee3 \u00b6 1.2 Memcached(\u7f13\u5b58) + Mysql + \u5782\u76f4\u62c6\u5206\uff08\u8bfb\u5199\u5206\u79bb\uff09 \u00b6 \u7f51\u7ad980%\u7684\u60c5\u51b5\u90fd\u662f\u5728\u8bfb\uff0c\u6bcf\u6b21\u90fd\u8981\u53bb\u67e5\u8be2\u6570\u636e\u5e93\u7684\u8bdd\u5c31\u5341\u5206\u7684\u9ebb\u70e6\uff01\u6240\u4ee5\u8bf4\u6211\u4eec\u5e0c\u671b\u51cf\u8f7b\u6570\u636e\u5e93\u7684\u538b\u529b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7f13\u5b58\u6765\u4fdd\u8bc1\u6548\u7387\uff01 1.3 \u5206\u5e93\u5206\u8868 + \u6c34\u5e73\u62c6\u5206 + Mysql\u96c6\u7fa4 \u00b6 1.4 \u5982\u4eca\u6700\u8fd1\u7684\u5e74\u4ee3 \u00b6 2. \u4e3a\u4ec0\u4e48\u662fNoSQL \u00b6 NoSQL = Not Only SQL\uff08\u4e0d\u4ec5\u4ec5\u662fSQL\uff09 Not Only Structured Query Language \u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u5217+\u884c\uff0c\u540c\u4e00\u4e2a\u8868\u4e0b\u6570\u636e\u7684\u7ed3\u6784\u662f\u4e00\u6837\u7684\u3002 \u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u6570\u636e\u5b58\u50a8\u6ca1\u6709\u56fa\u5b9a\u7684\u683c\u5f0f\uff0c\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u6a2a\u5411\u6269\u5c55\u3002 NoSQL\u6cdb\u6307\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u968f\u7740web2.0\u4e92\u8054\u7f51\u7684\u8bde\u751f\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5f88\u96be\u5bf9\u4ed8web2.0\u65f6\u4ee3\uff01\u5c24\u5176\u662f\u8d85\u5927\u89c4\u6a21\u7684\u9ad8\u5e76\u53d1\u7684\u793e\u533a\uff0c\u66b4\u9732\u51fa\u6765\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\uff0cNoSQL\u5728\u5f53\u4eca\u5927\u6570\u636e\u73af\u5883\u4e0b\u53d1\u5c55\u7684\u5341\u5206\u8fc5\u901f\uff0cRedis\u662f\u53d1\u5c55\u6700\u5feb\u7684\u3002 \u968f\u7740\u4e92\u8054\u7f51\u7f51\u7ad9\u7684\u5174\u8d77\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u6570\u636e\u5e93\u5728\u5e94\u4ed8\u52a8\u6001\u7f51\u7ad9\uff0c\u7279\u522b\u662f\u8d85\u5927\u89c4\u6a21\u548c\u9ad8\u5e76\u53d1\u7684\u7eaf\u52a8\u6001\u7f51\u7ad9\u5df2\u7ecf\u663e\u5f97\u529b\u4e0d\u4ece\u5fc3\uff0c\u66b4\u9732\u4e86\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\u3002\u5982\u5546\u57ce\u7f51\u7ad9\u4e2d\u5bf9 \u5546\u54c1\u6570\u636e\u9891\u7e41\u67e5\u8be2 \u3001 \u5bf9\u70ed\u641c\u5546\u54c1\u7684\u6392\u884c\u7edf\u8ba1 \u3001 \u8ba2\u5355\u8d85\u65f6\u95ee\u9898 \u3001\u4ee5\u53ca \u5fae\u4fe1\u670b\u53cb\u5708\uff08\u97f3\u9891\uff0c\u89c6\u9891\uff09\u5b58\u50a8 \u7b49\u76f8\u5173\u4f7f\u7528\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5b9e\u73b0\u5c31\u663e\u5f97\u975e\u5e38\u590d\u6742\uff0c\u867d\u7136\u80fd\u5b9e\u73b0\u76f8\u5e94\u529f\u80fd\u4f46\u662f\u5728\u6027\u80fd\u4e0a\u5374\u4e0d\u662f\u90a3\u4e48\u4e50\u89c2\u3002nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b\u7684\u51fa\u73b0\uff0c\u66f4\u597d\u7684\u89e3\u51b3\u4e86\u8fd9\u4e9b\u95ee\u9898\uff0c\u5b83\u544a\u8bc9\u4e86\u4e16\u754c\u4e0d\u4ec5\u4ec5\u662fsql\u3002 \u4e86\u89e3\uff1a3V + 3\u9ad8 \u5927\u6570\u636e\u65f6\u4ee3\u76843V \uff1a\u4e3b\u8981\u662f\u63cf\u8ff0\u95ee\u9898\u7684 \u6d77\u91cfVelume \u591a\u6837Variety \u5b9e\u65f6Velocity \u5927\u6570\u636e\u65f6\u4ee3\u76843\u9ad8 \uff1a \u4e3b\u8981\u662f\u5bf9\u7a0b\u5e8f\u7684\u8981\u6c42 \u9ad8\u5e76\u53d1 \u9ad8\u53ef\u6269 \u9ad8\u6027\u80fd 3. NoSQL\u7684\u56db\u5927\u5206\u7c7b \u00b6 3.1 \u952e\u503c(Key-Value)\u5b58\u50a8\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e: - \u8fd9\u4e00\u7c7b\u6570\u636e\u5e93\u4e3b\u8981\u4f1a\u4f7f\u7528\u5230\u4e00\u4e2a\u54c8\u5e0c\u8868\uff0c\u8fd9\u4e2a\u8868\u4e2d\u6709\u4e00\u4e2a\u7279\u5b9a\u7684\u952e\u548c\u4e00\u4e2a\u6307\u9488\u6307\u5411\u7279\u5b9a\u7684\u6570\u636e\u3002 # 2.\u7279\u70b9 - Key/value\u6a21\u578b\u5bf9\u4e8eIT\u7cfb\u7edf\u6765\u8bf4\u7684\u4f18\u52bf\u5728\u4e8e\u7b80\u5355\u3001\u6613\u90e8\u7f72\u3002 - \u4f46\u662f\u5982\u679cDBA\u53ea\u5bf9\u90e8\u5206\u503c\u8fdb\u884c\u67e5\u8be2\u6216\u66f4\u65b0\u7684\u65f6\u5019\uff0cKey/value\u5c31\u663e\u5f97\u6548\u7387\u4f4e\u4e0b\u4e86\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Tokyo Cabinet/Tyrant, - Redis - SSDB - Voldemort - Oracle BDB 3.2 \u5217\u5b58\u50a8\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e - \u8fd9\u90e8\u5206\u6570\u636e\u5e93\u901a\u5e38\u662f\u7528\u6765\u5e94\u5bf9\u5206\u5e03\u5f0f\u5b58\u50a8\u7684\u6d77\u91cf\u6570\u636e\u3002 # 2.\u7279\u70b9 - \u952e\u4ecd\u7136\u5b58\u5728\uff0c\u4f46\u662f\u5b83\u4eec\u7684\u7279\u70b9\u662f\u6307\u5411\u4e86\u591a\u4e2a\u5217\u3002\u8fd9\u4e9b\u5217\u662f\u7531\u5217\u5bb6\u65cf\u6765\u5b89\u6392\u7684\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Cassandra\u3001HBase\u3001Riak. 3.3 \u6587\u6863\u578b\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e - \u6587\u6863\u578b\u6570\u636e\u5e93\u7684\u7075\u611f\u662f\u6765\u81ea\u4e8eLotus Notes\u529e\u516c\u8f6f\u4ef6\u7684\uff0c\u800c\u4e14\u5b83\u540c\u7b2c\u4e00\u79cd\u952e\u503c\u5b58\u50a8\u76f8\u7c7b\u4f3c\u8be5\u7c7b\u578b\u7684\u6570\u636e\u6a21\u578b\u662f\u7248\u672c\u5316\u7684\u6587\u6863\uff0c\u534a\u7ed3\u6784\u5316\u7684\u6587\u6863\u4ee5\u7279\u5b9a\u7684\u683c\u5f0f\u5b58\u50a8\uff0c\u6bd4\u5982JSON\u3002\u6587\u6863\u578b\u6570\u636e\u5e93\u53ef \u4ee5\u770b\u4f5c\u662f\u952e\u503c\u6570\u636e\u5e93\u7684\u5347\u7ea7\u7248\uff0c\u5141\u8bb8\u4e4b\u95f4\u5d4c\u5957\u952e\u503c\u3002\u800c\u4e14\u6587\u6863\u578b\u6570\u636e\u5e93\u6bd4\u952e\u503c\u6570\u636e\u5e93\u7684\u67e5\u8be2\u6548\u7387\u66f4\u9ad8 # 2.\u7279\u70b9 - \u4ee5\u6587\u6863\u5f62\u5f0f\u5b58\u50a8 # 3.\u76f8\u5173\u4ea7\u54c1 - MongoDB\u3001CouchDB\u3001 MongoDb ( 4 .x ) . \u56fd\u5185\u4e5f\u6709\u6587\u6863\u578b\u6570\u636e\u5e93SequoiaDB\uff0c\u5df2\u7ecf\u5f00\u6e90\u3002 3.4 \u56fe\u5f62(Graph)\u6570\u636e\u5e93 \u00b6 # 1.\u8bf4\u660e - \u56fe\u5f62\u7ed3\u6784\u7684\u6570\u636e\u5e93\u540c\u5176\u4ed6\u884c\u5217\u4ee5\u53ca\u521a\u6027\u7ed3\u6784\u7684SQL\u6570\u636e\u5e93\u4e0d\u540c\uff0c\u5b83\u662f\u4f7f\u7528\u7075\u6d3b\u7684\u56fe\u5f62\u6a21\u578b\uff0c\u5e76\u4e14\u80fd\u591f\u6269\u5c55\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\u3002 - NoSQL\u6570\u636e\u5e93\u6ca1\u6709\u6807\u51c6\u7684\u67e5\u8be2\u8bed\u8a00 ( SQL ) \uff0c\u56e0\u6b64\u8fdb\u884c\u6570\u636e\u5e93\u67e5\u8be2\u9700\u8981\u5236\u5b9a\u6570\u636e\u6a21\u578b\u3002\u8bb8\u591aNoSQL\u6570\u636e\u5e93\u90fd\u6709REST\u5f0f\u7684\u6570\u636e\u63a5\u53e3\u6216\u8005\u67e5\u8be2API\u3002 # 2.\u7279\u70b9 # 3.\u76f8\u5173\u4ea7\u54c1 - Neo4J\u3001InfoGrid\u3001 Infinite Graph\u3001 4. NoSQL\u5e94\u7528\u573a\u666f \u00b6 \u6570\u636e\u6a21\u578b\u6bd4\u8f83\u7b80\u5355 \u9700\u8981\u7075\u6d3b\u6027\u66f4\u5f3a\u7684IT\u7cfb\u7edf \u5bf9\u6570\u636e\u5e93\u6027\u80fd\u8981\u6c42\u8f83\u9ad8 \u4e0d\u9700\u8981\u9ad8\u5ea6\u7684\u6570\u636e\u4e00\u81f4\u6027 5. \u4ec0\u4e48\u662fRedis \u00b6 Redis \u5f00\u6e90 \u9075\u5faaBSD \u57fa\u4e8e\u5185\u5b58\u6570\u636e\u5b58\u50a8 \u88ab\u7528\u4e8e\u4f5c\u4e3a \u6570\u636e\u5e93 \u7f13\u5b58 \u6d88\u606f\u4e2d\u95f4\u4ef6 redis\u662f\u4e00\u4e2a\u5185\u5b58\u578b\u7684\u6570\u636e\u5e93 6. Redis\u7279\u70b9 \u00b6 Redis\u662f\u4e00\u4e2a\u9ad8\u6027\u80fdkey/value\u5185\u5b58\u578b\u6570\u636e\u5e93 Redis\u652f\u6301\u4e30\u5bcc\u7684\u6570\u636e\u7c7b\u578b Redis\u652f\u6301\u6301\u4e45\u5316 Redis\u5355\u7ebf\u7a0b,\u5355\u8fdb\u7a0b \u5355\u7ebf\u7a0b\u4e0d\u4e00\u5b9a\u6bd4\u591a\u7ebf\u7a0b\u6162\uff0c\u5728CPU\u4e2d\uff0c\u591a\u7ebf\u7a0b\u9700\u8981\u8df3\u8f6c\uff0c\u800c\u5355\u7ebf\u7a0b\u4e0d\u9700\u8981\uff0c\u51cf\u5c11\u4e86\u8df3\u8f6c\u7684\u6d88\u8017\uff0c\u6240\u4ee5\u5728\u67d0\u4e9b\u573a\u666f\u91cc\u5355\u7ebf\u7a0b\u53ef\u80fd\u6bd4\u591a\u7ebf\u7a0b\u5feb\u3002 7. Ridis\u5b89\u88c5 \u00b6 \u7565 8. redis\u5e38\u7528\u547d\u4ee4 \u00b6 8.1 set get\u547d\u4ee4\uff0c\u5b58\u503c\uff0c\u53d6\u503c \u00b6 8.2 \u5207\u6362\u6570\u636e\u5e93\uff0credis\u9ed8\u8ba4\u670916\u4e2a\u6570\u636e\u5e93\uff0c\u9ed8\u8ba4\u4f7f\u75280\u53f7\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7select\u5207\u6362 \u00b6 8.3 \u6e05\u7a7a\u5f53\u524d\u6570\u636e\u5e93\uff1aflushdb,\u6e05\u7a7a\u6240\u6709\u6570\u636e\u5e93\uff1aflushall \u00b6 8.4 \u67e5\u8be2\u6240\u6709key: keys* \u00b6 8.5 \u67e5\u8be2\u6570\u636e\u5e93\u7684\u5927\u5c0f\uff1adbsize \u00b6 8.6 \u67e5\u770bkey\u662f\u5426\u5b58\u5728\uff1aexists keyName,\u5b58\u5728\u8fd4\u56de1\uff0c\u5426\u5219\u8fd4\u56de0 \u00b6 8.7 \u79fb\u9664Key: move keyName 1 \u00b6 8.8 \u4e3akey\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4: expire keyName timeout \u00b6 8.9 \u67e5\u770bkey\u7684\u5269\u4f59\u5b58\u6d3b\u65f6\u95f4\uff1attl keyName \u00b6 8.10 \u67e5\u770bkey\u7684\u7c7b\u578b\uff1atype keyName \u00b6 9. String\u8be6\u89e3 \u00b6 | \u547d\u4ee4 | \u8bf4\u660e | | ------------------------- | ----------------------- | | set | \u8bbe\u7f6e\u4e00\u4e2akey/value | | get | \u6839\u636ekey\u83b7\u5f97\u5bf9\u5e94\u7684value | | mset | \u4e00\u6b21\u8bbe\u7f6e\u591a\u4e2akey value | | mget | \u4e00\u6b21\u83b7\u5f97\u591a\u4e2akey\u7684value | | getset | \u83b7\u5f97\u539f\u59cbkey\u7684\u503c\uff0c\u540c\u65f6\u8bbe\u7f6e\u65b0\u503c | | strlen | \u83b7\u5f97\u5bf9\u5e94key\u5b58\u50a8value\u7684\u957f\u5ea6 | | append | \u4e3a\u5bf9\u5e94key\u7684value\u8ffd\u52a0\u5185\u5bb9 | | getrange \u7d22\u5f150\u5f00\u59cb | \u622a\u53d6value\u7684\u5185\u5bb9 | | setex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u79d2\uff09 | | psetex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u6beb\u79d2\uff09 | | setnx | \u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c,\u4e0d\u5b58\u5728\u6dfb\u52a0 | | msetnx\u539f\u5b50\u64cd\u4f5c ( \u53ea\u8981\u6709\u4e00\u4e2a\u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c ) | \u53ef\u4ee5\u540c\u65f6\u8bbe\u7f6e\u591a\u4e2akey,\u53ea\u6709\u6709\u4e00\u4e2a\u5b58\u5728\u90fd\u4e0d\u4fdd\u5b58 | | decr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684-1\u64cd\u4f5c | | decrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u51cf\u6cd5\u64cd\u4f5c | | Incr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684+1\u64cd\u4f5c | | incrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u52a0\u6cd5\u64cd\u4f5c | | Incrbyfloat | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u52a0\u5165\u6d6e\u70b9\u6570 | 9.1 strlen:\u6c42value\u7684\u957f\u5ea6\uff0cappend\uff1a\u8ffd\u52a0 \u00b6 9.2 \u81ea\u589e,\u81ea\u51cf\u64cd\u4f5c\uff1aincr incrby decr decrby \u00b6 9.3 \u5b57\u7b26\u4e32\u7684\u8303\u56f4\u64cd\u4f5c\uff1agetrange,setrange \u00b6 9.4 \u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\uff1asetex\uff08\u5982\u679c\u5b58\u5728Key\u5219\u8986\u76d6\uff0c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\uff09\uff0csetnx(\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8bbe\u7f6e) \u00b6 9.5 \u6279\u91cf\u8bbe\u7f6e\u548c\u83b7\u53d6\u503c\uff1amset,mget, msetnx(\u64cd\u4f5c\u4e3a\u539f\u5b50\u6027\uff0c\u8981\u4e48\u90fd\u6210\u529f\uff0c\u8981\u4e48\u90fd\u5931\u8d25) \u00b6 9.6 \u5b58\u53d6\u5bf9\u8c61 \u00b6 9.7 \u7ec4\u5408\u64cd\u4f5c\uff1agetset\u5148\u83b7\u53d6\u518d\u8bbe\u7f6e,\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8fd4\u56denil \u00b6 String\u7c7b\u4f3c\u7684\u4f7f\u7528\u573a\u666f\uff1avalue\u9664\u4e86\u662f\u6211\u4eec\u7684\u5b57\u7b26\u4e32\u8fd8\u53ef\u4ee5\u662f\u6211\u4eec\u7684\u6570\u5b57\uff01 \u8ba1\u6570\u5668 \u7edf\u8ba1\u591a\u5355\u4f4d\u7684\u6570\u91cf \u7c89\u4e1d\u6570 \u5bf9\u8c61\u7f13\u5b58\u5b58\u50a8 10. list\u8be6\u89e3 \u00b6 list\u7684\u547d\u4ee4\u90fd\u662fl\u5f00\u5934,list \u5217\u8868 \u76f8\u5f53\u4e8ejava\u4e2dlist \u96c6\u5408 \u7279\u70b9 \u5143\u7d20\u6709\u5e8f \u4e14 \u53ef\u4ee5\u91cd\u590d | \u547d\u4ee4 | \u8bf4\u660e | | ------- | --------------------- | | lpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u5934\u90e8 | | lpushx | \u540clpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | rpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u672b\u5c3e | | rpushx | \u540crpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | lpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u5de6\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | rpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u53f3\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | lrange | \u83b7\u53d6\u67d0\u4e00\u4e2a\u4e0b\u6807\u533a\u95f4\u5185\u7684\u5143\u7d20 | | llen | \u83b7\u53d6\u5217\u8868\u5143\u7d20\u4e2a\u6570 | | lset | \u8bbe\u7f6e\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u7684\u503c ( \u7d22\u5f15\u5fc5\u987b\u5b58\u5728 ) | | lindex | \u83b7\u53d6\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u4f4d\u7f6e\u7684\u5143\u7d20 | | lrem | \u5220\u9664\u91cd\u590d\u5143\u7d20 | | ltrim | \u4fdd\u7559\u5217\u8868\u4e2d\u7279\u5b9a\u533a\u95f4\u5185\u7684\u5143\u7d20 | | linsert | \u5728\u67d0\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\uff0c\u4e4b\u540e\u63d2\u5165\u65b0\u5143\u7d20 | 10.1 \u5de6\u63d2\uff1alpush,\u5de6\u5220\uff1alpop \u00b6 10.2 \u53f3\u63d2\uff1arpush,\u53f3\u5220\uff1arpop \u00b6 10.3 \u83b7\u53d6\u5217\u8868\u5143\u7d20\uff1alrange \u00b6 10.4 \u901a\u8fc7\u4e0b\u6807\u83b7\u53d6\u5143\u7d20\uff1alindex \u00b6 10.5 \u83b7\u53d6\u5217\u8868\u957f\u5ea6\uff1allen \u00b6 10.6 \u79fb\u9664\u5177\u4f53\u7684\u503c\u6240\u5728\u7684\u952e\u503c\u5bf9:lrem \u5217\u8868 \u79fb\u9664\u51e0\u4e2a \u79fb\u9664\u7684\u5177\u4f53value \u00b6 10.7 \u622a\u53d6\u64cd\u4f5c\uff1altrim \u5217\u8868 \u622a\u53d6\u7684\u5f00\u59cb\u4e0b\u6807 \u622a\u53d6\u7684\u7ed3\u675f\u4e0b\u6807 \u00b6 10.8 rpoplpush:\u79fb\u9664\u5217\u8868\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u5e76\u5c06\u8fd9\u4e2a\u5143\u7d20\u653e\u5230\u4e00\u4e2a\u65b0\u7684\u5217\u8868\u4e2d \u00b6 10.9 \u5224\u65ad\u5217\u8868\u662f\u5426\u5b58\u5728\uff1aEXISTS list \u00b6 10.10 lset:\u66f4\u65b0\u5217\u8868\u4e2d\u6307\u5b9a\u4e0b\u6807\u7684\u5143\u7d20\u7684value,\u524d\u63d0\u662f\u8be5\u4e0b\u6807\u5fc5\u987b\u6709\u503c\uff0c\u5426\u5219\u62a5\u9519 \u00b6 10.11 \u5728\u5217\u8868\u4e2d\u63d2\u5165\u503c\uff1a\u524d\u63d2\u548c\u540e\u63d2\uff1alinsert \u00b6 11. set\u8be6\u89e3 \u00b6 set\u662f\u65e0\u5e8f\u4e0d\u91cd\u590d\u96c6\u5408\uff0cset\u547d\u4ee4\u90fd\u662fs\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ----------- | ------------------------- | | sadd | \u4e3a\u96c6\u5408\u6dfb\u52a0\u5143\u7d20 | | smembers | \u663e\u793a\u96c6\u5408\u4e2d\u6240\u6709\u5143\u7d20 \u65e0\u5e8f | | scard | \u8fd4\u56de\u96c6\u5408\u4e2d\u5143\u7d20\u7684\u4e2a\u6570 | | spop | \u968f\u673a\u8fd4\u56de\u4e00\u4e2a\u5143\u7d20 \u5e76\u5c06\u5143\u7d20\u5728\u96c6\u5408\u4e2d\u5220\u9664 | | smove | \u4ece\u4e00\u4e2a\u96c6\u5408\u4e2d\u5411\u53e6\u4e00\u4e2a\u96c6\u5408\u79fb\u52a8\u5143\u7d20 \u5fc5\u987b\u662f\u540c\u4e00\u79cd\u7c7b\u578b | | srem | \u4ece\u96c6\u5408\u4e2d\u5220\u9664\u4e00\u4e2a\u5143\u7d20 | | sismember | \u5224\u65ad\u4e00\u4e2a\u96c6\u5408\u4e2d\u662f\u5426\u542b\u6709\u8fd9\u4e2a\u5143\u7d20 | | srandmember | \u968f\u673a\u8fd4\u56de\u5143\u7d20 | | sdiff | \u53bb\u6389\u7b2c\u4e00\u4e2a\u96c6\u5408\u4e2d\u5176\u5b83\u96c6\u5408\u542b\u6709\u7684\u76f8\u540c\u5143\u7d20 | | sinter | \u6c42\u4ea4\u96c6 | | sunion | \u6c42\u548c\u96c6 | 11.1 \u6dfb\u52a0\uff1asadd \u00b6 11.2 \u67e5\u770b\u6240\u6709: smembers \u00b6 11.3 \u67e5\u8be2set\u7684\u5143\u7d20\u4e2a\u6570\uff1ascard \u00b6 11.4 \u5224\u65adset\u4e2d\u662f\u5426\u5b58\u5728\u67d0\u5143\u7d20\uff1asismember \u00b6 11.5 \u79fb\u9664\u67d0\u4e2a\u5143\u7d20\uff1asrem \u00b6 11.6 \u968f\u673a\u62bd\u53d6\u4e00\u4e2a\u5143\u7d20\uff1aSRANDMEMBER \u00b6 11.7 \u968f\u673a\u79fb\u9664\u4e00\u4e2a\u5143\u7d20\uff1aspop \u00b6 11.8 \u5c06\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u5143\u7d20\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u96c6\u5408\u4e2d\uff1asmove \u00b6 11.9 \u96c6\u5408\u4e4b\u95f4\u6c42\u4ea4\u5e76\u8865\u96c6\uff1asinter sunite sdiff \u00b6 \u5dee\u96c6sdiff \u00b6 \u4ea4\u96c6sinter \u00b6 \u5e76\u96c6sunion \u00b6 12. hash\u8be6\u89e3 \u00b6 hash\u7684\u5f62\u5f0f\uff1akey filed vlaue,\u76f8\u5f53\u4e8ejava\u4e2d\u7684map\u96c6\u5408 hash\u547d\u4ee4\u90fd\u662fh\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ------------ | --------------- | | hset | \u8bbe\u7f6e\u4e00\u4e2akey/value\u5bf9 | | hget | \u83b7\u5f97\u4e00\u4e2akey\u5bf9\u5e94\u7684value | | hgetall | \u83b7\u5f97\u6240\u6709\u7684key/value\u5bf9 | | hdel | \u5220\u9664\u67d0\u4e00\u4e2akey/value\u5bf9 | | hexists | \u5224\u65ad\u4e00\u4e2akey\u662f\u5426\u5b58\u5728 | | hkeys | \u83b7\u5f97\u6240\u6709\u7684key | | hvals | \u83b7\u5f97\u6240\u6709\u7684value | | hmset | \u8bbe\u7f6e\u591a\u4e2akey/value | | hmget | \u83b7\u5f97\u591a\u4e2akey\u7684value | | hsetnx | \u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684key\u7684\u503c | | hincrby | \u4e3avalue\u8fdb\u884c\u52a0\u6cd5\u8fd0\u7b97 | | hincrbyfloat | \u4e3avalue\u52a0\u5165\u6d6e\u70b9\u503c | 12.1 \u5411hash\u4e2d\u6dfb\u52a0\u503c\uff1ahset \u00b6 12.2 \u5f97\u5230hash\u4e2d\u7684\u6307\u5b9afiled\u7684\u503c\uff1ahget \u00b6 12.3 \u5f97\u5230hash\u4e2d\u7684\u6240\u6709\u503c:hgetall \u00b6 12.4 \u6279\u91cf\u6dfb\u52a0\u548c\u83b7\u53d6\uff1ahmset hmget \u00b6 12.5 \u5220\u9664\u6307\u5b9a\u7684\u5b57\u6bb5\uff1ahdel \u00b6 12.6 \u83b7\u53d6hash\u7684\u5b57\u6bb5\u957f\u5ea6\uff1ahlen \u00b6 12.7 \u5224\u65adhash\u4e2d\u7684\u5b57\u6bb5\u662f\u5426\u5b58\u5728\uff1ahexist \u00b6 12.8 \u83b7\u53d6\u6240\u6709\u7684key(\u5b57\u6bb5)hkeys,\u83b7\u53d6\u6240\u6709\u7684value\uff1ahvals \u00b6 12.9 \u6307\u5b9a\u589e\u91cf\uff1ahincrby \u00b6 hash\u53d8\u66f4\u7684\u6570\u636e user name age,\u5c24\u5176\u662f\u662f\u7528\u6237\u4fe1\u606f\u4e4b\u7c7b\u7684\uff0c\u7ecf\u5e38\u53d8\u52a8\u7684\u4fe1\u606f\uff01 hash \u66f4\u9002\u5408\u4e8e\u5bf9\u8c61\u7684\u5b58\u50a8\uff0cString\u66f4\u52a0\u9002\u5408\u5b57\u7b26\u4e32\u5b58\u50a8\uff01 13. Zset\u8be6\u89e3 \u00b6 zset\u662f\u6709\u5e8f\u4e0d\u53ef\u91cd\u590d\u7684\u96c6\u5408,zset\u547d\u4ee4\u90fd\u662fz\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ---------------------- | -------------- | | zadd | \u6dfb\u52a0\u4e00\u4e2a\u6709\u5e8f\u96c6\u5408\u5143\u7d20 | | zcard | \u8fd4\u56de\u96c6\u5408\u7684\u5143\u7d20\u4e2a\u6570 | | zrange \u5347\u5e8f zrevrange \u964d\u5e8f | \u8fd4\u56de\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrangebyscore | \u6309\u7167\u5206\u6570\u67e5\u627e\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrank | \u8fd4\u56de\u6392\u540d | | zrevrank | \u5012\u5e8f\u6392\u540d | | zscore | \u663e\u793a\u67d0\u4e00\u4e2a\u5143\u7d20\u7684\u5206\u6570 | | zrem | \u79fb\u9664\u67d0\u4e00\u4e2a\u5143\u7d20 | | zincrby | \u7ed9\u67d0\u4e2a\u7279\u5b9a\u5143\u7d20\u52a0\u5206 | 13.1 \u6dfb\u52a0\u6570\u636e\uff1azadd \u00b6 13.2 \u83b7\u53d6\u6240\u6709\u503c,\u6309\u7167\u7d22\u5f15\u83b7\u53d6\uff1azrange \u00b6 13.3 \u83b7\u53d6\u6240\u6709\u503c\uff0c\u6309\u7167score\u83b7\u53d6\uff1azrangebyscore \u00b6 13.4 \u79fb\u9664\u5143\u7d20\uff1azrem \u00b6 13.5 \u5f97\u5230\u5143\u7d20\u7684\u4e2a\u6570:zcard \u00b6 13.6 \u83b7\u53d6\u6307\u5b9a\u533a\u95f4\u7684\u6210\u5458\u6570\u91cf\uff1azcount \u00b6 ZSET \u5b98\u65b9 \u53ef\u6392\u5e8fSET sortSet 14. geospatial \u00b6 15. bitmaps \u00b6 bitmap\u5373\u4f4d\u5b58\u50a8\uff0c\u9002\u7528\u4e8e\u53ea\u6709\u4e24\u9762\u6027\u7684\u5185\u5bb9\u3002\u5982\uff1a\u53ef\u4ee5\u7528bitmap\u5b58\u50a8\u7528\u6237\u662f\u5426\u767b\u5f55\uff0c\u662f\u5426\u6ce8\u518c\uff0c\u662f\u5426\u6253\u5361\u7b49\u7b49\u3002bitmap\u7684\u503c\u53ea\u67090\u548c1\u4e24\u4e2a\u503c\u3002 15.1 \u5b58\u50a8\u6570\u636e\uff1asetbit \u00b6 15.2 \u83b7\u53d6\u6307\u5b9a\u4e0b\u6807\u7684\u503c\uff1agetbit \u00b6 15.3 \u7edf\u8ba1bitmap\u4e2d1\u7684\u4f4d\u6570\uff1abitcount \u00b6 16. hyperloglogs \u00b6 \u7528\u4e8e\u7edf\u8ba1\u57fa\u6570\uff08\u5373\u4e0d\u91cd\u590d\u7684\u6570\u636e\uff09,\u53ef\u4ee5\u7528\u4e8e\u7edf\u8ba1\u7f51\u9875\u8bbf\u95ee\u91cf 16.1 \u6dfb\u52a0\uff1apfadd \u00b6 16.2 \u8ba1\u6570\uff1apfcount \u00b6 16.3 \u5408\u5e76\uff1apfmerge \u00b6","title":"\u6570\u636e\u7c7b\u578b"},{"location":"cs/db/redis/datatype/#redis","text":"","title":"Redis \u6570\u636e\u7c7b\u578b"},{"location":"cs/db/redis/datatype/#1-nosql","text":"NoSQL(Not Only SQL )\uff0c\u610f\u5373\u4e0d\u4ec5\u4ec5\u662fSQL, \u6cdb\u6307\u975e\u5173\u7cfb\u578b\u7684\u6570\u636e\u5e93\u3002Nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b,\u65e9\u671f\u5c31\u6709\u4eba\u63d0\u51fa,\u53d1\u5c55\u81f32009\u5e74\u8d8b\u52bf\u8d8a\u53d1\u9ad8\u6da8\u3002","title":"1. NoSQL"},{"location":"cs/db/redis/datatype/#11-mysql","text":"","title":"1.1 \u5355\u673aMysql\u65f6\u4ee3"},{"location":"cs/db/redis/datatype/#12-memcached-mysql","text":"\u7f51\u7ad980%\u7684\u60c5\u51b5\u90fd\u662f\u5728\u8bfb\uff0c\u6bcf\u6b21\u90fd\u8981\u53bb\u67e5\u8be2\u6570\u636e\u5e93\u7684\u8bdd\u5c31\u5341\u5206\u7684\u9ebb\u70e6\uff01\u6240\u4ee5\u8bf4\u6211\u4eec\u5e0c\u671b\u51cf\u8f7b\u6570\u636e\u5e93\u7684\u538b\u529b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u7f13\u5b58\u6765\u4fdd\u8bc1\u6548\u7387\uff01","title":"1.2 Memcached(\u7f13\u5b58) + Mysql + \u5782\u76f4\u62c6\u5206\uff08\u8bfb\u5199\u5206\u79bb\uff09"},{"location":"cs/db/redis/datatype/#13-mysql","text":"","title":"1.3 \u5206\u5e93\u5206\u8868 + \u6c34\u5e73\u62c6\u5206 + Mysql\u96c6\u7fa4"},{"location":"cs/db/redis/datatype/#14","text":"","title":"1.4 \u5982\u4eca\u6700\u8fd1\u7684\u5e74\u4ee3"},{"location":"cs/db/redis/datatype/#2-nosql","text":"NoSQL = Not Only SQL\uff08\u4e0d\u4ec5\u4ec5\u662fSQL\uff09 Not Only Structured Query Language \u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u5217+\u884c\uff0c\u540c\u4e00\u4e2a\u8868\u4e0b\u6570\u636e\u7684\u7ed3\u6784\u662f\u4e00\u6837\u7684\u3002 \u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff1a\u6570\u636e\u5b58\u50a8\u6ca1\u6709\u56fa\u5b9a\u7684\u683c\u5f0f\uff0c\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u6a2a\u5411\u6269\u5c55\u3002 NoSQL\u6cdb\u6307\u975e\u5173\u7cfb\u578b\u6570\u636e\u5e93\uff0c\u968f\u7740web2.0\u4e92\u8054\u7f51\u7684\u8bde\u751f\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5f88\u96be\u5bf9\u4ed8web2.0\u65f6\u4ee3\uff01\u5c24\u5176\u662f\u8d85\u5927\u89c4\u6a21\u7684\u9ad8\u5e76\u53d1\u7684\u793e\u533a\uff0c\u66b4\u9732\u51fa\u6765\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\uff0cNoSQL\u5728\u5f53\u4eca\u5927\u6570\u636e\u73af\u5883\u4e0b\u53d1\u5c55\u7684\u5341\u5206\u8fc5\u901f\uff0cRedis\u662f\u53d1\u5c55\u6700\u5feb\u7684\u3002 \u968f\u7740\u4e92\u8054\u7f51\u7f51\u7ad9\u7684\u5174\u8d77\uff0c\u4f20\u7edf\u7684\u5173\u7cfb\u6570\u636e\u5e93\u5728\u5e94\u4ed8\u52a8\u6001\u7f51\u7ad9\uff0c\u7279\u522b\u662f\u8d85\u5927\u89c4\u6a21\u548c\u9ad8\u5e76\u53d1\u7684\u7eaf\u52a8\u6001\u7f51\u7ad9\u5df2\u7ecf\u663e\u5f97\u529b\u4e0d\u4ece\u5fc3\uff0c\u66b4\u9732\u4e86\u5f88\u591a\u96be\u4ee5\u514b\u670d\u7684\u95ee\u9898\u3002\u5982\u5546\u57ce\u7f51\u7ad9\u4e2d\u5bf9 \u5546\u54c1\u6570\u636e\u9891\u7e41\u67e5\u8be2 \u3001 \u5bf9\u70ed\u641c\u5546\u54c1\u7684\u6392\u884c\u7edf\u8ba1 \u3001 \u8ba2\u5355\u8d85\u65f6\u95ee\u9898 \u3001\u4ee5\u53ca \u5fae\u4fe1\u670b\u53cb\u5708\uff08\u97f3\u9891\uff0c\u89c6\u9891\uff09\u5b58\u50a8 \u7b49\u76f8\u5173\u4f7f\u7528\u4f20\u7edf\u7684\u5173\u7cfb\u578b\u6570\u636e\u5e93\u5b9e\u73b0\u5c31\u663e\u5f97\u975e\u5e38\u590d\u6742\uff0c\u867d\u7136\u80fd\u5b9e\u73b0\u76f8\u5e94\u529f\u80fd\u4f46\u662f\u5728\u6027\u80fd\u4e0a\u5374\u4e0d\u662f\u90a3\u4e48\u4e50\u89c2\u3002nosql\u8fd9\u4e2a\u6280\u672f\u95e8\u7c7b\u7684\u51fa\u73b0\uff0c\u66f4\u597d\u7684\u89e3\u51b3\u4e86\u8fd9\u4e9b\u95ee\u9898\uff0c\u5b83\u544a\u8bc9\u4e86\u4e16\u754c\u4e0d\u4ec5\u4ec5\u662fsql\u3002 \u4e86\u89e3\uff1a3V + 3\u9ad8 \u5927\u6570\u636e\u65f6\u4ee3\u76843V \uff1a\u4e3b\u8981\u662f\u63cf\u8ff0\u95ee\u9898\u7684 \u6d77\u91cfVelume \u591a\u6837Variety \u5b9e\u65f6Velocity \u5927\u6570\u636e\u65f6\u4ee3\u76843\u9ad8 \uff1a \u4e3b\u8981\u662f\u5bf9\u7a0b\u5e8f\u7684\u8981\u6c42 \u9ad8\u5e76\u53d1 \u9ad8\u53ef\u6269 \u9ad8\u6027\u80fd","title":"2. \u4e3a\u4ec0\u4e48\u662fNoSQL"},{"location":"cs/db/redis/datatype/#3-nosql","text":"","title":"3. NoSQL\u7684\u56db\u5927\u5206\u7c7b"},{"location":"cs/db/redis/datatype/#31-key-value","text":"# 1.\u8bf4\u660e: - \u8fd9\u4e00\u7c7b\u6570\u636e\u5e93\u4e3b\u8981\u4f1a\u4f7f\u7528\u5230\u4e00\u4e2a\u54c8\u5e0c\u8868\uff0c\u8fd9\u4e2a\u8868\u4e2d\u6709\u4e00\u4e2a\u7279\u5b9a\u7684\u952e\u548c\u4e00\u4e2a\u6307\u9488\u6307\u5411\u7279\u5b9a\u7684\u6570\u636e\u3002 # 2.\u7279\u70b9 - Key/value\u6a21\u578b\u5bf9\u4e8eIT\u7cfb\u7edf\u6765\u8bf4\u7684\u4f18\u52bf\u5728\u4e8e\u7b80\u5355\u3001\u6613\u90e8\u7f72\u3002 - \u4f46\u662f\u5982\u679cDBA\u53ea\u5bf9\u90e8\u5206\u503c\u8fdb\u884c\u67e5\u8be2\u6216\u66f4\u65b0\u7684\u65f6\u5019\uff0cKey/value\u5c31\u663e\u5f97\u6548\u7387\u4f4e\u4e0b\u4e86\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Tokyo Cabinet/Tyrant, - Redis - SSDB - Voldemort - Oracle BDB","title":"3.1 \u952e\u503c(Key-Value)\u5b58\u50a8\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#32","text":"# 1.\u8bf4\u660e - \u8fd9\u90e8\u5206\u6570\u636e\u5e93\u901a\u5e38\u662f\u7528\u6765\u5e94\u5bf9\u5206\u5e03\u5f0f\u5b58\u50a8\u7684\u6d77\u91cf\u6570\u636e\u3002 # 2.\u7279\u70b9 - \u952e\u4ecd\u7136\u5b58\u5728\uff0c\u4f46\u662f\u5b83\u4eec\u7684\u7279\u70b9\u662f\u6307\u5411\u4e86\u591a\u4e2a\u5217\u3002\u8fd9\u4e9b\u5217\u662f\u7531\u5217\u5bb6\u65cf\u6765\u5b89\u6392\u7684\u3002 # 3.\u76f8\u5173\u4ea7\u54c1 - Cassandra\u3001HBase\u3001Riak.","title":"3.2 \u5217\u5b58\u50a8\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#33","text":"# 1.\u8bf4\u660e - \u6587\u6863\u578b\u6570\u636e\u5e93\u7684\u7075\u611f\u662f\u6765\u81ea\u4e8eLotus Notes\u529e\u516c\u8f6f\u4ef6\u7684\uff0c\u800c\u4e14\u5b83\u540c\u7b2c\u4e00\u79cd\u952e\u503c\u5b58\u50a8\u76f8\u7c7b\u4f3c\u8be5\u7c7b\u578b\u7684\u6570\u636e\u6a21\u578b\u662f\u7248\u672c\u5316\u7684\u6587\u6863\uff0c\u534a\u7ed3\u6784\u5316\u7684\u6587\u6863\u4ee5\u7279\u5b9a\u7684\u683c\u5f0f\u5b58\u50a8\uff0c\u6bd4\u5982JSON\u3002\u6587\u6863\u578b\u6570\u636e\u5e93\u53ef \u4ee5\u770b\u4f5c\u662f\u952e\u503c\u6570\u636e\u5e93\u7684\u5347\u7ea7\u7248\uff0c\u5141\u8bb8\u4e4b\u95f4\u5d4c\u5957\u952e\u503c\u3002\u800c\u4e14\u6587\u6863\u578b\u6570\u636e\u5e93\u6bd4\u952e\u503c\u6570\u636e\u5e93\u7684\u67e5\u8be2\u6548\u7387\u66f4\u9ad8 # 2.\u7279\u70b9 - \u4ee5\u6587\u6863\u5f62\u5f0f\u5b58\u50a8 # 3.\u76f8\u5173\u4ea7\u54c1 - MongoDB\u3001CouchDB\u3001 MongoDb ( 4 .x ) . \u56fd\u5185\u4e5f\u6709\u6587\u6863\u578b\u6570\u636e\u5e93SequoiaDB\uff0c\u5df2\u7ecf\u5f00\u6e90\u3002","title":"3.3 \u6587\u6863\u578b\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#34-graph","text":"# 1.\u8bf4\u660e - \u56fe\u5f62\u7ed3\u6784\u7684\u6570\u636e\u5e93\u540c\u5176\u4ed6\u884c\u5217\u4ee5\u53ca\u521a\u6027\u7ed3\u6784\u7684SQL\u6570\u636e\u5e93\u4e0d\u540c\uff0c\u5b83\u662f\u4f7f\u7528\u7075\u6d3b\u7684\u56fe\u5f62\u6a21\u578b\uff0c\u5e76\u4e14\u80fd\u591f\u6269\u5c55\u5230\u591a\u4e2a\u670d\u52a1\u5668\u4e0a\u3002 - NoSQL\u6570\u636e\u5e93\u6ca1\u6709\u6807\u51c6\u7684\u67e5\u8be2\u8bed\u8a00 ( SQL ) \uff0c\u56e0\u6b64\u8fdb\u884c\u6570\u636e\u5e93\u67e5\u8be2\u9700\u8981\u5236\u5b9a\u6570\u636e\u6a21\u578b\u3002\u8bb8\u591aNoSQL\u6570\u636e\u5e93\u90fd\u6709REST\u5f0f\u7684\u6570\u636e\u63a5\u53e3\u6216\u8005\u67e5\u8be2API\u3002 # 2.\u7279\u70b9 # 3.\u76f8\u5173\u4ea7\u54c1 - Neo4J\u3001InfoGrid\u3001 Infinite Graph\u3001","title":"3.4 \u56fe\u5f62(Graph)\u6570\u636e\u5e93"},{"location":"cs/db/redis/datatype/#4-nosql","text":"\u6570\u636e\u6a21\u578b\u6bd4\u8f83\u7b80\u5355 \u9700\u8981\u7075\u6d3b\u6027\u66f4\u5f3a\u7684IT\u7cfb\u7edf \u5bf9\u6570\u636e\u5e93\u6027\u80fd\u8981\u6c42\u8f83\u9ad8 \u4e0d\u9700\u8981\u9ad8\u5ea6\u7684\u6570\u636e\u4e00\u81f4\u6027","title":"4. NoSQL\u5e94\u7528\u573a\u666f"},{"location":"cs/db/redis/datatype/#5-redis","text":"Redis \u5f00\u6e90 \u9075\u5faaBSD \u57fa\u4e8e\u5185\u5b58\u6570\u636e\u5b58\u50a8 \u88ab\u7528\u4e8e\u4f5c\u4e3a \u6570\u636e\u5e93 \u7f13\u5b58 \u6d88\u606f\u4e2d\u95f4\u4ef6 redis\u662f\u4e00\u4e2a\u5185\u5b58\u578b\u7684\u6570\u636e\u5e93","title":"5. \u4ec0\u4e48\u662fRedis"},{"location":"cs/db/redis/datatype/#6-redis","text":"Redis\u662f\u4e00\u4e2a\u9ad8\u6027\u80fdkey/value\u5185\u5b58\u578b\u6570\u636e\u5e93 Redis\u652f\u6301\u4e30\u5bcc\u7684\u6570\u636e\u7c7b\u578b Redis\u652f\u6301\u6301\u4e45\u5316 Redis\u5355\u7ebf\u7a0b,\u5355\u8fdb\u7a0b \u5355\u7ebf\u7a0b\u4e0d\u4e00\u5b9a\u6bd4\u591a\u7ebf\u7a0b\u6162\uff0c\u5728CPU\u4e2d\uff0c\u591a\u7ebf\u7a0b\u9700\u8981\u8df3\u8f6c\uff0c\u800c\u5355\u7ebf\u7a0b\u4e0d\u9700\u8981\uff0c\u51cf\u5c11\u4e86\u8df3\u8f6c\u7684\u6d88\u8017\uff0c\u6240\u4ee5\u5728\u67d0\u4e9b\u573a\u666f\u91cc\u5355\u7ebf\u7a0b\u53ef\u80fd\u6bd4\u591a\u7ebf\u7a0b\u5feb\u3002","title":"6. Redis\u7279\u70b9"},{"location":"cs/db/redis/datatype/#7-ridis","text":"\u7565","title":"7. Ridis\u5b89\u88c5"},{"location":"cs/db/redis/datatype/#8-redis","text":"","title":"8. redis\u5e38\u7528\u547d\u4ee4"},{"location":"cs/db/redis/datatype/#81-set-get","text":"","title":"8.1 set get\u547d\u4ee4\uff0c\u5b58\u503c\uff0c\u53d6\u503c"},{"location":"cs/db/redis/datatype/#82-redis160select","text":"","title":"8.2 \u5207\u6362\u6570\u636e\u5e93\uff0credis\u9ed8\u8ba4\u670916\u4e2a\u6570\u636e\u5e93\uff0c\u9ed8\u8ba4\u4f7f\u75280\u53f7\u6570\u636e\u5e93\uff0c\u53ef\u4ee5\u901a\u8fc7select\u5207\u6362"},{"location":"cs/db/redis/datatype/#83-flushdbflushall","text":"","title":"8.3 \u6e05\u7a7a\u5f53\u524d\u6570\u636e\u5e93\uff1aflushdb,\u6e05\u7a7a\u6240\u6709\u6570\u636e\u5e93\uff1aflushall"},{"location":"cs/db/redis/datatype/#84-key-keys","text":"","title":"8.4 \u67e5\u8be2\u6240\u6709key: keys*"},{"location":"cs/db/redis/datatype/#85-dbsize","text":"","title":"8.5 \u67e5\u8be2\u6570\u636e\u5e93\u7684\u5927\u5c0f\uff1adbsize"},{"location":"cs/db/redis/datatype/#86-keyexists-keyname10","text":"","title":"8.6 \u67e5\u770bkey\u662f\u5426\u5b58\u5728\uff1aexists keyName,\u5b58\u5728\u8fd4\u56de1\uff0c\u5426\u5219\u8fd4\u56de0"},{"location":"cs/db/redis/datatype/#87-key-move-keyname-1","text":"","title":"8.7 \u79fb\u9664Key: move keyName 1"},{"location":"cs/db/redis/datatype/#88-key-expire-keyname-timeout","text":"","title":"8.8 \u4e3akey\u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4: expire keyName timeout"},{"location":"cs/db/redis/datatype/#89-keyttl-keyname","text":"","title":"8.9 \u67e5\u770bkey\u7684\u5269\u4f59\u5b58\u6d3b\u65f6\u95f4\uff1attl keyName"},{"location":"cs/db/redis/datatype/#810-keytype-keyname","text":"","title":"8.10 \u67e5\u770bkey\u7684\u7c7b\u578b\uff1atype keyName"},{"location":"cs/db/redis/datatype/#9-string","text":"| \u547d\u4ee4 | \u8bf4\u660e | | ------------------------- | ----------------------- | | set | \u8bbe\u7f6e\u4e00\u4e2akey/value | | get | \u6839\u636ekey\u83b7\u5f97\u5bf9\u5e94\u7684value | | mset | \u4e00\u6b21\u8bbe\u7f6e\u591a\u4e2akey value | | mget | \u4e00\u6b21\u83b7\u5f97\u591a\u4e2akey\u7684value | | getset | \u83b7\u5f97\u539f\u59cbkey\u7684\u503c\uff0c\u540c\u65f6\u8bbe\u7f6e\u65b0\u503c | | strlen | \u83b7\u5f97\u5bf9\u5e94key\u5b58\u50a8value\u7684\u957f\u5ea6 | | append | \u4e3a\u5bf9\u5e94key\u7684value\u8ffd\u52a0\u5185\u5bb9 | | getrange \u7d22\u5f150\u5f00\u59cb | \u622a\u53d6value\u7684\u5185\u5bb9 | | setex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u79d2\uff09 | | psetex | \u8bbe\u7f6e\u4e00\u4e2akey\u5b58\u6d3b\u7684\u6709\u6548\u671f\uff08\u6beb\u79d2\uff09 | | setnx | \u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c,\u4e0d\u5b58\u5728\u6dfb\u52a0 | | msetnx\u539f\u5b50\u64cd\u4f5c ( \u53ea\u8981\u6709\u4e00\u4e2a\u5b58\u5728\u4e0d\u505a\u4efb\u4f55\u64cd\u4f5c ) | \u53ef\u4ee5\u540c\u65f6\u8bbe\u7f6e\u591a\u4e2akey,\u53ea\u6709\u6709\u4e00\u4e2a\u5b58\u5728\u90fd\u4e0d\u4fdd\u5b58 | | decr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684-1\u64cd\u4f5c | | decrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u51cf\u6cd5\u64cd\u4f5c | | Incr | \u8fdb\u884c\u6570\u503c\u7c7b\u578b\u7684+1\u64cd\u4f5c | | incrby | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u8fdb\u884c\u52a0\u6cd5\u64cd\u4f5c | | Incrbyfloat | \u6839\u636e\u63d0\u4f9b\u7684\u6570\u636e\u52a0\u5165\u6d6e\u70b9\u6570 |","title":"9. String\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#91-strlenvalueappend","text":"","title":"9.1 strlen:\u6c42value\u7684\u957f\u5ea6\uff0cappend\uff1a\u8ffd\u52a0"},{"location":"cs/db/redis/datatype/#92-incr-incrby-decr-decrby","text":"","title":"9.2 \u81ea\u589e,\u81ea\u51cf\u64cd\u4f5c\uff1aincr incrby decr decrby"},{"location":"cs/db/redis/datatype/#93-getrangesetrange","text":"","title":"9.3 \u5b57\u7b26\u4e32\u7684\u8303\u56f4\u64cd\u4f5c\uff1agetrange,setrange"},{"location":"cs/db/redis/datatype/#94-setexkeysetnx","text":"","title":"9.4 \u8bbe\u7f6e\u8fc7\u671f\u65f6\u95f4\uff1asetex\uff08\u5982\u679c\u5b58\u5728Key\u5219\u8986\u76d6\uff0c\u4e0d\u5b58\u5728\u5219\u521b\u5efa\uff09\uff0csetnx(\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8bbe\u7f6e)"},{"location":"cs/db/redis/datatype/#95-msetmget-msetnx","text":"","title":"9.5 \u6279\u91cf\u8bbe\u7f6e\u548c\u83b7\u53d6\u503c\uff1amset,mget, msetnx(\u64cd\u4f5c\u4e3a\u539f\u5b50\u6027\uff0c\u8981\u4e48\u90fd\u6210\u529f\uff0c\u8981\u4e48\u90fd\u5931\u8d25)"},{"location":"cs/db/redis/datatype/#96","text":"","title":"9.6 \u5b58\u53d6\u5bf9\u8c61"},{"location":"cs/db/redis/datatype/#97-getsetnil","text":"String\u7c7b\u4f3c\u7684\u4f7f\u7528\u573a\u666f\uff1avalue\u9664\u4e86\u662f\u6211\u4eec\u7684\u5b57\u7b26\u4e32\u8fd8\u53ef\u4ee5\u662f\u6211\u4eec\u7684\u6570\u5b57\uff01 \u8ba1\u6570\u5668 \u7edf\u8ba1\u591a\u5355\u4f4d\u7684\u6570\u91cf \u7c89\u4e1d\u6570 \u5bf9\u8c61\u7f13\u5b58\u5b58\u50a8","title":"9.7 \u7ec4\u5408\u64cd\u4f5c\uff1agetset\u5148\u83b7\u53d6\u518d\u8bbe\u7f6e,\u5982\u679c\u4e0d\u5b58\u5728\u5c31\u8fd4\u56denil"},{"location":"cs/db/redis/datatype/#10-list","text":"list\u7684\u547d\u4ee4\u90fd\u662fl\u5f00\u5934,list \u5217\u8868 \u76f8\u5f53\u4e8ejava\u4e2dlist \u96c6\u5408 \u7279\u70b9 \u5143\u7d20\u6709\u5e8f \u4e14 \u53ef\u4ee5\u91cd\u590d | \u547d\u4ee4 | \u8bf4\u660e | | ------- | --------------------- | | lpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u5934\u90e8 | | lpushx | \u540clpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | rpush | \u5c06\u67d0\u4e2a\u503c\u52a0\u5165\u5230\u4e00\u4e2akey\u5217\u8868\u672b\u5c3e | | rpushx | \u540crpush,\u4f46\u662f\u5fc5\u987b\u8981\u4fdd\u8bc1\u8fd9\u4e2akey\u5b58\u5728 | | lpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u5de6\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | rpop | \u8fd4\u56de\u548c\u79fb\u9664\u5217\u8868\u53f3\u8fb9\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 | | lrange | \u83b7\u53d6\u67d0\u4e00\u4e2a\u4e0b\u6807\u533a\u95f4\u5185\u7684\u5143\u7d20 | | llen | \u83b7\u53d6\u5217\u8868\u5143\u7d20\u4e2a\u6570 | | lset | \u8bbe\u7f6e\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u7684\u503c ( \u7d22\u5f15\u5fc5\u987b\u5b58\u5728 ) | | lindex | \u83b7\u53d6\u67d0\u4e00\u4e2a\u6307\u5b9a\u7d22\u5f15\u4f4d\u7f6e\u7684\u5143\u7d20 | | lrem | \u5220\u9664\u91cd\u590d\u5143\u7d20 | | ltrim | \u4fdd\u7559\u5217\u8868\u4e2d\u7279\u5b9a\u533a\u95f4\u5185\u7684\u5143\u7d20 | | linsert | \u5728\u67d0\u4e00\u4e2a\u5143\u7d20\u4e4b\u524d\uff0c\u4e4b\u540e\u63d2\u5165\u65b0\u5143\u7d20 |","title":"10. list\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#101-lpushlpop","text":"","title":"10.1 \u5de6\u63d2\uff1alpush,\u5de6\u5220\uff1alpop"},{"location":"cs/db/redis/datatype/#102-rpushrpop","text":"","title":"10.2 \u53f3\u63d2\uff1arpush,\u53f3\u5220\uff1arpop"},{"location":"cs/db/redis/datatype/#103-lrange","text":"","title":"10.3 \u83b7\u53d6\u5217\u8868\u5143\u7d20\uff1alrange"},{"location":"cs/db/redis/datatype/#104-lindex","text":"","title":"10.4 \u901a\u8fc7\u4e0b\u6807\u83b7\u53d6\u5143\u7d20\uff1alindex"},{"location":"cs/db/redis/datatype/#105-llen","text":"","title":"10.5 \u83b7\u53d6\u5217\u8868\u957f\u5ea6\uff1allen"},{"location":"cs/db/redis/datatype/#106-lrem-value","text":"","title":"10.6 \u79fb\u9664\u5177\u4f53\u7684\u503c\u6240\u5728\u7684\u952e\u503c\u5bf9:lrem \u5217\u8868 \u79fb\u9664\u51e0\u4e2a \u79fb\u9664\u7684\u5177\u4f53value"},{"location":"cs/db/redis/datatype/#107-ltrim","text":"","title":"10.7 \u622a\u53d6\u64cd\u4f5c\uff1altrim \u5217\u8868 \u622a\u53d6\u7684\u5f00\u59cb\u4e0b\u6807 \u622a\u53d6\u7684\u7ed3\u675f\u4e0b\u6807"},{"location":"cs/db/redis/datatype/#108-rpoplpush","text":"","title":"10.8 rpoplpush:\u79fb\u9664\u5217\u8868\u4e2d\u7684\u6700\u540e\u4e00\u4e2a\u5143\u7d20\u5e76\u5c06\u8fd9\u4e2a\u5143\u7d20\u653e\u5230\u4e00\u4e2a\u65b0\u7684\u5217\u8868\u4e2d"},{"location":"cs/db/redis/datatype/#109-exists-list","text":"","title":"10.9 \u5224\u65ad\u5217\u8868\u662f\u5426\u5b58\u5728\uff1aEXISTS list"},{"location":"cs/db/redis/datatype/#1010-lsetvalue","text":"","title":"10.10 lset:\u66f4\u65b0\u5217\u8868\u4e2d\u6307\u5b9a\u4e0b\u6807\u7684\u5143\u7d20\u7684value,\u524d\u63d0\u662f\u8be5\u4e0b\u6807\u5fc5\u987b\u6709\u503c\uff0c\u5426\u5219\u62a5\u9519"},{"location":"cs/db/redis/datatype/#1011-linsert","text":"","title":"10.11 \u5728\u5217\u8868\u4e2d\u63d2\u5165\u503c\uff1a\u524d\u63d2\u548c\u540e\u63d2\uff1alinsert"},{"location":"cs/db/redis/datatype/#11-set","text":"set\u662f\u65e0\u5e8f\u4e0d\u91cd\u590d\u96c6\u5408\uff0cset\u547d\u4ee4\u90fd\u662fs\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ----------- | ------------------------- | | sadd | \u4e3a\u96c6\u5408\u6dfb\u52a0\u5143\u7d20 | | smembers | \u663e\u793a\u96c6\u5408\u4e2d\u6240\u6709\u5143\u7d20 \u65e0\u5e8f | | scard | \u8fd4\u56de\u96c6\u5408\u4e2d\u5143\u7d20\u7684\u4e2a\u6570 | | spop | \u968f\u673a\u8fd4\u56de\u4e00\u4e2a\u5143\u7d20 \u5e76\u5c06\u5143\u7d20\u5728\u96c6\u5408\u4e2d\u5220\u9664 | | smove | \u4ece\u4e00\u4e2a\u96c6\u5408\u4e2d\u5411\u53e6\u4e00\u4e2a\u96c6\u5408\u79fb\u52a8\u5143\u7d20 \u5fc5\u987b\u662f\u540c\u4e00\u79cd\u7c7b\u578b | | srem | \u4ece\u96c6\u5408\u4e2d\u5220\u9664\u4e00\u4e2a\u5143\u7d20 | | sismember | \u5224\u65ad\u4e00\u4e2a\u96c6\u5408\u4e2d\u662f\u5426\u542b\u6709\u8fd9\u4e2a\u5143\u7d20 | | srandmember | \u968f\u673a\u8fd4\u56de\u5143\u7d20 | | sdiff | \u53bb\u6389\u7b2c\u4e00\u4e2a\u96c6\u5408\u4e2d\u5176\u5b83\u96c6\u5408\u542b\u6709\u7684\u76f8\u540c\u5143\u7d20 | | sinter | \u6c42\u4ea4\u96c6 | | sunion | \u6c42\u548c\u96c6 |","title":"11. set\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#111-sadd","text":"","title":"11.1 \u6dfb\u52a0\uff1asadd"},{"location":"cs/db/redis/datatype/#112-smembers","text":"","title":"11.2 \u67e5\u770b\u6240\u6709: smembers"},{"location":"cs/db/redis/datatype/#113-setscard","text":"","title":"11.3 \u67e5\u8be2set\u7684\u5143\u7d20\u4e2a\u6570\uff1ascard"},{"location":"cs/db/redis/datatype/#114-setsismember","text":"","title":"11.4 \u5224\u65adset\u4e2d\u662f\u5426\u5b58\u5728\u67d0\u5143\u7d20\uff1asismember"},{"location":"cs/db/redis/datatype/#115-srem","text":"","title":"11.5 \u79fb\u9664\u67d0\u4e2a\u5143\u7d20\uff1asrem"},{"location":"cs/db/redis/datatype/#116-srandmember","text":"","title":"11.6 \u968f\u673a\u62bd\u53d6\u4e00\u4e2a\u5143\u7d20\uff1aSRANDMEMBER"},{"location":"cs/db/redis/datatype/#117-spop","text":"","title":"11.7 \u968f\u673a\u79fb\u9664\u4e00\u4e2a\u5143\u7d20\uff1aspop"},{"location":"cs/db/redis/datatype/#118-smove","text":"","title":"11.8 \u5c06\u4e00\u4e2a\u96c6\u5408\u4e2d\u7684\u5143\u7d20\u79fb\u52a8\u5230\u53e6\u4e00\u4e2a\u96c6\u5408\u4e2d\uff1asmove"},{"location":"cs/db/redis/datatype/#119-sinter-sunite-sdiff","text":"","title":"11.9 \u96c6\u5408\u4e4b\u95f4\u6c42\u4ea4\u5e76\u8865\u96c6\uff1asinter sunite sdiff"},{"location":"cs/db/redis/datatype/#sdiff","text":"","title":"\u5dee\u96c6sdiff"},{"location":"cs/db/redis/datatype/#sinter","text":"","title":"\u4ea4\u96c6sinter"},{"location":"cs/db/redis/datatype/#sunion","text":"","title":"\u5e76\u96c6sunion"},{"location":"cs/db/redis/datatype/#12-hash","text":"hash\u7684\u5f62\u5f0f\uff1akey filed vlaue,\u76f8\u5f53\u4e8ejava\u4e2d\u7684map\u96c6\u5408 hash\u547d\u4ee4\u90fd\u662fh\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ------------ | --------------- | | hset | \u8bbe\u7f6e\u4e00\u4e2akey/value\u5bf9 | | hget | \u83b7\u5f97\u4e00\u4e2akey\u5bf9\u5e94\u7684value | | hgetall | \u83b7\u5f97\u6240\u6709\u7684key/value\u5bf9 | | hdel | \u5220\u9664\u67d0\u4e00\u4e2akey/value\u5bf9 | | hexists | \u5224\u65ad\u4e00\u4e2akey\u662f\u5426\u5b58\u5728 | | hkeys | \u83b7\u5f97\u6240\u6709\u7684key | | hvals | \u83b7\u5f97\u6240\u6709\u7684value | | hmset | \u8bbe\u7f6e\u591a\u4e2akey/value | | hmget | \u83b7\u5f97\u591a\u4e2akey\u7684value | | hsetnx | \u8bbe\u7f6e\u4e00\u4e2a\u4e0d\u5b58\u5728\u7684key\u7684\u503c | | hincrby | \u4e3avalue\u8fdb\u884c\u52a0\u6cd5\u8fd0\u7b97 | | hincrbyfloat | \u4e3avalue\u52a0\u5165\u6d6e\u70b9\u503c |","title":"12. hash\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#121-hashhset","text":"","title":"12.1 \u5411hash\u4e2d\u6dfb\u52a0\u503c\uff1ahset"},{"location":"cs/db/redis/datatype/#122-hashfiledhget","text":"","title":"12.2 \u5f97\u5230hash\u4e2d\u7684\u6307\u5b9afiled\u7684\u503c\uff1ahget"},{"location":"cs/db/redis/datatype/#123-hashhgetall","text":"","title":"12.3 \u5f97\u5230hash\u4e2d\u7684\u6240\u6709\u503c:hgetall"},{"location":"cs/db/redis/datatype/#124-hmset-hmget","text":"","title":"12.4 \u6279\u91cf\u6dfb\u52a0\u548c\u83b7\u53d6\uff1ahmset hmget"},{"location":"cs/db/redis/datatype/#125-hdel","text":"","title":"12.5 \u5220\u9664\u6307\u5b9a\u7684\u5b57\u6bb5\uff1ahdel"},{"location":"cs/db/redis/datatype/#126-hashhlen","text":"","title":"12.6 \u83b7\u53d6hash\u7684\u5b57\u6bb5\u957f\u5ea6\uff1ahlen"},{"location":"cs/db/redis/datatype/#127-hashhexist","text":"","title":"12.7 \u5224\u65adhash\u4e2d\u7684\u5b57\u6bb5\u662f\u5426\u5b58\u5728\uff1ahexist"},{"location":"cs/db/redis/datatype/#128-keyhkeysvaluehvals","text":"","title":"12.8 \u83b7\u53d6\u6240\u6709\u7684key(\u5b57\u6bb5)hkeys,\u83b7\u53d6\u6240\u6709\u7684value\uff1ahvals"},{"location":"cs/db/redis/datatype/#129-hincrby","text":"hash\u53d8\u66f4\u7684\u6570\u636e user name age,\u5c24\u5176\u662f\u662f\u7528\u6237\u4fe1\u606f\u4e4b\u7c7b\u7684\uff0c\u7ecf\u5e38\u53d8\u52a8\u7684\u4fe1\u606f\uff01 hash \u66f4\u9002\u5408\u4e8e\u5bf9\u8c61\u7684\u5b58\u50a8\uff0cString\u66f4\u52a0\u9002\u5408\u5b57\u7b26\u4e32\u5b58\u50a8\uff01","title":"12.9 \u6307\u5b9a\u589e\u91cf\uff1ahincrby"},{"location":"cs/db/redis/datatype/#13-zset","text":"zset\u662f\u6709\u5e8f\u4e0d\u53ef\u91cd\u590d\u7684\u96c6\u5408,zset\u547d\u4ee4\u90fd\u662fz\u5f00\u5934 | \u547d\u4ee4 | \u8bf4\u660e | | ---------------------- | -------------- | | zadd | \u6dfb\u52a0\u4e00\u4e2a\u6709\u5e8f\u96c6\u5408\u5143\u7d20 | | zcard | \u8fd4\u56de\u96c6\u5408\u7684\u5143\u7d20\u4e2a\u6570 | | zrange \u5347\u5e8f zrevrange \u964d\u5e8f | \u8fd4\u56de\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrangebyscore | \u6309\u7167\u5206\u6570\u67e5\u627e\u4e00\u4e2a\u8303\u56f4\u5185\u7684\u5143\u7d20 | | zrank | \u8fd4\u56de\u6392\u540d | | zrevrank | \u5012\u5e8f\u6392\u540d | | zscore | \u663e\u793a\u67d0\u4e00\u4e2a\u5143\u7d20\u7684\u5206\u6570 | | zrem | \u79fb\u9664\u67d0\u4e00\u4e2a\u5143\u7d20 | | zincrby | \u7ed9\u67d0\u4e2a\u7279\u5b9a\u5143\u7d20\u52a0\u5206 |","title":"13. Zset\u8be6\u89e3"},{"location":"cs/db/redis/datatype/#131-zadd","text":"","title":"13.1 \u6dfb\u52a0\u6570\u636e\uff1azadd"},{"location":"cs/db/redis/datatype/#132-zrange","text":"","title":"13.2 \u83b7\u53d6\u6240\u6709\u503c,\u6309\u7167\u7d22\u5f15\u83b7\u53d6\uff1azrange"},{"location":"cs/db/redis/datatype/#133-scorezrangebyscore","text":"","title":"13.3 \u83b7\u53d6\u6240\u6709\u503c\uff0c\u6309\u7167score\u83b7\u53d6\uff1azrangebyscore"},{"location":"cs/db/redis/datatype/#134-zrem","text":"","title":"13.4 \u79fb\u9664\u5143\u7d20\uff1azrem"},{"location":"cs/db/redis/datatype/#135-zcard","text":"","title":"13.5 \u5f97\u5230\u5143\u7d20\u7684\u4e2a\u6570:zcard"},{"location":"cs/db/redis/datatype/#136-zcount","text":"ZSET \u5b98\u65b9 \u53ef\u6392\u5e8fSET sortSet","title":"13.6 \u83b7\u53d6\u6307\u5b9a\u533a\u95f4\u7684\u6210\u5458\u6570\u91cf\uff1azcount"},{"location":"cs/db/redis/datatype/#14-geospatial","text":"","title":"14. geospatial"},{"location":"cs/db/redis/datatype/#15-bitmaps","text":"bitmap\u5373\u4f4d\u5b58\u50a8\uff0c\u9002\u7528\u4e8e\u53ea\u6709\u4e24\u9762\u6027\u7684\u5185\u5bb9\u3002\u5982\uff1a\u53ef\u4ee5\u7528bitmap\u5b58\u50a8\u7528\u6237\u662f\u5426\u767b\u5f55\uff0c\u662f\u5426\u6ce8\u518c\uff0c\u662f\u5426\u6253\u5361\u7b49\u7b49\u3002bitmap\u7684\u503c\u53ea\u67090\u548c1\u4e24\u4e2a\u503c\u3002","title":"15. bitmaps"},{"location":"cs/db/redis/datatype/#151-setbit","text":"","title":"15.1 \u5b58\u50a8\u6570\u636e\uff1asetbit"},{"location":"cs/db/redis/datatype/#152-getbit","text":"","title":"15.2 \u83b7\u53d6\u6307\u5b9a\u4e0b\u6807\u7684\u503c\uff1agetbit"},{"location":"cs/db/redis/datatype/#153-bitmap1bitcount","text":"","title":"15.3 \u7edf\u8ba1bitmap\u4e2d1\u7684\u4f4d\u6570\uff1abitcount"},{"location":"cs/db/redis/datatype/#16-hyperloglogs","text":"\u7528\u4e8e\u7edf\u8ba1\u57fa\u6570\uff08\u5373\u4e0d\u91cd\u590d\u7684\u6570\u636e\uff09,\u53ef\u4ee5\u7528\u4e8e\u7edf\u8ba1\u7f51\u9875\u8bbf\u95ee\u91cf","title":"16. hyperloglogs"},{"location":"cs/db/redis/datatype/#161-pfadd","text":"","title":"16.1 \u6dfb\u52a0\uff1apfadd"},{"location":"cs/db/redis/datatype/#162-pfcount","text":"","title":"16.2 \u8ba1\u6570\uff1apfcount"},{"location":"cs/db/redis/datatype/#163-pfmerge","text":"","title":"16.3 \u5408\u5e76\uff1apfmerge"},{"location":"cs/db/redis/work/","text":"Redis \u4e8b\u52a1 \u00b6 redis\u7684\u4e8b\u52a1\u64cd\u4f5c \u00b6 redis\u7684\u5355\u6761\u547d\u4ee4\u4fdd\u8bc1\u539f\u5b50\u6027\uff0c\u4f46\u662fredis\u7684\u4e8b\u52a1\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027 redis\u7684\u4e8b\u52a1\u6ca1\u6709\u9694\u79bb\u7ea7\u522b\u3002redis\u4e8b\u52a1\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u7ec4\u547d\u4ee4\u7684\u96c6\u5408\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5728\u4e8b\u52a1\u4e2d\u4f1a\u88ab\u5e8f\u5217\u5316\uff0c\u7136\u540e\u6309\u7167\u547d\u4ee4\u7684\u5148\u540e\u987a\u5e8f\u4e00\u6b21\u6027\u5168\u90e8\u6267\u884c\uff0c\u5728\u6267\u884c\u7684\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u88ab\u6253\u65ad\u3002 \u5373\uff1aredis\u7684\u4e8b\u52a1\u5728\u6267\u884c\u65f6\u662f\u4e00\u6b21\u6027\uff0c\u987a\u5e8f\u6027\u548c\u6392\u4ed6\u6027\u7684 \u5f00\u542f\u4e8b\u52a1\uff1amulti \u00b6 \u547d\u4ee4\u5165\u961f: \u00b6 \u6267\u884c\u4e8b\u52a1:exec \u00b6 \u653e\u5f03\u4e8b\u52a1\uff1adiscard \u00b6 \u4e8b\u52a1\u5f02\u5e38 \u00b6 \u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u5982\u679c\u7f16\u5199\u7684\u547d\u4ee4\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u5219\u4f1a\u7acb\u5373\u62a5\u9519\uff0c\u4e14\u6574\u4e2a\u4e8b\u52a1\u961f\u5217\u4e2d\u7684\u6240\u6709\u547d\u4ee4\u90fd\u4e0d\u4f1a\u6267\u884c. \u5982\u679c\u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u547d\u4ee4\u4e2d\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u4f46\u662f\u5374\u6709\u8fd0\u884c\u9519\u8bef\uff0c\u5373\u547d\u4ee4\u80fd\u591f\u6210\u529f\u5165\u961f\uff0c\u4f46\u662f\u4e0d\u80fd\u591f\u6267\u884c\uff0c\u5219\u5728\u4e8b\u52a1\u63d0\u4ea4\u540e\u53ea\u6709\u8be5\u547d\u4ee4\u629b\u9519\uff0c\u5176\u4ed6\u547d\u4ee4\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\u3002 redis\u7684\u4e50\u89c2\u9501 \u00b6 \u4e50\u89c2\u9501\uff1a\u5c31\u662f\u5b83\u4f1a\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4e0d\u4f1a\u5931\u8d25\uff0c\u56e0\u6b64\u5b83\u4e0d\u4f1a\u7ed9\u4e8b\u52a1\u4e0a\u9501\u3002\u5b83\u53ea\u4f1a\u5728\u66f4\u65b0\u7684\u65f6\u5019\u5224\u65ad\u5728\u6b64\u671f\u95f4\u662f\u5426\u6709\u4eba\u4fee\u6539\u8fc7\u6570\u636e \u60b2\u89c2\u9501\uff1a\u5b83\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4f1a\u6267\u884c\u5931\u8d25\uff0c\u56e0\u6b64\u505a\u4efb\u4f55\u4e8b\u60c5\u5b83\u90fd\u4f1a\u52a0\u9501\uff0c\u8fd9\u6837\u662f\u53ca\u5176\u5f71\u54cd\u6548\u7387\u7684\u3002 redis\u7684\u4e50\u89c2\u9501\u5b9e\u73b0\u547d\u4ee4\uff1awatch \u00b6 \u5355\u7ebf\u7a0b\u4e0b\u8fd0\u884c \u00b6 \u591a\u7ebf\u7a0b\u4fee\u6539\u503c \u00b6 \u5982\u679c\u4e8b\u52a1\u6267\u884c\u5931\u8d25\uff0c\u9700\u8981\u5148\u89e3\u9501\uff0c\u518d\u52a0\u9501\uff0c\u89e3\u9501\u547d\u4ee4\u4e3a\uff1aunwatch \u00b6","title":"\u4e8b\u52a1"},{"location":"cs/db/redis/work/#redis","text":"","title":"Redis \u4e8b\u52a1"},{"location":"cs/db/redis/work/#redis_1","text":"redis\u7684\u5355\u6761\u547d\u4ee4\u4fdd\u8bc1\u539f\u5b50\u6027\uff0c\u4f46\u662fredis\u7684\u4e8b\u52a1\u4e0d\u4fdd\u8bc1\u539f\u5b50\u6027 redis\u7684\u4e8b\u52a1\u6ca1\u6709\u9694\u79bb\u7ea7\u522b\u3002redis\u4e8b\u52a1\u5b9e\u9645\u4e0a\u5c31\u662f\u4e00\u7ec4\u547d\u4ee4\u7684\u96c6\u5408\uff0c\u8fd9\u4e9b\u547d\u4ee4\u5728\u4e8b\u52a1\u4e2d\u4f1a\u88ab\u5e8f\u5217\u5316\uff0c\u7136\u540e\u6309\u7167\u547d\u4ee4\u7684\u5148\u540e\u987a\u5e8f\u4e00\u6b21\u6027\u5168\u90e8\u6267\u884c\uff0c\u5728\u6267\u884c\u7684\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u88ab\u6253\u65ad\u3002 \u5373\uff1aredis\u7684\u4e8b\u52a1\u5728\u6267\u884c\u65f6\u662f\u4e00\u6b21\u6027\uff0c\u987a\u5e8f\u6027\u548c\u6392\u4ed6\u6027\u7684","title":"redis\u7684\u4e8b\u52a1\u64cd\u4f5c"},{"location":"cs/db/redis/work/#multi","text":"","title":"\u5f00\u542f\u4e8b\u52a1\uff1amulti"},{"location":"cs/db/redis/work/#_1","text":"","title":"\u547d\u4ee4\u5165\u961f:"},{"location":"cs/db/redis/work/#exec","text":"","title":"\u6267\u884c\u4e8b\u52a1:exec"},{"location":"cs/db/redis/work/#discard","text":"","title":"\u653e\u5f03\u4e8b\u52a1\uff1adiscard"},{"location":"cs/db/redis/work/#_2","text":"\u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u5982\u679c\u7f16\u5199\u7684\u547d\u4ee4\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u5219\u4f1a\u7acb\u5373\u62a5\u9519\uff0c\u4e14\u6574\u4e2a\u4e8b\u52a1\u961f\u5217\u4e2d\u7684\u6240\u6709\u547d\u4ee4\u90fd\u4e0d\u4f1a\u6267\u884c. \u5982\u679c\u5728\u5f00\u542f\u4e8b\u52a1\u540e\uff0c\u547d\u4ee4\u4e2d\u6ca1\u6709\u8bed\u6cd5\u9519\u8bef\uff0c\u4f46\u662f\u5374\u6709\u8fd0\u884c\u9519\u8bef\uff0c\u5373\u547d\u4ee4\u80fd\u591f\u6210\u529f\u5165\u961f\uff0c\u4f46\u662f\u4e0d\u80fd\u591f\u6267\u884c\uff0c\u5219\u5728\u4e8b\u52a1\u63d0\u4ea4\u540e\u53ea\u6709\u8be5\u547d\u4ee4\u629b\u9519\uff0c\u5176\u4ed6\u547d\u4ee4\u53ef\u4ee5\u6b63\u5e38\u6267\u884c\u3002","title":"\u4e8b\u52a1\u5f02\u5e38"},{"location":"cs/db/redis/work/#redis_2","text":"\u4e50\u89c2\u9501\uff1a\u5c31\u662f\u5b83\u4f1a\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4e0d\u4f1a\u5931\u8d25\uff0c\u56e0\u6b64\u5b83\u4e0d\u4f1a\u7ed9\u4e8b\u52a1\u4e0a\u9501\u3002\u5b83\u53ea\u4f1a\u5728\u66f4\u65b0\u7684\u65f6\u5019\u5224\u65ad\u5728\u6b64\u671f\u95f4\u662f\u5426\u6709\u4eba\u4fee\u6539\u8fc7\u6570\u636e \u60b2\u89c2\u9501\uff1a\u5b83\u8ba4\u4e3a\u6240\u6709\u7684\u4e8b\u52a1\u90fd\u4f1a\u6267\u884c\u5931\u8d25\uff0c\u56e0\u6b64\u505a\u4efb\u4f55\u4e8b\u60c5\u5b83\u90fd\u4f1a\u52a0\u9501\uff0c\u8fd9\u6837\u662f\u53ca\u5176\u5f71\u54cd\u6548\u7387\u7684\u3002","title":"redis\u7684\u4e50\u89c2\u9501"},{"location":"cs/db/redis/work/#rediswatch","text":"","title":"redis\u7684\u4e50\u89c2\u9501\u5b9e\u73b0\u547d\u4ee4\uff1awatch"},{"location":"cs/db/redis/work/#_3","text":"","title":"\u5355\u7ebf\u7a0b\u4e0b\u8fd0\u884c"},{"location":"cs/db/redis/work/#_4","text":"","title":"\u591a\u7ebf\u7a0b\u4fee\u6539\u503c"},{"location":"cs/db/redis/work/#unwatch","text":"","title":"\u5982\u679c\u4e8b\u52a1\u6267\u884c\u5931\u8d25\uff0c\u9700\u8981\u5148\u89e3\u9501\uff0c\u518d\u52a0\u9501\uff0c\u89e3\u9501\u547d\u4ee4\u4e3a\uff1aunwatch"},{"location":"cs/hpc/","text":"\u9ad8\u6027\u80fd\u8ba1\u7b97 \u00b6 Abstract \u6211\u7684 mentor\uff08\u5927\ud83d\udc2e\uff09 \u5c31\u662f\u505a hpc \u7684\uff0c\u5f53\u521d\u5b9e\u4e60\u65f6\u4e5f\u6d89\u53ca\u5230\u4e00\u70b9\u70b9\u77e5\u8bc6\uff0c\u6240\u4ee5\u5bf9 hpc \u4e5f\u4ea7\u751f\u4e86\u4e00\u70b9\u70b9\u5174\u8da3\u3002\u867d\u7136\u8bf4\u4ee5\u540e\u5e94\u8be5\u4e0d\u4f1a\u505a hpc\uff0c\u4f46\u662f\u5b66\u4e60\u76f8\u5173\u90e8\u5206\u7684\u77e5\u8bc6\u662f\u6709\u5fc5\u8981\u7684\u3002 Table of Contents \u00b6 \u6982\u8bba \u5411\u91cf\u5316\u8ba1\u7b97 GPU \u7f16\u7a0b MPI \u57fa\u7840 OpenMP \u57fa\u7840 Reference \u00b6 HPC 101 \u8d85\u7b97\u5c0f\u5b66\u671f \u5317\u5927\u672a\u540d\u8d85\u7b97\u961f \u9ad8\u6027\u80fd\u8ba1\u7b97\u5165\u95e8 CUDA docs MPI Tutorials","title":"\u9ad8\u6027\u80fd\u8ba1\u7b97"},{"location":"cs/hpc/#_1","text":"Abstract \u6211\u7684 mentor\uff08\u5927\ud83d\udc2e\uff09 \u5c31\u662f\u505a hpc \u7684\uff0c\u5f53\u521d\u5b9e\u4e60\u65f6\u4e5f\u6d89\u53ca\u5230\u4e00\u70b9\u70b9\u77e5\u8bc6\uff0c\u6240\u4ee5\u5bf9 hpc \u4e5f\u4ea7\u751f\u4e86\u4e00\u70b9\u70b9\u5174\u8da3\u3002\u867d\u7136\u8bf4\u4ee5\u540e\u5e94\u8be5\u4e0d\u4f1a\u505a hpc\uff0c\u4f46\u662f\u5b66\u4e60\u76f8\u5173\u90e8\u5206\u7684\u77e5\u8bc6\u662f\u6709\u5fc5\u8981\u7684\u3002","title":"\u9ad8\u6027\u80fd\u8ba1\u7b97"},{"location":"cs/hpc/#table-of-contents","text":"\u6982\u8bba \u5411\u91cf\u5316\u8ba1\u7b97 GPU \u7f16\u7a0b MPI \u57fa\u7840 OpenMP \u57fa\u7840","title":"Table of Contents"},{"location":"cs/hpc/#reference","text":"HPC 101 \u8d85\u7b97\u5c0f\u5b66\u671f \u5317\u5927\u672a\u540d\u8d85\u7b97\u961f \u9ad8\u6027\u80fd\u8ba1\u7b97\u5165\u95e8 CUDA docs MPI Tutorials","title":"Reference"},{"location":"cs/hpc/gpu/","text":"GPU \u7f16\u7a0b \u00b6","title":"GPU \u7f16\u7a0b"},{"location":"cs/hpc/gpu/#gpu","text":"","title":"GPU \u7f16\u7a0b"},{"location":"cs/hpc/mpi/","text":"MPI \u57fa\u7840 \u00b6 \u7ea6 2264 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u53c2\u8003\uff1a MPI \u5e76\u884c\u7f16\u7a0b\u5165\u95e8 MPI \u7b80\u4ecb \u00b6 \u4ec0\u4e48\u662f MPI \u662f\u51fd\u6570\u5e93\u89c4\u8303\uff0c\u800c\u4e0d\u662f\u5e76\u884c\u8bed\u8a00\uff1b\u64cd\u4f5c\u5982\u540c\u5e93\u51fd\u6570\u8c03\u7528 \u2013 \u662f\u4e00\u79cd\u6807\u51c6\u548c\u89c4\u8303\uff0c\u800c\u975e\u67d0\u4e2a\u5bf9\u5b83\u7684\u5177\u4f53\u5b9e\u73b0\uff08MPICH\u7b49\uff09\uff0c\u4e0e\u7f16\u7a0b\u8bed\u8a00\u65e0\u5173 \u2013 \u662f\u4e00\u79cd\u6d88\u606f\u4f20\u9012\u7f16\u7a0b\u6a21\u578b\uff0c\u5e76\u6210\u4e3a\u8fd9\u7c7b\u7f16\u7a0b\u6a21\u578b\u7684\u4ee3\u8868 MPI \u7684\u4ea7\u751f \u6269\u5145\u5e76\u884c I/O \u8fdc\u7a0b\u5b58\u50a8\u8bbf\u95ee \u52a8\u6001\u8fdb\u7a0b\u7ba1\u7406 MPI \u7684\u8bed\u8a00\u7ed1\u5b9a: Fortran\u3001C \u4e3b\u8981\u7684 MPI \u5b9e\u73b0: MPICH\u3001LAMMPI MPI \u7a0b\u5e8f\u7f16\u8bd1\u4e0e\u8fd0\u884c \u7a0b\u5e8f\u7f16\u8bd1\uff1a C: % mpicc - o prog prog . c Fortran: % mpif77 - o prog prog . f \u7a0b\u5e8f\u8fd0\u884c % mpirun - np 4 prog \u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u52a8\u6001\u6539\u53d8\u8fdb\u7a0b\u7684\u4e2a\u6570 \u7533\u8bf7\u7684\u8fdb\u7a0b\u6570 np \u4e0e\u5b9e\u9645\u5904\u7406\u5668\u4e2a\u6570\u65e0\u5173 MPI \u57fa\u7840\u77e5\u8bc6 \u00b6 \u8fdb\u7a0b\u4e0e\u6d88\u606f\u4f20\u9012 \u00b6 \u5355\u4e2a\u8fdb\u7a0b \u5355\u673a\u5185\u591a\u4e2a\u8fdb\u7a0b \u5305\u542b\u4e8e\u901a\u8fc7\u7f51\u7edc\u8054\u63a5\u7684\u4e0d\u540c\u5904\u7406\u5668\u7684\u591a\u4e2a\u8fdb\u7a0b \u8fdb\u7a0b\u72ec\u7acb\u5b58\u5728\uff0c\u5e76\u4f4d\u4e8e\u4e0d\u540c\u7684\u5904\u7406\u5668 \u8fdb\u7a0b\u95f4\u76f8\u4e92\u4fe1\u606f\u4ea4\u6362\uff0c\u53ef\u4f9d\u9760\u6d88\u606f\u4f20\u9012 \u6700\u57fa\u672c\u7684\u6d88\u606f\u4f20\u9012\u64cd\u4f5c\u5305\u62ec\u53d1\u9001\u6d88\u606f send\u3001\u63a5\u53d7\u6d88\u606f receive\u3001\u8fdb\u7a0b\u540c\u6b65 barrier\uff0c\u89c4\u7ea6 reduction \u7b49 MPI \u91cd\u8981\u6982\u5ff5 \u00b6 \u8fdb\u7a0b\u7ec4\uff08process group\uff09\uff1aMPI \u7a0b\u5e8f\u7684\u5168\u90e8\u8fdb\u7a0b\u96c6\u5408\u7684 \u4e00\u4e2a\u6709\u5e8f\u5b50\u96c6 \u4e14\u8fdb\u7a0b\u7ec4\u4e2d\u6bcf\u4e2a\u8fdb\u7a0b\u88ab\u8d4b\u4e88\u4e00\u4e2a\u5728\u8be5\u7ec4\u4e2d\u552f\u4e00\u7684\u5e8f\u53f7\uff08rank\uff09\uff0c\u7528\u4e8e\u5728\u8be5\u7ec4\u4e2d\u6807\u8bc6\u8be5\u8fdb\u7a0b\u3002 \u901a\u4fe1\u5668\uff08communicator\uff09 \u7406\u89e3\u4e3a\u4e00\u7c7b\u8fdb\u7a0b\u7684\u96c6\u5408\u5373\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\uff0c\u4e14\u5728\u8be5 \u8fdb\u7a0b\u7ec4\uff0c\u8fdb\u7a0b\u95f4\u53ef\u4ee5\u76f8\u4e92\u901a\u4fe1 \u4efb\u4f55MPI\u901a\u4fe1\u51fd\u6570\u5747\u5fc5\u987b\u5728\u67d0\u4e2a\u901a\u4fe1\u5668\u5185\u53d1\u751f MPI \u7cfb\u7edf\u63d0\u4f9b\u7701\u7f3a\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \uff0c\u6240\u6709\u542f\u52a8\u7684 MPI \u8fdb\u7a0b\u901a\u8fc7\u8c03\u7528\u51fd\u6570 MPI_Init() \u5305\u542b\u5728\u8be5\u901a\u4fe1\u5668\u5185\uff1b\u5404\u8fdb\u7a0b\u901a\u8fc7\u51fd\u6570 PI_Comm_size() \u83b7\u53d6\u901a\u4fe1\u5668\u5305\u542b\u7684(\u521d\u59cb\u542f\u52a8)\u7684 MPI \u8fdb\u7a0b\u4e2a\u6570 \u7ec4\u5185\u901a\u4fe1\u5668 \u548c\u7ec4\u95f4\u901a\u4fe1\u5668 \u8fdb\u7a0b\u5e8f\u53f7\uff08rank\uff09\uff1a\u7528\u6765\u5728\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u6807\u8bc6\u4e00\u4e2a\u8fdb\u7a0b MPI \u7a0b\u5e8f\u4e2d\u7684\u8fdb\u7a0b\u7531\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u5e8f\u53f7\u552f\u4e00\u786e\u5b9a \uff0c \u5e8f\u53f7\u76f8\u5bf9\u4e8e\u8fdb \u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u800c\u8a00\uff08\u5047\u8bbe np \u4e2a\u5904\u7406\u5668\uff0c\u6807\u53f7 0...np-1\uff09 \u540c\u4e00\u4e2a\u8fdb\u7a0b\u5728\u4e0d\u540c\u7684\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u5e8f\u53f7 \uff0c\u8fdb\u7a0b\u7684\u5e8f \u53f7\u662f\u5728\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u88ab\u521b\u5efa\u65f6\u8d4b\u4e88\u7684 MPI \u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7279\u6b8a\u7684\u8fdb\u7a0b\u5e8f\u53f7 MPI_PROC_NULL \uff0c\u5b83\u4ee3\u8868\u7a7a \u8fdb\u7a0b(\u4e0d\u5b58\u5728\u7684\u8fdb\u7a0b)\uff0c \u4e0e MPI_PROC_NULL \u95f4\u7684\u901a\u4fe1\u5b9e\u9645\u4e0a\u6ca1\u6709\u4efb \u4f55\u4f5c\u7528 \u6d88\u606f\uff08message\uff09 \u5206\u4e3a \u6570\u636e\uff08data\uff09\u548c\u5305\u88c5\uff08envelope\uff09 \u4e24\u4e2a\u90e8\u5206 \u5305\u88c5\u7531\u63a5\u53d7\u8fdb\u7a0b\u5e8f\u53f7/\u53d1\u9001\u8fdb\u7a0b\u5e8f\u53f7\u3001\u6d88\u606f\u6807\u53f7\u548c\u901a\u4fe1\u5668\u4e09\u90e8\u5206\u7ec4\u6210\uff1b\u6570\u636e\u5305\u542b\u7528\u6237\u5c06\u8981\u4f20\u9012\u7684\u5185\u5bb9 MPI \u5bf9\u8c61\uff1aMPI \u7cfb\u7edf\u5185\u90e8\u5b9a\u4e49\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5305\u62ec\u6570\u636e\u7c7b\u578b\uff08\u5982 MPI_INT \uff09\u3001\u901a\u4fe1\u5668\uff08 MPI_Comm \uff09\u3001\u901a\u4fe1\u8bf7\u6c42\uff08 MPI_Request \uff09\u7b49\uff0c\u5b83\u4eec\u5bf9\u7528\u6237\u4e0d\u900f\u660e\u3002 MPI \u8054\u63a5\u5668\uff08handles\uff09\u8054\u63a5 MPI \u5bf9\u8c61\u7684\u5177\u4f53\u53d8\u91cf\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b83\u8bbf\u95ee\u548c\u53c2\u4e0e\u76f8\u5e94MPI\u5bf9\u8c61\u7684\u5177\u4f53\u64cd\u4f5c\u3002\u4f8b\u5982\uff0cMPI \u7cfb\u7edf\u5185\u90e8\u63d0\u4f9b\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \u3002 MPI \u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f \u00b6 error = MPI_Xxxxx ( parameters , ...); MPI_Xxxxx ( parameters , ...); \u6574\u5f62\u9519\u8bef\u7801\u7531\u51fd\u6570\u503c\u8fd4\u56de \u9664 MPI_Wtime() \u548c MPI_Wtick() \u5916\uff0c\u6240\u6709 MPI \u7684 C \u51fd\u6570\u5747\u8fd4\u56de\u4e00\u4e2a\u6574\u578b\u9519\u8bef\u7801\u3002\u6210\u529f\u65f6\u8fd4\u56de MPI_SUCCESS \uff0c\u5176\u4ed6\u9519\u8bef\u4ee3\u7801\u4f9d\u8d56\u4e8e\u6267\u884c MPI \u7a0b\u5e8f\u57fa\u672c\u7ed3\u6784 \u00b6 MPI include file -> \u53d8\u91cf\u5b9a\u4e49 -> MPI \u73af\u5883\u521d\u59cb\u5316 -> \u6267\u884c\u7a0b\u5e8f\u3001\u8fdb\u7a0b\u95f4\u901a\u4fe1 -> \u9000\u51fa MPI \u73af\u5883 #include void main ( int argc , char * argv []) { int np , rank , ierr ; ierr = MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & rank ); MPI_Comm_size ( MPI_COMM_WORLD , & np ); /* Do Some Works */ ierr = MPI_Finalize (); } MPI \u57fa\u7840\u51fd\u6570 \u00b6 MPI_Init \uff1a\u521d\u59cb\u5316 MPI \u73af\u5883 MPI_Initialized : \u68c0\u67e5 MPI \u73af\u5883\u662f\u5426\u5df2\u7ecf\u521d\u59cb\u5316 MPI_Comm_size \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u7684\u8fdb\u7a0b\u6570 MPI_Comm_rank \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u5f53\u524d\u8fdb\u7a0b\u7684\u5e8f\u53f7 MPI_Finalize \uff1a\u7ed3\u675f MPI \u73af\u5883 MPI_Abort \uff1a\u5f02\u5e38\u7ec8\u6b62 MPI \u7a0b\u5e8f MPI_Get_processor_name \uff1a\u83b7\u53d6\u5f53\u524d\u8fdb\u7a0b\u6240\u5728\u5904\u7406\u5668\u7684\u540d\u79f0 MPI_Wtime \uff1a\u83b7\u53d6\u5f53\u524d\u65f6\u95f4 Hello World \u00b6 #include #include #include void main ( int argc , char * argv [ ]) { int myid , numprocs , namelen ; char processor_name [ MPI_MAX_PROCESSOR_NAME ]; MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & myid ); MPI_Comm_size ( MPI_COMM_WORLD , & numprocs ); MPI_Get_processor_name ( processor_name , & namelen ); printf ( \"Hello World! Process %d of %d on %s \\n \" , myid , numprocs , processor_name ); MPI_Finalize (); } \u70b9\u5bf9\u70b9\u901a\u4fe1 \u00b6 MPI \u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u90fd\u5efa\u7acb\u5728\u70b9\u5bf9\u70b9\u901a\u4fe1\u4e4b\u4e0a \u4e24\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1 \u6e90\u8fdb\u7a0b\u53d1\u9001\u6d88\u606f\u5230\u76ee\u6807\u8fdb\u7a0b \u76ee\u6807\u8fdb\u7a0b\u63a5\u53d7\u6d88\u606f \u901a\u4fe1\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u901a\u4fe1\u5668\u5185 \u8fdb\u7a0b\u901a\u8fc7\u5176\u5728\u901a\u4fe1\u5668\u5185\u7684\u6807\u53f7\u8868\u793a \u901a\u4fe1\u7c7b\u578b \u51fd\u6570\u8fd4\u56de \u5bf9\u6570\u636e\u533a\u64cd\u4f5c \u7279\u6027 \u963b\u585e\u5f0f\u901a\u4fe1 1. \u963b\u585e\u578b\u51fd\u6570\u9700\u8981\u7b49\u5f85\u5236\u5b9a\u64cd\u4f5c\u5b8c\u6210\u8fd4\u56de 2. \u6216\u6240\u6d89\u53ca\u64cd\u4f5c\u7684\u6570\u636e\u8981\u88ab MPI \u7cfb\u7edf\u7f13\u5b58\u5b89\u5168\u5907\u4efd\u540e\u8fd4\u56de \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5bf9\u6570\u636e\u64cd\u4f5c\u662f\u5b89\u5168\u7684 1. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u7b80\u5355 2. \u4f7f\u7528\u4e0d\u5f53\u5bb9\u6613\u9020\u6210\u6b7b\u9501 \u975e\u963b\u585e\u5f0f\u901a\u4fe1 1. \u8c03\u7528\u540e\u7acb\u523b\u8fd4\u56de\uff0c\u5b9e\u9645\u64cd\u4f5c\u5728 MPI \u540e\u53f0\u6267\u884c 2. \u9700\u8c03\u7528\u51fd\u6570\u7b49\u5f85\u6216\u67e5\u8be2\u64cd\u4f5c\u7684\u5b8c\u6210\u60c5\u51b5 \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5373\u64cd\u4f5c\u6570\u636e\u533a\u4e0d\u5b89\u5168\u3002\u53ef\u80fd\u4e0e\u540e\u53f0\u6b63\u8fdb\u884c\u7684\u64cd\u4f5c\u51b2\u7a81 1. \u53ef\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u4e0e\u901a\u4fe1\u7684\u91cd\u53e0 2. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u590d\u6742 \u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1 \u00b6 MPI_Send \u00b6 \u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Send ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm ) buf\uff1a\u53d1\u9001\u7f13\u51b2\u533a\u7684\u8d77\u59cb\u5730\u5740 count \u4e0d\u662f\u5b57\u8282\u6570\uff0c\u800c\u662f\u6307\u5b9a\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570 datatype \u53ef\u662f\u539f\u59cb\u6570\u636e\u7c7b\u578b\uff0c\u6216\u4e3a\u7528\u6237\u81ea\u5b9a\u4e49\u7c7b\u578b dest \u662f \u53d1\u9001\u76ee\u6807\u7684 rank tag \u7528\u6765\u533a\u5206\u6d88\u606f MPI_Recv \u00b6 \u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Recv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Status * status ) buf \u662f\u8981\u5c06\u63a5\u6536\u5230\u7684\u5185\u5bb9\u5b58\u5165\u7684 buffer \u9996\u5730\u5740\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 count \u662f\u8981\u63a5\u6536\u7684 buffer \u5143\u7d20\u4e2a\u6570 datatype \u662f\u8981\u63a5\u6536\u7684 buffer \u4e2d\u5143\u7d20\u7c7b\u578b source \u662f\u63a5\u6536\u6765\u6e90\u7684 rank\uff08\u6216\u8005 MPI_ANY_SOURCE\uff09 tag \u662f message tag\uff08\u6216\u8005 MPI_ANY_TAG\uff09 comm \u662f communicator status \u662f\u63a5\u6536\u7684\u72b6\u6001\u7ed3\u6784\u4f53\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 \u4e0d\u9700\u8981\u65f6\u586b\u5199 MPI_STATUS_IGNORE MPI_Status \u4e2d\u5305\u542b\u4e09\u4e2a\u6210\u5458\u53d8\u91cf\uff1aMPI_SOURCE\u3001MPI_TAG\u3001MPI_ERROR \u53ef\u4ee5\u901a\u8fc7 MPI_Get_count(MPI_Status status, MPI_Datatype datatype, int count) \u51fd\u6570\u6765\u83b7\u53d6 count MPI_Get_count \u00b6 \u67e5\u8be2\u63a5\u6536\u5230\u7684\u6d88\u606f\u957f\u5ea6 int MPI_Get_count ( MPI_Status * status , MPI_Datatype datatype , int * count ) \u8be5\u51fd\u6570\u5728 count \u4e2d\u8fd4\u56de\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570\uff0c\u5373\u6d88\u606f\u7684\u957f\u5ea6 count \u5c5e\u4e8e MPI_Status \u7ed3\u6784\u7684\u4e00\u4e2a\u57df\uff0c\u4f46\u4e0d\u80fd\u88ab\u7528\u6237\u76f4\u63a5\u8bbf\u95ee MPI_Sendrecv \u00b6 \u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536 int MPI_Sendrecv ( void * sendbuf , int sendcount , MPI_Datatype sendtype , int dest , int sendtag , void * recvbuf , int recvcount , MPI_Datatype recvtype , int source , int recvtag , MPI_Comm comm , MPI_Status * status ) MPI_Sendrecv_replace \u00b6 \u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536\u3001\u6536\u53d1\u4f7f\u7528\u540c\u4e00\u7f13\u5b58\u533a int MPI_Sendrecv_replace ( void * buf , int count , MPI_Datatype datatype , int dest , int sendtag , int source , int recvtag , MPI_Comm comm , MPI_Status * status ) \u975e\u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1 \u00b6 MPI_Isend \u00b6 \u975e\u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Isend ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm , MPI_Request * request ) MPI \u7cfb\u7edf\u4f1a\u5728\u540e\u53f0\u5b8c\u6210\u6d88\u606f\u53d1\u9001 \u51fd\u6570\u4e3a\u8be5\u53d1\u9001\u64cd\u4f5c\u521b\u5efa\u4e86\u4e00\u4e2a\u8bf7\u6c42\uff0c\u901a\u8fc7 request \u53d8\u91cf\u8fd4\u56de request \u53ef\u4f9b\u4e4b\u540e\uff08\u67e5\u8be2\u548c\u7b49\u5f85\uff09\u51fd\u6570\u4f7f\u7528 MPI_Irecv \u00b6 \u975e\u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Irecv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Request * request ) MPI_Wait \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u7684\u5b8c\u6210 int MPI_Wait ( MPI_Request * request , MPI_Status * status ) int MPI_Test ( MPI_Request * request , int * flag , MPI_Status * status ) MPI_Wait \u963b\u585e\u7b49\u5f85\u901a\u4fe1\u51fd\u6570\u5b8c\u6210\u540e\u8fd4\u56de\uff1bMPI_Test \u68c0\u6d4b\u67d0\u901a\u4fe1\uff0c\u4e0d\u8bba\u5176\u662f\u5426\u5b8c\u6210\uff0c\u90fd\u7acb\u523b\u8fd4\u56de\uff0c\u5982\u679c\u901a\u4fe1\u5b8c\u6210\uff0c\u5219 flag=true \u5f53\u7b49\u5f85\u6216\u68c0\u6d4b\u7684\u901a\u4fe1\u5b8c\u6210\u65f6\uff0c\u901a\u4fe1\u8bf7\u6c42 request \u88ab\u8bbe\u7f6e\u6210 MPI_REQUEST_NULL \u8003\u5bdf\u63a5\u6536\u8bf7\u6c42\uff0cstatus \u8fd4\u56de\u4e0e MPI_Recv \u4e00\u6837\uff1b\u53d1\u9001\u8bf7\u6c42\uff0c\u5219\u4e0d\u786e\u5b9a MPI_Test \u8fd4\u56de\u65f6\uff0c\u5f53 flag=false\uff0cstatus \u4e0d\u88ab\u8d4b\u503c MPI_Waitany \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u4e2d\u67d0\u4e00\u4e2a\u7684\u5b8c\u6210 int MPI_Waitany ( int count , MPI_Request array_of_requests [], int * index , MPI_Status * status ) MPI_Waitall \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u5168\u90e8\u5b8c\u6210 int MPI_Waitall ( int count , MPI_Request array_of_requests [], MPI_Status array_of_statuses [] ) MPI_Waitsome \u00b6 \u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u7684\u90e8\u5206\u5b8c\u6210 int MPI_Waitsome ( int incount , MPI_Request array_of_requests [], int * outcount , int array_of_indices [], MPI_Status array_of_statuses [] ) MPI_Request_free \u00b6 \u901a\u4fe1\u8bf7\u6c42\u7684\u91ca\u653e\uff08\u963b\u585e\u578b\uff09 int MPI_Request_free ( MPI_Request * request ) MPI_Cancel \u00b6 \u53d6\u6d88\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Cancel ( MPI_Request * request ) MPI_Test_cancelled \u00b6 \u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u662f\u5426\u88ab\u53d6\u6d88\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Test_cancelled ( MPI_Status * status , int * flag ) MPI_Probe \u00b6 \u6d88\u606f\u63a2\u6d4b\uff08\u963b\u585e\u578b\uff09 int MPI_Probe ( int source , int tag , MPI_Comm comm , MPI_Status * status ) MPI_Iprobe \u00b6 \u6d88\u606f\u63a2\u6d4b\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Iprobe ( int source , int tag , MPI_Comm comm , int * flag , MPI_Status * status ) \u96c6\u5408\u901a\u4fe1 \u00b6 \u5f53\u9700\u8981\u8fdb\u884c\u8fdb\u7a0b\u4e4b\u95f4\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u4e00\u6216\u591a\u5bf9\u591a\u901a\u4fe1\u65f6\uff08\u5982\u5212\u5206\u4efb\u52a1\u3001\u6536\u96c6\u7ed3\u679c\uff09\uff0c\u4f7f\u7528\u591a\u4e2a Send/Recv \u4e0d\u65b9\u4fbf\uff0c\u53ef\u4ee5\u4f7f\u7528\u96c6\u5408\u901a\uff08Collective Communication\uff09 Barrier \u00b6 int MPI_Barrier ( MPI_Comm comm ) \u8fd0\u884c\u5230\u6b64\u51fd\u6570\u65f6\u8fdb\u884c\u7b49\u5f85\uff0c\u76f4\u5230 communicator \u4e2d\u6240\u6709\u8fdb\u7a0b\u90fd\u8fd0\u884c\u5230 Barrier \u4e4b\u540e\u518d\u4e00\u8d77\u7ee7\u7eed\u8fd0\u884c \u4e00\u5bf9\u591a \u00b6 MPI_Bcast \u00b6 int MPI_Bcast ( void * buffer , int count , MPI_Datatype datatype , int root , MPI_Comm comm ) \u6bd4 MPI_Send \u5c11\u4e86 dest\uff0c\u5373\u5c06 buffer \u4ece root \u53d1\u9001\u5230\u6240\u6709\u8fdb\u7a0b \u5305\u542b\u53d1\u9001\u548c\u63a5\u6536\uff08root \u53d1\u9001\uff0c\u5176\u5b83\u63a5\u6536\uff0croot \u53d1\u9001\u51fa buffer\uff0c\u5176\u5b83\u63a5\u6536\u653e\u5230 buffer \u4e2d\uff09 MPI_Bcast \u6548\u7387\u4e5f\u6bd4\u591a\u4e2a Send/Recv \u6548\u7387\u9ad8\uff08\u590d\u7528\u5df2\u7ecf\u5e7f\u64ad\u8fc7\u7684\u8282\u70b9\u8fdb\u884c\u65b0\u7684\u5e7f\u64ad\uff09 MPI_Scatter \u00b6 int MPI_Scatter ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u4e0e Broadcast \u4e0d\u540c\u7684\u662f\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u63a5\u6536\u5230\u7684\u662f sendbuf \u7684\u4e00\u90e8\u5206 \u591a\u5bf9\u4e00 \u00b6 MPI_Gather \u00b6 int MPI_Gather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u53c2\u6570\u610f\u4e49\u4e5f\u90fd\u7c7b\u4f3c\uff0c\u5c06\u6240\u6709\u8fdb\u7a0b\u4e2d\u7684 sendbuf \u53d1\u9001\u7ed9 root \u8fdb\u7a0b\uff0c\u62fc\u63a5\u5230 recvbuf \u4e2d MPI_Reduce \u00b6 int MPI_Reduce ( const void * sendbuf , void * recvbuf , int count , MPI_Datatype datatype , MPI_Op op , int root , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u5c06\u6536\u96c6\u5230\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\u5408\u5e76\u5230 recvbuf \u4e2d MPI_Op \u53ef\u4ee5\u662f MPI_MAX MPI_MIN MPI_SUM MPI_PROD MPI_LAND\uff08\u903b\u8f91\u4e0e\uff09MPI_BAND\uff08\u4f4d\u4e0e\uff09MPI_LOR MPI_BOR MPI_LXOR MPI_BXOR MPI_MAXLOC\uff08\u6700\u5927\u503c\u4e0e\u4f4d\u7f6e\uff09MPI_MINLOC \u591a\u5bf9\u591a \u00b6 MPI_Allgather \u00b6 int MPI_Allgather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u6240\u6709\u8fdb\u7a0b\u90fd\u4f1a\u5f97\u5230 MPI_Gather \u4e2d root \u5f97\u5230\u7684\u5185\u5bb9 MPI_Alltoall \u00b6 int MPI_Alltoall ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm ) \u6301\u4e45\u901a\u4fe1 \u00b6 \u6301\u4e45\u901a\u4fe1\u8bf7\u6c42\u53ef\u7528\u4e8e\u4ee5\u5b8c\u5168\u76f8\u540c\u7684\u65b9\u5f0f\uff08\u76f8\u540c\u7684\u901a\u4fe1\u5668\u3001\u6536\u53d1\u7f13\u51b2\u533a\u3001\u6570\u636e\u7c7b\u578b\u4e0e\u957f\u5ea6\u3001\u6e90/\u76ee\u7684\u5730\u5740\u548c\u6d88\u606f\u6807\u7b7e\uff09\u91cd\u590d\u6536\u53d1\u7684\u6d88\u606f\u3002\u76ee\u7684\u662f\u4e3a\u4e86\u51cf\u5c11\u5904\u7406\u6d88\u606f\u7684\u5f00\u9500\u53ca\u7b80\u5316 MPI \u7a0b\u5e8f","title":"MPI \u57fa\u7840"},{"location":"cs/hpc/mpi/#mpi","text":"\u7ea6 2264 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u53c2\u8003\uff1a MPI \u5e76\u884c\u7f16\u7a0b\u5165\u95e8","title":"MPI \u57fa\u7840"},{"location":"cs/hpc/mpi/#mpi_1","text":"\u4ec0\u4e48\u662f MPI \u662f\u51fd\u6570\u5e93\u89c4\u8303\uff0c\u800c\u4e0d\u662f\u5e76\u884c\u8bed\u8a00\uff1b\u64cd\u4f5c\u5982\u540c\u5e93\u51fd\u6570\u8c03\u7528 \u2013 \u662f\u4e00\u79cd\u6807\u51c6\u548c\u89c4\u8303\uff0c\u800c\u975e\u67d0\u4e2a\u5bf9\u5b83\u7684\u5177\u4f53\u5b9e\u73b0\uff08MPICH\u7b49\uff09\uff0c\u4e0e\u7f16\u7a0b\u8bed\u8a00\u65e0\u5173 \u2013 \u662f\u4e00\u79cd\u6d88\u606f\u4f20\u9012\u7f16\u7a0b\u6a21\u578b\uff0c\u5e76\u6210\u4e3a\u8fd9\u7c7b\u7f16\u7a0b\u6a21\u578b\u7684\u4ee3\u8868 MPI \u7684\u4ea7\u751f \u6269\u5145\u5e76\u884c I/O \u8fdc\u7a0b\u5b58\u50a8\u8bbf\u95ee \u52a8\u6001\u8fdb\u7a0b\u7ba1\u7406 MPI \u7684\u8bed\u8a00\u7ed1\u5b9a: Fortran\u3001C \u4e3b\u8981\u7684 MPI \u5b9e\u73b0: MPICH\u3001LAMMPI MPI \u7a0b\u5e8f\u7f16\u8bd1\u4e0e\u8fd0\u884c \u7a0b\u5e8f\u7f16\u8bd1\uff1a C: % mpicc - o prog prog . c Fortran: % mpif77 - o prog prog . f \u7a0b\u5e8f\u8fd0\u884c % mpirun - np 4 prog \u7a0b\u5e8f\u6267\u884c\u8fc7\u7a0b\u4e2d\u4e0d\u80fd\u52a8\u6001\u6539\u53d8\u8fdb\u7a0b\u7684\u4e2a\u6570 \u7533\u8bf7\u7684\u8fdb\u7a0b\u6570 np \u4e0e\u5b9e\u9645\u5904\u7406\u5668\u4e2a\u6570\u65e0\u5173","title":"MPI \u7b80\u4ecb"},{"location":"cs/hpc/mpi/#mpi_2","text":"","title":"MPI \u57fa\u7840\u77e5\u8bc6"},{"location":"cs/hpc/mpi/#_1","text":"\u5355\u4e2a\u8fdb\u7a0b \u5355\u673a\u5185\u591a\u4e2a\u8fdb\u7a0b \u5305\u542b\u4e8e\u901a\u8fc7\u7f51\u7edc\u8054\u63a5\u7684\u4e0d\u540c\u5904\u7406\u5668\u7684\u591a\u4e2a\u8fdb\u7a0b \u8fdb\u7a0b\u72ec\u7acb\u5b58\u5728\uff0c\u5e76\u4f4d\u4e8e\u4e0d\u540c\u7684\u5904\u7406\u5668 \u8fdb\u7a0b\u95f4\u76f8\u4e92\u4fe1\u606f\u4ea4\u6362\uff0c\u53ef\u4f9d\u9760\u6d88\u606f\u4f20\u9012 \u6700\u57fa\u672c\u7684\u6d88\u606f\u4f20\u9012\u64cd\u4f5c\u5305\u62ec\u53d1\u9001\u6d88\u606f send\u3001\u63a5\u53d7\u6d88\u606f receive\u3001\u8fdb\u7a0b\u540c\u6b65 barrier\uff0c\u89c4\u7ea6 reduction \u7b49","title":"\u8fdb\u7a0b\u4e0e\u6d88\u606f\u4f20\u9012"},{"location":"cs/hpc/mpi/#mpi_3","text":"\u8fdb\u7a0b\u7ec4\uff08process group\uff09\uff1aMPI \u7a0b\u5e8f\u7684\u5168\u90e8\u8fdb\u7a0b\u96c6\u5408\u7684 \u4e00\u4e2a\u6709\u5e8f\u5b50\u96c6 \u4e14\u8fdb\u7a0b\u7ec4\u4e2d\u6bcf\u4e2a\u8fdb\u7a0b\u88ab\u8d4b\u4e88\u4e00\u4e2a\u5728\u8be5\u7ec4\u4e2d\u552f\u4e00\u7684\u5e8f\u53f7\uff08rank\uff09\uff0c\u7528\u4e8e\u5728\u8be5\u7ec4\u4e2d\u6807\u8bc6\u8be5\u8fdb\u7a0b\u3002 \u901a\u4fe1\u5668\uff08communicator\uff09 \u7406\u89e3\u4e3a\u4e00\u7c7b\u8fdb\u7a0b\u7684\u96c6\u5408\u5373\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\uff0c\u4e14\u5728\u8be5 \u8fdb\u7a0b\u7ec4\uff0c\u8fdb\u7a0b\u95f4\u53ef\u4ee5\u76f8\u4e92\u901a\u4fe1 \u4efb\u4f55MPI\u901a\u4fe1\u51fd\u6570\u5747\u5fc5\u987b\u5728\u67d0\u4e2a\u901a\u4fe1\u5668\u5185\u53d1\u751f MPI \u7cfb\u7edf\u63d0\u4f9b\u7701\u7f3a\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \uff0c\u6240\u6709\u542f\u52a8\u7684 MPI \u8fdb\u7a0b\u901a\u8fc7\u8c03\u7528\u51fd\u6570 MPI_Init() \u5305\u542b\u5728\u8be5\u901a\u4fe1\u5668\u5185\uff1b\u5404\u8fdb\u7a0b\u901a\u8fc7\u51fd\u6570 PI_Comm_size() \u83b7\u53d6\u901a\u4fe1\u5668\u5305\u542b\u7684(\u521d\u59cb\u542f\u52a8)\u7684 MPI \u8fdb\u7a0b\u4e2a\u6570 \u7ec4\u5185\u901a\u4fe1\u5668 \u548c\u7ec4\u95f4\u901a\u4fe1\u5668 \u8fdb\u7a0b\u5e8f\u53f7\uff08rank\uff09\uff1a\u7528\u6765\u5728\u4e00\u4e2a\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u6807\u8bc6\u4e00\u4e2a\u8fdb\u7a0b MPI \u7a0b\u5e8f\u4e2d\u7684\u8fdb\u7a0b\u7531\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u5e8f\u53f7\u552f\u4e00\u786e\u5b9a \uff0c \u5e8f\u53f7\u76f8\u5bf9\u4e8e\u8fdb \u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u800c\u8a00\uff08\u5047\u8bbe np \u4e2a\u5904\u7406\u5668\uff0c\u6807\u53f7 0...np-1\uff09 \u540c\u4e00\u4e2a\u8fdb\u7a0b\u5728\u4e0d\u540c\u7684\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u4e2d\u53ef\u4ee5\u6709\u4e0d\u540c\u7684\u5e8f\u53f7 \uff0c\u8fdb\u7a0b\u7684\u5e8f \u53f7\u662f\u5728\u8fdb\u7a0b\u7ec4\u6216\u901a\u4fe1\u5668\u88ab\u521b\u5efa\u65f6\u8d4b\u4e88\u7684 MPI \u7cfb\u7edf\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7279\u6b8a\u7684\u8fdb\u7a0b\u5e8f\u53f7 MPI_PROC_NULL \uff0c\u5b83\u4ee3\u8868\u7a7a \u8fdb\u7a0b(\u4e0d\u5b58\u5728\u7684\u8fdb\u7a0b)\uff0c \u4e0e MPI_PROC_NULL \u95f4\u7684\u901a\u4fe1\u5b9e\u9645\u4e0a\u6ca1\u6709\u4efb \u4f55\u4f5c\u7528 \u6d88\u606f\uff08message\uff09 \u5206\u4e3a \u6570\u636e\uff08data\uff09\u548c\u5305\u88c5\uff08envelope\uff09 \u4e24\u4e2a\u90e8\u5206 \u5305\u88c5\u7531\u63a5\u53d7\u8fdb\u7a0b\u5e8f\u53f7/\u53d1\u9001\u8fdb\u7a0b\u5e8f\u53f7\u3001\u6d88\u606f\u6807\u53f7\u548c\u901a\u4fe1\u5668\u4e09\u90e8\u5206\u7ec4\u6210\uff1b\u6570\u636e\u5305\u542b\u7528\u6237\u5c06\u8981\u4f20\u9012\u7684\u5185\u5bb9 MPI \u5bf9\u8c61\uff1aMPI \u7cfb\u7edf\u5185\u90e8\u5b9a\u4e49\u7684\u6570\u636e\u7ed3\u6784\uff0c\u5305\u62ec\u6570\u636e\u7c7b\u578b\uff08\u5982 MPI_INT \uff09\u3001\u901a\u4fe1\u5668\uff08 MPI_Comm \uff09\u3001\u901a\u4fe1\u8bf7\u6c42\uff08 MPI_Request \uff09\u7b49\uff0c\u5b83\u4eec\u5bf9\u7528\u6237\u4e0d\u900f\u660e\u3002 MPI \u8054\u63a5\u5668\uff08handles\uff09\u8054\u63a5 MPI \u5bf9\u8c61\u7684\u5177\u4f53\u53d8\u91cf\uff0c\u7528\u6237\u53ef\u4ee5\u901a\u8fc7\u5b83\u8bbf\u95ee\u548c\u53c2\u4e0e\u76f8\u5e94MPI\u5bf9\u8c61\u7684\u5177\u4f53\u64cd\u4f5c\u3002\u4f8b\u5982\uff0cMPI \u7cfb\u7edf\u5185\u90e8\u63d0\u4f9b\u7684\u901a\u4fe1\u5668 MPI_COMM_WORLD \u3002","title":"MPI \u91cd\u8981\u6982\u5ff5"},{"location":"cs/hpc/mpi/#mpi_4","text":"error = MPI_Xxxxx ( parameters , ...); MPI_Xxxxx ( parameters , ...); \u6574\u5f62\u9519\u8bef\u7801\u7531\u51fd\u6570\u503c\u8fd4\u56de \u9664 MPI_Wtime() \u548c MPI_Wtick() \u5916\uff0c\u6240\u6709 MPI \u7684 C \u51fd\u6570\u5747\u8fd4\u56de\u4e00\u4e2a\u6574\u578b\u9519\u8bef\u7801\u3002\u6210\u529f\u65f6\u8fd4\u56de MPI_SUCCESS \uff0c\u5176\u4ed6\u9519\u8bef\u4ee3\u7801\u4f9d\u8d56\u4e8e\u6267\u884c","title":"MPI \u51fd\u6570\u7684\u4e00\u822c\u5f62\u5f0f"},{"location":"cs/hpc/mpi/#mpi_5","text":"MPI include file -> \u53d8\u91cf\u5b9a\u4e49 -> MPI \u73af\u5883\u521d\u59cb\u5316 -> \u6267\u884c\u7a0b\u5e8f\u3001\u8fdb\u7a0b\u95f4\u901a\u4fe1 -> \u9000\u51fa MPI \u73af\u5883 #include void main ( int argc , char * argv []) { int np , rank , ierr ; ierr = MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & rank ); MPI_Comm_size ( MPI_COMM_WORLD , & np ); /* Do Some Works */ ierr = MPI_Finalize (); }","title":"MPI \u7a0b\u5e8f\u57fa\u672c\u7ed3\u6784"},{"location":"cs/hpc/mpi/#mpi_6","text":"MPI_Init \uff1a\u521d\u59cb\u5316 MPI \u73af\u5883 MPI_Initialized : \u68c0\u67e5 MPI \u73af\u5883\u662f\u5426\u5df2\u7ecf\u521d\u59cb\u5316 MPI_Comm_size \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u7684\u8fdb\u7a0b\u6570 MPI_Comm_rank \uff1a\u83b7\u53d6\u901a\u4fe1\u5668\u4e2d\u5f53\u524d\u8fdb\u7a0b\u7684\u5e8f\u53f7 MPI_Finalize \uff1a\u7ed3\u675f MPI \u73af\u5883 MPI_Abort \uff1a\u5f02\u5e38\u7ec8\u6b62 MPI \u7a0b\u5e8f MPI_Get_processor_name \uff1a\u83b7\u53d6\u5f53\u524d\u8fdb\u7a0b\u6240\u5728\u5904\u7406\u5668\u7684\u540d\u79f0 MPI_Wtime \uff1a\u83b7\u53d6\u5f53\u524d\u65f6\u95f4","title":"MPI \u57fa\u7840\u51fd\u6570"},{"location":"cs/hpc/mpi/#hello-world","text":"#include #include #include void main ( int argc , char * argv [ ]) { int myid , numprocs , namelen ; char processor_name [ MPI_MAX_PROCESSOR_NAME ]; MPI_Init ( & argc , & argv ); MPI_Comm_rank ( MPI_COMM_WORLD , & myid ); MPI_Comm_size ( MPI_COMM_WORLD , & numprocs ); MPI_Get_processor_name ( processor_name , & namelen ); printf ( \"Hello World! Process %d of %d on %s \\n \" , myid , numprocs , processor_name ); MPI_Finalize (); }","title":"Hello World"},{"location":"cs/hpc/mpi/#_2","text":"MPI \u7cfb\u7edf\u7684\u901a\u4fe1\u65b9\u5f0f\u90fd\u5efa\u7acb\u5728\u70b9\u5bf9\u70b9\u901a\u4fe1\u4e4b\u4e0a \u4e24\u4e2a\u8fdb\u7a0b\u4e4b\u95f4\u7684\u901a\u4fe1 \u6e90\u8fdb\u7a0b\u53d1\u9001\u6d88\u606f\u5230\u76ee\u6807\u8fdb\u7a0b \u76ee\u6807\u8fdb\u7a0b\u63a5\u53d7\u6d88\u606f \u901a\u4fe1\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u901a\u4fe1\u5668\u5185 \u8fdb\u7a0b\u901a\u8fc7\u5176\u5728\u901a\u4fe1\u5668\u5185\u7684\u6807\u53f7\u8868\u793a \u901a\u4fe1\u7c7b\u578b \u51fd\u6570\u8fd4\u56de \u5bf9\u6570\u636e\u533a\u64cd\u4f5c \u7279\u6027 \u963b\u585e\u5f0f\u901a\u4fe1 1. \u963b\u585e\u578b\u51fd\u6570\u9700\u8981\u7b49\u5f85\u5236\u5b9a\u64cd\u4f5c\u5b8c\u6210\u8fd4\u56de 2. \u6216\u6240\u6d89\u53ca\u64cd\u4f5c\u7684\u6570\u636e\u8981\u88ab MPI \u7cfb\u7edf\u7f13\u5b58\u5b89\u5168\u5907\u4efd\u540e\u8fd4\u56de \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5bf9\u6570\u636e\u64cd\u4f5c\u662f\u5b89\u5168\u7684 1. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u7b80\u5355 2. \u4f7f\u7528\u4e0d\u5f53\u5bb9\u6613\u9020\u6210\u6b7b\u9501 \u975e\u963b\u585e\u5f0f\u901a\u4fe1 1. \u8c03\u7528\u540e\u7acb\u523b\u8fd4\u56de\uff0c\u5b9e\u9645\u64cd\u4f5c\u5728 MPI \u540e\u53f0\u6267\u884c 2. \u9700\u8c03\u7528\u51fd\u6570\u7b49\u5f85\u6216\u67e5\u8be2\u64cd\u4f5c\u7684\u5b8c\u6210\u60c5\u51b5 \u51fd\u6570\u8fd4\u56de\u540e\uff0c\u5373\u64cd\u4f5c\u6570\u636e\u533a\u4e0d\u5b89\u5168\u3002\u53ef\u80fd\u4e0e\u540e\u53f0\u6b63\u8fdb\u884c\u7684\u64cd\u4f5c\u51b2\u7a81 1. \u53ef\u4ee5\u5b9e\u73b0\u8ba1\u7b97\u4e0e\u901a\u4fe1\u7684\u91cd\u53e0 2. \u7a0b\u5e8f\u8bbe\u8ba1\u76f8\u5bf9\u590d\u6742","title":"\u70b9\u5bf9\u70b9\u901a\u4fe1"},{"location":"cs/hpc/mpi/#_3","text":"","title":"\u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1"},{"location":"cs/hpc/mpi/#mpi_send","text":"\u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Send ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm ) buf\uff1a\u53d1\u9001\u7f13\u51b2\u533a\u7684\u8d77\u59cb\u5730\u5740 count \u4e0d\u662f\u5b57\u8282\u6570\uff0c\u800c\u662f\u6307\u5b9a\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570 datatype \u53ef\u662f\u539f\u59cb\u6570\u636e\u7c7b\u578b\uff0c\u6216\u4e3a\u7528\u6237\u81ea\u5b9a\u4e49\u7c7b\u578b dest \u662f \u53d1\u9001\u76ee\u6807\u7684 rank tag \u7528\u6765\u533a\u5206\u6d88\u606f","title":"MPI_Send"},{"location":"cs/hpc/mpi/#mpi_recv","text":"\u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Recv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Status * status ) buf \u662f\u8981\u5c06\u63a5\u6536\u5230\u7684\u5185\u5bb9\u5b58\u5165\u7684 buffer \u9996\u5730\u5740\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 count \u662f\u8981\u63a5\u6536\u7684 buffer \u5143\u7d20\u4e2a\u6570 datatype \u662f\u8981\u63a5\u6536\u7684 buffer \u4e2d\u5143\u7d20\u7c7b\u578b source \u662f\u63a5\u6536\u6765\u6e90\u7684 rank\uff08\u6216\u8005 MPI_ANY_SOURCE\uff09 tag \u662f message tag\uff08\u6216\u8005 MPI_ANY_TAG\uff09 comm \u662f communicator status \u662f\u63a5\u6536\u7684\u72b6\u6001\u7ed3\u6784\u4f53\uff08\u4f5c\u4e3a\u201c\u8f93\u51fa\u201d\uff09 \u4e0d\u9700\u8981\u65f6\u586b\u5199 MPI_STATUS_IGNORE MPI_Status \u4e2d\u5305\u542b\u4e09\u4e2a\u6210\u5458\u53d8\u91cf\uff1aMPI_SOURCE\u3001MPI_TAG\u3001MPI_ERROR \u53ef\u4ee5\u901a\u8fc7 MPI_Get_count(MPI_Status status, MPI_Datatype datatype, int count) \u51fd\u6570\u6765\u83b7\u53d6 count","title":"MPI_Recv"},{"location":"cs/hpc/mpi/#mpi_get_count","text":"\u67e5\u8be2\u63a5\u6536\u5230\u7684\u6d88\u606f\u957f\u5ea6 int MPI_Get_count ( MPI_Status * status , MPI_Datatype datatype , int * count ) \u8be5\u51fd\u6570\u5728 count \u4e2d\u8fd4\u56de\u6570\u636e\u7c7b\u578b\u7684\u4e2a\u6570\uff0c\u5373\u6d88\u606f\u7684\u957f\u5ea6 count \u5c5e\u4e8e MPI_Status \u7ed3\u6784\u7684\u4e00\u4e2a\u57df\uff0c\u4f46\u4e0d\u80fd\u88ab\u7528\u6237\u76f4\u63a5\u8bbf\u95ee","title":"MPI_Get_count"},{"location":"cs/hpc/mpi/#mpi_sendrecv","text":"\u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536 int MPI_Sendrecv ( void * sendbuf , int sendcount , MPI_Datatype sendtype , int dest , int sendtag , void * recvbuf , int recvcount , MPI_Datatype recvtype , int source , int recvtag , MPI_Comm comm , MPI_Status * status )","title":"MPI_Sendrecv"},{"location":"cs/hpc/mpi/#mpi_sendrecv_replace","text":"\u6346\u7ed1\u53d1\u9001\u548c\u63a5\u6536\u3001\u6536\u53d1\u4f7f\u7528\u540c\u4e00\u7f13\u5b58\u533a int MPI_Sendrecv_replace ( void * buf , int count , MPI_Datatype datatype , int dest , int sendtag , int source , int recvtag , MPI_Comm comm , MPI_Status * status )","title":"MPI_Sendrecv_replace"},{"location":"cs/hpc/mpi/#_4","text":"","title":"\u975e\u963b\u585e\u5f0f\u70b9\u5bf9\u70b9\u901a\u4fe1"},{"location":"cs/hpc/mpi/#mpi_isend","text":"\u975e\u963b\u585e\u5f0f\u6d88\u606f\u53d1\u9001 int MPI_Isend ( void * buf , int count , MPI_Datatype datatype , int dest , int tag , MPI_Comm comm , MPI_Request * request ) MPI \u7cfb\u7edf\u4f1a\u5728\u540e\u53f0\u5b8c\u6210\u6d88\u606f\u53d1\u9001 \u51fd\u6570\u4e3a\u8be5\u53d1\u9001\u64cd\u4f5c\u521b\u5efa\u4e86\u4e00\u4e2a\u8bf7\u6c42\uff0c\u901a\u8fc7 request \u53d8\u91cf\u8fd4\u56de request \u53ef\u4f9b\u4e4b\u540e\uff08\u67e5\u8be2\u548c\u7b49\u5f85\uff09\u51fd\u6570\u4f7f\u7528","title":"MPI_Isend"},{"location":"cs/hpc/mpi/#mpi_irecv","text":"\u975e\u963b\u585e\u5f0f\u6d88\u606f\u63a5\u6536 int MPI_Irecv ( void * buf , int count , MPI_Datatype datatype , int source , int tag , MPI_Comm comm , MPI_Request * request )","title":"MPI_Irecv"},{"location":"cs/hpc/mpi/#mpi_wait","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u7684\u5b8c\u6210 int MPI_Wait ( MPI_Request * request , MPI_Status * status ) int MPI_Test ( MPI_Request * request , int * flag , MPI_Status * status ) MPI_Wait \u963b\u585e\u7b49\u5f85\u901a\u4fe1\u51fd\u6570\u5b8c\u6210\u540e\u8fd4\u56de\uff1bMPI_Test \u68c0\u6d4b\u67d0\u901a\u4fe1\uff0c\u4e0d\u8bba\u5176\u662f\u5426\u5b8c\u6210\uff0c\u90fd\u7acb\u523b\u8fd4\u56de\uff0c\u5982\u679c\u901a\u4fe1\u5b8c\u6210\uff0c\u5219 flag=true \u5f53\u7b49\u5f85\u6216\u68c0\u6d4b\u7684\u901a\u4fe1\u5b8c\u6210\u65f6\uff0c\u901a\u4fe1\u8bf7\u6c42 request \u88ab\u8bbe\u7f6e\u6210 MPI_REQUEST_NULL \u8003\u5bdf\u63a5\u6536\u8bf7\u6c42\uff0cstatus \u8fd4\u56de\u4e0e MPI_Recv \u4e00\u6837\uff1b\u53d1\u9001\u8bf7\u6c42\uff0c\u5219\u4e0d\u786e\u5b9a MPI_Test \u8fd4\u56de\u65f6\uff0c\u5f53 flag=false\uff0cstatus \u4e0d\u88ab\u8d4b\u503c","title":"MPI_Wait"},{"location":"cs/hpc/mpi/#mpi_waitany","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u4e2d\u67d0\u4e00\u4e2a\u7684\u5b8c\u6210 int MPI_Waitany ( int count , MPI_Request array_of_requests [], int * index , MPI_Status * status )","title":"MPI_Waitany"},{"location":"cs/hpc/mpi/#mpi_waitall","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u5168\u90e8\u5b8c\u6210 int MPI_Waitall ( int count , MPI_Request array_of_requests [], MPI_Status array_of_statuses [] )","title":"MPI_Waitall"},{"location":"cs/hpc/mpi/#mpi_waitsome","text":"\u7b49\u5f85\u3001\u68c0\u6d4b\u4e00\u7ec4\u901a\u4fe1\u8bf7\u6c42\u7684\u90e8\u5206\u5b8c\u6210 int MPI_Waitsome ( int incount , MPI_Request array_of_requests [], int * outcount , int array_of_indices [], MPI_Status array_of_statuses [] )","title":"MPI_Waitsome"},{"location":"cs/hpc/mpi/#mpi_request_free","text":"\u901a\u4fe1\u8bf7\u6c42\u7684\u91ca\u653e\uff08\u963b\u585e\u578b\uff09 int MPI_Request_free ( MPI_Request * request )","title":"MPI_Request_free"},{"location":"cs/hpc/mpi/#mpi_cancel","text":"\u53d6\u6d88\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Cancel ( MPI_Request * request )","title":"MPI_Cancel"},{"location":"cs/hpc/mpi/#mpi_test_cancelled","text":"\u68c0\u6d4b\u4e00\u4e2a\u901a\u4fe1\u8bf7\u6c42\u662f\u5426\u88ab\u53d6\u6d88\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Test_cancelled ( MPI_Status * status , int * flag )","title":"MPI_Test_cancelled"},{"location":"cs/hpc/mpi/#mpi_probe","text":"\u6d88\u606f\u63a2\u6d4b\uff08\u963b\u585e\u578b\uff09 int MPI_Probe ( int source , int tag , MPI_Comm comm , MPI_Status * status )","title":"MPI_Probe"},{"location":"cs/hpc/mpi/#mpi_iprobe","text":"\u6d88\u606f\u63a2\u6d4b\uff08\u975e\u963b\u585e\u578b\uff09 int MPI_Iprobe ( int source , int tag , MPI_Comm comm , int * flag , MPI_Status * status )","title":"MPI_Iprobe"},{"location":"cs/hpc/mpi/#_5","text":"\u5f53\u9700\u8981\u8fdb\u884c\u8fdb\u7a0b\u4e4b\u95f4\u4e00\u5bf9\u591a\u3001\u591a\u5bf9\u4e00\u6216\u591a\u5bf9\u591a\u901a\u4fe1\u65f6\uff08\u5982\u5212\u5206\u4efb\u52a1\u3001\u6536\u96c6\u7ed3\u679c\uff09\uff0c\u4f7f\u7528\u591a\u4e2a Send/Recv \u4e0d\u65b9\u4fbf\uff0c\u53ef\u4ee5\u4f7f\u7528\u96c6\u5408\u901a\uff08Collective Communication\uff09","title":"\u96c6\u5408\u901a\u4fe1"},{"location":"cs/hpc/mpi/#barrier","text":"int MPI_Barrier ( MPI_Comm comm ) \u8fd0\u884c\u5230\u6b64\u51fd\u6570\u65f6\u8fdb\u884c\u7b49\u5f85\uff0c\u76f4\u5230 communicator \u4e2d\u6240\u6709\u8fdb\u7a0b\u90fd\u8fd0\u884c\u5230 Barrier \u4e4b\u540e\u518d\u4e00\u8d77\u7ee7\u7eed\u8fd0\u884c","title":"Barrier"},{"location":"cs/hpc/mpi/#_6","text":"","title":"\u4e00\u5bf9\u591a"},{"location":"cs/hpc/mpi/#mpi_bcast","text":"int MPI_Bcast ( void * buffer , int count , MPI_Datatype datatype , int root , MPI_Comm comm ) \u6bd4 MPI_Send \u5c11\u4e86 dest\uff0c\u5373\u5c06 buffer \u4ece root \u53d1\u9001\u5230\u6240\u6709\u8fdb\u7a0b \u5305\u542b\u53d1\u9001\u548c\u63a5\u6536\uff08root \u53d1\u9001\uff0c\u5176\u5b83\u63a5\u6536\uff0croot \u53d1\u9001\u51fa buffer\uff0c\u5176\u5b83\u63a5\u6536\u653e\u5230 buffer \u4e2d\uff09 MPI_Bcast \u6548\u7387\u4e5f\u6bd4\u591a\u4e2a Send/Recv \u6548\u7387\u9ad8\uff08\u590d\u7528\u5df2\u7ecf\u5e7f\u64ad\u8fc7\u7684\u8282\u70b9\u8fdb\u884c\u65b0\u7684\u5e7f\u64ad\uff09","title":"MPI_Bcast"},{"location":"cs/hpc/mpi/#mpi_scatter","text":"int MPI_Scatter ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u4e0e Broadcast \u4e0d\u540c\u7684\u662f\uff0c\u6bcf\u4e2a\u8fdb\u7a0b\u63a5\u6536\u5230\u7684\u662f sendbuf \u7684\u4e00\u90e8\u5206","title":"MPI_Scatter"},{"location":"cs/hpc/mpi/#_7","text":"","title":"\u591a\u5bf9\u4e00"},{"location":"cs/hpc/mpi/#mpi_gather","text":"int MPI_Gather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , int root , MPI_Comm comm ) \u53c2\u6570\u610f\u4e49\u4e5f\u90fd\u7c7b\u4f3c\uff0c\u5c06\u6240\u6709\u8fdb\u7a0b\u4e2d\u7684 sendbuf \u53d1\u9001\u7ed9 root \u8fdb\u7a0b\uff0c\u62fc\u63a5\u5230 recvbuf \u4e2d","title":"MPI_Gather"},{"location":"cs/hpc/mpi/#mpi_reduce","text":"int MPI_Reduce ( const void * sendbuf , void * recvbuf , int count , MPI_Datatype datatype , MPI_Op op , int root , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u5c06\u6536\u96c6\u5230\u7684\u6570\u636e\u8fdb\u884c\u5904\u7406\u5408\u5e76\u5230 recvbuf \u4e2d MPI_Op \u53ef\u4ee5\u662f MPI_MAX MPI_MIN MPI_SUM MPI_PROD MPI_LAND\uff08\u903b\u8f91\u4e0e\uff09MPI_BAND\uff08\u4f4d\u4e0e\uff09MPI_LOR MPI_BOR MPI_LXOR MPI_BXOR MPI_MAXLOC\uff08\u6700\u5927\u503c\u4e0e\u4f4d\u7f6e\uff09MPI_MINLOC","title":"MPI_Reduce"},{"location":"cs/hpc/mpi/#_8","text":"","title":"\u591a\u5bf9\u591a"},{"location":"cs/hpc/mpi/#mpi_allgather","text":"int MPI_Allgather ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm ) \u7c7b\u4f3c MPI_Gather\uff0c\u4f46\u6240\u6709\u8fdb\u7a0b\u90fd\u4f1a\u5f97\u5230 MPI_Gather \u4e2d root \u5f97\u5230\u7684\u5185\u5bb9","title":"MPI_Allgather"},{"location":"cs/hpc/mpi/#mpi_alltoall","text":"int MPI_Alltoall ( const void * sendbuf , int sendcount , MPI_Datatype sendtype , void * recvbuf , int recvcount , MPI_Datatype recvtype , MPI_Comm comm )","title":"MPI_Alltoall"},{"location":"cs/hpc/mpi/#_9","text":"\u6301\u4e45\u901a\u4fe1\u8bf7\u6c42\u53ef\u7528\u4e8e\u4ee5\u5b8c\u5168\u76f8\u540c\u7684\u65b9\u5f0f\uff08\u76f8\u540c\u7684\u901a\u4fe1\u5668\u3001\u6536\u53d1\u7f13\u51b2\u533a\u3001\u6570\u636e\u7c7b\u578b\u4e0e\u957f\u5ea6\u3001\u6e90/\u76ee\u7684\u5730\u5740\u548c\u6d88\u606f\u6807\u7b7e\uff09\u91cd\u590d\u6536\u53d1\u7684\u6d88\u606f\u3002\u76ee\u7684\u662f\u4e3a\u4e86\u51cf\u5c11\u5904\u7406\u6d88\u606f\u7684\u5f00\u9500\u53ca\u7b80\u5316 MPI \u7a0b\u5e8f","title":"\u6301\u4e45\u901a\u4fe1"},{"location":"cs/hpc/openmp/","text":"OpenMP \u57fa\u7840 \u00b6 \u7ea6 1763 \u4e2a\u5b57 38 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f \u4ec0\u4e48\u662f OpenMP \u00b6 Open Multi-Processing OpenMP \u662f\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff08API\uff09\uff0c\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a\u4e00\u4e2a\u5e93 \u652f\u6301 C\u3001C++ \u548c Fortran \u652f\u6301\u591a\u79cd\u6307\u4ee4\u96c6\u548c\u64cd\u4f5c\u7cfb\u7edf OpenMP \u7684\u9002\u7528\u8303\u56f4\uff1a\u591a\u7ebf\u7a0b\u3001\u5171\u4eab\u5185\u5b58 \u5171\u4eab\u5b58\u50a8\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7684\u4e00\u4e2a\u5e76\u884c\u7f16\u7a0b\u6a21\u578b \u9002\u7528\u4e8e SMP\uff08Symmetric Multi-Processor\uff09\u5171\u4eab\u5185\u5b58\u591a\u5904\u7406\u7cfb\u7edf\u548c\u591a\u6838\u5904\u7406\u5668\u4f53\u7cfb\u7ed3\u6784 \u4e09\u7c7b\u4e3b\u8981 API\uff08\u8868\u73b0\u4e3a\u7f16\u8bd1\u5236\u5bfc\u6307\u4ee4\uff0c\u4f46\u5b9e\u9645\u4e0a\u4ecd\u4e3a API\uff09\uff1a\u7f16\u8bd1\u5668\u6307\u4ee4\u3001\u8fd0\u884c\u65f6\u5e93\u51fd\u6570\u3001\u73af\u5883\u53d8\u91cf \u4f20\u7edf\u4e0a\uff0c\u6211\u4eec\u5229\u7528 OpenMP \u8fdb\u884c\u5355\u673a\u5668 CPU \u4f18\u5316\uff08\u53ef\u8de8\u5904\u7406\u5668\uff09\uff0c\u4e0d\u8fc7\u5728\u8f83\u65b0\u7684 OpenMP \u7248\u672c\u7684\u4e2d\uff0c\u4f60\u751a\u81f3\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 OpenMP \u5c06\u4ee3\u7801\u4f18\u5316\u5230 GPU \u7b49\u5f02\u6784\u8ba1\u7b97\u8bbe\u5907\u4e0a \u5e76\u884c\u6027 \u00b6 \u8fdb\u7a0b\u548c\u7ebf\u7a0b \u00b6 \u8fdb\u7a0b \u6bcf\u4e2a\u8fdb\u7a0b\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u5730\u5740\u7a7a\u95f4 CPU \u5728\u8fdb\u7a0b\u4e4b\u95f4\u5207\u6362\u9700\u8981\u8fdb\u884c\u4e0a\u4e0b\u6587\u5207\u6362 \u7ebf\u7a0b \u4e00\u4e2a\u8fdb\u7a0b\u4e0b\u7684\u7ebf\u7a0b\u5171\u4eab\u5730\u5740\u7a7a\u95f4 CPU \u5728\u7ebf\u7a0b\u4e4b\u95f4\u5207\u6362\u5f00\u9500\u5c0f \u7ebf\u7a0b\u7684\u786c\u4ef6\u8c03\u5ea6 \u00b6 \u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5c06\u7ebf\u7a0b\u8c03\u5ea6\u5230 CPU \u6838\u5fc3\u8fd0\u884c \u5f53\u7ebf\u7a0b\u6570\u76ee\u8d85\u8fc7\u6838\u5fc3\u6570\uff0c\u4f1a\u51fa\u73b0\u591a\u4e2a\u7ebf\u7a0b\u62a2\u5360\u4e00\u4e2a CPU \u6838\u5fc3\uff0c\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d \u8d85\u7ebf\u7a0b\uff08hyper-threading\uff09\u5c06\u5355\u4e2a CPU \u7269\u7406\u6838\u5fc3\u62bd\u8c61\u4e3a\u591a\u4e2a\uff08\u76ee\u524d\u901a\u5e38\u4e3a 2 \u4e2a\uff09\u903b\u8f91\u6838\u5fc3\uff0c\u5171\u4eab\u7269\u7406\u6838\u5fc3\u7684\u8ba1\u7b97\u8d44\u6e90 \u786c\u4ef6\u7684\u5185\u5b58\u6a21\u578b \u00b6 CPU \u6838\u5fc3\u5728\u4e3b\u5b58\u4e4b\u4e0a\u6709 L1,L2,L3 \u591a\u7ea7\u7f13\u5b58 L1,L2 \u7f13\u5b58\u662f\u6838\u5fc3\u79c1\u6709\u7684 \u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4fdd\u8bc1\u4e0d\u540c\u6838\u5fc3\u7684\u7f13\u5b58\u4e00\u81f4\u6027\uff08coherence\uff09 \u88ab\u79f0\u4e3a cache coherence non-uniform memory access\uff08ccNUMA\uff09 \u7f13\u5b58\u4e00\u81f4\u6027\u4f1a\u5e26\u6765 False Sharing \u7684\u95ee\u9898 Fork-Join \u6a21\u578b \u00b6 \u5355\u7ebf\u7a0b\uff08initial thread\uff09\u5f00\u59cb\u6267\u884c \u8fdb\u5165\u5e76\u884c\u533a\uff08parallel region\uff09\u5f00\u59cb\u5e76\u884c\u6267\u884c \u5728\u5e76\u884c\u533a\u7ed3\u5c3e \u8fdb\u884c\u540c\u6b65 \u548c\u7ed3\u675f\u7ebf\u7a0b\uff0c\u7ee7\u7eed\u5355\u7ebf\u7a0b\u6267\u884c\u7a0b\u5e8f OpenMP \u7f16\u7a0b \u00b6 \u5b89\u88c5 \u00b6 \u542b\u5728 Ubuntu \u63d0\u4f9b\u7684 build-essential \u5305\u4e2d echo | cpp -fopenmp -dM | grep -i open # #define _OPENMP 201511 \u7f16\u8bd1\u4f7f\u7528 \u00b6 \u53ef\u4ee5\u76f4\u63a5\u5728\u7f16\u8bd1\u8bed\u53e5\u6dfb\u52a0 -fopenmp \uff0c\u5982 g++ -O2 -std = c++14 -fopenmp hello.cp -o hello \u5982\u679c\u7528 cmake \u6784\u5efa\u9879\u76ee\uff0cgcc \u52a0\u5165 -Wunknown-pragmas \u4f1a\u5728\u7f16\u8bd1\u65f6\u62a5\u544a\u6ca1\u6709\u5904\u7406\u7684 #pragma \uff0c\u53ef\u4ee5\u7528\u6765\u68c0\u67e5\u662f\u5426\u6709\u9057\u6f0f\u7684 OpenMP \u6307\u4ee4 find_package ( OpenMP ) add_compile_options ( -Wunknown-pragmas ) add_executable ( hello src/hello.cpp ) target_link_libraries ( hello OpenMP::OpenMP_CXX ) \u5e93\u51fd\u6570 \u00b6 \u4f7f\u7528\u65f6\u8981 #include \uff0c\u4e00\u4e9b\u5e38\u7528\u51fd\u6570\uff1a void omp_set_num_threads ( int ) \uff1a\u8bbe\u7f6e\u5e76\u884c\u533a\u8fd0\u884c\u7684\u7ebf\u7a0b\u6570 int omp_get_thread_num ( void ) \uff1a\u83b7\u53d6\u5f53\u524d\u7ebf\u7a0b\u53f7 int omp_get_num_threads ( void ) \uff1a\u83b7\u53d6\u603b\u7ebf\u7a0b\u6570 double omp_get_wtime ( void ) \uff1a\u83b7\u53d6\u65f6\u95f4\uff0c\u5e38\u7528\u4e8e\u8ba1\u7b97\u7ebf\u7a0b\u5185\u8bed\u53e5\u6267\u884c\u65f6\u95f4 double opm_get_wtick ( void ) \uff1a\u83b7\u5f97 omp_get_wtime \u65f6\u95f4\u7cbe\u5ea6 OpenMP \u4f1a\u8bfb\u53d6\u73af\u5883\u53d8\u91cf OMP_NUM_THREADS \u6765\u51b3\u5b9a\u521b\u5efa\u7684\u7ebf\u7a0b\u6570 \u5236\u5bfc\u8bed\u53e5 \u00b6 \u540c\u4e00\u7c7b openmp \u5236\u5bfc\u8bed\u53e5\u79f0\u4e3a\u4e00\u79cd\u6784\u9020\uff08construct\uff09 \u5f62\u5f0f\u4e3a #pragma omp \u4f7f\u7528 {} \u6807\u8bb0\u4f5c\u7528\u7684\u4ee3\u7801\u5757 \u652f\u6301\u7684\u4ece\u53e5 default(shared|none) \uff1a\u6307\u5b9a\u9ed8\u8ba4 shared \uff1a\u9ed8\u8ba4\u4e3a\u5171\u4eab\u53d8\u91cf none \uff1a\u65e0\u9ed8\u8ba4\u53d8\u91cf\u7c7b\u578b\uff0c\u6bcf\u4e2a\u53d8\u91cf\u90fd\u9700\u8981\u53e6\u5916\u6307\u5b9a shared(list) \uff1a\u6307\u5b9a\u5171\u4eab\u53d8\u91cf\u5217\u8868\u53d8\u91cf\u7c7b\u578b \u5171\u4eab\u53d8\u91cf\u5728\u5185\u5b58\u4e2d\u53ea\u6709\u4e00\u4efd\uff0c\u6240\u6709\u7ebf\u7a0b\u90fd\u53ef\u4ee5\u8bbf\u95ee \u8bf7\u4fdd\u8bc1\u5171\u4eab\u8bbf\u95ee\u4e0d\u4f1a\u51b2\u7a81 \u4e0d\u7279\u522b\u6307\u5b9a\u5e76\u884c\u533a\u53d8\u91cf \u9ed8\u8ba4\u4e3ashared private(list) \uff1a\u6307\u5b9a\u79c1\u6709\u53d8\u91cf\u5217\u8868 \u6bcf\u4e2a\u7ebf\u7a0b\u751f\u6210\u4e00\u4efd\u4e0e\u8be5\u79c1\u6709\u53d8\u91cf\u540c\u7c7b\u578b\u7684\u6570\u636e\u5bf9\u8c61 \u53d8\u91cf\u9700\u8981 \u91cd\u65b0\u521d\u59cb\u5316 firstprivate(list) \u540c private \u5bf9\u53d8\u91cf\u6839\u636e\u795d\u7ebf\u7a0b\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u521d\u59cb\u5316 lastprivate(list) \u540cprivate \u6267\u884c\u6700\u540e\u4e00\u4e2a\u5faa\u73af\u7684\u7ebf\u7a0b\u7684\u79c1\u6709\u6570\u636e\u53d6\u51fa\u8d4b\u503c\u7ed9\u4e3b\u7ebf\u7a0b\u7684\u53d8\u91cf nowait \uff1a\u53d6\u6d88\u4ee3\u7801\u5757\u7ed3\u675f\u7684\u6805\u680f\u540c\u6b65\uff08barrier\uff09 collapse(n) \uff1a\u5e94\u7528\u4e8e n \u91cd\u5faa\u73af\uff0c\u5408\u5e76\uff08\u5c55\u5f00\uff09\u5faa\u73af\u5e76\u884c \u6ce8\u610f\u5faa\u73af\u4e4b\u95f4\u662f\u5426\u6709\u6570\u636e\u4f9d\u8d56 ordered \uff1a\u58f0\u660e\u6709\u6f5c\u5728\u7684\u987a\u5e8f\u6267\u884c\u90e8\u5206 \u4f7f\u7528 #pragma omp ordered \u6807\u8bb0\u987a\u5e8f\u6267\u884c\u4ee3\u7801\uff08\u642d\u914d\u4f7f\u7528\uff09 ordered \u533a\u5185\u7684\u8bed\u53e5\u4efb\u610f\u65f6\u523b\u4ec5\u7531\u6700\u591a\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c schedule(type [, chuck]) \uff1a\u63a7\u5236\u8c03\u5ea6\u65b9\u5f0f static \uff1achunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 n/p\uff09 dynamic \uff1a\u52a8\u6001\u8c03\u5ea6\uff0cchunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 1\uff09 guided \uff1achunk \u5927\u5c0f\u52a8\u6001\u9012\u51cf runtime \uff1a\u7531\u7cfb\u7edf\u73af\u5883 OMP_SCHEDULE \u51b3\u5b9a parallel \u7ebf\u7a0b\u5e76\u884c \u00b6 \u4f7f\u7528 #pragma omp parallel \u521b\u5efa\u5e76\u884c\u5757\u6765\u5e76\u884c\u8fd0\u884c\u540c\u4e00\u6bb5\u7a0b\u5e8f\uff1a #include #include #include int main () { #pragma omp parallel { int ID = omp_get_thread_num (); printf ( \"thread #%d \\n \" , ID ); } } for \u5faa\u73af\u5e76\u884c \u00b6 parallel \u5757\u5185\u53ef\u4ee5\u4f7f\u7528 #pragma omp for \u6765\u5bf9 for \u5faa\u73af\u8fdb\u884c\u5e76\u884c\uff0c\u76f8\u5f53\u4e8e\u5c06\u5faa\u73af\u62c6\u6210\u4e0d\u540c\u90e8\u5206\u5206\u914d\u7ed9\u591a\u4e2a\u7ebf\u7a0b \u683c\u5f0f\u8981\u6c42 init-expr: \u9700\u8981\u662f var=lb \u5f62\u5f0f\uff0c\u7c7b\u578b\u4e5f\u6709\u9650\u5236 test-expr: \u9650\u5236\u4e3a var reational-opb \u6216\u8005 b relational-opb var incr-expr: \u9650\u5236\u4e3a var=var +/- incr \u6216\u8005 var=var +/- incr #pragma omp parallel { #pragma omp for { for ( int i = 0 ; i < N ; ++ i ) { c [ i ] = a [ i ] + b [ i ]; } } } parallel \u548c for \u53ef\u4ee5\u5408\u8d77\u6765\u5199\u4f5c\u4e00\u884c #pragma omp parallel for if \u6761\u4ef6\u5e76\u884c \u00b6 \u53ef\u4ee5\u5728\u5236\u5bfc\u8bed\u53e5\u540e\u9762\u52a0 if \u5b50\u53e5\u6765\u51b3\u5b9a\u662f\u5426\u8fdb\u884c\u5e76\u884c\uff1a #pragma omp parallel if(x) num_threads(4) { ... } \u5982\u679c x \u4e0d\u4e3a 0 \u5219\u5206\u4e3a\u56db\u4e2a\u7ebf\u7a0b\u6267\u884c\u5757\u5185\u5185\u5bb9 \u5982\u679c x \u4e3a 0 \u5219\u7531\u4e3b\u7ebf\u7a0b\u4e32\u884c\u6267\u884c reduction \u6267\u884c\u8fc7\u7a0b \u00b6 fork \u7ebf\u7a0b\u5e76\u5206\u914d\u4efb\u52a1 \u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u5b9a\u4e49\u4e00\u4e2a\u79c1\u6709\u53d8\u91cf omp_private \uff0c\u540c private \u5404\u4e2a\u7ebf\u7a0b\u6267\u884c\u8ba1\u7b97 \u6240\u6709 omp_priv \u548c omp_in \u4e00\u8d77\u987a\u5e8f\u8fdb\u884c reduction\uff0c\u5199\u56de\u539f\u53d8\u91cf \u540c\u6b65\u6784\u9020 \u00b6 #pragma omp sections \u00b6 \u5c06\u5e76\u884c\u533a\u5185\u7684\u4ee3\u7801\u5757\u5212\u5206\u4e3a\u591a\u4e2a section \u5206\u914d\u6267\u884c \u53ef\u4ee5\u642d\u914d parallel \u5408\u5e76\u4e3a #pragma omp parallel sections \u6784\u9020 \u6bcf\u4e2a section \u7531\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c \u7ebf\u7a0b\u6570\u5927\u4e8e section \u6570\u76ee\uff1a\u90e8\u5206\u7ebf\u7a0b\u7a7a\u95f2 \u7ebf\u7a0b\u6570\u5c0f\u4e8e section \u6570\u76ee\uff0c\u90e8\u5206\u7ebf\u7a0b\u5206\u914d\u591a\u4e2a section #pragma omp parallel sections { #pragma omp section code1 (); #pragma omp section code2 (); } #pragma omp barrier \u00b6 \u5728\u7279\u5b9a\u4f4d\u7f6e\u8fdb\u884c\u6805\u680f\u540c\u6b65 \u6bcf\u4e2a\u5e76\u884c\u5757\u90fd\u542b\u6709\u9690\u5f0f\u7684 barrier\uff0c\u4e5f\u5c31\u662f\u5728\u6240\u6709\u7ebf\u7a0b\u90fd\u7ed3\u675f\u540e\u624d\u80fd\u7ee7\u7eed\u5411\u4e0b\u8fd0\u884c \u5728\u5e76\u884c\u5757\u5185\u4e5f\u53ef\u4ee5\u5229\u7528 #pragma omp barrier \u6765\u540c\u6b65\u5404\u7ebf\u7a0b\uff0c\u5373\u6240\u6709\u7ebf\u7a0b\u90fd\u89e6\u78b0\u5230 barrier \u65f6\u518d\u7ee7\u7eed \u53ef\u4ee5\u5229\u7528 nowait \u5b50\u53e5\u6765\u53d6\u6d88\u5e76\u884c\u5757\u7ed3\u5c3e\u7684\u9690\u5f0f barrier\uff0c\u907f\u514d\u540c\u6b65\u4ea7\u751f\u7684\u5f00\u9500 #pragma omp single \u00b6 \u67d0\u6bb5\u4ee3\u7801\u5355\u7ebf\u7a0b\u6267\u884c\uff0c\u5e26\u9690\u5f0f\u540c\u6b65\uff08\u4f7f\u7528 nowait \u53bb\u6389\uff09 single \u7528\u6765\u5e8f\u5217\u5316\u4e00\u6bb5\u4ee3\u7801\uff0c\u5373\u5728\u4e00\u4e2a\u8fdb\u7a0b\u4e2d\u6267\u884c\uff08\u5904\u7406\u975e\u7ebf\u7a0b\u5b89\u5168\u7684\u4ee3\u7801\uff0c\u4f8b\u5982 IO\uff09 #pragma omp master \u00b6 \u91c7\u7528\u4e3b\u7ebf\u7a0b\u6267\u884c\uff0c\u65e0\u9690\u5f0f\u540c\u6b65 #pragma omp critical \u00b6 \u67d0\u6bb5\u4ee3\u7801\u7ebf\u7a0b\u4e92\u65a5\u6267\u884c #pragma omp atomic \u00b6 \u5355\u4e2a\u7279\u5b9a\u683c\u5f0f\u7684\u8bed\u53e5\u6216\u8bed\u53e5\u7ec4\u4e2d\u67d0\u4e2a\u53d8\u91cf\u8fdb\u884c\u539f\u5b50\u64cd\u4f5c False Sharing \u00b6 \u8017\u65f6\u589e\u52a0 24% \u4e0d\u540c\u6838\u5fc3\u5bf9\u540c\u4e00 cache line \u7684\u540c\u65f6\u8bfb\u5199\u4f1a\u9020\u6210\u4e25\u91cd\u7684\u51b2\u7a81\uff0c\u5bfc\u81f4\u8be5\u7ea7\u7f13\u5b58\u5931\u6548 \u66f4\u591a\u7279\u6027 \u00b6 \u4efb\u52a1\u6784\u9020 \u00b6 \u524d\u8ff0\u7684\u6784\u9020\u90fd\u9075\u5faa Fork-Join \u6a21\u5f0f\uff0c\u5bf9\u4efb\u52a1\u7c7b\u578b\u6709\u9650\u5236 \u4efb\u52a1\uff08task\uff09\u6784\u9020\u5141\u8bb8\u5b9a\u4e49\u4efb\u52a1\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\uff0c\u52a8\u6001\u8c03\u5ea6\u6267\u884c \u5373\u52a8\u6001\u7ba1\u7406\u7ebf\u7a0b\u6c60\uff08thread pool\uff09\u548c\u4efb\u52a1\u6c60\uff08task pool\uff09 \u5411\u91cf\u5316 \u00b6 \u5c06\u5faa\u73af\u8f6c\u6362\u4e3a SIMD \u5faa\u73af aligned \u7528\u4e8e\u5217\u51fa\u5185\u5b58\u5bf9\u9f50\u7684\u6307\u9488 safelen \u7528\u4e8e\u6807\u8bb0\u5faa\u73af\u5c55\u5f00\u65f6\u7684\u6570\u636e\u4f9d\u8d56 \u7f16\u8bd1\u5668\u4e5f\u81ea\u5e26\u5411\u91cf\u5316\u529f\u80fd\uff0c\u4f8b\u5982 gcc -O3 -ffast-math -fivopts -march=native -fopt-info-vec -fopt-info-vec-missed GPU \u652f\u6301 \u00b6 \u4ece OpenMP API 4.0 \u5f00\u59cb\u652f\u6301 GPU \u52a0\u901f","title":"OpenMP \u57fa\u7840"},{"location":"cs/hpc/openmp/#openmp","text":"\u7ea6 1763 \u4e2a\u5b57 38 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f","title":"OpenMP \u57fa\u7840"},{"location":"cs/hpc/openmp/#openmp_1","text":"Open Multi-Processing OpenMP \u662f\u4e00\u4e2a\u5e94\u7528\u7a0b\u5e8f\u63a5\u53e3\uff08API\uff09\uff0c\u53ef\u4ee5\u7b80\u5355\u7406\u89e3\u4e3a\u4e00\u4e2a\u5e93 \u652f\u6301 C\u3001C++ \u548c Fortran \u652f\u6301\u591a\u79cd\u6307\u4ee4\u96c6\u548c\u64cd\u4f5c\u7cfb\u7edf OpenMP \u7684\u9002\u7528\u8303\u56f4\uff1a\u591a\u7ebf\u7a0b\u3001\u5171\u4eab\u5185\u5b58 \u5171\u4eab\u5b58\u50a8\u4f53\u7cfb\u7ed3\u6784\u4e0a\u7684\u4e00\u4e2a\u5e76\u884c\u7f16\u7a0b\u6a21\u578b \u9002\u7528\u4e8e SMP\uff08Symmetric Multi-Processor\uff09\u5171\u4eab\u5185\u5b58\u591a\u5904\u7406\u7cfb\u7edf\u548c\u591a\u6838\u5904\u7406\u5668\u4f53\u7cfb\u7ed3\u6784 \u4e09\u7c7b\u4e3b\u8981 API\uff08\u8868\u73b0\u4e3a\u7f16\u8bd1\u5236\u5bfc\u6307\u4ee4\uff0c\u4f46\u5b9e\u9645\u4e0a\u4ecd\u4e3a API\uff09\uff1a\u7f16\u8bd1\u5668\u6307\u4ee4\u3001\u8fd0\u884c\u65f6\u5e93\u51fd\u6570\u3001\u73af\u5883\u53d8\u91cf \u4f20\u7edf\u4e0a\uff0c\u6211\u4eec\u5229\u7528 OpenMP \u8fdb\u884c\u5355\u673a\u5668 CPU \u4f18\u5316\uff08\u53ef\u8de8\u5904\u7406\u5668\uff09\uff0c\u4e0d\u8fc7\u5728\u8f83\u65b0\u7684 OpenMP \u7248\u672c\u7684\u4e2d\uff0c\u4f60\u751a\u81f3\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 OpenMP \u5c06\u4ee3\u7801\u4f18\u5316\u5230 GPU \u7b49\u5f02\u6784\u8ba1\u7b97\u8bbe\u5907\u4e0a","title":"\u4ec0\u4e48\u662f OpenMP"},{"location":"cs/hpc/openmp/#_1","text":"","title":"\u5e76\u884c\u6027"},{"location":"cs/hpc/openmp/#_2","text":"\u8fdb\u7a0b \u6bcf\u4e2a\u8fdb\u7a0b\u6709\u81ea\u5df1\u72ec\u7acb\u7684\u5730\u5740\u7a7a\u95f4 CPU \u5728\u8fdb\u7a0b\u4e4b\u95f4\u5207\u6362\u9700\u8981\u8fdb\u884c\u4e0a\u4e0b\u6587\u5207\u6362 \u7ebf\u7a0b \u4e00\u4e2a\u8fdb\u7a0b\u4e0b\u7684\u7ebf\u7a0b\u5171\u4eab\u5730\u5740\u7a7a\u95f4 CPU \u5728\u7ebf\u7a0b\u4e4b\u95f4\u5207\u6362\u5f00\u9500\u5c0f","title":"\u8fdb\u7a0b\u548c\u7ebf\u7a0b"},{"location":"cs/hpc/openmp/#_3","text":"\u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u5c06\u7ebf\u7a0b\u8c03\u5ea6\u5230 CPU \u6838\u5fc3\u8fd0\u884c \u5f53\u7ebf\u7a0b\u6570\u76ee\u8d85\u8fc7\u6838\u5fc3\u6570\uff0c\u4f1a\u51fa\u73b0\u591a\u4e2a\u7ebf\u7a0b\u62a2\u5360\u4e00\u4e2a CPU \u6838\u5fc3\uff0c\u5bfc\u81f4\u6027\u80fd\u4e0b\u964d \u8d85\u7ebf\u7a0b\uff08hyper-threading\uff09\u5c06\u5355\u4e2a CPU \u7269\u7406\u6838\u5fc3\u62bd\u8c61\u4e3a\u591a\u4e2a\uff08\u76ee\u524d\u901a\u5e38\u4e3a 2 \u4e2a\uff09\u903b\u8f91\u6838\u5fc3\uff0c\u5171\u4eab\u7269\u7406\u6838\u5fc3\u7684\u8ba1\u7b97\u8d44\u6e90","title":"\u7ebf\u7a0b\u7684\u786c\u4ef6\u8c03\u5ea6"},{"location":"cs/hpc/openmp/#_4","text":"CPU \u6838\u5fc3\u5728\u4e3b\u5b58\u4e4b\u4e0a\u6709 L1,L2,L3 \u591a\u7ea7\u7f13\u5b58 L1,L2 \u7f13\u5b58\u662f\u6838\u5fc3\u79c1\u6709\u7684 \u786c\u4ef6\u548c\u64cd\u4f5c\u7cfb\u7edf\u4fdd\u8bc1\u4e0d\u540c\u6838\u5fc3\u7684\u7f13\u5b58\u4e00\u81f4\u6027\uff08coherence\uff09 \u88ab\u79f0\u4e3a cache coherence non-uniform memory access\uff08ccNUMA\uff09 \u7f13\u5b58\u4e00\u81f4\u6027\u4f1a\u5e26\u6765 False Sharing \u7684\u95ee\u9898","title":"\u786c\u4ef6\u7684\u5185\u5b58\u6a21\u578b"},{"location":"cs/hpc/openmp/#fork-join","text":"\u5355\u7ebf\u7a0b\uff08initial thread\uff09\u5f00\u59cb\u6267\u884c \u8fdb\u5165\u5e76\u884c\u533a\uff08parallel region\uff09\u5f00\u59cb\u5e76\u884c\u6267\u884c \u5728\u5e76\u884c\u533a\u7ed3\u5c3e \u8fdb\u884c\u540c\u6b65 \u548c\u7ed3\u675f\u7ebf\u7a0b\uff0c\u7ee7\u7eed\u5355\u7ebf\u7a0b\u6267\u884c\u7a0b\u5e8f","title":"Fork-Join \u6a21\u578b"},{"location":"cs/hpc/openmp/#openmp_2","text":"","title":"OpenMP \u7f16\u7a0b"},{"location":"cs/hpc/openmp/#_5","text":"\u542b\u5728 Ubuntu \u63d0\u4f9b\u7684 build-essential \u5305\u4e2d echo | cpp -fopenmp -dM | grep -i open # #define _OPENMP 201511","title":"\u5b89\u88c5"},{"location":"cs/hpc/openmp/#_6","text":"\u53ef\u4ee5\u76f4\u63a5\u5728\u7f16\u8bd1\u8bed\u53e5\u6dfb\u52a0 -fopenmp \uff0c\u5982 g++ -O2 -std = c++14 -fopenmp hello.cp -o hello \u5982\u679c\u7528 cmake \u6784\u5efa\u9879\u76ee\uff0cgcc \u52a0\u5165 -Wunknown-pragmas \u4f1a\u5728\u7f16\u8bd1\u65f6\u62a5\u544a\u6ca1\u6709\u5904\u7406\u7684 #pragma \uff0c\u53ef\u4ee5\u7528\u6765\u68c0\u67e5\u662f\u5426\u6709\u9057\u6f0f\u7684 OpenMP \u6307\u4ee4 find_package ( OpenMP ) add_compile_options ( -Wunknown-pragmas ) add_executable ( hello src/hello.cpp ) target_link_libraries ( hello OpenMP::OpenMP_CXX )","title":"\u7f16\u8bd1\u4f7f\u7528"},{"location":"cs/hpc/openmp/#_7","text":"\u4f7f\u7528\u65f6\u8981 #include \uff0c\u4e00\u4e9b\u5e38\u7528\u51fd\u6570\uff1a void omp_set_num_threads ( int ) \uff1a\u8bbe\u7f6e\u5e76\u884c\u533a\u8fd0\u884c\u7684\u7ebf\u7a0b\u6570 int omp_get_thread_num ( void ) \uff1a\u83b7\u53d6\u5f53\u524d\u7ebf\u7a0b\u53f7 int omp_get_num_threads ( void ) \uff1a\u83b7\u53d6\u603b\u7ebf\u7a0b\u6570 double omp_get_wtime ( void ) \uff1a\u83b7\u53d6\u65f6\u95f4\uff0c\u5e38\u7528\u4e8e\u8ba1\u7b97\u7ebf\u7a0b\u5185\u8bed\u53e5\u6267\u884c\u65f6\u95f4 double opm_get_wtick ( void ) \uff1a\u83b7\u5f97 omp_get_wtime \u65f6\u95f4\u7cbe\u5ea6 OpenMP \u4f1a\u8bfb\u53d6\u73af\u5883\u53d8\u91cf OMP_NUM_THREADS \u6765\u51b3\u5b9a\u521b\u5efa\u7684\u7ebf\u7a0b\u6570","title":"\u5e93\u51fd\u6570"},{"location":"cs/hpc/openmp/#_8","text":"\u540c\u4e00\u7c7b openmp \u5236\u5bfc\u8bed\u53e5\u79f0\u4e3a\u4e00\u79cd\u6784\u9020\uff08construct\uff09 \u5f62\u5f0f\u4e3a #pragma omp \u4f7f\u7528 {} \u6807\u8bb0\u4f5c\u7528\u7684\u4ee3\u7801\u5757 \u652f\u6301\u7684\u4ece\u53e5 default(shared|none) \uff1a\u6307\u5b9a\u9ed8\u8ba4 shared \uff1a\u9ed8\u8ba4\u4e3a\u5171\u4eab\u53d8\u91cf none \uff1a\u65e0\u9ed8\u8ba4\u53d8\u91cf\u7c7b\u578b\uff0c\u6bcf\u4e2a\u53d8\u91cf\u90fd\u9700\u8981\u53e6\u5916\u6307\u5b9a shared(list) \uff1a\u6307\u5b9a\u5171\u4eab\u53d8\u91cf\u5217\u8868\u53d8\u91cf\u7c7b\u578b \u5171\u4eab\u53d8\u91cf\u5728\u5185\u5b58\u4e2d\u53ea\u6709\u4e00\u4efd\uff0c\u6240\u6709\u7ebf\u7a0b\u90fd\u53ef\u4ee5\u8bbf\u95ee \u8bf7\u4fdd\u8bc1\u5171\u4eab\u8bbf\u95ee\u4e0d\u4f1a\u51b2\u7a81 \u4e0d\u7279\u522b\u6307\u5b9a\u5e76\u884c\u533a\u53d8\u91cf \u9ed8\u8ba4\u4e3ashared private(list) \uff1a\u6307\u5b9a\u79c1\u6709\u53d8\u91cf\u5217\u8868 \u6bcf\u4e2a\u7ebf\u7a0b\u751f\u6210\u4e00\u4efd\u4e0e\u8be5\u79c1\u6709\u53d8\u91cf\u540c\u7c7b\u578b\u7684\u6570\u636e\u5bf9\u8c61 \u53d8\u91cf\u9700\u8981 \u91cd\u65b0\u521d\u59cb\u5316 firstprivate(list) \u540c private \u5bf9\u53d8\u91cf\u6839\u636e\u795d\u7ebf\u7a0b\u4e2d\u7684\u6570\u636e\u8fdb\u884c\u521d\u59cb\u5316 lastprivate(list) \u540cprivate \u6267\u884c\u6700\u540e\u4e00\u4e2a\u5faa\u73af\u7684\u7ebf\u7a0b\u7684\u79c1\u6709\u6570\u636e\u53d6\u51fa\u8d4b\u503c\u7ed9\u4e3b\u7ebf\u7a0b\u7684\u53d8\u91cf nowait \uff1a\u53d6\u6d88\u4ee3\u7801\u5757\u7ed3\u675f\u7684\u6805\u680f\u540c\u6b65\uff08barrier\uff09 collapse(n) \uff1a\u5e94\u7528\u4e8e n \u91cd\u5faa\u73af\uff0c\u5408\u5e76\uff08\u5c55\u5f00\uff09\u5faa\u73af\u5e76\u884c \u6ce8\u610f\u5faa\u73af\u4e4b\u95f4\u662f\u5426\u6709\u6570\u636e\u4f9d\u8d56 ordered \uff1a\u58f0\u660e\u6709\u6f5c\u5728\u7684\u987a\u5e8f\u6267\u884c\u90e8\u5206 \u4f7f\u7528 #pragma omp ordered \u6807\u8bb0\u987a\u5e8f\u6267\u884c\u4ee3\u7801\uff08\u642d\u914d\u4f7f\u7528\uff09 ordered \u533a\u5185\u7684\u8bed\u53e5\u4efb\u610f\u65f6\u523b\u4ec5\u7531\u6700\u591a\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c schedule(type [, chuck]) \uff1a\u63a7\u5236\u8c03\u5ea6\u65b9\u5f0f static \uff1achunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 n/p\uff09 dynamic \uff1a\u52a8\u6001\u8c03\u5ea6\uff0cchunk \u5927\u5c0f\u56fa\u5b9a\uff08\u9ed8\u8ba4 1\uff09 guided \uff1achunk \u5927\u5c0f\u52a8\u6001\u9012\u51cf runtime \uff1a\u7531\u7cfb\u7edf\u73af\u5883 OMP_SCHEDULE \u51b3\u5b9a","title":"\u5236\u5bfc\u8bed\u53e5"},{"location":"cs/hpc/openmp/#parallel","text":"\u4f7f\u7528 #pragma omp parallel \u521b\u5efa\u5e76\u884c\u5757\u6765\u5e76\u884c\u8fd0\u884c\u540c\u4e00\u6bb5\u7a0b\u5e8f\uff1a #include #include #include int main () { #pragma omp parallel { int ID = omp_get_thread_num (); printf ( \"thread #%d \\n \" , ID ); } }","title":"parallel \u7ebf\u7a0b\u5e76\u884c"},{"location":"cs/hpc/openmp/#for","text":"parallel \u5757\u5185\u53ef\u4ee5\u4f7f\u7528 #pragma omp for \u6765\u5bf9 for \u5faa\u73af\u8fdb\u884c\u5e76\u884c\uff0c\u76f8\u5f53\u4e8e\u5c06\u5faa\u73af\u62c6\u6210\u4e0d\u540c\u90e8\u5206\u5206\u914d\u7ed9\u591a\u4e2a\u7ebf\u7a0b \u683c\u5f0f\u8981\u6c42 init-expr: \u9700\u8981\u662f var=lb \u5f62\u5f0f\uff0c\u7c7b\u578b\u4e5f\u6709\u9650\u5236 test-expr: \u9650\u5236\u4e3a var reational-opb \u6216\u8005 b relational-opb var incr-expr: \u9650\u5236\u4e3a var=var +/- incr \u6216\u8005 var=var +/- incr #pragma omp parallel { #pragma omp for { for ( int i = 0 ; i < N ; ++ i ) { c [ i ] = a [ i ] + b [ i ]; } } } parallel \u548c for \u53ef\u4ee5\u5408\u8d77\u6765\u5199\u4f5c\u4e00\u884c #pragma omp parallel for","title":"for \u5faa\u73af\u5e76\u884c"},{"location":"cs/hpc/openmp/#if","text":"\u53ef\u4ee5\u5728\u5236\u5bfc\u8bed\u53e5\u540e\u9762\u52a0 if \u5b50\u53e5\u6765\u51b3\u5b9a\u662f\u5426\u8fdb\u884c\u5e76\u884c\uff1a #pragma omp parallel if(x) num_threads(4) { ... } \u5982\u679c x \u4e0d\u4e3a 0 \u5219\u5206\u4e3a\u56db\u4e2a\u7ebf\u7a0b\u6267\u884c\u5757\u5185\u5185\u5bb9 \u5982\u679c x \u4e3a 0 \u5219\u7531\u4e3b\u7ebf\u7a0b\u4e32\u884c\u6267\u884c","title":"if \u6761\u4ef6\u5e76\u884c"},{"location":"cs/hpc/openmp/#reduction","text":"fork \u7ebf\u7a0b\u5e76\u5206\u914d\u4efb\u52a1 \u6bcf\u4e00\u4e2a\u7ebf\u7a0b\u5b9a\u4e49\u4e00\u4e2a\u79c1\u6709\u53d8\u91cf omp_private \uff0c\u540c private \u5404\u4e2a\u7ebf\u7a0b\u6267\u884c\u8ba1\u7b97 \u6240\u6709 omp_priv \u548c omp_in \u4e00\u8d77\u987a\u5e8f\u8fdb\u884c reduction\uff0c\u5199\u56de\u539f\u53d8\u91cf","title":"reduction \u6267\u884c\u8fc7\u7a0b"},{"location":"cs/hpc/openmp/#_9","text":"","title":"\u540c\u6b65\u6784\u9020"},{"location":"cs/hpc/openmp/#pragma-omp-sections","text":"\u5c06\u5e76\u884c\u533a\u5185\u7684\u4ee3\u7801\u5757\u5212\u5206\u4e3a\u591a\u4e2a section \u5206\u914d\u6267\u884c \u53ef\u4ee5\u642d\u914d parallel \u5408\u5e76\u4e3a #pragma omp parallel sections \u6784\u9020 \u6bcf\u4e2a section \u7531\u4e00\u4e2a\u7ebf\u7a0b\u6267\u884c \u7ebf\u7a0b\u6570\u5927\u4e8e section \u6570\u76ee\uff1a\u90e8\u5206\u7ebf\u7a0b\u7a7a\u95f2 \u7ebf\u7a0b\u6570\u5c0f\u4e8e section \u6570\u76ee\uff0c\u90e8\u5206\u7ebf\u7a0b\u5206\u914d\u591a\u4e2a section #pragma omp parallel sections { #pragma omp section code1 (); #pragma omp section code2 (); }","title":"#pragma omp sections"},{"location":"cs/hpc/openmp/#pragma-omp-barrier","text":"\u5728\u7279\u5b9a\u4f4d\u7f6e\u8fdb\u884c\u6805\u680f\u540c\u6b65 \u6bcf\u4e2a\u5e76\u884c\u5757\u90fd\u542b\u6709\u9690\u5f0f\u7684 barrier\uff0c\u4e5f\u5c31\u662f\u5728\u6240\u6709\u7ebf\u7a0b\u90fd\u7ed3\u675f\u540e\u624d\u80fd\u7ee7\u7eed\u5411\u4e0b\u8fd0\u884c \u5728\u5e76\u884c\u5757\u5185\u4e5f\u53ef\u4ee5\u5229\u7528 #pragma omp barrier \u6765\u540c\u6b65\u5404\u7ebf\u7a0b\uff0c\u5373\u6240\u6709\u7ebf\u7a0b\u90fd\u89e6\u78b0\u5230 barrier \u65f6\u518d\u7ee7\u7eed \u53ef\u4ee5\u5229\u7528 nowait \u5b50\u53e5\u6765\u53d6\u6d88\u5e76\u884c\u5757\u7ed3\u5c3e\u7684\u9690\u5f0f barrier\uff0c\u907f\u514d\u540c\u6b65\u4ea7\u751f\u7684\u5f00\u9500","title":"#pragma omp barrier"},{"location":"cs/hpc/openmp/#pragma-omp-single","text":"\u67d0\u6bb5\u4ee3\u7801\u5355\u7ebf\u7a0b\u6267\u884c\uff0c\u5e26\u9690\u5f0f\u540c\u6b65\uff08\u4f7f\u7528 nowait \u53bb\u6389\uff09 single \u7528\u6765\u5e8f\u5217\u5316\u4e00\u6bb5\u4ee3\u7801\uff0c\u5373\u5728\u4e00\u4e2a\u8fdb\u7a0b\u4e2d\u6267\u884c\uff08\u5904\u7406\u975e\u7ebf\u7a0b\u5b89\u5168\u7684\u4ee3\u7801\uff0c\u4f8b\u5982 IO\uff09","title":"#pragma omp single"},{"location":"cs/hpc/openmp/#pragma-omp-master","text":"\u91c7\u7528\u4e3b\u7ebf\u7a0b\u6267\u884c\uff0c\u65e0\u9690\u5f0f\u540c\u6b65","title":"#pragma omp master"},{"location":"cs/hpc/openmp/#pragma-omp-critical","text":"\u67d0\u6bb5\u4ee3\u7801\u7ebf\u7a0b\u4e92\u65a5\u6267\u884c","title":"#pragma omp critical"},{"location":"cs/hpc/openmp/#pragma-omp-atomic","text":"\u5355\u4e2a\u7279\u5b9a\u683c\u5f0f\u7684\u8bed\u53e5\u6216\u8bed\u53e5\u7ec4\u4e2d\u67d0\u4e2a\u53d8\u91cf\u8fdb\u884c\u539f\u5b50\u64cd\u4f5c","title":"#pragma omp atomic"},{"location":"cs/hpc/openmp/#false-sharing","text":"\u8017\u65f6\u589e\u52a0 24% \u4e0d\u540c\u6838\u5fc3\u5bf9\u540c\u4e00 cache line \u7684\u540c\u65f6\u8bfb\u5199\u4f1a\u9020\u6210\u4e25\u91cd\u7684\u51b2\u7a81\uff0c\u5bfc\u81f4\u8be5\u7ea7\u7f13\u5b58\u5931\u6548","title":"False Sharing"},{"location":"cs/hpc/openmp/#_10","text":"","title":"\u66f4\u591a\u7279\u6027"},{"location":"cs/hpc/openmp/#_11","text":"\u524d\u8ff0\u7684\u6784\u9020\u90fd\u9075\u5faa Fork-Join \u6a21\u5f0f\uff0c\u5bf9\u4efb\u52a1\u7c7b\u578b\u6709\u9650\u5236 \u4efb\u52a1\uff08task\uff09\u6784\u9020\u5141\u8bb8\u5b9a\u4e49\u4efb\u52a1\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\uff0c\u52a8\u6001\u8c03\u5ea6\u6267\u884c \u5373\u52a8\u6001\u7ba1\u7406\u7ebf\u7a0b\u6c60\uff08thread pool\uff09\u548c\u4efb\u52a1\u6c60\uff08task pool\uff09","title":"\u4efb\u52a1\u6784\u9020"},{"location":"cs/hpc/openmp/#_12","text":"\u5c06\u5faa\u73af\u8f6c\u6362\u4e3a SIMD \u5faa\u73af aligned \u7528\u4e8e\u5217\u51fa\u5185\u5b58\u5bf9\u9f50\u7684\u6307\u9488 safelen \u7528\u4e8e\u6807\u8bb0\u5faa\u73af\u5c55\u5f00\u65f6\u7684\u6570\u636e\u4f9d\u8d56 \u7f16\u8bd1\u5668\u4e5f\u81ea\u5e26\u5411\u91cf\u5316\u529f\u80fd\uff0c\u4f8b\u5982 gcc -O3 -ffast-math -fivopts -march=native -fopt-info-vec -fopt-info-vec-missed","title":"\u5411\u91cf\u5316"},{"location":"cs/hpc/openmp/#gpu","text":"\u4ece OpenMP API 4.0 \u5f00\u59cb\u652f\u6301 GPU \u52a0\u901f","title":"GPU \u652f\u6301"},{"location":"cs/hpc/outline/","text":"\u6982\u8bba \u00b6 \u7ea6 564 \u4e2a\u5b57 24 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f \u4ec0\u4e48\u662f\u8d85\u7b97 \u00b6 \u8d85\u7ea7\u8ba1\u7b97\u673a\uff0c\u662f\u6307\u80fd\u591f\u6267\u884c\u4e00\u822c\u4e2a\u4eba\u7535\u8111\u65e0\u6cd5\u5904\u7406\u7684\u9ad8\u901f\u8fd0\u7b97\u7684\u8ba1\u7b97\u673a\uff0c\u89c4\u683c\u4e0e\u6027\u80fd\u6bd4\u4e2a\u4eba\u8ba1\u7b97\u673a\u5f3a\u5927\u8bb8\u591a\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u5f00\u53d1\u5de5\u5177 \u00b6 SIMD: AVX/SSE \u00b6 \u9ad8\u7ea7\u5411\u91cf\u6269\u5c55\u6307\u4ee4\u96c6\uff08AVX\uff09\u662f x86 \u67b6\u6784\u5fae\u5904\u7406\u5668\u4e2d\u7684\u6307\u4ee4\u96c6\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u5355\u6307\u4ee4\u591a\u6570\u636e\u6d41\uff08Single Instruction Multiple Data\uff09\uff0c\u5728\u786c\u4ef6\u5c42\u9762\u4e0a\u63d0\u4f9b\u4e86\u901a\u8fc7\u4e00\u6761\u6307\u4ee4\u8fd0\u884c\u591a\u4e2a\u8fd0\u7b97\u7684\u65b9\u6cd5 \u5728 x86 \u67b6\u6784\u4e0b\uff0cSIMD \u4e00\u534a\u548c SSE \u548c AVX \u7b49\u6307\u4ee4\u96c6\u8054\u7cfb\u5728\u4e00\u8d77\uff0cSSE \u548c AVX \u6307\u4ee4\u96c6\u4e2d\u63d0\u4f9b\u4e86\u5927\u91cf\u53ef\u4ee5\u5355\u6307\u4ee4\u64cd\u4f5c\u591a\u4e2a\u6570\u636e\u5355\u5143\u7684\u6307\u4ee4 \u4e0b\u9762\u662f SISD \u548c SIMD \u7684\u6bd4\u8f83 SISD vectorAdd ( float * a , float * b , float * c ) { for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } } SIMD \u901a\u8fc7\u4e00\u6761 CPU \u6307\u4ee4\uff0c\u5e76\u884c\u6267\u884c 8 \u4e2a float \u7684\u52a0 __m256 vectorAdd ( __m256 a , __m256 b , __m256 c ) { return _mm256_add_ps ( a , b ); } SIMT: CUDA/ROCM/OPENCL \u00b6 CUDA\uff08Compute Unified Device Architecture, \u7edf\u4e00\u8ba1\u7b97\u67b6\u6784\uff09\u662f\u7531\u82f1\u4f1f\u8fbe NVIDIA \u6240\u63a8\u51fa\u7684\u4e00\u79cd\u96c6\u6210\u6280\u672f\uff0c\u662f\u8be5\u516c\u53f8\u5bf9\u4e8e GPU \u7684\u6b63\u5f0f\u540d\u79f0\u3002 ROCm \u662f Advanced Micro Devices\uff08AMD\uff09\u7684\u8f6f\u4ef6\u6808\uff0c\u7528\u4e8e\u56fe\u5f62\u5904\u7406\u5355\u5143 GPGPU \u7f16\u7a0b\u3002 OpenCL\uff08Open Computing Language\uff0c\u5f00\u653e\u8ba1\u7b97\u8bed\u8a00\uff09\u662f\u4e00\u4e2a\u4e3a\u5f02\u6784\u5e73\u53f0\u7f16\u5199\u7a0b\u5e8f\u7684\u6846\u67b6\uff0c\u6b64\u5f02\u6784\u5e73\u53f0\u53ef\u7531 CPU\u3001GPU\u3001DSP\u3001FPGA \u6216\u5176\u5b83\u7c7b\u578b\u7684\u5904\u7406\u5668\u4e0e\u786c\u4f53\u52a0\u901f\u5668\u6240\u7ec4\u6210\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 CUDA __global__ void vectorAdd ( float * a , float * b , float * c ) { int tid = blockIdx . x ; if ( tid < 8 ) c [ tid ] = a [ tid ] + b [ tid ]; } OpenCL _kernel void vectorAdd ( global const float * a , global const float * b , global const float * c ) { int gid = get_global_id ( 0 ); if ( gid < 8 ) c [ gid ] = a [ gid ] + b [ gid ]; } MULTI-THREAD: OPENMP \u00b6 OpenMP \u662f\u4e00\u5957\u652f\u6301\u8de8\u5e73\u53f0\u5171\u4eab\u5185\u5b58\u65b9\u5f0f\u7684\u591a\u7ebf\u7a0b\u5e76\u53d1\u7684\u7f16\u7a0b API\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u4e3a\u4e86\u5229\u7528\u591a\u7ebf\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u66f4\u4f4e\u5c42\u7684\u5e93\u8fdb\u884c\u5f00\u53d1\uff08Linux \u4e0b\u7684 pthread\uff09\uff0cOpenMP \u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u7edf\u4e00\u4e14\u7b80\u6d01\u4e14\u8de8\u5e73\u53f0\u7684\u65b9\u5f0f\u8fdb\u884c\u5f00\u53d1\u3002 OpenMP vectorAdd ( float * a , float * b , float * c ) { #pragma omp for for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } } \u6027\u80fd\u8c03\u4f18 \u00b6 CPU \u00b6 CPU \u901a\u8fc7\u5c06\u6570\u636e\u7f13\u5b58\u5230 L1/L2/L3 Cache \u4e2d\u907f\u514d\u5bf9\u5185\u5b58\u7684\u9891\u7e41\u8bbf\u95ee\u9020\u6210\u7684\u4f4e\u6548 \u4f18\u5316\u65b9\u6cd5 \u5faa\u73af\u5c55\u5f00 \u5185\u5b58\u9884\u53d6 ... CPU \u672c\u8eab\u662f\u4e00\u4e2a\u6d41\u6c34\u7ebf\u7ed3\u6784\uff0c\u6267\u884c\u6bcf\u4e00\u6761\u6307\u4ee4\u5206\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u6d41\u6c34\u7ebf\u5730\u6267\u884c\u3002 \u5728\u51fa\u73b0\u5206\u652f\u7684\u5730\u65b9\u53ef\u80fd\u5bfc\u81f4\u6d41\u6c34\u7ebf\u65e0\u6cd5\u6b63\u5e38\u88ab\u586b\u5145 \u4f18\u5316\u65b9\u6cd5 \u5206\u652f\u9884\u6d4b GPU \u00b6 CUDA \u5f00\u53d1\u4e2d\u7684\u95ee\u9898 \u7ebf\u7a0b\u675f\u5206\u5316 \u7406\u89e3 GPU \u5185\u5b58\u6a21\u578b \u5e76\u53d1 ... RDMA \u00b6 \u5728\u6570\u636e\u4e2d\u5fc3\u9886\u57df\uff0c\u8fdc\u7a0b\u76f4\u63a5\u5185\u5b58\u8bbf\u95ee\u3002\u9002\u5408\u5927\u89c4\u6a21\u5e76\u884c\u8ba1\u7b97\u673a\u96c6\u7fa4\u3002","title":"\u6982\u8bba"},{"location":"cs/hpc/outline/#_1","text":"\u7ea6 564 \u4e2a\u5b57 24 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f","title":"\u6982\u8bba"},{"location":"cs/hpc/outline/#_2","text":"\u8d85\u7ea7\u8ba1\u7b97\u673a\uff0c\u662f\u6307\u80fd\u591f\u6267\u884c\u4e00\u822c\u4e2a\u4eba\u7535\u8111\u65e0\u6cd5\u5904\u7406\u7684\u9ad8\u901f\u8fd0\u7b97\u7684\u8ba1\u7b97\u673a\uff0c\u89c4\u683c\u4e0e\u6027\u80fd\u6bd4\u4e2a\u4eba\u8ba1\u7b97\u673a\u5f3a\u5927\u8bb8\u591a\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1","title":"\u4ec0\u4e48\u662f\u8d85\u7b97"},{"location":"cs/hpc/outline/#_3","text":"","title":"\u5f00\u53d1\u5de5\u5177"},{"location":"cs/hpc/outline/#simd-avxsse","text":"\u9ad8\u7ea7\u5411\u91cf\u6269\u5c55\u6307\u4ee4\u96c6\uff08AVX\uff09\u662f x86 \u67b6\u6784\u5fae\u5904\u7406\u5668\u4e2d\u7684\u6307\u4ee4\u96c6\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u5355\u6307\u4ee4\u591a\u6570\u636e\u6d41\uff08Single Instruction Multiple Data\uff09\uff0c\u5728\u786c\u4ef6\u5c42\u9762\u4e0a\u63d0\u4f9b\u4e86\u901a\u8fc7\u4e00\u6761\u6307\u4ee4\u8fd0\u884c\u591a\u4e2a\u8fd0\u7b97\u7684\u65b9\u6cd5 \u5728 x86 \u67b6\u6784\u4e0b\uff0cSIMD \u4e00\u534a\u548c SSE \u548c AVX \u7b49\u6307\u4ee4\u96c6\u8054\u7cfb\u5728\u4e00\u8d77\uff0cSSE \u548c AVX \u6307\u4ee4\u96c6\u4e2d\u63d0\u4f9b\u4e86\u5927\u91cf\u53ef\u4ee5\u5355\u6307\u4ee4\u64cd\u4f5c\u591a\u4e2a\u6570\u636e\u5355\u5143\u7684\u6307\u4ee4 \u4e0b\u9762\u662f SISD \u548c SIMD \u7684\u6bd4\u8f83 SISD vectorAdd ( float * a , float * b , float * c ) { for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } } SIMD \u901a\u8fc7\u4e00\u6761 CPU \u6307\u4ee4\uff0c\u5e76\u884c\u6267\u884c 8 \u4e2a float \u7684\u52a0 __m256 vectorAdd ( __m256 a , __m256 b , __m256 c ) { return _mm256_add_ps ( a , b ); }","title":"SIMD: AVX/SSE"},{"location":"cs/hpc/outline/#simt-cudarocmopencl","text":"CUDA\uff08Compute Unified Device Architecture, \u7edf\u4e00\u8ba1\u7b97\u67b6\u6784\uff09\u662f\u7531\u82f1\u4f1f\u8fbe NVIDIA \u6240\u63a8\u51fa\u7684\u4e00\u79cd\u96c6\u6210\u6280\u672f\uff0c\u662f\u8be5\u516c\u53f8\u5bf9\u4e8e GPU \u7684\u6b63\u5f0f\u540d\u79f0\u3002 ROCm \u662f Advanced Micro Devices\uff08AMD\uff09\u7684\u8f6f\u4ef6\u6808\uff0c\u7528\u4e8e\u56fe\u5f62\u5904\u7406\u5355\u5143 GPGPU \u7f16\u7a0b\u3002 OpenCL\uff08Open Computing Language\uff0c\u5f00\u653e\u8ba1\u7b97\u8bed\u8a00\uff09\u662f\u4e00\u4e2a\u4e3a\u5f02\u6784\u5e73\u53f0\u7f16\u5199\u7a0b\u5e8f\u7684\u6846\u67b6\uff0c\u6b64\u5f02\u6784\u5e73\u53f0\u53ef\u7531 CPU\u3001GPU\u3001DSP\u3001FPGA \u6216\u5176\u5b83\u7c7b\u578b\u7684\u5904\u7406\u5668\u4e0e\u786c\u4f53\u52a0\u901f\u5668\u6240\u7ec4\u6210\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 CUDA __global__ void vectorAdd ( float * a , float * b , float * c ) { int tid = blockIdx . x ; if ( tid < 8 ) c [ tid ] = a [ tid ] + b [ tid ]; } OpenCL _kernel void vectorAdd ( global const float * a , global const float * b , global const float * c ) { int gid = get_global_id ( 0 ); if ( gid < 8 ) c [ gid ] = a [ gid ] + b [ gid ]; }","title":"SIMT: CUDA/ROCM/OPENCL"},{"location":"cs/hpc/outline/#multi-thread-openmp","text":"OpenMP \u662f\u4e00\u5957\u652f\u6301\u8de8\u5e73\u53f0\u5171\u4eab\u5185\u5b58\u65b9\u5f0f\u7684\u591a\u7ebf\u7a0b\u5e76\u53d1\u7684\u7f16\u7a0b API\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u4e3a\u4e86\u5229\u7528\u591a\u7ebf\u7a0b\uff0c\u6211\u4eec\u53ef\u4ee5\u4f7f\u7528\u4e00\u4e9b\u66f4\u4f4e\u5c42\u7684\u5e93\u8fdb\u884c\u5f00\u53d1\uff08Linux \u4e0b\u7684 pthread\uff09\uff0cOpenMP \u63d0\u4f9b\u4e86\u4e00\u79cd\u66f4\u7edf\u4e00\u4e14\u7b80\u6d01\u4e14\u8de8\u5e73\u53f0\u7684\u65b9\u5f0f\u8fdb\u884c\u5f00\u53d1\u3002 OpenMP vectorAdd ( float * a , float * b , float * c ) { #pragma omp for for ( int i = 0 ; i < 8 ; i ++ ) { c [ i ] = a [ i ] + b [ i ]; } }","title":"MULTI-THREAD: OPENMP"},{"location":"cs/hpc/outline/#_4","text":"","title":"\u6027\u80fd\u8c03\u4f18"},{"location":"cs/hpc/outline/#cpu","text":"CPU \u901a\u8fc7\u5c06\u6570\u636e\u7f13\u5b58\u5230 L1/L2/L3 Cache \u4e2d\u907f\u514d\u5bf9\u5185\u5b58\u7684\u9891\u7e41\u8bbf\u95ee\u9020\u6210\u7684\u4f4e\u6548 \u4f18\u5316\u65b9\u6cd5 \u5faa\u73af\u5c55\u5f00 \u5185\u5b58\u9884\u53d6 ... CPU \u672c\u8eab\u662f\u4e00\u4e2a\u6d41\u6c34\u7ebf\u7ed3\u6784\uff0c\u6267\u884c\u6bcf\u4e00\u6761\u6307\u4ee4\u5206\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u6d41\u6c34\u7ebf\u5730\u6267\u884c\u3002 \u5728\u51fa\u73b0\u5206\u652f\u7684\u5730\u65b9\u53ef\u80fd\u5bfc\u81f4\u6d41\u6c34\u7ebf\u65e0\u6cd5\u6b63\u5e38\u88ab\u586b\u5145 \u4f18\u5316\u65b9\u6cd5 \u5206\u652f\u9884\u6d4b","title":"CPU"},{"location":"cs/hpc/outline/#gpu","text":"CUDA \u5f00\u53d1\u4e2d\u7684\u95ee\u9898 \u7ebf\u7a0b\u675f\u5206\u5316 \u7406\u89e3 GPU \u5185\u5b58\u6a21\u578b \u5e76\u53d1 ...","title":"GPU"},{"location":"cs/hpc/outline/#rdma","text":"\u5728\u6570\u636e\u4e2d\u5fc3\u9886\u57df\uff0c\u8fdc\u7a0b\u76f4\u63a5\u5185\u5b58\u8bbf\u95ee\u3002\u9002\u5408\u5927\u89c4\u6a21\u5e76\u884c\u8ba1\u7b97\u673a\u96c6\u7fa4\u3002","title":"RDMA"},{"location":"cs/hpc/vectorizecompute/","text":"\u5411\u91cf\u5316\u8ba1\u7b97 \u00b6","title":"\u5411\u91cf\u5316\u8ba1\u7b97"},{"location":"cs/hpc/vectorizecompute/#_1","text":"","title":"\u5411\u91cf\u5316\u8ba1\u7b97"},{"location":"cs/others/regex/","text":"\u6b63\u5219\u8868\u8fbe\u5f0f \u00b6 \u7ea6 2398 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f \u6b63\u5219\u8868\u8fbe\u5f0f\uff08Regular Expression\uff09\u4f7f\u7528\u5355\u4e2a\u5b57\u7b26\u4e32\u6765\u63cf\u8ff0\u3001\u5339\u914d\u4e00\u7cfb\u5217\u5339\u914d\u67d0\u4e2a\u53e5\u6cd5\u89c4\u5219\u7684\u5b57\u7b26\u4e32\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 Abstract \u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u4e14\u5f3a\u5927\u7684\u65b9\u5f0f\u6765\u67e5\u627e\u3001\u66ff\u6362\u3001\u9a8c\u8bc1\u548c\u63d0\u53d6\u6587\u672c\u6570\u636e\u3002\u5b66\u4e60\u4e0d\u6613\uff0c\u4f46\u4f7f\u7528\u8d77\u6765\u5f88\u8212\u670d\ud83d\ude0c RegExr \u6b63\u5219\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177 Regulex \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 HackerRank regex \u4e60\u9898\u96c6 copy from TonyCrane/note \u8bed\u6cd5 \u00b6 \u666e\u901a\u5b57\u7b26 \u00b6 \u666e\u901a\u5b57\u7b26\u5305\u62ec\u6ca1\u6709\u663e\u5f0f\u6307\u5b9a\u4e3a\u5143\u5b57\u7b26\u7684\u6240\u6709\u53ef\u6253\u5370\u548c\u4e0d\u53ef\u6253\u5370\u5b57\u7b26\u3002\u8fd9\u5305\u62ec\u6240\u6709\u5927\u5199\u548c\u5c0f\u5199\u5b57\u6bcd\u3001\u6240\u6709\u6570\u5b57\u3001\u6240\u6709\u6807\u70b9\u7b26\u53f7\u548c\u4e00\u4e9b\u5176\u4ed6\u7b26\u53f7\u3002 \u8bed\u6cd5 \u63cf\u8ff0 [...] \u5339\u914d\u4efb\u610f\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [ABC] \u5339\u914d\u6240\u6709 A B C \u5b57\u7b26 [^...] \u5339\u914d\u4efb\u610f\u4e0d\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [^ABC] \u5339\u914d\u9664\u4e86 A B C \u5916\u7684\u6240\u6709\u5355\u4e2a\u5b57\u7b26 [x-y] \u6309\u7167\u987a\u5e8f\u5339\u914d\u4ece x \u5230 y \u5230\u6240\u6709\u5b57\u7b26\uff0c\u5982 [a-z] \u5339\u914d\u6240\u6709\u5c0f\u5199\u5b57\u6bcd\uff0c[A-E] \u5339\u914d A \u5230 E \u8fd9\u4e94\u4e2a\u5b57\u7b26\uff5c \\s\\S \u5339\u914d\u6240\u6709\uff0c\\s \u662f\u5339\u914d\u6240\u6709\u7a7a\u767d\u7b26\uff08\u5305\u62ec\u6362\u884c\uff09\uff0c\\S \u975e\u7a7a\u767d\u7b26\uff08\u4e0d\u5305\u62ec\u6362\u884c\uff09 . \u5339\u914d\u4efb\u610f\u9664\u4e86\u6362\u884c\u7b26\u4ee5\u5916\u7684\u5b57\u7b26 \\w \u5339\u914d\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf\uff0c\u76f8\u5f53\u4e8e [a-zA-Z0-9_] x|y \u5339\u914d x \u6216 y \uff0c\u4f18\u5148\u7ea7\u6700\u4f4e\uff0c\u5982 a | bcd \u5339\u914d a \u6216 bcd \u975e\u6253\u5370\u5b57\u7b26 \u00b6 \u8bed\u6cd5 \u63cf\u8ff0 \\cx \u5339\u914d\u7531x\u6307\u660e\u7684\u63a7\u5236\u5b57\u7b26\u3002\u4f8b\u5982\uff0c \\cM \u5339\u914d\u4e00\u4e2a Control-M \u6216\u56de\u8f66\u7b26\u3002x \u7684\u503c\u5fc5\u987b\u4e3a A-Z \u6216 a-z \u4e4b\u4e00\u3002\u5426\u5219\uff0c\u5c06 c \u89c6\u4e3a\u4e00\u4e2a\u539f\u4e49\u7684 'c' \u5b57\u7b26\u3002 \\f \u5339\u914d\u4e00\u4e2a\u6362\u9875\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0c \u548c \\cL\u3002 \\n \u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0a \u548c \\cJ\u3002 \\r \u5339\u914d\u4e00\u4e2a\u56de\u8f66\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0d \u548c \\cM\u3002 \\s \u5339\u914d\u4efb\u4f55\u7a7a\u767d\u5b57\u7b26\uff0c\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49\u3002\u7b49\u4ef7\u4e8e [ \\f\\n\\r\\t\\v]\u3002\u6ce8\u610f Unicode \u6b63\u5219\u8868\u8fbe\u5f0f\u4f1a\u5339\u914d\u5168\u89d2\u7a7a\u683c\u7b26\u3002 \\S \u5339\u914d\u4efb\u4f55\u975e\u7a7a\u767d\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e [^ \\f\\n\\r\\t\\v]\u3002 \\t \u5339\u914d\u4e00\u4e2a\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x09 \u548c \\cI\u3002 \\v \u5339\u914d\u4e00\u4e2a\u5782\u76f4\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0b \u548c \\cK\u3002 \u7279\u6b8a\u5b57\u7b26 \u00b6 \u6709\u4e00\u4e9b\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002 \u8bed\u6cd5 \u63cf\u8ff0 $ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86 RegExp \u5bf9\u8c61\u7684 Multiline \u5c5e\u6027\uff0c\u5219 $ \u4e5f\u5339\u914d '\\n' () \u6807\u8bb0\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002\u5b50\u8868\u8fbe\u5f0f\u53ef\u4ee5\u83b7\u53d6\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u8981\u5339\u914d\u8fd9\u4e9b\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\( \u548c \\)\u3002 * \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d * \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\*\u3002 + \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u4e00\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d + \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\+\u3002 . \u5339\u914d\u9664\u6362\u884c\u7b26 \\n \u4e4b\u5916\u7684\u4efb\u4f55\u5355\u5b57\u7b26\u3002\u8981\u5339\u914d . \uff0c\u8bf7\u4f7f\u7528 \\. \u3002 [ \u6807\u8bb0\u4e00\u4e2a\u4e2d\u62ec\u53f7\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d [\uff0c\u8bf7\u4f7f\u7528 \\[\u3002 ? \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u4e00\u6b21\uff0c\u6216\u6307\u660e\u4e00\u4e2a\u975e\u8d2a\u5a6a\u9650\u5b9a\u7b26\u3002\u8981\u5339\u914d ? \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\?\u3002 \\ \u5c06\u4e0b\u4e00\u4e2a\u5b57\u7b26\u6807\u8bb0\u4e3a\u6216\u7279\u6b8a\u5b57\u7b26\u3001\u6216\u539f\u4e49\u5b57\u7b26\u3001\u6216\u5411\u540e\u5f15\u7528\u3001\u6216\u516b\u8fdb\u5236\u8f6c\u4e49\u7b26\u3002\u4f8b\u5982\uff0c'n' \u5339\u914d\u5b57\u7b26 'n'\u3002'\\n' \u5339\u914d\u6362\u884c\u7b26\u3002\u5e8f\u5217 '\\\\' \u5339\u914d \"\\\"\uff0c\u800c '\\(' \u5219\u5339\u914d \"(\"\u3002 ^ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9664\u975e\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\uff0c\u5f53\u8be5\u7b26\u53f7\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\u65f6\uff0c\u8868\u793a\u4e0d\u63a5\u53d7\u8be5\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u7684\u5b57\u7b26\u96c6\u5408\u3002\u8981\u5339\u914d ^ \u5b57\u7b26\u672c\u8eab\uff0c\u8bf7\u4f7f\u7528 \\^\u3002 { \u6807\u8bb0\u9650\u5b9a\u7b26\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d {\uff0c\u8bf7\u4f7f\u7528 \\{\u3002 | \u6307\u660e\u4e24\u9879\u4e4b\u95f4\u7684\u4e00\u4e2a\u9009\u62e9\u3002\u8981\u5339\u914d | \uff0c\u8bf7\u4f7f\u7528 \\|\u3002 \u9650\u5b9a\u7b26 \u00b6 \u7528\u6765\u6307\u5b9a\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u51fa\u73b0\u4e86\u591a\u5c11\u6b21 \u8bed\u6cd5 \u63cf\u8ff0 {n} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u51c6\u786e\u7684 n \u6b21\uff0c\u5982 o{2} \u5339\u914d\u4e24\u4e2a\u8fde\u7eed\u7684 o {n,} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u5982 o{2,} \u53ef\u4ee5\u5339\u914d goooood \u4e2d\u7684\u6240\u6709 o\uff0c\u4f46\u4e0d\u5339\u914d god \u4e2d\u7684 o {n,m} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u81f3\u591a m \u6b21 * \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 0 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {0,} + \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 1 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {1,} ? \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u53ef\u6709\u53ef\u65e0\uff08\u5339\u914d 0 \u6b21\u6216 1 \u6b21\uff09\uff0c\u76f8\u5f53\u4e8e {0,1} \u8d2a\u5a6a \u00b6 * \u548c + \u7684\u5339\u914d\u90fd\u662f\u8d2a\u5a6a\u7684\uff0c\u5373\u5c3d\u53ef\u80fd\u5339\u914d\u66f4\u591a\u7684\u5b57\u7b26\uff0c\u800c\u5728\u5b83\u4eec\u540e\u9762\u52a0\u4e0a ? \u5c31\u53ef\u4ee5\u975e\u8d2a\u5a6a\uff08\u5373\u6700\u5c0f\u5339\u914d\uff09 <.*> \u4f1a\u5339\u914d\u6574\u4e2a

    header

    \u5b57\u7b26\u4e32 <.*?> \u53ea\u4f1a\u5339\u914d\u5176\u4e2d\u7684

    \u548c

    \u5b9a\u4f4d\u7b26 \u00b6 \u53ea\u5339\u914d\u4f4d\u7f6e\uff0c\u6ca1\u6709\u5b57\u7b26\u4e0e\u4e4b\u5bf9\u5e94 \u8bed\u6cd5 \u63cf\u8ff0 ^ \u5339\u914d\u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5982\u679c\u662f\u591a\u884c\u6a21\u5f0f\uff0c\u5219\u65b0\u7684\u4e00\u884c\u4e5f\u7b97\u65b0\u7684\u5b57\u7b26\u4e32 $ \u5339\u914d\u5b57\u7b26\u4e32\u7ed3\u5c3e\uff0c\u591a\u884c\u6a21\u5f0f\u540c\u7406\u770b\u6210\u591a\u4e2a\u5b57\u7b26\u4e32 \\b \u5339\u914d\u5355\u8bcd\u8fb9\u754c\uff0c\u5373\u5b57\u7b26\u4e0e\u7a7a\u683c\u4e2d\u95f4\u7684\u4f4d\u7f6e \\B \u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c \u5b9a\u4f4d\u7b26\u53ea\u80fd\u5355\u72ec\u4f7f\u7528\uff0c\u4e0d\u80fd\u9644\u52a0\u9650\u5236\u7b26\u6307\u5b9a\u4e2a\u6570 \u5206\u7ec4 \u00b6 \u7528 () \u53ef\u4ee5\u6307\u5b9a\u5339\u914d\u4e00\u4e2a\u7ec4\uff0c\u4f7f\u7528 () \u53ef\u4ee5\u6307\u5b9a\u4e0d\u540c\u9009\u9879\uff0c\u6bcf\u4e00\u9879\u95f4\u7528 | \u5206\u9694 \u540c\u65f6 () \u4e5f\u662f\u6355\u83b7\u5206\u7ec4\uff0c\u5373\u62ec\u53f7\u5185\u5339\u914d\u7684\u5185\u5bb9\u4f1a\u88ab\u7f13\u5b58\uff0c\u5982\u679c\u8981\u907f\u514d\u8fd9\u79cd\uff0c\u9700\u8981\u4f7f\u7528 (?:) \u975e\u6355\u83b7\u5143\u6765\u8fdb\u884c\u5339\u914d \u53cd\u5411\u5f15\u7528 \u00b6 \u88ab\u7f13\u5b58\u7684\u6355\u83b7\u5206\u7ec4\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\n \u518d\u6b21\u5f15\u7528\uff0c\u5176\u4e2d n \u662f 1 \u5230 2 \u4f4d\u7684\u5341\u8fdb\u5236\u6570 \u6355\u83b7\u5206\u7ec4\u7684\u7f16\u53f7\u4ece 1 \u5f00\u59cb\uff0c\u6700\u591a 99 \u4e2a\uff0c\\1 \u5373\u8868\u793a\u548c\u7b2c\u4e00\u4e2a\u5706\u62ec\u53f7\u4e2d\u5339\u914d\u7684\u7ed3\u679c\u76f8\u540c\u7684\u90e8\u5206 \u5982 (abc|def)\\1 \u5339\u914d abcabc\u3001defdef \u4f46\u4e0d\u5339\u914d abcdef\u3001defabc \u5148\u884c\u65ad\u8a00\u548c\u540e\u884c\u65ad\u8a00 \u00b6 \u6b63\u5219\u8868\u8fbe\u5f0f\u6709\u5148\u884c\u65ad\u8a00\uff08lookahead\uff09\u548c\u540e\u884c\u65ad\u8a00\uff08lookbehind\uff09\uff0c\u5206\u4e3a\u56db\u79cd\u5f62\u5f0f\uff1a \u8bed\u6cd5 \u540d\u79f0 (?=pattern) \u96f6\u5bbd\u6b63\u5411\u5148\u884c\u65ad\u8a00 zero-width positive lookahead assertion (?!pattern) \u96f6\u5bbd\u8d1f\u5411\u5148\u884c\u65ad\u8a00 zero-width negative lookahead assertion (?<=pattern) \u96f6\u5bbd\u6b63\u5411\u540e\u884c\u65ad\u8a00 zero-width positive lookbehind assertion (?...) \u5219\u5305\u542b\u4e00\u4e2a\u4ece name \u6620\u5c04\u5230\u6355\u83b7\u7ec4\u7f16\u53f7\u7684\u952e\u503c\u5bf9 re.Match \u00b6 re.Match \u662f match \u548c search \u5728\u6210\u529f\u5339\u914d\u65f6\u8fd4\u56de\u7684\u7c7b\u578b Match.group([group])\uff1a\u8fd4\u56de\u5b57\u7b26\u4e32 group() \u6216 group(0) \u8fd4\u56de\u5339\u914d\u7684\u5b8c\u6574\u5b57\u7b26\u4e32 group(i) \u8fd4\u56de\u7b2c i \u4e2a\u6355\u83b7\u7ec4 Match.start([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u8d77\u59cb\u4f4d\u7f6e\uff08\u5b50\u4e32\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7d22\u5f15\uff09 Match.end([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u7ed3\u675f\u4f4d\u7f6e\uff08\u5b50\u4e32\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u7d22\u5f15+1\uff09 Match.span([group])\uff1a\u8fd4\u56de (Match.start([group]), Match.end([group])) Match.__gettiem__([group])\uff1a\u7b49\u540c\u4e8e .group([group]) \u989d\u5916\u8bed\u6cd5 \u00b6 (?#...)\uff1a\u6ce8\u91ca\uff0c\u76f4\u63a5\u5ffd\u7565 (?P ...)\uff1a\u4e3a\u6355\u83b7\u7ec4\u547d\u540d\u4e3a name\uff08\u5fc5\u987b\u662f\u5408\u6cd5 python \u53d8\u91cf\u540d\uff0c\u5e76\u4e14\u540c\u4e00\u4e2a pattern \u4e2d\u4e0d\u80fd\u91cd\u590d\uff09\uff0c\u540e\u9762\u53ef\u4ee5\u901a\u8fc7 name \u5f15\u7528\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7f16\u53f7\u5f15\u7528\u3002\u5728 Match.group([group]) \u7684 group \u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \"name\" \u6765\u83b7\u53d6\u8fd9\u4e2a\u6355\u83b7\u7ec4 (?P=name)\uff1a\u4e0e\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b8c\u5168\u76f8\u540c\u7684\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u901a\u8fc7\u7f16\u53f7\u5f15\u7528 (?(id/name)yes-pattern|no-pattern)\uff1a\u5982\u679c\u7f16\u53f7\u4e3a id \u6216\u8005\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b58\u5728\uff0c\u5219\u6b64\u5904\u4f7f\u7528 yes-pattern\uff0c\u5426\u5219\u4f7f\u7528 no-pattern \u4f8b\u5982\uff1a (<)?(\\w+@\\w+(?:\\.\\w+)+)(?(1)>|$) \u5339\u914d '' \u548c 'user@host.com' \uff0c\u4f46\u4e0d\u5339\u914d '' \u6807\u8bc6\u7b26 \u00b6 \u6807\u8bc6\u7b26 \u542b\u4e49 re.I \u5ffd\u7565\u5927\u5c0f\u5199 re.L \u672c\u5730\u5316\u8bc6\u522b\u5339\u914d\uff08\u4e0d\u53ef\u9760\uff09 re.M \u591a\u884c\u5339\u914d re.S \u5355\u884c\u5339\u914d\uff0c\u4f7f . \u540c\u6837\u5339\u914d\u6362\u884c\u7b26 re.U \u4f7f\u7528 unicode\uff0c\u5f71\u54cd \\w\\W\\b\\B re.X \u4f7f\u7528 python \u4e00\u6837\u7684\u6ce8\u91ca\uff0c\u5e76\u4e14\u6709\u591a\u884c pattern \u7684\u4f18\u5316\uff0c\u4f7f\u6b63\u5219\u66f4\u6613\u8bfb \u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u6807\u8bc6\u7b26\uff0c\u7528 | \u9694\u5f00\uff08\u5982 re.I | re.M \u8868\u793a\u591a\u884c\u4e14\u5ffd\u7565\u5927\u5c0f\u5199\uff09 re.X \u7684\u4f8b\u5b50 a = re . compile ( r \"\"\"\\d + # the integral part \\. # the decimal point \\d * # some fractional digits\"\"\" , re . X ) b = re . compile ( r \"\\d+\\.\\d*\" ) a b \u7b49\u4ef7 Reference \u00b6 \u83dc\u9e1f\u6559\u7a0b TonyCrane \u6b63\u5219\u8868\u8fbe\u5f0f","title":"RegEx \u6b63\u5219\u8868\u8fbe\u5f0f"},{"location":"cs/others/regex/#_1","text":"\u7ea6 2398 \u4e2a\u5b57 4 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f \u6b63\u5219\u8868\u8fbe\u5f0f\uff08Regular Expression\uff09\u4f7f\u7528\u5355\u4e2a\u5b57\u7b26\u4e32\u6765\u63cf\u8ff0\u3001\u5339\u914d\u4e00\u7cfb\u5217\u5339\u914d\u67d0\u4e2a\u53e5\u6cd5\u89c4\u5219\u7684\u5b57\u7b26\u4e32\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 Abstract \u6b63\u5219\u8868\u8fbe\u5f0f\u63d0\u4f9b\u4e86\u4e00\u79cd\u7075\u6d3b\u4e14\u5f3a\u5927\u7684\u65b9\u5f0f\u6765\u67e5\u627e\u3001\u66ff\u6362\u3001\u9a8c\u8bc1\u548c\u63d0\u53d6\u6587\u672c\u6570\u636e\u3002\u5b66\u4e60\u4e0d\u6613\uff0c\u4f46\u4f7f\u7528\u8d77\u6765\u5f88\u8212\u670d\ud83d\ude0c RegExr \u6b63\u5219\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177 Regulex \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 HackerRank regex \u4e60\u9898\u96c6 copy from TonyCrane/note","title":"\u6b63\u5219\u8868\u8fbe\u5f0f"},{"location":"cs/others/regex/#_2","text":"","title":"\u8bed\u6cd5"},{"location":"cs/others/regex/#_3","text":"\u666e\u901a\u5b57\u7b26\u5305\u62ec\u6ca1\u6709\u663e\u5f0f\u6307\u5b9a\u4e3a\u5143\u5b57\u7b26\u7684\u6240\u6709\u53ef\u6253\u5370\u548c\u4e0d\u53ef\u6253\u5370\u5b57\u7b26\u3002\u8fd9\u5305\u62ec\u6240\u6709\u5927\u5199\u548c\u5c0f\u5199\u5b57\u6bcd\u3001\u6240\u6709\u6570\u5b57\u3001\u6240\u6709\u6807\u70b9\u7b26\u53f7\u548c\u4e00\u4e9b\u5176\u4ed6\u7b26\u53f7\u3002 \u8bed\u6cd5 \u63cf\u8ff0 [...] \u5339\u914d\u4efb\u610f\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [ABC] \u5339\u914d\u6240\u6709 A B C \u5b57\u7b26 [^...] \u5339\u914d\u4efb\u610f\u4e0d\u5728 ... \u4e2d\u7684\u5b57\u7b26\uff0c\u5982 [^ABC] \u5339\u914d\u9664\u4e86 A B C \u5916\u7684\u6240\u6709\u5355\u4e2a\u5b57\u7b26 [x-y] \u6309\u7167\u987a\u5e8f\u5339\u914d\u4ece x \u5230 y \u5230\u6240\u6709\u5b57\u7b26\uff0c\u5982 [a-z] \u5339\u914d\u6240\u6709\u5c0f\u5199\u5b57\u6bcd\uff0c[A-E] \u5339\u914d A \u5230 E \u8fd9\u4e94\u4e2a\u5b57\u7b26\uff5c \\s\\S \u5339\u914d\u6240\u6709\uff0c\\s \u662f\u5339\u914d\u6240\u6709\u7a7a\u767d\u7b26\uff08\u5305\u62ec\u6362\u884c\uff09\uff0c\\S \u975e\u7a7a\u767d\u7b26\uff08\u4e0d\u5305\u62ec\u6362\u884c\uff09 . \u5339\u914d\u4efb\u610f\u9664\u4e86\u6362\u884c\u7b26\u4ee5\u5916\u7684\u5b57\u7b26 \\w \u5339\u914d\u5b57\u6bcd\u6570\u5b57\u4e0b\u5212\u7ebf\uff0c\u76f8\u5f53\u4e8e [a-zA-Z0-9_] x|y \u5339\u914d x \u6216 y \uff0c\u4f18\u5148\u7ea7\u6700\u4f4e\uff0c\u5982 a | bcd \u5339\u914d a \u6216 bcd","title":"\u666e\u901a\u5b57\u7b26"},{"location":"cs/others/regex/#_4","text":"\u8bed\u6cd5 \u63cf\u8ff0 \\cx \u5339\u914d\u7531x\u6307\u660e\u7684\u63a7\u5236\u5b57\u7b26\u3002\u4f8b\u5982\uff0c \\cM \u5339\u914d\u4e00\u4e2a Control-M \u6216\u56de\u8f66\u7b26\u3002x \u7684\u503c\u5fc5\u987b\u4e3a A-Z \u6216 a-z \u4e4b\u4e00\u3002\u5426\u5219\uff0c\u5c06 c \u89c6\u4e3a\u4e00\u4e2a\u539f\u4e49\u7684 'c' \u5b57\u7b26\u3002 \\f \u5339\u914d\u4e00\u4e2a\u6362\u9875\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0c \u548c \\cL\u3002 \\n \u5339\u914d\u4e00\u4e2a\u6362\u884c\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0a \u548c \\cJ\u3002 \\r \u5339\u914d\u4e00\u4e2a\u56de\u8f66\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0d \u548c \\cM\u3002 \\s \u5339\u914d\u4efb\u4f55\u7a7a\u767d\u5b57\u7b26\uff0c\u5305\u62ec\u7a7a\u683c\u3001\u5236\u8868\u7b26\u3001\u6362\u9875\u7b26\u7b49\u7b49\u3002\u7b49\u4ef7\u4e8e [ \\f\\n\\r\\t\\v]\u3002\u6ce8\u610f Unicode \u6b63\u5219\u8868\u8fbe\u5f0f\u4f1a\u5339\u914d\u5168\u89d2\u7a7a\u683c\u7b26\u3002 \\S \u5339\u914d\u4efb\u4f55\u975e\u7a7a\u767d\u5b57\u7b26\u3002\u7b49\u4ef7\u4e8e [^ \\f\\n\\r\\t\\v]\u3002 \\t \u5339\u914d\u4e00\u4e2a\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x09 \u548c \\cI\u3002 \\v \u5339\u914d\u4e00\u4e2a\u5782\u76f4\u5236\u8868\u7b26\u3002\u7b49\u4ef7\u4e8e \\x0b \u548c \\cK\u3002","title":"\u975e\u6253\u5370\u5b57\u7b26"},{"location":"cs/others/regex/#_5","text":"\u6709\u4e00\u4e9b\u7279\u6b8a\u542b\u4e49\u7684\u5b57\u7b26\u3002 \u8bed\u6cd5 \u63cf\u8ff0 $ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\u4f4d\u7f6e\u3002\u5982\u679c\u8bbe\u7f6e\u4e86 RegExp \u5bf9\u8c61\u7684 Multiline \u5c5e\u6027\uff0c\u5219 $ \u4e5f\u5339\u914d '\\n' () \u6807\u8bb0\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u548c\u7ed3\u675f\u4f4d\u7f6e\u3002\u5b50\u8868\u8fbe\u5f0f\u53ef\u4ee5\u83b7\u53d6\u4f9b\u4ee5\u540e\u4f7f\u7528\u3002\u8981\u5339\u914d\u8fd9\u4e9b\u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\( \u548c \\)\u3002 * \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d * \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\*\u3002 + \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u4e00\u6b21\u6216\u591a\u6b21\u3002\u8981\u5339\u914d + \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\+\u3002 . \u5339\u914d\u9664\u6362\u884c\u7b26 \\n \u4e4b\u5916\u7684\u4efb\u4f55\u5355\u5b57\u7b26\u3002\u8981\u5339\u914d . \uff0c\u8bf7\u4f7f\u7528 \\. \u3002 [ \u6807\u8bb0\u4e00\u4e2a\u4e2d\u62ec\u53f7\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d [\uff0c\u8bf7\u4f7f\u7528 \\[\u3002 ? \u5339\u914d\u524d\u9762\u7684\u5b50\u8868\u8fbe\u5f0f\u96f6\u6b21\u6216\u4e00\u6b21\uff0c\u6216\u6307\u660e\u4e00\u4e2a\u975e\u8d2a\u5a6a\u9650\u5b9a\u7b26\u3002\u8981\u5339\u914d ? \u5b57\u7b26\uff0c\u8bf7\u4f7f\u7528 \\?\u3002 \\ \u5c06\u4e0b\u4e00\u4e2a\u5b57\u7b26\u6807\u8bb0\u4e3a\u6216\u7279\u6b8a\u5b57\u7b26\u3001\u6216\u539f\u4e49\u5b57\u7b26\u3001\u6216\u5411\u540e\u5f15\u7528\u3001\u6216\u516b\u8fdb\u5236\u8f6c\u4e49\u7b26\u3002\u4f8b\u5982\uff0c'n' \u5339\u914d\u5b57\u7b26 'n'\u3002'\\n' \u5339\u914d\u6362\u884c\u7b26\u3002\u5e8f\u5217 '\\\\' \u5339\u914d \"\\\"\uff0c\u800c '\\(' \u5219\u5339\u914d \"(\"\u3002 ^ \u5339\u914d\u8f93\u5165\u5b57\u7b26\u4e32\u7684\u5f00\u59cb\u4f4d\u7f6e\uff0c\u9664\u975e\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\uff0c\u5f53\u8be5\u7b26\u53f7\u5728\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u4f7f\u7528\u65f6\uff0c\u8868\u793a\u4e0d\u63a5\u53d7\u8be5\u65b9\u62ec\u53f7\u8868\u8fbe\u5f0f\u4e2d\u7684\u5b57\u7b26\u96c6\u5408\u3002\u8981\u5339\u914d ^ \u5b57\u7b26\u672c\u8eab\uff0c\u8bf7\u4f7f\u7528 \\^\u3002 { \u6807\u8bb0\u9650\u5b9a\u7b26\u8868\u8fbe\u5f0f\u7684\u5f00\u59cb\u3002\u8981\u5339\u914d {\uff0c\u8bf7\u4f7f\u7528 \\{\u3002 | \u6307\u660e\u4e24\u9879\u4e4b\u95f4\u7684\u4e00\u4e2a\u9009\u62e9\u3002\u8981\u5339\u914d | \uff0c\u8bf7\u4f7f\u7528 \\|\u3002","title":"\u7279\u6b8a\u5b57\u7b26"},{"location":"cs/others/regex/#_6","text":"\u7528\u6765\u6307\u5b9a\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u51fa\u73b0\u4e86\u591a\u5c11\u6b21 \u8bed\u6cd5 \u63cf\u8ff0 {n} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u51c6\u786e\u7684 n \u6b21\uff0c\u5982 o{2} \u5339\u914d\u4e24\u4e2a\u8fde\u7eed\u7684 o {n,} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u5982 o{2,} \u53ef\u4ee5\u5339\u914d goooood \u4e2d\u7684\u6240\u6709 o\uff0c\u4f46\u4e0d\u5339\u914d god \u4e2d\u7684 o {n,m} \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d\u81f3\u5c11 n \u6b21\uff0c\u81f3\u591a m \u6b21 * \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 0 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {0,} + \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u5339\u914d 1 \u6b21\u6216\u591a\u6b21\uff0c\u76f8\u5f53\u4e8e {1,} ? \u524d\u4e00\u4e2a\u5b50\u8868\u8fbe\u5f0f\u53ef\u6709\u53ef\u65e0\uff08\u5339\u914d 0 \u6b21\u6216 1 \u6b21\uff09\uff0c\u76f8\u5f53\u4e8e {0,1}","title":"\u9650\u5b9a\u7b26"},{"location":"cs/others/regex/#_7","text":"* \u548c + \u7684\u5339\u914d\u90fd\u662f\u8d2a\u5a6a\u7684\uff0c\u5373\u5c3d\u53ef\u80fd\u5339\u914d\u66f4\u591a\u7684\u5b57\u7b26\uff0c\u800c\u5728\u5b83\u4eec\u540e\u9762\u52a0\u4e0a ? \u5c31\u53ef\u4ee5\u975e\u8d2a\u5a6a\uff08\u5373\u6700\u5c0f\u5339\u914d\uff09 <.*> \u4f1a\u5339\u914d\u6574\u4e2a

    header

    \u5b57\u7b26\u4e32 <.*?> \u53ea\u4f1a\u5339\u914d\u5176\u4e2d\u7684

    \u548c

    ","title":"\u8d2a\u5a6a"},{"location":"cs/others/regex/#_8","text":"\u53ea\u5339\u914d\u4f4d\u7f6e\uff0c\u6ca1\u6709\u5b57\u7b26\u4e0e\u4e4b\u5bf9\u5e94 \u8bed\u6cd5 \u63cf\u8ff0 ^ \u5339\u914d\u5b57\u7b26\u4e32\u5f00\u5934\uff0c\u5982\u679c\u662f\u591a\u884c\u6a21\u5f0f\uff0c\u5219\u65b0\u7684\u4e00\u884c\u4e5f\u7b97\u65b0\u7684\u5b57\u7b26\u4e32 $ \u5339\u914d\u5b57\u7b26\u4e32\u7ed3\u5c3e\uff0c\u591a\u884c\u6a21\u5f0f\u540c\u7406\u770b\u6210\u591a\u4e2a\u5b57\u7b26\u4e32 \\b \u5339\u914d\u5355\u8bcd\u8fb9\u754c\uff0c\u5373\u5b57\u7b26\u4e0e\u7a7a\u683c\u4e2d\u95f4\u7684\u4f4d\u7f6e \\B \u5339\u914d\u975e\u5355\u8bcd\u8fb9\u754c \u5b9a\u4f4d\u7b26\u53ea\u80fd\u5355\u72ec\u4f7f\u7528\uff0c\u4e0d\u80fd\u9644\u52a0\u9650\u5236\u7b26\u6307\u5b9a\u4e2a\u6570","title":"\u5b9a\u4f4d\u7b26"},{"location":"cs/others/regex/#_9","text":"\u7528 () \u53ef\u4ee5\u6307\u5b9a\u5339\u914d\u4e00\u4e2a\u7ec4\uff0c\u4f7f\u7528 () \u53ef\u4ee5\u6307\u5b9a\u4e0d\u540c\u9009\u9879\uff0c\u6bcf\u4e00\u9879\u95f4\u7528 | \u5206\u9694 \u540c\u65f6 () \u4e5f\u662f\u6355\u83b7\u5206\u7ec4\uff0c\u5373\u62ec\u53f7\u5185\u5339\u914d\u7684\u5185\u5bb9\u4f1a\u88ab\u7f13\u5b58\uff0c\u5982\u679c\u8981\u907f\u514d\u8fd9\u79cd\uff0c\u9700\u8981\u4f7f\u7528 (?:) \u975e\u6355\u83b7\u5143\u6765\u8fdb\u884c\u5339\u914d","title":"\u5206\u7ec4"},{"location":"cs/others/regex/#_10","text":"\u88ab\u7f13\u5b58\u7684\u6355\u83b7\u5206\u7ec4\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\n \u518d\u6b21\u5f15\u7528\uff0c\u5176\u4e2d n \u662f 1 \u5230 2 \u4f4d\u7684\u5341\u8fdb\u5236\u6570 \u6355\u83b7\u5206\u7ec4\u7684\u7f16\u53f7\u4ece 1 \u5f00\u59cb\uff0c\u6700\u591a 99 \u4e2a\uff0c\\1 \u5373\u8868\u793a\u548c\u7b2c\u4e00\u4e2a\u5706\u62ec\u53f7\u4e2d\u5339\u914d\u7684\u7ed3\u679c\u76f8\u540c\u7684\u90e8\u5206 \u5982 (abc|def)\\1 \u5339\u914d abcabc\u3001defdef \u4f46\u4e0d\u5339\u914d abcdef\u3001defabc","title":"\u53cd\u5411\u5f15\u7528"},{"location":"cs/others/regex/#_11","text":"\u6b63\u5219\u8868\u8fbe\u5f0f\u6709\u5148\u884c\u65ad\u8a00\uff08lookahead\uff09\u548c\u540e\u884c\u65ad\u8a00\uff08lookbehind\uff09\uff0c\u5206\u4e3a\u56db\u79cd\u5f62\u5f0f\uff1a \u8bed\u6cd5 \u540d\u79f0 (?=pattern) \u96f6\u5bbd\u6b63\u5411\u5148\u884c\u65ad\u8a00 zero-width positive lookahead assertion (?!pattern) \u96f6\u5bbd\u8d1f\u5411\u5148\u884c\u65ad\u8a00 zero-width negative lookahead assertion (?<=pattern) \u96f6\u5bbd\u6b63\u5411\u540e\u884c\u65ad\u8a00 zero-width positive lookbehind assertion (?...) \u5219\u5305\u542b\u4e00\u4e2a\u4ece name \u6620\u5c04\u5230\u6355\u83b7\u7ec4\u7f16\u53f7\u7684\u952e\u503c\u5bf9","title":"re.Pattern"},{"location":"cs/others/regex/#rematch","text":"re.Match \u662f match \u548c search \u5728\u6210\u529f\u5339\u914d\u65f6\u8fd4\u56de\u7684\u7c7b\u578b Match.group([group])\uff1a\u8fd4\u56de\u5b57\u7b26\u4e32 group() \u6216 group(0) \u8fd4\u56de\u5339\u914d\u7684\u5b8c\u6574\u5b57\u7b26\u4e32 group(i) \u8fd4\u56de\u7b2c i \u4e2a\u6355\u83b7\u7ec4 Match.start([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u8d77\u59cb\u4f4d\u7f6e\uff08\u5b50\u4e32\u7b2c\u4e00\u4e2a\u5b57\u7b26\u7684\u7d22\u5f15\uff09 Match.end([group])\uff1aMatch.group([group]) \u5728\u6574\u4e2a\u539f\u5b57\u7b26\u4e32\u4e2d\u7684\u7ed3\u675f\u4f4d\u7f6e\uff08\u5b50\u4e32\u6700\u540e\u4e00\u4e2a\u5b57\u7b26\u7d22\u5f15+1\uff09 Match.span([group])\uff1a\u8fd4\u56de (Match.start([group]), Match.end([group])) Match.__gettiem__([group])\uff1a\u7b49\u540c\u4e8e .group([group])","title":"re.Match"},{"location":"cs/others/regex/#_14","text":"(?#...)\uff1a\u6ce8\u91ca\uff0c\u76f4\u63a5\u5ffd\u7565 (?P ...)\uff1a\u4e3a\u6355\u83b7\u7ec4\u547d\u540d\u4e3a name\uff08\u5fc5\u987b\u662f\u5408\u6cd5 python \u53d8\u91cf\u540d\uff0c\u5e76\u4e14\u540c\u4e00\u4e2a pattern \u4e2d\u4e0d\u80fd\u91cd\u590d\uff09\uff0c\u540e\u9762\u53ef\u4ee5\u901a\u8fc7 name \u5f15\u7528\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u7f16\u53f7\u5f15\u7528\u3002\u5728 Match.group([group]) \u7684 group \u4e2d\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \"name\" \u6765\u83b7\u53d6\u8fd9\u4e2a\u6355\u83b7\u7ec4 (?P=name)\uff1a\u4e0e\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b8c\u5168\u76f8\u540c\u7684\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u901a\u8fc7\u7f16\u53f7\u5f15\u7528 (?(id/name)yes-pattern|no-pattern)\uff1a\u5982\u679c\u7f16\u53f7\u4e3a id \u6216\u8005\u540d\u5b57\u4e3a name \u7684\u6355\u83b7\u7ec4\u5b58\u5728\uff0c\u5219\u6b64\u5904\u4f7f\u7528 yes-pattern\uff0c\u5426\u5219\u4f7f\u7528 no-pattern \u4f8b\u5982\uff1a (<)?(\\w+@\\w+(?:\\.\\w+)+)(?(1)>|$) \u5339\u914d '' \u548c 'user@host.com' \uff0c\u4f46\u4e0d\u5339\u914d ''","title":"\u989d\u5916\u8bed\u6cd5"},{"location":"cs/others/regex/#_15","text":"\u6807\u8bc6\u7b26 \u542b\u4e49 re.I \u5ffd\u7565\u5927\u5c0f\u5199 re.L \u672c\u5730\u5316\u8bc6\u522b\u5339\u914d\uff08\u4e0d\u53ef\u9760\uff09 re.M \u591a\u884c\u5339\u914d re.S \u5355\u884c\u5339\u914d\uff0c\u4f7f . \u540c\u6837\u5339\u914d\u6362\u884c\u7b26 re.U \u4f7f\u7528 unicode\uff0c\u5f71\u54cd \\w\\W\\b\\B re.X \u4f7f\u7528 python \u4e00\u6837\u7684\u6ce8\u91ca\uff0c\u5e76\u4e14\u6709\u591a\u884c pattern \u7684\u4f18\u5316\uff0c\u4f7f\u6b63\u5219\u66f4\u6613\u8bfb \u540c\u65f6\u4f7f\u7528\u591a\u4e2a\u6807\u8bc6\u7b26\uff0c\u7528 | \u9694\u5f00\uff08\u5982 re.I | re.M \u8868\u793a\u591a\u884c\u4e14\u5ffd\u7565\u5927\u5c0f\u5199\uff09 re.X \u7684\u4f8b\u5b50 a = re . compile ( r \"\"\"\\d + # the integral part \\. # the decimal point \\d * # some fractional digits\"\"\" , re . X ) b = re . compile ( r \"\\d+\\.\\d*\" ) a b \u7b49\u4ef7","title":"\u6807\u8bc6\u7b26"},{"location":"cs/others/regex/#reference","text":"\u83dc\u9e1f\u6559\u7a0b TonyCrane \u6b63\u5219\u8868\u8fbe\u5f0f","title":"Reference"},{"location":"cs/pl/","text":"Programming language \u00b6 Abstract \u8bb0\u5f55\u4e00\u4e9b\u5b66\u4e60\u7f16\u7a0b\u8bed\u8a00\u65f6\u7684\u7b14\u8bb0 \u57fa\u672c\u90fd\u662f\u8fb9\u5b66\u8fb9\u7528\uff0c\u96f6\u96f6\u6563\u6563\uff0c\u6ca1\u6709\u7cfb\u7edf\u5730\u5b66\u4e60\u8fc7\uff08\u672c\u79d1\u6d47\u7684\u4e5f\u7b97\uff1f Table of Contents \u00b6 C/C++ C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528 Python Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883 Go Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO) Java Java \u57fa\u7840\u77e5\u8bc6 SpringBoot","title":"Programming language"},{"location":"cs/pl/#programming-language","text":"Abstract \u8bb0\u5f55\u4e00\u4e9b\u5b66\u4e60\u7f16\u7a0b\u8bed\u8a00\u65f6\u7684\u7b14\u8bb0 \u57fa\u672c\u90fd\u662f\u8fb9\u5b66\u8fb9\u7528\uff0c\u96f6\u96f6\u6563\u6563\uff0c\u6ca1\u6709\u7cfb\u7edf\u5730\u5b66\u4e60\u8fc7\uff08\u672c\u79d1\u6d47\u7684\u4e5f\u7b97\uff1f","title":"Programming language"},{"location":"cs/pl/#table-of-contents","text":"C/C++ C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528 Python Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883 Go Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO) Java Java \u57fa\u7840\u77e5\u8bc6 SpringBoot","title":"Table of Contents"},{"location":"cs/pl/c_cpp/","text":"C/C++ \u00b6 Abstract \u5b66\u4e60\u65f6\u95f4\u6700\u957f\u7684\u4e00\u95e8\u7f16\u7a0b\u8bed\u8a00\uff0c\u4f7f\u7528\u6700\u591a\u4e14\u6700\u4e3a\u719f\u6089\u7684\u7f16\u7a0b\u8bed\u8a00\u4e86\uff08\u6839\u672c\u4e0d\u4f1a \u5728ACM\u7ade\u8d5b\u4e2d\u5e38\u7528\uff0c\u5305\u62ec\u5728\u505aSLAM\u4e2d\u4e5f\u8981\u7ecf\u5e38\u4f7f\u7528\u3002 Table of Contents \u00b6 C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528","title":"C/C++"},{"location":"cs/pl/c_cpp/#cc","text":"Abstract \u5b66\u4e60\u65f6\u95f4\u6700\u957f\u7684\u4e00\u95e8\u7f16\u7a0b\u8bed\u8a00\uff0c\u4f7f\u7528\u6700\u591a\u4e14\u6700\u4e3a\u719f\u6089\u7684\u7f16\u7a0b\u8bed\u8a00\u4e86\uff08\u6839\u672c\u4e0d\u4f1a \u5728ACM\u7ade\u8d5b\u4e2d\u5e38\u7528\uff0c\u5305\u62ec\u5728\u505aSLAM\u4e2d\u4e5f\u8981\u7ecf\u5e38\u4f7f\u7528\u3002","title":"C/C++"},{"location":"cs/pl/c_cpp/#table-of-contents","text":"C++ \u7cfb\u7edf\u77e5\u8bc6 C++ STL C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528","title":"Table of Contents"},{"location":"cs/pl/c_cpp/basic/","text":"C++ \u7cfb\u7edf\u77e5\u8bc6 \u00b6 \u7ea6 12299 \u4e2a\u5b57 8 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 41 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9b\u5173\u4e8eC++\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6\uff0c\u5305\u62ec\u9762\u5411\u5bf9\u8c61\u7b49 \u4ee3\u7801\u5230\u53ef\u6267\u884c\u7a0b\u5e8f \u00b6 \u9884\u5904\u7406\uff1a\u6761\u4ef6\u7f16\u8bd1\uff0c\u5934\u6587\u4ef6\u5305\u542b\uff0c\u5b8f\u66ff\u6362\u5904\u7406\uff0c\u751f\u6210.i\u6587\u4ef6 \u7f16\u8bd1\uff1a\u5c06\u9884\u5904\u7406\u540e\u7684\u6587\u4ef6\u8f6c\u5316\u4e3a\u6c47\u7f16\u8bed\u8a00\uff0c\u751f\u6210.s\u6587\u4ef6 \u6c47\u7f16\uff1a\u6c47\u7f16\u53d8\u4e3a\u76ee\u6807\u4ee3\u7801\uff08\u673a\u5668\u4ee3\u7801\uff09\uff0c\u751f\u6210.o\u6587\u4ef6 \u94fe\u63a5\uff1a\u8fde\u63a5\u76ee\u6807\u4ee3\u7801\uff0c\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f \u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93 \u00b6 \u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93\u6700\u672c\u8d28\u7684\u533a\u522b\u5c31\u662f\uff1a \u8be5\u5e93\u662f\u5426\u88ab\u7f16\u8bd1\u8fdb\u76ee\u6807\uff08\u7a0b\u5e8f\uff09\u5185\u90e8 \u9759\u6001\u5e93 \u4e00\u822c\u6269\u5c55\u540d\u4e3a .a \u6216 .lib \uff0c\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u4f1a\u76f4\u63a5\u6574\u5408\u5230\u76ee\u6807\u7a0b\u5e8f\u4e2d\uff0c\u6240\u4ee5\u5229\u7528\u9759\u6001\u51fd\u6570\u5e93\u7f16\u8bd1\u6210\u7684\u6587\u4ef6\u6bd4\u8f83\u5927\uff0c\u6700\u5927\u7684\u4f18\u70b9\u5c31\u662f \u7f16\u8bd1\u6210\u529f\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u4ee5\u72ec\u7acb\u8fd0\u884c \uff0c\u800c\u4e0d\u518d\u9700\u8981\u5411\u5916\u90e8\u8981\u6c42\u8bfb\u53d6\u51fd\u6570\u5e93\u7684\u5185\u5bb9\uff1b\u4f46\u662f\u4ece\u5347\u7ea7\u96be\u6613\u5ea6\u6765\u770b\u660e\u663e\u6ca1\u6709\u4f18\u52bf\uff0c \u5982\u679c\u51fd\u6570\u5e93\u66f4\u65b0\uff0c\u9700\u8981\u91cd\u65b0\u7f16\u8bd1 \u3002 \u52a8\u6001\u5e93 \u52a8\u6001\u51fd\u6570\u5e93\u7684\u6269\u5c55\u540d\u4e00\u822c\u4e3a .so \u6216 .dll \uff0c\u8fd9\u7c7b\u51fd\u6570\u5e93\u901a\u5e38\u540d\u4e3alibxxx.so\u6216xxx.dll\u3002 \u4e0e\u9759\u6001\u51fd\u6570\u5e93\u88ab\u6574\u4e2a\u6355\u6349\u5230\u7a0b\u5e8f\u4e2d\u4e0d\u540c\uff0c\u52a8\u6001\u51fd\u6570\u5e93\u5728\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u91cc\u53ea\u6709\u4e00\u4e2a\u201c\u6307\u5411\u201d\u7684\u4f4d\u7f6e\u800c\u5df2\uff0c\u4e5f\u5c31\u662f\u8bf4\u5f53\u53ef\u6267\u884c\u6587\u4ef6\u9700\u8981\u4f7f\u7528\u51fd\u6570\u5e93\u7684\u673a\u5236\u65f6\uff0c\u7a0b\u5e8f\u624d\u4f1a\u53bb\u8bfb\u53d6\u51fd\u6570\u5e93\u6765\u4f7f\u7528\uff1b\u4e5f\u5c31\u662f\u8bf4\u53ef\u6267\u884c\u6587\u4ef6\u65e0\u6cd5\u5355\u72ec\u8fd0\u884c\u3002\u8fd9\u6837\u4ece\u4ea7\u54c1\u529f\u80fd\u5347\u7ea7\u89d2\u5ea6\u65b9\u4fbf\u5347\u7ea7\uff0c\u53ea\u9700\u8981\u66ff\u6362\u5bf9\u5e94\u52a8\u6001\u5e93\u5373\u53ef\uff0c\u4e0d\u5fc5\u91cd\u65b0\u7f16\u8bd1\u6574\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002 dll\u52a0\u8f7d \u00b6 \u9690\u5f0f\u52a0\u8f7d\uff08\u9759\u6001\u8c03\u7528\uff09 \u00b6 \u5728\u7a0b\u5e8f\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u5c06dll\u7f16\u8bd1\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u8c03\u7528\u65b9\u4fbf\uff0c\u7a0b\u5e8f\u53d1\u5e03\u7684\u65f6\u5019\u53ef\u4ee5\u4e0d\u7528\u5e26\u7740dll \u7f3a\u70b9\u662f\u7a0b\u5e8f\u4f1a\u5f88\u5927 \u663e\u793a\u52a0\u8f7d\uff08\u52a8\u6001\u8c03\u7528\uff09 \u00b6 \u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u7528\u5230dll\u91cc\u7684\u51fd\u6570\u65f6\uff0c\u518d\u52a8\u6001\u52a0\u8f7ddll\u5230\u5185\u5b58\u4e2d \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u56e0\u4e3a\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u540e\u518d\u52a0\u8f7d\u5230\uff0c\u6240\u4ee5\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u542f\u52a8\u66f4\u5feb\uff0c\u800c\u4e14dll\u7684\u7ef4\u62a4\u66f4\u5bb9\u6613\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u5982\u679c\u9700\u8981\u66f4\u65b0\uff0c\u5f88\u591a\u65f6\u5019\u76f4\u63a5\u66f4\u65b0dll\uff0c\u800c\u4e0d\u7528\u91cd\u65b0\u5b89\u88c5\u7a0b\u5e8f \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\uff0c\u51fd\u6570\u8c03\u7528\u7a0d\u5fae\u590d\u6742\u4e00\u70b9 C++\u5185\u5b58\u7ba1\u7406 \u00b6 \u5185\u5b58\u7ed3\u6784 \u00b6 C++ \u5185\u5b58\u5206\u533a\uff1a\u6808\u3001\u5806\u3001\u81ea\u7531\u5b58\u50a8\u533a\u3001\u5168\u5c40/\u9759\u6001\u5b58\u50a8\u533a\u3001\u5e38\u91cf\u533a \u6808\uff1a\u5b58\u653e\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u52a8\u5206\u914d\u548c\u91ca\u653e \u5806\uff1a\u52a8\u6001\u7533\u8bf7\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u5c31\u662f\u7531 malloc \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531\u7a0b\u5e8f\u5458\u63a7\u5236\u5b83\u7684\u5206\u914d\u548c\u91ca\u653e\uff0c\u5982\u679c\u7a0b\u5e8f\u6267\u884c\u7ed3\u675f\u8fd8\u6ca1\u6709\u91ca\u653e\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u56de\u6536 \u81ea\u7531\u5b58\u50a8\u533a\uff1a\u548c\u5806\u5341\u5206\u76f8\u4f3c\uff0c\u5b58\u653e\u7531 new \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531 delete \u91ca\u653e\u5185\u5b58 \u5168\u5c40\u533a/\u9759\u6001\u533a\uff1a\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u53d8\u91cf \u5e38\u91cf\u5b58\u50a8\u533a\uff1a\u5b58\u653e\u7684\u662f\u5e38\u91cf\uff0c\u4e0d\u5141\u8bb8\u4fee\u6539 \u4e8b\u5b9e\u4e0a\uff0c\u6211\u5728\u7f51\u4e0a\u770b\u7684\u5f88\u591a\u535a\u5ba2\uff0c\u5212\u5206\u81ea\u7531\u5b58\u50a8\u533a\u4e0e\u5806\u7684\u5206\u754c\u7ebf\u5c31\u662fnew/delete\u4e0emalloc/free\u3002\u7136\u800c\uff0c\u5c3d\u7ba1C++\u6807\u51c6\u6ca1\u6709\u8981\u6c42\uff0c\u4f46\u5f88\u591a\u7f16\u8bd1\u5668\u7684new/delete\u90fd\u662f\u4ee5malloc/free\u4e3a\u57fa\u7840\u6765\u5b9e\u73b0\u7684\u3002\u90a3\u4e48\u8bf7\u95ee\uff1a\u501f\u4ee5malloc\u5b9e\u73b0\u7684new\uff0c\u6240\u7533\u8bf7\u7684\u5185\u5b58\u662f\u5728\u5806\u4e0a\u8fd8\u662f\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\uff1f \u4ece\u6280\u672f\u4e0a\u6765\u8bf4\uff0c\u5806\uff08heap\uff09\u662fC\u8bed\u8a00\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u672f\u8bed\u3002\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u6240\u7ef4\u62a4\u7684\u4e00\u5757\u7279\u6b8a\u5185\u5b58\uff0c\u5b83\u63d0\u4f9b\u4e86\u52a8\u6001\u5206\u914d\u7684\u529f\u80fd\uff0c\u5f53\u8fd0\u884c\u7a0b\u5e8f\u8c03\u7528malloc()\u65f6\u5c31\u4f1a\u4ece\u4e2d\u5206\u914d\uff0c\u7a0d\u540e\u8c03\u7528free\u53ef\u628a\u5185\u5b58\u4ea4\u8fd8\u3002\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u548cdelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\uff0c\u901a\u8fc7new\u6765\u7533\u8bf7\u7684\u5185\u5b58\u533a\u57df\u53ef\u79f0\u4e3a\u81ea\u7531\u5b58\u50a8\u533a\u3002\u57fa\u672c\u4e0a\uff0c\u6240\u6709\u7684C++\u7f16\u8bd1\u5668\u9ed8\u8ba4\u4f7f\u7528\u5806\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4e5f\u5373\u662f\u7f3a\u7701\u7684\u5168\u5c40\u8fd0\u7b97\u7b26new\u548cdelete\u4e5f\u8bb8\u4f1a\u6309\u7167malloc\u548cfree\u7684\u65b9\u5f0f\u6765\u88ab\u5b9e\u73b0\uff0c\u8fd9\u65f6\u85c9\u7531new\u8fd0\u7b97\u7b26\u5206\u914d\u7684\u5bf9\u8c61\uff0c\u8bf4\u5b83\u5728\u5806\u4e0a\u4e5f\u5bf9\uff0c\u8bf4\u5b83\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e5f\u6b63\u786e\u3002\u4f46\u7a0b\u5e8f\u5458\u4e5f\u53ef\u4ee5\u901a\u8fc7\u91cd\u8f7d\u64cd\u4f5c\u7b26\uff0c\u6539\u7528\u5176\u4ed6\u5185\u5b58\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4f8b\u5982\u5168\u5c40\u53d8\u91cf\u505a\u7684\u5bf9\u8c61\u6c60\uff0c\u8fd9\u65f6\u81ea\u7531\u5b58\u50a8\u533a\u5c31\u533a\u522b\u4e8e\u5806\u4e86\u3002\u6211\u4eec\u6240\u9700\u8981\u8bb0\u4f4f\u7684\u5c31\u662f\uff1a \u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u7ef4\u62a4\u7684\u4e00\u5757\u5185\u5b58\uff0c\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u4e0edelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\u3002\u5806\u4e0e\u81ea\u7531\u5b58\u50a8\u533a\u5e76\u4e0d\u7b49\u4ef7\u3002 \u5185\u5b58\u6cc4\u6f0f \u00b6 \u5185\u5b58\u6cc4\u6f0f\u662f\u6307\u5e94\u7528\u7a0b\u5e8f\u5206\u914d\u67d0\u6bb5\u5185\u5b58\u540e\uff0c \u5931\u53bb\u4e86\u5bf9\u8be5\u6bb5\u5185\u5b58\u7684\u63a7\u5236 \uff0c\u56e0\u800c\u9020\u6210\u4e86\u5185\u5b58\u7684\u6d6a\u8d39\u3002 1. \u5728\u7c7b\u7684\u6784\u9020\u51fd\u6570\u548c\u6790\u6784\u51fd\u6570\u4e2d\u6ca1\u6709\u5339\u914d\u7684\u8c03\u7528new\u548cdelete\u51fd\u6570 2. \u6ca1\u6709\u6b63\u786e\u5730\u6e05\u9664 \u5d4c\u5957\u7684\u5bf9\u8c61\u6307\u9488 3. \u5728\u91ca\u653e \u5bf9\u8c61\u6570\u7ec4 \u65f6\u5728\u4e2d\u6ca1\u6709\u4f7f\u7528delete[] 4. \u6307\u5411\u5bf9\u8c61\u7684\u6307\u9488\u6570\u7ec4\u4e0d\u7b49\u540c\u4e8e\u5bf9\u8c61\u6570\u7ec4 1. \u7f3a\u5c11 \u62f7\u8d1d\u6784\u9020\u51fd\u6570 \u6216 \u91cd\u8f7d\u590d\u5236\u8fd0\u7b97\u7b26 \uff1a\u9690\u5f0f\u7684\u6307\u9488\u590d\u5236\u7ed3\u679c\u5c31\u662f\u4e24\u4e2a\u5bf9\u8c61\u62e5\u6709\u6307\u5411\u540c\u4e00\u4e2a\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u7a7a\u95f4\u7684\u6307\u9488\u3002 5. \u6ca1\u6709\u5c06\u57fa\u7c7b\u7684 \u6790\u6784\u51fd\u6570 \u5b9a\u4e49\u4e3a\u865a\u51fd\u6570\u3002 \u907f\u514d\u5185\u5b58\u6cc4\u6f0f \u00b6 RAII \u8d44\u6e90\u83b7\u53d6\u5373\u521d\u59cb\u5316 \uff0c\u662f\u4e00\u79cd\u5229\u7528\u5bf9\u8c61\u751f\u547d\u5468\u671f\u6765\u63a7\u5236\u7a0b\u5e8f\u8d44\u6e90\uff08\u5982\u5185\u5b58\u3001\u6587\u4ef6\u53e5\u67c4\u3001\u7f51\u7edc\u8fde\u63a5\u3001\u4e92\u65a5\u91cf\u7b49\u7b49\uff09\u7684\u7b80\u5355\u6280\u672f\u3002\u667a\u80fd\u6307\u9488\u5373RAII\u6700\u5177\u4ee3\u8868\u7684\u5b9e\u73b0 C++\u7279\u6027 \u00b6 C++\u7684\u7279\u6027\uff08C++11\u53ca\u4ee5\u4e0a\uff09 \u00b6 \u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001 \u9700\u8981\u5728\u4e0d\u540c\u7684\u5e73\u53f0\u4e0a\u8fdb\u884c\u7f16\u8bd1 \u7f16\u8bd1\u540e\u7684\u7a0b\u5e8f\u53ef\u4ee5\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u76f4\u63a5\u8fd0\u884c \u53ef\u4ee5\u9762\u5411\u8fc7\u7a0b\u548c\u9762\u5411\u5bf9\u8c61\u4e24\u79cd\u8bbe\u8ba1\u65b9\u5f0f \u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u672c\u5730\u7684\u7cfb\u7edf\u5e93 \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u63a5\u53e3 \u7f16\u8bd1\u540e\u4ec5\u5bf9\u53d8\u91cf\u7684\u7c7b\u578b\u8fdb\u884c\u4e86\u5b58\u50a8\uff0c\u4e0d\u53ef\u4ee5\u8fdb\u884c\u7c7b\u4f3c\u53cd\u5c04\u7684\u64cd\u4f5c \u652f\u6301\u65e0\u7b26\u53f7\u6574\u578b \u53d8\u91cf\u7c7b\u578b\u7684\u5b57\u8282\u957f\u5ea6\u53d7\u64cd\u4f5c\u7cfb\u7edf\u5f71\u54cd \u652f\u6301\u6307\u9488\u3001\u5f15\u7528\u3001\u503c\u4f20\u9012 \u6ca1\u6709\u9ed8\u8ba4\u63d0\u4f9b\u7684GC\u7cfb\u7edf \u7531\u7a0b\u5e8f\u5458\u8d1f\u8d23\u7ba1\u7406\u53d8\u91cf\u6240\u50a8\u5b58\u7684\u4f4d\u7f6e \u4e25\u683c\u7684RAII \u652f\u6301\u91cd\u5199\u3001\u91cd\u8f7d\uff0c\u5305\u62ec\u8fd0\u7b97\u7b26\u7684\u91cd\u8f7d \u591a\u91cd\u7ee7\u627f \u652f\u6301\u9884\u7f16\u8bd1\uff0c\u7f16\u8bd1\u5b8f\u5b9a\u4e49 \u652f\u6301\u51fd\u6570\u6307\u9488\uff0c\u51fd\u6570\u5bf9\u8c61\uff0clambda\u8868\u8fbe\u5f0f C++11\u65b0\u589e\u7684\u7279\u6027 \u00b6 foreach auto \u81ea\u52a8\u7c7b\u578b\u63a8\u65ad lambda \u533f\u540d\u51fd\u6570 \u540e\u7f6e\u8fd4\u56de\u7c7b\u578b override \u5173\u952e\u5b57 \u7981\u6b62\u91cd\u5199 final \u5e38\u91cf\u8868\u8fbe\u5f0f constexpr nullptr \u4ee3\u8868\u539f\u6765\u7684NULL\uff0c\u800c\u539f\u6765\u7684NULL\u66f4\u591a\u8868\u793a\u4e3a0 \u5f53\u5b58\u5728 void a(int x); \u548c void a(char *x); \u65f6\uff0c\u82e5\u4f7f\u7528 a(NULL) \u5219\u4f1a\u8c03\u7528\u524d\u8005\uff0c\u8fd9\u4e0e\u901a\u5e38\u7684\u7406\u89e3\u4e0d\u540c\uff0c\u800c\u4f7f\u7528 a*nullptr) \u5219\u4f1a\u660e\u786e\u7684\u8c03\u7528\u540e\u8005 \u5143\u7ec4 tuple \uff0c\u53ef\u4ee5\u4f7f\u7528 get<>() \u53d6\u51fa\u5176\u4e2d\u4e00\u4e2a\u503c\uff0c\u6216\u8005\u4f7f\u7528 tie() \u88c5\u5305\u6216\u89e3\u5305 struct\u548cclass\u7684\u533a\u522b \u00b6 struct\u9ed8\u8ba4\u4f7f\u7528public\uff0c\u800cclass\u9ed8\u8ba4\u4f7f\u7528private struct\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 {} \u8fdb\u884c\u521d\u59cb\u5316\uff0c\u800cclass\u5219\u9700\u8981\u6240\u6709\u6210\u5458\u53d8\u91cf\u90fd\u662fpublic\u7684\u65f6\u5019\u624d\u53ef\u4ee5\u4f7f\u7528 \u5806\u548c\u6808\u7684\u533a\u522b \u00b6 \u7533\u8bf7\u65b9\u5f0f\uff1a\u6808\u662f\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u5806\u662f\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7 \u7533\u8bf7\u540e\u7cfb\u7edf\u54cd\u5e94\uff1a\u5206\u914d\u6808\u7a7a\u95f4\uff0c\u5982\u679c\u5269\u4f59\u7a7a\u95f4\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u5219\u5206\u914d\u6210\u529f\uff0c\u5426\u5219\u5206\u914d\u5931\u8d25\u6808\u6ea2\u51fa\uff1b\u7533\u8bf7\u5806\u7a7a\u95f4\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u5448\u73b0\u7684\u65b9\u5f0f\u7c7b\u4f3c\u4e8e\u94fe\u8868\uff08\u8bb0\u5f55\u7a7a\u95f2\u5730\u5740\u7a7a\u95f4\u7684\u94fe\u8868\uff09\uff0c\u5728\u94fe\u8868\u4e0a\u5bfb\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u7684\u8282\u70b9\u5206\u914d\u7ed9\u7a0b\u5e8f\uff0c\u5c06\u8be5\u8282\u70b9\u4ece\u94fe\u8868\u4e2d\u5220\u9664\uff0c\u5927\u591a\u6570\u7cfb\u7edf\u4e2d\u8be5\u5757\u7a7a\u95f4\u7684\u9996\u5730\u5740\u5b58\u653e\u7684\u662f\u672c\u6b21\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u4fbf\u4e8e\u91ca\u653e\uff0c\u5c06\u8be5\u5757\u7a7a\u95f4\u4e0a\u7684\u5269\u4f59\u7a7a\u95f4\u518d\u6b21\u8fde\u63a5\u5728\u7a7a\u95f2\u94fe\u8868\u4e0a \u6808\u5728\u5185\u5b58\u4e2d\u662f\u8fde\u7eed\u7684\u4e00\u5757\u7a7a\u95f4\uff08\u5411\u4f4e\u5730\u5740\u6269\u5c55\uff09\u6700\u5927\u5bb9\u91cf\u662f\u7cfb\u7edf\u9884\u5b9a\u597d\u7684\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u7684\u7a7a\u95f4\uff08\u5411\u9ad8\u5730\u5740\u6269\u5c55\uff09\u662f\u4e0d\u8fde\u7eed\u7684 \u7533\u8bf7\u6548\u7387\uff1a\u6808\u662f\u6709\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u7533\u8bf7\u6548\u7387\u9ad8\uff0c\u4f46\u7a0b\u5e8f\u5458\u65e0\u6cd5\u63a7\u5236\uff1b\u5806\u662f\u7531\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7\uff0c\u6548\u7387\u4f4e\uff0c\u4f7f\u7528\u8d77\u6765\u65b9\u4fbf\u4f46\u662f\u5bb9\u6613\u4ea7\u751f\u788e\u7247 \u5b58\u653e\u7684\u5185\u5bb9\uff1a\u6808\u4e2d\u5b58\u653e\u7684\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u51fd\u6570\u7684\u53c2\u6570\uff1b\u5806\u4e2d\u5b58\u653e\u7684\u5185\u5bb9\u7531\u7a0b\u5e8f\u5458\u63a7\u5236 \u64cd\u4f5c\u7cfb\u7edf\u89d2\u5ea6 \u00b6 \u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u8fdb\u7a0b\u6240\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\u7528\u6765\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u3002\u7531\u7a0b\u5e8f\u5458\u7ba1\u7406\uff0c\u4e3b\u52a8\u7533\u8bf7\u4ee5\u53ca\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\uff0c\u5728\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u7531\u64cd\u4f5c\u7cfb\u7edf\u56de\u6536 \u6808\u662f\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7ba1\u7406\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7533\u8bf7\uff0c\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u901a\u5e38\u6bd4\u5806\u8981\u5c0f\u5f88\u591a\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\uff0c2\u5f53\u8c03\u7528\u4e00\u4e2a\u51fd\u6570\u65f6\u4f1a\u521b\u5efa\u4e00\u4e2a\u6808\uff0c\u5f53\u51fd\u6570\u7ed3\u675f\u65f6\u5219\u4f1a\u56de\u6536\u6808\u7684\u7a7a\u95f4\u3002 \u6570\u636e\u7ed3\u6784\u89d2\u5ea6 \u00b6 \u5806\u662f\u4e00\u9897\u5b8c\u5168\u4e8c\u53c9\u6811\uff0c\u5e38\u89c1\u7684\u6709\u6700\u5927\u5806\u548c\u6700\u5c0f\u5806\uff0c\u4ee5\u6700\u5927\u5806\u4e3a\u4f8b\uff0c\u5176\u6ee1\u8db3\u4e8c\u53c9\u6811\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u8282\u70b9\u7684\u5b69\u5b50\u8282\u70b9\u90fd\u6bd4\u6b64\u8282\u70b9\u5c0f\u3002\u901a\u5e38\u7528\u6765\u5b9e\u73b0\u4f18\u5148\u961f\u5217\u7684\u6548\u679c\uff0c\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(log N)\\) \u6808\u662f\u4e00\u79cd\u7ebf\u6027\u6570\u636e\u7ed3\u6784\uff0c\u6ee1\u8db3\u5148\u8fdb\u540e\u51fa\u7684\u7279\u70b9\uff0c\u5373\u6700\u5148\u8fdb\u5165\u7684\u6570\u636e\u6700\u540e\u79bb\u5f00\uff0c\u5e38\u89c1\u4e8eDFS\u4e2d\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5355\u8c03\u6808\u7684\u65b9\u5f0f\u6c42\u89e3\u4e00\u4e9b\u95ee\u9898\u3002\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(1)\\) C++\u4e2d\u56db\u79cdcast\u8f6c\u6362 \u00b6 const_cast \uff1a\u5bf9\u4e8e\u672a\u5b9a\u4e49const\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528const_cast\u6765\u53bb\u9664const\u5f15\u7528\u5bf9\u8c61\u7684const\uff0c\u5b8c\u6210\u51fd\u6570\u8c03\u7528\u3002\u53e6\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u7ed3\u5408static_cast\uff0c\u53ef\u4ee5\u5728\u975econst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u5185\u6dfb\u52a0const\uff0c\u8c03\u7528\u5b8cconst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u540e\uff0c\u518d\u4f7f\u7528const_cast\u53bb\u9664const\u9650\u5b9a\u3002 static_cast \uff1a\u5b8c\u6210\u57fa\u7840\u6570\u636e\u7c7b\u578b\uff1b\u540c\u4e00\u4e2a\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7c7b\u578b\u7684\u8f6c\u6362\uff1b\u4efb\u610f\u7c7b\u578b\u4e0e\u7a7a\u6307\u9488\u7c7b\u578bvoid* \u4e4b\u95f4\u7684\u8f6c\u6362\u3002 reinterpret_cast \uff1a\u65e0\u6761\u4ef6\u8f6c\u6362\uff08\u4ec0\u4e48\u90fd\u53ef\u4ee5\u8f6c\uff09\uff0cint\u53ef\u4ee5\u8f6c\u6307\u9488\uff0c\u53ef\u80fd\u4f1a\u51fa\u95ee\u9898\uff0c\u5c3d\u91cf\u5c11\u7528\u3002 dynamic_cast \uff1a\u7528\u4e8e\u52a8\u6001\u7c7b\u578b\u8f6c\u6362\u3002\u53ea\u80fd\u7528\u4e8e\u542b\u6709\u865a\u51fd\u6570\u7684\u7c7b\uff0c\u7528\u4e8e\u7c7b\u5c42\u6b21\u95f4\u7684\u5411\u4e0a\u548c\u5411\u4e0b\u8f6c\u6362\uff08\u5b50\u7c7b\u548c\u57fa\u7c7b\uff09\u3002\u53ea\u80fd\u8f6c\u6307\u9488\u6216\u5f15\u7528\u3002\u5411\u4e0b\u8f6c\u5316\u65f6\uff0c\u5982\u679c\u662f\u975e\u6cd5\u7684\u5bf9\u4e8e\u6307\u9488\u8fd4\u56deNULL\uff0c\u5bf9\u4e8e\u5f15\u7528\u629b\u5f02\u5e38\u3002\u5b83\u901a\u8fc7\u5224\u65ad\u5728\u6267\u884c\u5230\u8be5\u8bed\u53e5\u7684\u65f6\u5019\u53d8\u91cf\u7684\u8fd0\u884c\u65f6\u7c7b\u578b\u548c\u8981\u8f6c\u6362\u7684\u7c7b\u578b\u662f\u5426\u76f8\u540c\u6765\u5224\u65ad\u662f\u5426\u80fd\u591f\u8fdb\u884c\u5411\u4e0b\u8f6c\u6362\u3002 static \u00b6 \u9759\u6001\u5c40\u90e8\u53d8\u91cf \uff1a\u53d8\u91cf\u5c5e\u4e8e\u51fd\u6570\u672c\u8eab\uff0c\u4ec5\u53d7\u51fd\u6570\u7684\u63a7\u5236\u3002\u4fdd\u5b58\u5728\u5168\u5c40\u6570\u636e\u533a\uff0c\u800c\u4e0d\u662f\u5728\u6808\u4e2d\uff0c\u6bcf\u6b21\u7684\u503c\u4fdd\u6301\u5230\u4e0b\u4e00\u6b21\u8c03\u7528\uff0c\u76f4\u5230\u4e0b\u6b21\u8d4b\u65b0\u503c\u3002 \u9759\u6001\u5168\u5c40\u53d8\u91cf \uff1a\u5b9a\u4e49\u5728\u51fd\u6570\u4f53\u5916\uff0c\u7528\u4e8e\u4fee\u9970\u5168\u5c40\u53d8\u91cf\uff0c\u8868\u793a\u8be5\u53d8\u91cf \u53ea\u5728\u672c\u6587\u4ef6\u53ef\u89c1 \uff0c\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff08\u5168\u5c40\u53d8\u91cf\u53ef\u4ee5\uff09 \u9759\u6001\u51fd\u6570 \uff1a\u9759\u6001\u51fd\u6570\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff0c\u5176\u4ed6\u6587\u4ef6\u4e2d\u53ef\u4ee5\u5b9a\u4e49\u76f8\u540c\u540d\u5b57\u7684\u51fd\u6570\uff0c\u4e0d\u4f1a\u53d1\u751f\u51b2\u7a81 \u9759\u6001\u6570\u636e\u6210\u5458 \uff1a\u9759\u6001\u6570\u636e\u6210\u5458\u7684\u751f\u5b58\u671f\u5927\u96e8class\u7684\u5b9e\u4f8b\uff08\u9759\u6001\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2aclass\u6709\u4e00\u4efd\uff0c\u666e\u901a\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2ainstance\u6709\u4e00\u4efd\uff09 1. \u9759\u6001\u6210\u5458\u4e4b\u95f4\u53ef\u4ee5\u76f8\u4e92\u8bbf\u95ee \uff0c\u5305\u62ec\u9759\u6001\u6210\u5458\u51fd\u6570\u8bbf\u95ee\u9759\u6001\u6570\u636e\u6210\u5458\u548c\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\uff1b 2. \u975e\u9759\u6001\u6210\u5458\u51fd\u6570 \u53ef\u4ee5\u4efb\u610f\u5730\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\u548c\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 3. \u9759\u6001\u6210\u5458\u51fd\u6570\u4e0d\u80fd\u8bbf\u95ee\u975e\u9759\u6001 \u6210\u5458\u51fd\u6570\u548c\u975e\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 4. \u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u53ef\u4ee5\u7528\u6210\u5458\u8bbf\u95ee\u64cd\u4f5c\u7b26 . \u6216 -> \u4e3a\u4e00\u4e2a\u7c7b\u7684\u5bf9\u8c61\u6216\u6307\u5411\u7c7b\u5bf9\u8c61\u7684\u6307\u9488\u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u4e5f\u53ef\u4ee5\u7528\u7c7b\u540d :: \u51fd\u6570\u540d\u8c03\u7528(\u56e0\u4e3a\u5b83\u672c\u6765\u5c31\u662f\u5c5e\u4e8e\u7c7b\u7684\uff0c\u7528\u7c7b\u540d\u8c03\u7528\u5f88\u6b63\u5e38) static\u53d8\u91cf\u7684\u7279\u70b9 \u00b6 \u8be5\u53d8\u91cf\u5728\u5168\u5c40\u6570\u636e\u533a\u5206\u914d\u5185\u5b58 \u672a\u7ecf\u521d\u59cb\u5316\u7684\u9759\u6001\u5168\u5c40\u53d8\u91cf\u4f1a\u88ab\u7a0b\u5e8f\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0\uff08\u81ea\u52a8\u53d8\u91cf\u7684\u503c\u662f\u968f\u673a\u7684\uff0c\u9664\u975e\u4ed6\u88ab\u663e\u5f0f\u521d\u59cb\u5316\uff09 \u9759\u6001\u5168\u5c40\u53d8\u91cf\u5728\u58f0\u660e\u5b83\u7684\u6574\u4e2a\u6587\u4ef6\u90fd\u662f\u53ef\u89c1\u7684\uff0c\u800c\u5728\u6587\u4ef6\u4e4b\u5916\u662f\u4e0d\u53ef\u89c1\u7684 const \u00b6 \u4fee\u9970\u666e\u901a\u7c7b\u578b\u7684\u53d8\u91cf \u4fee\u9970\u6307\u9488\uff1a \u9876\u5c42const \uff08\u6307\u9488\u672c\u8eab\u662f\u4e2a\u5e38\u91cf\uff09\u548c \u5e95\u5c42const \uff08\u6307\u9488\u6307\u5411\u5bf9\u8c61\u662f\u4e00\u4e2a\u5e38\u91cf\uff09 \u4fee\u9970\u51fd\u6570\u53c2\u6570\uff1a 1. \u51fd\u6570\u53c2\u6570\u4e3a\u503c\u4f20\u9012\uff1a\u503c\u4f20\u9012\uff08pass-by-value\uff09\u662f\u4f20\u9012\u4e00\u4efd\u53c2\u6570\u7684\u62f7\u8d1d\u7ed9\u51fd\u6570\uff0c\u56e0\u6b64\u4e0d\u8bba\u51fd\u6570\u4f53\u4ee3\u7801\u5982\u4f55\u8fd0\u884c\uff0c\u4e5f\u53ea\u4f1a\u4fee\u6539\u62f7\u8d1d\u800c\u65e0\u6cd5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff0c\u8fd9\u79cd\u60c5\u51b5 \u4e0d\u9700\u8981\u5c06\u53c2\u6570\u58f0\u660e\u4e3aconst \u3002 2. \u51fd\u6570\u53c2\u6570\u4e3a\u6307\u9488\uff1a\u6307\u9488\u4f20\u9012\uff08pass-by-pointer\uff09 \u53ea\u4f1a\u8fdb\u884c\u6d45\u62f7\u8d1d\uff0c\u62f7\u8d1d\u4e00\u4efd\u6307\u9488\u7ed9\u51fd\u6570 \uff0c\u800c\u4e0d\u4f1a\u62f7\u8d1d\u4e00\u4efd\u539f\u59cb\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u7ed9\u6307\u9488\u53c2\u6570\u52a0\u4e0a\u9876\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u9488\u6307\u5411\u88ab\u7be1\u6539\uff0c\u52a0\u4e0a\u5e95\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u5411\u5bf9\u8c61\u88ab\u7be1\u6539\u3002 3. \u51fd\u6570\u53c2\u6570\u4e3a\u5f15\u7528\uff1a\u5f15\u7528\u4f20\u9012\uff08pass-by-reference\uff09\u53c8\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u7531\u4e8e\u5f15\u7528\u5c31\u662f\u5bf9\u8c61\u7684\u4e00\u4e2a\u522b\u540d\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u62f7\u8d1d\u5bf9\u8c61\uff0c\u51cf\u5c0f\u4e86\u5f00\u9500\u3002\u8fd9\u540c\u65f6\u4e5f\u5bfc\u81f4\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u5f15\u7528\u76f4\u63a5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff08\u6bd5\u7adf\u5f15\u7528\u548c\u539f\u59cb\u5bf9\u8c61\u5176\u5b9e\u662f\u540c\u4e00\u4e2a\u4e1c\u897f\uff09\uff0c\u56e0\u6b64\uff0c\u5927\u591a\u6570\u65f6\u5019\uff0c\u63a8\u8350\u51fd\u6570\u53c2\u6570\u8bbe\u7f6e\u4e3a pass-by-reference-to-const \u3002\u7ed9\u5f15\u7528\u52a0\u4e0a\u5e95\u5c42const\uff0c\u65e2\u53ef\u4ee5\u51cf\u5c0f\u62f7\u8d1d\u5f00\u9500\uff0c\u53c8\u53ef\u4ee5\u9632\u6b62\u4fee\u6539\u5e95\u5c42\u6240\u7528\u7684\u5bf9\u8c61\u3002 \u4fee\u9970\u51fd\u6570\u8fd4\u56de\u503c\uff1a\u4ee4\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5e38\u91cf\uff0c\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u56e0\u7528\u6237\u9519\u8bef\u9020\u6210\u7684\u610f\u5916\uff0c\u6bd4\u5982\u201c=\u201d\u3002 const\u6210\u5458\u51fd\u6570\uff1a const\u6210\u5458\u51fd\u6570\u4e0d\u53ef\u4fee\u6539\u7c7b\u5bf9\u8c61\u7684\u5185\u5bb9 \uff08\u6307\u9488\u7c7b\u578b\u7684\u6570\u636e\u6210\u5458\u53ea\u80fd\u4fdd\u8bc1\u4e0d\u4fee\u6539\u8be5\u6307\u9488\u6307\u5411\uff09\u3002\u539f\u7406\u662fconst\u6210\u5458\u51fd\u6570\u7684this\u6307\u9488\u5f0f\u5e95\u5c42const\u6307\u9488\uff0c\u4e0d\u80fd\u540c\u4e8e\u6539\u53d8\u5176\u6240\u6307\u5bf9\u8c61\u7684\u503c\u3002 \u5f53\u6210\u5458\u51fd\u6570const\u548cnon-const\u7248\u672c\u540c\u65f6\u5b58\u5728\u65f6\uff0cconst object\u53ea\u80fd\u8c03\u7528const\u7248\u672c\uff0cnon-const object\u667a\u80fd\u8c03\u7528non-const\u7248\u672c\u3002 extern \"C\" \u00b6 extern \"C\"\u7684\u4e3b\u8981\u4f5c\u7528\u5c31\u662f\u4e3a\u96f6\u80fd\u591f\u6b63\u786e\u5b9e\u73b0 C++\u4ee3\u7801\u8c03\u7528\u5176\u4ed6C\u8bed\u8a00\u4ee3\u7801 \u3002 \u52a0\u4e0aextern \"C\"\u540e\uff0c\u4f1a\u6307\u793a\u7f16\u8bd1\u5668\u8fd9\u90e8\u5206\u4ee3\u7801\u6309C\u8bed\u8a00\uff08\u800c\u4e0d\u662fC++\uff09\u7684\u65b9\u5f0f\u8fdb\u884c\u7f16\u8bd1\u3002\u7531\u4e8eC++\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1\u5668\u7f16\u8bd1\u51fd\u6570\u7684\u8fc7\u7a0b\u4e2d\u4f1a\u5c06\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u4e5f\u52a0\u5230\u7f16\u8bd1\u540e\u7684\u4ee3\u7801\u4e2d\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u51fd\u6570\u540d\uff1b\u800cC\u8bed\u8a00\u5e76\u4e0d\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1C\u8bed\u8a00\u4ee3\u7801\u7684\u51fd\u6570\u65f6\u4e0d\u4f1a\u5e26\u4e0a\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\uff0c\u4e00\u822c\u6307\u5305\u62ec\u51fd\u6570\u540d\u3002 \u5728C++\u51fa\u73b0\u4ee5\u524d\uff0c\u5f88\u591a\u4ee3\u7801\u90fd\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u800c\u4e14\u5f88\u5e95\u5c42\u7684\u5e93\u4e5f\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u4e3a\u4e86\u66f4\u597d\u7684\u652f\u6301\u539f\u6765\u7684C\u4ee3\u7801\u548c\u5df2\u7ecf\u5199\u597d\u7684C\u8bed\u8a00\u5e93\uff0c\u9700\u8981\u5728C++\u4e2d\u5c3d\u53ef\u80fd\u652f\u6301C\uff0c\u800cextern \"C\"\u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u7b56\u7565\u3002 C++\u4ee3\u7801\u8c03\u7528C\u8bed\u8a00\u4ee3\u7801 \u5728C++\u7684\u5934\u6587\u4ef6\u4e2d\u4f7f\u7528 \u5728\u591a\u4e2a\u534f\u540c\u5f00\u53d1\u65f6\uff0c\u53ef\u80fd\u6709\u7684\u4eba\u6bd4\u8f83\u64c5\u957fC\u8bed\u8a00\uff0c\u800c\u6709\u7684\u4eba\u64c5\u957fC++ inline \u00b6 \u7c7b\u5185\u5b9a\u4e49\u6210\u5458\u51fd\u6570\u9ed8\u8ba4\u4e3ainline \u4f18\u70b9 \u00b6 inline\u5b9a\u4e49\u7684\u7c7b\u7684\u5185\u8054\u51fd\u6570\uff0c\u51fd\u6570\u7684\u4ee3\u7801\u88ab\u653e\u5165\u7b26\u53f7\u8868\u4e2d\uff0c\u5728\u4f7f\u7528\u65f6\u76f4\u63a5\u8fdb\u884c\u66ff\u6362\uff0c\uff08\u50cf\u5b8f\u4e00\u6837\u5c55\u5f00\uff09\uff0c\u6ca1\u6709\u4e86\u8c03\u7528\u7684\u5f00\u9500\uff0c\u6548\u7387\u4e5f\u5f88\u9ad8\u3002 \u5185\u8054\u51fd\u6570\u4e5f\u662f\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u5728\u8c03\u7528\u4e00\u4e2a\u5185\u8054\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u68c0\u67e5\u5b83\u7684\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u4fdd\u8bc1\u8c03\u7528\u6b63\u786e\u3002\u7136\u540e\u8fdb\u884c\u4e00\u7cfb\u5217\u7684\u76f8\u5173\u68c0\u67e5\uff0c\u5c31\u50cf\u5bf9\u5f85\u4efb\u4f55\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\u4e00\u6837\u3002\u8fd9\u6837\u5c31\u6d88\u9664\u4e86\u5b83\u7684\u9690\u60a3\u548c\u5c40\u9650\u6027\u3002\uff08\u5b8f\u66ff\u6362\u4e0d\u4f1a\u68c0\u67e5\u7c7b\u578b\uff0c\u5b89\u5168\u9690\u60a3\u8f83\u5927\uff09 inline\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u7c7b\u7684\u6210\u5458\u51fd\u6570\uff0c\u4e0e\u7c7b\u7684\u666e\u901a\u6210\u5458\u51fd\u6570\u4f5c\u7528\u76f8\u540c\uff0c\u53ef\u4ee5\u653e\u4e3a\u4e00\u4e2a\u7c7b\u7684\u79c1\u6709\u6210\u5458\u548c\u4fdd\u62a4\u6210\u5458\u3002\u5185\u8054\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u66ff\u6362\u4e00\u822c\u7684\u5b8f\u5b9a\u4e49\uff0c\u6700\u91cd\u8981\u7684\u5e94\u7528\u5728\u4e8e\u7c7b\u7684\u5b58\u53d6\u51fd\u6570\u7684\u5b9a\u4e49\u4e0a\u9762\u3002 \u7f3a\u70b9 \u00b6 \u5185\u8054\u51fd\u6570\u5177\u6709\u4e00\u5b9a\u7684\u5c40\u9650\u6027\uff0c\u5185\u8054\u51fd\u6570\u7684 \u51fd\u6570\u4f53\u4e00\u822c\u6765\u8bf4\u4e0d\u80fd\u592a\u5927 \uff0c\u5982\u679c\u5185\u8054\u51fd\u6570\u7684\u51fd\u6570\u4f53\u8fc7\u5927\uff0c\u4e00\u822c\u7684\u7f16\u8bd1\u5668\u4f1a\u653e\u5f03\u5185\u8054\u65b9\u5f0f\uff0c\u800c\u91c7\u7528\u666e\u901a\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570\u3002\uff08\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f60\u5982\u679c\u4f7f\u7528\u5185\u8054\u51fd\u6570\uff0c\u53ea\u4e0d\u8fc7\u662f\u5411\u7f16\u8bd1\u5668\u63d0\u51fa\u4e00\u4e2a\u8bf7\u6c42\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u62d2\u7edd\u4f60\u7684\u8bf7\u6c42\uff09\u8fd9\u6837\uff0c\u5185\u8054\u51fd\u6570\u5c31\u548c\u666e\u901a\u51fd\u6570\u6267\u884c\u6548\u7387\u4e00\u6837\u4e86\u3002 inline\u8bf4\u660e\u5bf9\u7f16\u8bd1\u5668\u6765\u8bf4\u53ea\u662f\u4e00\u79cd\u5efa\u8bae\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u9009\u62e9\u5ffd\u7565\u8fd9\u4e2a\u5efa\u8bae\u3002\u6bd4\u5982\uff0c\u4f60\u8bb2\u4e00\u4e2a\u957f\u8fbe1000\u591a\u884c\u7684\u51fd\u6570\u6307\u5b9a\u4e3ainline\uff0c\u7f16\u8bd1\u5668\u5c31\u4f1a\u5ffd\u7565\u8fd9\u4e2ainline\uff0c\u5c06\u8fd9\u4e2a\u51fd\u6570\u8fd8\u539f\u6210\u666e\u901a\u51fd\u6570\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u8bf4\u628a\u4e00\u4e2a\u51fd\u6570\u5b9a\u4e49\u4e3ainline\u51fd\u6570\u5c31\u4e00\u5b9a\u4f1a\u88ab\u7f16\u8bd1\u5668\u8bc6\u522b\u4e3a\u5185\u8054\u51fd\u6570\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668\u7684\u5b9e\u73b0\u548c\u51fd\u6570\u4f53\u7684\u5927\u5c0f\u3002 \u548c\u5b8f\u5b9a\u4e49\u7684\u533a\u522b \u00b6 \u5b8f\u662f\u7531\u9884\u5904\u7406\u5668\u5bf9\u5b8f\u8fdb\u884c\u66ff\u4ee3\uff0c\u800c\u4e14\u5185\u8054\u51fd\u6570\u662f\u771f\u6b63\u7684\u51fd\u6570\uff0c\u53ea\u662f\u5728\u9700\u8981\u7528\u5230\u7684\u65f6\u5019\uff0c\u5185\u8054\u51fd\u6570\u50cf\u5b8f\u4e00\u6837\u7684\u5c55\u5f00\uff0c\u6240\u4ee5 \u53d6\u6d88\u4e86\u51fd\u6570\u7684\u53c2\u6570\u538b\u6808\uff0c\u51cf\u5c11\u4e86\u8c03\u7528\u7684\u5f00\u9500 \uff0c\u4f60\u53ef\u4ee5\u50cf\u8c03\u7528\u51fd\u6570\u4e00\u6837\u6765\u8c03\u7528\u5185\u8054\u51fd\u6570\uff0c\u800c\u4e0d\u5fc5\u62c5\u5fc3\u4f1a\u4ea7\u751f\u4e8e\u5904\u7406\u5b8f\u7684\u4e00\u4e9b\u95ee\u9898\u3002\u5185\u8054\u51fd\u6570\u4e0e\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ed6\u4eec\u7684\u4ee3\u7801\u6548\u7387\u662f\u4e00\u6837\uff0c\u4f46\u662f\u5185\u8054\u51fd\u6570\u8981\u4f18\u4e8e\u5b8f\u5b9a\u4e49\uff0c\u56e0\u4e3a\u5185\u8054\u51fd\u6570\u9075\u5faa\u7684\u7c7b\u578b\u548c\u4f5c\u7528\u57df\u89c4\u5219\uff0c\u5b83\u4e0e\u4e00\u822c\u51fd\u6570\u66f4\u76f8\u8fd1\uff0c\u5728\u4e00\u4e9b\u7f16\u8bd1\u5668\u4e2d\uff0c\u4e00\u65e6\u5173\u8054\u4e0a\u5185\u8054\u6269\u5c55\uff0c\u5c06\u4e0e\u4e00\u822c\u51fd\u6570\u4e00\u6837\u8fdb\u884c\u8c03\u7528\uff0c\u6bd4\u8f83\u65b9\u4fbf\u3002 \u6307\u9488\u548c\u5f15\u7528 \u00b6 \u6307\u9488\u6709\u7740\u81ea\u5df1\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u662f\u4e00\u4e2a\u53d8\u91cf\u7c7b\u578b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e0d\u4f1a\u50cf\u5176\u4ed6\u53d8\u91cf\u4e00\u6837\u53d8\u5316\uff0c\u800c\u5f15\u7528\u672c\u8d28\u4e0a\u662f\u201c\u53d8\u91cf\u7684\u522b\u540d\u201d\uff0c\u6ca1\u6709\u5360\u7528\u5185\u5b58\u7a7a\u95f4 \u6307\u9488\u5728\u58f0\u660e\u5468\u671f\u5185\u968f\u65f6\u53ef\u80fd\u4f1aNULL\uff0c\u6240\u4ee5\u4f7f\u7528\u65f6\u4e00\u5b9a\u8981\u505a\u68c0\u67e5\uff0c\u9632\u6b62\u51fa\u73b0\u7a7a\u6307\u9488\u3001\u91ce\u6307\u9488\u7684\u60c5\u51b5 \u6307\u9488\u58f0\u660e\u65f6\u53ef\u4ee5 \u6682\u65f6\u4e0d\u521d\u59cb\u5316 \uff0c\u5f15\u7528\u58f0\u660e\u65f6 \u5fc5\u987b\u521d\u59cb\u5316 \u4f7f\u7528 sizeof \u53ef\u4ee5\u6c42\u5f97\u51fa\u572832\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e3a4\u4e2a\u5b57\u8282\uff0c\u800c\u5f15\u7528\u5219\u4e3a\u539f\u5bf9\u8c61\u7684\u5927\u5c0f \u6307\u9488\u53ef\u4ee5\u521d\u59cb\u5316\u4e3a\u4efb\u610f\u6b63\u6574\u6570\u503c\uff0c\u800c\u5f15\u7528\u5fc5\u987b\u521d\u59cb\u5316\u4e3a\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u53d8\u91cf \u53c2\u6570\u4f20\u9012\u65f6\uff0c\u6307\u9488\u9700\u8981\u5148\u8fdb\u884c\u6307\u9488\u8f6c\u4e3a\u5f15\u7528\u7136\u540e\u518d\u4f7f\u7528\uff0c\u800c\u5f15\u7528\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u539f\u5bf9\u8c61 \u6307\u9488\u53ef\u4ee5\u6709 const \u5c5e\u6027\uff0c\u800c\u5f15\u7528\u6ca1\u6709 \u6307\u9488\u53ef\u4ee5\u91cd\u65b0\u8d4b\u503c\uff0c\u800c\u5f15\u7528\u4e0d\u53ef\u4ee5\u66f4\u6539 \u6307\u9488\u53ef\u4ee5\u8fdb\u884c\u591a\u7ea7\u6307\u9488\uff0c\u800c\u5f15\u7528\u53ea\u6709\u4e00\u7ea7 \u6307\u9488\u548c\u5f15\u7528\u8fdb\u884c++\uff08\u81ea\u589e\uff09\u64cd\u4f5c\u7684\u903b\u8f91\u548c\u7ed3\u679c\u90fd\u4e0d\u540c \u5f53\u9700\u8981\u8fd4\u56de\u52a8\u6001\u5185\u5b58\u5206\u914d\u7684\u5bf9\u8c61\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u6307\u9488\u800c\u4e0d\u662f\u5f15\u7528\uff0c\u56e0\u4e3a\u5f15\u7528\u53ef\u80fd\u4f1a\u4ea7\u751f\u5185\u5b58\u6cc4\u6f0f C++\u56db\u4e2a\u667a\u80fd\u6307\u9488 \u00b6 \u5c06\u57fa\u672c\u7c7b\u578b\u6307\u9488\u5c01\u88c5\u4e3a\u7c7b\u5bf9\u8c61\u6307\u9488\uff0c\u5e76\u5728\u6790\u6784\u51fd\u6570\u91cc\u7f16\u5199delete\u8bed\u53e5\u5220\u9664\u6307\u9488\u6307\u5411\u7684\u5185\u5b58\u7a7a\u95f4\u3002 \u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f \u7a7a\u6307\u9488\u548c\u91ce\u6307\u9488\u7684\u95ee\u9898 \u5bf9\u8c61\u91cd\u590d\u91ca\u653e\u7684\u95ee\u9898 \u5185\u5b58\u6cc4\u6f0f\u7684\u95ee\u9898 auto_ptr \uff08\u5df2\u5f03\u7528\uff09 \u91c7\u7528\u6240\u6709\u6743\u6a21\u5f0f\uff0c\u4efb\u4f55\u4e00\u4e2a new \u7684\u5bf9\u8c61\u53ea\u80fd\u7531\u4e00\u4e2a auto_ptr \u6765\u6307\u5411\uff0c\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u4f1a\u4f7f\u5f97\u539f\u6765\u7684\u6307\u9488\u4e22\u5931\u6307\u5411\u7684\u5bf9\u8c61 unique_ptr \u4e0e auto_ptr \u76f8\u540c\uff0c\u4f46\u662f\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u76f4\u63a5\u62a5\u9519\uff0c\u800c auto_ptr \u4e0d\u4f1a shared_ptr \u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u591a\u4e2a\u6307\u9488\u6307\u5411\u6b64\u5bf9\u8c61\uff0c\u540c\u65f6\u5f53\u6240\u6709\u6307\u5411\u6b64\u5bf9\u8c61\u7684\u6307\u9488\u90fd\u88ab\u6790\u6784\u540e\uff0c\u6b64\u5bf9\u8c61\u5c06\u4f1a\u88ab\u5220\u9664 weak_ptr \u5f31\u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u6307\u5411\u5176\u4ed6\u7684 shared_ptr \u5bf9\u8c61\uff0c\u6b64\u6307\u9488\u4e0d\u4f1a\u5f71\u54cd shared_ptr \u7684\u6790\u6784\u884c\u4e3a\uff0c\u901a\u5e38\u7528\u6765\u907f\u514d\u76f8\u4e92\u6307\u5411\u95ee\u9898 \u91ce\u6307\u9488 \u00b6 \u6307\u5411\u88ab\u91ca\u653e\u7684\u6216\u8005\u8bbf\u95ee\u53d7\u9650\u5185\u5b58\u7684\u6307\u9488\u3002 \u9020\u6210\u91ce\u6307\u9488\u7684\u539f\u56e0\uff1a - \u6307\u9488\u53d8\u91cf\u6ca1\u6709\u88ab\u521d\u59cb\u5316\uff08\u5982\u679c\u503c\u4e0d\u5b9a\uff0c\u53ef\u4ee5\u521d\u59cb\u5316\u4e3aNULL\uff09 - \u6307\u9488\u88abfree\u6216\u8005delete\u540e\uff0c\u6ca1\u6709\u7f6e\u4e3aNULL\uff0cfree\u548cdelete\u53ea\u662f\u628a\u6307\u9488\u6240\u6307\u5411\u7684\u5185\u5b58\u7ed9\u91ca\u653e\u6389\uff0c\u5e76\u6ca1\u6709\u628a\u6307\u9488\u672c\u8eab\u5e72\u6389\uff0c\u6b64\u65f6\u6307\u9488\u6307\u5411\u7684\u662f\uff1a\u201c\u5783\u573e\u201d\u5185\u5b58\u3002\u91ca\u653e\u540e\u7684\u6307\u9488\u5e94\u8be5\u88ab\u7f6e\u4e3aNULL\u3002 - \u6307\u9488\u64cd\u4f5c\u8d85\u8d8a\u4e86\u53d8\u91cf\u7684\u4f5c\u7528\u8303\u56f4\uff0c\u6bd4\u5982\u8fd4\u56de\u6307\u5411\u6808\u5185\u5b58\u7684\u6307\u9488\u5c31\u662f\u91ce\u6307\u9488\u3002 new\u548cmalloc \u00b6 \u5728\u4f7f\u7528\u7684\u65f6\u5019 new,delete \u642d\u914d\u4f7f\u7528\uff0cmalloc \u548c free \u642d\u914d\u4f7f\u7528\u3002 \u5c5e\u6027\uff1amalloc/free \u662f\u5e93\u51fd\u6570\uff0c\u9700\u8981\u5934\u6587\u4ef6\u7684\u652f\u6301\uff1bnew/delete \u662f\u5173\u952e\u5b57\uff0c\u9700\u8981\u7f16\u8bd1\u5668\u7684\u652f\u6301 \u53c2\u6570\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u65e0\u9700\u6307\u5b9a\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u7c7b\u578b\u81ea\u884c\u8ba1\u7b97\uff1bmalloc \u5728\u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u9700\u8981\u786e\u5b9a\u6240\u7533\u8bf7\u7a7a\u95f4\u7684\u5927\u5c0f \u8fd4\u56de\u503c\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u7c7b\u578b\u662f\u5bf9\u8c61\u7684\u6307\u9488\u7c7b\u578b\uff0c\u65e0\u9700\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\uff0c\u7b26\u5408\u7c7b\u578b\u5b89\u5168\u7684\u64cd\u4f5c\u7b26\uff1bmalloc \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u662f void* \u7c7b\u578b\uff0c\u9700\u8981\u8fdb\u884c\u5f3a\u5236\u7c7b\u578b\u7684\u8f6c\u6362\uff0c\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7c7b\u578b\u7684\u6307\u9488 \u5206\u914d\u5931\u8d25\uff1anew \u5206\u914d\u5931\u8d25\u65f6\uff0c\u4f1a\u629b\u51fa bad_alloc \u5f02\u5e38\uff0cmalloc \u5206\u914d\u5931\u8d25\u65f6\u8fd4\u56de\u7a7a\u6307\u9488 \u91cd\u8f7d\uff1anew/delete \u652f\u6301\u91cd\u8f7d\uff0cmalloc/free \u4e0d\u80fd\u8fdb\u884c\u91cd\u8f7d \u81ea\u5b9a\u4e49\u7c7b\u578b\u5b9e\u73b0\uff1anew \u9996\u5148\u8c03\u7528 operator new \u51fd\u6570\u7533\u8bf7\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 malloc \u5b9e\u73b0\uff09\uff0c\u7136\u540e\u8c03\u7528\u6784\u9020\u51fd\u6570\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u6700\u540e\u8fd4\u56de\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u6307\u9488\uff1bdelete \u9996\u5148\u8c03\u7528\u6790\u6784\u51fd\u6570\uff0c\u7136\u540e\u8c03\u7528 operator delete \u91ca\u653e\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 free \u5b9e\u73b0\uff09\u3002malloc/free \u65e0\u6cd5\u8fdb\u884c\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u5bf9\u8c61\u7684\u6784\u9020\u548c\u6790\u6784 \u5185\u5b58\u533a\u57df\uff1anew \u64cd\u4f5c\u7b26\u4ece\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e3a\u5bf9\u8c61\u52a8\u6001\u5206\u914d\u5185\u5b58\uff0c\u800c malloc \u51fd\u6570\u4ece\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002\uff08\u81ea\u7531\u5b58\u50a8\u533a\u4e0d\u7b49\u4e8e\u5806\uff09 \u7279\u5f81 new/delete malloc/free \u5206\u914d\u5185\u5b58\u7684\u4f4d\u7f6e \u81ea\u7531\u5b58\u50a8\u533a \u5806 \u5206\u914d\u6210\u529f \u8fd4\u56de\u5b8c\u6574\u7c7b\u578b\u6307\u9488 \u8fd4\u56devoid* \u5206\u914d\u5931\u8d25 \u9ed8\u8ba4\u629b\u51fa\u5f02\u5e38 \u8fd4\u56deNULL \u5206\u914d\u5185\u5b58\u7684\u5927\u5c0f \u7531\u7f16\u8bd1\u5668\u6839\u636e\u7c7b\u578b\u8ba1\u7b97\u5f97\u51fa \u5fc5\u987b\u663e\u5f0f\u6307\u5b9a\u5b57\u8282\u6570 \u5904\u7406\u6570\u7ec4 \u6709\u5904\u7406\u6570\u7ec4\u7684new\u7248\u672c\u548cnew[] \u9700\u8981\u7528\u6237\u8ba1\u7b97\u6570\u7ec4\u7684\u5927\u5c0f\u540e\u8fdb\u884c\u5185\u5b58\u5206\u914d \u4ee5\u5206\u914d\u5185\u5b58\u7684\u6269\u5145 \u65e0\u6cd5\u76f4\u89c2\u5904\u7406 \u4f7f\u7528realloc\u7b80\u5355\u5b8c\u6210 \u662f\u5426\u76f8\u4e92\u8c03\u7528 \u53ef\u4ee5\uff0c\u770b\u5177\u4f53\u7684operator new/delete\u5b9e\u73b0 \u4e0d\u53ef\u8c03\u7528new \u5206\u914d\u5185\u5b58\u65f6\u5185\u5b58\u4e0d\u8db3 \u5ba2\u6237\u80fd\u591f\u5236\u5b9a\u5904\u7406\u51fd\u6570\u6216\u91cd\u65b0\u5236\u5b9a\u5206\u914d\u5668 \u65e0\u6cd5\u901a\u8fc7\u7528\u6237\u4ee3\u7801\u8fdb\u884c\u5904\u7406 \u51fd\u6570\u91cd\u8f7d \u5141\u8bb8 \u4e0d\u5141\u8bb8 \u6784\u9020\u51fd\u6570\u4e0e\u6790\u6784\u51fd\u6570 \u8c03\u7528 \u4e0d\u8c03\u7528 \u6784\u9020\u51fd\u6570 \u00b6 \u6784\u9020\u51fd\u6570\u7684\u7279\u5f81 \u00b6 \u540d\u5b57\u548c\u7c7b\u540d\u76f8\u540c \u6ca1\u6709\u8fd4\u56de\u503c \u751f\u6210\u7c7b\u7684\u81ea\u52a8\u6267\u884c\uff0c\u4e0d\u9700\u8981\u8c03\u7528 \u4e3a\u4ec0\u4e48\u6784\u9020\u51fd\u6570\u4e0d\u53ef\u4ee5\u662f\u865a\u51fd\u6570 \u00b6 \u56e0\u4e3a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u5728\u6784\u9020\u51fd\u6570\u671f\u95f4\u521b\u5efa\u7684\uff0c\u6ca1\u6709\u865a\u51fd\u6570\u8868\u5c31\u6ca1\u6709\u529e\u6cd5\u8c03\u7528\u865a\u51fd\u6570 \u6790\u6784\u51fd\u6570 \u00b6 \u6790\u6784\u51fd\u6570\u7684\u4f5c\u7528 \u00b6 \u5982\u679c\u4e00\u4e2a\u7c7b\u4e2d\u6709\u6307\u9488\uff0c\u4e14\u8fd9\u4e2a\u6307\u9488\u6307\u5411\u4e86\u4e00\u6bb5\u7531\u6b64\u7c7b\u7684\u5b9e\u4f8b\u8bf7\u6c42\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u90a3\u4e48\u9700\u8981\u7531\u6790\u6784\u51fd\u6570\u6765\u5b9e\u73b0\u5bf9\u8fd9\u5757\u533a\u57df\u7684\u91ca\u653e\uff0c\u5426\u5219\u4f1a\u9020\u6210\u5185\u5b58\u6cc4\u6f0f C++\u4e3a\u4ec0\u4e48\u4e60\u60ef\u628a\u6790\u6784\u51fd\u6570\u5b9a\u4e49\u4e3a\u865a\u51fd\u6570 \u00b6 \u515a\u8fd9\u4e2a\u7c7b\u9700\u8981\u4f5c\u4e3a\u7236\u7c7b\u6d3e\u751f\u7684\u65f6\u5019\uff0c\u5982\u679c\u7a0b\u5e8f\u5f97\u5230\u7684\u662f\u6b64\u7236\u7c7b\u7684\u6307\u9488\uff0c\u90a3\u4e48\u6b64\u65f6\u5c31\u65e0\u6cd5\u6790\u6784\u5b50\u7c7b\uff0c\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f C++\u4e3a\u4ec0\u4e48\u9ed8\u8ba4\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570 \u00b6 \u865a\u51fd\u6570\u9700\u8981\u989d\u5916\u7684\u865a\u51fd\u6570\u8868\u548c\u865a\u51fd\u6570\u8868\u6307\u9488\uff0c\u5bf9\u4e8e\u4e0d\u4f1a\u6d3e\u751f\u7684\u7c7b\u800c\u8a00\uff0c\u6d6a\u8d39\u7a7a\u95f4 \u91cd\u8f7d\u548c\u91cd\u5199\uff08\u8986\u76d6\uff09 \u00b6 \u5bf9\u4e8e\u7c7b\u4e2d\u51fd\u6570\u7684\u91cd\u8f7d\u6216\u8005\u91cd\u5199\u800c\u8a00\uff0c\u91cd\u8f7d\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u7c7b\u7684\u5185\u90e8\uff0c\u91cd\u5199\u53d1\u751f\u5728\u4e0d\u540c\u7684\u7c7b\u4e4b\u95f4\uff0c\u5b50\u7c7b\u548c\u7236\u7c7b\u4e4b\u95f4 \u91cd\u8f7d\u7684\u51fd\u6570\u9700\u8981\u4e0e\u539f\u51fd\u6570\u6709\u76f8\u540c\u7684\u51fd\u6570\u540d\u3001\u4e0d\u540c\u7684\u53c2\u6570\u5217\u8868\uff0c\u4e0d\u5173\u6ce8\u51fd\u6570\u7684\u8fd4\u56de\u503c\u7c7b\u578b\uff1b\u91cd\u5199\u7684\u51fd\u6570\u7684\u51fd\u6570\u540d\u3001\u53c2\u6570\u5217\u8868\u548c\u8fd4\u56de\u503c\u7c7b\u578b\u90fd\u9700\u8981\u548c\u539f\u51fd\u6570\u76f8\u540c\uff0c\u7236\u7c7b\u4e2d\u88ab\u91cd\u5199\u7684\u51fd\u6570\u9700\u8981\u6709 virtual \u4fee\u9970 virtual \u5173\u952e\u5b57\uff1a\u91cd\u5199\u7684\u51fd\u6570\u57fa\u7c7b\u4e2d\u5fc5\u987b\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\uff0c\u91cd\u8f7d\u7684\u51fd\u6570\u53ef\u4ee5\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\u4e5f\u53ef\u4ee5\u6ca1\u6709 \u9501 \u00b6 C++\u4e2d\u9501\u7684\u7c7b\u578b \u00b6 \u4e92\u65a5\u9501\uff1a\u5bf9\u4e8e\u540c\u4e00\u4e2a\u53d8\u91cf\u53ea\u5141\u8bb8\u4e00\u4e2a\u7ebf\u7a0b\u8fdb\u884c\u8bfb\u5199\uff0c\u82e5\u4e0d\u6ee1\u8db3\u65f6\u5219\u4f1a\u8fdb\u5165\u963b\u585e\uff0c\u5e76\u4e14CPU\u4e0d\u4f1a\u8fdb\u5165\u5fd9\u7b49 \u6761\u4ef6\u9501\uff1a\u5f53\u6ee1\u8db3\u67d0\u4e2a\u6761\u4ef6\u65f6\uff0c\u518d\u5524\u9192\u6b64\u7ebf\u7a0b\uff0c\u5426\u5219\u4e00\u76f4\u963b\u585e\u72b6\u6001 \u81ea\u65cb\u9501\uff1a\u4e0d\u65ad\u7684\u68c0\u67e5\u9501\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\uff0c\u4e0d\u91ca\u653eCPU\uff0c\u6bd4\u8f83\u8017\u8d39CPU \u8bfb\u5199\u9501\uff1a\u5141\u8bb8\u6709\u8bfb\u9501\u7684\u65f6\u5019\u518d\u52a0\u8bfb\u9501\uff0c\u4f46\u662f\u6709\u5199\u9501\u65f6\u4e0d\u518d\u80fd\u52a0\u4efb\u4f55\u9501 \u9012\u5f52\u9501\uff1a\u5141\u8bb8\u540c\u4e00\u4e2a\u7ebf\u7a0b\u5bf9\u540c\u4e00\u4e2a\u9501\u8fdb\u884c\u591a\u6b21\u52a0\u9501 \u865a\u51fd\u6570 \u00b6 \u865a\u51fd\u6570 \u00b6 \u865a\u51fd\u6570\u7531 virtual \u6807\u8bb0 \u666e\u901a\u7684\u865a\u51fd\u6570\u4ecd\u7136\u9700\u8981\u8fdb\u884c\u5b9e\u73b0\uff0c\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u53ef\u4ee5\u91cd\u65b0\u5b9e\u73b0\u6b64\u51fd\u6570\u4e5f\u53ef\u4ee5\u4e0d\u5b9e\u73b0 \u7eaf\u865a\u51fd\u6570 \u00b6 \u7eaf\u865a\u51fd\u6570\u5728\u666e\u901a\u7684\u865a\u51fd\u6570\u540e\uff0c\u52a0\u4e0a =0 \u5f53\u4e00\u4e2a\u7c7b\u62e5\u6709\u7eaf\u865a\u51fd\u6570\u540e\uff0c\u5219\u6b64\u7c7b\u53d8\u6210\u62bd\u8c61\u7c7b\uff0c \u4e0d\u53ef\u4ee5\u8fdb\u884c\u5b9e\u4f8b\u5316 \u7eaf\u865a\u51fd\u6570\u4e0d\u9700\u8981\u5b9e\u73b0\uff0c\u4e14\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u51fd\u6570\uff0c\u5426\u5219\u6d3e\u751f\u7c7b\u4e5f\u662f\u62bd\u8c61\u7c7b\uff0c\u4e0d\u53ef\u4ee5\u5b9e\u4f8b\u5316 \u865a\u51fd\u6570\u7684\u5b9e\u73b0\u539f\u7406 \u00b6 \u5728\u7c7b\u4e2d\u4fdd\u5b58\u4e00\u5f20\u865a\u51fd\u6570\u8868\uff0c\u8868\u5185\u4fdd\u5b58\u4e86\u51fd\u6570\u6240\u5728\u7684\u4ee3\u7801\u6bb5 \u5f53\u5176\u4ed6\u7c7b\u7ee7\u627f\u6b64\u7c7b\u65f6\uff0c\u590d\u5236\u4e00\u4efd\u6b64\u865a\u51fd\u6570\u8868\u3002\u5f53\u5176\u4e2d\u7684\u865a\u51fd\u6570\u8fdb\u884c\u5b9e\u73b0\u540e\uff0c\u5c06\u865a\u51fd\u6570\u8868\u4e2d\u6b64\u51fd\u6570\u7684\u6307\u9488\u6240\u6307\u5411\u65b0\u7684\u51fd\u6570\u7684\u5730\u5740 \u5b9a\u4e49\u7c7b\u7684\u5b9e\u4f8b\u7684\u65f6\u5019\uff0c\u5728\u7c7b\u7684\u5f00\u5934\u4fdd\u5b58\u4e86\u4e00\u4e2a\u6307\u5411\u6b64\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\uff0c\u5f53\u9700\u8981\u8c03\u7528\u6b64\u51fd\u6570\u7684\u65f6\u5019\uff0c\u901a\u8fc7\u6b64\u6307\u9488\u627e\u5230\u5bf9\u5e94\u7684\u51fd\u6570\u5730\u5740 \u9759\u6001\u51fd\u6570\u548c\u865a\u51fd\u6570\u7684\u533a\u522b \u00b6 \u9759\u6001\u51fd\u6570\u5728\u7f16\u8bd1\u65f6\u5c31\u786e\u5b9a\u4e86\u8fd0\u884c\u7684\u65f6\u673a\uff0c\u800c\u865a\u51fd\u6570\u5219\u662f\u5728\u8fd0\u884c\u7684\u8fc7\u7a0b\u4e2d\u52a8\u6001\u7684\u5f97\u77e5\u865a\u51fd\u6570\u5730\u5740 strcpy\u548cmemcpy\u7684\u533a\u522b \u00b6 \u590d\u5236\u7684\u5185\u5bb9\u4e0d\u540c\u3002strcpy\u53ea\u80fd\u590d\u5236\u5b57\u7b26\u4e32\uff0c\u800cmemcpy\u53ef\u4ee5\u590d\u5236\u4efb\u610f\u5185\u5bb9\uff0c\u4f8b\u5982\u5b57\u7b26\u6570\u7ec4\u3001\u6574\u578b\u3001\u7ed3\u6784\u4f53\u3001\u7c7b\u7b49\u3002\u4f01\u4e1a\u4e2d\u4f7f\u7528memcpy\u5f88\u5e73\u5e38\uff0c\u56e0\u4e3a\u9700\u8981\u62f7\u8d1d\u5927\u91cf\u7684\u7ed3\u6784\u4f53\u53c2\u6570\u3002memcpy\u901a\u5e38\u4e0ememset\u51fd\u6570\u914d\u5408\u4f7f\u7528\u3002 \u590d\u5236\u7684\u65b9\u6cd5\u4e0d\u540c\u3002strcpy\u4e0d\u9700\u8981\u6307\u5b9a\u957f\u5ea6\uff0c\u4ed6\u9047\u5230\u88ab\u590d\u5236\u5b57\u7b26\u7684\u4e32\u7ed3\u675f\u7b26\"\\0\"\u624d\u7ed3\u675f\uff0c\u6240\u4ee5\u5bb9\u6613\u6ea2\u51fa\u3002memcpy\u5219\u662f\u6839\u636e\u5176\u7b2c\u4e09\u4e2a\u53c2\u6570\u51b3\u5b9a\u590d\u5236\u7684\u957f\u5ea6\u3002\u56e0\u6b64strcpy\u4f1a\u590d\u5236\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u7b26\"\\0\"\uff0c\u800cmemcpy\u5219\u4e0d\u4f1a\u590d\u5236\u3002 \u961f\u5217\u548c\u5806\u6808\u7684\u6a21\u62df \u00b6 \u7528\u4e24\u4e2a\u5806\u6808\u6a21\u62df\u961f\u5217 \u00b6 \u5c06\u4e24\u4e2a\u5806\u6808\u547d\u540d\u4e3aA\u3001B \u82e5B\u5806\u6808\u4e3a\u7a7a\uff0c\u5219\u5c06A\u5806\u6808\u7684\u6240\u6709\u503c\u90fd\u63a8\u5165B\u4e2d \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u63a8\u51fa\uff0c\u5219\u4eceB\u4e2d\u63a8\u51fa \u7528\u4e24\u4e2a\u961f\u5217\u6a21\u62df\u5806\u6808 \u00b6 \u5c06\u4e24\u4e2a\u961f\u5217\u547d\u540d\u4e3aA\u3001B \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u5f39\u51fa\uff0c\u5219\u5c06A\u4e2d\u7684\u503c\u9664\u4e86\u6700\u540e\u4e00\u4e2a\uff0c\u5176\u4ed6\u90fd\u63a8\u5165\u5230B\u4e2d\uff0c\u4e14\u4ec5\u7559\u4e0b\u4e00\u4e2a\u503c\uff0c\u7136\u540e\u5f39\u51fa\u8fd9\u4e2a\u503c\uff0c\u5e76\u5c06A\u3001B\u961f\u5217\u547d\u540d\u4e3aA\u3001B\u961f\u5217 \u53f3\u503c\u5f15\u7528 \u00b6 \u5982\u4f55\u786e\u5b9a\u4e00\u4e2a\u503c\u662f\u5de6\u503c\u8fd8\u662f\u53f3\u503c \u63d0\u4f9b\u4e86\u5730\u5740\u7684\u4e3a\u5de6\u503c\uff0c\u5de6\u503c\u53ef\u4ee5\u6ca1\u6709\u503c\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u5730\u5740 \u63d0\u4f9b\u4e86\u503c\u7684\u4e3a\u53f3\u503c\uff0c\u53f3\u503c\u53ef\u4ee5\u6ca1\u6709\u5730\u5740\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u503c \u53f3\u503c\u5f15\u7528\u7684\u529f\u80fd \u79fb\u52a8\u8bed\u53e5 \u5b8c\u7f8e\u8f6c\u53d1 STL \u00b6 vector \u00b6 \u6269\u5bb9\u89c4\u5219 \u00b6 \u5f53\u7a7a\u95f4\u4e0d\u8db3\u7684\u65f6\u5019\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09 \u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9 \u00b6 \u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002 MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904 \u00b6 \u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4 clear\u7684\u590d\u6742\u5ea6 \u00b6 \u590d\u6742\u5ea6\u4e0e\u5df2\u6709\u7684\u5143\u7d20\u6570\u91cf\u6210\u7ebf\u6027\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u5143\u7d20\u90fd\u9700\u8981\u6790\u6784 clear\u540e\uff0c\u5e76\u4e0d\u4f1a\u6539\u53d8vector\u7684\u5bb9\u91cf\u4e0a\u9650\uff0c\u53ea\u4f1a\u66f4\u65b0vector\u5185\u7684size\u5927\u5c0f unordered_map\u548cmap \u00b6 map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u7ea2\u9ed1\u6811 \uff08\u6240\u6709\u5143\u7d20\u90fd\u662f\u6709\u5e8f\u7684\uff09\uff0cunordered_map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u54c8\u5e0c\u8868 \uff08\u5143\u7d20\u7684\u6392\u5217\u662f\u65e0\u5e8f\u7684\uff09 map \u00b6 \u4f18\u70b9\uff1a \u6709\u5e8f \u6027\uff0c\u8fd9\u662fmap\u7ed3\u6784\u6700\u5927\u7684\u4f18\u70b9\uff0c\u5176\u5143\u7d20\u7684\u6709\u5e8f\u6027\u5728\u5f88\u591a\u5e94\u7528\u4e2d\u90fd\u4f1a\u7b80\u5316\u5f88\u591a\u7684\u64cd\u4f5c\uff1b\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7ea2\u9ed1\u6811\u4f7f\u5f97map\u7684\u5f88\u591a\u64cd\u4f5c\u5728 \\(logn\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e0b\u5c31\u53ef\u4ee5\u5b9e\u73b0\uff0c\u56e0\u6b64 \u6548\u7387 \u975e\u5e38\u9ad8 \u7f3a\u70b9\uff1a \u7a7a\u95f4\u5360\u7528\u7387\u9ad8 \uff0c\u56e0\u4e3amap\u5185\u90e8\u5b9e\u73b0\u4e86\u7ea2\u9ed1\u6811\uff0c\u867d\u7136\u63d0\u9ad8\u4e86\u8fd0\u884c\u6548\u7387\uff0c\u4f46\u662f\u56e0\u4e3a \u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u9700\u8981\u989d\u5916\u4fdd\u5b58\u7236\u8282\u70b9\u3001\u5b69\u5b50\u8282\u70b9\u548c\u7ea2/\u9ed1\u6027\u8d28 \uff0c\u4f7f\u5f97\u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u5360\u7528\u5927\u91cf\u7684\u7a7a\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e\u90a3\u4e9b\u6709\u987a\u5e8f\u8981\u6c42\u7684\u95ee\u9898\uff0c\u7528map\u4f1a\u66f4\u9ad8\u6548\u4e00\u4e9b unordered_map \u00b6 \u4f18\u70b9\uff1a\u56e0\u4e3a\u5185\u90e8\u5b9e\u73b0\u4e86\u54c8\u5e0c\u8868\uff0c\u56e0\u6b64\u5176 \u67e5\u627e\u901f\u5ea6 \u975e\u5e38\u5feb \u7f3a\u70b9\uff1a\u54c8\u5e0c\u8868\u7684 \u5efa\u7acb\u6bd4\u8f83\u8017\u8d39\u65f6\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e \u67e5\u627e\u95ee\u9898 \uff0cunordered_map\u4f1a\u66f4\u52a0\u9ad8\u6548\u4e00\u4e9b \u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4f18\u70b9\uff1f \u00b6 \u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001\u662f\u9762\u5411\u5bf9\u8c61\u7684\u4e09\u5927\u7279\u6027, \u8fd9\u4e9b\u7279\u6027\u4f7f\u5f97\u9762\u5411\u5bf9\u8c61\u53ef\u4ee5\u8bbe\u8ba1\u51fa\u4f4e\u8026\u5408\u7684\u7cfb\u7edf, \u4ece\u800c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027, \u4f7f\u7cfb\u7edf\u66f4\u6613\u7ef4\u62a4, \u529f\u80fd\u66f4\u6613\u590d\u7528\u3001\u62d3\u5c55, \u4f46\u662f\u5176\u6027\u80fd\u6bd4\u9762\u5411\u8fc7\u7a0b\u8981\u4f4e\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff0c\u5373OOP\uff0c\u662f\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u6ee1\u8db3\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u8bed\u8a00\uff0c\u4e00\u822c\u4f1a\u63d0\u4f9b\u7c7b\u3001\u5c01\u88c5\u3001\u7ee7\u627f\u7b49\u8bed\u6cd5\u548c\u6982\u5ff5\u6765\u8f85\u52a9\u6211\u4eec\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002 \u7c7b\u578b\u88ab\u8bbe\u8ba1\u4e3a\u5c06\u6570\u636e\u548c\u884c\u4e3a\u6346\u7ed1\u5728\u4e00\u8d77\u7684\u4e00\u79cd\u4e1c\u897f\uff0c\u6570\u636e\u548c\u884c\u4e3a\u88ab\u79f0\u4e4b\u4e3a\u7c7b\u578b\u7684\u6210\u5458\u3002\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u7c7b\u578b\u7684\u5b9e\u4f8b\uff0c\u4e0d\u540c\u7684\u5b9e\u4f8b\u5305\u542b\u4e0d\u540c\u7684\u6570\u636e\uff0c\u4ece\u800c\u5176\u8868\u73b0\u51fa\u6765\u7684\u884c\u4e3a\u4e5f\u4f1a\u4e0d\u540c\uff0c\u5c3d\u7ba1\u5176\u4ee3\u7801\u662f\u4e00\u6837\u7684\u3002 \u5c01\u88c5\u4f7f\u5f97\u7c7b\u7684\u6210\u5458\u5f97\u4ee5\u6709\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u4e00\u4e9b\u6210\u5458\u53ea\u5728\u7c7b\u578b\u7684\u5185\u90e8\u4f7f\u7528\uff0c\u88ab\u79f0\u4e4b\u4e3a\u79c1\u6709\u7684\uff08private\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u6d3e\u751f\u7c7b\u578b\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u53d7\u4fdd\u62a4\u7684\uff08protected\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u4efb\u4f55\u4e1c\u897f\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u516c\u5f00\u7684\uff08public\uff09\u3002\u800c\u67d0\u4e9b\u8bed\u8a00\u8fd8\u63d0\u4f9b\u4e86\u5185\u90e8\u7684\uff08internal\uff09\u8fd9\u6837\u7684\u8bbf\u95ee\u4fee\u9970\u7b26\u6765\u6807\u8bc6\u4e00\u4e9b\u53ea\u80fd\u88ab\u540c\u4e00\u4e2a\u7a0b\u5e8f\u96c6\u6216\u8005\u5305\u4f7f\u7528\u7684\u6210\u5458\u3002 \u7ee7\u627f\u53ef\u4ee5\u4ece\u4e00\u4e2a\u73b0\u6709\u7c7b\u578b\u6d3e\u751f\u51fa\u65b0\u7684\u7c7b\u578b\u6765\uff0c\u6d3e\u751f\u7c7b\u7ee7\u627f\u4e86\u57fa\u7c7b\u7684\u6240\u6709\u6210\u5458\uff0c\u4e5f\u53ef\u4ee5\u65b0\u589e\u53ea\u5c5e\u4e8e\u81ea\u5df1\u7684\u6210\u5458\u3002\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\uff0c\u6d3e\u751f\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u53ef\u4ee5\u88ab\u5f53\u505a\u57fa\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u6765\u4f7f\u7528\u3002 \u865a\u65b9\u6cd5\u4e3a\u6d3e\u751f\u7c7b\u4fee\u6539\u57fa\u7c7b\u7684\u884c\u4e3a\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9014\u5f84\uff0c\u901a\u8fc7\u91cd\u5199\uff08override\uff09\u865a\u65b9\u6cd5\u53ef\u4ee5\u4fee\u6539\u57fa\u7c7b\u67d0\u4e9b\u65b9\u6cd5\u7684\u884c\u4e3a\u3002\u5f53\u6d3e\u751f\u7c7b\u5b9e\u4f8b\u88ab\u5f53\u505a\u57fa\u7c7b\u5b9e\u4f8b\u6765\u4f7f\u7528\u65f6\uff0c\u8fd9\u4e00\u884c\u4e3a\u7684\u533a\u522b\u5c06\u4f1a\u88ab\u4f53\u73b0\u51fa\u6765\uff0c\u8fd9\u79cd\u5728\u8fd0\u884c\u65f6\u4e0d\u540c\u7c7b\u578b\u7684\u5b9e\u4f8b\u5728\u540c\u6837\u7684\u4ee3\u7801\u4e2d\u5448\u73b0\u51fa\u5b8c\u5168\u4e0d\u540c\u884c\u4e3a\u7684\u73b0\u8c61\u88ab\u79f0\u4e4b\u4e3a\u591a\u6001\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u6700\u521d\u662f\u4e3a\u4e86\u89e3\u51b3GUI\u7a0b\u5e8f\u8bbe\u8ba1\u95ee\u9898\u6240\u63d0\u51fa\u7684\uff0c\u540e\u6765\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u88ab\u53d1\u73b0\u4e5f\u6bd4\u8f83\u9002\u5408\u7528\u4e8e\u8bb8\u591a\u7279\u5b9a\u9886\u57df\u7684\u5f00\u53d1\u3002\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u662f\u76ee\u524d\u8fd0\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u4ece\u800c\u4e5f\u4ea7\u751f\u4e86\u975e\u5e38\u591a\u7684\u89e3\u51b3\u4ee3\u7801\u590d\u7528\u7684\u6280\u5de7\uff0c\u5176\u4e2d\u76f8\u5f53\u4e00\u90e8\u5206\u6280\u5de7\u5728\u7a0b\u5e8f\u4e2d\u53cd\u590d\u51fa\u73b0\u800c\u88ab\u63d0\u70bc\u4e3a\u8bbe\u8ba1\u6a21\u5f0f\u3002 static\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f \u00b6 \u9690\u85cf\u3002\u5f53\u6211\u4eec\u540c\u65f6\u7f16\u8bd1\u591a\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u6240\u6709\u672a\u52a0static\u7684\u5168\u5c40\u53d8\u91cf\u548c\u51fd\u6570\u90fd\u5177\u6709\u5168\u5c40\u53ef\u89c1\u6027\u3002\u6240\u4ee5\u4f7f\u7528static\u5728\u4e0d\u540c\u7684\u6587\u4ef6\u4e2d\u5b9a\u4e49\u540c\u540d\u53d8\u91cf\u548c\u51fd\u6570\uff0c\u4e0d\u9700\u8981\u62c5\u5fc3\u547d\u540d\u51b2\u7a81\u3002 \u4fdd\u6301\u53d8\u91cf\u5185\u5bb9\u7684\u6301\u4e45\u3002\u5b58\u50a8\u5728\u9759\u6001\u6570\u636e\u533a\u7684\u53d8\u91cf\u4f1a\u5728\u7a0b\u5e8f\u521a\u5f00\u59cb\u8fd0\u884c\u65f6\u5c31\u5b8c\u6210\u521d\u59cb\u5316\uff0c\u4e5f\u662f\u552f\u4e00\u7684\u4e00\u6b21\u521d\u59cb\u5316\uff0c\u5171\u6709\u4e24\u79cd\u53d8\u91cf\u5b58\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5168\u5c40\u53d8\u91cf\u548cstatic\u3002 \u9ed8\u8ba4\u521d\u59cb\u5316\u4e3a0\u3002\u5168\u5c40\u53d8\u91cf\u4e5f\u5177\u6709\u8fd9\u4e2a\u5c5e\u6027\uff0c\u56e0\u4e3a\u5168\u5c40\u53d8\u91cf\u4e5f\u5b58\u50a8\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5728\u9759\u6001\u5b58\u50a8\u533a\u5185\uff0c\u6240\u6709\u5b57\u8282\u7684\u9ed8\u8ba4\u503c\u65f60x00\uff0c\u8fd9\u4e00\u7279\u70b9\u53ef\u4ee5\u51cf\u5c11\u5de5\u4f5c\u91cf\u3002 const\u6709\u4ec0\u4e48\u7528\uff1f \u00b6 \u4e0d\u8981\u4e00\u542c\u5230const\u5c31\u8bf4\u662f\u5e38\u91cf\uff0c\u5e94\u8be5\u8bf4const\u4fee\u9970\u7684\u5185\u5bb9\u4e0d\u53ef\u6539\u53d8\u3002\u5b9a\u4e49\u5e38\u91cf\u53ea\u662f\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u8fd8\u6709const\u6570\u636e\u6210\u5458\uff0c\u53c2\u6570\uff0c\u8fd4\u56de\u503c\uff0c\u6210\u5458\u51fd\u6570\u7b49\uff0c\u88abconst\u4fee\u9970\u7684\u4e1c\u897f\u90fd\u53d7\u5230\u4e86\u5f3a\u5236\u4fdd\u62a4\uff0c\u53ef\u4ee5\u9884\u9632\u610f\u5916\u53d8\u52a8\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u5065\u58ee\u6027\u3002 C\u548cC++\u5404\u81ea\u662f\u5982\u4f55\u5b9a\u4e49\u5e38\u91cf\u7684\uff1f\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f \u00b6 C\u662f\u4f7f\u7528\u5b8f#define\u5b9a\u4e49\uff0cC++\u4f7f\u7528\u66f4\u597d\u7684const\u5b9a\u4e49\u3002 const\u662f\u6709\u6570\u636e\u7c7b\u578b\u7684\uff0c\u800cdefine\u6ca1\u6709\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9\u524d\u8005\u8fdb\u884c\u9759\u6001\u7c7b\u578b\u5b89\u5168\u68c0\u67e5\uff0c\u5bf9\u540e\u8005\u4ec5\u4ec5\u662f\u5b57\u7b26\u66ff\u6362\uff0c\u6ca1\u6709\u68c0\u67e5\uff0c\u4f1a\u4ea7\u751f\u9519\u8bef\uff08\u8fb9\u9645\u6548\u5e94\uff09\u3002 \u6709\u4e9b\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9const\u8fdb\u884c\u8c03\u8bd5\uff0c\u800cdefine\u4e0d\u884c\u3002 \u65e2\u7136C++\u6709\u66f4\u597d\u7684const\u4e3a\u5565\u8fd8\u8981define\uff1f \u00b6 const\u65e0\u6cd5\u66ff\u4ee3\u5b8f\u4f5c\u4e3a\u536b\u54e8\u6765\u9632\u6b62\u6587\u4ef6\u7684\u91cd\u590d\u5305\u542b\u3002 #include \u548c# include\"a.h\"\u6709\u4ec0\u4e48\u533a\u522b\uff1f \u00b6 \u524d\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u6807\u51c6\u5e93\u8def\u5f84\u5f00\u59cb\u641c\u7d22\uff0c\u540e\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u7528\u6237\u7684\u5de5\u4f5c\u8def\u5f84\u5f00\u59cb\u641c\u7d22\u3002 C++\u4ec0\u4e48\u662f\u591a\u6001\u6027\uff1f\u5982\u4f55\u4f53\u73b0\u7684\uff1f \u00b6 \u591a\u6001\u6027\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7ee7\u5c01\u88c5\u548c\u7ee7\u627f\u4e4b\u540e\u7684\u7b2c\u4e09\u4e2a\u57fa\u672c\u7279\u5f81\u3002 \u4ed6\u5728\u8fd0\u884c\u65f6\u51fa\u73b0\u7684\u591a\u6001\u6027\u901a\u8fc7\u6d3e\u751f\u7c7b\u548c\u865a\u51fd\u6570\u5b9e\u73b0\uff0c\u57fa\u7c7b\u548c\u6d3e\u751f\u7c7b\u4e2d\u4f7f\u7528\u540c\u6837\u7684\u51fd\u6570\u540d\uff0c\u5b8c\u6210\u4e0d\u540c\u7684\u64cd\u4f5c\u5177\u4f53\u5b9e\u73b0\u3002 \u591a\u6001\u6027\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u7ec4\u7ec7\u6027\u548c\u53ef\u8bfb\u6027\uff0c\u865a\u51fd\u6570\u5219\u6839\u636e\u7c7b\u578b\u7684\u4e0d\u540c\u6765\u8fdb\u884c\u4e0d\u540c\u7684\u9694\u79bb\u3002 \u4ec0\u4e48\u662f\u52a8\u6001\u7279\u6027\uff1f \u00b6 \u5728\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u786e\u5b9a\u4e0b\u6765\uff0c\u6211\u4eec\u79f0\u4e4b\u4e3a\u9759\u6001\u7279\u6027\u3002\u53cd\u4e4b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u8fd0\u884c\u7684\u65f6\u5019\u786e\u5b9a\uff0c\u79f0\u4e4b\u4e3a\u52a8\u6001\u7279\u6027\u3002C++\u4e2d\uff0c\u865a\u51fd\u6570\uff0c\u62bd\u8c61\u57fa\u7c7b\uff0c\u52a8\u6001\u7ed1\u5b9a\u548c\u591a\u6001\u6784\u6210\u4e86\u51fa\u8272\u7684\u52a8\u6001\u7279\u6027\u3002 \u4ec0\u4e48\u662f\u5c01\u88c5\uff1fC++\u4e2d\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f \u00b6 \u5c01\u88c5\u6765\u6e90\u4e8e\u4fe1\u606f\u9690\u85cf\u7684\u8bbe\u8ba1\u7406\u5ff5\uff0c\u662f\u901a\u8fc7\u7279\u6027\u548c\u884c\u4e3a\u7684\u7ec4\u5408\u6765\u521b\u5efa\u65b0\u6570\u636e\u7c7b\u578b\u8ba9\u63a5\u53e3\u548c\u67d0\u4e2a\u5b9e\u73b0\u76f8\u9694\u79bb\u3002 C++\u662f\u901a\u8fc7\u7c7b\u6765\u5b9e\u73b0\u7684\uff0c\u5c01\u88c5\u4e3a\u4e86\u4f7f\u7c7b\u4e2d\u6210\u5458\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u6709\u4e09\u4e2a\u5173\u952e\u5b57(balabalabala) \u4ec0\u4e48\u662fRTTI\uff1f \u00b6 RTT\u662f\u6307\u8fd0\u884c\u65f6\u7c7b\u578b\u8bc6\u522b\uff08Run-time type identification\uff09\u5728\u53ea\u6709\u4e00\u4e2a\u6307\u5411\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u65f6\u786e\u5b9a\u4e00\u4e2a\u5bf9\u8c61\u7684\u51c6\u786e\u7c7b\u578b\u3002 \u4ec0\u4e48\u662f\u6df1\u6d45\u62f7\u8d1d\uff1f \u00b6 \u6df1\u6d45\u62f7\u8d1d\u5173\u952e\u5728\u4e8e\u6709\u6ca1\u6709\u62f7\u8d1d\u5206\u914d\u7ed9\u6210\u5458\u7684\u8d44\u6e90\uff0c\u4f8b\u5982\u7ed9\u6307\u9488\u53d8\u91cf\u5206\u914d\u5185\u5b58\u3002\u6d45\u62f7\u8d1d\u53ea\u662f\u7ed9\u6210\u5458\u7b80\u5355\u8d4b\u503c\uff0c\u800c\u6df1\u62f7\u8d1d\u4e0d\u4ec5\u8d4b\u503c\uff0c\u8fd8\u5206\u914d\u8d44\u6e90\u3002 \u7c7b\u4e2d\u9ed8\u8ba4\u7684\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u548c\u8d4b\u503c\u6784\u9020\u51fd\u6570\u90fd\u662f\u6d45\u62f7\u8d1d\uff0c\u5f53\u7c7b\u7684\u6210\u5458\u53d8\u91cf\u4e2d\u51fa\u73b0\u6307\u9488\u53d8\u91cf\u65f6\uff0c\u6700\u597d\u4f7f\u7528\u6df1\u62f7\u8d1d\uff0c\u907f\u514d\u5185\u5b58\u7a7a\u95f4\u591a\u6b21\u91ca\u653e\u7684\u95ee\u9898\u51fa\u73b0\u3002 \u865a\u51fd\u6570\u8868\u6307\u9488\u4e3a\u4ec0\u4e48\u653e\u5728\u5f00\u5934\uff1f \u00b6 \u4f4d\u7f6e\uff1a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u865a\u51fd\u6570\u8868\u6240\u5728\u4f4d\u7f6e\u7684\u5730\u5740\u3002\u865a\u51fd\u6570\u8868\u6307\u9488\u5c5e\u4e8e\u5bf9\u8c61\u5b9e\u4f8b\u3002\u56e0\u800c\u901a\u8fc7new \u51fa\u6765\u7684\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u5806\uff0c\u58f0\u540d\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u6808\u3002 \u865a\u51fd\u6570\u8868\u7684\u5b58\u5728\u662f\u7f16\u8bd1\u5668\u4f9d\u8d56\u7684(\u4f46\u6240\u6709\u7f16\u8bd1\u5668\u90fd\u662f\u5982\u6b64)\uff0cvptr\u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u5f00\u5934.\u539f\u56e0\u662f\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u4f4d\u7f6e.\u8003\u8651\u4e00\u4e2a\u7c7b\u5c42\u6b21\u7ed3\u6784: struct base { T data ; virtual void f (); }; struct derived : base { T1 data ; virtual void g (); }; \u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u90a3\u4e48\u5bf9\u4e8e\u5b8c\u6574\u7c7b\u578b base \u7684\u5bf9\u8c61\uff0c\u5b83\u5c06\u4f4d\u4e8e sizeof(T) \u5b57\u8282\u4e4b\u540e.\u73b0\u5728\uff0c\u5f53\u4f60\u6709\u4e00\u4e2a\u5b8c\u6574\u7c7b\u578b\u7684\u5bf9\u8c61 derived \u65f6\uff0cbase \u5b50\u5bf9\u8c61\u7684\u5e03\u5c40\u5fc5\u987b\u4e0e\u5b8c\u6574 base \u5bf9\u8c61\u7684\u5e03\u5c40\u517c\u5bb9\uff0c\u56e0\u6b64 vptr \u4ecd\u7136\u5fc5\u987b\u662f sizeof(T) \u5b57\u8282\u5728\u5bf9\u8c61\u5185\u90e8\uff0c\u5b83\u5c06\u4f4d\u4e8e derived \u5bf9\u8c61\u4e2d\u95f4\u7684\u67d0\u4e2a\u4f4d\u7f6e(sizeof(T) \u4ece\u5f00\u59cb\uff0csizeof(T1) \u5728\u7ed3\u675f\u4e4b\u524d).\u6240\u4ee5\u5b83\u5c06\u4e0d\u518d\u4f4d\u4e8e\u5bf9\u8c61\u7684 end \u5904. \u6b64\u5916\uff0c\u7ed9\u5b9a\u4e00\u4e2a this \u6307\u9488\uff0c\u865a\u62df\u8c03\u7528\u9700\u8981\u901a\u8fc7 vtable \u8fdb\u884c\u95f4\u63a5\u8c03\u7528\uff0c\u8fd9\u57fa\u672c\u4e0a\u662f\u53d6\u6d88\u5bf9 vptr \u7684\u5f15\u7528\uff0c\u6dfb\u52a0\u4e00\u4e2a\u504f\u79fb\u91cf\u5e76\u8df3\u8f6c\u5230\u5b58\u50a8\u5728\u90a3\u91cc\u7684\u5185\u5b58\u4f4d\u7f6e.\u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u5219\u5bf9\u4e8e\u6bcf\u4e2a\u865a\u62df\u8c03\u7528\uff0c\u5728\u53d6\u6d88\u5f15\u7528 vptr \u4e4b\u524d\u90fd\u4f1a\u5bf9 this \u8fdb\u884c\u989d\u5916\u7684\u6dfb\u52a0. STL\u6e90\u7801\u4e2dhash\u7684\u8868\u73b0 \u00b6 hashtable \u662f\u91c7\u7528\u5f00\u94fe\u6cd5\u6765\u5b8c\u6210\u7684\uff0c\uff08vector + list\uff09 \u5e95\u5c42\u952e\u503c\u5e8f\u5217\u91c7\u7528 vector \u5b9e\u73b0\uff0cvector \u7684\u5927\u5c0f\u53d6\u7684\u662f\u8d28\u6570\uff0c\u4e14\u76f8\u90bb\u8d28\u6570\u7684\u5927\u5c0f\u7ea6\u4e3a 2 \u500d\u5173\u7cfb\uff0c\u5f53\u521b\u5efa hashtable \u65f6\uff0c\u4f1a\u81ea\u52a8\u9009\u53d6\u4e00\u4e2a\u63a5\u8fd1\u6240\u521b\u5efa\u5927\u5c0f\u7684\u8d28\u6570\u4f5c\u4e3a\u5f53\u524d hashtable \u7684\u5927\u5c0f\uff1b \u5bf9\u5e94\u952e\u7684\u503c\u5e8f\u5217\u91c7\u7528\u5355\u5411 list \u5b9e\u73b0\uff1b \u5f53 hashtable \u7684\u952e vector \u7684\u5927\u5c0f\u91cd\u65b0\u5206\u914d\u7684\u65f6\u5019\uff0c\u539f\u952e\u7684\u503c list \u4e5f\u4f1a\u91cd\u65b0\u5206\u914d\uff0c\u56e0\u4e3a vector \u91cd\u5efa\u4e86\u76f8\u5f53\u4e8e\u952e\u589e\u52a0\u4e86\uff0c\u90a3\u4e48\u539f\u6765\u7684\u503c\u5bf9\u5e94\u7684\u952e\u53ef\u80fd\u5c31\u4e0d\u540c\u4e8e\u539f\u6765\u5206\u914d\u7684\u952e\uff0c\u8fd9\u6837\u5c31\u9700\u8981\u91cd\u65b0\u786e\u5b9a\u503c\u7684\u952e\u3002 \u91cd\u8f7d\u5982\u4f55\u5b9e\u73b0 \u00b6 C++\u51fd\u6570\u91cd\u8f7d\u5e95\u5c42\u5b9e\u73b0\u539f\u7406\u662fC++\u5229\u7528\u503e\u8f67\u6280\u672f\uff0c\u6765\u6539\u540d\u51fd\u6570\u540d\uff0c\u533a\u5206\u53c2\u6570\u4e0d\u540c\u7684\u540c\u540d\u51fd\u6570\u3002 C++\u4e2d\uff0c\u8fd9\u4e09\u4e2a\u51fd\u6570\u5982\u679c\u5728\u4e3b\u51fd\u6570\u4e2d\u88ab\u8c03\u7528\u9009\u62e9\u54ea\u4e00\u4e2a\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u8eab\u51b3\u5b9a\u3002 \u6e90\u6587\u4ef6\u901a\u8fc7\u7f16\u8bd1\u540e\uff0c\u5c06\u76f8\u540c\u51fd\u6570\u540d\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u683c\u5f0f\uff0c\u6539\u53d8\u6210\u53ef\u4ee5\u533a\u5206\u7684\uff0c\u53bb\u9664\u4e86\u51fd\u6570\u5728\u8c03\u7528\u65f6\u7684\u4e8c\u4e49\u6027\uff0c\u4ece\u800c\u5b9e\u73b0\u51fd\u6570\u7684\u91cd\u8f7d\u3002 \u7ed3\u5408extern \"C\". \u52a8\u6001\u7ed1\u5b9a\u548c\u9759\u6001\u7ed1\u5b9a\u533a\u522b \u00b6 C++\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\uff0c\u5b58\u5728\u7740\u9759\u6001\u7ed1\u5b9a\u548c\u52a8\u6001\u7ed1\u5b9a\u7684\u5b9a\u4e49\uff0c\u672c\u8282\u5373\u662f\u4e3b\u8981\u8bb2\u8ff0\u8fd9\u4e24\u70b9\u533a\u5206\u3002 \u6211\u662f\u5728\u4e00\u4e2a\u7c7b\u7684\u7ee7\u627f\u4f53\u7cfb\u4e2d\u5206\u6790\u7684\uff0c\u56e0\u6b64\u4e0b\u9762\u6240\u8bf4\u7684\u5bf9\u8c61\u4e00\u822c\u5c31\u662f\u6307\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b\u3002 \u9996\u5148\u6211\u4eec\u9700\u8981\u660e\u786e\u51e0\u4e2a\u540d\u8bcd\u5b9a\u4e49\uff1a \u9759\u6001\u7c7b\u578b\uff1a\u5bf9\u8c61\u5728\u58f0\u660e\u65f6\u91c7\u7528\u7684\u7c7b\u578b\uff0c\u5728\u7f16\u8bd1\u671f\u65e2\u5df2\u786e\u5b9a\uff1b \u52a8\u6001\u7c7b\u578b\uff1a\u901a\u5e38\u662f\u6307\u4e00\u4e2a\u6307\u9488\u6216\u5f15\u7528\u76ee\u524d\u6240\u6307\u5bf9\u8c61\u7684\u7c7b\u578b\uff0c\u662f\u5728\u8fd0\u884c\u671f\u51b3\u5b9a\u7684\uff1b \u9759\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u9759\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u9759\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff1b \u52a8\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u52a8\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u9759\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff0c\u52a8\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\u53ef\u4ee5\u66f4\u6539\uff0c\u4f46\u662f\u9759\u6001\u7c7b\u578b\u65e0\u6cd5\u66f4\u6539\uff1b \u8981\u60f3\u5b9e\u73b0\u52a8\u6001\uff0c\u5fc5\u987b\u4f7f\u7528\u52a8\u6001\u7ed1\u5b9a\uff1b \u5728\u7ee7\u627f\u4f53\u7cfb\u4e2d\u53ea\u6709\u865a\u51fd\u6570\u4f7f\u7528\u7684\u662f\u52a8\u6001\u7ed1\u5b9a\uff0c\u5176\u4ed6\u7684\u5168\u90e8\u662f\u9759\u6001\u7ed1\u5b9a\uff1b \u6ce8\u610f\uff1a\u7edd\u5bf9\u4e0d\u8981\u91cd\u65b0\u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627f\u800c\u6765\u7684virtual\u51fd\u6570\u7684\u7f3a\u7701\u53c2\u6570\u503c\uff0c\u56e0\u4e3a\u7f3a\u7701\u53c2\u6570\u503c\u90fd\u662f\u9759\u6001\u7ed1\u5b9a\uff08\u4e3a\u4e86\u6267\u884c\u6548\u7387\uff09\uff0c\u800cvirtual\u51fd\u6570\u5374\u662f\u52a8\u6001\u7ed1\u5b9a\u3002 C++\u7684\u51e0\u79cd\u6784\u9020\u51fd\u6570 \u00b6 C++\u4e2d\u7684\u6784\u9020\u51fd\u6570\u53ef\u4ee5\u5206\u4e3a4\u7c7b\uff1a \uff081\uff09\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u3002\u4ee5Student\u7c7b\u4e3a\u4f8b\uff0c\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u7684\u539f\u578b\u4e3a Student(\uff09\uff1b//\u6ca1\u6709\u53c2\u6570 \uff082\uff09\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570 Student(int num\uff0cint age\uff09\uff1b//\u6709\u53c2\u6570 \uff083\uff09\u590d\u5236\uff08\u62f7\u8d1d\uff09\u6784\u9020\u51fd\u6570 Student(Student&\uff09\uff1b//\u5f62\u53c2\u662f\u672c\u7c7b\u5bf9\u8c61\u7684\u5f15\u7528 \uff084\uff09\u8f6c\u6362\u6784\u9020\u51fd\u6570 Student(int r) \uff1b//\u5f62\u53c2\u662f\u5176\u4ed6\u7c7b\u578b\u53d8\u91cf\uff0c\u4e14\u53ea\u6709\u4e00\u4e2a\u5f62\u53c2 \u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u548c\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570\u5728\u5b9a\u4e49\u7c7b\u7684\u5bf9\u8c61\u7684\u65f6\u5019\uff0c\u5b8c\u6210\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u5de5\u4f5c\u3002 \u590d\u5236\u6784\u9020\u51fd\u6570\u7528\u4e8e\u590d\u5236\u672c\u7c7b\u7684\u5bf9\u8c61\u3002 \u8f6c\u6362\u6784\u9020\u51fd\u6570\u7528\u4e8e\u5c06\u5176\u4ed6\u7c7b\u578b\u7684\u53d8\u91cf\uff0c\u9690\u5f0f\u8f6c\u6362\u4e3a\u672c\u7c7b\u5bf9\u8c61\u3002 \u4ec0\u4e48\u65f6\u5019\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570 \u00b6 \u5f53\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u4e24\u4e2a\u5173\u952e\u70b9\uff0c\u5206\u522b\u662f \u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f \u548c \u521d\u59cb\u5316\u5bf9\u8c61 \u521d\u59cb\u5316\u5bf9\u8c61 \u00b6 \u521d\u59cb\u5316\u5bf9\u8c61\u662f\u6307\uff0c\u4e3a\u5bf9\u8c61\u5206\u914d\u5185\u5b58\u540e\u7b2c\u4e00\u6b21\u5411\u5185\u5b58\u4e2d\u586b\u5145\u6570\u636e\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u5bf9\u8c61\u88ab\u521b\u5efa\u540e\u5fc5\u987b\u7acb\u5373\u521d\u59cb\u5316\u3002\u4e5f\u5c31\u662f\u8bf4\u53ea\u8981\u521b\u5efa\u5bf9\u8c61\u5c31\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\u3002 \u521d\u59cb\u5316\u548c\u8d4b\u503c\u7684\u533a\u522b \u00b6 \u521d\u59cb\u5316\u548c\u8d4b\u503c\u90fd\u662f\u5c06\u6570\u636e\u5199\u5165\u5185\u5b58\u4e2d\uff0c\u4ece\u8868\u9762\u770b\uff0c\u521d\u59cb\u5316\u5728\u5f88\u591a\u65f6\u5019\u90fd\u662f\u4ee5\u590d\u5236\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u7684\uff0c\u5f88\u5bb9\u6613\u5f15\u8d77\u6df7\u6dc6\u3002\u5728\u5b9a\u4e49\u7684\u540c\u65f6\u8fdb\u884c\u590d\u5236\u53eb\u505a\u521d\u59cb\u5316\uff0c\u5b9a\u4e49\u5b8c\u6210\u4ee5\u540e\u518d\u8d4b\u503c(\u4e0d\u7ba1\u5b9a\u4e49\u7684\u65f6\u5019\u6709\u6ca1\u6709\u8d4b\u503c)\u5c31\u53eb\u505a\u8d4b\u503c\u3002\u521d\u59cb\u5316\u53ea\u80fd\u7531\u4e00\u6b21\uff0c\u8d4b\u503c\u53ef\u4ee5\u7531\u5f88\u591a\u6b21\u3002 \u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u4e0d\u540c\u7684\u521d\u59cb\u5316\u65b9\u5f0f\u4f1a\u8c03\u7528\u4e0d\u540c\u7684\u6784\u9020\u51fd\u6570\uff1a \u00b6 \u5982\u679c\u7528\u4f20\u9012\u8fdb\u6765\u7684\u5b9e\u53c2\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u90a3\u4e48\u4f1a\u8c03\u7528\u666e\u901a\u7684\u6784\u9020\u51fd\u6570\u3002 \u5982\u679c\u7528\u73b0\u6709\u5bf9\u8c61\u7684\u6570\u636e\u6765\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u5c31\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u5c31\u662f\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u3002 \u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u6765\u521d\u59cb\u5316\u5bf9\u8c61\u7684\u51e0\u79cd\u60c5\u51b5\uff1a \u00b6 \u5c06\u5176\u5b83\u5bf9\u8c61\u4f5c\u4e3a\u5b9e\u53c2\u3002 \u5728\u521b\u5efa\u5bf9\u8c61\u7684\u540c\u65f6\u8d4b\u503c\u3002 \u51fd\u6570\u7684\u5f62\u53c2\u4e3a\u7c7b\u7c7b\u578b\u3002 \u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u7c7b\u7c7b\u578b(\u4e0e\u7f16\u8bd1\u5668\u6709\u5173\u4e0d\u7edd\u5bf9) C++\u7684\u5bb9\u5668\u6bd4\u8f83\uff0c\u4e3a\u4ec0\u4e48vector\u53ef\u4ee5\u968f\u673a\u8bbf\u95ee \u00b6 stl\u5bb9\u5668\u5305\u542b\u987a\u5e8f\u5bb9\u5668\u548c\u5173\u8054\u5bb9\u5668\u3002\u987a\u5e8f\u5bb9\u5668\u4e3b\u8981\u6709vector\uff0clist\uff0cdeque\uff0c\u5173\u8054\u5bb9\u5668\u4e3b\u8981\u662fpair\u3001set\u3001map\u3001multiset\u548cmultimap\uff0c\u6240\u4ee5\u603b\u5171\u7b97\u662f7\u79cd\u3002 \u6240\u8c13\u968f\u673a\u8bbf\u95ee\uff0c\u6211\u7684\u7406\u89e3\u662f\u6309\u7167\u6570\u7ec4\u7684\u65b9\u5f0f\u5728\u5185\u5b58\u4e2d\u987a\u5e8f\u5b58\u653e\uff0c\u53ea\u9700\u8981\u6839\u636e\u9996\u5730\u5740\u548c\u76f8\u5e94\u4e0b\u6807\u5c31\u80fd\u5bfb\u5740\u5230\u76f8\u5e94\u7684\u5143\u7d20\u3002 \u6240\u4ee5\u9010\u4e2a\u5206\u6790\u5982\u4e0b\uff1a vector\u7684\u5b9e\u73b0\u539f\u7406\u662f\u6570\u7ec4\uff0c\u6240\u4ee5\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 list\u7684\u5b9e\u73b0\u539f\u7406\u662f\u53cc\u5411\u94fe\u8868\uff0c\u6240\u4ee5\u4e0d\u652f\u6301\u3002 deque\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7c7b\u4f3c\u6570\u7ec4\u7684\u53cc\u7aef\u961f\u5217\uff0c\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 pair\u662f\u4e2a\u4e8c\u5143\u7ec4\uff0c\u4e00\u5171\u5c31\u4e24\u4e2a\u503c\uff0c\u8c08\u4e0d\u4e0a\u968f\u673a\u8bbf\u95ee\u3002 set\u3001multiset\u3001map\u3001multimap\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7ea2\u9ed1\u6811\uff0c\u4e0d\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 \u6240\u4ee5\u5728\u4e0a\u8ff0\u4e03\u79cd\u5bb9\u5668\u4e2d\u53ea\u6709vector\u548cdeque\u4e24\u79cd\u662f\u652f\u6301\u968f\u673a\u8bbf\u95ee\u7684\u3002 vector\u5e95\u5c42\u6570\u7ec4\u5927\u5c0f\u5206\u914d \u00b6 vector\u7684\u5927\u5c0f\u6709\u4e24\u4e2a\u53d8\u91cf\uff0c\u4e00\u4e2asize\uff0c\u4e00\u4e2acapacity\uff0csize\u662fvector\u5b9e\u9645\u5bb9\u91cf\uff0ccapacity\u662fvector\u6700\u5927\u5bb9\u91cf\uff0c\u5f53size=capacity\u65f6\uff0cvector\u9700\u8981\u8003\u8651\u6269\u5bb9\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09 \u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9 \u00b6 \u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002 MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904 \u00b6 \u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4 C++\u3001go\u3001python\u7684\u533a\u522b \u00b6 \u5305\u7ba1\u7406 \u00b6 C++\u8fd9\u79cd\u4e0e\u5e73\u53f0\u548c\u7f16\u8bd1\u5668\u76f8\u5173\uff0c\u5f88\u96be\u6709\u8bed\u8a00\u7ea7\u522b\u7684\u5305\u7ba1\u7406\u5668\uff0c \u4e00\u822c\u662f\u5404\u4e2a\u5f00\u53d1\u73af\u5883\u6301\u6709\u5404\u81ea\u7684\u590d\u7528\u7ba1\u7406\uff0c\u6bd4\u5982 linux \u7684 apt-get, deb, yum\uff0c\u5404\u79cdlib header dev\u5305\u53ef\u4ee5\u901a\u8fc7\u5176\u5b89\u88c5\u7684\u3002\u4e00\u822c\u90fd\u9700\u8981CMake\u6216\u8005Makefile\u8fdb\u884c\u5de5\u7a0b\u7ba1\u7406\uff0c\u6240\u4ee5\u6709\u76f8\u5e94\u7684\u5b66\u4e60\u6210\u672c\u3002 Python\u6709\u4e30\u5bcc\u7684\u5305\u7ba1\u7406\u5668\uff0c\u6bd4\u5982\uff0cdistutils\uff0csetuptools, \u8fd8\u6709\u8f83\u4e3a\u6d41\u884c\u7684pip\uff0c pip \u53ef\u4ee5\u5229\u7528 requirments.txt \u6765\u5b89\u88c5\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\u3002 GO\u65e9\u671f\u7684\u5305\u7ba1\u7406\u4e5f\u662f\u4e3a\u4eba\u8bdf\u75c5\uff0c\u4e0d\u8fc71.11 \u7248\u672c\u63a8\u51fa modules \u673a\u5236\uff0c\u8ba9go\u8bed\u8a00\u5305\u7ba1\u7406\u53d8\u5f97\u66f4\u65b9\u4fbf\u7b80\u5355\uff0c\u8fd8\u652f\u6301GoProxy\uff0creplace\uff0cSubCommand\u7b49\u9ad8\u7ea7\u7279\u6027\u3002 \u8bed\u6cd5 \u00b6 \u5728\u8bed\u6cd5\u65b9\u9762\uff0cC++\u548cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u8f83\u4e3a\u76f8\u4f3c\uff0c\u4f46\u662fGO\u8bed\u8a00\u8bed\u6cd5\u7b80\u6d01\uff0c\u4e0d\u9700\u8981\u7a0b\u5e8f\u5458\u7ba1\u7406\u5185\u5b58\uff0c\u6709\u4e30\u5bcc\u7684API\u53ef\u8c03\u7528\uff0c\u4e5f\u63d0\u4f9b\u4e86\u5207\u7247\uff0cmap\u7b49\u7075\u6d3b\u7684\u6570\u636e\u7c7b\u578b\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\u5728\u8bed\u6cd5\u65b9\u9762\u4ee5\u4f18\u96c5\u8457\u79f0\uff0c\u66f4\u4e3a\u7b80\u5355\u3002Python \u793e\u533a\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e0e\u6807\u51c6\u5e93\u7c7b\u4f3c\u3002\u5b83\u4eec\u7684\u529f\u80fd\u8986\u76d6 \u79d1\u5b66\u8ba1\u7b97\u3001\u4eba\u5de5\u667a\u80fd\u3001\u673a\u5668\u5b66\u4e60\u3001Web \u5f00\u53d1\u3001\u6570\u636e\u5e93\u63a5\u53e3\u591a\u4e2a\u9886\u57df\u3002 \u6027\u80fd \u00b6 \u5728\u6027\u80fd\u65b9\u9762\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\uff0c\u5728\u6027\u80fd\u65b9\u9762\u4e0eC++\u548cGO\u8bed\u8a00\u6709\u5f88\u5927\u5dee\u8ddd\uff0c\u5e76\u884c\u7f16\u7a0b\u8fd9\u4e00\u5757\u56e0\u4e3aGIL\u7684\u5b58\u5728,Python\u5f88\u96be\u5145\u5206\u5229\u7528\u591a\u6838CPU\u7684\u4f18\u52bf\u3002GO\u7684\u8fd0\u884c\u6548\u7387\u51e0\u4e4e\u53ef\u4ee5\u5ab2\u7f8eC/C++\uff0c\u800c\u4e14\u5929\u7136\u652f\u6301\u5e76\u53d1\u7f16\u7a0b\uff0c\u53ef\u4ee5\u901a\u8fc7go\u5173\u952e\u5b57\u521b\u5efaN\u4e2agoroutine\uff08\u4e00\u79cd\u7528\u6237\u6001\u7ebf\u7a0b\uff09\u6765\u5b9e\u73b0\u5e76\u53d1\uff0c\u540c\u65f6\u63d0\u4f9b\u591a\u4e2agoroutine\u7684\u540c\u6b65\u673a\u5236\u3002 \u5c0f\u7ed3 \u00b6 \u7efc\u4e0a\u6240\u8bc9\uff0cC++\u5728\u6027\u80fd\u65b9\u9762\u5f88\u9ad8\uff0c\u4f46\u662f\u5f00\u53d1\u6210\u672c\u4e5f\u6bd4\u8f83\u9ad8\u3002Python\u5f00\u53d1\u7b80\u5355\uff0c\u4f46\u662f\u6027\u80fd\u8f83\u4f4e\uff0c\u4f7f\u7528\u4e0e\u4e00\u4e9b\u5bf9\u6027\u80fd\u6ca1\u8981\u6c42\u7684\u670d\u52a1\u548c\u5de5\u5177\u5f00\u53d1\u3002\u76f8\u5bf9\u6765\u8bf4\uff0cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u7b80\u5355\uff0c\u5f00\u53d1\u6210\u672c\u4f4e\uff0c\u800c\u4e14\u6548\u7387\u4e5f\u8fdc\u9ad8\u4e8e\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u9002\u5408\u5927\u90e8\u5206\u7684\u670d\u52a1\u5f00\u53d1\u3002 Lambda\u8868\u8fbe\u5f0f\u7684\u53c2\u6570\u6355\u83b7\u6709\u54ea\u51e0\u79cd\u60c5\u51b5 \u00b6 \u503c\u6355\u83b7 \u4e0e\u4f20\u503c\u53c2\u6570\u7c7b\u4f3c\uff0c\u8981\u6c42\u503c\u6355\u83b7\u7684\u524d\u63d0\u662f \u53d8\u91cf\u53ef\u4ee5\u62f7\u8d1d \u4e0e\u4f20\u503c\u53c2\u6570\u4e0d\u540c\u7684\u662f\uff0c\u88ab\u6355\u83b7\u7684\u53d8\u91cf\u662f\u5728lambda\u521b\u5efa\u65f6\u62f7\u8d1d\uff0c\u800c\u4e0d\u662f\u5728\u8c03\u7528\u65f6\u62f7\u8d1d \u5f15\u7528\u6355\u83b7 \u786e\u4fdd\u88ab\u5f15\u7528\u7684\u5bf9\u8c61\u5728lambda\u8868\u8fbe\u5f0f\u6267\u884c\u65f6\u8fd8\u662f\u5b58\u5728\u7684 \u9690\u5f0f\u6355\u83b7 \u5728\u6355\u83b7\u5217\u8868\u4e2d\u4f7f\u7528 &\u6216 = \u5373\u8868\u793a\u9690\u5f0f\u6355\u83b7\uff0c \u6307\u793a\u7f16\u8bd1\u5668\u81ea\u52a8\u63a8\u65ad\u6355\u83b7\u5217\u8868 & \u8868\u793a\u91c7\u7528 \u5f15\u7528\u6355\u83b7 \u7684\u65b9\u5f0f = \u8868\u793a\u91c7\u7528 \u503c\u6355\u83b7 \u7684\u65b9\u5f0f Reference \u00b6 \u73b0\u4ee3C++32\u8bb2 C++\u9762\u8bd5\u8d44\u6599 \u7ec6\u8bfb Effective C++ cppreference","title":"C++ \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/c_cpp/basic/#c","text":"\u7ea6 12299 \u4e2a\u5b57 8 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 41 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9b\u5173\u4e8eC++\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6\uff0c\u5305\u62ec\u9762\u5411\u5bf9\u8c61\u7b49","title":"C++ \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/c_cpp/basic/#_1","text":"\u9884\u5904\u7406\uff1a\u6761\u4ef6\u7f16\u8bd1\uff0c\u5934\u6587\u4ef6\u5305\u542b\uff0c\u5b8f\u66ff\u6362\u5904\u7406\uff0c\u751f\u6210.i\u6587\u4ef6 \u7f16\u8bd1\uff1a\u5c06\u9884\u5904\u7406\u540e\u7684\u6587\u4ef6\u8f6c\u5316\u4e3a\u6c47\u7f16\u8bed\u8a00\uff0c\u751f\u6210.s\u6587\u4ef6 \u6c47\u7f16\uff1a\u6c47\u7f16\u53d8\u4e3a\u76ee\u6807\u4ee3\u7801\uff08\u673a\u5668\u4ee3\u7801\uff09\uff0c\u751f\u6210.o\u6587\u4ef6 \u94fe\u63a5\uff1a\u8fde\u63a5\u76ee\u6807\u4ee3\u7801\uff0c\u751f\u6210\u53ef\u6267\u884c\u7a0b\u5e8f","title":"\u4ee3\u7801\u5230\u53ef\u6267\u884c\u7a0b\u5e8f"},{"location":"cs/pl/c_cpp/basic/#_2","text":"\u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93\u6700\u672c\u8d28\u7684\u533a\u522b\u5c31\u662f\uff1a \u8be5\u5e93\u662f\u5426\u88ab\u7f16\u8bd1\u8fdb\u76ee\u6807\uff08\u7a0b\u5e8f\uff09\u5185\u90e8 \u9759\u6001\u5e93 \u4e00\u822c\u6269\u5c55\u540d\u4e3a .a \u6216 .lib \uff0c\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u4f1a\u76f4\u63a5\u6574\u5408\u5230\u76ee\u6807\u7a0b\u5e8f\u4e2d\uff0c\u6240\u4ee5\u5229\u7528\u9759\u6001\u51fd\u6570\u5e93\u7f16\u8bd1\u6210\u7684\u6587\u4ef6\u6bd4\u8f83\u5927\uff0c\u6700\u5927\u7684\u4f18\u70b9\u5c31\u662f \u7f16\u8bd1\u6210\u529f\u7684\u53ef\u6267\u884c\u6587\u4ef6\u53ef\u4ee5\u72ec\u7acb\u8fd0\u884c \uff0c\u800c\u4e0d\u518d\u9700\u8981\u5411\u5916\u90e8\u8981\u6c42\u8bfb\u53d6\u51fd\u6570\u5e93\u7684\u5185\u5bb9\uff1b\u4f46\u662f\u4ece\u5347\u7ea7\u96be\u6613\u5ea6\u6765\u770b\u660e\u663e\u6ca1\u6709\u4f18\u52bf\uff0c \u5982\u679c\u51fd\u6570\u5e93\u66f4\u65b0\uff0c\u9700\u8981\u91cd\u65b0\u7f16\u8bd1 \u3002 \u52a8\u6001\u5e93 \u52a8\u6001\u51fd\u6570\u5e93\u7684\u6269\u5c55\u540d\u4e00\u822c\u4e3a .so \u6216 .dll \uff0c\u8fd9\u7c7b\u51fd\u6570\u5e93\u901a\u5e38\u540d\u4e3alibxxx.so\u6216xxx.dll\u3002 \u4e0e\u9759\u6001\u51fd\u6570\u5e93\u88ab\u6574\u4e2a\u6355\u6349\u5230\u7a0b\u5e8f\u4e2d\u4e0d\u540c\uff0c\u52a8\u6001\u51fd\u6570\u5e93\u5728\u7f16\u8bd1\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u91cc\u53ea\u6709\u4e00\u4e2a\u201c\u6307\u5411\u201d\u7684\u4f4d\u7f6e\u800c\u5df2\uff0c\u4e5f\u5c31\u662f\u8bf4\u5f53\u53ef\u6267\u884c\u6587\u4ef6\u9700\u8981\u4f7f\u7528\u51fd\u6570\u5e93\u7684\u673a\u5236\u65f6\uff0c\u7a0b\u5e8f\u624d\u4f1a\u53bb\u8bfb\u53d6\u51fd\u6570\u5e93\u6765\u4f7f\u7528\uff1b\u4e5f\u5c31\u662f\u8bf4\u53ef\u6267\u884c\u6587\u4ef6\u65e0\u6cd5\u5355\u72ec\u8fd0\u884c\u3002\u8fd9\u6837\u4ece\u4ea7\u54c1\u529f\u80fd\u5347\u7ea7\u89d2\u5ea6\u65b9\u4fbf\u5347\u7ea7\uff0c\u53ea\u9700\u8981\u66ff\u6362\u5bf9\u5e94\u52a8\u6001\u5e93\u5373\u53ef\uff0c\u4e0d\u5fc5\u91cd\u65b0\u7f16\u8bd1\u6574\u4e2a\u53ef\u6267\u884c\u6587\u4ef6\u3002","title":"\u9759\u6001\u5e93\u548c\u52a8\u6001\u5e93"},{"location":"cs/pl/c_cpp/basic/#dll","text":"","title":"dll\u52a0\u8f7d"},{"location":"cs/pl/c_cpp/basic/#_3","text":"\u5728\u7a0b\u5e8f\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u5c06dll\u7f16\u8bd1\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u8c03\u7528\u65b9\u4fbf\uff0c\u7a0b\u5e8f\u53d1\u5e03\u7684\u65f6\u5019\u53ef\u4ee5\u4e0d\u7528\u5e26\u7740dll \u7f3a\u70b9\u662f\u7a0b\u5e8f\u4f1a\u5f88\u5927","title":"\u9690\u5f0f\u52a0\u8f7d\uff08\u9759\u6001\u8c03\u7528\uff09"},{"location":"cs/pl/c_cpp/basic/#_4","text":"\u5728\u7a0b\u5e8f\u8fd0\u884c\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u7528\u5230dll\u91cc\u7684\u51fd\u6570\u65f6\uff0c\u518d\u52a8\u6001\u52a0\u8f7ddll\u5230\u5185\u5b58\u4e2d \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\u56e0\u4e3a\u662f\u5728\u7a0b\u5e8f\u8fd0\u884c\u540e\u518d\u52a0\u8f7d\u5230\uff0c\u6240\u4ee5\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u542f\u52a8\u66f4\u5feb\uff0c\u800c\u4e14dll\u7684\u7ef4\u62a4\u66f4\u5bb9\u6613\uff0c\u4f7f\u5f97\u7a0b\u5e8f\u5982\u679c\u9700\u8981\u66f4\u65b0\uff0c\u5f88\u591a\u65f6\u5019\u76f4\u63a5\u66f4\u65b0dll\uff0c\u800c\u4e0d\u7528\u91cd\u65b0\u5b89\u88c5\u7a0b\u5e8f \u8fd9\u79cd\u52a0\u8f7d\u65b9\u5f0f\uff0c\u51fd\u6570\u8c03\u7528\u7a0d\u5fae\u590d\u6742\u4e00\u70b9","title":"\u663e\u793a\u52a0\u8f7d\uff08\u52a8\u6001\u8c03\u7528\uff09"},{"location":"cs/pl/c_cpp/basic/#c_1","text":"","title":"C++\u5185\u5b58\u7ba1\u7406"},{"location":"cs/pl/c_cpp/basic/#_5","text":"C++ \u5185\u5b58\u5206\u533a\uff1a\u6808\u3001\u5806\u3001\u81ea\u7531\u5b58\u50a8\u533a\u3001\u5168\u5c40/\u9759\u6001\u5b58\u50a8\u533a\u3001\u5e38\u91cf\u533a \u6808\uff1a\u5b58\u653e\u51fd\u6570\u7684\u5c40\u90e8\u53d8\u91cf\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u52a8\u5206\u914d\u548c\u91ca\u653e \u5806\uff1a\u52a8\u6001\u7533\u8bf7\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u5c31\u662f\u7531 malloc \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531\u7a0b\u5e8f\u5458\u63a7\u5236\u5b83\u7684\u5206\u914d\u548c\u91ca\u653e\uff0c\u5982\u679c\u7a0b\u5e8f\u6267\u884c\u7ed3\u675f\u8fd8\u6ca1\u6709\u91ca\u653e\uff0c\u64cd\u4f5c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u56de\u6536 \u81ea\u7531\u5b58\u50a8\u533a\uff1a\u548c\u5806\u5341\u5206\u76f8\u4f3c\uff0c\u5b58\u653e\u7531 new \u5206\u914d\u7684\u5185\u5b58\u5757\uff0c\u7531 delete \u91ca\u653e\u5185\u5b58 \u5168\u5c40\u533a/\u9759\u6001\u533a\uff1a\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u548c\u9759\u6001\u53d8\u91cf \u5e38\u91cf\u5b58\u50a8\u533a\uff1a\u5b58\u653e\u7684\u662f\u5e38\u91cf\uff0c\u4e0d\u5141\u8bb8\u4fee\u6539 \u4e8b\u5b9e\u4e0a\uff0c\u6211\u5728\u7f51\u4e0a\u770b\u7684\u5f88\u591a\u535a\u5ba2\uff0c\u5212\u5206\u81ea\u7531\u5b58\u50a8\u533a\u4e0e\u5806\u7684\u5206\u754c\u7ebf\u5c31\u662fnew/delete\u4e0emalloc/free\u3002\u7136\u800c\uff0c\u5c3d\u7ba1C++\u6807\u51c6\u6ca1\u6709\u8981\u6c42\uff0c\u4f46\u5f88\u591a\u7f16\u8bd1\u5668\u7684new/delete\u90fd\u662f\u4ee5malloc/free\u4e3a\u57fa\u7840\u6765\u5b9e\u73b0\u7684\u3002\u90a3\u4e48\u8bf7\u95ee\uff1a\u501f\u4ee5malloc\u5b9e\u73b0\u7684new\uff0c\u6240\u7533\u8bf7\u7684\u5185\u5b58\u662f\u5728\u5806\u4e0a\u8fd8\u662f\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\uff1f \u4ece\u6280\u672f\u4e0a\u6765\u8bf4\uff0c\u5806\uff08heap\uff09\u662fC\u8bed\u8a00\u548c\u64cd\u4f5c\u7cfb\u7edf\u7684\u672f\u8bed\u3002\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u6240\u7ef4\u62a4\u7684\u4e00\u5757\u7279\u6b8a\u5185\u5b58\uff0c\u5b83\u63d0\u4f9b\u4e86\u52a8\u6001\u5206\u914d\u7684\u529f\u80fd\uff0c\u5f53\u8fd0\u884c\u7a0b\u5e8f\u8c03\u7528malloc()\u65f6\u5c31\u4f1a\u4ece\u4e2d\u5206\u914d\uff0c\u7a0d\u540e\u8c03\u7528free\u53ef\u628a\u5185\u5b58\u4ea4\u8fd8\u3002\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u548cdelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\uff0c\u901a\u8fc7new\u6765\u7533\u8bf7\u7684\u5185\u5b58\u533a\u57df\u53ef\u79f0\u4e3a\u81ea\u7531\u5b58\u50a8\u533a\u3002\u57fa\u672c\u4e0a\uff0c\u6240\u6709\u7684C++\u7f16\u8bd1\u5668\u9ed8\u8ba4\u4f7f\u7528\u5806\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4e5f\u5373\u662f\u7f3a\u7701\u7684\u5168\u5c40\u8fd0\u7b97\u7b26new\u548cdelete\u4e5f\u8bb8\u4f1a\u6309\u7167malloc\u548cfree\u7684\u65b9\u5f0f\u6765\u88ab\u5b9e\u73b0\uff0c\u8fd9\u65f6\u85c9\u7531new\u8fd0\u7b97\u7b26\u5206\u914d\u7684\u5bf9\u8c61\uff0c\u8bf4\u5b83\u5728\u5806\u4e0a\u4e5f\u5bf9\uff0c\u8bf4\u5b83\u5728\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e5f\u6b63\u786e\u3002\u4f46\u7a0b\u5e8f\u5458\u4e5f\u53ef\u4ee5\u901a\u8fc7\u91cd\u8f7d\u64cd\u4f5c\u7b26\uff0c\u6539\u7528\u5176\u4ed6\u5185\u5b58\u6765\u5b9e\u73b0\u81ea\u7531\u5b58\u50a8\uff0c\u4f8b\u5982\u5168\u5c40\u53d8\u91cf\u505a\u7684\u5bf9\u8c61\u6c60\uff0c\u8fd9\u65f6\u81ea\u7531\u5b58\u50a8\u533a\u5c31\u533a\u522b\u4e8e\u5806\u4e86\u3002\u6211\u4eec\u6240\u9700\u8981\u8bb0\u4f4f\u7684\u5c31\u662f\uff1a \u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u7ef4\u62a4\u7684\u4e00\u5757\u5185\u5b58\uff0c\u800c\u81ea\u7531\u5b58\u50a8\u662fC++\u4e2d\u901a\u8fc7new\u4e0edelete\u52a8\u6001\u5206\u914d\u548c\u91ca\u653e\u5bf9\u8c61\u7684\u62bd\u8c61\u6982\u5ff5\u3002\u5806\u4e0e\u81ea\u7531\u5b58\u50a8\u533a\u5e76\u4e0d\u7b49\u4ef7\u3002","title":"\u5185\u5b58\u7ed3\u6784"},{"location":"cs/pl/c_cpp/basic/#_6","text":"\u5185\u5b58\u6cc4\u6f0f\u662f\u6307\u5e94\u7528\u7a0b\u5e8f\u5206\u914d\u67d0\u6bb5\u5185\u5b58\u540e\uff0c \u5931\u53bb\u4e86\u5bf9\u8be5\u6bb5\u5185\u5b58\u7684\u63a7\u5236 \uff0c\u56e0\u800c\u9020\u6210\u4e86\u5185\u5b58\u7684\u6d6a\u8d39\u3002 1. \u5728\u7c7b\u7684\u6784\u9020\u51fd\u6570\u548c\u6790\u6784\u51fd\u6570\u4e2d\u6ca1\u6709\u5339\u914d\u7684\u8c03\u7528new\u548cdelete\u51fd\u6570 2. \u6ca1\u6709\u6b63\u786e\u5730\u6e05\u9664 \u5d4c\u5957\u7684\u5bf9\u8c61\u6307\u9488 3. \u5728\u91ca\u653e \u5bf9\u8c61\u6570\u7ec4 \u65f6\u5728\u4e2d\u6ca1\u6709\u4f7f\u7528delete[] 4. \u6307\u5411\u5bf9\u8c61\u7684\u6307\u9488\u6570\u7ec4\u4e0d\u7b49\u540c\u4e8e\u5bf9\u8c61\u6570\u7ec4 1. \u7f3a\u5c11 \u62f7\u8d1d\u6784\u9020\u51fd\u6570 \u6216 \u91cd\u8f7d\u590d\u5236\u8fd0\u7b97\u7b26 \uff1a\u9690\u5f0f\u7684\u6307\u9488\u590d\u5236\u7ed3\u679c\u5c31\u662f\u4e24\u4e2a\u5bf9\u8c61\u62e5\u6709\u6307\u5411\u540c\u4e00\u4e2a\u52a8\u6001\u5206\u914d\u7684\u5185\u5b58\u7a7a\u95f4\u7684\u6307\u9488\u3002 5. \u6ca1\u6709\u5c06\u57fa\u7c7b\u7684 \u6790\u6784\u51fd\u6570 \u5b9a\u4e49\u4e3a\u865a\u51fd\u6570\u3002","title":"\u5185\u5b58\u6cc4\u6f0f"},{"location":"cs/pl/c_cpp/basic/#c_2","text":"","title":"C++\u7279\u6027"},{"location":"cs/pl/c_cpp/basic/#cc11","text":"\u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001 \u9700\u8981\u5728\u4e0d\u540c\u7684\u5e73\u53f0\u4e0a\u8fdb\u884c\u7f16\u8bd1 \u7f16\u8bd1\u540e\u7684\u7a0b\u5e8f\u53ef\u4ee5\u5728\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u76f4\u63a5\u8fd0\u884c \u53ef\u4ee5\u9762\u5411\u8fc7\u7a0b\u548c\u9762\u5411\u5bf9\u8c61\u4e24\u79cd\u8bbe\u8ba1\u65b9\u5f0f \u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u672c\u5730\u7684\u7cfb\u7edf\u5e93 \u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u63d0\u4f9b\u7684\u63a5\u53e3 \u7f16\u8bd1\u540e\u4ec5\u5bf9\u53d8\u91cf\u7684\u7c7b\u578b\u8fdb\u884c\u4e86\u5b58\u50a8\uff0c\u4e0d\u53ef\u4ee5\u8fdb\u884c\u7c7b\u4f3c\u53cd\u5c04\u7684\u64cd\u4f5c \u652f\u6301\u65e0\u7b26\u53f7\u6574\u578b \u53d8\u91cf\u7c7b\u578b\u7684\u5b57\u8282\u957f\u5ea6\u53d7\u64cd\u4f5c\u7cfb\u7edf\u5f71\u54cd \u652f\u6301\u6307\u9488\u3001\u5f15\u7528\u3001\u503c\u4f20\u9012 \u6ca1\u6709\u9ed8\u8ba4\u63d0\u4f9b\u7684GC\u7cfb\u7edf \u7531\u7a0b\u5e8f\u5458\u8d1f\u8d23\u7ba1\u7406\u53d8\u91cf\u6240\u50a8\u5b58\u7684\u4f4d\u7f6e \u4e25\u683c\u7684RAII \u652f\u6301\u91cd\u5199\u3001\u91cd\u8f7d\uff0c\u5305\u62ec\u8fd0\u7b97\u7b26\u7684\u91cd\u8f7d \u591a\u91cd\u7ee7\u627f \u652f\u6301\u9884\u7f16\u8bd1\uff0c\u7f16\u8bd1\u5b8f\u5b9a\u4e49 \u652f\u6301\u51fd\u6570\u6307\u9488\uff0c\u51fd\u6570\u5bf9\u8c61\uff0clambda\u8868\u8fbe\u5f0f","title":"C++\u7684\u7279\u6027\uff08C++11\u53ca\u4ee5\u4e0a\uff09"},{"location":"cs/pl/c_cpp/basic/#c11","text":"foreach auto \u81ea\u52a8\u7c7b\u578b\u63a8\u65ad lambda \u533f\u540d\u51fd\u6570 \u540e\u7f6e\u8fd4\u56de\u7c7b\u578b override \u5173\u952e\u5b57 \u7981\u6b62\u91cd\u5199 final \u5e38\u91cf\u8868\u8fbe\u5f0f constexpr nullptr \u4ee3\u8868\u539f\u6765\u7684NULL\uff0c\u800c\u539f\u6765\u7684NULL\u66f4\u591a\u8868\u793a\u4e3a0 \u5f53\u5b58\u5728 void a(int x); \u548c void a(char *x); \u65f6\uff0c\u82e5\u4f7f\u7528 a(NULL) \u5219\u4f1a\u8c03\u7528\u524d\u8005\uff0c\u8fd9\u4e0e\u901a\u5e38\u7684\u7406\u89e3\u4e0d\u540c\uff0c\u800c\u4f7f\u7528 a*nullptr) \u5219\u4f1a\u660e\u786e\u7684\u8c03\u7528\u540e\u8005 \u5143\u7ec4 tuple \uff0c\u53ef\u4ee5\u4f7f\u7528 get<>() \u53d6\u51fa\u5176\u4e2d\u4e00\u4e2a\u503c\uff0c\u6216\u8005\u4f7f\u7528 tie() \u88c5\u5305\u6216\u89e3\u5305","title":"C++11\u65b0\u589e\u7684\u7279\u6027"},{"location":"cs/pl/c_cpp/basic/#structclass","text":"struct\u9ed8\u8ba4\u4f7f\u7528public\uff0c\u800cclass\u9ed8\u8ba4\u4f7f\u7528private struct\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 {} \u8fdb\u884c\u521d\u59cb\u5316\uff0c\u800cclass\u5219\u9700\u8981\u6240\u6709\u6210\u5458\u53d8\u91cf\u90fd\u662fpublic\u7684\u65f6\u5019\u624d\u53ef\u4ee5\u4f7f\u7528","title":"struct\u548cclass\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_8","text":"\u7533\u8bf7\u65b9\u5f0f\uff1a\u6808\u662f\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u5806\u662f\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7 \u7533\u8bf7\u540e\u7cfb\u7edf\u54cd\u5e94\uff1a\u5206\u914d\u6808\u7a7a\u95f4\uff0c\u5982\u679c\u5269\u4f59\u7a7a\u95f4\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u5219\u5206\u914d\u6210\u529f\uff0c\u5426\u5219\u5206\u914d\u5931\u8d25\u6808\u6ea2\u51fa\uff1b\u7533\u8bf7\u5806\u7a7a\u95f4\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u5448\u73b0\u7684\u65b9\u5f0f\u7c7b\u4f3c\u4e8e\u94fe\u8868\uff08\u8bb0\u5f55\u7a7a\u95f2\u5730\u5740\u7a7a\u95f4\u7684\u94fe\u8868\uff09\uff0c\u5728\u94fe\u8868\u4e0a\u5bfb\u627e\u7b2c\u4e00\u4e2a\u5927\u4e8e\u7533\u8bf7\u7a7a\u95f4\u7684\u8282\u70b9\u5206\u914d\u7ed9\u7a0b\u5e8f\uff0c\u5c06\u8be5\u8282\u70b9\u4ece\u94fe\u8868\u4e2d\u5220\u9664\uff0c\u5927\u591a\u6570\u7cfb\u7edf\u4e2d\u8be5\u5757\u7a7a\u95f4\u7684\u9996\u5730\u5740\u5b58\u653e\u7684\u662f\u672c\u6b21\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u4fbf\u4e8e\u91ca\u653e\uff0c\u5c06\u8be5\u5757\u7a7a\u95f4\u4e0a\u7684\u5269\u4f59\u7a7a\u95f4\u518d\u6b21\u8fde\u63a5\u5728\u7a7a\u95f2\u94fe\u8868\u4e0a \u6808\u5728\u5185\u5b58\u4e2d\u662f\u8fde\u7eed\u7684\u4e00\u5757\u7a7a\u95f4\uff08\u5411\u4f4e\u5730\u5740\u6269\u5c55\uff09\u6700\u5927\u5bb9\u91cf\u662f\u7cfb\u7edf\u9884\u5b9a\u597d\u7684\uff0c\u5806\u5728\u5185\u5b58\u4e2d\u7684\u7a7a\u95f4\uff08\u5411\u9ad8\u5730\u5740\u6269\u5c55\uff09\u662f\u4e0d\u8fde\u7eed\u7684 \u7533\u8bf7\u6548\u7387\uff1a\u6808\u662f\u6709\u7cfb\u7edf\u81ea\u52a8\u5206\u914d\uff0c\u7533\u8bf7\u6548\u7387\u9ad8\uff0c\u4f46\u7a0b\u5e8f\u5458\u65e0\u6cd5\u63a7\u5236\uff1b\u5806\u662f\u7531\u7a0b\u5e8f\u5458\u4e3b\u52a8\u7533\u8bf7\uff0c\u6548\u7387\u4f4e\uff0c\u4f7f\u7528\u8d77\u6765\u65b9\u4fbf\u4f46\u662f\u5bb9\u6613\u4ea7\u751f\u788e\u7247 \u5b58\u653e\u7684\u5185\u5bb9\uff1a\u6808\u4e2d\u5b58\u653e\u7684\u662f\u5c40\u90e8\u53d8\u91cf\uff0c\u51fd\u6570\u7684\u53c2\u6570\uff1b\u5806\u4e2d\u5b58\u653e\u7684\u5185\u5bb9\u7531\u7a0b\u5e8f\u5458\u63a7\u5236","title":"\u5806\u548c\u6808\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_9","text":"\u5806\u662f\u64cd\u4f5c\u7cfb\u7edf\u4e3a\u8fdb\u7a0b\u6240\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\u7528\u6765\u5b58\u653e\u5168\u5c40\u53d8\u91cf\u3002\u7531\u7a0b\u5e8f\u5458\u7ba1\u7406\uff0c\u4e3b\u52a8\u7533\u8bf7\u4ee5\u53ca\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u53ef\u80fd\u4f1a\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f\uff0c\u5728\u8fdb\u7a0b\u7ed3\u675f\u540e\uff0c\u7531\u64cd\u4f5c\u7cfb\u7edf\u56de\u6536 \u6808\u662f\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7ba1\u7406\u7531\u7f16\u8bd1\u5668\u8fdb\u884c\u7533\u8bf7\uff0c\u91ca\u653e\u7684\u7a7a\u95f4\uff0c\u901a\u5e38\u6bd4\u5806\u8981\u5c0f\u5f88\u591a\uff0c\u5728C\u3001C++\u8bed\u8a00\u4e2d\uff0c2\u5f53\u8c03\u7528\u4e00\u4e2a\u51fd\u6570\u65f6\u4f1a\u521b\u5efa\u4e00\u4e2a\u6808\uff0c\u5f53\u51fd\u6570\u7ed3\u675f\u65f6\u5219\u4f1a\u56de\u6536\u6808\u7684\u7a7a\u95f4\u3002","title":"\u64cd\u4f5c\u7cfb\u7edf\u89d2\u5ea6"},{"location":"cs/pl/c_cpp/basic/#_10","text":"\u5806\u662f\u4e00\u9897\u5b8c\u5168\u4e8c\u53c9\u6811\uff0c\u5e38\u89c1\u7684\u6709\u6700\u5927\u5806\u548c\u6700\u5c0f\u5806\uff0c\u4ee5\u6700\u5927\u5806\u4e3a\u4f8b\uff0c\u5176\u6ee1\u8db3\u4e8c\u53c9\u6811\u4e2d\u7684\u4efb\u610f\u4e00\u4e2a\u8282\u70b9\u7684\u5b69\u5b50\u8282\u70b9\u90fd\u6bd4\u6b64\u8282\u70b9\u5c0f\u3002\u901a\u5e38\u7528\u6765\u5b9e\u73b0\u4f18\u5148\u961f\u5217\u7684\u6548\u679c\uff0c\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(log N)\\) \u6808\u662f\u4e00\u79cd\u7ebf\u6027\u6570\u636e\u7ed3\u6784\uff0c\u6ee1\u8db3\u5148\u8fdb\u540e\u51fa\u7684\u7279\u70b9\uff0c\u5373\u6700\u5148\u8fdb\u5165\u7684\u6570\u636e\u6700\u540e\u79bb\u5f00\uff0c\u5e38\u89c1\u4e8eDFS\u4e2d\u3002\u4e5f\u53ef\u4ee5\u901a\u8fc7\u5355\u8c03\u6808\u7684\u65b9\u5f0f\u6c42\u89e3\u4e00\u4e9b\u95ee\u9898\u3002\u63d2\u5165\u548c\u5220\u9664\u7684\u590d\u6742\u5ea6\u5747\u4e3a \\(O(1)\\)","title":"\u6570\u636e\u7ed3\u6784\u89d2\u5ea6"},{"location":"cs/pl/c_cpp/basic/#ccast","text":"const_cast \uff1a\u5bf9\u4e8e\u672a\u5b9a\u4e49const\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\uff0c\u901a\u5e38\u9700\u8981\u4f7f\u7528const_cast\u6765\u53bb\u9664const\u5f15\u7528\u5bf9\u8c61\u7684const\uff0c\u5b8c\u6210\u51fd\u6570\u8c03\u7528\u3002\u53e6\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u7ed3\u5408static_cast\uff0c\u53ef\u4ee5\u5728\u975econst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u5185\u6dfb\u52a0const\uff0c\u8c03\u7528\u5b8cconst\u7248\u672c\u7684\u6210\u5458\u51fd\u6570\u540e\uff0c\u518d\u4f7f\u7528const_cast\u53bb\u9664const\u9650\u5b9a\u3002 static_cast \uff1a\u5b8c\u6210\u57fa\u7840\u6570\u636e\u7c7b\u578b\uff1b\u540c\u4e00\u4e2a\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7c7b\u578b\u7684\u8f6c\u6362\uff1b\u4efb\u610f\u7c7b\u578b\u4e0e\u7a7a\u6307\u9488\u7c7b\u578bvoid* \u4e4b\u95f4\u7684\u8f6c\u6362\u3002 reinterpret_cast \uff1a\u65e0\u6761\u4ef6\u8f6c\u6362\uff08\u4ec0\u4e48\u90fd\u53ef\u4ee5\u8f6c\uff09\uff0cint\u53ef\u4ee5\u8f6c\u6307\u9488\uff0c\u53ef\u80fd\u4f1a\u51fa\u95ee\u9898\uff0c\u5c3d\u91cf\u5c11\u7528\u3002 dynamic_cast \uff1a\u7528\u4e8e\u52a8\u6001\u7c7b\u578b\u8f6c\u6362\u3002\u53ea\u80fd\u7528\u4e8e\u542b\u6709\u865a\u51fd\u6570\u7684\u7c7b\uff0c\u7528\u4e8e\u7c7b\u5c42\u6b21\u95f4\u7684\u5411\u4e0a\u548c\u5411\u4e0b\u8f6c\u6362\uff08\u5b50\u7c7b\u548c\u57fa\u7c7b\uff09\u3002\u53ea\u80fd\u8f6c\u6307\u9488\u6216\u5f15\u7528\u3002\u5411\u4e0b\u8f6c\u5316\u65f6\uff0c\u5982\u679c\u662f\u975e\u6cd5\u7684\u5bf9\u4e8e\u6307\u9488\u8fd4\u56deNULL\uff0c\u5bf9\u4e8e\u5f15\u7528\u629b\u5f02\u5e38\u3002\u5b83\u901a\u8fc7\u5224\u65ad\u5728\u6267\u884c\u5230\u8be5\u8bed\u53e5\u7684\u65f6\u5019\u53d8\u91cf\u7684\u8fd0\u884c\u65f6\u7c7b\u578b\u548c\u8981\u8f6c\u6362\u7684\u7c7b\u578b\u662f\u5426\u76f8\u540c\u6765\u5224\u65ad\u662f\u5426\u80fd\u591f\u8fdb\u884c\u5411\u4e0b\u8f6c\u6362\u3002","title":"C++\u4e2d\u56db\u79cdcast\u8f6c\u6362"},{"location":"cs/pl/c_cpp/basic/#static","text":"\u9759\u6001\u5c40\u90e8\u53d8\u91cf \uff1a\u53d8\u91cf\u5c5e\u4e8e\u51fd\u6570\u672c\u8eab\uff0c\u4ec5\u53d7\u51fd\u6570\u7684\u63a7\u5236\u3002\u4fdd\u5b58\u5728\u5168\u5c40\u6570\u636e\u533a\uff0c\u800c\u4e0d\u662f\u5728\u6808\u4e2d\uff0c\u6bcf\u6b21\u7684\u503c\u4fdd\u6301\u5230\u4e0b\u4e00\u6b21\u8c03\u7528\uff0c\u76f4\u5230\u4e0b\u6b21\u8d4b\u65b0\u503c\u3002 \u9759\u6001\u5168\u5c40\u53d8\u91cf \uff1a\u5b9a\u4e49\u5728\u51fd\u6570\u4f53\u5916\uff0c\u7528\u4e8e\u4fee\u9970\u5168\u5c40\u53d8\u91cf\uff0c\u8868\u793a\u8be5\u53d8\u91cf \u53ea\u5728\u672c\u6587\u4ef6\u53ef\u89c1 \uff0c\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff08\u5168\u5c40\u53d8\u91cf\u53ef\u4ee5\uff09 \u9759\u6001\u51fd\u6570 \uff1a\u9759\u6001\u51fd\u6570\u4e0d\u80fd\u88ab\u5176\u4ed6\u6587\u4ef6\u6240\u7528\uff0c\u5176\u4ed6\u6587\u4ef6\u4e2d\u53ef\u4ee5\u5b9a\u4e49\u76f8\u540c\u540d\u5b57\u7684\u51fd\u6570\uff0c\u4e0d\u4f1a\u53d1\u751f\u51b2\u7a81 \u9759\u6001\u6570\u636e\u6210\u5458 \uff1a\u9759\u6001\u6570\u636e\u6210\u5458\u7684\u751f\u5b58\u671f\u5927\u96e8class\u7684\u5b9e\u4f8b\uff08\u9759\u6001\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2aclass\u6709\u4e00\u4efd\uff0c\u666e\u901a\u6570\u636e\u6210\u5458\u662f\u6bcf\u4e2ainstance\u6709\u4e00\u4efd\uff09 1. \u9759\u6001\u6210\u5458\u4e4b\u95f4\u53ef\u4ee5\u76f8\u4e92\u8bbf\u95ee \uff0c\u5305\u62ec\u9759\u6001\u6210\u5458\u51fd\u6570\u8bbf\u95ee\u9759\u6001\u6570\u636e\u6210\u5458\u548c\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\uff1b 2. \u975e\u9759\u6001\u6210\u5458\u51fd\u6570 \u53ef\u4ee5\u4efb\u610f\u5730\u8bbf\u95ee\u9759\u6001\u6210\u5458\u51fd\u6570\u548c\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 3. \u9759\u6001\u6210\u5458\u51fd\u6570\u4e0d\u80fd\u8bbf\u95ee\u975e\u9759\u6001 \u6210\u5458\u51fd\u6570\u548c\u975e\u9759\u6001\u6570\u636e\u6210\u5458\uff1b 4. \u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u53ef\u4ee5\u7528\u6210\u5458\u8bbf\u95ee\u64cd\u4f5c\u7b26 . \u6216 -> \u4e3a\u4e00\u4e2a\u7c7b\u7684\u5bf9\u8c61\u6216\u6307\u5411\u7c7b\u5bf9\u8c61\u7684\u6307\u9488\u8c03\u7528\u9759\u6001\u6210\u5458\u51fd\u6570\uff0c\u4e5f\u53ef\u4ee5\u7528\u7c7b\u540d :: \u51fd\u6570\u540d\u8c03\u7528(\u56e0\u4e3a\u5b83\u672c\u6765\u5c31\u662f\u5c5e\u4e8e\u7c7b\u7684\uff0c\u7528\u7c7b\u540d\u8c03\u7528\u5f88\u6b63\u5e38)","title":"static"},{"location":"cs/pl/c_cpp/basic/#static_1","text":"\u8be5\u53d8\u91cf\u5728\u5168\u5c40\u6570\u636e\u533a\u5206\u914d\u5185\u5b58 \u672a\u7ecf\u521d\u59cb\u5316\u7684\u9759\u6001\u5168\u5c40\u53d8\u91cf\u4f1a\u88ab\u7a0b\u5e8f\u81ea\u52a8\u521d\u59cb\u5316\u4e3a0\uff08\u81ea\u52a8\u53d8\u91cf\u7684\u503c\u662f\u968f\u673a\u7684\uff0c\u9664\u975e\u4ed6\u88ab\u663e\u5f0f\u521d\u59cb\u5316\uff09 \u9759\u6001\u5168\u5c40\u53d8\u91cf\u5728\u58f0\u660e\u5b83\u7684\u6574\u4e2a\u6587\u4ef6\u90fd\u662f\u53ef\u89c1\u7684\uff0c\u800c\u5728\u6587\u4ef6\u4e4b\u5916\u662f\u4e0d\u53ef\u89c1\u7684","title":"static\u53d8\u91cf\u7684\u7279\u70b9"},{"location":"cs/pl/c_cpp/basic/#const","text":"\u4fee\u9970\u666e\u901a\u7c7b\u578b\u7684\u53d8\u91cf \u4fee\u9970\u6307\u9488\uff1a \u9876\u5c42const \uff08\u6307\u9488\u672c\u8eab\u662f\u4e2a\u5e38\u91cf\uff09\u548c \u5e95\u5c42const \uff08\u6307\u9488\u6307\u5411\u5bf9\u8c61\u662f\u4e00\u4e2a\u5e38\u91cf\uff09 \u4fee\u9970\u51fd\u6570\u53c2\u6570\uff1a 1. \u51fd\u6570\u53c2\u6570\u4e3a\u503c\u4f20\u9012\uff1a\u503c\u4f20\u9012\uff08pass-by-value\uff09\u662f\u4f20\u9012\u4e00\u4efd\u53c2\u6570\u7684\u62f7\u8d1d\u7ed9\u51fd\u6570\uff0c\u56e0\u6b64\u4e0d\u8bba\u51fd\u6570\u4f53\u4ee3\u7801\u5982\u4f55\u8fd0\u884c\uff0c\u4e5f\u53ea\u4f1a\u4fee\u6539\u62f7\u8d1d\u800c\u65e0\u6cd5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff0c\u8fd9\u79cd\u60c5\u51b5 \u4e0d\u9700\u8981\u5c06\u53c2\u6570\u58f0\u660e\u4e3aconst \u3002 2. \u51fd\u6570\u53c2\u6570\u4e3a\u6307\u9488\uff1a\u6307\u9488\u4f20\u9012\uff08pass-by-pointer\uff09 \u53ea\u4f1a\u8fdb\u884c\u6d45\u62f7\u8d1d\uff0c\u62f7\u8d1d\u4e00\u4efd\u6307\u9488\u7ed9\u51fd\u6570 \uff0c\u800c\u4e0d\u4f1a\u62f7\u8d1d\u4e00\u4efd\u539f\u59cb\u5bf9\u8c61\u3002\u56e0\u6b64\uff0c\u7ed9\u6307\u9488\u53c2\u6570\u52a0\u4e0a\u9876\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u9488\u6307\u5411\u88ab\u7be1\u6539\uff0c\u52a0\u4e0a\u5e95\u5c42const\u53ef\u4ee5\u9632\u6b62\u6307\u5411\u5bf9\u8c61\u88ab\u7be1\u6539\u3002 3. \u51fd\u6570\u53c2\u6570\u4e3a\u5f15\u7528\uff1a\u5f15\u7528\u4f20\u9012\uff08pass-by-reference\uff09\u53c8\u4e00\u4e2a\u5f88\u91cd\u8981\u7684\u4f5c\u7528\uff0c\u7531\u4e8e\u5f15\u7528\u5c31\u662f\u5bf9\u8c61\u7684\u4e00\u4e2a\u522b\u540d\uff0c\u56e0\u6b64\u4e0d\u9700\u8981\u62f7\u8d1d\u5bf9\u8c61\uff0c\u51cf\u5c0f\u4e86\u5f00\u9500\u3002\u8fd9\u540c\u65f6\u4e5f\u5bfc\u81f4\u53ef\u4ee5\u901a\u8fc7\u4fee\u6539\u5f15\u7528\u76f4\u63a5\u4fee\u6539\u539f\u662f\u5bf9\u8c61\uff08\u6bd5\u7adf\u5f15\u7528\u548c\u539f\u59cb\u5bf9\u8c61\u5176\u5b9e\u662f\u540c\u4e00\u4e2a\u4e1c\u897f\uff09\uff0c\u56e0\u6b64\uff0c\u5927\u591a\u6570\u65f6\u5019\uff0c\u63a8\u8350\u51fd\u6570\u53c2\u6570\u8bbe\u7f6e\u4e3a pass-by-reference-to-const \u3002\u7ed9\u5f15\u7528\u52a0\u4e0a\u5e95\u5c42const\uff0c\u65e2\u53ef\u4ee5\u51cf\u5c0f\u62f7\u8d1d\u5f00\u9500\uff0c\u53c8\u53ef\u4ee5\u9632\u6b62\u4fee\u6539\u5e95\u5c42\u6240\u7528\u7684\u5bf9\u8c61\u3002 \u4fee\u9970\u51fd\u6570\u8fd4\u56de\u503c\uff1a\u4ee4\u51fd\u6570\u8fd4\u56de\u4e00\u4e2a\u5e38\u91cf\uff0c\u53ef\u4ee5\u6709\u6548\u9632\u6b62\u56e0\u7528\u6237\u9519\u8bef\u9020\u6210\u7684\u610f\u5916\uff0c\u6bd4\u5982\u201c=\u201d\u3002 const\u6210\u5458\u51fd\u6570\uff1a const\u6210\u5458\u51fd\u6570\u4e0d\u53ef\u4fee\u6539\u7c7b\u5bf9\u8c61\u7684\u5185\u5bb9 \uff08\u6307\u9488\u7c7b\u578b\u7684\u6570\u636e\u6210\u5458\u53ea\u80fd\u4fdd\u8bc1\u4e0d\u4fee\u6539\u8be5\u6307\u9488\u6307\u5411\uff09\u3002\u539f\u7406\u662fconst\u6210\u5458\u51fd\u6570\u7684this\u6307\u9488\u5f0f\u5e95\u5c42const\u6307\u9488\uff0c\u4e0d\u80fd\u540c\u4e8e\u6539\u53d8\u5176\u6240\u6307\u5bf9\u8c61\u7684\u503c\u3002 \u5f53\u6210\u5458\u51fd\u6570const\u548cnon-const\u7248\u672c\u540c\u65f6\u5b58\u5728\u65f6\uff0cconst object\u53ea\u80fd\u8c03\u7528const\u7248\u672c\uff0cnon-const object\u667a\u80fd\u8c03\u7528non-const\u7248\u672c\u3002","title":"const"},{"location":"cs/pl/c_cpp/basic/#extern-c","text":"extern \"C\"\u7684\u4e3b\u8981\u4f5c\u7528\u5c31\u662f\u4e3a\u96f6\u80fd\u591f\u6b63\u786e\u5b9e\u73b0 C++\u4ee3\u7801\u8c03\u7528\u5176\u4ed6C\u8bed\u8a00\u4ee3\u7801 \u3002 \u52a0\u4e0aextern \"C\"\u540e\uff0c\u4f1a\u6307\u793a\u7f16\u8bd1\u5668\u8fd9\u90e8\u5206\u4ee3\u7801\u6309C\u8bed\u8a00\uff08\u800c\u4e0d\u662fC++\uff09\u7684\u65b9\u5f0f\u8fdb\u884c\u7f16\u8bd1\u3002\u7531\u4e8eC++\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1\u5668\u7f16\u8bd1\u51fd\u6570\u7684\u8fc7\u7a0b\u4e2d\u4f1a\u5c06\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u4e5f\u52a0\u5230\u7f16\u8bd1\u540e\u7684\u4ee3\u7801\u4e2d\uff0c\u800c\u4e0d\u4ec5\u4ec5\u662f\u51fd\u6570\u540d\uff1b\u800cC\u8bed\u8a00\u5e76\u4e0d\u652f\u6301\u51fd\u6570\u91cd\u8f7d\uff0c\u56e0\u6b64\u7f16\u8bd1C\u8bed\u8a00\u4ee3\u7801\u7684\u51fd\u6570\u65f6\u4e0d\u4f1a\u5e26\u4e0a\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\uff0c\u4e00\u822c\u6307\u5305\u62ec\u51fd\u6570\u540d\u3002 \u5728C++\u51fa\u73b0\u4ee5\u524d\uff0c\u5f88\u591a\u4ee3\u7801\u90fd\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u800c\u4e14\u5f88\u5e95\u5c42\u7684\u5e93\u4e5f\u662fC\u8bed\u8a00\u5199\u7684\uff0c\u4e3a\u4e86\u66f4\u597d\u7684\u652f\u6301\u539f\u6765\u7684C\u4ee3\u7801\u548c\u5df2\u7ecf\u5199\u597d\u7684C\u8bed\u8a00\u5e93\uff0c\u9700\u8981\u5728C++\u4e2d\u5c3d\u53ef\u80fd\u652f\u6301C\uff0c\u800cextern \"C\"\u5c31\u662f\u5176\u4e2d\u4e00\u4e2a\u7b56\u7565\u3002 C++\u4ee3\u7801\u8c03\u7528C\u8bed\u8a00\u4ee3\u7801 \u5728C++\u7684\u5934\u6587\u4ef6\u4e2d\u4f7f\u7528 \u5728\u591a\u4e2a\u534f\u540c\u5f00\u53d1\u65f6\uff0c\u53ef\u80fd\u6709\u7684\u4eba\u6bd4\u8f83\u64c5\u957fC\u8bed\u8a00\uff0c\u800c\u6709\u7684\u4eba\u64c5\u957fC++","title":"extern \"C\""},{"location":"cs/pl/c_cpp/basic/#inline","text":"\u7c7b\u5185\u5b9a\u4e49\u6210\u5458\u51fd\u6570\u9ed8\u8ba4\u4e3ainline","title":"inline"},{"location":"cs/pl/c_cpp/basic/#_11","text":"inline\u5b9a\u4e49\u7684\u7c7b\u7684\u5185\u8054\u51fd\u6570\uff0c\u51fd\u6570\u7684\u4ee3\u7801\u88ab\u653e\u5165\u7b26\u53f7\u8868\u4e2d\uff0c\u5728\u4f7f\u7528\u65f6\u76f4\u63a5\u8fdb\u884c\u66ff\u6362\uff0c\uff08\u50cf\u5b8f\u4e00\u6837\u5c55\u5f00\uff09\uff0c\u6ca1\u6709\u4e86\u8c03\u7528\u7684\u5f00\u9500\uff0c\u6548\u7387\u4e5f\u5f88\u9ad8\u3002 \u5185\u8054\u51fd\u6570\u4e5f\u662f\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\uff0c\u7f16\u8bd1\u5668\u5728\u8c03\u7528\u4e00\u4e2a\u5185\u8054\u51fd\u6570\u65f6\uff0c\u4f1a\u9996\u5148\u68c0\u67e5\u5b83\u7684\u53c2\u6570\u7684\u7c7b\u578b\uff0c\u4fdd\u8bc1\u8c03\u7528\u6b63\u786e\u3002\u7136\u540e\u8fdb\u884c\u4e00\u7cfb\u5217\u7684\u76f8\u5173\u68c0\u67e5\uff0c\u5c31\u50cf\u5bf9\u5f85\u4efb\u4f55\u4e00\u4e2a\u771f\u6b63\u7684\u51fd\u6570\u4e00\u6837\u3002\u8fd9\u6837\u5c31\u6d88\u9664\u4e86\u5b83\u7684\u9690\u60a3\u548c\u5c40\u9650\u6027\u3002\uff08\u5b8f\u66ff\u6362\u4e0d\u4f1a\u68c0\u67e5\u7c7b\u578b\uff0c\u5b89\u5168\u9690\u60a3\u8f83\u5927\uff09 inline\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u4e00\u4e2a\u7c7b\u7684\u6210\u5458\u51fd\u6570\uff0c\u4e0e\u7c7b\u7684\u666e\u901a\u6210\u5458\u51fd\u6570\u4f5c\u7528\u76f8\u540c\uff0c\u53ef\u4ee5\u653e\u4e3a\u4e00\u4e2a\u7c7b\u7684\u79c1\u6709\u6210\u5458\u548c\u4fdd\u62a4\u6210\u5458\u3002\u5185\u8054\u51fd\u6570\u53ef\u4ee5\u7528\u4e8e\u66ff\u6362\u4e00\u822c\u7684\u5b8f\u5b9a\u4e49\uff0c\u6700\u91cd\u8981\u7684\u5e94\u7528\u5728\u4e8e\u7c7b\u7684\u5b58\u53d6\u51fd\u6570\u7684\u5b9a\u4e49\u4e0a\u9762\u3002","title":"\u4f18\u70b9"},{"location":"cs/pl/c_cpp/basic/#_12","text":"\u5185\u8054\u51fd\u6570\u5177\u6709\u4e00\u5b9a\u7684\u5c40\u9650\u6027\uff0c\u5185\u8054\u51fd\u6570\u7684 \u51fd\u6570\u4f53\u4e00\u822c\u6765\u8bf4\u4e0d\u80fd\u592a\u5927 \uff0c\u5982\u679c\u5185\u8054\u51fd\u6570\u7684\u51fd\u6570\u4f53\u8fc7\u5927\uff0c\u4e00\u822c\u7684\u7f16\u8bd1\u5668\u4f1a\u653e\u5f03\u5185\u8054\u65b9\u5f0f\uff0c\u800c\u91c7\u7528\u666e\u901a\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570\u3002\uff08\u6362\u53e5\u8bdd\u8bf4\uff0c\u4f60\u5982\u679c\u4f7f\u7528\u5185\u8054\u51fd\u6570\uff0c\u53ea\u4e0d\u8fc7\u662f\u5411\u7f16\u8bd1\u5668\u63d0\u51fa\u4e00\u4e2a\u8bf7\u6c42\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u62d2\u7edd\u4f60\u7684\u8bf7\u6c42\uff09\u8fd9\u6837\uff0c\u5185\u8054\u51fd\u6570\u5c31\u548c\u666e\u901a\u51fd\u6570\u6267\u884c\u6548\u7387\u4e00\u6837\u4e86\u3002 inline\u8bf4\u660e\u5bf9\u7f16\u8bd1\u5668\u6765\u8bf4\u53ea\u662f\u4e00\u79cd\u5efa\u8bae\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u9009\u62e9\u5ffd\u7565\u8fd9\u4e2a\u5efa\u8bae\u3002\u6bd4\u5982\uff0c\u4f60\u8bb2\u4e00\u4e2a\u957f\u8fbe1000\u591a\u884c\u7684\u51fd\u6570\u6307\u5b9a\u4e3ainline\uff0c\u7f16\u8bd1\u5668\u5c31\u4f1a\u5ffd\u7565\u8fd9\u4e2ainline\uff0c\u5c06\u8fd9\u4e2a\u51fd\u6570\u8fd8\u539f\u6210\u666e\u901a\u51fd\u6570\uff0c\u56e0\u6b64\u5e76\u4e0d\u662f\u8bf4\u628a\u4e00\u4e2a\u51fd\u6570\u5b9a\u4e49\u4e3ainline\u51fd\u6570\u5c31\u4e00\u5b9a\u4f1a\u88ab\u7f16\u8bd1\u5668\u8bc6\u522b\u4e3a\u5185\u8054\u51fd\u6570\uff0c\u5177\u4f53\u53d6\u51b3\u4e8e\u7f16\u8bd1\u5668\u7684\u5b9e\u73b0\u548c\u51fd\u6570\u4f53\u7684\u5927\u5c0f\u3002","title":"\u7f3a\u70b9"},{"location":"cs/pl/c_cpp/basic/#_13","text":"\u5b8f\u662f\u7531\u9884\u5904\u7406\u5668\u5bf9\u5b8f\u8fdb\u884c\u66ff\u4ee3\uff0c\u800c\u4e14\u5185\u8054\u51fd\u6570\u662f\u771f\u6b63\u7684\u51fd\u6570\uff0c\u53ea\u662f\u5728\u9700\u8981\u7528\u5230\u7684\u65f6\u5019\uff0c\u5185\u8054\u51fd\u6570\u50cf\u5b8f\u4e00\u6837\u7684\u5c55\u5f00\uff0c\u6240\u4ee5 \u53d6\u6d88\u4e86\u51fd\u6570\u7684\u53c2\u6570\u538b\u6808\uff0c\u51cf\u5c11\u4e86\u8c03\u7528\u7684\u5f00\u9500 \uff0c\u4f60\u53ef\u4ee5\u50cf\u8c03\u7528\u51fd\u6570\u4e00\u6837\u6765\u8c03\u7528\u5185\u8054\u51fd\u6570\uff0c\u800c\u4e0d\u5fc5\u62c5\u5fc3\u4f1a\u4ea7\u751f\u4e8e\u5904\u7406\u5b8f\u7684\u4e00\u4e9b\u95ee\u9898\u3002\u5185\u8054\u51fd\u6570\u4e0e\u5e26\u53c2\u6570\u7684\u5b8f\u5b9a\u4e49\u8fdb\u884c\u6bd4\u8f83\uff0c\u4ed6\u4eec\u7684\u4ee3\u7801\u6548\u7387\u662f\u4e00\u6837\uff0c\u4f46\u662f\u5185\u8054\u51fd\u6570\u8981\u4f18\u4e8e\u5b8f\u5b9a\u4e49\uff0c\u56e0\u4e3a\u5185\u8054\u51fd\u6570\u9075\u5faa\u7684\u7c7b\u578b\u548c\u4f5c\u7528\u57df\u89c4\u5219\uff0c\u5b83\u4e0e\u4e00\u822c\u51fd\u6570\u66f4\u76f8\u8fd1\uff0c\u5728\u4e00\u4e9b\u7f16\u8bd1\u5668\u4e2d\uff0c\u4e00\u65e6\u5173\u8054\u4e0a\u5185\u8054\u6269\u5c55\uff0c\u5c06\u4e0e\u4e00\u822c\u51fd\u6570\u4e00\u6837\u8fdb\u884c\u8c03\u7528\uff0c\u6bd4\u8f83\u65b9\u4fbf\u3002","title":"\u548c\u5b8f\u5b9a\u4e49\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_14","text":"\u6307\u9488\u6709\u7740\u81ea\u5df1\u7684\u5185\u5b58\u7a7a\u95f4\uff0c\u662f\u4e00\u4e2a\u53d8\u91cf\u7c7b\u578b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e0d\u4f1a\u50cf\u5176\u4ed6\u53d8\u91cf\u4e00\u6837\u53d8\u5316\uff0c\u800c\u5f15\u7528\u672c\u8d28\u4e0a\u662f\u201c\u53d8\u91cf\u7684\u522b\u540d\u201d\uff0c\u6ca1\u6709\u5360\u7528\u5185\u5b58\u7a7a\u95f4 \u6307\u9488\u5728\u58f0\u660e\u5468\u671f\u5185\u968f\u65f6\u53ef\u80fd\u4f1aNULL\uff0c\u6240\u4ee5\u4f7f\u7528\u65f6\u4e00\u5b9a\u8981\u505a\u68c0\u67e5\uff0c\u9632\u6b62\u51fa\u73b0\u7a7a\u6307\u9488\u3001\u91ce\u6307\u9488\u7684\u60c5\u51b5 \u6307\u9488\u58f0\u660e\u65f6\u53ef\u4ee5 \u6682\u65f6\u4e0d\u521d\u59cb\u5316 \uff0c\u5f15\u7528\u58f0\u660e\u65f6 \u5fc5\u987b\u521d\u59cb\u5316 \u4f7f\u7528 sizeof \u53ef\u4ee5\u6c42\u5f97\u51fa\u572832\u4f4d\u64cd\u4f5c\u7cfb\u7edf\u4e0b\uff0c\u6307\u9488\u7684\u5927\u5c0f\u4e3a4\u4e2a\u5b57\u8282\uff0c\u800c\u5f15\u7528\u5219\u4e3a\u539f\u5bf9\u8c61\u7684\u5927\u5c0f \u6307\u9488\u53ef\u4ee5\u521d\u59cb\u5316\u4e3a\u4efb\u610f\u6b63\u6574\u6570\u503c\uff0c\u800c\u5f15\u7528\u5fc5\u987b\u521d\u59cb\u5316\u4e3a\u4e00\u4e2a\u5df2\u7ecf\u5b58\u5728\u7684\u53d8\u91cf \u53c2\u6570\u4f20\u9012\u65f6\uff0c\u6307\u9488\u9700\u8981\u5148\u8fdb\u884c\u6307\u9488\u8f6c\u4e3a\u5f15\u7528\u7136\u540e\u518d\u4f7f\u7528\uff0c\u800c\u5f15\u7528\u53ef\u4ee5\u76f4\u63a5\u64cd\u4f5c\u539f\u5bf9\u8c61 \u6307\u9488\u53ef\u4ee5\u6709 const \u5c5e\u6027\uff0c\u800c\u5f15\u7528\u6ca1\u6709 \u6307\u9488\u53ef\u4ee5\u91cd\u65b0\u8d4b\u503c\uff0c\u800c\u5f15\u7528\u4e0d\u53ef\u4ee5\u66f4\u6539 \u6307\u9488\u53ef\u4ee5\u8fdb\u884c\u591a\u7ea7\u6307\u9488\uff0c\u800c\u5f15\u7528\u53ea\u6709\u4e00\u7ea7 \u6307\u9488\u548c\u5f15\u7528\u8fdb\u884c++\uff08\u81ea\u589e\uff09\u64cd\u4f5c\u7684\u903b\u8f91\u548c\u7ed3\u679c\u90fd\u4e0d\u540c \u5f53\u9700\u8981\u8fd4\u56de\u52a8\u6001\u5185\u5b58\u5206\u914d\u7684\u5bf9\u8c61\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u6307\u9488\u800c\u4e0d\u662f\u5f15\u7528\uff0c\u56e0\u4e3a\u5f15\u7528\u53ef\u80fd\u4f1a\u4ea7\u751f\u5185\u5b58\u6cc4\u6f0f","title":"\u6307\u9488\u548c\u5f15\u7528"},{"location":"cs/pl/c_cpp/basic/#c_3","text":"\u5c06\u57fa\u672c\u7c7b\u578b\u6307\u9488\u5c01\u88c5\u4e3a\u7c7b\u5bf9\u8c61\u6307\u9488\uff0c\u5e76\u5728\u6790\u6784\u51fd\u6570\u91cc\u7f16\u5199delete\u8bed\u53e5\u5220\u9664\u6307\u9488\u6307\u5411\u7684\u5185\u5b58\u7a7a\u95f4\u3002 \u89e3\u51b3\u4ec0\u4e48\u95ee\u9898\uff1f \u7a7a\u6307\u9488\u548c\u91ce\u6307\u9488\u7684\u95ee\u9898 \u5bf9\u8c61\u91cd\u590d\u91ca\u653e\u7684\u95ee\u9898 \u5185\u5b58\u6cc4\u6f0f\u7684\u95ee\u9898 auto_ptr \uff08\u5df2\u5f03\u7528\uff09 \u91c7\u7528\u6240\u6709\u6743\u6a21\u5f0f\uff0c\u4efb\u4f55\u4e00\u4e2a new \u7684\u5bf9\u8c61\u53ea\u80fd\u7531\u4e00\u4e2a auto_ptr \u6765\u6307\u5411\uff0c\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u4f1a\u4f7f\u5f97\u539f\u6765\u7684\u6307\u9488\u4e22\u5931\u6307\u5411\u7684\u5bf9\u8c61 unique_ptr \u4e0e auto_ptr \u76f8\u540c\uff0c\u4f46\u662f\u8fdb\u884c\u8d4b\u503c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u76f4\u63a5\u62a5\u9519\uff0c\u800c auto_ptr \u4e0d\u4f1a shared_ptr \u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u591a\u4e2a\u6307\u9488\u6307\u5411\u6b64\u5bf9\u8c61\uff0c\u540c\u65f6\u5f53\u6240\u6709\u6307\u5411\u6b64\u5bf9\u8c61\u7684\u6307\u9488\u90fd\u88ab\u6790\u6784\u540e\uff0c\u6b64\u5bf9\u8c61\u5c06\u4f1a\u88ab\u5220\u9664 weak_ptr \u5f31\u5171\u4eab\u6307\u9488\uff0c\u5141\u8bb8\u6307\u5411\u5176\u4ed6\u7684 shared_ptr \u5bf9\u8c61\uff0c\u6b64\u6307\u9488\u4e0d\u4f1a\u5f71\u54cd shared_ptr \u7684\u6790\u6784\u884c\u4e3a\uff0c\u901a\u5e38\u7528\u6765\u907f\u514d\u76f8\u4e92\u6307\u5411\u95ee\u9898","title":"C++\u56db\u4e2a\u667a\u80fd\u6307\u9488"},{"location":"cs/pl/c_cpp/basic/#_15","text":"\u6307\u5411\u88ab\u91ca\u653e\u7684\u6216\u8005\u8bbf\u95ee\u53d7\u9650\u5185\u5b58\u7684\u6307\u9488\u3002 \u9020\u6210\u91ce\u6307\u9488\u7684\u539f\u56e0\uff1a - \u6307\u9488\u53d8\u91cf\u6ca1\u6709\u88ab\u521d\u59cb\u5316\uff08\u5982\u679c\u503c\u4e0d\u5b9a\uff0c\u53ef\u4ee5\u521d\u59cb\u5316\u4e3aNULL\uff09 - \u6307\u9488\u88abfree\u6216\u8005delete\u540e\uff0c\u6ca1\u6709\u7f6e\u4e3aNULL\uff0cfree\u548cdelete\u53ea\u662f\u628a\u6307\u9488\u6240\u6307\u5411\u7684\u5185\u5b58\u7ed9\u91ca\u653e\u6389\uff0c\u5e76\u6ca1\u6709\u628a\u6307\u9488\u672c\u8eab\u5e72\u6389\uff0c\u6b64\u65f6\u6307\u9488\u6307\u5411\u7684\u662f\uff1a\u201c\u5783\u573e\u201d\u5185\u5b58\u3002\u91ca\u653e\u540e\u7684\u6307\u9488\u5e94\u8be5\u88ab\u7f6e\u4e3aNULL\u3002 - \u6307\u9488\u64cd\u4f5c\u8d85\u8d8a\u4e86\u53d8\u91cf\u7684\u4f5c\u7528\u8303\u56f4\uff0c\u6bd4\u5982\u8fd4\u56de\u6307\u5411\u6808\u5185\u5b58\u7684\u6307\u9488\u5c31\u662f\u91ce\u6307\u9488\u3002","title":"\u91ce\u6307\u9488"},{"location":"cs/pl/c_cpp/basic/#newmalloc","text":"\u5728\u4f7f\u7528\u7684\u65f6\u5019 new,delete \u642d\u914d\u4f7f\u7528\uff0cmalloc \u548c free \u642d\u914d\u4f7f\u7528\u3002 \u5c5e\u6027\uff1amalloc/free \u662f\u5e93\u51fd\u6570\uff0c\u9700\u8981\u5934\u6587\u4ef6\u7684\u652f\u6301\uff1bnew/delete \u662f\u5173\u952e\u5b57\uff0c\u9700\u8981\u7f16\u8bd1\u5668\u7684\u652f\u6301 \u53c2\u6570\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u65e0\u9700\u6307\u5b9a\u5206\u914d\u7a7a\u95f4\u7684\u5927\u5c0f\uff0c\u7f16\u8bd1\u5668\u4f1a\u6839\u636e\u7c7b\u578b\u81ea\u884c\u8ba1\u7b97\uff1bmalloc \u5728\u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u9700\u8981\u786e\u5b9a\u6240\u7533\u8bf7\u7a7a\u95f4\u7684\u5927\u5c0f \u8fd4\u56de\u503c\uff1anew \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u7c7b\u578b\u662f\u5bf9\u8c61\u7684\u6307\u9488\u7c7b\u578b\uff0c\u65e0\u9700\u5f3a\u5236\u7c7b\u578b\u8f6c\u6362\uff0c\u7b26\u5408\u7c7b\u578b\u5b89\u5168\u7684\u64cd\u4f5c\u7b26\uff1bmalloc \u7533\u8bf7\u7a7a\u95f4\u65f6\uff0c\u8fd4\u56de\u7684\u662f void* \u7c7b\u578b\uff0c\u9700\u8981\u8fdb\u884c\u5f3a\u5236\u7c7b\u578b\u7684\u8f6c\u6362\uff0c\u8f6c\u6362\u4e3a\u5bf9\u8c61\u7c7b\u578b\u7684\u6307\u9488 \u5206\u914d\u5931\u8d25\uff1anew \u5206\u914d\u5931\u8d25\u65f6\uff0c\u4f1a\u629b\u51fa bad_alloc \u5f02\u5e38\uff0cmalloc \u5206\u914d\u5931\u8d25\u65f6\u8fd4\u56de\u7a7a\u6307\u9488 \u91cd\u8f7d\uff1anew/delete \u652f\u6301\u91cd\u8f7d\uff0cmalloc/free \u4e0d\u80fd\u8fdb\u884c\u91cd\u8f7d \u81ea\u5b9a\u4e49\u7c7b\u578b\u5b9e\u73b0\uff1anew \u9996\u5148\u8c03\u7528 operator new \u51fd\u6570\u7533\u8bf7\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 malloc \u5b9e\u73b0\uff09\uff0c\u7136\u540e\u8c03\u7528\u6784\u9020\u51fd\u6570\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u6700\u540e\u8fd4\u56de\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u6307\u9488\uff1bdelete \u9996\u5148\u8c03\u7528\u6790\u6784\u51fd\u6570\uff0c\u7136\u540e\u8c03\u7528 operator delete \u91ca\u653e\u7a7a\u95f4\uff08\u5e95\u5c42\u901a\u8fc7 free \u5b9e\u73b0\uff09\u3002malloc/free \u65e0\u6cd5\u8fdb\u884c\u81ea\u5b9a\u4e49\u7c7b\u578b\u7684\u5bf9\u8c61\u7684\u6784\u9020\u548c\u6790\u6784 \u5185\u5b58\u533a\u57df\uff1anew \u64cd\u4f5c\u7b26\u4ece\u81ea\u7531\u5b58\u50a8\u533a\u4e0a\u4e3a\u5bf9\u8c61\u52a8\u6001\u5206\u914d\u5185\u5b58\uff0c\u800c malloc \u51fd\u6570\u4ece\u5806\u4e0a\u52a8\u6001\u5206\u914d\u5185\u5b58\u3002\uff08\u81ea\u7531\u5b58\u50a8\u533a\u4e0d\u7b49\u4e8e\u5806\uff09 \u7279\u5f81 new/delete malloc/free \u5206\u914d\u5185\u5b58\u7684\u4f4d\u7f6e \u81ea\u7531\u5b58\u50a8\u533a \u5806 \u5206\u914d\u6210\u529f \u8fd4\u56de\u5b8c\u6574\u7c7b\u578b\u6307\u9488 \u8fd4\u56devoid* \u5206\u914d\u5931\u8d25 \u9ed8\u8ba4\u629b\u51fa\u5f02\u5e38 \u8fd4\u56deNULL \u5206\u914d\u5185\u5b58\u7684\u5927\u5c0f \u7531\u7f16\u8bd1\u5668\u6839\u636e\u7c7b\u578b\u8ba1\u7b97\u5f97\u51fa \u5fc5\u987b\u663e\u5f0f\u6307\u5b9a\u5b57\u8282\u6570 \u5904\u7406\u6570\u7ec4 \u6709\u5904\u7406\u6570\u7ec4\u7684new\u7248\u672c\u548cnew[] \u9700\u8981\u7528\u6237\u8ba1\u7b97\u6570\u7ec4\u7684\u5927\u5c0f\u540e\u8fdb\u884c\u5185\u5b58\u5206\u914d \u4ee5\u5206\u914d\u5185\u5b58\u7684\u6269\u5145 \u65e0\u6cd5\u76f4\u89c2\u5904\u7406 \u4f7f\u7528realloc\u7b80\u5355\u5b8c\u6210 \u662f\u5426\u76f8\u4e92\u8c03\u7528 \u53ef\u4ee5\uff0c\u770b\u5177\u4f53\u7684operator new/delete\u5b9e\u73b0 \u4e0d\u53ef\u8c03\u7528new \u5206\u914d\u5185\u5b58\u65f6\u5185\u5b58\u4e0d\u8db3 \u5ba2\u6237\u80fd\u591f\u5236\u5b9a\u5904\u7406\u51fd\u6570\u6216\u91cd\u65b0\u5236\u5b9a\u5206\u914d\u5668 \u65e0\u6cd5\u901a\u8fc7\u7528\u6237\u4ee3\u7801\u8fdb\u884c\u5904\u7406 \u51fd\u6570\u91cd\u8f7d \u5141\u8bb8 \u4e0d\u5141\u8bb8 \u6784\u9020\u51fd\u6570\u4e0e\u6790\u6784\u51fd\u6570 \u8c03\u7528 \u4e0d\u8c03\u7528","title":"new\u548cmalloc"},{"location":"cs/pl/c_cpp/basic/#_16","text":"","title":"\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_17","text":"\u540d\u5b57\u548c\u7c7b\u540d\u76f8\u540c \u6ca1\u6709\u8fd4\u56de\u503c \u751f\u6210\u7c7b\u7684\u81ea\u52a8\u6267\u884c\uff0c\u4e0d\u9700\u8981\u8c03\u7528","title":"\u6784\u9020\u51fd\u6570\u7684\u7279\u5f81"},{"location":"cs/pl/c_cpp/basic/#_18","text":"\u56e0\u4e3a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u5728\u6784\u9020\u51fd\u6570\u671f\u95f4\u521b\u5efa\u7684\uff0c\u6ca1\u6709\u865a\u51fd\u6570\u8868\u5c31\u6ca1\u6709\u529e\u6cd5\u8c03\u7528\u865a\u51fd\u6570","title":"\u4e3a\u4ec0\u4e48\u6784\u9020\u51fd\u6570\u4e0d\u53ef\u4ee5\u662f\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_19","text":"","title":"\u6790\u6784\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_20","text":"\u5982\u679c\u4e00\u4e2a\u7c7b\u4e2d\u6709\u6307\u9488\uff0c\u4e14\u8fd9\u4e2a\u6307\u9488\u6307\u5411\u4e86\u4e00\u6bb5\u7531\u6b64\u7c7b\u7684\u5b9e\u4f8b\u8bf7\u6c42\u5206\u914d\u7684\u7a7a\u95f4\uff0c\u90a3\u4e48\u9700\u8981\u7531\u6790\u6784\u51fd\u6570\u6765\u5b9e\u73b0\u5bf9\u8fd9\u5757\u533a\u57df\u7684\u91ca\u653e\uff0c\u5426\u5219\u4f1a\u9020\u6210\u5185\u5b58\u6cc4\u6f0f","title":"\u6790\u6784\u51fd\u6570\u7684\u4f5c\u7528"},{"location":"cs/pl/c_cpp/basic/#c_4","text":"\u515a\u8fd9\u4e2a\u7c7b\u9700\u8981\u4f5c\u4e3a\u7236\u7c7b\u6d3e\u751f\u7684\u65f6\u5019\uff0c\u5982\u679c\u7a0b\u5e8f\u5f97\u5230\u7684\u662f\u6b64\u7236\u7c7b\u7684\u6307\u9488\uff0c\u90a3\u4e48\u6b64\u65f6\u5c31\u65e0\u6cd5\u6790\u6784\u5b50\u7c7b\uff0c\u51fa\u73b0\u5185\u5b58\u6cc4\u6f0f","title":"C++\u4e3a\u4ec0\u4e48\u4e60\u60ef\u628a\u6790\u6784\u51fd\u6570\u5b9a\u4e49\u4e3a\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#c_5","text":"\u865a\u51fd\u6570\u9700\u8981\u989d\u5916\u7684\u865a\u51fd\u6570\u8868\u548c\u865a\u51fd\u6570\u8868\u6307\u9488\uff0c\u5bf9\u4e8e\u4e0d\u4f1a\u6d3e\u751f\u7684\u7c7b\u800c\u8a00\uff0c\u6d6a\u8d39\u7a7a\u95f4","title":"C++\u4e3a\u4ec0\u4e48\u9ed8\u8ba4\u7684\u6790\u6784\u51fd\u6570\u4e0d\u662f\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_21","text":"\u5bf9\u4e8e\u7c7b\u4e2d\u51fd\u6570\u7684\u91cd\u8f7d\u6216\u8005\u91cd\u5199\u800c\u8a00\uff0c\u91cd\u8f7d\u53d1\u751f\u5728\u540c\u4e00\u4e2a\u7c7b\u7684\u5185\u90e8\uff0c\u91cd\u5199\u53d1\u751f\u5728\u4e0d\u540c\u7684\u7c7b\u4e4b\u95f4\uff0c\u5b50\u7c7b\u548c\u7236\u7c7b\u4e4b\u95f4 \u91cd\u8f7d\u7684\u51fd\u6570\u9700\u8981\u4e0e\u539f\u51fd\u6570\u6709\u76f8\u540c\u7684\u51fd\u6570\u540d\u3001\u4e0d\u540c\u7684\u53c2\u6570\u5217\u8868\uff0c\u4e0d\u5173\u6ce8\u51fd\u6570\u7684\u8fd4\u56de\u503c\u7c7b\u578b\uff1b\u91cd\u5199\u7684\u51fd\u6570\u7684\u51fd\u6570\u540d\u3001\u53c2\u6570\u5217\u8868\u548c\u8fd4\u56de\u503c\u7c7b\u578b\u90fd\u9700\u8981\u548c\u539f\u51fd\u6570\u76f8\u540c\uff0c\u7236\u7c7b\u4e2d\u88ab\u91cd\u5199\u7684\u51fd\u6570\u9700\u8981\u6709 virtual \u4fee\u9970 virtual \u5173\u952e\u5b57\uff1a\u91cd\u5199\u7684\u51fd\u6570\u57fa\u7c7b\u4e2d\u5fc5\u987b\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\uff0c\u91cd\u8f7d\u7684\u51fd\u6570\u53ef\u4ee5\u6709 virtual \u5173\u952e\u5b57\u7684\u4fee\u9970\u4e5f\u53ef\u4ee5\u6ca1\u6709","title":"\u91cd\u8f7d\u548c\u91cd\u5199\uff08\u8986\u76d6\uff09"},{"location":"cs/pl/c_cpp/basic/#_22","text":"","title":"\u9501"},{"location":"cs/pl/c_cpp/basic/#c_6","text":"\u4e92\u65a5\u9501\uff1a\u5bf9\u4e8e\u540c\u4e00\u4e2a\u53d8\u91cf\u53ea\u5141\u8bb8\u4e00\u4e2a\u7ebf\u7a0b\u8fdb\u884c\u8bfb\u5199\uff0c\u82e5\u4e0d\u6ee1\u8db3\u65f6\u5219\u4f1a\u8fdb\u5165\u963b\u585e\uff0c\u5e76\u4e14CPU\u4e0d\u4f1a\u8fdb\u5165\u5fd9\u7b49 \u6761\u4ef6\u9501\uff1a\u5f53\u6ee1\u8db3\u67d0\u4e2a\u6761\u4ef6\u65f6\uff0c\u518d\u5524\u9192\u6b64\u7ebf\u7a0b\uff0c\u5426\u5219\u4e00\u76f4\u963b\u585e\u72b6\u6001 \u81ea\u65cb\u9501\uff1a\u4e0d\u65ad\u7684\u68c0\u67e5\u9501\u662f\u5426\u6ee1\u8db3\u6761\u4ef6\uff0c\u4e0d\u91ca\u653eCPU\uff0c\u6bd4\u8f83\u8017\u8d39CPU \u8bfb\u5199\u9501\uff1a\u5141\u8bb8\u6709\u8bfb\u9501\u7684\u65f6\u5019\u518d\u52a0\u8bfb\u9501\uff0c\u4f46\u662f\u6709\u5199\u9501\u65f6\u4e0d\u518d\u80fd\u52a0\u4efb\u4f55\u9501 \u9012\u5f52\u9501\uff1a\u5141\u8bb8\u540c\u4e00\u4e2a\u7ebf\u7a0b\u5bf9\u540c\u4e00\u4e2a\u9501\u8fdb\u884c\u591a\u6b21\u52a0\u9501","title":"C++\u4e2d\u9501\u7684\u7c7b\u578b"},{"location":"cs/pl/c_cpp/basic/#_23","text":"","title":"\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_24","text":"\u865a\u51fd\u6570\u7531 virtual \u6807\u8bb0 \u666e\u901a\u7684\u865a\u51fd\u6570\u4ecd\u7136\u9700\u8981\u8fdb\u884c\u5b9e\u73b0\uff0c\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u53ef\u4ee5\u91cd\u65b0\u5b9e\u73b0\u6b64\u51fd\u6570\u4e5f\u53ef\u4ee5\u4e0d\u5b9e\u73b0","title":"\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_25","text":"\u7eaf\u865a\u51fd\u6570\u5728\u666e\u901a\u7684\u865a\u51fd\u6570\u540e\uff0c\u52a0\u4e0a =0 \u5f53\u4e00\u4e2a\u7c7b\u62e5\u6709\u7eaf\u865a\u51fd\u6570\u540e\uff0c\u5219\u6b64\u7c7b\u53d8\u6210\u62bd\u8c61\u7c7b\uff0c \u4e0d\u53ef\u4ee5\u8fdb\u884c\u5b9e\u4f8b\u5316 \u7eaf\u865a\u51fd\u6570\u4e0d\u9700\u8981\u5b9e\u73b0\uff0c\u4e14\u6240\u6709\u7ee7\u627f\u6b64\u7c7b\u7684\u6d3e\u751f\u7c7b\u5fc5\u987b\u5b9e\u73b0\u6b64\u51fd\u6570\uff0c\u5426\u5219\u6d3e\u751f\u7c7b\u4e5f\u662f\u62bd\u8c61\u7c7b\uff0c\u4e0d\u53ef\u4ee5\u5b9e\u4f8b\u5316","title":"\u7eaf\u865a\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_26","text":"\u5728\u7c7b\u4e2d\u4fdd\u5b58\u4e00\u5f20\u865a\u51fd\u6570\u8868\uff0c\u8868\u5185\u4fdd\u5b58\u4e86\u51fd\u6570\u6240\u5728\u7684\u4ee3\u7801\u6bb5 \u5f53\u5176\u4ed6\u7c7b\u7ee7\u627f\u6b64\u7c7b\u65f6\uff0c\u590d\u5236\u4e00\u4efd\u6b64\u865a\u51fd\u6570\u8868\u3002\u5f53\u5176\u4e2d\u7684\u865a\u51fd\u6570\u8fdb\u884c\u5b9e\u73b0\u540e\uff0c\u5c06\u865a\u51fd\u6570\u8868\u4e2d\u6b64\u51fd\u6570\u7684\u6307\u9488\u6240\u6307\u5411\u65b0\u7684\u51fd\u6570\u7684\u5730\u5740 \u5b9a\u4e49\u7c7b\u7684\u5b9e\u4f8b\u7684\u65f6\u5019\uff0c\u5728\u7c7b\u7684\u5f00\u5934\u4fdd\u5b58\u4e86\u4e00\u4e2a\u6307\u5411\u6b64\u865a\u51fd\u6570\u8868\u7684\u6307\u9488\uff0c\u5f53\u9700\u8981\u8c03\u7528\u6b64\u51fd\u6570\u7684\u65f6\u5019\uff0c\u901a\u8fc7\u6b64\u6307\u9488\u627e\u5230\u5bf9\u5e94\u7684\u51fd\u6570\u5730\u5740","title":"\u865a\u51fd\u6570\u7684\u5b9e\u73b0\u539f\u7406"},{"location":"cs/pl/c_cpp/basic/#_27","text":"\u9759\u6001\u51fd\u6570\u5728\u7f16\u8bd1\u65f6\u5c31\u786e\u5b9a\u4e86\u8fd0\u884c\u7684\u65f6\u673a\uff0c\u800c\u865a\u51fd\u6570\u5219\u662f\u5728\u8fd0\u884c\u7684\u8fc7\u7a0b\u4e2d\u52a8\u6001\u7684\u5f97\u77e5\u865a\u51fd\u6570\u5730\u5740","title":"\u9759\u6001\u51fd\u6570\u548c\u865a\u51fd\u6570\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#strcpymemcpy","text":"\u590d\u5236\u7684\u5185\u5bb9\u4e0d\u540c\u3002strcpy\u53ea\u80fd\u590d\u5236\u5b57\u7b26\u4e32\uff0c\u800cmemcpy\u53ef\u4ee5\u590d\u5236\u4efb\u610f\u5185\u5bb9\uff0c\u4f8b\u5982\u5b57\u7b26\u6570\u7ec4\u3001\u6574\u578b\u3001\u7ed3\u6784\u4f53\u3001\u7c7b\u7b49\u3002\u4f01\u4e1a\u4e2d\u4f7f\u7528memcpy\u5f88\u5e73\u5e38\uff0c\u56e0\u4e3a\u9700\u8981\u62f7\u8d1d\u5927\u91cf\u7684\u7ed3\u6784\u4f53\u53c2\u6570\u3002memcpy\u901a\u5e38\u4e0ememset\u51fd\u6570\u914d\u5408\u4f7f\u7528\u3002 \u590d\u5236\u7684\u65b9\u6cd5\u4e0d\u540c\u3002strcpy\u4e0d\u9700\u8981\u6307\u5b9a\u957f\u5ea6\uff0c\u4ed6\u9047\u5230\u88ab\u590d\u5236\u5b57\u7b26\u7684\u4e32\u7ed3\u675f\u7b26\"\\0\"\u624d\u7ed3\u675f\uff0c\u6240\u4ee5\u5bb9\u6613\u6ea2\u51fa\u3002memcpy\u5219\u662f\u6839\u636e\u5176\u7b2c\u4e09\u4e2a\u53c2\u6570\u51b3\u5b9a\u590d\u5236\u7684\u957f\u5ea6\u3002\u56e0\u6b64strcpy\u4f1a\u590d\u5236\u5b57\u7b26\u4e32\u7684\u7ed3\u675f\u7b26\"\\0\"\uff0c\u800cmemcpy\u5219\u4e0d\u4f1a\u590d\u5236\u3002","title":"strcpy\u548cmemcpy\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_28","text":"","title":"\u961f\u5217\u548c\u5806\u6808\u7684\u6a21\u62df"},{"location":"cs/pl/c_cpp/basic/#_29","text":"\u5c06\u4e24\u4e2a\u5806\u6808\u547d\u540d\u4e3aA\u3001B \u82e5B\u5806\u6808\u4e3a\u7a7a\uff0c\u5219\u5c06A\u5806\u6808\u7684\u6240\u6709\u503c\u90fd\u63a8\u5165B\u4e2d \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u63a8\u51fa\uff0c\u5219\u4eceB\u4e2d\u63a8\u51fa","title":"\u7528\u4e24\u4e2a\u5806\u6808\u6a21\u62df\u961f\u5217"},{"location":"cs/pl/c_cpp/basic/#_30","text":"\u5c06\u4e24\u4e2a\u961f\u5217\u547d\u540d\u4e3aA\u3001B \u82e5\u9700\u8981\u63a8\u5165\uff0c\u5219\u63a8\u5165\u5230A\u4e2d \u82e5\u9700\u8981\u5f39\u51fa\uff0c\u5219\u5c06A\u4e2d\u7684\u503c\u9664\u4e86\u6700\u540e\u4e00\u4e2a\uff0c\u5176\u4ed6\u90fd\u63a8\u5165\u5230B\u4e2d\uff0c\u4e14\u4ec5\u7559\u4e0b\u4e00\u4e2a\u503c\uff0c\u7136\u540e\u5f39\u51fa\u8fd9\u4e2a\u503c\uff0c\u5e76\u5c06A\u3001B\u961f\u5217\u547d\u540d\u4e3aA\u3001B\u961f\u5217","title":"\u7528\u4e24\u4e2a\u961f\u5217\u6a21\u62df\u5806\u6808"},{"location":"cs/pl/c_cpp/basic/#_31","text":"\u5982\u4f55\u786e\u5b9a\u4e00\u4e2a\u503c\u662f\u5de6\u503c\u8fd8\u662f\u53f3\u503c \u63d0\u4f9b\u4e86\u5730\u5740\u7684\u4e3a\u5de6\u503c\uff0c\u5de6\u503c\u53ef\u4ee5\u6ca1\u6709\u503c\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u5730\u5740 \u63d0\u4f9b\u4e86\u503c\u7684\u4e3a\u53f3\u503c\uff0c\u53f3\u503c\u53ef\u4ee5\u6ca1\u6709\u5730\u5740\uff0c\u4f46\u662f\u4e00\u5b9a\u6709\u503c \u53f3\u503c\u5f15\u7528\u7684\u529f\u80fd \u79fb\u52a8\u8bed\u53e5 \u5b8c\u7f8e\u8f6c\u53d1","title":"\u53f3\u503c\u5f15\u7528"},{"location":"cs/pl/c_cpp/basic/#stl","text":"","title":"STL"},{"location":"cs/pl/c_cpp/basic/#vector","text":"","title":"vector"},{"location":"cs/pl/c_cpp/basic/#_32","text":"\u5f53\u7a7a\u95f4\u4e0d\u8db3\u7684\u65f6\u5019\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09","title":"\u6269\u5bb9\u89c4\u5219"},{"location":"cs/pl/c_cpp/basic/#_33","text":"\u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002","title":"\u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9"},{"location":"cs/pl/c_cpp/basic/#msvc15gcc2","text":"\u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4","title":"MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904"},{"location":"cs/pl/c_cpp/basic/#clear","text":"\u590d\u6742\u5ea6\u4e0e\u5df2\u6709\u7684\u5143\u7d20\u6570\u91cf\u6210\u7ebf\u6027\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u5143\u7d20\u90fd\u9700\u8981\u6790\u6784 clear\u540e\uff0c\u5e76\u4e0d\u4f1a\u6539\u53d8vector\u7684\u5bb9\u91cf\u4e0a\u9650\uff0c\u53ea\u4f1a\u66f4\u65b0vector\u5185\u7684size\u5927\u5c0f","title":"clear\u7684\u590d\u6742\u5ea6"},{"location":"cs/pl/c_cpp/basic/#unordered_mapmap","text":"map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u7ea2\u9ed1\u6811 \uff08\u6240\u6709\u5143\u7d20\u90fd\u662f\u6709\u5e8f\u7684\uff09\uff0cunordered_map\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a \u54c8\u5e0c\u8868 \uff08\u5143\u7d20\u7684\u6392\u5217\u662f\u65e0\u5e8f\u7684\uff09","title":"unordered_map\u548cmap"},{"location":"cs/pl/c_cpp/basic/#map","text":"\u4f18\u70b9\uff1a \u6709\u5e8f \u6027\uff0c\u8fd9\u662fmap\u7ed3\u6784\u6700\u5927\u7684\u4f18\u70b9\uff0c\u5176\u5143\u7d20\u7684\u6709\u5e8f\u6027\u5728\u5f88\u591a\u5e94\u7528\u4e2d\u90fd\u4f1a\u7b80\u5316\u5f88\u591a\u7684\u64cd\u4f5c\uff1b\u5185\u90e8\u5b9e\u73b0\u4e86\u4e00\u4e2a\u7ea2\u9ed1\u6811\u4f7f\u5f97map\u7684\u5f88\u591a\u64cd\u4f5c\u5728 \\(logn\\) \u7684\u65f6\u95f4\u590d\u6742\u5ea6\u4e0b\u5c31\u53ef\u4ee5\u5b9e\u73b0\uff0c\u56e0\u6b64 \u6548\u7387 \u975e\u5e38\u9ad8 \u7f3a\u70b9\uff1a \u7a7a\u95f4\u5360\u7528\u7387\u9ad8 \uff0c\u56e0\u4e3amap\u5185\u90e8\u5b9e\u73b0\u4e86\u7ea2\u9ed1\u6811\uff0c\u867d\u7136\u63d0\u9ad8\u4e86\u8fd0\u884c\u6548\u7387\uff0c\u4f46\u662f\u56e0\u4e3a \u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u9700\u8981\u989d\u5916\u4fdd\u5b58\u7236\u8282\u70b9\u3001\u5b69\u5b50\u8282\u70b9\u548c\u7ea2/\u9ed1\u6027\u8d28 \uff0c\u4f7f\u5f97\u6bcf\u4e00\u4e2a\u8282\u70b9\u90fd\u5360\u7528\u5927\u91cf\u7684\u7a7a\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e\u90a3\u4e9b\u6709\u987a\u5e8f\u8981\u6c42\u7684\u95ee\u9898\uff0c\u7528map\u4f1a\u66f4\u9ad8\u6548\u4e00\u4e9b","title":"map"},{"location":"cs/pl/c_cpp/basic/#unordered_map","text":"\u4f18\u70b9\uff1a\u56e0\u4e3a\u5185\u90e8\u5b9e\u73b0\u4e86\u54c8\u5e0c\u8868\uff0c\u56e0\u6b64\u5176 \u67e5\u627e\u901f\u5ea6 \u975e\u5e38\u5feb \u7f3a\u70b9\uff1a\u54c8\u5e0c\u8868\u7684 \u5efa\u7acb\u6bd4\u8f83\u8017\u8d39\u65f6\u95f4 \u9002\u7528\uff1a\u5bf9\u4e8e \u67e5\u627e\u95ee\u9898 \uff0cunordered_map\u4f1a\u66f4\u52a0\u9ad8\u6548\u4e00\u4e9b","title":"unordered_map"},{"location":"cs/pl/c_cpp/basic/#_34","text":"\u5c01\u88c5\u3001\u7ee7\u627f\u3001\u591a\u6001\u662f\u9762\u5411\u5bf9\u8c61\u7684\u4e09\u5927\u7279\u6027, \u8fd9\u4e9b\u7279\u6027\u4f7f\u5f97\u9762\u5411\u5bf9\u8c61\u53ef\u4ee5\u8bbe\u8ba1\u51fa\u4f4e\u8026\u5408\u7684\u7cfb\u7edf, \u4ece\u800c\u63d0\u9ad8\u4e86\u7cfb\u7edf\u7684\u7075\u6d3b\u6027, \u4f7f\u7cfb\u7edf\u66f4\u6613\u7ef4\u62a4, \u529f\u80fd\u66f4\u6613\u590d\u7528\u3001\u62d3\u5c55, \u4f46\u662f\u5176\u6027\u80fd\u6bd4\u9762\u5411\u8fc7\u7a0b\u8981\u4f4e\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\uff0c\u5373OOP\uff0c\u662f\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u6ee1\u8db3\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7684\u8bed\u8a00\uff0c\u4e00\u822c\u4f1a\u63d0\u4f9b\u7c7b\u3001\u5c01\u88c5\u3001\u7ee7\u627f\u7b49\u8bed\u6cd5\u548c\u6982\u5ff5\u6765\u8f85\u52a9\u6211\u4eec\u8fdb\u884c\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u3002 \u7c7b\u578b\u88ab\u8bbe\u8ba1\u4e3a\u5c06\u6570\u636e\u548c\u884c\u4e3a\u6346\u7ed1\u5728\u4e00\u8d77\u7684\u4e00\u79cd\u4e1c\u897f\uff0c\u6570\u636e\u548c\u884c\u4e3a\u88ab\u79f0\u4e4b\u4e3a\u7c7b\u578b\u7684\u6210\u5458\u3002\u6211\u4eec\u53ef\u4ee5\u521b\u5efa\u7c7b\u578b\u7684\u5b9e\u4f8b\uff0c\u4e0d\u540c\u7684\u5b9e\u4f8b\u5305\u542b\u4e0d\u540c\u7684\u6570\u636e\uff0c\u4ece\u800c\u5176\u8868\u73b0\u51fa\u6765\u7684\u884c\u4e3a\u4e5f\u4f1a\u4e0d\u540c\uff0c\u5c3d\u7ba1\u5176\u4ee3\u7801\u662f\u4e00\u6837\u7684\u3002 \u5c01\u88c5\u4f7f\u5f97\u7c7b\u7684\u6210\u5458\u5f97\u4ee5\u6709\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u4e00\u4e9b\u6210\u5458\u53ea\u5728\u7c7b\u578b\u7684\u5185\u90e8\u4f7f\u7528\uff0c\u88ab\u79f0\u4e4b\u4e3a\u79c1\u6709\u7684\uff08private\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u6d3e\u751f\u7c7b\u578b\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u53d7\u4fdd\u62a4\u7684\uff08protected\uff09\uff0c\u4e00\u4e9b\u6210\u5458\u53ef\u4ee5\u88ab\u4efb\u4f55\u4e1c\u897f\u4f7f\u7528\uff0c\u79f0\u4e4b\u4e3a\u516c\u5f00\u7684\uff08public\uff09\u3002\u800c\u67d0\u4e9b\u8bed\u8a00\u8fd8\u63d0\u4f9b\u4e86\u5185\u90e8\u7684\uff08internal\uff09\u8fd9\u6837\u7684\u8bbf\u95ee\u4fee\u9970\u7b26\u6765\u6807\u8bc6\u4e00\u4e9b\u53ea\u80fd\u88ab\u540c\u4e00\u4e2a\u7a0b\u5e8f\u96c6\u6216\u8005\u5305\u4f7f\u7528\u7684\u6210\u5458\u3002 \u7ee7\u627f\u53ef\u4ee5\u4ece\u4e00\u4e2a\u73b0\u6709\u7c7b\u578b\u6d3e\u751f\u51fa\u65b0\u7684\u7c7b\u578b\u6765\uff0c\u6d3e\u751f\u7c7b\u7ee7\u627f\u4e86\u57fa\u7c7b\u7684\u6240\u6709\u6210\u5458\uff0c\u4e5f\u53ef\u4ee5\u65b0\u589e\u53ea\u5c5e\u4e8e\u81ea\u5df1\u7684\u6210\u5458\u3002\u5728\u4efb\u4f55\u60c5\u51b5\u4e0b\uff0c\u6d3e\u751f\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u53ef\u4ee5\u88ab\u5f53\u505a\u57fa\u7c7b\u7c7b\u578b\u7684\u5b9e\u4f8b\u6765\u4f7f\u7528\u3002 \u865a\u65b9\u6cd5\u4e3a\u6d3e\u751f\u7c7b\u4fee\u6539\u57fa\u7c7b\u7684\u884c\u4e3a\u63d0\u4f9b\u4e86\u4e00\u4e2a\u9014\u5f84\uff0c\u901a\u8fc7\u91cd\u5199\uff08override\uff09\u865a\u65b9\u6cd5\u53ef\u4ee5\u4fee\u6539\u57fa\u7c7b\u67d0\u4e9b\u65b9\u6cd5\u7684\u884c\u4e3a\u3002\u5f53\u6d3e\u751f\u7c7b\u5b9e\u4f8b\u88ab\u5f53\u505a\u57fa\u7c7b\u5b9e\u4f8b\u6765\u4f7f\u7528\u65f6\uff0c\u8fd9\u4e00\u884c\u4e3a\u7684\u533a\u522b\u5c06\u4f1a\u88ab\u4f53\u73b0\u51fa\u6765\uff0c\u8fd9\u79cd\u5728\u8fd0\u884c\u65f6\u4e0d\u540c\u7c7b\u578b\u7684\u5b9e\u4f8b\u5728\u540c\u6837\u7684\u4ee3\u7801\u4e2d\u5448\u73b0\u51fa\u5b8c\u5168\u4e0d\u540c\u884c\u4e3a\u7684\u73b0\u8c61\u88ab\u79f0\u4e4b\u4e3a\u591a\u6001\u3002 \u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u6700\u521d\u662f\u4e3a\u4e86\u89e3\u51b3GUI\u7a0b\u5e8f\u8bbe\u8ba1\u95ee\u9898\u6240\u63d0\u51fa\u7684\uff0c\u540e\u6765\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u88ab\u53d1\u73b0\u4e5f\u6bd4\u8f83\u9002\u5408\u7528\u4e8e\u8bb8\u591a\u7279\u5b9a\u9886\u57df\u7684\u5f00\u53d1\u3002\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u662f\u76ee\u524d\u8fd0\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u4e00\u79cd\u7f16\u7a0b\u8303\u5f0f\uff0c\u4ece\u800c\u4e5f\u4ea7\u751f\u4e86\u975e\u5e38\u591a\u7684\u89e3\u51b3\u4ee3\u7801\u590d\u7528\u7684\u6280\u5de7\uff0c\u5176\u4e2d\u76f8\u5f53\u4e00\u90e8\u5206\u6280\u5de7\u5728\u7a0b\u5e8f\u4e2d\u53cd\u590d\u51fa\u73b0\u800c\u88ab\u63d0\u70bc\u4e3a\u8bbe\u8ba1\u6a21\u5f0f\u3002","title":"\u9762\u5411\u5bf9\u8c61\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u4f18\u70b9\uff1f"},{"location":"cs/pl/c_cpp/basic/#static_2","text":"\u9690\u85cf\u3002\u5f53\u6211\u4eec\u540c\u65f6\u7f16\u8bd1\u591a\u4e2a\u6587\u4ef6\u7684\u65f6\u5019\uff0c\u6240\u6709\u672a\u52a0static\u7684\u5168\u5c40\u53d8\u91cf\u548c\u51fd\u6570\u90fd\u5177\u6709\u5168\u5c40\u53ef\u89c1\u6027\u3002\u6240\u4ee5\u4f7f\u7528static\u5728\u4e0d\u540c\u7684\u6587\u4ef6\u4e2d\u5b9a\u4e49\u540c\u540d\u53d8\u91cf\u548c\u51fd\u6570\uff0c\u4e0d\u9700\u8981\u62c5\u5fc3\u547d\u540d\u51b2\u7a81\u3002 \u4fdd\u6301\u53d8\u91cf\u5185\u5bb9\u7684\u6301\u4e45\u3002\u5b58\u50a8\u5728\u9759\u6001\u6570\u636e\u533a\u7684\u53d8\u91cf\u4f1a\u5728\u7a0b\u5e8f\u521a\u5f00\u59cb\u8fd0\u884c\u65f6\u5c31\u5b8c\u6210\u521d\u59cb\u5316\uff0c\u4e5f\u662f\u552f\u4e00\u7684\u4e00\u6b21\u521d\u59cb\u5316\uff0c\u5171\u6709\u4e24\u79cd\u53d8\u91cf\u5b58\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5168\u5c40\u53d8\u91cf\u548cstatic\u3002 \u9ed8\u8ba4\u521d\u59cb\u5316\u4e3a0\u3002\u5168\u5c40\u53d8\u91cf\u4e5f\u5177\u6709\u8fd9\u4e2a\u5c5e\u6027\uff0c\u56e0\u4e3a\u5168\u5c40\u53d8\u91cf\u4e5f\u5b58\u50a8\u5728\u9759\u6001\u5b58\u50a8\u533a\uff0c\u5728\u9759\u6001\u5b58\u50a8\u533a\u5185\uff0c\u6240\u6709\u5b57\u8282\u7684\u9ed8\u8ba4\u503c\u65f60x00\uff0c\u8fd9\u4e00\u7279\u70b9\u53ef\u4ee5\u51cf\u5c11\u5de5\u4f5c\u91cf\u3002","title":"static\u6709\u4ec0\u4e48\u4f5c\u7528\uff1f"},{"location":"cs/pl/c_cpp/basic/#const_1","text":"\u4e0d\u8981\u4e00\u542c\u5230const\u5c31\u8bf4\u662f\u5e38\u91cf\uff0c\u5e94\u8be5\u8bf4const\u4fee\u9970\u7684\u5185\u5bb9\u4e0d\u53ef\u6539\u53d8\u3002\u5b9a\u4e49\u5e38\u91cf\u53ea\u662f\u4e00\u79cd\u4f7f\u7528\u65b9\u5f0f\uff0c\u8fd8\u6709const\u6570\u636e\u6210\u5458\uff0c\u53c2\u6570\uff0c\u8fd4\u56de\u503c\uff0c\u6210\u5458\u51fd\u6570\u7b49\uff0c\u88abconst\u4fee\u9970\u7684\u4e1c\u897f\u90fd\u53d7\u5230\u4e86\u5f3a\u5236\u4fdd\u62a4\uff0c\u53ef\u4ee5\u9884\u9632\u610f\u5916\u53d8\u52a8\uff0c\u63d0\u9ad8\u7a0b\u5e8f\u5065\u58ee\u6027\u3002","title":"const\u6709\u4ec0\u4e48\u7528\uff1f"},{"location":"cs/pl/c_cpp/basic/#cc","text":"C\u662f\u4f7f\u7528\u5b8f#define\u5b9a\u4e49\uff0cC++\u4f7f\u7528\u66f4\u597d\u7684const\u5b9a\u4e49\u3002 const\u662f\u6709\u6570\u636e\u7c7b\u578b\u7684\uff0c\u800cdefine\u6ca1\u6709\uff0c\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9\u524d\u8005\u8fdb\u884c\u9759\u6001\u7c7b\u578b\u5b89\u5168\u68c0\u67e5\uff0c\u5bf9\u540e\u8005\u4ec5\u4ec5\u662f\u5b57\u7b26\u66ff\u6362\uff0c\u6ca1\u6709\u68c0\u67e5\uff0c\u4f1a\u4ea7\u751f\u9519\u8bef\uff08\u8fb9\u9645\u6548\u5e94\uff09\u3002 \u6709\u4e9b\u7f16\u8bd1\u5668\u53ef\u4ee5\u5bf9const\u8fdb\u884c\u8c03\u8bd5\uff0c\u800cdefine\u4e0d\u884c\u3002","title":"C\u548cC++\u5404\u81ea\u662f\u5982\u4f55\u5b9a\u4e49\u5e38\u91cf\u7684\uff1f\u6709\u4ec0\u4e48\u4e0d\u540c\uff1f"},{"location":"cs/pl/c_cpp/basic/#cconstdefine","text":"const\u65e0\u6cd5\u66ff\u4ee3\u5b8f\u4f5c\u4e3a\u536b\u54e8\u6765\u9632\u6b62\u6587\u4ef6\u7684\u91cd\u590d\u5305\u542b\u3002","title":"\u65e2\u7136C++\u6709\u66f4\u597d\u7684const\u4e3a\u5565\u8fd8\u8981define\uff1f"},{"location":"cs/pl/c_cpp/basic/#include-includeah","text":"\u524d\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u6807\u51c6\u5e93\u8def\u5f84\u5f00\u59cb\u641c\u7d22\uff0c\u540e\u8005\uff0c\u7f16\u8bd1\u5668\u4ece\u7528\u6237\u7684\u5de5\u4f5c\u8def\u5f84\u5f00\u59cb\u641c\u7d22\u3002","title":"#include\u548c# include\"a.h\"\u6709\u4ec0\u4e48\u533a\u522b\uff1f"},{"location":"cs/pl/c_cpp/basic/#c_7","text":"\u591a\u6001\u6027\u662f\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u7ee7\u5c01\u88c5\u548c\u7ee7\u627f\u4e4b\u540e\u7684\u7b2c\u4e09\u4e2a\u57fa\u672c\u7279\u5f81\u3002 \u4ed6\u5728\u8fd0\u884c\u65f6\u51fa\u73b0\u7684\u591a\u6001\u6027\u901a\u8fc7\u6d3e\u751f\u7c7b\u548c\u865a\u51fd\u6570\u5b9e\u73b0\uff0c\u57fa\u7c7b\u548c\u6d3e\u751f\u7c7b\u4e2d\u4f7f\u7528\u540c\u6837\u7684\u51fd\u6570\u540d\uff0c\u5b8c\u6210\u4e0d\u540c\u7684\u64cd\u4f5c\u5177\u4f53\u5b9e\u73b0\u3002 \u591a\u6001\u6027\u63d0\u9ad8\u4e86\u4ee3\u7801\u7684\u7ec4\u7ec7\u6027\u548c\u53ef\u8bfb\u6027\uff0c\u865a\u51fd\u6570\u5219\u6839\u636e\u7c7b\u578b\u7684\u4e0d\u540c\u6765\u8fdb\u884c\u4e0d\u540c\u7684\u9694\u79bb\u3002","title":"C++\u4ec0\u4e48\u662f\u591a\u6001\u6027\uff1f\u5982\u4f55\u4f53\u73b0\u7684\uff1f"},{"location":"cs/pl/c_cpp/basic/#_35","text":"\u5728\u7edd\u5927\u591a\u6570\u60c5\u51b5\u4e0b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u7f16\u8bd1\u7684\u65f6\u5019\u5c31\u786e\u5b9a\u4e0b\u6765\uff0c\u6211\u4eec\u79f0\u4e4b\u4e3a\u9759\u6001\u7279\u6027\u3002\u53cd\u4e4b\uff0c\u7a0b\u5e8f\u7684\u529f\u80fd\u662f\u5728\u8fd0\u884c\u7684\u65f6\u5019\u786e\u5b9a\uff0c\u79f0\u4e4b\u4e3a\u52a8\u6001\u7279\u6027\u3002C++\u4e2d\uff0c\u865a\u51fd\u6570\uff0c\u62bd\u8c61\u57fa\u7c7b\uff0c\u52a8\u6001\u7ed1\u5b9a\u548c\u591a\u6001\u6784\u6210\u4e86\u51fa\u8272\u7684\u52a8\u6001\u7279\u6027\u3002","title":"\u4ec0\u4e48\u662f\u52a8\u6001\u7279\u6027\uff1f"},{"location":"cs/pl/c_cpp/basic/#c_8","text":"\u5c01\u88c5\u6765\u6e90\u4e8e\u4fe1\u606f\u9690\u85cf\u7684\u8bbe\u8ba1\u7406\u5ff5\uff0c\u662f\u901a\u8fc7\u7279\u6027\u548c\u884c\u4e3a\u7684\u7ec4\u5408\u6765\u521b\u5efa\u65b0\u6570\u636e\u7c7b\u578b\u8ba9\u63a5\u53e3\u548c\u67d0\u4e2a\u5b9e\u73b0\u76f8\u9694\u79bb\u3002 C++\u662f\u901a\u8fc7\u7c7b\u6765\u5b9e\u73b0\u7684\uff0c\u5c01\u88c5\u4e3a\u4e86\u4f7f\u7c7b\u4e2d\u6210\u5458\u9009\u62e9\u6027\u7684\u66b4\u9732\uff0c\u6709\u4e09\u4e2a\u5173\u952e\u5b57(balabalabala)","title":"\u4ec0\u4e48\u662f\u5c01\u88c5\uff1fC++\u4e2d\u662f\u5982\u4f55\u5b9e\u73b0\u7684\uff1f"},{"location":"cs/pl/c_cpp/basic/#rtti","text":"RTT\u662f\u6307\u8fd0\u884c\u65f6\u7c7b\u578b\u8bc6\u522b\uff08Run-time type identification\uff09\u5728\u53ea\u6709\u4e00\u4e2a\u6307\u5411\u57fa\u7c7b\u7684\u6307\u9488\u6216\u5f15\u7528\u65f6\u786e\u5b9a\u4e00\u4e2a\u5bf9\u8c61\u7684\u51c6\u786e\u7c7b\u578b\u3002","title":"\u4ec0\u4e48\u662fRTTI\uff1f"},{"location":"cs/pl/c_cpp/basic/#_36","text":"\u6df1\u6d45\u62f7\u8d1d\u5173\u952e\u5728\u4e8e\u6709\u6ca1\u6709\u62f7\u8d1d\u5206\u914d\u7ed9\u6210\u5458\u7684\u8d44\u6e90\uff0c\u4f8b\u5982\u7ed9\u6307\u9488\u53d8\u91cf\u5206\u914d\u5185\u5b58\u3002\u6d45\u62f7\u8d1d\u53ea\u662f\u7ed9\u6210\u5458\u7b80\u5355\u8d4b\u503c\uff0c\u800c\u6df1\u62f7\u8d1d\u4e0d\u4ec5\u8d4b\u503c\uff0c\u8fd8\u5206\u914d\u8d44\u6e90\u3002 \u7c7b\u4e2d\u9ed8\u8ba4\u7684\u62f7\u8d1d\u6784\u9020\u51fd\u6570\u548c\u8d4b\u503c\u6784\u9020\u51fd\u6570\u90fd\u662f\u6d45\u62f7\u8d1d\uff0c\u5f53\u7c7b\u7684\u6210\u5458\u53d8\u91cf\u4e2d\u51fa\u73b0\u6307\u9488\u53d8\u91cf\u65f6\uff0c\u6700\u597d\u4f7f\u7528\u6df1\u62f7\u8d1d\uff0c\u907f\u514d\u5185\u5b58\u7a7a\u95f4\u591a\u6b21\u91ca\u653e\u7684\u95ee\u9898\u51fa\u73b0\u3002","title":"\u4ec0\u4e48\u662f\u6df1\u6d45\u62f7\u8d1d\uff1f"},{"location":"cs/pl/c_cpp/basic/#_37","text":"\u4f4d\u7f6e\uff1a\u865a\u51fd\u6570\u8868\u6307\u9488\u662f\u865a\u51fd\u6570\u8868\u6240\u5728\u4f4d\u7f6e\u7684\u5730\u5740\u3002\u865a\u51fd\u6570\u8868\u6307\u9488\u5c5e\u4e8e\u5bf9\u8c61\u5b9e\u4f8b\u3002\u56e0\u800c\u901a\u8fc7new \u51fa\u6765\u7684\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u5806\uff0c\u58f0\u540d\u5bf9\u8c61\u7684\u865a\u51fd\u6570\u8868\u6307\u9488\u4f4d\u4e8e\u6808\u3002 \u865a\u51fd\u6570\u8868\u7684\u5b58\u5728\u662f\u7f16\u8bd1\u5668\u4f9d\u8d56\u7684(\u4f46\u6240\u6709\u7f16\u8bd1\u5668\u90fd\u662f\u5982\u6b64)\uff0cvptr\u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u5f00\u5934.\u539f\u56e0\u662f\u5b83\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7edf\u4e00\u7684\u4f4d\u7f6e.\u8003\u8651\u4e00\u4e2a\u7c7b\u5c42\u6b21\u7ed3\u6784: struct base { T data ; virtual void f (); }; struct derived : base { T1 data ; virtual void g (); }; \u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u90a3\u4e48\u5bf9\u4e8e\u5b8c\u6574\u7c7b\u578b base \u7684\u5bf9\u8c61\uff0c\u5b83\u5c06\u4f4d\u4e8e sizeof(T) \u5b57\u8282\u4e4b\u540e.\u73b0\u5728\uff0c\u5f53\u4f60\u6709\u4e00\u4e2a\u5b8c\u6574\u7c7b\u578b\u7684\u5bf9\u8c61 derived \u65f6\uff0cbase \u5b50\u5bf9\u8c61\u7684\u5e03\u5c40\u5fc5\u987b\u4e0e\u5b8c\u6574 base \u5bf9\u8c61\u7684\u5e03\u5c40\u517c\u5bb9\uff0c\u56e0\u6b64 vptr \u4ecd\u7136\u5fc5\u987b\u662f sizeof(T) \u5b57\u8282\u5728\u5bf9\u8c61\u5185\u90e8\uff0c\u5b83\u5c06\u4f4d\u4e8e derived \u5bf9\u8c61\u4e2d\u95f4\u7684\u67d0\u4e2a\u4f4d\u7f6e(sizeof(T) \u4ece\u5f00\u59cb\uff0csizeof(T1) \u5728\u7ed3\u675f\u4e4b\u524d).\u6240\u4ee5\u5b83\u5c06\u4e0d\u518d\u4f4d\u4e8e\u5bf9\u8c61\u7684 end \u5904. \u6b64\u5916\uff0c\u7ed9\u5b9a\u4e00\u4e2a this \u6307\u9488\uff0c\u865a\u62df\u8c03\u7528\u9700\u8981\u901a\u8fc7 vtable \u8fdb\u884c\u95f4\u63a5\u8c03\u7528\uff0c\u8fd9\u57fa\u672c\u4e0a\u662f\u53d6\u6d88\u5bf9 vptr \u7684\u5f15\u7528\uff0c\u6dfb\u52a0\u4e00\u4e2a\u504f\u79fb\u91cf\u5e76\u8df3\u8f6c\u5230\u5b58\u50a8\u5728\u90a3\u91cc\u7684\u5185\u5b58\u4f4d\u7f6e.\u5982\u679c vptr \u5b58\u50a8\u5728\u5bf9\u8c61\u7684\u672b\u5c3e\uff0c\u5219\u5bf9\u4e8e\u6bcf\u4e2a\u865a\u62df\u8c03\u7528\uff0c\u5728\u53d6\u6d88\u5f15\u7528 vptr \u4e4b\u524d\u90fd\u4f1a\u5bf9 this \u8fdb\u884c\u989d\u5916\u7684\u6dfb\u52a0.","title":"\u865a\u51fd\u6570\u8868\u6307\u9488\u4e3a\u4ec0\u4e48\u653e\u5728\u5f00\u5934\uff1f"},{"location":"cs/pl/c_cpp/basic/#stlhash","text":"hashtable \u662f\u91c7\u7528\u5f00\u94fe\u6cd5\u6765\u5b8c\u6210\u7684\uff0c\uff08vector + list\uff09 \u5e95\u5c42\u952e\u503c\u5e8f\u5217\u91c7\u7528 vector \u5b9e\u73b0\uff0cvector \u7684\u5927\u5c0f\u53d6\u7684\u662f\u8d28\u6570\uff0c\u4e14\u76f8\u90bb\u8d28\u6570\u7684\u5927\u5c0f\u7ea6\u4e3a 2 \u500d\u5173\u7cfb\uff0c\u5f53\u521b\u5efa hashtable \u65f6\uff0c\u4f1a\u81ea\u52a8\u9009\u53d6\u4e00\u4e2a\u63a5\u8fd1\u6240\u521b\u5efa\u5927\u5c0f\u7684\u8d28\u6570\u4f5c\u4e3a\u5f53\u524d hashtable \u7684\u5927\u5c0f\uff1b \u5bf9\u5e94\u952e\u7684\u503c\u5e8f\u5217\u91c7\u7528\u5355\u5411 list \u5b9e\u73b0\uff1b \u5f53 hashtable \u7684\u952e vector \u7684\u5927\u5c0f\u91cd\u65b0\u5206\u914d\u7684\u65f6\u5019\uff0c\u539f\u952e\u7684\u503c list \u4e5f\u4f1a\u91cd\u65b0\u5206\u914d\uff0c\u56e0\u4e3a vector \u91cd\u5efa\u4e86\u76f8\u5f53\u4e8e\u952e\u589e\u52a0\u4e86\uff0c\u90a3\u4e48\u539f\u6765\u7684\u503c\u5bf9\u5e94\u7684\u952e\u53ef\u80fd\u5c31\u4e0d\u540c\u4e8e\u539f\u6765\u5206\u914d\u7684\u952e\uff0c\u8fd9\u6837\u5c31\u9700\u8981\u91cd\u65b0\u786e\u5b9a\u503c\u7684\u952e\u3002","title":"STL\u6e90\u7801\u4e2dhash\u7684\u8868\u73b0"},{"location":"cs/pl/c_cpp/basic/#_38","text":"C++\u51fd\u6570\u91cd\u8f7d\u5e95\u5c42\u5b9e\u73b0\u539f\u7406\u662fC++\u5229\u7528\u503e\u8f67\u6280\u672f\uff0c\u6765\u6539\u540d\u51fd\u6570\u540d\uff0c\u533a\u5206\u53c2\u6570\u4e0d\u540c\u7684\u540c\u540d\u51fd\u6570\u3002 C++\u4e2d\uff0c\u8fd9\u4e09\u4e2a\u51fd\u6570\u5982\u679c\u5728\u4e3b\u51fd\u6570\u4e2d\u88ab\u8c03\u7528\u9009\u62e9\u54ea\u4e00\u4e2a\uff0c\u7531\u7f16\u8bd1\u5668\u81ea\u8eab\u51b3\u5b9a\u3002 \u6e90\u6587\u4ef6\u901a\u8fc7\u7f16\u8bd1\u540e\uff0c\u5c06\u76f8\u540c\u51fd\u6570\u540d\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u683c\u5f0f\uff0c\u6539\u53d8\u6210\u53ef\u4ee5\u533a\u5206\u7684\uff0c\u53bb\u9664\u4e86\u51fd\u6570\u5728\u8c03\u7528\u65f6\u7684\u4e8c\u4e49\u6027\uff0c\u4ece\u800c\u5b9e\u73b0\u51fd\u6570\u7684\u91cd\u8f7d\u3002 \u7ed3\u5408extern \"C\".","title":"\u91cd\u8f7d\u5982\u4f55\u5b9e\u73b0"},{"location":"cs/pl/c_cpp/basic/#_39","text":"C++\u5728\u9762\u5411\u5bf9\u8c61\u7f16\u7a0b\u4e2d\uff0c\u5b58\u5728\u7740\u9759\u6001\u7ed1\u5b9a\u548c\u52a8\u6001\u7ed1\u5b9a\u7684\u5b9a\u4e49\uff0c\u672c\u8282\u5373\u662f\u4e3b\u8981\u8bb2\u8ff0\u8fd9\u4e24\u70b9\u533a\u5206\u3002 \u6211\u662f\u5728\u4e00\u4e2a\u7c7b\u7684\u7ee7\u627f\u4f53\u7cfb\u4e2d\u5206\u6790\u7684\uff0c\u56e0\u6b64\u4e0b\u9762\u6240\u8bf4\u7684\u5bf9\u8c61\u4e00\u822c\u5c31\u662f\u6307\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b\u3002 \u9996\u5148\u6211\u4eec\u9700\u8981\u660e\u786e\u51e0\u4e2a\u540d\u8bcd\u5b9a\u4e49\uff1a \u9759\u6001\u7c7b\u578b\uff1a\u5bf9\u8c61\u5728\u58f0\u660e\u65f6\u91c7\u7528\u7684\u7c7b\u578b\uff0c\u5728\u7f16\u8bd1\u671f\u65e2\u5df2\u786e\u5b9a\uff1b \u52a8\u6001\u7c7b\u578b\uff1a\u901a\u5e38\u662f\u6307\u4e00\u4e2a\u6307\u9488\u6216\u5f15\u7528\u76ee\u524d\u6240\u6307\u5bf9\u8c61\u7684\u7c7b\u578b\uff0c\u662f\u5728\u8fd0\u884c\u671f\u51b3\u5b9a\u7684\uff1b \u9759\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u9759\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u9759\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff1b \u52a8\u6001\u7ed1\u5b9a\uff1a\u7ed1\u5b9a\u7684\u662f\u52a8\u6001\u7c7b\u578b\uff0c\u6240\u5bf9\u5e94\u7684\u51fd\u6570\u6216\u5c5e\u6027\u4f9d\u8d56\u4e8e\u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\uff0c\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u9759\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u7f16\u8bd1\u671f\uff0c\u52a8\u6001\u7ed1\u5b9a\u53d1\u751f\u5728\u8fd0\u884c\u671f\uff1b \u5bf9\u8c61\u7684\u52a8\u6001\u7c7b\u578b\u53ef\u4ee5\u66f4\u6539\uff0c\u4f46\u662f\u9759\u6001\u7c7b\u578b\u65e0\u6cd5\u66f4\u6539\uff1b \u8981\u60f3\u5b9e\u73b0\u52a8\u6001\uff0c\u5fc5\u987b\u4f7f\u7528\u52a8\u6001\u7ed1\u5b9a\uff1b \u5728\u7ee7\u627f\u4f53\u7cfb\u4e2d\u53ea\u6709\u865a\u51fd\u6570\u4f7f\u7528\u7684\u662f\u52a8\u6001\u7ed1\u5b9a\uff0c\u5176\u4ed6\u7684\u5168\u90e8\u662f\u9759\u6001\u7ed1\u5b9a\uff1b \u6ce8\u610f\uff1a\u7edd\u5bf9\u4e0d\u8981\u91cd\u65b0\u5b9a\u4e49\u4e00\u4e2a\u7ee7\u627f\u800c\u6765\u7684virtual\u51fd\u6570\u7684\u7f3a\u7701\u53c2\u6570\u503c\uff0c\u56e0\u4e3a\u7f3a\u7701\u53c2\u6570\u503c\u90fd\u662f\u9759\u6001\u7ed1\u5b9a\uff08\u4e3a\u4e86\u6267\u884c\u6548\u7387\uff09\uff0c\u800cvirtual\u51fd\u6570\u5374\u662f\u52a8\u6001\u7ed1\u5b9a\u3002","title":"\u52a8\u6001\u7ed1\u5b9a\u548c\u9759\u6001\u7ed1\u5b9a\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#c_9","text":"C++\u4e2d\u7684\u6784\u9020\u51fd\u6570\u53ef\u4ee5\u5206\u4e3a4\u7c7b\uff1a \uff081\uff09\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u3002\u4ee5Student\u7c7b\u4e3a\u4f8b\uff0c\u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u7684\u539f\u578b\u4e3a Student(\uff09\uff1b//\u6ca1\u6709\u53c2\u6570 \uff082\uff09\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570 Student(int num\uff0cint age\uff09\uff1b//\u6709\u53c2\u6570 \uff083\uff09\u590d\u5236\uff08\u62f7\u8d1d\uff09\u6784\u9020\u51fd\u6570 Student(Student&\uff09\uff1b//\u5f62\u53c2\u662f\u672c\u7c7b\u5bf9\u8c61\u7684\u5f15\u7528 \uff084\uff09\u8f6c\u6362\u6784\u9020\u51fd\u6570 Student(int r) \uff1b//\u5f62\u53c2\u662f\u5176\u4ed6\u7c7b\u578b\u53d8\u91cf\uff0c\u4e14\u53ea\u6709\u4e00\u4e2a\u5f62\u53c2 \u9ed8\u8ba4\u6784\u9020\u51fd\u6570\u548c\u521d\u59cb\u5316\u6784\u9020\u51fd\u6570\u5728\u5b9a\u4e49\u7c7b\u7684\u5bf9\u8c61\u7684\u65f6\u5019\uff0c\u5b8c\u6210\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u5de5\u4f5c\u3002 \u590d\u5236\u6784\u9020\u51fd\u6570\u7528\u4e8e\u590d\u5236\u672c\u7c7b\u7684\u5bf9\u8c61\u3002 \u8f6c\u6362\u6784\u9020\u51fd\u6570\u7528\u4e8e\u5c06\u5176\u4ed6\u7c7b\u578b\u7684\u53d8\u91cf\uff0c\u9690\u5f0f\u8f6c\u6362\u4e3a\u672c\u7c7b\u5bf9\u8c61\u3002","title":"C++\u7684\u51e0\u79cd\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_40","text":"\u5f53\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u91cc\u9700\u8981\u6ce8\u610f\u4e24\u4e2a\u5173\u952e\u70b9\uff0c\u5206\u522b\u662f \u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f \u548c \u521d\u59cb\u5316\u5bf9\u8c61","title":"\u4ec0\u4e48\u65f6\u5019\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/c_cpp/basic/#_41","text":"\u521d\u59cb\u5316\u5bf9\u8c61\u662f\u6307\uff0c\u4e3a\u5bf9\u8c61\u5206\u914d\u5185\u5b58\u540e\u7b2c\u4e00\u6b21\u5411\u5185\u5b58\u4e2d\u586b\u5145\u6570\u636e\uff0c\u8fd9\u4e2a\u8fc7\u7a0b\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u5bf9\u8c61\u88ab\u521b\u5efa\u540e\u5fc5\u987b\u7acb\u5373\u521d\u59cb\u5316\u3002\u4e5f\u5c31\u662f\u8bf4\u53ea\u8981\u521b\u5efa\u5bf9\u8c61\u5c31\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\u3002","title":"\u521d\u59cb\u5316\u5bf9\u8c61"},{"location":"cs/pl/c_cpp/basic/#_42","text":"\u521d\u59cb\u5316\u548c\u8d4b\u503c\u90fd\u662f\u5c06\u6570\u636e\u5199\u5165\u5185\u5b58\u4e2d\uff0c\u4ece\u8868\u9762\u770b\uff0c\u521d\u59cb\u5316\u5728\u5f88\u591a\u65f6\u5019\u90fd\u662f\u4ee5\u590d\u5236\u7684\u65b9\u5f0f\u6765\u5b9e\u73b0\u7684\uff0c\u5f88\u5bb9\u6613\u5f15\u8d77\u6df7\u6dc6\u3002\u5728\u5b9a\u4e49\u7684\u540c\u65f6\u8fdb\u884c\u590d\u5236\u53eb\u505a\u521d\u59cb\u5316\uff0c\u5b9a\u4e49\u5b8c\u6210\u4ee5\u540e\u518d\u8d4b\u503c(\u4e0d\u7ba1\u5b9a\u4e49\u7684\u65f6\u5019\u6709\u6ca1\u6709\u8d4b\u503c)\u5c31\u53eb\u505a\u8d4b\u503c\u3002\u521d\u59cb\u5316\u53ea\u80fd\u7531\u4e00\u6b21\uff0c\u8d4b\u503c\u53ef\u4ee5\u7531\u5f88\u591a\u6b21\u3002","title":"\u521d\u59cb\u5316\u548c\u8d4b\u503c\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_43","text":"\u5982\u679c\u7528\u4f20\u9012\u8fdb\u6765\u7684\u5b9e\u53c2\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u90a3\u4e48\u4f1a\u8c03\u7528\u666e\u901a\u7684\u6784\u9020\u51fd\u6570\u3002 \u5982\u679c\u7528\u73b0\u6709\u5bf9\u8c61\u7684\u6570\u636e\u6765\u521d\u59cb\u5316\u5bf9\u8c61\uff0c\u5c31\u4f1a\u8c03\u7528\u62f7\u8d1d\u6784\u9020\u51fd\u6570\uff0c\u8fd9\u5c31\u662f\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u521d\u59cb\u5316\u5bf9\u8c61\u3002","title":"\u521d\u59cb\u5316\u5bf9\u8c61\u65f6\u4f1a\u8c03\u7528\u6784\u9020\u51fd\u6570\uff0c\u4e0d\u540c\u7684\u521d\u59cb\u5316\u65b9\u5f0f\u4f1a\u8c03\u7528\u4e0d\u540c\u7684\u6784\u9020\u51fd\u6570\uff1a"},{"location":"cs/pl/c_cpp/basic/#_44","text":"\u5c06\u5176\u5b83\u5bf9\u8c61\u4f5c\u4e3a\u5b9e\u53c2\u3002 \u5728\u521b\u5efa\u5bf9\u8c61\u7684\u540c\u65f6\u8d4b\u503c\u3002 \u51fd\u6570\u7684\u5f62\u53c2\u4e3a\u7c7b\u7c7b\u578b\u3002 \u51fd\u6570\u8fd4\u56de\u503c\u4e3a\u7c7b\u7c7b\u578b(\u4e0e\u7f16\u8bd1\u5668\u6709\u5173\u4e0d\u7edd\u5bf9)","title":"\u4ee5\u62f7\u8d1d\u7684\u65b9\u5f0f\u6765\u521d\u59cb\u5316\u5bf9\u8c61\u7684\u51e0\u79cd\u60c5\u51b5\uff1a"},{"location":"cs/pl/c_cpp/basic/#cvector","text":"stl\u5bb9\u5668\u5305\u542b\u987a\u5e8f\u5bb9\u5668\u548c\u5173\u8054\u5bb9\u5668\u3002\u987a\u5e8f\u5bb9\u5668\u4e3b\u8981\u6709vector\uff0clist\uff0cdeque\uff0c\u5173\u8054\u5bb9\u5668\u4e3b\u8981\u662fpair\u3001set\u3001map\u3001multiset\u548cmultimap\uff0c\u6240\u4ee5\u603b\u5171\u7b97\u662f7\u79cd\u3002 \u6240\u8c13\u968f\u673a\u8bbf\u95ee\uff0c\u6211\u7684\u7406\u89e3\u662f\u6309\u7167\u6570\u7ec4\u7684\u65b9\u5f0f\u5728\u5185\u5b58\u4e2d\u987a\u5e8f\u5b58\u653e\uff0c\u53ea\u9700\u8981\u6839\u636e\u9996\u5730\u5740\u548c\u76f8\u5e94\u4e0b\u6807\u5c31\u80fd\u5bfb\u5740\u5230\u76f8\u5e94\u7684\u5143\u7d20\u3002 \u6240\u4ee5\u9010\u4e2a\u5206\u6790\u5982\u4e0b\uff1a vector\u7684\u5b9e\u73b0\u539f\u7406\u662f\u6570\u7ec4\uff0c\u6240\u4ee5\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 list\u7684\u5b9e\u73b0\u539f\u7406\u662f\u53cc\u5411\u94fe\u8868\uff0c\u6240\u4ee5\u4e0d\u652f\u6301\u3002 deque\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7c7b\u4f3c\u6570\u7ec4\u7684\u53cc\u7aef\u961f\u5217\uff0c\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 pair\u662f\u4e2a\u4e8c\u5143\u7ec4\uff0c\u4e00\u5171\u5c31\u4e24\u4e2a\u503c\uff0c\u8c08\u4e0d\u4e0a\u968f\u673a\u8bbf\u95ee\u3002 set\u3001multiset\u3001map\u3001multimap\u7684\u5b9e\u73b0\u539f\u7406\u662f\u7ea2\u9ed1\u6811\uff0c\u4e0d\u652f\u6301\u968f\u673a\u8bbf\u95ee\u3002 \u6240\u4ee5\u5728\u4e0a\u8ff0\u4e03\u79cd\u5bb9\u5668\u4e2d\u53ea\u6709vector\u548cdeque\u4e24\u79cd\u662f\u652f\u6301\u968f\u673a\u8bbf\u95ee\u7684\u3002","title":"C++\u7684\u5bb9\u5668\u6bd4\u8f83\uff0c\u4e3a\u4ec0\u4e48vector\u53ef\u4ee5\u968f\u673a\u8bbf\u95ee"},{"location":"cs/pl/c_cpp/basic/#vector_1","text":"vector\u7684\u5927\u5c0f\u6709\u4e24\u4e2a\u53d8\u91cf\uff0c\u4e00\u4e2asize\uff0c\u4e00\u4e2acapacity\uff0csize\u662fvector\u5b9e\u9645\u5bb9\u91cf\uff0ccapacity\u662fvector\u6700\u5927\u5bb9\u91cf\uff0c\u5f53size=capacity\u65f6\uff0cvector\u9700\u8981\u8003\u8651\u6269\u5bb9\uff0cvector\u4f1a\u6269\u5bb9\u81f3\u5f53\u524d\u7a7a\u95f4\u76842\uff08GCC\u4e0b\uff09/1.5\uff08MSVC\uff09","title":"vector\u5e95\u5c42\u6570\u7ec4\u5927\u5c0f\u5206\u914d"},{"location":"cs/pl/c_cpp/basic/#_45","text":"\u4ee5\u4e24\u500d\u7a7a\u95f4\u4e3a\u4f8b\uff0c\u5f53\u6269\u5bb9\u6b21\u6570\u4e3a30\u6b21\u5de6\u53f3\u65f6\uff0cvector\u7684\u7a7a\u95f4\u8fbe\u52301e9\uff0c\u800c\u901a\u5e38\u6bcf\u6b21\u6269\u5bb9\uff0c\u90fd\u4f1a\u9700\u8981\u5728\u5806\u4e0a\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\uff0c\u9700\u8981\u91cd\u65b0\u79fb\u52a8\u6574\u4e2a\u6570\u7ec4\u5230\u65b0\u7684\u7a7a\u95f4\u3002\u7531\u6b64\uff0c\u53ef\u4ee5\u5f97\u51fa\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u7684\u6b21\u6570\u8d8a\u5c11\u8d8a\u597d\uff0c\u540c\u65f6\u4e5f\u8981\u8282\u7ea6\u5185\u5b58\u7684\u5360\u7528\uff0c\u56e0\u4e3a\u6309\u7167\u6b64\u589e\u957f\uff0c\u5176\u5185\u5b58\u7684\u91cd\u590d\u7684\u5206\u914d\u6b21\u6570\u59cb\u7ec8\u5728\u5e38\u6570\u8303\u56f4\u5185\uff0c\u6240\u4ee5\u91c7\u7528\u4e0a\u8ff0\u7684\u6269\u5bb9\u65b9\u5f0f\u3002","title":"\u4e3a\u4ec0\u4e48\u8fd9\u6837\u6269\u5bb9"},{"location":"cs/pl/c_cpp/basic/#msvc15gcc2_1","text":"\u597d\u5904\uff1a\u56e0\u4e3a2\u500d\u7a7a\u95f4\u4e0b\uff0c\u4efb\u610f\u4e00\u4e2a\u7a7a\u95f4\u90fd\u5927\u4e8e\u4e4b\u524d\u6240\u6709\u5206\u914d\u8fc7\u7684\u7a7a\u95f4\u4e4b\u548c\uff0c\u8fd9\u5c31\u610f\u5473\u7740\u6bcf\u6b21\u8fdb\u884c\u6269\u5bb9\u7684\u65f6\u5019\u90fd\u9700\u8981\u5206\u914d\u4e00\u4e2a\u65b0\u7684\u7a7a\u95f4\u3002\u800c\u57281.5\u500d\u4e0b\uff0c\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u4e4b\u524d\u7684\u7a7a\u95f4\uff0c1.5\u500d\u76f8\u5bf9\u4e8e\u4f1a\u8282\u7ea6\u5185\u5b58 \u574f\u5904\uff1a1.5\u500d\u4e0b\u7684\u91cd\u65b0\u5206\u914d\u6b21\u6570\u66f4\u591a\uff0c\u4e5f\u5c31\u610f\u5473\u7740\u9700\u8981\u66f4\u591a\u7684\u91cd\u65b0\u5206\u914d\u7a7a\u95f4\u548c\u91cd\u65b0\u79fb\u52a8\u7684\u6b21\u6570\uff0c\u66f4\u52a0\u6d6a\u8d39\u65f6\u95f4","title":"MSVC\u4e0b\u76841.5\u500d\u7a7a\u95f4\u76f8\u5bf9\u4e8eGCC\u4e0b\u76842\u500d\u6709\u4ec0\u4e48\u597d\u5904\u548c\u574f\u5904"},{"location":"cs/pl/c_cpp/basic/#cgopython","text":"","title":"C++\u3001go\u3001python\u7684\u533a\u522b"},{"location":"cs/pl/c_cpp/basic/#_46","text":"C++\u8fd9\u79cd\u4e0e\u5e73\u53f0\u548c\u7f16\u8bd1\u5668\u76f8\u5173\uff0c\u5f88\u96be\u6709\u8bed\u8a00\u7ea7\u522b\u7684\u5305\u7ba1\u7406\u5668\uff0c \u4e00\u822c\u662f\u5404\u4e2a\u5f00\u53d1\u73af\u5883\u6301\u6709\u5404\u81ea\u7684\u590d\u7528\u7ba1\u7406\uff0c\u6bd4\u5982 linux \u7684 apt-get, deb, yum\uff0c\u5404\u79cdlib header dev\u5305\u53ef\u4ee5\u901a\u8fc7\u5176\u5b89\u88c5\u7684\u3002\u4e00\u822c\u90fd\u9700\u8981CMake\u6216\u8005Makefile\u8fdb\u884c\u5de5\u7a0b\u7ba1\u7406\uff0c\u6240\u4ee5\u6709\u76f8\u5e94\u7684\u5b66\u4e60\u6210\u672c\u3002 Python\u6709\u4e30\u5bcc\u7684\u5305\u7ba1\u7406\u5668\uff0c\u6bd4\u5982\uff0cdistutils\uff0csetuptools, \u8fd8\u6709\u8f83\u4e3a\u6d41\u884c\u7684pip\uff0c pip \u53ef\u4ee5\u5229\u7528 requirments.txt \u6765\u5b89\u88c5\u4f9d\u8d56\u7684\u5e93\u6587\u4ef6\u3002 GO\u65e9\u671f\u7684\u5305\u7ba1\u7406\u4e5f\u662f\u4e3a\u4eba\u8bdf\u75c5\uff0c\u4e0d\u8fc71.11 \u7248\u672c\u63a8\u51fa modules \u673a\u5236\uff0c\u8ba9go\u8bed\u8a00\u5305\u7ba1\u7406\u53d8\u5f97\u66f4\u65b9\u4fbf\u7b80\u5355\uff0c\u8fd8\u652f\u6301GoProxy\uff0creplace\uff0cSubCommand\u7b49\u9ad8\u7ea7\u7279\u6027\u3002","title":"\u5305\u7ba1\u7406"},{"location":"cs/pl/c_cpp/basic/#_47","text":"\u5728\u8bed\u6cd5\u65b9\u9762\uff0cC++\u548cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u8f83\u4e3a\u76f8\u4f3c\uff0c\u4f46\u662fGO\u8bed\u8a00\u8bed\u6cd5\u7b80\u6d01\uff0c\u4e0d\u9700\u8981\u7a0b\u5e8f\u5458\u7ba1\u7406\u5185\u5b58\uff0c\u6709\u4e30\u5bcc\u7684API\u53ef\u8c03\u7528\uff0c\u4e5f\u63d0\u4f9b\u4e86\u5207\u7247\uff0cmap\u7b49\u7075\u6d3b\u7684\u6570\u636e\u7c7b\u578b\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\u5728\u8bed\u6cd5\u65b9\u9762\u4ee5\u4f18\u96c5\u8457\u79f0\uff0c\u66f4\u4e3a\u7b80\u5355\u3002Python \u793e\u533a\u63d0\u4f9b\u4e86\u5927\u91cf\u7684\u7b2c\u4e09\u65b9\u6a21\u5757\uff0c\u4f7f\u7528\u65b9\u5f0f\u4e0e\u6807\u51c6\u5e93\u7c7b\u4f3c\u3002\u5b83\u4eec\u7684\u529f\u80fd\u8986\u76d6 \u79d1\u5b66\u8ba1\u7b97\u3001\u4eba\u5de5\u667a\u80fd\u3001\u673a\u5668\u5b66\u4e60\u3001Web \u5f00\u53d1\u3001\u6570\u636e\u5e93\u63a5\u53e3\u591a\u4e2a\u9886\u57df\u3002","title":"\u8bed\u6cd5"},{"location":"cs/pl/c_cpp/basic/#_48","text":"\u5728\u6027\u80fd\u65b9\u9762\uff0cPython\u4f5c\u4e3a\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\uff0c\u5728\u6027\u80fd\u65b9\u9762\u4e0eC++\u548cGO\u8bed\u8a00\u6709\u5f88\u5927\u5dee\u8ddd\uff0c\u5e76\u884c\u7f16\u7a0b\u8fd9\u4e00\u5757\u56e0\u4e3aGIL\u7684\u5b58\u5728,Python\u5f88\u96be\u5145\u5206\u5229\u7528\u591a\u6838CPU\u7684\u4f18\u52bf\u3002GO\u7684\u8fd0\u884c\u6548\u7387\u51e0\u4e4e\u53ef\u4ee5\u5ab2\u7f8eC/C++\uff0c\u800c\u4e14\u5929\u7136\u652f\u6301\u5e76\u53d1\u7f16\u7a0b\uff0c\u53ef\u4ee5\u901a\u8fc7go\u5173\u952e\u5b57\u521b\u5efaN\u4e2agoroutine\uff08\u4e00\u79cd\u7528\u6237\u6001\u7ebf\u7a0b\uff09\u6765\u5b9e\u73b0\u5e76\u53d1\uff0c\u540c\u65f6\u63d0\u4f9b\u591a\u4e2agoroutine\u7684\u540c\u6b65\u673a\u5236\u3002","title":"\u6027\u80fd"},{"location":"cs/pl/c_cpp/basic/#_49","text":"\u7efc\u4e0a\u6240\u8bc9\uff0cC++\u5728\u6027\u80fd\u65b9\u9762\u5f88\u9ad8\uff0c\u4f46\u662f\u5f00\u53d1\u6210\u672c\u4e5f\u6bd4\u8f83\u9ad8\u3002Python\u5f00\u53d1\u7b80\u5355\uff0c\u4f46\u662f\u6027\u80fd\u8f83\u4f4e\uff0c\u4f7f\u7528\u4e0e\u4e00\u4e9b\u5bf9\u6027\u80fd\u6ca1\u8981\u6c42\u7684\u670d\u52a1\u548c\u5de5\u5177\u5f00\u53d1\u3002\u76f8\u5bf9\u6765\u8bf4\uff0cGO\u8bed\u8a00\u7684\u8bed\u6cd5\u7b80\u5355\uff0c\u5f00\u53d1\u6210\u672c\u4f4e\uff0c\u800c\u4e14\u6548\u7387\u4e5f\u8fdc\u9ad8\u4e8e\u89e3\u91ca\u578b\u8bed\u8a00\uff0c\u9002\u5408\u5927\u90e8\u5206\u7684\u670d\u52a1\u5f00\u53d1\u3002","title":"\u5c0f\u7ed3"},{"location":"cs/pl/c_cpp/basic/#lambda","text":"\u503c\u6355\u83b7 \u4e0e\u4f20\u503c\u53c2\u6570\u7c7b\u4f3c\uff0c\u8981\u6c42\u503c\u6355\u83b7\u7684\u524d\u63d0\u662f \u53d8\u91cf\u53ef\u4ee5\u62f7\u8d1d \u4e0e\u4f20\u503c\u53c2\u6570\u4e0d\u540c\u7684\u662f\uff0c\u88ab\u6355\u83b7\u7684\u53d8\u91cf\u662f\u5728lambda\u521b\u5efa\u65f6\u62f7\u8d1d\uff0c\u800c\u4e0d\u662f\u5728\u8c03\u7528\u65f6\u62f7\u8d1d \u5f15\u7528\u6355\u83b7 \u786e\u4fdd\u88ab\u5f15\u7528\u7684\u5bf9\u8c61\u5728lambda\u8868\u8fbe\u5f0f\u6267\u884c\u65f6\u8fd8\u662f\u5b58\u5728\u7684 \u9690\u5f0f\u6355\u83b7 \u5728\u6355\u83b7\u5217\u8868\u4e2d\u4f7f\u7528 &\u6216 = \u5373\u8868\u793a\u9690\u5f0f\u6355\u83b7\uff0c \u6307\u793a\u7f16\u8bd1\u5668\u81ea\u52a8\u63a8\u65ad\u6355\u83b7\u5217\u8868 & \u8868\u793a\u91c7\u7528 \u5f15\u7528\u6355\u83b7 \u7684\u65b9\u5f0f = \u8868\u793a\u91c7\u7528 \u503c\u6355\u83b7 \u7684\u65b9\u5f0f","title":"Lambda\u8868\u8fbe\u5f0f\u7684\u53c2\u6570\u6355\u83b7\u6709\u54ea\u51e0\u79cd\u60c5\u51b5"},{"location":"cs/pl/c_cpp/basic/#reference","text":"\u73b0\u4ee3C++32\u8bb2 C++\u9762\u8bd5\u8d44\u6599 \u7ec6\u8bfb Effective C++ cppreference","title":"Reference"},{"location":"cs/pl/c_cpp/function/","text":"C++\u5404\u79cd\u51fd\u6570\u4f7f\u7528 \u00b6 \u7ea6 286 \u4e2a\u5b57 28 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9bC++\u51fd\u6570\u7684\u4f7f\u7528\u548c\u6269\u5c55\u7b49 std::string \u00b6 std::string::substr \u00b6 string substr ( size_t pos = 0 , size_t len = npos ) const ; \u8fd4\u56de\u4e00\u4e2a\u65b0\u5efa\u7684 \u521d\u59cb\u5316\u4e3astring\u5bf9\u8c61\u7684\u5b50\u4e32\u7684\u62f7\u8d1dstring\u5bf9\u8c61\u3002\u5b50\u4e32\u662f\uff0c\u5728\u5b57\u7b26\u4f4d\u7f6epos\u5f00\u59cb\uff0c\u8de8\u8d8alen\u4e2a\u5b57\u7b26\uff08\u6216\u76f4\u5230\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\uff0c\u4ee5\u5148\u5230\u8005\u4e3a\u51c6\uff09\u5bf9\u8c61\u7684\u90e8\u5206\u3002 \u5e94\u7528 // string::substr #include #include int main () { std :: string str = \"We think in generalities, but we live in details.\" ; // (quoting Alfred N. Whitehead) std :: string str2 = str . substr ( 3 , 5 ); // \"think\" std :: size_t pos = str . find ( \"live\" ); // position of \"live\" in str std :: string str3 = str . substr ( pos ); // get from \"live\" to the end std :: cout << str2 << ' ' << str3 << '\\n' ; return 0 ; } std::string::find \u00b6 size_t find ( const string & str , size_t pos = 0 ) const noexcept ; size_t find ( const char * s , size_t pos = 0 ) const ; size_t find ( const char * s , size_t pos , size_type n ) const ; size_t find ( char c , size_t pos = 0 ) const noexcept ; \u8fd4\u56de\u503c\u7c7b\u578b\u662f std::string::size_type (size_t) \uff0c \u5bf9\u5e94\u7684\u662f\u67e5\u627e\u5bf9\u8c61\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\uff08\u4ece0\u5f00\u59cb\uff09\uff0c\u5982\u679c\u672a\u67e5\u627e\u5230\uff0c\u8be5\u8fd4\u56de\u503c\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u6570\u636e\uff084294967295\uff09\uff0c\u5224\u65ad\u65f6\u4e0e std::string::npos \u8fdb\u884c\u5bf9\u6bd4\u3002 \u5efa\u8bae\u4f7f\u7528 size_type \uff0c\u8fd9\u6837\u53ef\u4ee5\u9002\u5e94\u4e0d\u540c\u7684\u5e73\u53f0\u3002\u56e0\u4e3a int \u7c7b\u578b\u7684\u5927\u5c0f\u4f1a\u6839\u636e\u4e0d\u540c\u5e73\u53f0\u800c\u4e0d\u540c\u3002 \u5e94\u7528 std :: string str ( \"abcdefg\" ); std :: string :: size_type pos = str . find ( \"abc\" ); if ( pos != std :: string :: npos ) { cout << \"Not find\" << endl ; } // or std :: string str ( \"abcdefg\" ); if ( str . find ( \"abc\" ) != std :: string :: npos ) { cout << \"Not find\" << endl ; } \u6269\u5c55 s.find(t) \u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.rfind(t) \u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_last_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_not_of(t) \u7b2c\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e s.find_last_not_of(t) \u6700\u540e\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e","title":"C++ \u5404\u79cd\u51fd\u6570\u4f7f\u7528"},{"location":"cs/pl/c_cpp/function/#c","text":"\u7ea6 286 \u4e2a\u5b57 28 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u8fd9\u91cc\u5f52\u6863\u4e00\u4e9bC++\u51fd\u6570\u7684\u4f7f\u7528\u548c\u6269\u5c55\u7b49","title":"C++\u5404\u79cd\u51fd\u6570\u4f7f\u7528"},{"location":"cs/pl/c_cpp/function/#stdstring","text":"","title":"std::string"},{"location":"cs/pl/c_cpp/function/#stdstringsubstr","text":"string substr ( size_t pos = 0 , size_t len = npos ) const ; \u8fd4\u56de\u4e00\u4e2a\u65b0\u5efa\u7684 \u521d\u59cb\u5316\u4e3astring\u5bf9\u8c61\u7684\u5b50\u4e32\u7684\u62f7\u8d1dstring\u5bf9\u8c61\u3002\u5b50\u4e32\u662f\uff0c\u5728\u5b57\u7b26\u4f4d\u7f6epos\u5f00\u59cb\uff0c\u8de8\u8d8alen\u4e2a\u5b57\u7b26\uff08\u6216\u76f4\u5230\u5b57\u7b26\u4e32\u7684\u7ed3\u5c3e\uff0c\u4ee5\u5148\u5230\u8005\u4e3a\u51c6\uff09\u5bf9\u8c61\u7684\u90e8\u5206\u3002 \u5e94\u7528 // string::substr #include #include int main () { std :: string str = \"We think in generalities, but we live in details.\" ; // (quoting Alfred N. Whitehead) std :: string str2 = str . substr ( 3 , 5 ); // \"think\" std :: size_t pos = str . find ( \"live\" ); // position of \"live\" in str std :: string str3 = str . substr ( pos ); // get from \"live\" to the end std :: cout << str2 << ' ' << str3 << '\\n' ; return 0 ; }","title":"std::string::substr"},{"location":"cs/pl/c_cpp/function/#stdstringfind","text":"size_t find ( const string & str , size_t pos = 0 ) const noexcept ; size_t find ( const char * s , size_t pos = 0 ) const ; size_t find ( const char * s , size_t pos , size_type n ) const ; size_t find ( char c , size_t pos = 0 ) const noexcept ; \u8fd4\u56de\u503c\u7c7b\u578b\u662f std::string::size_type (size_t) \uff0c \u5bf9\u5e94\u7684\u662f\u67e5\u627e\u5bf9\u8c61\u5728\u5b57\u7b26\u4e32\u4e2d\u7684\u4f4d\u7f6e\uff08\u4ece0\u5f00\u59cb\uff09\uff0c\u5982\u679c\u672a\u67e5\u627e\u5230\uff0c\u8be5\u8fd4\u56de\u503c\u662f\u4e00\u4e2a\u5f88\u5927\u7684\u6570\u636e\uff084294967295\uff09\uff0c\u5224\u65ad\u65f6\u4e0e std::string::npos \u8fdb\u884c\u5bf9\u6bd4\u3002 \u5efa\u8bae\u4f7f\u7528 size_type \uff0c\u8fd9\u6837\u53ef\u4ee5\u9002\u5e94\u4e0d\u540c\u7684\u5e73\u53f0\u3002\u56e0\u4e3a int \u7c7b\u578b\u7684\u5927\u5c0f\u4f1a\u6839\u636e\u4e0d\u540c\u5e73\u53f0\u800c\u4e0d\u540c\u3002 \u5e94\u7528 std :: string str ( \"abcdefg\" ); std :: string :: size_type pos = str . find ( \"abc\" ); if ( pos != std :: string :: npos ) { cout << \"Not find\" << endl ; } // or std :: string str ( \"abcdefg\" ); if ( str . find ( \"abc\" ) != std :: string :: npos ) { cout << \"Not find\" << endl ; } \u6269\u5c55 s.find(t) \u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.rfind(t) \u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u7b2c\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_last_of(t) \u4efb\u4f55\u4e00\u4e2a\u5b57\u7b26\u6700\u540e\u4e00\u6b21\u51fa\u73b0\u7684\u4f4d\u7f6e s.find_first_not_of(t) \u7b2c\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e s.find_last_not_of(t) \u6700\u540e\u4e00\u4e2a\u4e0d\u5728t\u4e2d\u7684\u5b57\u7b26\u6240\u5728\u4f4d\u7f6e","title":"std::string::find"},{"location":"cs/pl/c_cpp/stl/","text":"STL \u00b6 \u7ea6 1006 \u4e2a\u5b57 87 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f STL\u7b80\u79f0\u6807\u51c6\u6a21\u7248\u5e93\uff0c\u88ab\u5bb9\u7eb3\u5728C++\u6807\u51c6\u7a0b\u5e8f\u5e93\uff0c\u5305\u542b\u4e86\u8bb8\u591a\u57fa\u672c\u6570\u636e\u7ed3\u6784\u548c\u57fa\u672c\u7b97\u6cd5\uff0c\u4f7f\u7a0b\u5e8f\u5458\u5199\u8d77\u6765\u5f97\u5fc3\u5e94\u624b\u3002 \u4e3a\u4ec0\u4e48\u4f7f\u7528STL \u00b6 \u5728\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u4e2d\u4f1a\u4f7f\u7528\u5230\u5806\u3001\u6808\u3001\u961f\u5217\u3001\u94fe\u8868\u7b49\u4e00\u4e9b\u57fa\u672c\u7684\u7b97\u6cd5\uff0c\u800c\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u57fa\u672c\u7b97\u6cd5\u5199\u8d77\u6765\u5341\u5206\u7e41\u7410\uff0c\u5982\u679c\u4e0d\u60f3\u5199\u8fd9\u4e9b\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u8003\u8651\u4e00\u4e0bSTL\u4e86\u3002 \u4f46\u662f\u4e0d\u8981\u592a\u8fc7\u4e8e\u4f9d\u8d56STL\uff01 STL\u57fa\u672c\u6982\u5ff5 \u00b6 \u8981\u4f7f\u7528STL\uff0c\u9700\u8981\u7406\u89e3\u4ee5\u4e0b\u51e0\u4e2a\u57fa\u672c\u6982\u5ff5\uff1a \u5bb9\u5668 \uff1a\u662f\u5b58\u653e\u6570\u636e\u7684\u5730\u65b9\uff0c\u5e38\u89c1\u7684\u5bb9\u5668\u6709\uff1a\u94fe\u8868(list) \u6808(stack) \u52a8\u6001\u6570\u7ec4 (vector) \u53cc\u7aef\u961f\u5217(deque) \u961f\u5217(queue) \u6620\u5c04(map) \u8fed\u4ee3\u5668(iterator) \uff1a\u53ef\u4ee5\u7406\u89e3\u4e3aC\u8bed\u8a00\u91cc\u7684\u5730\u5740\uff0c\u800c\u8fed\u4ee3\u5668\u5c31\u662f\u5bb9\u5668\u7684\u4e00\u4e2a\u6307\u9488\uff0c\u5341\u5206\u91cd\u8981\uff01\uff01\uff01 \u7b97\u6cd5 \uff1a\u53ef\u4ee5\u5bf9\u5bb9\u5668\u91cc\u7684\u6570\u636e\u505a\u4e00\u4e9b\u57fa\u672c\u64cd\u4f5c\uff0c\u6bd4\u5982\u6392\u5e8f\uff0c\u627e\u6700\u5927\u5143\u7d20\u7b49\u7b49\u3002 STL\u4f7f\u7528\u524d\u7684\u521d\u59cb\u5316 \u00b6 \u9700\u8981\u5bf9\u5e94\u7684\u5934\u6587\u4ef6\uff0c\u6bd4\u5982list\u5c31\u9700\u8981 #include \uff0c\u4e14\u6ca1\u6709.h\uff0c\u6216\u8005\u6076\u5fc3\u7684\u4e07\u80fd\u5934 #include \u3002 \u6dfb\u52a0std\u547d\u540d\u7a7a\u95f4\uff08using namespace std;\uff09\u4e0d\u52a0\u7684\u8bdd\u540e\u9762\u53ef\u4ee5\u81ea\u5df1\u5199\u4e00\u5806\u3002\u3002\u3002 C++\u91ccSTL\u57fa\u672c\u5bb9\u5668\u8be6\u89e3 \u00b6 cmp\u7c7b \u00b6 \u901a\u8fc7\u81ea\u5b9a\u4e49cmp\u7c7b\u6765\u5b8c\u6210STL\u7684\u66f4\u52a0\u81ea\u7531\u7684\u8bbe\u7f6e struct cmp { bool operator ()( int a , int b ) { return a > b ; } }; sort \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u590d\u6742\u5ea6\u4e3aO(nlogn)\uff0c\u6bd4\u8f83\u6392\u5e8f\u7684\u6781\u9650\u4e86\u3002 bool cmp ( int a , int b ) { return a > b ; } int a [] = { 1 , 2 , 3 , 4 }; sort ( a , a + 4 , cmp ); sort\u91cc\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e00\u4e2a\u5730\u5740\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e8c\u4e2a\u5730\u5740\uff0c\u90fd\u4e09\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u5bf9\u6570\u7ec4\u6392\u5e8f\u7684\u51fd\u6570\uff0c\u4e0a\u9762\u7684cmp\u51fd\u6570\u662f\u4f7f\u6570\u7ec4\u5143\u7d20\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\u3002 sort\u662f\u4e0d\u7a33\u5b9a\u6392\u5e8f\uff0c\u5373\u5bf9\u4e8e\u76f8\u540c\u7684\u503c\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5176\u524d\u540e\u987a\u5e8f \u89e3\u51b3\u529e\u6cd5\uff1a 1\u3001\u589e\u52a0\u4e00\u4e2a index \u53d8\u91cf\uff0c\u5728\u503c\u76f8\u540c\u7684\u4f7f\u7528\u6bd4\u8f83 index \u503c\u7684\u5927\u5c0f 2\u3001\u4f7f\u7528 `stable_sort`` vector \u00b6 \u9700\u8981\u5934\u6587\u4ef6#include \u4e0d\u5b9a\u6570\u7ec4 vector < int > a , b ; a . push_back ( 1 ); // \u63a8\u5165\u4e00\u4e2a\u65b0\u7684\u503c\u5230\u6570\u7ec4\u6700\u540e a . pop_back (); // \u5220\u9664\u6570\u7ec4\u6700\u540e\u7684\u90a3\u4e2a\u503c a . front (); // \u6570\u7ec4\u5f00\u5934\u7684\u503c a . back (); // \u6570\u7ec4\u7ed3\u5c3e\u7684\u503c a = b ; // \u6570\u7ec4\u62f7\u8d1d a == b ; // \u6570\u7ec4\u662f\u5426\u76f8\u540c a [ 1 ]; // \u6570\u7ec4\u4e2d\u7b2c\u4e8c\u4e2a\u503c vector < int > a ; a . size (); // \u5bb9\u5668\u5185\u7684\u5143\u7d20\u4e2a\u6570 a . empty (); // \u5bb9\u5668\u662f\u5426\u4e3a\u7a7a // \u9664\u4e86queue\u548cstack\u5916\u901a\u7528\u7684\u65b9\u6cd5 a . clear (); // \u6e05\u7a7a\u5bb9\u5668\u5185\u7684\u6240\u6709\u5143\u7d20 a . begin (); // \u5bb9\u5668\u7684\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668 a . end (); // \u5bb9\u5668\u5c3e\u540e\u8fed\u4ee3\u5668 vector < int > v ; vector < int >:: iterator iter // \u5b9a\u4e49\u8fed\u4ee3\u5668 iter = v . begin (); // \u6570\u7ec4\u5934\u201c\u6307\u9488\u201d iter = v . end (); // \u6570\u7ec4\u5c3e\u201c\u6307\u9488\u201d ==list==: 1.\u9700\u8981\u5934\u6587\u4ef6#include l; 2.\u53cc\u5411\u94fe\u8868 list < int > l ; l . push_front ( 1 ); // \u63d2\u5165\u5143\u7d20\u5230\u5f00\u5934 l . pop_front (); // \u4ece\u5f00\u5934\u5220\u6389\u5143\u7d20 l . erase ( l . begin ()); // \u5220\u9664\u6307\u5b9a\u8fed\u4ee3\u5668\u5904\u7684\u5143\u7d20 l . insert ( l . begin (), 1 ); // \u5728\u6307\u5b9a\u8fed\u4ee3\u5668\u524d\u63d2\u5165\u5143\u7d20 l . reverse (); // \u53cd\u8f6c\u6574\u4e2a\u94fe\u8868 string \u00b6 \u4f2a\u5b57\u7b26\u4e32\uff1b \u5b9a\u4e49\uff1astring s; \u53ea\u80fd\u6d41\u8f93\u5165\u548c\u6d41\u8f93\u51fa\uff1b string a , b ; a [ 1 ] == 'a' ; // \u5f97\u5230\u67d0\u4e2a\u5b57\u7b26 a = b ; // \u5b57\u7b26\u4e32\u62f7\u8d1d a >= b ; // \u5b57\u5178\u5e8f\u6bd4\u8f83 a [ 1 ] = b [ 1 ]; // \u4fee\u6539\u67d0\u4e2a\u5b57\u7b26 a += b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = a + b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a += \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = b + \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 int len = a . lenth (); // \u5b57\u7b26\u4e32\u7684\u957f\u5ea6 queue \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u5148\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u94fe\u8868\u5b9e\u73b0\uff09 queue < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u961f\u5217 q . pop (); // \u63a8\u51fa\u961f\u5217\u5f00\u5934\u7684\u5143\u7d20 q . front (); // \u961f\u5217\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20 stack \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include ; \u540e\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u6570\u7ec4\u5b9e\u73b0\uff09 stack < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u5806\u6808 q . pop (); // \u63a8\u51fa\u5806\u6808\u6700\u540e\u7684\u5143\u7d20 q . top (); // \u5806\u6808\u7684\u6700\u540e\u7684\u5143\u7d20 pair \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \u8868\u793a\u4e00\u7ec4\u952e\u5bf9\uff08\u6709\u4e24\u4e2a\u53d8\u91cf\u7684\u7ed3\u6784\u4f53\uff09 pair < int , string > p ; p . first = 1 ; p . second = \"abc\" ; p = make_pair ( 1 , \"abc\" ); p = { 1 , \"abc\" }; pair < int , string > p [ 100 ]; sort ( p , p + 100 ); // \u9ed8\u8ba4\u4f18\u5148first\u4ece\u5c0f\u5230\u5927 // \u5982\u679cfirst\u76f8\u540c\u5219second\u4ece\u5c0f\u5230\u5927 pair\u4e0e\u5176\u4ed6\u7ed3\u6784\u5d4c\u5957 vector < pair < int , string > > vp ; queue < pair < float , int > > qp ; queue < pair < pair < int , int > , int > > qpp ; set \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b set \u4fdd\u5b58\u4e86\u4e0d\u53ef\u91cd\u590d\u7684\u5143\u7d20-- \u4e8c\u53c9\u641c\u7d22\u6811-\u7ea2\u9ed1\u6811 set < int > s ; s . insert ( 1 ); // \u63d2\u5165\u5230\u96c6\u5408\u4e2d s . erase ( 1 ); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . erase ( s . begin ()); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . count ( 1 ); // \u96c6\u5408\u4e2d\u662f\u5426\u5b58\u5728 s . find ( 1 ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u7531\u4e8eset\u662f\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 \u5185\u90e8\u6709\u5e8f(\u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927) \u6ca1\u6709\u91cd\u590d\u503c\uff0c\u5982\u679c\u51fa\u73b0\u91cd\u590d\u503c\u4f1a\u4e0d\u65ad\u88ab\u8986\u76d6 \u51e0\u4e4e\u6240\u6709\u64cd\u4f5c\u590d\u6742\u5ea6\u5747\u4e3a O(logN) \u4e0d\u53ef\u4ee5\u4fee\u6539\u8282\u70b9\u4e0a\u7684\u503c \u4fee\u6539\u64cd\u4f5c\u53ea\u80fd\u8fdb\u884c\u63d2\u5165\u548c\u5220\u9664\u4e24\u4e2a\u64cd\u4f5c set\u901a\u5e38\u4f5c\u7528\uff1a\u4fdd\u8bc1\u552f\u4e00\u6027\uff0c\u4fdd\u8bc1\u6570\u5217\u6709\u5e8f map \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \uff1b map\u5b57\u5178\uff08\u952e\u5bf9\u96c6\u5408\uff09 \u2014\u2014\u4e8c\u53c9\u641c\u7d22\u6811\u2014\u2014\u7ea2\u9ed1\u6811 map < char , int > m ; m . insert ( make_pair ( 'a' , 1 )); // \u52a0\u5165\u5b57\u5178 m . insert ({ 'a' , 1 }); // \u52a0\u5165\u5b57\u5178 m . erase ( 'a' ); // \u4ece\u5b57\u5178\u4e2d\u5220\u9664 m . count ( 'a' ); // \u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728 m . find ( 'a' ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u901a\u5e38\u79f0map\u7684first\u5143\u7d20\u4e3akey\uff0csecond\u5143\u7d20\u4e3avalue \u00b7\u7531\u4e8emap\u662f\u952e\u5bf9\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 1\u3001set\u7684\u5927\u90e8\u5206\u6027\u8d28\uff1b 2\u3001key\u4e0d\u80fd\u91cd\u590d\uff0c\u4e0d\u80fd\u4fee\u6539\uff0c\u53ea\u80fd\u5220\u9664\u548c\u6dfb\u52a0\uff1b 3\u3001\u5141\u8bb8value\u91cd\u590d\uff0c\u53ef\u4ee5\u5bf9value\u8fdb\u884c\u4fee\u6539\uff1b 4\u3001map\u662f\u6309\u7167key\u8fdb\u884c\u6392\u5e8f\u7684\uff1b 5\u3001key\u548cvalue\u4e00\u5b9a\u662f\u6210\u5bf9\u51fa\u73b0\u7684\uff1b 6\u3001map\u7684\u8fed\u4ee3\u5668\u6307\u5411\u7684\u5185\u5bb9\u662f\u4e00\u4e2apair\uff1b priority_queue \u00b6 \u9700\u8981\u5934\u6587\u4ef6 #include \u4f18\u5148\u961f\u5217--\u5806 priority_queue < int > prq ; prq . top (); // \u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . pop (); // \u5f39\u51fa\u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . push ( 1 ); // \u63a8\u5165\u5806 priority_queue\u9ed8\u8ba4\u4e3a\u6700\u5927\u5806\uff0c\u5373\u5806\u9876\u7684\u5143\u7d20\u6700\u5927 \u548cqueue\u4e00\u6837\uff0cpriority_queue\u4e0d\u5141\u8bb8\u8bbf\u95ee\u9664\u4e86\u5806\u9876\u5143\u7d20\u4ee5\u5916\u7684\u4efb\u4f55\u4e00\u4e2a\u5143\u7d20\u3002 priority_queue\u7684\u63d2\u5165\u548c\u5f39\u51fa\u64cd\u4f5c\u7684\u590d\u6742\u5ea6\u5747\u4e3aO(logN) priority_queue\u529f\u80fd\u4e0eset\u63a5\u8fd1\uff0c\u800c\u4e14set\u7684\u529f\u80fd\u66f4\u5f3a\u5927\uff0c\u5e76\u4e14\u7406\u8bba\u590d\u6742\u5ea6\u76f8\u540c\uff0c\u4e3a\u4ec0\u4e48\u6709\u65f6\u5019\u53cd\u800c\u5c31\u662f\u7528priority_queue\uff1f priority_queue\u7684\u590d\u6742\u5ea6\u4e3a\u6700\u5dee\u60c5\u51b5\u4e0b\u7684\u590d\u6742\u5ea6\uff0c\u800cset\u548cmap\u7684\u590d\u6742\u5ea6\u5747\u4e3a\u7a33\u5b9a\u590d\u6742\u5ea6\u7684\u6781\u9650\u503c","title":"C++ STL"},{"location":"cs/pl/c_cpp/stl/#stl","text":"\u7ea6 1006 \u4e2a\u5b57 87 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f STL\u7b80\u79f0\u6807\u51c6\u6a21\u7248\u5e93\uff0c\u88ab\u5bb9\u7eb3\u5728C++\u6807\u51c6\u7a0b\u5e8f\u5e93\uff0c\u5305\u542b\u4e86\u8bb8\u591a\u57fa\u672c\u6570\u636e\u7ed3\u6784\u548c\u57fa\u672c\u7b97\u6cd5\uff0c\u4f7f\u7a0b\u5e8f\u5458\u5199\u8d77\u6765\u5f97\u5fc3\u5e94\u624b\u3002","title":"STL"},{"location":"cs/pl/c_cpp/stl/#stl_1","text":"\u5728\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u5728\u7a0b\u5e8f\u4e2d\u4f1a\u4f7f\u7528\u5230\u5806\u3001\u6808\u3001\u961f\u5217\u3001\u94fe\u8868\u7b49\u4e00\u4e9b\u57fa\u672c\u7684\u7b97\u6cd5\uff0c\u800c\u5b66\u4e60\u6570\u636e\u7ed3\u6784\u7684\u65f6\u5019\uff0c\u8fd9\u4e9b\u57fa\u672c\u7b97\u6cd5\u5199\u8d77\u6765\u5341\u5206\u7e41\u7410\uff0c\u5982\u679c\u4e0d\u60f3\u5199\u8fd9\u4e9b\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u8003\u8651\u4e00\u4e0bSTL\u4e86\u3002 \u4f46\u662f\u4e0d\u8981\u592a\u8fc7\u4e8e\u4f9d\u8d56STL\uff01","title":"\u4e3a\u4ec0\u4e48\u4f7f\u7528STL"},{"location":"cs/pl/c_cpp/stl/#stl_2","text":"\u8981\u4f7f\u7528STL\uff0c\u9700\u8981\u7406\u89e3\u4ee5\u4e0b\u51e0\u4e2a\u57fa\u672c\u6982\u5ff5\uff1a \u5bb9\u5668 \uff1a\u662f\u5b58\u653e\u6570\u636e\u7684\u5730\u65b9\uff0c\u5e38\u89c1\u7684\u5bb9\u5668\u6709\uff1a\u94fe\u8868(list) \u6808(stack) \u52a8\u6001\u6570\u7ec4 (vector) \u53cc\u7aef\u961f\u5217(deque) \u961f\u5217(queue) \u6620\u5c04(map) \u8fed\u4ee3\u5668(iterator) \uff1a\u53ef\u4ee5\u7406\u89e3\u4e3aC\u8bed\u8a00\u91cc\u7684\u5730\u5740\uff0c\u800c\u8fed\u4ee3\u5668\u5c31\u662f\u5bb9\u5668\u7684\u4e00\u4e2a\u6307\u9488\uff0c\u5341\u5206\u91cd\u8981\uff01\uff01\uff01 \u7b97\u6cd5 \uff1a\u53ef\u4ee5\u5bf9\u5bb9\u5668\u91cc\u7684\u6570\u636e\u505a\u4e00\u4e9b\u57fa\u672c\u64cd\u4f5c\uff0c\u6bd4\u5982\u6392\u5e8f\uff0c\u627e\u6700\u5927\u5143\u7d20\u7b49\u7b49\u3002","title":"STL\u57fa\u672c\u6982\u5ff5"},{"location":"cs/pl/c_cpp/stl/#stl_3","text":"\u9700\u8981\u5bf9\u5e94\u7684\u5934\u6587\u4ef6\uff0c\u6bd4\u5982list\u5c31\u9700\u8981 #include \uff0c\u4e14\u6ca1\u6709.h\uff0c\u6216\u8005\u6076\u5fc3\u7684\u4e07\u80fd\u5934 #include \u3002 \u6dfb\u52a0std\u547d\u540d\u7a7a\u95f4\uff08using namespace std;\uff09\u4e0d\u52a0\u7684\u8bdd\u540e\u9762\u53ef\u4ee5\u81ea\u5df1\u5199\u4e00\u5806\u3002\u3002\u3002","title":"STL\u4f7f\u7528\u524d\u7684\u521d\u59cb\u5316"},{"location":"cs/pl/c_cpp/stl/#cstl","text":"","title":"C++\u91ccSTL\u57fa\u672c\u5bb9\u5668\u8be6\u89e3"},{"location":"cs/pl/c_cpp/stl/#cmp","text":"\u901a\u8fc7\u81ea\u5b9a\u4e49cmp\u7c7b\u6765\u5b8c\u6210STL\u7684\u66f4\u52a0\u81ea\u7531\u7684\u8bbe\u7f6e struct cmp { bool operator ()( int a , int b ) { return a > b ; } };","title":"cmp\u7c7b"},{"location":"cs/pl/c_cpp/stl/#sort","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u590d\u6742\u5ea6\u4e3aO(nlogn)\uff0c\u6bd4\u8f83\u6392\u5e8f\u7684\u6781\u9650\u4e86\u3002 bool cmp ( int a , int b ) { return a > b ; } int a [] = { 1 , 2 , 3 , 4 }; sort ( a , a + 4 , cmp ); sort\u91cc\u7b2c\u4e00\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e00\u4e2a\u5730\u5740\uff0c\u7b2c\u4e8c\u4e2a\u53c2\u6570\u662f\u6570\u7ec4\u9700\u8981\u6392\u5e8f\u7684\u7b2c\u4e8c\u4e2a\u5730\u5740\uff0c\u90fd\u4e09\u4e2a\u53c2\u6570\u662f\u4e00\u4e2a\u81ea\u5b9a\u4e49\u51fd\u6570\uff0c\u5bf9\u6570\u7ec4\u6392\u5e8f\u7684\u51fd\u6570\uff0c\u4e0a\u9762\u7684cmp\u51fd\u6570\u662f\u4f7f\u6570\u7ec4\u5143\u7d20\u4ece\u5927\u5230\u5c0f\u6392\u5e8f\u3002 sort\u662f\u4e0d\u7a33\u5b9a\u6392\u5e8f\uff0c\u5373\u5bf9\u4e8e\u76f8\u540c\u7684\u503c\uff0c\u65e0\u6cd5\u4fdd\u8bc1\u5176\u524d\u540e\u987a\u5e8f \u89e3\u51b3\u529e\u6cd5\uff1a 1\u3001\u589e\u52a0\u4e00\u4e2a index \u53d8\u91cf\uff0c\u5728\u503c\u76f8\u540c\u7684\u4f7f\u7528\u6bd4\u8f83 index \u503c\u7684\u5927\u5c0f 2\u3001\u4f7f\u7528 `stable_sort``","title":"sort"},{"location":"cs/pl/c_cpp/stl/#vector","text":"\u9700\u8981\u5934\u6587\u4ef6#include \u4e0d\u5b9a\u6570\u7ec4 vector < int > a , b ; a . push_back ( 1 ); // \u63a8\u5165\u4e00\u4e2a\u65b0\u7684\u503c\u5230\u6570\u7ec4\u6700\u540e a . pop_back (); // \u5220\u9664\u6570\u7ec4\u6700\u540e\u7684\u90a3\u4e2a\u503c a . front (); // \u6570\u7ec4\u5f00\u5934\u7684\u503c a . back (); // \u6570\u7ec4\u7ed3\u5c3e\u7684\u503c a = b ; // \u6570\u7ec4\u62f7\u8d1d a == b ; // \u6570\u7ec4\u662f\u5426\u76f8\u540c a [ 1 ]; // \u6570\u7ec4\u4e2d\u7b2c\u4e8c\u4e2a\u503c vector < int > a ; a . size (); // \u5bb9\u5668\u5185\u7684\u5143\u7d20\u4e2a\u6570 a . empty (); // \u5bb9\u5668\u662f\u5426\u4e3a\u7a7a // \u9664\u4e86queue\u548cstack\u5916\u901a\u7528\u7684\u65b9\u6cd5 a . clear (); // \u6e05\u7a7a\u5bb9\u5668\u5185\u7684\u6240\u6709\u5143\u7d20 a . begin (); // \u5bb9\u5668\u7684\u4e00\u4e2a\u5143\u7d20\u7684\u8fed\u4ee3\u5668 a . end (); // \u5bb9\u5668\u5c3e\u540e\u8fed\u4ee3\u5668 vector < int > v ; vector < int >:: iterator iter // \u5b9a\u4e49\u8fed\u4ee3\u5668 iter = v . begin (); // \u6570\u7ec4\u5934\u201c\u6307\u9488\u201d iter = v . end (); // \u6570\u7ec4\u5c3e\u201c\u6307\u9488\u201d ==list==: 1.\u9700\u8981\u5934\u6587\u4ef6#include l; 2.\u53cc\u5411\u94fe\u8868 list < int > l ; l . push_front ( 1 ); // \u63d2\u5165\u5143\u7d20\u5230\u5f00\u5934 l . pop_front (); // \u4ece\u5f00\u5934\u5220\u6389\u5143\u7d20 l . erase ( l . begin ()); // \u5220\u9664\u6307\u5b9a\u8fed\u4ee3\u5668\u5904\u7684\u5143\u7d20 l . insert ( l . begin (), 1 ); // \u5728\u6307\u5b9a\u8fed\u4ee3\u5668\u524d\u63d2\u5165\u5143\u7d20 l . reverse (); // \u53cd\u8f6c\u6574\u4e2a\u94fe\u8868","title":"vector"},{"location":"cs/pl/c_cpp/stl/#string","text":"\u4f2a\u5b57\u7b26\u4e32\uff1b \u5b9a\u4e49\uff1astring s; \u53ea\u80fd\u6d41\u8f93\u5165\u548c\u6d41\u8f93\u51fa\uff1b string a , b ; a [ 1 ] == 'a' ; // \u5f97\u5230\u67d0\u4e2a\u5b57\u7b26 a = b ; // \u5b57\u7b26\u4e32\u62f7\u8d1d a >= b ; // \u5b57\u5178\u5e8f\u6bd4\u8f83 a [ 1 ] = b [ 1 ]; // \u4fee\u6539\u67d0\u4e2a\u5b57\u7b26 a += b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = a + b ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a += \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 a = b + \"123\" ; // \u5b57\u7b26\u4e32\u62fc\u63a5 int len = a . lenth (); // \u5b57\u7b26\u4e32\u7684\u957f\u5ea6","title":"string"},{"location":"cs/pl/c_cpp/stl/#queue","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b \u5148\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u94fe\u8868\u5b9e\u73b0\uff09 queue < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u961f\u5217 q . pop (); // \u63a8\u51fa\u961f\u5217\u5f00\u5934\u7684\u5143\u7d20 q . front (); // \u961f\u5217\u7684\u7b2c\u4e00\u4e2a\u5143\u7d20","title":"queue"},{"location":"cs/pl/c_cpp/stl/#stack","text":"\u9700\u8981\u5934\u6587\u4ef6 #include ; \u540e\u8fdb\u5148\u51fa\uff08\u5185\u90e8\u4e3a\u6570\u7ec4\u5b9e\u73b0\uff09 stack < int > q ; q . push ( 1 ); // \u5c061\u63a8\u5165\u5806\u6808 q . pop (); // \u63a8\u51fa\u5806\u6808\u6700\u540e\u7684\u5143\u7d20 q . top (); // \u5806\u6808\u7684\u6700\u540e\u7684\u5143\u7d20","title":"stack"},{"location":"cs/pl/c_cpp/stl/#pair","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \u8868\u793a\u4e00\u7ec4\u952e\u5bf9\uff08\u6709\u4e24\u4e2a\u53d8\u91cf\u7684\u7ed3\u6784\u4f53\uff09 pair < int , string > p ; p . first = 1 ; p . second = \"abc\" ; p = make_pair ( 1 , \"abc\" ); p = { 1 , \"abc\" }; pair < int , string > p [ 100 ]; sort ( p , p + 100 ); // \u9ed8\u8ba4\u4f18\u5148first\u4ece\u5c0f\u5230\u5927 // \u5982\u679cfirst\u76f8\u540c\u5219second\u4ece\u5c0f\u5230\u5927 pair\u4e0e\u5176\u4ed6\u7ed3\u6784\u5d4c\u5957 vector < pair < int , string > > vp ; queue < pair < float , int > > qp ; queue < pair < pair < int , int > , int > > qpp ;","title":"pair"},{"location":"cs/pl/c_cpp/stl/#set","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b set \u4fdd\u5b58\u4e86\u4e0d\u53ef\u91cd\u590d\u7684\u5143\u7d20-- \u4e8c\u53c9\u641c\u7d22\u6811-\u7ea2\u9ed1\u6811 set < int > s ; s . insert ( 1 ); // \u63d2\u5165\u5230\u96c6\u5408\u4e2d s . erase ( 1 ); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . erase ( s . begin ()); // \u4ece\u96c6\u5408\u4e2d\u5220\u9664 s . count ( 1 ); // \u96c6\u5408\u4e2d\u662f\u5426\u5b58\u5728 s . find ( 1 ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u7531\u4e8eset\u662f\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 \u5185\u90e8\u6709\u5e8f(\u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927) \u6ca1\u6709\u91cd\u590d\u503c\uff0c\u5982\u679c\u51fa\u73b0\u91cd\u590d\u503c\u4f1a\u4e0d\u65ad\u88ab\u8986\u76d6 \u51e0\u4e4e\u6240\u6709\u64cd\u4f5c\u590d\u6742\u5ea6\u5747\u4e3a O(logN) \u4e0d\u53ef\u4ee5\u4fee\u6539\u8282\u70b9\u4e0a\u7684\u503c \u4fee\u6539\u64cd\u4f5c\u53ea\u80fd\u8fdb\u884c\u63d2\u5165\u548c\u5220\u9664\u4e24\u4e2a\u64cd\u4f5c set\u901a\u5e38\u4f5c\u7528\uff1a\u4fdd\u8bc1\u552f\u4e00\u6027\uff0c\u4fdd\u8bc1\u6570\u5217\u6709\u5e8f","title":"set"},{"location":"cs/pl/c_cpp/stl/#map","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \uff1b map\u5b57\u5178\uff08\u952e\u5bf9\u96c6\u5408\uff09 \u2014\u2014\u4e8c\u53c9\u641c\u7d22\u6811\u2014\u2014\u7ea2\u9ed1\u6811 map < char , int > m ; m . insert ( make_pair ( 'a' , 1 )); // \u52a0\u5165\u5b57\u5178 m . insert ({ 'a' , 1 }); // \u52a0\u5165\u5b57\u5178 m . erase ( 'a' ); // \u4ece\u5b57\u5178\u4e2d\u5220\u9664 m . count ( 'a' ); // \u5b57\u5178\u4e2d\u662f\u5426\u5b58\u5728 m . find ( 'a' ); // \u8fd4\u56de\u5bf9\u5e94\u503c\u7684\u8fed\u4ee3\u5668\uff08\u82e5\u65e0\u5219\u8fd4\u56de\u5c3e\u540e\u8fed\u4ee3\u5668\uff09 \u901a\u5e38\u79f0map\u7684first\u5143\u7d20\u4e3akey\uff0csecond\u5143\u7d20\u4e3avalue \u00b7\u7531\u4e8emap\u662f\u952e\u5bf9\u7ea2\u9ed1\u6811\uff0c\u6240\u4ee5\u6ee1\u8db3\u4ee5\u4e0b\u5185\u5bb9 1\u3001set\u7684\u5927\u90e8\u5206\u6027\u8d28\uff1b 2\u3001key\u4e0d\u80fd\u91cd\u590d\uff0c\u4e0d\u80fd\u4fee\u6539\uff0c\u53ea\u80fd\u5220\u9664\u548c\u6dfb\u52a0\uff1b 3\u3001\u5141\u8bb8value\u91cd\u590d\uff0c\u53ef\u4ee5\u5bf9value\u8fdb\u884c\u4fee\u6539\uff1b 4\u3001map\u662f\u6309\u7167key\u8fdb\u884c\u6392\u5e8f\u7684\uff1b 5\u3001key\u548cvalue\u4e00\u5b9a\u662f\u6210\u5bf9\u51fa\u73b0\u7684\uff1b 6\u3001map\u7684\u8fed\u4ee3\u5668\u6307\u5411\u7684\u5185\u5bb9\u662f\u4e00\u4e2apair\uff1b","title":"map"},{"location":"cs/pl/c_cpp/stl/#priority_queue","text":"\u9700\u8981\u5934\u6587\u4ef6 #include \u4f18\u5148\u961f\u5217--\u5806 priority_queue < int > prq ; prq . top (); // \u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . pop (); // \u5f39\u51fa\u5806\u9876\u4e0a\u7684\u5143\u7d20 prq . push ( 1 ); // \u63a8\u5165\u5806 priority_queue\u9ed8\u8ba4\u4e3a\u6700\u5927\u5806\uff0c\u5373\u5806\u9876\u7684\u5143\u7d20\u6700\u5927 \u548cqueue\u4e00\u6837\uff0cpriority_queue\u4e0d\u5141\u8bb8\u8bbf\u95ee\u9664\u4e86\u5806\u9876\u5143\u7d20\u4ee5\u5916\u7684\u4efb\u4f55\u4e00\u4e2a\u5143\u7d20\u3002 priority_queue\u7684\u63d2\u5165\u548c\u5f39\u51fa\u64cd\u4f5c\u7684\u590d\u6742\u5ea6\u5747\u4e3aO(logN) priority_queue\u529f\u80fd\u4e0eset\u63a5\u8fd1\uff0c\u800c\u4e14set\u7684\u529f\u80fd\u66f4\u5f3a\u5927\uff0c\u5e76\u4e14\u7406\u8bba\u590d\u6742\u5ea6\u76f8\u540c\uff0c\u4e3a\u4ec0\u4e48\u6709\u65f6\u5019\u53cd\u800c\u5c31\u662f\u7528priority_queue\uff1f priority_queue\u7684\u590d\u6742\u5ea6\u4e3a\u6700\u5dee\u60c5\u51b5\u4e0b\u7684\u590d\u6742\u5ea6\uff0c\u800cset\u548cmap\u7684\u590d\u6742\u5ea6\u5747\u4e3a\u7a33\u5b9a\u590d\u6742\u5ea6\u7684\u6781\u9650\u503c","title":"priority_queue"},{"location":"cs/pl/go/","text":"Go \u00b6 Abstract \u672c\u4ee5\u4e3a\u8fdb\u5165\u5b57\u8282\u540e\u9700\u8981\u7528\u5230Go\uff0c\u5c31\u63d0\u524d\u5b66\u4e86 \u7ed3\u679c\u6211\u662f\u5c0f\u4e11\uff08\u6ca1hc\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b Table of Contents \u00b6 Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO)","title":"Go"},{"location":"cs/pl/go/#go","text":"Abstract \u672c\u4ee5\u4e3a\u8fdb\u5165\u5b57\u8282\u540e\u9700\u8981\u7528\u5230Go\uff0c\u5c31\u63d0\u524d\u5b66\u4e86 \u7ed3\u679c\u6211\u662f\u5c0f\u4e11\uff08\u6ca1hc\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b","title":"Go"},{"location":"cs/pl/go/#table-of-contents","text":"Go \u8bed\u6cd5\u57fa\u7840 Gin \u6846\u67b6 (TODO)","title":"Table of Contents"},{"location":"cs/pl/go/basic/","text":"Go \u8bed\u6cd5\u57fa\u7840 \u00b6 \u7ea6 3054 \u4e2a\u5b57 158 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60 Go \u7684\u4e00\u4e9b\u8bed\u6cd5\uff0c\u548c\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u65e0\u592a\u5927\u533a\u522b\uff0c\u5165\u95e8\u8fd8\u662f\u5f88\u7b80\u5355\u7684 \u4e3a\u4ec0\u4e48\u5b66\u4e60 Go \u00b6 \u786c\u4ef6\u9650\u5236\uff1a\u6469\u5c14\u5b9a\u5f8b\u5df2\u7136\u5931\u6548 Go \u4e3a\u5e76\u53d1\u800c\u751f\uff1a\u5728\u591a\u6838\u5e76\u53d1\u4e0a\u62e5\u6709\u539f\u751f\u7684\u8bbe\u8ba1\u4f18\u52bf\uff0c\u4ece\u5e95\u5c42\u539f\u751f\u5e76\u53d1 Go \u6027\u80fd\u5f3a\u608d\uff1a\u540c C/C++ \u4e00\u6837\uff0cGo \u4e5f\u662f\u7f16\u8bd1\u578b\u8bed\u8a00\uff0c\u6267\u884c\u6548\u7387\u66f4\u9ad8\uff0c\u6027\u80fd\u66f4\u597d Go \u7b80\u5355\u6613\u5b66\uff1a\u8bed\u6cd5\u7b80\u6d01\u3001\u4ee3\u7801\u98ce\u683c\u7edf\u4e00\u3001\u5f00\u53d1\u6548\u7387\u9ad8 \u600e\u4e48\u88c5 Go \u00b6 \u4e0b\u8f7d \u00b6 Go \u5b98\u7f51\u4e0b\u8f7d\u5730\u5740 Go \u5b98\u65b9\u955c\u50cf\u7ad9\uff08\u63a8\u8350\uff09 Windows\u5e73\u53f0\u548cMac\u5e73\u53f0\u63a8\u8350\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u7248\uff0cLinux\u5e73\u53f0\u4e0b\u8f7d\u538b\u7f29\u6587\u4ef6\u7248\u3002 \u5b89\u88c5 \u00b6 Windows\uff1a\u4ee564\u4f4dWin10\u4e3e\u4f8b\uff0c\u5c06\u9009\u597d\u5b89\u88c5\u5305\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u53cc\u51fb\u4e00\u76f4next\uff0c \u6ce8\u610f\u8981\u6307\u5b9a\u4e00\u4e2aGo \u5b89\u88c5\u76ee\u5f55\uff0c\u8fd9\u5f88\u91cd\u8981 Linux\uff1a # \u5728\u7248\u672c\u9009\u62e9\u597d\u4e0b\u8f7d\u6587\u4ef6\u540e wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz # \u5c06\u4e0b\u8f7d\u597d\u7684\u6587\u4ef6\u89e3\u538b\u5230 `/usr/local` \u76ee\u5f55\u4e2d\uff0c\u6ca1\u6709\u6743\u9650\u52a0\u4e0a `sudo` tar -zxvf go1.14.1.linux-amd64.tar.gz -C /usr/local # \u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5728 `~/.profile` \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u5e76\u7528 `source` \u91cd\u65b0\u52a0\u8f7d export GOROOT = /usr/local/go export PATH = $PATH : $GOROOT /bin - Mac\uff1a\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u540e\uff0c\u76f4\u63a5\u70b9\u51fb\u4e0b\u4e00\u6b65\u5b89\u88c5\u5373\u53ef\uff0c\u9ed8\u8ba4\u4f1a\u5c06 go \u5b89\u88c5\u5230 /usr/local/go \u76ee\u5f55\u4e0b GOROOT \u548c GOPATH \u00b6 \u2002\u2002 GOROOT \u548c GOPATH \u90fd\u662f\u73af\u5883\u53d8\u91cf\uff0c\u5176\u4e2d GOROOT \u662f\u6211\u4eec\u5b89\u88c5go\u5f00\u53d1\u5305\u7684\u8def\u5f84\uff0c\u800c\u4ece Go 1.8 \u7248\u672c\u5f00\u59cb\uff0cGo\u5f00\u53d1\u5305\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u4f1a\u4e3a GOPATH \u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u76ee\u5f55\uff0c\u5e76\u4e14\u5728 Go1.14 \u53ca\u4e4b\u540e\u7684\u7248\u672c\u4e2d\u542f\u7528\u4e86 Go Module \u6a21\u5f0f\u4e4b\u540e\uff0c\u4e0d\u4e00\u5b9a\u975e\u8981\u5c06\u4ee3\u7801\u5199\u5230 GOPATH \u76ee\u5f55\u4e0b\uff0c\u6240\u4ee5\u4e5f\u5c31\u4e0d\u9700\u8981\u6211\u4eec\u518d\u81ea\u5df1\u914d\u7f6e GOPATH \u4e86\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684\u5373\u53ef\u3002 \u67e5\u770b GOPATH \u8def\u5f84\uff1a go env GOPROXY Go1.14 \u7248\u672c\u4e4b\u540e\uff0c\u90fd\u63a8\u8350\u4f7f\u7528 go mod \u6a21\u5f0f\u6765\u7ba1\u7406\u4f9d\u8d56\u73af\u5883\u4e86\uff0c\u4e5f\u4e0d\u518d\u5f3a\u5236\u6211\u4eec\u628a\u4ee3\u7801\u5fc5\u987b\u5199\u5728 GOPATH \u4e0b\u9762\u7684src\u76ee\u5f55\u4e86\uff0c\u4f60\u53ef\u4ee5\u5728\u4f60\u7535\u8111\u7684\u4efb\u610f\u4f4d\u7f6e\u7f16\u5199go\u4ee3\u7801\u3002\uff08\u7f51\u4e0a\u6709\u4e9b\u6559\u7a0b\u9002\u7528\u4e8e1.11\u7248\u672c\u4e4b\u524d\u3002\uff09 \u9ed8\u8ba4 GoPROXY \u914d\u7f6e\u662f\uff1a GOPROXY = https://proxy.golang.org,direct \uff0c\u7531\u4e8e\u56fd\u5185\u8bbf\u95ee\u4e0d\u5230 https://proxy.golang.org \uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u6362\u4e00\u4e2aPROXY\uff0c\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528 https://goproxy.io \u6216 https://goproxy.cn \u3002 \u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539GOPROXY\uff1a go env -w GOPROXY = https://goproxy.cn,direct \u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c Go \u00b6 \u2002\u2002\u4efb\u4f55\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u7f16\u5199 Go\uff08\u5305\u62ec\u8bb0\u4e8b\u672c\uff09\uff0c\u8fd9\u91cc\u63a8\u8350\u7528 VsCode\uff08\u9700\u5b89\u88c5 Go \u6269\u5c55\uff09\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528Sublime\uff0cJB \u7684\u5168\u5bb6\u6876\u7b49\u7b49 go mod init \u00b6 \u4f7f\u7528 go module \u6a21\u5f0f\u65b0\u5efa\u9879\u76ee\u65f6\uff0c\u6211\u4eec\u9700\u8981\u901a\u8fc7 go mod init \u9879\u76ee\u540d\u547d\u4ee4\u5bf9\u9879\u76ee\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u8be5\u547d\u4ee4\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210 go.mod \u6587\u4ef6\u3002\u6267\u884c\u5982\u4e0b\u547d\u4ee4 go mod init ${ project } \u8bb0\u5f97\u914d\u7f6e\u597d GOPROXY \u7f16\u8bd1\u3001\u8fd0\u884c\u3001\u5b89\u88c5 \u00b6 go build \uff1a \u547d\u4ee4\u8868\u793a\u5c06\u6e90\u4ee3\u7801\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002 go run \uff1a\u547d\u4ee4\u672c\u8d28\u4e0a\u662f\u5148\u5728\u4e34\u65f6\u76ee\u5f55\u7f16\u8bd1\u7a0b\u5e8f\u7136\u540e\u518d\u6267\u884c\u3002 go install \uff1a\u5b83\u5148\u7f16\u8bd1\u6e90\u4ee3\u7801\u5f97\u5230\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u53ef\u6267\u884c\u6587\u4ef6\u79fb\u52a8\u5230GOPATH\u7684bin\u76ee\u5f55\u4e0b\u3002\u56e0\u4e3a \u628a GOPATH \u4e0b\u7684 bin \u76ee\u5f55\u6dfb\u52a0\u5230\u4e86\u73af\u5883\u53d8\u91cf\u4e2d \uff0c\u6240\u4ee5\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u5730\u65b9\u76f4\u63a5\u6267\u884c\u53ef\u6267\u884c\u6587\u4ef6\u3002 go module \u00b6 \u2002\u2002 go module \u662fGo1.13\u7248\u672c\u4e4b\u540e\u3002Go\u8bed\u8a00\u9ed8\u8ba4\u7684\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\u3002 \u8bbe\u7f6e\u597d GO111MODULE=on \u5c31\u53ef\u4ee5\u4f7f\u7528 go module \u4f7f\u7528 go module`` \u7ba1\u7406\u4f9d\u8d56\u540e\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210\u4e24\u4e2a\u6587\u4ef6 go.mod \u548c go.sum` go mod \u547d\u4ee4\uff1a go mod download \u4e0b\u8f7d\u4f9d\u8d56\u7684module\u5230\u672c\u5730cache\uff08\u9ed8\u8ba4\u4e3a$GOPATH/pkg/mod\u76ee\u5f55\uff09 go mod edit \u7f16\u8f91go.mod\u6587\u4ef6 go mod graph \u6253\u5370\u6a21\u5757\u4f9d\u8d56\u56fe go mod init \u521d\u59cb\u5316\u5f53\u524d\u6587\u4ef6\u5939, \u521b\u5efago.mod\u6587\u4ef6 go mod tidy \u589e\u52a0\u7f3a\u5c11\u7684module\uff0c\u5220\u9664\u65e0\u7528\u7684module go mod vendor \u5c06\u4f9d\u8d56\u590d\u5236\u5230vendor\u4e0b go mod verify \u6821\u9a8c\u4f9d\u8d56 go mod why \u89e3\u91ca\u4e3a\u4ec0\u4e48\u9700\u8981\u4f9d\u8d56 go.mod\u6587\u4ef6\u8bb0\u5f55\u4e86\u9879\u76ee\u6240\u6709\u7684\u4f9d\u8d56\u4fe1\u606f \u5728\u9879\u76ee\u4e2d\u6267\u884c go get \u547d\u4ee4\u53ef\u4ee5\u4e0b\u8f7d\u4f9d\u8d56\u5305\uff0c\u5e76\u4e14\u8fd8\u53ef\u4ee5\u6307\u5b9a\u4e0b\u8f7d\u7684\u7248\u672c \u53d8\u91cf\u548c\u5e38\u91cf \u00b6 \u53d8\u91cf \u9700\u8981\u663e\u5f0f\u58f0\u660e\uff0c\u5e76\u4e14\u5728\u51fd\u6570\u8c03\u7528\u7b49\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u5668\u4f1a\u68c0\u67e5\u5176\u7c7b\u578b\u7684\u6b63\u786e\u6027 var \u58f0\u660e1\u4e2a\u6216\u591a\u4e2a\u53d8\u91cf\uff0cGo \u4f1a\u81ea\u52a8\u63a8\u65ad\u5df2\u7ecf\u6709\u521d\u59cb\u503c\u7684\u53d8\u91cf\u7c7b\u578b \u58f0\u660e\u540e\u5374\u6ca1\u6709\u7ed9\u51fa\u5bf9\u5e94\u7684\u521d\u59cb\u503c\u65f6\uff0c\u53d8\u91cf\u5c06\u4f1a\u521d\u59cb\u5316\u4e3a \u96f6\u503c \u3002 \u4f8b\u5982\uff0cint \u7684\u96f6\u503c\u662f 0 := \u8bed\u6cd5\u662f\u58f0\u660e\u5e76\u521d\u59cb\u5316\u53d8\u91cf\u7684\u7b80\u5199\uff08\u4e0d\u80fd\u5728\u51fd\u6570\u5916\u4f7f\u7528\uff09\uff0c \u4f8b\u5982 var f string = \"short\" \u53ef\u4ee5\u7b80\u5199\u4e3a f := \"short\" \u5728\u4f7f\u7528\u591a\u91cd\u8d4b\u503c\u65f6\uff0c\u5982\u679c\u60f3\u8981\u5ffd\u7565\u67d0\u4e2a\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528\u533f\u540d\u53d8\u91cf\uff0c\u4e00\u4e2a\u4e0b\u5212\u7ebf _ \u8868\u793a \u5e38\u91cf \u652f\u6301\u5b57\u7b26\u3001\u5b57\u7b26\u4e32\u3001\u5e03\u5c14\u548c\u6570\u503c\u5e38\u91cf const \u7528\u4e8e\u58f0\u660e\u4e00\u4e2a\u5e38\u91cf const \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u5728\u4efb\u4f55 var \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u7684\u5730\u65b9 iota \u662f\u5e38\u91cf\u8ba1\u6570\u5668\uff0c\u5728 const \u5173\u952e\u5b57\u51fa\u73b0\u65f6\u4f1a\u88ab\u91cd\u7f6e\u4e3a0 \u6761\u4ef6\u8bed\u53e5 \u00b6 if/else \u5206\u652f \u00b6 if-else if-else \u7ed3\u6784 Go \u89c4\u5b9a\u4e0e if \u5339\u914d\u7684\u5de6\u62ec\u53f7 { \u5fc5\u987b\u4e0e if \u548c\u8868\u8fbe\u5f0f\u653e\u5728\u540c\u884c\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4f1a\u89e6\u53d1\u7f16\u8bd1\u9519\u8bef\uff0c\u540c\u7406else \u5728\u6761\u4ef6\u8bed\u53e5\u4e4b\u524d\u53ef\u4ee5\u6709\u4e00\u4e2a\u58f0\u660e\u8bed\u53e5\uff1b\u5728\u8fd9\u91cc\u58f0\u660e\u7684\u53d8\u91cf\u53ef\u4ee5\u5728\u8fd9\u4e2a\u8bed\u53e5\u6240\u6709\u7684\u6761\u4ef6\u5206\u652f\u4e2d\u4f7f\u7528 \u5728 Go \u4e2d\uff0c\u6761\u4ef6\u8bed\u53e5\u7684\u5706\u62ec\u53f7\u4e0d\u662f\u5fc5\u9700\u7684\uff0c\u4f46\u662f\u82b1\u62ec\u53f7\u662f\u5fc5\u9700\u7684 Go \u6ca1\u6709\u4e09\u76ee\u8fd0\u7b97\u7b26\uff0c \u5373\u4f7f\u662f\u57fa\u672c\u7684\u6761\u4ef6\u5224\u65ad\uff0c\u4f9d\u7136\u9700\u8981\u4f7f\u7528\u5b8c\u6574\u7684 if \u8bed\u53e5 if-else if num := 9 ; num < 0 { fmt . Println ( num , \"is negative\" ) } else if num < 10 { fmt . Println ( num , \"has 1 digit\" ) } else { fmt . Println ( num , \"has multiple digits\" ) } switch \u5206\u652f \u00b6 \u4e0d\u5e26\u8868\u8fbe\u5f0f\u7684 switch \u662f\u5b9e\u73b0 if/else \u903b\u8f91\u7684\u53e6\u4e00\u79cd\u65b9\u5f0f \u6bcf\u4e2a switch \u53ea\u80fd\u6709\u4e00\u4e2a default \u5206\u652f \u4e00\u4e2a\u5206\u652f\u53ef\u4ee5\u6709\u591a\u4e2a\u503c\uff0c\u591a\u4e2acase\u503c\u4e2d\u95f4\u4f7f\u7528\u82f1\u6587\u9017\u53f7\u5206\u9694 fallthrough \u8bed\u6cd5\u53ef\u4ee5\u6267\u884c\u6ee1\u8db3\u6761\u4ef6\u7684case\u7684\u4e0b\u4e00\u4e2acase\uff0c\u662f\u4e3a\u4e86\u517c\u5bb9C\u8bed\u8a00\u4e2d\u7684case\u8bbe\u8ba1\u7684 switch func switchDemo5 () { s := \"a\" switch { case s == \"a\" : fmt . Println ( \"a\" ) fallthrough case s == \"b\" : fmt . Println ( \"b\" ) case s == \"c\" : fmt . Println ( \"c\" ) default : fmt . Println ( \"...\" ) } } \u5faa\u73af \u00b6 \u7ecf\u5178\u7684\u521d\u59cb/\u6761\u4ef6/\u540e\u7eed for \u5faa\u73af for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u53ef\u4ee5\u88ab\u5ffd\u7565\uff0c\u4f46\u662f\u521d\u59cb\u8bed\u53e5\u540e\u7684\u5206\u53f7\u5fc5\u987b\u8981\u5199 for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u548c\u7ed3\u675f\u8bed\u53e5\u90fd\u53ef\u4ee5\u7701\u7565 for\u5faa\u73af\u53ef\u4ee5\u901a\u8fc7break\u3001goto\u3001return\u3001panic\u8bed\u53e5\u5f3a\u5236\u9000\u51fa\u5faa\u73af Go\u8bed\u8a00\u4e2d\u53ef\u4ee5\u4f7f\u7528for range\u904d\u5386\u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u3001map \u53ca\u901a\u9053\uff08channel\uff09\u3002 \u901a\u8fc7for range\u904d\u5386\u7684\u8fd4\u56de\u503c\u6709\u4ee5\u4e0b\u89c4\u5f8b \u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u8fd4\u56de\u7d22\u5f15\u548c\u503c\u3002 map\u8fd4\u56de\u952e\u548c\u503c\u3002 \u901a\u9053\uff08channel\uff09\u53ea\u8fd4\u56de\u901a\u9053\u5185\u7684\u503c for for i := 0 ; i < 10 ; i ++ { ... } for ; i < 10 ; i ++ { ... } for i < 10 { ... } for i , v := range ** { ... } \u6570\u636e\u7c7b\u578b \u00b6 \u6570\u5b57\u4e0e\u8fd0\u7b97 \u00b6 \u6574\u578b\u6709int8/16/32/64\uff0c\u5305\u62ec\u5bf9\u5e94\u7684\u65e0\u7b26\u53f7\u6574\u578b \u6d6e\u70b9\u578b\u6709float32/64 \u590d\u6570\u6709complex64/128 \u8fd0\u7b97\uff1a \u548cC/C++\u65e0\u592a\u5927\u5dee\u522b \u5e03\u5c14\u7c7b\u578b \u00b6 \u901a\u8fc7 bool \u6765\u58f0\u660e\u5e03\u5c14\u578b\u6570\u636e\uff0c\u53ea\u6709 true \u548c false \u9ed8\u8ba4\u503c\u4e3a false \u4e0d\u5141\u8bb8\u5c06\u6574\u578b\u5f3a\u5236\u8f6c\u6362\u4e3a\u5e03\u5c14\u578b \u5e03\u5c14\u578b\u65e0\u6cd5\u53c2\u4e0e\u6570\u503c\u8fd0\u7b97\uff0c\u4e5f\u65e0\u6cd5\u4e0e\u5176\u4ed6\u7c7b\u578b\u8fdb\u884c\u8f6c\u6362 \u5b57\u7b26\u4e32 \u00b6 \u5b57\u7b26\u4e32\u7684\u5185\u90e8\u5b9e\u73b0\u4f7f\u7528 UTF-8 \u7f16\u7801\uff0c\u5b57\u7b26\u4e32\u7684\u503c\u4e3a\u53cc\u5f15\u53f7(\")\u4e2d\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u5728Go\u8bed\u8a00\u7684\u6e90\u7801\u4e2d\u76f4\u63a5\u6dfb\u52a0\u975eASCII\u7801\u5b57\u7b26 \u8981\u5b9a\u4e49\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u65f6\uff0c\u5c31\u5fc5\u987b\u4f7f\u7528\u53cd\u5f15\u53f7\u5b57\u7b26\uff0c\u53cd\u5f15\u53f7\u95f4\u6362\u884c\u5c06\u88ab\u4f5c\u4e3a\u5b57\u7b26\u4e32\u4e2d\u7684\u6362\u884c\uff0c\u4f46\u662f\u6240\u6709\u7684\u8f6c\u4e49\u5b57\u7b26\u5747\u65e0\u6548\uff0c\u6587\u672c\u5c06\u4f1a\u539f\u6837\u8f93\u51fa s := `\u7b2c\u4e00\u884c \u7b2c\u4e8c\u884c \u7b2c\u4e09\u884c ` \u5e38\u7528\u65b9\u6cd5 len(str) \uff1a\u6c42\u957f\u5ea6 +\u6216fmt.Sprintf \uff1a\u62fc\u63a5\u5b57\u7b26\u4e32 strings.Split \uff1a\u5206\u5272 strings.contains \uff1a\u5224\u65ad\u662f\u5426\u5305\u542b strings.HasPrefix,strings.HasSuffix \uff1a\u524d\u7f00/\u540e\u7f00\u5224\u65ad strings.Index(),strings.LastIndex() \uff1a\u5b50\u4e32\u51fa\u73b0\u7684\u4f4d\u7f6e strings.Join(a[]string, sep string) \uff1ajoin\u64cd\u4f5c byte\u548crune\u7c7b\u578b \u00b6 \u7ec4\u6210\u6bcf\u4e2a\u5b57\u7b26\u4e32\u7684\u5143\u7d20\u53eb\u505a\u201c\u5b57\u7b26\u201d\uff0c\u53ef\u4ee5\u901a\u8fc7\u904d\u5386\u6216\u8005\u5355\u4e2a\u83b7\u53d6\u5b57\u7b26\u4e32\u5143\u7d20\u83b7\u5f97\u5b57\u7b26\u3002 \u5b57\u7b26\u7528\u5355\u5f15\u53f7\uff08\u2019\uff09\u5305\u88f9\u8d77\u6765 Go \u5305\u62ec\u4e24\u79cd\u5b57\u7b26\uff1a uint8 \u7c7b\u578b\uff0c\u6216\u8005\u53eb byte \u578b\uff0c\u4ee3\u8868\u4e00\u4e2a ASCII \u7801\u5b57\u7b26 rune \u7c7b\u578b\uff0c\u4ee3\u8868\u4e00\u4e2a UTF-8 \u5b57\u7b26 \u5f53\u9700\u8981\u5904\u7406\u4e2d\u6587\u3001\u65e5\u6587\u6216\u8005\u5176\u4ed6\u590d\u5408\u5b57\u7b26\u65f6\uff0c\u5219\u9700\u8981\u7528\u5230 rune \u7c7b\u578b\u3002 rune \u7c7b\u578b\u5b9e\u9645\u662f\u4e00\u4e2a int32 Go \u4f7f\u7528\u4e86\u7279\u6b8a\u7684 rune \u7c7b\u578b\u6765\u5904\u7406 Unicode \uff0c\u8ba9\u57fa\u4e8e Unicode \u7684\u6587\u672c\u5904\u7406\u66f4\u4e3a\u65b9\u4fbf\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 byte \u578b\u8fdb\u884c\u9ed8\u8ba4\u5b57\u7b26\u4e32\u5904\u7406\uff0c\u6027\u80fd\u548c\u6269\u5c55\u6027\u90fd\u6709\u7167\u987e \u5b57\u7b26\u4e32\u5e95\u5c42\u662f\u4e00\u4e2abyte\u6570\u7ec4\uff0c\u6240\u4ee5\u53ef\u4ee5\u548c []byte \u7c7b\u578b\u76f8\u4e92\u8f6c\u6362 \u5b57\u7b26\u4e32\u662f\u4e0d\u80fd\u4fee\u6539\u7684\uff0c\u5b57\u7b26\u4e32\u662f\u7531 byte \u5b57\u8282\u7ec4\u6210\uff0c\u6240\u4ee5\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u662f byte \u5b57\u8282\u7684\u957f\u5ea6 rune \u7c7b\u578b\u7528\u6765\u8868\u793a utf8 \u5b57\u7b26\uff0c\u4e00\u4e2a rune \u5b57\u7b26\u7531\u4e00\u4e2a\u6216\u591a\u4e2a byte \u7ec4\u6210 \u8981\u4fee\u6539\u5b57\u7b26\u4e32\uff0c\u9700\u8981\u5148\u5c06\u5176\u8f6c\u6362\u6210 []rune \u6216 []byte \uff0c\u5b8c\u6210\u540e\u518d\u8f6c\u6362\u4e3a string byte and rune s1 := \"big\" // \u5f3a\u5236\u7c7b\u578b\u8f6c\u6362 byteS1 := [] byte ( s1 ) byteS1 [ 0 ] = 'p' fmt . Println ( string ( byteS1 )) s2 := \"\u767d\u841d\u535c\" runeS2 := [] rune ( s2 ) runeS2 [ 0 ] = '\u7ea2' fmt . Println ( string ( runeS2 )) \u6570\u7ec4 \u00b6 \u5b9a\u4e49\u4e00\u4e2a\u957f\u5ea6\u4e3a3\u5143\u7d20\u7c7b\u578b\u4e3aint\u7684\u6570\u7ec4a\uff1a var a [3]int \u5185\u7f6e\u51fd\u6570 len \u53ef\u4ee5\u8fd4\u56de\u6570\u7ec4\u7684\u957f\u5ea6 \u521d\u59cb\u5316 \u53ef\u4ee5\u4f7f\u7528\u521d\u59cb\u5316\u5217\u8868\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff1a var num = [3]int{1, 2} \u53ef\u4ee5\u8ba9\u7f16\u8bd1\u5668\u6839\u636e\u521d\u59cb\u503c\u7684\u4e2a\u6570\u81ea\u884c\u63a8\u65ad\u6570\u7ec4\u7684\u957f\u5ea6\uff0c var num = [...]{1, 2} \u6307\u5b9a\u7d22\u5f15\u503c\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff0c num := [...]int{1: 1, 3: 5} \u904d\u5386 for i := 0; i < len(a); i ++ {} for index, value := range a {} \u591a\u7ef4\u6570\u7ec4\u5b9a\u4e49\uff0c a := [2][3]int \u591a\u7ef4\u6570\u7ec4\u53ea\u6709\u7b2c\u4e00\u5c42\u53ef\u4ee5\u4f7f\u7528 ... \u6765\u8ba9\u7f16\u8bd1\u5668\u63a8\u5bfc\u6570\u7ec4\u957f\u5ea6\uff0c\u4e0d\u652f\u6301\u5185\u5c42\u4f7f\u7528 \u6570\u7ec4\u662f\u503c\u7c7b\u578b\uff0c\u8d4b\u503c\u548c\u4f20\u53c2\u4f1a\u590d\u5236\u6574\u4e2a\u6570\u7ec4\uff0c\u56e0\u6b64\u6539\u53d8\u526f\u672c\u7684\u503c\uff0c\u4e0d\u4f1a\u6539\u53d8\u672c\u8eab\u7684\u503c [n]*T \u8868\u793a\u6307\u9488\u6570\u7ec4\uff0c *[n]T \u8868\u793a\u6570\u7ec4\u6307\u9488 \u5207\u7247 \u00b6 \u5b9a\u4e49 \u5207\u7247\uff08Slice\uff09\u662f\u4e00\u4e2a\u62e5\u6709\u76f8\u540c\u7c7b\u578b\u5143\u7d20\u7684\u53ef\u53d8\u957f\u5ea6\u7684\u5e8f\u5217\u3002\u5b83\u662f\u57fa\u4e8e\u6570\u7ec4\u7c7b\u578b\u505a\u7684\u4e00\u5c42\u5c01\u88c5\u3002\u5b83\u975e\u5e38\u7075\u6d3b\uff0c\u652f\u6301\u81ea\u52a8\u6269\u5bb9 \u5207\u7247\u58f0\u660e\uff1a var name []T \uff0cname \u8868\u793a\u53d8\u91cf\u540d\uff0cT \u8868\u793a\u5207\u7247\u4e2d\u7684\u5143\u7d20\u7c7b\u578b \u5207\u7247\u62e5\u6709\u81ea\u5df1\u7684\u957f\u5ea6\u548c\u5bb9\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5185\u7f6e\u7684len()\u51fd\u6570\u6c42\u957f\u5ea6\uff0c\u4f7f\u7528\u5185\u7f6e\u7684cap()\u51fd\u6570\u6c42\u5207\u7247\u7684\u5bb9\u91cf \u5207\u7247\u7684\u5e95\u5c42\u5c31\u662f\u6570\u7ec4\uff0c\u548c Python \u4e00\u6837\uff0c\u53ef\u4ee5\u4f7f\u7528 b := a[1:3] \uff0c\u8868\u793a\u4ece\u6570\u7ec4 a \u4e2d\u9009\u51fa \u7d22\u5f15\u503c\u5728 \\([1,3)\\) \u4e2d\u7684\u5143\u7d20\u7ec4\u6210\u5207\u7247 b \u5b8c\u6574\u7684\u5207\u7247\u8868\u8fbe\u5f0f\uff1a a[low: high: max] \uff0c\u5f97\u5230\u7684\u7ed3\u679c\u5207\u7247\u7684\u5bb9\u91cf\u8bbe\u7f6e\u4e3a max - low \uff0clow \u53ef\u4ee5\u7701\u7565\uff0c\u9ed8\u8ba4\u4e3a0 \u4f7f\u7528\u5185\u7f6e make\u51fd\u6570 \u6784\u9020\u5207\u7247\uff0c make([]T, size, cap) \uff0cT \u8868\u793a\u5143\u7d20\u7c7b\u578b\uff0csize \u8868\u793a\u5143\u7d20\u6570\u91cf\uff0ccap \u8868\u793a\u5207\u7247\u5bb9\u91cf \u5224\u65ad\u5207\u7247\u662f\u5426\u4e3a\u7a7a\uff0c\u8bf7\u4f7f\u7528 len(s) == 0 \uff0c\u4e0d\u8981\u4f7f\u7528 s == nil \u5207\u7247\u4e0d\u80fd\u76f4\u63a5\u6bd4\u8f83 \u5207\u7247\u904d\u5386\u548c\u6570\u7ec4\u4e00\u6837 \u53ef\u4ee5\u7528 append() \u4e3a\u5207\u7247\u6dfb\u52a0\u5143\u7d20 s = append(s, 1,2,3) \uff0c\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5143\u7d20 s = append(s, s2...) \u5207\u7247\u7684\u6269\u5bb9\u7b56\u7565\uff08\u7565\uff09 \u53ef\u4ee5\u4f7f\u7528 copy() \u590d\u5236\u5207\u7247\uff0c\u4f46\u5207\u7247\u662f\u5f15\u7528\u7c7b\u578b\uff0c\u6240\u4ee5\u4e24\u4e2a\u5207\u7247\u90fd\u6307\u5411\u540c\u4e00\u5757\u5185\u5b58\u5730\u5740\uff0c\u5bf9\u4e00\u4e2a\u5207\u7247\u7684\u4fee\u6539\u4f1a\u5f71\u54cd\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5185\u5bb9 \u6392\u5e8f\uff0c\u9700\u8981 import sort \uff0c\u6392\u5e8f\u65f6\u53ef\u81ea\u5b9a\u4e49\u6392\u5e8f sort.Slice(a, func(i, j int) bool { return a[i] < a[j] }) Map \u00b6 \u4e00\u79cd\u65e0\u5e8f\u7684 key-value \u6570\u636e\u7ed3\u6784\uff0c\u5728 Go \u4e2d map \u662f\u5f15\u7528\u7c7b\u578b\uff0c\u5fc5\u987b\u521d\u59cb\u5316\u624d\u80fd\u4f7f\u7528 \u5b9a\u4e49\uff1a map[KeyType]ValueType \uff0cKeyType \u8868\u793a\u952e\u7684\u7c7b\u578b\uff0cValueType \u8868\u793a\u952e\u5bf9\u5e94\u7684\u503c\u7684\u7c7b\u578b\uff0c x := map[int]int{1:3, 2:4} \u6216 s := make([int]int, 2), s[1] = 3, s[2] = 4 \u5224\u65ad\u952e\u662f\u5426\u5b58\u5728\uff1a value, ok := map[key] \uff0c\u67e5\u770b ok \u662f\u5426\u4e3a true \u904d\u5386\uff1a for k, v := range map {} \uff0cv \u53ef\u7701\u7565\uff0c\u904d\u5386\u5143\u7d20\u7684\u987a\u5e8f\u4e0e\u6dfb\u52a0\u952e\u503c\u5bf9\u7684\u987a\u5e8f\u65e0\u5173\uff0c\u53ef\u4ee5\u628a key \u653e\u5165 slice \u4e2d\u6392\u5e8f\uff0c\u7136\u540e\u904d\u5386 slice \u5c31\u53ef\u4ee5\u6307\u5b9a\u987a\u5e8f delete() \u4ece map \u4e2d\u5220\u9664\u4e00\u7ec4\u952e\u503c\u5bf9 \u51fd\u6570 \u00b6 \u4f7f\u7528 func \u6765\u5b9a\u4e49\u51fd\u6570 \u901a\u8fc7\u51fd\u6570\u540d\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570 \u51fd\u6570\u7684\u53c2\u6570\u4e2d\u5982\u679c\u76f8\u90bb\u53d8\u91cf\u7684\u7c7b\u578b\u76f8\u540c\uff0c\u5219\u53ef\u4ee5\u7701\u7565\u7c7b\u578b\uff0c \u53ef\u53d8\u53c2\u6570\u662f\u6307\u51fd\u6570\u7684\u53c2\u6570\u6570\u91cf\u4e0d\u56fa\u5b9a\u3002Go\u8bed\u8a00\u4e2d\u7684\u53ef\u53d8\u53c2\u6570\u901a\u8fc7\u5728\u53c2\u6570\u540d\u540e\u52a0 ... \u6765\u6807\u8bc6\uff0c\u53ef\u53d8\u53c2\u6570\u901a\u5e38\u8981\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u53c2\u6570 \u51fd\u6570\u5982\u679c\u6709\u591a\u4e2a\u8fd4\u56de\u503c\uff0c\u5fc5\u987b\u4f7f\u7528 () \u5c06\u6240\u6709\u8fd4\u56de\u503c\u5305\u88f9 \u51fd\u6570\u5b9a\u4e49\u65f6\u53ef\u4ee5\u7ed9\u8fd4\u56de\u503c\u547d\u540d\uff0c\u5e76\u5728\u51fd\u6570\u4f53\u4e2d\u76f4\u63a5\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff0c\u6700\u540e\u901a\u8fc7return\u5173\u952e\u5b57\u8fd4\u56de \u53ef\u4ee5\u4f7f\u7528 type \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u7c7b\u578b \u9ad8\u9636\u51fd\u6570 \u51fd\u6570\u4f5c\u4e3a\u53c2\u6570 \u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c \u53ef\u4ee5\u5b9a\u4e49\u533f\u540d\u51fd\u6570\uff0c add := func(x, y int) \uff0c\u591a\u7528\u4e8e\u56de\u8c03\u51fd\u6570\u548c\u95ed\u5305 \u95ed\u5305=\u51fd\u6570+\u5f15\u7528\u73af\u5883\uff08\u7565\uff09 defer \u8bed\u53e5\uff0c\u5c06\u5176\u540e\u9762\u8ddf\u968f\u7684\u8bed\u53e5\u8fdb\u884c\u5ef6\u8fdf\u5904\u7406\uff0c\u4f1a\u88ab\u9006\u5e8f\u5904\u7406 \u4f7f\u7528 panic/recover \u6a21\u5f0f\u6765\u5904\u7406\u9519\u8bef\uff0c recover()\u5fc5\u987b\u642d\u914ddefer\u4f7f\u7528\uff0cdefer\u4e00\u5b9a\u8981\u5728\u53ef\u80fd\u5f15\u53d1panic\u7684\u8bed\u53e5\u4e4b\u524d\u5b9a\u4e49 func func \u51fd\u6570\u540d ( \u53c2\u6570 )( \u8fd4\u56de\u503c ) { \u51fd\u6570\u4f53 } func add ( a , b int ) int { return x + b } func intSum2 ( x ... int ) int { fmt . Println ( x ) //x\u662f\u4e00\u4e2a\u5207\u7247 sum := 0 for _ , v := range x { sum = sum + v } return sum } func calc ( x , y int ) ( int , int ) { reurn x + y , x - y } func calc ( x , y int ) ( sum , sub int ) { sum = x + y sub = x - y return } func add ( x , y int ) int { return x + y } func calc ( x , y int , op func ( int , int ) int ) int { return op ( x , y ) } func main () { ret2 := calc ( 10 , 20 , add ) fmt . Println ( ret2 ) //30 } func do ( s string ) ( func ( int , int ) int , error ) { switch s { case \"+\" : return add , nil case \"-\" : return sub , nil default : err := errors . New ( \"\u65e0\u6cd5\u8bc6\u522b\u7684\u64cd\u4f5c\u7b26\" ) return nil , err } } \u6307\u9488 \u00b6 \u548c C \u7684\u533a\u522b\u4e0d\u5927\uff0c\u90fd\u662f\u7528 * \u548c & \u6765\u64cd\u4f5c\uff0c * \u8868\u793a\u53d6\u503c\u64cd\u4f5c\u7b26\uff0c & \u8868\u793a\u53d6\u5730\u5740\u64cd\u4f5c\u7b26 new \u548c make \u5206\u914d\u5185\u5b58 a = new(int) \uff0cmake \u53ea\u7528\u4e8eslice\u3001map\u4ee5\u53cachannel\u7684\u5185\u5b58\u521b\u5efa\uff0c\u8fd4\u56de\u7684\u662f\u5f15\u7528\u7c7b\u578b \u800cnew\u7528\u4e8e\u7c7b\u578b\u7684\u5185\u5b58\u5206\u914d\uff0c\u5e76\u4e14\u5185\u5b58\u5bf9\u5e94\u7684\u503c\u4e3a\u7c7b\u578b\u96f6\u503c\uff0c\u8fd4\u56de\u7684\u662f\u6307\u5411\u7c7b\u578b\u7684\u6307\u9488 \u7ed3\u6784\u4f53 \u00b6 \u5b9a\u4e49\u4e0e\u521d\u59cb\u5316 \u00b6 type \u5b9a\u4e49\u7c7b\u578b\u522b\u540d type + struct \u5b9a\u4e49\u7ed3\u6784\u4f53\uff0ctype \u7c7b\u578b\u540d struct { \u5b57\u6bb5\u540d \u5b57\u6bb5\u7c7b\u578b ...} \u4f7f\u7528 var \u5b9e\u4f8b\u5316\u7ed3\u6784\u4f53 \u901a\u8fc7 . \u8bbf\u95ee\u7ed3\u6784\u4f53\u5b57\u6bb5 \u521d\u59cb\u5316 \u6ca1\u6709\u521d\u59cb\u5316\u7684\u7ed3\u6784\u4f53\uff0c\u5176\u6210\u5458\u53d8\u91cf\u90fd\u662f\u5bf9\u5e94\u5176\u7c7b\u578b\u7684\u96f6\u503c \u4f7f\u7528\u952e\u503c\u5bf9\u5bf9\u7ed3\u6784\u4f53\u8fdb\u884c\u521d\u59cb\u5316\u65f6\uff0c\u952e\u5bf9\u5e94\u7ed3\u6784\u4f53\u7684\u5b57\u6bb5\uff0c\u503c\u5bf9\u5e94\u8be5\u5b57\u6bb5\u7684\u521d\u59cb\u503c \u7ed3\u6784\u4f53\u5360\u7528\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\uff0c\u7a7a\u7ed3\u6784\u4f53\u662f\u4e0d\u5360\u7528\u7a7a\u95f4\u7684 \u7ed3\u6784\u9898\u6ca1\u6709\u6784\u9020\u51fd\u6570\uff0c\u4f46\u662f\u53ef\u4ee5\u81ea\u5df1\u5b9e\u73b0 \u6784\u9020\u51fd\u6570 func newPerson ( name , city string , age int8 ) * person { return & person { name : name , city : city , age : age , } } \u65b9\u6cd5 \u00b6 \u65b9\u6cd5\uff08Method\uff09\u662f\u4e00\u79cd\u4f5c\u7528\u4e8e\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u7684\u51fd\u6570\u3002\u8fd9\u79cd\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u53eb\u505a\u63a5\u6536\u8005\uff08Receiver\uff09\u3002\u63a5\u6536\u8005\u7684\u6982\u5ff5\u5c31\u7c7b\u4f3c\u4e8e\u5176\u4ed6\u8bed\u8a00\u4e2d\u7684 this \u6216\u8005 self\uff0c\u5f53\u7136\u8fd8\u53ef\u4ee5\u6709\u6307\u9488\u7c7b\u578b\u7684\u63a5\u6536\u8005 func ( \u63a5\u6536\u8005\u53d8\u91cf \u63a5\u6536\u8005\u7c7b\u578b ) \u65b9\u6cd5\u540d ( \u53c2\u6570\u5217\u8868 ) ( \u8fd4\u56de\u53c2\u6570 ) { \u51fd\u6570\u4f53 } \u65b9\u6cd5\u4e0e\u51fd\u6570\u7684\u533a\u522b\u662f\uff0c\u51fd\u6570\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u7c7b\u578b\uff0c\u65b9\u6cd5\u5c5e\u4e8e\u7279\u5b9a\u7684\u7c7b\u578b \u5176\u4ed6 \u00b6 \u7ed3\u6784\u4f53\u5141\u8bb8\u5176\u6210\u5458\u5b57\u6bb5\u5728\u58f0\u660e\u65f6\u6ca1\u6709\u5b57\u6bb5\u540d\u800c\u53ea\u6709\u7c7b\u578b\uff0c\u8fd9\u79cd\u6ca1\u6709\u540d\u5b57\u7684\u5b57\u6bb5\u5c31\u79f0\u4e3a\u533f\u540d\u5b57\u6bb5 \u4e00\u4e2a\u7ed3\u6784\u4f53\u4e2d\u53ef\u4ee5\u5d4c\u5957\u5305\u542b\u53e6\u4e00\u4e2a\u7ed3\u6784\u4f53\u6216\u7ed3\u6784\u4f53\u6307\u9488 \u901a\u8fc7\u7ed3\u6784\u4f53\u53ef\u4ee5\u5b9e\u73b0\u201c\u7ee7\u627f\u201d \u7ed3\u6784\u4f53\u4e2d\u5b57\u6bb5\u5927\u5199\u5f00\u5934\u8868\u793a\u53ef\u516c\u5f00\u8bbf\u95ee\uff0c\u5c0f\u5199\u8868\u793a\u79c1\u6709\uff08\u4ec5\u5728\u5b9a\u4e49\u5f53\u524d\u7ed3\u6784\u4f53\u7684\u5305\u4e2d\u53ef\u8bbf\u95ee\uff09 \u7ed3\u6784\u4f53\u53ef\u4ee5\u4f7f\u7528 JSON \u5e8f\u5217\u5316 \u63a5\u53e3 \u00b6 \u63a5\u53e3\u7c7b\u578b \u00b6 \u63a5\u53e3\u662f\u4e00\u79cd\u7531\u7a0b\u5e8f\u5458\u6765\u5b9a\u4e49\u7684\u7c7b\u578b\uff0c\u4e00\u4e2a\u63a5\u53e3\u7c7b\u578b\u5c31\u662f\u4e00\u7ec4\u65b9\u6cd5\u7684\u96c6\u5408\uff0c\u5b83\u89c4\u5b9a\u4e86\u9700\u8981\u5b9e\u73b0\u7684\u6240\u6709\u65b9\u6cd5 \u6bcf\u4e2a\u63a5\u53e3\u7c7b\u578b\u7531\u4efb\u610f\u4e2a\u65b9\u6cd5\u7b7e\u540d\u7ec4\u6210 type \u63a5\u53e3\u7c7b\u578b\u540d interface { \u65b9\u6cd5\u540d1 ( \u53c2\u6570\u5217\u88681 ) \u8fd4\u56de\u503c\u5217\u88681 \u65b9\u6cd5\u540d2 ( \u53c2\u6570\u5217\u88682 ) \u8fd4\u56de\u503c\u5217\u88682 ... } \u63a5\u53e3\u5c31\u662f\u89c4\u5b9a\u4e86\u4e00\u4e2a\u9700\u8981\u5b9e\u73b0\u7684\u65b9\u6cd5\u5217\u8868\uff0c\u5728 Go \u8bed\u8a00\u4e2d\u4e00\u4e2a\u7c7b\u578b\u53ea\u8981\u5b9e\u73b0\u4e86\u63a5\u53e3\u4e2d\u89c4\u5b9a\u7684\u6240\u6709\u65b9\u6cd5\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u79f0\u5b83\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u63a5\u53e3 \u53ef\u4ee5\u901a\u8fc7\u503c\u63a5\u6536\u8005\u6216\u6307\u9488\u63a5\u6536\u8005\u5b9e\u73b0\u501f\u53e3 \u7c7b\u578b\u4e0e\u63a5\u53e3\u7684\u5173\u7cfb \u00b6 \u4e00\u4e2a\u7c7b\u578b\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u591a\u79cd\u7c7b\u578b\u5b9e\u73b0\u540c\u4e00\u63a5\u53e3 \u63a5\u53e3\u7ec4\u5408 \u00b6 \u63a5\u53e3\u4e0e\u63a5\u53e3\u4e4b\u95f4\u53ef\u4ee5\u901a\u8fc7\u4e92\u76f8\u5d4c\u5957\u5f62\u6210\u65b0\u7684\u63a5\u53e3\u7c7b\u578b\uff0c\u4f8b\u5982Go\u6807\u51c6\u5e93io\u6e90\u7801\u4e2d\u5c31\u6709\u5f88\u591a\u63a5\u53e3\u4e4b\u95f4\u4e92\u76f8\u7ec4\u5408\u7684\u793a\u4f8b \u7a7a\u63a5\u53e3 \u00b6 \u7a7a\u63a5\u53e3\u662f\u6307\u6ca1\u6709\u5b9a\u4e49\u4efb\u4f55\u65b9\u6cd5\u7684\u63a5\u53e3\u7c7b\u578b\u3002\u56e0\u6b64\u4efb\u4f55\u7c7b\u578b\u90fd\u53ef\u4ee5\u89c6\u4e3a\u5b9e\u73b0\u4e86\u7a7a\u63a5\u53e3\u3002\u4e5f\u6b63\u662f\u56e0\u4e3a\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u8fd9\u4e2a\u7279\u6027\uff0c\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cf\u53ef\u4ee5\u5b58\u50a8\u4efb\u610f\u7c7b\u578b\u7684\u503c \u901a\u5e38\u6211\u4eec\u5728\u4f7f\u7528\u7a7a\u63a5\u53e3\u7c7b\u578b\u65f6\u4e0d\u5fc5\u4f7f\u7528type\u5173\u952e\u5b57\u58f0\u660e\uff0c\u53ef\u4ee5\u50cf\u4e0b\u9762\u7684\u4ee3\u7801\u4e00\u6837\u76f4\u63a5\u4f7f\u7528interface{}\uff0c var x interface{} \u7a7a\u63a5\u53e3\u4f5c\u4e3a\u51fd\u6570\u7684\u53c2\u6570\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u63a5\u6536\u4efb\u610f\u7c7b\u578b\u7684\u51fd\u6570\u53c2\u6570 \u7a7a\u63a5\u53e3\u4f5c\u4e3amap\u7684\u503c\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u4fdd\u5b58\u4efb\u610f\u503c\u7684\u5b57\u5178 Error \u63a5\u53e3 \u00b6 Go \u8bed\u8a00\u4e2d\u628a\u9519\u8bef\u5f53\u6210\u4e00\u79cd\u7279\u6b8a\u7684\u503c\u6765\u5904\u7406\uff0c\u4e0d\u652f\u6301\u5176\u4ed6\u8bed\u8a00\u4e2d\u4f7f\u7528 try/catch \u6355\u83b7\u5f02\u5e38\u7684\u65b9\u5f0f Go \u8bed\u8a00\u4e2d\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a error \u63a5\u53e3\u6765\u8868\u793a\u9519\u8bef\u7c7b\u578b \u5f53\u4e00\u4e2a\u51fd\u6570\u6216\u65b9\u6cd5\u9700\u8981\u8fd4\u56de\u9519\u8bef\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u662f\u628a\u9519\u8bef\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u8fd4\u56de\u503c\uff0c\u4f8b\u5982\u4e4b\u524d\u67e5\u8be2map\u4e2d\u662f\u5426\u5b58\u5728\u952e\u503c\u5bf9 \u9ed8\u8ba4\u96f6\u503c\u4e3a nil \u4f7f\u7528 fmt.Errorf \u624d\u63cf\u8ff0\u9519\u8bef\u4fe1\u606f \u53ef\u4ee5\u5bf9\u81ea\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9e\u73b0 error \u63a5\u53e3 \u6807\u51c6\u5e93 \u00b6 fmt \u00b6 \u2002\u2002fmt\u5305\u5b9e\u73b0\u4e86\u7c7b\u4f3cC\u8bed\u8a00printf\u548cscanf\u7684\u683c\u5f0f\u5316I/O\u3002\u4e3b\u8981\u5206\u4e3a\u5411\u5916\u8f93\u51fa\u5185\u5bb9\u548c\u83b7\u53d6\u8f93\u5165\u5185\u5bb9\u4e24\u5927\u90e8\u5206 \u5411\u5916\u8f93\u51fa \u00b6 Print() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u7cfb\u7edf\u7684\u6807\u51c6\u8f93\u51fa Fprint() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u4e00\u4e2aio.Writer\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cfw\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u7528\u8fd9\u4e2a\u51fd\u6570\u5f80\u6587\u4ef6\u4e2d\u5199\u5165\u5185\u5bb9 Sprint() \uff1a\u628a\u4f20\u5165\u7684\u6570\u636e\u751f\u6210\u5e76\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32 Errorf() \uff1a\u6839\u636eformat\u53c2\u6570\u751f\u6210\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u8be5\u5b57\u7b26\u4e32\u7684\u9519\u8bef \u83b7\u53d6\u8f93\u5165 \u00b6 Scan() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d\uff0c\u6362\u884c\u7b26\u89c6\u4e3a\u7a7a\u767d\u7b26 Scanf() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u6839\u636eformat\u53c2\u6570\u6307\u5b9a\u7684\u683c\u5f0f\u53bb\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d Scanln() \uff1a\u7c7b\u4f3cScan\uff0c\u5b83\u5728\u9047\u5230\u6362\u884c\u65f6\u624d\u505c\u6b62\u626b\u63cf\u3002\u6700\u540e\u4e00\u4e2a\u6570\u636e\u540e\u9762\u5fc5\u987b\u6709\u6362\u884c\u6216\u8005\u5230\u8fbe\u7ed3\u675f\u4f4d\u7f6e bufio.NewReader \uff1a\u65f6\u5019\u6211\u4eec\u60f3\u5b8c\u6574\u83b7\u53d6\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u800c\u8f93\u5165\u7684\u5185\u5bb9\u53ef\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u4f7f\u7528bufio\u5305\u6765\u5b9e\u73b0 Fscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4eceio.Reader\u4e2d\u8bfb\u53d6\u6570\u636e Sscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4ece\u6307\u5b9a\u5b57\u7b26\u4e32\u4e2d\u8bfb\u53d6\u6570\u636e log \u00b6 Go\u8bed\u8a00\u5185\u7f6e\u7684log\u5305\u5b9e\u73b0\u4e86\u7b80\u5355\u7684\u65e5\u5fd7\u670d\u52a1 log package main import ( \"log\" ) func main () { log . Println ( \"\u8fd9\u662f\u4e00\u6761\u5f88\u666e\u901a\u7684\u65e5\u5fd7\u3002\" ) v := \"\u5f88\u666e\u901a\u7684\" log . Printf ( \"\u8fd9\u662f\u4e00\u6761%s\u65e5\u5fd7\u3002\\n\" , v ) log . Fatalln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1fatal\u7684\u65e5\u5fd7\u3002\" ) log . Panicln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1panic\u7684\u65e5\u5fd7\u3002\" ) } \u9664\u4e86\u9ed8\u8ba4\u63d0\u4f9b\u65e5\u5fd7\u7684\u65f6\u95f4\u4fe1\u606f\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6elogger\u6765\u8bbe\u7f6e\u8f93\u51fa\u4fe1\u606f \u6587\u4ef6\u64cd\u4f5c \u00b6 \u6253\u5f00\u548c\u5173\u95ed\u6587\u4ef6 \u00b6 os.Open() \u51fd\u6570\u80fd\u591f\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u8fd4\u56de\u4e00\u4e2a *File \u548c\u4e00\u4e2a err \u3002\u5bf9\u5f97\u5230\u7684\u6587\u4ef6\u5b9e\u4f8b\u8c03\u7528 close() \u65b9\u6cd5\u80fd\u591f\u5173\u95ed\u6587\u4ef6 open and close package main import ( \"fmt\" \"os\" ) func main () { // \u53ea\u8bfb\u65b9\u5f0f\u6253\u5f00\u5f53\u524d\u76ee\u5f55\u4e0b\u7684main.go\u6587\u4ef6 file , err := os . Open ( \"./main.go\" ) if err != nil { fmt . Println ( \"open file failed!, err:\" , err ) return } // \u5173\u95ed\u6587\u4ef6 file . Close () } \u4e3a\u4e86\u9632\u6b62\u6587\u4ef6\u5fd8\u8bb0\u5173\u95ed\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528defer\u6ce8\u518c\u6587\u4ef6\u5173\u95ed\u8bed\u53e5 \u8bfb\u53d6\u6587\u4ef6 \u00b6 file.Read() \u63a5\u6536\u4e00\u4e2a\u5b57\u8282\u5207\u7247\uff0c\u8fd4\u56de\u8bfb\u53d6\u7684\u5b57\u8282\u6570\u548c\u53ef\u80fd\u7684\u5177\u4f53\u9519\u8bef\uff0c\u8bfb\u5230\u6587\u4ef6\u672b\u5c3e\u65f6\u4f1a\u8fd4\u56de0\u548cio.EOF func ( f * File ) Read ( b [] byte ) ( n int , err error ) \u4f7f\u7528 for \u5faa\u73af\u8bfb\u53d6\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6570\u636e bufio\u8bfb\u53d6\u6587\u4ef6 bufio \u662f\u5728 file \u7684\u57fa\u7840\u4e0a\u5c01\u88c5\u4e86\u4e00\u5c42API\uff0c\u652f\u6301\u66f4\u591a\u7684\u529f\u80fd \u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6 io/ioutil \u5305\u7684 ReadFile \u65b9\u6cd5\u80fd\u591f\u8bfb\u53d6\u5b8c\u6574\u7684\u6587\u4ef6\uff0c\u53ea\u9700\u8981\u5c06\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165 \u6587\u4ef6\u5199\u5165\u64cd\u4f5c \u00b6 os.OpenFile() \u51fd\u6570\u80fd\u591f\u4ee5\u6307\u5b9a\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u4ece\u800c\u5b9e\u73b0\u6587\u4ef6\u5199\u5165\u76f8\u5173\u529f\u80fd Write \u548c WriteString bufio.NewWriter ioutil.WriteFile strconv \u00b6 \u2002\u2002strconv\u5305\u5b9e\u73b0\u4e86\u57fa\u672c\u6570\u636e\u7c7b\u578b\u4e0e\u5176\u5b57\u7b26\u4e32\u8868\u793a\u7684\u8f6c\u6362 Atoi() \u00b6 \u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u6574\u6570\u8f6c\u6362\u4e3aint\u7c7b\u578b Itoa() \u00b6 \u7528\u4e8e\u5c06int\u7c7b\u578b\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u8868\u793a Parse\u7cfb\u5217\u51fd\u6570 \u00b6 \u2002\u2002Parse\u7c7b\u51fd\u6570\u7528\u4e8e\u8f6c\u6362\u5b57\u7b26\u4e32\u4e3a\u7ed9\u5b9a\u7c7b\u578b\u7684\u503c\uff1aParseBool()\u3001ParseFloat()\u3001ParseInt()\u3001ParseUint() \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684bool\u503c func ParseBool ( str string ) ( value bool , err error ) \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684\u6574\u6570\u503c func ParseInt ( s string , base int , bitSize int ) ( i int64 , err error ) \u89e3\u6790\u4e00\u4e2a\u8868\u793a\u6d6e\u70b9\u6570\u7684\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u5176\u503c func ParseFloat ( s string , bitSize int ) ( f float64 , err error ) Format\u7cfb\u5217\u51fd\u6570 \u00b6 \u2002\u2002Format\u7cfb\u5217\u51fd\u6570\u5b9e\u73b0\u4e86\u5c06\u7ed9\u5b9a\u7c7b\u578b\u6570\u636e\u683c\u5f0f\u5316\u4e3astring\u7c7b\u578b\u6570\u636e\u7684\u529f\u80fd \u6839\u636eb\u7684\u503c\u8fd4\u56de\u201dtrue\u201d\u6216\u201dfalse\u201d func FormatBool ( b bool ) string \u8fd4\u56dei\u7684base\u8fdb\u5236\u7684\u5b57\u7b26\u4e32\u8868\u793a func FormatInt ( i int64 , base int ) string \u51fd\u6570\u5c06\u6d6e\u70b9\u6570\u8868\u793a\u4e3a\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de func FormatFloat ( f float64 , fmt byte , prec , bitSize int ) string Referencce \u00b6 Go \u5b98\u65b9\u6587\u6863 Go \u83dc\u9e1f\u6559\u7a0b Go \u8bed\u8a00\u5b66\u4e60\u4e4b\u8def Go by Example \u4e2d\u6587\u7248","title":"Go \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/go/basic/#go","text":"\u7ea6 3054 \u4e2a\u5b57 158 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 12 \u5206\u949f Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60 Go \u7684\u4e00\u4e9b\u8bed\u6cd5\uff0c\u548c\u5176\u4ed6\u7f16\u7a0b\u8bed\u8a00\u65e0\u592a\u5927\u533a\u522b\uff0c\u5165\u95e8\u8fd8\u662f\u5f88\u7b80\u5355\u7684","title":"Go \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/go/basic/#go_1","text":"\u786c\u4ef6\u9650\u5236\uff1a\u6469\u5c14\u5b9a\u5f8b\u5df2\u7136\u5931\u6548 Go \u4e3a\u5e76\u53d1\u800c\u751f\uff1a\u5728\u591a\u6838\u5e76\u53d1\u4e0a\u62e5\u6709\u539f\u751f\u7684\u8bbe\u8ba1\u4f18\u52bf\uff0c\u4ece\u5e95\u5c42\u539f\u751f\u5e76\u53d1 Go \u6027\u80fd\u5f3a\u608d\uff1a\u540c C/C++ \u4e00\u6837\uff0cGo \u4e5f\u662f\u7f16\u8bd1\u578b\u8bed\u8a00\uff0c\u6267\u884c\u6548\u7387\u66f4\u9ad8\uff0c\u6027\u80fd\u66f4\u597d Go \u7b80\u5355\u6613\u5b66\uff1a\u8bed\u6cd5\u7b80\u6d01\u3001\u4ee3\u7801\u98ce\u683c\u7edf\u4e00\u3001\u5f00\u53d1\u6548\u7387\u9ad8","title":"\u4e3a\u4ec0\u4e48\u5b66\u4e60 Go"},{"location":"cs/pl/go/basic/#go_2","text":"","title":"\u600e\u4e48\u88c5 Go"},{"location":"cs/pl/go/basic/#_1","text":"Go \u5b98\u7f51\u4e0b\u8f7d\u5730\u5740 Go \u5b98\u65b9\u955c\u50cf\u7ad9\uff08\u63a8\u8350\uff09 Windows\u5e73\u53f0\u548cMac\u5e73\u53f0\u63a8\u8350\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u7248\uff0cLinux\u5e73\u53f0\u4e0b\u8f7d\u538b\u7f29\u6587\u4ef6\u7248\u3002","title":"\u4e0b\u8f7d"},{"location":"cs/pl/go/basic/#_2","text":"Windows\uff1a\u4ee564\u4f4dWin10\u4e3e\u4f8b\uff0c\u5c06\u9009\u597d\u5b89\u88c5\u5305\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u53cc\u51fb\u4e00\u76f4next\uff0c \u6ce8\u610f\u8981\u6307\u5b9a\u4e00\u4e2aGo \u5b89\u88c5\u76ee\u5f55\uff0c\u8fd9\u5f88\u91cd\u8981 Linux\uff1a # \u5728\u7248\u672c\u9009\u62e9\u597d\u4e0b\u8f7d\u6587\u4ef6\u540e wget https://dl.google.com/go/go1.14.1.linux-amd64.tar.gz # \u5c06\u4e0b\u8f7d\u597d\u7684\u6587\u4ef6\u89e3\u538b\u5230 `/usr/local` \u76ee\u5f55\u4e2d\uff0c\u6ca1\u6709\u6743\u9650\u52a0\u4e0a `sudo` tar -zxvf go1.14.1.linux-amd64.tar.gz -C /usr/local # \u914d\u7f6e\u73af\u5883\u53d8\u91cf\uff0c\u5728 `~/.profile` \u4e2d\u6dfb\u52a0\u4ee5\u4e0b\u4ee3\u7801\uff0c\u5e76\u7528 `source` \u91cd\u65b0\u52a0\u8f7d export GOROOT = /usr/local/go export PATH = $PATH : $GOROOT /bin - Mac\uff1a\u4e0b\u8f7d\u53ef\u6267\u884c\u6587\u4ef6\u540e\uff0c\u76f4\u63a5\u70b9\u51fb\u4e0b\u4e00\u6b65\u5b89\u88c5\u5373\u53ef\uff0c\u9ed8\u8ba4\u4f1a\u5c06 go \u5b89\u88c5\u5230 /usr/local/go \u76ee\u5f55\u4e0b","title":"\u5b89\u88c5"},{"location":"cs/pl/go/basic/#goroot-gopath","text":"GOROOT \u548c GOPATH \u90fd\u662f\u73af\u5883\u53d8\u91cf\uff0c\u5176\u4e2d GOROOT \u662f\u6211\u4eec\u5b89\u88c5go\u5f00\u53d1\u5305\u7684\u8def\u5f84\uff0c\u800c\u4ece Go 1.8 \u7248\u672c\u5f00\u59cb\uff0cGo\u5f00\u53d1\u5305\u5728\u5b89\u88c5\u5b8c\u6210\u540e\u4f1a\u4e3a GOPATH \u8bbe\u7f6e\u4e00\u4e2a\u9ed8\u8ba4\u76ee\u5f55\uff0c\u5e76\u4e14\u5728 Go1.14 \u53ca\u4e4b\u540e\u7684\u7248\u672c\u4e2d\u542f\u7528\u4e86 Go Module \u6a21\u5f0f\u4e4b\u540e\uff0c\u4e0d\u4e00\u5b9a\u975e\u8981\u5c06\u4ee3\u7801\u5199\u5230 GOPATH \u76ee\u5f55\u4e0b\uff0c\u6240\u4ee5\u4e5f\u5c31\u4e0d\u9700\u8981\u6211\u4eec\u518d\u81ea\u5df1\u914d\u7f6e GOPATH \u4e86\uff0c\u4f7f\u7528\u9ed8\u8ba4\u7684\u5373\u53ef\u3002 \u67e5\u770b GOPATH \u8def\u5f84\uff1a go env GOPROXY Go1.14 \u7248\u672c\u4e4b\u540e\uff0c\u90fd\u63a8\u8350\u4f7f\u7528 go mod \u6a21\u5f0f\u6765\u7ba1\u7406\u4f9d\u8d56\u73af\u5883\u4e86\uff0c\u4e5f\u4e0d\u518d\u5f3a\u5236\u6211\u4eec\u628a\u4ee3\u7801\u5fc5\u987b\u5199\u5728 GOPATH \u4e0b\u9762\u7684src\u76ee\u5f55\u4e86\uff0c\u4f60\u53ef\u4ee5\u5728\u4f60\u7535\u8111\u7684\u4efb\u610f\u4f4d\u7f6e\u7f16\u5199go\u4ee3\u7801\u3002\uff08\u7f51\u4e0a\u6709\u4e9b\u6559\u7a0b\u9002\u7528\u4e8e1.11\u7248\u672c\u4e4b\u524d\u3002\uff09 \u9ed8\u8ba4 GoPROXY \u914d\u7f6e\u662f\uff1a GOPROXY = https://proxy.golang.org,direct \uff0c\u7531\u4e8e\u56fd\u5185\u8bbf\u95ee\u4e0d\u5230 https://proxy.golang.org \uff0c\u6240\u4ee5\u6211\u4eec\u9700\u8981\u6362\u4e00\u4e2aPROXY\uff0c\u8fd9\u91cc\u63a8\u8350\u4f7f\u7528 https://goproxy.io \u6216 https://goproxy.cn \u3002 \u53ef\u4ee5\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539GOPROXY\uff1a go env -w GOPROXY = https://goproxy.cn,direct","title":"GOROOT \u548c GOPATH"},{"location":"cs/pl/go/basic/#go_3","text":"\u4efb\u4f55\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u7f16\u5199 Go\uff08\u5305\u62ec\u8bb0\u4e8b\u672c\uff09\uff0c\u8fd9\u91cc\u63a8\u8350\u7528 VsCode\uff08\u9700\u5b89\u88c5 Go \u6269\u5c55\uff09\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528Sublime\uff0cJB \u7684\u5168\u5bb6\u6876\u7b49\u7b49","title":"\u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c Go"},{"location":"cs/pl/go/basic/#go-mod-init","text":"\u4f7f\u7528 go module \u6a21\u5f0f\u65b0\u5efa\u9879\u76ee\u65f6\uff0c\u6211\u4eec\u9700\u8981\u901a\u8fc7 go mod init \u9879\u76ee\u540d\u547d\u4ee4\u5bf9\u9879\u76ee\u8fdb\u884c\u521d\u59cb\u5316\uff0c\u8be5\u547d\u4ee4\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210 go.mod \u6587\u4ef6\u3002\u6267\u884c\u5982\u4e0b\u547d\u4ee4 go mod init ${ project } \u8bb0\u5f97\u914d\u7f6e\u597d GOPROXY","title":"go mod init"},{"location":"cs/pl/go/basic/#_3","text":"go build \uff1a \u547d\u4ee4\u8868\u793a\u5c06\u6e90\u4ee3\u7801\u7f16\u8bd1\u6210\u53ef\u6267\u884c\u6587\u4ef6\u3002 go run \uff1a\u547d\u4ee4\u672c\u8d28\u4e0a\u662f\u5148\u5728\u4e34\u65f6\u76ee\u5f55\u7f16\u8bd1\u7a0b\u5e8f\u7136\u540e\u518d\u6267\u884c\u3002 go install \uff1a\u5b83\u5148\u7f16\u8bd1\u6e90\u4ee3\u7801\u5f97\u5230\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u7136\u540e\u5c06\u53ef\u6267\u884c\u6587\u4ef6\u79fb\u52a8\u5230GOPATH\u7684bin\u76ee\u5f55\u4e0b\u3002\u56e0\u4e3a \u628a GOPATH \u4e0b\u7684 bin \u76ee\u5f55\u6dfb\u52a0\u5230\u4e86\u73af\u5883\u53d8\u91cf\u4e2d \uff0c\u6240\u4ee5\u5c31\u53ef\u4ee5\u5728\u4efb\u610f\u5730\u65b9\u76f4\u63a5\u6267\u884c\u53ef\u6267\u884c\u6587\u4ef6\u3002","title":"\u7f16\u8bd1\u3001\u8fd0\u884c\u3001\u5b89\u88c5"},{"location":"cs/pl/go/basic/#go-module","text":"go module \u662fGo1.13\u7248\u672c\u4e4b\u540e\u3002Go\u8bed\u8a00\u9ed8\u8ba4\u7684\u4f9d\u8d56\u7ba1\u7406\u5de5\u5177\u3002 \u8bbe\u7f6e\u597d GO111MODULE=on \u5c31\u53ef\u4ee5\u4f7f\u7528 go module \u4f7f\u7528 go module`` \u7ba1\u7406\u4f9d\u8d56\u540e\u4f1a\u5728\u9879\u76ee\u6839\u76ee\u5f55\u4e0b\u751f\u6210\u4e24\u4e2a\u6587\u4ef6 go.mod \u548c go.sum` go mod \u547d\u4ee4\uff1a go mod download \u4e0b\u8f7d\u4f9d\u8d56\u7684module\u5230\u672c\u5730cache\uff08\u9ed8\u8ba4\u4e3a$GOPATH/pkg/mod\u76ee\u5f55\uff09 go mod edit \u7f16\u8f91go.mod\u6587\u4ef6 go mod graph \u6253\u5370\u6a21\u5757\u4f9d\u8d56\u56fe go mod init \u521d\u59cb\u5316\u5f53\u524d\u6587\u4ef6\u5939, \u521b\u5efago.mod\u6587\u4ef6 go mod tidy \u589e\u52a0\u7f3a\u5c11\u7684module\uff0c\u5220\u9664\u65e0\u7528\u7684module go mod vendor \u5c06\u4f9d\u8d56\u590d\u5236\u5230vendor\u4e0b go mod verify \u6821\u9a8c\u4f9d\u8d56 go mod why \u89e3\u91ca\u4e3a\u4ec0\u4e48\u9700\u8981\u4f9d\u8d56 go.mod\u6587\u4ef6\u8bb0\u5f55\u4e86\u9879\u76ee\u6240\u6709\u7684\u4f9d\u8d56\u4fe1\u606f \u5728\u9879\u76ee\u4e2d\u6267\u884c go get \u547d\u4ee4\u53ef\u4ee5\u4e0b\u8f7d\u4f9d\u8d56\u5305\uff0c\u5e76\u4e14\u8fd8\u53ef\u4ee5\u6307\u5b9a\u4e0b\u8f7d\u7684\u7248\u672c","title":"go module"},{"location":"cs/pl/go/basic/#_4","text":"\u53d8\u91cf \u9700\u8981\u663e\u5f0f\u58f0\u660e\uff0c\u5e76\u4e14\u5728\u51fd\u6570\u8c03\u7528\u7b49\u60c5\u51b5\u4e0b\uff0c\u7f16\u8bd1\u5668\u4f1a\u68c0\u67e5\u5176\u7c7b\u578b\u7684\u6b63\u786e\u6027 var \u58f0\u660e1\u4e2a\u6216\u591a\u4e2a\u53d8\u91cf\uff0cGo \u4f1a\u81ea\u52a8\u63a8\u65ad\u5df2\u7ecf\u6709\u521d\u59cb\u503c\u7684\u53d8\u91cf\u7c7b\u578b \u58f0\u660e\u540e\u5374\u6ca1\u6709\u7ed9\u51fa\u5bf9\u5e94\u7684\u521d\u59cb\u503c\u65f6\uff0c\u53d8\u91cf\u5c06\u4f1a\u521d\u59cb\u5316\u4e3a \u96f6\u503c \u3002 \u4f8b\u5982\uff0cint \u7684\u96f6\u503c\u662f 0 := \u8bed\u6cd5\u662f\u58f0\u660e\u5e76\u521d\u59cb\u5316\u53d8\u91cf\u7684\u7b80\u5199\uff08\u4e0d\u80fd\u5728\u51fd\u6570\u5916\u4f7f\u7528\uff09\uff0c \u4f8b\u5982 var f string = \"short\" \u53ef\u4ee5\u7b80\u5199\u4e3a f := \"short\" \u5728\u4f7f\u7528\u591a\u91cd\u8d4b\u503c\u65f6\uff0c\u5982\u679c\u60f3\u8981\u5ffd\u7565\u67d0\u4e2a\u503c\uff0c\u53ef\u4ee5\u4f7f\u7528\u533f\u540d\u53d8\u91cf\uff0c\u4e00\u4e2a\u4e0b\u5212\u7ebf _ \u8868\u793a \u5e38\u91cf \u652f\u6301\u5b57\u7b26\u3001\u5b57\u7b26\u4e32\u3001\u5e03\u5c14\u548c\u6570\u503c\u5e38\u91cf const \u7528\u4e8e\u58f0\u660e\u4e00\u4e2a\u5e38\u91cf const \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u5728\u4efb\u4f55 var \u8bed\u53e5\u53ef\u4ee5\u51fa\u73b0\u7684\u5730\u65b9 iota \u662f\u5e38\u91cf\u8ba1\u6570\u5668\uff0c\u5728 const \u5173\u952e\u5b57\u51fa\u73b0\u65f6\u4f1a\u88ab\u91cd\u7f6e\u4e3a0","title":"\u53d8\u91cf\u548c\u5e38\u91cf"},{"location":"cs/pl/go/basic/#_5","text":"","title":"\u6761\u4ef6\u8bed\u53e5"},{"location":"cs/pl/go/basic/#ifelse","text":"if-else if-else \u7ed3\u6784 Go \u89c4\u5b9a\u4e0e if \u5339\u914d\u7684\u5de6\u62ec\u53f7 { \u5fc5\u987b\u4e0e if \u548c\u8868\u8fbe\u5f0f\u653e\u5728\u540c\u884c\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4f1a\u89e6\u53d1\u7f16\u8bd1\u9519\u8bef\uff0c\u540c\u7406else \u5728\u6761\u4ef6\u8bed\u53e5\u4e4b\u524d\u53ef\u4ee5\u6709\u4e00\u4e2a\u58f0\u660e\u8bed\u53e5\uff1b\u5728\u8fd9\u91cc\u58f0\u660e\u7684\u53d8\u91cf\u53ef\u4ee5\u5728\u8fd9\u4e2a\u8bed\u53e5\u6240\u6709\u7684\u6761\u4ef6\u5206\u652f\u4e2d\u4f7f\u7528 \u5728 Go \u4e2d\uff0c\u6761\u4ef6\u8bed\u53e5\u7684\u5706\u62ec\u53f7\u4e0d\u662f\u5fc5\u9700\u7684\uff0c\u4f46\u662f\u82b1\u62ec\u53f7\u662f\u5fc5\u9700\u7684 Go \u6ca1\u6709\u4e09\u76ee\u8fd0\u7b97\u7b26\uff0c \u5373\u4f7f\u662f\u57fa\u672c\u7684\u6761\u4ef6\u5224\u65ad\uff0c\u4f9d\u7136\u9700\u8981\u4f7f\u7528\u5b8c\u6574\u7684 if \u8bed\u53e5 if-else if num := 9 ; num < 0 { fmt . Println ( num , \"is negative\" ) } else if num < 10 { fmt . Println ( num , \"has 1 digit\" ) } else { fmt . Println ( num , \"has multiple digits\" ) }","title":"if/else \u5206\u652f"},{"location":"cs/pl/go/basic/#switch","text":"\u4e0d\u5e26\u8868\u8fbe\u5f0f\u7684 switch \u662f\u5b9e\u73b0 if/else \u903b\u8f91\u7684\u53e6\u4e00\u79cd\u65b9\u5f0f \u6bcf\u4e2a switch \u53ea\u80fd\u6709\u4e00\u4e2a default \u5206\u652f \u4e00\u4e2a\u5206\u652f\u53ef\u4ee5\u6709\u591a\u4e2a\u503c\uff0c\u591a\u4e2acase\u503c\u4e2d\u95f4\u4f7f\u7528\u82f1\u6587\u9017\u53f7\u5206\u9694 fallthrough \u8bed\u6cd5\u53ef\u4ee5\u6267\u884c\u6ee1\u8db3\u6761\u4ef6\u7684case\u7684\u4e0b\u4e00\u4e2acase\uff0c\u662f\u4e3a\u4e86\u517c\u5bb9C\u8bed\u8a00\u4e2d\u7684case\u8bbe\u8ba1\u7684 switch func switchDemo5 () { s := \"a\" switch { case s == \"a\" : fmt . Println ( \"a\" ) fallthrough case s == \"b\" : fmt . Println ( \"b\" ) case s == \"c\" : fmt . Println ( \"c\" ) default : fmt . Println ( \"...\" ) } }","title":"switch \u5206\u652f"},{"location":"cs/pl/go/basic/#_6","text":"\u7ecf\u5178\u7684\u521d\u59cb/\u6761\u4ef6/\u540e\u7eed for \u5faa\u73af for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u53ef\u4ee5\u88ab\u5ffd\u7565\uff0c\u4f46\u662f\u521d\u59cb\u8bed\u53e5\u540e\u7684\u5206\u53f7\u5fc5\u987b\u8981\u5199 for\u5faa\u73af\u7684\u521d\u59cb\u8bed\u53e5\u548c\u7ed3\u675f\u8bed\u53e5\u90fd\u53ef\u4ee5\u7701\u7565 for\u5faa\u73af\u53ef\u4ee5\u901a\u8fc7break\u3001goto\u3001return\u3001panic\u8bed\u53e5\u5f3a\u5236\u9000\u51fa\u5faa\u73af Go\u8bed\u8a00\u4e2d\u53ef\u4ee5\u4f7f\u7528for range\u904d\u5386\u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u3001map \u53ca\u901a\u9053\uff08channel\uff09\u3002 \u901a\u8fc7for range\u904d\u5386\u7684\u8fd4\u56de\u503c\u6709\u4ee5\u4e0b\u89c4\u5f8b \u6570\u7ec4\u3001\u5207\u7247\u3001\u5b57\u7b26\u4e32\u8fd4\u56de\u7d22\u5f15\u548c\u503c\u3002 map\u8fd4\u56de\u952e\u548c\u503c\u3002 \u901a\u9053\uff08channel\uff09\u53ea\u8fd4\u56de\u901a\u9053\u5185\u7684\u503c for for i := 0 ; i < 10 ; i ++ { ... } for ; i < 10 ; i ++ { ... } for i < 10 { ... } for i , v := range ** { ... }","title":"\u5faa\u73af"},{"location":"cs/pl/go/basic/#_7","text":"","title":"\u6570\u636e\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_8","text":"\u6574\u578b\u6709int8/16/32/64\uff0c\u5305\u62ec\u5bf9\u5e94\u7684\u65e0\u7b26\u53f7\u6574\u578b \u6d6e\u70b9\u578b\u6709float32/64 \u590d\u6570\u6709complex64/128 \u8fd0\u7b97\uff1a \u548cC/C++\u65e0\u592a\u5927\u5dee\u522b","title":"\u6570\u5b57\u4e0e\u8fd0\u7b97"},{"location":"cs/pl/go/basic/#_9","text":"\u901a\u8fc7 bool \u6765\u58f0\u660e\u5e03\u5c14\u578b\u6570\u636e\uff0c\u53ea\u6709 true \u548c false \u9ed8\u8ba4\u503c\u4e3a false \u4e0d\u5141\u8bb8\u5c06\u6574\u578b\u5f3a\u5236\u8f6c\u6362\u4e3a\u5e03\u5c14\u578b \u5e03\u5c14\u578b\u65e0\u6cd5\u53c2\u4e0e\u6570\u503c\u8fd0\u7b97\uff0c\u4e5f\u65e0\u6cd5\u4e0e\u5176\u4ed6\u7c7b\u578b\u8fdb\u884c\u8f6c\u6362","title":"\u5e03\u5c14\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_10","text":"\u5b57\u7b26\u4e32\u7684\u5185\u90e8\u5b9e\u73b0\u4f7f\u7528 UTF-8 \u7f16\u7801\uff0c\u5b57\u7b26\u4e32\u7684\u503c\u4e3a\u53cc\u5f15\u53f7(\")\u4e2d\u7684\u5185\u5bb9\uff0c\u53ef\u4ee5\u5728Go\u8bed\u8a00\u7684\u6e90\u7801\u4e2d\u76f4\u63a5\u6dfb\u52a0\u975eASCII\u7801\u5b57\u7b26 \u8981\u5b9a\u4e49\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u65f6\uff0c\u5c31\u5fc5\u987b\u4f7f\u7528\u53cd\u5f15\u53f7\u5b57\u7b26\uff0c\u53cd\u5f15\u53f7\u95f4\u6362\u884c\u5c06\u88ab\u4f5c\u4e3a\u5b57\u7b26\u4e32\u4e2d\u7684\u6362\u884c\uff0c\u4f46\u662f\u6240\u6709\u7684\u8f6c\u4e49\u5b57\u7b26\u5747\u65e0\u6548\uff0c\u6587\u672c\u5c06\u4f1a\u539f\u6837\u8f93\u51fa s := `\u7b2c\u4e00\u884c \u7b2c\u4e8c\u884c \u7b2c\u4e09\u884c ` \u5e38\u7528\u65b9\u6cd5 len(str) \uff1a\u6c42\u957f\u5ea6 +\u6216fmt.Sprintf \uff1a\u62fc\u63a5\u5b57\u7b26\u4e32 strings.Split \uff1a\u5206\u5272 strings.contains \uff1a\u5224\u65ad\u662f\u5426\u5305\u542b strings.HasPrefix,strings.HasSuffix \uff1a\u524d\u7f00/\u540e\u7f00\u5224\u65ad strings.Index(),strings.LastIndex() \uff1a\u5b50\u4e32\u51fa\u73b0\u7684\u4f4d\u7f6e strings.Join(a[]string, sep string) \uff1ajoin\u64cd\u4f5c","title":"\u5b57\u7b26\u4e32"},{"location":"cs/pl/go/basic/#byterune","text":"\u7ec4\u6210\u6bcf\u4e2a\u5b57\u7b26\u4e32\u7684\u5143\u7d20\u53eb\u505a\u201c\u5b57\u7b26\u201d\uff0c\u53ef\u4ee5\u901a\u8fc7\u904d\u5386\u6216\u8005\u5355\u4e2a\u83b7\u53d6\u5b57\u7b26\u4e32\u5143\u7d20\u83b7\u5f97\u5b57\u7b26\u3002 \u5b57\u7b26\u7528\u5355\u5f15\u53f7\uff08\u2019\uff09\u5305\u88f9\u8d77\u6765 Go \u5305\u62ec\u4e24\u79cd\u5b57\u7b26\uff1a uint8 \u7c7b\u578b\uff0c\u6216\u8005\u53eb byte \u578b\uff0c\u4ee3\u8868\u4e00\u4e2a ASCII \u7801\u5b57\u7b26 rune \u7c7b\u578b\uff0c\u4ee3\u8868\u4e00\u4e2a UTF-8 \u5b57\u7b26 \u5f53\u9700\u8981\u5904\u7406\u4e2d\u6587\u3001\u65e5\u6587\u6216\u8005\u5176\u4ed6\u590d\u5408\u5b57\u7b26\u65f6\uff0c\u5219\u9700\u8981\u7528\u5230 rune \u7c7b\u578b\u3002 rune \u7c7b\u578b\u5b9e\u9645\u662f\u4e00\u4e2a int32 Go \u4f7f\u7528\u4e86\u7279\u6b8a\u7684 rune \u7c7b\u578b\u6765\u5904\u7406 Unicode \uff0c\u8ba9\u57fa\u4e8e Unicode \u7684\u6587\u672c\u5904\u7406\u66f4\u4e3a\u65b9\u4fbf\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u7528 byte \u578b\u8fdb\u884c\u9ed8\u8ba4\u5b57\u7b26\u4e32\u5904\u7406\uff0c\u6027\u80fd\u548c\u6269\u5c55\u6027\u90fd\u6709\u7167\u987e \u5b57\u7b26\u4e32\u5e95\u5c42\u662f\u4e00\u4e2abyte\u6570\u7ec4\uff0c\u6240\u4ee5\u53ef\u4ee5\u548c []byte \u7c7b\u578b\u76f8\u4e92\u8f6c\u6362 \u5b57\u7b26\u4e32\u662f\u4e0d\u80fd\u4fee\u6539\u7684\uff0c\u5b57\u7b26\u4e32\u662f\u7531 byte \u5b57\u8282\u7ec4\u6210\uff0c\u6240\u4ee5\u5b57\u7b26\u4e32\u7684\u957f\u5ea6\u662f byte \u5b57\u8282\u7684\u957f\u5ea6 rune \u7c7b\u578b\u7528\u6765\u8868\u793a utf8 \u5b57\u7b26\uff0c\u4e00\u4e2a rune \u5b57\u7b26\u7531\u4e00\u4e2a\u6216\u591a\u4e2a byte \u7ec4\u6210 \u8981\u4fee\u6539\u5b57\u7b26\u4e32\uff0c\u9700\u8981\u5148\u5c06\u5176\u8f6c\u6362\u6210 []rune \u6216 []byte \uff0c\u5b8c\u6210\u540e\u518d\u8f6c\u6362\u4e3a string byte and rune s1 := \"big\" // \u5f3a\u5236\u7c7b\u578b\u8f6c\u6362 byteS1 := [] byte ( s1 ) byteS1 [ 0 ] = 'p' fmt . Println ( string ( byteS1 )) s2 := \"\u767d\u841d\u535c\" runeS2 := [] rune ( s2 ) runeS2 [ 0 ] = '\u7ea2' fmt . Println ( string ( runeS2 ))","title":"byte\u548crune\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_11","text":"\u5b9a\u4e49\u4e00\u4e2a\u957f\u5ea6\u4e3a3\u5143\u7d20\u7c7b\u578b\u4e3aint\u7684\u6570\u7ec4a\uff1a var a [3]int \u5185\u7f6e\u51fd\u6570 len \u53ef\u4ee5\u8fd4\u56de\u6570\u7ec4\u7684\u957f\u5ea6 \u521d\u59cb\u5316 \u53ef\u4ee5\u4f7f\u7528\u521d\u59cb\u5316\u5217\u8868\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff1a var num = [3]int{1, 2} \u53ef\u4ee5\u8ba9\u7f16\u8bd1\u5668\u6839\u636e\u521d\u59cb\u503c\u7684\u4e2a\u6570\u81ea\u884c\u63a8\u65ad\u6570\u7ec4\u7684\u957f\u5ea6\uff0c var num = [...]{1, 2} \u6307\u5b9a\u7d22\u5f15\u503c\u6765\u521d\u59cb\u5316\u6570\u7ec4\uff0c num := [...]int{1: 1, 3: 5} \u904d\u5386 for i := 0; i < len(a); i ++ {} for index, value := range a {} \u591a\u7ef4\u6570\u7ec4\u5b9a\u4e49\uff0c a := [2][3]int \u591a\u7ef4\u6570\u7ec4\u53ea\u6709\u7b2c\u4e00\u5c42\u53ef\u4ee5\u4f7f\u7528 ... \u6765\u8ba9\u7f16\u8bd1\u5668\u63a8\u5bfc\u6570\u7ec4\u957f\u5ea6\uff0c\u4e0d\u652f\u6301\u5185\u5c42\u4f7f\u7528 \u6570\u7ec4\u662f\u503c\u7c7b\u578b\uff0c\u8d4b\u503c\u548c\u4f20\u53c2\u4f1a\u590d\u5236\u6574\u4e2a\u6570\u7ec4\uff0c\u56e0\u6b64\u6539\u53d8\u526f\u672c\u7684\u503c\uff0c\u4e0d\u4f1a\u6539\u53d8\u672c\u8eab\u7684\u503c [n]*T \u8868\u793a\u6307\u9488\u6570\u7ec4\uff0c *[n]T \u8868\u793a\u6570\u7ec4\u6307\u9488","title":"\u6570\u7ec4"},{"location":"cs/pl/go/basic/#_12","text":"\u5b9a\u4e49 \u5207\u7247\uff08Slice\uff09\u662f\u4e00\u4e2a\u62e5\u6709\u76f8\u540c\u7c7b\u578b\u5143\u7d20\u7684\u53ef\u53d8\u957f\u5ea6\u7684\u5e8f\u5217\u3002\u5b83\u662f\u57fa\u4e8e\u6570\u7ec4\u7c7b\u578b\u505a\u7684\u4e00\u5c42\u5c01\u88c5\u3002\u5b83\u975e\u5e38\u7075\u6d3b\uff0c\u652f\u6301\u81ea\u52a8\u6269\u5bb9 \u5207\u7247\u58f0\u660e\uff1a var name []T \uff0cname \u8868\u793a\u53d8\u91cf\u540d\uff0cT \u8868\u793a\u5207\u7247\u4e2d\u7684\u5143\u7d20\u7c7b\u578b \u5207\u7247\u62e5\u6709\u81ea\u5df1\u7684\u957f\u5ea6\u548c\u5bb9\u91cf\uff0c\u6211\u4eec\u53ef\u4ee5\u901a\u8fc7\u4f7f\u7528\u5185\u7f6e\u7684len()\u51fd\u6570\u6c42\u957f\u5ea6\uff0c\u4f7f\u7528\u5185\u7f6e\u7684cap()\u51fd\u6570\u6c42\u5207\u7247\u7684\u5bb9\u91cf \u5207\u7247\u7684\u5e95\u5c42\u5c31\u662f\u6570\u7ec4\uff0c\u548c Python \u4e00\u6837\uff0c\u53ef\u4ee5\u4f7f\u7528 b := a[1:3] \uff0c\u8868\u793a\u4ece\u6570\u7ec4 a \u4e2d\u9009\u51fa \u7d22\u5f15\u503c\u5728 \\([1,3)\\) \u4e2d\u7684\u5143\u7d20\u7ec4\u6210\u5207\u7247 b \u5b8c\u6574\u7684\u5207\u7247\u8868\u8fbe\u5f0f\uff1a a[low: high: max] \uff0c\u5f97\u5230\u7684\u7ed3\u679c\u5207\u7247\u7684\u5bb9\u91cf\u8bbe\u7f6e\u4e3a max - low \uff0clow \u53ef\u4ee5\u7701\u7565\uff0c\u9ed8\u8ba4\u4e3a0 \u4f7f\u7528\u5185\u7f6e make\u51fd\u6570 \u6784\u9020\u5207\u7247\uff0c make([]T, size, cap) \uff0cT \u8868\u793a\u5143\u7d20\u7c7b\u578b\uff0csize \u8868\u793a\u5143\u7d20\u6570\u91cf\uff0ccap \u8868\u793a\u5207\u7247\u5bb9\u91cf \u5224\u65ad\u5207\u7247\u662f\u5426\u4e3a\u7a7a\uff0c\u8bf7\u4f7f\u7528 len(s) == 0 \uff0c\u4e0d\u8981\u4f7f\u7528 s == nil \u5207\u7247\u4e0d\u80fd\u76f4\u63a5\u6bd4\u8f83 \u5207\u7247\u904d\u5386\u548c\u6570\u7ec4\u4e00\u6837 \u53ef\u4ee5\u7528 append() \u4e3a\u5207\u7247\u6dfb\u52a0\u5143\u7d20 s = append(s, 1,2,3) \uff0c\u4e5f\u53ef\u4ee5\u6dfb\u52a0\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5143\u7d20 s = append(s, s2...) \u5207\u7247\u7684\u6269\u5bb9\u7b56\u7565\uff08\u7565\uff09 \u53ef\u4ee5\u4f7f\u7528 copy() \u590d\u5236\u5207\u7247\uff0c\u4f46\u5207\u7247\u662f\u5f15\u7528\u7c7b\u578b\uff0c\u6240\u4ee5\u4e24\u4e2a\u5207\u7247\u90fd\u6307\u5411\u540c\u4e00\u5757\u5185\u5b58\u5730\u5740\uff0c\u5bf9\u4e00\u4e2a\u5207\u7247\u7684\u4fee\u6539\u4f1a\u5f71\u54cd\u53e6\u4e00\u4e2a\u5207\u7247\u7684\u5185\u5bb9 \u6392\u5e8f\uff0c\u9700\u8981 import sort \uff0c\u6392\u5e8f\u65f6\u53ef\u81ea\u5b9a\u4e49\u6392\u5e8f sort.Slice(a, func(i, j int) bool { return a[i] < a[j] })","title":"\u5207\u7247"},{"location":"cs/pl/go/basic/#map","text":"\u4e00\u79cd\u65e0\u5e8f\u7684 key-value \u6570\u636e\u7ed3\u6784\uff0c\u5728 Go \u4e2d map \u662f\u5f15\u7528\u7c7b\u578b\uff0c\u5fc5\u987b\u521d\u59cb\u5316\u624d\u80fd\u4f7f\u7528 \u5b9a\u4e49\uff1a map[KeyType]ValueType \uff0cKeyType \u8868\u793a\u952e\u7684\u7c7b\u578b\uff0cValueType \u8868\u793a\u952e\u5bf9\u5e94\u7684\u503c\u7684\u7c7b\u578b\uff0c x := map[int]int{1:3, 2:4} \u6216 s := make([int]int, 2), s[1] = 3, s[2] = 4 \u5224\u65ad\u952e\u662f\u5426\u5b58\u5728\uff1a value, ok := map[key] \uff0c\u67e5\u770b ok \u662f\u5426\u4e3a true \u904d\u5386\uff1a for k, v := range map {} \uff0cv \u53ef\u7701\u7565\uff0c\u904d\u5386\u5143\u7d20\u7684\u987a\u5e8f\u4e0e\u6dfb\u52a0\u952e\u503c\u5bf9\u7684\u987a\u5e8f\u65e0\u5173\uff0c\u53ef\u4ee5\u628a key \u653e\u5165 slice \u4e2d\u6392\u5e8f\uff0c\u7136\u540e\u904d\u5386 slice \u5c31\u53ef\u4ee5\u6307\u5b9a\u987a\u5e8f delete() \u4ece map \u4e2d\u5220\u9664\u4e00\u7ec4\u952e\u503c\u5bf9","title":"Map"},{"location":"cs/pl/go/basic/#_13","text":"\u4f7f\u7528 func \u6765\u5b9a\u4e49\u51fd\u6570 \u901a\u8fc7\u51fd\u6570\u540d\u7684\u65b9\u5f0f\u8c03\u7528\u51fd\u6570 \u51fd\u6570\u7684\u53c2\u6570\u4e2d\u5982\u679c\u76f8\u90bb\u53d8\u91cf\u7684\u7c7b\u578b\u76f8\u540c\uff0c\u5219\u53ef\u4ee5\u7701\u7565\u7c7b\u578b\uff0c \u53ef\u53d8\u53c2\u6570\u662f\u6307\u51fd\u6570\u7684\u53c2\u6570\u6570\u91cf\u4e0d\u56fa\u5b9a\u3002Go\u8bed\u8a00\u4e2d\u7684\u53ef\u53d8\u53c2\u6570\u901a\u8fc7\u5728\u53c2\u6570\u540d\u540e\u52a0 ... \u6765\u6807\u8bc6\uff0c\u53ef\u53d8\u53c2\u6570\u901a\u5e38\u8981\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u53c2\u6570 \u51fd\u6570\u5982\u679c\u6709\u591a\u4e2a\u8fd4\u56de\u503c\uff0c\u5fc5\u987b\u4f7f\u7528 () \u5c06\u6240\u6709\u8fd4\u56de\u503c\u5305\u88f9 \u51fd\u6570\u5b9a\u4e49\u65f6\u53ef\u4ee5\u7ed9\u8fd4\u56de\u503c\u547d\u540d\uff0c\u5e76\u5728\u51fd\u6570\u4f53\u4e2d\u76f4\u63a5\u4f7f\u7528\u8fd9\u4e9b\u53d8\u91cf\uff0c\u6700\u540e\u901a\u8fc7return\u5173\u952e\u5b57\u8fd4\u56de \u53ef\u4ee5\u4f7f\u7528 type \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u4e00\u4e2a\u51fd\u6570\u7c7b\u578b \u9ad8\u9636\u51fd\u6570 \u51fd\u6570\u4f5c\u4e3a\u53c2\u6570 \u51fd\u6570\u4f5c\u4e3a\u8fd4\u56de\u503c \u53ef\u4ee5\u5b9a\u4e49\u533f\u540d\u51fd\u6570\uff0c add := func(x, y int) \uff0c\u591a\u7528\u4e8e\u56de\u8c03\u51fd\u6570\u548c\u95ed\u5305 \u95ed\u5305=\u51fd\u6570+\u5f15\u7528\u73af\u5883\uff08\u7565\uff09 defer \u8bed\u53e5\uff0c\u5c06\u5176\u540e\u9762\u8ddf\u968f\u7684\u8bed\u53e5\u8fdb\u884c\u5ef6\u8fdf\u5904\u7406\uff0c\u4f1a\u88ab\u9006\u5e8f\u5904\u7406 \u4f7f\u7528 panic/recover \u6a21\u5f0f\u6765\u5904\u7406\u9519\u8bef\uff0c recover()\u5fc5\u987b\u642d\u914ddefer\u4f7f\u7528\uff0cdefer\u4e00\u5b9a\u8981\u5728\u53ef\u80fd\u5f15\u53d1panic\u7684\u8bed\u53e5\u4e4b\u524d\u5b9a\u4e49 func func \u51fd\u6570\u540d ( \u53c2\u6570 )( \u8fd4\u56de\u503c ) { \u51fd\u6570\u4f53 } func add ( a , b int ) int { return x + b } func intSum2 ( x ... int ) int { fmt . Println ( x ) //x\u662f\u4e00\u4e2a\u5207\u7247 sum := 0 for _ , v := range x { sum = sum + v } return sum } func calc ( x , y int ) ( int , int ) { reurn x + y , x - y } func calc ( x , y int ) ( sum , sub int ) { sum = x + y sub = x - y return } func add ( x , y int ) int { return x + y } func calc ( x , y int , op func ( int , int ) int ) int { return op ( x , y ) } func main () { ret2 := calc ( 10 , 20 , add ) fmt . Println ( ret2 ) //30 } func do ( s string ) ( func ( int , int ) int , error ) { switch s { case \"+\" : return add , nil case \"-\" : return sub , nil default : err := errors . New ( \"\u65e0\u6cd5\u8bc6\u522b\u7684\u64cd\u4f5c\u7b26\" ) return nil , err } }","title":"\u51fd\u6570"},{"location":"cs/pl/go/basic/#_14","text":"\u548c C \u7684\u533a\u522b\u4e0d\u5927\uff0c\u90fd\u662f\u7528 * \u548c & \u6765\u64cd\u4f5c\uff0c * \u8868\u793a\u53d6\u503c\u64cd\u4f5c\u7b26\uff0c & \u8868\u793a\u53d6\u5730\u5740\u64cd\u4f5c\u7b26 new \u548c make \u5206\u914d\u5185\u5b58 a = new(int) \uff0cmake \u53ea\u7528\u4e8eslice\u3001map\u4ee5\u53cachannel\u7684\u5185\u5b58\u521b\u5efa\uff0c\u8fd4\u56de\u7684\u662f\u5f15\u7528\u7c7b\u578b \u800cnew\u7528\u4e8e\u7c7b\u578b\u7684\u5185\u5b58\u5206\u914d\uff0c\u5e76\u4e14\u5185\u5b58\u5bf9\u5e94\u7684\u503c\u4e3a\u7c7b\u578b\u96f6\u503c\uff0c\u8fd4\u56de\u7684\u662f\u6307\u5411\u7c7b\u578b\u7684\u6307\u9488","title":"\u6307\u9488"},{"location":"cs/pl/go/basic/#_15","text":"","title":"\u7ed3\u6784\u4f53"},{"location":"cs/pl/go/basic/#_16","text":"type \u5b9a\u4e49\u7c7b\u578b\u522b\u540d type + struct \u5b9a\u4e49\u7ed3\u6784\u4f53\uff0ctype \u7c7b\u578b\u540d struct { \u5b57\u6bb5\u540d \u5b57\u6bb5\u7c7b\u578b ...} \u4f7f\u7528 var \u5b9e\u4f8b\u5316\u7ed3\u6784\u4f53 \u901a\u8fc7 . \u8bbf\u95ee\u7ed3\u6784\u4f53\u5b57\u6bb5 \u521d\u59cb\u5316 \u6ca1\u6709\u521d\u59cb\u5316\u7684\u7ed3\u6784\u4f53\uff0c\u5176\u6210\u5458\u53d8\u91cf\u90fd\u662f\u5bf9\u5e94\u5176\u7c7b\u578b\u7684\u96f6\u503c \u4f7f\u7528\u952e\u503c\u5bf9\u5bf9\u7ed3\u6784\u4f53\u8fdb\u884c\u521d\u59cb\u5316\u65f6\uff0c\u952e\u5bf9\u5e94\u7ed3\u6784\u4f53\u7684\u5b57\u6bb5\uff0c\u503c\u5bf9\u5e94\u8be5\u5b57\u6bb5\u7684\u521d\u59cb\u503c \u7ed3\u6784\u4f53\u5360\u7528\u4e00\u5757\u8fde\u7eed\u7684\u5185\u5b58\uff0c\u7a7a\u7ed3\u6784\u4f53\u662f\u4e0d\u5360\u7528\u7a7a\u95f4\u7684 \u7ed3\u6784\u9898\u6ca1\u6709\u6784\u9020\u51fd\u6570\uff0c\u4f46\u662f\u53ef\u4ee5\u81ea\u5df1\u5b9e\u73b0 \u6784\u9020\u51fd\u6570 func newPerson ( name , city string , age int8 ) * person { return & person { name : name , city : city , age : age , } }","title":"\u5b9a\u4e49\u4e0e\u521d\u59cb\u5316"},{"location":"cs/pl/go/basic/#_17","text":"\u65b9\u6cd5\uff08Method\uff09\u662f\u4e00\u79cd\u4f5c\u7528\u4e8e\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u7684\u51fd\u6570\u3002\u8fd9\u79cd\u7279\u5b9a\u7c7b\u578b\u53d8\u91cf\u53eb\u505a\u63a5\u6536\u8005\uff08Receiver\uff09\u3002\u63a5\u6536\u8005\u7684\u6982\u5ff5\u5c31\u7c7b\u4f3c\u4e8e\u5176\u4ed6\u8bed\u8a00\u4e2d\u7684 this \u6216\u8005 self\uff0c\u5f53\u7136\u8fd8\u53ef\u4ee5\u6709\u6307\u9488\u7c7b\u578b\u7684\u63a5\u6536\u8005 func ( \u63a5\u6536\u8005\u53d8\u91cf \u63a5\u6536\u8005\u7c7b\u578b ) \u65b9\u6cd5\u540d ( \u53c2\u6570\u5217\u8868 ) ( \u8fd4\u56de\u53c2\u6570 ) { \u51fd\u6570\u4f53 } \u65b9\u6cd5\u4e0e\u51fd\u6570\u7684\u533a\u522b\u662f\uff0c\u51fd\u6570\u4e0d\u5c5e\u4e8e\u4efb\u4f55\u7c7b\u578b\uff0c\u65b9\u6cd5\u5c5e\u4e8e\u7279\u5b9a\u7684\u7c7b\u578b","title":"\u65b9\u6cd5"},{"location":"cs/pl/go/basic/#_18","text":"\u7ed3\u6784\u4f53\u5141\u8bb8\u5176\u6210\u5458\u5b57\u6bb5\u5728\u58f0\u660e\u65f6\u6ca1\u6709\u5b57\u6bb5\u540d\u800c\u53ea\u6709\u7c7b\u578b\uff0c\u8fd9\u79cd\u6ca1\u6709\u540d\u5b57\u7684\u5b57\u6bb5\u5c31\u79f0\u4e3a\u533f\u540d\u5b57\u6bb5 \u4e00\u4e2a\u7ed3\u6784\u4f53\u4e2d\u53ef\u4ee5\u5d4c\u5957\u5305\u542b\u53e6\u4e00\u4e2a\u7ed3\u6784\u4f53\u6216\u7ed3\u6784\u4f53\u6307\u9488 \u901a\u8fc7\u7ed3\u6784\u4f53\u53ef\u4ee5\u5b9e\u73b0\u201c\u7ee7\u627f\u201d \u7ed3\u6784\u4f53\u4e2d\u5b57\u6bb5\u5927\u5199\u5f00\u5934\u8868\u793a\u53ef\u516c\u5f00\u8bbf\u95ee\uff0c\u5c0f\u5199\u8868\u793a\u79c1\u6709\uff08\u4ec5\u5728\u5b9a\u4e49\u5f53\u524d\u7ed3\u6784\u4f53\u7684\u5305\u4e2d\u53ef\u8bbf\u95ee\uff09 \u7ed3\u6784\u4f53\u53ef\u4ee5\u4f7f\u7528 JSON \u5e8f\u5217\u5316","title":"\u5176\u4ed6"},{"location":"cs/pl/go/basic/#_19","text":"","title":"\u63a5\u53e3"},{"location":"cs/pl/go/basic/#_20","text":"\u63a5\u53e3\u662f\u4e00\u79cd\u7531\u7a0b\u5e8f\u5458\u6765\u5b9a\u4e49\u7684\u7c7b\u578b\uff0c\u4e00\u4e2a\u63a5\u53e3\u7c7b\u578b\u5c31\u662f\u4e00\u7ec4\u65b9\u6cd5\u7684\u96c6\u5408\uff0c\u5b83\u89c4\u5b9a\u4e86\u9700\u8981\u5b9e\u73b0\u7684\u6240\u6709\u65b9\u6cd5 \u6bcf\u4e2a\u63a5\u53e3\u7c7b\u578b\u7531\u4efb\u610f\u4e2a\u65b9\u6cd5\u7b7e\u540d\u7ec4\u6210 type \u63a5\u53e3\u7c7b\u578b\u540d interface { \u65b9\u6cd5\u540d1 ( \u53c2\u6570\u5217\u88681 ) \u8fd4\u56de\u503c\u5217\u88681 \u65b9\u6cd5\u540d2 ( \u53c2\u6570\u5217\u88682 ) \u8fd4\u56de\u503c\u5217\u88682 ... } \u63a5\u53e3\u5c31\u662f\u89c4\u5b9a\u4e86\u4e00\u4e2a\u9700\u8981\u5b9e\u73b0\u7684\u65b9\u6cd5\u5217\u8868\uff0c\u5728 Go \u8bed\u8a00\u4e2d\u4e00\u4e2a\u7c7b\u578b\u53ea\u8981\u5b9e\u73b0\u4e86\u63a5\u53e3\u4e2d\u89c4\u5b9a\u7684\u6240\u6709\u65b9\u6cd5\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u79f0\u5b83\u5b9e\u73b0\u4e86\u8fd9\u4e2a\u63a5\u53e3 \u53ef\u4ee5\u901a\u8fc7\u503c\u63a5\u6536\u8005\u6216\u6307\u9488\u63a5\u6536\u8005\u5b9e\u73b0\u501f\u53e3","title":"\u63a5\u53e3\u7c7b\u578b"},{"location":"cs/pl/go/basic/#_21","text":"\u4e00\u4e2a\u7c7b\u578b\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u591a\u79cd\u7c7b\u578b\u5b9e\u73b0\u540c\u4e00\u63a5\u53e3","title":"\u7c7b\u578b\u4e0e\u63a5\u53e3\u7684\u5173\u7cfb"},{"location":"cs/pl/go/basic/#_22","text":"\u63a5\u53e3\u4e0e\u63a5\u53e3\u4e4b\u95f4\u53ef\u4ee5\u901a\u8fc7\u4e92\u76f8\u5d4c\u5957\u5f62\u6210\u65b0\u7684\u63a5\u53e3\u7c7b\u578b\uff0c\u4f8b\u5982Go\u6807\u51c6\u5e93io\u6e90\u7801\u4e2d\u5c31\u6709\u5f88\u591a\u63a5\u53e3\u4e4b\u95f4\u4e92\u76f8\u7ec4\u5408\u7684\u793a\u4f8b","title":"\u63a5\u53e3\u7ec4\u5408"},{"location":"cs/pl/go/basic/#_23","text":"\u7a7a\u63a5\u53e3\u662f\u6307\u6ca1\u6709\u5b9a\u4e49\u4efb\u4f55\u65b9\u6cd5\u7684\u63a5\u53e3\u7c7b\u578b\u3002\u56e0\u6b64\u4efb\u4f55\u7c7b\u578b\u90fd\u53ef\u4ee5\u89c6\u4e3a\u5b9e\u73b0\u4e86\u7a7a\u63a5\u53e3\u3002\u4e5f\u6b63\u662f\u56e0\u4e3a\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u8fd9\u4e2a\u7279\u6027\uff0c\u7a7a\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cf\u53ef\u4ee5\u5b58\u50a8\u4efb\u610f\u7c7b\u578b\u7684\u503c \u901a\u5e38\u6211\u4eec\u5728\u4f7f\u7528\u7a7a\u63a5\u53e3\u7c7b\u578b\u65f6\u4e0d\u5fc5\u4f7f\u7528type\u5173\u952e\u5b57\u58f0\u660e\uff0c\u53ef\u4ee5\u50cf\u4e0b\u9762\u7684\u4ee3\u7801\u4e00\u6837\u76f4\u63a5\u4f7f\u7528interface{}\uff0c var x interface{} \u7a7a\u63a5\u53e3\u4f5c\u4e3a\u51fd\u6570\u7684\u53c2\u6570\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u63a5\u6536\u4efb\u610f\u7c7b\u578b\u7684\u51fd\u6570\u53c2\u6570 \u7a7a\u63a5\u53e3\u4f5c\u4e3amap\u7684\u503c\uff0c\u4f7f\u7528\u7a7a\u63a5\u53e3\u5b9e\u73b0\u53ef\u4ee5\u4fdd\u5b58\u4efb\u610f\u503c\u7684\u5b57\u5178","title":"\u7a7a\u63a5\u53e3"},{"location":"cs/pl/go/basic/#error","text":"Go \u8bed\u8a00\u4e2d\u628a\u9519\u8bef\u5f53\u6210\u4e00\u79cd\u7279\u6b8a\u7684\u503c\u6765\u5904\u7406\uff0c\u4e0d\u652f\u6301\u5176\u4ed6\u8bed\u8a00\u4e2d\u4f7f\u7528 try/catch \u6355\u83b7\u5f02\u5e38\u7684\u65b9\u5f0f Go \u8bed\u8a00\u4e2d\u4f7f\u7528\u4e00\u4e2a\u540d\u4e3a error \u63a5\u53e3\u6765\u8868\u793a\u9519\u8bef\u7c7b\u578b \u5f53\u4e00\u4e2a\u51fd\u6570\u6216\u65b9\u6cd5\u9700\u8981\u8fd4\u56de\u9519\u8bef\u65f6\uff0c\u6211\u4eec\u901a\u5e38\u662f\u628a\u9519\u8bef\u4f5c\u4e3a\u6700\u540e\u4e00\u4e2a\u8fd4\u56de\u503c\uff0c\u4f8b\u5982\u4e4b\u524d\u67e5\u8be2map\u4e2d\u662f\u5426\u5b58\u5728\u952e\u503c\u5bf9 \u9ed8\u8ba4\u96f6\u503c\u4e3a nil \u4f7f\u7528 fmt.Errorf \u624d\u63cf\u8ff0\u9519\u8bef\u4fe1\u606f \u53ef\u4ee5\u5bf9\u81ea\u5b9a\u4e49\u7ed3\u6784\u4f53\u7c7b\u578b\u5b9e\u73b0 error \u63a5\u53e3","title":"Error \u63a5\u53e3"},{"location":"cs/pl/go/basic/#_24","text":"","title":"\u6807\u51c6\u5e93"},{"location":"cs/pl/go/basic/#fmt","text":"fmt\u5305\u5b9e\u73b0\u4e86\u7c7b\u4f3cC\u8bed\u8a00printf\u548cscanf\u7684\u683c\u5f0f\u5316I/O\u3002\u4e3b\u8981\u5206\u4e3a\u5411\u5916\u8f93\u51fa\u5185\u5bb9\u548c\u83b7\u53d6\u8f93\u5165\u5185\u5bb9\u4e24\u5927\u90e8\u5206","title":"fmt"},{"location":"cs/pl/go/basic/#_25","text":"Print() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u7cfb\u7edf\u7684\u6807\u51c6\u8f93\u51fa Fprint() \uff1a\u5c06\u5185\u5bb9\u8f93\u51fa\u5230\u4e00\u4e2aio.Writer\u63a5\u53e3\u7c7b\u578b\u7684\u53d8\u91cfw\u4e2d\uff0c\u6211\u4eec\u901a\u5e38\u7528\u8fd9\u4e2a\u51fd\u6570\u5f80\u6587\u4ef6\u4e2d\u5199\u5165\u5185\u5bb9 Sprint() \uff1a\u628a\u4f20\u5165\u7684\u6570\u636e\u751f\u6210\u5e76\u8fd4\u56de\u4e00\u4e2a\u5b57\u7b26\u4e32 Errorf() \uff1a\u6839\u636eformat\u53c2\u6570\u751f\u6210\u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u4e00\u4e2a\u5305\u542b\u8be5\u5b57\u7b26\u4e32\u7684\u9519\u8bef","title":"\u5411\u5916\u8f93\u51fa"},{"location":"cs/pl/go/basic/#_26","text":"Scan() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d\uff0c\u6362\u884c\u7b26\u89c6\u4e3a\u7a7a\u767d\u7b26 Scanf() \uff1a\u6807\u51c6\u8f93\u5165\u626b\u63cf\u6587\u672c\uff0c\u6839\u636eformat\u53c2\u6570\u6307\u5b9a\u7684\u683c\u5f0f\u53bb\u8bfb\u53d6\u7531\u7a7a\u767d\u7b26\u5206\u9694\u7684\u503c\u4fdd\u5b58\u5230\u4f20\u9012\u7ed9\u672c\u51fd\u6570\u7684\u53c2\u6570\u4e2d Scanln() \uff1a\u7c7b\u4f3cScan\uff0c\u5b83\u5728\u9047\u5230\u6362\u884c\u65f6\u624d\u505c\u6b62\u626b\u63cf\u3002\u6700\u540e\u4e00\u4e2a\u6570\u636e\u540e\u9762\u5fc5\u987b\u6709\u6362\u884c\u6216\u8005\u5230\u8fbe\u7ed3\u675f\u4f4d\u7f6e bufio.NewReader \uff1a\u65f6\u5019\u6211\u4eec\u60f3\u5b8c\u6574\u83b7\u53d6\u8f93\u5165\u7684\u5185\u5bb9\uff0c\u800c\u8f93\u5165\u7684\u5185\u5bb9\u53ef\u80fd\u5305\u542b\u7a7a\u683c\uff0c\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u4f7f\u7528bufio\u5305\u6765\u5b9e\u73b0 Fscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4eceio.Reader\u4e2d\u8bfb\u53d6\u6570\u636e Sscan()\u7cfb\u5217 \uff1a\u7c7b\u4f3c\u4e8e Scan()\u7cfb\u5217 \uff0c\u4ece\u6307\u5b9a\u5b57\u7b26\u4e32\u4e2d\u8bfb\u53d6\u6570\u636e","title":"\u83b7\u53d6\u8f93\u5165"},{"location":"cs/pl/go/basic/#log","text":"Go\u8bed\u8a00\u5185\u7f6e\u7684log\u5305\u5b9e\u73b0\u4e86\u7b80\u5355\u7684\u65e5\u5fd7\u670d\u52a1 log package main import ( \"log\" ) func main () { log . Println ( \"\u8fd9\u662f\u4e00\u6761\u5f88\u666e\u901a\u7684\u65e5\u5fd7\u3002\" ) v := \"\u5f88\u666e\u901a\u7684\" log . Printf ( \"\u8fd9\u662f\u4e00\u6761%s\u65e5\u5fd7\u3002\\n\" , v ) log . Fatalln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1fatal\u7684\u65e5\u5fd7\u3002\" ) log . Panicln ( \"\u8fd9\u662f\u4e00\u6761\u4f1a\u89e6\u53d1panic\u7684\u65e5\u5fd7\u3002\" ) } \u9664\u4e86\u9ed8\u8ba4\u63d0\u4f9b\u65e5\u5fd7\u7684\u65f6\u95f4\u4fe1\u606f\uff0c\u8fd8\u53ef\u4ee5\u901a\u8fc7\u914d\u7f6elogger\u6765\u8bbe\u7f6e\u8f93\u51fa\u4fe1\u606f","title":"log"},{"location":"cs/pl/go/basic/#_27","text":"","title":"\u6587\u4ef6\u64cd\u4f5c"},{"location":"cs/pl/go/basic/#_28","text":"os.Open() \u51fd\u6570\u80fd\u591f\u6253\u5f00\u4e00\u4e2a\u6587\u4ef6\uff0c\u8fd4\u56de\u4e00\u4e2a *File \u548c\u4e00\u4e2a err \u3002\u5bf9\u5f97\u5230\u7684\u6587\u4ef6\u5b9e\u4f8b\u8c03\u7528 close() \u65b9\u6cd5\u80fd\u591f\u5173\u95ed\u6587\u4ef6 open and close package main import ( \"fmt\" \"os\" ) func main () { // \u53ea\u8bfb\u65b9\u5f0f\u6253\u5f00\u5f53\u524d\u76ee\u5f55\u4e0b\u7684main.go\u6587\u4ef6 file , err := os . Open ( \"./main.go\" ) if err != nil { fmt . Println ( \"open file failed!, err:\" , err ) return } // \u5173\u95ed\u6587\u4ef6 file . Close () } \u4e3a\u4e86\u9632\u6b62\u6587\u4ef6\u5fd8\u8bb0\u5173\u95ed\uff0c\u6211\u4eec\u901a\u5e38\u4f7f\u7528defer\u6ce8\u518c\u6587\u4ef6\u5173\u95ed\u8bed\u53e5","title":"\u6253\u5f00\u548c\u5173\u95ed\u6587\u4ef6"},{"location":"cs/pl/go/basic/#_29","text":"file.Read() \u63a5\u6536\u4e00\u4e2a\u5b57\u8282\u5207\u7247\uff0c\u8fd4\u56de\u8bfb\u53d6\u7684\u5b57\u8282\u6570\u548c\u53ef\u80fd\u7684\u5177\u4f53\u9519\u8bef\uff0c\u8bfb\u5230\u6587\u4ef6\u672b\u5c3e\u65f6\u4f1a\u8fd4\u56de0\u548cio.EOF func ( f * File ) Read ( b [] byte ) ( n int , err error ) \u4f7f\u7528 for \u5faa\u73af\u8bfb\u53d6\u6587\u4ef6\u4e2d\u7684\u6240\u6709\u6570\u636e bufio\u8bfb\u53d6\u6587\u4ef6 bufio \u662f\u5728 file \u7684\u57fa\u7840\u4e0a\u5c01\u88c5\u4e86\u4e00\u5c42API\uff0c\u652f\u6301\u66f4\u591a\u7684\u529f\u80fd \u8bfb\u53d6\u6574\u4e2a\u6587\u4ef6 io/ioutil \u5305\u7684 ReadFile \u65b9\u6cd5\u80fd\u591f\u8bfb\u53d6\u5b8c\u6574\u7684\u6587\u4ef6\uff0c\u53ea\u9700\u8981\u5c06\u6587\u4ef6\u540d\u4f5c\u4e3a\u53c2\u6570\u4f20\u5165","title":"\u8bfb\u53d6\u6587\u4ef6"},{"location":"cs/pl/go/basic/#_30","text":"os.OpenFile() \u51fd\u6570\u80fd\u591f\u4ee5\u6307\u5b9a\u6a21\u5f0f\u6253\u5f00\u6587\u4ef6\uff0c\u4ece\u800c\u5b9e\u73b0\u6587\u4ef6\u5199\u5165\u76f8\u5173\u529f\u80fd Write \u548c WriteString bufio.NewWriter ioutil.WriteFile","title":"\u6587\u4ef6\u5199\u5165\u64cd\u4f5c"},{"location":"cs/pl/go/basic/#strconv","text":"strconv\u5305\u5b9e\u73b0\u4e86\u57fa\u672c\u6570\u636e\u7c7b\u578b\u4e0e\u5176\u5b57\u7b26\u4e32\u8868\u793a\u7684\u8f6c\u6362","title":"strconv"},{"location":"cs/pl/go/basic/#atoi","text":"\u7528\u4e8e\u5c06\u5b57\u7b26\u4e32\u7c7b\u578b\u7684\u6574\u6570\u8f6c\u6362\u4e3aint\u7c7b\u578b","title":"Atoi()"},{"location":"cs/pl/go/basic/#itoa","text":"\u7528\u4e8e\u5c06int\u7c7b\u578b\u6570\u636e\u8f6c\u6362\u4e3a\u5bf9\u5e94\u7684\u5b57\u7b26\u4e32\u8868\u793a","title":"Itoa()"},{"location":"cs/pl/go/basic/#parse","text":"Parse\u7c7b\u51fd\u6570\u7528\u4e8e\u8f6c\u6362\u5b57\u7b26\u4e32\u4e3a\u7ed9\u5b9a\u7c7b\u578b\u7684\u503c\uff1aParseBool()\u3001ParseFloat()\u3001ParseInt()\u3001ParseUint() \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684bool\u503c func ParseBool ( str string ) ( value bool , err error ) \u8fd4\u56de\u5b57\u7b26\u4e32\u8868\u793a\u7684\u6574\u6570\u503c func ParseInt ( s string , base int , bitSize int ) ( i int64 , err error ) \u89e3\u6790\u4e00\u4e2a\u8868\u793a\u6d6e\u70b9\u6570\u7684\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de\u5176\u503c func ParseFloat ( s string , bitSize int ) ( f float64 , err error )","title":"Parse\u7cfb\u5217\u51fd\u6570"},{"location":"cs/pl/go/basic/#format","text":"Format\u7cfb\u5217\u51fd\u6570\u5b9e\u73b0\u4e86\u5c06\u7ed9\u5b9a\u7c7b\u578b\u6570\u636e\u683c\u5f0f\u5316\u4e3astring\u7c7b\u578b\u6570\u636e\u7684\u529f\u80fd \u6839\u636eb\u7684\u503c\u8fd4\u56de\u201dtrue\u201d\u6216\u201dfalse\u201d func FormatBool ( b bool ) string \u8fd4\u56dei\u7684base\u8fdb\u5236\u7684\u5b57\u7b26\u4e32\u8868\u793a func FormatInt ( i int64 , base int ) string \u51fd\u6570\u5c06\u6d6e\u70b9\u6570\u8868\u793a\u4e3a\u5b57\u7b26\u4e32\u5e76\u8fd4\u56de func FormatFloat ( f float64 , fmt byte , prec , bitSize int ) string","title":"Format\u7cfb\u5217\u51fd\u6570"},{"location":"cs/pl/go/basic/#referencce","text":"Go \u5b98\u65b9\u6587\u6863 Go \u83dc\u9e1f\u6559\u7a0b Go \u8bed\u8a00\u5b66\u4e60\u4e4b\u8def Go by Example \u4e2d\u6587\u7248","title":"Referencce"},{"location":"cs/pl/go/gin/","text":"","title":"gin\u6846\u67b6 (TODO)"},{"location":"cs/pl/java/","text":"Java \u00b6 Abstract \u5f53\u521d\u627e\u5de5\u4f5c\u65f6\u963f\u91cc\u3001\u7f8e\u56e2\u3001\u4eac\u4e1c\u57fa\u672c\u90fd\u7528 java\uff08\u7ed3\u679c\u90fd\u88ab\u529d\u9000\u4e86\uff09\uff0c\u4f5c\u4e3a\u4e00\u540d\u4e0d\u662f java \u7a0b\u5e8f\u5458\uff0c\u4f46\u4e5f\u7a0d\u5fae\u5b66\u4e60\u4e00\u4e0b\u57fa\u7840\u77e5\u8bc6 \u4e0d\u559c\u6b22 java\uff0c\u6ca1\u6709 C++ \u5199\u8d77\u6765\u723d Table of Contents \u00b6 Java \u7cfb\u7edf\u77e5\u8bc6 SpringBoot","title":"Java"},{"location":"cs/pl/java/#java","text":"Abstract \u5f53\u521d\u627e\u5de5\u4f5c\u65f6\u963f\u91cc\u3001\u7f8e\u56e2\u3001\u4eac\u4e1c\u57fa\u672c\u90fd\u7528 java\uff08\u7ed3\u679c\u90fd\u88ab\u529d\u9000\u4e86\uff09\uff0c\u4f5c\u4e3a\u4e00\u540d\u4e0d\u662f java \u7a0b\u5e8f\u5458\uff0c\u4f46\u4e5f\u7a0d\u5fae\u5b66\u4e60\u4e00\u4e0b\u57fa\u7840\u77e5\u8bc6 \u4e0d\u559c\u6b22 java\uff0c\u6ca1\u6709 C++ \u5199\u8d77\u6765\u723d","title":"Java"},{"location":"cs/pl/java/#table-of-contents","text":"Java \u7cfb\u7edf\u77e5\u8bc6 SpringBoot","title":"Table of Contents"},{"location":"cs/pl/java/basic/","text":"Java \u7cfb\u7edf\u77e5\u8bc6 \u00b6 \u7ea6 2317 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u51c6\u5907\u9762\u8bd5\u65f6\u7a0d\u5fae\u5b66\u4e60\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6 \uff08\u4e0d\u7528java\uff0c\u4e5f\u4e0d\u559c\u6b22java\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5427 \u7ebf\u6027\u6c60 \u00b6 \u7ebf\u6027\u6c60\u7684\u539f\u56e0 \u4e0d\u65ad\u7684\u521b\u5efa\u548c\u5220\u7ebf\u7a0b\uff0c\u4f1a\u5e26\u6765\u8f83\u5927\u7684\u7cfb\u7edf\u8d44\u6e90\u8d1f\u8f7d \u7ebf\u7a0b\u7f3a\u4e4f\u7edf\u4e00\u7684\u7ba1\u7406\uff0c\u53ef\u80fd\u4f1a\u5e26\u6765\u65e0\u9650\u5236\u7684\u521b\u5efa\u7ebf\u7a0b \u7ebf\u7a0b\u4e4b\u95f4\u62a2\u5360\u8d44\u6e90 \u7ebf\u7a0b\u6c60\u7684\u5c5e\u6027 \u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u4fdd\u6301\u5b58\u5728\u7684\u7ebf\u7a0b\u6570\u91cf\uff0c\u8fd9\u4e9b\u7ebf\u7a0b\u4f1a\u4e00\u76f4\u5b58\u5728\uff0c\u4e0d\u4f1a\u88ab\u5220\u9664 \u4efb\u52a1\u7f13\u51b2\u9510\u88c2\uff1a\u5f53\u6240\u6709\u7684\u6838\u5fc3\u7ebf\u7a0b\u90fd\u5728\u8fd0\u884c\u65f6\uff0c\u65b0\u7684\u4efb\u52a1\u4f1a\u88ab\u52a0\u5165\u5230\u7f13\u51b2\u961f\u5217\u4e2d \u975e\u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u5f53\u4efb\u52a1\u7f13\u51b2\u961f\u5217\u6ee1\u540e\uff0c\u5c06\u4f1a\u521b\u5efa\u65b0\u7684\u7ebf\u7a0b\u6765\u6267\u884c\u961f\u5217\u4e2d\u7684\u4efb\u52a1\uff0c\u4e14\u989d\u5916\u521b\u5efa\u7684\u7ebf\u7a0b\u6570\u4e0d\u4f1a\u8d85\u8fc7\u975e\u6838\u5fc3\u7ebf\u7a0b\u6570 \u7a7a\u95f2\u7ebf\u7a0b\u7684\u5b58\u6d3b\u65f6\u95f4\uff1a\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u7a7a\u95f2\u65f6\uff0c\u4e14\u6301\u7eed\u4e86\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u6b64\u7ebf\u7a0b\u5c06\u4f1a\u88ab\u5220\u9664 \u62d2\u7edd\u7b56\u7565\uff0c\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u548c\u4efb\u52a1\u7f13\u5b58\u961f\u5217\u6ee1\u540e\uff0c\u5bf9\u5f85\u65b0\u7684\u4efb\u52a1\u7684\u7b56\u7565 Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u7c7b\u578b \u540d\u79f0 \u6838\u5fc3\u7ebf\u7a0b\u6570 \u7ebf\u7a0b\u6c60\u5927\u5c0f \u975e\u6838\u5fc3\u7ebf\u7a0b\u5b58\u6d3b\u65f6\u95f4 \u7b49\u5f85\u961f\u5217\u5927\u5c0f CachedThreadPool 0 \u221e 60s 0 SingleThreadExecutor 1 1 0 \u221e FixedThreadPool n n 0 \u221e ScheduledThreadPoolExecutor Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u5f15\u8d77OOM\u5f02\u5e38\uff08OutOfMemoryError\uff09 CachedThreadPool\u5141\u8bb8\u521b\u5efa\u65e0\u7ebf\u7684\u7ebf\u7a0b\uff0c\u4ece\u800c\u5f15\u8d77OOM\u5f02\u5e38 SingleThreadExecutor\u548cFixedThreadPool\u8bf7\u6c42\u961f\u5217\u4e3a\u65e0\u9650\u957f\uff0c\u53ef\u80fd\u4f1a\u5806\u79ef\u5927\u91cf\u7684\u6d88\u606f\uff0c\u4ece\u800c\u5f15\u53d1OOM\u5f02\u5e38\u3002 Java\u5185\u5b58 \u00b6 \u5185\u5b58\u7c7b\u578b \u4e3b\u5185\u5b58\uff1a\u7ebf\u7a0b\u4e4b\u95f4\u5171\u4eab\u7684\u53d8\u91cf\u50a8\u5b58\u5728\u4e3b\u5185\u5b58\u4e2d \u672c\u5730\u5185\u5b58\uff1a\u6bcf\u4e2a\u7ebf\u7a0b\u72ec\u7acb\u62e5\u6709\u7684\u5185\u5b58 \u672c\u5730\u5185\u5b58\u4fdd\u5b58\u7684\u662f\u4e3b\u5185\u5b58\u7684\u5171\u4eab\u53d8\u91cf\u7684\u526f\u672c \u5783\u573e\u56de\u6536 \u6839\u641c\u7d22\u7b97\u6cd5\uff08\u53ef\u8fbe\u6027\u5206\u6790\u7b97\u6cd5\uff09\u4eceGC ROOT\u7ed3\u70b9\u6cbf\u7740\u5f15\u7528\u94fe\u641c\u7d22\uff0c\u65e0\u6cd5\u5230\u8fbe\u7684\u7ed3\u70b9\u5373\u4e3a\u4e0d\u53ef\u5230\u8fbe\u7684\u5bf9\u8c61 \u5783\u573e\u56de\u6536\u5668 G1\u6536\u96c6\u5668 \u72ec\u7279\u7684\u5206\u4ee3\u5783\u573e\u56de\u6536\u5668\uff0c\u5206\u4ee3GC\uff1a\u5206\u4ee3\u6536\u96c6\u5668\uff0c\u540c\u65f6\u517c\u987e\u5e74\u8f7b\u4ee3\u548c\u8001\u5e74\u4ee3 \u4f7f\u7528\u5206\u533a\u7b97\u6cd5\uff0c\u4e0d\u8981\u6c42eden\uff0c\u5e74\u8f7b\u4ee3\u6216\u8001\u5e74\u4ee3\u7684\u7a7a\u95f4\u90fd\u8fde\u7eed \u5e76\u884c\u6027\uff1a\u56de\u6536\u671f\u95f4\uff0c\u53ef\u7531\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u5de5\u4f5c\uff0c\u6709\u6548\u5229\u7528\u591a\u6838CPU\u8d44\u6e90 \u7a7a\u95f4\u6574\u7406\uff1a\u56de\u6536\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u8fdb\u884c\u9002\u5f53\u5bf9\u8c61\u79fb\u52a8\uff0c\u51cf\u5c11\u7a7a\u95f4\u788e\u7247 \u53ef\u9884\u89c1\u6027\uff1aG1\u53ef\u9009\u53d6\u90e8\u5206\u533a\u57df\u8fdb\u884c\u56de\u6536\uff0c\u53ef\u89c1\u7f29\u5c0f\u56de\u6536\u8303\u56f4\uff0c\u51cf\u5c11\u5168\u5c40\u505c\u987f G1\u6536\u96c6\u5668\u7684\u8fc7\u7a0b \u521d\u59cb\u6807\u8bb0\uff08\u5b83\u6807\u8bb0\u4e86\u4eceGC ROOT\u5f00\u59cb\u76f4\u63a5\u53ef\u8fbe\u7684\u5bf9\u8c61\uff09Stop-The-World \u5e76\u53d1\u6807\u8bb0\uff08\u4eceGC Roots\u5f00\u59cb\u5bf9\u5806\u4e2d\u5bf9\u8c61\u8fdb\u884c\u53ef\u8fbe\u6027\u5206\u6790\uff0c\u627e\u51fa\u5b58\u6d3b\u5bf9\u8c61\uff09 \u6700\u7ec8\u6807\u8bb0\uff08\u6807\u8bb0\u90a3\u4e9b\u5728\u5e76\u53d1\u6807\u8bb0\u9636\u6bb5\u53d1\u751f\u53d8\u5316\u7684\u5bf9\u8c61\uff0c\u5c06\u88ab\u56de\u6536\uff09Stop-The-World \u7b5b\u9009\u56de\u6536\uff08\u9996\u5148\u5bf9\u5404\u4e2aRegin\u7684\u56de\u6536\u4ef7\u503c\u548c\u6210\u672c\u8fdb\u884c\u6392\u5e8f\uff0c\u6839\u636e\u7528\u6237\u6240\u671f\u5f85\u7684GC\u505c\u987f\u65f6\u95f4\u6307\u5b9a\u56de\u6536\u8ba1\u5212\uff0c\u56de\u6536\u4e00\u90e8\u5206Region\uff09Stop-The-World Map \u00b6 HashMap\u7684\u7ed3\u6784 \u91c7\u7528\u94fe\u5730\u5740\u6cd5\uff0c\u5f53\u53d1\u751f\u54c8\u5e0c\u51b2\u7a81\u65f6\u4f7f\u7528\u94fe\u8868\u89e3\u51b3 \u5f53\u94fe\u8868\u8fc7\u957f\u65f6\uff0c\u5728JDK1.8\u4e0b\u91c7\u7528\u7ea2\u9ed1\u6811\u4ee3\u66ff\u94fe\u8868\uff0c\u5f53\u6570\u636e\u91cf\u8f83\u5c11\u65f6\uff0c\u8f6c\u56de\u94fe\u8868 \u5f53\u5b58\u50a8\u7684\u6570\u636e\u91cf\u8d85\u8fc7\u4e00\u4e2a\u9608\u503c\u540e\uff0cHashMap\u7684\u54c8\u5e0c\u8868\u957f\u5ea6\u5c06\u4f1a\u6269\u5bb9\u5230\u539f\u6765\u7684\u4e24\u500d\uff0c\u7136\u540e\u5c06\u6240\u6709\u7684\u6570\u636e\u91cd\u65b0\u5206\u914d\u5230\u65b0\u7684\u5185\u5b58\u4e2d HashMap\u8fd9\u6837\u6269\u5bb9\u7684\u539f\u56e0 \u901a\u8fc7\u6070\u597d\u4e24\u500d\u6269\u5bb9\uff0c\u53ef\u4ee5\u8ba9\u539f\u6765\u5728\u7b2ci\u4e2a\u94fe\u8868\u7684\u503c\u88ab\u6070\u597d\u5206\u914d\u5230\u7b2ci\u548c\u7b2c2i\u4e2a\u94fe\u8868\u7684\u4f4d\u7f6e \u6bcf\u4e00\u4e2a\u503c\uff0c\u53ea\u9700\u8981\u5224\u65ad\u5176\u54c8\u5e0c\u503c\u5728\u67d0\u4e2a\u4e8c\u8fdb\u5236\u4f4d\u4e0a\u7684\u503c\u5373\u53ef\u76f4\u63a5\u5b8c\u6210\u5206\u914d TreeMap\u7684\u7ed3\u6784 TreeMap\u662f\u4e00\u9897\u7ea2\u9ed1\u6811 \u8bbe\u8ba1\u6a21\u5f0f \u00b6 \u8bbe\u8ba1\u539f\u5219 \u5f00\u95ed\u539f\u5219\uff1a\u5bf9\u6269\u5c55\u5f00\u653e\uff0c\u5bf9\u4fee\u6539\u5173\u95ed \u91cc\u6c0f\u66ff\u6362\u539f\u5219\uff1a\u5b50\u7c7b\u5fc5\u987b\u62e5\u6709\u6240\u6709\u7684\u7236\u7c7b\u529f\u80fd\uff0c\u5b50\u7c7b\u53ef\u4ee5\u5f00\u53d1\u81ea\u5df1\u7684\u65b0\u529f\u80fd \u4f9d\u8d56\u5012\u7f6e\u539f\u5219\uff1a\u9ad8\u5c42\u5b9e\u73b0\u4e0d\u80fd\u4f9d\u8d56\u4f4e\u5c42\u5b9e\u73b0\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u4f4e\u5c42\u7684\u62bd\u8c61\u7c7b \u5355\u4e00\u804c\u8d23\u539f\u5219\uff1a\u4e00\u4e2a\u7c7b\u5e94\u5f53\u53ea\u8d1f\u8d23\u4e00\u4e2a\u804c\u8d23 \u63a5\u53e3\u9694\u79bb\u539f\u5219\uff1a\u63a5\u53e3\u5e94\u8be5\u66f4\u5c0f\u66f4\u5177\u4f53\uff0c\u800c\u4e0d\u662f\u53bb\u5b9e\u73b0\u5f88\u5e9e\u5927\u7684\u501f\u53e3\u6765\u9002\u5e94\u6240\u6709\u9700\u6c42 \u8fea\u7c73\u7279\u6cd5\u5219\uff1a\u907f\u514d\u4e0e\u65e0\u5173\u5b9e\u4f53\u8fdb\u884c\u901a\u4fe1 \u5408\u6210\u590d\u7528\u539f\u5219\uff1a\u5c3d\u91cf\u5148\u4f7f\u7528\u7ec4\u5408\u6216\u8005\u805a\u5408\u7b49\u5173\u8054\uff0c\u5176\u6b21\u8003\u8651\u7ee7\u627f \u8bbe\u8ba1\u6a21\u5f0f \u521b\u5efa\u578b\u6a21\u5f0f \u5355\u4f8b\u6a21\u5f0f\uff1a\u9650\u5236\u4e00\u4e2a\u7c7b\u53ea\u80fd\u6709\u4e00\u4e2a\u5b9e\u4f8b \u539f\u578b\u6a21\u5f0f\uff1a\u4ee5\u4e00\u4e2a\u6b64\u7c7b\u578b\u7684\u5b9e\u4f8b\u4e3a\u6a21\u7248\uff0c\u901a\u8fc7\u62f7\u8d1d\u5185\u5b58\u4e2d\u7684\u4e8c\u8fdb\u5236\u503c\u6765\u76f4\u63a5\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61 \u5de5\u5382\u6a21\u5f0f\uff1a\u5c06\u521b\u5efa\u5bf9\u8c61\u7684\u8fc7\u7a0b\u7531\u53e6\u4e00\u4e2a\u7c7b\u8fdb\u884c\u5c01\u88c5 \u5efa\u9020\u8005\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u590d\u6742\u7684\u5bf9\u8c61\u5206\u4e3a\u591a\u4e2a\u7b80\u5355\u7684\u5bf9\u8c61\u7684\u7ec4\u5408\uff0c\u5e76\u5b9e\u73b0\u5c06\u591a\u4e2a\u5c0f\u5bf9\u8c61\u8fdb\u884c\u62fc\u88c5\u7684\u8fc7\u7a0b \u7ed3\u6784\u578b\u6a21\u5f0f \u4ee3\u7406\u6a21\u5f0f\uff1a\u4f7f\u5f97\u4e24\u4e2a\u5bf9\u8c61\u4e4b\u95f4\u4e0d\u80fd\u76f4\u63a5\u5f15\u7528\u8bbf\u95ee\uff0c\u53ea\u80fd\u901a\u8fc7\u7b2c\u4e09\u65b9\uff0c\u53ef\u4ee5\u4fdd\u62a4\u76ee\u6807\u5bf9\u8c61\uff0c\u6269\u5c55\u76ee\u6807\u5bf9\u8c61\u7684\u529f\u80fd \u9002\u914d\u5668\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u7c7b\u7684\u63a5\u53e3\u8f6c\u6362\u4e3a\u53e6\u4e00\u4e2a\u7c7b\u7684\u501f\u53e3\uff0c\u901a\u5e38\u662f\u4e3a\u4e86\u9002\u914d\u4e24\u4e2a\u63a5\u53e3\u7684\u5bf9\u63a5\u95ee\u9898 \u6865\u63a5\u6a21\u5f0f\uff1a\u5c06\u62bd\u8c61\u4e0e\u5b9e\u73b0\u5206\u79bb\uff0c\u4f7f\u5f97\u4ed6\u4eec\u53ef\u4ee5\u72ec\u7acb\u53d8\u5316\uff0c\u7528\u7ec4\u5408\u5173\u7cfb\u6765\u4ee3\u66ff\u7ee7\u627f\u5173\u7cfb \u88c5\u9970\u5668\u6a21\u5f0f\uff1a\u4e3a\u7c7b\u589e\u52a0\u65b0\u7684\u529f\u80fd\u7684\u540c\u65f6\uff0c\u907f\u514d\u4e86\u7ee7\u627f \u5916\u89c2\u6a21\u5f0f\uff1a\u9690\u85cf\u7cfb\u7edf\u7684\u590d\u6742\u6027 \u4eab\u5143\u6a21\u5f0f\uff1a\u91cd\u590d \u4f7f\u7528\u5df2\u7ecf\u521b\u5efa\u7684\u540c\u7c7b\u5bf9\u8c61 \u7ec4\u5408\u6a21\u5f0f \u884c\u4e3a\u578b\u6a21\u5f0f \u6a21\u677f\u65b9\u6cd5\u6a21\u5f0f\uff1a\u4ec5\u5b9e\u73b0\u4e00\u4e2a\u64cd\u4f5c\u4e2d\u7684\u9aa8\u5e72\u6b65\u9aa4\uff0c\u5177\u4f53\u6b65\u9aa4\u7531\u5176\u5b50\u7c7b\u5b9e\u73b0 \u7b56\u7565\u6a21\u5f0f \u547d\u4ee4\u6a21\u5f0f \u8d23\u4efb\u94fe\u6a21\u5f0f \u72b6\u6001\u6a21\u5f0f \u89c2\u5bdf\u8005\u6a21\u5f0f \u4e2d\u4ecb\u8005\u6a21\u5f0f \u8fed\u4ee3\u5668\u6a21\u5f0f \u8bbf\u95ee\u8005\u6a21\u5f0f \u5907\u5fd8\u5f55\u6a21\u5f0f \u89e3\u91ca\u5668\u6a21\u5f0f String \u00b6 String\u7c7b\u578b String\u7c7b\u578b\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u5bf9String\u7c7b\u578b\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u91cd\u65b0\u751f\u6210\u65b0\u7684String\u5bf9\u8c61 StringBuilder\u548cStringBuffer StringBuilder\u548cStringBuffer\u90fd\u662f\u53ef\u53d8\u7684 StringBuilder\u6ca1\u6709\u7ebf\u7a0b\u540c\u6b65\uff0c\u5b58\u5728\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\uff0c\u4f46\u662f\u5176\u6548\u7387\u7565\u9ad8\u4e8eStringBuffer StringBuffer\u80fd\u591f\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\uff0c\u4f46\u6548\u7387\u8f83\u4f4e \u63a5\u53e3\u548c\u62bd\u8c61\u7c7b \u00b6 \u63a5\u53e3\u548c\u62bd\u8c61\u7c7b\u7684\u533a\u522b \u62bd\u8c61\u7c7b\u53ef\u4ee5\u5199\u975e\u62bd\u8c61\u65b9\u6cd5\uff0c\u800c\u63a5\u53e3\u7c7b\u53ea\u80fd\u6709\u62bd\u8c61\u65b9\u6cd5 \u4e00\u4e2a\u7c7b\u53ea\u80fd\u7ee7\u627f\u81ea\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u800c\u4e00\u4e2a\u7c7b\u80fd\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u7ee7\u627f\u662f\u4e00\u4e2a\u201c\u662f\u4e0d\u662f\u201d\u7684\u5173\u7cfb\uff0c\u800c\u63a5\u53e3\u5b9e\u73b0\u5219\u662f\u201c\u6709\u6ca1\u6709\u201d\u7684\u5173\u7cfb \u6784\u9020\u51fd\u6570 \u00b6 \u5b50\u7c7b\u5b9e\u4f8b\u5316\u603b\u662f\u9ed8\u8ba4\u8c03\u7528\u7236\u7c7b\u7684\u65e0\u53c2\u6784\u9020\u65b9\u6cd5 \u4e3a\u4e86\u8ba9\u7236\u7c7b\u521d\u59cb\u5316\u5c5e\u6027\u548c\u65b9\u6cd5 equals \u00b6 equals \u548c == \u7684\u533a\u522b == \u5bf9\u4e8e\u57fa\u672c\u7c7b\u578b\u65f6\uff0c\u6bd4\u8f83\u7684\u662f\u4e24\u4e2a\u5bf9\u8c61\u7684\u503c\u662f\u5426\u76f8\u540c\uff0c\u800c\u5bf9\u4e8e\u5bf9\u8c61\u65f6\uff0c\u5219\u6bd4\u8f83\u7684\u662f\u8fd9\u4e24\u4e2a\u5f15\u7528\u662f\u5426\u6307\u5411\u4e86\u540c\u4e00\u4e2a\u5bf9\u8c61 equals \u5219\u53ef\u4ee5\u7531\u6b64\u7c7b\u8fdb\u884c\u91cd\u5199\uff0c\u4f7f\u5f97\u5176\u6ee1\u8db3\u6b63\u5e38\u7684\u6bd4\u8f83\u5173\u7cfb\u3002\u82e5\u4e0d\u8fdb\u884c\u91cd\u5199\uff0c\u5219\u4e0e == \u7b49\u4ef7 equals \u548c hashCode \u4e3a\u4ec0\u4e48\u9700\u8981\u540c\u65f6\u8fdb\u884c\u91cd\u5199 hashCode \u5728 Object \u7c7b\u4e0b\u7684\u9ed8\u8ba4\u884c\u4e3a\u662f\u5c06\u6b64\u503c\u7684\u5730\u5740\u53d6\u51fa\u4f5c\u4e3a hashCode \uff0c\u4f46\u8fd9\u4e0e hashCode \u672c\u610f\u4e0d\u540c\uff0c hashCode \u7684\u503c\u5e94\u5f53\u6ee1\u8db3\u5bf9\u4e8e\u4efb\u610fx\u82e5 x.equals(y) = true \uff0c\u5219 x.hashCode() = y.hashCode() \uff0c\u6240\u4ee5\u5f53\u91cd\u5199 equals \u65f6\uff0c\u901a\u5e38\u610f\u5473\u7740\u8fd9\u4e2a\u503c\u7684\u76f8\u7b49\u6982\u5ff5\u4e0e == \u4e0d\u540c\u3002\u6240\u4ee5\u5fc5\u7136\u9700\u8981\u91cd\u5199 hashCode \u907f\u514d\u5728 hashMap \u4e2d\u51fa\u73b0\u610f\u6599\u4e4b\u5916\u7684\u60c5\u51b5 CopyOnWrite \u00b6 \u5199\u5165\u65f6\u590d\u5236\uff08CopyOnWrite\uff0c\u7b80\u79f0COW\uff09\u601d\u60f3\u662f\u8ba1\u7b97\u673a\u7a0b\u5e8f\u8bbe\u8ba1\u9886\u57df\u4e2d\u7684\u4e00\u79cd\u901a\u7528\u4f18\u5316\u7b56\u7565\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\uff0c\u5982\u679c\u6709\u591a\u4e2a\u8c03\u7528\u8005\uff08Callers\uff09\u540c\u65f6\u8bbf\u95ee\u76f8\u540c\u7684\u8d44\u6e90\uff08\u5982\u5185\u5b58\u6216\u8005\u662f\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u5b58\u50a8\uff09\uff0c\u4ed6\u4eec\u4f1a\u5171\u540c\u83b7\u53d6\u76f8\u540c\u7684\u6307\u9488\u6307\u5411\u76f8\u540c\u7684\u8d44\u6e90\uff0c\u76f4\u5230\u67d0\u4e2a\u8c03\u7528\u8005\u4fee\u6539\u8d44\u6e90\u5185\u5bb9\u65f6\uff0c\u7cfb\u7edf\u624d\u4f1a\u771f\u6b63\u590d\u5236\u4e00\u4efd\u4e13\u7528\u526f\u672c\uff08private copy\uff09\u7ed9\u8be5\u8c03\u7528\u8005\uff0c\u800c\u5176\u4ed6\u8c03\u7528\u8005\u6240\u89c1\u5230\u7684\u6700\u521d\u7684\u8d44\u6e90\u4ecd\u7136\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u8fc7\u7a0b\u5bf9\u5176\u4ed6\u7684\u8c03\u7528\u8005\u90fd\u662f\u900f\u660e\u7684\uff08transparently\uff09\u3002\u6b64\u505a\u6cd5\u4e3b\u8981\u7684\u4f18\u70b9\u662f\u5982\u679c\u8c03\u7528\u8005\u6ca1\u6709\u4fee\u6539\u8d44\u6e90\uff0c\u5c31\u4e0d\u4f1a\u6709\u526f\u672c\uff08private copy\uff09\u88ab\u521b\u5efa\uff0c\u56e0\u6b64\u591a\u4e2a\u8c03\u7528\u8005\u53ea\u662f\u8bfb\u53d6\u64cd\u4f5c\u65f6\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4efd\u8d44\u6e90\u3002 \u901a\u4fd7\u6613\u61c2\u7684\u8bb2\uff0c\u5199\u5165\u65f6\u590d\u5236\u6280\u672f\u5c31\u662f\u4e0d\u540c\u8fdb\u7a0b\u5728\u8bbf\u95ee\u540c\u4e00\u8d44\u6e90\u7684\u65f6\u5019\uff0c\u53ea\u6709\u66f4\u65b0\u64cd\u4f5c\uff0c\u624d\u4f1a\u53bb\u590d\u5236\u4e00\u4efd\u65b0\u7684\u6570\u636e\u5e76\u66f4\u65b0\u66ff\u6362\uff0c\u5426\u5219\u90fd\u662f\u8bbf\u95ee\u540c\u4e00\u4e2a\u8d44\u6e90\u3002 JDK \u7684 CopyOnWriteArrayList/CopyOnWriteArraySet \u5bb9\u5668\u6b63\u662f\u91c7\u7528\u4e86 COW \u601d\u60f3\uff0c\u5b83\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u5462\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5e73\u65f6\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u90fd\u4e0d\u9700\u8981\u52a0\u9501\uff0c\u968f\u4fbf\u8bbf\u95ee\uff0c\u53ea\u6709\u5728\u66f4\u65b0\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u4ece\u539f\u6765\u7684\u6570\u636e\u590d\u5236\u4e00\u4e2a\u526f\u672c\u51fa\u6765\uff0c\u7136\u540e\u4fee\u6539\u8fd9\u4e2a\u526f\u672c\uff0c\u6700\u540e\u628a\u539f\u6570\u636e\u66ff\u6362\u6210\u5f53\u524d\u7684\u526f\u672c\u3002\u4fee\u6539\u64cd\u4f5c\u7684\u540c\u65f6\uff0c\u8bfb\u64cd\u4f5c\u4e0d\u4f1a\u88ab\u963b\u585e\uff0c\u800c\u662f\u7ee7\u7eed\u8bfb\u53d6\u65e7\u7684\u6570\u636e\u3002\u8fd9\u70b9\u8981\u8ddf\u8bfb\u5199\u9501\u533a\u5206\u4e00\u4e0b\u3002","title":"Java \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/java/basic/#java","text":"\u7ea6 2317 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u51c6\u5907\u9762\u8bd5\u65f6\u7a0d\u5fae\u5b66\u4e60\u7684\u4e00\u4e9b\u96f6\u6563\u77e5\u8bc6 \uff08\u4e0d\u7528java\uff0c\u4e5f\u4e0d\u559c\u6b22java\uff0c\u4f46\u8fd8\u662f\u8bb0\u5f55\u4e00\u4e0b\u5427","title":"Java \u7cfb\u7edf\u77e5\u8bc6"},{"location":"cs/pl/java/basic/#_1","text":"\u7ebf\u6027\u6c60\u7684\u539f\u56e0 \u4e0d\u65ad\u7684\u521b\u5efa\u548c\u5220\u7ebf\u7a0b\uff0c\u4f1a\u5e26\u6765\u8f83\u5927\u7684\u7cfb\u7edf\u8d44\u6e90\u8d1f\u8f7d \u7ebf\u7a0b\u7f3a\u4e4f\u7edf\u4e00\u7684\u7ba1\u7406\uff0c\u53ef\u80fd\u4f1a\u5e26\u6765\u65e0\u9650\u5236\u7684\u521b\u5efa\u7ebf\u7a0b \u7ebf\u7a0b\u4e4b\u95f4\u62a2\u5360\u8d44\u6e90 \u7ebf\u7a0b\u6c60\u7684\u5c5e\u6027 \u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u4fdd\u6301\u5b58\u5728\u7684\u7ebf\u7a0b\u6570\u91cf\uff0c\u8fd9\u4e9b\u7ebf\u7a0b\u4f1a\u4e00\u76f4\u5b58\u5728\uff0c\u4e0d\u4f1a\u88ab\u5220\u9664 \u4efb\u52a1\u7f13\u51b2\u9510\u88c2\uff1a\u5f53\u6240\u6709\u7684\u6838\u5fc3\u7ebf\u7a0b\u90fd\u5728\u8fd0\u884c\u65f6\uff0c\u65b0\u7684\u4efb\u52a1\u4f1a\u88ab\u52a0\u5165\u5230\u7f13\u51b2\u961f\u5217\u4e2d \u975e\u6838\u5fc3\u7ebf\u7a0b\u6570\uff1a\u5f53\u4efb\u52a1\u7f13\u51b2\u961f\u5217\u6ee1\u540e\uff0c\u5c06\u4f1a\u521b\u5efa\u65b0\u7684\u7ebf\u7a0b\u6765\u6267\u884c\u961f\u5217\u4e2d\u7684\u4efb\u52a1\uff0c\u4e14\u989d\u5916\u521b\u5efa\u7684\u7ebf\u7a0b\u6570\u4e0d\u4f1a\u8d85\u8fc7\u975e\u6838\u5fc3\u7ebf\u7a0b\u6570 \u7a7a\u95f2\u7ebf\u7a0b\u7684\u5b58\u6d3b\u65f6\u95f4\uff1a\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u7a7a\u95f2\u65f6\uff0c\u4e14\u6301\u7eed\u4e86\u4e00\u6bb5\u65f6\u95f4\u540e\uff0c\u6b64\u7ebf\u7a0b\u5c06\u4f1a\u88ab\u5220\u9664 \u62d2\u7edd\u7b56\u7565\uff0c\u5f53\u975e\u6838\u5fc3\u7ebf\u7a0b\u548c\u4efb\u52a1\u7f13\u5b58\u961f\u5217\u6ee1\u540e\uff0c\u5bf9\u5f85\u65b0\u7684\u4efb\u52a1\u7684\u7b56\u7565 Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u7c7b\u578b \u540d\u79f0 \u6838\u5fc3\u7ebf\u7a0b\u6570 \u7ebf\u7a0b\u6c60\u5927\u5c0f \u975e\u6838\u5fc3\u7ebf\u7a0b\u5b58\u6d3b\u65f6\u95f4 \u7b49\u5f85\u961f\u5217\u5927\u5c0f CachedThreadPool 0 \u221e 60s 0 SingleThreadExecutor 1 1 0 \u221e FixedThreadPool n n 0 \u221e ScheduledThreadPoolExecutor Java\u9ed8\u8ba4\u7684\u7ebf\u7a0b\u6c60\u6709\u4ec0\u4e48\u95ee\u9898\uff0c\u4e3a\u4ec0\u4e48\u4f1a\u5f15\u8d77OOM\u5f02\u5e38\uff08OutOfMemoryError\uff09 CachedThreadPool\u5141\u8bb8\u521b\u5efa\u65e0\u7ebf\u7684\u7ebf\u7a0b\uff0c\u4ece\u800c\u5f15\u8d77OOM\u5f02\u5e38 SingleThreadExecutor\u548cFixedThreadPool\u8bf7\u6c42\u961f\u5217\u4e3a\u65e0\u9650\u957f\uff0c\u53ef\u80fd\u4f1a\u5806\u79ef\u5927\u91cf\u7684\u6d88\u606f\uff0c\u4ece\u800c\u5f15\u53d1OOM\u5f02\u5e38\u3002","title":"\u7ebf\u6027\u6c60"},{"location":"cs/pl/java/basic/#java_1","text":"\u5185\u5b58\u7c7b\u578b \u4e3b\u5185\u5b58\uff1a\u7ebf\u7a0b\u4e4b\u95f4\u5171\u4eab\u7684\u53d8\u91cf\u50a8\u5b58\u5728\u4e3b\u5185\u5b58\u4e2d \u672c\u5730\u5185\u5b58\uff1a\u6bcf\u4e2a\u7ebf\u7a0b\u72ec\u7acb\u62e5\u6709\u7684\u5185\u5b58 \u672c\u5730\u5185\u5b58\u4fdd\u5b58\u7684\u662f\u4e3b\u5185\u5b58\u7684\u5171\u4eab\u53d8\u91cf\u7684\u526f\u672c \u5783\u573e\u56de\u6536 \u6839\u641c\u7d22\u7b97\u6cd5\uff08\u53ef\u8fbe\u6027\u5206\u6790\u7b97\u6cd5\uff09\u4eceGC ROOT\u7ed3\u70b9\u6cbf\u7740\u5f15\u7528\u94fe\u641c\u7d22\uff0c\u65e0\u6cd5\u5230\u8fbe\u7684\u7ed3\u70b9\u5373\u4e3a\u4e0d\u53ef\u5230\u8fbe\u7684\u5bf9\u8c61 \u5783\u573e\u56de\u6536\u5668 G1\u6536\u96c6\u5668 \u72ec\u7279\u7684\u5206\u4ee3\u5783\u573e\u56de\u6536\u5668\uff0c\u5206\u4ee3GC\uff1a\u5206\u4ee3\u6536\u96c6\u5668\uff0c\u540c\u65f6\u517c\u987e\u5e74\u8f7b\u4ee3\u548c\u8001\u5e74\u4ee3 \u4f7f\u7528\u5206\u533a\u7b97\u6cd5\uff0c\u4e0d\u8981\u6c42eden\uff0c\u5e74\u8f7b\u4ee3\u6216\u8001\u5e74\u4ee3\u7684\u7a7a\u95f4\u90fd\u8fde\u7eed \u5e76\u884c\u6027\uff1a\u56de\u6536\u671f\u95f4\uff0c\u53ef\u7531\u591a\u4e2a\u7ebf\u7a0b\u540c\u65f6\u5de5\u4f5c\uff0c\u6709\u6548\u5229\u7528\u591a\u6838CPU\u8d44\u6e90 \u7a7a\u95f4\u6574\u7406\uff1a\u56de\u6536\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u8fdb\u884c\u9002\u5f53\u5bf9\u8c61\u79fb\u52a8\uff0c\u51cf\u5c11\u7a7a\u95f4\u788e\u7247 \u53ef\u9884\u89c1\u6027\uff1aG1\u53ef\u9009\u53d6\u90e8\u5206\u533a\u57df\u8fdb\u884c\u56de\u6536\uff0c\u53ef\u89c1\u7f29\u5c0f\u56de\u6536\u8303\u56f4\uff0c\u51cf\u5c11\u5168\u5c40\u505c\u987f G1\u6536\u96c6\u5668\u7684\u8fc7\u7a0b \u521d\u59cb\u6807\u8bb0\uff08\u5b83\u6807\u8bb0\u4e86\u4eceGC ROOT\u5f00\u59cb\u76f4\u63a5\u53ef\u8fbe\u7684\u5bf9\u8c61\uff09Stop-The-World \u5e76\u53d1\u6807\u8bb0\uff08\u4eceGC Roots\u5f00\u59cb\u5bf9\u5806\u4e2d\u5bf9\u8c61\u8fdb\u884c\u53ef\u8fbe\u6027\u5206\u6790\uff0c\u627e\u51fa\u5b58\u6d3b\u5bf9\u8c61\uff09 \u6700\u7ec8\u6807\u8bb0\uff08\u6807\u8bb0\u90a3\u4e9b\u5728\u5e76\u53d1\u6807\u8bb0\u9636\u6bb5\u53d1\u751f\u53d8\u5316\u7684\u5bf9\u8c61\uff0c\u5c06\u88ab\u56de\u6536\uff09Stop-The-World \u7b5b\u9009\u56de\u6536\uff08\u9996\u5148\u5bf9\u5404\u4e2aRegin\u7684\u56de\u6536\u4ef7\u503c\u548c\u6210\u672c\u8fdb\u884c\u6392\u5e8f\uff0c\u6839\u636e\u7528\u6237\u6240\u671f\u5f85\u7684GC\u505c\u987f\u65f6\u95f4\u6307\u5b9a\u56de\u6536\u8ba1\u5212\uff0c\u56de\u6536\u4e00\u90e8\u5206Region\uff09Stop-The-World","title":"Java\u5185\u5b58"},{"location":"cs/pl/java/basic/#map","text":"HashMap\u7684\u7ed3\u6784 \u91c7\u7528\u94fe\u5730\u5740\u6cd5\uff0c\u5f53\u53d1\u751f\u54c8\u5e0c\u51b2\u7a81\u65f6\u4f7f\u7528\u94fe\u8868\u89e3\u51b3 \u5f53\u94fe\u8868\u8fc7\u957f\u65f6\uff0c\u5728JDK1.8\u4e0b\u91c7\u7528\u7ea2\u9ed1\u6811\u4ee3\u66ff\u94fe\u8868\uff0c\u5f53\u6570\u636e\u91cf\u8f83\u5c11\u65f6\uff0c\u8f6c\u56de\u94fe\u8868 \u5f53\u5b58\u50a8\u7684\u6570\u636e\u91cf\u8d85\u8fc7\u4e00\u4e2a\u9608\u503c\u540e\uff0cHashMap\u7684\u54c8\u5e0c\u8868\u957f\u5ea6\u5c06\u4f1a\u6269\u5bb9\u5230\u539f\u6765\u7684\u4e24\u500d\uff0c\u7136\u540e\u5c06\u6240\u6709\u7684\u6570\u636e\u91cd\u65b0\u5206\u914d\u5230\u65b0\u7684\u5185\u5b58\u4e2d HashMap\u8fd9\u6837\u6269\u5bb9\u7684\u539f\u56e0 \u901a\u8fc7\u6070\u597d\u4e24\u500d\u6269\u5bb9\uff0c\u53ef\u4ee5\u8ba9\u539f\u6765\u5728\u7b2ci\u4e2a\u94fe\u8868\u7684\u503c\u88ab\u6070\u597d\u5206\u914d\u5230\u7b2ci\u548c\u7b2c2i\u4e2a\u94fe\u8868\u7684\u4f4d\u7f6e \u6bcf\u4e00\u4e2a\u503c\uff0c\u53ea\u9700\u8981\u5224\u65ad\u5176\u54c8\u5e0c\u503c\u5728\u67d0\u4e2a\u4e8c\u8fdb\u5236\u4f4d\u4e0a\u7684\u503c\u5373\u53ef\u76f4\u63a5\u5b8c\u6210\u5206\u914d TreeMap\u7684\u7ed3\u6784 TreeMap\u662f\u4e00\u9897\u7ea2\u9ed1\u6811","title":"Map"},{"location":"cs/pl/java/basic/#_2","text":"\u8bbe\u8ba1\u539f\u5219 \u5f00\u95ed\u539f\u5219\uff1a\u5bf9\u6269\u5c55\u5f00\u653e\uff0c\u5bf9\u4fee\u6539\u5173\u95ed \u91cc\u6c0f\u66ff\u6362\u539f\u5219\uff1a\u5b50\u7c7b\u5fc5\u987b\u62e5\u6709\u6240\u6709\u7684\u7236\u7c7b\u529f\u80fd\uff0c\u5b50\u7c7b\u53ef\u4ee5\u5f00\u53d1\u81ea\u5df1\u7684\u65b0\u529f\u80fd \u4f9d\u8d56\u5012\u7f6e\u539f\u5219\uff1a\u9ad8\u5c42\u5b9e\u73b0\u4e0d\u80fd\u4f9d\u8d56\u4f4e\u5c42\u5b9e\u73b0\uff0c\u800c\u662f\u4f9d\u8d56\u4e8e\u4f4e\u5c42\u7684\u62bd\u8c61\u7c7b \u5355\u4e00\u804c\u8d23\u539f\u5219\uff1a\u4e00\u4e2a\u7c7b\u5e94\u5f53\u53ea\u8d1f\u8d23\u4e00\u4e2a\u804c\u8d23 \u63a5\u53e3\u9694\u79bb\u539f\u5219\uff1a\u63a5\u53e3\u5e94\u8be5\u66f4\u5c0f\u66f4\u5177\u4f53\uff0c\u800c\u4e0d\u662f\u53bb\u5b9e\u73b0\u5f88\u5e9e\u5927\u7684\u501f\u53e3\u6765\u9002\u5e94\u6240\u6709\u9700\u6c42 \u8fea\u7c73\u7279\u6cd5\u5219\uff1a\u907f\u514d\u4e0e\u65e0\u5173\u5b9e\u4f53\u8fdb\u884c\u901a\u4fe1 \u5408\u6210\u590d\u7528\u539f\u5219\uff1a\u5c3d\u91cf\u5148\u4f7f\u7528\u7ec4\u5408\u6216\u8005\u805a\u5408\u7b49\u5173\u8054\uff0c\u5176\u6b21\u8003\u8651\u7ee7\u627f \u8bbe\u8ba1\u6a21\u5f0f \u521b\u5efa\u578b\u6a21\u5f0f \u5355\u4f8b\u6a21\u5f0f\uff1a\u9650\u5236\u4e00\u4e2a\u7c7b\u53ea\u80fd\u6709\u4e00\u4e2a\u5b9e\u4f8b \u539f\u578b\u6a21\u5f0f\uff1a\u4ee5\u4e00\u4e2a\u6b64\u7c7b\u578b\u7684\u5b9e\u4f8b\u4e3a\u6a21\u7248\uff0c\u901a\u8fc7\u62f7\u8d1d\u5185\u5b58\u4e2d\u7684\u4e8c\u8fdb\u5236\u503c\u6765\u76f4\u63a5\u521b\u5efa\u4e00\u4e2a\u5bf9\u8c61 \u5de5\u5382\u6a21\u5f0f\uff1a\u5c06\u521b\u5efa\u5bf9\u8c61\u7684\u8fc7\u7a0b\u7531\u53e6\u4e00\u4e2a\u7c7b\u8fdb\u884c\u5c01\u88c5 \u5efa\u9020\u8005\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u590d\u6742\u7684\u5bf9\u8c61\u5206\u4e3a\u591a\u4e2a\u7b80\u5355\u7684\u5bf9\u8c61\u7684\u7ec4\u5408\uff0c\u5e76\u5b9e\u73b0\u5c06\u591a\u4e2a\u5c0f\u5bf9\u8c61\u8fdb\u884c\u62fc\u88c5\u7684\u8fc7\u7a0b \u7ed3\u6784\u578b\u6a21\u5f0f \u4ee3\u7406\u6a21\u5f0f\uff1a\u4f7f\u5f97\u4e24\u4e2a\u5bf9\u8c61\u4e4b\u95f4\u4e0d\u80fd\u76f4\u63a5\u5f15\u7528\u8bbf\u95ee\uff0c\u53ea\u80fd\u901a\u8fc7\u7b2c\u4e09\u65b9\uff0c\u53ef\u4ee5\u4fdd\u62a4\u76ee\u6807\u5bf9\u8c61\uff0c\u6269\u5c55\u76ee\u6807\u5bf9\u8c61\u7684\u529f\u80fd \u9002\u914d\u5668\u6a21\u5f0f\uff1a\u5c06\u4e00\u4e2a\u7c7b\u7684\u63a5\u53e3\u8f6c\u6362\u4e3a\u53e6\u4e00\u4e2a\u7c7b\u7684\u501f\u53e3\uff0c\u901a\u5e38\u662f\u4e3a\u4e86\u9002\u914d\u4e24\u4e2a\u63a5\u53e3\u7684\u5bf9\u63a5\u95ee\u9898 \u6865\u63a5\u6a21\u5f0f\uff1a\u5c06\u62bd\u8c61\u4e0e\u5b9e\u73b0\u5206\u79bb\uff0c\u4f7f\u5f97\u4ed6\u4eec\u53ef\u4ee5\u72ec\u7acb\u53d8\u5316\uff0c\u7528\u7ec4\u5408\u5173\u7cfb\u6765\u4ee3\u66ff\u7ee7\u627f\u5173\u7cfb \u88c5\u9970\u5668\u6a21\u5f0f\uff1a\u4e3a\u7c7b\u589e\u52a0\u65b0\u7684\u529f\u80fd\u7684\u540c\u65f6\uff0c\u907f\u514d\u4e86\u7ee7\u627f \u5916\u89c2\u6a21\u5f0f\uff1a\u9690\u85cf\u7cfb\u7edf\u7684\u590d\u6742\u6027 \u4eab\u5143\u6a21\u5f0f\uff1a\u91cd\u590d \u4f7f\u7528\u5df2\u7ecf\u521b\u5efa\u7684\u540c\u7c7b\u5bf9\u8c61 \u7ec4\u5408\u6a21\u5f0f \u884c\u4e3a\u578b\u6a21\u5f0f \u6a21\u677f\u65b9\u6cd5\u6a21\u5f0f\uff1a\u4ec5\u5b9e\u73b0\u4e00\u4e2a\u64cd\u4f5c\u4e2d\u7684\u9aa8\u5e72\u6b65\u9aa4\uff0c\u5177\u4f53\u6b65\u9aa4\u7531\u5176\u5b50\u7c7b\u5b9e\u73b0 \u7b56\u7565\u6a21\u5f0f \u547d\u4ee4\u6a21\u5f0f \u8d23\u4efb\u94fe\u6a21\u5f0f \u72b6\u6001\u6a21\u5f0f \u89c2\u5bdf\u8005\u6a21\u5f0f \u4e2d\u4ecb\u8005\u6a21\u5f0f \u8fed\u4ee3\u5668\u6a21\u5f0f \u8bbf\u95ee\u8005\u6a21\u5f0f \u5907\u5fd8\u5f55\u6a21\u5f0f \u89e3\u91ca\u5668\u6a21\u5f0f","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/pl/java/basic/#string","text":"String\u7c7b\u578b String\u7c7b\u578b\u662f\u4e0d\u53ef\u53d8\u7684\uff0c\u5bf9String\u7c7b\u578b\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u4f1a\u91cd\u65b0\u751f\u6210\u65b0\u7684String\u5bf9\u8c61 StringBuilder\u548cStringBuffer StringBuilder\u548cStringBuffer\u90fd\u662f\u53ef\u53d8\u7684 StringBuilder\u6ca1\u6709\u7ebf\u7a0b\u540c\u6b65\uff0c\u5b58\u5728\u7ebf\u7a0b\u5b89\u5168\u95ee\u9898\uff0c\u4f46\u662f\u5176\u6548\u7387\u7565\u9ad8\u4e8eStringBuffer StringBuffer\u80fd\u591f\u4fdd\u8bc1\u7ebf\u7a0b\u5b89\u5168\uff0c\u4f46\u6548\u7387\u8f83\u4f4e","title":"String"},{"location":"cs/pl/java/basic/#_3","text":"\u63a5\u53e3\u548c\u62bd\u8c61\u7c7b\u7684\u533a\u522b \u62bd\u8c61\u7c7b\u53ef\u4ee5\u5199\u975e\u62bd\u8c61\u65b9\u6cd5\uff0c\u800c\u63a5\u53e3\u7c7b\u53ea\u80fd\u6709\u62bd\u8c61\u65b9\u6cd5 \u4e00\u4e2a\u7c7b\u53ea\u80fd\u7ee7\u627f\u81ea\u4e00\u4e2a\u62bd\u8c61\u7c7b\uff0c\u800c\u4e00\u4e2a\u7c7b\u80fd\u5b9e\u73b0\u591a\u4e2a\u63a5\u53e3 \u7ee7\u627f\u662f\u4e00\u4e2a\u201c\u662f\u4e0d\u662f\u201d\u7684\u5173\u7cfb\uff0c\u800c\u63a5\u53e3\u5b9e\u73b0\u5219\u662f\u201c\u6709\u6ca1\u6709\u201d\u7684\u5173\u7cfb","title":"\u63a5\u53e3\u548c\u62bd\u8c61\u7c7b"},{"location":"cs/pl/java/basic/#_4","text":"\u5b50\u7c7b\u5b9e\u4f8b\u5316\u603b\u662f\u9ed8\u8ba4\u8c03\u7528\u7236\u7c7b\u7684\u65e0\u53c2\u6784\u9020\u65b9\u6cd5 \u4e3a\u4e86\u8ba9\u7236\u7c7b\u521d\u59cb\u5316\u5c5e\u6027\u548c\u65b9\u6cd5","title":"\u6784\u9020\u51fd\u6570"},{"location":"cs/pl/java/basic/#equals","text":"equals \u548c == \u7684\u533a\u522b == \u5bf9\u4e8e\u57fa\u672c\u7c7b\u578b\u65f6\uff0c\u6bd4\u8f83\u7684\u662f\u4e24\u4e2a\u5bf9\u8c61\u7684\u503c\u662f\u5426\u76f8\u540c\uff0c\u800c\u5bf9\u4e8e\u5bf9\u8c61\u65f6\uff0c\u5219\u6bd4\u8f83\u7684\u662f\u8fd9\u4e24\u4e2a\u5f15\u7528\u662f\u5426\u6307\u5411\u4e86\u540c\u4e00\u4e2a\u5bf9\u8c61 equals \u5219\u53ef\u4ee5\u7531\u6b64\u7c7b\u8fdb\u884c\u91cd\u5199\uff0c\u4f7f\u5f97\u5176\u6ee1\u8db3\u6b63\u5e38\u7684\u6bd4\u8f83\u5173\u7cfb\u3002\u82e5\u4e0d\u8fdb\u884c\u91cd\u5199\uff0c\u5219\u4e0e == \u7b49\u4ef7 equals \u548c hashCode \u4e3a\u4ec0\u4e48\u9700\u8981\u540c\u65f6\u8fdb\u884c\u91cd\u5199 hashCode \u5728 Object \u7c7b\u4e0b\u7684\u9ed8\u8ba4\u884c\u4e3a\u662f\u5c06\u6b64\u503c\u7684\u5730\u5740\u53d6\u51fa\u4f5c\u4e3a hashCode \uff0c\u4f46\u8fd9\u4e0e hashCode \u672c\u610f\u4e0d\u540c\uff0c hashCode \u7684\u503c\u5e94\u5f53\u6ee1\u8db3\u5bf9\u4e8e\u4efb\u610fx\u82e5 x.equals(y) = true \uff0c\u5219 x.hashCode() = y.hashCode() \uff0c\u6240\u4ee5\u5f53\u91cd\u5199 equals \u65f6\uff0c\u901a\u5e38\u610f\u5473\u7740\u8fd9\u4e2a\u503c\u7684\u76f8\u7b49\u6982\u5ff5\u4e0e == \u4e0d\u540c\u3002\u6240\u4ee5\u5fc5\u7136\u9700\u8981\u91cd\u5199 hashCode \u907f\u514d\u5728 hashMap \u4e2d\u51fa\u73b0\u610f\u6599\u4e4b\u5916\u7684\u60c5\u51b5","title":"equals"},{"location":"cs/pl/java/basic/#copyonwrite","text":"\u5199\u5165\u65f6\u590d\u5236\uff08CopyOnWrite\uff0c\u7b80\u79f0COW\uff09\u601d\u60f3\u662f\u8ba1\u7b97\u673a\u7a0b\u5e8f\u8bbe\u8ba1\u9886\u57df\u4e2d\u7684\u4e00\u79cd\u901a\u7528\u4f18\u5316\u7b56\u7565\u3002\u5176\u6838\u5fc3\u601d\u60f3\u662f\uff0c\u5982\u679c\u6709\u591a\u4e2a\u8c03\u7528\u8005\uff08Callers\uff09\u540c\u65f6\u8bbf\u95ee\u76f8\u540c\u7684\u8d44\u6e90\uff08\u5982\u5185\u5b58\u6216\u8005\u662f\u78c1\u76d8\u4e0a\u7684\u6570\u636e\u5b58\u50a8\uff09\uff0c\u4ed6\u4eec\u4f1a\u5171\u540c\u83b7\u53d6\u76f8\u540c\u7684\u6307\u9488\u6307\u5411\u76f8\u540c\u7684\u8d44\u6e90\uff0c\u76f4\u5230\u67d0\u4e2a\u8c03\u7528\u8005\u4fee\u6539\u8d44\u6e90\u5185\u5bb9\u65f6\uff0c\u7cfb\u7edf\u624d\u4f1a\u771f\u6b63\u590d\u5236\u4e00\u4efd\u4e13\u7528\u526f\u672c\uff08private copy\uff09\u7ed9\u8be5\u8c03\u7528\u8005\uff0c\u800c\u5176\u4ed6\u8c03\u7528\u8005\u6240\u89c1\u5230\u7684\u6700\u521d\u7684\u8d44\u6e90\u4ecd\u7136\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u8fc7\u7a0b\u5bf9\u5176\u4ed6\u7684\u8c03\u7528\u8005\u90fd\u662f\u900f\u660e\u7684\uff08transparently\uff09\u3002\u6b64\u505a\u6cd5\u4e3b\u8981\u7684\u4f18\u70b9\u662f\u5982\u679c\u8c03\u7528\u8005\u6ca1\u6709\u4fee\u6539\u8d44\u6e90\uff0c\u5c31\u4e0d\u4f1a\u6709\u526f\u672c\uff08private copy\uff09\u88ab\u521b\u5efa\uff0c\u56e0\u6b64\u591a\u4e2a\u8c03\u7528\u8005\u53ea\u662f\u8bfb\u53d6\u64cd\u4f5c\u65f6\u53ef\u4ee5\u5171\u4eab\u540c\u4e00\u4efd\u8d44\u6e90\u3002 \u901a\u4fd7\u6613\u61c2\u7684\u8bb2\uff0c\u5199\u5165\u65f6\u590d\u5236\u6280\u672f\u5c31\u662f\u4e0d\u540c\u8fdb\u7a0b\u5728\u8bbf\u95ee\u540c\u4e00\u8d44\u6e90\u7684\u65f6\u5019\uff0c\u53ea\u6709\u66f4\u65b0\u64cd\u4f5c\uff0c\u624d\u4f1a\u53bb\u590d\u5236\u4e00\u4efd\u65b0\u7684\u6570\u636e\u5e76\u66f4\u65b0\u66ff\u6362\uff0c\u5426\u5219\u90fd\u662f\u8bbf\u95ee\u540c\u4e00\u4e2a\u8d44\u6e90\u3002 JDK \u7684 CopyOnWriteArrayList/CopyOnWriteArraySet \u5bb9\u5668\u6b63\u662f\u91c7\u7528\u4e86 COW \u601d\u60f3\uff0c\u5b83\u662f\u5982\u4f55\u5de5\u4f5c\u7684\u5462\uff1f\u7b80\u5355\u6765\u8bf4\uff0c\u5c31\u662f\u5e73\u65f6\u67e5\u8be2\u7684\u65f6\u5019\uff0c\u90fd\u4e0d\u9700\u8981\u52a0\u9501\uff0c\u968f\u4fbf\u8bbf\u95ee\uff0c\u53ea\u6709\u5728\u66f4\u65b0\u7684\u65f6\u5019\uff0c\u624d\u4f1a\u4ece\u539f\u6765\u7684\u6570\u636e\u590d\u5236\u4e00\u4e2a\u526f\u672c\u51fa\u6765\uff0c\u7136\u540e\u4fee\u6539\u8fd9\u4e2a\u526f\u672c\uff0c\u6700\u540e\u628a\u539f\u6570\u636e\u66ff\u6362\u6210\u5f53\u524d\u7684\u526f\u672c\u3002\u4fee\u6539\u64cd\u4f5c\u7684\u540c\u65f6\uff0c\u8bfb\u64cd\u4f5c\u4e0d\u4f1a\u88ab\u963b\u585e\uff0c\u800c\u662f\u7ee7\u7eed\u8bfb\u53d6\u65e7\u7684\u6570\u636e\u3002\u8fd9\u70b9\u8981\u8ddf\u8bfb\u5199\u9501\u533a\u5206\u4e00\u4e0b\u3002","title":"CopyOnWrite"},{"location":"cs/pl/java/springboot/","text":"SpringBoot \u00b6 \u7ea6 1231 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u5f53\u521d\u4e3a\u4e86\u505a\u6570\u636e\u5e93\u8bfe\u8bbe\uff0c\u8ba9\u724c\u738b\u82b1\u4e86 1.5h \u6559\u6211 springboot \u5165\u95e8\uff0c\u4e4b\u524d\u5199\u5728 csdn \u4e0a\uff0c\u73b0\u5728\u79fb\u5230 note \u91cc \u9996\u5148\u521b\u5efa\u4e00\u4e2aspringboot\u9879\u76ee\u3002 model\u5c42 \u00b6 model\u5c42\u4e5f\u53ebpojo\u5c42\u6216\u8005entity\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22pojo\u5c42\u3002 \u4e00\u822c\u6570\u636e\u5e93\u7684\u4e00\u5f20\u8868\u5bf9\u5e94\u4e00\u4e2apojo\u5c42\uff0c\u5e76\u4e14\u8868\u4e2d\u6240\u6709\u5b57\u6bb5\u90fd\u5728pojo\u5c42\u90fd\u4e00\u4e00\u5bf9\u5e94\u3002 eg\uff1a\u4e00\u5f20Goods\u8868 \u7136\u540e\u8981\u5148\u5efa\u4e00\u4e2apojo\u7684package\uff0c\u4ee3\u8868\u5b83\u662f\u5b9e\u4f53\u5c42\u3002 \u518d\u5728\u8be5package\u4e0b\u521b\u5efa\u4e00\u4e2aGoods\u7684java\u6587\u4ef6\uff0c\u521b\u5efa\u7684\u5bf9\u8c61\u90fd\u662f\u548c\u8868\u91cc\u5b57\u6bb5\u4e00\u4e00\u5bf9\u5e94\uff0c\u5982\u4e0b\u6240\u793a\uff1a package pojo ; import lombok.* ; @Data public class Goods { /* \u5546\u54c1\u7f16\u53f7 */ private String GNo ; /* \u5546\u54c1\u540d\u79f0 */ private String GName ; /* \u5546\u54c1\u4ef7\u683c */ private Double GPrice ; } \u8fd9\u91cc\u7684lombok\u7684\u4f5c\u7528\u65f6\u4e3a\u4e86\u7b80\u5316\u4ee3\u7801\uff0c\u56e0\u4e3a\u5bf9\u4e8eprivate\u8fd9\u6837\u7684\u5bf9\u8c61\uff0c\u60f3\u8981\u8c03\u7528\u5b83\u7684\u65f6\u5019\uff0c\u9700\u8981get\u548cset\u4e24\u4e2a\u65b9\u6cd5\uff0c\u800c\u6709\u4e86lombok\u4e4b\u540e\u5c31\u53ef\u4ee5\u4e0d\u7528\u5199\uff0c\u76f4\u63a5\u7528\u5373\u53ef\u3002 \u4e0d\u8fc7\u8981\u6dfb\u52a0\u4f9d\u8d56\u548c\u6ce8\u89e3@Data\uff0clombok\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7528\u6cd5\uff0c\u4e4b\u540e\u53ef\u80fd\u4f1a\u51fa\u4e00\u7bc7\u535a\u5ba2\u3002 \u901a\u8fc7maven\u4e0b\u8f7d\u4f9d\u8d56\uff1a < dependency > < groupId > org . projectlombok < artifactId > lombok < optional > true \u8fd9\u6837\u6570\u636e\u5e93\u91cc\u7684\u5b57\u6bb5\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u5bf9\u8c61\u6765\u8868\u793a\u3002 \u4f46\u662fmodel\u4e0d\u5c5e\u4e8espringboot\u7684\u4e09\u5c42\u6846\u67b6\u3002 \u4e3b\u8981\u8bf4\u660e\u662fdao\u5c42\u3001service\u5c42\u548ccontroller\u5c42\u3002 \u8fd9\u4e9b\u5df2\u7ecf\u662f\u5c5e\u4e8e\u540e\u7aef\u4e86\u3002 \u5bf9\u4e8e\u4e00\u4e2a\u9879\u76ee\uff0c\u5b89\u5168\u6027\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\uff0c\u6240\u4ee5springboot\u5f88\u597d\u5730\u4f53\u73b0\u4e86\u8fd9\u4e00\u70b9\u3002 \u6bd4\u5982\uff1a \u60f3\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u5e76\u4e14\u64cd\u4f5c\uff0c\u53ea\u80fd\u901a\u8fc7dao\u5c42\u5411\u6570\u636e\u5e93\u53d1\u9001sql\u8bed\u53e5\uff0c\u5c06\u8fd9\u4e9b\u7ed3\u679c\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9service\u5c42\u3002 \u60f3\u8981\u5904\u7406\u6570\u636e\uff0c\u8981\u5148\u5411dao\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u5bf9dao\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u52a0\u5de5\u5904\u7406\uff0c\u5c06\u8fd9\u4e9b\u5904\u7406\u597d\u7684\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9controller\u5c42\u3002 \u5ba2\u6237\u60f3\u8981\u67e5\u8be2\u6216\u4fee\u6539\u6570\u636e\u65f6\uff0c\u8981\u5148\u5411service\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u6536\u96c6service\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\uff0c\u5c06\u8fd9\u4e9b\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u663e\u793a\u7ed9\u5ba2\u6237\uff0c\u4e00\u822c\u901a\u8fc7html\u7b49\u65b9\u6cd5\u7ed9\u5ba2\u6237\u3002 \u4e0b\u9762\u4f1a\u4e00\u4e00\u8bf4\u660e\u3002 dao\u5c42 \u00b6 dao\u5c42\u4e5f\u53ebmapper\u5c42\uff0c\u6570\u636e\u6301\u4e45\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22mapper\u5c42\u3002 \u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u6301\u4e45\u5316\u64cd\u4f5c\uff0c\u4ed6\u7684\u65b9\u6cd5\u662f\u9488\u5bf9\u6570\u636e\u5e93\u64cd\u4f5c\u7684\uff0c\u57fa\u672c\u7528\u5230\u7684\u5c31\u662f\u589e\u5220\u6539\u67e5\u3002\u5b83\u53ea\u662f\u4e2a\u63a5\u53e3\uff0c\u53ea\u6709\u65b9\u6cd5\u540d\u5b57\uff0c\u5177\u4f53\u5b9e\u73b0\u5728mapper.xml\u4e2d\u3002 \u65e2\u7136mapper\u5c42\u662f\u76f4\u63a5\u4e0e\u6570\u636e\u5e93\u76f8\u6302\u94a9\u7684\uff0c\u6240\u4ee5\u8981\u5148\u8fde\u63a5\u6570\u636e\u5e93\u3002 \u53ef\u4ee5\u5728sqlMapConfig.xml\u6587\u4ef6\u6216\u8005application.properties\u6587\u4ef6\u91cc\u6dfb\u52a0\u6570\u636e\u5e93\u5c5e\u6027\u7b49\uff0c\u5982\u4e0b\u6240\u793a\uff1a sqlMapConfig.xml\u6dfb\u52a0\u5c5e\u6027\uff1a < properties resource = \"/config/db.properties\" > < environments default = \"development\" > < environment id = \"development\" > < transactionManager type = \"JDBC\" /> < dataSource type = \"POOLED\" > < property name = \"driver\" value = \"${jdbc.driver}\" /> < property name = \"url\" value = \"${jdbc.url}\" /> < property name = \"username\" value = \"${jdbc.username}\" /> < property name = \"password\" value = \"${jdbc.password}\" /> \u5728 SqlMapConfig.xml\u5c31\u4e0d\u9700\u8981\u5bf9\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u786c\u7f16\u7801\u3002 application.properties\u6dfb\u52a0\u5c5e\u6027\uff1a \u65b9\u4fbf\u5bf9\u53c2\u6570\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u5176\u4ed6 xml \u53ef\u4ee5\u5e94\u7528\u8be5\u914d\u7f6e\u6587\u4ef6\u3002 \u7136\u540e\u68c0\u67e5\u662f\u5426\u8fde\u4e0a\u6570\u636e\u5e93\uff0c\u8bf7\u770b\u4e0b\u56fe\uff1a \u7136\u540e\u81ea\u5df1\u914d\u7f6e\u6570\u636e\u5e93\u3002 \u6570\u636e\u5e93\u8fde\u63a5\u4e0a\u4e86\uff0c\u5230\u4e86\u4e24\u4e2a\u6587\u4ef6\u7684\u7f16\u5199\uff0c\u6211\u91c7\u7528mybatis\u6846\u67b6\u3002 \u5982\u4f55\u7f16\u5199mapper.xml\uff0c\u5bf9\u6570\u636e\u5e93\u589e\u5220\u6539\u67e5\uff1f \u5728\u5b66\u4e60MyBatis\u6846\u67b6\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53d1\u73b0\u5728idea\u91cc\u9762\u6ca1\u6cd5\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\uff0c\u521b\u5efa\u51fa\u7684xml\u6587\u4ef6\u6ca1\u6709Mapper.xml\u6587\u4ef6\u7684\u57fa\u672c\u683c\u5f0f\uff0c\u4e0b\u9762\u8bf4\u660e\u5982\u4f55\u5728idea\u4e2d\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\u6a21\u677f\u3002 File \u2192 Settings\u2026 \u2192 Editor \u2192 File and Code Templates \u70b9\u51fb\"+\"\u53f7\uff0c\u5e76\u8f93\u5165\u6587\u4ef6\u7684\u540d\u79f0\u548c\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u7f16\u8f91\u597d\u6a21\u677f\u540e\u70b9\u51fbApply\u5373\u53ef\u521b\u5efa\u6210\u529f} mapper.xml\u6587\u4ef6\u6a21\u7248 < mapper namespace = \"\" > \u521b\u5efaGoodsMapper.xml\u6587\u4ef6\u3002 \u7f16\u5199\u5185\u5bb9\uff1a < mapper namespace = \"mapper.GoodsMapper\" > < insert id = \"insertGoods\" parameterType = \"mapper.GoodsMapper\" > insert into Goods ( GNo , GName , GPrice ) values ( # { GNo }, # { GName }, # { GPrice }) < delete id = \"deleteGoods\" parameterType = \"java.String\" > delete from Goods where id = # { id } < update id = \"uodateGoods\" parameterType = \"mapper.GoodsMapper\" > update Goods set GNo = # { GNo }, GName = # { GName }, GPrice = # { GPrice } where id = # { id } < select id = \"findGoods\" parameterType = \"java.String\" resultType = \"mapper.GoodsMapper\" > select * from Goods where id = # { id } \u521b\u5efaGoodsMapper\u7684\u63a5\u53e3\u3002 package mapper ; import pojo.Goods ; public interface GoodsMapper { /** *\u589e\u52a0\u5546\u54c1 * @param goods * @throw Exception */ void insertGoods ( Goods goods ) throws Exception ; /** * \u5220\u9664\u5546\u54c1 * @param GNo * @throw Exception */ void deleteGoods ( String GNo ) throws Exception ; /** * \u4fee\u6539\u5546\u54c1 * @param goods * @throw Exception */ void updateGoods ( Goods goods ) throws Exception ; /** * \u6839\u636eGNo\u67e5\u627e * @return * @throw Exception */ Goods findByGNo ( String GNo ) throws Exception ; } \u4e0d\u9700\u8981\u7f16\u5199\u63a5\u53e3\u5bf9\u5b9e\u73b0\u7c7b\u4e86\uff0c\u53ea\u8981\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u6620\u5c04\u5173\u7cfb\u5bf9\u5e94\u597d\u5c31ok\uff0c\u8fd9\u4e0d\u5728\u672c\u6587\u7684\u8bb2\u8ff0\u8303\u56f4\u5185\u3002 service\u5c42 \u00b6 service\u5c42\u53eb\u4e1a\u52a1\u903b\u8f91\u5c42\uff0c\u5b58\u653e\u4e1a\u52a1\u903b\u8f91\u5904\u7406\uff0c\u4e0d\u76f4\u63a5\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u64cd\u4f5c\uff0c\u6709\u63a5\u53e3\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff0c\u63d0\u4f9bcontroller\u5c42\u8c03\u7528\u7684\u65b9\u6cd5\u3002 \u521b\u5efa\u4e24\u4e2a\u6587\u4ef6\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u7c7b\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsService\u63a5\u53e3\u7c7b\uff1a package service.Goods ; import pojo.Goods ; public interface GoodsService { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsServiceImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package service.Goods ; import mapper.GoodsMapper ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Service ; import pojo.Goods ; @Service public class GoodsServiceImpl implements GoodsService { @Autowired private GoodsMapper goodsMapper ; @Override public void insertGoods ( Goods goods ) throws Exception { goodsMapper . insertGoods ( goods ); } @Override public void deleteGoods ( String GNo ) throws Exception { goodsMapper . deleteGoods ( GNo ); } @Override public void updateGood ( Goods goods ) throws Exception { goodsMapper . updateGoods ( goods ); } @Override public void findByGNo ( String GNo ) throws Exception { goodsMapper . findByGNo ( GNo ); } } \u5c31\u8fd9\u6837\uff0cservice\u5c42\u4e0emapper\u5c42\u5efa\u7acb\u8d77\u4e86\u8054\u7cfb\uff0cservice\u5c42\u53ef\u4ee5\u8c03\u7528mapper\u5c42\u7684\u65b9\u6cd5\u3002 controller\u5c42 \u00b6 controller\u5c42\u53eb\u63a7\u5236\u5668\u5c42\uff0c\u8d1f\u8d23\u524d\u540e\u7aef\u4ea4\u4e92\uff0c\u63a5\u53d7\u524d\u7aef\u8bf7\u6c42\uff0c\u8c03\u7528service\u5c42\uff0c\u63a5\u6536service\u5c42\u8fd4\u56de\u7684\u6570\u636e\uff0c\u6700\u540e\u8fd4\u56de\u5177\u4f53\u7684\u9875\u9762\u548c\u6570\u636e\u5230\u5ba2\u6237\u7aef\u3002 \u540c\u6837\uff0c\u4e5f\u9700\u8981\u4e24\u4e2a\u6587\u4ef6\uff0c\u63a5\u53e3\u7c7b\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsControllerI\u63a5\u53e3\u7c7b\uff1a package Controller.Goods ; import pojo.Goods ; public interface GoodsController { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsControllerImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package Controller.Goods ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Controller ; import org.springframework.web.bind.annotation.RequestMapping ; import pojo.Goods ; import service.Goods.GoodsService ; @Controller public class GoodsControllerImpl { @Autowired private GoodsService goodsService ; @RequestMapping ( value = \"/index\" ) public String insertGoods ( Goods goods ) throws Exception { goodsService . insertGoods ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String deleteGoods ( String GNo ) throws Exception { goodsService . deleteGoods ( GNo ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String updateGoods ( Goods goods ) throws Exception { goodsService . updateGood ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String findByGNo ( String GNo ) throws Exception { Goods goods = new Goods (); goods = goodsService . findByGNo ( GNo ); return \"/index\" ; } } \u8fd9\u6837\uff0c\u5ba2\u6237\u53ef\u4ee5\u901a\u8fc7\u8bf7\u6c42\u7684\u65b9\u5f0f\uff0c\u5c06\u6570\u636e\u4ece\u524d\u7aef\u4f20\u7ed9Controller\u5c42\uff0c\u7136\u540e\u4e00\u5c42\u4e00\u5c42\u4f20\u4e0b\u53bb\uff0c\u5728\u4e00\u5c42\u4e00\u5c42\u5730\u4f20\u4e0a\u6765\uff0c\u5b9e\u73b0\u4e86\u540e\u7aef\u5f00\u53d1\u3002 \u662f\u4e0d\u662f\u53d1\u73b0\u548c\u524d\u7aef\u6ca1\u4ec0\u4e48\u5173\u7cfb\uff1f \u662f\u7684\uff0cspringboot\u8fd8\u6709\u4e00\u4e2a\u4f18\u70b9\u5c31\u662f\u5b9e\u73b0\u4e86\u524d\u540e\u7aef\u5206\u79bb\uff0c\u4ece\u800c\u5de5\u4f5c\u4eba\u5458\u5206\u914d\u4efb\u52a1\u7684\u65f6\u5019\u66f4\u52a0\u5177\u6709\u6761\u7406\u6027\u3002\u800c\u4e09\u5c42\u7684\u67b6\u6784\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5458\u5f88\u5feb\u5730\u77e5\u9053bug\u51fa\u73b0\u5728\u54ea\u91cc\uff0c\u54ea\u4e00\u5c42\uff0c\u54ea\u4e00\u6587\u4ef6\uff0c\u5f88\u5feb\u7684\u4fee\u6539bug\u3002 \u545c\u547c\uff0c\u603b\u800c\u8a00\u4e4b\uff0cspringboot\u4f5c\u4e3aweb\u5f00\u53d1\u7684\u4e00\u4e2a\u4e3b\u6d41\u6846\u67b6\uff0c\u6b63\u5f0f\u56e0\u4e3a\u8fd9\u4e9b\u4f18\u79c0\u70b9\u8ba9\u5b83\u8131\u9896\u800c\u51fa\u3002 \u8fd9\u4e00\u7bc7\u5199\u5f97\u597d\u7d2f\u3002","title":"SpringBoot"},{"location":"cs/pl/java/springboot/#springboot","text":"\u7ea6 1231 \u4e2a\u5b57 196 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u5f53\u521d\u4e3a\u4e86\u505a\u6570\u636e\u5e93\u8bfe\u8bbe\uff0c\u8ba9\u724c\u738b\u82b1\u4e86 1.5h \u6559\u6211 springboot \u5165\u95e8\uff0c\u4e4b\u524d\u5199\u5728 csdn \u4e0a\uff0c\u73b0\u5728\u79fb\u5230 note \u91cc \u9996\u5148\u521b\u5efa\u4e00\u4e2aspringboot\u9879\u76ee\u3002","title":"SpringBoot"},{"location":"cs/pl/java/springboot/#model","text":"model\u5c42\u4e5f\u53ebpojo\u5c42\u6216\u8005entity\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22pojo\u5c42\u3002 \u4e00\u822c\u6570\u636e\u5e93\u7684\u4e00\u5f20\u8868\u5bf9\u5e94\u4e00\u4e2apojo\u5c42\uff0c\u5e76\u4e14\u8868\u4e2d\u6240\u6709\u5b57\u6bb5\u90fd\u5728pojo\u5c42\u90fd\u4e00\u4e00\u5bf9\u5e94\u3002 eg\uff1a\u4e00\u5f20Goods\u8868 \u7136\u540e\u8981\u5148\u5efa\u4e00\u4e2apojo\u7684package\uff0c\u4ee3\u8868\u5b83\u662f\u5b9e\u4f53\u5c42\u3002 \u518d\u5728\u8be5package\u4e0b\u521b\u5efa\u4e00\u4e2aGoods\u7684java\u6587\u4ef6\uff0c\u521b\u5efa\u7684\u5bf9\u8c61\u90fd\u662f\u548c\u8868\u91cc\u5b57\u6bb5\u4e00\u4e00\u5bf9\u5e94\uff0c\u5982\u4e0b\u6240\u793a\uff1a package pojo ; import lombok.* ; @Data public class Goods { /* \u5546\u54c1\u7f16\u53f7 */ private String GNo ; /* \u5546\u54c1\u540d\u79f0 */ private String GName ; /* \u5546\u54c1\u4ef7\u683c */ private Double GPrice ; } \u8fd9\u91cc\u7684lombok\u7684\u4f5c\u7528\u65f6\u4e3a\u4e86\u7b80\u5316\u4ee3\u7801\uff0c\u56e0\u4e3a\u5bf9\u4e8eprivate\u8fd9\u6837\u7684\u5bf9\u8c61\uff0c\u60f3\u8981\u8c03\u7528\u5b83\u7684\u65f6\u5019\uff0c\u9700\u8981get\u548cset\u4e24\u4e2a\u65b9\u6cd5\uff0c\u800c\u6709\u4e86lombok\u4e4b\u540e\u5c31\u53ef\u4ee5\u4e0d\u7528\u5199\uff0c\u76f4\u63a5\u7528\u5373\u53ef\u3002 \u4e0d\u8fc7\u8981\u6dfb\u52a0\u4f9d\u8d56\u548c\u6ce8\u89e3@Data\uff0clombok\u8fd8\u6709\u5f88\u591a\u5176\u4ed6\u7528\u6cd5\uff0c\u4e4b\u540e\u53ef\u80fd\u4f1a\u51fa\u4e00\u7bc7\u535a\u5ba2\u3002 \u901a\u8fc7maven\u4e0b\u8f7d\u4f9d\u8d56\uff1a < dependency > < groupId > org . projectlombok < artifactId > lombok < optional > true \u8fd9\u6837\u6570\u636e\u5e93\u91cc\u7684\u5b57\u6bb5\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u7528\u5bf9\u8c61\u6765\u8868\u793a\u3002 \u4f46\u662fmodel\u4e0d\u5c5e\u4e8espringboot\u7684\u4e09\u5c42\u6846\u67b6\u3002 \u4e3b\u8981\u8bf4\u660e\u662fdao\u5c42\u3001service\u5c42\u548ccontroller\u5c42\u3002 \u8fd9\u4e9b\u5df2\u7ecf\u662f\u5c5e\u4e8e\u540e\u7aef\u4e86\u3002 \u5bf9\u4e8e\u4e00\u4e2a\u9879\u76ee\uff0c\u5b89\u5168\u6027\u662f\u975e\u5e38\u6709\u5fc5\u8981\u7684\uff0c\u6240\u4ee5springboot\u5f88\u597d\u5730\u4f53\u73b0\u4e86\u8fd9\u4e00\u70b9\u3002 \u6bd4\u5982\uff1a \u60f3\u8981\u8bbf\u95ee\u6570\u636e\u5e93\u5e76\u4e14\u64cd\u4f5c\uff0c\u53ea\u80fd\u901a\u8fc7dao\u5c42\u5411\u6570\u636e\u5e93\u53d1\u9001sql\u8bed\u53e5\uff0c\u5c06\u8fd9\u4e9b\u7ed3\u679c\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9service\u5c42\u3002 \u60f3\u8981\u5904\u7406\u6570\u636e\uff0c\u8981\u5148\u5411dao\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u5bf9dao\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\u8fdb\u884c\u52a0\u5de5\u5904\u7406\uff0c\u5c06\u8fd9\u4e9b\u5904\u7406\u597d\u7684\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u4f20\u7ed9controller\u5c42\u3002 \u5ba2\u6237\u60f3\u8981\u67e5\u8be2\u6216\u4fee\u6539\u6570\u636e\u65f6\uff0c\u8981\u5148\u5411service\u5c42\u8bf7\u6c42\u6570\u636e\uff0c\u6536\u96c6service\u5c42\u4f20\u8fc7\u6765\u7684\u6570\u636e\uff0c\u5c06\u8fd9\u4e9b\u6570\u636e\u901a\u8fc7\u63a5\u53e3\u663e\u793a\u7ed9\u5ba2\u6237\uff0c\u4e00\u822c\u901a\u8fc7html\u7b49\u65b9\u6cd5\u7ed9\u5ba2\u6237\u3002 \u4e0b\u9762\u4f1a\u4e00\u4e00\u8bf4\u660e\u3002","title":"model\u5c42"},{"location":"cs/pl/java/springboot/#dao","text":"dao\u5c42\u4e5f\u53ebmapper\u5c42\uff0c\u6570\u636e\u6301\u4e45\u5c42\uff0c\u4e2a\u4eba\u6bd4\u8f83\u559c\u6b22mapper\u5c42\u3002 \u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u6301\u4e45\u5316\u64cd\u4f5c\uff0c\u4ed6\u7684\u65b9\u6cd5\u662f\u9488\u5bf9\u6570\u636e\u5e93\u64cd\u4f5c\u7684\uff0c\u57fa\u672c\u7528\u5230\u7684\u5c31\u662f\u589e\u5220\u6539\u67e5\u3002\u5b83\u53ea\u662f\u4e2a\u63a5\u53e3\uff0c\u53ea\u6709\u65b9\u6cd5\u540d\u5b57\uff0c\u5177\u4f53\u5b9e\u73b0\u5728mapper.xml\u4e2d\u3002 \u65e2\u7136mapper\u5c42\u662f\u76f4\u63a5\u4e0e\u6570\u636e\u5e93\u76f8\u6302\u94a9\u7684\uff0c\u6240\u4ee5\u8981\u5148\u8fde\u63a5\u6570\u636e\u5e93\u3002 \u53ef\u4ee5\u5728sqlMapConfig.xml\u6587\u4ef6\u6216\u8005application.properties\u6587\u4ef6\u91cc\u6dfb\u52a0\u6570\u636e\u5e93\u5c5e\u6027\u7b49\uff0c\u5982\u4e0b\u6240\u793a\uff1a sqlMapConfig.xml\u6dfb\u52a0\u5c5e\u6027\uff1a < properties resource = \"/config/db.properties\" > < environments default = \"development\" > < environment id = \"development\" > < transactionManager type = \"JDBC\" /> < dataSource type = \"POOLED\" > < property name = \"driver\" value = \"${jdbc.driver}\" /> < property name = \"url\" value = \"${jdbc.url}\" /> < property name = \"username\" value = \"${jdbc.username}\" /> < property name = \"password\" value = \"${jdbc.password}\" /> \u5728 SqlMapConfig.xml\u5c31\u4e0d\u9700\u8981\u5bf9\u6570\u636e\u5e93\u8fde\u63a5\u53c2\u6570\u786c\u7f16\u7801\u3002 application.properties\u6dfb\u52a0\u5c5e\u6027\uff1a \u65b9\u4fbf\u5bf9\u53c2\u6570\u8fdb\u884c\u7edf\u4e00\u7ba1\u7406\uff0c\u5176\u4ed6 xml \u53ef\u4ee5\u5e94\u7528\u8be5\u914d\u7f6e\u6587\u4ef6\u3002 \u7136\u540e\u68c0\u67e5\u662f\u5426\u8fde\u4e0a\u6570\u636e\u5e93\uff0c\u8bf7\u770b\u4e0b\u56fe\uff1a \u7136\u540e\u81ea\u5df1\u914d\u7f6e\u6570\u636e\u5e93\u3002 \u6570\u636e\u5e93\u8fde\u63a5\u4e0a\u4e86\uff0c\u5230\u4e86\u4e24\u4e2a\u6587\u4ef6\u7684\u7f16\u5199\uff0c\u6211\u91c7\u7528mybatis\u6846\u67b6\u3002 \u5982\u4f55\u7f16\u5199mapper.xml\uff0c\u5bf9\u6570\u636e\u5e93\u589e\u5220\u6539\u67e5\uff1f \u5728\u5b66\u4e60MyBatis\u6846\u67b6\u7684\u8fc7\u7a0b\u4e2d\uff0c\u53d1\u73b0\u5728idea\u91cc\u9762\u6ca1\u6cd5\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\uff0c\u521b\u5efa\u51fa\u7684xml\u6587\u4ef6\u6ca1\u6709Mapper.xml\u6587\u4ef6\u7684\u57fa\u672c\u683c\u5f0f\uff0c\u4e0b\u9762\u8bf4\u660e\u5982\u4f55\u5728idea\u4e2d\u521b\u5efaMapper.xml\u6620\u5c04\u6587\u4ef6\u6a21\u677f\u3002 File \u2192 Settings\u2026 \u2192 Editor \u2192 File and Code Templates \u70b9\u51fb\"+\"\u53f7\uff0c\u5e76\u8f93\u5165\u6587\u4ef6\u7684\u540d\u79f0\u548c\u6587\u4ef6\u7684\u7c7b\u578b\uff0c\u7f16\u8f91\u597d\u6a21\u677f\u540e\u70b9\u51fbApply\u5373\u53ef\u521b\u5efa\u6210\u529f} mapper.xml\u6587\u4ef6\u6a21\u7248 < mapper namespace = \"\" > \u521b\u5efaGoodsMapper.xml\u6587\u4ef6\u3002 \u7f16\u5199\u5185\u5bb9\uff1a < mapper namespace = \"mapper.GoodsMapper\" > < insert id = \"insertGoods\" parameterType = \"mapper.GoodsMapper\" > insert into Goods ( GNo , GName , GPrice ) values ( # { GNo }, # { GName }, # { GPrice }) < delete id = \"deleteGoods\" parameterType = \"java.String\" > delete from Goods where id = # { id } < update id = \"uodateGoods\" parameterType = \"mapper.GoodsMapper\" > update Goods set GNo = # { GNo }, GName = # { GName }, GPrice = # { GPrice } where id = # { id } < select id = \"findGoods\" parameterType = \"java.String\" resultType = \"mapper.GoodsMapper\" > select * from Goods where id = # { id } \u521b\u5efaGoodsMapper\u7684\u63a5\u53e3\u3002 package mapper ; import pojo.Goods ; public interface GoodsMapper { /** *\u589e\u52a0\u5546\u54c1 * @param goods * @throw Exception */ void insertGoods ( Goods goods ) throws Exception ; /** * \u5220\u9664\u5546\u54c1 * @param GNo * @throw Exception */ void deleteGoods ( String GNo ) throws Exception ; /** * \u4fee\u6539\u5546\u54c1 * @param goods * @throw Exception */ void updateGoods ( Goods goods ) throws Exception ; /** * \u6839\u636eGNo\u67e5\u627e * @return * @throw Exception */ Goods findByGNo ( String GNo ) throws Exception ; } \u4e0d\u9700\u8981\u7f16\u5199\u63a5\u53e3\u5bf9\u5b9e\u73b0\u7c7b\u4e86\uff0c\u53ea\u8981\u8fd9\u4e24\u4e2a\u6587\u4ef6\u7684\u6620\u5c04\u5173\u7cfb\u5bf9\u5e94\u597d\u5c31ok\uff0c\u8fd9\u4e0d\u5728\u672c\u6587\u7684\u8bb2\u8ff0\u8303\u56f4\u5185\u3002","title":"dao\u5c42"},{"location":"cs/pl/java/springboot/#service","text":"service\u5c42\u53eb\u4e1a\u52a1\u903b\u8f91\u5c42\uff0c\u5b58\u653e\u4e1a\u52a1\u903b\u8f91\u5904\u7406\uff0c\u4e0d\u76f4\u63a5\u5bf9\u6570\u636e\u5e93\u8fdb\u884c\u64cd\u4f5c\uff0c\u6709\u63a5\u53e3\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff0c\u63d0\u4f9bcontroller\u5c42\u8c03\u7528\u7684\u65b9\u6cd5\u3002 \u521b\u5efa\u4e24\u4e2a\u6587\u4ef6\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u7c7b\uff0c\u4e00\u4e2a\u5b58\u653e\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsService\u63a5\u53e3\u7c7b\uff1a package service.Goods ; import pojo.Goods ; public interface GoodsService { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsServiceImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package service.Goods ; import mapper.GoodsMapper ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Service ; import pojo.Goods ; @Service public class GoodsServiceImpl implements GoodsService { @Autowired private GoodsMapper goodsMapper ; @Override public void insertGoods ( Goods goods ) throws Exception { goodsMapper . insertGoods ( goods ); } @Override public void deleteGoods ( String GNo ) throws Exception { goodsMapper . deleteGoods ( GNo ); } @Override public void updateGood ( Goods goods ) throws Exception { goodsMapper . updateGoods ( goods ); } @Override public void findByGNo ( String GNo ) throws Exception { goodsMapper . findByGNo ( GNo ); } } \u5c31\u8fd9\u6837\uff0cservice\u5c42\u4e0emapper\u5c42\u5efa\u7acb\u8d77\u4e86\u8054\u7cfb\uff0cservice\u5c42\u53ef\u4ee5\u8c03\u7528mapper\u5c42\u7684\u65b9\u6cd5\u3002","title":"service\u5c42"},{"location":"cs/pl/java/springboot/#controller","text":"controller\u5c42\u53eb\u63a7\u5236\u5668\u5c42\uff0c\u8d1f\u8d23\u524d\u540e\u7aef\u4ea4\u4e92\uff0c\u63a5\u53d7\u524d\u7aef\u8bf7\u6c42\uff0c\u8c03\u7528service\u5c42\uff0c\u63a5\u6536service\u5c42\u8fd4\u56de\u7684\u6570\u636e\uff0c\u6700\u540e\u8fd4\u56de\u5177\u4f53\u7684\u9875\u9762\u548c\u6570\u636e\u5230\u5ba2\u6237\u7aef\u3002 \u540c\u6837\uff0c\u4e5f\u9700\u8981\u4e24\u4e2a\u6587\u4ef6\uff0c\u63a5\u53e3\u7c7b\u548c\u63a5\u53e3\u5b9e\u73b0\u7c7b\u3002 GoodsControllerI\u63a5\u53e3\u7c7b\uff1a package Controller.Goods ; import pojo.Goods ; public interface GoodsController { void insertGoods ( Goods goods ) throws Exception ; void deleteGoods ( String GNo ) throws Exception ; void updateGood ( Goods goods ) throws Exception ; void findByGNo ( String GNo ) throws Exception ; } GoodsControllerImpl\u63a5\u53e3\u5b9e\u73b0\u7c7b\uff1a package Controller.Goods ; import org.springframework.beans.factory.annotation.Autowired ; import org.springframework.stereotype.Controller ; import org.springframework.web.bind.annotation.RequestMapping ; import pojo.Goods ; import service.Goods.GoodsService ; @Controller public class GoodsControllerImpl { @Autowired private GoodsService goodsService ; @RequestMapping ( value = \"/index\" ) public String insertGoods ( Goods goods ) throws Exception { goodsService . insertGoods ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String deleteGoods ( String GNo ) throws Exception { goodsService . deleteGoods ( GNo ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String updateGoods ( Goods goods ) throws Exception { goodsService . updateGood ( goods ); return \"/index\" ; } @RequestMapping ( value = \"/index\" ) public String findByGNo ( String GNo ) throws Exception { Goods goods = new Goods (); goods = goodsService . findByGNo ( GNo ); return \"/index\" ; } } \u8fd9\u6837\uff0c\u5ba2\u6237\u53ef\u4ee5\u901a\u8fc7\u8bf7\u6c42\u7684\u65b9\u5f0f\uff0c\u5c06\u6570\u636e\u4ece\u524d\u7aef\u4f20\u7ed9Controller\u5c42\uff0c\u7136\u540e\u4e00\u5c42\u4e00\u5c42\u4f20\u4e0b\u53bb\uff0c\u5728\u4e00\u5c42\u4e00\u5c42\u5730\u4f20\u4e0a\u6765\uff0c\u5b9e\u73b0\u4e86\u540e\u7aef\u5f00\u53d1\u3002 \u662f\u4e0d\u662f\u53d1\u73b0\u548c\u524d\u7aef\u6ca1\u4ec0\u4e48\u5173\u7cfb\uff1f \u662f\u7684\uff0cspringboot\u8fd8\u6709\u4e00\u4e2a\u4f18\u70b9\u5c31\u662f\u5b9e\u73b0\u4e86\u524d\u540e\u7aef\u5206\u79bb\uff0c\u4ece\u800c\u5de5\u4f5c\u4eba\u5458\u5206\u914d\u4efb\u52a1\u7684\u65f6\u5019\u66f4\u52a0\u5177\u6709\u6761\u7406\u6027\u3002\u800c\u4e09\u5c42\u7684\u67b6\u6784\u53ef\u4ee5\u8ba9\u7a0b\u5e8f\u5458\u5f88\u5feb\u5730\u77e5\u9053bug\u51fa\u73b0\u5728\u54ea\u91cc\uff0c\u54ea\u4e00\u5c42\uff0c\u54ea\u4e00\u6587\u4ef6\uff0c\u5f88\u5feb\u7684\u4fee\u6539bug\u3002 \u545c\u547c\uff0c\u603b\u800c\u8a00\u4e4b\uff0cspringboot\u4f5c\u4e3aweb\u5f00\u53d1\u7684\u4e00\u4e2a\u4e3b\u6d41\u6846\u67b6\uff0c\u6b63\u5f0f\u56e0\u4e3a\u8fd9\u4e9b\u4f18\u79c0\u70b9\u8ba9\u5b83\u8131\u9896\u800c\u51fa\u3002 \u8fd9\u4e00\u7bc7\u5199\u5f97\u597d\u7d2f\u3002","title":"controller\u5c42"},{"location":"cs/pl/python/","text":"Python \u00b6 Abstract \u559c\u7231\u7a0b\u5ea6\u4ec5\u6b64\u4e8eC++\uff0c\u4f46\u5bf9\u6211\u6765\u8bf4\u662f\u76f8\u5bf9\u8584\u5f31\u7684\u8bed\u8a00 \u65e5\u5e38\u4e2d\u4f7f\u7528\u811a\u672c\u8f83\u591a\uff0c\u5b66\u672f\u4e0a\u673a\u5668\u5b66\u4e60/\u6df1\u5ea6\u5b66\u4e60\u65b9\u9762\u4f7f\u7528\u8f83\u591a Table of Contents \u00b6 Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883","title":"Python"},{"location":"cs/pl/python/#python","text":"Abstract \u559c\u7231\u7a0b\u5ea6\u4ec5\u6b64\u4e8eC++\uff0c\u4f46\u5bf9\u6211\u6765\u8bf4\u662f\u76f8\u5bf9\u8584\u5f31\u7684\u8bed\u8a00 \u65e5\u5e38\u4e2d\u4f7f\u7528\u811a\u672c\u8f83\u591a\uff0c\u5b66\u672f\u4e0a\u673a\u5668\u5b66\u4e60/\u6df1\u5ea6\u5b66\u4e60\u65b9\u9762\u4f7f\u7528\u8f83\u591a","title":"Python"},{"location":"cs/pl/python/#table-of-contents","text":"Python \u8bed\u6cd5\u57fa\u7840 Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 Python \u865a\u62df\u73af\u5883","title":"Table of Contents"},{"location":"cs/pl/python/basic/","text":"Python \u8bed\u6cd5\u57fa\u7840 \u00b6 Abstract copy from TonyCrane/note \u4ec0\u4e48\u662f python \u00b6 \u89e3\u91ca\u6027\u7684\u811a\u672c\u8bed\u8a00\uff1a\u901a\u8fc7\u89e3\u91ca\u5668\u6765\u76f4\u63a5\u8fd0\u884c\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\u94fe\u63a5\u6210\u4e8c\u8fdb\u5236\u6587\u4ef6 \u52a8\u6001\u7c7b\u578b\u8bed\u8a00\uff1a\u7c7b\u578b\u5728\u8fd0\u884c\u65f6\u786e\u5b9a\uff0c\u4e0d\u9700\u8981\u901a\u8fc7\u4ee3\u7801\u660e\u6587\u89c4\u5b9a \u9762\u5411\u5bf9\u8c61\u8bed\u8a00\uff1apython \u4e2d\u4e00\u5207\u7686\u5bf9\u8c61 ... \u600e\u4e48\u88c5 python \u00b6 \u88c5\u7684\u662f\u4ec0\u4e48\uff1f \u662f\u4e00\u4e2a python \u89e3\u91ca\u5668\uff0c\u4ee5\u53ca\u8fd0\u884c\u9700\u8981\u7684\u73af\u5883 \u600e\u4e48\u88c5\uff1f \u5b98\u65b9\u7f51\u7ad9 https://www.python.org/downloads/ conda\uff08\u4e00\u4e2a\u597d\u7528\u7684 python \u73af\u5883\u7ba1\u7406\u5de5\u5177\uff09 anaconda \uff08\u5927\u3001\u6709\u9884\u88c5\u73af\u5883\uff09 https://www.anaconda.com/ miniconda \uff08\u5c0f\uff09 https://docs.conda.io/en/latest/miniconda \u6781\u4e0d\u5efa\u8bae\u901a\u8fc7\u5fae\u8f6f\u5e94\u7528\u5546\u5e97\u5b89\u88c5 python \u88c5\u4ec0\u4e48\u7248\u672c\uff1f \u4e24\u4e2a\u5927\u7248\u672c\uff0c2.* \u548c 3.*\uff0c\u5dee\u522b\u8f83\u5927\uff0c\u5efa\u8bae 3.* \u4e00\u4e9b\u5c0f\u7248\u672c\uff0c3.6 \u53ca\u4e4b\u524d\u4e0d\u63a8\u8350\uff0c3.7 3.8 \u7a33\u5b9a\uff0c3.9 3.10 \u5b8c\u5584\u4e2d\uff0c3.11 \u9884\u89c8\u4e2d \u7ec6\u5206\u7248\u672c\uff0c\u9009\u62e9\u6700\u65b0\uff0c3.7.13\u30013.8.13\u30013.9.12\u30013.10.4 conda \u4e0d\u5fc5\u62c5\u5fc3\u7248\u672c\uff0c\u9ed8\u8ba4 3.9\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u4f7f\u7528\u4e0d\u540c\u7248\u672c \u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c python \u00b6 \u600e\u4e48\u7528 python\uff1f \u8bb0\u4f4f\u4f60\u4e0b\u8f7d\u7684\u662f\u4e00\u4e2a\u89e3\u91ca\u5668\uff0c\u5efa\u8bae\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c python code.py \u4ec0\u4e48\u662f\u547d\u4ee4\u884c\uff1f \u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u901a\u77e5\u7535\u8111\u6267\u884c\u67d0\u6307\u4ee4\u3001\u6216\u8005\u8fd0\u884c\u67d0\u7a0b\u5e8f Windows\uff1acmd\u3001Powershell -> \u5355\u72ec\u8fd0\u884c / Windows Terminal /... macOS\uff1azsh\u3001... -> \u7ec8\u7aef / iTerm /... Linux\uff1abash\u3001zsh\u3001... -> \u7ec8\u7aef / ... \u7528\u4ec0\u4e48\u5199\u4ee3\u7801\uff1f \u8bb0\u4f4f\u4f60\u7f16\u5199\u7684\u53ea\u662f\u4e00\u4e2a .py \u4f5c\u4e3a\u6269\u5c55\u540d\u7684\u6587\u672c\u6587\u4ef6 \u53ea\u8981\u6587\u672c\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u5199 \u8bb0\u4e8b\u672c\u3001\u81ea\u5e26 IDLE\u3001word Notepad++\u3001Sublime Text VSCode\uff08Visual Studio Code\uff0c\u4e0d\u662f VS\uff09code.visualstudio.com Pycharm\uff08Community Edition \u5c31\u591f\u7528\uff09jetbrains.com/pycharm \u6570\u636e\u7c7b\u578b \u00b6 \u6570\u5b57\u4e0e\u8fd0\u7b97 \u00b6 \u6574\u578bint\uff0c\u6d6e\u70b9\u578bfloat\uff0c\u590d\u6570complex\uff08c.real\u8868\u793a\u5b9e\u90e8\uff0cc.imag\u8868\u793a\u865a\u90e8\uff0cc.conjugate()\u8fd4\u56de\u5171\u8f6d\u590d\u6570\uff09 \u6574\u6570\u4e0e\u6d6e\u70b9\u6570\u8f6c\u6362 int(...)\uff1a\u54110\u820d\u5165 round(...)\uff1a\u5411\u5076\u820d\u5165\uff08\u56db\u820d\u516d\u5165\u4e94\u51d1\u5076\uff0c\u53ef\u4ee5\u5f53\u6210\u56db\u820d\u4e94\u5165\uff09 math.floor(...)\u3001math.ceil(...)\uff1a\u4e0b\u53d6\u6574\u3001\u4e0a\u53d6\u6574\uff08\u9700\u8981 import math\uff09 \u8fd0\u7b97 \u5bf9\u4e8e+ - *\u52a0\u51cf\u4e58\uff0c\u5982\u679c\u90fd\u662f\u6574\u6570\uff0c\u90a3\u7ed3\u679c\u4e5f\u662f\u6574\u6570\uff0c\u5b58\u5728\u6d6e\u70b9\u6570\uff0c\u5219\u7ed3\u679c\u662f\u6d6e\u70b9\u6570 \u5bf9\u4e8e/\u9664\uff0c\u7ed3\u679c\u662f\u6d6e\u70b9\u6570\uff0c\u5bf9\u4e8e//\uff0c\u7ed3\u679c\u662f\u6574\u6570\uff08\u5411\u4e0b\u53d6\u6574\uff09 \u5bf9\u4e8e%\u53d6\u6a21\uff0c a%b == a-(a//b)*b \u5bf9\u4e8e**\u4e58\u65b9\uff0c\u53ef\u4ee5\u662fa ** 0.5\uff0c\u6216 a ** 2 \u5bf9\u4e8e pow(a,b,mod) \u4e58\u65b9\uff0cmod\u53ef\u7701\u7565\uff0c\u5982\u679cmod\u4e3a-1\u5373\u4e3a\u4e58\u6cd5\u9006\u5143 \u66f4\u591a\u8fd0\u7b97\u901a\u8fc7 math\u3001numpy\u3001scipy \u7b49\u5305\u6765\u8fdb\u884c \u5b57\u7b26\u4e32 \u00b6 Python \u4e0d\u652f\u6301\u5355\u5b57\u7b26\u7c7b\u578b\uff0c\u5355\u5b57\u7b26\u5728 Python \u4e2d\u4e5f\u662f\u4f5c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f7f\u7528\u3002 \u5355\u5f15\u53f7 '...'\uff0c\u53cc\u5f15\u53f7 \"...\"\uff0c\u4e09\u5f15\u53f7 '''...''' \"\"\"...\"\"\"\uff08\u53ef\u4ee5\u5185\u90e8\u6362\u884c\uff09 \u4e09\u5f15\u53f7 str = \"\"\"\"\"\" \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( \\ t ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ \\ n ] \u3002 \"\"\" print(str) \u8f93\u51fa\u4e3a\uff1a \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ ] \u3002 \u524d\u7f00 r-string\uff1ar\"...\"\uff0c\u5f15\u53f7\u4e2d\u4e0d\u8fdb\u884c\u8f6c\u4e49\uff0c\u5373\u4e00\u4e2a/\u5c31\u4ee3\u8868\u659c\u6760\u5b57\u7b26\u672c\u8eab f-string\uff1af\"...\"\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32 b-string\uff1ab\"...\"\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a bytes\uff0c\u53ea\u80fd\u5305\u542b ASCII \u5b57\u7b26 \u5e38\u7528\u65b9\u6cd5 \u62fc\u63a5\uff1a\u76f4\u63a5\u5c06\u5b57\u7b26\u4e32\u201c\u76f8\u52a0\u201d \"...\".upper()\u3001\"...\".lower() \uff1a\u8f6c\u4e3a\u5168\u5927\u5199\u3001\u5168\u5c0f\u5199 \"...\".title() \uff1a\u5355\u8bcd\u9996\u5b57\u6bcd\u5927\u5199 \"...\".count(str) \uff1a\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2dstr\u51fa\u73b0\u7684\u6b21\u6570 \"...\".strip() \uff1a\u5220\u9664\u5b57\u7b26\u4e32\u9996\u5c3e\u7a7a\u767d\uff08\u5305\u542b\u7a7a\u683c\u548c\u5236\u8868\u7b26\uff09 \"...\".lstrip()\u3001\"...\".rstrip() \uff1a\u5220\u9664\u5de6\u3001\u53f3\u7aef\u7a7a\u767d\u6216\u6307\u5b9a\u5b57\u7b26 \"...\".replace(old, new) \uff1a\u5b57\u7b26\u4e32\u4e2d old \u66ff\u6362\u6210 new \"...\".split(c) \uff1a\u6839\u636e\u5b57\u7b26 c \u6765\u62c6\u5206\u5b57\u7b26\u4e32\u5f97\u5230\u5217\u8868\uff0c\u9ed8\u8ba4\u62c6\u5206\u7a7a\u767d f-string \u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u65b9\u5f0f\uff1a\"...\" % ...\uff0c\"...\".format(...)\uff0cf\"...\" f-string\u7528\u5927\u62ec{ }\u8868\u793a\u88ab\u66ff\u6362\u5b57\u6bb5\uff0c\u5176\u4e2d\u76f4\u63a5\u586b\u5165\u66ff\u6362\u5185\u5bb9\u5373\u53ef f-string\u7684\u5927\u62ec\u53f7{ }\u53ef\u4ee5\u586b\u5165\u8868\u8fbe\u5f0f\u6216\u8c03\u7528\u51fd\u6570\uff0cPython\u4f1a\u6c42\u51fa\u5176\u7ed3\u679c\u5e76\u586b\u5165\u8fd4\u56de\u7684\u5b57\u7b26\u4e32\u5185 f-string\u4e2d\u4f7f\u7528lambda\u533f\u540d\u51fd\u6570\uff1a\u53ef\u4ee5\u505a\u590d\u6742\u7684\u6570\u503c\u8ba1\u7b97 f-string\u5927\u62ec\u53f7\u5185\u4f7f\u7528\u7684\u5f15\u53f7\u4e0d\u80fd\u548c\u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u5b9a\u754c\u7b26\u5f15\u53f7\u51b2\u7a81\uff0c\u9700\u6839\u636e\u60c5\u51b5\u7075\u6d3b\u5207\u6362\u4f7f\u7528\u5355\u5f15\u53f7\u3001\u53cc\u5f15\u53f7\u3001\u5355\u4e09\u5f15\u53f7\u3001\u53cc\u4e09\u5f15\u53f7 \u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u8fd8\u53ef\u4ee5\u4f7f\u7528\\\u8f6c\u4e49\uff0c\u4f46\u5927\u62ec\u53f7\u5185\u4e0d\u80fd\u4f7f\u7528\\\u8f6c\u4e49 f-string\u5927\u62ec\u53f7\u5916\u5982\u679c\u9700\u8981\u663e\u793a\u5927\u62ec\u53f7\uff0c\u5219\u5e94\u8f93\u5165\u8fde\u7eed\u4e24\u4e2a\u5927\u62ec\u53f7{{ }}\uff1b\u5927\u62ec\u53f7\u5185\u9700\u8981\u5f15\u53f7\uff0c\u4f7f\u7528\u5f15\u53f7\u5373\u53ef f-string\u9488\u5bf9date\u3001datetime\u548ctime\u5bf9\u8c61\uff0c\u8fdb\u884c\u5e74\u6708\u65e5\u3001\u65f6\u5206\u79d2\u7b49\u4fe1\u606f\u63d0\u53d6 \u5bbd\u5ea6\u586b\u5145\uff1a:[ \u586b\u5145\u5b57\u7b26 ][ \u5bf9\u9f50\u65b9\u5f0f ][ \u5bbd\u5ea6 ]\uff0c< \u5de6\u5bf9\u9f50\uff0c> \u53f3\u5bf9\u9f50\uff0c^ \u5c45\u4e2d \u5b57\u7b26\u622a\u65ad\uff1a:[...].n\uff0c\u53ea\u663e\u793a\u5b57\u7b26\u4e32\u7684\u524d n \u4e2a\u5b57\u7b26 \u6570\u503c\u7b26\u53f7\uff1a:+ \u6b63\u6570\u52a0\u6b63\u53f7\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7\uff0c:- \u539f\u6837\uff0c: \uff08\u7a7a\u683c\uff09\u6b63\u6570\u52a0\u7a7a\u683c\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7 \u6570\u503c\u7cbe\u5ea6\uff1a:[ \u5bbd\u5ea6 ][ \u5206\u9694\u7b26 (,_)].[ \u7cbe\u5ea6 ]f\uff0c\u6ca1\u6709\u7cbe\u5ea6\u9ed8\u8ba4\u4e3a 6 \u8fdb\u5236\u663e\u793a\uff1ax \u5c0f\u5199\u5341\u516d\u8fdb\u5236\uff0cX \u5927\u5199\u5341\u516d\u8fdb\u5236\uff0co \u516b\u8fdb\u5236\uff0cb \u4e8c\u8fdb\u5236\uff0c\u52a0 # \u663e\u793a\u524d\u7f00 \u5b57\u8282\u7c7b\u578b \u00b6 \u7c7b\u4f3c\u5b57\u7b26\u4e32\uff0c\u4f46\u5b58\u50a8\u7684\u662f\u5b57\u8282\u7684\u503c\uff0c\u66f4\u50cf\u5217\u8868\uff0c\u663e\u793a\u4e3a b\"...\"\uff0c\u901a\u5e38\u7528\u4e8e\u7f51\u7edc\u6570\u636e\u4f20\u8f93\u3001\u4e8c\u8fdb\u5236\u56fe\u7247\u548c\u6587\u4ef6\u7684\u4fdd\u5b58\u7b49 \u901a\u8fc7bytes()\u751f\u6210bytes\u5b9e\u4f8b\uff0c\u503c\u7684\u5f62\u5f0f\u4e3ab\"...\"\uff0c\u7528\u4e0d\u540c\u7684\u7f16\u7801\u65b9\u5f0f\u4f1a\u5f62\u6210\u4e0d\u540c\u7684\u503c \u4e0e\u5b57\u7b26\u4e32\u8f6c\u6362 \"...\".encode(encoding) \u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4 UTF-8 bytes_obj.decode(encoding) \u6839\u636e encoding \u89e3\u7801\u5b57\u8282\u5e8f\u5217\uff0c\u89e3\u7801\u5931\u8d25\u4f1a\u62a5\u9519 bytes(\"...\", encoding) \u4e5f\u662f\u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32 \u5e03\u5c14\u7c7b\u578b \u00b6 True \u548c False\uff0c \u9996\u5b57\u6bcd\u5927\u5199 \u53ef\u4ee5\u7528bool(...)\u6765\u8f6c\u6362 \u53ef\u4ee5\u7528 & | \u6765\u8868\u793a\u4e0e\u548c\u6216\uff0c\u4e00\u822c\u4f7f\u7528and or not \u8fdb\u884c\u8fd0\u7b97\uff08\u53ef\u7ec4\u5408\uff09 \u5217\u8868 \u00b6 \u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u7684\u6570\u7ec4\uff0c\u4f46\u662f\u529f\u80fd\u66f4\u591a\uff0c\u800c\u4e14\u5185\u90e8\u5143\u7d20\u4e0d\u8981\u6c42\u540c\u4e00\u7c7b\u578b \u65b9\u62ec\u53f7 [] \u8868\u793a\u5217\u8868\uff0c\u5143\u7d20\u7528\u9017\u53f7\u5206\u9694 \u7d22\u5f15\uff08\u5373\u4e0b\u6807\uff09\u4ece 0 \u5f00\u59cb\u8ba1\u6570\uff0clst[n] \u5373\u8868\u793a\u8bbf\u95ee\u7b2c n+1 \u4e2a\u5143\u7d20 \u7d22\u5f15\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u8d1f\u6570\u5373\u8868\u793a\u5012\u6570\uff0c\u4f8b lst[-2] \u8868\u793a\u5012\u6570\u7b2c\u4e8c\u4e2a\u5143\u7d20 \u5207\u7247\uff08\u83b7\u53d6\u5217\u8868\u4e2d\u7684\u4e00\u90e8\u5206\u503c\uff09 lst[a:b]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u7684\u5217\u8868 lst[:b]\uff1a\u4ece\u5f00\u5934\u5230 lst[b-1] \u7684\u5217\u8868 lst[a:]\uff1a\u4ece lst[a] \u5230\u7ed3\u5c3e\u7684\u5217\u8868 lst[:]\uff1a\u8868\u793a\u6574\u4e2a\u5217\u8868\uff08\u62f7\u8d1d\u4e00\u4efd\uff09 lst[a:b:c]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u6bcf c \u4e2a\uff08\u5373\u6b65\u957f\uff09\u53d6\u4e00\u4e2a\u5f62\u6210\u7684\u5217\u8868 c \u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u6b64\u65f6\u9700\u8981 a > b \u624d\u80fd\u83b7\u53d6\u5230\u503c \u6709\u6b65\u957f\u65f6\u82e5\u7701\u7565 a\u3001b \u8bb0\u5f97\u4e0d\u8981\u7701\u7565\u5192\u53f7\uff0c\u4f8b lst[::-1] \u8868\u793a\u5217\u8868\u5012\u5e8f \u5217\u8868\u64cd\u4f5c \u00b6 \u4fee\u6539\u5143\u7d20\uff1a\u76f4\u63a5\u901a\u8fc7\u7d22\u5f15/\u5207\u7247\uff0c\u7136\u540e\u7b49\u53f7\u8d4b\u503c \u6709\u6808\u7684\u529f\u80fd lst.append(...) \u5728\u5217\u8868\u672b\u5c3e\u52a0\u5165\u5143\u7d20 lst.pop() \u5f39\u51fa\u5217\u8868\u672b\u5c3e\u5143\u7d20\u5e76\u8fd4\u56de \u4efb\u610f\u4f4d\u7f6e\u63d2\u5165\u5f39\u51fa lst.insert(i, x) \u5728\u7d22\u5f15 i \u7684\u4f4d\u7f6e\u63d2\u5165 x\uff0c\u540e\u9762\u4f9d\u6b21\u540e\u79fb lst.pop(i) \u5f39\u51fa\u7d22\u5f15 i \u4f4d\u7f6e\u7684\u5143\u7d20\uff0c\u540e\u9762\u4f9d\u6b21\u524d\u79fb \u5217\u8868\u62fc\u63a5 \u76f4\u63a5\u76f8\u52a0\uff0c\u4e0d\u6539\u53d8\u539f\u5217\u8868\uff0c\u5f97\u5230\u65b0\u7684\u5217\u8868 lst.extend([...])\uff0c\u628a\u4e00\u4e2a\u5217\u8868\u63a5\u5230\u5f53\u524d\u5217\u8868\u540e\u9762 \u6839\u636e\u503c\u5220\u9664\u5143\u7d20 lst.remove(value) \u5220\u9664\u7b2c\u4e00\u4e2a\u503c\u4e3a value \u7684\u5143\u7d20 \u6392\u5e8f\u5217\u8868 lst.sort() \u6c38\u4e45\u6392\u5e8f\uff08\u5373\u6392\u5e8f\u540e\u8d4b\u503c\u7ed9\u5f53\u524d\u5217\u8868\uff09 sorted(lst) \u4e34\u65f6\u6392\u5e8f\uff0c\u8fd4\u56de\u6392\u5e8f\u597d\u7684\u65b0\u5217\u8868 \u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927\uff0c\u5982\u679c\u4f20\u5165 reverse=True \u5219\u4ece\u5927\u5230\u5c0f \u53cd\u8f6c\u5217\u8868 lst.reverse() \u6c38\u4e45\u53cd\u8f6c\uff08\u610f\u4e49\u540c\u4e0a\uff09 lst[::-1] \u8fd4\u56de\u53cd\u8f6c\u7684\u5217\u8868\uff08\u5229\u7528\u524d\u9762\u8bf4\u5230\u7684\u5207\u7247\uff09 \u7edf\u8ba1\u64cd\u4f5c len(lst) \u5f97\u5230\u5217\u8868\u7684\u957f\u5ea6 sum(lst) \u5f97\u5230\u5217\u8868\u7684\u5143\u7d20\u548c\uff08\u672c\u8d28\u4e0a\u662f\u5c06 start \u53c2\u6570\u548c\u6bcf\u4e2a\u5143\u7d20\u4f9d\u6b21\u76f8\u52a0\uff09 \u53ef\u4ee5\u4f20\u5165 start \u53c2\u6570\u7528\u6765\u6307\u5b9a\u52a0\u548c\u7684\u8d77\u59cb\u503c max(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5927\u503c min(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5c0f\u503c \u5143\u7ec4 \u00b6 \u53ef\u4ee5\u770b\u6210\u5143\u7d20\u4e0d\u53ef\u53d8\u7684\u5217\u8868\uff0c\u5185\u90e8\u4e5f\u53ef\u4ee5\u5305\u542b\u4e0d\u540c\u7c7b\u578b\u7684\u5143\u7d20 \u62ec\u53f7\u8868\u793a\u5143\u7ec4\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694 \u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u4e00\u6837\u7684\u65b9\u6cd5\u6765\u8bfb\u53d6\u5143\u7d20\uff0c\u4f46\u5e76\u4e0d\u80fd\u4fee\u6539 \u5f53\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u65f6\u5019\u8981\u5199\u6210 (a,) \u800c\u4e0d\u662f (a)\uff08\u540e\u8005\u662f\u5355\u4e2a\u503c\uff09 \u53ef\u4ee5\u4f7f\u7528 tuple(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff08\u5217\u8868\u3001\u5b57\u7b26\u4e32\u7b49\uff09\u8f6c\u4e3a\u5143\u7ec4 \u5143\u7ec4\u5e76\u4e0d\u80fd\u4fdd\u8bc1\u5143\u7d20\u5b8c\u5168\u4e0d\u53ef\u53d8 \u907f\u514d\u5728\u5143\u7ec4\u4e2d\u5b58\u653e\u53ef\u53d8\u5143\u7d20 \u96c6\u5408 \u00b6 \u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694\uff0c\u4f1a\u81ea\u52a8\u53bb\u91cd \u53ef\u7528 set(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\u8f6c\u4e3a\u5143\u7ec4\uff0c\u81ea\u52a8\u53bb\u91cd \u96c6\u5408\u4e2d\u4e0d\u80fd\u5305\u542b\u5217\u8868\u7b49\u4e0d\u53ef hash \u5316\u7684\u5143\u7d20 \u4fee\u6539 s.add(...) \u6765\u52a0\u5165\u4e00\u4e2a\u5143\u7d20 s.remove(...) \u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u4f1a\u629b\u51fa\u5f02\u5e38 s.discard(...) \u6765\u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u5219\u5ffd\u7565 \u8fd0\u7b97 s1 & s2\u3001s1 | s2\u3001s1 - s2 \u4ea4\u96c6\u3001\u5e76\u96c6\u3001\u5dee\u96c6 s1 ^ s2 \u5bf9\u79f0\u5dee\u96c6 \u5b57\u5178 \u00b6 \u5b58\u50a8\u952e\u503c\u5bf9\uff0c\u4e5f\u662f\u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u4e0d\u8fc7\u9017\u53f7\u5206\u9694\u7684\u662f\u952e\u503c\u5bf9 {key: value, ...} {} \u662f\u7a7a\u5b57\u5178\u800c\u4e0d\u662f\u7a7a\u96c6\u5408 \u901a\u8fc7 d[key] \u6765\u8bbf\u95ee\u5b57\u5178\u4e2d key \u5bf9\u5e94\u7684\u503c\uff0c\u53ef\u4ee5\u8bfb\u53d6\u3001\u4fee\u6539 \u6dfb\u52a0\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 d[key] = value \u6765\u8fdb\u884c \u5220\u9664\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5 del d[key] \u901a\u8fc7 d[key] \u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728 key \u8fd9\u4e2a\u952e\u4f1a\u629b\u51fa\u5f02\u5e38 \u901a\u8fc7 d.get(key) \u6765\u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728\u5219\u4f1a\u8fd4\u56de None \u4f7f\u7528 d.get(key, default) \u5982\u679c\u6ca1\u6709 key \u65f6\u4f1a\u8fd4\u56de default \u503c d.update(d2) \u6765\u7528 d2 \u4e2d\u7684\u952e\u503c\u5bf9\u66f4\u65b0 d \u6761\u4ef6\u5206\u652f \u00b6 \u5e03\u5c14\u8868\u8fbe\u5f0f \u00b6 == \u5224\u65ad\u76f8\u7b49\uff08\u76f8\u7b49\u5219\u8fd4\u56de True\uff09\uff0c != \u5224\u65ad\u4e0d\u7b49 \u4f7f\u7528 and or not \u6765\u8fdb\u884c\u5e03\u5c14\u8fd0\u7b97\uff0c\u5fc5\u8981\u65f6\u52a0\u62ec\u53f7\u4fdd\u8bc1\u4f18\u5148\u7ea7 \u6570\u503c\u6bd4\u8f83\u5927\u5c0f < <= > >= \u5224\u65ad\u5143\u7d20\u662f\u5426\u5728\u5217\u8868\u4e2d value in lst\uff1a\u5982\u679c\u5728\u5219\u503c\u4e3a True value not in lst\uff1a\u5982\u679c\u5728\u5219\u4e3a False\uff08\u5224\u65ad\u662f\u5426\u4e0d\u5728\uff09 \u5224\u65ad\u952e\u662f\u5426\u5728\u5b57\u5178\u4e2d key in d\u3001key not in d \u4e0e\u5217\u8868\u540c\u7406 \u6761\u4ef6\u8bed\u53e5 \u00b6 if-elif-else \u7ed3\u6784\uff08\u4e0d\u662f else if\uff09 elif\u3001else \u5747\u53ef\u4ee5\u7701\u7565 \u6761\u4ef6\u4e0d\u9700\u8981\u52a0\u62ec\u53f7\uff08\u52a0\u4e86\u4e5f\u6ca1\u95ee\u9898\uff09 condition \u4f1a\u88ab\u8f6c\u6362\u6210 bool \u7c7b\u578b\u7136\u540e\u5224\u65ad \u6ce8\u610f\u7f29\u8fdb \u7c7b\u4e09\u76ee\u8fd0\u7b97\u7b26\u5199\u6cd5 a if condition else b \u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u4e2d\u7684 condition? a : b if-elif-else if condition1 : ... elif condition2 : ... elif condition3 : ... else : ... \u7f29\u8fdb \u00b6 \u7f29\u8fdb\u662f python \u4e2d\u5f88\u91cd\u8981\u7684\u4e1c\u897f\uff0cpython \u9760\u7f29\u8fdb\u6765\u5f97\u5230\u4ee3\u7801\u7ed3\u6784\uff0c\u800c\u4e0d\u662f\u5927\u62ec\u53f7 \u7f29\u8fdb\u53ef\u4ee5\u4f7f\u7528\u7a7a\u683c\u6216\u5236\u8868\u7b26 \u5982\u679c\u4e00\u4e9b\u4ee3\u7801\u5904\u4e8e\u540c\u4e00\u5c42\u7f29\u8fdb\u4e0b\uff0c\u5219\u5c5e\u4e8e\u540c\u4e00\u4e2a\u4ee3\u7801\u5757 \u540c\u4e00\u4e2a\u4ee3\u7801\u5757\u7684\u7f29\u8fdb\u8981\u7edf\u4e00 \u4e0d\u4ec5\u4ec5\u662f\u770b\u7740\u50cf\uff0c\u8981\u533a\u5206\u597d\u7a7a\u683c\u4e0e\u5236\u8868\u7b26 4 \u4e2a\u7a7a\u683c\u4e0e\u4e00\u4e2a\u663e\u793a\u5bbd\u5ea6\u4e3a 4 \u7684\u5236\u8868\u7b26\u5e76\u4e0d\u662f\u540c\u4e00\u7f29\u8fdb \u4e00\u822c\u4f7f\u7528 4 \u7a7a\u683c\u7f29\u8fdb\uff0c\u6216\u8005 1 \u5236\u8868\u7b26\u7f29\u8fdb \u7f16\u8f91\u5668\u4e2d\u6309 Tab \u6253\u51fa\u7684\u4e5f\u4e0d\u4e00\u5b9a\u662f\u5236\u8868\u7b26\uff0c\u8981\u5206\u6e05 \u7f29\u8fdb\u4e0d\u6b63\u786e\u4f1a\u62a5 IndentationError\uff0c\u6b64\u65f6\u6ce8\u610f\u68c0\u67e5\u7f29\u8fdb \u5faa\u73af \u00b6 for \u5faa\u73af \u00b6 python \u4e2d\u7684 for \u5faa\u73af\u5e76\u4e0d\u50cf c \u4e2d\u662f\u6307\u5b9a\u4e00\u4e2a\u53d8\u91cf\u7684\u53d8\u5316\u65b9\u5f0f\uff0c\u800c\u662f\u4ece\u5217\u8868/\u5143\u7ec4/\u8fed\u4ee3\u5668\u7b49\u53ef\u8fed\u4ee3\u5bf9\u8c61\u4e2d\u904d\u5386\u503c for \u5faa\u73af\u4f1a\u4ea7\u751f\u4e00\u4e2a\u7528\u4e8e\u5faa\u73af\u7684\u53d8\u91cf\uff0c\u8fd9\u4e2a\u53d8\u91cf\u5728\u5faa\u73af\u7ed3\u675f\u540e\u5e76\u4e0d\u4f1a\u5220\u9664\uff0c\u800c\u662f\u4fdd\u7559\u6700\u540e\u4e00\u6b21\u7684\u503c \u53ef\u4ee5\u4f7f\u7528 range \u6765\u751f\u6210\u4e00\u4e32\u6570\u5b57\u7528\u6765\u5faa\u73af range(a, b) \u751f\u6210\u4ece a \u5230 b-1 \u7684\u8fde\u7eed\u6574\u6570 range(a, b, c) \u4ee5 c \u4e3a\u6b65\u957f\u751f\u6210 range \u5f97\u5230\u7684\u5e76\u4e0d\u662f\u5217\u8868\uff0c\u5982\u679c\u8981\u7528\u5176\u751f\u6210\u5217\u8868\u8981\u4f7f\u7528 list(range(...)) for value in lst : ... for value in range ( ... ): ... for \u5faa\u73af\u904d\u5386\u5b57\u5178 \u00b6 \u6709\u4e09\u79cd\u65b9\u6cd5\u6765\u904d\u5386\u5b57\u5178 \u5728 d.keys() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u952e \u5728 d.values() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u503c \u5728 d.items() \u4e2d\u904d\u5386\u952e\u503c\u5bf9\uff08\u9700\u8981\u89e3\u5305\uff09 for key in d . keys (): ... for value in d . values (): ... for item in d . items (): ... # item \u4e3a\u4e00\u4e2a\u5143\u7ec4 for key , value in d . items (): ... # \u5c06 item \u89e3\u5305 \u5143\u7d20\u89e3\u5305 \u00b6 \u8d4b\u503c\u65f6\u7b49\u53f7\u5de6\u4fa7\u53ef\u4ee5\u662f\u7528\u9017\u53f7\u5206\u9694\u7684\u591a\u4e2a\u503c\uff0c\u8fd9\u65f6\u4f1a\u5c06\u53f3\u4fa7\u89e3\u5305\u5206\u522b\u8d4b\u503c\u7ed9\u5de6\u4fa7\u7684\u5404\u4e2a\u53d8\u91cf \u53f3\u4fa7\u4e5f\u53ef\u4ee5\u662f\u591a\u4e2a\u503c\uff08\u53ea\u8981\u51fa\u73b0\u9017\u53f7\u5c31\u4f1a\u89c6\u4e3a\u4e00\u4e2a\u5143\u7ec4\uff09 \u53ef\u4ee5\u901a\u8fc7 a, b = b, a \u5b9e\u73b0\u5143\u7d20\u4ea4\u6362 \u661f\u53f7\u8868\u8fbe\u5f0f \u53ef\u4ee5\u7528\u6765\u5728\u53ef\u8fed\u4ee3\u5bf9\u8c61\u5185\u90e8\u89e3\u5305 \u4e5f\u53ef\u7528\u6765\u6807\u8bb0\u4e00\u4e2a\u53d8\u91cf\u5305\u542b\u591a\u4e2a\u503c for \u5faa\u73af\u53ef\u4ee5\u89e3\u5305 t = ( 1 , 2 , 3 ) a , b , c = t # a = 1, b = 2, c = 3 t = ( 1 , 2 , ( 3 , 4 )) a , b , ( c , d ) = t # c = 3, d = 4 l = [ 1 , 2 , * [ 3 , 4 ]] # [3, 4] \u88ab\u89e3\u5305 ## l = [1, 2, 3, 4] a , * b = [ 1 , 2 , 3 , 4 ] ## a = 1, b = [2, 3, 4] lst = [[ 1 , 2 ], [ 3 , 4 ]] for a , b in lst : ... # \u7b2c\u4e00\u6b21\u5faa\u73af a, b \u4e3a 1, 2 # \u7b2c\u4e8c\u6b21\u5faa\u73af a, b \u4e3a 3, 4 for \u5faa\u73af\u6280\u5de7 \u00b6 enumerate \u8ba1\u6570 \u53ef\u4ee5\u6307\u5b9a\u521d\u59cb\u503c zip \u540c\u65f6\u5faa\u73af\u591a\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61 \u5faa\u73af\u6b21\u6570\u4e3a\u6700\u77ed\u7684\u5bf9\u8c61\u7684\u957f\u5ea6 for i , value in enumerate ( lst ): ... # i \u4f9d\u6b21\u4e3a 0\uff0c1\uff0c2\uff0c\u2026\u2026 for i , value in enumerate ( lst , 1 ): ... # i \u4f9d\u6b21\u4e3a 1\uff0c2\uff0c3\uff0c\u2026\u2026 for a , b in zip ( lst1 , lst2 ): ... # a \u5728 lst1 \u4e2d\u5faa\u73af # b \u5728 lst2 \u4e2d\u5faa\u73af \u5217\u8868\u63a8\u5bfc \u00b6 \u4e00\u79cd\u5f88\u65b9\u4fbf\u7684\u751f\u6210\u5217\u8868\u7684\u65b9\u5f0f \u5373\u5728\u5217\u8868\u4e2d\u5305\u542b\u5faa\u73af\uff0c\u9010\u6b21\u8bb0\u5f55\u5faa\u73af\u524d\u8868\u8fbe\u5f0f\u7684\u503c \u53ef\u4ee5\u6709\u591a\u91cd\u5faa\u73af\uff0c\u5373\u751f\u6210\u7b1b\u5361\u5c14\u79ef \u53ef\u4ee5\u5305\u542b\u6761\u4ef6\uff0c\u5373\u5728\u6761\u4ef6\u6210\u7acb\u65f6\u624d\u8bb0\u5f55\u503c \u5217\u8868\u63a8\u5bfc\u4e2d\u7684\u5faa\u73af\u53d8\u91cf\u6709\u5c40\u90e8\u4f5c\u7528\u57df \u5373\u5728\u5217\u8868\u63a8\u5bfc\u5916\u4e0d\u80fd\u8bbf\u95ee\u5faa\u73af\u53d8\u91cf lst = [] for i in range ( 1 , 10 ): lst . append ( i ** 2 ) ## \u7b49\u4ef7\u4e8e lst = [ i ** 2 for i in range ( 1 , 10 )] lst1 = [ x * y for x in l1 for y in l2 ] lst2 = [ ... for ... in ... if ... ] \u751f\u6210\u5143\u7ec4/\u5b57\u5178 \u00b6 \u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u63a8\u5bfc\u7c7b\u4f3c\u7684\u65b9\u6cd5\u751f\u6210\u5143\u7ec4\u548c\u5b57\u5178 \u751f\u6210\u5143\u7ec4\u7684\u65f6\u5019\u8981\u7528 tuple() \u53ea\u5199 () \u7684\u8bdd\u5219\u53ea\u662f\u751f\u6210\u5668\u8868\u8fbe\u5f0f \u751f\u6210\u5b57\u5178\u65f6\u5faa\u73af\u524d\u7528 : \u5c06\u952e\u503c\u9694\u5f00 tuple ( i ** 2 for i in range ( 1 , 10 )) ( i ** 2 for i in range ( 1 , 10 )) ## ^ generator object { a : b for a in ... for b in ... } \u63a7\u5236\u5faa\u73af \u00b6 \u548c\u5176\u5b83\u8bed\u8a00\u4e00\u6837\uff0c\u5728\u5faa\u73af\u4ee3\u7801\u5757\u4e2d\u53ef\u4ee5\u63a7\u5236\u5faa\u73af\u7684\u8fdb\u884c break \u7acb\u523b\u7ed3\u675f\u5faa\u73af continue \u7acb\u523b\u8fdb\u884c\u4e0b\u4e00\u8f6e\u5faa\u73af while \u5faa\u73af \u00b6 while \u5faa\u73af\u5373\u8fdb\u884c\u6761\u4ef6\u68c0\u67e5\uff0c\u5982\u679c\u4e3a True \u5219\u7ee7\u7eed\u8fd0\u884c\u76f4\u5230\u6761\u4ef6\u4e0d\u6ee1\u8db3\u505c\u6b62 while condition : ... \u51fd\u6570 \u00b6 \u51fd\u6570\u5b9a\u4e49 \u00b6 \u4f7f\u7528 def \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u51fd\u6570 \u5148\u51fd\u6570\u540d\uff0c\u7136\u540e\u62ec\u53f7\u5217\u51fa\u53c2\u6570\uff0c\u4e0b\u9762\u63a5\u4ee3\u7801\u5757 \u4f7f\u7528 return \u8fd4\u56de \u6ca1\u6709 return \u8fd0\u884c\u5230\u7ed3\u5c3e\uff0c\u8fd4\u56de None \u53ea\u6709 return\uff0c\u8fd4\u56de None return \u540e\u63a5\u5185\u5bb9\uff0c\u8fd4\u56de\u5185\u5bb9 return \u7684\u503c\u7c7b\u578b\u4e0d\u8981\u6c42\u4e00\u81f4 return \u53ef\u4ee5\u8fd4\u56de\u591a\u4e2a\u503c\uff08\u5229\u7528\u5143\u7ec4\uff09 def func_name ( arg1 , arg2 ): ... def func_name ( arg1 , arg2 ): ... return ... def func_name ( arg1 , arg2 ): ... return ... , ... \u51fd\u6570\u53c2\u6570 \u00b6 \u62ec\u53f7\u4e2d\u8981\u5217\u51fa\u53c2\u6570\u540d\uff0c\u4f9b\u51fd\u6570\u4f53\u5185\u4f7f\u7528 \u53ef\u4ee5\u5728\u53c2\u6570\u540e\u63a5\u7b49\u53f7\u8d4b\u9ed8\u8ba4\u503c \u4f7f\u7528\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5728\u8c03\u7528\u65f6\u53ef\u4ee5\u4e0d\u7528\u4f20 \u5229\u7528 * \u6765\u63a5\u6536\u4efb\u610f\u591a\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5143\u7ec4 * \u53c2\u6570\u540e\u9762\u4e0d\u80fd\u518d\u6709\u5176\u5b83\u975e\u5173\u952e\u5b57\u53c2\u6570 \u5229\u7528 ** \u6765\u63a5\u6536\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5b57\u5178 def func ( arg1 , arg2 ): ... def func ( arg1 , arg2 = \"...\" ): # \u9ed8\u8ba4\u503c ... def func ( arg1 , * arg2 ): # \u4efb\u610f\u591a\u53c2\u6570 ... def func ( arg1 , ** arg2 ): # \u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 ... def func ( arg1 , * arg2 , ** arg3 ): ... # *arg2 \u540e\u53ef\u4ee5\u52a0 **arg3 \u51fd\u6570\u8c03\u7528 \u00b6 \u901a\u8fc7 \u51fd\u6570\u540d(\u53c2\u6570) \u6765\u8c03\u7528\u51fd\u6570\uff0c\u5f97\u5230\u8fd4\u56de\u503c \u76f4\u63a5\u4f20\u53c2\u7684\u8bdd\u8981\u5c06\u53c2\u6570\u4e0e\u5b9a\u4e49\u5bf9\u5e94\u4e0a \u901a\u8fc7\u5173\u952e\u5b57\u4f20\u53c2\uff08\u53c2\u6570\u540d\uff09\u53ef\u4ee5\u6253\u4e71\u987a\u5e8f \u5e26\u6709\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5982\u679c\u4e0d\u4f20\u5219\u4f7f\u7528\u9ed8\u8ba4\u503c \u5982\u679c\u8bfb\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570\uff0c\u5219\u591a\u4f59\u7684\u8bfb\u5230\u5b57\u5178\u4e2d def func ( a , b ): ... func ( 1 , 2 ) # a = 1, b = 2 func ( b = 1 , a = 2 ) # a = 2, b = 1 def func2 ( a , ** b ): ... func2 ( a = 1 , b = 2 , c = 3 ) ## a = 1, b = {\"b\": 2, \"c\": 3} *\u5f15\u7528\u53d8\u91cf \u00b6 python \u4e2d\u7684\u53d8\u91cf\u90fd\u662f\u5f15\u7528\u7684\uff08\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u524d\u9762\u8bf4\u4e0d\u8981\u5c06\u53d8\u91cf\u7406\u89e3\u4e3a\u76d2\u5b50\uff09 \u7528 = \u5b9e\u9645\u4e0a\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u522b\u540d lst1 = lst2\uff0c\u5219 lst1 \u548c lst2 \u4f1a\u540c\u65f6\u53d8\u5316\uff08\u8981\u7528 [:] \u521b\u5efa\u526f\u672c\uff09 \u6570\u503c\u7c7b\u578b\u6709\u4f18\u5316\uff0c\u6240\u4ee5\u4e0d\u4f1a\u8fd9\u6837 == \u68c0\u67e5\u503c\u662f\u5426\u76f8\u7b49\uff0cis \u68c0\u67e5\u503c\u662f\u5426\u76f8\u540c \u89c2\u5bdf pythontutor.com \u51fd\u6570\u53c2\u6570\u4f20\u9012\u53ea\u6709\u201c\u5171\u4eab\u4f20\u53c2\u201d\u4e00\u79cd\u5f62\u5f0f\uff08\u5373\u4f20\u5f15\u7528\uff09 \u53ef\u53d8\u53d8\u91cf\uff08\u4f8b\u5982\u5217\u8868\uff09\u5728\u51fd\u6570\u5185\u90e8\u53ef\u4ee5\u88ab\u6539\u53d8 \u907f\u514d\u5411\u51fd\u6570\u4f20\u9012\u53ef\u53d8\u53d8\u91cf\uff08\u5217\u8868\u53ef\u4f20\u5165 [:] \u521b\u5efa\u7684\u526f\u672c\uff09 \u533f\u540d\u51fd\u6570 \u00b6 \u53ef\u4ee5\u901a\u8fc7 lambda \u8868\u8fbe\u5f0f\u6765\u5b9a\u4e49\u533f\u540d\u51fd\u6570 lambda \u8f93\u5165: \u8f93\u51fa\u8868\u8fbe\u5f0f \u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165 \u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf \u907f\u514d\u7528 lambda \u8d4b\u503c\u7684\u5f62\u5f0f\u5b9a\u4e49\u51fd\u6570 \u4f8b\u5982 __name__ \u5c5e\u6027\u4e0d\u4f1a\u662f\u51fd\u6570\u540d\uff0c\u800c\u662f \"\\\" lambda a : a ** 2 + 2 * a + 1 ( lambda a : a ** 2 + 2 * a + 1 )( 2 ) # 9 lambda a , b : a * 2 + b f = lambda a : a ** 2 + 2 * a + 1 ## \u8fd1\u4f3c\u7b49\u4ef7\u4e8e def f ( a ): return a ** 2 + 2 * a + 1 \u7528\u6237\u8f93\u5165 \u00b6 \u8bfb\u53d6\u7528\u6237\u8f93\u5165\u4f7f\u7528\u5185\u7f6e\u7684 input \u51fd\u6570 \u51fd\u6570\u53c2\u6570\u4e3a\u8981\u663e\u793a\u7684\u63d0\u793a\u7b26\uff0c\u4f8b\u5982 input(\"> \") \u51fd\u6570\u7684\u8fd4\u56de\u503c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32 \u6bcf\u6b21\u8bfb\u5165\u4e00\u884c\uff08\u5373\u8bfb\u5230\u6362\u884c\u4e3a\u6b62\uff09 \u9ad8\u9636\u51fd\u6570\u7528\u6cd5 \u00b6 \u63a5\u6536\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u7684\u51fd\u6570\u88ab\u79f0\u4e3a\u9ad8\u9636\u51fd\u6570 \u6bd4\u8f83\u5e38\u7528\u7684\u6709 map\u3001filter list ( map ( lambda x : x * 2 , [ 1 , 2 ])) ## [2, 4] list ( filter ( lambda x : x > 1 , [ 1 , 2 , 3 ])) ## [2, 3] \u7c7b\u4e0e\u9762\u5411\u5bf9\u8c61 \u00b6 \u7c7b \u00b6 \u7c7b\u53ef\u4ee5\u770b\u6210\u5305\u542b\u4e00\u4e9b \u5c5e\u6027 \u548c \u65b9\u6cd5 \u7684\u6846\u67b6 \u6839\u636e\u7c7b\u6765\u521b\u5efa\u5bf9\u8c61 -> \u5b9e\u4f8b\u5316 \u7528 class \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u7c7b \u7c7b\u4e2d\u7684\u51fd\u6570 -> \u65b9\u6cd5 \u7279\u6b8a\u65b9\u6cd5 __init__\uff0c\u5728\u7c7b\u5b9e\u4f8b\u5316\u7684\u65f6\u5019\u4f1a\u88ab\u81ea\u52a8\u8c03\u7528 \u5176\u5b83\u4e00\u822c\u7684\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u90fd\u8981\u4e3a\"self\"\uff0c\u8c03\u7528\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u4f20\u5165 \u76f4\u63a5\u5199\u5728\u7c7b\u4e2d\u7684\u662f\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e3a self.\\ \u8d4b\u503c\u7684\u5f62\u5f0f\u521b\u5efa\u5c5e\u6027 \u7528\u7c7b\u4f3c\u51fd\u6570\u8c03\u7528\u7684\u5f62\u5f0f\u5b9e\u4f8b\u5316\u7c7b\uff0c\u53c2\u6570\u4e3a__init__\u65b9\u6cd5\u7684\u53c2\u6570 \u76f4\u63a5\u901a\u8fc7 .\\ .\\ \u7684\u5f62\u5f0f\u8c03\u7528\u65b9\u6cd5/\u83b7\u53d6\u5c5e\u6027 class ClassName (): a = 1 def __init__ ( self , arg1 , arg2 ): self . arg1 = arg1 self . arg2 = arg2 def method ( self ): print ( self . arg1 , self . arg2 , self . a ) obj = ClassName ( 2 , 3 ) obj . method () # 2 3 1 print ( obj . a , obj . arg1 ) # 1 2 \u7c7b\u7684\u7ee7\u627f \u00b6 \u5728 class \u5b9a\u4e49\u7684\u62ec\u53f7\u4e2d\u52a0\u4e0a\u53e6\u4e00\u4e2a\u7c7b\u540d\u5219\u8868\u793a\u7ee7\u627f\u81ea\u90a3\u4e2a\u7c7b\u5b9a\u4e49\u4e00\u4e2a\u5b50\u7c7b \u5b50\u7c7b\u4f1a\u7ee7\u627f\u7236\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5 \u5b50\u7c7b\u7f16\u5199\u548c\u7236\u7c7b\u540d\u5b57\u4e00\u6837\u7684\u65b9\u6cd5\u4f1a \u91cd\u8f7d \u5728\u91cd\u8f7d\u7684\u65b9\u6cd5\u4e2d\u8c03\u7528\u7236\u7c7b\u7684\u539f\u65b9\u6cd5\u4f7f\u7528 super() \u4e5f\u53ef\u4ee5\u4e3a\u5b50\u7c7b\u5b9a\u4e49\u72ec\u6709\u7684\u65b9\u6cd5 class ClassA (): def __init__ ( self , a ): self . a = a def print ( self ): print ( self . a ) class ClassB ( ClassA ): def __init__ ( self , a ): super () . __init__ ( a ) self . a *= 2 obj = ClassB ( 1 ) obj . print () # 2 \u79c1\u6709\uff1f \u00b6 python \u4e2d\u7c7b\u5e76\u6ca1\u6709\u4e25\u683c\u79c1\u6709\u7684\u5c5e\u6027 \u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u4f1a\u88ab\u9690\u85cf\uff0c\u4e0d\u80fd\u76f4\u63a5\u8bfb\u53d6 \u4f46\u8fd9\u79cd\u5c5e\u6027\u53ef\u4ee5\u901a\u8fc7 _\u7c7b\u540d__\u5c5e\u6027 \u4f46\u65b9\u5f0f\u8bfb\u53d6\u5230 \u4f7f\u7528\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u53ef\u4ee5\u8f7b\u5fae\u4fdd\u62a4\u5c5e\u6027\uff0c\u4f46\u5e76\u4e0d\u4ee3\u8868\u5176\u662f\u79c1\u6709\u7684 class A (): a = 1 _a = 2 __a = 3 obj = A () print ( obj . a ) # 1 print ( obj . _a ) # 2 print ( obj . __a ) # AttributeError print ( obj . _A__a ) # 3 \u4e00\u5207\u7686\u5bf9\u8c61\uff1f \u00b6 python \u4e2d\u5373\u4f7f\u6700\u7b80\u5355\u7684\u6574\u6570\u4e5f\u662f\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b \u901a\u8fc7 dir(...) \u67e5\u770b\u4e00\u4e2a\u5bf9\u8c61\u7684\u6240\u6709\u5c5e\u6027/\u65b9\u6cd5 \u6709\u5f88\u591a\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u3001\u53cc\u4e0b\u5212\u7ebf\u7ed3\u5c3e\u7684\u65b9\u6cd5\uff0c\u6210\u4e3a\u9b54\u672f\u65b9\u6cd5\uff08dunder method\uff09 \u9b54\u672f\u65b9\u6cd5 \u00b6 \u5f88\u591a\u51fd\u6570\u3001\u8868\u8fbe\u5f0f\u5176\u5b9e\u662f\u901a\u8fc7\u8c03\u7528\u7c7b\u7684\u9b54\u672f\u65b9\u6cd5\u6765\u5b9e\u73b0\u7684 len(obj) \u8c03\u7528 obj.__len__() obj[...] \u8c03\u7528 obj.__getitem__(...) a in obj \u8c03\u7528 obj.__contains__(a) bool(obj) \u8c03\u7528 obj.__bool__() \u51fd\u6570\u7684\u8c03\u7528\u672c\u8d28\u4e0a\u662f\u8c03\u7528 func.__call__() a + b \u8c03\u7528 a.__add__(b) \u2026\u2026 \u4e00\u4e2a\u4f8b\u5b50\uff1a lst[a:b:c] \u5207\u7247\u64cd\u4f5c \u5176\u4e2d\u5207\u7247\u4e5f\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5b83\u662f\u4e00\u4e2a slice \u7c7b\u7684\u5b9e\u4f8b \u6240\u4ee5\u5b83\u7b49\u4ef7\u4e8e lst[slice(a, b, c)] \u800c\u901a\u8fc7 [] \u7684\u64cd\u4f5c\u53c8\u662f\u901a\u8fc7 __getitem__ \u9b54\u672f\u65b9\u6cd5\u5b9e\u73b0\u7684 \u6240\u4ee5\u5b83\u53c8\u7b49\u4ef7\u4e8e lst.__getitem__(slice(a, b, c)) __getitem__ \u65b9\u6cd5\u4e2d\u5904\u7406\u4e86 slice\uff0c\u8bfb\u53d6 abc \u7684\u503c\uff0c\u518d\u5904\u7406\u8fd4\u56de\u4e00\u4e2a\u65b0\u5217\u8868 \u6742\u9879\u5185\u5bb9 \u00b6 \u6587\u4ef6\u64cd\u4f5c \u00b6 open \u51fd\u6570\uff0c\u4f20\u5165\u6587\u4ef6\u540d\u3001\u6253\u5f00\u6a21\u5f0f \u6253\u5f00\u6a21\u5f0f\uff08\u53ef\u4ee5\u53e0\u52a0\uff09\uff1ar \u8bfb\uff08\u9ed8\u8ba4\uff09\u3001w \u5199\u3001x \u521b\u5efa\u5e76\u5199\u3001a \u5199\u5728\u672b\u5c3e\u3001b \u5b57\u8282\u6a21\u5f0f\u3001t \u6587\u672c\u6a21\u5f0f\uff08\u9ed8\u8ba4\uff09 \u8bfb\u53d6 \u6587\u672c\u6a21\u5f0f\u5efa\u8bae\u52a0\u4e0a encoding\uff0c\u4e0d\u7136\u5bb9\u6613\u62a5\u9519 f.read() \u8bfb\u53d6\u5168\u90e8\u5185\u5bb9\uff08\u5b57\u8282\u6a21\u5f0f\u5f97\u5230\u5b57\u8282\u5e8f\u5217\uff09 f.readline() \u8bfb\u53d6\u4e00\u884c f.readlines() \u8bfb\u53d6\u6240\u6709\u884c\uff0c\u8fd4\u56de\u4e00\u4e2a\u5217\u8868 \u5199\u5165 \u6587\u672c\u6a21\u5f0f\u540c\u6837\u5efa\u8bae\u52a0\u4e0a encoding f.write(...) \u76f4\u63a5\u5199\u5165 f.writelines(...) \u4f20\u5165\u5217\u8868\uff0c\u5143\u7d20\u95f4\u6362\u884c\u5199\u5165 \u901a\u8fc7\u8fd9\u79cd\u5f62\u5f0f\u64cd\u4f5c\u6587\u4ef6\u8bb0\u5f97\u7528\u5b8c\u540e\u8981 f.close() f = open ( \"filename\" , \"r\" , encoding = \"utf-8\" ) s = f . read () # a str ## line = f.readline() # a str ## lines = f.readlines() # a list ... f . close () f = open ( \"filename\" , \"w\" , encodeing = \"utf-8\" ) f . write ( \"...\" ) f . writelines ([ \"...\" , \"...\" ]) ... f . close () with \u5757 \u00b6 with ... as ...: \u5f00\u542f\u4e00\u4e2a\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668 \u5e38\u7528\u5728\u6587\u4ef6 open \u4e0a with \u5757\u5f00\u59cb\u81ea\u52a8\u6253\u5f00 with \u5757\u7ed3\u675f\u81ea\u52a8\u7ed3\u675f with \u5757\u7ed3\u675f\u540e\u53d8\u91cf\u4ecd\u4f1a\u7559\u5b58 with open ( \"file\" , \"r\" , encoding = \"utf-8\" ) as f : s = f . read () ... print ( f . closed ) # True \u5f02\u5e38\u4e0e\u5904\u7406 \u00b6 \u4ea7\u751f\u9519\u8bef -> \u629b\u51fa\u5f02\u5e38 -> \u7a0b\u5e8f\u7ed3\u675f raise \u5173\u952e\u5b57\u629b\u51fa\u5f02\u5e38 try-except \u5757\u6355\u83b7\u5f02\u5e38 \u53ef\u4ee5\u6709\u591a\u4e2a except\u3001\u4e0d\u53ef\u4ee5\u6ca1\u6709 except \u540e\u63a5\u5f02\u5e38\u7c7b\uff08\u6ca1\u6709\u5219\u6355\u83b7\u6240\u6709\uff09 as \u5b57\u53e5\u5b58\u4e0b\u5f02\u5e38 finally \u8bed\u53e5 \u4e0d\u7ba1\u662f\u5426\u6709\u5f02\u5e38\u90fd\u4f1a\u8fd0\u884c raise ... raise RuntimeError ( \"...\" ) try : input ( \">>> \" ) except KeyboardInterrupt : print ( \"Good bye\" ) try : print ( 1 / 0 ) except ZeroDivisionError as e : print ( \"can't devide by zero\" ) raise e finally : print ( \"finished\" ) if \u5916\u7684 else \u8bed\u53e5 \u00b6 else \u5757\u4e0d\u4ec5\u4ec5\u8ddf\u7740 if \u624d\u80fd\u4f7f\u7528 for-else for \u5faa\u73af\u7ed3\u675f\u624d\u4f1a\u8fd0\u884c for \u5faa\u73af\u88ab break \u4e86\u4e0d\u4f1a\u8fd0\u884c while-else condition \u4e0d\u6210\u7acb\u9000\u51fa\u624d\u4f1a\u8fd0\u884c \u5faa\u73af\u88ab break \u7ec8\u6b62\u4e86\u4e0d\u4f1a\u8fd0\u884c try-else try \u5757\u4e2d\u6ca1\u6709\u5f02\u5e38\u51fa\u73b0\u624d\u4f1a\u8fd0\u884c else \u5757\u4e2d\u5f02\u5e38\u4e0d\u4f1a\u88ab\u524d\u9762\u7684 except \u6355\u83b7 \u7a0b\u5e8f\u6d41\u8df3\u5230\u5757\u5916\u4e86\u4e0d\u4f1a\u8fd0\u884c\uff08return \u7b49\uff09 for value in lst : ... else : ... while condition : ... else : ... try : ... except ... : ... else : ... \u6a21\u5757\u4e0e\u5bfc\u5165 \u00b6 \u6a21\u5757\u53ef\u4ee5\u662f\u4e00\u4e2a\u5355\u72ec\u7684 .py \u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u6587\u4ef6\u5939 \u6587\u4ef6\u5939\u76f8\u5f53\u4e8e\u5bfc\u5165\u5176\u4e0b __init__.py \u6587\u4ef6 \u6a21\u5757\u4e2d\u6b63\u5e38\u7f16\u5199\u51fd\u6570\u3001\u7c7b\u3001\u8bed\u53e5 \u901a\u8fc7 import \u8bed\u53e5\u5bfc\u5165\u6a21\u5757 import code import code as cd from code import ... from code import * \u5bfc\u5165\u65f6\u76f8\u5f53\u4e8e\u8fd0\u884c\u4e86\u4e00\u904d\u5bfc\u5165\u7684\u4ee3\u7801 ## code.py print ( \"hello\" ) def f (): print ( \"call func in code.py\" ) ... import code # hello code . f () import code as cd # hello cd . f () from code import f # hello f () from code import * # hello f () \u201dmain \u51fd\u6570\u201c \u00b6 \u9632\u6b62\u5bfc\u5165\u65f6\u8fd0\u884c\u4ee3\u7801 \u53ea\u5141\u8bb8\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u65f6\u8fd0\u884c \u901a\u8fc7\u5224\u65ad __name__ \u5982\u679c\u662f\u76f4\u63a5\u8fd0\u884c\uff0c\u5219\u5176\u7b49\u4e8e\u5b57\u7b26\u4e32 __main__ \u5982\u679c\u662f\u88ab\u5bfc\u5165\u7684\uff0c\u5219\u5176\u7b49\u4e8e\u6a21\u5757\u540d ## code.py ... if __name__ == \"__main__\" : print ( \"hello\" ) else : print ( __name__ ) import code # code $ python code.py # hello \u5185\u90e8\u6a21\u5757 \u00b6 python \u81ea\u5e26\u4e86\u5f88\u591a\u5b9e\u7528\u7684\u6a21\u5757\uff08\u6807\u51c6\u5e93\uff09 os\u3001sys\uff1a\u7cfb\u7edf\u64cd\u4f5c math\uff1a\u6570\u5b66\u8fd0\u7b97 re\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f datetime\uff1a\u65e5\u671f\u4e0e\u65f6\u95f4 subprocess\uff1a\u5b50\u8fdb\u7a0b\u7ba1\u7406 argparse\uff1a\u547d\u4ee4\u884c\u53c2\u6570\u89e3\u6790 logging\uff1a\u65e5\u5fd7\u8bb0\u5f55 hashlib\uff1a\u54c8\u5e0c\u8ba1\u7b97 random\uff1a\u968f\u673a\u6570 csv\u3001json\uff1a\u6570\u636e\u683c\u5f0f\u89e3\u6790 collections\uff1a\u66f4\u591a\u7c7b\u578b ... \u770b\u6587\u6863\uff1a docs.python.org/zh-cn/3/library \u5916\u90e8\u6a21\u5757\u5b89\u88c5 \u00b6 pypi.org \u4e0a\u6709\u6781\u591a\u522b\u4eba\u5199\u597d\u4e86\u53ef\u4ee5\u7528\u7684\u6a21\u5757 numpy \u77e9\u9635\u7b49\u79d1\u5b66\u8ba1\u7b97\u3001scipy \u79d1\u5b66\u8ba1\u7b97\u3001matplotlib \u4f5c\u56fe\u2026\u2026 \u4f7f\u7528 pip \u5b89\u88c5\uff08pip / python -m pip\uff09 pip install pkg_name pip install pkg_name=... \u6307\u5b9a\u7248\u672c pip install -r requirements.txt \u5b89\u88c5 txt \u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5305 pip install ... -i https://pypi.tuna.tsinghua.edu.cn/simple \u6362\u6e90 pip list\u3001pip show \u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u7684\u6240\u6709\u5305/\u67d0\u4e2a\u5305\u7684\u4fe1\u606f pip uninstall pkg_name \u5378\u8f7d\u5305 pip \u5b89\u88c5\u672c\u5730\u6a21\u5757 \u76ee\u5f55\u4e0b\u9700\u8981\u5305\u542b setup.py / pyproject.toml pip install . \u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u590d\u5236\u5230 site-packages \u4e2d\uff09 pip install -e . \u53ef\u4fee\u6539\u5f62\u5f0f\u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u5728\u5f53\u524d\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u4ee3\u7801\uff09 \u6587\u6863\u5b57\u7b26\u4e32 \u00b6 \u6a21\u5757\u5f00\u5934\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 \u7c7b\u3001\u51fd\u6570\u5b9a\u4e49\u4e0b\u9762\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 help(...) \u7684\u65f6\u5019\u53ef\u4ee5\u663e\u793a obj.__doc__ \u8868\u793a\u8fd9\u4e32\u5b57\u7b26\u4e32 \u7f16\u8f91\u5668\u7528\u6765\u63d0\u793a \u4e00\u4e9b\u6587\u6863\u751f\u6210\u5de5\u5177\uff08sphinx \u7b49\uff09\u4ece\u4e2d\u83b7\u53d6\u6587\u6863 \"\"\" docstring for module \"\"\" def func ( ... ): \"\"\"docstring for function\"\"\" ... class A (): \"\"\"docstring for class\"\"\" def __init__ ( self , ... ): \"\"\"docstring for method\"\"\" ... \u4ee3\u7801\u89c4\u8303 \u00b6 PEP\uff1aPython Enhancement Proposals\uff1a peps.python.org PEP 8 \u89c4\u8303\uff0c\u7ed9\u51fa\u4e86\u63a8\u8350\u4f7f\u7528\u7684 python \u4ee3\u7801\u98ce\u683c\u89c4\u8303 peps.python.org/pep-0008 pep8.org \u66f4\u7ec6\u81f4\u7684\u4ee3\u7801\u98ce\u683c black github.com/psf/black flake8 flake8.pycqa.org ... Referencce \u00b6 Python3 \u83dc\u9e1f\u6559\u7a0b Python \u5b98\u65b9\u6587\u6863 Python\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\uff08\u7b2c2\u7248\uff09 Python \u8bed\u6cd5\u57fa\u7840","title":"Python \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/python/basic/#python","text":"Abstract copy from TonyCrane/note","title":"Python \u8bed\u6cd5\u57fa\u7840"},{"location":"cs/pl/python/basic/#python_1","text":"\u89e3\u91ca\u6027\u7684\u811a\u672c\u8bed\u8a00\uff1a\u901a\u8fc7\u89e3\u91ca\u5668\u6765\u76f4\u63a5\u8fd0\u884c\uff0c\u4e0d\u9700\u8981\u7f16\u8bd1\u94fe\u63a5\u6210\u4e8c\u8fdb\u5236\u6587\u4ef6 \u52a8\u6001\u7c7b\u578b\u8bed\u8a00\uff1a\u7c7b\u578b\u5728\u8fd0\u884c\u65f6\u786e\u5b9a\uff0c\u4e0d\u9700\u8981\u901a\u8fc7\u4ee3\u7801\u660e\u6587\u89c4\u5b9a \u9762\u5411\u5bf9\u8c61\u8bed\u8a00\uff1apython \u4e2d\u4e00\u5207\u7686\u5bf9\u8c61 ...","title":"\u4ec0\u4e48\u662f python"},{"location":"cs/pl/python/basic/#python_2","text":"\u88c5\u7684\u662f\u4ec0\u4e48\uff1f \u662f\u4e00\u4e2a python \u89e3\u91ca\u5668\uff0c\u4ee5\u53ca\u8fd0\u884c\u9700\u8981\u7684\u73af\u5883 \u600e\u4e48\u88c5\uff1f \u5b98\u65b9\u7f51\u7ad9 https://www.python.org/downloads/ conda\uff08\u4e00\u4e2a\u597d\u7528\u7684 python \u73af\u5883\u7ba1\u7406\u5de5\u5177\uff09 anaconda \uff08\u5927\u3001\u6709\u9884\u88c5\u73af\u5883\uff09 https://www.anaconda.com/ miniconda \uff08\u5c0f\uff09 https://docs.conda.io/en/latest/miniconda \u6781\u4e0d\u5efa\u8bae\u901a\u8fc7\u5fae\u8f6f\u5e94\u7528\u5546\u5e97\u5b89\u88c5 python \u88c5\u4ec0\u4e48\u7248\u672c\uff1f \u4e24\u4e2a\u5927\u7248\u672c\uff0c2.* \u548c 3.*\uff0c\u5dee\u522b\u8f83\u5927\uff0c\u5efa\u8bae 3.* \u4e00\u4e9b\u5c0f\u7248\u672c\uff0c3.6 \u53ca\u4e4b\u524d\u4e0d\u63a8\u8350\uff0c3.7 3.8 \u7a33\u5b9a\uff0c3.9 3.10 \u5b8c\u5584\u4e2d\uff0c3.11 \u9884\u89c8\u4e2d \u7ec6\u5206\u7248\u672c\uff0c\u9009\u62e9\u6700\u65b0\uff0c3.7.13\u30013.8.13\u30013.9.12\u30013.10.4 conda \u4e0d\u5fc5\u62c5\u5fc3\u7248\u672c\uff0c\u9ed8\u8ba4 3.9\uff0c\u53ef\u4ee5\u901a\u8fc7\u521b\u5efa\u865a\u62df\u73af\u5883\u6765\u4f7f\u7528\u4e0d\u540c\u7248\u672c","title":"\u600e\u4e48\u88c5 python"},{"location":"cs/pl/python/basic/#python_3","text":"\u600e\u4e48\u7528 python\uff1f \u8bb0\u4f4f\u4f60\u4e0b\u8f7d\u7684\u662f\u4e00\u4e2a\u89e3\u91ca\u5668\uff0c\u5efa\u8bae\u901a\u8fc7\u547d\u4ee4\u884c\u8fd0\u884c python code.py \u4ec0\u4e48\u662f\u547d\u4ee4\u884c\uff1f \u901a\u8fc7\u8f93\u5165\u547d\u4ee4\u6765\u901a\u77e5\u7535\u8111\u6267\u884c\u67d0\u6307\u4ee4\u3001\u6216\u8005\u8fd0\u884c\u67d0\u7a0b\u5e8f Windows\uff1acmd\u3001Powershell -> \u5355\u72ec\u8fd0\u884c / Windows Terminal /... macOS\uff1azsh\u3001... -> \u7ec8\u7aef / iTerm /... Linux\uff1abash\u3001zsh\u3001... -> \u7ec8\u7aef / ... \u7528\u4ec0\u4e48\u5199\u4ee3\u7801\uff1f \u8bb0\u4f4f\u4f60\u7f16\u5199\u7684\u53ea\u662f\u4e00\u4e2a .py \u4f5c\u4e3a\u6269\u5c55\u540d\u7684\u6587\u672c\u6587\u4ef6 \u53ea\u8981\u6587\u672c\u7f16\u8f91\u5668\u90fd\u53ef\u4ee5\u5199 \u8bb0\u4e8b\u672c\u3001\u81ea\u5e26 IDLE\u3001word Notepad++\u3001Sublime Text VSCode\uff08Visual Studio Code\uff0c\u4e0d\u662f VS\uff09code.visualstudio.com Pycharm\uff08Community Edition \u5c31\u591f\u7528\uff09jetbrains.com/pycharm","title":"\u600e\u4e48\u7f16\u5199\u3001\u8fd0\u884c python"},{"location":"cs/pl/python/basic/#_1","text":"","title":"\u6570\u636e\u7c7b\u578b"},{"location":"cs/pl/python/basic/#_2","text":"\u6574\u578bint\uff0c\u6d6e\u70b9\u578bfloat\uff0c\u590d\u6570complex\uff08c.real\u8868\u793a\u5b9e\u90e8\uff0cc.imag\u8868\u793a\u865a\u90e8\uff0cc.conjugate()\u8fd4\u56de\u5171\u8f6d\u590d\u6570\uff09 \u6574\u6570\u4e0e\u6d6e\u70b9\u6570\u8f6c\u6362 int(...)\uff1a\u54110\u820d\u5165 round(...)\uff1a\u5411\u5076\u820d\u5165\uff08\u56db\u820d\u516d\u5165\u4e94\u51d1\u5076\uff0c\u53ef\u4ee5\u5f53\u6210\u56db\u820d\u4e94\u5165\uff09 math.floor(...)\u3001math.ceil(...)\uff1a\u4e0b\u53d6\u6574\u3001\u4e0a\u53d6\u6574\uff08\u9700\u8981 import math\uff09 \u8fd0\u7b97 \u5bf9\u4e8e+ - *\u52a0\u51cf\u4e58\uff0c\u5982\u679c\u90fd\u662f\u6574\u6570\uff0c\u90a3\u7ed3\u679c\u4e5f\u662f\u6574\u6570\uff0c\u5b58\u5728\u6d6e\u70b9\u6570\uff0c\u5219\u7ed3\u679c\u662f\u6d6e\u70b9\u6570 \u5bf9\u4e8e/\u9664\uff0c\u7ed3\u679c\u662f\u6d6e\u70b9\u6570\uff0c\u5bf9\u4e8e//\uff0c\u7ed3\u679c\u662f\u6574\u6570\uff08\u5411\u4e0b\u53d6\u6574\uff09 \u5bf9\u4e8e%\u53d6\u6a21\uff0c a%b == a-(a//b)*b \u5bf9\u4e8e**\u4e58\u65b9\uff0c\u53ef\u4ee5\u662fa ** 0.5\uff0c\u6216 a ** 2 \u5bf9\u4e8e pow(a,b,mod) \u4e58\u65b9\uff0cmod\u53ef\u7701\u7565\uff0c\u5982\u679cmod\u4e3a-1\u5373\u4e3a\u4e58\u6cd5\u9006\u5143 \u66f4\u591a\u8fd0\u7b97\u901a\u8fc7 math\u3001numpy\u3001scipy \u7b49\u5305\u6765\u8fdb\u884c","title":"\u6570\u5b57\u4e0e\u8fd0\u7b97"},{"location":"cs/pl/python/basic/#_3","text":"Python \u4e0d\u652f\u6301\u5355\u5b57\u7b26\u7c7b\u578b\uff0c\u5355\u5b57\u7b26\u5728 Python \u4e2d\u4e5f\u662f\u4f5c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32\u4f7f\u7528\u3002 \u5355\u5f15\u53f7 '...'\uff0c\u53cc\u5f15\u53f7 \"...\"\uff0c\u4e09\u5f15\u53f7 '''...''' \"\"\"...\"\"\"\uff08\u53ef\u4ee5\u5185\u90e8\u6362\u884c\uff09 \u4e09\u5f15\u53f7 str = \"\"\"\"\"\" \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( \\ t ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ \\ n ] \u3002 \"\"\" print(str) \u8f93\u51fa\u4e3a\uff1a \u8fd9\u662f\u4e00\u4e2a\u591a\u884c\u5b57\u7b26\u4e32\u7684\u5b9e\u4f8b \u591a\u884c\u5b57\u7b26\u4e32\u53ef\u4ee5\u4f7f\u7528\u5236\u8868\u7b26 TAB ( ) \u3002 \u4e5f\u53ef\u4ee5\u4f7f\u7528\u6362\u884c\u7b26 [ ] \u3002 \u524d\u7f00 r-string\uff1ar\"...\"\uff0c\u5f15\u53f7\u4e2d\u4e0d\u8fdb\u884c\u8f6c\u4e49\uff0c\u5373\u4e00\u4e2a/\u5c31\u4ee3\u8868\u659c\u6760\u5b57\u7b26\u672c\u8eab f-string\uff1af\"...\"\uff0c\u683c\u5f0f\u5316\u5b57\u7b26\u4e32 b-string\uff1ab\"...\"\uff0c\u5c06\u5b57\u7b26\u4e32\u8f6c\u4e3a bytes\uff0c\u53ea\u80fd\u5305\u542b ASCII \u5b57\u7b26 \u5e38\u7528\u65b9\u6cd5 \u62fc\u63a5\uff1a\u76f4\u63a5\u5c06\u5b57\u7b26\u4e32\u201c\u76f8\u52a0\u201d \"...\".upper()\u3001\"...\".lower() \uff1a\u8f6c\u4e3a\u5168\u5927\u5199\u3001\u5168\u5c0f\u5199 \"...\".title() \uff1a\u5355\u8bcd\u9996\u5b57\u6bcd\u5927\u5199 \"...\".count(str) \uff1a\u8fd4\u56de\u5b57\u7b26\u4e32\u4e2dstr\u51fa\u73b0\u7684\u6b21\u6570 \"...\".strip() \uff1a\u5220\u9664\u5b57\u7b26\u4e32\u9996\u5c3e\u7a7a\u767d\uff08\u5305\u542b\u7a7a\u683c\u548c\u5236\u8868\u7b26\uff09 \"...\".lstrip()\u3001\"...\".rstrip() \uff1a\u5220\u9664\u5de6\u3001\u53f3\u7aef\u7a7a\u767d\u6216\u6307\u5b9a\u5b57\u7b26 \"...\".replace(old, new) \uff1a\u5b57\u7b26\u4e32\u4e2d old \u66ff\u6362\u6210 new \"...\".split(c) \uff1a\u6839\u636e\u5b57\u7b26 c \u6765\u62c6\u5206\u5b57\u7b26\u4e32\u5f97\u5230\u5217\u8868\uff0c\u9ed8\u8ba4\u62c6\u5206\u7a7a\u767d f-string \u683c\u5f0f\u5316\u5b57\u7b26\u4e32\u65b9\u5f0f\uff1a\"...\" % ...\uff0c\"...\".format(...)\uff0cf\"...\" f-string\u7528\u5927\u62ec{ }\u8868\u793a\u88ab\u66ff\u6362\u5b57\u6bb5\uff0c\u5176\u4e2d\u76f4\u63a5\u586b\u5165\u66ff\u6362\u5185\u5bb9\u5373\u53ef f-string\u7684\u5927\u62ec\u53f7{ }\u53ef\u4ee5\u586b\u5165\u8868\u8fbe\u5f0f\u6216\u8c03\u7528\u51fd\u6570\uff0cPython\u4f1a\u6c42\u51fa\u5176\u7ed3\u679c\u5e76\u586b\u5165\u8fd4\u56de\u7684\u5b57\u7b26\u4e32\u5185 f-string\u4e2d\u4f7f\u7528lambda\u533f\u540d\u51fd\u6570\uff1a\u53ef\u4ee5\u505a\u590d\u6742\u7684\u6570\u503c\u8ba1\u7b97 f-string\u5927\u62ec\u53f7\u5185\u4f7f\u7528\u7684\u5f15\u53f7\u4e0d\u80fd\u548c\u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u5b9a\u754c\u7b26\u5f15\u53f7\u51b2\u7a81\uff0c\u9700\u6839\u636e\u60c5\u51b5\u7075\u6d3b\u5207\u6362\u4f7f\u7528\u5355\u5f15\u53f7\u3001\u53cc\u5f15\u53f7\u3001\u5355\u4e09\u5f15\u53f7\u3001\u53cc\u4e09\u5f15\u53f7 \u5927\u62ec\u53f7\u5916\u7684\u5f15\u53f7\u8fd8\u53ef\u4ee5\u4f7f\u7528\\\u8f6c\u4e49\uff0c\u4f46\u5927\u62ec\u53f7\u5185\u4e0d\u80fd\u4f7f\u7528\\\u8f6c\u4e49 f-string\u5927\u62ec\u53f7\u5916\u5982\u679c\u9700\u8981\u663e\u793a\u5927\u62ec\u53f7\uff0c\u5219\u5e94\u8f93\u5165\u8fde\u7eed\u4e24\u4e2a\u5927\u62ec\u53f7{{ }}\uff1b\u5927\u62ec\u53f7\u5185\u9700\u8981\u5f15\u53f7\uff0c\u4f7f\u7528\u5f15\u53f7\u5373\u53ef f-string\u9488\u5bf9date\u3001datetime\u548ctime\u5bf9\u8c61\uff0c\u8fdb\u884c\u5e74\u6708\u65e5\u3001\u65f6\u5206\u79d2\u7b49\u4fe1\u606f\u63d0\u53d6 \u5bbd\u5ea6\u586b\u5145\uff1a:[ \u586b\u5145\u5b57\u7b26 ][ \u5bf9\u9f50\u65b9\u5f0f ][ \u5bbd\u5ea6 ]\uff0c< \u5de6\u5bf9\u9f50\uff0c> \u53f3\u5bf9\u9f50\uff0c^ \u5c45\u4e2d \u5b57\u7b26\u622a\u65ad\uff1a:[...].n\uff0c\u53ea\u663e\u793a\u5b57\u7b26\u4e32\u7684\u524d n \u4e2a\u5b57\u7b26 \u6570\u503c\u7b26\u53f7\uff1a:+ \u6b63\u6570\u52a0\u6b63\u53f7\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7\uff0c:- \u539f\u6837\uff0c: \uff08\u7a7a\u683c\uff09\u6b63\u6570\u52a0\u7a7a\u683c\u3001\u8d1f\u6570\u52a0\u8d1f\u53f7 \u6570\u503c\u7cbe\u5ea6\uff1a:[ \u5bbd\u5ea6 ][ \u5206\u9694\u7b26 (,_)].[ \u7cbe\u5ea6 ]f\uff0c\u6ca1\u6709\u7cbe\u5ea6\u9ed8\u8ba4\u4e3a 6 \u8fdb\u5236\u663e\u793a\uff1ax \u5c0f\u5199\u5341\u516d\u8fdb\u5236\uff0cX \u5927\u5199\u5341\u516d\u8fdb\u5236\uff0co \u516b\u8fdb\u5236\uff0cb \u4e8c\u8fdb\u5236\uff0c\u52a0 # \u663e\u793a\u524d\u7f00","title":"\u5b57\u7b26\u4e32"},{"location":"cs/pl/python/basic/#_4","text":"\u7c7b\u4f3c\u5b57\u7b26\u4e32\uff0c\u4f46\u5b58\u50a8\u7684\u662f\u5b57\u8282\u7684\u503c\uff0c\u66f4\u50cf\u5217\u8868\uff0c\u663e\u793a\u4e3a b\"...\"\uff0c\u901a\u5e38\u7528\u4e8e\u7f51\u7edc\u6570\u636e\u4f20\u8f93\u3001\u4e8c\u8fdb\u5236\u56fe\u7247\u548c\u6587\u4ef6\u7684\u4fdd\u5b58\u7b49 \u901a\u8fc7bytes()\u751f\u6210bytes\u5b9e\u4f8b\uff0c\u503c\u7684\u5f62\u5f0f\u4e3ab\"...\"\uff0c\u7528\u4e0d\u540c\u7684\u7f16\u7801\u65b9\u5f0f\u4f1a\u5f62\u6210\u4e0d\u540c\u7684\u503c \u4e0e\u5b57\u7b26\u4e32\u8f6c\u6362 \"...\".encode(encoding) \u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32\uff0c\u9ed8\u8ba4 UTF-8 bytes_obj.decode(encoding) \u6839\u636e encoding \u89e3\u7801\u5b57\u8282\u5e8f\u5217\uff0c\u89e3\u7801\u5931\u8d25\u4f1a\u62a5\u9519 bytes(\"...\", encoding) \u4e5f\u662f\u6839\u636e encoding \u7f16\u7801\u5b57\u7b26\u4e32","title":"\u5b57\u8282\u7c7b\u578b"},{"location":"cs/pl/python/basic/#_5","text":"True \u548c False\uff0c \u9996\u5b57\u6bcd\u5927\u5199 \u53ef\u4ee5\u7528bool(...)\u6765\u8f6c\u6362 \u53ef\u4ee5\u7528 & | \u6765\u8868\u793a\u4e0e\u548c\u6216\uff0c\u4e00\u822c\u4f7f\u7528and or not \u8fdb\u884c\u8fd0\u7b97\uff08\u53ef\u7ec4\u5408\uff09","title":"\u5e03\u5c14\u7c7b\u578b"},{"location":"cs/pl/python/basic/#_6","text":"\u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u7684\u6570\u7ec4\uff0c\u4f46\u662f\u529f\u80fd\u66f4\u591a\uff0c\u800c\u4e14\u5185\u90e8\u5143\u7d20\u4e0d\u8981\u6c42\u540c\u4e00\u7c7b\u578b \u65b9\u62ec\u53f7 [] \u8868\u793a\u5217\u8868\uff0c\u5143\u7d20\u7528\u9017\u53f7\u5206\u9694 \u7d22\u5f15\uff08\u5373\u4e0b\u6807\uff09\u4ece 0 \u5f00\u59cb\u8ba1\u6570\uff0clst[n] \u5373\u8868\u793a\u8bbf\u95ee\u7b2c n+1 \u4e2a\u5143\u7d20 \u7d22\u5f15\u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u8d1f\u6570\u5373\u8868\u793a\u5012\u6570\uff0c\u4f8b lst[-2] \u8868\u793a\u5012\u6570\u7b2c\u4e8c\u4e2a\u5143\u7d20 \u5207\u7247\uff08\u83b7\u53d6\u5217\u8868\u4e2d\u7684\u4e00\u90e8\u5206\u503c\uff09 lst[a:b]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u7684\u5217\u8868 lst[:b]\uff1a\u4ece\u5f00\u5934\u5230 lst[b-1] \u7684\u5217\u8868 lst[a:]\uff1a\u4ece lst[a] \u5230\u7ed3\u5c3e\u7684\u5217\u8868 lst[:]\uff1a\u8868\u793a\u6574\u4e2a\u5217\u8868\uff08\u62f7\u8d1d\u4e00\u4efd\uff09 lst[a:b:c]\uff1a\u4ece lst[a] \u5230 lst[b-1] \u6bcf c \u4e2a\uff08\u5373\u6b65\u957f\uff09\u53d6\u4e00\u4e2a\u5f62\u6210\u7684\u5217\u8868 c \u53ef\u4ee5\u662f\u8d1f\u6570\uff0c\u6b64\u65f6\u9700\u8981 a > b \u624d\u80fd\u83b7\u53d6\u5230\u503c \u6709\u6b65\u957f\u65f6\u82e5\u7701\u7565 a\u3001b \u8bb0\u5f97\u4e0d\u8981\u7701\u7565\u5192\u53f7\uff0c\u4f8b lst[::-1] \u8868\u793a\u5217\u8868\u5012\u5e8f","title":"\u5217\u8868"},{"location":"cs/pl/python/basic/#_7","text":"\u4fee\u6539\u5143\u7d20\uff1a\u76f4\u63a5\u901a\u8fc7\u7d22\u5f15/\u5207\u7247\uff0c\u7136\u540e\u7b49\u53f7\u8d4b\u503c \u6709\u6808\u7684\u529f\u80fd lst.append(...) \u5728\u5217\u8868\u672b\u5c3e\u52a0\u5165\u5143\u7d20 lst.pop() \u5f39\u51fa\u5217\u8868\u672b\u5c3e\u5143\u7d20\u5e76\u8fd4\u56de \u4efb\u610f\u4f4d\u7f6e\u63d2\u5165\u5f39\u51fa lst.insert(i, x) \u5728\u7d22\u5f15 i \u7684\u4f4d\u7f6e\u63d2\u5165 x\uff0c\u540e\u9762\u4f9d\u6b21\u540e\u79fb lst.pop(i) \u5f39\u51fa\u7d22\u5f15 i \u4f4d\u7f6e\u7684\u5143\u7d20\uff0c\u540e\u9762\u4f9d\u6b21\u524d\u79fb \u5217\u8868\u62fc\u63a5 \u76f4\u63a5\u76f8\u52a0\uff0c\u4e0d\u6539\u53d8\u539f\u5217\u8868\uff0c\u5f97\u5230\u65b0\u7684\u5217\u8868 lst.extend([...])\uff0c\u628a\u4e00\u4e2a\u5217\u8868\u63a5\u5230\u5f53\u524d\u5217\u8868\u540e\u9762 \u6839\u636e\u503c\u5220\u9664\u5143\u7d20 lst.remove(value) \u5220\u9664\u7b2c\u4e00\u4e2a\u503c\u4e3a value \u7684\u5143\u7d20 \u6392\u5e8f\u5217\u8868 lst.sort() \u6c38\u4e45\u6392\u5e8f\uff08\u5373\u6392\u5e8f\u540e\u8d4b\u503c\u7ed9\u5f53\u524d\u5217\u8868\uff09 sorted(lst) \u4e34\u65f6\u6392\u5e8f\uff0c\u8fd4\u56de\u6392\u5e8f\u597d\u7684\u65b0\u5217\u8868 \u9ed8\u8ba4\u4ece\u5c0f\u5230\u5927\uff0c\u5982\u679c\u4f20\u5165 reverse=True \u5219\u4ece\u5927\u5230\u5c0f \u53cd\u8f6c\u5217\u8868 lst.reverse() \u6c38\u4e45\u53cd\u8f6c\uff08\u610f\u4e49\u540c\u4e0a\uff09 lst[::-1] \u8fd4\u56de\u53cd\u8f6c\u7684\u5217\u8868\uff08\u5229\u7528\u524d\u9762\u8bf4\u5230\u7684\u5207\u7247\uff09 \u7edf\u8ba1\u64cd\u4f5c len(lst) \u5f97\u5230\u5217\u8868\u7684\u957f\u5ea6 sum(lst) \u5f97\u5230\u5217\u8868\u7684\u5143\u7d20\u548c\uff08\u672c\u8d28\u4e0a\u662f\u5c06 start \u53c2\u6570\u548c\u6bcf\u4e2a\u5143\u7d20\u4f9d\u6b21\u76f8\u52a0\uff09 \u53ef\u4ee5\u4f20\u5165 start \u53c2\u6570\u7528\u6765\u6307\u5b9a\u52a0\u548c\u7684\u8d77\u59cb\u503c max(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5927\u503c min(lst) \u5f97\u5230\u5217\u8868\u4e2d\u7684\u6700\u5c0f\u503c","title":"\u5217\u8868\u64cd\u4f5c"},{"location":"cs/pl/python/basic/#_8","text":"\u53ef\u4ee5\u770b\u6210\u5143\u7d20\u4e0d\u53ef\u53d8\u7684\u5217\u8868\uff0c\u5185\u90e8\u4e5f\u53ef\u4ee5\u5305\u542b\u4e0d\u540c\u7c7b\u578b\u7684\u5143\u7d20 \u62ec\u53f7\u8868\u793a\u5143\u7ec4\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694 \u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u4e00\u6837\u7684\u65b9\u6cd5\u6765\u8bfb\u53d6\u5143\u7d20\uff0c\u4f46\u5e76\u4e0d\u80fd\u4fee\u6539 \u5f53\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u7684\u65f6\u5019\u8981\u5199\u6210 (a,) \u800c\u4e0d\u662f (a)\uff08\u540e\u8005\u662f\u5355\u4e2a\u503c\uff09 \u53ef\u4ee5\u4f7f\u7528 tuple(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\uff08\u5217\u8868\u3001\u5b57\u7b26\u4e32\u7b49\uff09\u8f6c\u4e3a\u5143\u7ec4 \u5143\u7ec4\u5e76\u4e0d\u80fd\u4fdd\u8bc1\u5143\u7d20\u5b8c\u5168\u4e0d\u53ef\u53d8 \u907f\u514d\u5728\u5143\u7ec4\u4e2d\u5b58\u653e\u53ef\u53d8\u5143\u7d20","title":"\u5143\u7ec4"},{"location":"cs/pl/python/basic/#_9","text":"\u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u5185\u90e8\u5143\u7d20\u95f4\u7528\u9017\u53f7\u5206\u9694\uff0c\u4f1a\u81ea\u52a8\u53bb\u91cd \u53ef\u7528 set(...) \u6765\u5c06\u53ef\u8fed\u4ee3\u5bf9\u8c61\u8f6c\u4e3a\u5143\u7ec4\uff0c\u81ea\u52a8\u53bb\u91cd \u96c6\u5408\u4e2d\u4e0d\u80fd\u5305\u542b\u5217\u8868\u7b49\u4e0d\u53ef hash \u5316\u7684\u5143\u7d20 \u4fee\u6539 s.add(...) \u6765\u52a0\u5165\u4e00\u4e2a\u5143\u7d20 s.remove(...) \u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u4f1a\u629b\u51fa\u5f02\u5e38 s.discard(...) \u6765\u5220\u9664\u4e00\u4e2a\u5143\u7d20\uff0c\u5982\u679c\u6ca1\u6709\u5219\u5ffd\u7565 \u8fd0\u7b97 s1 & s2\u3001s1 | s2\u3001s1 - s2 \u4ea4\u96c6\u3001\u5e76\u96c6\u3001\u5dee\u96c6 s1 ^ s2 \u5bf9\u79f0\u5dee\u96c6","title":"\u96c6\u5408"},{"location":"cs/pl/python/basic/#_10","text":"\u5b58\u50a8\u952e\u503c\u5bf9\uff0c\u4e5f\u662f\u5927\u62ec\u53f7\u62ec\u8d77\u6765\uff0c\u4e0d\u8fc7\u9017\u53f7\u5206\u9694\u7684\u662f\u952e\u503c\u5bf9 {key: value, ...} {} \u662f\u7a7a\u5b57\u5178\u800c\u4e0d\u662f\u7a7a\u96c6\u5408 \u901a\u8fc7 d[key] \u6765\u8bbf\u95ee\u5b57\u5178\u4e2d key \u5bf9\u5e94\u7684\u503c\uff0c\u53ef\u4ee5\u8bfb\u53d6\u3001\u4fee\u6539 \u6dfb\u52a0\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5\u901a\u8fc7 d[key] = value \u6765\u8fdb\u884c \u5220\u9664\u952e\u503c\u5bf9\u53ef\u4ee5\u76f4\u63a5 del d[key] \u901a\u8fc7 d[key] \u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728 key \u8fd9\u4e2a\u952e\u4f1a\u629b\u51fa\u5f02\u5e38 \u901a\u8fc7 d.get(key) \u6765\u8bbf\u95ee\u503c\u65f6\u5982\u679c\u4e0d\u5b58\u5728\u5219\u4f1a\u8fd4\u56de None \u4f7f\u7528 d.get(key, default) \u5982\u679c\u6ca1\u6709 key \u65f6\u4f1a\u8fd4\u56de default \u503c d.update(d2) \u6765\u7528 d2 \u4e2d\u7684\u952e\u503c\u5bf9\u66f4\u65b0 d","title":"\u5b57\u5178"},{"location":"cs/pl/python/basic/#_11","text":"","title":"\u6761\u4ef6\u5206\u652f"},{"location":"cs/pl/python/basic/#_12","text":"== \u5224\u65ad\u76f8\u7b49\uff08\u76f8\u7b49\u5219\u8fd4\u56de True\uff09\uff0c != \u5224\u65ad\u4e0d\u7b49 \u4f7f\u7528 and or not \u6765\u8fdb\u884c\u5e03\u5c14\u8fd0\u7b97\uff0c\u5fc5\u8981\u65f6\u52a0\u62ec\u53f7\u4fdd\u8bc1\u4f18\u5148\u7ea7 \u6570\u503c\u6bd4\u8f83\u5927\u5c0f < <= > >= \u5224\u65ad\u5143\u7d20\u662f\u5426\u5728\u5217\u8868\u4e2d value in lst\uff1a\u5982\u679c\u5728\u5219\u503c\u4e3a True value not in lst\uff1a\u5982\u679c\u5728\u5219\u4e3a False\uff08\u5224\u65ad\u662f\u5426\u4e0d\u5728\uff09 \u5224\u65ad\u952e\u662f\u5426\u5728\u5b57\u5178\u4e2d key in d\u3001key not in d \u4e0e\u5217\u8868\u540c\u7406","title":"\u5e03\u5c14\u8868\u8fbe\u5f0f"},{"location":"cs/pl/python/basic/#_13","text":"if-elif-else \u7ed3\u6784\uff08\u4e0d\u662f else if\uff09 elif\u3001else \u5747\u53ef\u4ee5\u7701\u7565 \u6761\u4ef6\u4e0d\u9700\u8981\u52a0\u62ec\u53f7\uff08\u52a0\u4e86\u4e5f\u6ca1\u95ee\u9898\uff09 condition \u4f1a\u88ab\u8f6c\u6362\u6210 bool \u7c7b\u578b\u7136\u540e\u5224\u65ad \u6ce8\u610f\u7f29\u8fdb \u7c7b\u4e09\u76ee\u8fd0\u7b97\u7b26\u5199\u6cd5 a if condition else b \u7c7b\u4f3c\u5176\u5b83\u8bed\u8a00\u4e2d\u7684 condition? a : b if-elif-else if condition1 : ... elif condition2 : ... elif condition3 : ... else : ...","title":"\u6761\u4ef6\u8bed\u53e5"},{"location":"cs/pl/python/basic/#_14","text":"\u7f29\u8fdb\u662f python \u4e2d\u5f88\u91cd\u8981\u7684\u4e1c\u897f\uff0cpython \u9760\u7f29\u8fdb\u6765\u5f97\u5230\u4ee3\u7801\u7ed3\u6784\uff0c\u800c\u4e0d\u662f\u5927\u62ec\u53f7 \u7f29\u8fdb\u53ef\u4ee5\u4f7f\u7528\u7a7a\u683c\u6216\u5236\u8868\u7b26 \u5982\u679c\u4e00\u4e9b\u4ee3\u7801\u5904\u4e8e\u540c\u4e00\u5c42\u7f29\u8fdb\u4e0b\uff0c\u5219\u5c5e\u4e8e\u540c\u4e00\u4e2a\u4ee3\u7801\u5757 \u540c\u4e00\u4e2a\u4ee3\u7801\u5757\u7684\u7f29\u8fdb\u8981\u7edf\u4e00 \u4e0d\u4ec5\u4ec5\u662f\u770b\u7740\u50cf\uff0c\u8981\u533a\u5206\u597d\u7a7a\u683c\u4e0e\u5236\u8868\u7b26 4 \u4e2a\u7a7a\u683c\u4e0e\u4e00\u4e2a\u663e\u793a\u5bbd\u5ea6\u4e3a 4 \u7684\u5236\u8868\u7b26\u5e76\u4e0d\u662f\u540c\u4e00\u7f29\u8fdb \u4e00\u822c\u4f7f\u7528 4 \u7a7a\u683c\u7f29\u8fdb\uff0c\u6216\u8005 1 \u5236\u8868\u7b26\u7f29\u8fdb \u7f16\u8f91\u5668\u4e2d\u6309 Tab \u6253\u51fa\u7684\u4e5f\u4e0d\u4e00\u5b9a\u662f\u5236\u8868\u7b26\uff0c\u8981\u5206\u6e05 \u7f29\u8fdb\u4e0d\u6b63\u786e\u4f1a\u62a5 IndentationError\uff0c\u6b64\u65f6\u6ce8\u610f\u68c0\u67e5\u7f29\u8fdb","title":"\u7f29\u8fdb"},{"location":"cs/pl/python/basic/#_15","text":"","title":"\u5faa\u73af"},{"location":"cs/pl/python/basic/#for","text":"python \u4e2d\u7684 for \u5faa\u73af\u5e76\u4e0d\u50cf c \u4e2d\u662f\u6307\u5b9a\u4e00\u4e2a\u53d8\u91cf\u7684\u53d8\u5316\u65b9\u5f0f\uff0c\u800c\u662f\u4ece\u5217\u8868/\u5143\u7ec4/\u8fed\u4ee3\u5668\u7b49\u53ef\u8fed\u4ee3\u5bf9\u8c61\u4e2d\u904d\u5386\u503c for \u5faa\u73af\u4f1a\u4ea7\u751f\u4e00\u4e2a\u7528\u4e8e\u5faa\u73af\u7684\u53d8\u91cf\uff0c\u8fd9\u4e2a\u53d8\u91cf\u5728\u5faa\u73af\u7ed3\u675f\u540e\u5e76\u4e0d\u4f1a\u5220\u9664\uff0c\u800c\u662f\u4fdd\u7559\u6700\u540e\u4e00\u6b21\u7684\u503c \u53ef\u4ee5\u4f7f\u7528 range \u6765\u751f\u6210\u4e00\u4e32\u6570\u5b57\u7528\u6765\u5faa\u73af range(a, b) \u751f\u6210\u4ece a \u5230 b-1 \u7684\u8fde\u7eed\u6574\u6570 range(a, b, c) \u4ee5 c \u4e3a\u6b65\u957f\u751f\u6210 range \u5f97\u5230\u7684\u5e76\u4e0d\u662f\u5217\u8868\uff0c\u5982\u679c\u8981\u7528\u5176\u751f\u6210\u5217\u8868\u8981\u4f7f\u7528 list(range(...)) for value in lst : ... for value in range ( ... ): ...","title":"for \u5faa\u73af"},{"location":"cs/pl/python/basic/#for_1","text":"\u6709\u4e09\u79cd\u65b9\u6cd5\u6765\u904d\u5386\u5b57\u5178 \u5728 d.keys() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u952e \u5728 d.values() \u4e2d\u5faa\u73af\u904d\u5386\u6240\u6709\u503c \u5728 d.items() \u4e2d\u904d\u5386\u952e\u503c\u5bf9\uff08\u9700\u8981\u89e3\u5305\uff09 for key in d . keys (): ... for value in d . values (): ... for item in d . items (): ... # item \u4e3a\u4e00\u4e2a\u5143\u7ec4 for key , value in d . items (): ... # \u5c06 item \u89e3\u5305","title":"for \u5faa\u73af\u904d\u5386\u5b57\u5178"},{"location":"cs/pl/python/basic/#_16","text":"\u8d4b\u503c\u65f6\u7b49\u53f7\u5de6\u4fa7\u53ef\u4ee5\u662f\u7528\u9017\u53f7\u5206\u9694\u7684\u591a\u4e2a\u503c\uff0c\u8fd9\u65f6\u4f1a\u5c06\u53f3\u4fa7\u89e3\u5305\u5206\u522b\u8d4b\u503c\u7ed9\u5de6\u4fa7\u7684\u5404\u4e2a\u53d8\u91cf \u53f3\u4fa7\u4e5f\u53ef\u4ee5\u662f\u591a\u4e2a\u503c\uff08\u53ea\u8981\u51fa\u73b0\u9017\u53f7\u5c31\u4f1a\u89c6\u4e3a\u4e00\u4e2a\u5143\u7ec4\uff09 \u53ef\u4ee5\u901a\u8fc7 a, b = b, a \u5b9e\u73b0\u5143\u7d20\u4ea4\u6362 \u661f\u53f7\u8868\u8fbe\u5f0f \u53ef\u4ee5\u7528\u6765\u5728\u53ef\u8fed\u4ee3\u5bf9\u8c61\u5185\u90e8\u89e3\u5305 \u4e5f\u53ef\u7528\u6765\u6807\u8bb0\u4e00\u4e2a\u53d8\u91cf\u5305\u542b\u591a\u4e2a\u503c for \u5faa\u73af\u53ef\u4ee5\u89e3\u5305 t = ( 1 , 2 , 3 ) a , b , c = t # a = 1, b = 2, c = 3 t = ( 1 , 2 , ( 3 , 4 )) a , b , ( c , d ) = t # c = 3, d = 4 l = [ 1 , 2 , * [ 3 , 4 ]] # [3, 4] \u88ab\u89e3\u5305 ## l = [1, 2, 3, 4] a , * b = [ 1 , 2 , 3 , 4 ] ## a = 1, b = [2, 3, 4] lst = [[ 1 , 2 ], [ 3 , 4 ]] for a , b in lst : ... # \u7b2c\u4e00\u6b21\u5faa\u73af a, b \u4e3a 1, 2 # \u7b2c\u4e8c\u6b21\u5faa\u73af a, b \u4e3a 3, 4","title":"\u5143\u7d20\u89e3\u5305"},{"location":"cs/pl/python/basic/#for_2","text":"enumerate \u8ba1\u6570 \u53ef\u4ee5\u6307\u5b9a\u521d\u59cb\u503c zip \u540c\u65f6\u5faa\u73af\u591a\u4e2a\u53ef\u8fed\u4ee3\u5bf9\u8c61 \u5faa\u73af\u6b21\u6570\u4e3a\u6700\u77ed\u7684\u5bf9\u8c61\u7684\u957f\u5ea6 for i , value in enumerate ( lst ): ... # i \u4f9d\u6b21\u4e3a 0\uff0c1\uff0c2\uff0c\u2026\u2026 for i , value in enumerate ( lst , 1 ): ... # i \u4f9d\u6b21\u4e3a 1\uff0c2\uff0c3\uff0c\u2026\u2026 for a , b in zip ( lst1 , lst2 ): ... # a \u5728 lst1 \u4e2d\u5faa\u73af # b \u5728 lst2 \u4e2d\u5faa\u73af","title":"for \u5faa\u73af\u6280\u5de7"},{"location":"cs/pl/python/basic/#_17","text":"\u4e00\u79cd\u5f88\u65b9\u4fbf\u7684\u751f\u6210\u5217\u8868\u7684\u65b9\u5f0f \u5373\u5728\u5217\u8868\u4e2d\u5305\u542b\u5faa\u73af\uff0c\u9010\u6b21\u8bb0\u5f55\u5faa\u73af\u524d\u8868\u8fbe\u5f0f\u7684\u503c \u53ef\u4ee5\u6709\u591a\u91cd\u5faa\u73af\uff0c\u5373\u751f\u6210\u7b1b\u5361\u5c14\u79ef \u53ef\u4ee5\u5305\u542b\u6761\u4ef6\uff0c\u5373\u5728\u6761\u4ef6\u6210\u7acb\u65f6\u624d\u8bb0\u5f55\u503c \u5217\u8868\u63a8\u5bfc\u4e2d\u7684\u5faa\u73af\u53d8\u91cf\u6709\u5c40\u90e8\u4f5c\u7528\u57df \u5373\u5728\u5217\u8868\u63a8\u5bfc\u5916\u4e0d\u80fd\u8bbf\u95ee\u5faa\u73af\u53d8\u91cf lst = [] for i in range ( 1 , 10 ): lst . append ( i ** 2 ) ## \u7b49\u4ef7\u4e8e lst = [ i ** 2 for i in range ( 1 , 10 )] lst1 = [ x * y for x in l1 for y in l2 ] lst2 = [ ... for ... in ... if ... ]","title":"\u5217\u8868\u63a8\u5bfc"},{"location":"cs/pl/python/basic/#_18","text":"\u53ef\u4ee5\u4f7f\u7528\u548c\u5217\u8868\u63a8\u5bfc\u7c7b\u4f3c\u7684\u65b9\u6cd5\u751f\u6210\u5143\u7ec4\u548c\u5b57\u5178 \u751f\u6210\u5143\u7ec4\u7684\u65f6\u5019\u8981\u7528 tuple() \u53ea\u5199 () \u7684\u8bdd\u5219\u53ea\u662f\u751f\u6210\u5668\u8868\u8fbe\u5f0f \u751f\u6210\u5b57\u5178\u65f6\u5faa\u73af\u524d\u7528 : \u5c06\u952e\u503c\u9694\u5f00 tuple ( i ** 2 for i in range ( 1 , 10 )) ( i ** 2 for i in range ( 1 , 10 )) ## ^ generator object { a : b for a in ... for b in ... }","title":"\u751f\u6210\u5143\u7ec4/\u5b57\u5178"},{"location":"cs/pl/python/basic/#_19","text":"\u548c\u5176\u5b83\u8bed\u8a00\u4e00\u6837\uff0c\u5728\u5faa\u73af\u4ee3\u7801\u5757\u4e2d\u53ef\u4ee5\u63a7\u5236\u5faa\u73af\u7684\u8fdb\u884c break \u7acb\u523b\u7ed3\u675f\u5faa\u73af continue \u7acb\u523b\u8fdb\u884c\u4e0b\u4e00\u8f6e\u5faa\u73af","title":"\u63a7\u5236\u5faa\u73af"},{"location":"cs/pl/python/basic/#while","text":"while \u5faa\u73af\u5373\u8fdb\u884c\u6761\u4ef6\u68c0\u67e5\uff0c\u5982\u679c\u4e3a True \u5219\u7ee7\u7eed\u8fd0\u884c\u76f4\u5230\u6761\u4ef6\u4e0d\u6ee1\u8db3\u505c\u6b62 while condition : ...","title":"while \u5faa\u73af"},{"location":"cs/pl/python/basic/#_20","text":"","title":"\u51fd\u6570"},{"location":"cs/pl/python/basic/#_21","text":"\u4f7f\u7528 def \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u51fd\u6570 \u5148\u51fd\u6570\u540d\uff0c\u7136\u540e\u62ec\u53f7\u5217\u51fa\u53c2\u6570\uff0c\u4e0b\u9762\u63a5\u4ee3\u7801\u5757 \u4f7f\u7528 return \u8fd4\u56de \u6ca1\u6709 return \u8fd0\u884c\u5230\u7ed3\u5c3e\uff0c\u8fd4\u56de None \u53ea\u6709 return\uff0c\u8fd4\u56de None return \u540e\u63a5\u5185\u5bb9\uff0c\u8fd4\u56de\u5185\u5bb9 return \u7684\u503c\u7c7b\u578b\u4e0d\u8981\u6c42\u4e00\u81f4 return \u53ef\u4ee5\u8fd4\u56de\u591a\u4e2a\u503c\uff08\u5229\u7528\u5143\u7ec4\uff09 def func_name ( arg1 , arg2 ): ... def func_name ( arg1 , arg2 ): ... return ... def func_name ( arg1 , arg2 ): ... return ... , ...","title":"\u51fd\u6570\u5b9a\u4e49"},{"location":"cs/pl/python/basic/#_22","text":"\u62ec\u53f7\u4e2d\u8981\u5217\u51fa\u53c2\u6570\u540d\uff0c\u4f9b\u51fd\u6570\u4f53\u5185\u4f7f\u7528 \u53ef\u4ee5\u5728\u53c2\u6570\u540e\u63a5\u7b49\u53f7\u8d4b\u9ed8\u8ba4\u503c \u4f7f\u7528\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5728\u8c03\u7528\u65f6\u53ef\u4ee5\u4e0d\u7528\u4f20 \u5229\u7528 * \u6765\u63a5\u6536\u4efb\u610f\u591a\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5143\u7ec4 * \u53c2\u6570\u540e\u9762\u4e0d\u80fd\u518d\u6709\u5176\u5b83\u975e\u5173\u952e\u5b57\u53c2\u6570 \u5229\u7528 ** \u6765\u63a5\u6536\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 \u63a5\u6536\u8fdb\u6765\u662f\u4e00\u4e2a\u5b57\u5178 def func ( arg1 , arg2 ): ... def func ( arg1 , arg2 = \"...\" ): # \u9ed8\u8ba4\u503c ... def func ( arg1 , * arg2 ): # \u4efb\u610f\u591a\u53c2\u6570 ... def func ( arg1 , ** arg2 ): # \u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570 ... def func ( arg1 , * arg2 , ** arg3 ): ... # *arg2 \u540e\u53ef\u4ee5\u52a0 **arg3","title":"\u51fd\u6570\u53c2\u6570"},{"location":"cs/pl/python/basic/#_23","text":"\u901a\u8fc7 \u51fd\u6570\u540d(\u53c2\u6570) \u6765\u8c03\u7528\u51fd\u6570\uff0c\u5f97\u5230\u8fd4\u56de\u503c \u76f4\u63a5\u4f20\u53c2\u7684\u8bdd\u8981\u5c06\u53c2\u6570\u4e0e\u5b9a\u4e49\u5bf9\u5e94\u4e0a \u901a\u8fc7\u5173\u952e\u5b57\u4f20\u53c2\uff08\u53c2\u6570\u540d\uff09\u53ef\u4ee5\u6253\u4e71\u987a\u5e8f \u5e26\u6709\u9ed8\u8ba4\u503c\u7684\u53c2\u6570\u5982\u679c\u4e0d\u4f20\u5219\u4f7f\u7528\u9ed8\u8ba4\u503c \u5982\u679c\u8bfb\u4efb\u610f\u591a\u5173\u952e\u5b57\u53c2\u6570\uff0c\u5219\u591a\u4f59\u7684\u8bfb\u5230\u5b57\u5178\u4e2d def func ( a , b ): ... func ( 1 , 2 ) # a = 1, b = 2 func ( b = 1 , a = 2 ) # a = 2, b = 1 def func2 ( a , ** b ): ... func2 ( a = 1 , b = 2 , c = 3 ) ## a = 1, b = {\"b\": 2, \"c\": 3}","title":"\u51fd\u6570\u8c03\u7528"},{"location":"cs/pl/python/basic/#_24","text":"python \u4e2d\u7684\u53d8\u91cf\u90fd\u662f\u5f15\u7528\u7684\uff08\u8fd9\u4e5f\u5c31\u662f\u4e3a\u4ec0\u4e48\u524d\u9762\u8bf4\u4e0d\u8981\u5c06\u53d8\u91cf\u7406\u89e3\u4e3a\u76d2\u5b50\uff09 \u7528 = \u5b9e\u9645\u4e0a\u662f\u5b9a\u4e49\u4e86\u4e00\u4e2a\u522b\u540d lst1 = lst2\uff0c\u5219 lst1 \u548c lst2 \u4f1a\u540c\u65f6\u53d8\u5316\uff08\u8981\u7528 [:] \u521b\u5efa\u526f\u672c\uff09 \u6570\u503c\u7c7b\u578b\u6709\u4f18\u5316\uff0c\u6240\u4ee5\u4e0d\u4f1a\u8fd9\u6837 == \u68c0\u67e5\u503c\u662f\u5426\u76f8\u7b49\uff0cis \u68c0\u67e5\u503c\u662f\u5426\u76f8\u540c \u89c2\u5bdf pythontutor.com \u51fd\u6570\u53c2\u6570\u4f20\u9012\u53ea\u6709\u201c\u5171\u4eab\u4f20\u53c2\u201d\u4e00\u79cd\u5f62\u5f0f\uff08\u5373\u4f20\u5f15\u7528\uff09 \u53ef\u53d8\u53d8\u91cf\uff08\u4f8b\u5982\u5217\u8868\uff09\u5728\u51fd\u6570\u5185\u90e8\u53ef\u4ee5\u88ab\u6539\u53d8 \u907f\u514d\u5411\u51fd\u6570\u4f20\u9012\u53ef\u53d8\u53d8\u91cf\uff08\u5217\u8868\u53ef\u4f20\u5165 [:] \u521b\u5efa\u7684\u526f\u672c\uff09","title":"*\u5f15\u7528\u53d8\u91cf"},{"location":"cs/pl/python/basic/#_25","text":"\u53ef\u4ee5\u901a\u8fc7 lambda \u8868\u8fbe\u5f0f\u6765\u5b9a\u4e49\u533f\u540d\u51fd\u6570 lambda \u8f93\u5165: \u8f93\u51fa\u8868\u8fbe\u5f0f \u53ef\u4ee5\u6709\u591a\u4e2a\u8f93\u5165 \u53ef\u4ee5\u5c06\u4e00\u4e2a\u51fd\u6570\u8d4b\u503c\u7ed9\u4e00\u4e2a\u53d8\u91cf \u907f\u514d\u7528 lambda \u8d4b\u503c\u7684\u5f62\u5f0f\u5b9a\u4e49\u51fd\u6570 \u4f8b\u5982 __name__ \u5c5e\u6027\u4e0d\u4f1a\u662f\u51fd\u6570\u540d\uff0c\u800c\u662f \"\\\" lambda a : a ** 2 + 2 * a + 1 ( lambda a : a ** 2 + 2 * a + 1 )( 2 ) # 9 lambda a , b : a * 2 + b f = lambda a : a ** 2 + 2 * a + 1 ## \u8fd1\u4f3c\u7b49\u4ef7\u4e8e def f ( a ): return a ** 2 + 2 * a + 1","title":"\u533f\u540d\u51fd\u6570"},{"location":"cs/pl/python/basic/#_26","text":"\u8bfb\u53d6\u7528\u6237\u8f93\u5165\u4f7f\u7528\u5185\u7f6e\u7684 input \u51fd\u6570 \u51fd\u6570\u53c2\u6570\u4e3a\u8981\u663e\u793a\u7684\u63d0\u793a\u7b26\uff0c\u4f8b\u5982 input(\"> \") \u51fd\u6570\u7684\u8fd4\u56de\u503c\u4e3a\u4e00\u4e2a\u5b57\u7b26\u4e32 \u6bcf\u6b21\u8bfb\u5165\u4e00\u884c\uff08\u5373\u8bfb\u5230\u6362\u884c\u4e3a\u6b62\uff09","title":"\u7528\u6237\u8f93\u5165"},{"location":"cs/pl/python/basic/#_27","text":"\u63a5\u6536\u51fd\u6570\u4f5c\u4e3a\u53c2\u6570\u7684\u51fd\u6570\u88ab\u79f0\u4e3a\u9ad8\u9636\u51fd\u6570 \u6bd4\u8f83\u5e38\u7528\u7684\u6709 map\u3001filter list ( map ( lambda x : x * 2 , [ 1 , 2 ])) ## [2, 4] list ( filter ( lambda x : x > 1 , [ 1 , 2 , 3 ])) ## [2, 3]","title":"\u9ad8\u9636\u51fd\u6570\u7528\u6cd5"},{"location":"cs/pl/python/basic/#_28","text":"","title":"\u7c7b\u4e0e\u9762\u5411\u5bf9\u8c61"},{"location":"cs/pl/python/basic/#_29","text":"\u7c7b\u53ef\u4ee5\u770b\u6210\u5305\u542b\u4e00\u4e9b \u5c5e\u6027 \u548c \u65b9\u6cd5 \u7684\u6846\u67b6 \u6839\u636e\u7c7b\u6765\u521b\u5efa\u5bf9\u8c61 -> \u5b9e\u4f8b\u5316 \u7528 class \u5173\u952e\u5b57\u6765\u5b9a\u4e49\u7c7b \u7c7b\u4e2d\u7684\u51fd\u6570 -> \u65b9\u6cd5 \u7279\u6b8a\u65b9\u6cd5 __init__\uff0c\u5728\u7c7b\u5b9e\u4f8b\u5316\u7684\u65f6\u5019\u4f1a\u88ab\u81ea\u52a8\u8c03\u7528 \u5176\u5b83\u4e00\u822c\u7684\u65b9\u6cd5\u7b2c\u4e00\u4e2a\u53c2\u6570\u90fd\u8981\u4e3a\"self\"\uff0c\u8c03\u7528\u7684\u65f6\u5019\u4f1a\u81ea\u52a8\u4f20\u5165 \u76f4\u63a5\u5199\u5728\u7c7b\u4e2d\u7684\u662f\u5c5e\u6027\uff0c\u4e5f\u53ef\u4ee5\u901a\u8fc7\u4e3a self.\\ \u8d4b\u503c\u7684\u5f62\u5f0f\u521b\u5efa\u5c5e\u6027 \u7528\u7c7b\u4f3c\u51fd\u6570\u8c03\u7528\u7684\u5f62\u5f0f\u5b9e\u4f8b\u5316\u7c7b\uff0c\u53c2\u6570\u4e3a__init__\u65b9\u6cd5\u7684\u53c2\u6570 \u76f4\u63a5\u901a\u8fc7 .\\ .\\ \u7684\u5f62\u5f0f\u8c03\u7528\u65b9\u6cd5/\u83b7\u53d6\u5c5e\u6027 class ClassName (): a = 1 def __init__ ( self , arg1 , arg2 ): self . arg1 = arg1 self . arg2 = arg2 def method ( self ): print ( self . arg1 , self . arg2 , self . a ) obj = ClassName ( 2 , 3 ) obj . method () # 2 3 1 print ( obj . a , obj . arg1 ) # 1 2","title":"\u7c7b"},{"location":"cs/pl/python/basic/#_30","text":"\u5728 class \u5b9a\u4e49\u7684\u62ec\u53f7\u4e2d\u52a0\u4e0a\u53e6\u4e00\u4e2a\u7c7b\u540d\u5219\u8868\u793a\u7ee7\u627f\u81ea\u90a3\u4e2a\u7c7b\u5b9a\u4e49\u4e00\u4e2a\u5b50\u7c7b \u5b50\u7c7b\u4f1a\u7ee7\u627f\u7236\u7c7b\u7684\u6240\u6709\u5c5e\u6027\u548c\u65b9\u6cd5 \u5b50\u7c7b\u7f16\u5199\u548c\u7236\u7c7b\u540d\u5b57\u4e00\u6837\u7684\u65b9\u6cd5\u4f1a \u91cd\u8f7d \u5728\u91cd\u8f7d\u7684\u65b9\u6cd5\u4e2d\u8c03\u7528\u7236\u7c7b\u7684\u539f\u65b9\u6cd5\u4f7f\u7528 super() \u4e5f\u53ef\u4ee5\u4e3a\u5b50\u7c7b\u5b9a\u4e49\u72ec\u6709\u7684\u65b9\u6cd5 class ClassA (): def __init__ ( self , a ): self . a = a def print ( self ): print ( self . a ) class ClassB ( ClassA ): def __init__ ( self , a ): super () . __init__ ( a ) self . a *= 2 obj = ClassB ( 1 ) obj . print () # 2","title":"\u7c7b\u7684\u7ee7\u627f"},{"location":"cs/pl/python/basic/#_31","text":"python \u4e2d\u7c7b\u5e76\u6ca1\u6709\u4e25\u683c\u79c1\u6709\u7684\u5c5e\u6027 \u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u4f1a\u88ab\u9690\u85cf\uff0c\u4e0d\u80fd\u76f4\u63a5\u8bfb\u53d6 \u4f46\u8fd9\u79cd\u5c5e\u6027\u53ef\u4ee5\u901a\u8fc7 _\u7c7b\u540d__\u5c5e\u6027 \u4f46\u65b9\u5f0f\u8bfb\u53d6\u5230 \u4f7f\u7528\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u7684\u5c5e\u6027\u53ef\u4ee5\u8f7b\u5fae\u4fdd\u62a4\u5c5e\u6027\uff0c\u4f46\u5e76\u4e0d\u4ee3\u8868\u5176\u662f\u79c1\u6709\u7684 class A (): a = 1 _a = 2 __a = 3 obj = A () print ( obj . a ) # 1 print ( obj . _a ) # 2 print ( obj . __a ) # AttributeError print ( obj . _A__a ) # 3","title":"\u79c1\u6709\uff1f"},{"location":"cs/pl/python/basic/#_32","text":"python \u4e2d\u5373\u4f7f\u6700\u7b80\u5355\u7684\u6574\u6570\u4e5f\u662f\u4e00\u4e2a\u7c7b\u7684\u5b9e\u4f8b \u901a\u8fc7 dir(...) \u67e5\u770b\u4e00\u4e2a\u5bf9\u8c61\u7684\u6240\u6709\u5c5e\u6027/\u65b9\u6cd5 \u6709\u5f88\u591a\u53cc\u4e0b\u5212\u7ebf\u5f00\u5934\u3001\u53cc\u4e0b\u5212\u7ebf\u7ed3\u5c3e\u7684\u65b9\u6cd5\uff0c\u6210\u4e3a\u9b54\u672f\u65b9\u6cd5\uff08dunder method\uff09","title":"\u4e00\u5207\u7686\u5bf9\u8c61\uff1f"},{"location":"cs/pl/python/basic/#_33","text":"\u5f88\u591a\u51fd\u6570\u3001\u8868\u8fbe\u5f0f\u5176\u5b9e\u662f\u901a\u8fc7\u8c03\u7528\u7c7b\u7684\u9b54\u672f\u65b9\u6cd5\u6765\u5b9e\u73b0\u7684 len(obj) \u8c03\u7528 obj.__len__() obj[...] \u8c03\u7528 obj.__getitem__(...) a in obj \u8c03\u7528 obj.__contains__(a) bool(obj) \u8c03\u7528 obj.__bool__() \u51fd\u6570\u7684\u8c03\u7528\u672c\u8d28\u4e0a\u662f\u8c03\u7528 func.__call__() a + b \u8c03\u7528 a.__add__(b) \u2026\u2026 \u4e00\u4e2a\u4f8b\u5b50\uff1a lst[a:b:c] \u5207\u7247\u64cd\u4f5c \u5176\u4e2d\u5207\u7247\u4e5f\u662f\u4e00\u4e2a\u5bf9\u8c61\uff0c\u5b83\u662f\u4e00\u4e2a slice \u7c7b\u7684\u5b9e\u4f8b \u6240\u4ee5\u5b83\u7b49\u4ef7\u4e8e lst[slice(a, b, c)] \u800c\u901a\u8fc7 [] \u7684\u64cd\u4f5c\u53c8\u662f\u901a\u8fc7 __getitem__ \u9b54\u672f\u65b9\u6cd5\u5b9e\u73b0\u7684 \u6240\u4ee5\u5b83\u53c8\u7b49\u4ef7\u4e8e lst.__getitem__(slice(a, b, c)) __getitem__ \u65b9\u6cd5\u4e2d\u5904\u7406\u4e86 slice\uff0c\u8bfb\u53d6 abc \u7684\u503c\uff0c\u518d\u5904\u7406\u8fd4\u56de\u4e00\u4e2a\u65b0\u5217\u8868","title":"\u9b54\u672f\u65b9\u6cd5"},{"location":"cs/pl/python/basic/#_34","text":"","title":"\u6742\u9879\u5185\u5bb9"},{"location":"cs/pl/python/basic/#_35","text":"open \u51fd\u6570\uff0c\u4f20\u5165\u6587\u4ef6\u540d\u3001\u6253\u5f00\u6a21\u5f0f \u6253\u5f00\u6a21\u5f0f\uff08\u53ef\u4ee5\u53e0\u52a0\uff09\uff1ar \u8bfb\uff08\u9ed8\u8ba4\uff09\u3001w \u5199\u3001x \u521b\u5efa\u5e76\u5199\u3001a \u5199\u5728\u672b\u5c3e\u3001b \u5b57\u8282\u6a21\u5f0f\u3001t \u6587\u672c\u6a21\u5f0f\uff08\u9ed8\u8ba4\uff09 \u8bfb\u53d6 \u6587\u672c\u6a21\u5f0f\u5efa\u8bae\u52a0\u4e0a encoding\uff0c\u4e0d\u7136\u5bb9\u6613\u62a5\u9519 f.read() \u8bfb\u53d6\u5168\u90e8\u5185\u5bb9\uff08\u5b57\u8282\u6a21\u5f0f\u5f97\u5230\u5b57\u8282\u5e8f\u5217\uff09 f.readline() \u8bfb\u53d6\u4e00\u884c f.readlines() \u8bfb\u53d6\u6240\u6709\u884c\uff0c\u8fd4\u56de\u4e00\u4e2a\u5217\u8868 \u5199\u5165 \u6587\u672c\u6a21\u5f0f\u540c\u6837\u5efa\u8bae\u52a0\u4e0a encoding f.write(...) \u76f4\u63a5\u5199\u5165 f.writelines(...) \u4f20\u5165\u5217\u8868\uff0c\u5143\u7d20\u95f4\u6362\u884c\u5199\u5165 \u901a\u8fc7\u8fd9\u79cd\u5f62\u5f0f\u64cd\u4f5c\u6587\u4ef6\u8bb0\u5f97\u7528\u5b8c\u540e\u8981 f.close() f = open ( \"filename\" , \"r\" , encoding = \"utf-8\" ) s = f . read () # a str ## line = f.readline() # a str ## lines = f.readlines() # a list ... f . close () f = open ( \"filename\" , \"w\" , encodeing = \"utf-8\" ) f . write ( \"...\" ) f . writelines ([ \"...\" , \"...\" ]) ... f . close ()","title":"\u6587\u4ef6\u64cd\u4f5c"},{"location":"cs/pl/python/basic/#with","text":"with ... as ...: \u5f00\u542f\u4e00\u4e2a\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668 \u5e38\u7528\u5728\u6587\u4ef6 open \u4e0a with \u5757\u5f00\u59cb\u81ea\u52a8\u6253\u5f00 with \u5757\u7ed3\u675f\u81ea\u52a8\u7ed3\u675f with \u5757\u7ed3\u675f\u540e\u53d8\u91cf\u4ecd\u4f1a\u7559\u5b58 with open ( \"file\" , \"r\" , encoding = \"utf-8\" ) as f : s = f . read () ... print ( f . closed ) # True","title":"with \u5757"},{"location":"cs/pl/python/basic/#_36","text":"\u4ea7\u751f\u9519\u8bef -> \u629b\u51fa\u5f02\u5e38 -> \u7a0b\u5e8f\u7ed3\u675f raise \u5173\u952e\u5b57\u629b\u51fa\u5f02\u5e38 try-except \u5757\u6355\u83b7\u5f02\u5e38 \u53ef\u4ee5\u6709\u591a\u4e2a except\u3001\u4e0d\u53ef\u4ee5\u6ca1\u6709 except \u540e\u63a5\u5f02\u5e38\u7c7b\uff08\u6ca1\u6709\u5219\u6355\u83b7\u6240\u6709\uff09 as \u5b57\u53e5\u5b58\u4e0b\u5f02\u5e38 finally \u8bed\u53e5 \u4e0d\u7ba1\u662f\u5426\u6709\u5f02\u5e38\u90fd\u4f1a\u8fd0\u884c raise ... raise RuntimeError ( \"...\" ) try : input ( \">>> \" ) except KeyboardInterrupt : print ( \"Good bye\" ) try : print ( 1 / 0 ) except ZeroDivisionError as e : print ( \"can't devide by zero\" ) raise e finally : print ( \"finished\" )","title":"\u5f02\u5e38\u4e0e\u5904\u7406"},{"location":"cs/pl/python/basic/#if-else","text":"else \u5757\u4e0d\u4ec5\u4ec5\u8ddf\u7740 if \u624d\u80fd\u4f7f\u7528 for-else for \u5faa\u73af\u7ed3\u675f\u624d\u4f1a\u8fd0\u884c for \u5faa\u73af\u88ab break \u4e86\u4e0d\u4f1a\u8fd0\u884c while-else condition \u4e0d\u6210\u7acb\u9000\u51fa\u624d\u4f1a\u8fd0\u884c \u5faa\u73af\u88ab break \u7ec8\u6b62\u4e86\u4e0d\u4f1a\u8fd0\u884c try-else try \u5757\u4e2d\u6ca1\u6709\u5f02\u5e38\u51fa\u73b0\u624d\u4f1a\u8fd0\u884c else \u5757\u4e2d\u5f02\u5e38\u4e0d\u4f1a\u88ab\u524d\u9762\u7684 except \u6355\u83b7 \u7a0b\u5e8f\u6d41\u8df3\u5230\u5757\u5916\u4e86\u4e0d\u4f1a\u8fd0\u884c\uff08return \u7b49\uff09 for value in lst : ... else : ... while condition : ... else : ... try : ... except ... : ... else : ...","title":"if \u5916\u7684 else \u8bed\u53e5"},{"location":"cs/pl/python/basic/#_37","text":"\u6a21\u5757\u53ef\u4ee5\u662f\u4e00\u4e2a\u5355\u72ec\u7684 .py \u6587\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u6587\u4ef6\u5939 \u6587\u4ef6\u5939\u76f8\u5f53\u4e8e\u5bfc\u5165\u5176\u4e0b __init__.py \u6587\u4ef6 \u6a21\u5757\u4e2d\u6b63\u5e38\u7f16\u5199\u51fd\u6570\u3001\u7c7b\u3001\u8bed\u53e5 \u901a\u8fc7 import \u8bed\u53e5\u5bfc\u5165\u6a21\u5757 import code import code as cd from code import ... from code import * \u5bfc\u5165\u65f6\u76f8\u5f53\u4e8e\u8fd0\u884c\u4e86\u4e00\u904d\u5bfc\u5165\u7684\u4ee3\u7801 ## code.py print ( \"hello\" ) def f (): print ( \"call func in code.py\" ) ... import code # hello code . f () import code as cd # hello cd . f () from code import f # hello f () from code import * # hello f ()","title":"\u6a21\u5757\u4e0e\u5bfc\u5165"},{"location":"cs/pl/python/basic/#main","text":"\u9632\u6b62\u5bfc\u5165\u65f6\u8fd0\u884c\u4ee3\u7801 \u53ea\u5141\u8bb8\u76f4\u63a5\u8fd0\u884c\u811a\u672c\u65f6\u8fd0\u884c \u901a\u8fc7\u5224\u65ad __name__ \u5982\u679c\u662f\u76f4\u63a5\u8fd0\u884c\uff0c\u5219\u5176\u7b49\u4e8e\u5b57\u7b26\u4e32 __main__ \u5982\u679c\u662f\u88ab\u5bfc\u5165\u7684\uff0c\u5219\u5176\u7b49\u4e8e\u6a21\u5757\u540d ## code.py ... if __name__ == \"__main__\" : print ( \"hello\" ) else : print ( __name__ ) import code # code $ python code.py # hello","title":"\u201dmain \u51fd\u6570\u201c"},{"location":"cs/pl/python/basic/#_38","text":"python \u81ea\u5e26\u4e86\u5f88\u591a\u5b9e\u7528\u7684\u6a21\u5757\uff08\u6807\u51c6\u5e93\uff09 os\u3001sys\uff1a\u7cfb\u7edf\u64cd\u4f5c math\uff1a\u6570\u5b66\u8fd0\u7b97 re\uff1a\u6b63\u5219\u8868\u8fbe\u5f0f datetime\uff1a\u65e5\u671f\u4e0e\u65f6\u95f4 subprocess\uff1a\u5b50\u8fdb\u7a0b\u7ba1\u7406 argparse\uff1a\u547d\u4ee4\u884c\u53c2\u6570\u89e3\u6790 logging\uff1a\u65e5\u5fd7\u8bb0\u5f55 hashlib\uff1a\u54c8\u5e0c\u8ba1\u7b97 random\uff1a\u968f\u673a\u6570 csv\u3001json\uff1a\u6570\u636e\u683c\u5f0f\u89e3\u6790 collections\uff1a\u66f4\u591a\u7c7b\u578b ... \u770b\u6587\u6863\uff1a docs.python.org/zh-cn/3/library","title":"\u5185\u90e8\u6a21\u5757"},{"location":"cs/pl/python/basic/#_39","text":"pypi.org \u4e0a\u6709\u6781\u591a\u522b\u4eba\u5199\u597d\u4e86\u53ef\u4ee5\u7528\u7684\u6a21\u5757 numpy \u77e9\u9635\u7b49\u79d1\u5b66\u8ba1\u7b97\u3001scipy \u79d1\u5b66\u8ba1\u7b97\u3001matplotlib \u4f5c\u56fe\u2026\u2026 \u4f7f\u7528 pip \u5b89\u88c5\uff08pip / python -m pip\uff09 pip install pkg_name pip install pkg_name=... \u6307\u5b9a\u7248\u672c pip install -r requirements.txt \u5b89\u88c5 txt \u6587\u4ef6\u4e2d\u7684\u6240\u6709\u5305 pip install ... -i https://pypi.tuna.tsinghua.edu.cn/simple \u6362\u6e90 pip list\u3001pip show \u547d\u4ee4\u67e5\u770b\u5b89\u88c5\u7684\u6240\u6709\u5305/\u67d0\u4e2a\u5305\u7684\u4fe1\u606f pip uninstall pkg_name \u5378\u8f7d\u5305 pip \u5b89\u88c5\u672c\u5730\u6a21\u5757 \u76ee\u5f55\u4e0b\u9700\u8981\u5305\u542b setup.py / pyproject.toml pip install . \u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u590d\u5236\u5230 site-packages \u4e2d\uff09 pip install -e . \u53ef\u4fee\u6539\u5f62\u5f0f\u5b89\u88c5\u672c\u5730\u6a21\u5757\uff08\u5728\u5f53\u524d\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u76f4\u63a5\u4fee\u6539\u4ee3\u7801\uff09","title":"\u5916\u90e8\u6a21\u5757\u5b89\u88c5"},{"location":"cs/pl/python/basic/#_40","text":"\u6a21\u5757\u5f00\u5934\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 \u7c7b\u3001\u51fd\u6570\u5b9a\u4e49\u4e0b\u9762\u7684\u4e09\u5f15\u53f7\u5b57\u7b26\u4e32 help(...) \u7684\u65f6\u5019\u53ef\u4ee5\u663e\u793a obj.__doc__ \u8868\u793a\u8fd9\u4e32\u5b57\u7b26\u4e32 \u7f16\u8f91\u5668\u7528\u6765\u63d0\u793a \u4e00\u4e9b\u6587\u6863\u751f\u6210\u5de5\u5177\uff08sphinx \u7b49\uff09\u4ece\u4e2d\u83b7\u53d6\u6587\u6863 \"\"\" docstring for module \"\"\" def func ( ... ): \"\"\"docstring for function\"\"\" ... class A (): \"\"\"docstring for class\"\"\" def __init__ ( self , ... ): \"\"\"docstring for method\"\"\" ...","title":"\u6587\u6863\u5b57\u7b26\u4e32"},{"location":"cs/pl/python/basic/#_41","text":"PEP\uff1aPython Enhancement Proposals\uff1a peps.python.org PEP 8 \u89c4\u8303\uff0c\u7ed9\u51fa\u4e86\u63a8\u8350\u4f7f\u7528\u7684 python \u4ee3\u7801\u98ce\u683c\u89c4\u8303 peps.python.org/pep-0008 pep8.org \u66f4\u7ec6\u81f4\u7684\u4ee3\u7801\u98ce\u683c black github.com/psf/black flake8 flake8.pycqa.org ...","title":"\u4ee3\u7801\u89c4\u8303"},{"location":"cs/pl/python/basic/#referencce","text":"Python3 \u83dc\u9e1f\u6559\u7a0b Python \u5b98\u65b9\u6587\u6863 Python\u7f16\u7a0b\uff1a\u4ece\u5165\u95e8\u5230\u5b9e\u8df5\uff08\u7b2c2\u7248\uff09 Python \u8bed\u6cd5\u57fa\u7840","title":"Referencce"},{"location":"cs/pl/python/numpy/","text":"Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93 \u00b6 \u7ea6 2778 \u4e2a\u5b57 140 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u5728\u5b66\u4e60 Python\uff0c\u5c24\u5176\u662f\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c\u6700\u57fa\u7840\u7684 Numpy \u5341\u5206\u91cd\u8981\uff0c\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u73af\u5883\uff0c\u6240\u4ee5\u5fc5\u987b\u8981\u719f\u7ec3\u638c\u63e1\u3002 Numpy \u901a\u5e38\u4e0e SciPy(Scientific Python) \u548c Matplotlib(\u7ed8\u56fe\u5e93) \u4e00\u8d77\u98df\u7528\uff0c\u76f8\u5f53\u4e8e\u66ff\u4ee3\u4e86 MatLab\u3002 ndarray \u00b6 \u5c5e\u6027 \u00b6 Numpy \u7684\u4e3b\u8981\u5bf9\u8c61\u65f6\u540c\u6784\u591a\u7ef4\u6570\u7ec4\u3002\u5b83\u662f\u4e00\u4e2a\u5143\u7d20\u8868\uff08\u901a\u5e38\u662f\u6570\u5b57\uff09\uff0c\u6240\u6709\u7c7b\u578b\u90fd\u76f8\u540c\uff0c\u7531\u975e\u8d1f\u6574\u6570\u5143\u7ec4\u7d22\u5f15\u3002\u5728 Numpy \u7ef4\u5ea6\u4e2d\u79f0\u4e3a \u8f74 \u3002 Numpy \u7684\u6570\u7ec4\u7c7b\u88ab\u8c03\u7528 ndarray \uff0c\u522b\u540d\u4e3a array \uff0c\u4f46\u548c Python \u7684 array.array \u533a\u522b\u5f88\u5927 ndarray.ndim : \u6570\u7ec4\u7684\u8f74\uff08\u7ef4\u5ea6\uff09\u7684\u4e2a\u6570\uff0c\u4e5f\u88ab\u79f0 rank ndarray.shape : \u6570\u7ec4\u7684\u7ef4\u5ea6\u3002\u4e00\u4e2a\u6574\u6570\u7684\u5143\u7956\uff0c\u8868\u793a\u6bcf\u4e2a\u7ef4\u5ea6\u4e2d\u6570\u7ec4\u7684\u5927\u5c0f\uff0cshape \u7684\u957f\u5ea6\u5c31\u662f rank \u6216\u7ef4\u5ea6\u7684\u4e2a\u6570 ndim ndarray.size : \u6570\u7ec4\u5143\u7d20\u7684\u603b\u6570\uff0c\u7b49\u4e8e shape \u5143\u7d20\u7684\u4e58\u79ef ndarray.dtype : \u63cf\u8ff0\u6570\u7ec4\u4e2d\u5143\u7d20\u7c7b\u578b\u7684\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684 Python \u7c7b\u578b\u521b\u5efa\u6216\u6307\u5b9a dtype\uff0c\u4e5f\u53ef\u4ee5\u7528 Numpy \u63d0\u4f9b\u7684\u4f8b\u5982 numpy.int32, numpy.float64 \u7b49 ndarray.itemsize : \u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u5b57\u8282\u5927\u5c0f\uff0c\u4f8b\u5982 float64 \u7684 itemsize \u5c31\u662f 64/8=8\uff0c\u7b49\u4e8e ndarray.dtype.itemsize ndarray.data : \u8be5\u7f13\u51b2\u533a\u5305\u542b\u6570\u7ec4\u7684\u5b9e\u9645\u5143\u7d20\uff0c\u901a\u5e38\u4e0d\u4f7f\u7528\uff0c\u53ea\u9700\u8981\u901a\u8fc7\u7d22\u5f15\u8bbf\u95ee element in ndarray >>> import numpy as np >>> a = np . arange ( 15 ) . reshape ( 3 , 5 ) >>> a array ([[ 0 , 1 , 2 , 3 , 4 ], [ 5 , 6 , 7 , 8 , 9 ], [ 10 , 11 , 12 , 13 , 14 ]]) >>> a . shape ( 3 , 5 ) >>> a . ndim 2 >>> a . dtype . name 'int64' >>> a . itemsize 8 >>> a . size 15 >>> type ( a ) < type 'numpy.ndarray' > >>> b = np . array ([ 6 , 7 , 8 ]) >>> b array ([ 6 , 7 , 8 ]) >>> type ( b ) < type 'numpy.ndarray' > \u6570\u7ec4\u521b\u5efa \u00b6 a=np.array([2,3,4]) :\u4ece Python \u5217\u8868\u6216\u5143\u7ec4\u4e2d\u521b\u5efa\u6570\u7ec4\uff08\u7c7b\u578b\u63a8\u5bfc\uff09 b=np.array([(1,2,3),(4,5,6)]) : \u53ef\u4ee5\u5c06\u5e8f\u5217\u7684\u5e8f\u5217\u8f6c\u6362\u6210\u4e8c\u7ef4\u6570\u7ec4\uff0c\u751a\u81f3\u9ad8\u7ef4\u6570\u7ec4 c=np.array([[],[]], dtype=complex) : \u521b\u5efa\u65f6\u53ef\u4ee5\u663e\u5f0f\u6307\u5b9a\u6570\u7ec4\u7684\u7c7b\u578b dtype=complex \u5360\u4f4d\u7b26\u6570\u7ec4\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7684 dtype \u90fd\u662f float64 \uff09 np.zero() : \u521b\u5efa\u4e00\u4e2a\u7531 0 \u7ec4\u6210\u7684\u6570\u7ec4 np.ones() : \u521b\u5efa\u4e00\u4e2a\u7531 1 \u7ec4\u6210\u7684\u6570\u7ec4 np.empty() : \u521b\u5efa\u4e00\u4e2a\u6570\u7ec4\uff0c\u5185\u5bb9\u968f\u673a\uff08\u53d6\u51b3\u4e8e\u5185\u5b58\u72b6\u6001\uff09 np.arange() \uff0c\u521b\u5efa\u6570\u5b57\u7ec4\u6210\u7684\u6570\u7ec4\uff0c\u7c7b\u4f3c\u4e8e range \u7684\u51fd\u6570 \u5f53\u4e0e\u6d6e\u70b9\u53c2\u6570\u4e00\u8d77\u4f7f\u7528\u65f6\uff0c\u6700\u597d\u4f7f\u7528 linspace \u51fd\u6570\u63a5\u53d7\u60f3\u8981\u7684\u5143\u7d20\u6570\u91cf\u7684\u51fd\u6570\uff0c\u800c\u4e0d\u662f\u6b65\u957f step \u6253\u5370\u6570\u7ec4 \u00b6 Numpy \u4ee5\u5d4c\u5957\u5217\u8868\u7c7b\u4f3c\u7684\u65b9\u5f0f\u663e\u793a\uff0c\u6709\u4ee5\u4e0b\u5e03\u5c40 \u6700\u540e\u4e00\u4e2a\u8f74\u4ece\u5de6\u5230\u53f3\u6253\u5370 \u5012\u6570\u7b2c\u4e8c\u4e2a\u4ece\u4e0a\u5230\u4e0b\u6253\u5370 \u5176\u4f59\u90e8\u5206\u4ece\u4e0a\u5230\u4e0b\u6253\u5370\uff0c\u6bcf\u4e2a\u5207\u7247\u7528\u7a7a\u884c\u9694\u5f00 \u5f53\u6570\u7ec4\u592a\u5927\u800c\u65e0\u6cd5\u6253\u5370\u65f6\uff0cNumpy \u4f1a\u81ea\u52a8\u8df3\u8fc7\u6570\u7ec4\u7684\u4e2d\u5fc3\u90e8\u5206\u5e76\u4ec5\u6253\u5370\u89d2\u70b9\u3002\u8981\u7981\u7528\u6b64\u884c\u4e3a\u5e76\u5f3a\u5236NumPy\u6253\u5370\u6574\u4e2a\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u66f4\u6539\u6253\u5370\u9009\u9879 set_printoptions print array >>> a = np . arange ( 6 ) # 1d array >>> print ( a ) [ 0 1 2 3 4 5 ] >>> >>> b = np . arange ( 12 ) . reshape ( 4 , 3 ) # 2d array >>> print ( b ) [[ 0 1 2 ] [ 3 4 5 ] [ 6 7 8 ] [ 9 10 11 ]] >>> >>> c = np . arange ( 24 ) . reshape ( 2 , 3 , 4 ) # 3d array >>> print ( c ) [[[ 0 1 2 3 ] [ 4 5 6 7 ] [ 8 9 10 11 ]] [[ 12 13 14 15 ] [ 16 17 18 19 ] [ 20 21 22 23 ]]] >>> >>> print ( np . arange ( 10000 )) # 10000d array [ 0 1 2 ... , 9997 9998 9999 ] >>> >>> print ( np . arange ( 10000 ) . reshape ( 100 , 100 )) [[ 0 1 2 ... , 97 98 99 ] [ 100 101 102 ... , 197 198 199 ] [ 200 201 202 ... , 297 298 299 ] ... , [ 9700 9701 9702 ... , 9797 9798 9799 ] [ 9800 9801 9802 ... , 9897 9898 9899 ] [ 9900 9901 9902 ... , 9997 9998 9999 ]] >>> >>> np . set_printoptions ( threshold = sys . maxsize ) # sys module should be imported \u57fa\u672c\u64cd\u4f5c \u00b6 \u6570\u7ec4\u4e0a\u7684\u7b97\u6570\u8fd0\u7b97\u7b26\u4f1a\u5e94\u7528\u5230\u5143\u7d20\u7ea7\u522b \u4e58\u6cd5 * \u5728 array \u4e2d\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u77e9\u9635\u4e58\u6cd5\u53ef\u4ee5\u7528 @ \u6216 dot \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97 \u67d0\u4e9b\u64cd\u4f5c\u4f8b\u5982 +=\u3001*= \u4f1a\u76f4\u63a5\u66f4\u6539\u88ab\u64cd\u4f5c\u7684\u77e9\u9635\u6570\u7ec4\u800c\u4e0d\u4f1a\u521b\u5efa\u65b0\u77e9\u9635\u6570\u7ec4 \u5f53\u4f7f\u7528\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u7ed3\u679c\u6570\u7ec4\u7684\u7c7b\u578b\u5bf9\u5e94\u4e8e\u66f4\u4e00\u822c\u6216\u66f4\u7cbe\u786e\u7684\u6570\u7ec4\uff08\u79f0\u4e3a\u5411\u4e0a\u8f6c\u6362\u7684\u884c\u4e3a\uff09 \u8bb8\u591a\u4e00\u5143\u64cd\u4f5c\uff0c\u4f8b\u5982\u8ba1\u7b97\u6570\u7ec4\u4e2d\u6240\u6709\u5143\u7d20\u7684\u603b\u548c\uff0c\u90fd\u662f\u4f5c\u4e3a ndarray \u7c7b\u7684\u65b9\u6cd5\u5b9e\u73b0\u7684 min() max() sum() \u901a\u8fc7\u6307\u5b9a axis \u53c2\u6570\uff0c\u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6307\u5b9a\u8f74\u5e94\u7528\u64cd\u4f5c \u901a\u51fd\u6570 \u00b6 NumPy \u63d0\u4f9b\u719f\u6089\u7684\u6570\u5b66\u51fd\u6570\uff0c\u4f8b\u5982 sin \uff0c cos \u548c exp \u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u88ab\u79f0\u4e3a\u201c\u901a\u51fd\u6570\u201d\uff08ufunc\uff09\u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u51fd\u6570\u5728\u6570\u7ec4\u4e0a\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u4ea7\u751f\u4e00\u4e2a\u6570\u7ec4\u4f5c\u4e3a\u8f93\u51fa\u3002 \u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3 \u00b6 \u4e00\u7ef4\u7684\u6570\u7ec4\u53ef\u4ee5\u8fdb\u884c\u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3\u64cd\u4f5c\u7684\uff0c\u5c31\u50cf \u5217\u8868 \u548c\u5176\u4ed6 Python \u5e8f\u5217\u7c7b\u578b\u4e00\u6837 \u591a\u7ef4\u7684\u6570\u7ec4\u6bcf\u4e2a\u8f74\u53ef\u4ee5\u6709\u4e00\u4e2a\u7d22\u5f15\u3002\u8fd9\u4e9b\u7d22\u5f15\u4ee5\u9017\u53f7\u200b\u200b\u5206\u9694\u7684\u5143\u7ec4\u7ed9\u51fa \u5f53\u63d0\u4f9b\u7684\u7d22\u5f15\u5c11\u4e8e\u8f74\u7684\u6570\u91cf\u65f6\uff0c\u7f3a\u5931\u7684\u7d22\u5f15\u88ab\u8ba4\u4e3a\u662f\u5b8c\u6574\u7684\u5207\u7247 \u53ef\u4ee5\u4f7f\u7528 ... \u8868\u793a\u4ea7\u751f\u5b8c\u6574\u7d22\u5f15\u5143\u7ec4\u6240\u9700\u7684\u5192\u53f7\uff08\u5269\u4f59\u8f74\uff09\uff0c\u7528\u6765\u66ff\u4ee3 : \u4f8b\u5982 x \u662f rank \u4e3a 5 \u7684\u6570\u7ec4 x[1,2,...] = x[1,2,:,:,:] x[...,3] = x[:,:,:,:,3] x[4,...,5,:] = x[4,:,:,5,:] \u5bf9\u591a\u7ef4\u6570\u7ec4\u8fdb\u884c \u8fed\u4ee3\uff08Iterating\uff09 \u662f\u76f8\u5bf9\u4e8e\u7b2c\u4e00\u4e2a\u8f74\u5b8c\u6210\u7684 \u5982\u679c\u60f3\u8981\u5bf9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6267\u884c\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528 flat \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u662f\u6570\u7ec4\u7684\u6240\u6709\u5143\u7d20\u7684\u8fed\u4ee3\u5668 \u5f62\u72b6\u64cd\u7eb5 \u00b6 \u6539\u53d8\u6570\u7ec4\u5f62\u72b6 \u00b6 a.shape() : \u67e5\u770b\u6570\u7ec4\u7684\u5f62\u72b6 ravel() : \u5c06\u6570\u7ec4\u5e73\u5766\u5e76\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4 reshape(i, j, ...size) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4\uff0c\u5982\u679c size \u6307\u5b9a\u4e3a -1\uff0c\u5219\u4f1a\u81ea\u52a8\u8ba1\u7b97\u5176\u4ed6\u7684 size \u5927\u5c0f resize(i, j, ...) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u4fee\u6539\u6570\u7ec4\u672c\u8eab T : \u5c06\u6570\u7ec4\u8f6c\u7f6e \u5c06\u4e0d\u540c\u6570\u7ec4\u5806\u53e0 \u00b6 vstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u5782\u76f4\u5806\u53e0 hstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u6a2a\u5411\u5806\u53e0 coulumn_stack : 1D \u6570\u7ec4\u4f5c\u4e3a\u5217\u5806\u53e0\u5230 2D \u6570\u7ec4\u4e2d\uff0c\u76f8\u5f53\u4e8e hstack 2D \u6570\u7ec4 row_stack : \u7b49\u6548\u4e8e vstack \u4e8e\u4efb\u4f55\u8f93\u5165\u6570\u7ec4 r_\u3001c_ : \u901a\u8fc7\u6cbf\u4e00\u4e2a\u8f74\u5806\u53e0\u6570\u7ec4\u6765\u521b\u5efa\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u8303\u56f4\u4e3a\u64cd\u4f5c\u7b26 : \u5c06\u4e00\u4e2a\u6570\u7ec4\u62c6\u5206\u6210\u51e0\u4e2a\u8f83\u5c0f\u7684\u6570\u7ec4 \u00b6 hsplit() : \u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6c34\u5e73\u8f74\u62c6\u5206\u6570\u7ec4\uff0c\u65b9\u6cd5\u662f\u6307\u5b9a\u8981\u8fd4\u56de\u7684\u5f62\u72b6\u76f8\u7b49\u7684\u6570\u7ec4\u7684\u6570\u91cf\uff0c\u6216\u8005\u6307\u5b9a\u5e94\u8be5\u5728\u5176\u4e4b\u540e\u8fdb\u884c\u5206\u5272\u7684\u5217 vsplit() : \u6cbf\u5782\u76f4\u8f74\u5206\u5272 \u62f7\u8d1d\u548c\u89c6\u56fe \u00b6 \u5b8c\u5168\u4e0d\u590d\u5236 \u00b6 \u7b80\u5355\u5206\u914d\u4e0d\u4f1a\u590d\u5236\u6570\u7ec4\u5bf9\u8c61\u6216\u5176\u6570\u636e Python\u5c06\u53ef\u53d8\u5bf9\u8c61\u4f5c\u4e3a\u5f15\u7528\u4f20\u9012\uff0c\u56e0\u6b64\u51fd\u6570\u8c03\u7528\u4e0d\u4f1a\u590d\u5236 \u89c6\u56fe\u6216\u6d45\u62f7\u8d1d \u00b6 \u4e0d\u540c\u7684\u6570\u7ec4\u5bf9\u8c61\u53ef\u4ee5\u5171\u4eab\u76f8\u540c\u7684\u6570\u636e view() : \u521b\u5efa\u4e00\u4e2a\u67e5\u770b\u76f8\u540c\u6570\u636e\u7684\u65b0\u6570\u7ec4\u5bf9\u8c61 \u5207\u7247\u6570\u7ec4\u4f1a\u8fd4\u56de\u4e00\u4e2a\u89c6\u56fe \u6df1\u62f7\u8d1d \u00b6 copy() : \u751f\u6210\u6570\u7ec4\u53ca\u5176\u6570\u636e\u7684\u5b8c\u6574\u526f\u672c \u5982\u679c\u4e0d\u518d\u9700\u8981\u539f\u59cb\u6570\u7ec4\uff0c\u5219\u5e94\u5728\u5207\u7247\u540e\u8c03\u7528 copy() \u5e7f\u64ad \u00b6 \u5e7f\u64ad(Broadcast)\u662f numpy \u5bf9\u4e0d\u540c\u5f62\u72b6(shape)\u7684\u6570\u7ec4\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\u7684\u65b9\u5f0f\uff0c \u5bf9\u6570\u7ec4\u7684\u7b97\u672f\u8fd0\u7b97\u901a\u5e38\u5728\u76f8\u5e94\u7684\u5143\u7d20\u4e0a\u8fdb\u884c \u5982\u679c\u4e24\u4e2a\u6570\u7ec4 a \u548c b \u5f62\u72b6\u76f8\u540c\uff0c\u5373\u6ee1\u8db3 a.shape == b.shape\uff0c\u90a3\u4e48 a*b \u7684\u7ed3\u679c\u5c31\u662f a \u4e0e b \u6570\u7ec4\u5bf9\u5e94\u4f4d\u76f8\u4e58 \u5f53\u8fd0\u7b97\u4e2d\u7684 2 \u4e2a\u6570\u7ec4\u7684\u5f62\u72b6\u4e0d\u540c\u65f6\uff0cnumpy \u5c06\u81ea\u52a8\u89e6\u53d1\u5e7f\u64ad\u673a\u5236 \u89c4\u5219: \u5bf9\u4e24\u4e2a\u6570\u7ec4\uff0c\u5206\u522b\u6bd4\u8f83\u4ed6\u4eec\u7684\u6bcf\u4e00\u4e2a\u7ef4\u5ea6\uff08\u82e5\u5176\u4e2d\u4e00\u4e2a\u6570\u7ec4\u6ca1\u6709\u5f53\u524d\u7ef4\u5ea6\u5219\u5ffd\u7565\uff09 \u6570\u7ec4\u62e5\u6709\u76f8\u540c\u5f62\u72b6 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u76f8\u7b49 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u6709\u4e00\u4e2a\u662f 1 \u82e5\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c\u629b\u51fa \"ValueError: frames are not aligned\" \u5f02\u5e38 \u7d22\u5f15\u6280\u5de7 \u00b6 \u6574\u6570\u6570\u7ec4\u7d22\u5f15 \u00b6 \u6574\u6570\u6570\u7ec4\u7d22\u5f15\u662f\u6307\u4f7f\u7528\u4e00\u4e2a\u6570\u7ec4\u6765\u8bbf\u95ee\u53e6\u4e00\u4e2a\u6570\u7ec4\u7684\u5143\u7d20\u3002\u8fd9\u4e2a\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u76ee\u6807\u6570\u7ec4\u4e2d\u67d0\u4e2a\u7ef4\u5ea6\u4e0a\u7684\u7d22\u5f15\u503c\u3002 >>> a = np . arange ( 12 ) ** 2 # the first 12 square numbers >>> i = np . array ( [ 1 , 1 , 3 , 8 , 5 ] ) # an array of indices >>> a [ i ] # the elements of a at the positions i array ([ 1 , 1 , 9 , 64 , 25 ]) >>> >>> j = np . array ( [ [ 3 , 4 ], [ 9 , 7 ] ] ) # a bidimensional array of indices >>> a [ j ] # the same shape as j array ([[ 9 , 16 ], [ 81 , 49 ]]) \u5e03\u5c14\u6570\u7ec4\u7d22\u5f15 \u00b6 \u5e03\u5c14\u7d22\u5f15\u901a\u8fc7\u5e03\u5c14\u8fd0\u7b97\uff08\u5982\uff1a\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff09\u6765\u83b7\u53d6\u7b26\u5408\u6307\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u6570\u7ec4 >>> a = np . arange ( 12 ) . reshape ( 3 , 4 ) >>> b = a > 4 >>> b # b is a boolean with a's shape array ([[ False , False , False , False ], [ False , True , True , True ], [ True , True , True , True ]]) >>> a [ b ] # 1d array with the selected elements array ([ 5 , 6 , 7 , 8 , 9 , 10 , 11 ]) ix_()\u51fd\u6570 \u00b6 ix_ \u51fd\u6570\u53ef\u7528\u4e8e\u7ec4\u5408\u4e0d\u540c\u7684\u5411\u91cf\uff0c\u4ee5\u4fbf\u83b7\u5f97\u6bcf\u4e2an-uplet\u7684\u7ed3\u679c >>> a = np . array ([ 2 , 3 , 4 , 5 ]) >>> b = np . array ([ 8 , 5 , 4 ]) >>> c = np . array ([ 5 , 4 , 6 , 8 , 3 ]) >>> ax , bx , cx = np . ix_ ( a , b , c ) >>> ax array ([[[ 2 ]], [[ 3 ]], [[ 4 ]], [[ 5 ]]]) >>> bx array ([[[ 8 ], [ 5 ], [ 4 ]]]) >>> cx array ([[[ 5 , 4 , 6 , 8 , 3 ]]]) >>> ax . shape , bx . shape , cx . shape (( 4 , 1 , 1 ), ( 1 , 3 , 1 ), ( 1 , 1 , 5 )) >>> result = ax + bx * cx >>> result array ([[[ 42 , 34 , 50 , 66 , 26 ], [ 27 , 22 , 32 , 42 , 17 ], [ 22 , 18 , 26 , 34 , 14 ]], [[ 43 , 35 , 51 , 67 , 27 ], [ 28 , 23 , 33 , 43 , 18 ], [ 23 , 19 , 27 , 35 , 15 ]], [[ 44 , 36 , 52 , 68 , 28 ], [ 29 , 24 , 34 , 44 , 19 ], [ 24 , 20 , 28 , 36 , 16 ]], [[ 45 , 37 , 53 , 69 , 29 ], [ 30 , 25 , 35 , 45 , 20 ], [ 25 , 21 , 29 , 37 , 17 ]]]) >>> result [ 3 , 2 , 4 ] 17 >>> a [ 3 ] + b [ 2 ] * c [ 4 ] 17 \u4f4d\u8fd0\u7b97 \u00b6 bitwise_and() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u4e0e\u64cd\u4f5c bitwise_or() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u6216\u64cd\u4f5c invert() : \u6309\u4f4d\u53d6\u53cd left_shift() : \u5411\u5de6\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d right_shift() : \u5411\u53f3\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d \u51fd\u6570 \u00b6 \u5b57\u7b26\u4e32\u51fd\u6570 \u00b6 add() : \u5bf9\u4e24\u4e2a\u6570\u7ec4\u7684\u9010\u4e2a\u5b57\u7b26\u4e32\u5143\u7d20\u8fdb\u884c\u8fde\u63a5 multiply() : \u8fd4\u56de\u6309\u5143\u7d20\u591a\u91cd\u8fde\u63a5\u540e\u7684\u5b57\u7b26\u4e32 center() : \u5c45\u4e2d\u5b57\u7b26\u4e32 capitalize() : \u5c06\u5b57\u7b26\u4e32\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 title() : \u5c06\u5b57\u7b26\u4e32\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 lower() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5c0f\u5199 upper() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5927\u5199 split() : \u6307\u5b9a\u5206\u9694\u7b26\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u5206\u5272\uff0c\u5e76\u8fd4\u56de\u6570\u7ec4\u5217\u8868 splitlines() : \u8fd4\u56de\u5143\u7d20\u4e2d\u7684\u884c\u5217\u8868\uff0c\u4ee5\u6362\u884c\u7b26\u5206\u5272 strip() : \u79fb\u9664\u5143\u7d20\u5f00\u5934\u6216\u8005\u7ed3\u5c3e\u5904\u7684\u7279\u5b9a\u5b57\u7b26 join() : \u901a\u8fc7\u6307\u5b9a\u5206\u9694\u7b26\u6765\u8fde\u63a5\u6570\u7ec4\u4e2d\u7684\u5143\u7d20 replace() : \u4f7f\u7528\u65b0\u5b57\u7b26\u4e32\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b50\u5b57\u7b26\u4e32 decode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.decode encode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.encode \u6570\u5b66\u51fd\u6570 \u00b6 sin(), cos(), tan() \u7b49\u4e09\u89d2\u51fd\u6570 around() : \u8fd4\u56de\u6307\u5b9a\u6570\u5b57\u7684\u56db\u820d\u4e94\u5165\u503c floor() : \u8fd4\u56de\u5c0f\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5927\u6574\u6570\uff0c\u5373\u5411\u4e0b\u53d6\u6574 ceil() : \u8fd4\u56de\u5927\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5c0f\u6574\u6570\uff0c\u5373\u5411\u4e0a\u53d6\u6574 \u7b97\u6570\u51fd\u6570 \u00b6 add()\uff0csubtract()\uff0cmultiply() \u548c divide() reciprocal() : \u8fd4\u56de\u53c2\u6570\u9010\u5143\u7d20\u7684\u5012\u6570,\u5982 1/4 \u5012\u6570\u4e3a 4/1 power() : \u5c06\u7b2c\u4e00\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u4f5c\u4e3a\u5e95\u6570\uff0c\u8ba1\u7b97\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u5e42 mod() : \u8ba1\u7b97\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u76f8\u9664\u540e\u7684\u4f59\u6570 \u7edf\u8ba1\u51fd\u6570 \u00b6 amin() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5c0f\u503c amax() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5927\u503c ptp() : \u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u6700\u5927\u503c\u4e0e\u6700\u5c0f\u503c\u7684\u5dee\uff08\u6700\u5927\u503c - \u6700\u5c0f\u503c\uff09 percentile() : \u767e\u5206\u4f4d\u6570\u662f\u7edf\u8ba1\u4e2d\u4f7f\u7528\u7684\u5ea6\u91cf\uff0c\u8868\u793a\u5c0f\u4e8e\u8fd9\u4e2a\u503c\u7684\u89c2\u5bdf\u503c\u7684\u767e\u5206\u6bd4 median() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4 a \u4e2d\u5143\u7d20\u7684\u4e2d\u4f4d\u6570\uff08\u4e2d\u503c\uff09 mean() : \u8fd4\u56de\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u7b97\u672f\u5e73\u5747\u503c\uff0c\u5982\u679c\u63d0\u4f9b\u4e86\u8f74\uff0c\u5219\u6cbf\u5176\u8ba1\u7b97 average() : \u6839\u636e\u5728\u53e6\u4e00\u4e2a\u6570\u7ec4\u4e2d\u7ed9\u51fa\u7684\u5404\u81ea\u7684\u6743\u91cd\u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u52a0\u6743\u5e73\u5747\u503c sqrt(mean((x - x.mean())**2)) : \u6807\u51c6\u5dee\u516c\u5f0f mean((x - x.mean())** 2) : \u65b9\u5dee \u6392\u5e8f\u3001\u6761\u4ef6\u7b5b\u9009\u51fd\u6570 \u00b6 sort() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u7684\u6392\u5e8f\u526f\u672c lexsort() : \u7528\u4e8e\u5bf9\u591a\u4e2a\u5e8f\u5217\u8fdb\u884c\u6392\u5e8f nonzero() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u975e\u96f6\u5143\u7d20\u7684\u7d22\u5f15 where() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u6ee1\u8db3\u7ed9\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u7d22\u5f15 extract() : \u6839\u636e\u67d0\u4e2a\u6761\u4ef6\u4ece\u6570\u7ec4\u4e2d\u62bd\u53d6\u5143\u7d20\uff0c\u8fd4\u56de\u6ee1\u6761\u4ef6\u7684\u5143\u7d20 \u7ebf\u6027\u4ee3\u6570 \u00b6 numpy.dot() : \u4e24\u4e2a\u6570\u7ec4\u7684\u70b9\u79ef\uff0c\u5373\u5143\u7d20\u5bf9\u5e94\u76f8\u4e58 numpy.vdot() : \u4e24\u4e2a\u5411\u91cf\u7684\u70b9\u79ef numpy.inner() : \u4e24\u4e2a\u6570\u7ec4\u7684\u5185\u79ef numpy.matmul() : \u4e24\u4e2a\u6570\u7ec4\u7684\u77e9\u9635\u79ef numpy.determinant() : \u6570\u7ec4\u7684\u884c\u5217\u5f0f numpy.solve() : \u6c42\u89e3\u7ebf\u6027\u77e9\u9635\u65b9\u7a0b numpy.inv() : \u8ba1\u7b97\u77e9\u9635\u7684\u4e58\u6cd5\u9006\u77e9\u9635 numpy.matlib.empty() : \u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u77e9\u9635\uff0c\u5143\u7d20\u968f\u673a numpy.matlib.zeros() : \u521b\u5efa\u4e00\u4e2a\u4ee5 0 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.one() : \u521b\u5efa\u4e00\u4e2a\u4ee5 1 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.eye() : \u8fd4\u56de\u4e00\u4e2a\u77e9\u9635\uff0c\u5bf9\u89d2\u7ebf\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4e3a\u96f6 numpy.matlib.identity() : \u8fd4\u56de\u7ed9\u5b9a\u5927\u5c0f\u7684\u5355\u4f4d\u77e9\u9635 numpy.matlib.rand() : \u521b\u5efa\u4e00\u4e2a\u7ed9\u5b9a\u5927\u5c0f\u7684\u77e9\u9635\uff0c\u6570\u636e\u662f\u968f\u673a\u586b\u5145\u7684 \u5176\u4ed6 \u00b6 \u201c\u81ea\u52a8\u201d\u6574\u5f62 \u00b6 \u8981\u66f4\u6539\u6570\u7ec4\u7684\u5c3a\u5bf8\uff0c\u60a8\u53ef\u4ee5\u7701\u7565\u5176\u4e2d\u4e00\u4e2a\u5c3a\u5bf8\uff0c\u7136\u540e\u81ea\u52a8\u63a8\u5bfc\u51fa\u5c3a\u5bf8 >>> a = np . arange ( 30 ) >>> a . shape = 2 , - 1 , 3 # -1 means \"whatever is needed\" >>> a . shape ( 2 , 5 , 3 ) >>> a array ([[[ 0 , 1 , 2 ], [ 3 , 4 , 5 ], [ 6 , 7 , 8 ], [ 9 , 10 , 11 ], [ 12 , 13 , 14 ]], [[ 15 , 16 , 17 ], [ 18 , 19 , 20 ], [ 21 , 22 , 23 ], [ 24 , 25 , 26 ], [ 27 , 28 , 29 ]]]) \u77e2\u91cf\u5806\u53e0 \u00b6 \u901a\u8fc7 vstack \u7b49\u5c06\u6570\u7ec4\u5806\u53e0 x = np . arange ( 0 , 10 , 2 ) # x=([0,2,4,6,8]) y = np . arange ( 5 ) # y=([0,1,2,3,4]) m = np . vstack ([ x , y ]) # m=([[0,2,4,6,8], # [0,1,2,3,4]]) xy = np . hstack ([ x , y ]) # xy =([0,2,4,6,8,0,1,2,3,4]) \u76f4\u65b9\u56fe \u00b6 histogram\u5e94\u7528\u4e8e\u6570\u7ec4\u7684NumPy \u51fd\u6570\u8fd4\u56de\u4e00\u5bf9\u5411\u91cf\uff1a\u6570\u7ec4\u7684\u76f4\u65b9\u56fe\u548cbin\u7684\u5411\u91cf\u3002matplotlib\u8fd8\u6709\u4e00\u4e2a\u6784\u5efa\u76f4\u65b9\u56fe\u7684\u529f\u80fd\uff08hist\u5728Matlab\u4e2d\u79f0\u4e3a\uff09\uff0c\u4e0eNumPy\u4e2d\u7684\u76f4\u65b9\u56fe\u4e0d\u540c\u3002\u4e3b\u8981\u533a\u522b\u5728\u4e8epylab.hist\u81ea\u52a8\u7ed8\u5236\u76f4\u65b9\u56fe\uff0c\u800c numpy.histogram\u53ea\u751f\u6210\u6570\u636e >>> import numpy as np >>> import matplotlib.pyplot as plt >>> # Build a vector of 10000 normal deviates with variance 0.5^2 and mean 2 >>> mu , sigma = 2 , 0.5 >>> v = np . random . normal ( mu , sigma , 10000 ) >>> # Plot a normalized histogram with 50 bins >>> plt . hist ( v , bins = 50 , density = 1 ) # matplotlib version (plot) >>> plt . show () >>> # Compute the histogram with numpy and then plot it >>> ( n , bins ) = np . histogram ( v , bins = 50 , density = True ) # NumPy version (no plot) >>> plt . plot ( .5 * ( bins [ 1 :] + bins [: - 1 ]), n ) >>> plt . show () Reference \u00b6 Numpy \u5b98\u7f51 SciPy \u5b98\u7f51 Matplotlib \u5b98\u7f51 \u83dc\u9e1f\u6559\u7a0b Numpy \u5feb\u901f\u5165\u95e8 Numpy \u6570\u636e\u53ef\u89c6\u5316","title":"Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93"},{"location":"cs/pl/python/numpy/#numpy","text":"\u7ea6 2778 \u4e2a\u5b57 140 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u5728\u5b66\u4e60 Python\uff0c\u5c24\u5176\u662f\u673a\u5668\u5b66\u4e60\u9886\u57df\uff0c\u6700\u57fa\u7840\u7684 Numpy \u5341\u5206\u91cd\u8981\uff0c\u63d0\u4f9b\u4e00\u4e2a\u5f3a\u5927\u7684\u79d1\u5b66\u8ba1\u7b97\u73af\u5883\uff0c\u6240\u4ee5\u5fc5\u987b\u8981\u719f\u7ec3\u638c\u63e1\u3002 Numpy \u901a\u5e38\u4e0e SciPy(Scientific Python) \u548c Matplotlib(\u7ed8\u56fe\u5e93) \u4e00\u8d77\u98df\u7528\uff0c\u76f8\u5f53\u4e8e\u66ff\u4ee3\u4e86 MatLab\u3002","title":"Numpy \u79d1\u5b66\u8ba1\u7b97\u5e93"},{"location":"cs/pl/python/numpy/#ndarray","text":"","title":"ndarray"},{"location":"cs/pl/python/numpy/#_1","text":"Numpy \u7684\u4e3b\u8981\u5bf9\u8c61\u65f6\u540c\u6784\u591a\u7ef4\u6570\u7ec4\u3002\u5b83\u662f\u4e00\u4e2a\u5143\u7d20\u8868\uff08\u901a\u5e38\u662f\u6570\u5b57\uff09\uff0c\u6240\u6709\u7c7b\u578b\u90fd\u76f8\u540c\uff0c\u7531\u975e\u8d1f\u6574\u6570\u5143\u7ec4\u7d22\u5f15\u3002\u5728 Numpy \u7ef4\u5ea6\u4e2d\u79f0\u4e3a \u8f74 \u3002 Numpy \u7684\u6570\u7ec4\u7c7b\u88ab\u8c03\u7528 ndarray \uff0c\u522b\u540d\u4e3a array \uff0c\u4f46\u548c Python \u7684 array.array \u533a\u522b\u5f88\u5927 ndarray.ndim : \u6570\u7ec4\u7684\u8f74\uff08\u7ef4\u5ea6\uff09\u7684\u4e2a\u6570\uff0c\u4e5f\u88ab\u79f0 rank ndarray.shape : \u6570\u7ec4\u7684\u7ef4\u5ea6\u3002\u4e00\u4e2a\u6574\u6570\u7684\u5143\u7956\uff0c\u8868\u793a\u6bcf\u4e2a\u7ef4\u5ea6\u4e2d\u6570\u7ec4\u7684\u5927\u5c0f\uff0cshape \u7684\u957f\u5ea6\u5c31\u662f rank \u6216\u7ef4\u5ea6\u7684\u4e2a\u6570 ndim ndarray.size : \u6570\u7ec4\u5143\u7d20\u7684\u603b\u6570\uff0c\u7b49\u4e8e shape \u5143\u7d20\u7684\u4e58\u79ef ndarray.dtype : \u63cf\u8ff0\u6570\u7ec4\u4e2d\u5143\u7d20\u7c7b\u578b\u7684\u5bf9\u8c61\u3002\u53ef\u4ee5\u4f7f\u7528\u6807\u51c6\u7684 Python \u7c7b\u578b\u521b\u5efa\u6216\u6307\u5b9a dtype\uff0c\u4e5f\u53ef\u4ee5\u7528 Numpy \u63d0\u4f9b\u7684\u4f8b\u5982 numpy.int32, numpy.float64 \u7b49 ndarray.itemsize : \u6570\u7ec4\u4e2d\u6bcf\u4e2a\u5143\u7d20\u7684\u5b57\u8282\u5927\u5c0f\uff0c\u4f8b\u5982 float64 \u7684 itemsize \u5c31\u662f 64/8=8\uff0c\u7b49\u4e8e ndarray.dtype.itemsize ndarray.data : \u8be5\u7f13\u51b2\u533a\u5305\u542b\u6570\u7ec4\u7684\u5b9e\u9645\u5143\u7d20\uff0c\u901a\u5e38\u4e0d\u4f7f\u7528\uff0c\u53ea\u9700\u8981\u901a\u8fc7\u7d22\u5f15\u8bbf\u95ee element in ndarray >>> import numpy as np >>> a = np . arange ( 15 ) . reshape ( 3 , 5 ) >>> a array ([[ 0 , 1 , 2 , 3 , 4 ], [ 5 , 6 , 7 , 8 , 9 ], [ 10 , 11 , 12 , 13 , 14 ]]) >>> a . shape ( 3 , 5 ) >>> a . ndim 2 >>> a . dtype . name 'int64' >>> a . itemsize 8 >>> a . size 15 >>> type ( a ) < type 'numpy.ndarray' > >>> b = np . array ([ 6 , 7 , 8 ]) >>> b array ([ 6 , 7 , 8 ]) >>> type ( b ) < type 'numpy.ndarray' >","title":"\u5c5e\u6027"},{"location":"cs/pl/python/numpy/#_2","text":"a=np.array([2,3,4]) :\u4ece Python \u5217\u8868\u6216\u5143\u7ec4\u4e2d\u521b\u5efa\u6570\u7ec4\uff08\u7c7b\u578b\u63a8\u5bfc\uff09 b=np.array([(1,2,3),(4,5,6)]) : \u53ef\u4ee5\u5c06\u5e8f\u5217\u7684\u5e8f\u5217\u8f6c\u6362\u6210\u4e8c\u7ef4\u6570\u7ec4\uff0c\u751a\u81f3\u9ad8\u7ef4\u6570\u7ec4 c=np.array([[],[]], dtype=complex) : \u521b\u5efa\u65f6\u53ef\u4ee5\u663e\u5f0f\u6307\u5b9a\u6570\u7ec4\u7684\u7c7b\u578b dtype=complex \u5360\u4f4d\u7b26\u6570\u7ec4\uff08\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u7684 dtype \u90fd\u662f float64 \uff09 np.zero() : \u521b\u5efa\u4e00\u4e2a\u7531 0 \u7ec4\u6210\u7684\u6570\u7ec4 np.ones() : \u521b\u5efa\u4e00\u4e2a\u7531 1 \u7ec4\u6210\u7684\u6570\u7ec4 np.empty() : \u521b\u5efa\u4e00\u4e2a\u6570\u7ec4\uff0c\u5185\u5bb9\u968f\u673a\uff08\u53d6\u51b3\u4e8e\u5185\u5b58\u72b6\u6001\uff09 np.arange() \uff0c\u521b\u5efa\u6570\u5b57\u7ec4\u6210\u7684\u6570\u7ec4\uff0c\u7c7b\u4f3c\u4e8e range \u7684\u51fd\u6570 \u5f53\u4e0e\u6d6e\u70b9\u53c2\u6570\u4e00\u8d77\u4f7f\u7528\u65f6\uff0c\u6700\u597d\u4f7f\u7528 linspace \u51fd\u6570\u63a5\u53d7\u60f3\u8981\u7684\u5143\u7d20\u6570\u91cf\u7684\u51fd\u6570\uff0c\u800c\u4e0d\u662f\u6b65\u957f step","title":"\u6570\u7ec4\u521b\u5efa"},{"location":"cs/pl/python/numpy/#_3","text":"Numpy \u4ee5\u5d4c\u5957\u5217\u8868\u7c7b\u4f3c\u7684\u65b9\u5f0f\u663e\u793a\uff0c\u6709\u4ee5\u4e0b\u5e03\u5c40 \u6700\u540e\u4e00\u4e2a\u8f74\u4ece\u5de6\u5230\u53f3\u6253\u5370 \u5012\u6570\u7b2c\u4e8c\u4e2a\u4ece\u4e0a\u5230\u4e0b\u6253\u5370 \u5176\u4f59\u90e8\u5206\u4ece\u4e0a\u5230\u4e0b\u6253\u5370\uff0c\u6bcf\u4e2a\u5207\u7247\u7528\u7a7a\u884c\u9694\u5f00 \u5f53\u6570\u7ec4\u592a\u5927\u800c\u65e0\u6cd5\u6253\u5370\u65f6\uff0cNumpy \u4f1a\u81ea\u52a8\u8df3\u8fc7\u6570\u7ec4\u7684\u4e2d\u5fc3\u90e8\u5206\u5e76\u4ec5\u6253\u5370\u89d2\u70b9\u3002\u8981\u7981\u7528\u6b64\u884c\u4e3a\u5e76\u5f3a\u5236NumPy\u6253\u5370\u6574\u4e2a\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u66f4\u6539\u6253\u5370\u9009\u9879 set_printoptions print array >>> a = np . arange ( 6 ) # 1d array >>> print ( a ) [ 0 1 2 3 4 5 ] >>> >>> b = np . arange ( 12 ) . reshape ( 4 , 3 ) # 2d array >>> print ( b ) [[ 0 1 2 ] [ 3 4 5 ] [ 6 7 8 ] [ 9 10 11 ]] >>> >>> c = np . arange ( 24 ) . reshape ( 2 , 3 , 4 ) # 3d array >>> print ( c ) [[[ 0 1 2 3 ] [ 4 5 6 7 ] [ 8 9 10 11 ]] [[ 12 13 14 15 ] [ 16 17 18 19 ] [ 20 21 22 23 ]]] >>> >>> print ( np . arange ( 10000 )) # 10000d array [ 0 1 2 ... , 9997 9998 9999 ] >>> >>> print ( np . arange ( 10000 ) . reshape ( 100 , 100 )) [[ 0 1 2 ... , 97 98 99 ] [ 100 101 102 ... , 197 198 199 ] [ 200 201 202 ... , 297 298 299 ] ... , [ 9700 9701 9702 ... , 9797 9798 9799 ] [ 9800 9801 9802 ... , 9897 9898 9899 ] [ 9900 9901 9902 ... , 9997 9998 9999 ]] >>> >>> np . set_printoptions ( threshold = sys . maxsize ) # sys module should be imported","title":"\u6253\u5370\u6570\u7ec4"},{"location":"cs/pl/python/numpy/#_4","text":"\u6570\u7ec4\u4e0a\u7684\u7b97\u6570\u8fd0\u7b97\u7b26\u4f1a\u5e94\u7528\u5230\u5143\u7d20\u7ea7\u522b \u4e58\u6cd5 * \u5728 array \u4e2d\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u77e9\u9635\u4e58\u6cd5\u53ef\u4ee5\u7528 @ \u6216 dot \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97 \u67d0\u4e9b\u64cd\u4f5c\u4f8b\u5982 +=\u3001*= \u4f1a\u76f4\u63a5\u66f4\u6539\u88ab\u64cd\u4f5c\u7684\u77e9\u9635\u6570\u7ec4\u800c\u4e0d\u4f1a\u521b\u5efa\u65b0\u77e9\u9635\u6570\u7ec4 \u5f53\u4f7f\u7528\u4e0d\u540c\u7c7b\u578b\u7684\u6570\u7ec4\u8fdb\u884c\u64cd\u4f5c\u65f6\uff0c\u7ed3\u679c\u6570\u7ec4\u7684\u7c7b\u578b\u5bf9\u5e94\u4e8e\u66f4\u4e00\u822c\u6216\u66f4\u7cbe\u786e\u7684\u6570\u7ec4\uff08\u79f0\u4e3a\u5411\u4e0a\u8f6c\u6362\u7684\u884c\u4e3a\uff09 \u8bb8\u591a\u4e00\u5143\u64cd\u4f5c\uff0c\u4f8b\u5982\u8ba1\u7b97\u6570\u7ec4\u4e2d\u6240\u6709\u5143\u7d20\u7684\u603b\u548c\uff0c\u90fd\u662f\u4f5c\u4e3a ndarray \u7c7b\u7684\u65b9\u6cd5\u5b9e\u73b0\u7684 min() max() sum() \u901a\u8fc7\u6307\u5b9a axis \u53c2\u6570\uff0c\u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6307\u5b9a\u8f74\u5e94\u7528\u64cd\u4f5c","title":"\u57fa\u672c\u64cd\u4f5c"},{"location":"cs/pl/python/numpy/#_5","text":"NumPy \u63d0\u4f9b\u719f\u6089\u7684\u6570\u5b66\u51fd\u6570\uff0c\u4f8b\u5982 sin \uff0c cos \u548c exp \u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u88ab\u79f0\u4e3a\u201c\u901a\u51fd\u6570\u201d\uff08ufunc\uff09\u3002\u5728 NumPy \u4e2d\uff0c\u8fd9\u4e9b\u51fd\u6570\u5728\u6570\u7ec4\u4e0a\u6309\u5143\u7d20\u8fdb\u884c\u8fd0\u7b97\uff0c\u4ea7\u751f\u4e00\u4e2a\u6570\u7ec4\u4f5c\u4e3a\u8f93\u51fa\u3002","title":"\u901a\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_6","text":"\u4e00\u7ef4\u7684\u6570\u7ec4\u53ef\u4ee5\u8fdb\u884c\u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3\u64cd\u4f5c\u7684\uff0c\u5c31\u50cf \u5217\u8868 \u548c\u5176\u4ed6 Python \u5e8f\u5217\u7c7b\u578b\u4e00\u6837 \u591a\u7ef4\u7684\u6570\u7ec4\u6bcf\u4e2a\u8f74\u53ef\u4ee5\u6709\u4e00\u4e2a\u7d22\u5f15\u3002\u8fd9\u4e9b\u7d22\u5f15\u4ee5\u9017\u53f7\u200b\u200b\u5206\u9694\u7684\u5143\u7ec4\u7ed9\u51fa \u5f53\u63d0\u4f9b\u7684\u7d22\u5f15\u5c11\u4e8e\u8f74\u7684\u6570\u91cf\u65f6\uff0c\u7f3a\u5931\u7684\u7d22\u5f15\u88ab\u8ba4\u4e3a\u662f\u5b8c\u6574\u7684\u5207\u7247 \u53ef\u4ee5\u4f7f\u7528 ... \u8868\u793a\u4ea7\u751f\u5b8c\u6574\u7d22\u5f15\u5143\u7ec4\u6240\u9700\u7684\u5192\u53f7\uff08\u5269\u4f59\u8f74\uff09\uff0c\u7528\u6765\u66ff\u4ee3 : \u4f8b\u5982 x \u662f rank \u4e3a 5 \u7684\u6570\u7ec4 x[1,2,...] = x[1,2,:,:,:] x[...,3] = x[:,:,:,:,3] x[4,...,5,:] = x[4,:,:,5,:] \u5bf9\u591a\u7ef4\u6570\u7ec4\u8fdb\u884c \u8fed\u4ee3\uff08Iterating\uff09 \u662f\u76f8\u5bf9\u4e8e\u7b2c\u4e00\u4e2a\u8f74\u5b8c\u6210\u7684 \u5982\u679c\u60f3\u8981\u5bf9\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u6267\u884c\u64cd\u4f5c\uff0c\u53ef\u4ee5\u4f7f\u7528 flat \u5c5e\u6027\uff0c\u8be5\u5c5e\u6027\u662f\u6570\u7ec4\u7684\u6240\u6709\u5143\u7d20\u7684\u8fed\u4ee3\u5668","title":"\u7d22\u5f15\u3001\u5207\u7247\u548c\u8fed\u4ee3"},{"location":"cs/pl/python/numpy/#_7","text":"","title":"\u5f62\u72b6\u64cd\u7eb5"},{"location":"cs/pl/python/numpy/#_8","text":"a.shape() : \u67e5\u770b\u6570\u7ec4\u7684\u5f62\u72b6 ravel() : \u5c06\u6570\u7ec4\u5e73\u5766\u5e76\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4 reshape(i, j, ...size) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u8fd4\u56de\u4fee\u6539\u540e\u7684\u6570\u7ec4\uff0c\u5982\u679c size \u6307\u5b9a\u4e3a -1\uff0c\u5219\u4f1a\u81ea\u52a8\u8ba1\u7b97\u5176\u4ed6\u7684 size \u5927\u5c0f resize(i, j, ...) : \u5c06\u6570\u7ec4\u7684\u8f74\u6539\u6210 (i,j,..)\uff0c\u4fee\u6539\u6570\u7ec4\u672c\u8eab T : \u5c06\u6570\u7ec4\u8f6c\u7f6e","title":"\u6539\u53d8\u6570\u7ec4\u5f62\u72b6"},{"location":"cs/pl/python/numpy/#_9","text":"vstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u5782\u76f4\u5806\u53e0 hstack(a,b,...) : \u5c06\u6570\u7ec4 a\uff0cb\uff0c... \u6309\u987a\u5e8f\u6a2a\u5411\u5806\u53e0 coulumn_stack : 1D \u6570\u7ec4\u4f5c\u4e3a\u5217\u5806\u53e0\u5230 2D \u6570\u7ec4\u4e2d\uff0c\u76f8\u5f53\u4e8e hstack 2D \u6570\u7ec4 row_stack : \u7b49\u6548\u4e8e vstack \u4e8e\u4efb\u4f55\u8f93\u5165\u6570\u7ec4 r_\u3001c_ : \u901a\u8fc7\u6cbf\u4e00\u4e2a\u8f74\u5806\u53e0\u6570\u7ec4\u6765\u521b\u5efa\u6570\u7ec4\uff0c\u53ef\u4ee5\u4f7f\u7528\u8303\u56f4\u4e3a\u64cd\u4f5c\u7b26 :","title":"\u5c06\u4e0d\u540c\u6570\u7ec4\u5806\u53e0"},{"location":"cs/pl/python/numpy/#_10","text":"hsplit() : \u53ef\u4ee5\u6cbf\u6570\u7ec4\u7684\u6c34\u5e73\u8f74\u62c6\u5206\u6570\u7ec4\uff0c\u65b9\u6cd5\u662f\u6307\u5b9a\u8981\u8fd4\u56de\u7684\u5f62\u72b6\u76f8\u7b49\u7684\u6570\u7ec4\u7684\u6570\u91cf\uff0c\u6216\u8005\u6307\u5b9a\u5e94\u8be5\u5728\u5176\u4e4b\u540e\u8fdb\u884c\u5206\u5272\u7684\u5217 vsplit() : \u6cbf\u5782\u76f4\u8f74\u5206\u5272","title":"\u5c06\u4e00\u4e2a\u6570\u7ec4\u62c6\u5206\u6210\u51e0\u4e2a\u8f83\u5c0f\u7684\u6570\u7ec4"},{"location":"cs/pl/python/numpy/#_11","text":"","title":"\u62f7\u8d1d\u548c\u89c6\u56fe"},{"location":"cs/pl/python/numpy/#_12","text":"\u7b80\u5355\u5206\u914d\u4e0d\u4f1a\u590d\u5236\u6570\u7ec4\u5bf9\u8c61\u6216\u5176\u6570\u636e Python\u5c06\u53ef\u53d8\u5bf9\u8c61\u4f5c\u4e3a\u5f15\u7528\u4f20\u9012\uff0c\u56e0\u6b64\u51fd\u6570\u8c03\u7528\u4e0d\u4f1a\u590d\u5236","title":"\u5b8c\u5168\u4e0d\u590d\u5236"},{"location":"cs/pl/python/numpy/#_13","text":"\u4e0d\u540c\u7684\u6570\u7ec4\u5bf9\u8c61\u53ef\u4ee5\u5171\u4eab\u76f8\u540c\u7684\u6570\u636e view() : \u521b\u5efa\u4e00\u4e2a\u67e5\u770b\u76f8\u540c\u6570\u636e\u7684\u65b0\u6570\u7ec4\u5bf9\u8c61 \u5207\u7247\u6570\u7ec4\u4f1a\u8fd4\u56de\u4e00\u4e2a\u89c6\u56fe","title":"\u89c6\u56fe\u6216\u6d45\u62f7\u8d1d"},{"location":"cs/pl/python/numpy/#_14","text":"copy() : \u751f\u6210\u6570\u7ec4\u53ca\u5176\u6570\u636e\u7684\u5b8c\u6574\u526f\u672c \u5982\u679c\u4e0d\u518d\u9700\u8981\u539f\u59cb\u6570\u7ec4\uff0c\u5219\u5e94\u5728\u5207\u7247\u540e\u8c03\u7528 copy()","title":"\u6df1\u62f7\u8d1d"},{"location":"cs/pl/python/numpy/#_15","text":"\u5e7f\u64ad(Broadcast)\u662f numpy \u5bf9\u4e0d\u540c\u5f62\u72b6(shape)\u7684\u6570\u7ec4\u8fdb\u884c\u6570\u503c\u8ba1\u7b97\u7684\u65b9\u5f0f\uff0c \u5bf9\u6570\u7ec4\u7684\u7b97\u672f\u8fd0\u7b97\u901a\u5e38\u5728\u76f8\u5e94\u7684\u5143\u7d20\u4e0a\u8fdb\u884c \u5982\u679c\u4e24\u4e2a\u6570\u7ec4 a \u548c b \u5f62\u72b6\u76f8\u540c\uff0c\u5373\u6ee1\u8db3 a.shape == b.shape\uff0c\u90a3\u4e48 a*b \u7684\u7ed3\u679c\u5c31\u662f a \u4e0e b \u6570\u7ec4\u5bf9\u5e94\u4f4d\u76f8\u4e58 \u5f53\u8fd0\u7b97\u4e2d\u7684 2 \u4e2a\u6570\u7ec4\u7684\u5f62\u72b6\u4e0d\u540c\u65f6\uff0cnumpy \u5c06\u81ea\u52a8\u89e6\u53d1\u5e7f\u64ad\u673a\u5236 \u89c4\u5219: \u5bf9\u4e24\u4e2a\u6570\u7ec4\uff0c\u5206\u522b\u6bd4\u8f83\u4ed6\u4eec\u7684\u6bcf\u4e00\u4e2a\u7ef4\u5ea6\uff08\u82e5\u5176\u4e2d\u4e00\u4e2a\u6570\u7ec4\u6ca1\u6709\u5f53\u524d\u7ef4\u5ea6\u5219\u5ffd\u7565\uff09 \u6570\u7ec4\u62e5\u6709\u76f8\u540c\u5f62\u72b6 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u76f8\u7b49 \u5f53\u524d\u7ef4\u5ea6\u7684\u503c\u6709\u4e00\u4e2a\u662f 1 \u82e5\u6761\u4ef6\u4e0d\u6ee1\u8db3\uff0c\u629b\u51fa \"ValueError: frames are not aligned\" \u5f02\u5e38","title":"\u5e7f\u64ad"},{"location":"cs/pl/python/numpy/#_16","text":"","title":"\u7d22\u5f15\u6280\u5de7"},{"location":"cs/pl/python/numpy/#_17","text":"\u6574\u6570\u6570\u7ec4\u7d22\u5f15\u662f\u6307\u4f7f\u7528\u4e00\u4e2a\u6570\u7ec4\u6765\u8bbf\u95ee\u53e6\u4e00\u4e2a\u6570\u7ec4\u7684\u5143\u7d20\u3002\u8fd9\u4e2a\u6570\u7ec4\u4e2d\u7684\u6bcf\u4e2a\u5143\u7d20\u90fd\u662f\u76ee\u6807\u6570\u7ec4\u4e2d\u67d0\u4e2a\u7ef4\u5ea6\u4e0a\u7684\u7d22\u5f15\u503c\u3002 >>> a = np . arange ( 12 ) ** 2 # the first 12 square numbers >>> i = np . array ( [ 1 , 1 , 3 , 8 , 5 ] ) # an array of indices >>> a [ i ] # the elements of a at the positions i array ([ 1 , 1 , 9 , 64 , 25 ]) >>> >>> j = np . array ( [ [ 3 , 4 ], [ 9 , 7 ] ] ) # a bidimensional array of indices >>> a [ j ] # the same shape as j array ([[ 9 , 16 ], [ 81 , 49 ]])","title":"\u6574\u6570\u6570\u7ec4\u7d22\u5f15"},{"location":"cs/pl/python/numpy/#_18","text":"\u5e03\u5c14\u7d22\u5f15\u901a\u8fc7\u5e03\u5c14\u8fd0\u7b97\uff08\u5982\uff1a\u6bd4\u8f83\u8fd0\u7b97\u7b26\uff09\u6765\u83b7\u53d6\u7b26\u5408\u6307\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u6570\u7ec4 >>> a = np . arange ( 12 ) . reshape ( 3 , 4 ) >>> b = a > 4 >>> b # b is a boolean with a's shape array ([[ False , False , False , False ], [ False , True , True , True ], [ True , True , True , True ]]) >>> a [ b ] # 1d array with the selected elements array ([ 5 , 6 , 7 , 8 , 9 , 10 , 11 ])","title":"\u5e03\u5c14\u6570\u7ec4\u7d22\u5f15"},{"location":"cs/pl/python/numpy/#ix_","text":"ix_ \u51fd\u6570\u53ef\u7528\u4e8e\u7ec4\u5408\u4e0d\u540c\u7684\u5411\u91cf\uff0c\u4ee5\u4fbf\u83b7\u5f97\u6bcf\u4e2an-uplet\u7684\u7ed3\u679c >>> a = np . array ([ 2 , 3 , 4 , 5 ]) >>> b = np . array ([ 8 , 5 , 4 ]) >>> c = np . array ([ 5 , 4 , 6 , 8 , 3 ]) >>> ax , bx , cx = np . ix_ ( a , b , c ) >>> ax array ([[[ 2 ]], [[ 3 ]], [[ 4 ]], [[ 5 ]]]) >>> bx array ([[[ 8 ], [ 5 ], [ 4 ]]]) >>> cx array ([[[ 5 , 4 , 6 , 8 , 3 ]]]) >>> ax . shape , bx . shape , cx . shape (( 4 , 1 , 1 ), ( 1 , 3 , 1 ), ( 1 , 1 , 5 )) >>> result = ax + bx * cx >>> result array ([[[ 42 , 34 , 50 , 66 , 26 ], [ 27 , 22 , 32 , 42 , 17 ], [ 22 , 18 , 26 , 34 , 14 ]], [[ 43 , 35 , 51 , 67 , 27 ], [ 28 , 23 , 33 , 43 , 18 ], [ 23 , 19 , 27 , 35 , 15 ]], [[ 44 , 36 , 52 , 68 , 28 ], [ 29 , 24 , 34 , 44 , 19 ], [ 24 , 20 , 28 , 36 , 16 ]], [[ 45 , 37 , 53 , 69 , 29 ], [ 30 , 25 , 35 , 45 , 20 ], [ 25 , 21 , 29 , 37 , 17 ]]]) >>> result [ 3 , 2 , 4 ] 17 >>> a [ 3 ] + b [ 2 ] * c [ 4 ] 17","title":"ix_()\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_19","text":"bitwise_and() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u4e0e\u64cd\u4f5c bitwise_or() : \u5bf9\u6570\u7ec4\u5143\u7d20\u6267\u884c\u4f4d\u6216\u64cd\u4f5c invert() : \u6309\u4f4d\u53d6\u53cd left_shift() : \u5411\u5de6\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d right_shift() : \u5411\u53f3\u79fb\u52a8\u4e8c\u8fdb\u5236\u8868\u793a\u7684\u4f4d","title":"\u4f4d\u8fd0\u7b97"},{"location":"cs/pl/python/numpy/#_20","text":"","title":"\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_21","text":"add() : \u5bf9\u4e24\u4e2a\u6570\u7ec4\u7684\u9010\u4e2a\u5b57\u7b26\u4e32\u5143\u7d20\u8fdb\u884c\u8fde\u63a5 multiply() : \u8fd4\u56de\u6309\u5143\u7d20\u591a\u91cd\u8fde\u63a5\u540e\u7684\u5b57\u7b26\u4e32 center() : \u5c45\u4e2d\u5b57\u7b26\u4e32 capitalize() : \u5c06\u5b57\u7b26\u4e32\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 title() : \u5c06\u5b57\u7b26\u4e32\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u7b2c\u4e00\u4e2a\u5b57\u6bcd\u8f6c\u6362\u4e3a\u5927\u5199 lower() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5c0f\u5199 upper() : \u6570\u7ec4\u5143\u7d20\u8f6c\u6362\u4e3a\u5927\u5199 split() : \u6307\u5b9a\u5206\u9694\u7b26\u5bf9\u5b57\u7b26\u4e32\u8fdb\u884c\u5206\u5272\uff0c\u5e76\u8fd4\u56de\u6570\u7ec4\u5217\u8868 splitlines() : \u8fd4\u56de\u5143\u7d20\u4e2d\u7684\u884c\u5217\u8868\uff0c\u4ee5\u6362\u884c\u7b26\u5206\u5272 strip() : \u79fb\u9664\u5143\u7d20\u5f00\u5934\u6216\u8005\u7ed3\u5c3e\u5904\u7684\u7279\u5b9a\u5b57\u7b26 join() : \u901a\u8fc7\u6307\u5b9a\u5206\u9694\u7b26\u6765\u8fde\u63a5\u6570\u7ec4\u4e2d\u7684\u5143\u7d20 replace() : \u4f7f\u7528\u65b0\u5b57\u7b26\u4e32\u66ff\u6362\u5b57\u7b26\u4e32\u4e2d\u7684\u6240\u6709\u5b50\u5b57\u7b26\u4e32 decode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.decode encode() : \u6570\u7ec4\u5143\u7d20\u4f9d\u6b21\u8c03\u7528 str.encode","title":"\u5b57\u7b26\u4e32\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_22","text":"sin(), cos(), tan() \u7b49\u4e09\u89d2\u51fd\u6570 around() : \u8fd4\u56de\u6307\u5b9a\u6570\u5b57\u7684\u56db\u820d\u4e94\u5165\u503c floor() : \u8fd4\u56de\u5c0f\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5927\u6574\u6570\uff0c\u5373\u5411\u4e0b\u53d6\u6574 ceil() : \u8fd4\u56de\u5927\u4e8e\u6216\u8005\u7b49\u4e8e\u6307\u5b9a\u8868\u8fbe\u5f0f\u7684\u6700\u5c0f\u6574\u6570\uff0c\u5373\u5411\u4e0a\u53d6\u6574","title":"\u6570\u5b66\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_23","text":"add()\uff0csubtract()\uff0cmultiply() \u548c divide() reciprocal() : \u8fd4\u56de\u53c2\u6570\u9010\u5143\u7d20\u7684\u5012\u6570,\u5982 1/4 \u5012\u6570\u4e3a 4/1 power() : \u5c06\u7b2c\u4e00\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u4f5c\u4e3a\u5e95\u6570\uff0c\u8ba1\u7b97\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u5e42 mod() : \u8ba1\u7b97\u8f93\u5165\u6570\u7ec4\u4e2d\u76f8\u5e94\u5143\u7d20\u7684\u76f8\u9664\u540e\u7684\u4f59\u6570","title":"\u7b97\u6570\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_24","text":"amin() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5c0f\u503c amax() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4\u4e2d\u7684\u5143\u7d20\u6cbf\u6307\u5b9a\u8f74\u7684\u6700\u5927\u503c ptp() : \u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u6700\u5927\u503c\u4e0e\u6700\u5c0f\u503c\u7684\u5dee\uff08\u6700\u5927\u503c - \u6700\u5c0f\u503c\uff09 percentile() : \u767e\u5206\u4f4d\u6570\u662f\u7edf\u8ba1\u4e2d\u4f7f\u7528\u7684\u5ea6\u91cf\uff0c\u8868\u793a\u5c0f\u4e8e\u8fd9\u4e2a\u503c\u7684\u89c2\u5bdf\u503c\u7684\u767e\u5206\u6bd4 median() : \u7528\u4e8e\u8ba1\u7b97\u6570\u7ec4 a \u4e2d\u5143\u7d20\u7684\u4e2d\u4f4d\u6570\uff08\u4e2d\u503c\uff09 mean() : \u8fd4\u56de\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u7b97\u672f\u5e73\u5747\u503c\uff0c\u5982\u679c\u63d0\u4f9b\u4e86\u8f74\uff0c\u5219\u6cbf\u5176\u8ba1\u7b97 average() : \u6839\u636e\u5728\u53e6\u4e00\u4e2a\u6570\u7ec4\u4e2d\u7ed9\u51fa\u7684\u5404\u81ea\u7684\u6743\u91cd\u8ba1\u7b97\u6570\u7ec4\u4e2d\u5143\u7d20\u7684\u52a0\u6743\u5e73\u5747\u503c sqrt(mean((x - x.mean())**2)) : \u6807\u51c6\u5dee\u516c\u5f0f mean((x - x.mean())** 2) : \u65b9\u5dee","title":"\u7edf\u8ba1\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_25","text":"sort() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u7684\u6392\u5e8f\u526f\u672c lexsort() : \u7528\u4e8e\u5bf9\u591a\u4e2a\u5e8f\u5217\u8fdb\u884c\u6392\u5e8f nonzero() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u975e\u96f6\u5143\u7d20\u7684\u7d22\u5f15 where() : \u8fd4\u56de\u8f93\u5165\u6570\u7ec4\u4e2d\u6ee1\u8db3\u7ed9\u5b9a\u6761\u4ef6\u7684\u5143\u7d20\u7684\u7d22\u5f15 extract() : \u6839\u636e\u67d0\u4e2a\u6761\u4ef6\u4ece\u6570\u7ec4\u4e2d\u62bd\u53d6\u5143\u7d20\uff0c\u8fd4\u56de\u6ee1\u6761\u4ef6\u7684\u5143\u7d20","title":"\u6392\u5e8f\u3001\u6761\u4ef6\u7b5b\u9009\u51fd\u6570"},{"location":"cs/pl/python/numpy/#_26","text":"numpy.dot() : \u4e24\u4e2a\u6570\u7ec4\u7684\u70b9\u79ef\uff0c\u5373\u5143\u7d20\u5bf9\u5e94\u76f8\u4e58 numpy.vdot() : \u4e24\u4e2a\u5411\u91cf\u7684\u70b9\u79ef numpy.inner() : \u4e24\u4e2a\u6570\u7ec4\u7684\u5185\u79ef numpy.matmul() : \u4e24\u4e2a\u6570\u7ec4\u7684\u77e9\u9635\u79ef numpy.determinant() : \u6570\u7ec4\u7684\u884c\u5217\u5f0f numpy.solve() : \u6c42\u89e3\u7ebf\u6027\u77e9\u9635\u65b9\u7a0b numpy.inv() : \u8ba1\u7b97\u77e9\u9635\u7684\u4e58\u6cd5\u9006\u77e9\u9635 numpy.matlib.empty() : \u8fd4\u56de\u4e00\u4e2a\u65b0\u7684\u77e9\u9635\uff0c\u5143\u7d20\u968f\u673a numpy.matlib.zeros() : \u521b\u5efa\u4e00\u4e2a\u4ee5 0 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.one() : \u521b\u5efa\u4e00\u4e2a\u4ee5 1 \u586b\u5145\u7684\u77e9\u9635 numpy.matlib.eye() : \u8fd4\u56de\u4e00\u4e2a\u77e9\u9635\uff0c\u5bf9\u89d2\u7ebf\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u4f4d\u7f6e\u4e3a\u96f6 numpy.matlib.identity() : \u8fd4\u56de\u7ed9\u5b9a\u5927\u5c0f\u7684\u5355\u4f4d\u77e9\u9635 numpy.matlib.rand() : \u521b\u5efa\u4e00\u4e2a\u7ed9\u5b9a\u5927\u5c0f\u7684\u77e9\u9635\uff0c\u6570\u636e\u662f\u968f\u673a\u586b\u5145\u7684","title":"\u7ebf\u6027\u4ee3\u6570"},{"location":"cs/pl/python/numpy/#_27","text":"","title":"\u5176\u4ed6"},{"location":"cs/pl/python/numpy/#_28","text":"\u8981\u66f4\u6539\u6570\u7ec4\u7684\u5c3a\u5bf8\uff0c\u60a8\u53ef\u4ee5\u7701\u7565\u5176\u4e2d\u4e00\u4e2a\u5c3a\u5bf8\uff0c\u7136\u540e\u81ea\u52a8\u63a8\u5bfc\u51fa\u5c3a\u5bf8 >>> a = np . arange ( 30 ) >>> a . shape = 2 , - 1 , 3 # -1 means \"whatever is needed\" >>> a . shape ( 2 , 5 , 3 ) >>> a array ([[[ 0 , 1 , 2 ], [ 3 , 4 , 5 ], [ 6 , 7 , 8 ], [ 9 , 10 , 11 ], [ 12 , 13 , 14 ]], [[ 15 , 16 , 17 ], [ 18 , 19 , 20 ], [ 21 , 22 , 23 ], [ 24 , 25 , 26 ], [ 27 , 28 , 29 ]]])","title":"\u201c\u81ea\u52a8\u201d\u6574\u5f62"},{"location":"cs/pl/python/numpy/#_29","text":"\u901a\u8fc7 vstack \u7b49\u5c06\u6570\u7ec4\u5806\u53e0 x = np . arange ( 0 , 10 , 2 ) # x=([0,2,4,6,8]) y = np . arange ( 5 ) # y=([0,1,2,3,4]) m = np . vstack ([ x , y ]) # m=([[0,2,4,6,8], # [0,1,2,3,4]]) xy = np . hstack ([ x , y ]) # xy =([0,2,4,6,8,0,1,2,3,4])","title":"\u77e2\u91cf\u5806\u53e0"},{"location":"cs/pl/python/numpy/#_30","text":"histogram\u5e94\u7528\u4e8e\u6570\u7ec4\u7684NumPy \u51fd\u6570\u8fd4\u56de\u4e00\u5bf9\u5411\u91cf\uff1a\u6570\u7ec4\u7684\u76f4\u65b9\u56fe\u548cbin\u7684\u5411\u91cf\u3002matplotlib\u8fd8\u6709\u4e00\u4e2a\u6784\u5efa\u76f4\u65b9\u56fe\u7684\u529f\u80fd\uff08hist\u5728Matlab\u4e2d\u79f0\u4e3a\uff09\uff0c\u4e0eNumPy\u4e2d\u7684\u76f4\u65b9\u56fe\u4e0d\u540c\u3002\u4e3b\u8981\u533a\u522b\u5728\u4e8epylab.hist\u81ea\u52a8\u7ed8\u5236\u76f4\u65b9\u56fe\uff0c\u800c numpy.histogram\u53ea\u751f\u6210\u6570\u636e >>> import numpy as np >>> import matplotlib.pyplot as plt >>> # Build a vector of 10000 normal deviates with variance 0.5^2 and mean 2 >>> mu , sigma = 2 , 0.5 >>> v = np . random . normal ( mu , sigma , 10000 ) >>> # Plot a normalized histogram with 50 bins >>> plt . hist ( v , bins = 50 , density = 1 ) # matplotlib version (plot) >>> plt . show () >>> # Compute the histogram with numpy and then plot it >>> ( n , bins ) = np . histogram ( v , bins = 50 , density = True ) # NumPy version (no plot) >>> plt . plot ( .5 * ( bins [ 1 :] + bins [: - 1 ]), n ) >>> plt . show ()","title":"\u76f4\u65b9\u56fe"},{"location":"cs/pl/python/numpy/#reference","text":"Numpy \u5b98\u7f51 SciPy \u5b98\u7f51 Matplotlib \u5b98\u7f51 \u83dc\u9e1f\u6559\u7a0b Numpy \u5feb\u901f\u5165\u95e8 Numpy \u6570\u636e\u53ef\u89c6\u5316","title":"Reference"},{"location":"cs/pl/python/virtual/","text":"\u865a\u62df\u73af\u5883 \u00b6 \u7ea6 203 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f virtualenv \u00b6 pip install virtualenv : \u5b89\u88c5 virtualenv 'name' : \u521b\u5efa\u865a\u62df\u73af\u5883 cd venv && source ./vin/activate : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 rm -rf venv : \u5220\u9664\u865a\u62df\u73af\u5883 conda \u00b6 \u4e0b\u8f7d anaconda \u5b89\u88c5\u7684 python \u76f4\u63a5\u53ef\u4ee5\u4f7f\u7528 conda \u5de5\u5177 conda create --name 'name' python=3.9 -y : \u521b\u5efa\u865a\u62df\u73af\u5883 source activate venv : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 source deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 conda remove --name 'name' --all : \u5220\u9664\u865a\u62df\u73af\u5883 conda info -e / conda env list : \u5217\u51fa\u7cfb\u7edf\u5b58\u5728\u7684\u865a\u62df\u73af\u5883 conda list : \u67e5\u770b\u5f53\u524d\u73af\u5883\u4e0b\u5df2\u5b89\u88c5\u7684\u5305 conda list --name 'name' : \u67e5\u770b\u67d0\u4e2a\u6307\u5b9a\u73af\u5883\u7684\u5df2\u5b89\u88c5\u5305 conda search numpy : \u67e5\u770b package \u4fe1\u606f conda install --name 'name' numpy : \u5b89\u88c5package\uff0c\u5982\u679c\u4e0d\u7528-n\u6307\u5b9a\u73af\u5883\u540d\u79f0\uff0c\u5219\u88ab\u5b89\u88c5\u5728\u5f53\u524d\u6fc0\u6d3b\u73af\u5883 conda update --name 'name' numpy : \u66f4\u65b0 package conda remove --name 'name'numpy : \u5220\u9664 package","title":"Python \u865a\u62df\u73af\u5883"},{"location":"cs/pl/python/virtual/#_1","text":"\u7ea6 203 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f","title":"\u865a\u62df\u73af\u5883"},{"location":"cs/pl/python/virtual/#virtualenv","text":"pip install virtualenv : \u5b89\u88c5 virtualenv 'name' : \u521b\u5efa\u865a\u62df\u73af\u5883 cd venv && source ./vin/activate : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 rm -rf venv : \u5220\u9664\u865a\u62df\u73af\u5883","title":"virtualenv"},{"location":"cs/pl/python/virtual/#conda","text":"\u4e0b\u8f7d anaconda \u5b89\u88c5\u7684 python \u76f4\u63a5\u53ef\u4ee5\u4f7f\u7528 conda \u5de5\u5177 conda create --name 'name' python=3.9 -y : \u521b\u5efa\u865a\u62df\u73af\u5883 source activate venv : \u6fc0\u6d3b\u865a\u62df\u73af\u5883 source deactivate : \u9000\u51fa\u865a\u62df\u73af\u5883 conda remove --name 'name' --all : \u5220\u9664\u865a\u62df\u73af\u5883 conda info -e / conda env list : \u5217\u51fa\u7cfb\u7edf\u5b58\u5728\u7684\u865a\u62df\u73af\u5883 conda list : \u67e5\u770b\u5f53\u524d\u73af\u5883\u4e0b\u5df2\u5b89\u88c5\u7684\u5305 conda list --name 'name' : \u67e5\u770b\u67d0\u4e2a\u6307\u5b9a\u73af\u5883\u7684\u5df2\u5b89\u88c5\u5305 conda search numpy : \u67e5\u770b package \u4fe1\u606f conda install --name 'name' numpy : \u5b89\u88c5package\uff0c\u5982\u679c\u4e0d\u7528-n\u6307\u5b9a\u73af\u5883\u540d\u79f0\uff0c\u5219\u88ab\u5b89\u88c5\u5728\u5f53\u524d\u6fc0\u6d3b\u73af\u5883 conda update --name 'name' numpy : \u66f4\u65b0 package conda remove --name 'name'numpy : \u5220\u9664 package","title":"conda"},{"location":"cs/software/","text":"\u8f6f\u4ef6\u76f8\u5173 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u8f6f\u4ef6\u76f8\u5173\u4e66\u7c4d\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u8bbe\u8ba1\u6a21\u5f0f \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\uff08\u738b\u6620\u8f89\u8457\uff09 COM \u539f\u7406\u4e0e\u5e94\u7528\uff08\u6f58\u7231\u6c11\u8457\uff09 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0\uff08\u738b\u5343\u7965\u8457\uff09","title":"\u8f6f\u4ef6\u76f8\u5173"},{"location":"cs/software/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u8f6f\u4ef6\u76f8\u5173\u4e66\u7c4d\u7684\u7b14\u8bb0","title":"\u8f6f\u4ef6\u76f8\u5173"},{"location":"cs/software/#table-of-contents","text":"\u8bbe\u8ba1\u6a21\u5f0f \u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\uff08\u738b\u6620\u8f89\u8457\uff09 COM \u539f\u7406\u4e0e\u5e94\u7528\uff08\u6f58\u7231\u6c11\u8457\uff09 \u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0\uff08\u738b\u5343\u7965\u8457\uff09","title":"Table of Contents"},{"location":"cs/software/compa/","text":"COM \u539f\u7406\u4e0e\u5e94\u7528 \u00b6 \u7ea6 1108 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u81ea\u5b66\uff0c\u5bfc\u5e08\u63a8\u8350\u7684\u4e66\u7c4d\uff0c\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b\uff0c\u4ec5\u5b66\u4e60 \u7b2c\u4e00\u90e8\u5206 COM \u662f\u7531 Microsoft \u63d0\u51fa\u7684\u7ec4\u4ef6\u6807\u51c6\uff0c\u5b83\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u4ea4\u4e92\u7684\u6807\u51c6\uff0c \u4e95\u4e14\u4e5f\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u7684\u73af\u5883\u3002\u5728 COM \u6807\u51c6\u4e2d\uff0c\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u4e5f\u88ab\u79f0\u4e3a\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u53ef\u4ee5\u662f\u4e00\u4e2a\u52a8\u6001\u8fde\u63a5\u5e93(\u7f29\u5199\u4e3a DLL )\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5185\u7ec4 \u4ef6 (in-process component);\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f(\u5373 EXE \u7a0b\u5e8f)\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5916\u7ec4\u4ef6(out-of-process component)\u3002\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u56e0\u4e3a COM \u662f\u4ee5\u5bf9\u8c61\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b\uff0c\u6240\u4ee5\u5728\u7a0b\u5e8f\u4e0e\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u65f6\uff0c\u901a\u4fe1\u7684\u53cc\u65b9\u5e94\u8be5\u662f\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u4e5f\u53eb\u505a COM \u5bf9\u8c61\uff0c\u800c\u7ec4\u4ef6\u7a0b\u5e8f\uff08\u6216\u79f0\u505a COM \u7a0b\u5e8f\uff09\u662f\u63d0\u4f9b COM \u5bf9\u8c61\u7684\u4ee3\u7801\u8f7d\u4f53\u3002 \u2014\u2014\u2014\u2014 COM \u662f\u4ec0\u4e48 \u6982\u8ff0 \u00b6 \u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\u2014\u2014COM \u00b6 COM\u4e0d\u4ec5\u4ec5\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u6807\u51c6\uff0c\u5b83\u8fd8\u5f15\u4eba\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u601d\u60f3\u3002\u5728COM\u6807\u6dee\u4e2d\uff0c\u5bf9\u8c61\u662f\u4e00\u4e2a\u975e\u5e38\u6d3b\u8054\u7684\u5143\u7d20\uff0c\u6211\u4eec\u4e5f\u7ecf\u5e38\u628a\u5b83\u79f0\u4e3aCOM\u5bf9\u8c61\u3002\u7ec4\u4ef6\u6a21\u5757\u4e3aCOM\u5bf9\u8c61\u63d0\u4f9b\u4e86\u6d3b\u52a8\u7684\u7a7a\u95f4\uff0cCOM\u5bf9\u8c61\u4ee5\u63a5\u53e3\u7684\u65b9\u5f0f\u63d0\u4f9b\u670d\u52a1\uff0c\u6211\u4eec\u628a\u8fd9\u79cd\u63a5\u53e3\u79f0\u4e3aCOM\u63a5\u53e3\u3002 COM \u7ed3\u6784 \u00b6 \u5bf9\u8c61\u4e0e\u63a5\u53e3 \u00b6 COM \u5bf9\u8c61\u7c7b\u4f3c\u4e8e C++ \u4e2d\u5bf9\u8c61\u7684\u6982\u5ff5\uff0c\u5bf9\u8c61\u662f\u67d0\u4e2a\u7c7b(class)\u7684\u4e00\u4e2a\u5b9e\u4f8b;\u800c\u7c7b\u5219\u662f\u4e00\u7ec4\u76f8\u5173\u7684\u6570\u636e\u548c\u529f\u80fd\u7ec4\u5408\u5728\u4e00\u8d77\u7684\u4e00\u4e2a\u5b9a\u4e49\u3002\u4f7f\u7528\u5bf9\u8c61\u7684\u5e94\u7528(\u6216\u53e6\u4e00\u4e2a\u5bf9\u8c61)\u79f0\u4e3a\u5ba2\u6237\u3002 \u63a5\u53e3\u662f\u4e00\u7ec4\u903b\u8f91\u4e0a\u76f8\u5173\u7684\u51fd\u6570\u96c6\u5408\uff0c\u5176\u51fd\u6570\u4e5f\u88ab\u79f0\u4e3a\u63a5\u53e3\u6210\u5458\u51fd\u6570\u3002 \u5bf9\u8c61\u901a\u8fc7\u63a5\u53e3\u6210\u5458\u51fd\u6570\u4e3a\u5ba2\u6237\u63d0\u4f9b\u5404\u79cd\u5f62\u5f0f\u7684\u670d\u52a1\u3002 \u6bcf\u4e2a\u63a5\u53e3\u90fd\u7531\u4e00\u4e2a 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26(GUID)\u6765\u6807\u8bc6\u3002\u5ba2\u6237\u901a\u8fc7 GUID \u83b7\u5f97\u63a5\u53e3\u7684\u6307\u9488\u3002 \u6bcf\u4e2a\u5bf9\u8c61\u90fd\u6709\u4e00\u4e2a 128 \u4f4d\u7684 GUID \u6765\u6807\u8bc6\uff0c\u79f0\u4e3a CLSID\uff0c\u4fdd\u8bc1\u5728\u5168\u7403\u8303\u56f4\u5185\u7684\u552f\u4e00\u6027\u3002 \u5bf9\u4e8e\u5ba2\u6237\u6765\u8bf4\uff0c\u53ea\u4e0e\u63a5\u53e3\u6253\u4ea4\u9053\u3002 \u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b \u00b6 \u7a33\u5b9a\u6027\u3001\u53ef\u9760\u884c\u597d\u3002 \u8f6f\u4ef6\u7684\u53ef\u6269\u5c55\u6027\u66f4\u597d\u3002 \u63d0\u9ad8\u6027\u80fd\u3002 \u5728\u7f51\u7edc\u4e0a\u5b9e\u73b0\u65f6\uff0c\u53ef\u4ee5\u964d\u4f4e\u7f51\u7edc\u6d41\u91cf\u3002 \u7528\u4e8e\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e8b\u7269\u673a\u5236\uff0c\u63d0\u4f9b\u6570\u636e\u5907\u4efd\u80fd\u529b\u7b49\u3002 \u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u6700\u5927\u4f18\u70b9\u662f\u7a33\u5b9a\u6027\u597d\uff0c\u800c\u8fd9\u6b63\u662f COM \u6a21\u578b\u7684\u76ee\u6807\uff0c\u5c24\u5176\u5bf9\u4e8e\u8de8\u8fdb\u7a0b\u7684\u7a0b\u5e8f\u901a\u4fe1\u3002 \u4e0b\u9762\u662f COM \u4f7f\u7528\u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u51e0\u79cd\u7075\u6d3b\u7528\u6cd5\uff1a COM \u5e93 \u00b6 \u5728 Microsoft Windows \u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u4e0b\uff0cCOM \u5e93\u4ee5 .dll \u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u5728\uff0c\u5305\u62ec\u4e00\u4e0b\u5185\u5bb9\uff1a \u63d0\u4f9b\u4e86\u5c11\u91cf\u7684 API \u51fd\u6570\u5b9e\u73b0\u5ba2\u6237\u548c\u670d\u52a1\u5668\u7aef COM \u5e94\u7528\u7684\u521b\u5efa\u8fc7\u7a0b\u3002\u5728\u5ba2\u6237\u7aef\uff0c\u4e3b\u8981\u662f\u4e00\u4e9b\u521b\u5efa\u51fd\u6570;\u800c\u5728\u670d\u52a1\u5668\u7aef\uff0c\u63d0\u4f9b\u4e00\u4e9b\u5bf9\u5bf9\u8c61\u7684\u8bbf\u95ee\u652f\u6301 COM \u901a\u8fc7\u6ce8\u518c\u8868\u67e5\u627e\u672c\u5730\u670d\u52a1\u5668\u5373 EXE \u7a0b\u5e8f\uff0c\u4ee5\u53ca\u7a0b\u5e8f\u540d\u4e0e CLSID \u7684\u8f6c\u6362\u7b49 \u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u7684\u5185\u5b58\u63a7\u5236\u65b9\u6cd5\uff0c\u4f7f\u5e94\u7528\u63a7\u5236\u8fdb\u7a0b\u4e2d\u5185\u5b58\u7684\u5206\u914d COM \u5e93\u4e00\u822c\u4e0d\u5728\u5e94\u7528\u7a0b\u5e8f\u5c42\u5b9e\u73b0\uff0c\u800c\u5728\u64cd\u4f5c\u7cfb\u7edf\u5c42\u6b21\u4e0a\u5b9e\u73b0\uff0c\u56e0\u6b64\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u53ea\u6709\u4e00\u4e2a COM \u5e93\u5b9e\u73b0\u3002 COM \u7279\u6027 \u00b6 \u8bed\u8a00\u65e0\u5173\u6027\uff1aCOM \u89c4\u8303\u7684\u5b9a\u4e49\u4e0d\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7684\u8bed\u8a00\uff08\u4f46\u53ea\u6709\u7528 C/C++ \u8bed\u8a00\u624d\u80fd\u5b9e\u73b0 COM \u4e2d\u6240\u6709\u7684\u7279\u6027\uff09 \u8fdb\u7a0b\u900f\u660e\u7279\u6027\uff1a\u8de8\u8fdb\u7a0b\u64cd\u4f5c\u662f\u5f88\u6709\u5fc5\u8981\u7684\u3002\u5b9e\u73b0\u7684\u5173\u952e\u5728\u4e8e COM \u5e93 \u53ef\u91cd\u7528\u6027\uff1a\u4efb\u4f55\u5bf9\u8c61\u6a21\u578b\u7684\u5b9e\u73b0\u76ee\u6807\u3002 \u5305\u5bb9\u65b9\u5f0f \u805a\u5408\u65b9\u5f0f COM \u5bf9\u8c61\u548c\u63a5\u53e3 \u00b6 COM \u5bf9\u8c61 \u00b6 COM \u63d0\u4f9b\u7684\u662f\u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\uff0cCOM \u7ec4\u4ef6\u63d0\u4f9b\u7ed9\u5ba2\u6237\u7684\u662f\u4ee5\u5bf9\u8c61\u5f62\u5f0f\u5c01\u88c5\u8d77\u6765\u7684\u5b9e\u4f53 \u7c7b\u4f3c\u4e8e C++ \u8bed\u8a00\u4e2d\u7c7b\uff08class\uff09\u6982\u5ff5\uff0cCOM \u5bf9\u8c61\u4e5f\u5305\u62ec\u5c5e\u6027\uff08\u4e5f\u79f0\u4e3a\u72b6\u6001\uff09\u548c\u65b9\u6cd5\uff08\u4e5f\u79f0\u4e3a\u64cd\u4f5c\uff09 COM \u5bf9\u8c61\u7684\u6807\u8bc6\u2014\u2014CLSID \u00b6 \u5ba2\u6237\u7a0b\u5e8f\u901a\u8fc7\u4e00\u4e2a\u5168\u5c40\u6807\u8bc6\u7b26\u8fdb\u884c\u5bf9\u8c61\u7684\u521b\u5efa\u548c\u521d\u59cb\u5316\u5de5\u4f5c COM \u89c4\u8303\u91c7\u7528\u4e86 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26\uff08GUID\uff09\u6765\u6807\u8bc6\u5bf9\u8c61\uff08\u968f\u673a\u6570\uff09 COM \u5bf9\u8c61\u4e0e C++ \u5bf9\u8c61\u7684\u6bd4\u8f83 \u00b6 \u5c01\u88c5\u7279\u6027 \u53ef\u91cd\u7528\u6027 COM \u63a5\u53e3 \u00b6 \u4ece API \u5230 COM \u63a5\u53e3 \u00b6","title":"COM \u539f\u7406\u4e0e\u5e94\u7528"},{"location":"cs/software/compa/#com","text":"\u7ea6 1108 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u81ea\u5b66\uff0c\u5bfc\u5e08\u63a8\u8350\u7684\u4e66\u7c4d\uff0c\u8bb0\u5f55\u4e00\u4e0b\u5b66\u4e60\u8fc7\u7a0b\uff0c\u4ec5\u5b66\u4e60 \u7b2c\u4e00\u90e8\u5206 COM \u662f\u7531 Microsoft \u63d0\u51fa\u7684\u7ec4\u4ef6\u6807\u51c6\uff0c\u5b83\u4e0d\u4ec5\u5b9a\u4e49\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u4ea4\u4e92\u7684\u6807\u51c6\uff0c \u4e95\u4e14\u4e5f\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u7a0b\u5e8f\u8fd0\u884c\u6240\u9700\u7684\u73af\u5883\u3002\u5728 COM \u6807\u51c6\u4e2d\uff0c\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u4e5f\u88ab\u79f0\u4e3a\u4e00\u4e2a\u6a21\u5757\uff0c\u5b83\u53ef\u4ee5\u662f\u4e00\u4e2a\u52a8\u6001\u8fde\u63a5\u5e93(\u7f29\u5199\u4e3a DLL )\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5185\u7ec4 \u4ef6 (in-process component);\u4e5f\u53ef\u4ee5\u662f\u4e00\u4e2a\u53ef\u6267\u884c\u7a0b\u5e8f(\u5373 EXE \u7a0b\u5e8f)\uff0c\u88ab\u79f0\u4f5c\u8fdb\u7a0b\u5916\u7ec4\u4ef6(out-of-process component)\u3002\u4e00\u4e2a\u7ec4\u4ef6\u7a0b\u5e8f\u53ef\u4ee5\u5305\u542b\u4e00\u4e2a\u6216\u591a\u4e2a\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u56e0\u4e3a COM \u662f\u4ee5\u5bf9\u8c61\u4e3a\u57fa\u672c\u5355\u5143\u7684\u6a21\u578b\uff0c\u6240\u4ee5\u5728\u7a0b\u5e8f\u4e0e\u7a0b\u5e8f\u4e4b\u95f4\u8fdb\u884c\u901a\u4fe1\u65f6\uff0c\u901a\u4fe1\u7684\u53cc\u65b9\u5e94\u8be5\u662f\u7ec4\u4ef6\u5bf9\u8c61\uff0c\u4e5f\u53eb\u505a COM \u5bf9\u8c61\uff0c\u800c\u7ec4\u4ef6\u7a0b\u5e8f\uff08\u6216\u79f0\u505a COM \u7a0b\u5e8f\uff09\u662f\u63d0\u4f9b COM \u5bf9\u8c61\u7684\u4ee3\u7801\u8f7d\u4f53\u3002 \u2014\u2014\u2014\u2014 COM \u662f\u4ec0\u4e48","title":"COM \u539f\u7406\u4e0e\u5e94\u7528"},{"location":"cs/software/compa/#_1","text":"","title":"\u6982\u8ff0"},{"location":"cs/software/compa/#com_1","text":"COM\u4e0d\u4ec5\u4ec5\u63d0\u4f9b\u4e86\u7ec4\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u6807\u51c6\uff0c\u5b83\u8fd8\u5f15\u4eba\u4e86\u9762\u5411\u5bf9\u8c61\u7684\u601d\u60f3\u3002\u5728COM\u6807\u6dee\u4e2d\uff0c\u5bf9\u8c61\u662f\u4e00\u4e2a\u975e\u5e38\u6d3b\u8054\u7684\u5143\u7d20\uff0c\u6211\u4eec\u4e5f\u7ecf\u5e38\u628a\u5b83\u79f0\u4e3aCOM\u5bf9\u8c61\u3002\u7ec4\u4ef6\u6a21\u5757\u4e3aCOM\u5bf9\u8c61\u63d0\u4f9b\u4e86\u6d3b\u52a8\u7684\u7a7a\u95f4\uff0cCOM\u5bf9\u8c61\u4ee5\u63a5\u53e3\u7684\u65b9\u5f0f\u63d0\u4f9b\u670d\u52a1\uff0c\u6211\u4eec\u628a\u8fd9\u79cd\u63a5\u53e3\u79f0\u4e3aCOM\u63a5\u53e3\u3002","title":"\u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\u2014\u2014COM"},{"location":"cs/software/compa/#com_2","text":"","title":"COM \u7ed3\u6784"},{"location":"cs/software/compa/#_2","text":"COM \u5bf9\u8c61\u7c7b\u4f3c\u4e8e C++ \u4e2d\u5bf9\u8c61\u7684\u6982\u5ff5\uff0c\u5bf9\u8c61\u662f\u67d0\u4e2a\u7c7b(class)\u7684\u4e00\u4e2a\u5b9e\u4f8b;\u800c\u7c7b\u5219\u662f\u4e00\u7ec4\u76f8\u5173\u7684\u6570\u636e\u548c\u529f\u80fd\u7ec4\u5408\u5728\u4e00\u8d77\u7684\u4e00\u4e2a\u5b9a\u4e49\u3002\u4f7f\u7528\u5bf9\u8c61\u7684\u5e94\u7528(\u6216\u53e6\u4e00\u4e2a\u5bf9\u8c61)\u79f0\u4e3a\u5ba2\u6237\u3002 \u63a5\u53e3\u662f\u4e00\u7ec4\u903b\u8f91\u4e0a\u76f8\u5173\u7684\u51fd\u6570\u96c6\u5408\uff0c\u5176\u51fd\u6570\u4e5f\u88ab\u79f0\u4e3a\u63a5\u53e3\u6210\u5458\u51fd\u6570\u3002 \u5bf9\u8c61\u901a\u8fc7\u63a5\u53e3\u6210\u5458\u51fd\u6570\u4e3a\u5ba2\u6237\u63d0\u4f9b\u5404\u79cd\u5f62\u5f0f\u7684\u670d\u52a1\u3002 \u6bcf\u4e2a\u63a5\u53e3\u90fd\u7531\u4e00\u4e2a 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26(GUID)\u6765\u6807\u8bc6\u3002\u5ba2\u6237\u901a\u8fc7 GUID \u83b7\u5f97\u63a5\u53e3\u7684\u6307\u9488\u3002 \u6bcf\u4e2a\u5bf9\u8c61\u90fd\u6709\u4e00\u4e2a 128 \u4f4d\u7684 GUID \u6765\u6807\u8bc6\uff0c\u79f0\u4e3a CLSID\uff0c\u4fdd\u8bc1\u5728\u5168\u7403\u8303\u56f4\u5185\u7684\u552f\u4e00\u6027\u3002 \u5bf9\u4e8e\u5ba2\u6237\u6765\u8bf4\uff0c\u53ea\u4e0e\u63a5\u53e3\u6253\u4ea4\u9053\u3002","title":"\u5bf9\u8c61\u4e0e\u63a5\u53e3"},{"location":"cs/software/compa/#_3","text":"\u7a33\u5b9a\u6027\u3001\u53ef\u9760\u884c\u597d\u3002 \u8f6f\u4ef6\u7684\u53ef\u6269\u5c55\u6027\u66f4\u597d\u3002 \u63d0\u9ad8\u6027\u80fd\u3002 \u5728\u7f51\u7edc\u4e0a\u5b9e\u73b0\u65f6\uff0c\u53ef\u4ee5\u964d\u4f4e\u7f51\u7edc\u6d41\u91cf\u3002 \u7528\u4e8e\u6570\u636e\u5e93\u65f6\uff0c\u53ef\u4ee5\u5b9e\u73b0\u4e8b\u7269\u673a\u5236\uff0c\u63d0\u4f9b\u6570\u636e\u5907\u4efd\u80fd\u529b\u7b49\u3002 \u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u6700\u5927\u4f18\u70b9\u662f\u7a33\u5b9a\u6027\u597d\uff0c\u800c\u8fd9\u6b63\u662f COM \u6a21\u578b\u7684\u76ee\u6807\uff0c\u5c24\u5176\u5bf9\u4e8e\u8de8\u8fdb\u7a0b\u7684\u7a0b\u5e8f\u901a\u4fe1\u3002 \u4e0b\u9762\u662f COM \u4f7f\u7528\u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b\u7684\u51e0\u79cd\u7075\u6d3b\u7528\u6cd5\uff1a","title":"\u5ba2\u6237/\u670d\u52a1\u5668\u6a21\u578b"},{"location":"cs/software/compa/#com_3","text":"\u5728 Microsoft Windows \u64cd\u4f5c\u7cfb\u7edf\u73af\u5883\u4e0b\uff0cCOM \u5e93\u4ee5 .dll \u6587\u4ef6\u7684\u5f62\u5f0f\u5b58\u5728\uff0c\u5305\u62ec\u4e00\u4e0b\u5185\u5bb9\uff1a \u63d0\u4f9b\u4e86\u5c11\u91cf\u7684 API \u51fd\u6570\u5b9e\u73b0\u5ba2\u6237\u548c\u670d\u52a1\u5668\u7aef COM \u5e94\u7528\u7684\u521b\u5efa\u8fc7\u7a0b\u3002\u5728\u5ba2\u6237\u7aef\uff0c\u4e3b\u8981\u662f\u4e00\u4e9b\u521b\u5efa\u51fd\u6570;\u800c\u5728\u670d\u52a1\u5668\u7aef\uff0c\u63d0\u4f9b\u4e00\u4e9b\u5bf9\u5bf9\u8c61\u7684\u8bbf\u95ee\u652f\u6301 COM \u901a\u8fc7\u6ce8\u518c\u8868\u67e5\u627e\u672c\u5730\u670d\u52a1\u5668\u5373 EXE \u7a0b\u5e8f\uff0c\u4ee5\u53ca\u7a0b\u5e8f\u540d\u4e0e CLSID \u7684\u8f6c\u6362\u7b49 \u63d0\u4f9b\u4e86\u4e00\u79cd\u6807\u51c6\u7684\u5185\u5b58\u63a7\u5236\u65b9\u6cd5\uff0c\u4f7f\u5e94\u7528\u63a7\u5236\u8fdb\u7a0b\u4e2d\u5185\u5b58\u7684\u5206\u914d COM \u5e93\u4e00\u822c\u4e0d\u5728\u5e94\u7528\u7a0b\u5e8f\u5c42\u5b9e\u73b0\uff0c\u800c\u5728\u64cd\u4f5c\u7cfb\u7edf\u5c42\u6b21\u4e0a\u5b9e\u73b0\uff0c\u56e0\u6b64\u4e00\u4e2a\u64cd\u4f5c\u7cfb\u7edf\u53ea\u6709\u4e00\u4e2a COM \u5e93\u5b9e\u73b0\u3002","title":"COM \u5e93"},{"location":"cs/software/compa/#com_4","text":"\u8bed\u8a00\u65e0\u5173\u6027\uff1aCOM \u89c4\u8303\u7684\u5b9a\u4e49\u4e0d\u4f9d\u8d56\u4e8e\u7279\u5b9a\u7684\u8bed\u8a00\uff08\u4f46\u53ea\u6709\u7528 C/C++ \u8bed\u8a00\u624d\u80fd\u5b9e\u73b0 COM \u4e2d\u6240\u6709\u7684\u7279\u6027\uff09 \u8fdb\u7a0b\u900f\u660e\u7279\u6027\uff1a\u8de8\u8fdb\u7a0b\u64cd\u4f5c\u662f\u5f88\u6709\u5fc5\u8981\u7684\u3002\u5b9e\u73b0\u7684\u5173\u952e\u5728\u4e8e COM \u5e93 \u53ef\u91cd\u7528\u6027\uff1a\u4efb\u4f55\u5bf9\u8c61\u6a21\u578b\u7684\u5b9e\u73b0\u76ee\u6807\u3002 \u5305\u5bb9\u65b9\u5f0f \u805a\u5408\u65b9\u5f0f","title":"COM \u7279\u6027"},{"location":"cs/software/compa/#com_5","text":"","title":"COM \u5bf9\u8c61\u548c\u63a5\u53e3"},{"location":"cs/software/compa/#com_6","text":"COM \u63d0\u4f9b\u7684\u662f\u9762\u5411\u5bf9\u8c61\u7684\u7ec4\u4ef6\u6a21\u578b\uff0cCOM \u7ec4\u4ef6\u63d0\u4f9b\u7ed9\u5ba2\u6237\u7684\u662f\u4ee5\u5bf9\u8c61\u5f62\u5f0f\u5c01\u88c5\u8d77\u6765\u7684\u5b9e\u4f53 \u7c7b\u4f3c\u4e8e C++ \u8bed\u8a00\u4e2d\u7c7b\uff08class\uff09\u6982\u5ff5\uff0cCOM \u5bf9\u8c61\u4e5f\u5305\u62ec\u5c5e\u6027\uff08\u4e5f\u79f0\u4e3a\u72b6\u6001\uff09\u548c\u65b9\u6cd5\uff08\u4e5f\u79f0\u4e3a\u64cd\u4f5c\uff09","title":"COM \u5bf9\u8c61"},{"location":"cs/software/compa/#com-clsid","text":"\u5ba2\u6237\u7a0b\u5e8f\u901a\u8fc7\u4e00\u4e2a\u5168\u5c40\u6807\u8bc6\u7b26\u8fdb\u884c\u5bf9\u8c61\u7684\u521b\u5efa\u548c\u521d\u59cb\u5316\u5de5\u4f5c COM \u89c4\u8303\u91c7\u7528\u4e86 128 \u4f4d\u7684\u5168\u5c40\u552f\u4e00\u6807\u8bc6\u7b26\uff08GUID\uff09\u6765\u6807\u8bc6\u5bf9\u8c61\uff08\u968f\u673a\u6570\uff09","title":"COM \u5bf9\u8c61\u7684\u6807\u8bc6\u2014\u2014CLSID"},{"location":"cs/software/compa/#com-c","text":"\u5c01\u88c5\u7279\u6027 \u53ef\u91cd\u7528\u6027","title":"COM \u5bf9\u8c61\u4e0e C++ \u5bf9\u8c61\u7684\u6bd4\u8f83"},{"location":"cs/software/compa/#com_7","text":"","title":"COM \u63a5\u53e3"},{"location":"cs/software/compa/#api-com","text":"","title":"\u4ece API \u5230 COM \u63a5\u53e3"},{"location":"cs/software/design-pattern/","text":"\u8bbe\u8ba1\u6a21\u5f0f \u00b6 \u7ea6 2112 \u4e2a\u5b57 496 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 13 \u5206\u949f \u8bbe\u8ba1\u6a21\u5f0f \u662f\u8f6f\u4ef6\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002\u4ed6\u4eec\u5c31\u60f3\u80fd\u6839\u636e\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u7684\u9884\u5236\u84dd\u56fe\uff0c\u53ef\u7528\u4e8e\u89e3\u51b3\u4ee3\u7801\u4e2d\u53cd\u590d\u51fa\u73b0\u7684\u8bbe\u8ba1\u95ee\u9898\u3002 \u8bbe\u8ba1\u6a21\u5f0f\u4e0e\u65b9\u6cd5\u6216\u5e93\u7684\u4f7f\u7528\u65b9\u5f0f\u4e0d\u540c\uff0c\u4f60\u5f88\u96be\u76f4\u63a5\u5728\u81ea\u5df1\u7684\u7a0b\u5e8f\u4e2d\u5957\u7528\u67d0\u4e2a\u8bbe\u8ba1\u6a21\u5f0f\u3002\u6a21\u5f0f\u5e76\u4e0d\u662f\u4e00\u6bb5\u7279\u5b9a\u7684\u4ee3\u7801\uff0c\u800c\u662f\u89e3\u51b3\u7279\u5b9a\u95ee\u9898\u7684\u4e00\u822c\u6027\u6982\u5ff5\u3002 \u4f60\u53ef\u4ee5\u6839\u636e\u6a21\u5f0f\u6765\u5b9e\u73b0\u7b26\u5408\u81ea\u5df1\u7a0b\u5e8f\u5b9e\u9645\u6240\u9700\u7684\u89e3\u51b3\u65b9\u6848\u3002 \u4eba\u4eec\u5e38\u5e38\u4f1a\u6df7\u6dc6\u6a21\u5f0f\u548c\u7b97\u6cd5\uff0c\u56e0\u4e3a\u4e24\u8005\u5728\u6982\u5ff5\u4e0a\u90fd\u662f\u5df2\u77e5\u7279\u5b9a\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002 \u4f46\u7b97\u6cd5\u603b\u662f\u660e\u786e\u5b9a\u4e49\u8fbe\u6210\u7279\u5b9a\u76ee\u6807\u6240\u9700\u7684\u4e00\u7cfb\u5217\u6b65\u9aa4\uff0c\u800c\u6a21\u5f0f\u5219\u662f\u5bf9\u89e3\u51b3\u65b9\u6848\u7684\u66f4\u9ad8\u5c42\u6b21\u63cf\u8ff0\u3002\u540c\u4e00\u6a21\u5f0f\u5728\u4e24\u4e2a\u4e0d\u540c\u7a0b\u5e8f\u4e2d\u7684\u5b9e\u73b0\u4ee3\u7801\u53ef\u80fd\u4f1a\u4e0d\u4e00\u6837\u3002 \u7b97\u6cd5\u66f4\u50cf\u662f\u83dc\u8c31\uff1a\u63d0\u4f9b\u8fbe\u6210\u76ee\u6807\u7684\u660e\u786e\u6b65\u9aa4\u3002\u800c\u6a21\u5f0f\u66f4\u50cf\u662f\u84dd\u56fe\uff1a\u4f60\u53ef\u4ee5\u770b\u5230\u6700\u7ec8\u7684\u7ed3\u679c\u548c\u6a21\u5f0f\u7684\u529f\u80fd\uff0c\u4f46\u9700\u8981\u81ea\u5df1\u786e\u5b9a\u5b9e\u73b0\u6b65\u9aa4\u3002 Abstract \u5f52\u6863\u5b66\u4e60\u8bbe\u8ba1\u6a21\u5f0f\u65f6\u7684\u4e00\u4e9b\u7b14\u8bb0 \u4e3b\u8981\u7528 C++ \u5b9e\u73b0\uff0c\u6301\u7eed\u66f4\u65b0\u4e2d \u521b\u5efa\u578b\u6a21\u5f0f \u00b6 \u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u521b\u5efa\u4e00\u7cfb\u5217\u76f8\u5173\u7684\u5bf9\u8c61\uff0c \u800c\u65e0\u9700\u6307\u5b9a\u5176\u5177\u4f53\u7c7b\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5982\u679c\u4ee3\u7801\u9700\u8981\u4e0e\u591a\u4e2a\u4e0d\u540c\u7cfb\u5217\u7684\u76f8\u5173\u4ea7\u54c1\u4ea4\u4e92\uff0c\u4f46\u662f\u7531\u4e8e\u65e0\u6cd5\u63d0\u524d\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\uff0c\u6216\u8005\u51fa\u4e8e\u5bf9\u672a\u6765\u6269\u5c55\u6027\u7684\u8003\u8651\uff0c\u4f60\u4e0d\u5e0c\u671b\u4ee3\u7801\u57fa\u4e8e\u4ea7\u54c1\u7684\u5177\u4f53\u7c7b\u8fdb\u884c\u6784\u5efa\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u3002 \u5982\u679c\u4f60\u6709\u4e00\u4e2a\u57fa\u4e8e\u4e00\u7ec4\u62bd\u8c61\u65b9\u6cd5\u7684\u7d2f\uff0c\u4e14\u5176\u4e3b\u8981\u529f\u80fd\u56e0\u6b64\u53d8\u5f97\u4e0d\u660e\u786e\uff0c\u90a3\u4e48\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u8003\u8651\u4e86\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u786e\u4fdd\u540c\u4e00\u5de5\u5382\u751f\u4ea7\u7684\u4ea7\u54c1\u76f8\u4e92\u5339\u914d \u4f60\u53ef\u4ee5\u907f\u514d\u5ba2\u6237\u7aef\u548c\u5177\u4f53\u4ea7\u54c1\u4ee3\u7801\u7684\u8026\u5408 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u4ea7\u54c1\u751f\u6210\u4ee3\u7801\u62bd\u53d6\u5230\u540c\u4e00\u4f4d\u7f6e\uff0c\u4f7f\u5f97\u4ee3\u7801\u6613\u4e8e\u7ef4\u62a4 \u5f00\u95ed\u539f\u5219\u3002\u5411\u5e94\u7528\u7a0b\u5e8f\u4e2d\u5f15\u5165\u65b0\u4ea7\u54c1\u53d8\u4f53\u65f6\uff0c\u4f60\u65e0\u9700\u4fee\u6539\u5ba2\u6237\u7aef\u4ee3\u7801 \u7f3a\u70b9 \u00b6 \u7531\u4e8e\u91c7\u7528\u8be5\u6a21\u5f0f\u9700\u8981\u5411\u5e94\u7528\u4e2d\u5f15\u5165\u4f17\u591a\u63a5\u53e3\u548c\u7c7b\uff0c\u4ee3\u7801\u53ef\u80fd\u4f1a\u6bd4\u4e4b\u524d\u66f4\u52a0\u590d\u6742 AbstractFactory.cpp #include #include class AbstractProductA { public : virtual ~ AbstractProductA () {}; virtual std :: string UsefulFunctionA () const = 0 ; }; class ConcreteProductA1 : public AbstractProductA { public : std :: string UsefulFunctionA () const override { return \"The result of the product A1.\" ; } }; class ConcreteProductA2 : public AbstractProductA { public : std :: string UsefulFunctionA () const override { return \"The result of the product A2.\" ; } }; class AbstractProductB { public : virtual ~ AbstractProductB () {}; virtual std :: string UsefulFunctionB () const = 0 ; virtual std :: string AnotherUsefulFunctionB ( const AbstractProductA & collaborator ) const = 0 ; }; class ConcreteProductB1 : public AbstractProductB { public : std :: string UsefulFunctionB () const override { return \"The result of the product B1.\" ; } std :: string AnotherUsefulFunctionB ( const AbstractProductA & collaborator ) const override { const std :: string result = collaborator . UsefulFunctionA (); return \"The result of the B1 collaborating with ( \" + result + \" )\" ; } }; class ConcreteProductB2 : public AbstractProductB { public : std :: string UsefulFunctionB () const override { return \"The result of the product B2.\" ; } std :: string AnotherUsefulFunctionB ( const AbstractProductA & collaborator ) const override { const std :: string result = collaborator . UsefulFunctionA (); return \"The result of the B2 collaborating with ( \" + result + \" )\" ; } }; class AbstractFactory { public : virtual AbstractProductA * CreateProductA () const = 0 ; virtual AbstractProductB * CreateProductB () const = 0 ; }; class ConcreteFactory1 : public AbstractFactory { public : AbstractProductA * CreateProductA () const override { return new ConcreteProductA1 (); } AbstractProductB * CreateProductB () const override { return new ConcreteProductB1 (); } }; class ConcreteFactory2 : public AbstractFactory { public : AbstractProductA * CreateProductA () const override { return new ConcreteProductA2 (); } AbstractProductB * CreateProductB () const override { return new ConcreteProductB2 (); } }; void ClientCode ( const AbstractFactory & factory ) { const AbstractProductA * product_A = factory . CreateProductA (); const AbstractProductB * product_B = factory . CreateProductB (); std :: cout << product_B -> UsefulFunctionB () << \" \\n \" ; std :: cout << product_B -> AnotherUsefulFunctionB ( * product_A ) << \" \\n \" ; delete product_A ; delete product_B ; } int main () { std :: cout << \"Client: Testing client code with the first factory type: \\n \" ; ConcreteFactory1 * f1 = new ConcreteFactory1 (); ClientCode ( * f1 ); delete f1 ; std :: cout << std :: endl ; std :: cout << \"Client: Testing the same client code with the second factory type: \\n \" ; ConcreteFactory2 * f2 = new ConcreteFactory2 (); ClientCode ( * f2 ); delete f2 ; return 0 ; } \u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u5176\u5728\u7236\u7c7b\u4e2d\u63d0\u4f9b\u4e00\u4e2a\u521b\u5efa\u5bf9\u8c61\u7684\u65b9\u6cd5\uff0c\u5141\u8bb8\u5b50\u7c7b\u51b3\u5b9a\u5b9e\u4f8b\u5316\u5bf9\u8c61\u7684\u7c7b\u578b\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u7f16\u5199\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u65e0\u6cd5\u9884\u77e5\u5bf9\u8c61\u786e\u5207\u7c7b\u522b\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\u65f6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u7528\u6237\u80fd\u591f\u6269\u5c55\u4f60\u8f6f\u4ef6\u5e93\u6216\u6846\u67b6\u7684\u5185\u90e8\u7ec4\u4ef6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u590d\u7528\u73b0\u6709\u5bf9\u8c61\u6765\u8282\u7701\u7cfb\u7edf\u8d44\u6e90\uff0c\u800c\u4e0d\u662f\u6bcf\u6b21\u90fd\u91cd\u65b0\u521b\u5efa\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u53ef\u4ee5\u907f\u514d\u521b\u5efa\u8005\u548c\u5177\u4f53\u4ea7\u54c1\u4e4b\u95f4\u7684\u7d27\u5bc6\u8026\u5408 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u4ea7\u54c1\u521b\u5efa\u4ee3\u7801\u653e\u5728\u7a0b\u5e8f\u7684\u5355\u4e00\u4f4d\u7f6e\uff0c\u4ece\u800c\u4f7f\u5f97\u4ee3\u7801\u66f4\u5bb9\u6613\u7ef4\u62a4 \u5f00\u95ed\u539f\u5219\u3002\u65e0\u9700\u66f4\u6539\u73b0\u6709\u5ba2\u6237\u7aef\u4ee3\u7801\uff0c\u4f60\u5c31\u53ef\u4ee5\u5728\u7a0b\u5e8f\u4e2d\u5f15\u5165\u65b0\u7684\u4ea7\u54c1\u7c7b\u578b \u7f3a\u70b9 \u00b6 \u5e94\u7528\u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f\u9700\u8981\u5f15\u5165\u8bb8\u591a\u65b0\u7684\u5b50\u7c7b\uff0c\u4ee3\u7801\u53ef\u80fd\u4f1a\u53d8\u5f97\u590d\u6742\u3002\u6700\u597d\u7684\u60c5\u51b5\u65f6\u5c06\u8be5\u6a21\u5f0f\u5f15\u5165\u521b\u5efa\u8005\u7c7b\u7684\u73b0\u6709\u5c42\u6b21\u7ed3\u6784\u4e2d FactoryMethod.cpp #include class Product { public : virtual ~ Product () {} virtual std :: string Operation () const = 0 ; }; class ConcreteProduct1 : public Product { public : std :: string Operation () const override { return \"{Result of the ConcreteProduct1}\" ; } }; class ConcreteProduct2 : public Product { public : std :: string Operation () const override { return \"{Result of the ConcreteProduct2}\" ; } }; class Creator { public : virtual ~ Creator () {}; virtual Product * FactoryMethod () const = 0 ; std :: string SomeOperation () const { Product * product = this -> FactoryMethod (); std :: string result = \"Creator: The same creator's code has just worked with \" + product -> Operation (); delete product ; return result ; } }; class ConcreteCreator1 : public Creator { public : Product * FactoryMethod () const override { return new ConcreteProduct1 (); } }; class ConcreteCreator2 : public Creator { public : Product * FactoryMethod () const override { return new ConcreteProduct2 (); } }; void ClientCode ( const Creator & creator ) { std :: cout << \"Client: I'm not aware of the creator's class, but it still works. \\n \" << creator . SomeOperation () << std :: endl ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); std :: cout << \"App: Launched with the ConcreteCreator1. \\n \" ; Creator * creator1 = new ConcreteCreator1 (); ClientCode ( * creator1 ); std :: cout << std :: endl ; std :: cout << \"App: Launched with the ConcreteCreator2. \\n \" ; Creator * creator2 = new ConcreteCreator2 (); ClientCode ( * creator2 ); delete creator1 ; delete creator2 ; return 0 ; } \u751f\u6210\u5668\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u751f\u6210\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u5206\u6b65\u9aa4\u521b\u5efa\u590d\u6742\u5bf9\u8c61\u3002\u8be5\u6a21\u5f0f\u5141\u8bb8\u4f60\u4f7f\u7528\u76f8\u540c\u7684\u521b\u5efa\u4ee3\u7801\u751f\u6210\u4e0d\u540c\u7c7b\u578b\u548c\u5f62\u5f0f\u7684\u5bf9\u8c61\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f\u53ef\u907f\u514d\u201c\u91cd\u53e0\u6784\u9020\u51fd\u6570\u201d\u7684\u51fa\u73b0 \u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u4ee3\u7801\u521b\u5efa\u4e0d\u540c\u5f62\u5f0f\u7684\u4ea7\u54c1\uff08\u4f8b\u5982\u77f3\u5934\u6216\u6728\u5934\u623f\u5c4b\uff09\u65f6\uff0c\u53ef\u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f \u4f7f\u7528\u751f\u6210\u5668\u6784\u9020\u7ec4\u5408\u6811\u6216\u5176\u4ed6\u590d\u6742\u5bf9\u8c61 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u5206\u6b65\u521b\u5efa\u5bf9\u8c61\uff0c\u6682\u7f13\u521b\u5efa\u6b65\u9aa4\u6216\u9012\u5f52\u8fd0\u884c\u521b\u5efa\u6b65\u9aa4 \u751f\u6210\u4e0d\u540c\u5f62\u5f0f\u7684\u4ea7\u54c1\u65f6\uff0c\u4f60\u53ef\u4ee5\u590d\u7528\u76f8\u540c\u7684\u5236\u9020\u4ee3\u7801 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u590d\u6742\u6784\u9020\u4ee3\u7801\u4ece\u4ea7\u54c1\u7684\u4e1a\u52a1\u903b\u8f91\u4e2d\u5206\u79bb\u51fa\u6765 \u7f3a\u70b9 \u00b6 \u7531\u4e8e\u8be5\u6a21\u5f0f\u9700\u8981\u65b0\u589e\u591a\u4e2a\u7c7b\uff0c\u56e0\u6b64\u4ee3\u7801\u6574\u4f53\u590d\u6742\u7a0b\u5ea6\u4f1a\u6709\u6240\u589e\u52a0 Builder.cpp #include #include #include class Product1 { public : std :: vector < std :: string > parts ; void ListParts () const { std :: cout << \"Product parts: \" ; for ( size_t i = 0 ; i < parts . size (); i ++ ) { std :: cout << parts [ i ] << \" \\n \" [ i == parts . size () - 1 ]; } std :: cout << \" \\n \" ; } }; class Builder { public : virtual ~ Builder () {} virtual void ProducePartA () const = 0 ; virtual void ProducePartB () const = 0 ; virtual void ProducePartC () const = 0 ; }; class ConcreteBuilder1 : public Builder { private : Product1 * product ; public : ConcreteBuilder1 () { this -> Reset (); } ~ ConcreteBuilder1 () { delete product ; } void Reset () { this -> product = new Product1 (); } void ProducePartA () const override { this -> product -> parts . push_back ( \"PartA1\" ); } void ProducePartB () const override { this -> product -> parts . push_back ( \"PartB1\" ); } void ProducePartC () const override { this -> product -> parts . push_back ( \"PartC1\" ); } Product1 * GetProduct () { Product1 * result = this -> product ; this -> Reset (); return result ; } }; class Director { private : Builder * builder ; public : void set_builder ( Builder * builder ) { this -> builder = builder ; } void BuildMinimalViableProduct () { this -> builder -> ProducePartA (); } void BuildFullFeaturedProduct () { this -> builder -> ProducePartA (); this -> builder -> ProducePartB (); this -> builder -> ProducePartC (); } }; void ClientCode ( Director & director ) { ConcreteBuilder1 * builder = new ConcreteBuilder1 (); director . set_builder ( builder ); std :: cout << \"Standard basic product: \\n \" ; director . BuildMinimalViableProduct (); Product1 * p = builder -> GetProduct (); p -> ListParts (); delete p ; std :: cout << \"Standard full featured product: \\n \" ; director . BuildFullFeaturedProduct (); p = builder -> GetProduct (); p -> ListParts (); delete p ; std :: cout << \"Custom product: \\n \" ; builder -> ProducePartA (); builder -> ProducePartB (); p = builder -> GetProduct (); p -> ListParts (); delete p ; delete builder ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); Director * director = new Director (); ClientCode ( * director ); delete director ; return 0 ; } \u539f\u578b\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u539f\u578b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u590d\u5236\u5df2\u6709\u5bf9\u8c61\uff0c \u800c\u53c8\u65e0\u9700\u4f7f\u4ee3\u7801\u4f9d\u8d56\u5b83\u4eec\u6240\u5c5e\u7684\u7c7b\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5982\u679c\u4f60\u9700\u8981\u590d\u5236\u4e00\u4e9b\u5bf9\u8c61\uff0c\u540c\u65f6\u53c8\u5e0c\u671b\u4ee3\u7801\u72ec\u7acb\u4e8e\u8fd9\u4e9b\u5bf9\u8c61\u6240\u5c5e\u7684\u5177\u4f53\u7c7b\uff0c\u53ef\u4ee5\u4f7f\u7528\u539f\u578b\u6a21\u5f0f \u5982\u679c\u5b50\u7c7b\u7684\u533a\u522b\u4ec5\u5728\u4e8e\u5176\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u65b9\u5f0f\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u4f7f\u7528\u8be5\u6a21\u5f0f\u6765\u51cf\u5c11\u5b50\u7c7b\u7684\u6570\u91cf\u3002\u522b\u4eba\u521b\u5efa\u8fd9\u4e9b\u5b50\u7c7b\u7684\u76ee\u7684\u53ef\u80fd\u662f\u4e3a\u96f6\u521b\u5efa\u7279\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u514b\u9686\u5bf9\u8c61\uff0c\u800c\u65e0\u9700\u4e0e\u5b83\u4eec\u6240\u5c5e\u7684\u5177\u4f53\u7c7b\u76f8\u8026\u5408 \u4f60\u53ef\u4ee5\u514b\u9686\u9884\u751f\u6210\u539f\u578b\uff0c\u907f\u514d\u53cd\u590d\u8fd0\u884c\u521d\u59cb\u5316\u4ee3\u7801 \u4f60\u53ef\u4ee5\u66f4\u65b9\u4fbf\u5730\u751f\u6210\u590d\u6742\u5bf9\u8c61 \u4f60\u53ef\u4ee5\u7528\u7ee7\u627f\u4ee5\u5916\u7684\u65b9\u5f0f\u6765\u5904\u7406\u590d\u6742\u5bf9\u8c61\u7684\u4e0d\u540c\u914d\u7f6e \u7f3a\u70b9 \u00b6 \u514b\u9686\u5305\u542b\u5faa\u73af\u5f15\u7528\u7684\u590d\u6742\u5bf9\u8c61\u53ef\u80fd\u4f1a\u975e\u5e38\u9ebb\u70e6 Prototype.cpp #include #include #include enum Type { PROTOTYPE_1 = 0 , PROTOTYPE_2 }; class Prototype { protected : std :: string prototype_name_ ; float prototype_field_ ; public : Prototype () {} Prototype ( std :: string prototype_name ) : prototype_name_ ( prototype_name ) {} virtual ~ Prototype () {} virtual Prototype * Clone () const = 0 ; virtual void Method ( float prototype_field ) { this -> prototype_field_ = prototype_field ; std :: cout << \"Call Method from \" << prototype_name_ << \" with field : \" << prototype_field << std :: endl ; } }; class ConcretePrototype1 : public Prototype { private : float concrete_prototype_field1_ ; public : ConcretePrototype1 ( std :: string prototype_name , float concrete_prototype_field ) : Prototype ( prototype_name ), concrete_prototype_field1_ ( concrete_prototype_field ) {} Prototype * Clone () const override { return new ConcretePrototype1 ( * this ); } }; class ConcretePrototype2 : public Prototype { private : float concrete_prototype_field2_ ; public : ConcretePrototype2 ( std :: string prototype_name , float concrete_prototype_field ) : Prototype ( prototype_name ), concrete_prototype_field2_ ( concrete_prototype_field ) {} Prototype * Clone () const override { return new ConcretePrototype2 ( * this ); } }; class PrototypeFactory { private : std :: unordered_map < Type , Prototype * , std :: hash < int >> prototypes_ ; public : PrototypeFactory () { prototypes_ [ Type :: PROTOTYPE_1 ] = new ConcretePrototype1 ( \"PROTOTYPE_1 \" , 50.f ); prototypes_ [ Type :: PROTOTYPE_2 ] = new ConcretePrototype2 ( \"PROTOTYPE_2 \" , 60.f ); } ~ PrototypeFactory () { delete prototypes_ [ Type :: PROTOTYPE_1 ]; delete prototypes_ [ Type :: PROTOTYPE_2 ]; } Prototype * CreatePrototype ( Type type ) { return prototypes_ [ type ] -> Clone (); } }; void Client ( PrototypeFactory & prototype_factory ) { std :: cout << \"Let's create a Prototype 1 \\n \" ; Prototype * prototype = prototype_factory . CreatePrototype ( Type :: PROTOTYPE_1 ); prototype -> Method ( 90 ); delete prototype ; std :: cout << \" \\n \" ; std :: cout << \"Let's create a Prototype 2 \\n \" ; prototype = prototype_factory . CreatePrototype ( Type :: PROTOTYPE_2 ); prototype -> Method ( 10 ); delete prototype ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); PrototypeFactory * prototype_factory = new PrototypeFactory (); Client ( * prototype_factory ); delete prototype_factory ; return 0 ; } \u5355\u4f8b\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u5355\u4f8b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u8ba9\u4f60\u80fd\u591f\u4fdd\u8bc1\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u8bbf\u95ee\u8be5\u5b9e\u4f8b\u7684\u5168\u5c40\u8282\u70b9\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5982\u679c\u7a0b\u5e8f\u4e2d\u7684\u67d0\u4e2a\u7c7b\u5bf9\u4e8e\u6240\u6709\u5ba2\u6237\u7aef\u53ea\u6709\u4e00\u4e2a\u53ef\u7528\u7684\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f \u5982\u679c\u4f60\u9700\u8981\u66f4\u52a0\u4e25\u683c\u5730\u63a7\u5236\u5168\u5c40\u53d8\u91cf\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u4f60\u53ef\u4ee5\u4fdd\u8bc1\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b \u4f60\u83b7\u5f97\u4e86\u4e00\u4e2a\u6307\u5411\u8be5\u5b9e\u4f8b\u7684\u5168\u5c40\u8bbf\u95ee\u8282\u70b9 \u4ec5\u5728\u9996\u6b21\u8bf7\u6c42\u5355\u4f8b\u5bf9\u8c61\u65f6\u5bf9\u5176\u8fdb\u884c\u521d\u59cb\u5316 \u7f3a\u70b9 \u00b6 \u8fdd\u53cd\u4e86\u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u8be5\u6a21\u5f0f\u540c\u65f6\u89e3\u51b3\u4e86\u4e24\u4e2a\u95ee\u9898 \u5355\u4f8b\u6a21\u5f0f\u53ef\u80fd\u63a9\u76d6\u4e0d\u826f\u8bbe\u8ba1\uff0c\u6bd4\u5982\u7a0b\u5e8f\u5404\u7ec4\u4ef6\u4e4b\u95f4\u4e92\u76f8\u4e86\u89e3\u8fc7\u591a\u7b49 \u8be5\u6a21\u5f0f\u5728\u591a\u7ebf\u7a0b\u73af\u5883\u4e0b\u9700\u8981\u8fdb\u884c\u7279\u6b8a\u5904\u7406\uff0c\u907f\u514d\u591a\u4e2a\u7ebf\u7a0b\u591a\u6b21\u521b\u5efa\u5355\u4f8b\u5bf9\u8c61 \u5355\u4f8b\u7684\u5ba2\u6237\u7aef\u4ee3\u7801\u5355\u5143\u6d4b\u8bd5\u53ef\u80fd\u4f1a\u6bd4\u8f83\u56f0\u96be\uff0c\u56e0\u4e3a\u8bb8\u591a\u6d4b\u8bd5\u6846\u67b6\u4ee5\u57fa\u4e8e\u7ee7\u627f\u7684\u65b9\u5f0f\u521b\u5efa\u6a21\u62df\u5bf9\u8c61\u3002\u7531\u4e8e\u5355\u4f8b\u7c7b\u7684\u6784\u9020\u51fd\u6570\u662f\u79c1\u6709\u7684\uff0c\u800c\u4e14\u7edd\u5927\u90e8\u5206\u8bed\u8a00\u65e0\u6cd5\u91cd\u5199\u9759\u6001\u65b9\u6cd5\uff0c\u6240\u4ee5\u4f60\u9700\u8981\u60f3\u51fa\u4ed4\u7ec6\u8003\u8651\u6a21\u62df\u5355\u4f8b\u7684\u65b9\u6cd5\u3002\u8981\u4e48\u5e72\u8106\u4e0d\u7f16\u5199\u6d4b\u8bd5\u4ee3\u7801\uff0c\u6216\u8005\u4e0d\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f Singleton.cpp #include #include #include class Singleton { protected : Singleton ( const std :: string value ) : value_ ( value ) {} static Singleton * singleton_ ; std :: string value_ ; public : Singleton ( Singleton & other ) = delete ; void operator = ( const Singleton & ) = delete ; static Singleton * GetInstance ( const std :: string & value ); void SomeBusinessLogic () {} std :: string value () const { return value_ ; } }; Singleton * Singleton :: singleton_ = nullptr ; Singleton * Singleton::GetInstance ( const std :: string & value ) { if ( singleton_ == nullptr ) { singleton_ = new Singleton ( value ); } return singleton_ ; } void ThreadFoo () { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 1000 )); Singleton * singleton = Singleton :: GetInstance ( \"FOO\" ); std :: cout << singleton -> value () << \" \\n \" ; } void ThreadBar () { std :: this_thread :: sleep_for ( std :: chrono :: milliseconds ( 1000 )); Singleton * singleton = Singleton :: GetInstance ( \"BAR\" ); std :: cout << singleton -> value () << \" \\n \" ; } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); std :: cout << \"If you see the same value, then singleton was reused (yay! \\n \" << \"If you see different values, then 2 singletons were created (booo!!) \\n\\n \" << \"RESULT: \\n \" ; std :: thread t1 ( ThreadFoo ); std :: thread t2 ( ThreadBar ); t1 . join (); t2 . join (); return 0 ; } \u7ed3\u6784\u578b\u6a21\u5f0f \u00b6 \u9002\u914d\u5668\u6a21\u5f0f \u00b6 \u6982\u8ff0 \u00b6 \u9002\u914d\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u7ed3\u6784\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u4f7f\u63a5\u53e3\u4e0d\u517c\u5bb9\u7684\u5bf9\u8c61\u80fd\u591f\u76f8\u4e92\u5408\u4f5c\u3002 \u5e94\u7528\u573a\u666f \u00b6 \u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u67d0\u4e2a\u7c7b\uff0c\u4f46\u662f\u5176\u63a5\u53e3\u4e0e\u5176\u4ed6\u4ee3\u7801\u4e0d\u517c\u5bb9\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u9002\u914d\u5668\u7c7b \u5982\u679c\u4f60\u9700\u8981\u590d\u7528\u8fd9\u6837\u4e00\u4e9b\u7c7b\uff0c\u4ed6\u4eec\u5904\u4e8e\u540c\u4e00\u7ee7\u627f\u4f53\u7cfb\uff0c\u5e76\u4e14\u5b83\u4eec\u53c8\u6709\u4e86\u989d\u5916\u7684\u4e00\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u8fd9\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\u4e0d\u662f\u6240\u6709\u5728\u8fd9\u4e00\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7684\u5b50\u7c7b\u6240\u5177\u6709\u7684\u5171\u6027 \u4f18\u7f3a\u70b9 \u00b6 \u4f18\u70b9 \u00b6 \u5355\u4e00\u804c\u8d23\u539f\u5219\u3002\u4f60\u53ef\u4ee5\u5c06\u63a5\u53e3\u6216\u6570\u636e\u8f6c\u6362\u4ee3\u7801\u4ece\u7a0b\u5e8f\u4e3b\u8981\u4e5f\u8981\u4e1a\u52a1\u903b\u8f91\u4e2d\u5206\u79bb \u5f00\u95ed\u539f\u5219\u3002\u53ea\u8981\u5ba2\u6237\u7aef\u4ee3\u7801\u901a\u8fc7\u5ba2\u6237\u7aef\u63a5\u53e3\u4e0e\u9002\u914d\u5668\u8fdb\u884c\u4ea4\u4e92\uff0c\u4f60\u5c31\u80fd\u5728\u4e0d\u4fee\u6539\u73b0\u6709\u5ba2\u6237\u7aef\u4ee3\u7801\u7684\u60c5\u51b5\u4e0b\u5728\u7a0b\u5e8f\u4e2d\u6dfb\u52a0\u65b0\u7c7b\u578b\u7684\u9002\u914d\u5668 \u7f3a\u70b9 \u00b6 \u4ee3\u7801\u6574\u4f53\u590d\u6742\u5ea6\u589e\u52a0\uff0c\u56e0\u4e3a\u4f60\u9700\u8981\u65b0\u589e\u4e00\u7cfb\u5217\u63a5\u53e3\u548c\u7c7b\u3002\u6709\u65f6\u76f4\u63a5\u66f4\u6539\u670d\u52a1\u7c7b\u4f7f\u5176\u4e0e\u5176\u4ed6\u4ee3\u7801\u517c\u5bb9\u4f1a\u66f4\u7b80\u5355 Adapter.cpp #include #include #include class Target { public : virtual ~ Target () = default ; virtual std :: string Request () const { return \"Target: The defaut target's behabior.\" ; } }; class Adaptee { public : std :: string SpecificRequest () const { return \".eetpadA eht fo roivaheb laicepS\" ; } }; class Adapter : public Target { private : Adaptee * adaptee_ ; public : Adapter ( Adaptee * adaptee ) : adaptee_ ( adaptee ) {} std :: string Request () const override { std :: string to_reverse = this -> adaptee_ -> SpecificRequest (); std :: reverse ( to_reverse . begin (), to_reverse . end ()); return \"Adapter: (TRANSLATED) \" + to_reverse ; } }; void ClientCode ( const Target * target ) { std :: cout << target -> Request (); } int main () { std :: ios :: sync_with_stdio ( false ); std :: cin . tie ( nullptr ); std :: cout << \"Client: I can work just fine with the Target objects: \\n \" ; Target * target = new Target ; ClientCode ( target ); std :: cout << \" \\n\\n \" ; Adaptee * adaptee = new Adaptee ; std :: cout << \"Client: The Adaptee class has a weird interface. See, I don't understand it: \\n \" ; std :: cout << \"Adaptee: \" << adaptee -> SpecificRequest (); std :: cout << \" \\n\\n \" ; std :: cout << \"Client: But I can work with it via the Adapter: \\n \" ; Adapter * adapter = new Adapter ( adaptee ); ClientCode ( adapter ); std :: cout << \" \\n \" ; delete target ; delete adaptee ; delete adapter ; return 0 ; } \u884c\u4e3a\u6a21\u5f0f \u00b6","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_1","text":"\u7ea6 2112 \u4e2a\u5b57 496 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 13 \u5206\u949f \u8bbe\u8ba1\u6a21\u5f0f \u662f\u8f6f\u4ef6\u8bbe\u8ba1\u4e2d\u5e38\u89c1\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002\u4ed6\u4eec\u5c31\u60f3\u80fd\u6839\u636e\u9700\u6c42\u8fdb\u884c\u8c03\u6574\u7684\u9884\u5236\u84dd\u56fe\uff0c\u53ef\u7528\u4e8e\u89e3\u51b3\u4ee3\u7801\u4e2d\u53cd\u590d\u51fa\u73b0\u7684\u8bbe\u8ba1\u95ee\u9898\u3002 \u8bbe\u8ba1\u6a21\u5f0f\u4e0e\u65b9\u6cd5\u6216\u5e93\u7684\u4f7f\u7528\u65b9\u5f0f\u4e0d\u540c\uff0c\u4f60\u5f88\u96be\u76f4\u63a5\u5728\u81ea\u5df1\u7684\u7a0b\u5e8f\u4e2d\u5957\u7528\u67d0\u4e2a\u8bbe\u8ba1\u6a21\u5f0f\u3002\u6a21\u5f0f\u5e76\u4e0d\u662f\u4e00\u6bb5\u7279\u5b9a\u7684\u4ee3\u7801\uff0c\u800c\u662f\u89e3\u51b3\u7279\u5b9a\u95ee\u9898\u7684\u4e00\u822c\u6027\u6982\u5ff5\u3002 \u4f60\u53ef\u4ee5\u6839\u636e\u6a21\u5f0f\u6765\u5b9e\u73b0\u7b26\u5408\u81ea\u5df1\u7a0b\u5e8f\u5b9e\u9645\u6240\u9700\u7684\u89e3\u51b3\u65b9\u6848\u3002 \u4eba\u4eec\u5e38\u5e38\u4f1a\u6df7\u6dc6\u6a21\u5f0f\u548c\u7b97\u6cd5\uff0c\u56e0\u4e3a\u4e24\u8005\u5728\u6982\u5ff5\u4e0a\u90fd\u662f\u5df2\u77e5\u7279\u5b9a\u95ee\u9898\u7684\u5178\u578b\u89e3\u51b3\u65b9\u6848\u3002 \u4f46\u7b97\u6cd5\u603b\u662f\u660e\u786e\u5b9a\u4e49\u8fbe\u6210\u7279\u5b9a\u76ee\u6807\u6240\u9700\u7684\u4e00\u7cfb\u5217\u6b65\u9aa4\uff0c\u800c\u6a21\u5f0f\u5219\u662f\u5bf9\u89e3\u51b3\u65b9\u6848\u7684\u66f4\u9ad8\u5c42\u6b21\u63cf\u8ff0\u3002\u540c\u4e00\u6a21\u5f0f\u5728\u4e24\u4e2a\u4e0d\u540c\u7a0b\u5e8f\u4e2d\u7684\u5b9e\u73b0\u4ee3\u7801\u53ef\u80fd\u4f1a\u4e0d\u4e00\u6837\u3002 \u7b97\u6cd5\u66f4\u50cf\u662f\u83dc\u8c31\uff1a\u63d0\u4f9b\u8fbe\u6210\u76ee\u6807\u7684\u660e\u786e\u6b65\u9aa4\u3002\u800c\u6a21\u5f0f\u66f4\u50cf\u662f\u84dd\u56fe\uff1a\u4f60\u53ef\u4ee5\u770b\u5230\u6700\u7ec8\u7684\u7ed3\u679c\u548c\u6a21\u5f0f\u7684\u529f\u80fd\uff0c\u4f46\u9700\u8981\u81ea\u5df1\u786e\u5b9a\u5b9e\u73b0\u6b65\u9aa4\u3002 Abstract \u5f52\u6863\u5b66\u4e60\u8bbe\u8ba1\u6a21\u5f0f\u65f6\u7684\u4e00\u4e9b\u7b14\u8bb0 \u4e3b\u8981\u7528 C++ \u5b9e\u73b0\uff0c\u6301\u7eed\u66f4\u65b0\u4e2d","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_2","text":"","title":"\u521b\u5efa\u578b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_3","text":"","title":"\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_4","text":"\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u521b\u5efa\u4e00\u7cfb\u5217\u76f8\u5173\u7684\u5bf9\u8c61\uff0c \u800c\u65e0\u9700\u6307\u5b9a\u5176\u5177\u4f53\u7c7b\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_5","text":"\u5982\u679c\u4ee3\u7801\u9700\u8981\u4e0e\u591a\u4e2a\u4e0d\u540c\u7cfb\u5217\u7684\u76f8\u5173\u4ea7\u54c1\u4ea4\u4e92\uff0c\u4f46\u662f\u7531\u4e8e\u65e0\u6cd5\u63d0\u524d\u83b7\u53d6\u76f8\u5173\u4fe1\u606f\uff0c\u6216\u8005\u51fa\u4e8e\u5bf9\u672a\u6765\u6269\u5c55\u6027\u7684\u8003\u8651\uff0c\u4f60\u4e0d\u5e0c\u671b\u4ee3\u7801\u57fa\u4e8e\u4ea7\u54c1\u7684\u5177\u4f53\u7c7b\u8fdb\u884c\u6784\u5efa\uff0c\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\uff0c\u4f60\u53ef\u4ee5\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u3002 \u5982\u679c\u4f60\u6709\u4e00\u4e2a\u57fa\u4e8e\u4e00\u7ec4\u62bd\u8c61\u65b9\u6cd5\u7684\u7d2f\uff0c\u4e14\u5176\u4e3b\u8981\u529f\u80fd\u56e0\u6b64\u53d8\u5f97\u4e0d\u660e\u786e\uff0c\u90a3\u4e48\u5728\u8fd9\u79cd\u60c5\u51b5\u4e0b\u53ef\u4ee5\u8003\u8651\u4e86\u4f7f\u7528\u62bd\u8c61\u5de5\u5382\u6a21\u5f0f","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_6","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_9","text":"","title":"\u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_10","text":"\u5de5\u5382\u65b9\u6cd5\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u5176\u5728\u7236\u7c7b\u4e2d\u63d0\u4f9b\u4e00\u4e2a\u521b\u5efa\u5bf9\u8c61\u7684\u65b9\u6cd5\uff0c\u5141\u8bb8\u5b50\u7c7b\u51b3\u5b9a\u5b9e\u4f8b\u5316\u5bf9\u8c61\u7684\u7c7b\u578b\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_11","text":"\u7f16\u5199\u4ee3\u7801\u7684\u8fc7\u7a0b\u4e2d\uff0c\u5982\u679c\u65e0\u6cd5\u9884\u77e5\u5bf9\u8c61\u786e\u5207\u7c7b\u522b\u4ee5\u53ca\u4f9d\u8d56\u5173\u7cfb\u65f6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u7528\u6237\u80fd\u591f\u6269\u5c55\u4f60\u8f6f\u4ef6\u5e93\u6216\u6846\u67b6\u7684\u5185\u90e8\u7ec4\u4ef6\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5 \u5982\u679c\u4f60\u5e0c\u671b\u590d\u7528\u73b0\u6709\u5bf9\u8c61\u6765\u8282\u7701\u7cfb\u7edf\u8d44\u6e90\uff0c\u800c\u4e0d\u662f\u6bcf\u6b21\u90fd\u91cd\u65b0\u521b\u5efa\u5bf9\u8c61\uff0c\u53ef\u4f7f\u7528\u5de5\u5382\u65b9\u6cd5","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_12","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_15","text":"","title":"\u751f\u6210\u5668\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_16","text":"\u751f\u6210\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u5206\u6b65\u9aa4\u521b\u5efa\u590d\u6742\u5bf9\u8c61\u3002\u8be5\u6a21\u5f0f\u5141\u8bb8\u4f60\u4f7f\u7528\u76f8\u540c\u7684\u521b\u5efa\u4ee3\u7801\u751f\u6210\u4e0d\u540c\u7c7b\u578b\u548c\u5f62\u5f0f\u7684\u5bf9\u8c61\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_17","text":"\u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f\u53ef\u907f\u514d\u201c\u91cd\u53e0\u6784\u9020\u51fd\u6570\u201d\u7684\u51fa\u73b0 \u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u4ee3\u7801\u521b\u5efa\u4e0d\u540c\u5f62\u5f0f\u7684\u4ea7\u54c1\uff08\u4f8b\u5982\u77f3\u5934\u6216\u6728\u5934\u623f\u5c4b\uff09\u65f6\uff0c\u53ef\u4f7f\u7528\u751f\u6210\u5668\u6a21\u5f0f \u4f7f\u7528\u751f\u6210\u5668\u6784\u9020\u7ec4\u5408\u6811\u6216\u5176\u4ed6\u590d\u6742\u5bf9\u8c61","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_18","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_21","text":"","title":"\u539f\u578b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_22","text":"\u539f\u578b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u4f7f\u4f60\u80fd\u591f\u590d\u5236\u5df2\u6709\u5bf9\u8c61\uff0c \u800c\u53c8\u65e0\u9700\u4f7f\u4ee3\u7801\u4f9d\u8d56\u5b83\u4eec\u6240\u5c5e\u7684\u7c7b\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_23","text":"\u5982\u679c\u4f60\u9700\u8981\u590d\u5236\u4e00\u4e9b\u5bf9\u8c61\uff0c\u540c\u65f6\u53c8\u5e0c\u671b\u4ee3\u7801\u72ec\u7acb\u4e8e\u8fd9\u4e9b\u5bf9\u8c61\u6240\u5c5e\u7684\u5177\u4f53\u7c7b\uff0c\u53ef\u4ee5\u4f7f\u7528\u539f\u578b\u6a21\u5f0f \u5982\u679c\u5b50\u7c7b\u7684\u533a\u522b\u4ec5\u5728\u4e8e\u5176\u5bf9\u8c61\u7684\u521d\u59cb\u5316\u65b9\u5f0f\uff0c\u90a3\u4e48\u4f60\u53ef\u4ee5\u4f7f\u7528\u8be5\u6a21\u5f0f\u6765\u51cf\u5c11\u5b50\u7c7b\u7684\u6570\u91cf\u3002\u522b\u4eba\u521b\u5efa\u8fd9\u4e9b\u5b50\u7c7b\u7684\u76ee\u7684\u53ef\u80fd\u662f\u4e3a\u96f6\u521b\u5efa\u7279\u5b9a\u7c7b\u578b\u7684\u5bf9\u8c61","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_24","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_27","text":"","title":"\u5355\u4f8b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_28","text":"\u5355\u4f8b\u6a21\u5f0f \u662f\u4e00\u79cd\u521b\u5efa\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c\u8ba9\u4f60\u80fd\u591f\u4fdd\u8bc1\u4e00\u4e2a\u7c7b\u53ea\u6709\u4e00\u4e2a\u5b9e\u4f8b\uff0c\u5e76\u63d0\u4f9b\u4e00\u4e2a\u8bbf\u95ee\u8be5\u5b9e\u4f8b\u7684\u5168\u5c40\u8282\u70b9\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_29","text":"\u5982\u679c\u7a0b\u5e8f\u4e2d\u7684\u67d0\u4e2a\u7c7b\u5bf9\u4e8e\u6240\u6709\u5ba2\u6237\u7aef\u53ea\u6709\u4e00\u4e2a\u53ef\u7528\u7684\u5b9e\u4f8b\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f \u5982\u679c\u4f60\u9700\u8981\u66f4\u52a0\u4e25\u683c\u5730\u63a7\u5236\u5168\u5c40\u53d8\u91cf\uff0c\u53ef\u4ee5\u4f7f\u7528\u5355\u4f8b\u6a21\u5f0f","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_30","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_33","text":"","title":"\u7ed3\u6784\u578b\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_34","text":"","title":"\u9002\u914d\u5668\u6a21\u5f0f"},{"location":"cs/software/design-pattern/#_35","text":"\u9002\u914d\u5668\u6a21\u5f0f \u662f\u4e00\u79cd\u7ed3\u6784\u578b\u8bbe\u8ba1\u6a21\u5f0f\uff0c \u5b83\u80fd\u4f7f\u63a5\u53e3\u4e0d\u517c\u5bb9\u7684\u5bf9\u8c61\u80fd\u591f\u76f8\u4e92\u5408\u4f5c\u3002","title":"\u6982\u8ff0"},{"location":"cs/software/design-pattern/#_36","text":"\u5f53\u4f60\u5e0c\u671b\u4f7f\u7528\u67d0\u4e2a\u7c7b\uff0c\u4f46\u662f\u5176\u63a5\u53e3\u4e0e\u5176\u4ed6\u4ee3\u7801\u4e0d\u517c\u5bb9\u65f6\uff0c\u53ef\u4ee5\u4f7f\u7528\u9002\u914d\u5668\u7c7b \u5982\u679c\u4f60\u9700\u8981\u590d\u7528\u8fd9\u6837\u4e00\u4e9b\u7c7b\uff0c\u4ed6\u4eec\u5904\u4e8e\u540c\u4e00\u7ee7\u627f\u4f53\u7cfb\uff0c\u5e76\u4e14\u5b83\u4eec\u53c8\u6709\u4e86\u989d\u5916\u7684\u4e00\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u8fd9\u4e9b\u5171\u540c\u7684\u65b9\u6cd5\u4e0d\u662f\u6240\u6709\u5728\u8fd9\u4e00\u7ee7\u627f\u4f53\u7cfb\u4e2d\u7684\u5b50\u7c7b\u6240\u5177\u6709\u7684\u5171\u6027","title":"\u5e94\u7528\u573a\u666f"},{"location":"cs/software/design-pattern/#_37","text":"","title":"\u4f18\u7f3a\u70b9"},{"location":"cs/software/design-pattern/#_40","text":"","title":"\u884c\u4e3a\u6a21\u5f0f"},{"location":"cs/software/piaserver/","text":"","title":"\u5e94\u7528\u670d\u52a1\u5668\u539f\u7406\u4e0e\u5b9e\u73b0"},{"location":"cs/software/sca/","text":"\u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784 \u00b6 \u7ea6 5144 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 17 \u5206\u949f Abstract \u8fd9\u91cc\u8bb0\u5f55\u5b66\u4e60\u8fd9\u672c\u4e66\u65f6\u7684\u7b14\u8bb0\uff08\u540c\u65f6\u662f\u7814\u4e00\u7684\u5b66\u4f4d\u8bfe\uff09 \u4f5c\u8005\u662f\u6211\u7684\u5bfc\u5e08\u738b\u6620\u8f89\u6559\u6388 \u8f6f\u4ef6\u590d\u7528 \u00b6 \u8f6f\u4ef6\u590d\u7528\u7684\u6982\u5ff5 \u00b6 \u8f6f\u4ef6\u590d\u7528\u662f\u6307\u5728\u4e24\u6b21\u6216\u591a\u6b21\u4e0d\u540c\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u91cd\u590d\u4f7f\u7528\u76f8\u540c\u7684\u6216\u76f8\u8fd1\u7684\u8f6f\u4ef6\u5143\u7d20\u7684\u8fc7\u7a0b\u3002\u5f15\u51fa\u4e86 \u6784\u4ef6 \u7684\u6982\u5ff5\u3002 \u8f6f\u4ef6\u590d\u7528\u53ef\u5212\u5206\u4e3a\u5982\u4e0b\u51e0\u7c7b\uff1a \u4ee3\u7801\u7684\u590d\u7528 \u8bbe\u8ba1\u7684\u590d\u7528 \u5206\u6790\u7684\u590d\u7528 \u6d4b\u8bd5\u4fe1\u606f\u7684\u590d\u7528 \u8f6f\u4ef6\u590d\u7528\u7684\u5b9e\u73b0 \u00b6 \u57fa\u672c\u95ee\u9898 \u00b6 \u5de5\u7a0b\u65b9\u9762 \u7f3a\u5c11\u80fd\u591f\u6e05\u6670\u6807\u8bc6\u53ef\u590d\u7528\u6a21\u578b\u8981\u7d20\u7684\u624b\u6bb5\u3002 \u7f3a\u5c11\u80fd\u591f\u590d\u7528\u7684\u6784\u4ef6\u3002 \u53ef\u590d\u7528\u7684\u6784\u4ef6\u7f3a\u4e4f\u7075\u6d3b\u6027\u3002 \u7f3a\u4e4f\u6267\u884c\u590d\u7528\u8fc7\u7a0b\u7684\u5de5\u5177\u3002 \u8fc7\u7a0b\u65b9\u9762 \u7ec4\u7ec7\u65b9\u9762 \u8d44\u91d1\u65b9\u9762 \u5173\u952e\u56e0\u7d20 \u00b6 \u590d\u7528\u4f9d\u8d56\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 \u3002\u4f7f\u7528\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6765\u89c4\u5212\u548c\u7ba1\u7406\u5927\u89c4\u6a21\u53ef\u590d\u7528\u7cfb\u7edf\u7684\u590d\u6742\u6027\u662f\u6700\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\u3002 \u8f6f\u4ef6\u590d\u7528\u4e0e\u6784\u4ef6\u6280\u672f \u00b6 \u6784\u4ef6\u662f\u5177\u6709\u4e00\u5b9a\u529f\u80fd\u3001\u80fd\u591f\u72ec\u7acb\u5de5\u4f5c\u6216\u540c\u5176\u4ed6\u6784\u4ef6\u88c5\u914d\u8d77\u6765\u534f\u8c03\u5de5\u4f5c\u7684\u7a0b\u5e8f\u4f53\uff0c\u6784\u4ef6\u7684\u4f7f\u7528\u540c\u5b83\u7684\u5f00\u53d1\u3001\u751f\u4ea7\u65e0\u5173\u3002\u6574\u4e2a\u6784\u4ef6\u9690\u85cf\u4e86\u5177\u4f53\u7684\u5b9e\u73b0\uff0c\u53ea\u7528\u63a5\u53e3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002 \u4ece\u5916\u90e8\u5f62\u6001\u770b\uff1a \u72ec\u7acb\u800c\u6210\u719f\u7684\u6784\u4ef6 \u6709\u9650\u5236\u7684\u6784\u4ef6 \u9002\u7528\u6027\u6784\u4ef6 \u88c5\u914d\u7684\u6784\u4ef6 \u53ef\u4fee\u6539\u7684\u6784\u4ef6 \u6784\u4ef6\u6280\u672f \u00b6 \u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u95ee\u9898 \u00b6 \u6280\u672f\u4e0e\u9700\u6c42\u53d8\u5316\u7684\u95ee\u9898\u3002 \u91cd\u590d\u4e0d\u5fc5\u8981\u7684\u5de5\u4f5c\u95ee\u9898\u3002 \u5e94\u7528\u96c6\u6210\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u96be\u4ee5\u7ef4\u62a4\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u8d28\u91cf\u548c\u6210\u672c\u6709\u6548\u6027\u95ee\u9898\u7b49\u3002 \u6784\u4ef6\u6280\u672f\u662f\u76ee\u524d\u652f\u6301\u8f6f\u4ef6\u590d\u7528\u7684\u6838\u5fc3\u6280\u672f\u3002\u7814\u7a76\u5185\u5bb9\u5305\u62ec\uff1a \u6784\u4ef6\u83b7\u53d6\uff1a\u6709\u76ee\u7684\u7684\u6784\u4ef6\u751f\u4ea7\u548c\u4ece\u5df2\u6709\u7cfb\u7edf\u4e2d\u6316\u6398\u63d0\u53d6\u6784\u4ef6\u3002 \u7814\u7a76\u6a21\u578b\uff1a\u7814\u7a76\u6784\u4ef6\u7684\u672c\u8d28\u7279\u5f81\u548c\u6784\u4ef6\u95f4\u7684\u5173\u7cfb\u3002 \u6784\u4ef6\u63cf\u8ff0\u8bed\u8a00\uff1a\u4ee5\u6784\u4ef6\u6a21\u578b\u4e3a\u57fa\u7840\uff0c\u89e3\u51b3\u6784\u4ef6\u7684\u7cbe\u786e\u63cf\u8ff0\u3001\u7406\u89e3\u3001\u68c0\u7d20\u53ca\u7ec4\u88c5\u95ee\u9898\u3002 \u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff1a\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u53ca\u68c0\u7d20\u7b56\u7565\uff0c\u5efa\u7acb\u6784\u4ef6\u5e93\u7cfb\u7edf\uff0c\u652f\u6301\u6784\u4ef6\u7684\u6709\u6548\u7ba1\u7406\u3002 \u6784\u4ef6\u590d\u5408\u7ec4\u88c5\uff1a\u5728\u6784\u4ef6\u6a21\u578b\u7684\u57fa\u7840\u4e0a\u7814\u7a76\u6784\u4ef6\u7ec4\u88c5\u673a\u5236\uff0c\u5305\u62ec\u6e90\u4ee3\u7801\u7ea7\u7684\u7ec4\u88c5\u548c\u57fa\u4e8e\u6784\u4ef6\u5bf9\u8c61\u4e92\u64cd\u4f5c\u6027\u7684\u7ec4\u88c5\u3002 \u6807\u51c6\u5316\uff1a\u6784\u4ef6\u6a21\u578b\u7684\u6807\u51c6\u5316\u548c\u6784\u4ef6\u5e93\u7cfb\u7edf\u7684\u6807\u51c6\u5316\u7b49\u3002 \u8f6f\u4ef6\u6784\u4ef6\u7684\u6982\u5ff5 \u00b6 \u8f6f\u4ef6\u6210\u5206\u5305\u62ec\u7a0b\u5e8f\u4ee3\u7801\u3001\u6d4b\u8bd5\u7528\u4f8b\u3001\u8bbe\u8ba1\u6587\u6863\u3001\u8bbe\u8ba1\u8fc7\u7a0b\u3001\u9700\u6c42\u5206\u6790\u6587\u6863\uff0c\u751a\u81f3\u9886\u57df\u77e5\u8bc6\uff0c\u901a\u5e38\u628a\u8fd9\u79cd\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u6210\u5206\u79f0\u4e3a\u8f6f\u4ef6\u6784\u4ef6\uff0c\u7b80\u79f0\u8f6f\u6784\u4ef6\u6216\u8005\u6784\u4ef6\u3002\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u5143\u7d20\u8d8a\u5927\uff0c\u6211\u4eec\u5c31\u8bf4\u590d\u7528\u7684\u7c92\u5ea6(Granularity)\u8d8a\u5927\u3002 \u6784\u4ef6\u662f\u9884\u5148\u6784\u5efa\u7684\u3002 \u6784\u4ef6\u662f\u9ed1\u76d2\u7684\u3002 \u6784\u4ef6\u662f\u53ef\u5206\u79bb\u7684\u3002 \u6784\u4ef6\u80fd\u7528\u4e8e\u7ec4\u88c5\u548c\u90e8\u7f72\u3002 \u6784\u4ef6\u9700\u8981\u79f0\u4e3a\u6784\u4ef6\u5bb9\u5668\u6280\u672f\u7684\u652f\u6301\u3002 \u4e00\u4e2a\u5b8c\u6574\u7684\u6784\u4ef6\u5e94\u5305\u542b6\u4e2a\u8981\u7d20\uff1a \u53d7\u7ea6\u675f\u7684\u6784\u4ef6\u6807\u51c6\uff1a\u7b26\u5408\u67d0\u79cd\u6784\u4ef6\u6a21\u578b\u3002 \u89c4\u683c\u8bf4\u660e\uff1a\u6784\u4ef6\u63d0\u4f9b\u670d\u52a1\u7684\u62bd\u8c61\u63cf\u8ff0\uff0c\u7528\u4f5c\u670d\u52a1\u7684\u5ba2\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\u3002 \u5b9e\u73b0\uff1a\u5fc5\u987b\u7b26\u5408\u89c4\u683c\u8bf4\u660e\uff0c\u5404\u81ea\u5b9e\u73b0\u3002 \u5305\u88c5\u65b9\u6cd5\uff1a\u6309\u4e0d\u540c\u7684\u65b9\u5f0f\u5206\u7ec4\u6765\u63d0\u4f9b \u4e00\u5957\u53ef\u4ee5\u66ff\u6362\u7684\u670d\u52a1(\u5305)\u3002 \u6ce8\u518c\uff1a\u53ef\u5728\u6784\u4ef6\u652f\u6301\u73af\u5883\u4e2d\u6ce8\u518c\u3002 \u90e8\u7f72\u65b9\u6cd5\uff1a\u6784\u4ef6\u53ef\u4ee5\u90e8\u7f72\u591a\u4e2a\u5b9e\u4f8b\u3002 \u8f6f\u4ef6\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e \u00b6 \u6784\u4ef6\u7684\u540d\u79f0\u4e0e\u7b80\u77ed\u63cf\u8ff0\u3002 \u6784\u4ef6\u670d\u52a1\u3002 \u6784\u4ef6\u63a5\u53e3\u4fe1\u606f\u3002 \u6240\u9700\u7684\u63a5\u53e3\u3002 \u53d1\u5e03\u548c\u63a5\u53d7\u7684\u4e8b\u4ef6\u3002 \u6784\u4ef6\u7279\u5f81\u3002 \u9644\u52a0\u4fe1\u606f\u3002 \u8f6f\u4ef6\u6784\u4ef6\u63a5\u53e3 \u00b6 \u6784\u4ef6\u5fc5\u9886\u5bf9\u5176\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u8fdb\u884c\u62bd\u8c61\u63cf\u8ff0\uff0c\u4ee5\u4f5c\u4e3a\u670d\u52a1\u7684\u5bb9\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\uff0c\u8fd9\u5c31\u662f\u6784\u4ef6\u63a5\u53e3\u3002 \u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b \u00b6 \u6784\u4ef6\u6a21\u578b\u7684\u6982\u5ff5 \u00b6 \u6784\u4ef6\u6a21\u578b\u5b9a\u4e49\u4e86\u4ec0\u4e48\u662f\u6784\u4ef6\u3001\u6784\u4ef6\u7684\u4f9d\u636e\u3001\u5982\u4f55\u4f7f\u7528\u5176\u4ed6\u6784\u4ef6\u63d0\u4f9b\u7684\u670d\u52a1\u7b49\u3002\u5c07\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u5177\u4f53\u5b9e\u73b0\u5206\u79bb\uff0c\u4f9d\u9760\u6784\u4ef6\u5b9e\u73b0\u7684\u5177\u4f53\u6a21\u5f0f\u6765\u63a8\u5bfc\u51fa\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\uff0c\u53ef\u4ee5\u6784\u9020\u4e00\u4e2a\u6784\u4ef6\u6a21\u578b\u3002 \u4f7f\u7528\u4e2d\u95f4\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u6784\u4ef6\u4e4b\u95f4\u8fdb\u884c\u66f4\u597d\u5730\u901a\u4fe1\u3002\u5982\u6784\u4ef6\u4e4b\u95f4\u76f4\u63a5\u8fdb\u884c\u901a\u4fe1\uff0c\u5f53\u6784\u6210\u7cfb\u7edf\u7684\u6784\u4ef6\u6570\u91cf\u5e9e\u5927\u65f6\uff0c\u5176\u590d\u6742\u7a0b\u5ea6\u8fc5\u901f\u63d0\u9ad8\uff1b\u5982\u80fd\u5f15\u4eba\u4e2d\u4ecb\u5c42 (\u4e2d\u95f4\u4ef6)\uff0c\u5219\u53ef\u5f88\u597d\u5730\u907f\u514d\u6784\u4ef6\u95f4\u590d\u6742\u7684\u4ea4\u4e92\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b \u00b6 \u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b\u56fd\u5185\u8bb8\u591a\u5b66\u8005\u5728\u6784\u4ef6\u6a21\u578b\u7684\u7814\u7a76\u65b9\u9762\u505a\u4e86\u4e0d\u5c11\u7684\u5de5\u4f5c\uff0c\u5176\u4e2d\u8f83\u4e3a\u7a81\u51fa\u7684\u662f\u5317\u4eac\u5927\u5b66\u6768\u8299\u6e05\u9662\u58eb\u7b49\u4eba\u63d0\u51fa\u7684\u201c\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b(JBCOM)\u201d\u3002\u5b83\u7531\u5916\u90e8\u63a5\u53c8\u4e0e\u5185\u90e8\u7ed3\u6784\u4e24\u90e8\u5206\u7ec4\u6210\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u6784\u4ef6\u7684\u5916\u90e8\u63a5\u53e3\u662f\u6307\u6784\u4ef6\u5411\u5176\u590d\u7528\u8005\u63d0\u4f9b\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5305\u62ec:\u6784\u4ef6\u540d\u79f0\u3001\u529f\u80fd\u63cf\u8ff0\u3001\u5bf9\u5916\u529f\u80fd\u63a5\u53e3\uff0c\u6240\u9700\u670d\u52a1\u7684\u6784\u4ef6\u548c\u53c2\u6570\u5316\u5c5e\u6027\u7b49\u3002\u5916\u90e8\u63a5\u53e3\u662f\u6784\u4ef6\u4e0e\u5916\u754c\u7684\u4e00\u7ec4\u4ea4\u4e92\u70b9\uff0c\u8bf4\u660e\u4e86\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u90a3\u4e9b\u670d\u52a1(\u6d88\u606f\u3001\u64cd\u4f5c\u548c\u53d8\u91cf)\u3002 \u6784\u4ef6\u7684\u5185\u90e8\u7ed3\u6784\u5305\u62ec\u4e24\u65b9\u9762\u7684\u5185\u5bb9:\u5185\u90e8\u6210\u5458\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5176\u4e2d\uff0c\u5185\u90e8\u6210\u5458\u5305\u62ec\u5177\u4f53\u6210\u5458\u4e0e\u865a\u62df\u6210\u5458\uff0c\u800c\u6210\u5458\u5173\u7cfb\u5305\u62ec\u6210\u5458\u4e4b\u95f4\u7684\u4e92\u8054\uff0c\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e0e\u5916\u90e8\u63a5\u53e3\u4e4b\u95f4\u7684\u4e92\u8054\u3002 \u6784\u4ef6\u6a21\u578b\u7684\u63cf\u8ff0\u65b9\u6cd5 \u00b6 \u6784\u4ef6::=\u3008\u6784\u4ef6\u89c4\u7ea6\uff0c\u6784\u4ef6\u5b9e\u73b0\u3009 \u6784\u4ef6\u89c4\u7ea6::=\u3008\u63a5\u53c8\u90e8\u5206\uff0c\u7ed3\u6784\u90e8\u5206\u3009 \u63a5\u53e3\u90e8\u5206::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\uff0c\u670d\u52a1\u96c6\u5408\u3009 \u670d\u52a1::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\u3009 \u7ed3\u6784\u90e8\u5206::=\u3008\u539f\u5b50\u6784\u4ef6\u7ed3\u6784\u3009|\u3008\u590d\u5408\u6784\u4ef6\u7ed3\u6784\u3009 \u539f\u5b50\u6784\u4ef6\u7ed3\u6784::=\u3008\u6784\u4ef6\u5b9e\u73b0\u7684\u5f15\u7528\u3009 \u590d\u5408\u6784\u4ef6\u7ed3\u6784::=\u3008\u5f15\u7528\u7684\u6784\u4ef6\u7c7b\u578b\uff0c\u5b9e\u4f8b\u58f0\u660e\uff0c\u5b9e\u4f8b\u8fde\u63a5\uff0c\u6620\u5c04\u3009 eg. \u7f16\u8bd1\u5668\u590d\u5408\u6784\u4ef6\u5b9e\u4f8b\u3002 \u8f6f\u4ef6\u6784\u4ef6\u7684\u6df1\u5c42\u7406\u89e3 \u00b6 \u6784\u4ef6\u7684\u7c92\u5ea6 \u6784\u4ef6\u7684\u57fa\u7840\u8bbe\u65bd \u6784\u4ef6\u7684\u83b7\u53d6 \u6784\u4ef6\u7684\u7ba1\u7406 \u7ec4\u88c5\u4e0e\u90e8\u7f72 \u9762\u5411\u6784\u4ef6 \u00b6 \u9762\u5411\u6784\u4ef6\u7684\u6982\u5ff5 \u00b6 \u901a\u8fc7\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u5b9e\u73b0\uff0c\u6765\u5f97\u5230\u6240\u9700\u7684\u6784\u4ef6 \u6784\u4ef6\u7684\u5206\u7c7b \u00b6 \u6839\u636e\u8f6f\u4ef6 3 \u5c42\u6846\u67b6\u7684\u6784\u4ef6\u5206\u7c7b \u8868\u793a\u5c42 \u4e1a\u52a1\u5c42 \u6570\u636e\u5c42 \u636e\u6b64\u6846\u67b6\uff0c\u6784\u4ef6\u53ef\u4ee5\u88ab\u5206\u4e3a 3 \u7c7b\uff1a\u5e94\u7528\u8f6f\u4ef6\u3001\u4e1a\u52a1\u6784\u4ef6\u548c\u6570\u636e\u6784\u4ef6 \u4e1a\u52a1\u6784\u4ef6\u7684\u83b7\u53d6\u60c5\u51b5 \u5b9a\u4e49\u4e1a\u52a1\u5bf9\u8c61 \u786e\u5b9a\u63a7\u5236\u903b\u8f91\uff08\u4e1a\u52a1\u8fc7\u7a0b\uff09 \u786e\u5b9a\u4e1a\u52a1\u5bf9\u8c61\u4e0e\u63a7\u5236\u903b\u8f91\u4e4b\u95f4\u7684\u4ea4\u4e92 \u533a\u5206\u516c\u53f8\u7684\u4e1a\u52a1\u903b\u8f91\u548c\u7279\u5b9a\u90e8\u95e8\u7684\u4e1a\u52a1\u903b\u8f91 \u5c06\u4e1a\u52a1\u5bf9\u8c61\u548c\u63a7\u5236\u903b\u8f91\u5206\u914d\u5230\u76f8\u5e94\u7684\u4e1a\u52a1\u6784\u4ef6\u4e2d\u53bb \u57fa\u4e8e\u6784\u4ef6\u7c92\u5ea6\u5927\u5c0f\u7684\u6784\u4ef6\u5206\u7c7b \u53ef\u5206\u4e3a\uff1a\u5927\u7c92\u5ea6\u7684\u5e94\u7528\u6784\u4ef6\u3001\u7528\u6237\u4efb\u52a1\u6784\u4ef6\u3001\u6279\u5904\u7406\u6784\u4ef6\u548c\u5b50\u4efb\u52a1\u6784\u4ef6 \u6784\u4ef6\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0 \u00b6 \u6784\u4ef6\u63a5\u53e3\u5b9a\u4e49\u7684\u539f\u5219 \u00b6 \u6784\u4ef6\u63a5\u53e3\u7684\u5b9a\u4e49\u7684\u57fa\u672c\u539f\u5219\uff1a \u5b9a\u4e49\u4e00\u4e9b\u4e0d\u53d8\u7684\u63a5\u53e3 \u5b9a\u4e49\u81ea\u63cf\u8ff0\u7684\u63a5\u53e3 \u5b9a\u4e49\u5143\u6570\u636e\u6027\u8d28\u7684\u63a5\u53e3 \u6784\u4ef6\u8bbe\u8ba1\u6210\u53ef\u5b9a\u5236\u7684 \u539f\u5b50\u6784\u4ef6\u7684\u5236\u4f5c \u00b6 \u539f\u5b50\u6784\u4ef6 Atom \u662f\u6700\u5c0f\u7c92\u5ea6\u7684\u6784\u4ef6\uff0c\u8be5\u6784\u4ef6\u5728\u529f\u80fd\u7b49\u65b9\u9762\u5177\u6709\u4e0d\u53ef\u518d\u62c6\u5206\u7684\u6027\u8d28\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u7684\u5b9e\u4f53\u5bf9\u5e94\u5355\u4e2a\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u79f0\u8fd9\u4e2a\u6784\u4ef6\u662f\u5355\u5bf9\u8c61\u6784\u4ef6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u63a5\u53e3\u89c4\u7ea6\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u5bf9\u5e94\u591a\u4e2a\u534f\u4f5c\u5bf9\u8c61\u65f6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u9700\u8981\u5f15\u5165\u4e00\u4e2a\u63a7\u5236\u5bf9\u8c61\u3002 \u5b9a\u4e49\u6784\u4ef6\u63a5\u53e3\u7684\u89c4\u7ea6\u90e8\u5206\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002 \u590d\u5408\u6784\u4ef6\u7684\u5236\u4f5c \u00b6 \u590d\u5408\u6784\u4ef6 Assemble \u662f\u7531\u539f\u5b50\u6784\u4ef6\u6216\u8005\u590d\u5408\u6784\u4ef6\u7ec4\u88c5\u800c\u6210\u7684\u3002 \u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u6784\u4ef6\u7684\u63a5\u53e3\u89c4\u7ea6\u90e8\u5206 \u786e\u5b9a\u6240\u5305\u542b\u7684\u6210\u5458\u6784\u4ef6 \u5efa\u7acb\u5185\u90e8\u7684\u6210\u5458\u6784\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u8fde\u63a5\u5173\u7cfb \u5c06\u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u548c\u8981\u6c42\u7684\u529f\u80fd\u6620\u5c04\u5230\u5185\u90e8\u6210\u5458\u6784\u4ef6\u76f8\u5e94\u7684\u529f\u80fd\u4e0a \u5728\u5efa\u7acb\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u8fde\u63a5\u5173\u7cfb\u4ee5\u53ca\u590d\u5408\u6784\u4ef6\u548c\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u6620\u5c04\u65f6\uff0c\u9075\u5faa\u4e00\u4e0b\u89c4\u5219\uff1a \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ea\u80fd\u7531\u4e00\u4e2a\u63d0\u4f9b\u8005\u63d0\u4f9b \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ef\u4ee5\u6709\u591a\u4e2a\u4f7f\u7528\u8005 \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ef\u4ee5\u6620\u5c04\u5230\u591a\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ea\u80fd\u6620\u5c04\u5230\u4e00\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a \u6784\u4ef6\u7684\u7ba1\u7406\u4e0e\u7ef4\u62a4 \u00b6 \u6784\u4ef6\u5e93\u662f\u5bf9\u6784\u4ef6\u5b9e\u65bd\u5206\u7c7b\u548c\u7ba1\u7406\u7684\u673a\u6784\u3002 \u6784\u4ef6\u5e93\u7684\u7ec4\u7ec7 \u00b6 \u6784\u4ef6\u5e93\u7406\u8bba\u7814\u7a76\u7684\u91cd\u70b9\u662f\u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff0c\u5373\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u3001\u68c0\u7d22\u624b\u6bb5\u548c\u6784\u4ef6\u76f8\u4f3c\u6027\u5206\u6790\u7b49\u3002 \u9886\u57df\u4e0a\u6784\u4ef6\u5e93\u6ee1\u8db3\u7684\u6761\u4ef6\uff1a \u9886\u57df\u5b8c\u6574\u6027 \u9886\u57df\u62bd\u8c61\u6027 \u9886\u57df\u6807\u51c6\u5316 \u6784\u4ef6\u5e93\u7684\u5206\u7c7b\u6a21\u5f0f \u00b6 \u5173\u952e\u5b57\u5206\u7c7b\u6cd5 \u8d85\u6587\u672c\u7ec4\u7ec7\u6cd5 \u523b\u9762\u5206\u7c7b\u6cd5 \u7531\u4e00\u7ec4\u63cf\u8ff0\u6784\u4ef6\u672c\u8d28\u7279\u5f81\u7684\u523b\u9762\u7ec4\u6210\uff0c\u6bcf\u4e2a\u523b\u9762\u4ece\u4e0d\u540c\u7684\u89d2\u5ea6\u5bf9\u6784\u4ef6\u8fdb\u884c\u5206\u7c7b\u3002 \u4ece\u8868\u793a\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u523b\u9762\u662f\u4e00\u9897\u6709\u5411\u6811\uff0c\u6839\u8282\u70b9\u7684\u503c\u662f\u8be5\u523b\u9762\u7684\u540d\u79f0\uff0c\u6839\u8282\u70b9\u6240\u6709\u5b50\u6811\u6784\u6210\u7684\u68ee\u6797\u79f0\u4e3a\u672f\u8bed\u7a7a\u95f4 \u7279\u70b9\uff1a \u5bf9\u6784\u4ef6\u8fdb\u884c\u4e86\u591a\u89c6\u89d2\u4e0b\u7684\u5206\u7c7b\u63cf\u8ff0 \u6784\u4ef6\u5206\u7c7b\u63cf\u8ff0\u7684\u672f\u8bed\u7a7a\u95f4\u6613\u4e8e\u4fee\u6539\u548c\u7ef4\u62a4 \u57fa\u4e8e\u6784\u4ef6 \u00b6 \u6784\u4ef6\u7ec4\u88c5 \u00b6 \u6784\u4ef6\u7ec4\u88c5\u5c31\u662f\u786e\u5b9a\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u4e0e\u63a5\u53e3\u4e4b\u95f4\u7684\u5339\u914d\u548c\u6620\u5c04\uff0c\u5e76\u63d0\u4f9b\u6ee1\u8db3\u5373\u5c06\u6216\u5c06\u6765\u90e8\u7f72\u7684\u7ea6\u675f\u6761\u4ef6\u3002 \u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u95ee\u9898 \u00b6 \u4efb\u4f55\u57fa\u4e8e\u6784\u4ef6\u7684\u5f00\u53d1\u5e94\u7b26\u5408\u4ee5\u4e0b\u6784\u4ef6\uff1a \u8981\u6e05\u6670\u5730\u5206\u79bb\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u8bbe\u8ba1\u5b9e\u73b0 \u91cd\u70b9\u5173\u6ce8\u4e8e\u63a5\u53e3\u7684\u5b9e\u73b0\u65b9\u6cd5 \u5f62\u5f0f\u5730\u63cf\u8ff0\u6784\u4ef6\u7684\u8bed\u4e49\uff0c\u4e3b\u8981\u662f\u5bf9\u6784\u4ef6\u884c\u4e3a\u7684\u63cf\u8ff0\uff0c\u5176\u6838\u5fc3\u662f\u64cd\u4f5c\u7279\u5f81\u7684\u8bed\u4e49\u7ec6\u8282 \u4e25\u683c\u5730\u8bb0\u5f55\u7ec6\u5316\u8fc7\u7a0b\uff0c\u5e76\u4e14\u52a0\u4ee5\u9a8c\u8bc1 \u4ece\u6280\u672f\u89d2\u5ea6\u770b\uff0c\u6784\u4ef6\u7ec4\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8003\u8651\u7684\u95ee\u9898\uff1a \u6bcf\u4e2a\u6784\u4ef6\u6ee1\u8db3\u5176\u4ed6\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6\u95ee\u9898 \u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u63a5\u53e3\u5339\u914d\u548c\u6620\u5c04\u95ee\u9898 \u6784\u4ef6\u7684\u5305\u88c5\u95ee\u9898 \u6784\u4ef6\u7ec4\u88c5\u7684\u65b9\u6cd5\u4e0e\u6280\u672f \u00b6 \u5b9a\u5236 \u8bbe\u7f6e\u53c2\u6570\u503c \u5b8c\u6210\u9700\u8981\u7528\u6237\u5b9a\u5236\u7684\u4ee3\u7801 \u6709\u65f6\u5019\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u6784\u4ef6 \u5305\u88c5 \u9002\u914d \u9002\u914d\u5668 \u9002\u914d\u5668\u4f4d\u4e8e\u4e24\u4e2a\u6784\u4ef6\u4e4b\u95f4\uff0c\u7528\u4ee5\u8f6c\u6362\u4e24\u4e2a\u6784\u4ef6\u5bf9\u63a5\u53e3\u7684\u4e0d\u540c\u7406\u89e3\uff0c\u662f\u8bf7\u6c42\u8005\u548c\u88ab\u8bf7\u6c42\u8005\u4e4b\u95f4\u7684\u6620\u5c04 \u9002\u914d\u5668\u672c\u8eab\u4e0d\u5305\u542b\u8868\u793a\u5c42\u3001\u4e1a\u52a1\u5c42\u548c\u6570\u636e\u8bbf\u95ee\u5c42\u7684\u903b\u8f91\uff0c\u4e5f\u4e0d\u80fd\u6269\u5c55\u6784\u4ef6\u7684\u529f\u80fd\uff08\u4e0e\u5305\u88c5\u4e0d\u540c\uff09 \u9002\u914d\u5668\u4e0d\u662f\u6784\u4ef6\uff0c\u4e0d\u5c5e\u4e8e\u88ab\u9002\u914d\u7684\u4e24\u4e2a\u6784\u4ef6\u7684\u4efb\u4f55\u4e00\u4e2a\uff0c\u4efb\u4f55\u4e00\u4e2a\u6784\u4ef6\u7684\u4e0d\u5b58\u5728\u5c06\u5bfc\u81f4\u9002\u914d\u5668\u7684\u6d88\u5931 \u9a8c\u8bc1\u548c\u9519\u8bef\u5904\u7406\u529f\u80fd \u5b89\u5168\u6027 \u6784\u4ef6\u7ec4\u88c5\u7684\u5185\u5bb9 \u00b6 \u6784\u4ef6\u7ec4\u88c5\u7684\u5b9e\u65bd\u5185\u5bb9\uff1a \u5f3a\u5236\u5b9e\u73b0\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6 \u5904\u7406\u529f\u80fd\u548c\u6570\u636e\u7684\u4e0d\u5339\u914d \u7ba1\u7406\u6784\u4ef6\u95f4\u7684\u5173\u7cfb \u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u7c7b\u578b\u5305\u62ec\u62e5\u6709\u5173\u7cfb\u548c\u5916\u90e8\u5173\u7cfb\u3002\u4f46\u4ece\u5173\u7cfb\u7684\u8868\u793a\u89d2\u5ea6\u6765\u770b\uff0c\u53ef\u5206\u4e3a\u76f4\u63a5\u94fe\u63a5\u548c\u95f4\u63a5\u94fe\u63a5\u3002 \u6784\u4ef6\u90e8\u7f72 \u00b6 \u63d0\u4f9b\u6784\u4ef6\u8fd0\u884c\u65f6\u7684\u914d\u7f6e\u6570\u636e \u63d0\u4f9b\u90e8\u7f72\u65f6\u7528\u5230\u7684\u6784\u4ef6\u5185\u5efa\u914d\u7f6e\u6216\u5b9a\u5236\u670d\u52a1 \u63d0\u4f9b\u6784\u4ef6\u7ec4\u88c5\u7684\u8f85\u52a9\u73af\u5883 \u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406 \u00b6 \u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406 SCM \u662f\u6307\u4e00\u5957\u6309\u89c4\u5219\u7ba1\u7406\u8f6f\u4ef6\u5f00\u53d1\u3001\u7ef4\u62a4\uff0c\u4ee5\u53ca\u5176\u4e2d\u5404\u79cd\u4e2d\u95f4\u8f6f\u4ef6\u4ea7\u54c1\u7684\u65b9\u6cd5\u3002 \u914d\u7f6e\u8bc6\u522b \u53d8\u5316\u63a7\u5236 \u72b6\u6001\u8bb0\u5f55\u62a5\u544a \u5ba1\u8ba1 \u9886\u57df\u5de5\u7a0b \u00b6 \u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b \u00b6 \u5e94\u7528\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u7ec4\u7279\u6709\u7684\u9700\u6c42\uff0c\u4ea7\u751f\u4e00\u4e2a\u7279\u5b9a\u7684\u89e3\u51b3\u65b9\u6848 \u9886\u57df\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u4e2a\u9886\u57df\u4e2d\u7684\u6240\u6709\u7cfb\u7edf\uff0c\u800c\u4e0d\u5c40\u9650\u4e8e\u67d0\u4e2a\u7279\u5b9a\u7684\u7cfb\u7edf \u4e0e\u5e94\u7528\u5de5\u7a0b\u76f8\u6bd4 \uff1a\u9886\u57df\u5de5\u7a0b\u5904\u4e8e\u4e00\u4e2a\u8f83\u9ad8\u7684\u62bd\u8c61\u7ea7\u522b\u4e0a \u9886\u57df\u5de5\u7a0b\u7684\u6784\u6210 \u00b6 \u7ec4\u6210\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u9886\u57df\u5b9e\u73b0 \u53ef\u590d\u7528\u8d44\u4ea7\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u8d44\u4ea7\u83b7\u53d6\u3001\u8d44\u4ea7\u5206\u7c7b\u3001\u8d44\u4ea7\u7ef4\u62a4 \u5e94\u7528\u5de5\u7a0b\u7684\u6784\u6210 \u00b6 \u7ec4\u6210\uff1a\u4ea7\u54c1\u7a7a\u95f4\u3001\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\u3001\u751f\u4ea7\u8ba1\u5212\u3001\u9700\u6c42\u3001\u4ea7\u54c1\u3001\u7ba1\u7406 \u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b\u7684\u5173\u7cfb \u00b6 \u9886\u57df\u5171\u6027\u4e0e\u53d8\u5316\u6027 \u00b6 \u53d8\u5316\u6027\u7684\u5206\u7c7b \u53d8\u5316\u6027\u7ed1\u5b9a \u53d8\u5316\u6027\u63a7\u5236 \u53d8\u5316\u6027\u5904\u7406\u6280\u672f \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u57fa\u672c\u5185\u5bb9 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6982\u5ff5 \u00b6 \u51af \u00b7 \u8bfa\u4f9d\u66fc\u7ed3\u6784 \u57fa\u4e8e\u529f\u80fd\u6a21\u5757\u7684\u8f6f\u4ef6\u7ed3\u6784 \u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5b9a\u4e49 \u00b6 Garlan & Shaw \u6a21\u578b\uff1a SA = {Components, Connectors, Constrains} Perry & Wolf \u6a21\u578b\uff1a SA = {Elements, Form, Rational} CFRP \u6a21\u578b\uff1aSA = {Elements, Interfaces, COnnections, Connection Semantics} Vestal \u6a21\u578b\uff1a SA = {Component, Idioms/Styles, Common Patterns of Interaction} IEEE 510\uff1aArchitecture = {Component, Connector, Environment, Principle} Boehm \u6a21\u578b\uff1aSA = {Components, COnnections, Constrains, Stakeholders'needs, Rationals} \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6784\u6210\u8981\u7d20 \u00b6 \u6784\u4ef6 \u8fde\u63a5\u4ef6 \u4f53\u7cfb\u7ed3\u6784\u914d\u7f6e \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u7814\u7a76\u5185\u5bb9 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u63cf\u8ff0\u8bed\u8a00 ADL \u00b6 \u4f53\u7cfb\u7ed3\u6784\u6784\u9020 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u9a8c\u8bc1 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53d1\u73b0\u3001\u6f14\u5316\u548c\u590d\u7528 \u00b6 \u57fa\u4e8e\u4f53\u7cfb\u7ed3\u6784\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b \u00b6 \u7279\u5b9a\u9886\u57df\u7684\u4f53\u7cfb\u7ed3\u6784 DSSA \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u652f\u6301\u5de5\u5177 \u00b6 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u6a21\u5f0f\u7cfb\u7edf \u00b6 \u6a21\u5f0f\u7684\u6982\u5ff5\u4e0e\u5206\u7c7b \u00b6 \u6a21\u5f0f\u7684\u5b9a\u4e49 \u00b6 \u6bcf\u4e2a\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u5728\u6211\u4eec\u5468\u56f4\u4e0d\u65ad\u91cd\u590d\u53d1\u751f\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u8be5\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u7684\u6838\u5fc3\u5185\u5bb9\u3002\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u4e00\u6b21\u53c8\u4e00\u6b21\u5730\u4f7f\u7528\u8be5\u65b9\u6848\u800c\u4e0d\u5fc5\u505a\u91cd\u590d\u52b3\u52a8\u3002 \u89e3\u51b3\u7b56\u7565\uff1a\u5c06\u6a21\u578b\u3001\u89c6\u56fe\u3001\u63a7\u5236\u5668\u5212\u5206\u5f00\u3002\u5c31\u662f\u4e00\u4e2a\u5178\u578b\u7684\u6a21\u578b \u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09 \u6a21\u5f0f\u7684\u6784\u6210\u8981\u7d20 \u00b6 \u8bed\u5883\uff1a\u95ee\u9898\u51fa\u73b0\u7684\u80cc\u666f \u95ee\u9898\uff1a\u5728\u8bed\u5883\u4e2d\u91cd\u590d\u51fa\u73b0\u7684\u95ee\u9898 \u89e3\u51b3\u65b9\u6848\uff1a\u7ed9\u51fa\u5982\u4f55\u89e3\u51b3\u518d\u73b0\u7684\u95ee\u9898\uff0c\u6216\u8005\u8bf4\u5982\u4f55\u5e73\u8861\u4e0e\u4e4b\u76f8\u5173\u7684\u5f3a\u5236\u6761\u4ef6 \u5b9e\u73b0\uff1a\u5c31\u662f\u5c06\u4ee5\u4e0a\u7684\u89e3\u51b3\u65b9\u6848\u4ed8\u8bf8\u5b9e\u8df5 \u6a21\u5f0f\u7684\u4f18\u52bf \u00b6 \u8bbe\u8ba1\u590d\u7528 \u4ee3\u7801\u590d\u7528 \u7cfb\u7edf\u7ec4\u6210\u66f4\u6613\u4e8e\u88ab\u4ed6\u4eba\u7406\u89e3 \u6709\u5229\u4e8e\u7cfb\u7edf\u7684\u4e92\u64cd\u4f5c\u6027 \u6709\u5229\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790 \u6709\u5229\u4e8e\u7279\u5b9a\u6a21\u5f0f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53ef\u89c6\u5316 \u6a21\u5f0f\u5206\u7c7b \u00b6 \u5e95\u5c42\u6a21\u5f0f\uff1a\u60ef\u7528\u6cd5 \u4e2d\u5c42\u6a21\u5f0f\uff1a\u8bbe\u8ba1\u6a21\u5f0f \u9ad8\u5c42\u6a21\u5f0f\uff1a\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f \u60ef\u7528\u6cd5 \u00b6 \u60ef\u7528\u6cd5\u9488\u5bf9\u8bbe\u8ba1\u548c\u5b9e\u73b0\u65b9\u9762\uff0c\u662f\u9488\u5bf9\u5177\u4f53\u7279\u5b9a\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7684\u4f4e\u5c42\u6a21\u5f0f\uff0c\u5b83\u63cf\u8ff0\u5982\u4f55\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u6216\u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u7279\u70b9 \u60ef\u7528\u6cd5\u662f\u4e0e\u5177\u4f53\u8bed\u8a00\u5bc6\u5207\u76f8\u5173\u7684\u7f16\u7a0b\u7ecf\u9a8c\u7684,\u603b\u7ed3\u3002 \u60ef\u7528\u6cd5\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u53ca\u5176\u5173\u7cfb\u3002 \u60ef\u7528\u6cd5\u4ee3\u8868\u6700\u5e95\u5c42\u7684\u6a21\u5f0f\u3002 \u60ef\u7528\u6cd5\u66f4\u5173\u6ce8\u8bbe\u8ba1\u7684\u5b9e\u73b0\u3002 \u60ef\u7528\u6cd5\u53ef\u80fd\u662f\u4e00\u79cd\u7279\u5b9a\u8bbe\u8ba1\u6a21\u5f0f\u7684\u5177\u4f53\u5b9e\u73b0\u3002 \u76ca\u5904 \u4e00\u7ec4\u76f8\u5173\u7684\u60ef\u7528\u6cd5\u4f1a\u4f7f\u7a0b\u5e8f\u5f62\u6210\u4e00\u81f4\u7684\u98ce\u683c\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u5c06\u52a0\u901f\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u8fdb\u7a0b\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u4f7f\u7a0b\u5e8f\u66f4\u5bb9\u6613\u7406\u89e3\uff0c\u6709\u5229\u4e8e\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u7ef4\u62a4\u3002 \u00b7 \u8bbe\u8ba1\u6a21\u5f0f \u00b6 \u4e2d\u7b49\u89c4\u6a21\u7684\u6a21\u5f0f\uff0c\u5728\u89c4\u6a21\u4e0a\u6bd4\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u8981\u5c0f\uff0c\u4f46\u5728\u7ea7\u522b\u4e0a\u6bd4\u7279\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u60ef\u7528\u6cd5\u8981\u9ad8 \u8bbe\u8ba1\u6a21\u5f0f\u95ee\u9898\u7c7b\u522b \u00b6 \u7ed3\u6784\u5316\u5206\u89e3\uff1a\u6700\u666e\u904d\u7684\u6a21\u5f0f\u662f\u6574\u4f53 - \u90e8\u5206\u6a21\u5f0f \u5de5\u4f5c\u7684\u7ec4\u7ec7\uff1a\u4e3b\u63a7 - \u4ece\u5c5e\u6a21\u5f0f \u8bbf\u95ee\u63a7\u5236\uff1a\u4ee3\u7406\u8bbe\u8ba1\u6a21\u5f0f\u3001\u5916\u89c2\u6a21\u5f0f\u548c\u8fed\u4ee3\u5668\u6a21\u5f0f \u7ba1\u7406\uff1a\u547d\u4ee4\u5904\u7406\u5668\u6a21\u5f0f\u3001\u89c6\u56fe\u5904\u7406\u7a0b\u5e8f\u6a21\u5f0f \u901a\u4fe1\uff1a\u8f6c\u53d1\u5668 - \u63a5\u6536\u5668\u6a21\u5f0f\u3001\u5ba2\u6237\u673a - \u5206\u914d\u5668 - \u670d\u52a1\u5668\u6a21\u5f0f\u3001\u51fa\u7248\u8005 - \u8ba2\u9605\u8005\u6a21\u5f0f \u8bbe\u8ba1\u6a21\u5f0f\u5206\u7c7b \u00b6 \u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f \u00b6 \u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5b9a\u4e49 \u00b6 \u4e00\u4e2a\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u7a0b\u5e8f\u5728\u7279\u5b9a\u8bbe\u8ba1\u8bed\u5883\u4e2d\u7684\u7279\u6b8a\u7684\u518d\u73b0\u8bbe\u8ba1\u95ee\u9898\uff0c\u5e76\u4e3a\u5b83\u7684\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ecf\u8fc7\u5145\u5206\u9a8c\u8bc1\u7684\u901a\u7528\u56fe\u5f0f\u3002\u89e3\u51b3\u65b9\u6848\u56fe\u5f0f\u901a\u8fc7\u63cf\u8ff0\u5176\u7ec4\u6210\u6784\u4ef6\u3001\u5b83\u4eec\u7684\u8d23\u4efb\u548c\u76f8\u4e92\u5173\u7cfb\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u534f\u4f5c\u65b9\u5f0f\u6765\u5177\u4f53\u6307\u5b9a\u3002 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u662f\u6a21\u5f0f\u7cfb\u7edf\u4e2d\u7684\u6700\u9ad8\u7b49\u7ea7\u6a21\u5f0f \u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5206\u7c7b \u00b6 \u4ece\u6df7\u6c8c\u5230\u7ed3\u6784 \u5206\u5c42\u6a21\u5f0f \u7ba1\u9053/\u8fc7\u6ee4\u5668\u6a21\u5f0f \u9ed1\u677f\u6a21\u5f0f \u5206\u5e03\u5f0f\u7cfb\u7edf \u4ee3\u7406\u6a21\u5f0f \u4ea4\u4e92\u5f0f\u7cfb\u7edf \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\u6a21\u5f0f\uff08PAC\uff09 \u9002\u5e94\u6027\u6a21\u5f0f \u53cd\u5c04\u6a21\u5f0f \u5fae\u6838\u6a21\u5f0f \u5e38\u7528\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f \u00b6 \u7ba1\u9053/\u8fc7\u6ee4\u5668 \u57fa\u4e8e\u4e8b\u4ef6\u7684\u9690\u5f0f\u8c03\u7528 \u5206\u5c42\u98ce\u683c \u6570\u636e\u62bd\u8c61\u548c\u9762\u5411\u5bf9\u8c61 \u4ed3\u5e93\u4e0e\u9ed1\u677f\u6a21\u5f0f \u89e3\u91ca\u5668 \u4ee3\u7406\u6a21\u5f0f \u5fae\u6838 \u5ba2\u6237/\u670d\u52a1\u5668 \u6b63\u4ea4\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 C2 \u5f02\u6784\u7ed3\u6784 \u53cd\u5c04 \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\uff08PAC\uff09 \u6a21\u5f0f\u7cfb\u7edf\u4e0e\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c \u00b6 \u82e5\u5e72\u5b9a\u4e49 \u00b6 \u6a21\u5f0f\u7cfb\u7edf \uff1a\u5c06\u4e00\u4e2a\u4e2a\u5355\u72ec\u7684\u6a21\u5f0f\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u63cf\u8ff0\u4e86\u6a21\u5f0f\u4e4b\u95f4\u7684\u5173\u7cfb\u3001\u6a21\u5f0f\u7684\u5b9e\u73b0\uff0c\u4ee5\u53ca\u6a21\u5f0f\u600e\u6837\u76f8\u4e92\u8054\u7cfb\u76f8\u4e92\u8865\u5145\u6765\u6709\u6548\u652f\u6301\u8f6f\u4ef6\u5f00\u53d1\u7684\u3002 \u6a21\u5f0f\u8bed\u8a00 \uff1a\u7531\u7ed3\u6784\u548c\u89c4\u5219\u6784\u6210\u3002\u7ed3\u6784\u63cf\u8ff0\u4e86\u6a21\u5f0f\u662f\u66f4\u5c0f\u6a21\u5f0f\u7684\u6a21\u5f0f;\u89c4\u5219\u63cf\u8ff0\u4e86\u521b\u5efa\u6a21\u5f0f\u7684\u65b9\u5f0f\u548c\u4e0e\u5176\u4ed6\u6a21\u5f0f\u7684\u6392\u5217\u65b9\u5f0f\u3002 SA \u6a21\u5f0f\u7cfb\u7edf \uff1a\u662f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u6c47\u96c6\uff0c\u5305\u62ec\u6a21\u5f0f\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u5b9e\u73b0\u3001\u7ec4\u5408\u548c\u4f7f\u7528\u6307\u5357\u3002 \u6a21\u5f0f\u7cfb\u7edf\u7684\u6f14\u5316 \uff1a\u5305\u62ec\u6a21\u5f0f\u63cf\u8ff0\u7684\u6f14\u5316\u3001\u6a21\u5f0f\u7684\u91c7\u6398\u3001\u65b0\u6a21\u5f0f\u7684\u96c6\u6210\u548c\u5220\u9664\u8fc7\u65f6\u7684\u6a21\u5f0f\u7b49\u3002 \u6a21\u5f0f\u7cfb\u7edf\u5bf9\u8f6f\u4ef6\u5f00\u53d1\u7684\u652f\u6301\u6761\u4ef6 \u00b6 \u5305\u542b\u8db3\u591f\u591a\u7684\u57fa\u672c\u6a21\u5f0f \u6240\u6709\u7684\u6a21\u5f0f\u5e94\u8be5\u6709\u7edf\u4e00\u7684\u63cf\u8ff0\u5f62\u5f0f \u5177\u6709\u5bf9\u6a21\u5f0f\u5982\u4f55\u7ec4\u7ec7\u7684\u6a21\u5f0f \u652f\u6301\u8f6f\u4ef6\u6784\u9020\u7684\u65b9\u6cd5 \u652f\u6301\u6a21\u5f0f\u7cfb\u7edf\u7684\u81ea\u6211\u70df\u82b1 \u6a21\u5f0f\u7cfb\u7edf\u7684\u5168\u5c40\u5206\u7c7b\u89c6\u56fe \u00b6 \u9762\u5411\u95ee\u9898\u7684\u6a21\u5f0f\u9009\u62e9\u6b65\u9aa4 \u00b6 \u6307\u5b9a\u548c\u7cbe\u786e\u5730\u63cf\u8ff0\u95ee\u9898 \u9488\u5bf9\u95ee\u9898\u7684\u89c4\u6a21\uff0c\u9009\u62e9\u201c\u6a21\u5f0f\u7c7b\u522b\u201d\uff08\u4e0d\u662f\u6309\u95ee\u9898\u7c7b\u522b\u9009\u53d6\uff09 \u5bf9\u95ee\u9898\u8fdb\u884c\u5206\u7c7b\uff0c\u521d\u6b65\u9009\u53d6\u89e3\u51b3\u95ee\u9898\u7684\u6a21\u5f0f\u548c\u53ef\u9009\u6a21\u5f0f \u5bf9\u95ee\u9898\u7684\u5206\u7c7b\u548c\u76f8\u5e94\u7684\u89e3\u51b3\u6a21\u5f0f\u8fdb\u884c\u6bd4\u8f83\uff08\u4f18\u7f3a\u70b9\uff09 \u8fdb\u4e00\u6b65\u9009\u53d6\u66f4\u5408\u9002\u7684\u89e3\u51b3\u65b9\u6848\u7684\u53d8\u4f53 \u5982\u679c\u53d1\u73b0\u95ee\u9898\u96be\u4ee5\u89e3\u51b3\uff0c\u5219\u91cd\u65b0\u8fdb\u884c\u95ee\u9898\u5206\u7c7b\uff0c\u8f6c\u81f3 3 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u7684\u6bd4\u8f83 \u00b6 \u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4e3b\u8981\u63cf\u8ff0\u5e94\u7528\u7cfb\u7edf\u7684,\u603b\u4f53\u7ed3\u6784\u6846\u67b6\u3002\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u53ef\u5b58\u5728\u4e8e\u5404\u79cd\u5e94\u7528\u7cfb\u7edf\u89c4\u6a21\u548c\u62bd\u8c61\u5c42\u6b21\u4e0a\uff0c\u4ece\u5b9a\u4e49\u5e94\u7528\u7cfb\u7edf\u7684\u603b\u4f53\u7ed3\u6784\u5230\u63cf\u8ff0\u600e\u6837\u7528\u7ed9\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u7279\u5b9a\u95ee\u9898\u7684\u60ef\u7528\u6cd5\u6a21\u5f0f\u3002 \u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u76f8\u5bf9\u72ec\u7acb\u3002\u5404\u5e94\u7528\u7cfb\u7edf\u91c7\u7528\u4e0d\u540c\u7684\u98ce\u683c\u540e\uff0c\u4e0e\u7531\u5176\u4ed6\u98ce\u683c\u6784\u6210\u7684\u7cfb\u7edf\u8054\u7cfb\u8f83\u5c11\u3002\u800c\u6a21\u5f0f\u5f80\u5f80\u4f9d\u8d56\u4e8e\u5b83\u6240\u5305\u542b\u7684\u8f83\u5c0f\u7684\u6a21\u5f0f\u6216\u8005\u4e0e\u5b83\u76f8\u4e92\u4f5c\u7528\u7684\u6a21\u5f0f\u3002 \u6a21\u5f0f\u6bd4\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u66f4\u52a0\u9762\u5411\u95ee\u9898\u3002\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4fa7\u91cd\u4e8e\u4ece\u5e94\u7528\u7cfb\u7edf\u4e2d\u62bd\u53d6\u51fa\u5b83\u4eec\u7684\u603b\u4f53\u7ec4\u7ec7\u7ed3\u6784\uff0c\u800c\u8f83\u5c11\u4ece\u5b9e\u9645\u8bbe\u8ba1\u73af\u5883\u6c34\u8003\u611f\u8bbe\u8ba1\u7684\u6280\u672f\u3002\u800c\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u901a\u5e38\u7531\u95ee\u9898\u51fa\u73b0\u7684\u8bed\u5883\u3001\u89e3\u51b3\u65b9\u6848\u548c\u9002\u7528\u573a\u666f\u7ec4\u6210\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784"},{"location":"cs/software/sca/#_1","text":"\u7ea6 5144 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 17 \u5206\u949f Abstract \u8fd9\u91cc\u8bb0\u5f55\u5b66\u4e60\u8fd9\u672c\u4e66\u65f6\u7684\u7b14\u8bb0\uff08\u540c\u65f6\u662f\u7814\u4e00\u7684\u5b66\u4f4d\u8bfe\uff09 \u4f5c\u8005\u662f\u6211\u7684\u5bfc\u5e08\u738b\u6620\u8f89\u6559\u6388","title":"\u8f6f\u4ef6\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784"},{"location":"cs/software/sca/#_2","text":"","title":"\u8f6f\u4ef6\u590d\u7528"},{"location":"cs/software/sca/#_3","text":"\u8f6f\u4ef6\u590d\u7528\u662f\u6307\u5728\u4e24\u6b21\u6216\u591a\u6b21\u4e0d\u540c\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u91cd\u590d\u4f7f\u7528\u76f8\u540c\u7684\u6216\u76f8\u8fd1\u7684\u8f6f\u4ef6\u5143\u7d20\u7684\u8fc7\u7a0b\u3002\u5f15\u51fa\u4e86 \u6784\u4ef6 \u7684\u6982\u5ff5\u3002 \u8f6f\u4ef6\u590d\u7528\u53ef\u5212\u5206\u4e3a\u5982\u4e0b\u51e0\u7c7b\uff1a \u4ee3\u7801\u7684\u590d\u7528 \u8bbe\u8ba1\u7684\u590d\u7528 \u5206\u6790\u7684\u590d\u7528 \u6d4b\u8bd5\u4fe1\u606f\u7684\u590d\u7528","title":"\u8f6f\u4ef6\u590d\u7528\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_4","text":"","title":"\u8f6f\u4ef6\u590d\u7528\u7684\u5b9e\u73b0"},{"location":"cs/software/sca/#_5","text":"\u5de5\u7a0b\u65b9\u9762 \u7f3a\u5c11\u80fd\u591f\u6e05\u6670\u6807\u8bc6\u53ef\u590d\u7528\u6a21\u578b\u8981\u7d20\u7684\u624b\u6bb5\u3002 \u7f3a\u5c11\u80fd\u591f\u590d\u7528\u7684\u6784\u4ef6\u3002 \u53ef\u590d\u7528\u7684\u6784\u4ef6\u7f3a\u4e4f\u7075\u6d3b\u6027\u3002 \u7f3a\u4e4f\u6267\u884c\u590d\u7528\u8fc7\u7a0b\u7684\u5de5\u5177\u3002 \u8fc7\u7a0b\u65b9\u9762 \u7ec4\u7ec7\u65b9\u9762 \u8d44\u91d1\u65b9\u9762","title":"\u57fa\u672c\u95ee\u9898"},{"location":"cs/software/sca/#_6","text":"\u590d\u7528\u4f9d\u8d56\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 \u3002\u4f7f\u7528\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6765\u89c4\u5212\u548c\u7ba1\u7406\u5927\u89c4\u6a21\u53ef\u590d\u7528\u7cfb\u7edf\u7684\u590d\u6742\u6027\u662f\u6700\u597d\u7684\u89e3\u51b3\u65b9\u6cd5\u3002","title":"\u5173\u952e\u56e0\u7d20"},{"location":"cs/software/sca/#_7","text":"\u6784\u4ef6\u662f\u5177\u6709\u4e00\u5b9a\u529f\u80fd\u3001\u80fd\u591f\u72ec\u7acb\u5de5\u4f5c\u6216\u540c\u5176\u4ed6\u6784\u4ef6\u88c5\u914d\u8d77\u6765\u534f\u8c03\u5de5\u4f5c\u7684\u7a0b\u5e8f\u4f53\uff0c\u6784\u4ef6\u7684\u4f7f\u7528\u540c\u5b83\u7684\u5f00\u53d1\u3001\u751f\u4ea7\u65e0\u5173\u3002\u6574\u4e2a\u6784\u4ef6\u9690\u85cf\u4e86\u5177\u4f53\u7684\u5b9e\u73b0\uff0c\u53ea\u7528\u63a5\u53e3\u5bf9\u5916\u63d0\u4f9b\u670d\u52a1\u3002 \u4ece\u5916\u90e8\u5f62\u6001\u770b\uff1a \u72ec\u7acb\u800c\u6210\u719f\u7684\u6784\u4ef6 \u6709\u9650\u5236\u7684\u6784\u4ef6 \u9002\u7528\u6027\u6784\u4ef6 \u88c5\u914d\u7684\u6784\u4ef6 \u53ef\u4fee\u6539\u7684\u6784\u4ef6","title":"\u8f6f\u4ef6\u590d\u7528\u4e0e\u6784\u4ef6\u6280\u672f"},{"location":"cs/software/sca/#_8","text":"","title":"\u6784\u4ef6\u6280\u672f"},{"location":"cs/software/sca/#_9","text":"\u6280\u672f\u4e0e\u9700\u6c42\u53d8\u5316\u7684\u95ee\u9898\u3002 \u91cd\u590d\u4e0d\u5fc5\u8981\u7684\u5de5\u4f5c\u95ee\u9898\u3002 \u5e94\u7528\u96c6\u6210\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u96be\u4ee5\u7ef4\u62a4\u7684\u95ee\u9898\u3002 \u8f6f\u4ef6\u8d28\u91cf\u548c\u6210\u672c\u6709\u6548\u6027\u95ee\u9898\u7b49\u3002 \u6784\u4ef6\u6280\u672f\u662f\u76ee\u524d\u652f\u6301\u8f6f\u4ef6\u590d\u7528\u7684\u6838\u5fc3\u6280\u672f\u3002\u7814\u7a76\u5185\u5bb9\u5305\u62ec\uff1a \u6784\u4ef6\u83b7\u53d6\uff1a\u6709\u76ee\u7684\u7684\u6784\u4ef6\u751f\u4ea7\u548c\u4ece\u5df2\u6709\u7cfb\u7edf\u4e2d\u6316\u6398\u63d0\u53d6\u6784\u4ef6\u3002 \u7814\u7a76\u6a21\u578b\uff1a\u7814\u7a76\u6784\u4ef6\u7684\u672c\u8d28\u7279\u5f81\u548c\u6784\u4ef6\u95f4\u7684\u5173\u7cfb\u3002 \u6784\u4ef6\u63cf\u8ff0\u8bed\u8a00\uff1a\u4ee5\u6784\u4ef6\u6a21\u578b\u4e3a\u57fa\u7840\uff0c\u89e3\u51b3\u6784\u4ef6\u7684\u7cbe\u786e\u63cf\u8ff0\u3001\u7406\u89e3\u3001\u68c0\u7d20\u53ca\u7ec4\u88c5\u95ee\u9898\u3002 \u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff1a\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u53ca\u68c0\u7d20\u7b56\u7565\uff0c\u5efa\u7acb\u6784\u4ef6\u5e93\u7cfb\u7edf\uff0c\u652f\u6301\u6784\u4ef6\u7684\u6709\u6548\u7ba1\u7406\u3002 \u6784\u4ef6\u590d\u5408\u7ec4\u88c5\uff1a\u5728\u6784\u4ef6\u6a21\u578b\u7684\u57fa\u7840\u4e0a\u7814\u7a76\u6784\u4ef6\u7ec4\u88c5\u673a\u5236\uff0c\u5305\u62ec\u6e90\u4ee3\u7801\u7ea7\u7684\u7ec4\u88c5\u548c\u57fa\u4e8e\u6784\u4ef6\u5bf9\u8c61\u4e92\u64cd\u4f5c\u6027\u7684\u7ec4\u88c5\u3002 \u6807\u51c6\u5316\uff1a\u6784\u4ef6\u6a21\u578b\u7684\u6807\u51c6\u5316\u548c\u6784\u4ef6\u5e93\u7cfb\u7edf\u7684\u6807\u51c6\u5316\u7b49\u3002","title":"\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u95ee\u9898"},{"location":"cs/software/sca/#_10","text":"\u8f6f\u4ef6\u6210\u5206\u5305\u62ec\u7a0b\u5e8f\u4ee3\u7801\u3001\u6d4b\u8bd5\u7528\u4f8b\u3001\u8bbe\u8ba1\u6587\u6863\u3001\u8bbe\u8ba1\u8fc7\u7a0b\u3001\u9700\u6c42\u5206\u6790\u6587\u6863\uff0c\u751a\u81f3\u9886\u57df\u77e5\u8bc6\uff0c\u901a\u5e38\u628a\u8fd9\u79cd\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u6210\u5206\u79f0\u4e3a\u8f6f\u4ef6\u6784\u4ef6\uff0c\u7b80\u79f0\u8f6f\u6784\u4ef6\u6216\u8005\u6784\u4ef6\u3002\u53ef\u590d\u7528\u7684\u8f6f\u4ef6\u5143\u7d20\u8d8a\u5927\uff0c\u6211\u4eec\u5c31\u8bf4\u590d\u7528\u7684\u7c92\u5ea6(Granularity)\u8d8a\u5927\u3002 \u6784\u4ef6\u662f\u9884\u5148\u6784\u5efa\u7684\u3002 \u6784\u4ef6\u662f\u9ed1\u76d2\u7684\u3002 \u6784\u4ef6\u662f\u53ef\u5206\u79bb\u7684\u3002 \u6784\u4ef6\u80fd\u7528\u4e8e\u7ec4\u88c5\u548c\u90e8\u7f72\u3002 \u6784\u4ef6\u9700\u8981\u79f0\u4e3a\u6784\u4ef6\u5bb9\u5668\u6280\u672f\u7684\u652f\u6301\u3002 \u4e00\u4e2a\u5b8c\u6574\u7684\u6784\u4ef6\u5e94\u5305\u542b6\u4e2a\u8981\u7d20\uff1a \u53d7\u7ea6\u675f\u7684\u6784\u4ef6\u6807\u51c6\uff1a\u7b26\u5408\u67d0\u79cd\u6784\u4ef6\u6a21\u578b\u3002 \u89c4\u683c\u8bf4\u660e\uff1a\u6784\u4ef6\u63d0\u4f9b\u670d\u52a1\u7684\u62bd\u8c61\u63cf\u8ff0\uff0c\u7528\u4f5c\u670d\u52a1\u7684\u5ba2\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\u3002 \u5b9e\u73b0\uff1a\u5fc5\u987b\u7b26\u5408\u89c4\u683c\u8bf4\u660e\uff0c\u5404\u81ea\u5b9e\u73b0\u3002 \u5305\u88c5\u65b9\u6cd5\uff1a\u6309\u4e0d\u540c\u7684\u65b9\u5f0f\u5206\u7ec4\u6765\u63d0\u4f9b \u4e00\u5957\u53ef\u4ee5\u66ff\u6362\u7684\u670d\u52a1(\u5305)\u3002 \u6ce8\u518c\uff1a\u53ef\u5728\u6784\u4ef6\u652f\u6301\u73af\u5883\u4e2d\u6ce8\u518c\u3002 \u90e8\u7f72\u65b9\u6cd5\uff1a\u6784\u4ef6\u53ef\u4ee5\u90e8\u7f72\u591a\u4e2a\u5b9e\u4f8b\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_11","text":"\u6784\u4ef6\u7684\u540d\u79f0\u4e0e\u7b80\u77ed\u63cf\u8ff0\u3002 \u6784\u4ef6\u670d\u52a1\u3002 \u6784\u4ef6\u63a5\u53e3\u4fe1\u606f\u3002 \u6240\u9700\u7684\u63a5\u53e3\u3002 \u53d1\u5e03\u548c\u63a5\u53d7\u7684\u4e8b\u4ef6\u3002 \u6784\u4ef6\u7279\u5f81\u3002 \u9644\u52a0\u4fe1\u606f\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e"},{"location":"cs/software/sca/#_12","text":"\u6784\u4ef6\u5fc5\u9886\u5bf9\u5176\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u8fdb\u884c\u62bd\u8c61\u63cf\u8ff0\uff0c\u4ee5\u4f5c\u4e3a\u670d\u52a1\u7684\u5bb9\u6237\u65b9\u548c\u63d0\u4f9b\u65b9\u4e4b\u95f4\u7684\u5951\u7ea6\uff0c\u8fd9\u5c31\u662f\u6784\u4ef6\u63a5\u53e3\u3002","title":"\u8f6f\u4ef6\u6784\u4ef6\u63a5\u53e3"},{"location":"cs/software/sca/#_13","text":"","title":"\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b"},{"location":"cs/software/sca/#_14","text":"\u6784\u4ef6\u6a21\u578b\u5b9a\u4e49\u4e86\u4ec0\u4e48\u662f\u6784\u4ef6\u3001\u6784\u4ef6\u7684\u4f9d\u636e\u3001\u5982\u4f55\u4f7f\u7528\u5176\u4ed6\u6784\u4ef6\u63d0\u4f9b\u7684\u670d\u52a1\u7b49\u3002\u5c07\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u5177\u4f53\u5b9e\u73b0\u5206\u79bb\uff0c\u4f9d\u9760\u6784\u4ef6\u5b9e\u73b0\u7684\u5177\u4f53\u6a21\u5f0f\u6765\u63a8\u5bfc\u51fa\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\uff0c\u53ef\u4ee5\u6784\u9020\u4e00\u4e2a\u6784\u4ef6\u6a21\u578b\u3002 \u4f7f\u7528\u4e2d\u95f4\u4ef6\uff0c\u4e5f\u53ef\u4ee5\u4f7f\u6784\u4ef6\u4e4b\u95f4\u8fdb\u884c\u66f4\u597d\u5730\u901a\u4fe1\u3002\u5982\u6784\u4ef6\u4e4b\u95f4\u76f4\u63a5\u8fdb\u884c\u901a\u4fe1\uff0c\u5f53\u6784\u6210\u7cfb\u7edf\u7684\u6784\u4ef6\u6570\u91cf\u5e9e\u5927\u65f6\uff0c\u5176\u590d\u6742\u7a0b\u5ea6\u8fc5\u901f\u63d0\u9ad8\uff1b\u5982\u80fd\u5f15\u4eba\u4e2d\u4ecb\u5c42 (\u4e2d\u95f4\u4ef6)\uff0c\u5219\u53ef\u5f88\u597d\u5730\u907f\u514d\u6784\u4ef6\u95f4\u590d\u6742\u7684\u4ea4\u4e92\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a","title":"\u6784\u4ef6\u6a21\u578b\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_15","text":"\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b\u56fd\u5185\u8bb8\u591a\u5b66\u8005\u5728\u6784\u4ef6\u6a21\u578b\u7684\u7814\u7a76\u65b9\u9762\u505a\u4e86\u4e0d\u5c11\u7684\u5de5\u4f5c\uff0c\u5176\u4e2d\u8f83\u4e3a\u7a81\u51fa\u7684\u662f\u5317\u4eac\u5927\u5b66\u6768\u8299\u6e05\u9662\u58eb\u7b49\u4eba\u63d0\u51fa\u7684\u201c\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b(JBCOM)\u201d\u3002\u5b83\u7531\u5916\u90e8\u63a5\u53c8\u4e0e\u5185\u90e8\u7ed3\u6784\u4e24\u90e8\u5206\u7ec4\u6210\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u6784\u4ef6\u7684\u5916\u90e8\u63a5\u53e3\u662f\u6307\u6784\u4ef6\u5411\u5176\u590d\u7528\u8005\u63d0\u4f9b\u7684\u57fa\u672c\u4fe1\u606f\uff0c\u5305\u62ec:\u6784\u4ef6\u540d\u79f0\u3001\u529f\u80fd\u63cf\u8ff0\u3001\u5bf9\u5916\u529f\u80fd\u63a5\u53e3\uff0c\u6240\u9700\u670d\u52a1\u7684\u6784\u4ef6\u548c\u53c2\u6570\u5316\u5c5e\u6027\u7b49\u3002\u5916\u90e8\u63a5\u53e3\u662f\u6784\u4ef6\u4e0e\u5916\u754c\u7684\u4e00\u7ec4\u4ea4\u4e92\u70b9\uff0c\u8bf4\u660e\u4e86\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u90a3\u4e9b\u670d\u52a1(\u6d88\u606f\u3001\u64cd\u4f5c\u548c\u53d8\u91cf)\u3002 \u6784\u4ef6\u7684\u5185\u90e8\u7ed3\u6784\u5305\u62ec\u4e24\u65b9\u9762\u7684\u5185\u5bb9:\u5185\u90e8\u6210\u5458\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u5173\u7cfb\u3002\u5176\u4e2d\uff0c\u5185\u90e8\u6210\u5458\u5305\u62ec\u5177\u4f53\u6210\u5458\u4e0e\u865a\u62df\u6210\u5458\uff0c\u800c\u6210\u5458\u5173\u7cfb\u5305\u62ec\u6210\u5458\u4e4b\u95f4\u7684\u4e92\u8054\uff0c\u4ee5\u53ca\u5185\u90e8\u6210\u5458\u4e0e\u5916\u90e8\u63a5\u53e3\u4e4b\u95f4\u7684\u4e92\u8054\u3002","title":"\u9752\u9e1f\u8f6f\u4ef6\u6784\u4ef6\u6a21\u578b"},{"location":"cs/software/sca/#_16","text":"\u6784\u4ef6::=\u3008\u6784\u4ef6\u89c4\u7ea6\uff0c\u6784\u4ef6\u5b9e\u73b0\u3009 \u6784\u4ef6\u89c4\u7ea6::=\u3008\u63a5\u53c8\u90e8\u5206\uff0c\u7ed3\u6784\u90e8\u5206\u3009 \u63a5\u53e3\u90e8\u5206::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\uff0c\u670d\u52a1\u96c6\u5408\u3009 \u670d\u52a1::=\u3008\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u96c6\u5408\uff0c\u5bf9\u5916\u8bf7\u6c42\u7684\u529f\u80fd\u96c6\u5408\u3009 \u7ed3\u6784\u90e8\u5206::=\u3008\u539f\u5b50\u6784\u4ef6\u7ed3\u6784\u3009|\u3008\u590d\u5408\u6784\u4ef6\u7ed3\u6784\u3009 \u539f\u5b50\u6784\u4ef6\u7ed3\u6784::=\u3008\u6784\u4ef6\u5b9e\u73b0\u7684\u5f15\u7528\u3009 \u590d\u5408\u6784\u4ef6\u7ed3\u6784::=\u3008\u5f15\u7528\u7684\u6784\u4ef6\u7c7b\u578b\uff0c\u5b9e\u4f8b\u58f0\u660e\uff0c\u5b9e\u4f8b\u8fde\u63a5\uff0c\u6620\u5c04\u3009 eg. \u7f16\u8bd1\u5668\u590d\u5408\u6784\u4ef6\u5b9e\u4f8b\u3002","title":"\u6784\u4ef6\u6a21\u578b\u7684\u63cf\u8ff0\u65b9\u6cd5"},{"location":"cs/software/sca/#_17","text":"\u6784\u4ef6\u7684\u7c92\u5ea6 \u6784\u4ef6\u7684\u57fa\u7840\u8bbe\u65bd \u6784\u4ef6\u7684\u83b7\u53d6 \u6784\u4ef6\u7684\u7ba1\u7406 \u7ec4\u88c5\u4e0e\u90e8\u7f72","title":"\u8f6f\u4ef6\u6784\u4ef6\u7684\u6df1\u5c42\u7406\u89e3"},{"location":"cs/software/sca/#_18","text":"","title":"\u9762\u5411\u6784\u4ef6"},{"location":"cs/software/sca/#_19","text":"\u901a\u8fc7\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u5b9e\u73b0\uff0c\u6765\u5f97\u5230\u6240\u9700\u7684\u6784\u4ef6","title":"\u9762\u5411\u6784\u4ef6\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_20","text":"\u6839\u636e\u8f6f\u4ef6 3 \u5c42\u6846\u67b6\u7684\u6784\u4ef6\u5206\u7c7b \u8868\u793a\u5c42 \u4e1a\u52a1\u5c42 \u6570\u636e\u5c42 \u636e\u6b64\u6846\u67b6\uff0c\u6784\u4ef6\u53ef\u4ee5\u88ab\u5206\u4e3a 3 \u7c7b\uff1a\u5e94\u7528\u8f6f\u4ef6\u3001\u4e1a\u52a1\u6784\u4ef6\u548c\u6570\u636e\u6784\u4ef6 \u4e1a\u52a1\u6784\u4ef6\u7684\u83b7\u53d6\u60c5\u51b5 \u5b9a\u4e49\u4e1a\u52a1\u5bf9\u8c61 \u786e\u5b9a\u63a7\u5236\u903b\u8f91\uff08\u4e1a\u52a1\u8fc7\u7a0b\uff09 \u786e\u5b9a\u4e1a\u52a1\u5bf9\u8c61\u4e0e\u63a7\u5236\u903b\u8f91\u4e4b\u95f4\u7684\u4ea4\u4e92 \u533a\u5206\u516c\u53f8\u7684\u4e1a\u52a1\u903b\u8f91\u548c\u7279\u5b9a\u90e8\u95e8\u7684\u4e1a\u52a1\u903b\u8f91 \u5c06\u4e1a\u52a1\u5bf9\u8c61\u548c\u63a7\u5236\u903b\u8f91\u5206\u914d\u5230\u76f8\u5e94\u7684\u4e1a\u52a1\u6784\u4ef6\u4e2d\u53bb \u57fa\u4e8e\u6784\u4ef6\u7c92\u5ea6\u5927\u5c0f\u7684\u6784\u4ef6\u5206\u7c7b \u53ef\u5206\u4e3a\uff1a\u5927\u7c92\u5ea6\u7684\u5e94\u7528\u6784\u4ef6\u3001\u7528\u6237\u4efb\u52a1\u6784\u4ef6\u3001\u6279\u5904\u7406\u6784\u4ef6\u548c\u5b50\u4efb\u52a1\u6784\u4ef6","title":"\u6784\u4ef6\u7684\u5206\u7c7b"},{"location":"cs/software/sca/#_21","text":"","title":"\u6784\u4ef6\u7684\u8bbe\u8ba1\u4e0e\u5b9e\u73b0"},{"location":"cs/software/sca/#_22","text":"\u6784\u4ef6\u63a5\u53e3\u7684\u5b9a\u4e49\u7684\u57fa\u672c\u539f\u5219\uff1a \u5b9a\u4e49\u4e00\u4e9b\u4e0d\u53d8\u7684\u63a5\u53e3 \u5b9a\u4e49\u81ea\u63cf\u8ff0\u7684\u63a5\u53e3 \u5b9a\u4e49\u5143\u6570\u636e\u6027\u8d28\u7684\u63a5\u53e3 \u6784\u4ef6\u8bbe\u8ba1\u6210\u53ef\u5b9a\u5236\u7684","title":"\u6784\u4ef6\u63a5\u53e3\u5b9a\u4e49\u7684\u539f\u5219"},{"location":"cs/software/sca/#_23","text":"\u539f\u5b50\u6784\u4ef6 Atom \u662f\u6700\u5c0f\u7c92\u5ea6\u7684\u6784\u4ef6\uff0c\u8be5\u6784\u4ef6\u5728\u529f\u80fd\u7b49\u65b9\u9762\u5177\u6709\u4e0d\u53ef\u518d\u62c6\u5206\u7684\u6027\u8d28\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u7684\u5b9e\u4f53\u5bf9\u5e94\u5355\u4e2a\u5bf9\u8c61\u65f6\uff0c\u53ef\u4ee5\u79f0\u8fd9\u4e2a\u6784\u4ef6\u662f\u5355\u5bf9\u8c61\u6784\u4ef6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u63a5\u53e3\u89c4\u7ea6\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002 \u5f53\u4e00\u4e2a\u539f\u5b50\u6784\u4ef6\u5bf9\u5e94\u591a\u4e2a\u534f\u4f5c\u5bf9\u8c61\u65f6\uff0c\u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u9700\u8981\u5f15\u5165\u4e00\u4e2a\u63a7\u5236\u5bf9\u8c61\u3002 \u5b9a\u4e49\u6784\u4ef6\u63a5\u53e3\u7684\u89c4\u7ea6\u90e8\u5206\u3002 \u5236\u4f5c\u6784\u4ef6\u5b9e\u4f53\u3002","title":"\u539f\u5b50\u6784\u4ef6\u7684\u5236\u4f5c"},{"location":"cs/software/sca/#_24","text":"\u590d\u5408\u6784\u4ef6 Assemble \u662f\u7531\u539f\u5b50\u6784\u4ef6\u6216\u8005\u590d\u5408\u6784\u4ef6\u7ec4\u88c5\u800c\u6210\u7684\u3002 \u5236\u4f5c\u6d41\u7a0b\u5982\u4e0b\uff1a \u5b9a\u4e49\u6784\u4ef6\u7684\u63a5\u53e3\u89c4\u7ea6\u90e8\u5206 \u786e\u5b9a\u6240\u5305\u542b\u7684\u6210\u5458\u6784\u4ef6 \u5efa\u7acb\u5185\u90e8\u7684\u6210\u5458\u6784\u4ef6\u4e4b\u95f4\u7684\u63a5\u53e3\u8fde\u63a5\u5173\u7cfb \u5c06\u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u548c\u8981\u6c42\u7684\u529f\u80fd\u6620\u5c04\u5230\u5185\u90e8\u6210\u5458\u6784\u4ef6\u76f8\u5e94\u7684\u529f\u80fd\u4e0a \u5728\u5efa\u7acb\u5185\u90e8\u6210\u5458\u4e4b\u95f4\u7684\u8fde\u63a5\u5173\u7cfb\u4ee5\u53ca\u590d\u5408\u6784\u4ef6\u548c\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u6620\u5c04\u65f6\uff0c\u9075\u5faa\u4e00\u4e0b\u89c4\u5219\uff1a \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ea\u80fd\u7531\u4e00\u4e2a\u63d0\u4f9b\u8005\u63d0\u4f9b \u6210\u5458\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ef\u4ee5\u6709\u591a\u4e2a\u4f7f\u7528\u8005 \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u8981\u6c42\u7684\u529f\u80fd\u53ef\u4ee5\u6620\u5c04\u5230\u591a\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a \u590d\u5408\u6784\u4ef6\u5bf9\u5916\u63d0\u4f9b\u7684\u529f\u80fd\u53ea\u80fd\u6620\u5c04\u5230\u4e00\u4e2a\u6210\u5458\u6784\u4ef6\u7684\u529f\u80fd\u4e0a","title":"\u590d\u5408\u6784\u4ef6\u7684\u5236\u4f5c"},{"location":"cs/software/sca/#_25","text":"\u6784\u4ef6\u5e93\u662f\u5bf9\u6784\u4ef6\u5b9e\u65bd\u5206\u7c7b\u548c\u7ba1\u7406\u7684\u673a\u6784\u3002","title":"\u6784\u4ef6\u7684\u7ba1\u7406\u4e0e\u7ef4\u62a4"},{"location":"cs/software/sca/#_26","text":"\u6784\u4ef6\u5e93\u7406\u8bba\u7814\u7a76\u7684\u91cd\u70b9\u662f\u6784\u4ef6\u5206\u7c7b\u4e0e\u68c0\u7d22\uff0c\u5373\u7814\u7a76\u6784\u4ef6\u5206\u7c7b\u7b56\u7565\u3001\u7ec4\u7ec7\u6a21\u5f0f\u3001\u68c0\u7d22\u624b\u6bb5\u548c\u6784\u4ef6\u76f8\u4f3c\u6027\u5206\u6790\u7b49\u3002 \u9886\u57df\u4e0a\u6784\u4ef6\u5e93\u6ee1\u8db3\u7684\u6761\u4ef6\uff1a \u9886\u57df\u5b8c\u6574\u6027 \u9886\u57df\u62bd\u8c61\u6027 \u9886\u57df\u6807\u51c6\u5316","title":"\u6784\u4ef6\u5e93\u7684\u7ec4\u7ec7"},{"location":"cs/software/sca/#_27","text":"\u5173\u952e\u5b57\u5206\u7c7b\u6cd5 \u8d85\u6587\u672c\u7ec4\u7ec7\u6cd5 \u523b\u9762\u5206\u7c7b\u6cd5 \u7531\u4e00\u7ec4\u63cf\u8ff0\u6784\u4ef6\u672c\u8d28\u7279\u5f81\u7684\u523b\u9762\u7ec4\u6210\uff0c\u6bcf\u4e2a\u523b\u9762\u4ece\u4e0d\u540c\u7684\u89d2\u5ea6\u5bf9\u6784\u4ef6\u8fdb\u884c\u5206\u7c7b\u3002 \u4ece\u8868\u793a\u7684\u89d2\u5ea6\u6765\u770b\uff0c\u523b\u9762\u662f\u4e00\u9897\u6709\u5411\u6811\uff0c\u6839\u8282\u70b9\u7684\u503c\u662f\u8be5\u523b\u9762\u7684\u540d\u79f0\uff0c\u6839\u8282\u70b9\u6240\u6709\u5b50\u6811\u6784\u6210\u7684\u68ee\u6797\u79f0\u4e3a\u672f\u8bed\u7a7a\u95f4 \u7279\u70b9\uff1a \u5bf9\u6784\u4ef6\u8fdb\u884c\u4e86\u591a\u89c6\u89d2\u4e0b\u7684\u5206\u7c7b\u63cf\u8ff0 \u6784\u4ef6\u5206\u7c7b\u63cf\u8ff0\u7684\u672f\u8bed\u7a7a\u95f4\u6613\u4e8e\u4fee\u6539\u548c\u7ef4\u62a4","title":"\u6784\u4ef6\u5e93\u7684\u5206\u7c7b\u6a21\u5f0f"},{"location":"cs/software/sca/#_28","text":"","title":"\u57fa\u4e8e\u6784\u4ef6"},{"location":"cs/software/sca/#_29","text":"\u6784\u4ef6\u7ec4\u88c5\u5c31\u662f\u786e\u5b9a\u6784\u4ef6\u6240\u63d0\u4f9b\u7684\u670d\u52a1\u4e0e\u63a5\u53e3\u4e4b\u95f4\u7684\u5339\u914d\u548c\u6620\u5c04\uff0c\u5e76\u63d0\u4f9b\u6ee1\u8db3\u5373\u5c06\u6216\u5c06\u6765\u90e8\u7f72\u7684\u7ea6\u675f\u6761\u4ef6\u3002","title":"\u6784\u4ef6\u7ec4\u88c5"},{"location":"cs/software/sca/#_30","text":"\u4efb\u4f55\u57fa\u4e8e\u6784\u4ef6\u7684\u5f00\u53d1\u5e94\u7b26\u5408\u4ee5\u4e0b\u6784\u4ef6\uff1a \u8981\u6e05\u6670\u5730\u5206\u79bb\u6784\u4ef6\u7684\u89c4\u683c\u8bf4\u660e\u548c\u8bbe\u8ba1\u5b9e\u73b0 \u91cd\u70b9\u5173\u6ce8\u4e8e\u63a5\u53e3\u7684\u5b9e\u73b0\u65b9\u6cd5 \u5f62\u5f0f\u5730\u63cf\u8ff0\u6784\u4ef6\u7684\u8bed\u4e49\uff0c\u4e3b\u8981\u662f\u5bf9\u6784\u4ef6\u884c\u4e3a\u7684\u63cf\u8ff0\uff0c\u5176\u6838\u5fc3\u662f\u64cd\u4f5c\u7279\u5f81\u7684\u8bed\u4e49\u7ec6\u8282 \u4e25\u683c\u5730\u8bb0\u5f55\u7ec6\u5316\u8fc7\u7a0b\uff0c\u5e76\u4e14\u52a0\u4ee5\u9a8c\u8bc1 \u4ece\u6280\u672f\u89d2\u5ea6\u770b\uff0c\u6784\u4ef6\u7ec4\u88c5\u8fc7\u7a0b\u4e2d\u9700\u8003\u8651\u7684\u95ee\u9898\uff1a \u6bcf\u4e2a\u6784\u4ef6\u6ee1\u8db3\u5176\u4ed6\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6\u95ee\u9898 \u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u63a5\u53e3\u5339\u914d\u548c\u6620\u5c04\u95ee\u9898 \u6784\u4ef6\u7684\u5305\u88c5\u95ee\u9898","title":"\u6784\u4ef6\u7ec4\u88c5\u4e2d\u7684\u95ee\u9898"},{"location":"cs/software/sca/#_31","text":"\u5b9a\u5236 \u8bbe\u7f6e\u53c2\u6570\u503c \u5b8c\u6210\u9700\u8981\u7528\u6237\u5b9a\u5236\u7684\u4ee3\u7801 \u6709\u65f6\u5019\u9700\u8981\u91cd\u65b0\u7f16\u8bd1\u6784\u4ef6 \u5305\u88c5 \u9002\u914d \u9002\u914d\u5668 \u9002\u914d\u5668\u4f4d\u4e8e\u4e24\u4e2a\u6784\u4ef6\u4e4b\u95f4\uff0c\u7528\u4ee5\u8f6c\u6362\u4e24\u4e2a\u6784\u4ef6\u5bf9\u63a5\u53e3\u7684\u4e0d\u540c\u7406\u89e3\uff0c\u662f\u8bf7\u6c42\u8005\u548c\u88ab\u8bf7\u6c42\u8005\u4e4b\u95f4\u7684\u6620\u5c04 \u9002\u914d\u5668\u672c\u8eab\u4e0d\u5305\u542b\u8868\u793a\u5c42\u3001\u4e1a\u52a1\u5c42\u548c\u6570\u636e\u8bbf\u95ee\u5c42\u7684\u903b\u8f91\uff0c\u4e5f\u4e0d\u80fd\u6269\u5c55\u6784\u4ef6\u7684\u529f\u80fd\uff08\u4e0e\u5305\u88c5\u4e0d\u540c\uff09 \u9002\u914d\u5668\u4e0d\u662f\u6784\u4ef6\uff0c\u4e0d\u5c5e\u4e8e\u88ab\u9002\u914d\u7684\u4e24\u4e2a\u6784\u4ef6\u7684\u4efb\u4f55\u4e00\u4e2a\uff0c\u4efb\u4f55\u4e00\u4e2a\u6784\u4ef6\u7684\u4e0d\u5b58\u5728\u5c06\u5bfc\u81f4\u9002\u914d\u5668\u7684\u6d88\u5931 \u9a8c\u8bc1\u548c\u9519\u8bef\u5904\u7406\u529f\u80fd \u5b89\u5168\u6027","title":"\u6784\u4ef6\u7ec4\u88c5\u7684\u65b9\u6cd5\u4e0e\u6280\u672f"},{"location":"cs/software/sca/#_32","text":"\u6784\u4ef6\u7ec4\u88c5\u7684\u5b9e\u65bd\u5185\u5bb9\uff1a \u5f3a\u5236\u5b9e\u73b0\u6784\u4ef6\u7684\u9650\u5236\u6761\u4ef6 \u5904\u7406\u529f\u80fd\u548c\u6570\u636e\u7684\u4e0d\u5339\u914d \u7ba1\u7406\u6784\u4ef6\u95f4\u7684\u5173\u7cfb \u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u7c7b\u578b\u5305\u62ec\u62e5\u6709\u5173\u7cfb\u548c\u5916\u90e8\u5173\u7cfb\u3002\u4f46\u4ece\u5173\u7cfb\u7684\u8868\u793a\u89d2\u5ea6\u6765\u770b\uff0c\u53ef\u5206\u4e3a\u76f4\u63a5\u94fe\u63a5\u548c\u95f4\u63a5\u94fe\u63a5\u3002","title":"\u6784\u4ef6\u7ec4\u88c5\u7684\u5185\u5bb9"},{"location":"cs/software/sca/#_33","text":"\u63d0\u4f9b\u6784\u4ef6\u8fd0\u884c\u65f6\u7684\u914d\u7f6e\u6570\u636e \u63d0\u4f9b\u90e8\u7f72\u65f6\u7528\u5230\u7684\u6784\u4ef6\u5185\u5efa\u914d\u7f6e\u6216\u5b9a\u5236\u670d\u52a1 \u63d0\u4f9b\u6784\u4ef6\u7ec4\u88c5\u7684\u8f85\u52a9\u73af\u5883","title":"\u6784\u4ef6\u90e8\u7f72"},{"location":"cs/software/sca/#_34","text":"\u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406 SCM \u662f\u6307\u4e00\u5957\u6309\u89c4\u5219\u7ba1\u7406\u8f6f\u4ef6\u5f00\u53d1\u3001\u7ef4\u62a4\uff0c\u4ee5\u53ca\u5176\u4e2d\u5404\u79cd\u4e2d\u95f4\u8f6f\u4ef6\u4ea7\u54c1\u7684\u65b9\u6cd5\u3002 \u914d\u7f6e\u8bc6\u522b \u53d8\u5316\u63a7\u5236 \u72b6\u6001\u8bb0\u5f55\u62a5\u544a \u5ba1\u8ba1","title":"\u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u914d\u7f6e\u7ba1\u7406"},{"location":"cs/software/sca/#_35","text":"","title":"\u9886\u57df\u5de5\u7a0b"},{"location":"cs/software/sca/#_36","text":"\u5e94\u7528\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u7ec4\u7279\u6709\u7684\u9700\u6c42\uff0c\u4ea7\u751f\u4e00\u4e2a\u7279\u5b9a\u7684\u89e3\u51b3\u65b9\u6848 \u9886\u57df\u5de5\u7a0b \uff1a\u9488\u5bf9\u4e00\u4e2a\u9886\u57df\u4e2d\u7684\u6240\u6709\u7cfb\u7edf\uff0c\u800c\u4e0d\u5c40\u9650\u4e8e\u67d0\u4e2a\u7279\u5b9a\u7684\u7cfb\u7edf \u4e0e\u5e94\u7528\u5de5\u7a0b\u76f8\u6bd4 \uff1a\u9886\u57df\u5de5\u7a0b\u5904\u4e8e\u4e00\u4e2a\u8f83\u9ad8\u7684\u62bd\u8c61\u7ea7\u522b\u4e0a","title":"\u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b"},{"location":"cs/software/sca/#_37","text":"\u7ec4\u6210\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u9886\u57df\u5b9e\u73b0 \u53ef\u590d\u7528\u8d44\u4ea7\uff1a\u9886\u57df\u5206\u6790\u3001\u9886\u57df\u8bbe\u8ba1\u3001\u8d44\u4ea7\u83b7\u53d6\u3001\u8d44\u4ea7\u5206\u7c7b\u3001\u8d44\u4ea7\u7ef4\u62a4","title":"\u9886\u57df\u5de5\u7a0b\u7684\u6784\u6210"},{"location":"cs/software/sca/#_38","text":"\u7ec4\u6210\uff1a\u4ea7\u54c1\u7a7a\u95f4\u3001\u6784\u4ef6\u4e0e\u4f53\u7cfb\u7ed3\u6784\u3001\u751f\u4ea7\u8ba1\u5212\u3001\u9700\u6c42\u3001\u4ea7\u54c1\u3001\u7ba1\u7406","title":"\u5e94\u7528\u5de5\u7a0b\u7684\u6784\u6210"},{"location":"cs/software/sca/#_39","text":"","title":"\u9886\u57df\u5de5\u7a0b\u4e0e\u5e94\u7528\u5de5\u7a0b\u7684\u5173\u7cfb"},{"location":"cs/software/sca/#_40","text":"\u53d8\u5316\u6027\u7684\u5206\u7c7b \u53d8\u5316\u6027\u7ed1\u5b9a \u53d8\u5316\u6027\u63a7\u5236 \u53d8\u5316\u6027\u5904\u7406\u6280\u672f","title":"\u9886\u57df\u5171\u6027\u4e0e\u53d8\u5316\u6027"},{"location":"cs/software/sca/#_41","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u57fa\u672c\u5185\u5bb9"},{"location":"cs/software/sca/#_42","text":"\u51af \u00b7 \u8bfa\u4f9d\u66fc\u7ed3\u6784 \u57fa\u4e8e\u529f\u80fd\u6a21\u5757\u7684\u8f6f\u4ef6\u7ed3\u6784 \u57fa\u4e8e\u6784\u4ef6\u7684\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6982\u5ff5"},{"location":"cs/software/sca/#_43","text":"Garlan & Shaw \u6a21\u578b\uff1a SA = {Components, Connectors, Constrains} Perry & Wolf \u6a21\u578b\uff1a SA = {Elements, Form, Rational} CFRP \u6a21\u578b\uff1aSA = {Elements, Interfaces, COnnections, Connection Semantics} Vestal \u6a21\u578b\uff1a SA = {Component, Idioms/Styles, Common Patterns of Interaction} IEEE 510\uff1aArchitecture = {Component, Connector, Environment, Principle} Boehm \u6a21\u578b\uff1aSA = {Components, COnnections, Constrains, Stakeholders'needs, Rationals}","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5b9a\u4e49"},{"location":"cs/software/sca/#_44","text":"\u6784\u4ef6 \u8fde\u63a5\u4ef6 \u4f53\u7cfb\u7ed3\u6784\u914d\u7f6e","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6784\u6210\u8981\u7d20"},{"location":"cs/software/sca/#_45","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u7814\u7a76\u5185\u5bb9"},{"location":"cs/software/sca/#adl","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u63cf\u8ff0\u8bed\u8a00 ADL"},{"location":"cs/software/sca/#_46","text":"","title":"\u4f53\u7cfb\u7ed3\u6784\u6784\u9020"},{"location":"cs/software/sca/#_47","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790\u3001\u8bbe\u8ba1\u548c\u9a8c\u8bc1"},{"location":"cs/software/sca/#_48","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53d1\u73b0\u3001\u6f14\u5316\u548c\u590d\u7528"},{"location":"cs/software/sca/#_49","text":"","title":"\u57fa\u4e8e\u4f53\u7cfb\u7ed3\u6784\u7684\u8f6f\u4ef6\u5f00\u53d1\u8fc7\u7a0b"},{"location":"cs/software/sca/#dssa","text":"","title":"\u7279\u5b9a\u9886\u57df\u7684\u4f53\u7cfb\u7ed3\u6784 DSSA"},{"location":"cs/software/sca/#_50","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u652f\u6301\u5de5\u5177"},{"location":"cs/software/sca/#_51","text":"","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u6a21\u5f0f\u7cfb\u7edf"},{"location":"cs/software/sca/#_52","text":"","title":"\u6a21\u5f0f\u7684\u6982\u5ff5\u4e0e\u5206\u7c7b"},{"location":"cs/software/sca/#_53","text":"\u6bcf\u4e2a\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u5728\u6211\u4eec\u5468\u56f4\u4e0d\u65ad\u91cd\u590d\u53d1\u751f\u7684\u95ee\u9898\uff0c\u4ee5\u53ca\u8be5\u95ee\u9898\u89e3\u51b3\u65b9\u6848\u7684\u6838\u5fc3\u5185\u5bb9\u3002\u8fd9\u6837\uff0c\u4f60\u53ef\u4ee5\u4e00\u6b21\u53c8\u4e00\u6b21\u5730\u4f7f\u7528\u8be5\u65b9\u6848\u800c\u4e0d\u5fc5\u505a\u91cd\u590d\u52b3\u52a8\u3002 \u89e3\u51b3\u7b56\u7565\uff1a\u5c06\u6a21\u578b\u3001\u89c6\u56fe\u3001\u63a7\u5236\u5668\u5212\u5206\u5f00\u3002\u5c31\u662f\u4e00\u4e2a\u5178\u578b\u7684\u6a21\u578b \u6a21\u578b-\u89c6\u56fe-\u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09","title":"\u6a21\u5f0f\u7684\u5b9a\u4e49"},{"location":"cs/software/sca/#_54","text":"\u8bed\u5883\uff1a\u95ee\u9898\u51fa\u73b0\u7684\u80cc\u666f \u95ee\u9898\uff1a\u5728\u8bed\u5883\u4e2d\u91cd\u590d\u51fa\u73b0\u7684\u95ee\u9898 \u89e3\u51b3\u65b9\u6848\uff1a\u7ed9\u51fa\u5982\u4f55\u89e3\u51b3\u518d\u73b0\u7684\u95ee\u9898\uff0c\u6216\u8005\u8bf4\u5982\u4f55\u5e73\u8861\u4e0e\u4e4b\u76f8\u5173\u7684\u5f3a\u5236\u6761\u4ef6 \u5b9e\u73b0\uff1a\u5c31\u662f\u5c06\u4ee5\u4e0a\u7684\u89e3\u51b3\u65b9\u6848\u4ed8\u8bf8\u5b9e\u8df5","title":"\u6a21\u5f0f\u7684\u6784\u6210\u8981\u7d20"},{"location":"cs/software/sca/#_55","text":"\u8bbe\u8ba1\u590d\u7528 \u4ee3\u7801\u590d\u7528 \u7cfb\u7edf\u7ec4\u6210\u66f4\u6613\u4e8e\u88ab\u4ed6\u4eba\u7406\u89e3 \u6709\u5229\u4e8e\u7cfb\u7edf\u7684\u4e92\u64cd\u4f5c\u6027 \u6709\u5229\u4e8e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u5206\u6790 \u6709\u5229\u4e8e\u7279\u5b9a\u6a21\u5f0f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u53ef\u89c6\u5316","title":"\u6a21\u5f0f\u7684\u4f18\u52bf"},{"location":"cs/software/sca/#_56","text":"\u5e95\u5c42\u6a21\u5f0f\uff1a\u60ef\u7528\u6cd5 \u4e2d\u5c42\u6a21\u5f0f\uff1a\u8bbe\u8ba1\u6a21\u5f0f \u9ad8\u5c42\u6a21\u5f0f\uff1a\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f","title":"\u6a21\u5f0f\u5206\u7c7b"},{"location":"cs/software/sca/#_57","text":"\u60ef\u7528\u6cd5\u9488\u5bf9\u8bbe\u8ba1\u548c\u5b9e\u73b0\u65b9\u9762\uff0c\u662f\u9488\u5bf9\u5177\u4f53\u7279\u5b9a\u7a0b\u5e8f\u8bbe\u8ba1\u8bed\u8a00\u7684\u4f4e\u5c42\u6a21\u5f0f\uff0c\u5b83\u63cf\u8ff0\u5982\u4f55\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u6216\u6784\u4ef6\u4e4b\u95f4\u7684\u5173\u7cfb\u3002 \u7279\u70b9 \u60ef\u7528\u6cd5\u662f\u4e0e\u5177\u4f53\u8bed\u8a00\u5bc6\u5207\u76f8\u5173\u7684\u7f16\u7a0b\u7ecf\u9a8c\u7684,\u603b\u7ed3\u3002 \u60ef\u7528\u6cd5\u63cf\u8ff0\u5982\u4f55\u4f7f\u7528\u7ed9\u5b9a\u7684\u8bed\u8a00\u7279\u5f81\u6765\u5b9e\u73b0\u6784\u4ef6\u7684\u7279\u5b9a\u65b9\u9762\u53ca\u5176\u5173\u7cfb\u3002 \u60ef\u7528\u6cd5\u4ee3\u8868\u6700\u5e95\u5c42\u7684\u6a21\u5f0f\u3002 \u60ef\u7528\u6cd5\u66f4\u5173\u6ce8\u8bbe\u8ba1\u7684\u5b9e\u73b0\u3002 \u60ef\u7528\u6cd5\u53ef\u80fd\u662f\u4e00\u79cd\u7279\u5b9a\u8bbe\u8ba1\u6a21\u5f0f\u7684\u5177\u4f53\u5b9e\u73b0\u3002 \u76ca\u5904 \u4e00\u7ec4\u76f8\u5173\u7684\u60ef\u7528\u6cd5\u4f1a\u4f7f\u7a0b\u5e8f\u5f62\u6210\u4e00\u81f4\u7684\u98ce\u683c\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u5c06\u52a0\u901f\u7a0b\u5e8f\u8bbe\u8ba1\u7684\u8fdb\u7a0b\u3002 \u4e00\u81f4\u7684\u7a0b\u5e8f\u8bbe\u8ba1\u98ce\u683c\u4f7f\u7a0b\u5e8f\u66f4\u5bb9\u6613\u7406\u89e3\uff0c\u6709\u5229\u4e8e\u7a0b\u5e8f\u7684\u5f00\u53d1\u548c\u7ef4\u62a4\u3002 \u00b7","title":"\u60ef\u7528\u6cd5"},{"location":"cs/software/sca/#_58","text":"\u4e2d\u7b49\u89c4\u6a21\u7684\u6a21\u5f0f\uff0c\u5728\u89c4\u6a21\u4e0a\u6bd4\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u8981\u5c0f\uff0c\u4f46\u5728\u7ea7\u522b\u4e0a\u6bd4\u7279\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u7684\u60ef\u7528\u6cd5\u8981\u9ad8","title":"\u8bbe\u8ba1\u6a21\u5f0f"},{"location":"cs/software/sca/#_59","text":"\u7ed3\u6784\u5316\u5206\u89e3\uff1a\u6700\u666e\u904d\u7684\u6a21\u5f0f\u662f\u6574\u4f53 - \u90e8\u5206\u6a21\u5f0f \u5de5\u4f5c\u7684\u7ec4\u7ec7\uff1a\u4e3b\u63a7 - \u4ece\u5c5e\u6a21\u5f0f \u8bbf\u95ee\u63a7\u5236\uff1a\u4ee3\u7406\u8bbe\u8ba1\u6a21\u5f0f\u3001\u5916\u89c2\u6a21\u5f0f\u548c\u8fed\u4ee3\u5668\u6a21\u5f0f \u7ba1\u7406\uff1a\u547d\u4ee4\u5904\u7406\u5668\u6a21\u5f0f\u3001\u89c6\u56fe\u5904\u7406\u7a0b\u5e8f\u6a21\u5f0f \u901a\u4fe1\uff1a\u8f6c\u53d1\u5668 - \u63a5\u6536\u5668\u6a21\u5f0f\u3001\u5ba2\u6237\u673a - \u5206\u914d\u5668 - \u670d\u52a1\u5668\u6a21\u5f0f\u3001\u51fa\u7248\u8005 - \u8ba2\u9605\u8005\u6a21\u5f0f","title":"\u8bbe\u8ba1\u6a21\u5f0f\u95ee\u9898\u7c7b\u522b"},{"location":"cs/software/sca/#_60","text":"","title":"\u8bbe\u8ba1\u6a21\u5f0f\u5206\u7c7b"},{"location":"cs/software/sca/#_61","text":"","title":"\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f"},{"location":"cs/software/sca/#_62","text":"\u4e00\u4e2a\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u7684\u6a21\u5f0f\u63cf\u8ff0\u4e86\u4e00\u4e2a\u7a0b\u5e8f\u5728\u7279\u5b9a\u8bbe\u8ba1\u8bed\u5883\u4e2d\u7684\u7279\u6b8a\u7684\u518d\u73b0\u8bbe\u8ba1\u95ee\u9898\uff0c\u5e76\u4e3a\u5b83\u7684\u89e3\u51b3\u65b9\u6848\u63d0\u4f9b\u4e86\u4e00\u4e2a\u7ecf\u8fc7\u5145\u5206\u9a8c\u8bc1\u7684\u901a\u7528\u56fe\u5f0f\u3002\u89e3\u51b3\u65b9\u6848\u56fe\u5f0f\u901a\u8fc7\u63cf\u8ff0\u5176\u7ec4\u6210\u6784\u4ef6\u3001\u5b83\u4eec\u7684\u8d23\u4efb\u548c\u76f8\u4e92\u5173\u7cfb\uff0c\u4ee5\u53ca\u5b83\u4eec\u7684\u534f\u4f5c\u65b9\u5f0f\u6765\u5177\u4f53\u6307\u5b9a\u3002 \u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u662f\u6a21\u5f0f\u7cfb\u7edf\u4e2d\u7684\u6700\u9ad8\u7b49\u7ea7\u6a21\u5f0f","title":"\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5b9a\u4e49"},{"location":"cs/software/sca/#_63","text":"\u4ece\u6df7\u6c8c\u5230\u7ed3\u6784 \u5206\u5c42\u6a21\u5f0f \u7ba1\u9053/\u8fc7\u6ee4\u5668\u6a21\u5f0f \u9ed1\u677f\u6a21\u5f0f \u5206\u5e03\u5f0f\u7cfb\u7edf \u4ee3\u7406\u6a21\u5f0f \u4ea4\u4e92\u5f0f\u7cfb\u7edf \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\u6a21\u5f0f\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\u6a21\u5f0f\uff08PAC\uff09 \u9002\u5e94\u6027\u6a21\u5f0f \u53cd\u5c04\u6a21\u5f0f \u5fae\u6838\u6a21\u5f0f","title":"\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u5206\u7c7b"},{"location":"cs/software/sca/#_64","text":"\u7ba1\u9053/\u8fc7\u6ee4\u5668 \u57fa\u4e8e\u4e8b\u4ef6\u7684\u9690\u5f0f\u8c03\u7528 \u5206\u5c42\u98ce\u683c \u6570\u636e\u62bd\u8c61\u548c\u9762\u5411\u5bf9\u8c61 \u4ed3\u5e93\u4e0e\u9ed1\u677f\u6a21\u5f0f \u89e3\u91ca\u5668 \u4ee3\u7406\u6a21\u5f0f \u5fae\u6838 \u5ba2\u6237/\u670d\u52a1\u5668 \u6b63\u4ea4\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784 C2 \u5f02\u6784\u7ed3\u6784 \u53cd\u5c04 \u6a21\u578b - \u89c6\u56fe - \u63a7\u5236\u5668\uff08MVC\uff09 \u8868\u793a - \u62bd\u8c61 - \u63a7\u5236\uff08PAC\uff09","title":"\u5e38\u7528\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f"},{"location":"cs/software/sca/#_65","text":"","title":"\u6a21\u5f0f\u7cfb\u7edf\u4e0e\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c"},{"location":"cs/software/sca/#_66","text":"\u6a21\u5f0f\u7cfb\u7edf \uff1a\u5c06\u4e00\u4e2a\u4e2a\u5355\u72ec\u7684\u6a21\u5f0f\u6346\u7ed1\u5728\u4e00\u8d77\uff0c\u63cf\u8ff0\u4e86\u6a21\u5f0f\u4e4b\u95f4\u7684\u5173\u7cfb\u3001\u6a21\u5f0f\u7684\u5b9e\u73b0\uff0c\u4ee5\u53ca\u6a21\u5f0f\u600e\u6837\u76f8\u4e92\u8054\u7cfb\u76f8\u4e92\u8865\u5145\u6765\u6709\u6548\u652f\u6301\u8f6f\u4ef6\u5f00\u53d1\u7684\u3002 \u6a21\u5f0f\u8bed\u8a00 \uff1a\u7531\u7ed3\u6784\u548c\u89c4\u5219\u6784\u6210\u3002\u7ed3\u6784\u63cf\u8ff0\u4e86\u6a21\u5f0f\u662f\u66f4\u5c0f\u6a21\u5f0f\u7684\u6a21\u5f0f;\u89c4\u5219\u63cf\u8ff0\u4e86\u521b\u5efa\u6a21\u5f0f\u7684\u65b9\u5f0f\u548c\u4e0e\u5176\u4ed6\u6a21\u5f0f\u7684\u6392\u5217\u65b9\u5f0f\u3002 SA \u6a21\u5f0f\u7cfb\u7edf \uff1a\u662f\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u7684\u6c47\u96c6\uff0c\u5305\u62ec\u6a21\u5f0f\u5728\u8f6f\u4ef6\u5f00\u53d1\u4e2d\u7684\u5b9e\u73b0\u3001\u7ec4\u5408\u548c\u4f7f\u7528\u6307\u5357\u3002 \u6a21\u5f0f\u7cfb\u7edf\u7684\u6f14\u5316 \uff1a\u5305\u62ec\u6a21\u5f0f\u63cf\u8ff0\u7684\u6f14\u5316\u3001\u6a21\u5f0f\u7684\u91c7\u6398\u3001\u65b0\u6a21\u5f0f\u7684\u96c6\u6210\u548c\u5220\u9664\u8fc7\u65f6\u7684\u6a21\u5f0f\u7b49\u3002","title":"\u82e5\u5e72\u5b9a\u4e49"},{"location":"cs/software/sca/#_67","text":"\u5305\u542b\u8db3\u591f\u591a\u7684\u57fa\u672c\u6a21\u5f0f \u6240\u6709\u7684\u6a21\u5f0f\u5e94\u8be5\u6709\u7edf\u4e00\u7684\u63cf\u8ff0\u5f62\u5f0f \u5177\u6709\u5bf9\u6a21\u5f0f\u5982\u4f55\u7ec4\u7ec7\u7684\u6a21\u5f0f \u652f\u6301\u8f6f\u4ef6\u6784\u9020\u7684\u65b9\u6cd5 \u652f\u6301\u6a21\u5f0f\u7cfb\u7edf\u7684\u81ea\u6211\u70df\u82b1","title":"\u6a21\u5f0f\u7cfb\u7edf\u5bf9\u8f6f\u4ef6\u5f00\u53d1\u7684\u652f\u6301\u6761\u4ef6"},{"location":"cs/software/sca/#_68","text":"","title":"\u6a21\u5f0f\u7cfb\u7edf\u7684\u5168\u5c40\u5206\u7c7b\u89c6\u56fe"},{"location":"cs/software/sca/#_69","text":"\u6307\u5b9a\u548c\u7cbe\u786e\u5730\u63cf\u8ff0\u95ee\u9898 \u9488\u5bf9\u95ee\u9898\u7684\u89c4\u6a21\uff0c\u9009\u62e9\u201c\u6a21\u5f0f\u7c7b\u522b\u201d\uff08\u4e0d\u662f\u6309\u95ee\u9898\u7c7b\u522b\u9009\u53d6\uff09 \u5bf9\u95ee\u9898\u8fdb\u884c\u5206\u7c7b\uff0c\u521d\u6b65\u9009\u53d6\u89e3\u51b3\u95ee\u9898\u7684\u6a21\u5f0f\u548c\u53ef\u9009\u6a21\u5f0f \u5bf9\u95ee\u9898\u7684\u5206\u7c7b\u548c\u76f8\u5e94\u7684\u89e3\u51b3\u6a21\u5f0f\u8fdb\u884c\u6bd4\u8f83\uff08\u4f18\u7f3a\u70b9\uff09 \u8fdb\u4e00\u6b65\u9009\u53d6\u66f4\u5408\u9002\u7684\u89e3\u51b3\u65b9\u6848\u7684\u53d8\u4f53 \u5982\u679c\u53d1\u73b0\u95ee\u9898\u96be\u4ee5\u89e3\u51b3\uff0c\u5219\u91cd\u65b0\u8fdb\u884c\u95ee\u9898\u5206\u7c7b\uff0c\u8f6c\u81f3 3","title":"\u9762\u5411\u95ee\u9898\u7684\u6a21\u5f0f\u9009\u62e9\u6b65\u9aa4"},{"location":"cs/software/sca/#_70","text":"\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4e3b\u8981\u63cf\u8ff0\u5e94\u7528\u7cfb\u7edf\u7684,\u603b\u4f53\u7ed3\u6784\u6846\u67b6\u3002\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u53ef\u5b58\u5728\u4e8e\u5404\u79cd\u5e94\u7528\u7cfb\u7edf\u89c4\u6a21\u548c\u62bd\u8c61\u5c42\u6b21\u4e0a\uff0c\u4ece\u5b9a\u4e49\u5e94\u7528\u7cfb\u7edf\u7684\u603b\u4f53\u7ed3\u6784\u5230\u63cf\u8ff0\u600e\u6837\u7528\u7ed9\u5b9a\u7684\u7f16\u7a0b\u8bed\u8a00\u5b9e\u73b0\u7279\u5b9a\u95ee\u9898\u7684\u60ef\u7528\u6cd5\u6a21\u5f0f\u3002 \u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u76f8\u5bf9\u72ec\u7acb\u3002\u5404\u5e94\u7528\u7cfb\u7edf\u91c7\u7528\u4e0d\u540c\u7684\u98ce\u683c\u540e\uff0c\u4e0e\u7531\u5176\u4ed6\u98ce\u683c\u6784\u6210\u7684\u7cfb\u7edf\u8054\u7cfb\u8f83\u5c11\u3002\u800c\u6a21\u5f0f\u5f80\u5f80\u4f9d\u8d56\u4e8e\u5b83\u6240\u5305\u542b\u7684\u8f83\u5c0f\u7684\u6a21\u5f0f\u6216\u8005\u4e0e\u5b83\u76f8\u4e92\u4f5c\u7528\u7684\u6a21\u5f0f\u3002 \u6a21\u5f0f\u6bd4\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u66f4\u52a0\u9762\u5411\u95ee\u9898\u3002\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u4fa7\u91cd\u4e8e\u4ece\u5e94\u7528\u7cfb\u7edf\u4e2d\u62bd\u53d6\u51fa\u5b83\u4eec\u7684\u603b\u4f53\u7ec4\u7ec7\u7ed3\u6784\uff0c\u800c\u8f83\u5c11\u4ece\u5b9e\u9645\u8bbe\u8ba1\u73af\u5883\u6c34\u8003\u611f\u8bbe\u8ba1\u7684\u6280\u672f\u3002\u800c\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u901a\u5e38\u7531\u95ee\u9898\u51fa\u73b0\u7684\u8bed\u5883\u3001\u89e3\u51b3\u65b9\u6848\u548c\u9002\u7528\u573a\u666f\u7ec4\u6210\u3002","title":"\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u6a21\u5f0f\u4e0e\u8f6f\u4ef6\u4f53\u7cfb\u7ed3\u6784\u98ce\u683c\u7684\u6bd4\u8f83"},{"location":"cv/","text":"\u8ba1\u7b97\u673a\u89c6\u89c9 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u8ba1\u7b97\u673a\u89c6\u89c9\uff08SLAM\u3001SfM\u3001\u63ba\u70b9\u673a\u5668\u4eba\uff0c\u4f8b\u5982 ROS\uff09\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5927\u591a\u90fd\u662f\u81ea\u5b66\uff0c\u7406\u89e3 CV\uff08\u6570\u5b66\uff09 \u7684\u672c\u8d28\uff08\u96fe Table of Contents \u00b6 \u591a\u89c6\u56fe\u51e0\u4f55 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 2129 7 mins 1696560509 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2758 9 mins 1696560259 \u5355\u89c6\u56fe\u51e0\u4f55 3229 11 mins 1696489915 \u6444\u50cf\u673a\u6a21\u578b 3059 10 mins 1696486155 \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 1971 7 mins 1696486155 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 1575 5 mins 1696380447 2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 4643 15 mins 1696243054 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 6200 21 mins 1696243054 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 2835 9 mins 1695950449 \u4e09\u7ef4\u70b9\u4e91 \u70b9\u4e91\u914d\u51c6 4724 16 mins 1716986617 \u6570\u636e\u96c6\u76f8\u5173 Waymo 547 11 2 mins 1716990042 KITTI 711 41 3 mins 1716986617 TUM 1270 4 mins 1710922161 \u8bba\u6587\u76f8\u5173 3DGS \u7cfb\u5217 6459 172 24 mins 1728805876 NeRF \u7cfb\u5217 6810 125 23 mins 1727443194 Dynamic SLAM \u7cfb\u5217 7983 28 mins 1727251137 Others 3650 34 13 mins 1727251137 \u5de5\u5177\u76f8\u5173 COLMAP 479 67 2 mins 1727355695 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u8ba1\u7b97\u673a\u89c6\u89c9"},{"location":"cv/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u8ba1\u7b97\u673a\u89c6\u89c9\uff08SLAM\u3001SfM\u3001\u63ba\u70b9\u673a\u5668\u4eba\uff0c\u4f8b\u5982 ROS\uff09\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5927\u591a\u90fd\u662f\u81ea\u5b66\uff0c\u7406\u89e3 CV\uff08\u6570\u5b66\uff09 \u7684\u672c\u8d28\uff08\u96fe","title":"\u8ba1\u7b97\u673a\u89c6\u89c9"},{"location":"cv/#table-of-contents","text":"\u591a\u89c6\u56fe\u51e0\u4f55 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 2129 7 mins 1696560509 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 2758 9 mins 1696560259 \u5355\u89c6\u56fe\u51e0\u4f55 3229 11 mins 1696489915 \u6444\u50cf\u673a\u6a21\u578b 3059 10 mins 1696486155 \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P 1971 7 mins 1696486155 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 1575 5 mins 1696380447 2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 4643 15 mins 1696243054 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 6200 21 mins 1696243054 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 2835 9 mins 1695950449 \u4e09\u7ef4\u70b9\u4e91 \u70b9\u4e91\u914d\u51c6 4724 16 mins 1716986617 \u6570\u636e\u96c6\u76f8\u5173 Waymo 547 11 2 mins 1716990042 KITTI 711 41 3 mins 1716986617 TUM 1270 4 mins 1710922161 \u8bba\u6587\u76f8\u5173 3DGS \u7cfb\u5217 6459 172 24 mins 1728805876 NeRF \u7cfb\u5217 6810 125 23 mins 1727443194 Dynamic SLAM \u7cfb\u5217 7983 28 mins 1727251137 Others 3650 34 13 mins 1727251137 \u5de5\u5177\u76f8\u5173 COLMAP 479 67 2 mins 1727355695 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"cv/3d-visualization/","text":"\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316 \u00b6 \u7ea6 1116 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea\u5510\u6cfd\u5723\u300a\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316\u300b \u4e09\u7ef4\u7a7a\u95f4\u89c4\u5219\u6570\u636e\u573a\u7684\u76f4\u63a5\u4f53\u7ed8\u5236 \u00b6 \u4f53\u5143\uff08Voxel\uff09\uff1a\u6bcf\u4e2a\u7f51\u683c\u662f\u7ed3\u6784\u5316\u6570\u636e\u7684\u4e00\u4e2a\u5143\u7d20 \u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5\uff1a\u5c06\u79bb\u6563\u5206\u5e03\u7684\u4e09\u7ef4\u6570\u636e\u573a\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u89c4\u5219\u8f6c\u6362\u4e3a\u56fe\u5f62\u663e\u793a\u8bbe\u5907\u5e27\u7f13\u5b58\u4e2d\u7684\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7\uff0c\u5373\u751f\u6210\u6bcf\u4e2a\u50cf\u7d20\u70b9\u989c\u8272\u7684 R\u3001G\u3001B \u503c \u91cd\u91c7\u6837 \u00b6 \u4fe1\u53f7\uff1a\u8868\u793a\u4fe1\u606f\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u662f\u8fde\u7eed\u7684\uff0c\u4e5f\u53ef\u4ee5\u662f\u79bb\u6563\u7684\u3002\u4e09\u7ef4\u7269\u4f53\u5728\u89c2\u5bdf\u5e73\u9762\u4e0a\u7684\u6295\u5f71\u53ef\u4ee5\u770b\u4f5c\u662f\u4e8c\u7ef4\u8fde\u7eed\u4fe1\u53f7\uff0c\u5728\u56fe\u5f62\u7cfb\u7edf\u7684\u5e27\u7f13\u5b58\u4e2d\uff0c\u7531\u50cf\u7d20\u70b9\u7684\u6570\u503c\u7ec4\u6210\u7684\u77e9\u9635\u662f\u4e00\u4e2a\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7 \u91c7\u6837\uff1a\u4ece\u4e00\u4e2a\u8fde\u7eed\u4fe1\u53f7\u4e2d\u9009\u62e9\u6709\u9650\u4e2a\u6570\u503c\u7684\u8fc7\u7a0b \u91cd\u6784\uff1a\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u91cd\u65b0\u6784\u9020\u8be5\u539f\u59cb\u4fe1\u53f7\u7684\u8fc7\u7a0b \u5948\u9b41\u65af\u7279\u9891\u7387\uff1a\u4ece\u4e00\u4e2a\u4fe1\u53f7\u4e2d\u62bd\u53d6\u6837\u672c\u7684\u9891\u7387\u5927\u4e8e\u8be5\u4fe1\u53f7\u9891\u8c31\u4e2d\u6700\u9ad8\u9891\u7387\u7684\u4e24\u500d\u65f6\uff0c\u5c31\u53ef\u4ee5\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u6062\u590d\u51fa\u539f\u4fe1\u53f7\uff0c\u8fd9\u4e00\u91c7\u6837\u9891\u7387\u7684\u4e0b\u9650\u79f0\u4e3a\u5948\u9b41\u65af\u7279\u9891\u7387 \u91cd\u91c7\u6837\uff1a \u9009\u62e9\u9002\u5f53\u7684\u91cd\u6784\u6838\u51fd\u6570\uff0c\u5bf9\u79bb\u6563\u7684\u91c7\u6837\u4fe1\u53f7\u8fdb\u884c\u5377\u79ef\u8fd0\u7b97\uff0c\u91cd\u6784\u8fde\u7eed\u7684\u539f\u59cb\u4fe1\u53f7 \u91c7\u7528\u4f4e\u901a\u6ee4\u6ce2\u51fd\u6570\u53bb\u6389\u9ad8\u4e8e\u5948\u9b41\u65af\u7279\u9891\u7387\u6781\u9650\u7684\u9891\u7387\u6210\u5206 \u5bf9\u6ee4\u6ce2\u540e\u7684\u51fd\u6570\u91cd\u65b0\u91c7\u6837 \u5149\u5b66\u6a21\u578b \u00b6 \u5728\u91cd\u91c7\u6837\u7684\u57fa\u7840\u4e0a\uff0c\u8ba1\u7b97\u5168\u90e8\u91c7\u6837\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u4e5f\u5c31\u662f\u6bcf\u4e00\u4e2a\u50cf\u7d20\u7684\u5149\u5f3a\u5ea6\u503c I \u5149\u7ebf\u5438\u6536\u6a21\u578b \u5149\u7ebf\u53d1\u5c04\u6a21\u578b \u5149\u7ebf\u5438\u6536\u548c\u53d1\u6563\u6a21\u578b \u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u6280\u672f \u00b6 \u4e09\u7ef4\u6570\u636e\u573a\u7684\u5206\u7c7b\u95ee\u9898 \u9608\u503c\u6cd5 \u6982\u7387\u6cd5 \u6539\u8fdb\u540e\u7684\u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7269\u4f53\u7a7a\u95f4\u626b\u63cf\u7684\u4f53\u7ed8\u5236\u6280\u672f \u00b6 \u8db3\u8ff9\u8868\u6cd5\uff1a\u9010\u5c42\u3001\u9010\u884c\u3001\u9010\u4e2a\u5730\u8ba1\u7b97\u6bcf\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u5e76\u52a0\u4ee5\u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u7684\u56fe\u50cf \u57fa\u4e8e\u9519\u5207-\u53d8\u5f62\u6280\u672f\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7b97\u6cd5\u6d41\u7a0b \u5728\u9009\u5b9a\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7684\u4e3b\u8981\u89c2\u5bdf\u65b9\u5411\u540e\uff0c\u4f7f\u5750\u6807\u7cfb\u7684z\u8f74\u4e0e\u5176\u76f8\u91cd\u5408\u3002\u5c06\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7531\u7269\u4f53\u7a7a\u95f4\u53d8\u6362\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u3002\u5bf9\u5e73\u884c\u6295\u5f71\u800c\u8a00\uff0c\u9519\u5207\u53d8\u6362\u53ea\u5305\u542b\u6570\u636e\u5e73\u9762\u7684\u5e73\u79fb\u3002\u5bf9\u4e8e\u900f\u89c6\u6295\u5f71\uff0c\u5728\u5e73\u79fb\u540e\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u6bd4\u4f8b\u53d8\u6362\uff0c\u5728\u5e73\u79fb\u548c\u6bd4\u4f8b\u53d8\u6362\u65f6\uff0c\u5728\u4e8c\u7ef4\u6570\u636e\u5e73\u9762\u5185\uff0c\u9700\u4f5c\u91cd\u65b0\u91c7\u6837\u3002 \u5728\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u4e2d\uff0c\u5c06\u9519\u5207\u540e\u7684\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u4e2d\u5404\u91c7\u6837\u70b9\u7684\u989c\u8272\u503c\u6295\u5c04\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u7684\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u3002\u5f62\u6210\u4e2d\u95f4\u56fe\u50cf\u3002\u7531\u4e8e\u662f\u6b63\u6295\u5f71\uff0c\u5404\u91c7\u6837\u70b9\u91cd\u6784\u6838\u7684\u8db3\u8ff9\u51fd\u6570\u4e0e\u89c2\u5bdf\u65b9\u5411\u65e0\u5173\uff0c\u56e0\u800c\u65e0\u9700\u91cd\u65b0\u8ba1\u7b97\u3002 \u5c06\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u56fe\u50cf\u901a\u8fc7\u4e8c\u7ef4\u56fe\u50cf\u53d8\u5f62 \\(M_{warp}\\) \uff0c\u53d8\u6362\u5230\u56fe\u50cf\u7a7a\u95f4\uff0c\u5f97\u5230\u6700\u7ec8\u56fe\u50cf\u3002\u8fd9\u4e00\u6b65\u4e5f\u9700\u8981\u4f5c\u4e8c\u7ef4\u56fe\u50cf\u7684\u91cd\u65b0\u91c7\u6837\u3002 \u4f53\u5143\u6295\u5c04\u6cd5 \u5b50\u533a\u57df\u6295\u5c04\u6cd5 \u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f \u00b6 \u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f\u7684\u539f\u7406 \u5085\u7acb\u53f6\u6295\u5f71-\u622a\u9762\u5b9a\u7406 \u9891\u57df\u4f53\u7ed8\u5236\u57fa\u672c\u7b97\u6cd5 \u57fa\u4e8e\u7269\u8d28\u5206\u7c7b\u7684\u989c\u8272\u8d4b\u503c\u7684\u9891\u57df\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91cd\u6784\u6838\u9636\u6b21\u7684\u81ea\u9002\u5e94\u9009\u62e9 \u8fdb\u4e00\u6b65\u51cf\u5c11\u8ba1\u7b97\u91cf\u548c\u5b58\u50a8\u7a7a\u95f4 \u5bf9\u79f0\u91c7\u6837 \u54c8\u7279\u91cc\u53d8\u6362\u4ee3\u66ff\u5085\u7acb\u53f6\u53d8\u6362 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236 \u00b6 \u7eb9\u7406\u6620\u5c04\uff0c\u7eb9\u7406\u56fe\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u79f0\u4e3a\u7eb9\u7406\u5143\uff08texels\uff09 \u7eb9\u7406\u751f\u6210 \u7ed9\u51fa\u6620\u5c04\u5b9a\u4e49 \u7eb9\u7406\u7684\u91cd\u91c7\u6837 \u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u53ca\u5176\u786c\u4ef6\u5b9e\u73b0 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u7269\u4f53\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5c4f\u5e55\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u660e\u6697\u6548\u679c\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u8fb9\u754c\u9762\u7a81\u51fa\u6548\u679c\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91c7\u7528\u7a7a\u95f4\u8df3\u8dc3\u6280\u672f\u7684\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5","title":"\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316"},{"location":"cv/3d-visualization/#_1","text":"\u7ea6 1116 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea\u5510\u6cfd\u5723\u300a\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316\u300b","title":"\u4e09\u7ef4\u6570\u636e\u573a\u53ef\u89c6\u5316"},{"location":"cv/3d-visualization/#_2","text":"\u4f53\u5143\uff08Voxel\uff09\uff1a\u6bcf\u4e2a\u7f51\u683c\u662f\u7ed3\u6784\u5316\u6570\u636e\u7684\u4e00\u4e2a\u5143\u7d20 \u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5\uff1a\u5c06\u79bb\u6563\u5206\u5e03\u7684\u4e09\u7ef4\u6570\u636e\u573a\uff0c\u6309\u7167\u4e00\u5b9a\u7684\u89c4\u5219\u8f6c\u6362\u4e3a\u56fe\u5f62\u663e\u793a\u8bbe\u5907\u5e27\u7f13\u5b58\u4e2d\u7684\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7\uff0c\u5373\u751f\u6210\u6bcf\u4e2a\u50cf\u7d20\u70b9\u989c\u8272\u7684 R\u3001G\u3001B \u503c","title":"\u4e09\u7ef4\u7a7a\u95f4\u89c4\u5219\u6570\u636e\u573a\u7684\u76f4\u63a5\u4f53\u7ed8\u5236"},{"location":"cv/3d-visualization/#_3","text":"\u4fe1\u53f7\uff1a\u8868\u793a\u4fe1\u606f\u7684\u4e00\u4e2a\u51fd\u6570\uff0c\u53ef\u4ee5\u662f\u8fde\u7eed\u7684\uff0c\u4e5f\u53ef\u4ee5\u662f\u79bb\u6563\u7684\u3002\u4e09\u7ef4\u7269\u4f53\u5728\u89c2\u5bdf\u5e73\u9762\u4e0a\u7684\u6295\u5f71\u53ef\u4ee5\u770b\u4f5c\u662f\u4e8c\u7ef4\u8fde\u7eed\u4fe1\u53f7\uff0c\u5728\u56fe\u5f62\u7cfb\u7edf\u7684\u5e27\u7f13\u5b58\u4e2d\uff0c\u7531\u50cf\u7d20\u70b9\u7684\u6570\u503c\u7ec4\u6210\u7684\u77e9\u9635\u662f\u4e00\u4e2a\u4e8c\u7ef4\u79bb\u6563\u4fe1\u53f7 \u91c7\u6837\uff1a\u4ece\u4e00\u4e2a\u8fde\u7eed\u4fe1\u53f7\u4e2d\u9009\u62e9\u6709\u9650\u4e2a\u6570\u503c\u7684\u8fc7\u7a0b \u91cd\u6784\uff1a\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u91cd\u65b0\u6784\u9020\u8be5\u539f\u59cb\u4fe1\u53f7\u7684\u8fc7\u7a0b \u5948\u9b41\u65af\u7279\u9891\u7387\uff1a\u4ece\u4e00\u4e2a\u4fe1\u53f7\u4e2d\u62bd\u53d6\u6837\u672c\u7684\u9891\u7387\u5927\u4e8e\u8be5\u4fe1\u53f7\u9891\u8c31\u4e2d\u6700\u9ad8\u9891\u7387\u7684\u4e24\u500d\u65f6\uff0c\u5c31\u53ef\u4ee5\u4ece\u91c7\u6837\u4fe1\u53f7\u4e2d\u6062\u590d\u51fa\u539f\u4fe1\u53f7\uff0c\u8fd9\u4e00\u91c7\u6837\u9891\u7387\u7684\u4e0b\u9650\u79f0\u4e3a\u5948\u9b41\u65af\u7279\u9891\u7387 \u91cd\u91c7\u6837\uff1a \u9009\u62e9\u9002\u5f53\u7684\u91cd\u6784\u6838\u51fd\u6570\uff0c\u5bf9\u79bb\u6563\u7684\u91c7\u6837\u4fe1\u53f7\u8fdb\u884c\u5377\u79ef\u8fd0\u7b97\uff0c\u91cd\u6784\u8fde\u7eed\u7684\u539f\u59cb\u4fe1\u53f7 \u91c7\u7528\u4f4e\u901a\u6ee4\u6ce2\u51fd\u6570\u53bb\u6389\u9ad8\u4e8e\u5948\u9b41\u65af\u7279\u9891\u7387\u6781\u9650\u7684\u9891\u7387\u6210\u5206 \u5bf9\u6ee4\u6ce2\u540e\u7684\u51fd\u6570\u91cd\u65b0\u91c7\u6837","title":"\u91cd\u91c7\u6837"},{"location":"cv/3d-visualization/#_4","text":"\u5728\u91cd\u91c7\u6837\u7684\u57fa\u7840\u4e0a\uff0c\u8ba1\u7b97\u5168\u90e8\u91c7\u6837\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u4e5f\u5c31\u662f\u6bcf\u4e00\u4e2a\u50cf\u7d20\u7684\u5149\u5f3a\u5ea6\u503c I \u5149\u7ebf\u5438\u6536\u6a21\u578b \u5149\u7ebf\u53d1\u5c04\u6a21\u578b \u5149\u7ebf\u5438\u6536\u548c\u53d1\u6563\u6a21\u578b","title":"\u5149\u5b66\u6a21\u578b"},{"location":"cv/3d-visualization/#_5","text":"\u4e09\u7ef4\u6570\u636e\u573a\u7684\u5206\u7c7b\u95ee\u9898 \u9608\u503c\u6cd5 \u6982\u7387\u6cd5 \u6539\u8fdb\u540e\u7684\u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u7b97\u6cd5","title":"\u5149\u7ebf\u6295\u5c04\u4f53\u7ed8\u5236\u6280\u672f"},{"location":"cv/3d-visualization/#_6","text":"\u8db3\u8ff9\u8868\u6cd5\uff1a\u9010\u5c42\u3001\u9010\u884c\u3001\u9010\u4e2a\u5730\u8ba1\u7b97\u6bcf\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u5c4f\u5e55\u50cf\u7d20\u7684\u8d21\u732e\uff0c\u5e76\u52a0\u4ee5\u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u7684\u56fe\u50cf \u57fa\u4e8e\u9519\u5207-\u53d8\u5f62\u6280\u672f\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7b97\u6cd5\u6d41\u7a0b \u5728\u9009\u5b9a\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7684\u4e3b\u8981\u89c2\u5bdf\u65b9\u5411\u540e\uff0c\u4f7f\u5750\u6807\u7cfb\u7684z\u8f74\u4e0e\u5176\u76f8\u91cd\u5408\u3002\u5c06\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u7531\u7269\u4f53\u7a7a\u95f4\u53d8\u6362\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u3002\u5bf9\u5e73\u884c\u6295\u5f71\u800c\u8a00\uff0c\u9519\u5207\u53d8\u6362\u53ea\u5305\u542b\u6570\u636e\u5e73\u9762\u7684\u5e73\u79fb\u3002\u5bf9\u4e8e\u900f\u89c6\u6295\u5f71\uff0c\u5728\u5e73\u79fb\u540e\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u6bd4\u4f8b\u53d8\u6362\uff0c\u5728\u5e73\u79fb\u548c\u6bd4\u4f8b\u53d8\u6362\u65f6\uff0c\u5728\u4e8c\u7ef4\u6570\u636e\u5e73\u9762\u5185\uff0c\u9700\u4f5c\u91cd\u65b0\u91c7\u6837\u3002 \u5728\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u4e2d\uff0c\u5c06\u9519\u5207\u540e\u7684\u4e09\u7ef4\u79bb\u6563\u6570\u636e\u573a\u4e2d\u5404\u91c7\u6837\u70b9\u7684\u989c\u8272\u503c\u6295\u5c04\u5230\u9519\u5207\u7269\u4f53\u7a7a\u95f4\u7684\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u3002\u5f62\u6210\u4e2d\u95f4\u56fe\u50cf\u3002\u7531\u4e8e\u662f\u6b63\u6295\u5f71\uff0c\u5404\u91c7\u6837\u70b9\u91cd\u6784\u6838\u7684\u8db3\u8ff9\u51fd\u6570\u4e0e\u89c2\u5bdf\u65b9\u5411\u65e0\u5173\uff0c\u56e0\u800c\u65e0\u9700\u91cd\u65b0\u8ba1\u7b97\u3002 \u5c06\u4e2d\u95f4\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u56fe\u50cf\u901a\u8fc7\u4e8c\u7ef4\u56fe\u50cf\u53d8\u5f62 \\(M_{warp}\\) \uff0c\u53d8\u6362\u5230\u56fe\u50cf\u7a7a\u95f4\uff0c\u5f97\u5230\u6700\u7ec8\u56fe\u50cf\u3002\u8fd9\u4e00\u6b65\u4e5f\u9700\u8981\u4f5c\u4e8c\u7ef4\u56fe\u50cf\u7684\u91cd\u65b0\u91c7\u6837\u3002 \u4f53\u5143\u6295\u5c04\u6cd5 \u5b50\u533a\u57df\u6295\u5c04\u6cd5","title":"\u7269\u4f53\u7a7a\u95f4\u626b\u63cf\u7684\u4f53\u7ed8\u5236\u6280\u672f"},{"location":"cv/3d-visualization/#_7","text":"\u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f\u7684\u539f\u7406 \u5085\u7acb\u53f6\u6295\u5f71-\u622a\u9762\u5b9a\u7406 \u9891\u57df\u4f53\u7ed8\u5236\u57fa\u672c\u7b97\u6cd5 \u57fa\u4e8e\u7269\u8d28\u5206\u7c7b\u7684\u989c\u8272\u8d4b\u503c\u7684\u9891\u57df\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91cd\u6784\u6838\u9636\u6b21\u7684\u81ea\u9002\u5e94\u9009\u62e9 \u8fdb\u4e00\u6b65\u51cf\u5c11\u8ba1\u7b97\u91cf\u548c\u5b58\u50a8\u7a7a\u95f4 \u5bf9\u79f0\u91c7\u6837 \u54c8\u7279\u91cc\u53d8\u6362\u4ee3\u66ff\u5085\u7acb\u53f6\u53d8\u6362","title":"\u9891\u57df\u4f53\u7ed8\u5236\u6280\u672f"},{"location":"cv/3d-visualization/#_8","text":"\u7eb9\u7406\u6620\u5c04\uff0c\u7eb9\u7406\u56fe\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u79f0\u4e3a\u7eb9\u7406\u5143\uff08texels\uff09 \u7eb9\u7406\u751f\u6210 \u7ed9\u51fa\u6620\u5c04\u5b9a\u4e49 \u7eb9\u7406\u7684\u91cd\u91c7\u6837 \u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u53ca\u5176\u786c\u4ef6\u5b9e\u73b0 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u7269\u4f53\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5c4f\u5e55\u7a7a\u95f4\u91cd\u91c7\u6837\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u660e\u6697\u6548\u679c\u7684\u76f4\u63a5\u4f53\u7ed8\u5236\u7b97\u6cd5 \u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u5177\u6709\u8fb9\u754c\u9762\u7a81\u51fa\u6548\u679c\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5 \u91c7\u7528\u7a7a\u95f4\u8df3\u8dc3\u6280\u672f\u7684\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u4f53\u7ed8\u5236\u7b97\u6cd5","title":"\u7531\u4e09\u7ef4\u7eb9\u7406\u6620\u5c04\u786c\u4ef6\u652f\u6301\u7684\u76f4\u63a5\u4f53\u7ed8\u5236"},{"location":"cv/dataset/","text":"Dataset \u00b6 Abstract SLAM \u76f8\u5173\u6570\u636e\u96c6\u4ecb\u7ecd Table of Contents \u00b6 TUM KITTI Waymo","title":"Dataset"},{"location":"cv/dataset/#dataset","text":"Abstract SLAM \u76f8\u5173\u6570\u636e\u96c6\u4ecb\u7ecd","title":"Dataset"},{"location":"cv/dataset/#table-of-contents","text":"TUM KITTI Waymo","title":"Table of Contents"},{"location":"cv/dataset/kitti/","text":"KITTI \u6570\u636e\u96c6 \u00b6 \u7ea6 707 \u4e2a\u5b57 41 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u8be5\u6570\u636e\u96c6\u7528\u4e8e\u8bc4\u6d4b\u7acb\u4f53\u56fe\u50cf(stereo)\uff0c\u5149\u6d41(optical flow)\uff0c\u89c6\u89c9\u6d4b\u8ddd(visual odometry)\uff0c3D\u7269\u4f53\u68c0\u6d4b(object detection)\u548c3D\u8ddf\u8e2a(tracking)\u7b49\u8ba1\u7b97\u673a\u89c6\u89c9\u6280\u672f\u5728\u8f66\u8f7d\u73af\u5883\u4e0b\u7684\u6027\u80fd\u3002 KITTI\u5305\u542b\u5e02\u533a\u3001\u4e61\u6751\u548c\u9ad8\u901f\u516c\u8def\u7b49\u573a\u666f\u91c7\u96c6\u7684\u771f\u5b9e\u56fe\u50cf\u6570\u636e\uff0c\u6bcf\u5f20\u56fe\u50cf\u4e2d\u6700\u591a\u8fbe15\u8f86\u8f66\u548c30\u4e2a\u884c\u4eba\uff0c\u8fd8\u6709\u5404\u79cd\u7a0b\u5ea6\u7684\u906e\u6321\u4e0e\u622a\u65ad\u3002 \u6574\u4e2a\u6570\u636e\u96c6\u7531 389 \u5bf9\u7acb\u4f53\u56fe\u50cf\u548c\u5149\u6d41\u56fe\uff0c39.2 km\u89c6\u89c9\u6d4b\u8ddd\u5e8f\u5217\u4ee5\u53ca\u8d85\u8fc7 200k 3D \u6807\u6ce8\u7269\u4f53\u7684\u56fe\u50cf\u7ec4\u6210[1] \uff0c\u4ee5 10Hz \u7684\u9891\u7387\u91c7\u6837\u53ca\u540c\u6b65\u3002\u603b\u4f53\u4e0a\u770b\uff0c\u539f\u59cb\u6570\u636e\u96c6\u88ab\u5206\u7c7b\u4e3a Road , City , Residential , Campus \u548c Person \u3002\u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0clabel\u7ec6\u5206\u4e3a car, van, truck, pedestrian, pedestrian(sitting), cyclist, tram \u4ee5\u53camisc \u7ec4\u6210\u3002 \u4e3b\u9875\uff1a https://www.cvlibs.net/datasets/kitti/index.php \u53ef\u89c6\u5316\uff1a http://www.danielgm.net/cc/release/ \u6570\u636e\u96c6\u683c\u5f0f \u00b6 \u7ed3\u6784 \u00b6 data \u251c\u2500\u2500 kitti \u2502 \u251c\u2500\u2500 ImageSets \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 label_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u2502 \u251c\u2500\u2500 planes (optional) image_2 \u53732\u53f7\u5f69\u8272\u76f8\u673a\u6240\u62cd\u6444\u7684\u56fe\u7247\uff08.png\uff09\uff1b calib \u5bf9\u5e94\u6bcf\u4e00\u5e27\u7684\u5916\u53c2\uff08.txt\uff09\uff1b label_2 \u662f\u6bcf\u5e27\u7684\u6807\u6ce8\u4fe1\u606f\uff08.txt\uff09\uff1b velodyne \u662f Velodyne64 \u6240\u5f97\u7684\u70b9\u4e91\u6587\u4ef6\uff08.bin\uff09 \u6807\u5b9a\u6587\u4ef6 \u00b6 KITTI \u63d0\u4f9b\u4e86\u4e09\u79cd\u6807\u5b9a\u6587\u4ef6\uff0c\u4e0d\u9700\u4eba\u5de5\u8f6c\u6362\u3002 calib_cam_to_cam calib_imu_to_velo calib_velo_to_cam ImageSets \u00b6 train.txt\uff1a\u8bad\u7ec3\u96c6 \u5217\u8868\u4fe1\u606f test.txt\uff1a\u6d4b\u8bd5\u96c6 \u5217\u8868\u4fe1\u606f val.txt\uff1a\u9a8c\u8bc1\u96c6 \u5217\u8868\u4fe1\u606f image \u6587\u4ef6 \u00b6 image \u6587\u4ef6\u4ee5 8 \u4f4d PNG \u683c\u5f0f\u5b58\u50a8\uff0c\u5982\u4e0b\u6240\u793a\uff1a velodyne \u6587\u4ef6 \u00b6 velodyne \u6587\u4ef6\u662f\u6fc0\u5149\u96f7\u8fbe\u7684\u6d4b\u91cf\u6570\u636e\uff08\u7ed5\u5176\u5782\u76f4\u8f74\uff08\u9006\u65f6\u9488\uff09\u8fde\u7eed\u65cb\u8f6c\uff09\uff0c\u4ee5 \"000001.bin\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a 7b14 4642 1058 b541 9643 0340 0000 0000 46b6 4542 1283 b641 3333 0340 0000 0000 4e62 4042 9643 b541 b072 0040 cdcc 4c3d 8340 3f42 08ac b541 3bdf ff3f 0000 0000 e550 4042 022b b841 9cc4 0040 0000 0000 10d8 4042 022b ba41 4c37 0140 0000 0000 3fb5 3a42 14ae b541 5a64 fb3f 0000 0000 7dbf 3942 2731 b641 be9f fa3f 8fc2 f53d cd4c 3842 3f35 b641 4c37 f93f ec51 383e dbf9 3742 a69b b641 c3f5 f83f ec51 383e 2586 3742 9a99 b741 fed4 f83f 1f85 6b3e . . . \u70b9\u4e91\u6570\u636e\u4ee5\u6d6e\u70b9\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f\u5b58\u50a8\uff0c\u6bcf\u884c\u5305\u542b8\u4e2a\u6570\u636e\uff0c\u6bcf\u4e2a\u6570\u636e\u7531\u56db\u4f4d\u5341\u516d\u8fdb\u5236\u6570\u8868\u793a\uff08\u6d6e\u70b9\u6570\uff09\uff0c\u6bcf\u4e2a\u6570\u636e\u901a\u8fc7\u7a7a\u683c\u9694\u5f00\u3002\u4e00\u4e2a\u70b9\u4e91\u6570\u636e\u7531\u56db\u4e2a\u6d6e\u70b9\u6570\u6570\u636e\u6784\u6210\uff0c\u5206\u522b\u8868\u793a\u70b9\u4e91\u7684x\u3001y\u3001z\u3001r\uff08\u5f3a\u5ea6 or \u53cd\u5c04\u503c\uff09\uff0c\u70b9\u4e91\u7684\u5b58\u50a8\u65b9\u5f0f\u5982\u4e0b\u8868\u6240\u793a\uff1a calib \u6587\u4ef6 \u00b6 calib\u6587\u4ef6\u662f\u76f8\u673a\u3001\u96f7\u8fbe\u3001\u60ef\u5bfc\u7b49\u4f20\u611f\u5668\u7684\u77eb\u6b63\u6570\u636e\u3002\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a P0: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 0.000000000000e+00 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P1: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.875744000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P2: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 4.485728000000e+01 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.163791000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.745884000000e-03 P3: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.395242000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.199936000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.729905000000e-03 R0_rect: 9.999239000000e-01 9.837760000000e-03 -7.445048000000e-03 -9.869795000000e-03 9.999421000000e-01 -4.278459000000e-03 7.402527000000e-03 4.351614000000e-03 9.999631000000e-01 Tr_velo_to_cam: 7.533745000000e-03 -9.999714000000e-01 -6.166020000000e-04 -4.069766000000e-03 1.480249000000e-02 7.280733000000e-04 -9.998902000000e-01 -7.631618000000e-02 9.998621000000e-01 7.523790000000e-03 1.480755000000e-02 -2.717806000000e-01 Tr_imu_to_velo: 9.999976000000e-01 7.553071000000e-04 -2.035826000000e-03 -8.086759000000e-01 -7.854027000000e-04 9.998898000000e-01 -1.482298000000e-02 3.195559000000e-01 2.024406000000e-03 1.482454000000e-02 9.998881000000e-01 -7.997231000000e-01 label \u6587\u4ef6 \u00b6 label\u6587\u4ef6\u662f KITTI \u4e2d object \u7684\u6807\u7b7e\u548c\u8bc4\u4f30\u6570\u636e\uff0c\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5305\u542b\u6837\u5f0f\u5982\u4e0b\uff1a Truck 0.00 0 -1.57 599.41 156.40 629.75 189.25 2.85 2.63 12.34 0.47 1.49 69.44 -1.56 Car 0.00 0 1.85 387.63 181.54 423.81 203.12 1.67 1.87 3.69 -16.53 2.39 58.49 1.57 Cyclist 0.00 3 -1.65 676.60 163.95 688.98 193.93 1.86 0.60 2.02 4.59 1.32 45.84 -1.55 DontCare -1 -1 -10 503.89 169.71 590.61 190.13 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 511.35 174.96 527.81 187.45 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 532.37 176.35 542.68 185.27 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 559.62 175.83 575.40 183.15 -1 -1 -1 -1000 -1000 -1000 -10 \u7b2c1\u5217\uff08\u5b57\u7b26\u4e32\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u7c7b\u522b\uff08type\uff09 \u7b2c2\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u622a\u65ad\uff08truncated\uff09 \u7b2c3\u5217\uff08\u6574\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u906e\u6321\uff08occluded\uff09 \u7b2c4\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a\u7269\u4f53\u7684\u89c2\u5bdf\u89d2\u5ea6\uff08alpha\uff09 \u7b2c5~8\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u7269\u4f53\u76842D\u8fb9\u754c\u6846\u5927\u5c0f\uff08bbox\uff09 \u7b2c9~11\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u5c3a\u5bf8\uff08dimensions\uff09 \u7b2c12-14\u5217\uff08\u6574\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u4f4d\u7f6e\uff08location\uff09 \u7b2c15\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u7a7a\u95f4\u65b9\u5411\uff08rotation_y\uff09 \u7b2c16\u5217\uff08\u6574\u6570\uff09\uff1a\u68c0\u6d4b\u7684\u7f6e\u4fe1\u5ea6\uff08score\uff09\uff08 \u53ea\u6709\u6d4b\u8bd5\u96c6\u4e2d\u6709 \uff09 Reference \u00b6 KITTI\u6570\u636e\u96c6\u7b80\u4ecb\u4e0e\u4f7f\u7528 KITTI\u6570\u636e\u96c6\u89e3\u6790\u548c\u53ef\u89c6\u5316 \u4e00\u6587\u591a\u56fe\u641e\u61c2KITTI\u6570\u636e\u96c6\u4e0b\u8f7d\u53ca\u89e3\u6790 KITTI \u6570\u636e\u96c6","title":"KITTI"},{"location":"cv/dataset/kitti/#kitti","text":"\u7ea6 707 \u4e2a\u5b57 41 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract \u8be5\u6570\u636e\u96c6\u7528\u4e8e\u8bc4\u6d4b\u7acb\u4f53\u56fe\u50cf(stereo)\uff0c\u5149\u6d41(optical flow)\uff0c\u89c6\u89c9\u6d4b\u8ddd(visual odometry)\uff0c3D\u7269\u4f53\u68c0\u6d4b(object detection)\u548c3D\u8ddf\u8e2a(tracking)\u7b49\u8ba1\u7b97\u673a\u89c6\u89c9\u6280\u672f\u5728\u8f66\u8f7d\u73af\u5883\u4e0b\u7684\u6027\u80fd\u3002 KITTI\u5305\u542b\u5e02\u533a\u3001\u4e61\u6751\u548c\u9ad8\u901f\u516c\u8def\u7b49\u573a\u666f\u91c7\u96c6\u7684\u771f\u5b9e\u56fe\u50cf\u6570\u636e\uff0c\u6bcf\u5f20\u56fe\u50cf\u4e2d\u6700\u591a\u8fbe15\u8f86\u8f66\u548c30\u4e2a\u884c\u4eba\uff0c\u8fd8\u6709\u5404\u79cd\u7a0b\u5ea6\u7684\u906e\u6321\u4e0e\u622a\u65ad\u3002 \u6574\u4e2a\u6570\u636e\u96c6\u7531 389 \u5bf9\u7acb\u4f53\u56fe\u50cf\u548c\u5149\u6d41\u56fe\uff0c39.2 km\u89c6\u89c9\u6d4b\u8ddd\u5e8f\u5217\u4ee5\u53ca\u8d85\u8fc7 200k 3D \u6807\u6ce8\u7269\u4f53\u7684\u56fe\u50cf\u7ec4\u6210[1] \uff0c\u4ee5 10Hz \u7684\u9891\u7387\u91c7\u6837\u53ca\u540c\u6b65\u3002\u603b\u4f53\u4e0a\u770b\uff0c\u539f\u59cb\u6570\u636e\u96c6\u88ab\u5206\u7c7b\u4e3a Road , City , Residential , Campus \u548c Person \u3002\u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0clabel\u7ec6\u5206\u4e3a car, van, truck, pedestrian, pedestrian(sitting), cyclist, tram \u4ee5\u53camisc \u7ec4\u6210\u3002 \u4e3b\u9875\uff1a https://www.cvlibs.net/datasets/kitti/index.php \u53ef\u89c6\u5316\uff1a http://www.danielgm.net/cc/release/","title":"KITTI \u6570\u636e\u96c6"},{"location":"cv/dataset/kitti/#_1","text":"","title":"\u6570\u636e\u96c6\u683c\u5f0f"},{"location":"cv/dataset/kitti/#_2","text":"data \u251c\u2500\u2500 kitti \u2502 \u251c\u2500\u2500 ImageSets \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 calib \u2502 \u2502 \u251c\u2500\u2500 image_2 \u2502 \u2502 \u251c\u2500\u2500 label_2 \u2502 \u2502 \u251c\u2500\u2500 velodyne \u2502 \u2502 \u251c\u2500\u2500 planes (optional) image_2 \u53732\u53f7\u5f69\u8272\u76f8\u673a\u6240\u62cd\u6444\u7684\u56fe\u7247\uff08.png\uff09\uff1b calib \u5bf9\u5e94\u6bcf\u4e00\u5e27\u7684\u5916\u53c2\uff08.txt\uff09\uff1b label_2 \u662f\u6bcf\u5e27\u7684\u6807\u6ce8\u4fe1\u606f\uff08.txt\uff09\uff1b velodyne \u662f Velodyne64 \u6240\u5f97\u7684\u70b9\u4e91\u6587\u4ef6\uff08.bin\uff09","title":"\u7ed3\u6784"},{"location":"cv/dataset/kitti/#_3","text":"KITTI \u63d0\u4f9b\u4e86\u4e09\u79cd\u6807\u5b9a\u6587\u4ef6\uff0c\u4e0d\u9700\u4eba\u5de5\u8f6c\u6362\u3002 calib_cam_to_cam calib_imu_to_velo calib_velo_to_cam","title":"\u6807\u5b9a\u6587\u4ef6"},{"location":"cv/dataset/kitti/#imagesets","text":"train.txt\uff1a\u8bad\u7ec3\u96c6 \u5217\u8868\u4fe1\u606f test.txt\uff1a\u6d4b\u8bd5\u96c6 \u5217\u8868\u4fe1\u606f val.txt\uff1a\u9a8c\u8bc1\u96c6 \u5217\u8868\u4fe1\u606f","title":"ImageSets"},{"location":"cv/dataset/kitti/#image","text":"image \u6587\u4ef6\u4ee5 8 \u4f4d PNG \u683c\u5f0f\u5b58\u50a8\uff0c\u5982\u4e0b\u6240\u793a\uff1a","title":"image \u6587\u4ef6"},{"location":"cv/dataset/kitti/#velodyne","text":"velodyne \u6587\u4ef6\u662f\u6fc0\u5149\u96f7\u8fbe\u7684\u6d4b\u91cf\u6570\u636e\uff08\u7ed5\u5176\u5782\u76f4\u8f74\uff08\u9006\u65f6\u9488\uff09\u8fde\u7eed\u65cb\u8f6c\uff09\uff0c\u4ee5 \"000001.bin\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a 7b14 4642 1058 b541 9643 0340 0000 0000 46b6 4542 1283 b641 3333 0340 0000 0000 4e62 4042 9643 b541 b072 0040 cdcc 4c3d 8340 3f42 08ac b541 3bdf ff3f 0000 0000 e550 4042 022b b841 9cc4 0040 0000 0000 10d8 4042 022b ba41 4c37 0140 0000 0000 3fb5 3a42 14ae b541 5a64 fb3f 0000 0000 7dbf 3942 2731 b641 be9f fa3f 8fc2 f53d cd4c 3842 3f35 b641 4c37 f93f ec51 383e dbf9 3742 a69b b641 c3f5 f83f ec51 383e 2586 3742 9a99 b741 fed4 f83f 1f85 6b3e . . . \u70b9\u4e91\u6570\u636e\u4ee5\u6d6e\u70b9\u4e8c\u8fdb\u5236\u6587\u4ef6\u683c\u5f0f\u5b58\u50a8\uff0c\u6bcf\u884c\u5305\u542b8\u4e2a\u6570\u636e\uff0c\u6bcf\u4e2a\u6570\u636e\u7531\u56db\u4f4d\u5341\u516d\u8fdb\u5236\u6570\u8868\u793a\uff08\u6d6e\u70b9\u6570\uff09\uff0c\u6bcf\u4e2a\u6570\u636e\u901a\u8fc7\u7a7a\u683c\u9694\u5f00\u3002\u4e00\u4e2a\u70b9\u4e91\u6570\u636e\u7531\u56db\u4e2a\u6d6e\u70b9\u6570\u6570\u636e\u6784\u6210\uff0c\u5206\u522b\u8868\u793a\u70b9\u4e91\u7684x\u3001y\u3001z\u3001r\uff08\u5f3a\u5ea6 or \u53cd\u5c04\u503c\uff09\uff0c\u70b9\u4e91\u7684\u5b58\u50a8\u65b9\u5f0f\u5982\u4e0b\u8868\u6240\u793a\uff1a","title":"velodyne \u6587\u4ef6"},{"location":"cv/dataset/kitti/#calib","text":"calib\u6587\u4ef6\u662f\u76f8\u673a\u3001\u96f7\u8fbe\u3001\u60ef\u5bfc\u7b49\u4f20\u611f\u5668\u7684\u77eb\u6b63\u6570\u636e\u3002\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5185\u5bb9\u5982\u4e0b\uff1a P0: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 0.000000000000e+00 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P1: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.875744000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 0.000000000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 0.000000000000e+00 P2: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 4.485728000000e+01 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.163791000000e-01 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.745884000000e-03 P3: 7.215377000000e+02 0.000000000000e+00 6.095593000000e+02 -3.395242000000e+02 0.000000000000e+00 7.215377000000e+02 1.728540000000e+02 2.199936000000e+00 0.000000000000e+00 0.000000000000e+00 1.000000000000e+00 2.729905000000e-03 R0_rect: 9.999239000000e-01 9.837760000000e-03 -7.445048000000e-03 -9.869795000000e-03 9.999421000000e-01 -4.278459000000e-03 7.402527000000e-03 4.351614000000e-03 9.999631000000e-01 Tr_velo_to_cam: 7.533745000000e-03 -9.999714000000e-01 -6.166020000000e-04 -4.069766000000e-03 1.480249000000e-02 7.280733000000e-04 -9.998902000000e-01 -7.631618000000e-02 9.998621000000e-01 7.523790000000e-03 1.480755000000e-02 -2.717806000000e-01 Tr_imu_to_velo: 9.999976000000e-01 7.553071000000e-04 -2.035826000000e-03 -8.086759000000e-01 -7.854027000000e-04 9.998898000000e-01 -1.482298000000e-02 3.195559000000e-01 2.024406000000e-03 1.482454000000e-02 9.998881000000e-01 -7.997231000000e-01","title":"calib \u6587\u4ef6"},{"location":"cv/dataset/kitti/#label","text":"label\u6587\u4ef6\u662f KITTI \u4e2d object \u7684\u6807\u7b7e\u548c\u8bc4\u4f30\u6570\u636e\uff0c\u4ee5 \"000001.txt\" \u6587\u4ef6\u4e3a\u4f8b\uff0c\u5305\u542b\u6837\u5f0f\u5982\u4e0b\uff1a Truck 0.00 0 -1.57 599.41 156.40 629.75 189.25 2.85 2.63 12.34 0.47 1.49 69.44 -1.56 Car 0.00 0 1.85 387.63 181.54 423.81 203.12 1.67 1.87 3.69 -16.53 2.39 58.49 1.57 Cyclist 0.00 3 -1.65 676.60 163.95 688.98 193.93 1.86 0.60 2.02 4.59 1.32 45.84 -1.55 DontCare -1 -1 -10 503.89 169.71 590.61 190.13 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 511.35 174.96 527.81 187.45 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 532.37 176.35 542.68 185.27 -1 -1 -1 -1000 -1000 -1000 -10 DontCare -1 -1 -10 559.62 175.83 575.40 183.15 -1 -1 -1 -1000 -1000 -1000 -10 \u7b2c1\u5217\uff08\u5b57\u7b26\u4e32\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u7c7b\u522b\uff08type\uff09 \u7b2c2\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u622a\u65ad\uff08truncated\uff09 \u7b2c3\u5217\uff08\u6574\u6570\uff09\uff1a\u4ee3\u8868\u7269\u4f53\u662f\u5426\u88ab\u906e\u6321\uff08occluded\uff09 \u7b2c4\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a\u7269\u4f53\u7684\u89c2\u5bdf\u89d2\u5ea6\uff08alpha\uff09 \u7b2c5~8\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a\u7269\u4f53\u76842D\u8fb9\u754c\u6846\u5927\u5c0f\uff08bbox\uff09 \u7b2c9~11\u5217\uff08\u6d6e\u70b9\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u5c3a\u5bf8\uff08dimensions\uff09 \u7b2c12-14\u5217\uff08\u6574\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u4f4d\u7f6e\uff08location\uff09 \u7b2c15\u5217\uff08\u5f27\u5ea6\u6570\uff09\uff1a3D\u7269\u4f53\u7684\u7a7a\u95f4\u65b9\u5411\uff08rotation_y\uff09 \u7b2c16\u5217\uff08\u6574\u6570\uff09\uff1a\u68c0\u6d4b\u7684\u7f6e\u4fe1\u5ea6\uff08score\uff09\uff08 \u53ea\u6709\u6d4b\u8bd5\u96c6\u4e2d\u6709 \uff09","title":"label \u6587\u4ef6"},{"location":"cv/dataset/kitti/#reference","text":"KITTI\u6570\u636e\u96c6\u7b80\u4ecb\u4e0e\u4f7f\u7528 KITTI\u6570\u636e\u96c6\u89e3\u6790\u548c\u53ef\u89c6\u5316 \u4e00\u6587\u591a\u56fe\u641e\u61c2KITTI\u6570\u636e\u96c6\u4e0b\u8f7d\u53ca\u89e3\u6790 KITTI \u6570\u636e\u96c6","title":"Reference"},{"location":"cv/dataset/tum/","text":"TUM \u6570\u636e\u96c6 \u00b6 \u7ea6 1266 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract TUM RGB-D \u6570\u636e\u96c6\u7531\u5728\u4e0d\u540c\u7684\u5ba4\u5185\u573a\u666f\u4f7f\u7528 Microsoft Kinect \u4f20\u611f\u5668\u8bb0\u5f55\u768439 \u4e2a\u5e8f\u5217\u7ec4\u6210\uff0c\u5305\u542b\u4e86 Testing and Debugging\uff08\u6d4b\u8bd5\uff09 Handheld SLAM\uff08\u624b\u6301SLAM\uff09 Robot SLAM\uff08\u673a\u5668\u4ebaSLAM\uff09 Structure vs. Texture\uff08\u7ed3\u6784 vs \u4f4e\u7eb9\u7406\uff09 Dynamic Objects\uff08\u52a8\u6001\u7269\u4f53\uff09 3D Object Reconstruction\uff08\u4e09\u7ef4\u7269\u4f53\u91cd\u5efa\uff09 Validation Files\uff08\u9a8c\u8bc1\u96c6\uff09 Calibration Files\uff08\u6807\u5b9a\u6587\u4ef6\uff09 \u7b49\u51e0\u79cd\u9488\u5bf9\u4e0d\u540c\u4efb\u52a1\u7684\u6570\u636e\u96c6\uff0c\u6bcf\u4e2a\u79cd\u7c7b\u6709\u5305\u542b\u591a\u4e2a\u6570\u636e\uff0c\u53ef\u4ee5\u7528\u4e8e\u591a\u79cd\u4efb\u52a1\u7684\u6027\u80fd\u6d4b\u8bd5\u3002\u5176\u4e2d\u4e4b\u540e\u9a8c\u8bc1\u96c6\u6ca1\u6709\u771f\u503c\uff0c\u53ea\u80fd\u901a\u8fc7 TUM \u63d0\u4f9b\u7684\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177\u8bc4\u6d4b\u6211\u4eec\u7684\u8ba1\u7b97\u7ed3\u679c\u3002TUM\u6570\u636e\u96c6\u5e26\u6709\u6807\u51c6\u7684\u8f68\u8ff9\u548c\u4e00\u4e9b\u6bd4\u8f83\u5de5\u5177\uff0c\u6240\u4ee5\u975e\u5e38\u9002\u5408\u7528\u6765\u505a\u7814\u7a76\u3002 \u4e3b\u9875\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/download \u5728\u7ebf\u6d4b\u8bc4\u5de5\u5177\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/online_evaluation \u6570\u636e\u96c6\u683c\u5f0f \u00b6 ros bag \u00b6 \u53ef\u7528 ros \u7684 rosbag \u547d\u4ee4\u8fdb\u884c\u64ad\u653e\uff0c\u76f8\u5e94\u8282\u70b9\u8ba2\u9605\u56fe\u50cf\u8bdd\u9898\u5373\u53ef\u3002 tgz \u00b6 \u538b\u7f29\u540e\u5305\u542b\uff1a rgb.txt \u548c depth.txt \u6587\u4ef6\u8bb0\u5f55\u4e86\u5404\u6587\u4ef6\u7684\u91c7\u96c6\u65f6\u95f4\u548c\u5bf9\u5e94\u7684\u6587\u4ef6\u540d rgb/ \u548c depth/ \u76ee\u5f55\u5b58\u653e\u91c7\u96c6\u5230\u7684 png \u683c\u5f0f\u56fe\u50cf\u6587\u4ef6\uff0c\u4ee5\u91c7\u96c6\u65f6\u95f4\u547d\u540d groundtruth.txt \u4e3a\u5916\u90e8\u8fd0\u52a8\u6355\u6349\u7cfb\u7edf\u91c7\u96c6\u5230\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u683c\u5f0f\u4e3a\uff08time, tx, ty, tz, qx, qy, qw\uff09 Note \u5f69\u8272\u56fe\u3001\u6df1\u5ea6\u56fe\u548c\u6807\u51c6\u8f68\u8ff9\u7684\u91c7\u96c6\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u8f68\u8ff9\u7684\u91c7\u96c6\u9891\u7387\u6bd4\u56fe\u50cf\u9ad8\u5f88\u591a\u3002 \u5728\u4f7f\u7528\u6570\u636e\u4e4b\u524d\uff0c\u9700\u8981\u6839\u636e\u91c7\u96c6\u65f6\u95f4\uff0c\u5bf9\u6570\u636e\u8fdb\u884c\u4e00\u6b21\u65f6\u95f4\u4e0a\u7684\u5bf9\u9f50\uff0c\u4ee5\u4fbf\u5bf9\u5f69\u8272\u56fe\u548c\u6df1\u5ea6\u56fe\u8fdb\u884c\u914d\u5bf9\u3002 \u53ef\u4ee5\u628a\u91c7\u96c6\u65f6\u95f4\u76f8\u8fd1\u4e8e\u4e00\u4e2a\u9608\u503c\u7684\u6570\u636e\uff0c\u770b\u6210\u662f\u4e00\u5bf9\u56fe\u50cf\uff0c\u5e76\u628a\u76f8\u8fd1\u65f6\u95f4\u7684\u4f4d\u59ff\uff0c\u770b\u4f5c\u662f\u8be5\u56fe\u50cf\u7684\u771f\u5b9e\u91c7\u96c6\u4f4d\u7f6e\u3002 TUM\u63d0\u4f9b\u4e86 associate.py \u7a0b\u5e8f\uff0c\u5c06\u5176\u653e\u5165\u76ee\u5f55\u4e0b\u6267\u884c\u5373\u53ef\u5f97\u5230\u8bb0\u5f55\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u5339\u914d\u7ed3\u679c\u7684 accelerometer.txt \u6587\u4ef6\uff0c\u91cc\u9762\u8bb0\u5f55\u4e86\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u7684\u5339\u914d\u5173\u7cfb\u3002 \u52a8\u6001\u6570\u636e\u96c6 \u00b6 \u7814\u7a76\u52a8\u6001 SALM \u65f6\u7528\u7684\u662f TUM \u7684 Dynamic Objects \u6570\u636e\u96c6\uff089\u4e2a\uff09\u4ee5\u53ca Validation Files \u5bf9\u5e94\u7684\u90e8\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a fr2/desk_with_person \u8bb0\u5f55\u4e86\u4e00\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\u7684\u5178\u578b\u529e\u516c\u5ba4\u573a\u666f\uff0c\u5728\u5f55\u5236\u8fc7\u7a0b\u4e2d\uff0c\u8be5\u4eba\u79fb\u52a8\u5e76\u4e0e\u4e00\u4e9b\u7269\u4f53\uff08\u5c4f\u5e55\u3001\u7535\u8bdd\u7b49\uff09\u4e92\u52a8\u3002 \u5bf9\u4e8e\u5176\u4ed6 8 \u4e2a\u5e8f\u5217\uff0csitting \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\uff0c\u4ea4\u8c08\uff0c\u5e76\u7a0d\u5fae\u6253\u624b\u52bf\uff0c\u5e8f\u5217\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u548c\u91cc\u7a0b\u8ba1\u7b97\u6cd5\u5bf9\u7f13\u6162\u79fb\u52a8\u7684\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\uff1bwalking \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u8d70\u8fc7\u4e00\u4e2a\u529e\u516c\u5ba4\u573a\u666f\uff0c\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u5728\u5927\u90e8\u5206\u53ef\u89c1\u573a\u666f\u4e2d\u5feb\u901f\u79fb\u52a8\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\u3002xyz\uff0crpy\uff0chalfsphere\uff0cstatic \u5219\u5bf9\u5e94\u4e86\u76f8\u673a\u7684\u79fb\u52a8\u65b9\u5f0f\u3002\u5177\u4f53\u7684 sitting \u4e0e walking \u6570\u636e\u96c6\u4e2d\u7684\u533a\u522b\u5982\u4e0b\uff1a \u76f8\u673a\u8fd0\u52a8\u8f68\u8ff9\u7684\u533a\u522b\u5982\u4e0b\uff1a \u6570\u636e\u96c6\u5206\u6790 \u00b6 \u5bf9\u4e8e\u52a8\u6001\u73af\u5883\u4e0b\u7684SLAM\u95ee\u9898\uff0c\u6211\u4eec\u901a\u5e38\u9075\u5faa\u4ee5\u4e0b\u4e24\u4e2a\u51c6\u5219\u6765\u964d\u4f4e\u52a8\u6001\u7269\u4f53\u5bf9\u5b9a\u4f4d\u7cbe\u5ea6\u7684\u5f71\u54cd\u3002 \u51c6\u52191\uff1a\u5c3d\u53ef\u80fd\u5c06\u8fd0\u52a8\u7684\u7269\u4f53\uff08\u533a\u57df\uff09\u7684\u53bb\u9664\u3002\u8fd0\u52a8\u533a\u57df\u7684\u7279\u5f81\u70b9\u4f1a\u5f15\u5165\u4e00\u4e9b\u9519\u8bef\u7684\u7a7a\u95f4\u7ea6\u675f\uff0c\u6781\u5927\u7684\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\u53ca\u9c81\u68d2\u6027\uff0c\u56e0\u6b64\u5bf9\u52a8\u6001\u533a\u57df\u7684\u5bb9\u5fcd\u5ea6\u662f\u975e\u5e38\u4f4e\u7684\u3002 \u51c6\u52192\uff1a\u5c3d\u53ef\u80fd\u4fdd\u7559\u9759\u6001\u533a\u57df\u3002\u5982\u679c\u573a\u666f\u4e2d\u4f7f\u7528\u7684\u7279\u5f81\u70b9\u8fc7\u5c11\uff0c\u4e5f\u4f1a\u95f4\u63a5\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\uff0c\u6240\u4ee5\u5728\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u540c\u65f6\uff0c\u5c3d\u91cf\u4e0d\u8981\u628a\u9759\u6001\u70b9\u5f53\u505a\u52a8\u6001\u70b9\u53bb\u9664\u6389\u3002 \u5728\u4f7f\u7528\u8bed\u4e49\u4fe1\u606f\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u65f6\u5019\u8981\u8003\u8651\u7684\u95ee\u9898\uff1a \u5148\u9a8c\u77e5\u8bc6\u91cc\u9759\u6b62\u7684\u7269\u4f53\uff08\u6bd4\u5982\u6905\u5b50\uff0c\u4e66\uff09\u53ef\u80fd\u662f\u8fd0\u52a8\u7684\uff0c\u5982\u679c\u4e00\u4e2a\u4eba\u63a8\u7740\u6905\u5b50\u8fd0\u52a8\u7684\u8bdd\u4e5f\u9700\u8981\u5c06\u6905\u5b50\u533a\u57df\u7684\u7279\u5f81\u70b9\u8fdb\u884c\u5254\u9664\uff0c\u5426\u5219\u5b9a\u4f4d\u65f6\u4e5f\u4f1a\u4f7f\u7528\u4e00\u4e9b\u52a8\u6001\u7684\u4e0d\u5b89\u5168\u7684\u7279\u5f81\u70b9\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191 \u5148\u9a8c\u77e5\u8bc6\u91cc\u79fb\u52a8\u7684\u7269\u4f53\uff08\u6bd4\u5982\u4eba\u548c\u6c7d\u8f66\uff09\u53ef\u80fd\u662f\u9759\u6b62\u7684\uff0c\u5982\u679c\u8fd9\u4e9b\u533a\u57df\u53bb\u6389\u7684\u8bdd\uff0c\u4f1a\u56e0\u4e3a\u9759\u6001\u70b9\u7684\u51cf\u5c11\u800c\u964d\u4f4e\u5b9a\u4f4d\u7cbe\u5ea6\uff0c\u5373\u8fdd\u53cd\u4e86\u51c6\u52192\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u7f13\u6162\u8fd0\u52a8\u7684\u3002\u4e00\u4e9b\u8bba\u6587\u5e38\u5e38\u4f7f\u7528\u4e24\u5e27\u4e4b\u95f4\u8ba1\u7b97\u5916\u70b9\uff0c\u901a\u8fc7\u7269\u4f53\u4e0a\u5916\u70b9\u7684\u6570\u91cf\u5224\u65ad\u7269\u4f53\u662f\u5426\u5728\u79fb\u52a8\uff0c\u7136\u800c\u5982\u679c\u7269\u4f53\u662f\u5728\u7f13\u6162\u8fd0\u52a8\uff0c\u90a3\u4e48\u5f88\u96be\u5728\u524d\u540e\u4e24\u5e27\u56fe\u50cf\u4e4b\u95f4\u901a\u8fc7\u5916\u70b9\u7684\u65b9\u5f0f\u68c0\u6d4b\u51fa\u6765\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u5c40\u90e8\u8fd0\u52a8\u5c40\u90e8\u9759\u6b62\u7684\u3002\u6bd4\u5982 TUM \u6570\u636e\u96c6\u4e2d sitting \u4e2d\u7684\u90e8\u5206\uff0c\u4eba\u7684\u5927\u90e8\u5206\u533a\u57df\u5728\u9759\u6b62\u7684\uff0c\u4f46\u662f\u6709\u4e00\u5c0f\u90e8\u5206\u662f\u52a8\u6001\u7684\uff0c\u4e0d\u80fd\u5c06\u4eba\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u8fdb\u884c\u8fd0\u52a8\u5224\u65ad\uff0c\u4e5f\u5c31\u4e0d\u80fd\u540c\u65f6\u6ee1\u8db3\u51c6\u52191\u4e0e\u51c6\u52192\u3002 \u9488\u5bf9TUM\u6570\u636e\u96c6\uff0c\u5177\u4f53\u9700\u8981\u8003\u8651\u7684\u56e0\u7d20\u5305\u62ec\uff1a walking\u4e2d\u79fb\u52a8\u7684\u4eba sitting\u4e2d\u5c40\u90e8\u8fd0\u52a8\u7684\u4eba \u9759\u6b62\u7684\u4eba \u79fb\u52a8\u7684\u6905\u5b50\u548c\u4e66\u7c4d","title":"TUM"},{"location":"cv/dataset/tum/#tum","text":"\u7ea6 1266 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract TUM RGB-D \u6570\u636e\u96c6\u7531\u5728\u4e0d\u540c\u7684\u5ba4\u5185\u573a\u666f\u4f7f\u7528 Microsoft Kinect \u4f20\u611f\u5668\u8bb0\u5f55\u768439 \u4e2a\u5e8f\u5217\u7ec4\u6210\uff0c\u5305\u542b\u4e86 Testing and Debugging\uff08\u6d4b\u8bd5\uff09 Handheld SLAM\uff08\u624b\u6301SLAM\uff09 Robot SLAM\uff08\u673a\u5668\u4ebaSLAM\uff09 Structure vs. Texture\uff08\u7ed3\u6784 vs \u4f4e\u7eb9\u7406\uff09 Dynamic Objects\uff08\u52a8\u6001\u7269\u4f53\uff09 3D Object Reconstruction\uff08\u4e09\u7ef4\u7269\u4f53\u91cd\u5efa\uff09 Validation Files\uff08\u9a8c\u8bc1\u96c6\uff09 Calibration Files\uff08\u6807\u5b9a\u6587\u4ef6\uff09 \u7b49\u51e0\u79cd\u9488\u5bf9\u4e0d\u540c\u4efb\u52a1\u7684\u6570\u636e\u96c6\uff0c\u6bcf\u4e2a\u79cd\u7c7b\u6709\u5305\u542b\u591a\u4e2a\u6570\u636e\uff0c\u53ef\u4ee5\u7528\u4e8e\u591a\u79cd\u4efb\u52a1\u7684\u6027\u80fd\u6d4b\u8bd5\u3002\u5176\u4e2d\u4e4b\u540e\u9a8c\u8bc1\u96c6\u6ca1\u6709\u771f\u503c\uff0c\u53ea\u80fd\u901a\u8fc7 TUM \u63d0\u4f9b\u7684\u5728\u7ebf\u6d4b\u8bd5\u5de5\u5177\u8bc4\u6d4b\u6211\u4eec\u7684\u8ba1\u7b97\u7ed3\u679c\u3002TUM\u6570\u636e\u96c6\u5e26\u6709\u6807\u51c6\u7684\u8f68\u8ff9\u548c\u4e00\u4e9b\u6bd4\u8f83\u5de5\u5177\uff0c\u6240\u4ee5\u975e\u5e38\u9002\u5408\u7528\u6765\u505a\u7814\u7a76\u3002 \u4e3b\u9875\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/download \u5728\u7ebf\u6d4b\u8bc4\u5de5\u5177\uff1a https://vision.in.tum.de/data/datasets/rgbd-dataset/online_evaluation","title":"TUM \u6570\u636e\u96c6"},{"location":"cv/dataset/tum/#_1","text":"","title":"\u6570\u636e\u96c6\u683c\u5f0f"},{"location":"cv/dataset/tum/#ros-bag","text":"\u53ef\u7528 ros \u7684 rosbag \u547d\u4ee4\u8fdb\u884c\u64ad\u653e\uff0c\u76f8\u5e94\u8282\u70b9\u8ba2\u9605\u56fe\u50cf\u8bdd\u9898\u5373\u53ef\u3002","title":"ros bag"},{"location":"cv/dataset/tum/#tgz","text":"\u538b\u7f29\u540e\u5305\u542b\uff1a rgb.txt \u548c depth.txt \u6587\u4ef6\u8bb0\u5f55\u4e86\u5404\u6587\u4ef6\u7684\u91c7\u96c6\u65f6\u95f4\u548c\u5bf9\u5e94\u7684\u6587\u4ef6\u540d rgb/ \u548c depth/ \u76ee\u5f55\u5b58\u653e\u91c7\u96c6\u5230\u7684 png \u683c\u5f0f\u56fe\u50cf\u6587\u4ef6\uff0c\u4ee5\u91c7\u96c6\u65f6\u95f4\u547d\u540d groundtruth.txt \u4e3a\u5916\u90e8\u8fd0\u52a8\u6355\u6349\u7cfb\u7edf\u91c7\u96c6\u5230\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u683c\u5f0f\u4e3a\uff08time, tx, ty, tz, qx, qy, qw\uff09 Note \u5f69\u8272\u56fe\u3001\u6df1\u5ea6\u56fe\u548c\u6807\u51c6\u8f68\u8ff9\u7684\u91c7\u96c6\u90fd\u662f\u72ec\u7acb\u7684\uff0c\u8f68\u8ff9\u7684\u91c7\u96c6\u9891\u7387\u6bd4\u56fe\u50cf\u9ad8\u5f88\u591a\u3002 \u5728\u4f7f\u7528\u6570\u636e\u4e4b\u524d\uff0c\u9700\u8981\u6839\u636e\u91c7\u96c6\u65f6\u95f4\uff0c\u5bf9\u6570\u636e\u8fdb\u884c\u4e00\u6b21\u65f6\u95f4\u4e0a\u7684\u5bf9\u9f50\uff0c\u4ee5\u4fbf\u5bf9\u5f69\u8272\u56fe\u548c\u6df1\u5ea6\u56fe\u8fdb\u884c\u914d\u5bf9\u3002 \u53ef\u4ee5\u628a\u91c7\u96c6\u65f6\u95f4\u76f8\u8fd1\u4e8e\u4e00\u4e2a\u9608\u503c\u7684\u6570\u636e\uff0c\u770b\u6210\u662f\u4e00\u5bf9\u56fe\u50cf\uff0c\u5e76\u628a\u76f8\u8fd1\u65f6\u95f4\u7684\u4f4d\u59ff\uff0c\u770b\u4f5c\u662f\u8be5\u56fe\u50cf\u7684\u771f\u5b9e\u91c7\u96c6\u4f4d\u7f6e\u3002 TUM\u63d0\u4f9b\u4e86 associate.py \u7a0b\u5e8f\uff0c\u5c06\u5176\u653e\u5165\u76ee\u5f55\u4e0b\u6267\u884c\u5373\u53ef\u5f97\u5230\u8bb0\u5f55\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u5339\u914d\u7ed3\u679c\u7684 accelerometer.txt \u6587\u4ef6\uff0c\u91cc\u9762\u8bb0\u5f55\u4e86\u5f69\u8272\u56fe\u50cf\u4e0e\u6df1\u5ea6\u56fe\u50cf\u7684\u5339\u914d\u5173\u7cfb\u3002","title":"tgz"},{"location":"cv/dataset/tum/#_2","text":"\u7814\u7a76\u52a8\u6001 SALM \u65f6\u7528\u7684\u662f TUM \u7684 Dynamic Objects \u6570\u636e\u96c6\uff089\u4e2a\uff09\u4ee5\u53ca Validation Files \u5bf9\u5e94\u7684\u90e8\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a fr2/desk_with_person \u8bb0\u5f55\u4e86\u4e00\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\u7684\u5178\u578b\u529e\u516c\u5ba4\u573a\u666f\uff0c\u5728\u5f55\u5236\u8fc7\u7a0b\u4e2d\uff0c\u8be5\u4eba\u79fb\u52a8\u5e76\u4e0e\u4e00\u4e9b\u7269\u4f53\uff08\u5c4f\u5e55\u3001\u7535\u8bdd\u7b49\uff09\u4e92\u52a8\u3002 \u5bf9\u4e8e\u5176\u4ed6 8 \u4e2a\u5e8f\u5217\uff0csitting \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u5750\u5728\u529e\u516c\u684c\u524d\uff0c\u4ea4\u8c08\uff0c\u5e76\u7a0d\u5fae\u6253\u624b\u52bf\uff0c\u5e8f\u5217\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u548c\u91cc\u7a0b\u8ba1\u7b97\u6cd5\u5bf9\u7f13\u6162\u79fb\u52a8\u7684\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\uff1bwalking \u7c7b\u522b\u7684\u5e8f\u5217\u4e2d\u4e24\u4e2a\u4eba\u8d70\u8fc7\u4e00\u4e2a\u529e\u516c\u5ba4\u573a\u666f\uff0c\u65e8\u5728\u8bc4\u4f30\u89c6\u89c9 SLAM \u5728\u5927\u90e8\u5206\u53ef\u89c1\u573a\u666f\u4e2d\u5feb\u901f\u79fb\u52a8\u52a8\u6001\u5bf9\u8c61\u7684\u9c81\u68d2\u6027\u3002xyz\uff0crpy\uff0chalfsphere\uff0cstatic \u5219\u5bf9\u5e94\u4e86\u76f8\u673a\u7684\u79fb\u52a8\u65b9\u5f0f\u3002\u5177\u4f53\u7684 sitting \u4e0e walking \u6570\u636e\u96c6\u4e2d\u7684\u533a\u522b\u5982\u4e0b\uff1a \u76f8\u673a\u8fd0\u52a8\u8f68\u8ff9\u7684\u533a\u522b\u5982\u4e0b\uff1a","title":"\u52a8\u6001\u6570\u636e\u96c6"},{"location":"cv/dataset/tum/#_3","text":"\u5bf9\u4e8e\u52a8\u6001\u73af\u5883\u4e0b\u7684SLAM\u95ee\u9898\uff0c\u6211\u4eec\u901a\u5e38\u9075\u5faa\u4ee5\u4e0b\u4e24\u4e2a\u51c6\u5219\u6765\u964d\u4f4e\u52a8\u6001\u7269\u4f53\u5bf9\u5b9a\u4f4d\u7cbe\u5ea6\u7684\u5f71\u54cd\u3002 \u51c6\u52191\uff1a\u5c3d\u53ef\u80fd\u5c06\u8fd0\u52a8\u7684\u7269\u4f53\uff08\u533a\u57df\uff09\u7684\u53bb\u9664\u3002\u8fd0\u52a8\u533a\u57df\u7684\u7279\u5f81\u70b9\u4f1a\u5f15\u5165\u4e00\u4e9b\u9519\u8bef\u7684\u7a7a\u95f4\u7ea6\u675f\uff0c\u6781\u5927\u7684\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\u53ca\u9c81\u68d2\u6027\uff0c\u56e0\u6b64\u5bf9\u52a8\u6001\u533a\u57df\u7684\u5bb9\u5fcd\u5ea6\u662f\u975e\u5e38\u4f4e\u7684\u3002 \u51c6\u52192\uff1a\u5c3d\u53ef\u80fd\u4fdd\u7559\u9759\u6001\u533a\u57df\u3002\u5982\u679c\u573a\u666f\u4e2d\u4f7f\u7528\u7684\u7279\u5f81\u70b9\u8fc7\u5c11\uff0c\u4e5f\u4f1a\u95f4\u63a5\u964d\u4f4e\u5b9a\u4f4d\u7684\u7cbe\u5ea6\uff0c\u6240\u4ee5\u5728\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u540c\u65f6\uff0c\u5c3d\u91cf\u4e0d\u8981\u628a\u9759\u6001\u70b9\u5f53\u505a\u52a8\u6001\u70b9\u53bb\u9664\u6389\u3002 \u5728\u4f7f\u7528\u8bed\u4e49\u4fe1\u606f\u5254\u9664\u52a8\u6001\u533a\u57df\u7684\u65f6\u5019\u8981\u8003\u8651\u7684\u95ee\u9898\uff1a \u5148\u9a8c\u77e5\u8bc6\u91cc\u9759\u6b62\u7684\u7269\u4f53\uff08\u6bd4\u5982\u6905\u5b50\uff0c\u4e66\uff09\u53ef\u80fd\u662f\u8fd0\u52a8\u7684\uff0c\u5982\u679c\u4e00\u4e2a\u4eba\u63a8\u7740\u6905\u5b50\u8fd0\u52a8\u7684\u8bdd\u4e5f\u9700\u8981\u5c06\u6905\u5b50\u533a\u57df\u7684\u7279\u5f81\u70b9\u8fdb\u884c\u5254\u9664\uff0c\u5426\u5219\u5b9a\u4f4d\u65f6\u4e5f\u4f1a\u4f7f\u7528\u4e00\u4e9b\u52a8\u6001\u7684\u4e0d\u5b89\u5168\u7684\u7279\u5f81\u70b9\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191 \u5148\u9a8c\u77e5\u8bc6\u91cc\u79fb\u52a8\u7684\u7269\u4f53\uff08\u6bd4\u5982\u4eba\u548c\u6c7d\u8f66\uff09\u53ef\u80fd\u662f\u9759\u6b62\u7684\uff0c\u5982\u679c\u8fd9\u4e9b\u533a\u57df\u53bb\u6389\u7684\u8bdd\uff0c\u4f1a\u56e0\u4e3a\u9759\u6001\u70b9\u7684\u51cf\u5c11\u800c\u964d\u4f4e\u5b9a\u4f4d\u7cbe\u5ea6\uff0c\u5373\u8fdd\u53cd\u4e86\u51c6\u52192\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u7f13\u6162\u8fd0\u52a8\u7684\u3002\u4e00\u4e9b\u8bba\u6587\u5e38\u5e38\u4f7f\u7528\u4e24\u5e27\u4e4b\u95f4\u8ba1\u7b97\u5916\u70b9\uff0c\u901a\u8fc7\u7269\u4f53\u4e0a\u5916\u70b9\u7684\u6570\u91cf\u5224\u65ad\u7269\u4f53\u662f\u5426\u5728\u79fb\u52a8\uff0c\u7136\u800c\u5982\u679c\u7269\u4f53\u662f\u5728\u7f13\u6162\u8fd0\u52a8\uff0c\u90a3\u4e48\u5f88\u96be\u5728\u524d\u540e\u4e24\u5e27\u56fe\u50cf\u4e4b\u95f4\u901a\u8fc7\u5916\u70b9\u7684\u65b9\u5f0f\u68c0\u6d4b\u51fa\u6765\uff0c\u5373\u8fdd\u80cc\u4e86\u51c6\u52191\u3002 \u4e00\u4e9b\u7269\u4f53\u53ef\u80fd\u662f\u5c40\u90e8\u8fd0\u52a8\u5c40\u90e8\u9759\u6b62\u7684\u3002\u6bd4\u5982 TUM \u6570\u636e\u96c6\u4e2d sitting \u4e2d\u7684\u90e8\u5206\uff0c\u4eba\u7684\u5927\u90e8\u5206\u533a\u57df\u5728\u9759\u6b62\u7684\uff0c\u4f46\u662f\u6709\u4e00\u5c0f\u90e8\u5206\u662f\u52a8\u6001\u7684\uff0c\u4e0d\u80fd\u5c06\u4eba\u4f5c\u4e3a\u4e00\u4e2a\u6574\u4f53\u8fdb\u884c\u8fd0\u52a8\u5224\u65ad\uff0c\u4e5f\u5c31\u4e0d\u80fd\u540c\u65f6\u6ee1\u8db3\u51c6\u52191\u4e0e\u51c6\u52192\u3002 \u9488\u5bf9TUM\u6570\u636e\u96c6\uff0c\u5177\u4f53\u9700\u8981\u8003\u8651\u7684\u56e0\u7d20\u5305\u62ec\uff1a walking\u4e2d\u79fb\u52a8\u7684\u4eba sitting\u4e2d\u5c40\u90e8\u8fd0\u52a8\u7684\u4eba \u9759\u6b62\u7684\u4eba \u79fb\u52a8\u7684\u6905\u5b50\u548c\u4e66\u7c4d","title":"\u6570\u636e\u96c6\u5206\u6790"},{"location":"cv/dataset/waymo/","text":"KITTI \u6570\u636e\u96c6 \u00b6 \u7ea6 543 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract waymo\u63d0\u4f9b\u4e86\u4e24\u79cd\u6570\u636e\u96c6\uff0c motion \u4e0e perception \u4e24\u79cd\uff0c\u5176\u4e2d motion \u662f\u9e1f\u77b0\u56fe\uff0c\u5b98\u7f51\u4e2d\u6709\u4ecb\u7ecd\uff0c\u4e3b\u8981\u7528\u4e8e\u8f68\u8ff9\u9884\u6d4b\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c perception \u4e3b\u8981\u7528\u4e8e\u76ee\u6807\u68c0\u6d4b\u8ddf\u8e2a\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u662f\u7b2c\u4e00\u89c6\u89d2\uff0c\u6709\u76f8\u673a\u548c\u96f7\u8fbe\u4fe1\u606f\u3002 Waymo\u5305\u542b 798 \u4e2a\u8bad\u7ec3\u573a\u666f\u3001202 \u4e2a\u9a8c\u8bc1\u573a\u666f\u548c 150 \u4e2a\u6d4b\u8bd5\u573a\u666f\uff0c\u6bcf\u4e2a\u573a\u666f\u7684\u65f6\u957f\u4e3a 20 s\u3002Waymo \u6570\u636e\u96c6\u7684\u6807\u6ce8\u9891\u7387\u6bd4 nuScenes \u9ad8 5 \u500d\uff0c\u573a\u666f\u6570\u91cf\u662f nuScenes \u6570\u636e\u96c6\u7684 3 \u500d\uff0c\u6709\u6570\u91cf\u66f4\u591a\u4e14\u66f4\u5bc6\u96c6\u7684 2D/3D \u6807\u7b7e\u3002Waymo \u6570\u636e\u96c6\u5bf9\u81ea\u52a8\u9a7e\u9a76\u7b97\u6cd5\u7684\u9c81\u68d2\u6027\u548c\u6cdb\u5316\u80fd\u529b\u63d0\u51fa\u4e86\u66f4\u9ad8\u7684\u8981\u6c42\uff0c\u662f\u76ee\u524d\u4e3a\u6b62\u6700\u5927\u3001\u6700\u591a\u6837\u5316\u7684\u6570\u636e\u96c6\u3002 paper: https://arxiv.org/abs/1912.04838v7 github: https://github.com/waymo-research/waymo-open-dataset \u4e3b\u9875\uff1a https://waymo.com/open \u6570\u636e\u96c6\u683c\u5f0f \u00b6 \u7ed3\u6784 \u00b6 data \u251c\u2500\u2500 waymo \u2502 \u251c\u2500\u2500 waymo_format \u2502 \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 validation \u2502 \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 gt.bin \u2502 \u2502 \u251c\u2500\u2500 cam_gt.bin \u2502 \u2502 \u251c\u2500\u2500 fov_gt.bin \u2502 \u251c\u2500\u2500 kitti_format \u2502 \u2502 \u251c\u2500\u2500 ImageSets Ground Truth Labels \u00b6 \u6570\u636e\u96c6\u4e2d\u5bf9\u6c7d\u8f66\u3001\u884c\u4eba\u3001\u4ea4\u901a\u6807\u5fd7\u3001\u81ea\u884c\u8f66\u4eba\u5458\u8fdb\u884c\u4e86\u8be6\u7ec6\u6807\u6ce8\u3002\u5bf9\u4e8e\u6fc0\u5149\u96f7\u8fbe\u6570\u636e\uff0c\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a 7 \u81ea\u7531\u5ea6 3D bbox\uff1a(cx, cy, cz, l, w, h, \u03b8)\u3002\u5176\u4e2dcx, cy, cz \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u5750\u6807\uff0cl, w, h \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5bbd\u9ad8\uff0c\u03b8 \u8868\u793a\u4e3a\u7269\u4f53\u504f\u822a\u89d2\uff0c\u6b64\u5916\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u7269\u4f53\u8fd8\u6807\u6ce8\u4e86\u4e00\u4e2a\u552f\u4e00\u7684\u8ffd\u8e2a ID \u7f16\u53f7\u3002 \u56fe\u50cf\u6807\u6ce8\u4e2d\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a4\u81ea\u7531\u5ea62D bbox\uff1a(cx, cy, l, w)\u3002\u5176\u4e2dcx, cy \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u56fe\u50cf\u5750\u6807\uff0cl \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5ea6\uff0cw \u8868\u793a\u4e3a\u7269\u4f53\u5bbd\u5ea6\u3002 \u6b64\u5916\uff0c\u8fd8\u5c06\u6807\u6ce8\u7269\u4f53\u5212\u5206\u4e3a\u4e86\u4e24\u4e2a\u96be\u5ea6\uff1aLEVEL_2 \u4e3a\u7269\u4f53\u5bf9\u5e94\u6fc0\u5149\u96f7\u8fbe\u70b9\u6570\u5c11\u4e8e 5 \u4e2a\uff0c\u5176\u4f59\u5219\u5212\u5206\u4e3a LEVEL_1\u3002 Tasks \u00b6 \u6570\u636e\u96c6\u4efb\u52a1\u5212\u5206\u4e3a2D\u548c3D\u7269\u4f53\u68c0\u6d4b\u548c\u8ffd\u8e2a\u4efb\u52a1\uff0c\u8bad\u7ec3\u96c6\u573a\u666f\u6709798\u4e2a\uff0c\u9a8c\u8bc1\u96c6\u573a\u666f\u6709202\u4e2a\uff0c\u6d4b\u8bd5\u96c6\u573a\u666f\u6709150\u4e2a\u3002 Experiments \u00b6 \u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0cWaymo \u63d0\u4f9b\u4e86\u4e00\u4e2a Baseline\uff0c\u5176\u4f7f\u7528\u7684\u68c0\u6d4b\u65b9\u6cd5\u662f PointPillars\u3002\u5bf9\u4e8e 2D \u7269\u4f53\u68c0\u6d4b\uff0c\u4f7f\u7528\u4e86 Faster R-CNN \u4f5c\u4e3a baseline\uff0c\u5bf9\u4e8e3D\u7269\u4f53\u8ffd\u8e2a\uff0c\u4f7f\u7528\u4e86 AB3DMOT \u4f5c\u4e3a Baseline\u3002 Waymo \u8f6c\u6362 COCO \u683c\u5f0f \u00b6 https://github.com/shinya7y/WaymoCOCO Reference \u00b6 Waymo\u81ea\u52a8\u9a7e\u9a76\u6570\u636e\u96c6\u4ecb\u7ecd\u4e0e\u4f7f\u7528\u6559 Waymo\u6570\u636e\u96c6\u4e0b\u8f7d\u4e0e\u4f7f\u7528 WAYMO \u6570\u636e\u96c6","title":"Waymo"},{"location":"cv/dataset/waymo/#kitti","text":"\u7ea6 543 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract waymo\u63d0\u4f9b\u4e86\u4e24\u79cd\u6570\u636e\u96c6\uff0c motion \u4e0e perception \u4e24\u79cd\uff0c\u5176\u4e2d motion \u662f\u9e1f\u77b0\u56fe\uff0c\u5b98\u7f51\u4e2d\u6709\u4ecb\u7ecd\uff0c\u4e3b\u8981\u7528\u4e8e\u8f68\u8ff9\u9884\u6d4b\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c perception \u4e3b\u8981\u7528\u4e8e\u76ee\u6807\u68c0\u6d4b\u8ddf\u8e2a\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u662f\u7b2c\u4e00\u89c6\u89d2\uff0c\u6709\u76f8\u673a\u548c\u96f7\u8fbe\u4fe1\u606f\u3002 Waymo\u5305\u542b 798 \u4e2a\u8bad\u7ec3\u573a\u666f\u3001202 \u4e2a\u9a8c\u8bc1\u573a\u666f\u548c 150 \u4e2a\u6d4b\u8bd5\u573a\u666f\uff0c\u6bcf\u4e2a\u573a\u666f\u7684\u65f6\u957f\u4e3a 20 s\u3002Waymo \u6570\u636e\u96c6\u7684\u6807\u6ce8\u9891\u7387\u6bd4 nuScenes \u9ad8 5 \u500d\uff0c\u573a\u666f\u6570\u91cf\u662f nuScenes \u6570\u636e\u96c6\u7684 3 \u500d\uff0c\u6709\u6570\u91cf\u66f4\u591a\u4e14\u66f4\u5bc6\u96c6\u7684 2D/3D \u6807\u7b7e\u3002Waymo \u6570\u636e\u96c6\u5bf9\u81ea\u52a8\u9a7e\u9a76\u7b97\u6cd5\u7684\u9c81\u68d2\u6027\u548c\u6cdb\u5316\u80fd\u529b\u63d0\u51fa\u4e86\u66f4\u9ad8\u7684\u8981\u6c42\uff0c\u662f\u76ee\u524d\u4e3a\u6b62\u6700\u5927\u3001\u6700\u591a\u6837\u5316\u7684\u6570\u636e\u96c6\u3002 paper: https://arxiv.org/abs/1912.04838v7 github: https://github.com/waymo-research/waymo-open-dataset \u4e3b\u9875\uff1a https://waymo.com/open","title":"KITTI \u6570\u636e\u96c6"},{"location":"cv/dataset/waymo/#_1","text":"","title":"\u6570\u636e\u96c6\u683c\u5f0f"},{"location":"cv/dataset/waymo/#_2","text":"data \u251c\u2500\u2500 waymo \u2502 \u251c\u2500\u2500 waymo_format \u2502 \u2502 \u251c\u2500\u2500 training \u2502 \u2502 \u251c\u2500\u2500 validation \u2502 \u2502 \u251c\u2500\u2500 testing \u2502 \u2502 \u251c\u2500\u2500 gt.bin \u2502 \u2502 \u251c\u2500\u2500 cam_gt.bin \u2502 \u2502 \u251c\u2500\u2500 fov_gt.bin \u2502 \u251c\u2500\u2500 kitti_format \u2502 \u2502 \u251c\u2500\u2500 ImageSets","title":"\u7ed3\u6784"},{"location":"cv/dataset/waymo/#ground-truth-labels","text":"\u6570\u636e\u96c6\u4e2d\u5bf9\u6c7d\u8f66\u3001\u884c\u4eba\u3001\u4ea4\u901a\u6807\u5fd7\u3001\u81ea\u884c\u8f66\u4eba\u5458\u8fdb\u884c\u4e86\u8be6\u7ec6\u6807\u6ce8\u3002\u5bf9\u4e8e\u6fc0\u5149\u96f7\u8fbe\u6570\u636e\uff0c\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a 7 \u81ea\u7531\u5ea6 3D bbox\uff1a(cx, cy, cz, l, w, h, \u03b8)\u3002\u5176\u4e2dcx, cy, cz \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u5750\u6807\uff0cl, w, h \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5bbd\u9ad8\uff0c\u03b8 \u8868\u793a\u4e3a\u7269\u4f53\u504f\u822a\u89d2\uff0c\u6b64\u5916\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u7269\u4f53\u8fd8\u6807\u6ce8\u4e86\u4e00\u4e2a\u552f\u4e00\u7684\u8ffd\u8e2a ID \u7f16\u53f7\u3002 \u56fe\u50cf\u6807\u6ce8\u4e2d\u5c06\u6bcf\u4e00\u4e2a\u7269\u4f53\u6807\u6ce8\u4e3a4\u81ea\u7531\u5ea62D bbox\uff1a(cx, cy, l, w)\u3002\u5176\u4e2dcx, cy \u8868\u793a\u4e3a bbox \u4e2d\u5fc3\u56fe\u50cf\u5750\u6807\uff0cl \u8868\u793a\u4e3a\u7269\u4f53\u957f\u5ea6\uff0cw \u8868\u793a\u4e3a\u7269\u4f53\u5bbd\u5ea6\u3002 \u6b64\u5916\uff0c\u8fd8\u5c06\u6807\u6ce8\u7269\u4f53\u5212\u5206\u4e3a\u4e86\u4e24\u4e2a\u96be\u5ea6\uff1aLEVEL_2 \u4e3a\u7269\u4f53\u5bf9\u5e94\u6fc0\u5149\u96f7\u8fbe\u70b9\u6570\u5c11\u4e8e 5 \u4e2a\uff0c\u5176\u4f59\u5219\u5212\u5206\u4e3a LEVEL_1\u3002","title":"Ground Truth Labels"},{"location":"cv/dataset/waymo/#tasks","text":"\u6570\u636e\u96c6\u4efb\u52a1\u5212\u5206\u4e3a2D\u548c3D\u7269\u4f53\u68c0\u6d4b\u548c\u8ffd\u8e2a\u4efb\u52a1\uff0c\u8bad\u7ec3\u96c6\u573a\u666f\u6709798\u4e2a\uff0c\u9a8c\u8bc1\u96c6\u573a\u666f\u6709202\u4e2a\uff0c\u6d4b\u8bd5\u96c6\u573a\u666f\u6709150\u4e2a\u3002","title":"Tasks"},{"location":"cv/dataset/waymo/#experiments","text":"\u5bf9\u4e8e 3D \u7269\u4f53\u68c0\u6d4b\uff0cWaymo \u63d0\u4f9b\u4e86\u4e00\u4e2a Baseline\uff0c\u5176\u4f7f\u7528\u7684\u68c0\u6d4b\u65b9\u6cd5\u662f PointPillars\u3002\u5bf9\u4e8e 2D \u7269\u4f53\u68c0\u6d4b\uff0c\u4f7f\u7528\u4e86 Faster R-CNN \u4f5c\u4e3a baseline\uff0c\u5bf9\u4e8e3D\u7269\u4f53\u8ffd\u8e2a\uff0c\u4f7f\u7528\u4e86 AB3DMOT \u4f5c\u4e3a Baseline\u3002","title":"Experiments"},{"location":"cv/dataset/waymo/#waymo-coco","text":"https://github.com/shinya7y/WaymoCOCO","title":"Waymo \u8f6c\u6362 COCO \u683c\u5f0f"},{"location":"cv/dataset/waymo/#reference","text":"Waymo\u81ea\u52a8\u9a7e\u9a76\u6570\u636e\u96c6\u4ecb\u7ecd\u4e0e\u4f7f\u7528\u6559 Waymo\u6570\u636e\u96c6\u4e0b\u8f7d\u4e0e\u4f7f\u7528 WAYMO \u6570\u636e\u96c6","title":"Reference"},{"location":"cv/mvg/","text":"\u591a\u89c6\u56fe\u51e0\u4f55 \u00b6 Abstract \u8fd9\u91cc\u603b\u7ed3\u4e00\u4e9b\u5b66\u4e60\u591a\u89c6\u56fe\u51e0\u4f55\u65f6\u7684\u7b14\u8bb0 \u4e3a\u4e09\u7ef4\u7a7a\u95f4\u8bc6\u522b\u6253\u57fa\u7840 Table of Contents \u00b6 2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 \u6444\u50cf\u673a\u6a21\u578b \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P \u5355\u89c6\u56fe\u51e0\u4f55 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 Reference \u00b6 \u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u7684\u591a\u89c6\u56fe\u51e0\u4f55-\u7b2c\u4e00\u7248-\u4e2d\u6587\u5b8c\u6574\u7248.pdf Multiple View Geometry\uff08\u591a\u89c6\u56fe\u51e0\u4f55\uff09\u5b66\u4e60\u7b14\u8bb0 \u591a\u89c6\u56fe\u51e0\u4f55\u5b66(Multiple View Geometry)\u8bfb\u4e66\u7b14\u8bb0\u76ee\u5f55","title":"\u591a\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/#_1","text":"Abstract \u8fd9\u91cc\u603b\u7ed3\u4e00\u4e9b\u5b66\u4e60\u591a\u89c6\u56fe\u51e0\u4f55\u65f6\u7684\u7b14\u8bb0 \u4e3a\u4e09\u7ef4\u7a7a\u95f4\u8bc6\u522b\u6253\u57fa\u7840","title":"\u591a\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/#table-of-contents","text":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 \u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 \u6444\u50cf\u673a\u6a21\u578b \u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P \u5355\u89c6\u56fe\u51e0\u4f55 \u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 \u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784","title":"Table of Contents"},{"location":"cv/mvg/#reference","text":"\u8ba1\u7b97\u673a\u89c6\u89c9\u4e2d\u7684\u591a\u89c6\u56fe\u51e0\u4f55-\u7b2c\u4e00\u7248-\u4e2d\u6587\u5b8c\u6574\u7248.pdf Multiple View Geometry\uff08\u591a\u89c6\u56fe\u51e0\u4f55\uff09\u5b66\u4e60\u7b14\u8bb0 \u591a\u89c6\u56fe\u51e0\u4f55\u5b66(Multiple View Geometry)\u8bfb\u4e66\u7b14\u8bb0\u76ee\u5f55","title":"Reference"},{"location":"cv/mvg/3dr-camera-structure/","text":"\u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784 \u00b6 \u7ea6 2125 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u91cd\u6784\u7684\u4efb\u52a1\u662f\u6c42\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \uff0c\u4ee5\u53ca 3D \u4e2d\u7684\u70b9 \\(\\mathbf{X}_i\\) \uff0c\u4f7f\u5f97\u5bf9\u6240\u6709 i\uff0c\u6709 \\[ \\mathbf{x}_i=P \\mathbf{X}_i \\ \\ \\ \\ \\ \\ \\mathbf{x}_i^\\prime=P^\\prime \\mathbf{X}_i \\] \u91cd\u6784\u65b9\u6cd5\u6982\u8ff0 \u00b6 \u7531\u4e24\u89c6\u56fe\u91cd\u6784\u7684\u4e00\u79cd\u65b9\u6cd5\uff1a \u7531\u5bf9\u5e94\u70b9\u8ba1\u7b97\u57fa\u672c\u77e9\u9635 \u7531\u57fa\u672c\u77e9\u9635\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 \u9488\u5bf9\u6bcf\u7ec4\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u7a7a\u95f4\u4e2d\u6620\u5c04\u5230\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5230\u70b9 \u91cd\u6784\u7684\u591a\u4e49\u6027 \u00b6 \u82e5\u6ca1\u6709\u666f\u7269\u5728\u67d0\u4e2a 3D \u5750\u6807\u7cfb\u4e0b\u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u4e00\u822c\u4e0d\u53ef\u80fd\u4ece\u4e00\u5bf9\u89c6\u56fe\uff08\u6216\u4e8b\u5b9e\u4e0a\u4ece\u4efb\u610f\u6570\u76ee\u7684\u89c6\u56fe\uff09\u91cd\u6784\u8be5\u666f\u7269\u7684\u7edd\u5bf9\u4f4d\u7f6e\u548c\u671d\u5411\u3002\u4ec5\u7531\u56fe\u50cf\u6765\u786e\u5b9a\u666f\u7269\u5c31\u8981\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\uff08\u65cb\u8f6c\u3001\u5e73\u79fb\u548c\u7f29\u653e\uff09 \u5c04\u5f71\u591a\u4e49\u6027 \uff1a\u5982\u679c\u65e2\u4e0d\u77e5\u9053\u4efb\u4f55\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u4e5f\u4e0d\u77e5\u9053\u4e00\u4e2a\u6444\u50cf\u673a\u4e0e\u53e6\u4e00\u4e2a\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u90a3\u4e48\u91cd\u6784\u7684\u591a\u4e49\u6027\u7531\u4e00\u4e2a\u4efb\u610f\u5c04\u5f71\u53d8\u6362\u8868\u793a \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u6709\u5e73\u79fb\u8fd0\u52a8\uff0c\u4f46\u6807\u5b9a\u4e0d\u53d8\uff0c\u5219\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362\u4e0b\u91cd\u6784 \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u9664\u4e86\u7126\u8ddd\u5916\u90fd\u4ee5\u6807\u5b9a\uff0c\u5219\u4ecd\u7136\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u4e0b\u91cd\u6784 \u5c04\u5f71\u91cd\u6784\u5b9a\u7406 \u00b6 \u5982\u679c\u4e24\u5e45\u89c6\u56fe\u7684\u4e00\u4e2a\u70b9\u5bf9\u5e94\u96c6\u552f\u4e00\u5730\u786e\u5b9a\u4e86\u57fa\u672c\u77e9\u9635\uff0c\u5219\u666f\u7269\u548c\u6444\u50cf\u673a\u53ef\u4ee5\u4ec5\u7531\u8fd9\u4e9b\u5bf9\u5e94\u91cd\u6784\uff0c\u800c\u4e14\u7531\u8fd9\u4e9b\u5bf9\u5e94\u4ea7\u751f\u7684\u4efb\u4f55\u4e24\u4e2a\u91cd\u6784\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684 * \u5c04\u5f71\u91cd\u6784\u5b9a\u5b9a\u7406 \uff1a\u5047\u5b9a \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u70b9\u4e4b\u95f4\u5bf9\u5e94\u7684\u96c6\u5408\u800c\u4e14\u57fa\u672c\u77e9\u9635 F \u7531\u6761\u4ef6 \\(\\mathbf{x}_i^{\\prime \\top} F \\mathbf{x}_i=0\\) \uff08\u5bf9\u6240\u6709 i \u6210\u7acb\uff09\u552f\u4e00\u5730\u786e\u5b9a\u3002\u4ee4 \\((P_1,P_1^\\prime,\\{\\mathbf{X}_{1i}\\})\\) \u548c \\((P_2,P_2^\\prime,\\{\\mathbf{X}_{2i}\\})\\) \u4e3a\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u4e24\u4e2a\u91cd\u6784\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u77e9\u9635 H \u4f7f\u5f97 \\(P_2=P_1H^{-1},P_2^\\prime=P_1^\\prime H^{-1}\\) \u5e76\u4e14\u9664\u4e86\u4f7f\u5f97 \\(F\\mathbf{x}_i=F^\\top \\mathbf{x}_i^\\prime=\\mathbf{0}\\) \u7684\u90a3\u4e9b i \u5916\uff0c\u5bf9\u5176\u4f59\u6bcf\u4e2a i \u90fd\u6709 \\(\\mathbf{X}_{2i}=H\\mathbf{X}_{1i}\\) \u5206\u5c42\u91cd\u6784 \u00b6 \u4eff\u5c04\u91cd\u6784 \u00b6 \u4eff\u5c04\u91cd\u6784\u7684\u672c\u8d28\u662f\u7528\u67d0\u4e9b\u65b9\u6cd5\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u56e0\u4e3a\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\u7b49\u4ef7\u4e8e\u4eff\u5c04\u91cd\u6784\u3002\u5bfb\u627e\u4f7f \\(\\pi\\) \u6620\u5c04\u5230 \\((0,0,0,1)^\\top\\) \uff0c\u53ef\u4ee5\u628a \\(H^{-\\top}\\) \u4f5c\u4e3a Houscholder \u77e9\u9635\u6765\u8ba1\u7b97 \u5e73\u79fb\u8fd0\u52a8 \u6444\u50cf\u673a\u4f5c\u7eaf\u5e73\u79fb\u8fd0\u52a8\u65f6\uff0c\u53ef\u4ee5\u7531\u4e24\u5e45\u89c6\u56fe\u5b9e\u73b0\u4eff\u5c04\u91cd\u6784\u3002\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u4e00\u70b9 \\(\\mathbf{X}\\) \u5728\u7531\u6444\u50cf\u673a\u5e73\u79fb\u6240\u4ea7\u751f\u7684\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u540c\u4e00\u70b9\u3002\u7ed9\u5b9a\u4e00\u4e2a\u5c04\u5f71\u91cd\u6784\uff0c\u53ef\u4ee5\u91cd\u6784\u5bf9\u5e94\u4e8e\u5339\u914d \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u70b9 \\(\\mathbf{X}_i\\) \u3002\u70b9 \\(\\mathbf{X}_i\\) \u5c06\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u3002\u4ece\u4e09\u7ec4\u8fd9\u6837\u7684\u70b9\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\u2014\u2014\u8db3\u591f\u552f\u4e00\u5730\u628a\u5b83\u786e\u5b9a \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u4e14\u5185\u53c2\u4fdd\u6301\u4e0d\u53d8\u7684\u4e00\u4e2a\u7eaf\u5e73\u79fb\u8fd0\u52a8\uff0c\u5219 \\(F=[\\mathbf{e}]_\\times = [\\mathbf{e}^\\prime]_\\times\\) \uff0c\u5e76\u4e14\u4f5c\u4e3a\u4eff\u5c04\u91cd\u6784\u53ef\u9009\u7684\u4e24\u4e2a\u6444\u50cf\u673a\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[I|\\mathbf{e}^\\prime]\\) \u666f\u7269\u7ea6\u675f \uff1a\u666f\u7269\u7ea6\u675f\u6216\u6761\u4ef6\u4e5f\u53ef\u4ee5\u7528\u6765\u83b7\u5f97\u4eff\u5c04\u91cd\u6784\uff0c\u53ea\u8981\u80fd\u591f\u8fa8\u8ba4\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\uff0c\u8be5\u5e73\u9762\u5c31\u53ef\u4ee5\u8fa8\u8ba4\uff0c\u5e76\u4e14\u8be5\u91cd\u6784\u53ef\u4ee5\u53d8\u6362\u5230\u4eff\u5c04\u91cd\u6784 \u5e73\u884c\u76f4\u7ebf \uff1a\u6700\u660e\u663e\u7684\u6761\u4ef6\u662f\u77e5\u9053\u67d0\u4e9b 3D \u76f4\u7ebf\u5b9e\u9645\u662f\u5e73\u884c\u7684\u3002\u7a7a\u95f4\u4e24\u6761\u5e73\u884c\u76f4\u7ebf\u7684\u4ea4\u70b9\u7ed9\u51fa\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e00\u4e2a\u70b9\uff0c\u8be5\u4ea4\u70b9\u7684\u56fe\u50cf\u662f\u8fd9\u5bf9\u5e73\u884c\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4e14\u662f\u4e24\u6761\u50cf\u76f4\u7ebf\u7684\u4ea4\u70b9\u3002\u5047\u8bbe\u5728\u666f\u7269\u4e2d\u80fd\u591f\u786e\u5b9a\u4e09\u5bf9\u5e73\u884c\u76f4\u7ebf\u3002\u6bcf\u5bf9\u76f8\u4ea4\u4e8e\u65e0\u7a77\u8fdc\u5e73\u800c\u4e0a\u7684\u4e00\u70b9\uff0c\u5982\u679c\u6bcf\u5bf9\u6709\u4e0d\u540c\u7684\u65b9\u5411\uff0c\u5219\u4e09\u70b9\u5c06\u4e0d\u540c\u3002\u56e0\u4e3a\u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762\uff0c\u6545\u8fd9\u4e2a\u4fe1\u606f\u8db3\u591f\u786e\u5b9a\u5e73\u9762 \\(\\pi\\) \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4\u7387 \uff1a\u8fd0\u52a8\u666f\u7269\u4eff\u5c04\u957f\u5ea6\u6bd4\u7387\u4e0d\u53d8\u7684\u77e5\u8bc6\u8ba1\u7b97\u6d88\u5f71\u70b9 \u65e0\u7a77\u5355\u5e94 \uff1a\u5982\u679c\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784\u5df2\u5f97\u5230\u5e76\u4e14\u5176\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M^\\prime|\\mathbf{e}^\\prime]\\) \uff0c\u5219\u65e0\u7a77\u5355\u5e94\u662f \\(H_\\infty=M^\\prime\\) \u3002\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u5df2\u5f97\u5230\u65e0\u7a77\u5355\u5e94 \\(H_\\infty\\) \uff0c\u5219\u4eff\u5c04\u91cd\u6784\u7684\u6444\u50cf\u673a\u53ef\u4ee5\u53d6\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[H_\\infty|\\mathbf{e}^\\prime]\\) \u5176\u4e2d\u4e00\u4e2a\u662f\u4eff\u5c04\u6444\u50cf\u673a\u7684\u60c5\u5f62 \uff1a\u82e5 \\((P,P^\\prime,\\{\\mathbf{X}_i\\})\\) \u662f\u4ece\u4e00\u70b9\u5bf9\u5e94\u96c6\u5f97\u5230\u7684\u5c04\u5f71\u91cd\u6784\u4e14 \\(P=[I|\\mathbf{0}]\\) \u3002\u82e5\u5df2\u77e5 \\(P\\) \u4e8b\u5b9e\u4e0a\u662f\u4e00\u4e2a\u4eff\u5c04\u6444\u50cf\u673a\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u4ea4\u6362 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u6700\u540e\u4e24\u4e2a\u5217\u548c\u6bcf\u4e00\u4e2a \\(\\mathbf{X}_i\\) \u7684\u6700\u540e\u4e24\u4e2a\u5750\u6807\u800c\u5f97\u5230\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784 \u5ea6\u91cf\u91cd\u6784 \u00b6 \u4eff\u5c04\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u800c\u5ea6\u6700\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u82e5\u5df2\u77e5\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u67d0\u5e45\u56fe\u50cf\u4e2d\u7684\u50cf\u662f \\(\\omega\\) \uff0c\u4e14\u5df2\u77e5\u4eff\u5c04\u91cd\u6784\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[M|\\mathbf{m}]\\) \uff0c\u5219\u7528\u5f62\u5982 \\(H=\\begin{bmatrix} A^{-1} & \\\\ & 1 \\end{bmatrix}\\) \u7684 3D \u53d8\u6362\uff0c\u53ef\u4ee5\u628a\u4eff\u5c04\u91cd\u6784\u53d8\u6362\u5230\u5ea6\u91cf\u91cd\u6784\uff0c\u5176\u4e2d \\(A\\) \u7531\u65b9\u7a0b \\(AA^\\top=(M^\\top \\omega M)^{-1}\\) \u7684 Cholesky \u5206\u89e3\u5f97\u5230 Cholesky \u5206\u89e3 Cholesky \u5206\u89e3\u662f\u628a\u4e00\u4e2a\u5bf9\u79f0\u6b63\u5b9a\u7684\u77e9\u9635\u8868\u793a\u6210\u4e00\u4e2a\u4e0b\u4e09\u89d2\u77e9\u9635 \\(L\\) \u548c\u5176\u8f6c\u7f6e\u7684\u4e58\u79ef\u7684\u5206\u89e3\u3002\u5b83\u8981\u6c42\u77e9\u9635\u7684\u6240\u6709\u7279\u5f81\u503c\u5fc5\u987b\u5927\u4e8e\u96f6\uff0c\u6545\u5206\u89e3\u7684\u4e0b\u4e09\u89d2\u7684\u5bf9\u89d2\u5143\u4e5f\u662f\u5927\u4e8e\u96f6\u7684\u3002Cholesky \u5206\u89e3\u6cd5\u53c8\u79f0\u5e73\u65b9\u6839\u6cd5\uff0c\u662f\u5f53 \\(A\\) \u4e3a\u5b9e\u5bf9\u79f0\u6b63\u5b9a\u77e9\u9635\u65f6\uff0c \\(LU\\) \u4e09\u89d2\u5206\u89e3\u6cd5\u7684\u53d8\u5f62\u3002 \u666f\u7269\u6b63\u4ea4\u7684\u7ea6\u675f \uff1a\u666f\u7269\u7684\u6b63\u4ea4\u76f4\u7ebf\u7684\u4e00\u5bf9\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e00\u4e2a\u7ebf\u6027\u7ea6\u675f: \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2 = 0\\) \u3002\u7c7b\u4f3c\u5730\uff0c\u6765\u81ea\u4e00\u4e2a\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u548c\u4e0e\u4e4b\u5782\u76f4\u7684\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \\(\\mathbf{l}\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e24\u4e2a\u7ea6\u675f \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \uff0c\u4e00\u4e2a\u5e38\u7528\u7684\u4f8b\u5b50\u662f\u5782\u76f4\u65b9\u5411\u7684\u6d88\u5f71\u70b9\u548c\u6c34\u5e73\u5730\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \u5df2\u77e5\u5185\u53c2\u6570\u7684\u7ea6\u675f \uff1a\u5982\u679c\u6444\u50cf\u673a\u77e9\u9635\u7684\u6807\u5b9a\u77e9\u9635\u7b49\u4e8e \\(K\\) \uff0c\u5219\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u50cf\u662f \\(\\omega=K^{-\\top}K^{-1}\\) \u3002\u56e0\u6b64\u5305\u62ec\u5728 \\(K\\) \u4e2d\u7684\u6444\u50cf\u673a\u5185\u53c2\u6570\u4fe1\u606f\u53ef\u4ee5\u7528\u6765\u7ea6\u675f\u6216\u786e\u5b9a \\(\\omega\\) \u7684\u5143\u7d20\u3002\u5728\u5df2\u77e5 \\(K\\) \u7684\u626d\u66f2\u56e0\u5b50\u4e3a\u96f6\uff08 \\(s=0\\) \uff09\u65f6\u6709 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u82e5\u50cf\u7d20\u8fd8\u662f\u6b63\u65b9\u5f62\uff08\u96f6\u626d\u66f2\u53c2\u6570\u4e14 \\(\\alpha_x=\\alpha_y\\) \uff09\uff0c\u5219 \\(\\omega_{11}=\\omega_{22}\\) \u540c\u4e00\u6444\u50cf\u673a\u5728\u591a\u5e45\u56fe\u50cf\u4e2d\u7684\u7ea6\u675f \uff1a\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4e00\u4e2a\u6027\u8d28\u662f\u5b83\u5728\u56fe\u50cf\u4e0a\u7684\u6295\u5f71\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u800c\u4e0d\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u4f4d\u7f6e\u548c\u65b9\u5411\u3002\u5f53\u4e24\u4e2a\u6444\u50cf\u673a\u5177\u6709\u76f8\u540c\u7684\u6807\u5b9a\u77e9\u9635\u65f6(\u901a\u5e38\u610f\u5473\u7740\u540c\u4e00\u6444\u50cf\u673a\u5728\u4e0d\u540c\u4f4d\u7f6e\u62cd\u6444\u7684\u4e24\u5e45\u56fe\u50cf)\u5219\u6709 \\(\\omega=\\omega^\\prime\\) \uff0c\u5373\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u76f8\u540c\u7684\uff0c\u7ed9\u5b9a\u8db3\u591f\u591a\u7684\u56fe\u50cf\uff0c\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u6027\u8d28\u4ece\u4eff\u5c04\u91cd\u6784\u5f97\u5230\u5ea6\u91cf\u91cd\u6784 \u5229\u7528 \\(\\omega\\) \u76f4\u63a5\u5ea6\u91cf\u91cd\u6784 \u00b6 \u6700\u660e\u663e\u7684\u65b9\u6cd5\u662f\u5229\u7528IAC\uff08\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\uff09\u6765\u8ba1\u7b97\u6bcf\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5df1\u77e5\u6807\u5b9a\u4e0b\u7684\u91cd\u6784 \u53e6\u4e00\u4e2a\u66f4\u6982\u5ff5\u6027\u7684\u65b9\u6cd5\u662f\u8fd0\u7528IAC\u7684\u4fe1\u606f\u76f4\u63a5\u786e\u5b9a\u65e0\u7a77\u8fdc\u5e73\u9762\u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u76f4\u63a5\u91cd\u6784\u2014\u2014\u5229\u7528\u5730\u9762\u77e5\u8bc6 \u00b6 \u5728\u5c04\u5f71\u91cd\u6784\u4e0b\uff0c\u63a7\u5236\u70b9 \\(\\{\\mathbf{X}_i\\}\\) \u7684 3D \u4f4d\u7f6e\u53ef\u4ee5\u6709\u5b83\u4eec\u56fe\u50cf\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u6765\u8ba1\u7b97\u3002\u56e0\u4e3a\u8be5\u5c04\u5f71\u91cd\u6784\u901a\u8fc7\u4e00\u4e2a\u5355\u5e94\u8054\u7cfb\u4e8e\u771f\u6b63\u7684\u91cd\u6784\uff1a \\(\\mathbf{X}_{Ei}=H\\mathbf{X}_i, i=1,...,n\\) \u6bcf\u7ec4\u70b9\u5bf9\u5e94\u63d0\u4f9b\u5173\u4e8e H \u5143\u7d20\u7684\u4e09\u4e2a\u72ec\u7acb\u7ebf\u6027\u65b9\u7a0b\u3002\u56e0\u4e3a H \u6709 15 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6545\u82e5\u63d0\u4f9b \\(n \\ge 5\\) \u7ec4\uff08\u4e14\u6ca1\u6709\u56db\u4e2a\u63a7\u5236\u70b9\u662f\u5171\u9762\u7684\uff09\u70b9\u5bf9\u5e94\uff0c\u4fbf\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7ebf\u6027\u89e3 \u53e6\u4e00\u79cd\u65b9\u6cd5\u53ef\u4ee5\u4e0d\u8ba1\u7b97 \\(\\mathbf{X}_i\\) \u800c\u901a\u8fc7\u628a\u5df2\u77e5\u7684\u5730\u9762\u63a7\u5236\u70b9\u76f4\u63a5\u4e0e\u56fe\u50cf\u7684\u5ea6\u91cf\u76f8\u8054\u7cfb\u7684\u9014\u5f84\u6765\u8ba1\u7b97 H\u3002\u56e0\u6b64\u7c7b\u4f3c\u4e8e\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635\u7684 \\(DLT\\) \u7b97\u6cd5\uff1a \\(\\mathbf{x}_i = PH^{-1} \\mathbf{X}_{Ei}\\)","title":"\u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#3d","text":"\u7ea6 2125 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u91cd\u6784\u7684\u4efb\u52a1\u662f\u6c42\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \uff0c\u4ee5\u53ca 3D \u4e2d\u7684\u70b9 \\(\\mathbf{X}_i\\) \uff0c\u4f7f\u5f97\u5bf9\u6240\u6709 i\uff0c\u6709 \\[ \\mathbf{x}_i=P \\mathbf{X}_i \\ \\ \\ \\ \\ \\ \\mathbf{x}_i^\\prime=P^\\prime \\mathbf{X}_i \\]","title":"\u6444\u50cf\u673a\u548c\u7ed3\u6784\u7684 3D \u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_1","text":"\u7531\u4e24\u89c6\u56fe\u91cd\u6784\u7684\u4e00\u79cd\u65b9\u6cd5\uff1a \u7531\u5bf9\u5e94\u70b9\u8ba1\u7b97\u57fa\u672c\u77e9\u9635 \u7531\u57fa\u672c\u77e9\u9635\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 \u9488\u5bf9\u6bcf\u7ec4\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u7a7a\u95f4\u4e2d\u6620\u5c04\u5230\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5230\u70b9","title":"\u91cd\u6784\u65b9\u6cd5\u6982\u8ff0"},{"location":"cv/mvg/3dr-camera-structure/#_2","text":"\u82e5\u6ca1\u6709\u666f\u7269\u5728\u67d0\u4e2a 3D \u5750\u6807\u7cfb\u4e0b\u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u4e00\u822c\u4e0d\u53ef\u80fd\u4ece\u4e00\u5bf9\u89c6\u56fe\uff08\u6216\u4e8b\u5b9e\u4e0a\u4ece\u4efb\u610f\u6570\u76ee\u7684\u89c6\u56fe\uff09\u91cd\u6784\u8be5\u666f\u7269\u7684\u7edd\u5bf9\u4f4d\u7f6e\u548c\u671d\u5411\u3002\u4ec5\u7531\u56fe\u50cf\u6765\u786e\u5b9a\u666f\u7269\u5c31\u8981\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\uff08\u65cb\u8f6c\u3001\u5e73\u79fb\u548c\u7f29\u653e\uff09 \u5c04\u5f71\u591a\u4e49\u6027 \uff1a\u5982\u679c\u65e2\u4e0d\u77e5\u9053\u4efb\u4f55\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u4e5f\u4e0d\u77e5\u9053\u4e00\u4e2a\u6444\u50cf\u673a\u4e0e\u53e6\u4e00\u4e2a\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u90a3\u4e48\u91cd\u6784\u7684\u591a\u4e49\u6027\u7531\u4e00\u4e2a\u4efb\u610f\u5c04\u5f71\u53d8\u6362\u8868\u793a \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u6709\u5e73\u79fb\u8fd0\u52a8\uff0c\u4f46\u6807\u5b9a\u4e0d\u53d8\uff0c\u5219\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362\u4e0b\u91cd\u6784 \u5982\u679c\u4e24\u4e2a\u6444\u50cf\u673a\u9664\u4e86\u7126\u8ddd\u5916\u90fd\u4ee5\u6807\u5b9a\uff0c\u5219\u4ecd\u7136\u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u4e0b\u91cd\u6784","title":"\u91cd\u6784\u7684\u591a\u4e49\u6027"},{"location":"cv/mvg/3dr-camera-structure/#_3","text":"\u5982\u679c\u4e24\u5e45\u89c6\u56fe\u7684\u4e00\u4e2a\u70b9\u5bf9\u5e94\u96c6\u552f\u4e00\u5730\u786e\u5b9a\u4e86\u57fa\u672c\u77e9\u9635\uff0c\u5219\u666f\u7269\u548c\u6444\u50cf\u673a\u53ef\u4ee5\u4ec5\u7531\u8fd9\u4e9b\u5bf9\u5e94\u91cd\u6784\uff0c\u800c\u4e14\u7531\u8fd9\u4e9b\u5bf9\u5e94\u4ea7\u751f\u7684\u4efb\u4f55\u4e24\u4e2a\u91cd\u6784\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684 * \u5c04\u5f71\u91cd\u6784\u5b9a\u5b9a\u7406 \uff1a\u5047\u5b9a \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u70b9\u4e4b\u95f4\u5bf9\u5e94\u7684\u96c6\u5408\u800c\u4e14\u57fa\u672c\u77e9\u9635 F \u7531\u6761\u4ef6 \\(\\mathbf{x}_i^{\\prime \\top} F \\mathbf{x}_i=0\\) \uff08\u5bf9\u6240\u6709 i \u6210\u7acb\uff09\u552f\u4e00\u5730\u786e\u5b9a\u3002\u4ee4 \\((P_1,P_1^\\prime,\\{\\mathbf{X}_{1i}\\})\\) \u548c \\((P_2,P_2^\\prime,\\{\\mathbf{X}_{2i}\\})\\) \u4e3a\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u4e24\u4e2a\u91cd\u6784\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u77e9\u9635 H \u4f7f\u5f97 \\(P_2=P_1H^{-1},P_2^\\prime=P_1^\\prime H^{-1}\\) \u5e76\u4e14\u9664\u4e86\u4f7f\u5f97 \\(F\\mathbf{x}_i=F^\\top \\mathbf{x}_i^\\prime=\\mathbf{0}\\) \u7684\u90a3\u4e9b i \u5916\uff0c\u5bf9\u5176\u4f59\u6bcf\u4e2a i \u90fd\u6709 \\(\\mathbf{X}_{2i}=H\\mathbf{X}_{1i}\\)","title":"\u5c04\u5f71\u91cd\u6784\u5b9a\u7406"},{"location":"cv/mvg/3dr-camera-structure/#_4","text":"","title":"\u5206\u5c42\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_5","text":"\u4eff\u5c04\u91cd\u6784\u7684\u672c\u8d28\u662f\u7528\u67d0\u4e9b\u65b9\u6cd5\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u56e0\u4e3a\u5b9a\u4f4d\u65e0\u7a77\u8fdc\u5e73\u9762\u7b49\u4ef7\u4e8e\u4eff\u5c04\u91cd\u6784\u3002\u5bfb\u627e\u4f7f \\(\\pi\\) \u6620\u5c04\u5230 \\((0,0,0,1)^\\top\\) \uff0c\u53ef\u4ee5\u628a \\(H^{-\\top}\\) \u4f5c\u4e3a Houscholder \u77e9\u9635\u6765\u8ba1\u7b97 \u5e73\u79fb\u8fd0\u52a8 \u6444\u50cf\u673a\u4f5c\u7eaf\u5e73\u79fb\u8fd0\u52a8\u65f6\uff0c\u53ef\u4ee5\u7531\u4e24\u5e45\u89c6\u56fe\u5b9e\u73b0\u4eff\u5c04\u91cd\u6784\u3002\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u4e00\u70b9 \\(\\mathbf{X}\\) \u5728\u7531\u6444\u50cf\u673a\u5e73\u79fb\u6240\u4ea7\u751f\u7684\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u540c\u4e00\u70b9\u3002\u7ed9\u5b9a\u4e00\u4e2a\u5c04\u5f71\u91cd\u6784\uff0c\u53ef\u4ee5\u91cd\u6784\u5bf9\u5e94\u4e8e\u5339\u914d \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u7684\u70b9 \\(\\mathbf{X}_i\\) \u3002\u70b9 \\(\\mathbf{X}_i\\) \u5c06\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u3002\u4ece\u4e09\u7ec4\u8fd9\u6837\u7684\u70b9\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\u2014\u2014\u8db3\u591f\u552f\u4e00\u5730\u628a\u5b83\u786e\u5b9a \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u4e14\u5185\u53c2\u4fdd\u6301\u4e0d\u53d8\u7684\u4e00\u4e2a\u7eaf\u5e73\u79fb\u8fd0\u52a8\uff0c\u5219 \\(F=[\\mathbf{e}]_\\times = [\\mathbf{e}^\\prime]_\\times\\) \uff0c\u5e76\u4e14\u4f5c\u4e3a\u4eff\u5c04\u91cd\u6784\u53ef\u9009\u7684\u4e24\u4e2a\u6444\u50cf\u673a\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[I|\\mathbf{e}^\\prime]\\) \u666f\u7269\u7ea6\u675f \uff1a\u666f\u7269\u7ea6\u675f\u6216\u6761\u4ef6\u4e5f\u53ef\u4ee5\u7528\u6765\u83b7\u5f97\u4eff\u5c04\u91cd\u6784\uff0c\u53ea\u8981\u80fd\u591f\u8fa8\u8ba4\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e09\u4e2a\u70b9\uff0c\u8be5\u5e73\u9762\u5c31\u53ef\u4ee5\u8fa8\u8ba4\uff0c\u5e76\u4e14\u8be5\u91cd\u6784\u53ef\u4ee5\u53d8\u6362\u5230\u4eff\u5c04\u91cd\u6784 \u5e73\u884c\u76f4\u7ebf \uff1a\u6700\u660e\u663e\u7684\u6761\u4ef6\u662f\u77e5\u9053\u67d0\u4e9b 3D \u76f4\u7ebf\u5b9e\u9645\u662f\u5e73\u884c\u7684\u3002\u7a7a\u95f4\u4e24\u6761\u5e73\u884c\u76f4\u7ebf\u7684\u4ea4\u70b9\u7ed9\u51fa\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u4e00\u4e2a\u70b9\uff0c\u8be5\u4ea4\u70b9\u7684\u56fe\u50cf\u662f\u8fd9\u5bf9\u5e73\u884c\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4e14\u662f\u4e24\u6761\u50cf\u76f4\u7ebf\u7684\u4ea4\u70b9\u3002\u5047\u8bbe\u5728\u666f\u7269\u4e2d\u80fd\u591f\u786e\u5b9a\u4e09\u5bf9\u5e73\u884c\u76f4\u7ebf\u3002\u6bcf\u5bf9\u76f8\u4ea4\u4e8e\u65e0\u7a77\u8fdc\u5e73\u800c\u4e0a\u7684\u4e00\u70b9\uff0c\u5982\u679c\u6bcf\u5bf9\u6709\u4e0d\u540c\u7684\u65b9\u5411\uff0c\u5219\u4e09\u70b9\u5c06\u4e0d\u540c\u3002\u56e0\u4e3a\u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762\uff0c\u6545\u8fd9\u4e2a\u4fe1\u606f\u8db3\u591f\u786e\u5b9a\u5e73\u9762 \\(\\pi\\) \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4\u7387 \uff1a\u8fd0\u52a8\u666f\u7269\u4eff\u5c04\u957f\u5ea6\u6bd4\u7387\u4e0d\u53d8\u7684\u77e5\u8bc6\u8ba1\u7b97\u6d88\u5f71\u70b9 \u65e0\u7a77\u5355\u5e94 \uff1a\u5982\u679c\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784\u5df2\u5f97\u5230\u5e76\u4e14\u5176\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M^\\prime|\\mathbf{e}^\\prime]\\) \uff0c\u5219\u65e0\u7a77\u5355\u5e94\u662f \\(H_\\infty=M^\\prime\\) \u3002\u53cd\u8fc7\u6765\uff0c\u5982\u679c\u5df2\u5f97\u5230\u65e0\u7a77\u5355\u5e94 \\(H_\\infty\\) \uff0c\u5219\u4eff\u5c04\u91cd\u6784\u7684\u6444\u50cf\u673a\u53ef\u4ee5\u53d6\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[H_\\infty|\\mathbf{e}^\\prime]\\) \u5176\u4e2d\u4e00\u4e2a\u662f\u4eff\u5c04\u6444\u50cf\u673a\u7684\u60c5\u5f62 \uff1a\u82e5 \\((P,P^\\prime,\\{\\mathbf{X}_i\\})\\) \u662f\u4ece\u4e00\u70b9\u5bf9\u5e94\u96c6\u5f97\u5230\u7684\u5c04\u5f71\u91cd\u6784\u4e14 \\(P=[I|\\mathbf{0}]\\) \u3002\u82e5\u5df2\u77e5 \\(P\\) \u4e8b\u5b9e\u4e0a\u662f\u4e00\u4e2a\u4eff\u5c04\u6444\u50cf\u673a\uff0c\u5219\u53ef\u4ee5\u901a\u8fc7\u4ea4\u6362 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u6700\u540e\u4e24\u4e2a\u5217\u548c\u6bcf\u4e00\u4e2a \\(\\mathbf{X}_i\\) \u7684\u6700\u540e\u4e24\u4e2a\u5750\u6807\u800c\u5f97\u5230\u4e00\u4e2a\u4eff\u5c04\u91cd\u6784","title":"\u4eff\u5c04\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_6","text":"\u4eff\u5c04\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u65e0\u7a77\u8fdc\u5e73\u9762\uff0c\u800c\u5ea6\u6700\u91cd\u6784\u7684\u5173\u952e\u662f\u8fa8\u8ba4\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u82e5\u5df2\u77e5\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u67d0\u5e45\u56fe\u50cf\u4e2d\u7684\u50cf\u662f \\(\\omega\\) \uff0c\u4e14\u5df2\u77e5\u4eff\u5c04\u91cd\u6784\u4e2d\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f \\(P=[M|\\mathbf{m}]\\) \uff0c\u5219\u7528\u5f62\u5982 \\(H=\\begin{bmatrix} A^{-1} & \\\\ & 1 \\end{bmatrix}\\) \u7684 3D \u53d8\u6362\uff0c\u53ef\u4ee5\u628a\u4eff\u5c04\u91cd\u6784\u53d8\u6362\u5230\u5ea6\u91cf\u91cd\u6784\uff0c\u5176\u4e2d \\(A\\) \u7531\u65b9\u7a0b \\(AA^\\top=(M^\\top \\omega M)^{-1}\\) \u7684 Cholesky \u5206\u89e3\u5f97\u5230 Cholesky \u5206\u89e3 Cholesky \u5206\u89e3\u662f\u628a\u4e00\u4e2a\u5bf9\u79f0\u6b63\u5b9a\u7684\u77e9\u9635\u8868\u793a\u6210\u4e00\u4e2a\u4e0b\u4e09\u89d2\u77e9\u9635 \\(L\\) \u548c\u5176\u8f6c\u7f6e\u7684\u4e58\u79ef\u7684\u5206\u89e3\u3002\u5b83\u8981\u6c42\u77e9\u9635\u7684\u6240\u6709\u7279\u5f81\u503c\u5fc5\u987b\u5927\u4e8e\u96f6\uff0c\u6545\u5206\u89e3\u7684\u4e0b\u4e09\u89d2\u7684\u5bf9\u89d2\u5143\u4e5f\u662f\u5927\u4e8e\u96f6\u7684\u3002Cholesky \u5206\u89e3\u6cd5\u53c8\u79f0\u5e73\u65b9\u6839\u6cd5\uff0c\u662f\u5f53 \\(A\\) \u4e3a\u5b9e\u5bf9\u79f0\u6b63\u5b9a\u77e9\u9635\u65f6\uff0c \\(LU\\) \u4e09\u89d2\u5206\u89e3\u6cd5\u7684\u53d8\u5f62\u3002 \u666f\u7269\u6b63\u4ea4\u7684\u7ea6\u675f \uff1a\u666f\u7269\u7684\u6b63\u4ea4\u76f4\u7ebf\u7684\u4e00\u5bf9\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e00\u4e2a\u7ebf\u6027\u7ea6\u675f: \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2 = 0\\) \u3002\u7c7b\u4f3c\u5730\uff0c\u6765\u81ea\u4e00\u4e2a\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u548c\u4e0e\u4e4b\u5782\u76f4\u7684\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \\(\\mathbf{l}\\) \u5bf9 \\(\\omega\\) \u63d0\u4f9b\u4e24\u4e2a\u7ea6\u675f \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \uff0c\u4e00\u4e2a\u5e38\u7528\u7684\u4f8b\u5b50\u662f\u5782\u76f4\u65b9\u5411\u7684\u6d88\u5f71\u70b9\u548c\u6c34\u5e73\u5730\u5e73\u9762\u7684\u6d88\u5f71\u76f4\u7ebf \u5df2\u77e5\u5185\u53c2\u6570\u7684\u7ea6\u675f \uff1a\u5982\u679c\u6444\u50cf\u673a\u77e9\u9635\u7684\u6807\u5b9a\u77e9\u9635\u7b49\u4e8e \\(K\\) \uff0c\u5219\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u50cf\u662f \\(\\omega=K^{-\\top}K^{-1}\\) \u3002\u56e0\u6b64\u5305\u62ec\u5728 \\(K\\) \u4e2d\u7684\u6444\u50cf\u673a\u5185\u53c2\u6570\u4fe1\u606f\u53ef\u4ee5\u7528\u6765\u7ea6\u675f\u6216\u786e\u5b9a \\(\\omega\\) \u7684\u5143\u7d20\u3002\u5728\u5df2\u77e5 \\(K\\) \u7684\u626d\u66f2\u56e0\u5b50\u4e3a\u96f6\uff08 \\(s=0\\) \uff09\u65f6\u6709 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u82e5\u50cf\u7d20\u8fd8\u662f\u6b63\u65b9\u5f62\uff08\u96f6\u626d\u66f2\u53c2\u6570\u4e14 \\(\\alpha_x=\\alpha_y\\) \uff09\uff0c\u5219 \\(\\omega_{11}=\\omega_{22}\\) \u540c\u4e00\u6444\u50cf\u673a\u5728\u591a\u5e45\u56fe\u50cf\u4e2d\u7684\u7ea6\u675f \uff1a\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4e00\u4e2a\u6027\u8d28\u662f\u5b83\u5728\u56fe\u50cf\u4e0a\u7684\u6295\u5f71\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u800c\u4e0d\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u4f4d\u7f6e\u548c\u65b9\u5411\u3002\u5f53\u4e24\u4e2a\u6444\u50cf\u673a\u5177\u6709\u76f8\u540c\u7684\u6807\u5b9a\u77e9\u9635\u65f6(\u901a\u5e38\u610f\u5473\u7740\u540c\u4e00\u6444\u50cf\u673a\u5728\u4e0d\u540c\u4f4d\u7f6e\u62cd\u6444\u7684\u4e24\u5e45\u56fe\u50cf)\u5219\u6709 \\(\\omega=\\omega^\\prime\\) \uff0c\u5373\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u5728\u4e24\u5e45\u56fe\u50cf\u4e0a\u7684\u50cf\u662f\u76f8\u540c\u7684\uff0c\u7ed9\u5b9a\u8db3\u591f\u591a\u7684\u56fe\u50cf\uff0c\u53ef\u4ee5\u5229\u7528\u8fd9\u4e2a\u6027\u8d28\u4ece\u4eff\u5c04\u91cd\u6784\u5f97\u5230\u5ea6\u91cf\u91cd\u6784","title":"\u5ea6\u91cf\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#omega","text":"\u6700\u660e\u663e\u7684\u65b9\u6cd5\u662f\u5229\u7528IAC\uff08\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\uff09\u6765\u8ba1\u7b97\u6bcf\u4e2a\u6444\u50cf\u673a\u7684\u6807\u5b9a\uff0c\u7136\u540e\u518d\u8fdb\u884c\u5df1\u77e5\u6807\u5b9a\u4e0b\u7684\u91cd\u6784 \u53e6\u4e00\u4e2a\u66f4\u6982\u5ff5\u6027\u7684\u65b9\u6cd5\u662f\u8fd0\u7528IAC\u7684\u4fe1\u606f\u76f4\u63a5\u786e\u5b9a\u65e0\u7a77\u8fdc\u5e73\u9762\u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf","title":"\u5229\u7528\\(\\omega\\)\u76f4\u63a5\u5ea6\u91cf\u91cd\u6784"},{"location":"cv/mvg/3dr-camera-structure/#_7","text":"\u5728\u5c04\u5f71\u91cd\u6784\u4e0b\uff0c\u63a7\u5236\u70b9 \\(\\{\\mathbf{X}_i\\}\\) \u7684 3D \u4f4d\u7f6e\u53ef\u4ee5\u6709\u5b83\u4eec\u56fe\u50cf\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u6765\u8ba1\u7b97\u3002\u56e0\u4e3a\u8be5\u5c04\u5f71\u91cd\u6784\u901a\u8fc7\u4e00\u4e2a\u5355\u5e94\u8054\u7cfb\u4e8e\u771f\u6b63\u7684\u91cd\u6784\uff1a \\(\\mathbf{X}_{Ei}=H\\mathbf{X}_i, i=1,...,n\\) \u6bcf\u7ec4\u70b9\u5bf9\u5e94\u63d0\u4f9b\u5173\u4e8e H \u5143\u7d20\u7684\u4e09\u4e2a\u72ec\u7acb\u7ebf\u6027\u65b9\u7a0b\u3002\u56e0\u4e3a H \u6709 15 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6545\u82e5\u63d0\u4f9b \\(n \\ge 5\\) \u7ec4\uff08\u4e14\u6ca1\u6709\u56db\u4e2a\u63a7\u5236\u70b9\u662f\u5171\u9762\u7684\uff09\u70b9\u5bf9\u5e94\uff0c\u4fbf\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7ebf\u6027\u89e3 \u53e6\u4e00\u79cd\u65b9\u6cd5\u53ef\u4ee5\u4e0d\u8ba1\u7b97 \\(\\mathbf{X}_i\\) \u800c\u901a\u8fc7\u628a\u5df2\u77e5\u7684\u5730\u9762\u63a7\u5236\u70b9\u76f4\u63a5\u4e0e\u56fe\u50cf\u7684\u5ea6\u91cf\u76f8\u8054\u7cfb\u7684\u9014\u5f84\u6765\u8ba1\u7b97 H\u3002\u56e0\u6b64\u7c7b\u4f3c\u4e8e\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635\u7684 \\(DLT\\) \u7b97\u6cd5\uff1a \\(\\mathbf{x}_i = PH^{-1} \\mathbf{X}_{Ei}\\)","title":"\u76f4\u63a5\u91cd\u6784\u2014\u2014\u5229\u7528\u5730\u9762\u77e5\u8bc6"},{"location":"cv/mvg/ag-fm/","text":"\u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635 \u00b6 \u7ea6 2754 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u6781\u51e0\u4f55\u662f\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u5185\u5728\u7684\u5c04\u5f71\u51e0\u4f55\uff0c\u72ec\u7acb\u4e8e\u666f\u7269\u7ed3\u6784\uff0c\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u5185\u53c2\u6570\u548c\u76f8\u5bf9\u59ff\u6001 \u57fa\u672c\u77e9\u9635 F \u96c6\u4e2d\u4e86\u8fd9\u4e2a\u5185\u5728\u51e0\u4f55\u7684\u7cbe\u534e\uff0c\u5b83\u662f\u4e00\u4e2a\u79e9\u4e3a 2 \u7684 \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c\u4e00\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u5728\u7b2c\u4e00\u3001\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u50cf\u5206\u522b\u4e3a \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \uff0c\u5219\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u6ee1\u8db3\u5173\u7cfb \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u5bf9\u6781\u51e0\u4f55 \u00b6 \u672c\u8d28\u4e0a\uff0c\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u7684\u5bf9\u6781\u51e0\u4f55\u662f\u56fe\u50cf\u5e73\u9762\u4e0e\u4ee5\u57fa\u7ebf\uff08\u57fa\u7ebf\u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff09\u4e3a\u8f74\u7684\u5e73\u9762\u675f\u7684\u4ea4\u7684\u51e0\u4f55 \u5bf9\u6781\u70b9 \u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff08\u57fa\u7ebf\uff09\u4e0e\u50cf\u5e73\u9762\u7684 \u4ea4\u70b9 \u3002\u7b49\u4ef7\u5730\uff0c\u5bf9\u6781\u70b9\u662f\u5728\u4e00\u5e45\u89c6\u56fe\u4e2d\u53e6\u4e00\u4e2a\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u50cf\u3002\u5b83\u4e5f\u662f\u57fa\u7ebf\uff08\u5e73\u79fb\uff09\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \u5bf9\u6781\u5e73\u9762 \u662f\u4e00\u5f20\u5305\u542b\u57fa\u7ebf\u7684\u5e73\u9762\uff0c\u5b58\u5728\u7740\u5bf9\u6781\u5e73\u9762\u7684\u4e00\u4e2a\u5355\u53c2\u6570\u7c07\uff08\u675f\uff09 \u5bf9\u6781\u7ebf \u662f\u6781\u5e73\u9762\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u7ebf\uff0c\u6240\u6709\u5bf9\u6781\u7ebf\u76f8\u4ea4\u4e8e\u5bf9\u6781\u70b9\uff0c\u4e00\u5f20\u5bf9\u6781\u5e73\u9762\u4e0e\u5de6\u6216\u53f3\u50cf\u5e73\u9762\u76f8\u4ea4\u4e8e\u5bf9\u6781\u7ebf\uff0c\u5e76\u5b9a\u4e49\u4e86\u5bf9\u6781\u7ebf\u4e4b\u95f4\u7684\u5bf9\u5e94 \u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u8fd0\u52a8 \uff1a\u5bf9\u4e8e\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u4f5c\u5e73\u79fb\u4ee5\u53ca\u65cb\u8f6c\u8f74\u5782\u76f4\u56fe\u50cf\u5e73\u9762\u7684\u7279\u6b8a\u8fd0\u52a8\u60c5\u5f62\uff0c\u57fa\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u4f4d\u4e8e\u65e0\u7a77\u8fdc\uff0c\u56e0\u6b64\uff0c\u5bf9\u6781\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u800c\u5bf9\u6781\u7ebf\u662f\u5e73\u884c\u7ebf \u57fa\u672c\u77e9\u9635 F \u00b6 \u57fa\u672c\u77e9\u9635 F \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]\\) \\times H \\pi\uff0c\u5176\u4e2d \\(H_\\pi=P^\\prime P^+\\) \u662f\u4ece\u4e00\u5e45\u56fe\u50cf\u5230\u53e6\u4e00\u5e45\u56fe\u50cf\u901a\u8fc7\u4efb\u610f\u5e73\u9762 \\(\\pi\\) \u7684\u8f6c\u79fb\u6620\u5c04\u3002\u800c\u4e14\uff0c\u56e0\u4e3a \\([\\mathbf{e}^\\prime]_\\times\\) \u7684\u79e9\u4e3a 2 \u548c \\(H_\\pi\\) \u79e9\u4e3a 3\uff0c\u6240\u4ee5 F \u662f\u79e9 2 \u7684\u77e9\u9635 \u5047\u8bbe\u6444\u50cf\u673a\u77e9\u9635\u662f\u4e00\u4e2a\u5df2\u6807\u5b9a\u7684\u53cc\u773c\u88c5\u7f6e\u4e14\u4e16\u754c\u539f\u70b9\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u4e0a\uff1a \\[ F=[\\mathbf{e}^\\prime]_\\times K^\\prime R K^{-1}=K^{\\prime-\\top}[\\mathbf{t}]_\\times RK^{-1}=K^{\\prime -\\top}R[R^\\top \\mathbf{t}]_\\times K^{-1}=K^{\\prime -\\top}RK^\\top [\\mathbf{e}]_\\times \\] \u5bf9\u5e94\u6761\u4ef6 \u00b6 \u5bf9\u4e24\u5e45\u56fe\u50cf\u4e2d\u4efb\u4f55\u4e00\u5bf9\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \uff0c\u57fa\u672c\u77e9\u9635\u90fd\u6ee1\u8db3\u6761\u4ef6 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \\(F\\) \u53ef\u4ee5\u4ece\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8ba1\u7b97\u51fa\u6765\uff0c\u5373 \\(F\\) \u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u6574\u4f53\u5c3a\u5ea6\u56e0\u5b50\u7684\u4e00\u4e00\u4e0b\u7531\u6444\u50cf\u673a\u552f\u4e00\u786e\u5b9a \u57fa\u672c\u77e9\u9635\u7684\u6027\u8d28 \u00b6 \u5047\u8bbe\u4e24\u5e45\u56fe\u50cf\u7531\u4e2d\u5fc3\u4e0d\u91cd\u5408\u7684\u6444\u50cf\u673a\u83b7\u5f97\uff0c\u5219\u57fa\u672c\u77e9\u9635 \\(F\\) \u4e3a\u5bf9\u6240\u6709\u7684\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) ,\u5bf9\u6ee1\u8db3 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u7684\u79e9 2 \u7684\u552f\u4e00\u7684 \\(3 \\times 3\\) \u9f50\u6b21\u77e9\u9635 F \u662f\u79e9 2\u3001\u81ea\u7531\u5ea6 7 \u7684\u9f50\u6b21\u77e9\u9635 \u70b9\u5bf9\u5e94 \uff1a\u5982\u679c \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\uff0c\u90a3\u4e48 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u5bf9\u6781\u7ebf \\(\\mathbf{l}^\\prime=F\\mathbf{x}\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}\\) \u7684\u5bf9\u6781\u7ebf \\(\\mathbf{l}=F^\\top \\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}^\\prime\\) \u7684\u5bf9\u6781\u7ebf \u5bf9\u6781\u70b9 \\(F\\mathbf{e}=\\mathbf{0}\\) \\(F^\\top\\mathbf{e}^\\prime=\\mathbf{0}\\) \u7531\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8fdb\u884c\u8ba1\u7b97 \u4e00\u822c\u6444\u50cf\u673a \uff1a \\(F=[\\mathbf{e}^\\prime]_\\times P^\\prime P^+\\) \uff0c\u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\uff0c \\(\\mathbf{e}^\\prime=P^\\prime \\mathbf{C}\\) \u4e14 \\(P\\mathbf{c}=\\mathbf{0}\\) \u89c4\u8303\u6444\u50cf\u673a \uff1a \\(P=[I|\\mathbf{0}],F=[\\mathbf{e}^\\prime]_\\times M = M^{-\\top}[\\mathbf{e}]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime=\\mathbf{m}\\) \u4e14 \\(\\mathbf{e}=M^{-1}\\mathbf{m}\\) \u975e\u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff1a \\(P=K[I|\\mathbf{0}],P^\\prime=K^\\prime[R|\\mathbf{t}],F=K^{-\\top}[\\mathbf{t}]_\\times RK^{-1}=[K^\\prime \\mathbf{t}]_\\times K^\\prime R K^{-1}=K^{\\prime -\\top} RK^\\top [KR^\\top \\mathbf{t}]_\\times\\) \u8f6c\u7f6e \uff1a\u5982\u679c \\(F\\) \u662f\u6444\u50cf\u673a\u5bf9\u4f5c \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635\uff0c\u5219 \\(F^\\top\\) \u662f\u5176\u53cd\u5e8f\u5bf9 \\((P^\\prime,P)\\) \u7684\u57fa\u672c\u77e9\u9635 \u5bf9\u6781\u7ebf\u5355\u5e94 \u00b6 \u5047\u8bbe \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u5bf9\u6781\u7ebf\uff0c\u4e14 \\(k\\) \u662f\u4e0d\u8fc7\u5bf9\u6781\u70b9 \\(\\mathbf{e}\\) \u7684\u4efb\u4f55\u76f4\u7ebf\uff0c\u5219 \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u95f4\u7684\u5173\u7cfb\u662f \\(\\mathbf{l}^\\prime=F[\\mathbf{k}]_\\times \\mathbf{l}\\) \uff0c\u5bf9\u79f0\u5730\u6709 \\(\\mathbf{l}=F^\\top [\\mathbf{k}^\\prime]_\\times \\mathbf{l}^\\prime\\) \u7531\u7279\u6b8a\u8fd0\u52a8\u4ea7\u751f\u7684\u57fa\u672c\u77e9\u9635 \u00b6 \u7eaf\u5e73\u79fb \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u5e76\u4e14\u5185\u53c2\u4e0d\u53d8\u7684\u7eaf\u5e73\u79fb\uff0c\u53ef\u4ee5\u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u662f \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K[I|\\mathbf{t}]\\) \uff0c\u5219 \\(F=[\\mathbf{e}^\\prime]_\\times KK^{-1}=[\\mathbf{e}^\\prime]_\\times\\) \uff0c\u4ece\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f \\(\\mathbf{x}^\\prime=\\mathbf{x}+K\\mathbf{t}/Z\\) \uff0c\u5176\u4e2d \\(Z\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6\uff08\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u4e3b\u8f74\u4e0a\u6d4b\u91cf\u4ece \\(\\mathbf{X}\\) \u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u8ddd\u79bb\uff09 \u6ce8\u610f\u5728\u7eaf\u5e73\u79fb\u60c5\u5f62\uff0c \\(F=[\\mathbf{e}^\\prime]_\\times\\) \u662f\u53cd\u5bf9\u79f0\u7684\u800c\u4e14\u53ea\u6709 2 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5b83\u4eec\u5bf9\u5e94\u4e8e\u5bf9\u6781\u70b9\u7684\u4f4d\u7f6e \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \u4e0e \\(\\mathbf{e}=\\mathbf{e}^\\prime\\) \u662f\u5171\u7ebf\u7684\uff08\u5047\u8bbe\u628a\u4e24\u5e45\u56fe\u50cf\u53e0\u8d77\u6765\uff09\u3002\u8fd9\u79cd\u5171\u7ebf\u6027\u8d28\u79f0\u4e3a \u81ea\u5bf9\u6781 \uff0c\u5e76\u4e14\u5bf9\u4e8e\u4e00\u822c\u8fd0\u52a8\u4e0d\u6210\u7acb \u4e00\u822c\u8fd0\u52a8 \u7ed9\u5b9a\u4e24\u4e2a\u4efb\u610f\u6444\u50cf\u673a\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6444\u50cf\u673a\u65cb\u8f6c\u4f7f\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u5e73\u884c\u3002\u8be5\u65cb\u8f6c\u53ef\u4ee5\u901a\u8fc7\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u4e00\u4e2a\u5c04\u5f71\u53d8\u6362\u6765\u4eff\u771f\u3002\u9488\u5bf9\u4e24\u5e45\u56fe\u50cf\u7684\u6807\u5b9a\u77e9\u9635\u7684\u5dee\u522b\u8fd8\u53ef\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u8fdb\u4e00\u6b65\u7684\u77eb\u6b63\u3002\u8fd9\u4e24\u6b21\u77eb\u6b63\u7684\u7ed3\u679c\u7b49\u4ef7\u4e8e\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u4f5c\u5c04\u5f71\u53d8\u6362 \\(H\\) \u3002\u5047\u8bbe\u8fd9\u4e9b\u77eb\u6b63\u5df2\u7ecf\u5b8c\u6210\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u7684\u6709\u6548\u5173\u7cfb\u662f\u4e00\u4e2a\u7eaf\u5e73\u79fb\u3002 \u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u4e3a \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K^\\prime[R|\\mathbf{t}]\\) \uff0c\u9700\u8981\u7684\u5c04\u5f71\u53d8\u6362\u662f \\(H=K^\\prime RK^{-1}=H_\\infty\\) \uff0c\u5176\u4e2d \\(H_\\infty\\) \u662f\u65e0\u7a77\u5355\u5e94\uff0c\u4e14 \\(F=[\\mathbf{e}^\\prime]_\\times H_\\infty\\) \u3002\u5219\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u56fe\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f\uff1a \\(\\mathbf{x}^\\prime=K^\\prime RK^{-1}\\mathbf{x}+K^\\prime \\mathbf{t} / Z\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5728\u7eaf\u5e73\u9762\u8fd0\u52a8\u65f6\u65cb\u8f6c\u8f74\u4e0e\u5e73\u79fb\u65b9\u5411\u6b63\u4ea4\u3002\u6b63\u4ea4\u6027\u7ed9\u8fd9\u79cd\u8fd0\u52a8\u589e\u52a0\u4e86\u4e00\u4e2a\u7ea6\u675f\uff0c\u5982\u679c \\(K^\\prime=K\\) \uff0c\u5219 \\(F\\) \u7684\u5bf9\u79f0\u90e8\u5206\u5728\u8fd9\u79cd\u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\u65f6\u7684\u79e9\u4e3a 2\u3002\u4f7f\u5b83\u7684\u81ea\u7531\u5ea6\u4e2a\u6570\u4ece\u4e00\u822c\u8fd0\u52a8\u7684 7 \u4e2a\u964d\u4f4e\u5230\u7eaf\u5e73\u9762\u8fd0\u52a8\u7684 6 \u4e2a \u57fa\u672c\u77e9\u9635\u7684\u51e0\u4f55\u8868\u793a \u00b6 \u57fa\u672c\u77e9\u9635\u7684\u5bf9\u79f0\u548c\u53cd\u5bf9\u79f0\u90e8\u5206\u5206\u522b\u4e3a \\(F_s=(F+F^\\top)/2 \\ \\ \\ F_a=(F-F^\\top)/2\\) \uff0c\u6ee1\u8db3 \\(F=F_s+F_a\\) \u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_s\\) \u662f\u5bf9\u79f0\u7684\u5e76\u4e14\u4e00\u822c\u5730\u79e9\u4e3a 3\uff0c\u5b83\u6709 5 \u4e2a\u81ea\u7531\u5ea6\u5e76\u7b49\u540c\u4e8e\u4e00\u6761\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u79f0\u4e3a Steiner \u4e8c\u6b21\u66f2\u7ebf \u53cd\u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_a\\) \u662f\u53cd\u5bf9\u79f0\u7684\u5e76\u53ef\u4ee5\u8bb0\u4e3a \\(F_a=[\\mathbf{x}_a]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_a\\) \u662f \\(F_a\\) \u5730\u96f6\u77e2\u91cf\u3002\u53cd\u5bf9\u79f0\u90e8\u5206\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u4e14\u7b49\u540c\u4e8e\u70b9 \\(\\mathbf{x}_a\\) \u5bf9\u6781\u7ebf\u5bf9\u5e94 \uff1a\u7531\u4e00\u4e2a\u5355\u5e94\u5173\u8054\u7684\u4e24\u4e2a\u76f4\u7ebf\u675f\uff0c\u5b83\u4eec\u5bf9\u5e94\u76f4\u7ebf\u7684\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf\u3002\u8fd9\u4e24\u4e2a\u675f\u90fd\u662f\u5bf9\u6781\u7ebf\u675f\uff0c\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}\\) \u800c\u53e6\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}^\\prime\\) \u3002\u8fd9\u4e9b\u5bf9\u6781\u7ebf\u7531\u4e00\u4e2a 1D \u5355\u5e94\u76f8\u5173\u8054\u3002\u5176\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e8c\u6b21\u66f2\u7ebf \\(F_s\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\uff0c\u5176\u4e2d \\(F_s\\) \u7684\u79e9\u4e3a 2\u3002\u6b64\u65f6 Steiner \u4e8c\u6b21\u66f2\u7ebf\u662f\u9000\u5316\u7684\uff0c\u5b83\u7b49\u4ef7\u4e8e\u4e24\u6761\u4e0d\u91cd\u5408\u76f4\u7ebf \\(F_s=\\mathbf{l}_h\\mathbf{l}_s^\\top+\\mathbf{l}_s\\mathbf{l}_h^\\top\\) \uff0c \\(F\\) \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]_\\times[\\mathbf{l}_s]_\\times[\\mathbf{e}]_\\times\\) \u4e24\u4e2a\u5bf9\u6781\u70b9\u7684\u5206\u522b\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u548c\u76f4\u7ebf \\(\\mathbf{l}_s\\) \u6062\u590d\u6444\u50cf\u673a\u77e9\u9635 \u00b6 \u5c04\u5f71\u4e0d\u53d8\u6027\u548c\u89c4\u8303\u6444\u50cf\u673a \u00b6 \u5982\u679c H \u662f\u8868\u793a 3 \u7ef4\u5c04\u5f71\u53d8\u6362\u7684\u4e00\u4e2a \\(4 \\times 4\\) \u77e9\u9635\uff0c\u90a3\u4e48\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635 \\((P,P^\\prime)\\) \u548c \\((PH,P^\\prime H)\\) \u7684\u57fa\u672c\u77e9\u9635\u662f\u76f8\u540c\u7684 \u6444\u50cf\u673a\u77e9\u9635\u7684\u89c4\u8303\u5f62\u5f0f \uff1a\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635\u5bf9 \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M|\\mathbf{m}]\\) \u7684\u57fa\u672c\u77e9\u9635\u7b49\u4e8e \\([\\mathbf{m}]_\\times M\\) \u7ed9\u5b9a F \u540e\u7684\u6444\u50cf\u673a\u5c04\u5f71\u591a\u4e49\u6027 \u00b6 \u4ee4 F \u4e3a\u57fa\u672c\u77e9\u9635\u800c \\((P,P^\\prime)\\) \u548c \\((\\tilde{P},\\tilde{P}^\\prime)\\) \u90fd\u662f\u4e0e\u57fa\u672c\u77e9\u9635 F \u5bf9\u5e94\u7684\u4e24\u7ec4\u6444\u50cf\u673a\u77e9\u9635\u5bf9\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u7684 \\(4 \\times 4\\) \u77e9\u9635 H \u4f7f\u5f97 \\(\\tilde{P}=PH\\) \u548c \\(\\tilde{P}=P^\\prime H\\) \u82e5\u79e9\u4e3a 2 \u7684\u77e9\u9635 F \u53ef\u4ee5\u5206\u89e3\u4e3a\u4e24\u4e2a\u4e0d\u540c\u7684\u5f62\u5f0f\uff1a \\(F=[\\mathbf{a}]_\\times A\\) \u548c \\(F =[\\tilde{\\mathbf{a}}]_\\times \\tilde{A}\\) \uff0c\u5219\u5bf9\u67d0\u4e2a\u975e\u96f6\u5e38\u6570 k \u548c 3 \u7ef4\u77e2\u91cf \\(\\mathbf{v}\\) \u6709 \\(\\tilde{\\mathbf{a}}=k\\mathbf{a}\\) \u548c \\(\\tilde{A}=k^{-1}(A+\\mathbf{a} \\mathbf{v}^\\top)\\) \u7ed9\u5b9a F \u6c42\u89c4\u8303\u6444\u50cf\u673a\u5bf9 \u00b6 \u4e00\u4e2a\u975e\u96f6\u77e9\u9635 F \u662f\u5bf9\u5e94\u4e8e\u4e00\u5bf9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u57fa\u672c\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f \\(P^{\\prime \\top}FP\\) \u662f\u53cd\u5bf9\u79f0\u77e9\u9635 \u4ee4 F \u662f\u57fa\u672c\u77e9\u9635\uff0cS \u662f\u4efb\u610f\u53cd\u5bf9\u79f0\u77e9\u9635\u3002\u5b9a\u4e49\u6444\u50cf\u673a\u77e9\u9635\u5bf9\u4e3a\uff1a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[SF|\\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime\\) \u662f\u6ee1\u8db3 \\(\\mathbf{e}^{\\prime \\top}F=\\mathbf{0}\\) \u7684\u5bf9\u6781\u70b9\uff0c\u5e76\u5047\u5b9a\u6240\u5b9a\u4e49\u7684 \\(P^\\prime\\) \u662f\u6709\u6548\u7684\u6444\u50cf\u673a\u77e9\u9635\uff08\u79e9\u4e3a 3\uff09\uff0c\u5219 F \u662f\u5bf9\u5e94\u4e8e \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635 \u57fa\u672c\u77e9\u9635 F \u7684\u6444\u50cf\u673a\u77e9\u9635\u53ef\u4ee5\u9009\u62e9\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[[\\mathbf{e}^\\prime]_\\times F|\\mathbf{e}^\\prime]\\) \u5bf9\u5e94\u4e8e\u57fa\u672c\u77e9\u9635 F\uff0c\u4e00\u5bf9\u89c4\u8303\u5f62\u5f0f\u7684\u6444\u50cf\u673a\u77e9\u9635\u7684\u4e00\u822c\u516c\u5f0f\u662f \\(P=[I|\\mathbf{0}] \\ \\ \\ P^\\prime=[[\\mathbf{e}^\\prime]_\\times F + \\mathbf{e}^\\prime \\mathbf{v}^\\top | \\lambda \\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{v}\\) \u662f\u4efb\u4f55 3 \u7ef4\u77e2\u91cf\uff0c \\(\\lambda\\) \u662f\u4e00\u4e2a\u6b63\u6807\u91cf \u672c\u8d28\u77e9\u9635 \u00b6 \u672c\u8d28\u77e9\u9635\u662f\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u7cfb\u554a\u7684\u57fa\u672c\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\u3002\u57fa\u672c\u77e9\u9635\u53ef\u4ee5\u770b\u4f5c\u662f\u672c\u8d28\u77e9\u9635\u7684\u63a8\u5e7f\uff0c\u57fa\u672c\u77e9\u9635\u628a\u8981\u6c42\u6807\u5b9a\u6444\u50cf\u673a\u8fd9\u6837\u4e00\u4e2a(\u975e\u672c\u8d28\u7684)\u5047\u8bbe\u53bb\u6389\u4e86\u3002\u4e0e\u57fa\u672c\u77e9\u9635\u76f8\u6bd4\u8f83\uff0c\u672c\u8d28\u77e9\u9635\u6709\u8f83\u5c11\u7684\u81ea\u7531\u5ea6\u4f46\u589e\u52a0\u4e86\u4e00\u4e9b\u6027\u8d28\u3002 \u5f52\u4e00\u5316\u5750\u6807 \u901a\u8fc7\u77e5\u9053\u6807\u5b9a\u77e9\u9635 K\uff0c\u7528\u5b83\u7684\u9006\u77e9\u9635\u4f5c\u7528\u4e8e\u70b9 \\(\\mathbf{x}\\) \u5f97\u5230\u70b9 \\(\\hat{\\mathbf{x}}=K^{-1}\\mathbf{x}\\) \uff0c\u5219 \\(\\hat{\\mathbf{x}}=[R|\\mathbf{t}]\\mathbf{X}\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{x}}\\) \u662f\u56fe\u50cf\u4e0a\u7684\u70b9\u5728\u5f52\u4e00\u5316\u5750\u6807\u4e0b\u7684\u8868\u793a \u6444\u50cf\u673a\u77e9\u9635 \\(K^{-1}P=[R|\\mathbf{t}]\\) \u79f0\u4e3a\u5f52\u4e00\u5316\u6444\u50cf\u673a\u77e9\u9635 \u7528\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u8868\u793a\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u65f6\uff0c\u672c\u8d28\u77e9\u9635\u7684\u5b9a\u4e49\u65b9\u7a0b\u662f \\(\\hat{\\mathbf{x}}^{\\prime \\top} E \\hat{\\mathbf{x}}=0\\) \uff0c\u57fa\u672c\u77e9\u9635\u548c\u672c\u8d28\u77e9\u9635\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\(E=K^{\\prime \\top}FK\\) \u672c\u8d28\u77e9\u9635\u7684\u6027\u8d28 \u00b6 \u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u662f\u672c\u8d28\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u7684\u5947\u5f02\u503c\u4e2d\u6709\u4e24\u4e2a\u76f8\u7b49\u800c\u7b2c\u4e09\u4e2a\u662f 0 \u7531\u672c\u8d28\u77e9\u9635\u6062\u590d\u6444\u50cf\u673a\u77e9\u9635 \u00b6 \u82e5 E \u7684 SVD \u5206\u89e3\u4e3a \\(U diag(1,1,0)V^{\\top},E=SR\\) \u6709\u5982\u4e0b\u4e24\u79cd\u53ef\u80fd\u7684\u5206\u89e3\uff1a \\[ S=UZU^\\top \\ \\ \\ \\ \\ \\ R=UWV^\\top \\ \\ or \\ \\ UW^\\top V^\\top \\] \u5df2\u77e5\u672c\u8d28\u77e9\u9635 \\(U diag(1,1,0)V^\\top\\) \u548c\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P=[I|\\mathbf{0}]\\) \uff0c\u90a3\u4e48\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P^\\prime\\) \u6709\u4e0b\u5217\u56db\u79cd\u53ef\u80fd\u7684\u9009\u62e9\uff1a \\[ P^\\prime=[UWV^\\top|\\mathbf{u}_3]; \\ \\ \\ [UWV^\\top|-\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|-\\mathbf{u}_3] \\]","title":"\u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_1","text":"\u7ea6 2754 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u6781\u51e0\u4f55\u662f\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u5185\u5728\u7684\u5c04\u5f71\u51e0\u4f55\uff0c\u72ec\u7acb\u4e8e\u666f\u7269\u7ed3\u6784\uff0c\u53ea\u4f9d\u8d56\u4e8e\u6444\u50cf\u673a\u7684\u5185\u53c2\u6570\u548c\u76f8\u5bf9\u59ff\u6001 \u57fa\u672c\u77e9\u9635 F \u96c6\u4e2d\u4e86\u8fd9\u4e2a\u5185\u5728\u51e0\u4f55\u7684\u7cbe\u534e\uff0c\u5b83\u662f\u4e00\u4e2a\u79e9\u4e3a 2 \u7684 \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c\u4e00\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u5728\u7b2c\u4e00\u3001\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u50cf\u5206\u522b\u4e3a \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \uff0c\u5219\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u6ee1\u8db3\u5173\u7cfb \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\)","title":"\u5bf9\u6781\u51e0\u4f55\u548c\u57fa\u672c\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_2","text":"\u672c\u8d28\u4e0a\uff0c\u4e24\u5e45\u89c6\u56fe\u4e4b\u95f4\u7684\u5bf9\u6781\u51e0\u4f55\u662f\u56fe\u50cf\u5e73\u9762\u4e0e\u4ee5\u57fa\u7ebf\uff08\u57fa\u7ebf\u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff09\u4e3a\u8f74\u7684\u5e73\u9762\u675f\u7684\u4ea4\u7684\u51e0\u4f55 \u5bf9\u6781\u70b9 \u662f\u8fde\u63a5\u4e24\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u76f4\u7ebf\uff08\u57fa\u7ebf\uff09\u4e0e\u50cf\u5e73\u9762\u7684 \u4ea4\u70b9 \u3002\u7b49\u4ef7\u5730\uff0c\u5bf9\u6781\u70b9\u662f\u5728\u4e00\u5e45\u89c6\u56fe\u4e2d\u53e6\u4e00\u4e2a\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u50cf\u3002\u5b83\u4e5f\u662f\u57fa\u7ebf\uff08\u5e73\u79fb\uff09\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \u5bf9\u6781\u5e73\u9762 \u662f\u4e00\u5f20\u5305\u542b\u57fa\u7ebf\u7684\u5e73\u9762\uff0c\u5b58\u5728\u7740\u5bf9\u6781\u5e73\u9762\u7684\u4e00\u4e2a\u5355\u53c2\u6570\u7c07\uff08\u675f\uff09 \u5bf9\u6781\u7ebf \u662f\u6781\u5e73\u9762\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u7ebf\uff0c\u6240\u6709\u5bf9\u6781\u7ebf\u76f8\u4ea4\u4e8e\u5bf9\u6781\u70b9\uff0c\u4e00\u5f20\u5bf9\u6781\u5e73\u9762\u4e0e\u5de6\u6216\u53f3\u50cf\u5e73\u9762\u76f8\u4ea4\u4e8e\u5bf9\u6781\u7ebf\uff0c\u5e76\u5b9a\u4e49\u4e86\u5bf9\u6781\u7ebf\u4e4b\u95f4\u7684\u5bf9\u5e94 \u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u8fd0\u52a8 \uff1a\u5bf9\u4e8e\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u4f5c\u5e73\u79fb\u4ee5\u53ca\u65cb\u8f6c\u8f74\u5782\u76f4\u56fe\u50cf\u5e73\u9762\u7684\u7279\u6b8a\u8fd0\u52a8\u60c5\u5f62\uff0c\u57fa\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u4f4d\u4e8e\u65e0\u7a77\u8fdc\uff0c\u56e0\u6b64\uff0c\u5bf9\u6781\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u800c\u5bf9\u6781\u7ebf\u662f\u5e73\u884c\u7ebf","title":"\u5bf9\u6781\u51e0\u4f55"},{"location":"cv/mvg/ag-fm/#f","text":"\u57fa\u672c\u77e9\u9635 F \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]\\) \\times H \\pi\uff0c\u5176\u4e2d \\(H_\\pi=P^\\prime P^+\\) \u662f\u4ece\u4e00\u5e45\u56fe\u50cf\u5230\u53e6\u4e00\u5e45\u56fe\u50cf\u901a\u8fc7\u4efb\u610f\u5e73\u9762 \\(\\pi\\) \u7684\u8f6c\u79fb\u6620\u5c04\u3002\u800c\u4e14\uff0c\u56e0\u4e3a \\([\\mathbf{e}^\\prime]_\\times\\) \u7684\u79e9\u4e3a 2 \u548c \\(H_\\pi\\) \u79e9\u4e3a 3\uff0c\u6240\u4ee5 F \u662f\u79e9 2 \u7684\u77e9\u9635 \u5047\u8bbe\u6444\u50cf\u673a\u77e9\u9635\u662f\u4e00\u4e2a\u5df2\u6807\u5b9a\u7684\u53cc\u773c\u88c5\u7f6e\u4e14\u4e16\u754c\u539f\u70b9\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u4e0a\uff1a \\[ F=[\\mathbf{e}^\\prime]_\\times K^\\prime R K^{-1}=K^{\\prime-\\top}[\\mathbf{t}]_\\times RK^{-1}=K^{\\prime -\\top}R[R^\\top \\mathbf{t}]_\\times K^{-1}=K^{\\prime -\\top}RK^\\top [\\mathbf{e}]_\\times \\]","title":"\u57fa\u672c\u77e9\u9635 F"},{"location":"cv/mvg/ag-fm/#_3","text":"\u5bf9\u4e24\u5e45\u56fe\u50cf\u4e2d\u4efb\u4f55\u4e00\u5bf9\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \uff0c\u57fa\u672c\u77e9\u9635\u90fd\u6ee1\u8db3\u6761\u4ef6 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \\(F\\) \u53ef\u4ee5\u4ece\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8ba1\u7b97\u51fa\u6765\uff0c\u5373 \\(F\\) \u53ef\u5728\u76f8\u5dee\u4e00\u4e2a\u6574\u4f53\u5c3a\u5ea6\u56e0\u5b50\u7684\u4e00\u4e00\u4e0b\u7531\u6444\u50cf\u673a\u552f\u4e00\u786e\u5b9a","title":"\u5bf9\u5e94\u6761\u4ef6"},{"location":"cv/mvg/ag-fm/#_4","text":"\u5047\u8bbe\u4e24\u5e45\u56fe\u50cf\u7531\u4e2d\u5fc3\u4e0d\u91cd\u5408\u7684\u6444\u50cf\u673a\u83b7\u5f97\uff0c\u5219\u57fa\u672c\u77e9\u9635 \\(F\\) \u4e3a\u5bf9\u6240\u6709\u7684\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) ,\u5bf9\u6ee1\u8db3 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u7684\u79e9 2 \u7684\u552f\u4e00\u7684 \\(3 \\times 3\\) \u9f50\u6b21\u77e9\u9635 F \u662f\u79e9 2\u3001\u81ea\u7531\u5ea6 7 \u7684\u9f50\u6b21\u77e9\u9635 \u70b9\u5bf9\u5e94 \uff1a\u5982\u679c \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\uff0c\u90a3\u4e48 \\(\\mathbf{x}^{\\prime \\top}F\\mathbf{x}=0\\) \u5bf9\u6781\u7ebf \\(\\mathbf{l}^\\prime=F\\mathbf{x}\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}\\) \u7684\u5bf9\u6781\u7ebf \\(\\mathbf{l}=F^\\top \\mathbf{x}^\\prime\\) \u662f\u5bf9\u5e94\u4e8e \\(\\mathbf{x}^\\prime\\) \u7684\u5bf9\u6781\u7ebf \u5bf9\u6781\u70b9 \\(F\\mathbf{e}=\\mathbf{0}\\) \\(F^\\top\\mathbf{e}^\\prime=\\mathbf{0}\\) \u7531\u6444\u50cf\u673a\u77e9\u9635 \\(P\u3001P^\\prime\\) \u8fdb\u884c\u8ba1\u7b97 \u4e00\u822c\u6444\u50cf\u673a \uff1a \\(F=[\\mathbf{e}^\\prime]_\\times P^\\prime P^+\\) \uff0c\u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\uff0c \\(\\mathbf{e}^\\prime=P^\\prime \\mathbf{C}\\) \u4e14 \\(P\\mathbf{c}=\\mathbf{0}\\) \u89c4\u8303\u6444\u50cf\u673a \uff1a \\(P=[I|\\mathbf{0}],F=[\\mathbf{e}^\\prime]_\\times M = M^{-\\top}[\\mathbf{e}]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime=\\mathbf{m}\\) \u4e14 \\(\\mathbf{e}=M^{-1}\\mathbf{m}\\) \u975e\u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff1a \\(P=K[I|\\mathbf{0}],P^\\prime=K^\\prime[R|\\mathbf{t}],F=K^{-\\top}[\\mathbf{t}]_\\times RK^{-1}=[K^\\prime \\mathbf{t}]_\\times K^\\prime R K^{-1}=K^{\\prime -\\top} RK^\\top [KR^\\top \\mathbf{t}]_\\times\\) \u8f6c\u7f6e \uff1a\u5982\u679c \\(F\\) \u662f\u6444\u50cf\u673a\u5bf9\u4f5c \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635\uff0c\u5219 \\(F^\\top\\) \u662f\u5176\u53cd\u5e8f\u5bf9 \\((P^\\prime,P)\\) \u7684\u57fa\u672c\u77e9\u9635","title":"\u57fa\u672c\u77e9\u9635\u7684\u6027\u8d28"},{"location":"cv/mvg/ag-fm/#_5","text":"\u5047\u8bbe \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u662f\u5bf9\u5e94\u7684\u5bf9\u6781\u7ebf\uff0c\u4e14 \\(k\\) \u662f\u4e0d\u8fc7\u5bf9\u6781\u70b9 \\(\\mathbf{e}\\) \u7684\u4efb\u4f55\u76f4\u7ebf\uff0c\u5219 \\(\\mathbf{l}\\) \u548c \\(\\mathbf{l}^\\prime\\) \u95f4\u7684\u5173\u7cfb\u662f \\(\\mathbf{l}^\\prime=F[\\mathbf{k}]_\\times \\mathbf{l}\\) \uff0c\u5bf9\u79f0\u5730\u6709 \\(\\mathbf{l}=F^\\top [\\mathbf{k}^\\prime]_\\times \\mathbf{l}^\\prime\\)","title":"\u5bf9\u6781\u7ebf\u5355\u5e94"},{"location":"cv/mvg/ag-fm/#_6","text":"\u7eaf\u5e73\u79fb \u5047\u8bbe\u6444\u50cf\u673a\u7684\u8fd0\u52a8\u662f\u6ca1\u6709\u65cb\u8f6c\u5e76\u4e14\u5185\u53c2\u4e0d\u53d8\u7684\u7eaf\u5e73\u79fb\uff0c\u53ef\u4ee5\u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u662f \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K[I|\\mathbf{t}]\\) \uff0c\u5219 \\(F=[\\mathbf{e}^\\prime]_\\times KK^{-1}=[\\mathbf{e}^\\prime]_\\times\\) \uff0c\u4ece\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f \\(\\mathbf{x}^\\prime=\\mathbf{x}+K\\mathbf{t}/Z\\) \uff0c\u5176\u4e2d \\(Z\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6\uff08\u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u4e3b\u8f74\u4e0a\u6d4b\u91cf\u4ece \\(\\mathbf{X}\\) \u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u8ddd\u79bb\uff09 \u6ce8\u610f\u5728\u7eaf\u5e73\u79fb\u60c5\u5f62\uff0c \\(F=[\\mathbf{e}^\\prime]_\\times\\) \u662f\u53cd\u5bf9\u79f0\u7684\u800c\u4e14\u53ea\u6709 2 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5b83\u4eec\u5bf9\u5e94\u4e8e\u5bf9\u6781\u70b9\u7684\u4f4d\u7f6e \\(\\mathbf{x},\\mathbf{x}^\\prime\\) \u4e0e \\(\\mathbf{e}=\\mathbf{e}^\\prime\\) \u662f\u5171\u7ebf\u7684\uff08\u5047\u8bbe\u628a\u4e24\u5e45\u56fe\u50cf\u53e0\u8d77\u6765\uff09\u3002\u8fd9\u79cd\u5171\u7ebf\u6027\u8d28\u79f0\u4e3a \u81ea\u5bf9\u6781 \uff0c\u5e76\u4e14\u5bf9\u4e8e\u4e00\u822c\u8fd0\u52a8\u4e0d\u6210\u7acb \u4e00\u822c\u8fd0\u52a8 \u7ed9\u5b9a\u4e24\u4e2a\u4efb\u610f\u6444\u50cf\u673a\uff0c\u6211\u4eec\u53ef\u4ee5\u628a\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6444\u50cf\u673a\u65cb\u8f6c\u4f7f\u5b83\u4e0e\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u5e73\u884c\u3002\u8be5\u65cb\u8f6c\u53ef\u4ee5\u901a\u8fc7\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u4e00\u4e2a\u5c04\u5f71\u53d8\u6362\u6765\u4eff\u771f\u3002\u9488\u5bf9\u4e24\u5e45\u56fe\u50cf\u7684\u6807\u5b9a\u77e9\u9635\u7684\u5dee\u522b\u8fd8\u53ef\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u65bd\u52a0\u8fdb\u4e00\u6b65\u7684\u77eb\u6b63\u3002\u8fd9\u4e24\u6b21\u77eb\u6b63\u7684\u7ed3\u679c\u7b49\u4ef7\u4e8e\u5bf9\u7b2c\u4e00\u5e45\u56fe\u50cf\u4f5c\u5c04\u5f71\u53d8\u6362 \\(H\\) \u3002\u5047\u8bbe\u8fd9\u4e9b\u77eb\u6b63\u5df2\u7ecf\u5b8c\u6210\uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4e4b\u95f4\u7684\u6709\u6548\u5173\u7cfb\u662f\u4e00\u4e2a\u7eaf\u5e73\u79fb\u3002 \u5047\u8bbe\u4e24\u4e2a\u6444\u50cf\u673a\u77e9\u9635\u5206\u522b\u4e3a \\(P=K[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=K^\\prime[R|\\mathbf{t}]\\) \uff0c\u9700\u8981\u7684\u5c04\u5f71\u53d8\u6362\u662f \\(H=K^\\prime RK^{-1}=H_\\infty\\) \uff0c\u5176\u4e2d \\(H_\\infty\\) \u662f\u65e0\u7a77\u5355\u5e94\uff0c\u4e14 \\(F=[\\mathbf{e}^\\prime]_\\times H_\\infty\\) \u3002\u5219\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u5230\u56fe\u50cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u7684\u6620\u5c04\u662f\uff1a \\(\\mathbf{x}^\\prime=K^\\prime RK^{-1}\\mathbf{x}+K^\\prime \\mathbf{t} / Z\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5728\u7eaf\u5e73\u9762\u8fd0\u52a8\u65f6\u65cb\u8f6c\u8f74\u4e0e\u5e73\u79fb\u65b9\u5411\u6b63\u4ea4\u3002\u6b63\u4ea4\u6027\u7ed9\u8fd9\u79cd\u8fd0\u52a8\u589e\u52a0\u4e86\u4e00\u4e2a\u7ea6\u675f\uff0c\u5982\u679c \\(K^\\prime=K\\) \uff0c\u5219 \\(F\\) \u7684\u5bf9\u79f0\u90e8\u5206\u5728\u8fd9\u79cd\u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\u65f6\u7684\u79e9\u4e3a 2\u3002\u4f7f\u5b83\u7684\u81ea\u7531\u5ea6\u4e2a\u6570\u4ece\u4e00\u822c\u8fd0\u52a8\u7684 7 \u4e2a\u964d\u4f4e\u5230\u7eaf\u5e73\u9762\u8fd0\u52a8\u7684 6 \u4e2a","title":"\u7531\u7279\u6b8a\u8fd0\u52a8\u4ea7\u751f\u7684\u57fa\u672c\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_7","text":"\u57fa\u672c\u77e9\u9635\u7684\u5bf9\u79f0\u548c\u53cd\u5bf9\u79f0\u90e8\u5206\u5206\u522b\u4e3a \\(F_s=(F+F^\\top)/2 \\ \\ \\ F_a=(F-F^\\top)/2\\) \uff0c\u6ee1\u8db3 \\(F=F_s+F_a\\) \u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_s\\) \u662f\u5bf9\u79f0\u7684\u5e76\u4e14\u4e00\u822c\u5730\u79e9\u4e3a 3\uff0c\u5b83\u6709 5 \u4e2a\u81ea\u7531\u5ea6\u5e76\u7b49\u540c\u4e8e\u4e00\u6761\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u79f0\u4e3a Steiner \u4e8c\u6b21\u66f2\u7ebf \u53cd\u5bf9\u79f0\u90e8\u5206 \uff1a\u77e9\u9635 \\(F_a\\) \u662f\u53cd\u5bf9\u79f0\u7684\u5e76\u53ef\u4ee5\u8bb0\u4e3a \\(F_a=[\\mathbf{x}_a]_\\times\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_a\\) \u662f \\(F_a\\) \u5730\u96f6\u77e2\u91cf\u3002\u53cd\u5bf9\u79f0\u90e8\u5206\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u4e14\u7b49\u540c\u4e8e\u70b9 \\(\\mathbf{x}_a\\) \u5bf9\u6781\u7ebf\u5bf9\u5e94 \uff1a\u7531\u4e00\u4e2a\u5355\u5e94\u5173\u8054\u7684\u4e24\u4e2a\u76f4\u7ebf\u675f\uff0c\u5b83\u4eec\u5bf9\u5e94\u76f4\u7ebf\u7684\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf\u3002\u8fd9\u4e24\u4e2a\u675f\u90fd\u662f\u5bf9\u6781\u7ebf\u675f\uff0c\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}\\) \u800c\u53e6\u4e00\u4e2a\u8fc7 \\(\\mathbf{e}^\\prime\\) \u3002\u8fd9\u4e9b\u5bf9\u6781\u7ebf\u7531\u4e00\u4e2a 1D \u5355\u5e94\u76f8\u5173\u8054\u3002\u5176\u4ea4\u70b9\u7684\u8f68\u8ff9\u662f\u4e8c\u6b21\u66f2\u7ebf \\(F_s\\) \u7eaf\u5e73\u9762\u8fd0\u52a8 \u5e73\u9762\u8fd0\u52a8\u60c5\u5f62\uff0c\u5176\u4e2d \\(F_s\\) \u7684\u79e9\u4e3a 2\u3002\u6b64\u65f6 Steiner \u4e8c\u6b21\u66f2\u7ebf\u662f\u9000\u5316\u7684\uff0c\u5b83\u7b49\u4ef7\u4e8e\u4e24\u6761\u4e0d\u91cd\u5408\u76f4\u7ebf \\(F_s=\\mathbf{l}_h\\mathbf{l}_s^\\top+\\mathbf{l}_s\\mathbf{l}_h^\\top\\) \uff0c \\(F\\) \u53ef\u4ee5\u8bb0\u4e3a \\(F=[\\mathbf{e}^\\prime]_\\times[\\mathbf{l}_s]_\\times[\\mathbf{e}]_\\times\\) \u4e24\u4e2a\u5bf9\u6781\u70b9\u7684\u5206\u522b\u6709 2 \u4e2a\u81ea\u7531\u5ea6\u548c\u76f4\u7ebf \\(\\mathbf{l}_s\\)","title":"\u57fa\u672c\u77e9\u9635\u7684\u51e0\u4f55\u8868\u793a"},{"location":"cv/mvg/ag-fm/#_8","text":"","title":"\u6062\u590d\u6444\u50cf\u673a\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_9","text":"\u5982\u679c H \u662f\u8868\u793a 3 \u7ef4\u5c04\u5f71\u53d8\u6362\u7684\u4e00\u4e2a \\(4 \\times 4\\) \u77e9\u9635\uff0c\u90a3\u4e48\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635 \\((P,P^\\prime)\\) \u548c \\((PH,P^\\prime H)\\) \u7684\u57fa\u672c\u77e9\u9635\u662f\u76f8\u540c\u7684 \u6444\u50cf\u673a\u77e9\u9635\u7684\u89c4\u8303\u5f62\u5f0f \uff1a\u5bf9\u5e94\u4e8e\u6444\u50cf\u673a\u77e9\u9635\u5bf9 \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[M|\\mathbf{m}]\\) \u7684\u57fa\u672c\u77e9\u9635\u7b49\u4e8e \\([\\mathbf{m}]_\\times M\\)","title":"\u5c04\u5f71\u4e0d\u53d8\u6027\u548c\u89c4\u8303\u6444\u50cf\u673a"},{"location":"cv/mvg/ag-fm/#f_1","text":"\u4ee4 F \u4e3a\u57fa\u672c\u77e9\u9635\u800c \\((P,P^\\prime)\\) \u548c \\((\\tilde{P},\\tilde{P}^\\prime)\\) \u90fd\u662f\u4e0e\u57fa\u672c\u77e9\u9635 F \u5bf9\u5e94\u7684\u4e24\u7ec4\u6444\u50cf\u673a\u77e9\u9635\u5bf9\uff0c\u5219\u5b58\u5728\u4e00\u4e2a\u975e\u5947\u5f02\u7684 \\(4 \\times 4\\) \u77e9\u9635 H \u4f7f\u5f97 \\(\\tilde{P}=PH\\) \u548c \\(\\tilde{P}=P^\\prime H\\) \u82e5\u79e9\u4e3a 2 \u7684\u77e9\u9635 F \u53ef\u4ee5\u5206\u89e3\u4e3a\u4e24\u4e2a\u4e0d\u540c\u7684\u5f62\u5f0f\uff1a \\(F=[\\mathbf{a}]_\\times A\\) \u548c \\(F =[\\tilde{\\mathbf{a}}]_\\times \\tilde{A}\\) \uff0c\u5219\u5bf9\u67d0\u4e2a\u975e\u96f6\u5e38\u6570 k \u548c 3 \u7ef4\u77e2\u91cf \\(\\mathbf{v}\\) \u6709 \\(\\tilde{\\mathbf{a}}=k\\mathbf{a}\\) \u548c \\(\\tilde{A}=k^{-1}(A+\\mathbf{a} \\mathbf{v}^\\top)\\)","title":"\u7ed9\u5b9a F \u540e\u7684\u6444\u50cf\u673a\u5c04\u5f71\u591a\u4e49\u6027"},{"location":"cv/mvg/ag-fm/#f_2","text":"\u4e00\u4e2a\u975e\u96f6\u77e9\u9635 F \u662f\u5bf9\u5e94\u4e8e\u4e00\u5bf9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u548c \\(P^\\prime\\) \u7684\u57fa\u672c\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f \\(P^{\\prime \\top}FP\\) \u662f\u53cd\u5bf9\u79f0\u77e9\u9635 \u4ee4 F \u662f\u57fa\u672c\u77e9\u9635\uff0cS \u662f\u4efb\u610f\u53cd\u5bf9\u79f0\u77e9\u9635\u3002\u5b9a\u4e49\u6444\u50cf\u673a\u77e9\u9635\u5bf9\u4e3a\uff1a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[SF|\\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{e}^\\prime\\) \u662f\u6ee1\u8db3 \\(\\mathbf{e}^{\\prime \\top}F=\\mathbf{0}\\) \u7684\u5bf9\u6781\u70b9\uff0c\u5e76\u5047\u5b9a\u6240\u5b9a\u4e49\u7684 \\(P^\\prime\\) \u662f\u6709\u6548\u7684\u6444\u50cf\u673a\u77e9\u9635\uff08\u79e9\u4e3a 3\uff09\uff0c\u5219 F \u662f\u5bf9\u5e94\u4e8e \\((P,P^\\prime)\\) \u7684\u57fa\u672c\u77e9\u9635 \u57fa\u672c\u77e9\u9635 F \u7684\u6444\u50cf\u673a\u77e9\u9635\u53ef\u4ee5\u9009\u62e9\u4e3a \\(P=[I|\\mathbf{0}]\\) \u548c \\(P^\\prime=[[\\mathbf{e}^\\prime]_\\times F|\\mathbf{e}^\\prime]\\) \u5bf9\u5e94\u4e8e\u57fa\u672c\u77e9\u9635 F\uff0c\u4e00\u5bf9\u89c4\u8303\u5f62\u5f0f\u7684\u6444\u50cf\u673a\u77e9\u9635\u7684\u4e00\u822c\u516c\u5f0f\u662f \\(P=[I|\\mathbf{0}] \\ \\ \\ P^\\prime=[[\\mathbf{e}^\\prime]_\\times F + \\mathbf{e}^\\prime \\mathbf{v}^\\top | \\lambda \\mathbf{e}^\\prime]\\) \uff0c\u5176\u4e2d \\(\\mathbf{v}\\) \u662f\u4efb\u4f55 3 \u7ef4\u77e2\u91cf\uff0c \\(\\lambda\\) \u662f\u4e00\u4e2a\u6b63\u6807\u91cf","title":"\u7ed9\u5b9a F \u6c42\u89c4\u8303\u6444\u50cf\u673a\u5bf9"},{"location":"cv/mvg/ag-fm/#_10","text":"\u672c\u8d28\u77e9\u9635\u662f\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u7cfb\u554a\u7684\u57fa\u672c\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\u3002\u57fa\u672c\u77e9\u9635\u53ef\u4ee5\u770b\u4f5c\u662f\u672c\u8d28\u77e9\u9635\u7684\u63a8\u5e7f\uff0c\u57fa\u672c\u77e9\u9635\u628a\u8981\u6c42\u6807\u5b9a\u6444\u50cf\u673a\u8fd9\u6837\u4e00\u4e2a(\u975e\u672c\u8d28\u7684)\u5047\u8bbe\u53bb\u6389\u4e86\u3002\u4e0e\u57fa\u672c\u77e9\u9635\u76f8\u6bd4\u8f83\uff0c\u672c\u8d28\u77e9\u9635\u6709\u8f83\u5c11\u7684\u81ea\u7531\u5ea6\u4f46\u589e\u52a0\u4e86\u4e00\u4e9b\u6027\u8d28\u3002 \u5f52\u4e00\u5316\u5750\u6807 \u901a\u8fc7\u77e5\u9053\u6807\u5b9a\u77e9\u9635 K\uff0c\u7528\u5b83\u7684\u9006\u77e9\u9635\u4f5c\u7528\u4e8e\u70b9 \\(\\mathbf{x}\\) \u5f97\u5230\u70b9 \\(\\hat{\\mathbf{x}}=K^{-1}\\mathbf{x}\\) \uff0c\u5219 \\(\\hat{\\mathbf{x}}=[R|\\mathbf{t}]\\mathbf{X}\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{x}}\\) \u662f\u56fe\u50cf\u4e0a\u7684\u70b9\u5728\u5f52\u4e00\u5316\u5750\u6807\u4e0b\u7684\u8868\u793a \u6444\u50cf\u673a\u77e9\u9635 \\(K^{-1}P=[R|\\mathbf{t}]\\) \u79f0\u4e3a\u5f52\u4e00\u5316\u6444\u50cf\u673a\u77e9\u9635 \u7528\u5f52\u4e00\u5316\u56fe\u50cf\u5750\u6807\u8868\u793a\u5bf9\u5e94\u70b9 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u65f6\uff0c\u672c\u8d28\u77e9\u9635\u7684\u5b9a\u4e49\u65b9\u7a0b\u662f \\(\\hat{\\mathbf{x}}^{\\prime \\top} E \\hat{\\mathbf{x}}=0\\) \uff0c\u57fa\u672c\u77e9\u9635\u548c\u672c\u8d28\u77e9\u9635\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\(E=K^{\\prime \\top}FK\\)","title":"\u672c\u8d28\u77e9\u9635"},{"location":"cv/mvg/ag-fm/#_11","text":"\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u662f\u672c\u8d28\u77e9\u9635\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u7684\u5947\u5f02\u503c\u4e2d\u6709\u4e24\u4e2a\u76f8\u7b49\u800c\u7b2c\u4e09\u4e2a\u662f 0","title":"\u672c\u8d28\u77e9\u9635\u7684\u6027\u8d28"},{"location":"cv/mvg/ag-fm/#_12","text":"\u82e5 E \u7684 SVD \u5206\u89e3\u4e3a \\(U diag(1,1,0)V^{\\top},E=SR\\) \u6709\u5982\u4e0b\u4e24\u79cd\u53ef\u80fd\u7684\u5206\u89e3\uff1a \\[ S=UZU^\\top \\ \\ \\ \\ \\ \\ R=UWV^\\top \\ \\ or \\ \\ UW^\\top V^\\top \\] \u5df2\u77e5\u672c\u8d28\u77e9\u9635 \\(U diag(1,1,0)V^\\top\\) \u548c\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P=[I|\\mathbf{0}]\\) \uff0c\u90a3\u4e48\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u77e9\u9635 \\(P^\\prime\\) \u6709\u4e0b\u5217\u56db\u79cd\u53ef\u80fd\u7684\u9009\u62e9\uff1a \\[ P^\\prime=[UWV^\\top|\\mathbf{u}_3]; \\ \\ \\ [UWV^\\top|-\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|\\mathbf{u}_3]; \\ \\ \\ [UW^\\top V^\\top|-\\mathbf{u}_3] \\]","title":"\u7531\u672c\u8d28\u77e9\u9635\u6062\u590d\u6444\u50cf\u673a\u77e9\u9635"},{"location":"cv/mvg/calc-p/","text":"\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 p \u00b6 \u7ea6 1967 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u7531 3 \u7ef4\u7a7a\u95f4\u4e0e\u56fe\u50cf\u5e73\u9762\u5143\u7d20\u95f4\u7684\u5bf9\u5e94\u6765\u4f30\u8ba1\u6444\u50cf\u673a\u6295\u5f71\u77e9\u9635\u7684\u6570\u503c\u65b9\u6cd5\uff08\u7b80\u79f0\u786e\u5b9a\u6444\u50cf\u673a\u53c2\u6570\uff09 \u57fa\u672c\u65b9\u7a0b \u00b6 \u5bf9\u4e8e\u6bcf\u7ec4\u5bf9\u5e94 \\(\\mathbf{X}_i \\leftrightarrow \\mathbf{x}_i\\) \uff0c\u53ef\u4ee5\u5f97\u51fa\u4e0b\u9762\u5173\u7cfb\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i\\mathbf{X}_i^\\top & y_i\\mathbf{X}_i^\\top \\\\ w_i\\mathbf{X}_i^\\top & \\mathbf{0}^\\top & -x_i\\mathbf{X}_i^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{p}_1 \\\\ \\mathbf{p}_2 \\\\ \\mathbf{p}_3 \\end{bmatrix} = \\mathbf{0} \\] \u6700\u5c0f\u914d\u7f6e\u89e3 \uff1a\u77e9\u9635 P \u6709 12 \u4e2a\u5143\u7d20\u548c\uff08\u5ffd\u7565\u7f29\u653e\u56e0\u5b50\uff0911 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u89e3 P \u9700\u8981 11 \u4e2a\u65b9\u7a0b\u3002\u7ed9\u5b9a\u8fd9\u4e2a\u6700\u5c0f\u6570\u76ee\u7684\u5bf9\u5e94\u65f6\uff0c\u89e3\u65f6\u7cbe\u786e\u7684\uff0c\u5373\u7a7a\u95f4\u7684\u70b9\u51c6\u786e\u5730\u6295\u5f71\u5230\u5b83\u4eec\u88ab\u6d4b\u91cf\u5230\u56fe\u50cf\u4e0a \u8d85\u5b9a\u89e3 \uff1a\u5982\u679c\u7531\u4e8e\u70b9\u5750\u6807\u7684\u566a\u58f0\u5bfc\u81f4\u6570\u636e\u4e0d\u7cbe\u786e\u5e76\u4e14\u7ed9\u5b9a \\(n \\ge 6\\) \u7ec4\u70b9\u5bf9\u5e94\uff0c\u90a3\u4e48 \\(A\\mathbf{p}=\\mathbf{0}\\) \u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002P \u7684\u89e3\u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u4ee3\u6570\u6216\u51e0\u4f55\u8bef\u5dee\u6765\u83b7\u5f97\u3002\u6c42 \\(\\parallel A \\mathbf{p} \\parallel\\) \u7684\u6700\u5c0f\u503c\uff0c\u53ef\u80fd\u7684\u7ea6\u675f\u662f\uff1a \\(\\parallel \\mathbf{p} \\parallel = 1\\) \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{p}}^3\\) \u662f\u7531 P \u6700\u540e\u4e00\u884c\u7684\u524d\u4e09\u4e2a\u5143\u7d20\u7ec4\u6210\u7684\u77e2\u91cf \\((p_{31},p_{32},p_{33})^\\top\\) \u9000\u5316\u914d\u7f6e \u6444\u50cf\u673a\u4e2d\u5fc3\u548c\u70b9\u90fd\u5728\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u4e0a \u8fd9\u4e9b\u70b9\u90fd\u5728\u4e00\u5f20\u5e73\u9762\u548c\u5305\u542b\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u5e76\u96c6\u4e0a \u6570\u636e\u5f52\u4e00\u5316 \uff1a\u5f53\u70b9\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\u53d8\u5316\u76f8\u5bf9\u6bd4\u8f83\u5c0f\u65f6\uff0c\u91c7\u7528\u540c\u6837\u7c7b\u578b\u7684\u5f52\u4e00\u5316\u3002\u56e0\u6b64\uff0c\u628a\u70b9\u7684\u5f62\u5fc3\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u5e76\u5bf9\u5b83\u4eec\u7684\u5750\u6807\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684 RMS\uff08\u5747\u65b9\u6839\uff09\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{3}\\) \u3002\u9002\u7528\u4e8e\u70b9\u7d27\u81f4\u5206\u5e03\u7684\u60c5\u5f62 \u76f4\u7ebf\u5bf9\u5e94 \uff1a3D \u4e2d\u7684\u76f4\u7ebf\u53ef\u4ee5\u7528\u5b83\u901a\u8fc7\u7684\u4e24\u70b9 \\(\\mathbf{X}_0\\) \u548c \\(\\mathbf{X}_1\\) \u6765\u8868\u793a\u3002\u7531\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5f97\u5230\u7684\u5e73\u9762\u4e3a \\(P^\\top\\mathbf{l}\\) \u3002\u90a3\u4e48\u70b9 \\(\\mathbf{X}_j\\) \u5728\u8be5\u5e73\u9762\u4e0a\u7684\u6761\u4ef6\u662f \\(\\mathbf{l}^\\top P \\mathbf{X}_j = 0\\) \uff0c\u5176\u4e2d \\(j=0,1\\) \u51e0\u4f55\u8bef\u5dee \u00b6 \u56fe\u50cf\u4e2d\u7684\u51e0\u4f55\u8bef\u5dee \\(\\underset{i}{\\sum}d(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_i\\) \u662f\u88ab\u6d4b\u91cf\u7684\u70b9\uff0c \\(\\hat{\\mathbf{x}}_i\\) \u662f\u70b9 \\(P\\mathbf{X}_i\\) \uff0c\u5373 \\(\\mathbf{X}_i\\) \u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u7cbe\u786e\u7684\u56fe\u50cf\u70b9 \u5982\u679c\u6d4b\u91cf\u8bef\u5dee\u6ee1\u8db3\u9ad8\u65af\u5206\u5e03\uff0c\u90a3\u4e48 \\(\\underset{P}{\\min}\\underset{i}{\\sum}d(\\mathbf{x}_i,P\\mathbf{X}_i)^2\\) \u7684\u89e3\u662f \\(P\\) \u7684\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u4e16\u754c\u70b9\u6709\u8bef\u5dee 3D \u51e0\u4f55\u8bef\u5dee\u5b9a\u4e49\u4e3a\uff1a \\(\\underset{i}{\\sum}d(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u7684\u8bef\u5dee\u90fd\u8003\u8651\uff1a \\(\\underset{i=1}{\\sum}d_{Mah}(\\mathbf{x}_i,P\\hat{\\mathbf{X}}_i)^2+d_{Mah}(\\mathbf{X}+\\hat{\\mathbf{X}}_i)^2\\) \uff0c \\(d_{Mah}\\) \u8868\u793a\u8bef\u5dee\u534f\u65b9\u5dee\u77e9\u9635\u7684 Mahalanobis \u8ddd\u79bb \u4ee3\u6570\u8bef\u5dee\u7684\u96c6\u5408\u89e3\u91ca \u00b6 \u5047\u5b9a\u6240\u6709\u7684\u70b9 \\(\\mathbf{X}_i\\) \u5728 DLT \u7b97\u6cd5\u4e2d\u5df2\u7ecf\u5f52\u4e00\u5316\uff0cDLT \u7b97\u6cd5\u8981\u6700\u5c0f\u5316\u7684\u91cf\u662f\uff1a \\(\\sum_{i}(\\hat{w}_id(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i))^2\\) \uff0c\u5176\u4e2d \\(\\hat{w}(\\hat{x}_i,\\hat{y}_i,1)^\\top=P\\mathbf{X}_i\\) \uff0c \\(\\hat{w}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u70b9 \\(\\mathbf{X}_i\\) \u6cbf\u4e3b\u8f74\u65b9\u5411\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\uff0c\u8981\u6700\u5c0f\u5316\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4e8e \\(f\\sum_id(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u53d8\u6362\u4e0d\u53d8\u6027 \uff1a\u5728\u7ea6\u675f \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316 \\(A\\mathbf{p}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u6700\u5c0f\u5316 3D \u51e0\u4f55\u8ddd\u79bb\u3002\u8fd9\u6837\u65e2\u4e0d\u53d7 3D \u7a7a\u95f4\u4e5f\u4e0d\u53d7\u56fe\u50cf\u7a7a\u95f4\u7684\u76f8\u4f3c\u53d8\u6362\u7684\u5f71\u54cd \u4eff\u5c04\u6444\u50cf\u673a\u7684\u4f30\u8ba1 \u00b6 \u4e0a\u9762\u6709\u5173\u5c04\u5f71\u6444\u50cf\u673a\u63a8\u5bfc\u7684\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u4eff\u5c04\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u5b9a\u4e49\u4e3a\u5c04\u5f71\u77e9\u9635\u7684\u6700\u540e\u4e00\u884c\u662f \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u7684 DLT \u4f30\u8ba1\u662f\u5728 \\(P\\) \u7684\u6700\u540e\u4e00\u884c\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u4e0b\u6700\u5c0f\u5316 \\(\\parallel A \\mathbf{p} \\parallel\\) \u53d7\u9650\u6444\u50cf\u673a\u4f30\u8ba1 \u00b6 \u5728\u5173\u4e8e\u6444\u50cf\u673a\u53c2\u6570\u7684\u9650\u5236\u6761\u4ef6\u4e0b\u5bfb\u6c42\u4e00\u4e2a\u6700\u9002\u914d\u7684\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \uff0c\u901a\u5e38\u7684\u9650\u5236\u6709 \u626d\u66f2 \\(s\\) \u4e3a 0 \u50cf\u7d20\u662f\u6b63\u65b9\u5f62: \\(\\alpha_x=\\alpha_y\\) \u4e3b\u70b9 \\((x_0,y_0)^2\\) \u5df2\u77e5 \u6574\u4e2a\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u5df2\u77e5 \u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee \uff1a\u5047\u5b9a\u6211\u4eec\u5f3a\u8c03\u7ea6\u675f \\(s=0\\) \u548c \\(\\alpha_x=\\alpha_y\\) \uff0c\u7528\u4f59\u4e0b\u7684 9 \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u6444\u50cf\u673a\u77e9\u9635\u3002\u51e0\u4f55\u8bef\u5dee\u53ef\u4ee5\u7528\u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5\u76f8\u5bf9\u4e8e\u8fd9\u7ec4\u53c2\u6570\u6765\u6700\u5c0f\u5316 \u6700\u5c0f\u5316\u4ee3\u6570\u8bef\u5dee \uff1a\u8003\u8651\u628a\u53c2\u6570\u96c6 \\(\\mathbf{q}\\) \u6620\u5c04\u5230\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u53c2\u6570\u5316\u6620\u5c04 \\(g\\) \uff0c\u6700\u5c0f\u5316\u6240\u6709\u70b9\u5339\u914d\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 \\(\\parallel Ag(\\mathbf{q}) \\parallel\\) \u7b80\u5316\u7684\u6d4b\u91cf\u77e9\u9635 \uff1a\u4e00\u822c\uff0c \\(2n \\times 12\\) \u7684\u77e9\u9635 \\(A\\) \u53ef\u80fd\u6709\u5f88\u591a\u884c\u3002\u4f46\u53ef\u7528\u4e00\u4e2a \\(12 \\times 12\\) \u7684\u77e9\u9635 \\(\\hat{A}\\) \u6765\u4ee3\u66ff \\(A\\) \uff0c\u4f7f\u5f97\u5bf9\u4efb\u4f55\u77e2\u91cf \\(\\mathbf{p}\\) \u6709 \\(\\parallel A \\mathbf{p} \\parallel = \\mathbf{p}^\\top A^\\top A \\mathbf{p} = \\parallel \\hat{A} \\mathbf{p} \\parallel\\) \u521d\u59cb\u5316 \uff1a\u6c42\u6444\u50cf\u673a\u521d\u59cb\u5316\u53c2\u6570\u7684\u4e00\u79cd\u9014\u5f84\uff1a \u7528\u8bf8\u5982 DLT \u7684\u7ebf\u6027\u7b97\u6cd5\u6c42\u51fa\u4e00\u4e2a\u521d\u59cb\u7684\u6444\u50cf\u673a\u77e9\u9635 \u628a\u56fa\u5b9a\u53c2\u6570\u5f3a\u5236\u5230\u6240\u5e0c\u671b\u7684\u53d6\u503c\u8303\u56f4 \u628a\u6444\u50cf\u673a\u77e9\u9635\u5206\u89e3\u6240\u83b7\u5f97\u7684\u521d\u59cb\u503c\u8d4b\u7ed9\u53c2\u6570\u53d8\u91cf \u5916\u90e8\u6821\u51c6 \uff1a\u4e3a\u4e86\u8ba1\u7b97\u5916\u90e8\u6821\u51c6\uff0c\u9700\u5bf9\u4e16\u754c\u5750\u6807\u4f4d\u7f6e\u51c6\u786e\u5df2\u77e5\u7684\u4e00\u4e2a\u914d\u7f6e\u8fdb\u884c\u5f71\u50cf\u3002\u4e4b\u540e\u6c42\u6444\u50cf\u673a\u7684\u59ff\u6001\u3002\u5728\u673a\u5668\u4eba\u7cfb\u7edf\u7684\u624b\u773c\u6807\u5b9a\u4e2d\u6c42\u6444\u50cf\u673a\u4f4d\u7f6e\u5c31\u662f\u8fd9\u6837\u7684\u60c5\u5f62\uff1b\u8fd8\u6709\u5728\u91c7\u7528\u914d\u51c6\u6280\u672f\u7684\u57fa\u4e8e\u6a21\u578b\u7684\u8bc6\u522b\u4e2d\uff0c\u9700\u8981\u77e5\u9053\u7269\u4f53\u76f8\u5bf9\u6444\u50cf\u673a\u7684\u4f4d\u7f6e \u534f\u65b9\u5dee\u4f30\u8ba1 \uff1a\u5047\u5b9a\u6240\u6709\u7684\u65e0\u64e6\u597d\u4ec5\u53d1\u751f\u5728\u56fe\u50cf\u6d4b\u91cf\u4e2d\uff0cML \u6b8b\u5dee\u671f\u671b\u503c\u7b49\u4e8e \\(\\varepsilon_{res}=\\delta(1-d/2n)^{1/2}\\) \uff0c\u5176\u4e2d \\(d\\) \u662f\u8981\u62df\u5408\u7684\u6444\u50cf\u673a\u53c2\u6570\u6570\u76ee\uff08\u5bf9\u5b8c\u6574\u7684\u9488\u5b54\u6444\u50cf\u673a\u6a21\u578b\u662f 11\uff09\u3002\u7ed9\u5b9a\u4e00\u4e2a\u6b8b\u5dee\uff0c\u8be5\u516c\u5f0f\u4e5f\u53ef\u4ee5\u7528\u6765\u4f30\u8ba1\u70b9\u6d4b\u91cf\u7684\u51c6\u786e\u6027 \u5f84\u5411\u5931\u771f \u00b6 \u7528 \\((\\tilde{x},\\tilde{y})^\\top\\) \u6807\u8bb0\u5728\u7406\u60f3\uff08\u975e\u5931\u771f\uff09\u9488\u5b54\u6295\u5f71\u4e0b\u70b9\u4ee5\u7126\u8ddd\u4e3a\u6d4b\u91cf\u5355\u4f4d\u7684\u5750\u6807\u3002\u5bf9\u4e00\u70b9 \\(\\mathbf{X}\\) \u6709\uff1a \\((\\tilde{x},\\tilde{y},1)^\\top=[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u4e0b\u7684 3D \u70b9\uff0c\u5b9e\u9645\u7684\u6295\u5f71\u70b9\u901a\u8fc7\u4e00\u4e2a\u5f84\u5411\u4f4d\u79fb\u4e0e\u7406\u60f3\u70b9\u5173\u8054\u3002\u56e0\u6b64\uff0c\u5f84\u5411\uff08\u900f\u955c\uff09\u5931\u771f\u7684\u6a21\u578b\u662f\uff1a \\[\\begin{bmatrix} x_d \\\\ y_d \\end{bmatrix}=L(\\tilde{r})\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\end{bmatrix}\\] \\((\\tilde{x},\\tilde{y})^\\top\\) \u662f\u7406\u60f3\u56fe\u50cf\u4f4d\u7f6e\uff08\u9075\u5faa\u7ebf\u6027\u6295\u5f71\uff09 \\((x_d,y_d)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u540e\u7684\u5b9e\u9645\u56fe\u50cf\u7684\u4f4d\u7f6e \\(\\tilde{r}\\) \u4e3a\u5f84\u5411\u5931\u771f\u4e2d\u5fc3\u7684\u5f84\u5411\u8ddd\u79bb \\(\\sqrt{\\tilde{x}^2+\\tilde{y}^2}\\) \\(L(\\tilde{r})\\) \u662f\u4e00\u4e2a\u5931\u771f\u56e0\u5b50\uff0c\u5b83\u4ec5\u4ec5\u662f\u534a\u5f84 \\(\\tilde{r}\\) \u7684\u51fd\u6570 \u5931\u771f\u77eb\u6b63 \uff1a\u5728\u50cf\u7d20\u5750\u6807\u4e2d\uff0c\u5931\u771f\u77eb\u6b63\u8bb0\u4e3a \\[ \\hat{x}=x_c+L(r)(x-x_c) \\ \\ \\ \\ \\ \\ \\hat{y}=y_c+L(r)(y-y_c) \\] \\((x,y)^\\top\\) \u662f\u6d4b\u91cf\u7684\u5750\u6807 \\((\\hat{x},\\hat{y})^\\top\\) \u662f\u77eb\u6b63\u540e\u7684\u5750\u6807 \\((x_c,y_c)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\u4e14 \\(r^2=(x-x_c)^2+(y-y_c)^2\\) \uff0c\u6ce8\u610f\u5982\u679c\u957f\u5bbd\u6bd4\u4e0d\u662f 1\uff0c\u90a3\u4e48\u5728\u8ba1\u7b97 \\(r\\) \u65f6\u5fc5\u987b\u5bf9\u5b83\u8fdb\u884c\u77eb\u6b63 \u5931\u771f\u51fd\u6570\u548c\u4e2d\u5fc3\u7684\u9009\u62e9 \uff1a\u51fd\u6570 \\(L(r)\\) \u4ec5\u5f53 \\(r\\) \u4e3a\u6b63\u503c\u65f6\u6709\u5b9a\u4e49\u5e76\u4e14 \\(L(0)=1\\) \u3002\u4e00\u4e2a\u4efb\u610f\u51fd\u6570 \\(L(r)\\) \u7684\u903c\u8fd1\u53ef\u4ee5\u7531\u6cf0\u52d2\u5c55\u5f00\u5f0f \\(L(r)=1+\\mathcal{k}_1r+\\mathcal{k}_2r^2+\\mathcal{k}_3r^3+...\\) \u3002 \\(\\{k_1,k_2,k_3,...,x_c,y_c\\}\\) \u662f\u5f84\u5411\u77eb\u6b63\u7684\u7cfb\u6570\u3002\u4e3b\u70b9\u7ecf\u5e38\u88ab\u7528\u4f5c\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\uff0c\u867d\u7136\u5b83\u4eec\u672a\u5fc5\u5b8c\u5168\u91cd\u5408 \u8ba1\u7b97\u5931\u771f\u51fd\u6570 \uff1a\u51fd\u6570 \\(L(r)\\) \u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u57fa\u4e8e\u6620\u5c04\u7684\u7ebf\u6027\u504f\u5dee\u7684\u4ee3\u4ef7\u51fd\u6570\u6765\u8ba1\u7b97\u3002\u5931\u771f\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u5f71\u50cf\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\uff0c\u628a\u53c2\u6570 \\(k_i\\) \u4e0e \\(P\\) \u4e00\u8d77\u5728\u51e0\u4f55\u8bef\u5dee\u7684\u6700\u5c0f\u5316\u8fed\u4ee3\u4e2d\u8ba1\u7b97","title":"\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 P"},{"location":"cv/mvg/calc-p/#p","text":"\u7ea6 1967 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u7531 3 \u7ef4\u7a7a\u95f4\u4e0e\u56fe\u50cf\u5e73\u9762\u5143\u7d20\u95f4\u7684\u5bf9\u5e94\u6765\u4f30\u8ba1\u6444\u50cf\u673a\u6295\u5f71\u77e9\u9635\u7684\u6570\u503c\u65b9\u6cd5\uff08\u7b80\u79f0\u786e\u5b9a\u6444\u50cf\u673a\u53c2\u6570\uff09","title":"\u8ba1\u7b97\u6444\u50cf\u673a\u77e9\u9635 p"},{"location":"cv/mvg/calc-p/#_1","text":"\u5bf9\u4e8e\u6bcf\u7ec4\u5bf9\u5e94 \\(\\mathbf{X}_i \\leftrightarrow \\mathbf{x}_i\\) \uff0c\u53ef\u4ee5\u5f97\u51fa\u4e0b\u9762\u5173\u7cfb\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i\\mathbf{X}_i^\\top & y_i\\mathbf{X}_i^\\top \\\\ w_i\\mathbf{X}_i^\\top & \\mathbf{0}^\\top & -x_i\\mathbf{X}_i^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{p}_1 \\\\ \\mathbf{p}_2 \\\\ \\mathbf{p}_3 \\end{bmatrix} = \\mathbf{0} \\] \u6700\u5c0f\u914d\u7f6e\u89e3 \uff1a\u77e9\u9635 P \u6709 12 \u4e2a\u5143\u7d20\u548c\uff08\u5ffd\u7565\u7f29\u653e\u56e0\u5b50\uff0911 \u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u89e3 P \u9700\u8981 11 \u4e2a\u65b9\u7a0b\u3002\u7ed9\u5b9a\u8fd9\u4e2a\u6700\u5c0f\u6570\u76ee\u7684\u5bf9\u5e94\u65f6\uff0c\u89e3\u65f6\u7cbe\u786e\u7684\uff0c\u5373\u7a7a\u95f4\u7684\u70b9\u51c6\u786e\u5730\u6295\u5f71\u5230\u5b83\u4eec\u88ab\u6d4b\u91cf\u5230\u56fe\u50cf\u4e0a \u8d85\u5b9a\u89e3 \uff1a\u5982\u679c\u7531\u4e8e\u70b9\u5750\u6807\u7684\u566a\u58f0\u5bfc\u81f4\u6570\u636e\u4e0d\u7cbe\u786e\u5e76\u4e14\u7ed9\u5b9a \\(n \\ge 6\\) \u7ec4\u70b9\u5bf9\u5e94\uff0c\u90a3\u4e48 \\(A\\mathbf{p}=\\mathbf{0}\\) \u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002P \u7684\u89e3\u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u4ee3\u6570\u6216\u51e0\u4f55\u8bef\u5dee\u6765\u83b7\u5f97\u3002\u6c42 \\(\\parallel A \\mathbf{p} \\parallel\\) \u7684\u6700\u5c0f\u503c\uff0c\u53ef\u80fd\u7684\u7ea6\u675f\u662f\uff1a \\(\\parallel \\mathbf{p} \\parallel = 1\\) \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \uff0c\u5176\u4e2d \\(\\hat{\\mathbf{p}}^3\\) \u662f\u7531 P \u6700\u540e\u4e00\u884c\u7684\u524d\u4e09\u4e2a\u5143\u7d20\u7ec4\u6210\u7684\u77e2\u91cf \\((p_{31},p_{32},p_{33})^\\top\\) \u9000\u5316\u914d\u7f6e \u6444\u50cf\u673a\u4e2d\u5fc3\u548c\u70b9\u90fd\u5728\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u4e0a \u8fd9\u4e9b\u70b9\u90fd\u5728\u4e00\u5f20\u5e73\u9762\u548c\u5305\u542b\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u5e76\u96c6\u4e0a \u6570\u636e\u5f52\u4e00\u5316 \uff1a\u5f53\u70b9\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\u53d8\u5316\u76f8\u5bf9\u6bd4\u8f83\u5c0f\u65f6\uff0c\u91c7\u7528\u540c\u6837\u7c7b\u578b\u7684\u5f52\u4e00\u5316\u3002\u56e0\u6b64\uff0c\u628a\u70b9\u7684\u5f62\u5fc3\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u5e76\u5bf9\u5b83\u4eec\u7684\u5750\u6807\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684 RMS\uff08\u5747\u65b9\u6839\uff09\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{3}\\) \u3002\u9002\u7528\u4e8e\u70b9\u7d27\u81f4\u5206\u5e03\u7684\u60c5\u5f62 \u76f4\u7ebf\u5bf9\u5e94 \uff1a3D \u4e2d\u7684\u76f4\u7ebf\u53ef\u4ee5\u7528\u5b83\u901a\u8fc7\u7684\u4e24\u70b9 \\(\\mathbf{X}_0\\) \u548c \\(\\mathbf{X}_1\\) \u6765\u8868\u793a\u3002\u7531\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5f97\u5230\u7684\u5e73\u9762\u4e3a \\(P^\\top\\mathbf{l}\\) \u3002\u90a3\u4e48\u70b9 \\(\\mathbf{X}_j\\) \u5728\u8be5\u5e73\u9762\u4e0a\u7684\u6761\u4ef6\u662f \\(\\mathbf{l}^\\top P \\mathbf{X}_j = 0\\) \uff0c\u5176\u4e2d \\(j=0,1\\)","title":"\u57fa\u672c\u65b9\u7a0b"},{"location":"cv/mvg/calc-p/#_2","text":"\u56fe\u50cf\u4e2d\u7684\u51e0\u4f55\u8bef\u5dee \\(\\underset{i}{\\sum}d(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}_i\\) \u662f\u88ab\u6d4b\u91cf\u7684\u70b9\uff0c \\(\\hat{\\mathbf{x}}_i\\) \u662f\u70b9 \\(P\\mathbf{X}_i\\) \uff0c\u5373 \\(\\mathbf{X}_i\\) \u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u7cbe\u786e\u7684\u56fe\u50cf\u70b9 \u5982\u679c\u6d4b\u91cf\u8bef\u5dee\u6ee1\u8db3\u9ad8\u65af\u5206\u5e03\uff0c\u90a3\u4e48 \\(\\underset{P}{\\min}\\underset{i}{\\sum}d(\\mathbf{x}_i,P\\mathbf{X}_i)^2\\) \u7684\u89e3\u662f \\(P\\) \u7684\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u4e16\u754c\u70b9\u6709\u8bef\u5dee 3D \u51e0\u4f55\u8bef\u5dee\u5b9a\u4e49\u4e3a\uff1a \\(\\underset{i}{\\sum}d(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u7684\u8bef\u5dee\u90fd\u8003\u8651\uff1a \\(\\underset{i=1}{\\sum}d_{Mah}(\\mathbf{x}_i,P\\hat{\\mathbf{X}}_i)^2+d_{Mah}(\\mathbf{X}+\\hat{\\mathbf{X}}_i)^2\\) \uff0c \\(d_{Mah}\\) \u8868\u793a\u8bef\u5dee\u534f\u65b9\u5dee\u77e9\u9635\u7684 Mahalanobis \u8ddd\u79bb","title":"\u51e0\u4f55\u8bef\u5dee"},{"location":"cv/mvg/calc-p/#_3","text":"\u5047\u5b9a\u6240\u6709\u7684\u70b9 \\(\\mathbf{X}_i\\) \u5728 DLT \u7b97\u6cd5\u4e2d\u5df2\u7ecf\u5f52\u4e00\u5316\uff0cDLT \u7b97\u6cd5\u8981\u6700\u5c0f\u5316\u7684\u91cf\u662f\uff1a \\(\\sum_{i}(\\hat{w}_id(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i))^2\\) \uff0c\u5176\u4e2d \\(\\hat{w}(\\hat{x}_i,\\hat{y}_i,1)^\\top=P\\mathbf{X}_i\\) \uff0c \\(\\hat{w}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u70b9 \\(\\mathbf{X}_i\\) \u6cbf\u4e3b\u8f74\u65b9\u5411\u5230\u6444\u50cf\u673a\u7684\u6df1\u5ea6\uff0c\u8981\u6700\u5c0f\u5316\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4e8e \\(f\\sum_id(\\mathbf{X}_i,\\hat{\\mathbf{X}}_i)^2\\) \u53d8\u6362\u4e0d\u53d8\u6027 \uff1a\u5728\u7ea6\u675f \\(\\parallel \\hat{\\mathbf{p}}^3 \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316 \\(A\\mathbf{p}\\) \u53ef\u4ee5\u89e3\u91ca\u6210\u6700\u5c0f\u5316 3D \u51e0\u4f55\u8ddd\u79bb\u3002\u8fd9\u6837\u65e2\u4e0d\u53d7 3D \u7a7a\u95f4\u4e5f\u4e0d\u53d7\u56fe\u50cf\u7a7a\u95f4\u7684\u76f8\u4f3c\u53d8\u6362\u7684\u5f71\u54cd","title":"\u4ee3\u6570\u8bef\u5dee\u7684\u96c6\u5408\u89e3\u91ca"},{"location":"cv/mvg/calc-p/#_4","text":"\u4e0a\u9762\u6709\u5173\u5c04\u5f71\u6444\u50cf\u673a\u63a8\u5bfc\u7684\u65b9\u6cd5\u53ef\u4ee5\u76f4\u63a5\u7528\u4e8e\u4eff\u5c04\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u5b9a\u4e49\u4e3a\u5c04\u5f71\u77e9\u9635\u7684\u6700\u540e\u4e00\u884c\u662f \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a\u3002\u4eff\u5c04\u6444\u50cf\u673a\u7684 DLT \u4f30\u8ba1\u662f\u5728 \\(P\\) \u7684\u6700\u540e\u4e00\u884c\u6ee1\u8db3\u4e0a\u8ff0\u6761\u4ef6\u4e0b\u6700\u5c0f\u5316 \\(\\parallel A \\mathbf{p} \\parallel\\)","title":"\u4eff\u5c04\u6444\u50cf\u673a\u7684\u4f30\u8ba1"},{"location":"cv/mvg/calc-p/#_5","text":"\u5728\u5173\u4e8e\u6444\u50cf\u673a\u53c2\u6570\u7684\u9650\u5236\u6761\u4ef6\u4e0b\u5bfb\u6c42\u4e00\u4e2a\u6700\u9002\u914d\u7684\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \uff0c\u901a\u5e38\u7684\u9650\u5236\u6709 \u626d\u66f2 \\(s\\) \u4e3a 0 \u50cf\u7d20\u662f\u6b63\u65b9\u5f62: \\(\\alpha_x=\\alpha_y\\) \u4e3b\u70b9 \\((x_0,y_0)^2\\) \u5df2\u77e5 \u6574\u4e2a\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u5df2\u77e5 \u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee \uff1a\u5047\u5b9a\u6211\u4eec\u5f3a\u8c03\u7ea6\u675f \\(s=0\\) \u548c \\(\\alpha_x=\\alpha_y\\) \uff0c\u7528\u4f59\u4e0b\u7684 9 \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u6444\u50cf\u673a\u77e9\u9635\u3002\u51e0\u4f55\u8bef\u5dee\u53ef\u4ee5\u7528\u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5\u76f8\u5bf9\u4e8e\u8fd9\u7ec4\u53c2\u6570\u6765\u6700\u5c0f\u5316 \u6700\u5c0f\u5316\u4ee3\u6570\u8bef\u5dee \uff1a\u8003\u8651\u628a\u53c2\u6570\u96c6 \\(\\mathbf{q}\\) \u6620\u5c04\u5230\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u53c2\u6570\u5316\u6620\u5c04 \\(g\\) \uff0c\u6700\u5c0f\u5316\u6240\u6709\u70b9\u5339\u914d\u7684\u4ee3\u6570\u8bef\u5dee\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 \\(\\parallel Ag(\\mathbf{q}) \\parallel\\) \u7b80\u5316\u7684\u6d4b\u91cf\u77e9\u9635 \uff1a\u4e00\u822c\uff0c \\(2n \\times 12\\) \u7684\u77e9\u9635 \\(A\\) \u53ef\u80fd\u6709\u5f88\u591a\u884c\u3002\u4f46\u53ef\u7528\u4e00\u4e2a \\(12 \\times 12\\) \u7684\u77e9\u9635 \\(\\hat{A}\\) \u6765\u4ee3\u66ff \\(A\\) \uff0c\u4f7f\u5f97\u5bf9\u4efb\u4f55\u77e2\u91cf \\(\\mathbf{p}\\) \u6709 \\(\\parallel A \\mathbf{p} \\parallel = \\mathbf{p}^\\top A^\\top A \\mathbf{p} = \\parallel \\hat{A} \\mathbf{p} \\parallel\\) \u521d\u59cb\u5316 \uff1a\u6c42\u6444\u50cf\u673a\u521d\u59cb\u5316\u53c2\u6570\u7684\u4e00\u79cd\u9014\u5f84\uff1a \u7528\u8bf8\u5982 DLT \u7684\u7ebf\u6027\u7b97\u6cd5\u6c42\u51fa\u4e00\u4e2a\u521d\u59cb\u7684\u6444\u50cf\u673a\u77e9\u9635 \u628a\u56fa\u5b9a\u53c2\u6570\u5f3a\u5236\u5230\u6240\u5e0c\u671b\u7684\u53d6\u503c\u8303\u56f4 \u628a\u6444\u50cf\u673a\u77e9\u9635\u5206\u89e3\u6240\u83b7\u5f97\u7684\u521d\u59cb\u503c\u8d4b\u7ed9\u53c2\u6570\u53d8\u91cf \u5916\u90e8\u6821\u51c6 \uff1a\u4e3a\u4e86\u8ba1\u7b97\u5916\u90e8\u6821\u51c6\uff0c\u9700\u5bf9\u4e16\u754c\u5750\u6807\u4f4d\u7f6e\u51c6\u786e\u5df2\u77e5\u7684\u4e00\u4e2a\u914d\u7f6e\u8fdb\u884c\u5f71\u50cf\u3002\u4e4b\u540e\u6c42\u6444\u50cf\u673a\u7684\u59ff\u6001\u3002\u5728\u673a\u5668\u4eba\u7cfb\u7edf\u7684\u624b\u773c\u6807\u5b9a\u4e2d\u6c42\u6444\u50cf\u673a\u4f4d\u7f6e\u5c31\u662f\u8fd9\u6837\u7684\u60c5\u5f62\uff1b\u8fd8\u6709\u5728\u91c7\u7528\u914d\u51c6\u6280\u672f\u7684\u57fa\u4e8e\u6a21\u578b\u7684\u8bc6\u522b\u4e2d\uff0c\u9700\u8981\u77e5\u9053\u7269\u4f53\u76f8\u5bf9\u6444\u50cf\u673a\u7684\u4f4d\u7f6e \u534f\u65b9\u5dee\u4f30\u8ba1 \uff1a\u5047\u5b9a\u6240\u6709\u7684\u65e0\u64e6\u597d\u4ec5\u53d1\u751f\u5728\u56fe\u50cf\u6d4b\u91cf\u4e2d\uff0cML \u6b8b\u5dee\u671f\u671b\u503c\u7b49\u4e8e \\(\\varepsilon_{res}=\\delta(1-d/2n)^{1/2}\\) \uff0c\u5176\u4e2d \\(d\\) \u662f\u8981\u62df\u5408\u7684\u6444\u50cf\u673a\u53c2\u6570\u6570\u76ee\uff08\u5bf9\u5b8c\u6574\u7684\u9488\u5b54\u6444\u50cf\u673a\u6a21\u578b\u662f 11\uff09\u3002\u7ed9\u5b9a\u4e00\u4e2a\u6b8b\u5dee\uff0c\u8be5\u516c\u5f0f\u4e5f\u53ef\u4ee5\u7528\u6765\u4f30\u8ba1\u70b9\u6d4b\u91cf\u7684\u51c6\u786e\u6027","title":"\u53d7\u9650\u6444\u50cf\u673a\u4f30\u8ba1"},{"location":"cv/mvg/calc-p/#_6","text":"\u7528 \\((\\tilde{x},\\tilde{y})^\\top\\) \u6807\u8bb0\u5728\u7406\u60f3\uff08\u975e\u5931\u771f\uff09\u9488\u5b54\u6295\u5f71\u4e0b\u70b9\u4ee5\u7126\u8ddd\u4e3a\u6d4b\u91cf\u5355\u4f4d\u7684\u5750\u6807\u3002\u5bf9\u4e00\u70b9 \\(\\mathbf{X}\\) \u6709\uff1a \\((\\tilde{x},\\tilde{y},1)^\\top=[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u4e0b\u7684 3D \u70b9\uff0c\u5b9e\u9645\u7684\u6295\u5f71\u70b9\u901a\u8fc7\u4e00\u4e2a\u5f84\u5411\u4f4d\u79fb\u4e0e\u7406\u60f3\u70b9\u5173\u8054\u3002\u56e0\u6b64\uff0c\u5f84\u5411\uff08\u900f\u955c\uff09\u5931\u771f\u7684\u6a21\u578b\u662f\uff1a \\[\\begin{bmatrix} x_d \\\\ y_d \\end{bmatrix}=L(\\tilde{r})\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\end{bmatrix}\\] \\((\\tilde{x},\\tilde{y})^\\top\\) \u662f\u7406\u60f3\u56fe\u50cf\u4f4d\u7f6e\uff08\u9075\u5faa\u7ebf\u6027\u6295\u5f71\uff09 \\((x_d,y_d)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u540e\u7684\u5b9e\u9645\u56fe\u50cf\u7684\u4f4d\u7f6e \\(\\tilde{r}\\) \u4e3a\u5f84\u5411\u5931\u771f\u4e2d\u5fc3\u7684\u5f84\u5411\u8ddd\u79bb \\(\\sqrt{\\tilde{x}^2+\\tilde{y}^2}\\) \\(L(\\tilde{r})\\) \u662f\u4e00\u4e2a\u5931\u771f\u56e0\u5b50\uff0c\u5b83\u4ec5\u4ec5\u662f\u534a\u5f84 \\(\\tilde{r}\\) \u7684\u51fd\u6570 \u5931\u771f\u77eb\u6b63 \uff1a\u5728\u50cf\u7d20\u5750\u6807\u4e2d\uff0c\u5931\u771f\u77eb\u6b63\u8bb0\u4e3a \\[ \\hat{x}=x_c+L(r)(x-x_c) \\ \\ \\ \\ \\ \\ \\hat{y}=y_c+L(r)(y-y_c) \\] \\((x,y)^\\top\\) \u662f\u6d4b\u91cf\u7684\u5750\u6807 \\((\\hat{x},\\hat{y})^\\top\\) \u662f\u77eb\u6b63\u540e\u7684\u5750\u6807 \\((x_c,y_c)^\\top\\) \u662f\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\u4e14 \\(r^2=(x-x_c)^2+(y-y_c)^2\\) \uff0c\u6ce8\u610f\u5982\u679c\u957f\u5bbd\u6bd4\u4e0d\u662f 1\uff0c\u90a3\u4e48\u5728\u8ba1\u7b97 \\(r\\) \u65f6\u5fc5\u987b\u5bf9\u5b83\u8fdb\u884c\u77eb\u6b63 \u5931\u771f\u51fd\u6570\u548c\u4e2d\u5fc3\u7684\u9009\u62e9 \uff1a\u51fd\u6570 \\(L(r)\\) \u4ec5\u5f53 \\(r\\) \u4e3a\u6b63\u503c\u65f6\u6709\u5b9a\u4e49\u5e76\u4e14 \\(L(0)=1\\) \u3002\u4e00\u4e2a\u4efb\u610f\u51fd\u6570 \\(L(r)\\) \u7684\u903c\u8fd1\u53ef\u4ee5\u7531\u6cf0\u52d2\u5c55\u5f00\u5f0f \\(L(r)=1+\\mathcal{k}_1r+\\mathcal{k}_2r^2+\\mathcal{k}_3r^3+...\\) \u3002 \\(\\{k_1,k_2,k_3,...,x_c,y_c\\}\\) \u662f\u5f84\u5411\u77eb\u6b63\u7684\u7cfb\u6570\u3002\u4e3b\u70b9\u7ecf\u5e38\u88ab\u7528\u4f5c\u5f84\u5411\u5931\u771f\u7684\u4e2d\u5fc3\uff0c\u867d\u7136\u5b83\u4eec\u672a\u5fc5\u5b8c\u5168\u91cd\u5408 \u8ba1\u7b97\u5931\u771f\u51fd\u6570 \uff1a\u51fd\u6570 \\(L(r)\\) \u53ef\u4ee5\u901a\u8fc7\u6700\u5c0f\u5316\u4e00\u4e2a\u57fa\u4e8e\u6620\u5c04\u7684\u7ebf\u6027\u504f\u5dee\u7684\u4ee3\u4ef7\u51fd\u6570\u6765\u8ba1\u7b97\u3002\u5931\u771f\u51fd\u6570\u53ef\u4ee5\u4f5c\u4e3a\u5f71\u50cf\u8fc7\u7a0b\u7684\u4e00\u90e8\u5206\uff0c\u628a\u53c2\u6570 \\(k_i\\) \u4e0e \\(P\\) \u4e00\u8d77\u5728\u51e0\u4f55\u8bef\u5dee\u7684\u6700\u5c0f\u5316\u8fed\u4ee3\u4e2d\u8ba1\u7b97","title":"\u5f84\u5411\u5931\u771f"},{"location":"cv/mvg/camera-model/","text":"\u6444\u50cf\u673a\u6a21\u578b \u00b6 \u7ea6 3055 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6444\u50cf\u673a\u662f 3D \u4e16\u754c\uff08\u7269\u4f53\u7a7a\u95f4\uff09\u548c 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u6620\u5c04\u3002\u591a\u89c6\u56fe\u4e2d\u4e3b\u8981\u5173\u5fc3 \u4e2d\u5fc3\u6295\u5f71 \u3002 \u5177\u4f53\u6a21\u578b\u4e3b\u8981\u5206\u6210\u6709\u9650\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u548c\u201c\u65e0\u7a77\u8fdc\u201d\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u3002 \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u70b9\u7684\u6295\u5f71\u3002 \u6709\u9650\u6444\u50cf\u673a \u00b6 \u57fa\u672c\u9488\u5b54\u6a21\u578b \u00b6 \u4ee4\u6295\u5f71\u4e2d\u5fc3\u4f4d\u4e8e\u4e00\u4e2a\u6b27\u6c0f\u5750\u6807\u7cfb\u7684\u539f\u70b9\uff0c\u800c\u5e73\u9762 \\(Z=f\\) \u88ab\u79f0\u4e3a \u56fe\u50cf\u5e73\u9762 \u6216 \u805a\u7126\u5e73\u9762 \u3002 \u5728\u9488\u5b54\u6a21\u578b\u4e0b\uff0c\u7a7a\u95f4\u5750\u6807\u4e3a \\(\\mathbf{X}=(X,Y,Z)^\\top\\) \uff0c\u4ece\u4e16\u754c\u5750\u6807\u5230\u56fe\u50cf\u5750\u6807\u7684\u4e2d\u5fc3\u6295\u5f71\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z,fY/Z)^\\top\\) \u5c04\u5f71\u4e2d\u5fc3\u79f0\u4e3a \u6444\u50cf\u673a\u4e2d\u5fc3 \uff0c\u4e5f\u6210 \u5149\u5fc3 \u3002 \u6444\u50cf\u673a\u4e2d\u5fc3\u5230\u56fe\u50cf\u5e73\u9762\u7684\u5782\u7ebf\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u8f74 \u6216 \u4e3b\u5c04\u7ebf \uff0c\u800c\u4e3b\u8f74\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u79f0\u4e3a \u4e3b\u70b9 \uff0c\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u5e73\u9762\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u5e73\u9762 \u3002 \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e2d\u5fc3\u6295\u5f71\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX \\\\ fY \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & 0 & 0 \\\\ 0 & f & 0 & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\\\ \\\\ \u4e0a\u5f0f\u4e5f\u53ef\u8868\u793a\u4e3a \\ \\ \\ \\mathbf{x}=P\\mathbf{X} \\ \\ \\ \u5176\u4e2d \\ \\mathbf{X}\u7528\u56db\u7ef4\u9f50\u6b21\u77e2\u91cf(X,Y,Z,1)^\\top \u8868\u793a \\ P = diag(f,f,1)[\\mathbf{I}|\\mathbf{0}] \\] \u4e3b\u70b9\u504f\u7f6e \u4e0a\u9762\u8ba8\u8bba\u7684\u56fe\u50cf\u5e73\u9762\u7684\u5750\u6807\u539f\u70b9\u5728\u4e3b\u70b9\u4e0a\uff0c\u4f46\u5b9e\u9645\u4e0a\u53ef\u80fd\u4e0d\u662f\uff0c\u4e00\u822c\u60c5\u5f62\u7684\u6620\u5c04\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z+p_x,fY/Z+p_y)^\\top\\) \uff0c\u6839\u636e\u4e0a\u5f0f\u63a8\u5bfc\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX+Zp_x \\\\ fY+Zp_y \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & p_x & 0 \\\\ 0 & f & p_y & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\\\ \\\\ \\end{bmatrix} \\] \u4ee4 \\(K = \\begin{bmatrix} f & 0 & p_x \\\\ 0 & f & p_y \\\\ 0 & 0 & 1 \\end{bmatrix}\\) , \u5219\u6709 \\(\\mathbf{x}=K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d\u70b9 \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u7cfb\uff0c\u77e9\u9635 \\(K\\) \u79f0\u4e3a \u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635\uff08\u5185\u53c2\u77e9\u9635\uff09 \uff0c \\([\\mathbf{I}|\\mathbf{0}]\\) \u79f0\u4e3a \u5916\u53c2\u77e9\u9635 \u3002 \u6444\u50cf\u673a\u65cb\u8f6c\u4e0e\u4f4d\u79fb \\[ X_{cam}= \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\mathbf{X} \\\\ \\mathbf{x}=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\mathbf{X} \\] \u4e00\u822c\u7684\u9488\u5b54\u6444\u50cf\u673a \\(P=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\) \u6709 9 \u4e2a\u81ea\u7531\u5ea6\uff1b3 \u4e2a\u6765\u81ea \\(K\\) \uff0c3 \u4e2a\u6765\u81ea \\(R\\) \uff0c3 \u4e2a\u6765\u81ea \\(\\tilde{\\mathbf{C}}\\) \u3002 \\(K\\) \u4e2d\u7684\u53c2\u6570\u79f0\u4e3a\u6444\u50cf\u673a \u5185\u90e8\u53c2\u6570 \u6216\u6444\u50cf\u673a\u7684 \u5185\u90e8\u6821\u51c6 \u3002 \\(R\\) \u548c \\(\\tilde{\\mathbf{C}}\\) \u5e76\u79f0\u4e3a \u5916\u90e8\u53c2\u6570 \u6216 \u5916\u90e8\u6821\u51c6 \u3002\u6444\u50cf\u673a\u77e9\u9635\u53ef\u7b80\u5316\u6210\uff1a \\[ \\mathbf{P}=K[R|\\mathbf{t}]\uff0c\u5176\u4e2d \\ \\mathbf{t}=-R\\tilde{\\mathbf{C}} \\] CCD \u6444\u50cf\u673a \u00b6 CCD \u6444\u50cf\u673a\u7684\u50cf\u7d20\u53ef\u80fd\u4e0d\u662f\u6b63\u65b9\u5f62\uff0c\u5982\u679c\u56fe\u50cf\u5750\u6807\u4ee5\u50cf\u7d20\u6765\u6d4b\u91cf\uff0c\u90a3\u4e48\u9700\u8981\u5728\u6bcf\u4e2a\u65b9\u5411\u4e0a\u5f15\u5165\u975e\u7b49\u91cf\u5c3a\u5ea6\u56e0\u5b50\u3002 \u4e00\u822c\u5f62\u5f0f\uff1a \\[ K= \\begin{bmatrix} \\alpha_x & 0 & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u5176\u4e2d \\(\\alpha_x=fm_x, \\alpha_y=fm_y,x_0=m_xp_x,y_0=m_yp_y\\) \u3002 \\(m_x,m_y\\) \u5206\u522b\u662f\u5728 x \u548c y \u65b9\u5411\u4e0a\u56fe\u50cf\u5750\u6807\u5355\u4f4d\u77e9\u9635\u7684\u50cf\u7d20\u6570\u3002 \u4e00\u4e2a CCD \u6444\u50cf\u673a\u6709 10 \u4e2a\u81ea\u7531\u5ea6\u3002 \u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a \u00b6 \u8003\u8651\u5f62\u5982\u4e0b\u9762\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u589e\u52a0\u7684\u53c2\u6570 s \u79f0\u4e3a \u626d\u66f2\u53c2\u6570 \uff0c\u5bf9\u5927\u591a\u6570\u6807\u51c6\u7684\u6444\u50cf\u673a\u6765\u8bf4\uff0c\u5176\u626d\u66f2\u53c2\u6570\u4e3a 0\u3002 \\[ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u4e00\u4e2a\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u6709 11 \u4e2a\u81ea\u7531\u5ea6\u3002 \u5c04\u5f71\u6444\u50cf\u673a \u00b6 \u6444\u50cf\u673a\u6784\u9020 \u00b6 \u4e00\u822c\u5c04\u5f71\u6444\u50cf\u673a\u53ef\u4ee5\u6309 \\(P=[M|\\mathbf{p}_4]\\) \u5206\u5757\uff0c\u5176\u4e2d \\(M\\) \u662f \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c \\(M\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u5b83\u662f\u6709\u9650\u6444\u50cf\u673a\uff0c\u53cd\u4e4b\u5219\u4e0d\u7136 \u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u6444\u50cf\u673a\u4e2d\u5fc3 \\(C\\) \u662f \\(P\\) \u7684\u4e00\u7ef4\u53f3\u96f6\u7a7a\u95f4\uff0c\u5373 \\(P \\mathbf{C}=\\mathbf{0}\\) \u6709\u9650\u6444\u50cf\u673a \uff08M\u975e\u5947\u5f02\uff09 \\(\\mathbf{C}=\\begin{bmatrix} -M^{-1}\\mathbf{p}_4 \\\\ 1 \\end{bmatrix}\\) \u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff08M\u5947\u5f02\uff09 \\(\\mathbf{C} = \\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}\\) \uff0c\u5176\u4e2d\uff0c \\(\\mathbf{d}\\) \u662f \\(M\\) \u7684 3 \u7ef4\u96f6\u77e2\u91cf\uff0c\u5373 \\(M \\mathbf{d}=\\mathbf{0}\\) \u5217\u70b9 \uff1a\u5bf9\u4e8e \\(i=1,..,3\\) \uff0c\u5217\u77e2\u91cf \\(\\mathbf{p}_i\\) \u5206\u522b\u5bf9\u5e94\u4e8e \\(X,Y,Z\\) \u8f74\u5728\u56fe\u50cf\u4e0a\u7684\u6d88\u5f71\u70b9\u3002\u5217 \\(\\mathbf{p}_4\\) \u662f\u5750\u6807\u539f\u70b9\u7684\u56fe\u50cf \u4e3b\u5e73\u9762 \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5e73\u9762\u662f \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(\\mathbf{P}^3\\) \u8f74\u5e73\u9762 \uff1a\u5e73\u9762 \\(\\mathbf{P}^1\\) \u548c \\(\\mathbf{P}^2\\) \uff08 \\(P\\) \u7684\u7b2c\u4e00\u548c\u7b2c\u4e8c\u884c\uff09\u8868\u793a\u7a7a\u95f4\u4e2d\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5206\u522b\u5bf9\u5e94\u4e8e\u6620\u5c04\u5230\u56fe\u50cf\u4e0a\u76f4\u7ebf \\(x=0\\) \u548c \\(y=0\\) \u7684\u70b9 \u4e3b\u70b9 \uff1a\u56fe\u50cf\u70b9 \\(\\mathbf{x}_0=M\\mathbf{m}^3\\) \u662f\u6444\u50cf\u673a\u7684\u4e3b\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{m}^{3\\top}\\) \u662f \\(M\\) \u7684\u7b2c\u4e09\u884c \u4e3b\u5c04\u7ebf \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5c04\u7ebf\uff08\u4e3b\u8f74\uff09\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3 \\(\\mathbf{C}\\) \u800c\u65b9\u5411\u77e2\u91cf\u4e3a \\(\\mathbf{m}^{3\\top}\\) \u7684\u5c04\u7ebf\u3002\u4e3b\u8f74\u77e2\u91cf \\(\\mathbf{v}=\\det(M)\\mathbf{m}^3\\) \u6307\u5411\u6444\u50cf\u673a\u7684\u524d\u65b9 \u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u70b9\u7684\u4f5c\u7528 \u00b6 \u6b63\u5411\u6295\u5f71 \uff1a\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u70b9 \\(\\mathbf{D}=(\\mathbf{d}^\\top,\\mathbf{0})^\\top\\) \u8868\u793a\u6d88\u5f71\u70b9\uff0c\u8fd9\u4e9b\u70b9\u6620\u5c04\u5230 \\(\\mathbf{x}=P\\mathbf{D}=[M|\\mathbf{p}_4]=M\\mathbf{d}\\) \u70b9\u5230\u5c04\u5f71\u7684\u53cd\u5411\u6295\u5f71 \uff1a \u7ed9\u5b9a\u56fe\u50cf\u4e2d\u7684\u4e00\u4e2a\u70b9 \\(\\mathbf{x}\\) \u6765\u786e\u5b9a\u662f\u7a7a\u95f4\u7684\u90a3\u4e9b\u70b9\u88ab\u6620\u5c04\u5230\u8be5\u70b9\u3002\u8fd9\u4e9b\u70b9\u4ea4\u7ec4\u6210\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u7a7a\u95f4\u5c04\u7ebf\uff1a \\(\\mathbf{X}(\\lambda)=P^+\\mathbf{x}+\\lambda\\mathbf{C}\\) \u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\u3002 \\(P^+=P^\\top(PP^\\top)^{-1}\\) \u5e76\u4e14 \\(PP^+=I\\) \u4e00\u4e2a\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u53cd\u5411\u6295\u5f71\u7684\u5c04\u7ebf\u4ea4\u65e0\u7a77\u8fdc\u5e73\u9762\u4e8e\u70b9 \\(\\mathbf{D}=((M^{-1}\\mathbf{x})^\\top, 0)^\\top\\) \u3002\u5c06\u5c04\u7ebf\u5199\u6210\u5176\u4e0e\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e24\u70b9\u7684\u8fde\u63a5: \\[ \\mathbf{X}(\\mu)=\\mu\\begin{bmatrix}M^{-1}\\mathbf{x}\\\\0\\end{bmatrix}+ \\begin{bmatrix}-M^{-1}\\mathbf{p}_4\\\\1\\end{bmatrix}= \\begin{bmatrix}M^{-1}(\\mu\\mathbf{x}-\\mathbf{p}_4)\\\\1\\end{bmatrix} \\] \u70b9\u7684\u6df1\u5ea6 \u00b6 \u4ee4 \\(\\mathbf{X}=(X,Y,Z,T)^\\top\\) \u662f\u4e00\u4e2a 3D \u70b9\u800c \\(P=[M|\\mathbf{p}_4]\\) \u662f\u4e00\u4e2a\u6709\u9650\u6444\u50cf\u673a\u7684\u6444\u50cf\u673a\u77e9\u9635\uff0c\u5047\u5b9a \\(P(X,Y,Z,T)^\\top=w(x,y,1)^\\top\\) \uff0c\u90a3\u4e48 \\(depth(\\mathbf{X};P)=\\frac{sign(\\det M)w}{T\\parallel \\mathbf{m}^3 \\parallel}\\) \u662f\u5728\u6444\u50cf\u673a\u4e3b\u5e73\u9762\u524d\u65b9\u7684\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6 \u6444\u50cf\u673a\u77e9\u9635\u7684\u5206\u89e3 \u00b6 \u6c42\u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u4e2d\u5fc3 \\(\\mathbf{C}=(X,Y,Z,T)^\\top\\) \uff0c\u5176\u4e2d \\(X=\\det([\\mathbf{p}_2, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Y=-\\det([\\mathbf{p}_1, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Z=\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_4])\\) \\(T=-\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_3])\\) \u6c42\u6444\u50cf\u673a\u5b9a\u5411\u548c\u5185\u90e8\u53c2\u6570 \uff1a\u5728\u6709\u9650\u6444\u50cf\u673a\u7684\u60c5\u5f62\uff1a \\[ P=[M|-M\\tilde{\\mathbf{C}}]=K[R|-R\\tilde{\\mathbf{C}}] \\\\ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \\(\\alpha_x\\) \u662f \\(x-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(\\alpha_y\\) \u662f \\(y-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(s\\) \u662f\u626d\u66f2\u53c2\u6570 \\((x_0,y_0)^\\top\\) \u662f\u4e3b\u70b9\u7684\u5750\u6807 \u50cf\u7d20\u957f\u5bbd\u6bd4 \\(\\alpha_x/\\alpha_y\\) \u65e0\u7a77\u8fdc\u6444\u50cf\u673a \u00b6 \u65e0\u7a77\u8fdc\u6444\u50cf\u673a\u662f\u4e2d\u5fc3\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u6444\u50cf\u673a\u3002\u65e0\u7a77\u9009\u6444\u50cf\u673a\u53ef\u4ee5\u5206\u4e3a \u4eff\u5c04\u6444\u50cf\u673a \u548c \u975e\u4eff\u5c04\u6444\u50cf\u673a \u4eff\u5c04\u6444\u50cf\u673a \u00b6 \u4eff\u5c04\u6444\u50cf\u673a\u662f\u77e9\u9635 \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(P^{3\\top}\\) \u5f62\u5982 \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a \u5bf9\u4e8e\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\uff1a \\[ P_0=KR[I|-\\tilde{\\mathbf{C}}]=K \\begin{bmatrix} \\mathbf{r}^{1\\top}-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}} \\end{bmatrix} \\] \u5176\u4e2d \\(\\mathbf{r}^{i\\top}\\) \u662f\u65cb\u8f6c\u77e9\u9635\u7684\u7b2c i \u884c\u3002\u800c\u6570\u503c\u7684 \\(d_0=-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}}\\) \u662f\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u5728\u4e3b\u5c04\u7ebf\u65b9\u5411\u4e0a\u7684\u8ddd\u79bb \u6cbf\u4e3b\u5c04\u7ebf\u8ddf\u8e2a\u7684\u6548\u679c\u662f\u5c06\u77e9\u9635\u7684 \\((3,4)\\) \u5143\u7d20\u7528\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u6df1\u5ea6 \\(d_t\\) \u66ff\u4ee3 \u5047\u5b9a\u4f7f\u56fe\u50cf\u5927\u5c0f\u4fdd\u6301\u4e0d\u53d8\u7684\u653e\u5927\u56e0\u5b50\u662f \\(k=d_t/d_0\\) \uff0c\u5728\u65f6\u95f4 \\(t\\) \u6240\u4ea7\u751f\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f\uff1a \\[ P_t=K \\begin{bmatrix} d_t/d_0 & & \\\\ & d_t/d_0 & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}&d_t \\end{bmatrix}= \\frac{d_t}{d_0}K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}d_0/d_t&d_0 \\end{bmatrix} \\] \u56e0\u5b50 \\(d_t/d_0\\) \u53ef\u4ee5\u5ffd\u7565\uff0c\u5f53 \\(d_t\\) \u8d8b\u5411\u65e0\u7a77\u5927\u65f6\uff0c\u8be5\u77e9\u9635\u53d8\u6210 \\[ P_\\infty=\\lim_{t \\to \\infty}P_t=K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top&d_0 \\end{bmatrix} \\] \u5e94\u7528\u4eff\u5c04\u6444\u50cf\u673a\u7684\u8bef\u5dee \u00b6 \u5728\u8fc7\u4e16\u754c\u539f\u70b9\u5e76\u5782\u76f4\u5b50\u4e3b\u8f74\u65b9\u5411\u7684\u5e73\u9762\u4e0a\u7684\u4efb\u4f55\u70b9\u7684\u56fe\u50cf\u5728\u8fd9\u79cd\u53d8\u7126\u548c\u8fd0\u52a8\u7684\u590d\u5408\u4f5c\u7528\u4e0b\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u6837\u7684\u4e00\u4e2a\u70b9\u53ef\u4ee5\u8bb0\u4e3a \\(\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 \\\\ 1\\end{bmatrix}\\) \uff0c\u56e0\u4e3a \\(\\mathbf{r}^{3\\top}(\\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2)=0\\) \uff0c\u5373 \\(P_0\\mathbf{X}=P_t\\mathbf{X}=P_\\infty\\mathbf{X}\\) \u5bf9\u6240\u6709 \\(t\\) \u6210\u7acb \u5bf9\u4e0d\u5728\u8be5\u5e73\u9762\u4e0a\u7684\u70b9\uff0c\u8bbe\u4e00\u70b9 \\(\\mathbf{X}\\) \u79bb\u8be5\u5e73\u9762\u7684\u5782\u76f4\u8ddd\u79bb\u662f \\(\\Delta\\) \u8fd9\u4e2a 3D \u70b9\u53ef\u4ee5\u8868\u793a\u6210 \\[\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 + \\Delta\\mathbf{r}^3 \\\\ 1\\end{bmatrix}\\] \u5e76\u5206\u522b\u88ab\u6444\u50cf\u673a \\(P_0\\) \u548c \\(P_\\infty\\) \u5f71\u50cf\u5230 \\[ \\mathbf{x}_{proj}=P_0\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0+\\Delta \\end{bmatrix} \\ \\ \\ \\mathbf{x}_{affine}=P_\\infty\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0 \\end{bmatrix} \\] \u5176\u4e2d \\(\\tilde{x}=\\alpha-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}},\\tilde{y}=\\beta-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}}\\) \uff0c\u8bb0\u6807\u5b9a\u77e9\u9635\u4e3a\uff1a \\[ K=\\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\tilde{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\] \u56e0\u6b64\u4e24\u70b9\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_0= \\frac{d_0+\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u7528 \\(P_\\infty\\) \u4eff\u5c04\u8fd1\u4f3c\u771f\u5b9e\u6444\u50cf\u673a\u77e9\u9635 \\(P_0\\) \u7684\u6548\u5e94\u662f\u628a\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u5f84\u5411\u5730\u9760\u8fd1\u6216\u79bb\u5f00\u4e3b\u70b9 \\(\\tilde{\\mathbf{x}}_0\\) \uff0c\u5176\u52a0\u6743\u56e0\u5b50\u662f \\((d_0+\\Delta)/d_0=1+\\Delta/d_0\\) \u4eff\u5c04\u5f71\u50cf\u6761\u4ef6 \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_{proj}=\\frac{\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u6df1\u5ea6\u7684\u8d77\u4f0f( \\(\\Delta\\) )\u76f8\u5bf9\u5e73\u5747\u6df1\u5ea6( \\(d_0\\) )\u8f83\u5c0f \u70b9\u79bb\u4e3b\u8f74\u7684\u8ddd\u79bb\u8f83\u5c0f \\(P_\\infty\\) \u7684\u5206\u89e3 \u00b6 \u6444\u50cf\u673a\u77e9\u9635 \uff1a \\[ P_\\infty= \\begin{bmatrix} K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{t}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix}= \\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{0}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u5e73\u884c\u6295\u5f71 \u5e73\u884c\u6295\u5f71\u77e9\u9635 \\(\\begin{bmatrix} 1&0&0&0\\\\0&1&0&0\\\\0&0&0&1 \\end{bmatrix}\\) \u4ee3\u66ff\u79bb\u6709\u9650\u6444\u50cf\u673a\u7684\u89c4\u8303\u5c04\u5f71\u77e9\u9635 \\([\\mathbf{I}|\\mathbf{0}]\\) \u6807\u5b9a\u77e9\u9635 \\(\\begin{bmatrix}K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\\\hat{\\mathbf{0}}^\\top & 1\\end{bmatrix}\\) \u4ee3\u66ff\u4e86\u6709\u9650\u6444\u50cf\u673a\u7684 \\(K\\) \u4e3b\u70b9\u65e0\u5b9a\u4e49 \u4eff\u5c04\u6444\u50cf\u673a\u7684\u5c42\u6b21 \u00b6 \u6b63\u6295\u5f71 \uff1a\u6b63\u6295\u5f71\u6444\u50cf\u673a\u6709 5 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5373\u63cf\u8ff0\u65cb\u8f6c\u77e9\u9635 \\(R\\) \u7684\u4e09\u4e2a\u53c2\u6570\uff0c\u52a0\u4e0a\u4e24\u4e2a\u504f\u7f6e\u53c2\u6570 \\(t_1\\) \u548c \\(t_2\\) \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u7f29\u653e\u6b63\u6295\u5f71 \uff1a\u7f29\u653e\u6b63\u6295\u5f71\u662f\u6b63\u6295\u5f71\u7d27\u63a5\u4e00\u4e2a\u5747\u5300\u7f29\u653e\uff0c\u6709 6 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1/k \\end{bmatrix} \\] \u5f31\u900f\u89c6\u6295\u5f71 \uff1a\u4e0e\u6709\u9650 CCD \u6444\u50cf\u673a\u7c7b\u4f3c\uff0c\u8003\u8651\u4e24\u6839\u56fe\u50cf\u8f74\u7f29\u653e\u56e0\u5b50\u4e0d\u4e00\u6837\u7684\u65e0\u7a77\u8fdc\u6444\u50cf\u673a\uff0c\u6709 7 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\alpha_x & & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u4eff\u5c04\u6444\u50cf\u673a \\(P_A\\) \uff1a\u5982 \\(P_\\infty\\) \u4e00\u6837\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u7684\u5e73\u884c\u6295\u5f71\uff0c\u6709 8 \u4e2a\u81ea\u7531\u5ea6 \\[ P_A= \\begin{bmatrix} \\alpha_x & s & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u4eff\u5c04\u6444\u50cf\u673a\u7684\u5176\u4ed6\u6027\u8d28 \u00b6 \u4e3b\u5e73\u9762\u662f\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u4efb\u4f55\u5c04\u5f71\u6444\u50cf\u673a\u77e9\u9635\u662f\u4eff\u5c04\u6444\u50cf\u673a\u77e9\u9635 \u5e73\u884c\u7684\u4e16\u754c\u76f4\u7ebf\u88ab\u6295\u5f71\u6210\u5e73\u884c\u7684\u56fe\u50cf\u76f4\u7ebf \u6ee1\u8db3 \\(M_{2 \\times 3} \\mathbf{d}=\\mathbf{0}\\) \u7684\u77e2\u91cf \\(\\mathbf{d}\\) \u662f\u5e73\u884c\u6295\u5f71\u7684\u65b9\u5411\uff0c\u800c \\((\\mathbf{d}^\\top,0)^\\top\\) \u662f\u6444\u50cf\u673a\u4e2d\u5fc3\uff0c\u56e0\u4e3a \\(P_A\\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}=\\mathbf{0}\\) \u4e00\u822c\u65e0\u7a77\u8fdc\u6444\u50cf\u673a \u00b6 \u4eff\u5c04\u6444\u50cf\u673a \u975e\u4eff\u5c04\u6444\u50cf\u673a \u6444\u50cf\u673a\u4e2d\u5fc3\u5728 \\(\\pi_\\infty\\) \u4e0a \u662f \u662f \u4e3b\u5e73\u9762\u662f \\(\\pi_\\infty\\) \u662f \u4e0d\u662f \\(\\pi_\\infty\\) \u7684\u70b9\u7684\u56fe\u50cf\u5728 \\(\\mathbf{l}_\\infty\\) \u4e0a \u662f \u4e00\u822c\u4e0d\u662f \u5176\u4ed6\u6444\u50cf\u673a\u6a21\u578b \u00b6 \u63a8\u626b\u5f0f\u6444\u50cf\u673a \u7ebf\u9635\u6444\u50cf\u673a","title":"\u6444\u50cf\u673a\u6a21\u578b"},{"location":"cv/mvg/camera-model/#_1","text":"\u7ea6 3055 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract \u6444\u50cf\u673a\u662f 3D \u4e16\u754c\uff08\u7269\u4f53\u7a7a\u95f4\uff09\u548c 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u6620\u5c04\u3002\u591a\u89c6\u56fe\u4e2d\u4e3b\u8981\u5173\u5fc3 \u4e2d\u5fc3\u6295\u5f71 \u3002 \u5177\u4f53\u6a21\u578b\u4e3b\u8981\u5206\u6210\u6709\u9650\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u548c\u201c\u65e0\u7a77\u8fdc\u201d\u4e2d\u5fc3\u7684\u6444\u50cf\u673a\u6a21\u578b\u3002 \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u70b9\u7684\u6295\u5f71\u3002","title":"\u6444\u50cf\u673a\u6a21\u578b"},{"location":"cv/mvg/camera-model/#_2","text":"","title":"\u6709\u9650\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_3","text":"\u4ee4\u6295\u5f71\u4e2d\u5fc3\u4f4d\u4e8e\u4e00\u4e2a\u6b27\u6c0f\u5750\u6807\u7cfb\u7684\u539f\u70b9\uff0c\u800c\u5e73\u9762 \\(Z=f\\) \u88ab\u79f0\u4e3a \u56fe\u50cf\u5e73\u9762 \u6216 \u805a\u7126\u5e73\u9762 \u3002 \u5728\u9488\u5b54\u6a21\u578b\u4e0b\uff0c\u7a7a\u95f4\u5750\u6807\u4e3a \\(\\mathbf{X}=(X,Y,Z)^\\top\\) \uff0c\u4ece\u4e16\u754c\u5750\u6807\u5230\u56fe\u50cf\u5750\u6807\u7684\u4e2d\u5fc3\u6295\u5f71\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z,fY/Z)^\\top\\) \u5c04\u5f71\u4e2d\u5fc3\u79f0\u4e3a \u6444\u50cf\u673a\u4e2d\u5fc3 \uff0c\u4e5f\u6210 \u5149\u5fc3 \u3002 \u6444\u50cf\u673a\u4e2d\u5fc3\u5230\u56fe\u50cf\u5e73\u9762\u7684\u5782\u7ebf\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u8f74 \u6216 \u4e3b\u5c04\u7ebf \uff0c\u800c\u4e3b\u8f74\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u79f0\u4e3a \u4e3b\u70b9 \uff0c\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\u7684\u5e73\u9762\u79f0\u4e3a\u6444\u50cf\u673a\u7684 \u4e3b\u5e73\u9762 \u3002 \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e2d\u5fc3\u6295\u5f71\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX \\\\ fY \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & 0 & 0 \\\\ 0 & f & 0 & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\\\ \\\\ \u4e0a\u5f0f\u4e5f\u53ef\u8868\u793a\u4e3a \\ \\ \\ \\mathbf{x}=P\\mathbf{X} \\ \\ \\ \u5176\u4e2d \\ \\mathbf{X}\u7528\u56db\u7ef4\u9f50\u6b21\u77e2\u91cf(X,Y,Z,1)^\\top \u8868\u793a \\ P = diag(f,f,1)[\\mathbf{I}|\\mathbf{0}] \\] \u4e3b\u70b9\u504f\u7f6e \u4e0a\u9762\u8ba8\u8bba\u7684\u56fe\u50cf\u5e73\u9762\u7684\u5750\u6807\u539f\u70b9\u5728\u4e3b\u70b9\u4e0a\uff0c\u4f46\u5b9e\u9645\u4e0a\u53ef\u80fd\u4e0d\u662f\uff0c\u4e00\u822c\u60c5\u5f62\u7684\u6620\u5c04\u4e3a \\((X,Y,Z)^\\top \\to (fX/Z+p_x,fY/Z+p_y)^\\top\\) \uff0c\u6839\u636e\u4e0a\u5f0f\u63a8\u5bfc\uff1a \\[ \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} \\to \\begin{bmatrix} fX+Zp_x \\\\ fY+Zp_y \\\\ Z \\end{bmatrix} = \\begin{bmatrix} f & 0 & p_x & 0 \\\\ 0 & f & p_y & 0 \\\\ 0 & 0 & 1 & 0 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\\\ \\\\ \\end{bmatrix} \\] \u4ee4 \\(K = \\begin{bmatrix} f & 0 & p_x \\\\ 0 & f & p_y \\\\ 0 & 0 & 1 \\end{bmatrix}\\) , \u5219\u6709 \\(\\mathbf{x}=K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}_{cam}\\) \uff0c\u5176\u4e2d\u70b9 \\(\\mathbf{X}_{cam}\\) \u662f\u6444\u50cf\u673a\u5750\u6807\u7cfb\uff0c\u77e9\u9635 \\(K\\) \u79f0\u4e3a \u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635\uff08\u5185\u53c2\u77e9\u9635\uff09 \uff0c \\([\\mathbf{I}|\\mathbf{0}]\\) \u79f0\u4e3a \u5916\u53c2\u77e9\u9635 \u3002 \u6444\u50cf\u673a\u65cb\u8f6c\u4e0e\u4f4d\u79fb \\[ X_{cam}= \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} X \\\\ Y \\\\ Z \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} R & -R\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\mathbf{X} \\\\ \\mathbf{x}=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\mathbf{X} \\] \u4e00\u822c\u7684\u9488\u5b54\u6444\u50cf\u673a \\(P=KR[\\mathbf{I}|-\\tilde{\\mathbf{C}}]\\) \u6709 9 \u4e2a\u81ea\u7531\u5ea6\uff1b3 \u4e2a\u6765\u81ea \\(K\\) \uff0c3 \u4e2a\u6765\u81ea \\(R\\) \uff0c3 \u4e2a\u6765\u81ea \\(\\tilde{\\mathbf{C}}\\) \u3002 \\(K\\) \u4e2d\u7684\u53c2\u6570\u79f0\u4e3a\u6444\u50cf\u673a \u5185\u90e8\u53c2\u6570 \u6216\u6444\u50cf\u673a\u7684 \u5185\u90e8\u6821\u51c6 \u3002 \\(R\\) \u548c \\(\\tilde{\\mathbf{C}}\\) \u5e76\u79f0\u4e3a \u5916\u90e8\u53c2\u6570 \u6216 \u5916\u90e8\u6821\u51c6 \u3002\u6444\u50cf\u673a\u77e9\u9635\u53ef\u7b80\u5316\u6210\uff1a \\[ \\mathbf{P}=K[R|\\mathbf{t}]\uff0c\u5176\u4e2d \\ \\mathbf{t}=-R\\tilde{\\mathbf{C}} \\]","title":"\u57fa\u672c\u9488\u5b54\u6a21\u578b"},{"location":"cv/mvg/camera-model/#ccd","text":"CCD \u6444\u50cf\u673a\u7684\u50cf\u7d20\u53ef\u80fd\u4e0d\u662f\u6b63\u65b9\u5f62\uff0c\u5982\u679c\u56fe\u50cf\u5750\u6807\u4ee5\u50cf\u7d20\u6765\u6d4b\u91cf\uff0c\u90a3\u4e48\u9700\u8981\u5728\u6bcf\u4e2a\u65b9\u5411\u4e0a\u5f15\u5165\u975e\u7b49\u91cf\u5c3a\u5ea6\u56e0\u5b50\u3002 \u4e00\u822c\u5f62\u5f0f\uff1a \\[ K= \\begin{bmatrix} \\alpha_x & 0 & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u5176\u4e2d \\(\\alpha_x=fm_x, \\alpha_y=fm_y,x_0=m_xp_x,y_0=m_yp_y\\) \u3002 \\(m_x,m_y\\) \u5206\u522b\u662f\u5728 x \u548c y \u65b9\u5411\u4e0a\u56fe\u50cf\u5750\u6807\u5355\u4f4d\u77e9\u9635\u7684\u50cf\u7d20\u6570\u3002 \u4e00\u4e2a CCD \u6444\u50cf\u673a\u6709 10 \u4e2a\u81ea\u7531\u5ea6\u3002","title":"CCD \u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_4","text":"\u8003\u8651\u5f62\u5982\u4e0b\u9762\u7684\u6807\u5b9a\u77e9\u9635\uff0c\u589e\u52a0\u7684\u53c2\u6570 s \u79f0\u4e3a \u626d\u66f2\u53c2\u6570 \uff0c\u5bf9\u5927\u591a\u6570\u6807\u51c6\u7684\u6444\u50cf\u673a\u6765\u8bf4\uff0c\u5176\u626d\u66f2\u53c2\u6570\u4e3a 0\u3002 \\[ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \u4e00\u4e2a\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u6709 11 \u4e2a\u81ea\u7531\u5ea6\u3002","title":"\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_5","text":"","title":"\u5c04\u5f71\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_6","text":"\u4e00\u822c\u5c04\u5f71\u6444\u50cf\u673a\u53ef\u4ee5\u6309 \\(P=[M|\\mathbf{p}_4]\\) \u5206\u5757\uff0c\u5176\u4e2d \\(M\\) \u662f \\(3 \\times 3\\) \u77e9\u9635\uff0c\u5982\u679c \\(M\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u5b83\u662f\u6709\u9650\u6444\u50cf\u673a\uff0c\u53cd\u4e4b\u5219\u4e0d\u7136 \u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u6444\u50cf\u673a\u4e2d\u5fc3 \\(C\\) \u662f \\(P\\) \u7684\u4e00\u7ef4\u53f3\u96f6\u7a7a\u95f4\uff0c\u5373 \\(P \\mathbf{C}=\\mathbf{0}\\) \u6709\u9650\u6444\u50cf\u673a \uff08M\u975e\u5947\u5f02\uff09 \\(\\mathbf{C}=\\begin{bmatrix} -M^{-1}\\mathbf{p}_4 \\\\ 1 \\end{bmatrix}\\) \u65e0\u7a77\u8fdc\u6444\u50cf\u673a \uff08M\u5947\u5f02\uff09 \\(\\mathbf{C} = \\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}\\) \uff0c\u5176\u4e2d\uff0c \\(\\mathbf{d}\\) \u662f \\(M\\) \u7684 3 \u7ef4\u96f6\u77e2\u91cf\uff0c\u5373 \\(M \\mathbf{d}=\\mathbf{0}\\) \u5217\u70b9 \uff1a\u5bf9\u4e8e \\(i=1,..,3\\) \uff0c\u5217\u77e2\u91cf \\(\\mathbf{p}_i\\) \u5206\u522b\u5bf9\u5e94\u4e8e \\(X,Y,Z\\) \u8f74\u5728\u56fe\u50cf\u4e0a\u7684\u6d88\u5f71\u70b9\u3002\u5217 \\(\\mathbf{p}_4\\) \u662f\u5750\u6807\u539f\u70b9\u7684\u56fe\u50cf \u4e3b\u5e73\u9762 \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5e73\u9762\u662f \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(\\mathbf{P}^3\\) \u8f74\u5e73\u9762 \uff1a\u5e73\u9762 \\(\\mathbf{P}^1\\) \u548c \\(\\mathbf{P}^2\\) \uff08 \\(P\\) \u7684\u7b2c\u4e00\u548c\u7b2c\u4e8c\u884c\uff09\u8868\u793a\u7a7a\u95f4\u4e2d\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5206\u522b\u5bf9\u5e94\u4e8e\u6620\u5c04\u5230\u56fe\u50cf\u4e0a\u76f4\u7ebf \\(x=0\\) \u548c \\(y=0\\) \u7684\u70b9 \u4e3b\u70b9 \uff1a\u56fe\u50cf\u70b9 \\(\\mathbf{x}_0=M\\mathbf{m}^3\\) \u662f\u6444\u50cf\u673a\u7684\u4e3b\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{m}^{3\\top}\\) \u662f \\(M\\) \u7684\u7b2c\u4e09\u884c \u4e3b\u5c04\u7ebf \uff1a\u6444\u50cf\u673a\u7684\u4e3b\u5c04\u7ebf\uff08\u4e3b\u8f74\uff09\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3 \\(\\mathbf{C}\\) \u800c\u65b9\u5411\u77e2\u91cf\u4e3a \\(\\mathbf{m}^{3\\top}\\) \u7684\u5c04\u7ebf\u3002\u4e3b\u8f74\u77e2\u91cf \\(\\mathbf{v}=\\det(M)\\mathbf{m}^3\\) \u6307\u5411\u6444\u50cf\u673a\u7684\u524d\u65b9","title":"\u6444\u50cf\u673a\u6784\u9020"},{"location":"cv/mvg/camera-model/#_7","text":"\u6b63\u5411\u6295\u5f71 \uff1a\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u70b9 \\(\\mathbf{D}=(\\mathbf{d}^\\top,\\mathbf{0})^\\top\\) \u8868\u793a\u6d88\u5f71\u70b9\uff0c\u8fd9\u4e9b\u70b9\u6620\u5c04\u5230 \\(\\mathbf{x}=P\\mathbf{D}=[M|\\mathbf{p}_4]=M\\mathbf{d}\\) \u70b9\u5230\u5c04\u5f71\u7684\u53cd\u5411\u6295\u5f71 \uff1a \u7ed9\u5b9a\u56fe\u50cf\u4e2d\u7684\u4e00\u4e2a\u70b9 \\(\\mathbf{x}\\) \u6765\u786e\u5b9a\u662f\u7a7a\u95f4\u7684\u90a3\u4e9b\u70b9\u88ab\u6620\u5c04\u5230\u8be5\u70b9\u3002\u8fd9\u4e9b\u70b9\u4ea4\u7ec4\u6210\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u6761\u7a7a\u95f4\u5c04\u7ebf\uff1a \\(\\mathbf{X}(\\lambda)=P^+\\mathbf{x}+\\lambda\\mathbf{C}\\) \u5176\u4e2d \\(P^+\\) \u662f \\(P\\) \u7684\u4f2a\u9006\u3002 \\(P^+=P^\\top(PP^\\top)^{-1}\\) \u5e76\u4e14 \\(PP^+=I\\) \u4e00\u4e2a\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u53cd\u5411\u6295\u5f71\u7684\u5c04\u7ebf\u4ea4\u65e0\u7a77\u8fdc\u5e73\u9762\u4e8e\u70b9 \\(\\mathbf{D}=((M^{-1}\\mathbf{x})^\\top, 0)^\\top\\) \u3002\u5c06\u5c04\u7ebf\u5199\u6210\u5176\u4e0e\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e24\u70b9\u7684\u8fde\u63a5: \\[ \\mathbf{X}(\\mu)=\\mu\\begin{bmatrix}M^{-1}\\mathbf{x}\\\\0\\end{bmatrix}+ \\begin{bmatrix}-M^{-1}\\mathbf{p}_4\\\\1\\end{bmatrix}= \\begin{bmatrix}M^{-1}(\\mu\\mathbf{x}-\\mathbf{p}_4)\\\\1\\end{bmatrix} \\]","title":"\u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u70b9\u7684\u4f5c\u7528"},{"location":"cv/mvg/camera-model/#_8","text":"\u4ee4 \\(\\mathbf{X}=(X,Y,Z,T)^\\top\\) \u662f\u4e00\u4e2a 3D \u70b9\u800c \\(P=[M|\\mathbf{p}_4]\\) \u662f\u4e00\u4e2a\u6709\u9650\u6444\u50cf\u673a\u7684\u6444\u50cf\u673a\u77e9\u9635\uff0c\u5047\u5b9a \\(P(X,Y,Z,T)^\\top=w(x,y,1)^\\top\\) \uff0c\u90a3\u4e48 \\(depth(\\mathbf{X};P)=\\frac{sign(\\det M)w}{T\\parallel \\mathbf{m}^3 \\parallel}\\) \u662f\u5728\u6444\u50cf\u673a\u4e3b\u5e73\u9762\u524d\u65b9\u7684\u70b9 \\(\\mathbf{X}\\) \u7684\u6df1\u5ea6","title":"\u70b9\u7684\u6df1\u5ea6"},{"location":"cv/mvg/camera-model/#_9","text":"\u6c42\u6444\u50cf\u673a\u4e2d\u5fc3 \uff1a\u4e2d\u5fc3 \\(\\mathbf{C}=(X,Y,Z,T)^\\top\\) \uff0c\u5176\u4e2d \\(X=\\det([\\mathbf{p}_2, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Y=-\\det([\\mathbf{p}_1, \\mathbf{p}_3, \\mathbf{p}_4])\\) \\(Z=\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_4])\\) \\(T=-\\det([\\mathbf{p}_1, \\mathbf{p}_2, \\mathbf{p}_3])\\) \u6c42\u6444\u50cf\u673a\u5b9a\u5411\u548c\u5185\u90e8\u53c2\u6570 \uff1a\u5728\u6709\u9650\u6444\u50cf\u673a\u7684\u60c5\u5f62\uff1a \\[ P=[M|-M\\tilde{\\mathbf{C}}]=K[R|-R\\tilde{\\mathbf{C}}] \\\\ K= \\begin{bmatrix} \\alpha_x & s & x_0 \\\\ 0 & \\alpha_y & y_0 \\\\ 0 & 0 & 1 \\end{bmatrix} \\] \\(\\alpha_x\\) \u662f \\(x-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(\\alpha_y\\) \u662f \\(y-\\) \u5750\u6807\u65b9\u5411\u7684\u6bd4\u4f8b\u56e0\u5b50 \\(s\\) \u662f\u626d\u66f2\u53c2\u6570 \\((x_0,y_0)^\\top\\) \u662f\u4e3b\u70b9\u7684\u5750\u6807 \u50cf\u7d20\u957f\u5bbd\u6bd4 \\(\\alpha_x/\\alpha_y\\)","title":"\u6444\u50cf\u673a\u77e9\u9635\u7684\u5206\u89e3"},{"location":"cv/mvg/camera-model/#_10","text":"\u65e0\u7a77\u8fdc\u6444\u50cf\u673a\u662f\u4e2d\u5fc3\u5728\u65e0\u7a77\u8fdc\u5e73\u9762\u4e0a\u7684\u6444\u50cf\u673a\u3002\u65e0\u7a77\u9009\u6444\u50cf\u673a\u53ef\u4ee5\u5206\u4e3a \u4eff\u5c04\u6444\u50cf\u673a \u548c \u975e\u4eff\u5c04\u6444\u50cf\u673a","title":"\u65e0\u7a77\u8fdc\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_11","text":"\u4eff\u5c04\u6444\u50cf\u673a\u662f\u77e9\u9635 \\(P\\) \u7684\u6700\u540e\u4e00\u884c \\(P^{3\\top}\\) \u5f62\u5982 \\((0,0,0,1)\\) \u7684\u6444\u50cf\u673a \u5bf9\u4e8e\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\uff1a \\[ P_0=KR[I|-\\tilde{\\mathbf{C}}]=K \\begin{bmatrix} \\mathbf{r}^{1\\top}-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}} \\end{bmatrix} \\] \u5176\u4e2d \\(\\mathbf{r}^{i\\top}\\) \u662f\u65cb\u8f6c\u77e9\u9635\u7684\u7b2c i \u884c\u3002\u800c\u6570\u503c\u7684 \\(d_0=-\\mathbf{r}^{3\\top}\\tilde{\\mathbf{C}}\\) \u662f\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u5728\u4e3b\u5c04\u7ebf\u65b9\u5411\u4e0a\u7684\u8ddd\u79bb \u6cbf\u4e3b\u5c04\u7ebf\u8ddf\u8e2a\u7684\u6548\u679c\u662f\u5c06\u77e9\u9635\u7684 \\((3,4)\\) \u5143\u7d20\u7528\u4e16\u754c\u539f\u70b9\u5230\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u6df1\u5ea6 \\(d_t\\) \u66ff\u4ee3 \u5047\u5b9a\u4f7f\u56fe\u50cf\u5927\u5c0f\u4fdd\u6301\u4e0d\u53d8\u7684\u653e\u5927\u56e0\u5b50\u662f \\(k=d_t/d_0\\) \uff0c\u5728\u65f6\u95f4 \\(t\\) \u6240\u4ea7\u751f\u7684\u6444\u50cf\u673a\u77e9\u9635\u662f\uff1a \\[ P_t=K \\begin{bmatrix} d_t/d_0 & & \\\\ & d_t/d_0 & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}&d_t \\end{bmatrix}= \\frac{d_t}{d_0}K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{3\\top}d_0/d_t&d_0 \\end{bmatrix} \\] \u56e0\u5b50 \\(d_t/d_0\\) \u53ef\u4ee5\u5ffd\u7565\uff0c\u5f53 \\(d_t\\) \u8d8b\u5411\u65e0\u7a77\u5927\u65f6\uff0c\u8be5\u77e9\u9635\u53d8\u6210 \\[ P_\\infty=\\lim_{t \\to \\infty}P_t=K \\begin{bmatrix} \\mathbf{r}^{1\\top}&-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{r}^{2\\top}&-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}} \\\\ \\mathbf{0}^\\top&d_0 \\end{bmatrix} \\]","title":"\u4eff\u5c04\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_12","text":"\u5728\u8fc7\u4e16\u754c\u539f\u70b9\u5e76\u5782\u76f4\u5b50\u4e3b\u8f74\u65b9\u5411\u7684\u5e73\u9762\u4e0a\u7684\u4efb\u4f55\u70b9\u7684\u56fe\u50cf\u5728\u8fd9\u79cd\u53d8\u7126\u548c\u8fd0\u52a8\u7684\u590d\u5408\u4f5c\u7528\u4e0b\u4fdd\u6301\u4e0d\u53d8\u3002\u8fd9\u6837\u7684\u4e00\u4e2a\u70b9\u53ef\u4ee5\u8bb0\u4e3a \\(\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 \\\\ 1\\end{bmatrix}\\) \uff0c\u56e0\u4e3a \\(\\mathbf{r}^{3\\top}(\\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2)=0\\) \uff0c\u5373 \\(P_0\\mathbf{X}=P_t\\mathbf{X}=P_\\infty\\mathbf{X}\\) \u5bf9\u6240\u6709 \\(t\\) \u6210\u7acb \u5bf9\u4e0d\u5728\u8be5\u5e73\u9762\u4e0a\u7684\u70b9\uff0c\u8bbe\u4e00\u70b9 \\(\\mathbf{X}\\) \u79bb\u8be5\u5e73\u9762\u7684\u5782\u76f4\u8ddd\u79bb\u662f \\(\\Delta\\) \u8fd9\u4e2a 3D \u70b9\u53ef\u4ee5\u8868\u793a\u6210 \\[\\mathbf{X}=\\begin{bmatrix} \\alpha \\mathbf{r}^1+\\beta \\mathbf{r}^2 + \\Delta\\mathbf{r}^3 \\\\ 1\\end{bmatrix}\\] \u5e76\u5206\u522b\u88ab\u6444\u50cf\u673a \\(P_0\\) \u548c \\(P_\\infty\\) \u5f71\u50cf\u5230 \\[ \\mathbf{x}_{proj}=P_0\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0+\\Delta \\end{bmatrix} \\ \\ \\ \\mathbf{x}_{affine}=P_\\infty\\mathbf{X}=K\\begin{bmatrix} \\tilde{x} \\\\ \\tilde{y} \\\\ d_0 \\end{bmatrix} \\] \u5176\u4e2d \\(\\tilde{x}=\\alpha-\\mathbf{r}^{1\\top}\\tilde{\\mathbf{C}},\\tilde{y}=\\beta-\\mathbf{r}^{2\\top}\\tilde{\\mathbf{C}}\\) \uff0c\u8bb0\u6807\u5b9a\u77e9\u9635\u4e3a\uff1a \\[ K=\\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\tilde{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\] \u56e0\u6b64\u4e24\u70b9\u4e4b\u95f4\u7684\u5173\u7cfb\u662f \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_0= \\frac{d_0+\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u7528 \\(P_\\infty\\) \u4eff\u5c04\u8fd1\u4f3c\u771f\u5b9e\u6444\u50cf\u673a\u77e9\u9635 \\(P_0\\) \u7684\u6548\u5e94\u662f\u628a\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u5f84\u5411\u5730\u9760\u8fd1\u6216\u79bb\u5f00\u4e3b\u70b9 \\(\\tilde{\\mathbf{x}}_0\\) \uff0c\u5176\u52a0\u6743\u56e0\u5b50\u662f \\((d_0+\\Delta)/d_0=1+\\Delta/d_0\\) \u4eff\u5c04\u5f71\u50cf\u6761\u4ef6 \\[ \\tilde{\\mathbf{x}}_{affine}-\\tilde{\\mathbf{x}}_{proj}=\\frac{\\Delta}{d_0}(\\tilde{\\mathbf{x}}_{proj}-\\tilde{\\mathbf{x}}_0) \\] \u6df1\u5ea6\u7684\u8d77\u4f0f( \\(\\Delta\\) )\u76f8\u5bf9\u5e73\u5747\u6df1\u5ea6( \\(d_0\\) )\u8f83\u5c0f \u70b9\u79bb\u4e3b\u8f74\u7684\u8ddd\u79bb\u8f83\u5c0f","title":"\u5e94\u7528\u4eff\u5c04\u6444\u50cf\u673a\u7684\u8bef\u5dee"},{"location":"cv/mvg/camera-model/#p_infty","text":"\u6444\u50cf\u673a\u77e9\u9635 \uff1a \\[ P_\\infty= \\begin{bmatrix} K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{t}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix}= \\begin{bmatrix} K_{2 \\times 2} & \\tilde{\\mathbf{x}}_0 \\\\ \\hat{\\mathbf{0}}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\hat{R} & \\hat{\\mathbf{0}} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u5e73\u884c\u6295\u5f71 \u5e73\u884c\u6295\u5f71\u77e9\u9635 \\(\\begin{bmatrix} 1&0&0&0\\\\0&1&0&0\\\\0&0&0&1 \\end{bmatrix}\\) \u4ee3\u66ff\u79bb\u6709\u9650\u6444\u50cf\u673a\u7684\u89c4\u8303\u5c04\u5f71\u77e9\u9635 \\([\\mathbf{I}|\\mathbf{0}]\\) \u6807\u5b9a\u77e9\u9635 \\(\\begin{bmatrix}K_{2 \\times 2} & \\hat{\\mathbf{0}} \\\\\\hat{\\mathbf{0}}^\\top & 1\\end{bmatrix}\\) \u4ee3\u66ff\u4e86\u6709\u9650\u6444\u50cf\u673a\u7684 \\(K\\) \u4e3b\u70b9\u65e0\u5b9a\u4e49","title":"\\(P_\\infty\\) \u7684\u5206\u89e3"},{"location":"cv/mvg/camera-model/#_13","text":"\u6b63\u6295\u5f71 \uff1a\u6b63\u6295\u5f71\u6444\u50cf\u673a\u6709 5 \u4e2a\u81ea\u7531\u5ea6\uff0c\u5373\u63cf\u8ff0\u65cb\u8f6c\u77e9\u9635 \\(R\\) \u7684\u4e09\u4e2a\u53c2\u6570\uff0c\u52a0\u4e0a\u4e24\u4e2a\u504f\u7f6e\u53c2\u6570 \\(t_1\\) \u548c \\(t_2\\) \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u7f29\u653e\u6b63\u6295\u5f71 \uff1a\u7f29\u653e\u6b63\u6295\u5f71\u662f\u6b63\u6295\u5f71\u7d27\u63a5\u4e00\u4e2a\u5747\u5300\u7f29\u653e\uff0c\u6709 6 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1/k \\end{bmatrix} \\] \u5f31\u900f\u89c6\u6295\u5f71 \uff1a\u4e0e\u6709\u9650 CCD \u6444\u50cf\u673a\u7c7b\u4f3c\uff0c\u8003\u8651\u4e24\u6839\u56fe\u50cf\u8f74\u7f29\u653e\u56e0\u5b50\u4e0d\u4e00\u6837\u7684\u65e0\u7a77\u8fdc\u6444\u50cf\u673a\uff0c\u6709 7 \u4e2a\u81ea\u7531\u5ea6 \\[ P= \\begin{bmatrix} \\alpha_x & & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\] \u4eff\u5c04\u6444\u50cf\u673a \\(P_A\\) \uff1a\u5982 \\(P_\\infty\\) \u4e00\u6837\uff0c\u53ef\u4ee5\u8ba4\u4e3a\u662f\u6709\u9650\u5c04\u5f71\u6444\u50cf\u673a\u7684\u5e73\u884c\u6295\u5f71\uff0c\u6709 8 \u4e2a\u81ea\u7531\u5ea6 \\[ P_A= \\begin{bmatrix} \\alpha_x & s & \\\\ & \\alpha_y & \\\\ & & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{r}^{1\\top} & t_1 \\\\ \\mathbf{r}^{2\\top} & t_2 \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\]","title":"\u4eff\u5c04\u6444\u50cf\u673a\u7684\u5c42\u6b21"},{"location":"cv/mvg/camera-model/#_14","text":"\u4e3b\u5e73\u9762\u662f\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u4efb\u4f55\u5c04\u5f71\u6444\u50cf\u673a\u77e9\u9635\u662f\u4eff\u5c04\u6444\u50cf\u673a\u77e9\u9635 \u5e73\u884c\u7684\u4e16\u754c\u76f4\u7ebf\u88ab\u6295\u5f71\u6210\u5e73\u884c\u7684\u56fe\u50cf\u76f4\u7ebf \u6ee1\u8db3 \\(M_{2 \\times 3} \\mathbf{d}=\\mathbf{0}\\) \u7684\u77e2\u91cf \\(\\mathbf{d}\\) \u662f\u5e73\u884c\u6295\u5f71\u7684\u65b9\u5411\uff0c\u800c \\((\\mathbf{d}^\\top,0)^\\top\\) \u662f\u6444\u50cf\u673a\u4e2d\u5fc3\uff0c\u56e0\u4e3a \\(P_A\\begin{bmatrix} \\mathbf{d} \\\\ 0 \\end{bmatrix}=\\mathbf{0}\\)","title":"\u4eff\u5c04\u6444\u50cf\u673a\u7684\u5176\u4ed6\u6027\u8d28"},{"location":"cv/mvg/camera-model/#_15","text":"\u4eff\u5c04\u6444\u50cf\u673a \u975e\u4eff\u5c04\u6444\u50cf\u673a \u6444\u50cf\u673a\u4e2d\u5fc3\u5728 \\(\\pi_\\infty\\) \u4e0a \u662f \u662f \u4e3b\u5e73\u9762\u662f \\(\\pi_\\infty\\) \u662f \u4e0d\u662f \\(\\pi_\\infty\\) \u7684\u70b9\u7684\u56fe\u50cf\u5728 \\(\\mathbf{l}_\\infty\\) \u4e0a \u662f \u4e00\u822c\u4e0d\u662f","title":"\u4e00\u822c\u65e0\u7a77\u8fdc\u6444\u50cf\u673a"},{"location":"cv/mvg/camera-model/#_16","text":"\u63a8\u626b\u5f0f\u6444\u50cf\u673a \u7ebf\u9635\u6444\u50cf\u673a","title":"\u5176\u4ed6\u6444\u50cf\u673a\u6a21\u578b"},{"location":"cv/mvg/est2d/","text":"\u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362 \u00b6 \u7ea6 6196 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 21 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u4f30\u8ba1\u95ee\u9898\uff0c\u4f30\u8ba1\u7684\u542b\u4e49\u662f\u6307\u5728\u67d0\u4e9b\u672c\u8d28\u6d4b\u91cf\u7684\u57fa\u7840\u4e0a\u8ba1\u7b97\u67d0\u4e2a\u53d8\u6362\u6216\u5176\u5b83\u6570\u5b66\u91cf\uff0c\u5e38\u89c1\u7684\u4f30\u8ba1\u95ee\u9898\u7684\u7c7b\u578b\u6709\uff1a 2D \u5355\u5e94 \uff1a\u7ed9\u5b9a \\(IP^2\\) \u4e2d\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u540c\u5728 \\(IP^2\\) \u4e2d\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u628a\u6bcf\u4e00\u70b9 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u5c04\u5f71\u53d8\u6362\u3002 3D \u5230 2D \u7684\u6444\u50cf\u673a\u6295\u5f71 \uff1a\u7ed9\u5b9a 3D \u7a7a\u95f4\u7684\u70b9\u96c6 \\(X_i\\) \u4ee5\u53ca\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u6c42\u628a \\(X_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i\\) \u7684 3D \u5230 2D \u7684\u5c04\u5f71\u6620\u5c04\u3002 \u57fa\u672c\u77e9\u9635\u7684\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u53e6\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u4e0e\u8fd9\u4e9b\u5bf9\u5e94\u4e00\u76f4\u7684 \u57fa\u672c\u77e9\u9635 \\(F\\) \u3002 \u4e09\u7126\u70b9\u5f20\u91cf\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u8de8\u4e09\u5e45\u56fe\u50cf\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime \\leftrightarrow \\mathbf{x}_i^{\\prime \\prime}\\) \uff0c\u8ba1\u7b97\u4e09\u7126\u70b9\u5f20\u91cf\u3002 \u7814\u7a76\u4e24\u5e45\u56fe\u50cf\u4e4b\u95f4\u5bf9\u5e94\u70b9\u7684\u96c6\u5408 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u5bf9\u6240\u6709\u7684 i \u90fd\u6ee1\u8db3 \\(H\\mathbf{x}_i=\\mathbf{x}_i^\\prime\\) \u7684\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635 H\uff1a \u6d4b\u91cf\u6570 \uff1a\u77e9\u9635 H \u6709 9 \u4e2a\u5143\u7d20\uff0c\u4f46\u4ec5\u786e\u5b9a\u5230\u76f8\u5dee\u4e00\u4e2a\u5c3a\u5ea6\u56e0\u5b50\u3002\u56e0\u6b64\uff0c2D \u5c04\u5f71\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u7684\u603b\u6570\u662f 8\u3002\u56e0\u4e3a\u4e00\u4e2a 2D \u70b9\u6709\u4e24\u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u4e3a\u4e86\u5b8c\u5168\u7ea6\u675f H\uff0c\u9700\u8981\u6307\u5b9a\u56db\u7ec4\u70b9\u5bf9\u5e94\u3002 \u8fd1\u4f3c\u89e3 \uff1a\u5982\u679c\u7ed9\u5b9a\u56db\u7ec4\u5bf9\u5e94\uff0c\u90a3\u4e48\u53ef\u4ee5\u5f97\u5230\u77e9\u9635 H \u7684\u7cbe\u786e\u89e3\u8fd9\u79cd\u89e3\u79f0\u4e3a \u6700\u5c0f\u914d\u7f6e\u89e3 \u3002\u5982\u679c\u7ed9\u5b9a\u591a\u4e8e\u56db\u7ec4\u7684\u5bf9\u5e94\uff0c\u90a3\u4e48\u8fd9\u4e9b\u5bf9\u5e94\u53ef\u80fd\u4e0d\u4e0e\u4efb\u4f55\u5c04\u5f71\u53d8\u6362\u5b8c\u5168\u76f8\u5bb9\uff0c\u56e0\u800c\u6211\u4eec\u9762\u4e34\u7684\u4efb\u52a1\u662f\u6309\u7ed9\u5b9a\u7684\u6570\u636e\u786e\u5b9a\u201c\u6700\u597d\u201d\u7684\u53d8\u6362\u3002\u901a\u5e38\u8fd9\u4e2a\u4efb\u52a1\u662f\u901a\u8fc7\u5bfb\u627e\u6700\u5c0f\u5316\u67d0\u4e2a\u4ee3\u4ef7\u51fd\u6570\u7684\u53d8\u6362 H \u6765\u5b8c\u6210\u3002 \u9ec4\u91d1\u6807\u51c6\u7b97\u6cd5 \uff1a\u901a\u5e38\u5b58\u5728\u4e00\u79cd\u6700\u4f18\u7684\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u6700\u4f18\u7684\u542b\u4e49\u662f\u5728\u4e00\u5b9a\u5047\u8bbe\u4e0b\uff0c\u4f7f\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684 H \u662f\u53d8\u6362\u7684\u6700\u597d\u4f30\u8ba1\u3002\u8ba1\u7b97\u8be5\u4ee3\u4ef7\u51fd\u6570\u6700\u5c0f\u503c\u7684\u7b97\u6cd5\u79f0\u4e3a\u201c\u9ec4\u91d1\u6807\u51c6\u201d\u7b97\u6cd5\u3002 \u76f4\u63a5\u7ebf\u6027\u53d8\u6362\uff08DLT\uff09\u7b97\u6cd5 \u00b6 \u9996\u5148\u8ba8\u8bba\u7531\u7ed9\u5b9a 2D \u5230 2D\u7684\u56db\u7ec4\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u786e\u5b9a H \u7684\u4e00\u79cd\u7b80\u5355\u7684\u7ebf\u6027\u7b97\u6cd5\uff0c\u53d8\u6362\u7531 \\(\\mathbf{x}_i^\\prime = H\\mathbf{x}_i\\) \u7ed9\u51fa\u3002\u4f46\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u9f50\u6b21\u77e2\u91cf\u65b9\u7a0b\uff0c\u56e0\u6b64 3 \u7ef4\u77e2\u91cf \\(\\mathbf{x}_i^\\prime\\) \u548c \\(H\\mathbf{x}_i\\) \u4e0d\u76f8\u7b49\u3002\u53ef\u4ee5\u7528\u77e2\u91cf\u53c9\u4e58\uff1a \\(\\mathbf{x}_i^\\prime \\times H\\mathbf{x}_i=\\mathbf{0}\\) \u8868\u793a\u3002 \u5982\u679c\u5c06\u77e9\u9635 H \u7684\u7b2c j \u884c\u8bb0\u4e3a \\(h^{j\\top},\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \uff0c\u5219 \\(\\mathbf{x}_i^\\prime \\times H \\mathbf{x}_i=0\\) \u53ef\u4ee5\u8f6c\u6362\u6210\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime\\mathbf{x}_i^\\top \\\\ -y_i^\\prime \\mathbf{x}_i^\\top & x_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} =\\mathbf{0} \\] h \u662f\u7531\u77e9\u9635 H \u7684\u5143\u7d20\u7ec4\u6210\u7684 0 \u7ef4\u77e2\u91cf\uff1a \\[ \\mathbf{h}= \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} , \\ \\ \\ H= \\begin{bmatrix} h_1 & h_2 & h_3 \\\\ h_4 & h_5 & h_6 \\\\ h_7 & h_8 & h_9 \\end{bmatrix} \\] \\(A_i\\mathbf{h}=\\mathbf{0}\\) \u662f\u672a\u77e5\u77e2\u91cf \\(\\mathbf{h}\\) \u7684\u7ebf\u6027\u65b9\u7a0b\uff0c\u77e9\u9635 \\(A_i\\) \u7684\u5143\u7d20\u662f\u5df2\u77e5\u70b9\u7684\u5750\u6807\u7684\u4e8c\u6b21\u591a\u9879\u5f0f\u3002 \u867d\u7136\u5f0f\u4e2d\u6709\u4e09\u4e2a\u65b9\u7a0b\uff0c\u4f46\u4ec5\u6709\u4e24\u4e2a\u662f\u7ebf\u6027\u72ec\u7acb\u7684\u3002\u5728\u89e3 H \u65f6\u5e38\u7701\u53bb\u7b2c\u4e09\u4e2a\u7b49\u5f0f\u3002 \u8be5\u65b9\u7a0b\u7ec4\u5bf9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u4efb\u4f55\u9f50\u6b21\u5750\u6807 \\((x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u6210\u7acb\u3002 \u6c42\u89e3 H \uff1a\u6bcf\u7ec4\u70b9\u5bf9\u5e94\u7ed9\u51fa\u5173\u4e8e H \u5143\u7d20\u7684\u4e24\u4e2a\u72ec\u7acb\u7684\u65b9\u7a0b\u3002\u7ed9\u5b9a\u56db\u7ec4\u8fd9\u6837\u7684\u70b9\u5bf9\u5e94\uff0c\u4fbf\u83b7\u5f97\u65b9\u7a0b\u7ec4 \\(A\\mathbf{h}=\\mathbf{0}\\) \u3002 \u8d85\u5b9a\u89e3 \u00b6 \u5982\u679c\u7ed9\u51fa\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u591a\u4f59\u56db\u7ec4\uff0c\u65b9\u7a0b \\(A\\mathbf{h}=\\mathbf{0}\\) \u662f\u8d85\u5b9a\u7684\u3002 \u5982\u679c\u70b9\u7684\u4f4d\u7f6e\u662f\u7cbe\u786e\u7684\uff0c\u90a3\u4e48 \\(A\\) \u7684\u79e9\u4ecd\u7136\u4e3a 8 \u5e76\u6709\u4e00\u7ef4\u96f6\u7a7a\u95f4\uff0c\u5e76\u4e14\u5b58\u5728\u7cbe\u786e\u89e3 \\(\\mathbf{h}\\) \u3002 \u5982\u679c\u56fe\u50cf\u5750\u6807\u7684\u6d4b\u91cf\u65f6\u4e0d\u7cbe\u786e\u7684\uff0c\u65b9\u7a0b\u7ec4\u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002\u6240\u4ee5\u9700\u8981\u4e00\u4e2a\u9002\u5f53\u7684\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\mathbf{h}\\) \uff0c\u901a\u5e38\u9644\u52a0\u8303\u6570\u6761\u4ef6\uff0c\u65e2\u7136\u4e0d\u5b58\u5728 \\(A\\mathbf{h}=\\mathbf{0}\\) \u7684\u7cbe\u786e\u89e3\uff0c\u5f88\u81ea\u7136\u4f1a\u5728\u901a\u5e38\u7ea6\u675f \\(\\parallel \\mathbf{h} \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002\u8fd9\u7b49\u4ef7\u4e8e\u6c42\u5546 \\(\\parallel A \\mathbf{h} \\parallel / \\parallel \\mathbf{h} \\parallel\\) \u7684\u6700\u5c0f\u503c\u95ee\u9898\u3002\u8be5\u89e3\u662f \\(A^\\top A\\) \u7684\u6700\u5c0f\u7279\u5f81\u503c\u7684\uff08\u5355\u4f4d\uff09\u7279\u5f81\u77e2\u91cf\u3002\u7531\u6b64\u6240\u5f97\u5230\u7684\u7b97\u6cd5\u79f0\u4e3a \u57fa\u672cDLT\u7b97\u6cd5 \u3002 \u975e\u9f50\u6b21\u89e3 \u00b6 \u628a\u7b49\u5f0f\u8f6c\u6210\u975e\u9f50\u6b21\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u5373\u7ed9\u77e2\u91cf \\(\\mathbf{h}\\) \u4e2d\u7684\u67d0\u4e2a\u5143\u7d20\u5f3a\u52a0\u4e0a \\(h_j=1\\) \u7684\u6761\u4ef6\uff1a \\[ \\begin{bmatrix} 0 & 0 & 0 & -x_iw_i^\\top & -y_iw_i^\\top & -w_iw_i^\\top & x_iy_i^\\top & y_iy_i^\\top \\\\ x_iw_i^\\top & y_iw_i^\\top & w_iw_i^\\top & 0 & 0 & 0 & -x_ix_i^\\top & -y_ix_i^\\top \\\\ \\end{bmatrix} \\bar{\\mathbf{h}}= \\begin{bmatrix} -w_iy_i^\\top \\\\ -w_ix_i^\\top \\end{bmatrix} \\] \u5176\u4e2d \\(\\bar{\\mathbf{h}}\\) \u662f\u7531 \\(\\mathbf{h}\\) \u7684\u524d\u516b\u4e2a\u5143\u7d20\u7ec4\u6210\u7684 8 \u7ef4\u77e2\u91cf\u3002 \u4f46\u662f\uff0c\u5982\u679c\u4e8b\u5b9e\u4e0a\u771f\u6b63\u7684\u89e3\u662f \\(h_j=0\\) \uff0c\u90a3\u4e48\u4e0d\u5b58\u5728\u4e00\u56e0\u5b50 \\(k\\) \u4f7f\u5f97 \\(kh_j=1\\) \uff0c\u8868\u793a\u4ee4 \\(h_j=1\\) \u5f97\u4e0d\u5230\u771f\u89e3\u3002 \u9000\u5316\u914d\u7f6e \u00b6 \u5982\u679c \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u90a3\u4e48 \\(H^*=\\mathbf{x}_4^\\top\\mathbf{I}^\\top\\) \u662f\u4e00\u4e2a\u89e3 \\(H^*\\) \u662f\u552f\u4e00\u89e3\uff08\u76f8\u5dee\u4e00\u5c3a\u5ea6\u56e0\u5b50\uff09\uff0c\u56e0\u4e3a \\(H^*\\) \u662f\u5947\u5f02\u77e9\u9635\uff0c\u4e0d\u5b58\u5728\u628a\u6bcf\u4e2a \\(\\mathbf{x}_i\\) \u53d8\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u3002\u5f53 \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u800c \\(\\mathbf{x}_1^\\prime, \\mathbf{x}_2^\\prime, \\mathbf{x}_3^\\prime\\) \u4e0d\u5171\u7ebf\u65f6\u5c31\u4f1a\u4ea7\u751f\u8fd9\u79cd\u60c5\u51b5 \u5b58\u5728\u53e6\u5916\u4e00\u4e2a\u89e3 \\(H\\) \uff1a\u4ece\u800c\u4efb\u4f55\u5f62\u5982 \\(\\alpha H^*+\\beta H\\) \u7684\u77e9\u9635\u90fd\u662f\u89e3\uff0c\u56e0\u6b64\u6709\u4e00\u4e2a 2 \u53c2\u6570\u7684\u53d8\u6362\u7c07\u5b58\u5728\uff0c\u8fdb\u800c\u63a8\u51fa\u7ed9\u51fa\u7684 8 \u4e2a\u65b9\u7a0b\u4e0d\u662f\u72ec\u7acb\u7684 \u51fa\u73b0\u67d0\u79cd\u914d\u7f6e\u4e0d\u80fd\u786e\u5b9a\u552f\u4e00\u89e3\u7684\u60c5\u5f62\u79f0\u4e3a \u9000\u5316 \u3002 \u9000\u5316\u7684\u5b9a\u4e49\u65e2\u6d89\u53ca\u914d\u7f6e\u4e5f\u6d89\u53ca\u53d8\u6362\u7c7b\u578b\uff0c\u800c\u4e14\u9000\u5316\u95ee\u9898\u4e0d\u4ec5\u9650\u4e8e\u6700\u5c0f\u914d\u7f6e\u89e3\u3002\u5982\u679c\u591a\u51fa\u6765\u7684\uff08\u7cbe\u786e\u7684\uff0c\u5373\u65e0\u8bef\u5dee\u7684\uff09\u70b9\u5bf9\u5e94\u4e5f\u5171\u7ebf\uff0c\u90a3\u4e48\u9000\u5316\u95ee\u9898\u4ecd\u6ca1\u6709\u89e3\u51b3\u3002 \u7531\u7ebf\u548c\u5176\u4ed6\u5b9e\u4f53\u6c42\u89e3 \u00b6 \u524d\u9762\u53ea\u8ba8\u8bba\u7531\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u5355\u5e94\uff0c\u7136\u800c\u7ebf\u5bf9\u5e94\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5e94\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u5355\u5e94\uff0c\u6240\u4ee5\u5c31\u4ea7\u751f\u8ba1\u7b97\u4e00\u4e2a\u5355\u5e94\uff08\u6216\u4efb\u4f55\u5176\u4ed6\u5173\u7cfb\uff09\u9700\u8981\u591a\u5c11\u7ec4\u5bf9\u5e94\u7684\u95ee\u9898\u3002\u4e00\u822c\u7684\u539f\u5219\u662f\u7ea6\u675f\u6570\u5fc5\u987b\u7b49\u4e8e\u6216\u5927\u4e8e\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002 \u91c7\u7528\u6df7\u5408\u7c7b\u578b\u7684\u5bf9\u5e94\u6765\u8ba1\u7b97 H \u65f6\u5fc5\u987b\u8c28\u614e\uff0c\u4f8b\u5982\u4e00\u4e2a 2D \u5355\u5e94\u4e0d\u80fd\u7531\u4e24\u7ec4\u70b9\u5bf9\u5e94\u548c\u4e24\u7ec4\u7ebf\u5bf9\u5e94\u552f\u4e00\u786e\u5b9a\uff0c\u4f46\u80fd\u7531\u4e09\u7ea7\u70b9\u548c\u4e00\u7ec4\u7ebf\u6216\u4e00\u7ec4\u70b9\u548c\u4e09\u7ec4\u7ebf\u6765\u552f\u4e00\u786e\u5b9a\uff0c\u5373\u4f7f\u6bcf\u79cd\u914d\u7f6e\u90fd\u6709 8 \u4e2a\u81ea\u7531\u5ea6\u4e5f\u662f\u5982\u6b64\u3002 \u4e0d\u540c\u7684\u4ee3\u4ef7\u51fd\u6570 \u00b6 \u4e3a\u786e\u5b9a H \u7684\u8d85\u5b9a\u89e3\u800c\u9700\u6700\u5c0f\u5316\u7684\u82e5\u5e72\u4ee3\u4ef7\u51fd\u6570 \u4ee3\u6570\u8ddd\u79bb \u00b6 DLT \u7b97\u6cd5\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002 \u77e2\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u79f0\u4e3a\u6b8b\u5dee\u77e2\u91cf\uff0c\u5e76\u4e14\u8981\u6700\u5c0f\u5316\u7684\u6b63\u662f\u8be5\u8bef\u5dee\u77e2\u91cf\u7684\u8303\u6570\u3002 \u77e2\u91cf \\(\\varepsilon_i\\) \u88ab\u79f0\u4e3a\u5173\u8054\u4e8e\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u548c\u5355\u5e94 H \u7684 \u4ee3\u6570\u8bef\u5dee\u77e2\u91cf \uff0c\u8be5\u77e2\u91cf\u7684\u8303\u6570\u662f\u4e00\u4e2a\u6807\u91cf\uff0c\u79f0\u4e3a \u4ee3\u6570\u8ddd\u79bb \uff1a \\[ d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\parallel \\varepsilon_i \\parallel= \\parallel \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime \\mathbf{x}_i^\\top \\end{bmatrix} \\mathbf{h} \\parallel^2 \\] \u5bf9\u4e8e\u4efb\u4f55\u4e24\u4e2a\u77e2\u91cf \\(\\mathbf{x}_1\\) \u548c \\(\\mathbf{x}_2\\) \uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_1, \\mathbf{x}_2)^2=a_1^2+a_2^2 \\ \\ \u5176\u4e2d\\mathbf{a}=(a_1,a_2,a_3)^\\top=\\mathbf{x}_1 \\times \\mathbf{x}_2 \\] \u7ed9\u5b9a\u5bf9\u5e94\u7684\u96c6\u5408\uff0c\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u662f\u6574\u4e2a\u96c6\u5408\u7684\u4ee3\u6570\u8bef\u5dee\u77e2\u91cf\uff0c\u7531\u6b64\u53ef\u89c1\uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\sum_{i} \\parallel \\varepsilon_i \\parallel^2= \\parallel A\\mathbf{h} \\parallel^2= \\parallel \\varepsilon \\parallel^2 \\] \u7f3a\u70b9\u662f\u88ab\u6700\u5c0f\u5316\u7684\u91cf\u6ca1\u6709\u51e0\u4f55\u6216\u7edf\u8ba1\u4e0a\u7684\u610f\u4e49\u3002 \u51e0\u4f55\u8ddd\u79bb \u00b6 \u8bb0\u53f7 \u00b6 \u77e2\u91cf \\(\\mathbf{x}\\) \u8868\u793a \u6d4b\u91cf \u7684\u56fe\u50cf\u5750\u6807\uff1b \\(\\hat{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u4f30\u8ba1\u503c\u800c \\(\\bar{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u771f\u503c\u3002 \u5355\u56fe\u50cf\u8bef\u5dee \u00b6 \u9996\u5148\u8003\u8651\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u975e\u5e38\u7cbe\u786e\u800c\u8bef\u5dee\u4ec5\u51fa\u73b0\u5728\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u60c5\u5f62\u3002\u9002\u5b9c\u6700\u5c0f\u5316\u7684\u91cf\u662f \u8f6c\u79fb\u8bef\u5dee \u3002\u5b83\u662f\u7b2c\u4e8c\u5e45\u56fe\u50cf\u4e0a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u4e0e\u70b9 \\(H\\bar{\\mathbf{x}}\\) \u4e4b\u95f4\u7684 \u6b27\u6c0f\u8ddd\u79bb \u3002\u7528\u8bb0\u53f7 \\(d(\\mathbf{x}, \\mathbf{y})\\) \u8868\u793a\u975e\u9f50\u6b21\u70b9 \\(\\mathbf{x}\\) \u548c \\(\\mathbf{y}\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u3002\u5bf9\u5e94\u96c6\u5408\u7684\u8f6c\u79fb\u8bef\u5dee\u662f\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}_i})^2 \\] \u5bf9\u79f0\u8f6c\u79fb\u8bef\u5dee \u00b6 \u66f4\u5207\u5408\u5b9e\u9645\u7684\u60c5\u5f62\u662f\u56fe\u50cf\u6d4b\u91cf\u8bef\u5dee\u5728\u4e24\u5e45\u56fe\u50cf\u4e2d\u90fd\u53d1\u751f\uff0c\u4ece\u800c\u5e94\u8be5\u6700\u5c0f\u5316\u4e24\u5e45\u800c\u4e0d\u4ec5\u662f\u4e00\u5e45\u56fe\u50cf\u7684\u8bef\u5dee\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\] \u91cd\u6295\u5f71\u8bef\u5dee\u2014\u2014\u4e24\u5e45\u56fe\u50cf \u00b6 \u5bf9\u6bcf\u5e45\u56fe\u50cf\u8bef\u5dee\u4f5c\u91cf\u5316\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f30\u8ba1\u6bcf\u7ec4\u5bf9\u5e94\u7684\u201c\u6821\u6b63\u503c\u201d\u3002\u4e3a\u4e86\u5f97\u5230\u5b8c\u5168\u7684\u5339\u914d\u70b9\u96c6\u6709\u5fc5\u8981\u5728\u4e00\u5e45\u56fe\u50cf\uff08\u7b2c\u4e8c\u5e45\u56fe\u50cf\uff09\u4e0a\u5bf9\u6d4b\u91cf\u8fdb\u884c\u6821\u6b63\u3002 \u5355\u5e94 \\(\\hat{H}\\) \u548c\u5b8c\u5168\u5339\u914d\u7684\u70b9\u5bf9 \\(\\hat{\\mathbf{x}_i}\\) \u548c \\(\\hat{\\mathbf{x}_i}^\\prime\\) \u4ee5\u6700\u5c0f\u5316\u603b\u7684\u8bef\u5dee\u51fd\u6570: \\[ \\sum_{i} d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2 \\ \\ \\ s.t \\ \\ \\ \\hat{\\mathbf{x}_i}^\\prime=\\hat{H}\\hat{\\mathbf{x}_i} \\ \\ \\ \\forall i. \\] \u5148\u7531 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u4f30\u8ba1\u4e16\u754c\u5e73\u9762\u7684\u70b9 \\(\\hat{\\mathbf{X}_i}\\) \uff0c\u7136\u540e\u628a\u5b83\u91cd\u6295\u5f71\u5230\u4f30\u8ba1\u4e0a\u8ba4\u4e3a\u662f\u5b8c\u5168\u5339\u914d\u7684\u5bf9\u5e94 \\(\\hat{\\mathbf{x}_i} \\leftrightarrow \\hat{\\mathbf{x}_i}^\\prime\\) \u51e0\u4f55\u548c\u4ee3\u6570\u8ddd\u79bb\u7684\u6bd4\u8f83 \u00b6 \u4ee4 \\(\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u5e76\u5b9a\u4e49\u77e2\u91cf \\((\\hat{x_i}^\\prime, \\hat{y_i}^\\prime, \\hat{w_i}^\\prime)^\\top=\\hat{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}}\\) \uff0c\u5219 \\[ d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2= d_{alg}(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2/\\hat{w_i}^\\prime w_i^\\prime \\] \u51e0\u4f55\u8ddd\u79bb\u4e0e\u4ee3\u6570\u8ddd\u79bb\u76f8\u5173\uff0c\u4f46\u4e0d\u76f8\u7b49\u3002\u53ea\u6709\u5f53 \\(\\hat{w_i}^\\prime=w_i^\\prime=1\\) \u4e24\u4e2a\u8ddd\u79bb\u76f8\u7b49\u3002\u56e0\u6b64\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8ddd\u79bb\u548c\u4ee3\u6570\u8ddd\u79bb\u76f8\u7b49\u3002\u5bf9\u4e8e\u4eff\u5c04\u53d8\u6362\uff0c\u6700\u5c0f\u5316\u51e0\u4f55\u8ddd\u79bb\u53ef\u4ee5\u7528\u57fa\u4e8e\u4ee3\u6570\u8ddd\u79bb\u7684\u7ebf\u6027 DLT \u7b97\u6cd5\u3002 \u91cd\u6295\u5f71\u8bef\u5dee\u7684\u51e0\u4f55\u89e3\u91ca \u00b6 \u4e24\u5e73\u9762\u4e4b\u95f4\u7684\u5355\u5e94\u4f30\u8ba1\u53ef\u4ee5\u89c6\u4e3a\u7528 4D \u7a7a\u95f4 \\(IR^4\\) \u4e2d\u7684\u201c\u66f2\u9762\u201d\u6765\u62df\u5408\u70b9\u3002 \u6bcf\u5bf9\u56fe\u50cf\u70b9 \\(\\mathbf{x}, \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6d4b\u91cf\u7a7a\u95f4 \\(IR^4\\) \u7684\u4e00\u4e2a\u70b9\uff0c\u8bb0\u4f5c \\(\\mathbf{X}\\) \u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u6ee1\u8db3 \\(\\mathbf{x} \\times \\mathbf{x}^\\prime=\\mathbf{0}\\) \u7684\u56fe\u50cf\u5bf9\u5e94 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6765 \\(IR^4\\) \u4e2d\u7684\u4e00\u4e2a\u4ee3\u6570\u7c07 \\(\\upsilon_H\\) \uff0c\u5b83\u662f\u4e24\u4e2a\u8d85\u4e8c\u6b21\u66f2\u9762\u7684\u4ea4\u96c6\u3002 \\[ d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2=d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2 \\] \u5176\u4e2d \\(d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u5230\u7c07 \\(\\upsilon_H\\) \u7684\u5782\u76f4\u8ddd\u79bb\u3002 Sampson \u8bef\u5dee \u00b6 Sampson \u8bef\u5dee\u5176\u590d\u6742\u6027\u4ecb\u4e8e\u4ee3\u6570\u548c\u51e0\u4f55\u4ee3\u4ef7\u51fd\u6570\u4e4b\u95f4\uff0c\u4f46\u975e\u5e38\u8fd1\u4f3c\u4e8e\u51e0\u4f55\u8bef\u5dee\u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u5728 \\(\\upsilon_H\\) \u4e0a\u7684\u4efb\u4f55\u70b9 \\(\\mathbf{X}=(x,y,x^\\prime, y^\\prime)^\\top\\) \uff0c\u4ee3\u4ef7\u51fd\u6570\u7528 \\(\\mathcal{C}_H(\\mathbf{X})=\\mathbf{0}\\) \u3002\u7528\u4e0b\u5217 Taylor \u5c55\u5f00\u5f0f\u6765\u4e00\u9636\u903c\u8fd1\uff1a \\[ \\mathcal{C}_H(\\mathbf{X}+\\delta_x)=\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x \\] \u8bb0 \\(\\delta_x = \\hat{\\mathbf{X}}-\\mathbf{X}\\) \u5e0c\u671b \\(\\hat{\\mathbf{X}}\\) \u5728 \\(\\upsilon_H\\) \u4e0a\uff0c\u5373 \\(\\mathcal{C}_H(\\hat{\\mathbf{X}})=\\mathbf{0}\\) \uff0c\u56e0\u6b64 \\(\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x=\\mathbf{0}\\) \u3002\u8bb0\u6210 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \uff0c\u5176\u4e2d \\(\\mathbf{J}\\) \u662f\u504f\u5bfc\u6570\u77e9\u9635\uff0c \\(\\varepsilon\\) \u4e0e \\(\\mathbf{X}\\) \u76f8\u5173\u7684\u4ee3\u4ef7\u51fd\u6570 \\(\\mathcal{C}_H(\\mathbf{X})\\) \uff0c \u6700\u5c0f\u5316\u95ee\u9898 \u662f\u6c42\u6ee1\u8db3\u6b64\u65b9\u7a0b\u7684\u6700\u5c0f \\(\\delta_x\\) \u3002 \u5373 \u6c42\u5728\u6ee1\u8db3 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \u6761\u4ef6\u4e0b\u4f7f \\(\\parallel \\delta_x \\parallel\\) \u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\delta_x\\) \u4f7f\u7528 Lagrange \u4e58\u5b50\u6cd5\uff0c\u6c42\u7684\u8303\u6570 \\(\\parallel \\delta \\parallel^2\\) \u662f Sampson \u8bef\u5dee\uff1a \\[ \\parallel \\delta_x \\parallel^2= \\delta_x^\\top\\delta_x= \\varepsilon^\\top(\\mathbf{J}\\mathbf{J}^\\top)^{-1}\\varepsilon \\] \u7edf\u8ba1\u4ee3\u4ef7\u51fd\u6570\u548c\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u00b6 \u5047\u5b9a\u5728\u6ca1\u6709\u6d4b\u91cf\u8bef\u5dee\u65f6\uff0c\u771f\u5b9e\u7684\u70b9\u51c6\u786e\u6ee1\u8db3\u4e00\u4e2a\u5355\u5e94\u53d8\u6362\uff0c\u5373 \\(\\bar{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}_i}\\) \u3002 \u5047\u5b9a\u6bcf\u4e00\u5e45\u56fe\u50cf\u5750\u6807\u90fd\u5177\u6709\u96f6\u5747\u503c\u548c\u7edf\u4e00\u7684\u6807\u51c6\u5dee \\(\\sigma\\) \u7684\u9ad8\u65af\u566a\u58f0\u3002\u8fd9\u610f\u5473\u7740 \\(x=\\bar{x}+\\Delta x\\) \uff0c\u5176\u4e2d \\(\\Delta x\\) \u670d\u4ece\u65b9\u5dee\u4e3a \\(\\sigma^2\\) \u7684\u9ad8\u65af\u5206\u5e03\u3002\u8fdb\u4e00\u6b65\u5047\u8bbe\u6bcf\u6b21\u6d4b\u91cf\u7684\u566a\u58f0\u662f\u76f8\u5728\u72ec\u7acb\u7684\uff0c\u90a3\u4e48\uff0c\u82e5\u70b9\u7684\u771f\u503c\u662f \\(\\bar{\\mathbf{x}}\\) \uff0c\u5219\u6bcf\u4e2a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}\\) \u7684\u6982\u7387\u5bc6\u5ea6\u51fd\u6570(pdf)\u662f\uff1a \\[ \\Pr(\\mathbf{x})=(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x},\\bar{\\mathbf{x}})^2/(2\\sigma^2)} \\] \u5355\u56fe\u50cf\u8bef\u5dee \u00b6 \u5047\u5b9a\u6bcf\u70b9\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\uff0c\u70b9\u5bf9\u5e94 \\(\\{\\bar{\\mathbf{x}_i} \\leftrightarrow \\mathbf{x}_i^\\prime\\}\\) \u7684\u6982\u7387\u5c31\u662f\u5b83\u4eec\u5355\u4e2a pdf \u7684\u4e58\u79ef\uff1a \\[ \\Pr(\\{\\mathbf{x}_i^\\prime | H\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2/(2\\sigma^2)} \\] \u8be5\u5bf9\u5e94\u96c6\u5408\u7684 \u5bf9\u6570\u4f3c\u7136 \u4e3a\uff1a \\[ \\log \\Pr(\\mathbf{x}_i^\\prime | H)=-\\frac{1}{2\\sigma^2}\\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2+\u5e38\u6570 \\] \u5355\u5e94\u7684 \u6700\u5927\u4f3c\u7136 ML \u4f30\u8ba1 \\(\\hat{H}\\) \u6700\u5927\u5316\u8fd9\u4e2a\u5bf9\u6570\u4f3c\u7136\uff0c\u5373\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2 \\] \u56e0\u6b64\uff0cML \u4f30\u8ba1\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u51fd\u6570 \u53cc\u56fe\u50cf\u8bef\u5dee \u00b6 \u5982\u679c\u771f\u5b9e\u5bf9\u5e94\u662f \\(\\{\\bar{\\mathbf{x}}_i \\leftrightarrow H \\bar{\\mathbf{x}}_i=\\bar{\\mathbf{x}}_i^\\prime\\}\\) \uff0c\u53d7\u566a\u58f0\u5e72\u6270\u7684\u6570\u636e\u7684 pdf \u662f\uff1a \\[ \\Pr(\\{\\mathbf{x}_i, \\mathbf{x}_i^\\prime\\} | H, \\{\\bar{\\mathbf{x}}_i\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-(d(\\mathbf{x}_i, \\bar{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}}_i)^2)/(2\\sigma^2)} \\] ML \u4f30\u8ba1\u5c31\u662f\u6c42\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i, \\hat{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}}_i^\\prime)^2 \\] ML \u4f30\u8ba1\u7b49\u540c\u4e8e\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u51fd\u6570 Mahalanobis \u8ddd\u79bb \u00b6 \u4e00\u822c\u9ad8\u65af\u5206\u5e03\u7684\u60c5\u5f62\uff0c\u53ef\u4ee5\u5047\u5b9a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6ee1\u8db3\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u9ad8\u65af\u5206\u5e03\u51fd\u6570\u3002\u6700\u5927\u5316\u5bf9\u6570\u4f3c\u7136\u5219\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 Mahalanobis \u8ddd\u79bb\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2=(\\mathbf{X}-\\bar{\\mathbf{X}})^\\top\\sum\\nolimits^{-1}(\\mathbf{X}-\\bar{\\mathbf{X}}) \\] \u5f53\u6bcf\u5e45\u56fe\u50cf\u90fd\u6709\u8bef\u5dee\u5e76\u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u4e0e\u53e6\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\u65f6\uff0c\u5408\u9002\u7684\u4ee3\u4ef7\u51fd\u6570\u662f\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2+\\parallel \\mathbf{X}^\\prime - \\bar{\\mathbf{X}}^\\prime \\parallel_{\\sum^\\prime}^2 \\] \u5176\u4e2d \\(\\sum\\) \u548c \\(\\sum^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u7684\u534f\u65b9\u5dee\u77e9\u9635 \u53d8\u6362\u4e0d\u53d8\u6027\u548c\u5f52\u4e00\u5316 \u00b6 \u5173\u4e8e\u56fe\u50cf\u5750\u6807\u53d8\u6362\u7684\u4e0d\u53d8\u6027 \u00b6 \u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}\\) \u88ab \\(\\tilde{\\mathbf{x}}=T\\mathbf{x}\\) \u66ff\u4ee3\uff0c\u800c\u53e6\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}^\\prime\\) \u88ab \\(\\tilde{\\mathbf{x}}^\\prime=T^\\prime\\mathbf{x}^\\prime\\) \u66ff\u4ee3\u3002\u56e0\u6b64 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\uff1a \u6839\u636e\u516c\u5f0f \\(\\tilde{\\mathbf{x}}_i=T\\mathbf{x}_i\\) \u548c \\(\\tilde{\\mathbf{x}}_i^\\prime=T^\\prime\\mathbf{x}_i^\\prime\\) \u53d8\u6362\u56fe\u50cf\u5750\u6807 \u7531\u5bf9\u5e94 \\(\\tilde{\\mathbf{x}}_i \\leftrightarrow \\tilde{\\mathbf{x}}_i^\\prime\\) \uff0c\u6c42 \\(\\tilde{H}\\) \u4ee4 \\(H=T^{\\prime-1}\\tilde{H}T\\) DLT \u7b97\u6cd5\u7684\u975e\u4e0d\u53d8\u6027 \u00b6 \u4ee4 \\(T^\\prime\\) \u4e3a\u5177\u6709\u7f29\u653e\u56e0\u5b50 \\(s\\) \u7684\u76f8\u4f3c\u53d8\u6362\uff0c \\(T\\) \u4e3a\u4efb\u610f\u7684\u5c04\u5f71\u53d8\u6362\u3002\u6b64\u5916\uff0c\u5047\u8bbe \\(H\\) \u662f\u4efb\u4f55 2D \u5355\u5e94\u5e76\u5b9a\u4e49 \\(\\tilde{H}=T^\\prime HT^{-1}\\) \uff0c\u90a3\u4e48 \\(\\parallel \\tilde{A} \\tilde{\\mathbf{h}} \\parallel = s \\parallel A \\mathbf{h} \\parallel\\) \u867d\u7136\u8fd9\u6837\u5b9a\u4e49\u7684 \\(H\\) \u548c \\(\\tilde{H}\\) \u7ed9\u51fa\u540c\u6837\u7684\u8bef\u5dee \\(\\varepsilon\\) \uff0c\u4f46\u662f\u5bf9\u89e3\u65bd\u52a0\u7684\u7ea6\u675f\u6761\u4ef6 \\(\\parallel H \\parallel = 1\\) \u4e0d\u7b49\u4ef7\u4e8e\u6761\u4ef6 \\(\\parallel \\tilde{H} \\parallel = 1\\) \uff0c\u5b83\u4eec\u5e76\u4e0d\u4ee5\u4efb\u4f55\u7b80\u5355\u7684\u65b9\u5f0f\u76f8\u5173\u8054\u3002 \u51e0\u4f55\u8bef\u5dee\u7684\u4e0d\u53d8\u6027 \u00b6 \\[ d(\\tilde{\\mathbf{x}}^\\prime, \\tilde{H}\\tilde{\\mathbf{x}})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime HT^{-1}T\\mathbf{x})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime H\\mathbf{x})= d(\\mathbf{x}^\\prime, H\\mathbf{x}) \\] \u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8bef\u5dee\u88ab\u4e58\u4ee5\u53d8\u6362\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u4ece\u800c\u6700\u5c0f\u5316\u53d8\u6362\u7684\u5bf9\u5e94\u65b9\u5f0f\u4e0e\u6b27\u6c0f\u53d8\u6362\u76f8\u540c\u3002\u6240\u4ee5\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\u3002 \u5f52\u4e00\u5316\u53d8\u6362 \u00b6 \u6570\u636e\u5f52\u4e00\u5316\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u7ed3\u679c\u7684\u7cbe\u5ea6\uff0c\u8fd8\u5bf9\u521d\u59cb\u6570\u636e\u5f52\u4e00\u5316\u7684\u7b97\u6cd5\u5c06\u5bf9\u4efb\u4f55\u5c3a\u5ea6\u7f29\u653e\u548c\u5750\u6807\u539f\u70b9\u7684\u9009\u62e9\u4e0d\u53d8\u3002\u56e0\u800c\u4f7f DLT \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5173\u4e8e\u76f8\u4f3c\u53d8\u6362\u4e0d\u53d8\u3002 \u5404\u5411\u540c\u6027\u7f29\u653e \u00b6 \u5bf9\u70b9\u8fdb\u884c\u5e73\u79fb\u4f7f\u70b9\u96c6\u5f62\u5fc3\u4f4d\u4e8e\u539f\u70b9 \u5bf9\u70b9\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684\u5e73\u5747\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{2}\\) \u5bf9\u4e24\u5e45\u56fe\u50cf\u72ec\u7acb\u8fdb\u884c\u4e0a\u8ff0\u53d8\u6362 \u6570\u636e\u5f52\u4e00\u5316\u5728 DLT \u7b97\u6cd5\u4e2d\u662f\u5b9e\u8d28\u6027\u7684\uff0c\u4e00\u5b9a\u4e0d\u8981\u89c6\u5b83\u4e3a\u53ef\u6709\u53ef\u65e0\u7684\u3002 \u5f52\u4e00\u5316\u4e0e\u6761\u4ef6\u6570 \u00b6 \u5f52\u4e00\u5316\u7684\u5f71\u54cd\u4e0e DLT \u65b9\u7a0b\u7ec4\u7684\u6761\u4ef6\u6570\u6216\u51c6\u786e\u5730\u8bf4\u4e0e\u65b9\u7a0b\u7ec4\u77e9\u9635 A \u7684\u7b2c\u4e00\u4e2a\u548c\u5012\u6570\u7b2c\u4e8c\u4e2a\u5947\u5f02\u503c\u7684\u6bd4\u7387 \\(d_1/d_{n-1}\\) \u6709\u5173\u3002\u4f46\u662f\uff0c\u5728\u6709\u566a\u58f0\u5b58\u5728\u65f6\u89e3\u5c06\u504f\u79bb\u5176\u6b63\u786e\u7ed3\u679c\u3002\u5927\u6761\u4ef6\u6570\u4f1a\u653e\u5927\u8fd9\u79cd\u504f\u5411\u3002 \u975e\u5404\u5411\u540c\u6027\u7f29\u653e \u00b6 \u5728\u975e\u5404\u540c\u6027\u7f29\u653e\u4e2d\uff0c\u70b9\u7684\u5f62\u5fc3\u548c\u524d\u9762\u4e00\u6837\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7ecf\u5e73\u79fb\u540e\u70b9\u5728\u539f\u70b9\u9644\u8fd1\u5f62\u6210\u4e91\u3002\u7136\u540e\u8fdb\u884c\u5750\u6807\u5c3a\u5ea6\u7f29\u653e\u4f7f\u8be5\u70b9\u96c6\u7684\u4e24\u4e3b\u77e9\u90fd\u7b49\u4e8e 1\u3002\u8fd9\u6837\u4f7f\u8be5\u70b9\u96c6\u5f62\u6210\u4ee5\u539f\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u534a\u5f84\u4e3a 1 \u7684\u8fd1\u4f3c\u7684\u5bf9\u79f0\u5706\u4e91\u3002 \u65e0\u7a77\u8fdc\u9644\u8fd1\u7684\u70b9\u7684\u7f29\u653e \u00b6 \u5f53\u70b9\u4f4d\u4e8e\u6216\u63a5\u8fd1\u5e73\u9762\u7684\u65e0\u7a77\u8fdc\u65f6\uff0c\u5404\u5411\u540c\u6027\uff08\u6216\u975e\u5404\u5411\u540c\u6027\uff09\u7684\u7f29\u653e\u65b9\u5f0f\u6765\u5f52\u4e00\u5316\u5750\u6807\u662f\u65e2\u65e0\u9053\u7406\u53c8\u4e0d\u53ef\u884c\u7684\uff0c\u56e0\u4e3a\u5f62\u5fc3\u5750\u6807\u548c\u7f29\u653e\u56e0\u5b50\u4e3a\u65e0\u7a77\u5927\u6216\u63a5\u8fd1\u65e0\u7a77\u5927\u3002\u4e00\u4e2a\u4f3c\u4e4e\u4f1a\u7ed9\u51fa\u597d\u7ed3\u679c\u7684\u65b9\u6cd5\u662f\u5f52\u4e00\u5316\u70b9\u96c6 \\(\\mathbf{x}_i=(x_i,y_i,w_i)^\\top\\) \u4f7f\u5f97\uff1a \\[ \\sum_i x_i=\\sum_i y_i=0;\\sum_ix_i^2+y_i^2=2\\sum_iw_i^2;x_i^2+y_i^2+w_i^2=1,\\forall i \\] \u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5 \u00b6 \u8fed\u4ee3\u6700\u5c0f\u5316\u6280\u672f \u4ee3\u4ef7\u53c2\u6570 \uff1a\u4ee3\u4ef7\u51fd\u6570\u662f\u6700\u5c0f\u5316\u7684\u57fa\u7840 \u53c2\u6570\u5316 \uff1a\u628a\u8981\u8ba1\u7b97\u7684\u53d8\u6362\uff08\u6216\u5176\u4ed6\u5b9e\u4f53\uff09\u8868\u793a\u6210\u6709\u9650\u6570\u76ee\u7684\u53c2\u6570 \u51fd\u6570\u786e\u5b9a \uff1a\u5fc5\u987b\u786e\u5b9a\u4e00\u4e2a\u7528\u53c2\u6570\u96c6\u63cf\u8ff0\u7684\u4ee3\u4ef7\u51fd\u6570 \u521d\u59cb\u5316 \uff1a\u8ba1\u7b97\u4e00\u4e2a\u9002\u5f53\u7684\u521d\u59cb\u53c2\u6570\u4f30\u8ba1\u3002\u4e00\u822c\u5c06\u7531\u4e00\u4e2a\u7ebf\u6027\u7b97\u6cd5\uff08\u4f8b\u5982 DLT \u7b97\u6cd5\uff09\u6765\u5b9e\u73b0 \u8fed\u4ee3 \uff1a\u7531\u521d\u59cb\u89e3\u5f00\u59cb\uff0c\u5728\u8fed\u4ee3\u4e2d\u9010\u6b65\u4fee\u6b63\u53c2\u6570\u4ee5\u8fbe\u5230\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u7684\u76ee\u7684 \u5173\u4e8e\u53c2\u6570\u5316 \u00b6 \u6307\u5bfc\u53c2\u6570\u5316\u7684\u4e00\u822c\u7b56\u7565\u662f\u9009\u62e9\u80fd\u8986\u76d6\u6700\u5c0f\u5316\u7684\u6574\u4e2a\u7a7a\u95f4\u5e76\u80fd\u7528\u4e00\u79cd\u65b9\u4fbf\u7684\u65b9\u5f0f\u6765\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u3002\u5bf9\u4e8e\u9f50\u6b21\u76ee\u6807\u901a\u5e38\u8bbe\u6709\u5fc5\u8981\u6216\u4e0d\u9f13\u52b1\u8ffd\u6c42\u6d88\u9664\u5c3a\u5ea6\u56e0\u5b50\u7684\u591a\u4e49\u6027\u800c\u91c7\u7528\u6700\u5c0f\u53c2\u6570\u5316\u3002\u9009\u62e9\u53c2\u6570\u5316\u7684\u53e6\u4e00\u4e2a\u8003\u8651\u662f\u9650\u5236\u53d8\u6362\u4e3a\u4e00\u4e2a\u5177\u4f53\u7684\u7c7b\u578b\u3002 \u51fd\u6570\u786e\u5b9a \u00b6 \u6709\u4e00\u4e2a\u534f\u65b9\u5dee\u77e9\u9635\u4e3a \\(\\sum\\) \u7684 \u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X} \\in IR^N\\) \u4e00\u7ec4\u53c2\u6570\u88ab\u8868\u8fbe\u6210\u4e00\u4e2a\u77e2\u91cf \\(\\mathbf{P} \\in IR^M\\) \u5b9a\u4e49\u4e00\u4e2a\u6620\u5c04 \\(f:\\ IR^M \\to IR^N\\) \uff0c\u5176\u503c\u57df\uff08\u81f3\u5c11\u5c40\u90e8\u5730\uff09\u662f \\(IR^N\\) \u4e2d\u8868\u793a\u5bb9\u8bb8\u6d4b\u91cf\u96c6\u7684\u6a21\u578b\u66f2\u9762 S \u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u662f Mahalanobis \u8ddd\u79bb \\[\\parallel \\mathbf{X} - f(\\mathbf{P}) \\parallel_{\\sum}^2=(\\mathbf{X} - f(\\mathbf{P}))^\\top\\sum\\nolimits^{-1}(\\mathbf{X} - f(\\mathbf{P}))\\] \u5355\u56fe\u50cf\u8bef\u5dee-\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570 \uff1a\u56fa\u5b9a\u7b2c\u4e00\u5e45\u56fe\u50cf\u4e2d\u70b9 \\(\\mathbf{x}_i\\) \u7684\u5750\u6807\uff0c\u5e76\u53d8\u6362 H \u4ee5\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ \\sum_id(\\mathbf{x}_i^\\prime,H\\tilde{\\mathbf{x}}_i)^2 \\\\ f:\\mathbf{h} \\to (H\\mathbf{x}_1, H\\mathbf{x}_2, ..., H\\mathbf{H}_n) \\] \u5bf9\u79f0\u4f20\u9012\u8bef\u5dee-\u5bf9\u79f0\u5316\u4ee3\u4ef7\u51fd\u6570 \\[ \\sum_id(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\\\ f: \\mathbf{h} \\to (H^{-1}\\mathbf{x}_1^\\prime, ..., H^{-1}\\mathbf{x}_n^\\prime, H\\mathbf{x}_1, ..., H\\mathbf{x}_n) \\] \u91cd\u6295\u5f71\u8bef\u5dee \uff1a\u53ef\u4ee5\u7528 \\(\\hat{\\mathbf{x}}_i\\) \u5750\u6807\u548c \\(\\hat{H}\\) \u77e9\u9635\u7684\u5143\u7d20\u2014\u2014\u603b\u5171 \\(2n+9\\) \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u3002 \u53c2\u6570\u77e2\u91cf \uff1a \\(\\mathbf{P}=(\\mathbf{h}, \\hat{\\mathbf{x}}_i, ..., \\hat{\\mathbf{x}}_n)\\) \u3002\u51fd\u6570 \\(f\\) \u5b9a\u4e49\u4e3a \\(f:\\mathbf{P}\\to (\\hat{\\mathbf{x}}_1, \\hat{\\mathbf{x}}_i^\\prime, ..., \\hat{\\mathbf{x}}_n, \\hat{\\mathbf{x}}_n^\\prime)\\) Sampson \u8fd1\u4f3c \uff1a\u91cd\u6295\u5f71\u8bef\u5dee\u7684 Sampson \u8fd1\u4f3c\u4f7f\u6295\u5f71\u8bef\u5dee\u4e5f\u80fd\u4ec5\u5bf9 9 \u4e2a\u53c2\u6570\u6700\u5c0f\u5316 \u521d\u59cb\u5316 \u00b6 \u53ef\u4ee5\u7528\u7ebf\u6027\u6280\u672f\u6216\u6700\u5c0f\u914d\u7f6e\u89e3\u6765\u6c42\u53c2\u6570\u5316\u7684\u521d\u59cb\u4f30\u8ba1\u3002\u8fd8\u91c7\u7528\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5728\u53c2\u6570\u7a7a\u95f4\u8fdb\u884c\u8db3\u591f\u5bc6\u7684\u91c7\u6837\uff0c\u4ece\u6bcf\u4e00\u4e2a\u91c7\u6837\u521d\u59cb\u70b9\u5f00\u59cb\u8fed\u4ee3\u5e76\u4fdd\u7559\u6700\u597d\u7684\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u6cd5\u4ec5\u5728\u53c2\u6570\u7a7a\u95f4\u7684\u7ef4\u6570\u8db3\u591f\u5c0f\u65f6\u624d\u53ef\u91c7\u7528 \u8fed\u4ee3\u65b9\u6cd5 \u00b6 \u5176\u4e2d\u6700\u5e38\u7528\u7684\u6709 Newton \u8fed\u4ee3\u548c Levenberg-Marquardt \u65b9\u6cd5\u3002Newton \u8fed\u4ee3\u662f\u6700\u5feb\u7684\uff0c\u4f46\u662f\u5b83\u9700\u8981\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u800c\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u80fd\u4f1a\u53d1\u6563\u3002Levenberg-Marquardt \u65b9\u6cd5\u662f\u4e00\u79cd\u66f4\u7a33\u5b9a\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u5b83\u7684\u6536\u655b\u901f\u5ea6\u6bd4 Newton \u8fed\u4ee3\u6162\u3002 \u7b97\u6cd5\u7684\u5b9e\u9a8c\u6bd4\u8f83 \u00b6 \u9c81\u68d2\u4f30\u8ba1 \u00b6 \u4e4b\u524d\u8ba8\u8bba\u7684\u5bf9\u5e94\u96c6\u7684\u552f\u4e00\u8bef\u5dee\u6e90\u6765\u81ea\u70b9\u7684\u4f4d\u7f6e\u6d4b\u91cf\uff0c\u5728\u8bb8\u591a\u5b9e\u9645\u8fd0\u884c\u4e2d\uff0c\u8fd8\u5b58\u5728\u7740\u70b9\u88ab\u9519\u914d\u7684\u60c5\u51b5\u3002\u9519\u914d\u70b9\u5bf9\u9ad8\u65af\u8bef\u5dee\u5206\u5e03\u800c\u8a00\u662f \u91ce\u503c \u3002 RANSAC \u00b6 \u7528 \u6a21\u578b \u53bb\u62df\u5408\u6570\u636e\uff0c \u968f\u673a\u6837\u672c \u5305\u542b\u8db3\u4ee5\u786e\u5b9a\u6a21\u578b\u7684\u6700\u5c0f\u6570\u636e\u96c6\u3002\u5982\u679c\u6a21\u578b\u662f\u5e73\u9762\u5355\u5e94\uff0c\u800c\u6570\u636e\u662f 2D \u70b9\u5bf9\u5e94\u96c6\uff0c\u90a3\u4e48\u6700\u5c0f\u5b50\u96c6\u5305\u542b\u56db\u7ec4\u5bf9\u5e94\u3002 \u7b97\u6cd5\u6d41\u7a0b \u968f\u673a\u5730\u4ece\u6570\u636e\u96c6 \\(S\\) \u4e2d\u9009\u62e9 \\(s\\) \u4e2a\u6570\u636e\u70b9\u7ec4\u6210\u7684\u4e00\u4e2a\u6837\u672c\u4f5c\u4e3a\u6a21\u578b\u7684\u4e00\u4e2a\u793a\u4f8b \u786e\u5b9a\u5728\u6a21\u578b\u8ddd\u79bb\u9608\u503c \\(t\\) \u5185\u7684\u6570\u636e\u70b9\u96c6 \\(S_i\\) \uff0c \\(S_i\\) \u79f0\u4e3a\u91c7\u6837\u7684\u4e00\u81f4\u96c6\u5e76\u5b9a\u4e49 \\(S_i\\) \u7684\u5185\u70b9 \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f(\u5185\u70b9\u7684\u6570\u76ee)\u5927\u4e8e\u67d0\u4e2a\u9608\u503c \\(T\\) \uff0c\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b\u5e76\u7ed3\u675f \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f\u5c0f\u4e8e \\(T\\) \uff0c\u9009\u62e9\u4e00\u4e2a\u65b0\u7684\u5b50\u96c6\u5e76\u91cd\u590d\u4e0a\u9762\u7684\u8fc7\u7a0b \u7ecf\u8fc7 \\(N\\) \u6b21\u8bd5\u9a8c\u9009\u62e9\u6700\u5927\u4e00\u81f4\u96c6 \\(S_i\\) \uff0c\u5e76\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b \u9c81\u68d2\u6700\u5927\u4f3c\u7136\u4f30\u8ba1 \u00b6 \u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570 \uff1a\u4e0d\u540c\u4e8e\u4ec5\u5728\u5185\u70b9\u4e0a\u6700\u5c0f\u5316 \\(\\mathcal{C}=\\sum_{i}d_{\\perp}^2\\) \uff0c\u53e6\u4e00\u79cd\u6539\u8fdb\u7684\u9c81\u68d2\u65b9\u6cd5\u662f\u5728\u6240\u6709\u6570\u636e\u4e0a\u6700\u5c0f\u5316\u3002\u4e00\u4e2a\u5408\u9002\u7684\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\u662f \\[ \\mathcal{D}=\\sum_i \\gamma(d_{\\perp})\u4e14\\gamma(e)= \\left\\{\\begin{matrix} e^2 & e^2 < t^2 & \u5185\u70b9 \\\\ t^2 & e^2 >= t^2 & \u91ce\u503c \\end{matrix}\\right. \\] \\(d_\\perp\\) \u662f\u70b9\u7684\u8bef\u5dee\uff0c \\(\\gamma(e)\\) \u662f\u4e00\u4e2a\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u4e2d\u7ed9\u91ce\u503c\u8d4b\u4e00\u4e2a\u56fa\u5b9a\u7684\u4ee3\u4ef7\u3002 \u5176\u4ed6\u9c81\u68d2\u7b97\u6cd5 \u00b6 \u6700\u5c0f\u4e2d\u503c\u5e73\u65b9(LMS)\u4f30\u8ba1 \uff1a\u2003\u6839\u636e\u6570\u636e\u4e2d\u6240\u6709\u70b9\u7684\u8ddd\u79bb\u4e2d\u503c\uff0c\u9009\u62e9\u5177\u6709\u6700\u5c0f\u4e2d\u503c\u7684\u6a21\u578b\u3002LMS \u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u4e0d\u9700\u8981\u9608\u503c\u6216\u8bef\u5dee\u65b9\u5dee\u7684\u5148\u9a8c\u77e5\u8bc6\u3002 LMS \u7684\u7f3a\u70b9\u662f\u5982\u679c\u591a\u4e8e\u4e00\u534a\u7684\u6570\u636e\u662f\u91ce\u503c\u90a3\u4e48\u5b83\u8981\u5931\u8d25\uff0c\u56e0\u4e3a\u8ddd\u79bb\u7684\u4e2d\u503c\u53ef\u80fd\u662f\u4e00\u4e2a\u91ce\u503c\u3002\u89e3\u51b3\u7684\u529e\u6cd5\u662f\u7528\u91ce\u503c\u7684\u6bd4\u4f8b\u6765\u786e\u5b9a\u6240\u9009\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u91ce\u503c\u7684\u6570\u91cf\u5c11\uff0c\u90a3\u4e48\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u9c81\u68d2\u65b9\u6cd5\uff1a \u5220\u70b9\u65b9\u6cd5 \u2003\u6bcf\u70b9\u8f6e\u6d41\u88ab\u5220\u9664\u800c\u7528\u6a21\u578b\u5bf9\u5269\u4e0b\u7684\u6570\u636e\u62df\u5408\u3002 \u52a0\u6743\u6700\u5c0f\u4e8c\u4e58\u65b9\u8fed\u4ee3 \u2003\u5176\u4e2d\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u62df\u5408\u7684\u5f71\u54cd\u4ee5\u5b83\u7684\u6b8b\u5dee\u6765\u53cd\u52a0\u6743\u3002 \u5355\u5e94\u7684\u81ea\u52a8\u8ba1\u7b97 \u00b6 \u8ba1\u7b97\u4e24\u5e45\u56fe\u50cf\u95f4\u7684\u5355\u5e94\u7684\u7b97\u6cd5\u3002 \u7b97\u6cd5\u7684\u8f93\u5165\u4ec5\u4ec5\u662f\u56fe\u50cf\uff0c\u4e0d\u9700\u8981\u5176\u4ed6 \u5148\u9a8c \u4fe1\u606f\uff1b\u800c\u8f93\u51fa\u7684\u662f\u5355\u5e94\u7684\u4f30\u8ba1\u4ee5\u53ca\u4e00\u7ec4\u5bf9\u5e94\u7684\u5174\u8da3\u70b9\u3002\u8be5\u7b97\u6cd5\u53ef\u4ee5\u5e94\u7528\u4e8e\u8bf8\u5982\u4e00\u5f20\u5e73\u5766\u8868\u9762\u7684\u4e24\u5e45\u56fe\u50cf\u6216\u7531\u6444\u50cf\u673a\u7ed5\u5176\u5149\u5fc3\u65cb\u8f6c\u7684\u5230\u7684\u4e24\u5e45\u56fe\u50cf\u3002 \u7b97\u6cd5\u6d41\u7a0b \u5174\u8da3\u70b9 \uff1a\u5728\u6bcf\u4e00\u5e45\u56fe\u50cf\u4e0a\u8ba1\u7b97\u5174\u8da3\u70b9 \u5047\u8bbe\u5bf9\u5e94 \uff1a\u6839\u636e\u5174\u8da3\u70b9\u7070\u5ea6\u9886\u57df\u7684\u63a5\u8fd1\u548c\u76f8\u4f3c\uff0c\u8ba1\u7b97\u5b83\u4eec\u7684\u5339\u914d\u96c6\u3002 RANSAC\u9c81\u68d2\u4f30\u8ba1 \uff1a\u91cd\u590d \\(N\\) \u6b21\u91c7\u6837\uff1a \u9009\u62e9\u7531\u56db\u7ec4\u5bf9\u5e94\u7ec4\u6210\u7684\u4e00\u4e2a\u968f\u673a\u6837\u672c\u5e76\u8ba1\u7b97\u5355\u5e94 H \u5bf9\u5047\u8bbe\u7684\u6bcf\u7ec4\u5355\u5e94\uff0c\u8ba1\u7b97\u8ddd\u79bb \\(d_{\\perp}\\) \u6839\u636e \\(d_\\perp < t = \\sqrt{5.99} \\delta\\) \u50cf\u7d20\u786e\u5b9a\u5bf9\u5e94\u6570\uff0c\u8fdb\u800c\u8ba1\u7b97\u4e0e H \u4e00\u81f4\u7684\u5185\u70b9\u6570 \u9009\u62e9\u5177\u6709\u6700\u5927\u5185\u70b9\u6570\u7684 H\uff0c\u5f53\u6570\u76ee\u76f8\u7b49\u65f6\u9009\u62e9\u5185\u70b9\u7684\u6807\u51c6\u65b9\u5dee\u6700\u4f4e\u7684 H \u6700\u4f18\u4f30\u8ba1 \uff1a\u7531\u5212\u5b9a\u7684\u5185\u70b9\u7684\u6240\u6709\u5bf9\u5e94\u91cd\u65b0\u4f30\u8ba1 H\uff0c\u7528 Levenberg-Marquardt \u7b97\u6cd5\u6765\u6700\u5c0f\u5316 ML \u4ee3\u4ef7\u51fd\u6570 \u5f15\u5bfc\u5339\u914d \uff1a\u7528\u4f30\u8ba1\u7684 H \u53bb\u5b9a\u4e49\u8f6c\u79fb\u70b9\u4f4d\u7f6e\u9644\u8fd1\u7684\u641c\u7d22\u533a\u57df\uff0c\u8fdb\u4e00\u6b65\u786e\u5b9a\u5174\u8da3\u70b9\u7684\u5bf9\u5e94\u3002 \u6700\u540e\u4e24\u6b65\u91cd\u590d\u5230\u5bf9\u5e94\u7684\u6570\u76ee\u7a33\u5b9a\u4e3a\u6b62","title":"\u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/est2d/#2d","text":"\u7ea6 6196 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 21 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u4f30\u8ba1\u95ee\u9898\uff0c\u4f30\u8ba1\u7684\u542b\u4e49\u662f\u6307\u5728\u67d0\u4e9b\u672c\u8d28\u6d4b\u91cf\u7684\u57fa\u7840\u4e0a\u8ba1\u7b97\u67d0\u4e2a\u53d8\u6362\u6216\u5176\u5b83\u6570\u5b66\u91cf\uff0c\u5e38\u89c1\u7684\u4f30\u8ba1\u95ee\u9898\u7684\u7c7b\u578b\u6709\uff1a 2D \u5355\u5e94 \uff1a\u7ed9\u5b9a \\(IP^2\\) \u4e2d\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u540c\u5728 \\(IP^2\\) \u4e2d\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u628a\u6bcf\u4e00\u70b9 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230\u5bf9\u5e94\u70b9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u5c04\u5f71\u53d8\u6362\u3002 3D \u5230 2D \u7684\u6444\u50cf\u673a\u6295\u5f71 \uff1a\u7ed9\u5b9a 3D \u7a7a\u95f4\u7684\u70b9\u96c6 \\(X_i\\) \u4ee5\u53ca\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u6c42\u628a \\(X_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i\\) \u7684 3D \u5230 2D \u7684\u5c04\u5f71\u6620\u5c04\u3002 \u57fa\u672c\u77e9\u9635\u7684\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u70b9\u96c6 \\(\\mathbf{x}_i\\) \uff0c\u548c\u53e6\u4e00\u5e45\u56fe\u50cf\u4e0a\u7684\u5bf9\u5e94\u70b9\u96c6 \\(\\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u4e0e\u8fd9\u4e9b\u5bf9\u5e94\u4e00\u76f4\u7684 \u57fa\u672c\u77e9\u9635 \\(F\\) \u3002 \u4e09\u7126\u70b9\u5f20\u91cf\u8ba1\u7b97 \uff1a\u7ed9\u5b9a\u8de8\u4e09\u5e45\u56fe\u50cf\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime \\leftrightarrow \\mathbf{x}_i^{\\prime \\prime}\\) \uff0c\u8ba1\u7b97\u4e09\u7126\u70b9\u5f20\u91cf\u3002 \u7814\u7a76\u4e24\u5e45\u56fe\u50cf\u4e4b\u95f4\u5bf9\u5e94\u70b9\u7684\u96c6\u5408 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \uff0c\u8ba1\u7b97\u5bf9\u6240\u6709\u7684 i \u90fd\u6ee1\u8db3 \\(H\\mathbf{x}_i=\\mathbf{x}_i^\\prime\\) \u7684\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635 H\uff1a \u6d4b\u91cf\u6570 \uff1a\u77e9\u9635 H \u6709 9 \u4e2a\u5143\u7d20\uff0c\u4f46\u4ec5\u786e\u5b9a\u5230\u76f8\u5dee\u4e00\u4e2a\u5c3a\u5ea6\u56e0\u5b50\u3002\u56e0\u6b64\uff0c2D \u5c04\u5f71\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u7684\u603b\u6570\u662f 8\u3002\u56e0\u4e3a\u4e00\u4e2a 2D \u70b9\u6709\u4e24\u4e2a\u81ea\u7531\u5ea6\uff0c\u6240\u4ee5\u4e3a\u4e86\u5b8c\u5168\u7ea6\u675f H\uff0c\u9700\u8981\u6307\u5b9a\u56db\u7ec4\u70b9\u5bf9\u5e94\u3002 \u8fd1\u4f3c\u89e3 \uff1a\u5982\u679c\u7ed9\u5b9a\u56db\u7ec4\u5bf9\u5e94\uff0c\u90a3\u4e48\u53ef\u4ee5\u5f97\u5230\u77e9\u9635 H \u7684\u7cbe\u786e\u89e3\u8fd9\u79cd\u89e3\u79f0\u4e3a \u6700\u5c0f\u914d\u7f6e\u89e3 \u3002\u5982\u679c\u7ed9\u5b9a\u591a\u4e8e\u56db\u7ec4\u7684\u5bf9\u5e94\uff0c\u90a3\u4e48\u8fd9\u4e9b\u5bf9\u5e94\u53ef\u80fd\u4e0d\u4e0e\u4efb\u4f55\u5c04\u5f71\u53d8\u6362\u5b8c\u5168\u76f8\u5bb9\uff0c\u56e0\u800c\u6211\u4eec\u9762\u4e34\u7684\u4efb\u52a1\u662f\u6309\u7ed9\u5b9a\u7684\u6570\u636e\u786e\u5b9a\u201c\u6700\u597d\u201d\u7684\u53d8\u6362\u3002\u901a\u5e38\u8fd9\u4e2a\u4efb\u52a1\u662f\u901a\u8fc7\u5bfb\u627e\u6700\u5c0f\u5316\u67d0\u4e2a\u4ee3\u4ef7\u51fd\u6570\u7684\u53d8\u6362 H \u6765\u5b8c\u6210\u3002 \u9ec4\u91d1\u6807\u51c6\u7b97\u6cd5 \uff1a\u901a\u5e38\u5b58\u5728\u4e00\u79cd\u6700\u4f18\u7684\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u6700\u4f18\u7684\u542b\u4e49\u662f\u5728\u4e00\u5b9a\u5047\u8bbe\u4e0b\uff0c\u4f7f\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684 H \u662f\u53d8\u6362\u7684\u6700\u597d\u4f30\u8ba1\u3002\u8ba1\u7b97\u8be5\u4ee3\u4ef7\u51fd\u6570\u6700\u5c0f\u503c\u7684\u7b97\u6cd5\u79f0\u4e3a\u201c\u9ec4\u91d1\u6807\u51c6\u201d\u7b97\u6cd5\u3002","title":"\u4f30\u8ba1\u2014\u20142D \u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/est2d/#dlt","text":"\u9996\u5148\u8ba8\u8bba\u7531\u7ed9\u5b9a 2D \u5230 2D\u7684\u56db\u7ec4\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u786e\u5b9a H \u7684\u4e00\u79cd\u7b80\u5355\u7684\u7ebf\u6027\u7b97\u6cd5\uff0c\u53d8\u6362\u7531 \\(\\mathbf{x}_i^\\prime = H\\mathbf{x}_i\\) \u7ed9\u51fa\u3002\u4f46\u56e0\u4e3a\u8fd9\u662f\u4e00\u4e2a\u9f50\u6b21\u77e2\u91cf\u65b9\u7a0b\uff0c\u56e0\u6b64 3 \u7ef4\u77e2\u91cf \\(\\mathbf{x}_i^\\prime\\) \u548c \\(H\\mathbf{x}_i\\) \u4e0d\u76f8\u7b49\u3002\u53ef\u4ee5\u7528\u77e2\u91cf\u53c9\u4e58\uff1a \\(\\mathbf{x}_i^\\prime \\times H\\mathbf{x}_i=\\mathbf{0}\\) \u8868\u793a\u3002 \u5982\u679c\u5c06\u77e9\u9635 H \u7684\u7b2c j \u884c\u8bb0\u4e3a \\(h^{j\\top},\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \uff0c\u5219 \\(\\mathbf{x}_i^\\prime \\times H \\mathbf{x}_i=0\\) \u53ef\u4ee5\u8f6c\u6362\u6210\uff1a \\[ \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime\\mathbf{x}_i^\\top \\\\ -y_i^\\prime \\mathbf{x}_i^\\top & x_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top \\end{bmatrix} \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} =\\mathbf{0} \\] h \u662f\u7531\u77e9\u9635 H \u7684\u5143\u7d20\u7ec4\u6210\u7684 0 \u7ef4\u77e2\u91cf\uff1a \\[ \\mathbf{h}= \\begin{bmatrix} \\mathbf{h}^1 \\\\ \\mathbf{h}^2 \\\\ \\mathbf{h}^3 \\end{bmatrix} , \\ \\ \\ H= \\begin{bmatrix} h_1 & h_2 & h_3 \\\\ h_4 & h_5 & h_6 \\\\ h_7 & h_8 & h_9 \\end{bmatrix} \\] \\(A_i\\mathbf{h}=\\mathbf{0}\\) \u662f\u672a\u77e5\u77e2\u91cf \\(\\mathbf{h}\\) \u7684\u7ebf\u6027\u65b9\u7a0b\uff0c\u77e9\u9635 \\(A_i\\) \u7684\u5143\u7d20\u662f\u5df2\u77e5\u70b9\u7684\u5750\u6807\u7684\u4e8c\u6b21\u591a\u9879\u5f0f\u3002 \u867d\u7136\u5f0f\u4e2d\u6709\u4e09\u4e2a\u65b9\u7a0b\uff0c\u4f46\u4ec5\u6709\u4e24\u4e2a\u662f\u7ebf\u6027\u72ec\u7acb\u7684\u3002\u5728\u89e3 H \u65f6\u5e38\u7701\u53bb\u7b2c\u4e09\u4e2a\u7b49\u5f0f\u3002 \u8be5\u65b9\u7a0b\u7ec4\u5bf9 \\(\\mathbf{x}_i^\\prime\\) \u7684\u4efb\u4f55\u9f50\u6b21\u5750\u6807 \\((x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u6210\u7acb\u3002 \u6c42\u89e3 H \uff1a\u6bcf\u7ec4\u70b9\u5bf9\u5e94\u7ed9\u51fa\u5173\u4e8e H \u5143\u7d20\u7684\u4e24\u4e2a\u72ec\u7acb\u7684\u65b9\u7a0b\u3002\u7ed9\u5b9a\u56db\u7ec4\u8fd9\u6837\u7684\u70b9\u5bf9\u5e94\uff0c\u4fbf\u83b7\u5f97\u65b9\u7a0b\u7ec4 \\(A\\mathbf{h}=\\mathbf{0}\\) \u3002","title":"\u76f4\u63a5\u7ebf\u6027\u53d8\u6362\uff08DLT\uff09\u7b97\u6cd5"},{"location":"cv/mvg/est2d/#_1","text":"\u5982\u679c\u7ed9\u51fa\u7684\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u591a\u4f59\u56db\u7ec4\uff0c\u65b9\u7a0b \\(A\\mathbf{h}=\\mathbf{0}\\) \u662f\u8d85\u5b9a\u7684\u3002 \u5982\u679c\u70b9\u7684\u4f4d\u7f6e\u662f\u7cbe\u786e\u7684\uff0c\u90a3\u4e48 \\(A\\) \u7684\u79e9\u4ecd\u7136\u4e3a 8 \u5e76\u6709\u4e00\u7ef4\u96f6\u7a7a\u95f4\uff0c\u5e76\u4e14\u5b58\u5728\u7cbe\u786e\u89e3 \\(\\mathbf{h}\\) \u3002 \u5982\u679c\u56fe\u50cf\u5750\u6807\u7684\u6d4b\u91cf\u65f6\u4e0d\u7cbe\u786e\u7684\uff0c\u65b9\u7a0b\u7ec4\u5c06\u4e0d\u5b58\u5728\u7cbe\u786e\u89e3\u3002\u6240\u4ee5\u9700\u8981\u4e00\u4e2a\u9002\u5f53\u7684\u4ee3\u4ef7\u51fd\u6570\u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\mathbf{h}\\) \uff0c\u901a\u5e38\u9644\u52a0\u8303\u6570\u6761\u4ef6\uff0c\u65e2\u7136\u4e0d\u5b58\u5728 \\(A\\mathbf{h}=\\mathbf{0}\\) \u7684\u7cbe\u786e\u89e3\uff0c\u5f88\u81ea\u7136\u4f1a\u5728\u901a\u5e38\u7ea6\u675f \\(\\parallel \\mathbf{h} \\parallel = 1\\) \u4e0b\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002\u8fd9\u7b49\u4ef7\u4e8e\u6c42\u5546 \\(\\parallel A \\mathbf{h} \\parallel / \\parallel \\mathbf{h} \\parallel\\) \u7684\u6700\u5c0f\u503c\u95ee\u9898\u3002\u8be5\u89e3\u662f \\(A^\\top A\\) \u7684\u6700\u5c0f\u7279\u5f81\u503c\u7684\uff08\u5355\u4f4d\uff09\u7279\u5f81\u77e2\u91cf\u3002\u7531\u6b64\u6240\u5f97\u5230\u7684\u7b97\u6cd5\u79f0\u4e3a \u57fa\u672cDLT\u7b97\u6cd5 \u3002","title":"\u8d85\u5b9a\u89e3"},{"location":"cv/mvg/est2d/#_2","text":"\u628a\u7b49\u5f0f\u8f6c\u6210\u975e\u9f50\u6b21\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u5373\u7ed9\u77e2\u91cf \\(\\mathbf{h}\\) \u4e2d\u7684\u67d0\u4e2a\u5143\u7d20\u5f3a\u52a0\u4e0a \\(h_j=1\\) \u7684\u6761\u4ef6\uff1a \\[ \\begin{bmatrix} 0 & 0 & 0 & -x_iw_i^\\top & -y_iw_i^\\top & -w_iw_i^\\top & x_iy_i^\\top & y_iy_i^\\top \\\\ x_iw_i^\\top & y_iw_i^\\top & w_iw_i^\\top & 0 & 0 & 0 & -x_ix_i^\\top & -y_ix_i^\\top \\\\ \\end{bmatrix} \\bar{\\mathbf{h}}= \\begin{bmatrix} -w_iy_i^\\top \\\\ -w_ix_i^\\top \\end{bmatrix} \\] \u5176\u4e2d \\(\\bar{\\mathbf{h}}\\) \u662f\u7531 \\(\\mathbf{h}\\) \u7684\u524d\u516b\u4e2a\u5143\u7d20\u7ec4\u6210\u7684 8 \u7ef4\u77e2\u91cf\u3002 \u4f46\u662f\uff0c\u5982\u679c\u4e8b\u5b9e\u4e0a\u771f\u6b63\u7684\u89e3\u662f \\(h_j=0\\) \uff0c\u90a3\u4e48\u4e0d\u5b58\u5728\u4e00\u56e0\u5b50 \\(k\\) \u4f7f\u5f97 \\(kh_j=1\\) \uff0c\u8868\u793a\u4ee4 \\(h_j=1\\) \u5f97\u4e0d\u5230\u771f\u89e3\u3002","title":"\u975e\u9f50\u6b21\u89e3"},{"location":"cv/mvg/est2d/#_3","text":"\u5982\u679c \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u90a3\u4e48 \\(H^*=\\mathbf{x}_4^\\top\\mathbf{I}^\\top\\) \u662f\u4e00\u4e2a\u89e3 \\(H^*\\) \u662f\u552f\u4e00\u89e3\uff08\u76f8\u5dee\u4e00\u5c3a\u5ea6\u56e0\u5b50\uff09\uff0c\u56e0\u4e3a \\(H^*\\) \u662f\u5947\u5f02\u77e9\u9635\uff0c\u4e0d\u5b58\u5728\u628a\u6bcf\u4e2a \\(\\mathbf{x}_i\\) \u53d8\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u3002\u5f53 \\(\\mathbf{x}_1, \\mathbf{x}_2, \\mathbf{x}_3\\) \u5171\u7ebf\uff0c\u800c \\(\\mathbf{x}_1^\\prime, \\mathbf{x}_2^\\prime, \\mathbf{x}_3^\\prime\\) \u4e0d\u5171\u7ebf\u65f6\u5c31\u4f1a\u4ea7\u751f\u8fd9\u79cd\u60c5\u51b5 \u5b58\u5728\u53e6\u5916\u4e00\u4e2a\u89e3 \\(H\\) \uff1a\u4ece\u800c\u4efb\u4f55\u5f62\u5982 \\(\\alpha H^*+\\beta H\\) \u7684\u77e9\u9635\u90fd\u662f\u89e3\uff0c\u56e0\u6b64\u6709\u4e00\u4e2a 2 \u53c2\u6570\u7684\u53d8\u6362\u7c07\u5b58\u5728\uff0c\u8fdb\u800c\u63a8\u51fa\u7ed9\u51fa\u7684 8 \u4e2a\u65b9\u7a0b\u4e0d\u662f\u72ec\u7acb\u7684 \u51fa\u73b0\u67d0\u79cd\u914d\u7f6e\u4e0d\u80fd\u786e\u5b9a\u552f\u4e00\u89e3\u7684\u60c5\u5f62\u79f0\u4e3a \u9000\u5316 \u3002 \u9000\u5316\u7684\u5b9a\u4e49\u65e2\u6d89\u53ca\u914d\u7f6e\u4e5f\u6d89\u53ca\u53d8\u6362\u7c7b\u578b\uff0c\u800c\u4e14\u9000\u5316\u95ee\u9898\u4e0d\u4ec5\u9650\u4e8e\u6700\u5c0f\u914d\u7f6e\u89e3\u3002\u5982\u679c\u591a\u51fa\u6765\u7684\uff08\u7cbe\u786e\u7684\uff0c\u5373\u65e0\u8bef\u5dee\u7684\uff09\u70b9\u5bf9\u5e94\u4e5f\u5171\u7ebf\uff0c\u90a3\u4e48\u9000\u5316\u95ee\u9898\u4ecd\u6ca1\u6709\u89e3\u51b3\u3002","title":"\u9000\u5316\u914d\u7f6e"},{"location":"cv/mvg/est2d/#_4","text":"\u524d\u9762\u53ea\u8ba8\u8bba\u7531\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u5355\u5e94\uff0c\u7136\u800c\u7ebf\u5bf9\u5e94\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5e94\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u5355\u5e94\uff0c\u6240\u4ee5\u5c31\u4ea7\u751f\u8ba1\u7b97\u4e00\u4e2a\u5355\u5e94\uff08\u6216\u4efb\u4f55\u5176\u4ed6\u5173\u7cfb\uff09\u9700\u8981\u591a\u5c11\u7ec4\u5bf9\u5e94\u7684\u95ee\u9898\u3002\u4e00\u822c\u7684\u539f\u5219\u662f\u7ea6\u675f\u6570\u5fc5\u987b\u7b49\u4e8e\u6216\u5927\u4e8e\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002 \u91c7\u7528\u6df7\u5408\u7c7b\u578b\u7684\u5bf9\u5e94\u6765\u8ba1\u7b97 H \u65f6\u5fc5\u987b\u8c28\u614e\uff0c\u4f8b\u5982\u4e00\u4e2a 2D \u5355\u5e94\u4e0d\u80fd\u7531\u4e24\u7ec4\u70b9\u5bf9\u5e94\u548c\u4e24\u7ec4\u7ebf\u5bf9\u5e94\u552f\u4e00\u786e\u5b9a\uff0c\u4f46\u80fd\u7531\u4e09\u7ea7\u70b9\u548c\u4e00\u7ec4\u7ebf\u6216\u4e00\u7ec4\u70b9\u548c\u4e09\u7ec4\u7ebf\u6765\u552f\u4e00\u786e\u5b9a\uff0c\u5373\u4f7f\u6bcf\u79cd\u914d\u7f6e\u90fd\u6709 8 \u4e2a\u81ea\u7531\u5ea6\u4e5f\u662f\u5982\u6b64\u3002","title":"\u7531\u7ebf\u548c\u5176\u4ed6\u5b9e\u4f53\u6c42\u89e3"},{"location":"cv/mvg/est2d/#_5","text":"\u4e3a\u786e\u5b9a H \u7684\u8d85\u5b9a\u89e3\u800c\u9700\u6700\u5c0f\u5316\u7684\u82e5\u5e72\u4ee3\u4ef7\u51fd\u6570","title":"\u4e0d\u540c\u7684\u4ee3\u4ef7\u51fd\u6570"},{"location":"cv/mvg/est2d/#_6","text":"DLT \u7b97\u6cd5\u6700\u5c0f\u5316\u8303\u6570 \\(\\parallel A \\mathbf{h} \\parallel\\) \u3002 \u77e2\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u79f0\u4e3a\u6b8b\u5dee\u77e2\u91cf\uff0c\u5e76\u4e14\u8981\u6700\u5c0f\u5316\u7684\u6b63\u662f\u8be5\u8bef\u5dee\u77e2\u91cf\u7684\u8303\u6570\u3002 \u77e2\u91cf \\(\\varepsilon_i\\) \u88ab\u79f0\u4e3a\u5173\u8054\u4e8e\u70b9\u5bf9\u5e94 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u548c\u5355\u5e94 H \u7684 \u4ee3\u6570\u8bef\u5dee\u77e2\u91cf \uff0c\u8be5\u77e2\u91cf\u7684\u8303\u6570\u662f\u4e00\u4e2a\u6807\u91cf\uff0c\u79f0\u4e3a \u4ee3\u6570\u8ddd\u79bb \uff1a \\[ d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\parallel \\varepsilon_i \\parallel= \\parallel \\begin{bmatrix} \\mathbf{0}^\\top & -w_i^\\prime\\mathbf{x}_i^\\top & y_i^\\prime \\mathbf{x}_i^\\top \\\\ w_i^\\prime\\mathbf{x}_i^\\top & \\mathbf{0}^\\top & -x_i^\\prime \\mathbf{x}_i^\\top \\end{bmatrix} \\mathbf{h} \\parallel^2 \\] \u5bf9\u4e8e\u4efb\u4f55\u4e24\u4e2a\u77e2\u91cf \\(\\mathbf{x}_1\\) \u548c \\(\\mathbf{x}_2\\) \uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_1, \\mathbf{x}_2)^2=a_1^2+a_2^2 \\ \\ \u5176\u4e2d\\mathbf{a}=(a_1,a_2,a_3)^\\top=\\mathbf{x}_1 \\times \\mathbf{x}_2 \\] \u7ed9\u5b9a\u5bf9\u5e94\u7684\u96c6\u5408\uff0c\u91cf \\(\\varepsilon=A\\mathbf{h}\\) \u662f\u6574\u4e2a\u96c6\u5408\u7684\u4ee3\u6570\u8bef\u5dee\u77e2\u91cf\uff0c\u7531\u6b64\u53ef\u89c1\uff1a \\[ \\sum_{i}d_{alg}(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2= \\sum_{i} \\parallel \\varepsilon_i \\parallel^2= \\parallel A\\mathbf{h} \\parallel^2= \\parallel \\varepsilon \\parallel^2 \\] \u7f3a\u70b9\u662f\u88ab\u6700\u5c0f\u5316\u7684\u91cf\u6ca1\u6709\u51e0\u4f55\u6216\u7edf\u8ba1\u4e0a\u7684\u610f\u4e49\u3002","title":"\u4ee3\u6570\u8ddd\u79bb"},{"location":"cv/mvg/est2d/#_7","text":"","title":"\u51e0\u4f55\u8ddd\u79bb"},{"location":"cv/mvg/est2d/#_8","text":"\u77e2\u91cf \\(\\mathbf{x}\\) \u8868\u793a \u6d4b\u91cf \u7684\u56fe\u50cf\u5750\u6807\uff1b \\(\\hat{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u4f30\u8ba1\u503c\u800c \\(\\bar{\\mathbf{x}}\\) \u8868\u793a\u8be5\u70b9\u7684\u771f\u503c\u3002","title":"\u8bb0\u53f7"},{"location":"cv/mvg/est2d/#_9","text":"\u9996\u5148\u8003\u8651\u7b2c\u4e00\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u975e\u5e38\u7cbe\u786e\u800c\u8bef\u5dee\u4ec5\u51fa\u73b0\u5728\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u60c5\u5f62\u3002\u9002\u5b9c\u6700\u5c0f\u5316\u7684\u91cf\u662f \u8f6c\u79fb\u8bef\u5dee \u3002\u5b83\u662f\u7b2c\u4e8c\u5e45\u56fe\u50cf\u4e0a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}^\\prime\\) \u4e0e\u70b9 \\(H\\bar{\\mathbf{x}}\\) \u4e4b\u95f4\u7684 \u6b27\u6c0f\u8ddd\u79bb \u3002\u7528\u8bb0\u53f7 \\(d(\\mathbf{x}, \\mathbf{y})\\) \u8868\u793a\u975e\u9f50\u6b21\u70b9 \\(\\mathbf{x}\\) \u548c \\(\\mathbf{y}\\) \u4e4b\u95f4\u7684\u6b27\u6c0f\u8ddd\u79bb\u3002\u5bf9\u5e94\u96c6\u5408\u7684\u8f6c\u79fb\u8bef\u5dee\u662f\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}_i})^2 \\]","title":"\u5355\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/est2d/#_10","text":"\u66f4\u5207\u5408\u5b9e\u9645\u7684\u60c5\u5f62\u662f\u56fe\u50cf\u6d4b\u91cf\u8bef\u5dee\u5728\u4e24\u5e45\u56fe\u50cf\u4e2d\u90fd\u53d1\u751f\uff0c\u4ece\u800c\u5e94\u8be5\u6700\u5c0f\u5316\u4e24\u5e45\u800c\u4e0d\u4ec5\u662f\u4e00\u5e45\u56fe\u50cf\u7684\u8bef\u5dee\uff1a \\[ \\sum_{i} d(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\]","title":"\u5bf9\u79f0\u8f6c\u79fb\u8bef\u5dee"},{"location":"cv/mvg/est2d/#_11","text":"\u5bf9\u6bcf\u5e45\u56fe\u50cf\u8bef\u5dee\u4f5c\u91cf\u5316\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u4f30\u8ba1\u6bcf\u7ec4\u5bf9\u5e94\u7684\u201c\u6821\u6b63\u503c\u201d\u3002\u4e3a\u4e86\u5f97\u5230\u5b8c\u5168\u7684\u5339\u914d\u70b9\u96c6\u6709\u5fc5\u8981\u5728\u4e00\u5e45\u56fe\u50cf\uff08\u7b2c\u4e8c\u5e45\u56fe\u50cf\uff09\u4e0a\u5bf9\u6d4b\u91cf\u8fdb\u884c\u6821\u6b63\u3002 \u5355\u5e94 \\(\\hat{H}\\) \u548c\u5b8c\u5168\u5339\u914d\u7684\u70b9\u5bf9 \\(\\hat{\\mathbf{x}_i}\\) \u548c \\(\\hat{\\mathbf{x}_i}^\\prime\\) \u4ee5\u6700\u5c0f\u5316\u603b\u7684\u8bef\u5dee\u51fd\u6570: \\[ \\sum_{i} d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2 \\ \\ \\ s.t \\ \\ \\ \\hat{\\mathbf{x}_i}^\\prime=\\hat{H}\\hat{\\mathbf{x}_i} \\ \\ \\ \\forall i. \\] \u5148\u7531 \\(\\mathbf{x}_i \\leftrightarrow \\mathbf{x}_i^\\prime\\) \u4f30\u8ba1\u4e16\u754c\u5e73\u9762\u7684\u70b9 \\(\\hat{\\mathbf{X}_i}\\) \uff0c\u7136\u540e\u628a\u5b83\u91cd\u6295\u5f71\u5230\u4f30\u8ba1\u4e0a\u8ba4\u4e3a\u662f\u5b8c\u5168\u5339\u914d\u7684\u5bf9\u5e94 \\(\\hat{\\mathbf{x}_i} \\leftrightarrow \\hat{\\mathbf{x}_i}^\\prime\\)","title":"\u91cd\u6295\u5f71\u8bef\u5dee\u2014\u2014\u4e24\u5e45\u56fe\u50cf"},{"location":"cv/mvg/est2d/#_12","text":"\u4ee4 \\(\\mathbf{x}_i^\\prime=(x_i^\\prime, y_i^\\prime, w_i^\\prime)^\\top\\) \u5e76\u5b9a\u4e49\u77e2\u91cf \\((\\hat{x_i}^\\prime, \\hat{y_i}^\\prime, \\hat{w_i}^\\prime)^\\top=\\hat{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}}\\) \uff0c\u5219 \\[ d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2= d_{alg}(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2/\\hat{w_i}^\\prime w_i^\\prime \\] \u51e0\u4f55\u8ddd\u79bb\u4e0e\u4ee3\u6570\u8ddd\u79bb\u76f8\u5173\uff0c\u4f46\u4e0d\u76f8\u7b49\u3002\u53ea\u6709\u5f53 \\(\\hat{w_i}^\\prime=w_i^\\prime=1\\) \u4e24\u4e2a\u8ddd\u79bb\u76f8\u7b49\u3002\u56e0\u6b64\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8ddd\u79bb\u548c\u4ee3\u6570\u8ddd\u79bb\u76f8\u7b49\u3002\u5bf9\u4e8e\u4eff\u5c04\u53d8\u6362\uff0c\u6700\u5c0f\u5316\u51e0\u4f55\u8ddd\u79bb\u53ef\u4ee5\u7528\u57fa\u4e8e\u4ee3\u6570\u8ddd\u79bb\u7684\u7ebf\u6027 DLT \u7b97\u6cd5\u3002","title":"\u51e0\u4f55\u548c\u4ee3\u6570\u8ddd\u79bb\u7684\u6bd4\u8f83"},{"location":"cv/mvg/est2d/#_13","text":"\u4e24\u5e73\u9762\u4e4b\u95f4\u7684\u5355\u5e94\u4f30\u8ba1\u53ef\u4ee5\u89c6\u4e3a\u7528 4D \u7a7a\u95f4 \\(IR^4\\) \u4e2d\u7684\u201c\u66f2\u9762\u201d\u6765\u62df\u5408\u70b9\u3002 \u6bcf\u5bf9\u56fe\u50cf\u70b9 \\(\\mathbf{x}, \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6d4b\u91cf\u7a7a\u95f4 \\(IR^4\\) \u7684\u4e00\u4e2a\u70b9\uff0c\u8bb0\u4f5c \\(\\mathbf{X}\\) \u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u6ee1\u8db3 \\(\\mathbf{x} \\times \\mathbf{x}^\\prime=\\mathbf{0}\\) \u7684\u56fe\u50cf\u5bf9\u5e94 \\(\\mathbf{x} \\leftrightarrow \\mathbf{x}^\\prime\\) \u5b9a\u4e49\u6765 \\(IR^4\\) \u4e2d\u7684\u4e00\u4e2a\u4ee3\u6570\u7c07 \\(\\upsilon_H\\) \uff0c\u5b83\u662f\u4e24\u4e2a\u8d85\u4e8c\u6b21\u66f2\u9762\u7684\u4ea4\u96c6\u3002 \\[ d(\\mathbf{x}_i, \\hat{\\mathbf{x}_i})^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}_i}^\\prime)^2=d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2 \\] \u5176\u4e2d \\(d_\\perp(\\mathbf{X}_i, \\upsilon_H)^2\\) \u662f\u70b9 \\(\\mathbf{X}\\) \u5230\u7c07 \\(\\upsilon_H\\) \u7684\u5782\u76f4\u8ddd\u79bb\u3002","title":"\u91cd\u6295\u5f71\u8bef\u5dee\u7684\u51e0\u4f55\u89e3\u91ca"},{"location":"cv/mvg/est2d/#sampson","text":"Sampson \u8bef\u5dee\u5176\u590d\u6742\u6027\u4ecb\u4e8e\u4ee3\u6570\u548c\u51e0\u4f55\u4ee3\u4ef7\u51fd\u6570\u4e4b\u95f4\uff0c\u4f46\u975e\u5e38\u8fd1\u4f3c\u4e8e\u51e0\u4f55\u8bef\u5dee\u3002 \u5bf9\u7ed9\u5b9a\u7684\u5355\u5e94 H\uff0c\u5728 \\(\\upsilon_H\\) \u4e0a\u7684\u4efb\u4f55\u70b9 \\(\\mathbf{X}=(x,y,x^\\prime, y^\\prime)^\\top\\) \uff0c\u4ee3\u4ef7\u51fd\u6570\u7528 \\(\\mathcal{C}_H(\\mathbf{X})=\\mathbf{0}\\) \u3002\u7528\u4e0b\u5217 Taylor \u5c55\u5f00\u5f0f\u6765\u4e00\u9636\u903c\u8fd1\uff1a \\[ \\mathcal{C}_H(\\mathbf{X}+\\delta_x)=\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x \\] \u8bb0 \\(\\delta_x = \\hat{\\mathbf{X}}-\\mathbf{X}\\) \u5e0c\u671b \\(\\hat{\\mathbf{X}}\\) \u5728 \\(\\upsilon_H\\) \u4e0a\uff0c\u5373 \\(\\mathcal{C}_H(\\hat{\\mathbf{X}})=\\mathbf{0}\\) \uff0c\u56e0\u6b64 \\(\\mathcal{C}_H(\\mathbf{X})+\\frac{\\partial \\mathcal{C}_H}{\\partial \\mathbf{X}} \\delta_x=\\mathbf{0}\\) \u3002\u8bb0\u6210 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \uff0c\u5176\u4e2d \\(\\mathbf{J}\\) \u662f\u504f\u5bfc\u6570\u77e9\u9635\uff0c \\(\\varepsilon\\) \u4e0e \\(\\mathbf{X}\\) \u76f8\u5173\u7684\u4ee3\u4ef7\u51fd\u6570 \\(\\mathcal{C}_H(\\mathbf{X})\\) \uff0c \u6700\u5c0f\u5316\u95ee\u9898 \u662f\u6c42\u6ee1\u8db3\u6b64\u65b9\u7a0b\u7684\u6700\u5c0f \\(\\delta_x\\) \u3002 \u5373 \u6c42\u5728\u6ee1\u8db3 \\(\\mathbf{J}\\delta_x=-\\varepsilon\\) \u6761\u4ef6\u4e0b\u4f7f \\(\\parallel \\delta_x \\parallel\\) \u53d6\u6700\u5c0f\u503c\u7684\u77e2\u91cf \\(\\delta_x\\) \u4f7f\u7528 Lagrange \u4e58\u5b50\u6cd5\uff0c\u6c42\u7684\u8303\u6570 \\(\\parallel \\delta \\parallel^2\\) \u662f Sampson \u8bef\u5dee\uff1a \\[ \\parallel \\delta_x \\parallel^2= \\delta_x^\\top\\delta_x= \\varepsilon^\\top(\\mathbf{J}\\mathbf{J}^\\top)^{-1}\\varepsilon \\]","title":"Sampson \u8bef\u5dee"},{"location":"cv/mvg/est2d/#_14","text":"\u5047\u5b9a\u5728\u6ca1\u6709\u6d4b\u91cf\u8bef\u5dee\u65f6\uff0c\u771f\u5b9e\u7684\u70b9\u51c6\u786e\u6ee1\u8db3\u4e00\u4e2a\u5355\u5e94\u53d8\u6362\uff0c\u5373 \\(\\bar{\\mathbf{x}_i}^\\prime=H\\bar{\\mathbf{x}_i}\\) \u3002 \u5047\u5b9a\u6bcf\u4e00\u5e45\u56fe\u50cf\u5750\u6807\u90fd\u5177\u6709\u96f6\u5747\u503c\u548c\u7edf\u4e00\u7684\u6807\u51c6\u5dee \\(\\sigma\\) \u7684\u9ad8\u65af\u566a\u58f0\u3002\u8fd9\u610f\u5473\u7740 \\(x=\\bar{x}+\\Delta x\\) \uff0c\u5176\u4e2d \\(\\Delta x\\) \u670d\u4ece\u65b9\u5dee\u4e3a \\(\\sigma^2\\) \u7684\u9ad8\u65af\u5206\u5e03\u3002\u8fdb\u4e00\u6b65\u5047\u8bbe\u6bcf\u6b21\u6d4b\u91cf\u7684\u566a\u58f0\u662f\u76f8\u5728\u72ec\u7acb\u7684\uff0c\u90a3\u4e48\uff0c\u82e5\u70b9\u7684\u771f\u503c\u662f \\(\\bar{\\mathbf{x}}\\) \uff0c\u5219\u6bcf\u4e2a\u6d4b\u91cf\u70b9 \\(\\mathbf{x}\\) \u7684\u6982\u7387\u5bc6\u5ea6\u51fd\u6570(pdf)\u662f\uff1a \\[ \\Pr(\\mathbf{x})=(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x},\\bar{\\mathbf{x}})^2/(2\\sigma^2)} \\]","title":"\u7edf\u8ba1\u4ee3\u4ef7\u51fd\u6570\u548c\u6700\u5927\u4f3c\u7136\u4f30\u8ba1"},{"location":"cv/mvg/est2d/#_15","text":"\u5047\u5b9a\u6bcf\u70b9\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\uff0c\u70b9\u5bf9\u5e94 \\(\\{\\bar{\\mathbf{x}_i} \\leftrightarrow \\mathbf{x}_i^\\prime\\}\\) \u7684\u6982\u7387\u5c31\u662f\u5b83\u4eec\u5355\u4e2a pdf \u7684\u4e58\u79ef\uff1a \\[ \\Pr(\\{\\mathbf{x}_i^\\prime | H\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2/(2\\sigma^2)} \\] \u8be5\u5bf9\u5e94\u96c6\u5408\u7684 \u5bf9\u6570\u4f3c\u7136 \u4e3a\uff1a \\[ \\log \\Pr(\\mathbf{x}_i^\\prime | H)=-\\frac{1}{2\\sigma^2}\\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2+\u5e38\u6570 \\] \u5355\u5e94\u7684 \u6700\u5927\u4f3c\u7136 ML \u4f30\u8ba1 \\(\\hat{H}\\) \u6700\u5927\u5316\u8fd9\u4e2a\u5bf9\u6570\u4f3c\u7136\uff0c\u5373\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i^\\prime, H \\bar{\\mathbf{x}}_i)^2 \\] \u56e0\u6b64\uff0cML \u4f30\u8ba1\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u51fd\u6570","title":"\u5355\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/est2d/#_16","text":"\u5982\u679c\u771f\u5b9e\u5bf9\u5e94\u662f \\(\\{\\bar{\\mathbf{x}}_i \\leftrightarrow H \\bar{\\mathbf{x}}_i=\\bar{\\mathbf{x}}_i^\\prime\\}\\) \uff0c\u53d7\u566a\u58f0\u5e72\u6270\u7684\u6570\u636e\u7684 pdf \u662f\uff1a \\[ \\Pr(\\{\\mathbf{x}_i, \\mathbf{x}_i^\\prime\\} | H, \\{\\bar{\\mathbf{x}}_i\\}) = \\prod_{i}(\\frac{1}{2\\pi\\sigma^2})e^{-(d(\\mathbf{x}_i, \\bar{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, H\\bar{\\mathbf{x}}_i)^2)/(2\\sigma^2)} \\] ML \u4f30\u8ba1\u5c31\u662f\u6c42\u6700\u5c0f\u5316\uff1a \\[ \\sum_{i}d(\\mathbf{x}_i, \\hat{\\mathbf{x}}_i)^2+d(\\mathbf{x}_i^\\prime, \\hat{\\mathbf{x}}_i^\\prime)^2 \\] ML \u4f30\u8ba1\u7b49\u540c\u4e8e\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u51fd\u6570","title":"\u53cc\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/est2d/#mahalanobis","text":"\u4e00\u822c\u9ad8\u65af\u5206\u5e03\u7684\u60c5\u5f62\uff0c\u53ef\u4ee5\u5047\u5b9a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6ee1\u8db3\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u9ad8\u65af\u5206\u5e03\u51fd\u6570\u3002\u6700\u5927\u5316\u5bf9\u6570\u4f3c\u7136\u5219\u7b49\u4ef7\u4e8e\u6700\u5c0f\u5316 Mahalanobis \u8ddd\u79bb\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2=(\\mathbf{X}-\\bar{\\mathbf{X}})^\\top\\sum\\nolimits^{-1}(\\mathbf{X}-\\bar{\\mathbf{X}}) \\] \u5f53\u6bcf\u5e45\u56fe\u50cf\u90fd\u6709\u8bef\u5dee\u5e76\u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u4e0e\u53e6\u4e00\u5e45\u56fe\u50cf\u4e2d\u7684\u8bef\u5dee\u662f\u72ec\u7acb\u7684\u65f6\uff0c\u5408\u9002\u7684\u4ee3\u4ef7\u51fd\u6570\u662f\uff1a \\[ \\parallel \\mathbf{X} - \\bar{\\mathbf{X}} \\parallel_{\\sum}^2+\\parallel \\mathbf{X}^\\prime - \\bar{\\mathbf{X}}^\\prime \\parallel_{\\sum^\\prime}^2 \\] \u5176\u4e2d \\(\\sum\\) \u548c \\(\\sum^\\prime\\) \u662f\u4e24\u5e45\u56fe\u50cf\u7684\u6d4b\u91cf\u7684\u534f\u65b9\u5dee\u77e9\u9635","title":"Mahalanobis \u8ddd\u79bb"},{"location":"cv/mvg/est2d/#_17","text":"","title":"\u53d8\u6362\u4e0d\u53d8\u6027\u548c\u5f52\u4e00\u5316"},{"location":"cv/mvg/est2d/#_18","text":"\u5047\u5b9a\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}\\) \u88ab \\(\\tilde{\\mathbf{x}}=T\\mathbf{x}\\) \u66ff\u4ee3\uff0c\u800c\u53e6\u4e00\u5e45\u56fe\u50cf\u7684\u5750\u6807 \\(\\mathbf{x}^\\prime\\) \u88ab \\(\\tilde{\\mathbf{x}}^\\prime=T^\\prime\\mathbf{x}^\\prime\\) \u66ff\u4ee3\u3002\u56e0\u6b64 \\(\\mathbf{x}_i\\) \u6620\u5c04\u5230 \\(\\mathbf{x}_i^\\prime\\) \u7684\u53d8\u6362\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\uff1a \u6839\u636e\u516c\u5f0f \\(\\tilde{\\mathbf{x}}_i=T\\mathbf{x}_i\\) \u548c \\(\\tilde{\\mathbf{x}}_i^\\prime=T^\\prime\\mathbf{x}_i^\\prime\\) \u53d8\u6362\u56fe\u50cf\u5750\u6807 \u7531\u5bf9\u5e94 \\(\\tilde{\\mathbf{x}}_i \\leftrightarrow \\tilde{\\mathbf{x}}_i^\\prime\\) \uff0c\u6c42 \\(\\tilde{H}\\) \u4ee4 \\(H=T^{\\prime-1}\\tilde{H}T\\)","title":"\u5173\u4e8e\u56fe\u50cf\u5750\u6807\u53d8\u6362\u7684\u4e0d\u53d8\u6027"},{"location":"cv/mvg/est2d/#dlt_1","text":"\u4ee4 \\(T^\\prime\\) \u4e3a\u5177\u6709\u7f29\u653e\u56e0\u5b50 \\(s\\) \u7684\u76f8\u4f3c\u53d8\u6362\uff0c \\(T\\) \u4e3a\u4efb\u610f\u7684\u5c04\u5f71\u53d8\u6362\u3002\u6b64\u5916\uff0c\u5047\u8bbe \\(H\\) \u662f\u4efb\u4f55 2D \u5355\u5e94\u5e76\u5b9a\u4e49 \\(\\tilde{H}=T^\\prime HT^{-1}\\) \uff0c\u90a3\u4e48 \\(\\parallel \\tilde{A} \\tilde{\\mathbf{h}} \\parallel = s \\parallel A \\mathbf{h} \\parallel\\) \u867d\u7136\u8fd9\u6837\u5b9a\u4e49\u7684 \\(H\\) \u548c \\(\\tilde{H}\\) \u7ed9\u51fa\u540c\u6837\u7684\u8bef\u5dee \\(\\varepsilon\\) \uff0c\u4f46\u662f\u5bf9\u89e3\u65bd\u52a0\u7684\u7ea6\u675f\u6761\u4ef6 \\(\\parallel H \\parallel = 1\\) \u4e0d\u7b49\u4ef7\u4e8e\u6761\u4ef6 \\(\\parallel \\tilde{H} \\parallel = 1\\) \uff0c\u5b83\u4eec\u5e76\u4e0d\u4ee5\u4efb\u4f55\u7b80\u5355\u7684\u65b9\u5f0f\u76f8\u5173\u8054\u3002","title":"DLT \u7b97\u6cd5\u7684\u975e\u4e0d\u53d8\u6027"},{"location":"cv/mvg/est2d/#_19","text":"\\[ d(\\tilde{\\mathbf{x}}^\\prime, \\tilde{H}\\tilde{\\mathbf{x}})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime HT^{-1}T\\mathbf{x})= d(T^\\prime \\mathbf{x}^\\prime, T^\\prime H\\mathbf{x})= d(\\mathbf{x}^\\prime, H\\mathbf{x}) \\] \u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\uff0c\u51e0\u4f55\u8bef\u5dee\u88ab\u4e58\u4ee5\u53d8\u6362\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u4ece\u800c\u6700\u5c0f\u5316\u53d8\u6362\u7684\u5bf9\u5e94\u65b9\u5f0f\u4e0e\u6b27\u6c0f\u53d8\u6362\u76f8\u540c\u3002\u6240\u4ee5\u6700\u5c0f\u5316\u51e0\u4f55\u8bef\u5dee\u5728\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\u3002","title":"\u51e0\u4f55\u8bef\u5dee\u7684\u4e0d\u53d8\u6027"},{"location":"cv/mvg/est2d/#_20","text":"\u6570\u636e\u5f52\u4e00\u5316\u4e0d\u4ec5\u63d0\u9ad8\u4e86\u7ed3\u679c\u7684\u7cbe\u5ea6\uff0c\u8fd8\u5bf9\u521d\u59cb\u6570\u636e\u5f52\u4e00\u5316\u7684\u7b97\u6cd5\u5c06\u5bf9\u4efb\u4f55\u5c3a\u5ea6\u7f29\u653e\u548c\u5750\u6807\u539f\u70b9\u7684\u9009\u62e9\u4e0d\u53d8\u3002\u56e0\u800c\u4f7f DLT \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5173\u4e8e\u76f8\u4f3c\u53d8\u6362\u4e0d\u53d8\u3002","title":"\u5f52\u4e00\u5316\u53d8\u6362"},{"location":"cv/mvg/est2d/#_21","text":"\u5bf9\u70b9\u8fdb\u884c\u5e73\u79fb\u4f7f\u70b9\u96c6\u5f62\u5fc3\u4f4d\u4e8e\u539f\u70b9 \u5bf9\u70b9\u8fdb\u884c\u7f29\u653e\u4f7f\u5b83\u4eec\u5230\u539f\u70b9\u7684\u5e73\u5747\u8ddd\u79bb\u7b49\u4e8e \\(\\sqrt{2}\\) \u5bf9\u4e24\u5e45\u56fe\u50cf\u72ec\u7acb\u8fdb\u884c\u4e0a\u8ff0\u53d8\u6362 \u6570\u636e\u5f52\u4e00\u5316\u5728 DLT \u7b97\u6cd5\u4e2d\u662f\u5b9e\u8d28\u6027\u7684\uff0c\u4e00\u5b9a\u4e0d\u8981\u89c6\u5b83\u4e3a\u53ef\u6709\u53ef\u65e0\u7684\u3002","title":"\u5404\u5411\u540c\u6027\u7f29\u653e"},{"location":"cv/mvg/est2d/#_22","text":"\u5f52\u4e00\u5316\u7684\u5f71\u54cd\u4e0e DLT \u65b9\u7a0b\u7ec4\u7684\u6761\u4ef6\u6570\u6216\u51c6\u786e\u5730\u8bf4\u4e0e\u65b9\u7a0b\u7ec4\u77e9\u9635 A \u7684\u7b2c\u4e00\u4e2a\u548c\u5012\u6570\u7b2c\u4e8c\u4e2a\u5947\u5f02\u503c\u7684\u6bd4\u7387 \\(d_1/d_{n-1}\\) \u6709\u5173\u3002\u4f46\u662f\uff0c\u5728\u6709\u566a\u58f0\u5b58\u5728\u65f6\u89e3\u5c06\u504f\u79bb\u5176\u6b63\u786e\u7ed3\u679c\u3002\u5927\u6761\u4ef6\u6570\u4f1a\u653e\u5927\u8fd9\u79cd\u504f\u5411\u3002","title":"\u5f52\u4e00\u5316\u4e0e\u6761\u4ef6\u6570"},{"location":"cv/mvg/est2d/#_23","text":"\u5728\u975e\u5404\u540c\u6027\u7f29\u653e\u4e2d\uff0c\u70b9\u7684\u5f62\u5fc3\u548c\u524d\u9762\u4e00\u6837\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7ecf\u5e73\u79fb\u540e\u70b9\u5728\u539f\u70b9\u9644\u8fd1\u5f62\u6210\u4e91\u3002\u7136\u540e\u8fdb\u884c\u5750\u6807\u5c3a\u5ea6\u7f29\u653e\u4f7f\u8be5\u70b9\u96c6\u7684\u4e24\u4e3b\u77e9\u90fd\u7b49\u4e8e 1\u3002\u8fd9\u6837\u4f7f\u8be5\u70b9\u96c6\u5f62\u6210\u4ee5\u539f\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u534a\u5f84\u4e3a 1 \u7684\u8fd1\u4f3c\u7684\u5bf9\u79f0\u5706\u4e91\u3002","title":"\u975e\u5404\u5411\u540c\u6027\u7f29\u653e"},{"location":"cv/mvg/est2d/#_24","text":"\u5f53\u70b9\u4f4d\u4e8e\u6216\u63a5\u8fd1\u5e73\u9762\u7684\u65e0\u7a77\u8fdc\u65f6\uff0c\u5404\u5411\u540c\u6027\uff08\u6216\u975e\u5404\u5411\u540c\u6027\uff09\u7684\u7f29\u653e\u65b9\u5f0f\u6765\u5f52\u4e00\u5316\u5750\u6807\u662f\u65e2\u65e0\u9053\u7406\u53c8\u4e0d\u53ef\u884c\u7684\uff0c\u56e0\u4e3a\u5f62\u5fc3\u5750\u6807\u548c\u7f29\u653e\u56e0\u5b50\u4e3a\u65e0\u7a77\u5927\u6216\u63a5\u8fd1\u65e0\u7a77\u5927\u3002\u4e00\u4e2a\u4f3c\u4e4e\u4f1a\u7ed9\u51fa\u597d\u7ed3\u679c\u7684\u65b9\u6cd5\u662f\u5f52\u4e00\u5316\u70b9\u96c6 \\(\\mathbf{x}_i=(x_i,y_i,w_i)^\\top\\) \u4f7f\u5f97\uff1a \\[ \\sum_i x_i=\\sum_i y_i=0;\\sum_ix_i^2+y_i^2=2\\sum_iw_i^2;x_i^2+y_i^2+w_i^2=1,\\forall i \\]","title":"\u65e0\u7a77\u8fdc\u9644\u8fd1\u7684\u70b9\u7684\u7f29\u653e"},{"location":"cv/mvg/est2d/#_25","text":"\u8fed\u4ee3\u6700\u5c0f\u5316\u6280\u672f \u4ee3\u4ef7\u53c2\u6570 \uff1a\u4ee3\u4ef7\u51fd\u6570\u662f\u6700\u5c0f\u5316\u7684\u57fa\u7840 \u53c2\u6570\u5316 \uff1a\u628a\u8981\u8ba1\u7b97\u7684\u53d8\u6362\uff08\u6216\u5176\u4ed6\u5b9e\u4f53\uff09\u8868\u793a\u6210\u6709\u9650\u6570\u76ee\u7684\u53c2\u6570 \u51fd\u6570\u786e\u5b9a \uff1a\u5fc5\u987b\u786e\u5b9a\u4e00\u4e2a\u7528\u53c2\u6570\u96c6\u63cf\u8ff0\u7684\u4ee3\u4ef7\u51fd\u6570 \u521d\u59cb\u5316 \uff1a\u8ba1\u7b97\u4e00\u4e2a\u9002\u5f53\u7684\u521d\u59cb\u53c2\u6570\u4f30\u8ba1\u3002\u4e00\u822c\u5c06\u7531\u4e00\u4e2a\u7ebf\u6027\u7b97\u6cd5\uff08\u4f8b\u5982 DLT \u7b97\u6cd5\uff09\u6765\u5b9e\u73b0 \u8fed\u4ee3 \uff1a\u7531\u521d\u59cb\u89e3\u5f00\u59cb\uff0c\u5728\u8fed\u4ee3\u4e2d\u9010\u6b65\u4fee\u6b63\u53c2\u6570\u4ee5\u8fbe\u5230\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u7684\u76ee\u7684","title":"\u8fed\u4ee3\u6700\u5c0f\u5316\u65b9\u6cd5"},{"location":"cv/mvg/est2d/#_26","text":"\u6307\u5bfc\u53c2\u6570\u5316\u7684\u4e00\u822c\u7b56\u7565\u662f\u9009\u62e9\u80fd\u8986\u76d6\u6700\u5c0f\u5316\u7684\u6574\u4e2a\u7a7a\u95f4\u5e76\u80fd\u7528\u4e00\u79cd\u65b9\u4fbf\u7684\u65b9\u5f0f\u6765\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u3002\u5bf9\u4e8e\u9f50\u6b21\u76ee\u6807\u901a\u5e38\u8bbe\u6709\u5fc5\u8981\u6216\u4e0d\u9f13\u52b1\u8ffd\u6c42\u6d88\u9664\u5c3a\u5ea6\u56e0\u5b50\u7684\u591a\u4e49\u6027\u800c\u91c7\u7528\u6700\u5c0f\u53c2\u6570\u5316\u3002\u9009\u62e9\u53c2\u6570\u5316\u7684\u53e6\u4e00\u4e2a\u8003\u8651\u662f\u9650\u5236\u53d8\u6362\u4e3a\u4e00\u4e2a\u5177\u4f53\u7684\u7c7b\u578b\u3002","title":"\u5173\u4e8e\u53c2\u6570\u5316"},{"location":"cv/mvg/est2d/#_27","text":"\u6709\u4e00\u4e2a\u534f\u65b9\u5dee\u77e9\u9635\u4e3a \\(\\sum\\) \u7684 \u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X} \\in IR^N\\) \u4e00\u7ec4\u53c2\u6570\u88ab\u8868\u8fbe\u6210\u4e00\u4e2a\u77e2\u91cf \\(\\mathbf{P} \\in IR^M\\) \u5b9a\u4e49\u4e00\u4e2a\u6620\u5c04 \\(f:\\ IR^M \\to IR^N\\) \uff0c\u5176\u503c\u57df\uff08\u81f3\u5c11\u5c40\u90e8\u5730\uff09\u662f \\(IR^N\\) \u4e2d\u8868\u793a\u5bb9\u8bb8\u6d4b\u91cf\u96c6\u7684\u6a21\u578b\u66f2\u9762 S \u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\u662f Mahalanobis \u8ddd\u79bb \\[\\parallel \\mathbf{X} - f(\\mathbf{P}) \\parallel_{\\sum}^2=(\\mathbf{X} - f(\\mathbf{P}))^\\top\\sum\\nolimits^{-1}(\\mathbf{X} - f(\\mathbf{P}))\\] \u5355\u56fe\u50cf\u8bef\u5dee-\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570 \uff1a\u56fa\u5b9a\u7b2c\u4e00\u5e45\u56fe\u50cf\u4e2d\u70b9 \\(\\mathbf{x}_i\\) \u7684\u5750\u6807\uff0c\u5e76\u53d8\u6362 H \u4ee5\u6700\u5c0f\u5316\u4ee3\u4ef7\u51fd\u6570\uff1a \\[ \\sum_id(\\mathbf{x}_i^\\prime,H\\tilde{\\mathbf{x}}_i)^2 \\\\ f:\\mathbf{h} \\to (H\\mathbf{x}_1, H\\mathbf{x}_2, ..., H\\mathbf{H}_n) \\] \u5bf9\u79f0\u4f20\u9012\u8bef\u5dee-\u5bf9\u79f0\u5316\u4ee3\u4ef7\u51fd\u6570 \\[ \\sum_id(\\mathbf{x}_i, H^{-1}\\mathbf{x}_i^\\prime)^2+d(\\mathbf{x}_i^\\prime, H\\mathbf{x}_i)^2 \\\\ f: \\mathbf{h} \\to (H^{-1}\\mathbf{x}_1^\\prime, ..., H^{-1}\\mathbf{x}_n^\\prime, H\\mathbf{x}_1, ..., H\\mathbf{x}_n) \\] \u91cd\u6295\u5f71\u8bef\u5dee \uff1a\u53ef\u4ee5\u7528 \\(\\hat{\\mathbf{x}}_i\\) \u5750\u6807\u548c \\(\\hat{H}\\) \u77e9\u9635\u7684\u5143\u7d20\u2014\u2014\u603b\u5171 \\(2n+9\\) \u4e2a\u53c2\u6570\u6765\u53c2\u6570\u5316\u3002 \u53c2\u6570\u77e2\u91cf \uff1a \\(\\mathbf{P}=(\\mathbf{h}, \\hat{\\mathbf{x}}_i, ..., \\hat{\\mathbf{x}}_n)\\) \u3002\u51fd\u6570 \\(f\\) \u5b9a\u4e49\u4e3a \\(f:\\mathbf{P}\\to (\\hat{\\mathbf{x}}_1, \\hat{\\mathbf{x}}_i^\\prime, ..., \\hat{\\mathbf{x}}_n, \\hat{\\mathbf{x}}_n^\\prime)\\) Sampson \u8fd1\u4f3c \uff1a\u91cd\u6295\u5f71\u8bef\u5dee\u7684 Sampson \u8fd1\u4f3c\u4f7f\u6295\u5f71\u8bef\u5dee\u4e5f\u80fd\u4ec5\u5bf9 9 \u4e2a\u53c2\u6570\u6700\u5c0f\u5316","title":"\u51fd\u6570\u786e\u5b9a"},{"location":"cv/mvg/est2d/#_28","text":"\u53ef\u4ee5\u7528\u7ebf\u6027\u6280\u672f\u6216\u6700\u5c0f\u914d\u7f6e\u89e3\u6765\u6c42\u53c2\u6570\u5316\u7684\u521d\u59cb\u4f30\u8ba1\u3002\u8fd8\u91c7\u7528\u7684\u53e6\u4e00\u79cd\u65b9\u6cd5\u662f\u5728\u53c2\u6570\u7a7a\u95f4\u8fdb\u884c\u8db3\u591f\u5bc6\u7684\u91c7\u6837\uff0c\u4ece\u6bcf\u4e00\u4e2a\u91c7\u6837\u521d\u59cb\u70b9\u5f00\u59cb\u8fed\u4ee3\u5e76\u4fdd\u7559\u6700\u597d\u7684\u7ed3\u679c\u3002\u8fd9\u79cd\u65b9\u6cd5\u4ec5\u5728\u53c2\u6570\u7a7a\u95f4\u7684\u7ef4\u6570\u8db3\u591f\u5c0f\u65f6\u624d\u53ef\u91c7\u7528","title":"\u521d\u59cb\u5316"},{"location":"cv/mvg/est2d/#_29","text":"\u5176\u4e2d\u6700\u5e38\u7528\u7684\u6709 Newton \u8fed\u4ee3\u548c Levenberg-Marquardt \u65b9\u6cd5\u3002Newton \u8fed\u4ee3\u662f\u6700\u5feb\u7684\uff0c\u4f46\u662f\u5b83\u9700\u8981\u8ba1\u7b97\u4ee3\u4ef7\u51fd\u6570\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u800c\u4e14\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u53ef\u80fd\u4f1a\u53d1\u6563\u3002Levenberg-Marquardt \u65b9\u6cd5\u662f\u4e00\u79cd\u66f4\u7a33\u5b9a\u7684\u65b9\u6cd5\uff0c\u4f46\u662f\u5b83\u7684\u6536\u655b\u901f\u5ea6\u6bd4 Newton \u8fed\u4ee3\u6162\u3002","title":"\u8fed\u4ee3\u65b9\u6cd5"},{"location":"cv/mvg/est2d/#_30","text":"","title":"\u7b97\u6cd5\u7684\u5b9e\u9a8c\u6bd4\u8f83"},{"location":"cv/mvg/est2d/#_31","text":"\u4e4b\u524d\u8ba8\u8bba\u7684\u5bf9\u5e94\u96c6\u7684\u552f\u4e00\u8bef\u5dee\u6e90\u6765\u81ea\u70b9\u7684\u4f4d\u7f6e\u6d4b\u91cf\uff0c\u5728\u8bb8\u591a\u5b9e\u9645\u8fd0\u884c\u4e2d\uff0c\u8fd8\u5b58\u5728\u7740\u70b9\u88ab\u9519\u914d\u7684\u60c5\u51b5\u3002\u9519\u914d\u70b9\u5bf9\u9ad8\u65af\u8bef\u5dee\u5206\u5e03\u800c\u8a00\u662f \u91ce\u503c \u3002","title":"\u9c81\u68d2\u4f30\u8ba1"},{"location":"cv/mvg/est2d/#ransac","text":"\u7528 \u6a21\u578b \u53bb\u62df\u5408\u6570\u636e\uff0c \u968f\u673a\u6837\u672c \u5305\u542b\u8db3\u4ee5\u786e\u5b9a\u6a21\u578b\u7684\u6700\u5c0f\u6570\u636e\u96c6\u3002\u5982\u679c\u6a21\u578b\u662f\u5e73\u9762\u5355\u5e94\uff0c\u800c\u6570\u636e\u662f 2D \u70b9\u5bf9\u5e94\u96c6\uff0c\u90a3\u4e48\u6700\u5c0f\u5b50\u96c6\u5305\u542b\u56db\u7ec4\u5bf9\u5e94\u3002 \u7b97\u6cd5\u6d41\u7a0b \u968f\u673a\u5730\u4ece\u6570\u636e\u96c6 \\(S\\) \u4e2d\u9009\u62e9 \\(s\\) \u4e2a\u6570\u636e\u70b9\u7ec4\u6210\u7684\u4e00\u4e2a\u6837\u672c\u4f5c\u4e3a\u6a21\u578b\u7684\u4e00\u4e2a\u793a\u4f8b \u786e\u5b9a\u5728\u6a21\u578b\u8ddd\u79bb\u9608\u503c \\(t\\) \u5185\u7684\u6570\u636e\u70b9\u96c6 \\(S_i\\) \uff0c \\(S_i\\) \u79f0\u4e3a\u91c7\u6837\u7684\u4e00\u81f4\u96c6\u5e76\u5b9a\u4e49 \\(S_i\\) \u7684\u5185\u70b9 \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f(\u5185\u70b9\u7684\u6570\u76ee)\u5927\u4e8e\u67d0\u4e2a\u9608\u503c \\(T\\) \uff0c\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b\u5e76\u7ed3\u675f \u5982\u679c \\(S_i\\) \u7684\u5927\u5c0f\u5c0f\u4e8e \\(T\\) \uff0c\u9009\u62e9\u4e00\u4e2a\u65b0\u7684\u5b50\u96c6\u5e76\u91cd\u590d\u4e0a\u9762\u7684\u8fc7\u7a0b \u7ecf\u8fc7 \\(N\\) \u6b21\u8bd5\u9a8c\u9009\u62e9\u6700\u5927\u4e00\u81f4\u96c6 \\(S_i\\) \uff0c\u5e76\u7528 \\(S_i\\) \u7684\u6240\u6709\u70b9\u91cd\u4f30\u8ba1\u6a21\u578b","title":"RANSAC"},{"location":"cv/mvg/est2d/#_32","text":"\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570 \uff1a\u4e0d\u540c\u4e8e\u4ec5\u5728\u5185\u70b9\u4e0a\u6700\u5c0f\u5316 \\(\\mathcal{C}=\\sum_{i}d_{\\perp}^2\\) \uff0c\u53e6\u4e00\u79cd\u6539\u8fdb\u7684\u9c81\u68d2\u65b9\u6cd5\u662f\u5728\u6240\u6709\u6570\u636e\u4e0a\u6700\u5c0f\u5316\u3002\u4e00\u4e2a\u5408\u9002\u7684\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\u662f \\[ \\mathcal{D}=\\sum_i \\gamma(d_{\\perp})\u4e14\\gamma(e)= \\left\\{\\begin{matrix} e^2 & e^2 < t^2 & \u5185\u70b9 \\\\ t^2 & e^2 >= t^2 & \u91ce\u503c \\end{matrix}\\right. \\] \\(d_\\perp\\) \u662f\u70b9\u7684\u8bef\u5dee\uff0c \\(\\gamma(e)\\) \u662f\u4e00\u4e2a\u9c81\u68d2\u4ee3\u4ef7\u51fd\u6570\uff0c\u5176\u4e2d\u7ed9\u91ce\u503c\u8d4b\u4e00\u4e2a\u56fa\u5b9a\u7684\u4ee3\u4ef7\u3002","title":"\u9c81\u68d2\u6700\u5927\u4f3c\u7136\u4f30\u8ba1"},{"location":"cv/mvg/est2d/#_33","text":"\u6700\u5c0f\u4e2d\u503c\u5e73\u65b9(LMS)\u4f30\u8ba1 \uff1a\u2003\u6839\u636e\u6570\u636e\u4e2d\u6240\u6709\u70b9\u7684\u8ddd\u79bb\u4e2d\u503c\uff0c\u9009\u62e9\u5177\u6709\u6700\u5c0f\u4e2d\u503c\u7684\u6a21\u578b\u3002LMS \u7684\u4f18\u70b9\u5728\u4e8e\u5b83\u4e0d\u9700\u8981\u9608\u503c\u6216\u8bef\u5dee\u65b9\u5dee\u7684\u5148\u9a8c\u77e5\u8bc6\u3002 LMS \u7684\u7f3a\u70b9\u662f\u5982\u679c\u591a\u4e8e\u4e00\u534a\u7684\u6570\u636e\u662f\u91ce\u503c\u90a3\u4e48\u5b83\u8981\u5931\u8d25\uff0c\u56e0\u4e3a\u8ddd\u79bb\u7684\u4e2d\u503c\u53ef\u80fd\u662f\u4e00\u4e2a\u91ce\u503c\u3002\u89e3\u51b3\u7684\u529e\u6cd5\u662f\u7528\u91ce\u503c\u7684\u6bd4\u4f8b\u6765\u786e\u5b9a\u6240\u9009\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u91ce\u503c\u7684\u6570\u91cf\u5c11\uff0c\u90a3\u4e48\u53ef\u4ee5\u91c7\u7528\u4ee5\u4e0b\u9c81\u68d2\u65b9\u6cd5\uff1a \u5220\u70b9\u65b9\u6cd5 \u2003\u6bcf\u70b9\u8f6e\u6d41\u88ab\u5220\u9664\u800c\u7528\u6a21\u578b\u5bf9\u5269\u4e0b\u7684\u6570\u636e\u62df\u5408\u3002 \u52a0\u6743\u6700\u5c0f\u4e8c\u4e58\u65b9\u8fed\u4ee3 \u2003\u5176\u4e2d\u4e00\u4e2a\u6570\u636e\u70b9\u5bf9\u62df\u5408\u7684\u5f71\u54cd\u4ee5\u5b83\u7684\u6b8b\u5dee\u6765\u53cd\u52a0\u6743\u3002","title":"\u5176\u4ed6\u9c81\u68d2\u7b97\u6cd5"},{"location":"cv/mvg/est2d/#_34","text":"\u8ba1\u7b97\u4e24\u5e45\u56fe\u50cf\u95f4\u7684\u5355\u5e94\u7684\u7b97\u6cd5\u3002 \u7b97\u6cd5\u7684\u8f93\u5165\u4ec5\u4ec5\u662f\u56fe\u50cf\uff0c\u4e0d\u9700\u8981\u5176\u4ed6 \u5148\u9a8c \u4fe1\u606f\uff1b\u800c\u8f93\u51fa\u7684\u662f\u5355\u5e94\u7684\u4f30\u8ba1\u4ee5\u53ca\u4e00\u7ec4\u5bf9\u5e94\u7684\u5174\u8da3\u70b9\u3002\u8be5\u7b97\u6cd5\u53ef\u4ee5\u5e94\u7528\u4e8e\u8bf8\u5982\u4e00\u5f20\u5e73\u5766\u8868\u9762\u7684\u4e24\u5e45\u56fe\u50cf\u6216\u7531\u6444\u50cf\u673a\u7ed5\u5176\u5149\u5fc3\u65cb\u8f6c\u7684\u5230\u7684\u4e24\u5e45\u56fe\u50cf\u3002 \u7b97\u6cd5\u6d41\u7a0b \u5174\u8da3\u70b9 \uff1a\u5728\u6bcf\u4e00\u5e45\u56fe\u50cf\u4e0a\u8ba1\u7b97\u5174\u8da3\u70b9 \u5047\u8bbe\u5bf9\u5e94 \uff1a\u6839\u636e\u5174\u8da3\u70b9\u7070\u5ea6\u9886\u57df\u7684\u63a5\u8fd1\u548c\u76f8\u4f3c\uff0c\u8ba1\u7b97\u5b83\u4eec\u7684\u5339\u914d\u96c6\u3002 RANSAC\u9c81\u68d2\u4f30\u8ba1 \uff1a\u91cd\u590d \\(N\\) \u6b21\u91c7\u6837\uff1a \u9009\u62e9\u7531\u56db\u7ec4\u5bf9\u5e94\u7ec4\u6210\u7684\u4e00\u4e2a\u968f\u673a\u6837\u672c\u5e76\u8ba1\u7b97\u5355\u5e94 H \u5bf9\u5047\u8bbe\u7684\u6bcf\u7ec4\u5355\u5e94\uff0c\u8ba1\u7b97\u8ddd\u79bb \\(d_{\\perp}\\) \u6839\u636e \\(d_\\perp < t = \\sqrt{5.99} \\delta\\) \u50cf\u7d20\u786e\u5b9a\u5bf9\u5e94\u6570\uff0c\u8fdb\u800c\u8ba1\u7b97\u4e0e H \u4e00\u81f4\u7684\u5185\u70b9\u6570 \u9009\u62e9\u5177\u6709\u6700\u5927\u5185\u70b9\u6570\u7684 H\uff0c\u5f53\u6570\u76ee\u76f8\u7b49\u65f6\u9009\u62e9\u5185\u70b9\u7684\u6807\u51c6\u65b9\u5dee\u6700\u4f4e\u7684 H \u6700\u4f18\u4f30\u8ba1 \uff1a\u7531\u5212\u5b9a\u7684\u5185\u70b9\u7684\u6240\u6709\u5bf9\u5e94\u91cd\u65b0\u4f30\u8ba1 H\uff0c\u7528 Levenberg-Marquardt \u7b97\u6cd5\u6765\u6700\u5c0f\u5316 ML \u4ee3\u4ef7\u51fd\u6570 \u5f15\u5bfc\u5339\u914d \uff1a\u7528\u4f30\u8ba1\u7684 H \u53bb\u5b9a\u4e49\u8f6c\u79fb\u70b9\u4f4d\u7f6e\u9644\u8fd1\u7684\u641c\u7d22\u533a\u57df\uff0c\u8fdb\u4e00\u6b65\u786e\u5b9a\u5174\u8da3\u70b9\u7684\u5bf9\u5e94\u3002 \u6700\u540e\u4e24\u6b65\u91cd\u590d\u5230\u5bf9\u5e94\u7684\u6570\u76ee\u7a33\u5b9a\u4e3a\u6b62","title":"\u5355\u5e94\u7684\u81ea\u52a8\u8ba1\u7b97"},{"location":"cv/mvg/eval/","text":"\u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790 \u00b6 \u7ea6 1571 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u8bc4\u4ef7\u548c\u91cf\u5316\u4f30\u8ba1\u7b97\u6cd5\u7684\u7ed3\u679c\u3002 \u901a\u5e38\u4ec5\u6709\u4e00\u4e2a\u53d8\u91cf\u6216\u53d8\u6362\u7684\u4f30\u8ba1\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u7f6e\u4fe1\u5ea6\u6216\u4e0d\u53ef\u9760\u6027\u5ea6\u7684\u6d4b\u91cf \u7ebf\u6027\u903c\u8fd1\u6cd5 \u8499\u7279\u5361\u6d1b\u6cd5 \u6027\u80fd\u7684\u754c\u5b9a \u00b6 \u8bb0\u53f7\u7684\u89c4\u5b9a \u6d4b\u91cf\u5f97\u5230\u7684\u91cf\uff0c\u5982 \\(\\mathbf{x}\\) \u8868\u793a\u56fe\u50cf\u70b9 \u88ab\u4f30\u8ba1\u7684\u91cf\u7528\u52a0\u5e3d\u5b50\u6765\u6807\u8bc6\uff0c\u5982 \\(\\hat{\\mathbf{x}}\\) \u6216 \\(\\hat{H}\\) \u91cf\u7684\u771f\u503c\u7528\u52a0\u6a2a\u6760\u8868\u793a\uff0c\u5982 \\(\\bar{\\mathbf{x}}\\) \u6216 \\(\\bar{H}\\) \u5355\u56fe\u50cf\u8bef\u5dee \u00b6 2D \u5355\u5e94\u7684\u4f30\u8ba1\u95ee\u9898\u5728\u4ec5\u7ed9\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u5750\u6807\u52a0\u566a\u58f0\u7684\u60c5\u5f62\u4e0b\uff0c\u8bbe\u6709 n \u7ec4\u8fd9\u6837\u7684\u5339\u914d\u70b9\uff0c RMS\uff08\u5747\u65b9\u6839\uff09\u6b8b\u5dee\uff1a \\[ \\varepsilon_{res}=(\\frac{1}{2n}\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\] \u53cc\u56fe\u50cf\u8bef\u5dee \u00b6 \u5bf9\u53cc\u56fe\u50cf\u8bef\u5dee\u60c5\u5f62\uff0c\u6b8b\u5dee\u662f \\[ \\varepsilon_{res}=\\frac{1}{\\sqrt{4n}}(\\sum_{i=1}^nd(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2+\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\] \u6700\u4f18\u4f30\u8ba1\u7b97\u6cd5\uff08MLE\uff09 \u00b6 \\(IR^N\\) \u4e0a\u603b\u65b9\u5dee\u4e3a \\(N\\delta^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03\u5411\u4e00\u4e2a \\(s\\) \u7ef4\u5b50\u7a7a\u95f4\u7684\u6295\u5f71\u662f\u603b\u65b9\u5dee\u4e3a \\(s\\sigma^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03 \u8003\u8651\u4e00\u4e2a\u4f30\u8ba1\u95ee\u9898\uff0c\u5176\u4e2d \\(N\\) \u4e2a\u6d4b\u91cf\u7531\u4f9d\u8d56\u4e8e \\(d\\) \u4e2a\u672c\u8d28\u53c2\u6570\u96c6\u7684\u51fd\u6570\u6a21\u578b\u5316\u3002\u5047\u5b9a\u6bcf\u4e2a\u6d4b\u91cf\u53d8\u91cf\u6709\u6807\u51c6\u5dee \\(\\delta\\) \u7684\u72ec\u7acb\u9ad8\u65af\u566a\u58f0\u3002 ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u6b8b\u5dee\uff08\u6d4b\u91cf\u503c\u5230\u4f30\u8ba1\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{res}=E [\\parallel \\hat{\\mathbf{X}} - \\mathbf{X} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(1-d/N)^{1/2} \\] ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u4f30\u8ba1\u8bef\u5dee\uff08\u4f30\u8ba1\u503c\u5230\u771f\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{est}=E [\\parallel \\hat{\\mathbf{X}} - \\bar{\\mathbf{X}} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(d/N)^{1/2} \\] \u53d8\u6362\u4f30\u8ba1\u7684\u534f\u65b9\u5dee \u00b6 \u6c42\u5f97\u7684\u53d8\u6362\u7684\u4e0d\u53ef\u9760\u6027\u901a\u5e38\u7531\u53d8\u6362\u7684 \u534f\u65b9\u5dee\u77e9\u9635 \u83b7\u53d6\uff0c\u56e0\u4e3a \\(H\\) \u662f 9 \u5143\u7d20\u7684\u77e9\u9635\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f\u4e00\u4e2a \\(9\\times 9\\) \u77e9\u9635\u3002 \u534f\u65b9\u5dee\u7684\u524d\u5411\u4f20\u64ad \u00b6 \u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{v}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u6620\u5c04\uff1a\u5b9a\u4e49\u4e3a \\(f(\\mathbf{v})=f(\\bar{\\mathbf{v}})+A(\\mathbf{v}-\\bar{\\mathbf{v}})\\) \u3002\u90a3\u4e48 \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(A\\sum A^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\u3002 \u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{v}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u90bb\u57df\u53ef\u5fae\uff0c\u90a3\u4e48\u5728\u7cbe\u786e\u5230\u4e00\u9636\u8fd1\u4f3c\u7684\u7a0b\u5ea6\u4e0b\uff0c \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(J\\sum J^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u4e2d \\(J\\) \u662f \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u503c\u3002 \u534f\u65b9\u5dee\u7684\u53cd\u5411\u4f20\u64ad \u00b6 \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u4eff\u5c04\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u5f62\u4e3a \\(f(\\mathbf{P})=f(\\bar{\\mathbf{P}}) + J(\\mathbf{P}-\\bar{\\mathbf{P}})\\) \u7684\u4eff\u5c04\u6620\u5c04\uff0c\u5176\u4e2d \\(J\\) \u7684\u79e9\u7b49\u4e8e \\(M\\) \u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u4e00\u6620\u5c04\uff0c\u5b83\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \uff0c\u90a3\u4e48 \\(\\hat{\\mathbf{P}}=f^{-1} \\small\\circ (\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1} \\] \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u975e\u7ebf\u6027\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u800c \\(J\\) \u662f\u5b83\u5728\u70b9 \\(\\bar{\\mathbf{P}}\\) \u5904\u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u3002\u5047\u5b9a \\(J\\) \u7684\u79e9\u4e3a \\(M\\) \uff0c\u5219 \\(f\\) \u5728 \\(\\bar{\\mathbf{P}}\\) \u7684\u90bb\u57df\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4\u6620\u5c04 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \uff0c\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u3002\u90a3\u4e48\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\uff0c \\(\\hat{\\mathbf{P}}=f^{-1} \\small \\circ \\eta(\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\((J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002 \u8d85\u53c2\u6570\u5316 \u00b6 \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u8d85\u53c2\u6570\u5316\u60c5\u5f62\u3002\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u5b83\u628a\u4e00\u7ec4\u53c2\u6570 \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230\u6d4b\u91cf\u77e2\u91cf \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(S_\\mathbf{p}\\) \u662f\u5d4c\u5165 \\(IR^M\\) \u4e2d\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684 d \u7ef4\u5149\u6ed1\u6d41\u5f62\u5e76\u4f7f\u5f97\u6620\u5c04 \\(f\\) \u5728\u6d41\u5f62 \\(S_\\mathbf{p}\\) \u4e0a \\(\\bar{\\mathbf{P}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\uff0c \\(f\\) \u628a \\(S_\\mathbf{p}\\) \u5c40\u57df\u5730\u6620\u5c04\u5230 \\(IR^N\\) \u4e0a\u5230\u6d41\u5f62 \\(f(S_\\mathbf{p})\\) \u3002\u51fd\u6570 \\(f\\) \u6709\u4e00\u4e2a\u5c40\u90e8\u9006\u51fd\u6570\uff0c\u8bb0\u4e3a \\(f^{-1}\\) \uff0c\u5b83\u9650\u5236\u5728\u66f2\u9762 \\(f(S_\\mathbf{p})\\) \u4e0a \\(\\bar{\\mathbf{X}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\uff0c\u5b9a\u4e49 \\(IR^N\\) \u4e0a\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}\\) \u548c\u534f\u65b9\u5dee \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\uff0c\u5e76\u4ee4 \\(\\eta: IR^N \\to f(S_\\mathbf{p})\\) \u628a \\(IR^N\\) \u4e0a\u7684\u70b9\u6620\u5c04\u5230 \\(f(S_\\mathbf{p})\\) \u4e0a\u5e76\u5728 Mahalanobis \u8303\u6570 \\(\\parallel \\cdot \\parallel_{\\sum_{\\mathbf{x}}}\\) \u610f\u4e49\u4e0b\u6700\u8fd1\u7684\u70b9\uff0c \\(IR^N\\) \u4e0a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_\\mathbf{x}\\) \u7684\u6982\u7387\u5206\u5e03\u901a\u8fc7 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc \\(IR^M\\) \u4e0a\u7684\u6982\u7387\u5206\u5e03\uff0c\u5b83\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_\\mathbf{p}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{+A}=A(A^\\top J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J A)^{-1}A^\\top \\] \u5176\u4e2d \\(A\\) \u662f\u4efb\u610f \\(m \\times d\\) \u77e9\u9635\uff0c\u5b83\u7684\u5217\u77e2\u91cf\u751f\u6210 \\(S_\\mathbf{p}\\) \u7684\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684\u5207\u7a7a\u95f4\u3002 \u4ee4\u53ef\u5fae\u6620\u5c04 \\(f:IR^M \\to IR^N\\) \uff0c\u628a \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230 \\(\\bar{\\mathbf{X}}\\) \uff0c\u5e76\u4ee4 \\(J\\) \u4e3a \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\uff0c\u8bbe \\(IR^N\\) \u4e0a\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\u5b9a\u4e49\u5728 \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u628a\u4e00\u4e2a\u6d4b\u91cf \\(\\mathbf{X}\\) \u6620\u5230\u7ea6\u675f\u5728\u5c40\u90e8\u6b63\u4ea4\u4e8e \\(J\\) \u7684\u96f6\u7a7a\u95f4\u7684\u66f2\u9762 \\(S_\\mathbf{p}\\) \u4e0a\u7684 MLE \u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u7684\u6620\u5c04\uff0c\u90a3\u4e48 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc\u5728 \\(IR^M\\) \u4e0a\u7684\u4e00\u4e2a\u5206\u5e03\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u662f\uff1a \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{*} \\] \u534f\u65b9\u5dee\u4f30\u8ba1\u7684\u8499\u7279\u5361\u6d1b\u6cd5 \u00b6 \u4e4b\u524d\u8ba8\u8bba\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u65b9\u6cd5\u90fd\u5efa\u7acb\u5728\u7ebf\u6027\u5047\u5b9a\u4e4b\u4e0a\u3002 \u5982\u679c\u4e0d\u77e5\u9053 H \u7684\u771f\u503c\u65f6\uff0c\u4f30\u8ba1\u53d8\u6362 H \u7684\u534f\u65b9\u5dee\u7684\u89e3\u6790\u6cd5\u548c\u8499\u7279\u5361\u6d1b\u6cd5\u90fd\u53ef\u4ee5\u7528\u4e8e\u5b9e\u9645\u6570\u636e\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u3002","title":"\u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790"},{"location":"cv/mvg/eval/#_1","text":"\u7ea6 1571 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5982\u4f55\u8bc4\u4ef7\u548c\u91cf\u5316\u4f30\u8ba1\u7b97\u6cd5\u7684\u7ed3\u679c\u3002 \u901a\u5e38\u4ec5\u6709\u4e00\u4e2a\u53d8\u91cf\u6216\u53d8\u6362\u7684\u4f30\u8ba1\u662f\u4e0d\u591f\u7684\uff0c\u8fd8\u9700\u8981\u8fdb\u884c\u7f6e\u4fe1\u5ea6\u6216\u4e0d\u53ef\u9760\u6027\u5ea6\u7684\u6d4b\u91cf \u7ebf\u6027\u903c\u8fd1\u6cd5 \u8499\u7279\u5361\u6d1b\u6cd5","title":"\u7b97\u6cd5\u8bc4\u4ef7\u548c\u8bef\u5dee\u5206\u6790"},{"location":"cv/mvg/eval/#_2","text":"\u8bb0\u53f7\u7684\u89c4\u5b9a \u6d4b\u91cf\u5f97\u5230\u7684\u91cf\uff0c\u5982 \\(\\mathbf{x}\\) \u8868\u793a\u56fe\u50cf\u70b9 \u88ab\u4f30\u8ba1\u7684\u91cf\u7528\u52a0\u5e3d\u5b50\u6765\u6807\u8bc6\uff0c\u5982 \\(\\hat{\\mathbf{x}}\\) \u6216 \\(\\hat{H}\\) \u91cf\u7684\u771f\u503c\u7528\u52a0\u6a2a\u6760\u8868\u793a\uff0c\u5982 \\(\\bar{\\mathbf{x}}\\) \u6216 \\(\\bar{H}\\)","title":"\u6027\u80fd\u7684\u754c\u5b9a"},{"location":"cv/mvg/eval/#_3","text":"2D \u5355\u5e94\u7684\u4f30\u8ba1\u95ee\u9898\u5728\u4ec5\u7ed9\u7b2c\u4e8c\u5e45\u56fe\u50cf\u7684\u5750\u6807\u52a0\u566a\u58f0\u7684\u60c5\u5f62\u4e0b\uff0c\u8bbe\u6709 n \u7ec4\u8fd9\u6837\u7684\u5339\u914d\u70b9\uff0c RMS\uff08\u5747\u65b9\u6839\uff09\u6b8b\u5dee\uff1a \\[ \\varepsilon_{res}=(\\frac{1}{2n}\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\]","title":"\u5355\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/eval/#_4","text":"\u5bf9\u53cc\u56fe\u50cf\u8bef\u5dee\u60c5\u5f62\uff0c\u6b8b\u5dee\u662f \\[ \\varepsilon_{res}=\\frac{1}{\\sqrt{4n}}(\\sum_{i=1}^nd(\\mathbf{x}_i,\\hat{\\mathbf{x}}_i)^2+\\sum_{i=1}^nd(\\mathbf{x}_i^\\prime,\\hat{\\mathbf{x}}_i^\\prime)^2)^{1/2} \\]","title":"\u53cc\u56fe\u50cf\u8bef\u5dee"},{"location":"cv/mvg/eval/#mle","text":"\\(IR^N\\) \u4e0a\u603b\u65b9\u5dee\u4e3a \\(N\\delta^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03\u5411\u4e00\u4e2a \\(s\\) \u7ef4\u5b50\u7a7a\u95f4\u7684\u6295\u5f71\u662f\u603b\u65b9\u5dee\u4e3a \\(s\\sigma^2\\) \u7684\u5404\u5411\u540c\u6027\u9ad8\u65af\u5206\u5e03 \u8003\u8651\u4e00\u4e2a\u4f30\u8ba1\u95ee\u9898\uff0c\u5176\u4e2d \\(N\\) \u4e2a\u6d4b\u91cf\u7531\u4f9d\u8d56\u4e8e \\(d\\) \u4e2a\u672c\u8d28\u53c2\u6570\u96c6\u7684\u51fd\u6570\u6a21\u578b\u5316\u3002\u5047\u5b9a\u6bcf\u4e2a\u6d4b\u91cf\u53d8\u91cf\u6709\u6807\u51c6\u5dee \\(\\delta\\) \u7684\u72ec\u7acb\u9ad8\u65af\u566a\u58f0\u3002 ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u6b8b\u5dee\uff08\u6d4b\u91cf\u503c\u5230\u4f30\u8ba1\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{res}=E [\\parallel \\hat{\\mathbf{X}} - \\mathbf{X} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(1-d/N)^{1/2} \\] ML \u4f30\u8ba1\u7b97\u6cd5\u7684 RMS \u4f30\u8ba1\u8bef\u5dee\uff08\u4f30\u8ba1\u503c\u5230\u771f\u503c\u7684\u8ddd\u79bb\uff09\u662f \\[ \\varepsilon_{est}=E [\\parallel \\hat{\\mathbf{X}} - \\bar{\\mathbf{X}} \\parallel / \\mathbf{N}]^{1/2}=\\sigma(d/N)^{1/2} \\]","title":"\u6700\u4f18\u4f30\u8ba1\u7b97\u6cd5\uff08MLE\uff09"},{"location":"cv/mvg/eval/#_5","text":"\u6c42\u5f97\u7684\u53d8\u6362\u7684\u4e0d\u53ef\u9760\u6027\u901a\u5e38\u7531\u53d8\u6362\u7684 \u534f\u65b9\u5dee\u77e9\u9635 \u83b7\u53d6\uff0c\u56e0\u4e3a \\(H\\) \u662f 9 \u5143\u7d20\u7684\u77e9\u9635\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f\u4e00\u4e2a \\(9\\times 9\\) \u77e9\u9635\u3002","title":"\u53d8\u6362\u4f30\u8ba1\u7684\u534f\u65b9\u5dee"},{"location":"cv/mvg/eval/#_6","text":"\u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{v}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u6620\u5c04\uff1a\u5b9a\u4e49\u4e3a \\(f(\\mathbf{v})=f(\\bar{\\mathbf{v}})+A(\\mathbf{v}-\\bar{\\mathbf{v}})\\) \u3002\u90a3\u4e48 \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(A\\sum A^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\u3002 \u4ee4 \\(\\mathbf{v}\\) \u662f \\(IR^M\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{v}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u77e2\u91cf\uff0c\u5047\u5b9a \\(f:IR^M \\to IR^N\\) \u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u90bb\u57df\u53ef\u5fae\uff0c\u90a3\u4e48\u5728\u7cbe\u786e\u5230\u4e00\u9636\u8fd1\u4f3c\u7684\u7a0b\u5ea6\u4e0b\uff0c \\(f(\\mathbf{v})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(f(\\bar{\\mathbf{v}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(J\\sum J^\\top\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u4e2d \\(J\\) \u662f \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u5728 \\(\\bar{\\mathbf{v}}\\) \u7684\u503c\u3002","title":"\u534f\u65b9\u5dee\u7684\u524d\u5411\u4f20\u64ad"},{"location":"cv/mvg/eval/#_7","text":"\u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u4eff\u5c04\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u5f62\u4e3a \\(f(\\mathbf{P})=f(\\bar{\\mathbf{P}}) + J(\\mathbf{P}-\\bar{\\mathbf{P}})\\) \u7684\u4eff\u5c04\u6620\u5c04\uff0c\u5176\u4e2d \\(J\\) \u7684\u79e9\u7b49\u4e8e \\(M\\) \u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u4e00\u6620\u5c04\uff0c\u5b83\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \uff0c\u90a3\u4e48 \\(\\hat{\\mathbf{P}}=f^{-1} \\small\\circ (\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u7684\u968f\u673a\u53d8\u91cf\uff0c\u5176\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1} \\] \u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u975e\u7ebf\u6027\u60c5\u5f62\uff1a\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u800c \\(J\\) \u662f\u5b83\u5728\u70b9 \\(\\bar{\\mathbf{P}}\\) \u5904\u7684\u96c5\u53ef\u6bd4\u77e9\u9635\u3002\u5047\u5b9a \\(J\\) \u7684\u79e9\u4e3a \\(M\\) \uff0c\u5219 \\(f\\) \u5728 \\(\\bar{\\mathbf{P}}\\) \u7684\u90bb\u57df\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\u3002\u4ee4 \\(\\mathbf{X}\\) \u662f \\(IR^N\\) \u4e2d\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}=f(\\bar{\\mathbf{P}})\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002\u4ee4\u6620\u5c04 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \uff0c\u628a\u6d4b\u91cf\u77e2\u91cf \\(\\mathbf{X}\\) \u6620\u5c04\u5230\u5bf9\u5e94\u4e8e ML \u4f30\u8ba1 \\(\\hat{\\mathbf{X}}\\) \u7684\u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u3002\u90a3\u4e48\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\uff0c \\(\\hat{\\mathbf{P}}=f^{-1} \\small \\circ \\eta(\\mathbf{X})\\) \u662f\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{P}}\\) \u548c\u534f\u65b9\u5dee\u77e9\u9635 \\((J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{-1}\\) \u7684\u968f\u673a\u53d8\u91cf\u3002","title":"\u534f\u65b9\u5dee\u7684\u53cd\u5411\u4f20\u64ad"},{"location":"cv/mvg/eval/#_8","text":"\u534f\u65b9\u5dee\u7684\u53cd\u5411\u8f93\u9001\u2014\u2014\u8d85\u53c2\u6570\u5316\u60c5\u5f62\u3002\u4ee4 \\(f:IR^M \\to IR^N\\) \u662f\u4e00\u4e2a\u53ef\u5fae\u6620\u5c04\uff0c\u5b83\u628a\u4e00\u7ec4\u53c2\u6570 \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230\u6d4b\u91cf\u77e2\u91cf \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(S_\\mathbf{p}\\) \u662f\u5d4c\u5165 \\(IR^M\\) \u4e2d\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684 d \u7ef4\u5149\u6ed1\u6d41\u5f62\u5e76\u4f7f\u5f97\u6620\u5c04 \\(f\\) \u5728\u6d41\u5f62 \\(S_\\mathbf{p}\\) \u4e0a \\(\\bar{\\mathbf{P}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\u662f\u4e00\u4e00\u5bf9\u5e94\u7684\uff0c \\(f\\) \u628a \\(S_\\mathbf{p}\\) \u5c40\u57df\u5730\u6620\u5c04\u5230 \\(IR^N\\) \u4e0a\u5230\u6d41\u5f62 \\(f(S_\\mathbf{p})\\) \u3002\u51fd\u6570 \\(f\\) \u6709\u4e00\u4e2a\u5c40\u90e8\u9006\u51fd\u6570\uff0c\u8bb0\u4e3a \\(f^{-1}\\) \uff0c\u5b83\u9650\u5236\u5728\u66f2\u9762 \\(f(S_\\mathbf{p})\\) \u4e0a \\(\\bar{\\mathbf{X}}\\) \u7684\u4e00\u4e2a\u90bb\u57df\u5185\uff0c\u5b9a\u4e49 \\(IR^N\\) \u4e0a\u7684\u4e00\u4e2a\u5177\u6709\u5747\u503c \\(\\bar{\\mathbf{X}}\\) \u548c\u534f\u65b9\u5dee \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\uff0c\u5e76\u4ee4 \\(\\eta: IR^N \\to f(S_\\mathbf{p})\\) \u628a \\(IR^N\\) \u4e0a\u7684\u70b9\u6620\u5c04\u5230 \\(f(S_\\mathbf{p})\\) \u4e0a\u5e76\u5728 Mahalanobis \u8303\u6570 \\(\\parallel \\cdot \\parallel_{\\sum_{\\mathbf{x}}}\\) \u610f\u4e49\u4e0b\u6700\u8fd1\u7684\u70b9\uff0c \\(IR^N\\) \u4e0a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_\\mathbf{x}\\) \u7684\u6982\u7387\u5206\u5e03\u901a\u8fc7 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc \\(IR^M\\) \u4e0a\u7684\u6982\u7387\u5206\u5e03\uff0c\u5b83\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u7684\u534f\u65b9\u5dee\u77e9\u9635\u662f \\[ \\sum_\\mathbf{p}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{+A}=A(A^\\top J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J A)^{-1}A^\\top \\] \u5176\u4e2d \\(A\\) \u662f\u4efb\u610f \\(m \\times d\\) \u77e9\u9635\uff0c\u5b83\u7684\u5217\u77e2\u91cf\u751f\u6210 \\(S_\\mathbf{p}\\) \u7684\u8fc7\u70b9 \\(\\bar{\\mathbf{P}}\\) \u7684\u5207\u7a7a\u95f4\u3002 \u4ee4\u53ef\u5fae\u6620\u5c04 \\(f:IR^M \\to IR^N\\) \uff0c\u628a \\(\\bar{\\mathbf{P}}\\) \u6620\u5c04\u5230 \\(\\bar{\\mathbf{X}}\\) \uff0c\u5e76\u4ee4 \\(J\\) \u4e3a \\(f\\) \u7684\u96c5\u53ef\u6bd4\u77e9\u9635\uff0c\u8bbe \\(IR^N\\) \u4e0a\u4e00\u4e2a\u5177\u6709\u534f\u65b9\u5dee\u77e9\u9635 \\(\\sum_{\\mathbf{x}}\\) \u7684\u9ad8\u65af\u5206\u5e03\u5b9a\u4e49\u5728 \\(\\bar{\\mathbf{X}}\\) \uff0c\u4ee4 \\(f^{-1} \\small\\circ \\eta:IR^N \\to IR^M\\) \u662f\u628a\u4e00\u4e2a\u6d4b\u91cf \\(\\mathbf{X}\\) \u6620\u5230\u7ea6\u675f\u5728\u5c40\u90e8\u6b63\u4ea4\u4e8e \\(J\\) \u7684\u96f6\u7a7a\u95f4\u7684\u66f2\u9762 \\(S_\\mathbf{p}\\) \u4e0a\u7684 MLE \u53c2\u6570\u77e2\u91cf \\(\\mathbf{P}\\) \u7684\u6620\u5c04\uff0c\u90a3\u4e48 \\(f^{-1} \\small\\circ \\eta\\) \u8bf1\u5bfc\u5728 \\(IR^M\\) \u4e0a\u7684\u4e00\u4e2a\u5206\u5e03\uff0c\u5b83\u7684\u534f\u65b9\u5dee\u77e9\u9635\u5728\u4e00\u9636\u7cbe\u5ea6\u4e0b\u662f\uff1a \\[ \\sum_{\\mathbf{P}}=(J^\\top \\sum_{\\mathbf{x}}\\nolimits^{-1} J)^{*} \\]","title":"\u8d85\u53c2\u6570\u5316"},{"location":"cv/mvg/eval/#_9","text":"\u4e4b\u524d\u8ba8\u8bba\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u65b9\u6cd5\u90fd\u5efa\u7acb\u5728\u7ebf\u6027\u5047\u5b9a\u4e4b\u4e0a\u3002 \u5982\u679c\u4e0d\u77e5\u9053 H \u7684\u771f\u503c\u65f6\uff0c\u4f30\u8ba1\u53d8\u6362 H \u7684\u534f\u65b9\u5dee\u7684\u89e3\u6790\u6cd5\u548c\u8499\u7279\u5361\u6d1b\u6cd5\u90fd\u53ef\u4ee5\u7528\u4e8e\u5b9e\u9645\u6570\u636e\u7684\u534f\u65b9\u5dee\u4f30\u8ba1\u3002","title":"\u534f\u65b9\u5dee\u4f30\u8ba1\u7684\u8499\u7279\u5361\u6d1b\u6cd5"},{"location":"cv/mvg/one-vg/","text":"\u5355\u89c6\u56fe\u51e0\u4f55 \u00b6 \u7ea6 3225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5728\u900f\u89c6\u6295\u5f71\u4e0b\u5176\u4ed6\u7684 3D \u51e0\u4f55\u5b9e\u4f53\u4e0e\u5176 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u8fd9\u4e9b\u5b9e\u4f53\u5305\u62ec\u5e73\u9762\u3001\u76f4\u7ebf\u3001\u4e8c\u6b21\u66f2\u7ebf\u3001\u4e8c\u6b21\u66f2\u9762\uff0c\u5c06\u63a8\u5bfc\u5b83\u4eec\u7684\u6b63\u5411\u548c\u53cd\u5411\u6295\u5f71\u7684\u6027\u8d28 \u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528 \u00b6 \u5bf9\u5e73\u9762\u7684\u4f5c\u7528 \u00b6 \u5047\u5b9a\u9009\u62e9 XY - \u5e73\u9762\u4e0e\u666f\u7269\u4e2d\u7684\u5e73\u9762 \\(\\pi\\) \u5bf9\u5e94\uff0c\u4f7f\u5f97\u5e73\u9762\u4e0a\u7684\u70b9 \\(Z\\) \u5750\u6807\u4e3a\u96f6\u3002 \\(\\mathbf{x}=P\\mathbf{X}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\ \\mathbf{p}_3 \\ \\mathbf{p}_4] \\begin{bmatrix} X \\\\ Y \\\\ 0 \\\\ 1 \\end{bmatrix}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\mathbf{p}_4]\\begin{bmatrix} X \\\\ Y \\\\ 1 \\end{bmatrix}\\) \u5373 \\(\\mathbf{x}=H\\mathbf{x}_\\pi\\) \u3002\u5728\u900f\u89c6\u5f71\u50cf\u4e0b\uff0c\u4e00\u5f20\u666f\u7269\u5e73\u9762\u4e0e\u4e00\u5f20\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u6700\u4e00\u822c\u7684\u53d8\u6362\u662f\u5e73\u9762\u5c04\u5f71\u53d8\u6362 \u5bf9\u76f4\u7ebf\u7684\u4f5c\u7528 \u00b6 \u6b63\u5411\u6295\u5f71 \uff1a \\(\\mathbf{A}\\) \u548c \\(\\mathbf{B}\\) \u662f 3 \u7ef4\u7a7a\u95f4\u7684\u70b9\uff0c\u800c \\(\\mathbf{a},\\mathbf{b}\\) \u662f\u5b83\u4eec\u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u56fe\u50cf\uff1a \\(\\mathbf{x}(\\mu)=P(\\mathbf{A}+\\mu \\mathbf{B})=P\\mathbf{A}+\\mu P \\mathbf{B}=\\mathbf{a} + \\mu \\mathbf{b}\\) \u76f4\u7ebf\u7684\u53cd\u5411\u6295\u5f71 \uff1a\u7ecf\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u6620\u5c04\u6210\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}\\) \u7684\u7a7a\u95f4\u7684\u70b9\u96c6\u662f\u5e73\u9762 \\(P^\\top\\mathbf{l}\\) Pl\u00fccker \u76f4\u7ebf\u8868\u793a \u4e00\u6761\u7528 Pl\u00fccker \u77e9\u9635 \\(L\\) \u8868\u793a\u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\uff0c\u5728\u6444\u50cf\u673a\u6620\u5c04 \\(P\\) \u4f5c\u7528\u4e0b\u88ab\u6620\u5c04\u6210\u6ee1\u8db3 \\([\\mathbf{l}]_\\times=PLP^\\top\\) \u7684\u76f4\u7ebf \u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u662f\u79e9\u4e3a 3 \u7684 \\(3 \\times 6\\) \u77e9\u9635\uff0c\u5373 \\(P=\\begin{bmatrix} \\mathbf{P}^2 \\wedge \\mathbf{P}^3 \\\\ \\mathbf{P}^3 \\wedge \\mathbf{P}^1 \\\\ \\mathbf{P}^1 \\wedge \\mathbf{P}^2 \\end{bmatrix}\\) \uff0c\u5176\u4e2d \\(\\mathbf{P}^{i\\top}\\) \u662f\u70b9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u884c\uff0c\u800c \\(\\mathbf{P}^i \\wedge \\mathbf{P}^j\\) \u662f\u5e73\u9762 \\(\\mathbf{P}^i\\) \u4e0e \\(\\mathbf{P}^j\\) \u7684\u4ea4\u7ebf\u7684 Pl\u00fccker \u5750\u6807 \u5728\u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u4f5c\u7528\u4e0b\uff0c \\(IP^3\\) \u4e2d\u7528 Pl\u00fccker \u5750\u6807\u8868\u793a\u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u88ab\u6620\u5c04\u5bfc\u56fe\u50cf\u76f4\u7ebf\uff1a \\(\\mathbf{l}=P\\mathcal{L}=\\begin{bmatrix} (\\mathbf{P}^2 \\wedge \\mathbf{P}^3 | \\mathcal{L}) \\\\ (\\mathbf{P}^3 \\wedge \\mathbf{P}^1 | \\mathcal{L}) \\\\ (\\mathbf{P}^1 \\wedge \\mathbf{P}^2 | \\mathcal{L}) \\end{bmatrix}\\) \\(IP^3\\) \u4e2d\u6ee1\u8db3 \\(P\\mathcal{L}=\\mathbf{0}\\) \u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u5fc5\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3 \u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528 \u00b6 \u5728\u6444\u50cf\u673a \\(P\\) \u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53cd\u5411\u6295\u5f71\u6210\u9525\u9762: \\(Q_{CO}=P^\\top CP\\) \u5149\u6ed1\u66f2\u9762\u7684\u56fe\u50cf \u00b6 \u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u5b9a\u4e49\u4e3a\u5f71\u50cf\u5c04\u7ebf\u4e0e \\(S\\) \u7684\u6240\u6709\u5207\u70b9 \\(\\mathbf{X}\\) \u7684\u96c6\u5408\u3002\u5728\u56fe\u50cf\u4e0a\uff0c\u4e0e\u5b83\u5bf9\u5e94\u7684 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u662f \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u96c6\u5408\uff0c\u5373 \\(\\gamma\\) \u662f \\(\\Gamma\\) \u7684\u56fe\u50cf \u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u4ec5\u53d6\u51b3\u4e8e\u6444\u50cf\u673a\u4e2d\u5fc3\u4e0e\u66f2\u9762\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u800c\u4e0e\u56fe\u50cf\u5e73\u9762\u65e0\u5173 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u7531\u56fe\u50cf\u5e73\u9762\u4e0e\u8f6e\u5ed3\u751f\u6210\u5143\u7684\u5c04\u7ebf\u7684\u76f8\u4ea4\u786e\u5b9a\uff0c\u56e0\u6b64\u4e0e\u56fe\u50cf\u5e73\u9762\u6709\u5173 \u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u4e8c\u6b21\u66f2\u9762\u7684\u4f5c\u7528 \u00b6 \u4e8c\u6b21\u66f2\u9762\u7684\u6b63\u5411\u6295\u5f71 \u5728\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u5916\u5f62\u7ebf\u662f\u4e0b\u5f0f\u7ed9\u5b9a\u7684\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(C^*=PQ^*P^\\top\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u548c\u4e2d\u5fc3\u4e3a \\(C\\) \u7684\u6444\u50cf\u673a\u76f8\u5bf9\u5e94\u7684\u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u7684\u5e73\u9762\u662f \\(\\pi_\\Gamma=QC\\) \u9876\u70b9\u4e3a \\(\\mathbf{V}\\) \u5e76\u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u76f8\u5207\u7684\u9525\u9762\u662f\u4e00\u4e2a\u9000\u5316\u7684\u4e8c\u6b21\u66f2\u9762 \\(Q_{CO}=(\\mathbf{V}^\\top Q\\mathbf{V})Q-(Q\\mathbf{V})(Q\\mathbf{V})^\\top\\) \uff0c\u5f53 \\(Q_{CQ}\\mathbf{V}=\\mathbf{0}\\) \u65f6\uff0c \\(\\mathbf{V}\\) \u6b63\u662f\u6240\u8981\u6c42\u7684\u9525\u9762\u7684\u9876\u70b9 \u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u91cd\u8981\u6027 \u00b6 3 \u7ef4\u7a7a\u95f4\u7684\u7269\u4f53\u548c\u6444\u50cf\u673a\u4e2d\u5fc3\u786e\u5b9a\u4e86\u4e00\u4e2a\u5c04\u7ebf\u96c6\u5408\uff0c\u800c\u8fd9\u4e9b\u5c04\u7ebf\u4e0e\u4e00\u5f20\u5e73\u9762\u7684\u4ea4\u5c31\u4ea7\u751f\u8be5\u7269\u4f53\u7684\u56fe\u50cf\uff0c\u8fd9\u4e2a\u96c6\u5408\u901a\u5e38\u79f0\u4e3a \u5c04\u7ebf\u9525 \u5047\u8bbe\u5c04\u7ebf\u9525\u4e0e\u4e24\u5f20\u5e73\u9762\u76f8\u4ea4\uff0c\u90a3\u4e48\u6240\u5f97\u4e24\u5e45\u56fe\u50cf \\(\\mathbf{I}\\) \u548c \\(\\mathbf{I}^\\prime\\) \u663e\u7136\u4ee5\u4e00\u4e2a\u900f\u89c6\u6620\u5c04\u76f8\u5173\u8054\u3002\u56e0\u4e3a\u6444\u50cf\u673a\u6709\u5171\u540c\u7684\u4e2d\u5fc3\uff0c\u4ece\u800c\u7531\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4ea7\u751f\u7684 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a \\(\\mathbf{x}^\\prime=P^\\prime \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1}P \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1} \\mathbf{x}\\) \uff0c\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\u4ee5\u4e00\u4e2a\u5f62\u5982 \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \u7684\u5e73\u9762\u5355\u5e94( \\(3 \\times 3\\) \u77e9\u9635)\u76f8\u5173\u8054\uff0c\u5176\u4e2d \\(H=(K^\\prime R^\\prime)(KR)^{-1}\\) \u79fb\u52a8\u56fe\u50cf\u5e73\u9762 \u00b6 \u8003\u8651\u7126\u8ddd\u589e\u52a0\u7684\u60c5\u51b5\uff0c\u5728\u4e00\u9636\u8fd1\u4f3c\u7684\u7cbe\u5ea6\u4e0b\uff0c\u5b83\u76f8\u5f53\u4e8e\u56fe\u50cf\u5e73\u9762\u6cbf\u4e3b\u8f74\u79fb\u52a8 \u56e0\u5b50 \\(k=f^\\prime/f\\) \u7684\u53d8\u7126\u6548\u679c\u7b49\u4e8e\u7528 \\(diag(k,k,1)\\) \u53f3\u4e58\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u6444\u50cf\u673a\u65cb\u8f6c \u00b6 \u6444\u50cf\u673a\u5728\u4e0d\u6539\u53d8\u5b83\u7684\u5185\u90e8\u53c2\u6570\u7684\u60c5\u51b5\u4e0b\u7ed5\u5b83\u7684\u4e2d\u5fc3\u65cb\u8f6c\u3002\u5982\u679c\u70b9 \\(\\mathbf{X}\\) \u5728\u7eaf\u65cb\u8f6c\u524d\u548c\u540e\u7684\u56fe\u50cf\u662f \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \uff0c\u90a3\u4e48 \\(\\mathbf{x}^\\prime=K[R|\\mathbf{0}]\\mathbf{X}=KRK^{-1}K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}=KRK^{-1}\\mathbf{x}\\) \uff0c\u56e0\u6b64\uff0c \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \uff0c\u5176\u4e2d \\(H=KRK^{-1}\\) \u8fd9\u79cd\u5355\u5e94\u662f\u4e00\u4e2a\u5171\u8f6d\u65cb\u8f6c \u5e94\u7528\u4e0e\u4e3e\u4f8b \u00b6 \u89c6\u56fe\u5408\u6210 \u00b6 \u53ef\u4ee5\u5bf9\u73b0\u6709\u7684\u56fe\u50cf\u8fdb\u884c\u5e73\u9762\u5355\u5e94\u6027\u7684\u5f62\u53d8\u63d2\u8865\u6765\u4ea7\u751f\u65b0\u7684\u56fe\u50cf\uff0c\u65b0\u7684\u56fe\u50cf\u5bf9\u5e94\u4e8e\u4e0d\u540c\u7684\u6444\u50cf\u673a\u5b9a\u5411(\u4f46\u6444\u50cf\u673a\u4e2d\u5fc3\u76f8\u540c) \u8ba1\u7b97\u628a\u56fe\u50cf\u4e2d\u7684\u56db\u8fb9\u5f62\u6620\u5c04\u56de\u5177\u6709\u6b63\u786e\u957f\u5bbd\u6bd4\u77e9\u5f62\u7684\u5355\u5e94 H \u7528\u8fd9\u4e2a\u5355\u5e94\u5bf9\u539f\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865 \u5e73\u9762\u5168\u666f\u62fc\u56fe \u00b6 \u6444\u50cf\u673a\u7ed5\u5176\u4e2d\u5fc3\u65cb\u8f6c\u6240\u5f97\u5230\u7684\u4e00\u7ec4\u56fe\u50cf\u4e4b\u95f4\u4ee5\u4e00\u4e2a\u5e73\u9762\u5355\u5e94\u76f8\u5173\u8054\u3002\u8fd9\u6837\u7684\u4e00\u7ec4\u56fe\u50cf\u53ef\u4ee5\u901a\u8fc7\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\u4e0e\u5176\u4e2d\u4e00\u5e45\u56fe\u50cf\u7684\u5e73\u9762\u914d\u51c6\u3002 \u9009\u62e9\u56fe\u50cf\u96c6\u5408\u4e2d\u7684\u4e00\u5e45\u4f5c\u4e3a\u53c2\u8003\u56fe\u50cf \u5728\u5176\u4f59\u7684\u56fe\u50cf\u4e2d\u9009\u4e00\u5e45\u56fe\u50cf\uff0c\u8ba1\u7b97\u628a\u5b83\u6620\u5c04\u5230\u53c2\u8003\u56fe\u50cf\u7684\u5355\u5e94 H \u7528\u5f97\u5230\u7684\u5355\u5e94\u5bf9\u8fd9\u5e45\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\uff0c\u5e76\u4e14\u7528\u63d2\u8865\u56fe\u50cf\u4e0e\u53c2\u8003\u56fe\u50cf\u7684\u975e\u91cd\u53e0\u90e8\u5206\u6765\u6269\u5927\u53c2\u8003\u56fe\u50cf \u5bf9\u56fe\u50cf\u96c6\u5408\u4e2d\u4f59\u4e0b\u7684\u56fe\u50cf\u91cd\u590d\u4e0a\u8ff0\u6700\u540e\u4e24\u6b65\u8fc7\u7a0b \uff08\u7b80\u5316\u7684\uff09\u5c04\u5f71\u8bb0\u53f7 \u00b6 \u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u90fd\u9009\u62e9\u89c4\u8303\u7684\u5c04\u5f71\u5750\u6807\u90a3\u4e48\u6444\u50cf\u673a\u77e9\u9635\uff1a \\(P=\\begin{bmatrix} a & 0 & 0 & -d \\\\ 0 & b & 0 & -d \\\\ 0 & 0 & c & -d \\end{bmatrix}\\) \u6ee1\u8db3 \\(\\mathbf{x}_i=P\\mathbf{X}_i,i=1,...,4\\) \u548c \\(P(a^{-1},b^{-1},c^{-1},d^{-1})^\\top=\\mathbf{0}\\) \uff0c\u540e\u8005\u8868\u793a\u6444\u50cf\u673a\u4e2d\u5fc3\u662f \\(\\mathbf{C}=(a^{-1},b^{-1},c^{-1},d^{-1})^\\top\\) \u79fb\u52a8\u6444\u50cf\u673a\u4e2d\u5fc3 \u00b6 \u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u91cd\u5408\u7684\u4e24\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9.\u90ce\u5728\u540c\u4e00\u5c04\u7ebf\u4e0a\u7684\u70b9\u3002\u5982\u679c\u6444\u50cf\u673a\u4e2d\u5fc3\u88ab\u79fb\u52a8\u4e86(\u6ca1\u6709\u6cbf\u7740\u8fd9\u6761\u5c04\u7ebf) \uff0c\u90a3\u4e48\u5176\u56fe\u50cf\u5c31\u4e0d\u518d\u91cd\u5408\u4e86\u3002\u539f\u6765\u662f\u91cd\u5408\u7684\u56fe\u50cf\u70b9\u4e4b\u95f4\u7684\u76f8\u5bf9\u4f4d\u79fb\u79f0\u4e3a\u89c6\u5dee\u3002 \u6444\u50cf\u673a\u6807\u5b9a\u4e0e\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf \u00b6 \u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u662f \\(\\mathbf{x}\\) \u4e0e\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\u6d4b\u91cf\u7684\u5c04\u7ebf\u65b9\u5411 \\(\\mathbf{d}=K^{-1}\\mathbf{x}\\) \u4e4b\u95f4\u7684\u4e00\u4e2a\uff08\u4eff\u5c04\uff09\u53d8\u6362 \u4e00\u6761\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u786e\u5b9a\u4e00\u5f20\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u8be5\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}=K^\\top \\mathbf{l}\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf \u00b6 \\(\\pi_\\infty\\) \u4e0e\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u7684\u6620\u5c04\u7531\u5e73\u9762\u5355\u5e94 \\(\\mathbf{x}=H\\mathbf{d}\\) \u7ed9\u51fa\uff0c\u5176\u4e2d \\(H=KR\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08\u7b80\u79f0 IAC\uff09\u662f\u4e8c\u6b21\u66f2\u7ebf \\(\\omega=(KK^\\top)^{-1}=K^{-\\top}K^{-1}\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5076\u56fe\u50cf\uff08\u7b80\u79f0 DIAC\uff09\u4e3a \\(\\omega^*=\\omega^{-1}=KK^\\top\\) \u4e00\u4e2a\u7b80\u5355\u7684\u6807\u5b9a\u88c5\u7f6e \u88c5\u7f6e\u91cc\u6709\u4e09\u4e2a\u6b63\u65b9\u5f62\uff08\u5b83\u4eec\u6240\u5728\u5e73\u9762\u662f\u4e0d\u5e73\u884c\u7684\uff0c\u4f46\u4e5f\u4e0d\u5fc5\u6b63\u4ea4\uff09\u7684\u56fe\u50cf\u63d0\u4f9b\u8ba1\u7b97 \\(K\\) \u7684\u8db3\u591f\u7ea6\u675f \u5bf9\u6bcf\u4e2a\u6b63\u65b9\u5f62\uff0c\u8ba1\u7b97\u628a\u5b83\u7684\u89d2\u70b9 \\((0,0)^\\top\u3001(1,0)\u3001(0,1)\u3001(1,1)^\\top\\) \u6620\u5c04\u5230\u76f8\u5e94\u7684\u56fe\u50cf\u70b9\u7684\u5355\u5e94 \\(H\\) \u8ba1\u7b97\u8be5\u6b63\u65b9\u5f62\u6240\u5728\u5e73\u9762\u865a\u5706\u70b9\u7684\u56fe\u50cf\uff0c\u5373 \\(H(1,\\pm i,0)^\\top\\) \u7531\u8fd9\u516d\u4e2a\u865a\u5706\u70b9\u7684\u56fe\u50cf\u62df\u5408\u51fa\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(\\omega\\) \u7528 Cholesky \u5206\u89e3\u7531 \\(\\omega=(KK^\\top)^{-1}\\) \u8ba1\u7b97\u6807\u5b9a \\(K\\) \u56fe\u50cf\u4e2d\u7684\u6b63\u4ea4\u6027 \u5982\u679c\u56fe\u50cf\u70b9\u5173\u4e8e \\(\\omega\\) \u5171\u8f6d\uff0c\u5373\u5982\u679c \\(\\mathbf{x}_1^\\top \\omega \\mathbf{x}_2 = 0\\) \uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5bf9\u5e94\u4e8e\u6b63\u4ea4\u7684\u65b9\u5411 \u5047\u5b9a\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5230\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}\\) \u7684\u5e73\u9762 \\(\\pi\\) \uff0c\u90a3\u4e48\u6cd5\u7ebf\u7684\u5f71\u50cf\u4e3a\u70b9 \\(K\\mathbf{n}\\) \uff0c\u800c\u4e14\u76f4\u7ebf \\(\\mathbf{l}\\) \u662f\u8be5\u70b9\u7684\u6781\u7ebf\uff0c\u56e0\u6b64 \\(\\mathbf{l}=\\omega K \\mathbf{n}=(KK^\\top)^{-1}K\\mathbf{n}=K^{-\\top}\\mathbf{n}\\) \uff0c\u5373 \\(\\pi\\) \u7684\u6cd5\u7ebf\u662f \\(\\mathbf{n}=K^\\top \\mathbf{l}\\) \u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \u00b6 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08IAC\uff09\u662f\u56fe\u50cf\u4e2d\u7684\u4e00\u6761\u865a\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e3a\u4e86\u53ef\u89c6\u5316\u7684\u76ee\u7684\uff0c\u8003\u8651\u4e0e\u6444\u50cf\u673a\u6807\u5b9a\u7d27\u5bc6\u76f8\u5173\u7684\u53e6\u5916\u4e00\u79cd\u66f2\u7ebf\uff0c\u8fd9\u6837\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4e3a \u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff0c\u5b83\u662f\u4e00\u4e2a\u9876\u89d2\u4e3a \\(45^\\circ\\) \u800c\u8f74\u4e3a\u6444\u50cf\u673a\u4e3b\u8f74\u7684\u5706\u9525\u9762\u7684\u56fe\u50cf\u3002\u8be5\u5706\u9525\u9762\u7684\u70b9\u6620\u5c04\u4e3a\u4e8c\u6b21\u66f2\u7ebf\uff1a \\[ C=K^{-\\top} \\begin{bmatrix} 1 & & \\\\ & 1 & \\\\ & & -1 \\end{bmatrix} K^{-\\top} \\] \u6b63\u4ea4\u6027\u548c\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff1a\u5982\u679c\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u5bf9\u5e94\u4e8e\u5782\u76f4\u4e8e\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u5c04\u7ebf\u7684\u4e00\u4e2a\u5e73\u9762\uff0c\u90a3\u4e48\uff0c\u8fd9\u6761\u76f4\u7ebf\u662f \\(\\mathbf{x}\\) \u5173\u4e8e\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf\u7684\u53cd\u5c04\u70b9 \\(\\overset{\\cdot}{\\mathbf{x}}\\) \u7684\u6781\u7ebf \\(C\\overset{\\cdot}{\\mathbf{x}}\\) \u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf \u00b6 \u900f\u89c6\u6295\u5f71\u7684\u4e00\u4e2a\u663e\u8457\u7279\u5f81\u662f\u5ef6\u4f38\u81f3\u65e0\u7a77\u8fdc\u7684\u7269\u4f53\u7684\u56fe\u50cf\u53ef\u80fd\u51fa\u73b0\u5728\u6709\u9650\u8303\u56f4 \u6d88\u5f71\u70b9 \u96c6\u5408\u4e0a\u4e00\u6761\u4e16\u754c\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u7531\u5e73\u884c\u4e8e\u8be5\u76f4\u7ebf\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u5f97\u5230\u3002\u56e0\u6b64\u6d88\u5f71\u70b9\u4ec5\u4f9d\u8d56\u4e8e\u76f4\u7ebf\u7684\u65b9\u5411\uff0c\u800c\u4e0e\u5176\u4f4d\u7f6e\u65e0\u5173\u3002\u5982\u679c\u4e16\u754c\u76f4\u7ebf\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\uff0c\u90a3\u4e48\u6d88\u5f71\u70b9\u5728\u56fe\u50cf\u7684\u65e0\u7a77\u8fdc\u5904\u3002 \u8be5\u4e16\u754c\u76f4\u7ebf\u53ef\u4ee5\u7528 \\(\\mathbf{X}(\\lambda)=\\mathbf{A}+\\lambda\\mathbf{D}\\) \u6765\u53c2\u6570\u5316\uff0c\u5176\u4e2d \\(\\mathbf{A}\\) \u662f\u76f4\u7ebf\u4e0a\u7684\u70b9\uff0c\u800c \\(\\mathbf{D}=(\\mathbf{d}^\\top,0)^\\top\\) \u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u4e14\u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9 \\(\\mathbf{v}\\) \uff0c\u5373 \\(\\mathbf{v}=K\\mathbf{d}\\) \u7531\u6d88\u5f71\u70b9\u6c42\u6444\u50cf\u673a\u65cb\u8f6c \u6d88\u5f71\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u7684\u56fe\u50cf\uff0c\u5b83\u63d0\u4f9b\u5b9a\u5411(\u59ff\u6001)\u4fe1\u606f\u7684\u65b9\u5f0f\u4e0e\u4e0d\u52a8\u661f\u63d0\u4f9b\u7684\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u8003\u8651\u7531\u5b9a\u5411\u548c\u4f4d\u7f6e\u4e0d\u540c\u7684\u4e24\u4e2a\u6807\u5b9a\u6444\u50cf\u673a\u83b7\u53d6\u7684\u4e00\u4e2a\u666f\u7269\u7684\u4e24\u5e45\u56fe\u50cf\u3002\u65e0\u7a77\u8fdc\u70b9\u4f5c\u4e3a\u666f\u7269\u7684\u4e00\u90e8\u5206\u4e0e\u6444\u50cf\u673a\u65e0\u5173\u3002\u5b83\u4eec\u7684\u56fe\u50cf\uff0c\u5373\u6d88\u5f71\u70b9\uff0c\u4e0d\u53d7\u6444\u50cf\u673a\u4f4d\u7f6e\u53d8\u5316\u7684\u5f71\u54cd\uff0c\u4f46\u8981\u53d7\u6444\u50cf\u673a\u65cb\u8f6c\u7684\u5f71\u54cd\u3002 \u4ee4\u4e00\u6761\u666f\u7269\u76f4\u7ebf\u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u7684\u6d88\u5f71\u70b9\u662f \\(\\mathbf{v}_i\\) \uff0c\u5728\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u662f \\(\\mathbf{v}_i^\\prime\\) \uff0c\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i\\) \u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i=K^{-1}\\mathbf{v}_i / \\parallel K^{-1} \\mathbf{v}_i \\parallel\\) \uff0c\u800c\u5bf9\u5e94\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i^\\prime\\) \uff0c\u5728\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i^\\prime\\) \uff0c\u5219\u6444\u50cf\u673a\u7684\u65cb\u8f6c \\(\\mathbf{d}_i^\\prime=R\\mathbf{d}_i\\) \u6d88\u5f71\u7ebf 3 \u7ef4\u7a7a\u95f4\u7684\u5e73\u884c\u5e73\u9762\u4e0e \\(\\pi _\\infty\\) \u4ea4\u4e8e\u4e00\u6761\u516c\u5171\u7684\u76f4\u7ebf\uff0c\u800c\u8fd9\u6761\u76f4\u7ebf\u7684\u56fe\u50cf\u5c31\u662f\u5e73\u9762\u7684\u6d88\u5f71\u7ebf\u3002\u51e0\u4f55\u4e0a\uff0c\u6d88\u5f71\u7ebf\u7531\u5e73\u884c\u4e8e\u666f\u7269\u5e73\u9762\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u5f20\u5e73\u9762\u4e0e\u56fe\u50cf\u7684\u4ea4\u7ebf\u5f97\u5230\u3002\u663e\u7136\uff0c \u6d88\u5f71\u7ebf\u4ec5\u4e0e\u666f\u7269\u5e73\u9762\u7684\u5b9a\u5411\u6709\u5173\uff0c\u800c\u4e0e\u5b83\u7684\u4f4d\u7f6e\u65e0\u5173\u3002 \u5728\u6444\u50cf\u673a\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u5782\u76f4\u4e8e\u65b9\u5411 \\(\\mathbf{n}\\) \u7684\u5e73\u9762\u96c6\u7684\u6d88\u5f71\u7ebf\u662f \\(\\mathbf{l}=K^{-\\top}\\mathbf{n}\\) \u4e24\u6761\u666f\u7269\u76f4\u7ebf\u4e4b\u95f4\u7684\u5939\u89d2 \uff1a\u4ee4 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u662f\u4e00\u5e45\u56fe\u50cf\u4e2d\u4e24\u6761\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4ee4 \\(\\omega\\) \u4e3a\u56fe\u50cf\u4e2d\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\u3002\u5982\u679c \\(\\theta\\) \u662f\u4e24\u76f4\u7ebf\u65b9\u5411\u95f4\u7684\u5939\u89d2\uff0c\u5219 \\[ \\cos \\theta = \\frac{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2}{\\sqrt{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_1} \\sqrt{\\mathbf{v}_2^\\top \\omega \\mathbf{v}_2}} \\] \u6b63\u4ea4\u6027\u5173\u7cfb \u5177\u6709\u5782\u76f4\u65b9\u5411\u7684\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2=0\\) \u4e00\u5f20\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u53ef\u4ee5\u6309\u516c\u5f0f \\(\\mathbf{v}=\\omega^*\\mathbf{l}\\) \u7531\u5e73\u9762\u7684\u6d88\u5f71\u7ebf \\(\\mathbf{l}\\) \u83b7\u5f97\uff1b\u53cd\u4e4b\u6709 \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \u4e24\u5782\u76f4\u5e73\u9762\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{l}_1^\\top \\omega^* \\mathbf{l}_2=0\\) \u7531\u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf\u786e\u5b9a\u6807\u5b9a K \u00b6 \u5982\u679c \\(s=K_{12}=0\\) \uff0c\u5e76\u4e14 \\([\\omega_{ij}]=\\omega=K^{-\\top}K^{-1}\\) \uff0c\u90a3\u4e48 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u5982\u679c\u8fd8\u6ee1\u8db3 \\(\\alpha_x=K_{11}=K_{22}=\\alpha_y\\) \uff0c\u90a3\u4e48 \\(\\omega_{11}=\\omega_{22}\\) \u7531\u4e09\u4e2a\u6b63\u4ea4\u6d88\u5f71\u70b9\u7ed9\u5b9a\u7684\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \u9996\u5148\u6784\u4f5c\u9876\u70b9\u4e3a\u4e09\u4e2a\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2,\\mathbf{v}_3\\) \u7684\u4e09\u89d2\u5f62 \\(C\\) \u7684\u4e2d\u5fc3\u662f\u4e09\u89d2\u5f62\u7684\u5782\u5fc3 \u5173\u4e8e\u4e2d\u5fc3\u53cd\u5c04\u5176\u4e2d\u7684\u4e00\u4e2a\u6d88\u5f71\u70b9\uff08\u4f8b\u5982 \\(\\mathbf{v}_1\\) \uff09\u5f97\u5230 \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u6839\u636e\u6761\u4ef6\uff1a \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u7684\u6781\u7ebf\u8fc7 \\(\\mathbf{v}_2, \\mathbf{v}_3\\) \u6765\u786e\u5b9a \\(C\\) \u7684\u534a\u5f84","title":"\u5355\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/one-vg/#_1","text":"\u7ea6 3225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u5728\u900f\u89c6\u6295\u5f71\u4e0b\u5176\u4ed6\u7684 3D \u51e0\u4f55\u5b9e\u4f53\u4e0e\u5176 2D \u56fe\u50cf\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u8fd9\u4e9b\u5b9e\u4f53\u5305\u62ec\u5e73\u9762\u3001\u76f4\u7ebf\u3001\u4e8c\u6b21\u66f2\u7ebf\u3001\u4e8c\u6b21\u66f2\u9762\uff0c\u5c06\u63a8\u5bfc\u5b83\u4eec\u7684\u6b63\u5411\u548c\u53cd\u5411\u6295\u5f71\u7684\u6027\u8d28","title":"\u5355\u89c6\u56fe\u51e0\u4f55"},{"location":"cv/mvg/one-vg/#_2","text":"","title":"\u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_3","text":"\u5047\u5b9a\u9009\u62e9 XY - \u5e73\u9762\u4e0e\u666f\u7269\u4e2d\u7684\u5e73\u9762 \\(\\pi\\) \u5bf9\u5e94\uff0c\u4f7f\u5f97\u5e73\u9762\u4e0a\u7684\u70b9 \\(Z\\) \u5750\u6807\u4e3a\u96f6\u3002 \\(\\mathbf{x}=P\\mathbf{X}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\ \\mathbf{p}_3 \\ \\mathbf{p}_4] \\begin{bmatrix} X \\\\ Y \\\\ 0 \\\\ 1 \\end{bmatrix}=[\\mathbf{p}_1 \\ \\mathbf{p}_2 \\mathbf{p}_4]\\begin{bmatrix} X \\\\ Y \\\\ 1 \\end{bmatrix}\\) \u5373 \\(\\mathbf{x}=H\\mathbf{x}_\\pi\\) \u3002\u5728\u900f\u89c6\u5f71\u50cf\u4e0b\uff0c\u4e00\u5f20\u666f\u7269\u5e73\u9762\u4e0e\u4e00\u5f20\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u6700\u4e00\u822c\u7684\u53d8\u6362\u662f\u5e73\u9762\u5c04\u5f71\u53d8\u6362","title":"\u5bf9\u5e73\u9762\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_4","text":"\u6b63\u5411\u6295\u5f71 \uff1a \\(\\mathbf{A}\\) \u548c \\(\\mathbf{B}\\) \u662f 3 \u7ef4\u7a7a\u95f4\u7684\u70b9\uff0c\u800c \\(\\mathbf{a},\\mathbf{b}\\) \u662f\u5b83\u4eec\u5728 \\(P\\) \u4f5c\u7528\u4e0b\u7684\u56fe\u50cf\uff1a \\(\\mathbf{x}(\\mu)=P(\\mathbf{A}+\\mu \\mathbf{B})=P\\mathbf{A}+\\mu P \\mathbf{B}=\\mathbf{a} + \\mu \\mathbf{b}\\) \u76f4\u7ebf\u7684\u53cd\u5411\u6295\u5f71 \uff1a\u7ecf\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u6620\u5c04\u6210\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}\\) \u7684\u7a7a\u95f4\u7684\u70b9\u96c6\u662f\u5e73\u9762 \\(P^\\top\\mathbf{l}\\) Pl\u00fccker \u76f4\u7ebf\u8868\u793a \u4e00\u6761\u7528 Pl\u00fccker \u77e9\u9635 \\(L\\) \u8868\u793a\u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\uff0c\u5728\u6444\u50cf\u673a\u6620\u5c04 \\(P\\) \u4f5c\u7528\u4e0b\u88ab\u6620\u5c04\u6210\u6ee1\u8db3 \\([\\mathbf{l}]_\\times=PLP^\\top\\) \u7684\u76f4\u7ebf \u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u662f\u79e9\u4e3a 3 \u7684 \\(3 \\times 6\\) \u77e9\u9635\uff0c\u5373 \\(P=\\begin{bmatrix} \\mathbf{P}^2 \\wedge \\mathbf{P}^3 \\\\ \\mathbf{P}^3 \\wedge \\mathbf{P}^1 \\\\ \\mathbf{P}^1 \\wedge \\mathbf{P}^2 \\end{bmatrix}\\) \uff0c\u5176\u4e2d \\(\\mathbf{P}^{i\\top}\\) \u662f\u70b9\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u884c\uff0c\u800c \\(\\mathbf{P}^i \\wedge \\mathbf{P}^j\\) \u662f\u5e73\u9762 \\(\\mathbf{P}^i\\) \u4e0e \\(\\mathbf{P}^j\\) \u7684\u4ea4\u7ebf\u7684 Pl\u00fccker \u5750\u6807 \u5728\u7ebf\u6295\u5f71\u77e9\u9635 \\(P\\) \u4f5c\u7528\u4e0b\uff0c \\(IP^3\\) \u4e2d\u7528 Pl\u00fccker \u5750\u6807\u8868\u793a\u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u88ab\u6620\u5c04\u5bfc\u56fe\u50cf\u76f4\u7ebf\uff1a \\(\\mathbf{l}=P\\mathcal{L}=\\begin{bmatrix} (\\mathbf{P}^2 \\wedge \\mathbf{P}^3 | \\mathcal{L}) \\\\ (\\mathbf{P}^3 \\wedge \\mathbf{P}^1 | \\mathcal{L}) \\\\ (\\mathbf{P}^1 \\wedge \\mathbf{P}^2 | \\mathcal{L}) \\end{bmatrix}\\) \\(IP^3\\) \u4e2d\u6ee1\u8db3 \\(P\\mathcal{L}=\\mathbf{0}\\) \u7684\u76f4\u7ebf \\(\\mathcal{L}\\) \u5fc5\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3","title":"\u5bf9\u76f4\u7ebf\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_5","text":"\u5728\u6444\u50cf\u673a \\(P\\) \u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53cd\u5411\u6295\u5f71\u6210\u9525\u9762: \\(Q_{CO}=P^\\top CP\\)","title":"\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_6","text":"\u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u5b9a\u4e49\u4e3a\u5f71\u50cf\u5c04\u7ebf\u4e0e \\(S\\) \u7684\u6240\u6709\u5207\u70b9 \\(\\mathbf{X}\\) \u7684\u96c6\u5408\u3002\u5728\u56fe\u50cf\u4e0a\uff0c\u4e0e\u5b83\u5bf9\u5e94\u7684 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u662f \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u96c6\u5408\uff0c\u5373 \\(\\gamma\\) \u662f \\(\\Gamma\\) \u7684\u56fe\u50cf \u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u4ec5\u53d6\u51b3\u4e8e\u6444\u50cf\u673a\u4e2d\u5fc3\u4e0e\u66f2\u9762\u7684\u76f8\u5bf9\u4f4d\u7f6e\uff0c\u800c\u4e0e\u56fe\u50cf\u5e73\u9762\u65e0\u5173 \u89c6\u5728\u8f6e\u5ed3\u7ebf \\(\\gamma\\) \u7531\u56fe\u50cf\u5e73\u9762\u4e0e\u8f6e\u5ed3\u751f\u6210\u5143\u7684\u5c04\u7ebf\u7684\u76f8\u4ea4\u786e\u5b9a\uff0c\u56e0\u6b64\u4e0e\u56fe\u50cf\u5e73\u9762\u6709\u5173","title":"\u5149\u6ed1\u66f2\u9762\u7684\u56fe\u50cf"},{"location":"cv/mvg/one-vg/#_7","text":"\u4e8c\u6b21\u66f2\u9762\u7684\u6b63\u5411\u6295\u5f71 \u5728\u6444\u50cf\u673a\u77e9\u9635 \\(P\\) \u7684\u4f5c\u7528\u4e0b\uff0c\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u5916\u5f62\u7ebf\u662f\u4e0b\u5f0f\u7ed9\u5b9a\u7684\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(C^*=PQ^*P^\\top\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u548c\u4e2d\u5fc3\u4e3a \\(C\\) \u7684\u6444\u50cf\u673a\u76f8\u5bf9\u5e94\u7684\u8f6e\u5ed3\u751f\u6210\u5143 \\(\\Gamma\\) \u7684\u5e73\u9762\u662f \\(\\pi_\\Gamma=QC\\) \u9876\u70b9\u4e3a \\(\\mathbf{V}\\) \u5e76\u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u76f8\u5207\u7684\u9525\u9762\u662f\u4e00\u4e2a\u9000\u5316\u7684\u4e8c\u6b21\u66f2\u9762 \\(Q_{CO}=(\\mathbf{V}^\\top Q\\mathbf{V})Q-(Q\\mathbf{V})(Q\\mathbf{V})^\\top\\) \uff0c\u5f53 \\(Q_{CQ}\\mathbf{V}=\\mathbf{0}\\) \u65f6\uff0c \\(\\mathbf{V}\\) \u6b63\u662f\u6240\u8981\u6c42\u7684\u9525\u9762\u7684\u9876\u70b9","title":"\u5c04\u5f71\u6444\u50cf\u673a\u5bf9\u4e8c\u6b21\u66f2\u9762\u7684\u4f5c\u7528"},{"location":"cv/mvg/one-vg/#_8","text":"3 \u7ef4\u7a7a\u95f4\u7684\u7269\u4f53\u548c\u6444\u50cf\u673a\u4e2d\u5fc3\u786e\u5b9a\u4e86\u4e00\u4e2a\u5c04\u7ebf\u96c6\u5408\uff0c\u800c\u8fd9\u4e9b\u5c04\u7ebf\u4e0e\u4e00\u5f20\u5e73\u9762\u7684\u4ea4\u5c31\u4ea7\u751f\u8be5\u7269\u4f53\u7684\u56fe\u50cf\uff0c\u8fd9\u4e2a\u96c6\u5408\u901a\u5e38\u79f0\u4e3a \u5c04\u7ebf\u9525 \u5047\u8bbe\u5c04\u7ebf\u9525\u4e0e\u4e24\u5f20\u5e73\u9762\u76f8\u4ea4\uff0c\u90a3\u4e48\u6240\u5f97\u4e24\u5e45\u56fe\u50cf \\(\\mathbf{I}\\) \u548c \\(\\mathbf{I}^\\prime\\) \u663e\u7136\u4ee5\u4e00\u4e2a\u900f\u89c6\u6620\u5c04\u76f8\u5173\u8054\u3002\u56e0\u4e3a\u6444\u50cf\u673a\u6709\u5171\u540c\u7684\u4e2d\u5fc3\uff0c\u4ece\u800c\u7531\u8fd9\u4e24\u4e2a\u6444\u50cf\u673a\u4ea7\u751f\u7684 3 \u7ef4\u7a7a\u95f4\u70b9 \\(\\mathbf{X}\\) \u7684\u56fe\u50cf\u4e4b\u95f4\u7684\u5173\u7cfb\uff1a \\(\\mathbf{x}^\\prime=P^\\prime \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1}P \\mathbf{X}=(K^\\prime R^\\prime)(KR)^{-1} \\mathbf{x}\\) \uff0c\u5bf9\u5e94\u7684\u56fe\u50cf\u70b9\u4ee5\u4e00\u4e2a\u5f62\u5982 \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \u7684\u5e73\u9762\u5355\u5e94( \\(3 \\times 3\\) \u77e9\u9635)\u76f8\u5173\u8054\uff0c\u5176\u4e2d \\(H=(K^\\prime R^\\prime)(KR)^{-1}\\)","title":"\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u91cd\u8981\u6027"},{"location":"cv/mvg/one-vg/#_9","text":"\u8003\u8651\u7126\u8ddd\u589e\u52a0\u7684\u60c5\u51b5\uff0c\u5728\u4e00\u9636\u8fd1\u4f3c\u7684\u7cbe\u5ea6\u4e0b\uff0c\u5b83\u76f8\u5f53\u4e8e\u56fe\u50cf\u5e73\u9762\u6cbf\u4e3b\u8f74\u79fb\u52a8 \u56e0\u5b50 \\(k=f^\\prime/f\\) \u7684\u53d8\u7126\u6548\u679c\u7b49\u4e8e\u7528 \\(diag(k,k,1)\\) \u53f3\u4e58\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\)","title":"\u79fb\u52a8\u56fe\u50cf\u5e73\u9762"},{"location":"cv/mvg/one-vg/#_10","text":"\u6444\u50cf\u673a\u5728\u4e0d\u6539\u53d8\u5b83\u7684\u5185\u90e8\u53c2\u6570\u7684\u60c5\u51b5\u4e0b\u7ed5\u5b83\u7684\u4e2d\u5fc3\u65cb\u8f6c\u3002\u5982\u679c\u70b9 \\(\\mathbf{X}\\) \u5728\u7eaf\u65cb\u8f6c\u524d\u548c\u540e\u7684\u56fe\u50cf\u662f \\(\\mathbf{x}\\) \u548c \\(\\mathbf{x}^\\prime\\) \uff0c\u90a3\u4e48 \\(\\mathbf{x}^\\prime=K[R|\\mathbf{0}]\\mathbf{X}=KRK^{-1}K[\\mathbf{I}|\\mathbf{0}]\\mathbf{X}=KRK^{-1}\\mathbf{x}\\) \uff0c\u56e0\u6b64\uff0c \\(\\mathbf{x}^\\prime=H\\mathbf{x}\\) \uff0c\u5176\u4e2d \\(H=KRK^{-1}\\) \u8fd9\u79cd\u5355\u5e94\u662f\u4e00\u4e2a\u5171\u8f6d\u65cb\u8f6c","title":"\u6444\u50cf\u673a\u65cb\u8f6c"},{"location":"cv/mvg/one-vg/#_11","text":"","title":"\u5e94\u7528\u4e0e\u4e3e\u4f8b"},{"location":"cv/mvg/one-vg/#_12","text":"\u53ef\u4ee5\u5bf9\u73b0\u6709\u7684\u56fe\u50cf\u8fdb\u884c\u5e73\u9762\u5355\u5e94\u6027\u7684\u5f62\u53d8\u63d2\u8865\u6765\u4ea7\u751f\u65b0\u7684\u56fe\u50cf\uff0c\u65b0\u7684\u56fe\u50cf\u5bf9\u5e94\u4e8e\u4e0d\u540c\u7684\u6444\u50cf\u673a\u5b9a\u5411(\u4f46\u6444\u50cf\u673a\u4e2d\u5fc3\u76f8\u540c) \u8ba1\u7b97\u628a\u56fe\u50cf\u4e2d\u7684\u56db\u8fb9\u5f62\u6620\u5c04\u56de\u5177\u6709\u6b63\u786e\u957f\u5bbd\u6bd4\u77e9\u5f62\u7684\u5355\u5e94 H \u7528\u8fd9\u4e2a\u5355\u5e94\u5bf9\u539f\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865","title":"\u89c6\u56fe\u5408\u6210"},{"location":"cv/mvg/one-vg/#_13","text":"\u6444\u50cf\u673a\u7ed5\u5176\u4e2d\u5fc3\u65cb\u8f6c\u6240\u5f97\u5230\u7684\u4e00\u7ec4\u56fe\u50cf\u4e4b\u95f4\u4ee5\u4e00\u4e2a\u5e73\u9762\u5355\u5e94\u76f8\u5173\u8054\u3002\u8fd9\u6837\u7684\u4e00\u7ec4\u56fe\u50cf\u53ef\u4ee5\u901a\u8fc7\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\u4e0e\u5176\u4e2d\u4e00\u5e45\u56fe\u50cf\u7684\u5e73\u9762\u914d\u51c6\u3002 \u9009\u62e9\u56fe\u50cf\u96c6\u5408\u4e2d\u7684\u4e00\u5e45\u4f5c\u4e3a\u53c2\u8003\u56fe\u50cf \u5728\u5176\u4f59\u7684\u56fe\u50cf\u4e2d\u9009\u4e00\u5e45\u56fe\u50cf\uff0c\u8ba1\u7b97\u628a\u5b83\u6620\u5c04\u5230\u53c2\u8003\u56fe\u50cf\u7684\u5355\u5e94 H \u7528\u5f97\u5230\u7684\u5355\u5e94\u5bf9\u8fd9\u5e45\u56fe\u50cf\u8fdb\u884c\u5c04\u5f71\u5f62\u53d8\u63d2\u8865\uff0c\u5e76\u4e14\u7528\u63d2\u8865\u56fe\u50cf\u4e0e\u53c2\u8003\u56fe\u50cf\u7684\u975e\u91cd\u53e0\u90e8\u5206\u6765\u6269\u5927\u53c2\u8003\u56fe\u50cf \u5bf9\u56fe\u50cf\u96c6\u5408\u4e2d\u4f59\u4e0b\u7684\u56fe\u50cf\u91cd\u590d\u4e0a\u8ff0\u6700\u540e\u4e24\u6b65\u8fc7\u7a0b","title":"\u5e73\u9762\u5168\u666f\u62fc\u56fe"},{"location":"cv/mvg/one-vg/#_14","text":"\u5982\u679c\u4e16\u754c\u548c\u56fe\u50cf\u70b9\u90fd\u9009\u62e9\u89c4\u8303\u7684\u5c04\u5f71\u5750\u6807\u90a3\u4e48\u6444\u50cf\u673a\u77e9\u9635\uff1a \\(P=\\begin{bmatrix} a & 0 & 0 & -d \\\\ 0 & b & 0 & -d \\\\ 0 & 0 & c & -d \\end{bmatrix}\\) \u6ee1\u8db3 \\(\\mathbf{x}_i=P\\mathbf{X}_i,i=1,...,4\\) \u548c \\(P(a^{-1},b^{-1},c^{-1},d^{-1})^\\top=\\mathbf{0}\\) \uff0c\u540e\u8005\u8868\u793a\u6444\u50cf\u673a\u4e2d\u5fc3\u662f \\(\\mathbf{C}=(a^{-1},b^{-1},c^{-1},d^{-1})^\\top\\)","title":"\uff08\u7b80\u5316\u7684\uff09\u5c04\u5f71\u8bb0\u53f7"},{"location":"cv/mvg/one-vg/#_15","text":"\u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u91cd\u5408\u7684\u4e24\u4e2a 3 \u7ef4\u7a7a\u95f4\u70b9.\u90ce\u5728\u540c\u4e00\u5c04\u7ebf\u4e0a\u7684\u70b9\u3002\u5982\u679c\u6444\u50cf\u673a\u4e2d\u5fc3\u88ab\u79fb\u52a8\u4e86(\u6ca1\u6709\u6cbf\u7740\u8fd9\u6761\u5c04\u7ebf) \uff0c\u90a3\u4e48\u5176\u56fe\u50cf\u5c31\u4e0d\u518d\u91cd\u5408\u4e86\u3002\u539f\u6765\u662f\u91cd\u5408\u7684\u56fe\u50cf\u70b9\u4e4b\u95f4\u7684\u76f8\u5bf9\u4f4d\u79fb\u79f0\u4e3a\u89c6\u5dee\u3002","title":"\u79fb\u52a8\u6444\u50cf\u673a\u4e2d\u5fc3"},{"location":"cv/mvg/one-vg/#_16","text":"\u6444\u50cf\u673a\u6807\u5b9a\u77e9\u9635 \\(K\\) \u662f \\(\\mathbf{x}\\) \u4e0e\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\u6d4b\u91cf\u7684\u5c04\u7ebf\u65b9\u5411 \\(\\mathbf{d}=K^{-1}\\mathbf{x}\\) \u4e4b\u95f4\u7684\u4e00\u4e2a\uff08\u4eff\u5c04\uff09\u53d8\u6362 \u4e00\u6761\u56fe\u50cf\u76f4\u7ebf \\(\\mathbf{l}\\) \u786e\u5b9a\u4e00\u5f20\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5e73\u9762\uff0c\u5728\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u8be5\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}=K^\\top \\mathbf{l}\\)","title":"\u6444\u50cf\u673a\u6807\u5b9a\u4e0e\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf"},{"location":"cv/mvg/one-vg/#_17","text":"\\(\\pi_\\infty\\) \u4e0e\u56fe\u50cf\u5e73\u9762\u4e4b\u95f4\u7684\u6620\u5c04\u7531\u5e73\u9762\u5355\u5e94 \\(\\mathbf{x}=H\\mathbf{d}\\) \u7ed9\u51fa\uff0c\u5176\u4e2d \\(H=KR\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08\u7b80\u79f0 IAC\uff09\u662f\u4e8c\u6b21\u66f2\u7ebf \\(\\omega=(KK^\\top)^{-1}=K^{-\\top}K^{-1}\\) \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u5bf9\u5076\u56fe\u50cf\uff08\u7b80\u79f0 DIAC\uff09\u4e3a \\(\\omega^*=\\omega^{-1}=KK^\\top\\) \u4e00\u4e2a\u7b80\u5355\u7684\u6807\u5b9a\u88c5\u7f6e \u88c5\u7f6e\u91cc\u6709\u4e09\u4e2a\u6b63\u65b9\u5f62\uff08\u5b83\u4eec\u6240\u5728\u5e73\u9762\u662f\u4e0d\u5e73\u884c\u7684\uff0c\u4f46\u4e5f\u4e0d\u5fc5\u6b63\u4ea4\uff09\u7684\u56fe\u50cf\u63d0\u4f9b\u8ba1\u7b97 \\(K\\) \u7684\u8db3\u591f\u7ea6\u675f \u5bf9\u6bcf\u4e2a\u6b63\u65b9\u5f62\uff0c\u8ba1\u7b97\u628a\u5b83\u7684\u89d2\u70b9 \\((0,0)^\\top\u3001(1,0)\u3001(0,1)\u3001(1,1)^\\top\\) \u6620\u5c04\u5230\u76f8\u5e94\u7684\u56fe\u50cf\u70b9\u7684\u5355\u5e94 \\(H\\) \u8ba1\u7b97\u8be5\u6b63\u65b9\u5f62\u6240\u5728\u5e73\u9762\u865a\u5706\u70b9\u7684\u56fe\u50cf\uff0c\u5373 \\(H(1,\\pm i,0)^\\top\\) \u7531\u8fd9\u516d\u4e2a\u865a\u5706\u70b9\u7684\u56fe\u50cf\u62df\u5408\u51fa\u4e00\u6761\u4e8c\u6b21\u66f2\u7ebf \\(\\omega\\) \u7528 Cholesky \u5206\u89e3\u7531 \\(\\omega=(KK^\\top)^{-1}\\) \u8ba1\u7b97\u6807\u5b9a \\(K\\) \u56fe\u50cf\u4e2d\u7684\u6b63\u4ea4\u6027 \u5982\u679c\u56fe\u50cf\u70b9\u5173\u4e8e \\(\\omega\\) \u5171\u8f6d\uff0c\u5373\u5982\u679c \\(\\mathbf{x}_1^\\top \\omega \\mathbf{x}_2 = 0\\) \uff0c\u90a3\u4e48\u8fd9\u4e24\u4e2a\u56fe\u50cf\u70b9\u5bf9\u5e94\u4e8e\u6b63\u4ea4\u7684\u65b9\u5411 \u5047\u5b9a\u76f4\u7ebf \\(\\mathbf{l}\\) \u53cd\u5411\u6295\u5f71\u5230\u6cd5\u7ebf\u65b9\u5411\u4e3a \\(\\mathbf{n}\\) \u7684\u5e73\u9762 \\(\\pi\\) \uff0c\u90a3\u4e48\u6cd5\u7ebf\u7684\u5f71\u50cf\u4e3a\u70b9 \\(K\\mathbf{n}\\) \uff0c\u800c\u4e14\u76f4\u7ebf \\(\\mathbf{l}\\) \u662f\u8be5\u70b9\u7684\u6781\u7ebf\uff0c\u56e0\u6b64 \\(\\mathbf{l}=\\omega K \\mathbf{n}=(KK^\\top)^{-1}K\\mathbf{n}=K^{-\\top}\\mathbf{n}\\) \uff0c\u5373 \\(\\pi\\) \u7684\u6cd5\u7ebf\u662f \\(\\mathbf{n}=K^\\top \\mathbf{l}\\)","title":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf"},{"location":"cv/mvg/one-vg/#_18","text":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\uff08IAC\uff09\u662f\u56fe\u50cf\u4e2d\u7684\u4e00\u6761\u865a\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e3a\u4e86\u53ef\u89c6\u5316\u7684\u76ee\u7684\uff0c\u8003\u8651\u4e0e\u6444\u50cf\u673a\u6807\u5b9a\u7d27\u5bc6\u76f8\u5173\u7684\u53e6\u5916\u4e00\u79cd\u66f2\u7ebf\uff0c\u8fd9\u6837\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4e3a \u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff0c\u5b83\u662f\u4e00\u4e2a\u9876\u89d2\u4e3a \\(45^\\circ\\) \u800c\u8f74\u4e3a\u6444\u50cf\u673a\u4e3b\u8f74\u7684\u5706\u9525\u9762\u7684\u56fe\u50cf\u3002\u8be5\u5706\u9525\u9762\u7684\u70b9\u6620\u5c04\u4e3a\u4e8c\u6b21\u66f2\u7ebf\uff1a \\[ C=K^{-\\top} \\begin{bmatrix} 1 & & \\\\ & 1 & \\\\ & & -1 \\end{bmatrix} K^{-\\top} \\] \u6b63\u4ea4\u6027\u548c\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \uff1a\u5982\u679c\u56fe\u50cf\u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u5bf9\u5e94\u4e8e\u5782\u76f4\u4e8e\u56fe\u50cf\u70b9 \\(\\mathbf{x}\\) \u7684\u5c04\u7ebf\u7684\u4e00\u4e2a\u5e73\u9762\uff0c\u90a3\u4e48\uff0c\u8fd9\u6761\u76f4\u7ebf\u662f \\(\\mathbf{x}\\) \u5173\u4e8e\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf\u7684\u53cd\u5c04\u70b9 \\(\\overset{\\cdot}{\\mathbf{x}}\\) \u7684\u6781\u7ebf \\(C\\overset{\\cdot}{\\mathbf{x}}\\)","title":"\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf"},{"location":"cv/mvg/one-vg/#_19","text":"\u900f\u89c6\u6295\u5f71\u7684\u4e00\u4e2a\u663e\u8457\u7279\u5f81\u662f\u5ef6\u4f38\u81f3\u65e0\u7a77\u8fdc\u7684\u7269\u4f53\u7684\u56fe\u50cf\u53ef\u80fd\u51fa\u73b0\u5728\u6709\u9650\u8303\u56f4 \u6d88\u5f71\u70b9 \u96c6\u5408\u4e0a\u4e00\u6761\u4e16\u754c\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u7531\u5e73\u884c\u4e8e\u8be5\u76f4\u7ebf\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9\u5f97\u5230\u3002\u56e0\u6b64\u6d88\u5f71\u70b9\u4ec5\u4f9d\u8d56\u4e8e\u76f4\u7ebf\u7684\u65b9\u5411\uff0c\u800c\u4e0e\u5176\u4f4d\u7f6e\u65e0\u5173\u3002\u5982\u679c\u4e16\u754c\u76f4\u7ebf\u5e73\u884c\u4e8e\u56fe\u50cf\u5e73\u9762\uff0c\u90a3\u4e48\u6d88\u5f71\u70b9\u5728\u56fe\u50cf\u7684\u65e0\u7a77\u8fdc\u5904\u3002 \u8be5\u4e16\u754c\u76f4\u7ebf\u53ef\u4ee5\u7528 \\(\\mathbf{X}(\\lambda)=\\mathbf{A}+\\lambda\\mathbf{D}\\) \u6765\u53c2\u6570\u5316\uff0c\u5176\u4e2d \\(\\mathbf{A}\\) \u662f\u76f4\u7ebf\u4e0a\u7684\u70b9\uff0c\u800c \\(\\mathbf{D}=(\\mathbf{d}^\\top,0)^\\top\\) \u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684 3 \u7ef4\u7a7a\u95f4\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u662f\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u4e14\u65b9\u5411\u4e3a \\(\\mathbf{d}\\) \u7684\u5c04\u7ebf\u4e0e\u56fe\u50cf\u5e73\u9762\u7684\u4ea4\u70b9 \\(\\mathbf{v}\\) \uff0c\u5373 \\(\\mathbf{v}=K\\mathbf{d}\\) \u7531\u6d88\u5f71\u70b9\u6c42\u6444\u50cf\u673a\u65cb\u8f6c \u6d88\u5f71\u70b9\u662f\u65e0\u7a77\u8fdc\u70b9\u7684\u56fe\u50cf\uff0c\u5b83\u63d0\u4f9b\u5b9a\u5411(\u59ff\u6001)\u4fe1\u606f\u7684\u65b9\u5f0f\u4e0e\u4e0d\u52a8\u661f\u63d0\u4f9b\u7684\u65b9\u5f0f\u7c7b\u4f3c\uff0c\u8003\u8651\u7531\u5b9a\u5411\u548c\u4f4d\u7f6e\u4e0d\u540c\u7684\u4e24\u4e2a\u6807\u5b9a\u6444\u50cf\u673a\u83b7\u53d6\u7684\u4e00\u4e2a\u666f\u7269\u7684\u4e24\u5e45\u56fe\u50cf\u3002\u65e0\u7a77\u8fdc\u70b9\u4f5c\u4e3a\u666f\u7269\u7684\u4e00\u90e8\u5206\u4e0e\u6444\u50cf\u673a\u65e0\u5173\u3002\u5b83\u4eec\u7684\u56fe\u50cf\uff0c\u5373\u6d88\u5f71\u70b9\uff0c\u4e0d\u53d7\u6444\u50cf\u673a\u4f4d\u7f6e\u53d8\u5316\u7684\u5f71\u54cd\uff0c\u4f46\u8981\u53d7\u6444\u50cf\u673a\u65cb\u8f6c\u7684\u5f71\u54cd\u3002 \u4ee4\u4e00\u6761\u666f\u7269\u76f4\u7ebf\u5728\u7b2c\u4e00\u5e45\u89c6\u56fe\u4e2d\u7684\u6d88\u5f71\u70b9\u662f \\(\\mathbf{v}_i\\) \uff0c\u5728\u7b2c\u4e8c\u5e45\u89c6\u56fe\u4e2d\u7684\u662f \\(\\mathbf{v}_i^\\prime\\) \uff0c\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i\\) \u5728\u7b2c\u4e00\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i=K^{-1}\\mathbf{v}_i / \\parallel K^{-1} \\mathbf{v}_i \\parallel\\) \uff0c\u800c\u5bf9\u5e94\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}_i^\\prime\\) \uff0c\u5728\u7b2c\u4e8c\u4e2a\u6444\u50cf\u673a\u7684\u6b27\u6c0f\u5750\u6807\u7cfb\u4e2d\u6d4b\u91cf\u5f97\u5230\u7684\u65b9\u5411\u662f \\(\\mathbf{d}_i^\\prime\\) \uff0c\u5219\u6444\u50cf\u673a\u7684\u65cb\u8f6c \\(\\mathbf{d}_i^\\prime=R\\mathbf{d}_i\\) \u6d88\u5f71\u7ebf 3 \u7ef4\u7a7a\u95f4\u7684\u5e73\u884c\u5e73\u9762\u4e0e \\(\\pi _\\infty\\) \u4ea4\u4e8e\u4e00\u6761\u516c\u5171\u7684\u76f4\u7ebf\uff0c\u800c\u8fd9\u6761\u76f4\u7ebf\u7684\u56fe\u50cf\u5c31\u662f\u5e73\u9762\u7684\u6d88\u5f71\u7ebf\u3002\u51e0\u4f55\u4e0a\uff0c\u6d88\u5f71\u7ebf\u7531\u5e73\u884c\u4e8e\u666f\u7269\u5e73\u9762\u5e76\u8fc7\u6444\u50cf\u673a\u4e2d\u5fc3\u7684\u4e00\u5f20\u5e73\u9762\u4e0e\u56fe\u50cf\u7684\u4ea4\u7ebf\u5f97\u5230\u3002\u663e\u7136\uff0c \u6d88\u5f71\u7ebf\u4ec5\u4e0e\u666f\u7269\u5e73\u9762\u7684\u5b9a\u5411\u6709\u5173\uff0c\u800c\u4e0e\u5b83\u7684\u4f4d\u7f6e\u65e0\u5173\u3002 \u5728\u6444\u50cf\u673a\u6b27\u6c0f\u5750\u6807\u7cfb\u4e0b\uff0c\u5782\u76f4\u4e8e\u65b9\u5411 \\(\\mathbf{n}\\) \u7684\u5e73\u9762\u96c6\u7684\u6d88\u5f71\u7ebf\u662f \\(\\mathbf{l}=K^{-\\top}\\mathbf{n}\\) \u4e24\u6761\u666f\u7269\u76f4\u7ebf\u4e4b\u95f4\u7684\u5939\u89d2 \uff1a\u4ee4 \\(\\mathbf{v}_1,\\mathbf{v}_2\\) \u662f\u4e00\u5e45\u56fe\u50cf\u4e2d\u4e24\u6761\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\uff0c\u800c\u4ee4 \\(\\omega\\) \u4e3a\u56fe\u50cf\u4e2d\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf\u7684\u56fe\u50cf\u3002\u5982\u679c \\(\\theta\\) \u662f\u4e24\u76f4\u7ebf\u65b9\u5411\u95f4\u7684\u5939\u89d2\uff0c\u5219 \\[ \\cos \\theta = \\frac{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2}{\\sqrt{\\mathbf{v}_1^\\top \\omega \\mathbf{v}_1} \\sqrt{\\mathbf{v}_2^\\top \\omega \\mathbf{v}_2}} \\] \u6b63\u4ea4\u6027\u5173\u7cfb \u5177\u6709\u5782\u76f4\u65b9\u5411\u7684\u76f4\u7ebf\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{v}_1^\\top \\omega \\mathbf{v}_2=0\\) \u4e00\u5f20\u5e73\u9762\u7684\u6cd5\u7ebf\u65b9\u5411\u7684\u6d88\u5f71\u70b9 \\(\\mathbf{v}\\) \u53ef\u4ee5\u6309\u516c\u5f0f \\(\\mathbf{v}=\\omega^*\\mathbf{l}\\) \u7531\u5e73\u9762\u7684\u6d88\u5f71\u7ebf \\(\\mathbf{l}\\) \u83b7\u5f97\uff1b\u53cd\u4e4b\u6709 \\(\\mathbf{l}=\\omega \\mathbf{v}\\) \u4e24\u5782\u76f4\u5e73\u9762\u7684\u6d88\u5f71\u70b9\u6ee1\u8db3 \\(\\mathbf{l}_1^\\top \\omega^* \\mathbf{l}_2=0\\)","title":"\u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf"},{"location":"cv/mvg/one-vg/#k","text":"\u5982\u679c \\(s=K_{12}=0\\) \uff0c\u5e76\u4e14 \\([\\omega_{ij}]=\\omega=K^{-\\top}K^{-1}\\) \uff0c\u90a3\u4e48 \\(\\omega_{12}=\\omega_{21}=0\\) \uff0c\u5982\u679c\u8fd8\u6ee1\u8db3 \\(\\alpha_x=K_{11}=K_{22}=\\alpha_y\\) \uff0c\u90a3\u4e48 \\(\\omega_{11}=\\omega_{22}\\) \u7531\u4e09\u4e2a\u6b63\u4ea4\u6d88\u5f71\u70b9\u7ed9\u5b9a\u7684\u6807\u5b9a\u4e8c\u6b21\u66f2\u7ebf \u9996\u5148\u6784\u4f5c\u9876\u70b9\u4e3a\u4e09\u4e2a\u6d88\u5f71\u70b9 \\(\\mathbf{v}_1,\\mathbf{v}_2,\\mathbf{v}_3\\) \u7684\u4e09\u89d2\u5f62 \\(C\\) \u7684\u4e2d\u5fc3\u662f\u4e09\u89d2\u5f62\u7684\u5782\u5fc3 \u5173\u4e8e\u4e2d\u5fc3\u53cd\u5c04\u5176\u4e2d\u7684\u4e00\u4e2a\u6d88\u5f71\u70b9\uff08\u4f8b\u5982 \\(\\mathbf{v}_1\\) \uff09\u5f97\u5230 \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u6839\u636e\u6761\u4ef6\uff1a \\(\\overset{\\cdot}{\\mathbf{v}}_1\\) \u7684\u6781\u7ebf\u8fc7 \\(\\mathbf{v}_2, \\mathbf{v}_3\\) \u6765\u786e\u5b9a \\(C\\) \u7684\u534a\u5f84","title":"\u7531\u6d88\u5f71\u70b9\u548c\u6d88\u5f71\u7ebf\u786e\u5b9a\u6807\u5b9a K"},{"location":"cv/mvg/pjt2d/","text":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u00b6 \u7ea6 4639 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecdMVG\u6240\u5fc5\u987b\u7684\u51e0\u4f55\u6982\u5ff5\u548c\u7b26\u53f7\uff0c\u5177\u4f53\u6db5\u76d6\u5e73\u9762\u7684\u5c04\u5f71\u53d8\u6362\u51e0\u4f55 \u5e73\u9762\u51e0\u4f55 \u00b6 2D \u5c04\u5f71\u5e73\u9762 \u00b6 \u70b9\u4e0e\u76f4\u7ebf \u00b6 \u76f4\u7ebf\u7684\u5176\u6b21\u8868\u793a \u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u65b9\u7a0b \\(ax+by+c=0\\) \u53ef\u4ee5\u7528\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u8868\u793a\u3002 \u5bf9\u4efb\u4f55\u975e\u96f6\u7684k\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u4e0e \\(k(a,b,c)^{\\top}\\) \u8868\u793a\u540c\u4e00\u76f4\u7ebf \u3002 \u70b9\u7684\u5176\u6b21\u8868\u793a \u4e00\u4e2a\u70b9\u7684\u4efb\u4f55\u9f50\u6b21\u77e2\u91cf\u7684\u8868\u793a\u5f62\u5f0f\u4e3a \\(x=(x_1,x_2,x_3)^{\\top}\\) \uff0c\u975e\u9f50\u6b21\u5750\u6807 \\(x=(\\frac{x_1}{x_3}, \\frac{x_2}{x_3})^{\\top}\\) \u3002 \u7ed3\u8bba1 \u70b9 \\(x\\) \u5728\u76f4\u7ebf \\(l\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(x^{\\top}l=0\\) \u3002 \\(x^{\\top}l = l^{\\top}x = x \\cdot l = 0\\) \u3002 \u7ed3\u8bba2 \u4e24\u76f4\u7ebf \\(l\\) \u548c \\(l^{\\prime}\\) \u7684\u4ea4\u70b9\u662f\u70b9 \\(x=l \\times l^{\\prime}\\) \u3002 \u53c9\u4e58 \\[c = a \\times b = (a.y * b.z - b.y * a.z, \\quad b.x * a.z - a.x * b.z, \\quad a.x * b.y - b.x * a.y)\\] \u7ed3\u8bba3 \u8fc7\u4e24\u70b9 \\(x\\) \u548c \\(x^{\\prime}\\) \u7684\u76f4\u7ebf\u662f \\(l = x \\times x^{\\prime}\\) \u3002 \u5e73\u884c\u7ebf\u7684\u4ea4\u70b9 \u4e24\u5e73\u884c\u76f4\u7ebf \\(ax+by+c=0\\) \u548c \\(ax+by+c^{\\prime}=0\\) \uff0c\u7531 \u7ed3\u8bba2 \u53ef\u5f97\u4ea4\u70b9 \\((b, -a, 0)^{\\top}\\) \u3002 \u7406\u60f3\u70b9\u548c\u65e0\u7a77\u8fdc\u7ebf \u5f53\u9f50\u6b21\u77e2\u91cf \\(x = (x_1, x_2, x_3)^{\\top}\\) \u4e2d\u7684 \\(x_3=0\\) \u65f6\u7684\u70b9\u88ab\u79f0\u4e3a \u7406\u60f3\u70b9 \uff0c\u6216 \u65e0\u7a77\u8fdc\u70b9 \u3002\u6240\u6709\u7406\u60f3\u70b9\u96c6\u5408\u5728\u4e00\u6761\u76f4\u7ebf\u4e0a\uff0c\u79f0 \u65e0\u7a77\u8fdc\u7ebf \uff0c\u7528 \\(I_{\\infty}=(0,0,1)^{\\top}\\) \u8868\u793a\u3002 \u5c04\u5f71\u5e73\u9762\u6a21\u578b \\(IP^2\\) \u7684\u70b9\u548c\u7ebf\u5206\u522b\u4e3a\u4e2d\u8fc7\u539f\u70b9\u7684\u5c04\u7ebf\u548c\u5e73\u9762 \\(x_1x_2\\) \u5e73\u9762\u4e0a\u7684\u5c04\u7ebf\u8868\u793a\u7406\u60f3\u70b9\uff0c\u800c \\(x_1x_2\\) \u5e73\u9762\u8868\u793a \\(I_{\\infty}\\) \u3002 \u7ed3\u8bba4\uff08\u5bf9\u5076\u539f\u7406\uff09 2\u7ef4\u5c04\u5f71\u51e0\u4f55\u4e2d\u7684\u4efb\u4f55\u5b9a\u7406\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u5bf9\u5076\u5b9a\u7406\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u4e92\u6362\u539f\u5b9a\u7406\u4e2d\u70b9\u548c\u7ebf\u7684\u4f5c\u7528\u800c\u5bfc\u51fa\u3002 \u4e8c\u6b21\u66f2\u7ebf\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \u00b6 \u4e8c\u6b21\u66f2\u7ebf \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b: \u53cc\u66f2\u7ebf\uff0c\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002 \u5728\u975e\u9f50\u6b21\u5750\u6807\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u7684\u65b9\u7a0b\u662f \\[ax^2+bxy+cy^2+dx+ey+f=0\\] \u901a\u8fc7\u66ff\u4ee3 \\(x\\to\\frac{x_1}{x_3}\\) \uff0c \\(y\\to\\frac{x_2}{x_3}\\) \uff0c\u5f97\u5230\uff1a \\[ax_1^2+bx_1x_2+cx_2^2+dx_1x_3+ex_2x_3+fx_3^2=0\\] \u8868\u793a\u6210\u77e9\u9635\u5f62\u5f0f\u4e3a \\(x^{\\top}Cx=0\\) \u5176\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u7cfb\u6570\u77e9\u9635 \\(C\\) \u4e3a \\[ C = \\left[ \\begin{matrix} a & b/2 & d/2 \\\\ b/2 & c & e/2 \\\\ d/2 & e/2 & f \\end{matrix} \\right] \\] \u7ed3\u8bba5 \u8fc7(\u975e\u9000\u5316)\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u4e0a\u70b9 \\(x\\) \u7684\u5207\u7ebf \\(l\\) \u7531 \\(l=Cx\\) \u786e\u5b9a\u3002 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \u4e0a\u9762\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u66f4\u786e\u5207\u5730\u5e94\u79f0\u4e3a\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u56e0\u4e3a\u5b83\u5b9a\u4e49\u7684\u662f\u70b9\u7684\u65b9\u7a0b\u3002\u540c\u65f6\u8fd9\u79cd \u5bf9\u5076 \uff08\u6216\u7ebf\uff09\u4e8c\u6b21\u66f2\u7ebf\u4e5f\u7531\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u8868\u793a\uff0c\u6211\u4eec\u628a\u5b83\u8bb0\u4e3a \\(C^*\\) \uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u5207\u7ebf \\(l\\) \u6ee1\u8db3 \\(l^{\\top}C^*l=0\\) \u3002\u5176\u4e2d \\(C^*\\) \u8868\u793a\u4e3a \\(C\\) \u7684\u4f34\u968f\u77e9\u9635\u3002 \u9000\u5316\u4e8c\u6b21\u66f2\u7ebf \u975e\u6ee1\u79e9\u77e9\u9635 \\(C\\) \u6240\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4f5c\u9000\u5316\u4e8c\u6b21\u66f2\u7ebf\u3002\u9000\u5316\u7684\u70b9\u4e8c\u6b21\u66f2\u7ebf\u5305\u542b\u4e24\u6761\u7ebf(\u79e9 2) \u6216\u4e00\u6761\u91cd\u7ebf(\u79e9 1) \u3002 \u5c04\u5f71\u53d8\u6362 \u00b6 \u5c04\u5f71\u6620\u5c04 \u5c04\u5f71\u6620\u5c04 \u662f \\(IP^2\\) \u5230\u5b83\u81ea\u8eab\u7684\u4e00\u79cd\u6ee1\u8db3\u4e0b\u5217\u6761\u4ef6\u7684\u53ef\u9006\u6620\u5c04 \\(h\\) \uff1a\u4e09\u70b9 \\(x_1\\) , \\(x_2\\) \u548c \\(x_3\\) \u5171\u7ebf\u5f53\u4e14\u4ec5\u5f53 \\(h(x_1)\\) , \\(h(x_2)\\) , \\(h(x_3)\\) \u4e5f\u5171\u7ebf\u3002 \u5c04\u5f71\u6620\u5c04\u4e5f\u79f0\u4e3a\u4fdd\u7ebf\u53d8\u6362 \uff0c\u6216\u5c04\u5f71\u53d8\u6362\u6216\u5355\u5e94 (homography) \u3002 \u5b9a\u74061 \u6620\u5c04 \\(h\\) \uff1a \\(IP^2 \\to IP^2\\) \u662f\u5c04\u5f71\u6620\u5c04\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b58\u5728\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(H\\) \uff0c\u4f7f\u5f97 \\(IP^2\\) \u7684\u4efb\u4f55\u4e00\u4e2a\u7528\u77e2\u91cf \\(x\\) \u8868\u793a\u7684\u70b9\u90fd\u6ee1\u8db3 \\(h(x)=Hx\\) \u3002 \u5c04\u5f71\u53d8\u6362 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u662f\u5173\u4e8e\u9f50\u6b213\u7ef4\u77e2\u91cf\u7684\u4e00\u79cd\u7ebf\u6027\u53d8\u6362\uff0c\u5e76\u53ef\u7528\u4e00\u4e2a\u975e\u5947\u5f02 \\(3 \\times 3\\) \u77e9\u9635 \\(H\\) \u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x_1^\\prime \\\\ x_2^\\prime\\\\ x_3^\\prime \\end{pmatrix} = \\left[ \\begin{matrix} h_{11} & h_{12} & h_{13} \\\\ h_{21} & h_{22} & h_{23} \\\\ h_{31} & h_{32} & h_{33} \\end{matrix} \\right] \\begin{pmatrix} x_1 \\\\ x_2\\\\ x_3 \\end{pmatrix} \\] \u6216\u66f4\u7b80\u6d01\u5730\u8868\u793a\u4e3a \\(x^\\prime = Hx\\) \u3002 \u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362 \u00b6 \u76f4\u7ebf\u7684\u53d8\u6362 \\[l^\\prime = H^{-T}l\\] \u4e5f\u53ef\u4ee5\u5199\u6210 \\(l^{\\prime T}=l^{\\top}H^{-1}\\) \u3002\u76f4\u7ebf\u548c\u70b9\u53d8\u6362\u7684\u57fa\u672c\u533a\u522b\u5728\u4e8e\u70b9\u53d8\u6362\u4f9d\u636e \\(H\\) \uff0c\u800c\u76f4\u7ebf\uff08\u89c6\u4e3a\u884c\u77e2\u91cf\uff09\u53d8\u6362\u5219\u4f9d\u636e \\(H^{-1}\\) \u3002\u79f0\u70b9\u53d8\u6362\u4e3a \u9006\u53d8 \u800c\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c \\(x^{\\top}Cx = x^{\\prime T}[H^{-1}]^{\\top}CH^{-1}x^\\prime = x^{\\prime T} H^{-T}CH^{-1} x^{\\prime}\\) \u3002 \u7ed3\u8bba1 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53d8\u6362\u4e3a \\(C^\\prime = H^{-T}CH^{-1}\\) \u3002\uff08\u56e0\u4e3a\u5b58\u5728 \\(H^{-1}\\) \uff0c\u6240\u4ee5\u79f0\u4e8c\u6b21\u66f2\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \uff09 \u8bc1\u660e \\[ x^{\\top}Cx = (H^{-1}x^\\prime)^{\\top} C (H^{-1}x^\\prime) = x^{\\prime T} (H^{-T}CH^{-1}) x^\\prime \\] \u7ed3\u8bba2 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C^*\\) \u53d8\u6362\u4e3a \\(C^{*\\prime} = HC^* H^{\\top}\\) \u3002 \u8bc1\u660e \\[ l^{\\top}C^*l = (H^{\\top}l)^{\\top}C^*(H^{\\top}l)=l^{\\top}HC^*H^{\\top}l \\] \u53d8\u6362\u7684\u5c42\u6b21 \u00b6 \u2002\u2002\u7531 \\(n \\times n\\) \u53ef\u9006\u5b9e\u77e9\u9635\u7684\u7fa4\u79f0\u4e3a\uff08\u5b9e\u7684\uff09\u4e00\u822c\u7ebf\u6027\u7fa4\u6216 \\(GL(n)\\) \u3002\u5f53\uff0c \u628a\u76f8\u5dee\u975e\u96f6\u7eaf\u9760\u56e0\u5b50\u7684\u77e9\u9635\u90fd\u89c6\u4e3a\u7b49\u540c\u65f6\uff0c\u4fbf\u5f97\u5230\u5c04\u5f71\u7ebf\u6027\u7fa4\uff0c\u8bb0\u4e3a \\(PL(n)\\) (\u5b83\u662f \\(GL(n)\\) \u7684\u5546\u7fa4)\u3002\u5728\u5e73\u9762\u5c04\u5f71\u53d8\u6362\u65f6\uff0c \\(n=3\\) \u3002 \u7b49\u8ddd\u53d8\u6362 \u00b6 \u2002\u2002\u7b49\u8ddd(isometric)\u53d8\u6362\u662f\u5e73\u9762 \\(IR^2\\) \u7684\u53d8\u6362\uff0c\u4fdd\u6301\u6b27\u5f0f\u8ddd\u79bb\u4e0d\u53d8\uff0c\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u53ef\u8868\u793a\u4e3a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} \\varepsilon \\cos \\theta & -\\sin \\theta & t_x \\\\ \\varepsilon \\sin \\theta & \\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u5176\u4e2d \\(\\varepsilon = \\pm 1\\) \u3002\u5982\u679c \\(\\varepsilon = 1\\) \u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u4fdd\u5411\u7684 \u5e76\u4e14\u4e5f\u662f \u6b27\u6c0f \u53d8\u6362\uff08\u5e73\u79fb\u548c\u65cb\u8f6c\u7684\u590d\u5408\uff09\u3002\u5982\u679c \\(\\varepsilon = -1\\) \uff0c\u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u9006\u5411\u7684 \u3002 \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_E \\mathbf{x} = \\left[ \\begin{matrix} R & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u65cb\u8f6c\u4e00\u4e2a\uff0c\u5e73\u79fb\u4e8c\u4e2a\u3002 \u4e0d\u53d8\u91cf \uff1a\u957f\u5ea6(\u4e24\u70b9\u7684\u8ddd\u79bb)\uff0c\u89d2\u5ea6(\u4e24\u7ebf\u7684\u5939\u89d2)\u548c\u9762\u804c\u3002 \u7fa4\u548c\u5b9a\u5411 \u2003\u4fdd\u5411\u7684\u7b49\u8ddd\u53d8\u6362\u5f62\u6210\u4e00\u4e2a\u7fa4\uff0c\u4f46\u9006\u5411\u7684\u4e0d\u662f\u3002\u8fd9\u79cd\u533a\u522b\u5bf9\u4e8e\u4e0b\u9762\u7684\u76f8\u4f3c\u548c\u4eff\u5c04\u53d8\u6362\u540c\u6837\u5982\u6b64\u3002 \u76f8\u4f3c\u53d8\u6362 \u00b6 \u2002\u2002\u76f8\u4f3c\u53d8\u6362\u662f\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u4e0e\u4e00\u4e2a\u5747\u5300\u7f29\u653e\u7684\u590d\u5408\u3002\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_S \\mathbf{x} = \\left[ \\begin{matrix} sR & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u4e0d\u53d8\u91cf \uff1a\u76f4\u7ebf\u7684\u5939\u89d2\uff0c\u4e24\u957f\u5ea6\u7684\u6bd4\u7387\u548c\u9762\u79ef\u7684\u6bd4\u7387\u3002 \u4eff\u5c04\u53d8\u6362 \u00b6 \u2002\u2002\u4eff\u5c04\u53d8\u6362\u662f\u4e00\u4e2a\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\u4e0e\u4e00\u4e2a\u5e73\u79fb\u53d8\u6362\u7684\u590d\u5408\uff0c\u5b83\u7684\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} a_{11} & a_{12} & t_x \\\\ a_{21} & a_{22} & t_y \\\\ 0 & 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y \\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_A \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u4eff\u5c04\u53d8\u6362\u6709\u516d\u81ea\u7531\u5ea6\uff0c\u53ef\u4ee5\u7531\u4e09\u7ec4\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u3002 \u4e0d\u53d8\u91cf \uff1a\u5e73\u884c\u7ebf\uff0c\u5e73\u884c\u7ebf\u6bb5\u7684\u957f\u5ea6\u6bd4\u548c\u9762\u79ef\u6bd4\u3002 \u5c04\u5f71\u53d8\u6362 \u00b6 \u5b83\u662f\u9f50\u6b21\u5750\u6807\u7684\u4e00\u822c\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\uff0c\u5176\u5206\u5757\u5f62\u5f0f\uff1a \\[ \\mathbf{x}^\\prime = H_P \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u5176\u4e2d \\(\\mathbf{v}=(v_1, v_2)^{\\top}\\) \u3002 \u2002\u2002\u5c04\u5f71\u53d8\u6362\u7531\u516b\u4e2a\u53c2\u6570\u786e\u5b9a\uff0c\u53ef\u7531\u56db\u7ec4\u70b9\u5bf9\u5e94\u7b97\u51fa\uff0c \u4f46\u5176\u4e2d\u5c5e\u4e8e\u5411\u4e00\u5e73\u9762\u7684\u4e09\u70b9\u5fc5\u4e0d\u5171\u7ebf\u3002 \u4e0d\u53d8\u91cf \uff1a\u6700\u57fa\u672c\u7684\u5c04\u5f71\u4e0d\u53d8\u91cf\u662f\u56db\u5171\u7ebf\u70b9\u7684\u4ea4\u6bd4\u3002 \u5c04\u5f71\u53d8\u6362\u7684\u5206\u89e3 \u00b6 \u2002\u2002\u5c04\u5f71\u53d8\u6362\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e32\u53d8\u6362\u94fe\u7684\u590d\u5408\uff0c\u94fe\u4e2d\u7684\u6bcf\u4e2a\u77e9\u9635\u6bd4\u5b83\u524d\u9762\u7684\u4e00\u4e2a\u77e9\u9635\u6240\u8868\u793a\u7684\u53d8\u6362\u5c42\u6b21\u9ad8\u3002 \\[ H = H_SH_AH_P = \\left[ \\begin{matrix} sR & \\mathbf{t}/v \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} K & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\] \u5176\u4e2d \\(A=sRK+\\mathbf{tv}^{\\top}/v\\) \uff0c\u800c \\(K\\) \u662f\u6ee1\u8db3 \\(det\\ K=1\\) \u7684\u5f52\u4e00\u5316\u4e0a\u4e09\u89d2\u77e9\u9635\u3002\u5982\u679c \\(v \\ne 0\\) \u4e0a\u8ff0\u5206\u89e3\u662f\u6709\u6548\u7684\uff0c\u800c\u4e14\u5982\u679c \\(s\\) \u53d6\u6b63\u503c\uff0c\u5b83\u8fd8\u662f\u552f\u4e00\u7684\u3002 \u4e0d\u53d8\u91cf\u7684\u6570\u76ee \uff1a\u4e0e\u51fd\u6570\u65e0\u5173\u7684\u4e0d\u53d8\u91cf\u6570\u7b49\u4e8e\u6216\u5927\u4e8e\u914d\u7f6e\u7684\u81ea\u7531\u5ea6\u6570\u51cf\u53bb\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002 1D \u5c04\u5f71\u51e0\u4f55\u548c\u4ea4\u6bd4 \u00b6 \u2002\u2002\u76f4\u7ebf\u4e0a\u7684\u70b9 \\(x\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a \\((x_1, x_2)^{\\top}\\) \uff0c\u800c \\((x_1, 0)^{\\top}\\) \u662f\u8be5\u76f4\u7ebf\u7684\u7406\u60f3\u70b9\u3002\u6211\u4eec\u5c06\u7528\u8bb0\u53f7 \\(\\mathbf{\\bar{x}}\\) \u8868\u793a \\(2\\) \u7ef4\u77e2\u91cf \\((x_1, x_2)^{\\top}\\) \u3002\u53ef\u7528\u9f50\u6b21\u77e9\u9635\u8868\u793a\uff1a \\[\\mathbf{\\bar{x}}^\\prime = H_{2 \\times 2} \\mathbf{\\bar{x}}\\] \u4ea4\u6bd4 \u00b6 \u2002\u2002\u4ea4\u6bd4\u662f \\(IP^1\\) \u7684\u57fa\u672c\u5c04\u5f71\u4e0d\u53d8\u91cf\u3002\u7ed9\u5b9a \\(4\\) \u4e2a\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \uff0c\u4ea4\u6bd4\u5b9a\u4e49\u4e3a \\[ Cross(\\mathbf{\\bar{x}_1},\\mathbf{\\bar{x}_2},\\mathbf{\\bar{x}_3},\\mathbf{\\bar{x}_4}) = \\frac{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_2}||\\mathbf{\\bar{x}_3}\\mathbf{\\bar{x}_4}|}{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_3}||\\mathbf{\\bar{x}_2}\\mathbf{\\bar{x}_4}|} \\] \u5176\u4e2d \\[ |\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}| =det \\begin{bmatrix} x_{i1} & x_{j1} \\\\ x_{i2} & x_{j2} \\end{bmatrix} \\] \u4ea4\u6bd4\u7684\u4e3b\u8981\u7279\u70b9 \u4ea4\u6bd4\u7684\u503c\u4e0e\u5404\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u6240\u7528\u7684\u5177\u4f53\u7684\u9f50\u6b21\u8868\u793a\u65e0\u5173\u3002 \u5982\u679c\u6bcf\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u90fd\u662f\u6709\u9650\u70b9\uff0c\u5e76\u4e14\u5728\u9f50\u6b21\u8868\u793a\u4e2d\u5747\u9009\u62e9 \\(x_2 = 1\\) \uff0c\u90a3\u4e48 \\(|\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}|\\) \u5c31\u8868\u793a\u7531 \\(\\mathbf{\\bar{x}_i}\\) \u5230 \\(\\mathbf{\\bar{x}_j}\\) \u7684\u5e26\u7b26\u53f7\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u4e2d\u6709\u4e00\u4e2a\u7406\u60f3\u70b9\uff0c\u4ea4\u6bd4\u7684\u5b9a\u4e49\u4ecd\u7136\u6709\u6548\u3002 \u5728\u4efb\u4f55\u76f4\u7ebf\u7684\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u4ea4\u6bd4\u7684\u503c\u4e0d\u53d8\u3002 \u5171\u70b9\u7ebf \u5171\u70b9\u7ebf\u662f\u76f4\u7ebf\u4e0a\u5171\u7ebf\u70b9\u7684\u5bf9\u5076\u3002\u8fd9\u610f\u5473\u7740\u5e73\u9762\u4e0a\u7684\u5171\u70b9\u7ebf\u4e5f\u6709\u51e0\u4f55 \\(IP^1\\) \u3002\u7279\u522b\u662f\uff0c\u4efb\u4f55\u56db\u6761\u5171\u70b9\u7ebf\u90fd\u6709\u4e00\u4e2a\u786e\u5b9a\u7684\u4ea4\u6bd4\u3002 \u4ece\u56fe\u50cf\u6062\u590d\u4eff\u5c04\u548c\u5ea6\u91cf\u6027\u8d28 \u00b6 \u2002\u2002\u5c04\u5f71\u77eb\u6b63\u7684\u76ee\u7684\u662f\u6d88\u9664\u5e73\u9762\u7684\u900f\u89c6\u56fe\u50cf\u4e2d\u7684\u5c04\u5f71\u5931\u771f\uff0c\u4f7f\u5f97\u539f\u59cb\u5e73\u9762\u7684\u76f8\u4f3c\u6027\u8d28\uff08\u89d2\u5ea6\u3001\u957f\u5ea6\u6bd4\uff09\u53ef\u4ee5\u88ab\u6d4b\u91cf\u3002 \u65e0\u7a77\u8fdc\u7ebf \u00b6 \u2002\u2002\u5728\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u7406\u60f3\u70b9\u53ef\u4ee5\u6620\u5c04\u4e3a\u6709\u9650\u70b9\uff0c\u56e0\u800c \\(I_{\\infty}\\) \u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\u3002\u4f46\u5982\u679c\u662f\u4eff\u5c04\u53d8\u6362\uff0c \\(I_{\\infty}\\) \u4e0d\u4f1a\u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\uff0c\u5373\u4ecd\u7559\u5728\u65e0\u7a77\u8fdc\u5904\uff0c\u663e\u7136\uff0c\u5b83\u53ef\u76f4\u63a5\u7531\u76f4\u7ebf\u7684\u53d8\u6362\u63a8\u51fa\uff1a \\[ I_{\\infty}^\\prime = H_A^{-T}I_{\\infty} = \\begin{bmatrix} A^{-T} & \\mathbf{0} \\\\ -\\mathbf{t}^{\\top}A^{-T} & 1 \\end{bmatrix} \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = I_\\infty \\] \u7ed3\u8bba1 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u76f4\u7ebf \\(I_{\\infty}\\) \u4e3a\u4e0d\u52a8\u76f4\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4eff\u5c04\u53d8\u6362\u3002 \u2002\u2002\u5728\u5e73\u9762\u7684\u50cf\u4e2d\uff0c\u4e00\u4f46\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u5f97\u5230\u8fa8\u8ba4\uff0c\u5c31\u6709\u53ef\u80fd\u5bf9\u539f\u5e73\u9762\u8fdb\u884c\u4eff\u5c04\u6d4b\u91cf\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u76f4\u63a5\u628a\u5df2\u8fa8\u8ba4\u7684 \\(I_\\infty\\) \u53d8\u6362\u5230\u5b83\u7684\u89c4\u8303\u4f4d\u7f6e \\(I_\\infty = (0,0,1)^{\\top}\\) \u3002\u628a\u5b9e\u73b0\u6b64\u53d8\u6362\u7684(\u5c04\u5f71)\u77e9\u9635\u5e94\u7528\u4e8e\u56fe\u50cf\u4e2d\u7684\u6bcf\u4e00\u70b9\u4ee5\u8fbe\u5230\u5bf9\u56fe\u50cf\u8fdb\u884c\u4eff\u5c04\u77eb\u6b63\u7684\u76ee\u7684\uff0c\u5373\u53d8\u6362\u4e4b\u540e\uff0c\u4eff\u5c04\u6d4b\u91cf\u53ef\u4ee5\u76f4\u63a5\u5728\u77eb\u6b63\u8fc7\u7684\u56fe\u50cf\u4e2d\u8fdb\u884c\u3002 \u2002\u2002\u5982\u679c\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u662f \\(\\mathbf{I} = (l_1, l_2, l_3)^{\\top}\\) \uff0c\u5047\u5b9a \\(l_3 \\ne 0\\) \uff0c\u90a3\u4e48\u628a \\(\\mathbf{l}\\) \u6620\u5c04\u56de \\(l_\\infty = (0,0,1)^{\\top}\\) \u7684\u4e00\u4e2a\u5408\u9002\u7684\u5c04\u5f71\u70b9\u4ea4\u6362\u662f \\[ H=H_A \\begin{bmatrix} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ l_1 & l_2 & l_3 \\end{bmatrix} \\] \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4 \u7ed9\u5b9a\u4e00\u4e2a\u76f4\u7ebf\u4e0a\u6709\u5df2\u77e5\u957f\u5ea6\u6bd4\u7684\u4e24\u4e2a\u7ebf\u6bb5\uff0c\u8be5\u76f4\u7ebf\u4e0a\u7684\u65e0\u7a77\u8fdc\u70b9\u4fbf\u53ef\u4ee5\u786e\u5b9a\u3002 \u865a\u5706\u70b9\u53ca\u5176\u5bf9\u5076 \u00b6 \u865a\u5706\u70b9 \u6bcf\u4e00\u5706\u5468\u4e0e \\(l_\\infty\\) \u76f8\u4ea4\u7684\u70b9\u79f0\u4e3a\u865a\u5706\u70b9\u3002 \u8bc1\u660e \u5728\u4e8c\u6b21\u66f2\u7ebf\u4e3a\u5706\u6709 \\(a=c\\) \u4e14 \\(b=0\\) \u3002\u53d6 \\(a=1\\) \u5219\uff1a \\[x_1^2+x_2^2+dx_1x_3+ex_2x_3=fx_3^2=0\\] \u8be5\u4e8c\u6b21\u66f2\u7ebf\u76f8\u4ea4\u4e8e \\(l_\\infty\\) \u4e8e(\u7406\u60f3)\u70b9( \\(x_3=0\\) )\uff1a \\[x_1^2+x_2^2=0\\] \u89e3\u5f97\u865a\u5706\u70b9\u7684\u6807\u51c6\u5750\u6807\u662f \\(\\mathbf{I}=(1,i,0)^{\\top}, \\; \\mathbf{J}=(1, -i, 0)^{\\top}\\) \u3002 \u8fd9\u4e00\u5bf9\u865a\u5706\u70b9\u662f\u590d\u5171\u8f6d\u7406\u60f3\u70b9\uff0c\u5b83\u4eec\u5728\u4fdd\u5411\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\uff1a \\[ \\mathbf{I}^\\prime = H_S\\mathbf{I} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = se^{-i \\theta} \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = \\mathbf{I} \\] \u7ed3\u8bba2 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u865a\u5706\u70b9 \\(I\\) \u548c \\(J\\) \u4e3a\u4e0d\u52a8\u70b9\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362\u3002 \u2002\u2002\u4efb\u4f55\u5706\u90fd\u4ea4 \\(\\mathbf{I}_\\infty\\) \u4e8e\u865a\u5706\u70b9 . \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\u4e00\u4e2a\u5706\u7531\u4e09\u70b9\u6307\u5b9a.\u865a\u5706\u70b9\u5f15\u51fa\u53e6 \u4e00\u79cd\u8ba1\u7b97.\u5706\u53ef\u4ee5\u7528\u7531\u4e94\u4e2a\u70b9\u5b9a\u4e49\u7684\u4e00\u822c\u4e8c\u6b21\u66f2\u7ebf\u7684\u516c\u5f0f\uff08\u4e09\u4e2a\u70b9\u52a0\u4e24\u4e2a\u865a\u5706\u70b9\uff09\u3002\u865a\u5706\u70b9\u662f\u628a\u6b27\u6c0f\u51e0\u4f55\u4e2d\u7684\u4e24\u6b63\u4ea4\u65b9\u5411\u5408\u5e76\u5230\u4e00\u4e2a\u590d\u5171\u8f6d\u4e2d\uff0c\u5373 \\[\\mathbf{I}=(1,0,0)^{\\top} + i(0,1,0)^{\\top}\\] \u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf \\[C_{\\infty}^* = \\mathbf{I}\\mathbf{J}^{\\top}+\\mathbf{J}\\mathbf{I}^{\\top}\\] \u7ed3\u8bba3 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_{\\infty}^*\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\u4e0d\u53d8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u76f8\u4f3c\u53d8\u6362\u3002 \u6b64\u5916\uff0c\u5728\u4efb\u4f55\u5c04\u5f71\u6846\u67b6\u4e0b\uff0c \\(C_{\\infty}^*\\) \u5177\u6709\u4e00\u4e9b\u6027\u8d28\uff1a \\(C_{\\infty}^*\\) \u6709 \\(4\\) \u4e2a\u81ea\u7531\u5ea6 \\(\\mathbf{I}_\\infty\\) \u662f \\(C_{\\infty}^*\\) \u7684\u96f6\u77e2\u91cf \u5c04\u5f71\u5e73\u9762\u4e0a\u7684\u5939\u89d2 \u00b6 \u2002\u2002\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e24\u7ebf\u95f4\u7684\u5939\u89d2\u7531\u5b83\u4eec\u6cd5\u7ebf\u7684\u70b9\u4e58\u6765\u8ba1\u7b97\u3002\u76f4\u7ebf \\(\\mathbf{I}=(l_1, l_2, l_3)^{\\top}\\) \u548c \\(\\mathbf{m}=(m_1, m_2, m_3)^{\\top}\\) \u7684\u6cd5\u7ebf\u5206\u522b\u5e73\u884c\u4e8e \\((l_1, l_2)^{\\top}\\) \\((m_1, m_2)^{\\top}\\) \uff0c\u5176\u5939\u89d2\u4e3a \\[\\cos \\theta = \\frac{l_1m_1+l_2m_2}{\\sqrt{(l_1^2+l_2^2)(m_1^2+m_2^2)}}\\] \u5728\u5c04\u5f71\u53d8\u6362\u4e0b\u4e0d\u53d8\u7684\u516c\u5f0f\u4e3a: \\[\\cos \\theta = \\frac{\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}}{\\sqrt{(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{I})(\\mathbf{m}^{\\top}C_{\\infty}^*\\mathbf{m})}}\\] \u5176\u4e2d \\(C_\\infty^*\\) \u662f\u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002 \u7ed3\u8bba4 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u6b27\u6c0f\u89d2\u53ef\u4ee5\u6d4b\u91cf\u3002 \u7ed3\u8bba5 \u5982\u679c \\(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}=\\mathbf{0}\\) \uff0c\u5219\u76f4\u7ebf \\(l\\) \u548c \\(m\\) \u6b63\u4ea4\u3002 \u7ed3\u8bba6 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u957f\u5ea6\u6bd4\u540c\u6837\u53ef\u4ee5\u6d4b\u91cf\u3002 \u7531\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28 \u00b6 \u2002\u2002\u628a\u865a\u5706\u70b9\u53d8\u6362\u5230\u5b83\u4eec\u7684\u6807\u51c6\u4f4d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u7531\u5e73\u9762\u7684\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28\u3002\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u200b\u51e0\u4e4e\u5305\u542b\u4e86\u5b9e\u73b0\u5ea6\u91cf\u77eb\u6b63\u6240\u9700\u7684\u5168\u90e8\u4fe1\u606f\u3002\u5b83\u80fd\u786e\u5b9a\u5c04\u5f71\u53d8\u6362\u4e2d\u7684\u4eff\u5c04\u548c\u5c04\u5f71\u6210\u5206\uff0c\u800c\u53ea\u7559\u4e0b\u76f8\u4f3c\u53d8\u6362\u7684\u5931\u771f\u3002 \u7ed3\u8bba7 \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\uff0c\u4e00\u65e6 \\(C_\\infty^*\\) \u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u5c04\u5f71\u5931\u771f\u53ef\u4ee5\u77eb\u6b63\u5230\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u5176\u4ed6\u6027\u8d28 \u00b6 \u6781\u70b9-\u6781\u7ebf\u5173\u7cfb \u00b6 \u2002\u2002\u70b9 \\(\\mathbf{x}\\) \u548c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5b9a\u4e49\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \uff0c \\(\\mathbf{l}\\) \u79f0\u4e3a \\(\\mathbf{x}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u7ebf \uff0c\u800c\u70b9 \\(\\mathbf{x}\\) \u79f0\u4e3a \\(\\mathbf{l}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u70b9 \u3002 \u70b9 \\(\\mathbf{x}\\) \u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4ea4\u4e8e\u4e24\u70b9\u3002 \\(C\\) \u7684\u8fc7\u8fd9\u4e24\u70b9\u7684\u4e24\u6761\u5207\u7ebf\u76f8\u4ea4\u4e8e \\(\\mathbf{x}\\) \u3002 \u5982\u679c\u70b9 \\(x\\) \u5728 \\(C\\) \u4e0a\uff0c\u5219\u5b83\u7684\u6781\u7ebf\u5c31\u662f\u4e8c\u6b21\u66f2\u7ebf\u8fc7 \\(x\\) \u70b9\u7684\u5207\u7ebf\u3002 \u5bf9\u5c04 \u5b9a\u4e49 \uff1a\u5bf9\u5c04\u662f \\(IP^2\\) \u70b9\u5230 \\(IP^2\\) \u7ebf\u7684\u53ef\u9006\u6620\u5c04\u3002\u5e76\u7528\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(A\\) \u8868\u793a\u4e3a \\(\\mathbf{l}=A\\mathbf{x}\\) \u3002 \u5171\u8f6d\u70b9 \uff1a\u5982\u679c\u70b9 \\(y\\) \u5728\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4e0a\uff0c\u5219 \\(\\mathbf{y}^{\\top}\\mathbf{l}=\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u3002\u6ee1\u8db3 \\(\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u7684\u4efb\u4f55\u4e24\u70b9 \\(x,y\\) \u79f0\u4e3a\u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5171\u8f6d\u3002 \u5982\u679c \\(\\mathbf{x}\\) \u5728 \\(\\mathbf{y}\\) \u7684\u6781\u7ebf\u4e0a\uff0c\u90a3\u4e48 \\(\\mathbf{y}\\) \u4e5f\u5728 \\(\\mathbf{x}\\) \u7684\u6781\u7ebf\u4e0a\u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u5206\u7c7b \u00b6 \u4e8c\u6b21\u66f2\u7ebf\u7684\u5c04\u5f71\u6807\u51c6\u5f62\u5f0f \u00b6 \u2002\u2002\u4efb\u4f55\u4e8c\u6b21\u66f2\u7ebf\u90fd\u5c04\u5f71\u7b49\u4ef7\u4e8e\u4e00\u4e2a\u7531\u5bf9\u89d2\u77e9\u9635\u8868\u793a\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e8c\u6b21\u66f2\u7ebf \\(D\\) \u6700\u7ec8\u88ab\u8868\u793a\u4e3a\u5177\u6709\u77e9\u9635 \\(diag(\\varepsilon_1, \\varepsilon_2, \\varepsilon_3)\\) \u7684\u4e8c\u6b21\u66f2\u7ebf\uff0c\u5176\u4e2d \\(\\varepsilon_i=\\pm 1\\) \u6216 \\(0\\) \u3002 \u5bf9\u89d2\u7ebf \u65b9\u7a0b \u4e8c\u6b21\u66f2\u7ebf\u7c7b\u578b \\((1,1,1)\\) \\(x^2+y^2+w^2=0\\) \u5047\u4e8c\u6b21\u66f2\u7ebf--\u65e0\u5b9e\u70b9 \\((1,1,-1)\\) \\(x^2+y^2-w^2=0\\) \u5706 \\((1,1,0)\\) \\(x^2+y^2=0\\) \u5355\u4e2a\u5b9e\u70b9 \\((0,0,1)^{\\top}\\) \\((1,-1,0)\\) \\(x^2-y^2=0\\) \u4e24\u6761\u76f4\u7ebf \\(x=\\pm y\\) \\((1,0,0)\\) \\(x^2=0\\) \u5355\u6761\u76f4\u7ebf \\(x=0\\) \u8ba1\u4e24\u6b21 \u4e8c\u6b21\u66f2\u7ebf\u7684\u4eff\u5c04\u5206\u7c7b \u00b6 \u2002\u2002\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c(\u975e\u9000\u5316\u6216\u771f)\u4e8c\u6b21\u66f2\u7ebf\u53ef\u4ee5\u5206\u4e3a\u53cc\u66f2\u7ebf\u3001\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002\u5728\u5c04\u5f71\u51e0\u4f55\u4e2d\u4e09\u79cd\u7c7b\u578b\u7684\u4e8c\u6b21\u66f2\u7ebf\u4e0e \\(l_\\infty\\) \u7684\u5173\u7cfb\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u4e0a\u56fe\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u662f \\((a)\\) \u692d\u5706\uff0c \\((b)\\) \u629b\u7269\u7ebf\uff0c \\((c)\\) \u53cc\u66f2\u7ebf\u3002\u5b83\u4eec\u4e0e \\(l_{\\infty}\\) \u7684\u5173\u7cfb : \\((a)\\) \u65e0\u5b9e\u4ea4\u70b9\u3001 \\((b)\\) \u76f8\u5207( \\(2\\) \u70b9\u63a5\u89e6)\u3001 \\((c)\\) \u6709 \\(2\\) \u4e2a\u5b9e\u4ea4\u70b9\u3002 \u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf \u00b6 \u2002\u2002\u53d8\u6362\u7684\u4e00\u4e2a \u7279\u5f81\u77e2\u91cf \u5bf9\u5e94\u4e00\u4e2a \u4e0d\u52a8\u70b9 \uff0c\u56e0\u4e3a\u5bf9\u4e8e\u7279\u5f81\u503c \\(\\lambda\\) \u53ca\u5176\u5bf9\u5e94\u7684\u7279\u5f81\u77e2\u91cf \\(e\\) \u6709: \\[H\\mathbf{e} = \\lambda \\mathbf{e}\\] \u2002\u2002\u800c \\(\\mathbf{e}\\) \u548c \\(\\lambda \\mathbf{e}\\) \u8868\u793a\u540c\u4e00\u70b9\u3002\u7c7b\u4f3c\u7684\u63a8\u5bfc\u53ef\u4ee5\u7528\u4e8e\u4e0d\u52a8\u76f4\u7ebf\uff0c\u5b83\u5bf9\u5e94\u4e8e \\(H^{\\top}\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u7684\u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf \u8fd9\u91cc\u6709\u4e09\u4e2a\u4e0d\u52a8\u70b9\u548c\u8fc7\u8fd9\u4e09\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf.\u4e0d\u52a8\u76f4\u7ebf\u548c\u4e0d\u52a8\u70b9\u53ef\u80fd\u662f\u590d\u7684\uff1a\u4ece\u4ee3\u6570\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u4e0d\u52a8\u70b9\u662f\u70b9\u53d8\u6362 \\((\\mathbf{x}^\\prime=H\\mathbf{x})\\) \u7684\u7279\u5f81\u77e2\u91cf \\(\\mathbf{e}_i\\) \uff0c\u800c\u4e0d\u52a8\u76f4\u7ebf\u662f\u7ebf\u53d8\u6362 \\((\\mathbf{l}^\\prime =H^{-T}\\mathbf{l})\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002\u6ce8\u610f\uff0c\u4e0d\u52a8\u76f4\u7ebf\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\uff1a\u5728\u53d8\u6362\u4e0b\uff0c\u76f4\u7ebf\u4e0a\u7684\u4e00\u70b9\u88ab\u6620\u4e3a\u5176\u4e0a\u7684\u53e6\u4e00\u70b9\uff0c\u53ea\u6709\u4e0d\u52a8\u70b9\u624d\u6620\u4e3a\u81ea\u8eab\u3002 \u6b27\u6c0f\u77e9\u9635 \u00b6 \u2002\u2002\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u662f\u865a\u5706\u70b9 \\(\\mathbf{I},\\mathbf{J}\\) \u7ec4\u6210\u7684\u590d\u5171\u8f6d\u5bf9\uff0c\u76f8\u5bf9\u5e94\u7684\u7279\u5f81\u503c\u662f \\(|e^{i \\theta}, e^{-i \\theta}|\\) \uff0c\u8fd9\u91cc \\(\\theta\\) \u662f\u65cb\u8f6c\u89d2\u3002\u5bf9\u5e94\u4e8e\u7279\u5f81\u503c \\(1\\) \u7684\u7b2c\u4e09\u4e2a\u7279\u5f81\u5411\u91cf\uff0c\u79f0\u4e3a \\(\u6781\u70b9\\) \u3002\u6b27\u6c0f\u53d8\u6362\u7b49\u4ef7\u4e8e\u7ed5\u8be5\u70b9\u8f6c \\(\\theta\\) \u89d2\u7684\u7eaf\u65cb\u8f6c\u5e76\u4e14\u6ca1\u6709\u5e73\u79fb\u3002 \u4e00\u79cd\u7279\u6b8a\u7684\u60c5\u8bc6\u662f\u7eaf\u5e73\u79fb(\u5373 \\(\\theta=0\\) )\u3002\u8fd9\u65f6\u7279\u5f81\u503c\u4e09\u91cd\u9000\u5316\uff0c\u8fd9\u662f\u7ea6\u675f\u900f\u89c6\u53d8\u6362\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002 \u76f8\u4f3c\u77e9\u9635 \u00b6 \u2002\u2002\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u4ecd\u662f\u865a\u5706\u70b9\u3002\u7279\u5f81\u503c\u662f \\(|1,se^{i \\theta}, se^{-i \\theta}|\\) \u3002\u76f8\u4f3c\u53d8\u6362\u7684\u4f5c\u7528\u53ef\u4ee5\u7406\u89e3\u4e3a\u7ed5\u5b83\u7684\u6709\u9650\u4e0d\u52a8\u70b9\u7684\u65cb\u8f6c\u548c\u53d6 \\(s\\) \u4e3a\u56e0\u5b50\u7684\u5747\u5300\u7f29\u653e\u3002\u6ce8\u610f\u865a\u5706\u70b9\u7684\u7279\u5f81\u503c\u4ecd\u7136\u8868\u5f81\u65cb\u8f6c\u89d2\u3002 \u4eff\u5c04\u77e9\u9635 \u00b6 \u2002\u2002\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u53ef\u4ee5\u662f\u5b9e\u6216\u590d\u5171\u8f6d\u7684\uff0c\u4f46\u5728\u4efb\u4f55\u4e00\u79cd\u60c5\u51b5\u4e0b\uff0c\u8fc7\u8fd9\u4e9b\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf \\(\\mathbf{l}_\\infty=(0,0,1)^{\\top}\\) \u662f\u5b9e\u7684\u3002","title":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#2d","text":"\u7ea6 4639 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecdMVG\u6240\u5fc5\u987b\u7684\u51e0\u4f55\u6982\u5ff5\u548c\u7b26\u53f7\uff0c\u5177\u4f53\u6db5\u76d6\u5e73\u9762\u7684\u5c04\u5f71\u53d8\u6362\u51e0\u4f55","title":"2D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_1","text":"","title":"\u5e73\u9762\u51e0\u4f55"},{"location":"cv/mvg/pjt2d/#2d_1","text":"","title":"2D \u5c04\u5f71\u5e73\u9762"},{"location":"cv/mvg/pjt2d/#_2","text":"\u76f4\u7ebf\u7684\u5176\u6b21\u8868\u793a \u5e73\u9762\u4e0a\u7684\u4e00\u6761\u76f4\u7ebf\u7684\u65b9\u7a0b \\(ax+by+c=0\\) \u53ef\u4ee5\u7528\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u8868\u793a\u3002 \u5bf9\u4efb\u4f55\u975e\u96f6\u7684k\u77e2\u91cf \\((a,b,c)^{\\top}\\) \u4e0e \\(k(a,b,c)^{\\top}\\) \u8868\u793a\u540c\u4e00\u76f4\u7ebf \u3002 \u70b9\u7684\u5176\u6b21\u8868\u793a \u4e00\u4e2a\u70b9\u7684\u4efb\u4f55\u9f50\u6b21\u77e2\u91cf\u7684\u8868\u793a\u5f62\u5f0f\u4e3a \\(x=(x_1,x_2,x_3)^{\\top}\\) \uff0c\u975e\u9f50\u6b21\u5750\u6807 \\(x=(\\frac{x_1}{x_3}, \\frac{x_2}{x_3})^{\\top}\\) \u3002 \u7ed3\u8bba1 \u70b9 \\(x\\) \u5728\u76f4\u7ebf \\(l\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(x^{\\top}l=0\\) \u3002 \\(x^{\\top}l = l^{\\top}x = x \\cdot l = 0\\) \u3002 \u7ed3\u8bba2 \u4e24\u76f4\u7ebf \\(l\\) \u548c \\(l^{\\prime}\\) \u7684\u4ea4\u70b9\u662f\u70b9 \\(x=l \\times l^{\\prime}\\) \u3002 \u53c9\u4e58 \\[c = a \\times b = (a.y * b.z - b.y * a.z, \\quad b.x * a.z - a.x * b.z, \\quad a.x * b.y - b.x * a.y)\\] \u7ed3\u8bba3 \u8fc7\u4e24\u70b9 \\(x\\) \u548c \\(x^{\\prime}\\) \u7684\u76f4\u7ebf\u662f \\(l = x \\times x^{\\prime}\\) \u3002 \u5e73\u884c\u7ebf\u7684\u4ea4\u70b9 \u4e24\u5e73\u884c\u76f4\u7ebf \\(ax+by+c=0\\) \u548c \\(ax+by+c^{\\prime}=0\\) \uff0c\u7531 \u7ed3\u8bba2 \u53ef\u5f97\u4ea4\u70b9 \\((b, -a, 0)^{\\top}\\) \u3002 \u7406\u60f3\u70b9\u548c\u65e0\u7a77\u8fdc\u7ebf \u5f53\u9f50\u6b21\u77e2\u91cf \\(x = (x_1, x_2, x_3)^{\\top}\\) \u4e2d\u7684 \\(x_3=0\\) \u65f6\u7684\u70b9\u88ab\u79f0\u4e3a \u7406\u60f3\u70b9 \uff0c\u6216 \u65e0\u7a77\u8fdc\u70b9 \u3002\u6240\u6709\u7406\u60f3\u70b9\u96c6\u5408\u5728\u4e00\u6761\u76f4\u7ebf\u4e0a\uff0c\u79f0 \u65e0\u7a77\u8fdc\u7ebf \uff0c\u7528 \\(I_{\\infty}=(0,0,1)^{\\top}\\) \u8868\u793a\u3002 \u5c04\u5f71\u5e73\u9762\u6a21\u578b \\(IP^2\\) \u7684\u70b9\u548c\u7ebf\u5206\u522b\u4e3a\u4e2d\u8fc7\u539f\u70b9\u7684\u5c04\u7ebf\u548c\u5e73\u9762 \\(x_1x_2\\) \u5e73\u9762\u4e0a\u7684\u5c04\u7ebf\u8868\u793a\u7406\u60f3\u70b9\uff0c\u800c \\(x_1x_2\\) \u5e73\u9762\u8868\u793a \\(I_{\\infty}\\) \u3002 \u7ed3\u8bba4\uff08\u5bf9\u5076\u539f\u7406\uff09 2\u7ef4\u5c04\u5f71\u51e0\u4f55\u4e2d\u7684\u4efb\u4f55\u5b9a\u7406\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u5bf9\u5076\u5b9a\u7406\uff0c\u5b83\u53ef\u4ee5\u901a\u8fc7\u4e92\u6362\u539f\u5b9a\u7406\u4e2d\u70b9\u548c\u7ebf\u7684\u4f5c\u7528\u800c\u5bfc\u51fa\u3002","title":"\u70b9\u4e0e\u76f4\u7ebf"},{"location":"cv/mvg/pjt2d/#_3","text":"\u4e8c\u6b21\u66f2\u7ebf \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b: \u53cc\u66f2\u7ebf\uff0c\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002 \u5728\u975e\u9f50\u6b21\u5750\u6807\u4e2d\uff0c\u4e8c\u6b21\u66f2\u7ebf\u7684\u65b9\u7a0b\u662f \\[ax^2+bxy+cy^2+dx+ey+f=0\\] \u901a\u8fc7\u66ff\u4ee3 \\(x\\to\\frac{x_1}{x_3}\\) \uff0c \\(y\\to\\frac{x_2}{x_3}\\) \uff0c\u5f97\u5230\uff1a \\[ax_1^2+bx_1x_2+cx_2^2+dx_1x_3+ex_2x_3+fx_3^2=0\\] \u8868\u793a\u6210\u77e9\u9635\u5f62\u5f0f\u4e3a \\(x^{\\top}Cx=0\\) \u5176\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u7cfb\u6570\u77e9\u9635 \\(C\\) \u4e3a \\[ C = \\left[ \\begin{matrix} a & b/2 & d/2 \\\\ b/2 & c & e/2 \\\\ d/2 & e/2 & f \\end{matrix} \\right] \\] \u7ed3\u8bba5 \u8fc7(\u975e\u9000\u5316)\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u4e0a\u70b9 \\(x\\) \u7684\u5207\u7ebf \\(l\\) \u7531 \\(l=Cx\\) \u786e\u5b9a\u3002 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \u4e0a\u9762\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u66f4\u786e\u5207\u5730\u5e94\u79f0\u4e3a\u70b9\u4e8c\u6b21\u66f2\u7ebf\uff0c\u56e0\u4e3a\u5b83\u5b9a\u4e49\u7684\u662f\u70b9\u7684\u65b9\u7a0b\u3002\u540c\u65f6\u8fd9\u79cd \u5bf9\u5076 \uff08\u6216\u7ebf\uff09\u4e8c\u6b21\u66f2\u7ebf\u4e5f\u7531\u4e00\u4e2a \\(3 \\times 3\\) \u77e9\u9635\u8868\u793a\uff0c\u6211\u4eec\u628a\u5b83\u8bb0\u4e3a \\(C^*\\) \uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u5207\u7ebf \\(l\\) \u6ee1\u8db3 \\(l^{\\top}C^*l=0\\) \u3002\u5176\u4e2d \\(C^*\\) \u8868\u793a\u4e3a \\(C\\) \u7684\u4f34\u968f\u77e9\u9635\u3002 \u9000\u5316\u4e8c\u6b21\u66f2\u7ebf \u975e\u6ee1\u79e9\u77e9\u9635 \\(C\\) \u6240\u5b9a\u4e49\u7684\u4e8c\u6b21\u66f2\u7ebf\u79f0\u4f5c\u9000\u5316\u4e8c\u6b21\u66f2\u7ebf\u3002\u9000\u5316\u7684\u70b9\u4e8c\u6b21\u66f2\u7ebf\u5305\u542b\u4e24\u6761\u7ebf(\u79e9 2) \u6216\u4e00\u6761\u91cd\u7ebf(\u79e9 1) \u3002","title":"\u4e8c\u6b21\u66f2\u7ebf\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf"},{"location":"cv/mvg/pjt2d/#_4","text":"\u5c04\u5f71\u6620\u5c04 \u5c04\u5f71\u6620\u5c04 \u662f \\(IP^2\\) \u5230\u5b83\u81ea\u8eab\u7684\u4e00\u79cd\u6ee1\u8db3\u4e0b\u5217\u6761\u4ef6\u7684\u53ef\u9006\u6620\u5c04 \\(h\\) \uff1a\u4e09\u70b9 \\(x_1\\) , \\(x_2\\) \u548c \\(x_3\\) \u5171\u7ebf\u5f53\u4e14\u4ec5\u5f53 \\(h(x_1)\\) , \\(h(x_2)\\) , \\(h(x_3)\\) \u4e5f\u5171\u7ebf\u3002 \u5c04\u5f71\u6620\u5c04\u4e5f\u79f0\u4e3a\u4fdd\u7ebf\u53d8\u6362 \uff0c\u6216\u5c04\u5f71\u53d8\u6362\u6216\u5355\u5e94 (homography) \u3002 \u5b9a\u74061 \u6620\u5c04 \\(h\\) \uff1a \\(IP^2 \\to IP^2\\) \u662f\u5c04\u5f71\u6620\u5c04\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b58\u5728\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(H\\) \uff0c\u4f7f\u5f97 \\(IP^2\\) \u7684\u4efb\u4f55\u4e00\u4e2a\u7528\u77e2\u91cf \\(x\\) \u8868\u793a\u7684\u70b9\u90fd\u6ee1\u8db3 \\(h(x)=Hx\\) \u3002 \u5c04\u5f71\u53d8\u6362 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u662f\u5173\u4e8e\u9f50\u6b213\u7ef4\u77e2\u91cf\u7684\u4e00\u79cd\u7ebf\u6027\u53d8\u6362\uff0c\u5e76\u53ef\u7528\u4e00\u4e2a\u975e\u5947\u5f02 \\(3 \\times 3\\) \u77e9\u9635 \\(H\\) \u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x_1^\\prime \\\\ x_2^\\prime\\\\ x_3^\\prime \\end{pmatrix} = \\left[ \\begin{matrix} h_{11} & h_{12} & h_{13} \\\\ h_{21} & h_{22} & h_{23} \\\\ h_{31} & h_{32} & h_{33} \\end{matrix} \\right] \\begin{pmatrix} x_1 \\\\ x_2\\\\ x_3 \\end{pmatrix} \\] \u6216\u66f4\u7b80\u6d01\u5730\u8868\u793a\u4e3a \\(x^\\prime = Hx\\) \u3002","title":"\u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_5","text":"\u76f4\u7ebf\u7684\u53d8\u6362 \\[l^\\prime = H^{-T}l\\] \u4e5f\u53ef\u4ee5\u5199\u6210 \\(l^{\\prime T}=l^{\\top}H^{-1}\\) \u3002\u76f4\u7ebf\u548c\u70b9\u53d8\u6362\u7684\u57fa\u672c\u533a\u522b\u5728\u4e8e\u70b9\u53d8\u6362\u4f9d\u636e \\(H\\) \uff0c\u800c\u76f4\u7ebf\uff08\u89c6\u4e3a\u884c\u77e2\u91cf\uff09\u53d8\u6362\u5219\u4f9d\u636e \\(H^{-1}\\) \u3002\u79f0\u70b9\u53d8\u6362\u4e3a \u9006\u53d8 \u800c\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \u3002 \u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c \\(x^{\\top}Cx = x^{\\prime T}[H^{-1}]^{\\top}CH^{-1}x^\\prime = x^{\\prime T} H^{-T}CH^{-1} x^{\\prime}\\) \u3002 \u7ed3\u8bba1 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u53d8\u6362\u4e3a \\(C^\\prime = H^{-T}CH^{-1}\\) \u3002\uff08\u56e0\u4e3a\u5b58\u5728 \\(H^{-1}\\) \uff0c\u6240\u4ee5\u79f0\u4e8c\u6b21\u66f2\u7ebf\u53d8\u6362\u4e3a \u534f\u53d8 \uff09 \u8bc1\u660e \\[ x^{\\top}Cx = (H^{-1}x^\\prime)^{\\top} C (H^{-1}x^\\prime) = x^{\\prime T} (H^{-T}CH^{-1}) x^\\prime \\] \u7ed3\u8bba2 \u5728\u70b9\u53d8\u6362 \\(x^\\prime = Hx\\) \u4e0b\uff0c\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C^*\\) \u53d8\u6362\u4e3a \\(C^{*\\prime} = HC^* H^{\\top}\\) \u3002 \u8bc1\u660e \\[ l^{\\top}C^*l = (H^{\\top}l)^{\\top}C^*(H^{\\top}l)=l^{\\top}HC^*H^{\\top}l \\]","title":"\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u7ebf\u7684\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_6","text":"\u7531 \\(n \\times n\\) \u53ef\u9006\u5b9e\u77e9\u9635\u7684\u7fa4\u79f0\u4e3a\uff08\u5b9e\u7684\uff09\u4e00\u822c\u7ebf\u6027\u7fa4\u6216 \\(GL(n)\\) \u3002\u5f53\uff0c \u628a\u76f8\u5dee\u975e\u96f6\u7eaf\u9760\u56e0\u5b50\u7684\u77e9\u9635\u90fd\u89c6\u4e3a\u7b49\u540c\u65f6\uff0c\u4fbf\u5f97\u5230\u5c04\u5f71\u7ebf\u6027\u7fa4\uff0c\u8bb0\u4e3a \\(PL(n)\\) (\u5b83\u662f \\(GL(n)\\) \u7684\u5546\u7fa4)\u3002\u5728\u5e73\u9762\u5c04\u5f71\u53d8\u6362\u65f6\uff0c \\(n=3\\) \u3002","title":"\u53d8\u6362\u7684\u5c42\u6b21"},{"location":"cv/mvg/pjt2d/#_7","text":"\u7b49\u8ddd(isometric)\u53d8\u6362\u662f\u5e73\u9762 \\(IR^2\\) \u7684\u53d8\u6362\uff0c\u4fdd\u6301\u6b27\u5f0f\u8ddd\u79bb\u4e0d\u53d8\uff0c\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u53ef\u8868\u793a\u4e3a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} \\varepsilon \\cos \\theta & -\\sin \\theta & t_x \\\\ \\varepsilon \\sin \\theta & \\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u5176\u4e2d \\(\\varepsilon = \\pm 1\\) \u3002\u5982\u679c \\(\\varepsilon = 1\\) \u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u4fdd\u5411\u7684 \u5e76\u4e14\u4e5f\u662f \u6b27\u6c0f \u53d8\u6362\uff08\u5e73\u79fb\u548c\u65cb\u8f6c\u7684\u590d\u5408\uff09\u3002\u5982\u679c \\(\\varepsilon = -1\\) \uff0c\u90a3\u4e48\u8be5\u7b49\u8ddd\u53d8\u6362\u662f \u9006\u5411\u7684 \u3002 \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_E \\mathbf{x} = \\left[ \\begin{matrix} R & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u6b27\u6c0f\u53d8\u6362\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u65cb\u8f6c\u4e00\u4e2a\uff0c\u5e73\u79fb\u4e8c\u4e2a\u3002 \u4e0d\u53d8\u91cf \uff1a\u957f\u5ea6(\u4e24\u70b9\u7684\u8ddd\u79bb)\uff0c\u89d2\u5ea6(\u4e24\u7ebf\u7684\u5939\u89d2)\u548c\u9762\u804c\u3002 \u7fa4\u548c\u5b9a\u5411 \u2003\u4fdd\u5411\u7684\u7b49\u8ddd\u53d8\u6362\u5f62\u6210\u4e00\u4e2a\u7fa4\uff0c\u4f46\u9006\u5411\u7684\u4e0d\u662f\u3002\u8fd9\u79cd\u533a\u522b\u5bf9\u4e8e\u4e0b\u9762\u7684\u76f8\u4f3c\u548c\u4eff\u5c04\u53d8\u6362\u540c\u6837\u5982\u6b64\u3002","title":"\u7b49\u8ddd\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_8","text":"\u76f8\u4f3c\u53d8\u6362\u662f\u4e00\u4e2a\u7b49\u8ddd\u53d8\u6362\u4e0e\u4e00\u4e2a\u5747\u5300\u7f29\u653e\u7684\u590d\u5408\u3002\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y\\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_S \\mathbf{x} = \\left[ \\begin{matrix} sR & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u4e0d\u53d8\u91cf \uff1a\u76f4\u7ebf\u7684\u5939\u89d2\uff0c\u4e24\u957f\u5ea6\u7684\u6bd4\u7387\u548c\u9762\u79ef\u7684\u6bd4\u7387\u3002","title":"\u76f8\u4f3c\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_9","text":"\u4eff\u5c04\u53d8\u6362\u662f\u4e00\u4e2a\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\u4e0e\u4e00\u4e2a\u5e73\u79fb\u53d8\u6362\u7684\u590d\u5408\uff0c\u5b83\u7684\u77e9\u9635\u8868\u793a\u4e3a\uff1a \\[ \\begin{pmatrix} x^\\prime \\\\ y^\\prime\\\\ 1 \\end{pmatrix} = \\left[ \\begin{matrix} a_{11} & a_{12} & t_x \\\\ a_{21} & a_{22} & t_y \\\\ 0 & 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} x \\\\ y \\\\ 1 \\end{pmatrix} \\] \u53ef\u4ee5\u7528\u66f4\u7b80\u6d01\u7684\u5206\u5757\u5f62\u5f0f\u5199\u4e3a \\[ \\mathbf{x}^\\prime = H_A \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u2002\u2002\u5e73\u9762\u4eff\u5c04\u53d8\u6362\u6709\u516d\u81ea\u7531\u5ea6\uff0c\u53ef\u4ee5\u7531\u4e09\u7ec4\u70b9\u5bf9\u5e94\u6765\u8ba1\u7b97\u3002 \u4e0d\u53d8\u91cf \uff1a\u5e73\u884c\u7ebf\uff0c\u5e73\u884c\u7ebf\u6bb5\u7684\u957f\u5ea6\u6bd4\u548c\u9762\u79ef\u6bd4\u3002","title":"\u4eff\u5c04\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_10","text":"\u5b83\u662f\u9f50\u6b21\u5750\u6807\u7684\u4e00\u822c\u975e\u5947\u5f02\u7ebf\u6027\u53d8\u6362\uff0c\u5176\u5206\u5757\u5f62\u5f0f\uff1a \\[ \\mathbf{x}^\\prime = H_P \\mathbf{x} = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\mathbf{x} \\] \u5176\u4e2d \\(\\mathbf{v}=(v_1, v_2)^{\\top}\\) \u3002 \u2002\u2002\u5c04\u5f71\u53d8\u6362\u7531\u516b\u4e2a\u53c2\u6570\u786e\u5b9a\uff0c\u53ef\u7531\u56db\u7ec4\u70b9\u5bf9\u5e94\u7b97\u51fa\uff0c \u4f46\u5176\u4e2d\u5c5e\u4e8e\u5411\u4e00\u5e73\u9762\u7684\u4e09\u70b9\u5fc5\u4e0d\u5171\u7ebf\u3002 \u4e0d\u53d8\u91cf \uff1a\u6700\u57fa\u672c\u7684\u5c04\u5f71\u4e0d\u53d8\u91cf\u662f\u56db\u5171\u7ebf\u70b9\u7684\u4ea4\u6bd4\u3002","title":"\u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/pjt2d/#_11","text":"\u5c04\u5f71\u53d8\u6362\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e32\u53d8\u6362\u94fe\u7684\u590d\u5408\uff0c\u94fe\u4e2d\u7684\u6bcf\u4e2a\u77e9\u9635\u6bd4\u5b83\u524d\u9762\u7684\u4e00\u4e2a\u77e9\u9635\u6240\u8868\u793a\u7684\u53d8\u6362\u5c42\u6b21\u9ad8\u3002 \\[ H = H_SH_AH_P = \\left[ \\begin{matrix} sR & \\mathbf{t}/v \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} K & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 1 \\\\ \\end{matrix} \\right] \\left[ \\begin{matrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] = \\left[ \\begin{matrix} A & \\mathbf{t} \\\\ \\mathbf{v}^{\\top} & v \\\\ \\end{matrix} \\right] \\] \u5176\u4e2d \\(A=sRK+\\mathbf{tv}^{\\top}/v\\) \uff0c\u800c \\(K\\) \u662f\u6ee1\u8db3 \\(det\\ K=1\\) \u7684\u5f52\u4e00\u5316\u4e0a\u4e09\u89d2\u77e9\u9635\u3002\u5982\u679c \\(v \\ne 0\\) \u4e0a\u8ff0\u5206\u89e3\u662f\u6709\u6548\u7684\uff0c\u800c\u4e14\u5982\u679c \\(s\\) \u53d6\u6b63\u503c\uff0c\u5b83\u8fd8\u662f\u552f\u4e00\u7684\u3002 \u4e0d\u53d8\u91cf\u7684\u6570\u76ee \uff1a\u4e0e\u51fd\u6570\u65e0\u5173\u7684\u4e0d\u53d8\u91cf\u6570\u7b49\u4e8e\u6216\u5927\u4e8e\u914d\u7f6e\u7684\u81ea\u7531\u5ea6\u6570\u51cf\u53bb\u53d8\u6362\u7684\u81ea\u7531\u5ea6\u6570\u3002","title":"\u5c04\u5f71\u53d8\u6362\u7684\u5206\u89e3"},{"location":"cv/mvg/pjt2d/#1d","text":"\u76f4\u7ebf\u4e0a\u7684\u70b9 \\(x\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a \\((x_1, x_2)^{\\top}\\) \uff0c\u800c \\((x_1, 0)^{\\top}\\) \u662f\u8be5\u76f4\u7ebf\u7684\u7406\u60f3\u70b9\u3002\u6211\u4eec\u5c06\u7528\u8bb0\u53f7 \\(\\mathbf{\\bar{x}}\\) \u8868\u793a \\(2\\) \u7ef4\u77e2\u91cf \\((x_1, x_2)^{\\top}\\) \u3002\u53ef\u7528\u9f50\u6b21\u77e9\u9635\u8868\u793a\uff1a \\[\\mathbf{\\bar{x}}^\\prime = H_{2 \\times 2} \\mathbf{\\bar{x}}\\]","title":"1D \u5c04\u5f71\u51e0\u4f55\u548c\u4ea4\u6bd4"},{"location":"cv/mvg/pjt2d/#_12","text":"\u4ea4\u6bd4\u662f \\(IP^1\\) \u7684\u57fa\u672c\u5c04\u5f71\u4e0d\u53d8\u91cf\u3002\u7ed9\u5b9a \\(4\\) \u4e2a\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \uff0c\u4ea4\u6bd4\u5b9a\u4e49\u4e3a \\[ Cross(\\mathbf{\\bar{x}_1},\\mathbf{\\bar{x}_2},\\mathbf{\\bar{x}_3},\\mathbf{\\bar{x}_4}) = \\frac{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_2}||\\mathbf{\\bar{x}_3}\\mathbf{\\bar{x}_4}|}{|\\mathbf{\\bar{x}_1}\\mathbf{\\bar{x}_3}||\\mathbf{\\bar{x}_2}\\mathbf{\\bar{x}_4}|} \\] \u5176\u4e2d \\[ |\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}| =det \\begin{bmatrix} x_{i1} & x_{j1} \\\\ x_{i2} & x_{j2} \\end{bmatrix} \\] \u4ea4\u6bd4\u7684\u4e3b\u8981\u7279\u70b9 \u4ea4\u6bd4\u7684\u503c\u4e0e\u5404\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u6240\u7528\u7684\u5177\u4f53\u7684\u9f50\u6b21\u8868\u793a\u65e0\u5173\u3002 \u5982\u679c\u6bcf\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u90fd\u662f\u6709\u9650\u70b9\uff0c\u5e76\u4e14\u5728\u9f50\u6b21\u8868\u793a\u4e2d\u5747\u9009\u62e9 \\(x_2 = 1\\) \uff0c\u90a3\u4e48 \\(|\\mathbf{\\bar{x}_i}\\mathbf{\\bar{x}_j}|\\) \u5c31\u8868\u793a\u7531 \\(\\mathbf{\\bar{x}_i}\\) \u5230 \\(\\mathbf{\\bar{x}_j}\\) \u7684\u5e26\u7b26\u53f7\u7684\u8ddd\u79bb\u3002 \u5982\u679c\u70b9 \\(\\mathbf{\\bar{x}_i}\\) \u4e2d\u6709\u4e00\u4e2a\u7406\u60f3\u70b9\uff0c\u4ea4\u6bd4\u7684\u5b9a\u4e49\u4ecd\u7136\u6709\u6548\u3002 \u5728\u4efb\u4f55\u76f4\u7ebf\u7684\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u4ea4\u6bd4\u7684\u503c\u4e0d\u53d8\u3002 \u5171\u70b9\u7ebf \u5171\u70b9\u7ebf\u662f\u76f4\u7ebf\u4e0a\u5171\u7ebf\u70b9\u7684\u5bf9\u5076\u3002\u8fd9\u610f\u5473\u7740\u5e73\u9762\u4e0a\u7684\u5171\u70b9\u7ebf\u4e5f\u6709\u51e0\u4f55 \\(IP^1\\) \u3002\u7279\u522b\u662f\uff0c\u4efb\u4f55\u56db\u6761\u5171\u70b9\u7ebf\u90fd\u6709\u4e00\u4e2a\u786e\u5b9a\u7684\u4ea4\u6bd4\u3002","title":"\u4ea4\u6bd4"},{"location":"cv/mvg/pjt2d/#_13","text":"\u5c04\u5f71\u77eb\u6b63\u7684\u76ee\u7684\u662f\u6d88\u9664\u5e73\u9762\u7684\u900f\u89c6\u56fe\u50cf\u4e2d\u7684\u5c04\u5f71\u5931\u771f\uff0c\u4f7f\u5f97\u539f\u59cb\u5e73\u9762\u7684\u76f8\u4f3c\u6027\u8d28\uff08\u89d2\u5ea6\u3001\u957f\u5ea6\u6bd4\uff09\u53ef\u4ee5\u88ab\u6d4b\u91cf\u3002","title":"\u4ece\u56fe\u50cf\u6062\u590d\u4eff\u5c04\u548c\u5ea6\u91cf\u6027\u8d28"},{"location":"cv/mvg/pjt2d/#_14","text":"\u5728\u5c04\u5f71\u53d8\u6362\u4e0b\uff0c\u7406\u60f3\u70b9\u53ef\u4ee5\u6620\u5c04\u4e3a\u6709\u9650\u70b9\uff0c\u56e0\u800c \\(I_{\\infty}\\) \u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\u3002\u4f46\u5982\u679c\u662f\u4eff\u5c04\u53d8\u6362\uff0c \\(I_{\\infty}\\) \u4e0d\u4f1a\u88ab\u6620\u5c04\u4e3a\u6709\u9650\u76f4\u7ebf\uff0c\u5373\u4ecd\u7559\u5728\u65e0\u7a77\u8fdc\u5904\uff0c\u663e\u7136\uff0c\u5b83\u53ef\u76f4\u63a5\u7531\u76f4\u7ebf\u7684\u53d8\u6362\u63a8\u51fa\uff1a \\[ I_{\\infty}^\\prime = H_A^{-T}I_{\\infty} = \\begin{bmatrix} A^{-T} & \\mathbf{0} \\\\ -\\mathbf{t}^{\\top}A^{-T} & 1 \\end{bmatrix} \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = \\begin{pmatrix} 0 \\\\ 0 \\\\ 1 \\end{pmatrix} = I_\\infty \\] \u7ed3\u8bba1 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u76f4\u7ebf \\(I_{\\infty}\\) \u4e3a\u4e0d\u52a8\u76f4\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4eff\u5c04\u53d8\u6362\u3002 \u2002\u2002\u5728\u5e73\u9762\u7684\u50cf\u4e2d\uff0c\u4e00\u4f46\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u5f97\u5230\u8fa8\u8ba4\uff0c\u5c31\u6709\u53ef\u80fd\u5bf9\u539f\u5e73\u9762\u8fdb\u884c\u4eff\u5c04\u6d4b\u91cf\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u76f4\u63a5\u628a\u5df2\u8fa8\u8ba4\u7684 \\(I_\\infty\\) \u53d8\u6362\u5230\u5b83\u7684\u89c4\u8303\u4f4d\u7f6e \\(I_\\infty = (0,0,1)^{\\top}\\) \u3002\u628a\u5b9e\u73b0\u6b64\u53d8\u6362\u7684(\u5c04\u5f71)\u77e9\u9635\u5e94\u7528\u4e8e\u56fe\u50cf\u4e2d\u7684\u6bcf\u4e00\u70b9\u4ee5\u8fbe\u5230\u5bf9\u56fe\u50cf\u8fdb\u884c\u4eff\u5c04\u77eb\u6b63\u7684\u76ee\u7684\uff0c\u5373\u53d8\u6362\u4e4b\u540e\uff0c\u4eff\u5c04\u6d4b\u91cf\u53ef\u4ee5\u76f4\u63a5\u5728\u77eb\u6b63\u8fc7\u7684\u56fe\u50cf\u4e2d\u8fdb\u884c\u3002 \u2002\u2002\u5982\u679c\u65e0\u7a77\u8fdc\u76f4\u7ebf\u7684\u50cf\u662f \\(\\mathbf{I} = (l_1, l_2, l_3)^{\\top}\\) \uff0c\u5047\u5b9a \\(l_3 \\ne 0\\) \uff0c\u90a3\u4e48\u628a \\(\\mathbf{l}\\) \u6620\u5c04\u56de \\(l_\\infty = (0,0,1)^{\\top}\\) \u7684\u4e00\u4e2a\u5408\u9002\u7684\u5c04\u5f71\u70b9\u4ea4\u6362\u662f \\[ H=H_A \\begin{bmatrix} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ l_1 & l_2 & l_3 \\end{bmatrix} \\] \u76f4\u7ebf\u4e0a\u7684\u8ddd\u79bb\u6bd4 \u7ed9\u5b9a\u4e00\u4e2a\u76f4\u7ebf\u4e0a\u6709\u5df2\u77e5\u957f\u5ea6\u6bd4\u7684\u4e24\u4e2a\u7ebf\u6bb5\uff0c\u8be5\u76f4\u7ebf\u4e0a\u7684\u65e0\u7a77\u8fdc\u70b9\u4fbf\u53ef\u4ee5\u786e\u5b9a\u3002","title":"\u65e0\u7a77\u8fdc\u7ebf"},{"location":"cv/mvg/pjt2d/#_15","text":"\u865a\u5706\u70b9 \u6bcf\u4e00\u5706\u5468\u4e0e \\(l_\\infty\\) \u76f8\u4ea4\u7684\u70b9\u79f0\u4e3a\u865a\u5706\u70b9\u3002 \u8bc1\u660e \u5728\u4e8c\u6b21\u66f2\u7ebf\u4e3a\u5706\u6709 \\(a=c\\) \u4e14 \\(b=0\\) \u3002\u53d6 \\(a=1\\) \u5219\uff1a \\[x_1^2+x_2^2+dx_1x_3+ex_2x_3=fx_3^2=0\\] \u8be5\u4e8c\u6b21\u66f2\u7ebf\u76f8\u4ea4\u4e8e \\(l_\\infty\\) \u4e8e(\u7406\u60f3)\u70b9( \\(x_3=0\\) )\uff1a \\[x_1^2+x_2^2=0\\] \u89e3\u5f97\u865a\u5706\u70b9\u7684\u6807\u51c6\u5750\u6807\u662f \\(\\mathbf{I}=(1,i,0)^{\\top}, \\; \\mathbf{J}=(1, -i, 0)^{\\top}\\) \u3002 \u8fd9\u4e00\u5bf9\u865a\u5706\u70b9\u662f\u590d\u5171\u8f6d\u7406\u60f3\u70b9\uff0c\u5b83\u4eec\u5728\u4fdd\u5411\u76f8\u4f3c\u53d8\u6362\u4e0b\u4e0d\u53d8\uff1a \\[ \\mathbf{I}^\\prime = H_S\\mathbf{I} = \\left[ \\begin{matrix} s\\cos \\theta & -s\\sin \\theta & t_x \\\\ s\\sin \\theta & s\\cos \\theta & t_y \\\\ 0& 0 & 1 \\end{matrix} \\right] \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = se^{-i \\theta} \\begin{pmatrix} 1 \\\\ i \\\\ 0 \\end{pmatrix} = \\mathbf{I} \\] \u7ed3\u8bba2 \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u865a\u5706\u70b9 \\(I\\) \u548c \\(J\\) \u4e3a\u4e0d\u52a8\u70b9\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362\u3002 \u2002\u2002\u4efb\u4f55\u5706\u90fd\u4ea4 \\(\\mathbf{I}_\\infty\\) \u4e8e\u865a\u5706\u70b9 . \u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\u4e00\u4e2a\u5706\u7531\u4e09\u70b9\u6307\u5b9a.\u865a\u5706\u70b9\u5f15\u51fa\u53e6 \u4e00\u79cd\u8ba1\u7b97.\u5706\u53ef\u4ee5\u7528\u7531\u4e94\u4e2a\u70b9\u5b9a\u4e49\u7684\u4e00\u822c\u4e8c\u6b21\u66f2\u7ebf\u7684\u516c\u5f0f\uff08\u4e09\u4e2a\u70b9\u52a0\u4e24\u4e2a\u865a\u5706\u70b9\uff09\u3002\u865a\u5706\u70b9\u662f\u628a\u6b27\u6c0f\u51e0\u4f55\u4e2d\u7684\u4e24\u6b63\u4ea4\u65b9\u5411\u5408\u5e76\u5230\u4e00\u4e2a\u590d\u5171\u8f6d\u4e2d\uff0c\u5373 \\[\\mathbf{I}=(1,0,0)^{\\top} + i(0,1,0)^{\\top}\\] \u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf \\[C_{\\infty}^* = \\mathbf{I}\\mathbf{J}^{\\top}+\\mathbf{J}\\mathbf{I}^{\\top}\\] \u7ed3\u8bba3 \u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_{\\infty}^*\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\u4e0d\u53d8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u76f8\u4f3c\u53d8\u6362\u3002 \u6b64\u5916\uff0c\u5728\u4efb\u4f55\u5c04\u5f71\u6846\u67b6\u4e0b\uff0c \\(C_{\\infty}^*\\) \u5177\u6709\u4e00\u4e9b\u6027\u8d28\uff1a \\(C_{\\infty}^*\\) \u6709 \\(4\\) \u4e2a\u81ea\u7531\u5ea6 \\(\\mathbf{I}_\\infty\\) \u662f \\(C_{\\infty}^*\\) \u7684\u96f6\u77e2\u91cf","title":"\u865a\u5706\u70b9\u53ca\u5176\u5bf9\u5076"},{"location":"cv/mvg/pjt2d/#_16","text":"\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c\u4e24\u7ebf\u95f4\u7684\u5939\u89d2\u7531\u5b83\u4eec\u6cd5\u7ebf\u7684\u70b9\u4e58\u6765\u8ba1\u7b97\u3002\u76f4\u7ebf \\(\\mathbf{I}=(l_1, l_2, l_3)^{\\top}\\) \u548c \\(\\mathbf{m}=(m_1, m_2, m_3)^{\\top}\\) \u7684\u6cd5\u7ebf\u5206\u522b\u5e73\u884c\u4e8e \\((l_1, l_2)^{\\top}\\) \\((m_1, m_2)^{\\top}\\) \uff0c\u5176\u5939\u89d2\u4e3a \\[\\cos \\theta = \\frac{l_1m_1+l_2m_2}{\\sqrt{(l_1^2+l_2^2)(m_1^2+m_2^2)}}\\] \u5728\u5c04\u5f71\u53d8\u6362\u4e0b\u4e0d\u53d8\u7684\u516c\u5f0f\u4e3a: \\[\\cos \\theta = \\frac{\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}}{\\sqrt{(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{I})(\\mathbf{m}^{\\top}C_{\\infty}^*\\mathbf{m})}}\\] \u5176\u4e2d \\(C_\\infty^*\\) \u662f\u4e0e\u865a\u5706\u70b9\u5bf9\u5076\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002 \u7ed3\u8bba4 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u6b27\u6c0f\u89d2\u53ef\u4ee5\u6d4b\u91cf\u3002 \u7ed3\u8bba5 \u5982\u679c \\(\\mathbf{I}^{\\top}C_{\\infty}^*\\mathbf{m}=\\mathbf{0}\\) \uff0c\u5219\u76f4\u7ebf \\(l\\) \u548c \\(m\\) \u6b63\u4ea4\u3002 \u7ed3\u8bba6 \u4e00\u65e6\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\u88ab\u8fa8\u8ba4\uff0c\u957f\u5ea6\u6bd4\u540c\u6837\u53ef\u4ee5\u6d4b\u91cf\u3002","title":"\u5c04\u5f71\u5e73\u9762\u4e0a\u7684\u5939\u89d2"},{"location":"cv/mvg/pjt2d/#_17","text":"\u628a\u865a\u5706\u70b9\u53d8\u6362\u5230\u5b83\u4eec\u7684\u6807\u51c6\u4f4d\u7f6e\uff0c\u5c31\u53ef\u4ee5\u7531\u5e73\u9762\u7684\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28\u3002\u5bf9\u5076\u4e8c\u6b21\u66f2\u7ebf \\(C_\\infty^*\\) \u200b\u51e0\u4e4e\u5305\u542b\u4e86\u5b9e\u73b0\u5ea6\u91cf\u77eb\u6b63\u6240\u9700\u7684\u5168\u90e8\u4fe1\u606f\u3002\u5b83\u80fd\u786e\u5b9a\u5c04\u5f71\u53d8\u6362\u4e2d\u7684\u4eff\u5c04\u548c\u5c04\u5f71\u6210\u5206\uff0c\u800c\u53ea\u7559\u4e0b\u76f8\u4f3c\u53d8\u6362\u7684\u5931\u771f\u3002 \u7ed3\u8bba7 \u5728\u5c04\u5f71\u5e73\u9762\u4e0a\uff0c\u4e00\u65e6 \\(C_\\infty^*\\) \u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u5c04\u5f71\u5931\u771f\u53ef\u4ee5\u77eb\u6b63\u5230\u76f8\u5dee\u4e00\u4e2a\u76f8\u4f3c\u53d8\u6362\u3002","title":"\u7531\u56fe\u50cf\u6062\u590d\u5ea6\u91cf\u6027\u8d28"},{"location":"cv/mvg/pjt2d/#_18","text":"","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u5176\u4ed6\u6027\u8d28"},{"location":"cv/mvg/pjt2d/#-","text":"\u70b9 \\(\\mathbf{x}\\) \u548c\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5b9a\u4e49\u4e00\u6761\u76f4\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \uff0c \\(\\mathbf{l}\\) \u79f0\u4e3a \\(\\mathbf{x}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u7ebf \uff0c\u800c\u70b9 \\(\\mathbf{x}\\) \u79f0\u4e3a \\(\\mathbf{l}\\) \u5173\u4e8e \\(C\\) \u7684 \u6781\u70b9 \u3002 \u70b9 \\(\\mathbf{x}\\) \u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u7684\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4ea4\u4e8e\u4e24\u70b9\u3002 \\(C\\) \u7684\u8fc7\u8fd9\u4e24\u70b9\u7684\u4e24\u6761\u5207\u7ebf\u76f8\u4ea4\u4e8e \\(\\mathbf{x}\\) \u3002 \u5982\u679c\u70b9 \\(x\\) \u5728 \\(C\\) \u4e0a\uff0c\u5219\u5b83\u7684\u6781\u7ebf\u5c31\u662f\u4e8c\u6b21\u66f2\u7ebf\u8fc7 \\(x\\) \u70b9\u7684\u5207\u7ebf\u3002 \u5bf9\u5c04 \u5b9a\u4e49 \uff1a\u5bf9\u5c04\u662f \\(IP^2\\) \u70b9\u5230 \\(IP^2\\) \u7ebf\u7684\u53ef\u9006\u6620\u5c04\u3002\u5e76\u7528\u4e00\u4e2a \\(3 \\times 3\\) \u975e\u5947\u5f02\u77e9\u9635 \\(A\\) \u8868\u793a\u4e3a \\(\\mathbf{l}=A\\mathbf{x}\\) \u3002 \u5171\u8f6d\u70b9 \uff1a\u5982\u679c\u70b9 \\(y\\) \u5728\u6781\u7ebf \\(\\mathbf{l}=C\\mathbf{x}\\) \u4e0a\uff0c\u5219 \\(\\mathbf{y}^{\\top}\\mathbf{l}=\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u3002\u6ee1\u8db3 \\(\\mathbf{y}^{\\top}C\\mathbf{x}=0\\) \u7684\u4efb\u4f55\u4e24\u70b9 \\(x,y\\) \u79f0\u4e3a\u5173\u4e8e\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5171\u8f6d\u3002 \u5982\u679c \\(\\mathbf{x}\\) \u5728 \\(\\mathbf{y}\\) \u7684\u6781\u7ebf\u4e0a\uff0c\u90a3\u4e48 \\(\\mathbf{y}\\) \u4e5f\u5728 \\(\\mathbf{x}\\) \u7684\u6781\u7ebf\u4e0a\u3002","title":"\u6781\u70b9-\u6781\u7ebf\u5173\u7cfb"},{"location":"cv/mvg/pjt2d/#_19","text":"","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u5206\u7c7b"},{"location":"cv/mvg/pjt2d/#_20","text":"\u4efb\u4f55\u4e8c\u6b21\u66f2\u7ebf\u90fd\u5c04\u5f71\u7b49\u4ef7\u4e8e\u4e00\u4e2a\u7531\u5bf9\u89d2\u77e9\u9635\u8868\u793a\u7684\u4e8c\u6b21\u66f2\u7ebf\u3002\u4e8c\u6b21\u66f2\u7ebf \\(D\\) \u6700\u7ec8\u88ab\u8868\u793a\u4e3a\u5177\u6709\u77e9\u9635 \\(diag(\\varepsilon_1, \\varepsilon_2, \\varepsilon_3)\\) \u7684\u4e8c\u6b21\u66f2\u7ebf\uff0c\u5176\u4e2d \\(\\varepsilon_i=\\pm 1\\) \u6216 \\(0\\) \u3002 \u5bf9\u89d2\u7ebf \u65b9\u7a0b \u4e8c\u6b21\u66f2\u7ebf\u7c7b\u578b \\((1,1,1)\\) \\(x^2+y^2+w^2=0\\) \u5047\u4e8c\u6b21\u66f2\u7ebf--\u65e0\u5b9e\u70b9 \\((1,1,-1)\\) \\(x^2+y^2-w^2=0\\) \u5706 \\((1,1,0)\\) \\(x^2+y^2=0\\) \u5355\u4e2a\u5b9e\u70b9 \\((0,0,1)^{\\top}\\) \\((1,-1,0)\\) \\(x^2-y^2=0\\) \u4e24\u6761\u76f4\u7ebf \\(x=\\pm y\\) \\((1,0,0)\\) \\(x^2=0\\) \u5355\u6761\u76f4\u7ebf \\(x=0\\) \u8ba1\u4e24\u6b21","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u5c04\u5f71\u6807\u51c6\u5f62\u5f0f"},{"location":"cv/mvg/pjt2d/#_21","text":"\u5728\u6b27\u6c0f\u51e0\u4f55\u4e2d\uff0c(\u975e\u9000\u5316\u6216\u771f)\u4e8c\u6b21\u66f2\u7ebf\u53ef\u4ee5\u5206\u4e3a\u53cc\u66f2\u7ebf\u3001\u692d\u5706\u548c\u629b\u7269\u7ebf\u3002\u5728\u5c04\u5f71\u51e0\u4f55\u4e2d\u4e09\u79cd\u7c7b\u578b\u7684\u4e8c\u6b21\u66f2\u7ebf\u4e0e \\(l_\\infty\\) \u7684\u5173\u7cfb\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u4e0a\u56fe\u4e2d\u4e8c\u6b21\u66f2\u7ebf\u662f \\((a)\\) \u692d\u5706\uff0c \\((b)\\) \u629b\u7269\u7ebf\uff0c \\((c)\\) \u53cc\u66f2\u7ebf\u3002\u5b83\u4eec\u4e0e \\(l_{\\infty}\\) \u7684\u5173\u7cfb : \\((a)\\) \u65e0\u5b9e\u4ea4\u70b9\u3001 \\((b)\\) \u76f8\u5207( \\(2\\) \u70b9\u63a5\u89e6)\u3001 \\((c)\\) \u6709 \\(2\\) \u4e2a\u5b9e\u4ea4\u70b9\u3002","title":"\u4e8c\u6b21\u66f2\u7ebf\u7684\u4eff\u5c04\u5206\u7c7b"},{"location":"cv/mvg/pjt2d/#_22","text":"\u53d8\u6362\u7684\u4e00\u4e2a \u7279\u5f81\u77e2\u91cf \u5bf9\u5e94\u4e00\u4e2a \u4e0d\u52a8\u70b9 \uff0c\u56e0\u4e3a\u5bf9\u4e8e\u7279\u5f81\u503c \\(\\lambda\\) \u53ca\u5176\u5bf9\u5e94\u7684\u7279\u5f81\u77e2\u91cf \\(e\\) \u6709: \\[H\\mathbf{e} = \\lambda \\mathbf{e}\\] \u2002\u2002\u800c \\(\\mathbf{e}\\) \u548c \\(\\lambda \\mathbf{e}\\) \u8868\u793a\u540c\u4e00\u70b9\u3002\u7c7b\u4f3c\u7684\u63a8\u5bfc\u53ef\u4ee5\u7528\u4e8e\u4e0d\u52a8\u76f4\u7ebf\uff0c\u5b83\u5bf9\u5e94\u4e8e \\(H^{\\top}\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002 \u5e73\u9762\u5c04\u5f71\u53d8\u6362\u7684\u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf \u8fd9\u91cc\u6709\u4e09\u4e2a\u4e0d\u52a8\u70b9\u548c\u8fc7\u8fd9\u4e09\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf.\u4e0d\u52a8\u76f4\u7ebf\u548c\u4e0d\u52a8\u70b9\u53ef\u80fd\u662f\u590d\u7684\uff1a\u4ece\u4ee3\u6570\u7684\u89d2\u5ea6\u6765\u8bf4\uff0c\u4e0d\u52a8\u70b9\u662f\u70b9\u53d8\u6362 \\((\\mathbf{x}^\\prime=H\\mathbf{x})\\) \u7684\u7279\u5f81\u77e2\u91cf \\(\\mathbf{e}_i\\) \uff0c\u800c\u4e0d\u52a8\u76f4\u7ebf\u662f\u7ebf\u53d8\u6362 \\((\\mathbf{l}^\\prime =H^{-T}\\mathbf{l})\\) \u7684\u7279\u5f81\u77e2\u91cf\u3002\u6ce8\u610f\uff0c\u4e0d\u52a8\u76f4\u7ebf\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\uff1a\u5728\u53d8\u6362\u4e0b\uff0c\u76f4\u7ebf\u4e0a\u7684\u4e00\u70b9\u88ab\u6620\u4e3a\u5176\u4e0a\u7684\u53e6\u4e00\u70b9\uff0c\u53ea\u6709\u4e0d\u52a8\u70b9\u624d\u6620\u4e3a\u81ea\u8eab\u3002","title":"\u4e0d\u52a8\u70b9\u4e0e\u76f4\u7ebf"},{"location":"cv/mvg/pjt2d/#_23","text":"\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u662f\u865a\u5706\u70b9 \\(\\mathbf{I},\\mathbf{J}\\) \u7ec4\u6210\u7684\u590d\u5171\u8f6d\u5bf9\uff0c\u76f8\u5bf9\u5e94\u7684\u7279\u5f81\u503c\u662f \\(|e^{i \\theta}, e^{-i \\theta}|\\) \uff0c\u8fd9\u91cc \\(\\theta\\) \u662f\u65cb\u8f6c\u89d2\u3002\u5bf9\u5e94\u4e8e\u7279\u5f81\u503c \\(1\\) \u7684\u7b2c\u4e09\u4e2a\u7279\u5f81\u5411\u91cf\uff0c\u79f0\u4e3a \\(\u6781\u70b9\\) \u3002\u6b27\u6c0f\u53d8\u6362\u7b49\u4ef7\u4e8e\u7ed5\u8be5\u70b9\u8f6c \\(\\theta\\) \u89d2\u7684\u7eaf\u65cb\u8f6c\u5e76\u4e14\u6ca1\u6709\u5e73\u79fb\u3002 \u4e00\u79cd\u7279\u6b8a\u7684\u60c5\u8bc6\u662f\u7eaf\u5e73\u79fb(\u5373 \\(\\theta=0\\) )\u3002\u8fd9\u65f6\u7279\u5f81\u503c\u4e09\u91cd\u9000\u5316\uff0c\u8fd9\u662f\u7ea6\u675f\u900f\u89c6\u53d8\u6362\u7684\u4e00\u4e2a\u4f8b\u5b50\u3002","title":"\u6b27\u6c0f\u77e9\u9635"},{"location":"cv/mvg/pjt2d/#_24","text":"\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u4ecd\u662f\u865a\u5706\u70b9\u3002\u7279\u5f81\u503c\u662f \\(|1,se^{i \\theta}, se^{-i \\theta}|\\) \u3002\u76f8\u4f3c\u53d8\u6362\u7684\u4f5c\u7528\u53ef\u4ee5\u7406\u89e3\u4e3a\u7ed5\u5b83\u7684\u6709\u9650\u4e0d\u52a8\u70b9\u7684\u65cb\u8f6c\u548c\u53d6 \\(s\\) \u4e3a\u56e0\u5b50\u7684\u5747\u5300\u7f29\u653e\u3002\u6ce8\u610f\u865a\u5706\u70b9\u7684\u7279\u5f81\u503c\u4ecd\u7136\u8868\u5f81\u65cb\u8f6c\u89d2\u3002","title":"\u76f8\u4f3c\u77e9\u9635"},{"location":"cv/mvg/pjt2d/#_25","text":"\u4e24\u4e2a\u4e0d\u52a8\u7406\u60f3\u70b9\u53ef\u4ee5\u662f\u5b9e\u6216\u590d\u5171\u8f6d\u7684\uff0c\u4f46\u5728\u4efb\u4f55\u4e00\u79cd\u60c5\u51b5\u4e0b\uff0c\u8fc7\u8fd9\u4e9b\u70b9\u7684\u4e0d\u52a8\u76f4\u7ebf \\(\\mathbf{l}_\\infty=(0,0,1)^{\\top}\\) \u662f\u5b9e\u7684\u3002","title":"\u4eff\u5c04\u77e9\u9635"},{"location":"cv/mvg/pjt3d/","text":"3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362 \u00b6 \u7ea6 2831 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecd 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4 \\(IP^3\\) \u7684\u6027\u8d28\u548c\u57fa\u672c\u8981\u7d20\u3002 \u70b9\u548c\u5c04\u5f71\u53d8\u6362 \u00b6 \u4e09\u7ef4\u7a7a\u95f4\u7684\u4e00\u70b9 \\(\\mathbf{X}\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a\u4e00\u4e2a 4 \u7ef4\u77e2\u91cf\uff0c\u9f50\u6b21\u77e2\u91cf \\(\\mathbf{X}=(X_1,X_2,X_3,X_4)^{\\top}\\) \u5f53 \\(X_4 \\ne 0\\) \u65f6\u8868\u793a\u4e3a \\(IR^3\\) \u4e2d\u975e\u9f50\u6b21\u5750\u6807\u4e3a \\((X,Y,Z)^{\\top}\\) \u7684\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{X}=X_1/X_4,Y=X_2/X_4,Z=X_3/X_4\\) \u3002 \u5f53 \\(X_4=0\\) \u7684\u9f50\u6b21\u70b9\u8868\u793a\u65e0\u7a77\u8fdc\u70b9\u3002 \\(IR^3\\) \u4e0a\u7684\u5c04\u5f71\u53d8\u6362\u662f\u7531\u975e\u5947\u5f02 \\(4 \\times 4\\) \u77e9\u9635\u7ed9\u51fa\uff0c\u5b83\u662f\u5173\u4e8e\u9f50\u6b21 4 \u7ef4\u77e2\u91cf\u7684\u7ebf\u6027\u53d8\u6362\uff1a \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \uff0c\u8be5\u6620\u5c04\u662f\u4fdd\u7ebf\u53d8\u6362\uff08\u76f4\u7ebf\u88ab\u6620\u5c04\u5230\u76f4\u7ebf\uff09\u3002 \u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u9762\u7684\u8868\u793a\u548c\u53d8\u6362 \u00b6 \u5e73\u9762 \u00b6 \u5e73\u9762\u7684\u9f50\u6b21\u8868\u793a\u4e3a \\(\\mathbf{\\pi}=(\\pi_1, \\pi_2, \\pi_3, \\pi_4)^{\\top}\\) \u3002 \u70b9 \\(\\mathbf{X}\\) \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u5219\uff1a \\(\\mathbf{\\pi}^{\\top}\\mathbf{X}=0\\) \u8054\u5408\u4e0e\u5173\u8054\u5173\u7cfb \u5e73\u9762\u53ef\u7531\u4e00\u822c\u4f4d\u7f6e\u7684\u4e09\u4e2a\u70b9\u6216\u4e00\u6761\u76f4\u7ebf\u4e0e\u4e00\u4e2a\u70b9\u7684\u8054\u5408\u6765\u552f\u4e00\u786e\u5b9a\uff08\u4e00\u822c\u4f4d\u7f6e\u6307\u4e09\u70b9\u4e0d\u5171\u7ebf\u6216\u5728\u540e\u4e00\u79cd\u60c5\u5f62\u4e0b\u6307\u70b9\u4e0d\u5728\u76f4\u7ebf\u4e0a\uff09 \u4e24\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u76f4\u7ebf \u4e09\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u70b9 \u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762 \u786e\u5b9a\u5e73\u9762\u7684\u4e09\u4e2a\u70b9\u662f \\(\\mathbf{X}_1=(\\hat{\\mathbf{X}_1})^{\\top}\u3001\\mathbf{X}_2=(\\hat{\\mathbf{X}_2})^{\\top}\u3001\\mathbf{X}_3=(\\hat{\\mathbf{X}_3})^{\\top}\\) \uff0c\u5219 \\[ \\mathbf{\\pi}=((\\hat{\\mathbf{X}_1}-\\hat{\\mathbf{X}_3}) \\times (\\hat{\\mathbf{X}_2}-\\hat{\\mathbf{X}_3}), -\\hat{\\mathbf{X}_3}^{\\top}(\\hat{\\mathbf{X}_1} \\times \\hat{\\mathbf{X}_2}))^{\\top} \\] \u4e09\u5e73\u9762\u786e\u5b9a\u4e00\u70b9 \u4e09\u5e73\u9762 \\(\\mathbf{\\pi}_i\\) \u7684\u4ea4\u70b9 \\(\\mathbf{X}\\) \u53ef\u901a\u8fc7\u6c42\u4ee5\u4e09\u5f20\u5e73\u9762\u4e3a\u884c\u7684 \\(3 \\times 4\\) \u77e9\u9635\u7684\uff08\u53f3\uff09\u96f6\u7a7a\u95f4\u76f4\u63a5\u8ba1\u7b97\u51fa\u6765\uff1a \\[ \\begin{bmatrix} \\mathbf{\\pi}_1^{\\top}\\\\ \\mathbf{\\pi}_2^{\\top}\\\\ \\mathbf{\\pi}_3^{\\top} \\end{bmatrix} \\mathbf{X}=\\mathbf{0} \\] \u5c04\u5f71\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u5e73\u9762\u53d8\u6362\u4e3a \\(\\mathbf{\\pi}^\\prime=H^{-\\top}\\mathbf{\\pi}\\) \u5e73\u9762\u4e0a\u7684\u70b9\u7684\u53c2\u6570\u8868\u793a \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u7684\u70b9 \\(\\mathbf{X}\\) \u53ef\u4ee5\u5199\u6210 \\(\\mathbf{X}=M\\mathbf{x}\\) \u5176\u4e2d \\(4 \\times 3\\) \u77e9\u9635 \\(M\\) \u7684\u5217\u751f\u6210 \\(\\mathbf{\\pi}^{\\top}\\) \u7684\u79e9\u4e3a 3 \u7684\u96f6\u7a7a\u95f4\uff0c\u5373 \\(\\mathbf{\\pi}^{\\top} M=\\mathbf{0}^{\\top}\\) \u76f4\u7ebf \u00b6 \u96f6\u7a7a\u95f4 \u4e00\u4e2a\u7b97\u5b50 \\(\\mathbf{A}\\) \u7684\u96f6\u7a7a\u95f4\u662f \\(\\mathbf{A}\\mathbf{v}=\\mathbf{0}\\) \u7684\u6240\u6709\u89e3 \\(\\mathbf{v}\\) \u7684\u96c6\u5408\u3002\u5b83\u4e5f\u53eb\u505a \\(\\mathbf{A}\\) \u7684\u6838\uff0c\u6838\u7a7a\u95f4\u3002\u5982\u679c\u7b97\u5b50\u662f\u5728\u5411\u91cf\u7a7a\u95f4\u4e0a\u7684\u7ebf\u6027\u7b97\u5b50\uff0c\u96f6\u7a7a\u95f4\u5c31\u662f\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002\u56e0\u6b64\u96f6\u7a7a\u95f4\u4e5f\u662f\u5411\u91cf\u7a7a\u95f4\u3002 \u751f\u6210\u5b50\u7a7a\u95f4 \u8bbe \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u662f \\(R^m\\) \u4e2d\u4efb\u4e00\u7ec4\u5411\u91cf\u3002\u8bb0 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u7684\u6240\u6709\u7ebf\u6027\u7ec4\u5408\u7684\u96c6\u5408\u4e3a \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \uff0c\u5373 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)=\\{k_1\\alpha_1+k_2\\alpha_2+...+k_m\\alpha_m | k_i \\in R, i=1,2,...,m\\}\\) \uff0c\u79f0 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \u4e3a\u5411\u91cf\u7ec4 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u751f\u6210\u7684\u5b50\u7a7a\u95f4\u3002 \u96f6\u7a7a\u95f4\u4e0e\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a \u5047\u5b9a \\(\\mathbf{A}\u3001\\mathbf{B}\\) \u662f\u4e24\uff08\u4e0d\u91cd\u5408\uff09\u7684\u7a7a\u95f4\u70b9\uff0c\u90a3\u4e48\u8fde\u63a5\u8fd9\u4e24\u70b9\u7684\u76f4\u7ebf\u7531\u4e00\u4e2a \\(2 \\times 4\\) \u77e9\u9635 \\(W\\) \u7684\u884c\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a\uff0c \\(W=\\begin{bmatrix} \\mathbf{A}^{\\top} \\\\ \\mathbf{B}^{\\top} \\end{bmatrix}\\) \\(W^{\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u5728\u76f4\u7ebf \\(\\lambda \\mathbf{A}+\\mu \\mathbf{B}\\) \u4e0a\u7684\u70b9\u675f \\(W\\) \u7684 2 \u7ef4\u53f3\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \u4e00\u6761\u76f4\u7ebf\u7684\u5bf9\u5076\u8868\u793a\u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}\uff0c\\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u8be5\u76f4\u7ebf\u8868\u793a\u4e3a\u77e9\u9635 \\(W^*=\\begin{bmatrix} \\mathbf{P}^{\\top} \\\\ \\mathbf{Q}^{\\top} \\end{bmatrix}\\) \\(W^{*\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u8be5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \\(\\lambda^\\prime\\mathbf{P}+\\mu^\\prime\\mathbf{Q}\\) \\(W^{*\\top}\\) \u7684 2 \u7ef4\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u8be5\u76f4\u7ebf\u4e0a\u7684\u70b9\u675f \u8fd9\u4e24\u79cd\u8868\u793a\u4ee5 \\(W^*W^{\\top}=WW^{*\\top}=0_{2\\times 2}\\) \u76f8\u8054\u7cfb Pl\u00fccker \u77e9\u9635 \u8fd9\u91cc\u4e00\u6761\u76f4\u7ebf\u7531 \\(4 \\times 4\\) \u53cd\u5bf9\u79f0\u9f50\u6b21\u77e9\u9635\u8868\u793a\u3002\u8fde\u63a5\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u76f4\u7ebf\u7531\u77e9\u9635 \\(\\mathbf{L}\\) \u8868\u793a\uff0c\u5176\u5143\u7d20\u4e3a\uff1a \\(l_{ij}=A_iB_j-B_iA_j\\) \uff0c\u6216\u7528\u77e2\u91cf\u8bb0\u53f7\u7b49\u4ef7\u4e8e\u8868\u793a\u4e3a \\(L=\\mathbf{A}\\mathbf{B}^{\\top}-\\mathbf{B}\\mathbf{A}^{\\top}\\) \u6027\u8d28 \\(L\\) \u7684\u79e9\u4e3a 2 \u8be5\u8868\u793a\u5177\u6709\u63cf\u8ff0\u4e00\u6761\u76f4\u7ebf\u6240\u9700\u8981\u7684 4 \u4e2a\u81ea\u7531\u5ea6 \u77e9\u9635 \\(L\\) \u4e0e\u7528\u6765\u786e\u5b9a\u5b83\u7684\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u65e0\u5173 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u8be5\u77e9\u9635\u53d8\u6362\u4e3a \\(L^\\prime=HLH^{\\top}\\) \u65f6\uff0c\u5373\u5b83\u662f\u4e00\u4e2a\u9636\u4e3a 2 \u7684\u5f20\u91cf \u7531\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\u786e\u5b9a\u7684\u76f4\u7ebf\u7684\u5bf9\u5076 Pl\u00fccker \u8868\u793a\u4e3a \\(L^*\\) \u4e3a \\(L^*=\\mathbf{P}\\mathbf{Q}^{\\top}-\\mathbf{Q}\\mathbf{P}^{\\top}\\) \u7531\u70b9 \\(\\mathbf{X}\\) \u548c\u76f4\u7ebf \\(L\\) \u8054\u5408\u800c\u786e\u5b9a\u7684\u5e73\u9762\u4e3a \\(\\mathbf{\\pi}=L^*\\mathbf{X}\\) \uff0c\u5e76\u4e14 \\(L^*\\mathbf{X}=0\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(\\mathbf{X}\\) \u5728 \\(L\\) \u4e0a \u7531\u76f4\u7ebf \\(L\\) \u548c\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u76f8\u4ea4\u800c\u786e\u5b9a\u7684\u70b9\u4e3a \\(\\mathbf{X}=L\\mathbf{\\pi}\\) \uff0c\u5e76\u4e14 \\(L\\mathbf{\\pi}=\\mathbf{0}\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(L\\) \u5728 \\(\\mathbf{\\pi}\\) \u4e0a Pl\u00fccker \u76f4\u7ebf\u5750\u6807 Pl\u00fccker \u76f4\u7ebf\u5750\u6807\u662f \\(4 \\times 4\\) \u53cd\u5bf9\u79f0 Pl\u00fccker \u77e9\u9635 \\(L\\) \u7684\u516d\u4e2a\u975e\u96f6\u5143\u7d20\uff0c\u5373 \\(\\mathcal{L}=\\{l_{12},l_{13},l_{14},l_{23},l_{42},l_{34}\\}\\) \u7531\u4e8e \\(\\det{L}=0\\) \uff0c\u6240\u4ee5\u5750\u6807\u6ee1\u8db3 \\(l_{12}l_{34}+l_{13}l_{42}+l_{14}l_{23}=0\\) \u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}\\) \u548c \\(\\hat{\\mathcal{L}}\\) \u5171\u9762\uff08\u56e0\u800c\u76f8\u4ea4\uff09\u7684\u5145\u8981\u6761\u4ef6\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \uff0c\u5219 6 \u7ef4\u77e2\u91cf \\(\\mathcal{L}\\) \u4ec5\u8868\u793a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u76f4\u7ebf \u5047\u5b9a\u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}, \\hat{\\mathcal{L}}\\) \u5206\u522b\u4e3a\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u548c \\(\\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}\\) \u7684\u4ea4\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=\\det [\\mathbf{P}, \\mathbf{Q}, \\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}]\\) \uff0c\u540c\u7406\uff0c\u4e24\u6761\u76f4\u7ebf\u76f8\u4ea4\u7684\u5145\u8981\u6761\u4ef6\u5c31\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\(\\mathcal{L}\\) \u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u800c \\(\\hat{\\mathcal{L}}\\) \u662f\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u8fde\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=(\\mathbf{P}^{\\top}\\mathbf{A})(\\mathbf{Q}^{\\top}\\mathbf{B})-(\\mathbf{Q}^{\\top}\\mathbf{A})(\\mathbf{P}^{\\top}\\mathbf{B})\\) \u4e8c\u6b21\u66f2\u9762\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \u00b6 \\(IP^3\\) \u4e2d\uff0c\u4e8c\u6b21\u66f2\u9762\u7531\u4e0b\u5217\u65b9\u7a0b\u5b9a\u4e49\uff1a \\(\\mathbf{X}^{\\top} Q\\mathbf{X}=0\\) \uff0c\u5176\u4e2d \\(Q\\) \u662f\u4e00\u4e2a \\(4 \\times 4\\) \u7684\u5bf9\u79f0\u77e9\u9635 \u4e2a\u4e8c\u6b21\u66f2\u9762\u6709 9 \u4e2a\u81ea\u7531\u5ea6 \u4e00\u822c\u4f4d\u7f6e\u4e0a\u7684\u4e5d\u4e2a\u70b9\u786e\u5b9a\u4e00\u4e2a\u4e8c\u6b21\u66f2\u9762 \u5982\u679c\u77e9\u9635 \\(Q\\) \u662f\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u4e8c\u6b21\u66f2\u9762\u662f\u9000\u5316\u7684\uff0c\u5e76\u53ef\u4ee5\u7531\u8f83\u5c11\u7684\u70b9\u6765\u786e\u5b9a \u4e8c\u6b21\u66f2\u9762\u5b9a\u4e49\u4e86\u70b9\u548c\u5e73\u9762\u4e4b\u95f4\u7684\u4e00\u79cd\u914d\u6781\uff0c\u7c7b\u4f3c\u4e8e\u4e8c\u6b21\u66f2\u7ebf\u5728\u70b9\u548c\u76f4\u7ebf\u4e4b\u95f4\u5b9a\u4e49\u7684\u914d\u6781\uff0c\u5e73\u9762 \\(\\mathbf{\\pi}=Q\\mathbf{X}\\) \u79f0\u4e3a\u662f \\(\\mathbf{X}\\) \u5173\u4e8e \\(Q\\) \u7684\u6781\u5e73\u9762\uff0c\u5f53 \\(Q\\) \u4e3a\u975e\u5947\u5f02\u5e76\u4e14 \\(\\mathbf{X}\\) \u5728\u4e8c\u6b21\u66f2\u9762\u4e4b\u5916\u65f6\uff0c\u6781\u5e73\u9762\u7531\u8fc7 \\(\\mathbf{X}\\) \u4e14\u4e0e \\(Q\\) \u76f8\u5207\u7684\u5c04\u7ebf\u7ec4\u6210\u7684\u9525\u4e0e \\(Q\\) \u60f3\u63a5\u89e6\u7684\u70b9\u6765\u5b9a\u4e49\u3002\u5982\u679c \\(\\mathbf{X}\\) \u5728 \\(Q\\) \u4e0a\uff0c\u90a3\u4e48 \\(Q\\mathbf{X}\\) \u662f \\(Q\\) \u5728\u70b9 \\(\\mathbf{X}\\) \u7684\u5207\u5e73\u9762 \u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u4ea4\u7ebf\u662f\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u9762\u53d8\u6362\u4e3a \\(Q^\\prime=H^{-\\top}QH^{-1}\\) \u4e8c\u6b21\u66f2\u9762\u7684\u5206\u7c7b \u00b6 \u5bf9\u89d2\u77e9\u9635 \\(D\\) \u7684\u7b26\u53f7\u5dee\uff0c\u8bb0\u4e3a \\(\\sigma(D)\\) \uff0c\u5b9a\u4e49\u4e3a \\(D\\) \u4e2d +1 \u7684\u4e2a\u6570\u4e0e -1 \u7684\u4e2a\u6570\u7684\u5dee\u503c \u4e09\u6b21\u7ed5\u7ebf \u00b6 \u4e09\u6b21\u7ed5\u7ebf\u53ef\u4ee5\u770b\u6210 2D \u4e8c\u6b21\u66f2\u7ebf\u7684 3 \u7ef4\u7c7b\u63a8\u3002\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u5b9a\u4e49\u4e3a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u66f2\u7ebf\uff0c\u5b83\u7684\u53c2\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ \\begin{bmatrix} x_1 \\\\ x_2 \\\\ x_3 \\\\ x_4 \\end{bmatrix} = A \\begin{bmatrix} 1 \\\\ \\theta \\\\ \\theta^2 \\\\ \\theta^3 \\end{bmatrix} = \\begin{bmatrix} a_{11}+a_{12}\\theta+a_{13}\\theta^2+a_{14}\\theta^3 \\\\ a_{21}+a_{22}\\theta+a_{23}\\theta^2+a_{24}\\theta^3 \\\\ a_{31}+a_{32}\\theta+a_{33}\\theta^2+a_{34}\\theta^3 \\\\ a_{41}+a_{42}\\theta+a_{43}\\theta^2+a_{44}\\theta^3 \\end{bmatrix} \\] \u6027\u8d28 \u4ee4 \\(\\mathbf{c}\\) \u4e3a\u4e00\u6761\u975e\u5947\u5f02\u4e09\u6b21\u7ed5\u7ebf\u3002\u90a3\u4e48 \\(\\mathbf{c}\\) \u4e0d\u6574\u4e2a\u5730\u5305\u542b\u5728 \\(IP^3\\) \u7684\u4efb\u4f55\u4e00\u5f20\u5e73\u9762\u4e2d\uff0c\u800c\u662f\u4e0e\u4e00\u822c\u5e73\u9762\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u4ea4\u70b9 \u4e09\u6b21\u7ed5\u7ebf\u6709 12 \u4e2a\u81ea\u7531\u5ea6 \u6240\u6709\u975e\u9000\u5316\u7684\u4e09\u6b21\u7ed5\u7ebf\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684 \u53d8\u6362\u7684\u5c42\u6b21 \u00b6 3 \u7ef4\u7a7a\u95f4\u53d8\u6362\u540c\u6837\u5177\u6709\u76f8\u5e94\u7684 2 \u7ef4\u7a7a\u95f4\u53d8\u6362 \u9ad8\u65af\u66f2\u7387 \uff1a\u5fae\u5206\u51e0\u4f55\u4e2d\uff0c\u66f2\u9762\u4e0a\u4e00\u70b9\u7684\u9ad8\u65af\u66f2\u7387\u662f\u8be5\u70b9\u4e3b\u66f2\u7387 \\(k_1\\) \u548c \\(k_2\\) \u7684\u4e58\u79ef\u3002\u5b83\u662f\u66f2\u7387\u7684\u5185\u5728\u5ea6\u91cf\uff0c\u4e5f\u5373\uff0c\u5b83\u7684\u503c\u53ea\u4f9d\u8d56\u4e8e\u66f2\u9762\u4e0a\u7684\u8ddd\u79bb\u5982\u4f55\u6d4b\u91cf\uff0c\u800c\u4e0d\u662f\u66f2\u9762\u5982\u4f55\u5d4c\u5165\u5230\u7a7a\u95f4\u3002 \u8f6c\u52a8\u5206\u89e3 \u4efb\u4f55\u5177\u4f53\u7684\u5e73\u79fb\u52a0\u65cb\u8f6c\u8fd0\u52a8\u90fd\u7b49\u4ef7\u4e8e\u7ed5\u4e00\u6839\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u52a0\u6cbf\u8be5\u8f6c\u52a8\u8f74\u7684\u5e73\u79fb\u3002\u8be5\u8f6c\u52a8\u8f74\u5e73\u884c\u4e8e\u539f\u6765\u7684\u65cb\u8f6c\u8f74\u3002 \u5e73\u79fb\u52a0\u7ed5\u6b63\u4ea4\u8f74\u7684\u65cb\u8f6c\u8fd0\u52a8(\u79f0\u5e73\u9762\u8fd0\u52a8)\u7b49\u4ef7\u4e8e\u4ec5\u4ec5\u7ed5\u67d0\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u3002 \u65e0\u7a77\u8fdc\u5e73\u9762 \u00b6 \u5728 3 \u7ef4\u7a7a\u95f4\u7684\u5c04\u5f71\u51e0\u4f55\u4e2d\uff0c\u4e0e \\(\\mathbf{I}_{\\infty}\\) \u7684\u865a\u5706\u70b9\u5bf9\u5e94\u7684\u51e0\u4f55\u5b9e\u4f53\u662f\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_{\\infty}\\) \u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u4eff\u5c04\u7a7a\u95f4\u4e2d\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u6807\u51c6\u4f4d\u7f6e\u662f \\(\\mathbf{\\pi}_\\infty=(0,0,0,1)^{\\top}\\) \uff0c \\(\\mathbf{\\pi}_\\infty\\) \u5305\u542b\u6240\u6709\u65b9\u5411 \\(\\mathbf{D}=(X_1,X_2,X_3,0)^{\\top}\\) \u5e76\u4e14\u53ef\u4ee5\u7528\u6765\u8bc6\u522b\u4eff\u5c04\u6027\u8d28 \u4e24\u5f20\u5e73\u9762\u76f8\u5e73\u884c\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u4eec\u7684\u4ea4\u7ebf\u5728 \\(\\mathbf{\\pi}_\\infty\\) \u4e0a \u5982\u679c\u4e00\u6761\u76f4\u7ebf\u4e0e\u53e6\u4e00\u6761\u76f4\u7ebf\u6216\u4e00\u5f20\u5e73\u9762\u76f8\u4ea4\u4e8e \\(\\mathbf{\\pi}_\\infty\\) \u4e0a\uff0c\u5219\u5b83\u4eec\u76f8\u5e73\u884c \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u4e0d\u52a8\u5e73\u9762\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362 \u4e00\u822c\u5730\u8bf4\uff0c\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u6574\u4e2a\u96c6\u5408\u4e0d\u52a8\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8 \u4ec5\u6709 \\(\\mathbf{\\pi}_\\infty\\) \u5728\u4efb\u4f55\u4eff\u5c04\u53d8\u6362\u4e0b\u4fdd\u6301\u4e0d\u52a8 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \u00b6 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u5728 \\(\\pi_\\infty\\) \u4e0a\u4e00\u6761\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u7ebf\u3002\u5728\u5ea6\u91cf\u5750\u6807\u7cfb\u4e2d \\(\\pi_\\infty=(0,0,0,1)^{\\top}\\) \uff0c\u800c\u5728 \\(\\Omega_\\infty\\) \u4e0a\u7684\u70b9\u6ee1\u8db3\uff1a \\(\\left.\\begin{matrix} X_1^2+X_2^2+X_3^2 \\\\ X_4^2 \\end{matrix}\\right\\} = 0\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u4e0d\u52a8\u4e8c\u6b21\u66f2\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \\(\\Omega_\\infty\\) \u5728\u4e00\u822c\u76f8\u4f3c\u53d8\u6362\u4e0b\u662f\u96c6\u5408\u4e0d\u61c2\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\u7684 \u6240\u6709\u7684\u5706\u4ea4 \\(\\Omega_\\infty\\) \u4e8e\u4e24\u70b9\uff0c\u8fd9\u4e24\u70b9\u662f\u865a\u5706\u70b9 \u6240\u6709\u7403\u9762\u4ea4 \\(\\pi_\\infty\\) \u4e8e \\(\\Omega_\\infty\\) \u5ea6\u91cf\u6027\u8d28 \uff1a\u4e00\u65e6 \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u8bf8\u5982\u5939\u89d2\u548c\u76f8\u5bf9\u957f\u5ea6\u7b49\u5ea6\u6700\u6027\u8d28\u53ef\u4ee5\u88ab\u6d4b\u5b9a\u3002\u8bbe\u4e24\u6761\u76f4\u7ebf\u7684\u65b9\u5411\u4e3a \\(d_1\\) \u548c \\(d_2\\) \uff083 \u7ef4\u77e2\u91cf\uff09\uff0c\u5219 \\[ \\cos \\theta = \\frac{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2)}{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_1)(\\mathbf{d}_2^{\\top} \\Omega_\\infty \\mathbf{d}_2)} \\] \u6b63\u4ea4\u4e0e\u914d\u6781 \uff1a\u5982\u679c \\(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2=0\\) \uff0c\u5219 \\(\\mathbf{d}_1\\) \u548c \\(\\mathbf{d}_2\\) \u76f8\u5782\u76f4\u3002\u56e0\u800c\u5782\u76f4\u6027\u53ef\u7531\u5173\u4e8e \\(\\Omega_\\infty\\) \u7684\u5171\u8f6d\u6027\u6765\u8868\u5f81 \u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \u00b6 \u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u7684\u5bf9\u5076\u662f 3 \u7ef4\u7a7a\u95f4\u4e2d\u4e00\u79cd\u9000\u5316\u7684\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\uff0c\u79f0\u4e3a\u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\u5e76\u8bb0\u4e3a \\(Q_\\infty^*\\) \u3002\u4ece\u51e0\u4f55\u4e0a\u8bf4\uff0c \\(Q_\\infty^*\\) \u7531 \\(\\Omega_\\infty\\) \u7684\u5207\u5e73\u9762\u7ec4\u6210\uff0c\u5b83\u88ab\u79f0\u4e3a \u8fb9\u4e8c\u6b21\u66f2\u9762 \u3002\u5b83\u5728 3 \u7ef4\u5ea6\u91cf\u7a7a\u95f4\u7684\u6807\u51c6\u5f62\u5f0f\u662f\uff1a \\(Q_\\infty^* = \\begin{bmatrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 0 \\end{bmatrix}\\) \u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \\(Q_\\infty^*\\) \u4e0d\u52a8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\pi_\\infty\\) \u662f \\(Q_\\infty^*\\) \u7684\u96f6\u77e2\u91cf \u4e24\u5f20\u5e73\u9762 \\(\\pi_1\\) \u548c \\(\\pi_2\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7531\u4e0b\u5f0f\u7ed9\u51fa\uff1a \\[ \\cos \\theta = \\frac{\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_2}{\\sqrt{(\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_1)(\\mathbf{\\pi}_2^{\\top} Q_\\infty^* \\mathbf{\\pi}_2)}} \\]","title":"3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#3d","text":"\u7ea6 2831 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u672c\u7ae0\u4e3b\u8981\u4ecb\u7ecd 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4 \\(IP^3\\) \u7684\u6027\u8d28\u548c\u57fa\u672c\u8981\u7d20\u3002","title":"3D \u5c04\u5f71\u51e0\u4f55\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#_1","text":"\u4e09\u7ef4\u7a7a\u95f4\u7684\u4e00\u70b9 \\(\\mathbf{X}\\) \u7528\u9f50\u6b21\u5750\u6807\u8868\u793a\u4e3a\u4e00\u4e2a 4 \u7ef4\u77e2\u91cf\uff0c\u9f50\u6b21\u77e2\u91cf \\(\\mathbf{X}=(X_1,X_2,X_3,X_4)^{\\top}\\) \u5f53 \\(X_4 \\ne 0\\) \u65f6\u8868\u793a\u4e3a \\(IR^3\\) \u4e2d\u975e\u9f50\u6b21\u5750\u6807\u4e3a \\((X,Y,Z)^{\\top}\\) \u7684\u70b9\uff0c\u5176\u4e2d \\(\\mathbf{X}=X_1/X_4,Y=X_2/X_4,Z=X_3/X_4\\) \u3002 \u5f53 \\(X_4=0\\) \u7684\u9f50\u6b21\u70b9\u8868\u793a\u65e0\u7a77\u8fdc\u70b9\u3002 \\(IR^3\\) \u4e0a\u7684\u5c04\u5f71\u53d8\u6362\u662f\u7531\u975e\u5947\u5f02 \\(4 \\times 4\\) \u77e9\u9635\u7ed9\u51fa\uff0c\u5b83\u662f\u5173\u4e8e\u9f50\u6b21 4 \u7ef4\u77e2\u91cf\u7684\u7ebf\u6027\u53d8\u6362\uff1a \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \uff0c\u8be5\u6620\u5c04\u662f\u4fdd\u7ebf\u53d8\u6362\uff08\u76f4\u7ebf\u88ab\u6620\u5c04\u5230\u76f4\u7ebf\uff09\u3002","title":"\u70b9\u548c\u5c04\u5f71\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#_2","text":"","title":"\u5e73\u9762\u3001\u76f4\u7ebf\u548c\u4e8c\u6b21\u66f2\u9762\u7684\u8868\u793a\u548c\u53d8\u6362"},{"location":"cv/mvg/pjt3d/#_3","text":"\u5e73\u9762\u7684\u9f50\u6b21\u8868\u793a\u4e3a \\(\\mathbf{\\pi}=(\\pi_1, \\pi_2, \\pi_3, \\pi_4)^{\\top}\\) \u3002 \u70b9 \\(\\mathbf{X}\\) \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u5219\uff1a \\(\\mathbf{\\pi}^{\\top}\\mathbf{X}=0\\) \u8054\u5408\u4e0e\u5173\u8054\u5173\u7cfb \u5e73\u9762\u53ef\u7531\u4e00\u822c\u4f4d\u7f6e\u7684\u4e09\u4e2a\u70b9\u6216\u4e00\u6761\u76f4\u7ebf\u4e0e\u4e00\u4e2a\u70b9\u7684\u8054\u5408\u6765\u552f\u4e00\u786e\u5b9a\uff08\u4e00\u822c\u4f4d\u7f6e\u6307\u4e09\u70b9\u4e0d\u5171\u7ebf\u6216\u5728\u540e\u4e00\u79cd\u60c5\u5f62\u4e0b\u6307\u70b9\u4e0d\u5728\u76f4\u7ebf\u4e0a\uff09 \u4e24\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u76f4\u7ebf \u4e09\u5f20\u4e0d\u540c\u7684\u5e73\u9762\u76f8\u4ea4\u4e8e\u552f\u4e00\u7684\u70b9 \u4e09\u70b9\u786e\u5b9a\u4e00\u5f20\u5e73\u9762 \u786e\u5b9a\u5e73\u9762\u7684\u4e09\u4e2a\u70b9\u662f \\(\\mathbf{X}_1=(\\hat{\\mathbf{X}_1})^{\\top}\u3001\\mathbf{X}_2=(\\hat{\\mathbf{X}_2})^{\\top}\u3001\\mathbf{X}_3=(\\hat{\\mathbf{X}_3})^{\\top}\\) \uff0c\u5219 \\[ \\mathbf{\\pi}=((\\hat{\\mathbf{X}_1}-\\hat{\\mathbf{X}_3}) \\times (\\hat{\\mathbf{X}_2}-\\hat{\\mathbf{X}_3}), -\\hat{\\mathbf{X}_3}^{\\top}(\\hat{\\mathbf{X}_1} \\times \\hat{\\mathbf{X}_2}))^{\\top} \\] \u4e09\u5e73\u9762\u786e\u5b9a\u4e00\u70b9 \u4e09\u5e73\u9762 \\(\\mathbf{\\pi}_i\\) \u7684\u4ea4\u70b9 \\(\\mathbf{X}\\) \u53ef\u901a\u8fc7\u6c42\u4ee5\u4e09\u5f20\u5e73\u9762\u4e3a\u884c\u7684 \\(3 \\times 4\\) \u77e9\u9635\u7684\uff08\u53f3\uff09\u96f6\u7a7a\u95f4\u76f4\u63a5\u8ba1\u7b97\u51fa\u6765\uff1a \\[ \\begin{bmatrix} \\mathbf{\\pi}_1^{\\top}\\\\ \\mathbf{\\pi}_2^{\\top}\\\\ \\mathbf{\\pi}_3^{\\top} \\end{bmatrix} \\mathbf{X}=\\mathbf{0} \\] \u5c04\u5f71\u53d8\u6362 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u5e73\u9762\u53d8\u6362\u4e3a \\(\\mathbf{\\pi}^\\prime=H^{-\\top}\\mathbf{\\pi}\\) \u5e73\u9762\u4e0a\u7684\u70b9\u7684\u53c2\u6570\u8868\u793a \u5728\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0a\u7684\u70b9 \\(\\mathbf{X}\\) \u53ef\u4ee5\u5199\u6210 \\(\\mathbf{X}=M\\mathbf{x}\\) \u5176\u4e2d \\(4 \\times 3\\) \u77e9\u9635 \\(M\\) \u7684\u5217\u751f\u6210 \\(\\mathbf{\\pi}^{\\top}\\) \u7684\u79e9\u4e3a 3 \u7684\u96f6\u7a7a\u95f4\uff0c\u5373 \\(\\mathbf{\\pi}^{\\top} M=\\mathbf{0}^{\\top}\\)","title":"\u5e73\u9762"},{"location":"cv/mvg/pjt3d/#_4","text":"\u96f6\u7a7a\u95f4 \u4e00\u4e2a\u7b97\u5b50 \\(\\mathbf{A}\\) \u7684\u96f6\u7a7a\u95f4\u662f \\(\\mathbf{A}\\mathbf{v}=\\mathbf{0}\\) \u7684\u6240\u6709\u89e3 \\(\\mathbf{v}\\) \u7684\u96c6\u5408\u3002\u5b83\u4e5f\u53eb\u505a \\(\\mathbf{A}\\) \u7684\u6838\uff0c\u6838\u7a7a\u95f4\u3002\u5982\u679c\u7b97\u5b50\u662f\u5728\u5411\u91cf\u7a7a\u95f4\u4e0a\u7684\u7ebf\u6027\u7b97\u5b50\uff0c\u96f6\u7a7a\u95f4\u5c31\u662f\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002\u56e0\u6b64\u96f6\u7a7a\u95f4\u4e5f\u662f\u5411\u91cf\u7a7a\u95f4\u3002 \u751f\u6210\u5b50\u7a7a\u95f4 \u8bbe \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u662f \\(R^m\\) \u4e2d\u4efb\u4e00\u7ec4\u5411\u91cf\u3002\u8bb0 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u7684\u6240\u6709\u7ebf\u6027\u7ec4\u5408\u7684\u96c6\u5408\u4e3a \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \uff0c\u5373 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)=\\{k_1\\alpha_1+k_2\\alpha_2+...+k_m\\alpha_m | k_i \\in R, i=1,2,...,m\\}\\) \uff0c\u79f0 \\(span(\\alpha_1, \\alpha_2, ..., \\alpha_m)\\) \u4e3a\u5411\u91cf\u7ec4 \\(\\alpha_1, \\alpha_2, ..., \\alpha_m\\) \u751f\u6210\u7684\u5b50\u7a7a\u95f4\u3002 \u96f6\u7a7a\u95f4\u4e0e\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a \u5047\u5b9a \\(\\mathbf{A}\u3001\\mathbf{B}\\) \u662f\u4e24\uff08\u4e0d\u91cd\u5408\uff09\u7684\u7a7a\u95f4\u70b9\uff0c\u90a3\u4e48\u8fde\u63a5\u8fd9\u4e24\u70b9\u7684\u76f4\u7ebf\u7531\u4e00\u4e2a \\(2 \\times 4\\) \u77e9\u9635 \\(W\\) \u7684\u884c\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u8868\u793a\uff0c \\(W=\\begin{bmatrix} \\mathbf{A}^{\\top} \\\\ \\mathbf{B}^{\\top} \\end{bmatrix}\\) \\(W^{\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u5728\u76f4\u7ebf \\(\\lambda \\mathbf{A}+\\mu \\mathbf{B}\\) \u4e0a\u7684\u70b9\u675f \\(W\\) \u7684 2 \u7ef4\u53f3\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \u4e00\u6761\u76f4\u7ebf\u7684\u5bf9\u5076\u8868\u793a\u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}\uff0c\\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u8be5\u76f4\u7ebf\u8868\u793a\u4e3a\u77e9\u9635 \\(W^*=\\begin{bmatrix} \\mathbf{P}^{\\top} \\\\ \\mathbf{Q}^{\\top} \\end{bmatrix}\\) \\(W^{*\\top}\\) \u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u4ee5\u8be5\u76f4\u7ebf\u4e3a\u8f74\u7684\u5e73\u9762\u675f \\(\\lambda^\\prime\\mathbf{P}+\\mu^\\prime\\mathbf{Q}\\) \\(W^{*\\top}\\) \u7684 2 \u7ef4\u96f6\u7a7a\u95f4\u7684\u751f\u6210\u5b50\u7a7a\u95f4\u662f\u8be5\u76f4\u7ebf\u4e0a\u7684\u70b9\u675f \u8fd9\u4e24\u79cd\u8868\u793a\u4ee5 \\(W^*W^{\\top}=WW^{*\\top}=0_{2\\times 2}\\) \u76f8\u8054\u7cfb Pl\u00fccker \u77e9\u9635 \u8fd9\u91cc\u4e00\u6761\u76f4\u7ebf\u7531 \\(4 \\times 4\\) \u53cd\u5bf9\u79f0\u9f50\u6b21\u77e9\u9635\u8868\u793a\u3002\u8fde\u63a5\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u76f4\u7ebf\u7531\u77e9\u9635 \\(\\mathbf{L}\\) \u8868\u793a\uff0c\u5176\u5143\u7d20\u4e3a\uff1a \\(l_{ij}=A_iB_j-B_iA_j\\) \uff0c\u6216\u7528\u77e2\u91cf\u8bb0\u53f7\u7b49\u4ef7\u4e8e\u8868\u793a\u4e3a \\(L=\\mathbf{A}\\mathbf{B}^{\\top}-\\mathbf{B}\\mathbf{A}^{\\top}\\) \u6027\u8d28 \\(L\\) \u7684\u79e9\u4e3a 2 \u8be5\u8868\u793a\u5177\u6709\u63cf\u8ff0\u4e00\u6761\u76f4\u7ebf\u6240\u9700\u8981\u7684 4 \u4e2a\u81ea\u7531\u5ea6 \u77e9\u9635 \\(L\\) \u4e0e\u7528\u6765\u786e\u5b9a\u5b83\u7684\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u65e0\u5173 \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\u8be5\u77e9\u9635\u53d8\u6362\u4e3a \\(L^\\prime=HLH^{\\top}\\) \u65f6\uff0c\u5373\u5b83\u662f\u4e00\u4e2a\u9636\u4e3a 2 \u7684\u5f20\u91cf \u7531\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\u786e\u5b9a\u7684\u76f4\u7ebf\u7684\u5bf9\u5076 Pl\u00fccker \u8868\u793a\u4e3a \\(L^*\\) \u4e3a \\(L^*=\\mathbf{P}\\mathbf{Q}^{\\top}-\\mathbf{Q}\\mathbf{P}^{\\top}\\) \u7531\u70b9 \\(\\mathbf{X}\\) \u548c\u76f4\u7ebf \\(L\\) \u8054\u5408\u800c\u786e\u5b9a\u7684\u5e73\u9762\u4e3a \\(\\mathbf{\\pi}=L^*\\mathbf{X}\\) \uff0c\u5e76\u4e14 \\(L^*\\mathbf{X}=0\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(\\mathbf{X}\\) \u5728 \\(L\\) \u4e0a \u7531\u76f4\u7ebf \\(L\\) \u548c\u5e73\u9762 \\(\\mathbf{\\pi}\\) \u76f8\u4ea4\u800c\u786e\u5b9a\u7684\u70b9\u4e3a \\(\\mathbf{X}=L\\mathbf{\\pi}\\) \uff0c\u5e76\u4e14 \\(L\\mathbf{\\pi}=\\mathbf{0}\\) \u7684\u5145\u8981\u6761\u4ef6\u662f \\(L\\) \u5728 \\(\\mathbf{\\pi}\\) \u4e0a Pl\u00fccker \u76f4\u7ebf\u5750\u6807 Pl\u00fccker \u76f4\u7ebf\u5750\u6807\u662f \\(4 \\times 4\\) \u53cd\u5bf9\u79f0 Pl\u00fccker \u77e9\u9635 \\(L\\) \u7684\u516d\u4e2a\u975e\u96f6\u5143\u7d20\uff0c\u5373 \\(\\mathcal{L}=\\{l_{12},l_{13},l_{14},l_{23},l_{42},l_{34}\\}\\) \u7531\u4e8e \\(\\det{L}=0\\) \uff0c\u6240\u4ee5\u5750\u6807\u6ee1\u8db3 \\(l_{12}l_{34}+l_{13}l_{42}+l_{14}l_{23}=0\\) \u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}\\) \u548c \\(\\hat{\\mathcal{L}}\\) \u5171\u9762\uff08\u56e0\u800c\u76f8\u4ea4\uff09\u7684\u5145\u8981\u6761\u4ef6\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \uff0c\u5219 6 \u7ef4\u77e2\u91cf \\(\\mathcal{L}\\) \u4ec5\u8868\u793a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u76f4\u7ebf \u5047\u5b9a\u4e24\u6761\u76f4\u7ebf \\(\\mathcal{L}, \\hat{\\mathcal{L}}\\) \u5206\u522b\u4e3a\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u548c \\(\\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}\\) \u7684\u4ea4\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=\\det [\\mathbf{P}, \\mathbf{Q}, \\hat{\\mathbf{P}}, \\hat{\\mathbf{Q}}]\\) \uff0c\u540c\u7406\uff0c\u4e24\u6761\u76f4\u7ebf\u76f8\u4ea4\u7684\u5145\u8981\u6761\u4ef6\u5c31\u662f \\((\\mathcal{L} | \\hat{\\mathcal{L}})=0\\) \u5982\u679c \\(\\mathcal{L}\\) \u662f\u4e24\u5e73\u9762 \\(\\mathbf{P}, \\mathbf{Q}\\) \u7684\u4ea4\u7ebf\uff0c\u800c \\(\\hat{\\mathcal{L}}\\) \u662f\u4e24\u70b9 \\(\\mathbf{A}, \\mathbf{B}\\) \u7684\u8fde\u7ebf\uff0c\u90a3\u4e48 \\((\\mathcal{L} | \\hat{\\mathcal{L}})=(\\mathbf{P}^{\\top}\\mathbf{A})(\\mathbf{Q}^{\\top}\\mathbf{B})-(\\mathbf{Q}^{\\top}\\mathbf{A})(\\mathbf{P}^{\\top}\\mathbf{B})\\)","title":"\u76f4\u7ebf"},{"location":"cv/mvg/pjt3d/#_5","text":"\\(IP^3\\) \u4e2d\uff0c\u4e8c\u6b21\u66f2\u9762\u7531\u4e0b\u5217\u65b9\u7a0b\u5b9a\u4e49\uff1a \\(\\mathbf{X}^{\\top} Q\\mathbf{X}=0\\) \uff0c\u5176\u4e2d \\(Q\\) \u662f\u4e00\u4e2a \\(4 \\times 4\\) \u7684\u5bf9\u79f0\u77e9\u9635 \u4e2a\u4e8c\u6b21\u66f2\u9762\u6709 9 \u4e2a\u81ea\u7531\u5ea6 \u4e00\u822c\u4f4d\u7f6e\u4e0a\u7684\u4e5d\u4e2a\u70b9\u786e\u5b9a\u4e00\u4e2a\u4e8c\u6b21\u66f2\u9762 \u5982\u679c\u77e9\u9635 \\(Q\\) \u662f\u5947\u5f02\u7684\uff0c\u90a3\u4e48\u4e8c\u6b21\u66f2\u9762\u662f\u9000\u5316\u7684\uff0c\u5e76\u53ef\u4ee5\u7531\u8f83\u5c11\u7684\u70b9\u6765\u786e\u5b9a \u4e8c\u6b21\u66f2\u9762\u5b9a\u4e49\u4e86\u70b9\u548c\u5e73\u9762\u4e4b\u95f4\u7684\u4e00\u79cd\u914d\u6781\uff0c\u7c7b\u4f3c\u4e8e\u4e8c\u6b21\u66f2\u7ebf\u5728\u70b9\u548c\u76f4\u7ebf\u4e4b\u95f4\u5b9a\u4e49\u7684\u914d\u6781\uff0c\u5e73\u9762 \\(\\mathbf{\\pi}=Q\\mathbf{X}\\) \u79f0\u4e3a\u662f \\(\\mathbf{X}\\) \u5173\u4e8e \\(Q\\) \u7684\u6781\u5e73\u9762\uff0c\u5f53 \\(Q\\) \u4e3a\u975e\u5947\u5f02\u5e76\u4e14 \\(\\mathbf{X}\\) \u5728\u4e8c\u6b21\u66f2\u9762\u4e4b\u5916\u65f6\uff0c\u6781\u5e73\u9762\u7531\u8fc7 \\(\\mathbf{X}\\) \u4e14\u4e0e \\(Q\\) \u76f8\u5207\u7684\u5c04\u7ebf\u7ec4\u6210\u7684\u9525\u4e0e \\(Q\\) \u60f3\u63a5\u89e6\u7684\u70b9\u6765\u5b9a\u4e49\u3002\u5982\u679c \\(\\mathbf{X}\\) \u5728 \\(Q\\) \u4e0a\uff0c\u90a3\u4e48 \\(Q\\mathbf{X}\\) \u662f \\(Q\\) \u5728\u70b9 \\(\\mathbf{X}\\) \u7684\u5207\u5e73\u9762 \u5e73\u9762 \\(\\mathbf{\\pi}\\) \u4e0e\u4e8c\u6b21\u66f2\u9762 \\(Q\\) \u7684\u4ea4\u7ebf\u662f\u4e8c\u6b21\u66f2\u7ebf \\(C\\) \u5728\u70b9\u53d8\u6362 \\(\\mathbf{X}^\\prime=H\\mathbf{X}\\) \u4e0b\uff0c\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u9762\u53d8\u6362\u4e3a \\(Q^\\prime=H^{-\\top}QH^{-1}\\)","title":"\u4e8c\u6b21\u66f2\u9762\u4e0e\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762"},{"location":"cv/mvg/pjt3d/#_6","text":"\u5bf9\u89d2\u77e9\u9635 \\(D\\) \u7684\u7b26\u53f7\u5dee\uff0c\u8bb0\u4e3a \\(\\sigma(D)\\) \uff0c\u5b9a\u4e49\u4e3a \\(D\\) \u4e2d +1 \u7684\u4e2a\u6570\u4e0e -1 \u7684\u4e2a\u6570\u7684\u5dee\u503c","title":"\u4e8c\u6b21\u66f2\u9762\u7684\u5206\u7c7b"},{"location":"cv/mvg/pjt3d/#_7","text":"\u4e09\u6b21\u7ed5\u7ebf\u53ef\u4ee5\u770b\u6210 2D \u4e8c\u6b21\u66f2\u7ebf\u7684 3 \u7ef4\u7c7b\u63a8\u3002\u4e00\u6761\u4e09\u6b21\u7ed5\u7ebf\u5b9a\u4e49\u4e3a \\(IP^3\\) \u4e2d\u7684\u4e00\u6761\u66f2\u7ebf\uff0c\u5b83\u7684\u53c2\u6570\u5f62\u5f0f\u5982\u4e0b\uff1a \\[ \\begin{bmatrix} x_1 \\\\ x_2 \\\\ x_3 \\\\ x_4 \\end{bmatrix} = A \\begin{bmatrix} 1 \\\\ \\theta \\\\ \\theta^2 \\\\ \\theta^3 \\end{bmatrix} = \\begin{bmatrix} a_{11}+a_{12}\\theta+a_{13}\\theta^2+a_{14}\\theta^3 \\\\ a_{21}+a_{22}\\theta+a_{23}\\theta^2+a_{24}\\theta^3 \\\\ a_{31}+a_{32}\\theta+a_{33}\\theta^2+a_{34}\\theta^3 \\\\ a_{41}+a_{42}\\theta+a_{43}\\theta^2+a_{44}\\theta^3 \\end{bmatrix} \\] \u6027\u8d28 \u4ee4 \\(\\mathbf{c}\\) \u4e3a\u4e00\u6761\u975e\u5947\u5f02\u4e09\u6b21\u7ed5\u7ebf\u3002\u90a3\u4e48 \\(\\mathbf{c}\\) \u4e0d\u6574\u4e2a\u5730\u5305\u542b\u5728 \\(IP^3\\) \u7684\u4efb\u4f55\u4e00\u5f20\u5e73\u9762\u4e2d\uff0c\u800c\u662f\u4e0e\u4e00\u822c\u5e73\u9762\u6709\u4e09\u4e2a\u4e0d\u540c\u7684\u4ea4\u70b9 \u4e09\u6b21\u7ed5\u7ebf\u6709 12 \u4e2a\u81ea\u7531\u5ea6 \u6240\u6709\u975e\u9000\u5316\u7684\u4e09\u6b21\u7ed5\u7ebf\u90fd\u662f\u5c04\u5f71\u7b49\u4ef7\u7684","title":"\u4e09\u6b21\u7ed5\u7ebf"},{"location":"cv/mvg/pjt3d/#_8","text":"3 \u7ef4\u7a7a\u95f4\u53d8\u6362\u540c\u6837\u5177\u6709\u76f8\u5e94\u7684 2 \u7ef4\u7a7a\u95f4\u53d8\u6362 \u9ad8\u65af\u66f2\u7387 \uff1a\u5fae\u5206\u51e0\u4f55\u4e2d\uff0c\u66f2\u9762\u4e0a\u4e00\u70b9\u7684\u9ad8\u65af\u66f2\u7387\u662f\u8be5\u70b9\u4e3b\u66f2\u7387 \\(k_1\\) \u548c \\(k_2\\) \u7684\u4e58\u79ef\u3002\u5b83\u662f\u66f2\u7387\u7684\u5185\u5728\u5ea6\u91cf\uff0c\u4e5f\u5373\uff0c\u5b83\u7684\u503c\u53ea\u4f9d\u8d56\u4e8e\u66f2\u9762\u4e0a\u7684\u8ddd\u79bb\u5982\u4f55\u6d4b\u91cf\uff0c\u800c\u4e0d\u662f\u66f2\u9762\u5982\u4f55\u5d4c\u5165\u5230\u7a7a\u95f4\u3002 \u8f6c\u52a8\u5206\u89e3 \u4efb\u4f55\u5177\u4f53\u7684\u5e73\u79fb\u52a0\u65cb\u8f6c\u8fd0\u52a8\u90fd\u7b49\u4ef7\u4e8e\u7ed5\u4e00\u6839\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u52a0\u6cbf\u8be5\u8f6c\u52a8\u8f74\u7684\u5e73\u79fb\u3002\u8be5\u8f6c\u52a8\u8f74\u5e73\u884c\u4e8e\u539f\u6765\u7684\u65cb\u8f6c\u8f74\u3002 \u5e73\u79fb\u52a0\u7ed5\u6b63\u4ea4\u8f74\u7684\u65cb\u8f6c\u8fd0\u52a8(\u79f0\u5e73\u9762\u8fd0\u52a8)\u7b49\u4ef7\u4e8e\u4ec5\u4ec5\u7ed5\u67d0\u8f6c\u52a8\u8f74\u7684\u65cb\u8f6c\u3002","title":"\u53d8\u6362\u7684\u5c42\u6b21"},{"location":"cv/mvg/pjt3d/#_9","text":"\u5728 3 \u7ef4\u7a7a\u95f4\u7684\u5c04\u5f71\u51e0\u4f55\u4e2d\uff0c\u4e0e \\(\\mathbf{I}_{\\infty}\\) \u7684\u865a\u5706\u70b9\u5bf9\u5e94\u7684\u51e0\u4f55\u5b9e\u4f53\u662f\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_{\\infty}\\) \u548c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u4eff\u5c04\u7a7a\u95f4\u4e2d\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762\u7684\u6807\u51c6\u4f4d\u7f6e\u662f \\(\\mathbf{\\pi}_\\infty=(0,0,0,1)^{\\top}\\) \uff0c \\(\\mathbf{\\pi}_\\infty\\) \u5305\u542b\u6240\u6709\u65b9\u5411 \\(\\mathbf{D}=(X_1,X_2,X_3,0)^{\\top}\\) \u5e76\u4e14\u53ef\u4ee5\u7528\u6765\u8bc6\u522b\u4eff\u5c04\u6027\u8d28 \u4e24\u5f20\u5e73\u9762\u76f8\u5e73\u884c\u7684\u5145\u8981\u6761\u4ef6\u662f\u5b83\u4eec\u7684\u4ea4\u7ebf\u5728 \\(\\mathbf{\\pi}_\\infty\\) \u4e0a \u5982\u679c\u4e00\u6761\u76f4\u7ebf\u4e0e\u53e6\u4e00\u6761\u76f4\u7ebf\u6216\u4e00\u5f20\u5e73\u9762\u76f8\u4ea4\u4e8e \\(\\mathbf{\\pi}_\\infty\\) \u4e0a\uff0c\u5219\u5b83\u4eec\u76f8\u5e73\u884c \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u4e0d\u52a8\u5e73\u9762\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u4e00\u4e2a\u4eff\u5c04\u53d8\u6362 \u4e00\u822c\u5730\u8bf4\uff0c\u5728\u4eff\u5c04\u53d8\u6362\u4e0b\u5e73\u9762 \\(\\mathbf{\\pi}_\\infty\\) \u662f\u6574\u4e2a\u96c6\u5408\u4e0d\u52a8\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8 \u4ec5\u6709 \\(\\mathbf{\\pi}_\\infty\\) \u5728\u4efb\u4f55\u4eff\u5c04\u53d8\u6362\u4e0b\u4fdd\u6301\u4e0d\u52a8","title":"\u65e0\u7a77\u8fdc\u5e73\u9762"},{"location":"cv/mvg/pjt3d/#_10","text":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u5728 \\(\\pi_\\infty\\) \u4e0a\u4e00\u6761\uff08\u70b9\uff09\u4e8c\u6b21\u66f2\u7ebf\u3002\u5728\u5ea6\u91cf\u5750\u6807\u7cfb\u4e2d \\(\\pi_\\infty=(0,0,0,1)^{\\top}\\) \uff0c\u800c\u5728 \\(\\Omega_\\infty\\) \u4e0a\u7684\u70b9\u6ee1\u8db3\uff1a \\(\\left.\\begin{matrix} X_1^2+X_2^2+X_3^2 \\\\ X_4^2 \\end{matrix}\\right\\} = 0\\) \u5728\u5c04\u5f71\u53d8\u6362 \\(H\\) \u4e0b\uff0c\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u662f\u4e0d\u52a8\u4e8c\u6b21\u66f2\u7ebf\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \\(\\Omega_\\infty\\) \u5728\u4e00\u822c\u76f8\u4f3c\u53d8\u6362\u4e0b\u662f\u96c6\u5408\u4e0d\u61c2\uff0c\u800c\u4e0d\u662f\u70b9\u70b9\u4e0d\u52a8\u7684 \u6240\u6709\u7684\u5706\u4ea4 \\(\\Omega_\\infty\\) \u4e8e\u4e24\u70b9\uff0c\u8fd9\u4e24\u70b9\u662f\u865a\u5706\u70b9 \u6240\u6709\u7403\u9762\u4ea4 \\(\\pi_\\infty\\) \u4e8e \\(\\Omega_\\infty\\) \u5ea6\u91cf\u6027\u8d28 \uff1a\u4e00\u65e6 \\(\\Omega_\\infty\\) \u5728 3 \u7ef4\u5c04\u5f71\u7a7a\u95f4\u88ab\u8fa8\u8ba4\uff0c\u90a3\u4e48\u8bf8\u5982\u5939\u89d2\u548c\u76f8\u5bf9\u957f\u5ea6\u7b49\u5ea6\u6700\u6027\u8d28\u53ef\u4ee5\u88ab\u6d4b\u5b9a\u3002\u8bbe\u4e24\u6761\u76f4\u7ebf\u7684\u65b9\u5411\u4e3a \\(d_1\\) \u548c \\(d_2\\) \uff083 \u7ef4\u77e2\u91cf\uff09\uff0c\u5219 \\[ \\cos \\theta = \\frac{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2)}{(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_1)(\\mathbf{d}_2^{\\top} \\Omega_\\infty \\mathbf{d}_2)} \\] \u6b63\u4ea4\u4e0e\u914d\u6781 \uff1a\u5982\u679c \\(\\mathbf{d}_1^{\\top} \\Omega_\\infty \\mathbf{d}_2=0\\) \uff0c\u5219 \\(\\mathbf{d}_1\\) \u548c \\(\\mathbf{d}_2\\) \u76f8\u5782\u76f4\u3002\u56e0\u800c\u5782\u76f4\u6027\u53ef\u7531\u5173\u4e8e \\(\\Omega_\\infty\\) \u7684\u5171\u8f6d\u6027\u6765\u8868\u5f81","title":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf"},{"location":"cv/mvg/pjt3d/#_11","text":"\u7edd\u5bf9\u4e8c\u6b21\u66f2\u7ebf \\(\\Omega_\\infty\\) \u7684\u5bf9\u5076\u662f 3 \u7ef4\u7a7a\u95f4\u4e2d\u4e00\u79cd\u9000\u5316\u7684\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\uff0c\u79f0\u4e3a\u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762\u5e76\u8bb0\u4e3a \\(Q_\\infty^*\\) \u3002\u4ece\u51e0\u4f55\u4e0a\u8bf4\uff0c \\(Q_\\infty^*\\) \u7531 \\(\\Omega_\\infty\\) \u7684\u5207\u5e73\u9762\u7ec4\u6210\uff0c\u5b83\u88ab\u79f0\u4e3a \u8fb9\u4e8c\u6b21\u66f2\u9762 \u3002\u5b83\u5728 3 \u7ef4\u5ea6\u91cf\u7a7a\u95f4\u7684\u6807\u51c6\u5f62\u5f0f\u662f\uff1a \\(Q_\\infty^* = \\begin{bmatrix} \\mathbf{I} & \\mathbf{0} \\\\ \\mathbf{0}^{\\top} & 0 \\end{bmatrix}\\) \u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762 \\(Q_\\infty^*\\) \u4e0d\u52a8\u7684\u5145\u8981\u6761\u4ef6\u662f \\(H\\) \u662f\u76f8\u4f3c\u53d8\u6362 \u65e0\u7a77\u8fdc\u5e73\u9762 \\(\\pi_\\infty\\) \u662f \\(Q_\\infty^*\\) \u7684\u96f6\u77e2\u91cf \u4e24\u5f20\u5e73\u9762 \\(\\pi_1\\) \u548c \\(\\pi_2\\) \u4e4b\u95f4\u7684\u5939\u89d2\u7531\u4e0b\u5f0f\u7ed9\u51fa\uff1a \\[ \\cos \\theta = \\frac{\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_2}{\\sqrt{(\\mathbf{\\pi}_1^{\\top} Q_\\infty^* \\mathbf{\\pi}_1)(\\mathbf{\\pi}_2^{\\top} Q_\\infty^* \\mathbf{\\pi}_2)}} \\]","title":"\u7edd\u5bf9\u5bf9\u5076\u4e8c\u6b21\u66f2\u9762"},{"location":"cv/papers/","text":"SLAM \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u89c6\u89c9\u7684\u76f8\u5173\u7b14\u8bb0 Table of Contents \u00b6 Dynamic-SLAM \u7cfb\u5217 DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM NeRF \u7cfb\u5217 NeRF DDN-SLAM Co-SLAM NID-SLAM iMAP NICE-SLAM NeRF-Evaluation 3DGS \u7cfb\u5217 3DGS 4DGS SplaTAM Gaussian Splatting SLAM \u6742\u9879 SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation Reference \u00b6 \u3010\u52a8\u6001SLAM\u3011\u5feb\u901f\u5165\u95e8\uff08\u539f\u7406\u4ecb\u7ecd\u53ca\u7ecf\u5178\u7b97\u6cd5\uff09 \u3010\u52a8\u6001SLAM\u3011\u52a8\u6001\u573a\u666f\u4e0b\u5b9e\u65f6\u4e09\u7ef4\u91cd\u5efa\u8bba\u6587\u6c47\u603b \u3010\u52a8\u6001SLAM\u3011\u7ecf\u5178\u5f00\u6e90\u8bba\u6587\uff08\u66f4\u65b0\u4e2d\uff09 \u52a8\u6001\u73af\u5883SLAM\u4e13\u9898(\u56db) | \u601d\u8003\u6846\u67b6 \u52a8\u6001\u73af\u5883\u4e0b\u7684slam\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f SLAM\u4e2d\u53bb\u9664\u52a8\u6001\u7269\u4f53\u7684\u90e8\u5206\u65b9\u6cd5\uff08\u4e3b\u8981\u662f\u89c6\u89c9SLAM\uff09 SLAM\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u53bb\u9664\u95ee\u9898 \u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684\uff08NeRF-based\uff09 SLAM \u7efc\u8ff0 \u89e3\u9501SLAM\u65b0\u7eaa\u5143\uff01\u57fa\u4e8eNeRF\u548c3D GS\u65b9\u6cd5\u7efc\u8ff0 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u2014NeRF SLAM\uff08\u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684SLAM\uff09","title":"SLAM"},{"location":"cv/papers/#slam","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u89c6\u89c9\u7684\u76f8\u5173\u7b14\u8bb0","title":"SLAM"},{"location":"cv/papers/#table-of-contents","text":"Dynamic-SLAM \u7cfb\u5217 DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM NeRF \u7cfb\u5217 NeRF DDN-SLAM Co-SLAM NID-SLAM iMAP NICE-SLAM NeRF-Evaluation 3DGS \u7cfb\u5217 3DGS 4DGS SplaTAM Gaussian Splatting SLAM \u6742\u9879 SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation","title":"Table of Contents"},{"location":"cv/papers/#reference","text":"\u3010\u52a8\u6001SLAM\u3011\u5feb\u901f\u5165\u95e8\uff08\u539f\u7406\u4ecb\u7ecd\u53ca\u7ecf\u5178\u7b97\u6cd5\uff09 \u3010\u52a8\u6001SLAM\u3011\u52a8\u6001\u573a\u666f\u4e0b\u5b9e\u65f6\u4e09\u7ef4\u91cd\u5efa\u8bba\u6587\u6c47\u603b \u3010\u52a8\u6001SLAM\u3011\u7ecf\u5178\u5f00\u6e90\u8bba\u6587\uff08\u66f4\u65b0\u4e2d\uff09 \u52a8\u6001\u73af\u5883SLAM\u4e13\u9898(\u56db) | \u601d\u8003\u6846\u67b6 \u52a8\u6001\u73af\u5883\u4e0b\u7684slam\u95ee\u9898\u5982\u4f55\u89e3\u51b3\uff1f SLAM\u4e2d\u53bb\u9664\u52a8\u6001\u7269\u4f53\u7684\u90e8\u5206\u65b9\u6cd5\uff08\u4e3b\u8981\u662f\u89c6\u89c9SLAM\uff09 SLAM\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u53bb\u9664\u95ee\u9898 \u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684\uff08NeRF-based\uff09 SLAM \u7efc\u8ff0 \u89e3\u9501SLAM\u65b0\u7eaa\u5143\uff01\u57fa\u4e8eNeRF\u548c3D GS\u65b9\u6cd5\u7efc\u8ff0 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u2014NeRF SLAM\uff08\u57fa\u4e8e\u795e\u7ecf\u8f90\u5c04\u573a\u7684SLAM\uff09","title":"Reference"},{"location":"cv/papers/3dgs/","text":"3DGS \u7cfb\u5217 \u00b6 Abstract 3DGS \u7cfb\u5217\u76f8\u5173\u5185\u5bb9 Table of Contents \u00b6 3DGS 4DGS SplaTAM Gaussian Splatting SLAM","title":"3DGS \u7cfb\u5217"},{"location":"cv/papers/3dgs/#3dgs","text":"Abstract 3DGS \u7cfb\u5217\u76f8\u5173\u5185\u5bb9","title":"3DGS \u7cfb\u5217"},{"location":"cv/papers/3dgs/#table-of-contents","text":"3DGS 4DGS SplaTAM Gaussian Splatting SLAM","title":"Table of Contents"},{"location":"cv/papers/3dgs/3dgs/","text":"3DGS \u00b6 \u7ea6 2609 \u4e2a\u5b57 174 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract paper\uff1a 3DGS: 3D Gaussian Splatting for Real-Time Radiance Field Rendering code\uff1a gaussian-splatting Idea \u00b6 Introduction \u00b6 \u57fa\u4e8e Splatting \u548c\u673a\u5668\u5b66\u4e60\u7684\u4e09\u7ef4\u91cd\u5efa\u65b9\u6cd5\uff0c\u7528\u4e8e \u5b9e\u65f6\u4e14\u903c\u771f\u5730\u6e32\u67d3\u4ece\u4e00\u7ec4\u56fe\u50cf\u4e2d\u5b66\u5230\u7684\u573a\u666f \uff0c\u6539\u5584 NeRF \u7684\u8bad\u7ec3\u901f\u5ea6\u548c\u6e32\u67d3\u8d28\u91cf\u7684\u74f6\u9888\u95ee\u9898\uff0c \u4fdd\u6301\u6709\u7ade\u4e89\u529b\u7684\u8bad\u7ec3\u65f6\u95f4\u7684\u540c\u65f6\u5b9e\u73b0\u6700\u5148\u8fdb\u7684\u89c6\u89c9\u8d28\u91cf\uff0c\u5141\u8bb8\u5728 1080p \u5206\u8fa8\u7387\u4e0b\u5b9e\u73b0\u9ad8\u8d28\u91cf\u7684\u5b9e\u65f6\uff08 >= 30 fps\uff09\u7684\u65b0\u89c6\u56fe\u5408\u6210 3DGS \u8fdb\u884c\u573a\u666f\u8868\u8fbe \uff0c\u591a\u4e2a\u9ad8\u65af\u6a21\u578b\u5171\u540c\u6784\u6210\u6574\u4e2a\u573a\u666f\u7684\u8fde\u7eed\u4f53\u79ef\u8868\u793a \u4ece\u6700\u521d\u7531 SfM \u751f\u6210\u7684\u7a00\u758f\u70b9\u5f00\u59cb\u521d\u59cb\u5316 3DGS\u8fd9\u79cd\u57fa\u5143\uff0c\u7ee7\u627f \u53ef\u5fae\u5206 \u4f53\u79ef\u8868\u793a\u7684\u5c5e\u6027\uff0c\u540c\u65f6\u662f \u975e\u7ed3\u6784\u5316 \u548c \u663e\u5f0f \u7684\uff0c\u5bb9\u6613\u6295\u5f71\u5230 2D\uff0c\u5feb\u901f \\(\\alpha\\) -blender \u81ea\u9002\u5e94\u5bc6\u5ea6\u63a7\u5236\u4f18\u5316 \uff1a\u9488\u5bf9 3DGS \u7684\u5404\u79cd\u5c5e\u6027 \uff08\u4f4d\u7f6e\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u5404\u5411\u5f02\u6027\u534f\u65b9\u5dee\u548c\u7403\u8c10\u51fd\u6570\uff09 \u8fdb\u884c\u4f18\u5316\uff0c\u4e14\u4ea4\u9519\u8fdb\u884c\uff0c\u5305\u62ec\u5728\u4f18\u5316\u8fc7\u7a0b\u4e2d\u79fb\u9664 3DGS\uff0c\u4ee5\u6b64\u7cbe\u786e\u8868\u8fbe\u573a\u666f \u5feb\u901f\u5149\u6805\u5316 \uff1a\u4f7f\u7528\u9ad8\u901f GPU\uff0c\u652f\u6301\u5404\u5411\u5f02\u6027\u629b\u96ea\u7403\uff0c\u4fdd\u8bc1\u9ad8\u8d28\u91cf\u5b9e\u65f6\u6e32\u67d3 Splatting \u00b6 \u4ec0\u4e48\u662f Splatting\uff1f\u4ec0\u4e48\u662f 3DGS\uff1f\u4e3a\u4ec0\u4e48\u9009\u62e9 GS\uff1f \u4e00\u79cd\u4f53\u6e32\u67d3\u7684\u65b9\u6cd5\uff08\u629b\u96ea\u7403\u6cd5\u3001\u8db3\u8ff9\u6cd5\u3001\u55b7\u6e85\uff09\uff1a\u4ece 3D \u7269\u4f53\u6e32\u67d3\u5230 2D \u5e73\u9762 NeRF \u662f\u88ab\u52a8\u7684\uff0c\u65b9\u5f0f\u662f Ray-casting \uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u50cf\u7d20\u70b9\u6536\u5230\u53d1\u5149\u7c92\u5b50\u7684\u5f71\u54cd\u6765\u751f\u6210\u56fe\u50cf Splatting \u662f\u4e3b\u52a8\u7684\uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u53d1\u5149\u7c92\u5b50\u5982\u4f55\u5f71\u54cd\u50cf\u7d20\u70b9 \u60f3\u8c61\u8f93\u5165\u662f\u4e00\u4e9b\u96ea\u7403\uff0c\u56fe\u7247\u662f\u4e00\u9762\u7816\u5899\uff0c\u56fe\u50cf\u751f\u6210\u8fc7\u7a0b\u662f\u5411\u5899\u9762\u6254\u96ea\u7403\u7684\u8fc7\u7a0b\uff0c\u6bcf\u6254\u4e00\u4e2a\u96ea\u7403\uff0c\u5899\u4e0a\u90fd\u6709\u6269\u6563\u75d5\u8ff9 footprint\uff0c\u6d41\u7a0b\uff1a \u9009\u62e9\u96ea\u7403 \u629b\u63b7\u96ea\u7403\uff0c\u4ece 3D \u6295\u5f71\u5230 2D\uff0c\u5f97\u5230\u8db3\u8ff9 \u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u56fe\u50cf \u9009\u62e9\u96ea\u7403 3DGS \u00b6 \u8f93\u5165\u662f\u70b9\u4e91\uff0c\u65e0\u4f53\u79ef\uff0c\u9700\u8981\u4e00\u4e2a \u6838 \u8fdb\u884c\u81a8\u80c0\uff0c\u53ef\u4ee5\u7528\u9ad8\u65af/\u5706/\u6b63\u65b9\u4f53... \u9009\u62e9\u9ad8\u65af\u7684\u7406\u7531\uff0c\u6709\u5f88\u597d\u7684\u6570\u5b66\u6027\u8d28\uff1a \u4eff\u5c04\u53d8\u6362\u540e\u9ad8\u65af\u6838\u4ecd\u7136\u95ed\u5408 3D \u964d\u5230 2D \u540e\uff08\u6cbf\u7740\u67d0\u4e00\u8f74\u79ef\u5206\uff09\u4ecd\u7136\u662f\u9ad8\u65af \u692d\u7403\u9ad8\u65af \\(G(x;\\mu,\\sum)=\\frac{1}{\\sqrt{(2\\pi)^k \\left | \\sum \\right |}} \\exp^{-\\frac{1}{2}(x-\\mu)^\\top\\sum^{-1}(x-\\mu)}\\) \uff0c \\(\\mu\\) \u8868\u793a\u5747\u503c\uff0c \\(\\sum\\) \u8868\u793a\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u534a\u6b63\u5b9a\uff08\u9ad8\u7ef4\u65f6\u4ece\u65b9\u5dee\u53d8\u6210\u534f\u65b9\u5dee\u77e9\u9635\uff09 \u4e3a\u4ec0\u4e48 3DGS \u662f\u692d\u7403\uff1f \u5404\u5411\u540c\u6027\u548c\u5404\u5411\u5f02\u6027 \u5404\u5411\u540c\u6027 \u5728\u6240\u6709\u65b9\u5411\u5177\u6709\u76f8\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma^2 & 0 &0 \\\\ 0 & \\sigma^2 &0 \\\\ 0 & 0 & \\sigma^2 \\end{bmatrix} \\] \u5404\u5411\u5f02\u6027 \u5728\u4e0d\u540c\u65b9\u5411\u5177\u6709\u4e0d\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u692d\u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma_x^2 & \\sigma_{xy} & \\sigma_{xz} \\\\ \\sigma_{yx} & \\sigma_y^2 & \\sigma_{yz} \\\\ \\sigma_{zx} & \\sigma_{zy} & \\sigma_z^2 \\end{bmatrix} \\] 3DGS \u4e0e\u534f\u65b9\u5dee\u77e9\u9635 \u00b6 \u534f\u65b9\u5dee\u77e9\u9635\u548c\u692d\u7403\u6709\u4ec0\u4e48\u5173\u7cfb\uff1f\u4e3a\u4ec0\u4e48\u80fd\u63a7\u5236\u692d\u7403\u5f62\u72b6\uff1f \u9ad8\u65af\u5206\u5e03\u7684\u4eff\u5c04\u53d8\u6362\uff1a \\(\\mathcal{w}=A \\mathcal{x} + b\\) \\(\\mathcal{w} \\thicksim N(A\\mu+b, A\\sum A^\\top)\\) \\(\\sum=A \\cdot I \\cdot A^\\top\\) \u5373\u4efb\u610f\u9ad8\u65af\u53ef\u4ee5\u770b\u4f5c\u662f\u6807\u51c6\u9ad8\u65af\u901a\u8fc7\u4eff\u5c04\u53d8\u6362\u5f97\u5230 \u534f\u65b9\u5dee\u77e9\u9635\u4e3a\u4ec0\u4e48\u80fd\u7528\u7f29\u653e\u548c\u65cb\u8f6c\u77e9\u9635\u8868\u8fbe\uff1f \\(A = RS\\) \\(\\sum=A \\cdot I \\cdot A^\\top = R \\cdot S \\cdot I \\cdot (R \\cdot S)^\\top = R \\cdot S \\cdot S^\\top \\cdot R^\\top\\) \u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635 Code # covariance = RS[S^T][R^T] def computeCov3D ( scale , mod , rot ): # create scaling matrix S = np . array ( [[ scale [ 0 ] * mod , 0 , 0 ], [ 0 , scale [ 1 ] * mod , 0 ], [ 0 , 0 , scale [ 2 ] * mod ]] ) # normalize quaternion to get valid rotation # we use rotation matrix R = rot # compute 3d world covariance matrix Sigma M = np . dot ( R , S ) cov3D = np . dot ( M , M . T ) return cov3D \u629b\u96ea\u7403 \u4ece 3D \u5230\u50cf\u7d20 \u00b6 \u5728\u76f8\u673a\u6a21\u578b\u4e2d\uff1a\u4e16\u754c\u5750\u6807\u7cfb\u3001\u76f8\u673a\u5750\u6807\u7cfb\u3001\u5f52\u4e00\u5316\u5750\u6807\u7cfb\u3001\u50cf\u7d20\u5750\u6807\u7cfb \u5728 CG \u4e2d\uff1a\u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\uff1a \u4ece\u4e16\u754c\u5750\u6807\u7cfb\u5230\u76f8\u673a\u5750\u6807\u7cfb \u4eff\u5c04\u53d8\u6362 \\(\\mathcal{w}=A \\mathcal{x} + b\\) \u6295\u5f71\u53d8\u6362 3D \u5230 2D \u6b63\u4ea4\u6295\u5f71\uff0c\u4e0e z \u65e0\u5173\uff0c\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7acb\u65b9\u4f53\u7f29\u653e\u5230 \\(\\left [-1,1 \\right ]^3\\) \u7684\u6b63\u65b9\u4f53\uff0c\u4eff\u5c04\u53d8\u6362 \u900f\u89c6\u6295\u5f71\uff0c\u4e0e z \u6709\u5173\uff0c\u5148\u628a\u9525\u4f53\u538b\u6210\u7acb\u65b9\u4f53\uff0c\u5728\u6b63\u4ea4\u6295\u5f71 \u89c6\u53e3\u53d8\u6362 \u4e0e z \u65e0\u5173 \u5c06 \\([-1, 1]^2\\) \u7684\u77e9\u5f62\u53d8\u6362\u81f3 \\([0, w] \\times [0, h]\\) \u5149\u6805\u5316 \u628a\u4e1c\u897f\u753b\u5728\u5c4f\u5e55\u4e0a \u8fde\u7eed\u8f6c\u79bb\u6563 \u65b9\u6cd5\uff1a\u91c7\u6837 \u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u6295\u5f71\u53d8\u6362\uff1f \u6295\u5f71\u53d8\u6362\u4e2d\uff1a \u9ad8\u65af\u6838\u4e2d\u5fc3 \\(x_k = [x_0, x_1, x_2]^\\top\\) \u9ad8\u65af\u6838 \\(r_k(x)=G_{v_k}(x-x_k)\\) \u5747\u503c \\(x_k = m(u_k)\\) \uff0c\u4e00\u4e2a\u70b9\uff0c\u4e0d\u4f1a\u5f62\u53d8 \u534f\u65b9\u5dee\u77e9\u9635\uff1f\u900f\u89c6\u6295\u5f71\u5230\u6b63\u4ea4\u6295\u5f71\u662f\u975e\u7ebf\u6027\u53d8\u6362\uff0c\u5373\u975e\u4eff\u5c04\u53d8\u6362\uff0c\u4f46\u9ad8\u65af\u692d\u7403\u4e00\u76f4\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528 \u5f15\u5165\u96c5\u53ef\u6bd4\u8fd1\u4f3c\u77e9\u9635 \u6cf0\u52d2\u5c55\u5f00\u3001\u7ebf\u6027\u903c\u8fd1 \u5bf9\u975e\u7ebf\u6027\u53d8\u6362\u7684\u5c40\u90e8\u7ebf\u6027\u8fd1\u4f3c \u53ef\u8ba1\u7b97\u5f97 \\(J = \\frac{\\partial m(u_k)}{\\partial u}\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(V_k = J V_k^\\prime j^\\top = JWV_k^{\\prime \\prime} W^\\top J^\\top\\) \u89c6\u53e3\u53d8\u6362 \u6b64\u65f6\u5747\u503c\u548c\u534f\u65b9\u5dee\u5728\u4e00\u4e2a\u5750\u6807\u7cfb\u5417\uff1f \u5747\u503c\uff1a\u5728 NDC \u5750\u6807\u7cfb \\([-1, 1]^3\\) \uff0c\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u534f\u65b9\u5dee\u77e9\u9635\uff1a\u5728\u672a\u7f29\u653e\u7684\u6b63\u4ea4\u5750\u6807\u7cfb \\([l,r] \\times [b, t] \\times [f, n]\\) \uff0c\u4e0d\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u5bf9\u4e8e\u9ad8\u65af\u6838\u4e2d\u5fc3 \\(\\mu = [\\mu_1, \\mu_2, \\mu_3]^\\top\\) \u5e73\u79fb + \u7f29\u653e \u5bf9\u4e8e\u534f\u65b9\u5dee\u77e9\u9635 \u8db3\u8ff9\u6e32\u67d3\uff1a\u79bb\u6563\u8ba1\u7b97 \\(G(\\hat{x}) = \\exp(-\\frac{1}{2} (x-\\mu)^\\top V_k^{-1}(x-\\mu))\\) 3DGS \u4e2d\u5fc3\u7684\u53d8\u6362 Code # transform point, from world to ndc # Notice, projmatrix already processed as mvp matrix p_hom = transformPoint4x4 ( p_orig , projmatrix ) p_w = 1 / ( p_hom [ 3 ] + 0.0000001 ) p_proj = [ p_hom [ 0 ] * p_w , p_hom [ 1 ] * p_w , p_hom [ 2 ] * p_w ] # transfrom point from NDC to Pixel point_image = [ ndc2Pix ( p_proj [ 0 ], W ), ndc2Pix ( p_proj [ 1 ], H )] 3DGS \u534f\u65b9\u5dee\u77e9\u9635\u7684\u53d8\u6362 Code def computeCov2D ( mean , focal_x , focal_y , tan_fovx , tan_fovy , cov3D , viewmatrix ): # The following models the steps outlined by equations 29 # and 31 in \"EWA Splatting\" (Zwicker et al., 2002). # Additionally considers aspect / scaling of viewport. # Transposes used to account for row-/column-major conventions. t = transformPoint4x3 ( mean , viewmatrix ) limx = 1.3 * tan_fovx limy = 1.3 * tan_fovy txtz = t [ 0 ] / t [ 2 ] tytz = t [ 1 ] / t [ 2 ] t [ 0 ] = min ( limx , max ( - limx , txtz )) * t [ 2 ] t [ 1 ] = min ( limy , max ( - limy , tytz )) * t [ 2 ] J = np . array ( [ [ focal_x / t [ 2 ], 0 , - ( focal_x * t [ 0 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , focal_y / t [ 2 ], - ( focal_y * t [ 1 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , 0 , 0 ], ] ) W = viewmatrix [: 3 , : 3 ] T = np . dot ( J , W ) cov = np . dot ( T , cov3D ) cov = np . dot ( cov , T . T ) # Apply low-pass filter # Every Gaussia should be at least one pixel wide/high # Discard 3rd row and column cov [ 0 , 0 ] += 0.3 cov [ 1 , 1 ] += 0.3 return [ cov [ 0 , 0 ], cov [ 0 , 1 ], cov [ 1 , 1 ]] \u96ea\u7403\u989c\u8272 \u7403\u8c10\u51fd\u6570 \u00b6 \u57fa\u51fd\u6570\uff1a\u4efb\u4f55\u4e00\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u5206\u89e3\u4e3a\u6b63\u5f26\u6838\u4f59\u5f26\u7684\u7ebf\u6027\u7ec4\u5408 \u7403\u8c10\u51fd\u6570 \u4efb\u4f55\u4e00\u4e2a\u7403\u9762\u5750\u6807\u7684\u51fd\u6570\u90fd\u53ef\u4ee5\u7528\u591a\u4e2a\u7403\u8c10\u51fd\u6570\u6765\u8fd1\u4f3c \\(f(t) \\approx \\sum_l \\sum_{m=-l}^l c_l^m y_l^m (\\theta, \\phi)\\) \u5176\u4e2d\uff0c \\(c_l^m\\) \u5404\u9879\u7cfb\u6570\uff0c \\(y^m\\) \u57fa\u51fd\u6570 \u8bba\u6587\u4e2d\u7684 \\(n=4\\) \uff0c\u5171\u6709 16 \u4e2a\u53c2\u6570\uff08\u672c\u8d28\u4e0a\u662f1+3+5+7\uff09 \u7403\u8c10\u51fd\u6570 Code def computeColorFromSH ( deg , pos , campos , sh ): # The implementation is loosely based on code for # \"Differentiable Point-Based Radiance Fields for # Efficient View Synthesis\" by Zhang et al. (2022) dir = pos - campos dir = dir / np . linalg . norm ( dir ) result = SH_C0 * sh [ 0 ] if deg > 0 : x , y , z = dir result = result - SH_C1 * y * sh [ 1 ] + SH_C1 * z * sh [ 2 ] - SH_C1 * x * sh [ 3 ] if deg > 1 : xx = x * x yy = y * y zz = z * z xy = x * y yz = y * z xz = x * z result = ( result + SH_C2 [ 0 ] * xy * sh [ 4 ] + SH_C2 [ 1 ] * yz * sh [ 5 ] + SH_C2 [ 2 ] * ( 2.0 * zz - xx - yy ) * sh [ 6 ] + SH_C2 [ 3 ] * xz * sh [ 7 ] + SH_C2 [ 4 ] * ( xx - yy ) * sh [ 8 ] ) if deg > 2 : result = ( result + SH_C3 [ 0 ] * y * ( 3.0 * xx - yy ) * sh [ 9 ] + SH_C3 [ 1 ] * xy * z * sh [ 10 ] + SH_C3 [ 2 ] * y * ( 4.0 * zz - xx - yy ) * sh [ 11 ] + SH_C3 [ 3 ] * z * ( 2.0 * zz - 3.0 * xx - 3.0 * yy ) * sh [ 12 ] + SH_C3 [ 4 ] * x * ( 4.0 * zz - xx - yy ) * sh [ 13 ] + SH_C3 [ 5 ] * z * ( xx - yy ) * sh [ 14 ] + SH_C3 [ 6 ] * x * ( xx - 3.0 * yy ) * sh [ 15 ] ) result += 0.5 return np . clip ( result , a_min = 0 , a_max = 1 ) \u4e3a\u4ec0\u4e48\u7403\u8c10\u51fd\u6570\u80fd\u66f4\u597d\u5730\u8868\u8fbe\u989c\u8272\uff1f \u6b63\u5e38\u4f7f\u7528\u7684 RGB \u53ea\u6709\u4e09\u4e2a\u53d8\u91cf\u8868\u8fbe \u7403\u8c10\u51fd\u6570\u6709 \\(16 \\times 3\\) \u4e2a\u53d8\u91cf\u8868\u8fbe \u8db3\u8ff9\u5408\u6210 \u76f4\u89c2\u4e0a\u8fdb\u884c \\(\\alpha\\) -blending \u5b9e\u9645\u4e0a 3DGS \u4f9d\u7136\u5bf9\u6bcf\u4e2a\u50cf\u7d20\u7740\u8272\uff0c\u53c2\u8003 NeRF \u5bf9\u5149\u7ebf\u4e0a\u7c92\u5b50\u8fdb\u884c\u6c42\u548c splatting \u6ca1\u6709\u50cf NeRF \u4e00\u6837\u627e\u7c92\u5b50\u7684\u8fc7\u7a0b \u5bf9\u9ad8\u65af\u7403\u6309\u7167\u6df1\u5ea6 z \u6392\u5e8f\uff0c\u6e32\u67d3\u7684\u65f6\u5019\u6254\u7684\u987a\u5e8f\u6709\u5173 \u5feb\u901f\u9ad8\u65af\u5149\u6805\u5316 \u00b6 \u5ef6\u7eed Splatting\uff0c\u5982\u4f55 \u5feb\u901f \u9ad8\u65af\u5149\u6805\u5316\uff1f \u4ece\u50cf\u7d20\u7ea7\u522b\u7684\u64cd\u4f5c\u7406\u89e3\u6e32\u67d3\u8fc7\u7a0b\uff1a\u5bf9\u4e8e\u7ed9\u5b9a\u5750\u6807 \\(x\\) \u7684\u50cf\u7d20\u70b9\uff0c\u53ef\u4ee5\u901a\u8fc7\u89c6\u56fe\u53d8\u5316\u8ba1\u7b97\u51fa\u6240\u6709\u5728\u8be5\u4f4d\u7f6e\u91cd\u53e0\u7684\u9ad8\u65af\u7684\u6df1\u5ea6\u5e76\u6392\u5e8f\uff0c\u6700\u540e\u5bf9\u6392\u5217\u597d\u7684\u9ad8\u65af\u8fdb\u884c \\(\\alpha\\) -blending\uff0c\u8fd4\u56de\u8be5\u50cf\u7d20\u70b9\u6700\u540e\u7684\u989c\u8272\u503c \\[ C = \\sum_{i \\in N} c_i \\alpha^\\prime \\prod_{j=1}^{i-1}(1 - \\alpha_j^\\prime) \\] \u7531\u4e8e\u6392\u5e8f\u8fc7\u7a0b\u96be\u4ee5\u5e76\u884c\u5316\uff0c3dgs \u4f7f\u7528\u4e00\u4e9b\u7b56\u7565\u63d0\u9ad8\u6548\u7387 \u4f7f\u7528\u56fe\u50cf\u5757\u6765\u4ee3\u66ff\u50cf\u7d20\u7ea7\u522b\u7684\u7cbe\u5ea6\uff0c\u6bcf\u4e2a\u5757\u5305\u542b \\(16 \\times 16\\) \u4e2a\u50cf\u7d20\uff0c\u5bf9\u4e8e\u8986\u76d6\u591a\u4e2a\u5757\u7684\u9ad8\u65af\uff0c\u4f5c\u8005\u590d\u5236\u9ad8\u65af\u5e76\u4e3a\u5b83\u4eec\u5206\u914d\u6807\u8bc6\u7b26 \u6bcf\u4e2a\u5757\u72ec\u7acb\u6392\u5e8f\u5e76\u8ba1\u7b97\u989c\u8272\u503c\uff0c\u53ef\u5e76\u884c\u6267\u884c \u81ea\u9002\u5e94\u9ad8\u65af\u5bc6\u5ea6\u63a7\u5236 \u00b6 \u521d\u59cb\u5316\u7684\u70b9\u4e91\u7684\u521d\u59cb\u5f62\u72b6\u662f\u4e00\u4e2a\u7403\uff0c \u5f3a\u4f9d\u8d56 SfM \u751f\u6210\u7684\u521d\u59cb\u70b9\u4e91 \uff0c\u53ef\u80fd\u5bfc\u81f4\u751f\u6210\u9ad8\u65af\u5728\u7a7a\u95f4\u5bc6\u5ea6\u8fc7\u5927\u6216\u8fc7\u5c0f\uff1f \u5177\u4f53\u65b9\u6cd5\u6709 \u70b9\u5bc6\u96c6\u5316 \u548c \u70b9\u526a\u679d \u3002 \u70b9\u5bc6\u96c6\u5316 \u00b6 \u91cd\u5efa\u4e0d\u8db3\u7684\u533a\u57df\u514b\u9686\u5c0f\u9ad8\u65af \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u57fa\u4e8e\u9009\u62e9\u7684\u70b9\u751f\u6210\u65b0\u7684\u70b9\u4e91\u5750\u6807\u3001\u7279\u5f81\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u7f29\u653e\u548c\u65cb\u8f6c \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91\u4e2d \u8c03\u7528 densification_postfix \u51fd\u6570\u5bf9\u70b9\u4e91\u8fdb\u884c\u540e\u5904\u7406 densify_and_clone Code def densify_and_clone ( self , grads , grad_threshold , scene_extent ): # Extract points that satisfy the gradient condition selected_pts_mask = torch . where ( torch . norm ( grads , dim =- 1 ) >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values <= self . percent_dense * scene_extent ) new_xyz = self . _xyz [ selected_pts_mask ] new_features_dc = self . _features_dc [ selected_pts_mask ] new_features_rest = self . _features_rest [ selected_pts_mask ] new_opacities = self . _opacity [ selected_pts_mask ] new_scaling = self . _scaling [ selected_pts_mask ] new_rotation = self . _rotation [ selected_pts_mask ] self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacities , new_scaling , new_rotation ) \u91cd\u5efa\u8fc7\u5ea6\u7684\u533a\u57df\u62c6\u5206\u5927\u9ad8\u65af \u83b7\u53d6\u521d\u59cb\u70b9\u4e91\u7684\u6570\u91cf n_init_points \u521b\u5efa\u4e00\u4e2a\u4e0e\u68af\u5ea6\u76f8\u540c\u5927\u5c0f\u7684\u96f6\u5f20\u91cf padded_grad \uff0c\u5e76\u5c06\u68af\u5ea6\u503c\u586b\u5145\u5230\u5176\u4e2d \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u5c06\u6ee1\u8db3\u6761\u4ef6\u548c\u7f29\u653e\u6761\u4ef6\u7684\u70b9\u590d\u5236 N \u6b21\uff0c\u5e76\u8ba1\u7b97\u65b0\u7684\u5750\u6807\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u548c\u7279\u5f81 \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91 \u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u526a\u679d\u7684\u8fc7\u6ee4\u5668 prune_filter \uff0c\u5176\u4e2d\u5305\u62ec\u539f\u59cb\u70b9\u4e91\u548c\u65b0\u751f\u6210\u70b9\u4e91\u7684\u63a9\u7801 \u6839\u636e\u526a\u679d\u8fc7\u6ee4\u5668\u5220\u9664\u4e0d\u9700\u8981\u7684\u70b9 densify_and_split Code def densify_and_split ( self , grads , grad_threshold , scene_extent , N = 2 ): n_init_points = self . get_xyz . shape [ 0 ] # Extract points that satisfy the gradient condition padded_grad = torch . zeros (( n_init_points ), device = \"cuda\" ) padded_grad [: grads . shape [ 0 ]] = grads . squeeze () selected_pts_mask = torch . where ( padded_grad >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values > self . percent_dense * scene_extent ) stds = self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) means = torch . zeros (( stds . size ( 0 ), 3 ), device = \"cuda\" ) samples = torch . normal ( mean = means , std = stds ) rots = build_rotation ( self . _rotation [ selected_pts_mask ]) . repeat ( N , 1 , 1 ) # \u65b0\u751f\u6210\u70b9\u4e91\u4fe1\u606f\uff08\u7531\u5927\u9ad8\u65af\u5206\u5272\u5e76\u6309\u4e00\u5b9a\u7cfb\u6570\u7f29\u653e\u5f97\u5230\uff09 new_xyz = torch . bmm ( rots , samples . unsqueeze ( - 1 )) . squeeze ( - 1 ) + self . get_xyz [ selected_pts_mask ] . repeat ( N , 1 ) new_scaling = self . scaling_inverse_activation ( self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) / ( 0.8 * N )) new_rotation = self . _rotation [ selected_pts_mask ] . repeat ( N , 1 ) new_features_dc = self . _features_dc [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_features_rest = self . _features_rest [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_opacity = self . _opacity [ selected_pts_mask ] . repeat ( N , 1 ) self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacity , new_scaling , new_rotation ) prune_filter = torch . cat (( selected_pts_mask , torch . zeros ( N * selected_pts_mask . sum (), device = \"cuda\" , dtype = bool ))) # \u88c1\u526a\u8fc7\u7a0b\u53c2\u7167\u5176\u4e0d\u900f\u660e\u5ea6\u503c\u8fdb\u884c\uff0c\u88c1\u526a\u6389\u4e0d\u5fc5\u8981\u7684\u70b9\u63d0\u9ad8\u6548\u7387 self . prune_points ( prune_filter ) \u70b9\u526a\u679d \u00b6 \u5c06\u4e0d\u900f\u660e\u5ea6\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u7684\u70b9\u51cf\u53bb\uff0c\u5c06\u8fc7\u5927\u7684\u4e5f\u51cf\u53bb\uff0c\u7c7b\u4f3c\u4e8e\u6b63\u5219\u5316\u8fc7\u7a0b\u3002\u5e76\u4e14\u5728\u8fed\u4ee3\u4e00\u5b9a\u6b21\u6570\u540e\uff0c\u9ad8\u65af\u4f1a\u88ab\u8bbe\u7f6e\u4e3a\u51e0\u4e4e\u900f\u660e\u3002\u8fd9\u6837\u5c31\u80fd\u6709\u63a7\u5236\u5730\u589e\u52a0\u5fc5\u8981\u7684\u9ad8\u65af\u5bc6\u5ea6\uff0c\u540c\u65f6\u5254\u9664\u591a\u4f59\u7684\u9ad8\u65af\u3002 \u6839\u636e\u6700\u5c0f\u4e0d\u900f\u660e\u5ea6\u548c\u6700\u5927\u5c4f\u5e55\u5c3a\u5bf8\u7b49\u6761\u4ef6\u751f\u6210\u526a\u679d\u63a9\u7801 prune_mask \uff0c\u5e76\u8c03\u7528 prune_points \u51fd\u6570\u8fdb\u884c\u70b9\u4e91\u7684\u526a\u679d\u64cd\u4f5c prune_points \u51fd\u6570\u6839\u636e\u7ed9\u5b9a\u7684\u63a9\u7801 mask \u5bf9\u70b9\u4e91\u8fdb\u884c\u526a\u679d\u64cd\u4f5c\uff0c\u5c06\u4e0d\u9700\u8981\u7684\u70b9\u4ece\u70b9\u4e91\u4e2d\u5220\u9664\uff0c\u5e76\u66f4\u65b0\u76f8\u5173\u7684\u5f20\u91cf\u6570\u636e densify_and_prune Code def densify_and_prune ( self , max_grad , min_opacity , extent , max_screen_size ): grads = self . xyz_gradient_accum / self . denom grads [ grads . isnan ()] = 0.0 # \u70b9\u5bc6\u96c6\u5316\u8fc7\u7a0b self . densify_and_clone ( grads , max_grad , extent ) self . densify_and_split ( grads , max_grad , extent ) prune_mask = ( self . get_opacity < min_opacity ) . squeeze () if max_screen_size : big_points_vs = self . max_radii2D > max_screen_size big_points_ws = self . get_scaling . max ( dim = 1 ) . values > 0.1 * extent prune_mask = torch . logical_or ( torch . logical_or ( prune_mask , big_points_vs ), big_points_ws ) self . prune_points ( prune_mask ) torch . cuda . empty_cache () def prune_points ( self , mask ): valid_points_mask = ~ mask optimizable_tensors = self . _prune_optimizer ( valid_points_mask ) self . _xyz = optimizable_tensors [ \"xyz\" ] self . _features_dc = optimizable_tensors [ \"f_dc\" ] self . _features_rest = optimizable_tensors [ \"f_rest\" ] self . _opacity = optimizable_tensors [ \"opacity\" ] self . _scaling = optimizable_tensors [ \"scaling\" ] self . _rotation = optimizable_tensors [ \"rotation\" ] self . xyz_gradient_accum = self . xyz_gradient_accum [ valid_points_mask ] self . denom = self . denom [ valid_points_mask ] self . max_radii2D = self . max_radii2D [ valid_points_mask ] \u53c2\u6570\u4f30\u8ba1 \u00b6 \u521d\u59cb\u70b9\u4e91\uff0c\u6bcf\u4e2a\u70b9\u81a8\u80c0\u6210 3d \u9ad8\u65af\u692d\u7403 \u5219\u6bcf\u4e2a\u692d\u7403\u7684\u53c2\u6570\u6709\uff1a \u4e2d\u5fc3\u70b9\u4f4d\u7f6e \\((x,y,z)\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(R,S\\) \u7403\u8c10\u51fd\u6570\u7cfb\u6570 \\(16 \\times 3\\) \u900f\u660e\u5ea6 \\(\\alpha\\) Source Code Review \u00b6 \u5b66\u4e60\u81ea \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb_gaussian splatting\u6e90\u7801\u5206\u6790-CSDN\u535a\u5ba2 Experiment \u00b6 \u786c\u4ef6\u914d\u7f6e Ubuntu 20.04 + 4060Ti + CUDA 11.8 \u8dd1\u5728 Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09 Office Scenes \u00b6 Own Scenes \u00b6 Reference \u00b6 3D GaussianSplatting \u6280\u672f\u7684\u5f71\u54cd\u4f1a\u6709\u591a\u5927\uff1f \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-3d gaussian splatting \u5168\u89e3(\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f) 3D Gaussian Splatting\u539f\u7406\u901f\u901a \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0a\uff09 \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0b\uff09 \uff08\u5e72\u8d27\uff09\u300a\u96c5\u53ef\u6bd4\u77e9\u9635\u662f\u4ec0\u4e48\u4e1c\u897f\u300b3Blue1Brown\uff0c\u642c\u81ea\u53ef\u6c57\u5b66\u9662\u3002 \u3010\u81ea\u5236\u4e2d\u6587\u5b57\u5e55\u3011 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb 3dgs_\u8721\u7b14\u5c0f\u65b0\u914d\u5409\u826f\u5409\u5f71\u7684\u535a\u5ba2-CSDN\u535a\u5ba2 \uff08\u4e09\u7ef4\u91cd\u5efa\u5b66\u4e60\uff093D Gaussian Splatting & Instant-NGP\u73af\u5883\u914d\u7f6e_3d gaussian splatting \u73af\u5883\u642d\u5efa-CSDN\u535a\u5ba2 Gaussian Splatting\u4ee3\u7801\u5b89\u88c5\u90e8\u7f72\uff08windows\uff09_gaussian splatting github-CSDN\u535a\u5ba2 3D Gaussian Splatting\u5165\u95e8\u6307\u5357 - \u54d4\u54e9\u54d4\u54e9","title":"3DGS"},{"location":"cv/papers/3dgs/3dgs/#3dgs","text":"\u7ea6 2609 \u4e2a\u5b57 174 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 11 \u5206\u949f Abstract paper\uff1a 3DGS: 3D Gaussian Splatting for Real-Time Radiance Field Rendering code\uff1a gaussian-splatting","title":"3DGS"},{"location":"cv/papers/3dgs/3dgs/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/3dgs/#introduction","text":"\u57fa\u4e8e Splatting \u548c\u673a\u5668\u5b66\u4e60\u7684\u4e09\u7ef4\u91cd\u5efa\u65b9\u6cd5\uff0c\u7528\u4e8e \u5b9e\u65f6\u4e14\u903c\u771f\u5730\u6e32\u67d3\u4ece\u4e00\u7ec4\u56fe\u50cf\u4e2d\u5b66\u5230\u7684\u573a\u666f \uff0c\u6539\u5584 NeRF \u7684\u8bad\u7ec3\u901f\u5ea6\u548c\u6e32\u67d3\u8d28\u91cf\u7684\u74f6\u9888\u95ee\u9898\uff0c \u4fdd\u6301\u6709\u7ade\u4e89\u529b\u7684\u8bad\u7ec3\u65f6\u95f4\u7684\u540c\u65f6\u5b9e\u73b0\u6700\u5148\u8fdb\u7684\u89c6\u89c9\u8d28\u91cf\uff0c\u5141\u8bb8\u5728 1080p \u5206\u8fa8\u7387\u4e0b\u5b9e\u73b0\u9ad8\u8d28\u91cf\u7684\u5b9e\u65f6\uff08 >= 30 fps\uff09\u7684\u65b0\u89c6\u56fe\u5408\u6210 3DGS \u8fdb\u884c\u573a\u666f\u8868\u8fbe \uff0c\u591a\u4e2a\u9ad8\u65af\u6a21\u578b\u5171\u540c\u6784\u6210\u6574\u4e2a\u573a\u666f\u7684\u8fde\u7eed\u4f53\u79ef\u8868\u793a \u4ece\u6700\u521d\u7531 SfM \u751f\u6210\u7684\u7a00\u758f\u70b9\u5f00\u59cb\u521d\u59cb\u5316 3DGS\u8fd9\u79cd\u57fa\u5143\uff0c\u7ee7\u627f \u53ef\u5fae\u5206 \u4f53\u79ef\u8868\u793a\u7684\u5c5e\u6027\uff0c\u540c\u65f6\u662f \u975e\u7ed3\u6784\u5316 \u548c \u663e\u5f0f \u7684\uff0c\u5bb9\u6613\u6295\u5f71\u5230 2D\uff0c\u5feb\u901f \\(\\alpha\\) -blender \u81ea\u9002\u5e94\u5bc6\u5ea6\u63a7\u5236\u4f18\u5316 \uff1a\u9488\u5bf9 3DGS \u7684\u5404\u79cd\u5c5e\u6027 \uff08\u4f4d\u7f6e\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u5404\u5411\u5f02\u6027\u534f\u65b9\u5dee\u548c\u7403\u8c10\u51fd\u6570\uff09 \u8fdb\u884c\u4f18\u5316\uff0c\u4e14\u4ea4\u9519\u8fdb\u884c\uff0c\u5305\u62ec\u5728\u4f18\u5316\u8fc7\u7a0b\u4e2d\u79fb\u9664 3DGS\uff0c\u4ee5\u6b64\u7cbe\u786e\u8868\u8fbe\u573a\u666f \u5feb\u901f\u5149\u6805\u5316 \uff1a\u4f7f\u7528\u9ad8\u901f GPU\uff0c\u652f\u6301\u5404\u5411\u5f02\u6027\u629b\u96ea\u7403\uff0c\u4fdd\u8bc1\u9ad8\u8d28\u91cf\u5b9e\u65f6\u6e32\u67d3","title":"Introduction"},{"location":"cv/papers/3dgs/3dgs/#splatting","text":"\u4ec0\u4e48\u662f Splatting\uff1f\u4ec0\u4e48\u662f 3DGS\uff1f\u4e3a\u4ec0\u4e48\u9009\u62e9 GS\uff1f \u4e00\u79cd\u4f53\u6e32\u67d3\u7684\u65b9\u6cd5\uff08\u629b\u96ea\u7403\u6cd5\u3001\u8db3\u8ff9\u6cd5\u3001\u55b7\u6e85\uff09\uff1a\u4ece 3D \u7269\u4f53\u6e32\u67d3\u5230 2D \u5e73\u9762 NeRF \u662f\u88ab\u52a8\u7684\uff0c\u65b9\u5f0f\u662f Ray-casting \uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u50cf\u7d20\u70b9\u6536\u5230\u53d1\u5149\u7c92\u5b50\u7684\u5f71\u54cd\u6765\u751f\u6210\u56fe\u50cf Splatting \u662f\u4e3b\u52a8\u7684\uff0c\u8ba1\u7b97\u51fa\u6bcf\u4e2a\u53d1\u5149\u7c92\u5b50\u5982\u4f55\u5f71\u54cd\u50cf\u7d20\u70b9 \u60f3\u8c61\u8f93\u5165\u662f\u4e00\u4e9b\u96ea\u7403\uff0c\u56fe\u7247\u662f\u4e00\u9762\u7816\u5899\uff0c\u56fe\u50cf\u751f\u6210\u8fc7\u7a0b\u662f\u5411\u5899\u9762\u6254\u96ea\u7403\u7684\u8fc7\u7a0b\uff0c\u6bcf\u6254\u4e00\u4e2a\u96ea\u7403\uff0c\u5899\u4e0a\u90fd\u6709\u6269\u6563\u75d5\u8ff9 footprint\uff0c\u6d41\u7a0b\uff1a \u9009\u62e9\u96ea\u7403 \u629b\u63b7\u96ea\u7403\uff0c\u4ece 3D \u6295\u5f71\u5230 2D\uff0c\u5f97\u5230\u8db3\u8ff9 \u5408\u6210\uff0c\u5f62\u6210\u6700\u540e\u56fe\u50cf","title":"Splatting"},{"location":"cv/papers/3dgs/3dgs/#3dgs_1","text":"\u8f93\u5165\u662f\u70b9\u4e91\uff0c\u65e0\u4f53\u79ef\uff0c\u9700\u8981\u4e00\u4e2a \u6838 \u8fdb\u884c\u81a8\u80c0\uff0c\u53ef\u4ee5\u7528\u9ad8\u65af/\u5706/\u6b63\u65b9\u4f53... \u9009\u62e9\u9ad8\u65af\u7684\u7406\u7531\uff0c\u6709\u5f88\u597d\u7684\u6570\u5b66\u6027\u8d28\uff1a \u4eff\u5c04\u53d8\u6362\u540e\u9ad8\u65af\u6838\u4ecd\u7136\u95ed\u5408 3D \u964d\u5230 2D \u540e\uff08\u6cbf\u7740\u67d0\u4e00\u8f74\u79ef\u5206\uff09\u4ecd\u7136\u662f\u9ad8\u65af \u692d\u7403\u9ad8\u65af \\(G(x;\\mu,\\sum)=\\frac{1}{\\sqrt{(2\\pi)^k \\left | \\sum \\right |}} \\exp^{-\\frac{1}{2}(x-\\mu)^\\top\\sum^{-1}(x-\\mu)}\\) \uff0c \\(\\mu\\) \u8868\u793a\u5747\u503c\uff0c \\(\\sum\\) \u8868\u793a\u534f\u65b9\u5dee\u77e9\u9635\uff0c\u534a\u6b63\u5b9a\uff08\u9ad8\u7ef4\u65f6\u4ece\u65b9\u5dee\u53d8\u6210\u534f\u65b9\u5dee\u77e9\u9635\uff09 \u4e3a\u4ec0\u4e48 3DGS \u662f\u692d\u7403\uff1f \u5404\u5411\u540c\u6027\u548c\u5404\u5411\u5f02\u6027 \u5404\u5411\u540c\u6027 \u5728\u6240\u6709\u65b9\u5411\u5177\u6709\u76f8\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma^2 & 0 &0 \\\\ 0 & \\sigma^2 &0 \\\\ 0 & 0 & \\sigma^2 \\end{bmatrix} \\] \u5404\u5411\u5f02\u6027 \u5728\u4e0d\u540c\u65b9\u5411\u5177\u6709\u4e0d\u540c\u7684\u6269\u6563\u7a0b\u5ea6\uff08\u68af\u5ea6\uff09\uff0c\u4f8b\u5982 \u692d\u7403 3D \u9ad8\u65af\u5206\u5e03\uff1a\u534f\u65b9\u5dee\u77e9\u9635\u662f\u5bf9\u89d2\u77e9\u9635 \\[ \\sum = \\begin{bmatrix} \\sigma_x^2 & \\sigma_{xy} & \\sigma_{xz} \\\\ \\sigma_{yx} & \\sigma_y^2 & \\sigma_{yz} \\\\ \\sigma_{zx} & \\sigma_{zy} & \\sigma_z^2 \\end{bmatrix} \\]","title":"\u9009\u62e9\u96ea\u7403 3DGS"},{"location":"cv/papers/3dgs/3dgs/#3dgs_2","text":"\u534f\u65b9\u5dee\u77e9\u9635\u548c\u692d\u7403\u6709\u4ec0\u4e48\u5173\u7cfb\uff1f\u4e3a\u4ec0\u4e48\u80fd\u63a7\u5236\u692d\u7403\u5f62\u72b6\uff1f \u9ad8\u65af\u5206\u5e03\u7684\u4eff\u5c04\u53d8\u6362\uff1a \\(\\mathcal{w}=A \\mathcal{x} + b\\) \\(\\mathcal{w} \\thicksim N(A\\mu+b, A\\sum A^\\top)\\) \\(\\sum=A \\cdot I \\cdot A^\\top\\) \u5373\u4efb\u610f\u9ad8\u65af\u53ef\u4ee5\u770b\u4f5c\u662f\u6807\u51c6\u9ad8\u65af\u901a\u8fc7\u4eff\u5c04\u53d8\u6362\u5f97\u5230 \u534f\u65b9\u5dee\u77e9\u9635\u4e3a\u4ec0\u4e48\u80fd\u7528\u7f29\u653e\u548c\u65cb\u8f6c\u77e9\u9635\u8868\u8fbe\uff1f \\(A = RS\\) \\(\\sum=A \\cdot I \\cdot A^\\top = R \\cdot S \\cdot I \\cdot (R \\cdot S)^\\top = R \\cdot S \\cdot S^\\top \\cdot R^\\top\\) \u8ba1\u7b97\u534f\u65b9\u5dee\u77e9\u9635 Code # covariance = RS[S^T][R^T] def computeCov3D ( scale , mod , rot ): # create scaling matrix S = np . array ( [[ scale [ 0 ] * mod , 0 , 0 ], [ 0 , scale [ 1 ] * mod , 0 ], [ 0 , 0 , scale [ 2 ] * mod ]] ) # normalize quaternion to get valid rotation # we use rotation matrix R = rot # compute 3d world covariance matrix Sigma M = np . dot ( R , S ) cov3D = np . dot ( M , M . T ) return cov3D","title":"3DGS \u4e0e\u534f\u65b9\u5dee\u77e9\u9635"},{"location":"cv/papers/3dgs/3dgs/#3d","text":"\u5728\u76f8\u673a\u6a21\u578b\u4e2d\uff1a\u4e16\u754c\u5750\u6807\u7cfb\u3001\u76f8\u673a\u5750\u6807\u7cfb\u3001\u5f52\u4e00\u5316\u5750\u6807\u7cfb\u3001\u50cf\u7d20\u5750\u6807\u7cfb \u5728 CG \u4e2d\uff1a\u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\u3001\u6295\u5f71\u53d8\u6362\u3001\u89c6\u53e3\u53d8\u6362\u3001\u5149\u6805\u5316 \u89c2\u6d4b\u53d8\u6362\uff1a \u4ece\u4e16\u754c\u5750\u6807\u7cfb\u5230\u76f8\u673a\u5750\u6807\u7cfb \u4eff\u5c04\u53d8\u6362 \\(\\mathcal{w}=A \\mathcal{x} + b\\) \u6295\u5f71\u53d8\u6362 3D \u5230 2D \u6b63\u4ea4\u6295\u5f71\uff0c\u4e0e z \u65e0\u5173\uff0c\u5e73\u79fb\u5230\u539f\u70b9\uff0c\u7acb\u65b9\u4f53\u7f29\u653e\u5230 \\(\\left [-1,1 \\right ]^3\\) \u7684\u6b63\u65b9\u4f53\uff0c\u4eff\u5c04\u53d8\u6362 \u900f\u89c6\u6295\u5f71\uff0c\u4e0e z \u6709\u5173\uff0c\u5148\u628a\u9525\u4f53\u538b\u6210\u7acb\u65b9\u4f53\uff0c\u5728\u6b63\u4ea4\u6295\u5f71 \u89c6\u53e3\u53d8\u6362 \u4e0e z \u65e0\u5173 \u5c06 \\([-1, 1]^2\\) \u7684\u77e9\u5f62\u53d8\u6362\u81f3 \\([0, w] \\times [0, h]\\) \u5149\u6805\u5316 \u628a\u4e1c\u897f\u753b\u5728\u5c4f\u5e55\u4e0a \u8fde\u7eed\u8f6c\u79bb\u6563 \u65b9\u6cd5\uff1a\u91c7\u6837 \u4e3a\u4ec0\u4e48\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528\u6295\u5f71\u53d8\u6362\uff1f \u6295\u5f71\u53d8\u6362\u4e2d\uff1a \u9ad8\u65af\u6838\u4e2d\u5fc3 \\(x_k = [x_0, x_1, x_2]^\\top\\) \u9ad8\u65af\u6838 \\(r_k(x)=G_{v_k}(x-x_k)\\) \u5747\u503c \\(x_k = m(u_k)\\) \uff0c\u4e00\u4e2a\u70b9\uff0c\u4e0d\u4f1a\u5f62\u53d8 \u534f\u65b9\u5dee\u77e9\u9635\uff1f\u900f\u89c6\u6295\u5f71\u5230\u6b63\u4ea4\u6295\u5f71\u662f\u975e\u7ebf\u6027\u53d8\u6362\uff0c\u5373\u975e\u4eff\u5c04\u53d8\u6362\uff0c\u4f46\u9ad8\u65af\u692d\u7403\u4e00\u76f4\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff0c\u6240\u4ee5\u4e0d\u80fd\u76f4\u63a5\u4f7f\u7528 \u5f15\u5165\u96c5\u53ef\u6bd4\u8fd1\u4f3c\u77e9\u9635 \u6cf0\u52d2\u5c55\u5f00\u3001\u7ebf\u6027\u903c\u8fd1 \u5bf9\u975e\u7ebf\u6027\u53d8\u6362\u7684\u5c40\u90e8\u7ebf\u6027\u8fd1\u4f3c \u53ef\u8ba1\u7b97\u5f97 \\(J = \\frac{\\partial m(u_k)}{\\partial u}\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(V_k = J V_k^\\prime j^\\top = JWV_k^{\\prime \\prime} W^\\top J^\\top\\) \u89c6\u53e3\u53d8\u6362 \u6b64\u65f6\u5747\u503c\u548c\u534f\u65b9\u5dee\u5728\u4e00\u4e2a\u5750\u6807\u7cfb\u5417\uff1f \u5747\u503c\uff1a\u5728 NDC \u5750\u6807\u7cfb \\([-1, 1]^3\\) \uff0c\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u534f\u65b9\u5dee\u77e9\u9635\uff1a\u5728\u672a\u7f29\u653e\u7684\u6b63\u4ea4\u5750\u6807\u7cfb \\([l,r] \\times [b, t] \\times [f, n]\\) \uff0c\u4e0d\u9700\u8981\u89c6\u53e3\u53d8\u6362 \u5bf9\u4e8e\u9ad8\u65af\u6838\u4e2d\u5fc3 \\(\\mu = [\\mu_1, \\mu_2, \\mu_3]^\\top\\) \u5e73\u79fb + \u7f29\u653e \u5bf9\u4e8e\u534f\u65b9\u5dee\u77e9\u9635 \u8db3\u8ff9\u6e32\u67d3\uff1a\u79bb\u6563\u8ba1\u7b97 \\(G(\\hat{x}) = \\exp(-\\frac{1}{2} (x-\\mu)^\\top V_k^{-1}(x-\\mu))\\) 3DGS \u4e2d\u5fc3\u7684\u53d8\u6362 Code # transform point, from world to ndc # Notice, projmatrix already processed as mvp matrix p_hom = transformPoint4x4 ( p_orig , projmatrix ) p_w = 1 / ( p_hom [ 3 ] + 0.0000001 ) p_proj = [ p_hom [ 0 ] * p_w , p_hom [ 1 ] * p_w , p_hom [ 2 ] * p_w ] # transfrom point from NDC to Pixel point_image = [ ndc2Pix ( p_proj [ 0 ], W ), ndc2Pix ( p_proj [ 1 ], H )] 3DGS \u534f\u65b9\u5dee\u77e9\u9635\u7684\u53d8\u6362 Code def computeCov2D ( mean , focal_x , focal_y , tan_fovx , tan_fovy , cov3D , viewmatrix ): # The following models the steps outlined by equations 29 # and 31 in \"EWA Splatting\" (Zwicker et al., 2002). # Additionally considers aspect / scaling of viewport. # Transposes used to account for row-/column-major conventions. t = transformPoint4x3 ( mean , viewmatrix ) limx = 1.3 * tan_fovx limy = 1.3 * tan_fovy txtz = t [ 0 ] / t [ 2 ] tytz = t [ 1 ] / t [ 2 ] t [ 0 ] = min ( limx , max ( - limx , txtz )) * t [ 2 ] t [ 1 ] = min ( limy , max ( - limy , tytz )) * t [ 2 ] J = np . array ( [ [ focal_x / t [ 2 ], 0 , - ( focal_x * t [ 0 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , focal_y / t [ 2 ], - ( focal_y * t [ 1 ]) / ( t [ 2 ] * t [ 2 ])], [ 0 , 0 , 0 ], ] ) W = viewmatrix [: 3 , : 3 ] T = np . dot ( J , W ) cov = np . dot ( T , cov3D ) cov = np . dot ( cov , T . T ) # Apply low-pass filter # Every Gaussia should be at least one pixel wide/high # Discard 3rd row and column cov [ 0 , 0 ] += 0.3 cov [ 1 , 1 ] += 0.3 return [ cov [ 0 , 0 ], cov [ 0 , 1 ], cov [ 1 , 1 ]]","title":"\u629b\u96ea\u7403 \u4ece 3D \u5230\u50cf\u7d20"},{"location":"cv/papers/3dgs/3dgs/#_1","text":"\u57fa\u51fd\u6570\uff1a\u4efb\u4f55\u4e00\u4e2a\u51fd\u6570\u90fd\u53ef\u4ee5\u5206\u89e3\u4e3a\u6b63\u5f26\u6838\u4f59\u5f26\u7684\u7ebf\u6027\u7ec4\u5408 \u7403\u8c10\u51fd\u6570 \u4efb\u4f55\u4e00\u4e2a\u7403\u9762\u5750\u6807\u7684\u51fd\u6570\u90fd\u53ef\u4ee5\u7528\u591a\u4e2a\u7403\u8c10\u51fd\u6570\u6765\u8fd1\u4f3c \\(f(t) \\approx \\sum_l \\sum_{m=-l}^l c_l^m y_l^m (\\theta, \\phi)\\) \u5176\u4e2d\uff0c \\(c_l^m\\) \u5404\u9879\u7cfb\u6570\uff0c \\(y^m\\) \u57fa\u51fd\u6570 \u8bba\u6587\u4e2d\u7684 \\(n=4\\) \uff0c\u5171\u6709 16 \u4e2a\u53c2\u6570\uff08\u672c\u8d28\u4e0a\u662f1+3+5+7\uff09 \u7403\u8c10\u51fd\u6570 Code def computeColorFromSH ( deg , pos , campos , sh ): # The implementation is loosely based on code for # \"Differentiable Point-Based Radiance Fields for # Efficient View Synthesis\" by Zhang et al. (2022) dir = pos - campos dir = dir / np . linalg . norm ( dir ) result = SH_C0 * sh [ 0 ] if deg > 0 : x , y , z = dir result = result - SH_C1 * y * sh [ 1 ] + SH_C1 * z * sh [ 2 ] - SH_C1 * x * sh [ 3 ] if deg > 1 : xx = x * x yy = y * y zz = z * z xy = x * y yz = y * z xz = x * z result = ( result + SH_C2 [ 0 ] * xy * sh [ 4 ] + SH_C2 [ 1 ] * yz * sh [ 5 ] + SH_C2 [ 2 ] * ( 2.0 * zz - xx - yy ) * sh [ 6 ] + SH_C2 [ 3 ] * xz * sh [ 7 ] + SH_C2 [ 4 ] * ( xx - yy ) * sh [ 8 ] ) if deg > 2 : result = ( result + SH_C3 [ 0 ] * y * ( 3.0 * xx - yy ) * sh [ 9 ] + SH_C3 [ 1 ] * xy * z * sh [ 10 ] + SH_C3 [ 2 ] * y * ( 4.0 * zz - xx - yy ) * sh [ 11 ] + SH_C3 [ 3 ] * z * ( 2.0 * zz - 3.0 * xx - 3.0 * yy ) * sh [ 12 ] + SH_C3 [ 4 ] * x * ( 4.0 * zz - xx - yy ) * sh [ 13 ] + SH_C3 [ 5 ] * z * ( xx - yy ) * sh [ 14 ] + SH_C3 [ 6 ] * x * ( xx - 3.0 * yy ) * sh [ 15 ] ) result += 0.5 return np . clip ( result , a_min = 0 , a_max = 1 ) \u4e3a\u4ec0\u4e48\u7403\u8c10\u51fd\u6570\u80fd\u66f4\u597d\u5730\u8868\u8fbe\u989c\u8272\uff1f \u6b63\u5e38\u4f7f\u7528\u7684 RGB \u53ea\u6709\u4e09\u4e2a\u53d8\u91cf\u8868\u8fbe \u7403\u8c10\u51fd\u6570\u6709 \\(16 \\times 3\\) \u4e2a\u53d8\u91cf\u8868\u8fbe \u8db3\u8ff9\u5408\u6210 \u76f4\u89c2\u4e0a\u8fdb\u884c \\(\\alpha\\) -blending \u5b9e\u9645\u4e0a 3DGS \u4f9d\u7136\u5bf9\u6bcf\u4e2a\u50cf\u7d20\u7740\u8272\uff0c\u53c2\u8003 NeRF \u5bf9\u5149\u7ebf\u4e0a\u7c92\u5b50\u8fdb\u884c\u6c42\u548c splatting \u6ca1\u6709\u50cf NeRF \u4e00\u6837\u627e\u7c92\u5b50\u7684\u8fc7\u7a0b \u5bf9\u9ad8\u65af\u7403\u6309\u7167\u6df1\u5ea6 z \u6392\u5e8f\uff0c\u6e32\u67d3\u7684\u65f6\u5019\u6254\u7684\u987a\u5e8f\u6709\u5173","title":"\u96ea\u7403\u989c\u8272 \u7403\u8c10\u51fd\u6570"},{"location":"cv/papers/3dgs/3dgs/#_2","text":"\u5ef6\u7eed Splatting\uff0c\u5982\u4f55 \u5feb\u901f \u9ad8\u65af\u5149\u6805\u5316\uff1f \u4ece\u50cf\u7d20\u7ea7\u522b\u7684\u64cd\u4f5c\u7406\u89e3\u6e32\u67d3\u8fc7\u7a0b\uff1a\u5bf9\u4e8e\u7ed9\u5b9a\u5750\u6807 \\(x\\) \u7684\u50cf\u7d20\u70b9\uff0c\u53ef\u4ee5\u901a\u8fc7\u89c6\u56fe\u53d8\u5316\u8ba1\u7b97\u51fa\u6240\u6709\u5728\u8be5\u4f4d\u7f6e\u91cd\u53e0\u7684\u9ad8\u65af\u7684\u6df1\u5ea6\u5e76\u6392\u5e8f\uff0c\u6700\u540e\u5bf9\u6392\u5217\u597d\u7684\u9ad8\u65af\u8fdb\u884c \\(\\alpha\\) -blending\uff0c\u8fd4\u56de\u8be5\u50cf\u7d20\u70b9\u6700\u540e\u7684\u989c\u8272\u503c \\[ C = \\sum_{i \\in N} c_i \\alpha^\\prime \\prod_{j=1}^{i-1}(1 - \\alpha_j^\\prime) \\] \u7531\u4e8e\u6392\u5e8f\u8fc7\u7a0b\u96be\u4ee5\u5e76\u884c\u5316\uff0c3dgs \u4f7f\u7528\u4e00\u4e9b\u7b56\u7565\u63d0\u9ad8\u6548\u7387 \u4f7f\u7528\u56fe\u50cf\u5757\u6765\u4ee3\u66ff\u50cf\u7d20\u7ea7\u522b\u7684\u7cbe\u5ea6\uff0c\u6bcf\u4e2a\u5757\u5305\u542b \\(16 \\times 16\\) \u4e2a\u50cf\u7d20\uff0c\u5bf9\u4e8e\u8986\u76d6\u591a\u4e2a\u5757\u7684\u9ad8\u65af\uff0c\u4f5c\u8005\u590d\u5236\u9ad8\u65af\u5e76\u4e3a\u5b83\u4eec\u5206\u914d\u6807\u8bc6\u7b26 \u6bcf\u4e2a\u5757\u72ec\u7acb\u6392\u5e8f\u5e76\u8ba1\u7b97\u989c\u8272\u503c\uff0c\u53ef\u5e76\u884c\u6267\u884c","title":"\u5feb\u901f\u9ad8\u65af\u5149\u6805\u5316"},{"location":"cv/papers/3dgs/3dgs/#_3","text":"\u521d\u59cb\u5316\u7684\u70b9\u4e91\u7684\u521d\u59cb\u5f62\u72b6\u662f\u4e00\u4e2a\u7403\uff0c \u5f3a\u4f9d\u8d56 SfM \u751f\u6210\u7684\u521d\u59cb\u70b9\u4e91 \uff0c\u53ef\u80fd\u5bfc\u81f4\u751f\u6210\u9ad8\u65af\u5728\u7a7a\u95f4\u5bc6\u5ea6\u8fc7\u5927\u6216\u8fc7\u5c0f\uff1f \u5177\u4f53\u65b9\u6cd5\u6709 \u70b9\u5bc6\u96c6\u5316 \u548c \u70b9\u526a\u679d \u3002","title":"\u81ea\u9002\u5e94\u9ad8\u65af\u5bc6\u5ea6\u63a7\u5236"},{"location":"cv/papers/3dgs/3dgs/#_4","text":"\u91cd\u5efa\u4e0d\u8db3\u7684\u533a\u57df\u514b\u9686\u5c0f\u9ad8\u65af \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u57fa\u4e8e\u9009\u62e9\u7684\u70b9\u751f\u6210\u65b0\u7684\u70b9\u4e91\u5750\u6807\u3001\u7279\u5f81\u3001\u4e0d\u900f\u660e\u5ea6\u3001\u7f29\u653e\u548c\u65cb\u8f6c \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91\u4e2d \u8c03\u7528 densification_postfix \u51fd\u6570\u5bf9\u70b9\u4e91\u8fdb\u884c\u540e\u5904\u7406 densify_and_clone Code def densify_and_clone ( self , grads , grad_threshold , scene_extent ): # Extract points that satisfy the gradient condition selected_pts_mask = torch . where ( torch . norm ( grads , dim =- 1 ) >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values <= self . percent_dense * scene_extent ) new_xyz = self . _xyz [ selected_pts_mask ] new_features_dc = self . _features_dc [ selected_pts_mask ] new_features_rest = self . _features_rest [ selected_pts_mask ] new_opacities = self . _opacity [ selected_pts_mask ] new_scaling = self . _scaling [ selected_pts_mask ] new_rotation = self . _rotation [ selected_pts_mask ] self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacities , new_scaling , new_rotation ) \u91cd\u5efa\u8fc7\u5ea6\u7684\u533a\u57df\u62c6\u5206\u5927\u9ad8\u65af \u83b7\u53d6\u521d\u59cb\u70b9\u4e91\u7684\u6570\u91cf n_init_points \u521b\u5efa\u4e00\u4e2a\u4e0e\u68af\u5ea6\u76f8\u540c\u5927\u5c0f\u7684\u96f6\u5f20\u91cf padded_grad \uff0c\u5e76\u5c06\u68af\u5ea6\u503c\u586b\u5145\u5230\u5176\u4e2d \u6839\u636e\u68af\u5ea6\u7684\u9608\u503c\u6761\u4ef6\u548c\u70b9\u4e91\u7684\u7f29\u653e\u56e0\u5b50\uff0c\u751f\u6210\u4e00\u4e2a\u9009\u62e9\u70b9\u7684\u63a9\u7801 selected_pts_mask \u5c06\u6ee1\u8db3\u6761\u4ef6\u548c\u7f29\u653e\u6761\u4ef6\u7684\u70b9\u590d\u5236 N \u6b21\uff0c\u5e76\u8ba1\u7b97\u65b0\u7684\u5750\u6807\u3001\u7f29\u653e\u3001\u65cb\u8f6c\u548c\u7279\u5f81 \u5c06\u65b0\u751f\u6210\u7684\u70b9\u4e91\u548c\u7279\u5f81\u9644\u52a0\u5230\u539f\u59cb\u70b9\u4e91 \u521b\u5efa\u4e00\u4e2a\u7528\u4e8e\u526a\u679d\u7684\u8fc7\u6ee4\u5668 prune_filter \uff0c\u5176\u4e2d\u5305\u62ec\u539f\u59cb\u70b9\u4e91\u548c\u65b0\u751f\u6210\u70b9\u4e91\u7684\u63a9\u7801 \u6839\u636e\u526a\u679d\u8fc7\u6ee4\u5668\u5220\u9664\u4e0d\u9700\u8981\u7684\u70b9 densify_and_split Code def densify_and_split ( self , grads , grad_threshold , scene_extent , N = 2 ): n_init_points = self . get_xyz . shape [ 0 ] # Extract points that satisfy the gradient condition padded_grad = torch . zeros (( n_init_points ), device = \"cuda\" ) padded_grad [: grads . shape [ 0 ]] = grads . squeeze () selected_pts_mask = torch . where ( padded_grad >= grad_threshold , True , False ) selected_pts_mask = torch . logical_and ( selected_pts_mask , torch . max ( self . get_scaling , dim = 1 ) . values > self . percent_dense * scene_extent ) stds = self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) means = torch . zeros (( stds . size ( 0 ), 3 ), device = \"cuda\" ) samples = torch . normal ( mean = means , std = stds ) rots = build_rotation ( self . _rotation [ selected_pts_mask ]) . repeat ( N , 1 , 1 ) # \u65b0\u751f\u6210\u70b9\u4e91\u4fe1\u606f\uff08\u7531\u5927\u9ad8\u65af\u5206\u5272\u5e76\u6309\u4e00\u5b9a\u7cfb\u6570\u7f29\u653e\u5f97\u5230\uff09 new_xyz = torch . bmm ( rots , samples . unsqueeze ( - 1 )) . squeeze ( - 1 ) + self . get_xyz [ selected_pts_mask ] . repeat ( N , 1 ) new_scaling = self . scaling_inverse_activation ( self . get_scaling [ selected_pts_mask ] . repeat ( N , 1 ) / ( 0.8 * N )) new_rotation = self . _rotation [ selected_pts_mask ] . repeat ( N , 1 ) new_features_dc = self . _features_dc [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_features_rest = self . _features_rest [ selected_pts_mask ] . repeat ( N , 1 , 1 ) new_opacity = self . _opacity [ selected_pts_mask ] . repeat ( N , 1 ) self . densification_postfix ( new_xyz , new_features_dc , new_features_rest , new_opacity , new_scaling , new_rotation ) prune_filter = torch . cat (( selected_pts_mask , torch . zeros ( N * selected_pts_mask . sum (), device = \"cuda\" , dtype = bool ))) # \u88c1\u526a\u8fc7\u7a0b\u53c2\u7167\u5176\u4e0d\u900f\u660e\u5ea6\u503c\u8fdb\u884c\uff0c\u88c1\u526a\u6389\u4e0d\u5fc5\u8981\u7684\u70b9\u63d0\u9ad8\u6548\u7387 self . prune_points ( prune_filter )","title":"\u70b9\u5bc6\u96c6\u5316"},{"location":"cv/papers/3dgs/3dgs/#_5","text":"\u5c06\u4e0d\u900f\u660e\u5ea6\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u7684\u70b9\u51cf\u53bb\uff0c\u5c06\u8fc7\u5927\u7684\u4e5f\u51cf\u53bb\uff0c\u7c7b\u4f3c\u4e8e\u6b63\u5219\u5316\u8fc7\u7a0b\u3002\u5e76\u4e14\u5728\u8fed\u4ee3\u4e00\u5b9a\u6b21\u6570\u540e\uff0c\u9ad8\u65af\u4f1a\u88ab\u8bbe\u7f6e\u4e3a\u51e0\u4e4e\u900f\u660e\u3002\u8fd9\u6837\u5c31\u80fd\u6709\u63a7\u5236\u5730\u589e\u52a0\u5fc5\u8981\u7684\u9ad8\u65af\u5bc6\u5ea6\uff0c\u540c\u65f6\u5254\u9664\u591a\u4f59\u7684\u9ad8\u65af\u3002 \u6839\u636e\u6700\u5c0f\u4e0d\u900f\u660e\u5ea6\u548c\u6700\u5927\u5c4f\u5e55\u5c3a\u5bf8\u7b49\u6761\u4ef6\u751f\u6210\u526a\u679d\u63a9\u7801 prune_mask \uff0c\u5e76\u8c03\u7528 prune_points \u51fd\u6570\u8fdb\u884c\u70b9\u4e91\u7684\u526a\u679d\u64cd\u4f5c prune_points \u51fd\u6570\u6839\u636e\u7ed9\u5b9a\u7684\u63a9\u7801 mask \u5bf9\u70b9\u4e91\u8fdb\u884c\u526a\u679d\u64cd\u4f5c\uff0c\u5c06\u4e0d\u9700\u8981\u7684\u70b9\u4ece\u70b9\u4e91\u4e2d\u5220\u9664\uff0c\u5e76\u66f4\u65b0\u76f8\u5173\u7684\u5f20\u91cf\u6570\u636e densify_and_prune Code def densify_and_prune ( self , max_grad , min_opacity , extent , max_screen_size ): grads = self . xyz_gradient_accum / self . denom grads [ grads . isnan ()] = 0.0 # \u70b9\u5bc6\u96c6\u5316\u8fc7\u7a0b self . densify_and_clone ( grads , max_grad , extent ) self . densify_and_split ( grads , max_grad , extent ) prune_mask = ( self . get_opacity < min_opacity ) . squeeze () if max_screen_size : big_points_vs = self . max_radii2D > max_screen_size big_points_ws = self . get_scaling . max ( dim = 1 ) . values > 0.1 * extent prune_mask = torch . logical_or ( torch . logical_or ( prune_mask , big_points_vs ), big_points_ws ) self . prune_points ( prune_mask ) torch . cuda . empty_cache () def prune_points ( self , mask ): valid_points_mask = ~ mask optimizable_tensors = self . _prune_optimizer ( valid_points_mask ) self . _xyz = optimizable_tensors [ \"xyz\" ] self . _features_dc = optimizable_tensors [ \"f_dc\" ] self . _features_rest = optimizable_tensors [ \"f_rest\" ] self . _opacity = optimizable_tensors [ \"opacity\" ] self . _scaling = optimizable_tensors [ \"scaling\" ] self . _rotation = optimizable_tensors [ \"rotation\" ] self . xyz_gradient_accum = self . xyz_gradient_accum [ valid_points_mask ] self . denom = self . denom [ valid_points_mask ] self . max_radii2D = self . max_radii2D [ valid_points_mask ]","title":"\u70b9\u526a\u679d"},{"location":"cv/papers/3dgs/3dgs/#_6","text":"\u521d\u59cb\u70b9\u4e91\uff0c\u6bcf\u4e2a\u70b9\u81a8\u80c0\u6210 3d \u9ad8\u65af\u692d\u7403 \u5219\u6bcf\u4e2a\u692d\u7403\u7684\u53c2\u6570\u6709\uff1a \u4e2d\u5fc3\u70b9\u4f4d\u7f6e \\((x,y,z)\\) \u534f\u65b9\u5dee\u77e9\u9635 \\(R,S\\) \u7403\u8c10\u51fd\u6570\u7cfb\u6570 \\(16 \\times 3\\) \u900f\u660e\u5ea6 \\(\\alpha\\)","title":"\u53c2\u6570\u4f30\u8ba1"},{"location":"cv/papers/3dgs/3dgs/#source-code-review","text":"\u5b66\u4e60\u81ea \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb_gaussian splatting\u6e90\u7801\u5206\u6790-CSDN\u535a\u5ba2","title":"Source Code Review"},{"location":"cv/papers/3dgs/3dgs/#experiment","text":"\u786c\u4ef6\u914d\u7f6e Ubuntu 20.04 + 4060Ti + CUDA 11.8 \u8dd1\u5728 Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09","title":"Experiment"},{"location":"cv/papers/3dgs/3dgs/#office-scenes","text":"","title":"Office Scenes"},{"location":"cv/papers/3dgs/3dgs/#own-scenes","text":"","title":"Own Scenes"},{"location":"cv/papers/3dgs/3dgs/#reference","text":"3D GaussianSplatting \u6280\u672f\u7684\u5f71\u54cd\u4f1a\u6709\u591a\u5927\uff1f \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-3d gaussian splatting \u5168\u89e3(\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f) 3D Gaussian Splatting\u539f\u7406\u901f\u901a \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0a\uff09 \u54c8\u5de5\u5927\u535a\u58eb\u5206\u4eab\uff1a\u57fa\u4e8eGaussian Splatting\u7684SLAM\u65b0\u53d1\u5c55\u4e0e\u65b0\u8bba\u6587\uff08\u4e0b\uff09 \uff08\u5e72\u8d27\uff09\u300a\u96c5\u53ef\u6bd4\u77e9\u9635\u662f\u4ec0\u4e48\u4e1c\u897f\u300b3Blue1Brown\uff0c\u642c\u81ea\u53ef\u6c57\u5b66\u9662\u3002 \u3010\u81ea\u5236\u4e2d\u6587\u5b57\u5e55\u3011 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian Splatting\u6e90\u7801\u89e3\u8bfb 3dgs_\u8721\u7b14\u5c0f\u65b0\u914d\u5409\u826f\u5409\u5f71\u7684\u535a\u5ba2-CSDN\u535a\u5ba2 \uff08\u4e09\u7ef4\u91cd\u5efa\u5b66\u4e60\uff093D Gaussian Splatting & Instant-NGP\u73af\u5883\u914d\u7f6e_3d gaussian splatting \u73af\u5883\u642d\u5efa-CSDN\u535a\u5ba2 Gaussian Splatting\u4ee3\u7801\u5b89\u88c5\u90e8\u7f72\uff08windows\uff09_gaussian splatting github-CSDN\u535a\u5ba2 3D Gaussian Splatting\u5165\u95e8\u6307\u5357 - \u54d4\u54e9\u54d4\u54e9","title":"Reference"},{"location":"cv/papers/3dgs/4dgs/","text":"4DGaussians \u00b6 \u7ea6 1368 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a 4D Gaussian Splatting for Real-Time Dynamic Scene Rendering code\uff1a 4DGaussians Idea \u00b6 Introduction \u00b6 3DGS \u53ea\u80fd\u5728\u9759\u6001\u573a\u666f\u91cd\u5efa\uff0c\u5982\u679c\u53d1\u751f\u8fd0\u52a8\uff0c\u5219\u9700\u8981\u8003\u8651\u65f6\u95f4\u7ef4\u5ea6\u7684\u4fe1\u606f\uff0c\u628a 3DGS \u7684\u601d\u60f3\u653e\u5230\u5bf9\u52a8\u6001\u7a7a\u95f4\u7684\u5efa\u6a21\u4e0a \u6700\u7b80\u5355\u7684\u60f3\u6cd5\u5c31\u662f\u5728\u6bcf\u4e00\u4e2a\u65f6\u95f4\u70b9\u4e0a\u5355\u72ec\u5efa\u7acb\u4e00\u4e2a 3DGS \u6a21\u578b\uff0c\u5c06\u4e00\u6bb5\u65f6\u95f4\u4e0a\u6240\u6709\u7684 3DGS \u6a21\u578b\u7ec4\u5408\u8d77\u6765\u5c31\u662f\u4e00\u4e2a 4DGS \u6a21\u578b\uff0c\u4f46\u8fd9\u6837\u4f1a\u4ee3\u7801\u5b58\u50a8\u7a7a\u95f4\u7206\u70b8\u7684\u95ee\u9898 4DGS \u7684\u521b\u65b0\u70b9\u5728\u4e8e\uff0c\u5728 3DGS \u7684\u57fa\u7840\u4e0a\uff0c\u5f15\u5165 \u53d8\u5f62\u573a(deformation field) \u6765\u8868\u793a Gaussians \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff0c\u5305\u62ec\u4e00\u4e2a\u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u548c\u4e00\u4e2a\u8f7b\u91cf\u7ea7 MLP\uff0c\u7b80\u5355\u5730\u8bf4\uff0c\u5c06\u52a8\u6001\u573a\u666f\u770b\u4f5c\u662f\u4e00\u4e2a\u9759\u6001\u573a\u666f\u5728\u65f6\u95f4\u7ef4\u5ea6\u4e0a\u7684\u53d8\u5f62 \u5728\u6bcf\u4e2a\u65f6\u95f4\u6233\uff0c\u53d8\u5f62\u573a\u4f1a\u5c06 Gaussians \u8f6c\u6362\u5230\u4e00\u4e2a\u5177\u4f53\u65b0\u5f62\u72b6\u7684\u65b0\u4f4d\u7f6e\uff0c\u8be5\u53d8\u6362\u76f8\u5f53\u4e8e Gaussian \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff08\u4ece\u59cb\u81f3\u7ec8\u53ea\u7ef4\u62a4\u4e00\u7ec4 3DGS \u6a21\u578b\uff0c\u5373\u53ea\u6709\u4e00\u7ec4 3D \u9ad8\u65af\u7403\uff0c\u53ea\u662f\u5728\u4e0d\u540c\u7684\u65f6\u95f4\u8282\u70b9\uff0c\u9ad8\u65af\u7403\u4f1a\u505a\u51fa\u76f8\u5e94\u7684\u53d8\u6362\uff09 4DGS \u6a21\u578b\u4e2d\uff0c\u5c06\u4e00\u4e2a\u70b9\u7684 \\((x,y,z,t)\\) \u5750\u6807\u5148\u4ee3\u5165\u4e00\u4e2a\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668\uff0c\u968f\u540e\u8f93\u51fa\u5e26\u5165\u4e00\u4e2a\u591a\u5934\u7684\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u8fdb\u884c\u89e3\u7801\uff0c\u5f97\u5230 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u4e0e\u539f\u503c\u76f8\u52a0\u540e\uff0c\u6309\u7167 3DGS \u7684\u65b9\u6cd5\u5f97\u5230\u4e0d\u900f\u660e\u5ea6\u548c SH \u7cfb\u6570\u8fdb\u884c\u6e32\u67d3 4D Gaussian Splatting Framework \u00b6 \u53c2\u6570\u8bf4\u660e \u65cb\u8f6c\u77e9\u9635 \\(M = [R, T]\\) \u65f6\u95f4\u6233 \\(t\\) 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u9ad8\u65af\u53d8\u5f62\u573a\u7f51\u7edc \\(\\mathcal{F}\\) \u6cfc\u6e85\u65b9\u6cd5 \\(\\mathcal{S}\\) 3D \u9ad8\u65af\u53d8\u5f62\u573a\u53d8\u5316\u91cf \\(\\Delta \\mathcal{G} = \\mathcal{F}(\\mathcal{G}, t)\\) \u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668 \\(\\mathcal{H}\\) \uff0c\u5c06 3D \u9ad8\u65af\u7f16\u7801 \\(f_d = \\mathcal{H} = (\\mathcal{G}, t)\\) \u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D}\\) \uff0c\u5c06 \\(\\Delta \\mathcal{G}\\) \u89e3\u7801 \\(\\Delta \\mathcal{G} = \\mathcal{D}(f)\\) \u4ece\u539f\u59cb 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u8f6c\u6362\u5230\u4e00\u4e2a\u65f6\u95f4\u6233\u7684\u65b0\u7684 \\(\\mathcal{G}^\\prime = \\Delta \\mathcal{G} + \\mathcal{G}\\) \u65b0\u89c6\u89d2\u56fe\u50cf \\(\\hat{I} = \\mathcal{S}(M, \\mathcal{G}^\\prime)\\) Gaussian Deformation Field Network \u00b6 Spatial-Temporal Structure Encoder \u00b6 \u7075\u611f\u6765\u6e90 \u53c2\u8003 CVPR 2023 HexPlane \u548c K-Planes \u4e2d\u6709\u5173\u65f6\u7a7a\u7ed3\u6784\u5f20\u91cf\u5206\u89e3\u7684\u601d\u60f3\uff0c\u6700\u5f00\u59cb\u662f\u5728 3D NeRF \u4e2d \u8bba\u6587 TensoRF \u51fa\u73b0\uff0c\u6536\u5230\u5f20\u91cf CP/VM \u5206\u89e3\u516c\u5f0f\u7684\u542f\u53d1\uff0c\u7387\u5148\u63d0\u51fa\u5c063D\u7a7a\u95f4\u5f20\u91cf\u5206\u89e3\u6210\u591a\u4e2a\u79e91\u5f20\u91cf\uff0c\u5efa\u7acb\u4e86\u4e00\u4e2a\u663e\u5f0f\u7684\u6a21\u578b\u6765\u8868\u5f813D\u7a7a\u95f4\uff0c\u5c06\u6bcf\u4e2a\u79e91\u5f20\u91cf\u4f5c\u4e3a\u5f85\u4f18\u5316\u7684\u53d8\u91cf\uff0c\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u8fdb\u884c\u4f18\u5316\uff0c\u63d0\u9ad8\u4e86\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6\u4e0e\u63a8\u7406\u901f\u5ea6 HexPlane \u63d0\u51fa\u4e86\u4e00\u4e2a 4D \u7a7a\u95f4\u5f20\u91cf\u8f90\u5c04\u573a\uff0c\u7b80\u5355\u7406\u89e3\u5c31\u662f\u628a\u4e00\u4e2a \\((x,y,z,t)\\) \u56db\u7ef4\u5f20\u91cf\u770b\u4f5c \\((xy, zt, yz, xt, zx, yt\\) ) \u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\uff0c\u91c7\u7528\u7c7b\u4f3c\u5f20\u91cf VM \u5206\u89e3\u7684\u65b9\u5f0f\u6765\u7ec4\u5408 K-Planes \u4e5f\u662f\u76f8\u540c\u7684\u601d\u60f3\uff0c\u5dee\u522b\u5728\u4e8e\u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\u5f62\u5f0f\uff0c\u91c7\u7528\u7c7b\u4f3c Hadamard \u79ef\u6765\u7ec4\u5408 HexPlane \u548c K-Planes \u5229\u7528 4D \u7a7a\u95f4\u5f20\u91cf\u573a\u5bf9\u7a7a\u95f4\u4fe1\u606f\u8fdb\u884c\u7f16\u7801\uff0c\u968f\u540e\u5229\u7528\u591a\u5934\u89e3\u7801\u5668\u89e3\u7801\u51fa\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u7136\u540e\u7528 NeRF \u7684\u4f53\u79ef\u5c04\u7ebf\u6cd5\u6e32\u67d3\u56fe\u50cf \u4e0e HexPlane \u548c K-Planes \u4e0d\u540c\u7684\u662f\uff0c4DGS \u63a5\u4e0b\u6765\u901a\u8fc7\u4e00\u4e2a\u7531\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u5c06\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u4fe1\u606f\u5206\u522b\u89e3\u7801\u6210 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u800c\u4e0d\u662f\u89e3\u7801\u6210\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u8f6c\u800c\u7528 3DGS \u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406 \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u7a7a\u95f4\u76f8\u90bb\u7684\u9ad8\u65af\u5728\u8fd0\u52a8\u548c\u5f62\u53d8\u4e0a\u5177\u6709\u76f8\u4f3c\u7684\u7279\u5f81\uff0c\u540c\u4e00\u4e2a\u9ad8\u65af\u5728\u76f8\u90bb\u65f6\u95f4\u4e5f\u4f1a\u5448\u73b0\u76f8\u4f3c\u7684\u53d8\u5316\u7279\u5f81\uff0c\u5e76\u4e14\u76f8\u9694\u8f83\u8fdc\u7684\u9ad8\u65af\u4e4b\u95f4\u4e5f\u4f1a\u5177\u6709\u4e00\u5b9a\u7684\u5173\u8054\u3002 \u56e0\u6b64 4DGS \u91c7\u7528 \u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u4f53\u7d20\u7f51\u683c\u6a21\u5757 \u5bf9\u5355\u5143\u4f53\u7d20\u4e2d\u7684\u6bcf\u4e2a\u9ad8\u65af\u7684\u7a7a\u95f4\u548c\u65f6\u95f4\u8fdb\u884c\u7f16\u7801 \\(\\mathcal{H}\\) \u5305\u62ec\u516d\u4e2a\u591a\u5206\u8fa8\u7387\u5e73\u9762\u6a21\u5757 \\(R_l(i,j)\\) \u548c\u4e00\u4e2a\u5c0f\u578b MLP \\(\\phi_d\\) \\(\\{R_l(i,j), \\phi_d | (i,j) \\in \\{ (x,y),(x,z),(y,z),(x,t),(y,t),(z,t)\\}, l \\in \\{1, 2 \\} \\}\\) \uff0c \\(\\mu = (x,y,z)\\) \u662f 3D \u9ad8\u65af\u7684\u5e73\u5747\u503c \u8ba1\u7b97\u4f53\u7d20\u7279\u5f81\uff1a \\[ f_h=\\bigcup_l\\prod\\text{interp}(R_l(i,j)) \\] \\(f_h\\) \u662f\u795e\u7ecf\u4f53\u7d20\u7279\u5f81\uff0c\u5229\u7528\u53cc\u7ebf\u6027\u63d2\u503c\u5bf9\u9644\u8fd1\u7684\u56db\u4e2a\u67e5\u8be2\u4f53\u7d20\u7279\u5f81\u8fdb\u884c\u63d2\u503c \u968f\u540e\u7528 MLP \u5c06\u6240\u6709\u539f\u59cb\u7279\u5f81\u8fdb\u884c\u89e3\u7801 \\(f_d = \\phi_d(f_h)\\) Multi-Head Gaussian Deformation Decoder \u00b6 \u8bbe\u8ba1\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D} = \\{ \\phi_x, \\phi_r, \\phi_s \\}\\) \u7528 MLP \u5206\u522b\u9884\u6d4b\u53d8\u5f62\u91cf \u9ad8\u65af\u7403\u4f4d\u79fb\u53d8\u5316\u91cf \\(\\Delta \\mathcal{X} = \\phi_x(f_d)\\) \u9ad8\u65af\u7403\u65cb\u8f6c\u56db\u5143\u6570\u53d8\u5316\u91cf \\(\\Delta r = \\phi_r(f_d)\\) \u9ad8\u65af\u7403\u7f29\u653e\u56e0\u5b50\u53d8\u5316\u91cf \\(\\Delta s = \\phi_s(f_d)\\) \u53d8\u5f62\u540e\u7684\u7279\u5f81\u8868\u793a\u4e3a \\((\\mathcal{X}^\\prime, r^\\prime, s^\\prime) = (\\mathcal{X} + \\Delta \\mathcal{X}, r + \\Delta r, s + \\Delta s)\\) \u6700\u540e\u83b7\u5f97\u51fa\u9ad8\u65af\u7403\u52a8\u6001\u53d8\u5316\u540e\u7684\u65b0\u5f62\u72b6\u65b0\u4f4d\u7f6e \\(\\mathcal{G}^\\prime = \\{ \\mathcal{X}^\\prime, s^\\prime, r^\\prime, \\sigma, \\mathcal{C} \\}\\) Optimization \u00b6 3D Gaussian Initialization \u00b6 \u91c7\u53d6\u4e86\u4e24\u9636\u6bb5\u8bad\u7ec3\u7b56\u7565\uff1a\u9759\u6001\u573a\u666f\u521d\u59cb\u5316\u548c\u53d8\u5f62\u573a\u5fae\u8c03\uff1b \u521d\u59cb\u5316\u9636\u6bb5\uff1a\u4e3b\u8981\u4f18\u5316\u9759\u6001\u573a\u666f\u7684\u8868\u793a\uff0c\u5373\u53ea\u4f18\u5316 3D Gaussians \u7684\u53c2\u6570\uff1b \u5fae\u8c03\u9636\u6bb5\uff1a\u4e3b\u8981\u5b66\u4e60\u53d8\u5f62\u573a\u7684\u8868\u793a\uff0c\u5373\u4f18\u5316\u591a\u5206\u8fa8\u7387\u795e\u7ecf\u4f53\u7d20\u548c MLP\uff1b Loss Function \u00b6 \u4f7f\u7528 \\(L_1\\) \u989c\u8272\u635f\u5931\u548c\u57fa\u4e8e\u7f51\u683c\u7684 TV \u635f\u5931 \\(\\mathcal{L}_{tv}\\) \u76d1\u7763\u8bad\u7ec3 \\[ \\mathcal{L} = \\left | \\hat{I} - I \\right | + \\mathcal{L}_{tv} \\] Experiments \u00b6 Reference \u00b6 https://blog.csdn.net/m0_51976564/article/details/134595401 https://zhuanlan.zhihu.com/p/663337795 https://blog.csdn.net/weixin_71780622/article/details/136063893 https://blog.csdn.net/m0_55605361/article/details/141122450","title":"4DGS"},{"location":"cv/papers/3dgs/4dgs/#4dgaussians","text":"\u7ea6 1368 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a 4D Gaussian Splatting for Real-Time Dynamic Scene Rendering code\uff1a 4DGaussians","title":"4DGaussians"},{"location":"cv/papers/3dgs/4dgs/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/4dgs/#introduction","text":"3DGS \u53ea\u80fd\u5728\u9759\u6001\u573a\u666f\u91cd\u5efa\uff0c\u5982\u679c\u53d1\u751f\u8fd0\u52a8\uff0c\u5219\u9700\u8981\u8003\u8651\u65f6\u95f4\u7ef4\u5ea6\u7684\u4fe1\u606f\uff0c\u628a 3DGS \u7684\u601d\u60f3\u653e\u5230\u5bf9\u52a8\u6001\u7a7a\u95f4\u7684\u5efa\u6a21\u4e0a \u6700\u7b80\u5355\u7684\u60f3\u6cd5\u5c31\u662f\u5728\u6bcf\u4e00\u4e2a\u65f6\u95f4\u70b9\u4e0a\u5355\u72ec\u5efa\u7acb\u4e00\u4e2a 3DGS \u6a21\u578b\uff0c\u5c06\u4e00\u6bb5\u65f6\u95f4\u4e0a\u6240\u6709\u7684 3DGS \u6a21\u578b\u7ec4\u5408\u8d77\u6765\u5c31\u662f\u4e00\u4e2a 4DGS \u6a21\u578b\uff0c\u4f46\u8fd9\u6837\u4f1a\u4ee3\u7801\u5b58\u50a8\u7a7a\u95f4\u7206\u70b8\u7684\u95ee\u9898 4DGS \u7684\u521b\u65b0\u70b9\u5728\u4e8e\uff0c\u5728 3DGS \u7684\u57fa\u7840\u4e0a\uff0c\u5f15\u5165 \u53d8\u5f62\u573a(deformation field) \u6765\u8868\u793a Gaussians \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff0c\u5305\u62ec\u4e00\u4e2a\u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u548c\u4e00\u4e2a\u8f7b\u91cf\u7ea7 MLP\uff0c\u7b80\u5355\u5730\u8bf4\uff0c\u5c06\u52a8\u6001\u573a\u666f\u770b\u4f5c\u662f\u4e00\u4e2a\u9759\u6001\u573a\u666f\u5728\u65f6\u95f4\u7ef4\u5ea6\u4e0a\u7684\u53d8\u5f62 \u5728\u6bcf\u4e2a\u65f6\u95f4\u6233\uff0c\u53d8\u5f62\u573a\u4f1a\u5c06 Gaussians \u8f6c\u6362\u5230\u4e00\u4e2a\u5177\u4f53\u65b0\u5f62\u72b6\u7684\u65b0\u4f4d\u7f6e\uff0c\u8be5\u53d8\u6362\u76f8\u5f53\u4e8e Gaussian \u7684\u8fd0\u52a8\u548c\u5f62\u53d8\uff08\u4ece\u59cb\u81f3\u7ec8\u53ea\u7ef4\u62a4\u4e00\u7ec4 3DGS \u6a21\u578b\uff0c\u5373\u53ea\u6709\u4e00\u7ec4 3D \u9ad8\u65af\u7403\uff0c\u53ea\u662f\u5728\u4e0d\u540c\u7684\u65f6\u95f4\u8282\u70b9\uff0c\u9ad8\u65af\u7403\u4f1a\u505a\u51fa\u76f8\u5e94\u7684\u53d8\u6362\uff09 4DGS \u6a21\u578b\u4e2d\uff0c\u5c06\u4e00\u4e2a\u70b9\u7684 \\((x,y,z,t)\\) \u5750\u6807\u5148\u4ee3\u5165\u4e00\u4e2a\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668\uff0c\u968f\u540e\u8f93\u51fa\u5e26\u5165\u4e00\u4e2a\u591a\u5934\u7684\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u8fdb\u884c\u89e3\u7801\uff0c\u5f97\u5230 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u4e0e\u539f\u503c\u76f8\u52a0\u540e\uff0c\u6309\u7167 3DGS \u7684\u65b9\u6cd5\u5f97\u5230\u4e0d\u900f\u660e\u5ea6\u548c SH \u7cfb\u6570\u8fdb\u884c\u6e32\u67d3","title":"Introduction"},{"location":"cv/papers/3dgs/4dgs/#4d-gaussian-splatting-framework","text":"\u53c2\u6570\u8bf4\u660e \u65cb\u8f6c\u77e9\u9635 \\(M = [R, T]\\) \u65f6\u95f4\u6233 \\(t\\) 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u9ad8\u65af\u53d8\u5f62\u573a\u7f51\u7edc \\(\\mathcal{F}\\) \u6cfc\u6e85\u65b9\u6cd5 \\(\\mathcal{S}\\) 3D \u9ad8\u65af\u53d8\u5f62\u573a\u53d8\u5316\u91cf \\(\\Delta \\mathcal{G} = \\mathcal{F}(\\mathcal{G}, t)\\) \u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u5668 \\(\\mathcal{H}\\) \uff0c\u5c06 3D \u9ad8\u65af\u7f16\u7801 \\(f_d = \\mathcal{H} = (\\mathcal{G}, t)\\) \u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D}\\) \uff0c\u5c06 \\(\\Delta \\mathcal{G}\\) \u89e3\u7801 \\(\\Delta \\mathcal{G} = \\mathcal{D}(f)\\) \u4ece\u539f\u59cb 3D \u9ad8\u65af \\(\\mathcal{G}\\) \u8f6c\u6362\u5230\u4e00\u4e2a\u65f6\u95f4\u6233\u7684\u65b0\u7684 \\(\\mathcal{G}^\\prime = \\Delta \\mathcal{G} + \\mathcal{G}\\) \u65b0\u89c6\u89d2\u56fe\u50cf \\(\\hat{I} = \\mathcal{S}(M, \\mathcal{G}^\\prime)\\)","title":"4D Gaussian Splatting Framework"},{"location":"cv/papers/3dgs/4dgs/#gaussian-deformation-field-network","text":"","title":"Gaussian Deformation Field Network"},{"location":"cv/papers/3dgs/4dgs/#spatial-temporal-structure-encoder","text":"\u7075\u611f\u6765\u6e90 \u53c2\u8003 CVPR 2023 HexPlane \u548c K-Planes \u4e2d\u6709\u5173\u65f6\u7a7a\u7ed3\u6784\u5f20\u91cf\u5206\u89e3\u7684\u601d\u60f3\uff0c\u6700\u5f00\u59cb\u662f\u5728 3D NeRF \u4e2d \u8bba\u6587 TensoRF \u51fa\u73b0\uff0c\u6536\u5230\u5f20\u91cf CP/VM \u5206\u89e3\u516c\u5f0f\u7684\u542f\u53d1\uff0c\u7387\u5148\u63d0\u51fa\u5c063D\u7a7a\u95f4\u5f20\u91cf\u5206\u89e3\u6210\u591a\u4e2a\u79e91\u5f20\u91cf\uff0c\u5efa\u7acb\u4e86\u4e00\u4e2a\u663e\u5f0f\u7684\u6a21\u578b\u6765\u8868\u5f813D\u7a7a\u95f4\uff0c\u5c06\u6bcf\u4e2a\u79e91\u5f20\u91cf\u4f5c\u4e3a\u5f85\u4f18\u5316\u7684\u53d8\u91cf\uff0c\u901a\u8fc7\u53cd\u5411\u4f20\u64ad\u8fdb\u884c\u4f18\u5316\uff0c\u63d0\u9ad8\u4e86\u6a21\u578b\u8bad\u7ec3\u901f\u5ea6\u4e0e\u63a8\u7406\u901f\u5ea6 HexPlane \u63d0\u51fa\u4e86\u4e00\u4e2a 4D \u7a7a\u95f4\u5f20\u91cf\u8f90\u5c04\u573a\uff0c\u7b80\u5355\u7406\u89e3\u5c31\u662f\u628a\u4e00\u4e2a \\((x,y,z,t)\\) \u56db\u7ef4\u5f20\u91cf\u770b\u4f5c \\((xy, zt, yz, xt, zx, yt\\) ) \u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\uff0c\u91c7\u7528\u7c7b\u4f3c\u5f20\u91cf VM \u5206\u89e3\u7684\u65b9\u5f0f\u6765\u7ec4\u5408 K-Planes \u4e5f\u662f\u76f8\u540c\u7684\u601d\u60f3\uff0c\u5dee\u522b\u5728\u4e8e\u8fd9\u516d\u4e2a\u4e8c\u7ef4\u5f20\u91cf\u7684\u7ec4\u5408\u5f62\u5f0f\uff0c\u91c7\u7528\u7c7b\u4f3c Hadamard \u79ef\u6765\u7ec4\u5408 HexPlane \u548c K-Planes \u5229\u7528 4D \u7a7a\u95f4\u5f20\u91cf\u573a\u5bf9\u7a7a\u95f4\u4fe1\u606f\u8fdb\u884c\u7f16\u7801\uff0c\u968f\u540e\u5229\u7528\u591a\u5934\u89e3\u7801\u5668\u89e3\u7801\u51fa\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u7136\u540e\u7528 NeRF \u7684\u4f53\u79ef\u5c04\u7ebf\u6cd5\u6e32\u67d3\u56fe\u50cf \u4e0e HexPlane \u548c K-Planes \u4e0d\u540c\u7684\u662f\uff0c4DGS \u63a5\u4e0b\u6765\u901a\u8fc7\u4e00\u4e2a\u7531\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668\u5c06\u65f6\u7a7a\u7ed3\u6784\u7f16\u7801\u4fe1\u606f\u5206\u522b\u89e3\u7801\u6210 \\((x,y,z,r,s)\\) \u7684\u53d8\u5f62\u503c\uff0c\u800c\u4e0d\u662f\u89e3\u7801\u6210\u4e0d\u900f\u660e\u5ea6\u548c\u989c\u8272\uff0c\u8f6c\u800c\u7528 3DGS \u7684\u65b9\u6cd5\u8fdb\u884c\u5904\u7406 \u5982\u4e0a\u56fe\u6240\u793a\uff0c\u7a7a\u95f4\u76f8\u90bb\u7684\u9ad8\u65af\u5728\u8fd0\u52a8\u548c\u5f62\u53d8\u4e0a\u5177\u6709\u76f8\u4f3c\u7684\u7279\u5f81\uff0c\u540c\u4e00\u4e2a\u9ad8\u65af\u5728\u76f8\u90bb\u65f6\u95f4\u4e5f\u4f1a\u5448\u73b0\u76f8\u4f3c\u7684\u53d8\u5316\u7279\u5f81\uff0c\u5e76\u4e14\u76f8\u9694\u8f83\u8fdc\u7684\u9ad8\u65af\u4e4b\u95f4\u4e5f\u4f1a\u5177\u6709\u4e00\u5b9a\u7684\u5173\u8054\u3002 \u56e0\u6b64 4DGS \u91c7\u7528 \u591a\u5206\u8fa8\u7387\u7279\u5f81\u5e73\u9762\u4f53\u7d20\u7f51\u683c\u6a21\u5757 \u5bf9\u5355\u5143\u4f53\u7d20\u4e2d\u7684\u6bcf\u4e2a\u9ad8\u65af\u7684\u7a7a\u95f4\u548c\u65f6\u95f4\u8fdb\u884c\u7f16\u7801 \\(\\mathcal{H}\\) \u5305\u62ec\u516d\u4e2a\u591a\u5206\u8fa8\u7387\u5e73\u9762\u6a21\u5757 \\(R_l(i,j)\\) \u548c\u4e00\u4e2a\u5c0f\u578b MLP \\(\\phi_d\\) \\(\\{R_l(i,j), \\phi_d | (i,j) \\in \\{ (x,y),(x,z),(y,z),(x,t),(y,t),(z,t)\\}, l \\in \\{1, 2 \\} \\}\\) \uff0c \\(\\mu = (x,y,z)\\) \u662f 3D \u9ad8\u65af\u7684\u5e73\u5747\u503c \u8ba1\u7b97\u4f53\u7d20\u7279\u5f81\uff1a \\[ f_h=\\bigcup_l\\prod\\text{interp}(R_l(i,j)) \\] \\(f_h\\) \u662f\u795e\u7ecf\u4f53\u7d20\u7279\u5f81\uff0c\u5229\u7528\u53cc\u7ebf\u6027\u63d2\u503c\u5bf9\u9644\u8fd1\u7684\u56db\u4e2a\u67e5\u8be2\u4f53\u7d20\u7279\u5f81\u8fdb\u884c\u63d2\u503c \u968f\u540e\u7528 MLP \u5c06\u6240\u6709\u539f\u59cb\u7279\u5f81\u8fdb\u884c\u89e3\u7801 \\(f_d = \\phi_d(f_h)\\)","title":"Spatial-Temporal Structure Encoder"},{"location":"cv/papers/3dgs/4dgs/#multi-head-gaussian-deformation-decoder","text":"\u8bbe\u8ba1\u591a\u5934\u9ad8\u65af\u53d8\u5f62\u89e3\u7801\u5668 \\(\\mathcal{D} = \\{ \\phi_x, \\phi_r, \\phi_s \\}\\) \u7528 MLP \u5206\u522b\u9884\u6d4b\u53d8\u5f62\u91cf \u9ad8\u65af\u7403\u4f4d\u79fb\u53d8\u5316\u91cf \\(\\Delta \\mathcal{X} = \\phi_x(f_d)\\) \u9ad8\u65af\u7403\u65cb\u8f6c\u56db\u5143\u6570\u53d8\u5316\u91cf \\(\\Delta r = \\phi_r(f_d)\\) \u9ad8\u65af\u7403\u7f29\u653e\u56e0\u5b50\u53d8\u5316\u91cf \\(\\Delta s = \\phi_s(f_d)\\) \u53d8\u5f62\u540e\u7684\u7279\u5f81\u8868\u793a\u4e3a \\((\\mathcal{X}^\\prime, r^\\prime, s^\\prime) = (\\mathcal{X} + \\Delta \\mathcal{X}, r + \\Delta r, s + \\Delta s)\\) \u6700\u540e\u83b7\u5f97\u51fa\u9ad8\u65af\u7403\u52a8\u6001\u53d8\u5316\u540e\u7684\u65b0\u5f62\u72b6\u65b0\u4f4d\u7f6e \\(\\mathcal{G}^\\prime = \\{ \\mathcal{X}^\\prime, s^\\prime, r^\\prime, \\sigma, \\mathcal{C} \\}\\)","title":"Multi-Head Gaussian Deformation Decoder"},{"location":"cv/papers/3dgs/4dgs/#optimization","text":"","title":"Optimization"},{"location":"cv/papers/3dgs/4dgs/#3d-gaussian-initialization","text":"\u91c7\u53d6\u4e86\u4e24\u9636\u6bb5\u8bad\u7ec3\u7b56\u7565\uff1a\u9759\u6001\u573a\u666f\u521d\u59cb\u5316\u548c\u53d8\u5f62\u573a\u5fae\u8c03\uff1b \u521d\u59cb\u5316\u9636\u6bb5\uff1a\u4e3b\u8981\u4f18\u5316\u9759\u6001\u573a\u666f\u7684\u8868\u793a\uff0c\u5373\u53ea\u4f18\u5316 3D Gaussians \u7684\u53c2\u6570\uff1b \u5fae\u8c03\u9636\u6bb5\uff1a\u4e3b\u8981\u5b66\u4e60\u53d8\u5f62\u573a\u7684\u8868\u793a\uff0c\u5373\u4f18\u5316\u591a\u5206\u8fa8\u7387\u795e\u7ecf\u4f53\u7d20\u548c MLP\uff1b","title":"3D Gaussian Initialization"},{"location":"cv/papers/3dgs/4dgs/#loss-function","text":"\u4f7f\u7528 \\(L_1\\) \u989c\u8272\u635f\u5931\u548c\u57fa\u4e8e\u7f51\u683c\u7684 TV \u635f\u5931 \\(\\mathcal{L}_{tv}\\) \u76d1\u7763\u8bad\u7ec3 \\[ \\mathcal{L} = \\left | \\hat{I} - I \\right | + \\mathcal{L}_{tv} \\]","title":"Loss Function"},{"location":"cv/papers/3dgs/4dgs/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/3dgs/4dgs/#reference","text":"https://blog.csdn.net/m0_51976564/article/details/134595401 https://zhuanlan.zhihu.com/p/663337795 https://blog.csdn.net/weixin_71780622/article/details/136063893 https://blog.csdn.net/m0_55605361/article/details/141122450","title":"Reference"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/","text":"Gaussian Splatting SLAM \u00b6 \u7ea6 926 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a Gaussian Splatting SLAM code\uff1a MonoGS video: MonoGS Idea \u00b6 Introduction \u00b6 \u7b2c\u4e00\u4e2a\u8fd1\u5b9e\u65f6 SLAM \u7cfb\u7edf\uff0c\u4ee5 3DGS \u4f5c\u4e3a\u552f\u4e00\u7684\u5e95\u5c42\u573a\u666f\u8868\u793a\uff0c\u53ef\u4ee5\u5904\u7406\u5355\u76ee\u8f93\u5165\u3002 SLAM \u6846\u67b6\u5185\u7684\u65b0\u6280\u672f\uff0c\u5305\u62ec\u7528\u4e8e\u76f4\u63a5\u76f8\u673a\u59ff\u6001\u4f30\u8ba1\u7684\u674e\u7fa4\u4e0a\u7684\u89e3\u6790\u96c5\u53ef\u6bd4\u77e9\u9635\u3001\u9ad8\u65af\u5f62\u72b6\u7684\u5404\u5411\u540c\u6027\u6b63\u5219\u5316\u548c\u51e0\u4f55\u9a8c\u8bc1 \u5173\u952e\u5e27\u9009\u53d6\u7b56\u7565\u3001Gaussian \u7684\u589e\u52a0\u548c\u5220\u9664\u7b56\u7565 Gaussian Representation \u7528\u4e00\u7ec4\u5404\u5411\u5f02\u6027\u7684\u9ad8\u65af \\(\\mathcal{G}\\) \u6620\u5c04\u573a\u666f \u6bcf\u4e2a\u9ad8\u65af\u503c\u53ea\u6709 8 \u4e2a\u53c2\u6570\uff08RGB 3 \u4e2a\u3001\u4e2d\u5fc3\u4f4d\u7f6e 3 \u4e2a\u3001\u534a\u5f84 1 \u4e2a\u3001\u4e0d\u900f\u660e\u5ea6 1 \u4e2a\uff09 Tracking \u00b6 \u4f30\u8ba1\u76f8\u673a\u5916\u53c2,\u6700\u5c0f\u5316\u4ee5\u4e0b\u76ee\u6807\u51fd\u6570 \\[ \\begin{aligned} E_{pho}=\\left\\|I(\\mathcal{G},\\boldsymbol{T}_{CW})-\\bar{I}\\right\\|_{1}\\\\ E_{geo}=\\left\\|D(\\mathcal{G},\\boldsymbol{T}_{CW})-\\bar{D}\\right\\|_{1} \\\\ \\min \\lambda_{pho} E_{pho} + (1 - \\lambda_{pho})E_{geo} \\end{aligned} \\] parameters \\(\\lambda_{pho}\\) \u6743\u91cd\u8d85\u53c2\u6570 \\(I(\\mathcal{G},\\boldsymbol{T}_{CW})\\) \u8868\u793a\u4ece\u5916\u53c2\u4e3a \\(\\boldsymbol{T}_{CW}\\) \u7684\u76f8\u673a\u6e32\u67d3\u9ad8\u65af\u96c6\u5408 \\(\\mathcal{G}\\) \u6240\u5f97\u7684\u56fe\u7247 \\(\\bar{I}\\) \u771f\u5b9e\u56fe\u7247 \\(E_{pho}\\) \u56fe\u7247\u8bef\u5dee \\(E_{geo}\\) \u6df1\u5ea6\u8bef\u5dee,\u4ec5\u5728\u6df1\u5ea6\u4fe1\u606f\u53ef\u7528\u65f6\u5f15\u5165 \\(D(\\mathcal{G},\\boldsymbol{T}_{CW})\\) \u6e32\u67d3\u51fa\u6765\u7684\u6df1\u5ea6\uff08\u6e32\u67d3\u65b9\u5f0f\u548c RGB \u503c\u7c7b\u4f3c,\u5747\u4e3a\u6309\u4e0d\u900f\u660e\u5ea6\u548c\u900f\u5149\u7387\u52a0\u6743\u5e73\u5747\uff09 \\(\\bar{D}\\) \u6df1\u5ea6\u6570\u636e Keyframing \u00b6 \u9009\u53d6\u5173\u952e\u5e27\u7a97\u53e3 \\(\\mathcal{W}_k\\) ,\u4e24\u5e27\u4e4b\u95f4\u5171\u540c\u53ef\u89c1 Gaussian \u7684\u6bd4\u4f8b \u5224\u65ad Gaussian \u662f\u5426\u53ef\u89c1\u7684\u65b9\u6cd5\u5c31\u662f\u5224\u65ad\u5230\u8be5 Gaussian \u7684\u900f\u5149\u7387\u662f\u5426\u8fbe\u5230 0.5 \u5b9a\u4e49\u5171\u540c\u53ef\u89c1\u5ea6\uff08covisibility\uff09\u4e3a\u5f53\u524d\u5e27 \\(i\\) \u4e0e\u4e0a\u4e00\u5173\u952e\u5e27 \\(j\\) \u4e4b\u95f4\u53ef\u89c1 Gaussian \u96c6\u5408\u7684 IoU \u82e5 covisibility \u4f4e\u4e8e\u67d0\u4e2a\u9608\u503c\uff0c\u6216\u76f8\u5bf9\u5e73\u79fb \\(t_{ij}\\) \u76f8\u5bf9\u4e8e\u6df1\u5ea6\u4e2d\u4f4d\u6570\u8f83\u5927\uff0c\u5219\u5e27 \\(i\\) \u88ab\u89c6\u4e3a\u5173\u952e\u5e27 \u540c\u65f6\u5728\u5f53\u524d\u5e27 \\(i\\) \u88ab\u52a0\u5165\u5230\u5173\u952e\u5e27\u7a97\u53e3\u65f6\uff0c\u4e5f\u8981\u79fb\u9664 \\(\\mathcal{W}_k\\) \u4e2d\u8001\u65e7\u7684\u5173\u952e\u5e27 \u5f53\u5e27 \\(j \\in \\mathcal{W}_k\\) \u4e0e\u5f53\u524d\u5e27 \\(i\\) \u53ef\u89c1 Gaussians \u7684\u91cd\u53e0\u7cfb\u6570 OC \u5c0f\u4e8e\u67d0\u4e2a\u9608\u503c\u65f6\uff0c\u79fb\u9664\u3002 \\[ OC_{cov}(i,j)=\\frac{|\\mathcal{G}_i^v\\cap\\mathcal{G}_j^v|}{\\min(|\\mathcal{G}_i^v|,|\\mathcal{G}_j^v|)} \\] Gaussian Insertion and Pruning \u00b6 \u6bcf\u4e2a\u5173\u952e\u5e27\u90fd\u4f1a\u6dfb\u52a0\u65b0\u7684 Gaussians\uff0c\u7528\u5173\u952e\u5e27\u7684\u6bcf\u4e2a\u50cf\u7d20\u70b9\u7684\u6df1\u5ea6 D\uff08\u5728\u5355\u76ee\u76f8\u673a\u7684\u60c5\u51b5\u4e0b\u4f1a\u6e32\u67d3\u6df1\u5ea6\u6765\u4f30\u8ba1 D \u7684\u503c\uff09\u4f5c\u4e3a\u65b0\u589e Gaussians \u7684\u53c2\u8003\u4f4d\u7f6e \u7531\u4e8e D \u4e0d\u4e00\u5b9a\u51c6\u786e\uff0c\u65b0\u7684 Gaussians \u7684\u6df1\u5ea6\u670d\u4ece\u4e00\u4e2a\u5747\u503c\u4e3a D\u3001\u65b9\u5dee\u8f83\u5c0f\u7684\u6b63\u592a\u5206\u5e03 \u5bf9\u4e8e\u6ca1\u6709\u6df1\u5ea6\u4f30\u8ba1\u7684\u50cf\u7d20\uff0c\u65b0 Gaussians \u7684\u6df1\u5ea6\u670d\u4ece\u5747\u503c\u4e3a\u6e32\u67d3\u56fe\u50cf\u6df1\u5ea6\u4e2d\u4f4d\u6570\u3001\u65b9\u5dee\u8f83\u5927\u7684\u6b63\u592a\u5206\u5e03 \u4e00\u5f00\u59cb\u6ca1\u6709 Gaussian \u65f6\uff0c\u65b0\u589e Gaussian \u7684\u4f4d\u7f6e\u662f\u968f\u673a\u7684 \u5f53\u5173\u952e\u5e27\u7a97\u53e3 \\(\\mathcal{W}_k\\) \u5df2\u6ee1\uff0c\u6267\u884c\u526a\u679d\u64cd\u4f5c\uff0c\u5982\u679c\u6700\u8fd1\u4e09\u4e2a\u5173\u952e\u5e27\u90a3\u65b0\u589e\u7684 Gaussians \u6ca1\u6709\u5728\u5176\u4ed6\u81f3\u5c11\u4e09\u5e27\u5185\u89c2\u5bdf\u5230\uff0c\u79fb\u9664\u3002\u4e0d\u900f\u660e\u5ea6\u5c0f\u4e8e 0.7 \u7684 Gaussians \u4e5f\u4f1a\u88ab\u79fb\u9664\u3002 Mapping \u00b6 \u7ef4\u62a4\u4e00\u4e2a\u534f\u8c03\u7684 3D \u7ed3\u6784\u5e76\u4f18\u5316\u65b0\u63d2\u5165\u7684 Gaussians \u53c2\u4e0e\u4f18\u5316\u7684\u5e27\u96c6\u5408\u4e3a \\(\\mathcal{W}=\\mathcal{W}_k \\cup \\mathcal{W}_r\\) \uff0c\u5176\u4e2d \\(\\mathcal{W}_r\\) \u662f\u968f\u673a\u9009\u53d6\u7684\u4e24\u4e2a\u65e7\u5e27 3D \u9ad8\u65af\u6e32\u67d3\u8fc7\u7a0b\u4e2d\u6ca1\u6709\u5bf9\u6cbf\u5149\u7ebf\u65b9\u5411\u7684 Gaussian \u8fdb\u884c\u7ea6\u675f\uff0c\u4f1a\u5bfc\u81f4 SLAM \u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4f2a\u5f71\uff0c\u56e0\u6b64\u5f15\u5165\u5404\u5411\u540c\u6027\u7ea6\u675f \\[ E_{iso}=\\sum_{i=1}^{|\\mathcal{G}|}\\left\\|\\mathbf{s}_i-\\tilde{\\mathbf{s}_i}\\cdot\\mathbf{1}\\right\\|_1 \\] \u5bf9\u4e8e\u5efa\u56fe\u90e8\u5206\uff0c\u6700\u5c0f\u5316\u4ee5\u4e0b\u76ee\u6807\u51fd\u6570 \\[ \\min_{\\boldsymbol{T}_{CW_{\\forall k\\in\\mathcal{W}}}^k\\in\\mathbf{SE}{(3),\\mathcal{G}}}\\sum_{\\forall k\\in\\mathcal{W}}E_{pho}^k+\\lambda_{iso}E_{iso} \\] Experiments \u00b6 Reference \u00b6 \u3010\u8ba1\u7b97\u673a\u89c6\u89c9\u3011\u56db\u7bc7\u57fa\u4e8eGaussian Splatting\u7684SLAM\u8bba\u6587\u5bf9\u6bd4_gaussian splatting slam-CSDN\u535a\u5ba2 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143DGS-SLAM\u7cfb\u5217\u4ee3\u7801\u89e3\u8bfb_gs slam-CSDN\u535a\u5ba2","title":"Gaussian Splatting SLAM"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#gaussian-splatting-slam","text":"\u7ea6 926 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a Gaussian Splatting SLAM code\uff1a MonoGS video: MonoGS","title":"Gaussian Splatting SLAM"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#introduction","text":"\u7b2c\u4e00\u4e2a\u8fd1\u5b9e\u65f6 SLAM \u7cfb\u7edf\uff0c\u4ee5 3DGS \u4f5c\u4e3a\u552f\u4e00\u7684\u5e95\u5c42\u573a\u666f\u8868\u793a\uff0c\u53ef\u4ee5\u5904\u7406\u5355\u76ee\u8f93\u5165\u3002 SLAM \u6846\u67b6\u5185\u7684\u65b0\u6280\u672f\uff0c\u5305\u62ec\u7528\u4e8e\u76f4\u63a5\u76f8\u673a\u59ff\u6001\u4f30\u8ba1\u7684\u674e\u7fa4\u4e0a\u7684\u89e3\u6790\u96c5\u53ef\u6bd4\u77e9\u9635\u3001\u9ad8\u65af\u5f62\u72b6\u7684\u5404\u5411\u540c\u6027\u6b63\u5219\u5316\u548c\u51e0\u4f55\u9a8c\u8bc1 \u5173\u952e\u5e27\u9009\u53d6\u7b56\u7565\u3001Gaussian \u7684\u589e\u52a0\u548c\u5220\u9664\u7b56\u7565 Gaussian Representation \u7528\u4e00\u7ec4\u5404\u5411\u5f02\u6027\u7684\u9ad8\u65af \\(\\mathcal{G}\\) \u6620\u5c04\u573a\u666f \u6bcf\u4e2a\u9ad8\u65af\u503c\u53ea\u6709 8 \u4e2a\u53c2\u6570\uff08RGB 3 \u4e2a\u3001\u4e2d\u5fc3\u4f4d\u7f6e 3 \u4e2a\u3001\u534a\u5f84 1 \u4e2a\u3001\u4e0d\u900f\u660e\u5ea6 1 \u4e2a\uff09","title":"Introduction"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#tracking","text":"\u4f30\u8ba1\u76f8\u673a\u5916\u53c2,\u6700\u5c0f\u5316\u4ee5\u4e0b\u76ee\u6807\u51fd\u6570 \\[ \\begin{aligned} E_{pho}=\\left\\|I(\\mathcal{G},\\boldsymbol{T}_{CW})-\\bar{I}\\right\\|_{1}\\\\ E_{geo}=\\left\\|D(\\mathcal{G},\\boldsymbol{T}_{CW})-\\bar{D}\\right\\|_{1} \\\\ \\min \\lambda_{pho} E_{pho} + (1 - \\lambda_{pho})E_{geo} \\end{aligned} \\] parameters \\(\\lambda_{pho}\\) \u6743\u91cd\u8d85\u53c2\u6570 \\(I(\\mathcal{G},\\boldsymbol{T}_{CW})\\) \u8868\u793a\u4ece\u5916\u53c2\u4e3a \\(\\boldsymbol{T}_{CW}\\) \u7684\u76f8\u673a\u6e32\u67d3\u9ad8\u65af\u96c6\u5408 \\(\\mathcal{G}\\) \u6240\u5f97\u7684\u56fe\u7247 \\(\\bar{I}\\) \u771f\u5b9e\u56fe\u7247 \\(E_{pho}\\) \u56fe\u7247\u8bef\u5dee \\(E_{geo}\\) \u6df1\u5ea6\u8bef\u5dee,\u4ec5\u5728\u6df1\u5ea6\u4fe1\u606f\u53ef\u7528\u65f6\u5f15\u5165 \\(D(\\mathcal{G},\\boldsymbol{T}_{CW})\\) \u6e32\u67d3\u51fa\u6765\u7684\u6df1\u5ea6\uff08\u6e32\u67d3\u65b9\u5f0f\u548c RGB \u503c\u7c7b\u4f3c,\u5747\u4e3a\u6309\u4e0d\u900f\u660e\u5ea6\u548c\u900f\u5149\u7387\u52a0\u6743\u5e73\u5747\uff09 \\(\\bar{D}\\) \u6df1\u5ea6\u6570\u636e","title":"Tracking"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#keyframing","text":"\u9009\u53d6\u5173\u952e\u5e27\u7a97\u53e3 \\(\\mathcal{W}_k\\) ,\u4e24\u5e27\u4e4b\u95f4\u5171\u540c\u53ef\u89c1 Gaussian \u7684\u6bd4\u4f8b \u5224\u65ad Gaussian \u662f\u5426\u53ef\u89c1\u7684\u65b9\u6cd5\u5c31\u662f\u5224\u65ad\u5230\u8be5 Gaussian \u7684\u900f\u5149\u7387\u662f\u5426\u8fbe\u5230 0.5 \u5b9a\u4e49\u5171\u540c\u53ef\u89c1\u5ea6\uff08covisibility\uff09\u4e3a\u5f53\u524d\u5e27 \\(i\\) \u4e0e\u4e0a\u4e00\u5173\u952e\u5e27 \\(j\\) \u4e4b\u95f4\u53ef\u89c1 Gaussian \u96c6\u5408\u7684 IoU \u82e5 covisibility \u4f4e\u4e8e\u67d0\u4e2a\u9608\u503c\uff0c\u6216\u76f8\u5bf9\u5e73\u79fb \\(t_{ij}\\) \u76f8\u5bf9\u4e8e\u6df1\u5ea6\u4e2d\u4f4d\u6570\u8f83\u5927\uff0c\u5219\u5e27 \\(i\\) \u88ab\u89c6\u4e3a\u5173\u952e\u5e27 \u540c\u65f6\u5728\u5f53\u524d\u5e27 \\(i\\) \u88ab\u52a0\u5165\u5230\u5173\u952e\u5e27\u7a97\u53e3\u65f6\uff0c\u4e5f\u8981\u79fb\u9664 \\(\\mathcal{W}_k\\) \u4e2d\u8001\u65e7\u7684\u5173\u952e\u5e27 \u5f53\u5e27 \\(j \\in \\mathcal{W}_k\\) \u4e0e\u5f53\u524d\u5e27 \\(i\\) \u53ef\u89c1 Gaussians \u7684\u91cd\u53e0\u7cfb\u6570 OC \u5c0f\u4e8e\u67d0\u4e2a\u9608\u503c\u65f6\uff0c\u79fb\u9664\u3002 \\[ OC_{cov}(i,j)=\\frac{|\\mathcal{G}_i^v\\cap\\mathcal{G}_j^v|}{\\min(|\\mathcal{G}_i^v|,|\\mathcal{G}_j^v|)} \\]","title":"Keyframing"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#gaussian-insertion-and-pruning","text":"\u6bcf\u4e2a\u5173\u952e\u5e27\u90fd\u4f1a\u6dfb\u52a0\u65b0\u7684 Gaussians\uff0c\u7528\u5173\u952e\u5e27\u7684\u6bcf\u4e2a\u50cf\u7d20\u70b9\u7684\u6df1\u5ea6 D\uff08\u5728\u5355\u76ee\u76f8\u673a\u7684\u60c5\u51b5\u4e0b\u4f1a\u6e32\u67d3\u6df1\u5ea6\u6765\u4f30\u8ba1 D \u7684\u503c\uff09\u4f5c\u4e3a\u65b0\u589e Gaussians \u7684\u53c2\u8003\u4f4d\u7f6e \u7531\u4e8e D \u4e0d\u4e00\u5b9a\u51c6\u786e\uff0c\u65b0\u7684 Gaussians \u7684\u6df1\u5ea6\u670d\u4ece\u4e00\u4e2a\u5747\u503c\u4e3a D\u3001\u65b9\u5dee\u8f83\u5c0f\u7684\u6b63\u592a\u5206\u5e03 \u5bf9\u4e8e\u6ca1\u6709\u6df1\u5ea6\u4f30\u8ba1\u7684\u50cf\u7d20\uff0c\u65b0 Gaussians \u7684\u6df1\u5ea6\u670d\u4ece\u5747\u503c\u4e3a\u6e32\u67d3\u56fe\u50cf\u6df1\u5ea6\u4e2d\u4f4d\u6570\u3001\u65b9\u5dee\u8f83\u5927\u7684\u6b63\u592a\u5206\u5e03 \u4e00\u5f00\u59cb\u6ca1\u6709 Gaussian \u65f6\uff0c\u65b0\u589e Gaussian \u7684\u4f4d\u7f6e\u662f\u968f\u673a\u7684 \u5f53\u5173\u952e\u5e27\u7a97\u53e3 \\(\\mathcal{W}_k\\) \u5df2\u6ee1\uff0c\u6267\u884c\u526a\u679d\u64cd\u4f5c\uff0c\u5982\u679c\u6700\u8fd1\u4e09\u4e2a\u5173\u952e\u5e27\u90a3\u65b0\u589e\u7684 Gaussians \u6ca1\u6709\u5728\u5176\u4ed6\u81f3\u5c11\u4e09\u5e27\u5185\u89c2\u5bdf\u5230\uff0c\u79fb\u9664\u3002\u4e0d\u900f\u660e\u5ea6\u5c0f\u4e8e 0.7 \u7684 Gaussians \u4e5f\u4f1a\u88ab\u79fb\u9664\u3002","title":"Gaussian Insertion and Pruning"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#mapping","text":"\u7ef4\u62a4\u4e00\u4e2a\u534f\u8c03\u7684 3D \u7ed3\u6784\u5e76\u4f18\u5316\u65b0\u63d2\u5165\u7684 Gaussians \u53c2\u4e0e\u4f18\u5316\u7684\u5e27\u96c6\u5408\u4e3a \\(\\mathcal{W}=\\mathcal{W}_k \\cup \\mathcal{W}_r\\) \uff0c\u5176\u4e2d \\(\\mathcal{W}_r\\) \u662f\u968f\u673a\u9009\u53d6\u7684\u4e24\u4e2a\u65e7\u5e27 3D \u9ad8\u65af\u6e32\u67d3\u8fc7\u7a0b\u4e2d\u6ca1\u6709\u5bf9\u6cbf\u5149\u7ebf\u65b9\u5411\u7684 Gaussian \u8fdb\u884c\u7ea6\u675f\uff0c\u4f1a\u5bfc\u81f4 SLAM \u8fc7\u7a0b\u4e2d\u51fa\u73b0\u4f2a\u5f71\uff0c\u56e0\u6b64\u5f15\u5165\u5404\u5411\u540c\u6027\u7ea6\u675f \\[ E_{iso}=\\sum_{i=1}^{|\\mathcal{G}|}\\left\\|\\mathbf{s}_i-\\tilde{\\mathbf{s}_i}\\cdot\\mathbf{1}\\right\\|_1 \\] \u5bf9\u4e8e\u5efa\u56fe\u90e8\u5206\uff0c\u6700\u5c0f\u5316\u4ee5\u4e0b\u76ee\u6807\u51fd\u6570 \\[ \\min_{\\boldsymbol{T}_{CW_{\\forall k\\in\\mathcal{W}}}^k\\in\\mathbf{SE}{(3),\\mathcal{G}}}\\sum_{\\forall k\\in\\mathcal{W}}E_{pho}^k+\\lambda_{iso}E_{iso} \\]","title":"Mapping"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/3dgs/gaussian-splatting-slam/#reference","text":"\u3010\u8ba1\u7b97\u673a\u89c6\u89c9\u3011\u56db\u7bc7\u57fa\u4e8eGaussian Splatting\u7684SLAM\u8bba\u6587\u5bf9\u6bd4_gaussian splatting slam-CSDN\u535a\u5ba2 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143DGS-SLAM\u7cfb\u5217\u4ee3\u7801\u89e3\u8bfb_gs slam-CSDN\u535a\u5ba2","title":"Reference"},{"location":"cv/papers/3dgs/splatam/","text":"SplaTAM \u00b6 \u7ea6 1520 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a SplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM code\uff1a gaussian-splatting Idea \u00b6 Introduction \u00b6 \u7b2c\u4e00\u4e2a 3DGS \u7ed3\u5408 SLAM \u7684\u7cfb\u7edf\uff0c\u7528 3DGS \u8868\u793a\u573a\u666f\uff0c\u53ef\u4ee5\u7528\u65e0\u4f4d\u59ff\u7684\u5355\u76ee RGB-D \u76f8\u673a\u5b9e\u73b0\u5bc6\u96c6 SLAM \u89e3\u51b3\u795e\u7ecf\u8f90\u5c04\u573a\u573a\u666f\u8868\u793a\u7684\u5c40\u9650\u6027\uff0c\u5305\u62ec\u5feb\u901f\u6e32\u67d3\u548c\u4f18\u5316\uff0c\u786e\u5b9a\u533a\u57df\u662f\u5426\u88ab map \u7684\u80fd\u529b\uff0c\u4ee5\u53ca\u901a\u8fc7\u6dfb\u52a0\u548c\u5220\u9664\u9ad8\u65af\u7684\u7ed3\u6784\u5316\u5730\u56fe\u6269\u5c55 \u91c7\u7528\u4e86\u4e00\u4e2a\u5728\u7ebf\u8ddf\u8e2a\u548c\u5efa\u56fe\u6846\u67b6\uff0c\u540c\u65f6\u88c1\u526a\u5b83\uff0c\u4ee5\u4e13\u95e8\u4f7f\u7528\u5e95\u5c42\u7684\u9ad8\u65af\u8868\u793a\u548c\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u7684silhouette(\u8f6e\u5ed3)\u5f15\u5bfc\u7684\u4f18\u5316 \u540c\u65f6\u4f18\u5316\u4f4d\u59ff\u4f30\u8ba1\u3001\u573a\u666f\u91cd\u5efa\u548c\u65b0\u89c6\u89d2\u5408\u6210\uff0c\u5141\u8bb8\u5b9e\u65f6\u6e32\u67d3\u9ad8\u5206\u8fa8\u7387\u7684\u5bc6\u96c6 3D \u5730\u56fe \u9ad8\u65af\u5730\u56fe\u8868\u793a \u00b6 \u573a\u666f\u4e2d\u7684\u5e95\u5c42\u5730\u56fe\u8868\u793a\u4e3a\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\uff0c\u7b80\u5316\u539f\u59cb GS\uff0c \u53ea\u4f7f\u7528\u4e0e\u89c6\u56fe\u65e0\u5173\u7684\u989c\u8272\uff0c\u5e76\u8feb\u4f7f\u9ad8\u65af\u5206\u5e03\u662f\u5404\u5411\u540c\u6027 \u6bcf\u4e2a\u9ad8\u65af\u503c\u53ea\u6709 8 \u4e2a\u53c2\u6570\uff08RGB 3 \u4e2a\uff0c\u4e2d\u5fc3\u4f4d\u7f6e 3 \u4e2a\uff0c\u534a\u5f84 1 \u4e2a\uff0c\u4e0d\u900f\u660e\u5ea6 1 \u4e2a\uff09 \u6839\u636e\u9ad8\u65af\u5206\u5e03\u7684\u4e0d\u900f\u660e\u5ea6\u52a0\u6743\u7684\u6807\u51c6\uff08\u975e\u5f52\u4e00\u5316\uff09\u9ad8\u65af\u65b9\u7a0b\uff0c\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u90fd\u5f71\u54cd\u4e09\u7ef4\u7a7a\u95f4 \\(x \\in R^3\\) \u7684\u4e00\u4e2a\u70b9\uff1a \\[ f(\\mathcal{x}) = o \\exp \\left ( - \\frac{\\left \\| \\mathcal{x} - \\mathcal{\\mu} \\right \\|^2 }{2r^2} \\right) \\] \u6cfc\u6e85\u7684\u53ef\u5fae\u6e32\u67d3 \u00b6 \u80fd\u591f\u5c06\u5e95\u5c42\u9ad8\u65af\u5730\u56fe\u4e2d\u7684\u9ad8\u4fdd\u771f\u989c\u8272\u3001\u6df1\u5ea6\u548c\u8f6e\u5ed3\u56fe\u50cf\u6e32\u67d3\u5230\u4efb\u4f55\u53ef\u80fd\u7684\u76f8\u673a\u53c2\u8003\u5e27\u4e2d \u53ef\u5fae\u6e32\u67d3\u5141\u8bb8\u76f4\u63a5\u8ba1\u7b97\u5e95\u5c42\u573a\u666f\u8868\u793a\uff08\u9ad8\u65af\uff09\u548c\u76f8\u673a\u53c2\u6570\u7684\u68af\u5ea6\uff0c\u5229\u7528\u6e32\u67d3\u548c\u771f\u5b9e\u7684 RGB-D \u5e27\u4e4b\u95f4\u7684\u8bef\u5dee\uff0c\u5e76\u66f4\u65b0\u9ad8\u65af\u548c\u76f8\u673a\u53c2\u6570\u6765\u51cf\u5c11\u8bef\u5dee \u9ad8\u65af\u6e32\u67d3 RGB \u56fe\u50cf\u7684\u8fc7\u7a0b\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e09\u7ef4\u9ad8\u65af\u548c\u76f8\u673a\u4f4d\u59ff\u7684\u96c6\u5408\uff0c\u9996\u5148\u4ece\u524d\u5f80\u540e\u5bf9\u6240\u6709\u9ad8\u65af\u8fdb\u884c\u6392\u5e8f\uff0c\u901a\u8fc7 \u5728\u50cf\u7d20\u7a7a\u95f4\u4e2d\uff0c\u4f9d\u6b21 \\(\\alpha\\) -\u5408\u6210\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u7684\u4e8c\u7ef4\u6295\u5f71\uff0c\u6765\u6e32\u67d3 RGB \u56fe\u50cf \u50cf\u7d20 \\(p=(u,v)\\) \u6e32\u67d3\u989c\u8272\u516c\u5f0f\uff1a \\[ \\begin{aligned} C(\\mathcal{p}) = \\sum_{i=1}^n \\mathcal{c}_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\\\ \\mathcal{\\mu}^{2D} = K \\frac{E_t \\mathcal{\\mu}}{d}, \\ \\ \\ r^{2D} = \\frac{fr}{d}, \\ \\ \\ where d = (E_t \\mathcal{\\mu})_z \\end{aligned} \\] \\(K\\) \u662f\u76f8\u673a\u5185\u53c2\uff0c \\(E_t\\) \u662f\u7b2c \\(t\\) \u5e27\u5904\u7684\u76f8\u673a\u65cb\u8f6c\u548c\u5e73\u79fb\u7684\u5916\u53c2\uff0c \\(f\\) \u662f\u7126\u8ddd\uff0c \\(d\\) \u662f\u76f8\u673a\u5750\u6807\u7cfb\u4e0b\u7b2c \\(i\\) \u4e2a\u9ad8\u65af\u503c\u7684\u6df1\u5ea6 \u7c7b\u4f3c\u7684\u6df1\u5ea6\u6e32\u67d3\uff08\u53ef\u4ee5\u4e0e\u8f93\u5165\u6df1\u5ea6\u56fe\u6bd4\u8f83\uff0c\u8fd4\u56de\u76f8\u5bf9\u4e8e 3D \u5730\u56fe\u7684\u68af\u5ea6\uff09 \\[ D(\\mathcal{p}) = \\sum_{i=1}^n d_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\] \u6e32\u67d3\u4e00\u4e2a silhouette\uff08\u8f6e\u5ed3\uff09\u56fe\u50cf\u6765\u786e\u5b9a\u53ef\u89c1\u6027\uff0c\u4f8b\u5982\u4e00\u4e2a\u50cf\u7d20\u662f\u5426\u5305\u542b\u6765\u81ea\u5f53\u524d\u5730\u56fe\u7684\u4fe1\u606f\uff1a \\[ S(\\mathcal{p}) = \\sum_{i=1}^n f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\] SLAM \u7cfb\u7edf \u00b6 Tip \u4ece\u9ad8\u65af\u5e95\u5c42\u8868\u793a\u548c\u53ef\u5fae\u6e32\u67d3\u5668\u5efa\u7acb\u4e00\u4e2a SLAM \u7cfb\u7edf\u3002 \u5047\u8bbe\u6709\u4e00\u4e2a\u73b0\u6709\u7684\u5730\u56fe\uff08\u901a\u8fc7\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\u8868\u793a\uff09\uff0c\u5df2\u7ecf\u62df\u5408\u4e86\u7b2c 1 \u5e27\u5230\u7b2c t \u5e27\u3002\u7ed9\u5b9a\u4e00\u4e2a\u65b0\u7684 RGB-D \u5e27 t+1\uff0cSLAM \u7cfb\u7edf\u4f1a\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a \u76f8\u673a\u8ddf\u8e2a \uff1a\u5229\u7528 t + 1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316 RGB-D \u5e8f\u5217\u7684\u56fe\u50cf\u548c\u6df1\u5ea6\u91cd\u5efa\u8bef\u5dee\uff0c\u4f46\u53ea\u8bc4\u4f30\u8f6e\u5ed3\u5185\u7684\u50cf\u7d20\u7684\u8bef\u5dee \u9ad8\u65af\u5bc6\u5ea6 \uff1a\u6839\u636e\u6e32\u67d3\u7684\u8f6e\u5ed3\u548c\u8f93\u5165\u6df1\u5ea6\uff0c\u5411\u5730\u56fe\u4e2d\u6dfb\u52a0\u65b0\u7684\u9ad8\u65af \u5730\u56fe\u66f4\u65b0 \uff1a\u7ed9\u5b9a\u4ece\u7b2c 1 \u5e27\u5230 \u7b2c t+1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316\u6240\u6709\u56fe\u50cf\u7684 RGB \u548c\u6df1\u5ea6\u8bef\u5dee\u6765\u66f4\u65b0\u9ad8\u65af\u5206\u5e03\u53c2\u6570\u3002\u4ee3\u7801\u4e2d\uff0c\u4e3a\u4fdd\u6301\u6279\u5904\u7406\u5927\u5c0f\u548c\u53ef\u7ba1\u7406\u6027\uff0c\u5c06\u5bf9\u9009\u597d\u7684\uff0c\u4e0e\u6700\u8fd1\u5e27\u91cd\u53e0\u7684\u5173\u952e\u5e27\u5b50\u96c6\u8fdb\u884c\u4f18\u5316 \u521d\u59cb\u5316 \u00b6 \u7b2c\u4e00\u5e27\u8df3\u8fc7\u8ddf\u8e2a\uff0c\u5c06\u76f8\u673a\u4f4d\u59ff\u8bbe\u7f6e\u4e3a identity\uff0c\u7a20\u5bc6\u5316\u4e2d\uff0c\u7531\u4e8e\u6e32\u67d3\u7684\u8f6e\u5ed3\u4e3a\u7a7a\uff0c \u6240\u6709\u50cf\u7d20\u90fd\u7528\u4e8e\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af \u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u6dfb\u52a0\u4e00\u4e2a\u989c\u8272\u4e3a\u50cf\u7d20\u7684\u65b0\u9ad8\u65af\uff0c\u4e2d\u5fc3\u4f4d\u7f6e\u4e3a\u6295\u5f71\u7684\u50cf\u7d20\u6df1\u5ea6\uff0c\u4e0d\u900f\u660e\u5ea6\u4e3a 0.5\uff0c\u534a\u5f84\u7b49\u4e8e\u4e00\u4e2a\u50cf\u7d20\u534a\u5f84\u6295\u5f71\u5230 2D \u56fe\u50cf\u7684\u6df1\u5ea6\u9664\u4ee5\u7126\u8ddd \\(r = \\frac{D_{GT}}{f}\\) \u76f8\u673a\u8ddf\u8e2a \u00b6 \u4f30\u8ba1\u5f53\u524d\u8f93\u5165\u7684\u5728\u7ebf RGB-D \u56fe\u50cf\u7684\u76f8\u673a\u4f4d\u59ff\u3002\u901a\u8fc7\u5bf9\u76f8\u673a\u4e2d\u5fc3 + \u56db\u5143\u6570\u7a7a\u95f4\u4e2d\u59ff\u6001\u53c2\u6570\u7684\u6052\u5b9a\u901f\u5ea6\u6b63\u5411\u6295\u5f71\uff0c\u4e3a\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u6b65\u521d\u59cb\u5316\u76f8\u673a\u4f4d\u59ff \\[ E_{t+1}=E_t + (E_t - E_{t-1}) \\] \u901a\u8fc7\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\uff0c\u901a\u8fc7\u53ef\u5fae\u5206\u6e32\u67d3 RGB\u3001\u6df1\u5ea6\u3001\u548c\u8f6e\u5ed3\u56fe\uff0c\u5e76\u66f4\u65b0\u76f8\u673a\u53c2\u6570\uff0c\u540c\u65f6\u4fdd\u6301\u9ad8\u65af\u53c2\u6570\u4e0d\u53d8\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\uff1a \\[ L(t) = \\sum_\\mathcal{p} (S(\\mathcal{p}) > 0.99)(L_1(D(\\mathcal{p}))+0.5L_1(C(\\mathcal{p}))) \\] \u4e0a\u8ff0\u4e3a\u6df1\u5ea6\u548c\u989c\u8272\u4e0a\u7684 \\(L_1\\) \u635f\u5931\uff0c\u989c\u8272\u7684\u6743\u91cd\u5c11\u4e00\u534a\uff0c\u53ea\u5e94\u7528\u4ee5\u4e0a\u635f\u5931\u4e8e\u901a\u8fc7\u8f6e\u5ed3\u56fe\u6e32\u67d3\u7684\u50cf\u7d20\u3002\u8f6e\u5ed3\u56fe\u6355\u83b7\u4e86\u5730\u56fe\u7684\u4e0d\u786e\u5b9a\u6027\u3002\u8fd9\u5bf9\u4e8e\u8ddf\u8e2a\u65b0\u7684\u76f8\u673a\u4f4d\u59ff\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u65b0\u5e27\u901a\u5e38\u5305\u542b\u5728\u5730\u56fe\u4e2d\u5c1a\u672a\u6355\u83b7\u6216\u7ecf\u8fc7\u826f\u597d\u4f18\u5316\u7684\u65b0\u4fe1\u606f\u3002\u5982\u679c\u4e00\u4e2a\u50cf\u7d20\u6ca1\u6709 GT \u6df1\u5ea6\uff0c\u5219 \\(L_1\\) \u635f\u5931\u4e3a 0 \u9ad8\u65af\u7a20\u5bc6\u5316 \u00b6 \u4e3a\u6bcf\u4e2a\u65b0\u8fdb\u5165\u5e27\u5728\u5730\u56fe\u4e2d\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af\u5206\u5e03\u3002 \u5728\u8ddf\u8e2a\u4e4b\u540e\uff0c\u5bf9\u65b0\u8fdb\u5165\u5e27\u7684\u76f8\u673a\u4f4d\u59ff\u6709\u4e00\u4e2a\u51c6\u786e\u7684\u4f30\u8ba1 \u5bf9\u4e8e\u6df1\u5ea6\u56fe\u50cf\uff0c\u5bf9\u9ad8\u65af\u5206\u5e03\u5728\u573a\u666f\u4e2d\u7684\u4f4d\u7f6e\u6709\u4e86\u597d\u7684\u4f30\u8ba1 \u5f53\u524d\u7684\u9ad8\u65af\u5df2\u7ecf\u51c6\u786e\u5730\u8868\u793a\u573a\u666f\u51e0\u4f55\uff0c\u4e0d\u9700\u8981\u6dfb\u52a0\u9ad8\u65af\uff0c\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u5bc6\u96c6\u5316 mask \u6765\u786e\u5b9a\u54ea\u4e9b\u50cf\u7d20\u5e94\u8be5\u88ab\u5bc6\u96c6\u5316 \\[ M(\\mathcal{p}) = (S(\\mathcal{p})<0.5) + (D_{GT}(\\mathcal{p})50 MDE) \\] \u6b64 mask \u53ea\u663e\u793a\u5730\u56fe\u5bc6\u5ea6\u4e0d\u8db3\u7684\u5730\u65b9 ( \\(S < 0.5\\) )\uff0c\u6216\u8005\u5728\u5f53\u524d\u4f30\u8ba1\u7684\u51e0\u4f55\u56fe\u5f62\u524d\u9762\u6709\u65b0\u7684\u51e0\u4f55\u56fe\u5f62\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u57fa\u4e8e\u8fd9\u4e2a mask\uff0c\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u9ad8\u65af\u8fdb\u884c\u7b2c\u4e00\u5e27\u521d\u59cb\u5316 \u9ad8\u65af\u5730\u56fe\u66f4\u65b0 \u00b6 \u57fa\u4e8e\u4f30\u8ba1\u7684\u5728\u7ebf\u76f8\u673a\u4f4d\u59ff\u4e0b\uff0c\u66f4\u65b0\u4e09\u7ef4\u9ad8\u65af\u5730\u56fe\u7684\u53c2\u6570\u3002\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u548c\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\u6765\u5b9e\u73b0\uff0c \u548c\u8ddf\u8e2a\u4e0d\u540c\u7684\u662f\uff0c\u76f8\u673a\u4f4d\u59ff\u662f\u56fa\u5b9a\u7684\uff0c\u9ad8\u65af\u5206\u5e03\u7684\u53c2\u6570\u88ab\u66f4\u65b0 \u548c\u5df2\u77e5\u76f8\u673a\u4f4d\u59ff\u7684\u56fe\u50cf\u62df\u5408\u8f90\u5c04\u573a\u7684\u7ecf\u5178\u95ee\u9898\u76f8\u4f3c\uff0c\u6709\u4e24\u4e2a\u4f18\u5316\u7684\u5730\u65b9\uff1a \u4e0d\u662f\u4ece\u5934\u5f00\u59cb\uff0c\u800c\u662f\u4ece\u6700\u8fd1\u6784\u5efa\u7684\u5730\u56fe\u4e2d\u9884\u70ed\uff0c\u5f00\u59cb\u4f18\u5316 \u4e0d\u4f18\u5316\u6240\u6709\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff0c\u800c\u662f\u9009\u62e9\u53ef\u80fd\u5f71\u54cd\u65b0\u6dfb\u52a0\u7684\u9ad8\u65af\u5206\u5e03\u7684\u5e27\u3002\u5c06\u6bcf n \u5e27\u4fdd\u5b58\u4e3a\u5173\u952e\u5e27\uff0c\u5e76\u9009\u62e9 k \u5e27\u8fdb\u884c\u4f18\u5316\uff0c\u5305\u62ec\u5f53\u524d\u5e27\u3001\u6700\u8fd1\u7684\u5173\u952e\u5e27\uff0c\u4ee5\u53ca k\u22122 \u4e4b\u524d\u4e0e\u5f53\u524d\u5e27\u91cd\u53e0\u6700\u9ad8\u7684\u5173\u952e\u5e27\u3002\u91cd\u53e0\u662f\u901a\u8fc7\u53d6\u5f53\u524d\u5e27\u6df1\u5ea6\u56fe\u7684\u70b9\u4e91\uff0c\u5e76\u786e\u5b9a\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u9519\u8bef\u70b9\u6570\u6765\u786e\u5b9a\u7684 \u4f18\u5316\u548c\u8ddf\u8e2a\u7684\u635f\u5931\u76f8\u4f3c\uff0c\u4f46\u4e0d\u4f7f\u7528\u8f6e\u5ed3 mask\uff08\u56e0\u4e3a\u8981\u4f18\u5316\u6240\u6709\u50cf\u7d20\uff09\u3002\u53e6\u5916\u5728 RGB \u6e32\u67d3\u4e2d\u6dfb\u52a0\u4e00\u4e2a SSIM \u635f\u5931\uff0c\u5e76\u5254\u9664\u4e0d\u900f\u660e\u5ea6\u63a5\u8fd1 0 \u7684\u65e0\u7528\u9ad8\u65af\u5206\u5e03 Experiment \u00b6 Reference \u00b6 \u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian SLAM\uff0cSplaTAM\u914d\u7f6e\uff08Linux\uff09\u4e0e\u6e90\u7801\u89e3\u8bfb-CSDN\u535a\u5ba2 \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014\u57fa\u4e8eTUM-RGBD\u6570\u636e\u96c6\u7684SplaTAM\u6d4b\u8bd5_jiyu tum-rgbd\u6570\u636e\u96c6\u7684splatam\u6d4b\u8bd5-CSDN\u535a\u5ba2 \u3010\u4e09\u7ef4\u91cd\u5efa\u3011\u3010SLAM\u3011SplaTAM\uff1a\u57fa\u4e8e3D\u9ad8\u65af\u7684\u5bc6\u96c6RGB-D SLAM(CVPR 2024)-CSDN\u535a\u5ba2 \u8bba\u6587\u590d\u73b0\u300aSplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM\u300b_splatam\u8bba\u6587\u89e3\u6790-CSDN\u535a\u5ba2","title":"SplaTAM"},{"location":"cv/papers/3dgs/splatam/#splatam","text":"\u7ea6 1520 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a SplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM code\uff1a gaussian-splatting","title":"SplaTAM"},{"location":"cv/papers/3dgs/splatam/#idea","text":"","title":"Idea"},{"location":"cv/papers/3dgs/splatam/#introduction","text":"\u7b2c\u4e00\u4e2a 3DGS \u7ed3\u5408 SLAM \u7684\u7cfb\u7edf\uff0c\u7528 3DGS \u8868\u793a\u573a\u666f\uff0c\u53ef\u4ee5\u7528\u65e0\u4f4d\u59ff\u7684\u5355\u76ee RGB-D \u76f8\u673a\u5b9e\u73b0\u5bc6\u96c6 SLAM \u89e3\u51b3\u795e\u7ecf\u8f90\u5c04\u573a\u573a\u666f\u8868\u793a\u7684\u5c40\u9650\u6027\uff0c\u5305\u62ec\u5feb\u901f\u6e32\u67d3\u548c\u4f18\u5316\uff0c\u786e\u5b9a\u533a\u57df\u662f\u5426\u88ab map \u7684\u80fd\u529b\uff0c\u4ee5\u53ca\u901a\u8fc7\u6dfb\u52a0\u548c\u5220\u9664\u9ad8\u65af\u7684\u7ed3\u6784\u5316\u5730\u56fe\u6269\u5c55 \u91c7\u7528\u4e86\u4e00\u4e2a\u5728\u7ebf\u8ddf\u8e2a\u548c\u5efa\u56fe\u6846\u67b6\uff0c\u540c\u65f6\u88c1\u526a\u5b83\uff0c\u4ee5\u4e13\u95e8\u4f7f\u7528\u5e95\u5c42\u7684\u9ad8\u65af\u8868\u793a\u548c\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u7684silhouette(\u8f6e\u5ed3)\u5f15\u5bfc\u7684\u4f18\u5316 \u540c\u65f6\u4f18\u5316\u4f4d\u59ff\u4f30\u8ba1\u3001\u573a\u666f\u91cd\u5efa\u548c\u65b0\u89c6\u89d2\u5408\u6210\uff0c\u5141\u8bb8\u5b9e\u65f6\u6e32\u67d3\u9ad8\u5206\u8fa8\u7387\u7684\u5bc6\u96c6 3D \u5730\u56fe","title":"Introduction"},{"location":"cv/papers/3dgs/splatam/#_1","text":"\u573a\u666f\u4e2d\u7684\u5e95\u5c42\u5730\u56fe\u8868\u793a\u4e3a\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\uff0c\u7b80\u5316\u539f\u59cb GS\uff0c \u53ea\u4f7f\u7528\u4e0e\u89c6\u56fe\u65e0\u5173\u7684\u989c\u8272\uff0c\u5e76\u8feb\u4f7f\u9ad8\u65af\u5206\u5e03\u662f\u5404\u5411\u540c\u6027 \u6bcf\u4e2a\u9ad8\u65af\u503c\u53ea\u6709 8 \u4e2a\u53c2\u6570\uff08RGB 3 \u4e2a\uff0c\u4e2d\u5fc3\u4f4d\u7f6e 3 \u4e2a\uff0c\u534a\u5f84 1 \u4e2a\uff0c\u4e0d\u900f\u660e\u5ea6 1 \u4e2a\uff09 \u6839\u636e\u9ad8\u65af\u5206\u5e03\u7684\u4e0d\u900f\u660e\u5ea6\u52a0\u6743\u7684\u6807\u51c6\uff08\u975e\u5f52\u4e00\u5316\uff09\u9ad8\u65af\u65b9\u7a0b\uff0c\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u90fd\u5f71\u54cd\u4e09\u7ef4\u7a7a\u95f4 \\(x \\in R^3\\) \u7684\u4e00\u4e2a\u70b9\uff1a \\[ f(\\mathcal{x}) = o \\exp \\left ( - \\frac{\\left \\| \\mathcal{x} - \\mathcal{\\mu} \\right \\|^2 }{2r^2} \\right) \\]","title":"\u9ad8\u65af\u5730\u56fe\u8868\u793a"},{"location":"cv/papers/3dgs/splatam/#_2","text":"\u80fd\u591f\u5c06\u5e95\u5c42\u9ad8\u65af\u5730\u56fe\u4e2d\u7684\u9ad8\u4fdd\u771f\u989c\u8272\u3001\u6df1\u5ea6\u548c\u8f6e\u5ed3\u56fe\u50cf\u6e32\u67d3\u5230\u4efb\u4f55\u53ef\u80fd\u7684\u76f8\u673a\u53c2\u8003\u5e27\u4e2d \u53ef\u5fae\u6e32\u67d3\u5141\u8bb8\u76f4\u63a5\u8ba1\u7b97\u5e95\u5c42\u573a\u666f\u8868\u793a\uff08\u9ad8\u65af\uff09\u548c\u76f8\u673a\u53c2\u6570\u7684\u68af\u5ea6\uff0c\u5229\u7528\u6e32\u67d3\u548c\u771f\u5b9e\u7684 RGB-D \u5e27\u4e4b\u95f4\u7684\u8bef\u5dee\uff0c\u5e76\u66f4\u65b0\u9ad8\u65af\u548c\u76f8\u673a\u53c2\u6570\u6765\u51cf\u5c11\u8bef\u5dee \u9ad8\u65af\u6e32\u67d3 RGB \u56fe\u50cf\u7684\u8fc7\u7a0b\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e09\u7ef4\u9ad8\u65af\u548c\u76f8\u673a\u4f4d\u59ff\u7684\u96c6\u5408\uff0c\u9996\u5148\u4ece\u524d\u5f80\u540e\u5bf9\u6240\u6709\u9ad8\u65af\u8fdb\u884c\u6392\u5e8f\uff0c\u901a\u8fc7 \u5728\u50cf\u7d20\u7a7a\u95f4\u4e2d\uff0c\u4f9d\u6b21 \\(\\alpha\\) -\u5408\u6210\u6bcf\u4e2a\u9ad8\u65af\u5206\u5e03\u7684\u4e8c\u7ef4\u6295\u5f71\uff0c\u6765\u6e32\u67d3 RGB \u56fe\u50cf \u50cf\u7d20 \\(p=(u,v)\\) \u6e32\u67d3\u989c\u8272\u516c\u5f0f\uff1a \\[ \\begin{aligned} C(\\mathcal{p}) = \\sum_{i=1}^n \\mathcal{c}_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\\\ \\mathcal{\\mu}^{2D} = K \\frac{E_t \\mathcal{\\mu}}{d}, \\ \\ \\ r^{2D} = \\frac{fr}{d}, \\ \\ \\ where d = (E_t \\mathcal{\\mu})_z \\end{aligned} \\] \\(K\\) \u662f\u76f8\u673a\u5185\u53c2\uff0c \\(E_t\\) \u662f\u7b2c \\(t\\) \u5e27\u5904\u7684\u76f8\u673a\u65cb\u8f6c\u548c\u5e73\u79fb\u7684\u5916\u53c2\uff0c \\(f\\) \u662f\u7126\u8ddd\uff0c \\(d\\) \u662f\u76f8\u673a\u5750\u6807\u7cfb\u4e0b\u7b2c \\(i\\) \u4e2a\u9ad8\u65af\u503c\u7684\u6df1\u5ea6 \u7c7b\u4f3c\u7684\u6df1\u5ea6\u6e32\u67d3\uff08\u53ef\u4ee5\u4e0e\u8f93\u5165\u6df1\u5ea6\u56fe\u6bd4\u8f83\uff0c\u8fd4\u56de\u76f8\u5bf9\u4e8e 3D \u5730\u56fe\u7684\u68af\u5ea6\uff09 \\[ D(\\mathcal{p}) = \\sum_{i=1}^n d_i f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\] \u6e32\u67d3\u4e00\u4e2a silhouette\uff08\u8f6e\u5ed3\uff09\u56fe\u50cf\u6765\u786e\u5b9a\u53ef\u89c1\u6027\uff0c\u4f8b\u5982\u4e00\u4e2a\u50cf\u7d20\u662f\u5426\u5305\u542b\u6765\u81ea\u5f53\u524d\u5730\u56fe\u7684\u4fe1\u606f\uff1a \\[ S(\\mathcal{p}) = \\sum_{i=1}^n f_i(\\mathcal{p}) \\prod_{j=1}^{i-1}(1 - f_j(\\mathcal{p})) \\]","title":"\u6cfc\u6e85\u7684\u53ef\u5fae\u6e32\u67d3"},{"location":"cv/papers/3dgs/splatam/#slam","text":"Tip \u4ece\u9ad8\u65af\u5e95\u5c42\u8868\u793a\u548c\u53ef\u5fae\u6e32\u67d3\u5668\u5efa\u7acb\u4e00\u4e2a SLAM \u7cfb\u7edf\u3002 \u5047\u8bbe\u6709\u4e00\u4e2a\u73b0\u6709\u7684\u5730\u56fe\uff08\u901a\u8fc7\u4e00\u7ec4\u4e09\u7ef4\u9ad8\u65af\u5206\u5e03\u8868\u793a\uff09\uff0c\u5df2\u7ecf\u62df\u5408\u4e86\u7b2c 1 \u5e27\u5230\u7b2c t \u5e27\u3002\u7ed9\u5b9a\u4e00\u4e2a\u65b0\u7684 RGB-D \u5e27 t+1\uff0cSLAM \u7cfb\u7edf\u4f1a\u8fdb\u884c\u4ee5\u4e0b\u64cd\u4f5c\uff1a \u76f8\u673a\u8ddf\u8e2a \uff1a\u5229\u7528 t + 1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316 RGB-D \u5e8f\u5217\u7684\u56fe\u50cf\u548c\u6df1\u5ea6\u91cd\u5efa\u8bef\u5dee\uff0c\u4f46\u53ea\u8bc4\u4f30\u8f6e\u5ed3\u5185\u7684\u50cf\u7d20\u7684\u8bef\u5dee \u9ad8\u65af\u5bc6\u5ea6 \uff1a\u6839\u636e\u6e32\u67d3\u7684\u8f6e\u5ed3\u548c\u8f93\u5165\u6df1\u5ea6\uff0c\u5411\u5730\u56fe\u4e2d\u6dfb\u52a0\u65b0\u7684\u9ad8\u65af \u5730\u56fe\u66f4\u65b0 \uff1a\u7ed9\u5b9a\u4ece\u7b2c 1 \u5e27\u5230 \u7b2c t+1 \u5e27\u7684\u76f8\u673a\u4f4d\u59ff\uff0c\u6700\u5c0f\u5316\u6240\u6709\u56fe\u50cf\u7684 RGB \u548c\u6df1\u5ea6\u8bef\u5dee\u6765\u66f4\u65b0\u9ad8\u65af\u5206\u5e03\u53c2\u6570\u3002\u4ee3\u7801\u4e2d\uff0c\u4e3a\u4fdd\u6301\u6279\u5904\u7406\u5927\u5c0f\u548c\u53ef\u7ba1\u7406\u6027\uff0c\u5c06\u5bf9\u9009\u597d\u7684\uff0c\u4e0e\u6700\u8fd1\u5e27\u91cd\u53e0\u7684\u5173\u952e\u5e27\u5b50\u96c6\u8fdb\u884c\u4f18\u5316","title":"SLAM \u7cfb\u7edf"},{"location":"cv/papers/3dgs/splatam/#_3","text":"\u7b2c\u4e00\u5e27\u8df3\u8fc7\u8ddf\u8e2a\uff0c\u5c06\u76f8\u673a\u4f4d\u59ff\u8bbe\u7f6e\u4e3a identity\uff0c\u7a20\u5bc6\u5316\u4e2d\uff0c\u7531\u4e8e\u6e32\u67d3\u7684\u8f6e\u5ed3\u4e3a\u7a7a\uff0c \u6240\u6709\u50cf\u7d20\u90fd\u7528\u4e8e\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af \u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u6dfb\u52a0\u4e00\u4e2a\u989c\u8272\u4e3a\u50cf\u7d20\u7684\u65b0\u9ad8\u65af\uff0c\u4e2d\u5fc3\u4f4d\u7f6e\u4e3a\u6295\u5f71\u7684\u50cf\u7d20\u6df1\u5ea6\uff0c\u4e0d\u900f\u660e\u5ea6\u4e3a 0.5\uff0c\u534a\u5f84\u7b49\u4e8e\u4e00\u4e2a\u50cf\u7d20\u534a\u5f84\u6295\u5f71\u5230 2D \u56fe\u50cf\u7684\u6df1\u5ea6\u9664\u4ee5\u7126\u8ddd \\(r = \\frac{D_{GT}}{f}\\)","title":"\u521d\u59cb\u5316"},{"location":"cv/papers/3dgs/splatam/#_4","text":"\u4f30\u8ba1\u5f53\u524d\u8f93\u5165\u7684\u5728\u7ebf RGB-D \u56fe\u50cf\u7684\u76f8\u673a\u4f4d\u59ff\u3002\u901a\u8fc7\u5bf9\u76f8\u673a\u4e2d\u5fc3 + \u56db\u5143\u6570\u7a7a\u95f4\u4e2d\u59ff\u6001\u53c2\u6570\u7684\u6052\u5b9a\u901f\u5ea6\u6b63\u5411\u6295\u5f71\uff0c\u4e3a\u4e00\u4e2a\u65b0\u7684\u65f6\u95f4\u6b65\u521d\u59cb\u5316\u76f8\u673a\u4f4d\u59ff \\[ E_{t+1}=E_t + (E_t - E_{t-1}) \\] \u901a\u8fc7\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\uff0c\u901a\u8fc7\u53ef\u5fae\u5206\u6e32\u67d3 RGB\u3001\u6df1\u5ea6\u3001\u548c\u8f6e\u5ed3\u56fe\uff0c\u5e76\u66f4\u65b0\u76f8\u673a\u53c2\u6570\uff0c\u540c\u65f6\u4fdd\u6301\u9ad8\u65af\u53c2\u6570\u4e0d\u53d8\uff0c\u4ee5\u6700\u5c0f\u5316\u635f\u5931\uff1a \\[ L(t) = \\sum_\\mathcal{p} (S(\\mathcal{p}) > 0.99)(L_1(D(\\mathcal{p}))+0.5L_1(C(\\mathcal{p}))) \\] \u4e0a\u8ff0\u4e3a\u6df1\u5ea6\u548c\u989c\u8272\u4e0a\u7684 \\(L_1\\) \u635f\u5931\uff0c\u989c\u8272\u7684\u6743\u91cd\u5c11\u4e00\u534a\uff0c\u53ea\u5e94\u7528\u4ee5\u4e0a\u635f\u5931\u4e8e\u901a\u8fc7\u8f6e\u5ed3\u56fe\u6e32\u67d3\u7684\u50cf\u7d20\u3002\u8f6e\u5ed3\u56fe\u6355\u83b7\u4e86\u5730\u56fe\u7684\u4e0d\u786e\u5b9a\u6027\u3002\u8fd9\u5bf9\u4e8e\u8ddf\u8e2a\u65b0\u7684\u76f8\u673a\u4f4d\u59ff\u975e\u5e38\u91cd\u8981\uff0c\u56e0\u4e3a\u65b0\u5e27\u901a\u5e38\u5305\u542b\u5728\u5730\u56fe\u4e2d\u5c1a\u672a\u6355\u83b7\u6216\u7ecf\u8fc7\u826f\u597d\u4f18\u5316\u7684\u65b0\u4fe1\u606f\u3002\u5982\u679c\u4e00\u4e2a\u50cf\u7d20\u6ca1\u6709 GT \u6df1\u5ea6\uff0c\u5219 \\(L_1\\) \u635f\u5931\u4e3a 0","title":"\u76f8\u673a\u8ddf\u8e2a"},{"location":"cv/papers/3dgs/splatam/#_5","text":"\u4e3a\u6bcf\u4e2a\u65b0\u8fdb\u5165\u5e27\u5728\u5730\u56fe\u4e2d\u521d\u59cb\u5316\u65b0\u7684\u9ad8\u65af\u5206\u5e03\u3002 \u5728\u8ddf\u8e2a\u4e4b\u540e\uff0c\u5bf9\u65b0\u8fdb\u5165\u5e27\u7684\u76f8\u673a\u4f4d\u59ff\u6709\u4e00\u4e2a\u51c6\u786e\u7684\u4f30\u8ba1 \u5bf9\u4e8e\u6df1\u5ea6\u56fe\u50cf\uff0c\u5bf9\u9ad8\u65af\u5206\u5e03\u5728\u573a\u666f\u4e2d\u7684\u4f4d\u7f6e\u6709\u4e86\u597d\u7684\u4f30\u8ba1 \u5f53\u524d\u7684\u9ad8\u65af\u5df2\u7ecf\u51c6\u786e\u5730\u8868\u793a\u573a\u666f\u51e0\u4f55\uff0c\u4e0d\u9700\u8981\u6dfb\u52a0\u9ad8\u65af\uff0c\u56e0\u6b64\u521b\u5efa\u4e00\u4e2a\u5bc6\u96c6\u5316 mask \u6765\u786e\u5b9a\u54ea\u4e9b\u50cf\u7d20\u5e94\u8be5\u88ab\u5bc6\u96c6\u5316 \\[ M(\\mathcal{p}) = (S(\\mathcal{p})<0.5) + (D_{GT}(\\mathcal{p})50 MDE) \\] \u6b64 mask \u53ea\u663e\u793a\u5730\u56fe\u5bc6\u5ea6\u4e0d\u8db3\u7684\u5730\u65b9 ( \\(S < 0.5\\) )\uff0c\u6216\u8005\u5728\u5f53\u524d\u4f30\u8ba1\u7684\u51e0\u4f55\u56fe\u5f62\u524d\u9762\u6709\u65b0\u7684\u51e0\u4f55\u56fe\u5f62\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u50cf\u7d20\uff0c\u57fa\u4e8e\u8fd9\u4e2a mask\uff0c\u6dfb\u52a0\u4e00\u4e2a\u65b0\u7684\u9ad8\u65af\u8fdb\u884c\u7b2c\u4e00\u5e27\u521d\u59cb\u5316","title":"\u9ad8\u65af\u7a20\u5bc6\u5316"},{"location":"cv/papers/3dgs/splatam/#_6","text":"\u57fa\u4e8e\u4f30\u8ba1\u7684\u5728\u7ebf\u76f8\u673a\u4f4d\u59ff\u4e0b\uff0c\u66f4\u65b0\u4e09\u7ef4\u9ad8\u65af\u5730\u56fe\u7684\u53c2\u6570\u3002\u901a\u8fc7\u53ef\u5fae\u6e32\u67d3\u548c\u57fa\u4e8e\u68af\u5ea6\u7684\u4f18\u5316\u6765\u5b9e\u73b0\uff0c \u548c\u8ddf\u8e2a\u4e0d\u540c\u7684\u662f\uff0c\u76f8\u673a\u4f4d\u59ff\u662f\u56fa\u5b9a\u7684\uff0c\u9ad8\u65af\u5206\u5e03\u7684\u53c2\u6570\u88ab\u66f4\u65b0 \u548c\u5df2\u77e5\u76f8\u673a\u4f4d\u59ff\u7684\u56fe\u50cf\u62df\u5408\u8f90\u5c04\u573a\u7684\u7ecf\u5178\u95ee\u9898\u76f8\u4f3c\uff0c\u6709\u4e24\u4e2a\u4f18\u5316\u7684\u5730\u65b9\uff1a \u4e0d\u662f\u4ece\u5934\u5f00\u59cb\uff0c\u800c\u662f\u4ece\u6700\u8fd1\u6784\u5efa\u7684\u5730\u56fe\u4e2d\u9884\u70ed\uff0c\u5f00\u59cb\u4f18\u5316 \u4e0d\u4f18\u5316\u6240\u6709\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff0c\u800c\u662f\u9009\u62e9\u53ef\u80fd\u5f71\u54cd\u65b0\u6dfb\u52a0\u7684\u9ad8\u65af\u5206\u5e03\u7684\u5e27\u3002\u5c06\u6bcf n \u5e27\u4fdd\u5b58\u4e3a\u5173\u952e\u5e27\uff0c\u5e76\u9009\u62e9 k \u5e27\u8fdb\u884c\u4f18\u5316\uff0c\u5305\u62ec\u5f53\u524d\u5e27\u3001\u6700\u8fd1\u7684\u5173\u952e\u5e27\uff0c\u4ee5\u53ca k\u22122 \u4e4b\u524d\u4e0e\u5f53\u524d\u5e27\u91cd\u53e0\u6700\u9ad8\u7684\u5173\u952e\u5e27\u3002\u91cd\u53e0\u662f\u901a\u8fc7\u53d6\u5f53\u524d\u5e27\u6df1\u5ea6\u56fe\u7684\u70b9\u4e91\uff0c\u5e76\u786e\u5b9a\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u9519\u8bef\u70b9\u6570\u6765\u786e\u5b9a\u7684 \u4f18\u5316\u548c\u8ddf\u8e2a\u7684\u635f\u5931\u76f8\u4f3c\uff0c\u4f46\u4e0d\u4f7f\u7528\u8f6e\u5ed3 mask\uff08\u56e0\u4e3a\u8981\u4f18\u5316\u6240\u6709\u50cf\u7d20\uff09\u3002\u53e6\u5916\u5728 RGB \u6e32\u67d3\u4e2d\u6dfb\u52a0\u4e00\u4e2a SSIM \u635f\u5931\uff0c\u5e76\u5254\u9664\u4e0d\u900f\u660e\u5ea6\u63a5\u8fd1 0 \u7684\u65e0\u7528\u9ad8\u65af\u5206\u5e03","title":"\u9ad8\u65af\u5730\u56fe\u66f4\u65b0"},{"location":"cv/papers/3dgs/splatam/#experiment","text":"","title":"Experiment"},{"location":"cv/papers/3dgs/splatam/#reference","text":"\u5b66\u4e60\u7b14\u8bb0\u4e4b\u2014\u20143D Gaussian SLAM\uff0cSplaTAM\u914d\u7f6e\uff08Linux\uff09\u4e0e\u6e90\u7801\u89e3\u8bfb-CSDN\u535a\u5ba2 \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014\u57fa\u4e8eTUM-RGBD\u6570\u636e\u96c6\u7684SplaTAM\u6d4b\u8bd5_jiyu tum-rgbd\u6570\u636e\u96c6\u7684splatam\u6d4b\u8bd5-CSDN\u535a\u5ba2 \u3010\u4e09\u7ef4\u91cd\u5efa\u3011\u3010SLAM\u3011SplaTAM\uff1a\u57fa\u4e8e3D\u9ad8\u65af\u7684\u5bc6\u96c6RGB-D SLAM(CVPR 2024)-CSDN\u535a\u5ba2 \u8bba\u6587\u590d\u73b0\u300aSplaTAM: Splat, Track & Map 3D Gaussians for Dense RGB-D SLAM\u300b_splatam\u8bba\u6587\u89e3\u6790-CSDN\u535a\u5ba2","title":"Reference"},{"location":"cv/papers/dynamic-slam/","text":"\u52a8\u6001 SLAM \u7cfb\u5217 \u00b6 Abstract \u52a8\u6001 SLAM \u7cfb\u5217\u76f8\u5173\u5185\u5bb9 Table of Contents \u00b6 DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM","title":"\u52a8\u6001 SLAM \u7cfb\u5217"},{"location":"cv/papers/dynamic-slam/#slam","text":"Abstract \u52a8\u6001 SLAM \u7cfb\u5217\u76f8\u5173\u5185\u5bb9","title":"\u52a8\u6001 SLAM \u7cfb\u5217"},{"location":"cv/papers/dynamic-slam/#table-of-contents","text":"DynaSLAM DS-SLAM Detect-SLAM FlowFusion RigidFusion Crowd-SLAM","title":"Table of Contents"},{"location":"cv/papers/dynamic-slam/crowd-slam/","text":"Crowd-SLAM \u00b6 \u7ea6 172 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a Crowd-SLAM: Visual SLAM Towards Crowded Environments using Object Detection code\uff1a Crowd-SLAM Idea \u00b6 \u52a8\u6001 SLAM + \u76ee\u6807\u68c0\u6d4b\uff08\u62e5\u6324\u7684\u4eba\u7fa4\uff09 \u57fa\u4e8e ORB-SLAM2\uff0c\u989d\u5916\u589e\u52a0\u4e00\u4e2a\u76ee\u6807\u68c0\u6d4b\u7ebf\u7a0b \u76ee\u6807\u68c0\u6d4b\u4f7f\u7528\u6539\u7248\u7684 YOLO\uff0c\u7528 Crowdhuman \u8bad\u7ec3\u7684 CYTi \u5c06\u8fb9\u754c\u6846\u91cc\u7684\u5173\u952e\u70b9\uff08\u4eba\u7684\u7279\u5f81\u70b9\uff09\u5168\u90e8\u89c6\u4e3a\u5916\u70b9\uff0c\u8fdb\u884c\u53bb\u9664 \u68c0\u67e5\u8fc7\u6ee4\u533a\u57df\u5e76\u66f4\u65b0\u7279\u5f81\u70b9\u6570\u91cf\uff0c\u7279\u5f81\u70b9\u7684\u4e2a\u6570\u4ece\u7ed9\u5b9a\u7684\u521d\u59cb\u503c\u5f00\u59cb\uff0c\u968f\u7740\u6ee4\u6ce2\u9762\u79ef\u589e\u52a0\u800c\u589e\u5927\uff0c300/30%\uff0c500/60%\uff0c700/90%\uff0c1200/95%\u3002 Experiments \u00b6 Drawbacks \u00b6 \u7531\u4e8e\u4eba\u7269\u7684\u59ff\u52bf\u548c\u76f8\u673a\u7684\u63a5\u8fd1\uff0c\u4eba\u7269\u5360\u636e\u56fe\u50cf\u5927\u90e8\u5206\u533a\u57df\uff0c\u5bfc\u81f4\u7279\u5f81\u8017\u5c3d \u4e0d\u8fc7\u6ee4\u9664\u4eba\u4e4b\u5916\u7684\u52a8\u6001\u7269\u4f53","title":"Crowd-SLAM"},{"location":"cv/papers/dynamic-slam/crowd-slam/#crowd-slam","text":"\u7ea6 172 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a Crowd-SLAM: Visual SLAM Towards Crowded Environments using Object Detection code\uff1a Crowd-SLAM","title":"Crowd-SLAM"},{"location":"cv/papers/dynamic-slam/crowd-slam/#idea","text":"\u52a8\u6001 SLAM + \u76ee\u6807\u68c0\u6d4b\uff08\u62e5\u6324\u7684\u4eba\u7fa4\uff09 \u57fa\u4e8e ORB-SLAM2\uff0c\u989d\u5916\u589e\u52a0\u4e00\u4e2a\u76ee\u6807\u68c0\u6d4b\u7ebf\u7a0b \u76ee\u6807\u68c0\u6d4b\u4f7f\u7528\u6539\u7248\u7684 YOLO\uff0c\u7528 Crowdhuman \u8bad\u7ec3\u7684 CYTi \u5c06\u8fb9\u754c\u6846\u91cc\u7684\u5173\u952e\u70b9\uff08\u4eba\u7684\u7279\u5f81\u70b9\uff09\u5168\u90e8\u89c6\u4e3a\u5916\u70b9\uff0c\u8fdb\u884c\u53bb\u9664 \u68c0\u67e5\u8fc7\u6ee4\u533a\u57df\u5e76\u66f4\u65b0\u7279\u5f81\u70b9\u6570\u91cf\uff0c\u7279\u5f81\u70b9\u7684\u4e2a\u6570\u4ece\u7ed9\u5b9a\u7684\u521d\u59cb\u503c\u5f00\u59cb\uff0c\u968f\u7740\u6ee4\u6ce2\u9762\u79ef\u589e\u52a0\u800c\u589e\u5927\uff0c300/30%\uff0c500/60%\uff0c700/90%\uff0c1200/95%\u3002","title":"Idea"},{"location":"cv/papers/dynamic-slam/crowd-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/dynamic-slam/crowd-slam/#drawbacks","text":"\u7531\u4e8e\u4eba\u7269\u7684\u59ff\u52bf\u548c\u76f8\u673a\u7684\u63a5\u8fd1\uff0c\u4eba\u7269\u5360\u636e\u56fe\u50cf\u5927\u90e8\u5206\u533a\u57df\uff0c\u5bfc\u81f4\u7279\u5f81\u8017\u5c3d \u4e0d\u8fc7\u6ee4\u9664\u4eba\u4e4b\u5916\u7684\u52a8\u6001\u7269\u4f53","title":"Drawbacks"},{"location":"cv/papers/dynamic-slam/detect-slam/","text":"Detect-SLAM \u00b6 \u7ea6 1402 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a Detect-SLAM: Making Object Detection and SLAM Mutually Beneficial code\uff1a Detect-SLAM Introduction \u00b6 \u5c06\u89c6\u89c9 SLAM \u4e0e\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc DNN \u7684\u76ee\u6807\u68c0\u6d4b\u7ed3\u5408\u3002 \u5229\u7528\u8bed\u4e49\u4fe1\u606f\u6d88\u9664 SLAM Pipeline \u4e2d\u79fb\u52a8\u5bf9\u8c61\u7684\u8d1f\u9762\u5f71\u54cd\u3002 \u9488\u5bf9\u8bed\u4e49\u4fe1\u606f\u7684\u65f6\u5ef6\u4e3b\u8981\u7531\u901a\u4fe1\u548c\u68c0\u6d4b\u5f15\u8d77\u7684\u95ee\u9898\uff0c\u63d0\u51fa\u4e86\u4e00\u79cd\u5b9e\u65f6\u4f20\u64ad\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\u7684\u65b9\u6cd5\u3002 \u7b2c\u4e00\u4e2a\u5c06 SLAM \u548c\u57fa\u4e8e DNN \u7684\u68c0\u6d4b\u5668\u7ed3\u5408\u8d77\u6765\u7684\u5de5\u4f5c\uff0c\u89e3\u51b3\uff1a \u63d0\u9ad8 SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u9c81\u68d2\u6027 \u6784\u5efa\u8bed\u4e49\u5730\u56fe \u63d0\u9ad8\u76ee\u6807\u68c0\u6d4b\u6027\u80fd Related Work \u00b6 SLAM Paschalis \u7b49\u4eba\u4e13\u6ce8\u4e8e 3D \u70b9\u4e91\uff0cSun \u7b49\u4eba\u5728 2D Patch \u4e0a\u3002\u5b83\u4eec\u90fd\u5305\u62ec\u5206\u5272\u548c\u989d\u5916\u83b7\u53d6\u79fb\u52a8\u5bf9\u8c61\u7684\u63a9\u7801\u3002 Detect SLAM \u7701\u7565\u4e86\u8fd9\u4e9b\u64cd\u4f5c\u5e76\u901a\u8fc7\u66f4\u65b0\u7279\u5f81\u7684\u79fb\u52a8\u6982\u7387\u6765\u8fc7\u6ee4\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\u7684\u7279\u5f81\uff0c\u662f\u57fa\u4e8e\u7279\u5f81\u7ea7\u8868\u793a\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u52a0\u9c81\u68d2\u548c\u9ad8\u6548\u7684\u3002 DNN Based Object Detection Faster R-CNN\u3001YOLOv2\u3001SSD Detect-SLAM \u4e2d\u90e8\u7f72 SSD \u4f5c\u4e3a\u68c0\u6d4b\u5668\u6a21\u5757 \u4e3a\u4e86\u514b\u670d SLAM \u548c\u68c0\u6d4b\u5668\u4e4b\u95f4\u7684\u5ef6\u8fdf\uff0c\u907f\u514d\u9010\u5e27\u68c0\u6d4b\uff0c\u5e76\u8003\u8651\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027 Combining SLAM and Object Detection Pillai \u8bbe\u8ba1\u4e86\u4e00\u4e2a\u652f\u6301 SLAM \u7684\u7269\u4f53\u8bc6\u522b\u7cfb\u7edf McCormac \u5c06 SLAM \u548c CNN \u7ed3\u5408\u8d77\u6765\uff0c\u9ad8\u6548\u751f\u6210\u8bed\u4e49 3D \u5730\u56fe Bowman \u5c06\u79bb\u6563\u8bc6\u522b\u548c\u6570\u636e\u5173\u8054\u95ee\u9898\u4e0e\u8fde\u7eed SLAM \u4f18\u5316\u6574\u5408\u5230\u4e00\u4e2a\u4f18\u5316\u95ee\u9898\uff0c\u5f97\u5230\u66f4\u7cbe\u786e\u7684\u8f68\u8ff9 Duncan \u521b\u5efa\u4e00\u79cd\u57fa\u4e8e\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee SLAM \u7cfb\u7edf\u4e2d\u5c3a\u5ea6\u6a21\u7cca\u548c\u6f02\u79fb\u95ee\u9898 Sucar \u5c06\u57fa\u4e8e\u5361\u5c14\u66fc\u6ee4\u6ce2\u7684\u5355\u76ee SLAM \u4e0e\u68c0\u6d4b\u5668\u63d0\u4f9b\u7684\u8bed\u4e49\u4fe1\u606f\u76f8\u7ed3\u5408\uff0c\u4ee5\u8d1d\u53f6\u65af\u65b9\u6848\u4f30\u8ba1 3D \u6a21\u578b\u7684\u5168\u5c40\u89c4\u6a21 Detect-SLAM \u00b6 Detect-SLAM \u4ee5 ORB-SLAM2 \u4e3a\u57fa\uff0c\u4e0e\u4e4b\u76f8\u6bd4\uff0c\u5305\u62ec\u4e09\u4e2a\u65b0\u6d41\u7a0b\uff1a \u52a8\u6001\u7269\u4f53\u53bb\u9664\uff0c\u8fc7\u6ee4\u6389\u4e0e\u52a8\u6001\u7269\u4f53\u76f8\u5173\u7684\u7279\u5f81\uff1b \u5bf9\u8c61\u5efa\u56fe\uff0c\u91cd\u5efa\u5728\u5173\u952e\u5e27\u4e2d\u88ab\u68c0\u6d4b\u5230\u7684\u9759\u6001\u7269\u4f53\uff0c\u7531\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u7a20\u5bc6\u70b9\u4e91\u7ec4\u6210\uff1b SLAM \u589e\u5f3a\u68c0\u6d4b\u5668\uff0c\u5229\u7528\u5bf9\u8c61\u5730\u56fe\u4f5c\u4e3a\u5148\u9a8c\u77e5\u8bc6\u6765\u63d0\u9ad8\u5728\u5177\u6709\u6311\u6218\u6027\u7684\u73af\u5883\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\uff1b Moving Objects Removal \u00b6 \u9488\u5bf9\u9010\u5e27\u4f7f\u7528 SSD \u76ee\u6807\u68c0\u6d4b\u6574\u4e2a\u7cfb\u7edf\u7684\u901f\u5ea6\u4e5f\u53ea\u6709 3FPS\uff0c\u8fd9\u4e00\u90e8\u5206\u63d0\u51fa\u4e24\u4e2a\u7b56\u7565\u89e3\u51b3\uff1a \u4ec5\u5728\u5173\u952e\u5e27\u4e2d\u505a\u76ee\u6807\u68c0\u6d4b\uff0c\u7136\u540e\u66f4\u65b0\u5c40\u90e8\u5730\u56fe\u4e2d\u70b9\u7684\u79fb\u52a8\u6982\u7387\u4ee5\u52a0\u901f\u7ebf\u7a0b\uff1b \u5728\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\u524d\uff0c\u901a\u8fc7\u7279\u5f81\u5339\u914d\u548c\u5339\u914d\u70b9\u6269\u5c55\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\uff0c\u6709\u6548\u5730\u53bb\u9664\u52a8\u6001\u7269\u4f53\u4e0a\u63d0\u53d6\u7684\u7279\u5f81\uff1b \u628a\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u7279\u5f81\u70b9\u7684\u6982\u7387\u79f0\u4e3a\u8fd0\u52a8\u6982\u7387\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6211\u4eec\u6839\u636e\u79fb\u52a8\u6982\u7387\u5c06\u8fd9\u4e9b\u5173\u952e\u70b9\u533a\u5206\u4e3a\u56db\u79cd\u72b6\u6001\u3002\u5728\u5339\u914d\u70b9\u6269\u5c55\u4e2d\u4f7f\u7528\u4e24\u4e2a\u9ad8\u7f6e\u4fe1\u5ea6\u70b9\u5c06\u79fb\u52a8\u6982\u7387\u4f20\u64ad\u5230\u76f8\u90bb\u7684\u4e0d\u5339\u914d\u70b9\u3002\u5728\u6bcf\u4e2a\u70b9\u901a\u8fc7\u4f20\u64ad\u83b7\u5f97\u79fb\u52a8\u6982\u7387\u540e\uff0c\u6211\u4eec\u79fb\u9664\u6240\u6709\u52a8\u6001\u70b9\uff0c\u5e76\u4f7f\u7528RANSAC\u8fc7\u6ee4\u5176\u4ed6\u5f02\u5e38\u503c\u4ee5\u8fdb\u884c\u59ff\u6001\u4f30\u8ba1\u3002 Updating Moving Probability \u8003\u8651\u5230\u68c0\u6d4b\u7684\u5ef6\u8fdf\u548c\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027\uff0c\u53ea\u9009\u62e9\u5173\u952e\u5e27\u7684\u5f69\u8272\u56fe\u50cf\uff0c\u901a\u8fc7 DNN \u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\u548c\u524d\u5411\u4f20\u64ad\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u9010\u5e27\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\u3002\u4e00\u65e6\u83b7\u5f97\u68c0\u6d4b\u7ed3\u679c\uff0c\u6211\u4eec\u5c06\u5173\u952e\u5e27\u63d2\u5165\u672c\u5730\u5730\u56fe\u5e76\u66f4\u65b0\u672c\u5730\u5730\u56fe\u4e2d\u7684\u79fb\u52a8\u6982\u7387\u3002\u66f4\u65b0\u5728\u5173\u952e\u5e27\u4e2d\u627e\u5230\u5339\u914d\u5173\u952e\u70b9\u7684 3D \u70b9\u7684\u6982\u7387\uff1a \\[ P_t(X^i)=(1-\\alpha)P_{t-1}(X^i)+\\alpha S_t(X^i) \\quad \\quad \u672c\u6587\u4e2d\u9009\u62e9 \\quad \\alpha = 0.3 \\] Moving Probability Propagation \u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\uff0c\u901a\u8fc7\u4e24\u4e2a\u64cd\u4f5c\u9010\u5e27\u4f30\u8ba1\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\uff1a \u7279\u5f81\u5339\u914d \u5339\u914d\u70b9\u6269\u5c55\uff08\u79fb\u52a8\u6982\u7387\u4f20\u64ad\uff09 Mapping Objects \u00b6 Predicting Region ID \u9884\u6d4b\u56fe\u50cf\u7a7a\u95f4\u4e2d\u6bcf\u4e2a\u68c0\u6d4b\u5230\u7684\u533a\u57df\u7684\u5bf9\u8c61 ID\u3002\u533a\u57df ID \u9884\u6d4b\u7684\u76ee\u7684\u662f\u5728\u5bf9\u8c61\u56fe\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u5bf9\u8c61 ID\uff0c\u6216\u8005\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u68c0\u6d4b\u5230\u5219\u751f\u6210\u4e00\u4e2a\u65b0\u7684 ID\u3002 \u5bf9\u8c61 ID \u9884\u6d4b\u57fa\u4e8e\u51e0\u4f55\u5047\u8bbe\uff0c\u5373\u5982\u679c\u4e24\u4e2a\u533a\u57df\u5c5e\u4e8e\u540c\u4e00\u5bf9\u8c61\uff0c\u5219\u6295\u5f71\u548c\u68c0\u6d4b\u533a\u57df\u5e94\u8be5\u91cd\u53e0\u3002\uff08\u7528 IOU \u5904\u7406\uff09 Cutting Background \u5c3d\u7ba1\u68c0\u6d4b\u5668\u63d0\u4f9b\u4e86\u56fe\u50cf\u4e2d\u5bf9\u8c61\u7684\u8fb9\u754c\u6846\uff0c\u4f46\u5b83\u662f\u4e00\u4e2a\u77e9\u5f62\u6846\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e9b\u610f\u60f3\u4e0d\u5230\u7684\u80cc\u666f\uff0c\u7528\u4e8e\u6784\u5efa\u5e72\u51c0\u7684\u5bf9\u8c61\u56fe\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u4f7f\u7528 Grab - Cut \u7b97\u6cd5\u5206\u5272\u80cc\u666f\uff0c\u5c06\u91cd\u53e0\u533a\u57df\u4e2d\u5148\u524d\u91cd\u5efa\u5bf9\u8c61\u6295\u5f71\u7684\u70b9\u4f5c\u4e3a\u524d\u666f\u79cd\u5b50\uff0c\u5c06\u8fb9\u754c\u6846\u5916\u7684\u70b9\u4f5c\u4e3a\u80cc\u666f\u3002\u7136\u540e\u6211\u4eec\u4ece\u8fb9\u754c\u6846\u4e2d\u5f97\u5230\u4e00\u4e2a\u76ee\u6807\u5bf9\u8c61\u7684\u6bb5\u63a9\u7801\uff0c\u7ecf\u8fc7\u4e09\u6b21\u8fed\u4ee3\u3002 Reconstruction \u5229\u7528\u5bf9\u8c61\u63a9\u7801\uff0c\u521b\u5efa\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u5bf9\u8c61\u70b9\u4e91\uff0c\u5e76\u8fc7\u6ee4 3D \u7a7a\u95f4\u4e2d\u7684\u566a\u58f0\u70b9\u3002\u6700\u540e\uff0c\u5c06\u7269\u4f53\u70b9\u4e91\u8f6c\u6362\u4e3a\u5e26\u6709\u76f8\u673a\u4f4d\u59ff\u7684\u4e16\u754c\u5750\u6807\uff0c\u5e76\u5c06\u5b83\u4eec\u63d2\u5165\u5230\u7269\u4f53\u5730\u56fe\u4e2d\u3002 SLAM-enhanced Detector \u00b6 Region Proposal \u6bcf\u4e2a\u76ee\u6807\u533a\u57df\u662f\u901a\u8fc7 3D \u76ee\u6807\u56fe\u6295\u5f71\u5230 2D \u5e73\u9762\u63d0\u51fa\u7684\uff0c\u8ddf\u8e2a\u4f30\u8ba1\u5f53\u524d\u76f8\u673a\u4f4d\u59ff\u3002\u5bf9\u5177\u6709\u76f8\u540c\u5bf9\u8c61 ID \u7684\u50cf\u7d20\u8fdb\u884c\u805a\u7c7b\u6765\u63d0\u51fa\u53ef\u80fd\u5305\u542b\u5bf9\u8c61\u7684\u5019\u9009\u533a\u57df\u3002 Region Filter \u6709\u4e0d\u5728\u9884\u671f\u7684\u533a\u57df\u88ab\u63d0\u51fa\uff0c\u56e0\u6b64\u9700\u8981\u5254\u9664\u533a\u57df\u5927\u5c0f 20x20 px \u7684\u5c0f\u5019\u9009\u6846\u3002 Hard Example Mining \u5bf9\u539f\u59cbSSD\u7f51\u7edc\u8fdb\u884c\u5fae\u8c03\uff0c\u4ee5\u63d0\u9ad8\u7c7b\u4f3c\u573a\u666f\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\u3002 Experiment \u00b6 \u7565","title":"Detect-SLAM"},{"location":"cv/papers/dynamic-slam/detect-slam/#detect-slam","text":"\u7ea6 1402 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a Detect-SLAM: Making Object Detection and SLAM Mutually Beneficial code\uff1a Detect-SLAM","title":"Detect-SLAM"},{"location":"cv/papers/dynamic-slam/detect-slam/#introduction","text":"\u5c06\u89c6\u89c9 SLAM \u4e0e\u6df1\u5ea6\u795e\u7ecf\u7f51\u7edc DNN \u7684\u76ee\u6807\u68c0\u6d4b\u7ed3\u5408\u3002 \u5229\u7528\u8bed\u4e49\u4fe1\u606f\u6d88\u9664 SLAM Pipeline \u4e2d\u79fb\u52a8\u5bf9\u8c61\u7684\u8d1f\u9762\u5f71\u54cd\u3002 \u9488\u5bf9\u8bed\u4e49\u4fe1\u606f\u7684\u65f6\u5ef6\u4e3b\u8981\u7531\u901a\u4fe1\u548c\u68c0\u6d4b\u5f15\u8d77\u7684\u95ee\u9898\uff0c\u63d0\u51fa\u4e86\u4e00\u79cd\u5b9e\u65f6\u4f20\u64ad\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\u7684\u65b9\u6cd5\u3002 \u7b2c\u4e00\u4e2a\u5c06 SLAM \u548c\u57fa\u4e8e DNN \u7684\u68c0\u6d4b\u5668\u7ed3\u5408\u8d77\u6765\u7684\u5de5\u4f5c\uff0c\u89e3\u51b3\uff1a \u63d0\u9ad8 SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u9c81\u68d2\u6027 \u6784\u5efa\u8bed\u4e49\u5730\u56fe \u63d0\u9ad8\u76ee\u6807\u68c0\u6d4b\u6027\u80fd","title":"Introduction"},{"location":"cv/papers/dynamic-slam/detect-slam/#related-work","text":"SLAM Paschalis \u7b49\u4eba\u4e13\u6ce8\u4e8e 3D \u70b9\u4e91\uff0cSun \u7b49\u4eba\u5728 2D Patch \u4e0a\u3002\u5b83\u4eec\u90fd\u5305\u62ec\u5206\u5272\u548c\u989d\u5916\u83b7\u53d6\u79fb\u52a8\u5bf9\u8c61\u7684\u63a9\u7801\u3002 Detect SLAM \u7701\u7565\u4e86\u8fd9\u4e9b\u64cd\u4f5c\u5e76\u901a\u8fc7\u66f4\u65b0\u7279\u5f81\u7684\u79fb\u52a8\u6982\u7387\u6765\u8fc7\u6ee4\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\u7684\u7279\u5f81\uff0c\u662f\u57fa\u4e8e\u7279\u5f81\u7ea7\u8868\u793a\u7684\uff0c\u5e76\u4e14\u53ef\u4ee5\u66f4\u52a0\u9c81\u68d2\u548c\u9ad8\u6548\u7684\u3002 DNN Based Object Detection Faster R-CNN\u3001YOLOv2\u3001SSD Detect-SLAM \u4e2d\u90e8\u7f72 SSD \u4f5c\u4e3a\u68c0\u6d4b\u5668\u6a21\u5757 \u4e3a\u4e86\u514b\u670d SLAM \u548c\u68c0\u6d4b\u5668\u4e4b\u95f4\u7684\u5ef6\u8fdf\uff0c\u907f\u514d\u9010\u5e27\u68c0\u6d4b\uff0c\u5e76\u8003\u8651\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027 Combining SLAM and Object Detection Pillai \u8bbe\u8ba1\u4e86\u4e00\u4e2a\u652f\u6301 SLAM \u7684\u7269\u4f53\u8bc6\u522b\u7cfb\u7edf McCormac \u5c06 SLAM \u548c CNN \u7ed3\u5408\u8d77\u6765\uff0c\u9ad8\u6548\u751f\u6210\u8bed\u4e49 3D \u5730\u56fe Bowman \u5c06\u79bb\u6563\u8bc6\u522b\u548c\u6570\u636e\u5173\u8054\u95ee\u9898\u4e0e\u8fde\u7eed SLAM \u4f18\u5316\u6574\u5408\u5230\u4e00\u4e2a\u4f18\u5316\u95ee\u9898\uff0c\u5f97\u5230\u66f4\u7cbe\u786e\u7684\u8f68\u8ff9 Duncan \u521b\u5efa\u4e00\u79cd\u57fa\u4e8e\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee\u7684\u65b9\u6cd5\uff0c\u4f7f\u7528\u76ee\u6807\u68c0\u6d4b\u5668\u6765\u89e3\u51b3\u4f20\u7edf\u5355\u76ee SLAM \u7cfb\u7edf\u4e2d\u5c3a\u5ea6\u6a21\u7cca\u548c\u6f02\u79fb\u95ee\u9898 Sucar \u5c06\u57fa\u4e8e\u5361\u5c14\u66fc\u6ee4\u6ce2\u7684\u5355\u76ee SLAM \u4e0e\u68c0\u6d4b\u5668\u63d0\u4f9b\u7684\u8bed\u4e49\u4fe1\u606f\u76f8\u7ed3\u5408\uff0c\u4ee5\u8d1d\u53f6\u65af\u65b9\u6848\u4f30\u8ba1 3D \u6a21\u578b\u7684\u5168\u5c40\u89c4\u6a21","title":"Related Work"},{"location":"cv/papers/dynamic-slam/detect-slam/#detect-slam_1","text":"Detect-SLAM \u4ee5 ORB-SLAM2 \u4e3a\u57fa\uff0c\u4e0e\u4e4b\u76f8\u6bd4\uff0c\u5305\u62ec\u4e09\u4e2a\u65b0\u6d41\u7a0b\uff1a \u52a8\u6001\u7269\u4f53\u53bb\u9664\uff0c\u8fc7\u6ee4\u6389\u4e0e\u52a8\u6001\u7269\u4f53\u76f8\u5173\u7684\u7279\u5f81\uff1b \u5bf9\u8c61\u5efa\u56fe\uff0c\u91cd\u5efa\u5728\u5173\u952e\u5e27\u4e2d\u88ab\u68c0\u6d4b\u5230\u7684\u9759\u6001\u7269\u4f53\uff0c\u7531\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u7a20\u5bc6\u70b9\u4e91\u7ec4\u6210\uff1b SLAM \u589e\u5f3a\u68c0\u6d4b\u5668\uff0c\u5229\u7528\u5bf9\u8c61\u5730\u56fe\u4f5c\u4e3a\u5148\u9a8c\u77e5\u8bc6\u6765\u63d0\u9ad8\u5728\u5177\u6709\u6311\u6218\u6027\u7684\u73af\u5883\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\uff1b","title":"Detect-SLAM"},{"location":"cv/papers/dynamic-slam/detect-slam/#moving-objects-removal","text":"\u9488\u5bf9\u9010\u5e27\u4f7f\u7528 SSD \u76ee\u6807\u68c0\u6d4b\u6574\u4e2a\u7cfb\u7edf\u7684\u901f\u5ea6\u4e5f\u53ea\u6709 3FPS\uff0c\u8fd9\u4e00\u90e8\u5206\u63d0\u51fa\u4e24\u4e2a\u7b56\u7565\u89e3\u51b3\uff1a \u4ec5\u5728\u5173\u952e\u5e27\u4e2d\u505a\u76ee\u6807\u68c0\u6d4b\uff0c\u7136\u540e\u66f4\u65b0\u5c40\u90e8\u5730\u56fe\u4e2d\u70b9\u7684\u79fb\u52a8\u6982\u7387\u4ee5\u52a0\u901f\u7ebf\u7a0b\uff1b \u5728\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\u524d\uff0c\u901a\u8fc7\u7279\u5f81\u5339\u914d\u548c\u5339\u914d\u70b9\u6269\u5c55\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\uff0c\u6709\u6548\u5730\u53bb\u9664\u52a8\u6001\u7269\u4f53\u4e0a\u63d0\u53d6\u7684\u7279\u5f81\uff1b \u628a\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u7279\u5f81\u70b9\u7684\u6982\u7387\u79f0\u4e3a\u8fd0\u52a8\u6982\u7387\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u6211\u4eec\u6839\u636e\u79fb\u52a8\u6982\u7387\u5c06\u8fd9\u4e9b\u5173\u952e\u70b9\u533a\u5206\u4e3a\u56db\u79cd\u72b6\u6001\u3002\u5728\u5339\u914d\u70b9\u6269\u5c55\u4e2d\u4f7f\u7528\u4e24\u4e2a\u9ad8\u7f6e\u4fe1\u5ea6\u70b9\u5c06\u79fb\u52a8\u6982\u7387\u4f20\u64ad\u5230\u76f8\u90bb\u7684\u4e0d\u5339\u914d\u70b9\u3002\u5728\u6bcf\u4e2a\u70b9\u901a\u8fc7\u4f20\u64ad\u83b7\u5f97\u79fb\u52a8\u6982\u7387\u540e\uff0c\u6211\u4eec\u79fb\u9664\u6240\u6709\u52a8\u6001\u70b9\uff0c\u5e76\u4f7f\u7528RANSAC\u8fc7\u6ee4\u5176\u4ed6\u5f02\u5e38\u503c\u4ee5\u8fdb\u884c\u59ff\u6001\u4f30\u8ba1\u3002 Updating Moving Probability \u8003\u8651\u5230\u68c0\u6d4b\u7684\u5ef6\u8fdf\u548c\u8fde\u7eed\u5e27\u7684\u65f6\u7a7a\u4e00\u81f4\u6027\uff0c\u53ea\u9009\u62e9\u5173\u952e\u5e27\u7684\u5f69\u8272\u56fe\u50cf\uff0c\u901a\u8fc7 DNN \u5bf9\u56fe\u50cf\u8fdb\u884c\u9884\u5904\u7406\u548c\u524d\u5411\u4f20\u64ad\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u9010\u5e27\u4f20\u64ad\u8fd0\u52a8\u6982\u7387\u3002\u4e00\u65e6\u83b7\u5f97\u68c0\u6d4b\u7ed3\u679c\uff0c\u6211\u4eec\u5c06\u5173\u952e\u5e27\u63d2\u5165\u672c\u5730\u5730\u56fe\u5e76\u66f4\u65b0\u672c\u5730\u5730\u56fe\u4e2d\u7684\u79fb\u52a8\u6982\u7387\u3002\u66f4\u65b0\u5728\u5173\u952e\u5e27\u4e2d\u627e\u5230\u5339\u914d\u5173\u952e\u70b9\u7684 3D \u70b9\u7684\u6982\u7387\uff1a \\[ P_t(X^i)=(1-\\alpha)P_{t-1}(X^i)+\\alpha S_t(X^i) \\quad \\quad \u672c\u6587\u4e2d\u9009\u62e9 \\quad \\alpha = 0.3 \\] Moving Probability Propagation \u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\uff0c\u901a\u8fc7\u4e24\u4e2a\u64cd\u4f5c\u9010\u5e27\u4f30\u8ba1\u6bcf\u4e2a\u5173\u952e\u70b9\u7684\u79fb\u52a8\u6982\u7387\uff1a \u7279\u5f81\u5339\u914d \u5339\u914d\u70b9\u6269\u5c55\uff08\u79fb\u52a8\u6982\u7387\u4f20\u64ad\uff09","title":"Moving Objects Removal"},{"location":"cv/papers/dynamic-slam/detect-slam/#mapping-objects","text":"Predicting Region ID \u9884\u6d4b\u56fe\u50cf\u7a7a\u95f4\u4e2d\u6bcf\u4e2a\u68c0\u6d4b\u5230\u7684\u533a\u57df\u7684\u5bf9\u8c61 ID\u3002\u533a\u57df ID \u9884\u6d4b\u7684\u76ee\u7684\u662f\u5728\u5bf9\u8c61\u56fe\u4e2d\u627e\u5230\u5bf9\u5e94\u7684\u5bf9\u8c61 ID\uff0c\u6216\u8005\u5982\u679c\u662f\u7b2c\u4e00\u6b21\u68c0\u6d4b\u5230\u5219\u751f\u6210\u4e00\u4e2a\u65b0\u7684 ID\u3002 \u5bf9\u8c61 ID \u9884\u6d4b\u57fa\u4e8e\u51e0\u4f55\u5047\u8bbe\uff0c\u5373\u5982\u679c\u4e24\u4e2a\u533a\u57df\u5c5e\u4e8e\u540c\u4e00\u5bf9\u8c61\uff0c\u5219\u6295\u5f71\u548c\u68c0\u6d4b\u533a\u57df\u5e94\u8be5\u91cd\u53e0\u3002\uff08\u7528 IOU \u5904\u7406\uff09 Cutting Background \u5c3d\u7ba1\u68c0\u6d4b\u5668\u63d0\u4f9b\u4e86\u56fe\u50cf\u4e2d\u5bf9\u8c61\u7684\u8fb9\u754c\u6846\uff0c\u4f46\u5b83\u662f\u4e00\u4e2a\u77e9\u5f62\u6846\uff0c\u5176\u4e2d\u5305\u542b\u4e00\u4e9b\u610f\u60f3\u4e0d\u5230\u7684\u80cc\u666f\uff0c\u7528\u4e8e\u6784\u5efa\u5e72\u51c0\u7684\u5bf9\u8c61\u56fe\u3002\u56e0\u6b64\uff0c\u6211\u4eec\u4f7f\u7528 Grab - Cut \u7b97\u6cd5\u5206\u5272\u80cc\u666f\uff0c\u5c06\u91cd\u53e0\u533a\u57df\u4e2d\u5148\u524d\u91cd\u5efa\u5bf9\u8c61\u6295\u5f71\u7684\u70b9\u4f5c\u4e3a\u524d\u666f\u79cd\u5b50\uff0c\u5c06\u8fb9\u754c\u6846\u5916\u7684\u70b9\u4f5c\u4e3a\u80cc\u666f\u3002\u7136\u540e\u6211\u4eec\u4ece\u8fb9\u754c\u6846\u4e2d\u5f97\u5230\u4e00\u4e2a\u76ee\u6807\u5bf9\u8c61\u7684\u6bb5\u63a9\u7801\uff0c\u7ecf\u8fc7\u4e09\u6b21\u8fed\u4ee3\u3002 Reconstruction \u5229\u7528\u5bf9\u8c61\u63a9\u7801\uff0c\u521b\u5efa\u5206\u914d\u6709\u5bf9\u8c61 ID \u7684\u5bf9\u8c61\u70b9\u4e91\uff0c\u5e76\u8fc7\u6ee4 3D \u7a7a\u95f4\u4e2d\u7684\u566a\u58f0\u70b9\u3002\u6700\u540e\uff0c\u5c06\u7269\u4f53\u70b9\u4e91\u8f6c\u6362\u4e3a\u5e26\u6709\u76f8\u673a\u4f4d\u59ff\u7684\u4e16\u754c\u5750\u6807\uff0c\u5e76\u5c06\u5b83\u4eec\u63d2\u5165\u5230\u7269\u4f53\u5730\u56fe\u4e2d\u3002","title":"Mapping Objects"},{"location":"cv/papers/dynamic-slam/detect-slam/#slam-enhanced-detector","text":"Region Proposal \u6bcf\u4e2a\u76ee\u6807\u533a\u57df\u662f\u901a\u8fc7 3D \u76ee\u6807\u56fe\u6295\u5f71\u5230 2D \u5e73\u9762\u63d0\u51fa\u7684\uff0c\u8ddf\u8e2a\u4f30\u8ba1\u5f53\u524d\u76f8\u673a\u4f4d\u59ff\u3002\u5bf9\u5177\u6709\u76f8\u540c\u5bf9\u8c61 ID \u7684\u50cf\u7d20\u8fdb\u884c\u805a\u7c7b\u6765\u63d0\u51fa\u53ef\u80fd\u5305\u542b\u5bf9\u8c61\u7684\u5019\u9009\u533a\u57df\u3002 Region Filter \u6709\u4e0d\u5728\u9884\u671f\u7684\u533a\u57df\u88ab\u63d0\u51fa\uff0c\u56e0\u6b64\u9700\u8981\u5254\u9664\u533a\u57df\u5927\u5c0f 20x20 px \u7684\u5c0f\u5019\u9009\u6846\u3002 Hard Example Mining \u5bf9\u539f\u59cbSSD\u7f51\u7edc\u8fdb\u884c\u5fae\u8c03\uff0c\u4ee5\u63d0\u9ad8\u7c7b\u4f3c\u573a\u666f\u4e2d\u7684\u68c0\u6d4b\u6027\u80fd\u3002","title":"SLAM-enhanced Detector"},{"location":"cv/papers/dynamic-slam/detect-slam/#experiment","text":"\u7565","title":"Experiment"},{"location":"cv/papers/dynamic-slam/ds-slam/","text":"DS-SLAM \u00b6 \u7ea6 2274 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract paper\uff1a DS-SLAM: A Semantic Visual SLAM towards Dynamic Environments code\uff1a DS-SLAM Introduction \u00b6 \u4f7f\u7528\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u548c\u5149\u6d41\u76f8\u7ed3\u5408\u7684\u65b9\u6cd5\u51cf\u5c11\u89c6\u89c9 SLAM \u4e2d\u52a8\u6001\u7269\u4f53\u9020\u6210\u7684\u5f71\u54cd\u3002 \u57fa\u4e8eORB-SLAM2\u63d0\u51fa\u4e86\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b8c\u6574\u8bed\u4e49SLAM\u7cfb\u7edf\uff08DS-SLAM\uff09\uff0c\u53ef\u4ee5\u51cf\u5c11\u52a8\u6001\u5bf9\u8c61\u5bf9\u59ff\u6001\u4f30\u8ba1\u7684\u5f71\u54cd\u3002 \u8be5\u7cfb\u7edf\u7684\u6709\u6548\u6027\u5728 TUM RGB-D \u6570\u636e\u96c6 \u4e0a\u8fdb\u884c\u8bc4\u4f30\u3002 \u7ed3\u679c\u8868\u660e\uff0cDS-SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\u65b9\u9762\u660e\u663e\u4f18\u4e8e ORB-SLAM2\u3002 \u8be5\u7cfb\u7edf\u8fd8\u4e0e\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u96c6\u6210\uff0c\u5e76\u901a\u8fc7\u5728\u771f\u5b9e\u73af\u5883\u4e2d\u5bf9\u673a\u5668\u4eba\u8fdb\u884c DS-SLAM \u6d4b\u8bd5\u6765\u9a8c\u8bc1\u5176\u6027\u80fd\u3002 2.\u5c06\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u5355\u72ec\u7684\u653e\u5728\u4e00\u4e2a\u7ebf\u7a0b\u5f53\u4e2d\uff0c\u5c06\u8bed\u4e49\u5206\u5272\u548c\u8fd0\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7684\u65b9\u6cd5\uff08\u5149\u6d41\u6cd5\uff08\u901a\u8fc7\u8ba1\u7b97\u5149\u6d41\u7684\u4e0d\u4e00\u81f4\u6027\u6765\u533a\u5206\u9759\u6001\u80cc\u666f\u548c\u8fd0\u52a8\u76ee\u6807\uff09\uff09\u76f8\u7ed3\u5408\uff0c\u8fc7\u6ee4\u6389\u573a\u666f\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u3002\u4ece\u800c\u63d0\u9ad8\u4e86\u5b9a\u4f4d\u6a21\u5757\u548c\u5efa\u56fe\u6a21\u5757\u5728\u52a8\u6001\u573a\u666f\u4e0b\u7684\u9c81\u68d2\u6027\u548c\u51c6\u786e\u6027\u3002 DS-SLAM \u521b\u5efa\u4e00\u4e2a\u5355\u72ec\u7684\u7ebf\u7a0b\u6765\u6784\u5efa\u4e00\u4e2a\u5bc6\u96c6\u7684\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe \u3002\u5bc6\u96c6\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe\u91c7\u7528 log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09 \u65b9\u6cd5\u8fc7\u6ee4\u6389\u4e0d\u7a33\u5b9a\u7684\u4f53\u7d20\u5e76\u66f4\u65b0\u8fd9\u4e9b\u4f53\u7d20\u7684\u8bed\u4e49\u3002 RELATED WORK \u00b6 \u5728\u4ee5\u524d\u7684\u5de5\u4f5c\u4e2d\uff0c\u8bed\u4e49\u56fe\u901a\u5e38\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u51e0\u4f55\u90e8\u5206\u548c\u8bed\u4e49\u90e8\u5206\u3002\u8bed\u4e49\u65b9\u6cd5\u9884\u5148\u8bad\u7ec3\u4e86\u5bf9\u8c61\u8bc6\u522b\u5b50\u7cfb\u7edf\uff0c\u5e76\u5c06\u8bed\u4e49\u4fe1\u606f\u9644\u52a0\u5230\u8bc6\u522b\u7684\u5bf9\u8c61\u6a21\u578b\u4e0a\u3002\u4ed6\u4eec\u7684\u5de5\u4f5c\u4ec5\u96c6\u4e2d\u5728\u8bed\u4e49\u6620\u5c04\u548c\u5bf9\u8c61\u8bc6\u522b\u4e0a\uff0c\u800c\u8bed\u4e49\u4fe1\u606f\u5728\u5176\u4ed6\u90e8\u5206\u7684\u4fe1\u606f\u5374\u6ca1\u6709\u5f88\u597d\u5730\u4f7f\u7528\u3002\u8fd1\u671f\u5de5\u4f5c\u5229\u7528\u573a\u666f\u4e2d\u7684\u51e0\u4f55\u5c5e\u6027\u548c\u8bed\u4e49\u5c5e\u6027\u5171\u540c\u4f30\u8ba1\u76f8\u673a\u7684\u59ff\u52bf\uff0c\u70b9\u548c\u5bf9\u8c61\uff0c\u4ece\u800c\u663e\u8457\u63d0\u9ad8\u4e86\u5bf9\u8c61\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u8bed\u4e49\u4fe1\u606f\u4e0d\u4ec5\u7528\u4e8e\u751f\u6210\u57fa\u4e8e\u516b\u53c9\u6811\u7684\u73af\u5883\u8868\u793a\uff0c\u800c\u4e14\u8fd8\u7528\u4e8e\u5728\u52a8\u6001\u73af\u5883\u4e2d\u8ddf\u8e2a\u8fc7\u7a0b\u4e2d\u8fc7\u6ee4\u5f02\u5e38\u503c\u3002 SYSTEM INTRUDUCTION \u00b6 Framework of DS-SLAM \u00b6 Kinect2\u6355\u83b7\u7684\u539f\u59cbRGB\u56fe\u50cf\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u548c\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u4e2d\u540c\u65f6\u8fdb\u884c\u5904\u7406\u3002\u8ddf\u8e2a\u7ebf\u7a0b\u9996\u5148\u63d0\u53d6ORB\u7279\u5f81\u70b9\uff0c\u7136\u540e\u7c97\u7565\u68c0\u67e5\u7279\u5f81\u70b9\u7684\u79fb\u52a8\u4e00\u81f4\u6027\u5e76\u4fdd\u5b58\u6f5c\u5728\u7684\u5f02\u5e38\u503c\u3002\u7136\u540e\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u5177\u6709\u7531\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u9884\u6d4b\u7684\u50cf\u7d20\u7ea7\u8bed\u4e49\u6807\u7b7e\u7684\u56fe\u50cf\u3002\u5206\u5272\u7ed3\u679c\u5230\u8fbe\u540e\uff0c\u5c06\u6839\u636e\u5206\u5272\u7ed3\u679c\u548c\u4e4b\u524d\u68c0\u6d4b\u5230\u7684\u6f5c\u5728\u5f02\u5e38\u503c\uff0c\u4e22\u5f03\u4f4d\u4e8e\u8fd0\u52a8\u7269\u4f53\u4e2d\u7684ORB\u7279\u5f81\u70b9\u5f02\u5e38\u503c\u3002\u7136\u540e\uff0c\u901a\u8fc7\u5339\u914d\u5176\u4f59\u7684\u7a33\u5b9a\u7279\u5f81\u70b9\u6765\u8ba1\u7b97\u53d8\u6362\u77e9\u9635\u3002 Semantic Segmentation \u00b6 DS-SLAM\u91c7\u7528SegNet\u63d0\u4f9b\u57fa\u4e8ecaffe\u7684\u50cf\u7d20\u7ea7\u5b9e\u65f6\u8bed\u4e49\u5206\u5272\u3002\u5728PASCAL VOC\u6570\u636e\u96c6\u4e0a\u8bad\u7ec3\u7684SegNet\u603b\u5171\u53ef\u4ee5\u5206\u527220\u4e2a\u7c7b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4eba\u6700\u6709\u53ef\u80fd\u662f\u52a8\u6001\u5bf9\u8c61\uff0c\u56e0\u6b64\u6211\u4eec\u5047\u8bbe\u4f4d\u4e8e\u4eba\u8eab\u4e0a\u7684\u7279\u5f81\u70b9\u6700\u6709\u53ef\u80fd\u662f\u5f02\u5e38\u503c\u3002 Moving Consistency Check \u00b6 \u7ecf\u8fc7\u8bed\u4e49\u5206\u5272\u7684\u6a21\u5757\u540e\uff0c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u5206\u5272\u7684Mask\u7684\uff0c\u6240\u4ee5\u73b0\u5728\u7684\u4efb\u52a1\u5c31\u662f\u53bb\u786e\u5b9a\uff0c\u67d0\u4e2a\u5173\u952e\u70b9\u662f\u5426\u662f\u79fb\u52a8\u7684\uff0c\u5982\u679c\u6709\u4e00\u5b9a\u6570\u91cf\u7684\u79fb\u52a8\u70b9\u843d\u5728\u4e86\u67d0\u4e00\u4e2a\u5206\u5272\u51fa\u6765\u7684\u7269\u4f53\u8f6e\u5ed3\u5185\u90e8\uff0c\u90a3\u8fd9\u4e2a\u7269\u4f53\u5c31\u88ab\u89c6\u4e3a\u52a8\u6001\uff0c\u4e0a\u9762\u6240\u6709\u7684\u7279\u5f81\u70b9\u90fd\u4f1a\u88ab\u5254\u9664\u3002 \u5224\u65ad\u52a8\u6001\u70b9\u6b65\u9aa4\uff1a \u8ba1\u7b97\u5149\u6d41\u91d1\u5b57\u5854\u5f97\u5230\u5f53\u524d\u5e27\u4e2d\u5df2\u7ecf\u5339\u914d\u7684\u7279\u5f81\u70b9 \u5982\u679c\u5339\u914d\u70b9\u5bf9\u79bb\u56fe\u50cf\u7684\u8fb9\u7f18\u592a\u8fd1\uff0c\u6216\u8005\u5404\u81ea\u4ee5\u4e24\u4e2a\u76f8\u5339\u914d\u7684\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u5176 3x3 \u533a\u57df\u8303\u56f4\u5185\u50cf\u7d20\u503c\u5dee\u5f02\u592a\u5927\uff0c\u8fd9\u4e2a\u5339\u914d\u70b9\u5c31\u4f1a\u88ab\u4e22\u5f03 \u4f7f\u7528 RANSAC \u7684\u65b9\u6cd5\uff08\u4f7f\u7528\u6700\u591a\u5185\u70b9\uff09\u627e\u5230\u57fa\u7840\u77e9\u9635 F \u4f7f\u7528\u57fa\u7840\u77e9\u9635\u8ba1\u7b97\u5f53\u524d\u5e27\u7684\u6781\u7ebf\uff0c\u5df2\u77e5\u4e0a\u4e00\u5e27\u4e2d\u7684\u7279\u5f81\u70b9\u50cf\u7d20\u4f4d\u7f6e\u4e3a \\(p_1=[u_1, v_1, 1]\\) \uff0c\u8fd9\u4e2a\u70b9\u5728\u5f53\u524d\u5e27\u4e2d\u5bf9\u5e94\u7684\u4f4d\u7f6e\u4e3a \\(p_2=[u_2, v_2, 1]\\) \uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u6c42\u51fa\u70b9 \\(p_1\\) \u6295\u5f71\u5230\u5f53\u524d\u5e27\u4e2d\u7684\u6781\u7ebf \\(I_1\\) \\[I_1 = \\begin{pmatrix} X \\\\ Y \\\\ Z \\end{pmatrix} Fp_1 = F \\begin{pmatrix} u_1 \\\\ v_1 \\\\ 1 \\end{pmatrix} \\] \u8ba1\u7b97\u5339\u914d\u7684\u7279\u5f81\u70b9\u5230\u5b83\u5bf9\u5e94\u6781\u7ebf\u7684\u8ddd\u79bb\uff0c\u5982\u679c\u8fd9\u4e2a\u8ddd\u79bb\u8d85\u8fc7\u9608\u503c\u5219\u88ab\u89c6\u4e3a\u79fb\u52a8\u70b9\uff0c\u53cd\u4e4b\u4e3a\u9759\u6001\u70b9\u3002\u8ddd\u79bb\u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ D = \\frac{|P_2^\\top F P_1|}{\\sqrt{\\parallel X \\parallel^2 + \\parallel Y \\parallel^2}} \\] Outlier Rejection \u00b6 \u7531\u4e8e\u4eba\u4f53\u7b49\u8fd0\u52a8\u7269\u4f53\u7684\u67d4\u6027\u53d8\u5f62\u548c\u590d\u6742\u8fd0\u52a8\uff0c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u65b9\u6cd5\u5f88\u96be\u63d0\u53d6\u5b8c\u6574\u52a8\u6001\u533a\u57df\u7684\u8f6e\u5ed3\uff0c\u66f4\u4f55\u51b5\u63d0\u53d6\u6574\u4e2a\u8f6e\u5ed3\u7684\u65f6\u95f4\u5f00\u9500\u975e\u5e38\u5927\u3002\u5728DS-SLAM\u4e2d\uff0c\u7531\u4e8e\u91c7\u7528\u4e86\u8bed\u4e49\u5206\u5272\u7f51\u7edc\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u83b7\u5f97\u7269\u4f53\u7684\u5b8c\u6574\u8f6e\u5ed3\u3002\u6211\u4eec\u7684\u60f3\u6cd5\u662f\u5c06\u8bed\u4e49\u4fe1\u606f\u548c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u7ed3\u5408\u8d77\u6765\uff0c\u5b8c\u6210\u4e24\u7ea7\u8bed\u4e49\u77e5\u8bc6\u5e93\u7684\u5efa\u7acb\uff1a \u5bf9\u8c61\u662f\u5426\u79fb\u52a8\u3002\u5982\u679c\u5728\u5206\u5272\u5bf9\u8c61\u7684\u8f6e\u5ed3\u4e2d\u5b58\u5728\u901a\u8fc7\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u800c\u4ea7\u751f\u7684\u4e00\u5b9a\u6570\u91cf\u7684\u52a8\u6001\u70b9\uff0c\u5219\u786e\u5b9a\u8be5\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\u3002 \u5982\u679c\u786e\u5b9a\u5206\u5272\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\uff0c\u5219\u5220\u9664\u4f4d\u4e8e\u5bf9\u8c61\u8f6e\u5ed3\u4e2d\u7684\u6240\u6709\u7279\u5f81\u70b9\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7cbe\u786e\u5730\u6d88\u9664\u5f02\u5e38\u503c\u3002\u6b64\u5916\uff0c\u9519\u8bef\u5206\u5272\u7684\u5f71\u54cd\u4e5f\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u964d\u4f4e\u3002 \u6b64\u5916\uff0c\u53ef\u4ee5\u5145\u5206\u5229\u7528\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u7684\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u7684\u65f6\u95f4\u3002\u5728\u7b49\u5f85\u671f\u95f4\uff0c\u53ef\u4ee5\u8fdb\u884c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u3002\u5728\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u7ed3\u679c\u90e8\u5206\uff0c\u8868 IV \u7ed9\u51fa\u4e86 DS-SLAM \u4e2d\u7684\u6d88\u8017\u65f6\u95f4\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f7f\u7528\u7684\u65f6\u95f4\u5927\u7ea6\u7b49\u4e8e\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u3002 \u5728\u672c\u6587\u7684\u5176\u4f59\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u5c06\u4eba\u7c7b\u4f5c\u4e3a\u52a8\u6001\u5bf9\u8c61\u7684\u5178\u578b\u4ee3\u8868\u3002\u4ece\u7406\u8bba\u4e0a\u8bb2\uff0cDS-SLAM\u9002\u7528\u4e8e\u4efb\u4f55\u591a\u4e2a\u5df2\u8bc6\u522b\u548c\u5206\u6bb5\u7684\u52a8\u6001\u5bf9\u8c61\u3002 \u8bed\u4e49\u5206\u5272\u7ed3\u679c\u51fa\u6765\u540e\uff0c\u5982\u679c\u6ca1\u6709\u4eba\u88ab\u68c0\u6d4b\u5230\uff0c\u90a3\u4e48\u6240\u6709\u7684ORB\u7279\u5f81\u5c06\u76f4\u63a5\u4e0e\u6700\u540e\u4e00\u5e27\u5339\u914d\u4ee5\u9884\u6d4b\u59ff\u52bf\u3002\u5426\u5219\uff0c\u8bf7\u4f7f\u7528\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u6765\u786e\u5b9a\u4eba\u5458\u662f\u5426\u5728\u79fb\u52a8\u3002\u5982\u679c\u786e\u5b9a\u4eba\u662f\u9759\u6001\u7684\uff0c\u5219\u76f4\u63a5\u9884\u6d4b\u59ff\u52bf\uff0c\u5426\u5219\u5728\u5339\u914d\u4e4b\u524d\u5220\u9664\u6240\u6709\u5c5e\u4e8e\u4eba\u7684\u8f6e\u5ed3\u5185\u7684ORB\u7279\u5f81\u70b9\u3002\u8fd9\u6837\uff0c\u53ef\u4ee5\u663e\u7740\u964d\u4f4e\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002 Dense semantic 3D octo-tree map building \u00b6 \u8bed\u4e49\u516b\u53c9\u6811\u6620\u5c04\u7ebf\u7a0b\u4ece\u8ddf\u8e2a\u7ebf\u7a0b\u83b7\u53d6\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4ece\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u83b7\u53d6\u5206\u5272\u7ed3\u679c\u3002\u5173\u952e\u5e27\u7684\u53d8\u6362\u77e9\u9635\u548c\u6df1\u5ea6\u56fe\u50cf\u7528\u4e8e\u751f\u6210\u5c40\u90e8\u70b9\u4e91\u3002\u7136\u540e\uff0c\u672c\u5730\u70b9\u4e91\u5c06\u88ab\u8f6c\u6362\u5e76\u7ef4\u62a4\u5728\u5168\u5c40\u516b\u70b9\u6811\u5730\u56fe\u4e2d\u3002\u6211\u4eec\u91c7\u7528\u516b\u53c9\u6811\u8868\u793a\uff0c\u662f\u56e0\u4e3a\u5b83\u7075\u6d3b\uff0c\u7d27\u51d1\u4e14\u53ef\u66f4\u65b0\u3002\u516b\u5143\u6811\u5730\u56fe\u88ab\u9ad8\u6548\u5b58\u50a8\uff0c\u5e76\u4e14\u6613\u4e8e\u7528\u4e8e\u5bfc\u822a\u3002 \u8bed\u4e49\u4fe1\u606f\u88ab\u5408\u5e76\u5230\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u3002\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u7684\u6bcf\u4e2a\u4f53\u7d20\u90fd\u4e0e\u7279\u5b9a\u7684\u989c\u8272\u76f8\u5173\u8054\uff0c\u5e76\u4e14\u6bcf\u79cd\u989c\u8272\u90fd\u4ee3\u8868\u4e00\u4e2a\u8bed\u4e49\u6807\u7b7e\u3002\u4f8b\u5982\uff0c\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u6c99\u53d1\uff0c\u800c\u7c89\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u4e00\u4e2a\u4eba\u3002\u5efa\u6a21\u548c\u8bed\u4e49\u878d\u5408\u7684\u6240\u6709\u8fc7\u7a0b\u5747\u4ee5\u6982\u7387\u65b9\u5f0f\u5b8c\u6210\uff0c\u56e0\u6b64\u53ef\u4ee5\u65b9\u4fbf\u5730\u66f4\u65b0\u4f53\u7d20\u7684\u5c5e\u6027\u3002\u8fd9\u6837\uff0c\u5bc6\u96c6\u7684\u8bed\u4e493D\u516b\u53c9\u6811\u5730\u56fe\u53ef\u4ee5\u4e3a\u79fb\u52a8\u673a\u5668\u4eba\u5b8c\u6210\u9ad8\u7ea7\u4efb\u52a1\u63d0\u4f9b\u57fa\u7840\u3002 DS-SLAM \u9762\u5411\u5904\u7406\u52a8\u6001\u73af\u5883\uff0c\u56e0\u6b64\u52a8\u6001\u5bf9\u8c61\u4e0d\u5e94\u8be5\u5b58\u5728\u4e8e\u5730\u56fe\u4e2d\u3002\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6709\u6548\u5730\u8fc7\u6ee4\u6389\u52a8\u6001\u5bf9\u8c61\u3002\u7136\u800c\uff0c\u8bed\u4e49\u5206\u5272\u7684\u51c6\u786e\u6027\u662f\u6709\u9650\u7684\u3002\u5728\u590d\u6742\u60c5\u51b5\u4e0b\uff0c\u4f8b\u5982\u5bf9\u8c61\u76f8\u4e92\u91cd\u53e0\uff0c\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u80fd\u4e0d\u5b8c\u6574\u751a\u81f3\u9519\u8bef\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cDS-SLAM \u4e2d\u4f7f\u7528\u4e86log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09\u6765\u6700\u5c0f\u5316\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002 log-odds score\u7528\u4e8e\u8868\u793a\u5355\u4e2a\u4f53\u7d20\u88ab\u5b9a\u91cf\u5360\u7528\u7684\u53ef\u80fd\u6027\u3002\u4ee4p\u8868\u793a\u4e00\u4e2a\u4f53\u7d20\u88ab\u5360\u7528\u7684\u6982\u7387\uff0cl\u8868\u793a\u8be5\u6982\u7387\u7684log-odds score\u3002 \u53ef\u4ee5\u901a\u8fc7logit\u53d8\u6362\u8ba1\u7b97\uff1a \\[ l = logit(p) = \\log (\\frac{p}{1-p}) \\\\ p = logit^{-1}(l) = \\frac{\\exp(l)}{\\exp(l) + 1} \\\\ L(n | z_{1:t+1}) = L(n | z_{1:t-1}) + L(n | z_t) \\] \u5982\u679c\u4f53\u7d20n\u88ab\u89c2\u5bdf\u5230\u88ab\u5360\u7528\u90a3\u4e48 \\(L=\\tau\\) \uff0c\u5426\u5219\u4e3a0\u3002\u589e\u91cf \\(\\tau\\) \u662f\u4e00\u4e2a\u9884\u5b9a\u4e49\u7684\u503c\u3002\u5f53\u91cd\u590d\u89c2\u5bdf\u5230\u8be5\u4f53\u7d20\u88ab\u5360\u7528\u65f6\uff0c\u8be5\u4f53\u7d20\u7684log-odds score\u4f1a\u589e\u52a0\uff0c\u5426\u5219\u4f1a\u51cf\u5c11\u3002\u4e00\u4e2a\u4f53\u7d20\u7684\u5360\u636e\u6982\u7387p\u53ef\u4ee5\u901a\u8fc7\u9006logit\u53d8\u6362\u6765\u8ba1\u7b97\u3002\u53ea\u6709\u5f53\u5360\u7528\u6982\u7387p\u5927\u4e8e\u9884\u5148\u5b9a\u4e49\u7684\u9608\u503c\u65f6\uff0c\u624d\u8ba4\u4e3a\u4f53\u7d20\u88ab\u5360\u7528\uff0c\u5e76\u5c06\u5728\u516b\u53c9\u6811\u56fe\u4e2d\u53ef\u89c6\u5316\u3002\u6362\u8a00\u4e4b\uff0c\u88ab\u89c2\u5bdf\u5230\u88ab\u591a\u6b21\u5360\u636e\u7684\u4f53\u7d20\u88ab\u8ba4\u4e3a\u662f\u7a33\u5b9a\u5360\u636e\u4f53\u7d20\u3002\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u597d\u5730\u5904\u7406\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5730\u56fe\u6784\u5efa\u95ee\u9898\u3002 EXPERIMENTAL RESULTS \u00b6 \u7565\u3002","title":"DS-SLAM"},{"location":"cv/papers/dynamic-slam/ds-slam/#ds-slam","text":"\u7ea6 2274 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract paper\uff1a DS-SLAM: A Semantic Visual SLAM towards Dynamic Environments code\uff1a DS-SLAM","title":"DS-SLAM"},{"location":"cv/papers/dynamic-slam/ds-slam/#introduction","text":"\u4f7f\u7528\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u548c\u5149\u6d41\u76f8\u7ed3\u5408\u7684\u65b9\u6cd5\u51cf\u5c11\u89c6\u89c9 SLAM \u4e2d\u52a8\u6001\u7269\u4f53\u9020\u6210\u7684\u5f71\u54cd\u3002 \u57fa\u4e8eORB-SLAM2\u63d0\u51fa\u4e86\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b8c\u6574\u8bed\u4e49SLAM\u7cfb\u7edf\uff08DS-SLAM\uff09\uff0c\u53ef\u4ee5\u51cf\u5c11\u52a8\u6001\u5bf9\u8c61\u5bf9\u59ff\u6001\u4f30\u8ba1\u7684\u5f71\u54cd\u3002 \u8be5\u7cfb\u7edf\u7684\u6709\u6548\u6027\u5728 TUM RGB-D \u6570\u636e\u96c6 \u4e0a\u8fdb\u884c\u8bc4\u4f30\u3002 \u7ed3\u679c\u8868\u660e\uff0cDS-SLAM \u5728\u52a8\u6001\u73af\u5883\u4e2d\u7684\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\u65b9\u9762\u660e\u663e\u4f18\u4e8e ORB-SLAM2\u3002 \u8be5\u7cfb\u7edf\u8fd8\u4e0e\u673a\u5668\u4eba\u64cd\u4f5c\u7cfb\u7edf\uff08ROS\uff09\u96c6\u6210\uff0c\u5e76\u901a\u8fc7\u5728\u771f\u5b9e\u73af\u5883\u4e2d\u5bf9\u673a\u5668\u4eba\u8fdb\u884c DS-SLAM \u6d4b\u8bd5\u6765\u9a8c\u8bc1\u5176\u6027\u80fd\u3002 2.\u5c06\u8bed\u4e49\u5206\u5272\u7f51\u7edc\u5355\u72ec\u7684\u653e\u5728\u4e00\u4e2a\u7ebf\u7a0b\u5f53\u4e2d\uff0c\u5c06\u8bed\u4e49\u5206\u5272\u548c\u8fd0\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7684\u65b9\u6cd5\uff08\u5149\u6d41\u6cd5\uff08\u901a\u8fc7\u8ba1\u7b97\u5149\u6d41\u7684\u4e0d\u4e00\u81f4\u6027\u6765\u533a\u5206\u9759\u6001\u80cc\u666f\u548c\u8fd0\u52a8\u76ee\u6807\uff09\uff09\u76f8\u7ed3\u5408\uff0c\u8fc7\u6ee4\u6389\u573a\u666f\u4e2d\u7684\u52a8\u6001\u7269\u4f53\u3002\u4ece\u800c\u63d0\u9ad8\u4e86\u5b9a\u4f4d\u6a21\u5757\u548c\u5efa\u56fe\u6a21\u5757\u5728\u52a8\u6001\u573a\u666f\u4e0b\u7684\u9c81\u68d2\u6027\u548c\u51c6\u786e\u6027\u3002 DS-SLAM \u521b\u5efa\u4e00\u4e2a\u5355\u72ec\u7684\u7ebf\u7a0b\u6765\u6784\u5efa\u4e00\u4e2a\u5bc6\u96c6\u7684\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe \u3002\u5bc6\u96c6\u8bed\u4e49 3D \u516b\u53c9\u6811\u56fe\u91c7\u7528 log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09 \u65b9\u6cd5\u8fc7\u6ee4\u6389\u4e0d\u7a33\u5b9a\u7684\u4f53\u7d20\u5e76\u66f4\u65b0\u8fd9\u4e9b\u4f53\u7d20\u7684\u8bed\u4e49\u3002","title":"Introduction"},{"location":"cv/papers/dynamic-slam/ds-slam/#related-work","text":"\u5728\u4ee5\u524d\u7684\u5de5\u4f5c\u4e2d\uff0c\u8bed\u4e49\u56fe\u901a\u5e38\u7531\u4e24\u90e8\u5206\u7ec4\u6210\uff1a\u51e0\u4f55\u90e8\u5206\u548c\u8bed\u4e49\u90e8\u5206\u3002\u8bed\u4e49\u65b9\u6cd5\u9884\u5148\u8bad\u7ec3\u4e86\u5bf9\u8c61\u8bc6\u522b\u5b50\u7cfb\u7edf\uff0c\u5e76\u5c06\u8bed\u4e49\u4fe1\u606f\u9644\u52a0\u5230\u8bc6\u522b\u7684\u5bf9\u8c61\u6a21\u578b\u4e0a\u3002\u4ed6\u4eec\u7684\u5de5\u4f5c\u4ec5\u96c6\u4e2d\u5728\u8bed\u4e49\u6620\u5c04\u548c\u5bf9\u8c61\u8bc6\u522b\u4e0a\uff0c\u800c\u8bed\u4e49\u4fe1\u606f\u5728\u5176\u4ed6\u90e8\u5206\u7684\u4fe1\u606f\u5374\u6ca1\u6709\u5f88\u597d\u5730\u4f7f\u7528\u3002\u8fd1\u671f\u5de5\u4f5c\u5229\u7528\u573a\u666f\u4e2d\u7684\u51e0\u4f55\u5c5e\u6027\u548c\u8bed\u4e49\u5c5e\u6027\u5171\u540c\u4f30\u8ba1\u76f8\u673a\u7684\u59ff\u52bf\uff0c\u70b9\u548c\u5bf9\u8c61\uff0c\u4ece\u800c\u663e\u8457\u63d0\u9ad8\u4e86\u5bf9\u8c61\u8bc6\u522b\u7684\u51c6\u786e\u6027\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u8bed\u4e49\u4fe1\u606f\u4e0d\u4ec5\u7528\u4e8e\u751f\u6210\u57fa\u4e8e\u516b\u53c9\u6811\u7684\u73af\u5883\u8868\u793a\uff0c\u800c\u4e14\u8fd8\u7528\u4e8e\u5728\u52a8\u6001\u73af\u5883\u4e2d\u8ddf\u8e2a\u8fc7\u7a0b\u4e2d\u8fc7\u6ee4\u5f02\u5e38\u503c\u3002","title":"RELATED WORK"},{"location":"cv/papers/dynamic-slam/ds-slam/#system-intruduction","text":"","title":"SYSTEM INTRUDUCTION"},{"location":"cv/papers/dynamic-slam/ds-slam/#framework-of-ds-slam","text":"Kinect2\u6355\u83b7\u7684\u539f\u59cbRGB\u56fe\u50cf\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u548c\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u4e2d\u540c\u65f6\u8fdb\u884c\u5904\u7406\u3002\u8ddf\u8e2a\u7ebf\u7a0b\u9996\u5148\u63d0\u53d6ORB\u7279\u5f81\u70b9\uff0c\u7136\u540e\u7c97\u7565\u68c0\u67e5\u7279\u5f81\u70b9\u7684\u79fb\u52a8\u4e00\u81f4\u6027\u5e76\u4fdd\u5b58\u6f5c\u5728\u7684\u5f02\u5e38\u503c\u3002\u7136\u540e\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u5177\u6709\u7531\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u9884\u6d4b\u7684\u50cf\u7d20\u7ea7\u8bed\u4e49\u6807\u7b7e\u7684\u56fe\u50cf\u3002\u5206\u5272\u7ed3\u679c\u5230\u8fbe\u540e\uff0c\u5c06\u6839\u636e\u5206\u5272\u7ed3\u679c\u548c\u4e4b\u524d\u68c0\u6d4b\u5230\u7684\u6f5c\u5728\u5f02\u5e38\u503c\uff0c\u4e22\u5f03\u4f4d\u4e8e\u8fd0\u52a8\u7269\u4f53\u4e2d\u7684ORB\u7279\u5f81\u70b9\u5f02\u5e38\u503c\u3002\u7136\u540e\uff0c\u901a\u8fc7\u5339\u914d\u5176\u4f59\u7684\u7a33\u5b9a\u7279\u5f81\u70b9\u6765\u8ba1\u7b97\u53d8\u6362\u77e9\u9635\u3002","title":"Framework of DS-SLAM"},{"location":"cv/papers/dynamic-slam/ds-slam/#semantic-segmentation","text":"DS-SLAM\u91c7\u7528SegNet\u63d0\u4f9b\u57fa\u4e8ecaffe\u7684\u50cf\u7d20\u7ea7\u5b9e\u65f6\u8bed\u4e49\u5206\u5272\u3002\u5728PASCAL VOC\u6570\u636e\u96c6\u4e0a\u8bad\u7ec3\u7684SegNet\u603b\u5171\u53ef\u4ee5\u5206\u527220\u4e2a\u7c7b\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4eba\u6700\u6709\u53ef\u80fd\u662f\u52a8\u6001\u5bf9\u8c61\uff0c\u56e0\u6b64\u6211\u4eec\u5047\u8bbe\u4f4d\u4e8e\u4eba\u8eab\u4e0a\u7684\u7279\u5f81\u70b9\u6700\u6709\u53ef\u80fd\u662f\u5f02\u5e38\u503c\u3002","title":"Semantic Segmentation"},{"location":"cv/papers/dynamic-slam/ds-slam/#moving-consistency-check","text":"\u7ecf\u8fc7\u8bed\u4e49\u5206\u5272\u7684\u6a21\u5757\u540e\uff0c\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u5206\u5272\u7684Mask\u7684\uff0c\u6240\u4ee5\u73b0\u5728\u7684\u4efb\u52a1\u5c31\u662f\u53bb\u786e\u5b9a\uff0c\u67d0\u4e2a\u5173\u952e\u70b9\u662f\u5426\u662f\u79fb\u52a8\u7684\uff0c\u5982\u679c\u6709\u4e00\u5b9a\u6570\u91cf\u7684\u79fb\u52a8\u70b9\u843d\u5728\u4e86\u67d0\u4e00\u4e2a\u5206\u5272\u51fa\u6765\u7684\u7269\u4f53\u8f6e\u5ed3\u5185\u90e8\uff0c\u90a3\u8fd9\u4e2a\u7269\u4f53\u5c31\u88ab\u89c6\u4e3a\u52a8\u6001\uff0c\u4e0a\u9762\u6240\u6709\u7684\u7279\u5f81\u70b9\u90fd\u4f1a\u88ab\u5254\u9664\u3002 \u5224\u65ad\u52a8\u6001\u70b9\u6b65\u9aa4\uff1a \u8ba1\u7b97\u5149\u6d41\u91d1\u5b57\u5854\u5f97\u5230\u5f53\u524d\u5e27\u4e2d\u5df2\u7ecf\u5339\u914d\u7684\u7279\u5f81\u70b9 \u5982\u679c\u5339\u914d\u70b9\u5bf9\u79bb\u56fe\u50cf\u7684\u8fb9\u7f18\u592a\u8fd1\uff0c\u6216\u8005\u5404\u81ea\u4ee5\u4e24\u4e2a\u76f8\u5339\u914d\u7684\u70b9\u4e3a\u4e2d\u5fc3\uff0c\u5176 3x3 \u533a\u57df\u8303\u56f4\u5185\u50cf\u7d20\u503c\u5dee\u5f02\u592a\u5927\uff0c\u8fd9\u4e2a\u5339\u914d\u70b9\u5c31\u4f1a\u88ab\u4e22\u5f03 \u4f7f\u7528 RANSAC \u7684\u65b9\u6cd5\uff08\u4f7f\u7528\u6700\u591a\u5185\u70b9\uff09\u627e\u5230\u57fa\u7840\u77e9\u9635 F \u4f7f\u7528\u57fa\u7840\u77e9\u9635\u8ba1\u7b97\u5f53\u524d\u5e27\u7684\u6781\u7ebf\uff0c\u5df2\u77e5\u4e0a\u4e00\u5e27\u4e2d\u7684\u7279\u5f81\u70b9\u50cf\u7d20\u4f4d\u7f6e\u4e3a \\(p_1=[u_1, v_1, 1]\\) \uff0c\u8fd9\u4e2a\u70b9\u5728\u5f53\u524d\u5e27\u4e2d\u5bf9\u5e94\u7684\u4f4d\u7f6e\u4e3a \\(p_2=[u_2, v_2, 1]\\) \uff0c\u7136\u540e\u5c31\u53ef\u4ee5\u6c42\u51fa\u70b9 \\(p_1\\) \u6295\u5f71\u5230\u5f53\u524d\u5e27\u4e2d\u7684\u6781\u7ebf \\(I_1\\) \\[I_1 = \\begin{pmatrix} X \\\\ Y \\\\ Z \\end{pmatrix} Fp_1 = F \\begin{pmatrix} u_1 \\\\ v_1 \\\\ 1 \\end{pmatrix} \\] \u8ba1\u7b97\u5339\u914d\u7684\u7279\u5f81\u70b9\u5230\u5b83\u5bf9\u5e94\u6781\u7ebf\u7684\u8ddd\u79bb\uff0c\u5982\u679c\u8fd9\u4e2a\u8ddd\u79bb\u8d85\u8fc7\u9608\u503c\u5219\u88ab\u89c6\u4e3a\u79fb\u52a8\u70b9\uff0c\u53cd\u4e4b\u4e3a\u9759\u6001\u70b9\u3002\u8ddd\u79bb\u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ D = \\frac{|P_2^\\top F P_1|}{\\sqrt{\\parallel X \\parallel^2 + \\parallel Y \\parallel^2}} \\]","title":"Moving Consistency Check"},{"location":"cv/papers/dynamic-slam/ds-slam/#outlier-rejection","text":"\u7531\u4e8e\u4eba\u4f53\u7b49\u8fd0\u52a8\u7269\u4f53\u7684\u67d4\u6027\u53d8\u5f62\u548c\u590d\u6742\u8fd0\u52a8\uff0c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u65b9\u6cd5\u5f88\u96be\u63d0\u53d6\u5b8c\u6574\u52a8\u6001\u533a\u57df\u7684\u8f6e\u5ed3\uff0c\u66f4\u4f55\u51b5\u63d0\u53d6\u6574\u4e2a\u8f6e\u5ed3\u7684\u65f6\u95f4\u5f00\u9500\u975e\u5e38\u5927\u3002\u5728DS-SLAM\u4e2d\uff0c\u7531\u4e8e\u91c7\u7528\u4e86\u8bed\u4e49\u5206\u5272\u7f51\u7edc\uff0c\u53ef\u4ee5\u5f88\u5bb9\u6613\u5730\u83b7\u5f97\u7269\u4f53\u7684\u5b8c\u6574\u8f6e\u5ed3\u3002\u6211\u4eec\u7684\u60f3\u6cd5\u662f\u5c06\u8bed\u4e49\u4fe1\u606f\u548c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u7ed3\u5408\u8d77\u6765\uff0c\u5b8c\u6210\u4e24\u7ea7\u8bed\u4e49\u77e5\u8bc6\u5e93\u7684\u5efa\u7acb\uff1a \u5bf9\u8c61\u662f\u5426\u79fb\u52a8\u3002\u5982\u679c\u5728\u5206\u5272\u5bf9\u8c61\u7684\u8f6e\u5ed3\u4e2d\u5b58\u5728\u901a\u8fc7\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u800c\u4ea7\u751f\u7684\u4e00\u5b9a\u6570\u91cf\u7684\u52a8\u6001\u70b9\uff0c\u5219\u786e\u5b9a\u8be5\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\u3002 \u5982\u679c\u786e\u5b9a\u5206\u5272\u5bf9\u8c61\u6b63\u5728\u79fb\u52a8\uff0c\u5219\u5220\u9664\u4f4d\u4e8e\u5bf9\u8c61\u8f6e\u5ed3\u4e2d\u7684\u6240\u6709\u7279\u5f81\u70b9\u3002\u901a\u8fc7\u8fd9\u79cd\u65b9\u5f0f\uff0c\u53ef\u4ee5\u7cbe\u786e\u5730\u6d88\u9664\u5f02\u5e38\u503c\u3002\u6b64\u5916\uff0c\u9519\u8bef\u5206\u5272\u7684\u5f71\u54cd\u4e5f\u53ef\u4ee5\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u964d\u4f4e\u3002 \u6b64\u5916\uff0c\u53ef\u4ee5\u5145\u5206\u5229\u7528\u8ddf\u8e2a\u7ebf\u7a0b\u7b49\u5f85\u53e6\u4e00\u4e2a\u7ebf\u7a0b\u7684\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u7684\u65f6\u95f4\u3002\u5728\u7b49\u5f85\u671f\u95f4\uff0c\u53ef\u4ee5\u8fdb\u884c\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u3002\u5728\u63a5\u4e0b\u6765\u7684\u5b9e\u9a8c\u7ed3\u679c\u90e8\u5206\uff0c\u8868 IV \u7ed9\u51fa\u4e86 DS-SLAM \u4e2d\u7684\u6d88\u8017\u65f6\u95f4\u3002\u53ef\u4ee5\u770b\u51fa\uff0c\u5728\u8ddf\u8e2a\u7ebf\u7a0b\u4e2d\u4f7f\u7528\u7684\u65f6\u95f4\u5927\u7ea6\u7b49\u4e8e\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u3002 \u5728\u672c\u6587\u7684\u5176\u4f59\u90e8\u5206\u4e2d\uff0c\u6211\u4eec\u5c06\u4eba\u7c7b\u4f5c\u4e3a\u52a8\u6001\u5bf9\u8c61\u7684\u5178\u578b\u4ee3\u8868\u3002\u4ece\u7406\u8bba\u4e0a\u8bb2\uff0cDS-SLAM\u9002\u7528\u4e8e\u4efb\u4f55\u591a\u4e2a\u5df2\u8bc6\u522b\u548c\u5206\u6bb5\u7684\u52a8\u6001\u5bf9\u8c61\u3002 \u8bed\u4e49\u5206\u5272\u7ed3\u679c\u51fa\u6765\u540e\uff0c\u5982\u679c\u6ca1\u6709\u4eba\u88ab\u68c0\u6d4b\u5230\uff0c\u90a3\u4e48\u6240\u6709\u7684ORB\u7279\u5f81\u5c06\u76f4\u63a5\u4e0e\u6700\u540e\u4e00\u5e27\u5339\u914d\u4ee5\u9884\u6d4b\u59ff\u52bf\u3002\u5426\u5219\uff0c\u8bf7\u4f7f\u7528\u79fb\u52a8\u4e00\u81f4\u6027\u68c0\u67e5\u7ed3\u679c\u6765\u786e\u5b9a\u4eba\u5458\u662f\u5426\u5728\u79fb\u52a8\u3002\u5982\u679c\u786e\u5b9a\u4eba\u662f\u9759\u6001\u7684\uff0c\u5219\u76f4\u63a5\u9884\u6d4b\u59ff\u52bf\uff0c\u5426\u5219\u5728\u5339\u914d\u4e4b\u524d\u5220\u9664\u6240\u6709\u5c5e\u4e8e\u4eba\u7684\u8f6e\u5ed3\u5185\u7684ORB\u7279\u5f81\u70b9\u3002\u8fd9\u6837\uff0c\u53ef\u4ee5\u663e\u7740\u964d\u4f4e\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002","title":"Outlier Rejection"},{"location":"cv/papers/dynamic-slam/ds-slam/#dense-semantic-3d-octo-tree-map-building","text":"\u8bed\u4e49\u516b\u53c9\u6811\u6620\u5c04\u7ebf\u7a0b\u4ece\u8ddf\u8e2a\u7ebf\u7a0b\u83b7\u53d6\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4ece\u8bed\u4e49\u5206\u5272\u7ebf\u7a0b\u83b7\u53d6\u5206\u5272\u7ed3\u679c\u3002\u5173\u952e\u5e27\u7684\u53d8\u6362\u77e9\u9635\u548c\u6df1\u5ea6\u56fe\u50cf\u7528\u4e8e\u751f\u6210\u5c40\u90e8\u70b9\u4e91\u3002\u7136\u540e\uff0c\u672c\u5730\u70b9\u4e91\u5c06\u88ab\u8f6c\u6362\u5e76\u7ef4\u62a4\u5728\u5168\u5c40\u516b\u70b9\u6811\u5730\u56fe\u4e2d\u3002\u6211\u4eec\u91c7\u7528\u516b\u53c9\u6811\u8868\u793a\uff0c\u662f\u56e0\u4e3a\u5b83\u7075\u6d3b\uff0c\u7d27\u51d1\u4e14\u53ef\u66f4\u65b0\u3002\u516b\u5143\u6811\u5730\u56fe\u88ab\u9ad8\u6548\u5b58\u50a8\uff0c\u5e76\u4e14\u6613\u4e8e\u7528\u4e8e\u5bfc\u822a\u3002 \u8bed\u4e49\u4fe1\u606f\u88ab\u5408\u5e76\u5230\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u3002\u516b\u53c9\u6811\u5730\u56fe\u4e2d\u7684\u6bcf\u4e2a\u4f53\u7d20\u90fd\u4e0e\u7279\u5b9a\u7684\u989c\u8272\u76f8\u5173\u8054\uff0c\u5e76\u4e14\u6bcf\u79cd\u989c\u8272\u90fd\u4ee3\u8868\u4e00\u4e2a\u8bed\u4e49\u6807\u7b7e\u3002\u4f8b\u5982\uff0c\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u6c99\u53d1\uff0c\u800c\u7c89\u7ea2\u8272\u7684\u4f53\u7d20\u4ee3\u8868\u5b83\u5c5e\u4e8e\u4e00\u4e2a\u4eba\u3002\u5efa\u6a21\u548c\u8bed\u4e49\u878d\u5408\u7684\u6240\u6709\u8fc7\u7a0b\u5747\u4ee5\u6982\u7387\u65b9\u5f0f\u5b8c\u6210\uff0c\u56e0\u6b64\u53ef\u4ee5\u65b9\u4fbf\u5730\u66f4\u65b0\u4f53\u7d20\u7684\u5c5e\u6027\u3002\u8fd9\u6837\uff0c\u5bc6\u96c6\u7684\u8bed\u4e493D\u516b\u53c9\u6811\u5730\u56fe\u53ef\u4ee5\u4e3a\u79fb\u52a8\u673a\u5668\u4eba\u5b8c\u6210\u9ad8\u7ea7\u4efb\u52a1\u63d0\u4f9b\u57fa\u7840\u3002 DS-SLAM \u9762\u5411\u5904\u7406\u52a8\u6001\u73af\u5883\uff0c\u56e0\u6b64\u52a8\u6001\u5bf9\u8c61\u4e0d\u5e94\u8be5\u5b58\u5728\u4e8e\u5730\u56fe\u4e2d\u3002\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u4ee5\u5e2e\u52a9\u6211\u4eec\u6709\u6548\u5730\u8fc7\u6ee4\u6389\u52a8\u6001\u5bf9\u8c61\u3002\u7136\u800c\uff0c\u8bed\u4e49\u5206\u5272\u7684\u51c6\u786e\u6027\u662f\u6709\u9650\u7684\u3002\u5728\u590d\u6742\u60c5\u51b5\u4e0b\uff0c\u4f8b\u5982\u5bf9\u8c61\u76f8\u4e92\u91cd\u53e0\uff0c\u8bed\u4e49\u5206\u5272\u7ed3\u679c\u53ef\u80fd\u4e0d\u5b8c\u6574\u751a\u81f3\u9519\u8bef\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\uff0cDS-SLAM \u4e2d\u4f7f\u7528\u4e86log-odds score\uff08\u5bf9\u6570\u4f18\u52bf\u8bb0\u5206\u6cd5\uff09\u6765\u6700\u5c0f\u5316\u52a8\u6001\u5bf9\u8c61\u7684\u5f71\u54cd\u3002 log-odds score\u7528\u4e8e\u8868\u793a\u5355\u4e2a\u4f53\u7d20\u88ab\u5b9a\u91cf\u5360\u7528\u7684\u53ef\u80fd\u6027\u3002\u4ee4p\u8868\u793a\u4e00\u4e2a\u4f53\u7d20\u88ab\u5360\u7528\u7684\u6982\u7387\uff0cl\u8868\u793a\u8be5\u6982\u7387\u7684log-odds score\u3002 \u53ef\u4ee5\u901a\u8fc7logit\u53d8\u6362\u8ba1\u7b97\uff1a \\[ l = logit(p) = \\log (\\frac{p}{1-p}) \\\\ p = logit^{-1}(l) = \\frac{\\exp(l)}{\\exp(l) + 1} \\\\ L(n | z_{1:t+1}) = L(n | z_{1:t-1}) + L(n | z_t) \\] \u5982\u679c\u4f53\u7d20n\u88ab\u89c2\u5bdf\u5230\u88ab\u5360\u7528\u90a3\u4e48 \\(L=\\tau\\) \uff0c\u5426\u5219\u4e3a0\u3002\u589e\u91cf \\(\\tau\\) \u662f\u4e00\u4e2a\u9884\u5b9a\u4e49\u7684\u503c\u3002\u5f53\u91cd\u590d\u89c2\u5bdf\u5230\u8be5\u4f53\u7d20\u88ab\u5360\u7528\u65f6\uff0c\u8be5\u4f53\u7d20\u7684log-odds score\u4f1a\u589e\u52a0\uff0c\u5426\u5219\u4f1a\u51cf\u5c11\u3002\u4e00\u4e2a\u4f53\u7d20\u7684\u5360\u636e\u6982\u7387p\u53ef\u4ee5\u901a\u8fc7\u9006logit\u53d8\u6362\u6765\u8ba1\u7b97\u3002\u53ea\u6709\u5f53\u5360\u7528\u6982\u7387p\u5927\u4e8e\u9884\u5148\u5b9a\u4e49\u7684\u9608\u503c\u65f6\uff0c\u624d\u8ba4\u4e3a\u4f53\u7d20\u88ab\u5360\u7528\uff0c\u5e76\u5c06\u5728\u516b\u53c9\u6811\u56fe\u4e2d\u53ef\u89c6\u5316\u3002\u6362\u8a00\u4e4b\uff0c\u88ab\u89c2\u5bdf\u5230\u88ab\u591a\u6b21\u5360\u636e\u7684\u4f53\u7d20\u88ab\u8ba4\u4e3a\u662f\u7a33\u5b9a\u5360\u636e\u4f53\u7d20\u3002\u4f7f\u7528\u8fd9\u79cd\u65b9\u6cd5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f88\u597d\u5730\u5904\u7406\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5730\u56fe\u6784\u5efa\u95ee\u9898\u3002","title":"Dense semantic 3D octo-tree map building"},{"location":"cv/papers/dynamic-slam/ds-slam/#experimental-results","text":"\u7565\u3002","title":"EXPERIMENTAL RESULTS"},{"location":"cv/papers/dynamic-slam/dynaslam/","text":"DynaSLAM \u00b6 \u7ea6 1868 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f Abstract paper\uff1a DynaSLAM: Tracking, Mapping and Inpainting in Dynamic Scenes code\uff1a DynaSLAM INTRUDUCTION \u00b6 \u5728\u89c6\u89c9SLAM\u4e2d\uff0c\u52a8\u6001\u7269\u4f53\u4f1a\u5e26\u6765\u5982\u4e0b\u6311\u6218\uff1a \u5982\u4f55\u68c0\u6d4b\u56fe\u50cf\u4e2d\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4ece\u800c\uff1a \u9632\u6b62tracking\u7b97\u6cd5\u4f7f\u7528\u52a8\u6001\u7269\u4f53\u4e0a\u7684\u5339\u914d\u70b9\u5bf9 \u9632\u6b62mapping\u7b97\u6cd5\u628a\u79fb\u52a8\u7269\u4f53\u52a0\u51653D\u5730\u56fe\u4e2d \u600e\u4e48\u53bb\u8865\u51683D\u5730\u56fe\u4e2d\u90a3\u4e9b\u88ab\u79fb\u52a8\u7269\u4f53\u6321\u4f4f\u4ece\u800c\u7f3a\u5931\u4e86\u7684\u90e8\u5206\u3002 DynaSLAM\u662f\u53ef\u4ee5\u7528\u4e8e\u5355\u76ee\uff0c\u53cc\u76ee\uff0cRGB-D\u7684\u52a8\u6001SLAM\u7cfb\u7edf\uff0c\u76f8\u5f53\u4e8e\u662f\u5728ORB-SLAM2\u4e0a\u52a0\u4e86\u4e00\u4e2a\u524d\u7aef\u7684\u6a21\u5757\uff0c\u4e0a\u9762\u7684\u4e24\u4e2a\u6311\u6218\uff0c\u8fd9\u7bc7\u8bba\u6587\u90fd\u7ed9\u51fa\u4e86\u5bf9\u5e94\u7684\u89e3\u51b3\u529e\u6cd5\u3002 \u5bf9\u4e8e\u5355\u76ee\u548c\u53cc\u76ee\uff1a\u4f7f\u7528CNN\u8fdb\u884c\u50cf\u7d20\u5206\u5272\uff0c\u628a\u56fe\u50cf\u4e2d\u7684\u4eba\u548c\u8f66\u5254\u9664\uff0c\u7279\u5f81\u63d0\u53d6\u65f6\u5c31\u4e0d\u4f1a\u8fd9\u4e9b\u4e0a\u9762\u63d0\u53d6\u3002 \u5bf9\u4e8eRGB-D\uff1a\u7ed3\u5408\u591a\u89c6\u89d2\u51e0\u4f55\u6a21\u578b\u548c\u6df1\u5ea6\u5b66\u4e60\uff08\u91cd\u70b9\uff01\uff09 RELATED WORK \u00b6 \u5728\u8fd9\u4e2a\u90e8\u5206\u4f5c\u8005\u8fd8\u603b\u7ed3\u4e86\u4e00\u4e0b\u76ee\u524d\u52a8\u6001SLAM\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a \u5e38\u89c4\u53bb\u9664\u52a8\u6001\u7684\u5916\u70b9\uff1a RANSAC robust cost function \u5bf9\u4e8e\u57fa\u4e8e\u7279\u5f81\u7684SLAM\uff1a \u901a\u8fc7\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u5f53\u524d\u5e27\u6765\u68c0\u6d4b\u573a\u666f\u4e2d\u7684\u53d8\u5316 \u68c0\u6d4b\u548c\u8ffd\u8e2a\u5df2\u77e5\u76843D\u52a8\u6001\u70b9\uff0c\u6bd4\u5982\u4eba \u4f7f\u7528\u6df1\u5ea6\u8fb9\u7f18\u70b9\uff0c\u4ed6\u6709\u4e00\u4e2a\u76f8\u5173\u8054\u6743\u91cd\u53ef\u4ee5\u7528\u6765\u8868\u793a\u5176\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u6982\u7387 \u5bf9\u4e8e\u76f4\u63a5\u6cd5SLAM\uff0c\u4ed6\u5bf9\u52a8\u6001\u7269\u4f53\u66f4\u52a0\u654f\u611f\uff1a \u901a\u8fc7\u53cc\u76ee\u76f8\u673a\u7684\u573a\u666f\u6d41\u6765\u68c0\u6d4b\u79fb\u52a8\u7269\u4f53 \u4f7f\u7528RGB-D\u5149\u6d41\u5206\u5272\u52a8\u6001\u7269\u4f53 \u901a\u8fc7\u8ba1\u7b97\u8fde\u7eed\u5e27\u4e4b\u95f4\u6295\u5f71\u5230\u540c\u4e00\u5e73\u9762\u7684\u6df1\u5ea6\u56fe\u7684\u5dee\u522b\u6765\u627e\u5230\u9759\u6b62\u7684\u90e8\u5206 \u8ba1\u7b97\u8fde\u7eedRGB\u56fe\u50cf\u4e4b\u95f4intensity\u7684\u5dee\u522b\uff0c\u50cf\u7d20\u5206\u7c7b\u901a\u8fc7\u5bf9\u91cf\u5316\u7684\u6df1\u5ea6\u56fe\u8fdb\u884c\u5206\u5272\u800c\u5b8c\u6210\uff1f \u4e0a\u9762\u5217\u51fa\u5173\u4e8e\u7279\u5f81\u6cd5\u548c\u76f4\u63a5\u6cd5\u7684\u65b9\u6848\u90fd\u6709\u4e00\u4e9b\u95ee\u9898\u6ca1\u80fd\u89e3\u51b3\uff1a \u4e0d\u80fd\u4f30\u8ba1\u4e00\u4e9b\u4fdd\u6301\u9759\u6b62\u7684\u5148\u9a8c\u52a8\u6001\u7269\u4f53\uff0c\u6bd4\u5982\u9759\u6b62\u7684\u6c7d\u8f66\uff0c\u5750\u7740\u7684\u4eba \u4e0d\u80fd\u68c0\u6d4b\u9759\u6001\u7269\u4f53\u5f15\u8d77\u7684\u53d8\u5316\uff0c\u6bd4\u5982\u8bf4\u88ab\u4eba\u62d6\u52a8\u7684\u6905\u5b50\uff0c\u6216\u8005\u88ab\u4eba\u4e22\u98de\u7684\u7403\u3002 \u800cDynaSLAM\u4e0d\u4ec5\u53ef\u4ee5\u68c0\u6d4b\u51fa\u6b63\u5728\u79fb\u52a8\u7684\u7269\u4f53\uff0c\u8fd8\u53ef\u4ee5\u68c0\u6d4b\u51fa\u4e00\u4e9b\u201c\u53ef\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\u3002 SYSTEM DESCRIPTION \u00b6 Segmentation of Potentially Dynamic Content using a CNN \u00b6 \u4f7f\u7528 MASK-RCNN \u8fdb\u884c\u50cf\u7d20\u7ea7\u5206\u5272\uff0c\u53ea\u7528\u5230\u8bed\u4e49\u4fe1\u606f\u3002 Low-Cost Tracking \u00b6 \u4e0a\u4e00\u6b65\u4e2d\u628a\u52a8\u6001\u7279\u5f81\u70b9\u53bb\u9664\u540e\uff0c\u7528\u5269\u4e0b\u7684\u9759\u6001\u70b9\u7ebf\u6c42\u51fa\u4e00\u4e2a\u76f8\u673a\u7684\u4f4d\u59ff\u3002\u7531\u4e8e\u8ba1\u7b97\u7279\u5f81\u70b9\u7684\u65f6\u5019\uff0c\u7279\u5f81\u70b9\u672c\u5c31\u559c\u6b22\u843d\u5728\u5206\u5272\u8f6e\u5ed3\u8fd9\u79cd\u9ad8\u68af\u5ea6\u533a\u57df\uff08\u53ef\u4ee5\u627e\u56fe\u7247\u770b\u4e00\u4e0b\uff0c\u6bd4\u5982\uff0c\u4eba\u8eab\u4f53\u5206\u51fa\u6765\u7684\u5206\u5272\u8fb9\u754c\uff0c\u540e\u9762\u5c31\u662f\u80cc\u666f\uff0c\u6709\u4e00\u4e9b\u906e\u6321\u5173\u7cfb\uff0c\u5206\u5272\u8fb9\u754c\u9644\u8fd1\u4f1a\u662f\u68af\u5ea6\u53d8\u5316\u5927\u7684\u533a\u57df\uff0c\u7279\u5f81\u70b9\u672c\u8eab\u5c31\u5bb9\u6613\u843d\u5728\u8fd9\u79cd\u5730\u65b9\uff09\uff0c\u6240\u4ee5\u8fd9\u4e2a\u5206\u5272\u8f6e\u5ed3\u9644\u8fd1\u7684\u70b9\u4e5f\u4e0d\u8981\uff0c\u4ee3\u7801\u4e2d\u7528\u4e86erode\u5904\u7406\u3002\u8fd9\u4e00\u6b65\u7684tracking\u8ba1\u7b97\u6bd4\u8f83\u7b80\u5355\uff0c\u662fORB\u539f\u7248\u7684\u7b80\u5316\u3002\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u56fe\u50cf\u5e27\uff0c\u627e\u5230\u5730\u56fe\u70b9\u5728\u56fe\u50cf\u9759\u6001\u533a\u57df\u4e2d\u5bf9\u5e94\u7684\u5339\u914d\u70b9\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u6765\u4f18\u5316\u76f8\u673a\u4f4d\u59ff\u3002 Segmentation of Dynamic Content using Mask R-CNN and Multi-view Geometry \u00b6 \u4f7f\u7528MASK-RCNN\u53ea\u80fd\u5206\u5272\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u4e0d\u80fd\u627e\u5230\u90a3\u4e9b\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u6bd4\u5982\u88ab\u4eba\u62ff\u7740\u7684\u4e66\uff0c\u8ddf\u4eba\u4e00\u8d77\u79fb\u52a8\u7684\u8f6c\u6905\u7b49\u7b49\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u79cd\u60c5\u51b5\uff0c\u5c31\u91c7\u7528\u4e86\u4e0b\u9762\u7684\u591a\u89c6\u56fe\u51e0\u4f55\u7684\u65b9\u6cd5\uff1a \u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u8f93\u5165\u5e27\uff0c\u9009\u62e9\u4e4b\u524d\u7684\u548c\u8f93\u5165\u5e27\u6709\u6700\u9ad8\u91cd\u5408\u5ea6\u7684\u591a\u4e2a\u5173\u952e\u5e27\uff08\u8bba\u6587\u8bbe\u7f6e\u4e3a5\u4e2a\uff09\uff0c\u8fd9\u4e2a\u91cd\u5408\u5ea6\u662f\u901a\u8fc7\u8003\u8651\u65b0\u7684\u4e00\u5e27\u548c\u6bcf\u4e2a\u5173\u952e\u5e27\u4e4b\u95f4\u7684\u8ddd\u79bb\u548c\u65cb\u8f6c\u6765\u51b3\u5b9a\u7684\u3002 \u628a\u4e4b\u524d\u5173\u952e\u5e27\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u70b9 \\(x\\) \u90fd\u6295\u5f71\u5230\u5f53\u524d\u5e27\uff0c\u5f97\u5230\u5173\u952e\u70b9 \\(x^\\prime\\) \u548c\u5b83\u4eec\u7684\u6295\u5f71\u6df1\u5ea6 \\(z_{proj}\\) \u5bf9\u4e8e\u6bcf\u4e2a\u5173\u952e\u70b9\uff0c\u5b83\u5bf9\u5e94\u76843D\u70b9\u662f \\(X\\) \u3002\u7136\u540e\uff0c\u8ba1\u7b97 \\(x\\) \u548c \\(x^\\prime\\) \u53cd\u6295\u5f71\u4e4b\u95f4\u7684\u5939\u89d2\uff0c\u5373\u89c6\u5dee\u89d2 \\(\\alpha\\) \u3002 \u5982\u679c\u89d2\u5ea6\u5927\u4e8e30\u5ea6\uff0c\u8fd9\u4e2a\u70b9\u5c31\u6709\u53ef\u80fd\u88ab\u906e\u6321 \uff0c\u4e4b\u540e\u5c31\u4f1a\u88ab\u5ffd\u7565\u3002\u6bd4\u5982\u5728TUM\u6570\u636e\u96c6\u4e2d\uff0c\u5982\u679c\u89c6\u5dee\u89d2\u5927\u4e8e30\u5ea6\uff0c\u7531\u4e8e\u89c6\u89d2\u7684\u4e0d\u540c\uff0c\u9759\u6001\u70b9\u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u3002 \u8ba1\u7b97\u51fa\u5173\u7fbd\u6df1\u5ea6\u7684 \u91cd\u6295\u5f71\u8bef\u5dee\uff1a \\(\\Delta z = z_{proj} - z^\\prime\\) \uff0c \\(z^\\prime\\) \u662f\u5f53\u524d\u5e27\u4e2d\u8fd8\u6709\u7684\u5173\u952e\u70b9\u7684\u6df1\u5ea6\uff08\u6d4b\u91cf\u503c\uff09\u3002\u5982\u679c \\(\\Delta z > \\tau_z\\) \uff0c\u5173\u952e\u70b9 \\(x^\\prime\\) \u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u7269\u4f53\u3002\u4e3a\u4e86\u4e00\u4e2a\u597d\u7684\u7cbe\u5ea6\u548c\u53ec\u56de\u7387\uff0c\u901a\u8fc7\u6700\u5927\u5316 \\(0.7 * Presion + 0.3 * Recall\\) \uff0c\u5c06 \\(\\tau_z\\) \u5b9a\u4e3a 0.4m\u3002 \u6709\u4e00\u4e9b\u88ab\u6807\u8bb0\u4e3a\u52a8\u6001\u7684\u5173\u952e\u70b9\u4f4d\u4e8e\u79fb\u52a8\u7269\u4f53\u7684\u8fb9\u754c\u4e0a\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5f15\u8d77\u95ee\u9898\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u6240\u63d0\u4f9b\u7684\u4fe1\u606f\u3002 \u5982\u679c\u4e00\u4e2a\u5173\u952e\u70b9\u88ab\u8bbe\u5b9a\u4e3a\u52a8\u6001\uff0c\u4f46\u5728\u6df1\u5ea6\u56fe\u4e2d\u5b83\u5468\u56f4\u7684\u533a\u57df\u6709\u5f88\u5927\u7684\u65b9\u5dee\uff0c\u6211\u4eec\u5c31\u628a\u6807\u7b7e\u6539\u4e3a\u9759\u6001\u3002 \u4e3a\u4e86\u627e\u5230\u52a8\u6001\u7269\u4f53\u7684\u6240\u6709\u50cf\u7d20\u70b9\uff0c\u5728\u6df1\u5ea6\u56fe\u7684\u52a8\u6001\u70b9\u5468\u56f4\u8fdb\u884c\u533a\u57df\u589e\u957f\u7b97\u6cd5\u3002 \u8fd9\u4e24\u79cd\u65b9\u6cd5\u5448\u73b0\u51fa\u529f\u80fd\u4e0a\u7684\u4e92\u8865\uff0c\u6240\u4ee5\u6700\u7ec8\u53d6\u4e86\u4e24\u4e2aMask\u7684\u5e76\u96c6\uff0c\u88ab\u5206\u5272\u7684\u52a8\u6001\u90e8\u5206\u88ab\u4ece\u5f53\u524d\u5e27\u548c\u5730\u56fe\u4e2d\u79fb\u9664\uff1a \u591a\u89c6\u56fe\u51e0\u4f55 \uff1a\u80fd\u8bc6\u522b\u51fa\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u4f46\u9700\u8981\u6709\u591a\u89c6\u56fe\u624d\u80fd\u8fdb\u884c\u521d\u59cb\u5316\u3002\u5728\u56fe4a\u4e2d\u770b\u5230\uff0c\u4e0d\u4ec5\u68c0\u6d4b\u5230\u4e86\u56fe\u50cf\u524d\u9762\u7684\u4eba\uff0c\u800c\u4e14\u8fd8\u68c0\u6d4b\u5230\u4e86\u4ed6\u6240\u62ff\u7684\u4e66\u548c\u4ed6\u6240\u5750\u7684\u6905\u5b50\uff1b\u4f46\u662f\u8fdc\u5904\u7684\u4eba\u5e76\u6ca1\u6709\u88ab\u68c0\u6d4b\u5230\uff0c\u539f\u56e0\u6709\u4e8c\uff1aRGB-D\u76f8\u673a\u5728\u6d4b\u91cf\u8fdc\u5904\u7269\u4f53\u7684\u6df1\u5ea6\u65f6\u4f1a\u6709\u56f0\u96be\uff1b\u5176\u6b21\uff0c\u53ef\u9760\u7684\u7279\u5f81\u4f4d\u4e8e\u786e\u5b9a\u7684\uff0c\u56e0\u6b64\u662f\u9644\u8fd1\u7684\u56fe\u50cf\u90e8\u5206\u3002 \u6df1\u5ea6\u5b66\u4e60 \uff1a\u53ea\u80fd\u8bc6\u522b\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u6ca1\u6709\u521d\u59cb\u5316\u65b9\u9762\u7684\u95ee\u9898\u3002\u53ef\u4ee5\u5728\u56fe4b\u770b\u5230\uff0c\u53ea\u6709\u4e24\u4e2a\u4eba\u88ab\u68c0\u6d4b\u4e3a\u52a8\u6001\u7269\u4f53\uff0c\u800c\u4e14\u5206\u5272\u4e5f\u4e0d\u592a\u51c6\u786e\uff1b\u800c\u6d6e\u52a8\u7684\u4e66\u4f1a\u88ab\u7559\u5728\u56fe\u50cf\u4e2d\uff0c\u5e76\u9519\u8bef\u5730\u6210\u4e3a\u4e09\u7ef4\u5730\u56fe\u7684\u4e00\u90e8\u5206\u3002 Tracking and Mapping \u00b6 \u8fd9\u4e00\u6b65\u4e2d\uff0c\u7cfb\u7edf\u7684\u8f93\u5165\u662f\uff1aRGB\u56fe\uff0c\u6df1\u5ea6\u56fe\u50cf\uff0c\u5206\u5272\u7684Mask\u3002 \u5728\u56fe\u50cf\u4e2d\u63d0\u53d6\u51fa\u7684ORB\u7279\u5f81\u70b9\u90fd\u88ab\u6807\u8bb0\u4e3a\u9759\u6001\u70b9\uff0c \u5982\u679c\u7279\u5f81\u70b9\u843d\u5728\u4e86\u5206\u5272\u8f6e\u5ed3\u5468\u56f4\uff08\u9ad8\u68af\u5ea6\u533a\u57df\uff09\uff0c\u5c31\u4f1a\u88ab\u79fb\u9664\u3002 Background Inpainting \u00b6 \u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u88ab\u79fb\u9664\u7684\u52a8\u6001\u7269\u4f53\uff0c\u5e0c\u671b\u80fd\u7528\u4e4b\u524d\u89c6\u56fe\u4e2d\u7684\u9759\u6001\u4fe1\u606f\u6765\u8865\u5168\u4e22\u5931\u7684\u80cc\u666f\u4fe1\u606f\uff08\u88ab\u52a8\u6001\u7269\u4f53\u906e\u6321\u4e86\u7684\u90e8\u5206\uff09\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5408\u6210\u4e00\u4e2a\u6ca1\u6709\u79fb\u52a8\u7269\u4f53\u7684\u56fe\u50cf\u3002 \u7531\u4e8e\u6211\u4eec\u77e5\u9053\u524d\u4e00\u5e27\u548c\u5f53\u524d\u5e27\u7684\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e9b\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff08\u6b64\u5904\u8bbe\u7f6e\u4e3a\u524d20\u4e2a\uff09\u7684RGB\u548c\u6df1\u5ea6\u56fe\u6295\u5f71\u5230\u5f53\u524d\u5e27\u7684\u52a8\u6001\u533a\u57df\uff1a \u6709\u4e9b\u7a7a\u9699\u6ca1\u6709\u5bf9\u5e94\u5173\u7cfb\uff0c\u88ab\u7559\u4e3a\u7a7a\u767d \u6709\u4e9b\u533a\u57df\u4e0d\u80fd\u88ab\u8865\u5168\uff0c\u56e0\u4e3a\u5176\u5bf9\u5e94\u7684\u573a\u666f\u90e8\u5206\u5230\u76ee\u524d\u8fd8\u6ca1\u51fa\u73b0\u5728\u5173\u952e\u5e27\u4e2d \u5982\u679c\u5b83\u51fa\u73b0\u4e86\uff0c\u4f46\u6ca1\u6709\u6709\u6548\u7684\u6df1\u5ea6\u4fe1\u606f\u3002\u8fd9\u4e9b\u7a7a\u9699\u4e5f\u4e0d\u80fd\u7528\u51e0\u4f55\u65b9\u6cd5\u6765\u91cd\u5efa\uff0c\u800c\u9700\u8981\u4e00\u79cd\u66f4\u590d\u6742\u7684\u6d82\u62b9\u6280\u672f\u3002 \u4ece\u4e0b\u9762\u7684\u56fe5\u53ef\u4ee5\u770b\u5230\u5927\u90e8\u5206\u88ab\u5206\u5272\u7684\u90e8\u5206\u5df2\u7ecf\u7528\u6765\u81ea\u9759\u6001\u80cc\u666f\u7684\u4fe1\u606f\u8fdb\u884c\u4e86\u9002\u5f53\u7684\u8865\u5168\u3002 EXPERIMENTAL RESULTS \u00b6 \u7565\u3002","title":"DynaSLAM"},{"location":"cv/papers/dynamic-slam/dynaslam/#dynaslam","text":"\u7ea6 1868 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 6 \u5206\u949f Abstract paper\uff1a DynaSLAM: Tracking, Mapping and Inpainting in Dynamic Scenes code\uff1a DynaSLAM","title":"DynaSLAM"},{"location":"cv/papers/dynamic-slam/dynaslam/#intruduction","text":"\u5728\u89c6\u89c9SLAM\u4e2d\uff0c\u52a8\u6001\u7269\u4f53\u4f1a\u5e26\u6765\u5982\u4e0b\u6311\u6218\uff1a \u5982\u4f55\u68c0\u6d4b\u56fe\u50cf\u4e2d\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4ece\u800c\uff1a \u9632\u6b62tracking\u7b97\u6cd5\u4f7f\u7528\u52a8\u6001\u7269\u4f53\u4e0a\u7684\u5339\u914d\u70b9\u5bf9 \u9632\u6b62mapping\u7b97\u6cd5\u628a\u79fb\u52a8\u7269\u4f53\u52a0\u51653D\u5730\u56fe\u4e2d \u600e\u4e48\u53bb\u8865\u51683D\u5730\u56fe\u4e2d\u90a3\u4e9b\u88ab\u79fb\u52a8\u7269\u4f53\u6321\u4f4f\u4ece\u800c\u7f3a\u5931\u4e86\u7684\u90e8\u5206\u3002 DynaSLAM\u662f\u53ef\u4ee5\u7528\u4e8e\u5355\u76ee\uff0c\u53cc\u76ee\uff0cRGB-D\u7684\u52a8\u6001SLAM\u7cfb\u7edf\uff0c\u76f8\u5f53\u4e8e\u662f\u5728ORB-SLAM2\u4e0a\u52a0\u4e86\u4e00\u4e2a\u524d\u7aef\u7684\u6a21\u5757\uff0c\u4e0a\u9762\u7684\u4e24\u4e2a\u6311\u6218\uff0c\u8fd9\u7bc7\u8bba\u6587\u90fd\u7ed9\u51fa\u4e86\u5bf9\u5e94\u7684\u89e3\u51b3\u529e\u6cd5\u3002 \u5bf9\u4e8e\u5355\u76ee\u548c\u53cc\u76ee\uff1a\u4f7f\u7528CNN\u8fdb\u884c\u50cf\u7d20\u5206\u5272\uff0c\u628a\u56fe\u50cf\u4e2d\u7684\u4eba\u548c\u8f66\u5254\u9664\uff0c\u7279\u5f81\u63d0\u53d6\u65f6\u5c31\u4e0d\u4f1a\u8fd9\u4e9b\u4e0a\u9762\u63d0\u53d6\u3002 \u5bf9\u4e8eRGB-D\uff1a\u7ed3\u5408\u591a\u89c6\u89d2\u51e0\u4f55\u6a21\u578b\u548c\u6df1\u5ea6\u5b66\u4e60\uff08\u91cd\u70b9\uff01\uff09","title":"INTRUDUCTION"},{"location":"cv/papers/dynamic-slam/dynaslam/#related-work","text":"\u5728\u8fd9\u4e2a\u90e8\u5206\u4f5c\u8005\u8fd8\u603b\u7ed3\u4e86\u4e00\u4e0b\u76ee\u524d\u52a8\u6001SLAM\u7684\u4e00\u4e9b\u65b9\u6cd5\uff1a \u5e38\u89c4\u53bb\u9664\u52a8\u6001\u7684\u5916\u70b9\uff1a RANSAC robust cost function \u5bf9\u4e8e\u57fa\u4e8e\u7279\u5f81\u7684SLAM\uff1a \u901a\u8fc7\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u5f53\u524d\u5e27\u6765\u68c0\u6d4b\u573a\u666f\u4e2d\u7684\u53d8\u5316 \u68c0\u6d4b\u548c\u8ffd\u8e2a\u5df2\u77e5\u76843D\u52a8\u6001\u70b9\uff0c\u6bd4\u5982\u4eba \u4f7f\u7528\u6df1\u5ea6\u8fb9\u7f18\u70b9\uff0c\u4ed6\u6709\u4e00\u4e2a\u76f8\u5173\u8054\u6743\u91cd\u53ef\u4ee5\u7528\u6765\u8868\u793a\u5176\u5c5e\u4e8e\u8fd0\u52a8\u7269\u4f53\u7684\u6982\u7387 \u5bf9\u4e8e\u76f4\u63a5\u6cd5SLAM\uff0c\u4ed6\u5bf9\u52a8\u6001\u7269\u4f53\u66f4\u52a0\u654f\u611f\uff1a \u901a\u8fc7\u53cc\u76ee\u76f8\u673a\u7684\u573a\u666f\u6d41\u6765\u68c0\u6d4b\u79fb\u52a8\u7269\u4f53 \u4f7f\u7528RGB-D\u5149\u6d41\u5206\u5272\u52a8\u6001\u7269\u4f53 \u901a\u8fc7\u8ba1\u7b97\u8fde\u7eed\u5e27\u4e4b\u95f4\u6295\u5f71\u5230\u540c\u4e00\u5e73\u9762\u7684\u6df1\u5ea6\u56fe\u7684\u5dee\u522b\u6765\u627e\u5230\u9759\u6b62\u7684\u90e8\u5206 \u8ba1\u7b97\u8fde\u7eedRGB\u56fe\u50cf\u4e4b\u95f4intensity\u7684\u5dee\u522b\uff0c\u50cf\u7d20\u5206\u7c7b\u901a\u8fc7\u5bf9\u91cf\u5316\u7684\u6df1\u5ea6\u56fe\u8fdb\u884c\u5206\u5272\u800c\u5b8c\u6210\uff1f \u4e0a\u9762\u5217\u51fa\u5173\u4e8e\u7279\u5f81\u6cd5\u548c\u76f4\u63a5\u6cd5\u7684\u65b9\u6848\u90fd\u6709\u4e00\u4e9b\u95ee\u9898\u6ca1\u80fd\u89e3\u51b3\uff1a \u4e0d\u80fd\u4f30\u8ba1\u4e00\u4e9b\u4fdd\u6301\u9759\u6b62\u7684\u5148\u9a8c\u52a8\u6001\u7269\u4f53\uff0c\u6bd4\u5982\u9759\u6b62\u7684\u6c7d\u8f66\uff0c\u5750\u7740\u7684\u4eba \u4e0d\u80fd\u68c0\u6d4b\u9759\u6001\u7269\u4f53\u5f15\u8d77\u7684\u53d8\u5316\uff0c\u6bd4\u5982\u8bf4\u88ab\u4eba\u62d6\u52a8\u7684\u6905\u5b50\uff0c\u6216\u8005\u88ab\u4eba\u4e22\u98de\u7684\u7403\u3002 \u800cDynaSLAM\u4e0d\u4ec5\u53ef\u4ee5\u68c0\u6d4b\u51fa\u6b63\u5728\u79fb\u52a8\u7684\u7269\u4f53\uff0c\u8fd8\u53ef\u4ee5\u68c0\u6d4b\u51fa\u4e00\u4e9b\u201c\u53ef\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\u3002","title":"RELATED WORK"},{"location":"cv/papers/dynamic-slam/dynaslam/#system-description","text":"","title":"SYSTEM DESCRIPTION"},{"location":"cv/papers/dynamic-slam/dynaslam/#segmentation-of-potentially-dynamic-content-using-a-cnn","text":"\u4f7f\u7528 MASK-RCNN \u8fdb\u884c\u50cf\u7d20\u7ea7\u5206\u5272\uff0c\u53ea\u7528\u5230\u8bed\u4e49\u4fe1\u606f\u3002","title":"Segmentation of Potentially Dynamic Content using a CNN"},{"location":"cv/papers/dynamic-slam/dynaslam/#low-cost-tracking","text":"\u4e0a\u4e00\u6b65\u4e2d\u628a\u52a8\u6001\u7279\u5f81\u70b9\u53bb\u9664\u540e\uff0c\u7528\u5269\u4e0b\u7684\u9759\u6001\u70b9\u7ebf\u6c42\u51fa\u4e00\u4e2a\u76f8\u673a\u7684\u4f4d\u59ff\u3002\u7531\u4e8e\u8ba1\u7b97\u7279\u5f81\u70b9\u7684\u65f6\u5019\uff0c\u7279\u5f81\u70b9\u672c\u5c31\u559c\u6b22\u843d\u5728\u5206\u5272\u8f6e\u5ed3\u8fd9\u79cd\u9ad8\u68af\u5ea6\u533a\u57df\uff08\u53ef\u4ee5\u627e\u56fe\u7247\u770b\u4e00\u4e0b\uff0c\u6bd4\u5982\uff0c\u4eba\u8eab\u4f53\u5206\u51fa\u6765\u7684\u5206\u5272\u8fb9\u754c\uff0c\u540e\u9762\u5c31\u662f\u80cc\u666f\uff0c\u6709\u4e00\u4e9b\u906e\u6321\u5173\u7cfb\uff0c\u5206\u5272\u8fb9\u754c\u9644\u8fd1\u4f1a\u662f\u68af\u5ea6\u53d8\u5316\u5927\u7684\u533a\u57df\uff0c\u7279\u5f81\u70b9\u672c\u8eab\u5c31\u5bb9\u6613\u843d\u5728\u8fd9\u79cd\u5730\u65b9\uff09\uff0c\u6240\u4ee5\u8fd9\u4e2a\u5206\u5272\u8f6e\u5ed3\u9644\u8fd1\u7684\u70b9\u4e5f\u4e0d\u8981\uff0c\u4ee3\u7801\u4e2d\u7528\u4e86erode\u5904\u7406\u3002\u8fd9\u4e00\u6b65\u7684tracking\u8ba1\u7b97\u6bd4\u8f83\u7b80\u5355\uff0c\u662fORB\u539f\u7248\u7684\u7b80\u5316\u3002\u628a\u5730\u56fe\u7279\u5f81\u70b9\u6295\u5f71\u5230\u56fe\u50cf\u5e27\uff0c\u627e\u5230\u5730\u56fe\u70b9\u5728\u56fe\u50cf\u9759\u6001\u533a\u57df\u4e2d\u5bf9\u5e94\u7684\u5339\u914d\u70b9\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u91cd\u6295\u5f71\u8bef\u5dee\u6765\u4f18\u5316\u76f8\u673a\u4f4d\u59ff\u3002","title":"Low-Cost Tracking"},{"location":"cv/papers/dynamic-slam/dynaslam/#segmentation-of-dynamic-content-using-mask-r-cnn-and-multi-view-geometry","text":"\u4f7f\u7528MASK-RCNN\u53ea\u80fd\u5206\u5272\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u4e0d\u80fd\u627e\u5230\u90a3\u4e9b\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u6bd4\u5982\u88ab\u4eba\u62ff\u7740\u7684\u4e66\uff0c\u8ddf\u4eba\u4e00\u8d77\u79fb\u52a8\u7684\u8f6c\u6905\u7b49\u7b49\u3002\u4e3a\u4e86\u89e3\u51b3\u8fd9\u79cd\u60c5\u51b5\uff0c\u5c31\u91c7\u7528\u4e86\u4e0b\u9762\u7684\u591a\u89c6\u56fe\u51e0\u4f55\u7684\u65b9\u6cd5\uff1a \u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u8f93\u5165\u5e27\uff0c\u9009\u62e9\u4e4b\u524d\u7684\u548c\u8f93\u5165\u5e27\u6709\u6700\u9ad8\u91cd\u5408\u5ea6\u7684\u591a\u4e2a\u5173\u952e\u5e27\uff08\u8bba\u6587\u8bbe\u7f6e\u4e3a5\u4e2a\uff09\uff0c\u8fd9\u4e2a\u91cd\u5408\u5ea6\u662f\u901a\u8fc7\u8003\u8651\u65b0\u7684\u4e00\u5e27\u548c\u6bcf\u4e2a\u5173\u952e\u5e27\u4e4b\u95f4\u7684\u8ddd\u79bb\u548c\u65cb\u8f6c\u6765\u51b3\u5b9a\u7684\u3002 \u628a\u4e4b\u524d\u5173\u952e\u5e27\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u70b9 \\(x\\) \u90fd\u6295\u5f71\u5230\u5f53\u524d\u5e27\uff0c\u5f97\u5230\u5173\u952e\u70b9 \\(x^\\prime\\) \u548c\u5b83\u4eec\u7684\u6295\u5f71\u6df1\u5ea6 \\(z_{proj}\\) \u5bf9\u4e8e\u6bcf\u4e2a\u5173\u952e\u70b9\uff0c\u5b83\u5bf9\u5e94\u76843D\u70b9\u662f \\(X\\) \u3002\u7136\u540e\uff0c\u8ba1\u7b97 \\(x\\) \u548c \\(x^\\prime\\) \u53cd\u6295\u5f71\u4e4b\u95f4\u7684\u5939\u89d2\uff0c\u5373\u89c6\u5dee\u89d2 \\(\\alpha\\) \u3002 \u5982\u679c\u89d2\u5ea6\u5927\u4e8e30\u5ea6\uff0c\u8fd9\u4e2a\u70b9\u5c31\u6709\u53ef\u80fd\u88ab\u906e\u6321 \uff0c\u4e4b\u540e\u5c31\u4f1a\u88ab\u5ffd\u7565\u3002\u6bd4\u5982\u5728TUM\u6570\u636e\u96c6\u4e2d\uff0c\u5982\u679c\u89c6\u5dee\u89d2\u5927\u4e8e30\u5ea6\uff0c\u7531\u4e8e\u89c6\u89d2\u7684\u4e0d\u540c\uff0c\u9759\u6001\u70b9\u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u3002 \u8ba1\u7b97\u51fa\u5173\u7fbd\u6df1\u5ea6\u7684 \u91cd\u6295\u5f71\u8bef\u5dee\uff1a \\(\\Delta z = z_{proj} - z^\\prime\\) \uff0c \\(z^\\prime\\) \u662f\u5f53\u524d\u5e27\u4e2d\u8fd8\u6709\u7684\u5173\u952e\u70b9\u7684\u6df1\u5ea6\uff08\u6d4b\u91cf\u503c\uff09\u3002\u5982\u679c \\(\\Delta z > \\tau_z\\) \uff0c\u5173\u952e\u70b9 \\(x^\\prime\\) \u5c31\u4f1a\u88ab\u89c6\u4e3a\u52a8\u6001\u7269\u4f53\u3002\u4e3a\u4e86\u4e00\u4e2a\u597d\u7684\u7cbe\u5ea6\u548c\u53ec\u56de\u7387\uff0c\u901a\u8fc7\u6700\u5927\u5316 \\(0.7 * Presion + 0.3 * Recall\\) \uff0c\u5c06 \\(\\tau_z\\) \u5b9a\u4e3a 0.4m\u3002 \u6709\u4e00\u4e9b\u88ab\u6807\u8bb0\u4e3a\u52a8\u6001\u7684\u5173\u952e\u70b9\u4f4d\u4e8e\u79fb\u52a8\u7269\u4f53\u7684\u8fb9\u754c\u4e0a\uff0c\u8fd9\u53ef\u80fd\u4f1a\u5f15\u8d77\u95ee\u9898\u3002\u4e3a\u4e86\u907f\u514d\u8fd9\u79cd\u60c5\u51b5\uff0c\u53ef\u4ee5\u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u6240\u63d0\u4f9b\u7684\u4fe1\u606f\u3002 \u5982\u679c\u4e00\u4e2a\u5173\u952e\u70b9\u88ab\u8bbe\u5b9a\u4e3a\u52a8\u6001\uff0c\u4f46\u5728\u6df1\u5ea6\u56fe\u4e2d\u5b83\u5468\u56f4\u7684\u533a\u57df\u6709\u5f88\u5927\u7684\u65b9\u5dee\uff0c\u6211\u4eec\u5c31\u628a\u6807\u7b7e\u6539\u4e3a\u9759\u6001\u3002 \u4e3a\u4e86\u627e\u5230\u52a8\u6001\u7269\u4f53\u7684\u6240\u6709\u50cf\u7d20\u70b9\uff0c\u5728\u6df1\u5ea6\u56fe\u7684\u52a8\u6001\u70b9\u5468\u56f4\u8fdb\u884c\u533a\u57df\u589e\u957f\u7b97\u6cd5\u3002 \u8fd9\u4e24\u79cd\u65b9\u6cd5\u5448\u73b0\u51fa\u529f\u80fd\u4e0a\u7684\u4e92\u8865\uff0c\u6240\u4ee5\u6700\u7ec8\u53d6\u4e86\u4e24\u4e2aMask\u7684\u5e76\u96c6\uff0c\u88ab\u5206\u5272\u7684\u52a8\u6001\u90e8\u5206\u88ab\u4ece\u5f53\u524d\u5e27\u548c\u5730\u56fe\u4e2d\u79fb\u9664\uff1a \u591a\u89c6\u56fe\u51e0\u4f55 \uff1a\u80fd\u8bc6\u522b\u51fa\u201c\u53ef\u4ee5\u88ab\u79fb\u52a8\u201d\u7684\u7269\u4f53\uff0c\u4f46\u9700\u8981\u6709\u591a\u89c6\u56fe\u624d\u80fd\u8fdb\u884c\u521d\u59cb\u5316\u3002\u5728\u56fe4a\u4e2d\u770b\u5230\uff0c\u4e0d\u4ec5\u68c0\u6d4b\u5230\u4e86\u56fe\u50cf\u524d\u9762\u7684\u4eba\uff0c\u800c\u4e14\u8fd8\u68c0\u6d4b\u5230\u4e86\u4ed6\u6240\u62ff\u7684\u4e66\u548c\u4ed6\u6240\u5750\u7684\u6905\u5b50\uff1b\u4f46\u662f\u8fdc\u5904\u7684\u4eba\u5e76\u6ca1\u6709\u88ab\u68c0\u6d4b\u5230\uff0c\u539f\u56e0\u6709\u4e8c\uff1aRGB-D\u76f8\u673a\u5728\u6d4b\u91cf\u8fdc\u5904\u7269\u4f53\u7684\u6df1\u5ea6\u65f6\u4f1a\u6709\u56f0\u96be\uff1b\u5176\u6b21\uff0c\u53ef\u9760\u7684\u7279\u5f81\u4f4d\u4e8e\u786e\u5b9a\u7684\uff0c\u56e0\u6b64\u662f\u9644\u8fd1\u7684\u56fe\u50cf\u90e8\u5206\u3002 \u6df1\u5ea6\u5b66\u4e60 \uff1a\u53ea\u80fd\u8bc6\u522b\u51fa\u5148\u9a8c\u7684\u52a8\u6001\u7269\u4f53\uff0c\u4f46\u662f\u6ca1\u6709\u521d\u59cb\u5316\u65b9\u9762\u7684\u95ee\u9898\u3002\u53ef\u4ee5\u5728\u56fe4b\u770b\u5230\uff0c\u53ea\u6709\u4e24\u4e2a\u4eba\u88ab\u68c0\u6d4b\u4e3a\u52a8\u6001\u7269\u4f53\uff0c\u800c\u4e14\u5206\u5272\u4e5f\u4e0d\u592a\u51c6\u786e\uff1b\u800c\u6d6e\u52a8\u7684\u4e66\u4f1a\u88ab\u7559\u5728\u56fe\u50cf\u4e2d\uff0c\u5e76\u9519\u8bef\u5730\u6210\u4e3a\u4e09\u7ef4\u5730\u56fe\u7684\u4e00\u90e8\u5206\u3002","title":"Segmentation of Dynamic Content using Mask R-CNN and Multi-view Geometry"},{"location":"cv/papers/dynamic-slam/dynaslam/#tracking-and-mapping","text":"\u8fd9\u4e00\u6b65\u4e2d\uff0c\u7cfb\u7edf\u7684\u8f93\u5165\u662f\uff1aRGB\u56fe\uff0c\u6df1\u5ea6\u56fe\u50cf\uff0c\u5206\u5272\u7684Mask\u3002 \u5728\u56fe\u50cf\u4e2d\u63d0\u53d6\u51fa\u7684ORB\u7279\u5f81\u70b9\u90fd\u88ab\u6807\u8bb0\u4e3a\u9759\u6001\u70b9\uff0c \u5982\u679c\u7279\u5f81\u70b9\u843d\u5728\u4e86\u5206\u5272\u8f6e\u5ed3\u5468\u56f4\uff08\u9ad8\u68af\u5ea6\u533a\u57df\uff09\uff0c\u5c31\u4f1a\u88ab\u79fb\u9664\u3002","title":"Tracking and Mapping"},{"location":"cv/papers/dynamic-slam/dynaslam/#background-inpainting","text":"\u5bf9\u4e8e\u6bcf\u4e00\u4e2a\u88ab\u79fb\u9664\u7684\u52a8\u6001\u7269\u4f53\uff0c\u5e0c\u671b\u80fd\u7528\u4e4b\u524d\u89c6\u56fe\u4e2d\u7684\u9759\u6001\u4fe1\u606f\u6765\u8865\u5168\u4e22\u5931\u7684\u80cc\u666f\u4fe1\u606f\uff08\u88ab\u52a8\u6001\u7269\u4f53\u906e\u6321\u4e86\u7684\u90e8\u5206\uff09\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5408\u6210\u4e00\u4e2a\u6ca1\u6709\u79fb\u52a8\u7269\u4f53\u7684\u56fe\u50cf\u3002 \u7531\u4e8e\u6211\u4eec\u77e5\u9053\u524d\u4e00\u5e27\u548c\u5f53\u524d\u5e27\u7684\u4f4d\u7f6e\uff0c\u53ef\u4ee5\u5c06\u4e00\u4e9b\u4e4b\u524d\u7684\u5173\u952e\u5e27\uff08\u6b64\u5904\u8bbe\u7f6e\u4e3a\u524d20\u4e2a\uff09\u7684RGB\u548c\u6df1\u5ea6\u56fe\u6295\u5f71\u5230\u5f53\u524d\u5e27\u7684\u52a8\u6001\u533a\u57df\uff1a \u6709\u4e9b\u7a7a\u9699\u6ca1\u6709\u5bf9\u5e94\u5173\u7cfb\uff0c\u88ab\u7559\u4e3a\u7a7a\u767d \u6709\u4e9b\u533a\u57df\u4e0d\u80fd\u88ab\u8865\u5168\uff0c\u56e0\u4e3a\u5176\u5bf9\u5e94\u7684\u573a\u666f\u90e8\u5206\u5230\u76ee\u524d\u8fd8\u6ca1\u51fa\u73b0\u5728\u5173\u952e\u5e27\u4e2d \u5982\u679c\u5b83\u51fa\u73b0\u4e86\uff0c\u4f46\u6ca1\u6709\u6709\u6548\u7684\u6df1\u5ea6\u4fe1\u606f\u3002\u8fd9\u4e9b\u7a7a\u9699\u4e5f\u4e0d\u80fd\u7528\u51e0\u4f55\u65b9\u6cd5\u6765\u91cd\u5efa\uff0c\u800c\u9700\u8981\u4e00\u79cd\u66f4\u590d\u6742\u7684\u6d82\u62b9\u6280\u672f\u3002 \u4ece\u4e0b\u9762\u7684\u56fe5\u53ef\u4ee5\u770b\u5230\u5927\u90e8\u5206\u88ab\u5206\u5272\u7684\u90e8\u5206\u5df2\u7ecf\u7528\u6765\u81ea\u9759\u6001\u80cc\u666f\u7684\u4fe1\u606f\u8fdb\u884c\u4e86\u9002\u5f53\u7684\u8865\u5168\u3002","title":"Background Inpainting"},{"location":"cv/papers/dynamic-slam/dynaslam/#experimental-results","text":"\u7565\u3002","title":"EXPERIMENTAL RESULTS"},{"location":"cv/papers/dynamic-slam/flowfusion/","text":"FlowFusion \u00b6 \u7ea6 861 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a FlowFusion: Dynamic Dense RGB-D SLAM Based on Optical Flow Introduction \u00b6 \u57fa\u4e8e\u6d41\u7684\u52a8\u6001/\u9759\u6001\u5206\u5272\u6765\u5904\u7406\u52a8\u6001SLAM\u95ee\u9898\u3002 \u63d0\u4f9b\u4e86\u4e00\u79cd\u65b0\u9896\u7684\u57fa\u4e8e\u5149\u6d41\u6b8b\u5dee\u7684\u52a8\u6001\u5206\u5272\u548c\u5bc6\u96c6\u878d\u5408RGB-D SLAM\u65b9\u6848\u3002 \u901a\u8fc7\u6539\u5584\u52a8\u6001\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u5728\u5f53\u524dRGB-D\u5e27\u4e2d\u6709\u6548\u5730\u63d0\u53d6\u52a8\u6001\u7247\u6bb5\uff0c\u7136\u540e\u51c6\u786e\u5730\u91cd\u5efa\u9759\u6001\u73af\u5883\u3002 RELATED WORKS \u00b6 KinectFusion \u548c ElasticFusion\uff08EF\uff09 \u5b9e\u65f6\u91cd\u5efa\u9759\u6001\u5ba4\u5185\u73af\u5883\u3002 Co-Fusion\uff08CF\uff09\u662f\u4e00\u4e2a\u5b9e\u65f6\u7269\u4f53\u5206\u5272\u548c\u8ffd\u8e2a\u65b9\u6cd5\uff0c\u7ed3\u5408\u4e86\u57fa\u4e8e\u5206\u5c42\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u5272\u65b9\u6cd5\u548c EF \u7684\u9759\u6001\u7a20\u5bc6\u91cd\u5efa\u6846\u67b6\u3002 \u9664\u4e86\u8bed\u4e49\u6807\u8bb0\u89e3\u51b3\u65b9\u6848\u5916\uff0c\u8fd8\u6709\u4ece\u7a20\u5bc6\u7684 RGB-D \u878d\u5408\u65b9\u6848\u4e2d\u627e\u51fa\u52a8\u6001\u70b9\u4e91\u4f5c\u4e3a\u5f02\u5e38\u503c\u3002\u4f8b\u5982\u8054\u5408\u8fd0\u52a8\u5206\u5272\u548c\u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff08JF\uff09\uff0c\u4ee5\u53ca\u4e00\u79cd\u9759\u6001\u80cc\u666f\u91cd\u5efa\u65b9\u6cd5\uff08SF\uff09\u3002 \u5229\u7528\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u76ee\u6807\u68c0\u6d4b\u65b9\u6cd5\uff0c\u901a\u8fc7\u9884\u5904\u7406\u53bb\u9664\u6f5c\u5728\u7684\u52a8\u6001\u7269\u4f53\uff0c\u7136\u540e\u91cd\u5efa\u73af\u5883\u3002\u4f8b\u5982 PoseFusion\uff08PF\uff09\u3002 \u5c06\u73af\u5883\u52a8\u6001\u5c5e\u6027\u5b9a\u4e49\u4e3a\u8bed\u4e49\u6982\u5ff5\uff0c\u5e76\u5229\u7528 SLAM \u5de5\u5177\u89e3\u51b3\u3002\u4f8b\u5982\u4e00\u79cd\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684 3D \u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u7ed3\u5408\u4e86\u4e24\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u3002 OPTICAL FLOW BASED JOINT DYNAMIC SEGMENTATION AND DENSE FUSION \u00b6 Visual Odometry in Dense RGB-D Fusion \u00b6 \u8f93\u5165\u4e24\u4e2a\u8fde\u7eed\u7684 RGB-D \u5e27 A \u548c B\uff0cRGB \u56fe\u50cf\u9996\u5148\u88ab\u9988\u9001\u5230 PWC-net \u7528\u4e8e\u5149\u6d41\u4f30\u8ba1\u3002 \u5f3a\u5ea6\u548c\u6df1\u5ea6\u5bf9 A \u548c B \u88ab\u9988\u9001\u5230\u9c81\u68d2\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u4f30\u8ba1\u5668\uff0c\u4ee5\u521d\u59cb\u5316\u76f8\u673a\u8fd0\u52a8 Optical Flow Residual Estimated by Projecting the Scene Flow \u00b6 \u901a\u8fc7\u8ba1\u7b97\u6bcf\u4e2a\u7c07\u7684\u5e73\u5747\u6b8b\u5dee\u6765\u533a\u5206\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53 \u4f8b\u5982\u80cc\u666f\u4e0d\u79fb\u52a8\uff0c\u56e0\u6b64\u5b83\u4eec\u7684\u6b8b\u5dee\u8f83\u4f4e \u52a8\u6001\u7269\u4f53\u7684\u6b8b\u5dee\u8f83\u9ad8 \u6df1\u5ea6\u548c\u5f3a\u5ea6\u7684\u6b8b\u5dee\u4e0d\u662f\u4e00\u4e2a\u597d\u7684\u6307\u6807\uff0c\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528\u573a\u666f\u6d41\u8bc4\u4f30\u79fb\u52a8\u70b9\u4e91 \u4e3a\u4e86\u6446\u8131\u76f8\u673a\u7684\u81ea\u8eab\u8fd0\u52a8\uff0c\u5f15\u5165\u4e86\u5149\u6d41\u6b8b\u5dee\u7684\u6982\u5ff5\uff0c\u88ab\u5b9a\u4e49\u4e3a\u6295\u5f71\u7684 2D \u573a\u666f\u6d41\uff0c\u4ee5\u7a81\u51fa\u50cf\u7d20\u7684\u52a8\u6001\u5c5e\u6027\u3002 \u4e0b\u56fe\u662f\u6295\u5f71\u7684 2D \u573a\u666f\u5728\u56fe\u50cf\u5e73\u9762\u4e2d\u6d41\u52a8 \\(x^p\\) \u662f\u5e27 A \u4e2d\u7684\u4e00\u4e2a\u5bf9\u8c61\u70b9\u6295\u5f71\u50cf\u7d20 \\(x^q\\) \u662f\u5e27 B \u4e2d\u7684\u540c\u4e00\u4e2a 3D \u70b9\uff08\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\uff09 \u7ea2\u8272\u7bad\u5934\u8868\u793a\u573a\u666f\u6d41\uff08\u4e16\u754c\u7a7a\u95f4\u8fd0\u52a8\uff09 \u84dd\u8272\u7bad\u5934\u662f \\(x^{a \\to b}\\) \u4e2d\u7684\u5149\u6d41 \u7eff\u8272\u7bad\u5934 \\(x^{sf}\\) \u662f\u56fe\u50cf\u5e73\u9762\u4e2d\u6295\u5f71\u7684 2D \u573a\u666f\u6d41 \\(x^e\\) \u662f\u6444\u50cf\u673a\u81ea\u8eab\u8fd0\u52a8\u4ea7\u751f\u7684\u6d41 \u4e0b\u56fe\u662f\u8fed\u4ee3\u4f30\u8ba1\u52a8\u6001\u573a\u666f\u4e2d\u76842D\u573a\u666f\u6d41.(a)\u662f\u673a\u5668\u4eba\u5411\u5de6\u79fb\u52a8\u800c\u4eba\u7c7b\u5411\u53f3\u79fb\u52a8\u7684\u573a\u666f.(b)\u662f\u6839\u636e(a)\u7684\u56fe\u50cf\u5bf9\u4f30\u8ba1\u7684\u5149\u6d41.\u989c\u8272\u8868\u793a\u6d41\u52a8\u65b9\u5411,\u5f3a\u5ea6\u8868\u793a\u50cf\u7d20\u4f4d\u79fb.\u84dd\u8272\u7684\u6d41\u52a8\u662f\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u7684\u7ed3\u679c.\u6211\u4eec\u4ece\u5149\u6d41\u4e2d\u51cf\u53bb\u81ea\u6211\u6d41,\u5f97\u5230\u50cf\u5e73\u9762\u4e0a\u7684\u573a\u666f\u6d41\u5206\u91cf,\u5982(c)\u6240\u793a.\u5728(b)\u4e2d\u8fed\u4ee3\u5730\u79fb\u9664\u573a\u666f\u6d41\u548c \\(x^e\\) \u57287\u6b21\u8fed\u4ee3\u4e4b\u540e\u5c31\u53ef\u4ee5\u83b7\u5f97\u66f4\u597d\u76842D\u573a\u666f\u6d41\u7ed3\u679c,\u5982(d). Dynamic Clusters Segmentation \u00b6 \u5df2\u7ecf\u5b9a\u4e49\u4e86\u4e09\u4e2a\u6b8b\u5dee \\(r_I, r_D, r_F\\) \uff0c\u5206\u522b\u8868\u793a\u4e3a\u5f3a\u5ea6\u3001\u6df1\u5ea6\u548c\u5149\u6d41 \u901a\u8fc7\u4e24\u6b65\u6765\u533a\u5206\u7c07\u662f\u5426\u4e3a\u52a8\u6001\u800c\u4e0d\u4f9d\u9760\u5e73\u5747\u6b8b\u5dee \u8ba1\u7b97\u4e00\u4e2a\u6307\u6807\u6765\u7ec4\u5408\u8fd9\u4e09\u4e2a\u6b8b\u5dee \u8bbe\u8ba1\u4e00\u4e2a\u6700\u5c0f\u5316\u51fd\u6570\u6765\u9650\u5b9a\u7c07\u7684\u52a8\u6001\u7c7b\u522b DYNAMIC SLAM EXPERIMENTS AND EVALUATIONS \u00b6 \u7565\u3002","title":"FlowFusion"},{"location":"cv/papers/dynamic-slam/flowfusion/#flowfusion","text":"\u7ea6 861 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a FlowFusion: Dynamic Dense RGB-D SLAM Based on Optical Flow","title":"FlowFusion"},{"location":"cv/papers/dynamic-slam/flowfusion/#introduction","text":"\u57fa\u4e8e\u6d41\u7684\u52a8\u6001/\u9759\u6001\u5206\u5272\u6765\u5904\u7406\u52a8\u6001SLAM\u95ee\u9898\u3002 \u63d0\u4f9b\u4e86\u4e00\u79cd\u65b0\u9896\u7684\u57fa\u4e8e\u5149\u6d41\u6b8b\u5dee\u7684\u52a8\u6001\u5206\u5272\u548c\u5bc6\u96c6\u878d\u5408RGB-D SLAM\u65b9\u6848\u3002 \u901a\u8fc7\u6539\u5584\u52a8\u6001\u56e0\u7d20\u7684\u5f71\u54cd\uff0c\u5728\u5f53\u524dRGB-D\u5e27\u4e2d\u6709\u6548\u5730\u63d0\u53d6\u52a8\u6001\u7247\u6bb5\uff0c\u7136\u540e\u51c6\u786e\u5730\u91cd\u5efa\u9759\u6001\u73af\u5883\u3002","title":"Introduction"},{"location":"cv/papers/dynamic-slam/flowfusion/#related-works","text":"KinectFusion \u548c ElasticFusion\uff08EF\uff09 \u5b9e\u65f6\u91cd\u5efa\u9759\u6001\u5ba4\u5185\u73af\u5883\u3002 Co-Fusion\uff08CF\uff09\u662f\u4e00\u4e2a\u5b9e\u65f6\u7269\u4f53\u5206\u5272\u548c\u8ffd\u8e2a\u65b9\u6cd5\uff0c\u7ed3\u5408\u4e86\u57fa\u4e8e\u5206\u5c42\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u5272\u65b9\u6cd5\u548c EF \u7684\u9759\u6001\u7a20\u5bc6\u91cd\u5efa\u6846\u67b6\u3002 \u9664\u4e86\u8bed\u4e49\u6807\u8bb0\u89e3\u51b3\u65b9\u6848\u5916\uff0c\u8fd8\u6709\u4ece\u7a20\u5bc6\u7684 RGB-D \u878d\u5408\u65b9\u6848\u4e2d\u627e\u51fa\u52a8\u6001\u70b9\u4e91\u4f5c\u4e3a\u5f02\u5e38\u503c\u3002\u4f8b\u5982\u8054\u5408\u8fd0\u52a8\u5206\u5272\u548c\u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff08JF\uff09\uff0c\u4ee5\u53ca\u4e00\u79cd\u9759\u6001\u80cc\u666f\u91cd\u5efa\u65b9\u6cd5\uff08SF\uff09\u3002 \u5229\u7528\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u76ee\u6807\u68c0\u6d4b\u65b9\u6cd5\uff0c\u901a\u8fc7\u9884\u5904\u7406\u53bb\u9664\u6f5c\u5728\u7684\u52a8\u6001\u7269\u4f53\uff0c\u7136\u540e\u91cd\u5efa\u73af\u5883\u3002\u4f8b\u5982 PoseFusion\uff08PF\uff09\u3002 \u5c06\u73af\u5883\u52a8\u6001\u5c5e\u6027\u5b9a\u4e49\u4e3a\u8bed\u4e49\u6982\u5ff5\uff0c\u5e76\u5229\u7528 SLAM \u5de5\u5177\u89e3\u51b3\u3002\u4f8b\u5982\u4e00\u79cd\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684 3D \u573a\u666f\u6d41\u4f30\u8ba1\u65b9\u6cd5\uff0c\u8be5\u65b9\u6cd5\u7ed3\u5408\u4e86\u4e24\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u3002","title":"RELATED WORKS"},{"location":"cv/papers/dynamic-slam/flowfusion/#optical-flow-based-joint-dynamic-segmentation-and-dense-fusion","text":"","title":"OPTICAL FLOW BASED JOINT DYNAMIC SEGMENTATION AND DENSE FUSION"},{"location":"cv/papers/dynamic-slam/flowfusion/#visual-odometry-in-dense-rgb-d-fusion","text":"\u8f93\u5165\u4e24\u4e2a\u8fde\u7eed\u7684 RGB-D \u5e27 A \u548c B\uff0cRGB \u56fe\u50cf\u9996\u5148\u88ab\u9988\u9001\u5230 PWC-net \u7528\u4e8e\u5149\u6d41\u4f30\u8ba1\u3002 \u5f3a\u5ea6\u548c\u6df1\u5ea6\u5bf9 A \u548c B \u88ab\u9988\u9001\u5230\u9c81\u68d2\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u4f30\u8ba1\u5668\uff0c\u4ee5\u521d\u59cb\u5316\u76f8\u673a\u8fd0\u52a8","title":"Visual Odometry in Dense RGB-D Fusion"},{"location":"cv/papers/dynamic-slam/flowfusion/#optical-flow-residual-estimated-by-projecting-the-scene-flow","text":"\u901a\u8fc7\u8ba1\u7b97\u6bcf\u4e2a\u7c07\u7684\u5e73\u5747\u6b8b\u5dee\u6765\u533a\u5206\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53 \u4f8b\u5982\u80cc\u666f\u4e0d\u79fb\u52a8\uff0c\u56e0\u6b64\u5b83\u4eec\u7684\u6b8b\u5dee\u8f83\u4f4e \u52a8\u6001\u7269\u4f53\u7684\u6b8b\u5dee\u8f83\u9ad8 \u6df1\u5ea6\u548c\u5f3a\u5ea6\u7684\u6b8b\u5dee\u4e0d\u662f\u4e00\u4e2a\u597d\u7684\u6307\u6807\uff0c\u89e3\u51b3\u65b9\u6848\u662f\u4f7f\u7528\u573a\u666f\u6d41\u8bc4\u4f30\u79fb\u52a8\u70b9\u4e91 \u4e3a\u4e86\u6446\u8131\u76f8\u673a\u7684\u81ea\u8eab\u8fd0\u52a8\uff0c\u5f15\u5165\u4e86\u5149\u6d41\u6b8b\u5dee\u7684\u6982\u5ff5\uff0c\u88ab\u5b9a\u4e49\u4e3a\u6295\u5f71\u7684 2D \u573a\u666f\u6d41\uff0c\u4ee5\u7a81\u51fa\u50cf\u7d20\u7684\u52a8\u6001\u5c5e\u6027\u3002 \u4e0b\u56fe\u662f\u6295\u5f71\u7684 2D \u573a\u666f\u5728\u56fe\u50cf\u5e73\u9762\u4e2d\u6d41\u52a8 \\(x^p\\) \u662f\u5e27 A \u4e2d\u7684\u4e00\u4e2a\u5bf9\u8c61\u70b9\u6295\u5f71\u50cf\u7d20 \\(x^q\\) \u662f\u5e27 B \u4e2d\u7684\u540c\u4e00\u4e2a 3D \u70b9\uff08\u5c5e\u4e8e\u79fb\u52a8\u5bf9\u8c61\uff09 \u7ea2\u8272\u7bad\u5934\u8868\u793a\u573a\u666f\u6d41\uff08\u4e16\u754c\u7a7a\u95f4\u8fd0\u52a8\uff09 \u84dd\u8272\u7bad\u5934\u662f \\(x^{a \\to b}\\) \u4e2d\u7684\u5149\u6d41 \u7eff\u8272\u7bad\u5934 \\(x^{sf}\\) \u662f\u56fe\u50cf\u5e73\u9762\u4e2d\u6295\u5f71\u7684 2D \u573a\u666f\u6d41 \\(x^e\\) \u662f\u6444\u50cf\u673a\u81ea\u8eab\u8fd0\u52a8\u4ea7\u751f\u7684\u6d41 \u4e0b\u56fe\u662f\u8fed\u4ee3\u4f30\u8ba1\u52a8\u6001\u573a\u666f\u4e2d\u76842D\u573a\u666f\u6d41.(a)\u662f\u673a\u5668\u4eba\u5411\u5de6\u79fb\u52a8\u800c\u4eba\u7c7b\u5411\u53f3\u79fb\u52a8\u7684\u573a\u666f.(b)\u662f\u6839\u636e(a)\u7684\u56fe\u50cf\u5bf9\u4f30\u8ba1\u7684\u5149\u6d41.\u989c\u8272\u8868\u793a\u6d41\u52a8\u65b9\u5411,\u5f3a\u5ea6\u8868\u793a\u50cf\u7d20\u4f4d\u79fb.\u84dd\u8272\u7684\u6d41\u52a8\u662f\u76f8\u673a\u81ea\u6211\u8fd0\u52a8\u7684\u7ed3\u679c.\u6211\u4eec\u4ece\u5149\u6d41\u4e2d\u51cf\u53bb\u81ea\u6211\u6d41,\u5f97\u5230\u50cf\u5e73\u9762\u4e0a\u7684\u573a\u666f\u6d41\u5206\u91cf,\u5982(c)\u6240\u793a.\u5728(b)\u4e2d\u8fed\u4ee3\u5730\u79fb\u9664\u573a\u666f\u6d41\u548c \\(x^e\\) \u57287\u6b21\u8fed\u4ee3\u4e4b\u540e\u5c31\u53ef\u4ee5\u83b7\u5f97\u66f4\u597d\u76842D\u573a\u666f\u6d41\u7ed3\u679c,\u5982(d).","title":"Optical Flow Residual Estimated by Projecting the Scene Flow"},{"location":"cv/papers/dynamic-slam/flowfusion/#dynamic-clusters-segmentation","text":"\u5df2\u7ecf\u5b9a\u4e49\u4e86\u4e09\u4e2a\u6b8b\u5dee \\(r_I, r_D, r_F\\) \uff0c\u5206\u522b\u8868\u793a\u4e3a\u5f3a\u5ea6\u3001\u6df1\u5ea6\u548c\u5149\u6d41 \u901a\u8fc7\u4e24\u6b65\u6765\u533a\u5206\u7c07\u662f\u5426\u4e3a\u52a8\u6001\u800c\u4e0d\u4f9d\u9760\u5e73\u5747\u6b8b\u5dee \u8ba1\u7b97\u4e00\u4e2a\u6307\u6807\u6765\u7ec4\u5408\u8fd9\u4e09\u4e2a\u6b8b\u5dee \u8bbe\u8ba1\u4e00\u4e2a\u6700\u5c0f\u5316\u51fd\u6570\u6765\u9650\u5b9a\u7c07\u7684\u52a8\u6001\u7c7b\u522b","title":"Dynamic Clusters Segmentation"},{"location":"cv/papers/dynamic-slam/flowfusion/#dynamic-slam-experiments-and-evaluations","text":"\u7565\u3002","title":"DYNAMIC SLAM EXPERIMENTS AND EVALUATIONS"},{"location":"cv/papers/dynamic-slam/rigidfusion/","text":"RigidFusion \u00b6 \u7ea6 1358 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a RigidFusion: Robot Localisation and Mapping in Environments with Large Dynamic Rigid Objects INTRODUCTION \u00b6 \u5728\u771f\u5b9e\u7684 SLAM \u573a\u666f\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5728\u9047\u5230\u5927\u91cf\u52a8\u6001\u969c\u788d\u7269\u7684\u573a\u666f\u65f6\u5019\uff0c\u7279\u522b\u5bb9\u6613\u9020\u6210\u8ddf\u4e22\u7684\u95ee\u9898\u3002\u4f20\u7edf\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\u901a\u8fc7\u5c06\u52a8\u6001\u969c\u788d\u7269\u6ee4\u9664\uff0c\u800c\u672c\u6587\u4e2d\u63d0\u5230\u5c06\u52a8\u6001\u7269\u4f53\u770b\u505a\u521a\u4f53\u8fdb\u884c\u8ddf\u8e2a\u3002 \u6587\u4e2d\u63d0\u51fa\u4e00\u79cd\u65b0\u7684 RGB-D SLAM \u65b9\u6cd5\uff0c\u53ef\u4ee5\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u53ef\u80fd\u906e\u6321\u76f8\u673a\u89c6\u91ce\u4e3b\u8981\u90e8\u5206\u7684\u5927\u578b\u52a8\u6001\u521a\u6027\u7269\u4f53\u3002\u4e4b\u524d\u7684\u65b9\u6cd5\u5c06\u573a\u666f\u7684 \u52a8\u6001\u90e8\u5206\u89c6\u4e3a\u5f02\u5e38\u503c\uff0c\u56e0\u6b64\u5c40\u9650\u4e8e\u573a\u666f\u4e2d\u7684\u5c11\u91cf\u53d8\u5316 \uff0c\u6216\u4f9d\u8d56\u573a\u666f\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u4ee5\u5b9e\u73b0\u9c81\u68d2\u7684\u6444\u50cf\u673a\u8ddf\u8e2a\u3002 \u672c\u6587\u63d0\u51fa\u5c06\u6240\u6709\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u4e00\u4e2a\u521a\u4f53\uff0c\u540c\u65f6\u5206\u5272\u548c\u8ddf\u8e2a\u9759\u6001\u548c\u52a8\u6001\u90e8\u4ef6\u3002 \u56e0\u6b64\uff0c\u5728\u52a8\u6001\u5bf9\u8c61\u9020\u6210\u5927\u906e\u6321\u7684\u73af\u5883\u4e2d\uff0c\u80fd\u591f\u540c\u65f6\u5b9a\u4f4d\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u521a\u6027\u52a8\u6001\u7ec4\u4ef6\u3002 Info \u4e00\u4e2a\u65b0\u7684SLAM\u6846\u67b6\uff0c\u4f7f\u7528RGB-D\u6444\u50cf\u5934\uff0c\u5728\u6574\u4e2aSLAM\u6846\u67b6\u4e2d\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u573a\u666f\uff0c\u901a\u8fc7\u5177\u6709\u6f5c\u5728\u6f02\u79fb\u7684\u8fd0\u52a8\u5148\u9a8c\u6765\u5b8c\u6210\u9759\u6001\u80cc\u666f\u548c\u4e00\u4e2a\u52a8\u6001\u521a\u4f53\u7684\u6784\u5efa\u3002 \u4f7f\u7528\u7a20\u5bc6SLAM\u5efa\u56fe\u7684\u65b9\u6cd5\uff0c\u5bf9\u89c6\u89c9\u8f93\u5165\u4e2d\u7684\u5927\u578b\u52a8\u6001\u906e\u6321(\u8d85\u8fc7\u89c6\u91ce\u768465%)\u5177\u6709\u9c81\u68d2\u6027\u3002\u540c\u65f6\u8be5SLAM\u6a21\u578b\u4e0d\u4f9d\u8d56\u9759\u6001\u548c\u52a8\u6001\u6a21\u578b\u7684\u521d\u59cb\u5316; \u63d0\u4f9b\u4e00\u4e2a\u65b0\u7684RGB-D SLAM\u6570\u636e\u96c6\uff0c\u6570\u636e\u96c6\u4e2d\u5305\u62ec\u5177\u6709\u5728\u573a\u666f\u4e2d\u9020\u6210\u5927\u906e\u6321\u7684\u52a8\u6001\u5bf9\u8c61\u548c\u771f\u5b9e\u8f68\u8ff9\u3002 RELATED WORK \u00b6 \u52a8\u6001\u89c6\u89c9SLAM\u6216\u89c6\u89c9\u91cc\u7a0b\u8ba1\u65b9\u6cd5\u53ef\u4ee5\u5206\u4e3a \u76f4\u63a5\u3001\u95f4\u63a5\u6216\u591a\u8fd0\u52a8\u91cc\u7a0b\u8ba1\u65b9\u6cd5 \u3002 \u673a\u5668\u4eba\u672c\u4f53\u611f\u77e5\u8fd8\u53ef\u7528\u4e8e\u652f\u6301\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b9a\u4f4d\u3002 \u76f4\u63a5\u6cd5 \uff1a\u9700\u8981\u5bf9\u573a\u666f\u4e2d\u7684\u5bf9\u8c61\u6709\u5145\u5206\u7684\u4e86\u89e3\uff0c\u5982\u679c\u672a\u68c0\u6d4b\u5230\u52a8\u6001\u5bf9\u8c61\uff0c\u5219\u5931\u8d25\u3002 \u95f4\u63a5\u6cd5 \uff1a\u5f53\u52a8\u6001\u5bf9\u8c61\u6210\u4e3a\u4e3b\u8981\u90e8\u5206\u662f\u65e0\u6cd5\u5904\u7406\u56fe\u50cf\u3002 OVERVIEW \u00b6 \u672c\u6587\u63d0\u51fa\u4e00\u79cd SLAM \u6846\u67b6\uff0c\u5c06\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u5355\u4e2a\u521a\u4f53\uff0c\u5229\u7528\u8fd0\u52a8\u5148\u9a8c\u5206\u5272\u9759\u6001\u90e8\u4ef6\u548c\u52a8\u6001\u90e8\u4ef6\u3002\u5229\u7528\u5206\u5272\u540e\u7684\u56fe\u50cf\u5bf9\u6444\u50cf\u673a\u8fdb\u884c\u8ddf\u8e2a\uff0c\u91cd\u5efa\u80cc\u666f\u548c\u76ee\u6807\u6a21\u578b\u3002 \u91cd\u5efa\u6d41\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u9996\u5148\u9700\u8981\u8fde\u7eed\u4e24\u4e2a RGB-D \u5173\u952e\u5e27 A \u548c B\uff0c\u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\u53ca \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u662f\u5c5e\u4e8e \\(se(3)\\) \u7684\uff0c\u6b64\u5916\u8fd8\u9700\u8981\u524d\u4e00\u5e27\u7684\u8bed\u4e49\u5206\u5272\u4fe1\u606f \\(\\widetilde{\\Gamma}_A \\in \\mathbb{R}^{W \\times H}\\) \u3002\u9996\u5148\u6839\u636e\u8fd0\u52a8\u5148\u9a8c\u4fe1\u606f\u68c0\u6d4b\u7269\u4f53\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53\uff1b\u7136\u540e\u5f53\u7269\u4f53\u8fd0\u52a8\u65f6\uff0c\u57fa\u4e8e\u5e27\u95f4\u5bf9\u5176\uff0c\u6211\u4eec\u8054\u5408\u4f30\u8ba1\u5206\u5272 \\(\\widetilde{\\Gamma}_B\\) \u548c \u521a\u4f53\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002\u8fd9\u4e9b\u7247\u6bb5\u7528\u4e8e\u91cd\u5efa\u9759\u6001\u73af\u5883\u548c\u52a8\u6001\u5bf9\u8c61\uff0c\u5e76\u5229\u7528\u5e27\u4e0e\u6a21\u578b\u7684\u5bf9\u5176\u5b9e\u73b0\u6444\u50cf\u673a\u7684\u5b9a\u4f4d\u3002 \u56fe\u50cf\u805a\u5408 \u00b6 \u6bcf\u4e2a\u65b0\u7684\u5f3a\u5ea6\u548c\u6df1\u5ea6\u56fe\u50cf \\((I,D) \\in \\mathbb{R}^{W \\times H}\\) \u5bf9\u901a\u8fc7\u4f7f\u7528 K-\u5747\u503c\u805a\u7c7b\uff0c\u88ab\u5206\u5272\u6210 K \u4e2a\u51e0\u4f55\u7c07 \\(V=V_i|i=1,...,K\\) \u3002\u5047\u8bbe\u6bcf\u4e2a\u7c07\u6ee1\u8db3\u521a\u6027\u6761\u4ef6\uff0c\u6bcf\u4e2a\u521a\u4f53\u53ef\u4ee5\u901a\u8fc7\u7c07\u7684\u7ec4\u5408\u6765\u8fd1\u4f3c\u3002\u540c\u65f6\u6587\u4e2d\u8fd8\u4e3a\u6bcf\u4e2a\u96c6\u7fa4\u5206\u914d\u4e00\u4e2a\u5206\u6570 \\(\\gamma_u \\in [0,1]\\) \u8868\u793a\u7c07\u662f\u5426\u5c5e\u4e8e\u9759\u6001\u521a\u4f53\u7684\u6982\u7387\uff1b \\(\\gamma_i=0\\) \u8868\u793a\u52a8\u6001\u7c07\uff0c\u800c \\(\\gamma_i=1\\) \u8868\u793a\u9759\u6001\u7c07\u3002\u5bf9\u4e8e RGB-D \u5e27 A\uff0c\u5c06\u603b\u4f53\u5206\u6570\u8868\u793a\u4e3a \\(\\gamma_A \\in \\mathbb{R}^K\\) \u3002 \u8ddd\u79bb\u5224\u65ad \u00b6 \u5982\u679c\u4e24\u4e2a\u8fd0\u52a8\u5148\u9a8c\u4e4b\u95f4\u7684\u5dee \\(||\\widetilde{\\xi}_s -\\widetilde{\\xi}_d||^2\\) \u5c0f\u4e8e\u9608\u503c \\(\\hat{d}\\) \uff0c\u5219\u5c06\u56fe\u50cf\u4e2d\u7684\u6240\u6709\u805a\u7c7b\u89c6\u4e3a\u9759\u6001\u548c\u52a8\u6001\u5206\u5272\u3002\u5426\u5219\u5c06\u5171\u540c\u4f18\u5316\u5f53\u524d\u5e27\u7684\u5206\u6570 \\(\\gamma_B\\) \u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002 \u56fe\u50cf\u5206\u5272 \u00b6 \u4ece\u805a\u7c7b\u548c\u5206\u6570\u4e2d\u8ba1\u7b97\u50cf\u7d20\u7ea7\u5206\u5272 \\(\\widetilde{\\Gamma}_B \\in \\mathbb{R}^{W \\times H}\\) \u3002\u4e0e\u9759\u6001\u878d\u5408\u7c7b\u4f3c\uff0c\u4ece\u5206\u5272\u4e2d\u8ba1\u7b97\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u52a0\u6743 RGB-D \u56fe\u50cf \\(\\widetilde{\\Gamma}_B\\) \u3002\u8fd9\u4e9b\u52a0\u6743\u56fe\u50cf\u7528\u4e8e\u91cd\u5efa\u80cc\u666f\u548c\u52a8\u6001\u76ee\u6807\u7684\u6a21\u578b\uff0c\u5e76\u901a\u8fc7\u5e27-\u6a21\u578b\u5bf9\u5176\u6765\u7ec6\u5316\u4f30\u8ba1\u7684\u76f8\u673a\u59ff\u6001\u3002 \u5750\u6807\u7cfb\u8f6c\u6362 \u00b6 \u5206\u522b\u4ece world-frame\u3001camera-frame \u548c object-frame \u8868\u793a\u4e3a \\(F_W\u3001F_C\u3001F_O\\) \u3002\u4f7f\u7528 \\(T_{XY} \\in SE(3)\\) \u5c06\u5750\u6807\u7cfb \\(F_Y\\) \u4e2d\u67d0\u4e2a\u70b9\u7684\u9f50\u6b21\u5750\u6807\u8f6c\u6362\u4e3a \\(F_X\\) \u3002\u5728\u56fe\u50cf\u5e27 A \u4e2d\uff0c\u76f8\u673a\u548c\u7269\u4f53\u7684\u59ff\u6001\u5206\u522b\u662f \\(T_{WC_A}\\) \u548c \\(T_{WO_A}\\) \u3002\u8003\u8651\u4e24\u4e2a\u56fe\u50cf\u5e27 A \u548c B\uff0c \\(\\xi_s\\) \u4e0e\u6444\u50cf\u673a\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_s)=T_{WC_A}^{-1}T_{WC_B}=T_{C_AC_B}\\) \uff0c\u6c42\u51fa\u673a\u5668\u4eba\u79fb\u52a8\u7684\u4fe1\u606f\uff0c \\(\\xi_d\\) \u4e0e\u6444\u50cf\u673a\u7684\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_d)=T_{WC_A}^{-1}T_{WO_A}T_{WO_B}^{-1}T_{WC_B}=T_{C_AO_A}T_{C_BO_B}^{-1}\\) \uff0c\u6700\u540e\u8f6c\u5316\u4e3a\u76f8\u673a\u548c\u7269\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8\u5173\u7cfb\u3002\u5176\u4e2d \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u53ef\u4ee5\u7531\u672c\u4f53\u611f\u89c9\u4f20\u611f\u5668\u63d0\u4f9b\uff0c\u5982\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u548c\u624b\u81c2\u6b63\u5411\u8fd0\u52a8\u5b66\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u9759\u6001\u8fd0\u52a8\u5148\u9a8c \\(\\widetilde{\\xi}_s\\) \u662f\u901a\u8fc7\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u6216\u901a\u8fc7\u5728\u76f8\u673a\u5730\u9762\u771f\u503c\u8f68\u8ff9\u4e0a\u6dfb\u52a0\u6a21\u62df\u6f02\u79fb\u6765\u8ba1\u7b97\u3002\u901a\u8fc7\u6a21\u62df\u5bf9\u8c61\u771f\u503c\u8f68\u8ff9\u4e0a\u7684\u6f02\u79fb\u6765\u751f\u6210 \\(\\widetilde{\\xi}_d\\) \u3002","title":"RigidFusion"},{"location":"cv/papers/dynamic-slam/rigidfusion/#rigidfusion","text":"\u7ea6 1358 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract paper\uff1a RigidFusion: Robot Localisation and Mapping in Environments with Large Dynamic Rigid Objects","title":"RigidFusion"},{"location":"cv/papers/dynamic-slam/rigidfusion/#introduction","text":"\u5728\u771f\u5b9e\u7684 SLAM \u573a\u666f\u4e2d\uff0c\u6211\u4eec\u4f1a\u53d1\u73b0\u5728\u9047\u5230\u5927\u91cf\u52a8\u6001\u969c\u788d\u7269\u7684\u573a\u666f\u65f6\u5019\uff0c\u7279\u522b\u5bb9\u6613\u9020\u6210\u8ddf\u4e22\u7684\u95ee\u9898\u3002\u4f20\u7edf\u7684\u89e3\u51b3\u65b9\u6cd5\u662f\u901a\u8fc7\u5c06\u52a8\u6001\u969c\u788d\u7269\u6ee4\u9664\uff0c\u800c\u672c\u6587\u4e2d\u63d0\u5230\u5c06\u52a8\u6001\u7269\u4f53\u770b\u505a\u521a\u4f53\u8fdb\u884c\u8ddf\u8e2a\u3002 \u6587\u4e2d\u63d0\u51fa\u4e00\u79cd\u65b0\u7684 RGB-D SLAM \u65b9\u6cd5\uff0c\u53ef\u4ee5\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u53ef\u80fd\u906e\u6321\u76f8\u673a\u89c6\u91ce\u4e3b\u8981\u90e8\u5206\u7684\u5927\u578b\u52a8\u6001\u521a\u6027\u7269\u4f53\u3002\u4e4b\u524d\u7684\u65b9\u6cd5\u5c06\u573a\u666f\u7684 \u52a8\u6001\u90e8\u5206\u89c6\u4e3a\u5f02\u5e38\u503c\uff0c\u56e0\u6b64\u5c40\u9650\u4e8e\u573a\u666f\u4e2d\u7684\u5c11\u91cf\u53d8\u5316 \uff0c\u6216\u4f9d\u8d56\u573a\u666f\u4e2d\u6240\u6709\u5bf9\u8c61\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u4ee5\u5b9e\u73b0\u9c81\u68d2\u7684\u6444\u50cf\u673a\u8ddf\u8e2a\u3002 \u672c\u6587\u63d0\u51fa\u5c06\u6240\u6709\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u4e00\u4e2a\u521a\u4f53\uff0c\u540c\u65f6\u5206\u5272\u548c\u8ddf\u8e2a\u9759\u6001\u548c\u52a8\u6001\u90e8\u4ef6\u3002 \u56e0\u6b64\uff0c\u5728\u52a8\u6001\u5bf9\u8c61\u9020\u6210\u5927\u906e\u6321\u7684\u73af\u5883\u4e2d\uff0c\u80fd\u591f\u540c\u65f6\u5b9a\u4f4d\u548c\u91cd\u5efa\u9759\u6001\u80cc\u666f\u548c\u521a\u6027\u52a8\u6001\u7ec4\u4ef6\u3002 Info \u4e00\u4e2a\u65b0\u7684SLAM\u6846\u67b6\uff0c\u4f7f\u7528RGB-D\u6444\u50cf\u5934\uff0c\u5728\u6574\u4e2aSLAM\u6846\u67b6\u4e2d\u540c\u65f6\u5206\u5272\u3001\u8ddf\u8e2a\u548c\u91cd\u5efa\u573a\u666f\uff0c\u901a\u8fc7\u5177\u6709\u6f5c\u5728\u6f02\u79fb\u7684\u8fd0\u52a8\u5148\u9a8c\u6765\u5b8c\u6210\u9759\u6001\u80cc\u666f\u548c\u4e00\u4e2a\u52a8\u6001\u521a\u4f53\u7684\u6784\u5efa\u3002 \u4f7f\u7528\u7a20\u5bc6SLAM\u5efa\u56fe\u7684\u65b9\u6cd5\uff0c\u5bf9\u89c6\u89c9\u8f93\u5165\u4e2d\u7684\u5927\u578b\u52a8\u6001\u906e\u6321(\u8d85\u8fc7\u89c6\u91ce\u768465%)\u5177\u6709\u9c81\u68d2\u6027\u3002\u540c\u65f6\u8be5SLAM\u6a21\u578b\u4e0d\u4f9d\u8d56\u9759\u6001\u548c\u52a8\u6001\u6a21\u578b\u7684\u521d\u59cb\u5316; \u63d0\u4f9b\u4e00\u4e2a\u65b0\u7684RGB-D SLAM\u6570\u636e\u96c6\uff0c\u6570\u636e\u96c6\u4e2d\u5305\u62ec\u5177\u6709\u5728\u573a\u666f\u4e2d\u9020\u6210\u5927\u906e\u6321\u7684\u52a8\u6001\u5bf9\u8c61\u548c\u771f\u5b9e\u8f68\u8ff9\u3002","title":"INTRODUCTION"},{"location":"cv/papers/dynamic-slam/rigidfusion/#related-work","text":"\u52a8\u6001\u89c6\u89c9SLAM\u6216\u89c6\u89c9\u91cc\u7a0b\u8ba1\u65b9\u6cd5\u53ef\u4ee5\u5206\u4e3a \u76f4\u63a5\u3001\u95f4\u63a5\u6216\u591a\u8fd0\u52a8\u91cc\u7a0b\u8ba1\u65b9\u6cd5 \u3002 \u673a\u5668\u4eba\u672c\u4f53\u611f\u77e5\u8fd8\u53ef\u7528\u4e8e\u652f\u6301\u52a8\u6001\u73af\u5883\u4e2d\u7684\u5b9a\u4f4d\u3002 \u76f4\u63a5\u6cd5 \uff1a\u9700\u8981\u5bf9\u573a\u666f\u4e2d\u7684\u5bf9\u8c61\u6709\u5145\u5206\u7684\u4e86\u89e3\uff0c\u5982\u679c\u672a\u68c0\u6d4b\u5230\u52a8\u6001\u5bf9\u8c61\uff0c\u5219\u5931\u8d25\u3002 \u95f4\u63a5\u6cd5 \uff1a\u5f53\u52a8\u6001\u5bf9\u8c61\u6210\u4e3a\u4e3b\u8981\u90e8\u5206\u662f\u65e0\u6cd5\u5904\u7406\u56fe\u50cf\u3002","title":"RELATED WORK"},{"location":"cv/papers/dynamic-slam/rigidfusion/#overview","text":"\u672c\u6587\u63d0\u51fa\u4e00\u79cd SLAM \u6846\u67b6\uff0c\u5c06\u52a8\u6001\u90e8\u4ef6\u89c6\u4e3a\u5355\u4e2a\u521a\u4f53\uff0c\u5229\u7528\u8fd0\u52a8\u5148\u9a8c\u5206\u5272\u9759\u6001\u90e8\u4ef6\u548c\u52a8\u6001\u90e8\u4ef6\u3002\u5229\u7528\u5206\u5272\u540e\u7684\u56fe\u50cf\u5bf9\u6444\u50cf\u673a\u8fdb\u884c\u8ddf\u8e2a\uff0c\u91cd\u5efa\u80cc\u666f\u548c\u76ee\u6807\u6a21\u578b\u3002 \u91cd\u5efa\u6d41\u7a0b\u5982\u4e0b\u56fe\u6240\u793a\uff0c\u9996\u5148\u9700\u8981\u8fde\u7eed\u4e24\u4e2a RGB-D \u5173\u952e\u5e27 A \u548c B\uff0c\u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\uff0c\u9759\u6001\u548c\u52a8\u6001\u7269\u4f53\u7684\u5148\u9a8c\u4fe1\u606f\u53ca \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u662f\u5c5e\u4e8e \\(se(3)\\) \u7684\uff0c\u6b64\u5916\u8fd8\u9700\u8981\u524d\u4e00\u5e27\u7684\u8bed\u4e49\u5206\u5272\u4fe1\u606f \\(\\widetilde{\\Gamma}_A \\in \\mathbb{R}^{W \\times H}\\) \u3002\u9996\u5148\u6839\u636e\u8fd0\u52a8\u5148\u9a8c\u4fe1\u606f\u68c0\u6d4b\u7269\u4f53\u662f\u5426\u4e3a\u52a8\u6001\u7269\u4f53\uff1b\u7136\u540e\u5f53\u7269\u4f53\u8fd0\u52a8\u65f6\uff0c\u57fa\u4e8e\u5e27\u95f4\u5bf9\u5176\uff0c\u6211\u4eec\u8054\u5408\u4f30\u8ba1\u5206\u5272 \\(\\widetilde{\\Gamma}_B\\) \u548c \u521a\u4f53\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002\u8fd9\u4e9b\u7247\u6bb5\u7528\u4e8e\u91cd\u5efa\u9759\u6001\u73af\u5883\u548c\u52a8\u6001\u5bf9\u8c61\uff0c\u5e76\u5229\u7528\u5e27\u4e0e\u6a21\u578b\u7684\u5bf9\u5176\u5b9e\u73b0\u6444\u50cf\u673a\u7684\u5b9a\u4f4d\u3002","title":"OVERVIEW"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_1","text":"\u6bcf\u4e2a\u65b0\u7684\u5f3a\u5ea6\u548c\u6df1\u5ea6\u56fe\u50cf \\((I,D) \\in \\mathbb{R}^{W \\times H}\\) \u5bf9\u901a\u8fc7\u4f7f\u7528 K-\u5747\u503c\u805a\u7c7b\uff0c\u88ab\u5206\u5272\u6210 K \u4e2a\u51e0\u4f55\u7c07 \\(V=V_i|i=1,...,K\\) \u3002\u5047\u8bbe\u6bcf\u4e2a\u7c07\u6ee1\u8db3\u521a\u6027\u6761\u4ef6\uff0c\u6bcf\u4e2a\u521a\u4f53\u53ef\u4ee5\u901a\u8fc7\u7c07\u7684\u7ec4\u5408\u6765\u8fd1\u4f3c\u3002\u540c\u65f6\u6587\u4e2d\u8fd8\u4e3a\u6bcf\u4e2a\u96c6\u7fa4\u5206\u914d\u4e00\u4e2a\u5206\u6570 \\(\\gamma_u \\in [0,1]\\) \u8868\u793a\u7c07\u662f\u5426\u5c5e\u4e8e\u9759\u6001\u521a\u4f53\u7684\u6982\u7387\uff1b \\(\\gamma_i=0\\) \u8868\u793a\u52a8\u6001\u7c07\uff0c\u800c \\(\\gamma_i=1\\) \u8868\u793a\u9759\u6001\u7c07\u3002\u5bf9\u4e8e RGB-D \u5e27 A\uff0c\u5c06\u603b\u4f53\u5206\u6570\u8868\u793a\u4e3a \\(\\gamma_A \\in \\mathbb{R}^K\\) \u3002","title":"\u56fe\u50cf\u805a\u5408"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_2","text":"\u5982\u679c\u4e24\u4e2a\u8fd0\u52a8\u5148\u9a8c\u4e4b\u95f4\u7684\u5dee \\(||\\widetilde{\\xi}_s -\\widetilde{\\xi}_d||^2\\) \u5c0f\u4e8e\u9608\u503c \\(\\hat{d}\\) \uff0c\u5219\u5c06\u56fe\u50cf\u4e2d\u7684\u6240\u6709\u805a\u7c7b\u89c6\u4e3a\u9759\u6001\u548c\u52a8\u6001\u5206\u5272\u3002\u5426\u5219\u5c06\u5171\u540c\u4f18\u5316\u5f53\u524d\u5e27\u7684\u5206\u6570 \\(\\gamma_B\\) \u4ee5\u53ca\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8 \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u3002","title":"\u8ddd\u79bb\u5224\u65ad"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_3","text":"\u4ece\u805a\u7c7b\u548c\u5206\u6570\u4e2d\u8ba1\u7b97\u50cf\u7d20\u7ea7\u5206\u5272 \\(\\widetilde{\\Gamma}_B \\in \\mathbb{R}^{W \\times H}\\) \u3002\u4e0e\u9759\u6001\u878d\u5408\u7c7b\u4f3c\uff0c\u4ece\u5206\u5272\u4e2d\u8ba1\u7b97\u9759\u6001\u548c\u52a8\u6001\u521a\u4f53\u7684\u52a0\u6743 RGB-D \u56fe\u50cf \\(\\widetilde{\\Gamma}_B\\) \u3002\u8fd9\u4e9b\u52a0\u6743\u56fe\u50cf\u7528\u4e8e\u91cd\u5efa\u80cc\u666f\u548c\u52a8\u6001\u76ee\u6807\u7684\u6a21\u578b\uff0c\u5e76\u901a\u8fc7\u5e27-\u6a21\u578b\u5bf9\u5176\u6765\u7ec6\u5316\u4f30\u8ba1\u7684\u76f8\u673a\u59ff\u6001\u3002","title":"\u56fe\u50cf\u5206\u5272"},{"location":"cv/papers/dynamic-slam/rigidfusion/#_4","text":"\u5206\u522b\u4ece world-frame\u3001camera-frame \u548c object-frame \u8868\u793a\u4e3a \\(F_W\u3001F_C\u3001F_O\\) \u3002\u4f7f\u7528 \\(T_{XY} \\in SE(3)\\) \u5c06\u5750\u6807\u7cfb \\(F_Y\\) \u4e2d\u67d0\u4e2a\u70b9\u7684\u9f50\u6b21\u5750\u6807\u8f6c\u6362\u4e3a \\(F_X\\) \u3002\u5728\u56fe\u50cf\u5e27 A \u4e2d\uff0c\u76f8\u673a\u548c\u7269\u4f53\u7684\u59ff\u6001\u5206\u522b\u662f \\(T_{WC_A}\\) \u548c \\(T_{WO_A}\\) \u3002\u8003\u8651\u4e24\u4e2a\u56fe\u50cf\u5e27 A \u548c B\uff0c \\(\\xi_s\\) \u4e0e\u6444\u50cf\u673a\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_s)=T_{WC_A}^{-1}T_{WC_B}=T_{C_AC_B}\\) \uff0c\u6c42\u51fa\u673a\u5668\u4eba\u79fb\u52a8\u7684\u4fe1\u606f\uff0c \\(\\xi_d\\) \u4e0e\u6444\u50cf\u673a\u7684\u4f4d\u59ff\u7684\u5173\u7cfb\u4e3a \\(T(\\xi_d)=T_{WC_A}^{-1}T_{WO_A}T_{WO_B}^{-1}T_{WC_B}=T_{C_AO_A}T_{C_BO_B}^{-1}\\) \uff0c\u6700\u540e\u8f6c\u5316\u4e3a\u76f8\u673a\u548c\u7269\u4f53\u7684\u76f8\u5bf9\u8fd0\u52a8\u5173\u7cfb\u3002\u5176\u4e2d \\(\\widetilde{\\xi}_s\\) \u548c \\(\\widetilde{\\xi}_d\\) \u53ef\u4ee5\u7531\u672c\u4f53\u611f\u89c9\u4f20\u611f\u5668\u63d0\u4f9b\uff0c\u5982\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u548c\u624b\u81c2\u6b63\u5411\u8fd0\u52a8\u5b66\u3002 \u5728\u672c\u6587\u4e2d\uff0c\u9759\u6001\u8fd0\u52a8\u5148\u9a8c \\(\\widetilde{\\xi}_s\\) \u662f\u901a\u8fc7\u8f66\u8f6e\u91cc\u7a0b\u8ba1\u6216\u901a\u8fc7\u5728\u76f8\u673a\u5730\u9762\u771f\u503c\u8f68\u8ff9\u4e0a\u6dfb\u52a0\u6a21\u62df\u6f02\u79fb\u6765\u8ba1\u7b97\u3002\u901a\u8fc7\u6a21\u62df\u5bf9\u8c61\u771f\u503c\u8f68\u8ff9\u4e0a\u7684\u6f02\u79fb\u6765\u751f\u6210 \\(\\widetilde{\\xi}_d\\) \u3002","title":"\u5750\u6807\u7cfb\u8f6c\u6362"},{"location":"cv/papers/nerf/","text":"NeRF \u7cfb\u5217 \u00b6 Abstract NeRF \u7cfb\u5217\u76f8\u5173\u5185\u5bb9 Table of Contents \u00b6 NeRF NeRF-Evaluation iMAP NICE-SLAM Co-SLAM NID-SLAM DDN-SLAM","title":"NeRF \u7cfb\u5217"},{"location":"cv/papers/nerf/#nerf","text":"Abstract NeRF \u7cfb\u5217\u76f8\u5173\u5185\u5bb9","title":"NeRF \u7cfb\u5217"},{"location":"cv/papers/nerf/#table-of-contents","text":"NeRF NeRF-Evaluation iMAP NICE-SLAM Co-SLAM NID-SLAM DDN-SLAM","title":"Table of Contents"},{"location":"cv/papers/nerf/co-slam/","text":"Co-SLAM \u00b6 \u7ea6 713 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM code\uff1a [CVPR'23] Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM video: Co-SLAM About INR \u00b6 \u795e\u7ecf\u9690\u5f0f\u8868\u5f81 slam\uff08implict neural representaton\uff0cINR\uff09\u4f7f\u7528\u4e00\u4e2a\u8fde\u7eed\u51fd\u6570\u6765\u8868\u5f81\u56fe\u50cf\u6216\u8005\u4e09\u7ef4 voxel\uff0c\u5e76\u7528\u795e\u7ecf\u7f51\u7edc\u6765\u903c\u8fd1\u8fd9\u4e2a\u51fd\u6570\u3002Co-SLAM \u4e5f\u662f\u8fd9\u7c7b\u5de5\u4f5c\uff0cCo-SLAM \u5c06\u573a\u666f\u8868\u793a\u4e3a\u591a\u5206\u8fa8\u7387\u54c8\u5e0c\u7f51\u683c\uff0c\u4ee5\u5229\u7528\u5176\u8f83\u9ad8\u7684\u6536\u655b\u901f\u5ea6\u548c\u8868\u793a\u9ad8\u9891\u5c40\u90e8\u7279\u5f81\u7684\u80fd\u529b\u3002\u6b64\u5916\uff0cCo-SLAM \u8fd8\u91c7\u7528\u4e86 one-blob encoding\uff0c\u4ee5\u4fc3\u8fdb\u672a\u89c2\u5bdf\u533a\u57df\u7684\u8868\u9762\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\uff1b\u5728\u6240\u6709\u5173\u952e\u5e27\u4e0a\u8fdb\u884c BA\u3002 Related Work \u00b6 \u7a20\u5bc6\u56fe\u89c6\u89c9 SLAM \u00b6 \u4f20\u7edf\u91c7\u7528 3D-3D ICP \u6c42\u89e3\uff0c\u91c7\u7528\u6df1\u5ea6\u5b66\u4e60\u53ef\u4ee5\u63d0\u5347\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\uff0c\u4f46\u5927\u90e8\u5206\u7684 pipeline \u4ecd\u7136\u91c7\u7528\u4f20\u7edf\u65b9\u6cd5\u3002 INR \u00b6 INR\u5728\u795e\u7ecf\u7f51\u7edc\u4e2d\u7f16\u7801\u4e09\u7ef4\u56fe\u50cf\uff0c\u5982\u5177\u6709\u4ee3\u8868\u6027\u7684 NeRF\uff0c\u91c7\u7528\u4e86\u5e26\u6709 MLP\u7684 coordinate encoding \u901a\u8fc7\u4f53\u7ed8\u5236\u8fdb\u884c\u573a\u666f\u91cd\u5efa\uff0c\u4f46\u662f\u8bad\u7ec3\u4e8b\u4ef6\u8fc7\u957f\uff0c\u540e\u7eed\u6709 parametric embedding \u7b49\u5de5\u4f5c\uff0c\u867d\u7136\u589e\u52a0\u4e86\u53c2\u6570\u91cf\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u8bad\u7ec3\u65f6\u95f4\u3002 Neural Implicit SLAM \u00b6 iMAP \u91c7\u7528 MLP \u5728\u63a5\u8fd1\u5b9e\u65f6\u5185\u540c\u65f6\u8ffd\u8e2a\u548c\u5efa\u56fe\uff0c\u4ece\u800c\u5b9e\u73b0\u4e86 10 Hz tracking \u548c 2 Hz \u5efa\u56fe\u3002\u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u5f00\u9500\u5e76\u63d0\u9ad8\u53ef\u6269\u5c55\u6027\uff0cNICE-SLAM \u91c7\u7528\u4e86\u591a\u5c42\u7279\u5f81\u7f51\u683c\u6765\u8868\u793a\u573a\u666f\u3002\u7136\u800c\uff0c\u7531\u4e8e\u7279\u5f81\u7f51\u683c\u53ea\u8fdb\u884c\u5c40\u90e8\u66f4\u65b0\uff0c\u56e0\u6b64\u65e0\u6cd5\u5b9e\u73b0\u5408\u7406\u7684hole-filling\u3002 Idea \u00b6 Joint Corrdinate and Parametric Encoding \u57fa\u4e8e\u5750\u6807\u7684\u8868\u793a\u65b9\u6cd5\u53d7\u76ca\u4e8e MLP \u7684\u5e73\u6ed1\u4e00\u81f4\u6027\u5b9e\u9a8c\uff0c\u80fd\u591f\u5f97\u5230\u9ad8\u4fdd\u771f\u7684\u91cd\u5efa\u7ed3\u679c\uff0c\u4f46\u662f\u6536\u655b\u592a\u6162\uff0c\u800c\u4e14\u4f1a\u53d1\u751f\u707e\u96be\u6027\u9057\u5fd8\u3002 \u57fa\u4e8e\u53c2\u6570\u7684\u8868\u793a\u65b9\u6cd5\u63d0\u9ad8\u4e86\u8ba1\u7b97\u6548\u7387\uff0c\u4f46\u5728\u5e73\u6ed1\u6027\u548c hole-filling \u4e0a\u8868\u73b0\u4e0d\u597d\u3002 Co-SLAM \u91c7\u7528\u4e86\u8054\u5408\u5750\u6807\u548c\u53c2\u6570\u7f16\u7801\uff0c\u9002\u7528 One-blob \u7f16\u7801\uff0c\u800c\u4e0d\u662f\u5c06\u7a7a\u95f4\u5750\u6807\u5d4c\u5165\u591a\u4e2a\u9891\u6bb5\uff0c\u5728 hashGrid \u7684\u591a\u5206\u8fa8\u7387\u7279\u5f81\u7f51\u7edc\u8868\u5f81\u4e2d\u4f7f\u7528 One-blob \u7f16\u7801\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5feb\u901f\u6536\u655b\u548c online-slam \u6240\u9700\u7684 hole-filling\u3002 Depth and Color Rendering \uff1a\u901a\u8fc7\u5bf9\u6cbf\u91c7\u6837\u5c04\u7ebf\u7684\u9884\u6d4b\u503c\u8fdb\u884c\u79ef\u5206\uff0c\u5448\u73b0\u6df1\u5ea6\u548c\u8272\u5f69\u3002 Tracking and BA \u76ee\u6807\u51fd\u6570\uff1a\u989c\u8272\u548c\u6df1\u5ea6 loss \u901a\u8fc7\u5e73\u65b9\u8bef\u5dee\u8ba1\u7b97\uff0c Camera Tracking\uff1a\u76f8\u673a\u5230\u4e16\u754c\u7684\u53d8\u6362\u77e9\u9635 T\uff0c\u57fa\u4e8e\u5300\u901f\u6052\u5b9a\u8fd0\u52a8\u6a21\u578b\uff0c\u7136\u540e\u9009\u53d6\u5f53\u524d\u5e27\u5185\u7684 \\(N_t\\) (1024) \u4e2a\u50cf\u7d20\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u76ee\u6807\u51fd\u6570\u4f18\u5316\u4f4d\u59ff\uff0c\u800c\u76ee\u6807\u51fd\u6570\u4e0e\u76f8\u673a\u5916\u53c2\u6709\u5173\u3002 BA\uff1a\u5728 Co-SLAM \u4e2d\uff0c\u4e0d\u518d\u9700\u8981\u5b58\u50a8\u5b8c\u6574\u7684\u5173\u952e\u5e27\u56fe\u50cf\u6216\u5173\u952e\u5e27\u9009\u62e9\u3002\u76f8\u53cd\u53ea\u5b58\u50a8\u4ee3\u8868\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u50cf\u7d20\u5b50\u96c6\uff08\u7ea6 5%\uff09\u3002\u4e3a\u4e86\u8fdb\u884c\u8054\u5408\u4f18\u5316\uff0c\u6211\u4eec\u4ece\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u968f\u673a\u62bd\u53d6 \\(N_g\\) \u6761\u5c04\u7ebf\uff0c\u4ee5\u4f18\u5316\u573a\u666f\u8868\u793a\u548c\u76f8\u673a\u4f4d\u59ff\u3002 Experiments \u00b6","title":"Co-SLAM"},{"location":"cv/papers/nerf/co-slam/#co-slam","text":"\u7ea6 713 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM code\uff1a [CVPR'23] Co-SLAM: Joint Coordinate and Sparse Parametric Encodings for Neural Real-Time SLAM video: Co-SLAM","title":"Co-SLAM"},{"location":"cv/papers/nerf/co-slam/#about-inr","text":"\u795e\u7ecf\u9690\u5f0f\u8868\u5f81 slam\uff08implict neural representaton\uff0cINR\uff09\u4f7f\u7528\u4e00\u4e2a\u8fde\u7eed\u51fd\u6570\u6765\u8868\u5f81\u56fe\u50cf\u6216\u8005\u4e09\u7ef4 voxel\uff0c\u5e76\u7528\u795e\u7ecf\u7f51\u7edc\u6765\u903c\u8fd1\u8fd9\u4e2a\u51fd\u6570\u3002Co-SLAM \u4e5f\u662f\u8fd9\u7c7b\u5de5\u4f5c\uff0cCo-SLAM \u5c06\u573a\u666f\u8868\u793a\u4e3a\u591a\u5206\u8fa8\u7387\u54c8\u5e0c\u7f51\u683c\uff0c\u4ee5\u5229\u7528\u5176\u8f83\u9ad8\u7684\u6536\u655b\u901f\u5ea6\u548c\u8868\u793a\u9ad8\u9891\u5c40\u90e8\u7279\u5f81\u7684\u80fd\u529b\u3002\u6b64\u5916\uff0cCo-SLAM \u8fd8\u91c7\u7528\u4e86 one-blob encoding\uff0c\u4ee5\u4fc3\u8fdb\u672a\u89c2\u5bdf\u533a\u57df\u7684\u8868\u9762\u4e00\u81f4\u6027\u548c\u5b8c\u6574\u6027\uff1b\u5728\u6240\u6709\u5173\u952e\u5e27\u4e0a\u8fdb\u884c BA\u3002","title":"About INR"},{"location":"cv/papers/nerf/co-slam/#related-work","text":"","title":"Related Work"},{"location":"cv/papers/nerf/co-slam/#slam","text":"\u4f20\u7edf\u91c7\u7528 3D-3D ICP \u6c42\u89e3\uff0c\u91c7\u7528\u6df1\u5ea6\u5b66\u4e60\u53ef\u4ee5\u63d0\u5347\u51c6\u786e\u6027\u548c\u9c81\u68d2\u6027\uff0c\u4f46\u5927\u90e8\u5206\u7684 pipeline \u4ecd\u7136\u91c7\u7528\u4f20\u7edf\u65b9\u6cd5\u3002","title":"\u7a20\u5bc6\u56fe\u89c6\u89c9 SLAM"},{"location":"cv/papers/nerf/co-slam/#inr","text":"INR\u5728\u795e\u7ecf\u7f51\u7edc\u4e2d\u7f16\u7801\u4e09\u7ef4\u56fe\u50cf\uff0c\u5982\u5177\u6709\u4ee3\u8868\u6027\u7684 NeRF\uff0c\u91c7\u7528\u4e86\u5e26\u6709 MLP\u7684 coordinate encoding \u901a\u8fc7\u4f53\u7ed8\u5236\u8fdb\u884c\u573a\u666f\u91cd\u5efa\uff0c\u4f46\u662f\u8bad\u7ec3\u4e8b\u4ef6\u8fc7\u957f\uff0c\u540e\u7eed\u6709 parametric embedding \u7b49\u5de5\u4f5c\uff0c\u867d\u7136\u589e\u52a0\u4e86\u53c2\u6570\u91cf\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u8bad\u7ec3\u65f6\u95f4\u3002","title":"INR"},{"location":"cv/papers/nerf/co-slam/#neural-implicit-slam","text":"iMAP \u91c7\u7528 MLP \u5728\u63a5\u8fd1\u5b9e\u65f6\u5185\u540c\u65f6\u8ffd\u8e2a\u548c\u5efa\u56fe\uff0c\u4ece\u800c\u5b9e\u73b0\u4e86 10 Hz tracking \u548c 2 Hz \u5efa\u56fe\u3002\u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u5f00\u9500\u5e76\u63d0\u9ad8\u53ef\u6269\u5c55\u6027\uff0cNICE-SLAM \u91c7\u7528\u4e86\u591a\u5c42\u7279\u5f81\u7f51\u683c\u6765\u8868\u793a\u573a\u666f\u3002\u7136\u800c\uff0c\u7531\u4e8e\u7279\u5f81\u7f51\u683c\u53ea\u8fdb\u884c\u5c40\u90e8\u66f4\u65b0\uff0c\u56e0\u6b64\u65e0\u6cd5\u5b9e\u73b0\u5408\u7406\u7684hole-filling\u3002","title":"Neural Implicit SLAM"},{"location":"cv/papers/nerf/co-slam/#idea","text":"Joint Corrdinate and Parametric Encoding \u57fa\u4e8e\u5750\u6807\u7684\u8868\u793a\u65b9\u6cd5\u53d7\u76ca\u4e8e MLP \u7684\u5e73\u6ed1\u4e00\u81f4\u6027\u5b9e\u9a8c\uff0c\u80fd\u591f\u5f97\u5230\u9ad8\u4fdd\u771f\u7684\u91cd\u5efa\u7ed3\u679c\uff0c\u4f46\u662f\u6536\u655b\u592a\u6162\uff0c\u800c\u4e14\u4f1a\u53d1\u751f\u707e\u96be\u6027\u9057\u5fd8\u3002 \u57fa\u4e8e\u53c2\u6570\u7684\u8868\u793a\u65b9\u6cd5\u63d0\u9ad8\u4e86\u8ba1\u7b97\u6548\u7387\uff0c\u4f46\u5728\u5e73\u6ed1\u6027\u548c hole-filling \u4e0a\u8868\u73b0\u4e0d\u597d\u3002 Co-SLAM \u91c7\u7528\u4e86\u8054\u5408\u5750\u6807\u548c\u53c2\u6570\u7f16\u7801\uff0c\u9002\u7528 One-blob \u7f16\u7801\uff0c\u800c\u4e0d\u662f\u5c06\u7a7a\u95f4\u5750\u6807\u5d4c\u5165\u591a\u4e2a\u9891\u6bb5\uff0c\u5728 hashGrid \u7684\u591a\u5206\u8fa8\u7387\u7279\u5f81\u7f51\u7edc\u8868\u5f81\u4e2d\u4f7f\u7528 One-blob \u7f16\u7801\uff0c\u53ef\u4ee5\u5b9e\u73b0\u5feb\u901f\u6536\u655b\u548c online-slam \u6240\u9700\u7684 hole-filling\u3002 Depth and Color Rendering \uff1a\u901a\u8fc7\u5bf9\u6cbf\u91c7\u6837\u5c04\u7ebf\u7684\u9884\u6d4b\u503c\u8fdb\u884c\u79ef\u5206\uff0c\u5448\u73b0\u6df1\u5ea6\u548c\u8272\u5f69\u3002 Tracking and BA \u76ee\u6807\u51fd\u6570\uff1a\u989c\u8272\u548c\u6df1\u5ea6 loss \u901a\u8fc7\u5e73\u65b9\u8bef\u5dee\u8ba1\u7b97\uff0c Camera Tracking\uff1a\u76f8\u673a\u5230\u4e16\u754c\u7684\u53d8\u6362\u77e9\u9635 T\uff0c\u57fa\u4e8e\u5300\u901f\u6052\u5b9a\u8fd0\u52a8\u6a21\u578b\uff0c\u7136\u540e\u9009\u53d6\u5f53\u524d\u5e27\u5185\u7684 \\(N_t\\) (1024) \u4e2a\u50cf\u7d20\uff0c\u901a\u8fc7\u6700\u5c0f\u5316\u76ee\u6807\u51fd\u6570\u4f18\u5316\u4f4d\u59ff\uff0c\u800c\u76ee\u6807\u51fd\u6570\u4e0e\u76f8\u673a\u5916\u53c2\u6709\u5173\u3002 BA\uff1a\u5728 Co-SLAM \u4e2d\uff0c\u4e0d\u518d\u9700\u8981\u5b58\u50a8\u5b8c\u6574\u7684\u5173\u952e\u5e27\u56fe\u50cf\u6216\u5173\u952e\u5e27\u9009\u62e9\u3002\u76f8\u53cd\u53ea\u5b58\u50a8\u4ee3\u8868\u6bcf\u4e2a\u5173\u952e\u5e27\u7684\u50cf\u7d20\u5b50\u96c6\uff08\u7ea6 5%\uff09\u3002\u4e3a\u4e86\u8fdb\u884c\u8054\u5408\u4f18\u5316\uff0c\u6211\u4eec\u4ece\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u968f\u673a\u62bd\u53d6 \\(N_g\\) \u6761\u5c04\u7ebf\uff0c\u4ee5\u4f18\u5316\u573a\u666f\u8868\u793a\u548c\u76f8\u673a\u4f4d\u59ff\u3002","title":"Idea"},{"location":"cv/papers/nerf/co-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/nerf/ddn-slam/","text":"DDN-SLAM \u00b6 \u7ea6 225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DDN-SLAM: Real-time Dense Dynamic Neural Implicit SLAM code: not open source Idea \u00b6 \u63d0\u51fa\u4e86\u57fa\u4e8e \u8bed\u4e49\u7279\u5f81 \u7684\u52a8\u6001 SLAM\uff0c\u901a\u8fc7\u7ed3\u5408 \u8bed\u4e49\u68c0\u6d4b\u6846\u67b6 \u548c \u9ad8\u65af\u6df7\u5408\u6a21\u578b \u80cc\u666f\u6df1\u5ea6\u6982\u7387\u68c0\u67e5\u65b9\u6cd5\uff0c\u533a\u5206\u524d\u666f\u548c\u80cc\u666f\u4ee5\u6d88\u9664\u5e72\u6270\u7684\u52a8\u6001\u7279\u5f81\u70b9\uff1b \u901a\u8fc7\u5bf9\u52a8\u6001\u70b9 \u91cd\u6295\u5f71\u8bef\u5dee \u7684\u4e8c\u6b21\u68c0\u67e5\u5e76 BA \u6765\u5efa\u7acb\u957f\u671f\u7684\u6570\u636e\u5173\u8054\uff1b \u63d0\u51fa\u4e00\u79cd\u6df7\u5408\u7684\u80cc\u666f\u6062\u590d\u548c\u6e32\u67d3\u7b56\u7565\uff0c\u5305\u62ec\u5229\u7528 \u7279\u5f81\u7684\u5149\u6d41\u6765\u533a\u5206\u52a8\u6001\u63a9\u7801 \u4ee5\u8fdb\u884c\u80cc\u666f\u6062\u590d\uff1b \u63d0\u51fa\u4e00\u79cd\u7531 \u9759\u6001\u7a00\u758f\u70b9\u4e91\u5f15\u5bfc\u7684\u91c7\u6837\u7b56\u7565 \uff0c\u4ee5\u589e\u5f3a\u5bf9\u9759\u6001\u8868\u9762\u7684\u91cd\u5efa\uff1b \u63d0\u51fa\u4e00\u79cd\u57fa\u4e8e \u52a8\u6001\u63a9\u7801\u7684\u6e32\u67d3\u635f\u5931 \uff0c\u5305\u62ec\u8fd0\u52a8\u4e00\u81f4\u6027\u635f\u5931\u3001\u6df1\u5ea6\u635f\u5931\u548c\u989c\u8272\u635f\u5931\uff0c\u4ee5\u7ea6\u675f\u52a8\u6001\u7269\u4f53\u7684\u6e32\u67d3\u9b3c\u5f71\u5e76\u6d88\u9664\u906e\u6321\u3002 Experiments \u00b6 \u65e0\u6e90\u4ee3\u7801\u3002","title":"DDN-SLAM"},{"location":"cv/papers/nerf/ddn-slam/#ddn-slam","text":"\u7ea6 225 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DDN-SLAM: Real-time Dense Dynamic Neural Implicit SLAM code: not open source","title":"DDN-SLAM"},{"location":"cv/papers/nerf/ddn-slam/#idea","text":"\u63d0\u51fa\u4e86\u57fa\u4e8e \u8bed\u4e49\u7279\u5f81 \u7684\u52a8\u6001 SLAM\uff0c\u901a\u8fc7\u7ed3\u5408 \u8bed\u4e49\u68c0\u6d4b\u6846\u67b6 \u548c \u9ad8\u65af\u6df7\u5408\u6a21\u578b \u80cc\u666f\u6df1\u5ea6\u6982\u7387\u68c0\u67e5\u65b9\u6cd5\uff0c\u533a\u5206\u524d\u666f\u548c\u80cc\u666f\u4ee5\u6d88\u9664\u5e72\u6270\u7684\u52a8\u6001\u7279\u5f81\u70b9\uff1b \u901a\u8fc7\u5bf9\u52a8\u6001\u70b9 \u91cd\u6295\u5f71\u8bef\u5dee \u7684\u4e8c\u6b21\u68c0\u67e5\u5e76 BA \u6765\u5efa\u7acb\u957f\u671f\u7684\u6570\u636e\u5173\u8054\uff1b \u63d0\u51fa\u4e00\u79cd\u6df7\u5408\u7684\u80cc\u666f\u6062\u590d\u548c\u6e32\u67d3\u7b56\u7565\uff0c\u5305\u62ec\u5229\u7528 \u7279\u5f81\u7684\u5149\u6d41\u6765\u533a\u5206\u52a8\u6001\u63a9\u7801 \u4ee5\u8fdb\u884c\u80cc\u666f\u6062\u590d\uff1b \u63d0\u51fa\u4e00\u79cd\u7531 \u9759\u6001\u7a00\u758f\u70b9\u4e91\u5f15\u5bfc\u7684\u91c7\u6837\u7b56\u7565 \uff0c\u4ee5\u589e\u5f3a\u5bf9\u9759\u6001\u8868\u9762\u7684\u91cd\u5efa\uff1b \u63d0\u51fa\u4e00\u79cd\u57fa\u4e8e \u52a8\u6001\u63a9\u7801\u7684\u6e32\u67d3\u635f\u5931 \uff0c\u5305\u62ec\u8fd0\u52a8\u4e00\u81f4\u6027\u635f\u5931\u3001\u6df1\u5ea6\u635f\u5931\u548c\u989c\u8272\u635f\u5931\uff0c\u4ee5\u7ea6\u675f\u52a8\u6001\u7269\u4f53\u7684\u6e32\u67d3\u9b3c\u5f71\u5e76\u6d88\u9664\u906e\u6321\u3002","title":"Idea"},{"location":"cv/papers/nerf/ddn-slam/#experiments","text":"\u65e0\u6e90\u4ee3\u7801\u3002","title":"Experiments"},{"location":"cv/papers/nerf/imap/","text":"iMAP \u00b6 \u7ea6 969 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a iMAP: Implicit Mapping and Positioning in Real-Time code\uff1a iMAP_pytorch Idea \u00b6 Intrdocution \u00b6 \u7b2c\u4e00\u4e2a\u57fa\u4e8e RGB-D \u76f8\u673a\uff0c\u7528 MLP \u505a\u573a\u666f\u8868\u5f81 \u5b9e\u65f6 SLAM\u7cfb\u7edf \u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684 TSDF \u573a\u666f\u8868\u5f81\u65b9\u6cd5\uff0ciMAP \u53ef\u4ee5\u91cd\u5efa\u51fa\u672a\u88ab\u89c2\u5bdf\u5230\u7684\u5730\u65b9 \u9690\u5f0f\u573a\u666f\u8868\u5f81\u53ef\u4ee5\u7528\u6765\u505a\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\uff0c\u4f46\u90fd\u662f\u79bb\u7ebf\u5f62\u5f0f\uff0c\u8ba1\u7b97\u91cf\u5927\uff0ciMAP \u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u80fd\u8fbe\u5230\u5b9e\u65f6\u6548\u679c \u6301\u7eed\u5b66\u4e60\u4f1a\u9047\u5230 \u707e\u96be\u6027\u9057\u5fd8 \uff0ciMAP \u91c7\u7528 replay-based approach\uff0c\u5c06\u5148\u524d\u7684\u7ed3\u679c\u7f13\u5b58 Implicit Scene Neural Network \u00b6 \u501f\u9274 NeRF\uff0c\u7528 MLP \u5c06 3D \u5750\u6807\u70b9\u8f6c\u6362\u6210\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\u503c\uff1a \\(\\bold{p}=(x,y,z),F_\\theta(\\bold{p})=(\\bold{c}, \\rho)\\) \u4e0d\u8003\u8651\u89c6\u89d2\u65b9\u5411\uff08\u4e0d\u9700\u8981\u5bf9\u955c\u9762\u53cd\u5c04\u5efa\u6a21\uff09 Depth and Colour Rendering \u00b6 \u901a\u8fc7 scene network \u6765\u4ece\u6307\u5b9a\u89c6\u89d2\u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\u56fe\u50cf \u8f93\u5165\u662f\u76f8\u673a\u4f4d\u59ff \\(T_{WC}\\) \u548c\u50cf\u7d20\u5750\u6807 \\([u,v]\\) \uff0c\u5148\u53cd\u6295\u5f71\u5230\u4e16\u754c\u5750\u6807\u7cfb: \\[\\bold{r}=T_{WC}K^{-1}[u,v]\\] \u7136\u540e\u5728\u89c6\u89d2\u5c04\u7ebf\u4e0a\u91c7\u6837\uff1a \\[\\bold{p}_i=d_i \\bold{r} \\ \\ \\ \\ \\ d_i \\in \\{d_1, ..., d_N\\}\\] \u67e5\u8be2\u573a\u666f\u7f51\u7edc\u4e4b\u524d\u5f97\u5230\u7684\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\uff1a \\[(\\bold{c}_i, \\rho_i) = F_\\theta(\\bold{p}_i)\\] \u5c06\u4f53\u79ef\u5bc6\u5ea6\u8f6c\u6362\u4e3a\u5360\u636e\u6982\u7387 occupancy probability: \\[ \\delta_i = d_{i+1} - d_i \\\\ o_i = 1 - \\exp(-\\rho_i \\delta_i) \\\\ w_i = o_i \\prod_{j=1}^{i-1}(1-o_j) \\] \u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\uff1a \\[ \\hat{D}[u,v] = \\sum_{i=1}^{N}w_i d_i \\\\ \\hat{I}[u,v] = \\sum_{i=1}^{N}w_i \\bold{c}_i \\] \u8ba1\u7b97\u6df1\u5ea6\u7684\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}[u,v] = \\sum_{i=1}^{N}w_i (d_i - \\hat{D}[u,v])^2 \\] Joint optimisation \u00b6 \u7528\u5173\u952e\u5e27\u96c6\u5408\uff0c\u9488\u5bf9 \u7f51\u7edc\u53c2\u6570 \u548c \u76f8\u673a\u4f4d\u59ff \u505a\u8054\u5408\u4f18\u5316\u3002Adam \u4f18\u5316\u5668\uff0closs \u662f \u5149\u5ea6\u8bef\u5dee \u548c \u51e0\u4f55\u8bef\u5dee \u7684\u52a0\u6743 \u5149\u5ea6\u8bef\u5dee photometric error\uff1a \\[ e_i^p[u, v]=\\left | I_i[u,v] - \\hat{I}_i[u,v] \\right | \\\\ \\\\ L_p = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} e_i^p[u, v] \\] \u51e0\u4f55\u8bef\u5dee geometric error\uff08\u4f7f\u7528\u5230\u6df1\u5ea6\u65b9\u5dee\uff09\uff1a \\[ L_g = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} \\frac{e_i^g[u,v]}{\\sqrt{\\hat{D}_{var}[u,v]}} \\] Adam \u4f18\u5316\u5668\uff0c\u5bf9\u5149\u5ea6\u8bef\u5dee\u6dfb\u52a0\u4e00\u4e2a\u6743\u91cd \\(\\lambda\\) \uff1a \\[ \\min_{\\theta,\\{T_i\\}}(L_g + \\lambda_p L_p) \\] \u4e0a\u9762\u90fd\u662f Mapping \u9636\u6bb5\uff0cTracking \u9636\u6bb5\u4e0e Mapping \u5e76\u884c\uff0c\u4f46\u662f\u9891\u7387\u66f4\u9ad8\uff0c\u9488\u5bf9 latest frame\uff0c\u56fa\u5b9a\u573a\u666f\u7f51\u7edc\uff0c\u4f7f\u7528\u4e4b\u524d\u7684 loss \u548c\u4f18\u5316\u5668\u4f18\u5316\u4f4d\u59ff Keyframe Selection \u00b6 \u8003\u8651\u8ba1\u7b97\u590d\u6742\u5ea6\u548c\u56fe\u50cf\u5197\u4f59\u5ea6\uff0c\u57fa\u4e8e information gain \u9009\u53d6\u5173\u952e\u5e27 \u7b2c\u4e00\u5e27 \u4e00\u5b9a\u88ab\u9009\u53d6\uff0c\u7528\u4f5c\u7f51\u7edc\u521d\u59cb\u5316\u548c\u4e16\u754c\u5750\u6807\u7cfb\u7684\u56fa\u5b9a \u6bcf\u65b0\u589e\u4e00\u4e2a\u5173\u952e\u5e27\uff0c\u4fdd\u5b58\u4e00\u6b21 network \u4f5c\u4e3a snapshot\uff0c\u7528\u4e8e replay\uff08\u9632\u6b62 catastrophic forgetting \u7684\u7f13\u5b58\u673a\u5236\uff09 \u540e\u7eed\u5173\u952e\u5e27\u7684\u9009\u53d6\u65b9\u6cd5\u662f\uff0c\u4e0e snapshot \u505a\u6bd4\u8f83\uff0c \u662f\u5426\u89c2\u5bdf\u5230\u4e86\u65b0\u533a\u57df \u5728 snapshot \u548c frame \u968f\u673a\u9009\u53d6 s \u4e2a\u50cf\u7d20\u70b9 \u6bd4\u8f83\u6df1\u5ea6\u503c\u5dee\u4e00\uff0c\u8ba1\u7b97\u5982\u4e0b\u5206\u6570\uff0c\u7136\u540e\u4e0e\u9608\u503c\u505a\u6bd4\u8f83\uff0c\u5c0f\u4e8e\u5c31\u52a0\u5165\u5173\u952e\u5e27 \\[ P=\\frac{1}{\\left | s \\right | } \\sum_{(u,v) \\in s} (\\frac{\\left | D[u,v] - \\hat{D}[u,v] \\right | }{D[u,v]} < t_D) \\] Active Sampling \u00b6 \u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u590d\u6742\u5ea6\uff0ciMAP \u5206\u522b\u5bf9\u50cf\u7d20\u70b9\u3001\u5173\u952e\u5e27\u90fd\u505a\u4e86 Active Sampling image active sampling\uff1a\u5bf9\u56fe\u50cf\u968f\u673a\u9009\u70b9\uff0c\u9009\u53d6\u65b9\u6cd5\u662f\u5148\u5206\u5757\uff0c\u5148\u5747\u5300\u91c7\u6837\uff0c\u5206\u5757\u6c42 loss\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5757\u7684\u6743\u91cd\uff0c\u7136\u540e\u6839\u636e\u6743\u91cd\u91c7\u6837 keyframe active sampling\uff1a\u4e3a\u4e86\u9650\u5236\u8054\u5408\u4f18\u5316\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\uff0c\u6bcf\u6b21\u8fed\u4ee3\u53ea\u9009\u4e09\u4e2a\u5173\u952e\u5e27\u3002\u540c\u4e0a\uff0c\u4e5f\u662f\u8ba1\u7b97 loss \u5728\u5206\u914d\u6743\u91cd Experiments \u00b6 \u6211\u4eec\u5bf9\u6a21\u62df\u5e8f\u5217\u548c\u771f\u5b9e\u5e8f\u5217\u8fdb\u884c\u5b9e\u9a8c\u3002\u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6211\u4eec\u4f7f\u7528\u526f\u672c\u6570\u636e\u96c6[29]\uff0c\u5bf9\u771f\u5b9e\u623f\u95f4\u89c4\u6a21\u7684\u73af\u5883\u8fdb\u884c\u9ad8\u8d28\u91cf3D\u91cd\u5efa\uff0c\u5305\u62ec5\u4e2a\u529e\u516c\u5ba4\u548c3\u4e2a\u516c\u5bd3\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u526f\u672c\u573a\u666f\uff0c\u6211\u4eec\u6e32\u67d32000\u4e2aRGB-D\u5e27\u7684\u968f\u673a\u8f68\u8ff9\u3002\u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u6211\u4eec\u4f7f\u7528\u624b\u6301Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D\u6570\u636e\u96c6[30]\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002 \u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6570\u636e\u96c6\u662f Replica \u7684 5 offices \u548c 3 apartments \u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u4f7f\u7528\u624b\u6301 Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D \u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002","title":"iMAP"},{"location":"cv/papers/nerf/imap/#imap","text":"\u7ea6 969 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract paper\uff1a iMAP: Implicit Mapping and Positioning in Real-Time code\uff1a iMAP_pytorch","title":"iMAP"},{"location":"cv/papers/nerf/imap/#idea","text":"","title":"Idea"},{"location":"cv/papers/nerf/imap/#intrdocution","text":"\u7b2c\u4e00\u4e2a\u57fa\u4e8e RGB-D \u76f8\u673a\uff0c\u7528 MLP \u505a\u573a\u666f\u8868\u5f81 \u5b9e\u65f6 SLAM\u7cfb\u7edf \u76f8\u6bd4\u4e8e\u4f20\u7edf\u7684 TSDF \u573a\u666f\u8868\u5f81\u65b9\u6cd5\uff0ciMAP \u53ef\u4ee5\u91cd\u5efa\u51fa\u672a\u88ab\u89c2\u5bdf\u5230\u7684\u5730\u65b9 \u9690\u5f0f\u573a\u666f\u8868\u5f81\u53ef\u4ee5\u7528\u6765\u505a\u76f8\u673a\u4f4d\u59ff\u4f30\u8ba1\uff0c\u4f46\u90fd\u662f\u79bb\u7ebf\u5f62\u5f0f\uff0c\u8ba1\u7b97\u91cf\u5927\uff0ciMAP \u4f7f\u7528\u6df1\u5ea6\u56fe\u50cf\u80fd\u8fbe\u5230\u5b9e\u65f6\u6548\u679c \u6301\u7eed\u5b66\u4e60\u4f1a\u9047\u5230 \u707e\u96be\u6027\u9057\u5fd8 \uff0ciMAP \u91c7\u7528 replay-based approach\uff0c\u5c06\u5148\u524d\u7684\u7ed3\u679c\u7f13\u5b58","title":"Intrdocution"},{"location":"cv/papers/nerf/imap/#implicit-scene-neural-network","text":"\u501f\u9274 NeRF\uff0c\u7528 MLP \u5c06 3D \u5750\u6807\u70b9\u8f6c\u6362\u6210\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\u503c\uff1a \\(\\bold{p}=(x,y,z),F_\\theta(\\bold{p})=(\\bold{c}, \\rho)\\) \u4e0d\u8003\u8651\u89c6\u89d2\u65b9\u5411\uff08\u4e0d\u9700\u8981\u5bf9\u955c\u9762\u53cd\u5c04\u5efa\u6a21\uff09","title":"Implicit Scene Neural Network"},{"location":"cv/papers/nerf/imap/#depth-and-colour-rendering","text":"\u901a\u8fc7 scene network \u6765\u4ece\u6307\u5b9a\u89c6\u89d2\u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\u56fe\u50cf \u8f93\u5165\u662f\u76f8\u673a\u4f4d\u59ff \\(T_{WC}\\) \u548c\u50cf\u7d20\u5750\u6807 \\([u,v]\\) \uff0c\u5148\u53cd\u6295\u5f71\u5230\u4e16\u754c\u5750\u6807\u7cfb: \\[\\bold{r}=T_{WC}K^{-1}[u,v]\\] \u7136\u540e\u5728\u89c6\u89d2\u5c04\u7ebf\u4e0a\u91c7\u6837\uff1a \\[\\bold{p}_i=d_i \\bold{r} \\ \\ \\ \\ \\ d_i \\in \\{d_1, ..., d_N\\}\\] \u67e5\u8be2\u573a\u666f\u7f51\u7edc\u4e4b\u524d\u5f97\u5230\u7684\u989c\u8272\u548c\u4f53\u79ef\u5bc6\u5ea6\uff1a \\[(\\bold{c}_i, \\rho_i) = F_\\theta(\\bold{p}_i)\\] \u5c06\u4f53\u79ef\u5bc6\u5ea6\u8f6c\u6362\u4e3a\u5360\u636e\u6982\u7387 occupancy probability: \\[ \\delta_i = d_{i+1} - d_i \\\\ o_i = 1 - \\exp(-\\rho_i \\delta_i) \\\\ w_i = o_i \\prod_{j=1}^{i-1}(1-o_j) \\] \u5f97\u5230\u6df1\u5ea6\u548c\u989c\u8272\uff1a \\[ \\hat{D}[u,v] = \\sum_{i=1}^{N}w_i d_i \\\\ \\hat{I}[u,v] = \\sum_{i=1}^{N}w_i \\bold{c}_i \\] \u8ba1\u7b97\u6df1\u5ea6\u7684\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}[u,v] = \\sum_{i=1}^{N}w_i (d_i - \\hat{D}[u,v])^2 \\]","title":"Depth and Colour Rendering"},{"location":"cv/papers/nerf/imap/#joint-optimisation","text":"\u7528\u5173\u952e\u5e27\u96c6\u5408\uff0c\u9488\u5bf9 \u7f51\u7edc\u53c2\u6570 \u548c \u76f8\u673a\u4f4d\u59ff \u505a\u8054\u5408\u4f18\u5316\u3002Adam \u4f18\u5316\u5668\uff0closs \u662f \u5149\u5ea6\u8bef\u5dee \u548c \u51e0\u4f55\u8bef\u5dee \u7684\u52a0\u6743 \u5149\u5ea6\u8bef\u5dee photometric error\uff1a \\[ e_i^p[u, v]=\\left | I_i[u,v] - \\hat{I}_i[u,v] \\right | \\\\ \\\\ L_p = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} e_i^p[u, v] \\] \u51e0\u4f55\u8bef\u5dee geometric error\uff08\u4f7f\u7528\u5230\u6df1\u5ea6\u65b9\u5dee\uff09\uff1a \\[ L_g = \\frac{1}{M} \\sum_{i=1}^{W} \\sum_{(u,v) \\in s_i} \\frac{e_i^g[u,v]}{\\sqrt{\\hat{D}_{var}[u,v]}} \\] Adam \u4f18\u5316\u5668\uff0c\u5bf9\u5149\u5ea6\u8bef\u5dee\u6dfb\u52a0\u4e00\u4e2a\u6743\u91cd \\(\\lambda\\) \uff1a \\[ \\min_{\\theta,\\{T_i\\}}(L_g + \\lambda_p L_p) \\] \u4e0a\u9762\u90fd\u662f Mapping \u9636\u6bb5\uff0cTracking \u9636\u6bb5\u4e0e Mapping \u5e76\u884c\uff0c\u4f46\u662f\u9891\u7387\u66f4\u9ad8\uff0c\u9488\u5bf9 latest frame\uff0c\u56fa\u5b9a\u573a\u666f\u7f51\u7edc\uff0c\u4f7f\u7528\u4e4b\u524d\u7684 loss \u548c\u4f18\u5316\u5668\u4f18\u5316\u4f4d\u59ff","title":"Joint optimisation"},{"location":"cv/papers/nerf/imap/#keyframe-selection","text":"\u8003\u8651\u8ba1\u7b97\u590d\u6742\u5ea6\u548c\u56fe\u50cf\u5197\u4f59\u5ea6\uff0c\u57fa\u4e8e information gain \u9009\u53d6\u5173\u952e\u5e27 \u7b2c\u4e00\u5e27 \u4e00\u5b9a\u88ab\u9009\u53d6\uff0c\u7528\u4f5c\u7f51\u7edc\u521d\u59cb\u5316\u548c\u4e16\u754c\u5750\u6807\u7cfb\u7684\u56fa\u5b9a \u6bcf\u65b0\u589e\u4e00\u4e2a\u5173\u952e\u5e27\uff0c\u4fdd\u5b58\u4e00\u6b21 network \u4f5c\u4e3a snapshot\uff0c\u7528\u4e8e replay\uff08\u9632\u6b62 catastrophic forgetting \u7684\u7f13\u5b58\u673a\u5236\uff09 \u540e\u7eed\u5173\u952e\u5e27\u7684\u9009\u53d6\u65b9\u6cd5\u662f\uff0c\u4e0e snapshot \u505a\u6bd4\u8f83\uff0c \u662f\u5426\u89c2\u5bdf\u5230\u4e86\u65b0\u533a\u57df \u5728 snapshot \u548c frame \u968f\u673a\u9009\u53d6 s \u4e2a\u50cf\u7d20\u70b9 \u6bd4\u8f83\u6df1\u5ea6\u503c\u5dee\u4e00\uff0c\u8ba1\u7b97\u5982\u4e0b\u5206\u6570\uff0c\u7136\u540e\u4e0e\u9608\u503c\u505a\u6bd4\u8f83\uff0c\u5c0f\u4e8e\u5c31\u52a0\u5165\u5173\u952e\u5e27 \\[ P=\\frac{1}{\\left | s \\right | } \\sum_{(u,v) \\in s} (\\frac{\\left | D[u,v] - \\hat{D}[u,v] \\right | }{D[u,v]} < t_D) \\]","title":"Keyframe Selection"},{"location":"cv/papers/nerf/imap/#active-sampling","text":"\u4e3a\u4e86\u51cf\u5c11\u8ba1\u7b97\u590d\u6742\u5ea6\uff0ciMAP \u5206\u522b\u5bf9\u50cf\u7d20\u70b9\u3001\u5173\u952e\u5e27\u90fd\u505a\u4e86 Active Sampling image active sampling\uff1a\u5bf9\u56fe\u50cf\u968f\u673a\u9009\u70b9\uff0c\u9009\u53d6\u65b9\u6cd5\u662f\u5148\u5206\u5757\uff0c\u5148\u5747\u5300\u91c7\u6837\uff0c\u5206\u5757\u6c42 loss\uff0c\u8ba1\u7b97\u6bcf\u4e00\u5757\u7684\u6743\u91cd\uff0c\u7136\u540e\u6839\u636e\u6743\u91cd\u91c7\u6837 keyframe active sampling\uff1a\u4e3a\u4e86\u9650\u5236\u8054\u5408\u4f18\u5316\u7684\u8ba1\u7b97\u590d\u6742\u5ea6\uff0c\u6bcf\u6b21\u8fed\u4ee3\u53ea\u9009\u4e09\u4e2a\u5173\u952e\u5e27\u3002\u540c\u4e0a\uff0c\u4e5f\u662f\u8ba1\u7b97 loss \u5728\u5206\u914d\u6743\u91cd","title":"Active Sampling"},{"location":"cv/papers/nerf/imap/#experiments","text":"\u6211\u4eec\u5bf9\u6a21\u62df\u5e8f\u5217\u548c\u771f\u5b9e\u5e8f\u5217\u8fdb\u884c\u5b9e\u9a8c\u3002\u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6211\u4eec\u4f7f\u7528\u526f\u672c\u6570\u636e\u96c6[29]\uff0c\u5bf9\u771f\u5b9e\u623f\u95f4\u89c4\u6a21\u7684\u73af\u5883\u8fdb\u884c\u9ad8\u8d28\u91cf3D\u91cd\u5efa\uff0c\u5305\u62ec5\u4e2a\u529e\u516c\u5ba4\u548c3\u4e2a\u516c\u5bd3\u3002\u5bf9\u4e8e\u6bcf\u4e2a\u526f\u672c\u573a\u666f\uff0c\u6211\u4eec\u6e32\u67d32000\u4e2aRGB-D\u5e27\u7684\u968f\u673a\u8f68\u8ff9\u3002\u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u6211\u4eec\u4f7f\u7528\u624b\u6301Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D\u6570\u636e\u96c6[30]\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002 \u5bf9\u4e8e\u91cd\u5efa\u8bc4\u4f30\uff0c\u6570\u636e\u96c6\u662f Replica \u7684 5 offices \u548c 3 apartments \u5bf9\u4e8e\u539f\u59cb\u76f8\u673a\u5f55\u5236\uff0c\u4f7f\u7528\u624b\u6301 Microsoft Azure Kinect\u5728\u5404\u79cd\u73af\u5883\u4e2d\u6355\u83b7RGB-D\u89c6\u9891\uff0c\u5e76\u5728TUM RGB-D \u4e0a\u8fdb\u884c\u6d4b\u8bd5\u4ee5\u8bc4\u4f30\u76f8\u673a\u8ddf\u8e2a\u3002","title":"Experiments"},{"location":"cv/papers/nerf/nerf-evaluation/","text":"NeRF-Evaluation \u00b6 \u7ea6 1033 \u4e2a\u5b57 114 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract NeRF \u5e38\u7528\u8bc4\u4ef7\u6307\u6807 PSNR \u00b6 Info Peak Signal-to-Noise Ratio \u5cf0\u503c\u4fe1\u566a\u6bd4 \u8861\u91cf\u4e86\u4e00\u5f20\u566a\u58f0\u56fe\u50cf\u548c\u4e00\u5f20\u5e72\u51c0\u56fe\u50cf\u7684\u5dee\u5f02 PSNR\u901a\u8fc7\u8ba1\u7b97\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5747\u65b9\u8bef\u5dee\uff08Mean Squared Error\uff0cMSE\uff09\u6765\u91cf\u5316\u5b83\u4eec\u4e4b\u95f4\u7684\u5dee\u5f02\u3002 \u4e24\u5f20\u56fe\u8c61\u7684\u5dee\u5f02\u8d8a\u5c0f\uff0cMSE\u8d8a\u5c0f, PSNR\u5c31\u8d8a\u5927\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d \u3002 \\[ MSE = \\frac{1}{mn}\\sum_{i=0}^{m-1} \\sum_{j=0}^{n-1}[I(i, j) - K(i, j)]^2 \\\\ PSNR = 10 * \\log_{10}(\\frac{MAX_I^2}{MSE}) \\] \u5176\u4e2d \\(MAX\\) \u662f\u52a8\u6001\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5373\u67d0\u70b9 \\((i, j)\\) \u50cf\u7d20\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5982\u679c\u56fe\u50cf\u662f \\(8\\) \u4f4d\u7684\uff0c\u5219 \\(MAX = 2^8 - 1 = 255\\) from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) . astype ( np . float64 ) img2 = np . array ( Image . open ( 'compress.jpg' )) . astype ( np . float64 ) def psnr ( img1 , img2 ): mse = np . mean (( img1 - img2 ) ** 2 ) if mse == 0 : return float ( 'inf' ) else : return 20 * np . log10 ( 255 / np . sqrt ( mse )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) # -------- # from skimage.metrics import peak_signal_noise_ratio as psnr from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) img2 = np . array ( Image . open ( 'compress.jpg' )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) Tip PSNR\u63a5\u8fd1 50dB \uff0c\u4ee3\u8868\u538b\u7f29\u540e\u7684\u56fe\u50cf\u4ec5\u6709\u4e9b\u8bb8\u975e\u5e38\u5c0f\u7684\u8bef\u5dee\u3002 PSNR\u5927\u4e8e 30dB \uff0c\u4eba\u773c\u5f88\u96be\u67e5\u89c9\u538b\u7f29\u540e\u548c\u539f\u59cb\u5f71\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 20dB \u5230 30dB \u4e4b\u95f4\uff0c\u4eba\u773c\u5c31\u53ef\u4ee5\u5bdf\u89c9\u51fa\u56fe\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 10dB \u5230 20dB \u4e4b\u95f4\uff0c\u4eba\u773c\u8fd8\u662f\u53ef\u4ee5\u7528\u8089\u773c\u770b\u51fa\u8fd9\u4e2a\u56fe\u50cf\u539f\u59cb\u7684\u7ed3\u6784\uff0c\u4e14\u76f4\u89c2\u4e0a\u4f1a\u5224\u65ad\u4e24\u5f20\u56fe\u50cf\u4e0d\u5b58\u5728\u5f88\u5927\u7684\u5dee\u5f02\u3002 PSNR\u4f4e\u4e8e 10dB\uff0c\u4eba\u7c7b\u5f88\u96be\u7528\u8089\u773c\u53bb\u5224\u65ad\u4e24\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u76f8\u540c\uff0c\u4e00\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u53e6\u4e00\u4e2a\u56fe\u50cf\u7684\u538b\u7f29\u7ed3\u679c\u3002 MS-SSIM \u00b6 Info Structural Similarity Index Measure \u7ed3\u6784\u76f8\u4f3c\u6027 \u91cf\u4e86\u4e24\u5f20\u56fe\u7247\u4e4b\u95f4\u7684\u76f8\u4f3c\u7a0b\u5ea6/\u8861\u91cf\u56fe\u7247\u7684\u5931\u771f\u7a0b\u5ea6\uff0c\u8003\u8651\u4e86\u56fe\u50cf\u7684\u4eae\u5ea6\u3001\u5bf9\u6bd4\u5ea6\u548c\u7ed3\u6784\u7b49\u65b9\u9762\uff0c\u800c MS-SSIM\u3002\u5728 SSIM \u7684\u57fa\u7840\u4e0a\u5f15\u5165\u591a\u4e2a\u5c3a\u5ea6 MS-SSIM\u7684\u503c\u8303\u56f4\u5728 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u63a5\u8fd1 1 \u8868\u793a\u91cd\u5efa\u56fe\u50cf\u4e0e\u539f\u59cb\u56fe\u50cf\u7684\u76f8\u4f3c\u5ea6\u8d8a\u9ad8\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d import cv2 import numpy as np def ms_ssim ( img1 , img2 ): # \u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf img1 = cv2 . cvtColor ( img1 , cv2 . COLOR_BGR2GRAY ) img2 = cv2 . cvtColor ( img2 , cv2 . COLOR_BGR2GRAY ) # \u8ba1\u7b97MS-SSIM weights = np . array ([ 0.0448 , 0.2856 , 0.3001 , 0.2363 , 0.1333 ]) # \u4e0d\u540c\u5c3a\u5ea6\u7684\u6743\u91cd levels = weights . size mssim = np . zeros ( levels ) mcs = np . zeros ( levels ) for i in range ( levels ): ssim_map , cs_map = ssim ( img1 , img2 ) mssim [ i ] = np . mean ( ssim_map ) mcs [ i ] = np . mean ( cs_map ) img1 = cv2 . resize ( img1 , ( img1 . shape [ 1 ] // 2 , img1 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) img2 = cv2 . resize ( img2 , ( img2 . shape [ 1 ] // 2 , img2 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) # \u6574\u4f53MS-SSIM\u8ba1\u7b97 overall_mssim = np . prod ( mcs [: - 1 ] ** weights [: - 1 ]) * ( mssim [ - 1 ] ** weights [ - 1 ]) return overall_mssim def ssim ( img1 , img2 , k1 = 0.01 , k2 = 0.03 , win_size = 11 , L = 255 ): C1 = ( k1 * L ) ** 2 C2 = ( k2 * L ) ** 2 # \u8ba1\u7b97\u5747\u503c\u548c\u65b9\u5dee mu1 = cv2 . GaussianBlur ( img1 , ( win_size , win_size ), 1.5 ) mu2 = cv2 . GaussianBlur ( img2 , ( win_size , win_size ), 1.5 ) mu1_sq = mu1 ** 2 mu2_sq = mu2 ** 2 mu1_mu2 = mu1 * mu2 sigma1_sq = cv2 . GaussianBlur ( img1 * img1 , ( win_size , win_size ), 1.5 ) - mu1_sq sigma2_sq = cv2 . GaussianBlur ( img2 * img2 , ( win_size , win_size ), 1.5 ) - mu2_sq sigma12 = cv2 . GaussianBlur ( img1 * img2 , ( win_size , win_size ), 1.5 ) - mu1_mu2 # \u8ba1\u7b97\u76f8\u4f3c\u6027\u5ea6\u91cf ssim_map = (( 2 * mu1_mu2 + C1 ) * ( 2 * sigma12 + C2 )) / (( mu1_sq + mu2_sq + C1 ) * ( sigma1_sq + sigma2_sq + C2 )) cs_map = ( 2 * sigma12 + C2 ) / ( sigma1_sq + sigma2_sq + C2 ) return ssim_map , cs_map # \u8bfb\u53d6\u56fe\u50cf img1 = cv2 . imread ( 'image1.jpg' ) img2 = cv2 . imread ( 'image2.jpg' ) # \u8ba1\u7b97MS-SSIM ms_ssim_score = ms_ssim ( img1 , img2 ) print ( \"MS-SSIM score:\" , ms_ssim_score ) LPIPS \u00b6 Info Learned Perceptual Image Patch Similarity \u5b66\u4e60\u611f\u77e5\u56fe\u50cf\u5757\u76f8\u4f3c\u5ea6 \u57fa\u4e8e\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u7528\u4e8e\u8bc4\u4f30\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf LPIPS\u7684\u5f97\u5206\u8303\u56f4\u901a\u5e38\u662f 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u5c0f\u8868\u793a\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf\u8d8a\u9ad8 \u4e0e\u4f20\u7edf\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff08\u5982PSNR\u548cSSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u66f4\u52a0\u6ce8\u91cd\u4e8e\u4eba\u773c\u611f\u77e5\u7684\u56e0\u7d20\uff0c\u80fd\u591f\u66f4\u597d\u5730\u6355\u6349\u5230\u56fe\u50cf\u4e4b\u95f4\u7684\u611f\u77e5\u5dee\u5f02 LPIPS\u662f\u4e00\u79cd\u57fa\u4e8e\u5b66\u4e60\u7684\u6307\u6807\uff0c\u5b83\u7684\u6027\u80fd\u53d7\u5230\u6240\u4f7f\u7528\u7684CNN\u6a21\u578b\u548c\u8bad\u7ec3\u6570\u636e\u7684\u5f71\u54cd\u3002\u56e0\u6b64\uff0c\u5728\u4f7f\u7528LPIPS\u8fdb\u884c\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u4e0e\u8bad\u7ec3\u6a21\u578b\u76f8\u4f3c\u7684\u6570\u636e\u96c6\u548c\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u4ee5\u4fdd\u8bc1\u8bc4\u4f30\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u53ef\u9760\u6027 import torch import torchvision.transforms as transforms from PIL import Image from models import dist_model # \u52a0\u8f7d\u9884\u8bad\u7ec3\u7684LPIPS\u6a21\u578b model = dist_model . DistModel () model . initialize ( model = 'net-lin' , net = 'alex' , use_gpu = True ) # \u56fe\u50cf\u9884\u5904\u7406 preprocess = transforms . Compose ([ transforms . Resize (( 256 , 256 )), transforms . ToTensor () ]) # \u52a0\u8f7d\u56fe\u50cf\u5e76\u8fdb\u884c\u9884\u5904\u7406 image1 = Image . open ( 'image1.jpg' ) . convert ( 'RGB' ) image2 = Image . open ( 'image2.jpg' ) . convert ( 'RGB' ) image1 = preprocess ( image1 ) . unsqueeze ( 0 ) image2 = preprocess ( image2 ) . unsqueeze ( 0 ) # \u5c06\u56fe\u50cf\u8f6c\u6362\u4e3aPyTorch\u5f20\u91cf\u5e76\u8ba1\u7b97LPIPS with torch . no_grad (): lpips_score = model . forward ( image1 , image2 ) . item () print ( \"LPIPS score:\" , lpips_score ) Comparison \u00b6 Quote PSNR\uff08Peak Signal-to-Noise Ratio\uff09\uff1aPSNR\u662f\u4e00\u79cd\u5e38\u7528\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff0c\u7528\u4e8e\u8861\u91cf\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u5b83\u901a\u8fc7\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u6765\u91cf\u5316\u4e24\u4e2a\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u6570\u503c\u8d8a\u9ad8\u8868\u793a\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d\u3002 MS-SSIM\uff08Multi-Scale Structural Similarity Index\uff09\uff1aMS-SSIM\u662f\u4e00\u79cd\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u5728\u8ba1\u7b97\u56fe\u50cf\u76f8\u4f3c\u6027\u65f6\u8003\u8651\u4e86\u591a\u4e2a\u5c3a\u5ea6\u7684\u4fe1\u606f\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08SSIM\uff09\u76f8\u6bd4\uff0cMS-SSIM\u5c06\u56fe\u50cf\u5206\u89e3\u6210\u591a\u4e2a\u5c3a\u5ea6\uff0c\u5e76\u5728\u6bcf\u4e2a\u5c3a\u5ea6\u4e0a\u8ba1\u7b97\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u6700\u540e\u53d6\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u7684\u76f8\u4f3c\u6027\u8bc4\u4f30\u3002MS-SSIM\u76f8\u8f83\u4e8ePSNR\u66f4\u80fd\u53cd\u6620\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002 LPIPS\uff08Learned Perceptual Image Patch Similarity\uff09\uff1aLPIPS\u662f\u4e00\u79cd\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u901a\u8fc7\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u6765\u5b66\u4e60\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u76f8\u4f3c\u6027\u3002LPIPS\u8003\u8651\u4e86\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u654f\u611f\u6027\uff0c\u901a\u8fc7\u8ba1\u7b97\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u8ddd\u79bb\u6765\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08\u5982SSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u5728\u5b66\u4e60\u611f\u77e5\u8ddd\u79bb\u65f6\u66f4\u52a0\u51c6\u786e\u548c\u5168\u9762\u3002 \u8fd9\u4e9b\u6307\u6807\u5728\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u4e2d\u90fd\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002PSNR\u4e3b\u8981\u7528\u4e8e\u8861\u91cf\u56fe\u50cf\u7684\u91cd\u5efa\u8bef\u5dee\uff0c\u800cMS-SSIM\u548cLPIPS\u66f4\u52a0\u5173\u6ce8\u4eba\u773c\u5bf9\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e0d\u540c\u7684\u6307\u6807\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u7efc\u5408\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002 Reference \u00b6 NeRF\u5e38\u7528\u8bc4\u4ef7\u6307\u6807\u90fd\u662f\u4ec0\u4e48\u610f\u601d\uff1fPSNR\u3001SSIM\u3001LPIPS\u8be6\u89e3 NeRF \u6a21\u578b\u8bc4\u4ef7\u6307\u6807PSNR,MS-SSIM, LPIPS \u8be6\u89e3\u548cpython\u5b9e\u73b0","title":"NeRF-Evaluation"},{"location":"cv/papers/nerf/nerf-evaluation/#nerf-evaluation","text":"\u7ea6 1033 \u4e2a\u5b57 114 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract NeRF \u5e38\u7528\u8bc4\u4ef7\u6307\u6807","title":"NeRF-Evaluation"},{"location":"cv/papers/nerf/nerf-evaluation/#psnr","text":"Info Peak Signal-to-Noise Ratio \u5cf0\u503c\u4fe1\u566a\u6bd4 \u8861\u91cf\u4e86\u4e00\u5f20\u566a\u58f0\u56fe\u50cf\u548c\u4e00\u5f20\u5e72\u51c0\u56fe\u50cf\u7684\u5dee\u5f02 PSNR\u901a\u8fc7\u8ba1\u7b97\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5747\u65b9\u8bef\u5dee\uff08Mean Squared Error\uff0cMSE\uff09\u6765\u91cf\u5316\u5b83\u4eec\u4e4b\u95f4\u7684\u5dee\u5f02\u3002 \u4e24\u5f20\u56fe\u8c61\u7684\u5dee\u5f02\u8d8a\u5c0f\uff0cMSE\u8d8a\u5c0f, PSNR\u5c31\u8d8a\u5927\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d \u3002 \\[ MSE = \\frac{1}{mn}\\sum_{i=0}^{m-1} \\sum_{j=0}^{n-1}[I(i, j) - K(i, j)]^2 \\\\ PSNR = 10 * \\log_{10}(\\frac{MAX_I^2}{MSE}) \\] \u5176\u4e2d \\(MAX\\) \u662f\u52a8\u6001\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5373\u67d0\u70b9 \\((i, j)\\) \u50cf\u7d20\u8303\u56f4\u7684\u6700\u5927\u503c\uff0c\u5982\u679c\u56fe\u50cf\u662f \\(8\\) \u4f4d\u7684\uff0c\u5219 \\(MAX = 2^8 - 1 = 255\\) from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) . astype ( np . float64 ) img2 = np . array ( Image . open ( 'compress.jpg' )) . astype ( np . float64 ) def psnr ( img1 , img2 ): mse = np . mean (( img1 - img2 ) ** 2 ) if mse == 0 : return float ( 'inf' ) else : return 20 * np . log10 ( 255 / np . sqrt ( mse )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) # -------- # from skimage.metrics import peak_signal_noise_ratio as psnr from PIL import Image import numpy as np img1 = np . array ( Image . open ( 'original.jpg' )) img2 = np . array ( Image . open ( 'compress.jpg' )) if __name__ == \"__main__\" : print ( psnr ( img1 , img2 )) Tip PSNR\u63a5\u8fd1 50dB \uff0c\u4ee3\u8868\u538b\u7f29\u540e\u7684\u56fe\u50cf\u4ec5\u6709\u4e9b\u8bb8\u975e\u5e38\u5c0f\u7684\u8bef\u5dee\u3002 PSNR\u5927\u4e8e 30dB \uff0c\u4eba\u773c\u5f88\u96be\u67e5\u89c9\u538b\u7f29\u540e\u548c\u539f\u59cb\u5f71\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 20dB \u5230 30dB \u4e4b\u95f4\uff0c\u4eba\u773c\u5c31\u53ef\u4ee5\u5bdf\u89c9\u51fa\u56fe\u50cf\u7684\u5dee\u5f02\u3002 PSNR\u4ecb\u4e8e 10dB \u5230 20dB \u4e4b\u95f4\uff0c\u4eba\u773c\u8fd8\u662f\u53ef\u4ee5\u7528\u8089\u773c\u770b\u51fa\u8fd9\u4e2a\u56fe\u50cf\u539f\u59cb\u7684\u7ed3\u6784\uff0c\u4e14\u76f4\u89c2\u4e0a\u4f1a\u5224\u65ad\u4e24\u5f20\u56fe\u50cf\u4e0d\u5b58\u5728\u5f88\u5927\u7684\u5dee\u5f02\u3002 PSNR\u4f4e\u4e8e 10dB\uff0c\u4eba\u7c7b\u5f88\u96be\u7528\u8089\u773c\u53bb\u5224\u65ad\u4e24\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u76f8\u540c\uff0c\u4e00\u4e2a\u56fe\u50cf\u662f\u5426\u4e3a\u53e6\u4e00\u4e2a\u56fe\u50cf\u7684\u538b\u7f29\u7ed3\u679c\u3002","title":"PSNR"},{"location":"cv/papers/nerf/nerf-evaluation/#ms-ssim","text":"Info Structural Similarity Index Measure \u7ed3\u6784\u76f8\u4f3c\u6027 \u91cf\u4e86\u4e24\u5f20\u56fe\u7247\u4e4b\u95f4\u7684\u76f8\u4f3c\u7a0b\u5ea6/\u8861\u91cf\u56fe\u7247\u7684\u5931\u771f\u7a0b\u5ea6\uff0c\u8003\u8651\u4e86\u56fe\u50cf\u7684\u4eae\u5ea6\u3001\u5bf9\u6bd4\u5ea6\u548c\u7ed3\u6784\u7b49\u65b9\u9762\uff0c\u800c MS-SSIM\u3002\u5728 SSIM \u7684\u57fa\u7840\u4e0a\u5f15\u5165\u591a\u4e2a\u5c3a\u5ea6 MS-SSIM\u7684\u503c\u8303\u56f4\u5728 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u63a5\u8fd1 1 \u8868\u793a\u91cd\u5efa\u56fe\u50cf\u4e0e\u539f\u59cb\u56fe\u50cf\u7684\u76f8\u4f3c\u5ea6\u8d8a\u9ad8\uff0c\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d import cv2 import numpy as np def ms_ssim ( img1 , img2 ): # \u8f6c\u6362\u4e3a\u7070\u5ea6\u56fe\u50cf img1 = cv2 . cvtColor ( img1 , cv2 . COLOR_BGR2GRAY ) img2 = cv2 . cvtColor ( img2 , cv2 . COLOR_BGR2GRAY ) # \u8ba1\u7b97MS-SSIM weights = np . array ([ 0.0448 , 0.2856 , 0.3001 , 0.2363 , 0.1333 ]) # \u4e0d\u540c\u5c3a\u5ea6\u7684\u6743\u91cd levels = weights . size mssim = np . zeros ( levels ) mcs = np . zeros ( levels ) for i in range ( levels ): ssim_map , cs_map = ssim ( img1 , img2 ) mssim [ i ] = np . mean ( ssim_map ) mcs [ i ] = np . mean ( cs_map ) img1 = cv2 . resize ( img1 , ( img1 . shape [ 1 ] // 2 , img1 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) img2 = cv2 . resize ( img2 , ( img2 . shape [ 1 ] // 2 , img2 . shape [ 0 ] // 2 ), interpolation = cv2 . INTER_LINEAR ) # \u6574\u4f53MS-SSIM\u8ba1\u7b97 overall_mssim = np . prod ( mcs [: - 1 ] ** weights [: - 1 ]) * ( mssim [ - 1 ] ** weights [ - 1 ]) return overall_mssim def ssim ( img1 , img2 , k1 = 0.01 , k2 = 0.03 , win_size = 11 , L = 255 ): C1 = ( k1 * L ) ** 2 C2 = ( k2 * L ) ** 2 # \u8ba1\u7b97\u5747\u503c\u548c\u65b9\u5dee mu1 = cv2 . GaussianBlur ( img1 , ( win_size , win_size ), 1.5 ) mu2 = cv2 . GaussianBlur ( img2 , ( win_size , win_size ), 1.5 ) mu1_sq = mu1 ** 2 mu2_sq = mu2 ** 2 mu1_mu2 = mu1 * mu2 sigma1_sq = cv2 . GaussianBlur ( img1 * img1 , ( win_size , win_size ), 1.5 ) - mu1_sq sigma2_sq = cv2 . GaussianBlur ( img2 * img2 , ( win_size , win_size ), 1.5 ) - mu2_sq sigma12 = cv2 . GaussianBlur ( img1 * img2 , ( win_size , win_size ), 1.5 ) - mu1_mu2 # \u8ba1\u7b97\u76f8\u4f3c\u6027\u5ea6\u91cf ssim_map = (( 2 * mu1_mu2 + C1 ) * ( 2 * sigma12 + C2 )) / (( mu1_sq + mu2_sq + C1 ) * ( sigma1_sq + sigma2_sq + C2 )) cs_map = ( 2 * sigma12 + C2 ) / ( sigma1_sq + sigma2_sq + C2 ) return ssim_map , cs_map # \u8bfb\u53d6\u56fe\u50cf img1 = cv2 . imread ( 'image1.jpg' ) img2 = cv2 . imread ( 'image2.jpg' ) # \u8ba1\u7b97MS-SSIM ms_ssim_score = ms_ssim ( img1 , img2 ) print ( \"MS-SSIM score:\" , ms_ssim_score )","title":"MS-SSIM"},{"location":"cv/papers/nerf/nerf-evaluation/#lpips","text":"Info Learned Perceptual Image Patch Similarity \u5b66\u4e60\u611f\u77e5\u56fe\u50cf\u5757\u76f8\u4f3c\u5ea6 \u57fa\u4e8e\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u7528\u4e8e\u8bc4\u4f30\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf LPIPS\u7684\u5f97\u5206\u8303\u56f4\u901a\u5e38\u662f 0 \u5230 1 \u4e4b\u95f4\uff0c\u6570\u503c\u8d8a\u5c0f\u8868\u793a\u56fe\u50cf\u7684\u611f\u77e5\u8d28\u91cf\u8d8a\u9ad8 \u4e0e\u4f20\u7edf\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff08\u5982PSNR\u548cSSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u66f4\u52a0\u6ce8\u91cd\u4e8e\u4eba\u773c\u611f\u77e5\u7684\u56e0\u7d20\uff0c\u80fd\u591f\u66f4\u597d\u5730\u6355\u6349\u5230\u56fe\u50cf\u4e4b\u95f4\u7684\u611f\u77e5\u5dee\u5f02 LPIPS\u662f\u4e00\u79cd\u57fa\u4e8e\u5b66\u4e60\u7684\u6307\u6807\uff0c\u5b83\u7684\u6027\u80fd\u53d7\u5230\u6240\u4f7f\u7528\u7684CNN\u6a21\u578b\u548c\u8bad\u7ec3\u6570\u636e\u7684\u5f71\u54cd\u3002\u56e0\u6b64\uff0c\u5728\u4f7f\u7528LPIPS\u8fdb\u884c\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u65f6\uff0c\u9700\u8981\u4f7f\u7528\u4e0e\u8bad\u7ec3\u6a21\u578b\u76f8\u4f3c\u7684\u6570\u636e\u96c6\u548c\u9884\u8bad\u7ec3\u6a21\u578b\uff0c\u4ee5\u4fdd\u8bc1\u8bc4\u4f30\u7ed3\u679c\u7684\u51c6\u786e\u6027\u548c\u53ef\u9760\u6027 import torch import torchvision.transforms as transforms from PIL import Image from models import dist_model # \u52a0\u8f7d\u9884\u8bad\u7ec3\u7684LPIPS\u6a21\u578b model = dist_model . DistModel () model . initialize ( model = 'net-lin' , net = 'alex' , use_gpu = True ) # \u56fe\u50cf\u9884\u5904\u7406 preprocess = transforms . Compose ([ transforms . Resize (( 256 , 256 )), transforms . ToTensor () ]) # \u52a0\u8f7d\u56fe\u50cf\u5e76\u8fdb\u884c\u9884\u5904\u7406 image1 = Image . open ( 'image1.jpg' ) . convert ( 'RGB' ) image2 = Image . open ( 'image2.jpg' ) . convert ( 'RGB' ) image1 = preprocess ( image1 ) . unsqueeze ( 0 ) image2 = preprocess ( image2 ) . unsqueeze ( 0 ) # \u5c06\u56fe\u50cf\u8f6c\u6362\u4e3aPyTorch\u5f20\u91cf\u5e76\u8ba1\u7b97LPIPS with torch . no_grad (): lpips_score = model . forward ( image1 , image2 ) . item () print ( \"LPIPS score:\" , lpips_score )","title":"LPIPS"},{"location":"cv/papers/nerf/nerf-evaluation/#comparison","text":"Quote PSNR\uff08Peak Signal-to-Noise Ratio\uff09\uff1aPSNR\u662f\u4e00\u79cd\u5e38\u7528\u7684\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u6307\u6807\uff0c\u7528\u4e8e\u8861\u91cf\u539f\u59cb\u56fe\u50cf\u4e0e\u91cd\u5efa\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\u3002\u5b83\u901a\u8fc7\u8ba1\u7b97\u5747\u65b9\u8bef\u5dee\uff08MSE\uff09\u6765\u91cf\u5316\u4e24\u4e2a\u56fe\u50cf\u4e4b\u95f4\u7684\u5dee\u5f02\uff0c\u6570\u503c\u8d8a\u9ad8\u8868\u793a\u56fe\u50cf\u8d28\u91cf\u8d8a\u597d\u3002 MS-SSIM\uff08Multi-Scale Structural Similarity Index\uff09\uff1aMS-SSIM\u662f\u4e00\u79cd\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u5728\u8ba1\u7b97\u56fe\u50cf\u76f8\u4f3c\u6027\u65f6\u8003\u8651\u4e86\u591a\u4e2a\u5c3a\u5ea6\u7684\u4fe1\u606f\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08SSIM\uff09\u76f8\u6bd4\uff0cMS-SSIM\u5c06\u56fe\u50cf\u5206\u89e3\u6210\u591a\u4e2a\u5c3a\u5ea6\uff0c\u5e76\u5728\u6bcf\u4e2a\u5c3a\u5ea6\u4e0a\u8ba1\u7b97\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u6700\u540e\u53d6\u5e73\u5747\u503c\u4f5c\u4e3a\u6700\u7ec8\u7684\u76f8\u4f3c\u6027\u8bc4\u4f30\u3002MS-SSIM\u76f8\u8f83\u4e8ePSNR\u66f4\u80fd\u53cd\u6620\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002 LPIPS\uff08Learned Perceptual Image Patch Similarity\uff09\uff1aLPIPS\u662f\u4e00\u79cd\u5b66\u4e60\u7684\u611f\u77e5\u56fe\u50cf\u8865\u4e01\u76f8\u4f3c\u6027\u6307\u6807\uff0c\u5b83\u901a\u8fc7\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u6765\u5b66\u4e60\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u76f8\u4f3c\u6027\u3002LPIPS\u8003\u8651\u4e86\u4eba\u773c\u5bf9\u4e8e\u56fe\u50cf\u611f\u77e5\u7684\u654f\u611f\u6027\uff0c\u901a\u8fc7\u8ba1\u7b97\u56fe\u50cf\u8865\u4e01\u4e4b\u95f4\u7684\u611f\u77e5\u8ddd\u79bb\u6765\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002\u4e0e\u4f20\u7edf\u7684\u7ed3\u6784\u76f8\u4f3c\u6027\u6307\u6807\uff08\u5982SSIM\uff09\u76f8\u6bd4\uff0cLPIPS\u5728\u5b66\u4e60\u611f\u77e5\u8ddd\u79bb\u65f6\u66f4\u52a0\u51c6\u786e\u548c\u5168\u9762\u3002 \u8fd9\u4e9b\u6307\u6807\u5728\u56fe\u50cf\u8d28\u91cf\u8bc4\u4f30\u4e2d\u90fd\u6709\u5e7f\u6cdb\u7684\u5e94\u7528\u3002PSNR\u4e3b\u8981\u7528\u4e8e\u8861\u91cf\u56fe\u50cf\u7684\u91cd\u5efa\u8bef\u5dee\uff0c\u800cMS-SSIM\u548cLPIPS\u66f4\u52a0\u5173\u6ce8\u4eba\u773c\u5bf9\u56fe\u50cf\u611f\u77e5\u7684\u5dee\u5f02\u3002\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\uff0c\u4e0d\u540c\u7684\u6307\u6807\u53ef\u4ee5\u7ed3\u5408\u4f7f\u7528\uff0c\u4ee5\u7efc\u5408\u8bc4\u4f30\u56fe\u50cf\u8d28\u91cf\u3002","title":"Comparison"},{"location":"cv/papers/nerf/nerf-evaluation/#reference","text":"NeRF\u5e38\u7528\u8bc4\u4ef7\u6307\u6807\u90fd\u662f\u4ec0\u4e48\u610f\u601d\uff1fPSNR\u3001SSIM\u3001LPIPS\u8be6\u89e3 NeRF \u6a21\u578b\u8bc4\u4ef7\u6307\u6807PSNR,MS-SSIM, LPIPS \u8be6\u89e3\u548cpython\u5b9e\u73b0","title":"Reference"},{"location":"cv/papers/nerf/nerf/","text":"NeRF \u00b6 \u7ea6 2137 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract paper\uff1a NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis code\uff1a nerf_pytorch Idea \u00b6 Introduction \u00b6 \u901a\u8fc7\u4f18\u5316\u4e00\u7ec4\u7a00\u758f\u8f93\u5165\u89c6\u89d2\u7684\u8fde\u7eed\u4f53\u79ef\u573a\u51fd\u6570\uff0c\u5b9e\u73b0\u5408\u6210\u590d\u6742\u573a\u666f\u7684\u65b0\u89c6\u89d2\u3002 \u7528\u4e00\u4e2a \u5168\u94fe\u63a5\uff08\u975e\u5377\u79ef\uff09\u6df1\u5ea6\u7f51\u7edc \u8868\u793a\u573a\u666f\uff0c\u8f93\u5165\u662f\u4e00\u4e2a \u8fde\u7eed\u7684 5D \u5750\u6807\uff08 \\(x\\) , \\(y\\) , \\(z\\) , \\(\\theta\\) , \\(\\phi\\) \u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff09\uff0c\u8f93\u51fa\u662f \u8be5\u7a7a\u95f4\u4f4d\u7f6e\u5904\u7684\u4f53\u79ef\u5bc6\u5ea6\u548c\u89c6\u89d2\u76f8\u5173\u7684\u8f90\u5c04\u5f3a\u5ea6 \u3002 \u901a\u8fc7\u67e5\u8be2\u76f8\u673a\u5149\u7ebf\u4e0a 5D \u5750\u6807\u6765\u5408\u6210\u89c6\u89d2\uff0c\u5e76\u7528\u4f53\u6e32\u67d3\u6280\u672f\u5c06\u8f93\u51fa\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u6295\u5f71\u5230\u56fe\u50cf\u4e2d \u3002 \u7531\u4e8e\u4f53\u6e32\u67d3\u5728\u81ea\u7136\u4e0a\u662f\u53ef\u5fae\u5206\u7684\uff0c \u4f18\u5316\u6211\u4eec\u7684\u8868\u793a\u6240\u9700\u7684\u552f\u4e00\u8f93\u5165\u662f\u4e00\u7ec4\u5177\u6709\u5df2\u77e5\u76f8\u673a\u59ff\u6001\u7684\u56fe\u50cf \uff0c\u5305\u62ec\u4e00\u79cd\u5206\u5c42\u91c7\u6837\u7b56\u7565\uff0c\u5c06 MLP \u7684\u5bb9\u91cf\u5206\u914d\u7ed9\u5177\u6709\u53ef\u89c1\u573a\u666f\u5185\u5bb9\u7684\u7a7a\u95f4\u3002 \u4e00\u79cd \u4f4d\u7f6e\u7f16\u7801 \uff0c\u5c06\u6bcf\u4e2a\u8f93\u5165\u7684 5D \u5750\u6807\u6620\u5c04\u5230\u66f4\u9ad8\u7ef4\u5ea6\u7684\u7a7a\u95f4\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u5b66\u4e60\u8868\u793a\u5177\u6709\u66f4\u9ad8\u9891\u7387\u7684\u573a\u666f\u5185\u5bb9 NeRF Scene Representation \u00b6 \u4e0b\u56fe\u4e2d\u95f4\u7684\u51fd\u6570 \\(F\\) \u5c31\u662f\u56fe\u5f53\u4e2d\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u7528\u6765\u8868\u793a 3D \u573a\u666f\uff0c\u8fd9\u79cd\u8868\u793a\u65b9\u6cd5\u662f \u9690\u5f0f \u7684 \u8f93\u5165 \\(x,y,z,\\theta,\\phi\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB, \\sigma\\) \u662f\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u7684\u989c\u8272\u548c\u5bc6\u5ea6 Volume Rendering \u00b6 \u5149\u7ebf\u7684\u6570\u5b66\u8868\u793a\u4e0e\u5149\u7ebf\u91c7\u6837 \u00b6 \u4e00\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u7684\u5408\u6210\uff0c\u5c31\u662f\u6210\u50cf\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u90a3\u4e48\u8fd9\u6761\u5149\u7ebf\u600e\u4e48\u8868\u793a\uff1f\u4ee5\u53ca\u600e\u4e48\u5728\u5149\u7ebf\u4e0a\u53d6\u4e00\u4e9b\u70b9\uff1f nerf \u7684\u5149\u7ebf\u8868\u793a \u00b6 \u5149\u7ebf\u662f\u4e00\u6761\u7a7a\u95f4\u76f4\u7ebf\uff0c\u51c6\u786e\u7684\u8bf4\u662f\u4e00\u6761\u7a7a\u95f4\u5c04\u7ebf\uff0c\u8868\u793a\u5982\u4e0b \\[ \\bold{r}(t) = \\bold{c} + t\\bold{d} \\] \u8d77\u70b9\u5750\u6807 \\(\\bold{o}\\) \uff1a\u76f8\u673a\u4e2d\u5fc3\u70b9 \u65b9\u5411\u5411\u91cf \\(\\bold{d}\\) \uff1a\u76f8\u673a\u5149\u7ebf\u65b9\u5411 \\(t\\) \uff1a\u5149\u7ebf\u4e0a\u7684\u70b9\u5230\u8d77\u70b9\u7684\u6c34\u5e73\u8ddd\u79bb\uff0c \\(t\\) \u53d6\u4e0d\u540c\u7684\u503c\u5c31\u662f\u5149\u7ebf\u4e0a\u4e0d\u540c\u7684\u91c7\u6837\u70b9 nerf \u5149\u7ebf\u516c\u5f0f\u63a8\u5bfc \u00b6 \u7ecf\u8bc1\u660e\u540e NeRF \u7684 \\(t\\) \u53d6\u7684\u662f z \u8f74\u8ddd\u79bb\uff0c\u800c\u4e0d\u662f\u5149\u7ebf\u7684\u8ddd\u79bb\uff0c\u800c\u4e14\u53ea\u6709\u4e2d\u5fc3\u5149\u7ebf\u65b9\u5411\u662f\u5355\u4f4d\u5411\u91cf\u3002 \\[ \\bold{r} = \\bold{o} + \\|z\\|\\bold{d} \\] \u5149\u7ebf\u91c7\u6837 \u00b6 \\(t=\\|z\\|\\) \uff1a\u5149\u7ebf\u4e0a\u7684\u70b9\u5230\u8d77\u70b9\uff08\u76f8\u673a\u4e2d\u5fc3\uff09\u7684\u8ddd\u79bb\uff0c \\(t\\) \u53d6\u4e0d\u540c\u503c\u5c31\u662f\u5149\u7ebf\u4e0a\u4e0d\u540c\u7684\u91c7\u6837\u70b9\uff0cnerf \u9ed8\u8ba4\u53d6 61 \u4e2a\u70b9\uff0c60 \u6bb5\u3002 \\(\\bold{r}(t)\\) \uff1a\u5149\u7ebf\u4e0a\u7684\u70b9\u7684\u4e09\u7ef4\u5750\u6807\u3002 \\(\\bold{d}\\) \uff1a\u5149\u7ebf\u65b9\u5411\u5411\u91cf\uff0c\u4e5f\u662f\u4e09\u4e2a\u503c\u3002 Code def get_rays ( H , W , K , c2w ): i , j = torch . meshgrid ( torch . linspace ( 0 , W - 1 , W ), torch . linspace ( 0 , H - 1 , H )) i = i . t () j = j . t () dirs = torch . stack ([( i - K [ 0 ][ 2 ]) / K [ 0 ][ 0 ], - ( j - K [ 1 ][ 2 ]) / K [ 1 ][ 1 ], - torch . ones_like ( i )], - 1 ) rays_d = torch . sum ( dirs [ ... , np . newaxis , :] * c2w [: 3 ,: 3 ], - 1 ) rays_o = c2w [: 3 , - 1 ] . expand ( rays_d . shape ) return rays_o , rays_d #\u8ba1\u7b97\u5149\u7ebf\u91c7\u6837 z_vals = tf . linspace ( near , far , N_samples ) pts = rays_o [ ... , None ,:] + rays_d [ ... , None ,:] * z_vals [ ... ,:, None ] dirs \u662f\u76f8\u673a\u5750\u6807\u7cfb\u4e0b\u7684\u5149\u7ebf\u65b9\u5411\u3002 rays_d \u662f\u4e16\u754c\u5750\u6807\u7cfb\u4e0b\u7684\u5149\u7ebf\u65b9\u5411\uff0c\u4e3a\u4ec0\u4e48\u7528\u70b9\u4e58\uff0b\u6c42\u548c\uff1a\u56e0\u4e3a\u8f93\u5165\u662f\u884c\u5411\u91cf\uff08python\u6ca1\u6709\u4e00\u7ef4\u5217\u5411\u91cf\uff09\u4e0d\u80fd\u76f4\u63a5\u50cf\u5217\u5411\u91cf\u90a3\u6837\u7528\u77e9\u9635\u4e58\u6cd5\u3002 rays_o \u662f\u4e16\u754c\u5750\u6807\u7cfb\u4e0b\u7684\u5149\u7ebf\u8d77\u70b9\u3002 \u5149\u7ebf\u6210\u50cf\u6a21\u578b \u00b6 \u600e\u4e48\u5408\u6210\u4e00\u6761\u5149\u7ebf\u4e0a\u7684\u6240\u6709\u7c92\u5b50\u7684\u56fe\u50cf? \u5206\u6790\u5355\u70b9 P \u5bf9\u6210\u50cf\u7684\u8d21\u732e\u3002P \u8ddd\u79bb\u7ebf\u8d77\u70b9\u7684\u8ddd\u79bb\u662f t\uff0c\u7136\u540e\u80fd\u5f97\u51fa P \u70b9\u5750\u6807 \\(\\bold{r}(t)\\) \u5bc6\u5ea6\u8d8a\u9ad8\uff0c\u900f\u660e\u5ea6\u8d8a\u4f4e\uff0c\u6240\u4ee5\u5355\u770bP\u70b9\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot \\sigma\\) \\(\\sigma = 1.0\\) \uff1a\u5b8c\u5168\u4e0d\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 1.0=c\\) \\(\\sigma = 0.0\\) \uff1a\u5b8c\u6210\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 0.0=0\\) \u540c\u65f6\uff0c\u5149\u7ebf\u4ece\u76f8\u673a\u51fa\u53d1\uff0c\u7531\u4e8e\u5bc6\u5ea6 \\(\\sigma\\) \u7684\u5b58\u5728\uff0c\u5f3a\u5ea6\u4e0d\u65ad\u51cf\u5f31\uff0c\u4e0d\u4e00\u5b9a\u80fd\u5230\u5230 P \u70b9\uff0c\u5230\u8fbe\u7684\u6982\u7387\u65f6\u8bb0\u4e3a \\(\\bold{T}(t)\\) \u3002 \u53ef\u4ee5\u60f3\u8c61\uff0c \\(\\bold{\u03a4}\\) \u5e94\u8be5\u662f\u5bc6\u5ea6 \\(\\sigma\\) \u548c\u8ddd\u79bb \\(t\\) \u7684\u51fd\u6570 \u90a3\u4e48\u6c47\u603b\u5230\u4e00\u8d77\uff1a\u573a\u666f\u4e2d\u4e00\u70b9P\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u8d21\u732e\uff1a \\(\\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t))\\) \u3002 \u5176\u4e2d \\(\\bold{r}(t)\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u7684\u5750\u6807\uff0c \\(\\bold{d}\\) \u662f\u5149\u7ebf\u65b9\u5411\uff0c \\(t\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u4e0e\u76f8\u673a\u4e2d\u5fc3\u8ddd\u79bb\u3002 \u6574\u6761\u5149\u7ebf\u6210\u50cf\uff1a\u77e5\u9053\u4e86\u7684\u5355\u70b9\uff0c\u6574\u6761\u5149\u7ebf\u6210\u50cf\u5c31\u662f\u5bf9\u5149\u7ebf\u4e0a\u6240\u6709\u7684\u70b9\u6c42\u79ef\u5206\uff0c\u4e14\u8003\u8651\u5149\u7ebf\u53ea\u9700\u6709\u9650\u533a\u95f4 \\(t_n-t_f\\) \u4e4b\u95f4\uff0c\u5f97\u5149\u7ebf \\(r\\) \u6210\u50cf\uff1a \\[ C(r) = \\int_{t_n}^{t_f} \\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t)) dt \\ \\ \\ where \\ \\bold{T}(t) = \\exp(-\\int_{t_n}^{t_f} \\sigma(s) ds) \\] NeRF \u4e2d\u5206\u6bb5\u968f\u673a\u91c7\u6837 \u8ba1\u7b97\u673a\u662f\u65e0\u6cd5\u8fde\u7eed\u79ef\u5206\uff0c\u56e0\u6b64\u91c7\u6837\u662f\u9700\u8981\u8fd1\u4f3c\u79bb\u6563\u7684\u3002 \u5982\u679c\u9009\u62e9\u5728\u5149\u7ebf\u8def\u5f84\u4e0a\u5747\u5300\u91c7\u6837\uff0c\u867d\u7136\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u8fd1\u4f3c\u8fd9\u4e2a\u79ef\u5206\uff0c\u4f46\u8fd9\u79cd\u2f45\u6cd5\u5728\u5904\u7406\u5bc6\u5ea6\u8f83\u2fbc\u7684\u533a\u57df\u6216\u8005\u5feb\u901f\u53d8\u5316\u7684\u533a\u57df\u65f6\u6548\u679c\u5e76\u4e0d\u597d\u3002\u56e0\u4e3a\u8fd9\u4e9b\u533a\u57df\u53ef\u80fd\u9700\u8981\u66f4\u2fbc\u7684\u91c7\u6837\u5bc6\u5ea6\u6765\u51c6\u786e\u5730\u4f30\u8ba1\u79ef\u5206\u3002 \u2fb8\u5148\u5c06\u5c04\u7ebf\u9700\u8981\u79ef\u5206\u7684\u533a\u57df\u5206\u4e3aN\u4efd\uff0c\u7136\u540e\u5728\u6bcf\u2f00\u4e2a\u2f29\u533a\u57df\u4e2d\u8fdb\u2f8f\u5747\u5300\u968f\u673a\u91c7\u6837\u3002\u8fd9\u6837\u7684\u2f45\u5f0f\u80fd\u591f\u5728\u53ea\u91c7\u6837\u79bb\u6563\u70b9\u7684\u524d\u63d0\u4e0b\uff0c\u4fdd\u8bc1\u91c7\u6837\u4f4d\u7f6e\u7684\u8fde\u7eed\u6027\u3002 \\[ t_i\\thicksim\\mathcal{U}{\\left[t_n+\\frac{i-1}N(t_f-t_n),\\mathrm{~}t_n+\\frac iN(t_f-t_n)\\right]}. \\] Optimizing NeRF \u00b6 Positional encoding \u00b6 \u5bf9\u795e\u7ecf\u7f51\u7edc\u76f4\u63a5\u8f93\u5165 5D \u4f1a\u5bfc\u81f4\u6e32\u67d3\u6548\u679c\u8f83\u5dee\uff0c\u4e0d\u80fd\u5f88\u597d\u5730\u8868\u793a\u989c\u8272\u548c\u51e0\u4f55\u4e2d\u9ad8\u9891\u53d8\u5316\u3002 \u5c06\u8f93\u5165\u7684\u4e09\u7ef4\u5750\u6807\u8fdb\u884c\u4f4d\u7f6e\u7f16\u7801\uff1a \\[ F_\\mathcal{\\theta} = F_{\\mathcal{\\theta}}^\\prime \\gamma \\\\ \\gamma(p)=\\begin{pmatrix}\\sin\\bigl(2^0\\pi p\\bigr),\\cos\\bigl(2^0\\pi p\\bigr),&\\cdots,\\sin\\bigl(2^{L-1}\\pi p\\bigr), \\cos\\bigl(2^{L-1}\\pi p\\bigr)\\end{pmatrix}. \\] Hierarchical volume sampling \u00b6 NeRF \u7684\u6e32\u67d3\u8fc7\u7a0b\u8ba1\u7b97\u91cf\u5f88\u5927\uff0c\u6bcf\u6761\u5c04\u7ebf\u90fd\u8981\u91c7\u6837\u5f88\u591a\u70b9\uff0c\u4f46\u5b9e\u9645\u4e0a\uff0c\u4e00\u6761\u5c04\u7ebf\u4e0a\u7684\u5927\u90e8\u5206\u533a\u57df\u90fd\u662f\u7a7a\u533a\u57df\uff0c\u6216\u88ab\u906e\u6321\u7684\u533a\u57df\uff0c\u5bf9\u6700\u7ec8\u7684\u989c\u8272\u6ca1\u6709\u8d21\u732e\u3002 \u56e0\u6b64\u91c7\u7528\u4e00\u79cd coarse to fine \u7684\u5f62\u5f0f\uff0c\u540c\u65f6\u4f18\u5316 coarse \u7f51\u7edc\u548c fine \u7f51\u7edc\u3002\u5148\u5728\u5149\u7ebf\u4e0a\u5747\u5300\u91c7\u6837\u4e00\u4e9b\u70b9\uff0c\u5e76\u8ba1\u7b97\u5176\u4f53\u79ef\u5bc6\u5ea6\uff0c\u7136\u540e\u57fa\u4e8e\u8fd9\u4e9b\u5bc6\u5ea6\u503c\u8fdb\u884c\u91cd\u91c7\u6837\uff0c\u5f97\u5230\u66f4\u503e\u5411\u4e8e\u7269\u4f53\u5185\u90e8\u548c\u8868\u9762\u7684\u70b9\uff0c\u4ee5\u63d0\u9ad8\u6e32\u67d3\u6548\u679c\u3002 Loss Fn and Train \u00b6 \u5bf9\u4e8e\u6bcf\u4e2a\u573a\u666f\uff0c\u9488\u5bf9\u5355\u72ec\u7684\u795e\u7ecf\u8fde\u7eed\u4f53\u79ef\u8868\u793a\u7f51\u7edc\u8fdb\u884c\u4f18\u5316\u3002\u9700\u8981\u573a\u666f\u7684 RGB \u56fe\u50cf\u6570\u636e\u96c6\u3001\u76f8\u5e94\u7684\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\uff0c\u4ee5\u53ca\u573a\u666f\u8fb9\u754c\uff08\u5bf9\u4e8e\u5408\u6210\u6570\u636e\uff0c\u4f7f\u7528\u771f\u5b9e\u7684\u76f8\u673a\u4f4d\u59ff\u3001\u5185\u53c2\u548c\u8fb9\u754c\uff0c\u5bf9\u4e8e\u771f\u5b9e\u6570\u636e\uff0c\u4f7f\u7528 COLMAP \u4f30\u8ba1\u8fd9\u4e9b\u53c2\u6570\uff09 \u6bcf\u6b21\u8fed\u4ee3\uff0c\u4ece\u6570\u636e\u96c6\u4e2d\u6240\u6709\u50cf\u7d20\u4e2d\u968f\u673a\u91c7\u6837\u4e00\u4e2a batch \u7684\u76f8\u673a\u5149\u7ebf\uff0c\u7136\u540e\u6839\u636e\u5206\u5c42\u91c7\u6837\u65b9\u6cd5\u4ece coarse \u7f51\u7edc\u67e5\u8be2 \\(N_c\\) \u4e2a\u6837\u672c\u548c\u4ece fine \u7f51\u7edc\u4e2d\u67e5\u8be2 \\(N_c + N_f\\) \u4e2a\u6602\u672c\uff0c\u518d\u6839\u636e\u4f53\u6e32\u67d3\u5f97\u5230\u6bcf\u6761\u5149\u7ebf\u7684\u989c\u8272 \u635f\u5931\u51fd\u6570\u4ec5\u4ec5\u662f coarse \u548c fine \u7684\u6e32\u67d3\u50cf\u7d20\u989c\u8272\u4e0e\u771f\u5b9e\u989c\u8272\u4e4b\u95f4\u7684\u603b\u5e73\u65b9\u5dee\u8bef\u5dee\uff0c\u540c\u65f6\u4f18\u5316 coarse \u548c fine \\[ \\mathcal{L} = \\sum_{r \\in R} \\left [ \\left \\| \\hat{C}_c(r) - C(r) \\right \\|_2^2 - \\left \\| \\hat{C}_f(r) - C(r) \\right \\|_2^2 \\right ] \\] Pipeline \u00b6 \u5df2\u77e5\u76f8\u673a\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\u62cd\u6444\u4e86\u4e00\u7ec4\u76ee\u6807\u573a\u666f\u7684\u7167\u7247\u3002\uff08\u5982\u679c\u4f60\u662f\u624b\u673a\u62cd\u6444\u7684\u4e00\u6bb5\u89c6\u9891\u53ef\u4ee5\u7528 colormap \u8f6c\uff09 \u4ece\u76f8\u673a\u4e2d\u5fc3\u5f00\u59cb\uff0c\u6cbf\u7740\u67d0\u4e2a\u50cf\u7d20\u65b9\u5411\u53d1\u5c04\u4e00\u6761\u5149\u7ebf\u3002(\u6ce8\u610f\uff1a\u8ddf\u771f\u5b9e\u7684\u76f8\u673a\u6210\u50cf\u6a21\u578b\u5149\u7ebf\u65b9\u5411\u662f\u76f8\u53cd\u7684\uff0c\u4f46\u4e0d\u5f71\u54cd)\u3002 \u5efa\u7acb\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc \\(F\\) \uff0c\u8f93\u5165 \\((x,y,z,\\theta,\\phi)\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB,\\sigma\\) \u989c\u8272\u548c\u5bc6\u5ea6\u3002\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u3002 \u628a\u8fd9\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u5408\u6210\uff0c\u5c31\u80fd\u7b97\u51fa\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\u3002 \u6839\u636e\u8f93\u5165\u7684\u4e00\u7ec4\u56fe\u50cf\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u751f\u6210\u65e0\u6570\u6761\u5149\u7ebf\uff0c\u4e0d\u65ad\u53bb\u4f18\u5316\u53ef\u5fae\u51fd\u6570 \\(F\\) \u3002\u5f53\u4f18\u5316\u6b21\u6570\u8db3\u591f\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\(F\\) \u7b97\u51fa\u6240\u6709\u89c6\u89d2\u4e0b\u56fe\u50cf\u7684\u50cf\u7d20 RGB \u503c\u3002 \u77e5\u9053\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u7528 Marching Cubes \u7b97\u6cd5\u8f6c\u6362\u4e3a\u4e09\u89d2\u7f51\u4e09\u7ef4\u6a21\u578b\u3002\u5b8c\u6210\u4e09\u7ef4\u91cd\u5efa\u3002 \u6c42\u5f97 \\(F\\) \u5c31\u5b9e\u73b0\u4e86\u4e09\u7ef4\u91cd\u5efa\uff0c\u540e\u9762\u90fd\u662f\u5408\u6210\u65b0\u89c6\u89d2\u548c\u8f6c\u6362\u3002 \u57fa\u672c\u539f\u7406 \u4f5c\u8005\u9996\u5148\u628a\u91cd\u5efa\u8fc7\u7a0b \\(F\\) \u7528\u6df1\u5ea6\u5b66\u4e60\u4ee3\u66ff\uff0c \\(F(x,y,z,\\theta,\\phi)=RGB\\sigma\\) \u4ece\uff08\u7a7a\u95f4\u4f4d\u7f6e\u3001\u89c2\u5bdf\u65b9\u5411\uff09\u5230\uff08\u989c\u8272\u3001\u5bc6\u5ea6\uff09\u7684\u8fc7\u7a0b\u3002 \u4f5c\u8005\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u5149\u5b66\u6a21\u578b\u505a\u4e86\u5047\u8bbe\uff0c\u5efa\u7acb\u4e00\u4e2a\u6570\u5b66\u6a21\u578b\u3002 \u6839\u636e\u5149\u7ebf\u6210\u50cf\u4e0e\u8f93\u5165\u50cf\u7d20\u4e0d\u540c\u4e0d\u65ad\u4f18\u5316\uff0c\u8fdb\u800c\u4f18\u5316\u5f97\u51fa \\(F\\) \u3002 \u7b97\u6cd5\u7684\u5173\u952e\uff1a \u5149\u7ebf\u6210\u50cf\u6a21\u578b \u3002 Experiment \u00b6 \u4e0b\u56fe\u662f Instant-NGP \u5b9e\u9a8c\uff1a Reference \u00b6 nerf-learn NeRF\u5f00\u7bc7\u8bba\u6587\u89e3\u8bfb NeRF \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-NeRF\u5168\u89e3\uff08\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f\uff09 https://cloud.baidu.com/article/2741971","title":"NeRF"},{"location":"cv/papers/nerf/nerf/#nerf","text":"\u7ea6 2137 \u4e2a\u5b57 11 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract paper\uff1a NeRF: Representing Scenes as Neural Radiance Fields for View Synthesis code\uff1a nerf_pytorch","title":"NeRF"},{"location":"cv/papers/nerf/nerf/#idea","text":"","title":"Idea"},{"location":"cv/papers/nerf/nerf/#introduction","text":"\u901a\u8fc7\u4f18\u5316\u4e00\u7ec4\u7a00\u758f\u8f93\u5165\u89c6\u89d2\u7684\u8fde\u7eed\u4f53\u79ef\u573a\u51fd\u6570\uff0c\u5b9e\u73b0\u5408\u6210\u590d\u6742\u573a\u666f\u7684\u65b0\u89c6\u89d2\u3002 \u7528\u4e00\u4e2a \u5168\u94fe\u63a5\uff08\u975e\u5377\u79ef\uff09\u6df1\u5ea6\u7f51\u7edc \u8868\u793a\u573a\u666f\uff0c\u8f93\u5165\u662f\u4e00\u4e2a \u8fde\u7eed\u7684 5D \u5750\u6807\uff08 \\(x\\) , \\(y\\) , \\(z\\) , \\(\\theta\\) , \\(\\phi\\) \u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff09\uff0c\u8f93\u51fa\u662f \u8be5\u7a7a\u95f4\u4f4d\u7f6e\u5904\u7684\u4f53\u79ef\u5bc6\u5ea6\u548c\u89c6\u89d2\u76f8\u5173\u7684\u8f90\u5c04\u5f3a\u5ea6 \u3002 \u901a\u8fc7\u67e5\u8be2\u76f8\u673a\u5149\u7ebf\u4e0a 5D \u5750\u6807\u6765\u5408\u6210\u89c6\u89d2\uff0c\u5e76\u7528\u4f53\u6e32\u67d3\u6280\u672f\u5c06\u8f93\u51fa\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u6295\u5f71\u5230\u56fe\u50cf\u4e2d \u3002 \u7531\u4e8e\u4f53\u6e32\u67d3\u5728\u81ea\u7136\u4e0a\u662f\u53ef\u5fae\u5206\u7684\uff0c \u4f18\u5316\u6211\u4eec\u7684\u8868\u793a\u6240\u9700\u7684\u552f\u4e00\u8f93\u5165\u662f\u4e00\u7ec4\u5177\u6709\u5df2\u77e5\u76f8\u673a\u59ff\u6001\u7684\u56fe\u50cf \uff0c\u5305\u62ec\u4e00\u79cd\u5206\u5c42\u91c7\u6837\u7b56\u7565\uff0c\u5c06 MLP \u7684\u5bb9\u91cf\u5206\u914d\u7ed9\u5177\u6709\u53ef\u89c1\u573a\u666f\u5185\u5bb9\u7684\u7a7a\u95f4\u3002 \u4e00\u79cd \u4f4d\u7f6e\u7f16\u7801 \uff0c\u5c06\u6bcf\u4e2a\u8f93\u5165\u7684 5D \u5750\u6807\u6620\u5c04\u5230\u66f4\u9ad8\u7ef4\u5ea6\u7684\u7a7a\u95f4\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u5b66\u4e60\u8868\u793a\u5177\u6709\u66f4\u9ad8\u9891\u7387\u7684\u573a\u666f\u5185\u5bb9","title":"Introduction"},{"location":"cv/papers/nerf/nerf/#nerf-scene-representation","text":"\u4e0b\u56fe\u4e2d\u95f4\u7684\u51fd\u6570 \\(F\\) \u5c31\u662f\u56fe\u5f53\u4e2d\u7684\u795e\u7ecf\u7f51\u7edc\uff0c\u7528\u6765\u8868\u793a 3D \u573a\u666f\uff0c\u8fd9\u79cd\u8868\u793a\u65b9\u6cd5\u662f \u9690\u5f0f \u7684 \u8f93\u5165 \\(x,y,z,\\theta,\\phi\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB, \\sigma\\) \u662f\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u7684\u989c\u8272\u548c\u5bc6\u5ea6","title":"NeRF Scene Representation"},{"location":"cv/papers/nerf/nerf/#volume-rendering","text":"","title":"Volume Rendering"},{"location":"cv/papers/nerf/nerf/#_1","text":"\u4e00\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u7684\u5408\u6210\uff0c\u5c31\u662f\u6210\u50cf\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u90a3\u4e48\u8fd9\u6761\u5149\u7ebf\u600e\u4e48\u8868\u793a\uff1f\u4ee5\u53ca\u600e\u4e48\u5728\u5149\u7ebf\u4e0a\u53d6\u4e00\u4e9b\u70b9\uff1f","title":"\u5149\u7ebf\u7684\u6570\u5b66\u8868\u793a\u4e0e\u5149\u7ebf\u91c7\u6837"},{"location":"cv/papers/nerf/nerf/#_3","text":"\u600e\u4e48\u5408\u6210\u4e00\u6761\u5149\u7ebf\u4e0a\u7684\u6240\u6709\u7c92\u5b50\u7684\u56fe\u50cf? \u5206\u6790\u5355\u70b9 P \u5bf9\u6210\u50cf\u7684\u8d21\u732e\u3002P \u8ddd\u79bb\u7ebf\u8d77\u70b9\u7684\u8ddd\u79bb\u662f t\uff0c\u7136\u540e\u80fd\u5f97\u51fa P \u70b9\u5750\u6807 \\(\\bold{r}(t)\\) \u5bc6\u5ea6\u8d8a\u9ad8\uff0c\u900f\u660e\u5ea6\u8d8a\u4f4e\uff0c\u6240\u4ee5\u5355\u770bP\u70b9\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot \\sigma\\) \\(\\sigma = 1.0\\) \uff1a\u5b8c\u5168\u4e0d\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 1.0=c\\) \\(\\sigma = 0.0\\) \uff1a\u5b8c\u6210\u900f\u660e\uff0c\u5b83\u7684\u6210\u50cf\u989c\u8272\u5c31\u662f \\(c \\cdot 0.0=0\\) \u540c\u65f6\uff0c\u5149\u7ebf\u4ece\u76f8\u673a\u51fa\u53d1\uff0c\u7531\u4e8e\u5bc6\u5ea6 \\(\\sigma\\) \u7684\u5b58\u5728\uff0c\u5f3a\u5ea6\u4e0d\u65ad\u51cf\u5f31\uff0c\u4e0d\u4e00\u5b9a\u80fd\u5230\u5230 P \u70b9\uff0c\u5230\u8fbe\u7684\u6982\u7387\u65f6\u8bb0\u4e3a \\(\\bold{T}(t)\\) \u3002 \u53ef\u4ee5\u60f3\u8c61\uff0c \\(\\bold{\u03a4}\\) \u5e94\u8be5\u662f\u5bc6\u5ea6 \\(\\sigma\\) \u548c\u8ddd\u79bb \\(t\\) \u7684\u51fd\u6570 \u90a3\u4e48\u6c47\u603b\u5230\u4e00\u8d77\uff1a\u573a\u666f\u4e2d\u4e00\u70b9P\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u8d21\u732e\uff1a \\(\\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t))\\) \u3002 \u5176\u4e2d \\(\\bold{r}(t)\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u7684\u5750\u6807\uff0c \\(\\bold{d}\\) \u662f\u5149\u7ebf\u65b9\u5411\uff0c \\(t\\) \u662f\u5149\u7ebf\u4e0a\u70b9\u4e0e\u76f8\u673a\u4e2d\u5fc3\u8ddd\u79bb\u3002 \u6574\u6761\u5149\u7ebf\u6210\u50cf\uff1a\u77e5\u9053\u4e86\u7684\u5355\u70b9\uff0c\u6574\u6761\u5149\u7ebf\u6210\u50cf\u5c31\u662f\u5bf9\u5149\u7ebf\u4e0a\u6240\u6709\u7684\u70b9\u6c42\u79ef\u5206\uff0c\u4e14\u8003\u8651\u5149\u7ebf\u53ea\u9700\u6709\u9650\u533a\u95f4 \\(t_n-t_f\\) \u4e4b\u95f4\uff0c\u5f97\u5149\u7ebf \\(r\\) \u6210\u50cf\uff1a \\[ C(r) = \\int_{t_n}^{t_f} \\bold{T}(t) \\cdot \\bold{c}(\\bold{r}(t), d) \\cdot \\sigma(\\bold{r}(t)) dt \\ \\ \\ where \\ \\bold{T}(t) = \\exp(-\\int_{t_n}^{t_f} \\sigma(s) ds) \\] NeRF \u4e2d\u5206\u6bb5\u968f\u673a\u91c7\u6837 \u8ba1\u7b97\u673a\u662f\u65e0\u6cd5\u8fde\u7eed\u79ef\u5206\uff0c\u56e0\u6b64\u91c7\u6837\u662f\u9700\u8981\u8fd1\u4f3c\u79bb\u6563\u7684\u3002 \u5982\u679c\u9009\u62e9\u5728\u5149\u7ebf\u8def\u5f84\u4e0a\u5747\u5300\u91c7\u6837\uff0c\u867d\u7136\u5728\u4e00\u5b9a\u7a0b\u5ea6\u4e0a\u8fd1\u4f3c\u8fd9\u4e2a\u79ef\u5206\uff0c\u4f46\u8fd9\u79cd\u2f45\u6cd5\u5728\u5904\u7406\u5bc6\u5ea6\u8f83\u2fbc\u7684\u533a\u57df\u6216\u8005\u5feb\u901f\u53d8\u5316\u7684\u533a\u57df\u65f6\u6548\u679c\u5e76\u4e0d\u597d\u3002\u56e0\u4e3a\u8fd9\u4e9b\u533a\u57df\u53ef\u80fd\u9700\u8981\u66f4\u2fbc\u7684\u91c7\u6837\u5bc6\u5ea6\u6765\u51c6\u786e\u5730\u4f30\u8ba1\u79ef\u5206\u3002 \u2fb8\u5148\u5c06\u5c04\u7ebf\u9700\u8981\u79ef\u5206\u7684\u533a\u57df\u5206\u4e3aN\u4efd\uff0c\u7136\u540e\u5728\u6bcf\u2f00\u4e2a\u2f29\u533a\u57df\u4e2d\u8fdb\u2f8f\u5747\u5300\u968f\u673a\u91c7\u6837\u3002\u8fd9\u6837\u7684\u2f45\u5f0f\u80fd\u591f\u5728\u53ea\u91c7\u6837\u79bb\u6563\u70b9\u7684\u524d\u63d0\u4e0b\uff0c\u4fdd\u8bc1\u91c7\u6837\u4f4d\u7f6e\u7684\u8fde\u7eed\u6027\u3002 \\[ t_i\\thicksim\\mathcal{U}{\\left[t_n+\\frac{i-1}N(t_f-t_n),\\mathrm{~}t_n+\\frac iN(t_f-t_n)\\right]}. \\]","title":"\u5149\u7ebf\u6210\u50cf\u6a21\u578b"},{"location":"cv/papers/nerf/nerf/#optimizing-nerf","text":"","title":"Optimizing NeRF"},{"location":"cv/papers/nerf/nerf/#positional-encoding","text":"\u5bf9\u795e\u7ecf\u7f51\u7edc\u76f4\u63a5\u8f93\u5165 5D \u4f1a\u5bfc\u81f4\u6e32\u67d3\u6548\u679c\u8f83\u5dee\uff0c\u4e0d\u80fd\u5f88\u597d\u5730\u8868\u793a\u989c\u8272\u548c\u51e0\u4f55\u4e2d\u9ad8\u9891\u53d8\u5316\u3002 \u5c06\u8f93\u5165\u7684\u4e09\u7ef4\u5750\u6807\u8fdb\u884c\u4f4d\u7f6e\u7f16\u7801\uff1a \\[ F_\\mathcal{\\theta} = F_{\\mathcal{\\theta}}^\\prime \\gamma \\\\ \\gamma(p)=\\begin{pmatrix}\\sin\\bigl(2^0\\pi p\\bigr),\\cos\\bigl(2^0\\pi p\\bigr),&\\cdots,\\sin\\bigl(2^{L-1}\\pi p\\bigr), \\cos\\bigl(2^{L-1}\\pi p\\bigr)\\end{pmatrix}. \\]","title":"Positional encoding"},{"location":"cv/papers/nerf/nerf/#hierarchical-volume-sampling","text":"NeRF \u7684\u6e32\u67d3\u8fc7\u7a0b\u8ba1\u7b97\u91cf\u5f88\u5927\uff0c\u6bcf\u6761\u5c04\u7ebf\u90fd\u8981\u91c7\u6837\u5f88\u591a\u70b9\uff0c\u4f46\u5b9e\u9645\u4e0a\uff0c\u4e00\u6761\u5c04\u7ebf\u4e0a\u7684\u5927\u90e8\u5206\u533a\u57df\u90fd\u662f\u7a7a\u533a\u57df\uff0c\u6216\u88ab\u906e\u6321\u7684\u533a\u57df\uff0c\u5bf9\u6700\u7ec8\u7684\u989c\u8272\u6ca1\u6709\u8d21\u732e\u3002 \u56e0\u6b64\u91c7\u7528\u4e00\u79cd coarse to fine \u7684\u5f62\u5f0f\uff0c\u540c\u65f6\u4f18\u5316 coarse \u7f51\u7edc\u548c fine \u7f51\u7edc\u3002\u5148\u5728\u5149\u7ebf\u4e0a\u5747\u5300\u91c7\u6837\u4e00\u4e9b\u70b9\uff0c\u5e76\u8ba1\u7b97\u5176\u4f53\u79ef\u5bc6\u5ea6\uff0c\u7136\u540e\u57fa\u4e8e\u8fd9\u4e9b\u5bc6\u5ea6\u503c\u8fdb\u884c\u91cd\u91c7\u6837\uff0c\u5f97\u5230\u66f4\u503e\u5411\u4e8e\u7269\u4f53\u5185\u90e8\u548c\u8868\u9762\u7684\u70b9\uff0c\u4ee5\u63d0\u9ad8\u6e32\u67d3\u6548\u679c\u3002","title":"Hierarchical volume sampling"},{"location":"cv/papers/nerf/nerf/#loss-fn-and-train","text":"\u5bf9\u4e8e\u6bcf\u4e2a\u573a\u666f\uff0c\u9488\u5bf9\u5355\u72ec\u7684\u795e\u7ecf\u8fde\u7eed\u4f53\u79ef\u8868\u793a\u7f51\u7edc\u8fdb\u884c\u4f18\u5316\u3002\u9700\u8981\u573a\u666f\u7684 RGB \u56fe\u50cf\u6570\u636e\u96c6\u3001\u76f8\u5e94\u7684\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\uff0c\u4ee5\u53ca\u573a\u666f\u8fb9\u754c\uff08\u5bf9\u4e8e\u5408\u6210\u6570\u636e\uff0c\u4f7f\u7528\u771f\u5b9e\u7684\u76f8\u673a\u4f4d\u59ff\u3001\u5185\u53c2\u548c\u8fb9\u754c\uff0c\u5bf9\u4e8e\u771f\u5b9e\u6570\u636e\uff0c\u4f7f\u7528 COLMAP \u4f30\u8ba1\u8fd9\u4e9b\u53c2\u6570\uff09 \u6bcf\u6b21\u8fed\u4ee3\uff0c\u4ece\u6570\u636e\u96c6\u4e2d\u6240\u6709\u50cf\u7d20\u4e2d\u968f\u673a\u91c7\u6837\u4e00\u4e2a batch \u7684\u76f8\u673a\u5149\u7ebf\uff0c\u7136\u540e\u6839\u636e\u5206\u5c42\u91c7\u6837\u65b9\u6cd5\u4ece coarse \u7f51\u7edc\u67e5\u8be2 \\(N_c\\) \u4e2a\u6837\u672c\u548c\u4ece fine \u7f51\u7edc\u4e2d\u67e5\u8be2 \\(N_c + N_f\\) \u4e2a\u6602\u672c\uff0c\u518d\u6839\u636e\u4f53\u6e32\u67d3\u5f97\u5230\u6bcf\u6761\u5149\u7ebf\u7684\u989c\u8272 \u635f\u5931\u51fd\u6570\u4ec5\u4ec5\u662f coarse \u548c fine \u7684\u6e32\u67d3\u50cf\u7d20\u989c\u8272\u4e0e\u771f\u5b9e\u989c\u8272\u4e4b\u95f4\u7684\u603b\u5e73\u65b9\u5dee\u8bef\u5dee\uff0c\u540c\u65f6\u4f18\u5316 coarse \u548c fine \\[ \\mathcal{L} = \\sum_{r \\in R} \\left [ \\left \\| \\hat{C}_c(r) - C(r) \\right \\|_2^2 - \\left \\| \\hat{C}_f(r) - C(r) \\right \\|_2^2 \\right ] \\]","title":"Loss Fn and Train"},{"location":"cv/papers/nerf/nerf/#pipeline","text":"\u5df2\u77e5\u76f8\u673a\u5728\u4e0d\u540c\u7684\u4f4d\u7f6e\u62cd\u6444\u4e86\u4e00\u7ec4\u76ee\u6807\u573a\u666f\u7684\u7167\u7247\u3002\uff08\u5982\u679c\u4f60\u662f\u624b\u673a\u62cd\u6444\u7684\u4e00\u6bb5\u89c6\u9891\u53ef\u4ee5\u7528 colormap \u8f6c\uff09 \u4ece\u76f8\u673a\u4e2d\u5fc3\u5f00\u59cb\uff0c\u6cbf\u7740\u67d0\u4e2a\u50cf\u7d20\u65b9\u5411\u53d1\u5c04\u4e00\u6761\u5149\u7ebf\u3002(\u6ce8\u610f\uff1a\u8ddf\u771f\u5b9e\u7684\u76f8\u673a\u6210\u50cf\u6a21\u578b\u5149\u7ebf\u65b9\u5411\u662f\u76f8\u53cd\u7684\uff0c\u4f46\u4e0d\u5f71\u54cd)\u3002 \u5efa\u7acb\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc \\(F\\) \uff0c\u8f93\u5165 \\((x,y,z,\\theta,\\phi)\\) \u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u89c2\u5bdf\u65b9\u5411\uff0c\u8f93\u51fa \\(RGB,\\sigma\\) \u989c\u8272\u548c\u5bc6\u5ea6\u3002\u5c31\u80fd\u7b97\u51fa\u573a\u666f\u4e2d\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u3002 \u628a\u8fd9\u6761\u5149\u7ebf\u4e0a\u6240\u6709\u4f4d\u7f6e\u4e0a\u7684\u989c\u8272\u548c\u5bc6\u5ea6\u5408\u6210\uff0c\u5c31\u80fd\u7b97\u51fa\u56fe\u4e0a\u7684\u50cf\u7d20 RGB \u503c\u3002 \u6839\u636e\u8f93\u5165\u7684\u4e00\u7ec4\u56fe\u50cf\u4e0a\u7684\u50cf\u7d20 RGB \u503c\uff0c\u751f\u6210\u65e0\u6570\u6761\u5149\u7ebf\uff0c\u4e0d\u65ad\u53bb\u4f18\u5316\u53ef\u5fae\u51fd\u6570 \\(F\\) \u3002\u5f53\u4f18\u5316\u6b21\u6570\u8db3\u591f\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528 \\(F\\) \u7b97\u51fa\u6240\u6709\u89c6\u89d2\u4e0b\u56fe\u50cf\u7684\u50cf\u7d20 RGB \u503c\u3002 \u77e5\u9053\u6bcf\u4e2a\u4f4d\u7f6e\u7684\u989c\u8272\u548c\u5bc6\u5ea6\uff0c\u5c31\u7528 Marching Cubes \u7b97\u6cd5\u8f6c\u6362\u4e3a\u4e09\u89d2\u7f51\u4e09\u7ef4\u6a21\u578b\u3002\u5b8c\u6210\u4e09\u7ef4\u91cd\u5efa\u3002 \u6c42\u5f97 \\(F\\) \u5c31\u5b9e\u73b0\u4e86\u4e09\u7ef4\u91cd\u5efa\uff0c\u540e\u9762\u90fd\u662f\u5408\u6210\u65b0\u89c6\u89d2\u548c\u8f6c\u6362\u3002 \u57fa\u672c\u539f\u7406 \u4f5c\u8005\u9996\u5148\u628a\u91cd\u5efa\u8fc7\u7a0b \\(F\\) \u7528\u6df1\u5ea6\u5b66\u4e60\u4ee3\u66ff\uff0c \\(F(x,y,z,\\theta,\\phi)=RGB\\sigma\\) \u4ece\uff08\u7a7a\u95f4\u4f4d\u7f6e\u3001\u89c2\u5bdf\u65b9\u5411\uff09\u5230\uff08\u989c\u8272\u3001\u5bc6\u5ea6\uff09\u7684\u8fc7\u7a0b\u3002 \u4f5c\u8005\u5bf9\u5149\u7ebf\u6210\u50cf\u7684\u5149\u5b66\u6a21\u578b\u505a\u4e86\u5047\u8bbe\uff0c\u5efa\u7acb\u4e00\u4e2a\u6570\u5b66\u6a21\u578b\u3002 \u6839\u636e\u5149\u7ebf\u6210\u50cf\u4e0e\u8f93\u5165\u50cf\u7d20\u4e0d\u540c\u4e0d\u65ad\u4f18\u5316\uff0c\u8fdb\u800c\u4f18\u5316\u5f97\u51fa \\(F\\) \u3002 \u7b97\u6cd5\u7684\u5173\u952e\uff1a \u5149\u7ebf\u6210\u50cf\u6a21\u578b \u3002","title":"Pipeline"},{"location":"cv/papers/nerf/nerf/#experiment","text":"\u4e0b\u56fe\u662f Instant-NGP \u5b9e\u9a8c\uff1a","title":"Experiment"},{"location":"cv/papers/nerf/nerf/#reference","text":"nerf-learn NeRF\u5f00\u7bc7\u8bba\u6587\u89e3\u8bfb NeRF \u3010\u8f83\u771f\u7cfb\u5217\u3011\u8bb2\u4eba\u8bdd-NeRF\u5168\u89e3\uff08\u539f\u7406+\u4ee3\u7801+\u516c\u5f0f\uff09 https://cloud.baidu.com/article/2741971","title":"Reference"},{"location":"cv/papers/nerf/nice-slam/","text":"NICE-SLAM \u00b6 \u7ea6 1340 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract paper\uff1a NICE-SLAM: Neural Implicit Scalable Encoding for SLAM code\uff1a NICE-SLAM Idea \u00b6 Introduction \u00b6 Real-Time \u5927\u573a\u666f\u6709\u6548\uff0ciMAP \u6216 learning-based \u65b9\u6cd5\u505a\u4e0d\u5230 robust\uff0c\u5bf9 nosie \u548c\u672a\u89c2\u6d4b\u5230\u4f4d\u7f6e\u9c81\u68d2\uff0c\u5408\u7406\u9884\u6d4b \u6700\u5927\u7684\u521b\u65b0\u70b9\uff1a multilevel grid-based features\uff08\u57fa\u4e8e\u7f51\u683c\u7684\u591a\u5c42\u7279\u5f81\uff09 \uff0c\u5176\u4f59\u7684 idea \u5c31\u662f\u4f18\u5316\u65b9\u6cd5\uff0c\u5982\u4f55 mapping\u3001tracking\u3001\u5982\u4f55\u52a0\u901f\uff0c\u8054\u5408\u8bad\u7ec3+\u5206\u5c42\u8bad\u7ec3\uff0cnerf \u91c7\u6837\u65b9\u6cd5\u7b49\u7b49 \u91c7\u7528\u4e86\u4e09\u7ef4\u6805\u683c\u5730\u56fe\uff0c\u6bcf\u4e2a\u6805\u683c\u4fdd\u5b58\u5c40\u90e8\u7279\u5f81\uff0c\u7528 decoder \u5c06\u7279\u5f81\u89e3\u7801\u5373\u53ef\u6062\u590d\u51fa\u573a\u666f\uff0c\u56e0\u6b64\u5373\u4f7f\u573a\u666f\u9762\u79ef\u5f88\u5927\u4e5f\u4e0d\u5b58\u5728\u7f51\u7edc\u9057\u5fd8\u7684\u95ee\u9898 Hierarchical Scene Representation \u00b6 \u4e0a\u56fe\u4e2d\u7684\u53f3\u8fb9\u90e8\u5206\uff0c\u4ece\u5de6\u5411\u53f3\u770b\u5206\u522b\u662f MLP \u548c feature grid\uff1b \u4ece\u4e0a\u5f80\u4e0b\u770b\uff0c\u6709\u56db\u4e2a\u90e8\u5206\uff0c\u524d\u4e09\u90e8\u5206\u9884\u6d4b\u51e0\u4f55\u4fe1\u606f\uff0c\u7b2c\u56db\u90e8\u5206\u9884\u6d4b\u989c\u8272\uff1a coarse-level : \u4e3a\u63d0\u5347\u6548\u7387\uff0cgrid \u91c7\u6837\u5757\u5927\u4e14\u72ec\u7acb\u51fa\u6765\uff0c\u7528\u4e8e \u9884\u6d4b \uff08\u586b\u8865\u7a7a\u6d1e\uff0c\u4f8b\u5982\u5730\u677f\u5899\u9762\uff09 mid-level+fine-level : \u5148\u7ecf\u8fc7 mid-level \u9884\u6d4b\u51fa\u4e00\u4e2a\u5360\u7528\u7387 \\(o\\) \uff0c\u4f7f\u7528 fine-level \u9884\u6d4b\u51fa \\(\\Delta o\\) \uff0c\u4e24\u8005\u76f8\u52a0\u5f97\u5230\u6700\u7ec8\u5360\u7528\u7387\u3002\u4ece\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa fine-level \u7684\u8f93\u5165\u662f\u5c0f\u7f51\u683c\u3001\u5c0f\u5c0f\u7f51\u683c... color-level \uff1a\u4e0e\u524d\u4e09\u5c42\u4e0d\u540c\uff0c color-level \u7684 decoder \u548c encoder \u90fd\u5728\u66f4\u65b0\uff0c\u800c\u524d\u4e09\u5c42\u56fa\u5b9a\u4e86 MLP \u53ea\u66f4\u65b0\u7279\u5f81\u7f51\u7edc \uff0c\u8fd9\u6837\u6709\u52a9\u4e8e\u5927\u573a\u666f\u7684\u6784\u5efa\uff0cMLP \u4e0d\u4f1a\u88ab\u65b0\u7684\u7279\u5f81\u5f71\u54cd\u3002\u6b64\u5904\u7684 MLP \u662f CNN + MLP \u9884\u8bad\u7ec3\u540e\uff0c\u5355\u72ec\u53d6 MLP \u51fa\u6765\u83b7\u5f97\u3002\u56e0\u6b64 color-level \u5c31\u4f1a\u5b58\u5728\u989c\u8272\u88ab\u66f4\u65b0\u7684\u95ee\u9898\uff0c\u6784\u5efa\u5927\u573a\u666f\u65f6\u5c31\u4e0d\u80fd\u6709\u989c\u8272\u4fe1\u606f\u3002 Depth and Color Rendering \u00b6 \u501f\u9274 NeRF \u7684\u65b9\u6cd5\u83b7\u5f97 depth \u548c color \u5bf9\u4e8e\u4e00\u6761\u5149\u7ebf\uff0c\u4f7f\u7528\u5206\u5c42\u548c\u5747\u5300\u91c7\u6837\u4e00\u4e2a\u5f97\u5230 N \u4e2a\u70b9\uff0c\u5bf9\u4e8e\u8fd9 N \u4e2a\u70b9\u90fd\u4f30\u8ba1\u51fa\u4e00\u4e2a\u6743\u91cd \\(w_i\\) \uff08\u8868\u793a\u5149\u7ebf\u5230 i \u7ec8\u6b62\u7684\u6982\u7387\uff09\uff0c\u663e\u7136\u6982\u7387\u8d8a\u5927\uff0c\u8fd9\u4e00\u70b9\u8d8a\u5bb9\u6613\u662f\u7269\u4f53\u3002 coarse \u5c42 \u548c fine \u5c42\u7684\u6743\u91cd\uff1a \\[ w_i^c = o_{p_i}^0 \\prod_{j=1}^{i-1}(1-o_{p_j}^0) = o_{p_i} \\prod_{j=1}^{i-1}(1-o_{p_j}) \\] \u7531\u6743\u91cd\u53ef\u4ee5\u5f97\u5230\u6e32\u67d3\u540e\u7684\u6df1\u5ea6\u503c\u548c\u989c\u8272\u503c\uff1a \\[ \\hat{D}^c = \\sum_{i=1}^N w_i^c d_i, \\quad \\hat{D}^f = \\sum_{i=1}^N w_i^f d_i, \\quad \\hat{I} = \\sum_{i=1}^N w_i^f \\mathbf{c}_i \\] \u5176\u4e2d\uff0c \\(d_i\\) \u662f\u91c7\u6837\u70b9\u5230\u539f\u70b9\u7684\u8ddd\u79bb\u3002\u8fdb\u4e00\u6b65\u8fd8\u53ef\u4ee5\u6c42\u51fa\u6cbf\u5149\u7ebf\u65b9\u5411\u7684\u6df1\u5ea6\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}^c = \\sum_{i=1}^N w_i^c (\\hat{D}^c - d_i)^2 \\quad \\hat{D}_{var}^f = \\sum_{i=1}^N w_i^f (\\hat{D}^f - d_i)^2 \\] Mapping and Tracking \u00b6 \u4e3b\u8981\u57fa\u4e8e Hierarchical Scene Representation \u548c\u76f8\u673a\u4f4d\u59ff\u7684\u53c2\u6570 \\(\\theta\\) \u548c \\(\\omega\\) \u7684\u4f18\u5316\u3002\uff08\u635f\u5931\u51fd\u6570\uff09 Mapping \uff1a\u4f18\u5316 scene representation \u5efa\u56fe\u9636\u6bb5\u5305\u542b\u4e24\u4e2a loss \u51e0\u4f55 loss \\[ \\mathcal{L}_g^l=\\frac{1}{M}\\sum_{m=1}^M \\left | D_m - \\hat{D}_m^l \\right |, \\quad l\\in\\{c,f\\} \\] \u5149\u5ea6 loss \\[ \\mathcal{L}_p = \\frac{1}{M} \\sum_{m=1}^M \\left | I_m - \\hat{I}_m \\right | \\] \u901a\u8fc7\u4ece\u5f53\u524d\u5e27\u548c\u5173\u952e\u5e27\u4e2d\u5747\u5300\u91c7\u6837\u5171 M \u4e2a\u50cf\u7d20\uff0c\u6700\u5c0f\u5316 loss\u3002\u4f18\u5316\u987a\u5e8f\uff1a \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level feature grid \\(\\phi_\\theta^1\\) \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level \u548c fine-level feature grid \\(\\phi_\\theta^1\\) \u548c \\(\\phi_\\theta^2\\) \u4f7f\u7528 local bundle adjustment\uff08BA \u5c40\u90e8\u7ea6\u675f\u8c03\u6574\uff09\u8054\u5408\u4f18\u5316\u6240\u6709 level \u7684 grids\uff0ccolor decoder\uff0c\u76f8\u673a\u5916\u53c2 \\(\\{\\mathbf{R}_i, \\mathbf{t}_i\\}\\) \u5728\u7b2c K \u4e2a\u5173\u952e\u5e27\u5904\uff0c\u4f7f\u7528\u5982\u4e0b\uff1a \\[ \\min_{\\theta,\\omega,\\{\\mathbf{R}_i,\\mathbf{t}_i\\}}(\\mathcal{L}_g^c+\\mathcal{L}_g^f+\\lambda_p\\mathcal{L}_p) \\] \u4f5c\u8005\u89e3\u91ca\u8fd9\u4e48\u505a\u7684\u539f\u56e0 \u5916\u5206\u8fa8\u7387\u7684\u5916\u89c2\u548c fine-level \u90fd\u4f9d\u8d56\u4e8e mid-level \u6240\u4ee5\u5148\u4f18\u5316 mid \u80fd\u591f \u52a0\u5feb\u6536\u655b \u3002\u6b64\u5916\uff0c\u4f7f\u7528\u5e76\u884c\u4e09\u4e2a\u7ebf\u7a0b\u52a0\u901f\u4f18\u5316\u8fc7\u7a0b\uff1acoarse-level\uff0cmid+fine+color\uff0ctracking\uff08\u4e0b\u4e2a\u6b65\u9aa4\uff09\u3002 Tracking \uff1a\u4f18\u5316\u5f53\u524d\u5e27\u7684 camera poses\uff0c\u5373 \\(\\{R,t\\}\\) \u5728\u5f53\u524d\u5e27\u4e2d\u91c7\u6837 \\(M_t\\) \u4e2a\u50cf\u7d20\u70b9\u4f7f\u7528\u5982\u4e0b loss\uff1a \\[ \\min_{\\mathbf{R},\\mathbf{t}} (\\mathcal{L}_{g \\_ var}+\\lambda_{pt}\\mathcal{L}_{p}) \\] \u5176\u4e2d\uff0c\u5bf9\u51e0\u4f55\u635f\u5931\u505a\u4e86\u4fee\u6539\uff0c\u4fee\u6539 \\(\\mathcal{L}_{g \\_ var}\\) \u5982\u4e0b\uff1a \\[ \\mathcal{L}_{g \\_ var}=\\frac{1}{M_t}\\sum_{m=1}^{M_t}\\frac{\\left|D_m-\\hat{D}_m^c\\right|}{\\sqrt{\\hat{D}_{var}^c}}+\\frac{\\left|D_m-\\hat{D}_m^f\\right|}{\\sqrt{\\hat{D}_{var}^f}} \\] \u4f7f\u7528 \\(L_{g \\_ var}\\) \u7684\u597d\u5904 The modified loss down-weights less certain regions in the reconstructed geometry [46, 62], e.g., object edges. \u4fee\u6539\u540e\u7684 loss \u964d\u4f4e\u4e86\u91cd\u5efa\u573a\u666f\u4e2d\u4e0d\u786e\u5b9a\u533a\u57df\u7684\u6743\u91cd\u3002 Robustness to Dynamic Objects \uff1a\u5f53\u573a\u666f\u4e2d\u51fa\u73b0\u52a8\u6001\u7269\u4f53\u65f6\uff0cNICE-SLAM \u53ef\u4ee5\u901a\u8fc7\u8fc7\u6ee4\u50cf\u7d20\u70b9\u6765\u5ffd\u7565\u8fd9\u4e2a\u52a8\u6001\u7269\u4f53\uff0c\u56e0\u4e3a\u5728\u52a8\u6001\u7269\u4f53\u4e0a\u91c7\u6837\u5f97\u5230\u7684\u50cf\u7d20\u70b9 loss \u503c\u4f1a\u5f88\u5927\u3002\uff08\u8fd9\u4e00\u70b9\u53ef\u4ee5\u5229\u7528\u8d77\u6765\uff09 Keyframe Selection \u00b6 \u7c7b\u4f3c iMAP \u4e00\u6837\uff0c\u7ef4\u62a4\u4e00\u4e2a\u5168\u5c40\u7684\u5173\u952e\u5e27\uff0c\u57fa\u4e8e\u65b0\u589e\u4fe1\u606f\u6765\u6dfb\u52a0\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4f46\u4e0d\u540c\u7684\u662f\uff0c\u5305\u62ec \u7684\u5173\u952e\u5e27\u5f53\u4f18\u5316\u573a\u666f\u51e0\u4f55\u65f6\u9700\u8981\u4e0e\u5f53\u524d\u5e27\u6709\u89c6\u89c9\u91cd\u53e0\u3002 \u8fd9\u79cd\u9009\u62e9\u7b56\u7565\u4e0d\u4ec5\u786e\u4fdd\u5f53\u524d\u89c6\u56fe\u4e4b\u5916\u7684\u51e0\u4f55\u4fdd\u6301\u9759\u6001\uff0c\u800c\u4e14\u8fd8\u4f1a\u5bfc\u81f4\u975e\u5e38\u6709\u6548\u7684\u6700\u4f73\u5316\u95ee\u9898\uff0c\u56e0\u4e3a\u6bcf\u6b21\u53ea\u4f18\u5316\u5fc5\u8981\u7684\u53c2\u6570\u3002 \u5b9e\u9645\u4e0a\uff0c\u9996\u5148\u968f\u673a\u91c7\u6837\u50cf\u7d20\u5e76\u4f7f\u7528\u4f18\u5316\u7684\u76f8\u673a\u59ff\u52bf\u53cd\u5411\u6295\u5f71\u76f8\u5e94\u7684\u6df1\u5ea6\u3002\u7136\u540e\uff0c\u5c06\u70b9\u4e91\u6295\u5f71\u5230\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u5e27\u3002\u4ece\u90a3\u4e9b\u6709\u70b9\u6295\u5c04\u5230\u7684\u5173\u952e\u5e27\u4e2d\uff0c\u6211\u4eec\u968f\u673a\u9009\u62e9 K\u22122 \u5e27\u3002\u6b64\u5916\uff0c\u8fd8\u5728\u573a\u666f\u8868\u793a\u4f18\u5316\u4e2d\u5305\u62ec\u6700\u8fd1\u7684\u5173\u952e\u5e27\u548c\u5f53\u524d\u5e27\uff0c\u5f62\u6210 K \u4e2a\u6d3b\u52a8\u5e27\u7684\u603b\u6570\u3002 Experiments \u00b6 \u6570\u636e\u96c6\uff1aReplica\u3001ScanNet\u3001TUM RGB-D\u3001Co-Fusion Baseline\uff1aTSDF-Fusion\u3001DI-Fusion\u3001iMAP\u3001BAD\u2014SLAM\u3001Kintinuous\u3001ORB-SLAM2 Reference \u00b6 NICE-SLAM\u5b66\u4e60 NICE-SLAM: Neural Implicit Scalable Encoding for SLAM\u8bba\u6587\u9605\u8bfb\u8bb0\u5f55 NICE-SLAM \u4ee3\u7801\u7b80\u6790","title":"NICE-SLAM"},{"location":"cv/papers/nerf/nice-slam/#nice-slam","text":"\u7ea6 1340 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract paper\uff1a NICE-SLAM: Neural Implicit Scalable Encoding for SLAM code\uff1a NICE-SLAM","title":"NICE-SLAM"},{"location":"cv/papers/nerf/nice-slam/#idea","text":"","title":"Idea"},{"location":"cv/papers/nerf/nice-slam/#introduction","text":"Real-Time \u5927\u573a\u666f\u6709\u6548\uff0ciMAP \u6216 learning-based \u65b9\u6cd5\u505a\u4e0d\u5230 robust\uff0c\u5bf9 nosie \u548c\u672a\u89c2\u6d4b\u5230\u4f4d\u7f6e\u9c81\u68d2\uff0c\u5408\u7406\u9884\u6d4b \u6700\u5927\u7684\u521b\u65b0\u70b9\uff1a multilevel grid-based features\uff08\u57fa\u4e8e\u7f51\u683c\u7684\u591a\u5c42\u7279\u5f81\uff09 \uff0c\u5176\u4f59\u7684 idea \u5c31\u662f\u4f18\u5316\u65b9\u6cd5\uff0c\u5982\u4f55 mapping\u3001tracking\u3001\u5982\u4f55\u52a0\u901f\uff0c\u8054\u5408\u8bad\u7ec3+\u5206\u5c42\u8bad\u7ec3\uff0cnerf \u91c7\u6837\u65b9\u6cd5\u7b49\u7b49 \u91c7\u7528\u4e86\u4e09\u7ef4\u6805\u683c\u5730\u56fe\uff0c\u6bcf\u4e2a\u6805\u683c\u4fdd\u5b58\u5c40\u90e8\u7279\u5f81\uff0c\u7528 decoder \u5c06\u7279\u5f81\u89e3\u7801\u5373\u53ef\u6062\u590d\u51fa\u573a\u666f\uff0c\u56e0\u6b64\u5373\u4f7f\u573a\u666f\u9762\u79ef\u5f88\u5927\u4e5f\u4e0d\u5b58\u5728\u7f51\u7edc\u9057\u5fd8\u7684\u95ee\u9898","title":"Introduction"},{"location":"cv/papers/nerf/nice-slam/#hierarchical-scene-representation","text":"\u4e0a\u56fe\u4e2d\u7684\u53f3\u8fb9\u90e8\u5206\uff0c\u4ece\u5de6\u5411\u53f3\u770b\u5206\u522b\u662f MLP \u548c feature grid\uff1b \u4ece\u4e0a\u5f80\u4e0b\u770b\uff0c\u6709\u56db\u4e2a\u90e8\u5206\uff0c\u524d\u4e09\u90e8\u5206\u9884\u6d4b\u51e0\u4f55\u4fe1\u606f\uff0c\u7b2c\u56db\u90e8\u5206\u9884\u6d4b\u989c\u8272\uff1a coarse-level : \u4e3a\u63d0\u5347\u6548\u7387\uff0cgrid \u91c7\u6837\u5757\u5927\u4e14\u72ec\u7acb\u51fa\u6765\uff0c\u7528\u4e8e \u9884\u6d4b \uff08\u586b\u8865\u7a7a\u6d1e\uff0c\u4f8b\u5982\u5730\u677f\u5899\u9762\uff09 mid-level+fine-level : \u5148\u7ecf\u8fc7 mid-level \u9884\u6d4b\u51fa\u4e00\u4e2a\u5360\u7528\u7387 \\(o\\) \uff0c\u4f7f\u7528 fine-level \u9884\u6d4b\u51fa \\(\\Delta o\\) \uff0c\u4e24\u8005\u76f8\u52a0\u5f97\u5230\u6700\u7ec8\u5360\u7528\u7387\u3002\u4ece\u56fe\u4e2d\u53ef\u4ee5\u770b\u51fa fine-level \u7684\u8f93\u5165\u662f\u5c0f\u7f51\u683c\u3001\u5c0f\u5c0f\u7f51\u683c... color-level \uff1a\u4e0e\u524d\u4e09\u5c42\u4e0d\u540c\uff0c color-level \u7684 decoder \u548c encoder \u90fd\u5728\u66f4\u65b0\uff0c\u800c\u524d\u4e09\u5c42\u56fa\u5b9a\u4e86 MLP \u53ea\u66f4\u65b0\u7279\u5f81\u7f51\u7edc \uff0c\u8fd9\u6837\u6709\u52a9\u4e8e\u5927\u573a\u666f\u7684\u6784\u5efa\uff0cMLP \u4e0d\u4f1a\u88ab\u65b0\u7684\u7279\u5f81\u5f71\u54cd\u3002\u6b64\u5904\u7684 MLP \u662f CNN + MLP \u9884\u8bad\u7ec3\u540e\uff0c\u5355\u72ec\u53d6 MLP \u51fa\u6765\u83b7\u5f97\u3002\u56e0\u6b64 color-level \u5c31\u4f1a\u5b58\u5728\u989c\u8272\u88ab\u66f4\u65b0\u7684\u95ee\u9898\uff0c\u6784\u5efa\u5927\u573a\u666f\u65f6\u5c31\u4e0d\u80fd\u6709\u989c\u8272\u4fe1\u606f\u3002","title":"Hierarchical Scene Representation"},{"location":"cv/papers/nerf/nice-slam/#depth-and-color-rendering","text":"\u501f\u9274 NeRF \u7684\u65b9\u6cd5\u83b7\u5f97 depth \u548c color \u5bf9\u4e8e\u4e00\u6761\u5149\u7ebf\uff0c\u4f7f\u7528\u5206\u5c42\u548c\u5747\u5300\u91c7\u6837\u4e00\u4e2a\u5f97\u5230 N \u4e2a\u70b9\uff0c\u5bf9\u4e8e\u8fd9 N \u4e2a\u70b9\u90fd\u4f30\u8ba1\u51fa\u4e00\u4e2a\u6743\u91cd \\(w_i\\) \uff08\u8868\u793a\u5149\u7ebf\u5230 i \u7ec8\u6b62\u7684\u6982\u7387\uff09\uff0c\u663e\u7136\u6982\u7387\u8d8a\u5927\uff0c\u8fd9\u4e00\u70b9\u8d8a\u5bb9\u6613\u662f\u7269\u4f53\u3002 coarse \u5c42 \u548c fine \u5c42\u7684\u6743\u91cd\uff1a \\[ w_i^c = o_{p_i}^0 \\prod_{j=1}^{i-1}(1-o_{p_j}^0) = o_{p_i} \\prod_{j=1}^{i-1}(1-o_{p_j}) \\] \u7531\u6743\u91cd\u53ef\u4ee5\u5f97\u5230\u6e32\u67d3\u540e\u7684\u6df1\u5ea6\u503c\u548c\u989c\u8272\u503c\uff1a \\[ \\hat{D}^c = \\sum_{i=1}^N w_i^c d_i, \\quad \\hat{D}^f = \\sum_{i=1}^N w_i^f d_i, \\quad \\hat{I} = \\sum_{i=1}^N w_i^f \\mathbf{c}_i \\] \u5176\u4e2d\uff0c \\(d_i\\) \u662f\u91c7\u6837\u70b9\u5230\u539f\u70b9\u7684\u8ddd\u79bb\u3002\u8fdb\u4e00\u6b65\u8fd8\u53ef\u4ee5\u6c42\u51fa\u6cbf\u5149\u7ebf\u65b9\u5411\u7684\u6df1\u5ea6\u65b9\u5dee\uff1a \\[ \\hat{D}_{var}^c = \\sum_{i=1}^N w_i^c (\\hat{D}^c - d_i)^2 \\quad \\hat{D}_{var}^f = \\sum_{i=1}^N w_i^f (\\hat{D}^f - d_i)^2 \\]","title":"Depth and Color Rendering"},{"location":"cv/papers/nerf/nice-slam/#mapping-and-tracking","text":"\u4e3b\u8981\u57fa\u4e8e Hierarchical Scene Representation \u548c\u76f8\u673a\u4f4d\u59ff\u7684\u53c2\u6570 \\(\\theta\\) \u548c \\(\\omega\\) \u7684\u4f18\u5316\u3002\uff08\u635f\u5931\u51fd\u6570\uff09 Mapping \uff1a\u4f18\u5316 scene representation \u5efa\u56fe\u9636\u6bb5\u5305\u542b\u4e24\u4e2a loss \u51e0\u4f55 loss \\[ \\mathcal{L}_g^l=\\frac{1}{M}\\sum_{m=1}^M \\left | D_m - \\hat{D}_m^l \\right |, \\quad l\\in\\{c,f\\} \\] \u5149\u5ea6 loss \\[ \\mathcal{L}_p = \\frac{1}{M} \\sum_{m=1}^M \\left | I_m - \\hat{I}_m \\right | \\] \u901a\u8fc7\u4ece\u5f53\u524d\u5e27\u548c\u5173\u952e\u5e27\u4e2d\u5747\u5300\u91c7\u6837\u5171 M \u4e2a\u50cf\u7d20\uff0c\u6700\u5c0f\u5316 loss\u3002\u4f18\u5316\u987a\u5e8f\uff1a \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level feature grid \\(\\phi_\\theta^1\\) \u4f7f\u7528 \\(\\mathcal{L}_g^f\\) \u4f18\u5316 mid-level \u548c fine-level feature grid \\(\\phi_\\theta^1\\) \u548c \\(\\phi_\\theta^2\\) \u4f7f\u7528 local bundle adjustment\uff08BA \u5c40\u90e8\u7ea6\u675f\u8c03\u6574\uff09\u8054\u5408\u4f18\u5316\u6240\u6709 level \u7684 grids\uff0ccolor decoder\uff0c\u76f8\u673a\u5916\u53c2 \\(\\{\\mathbf{R}_i, \\mathbf{t}_i\\}\\) \u5728\u7b2c K \u4e2a\u5173\u952e\u5e27\u5904\uff0c\u4f7f\u7528\u5982\u4e0b\uff1a \\[ \\min_{\\theta,\\omega,\\{\\mathbf{R}_i,\\mathbf{t}_i\\}}(\\mathcal{L}_g^c+\\mathcal{L}_g^f+\\lambda_p\\mathcal{L}_p) \\] \u4f5c\u8005\u89e3\u91ca\u8fd9\u4e48\u505a\u7684\u539f\u56e0 \u5916\u5206\u8fa8\u7387\u7684\u5916\u89c2\u548c fine-level \u90fd\u4f9d\u8d56\u4e8e mid-level \u6240\u4ee5\u5148\u4f18\u5316 mid \u80fd\u591f \u52a0\u5feb\u6536\u655b \u3002\u6b64\u5916\uff0c\u4f7f\u7528\u5e76\u884c\u4e09\u4e2a\u7ebf\u7a0b\u52a0\u901f\u4f18\u5316\u8fc7\u7a0b\uff1acoarse-level\uff0cmid+fine+color\uff0ctracking\uff08\u4e0b\u4e2a\u6b65\u9aa4\uff09\u3002 Tracking \uff1a\u4f18\u5316\u5f53\u524d\u5e27\u7684 camera poses\uff0c\u5373 \\(\\{R,t\\}\\) \u5728\u5f53\u524d\u5e27\u4e2d\u91c7\u6837 \\(M_t\\) \u4e2a\u50cf\u7d20\u70b9\u4f7f\u7528\u5982\u4e0b loss\uff1a \\[ \\min_{\\mathbf{R},\\mathbf{t}} (\\mathcal{L}_{g \\_ var}+\\lambda_{pt}\\mathcal{L}_{p}) \\] \u5176\u4e2d\uff0c\u5bf9\u51e0\u4f55\u635f\u5931\u505a\u4e86\u4fee\u6539\uff0c\u4fee\u6539 \\(\\mathcal{L}_{g \\_ var}\\) \u5982\u4e0b\uff1a \\[ \\mathcal{L}_{g \\_ var}=\\frac{1}{M_t}\\sum_{m=1}^{M_t}\\frac{\\left|D_m-\\hat{D}_m^c\\right|}{\\sqrt{\\hat{D}_{var}^c}}+\\frac{\\left|D_m-\\hat{D}_m^f\\right|}{\\sqrt{\\hat{D}_{var}^f}} \\] \u4f7f\u7528 \\(L_{g \\_ var}\\) \u7684\u597d\u5904 The modified loss down-weights less certain regions in the reconstructed geometry [46, 62], e.g., object edges. \u4fee\u6539\u540e\u7684 loss \u964d\u4f4e\u4e86\u91cd\u5efa\u573a\u666f\u4e2d\u4e0d\u786e\u5b9a\u533a\u57df\u7684\u6743\u91cd\u3002 Robustness to Dynamic Objects \uff1a\u5f53\u573a\u666f\u4e2d\u51fa\u73b0\u52a8\u6001\u7269\u4f53\u65f6\uff0cNICE-SLAM \u53ef\u4ee5\u901a\u8fc7\u8fc7\u6ee4\u50cf\u7d20\u70b9\u6765\u5ffd\u7565\u8fd9\u4e2a\u52a8\u6001\u7269\u4f53\uff0c\u56e0\u4e3a\u5728\u52a8\u6001\u7269\u4f53\u4e0a\u91c7\u6837\u5f97\u5230\u7684\u50cf\u7d20\u70b9 loss \u503c\u4f1a\u5f88\u5927\u3002\uff08\u8fd9\u4e00\u70b9\u53ef\u4ee5\u5229\u7528\u8d77\u6765\uff09","title":"Mapping and Tracking"},{"location":"cv/papers/nerf/nice-slam/#keyframe-selection","text":"\u7c7b\u4f3c iMAP \u4e00\u6837\uff0c\u7ef4\u62a4\u4e00\u4e2a\u5168\u5c40\u7684\u5173\u952e\u5e27\uff0c\u57fa\u4e8e\u65b0\u589e\u4fe1\u606f\u6765\u6dfb\u52a0\u65b0\u7684\u5173\u952e\u5e27\uff0c\u4f46\u4e0d\u540c\u7684\u662f\uff0c\u5305\u62ec \u7684\u5173\u952e\u5e27\u5f53\u4f18\u5316\u573a\u666f\u51e0\u4f55\u65f6\u9700\u8981\u4e0e\u5f53\u524d\u5e27\u6709\u89c6\u89c9\u91cd\u53e0\u3002 \u8fd9\u79cd\u9009\u62e9\u7b56\u7565\u4e0d\u4ec5\u786e\u4fdd\u5f53\u524d\u89c6\u56fe\u4e4b\u5916\u7684\u51e0\u4f55\u4fdd\u6301\u9759\u6001\uff0c\u800c\u4e14\u8fd8\u4f1a\u5bfc\u81f4\u975e\u5e38\u6709\u6548\u7684\u6700\u4f73\u5316\u95ee\u9898\uff0c\u56e0\u4e3a\u6bcf\u6b21\u53ea\u4f18\u5316\u5fc5\u8981\u7684\u53c2\u6570\u3002 \u5b9e\u9645\u4e0a\uff0c\u9996\u5148\u968f\u673a\u91c7\u6837\u50cf\u7d20\u5e76\u4f7f\u7528\u4f18\u5316\u7684\u76f8\u673a\u59ff\u52bf\u53cd\u5411\u6295\u5f71\u76f8\u5e94\u7684\u6df1\u5ea6\u3002\u7136\u540e\uff0c\u5c06\u70b9\u4e91\u6295\u5f71\u5230\u5168\u5c40\u5173\u952e\u5e27\u5217\u8868\u4e2d\u7684\u6bcf\u4e2a\u5173\u952e\u5e27\u3002\u4ece\u90a3\u4e9b\u6709\u70b9\u6295\u5c04\u5230\u7684\u5173\u952e\u5e27\u4e2d\uff0c\u6211\u4eec\u968f\u673a\u9009\u62e9 K\u22122 \u5e27\u3002\u6b64\u5916\uff0c\u8fd8\u5728\u573a\u666f\u8868\u793a\u4f18\u5316\u4e2d\u5305\u62ec\u6700\u8fd1\u7684\u5173\u952e\u5e27\u548c\u5f53\u524d\u5e27\uff0c\u5f62\u6210 K \u4e2a\u6d3b\u52a8\u5e27\u7684\u603b\u6570\u3002","title":"Keyframe Selection"},{"location":"cv/papers/nerf/nice-slam/#experiments","text":"\u6570\u636e\u96c6\uff1aReplica\u3001ScanNet\u3001TUM RGB-D\u3001Co-Fusion Baseline\uff1aTSDF-Fusion\u3001DI-Fusion\u3001iMAP\u3001BAD\u2014SLAM\u3001Kintinuous\u3001ORB-SLAM2","title":"Experiments"},{"location":"cv/papers/nerf/nice-slam/#reference","text":"NICE-SLAM\u5b66\u4e60 NICE-SLAM: Neural Implicit Scalable Encoding for SLAM\u8bba\u6587\u9605\u8bfb\u8bb0\u5f55 NICE-SLAM \u4ee3\u7801\u7b80\u6790","title":"Reference"},{"location":"cv/papers/nerf/nid-slam/","text":"NID-SLAM \u00b6 \u7ea6 344 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a NID-SLAM: Neural Implicit Representation-based RGB-D SLAM In Dynamic Environments Idea \u00b6 \u795e\u7ecf\u9690\u5f0f SLAM + \u52a8\u6001\u73af\u5883 \u52a8\u6001\u7269\u4f53\u53bb\u9664 \uff1a \u6df1\u5ea6\u4fee\u6b63\uff1a\u8ba1\u7b97\u6df1\u5ea6\u56fe\u7684\u56fe\u50cf\u68af\u5ea6\uff0c\u5f53\u56fe\u50cf\u7684\u6c34\u5e73\u6216\u5782\u76f4\u68af\u5ea6\u8d85\u8fc7\u9608\u503c\u65f6\uff0c\u5c06\u68af\u5ea6\u65b9\u5411\u4e0a\u540e\u7eed\u50cf\u7d20\u70b9\u7684\u6df1\u5ea6\u7f6e\u4e3a 0 \u57fa\u4e8e\u6df1\u5ea6\u7684\u8bed\u4e49\u5206\u5272\uff1a\u91c7\u7528\u57fa\u4e8e\u8fb9\u754c\u6846\u7684\u7f51\u7edc\uff08YOLO\uff09\u8fdb\u884c\u8f93\u5165\u56fe\u50cf\u7684\u8bed\u4e49\u5206\u5272\uff0c\u8f93\u51fa\u4e3a\u6f5c\u5728\u52a8\u6001\u6216\u53ef\u79fb\u52a8\u7269\u4f53\u7684\u4e8c\u8fdb\u5236\u63a9\u7801 \u80cc\u666f\u4fee\u590d\uff1a\u4f7f\u7528\u4ee5\u524d\u7684\u89c6\u70b9\u83b7\u5f97\u7684\u9759\u6001\u4fe1\u606f\u4fee\u590d\u88ab\u906e\u6321\u7684\u80cc\u666f \u5173\u952e\u5e27\u9009\u62e9\u7b56\u7565 \uff1a\u4e24\u79cd\u9009\u62e9\u7b56\u7565 \u52a8\u6001\u7269\u4f53\u6bd4\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u8986\u76d6\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u8986\u76d6\u6700\u5927\u573a\u666f\u533a\u57df\u7684\u5e27\uff0c\u786e\u4fdd\u573a\u666f\u8fb9\u7f18\u533a\u57df\u7684\u5168\u9762\u4f18\u5316\uff09 \u5f53\u524d\u5e27\u4e0e\u524d\u4e00\u5173\u952e\u5e27\u91cd\u53e0\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u91cd\u53e0\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u4ece\u4e0e\u5f53\u524d\u5e27\u89c6\u89c9\u4e0a\u91cd\u53e0\u7684\u5173\u952e\u5e27\u968f\u673a\u9009\u62e9 \u4e24\u4e2a\u6bd4\u7387\u7684\u52a0\u6743\u548c\u5c0f\u4e8e\u9608\u503c\u5219\u63d2\u5165\u5173\u952e\u5e27\u96c6\u5408 \u9759\u6001\u573a\u666f\u9ed8\u8ba4\u4f7f\u7528\u91cd\u53e0\u7b56\u7565 \u4e3a\u907f\u514d\u8fc7\u5ea6\u5173\u6ce8\u8fb9\u7f18\u533a\u57df\u5e76\u53cd\u590d\u4f18\u5316\u76f8\u540c\u533a\u57df\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528\u57fa\u4e8e\u8986\u76d6\u7684\u7b56\u7565\u4f18\u5316\u6574\u4e2a\u573a\u666f\uff0c\u7136\u540e\u591a\u6b21\u4f7f\u7528\u57fa\u4e8e\u91cd\u53e0\u7684\u7b56\u7565\uff0c\u91cd\u590d\u591a\u6b21 \u573a\u666f\u8868\u793a\u548c\u56fe\u5f62\u6e32\u67d3 Experiments \u00b6","title":"NID-SLAM"},{"location":"cv/papers/nerf/nid-slam/#nid-slam","text":"\u7ea6 344 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a NID-SLAM: Neural Implicit Representation-based RGB-D SLAM In Dynamic Environments","title":"NID-SLAM"},{"location":"cv/papers/nerf/nid-slam/#idea","text":"\u795e\u7ecf\u9690\u5f0f SLAM + \u52a8\u6001\u73af\u5883 \u52a8\u6001\u7269\u4f53\u53bb\u9664 \uff1a \u6df1\u5ea6\u4fee\u6b63\uff1a\u8ba1\u7b97\u6df1\u5ea6\u56fe\u7684\u56fe\u50cf\u68af\u5ea6\uff0c\u5f53\u56fe\u50cf\u7684\u6c34\u5e73\u6216\u5782\u76f4\u68af\u5ea6\u8d85\u8fc7\u9608\u503c\u65f6\uff0c\u5c06\u68af\u5ea6\u65b9\u5411\u4e0a\u540e\u7eed\u50cf\u7d20\u70b9\u7684\u6df1\u5ea6\u7f6e\u4e3a 0 \u57fa\u4e8e\u6df1\u5ea6\u7684\u8bed\u4e49\u5206\u5272\uff1a\u91c7\u7528\u57fa\u4e8e\u8fb9\u754c\u6846\u7684\u7f51\u7edc\uff08YOLO\uff09\u8fdb\u884c\u8f93\u5165\u56fe\u50cf\u7684\u8bed\u4e49\u5206\u5272\uff0c\u8f93\u51fa\u4e3a\u6f5c\u5728\u52a8\u6001\u6216\u53ef\u79fb\u52a8\u7269\u4f53\u7684\u4e8c\u8fdb\u5236\u63a9\u7801 \u80cc\u666f\u4fee\u590d\uff1a\u4f7f\u7528\u4ee5\u524d\u7684\u89c6\u70b9\u83b7\u5f97\u7684\u9759\u6001\u4fe1\u606f\u4fee\u590d\u88ab\u906e\u6321\u7684\u80cc\u666f \u5173\u952e\u5e27\u9009\u62e9\u7b56\u7565 \uff1a\u4e24\u79cd\u9009\u62e9\u7b56\u7565 \u52a8\u6001\u7269\u4f53\u6bd4\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u8986\u76d6\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u8986\u76d6\u6700\u5927\u573a\u666f\u533a\u57df\u7684\u5e27\uff0c\u786e\u4fdd\u573a\u666f\u8fb9\u7f18\u533a\u57df\u7684\u5168\u9762\u4f18\u5316\uff09 \u5f53\u524d\u5e27\u4e0e\u524d\u4e00\u5173\u952e\u5e27\u91cd\u53e0\u7387\u8f83\u4f4e\u7684\u5e27\uff08\u91cd\u53e0\u7b56\u7565\uff09\uff1a\u503e\u5411\u4e8e\u4ece\u4e0e\u5f53\u524d\u5e27\u89c6\u89c9\u4e0a\u91cd\u53e0\u7684\u5173\u952e\u5e27\u968f\u673a\u9009\u62e9 \u4e24\u4e2a\u6bd4\u7387\u7684\u52a0\u6743\u548c\u5c0f\u4e8e\u9608\u503c\u5219\u63d2\u5165\u5173\u952e\u5e27\u96c6\u5408 \u9759\u6001\u573a\u666f\u9ed8\u8ba4\u4f7f\u7528\u91cd\u53e0\u7b56\u7565 \u4e3a\u907f\u514d\u8fc7\u5ea6\u5173\u6ce8\u8fb9\u7f18\u533a\u57df\u5e76\u53cd\u590d\u4f18\u5316\u76f8\u540c\u533a\u57df\uff0c\u6211\u4eec\u9996\u5148\u4f7f\u7528\u57fa\u4e8e\u8986\u76d6\u7684\u7b56\u7565\u4f18\u5316\u6574\u4e2a\u573a\u666f\uff0c\u7136\u540e\u591a\u6b21\u4f7f\u7528\u57fa\u4e8e\u91cd\u53e0\u7684\u7b56\u7565\uff0c\u91cd\u590d\u591a\u6b21 \u573a\u666f\u8868\u793a\u548c\u56fe\u5f62\u6e32\u67d3","title":"Idea"},{"location":"cv/papers/nerf/nid-slam/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/others/","text":"Others \u00b6 Abstract \u5176\u4ed6 Table of Contents \u00b6 SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation","title":"Others"},{"location":"cv/papers/others/#others","text":"Abstract \u5176\u4ed6","title":"Others"},{"location":"cv/papers/others/#table-of-contents","text":"SLAM 14 \u8bb2 ORB-SLAM2 LET-NET DeepV2D EndoscopyDepthEstimation","title":"Table of Contents"},{"location":"cv/papers/others/deepv2d/","text":"DeepV2D \u00b6 \u7ea6 408 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DeepV2D: Video to Depth with Differentiable Structure from Motion code\uff1a DeepV2D Idea \u00b6 \u901a\u8fc7\u89c6\u9891\u5e8f\u5217\u9884\u6d4b\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\uff0c\u5206\u4e3a\u4e24\u6a21\u5757\uff1a \u6df1\u5ea6\u6a21\u5757 \u548c \u8fd0\u52a8\u6a21\u5757 \uff1b \u6df1\u5ea6\u6a21\u5757\u5c06\u76f8\u673a\u8fd0\u52a8\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u66f4\u65b0\u7684\u6df1\u5ea6\u9884\u6d4b\uff1b\u8fd0\u52a8\u6a21\u5757\u5c06\u6df1\u5ea6\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u8fd0\u52a8\u77eb\u6b63\u9879\uff1b \u6df1\u5ea6\u6a21\u5757\uff1a 2D \u7279\u5f81\u63d0\u53d6 \uff1a\u63d0\u53d6\u4ece\u8f93\u5165\u56fe\u7247\u5b66\u4e60\u5230\u7684\u7279\u5f81\uff1b \u53cd\u6295\u5f71\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570 \uff1a\u8bbe\u8ba1\u4e00\u79cd\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff0c\u5c06 \\(I_1\\) \u4f5c\u4e3a\u5173\u952e\u5e27\uff0c\u5176\u4f59 \\(I_{2,...,n}\\) \u5e27\u88ab\u7528\u4e8e\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff1b 3D \u7acb\u4f53\u5339\u914d \uff1a \\(N-1\\) \u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\u7684\u96c6\u5408\u9996\u5148\u901a\u8fc7 3D \u5377\u79ef\u5c42\u540e\u518d\u8fdb\u884c\u7acb\u4f53\u5339\u914d\uff0c\u7136\u540e\u901a\u8fc7\u5e73\u5747 \\(N-1\\) \u4e2a\u5bb9\u91cf\u51fd\u6570\u6765\u6267\u884c\u89c6\u56fe\u6c60\u5316\uff0c\u805a\u5408\u5e27\u7684\u4fe1\u606f\uff1b \u8fd0\u52a8\u6a21\u5757\uff1a \u521d\u59cb\u5316 \uff1a\u4f7f\u7528\u4e00\u4e2a\u7f51\u7edc\u9884\u6d4b\u521d\u59cb\u59ff\u6001\u4f30\u8ba1\uff0c\u9009\u62e9\u4e00\u5e27\u4f5c\u4e3a\u5173\u952e\u5e27\u3002\u901a\u8fc7\u5c06\u5173\u952e\u5e27\u59ff\u6001\u8bbe\u7f6e\u4e3a\u5355\u4f4d\u77e9\u9635\u6765\u521d\u59cb\u5316\u59ff\u6001\uff0c\u7136\u540e\u9884\u6d4b\u5173\u952e\u5e27\u4e0e\u89c6\u9891\u4e2d\u6bcf\u4e2a\u5176\u4ed6\u5e27\u4e4b\u95f4\u7684\u76f8\u5bf9\u8fd0\u52a8\uff1b \u7279\u5f81\u63d0\u53d6 \uff1a\u7279\u5f81\u63d0\u53d6\u5668\u5c06\u6bcf\u4e00\u5e27\u6620\u5c04\u5230\u4e00\u4e2a\u5bc6\u96c6\u7684\u7279\u5f81\u6620\u5c04\uff0c\u6743\u91cd\u5728\u6240\u6709\u5e27\u4e4b\u95f4\u5171\u4eab\uff1b \u8bef\u5dee\u9879 \u4f18\u5316\u76ee\u6807 \u5168\u5c40\u59ff\u6001\u4f18\u5316 \u5173\u952e\u5e27\u59ff\u6001\u4f18\u5316 LS-\u4f18\u5316\u5c42 \u603b\u7cfb\u7edf\uff1a\u91c7\u7528\u4e24\u79cd\u521d\u59cb\u5316\u7b56\u7565\uff0c\u81ea\u521d\u59cb\u5316\u4f7f\u7528\u6052\u5b9a\u6df1\u5ea6\u56fe\u521d\u59cb\u5316DeepV2D\uff1b\u5355\u5e45\u56fe\u50cf\u521d\u59cb\u5316\u4f7f\u7528\u5355\u5e45\u56fe\u50cf\u6df1\u5ea6\u7f51\u7edc\u7684\u8f93\u51fa\u8fdb\u884c\u521d\u59cb\u5316\uff1b \u76d1\u7763\u635f\u5931\u51fd\u6570\uff1a \u6df1\u5ea6\u76d1\u7763 \u8fd0\u52a8\u76d1\u7763 \u603b\u635f\u5931 Experiments \u00b6","title":"DeepV2D"},{"location":"cv/papers/others/deepv2d/#deepv2d","text":"\u7ea6 408 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a DeepV2D: Video to Depth with Differentiable Structure from Motion code\uff1a DeepV2D","title":"DeepV2D"},{"location":"cv/papers/others/deepv2d/#idea","text":"\u901a\u8fc7\u89c6\u9891\u5e8f\u5217\u9884\u6d4b\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\uff0c\u5206\u4e3a\u4e24\u6a21\u5757\uff1a \u6df1\u5ea6\u6a21\u5757 \u548c \u8fd0\u52a8\u6a21\u5757 \uff1b \u6df1\u5ea6\u6a21\u5757\u5c06\u76f8\u673a\u8fd0\u52a8\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u66f4\u65b0\u7684\u6df1\u5ea6\u9884\u6d4b\uff1b\u8fd0\u52a8\u6a21\u5757\u5c06\u6df1\u5ea6\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u8fd0\u52a8\u77eb\u6b63\u9879\uff1b \u6df1\u5ea6\u6a21\u5757\uff1a 2D \u7279\u5f81\u63d0\u53d6 \uff1a\u63d0\u53d6\u4ece\u8f93\u5165\u56fe\u7247\u5b66\u4e60\u5230\u7684\u7279\u5f81\uff1b \u53cd\u6295\u5f71\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570 \uff1a\u8bbe\u8ba1\u4e00\u79cd\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff0c\u5c06 \\(I_1\\) \u4f5c\u4e3a\u5173\u952e\u5e27\uff0c\u5176\u4f59 \\(I_{2,...,n}\\) \u5e27\u88ab\u7528\u4e8e\u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\uff1b 3D \u7acb\u4f53\u5339\u914d \uff1a \\(N-1\\) \u4ee3\u4ef7\u5bb9\u91cf\u51fd\u6570\u7684\u96c6\u5408\u9996\u5148\u901a\u8fc7 3D \u5377\u79ef\u5c42\u540e\u518d\u8fdb\u884c\u7acb\u4f53\u5339\u914d\uff0c\u7136\u540e\u901a\u8fc7\u5e73\u5747 \\(N-1\\) \u4e2a\u5bb9\u91cf\u51fd\u6570\u6765\u6267\u884c\u89c6\u56fe\u6c60\u5316\uff0c\u805a\u5408\u5e27\u7684\u4fe1\u606f\uff1b \u8fd0\u52a8\u6a21\u5757\uff1a \u521d\u59cb\u5316 \uff1a\u4f7f\u7528\u4e00\u4e2a\u7f51\u7edc\u9884\u6d4b\u521d\u59cb\u59ff\u6001\u4f30\u8ba1\uff0c\u9009\u62e9\u4e00\u5e27\u4f5c\u4e3a\u5173\u952e\u5e27\u3002\u901a\u8fc7\u5c06\u5173\u952e\u5e27\u59ff\u6001\u8bbe\u7f6e\u4e3a\u5355\u4f4d\u77e9\u9635\u6765\u521d\u59cb\u5316\u59ff\u6001\uff0c\u7136\u540e\u9884\u6d4b\u5173\u952e\u5e27\u4e0e\u89c6\u9891\u4e2d\u6bcf\u4e2a\u5176\u4ed6\u5e27\u4e4b\u95f4\u7684\u76f8\u5bf9\u8fd0\u52a8\uff1b \u7279\u5f81\u63d0\u53d6 \uff1a\u7279\u5f81\u63d0\u53d6\u5668\u5c06\u6bcf\u4e00\u5e27\u6620\u5c04\u5230\u4e00\u4e2a\u5bc6\u96c6\u7684\u7279\u5f81\u6620\u5c04\uff0c\u6743\u91cd\u5728\u6240\u6709\u5e27\u4e4b\u95f4\u5171\u4eab\uff1b \u8bef\u5dee\u9879 \u4f18\u5316\u76ee\u6807 \u5168\u5c40\u59ff\u6001\u4f18\u5316 \u5173\u952e\u5e27\u59ff\u6001\u4f18\u5316 LS-\u4f18\u5316\u5c42 \u603b\u7cfb\u7edf\uff1a\u91c7\u7528\u4e24\u79cd\u521d\u59cb\u5316\u7b56\u7565\uff0c\u81ea\u521d\u59cb\u5316\u4f7f\u7528\u6052\u5b9a\u6df1\u5ea6\u56fe\u521d\u59cb\u5316DeepV2D\uff1b\u5355\u5e45\u56fe\u50cf\u521d\u59cb\u5316\u4f7f\u7528\u5355\u5e45\u56fe\u50cf\u6df1\u5ea6\u7f51\u7edc\u7684\u8f93\u51fa\u8fdb\u884c\u521d\u59cb\u5316\uff1b \u76d1\u7763\u635f\u5931\u51fd\u6570\uff1a \u6df1\u5ea6\u76d1\u7763 \u8fd0\u52a8\u76d1\u7763 \u603b\u635f\u5931","title":"Idea"},{"location":"cv/papers/others/deepv2d/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/others/endoscopy-depth-estimation/","text":"EndoscopyDepthEstimation \u00b6 \u7ea6 671 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Dense Depth Estimation in Monocular Endoscopy with Self-supervised Learning Methods code\uff1a EndoscopyDepthEstimation-Pytorch Idea \u00b6 Training Data\uff1a\u4f7f\u7528\u7684\u6570\u636e\u96c6\u662f\u65e0\u6807\u6ce8\u7684\u5185\u7aa5\u955c\u89c6\u9891 Data Preprocessing \uff1a\u9996\u5148\u4f7f\u7528 SfM \u8fdb\u884c\u7a00\u758f\u91cd\u5efa\u3001\u4f30\u8ba1\u76f8\u673a\u4f4d\u59ff\u548c\u53ef\u89c1\u70b9\uff0c\u751f\u6210\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u3002 Sparse Depth Map \uff1a\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u6a21\u5757\uff0c\u4ec5\u9884\u6d4b\u5230\u5168\u5c40\u8303\u56f4\u5185\u7684\u6df1\u5ea6\u3002\u4e3a\u4e86\u5b9e\u73b0\u6709\u6548\u7684\u635f\u5931\u8ba1\u7b97\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c4\u6a21\u548c SfM \u7ed3\u679c\u5fc5\u987b\u5339\u914d\u3002 Sparse Soft Mask \uff1a\u7a00\u758f\u63a9\u7801\u80fd\u5229\u7528\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u4e2d\u6709\u6548\u7a00\u758f\u4fe1\u53f7\uff0c\u5e76\u5ffd\u7565\u5176\u4f59\u65e0\u6548\u533a\u57df\u3002\u4f7f\u7528\u7684\u662f SFL\u3002 Network Architecture\uff1a\u67b6\u6784\u5982\u4e0b\u56fe\u3002\u4f9d\u9760\u6765\u81eaSfM\u7684\u7a00\u758f\u4fe1\u53f7\u548c\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u6765\u5b66\u4e60\u4ece\u5355\u4e2a\u5185\u7aa5\u955c\u89c6\u9891\u5e27\u9884\u6d4b\u5bc6\u96c6\u6df1\u5ea6\u56fe\uff0c\u5728\u5e94\u7528\u9636\u6bb5\uff0c\u8be5\u7f51\u7edc\u5177\u6709\u4ece\u5355\u4e2a\u5e27\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\u7684\u7b80\u5355\u5355\u5206\u652f\u67b6\u6784\uff0c\u4e0b\u9762\u7684\u6240\u6709\u81ea\u5b9a\u4e49\u5c42\u90fd\u662f\u53ef\u5fae\u5206\u7684\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u4ee5\u7aef\u5230\u7aef\u7684\u65b9\u5f0f\u8fdb\u884c\u8bad\u7ec3\u3002 Monocular Depth Estimation \uff1a\u4f7f\u7528 DenseNet \u7684\u4fee\u6539\u7248\u672c\uff0c\u5c06\u6700\u540e\u4e00\u4e2a\u5377\u79ef\u5c42\u7684\u901a\u9053\u6570\u66f4\u6539\u4e3a1\uff0c\u5e76\u7528\u7ebf\u6027\u6fc0\u6d3b\u66ff\u6362\u6700\u7ec8\u6fc0\u6d3b\uff0c\u5373 log-softmax\u3002\u8fd8\u5c06\u7f51\u7edc\u4e0a\u8fc7\u5ea6\u90e8\u5206\u4e2d\u7684\u8f6c\u7f6e\u5377\u79ef\u5c42\u66ff\u6362\u4e3a\u6700\u8fd1\u90bb\u4e0a\u91c7\u6837\u548c\u5377\u79ef\u5c42\u3002 Depth Scaling Layer \uff1a\u8be5\u5c42\u4e0e\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u7684\u6df1\u5ea6\u9884\u6d4b\u89c4\u6a21\u548c\u76f8\u5e94\u7684 SfM \u7ed3\u679c\u76f8\u5339\u914d\uff0c\u4ee5\u8fdb\u884c\u6b63\u786e\u7684\u635f\u5931\u8ba1\u7b97\u3002 Flow from Depth Layer \uff1a\u4e3a\u4e86\u4f7f\u7528 SfM \u7ed3\u679c\u751f\u6210\u7684\u7a00\u758f\u6d41\u56fe\u6765\u8fdb\u884c\u540e\u9762\u63cf\u8ff0\u7684 SFL \u7f51\u7edc\u8bad\u7ec3\uff0c\u9996\u5148\u9700\u8981\u5c06\u7f29\u653e\u7684\u6df1\u5ea6\u56fe\u8f6c\u6362\u4e3a\u5177\u6709\u76f8\u5bf9\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\u7684\u7a20\u5bc6\u6d41\u56fe\uff08\u501f\u9274\u4f7f\u7528\u751f\u6210\u7684\u7a20\u5bc6\u6d41\u56fe\u4f5c\u4e3a\u5149\u6d41\u4f30\u8ba1\u7f51\u7edc\u7684\u8f93\u5165\uff09\u3002\u7a20\u5bc6\u6d41\u56fe\u7684\u672c\u8d28\u4e0a\u662f\u63cf\u8ff0 3D \u70b9\u53d8\u4e3a\u5230 2D \u70b9\u7684\u8f6c\u6362\u3002 Depth Warping Layer \uff1a\u7a00\u758f\u6d41\u56fe\u4e3b\u8981\u4e3a\u6765\u81ea SfM \u7684\u7a00\u758f\u4fe1\u606f\u6295\u5c04\u5230\u5e27\u7684\u533a\u57df\u8fdb\u884c\uff0c\u9274\u4e8e\u5927\u591a\u6570\u5e27\u53ea\u6709\u4e00\u5c0f\u90e8\u5206\u50cf\u7d20\u7684\u503c\u5728\u7a00\u758f\u6d41\u56fe\u4e2d\u6709\u6548\uff0c\u5927\u591a\u6570\u533a\u57df\u4ecd\u7136\u6ca1\u6709\u5f97\u5230\u9002\u5f53\u7684\u5f15\u5bfc\u3002\u901a\u8fc7\u76f8\u673a\u8fd0\u52a8\u548c\u76f8\u673a\u5185\u53c2\uff0c\u53ef\u4ee5\u901a\u8fc7\u52a0\u5f3a\u4e24\u4e2a\u76f8\u5e94\u6df1\u5ea6\u9884\u6d4b\u4e4b\u95f4\u7684\u4e00\u81f4\u6027\u6765\u5229\u7528\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u3002\u76f4\u89c9\u662f\uff0c\u4ece\u4e24\u4e2a\u76f8\u90bb\u5e27\u5206\u522b\u9884\u6d4b\u7684\u5bc6\u96c6\u6df1\u5ea6\u56fe\u662f\u76f8\u5173\u7684\uff0c\u56e0\u4e3a\u89c2\u5bdf\u5230\u7684\u533a\u57df\u4e4b\u95f4\u5b58\u5728\u91cd\u53e0\u3002\u4e3a\u4e86\u4f7f\u540e\u9762\u63cf\u8ff0\u7684\u6df1\u5ea6\u4e00\u81f4\u6027\u635f\u5931\u4e2d\u5f3a\u5236\u6267\u884c\u7684\u51e0\u4f55\u7ea6\u675f\u53ef\u5fae\u5206\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c2\u70b9\u5fc5\u987b\u9996\u5148\u5bf9\u9f50\u3002 Loss Functions Sparse Flow Loss (SFL) Depth Consistency Loss (DCL) Experiments \u00b6","title":"EndoscopyDepthEstimation"},{"location":"cv/papers/others/endoscopy-depth-estimation/#endoscopydepthestimation","text":"\u7ea6 671 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract paper\uff1a Dense Depth Estimation in Monocular Endoscopy with Self-supervised Learning Methods code\uff1a EndoscopyDepthEstimation-Pytorch","title":"EndoscopyDepthEstimation"},{"location":"cv/papers/others/endoscopy-depth-estimation/#idea","text":"Training Data\uff1a\u4f7f\u7528\u7684\u6570\u636e\u96c6\u662f\u65e0\u6807\u6ce8\u7684\u5185\u7aa5\u955c\u89c6\u9891 Data Preprocessing \uff1a\u9996\u5148\u4f7f\u7528 SfM \u8fdb\u884c\u7a00\u758f\u91cd\u5efa\u3001\u4f30\u8ba1\u76f8\u673a\u4f4d\u59ff\u548c\u53ef\u89c1\u70b9\uff0c\u751f\u6210\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u3002 Sparse Depth Map \uff1a\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u6a21\u5757\uff0c\u4ec5\u9884\u6d4b\u5230\u5168\u5c40\u8303\u56f4\u5185\u7684\u6df1\u5ea6\u3002\u4e3a\u4e86\u5b9e\u73b0\u6709\u6548\u7684\u635f\u5931\u8ba1\u7b97\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c4\u6a21\u548c SfM \u7ed3\u679c\u5fc5\u987b\u5339\u914d\u3002 Sparse Soft Mask \uff1a\u7a00\u758f\u63a9\u7801\u80fd\u5229\u7528\u7a00\u758f\u5f62\u5f0f\u6570\u636e\u4e2d\u6709\u6548\u7a00\u758f\u4fe1\u53f7\uff0c\u5e76\u5ffd\u7565\u5176\u4f59\u65e0\u6548\u533a\u57df\u3002\u4f7f\u7528\u7684\u662f SFL\u3002 Network Architecture\uff1a\u67b6\u6784\u5982\u4e0b\u56fe\u3002\u4f9d\u9760\u6765\u81eaSfM\u7684\u7a00\u758f\u4fe1\u53f7\u548c\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u6765\u5b66\u4e60\u4ece\u5355\u4e2a\u5185\u7aa5\u955c\u89c6\u9891\u5e27\u9884\u6d4b\u5bc6\u96c6\u6df1\u5ea6\u56fe\uff0c\u5728\u5e94\u7528\u9636\u6bb5\uff0c\u8be5\u7f51\u7edc\u5177\u6709\u4ece\u5355\u4e2a\u5e27\u8fdb\u884c\u6df1\u5ea6\u4f30\u8ba1\u7684\u7b80\u5355\u5355\u5206\u652f\u67b6\u6784\uff0c\u4e0b\u9762\u7684\u6240\u6709\u81ea\u5b9a\u4e49\u5c42\u90fd\u662f\u53ef\u5fae\u5206\u7684\uff0c\u4ee5\u4fbf\u7f51\u7edc\u53ef\u4ee5\u4ee5\u7aef\u5230\u7aef\u7684\u65b9\u5f0f\u8fdb\u884c\u8bad\u7ec3\u3002 Monocular Depth Estimation \uff1a\u4f7f\u7528 DenseNet \u7684\u4fee\u6539\u7248\u672c\uff0c\u5c06\u6700\u540e\u4e00\u4e2a\u5377\u79ef\u5c42\u7684\u901a\u9053\u6570\u66f4\u6539\u4e3a1\uff0c\u5e76\u7528\u7ebf\u6027\u6fc0\u6d3b\u66ff\u6362\u6700\u7ec8\u6fc0\u6d3b\uff0c\u5373 log-softmax\u3002\u8fd8\u5c06\u7f51\u7edc\u4e0a\u8fc7\u5ea6\u90e8\u5206\u4e2d\u7684\u8f6c\u7f6e\u5377\u79ef\u5c42\u66ff\u6362\u4e3a\u6700\u8fd1\u90bb\u4e0a\u91c7\u6837\u548c\u5377\u79ef\u5c42\u3002 Depth Scaling Layer \uff1a\u8be5\u5c42\u4e0e\u5355\u76ee\u6df1\u5ea6\u4f30\u8ba1\u7684\u6df1\u5ea6\u9884\u6d4b\u89c4\u6a21\u548c\u76f8\u5e94\u7684 SfM \u7ed3\u679c\u76f8\u5339\u914d\uff0c\u4ee5\u8fdb\u884c\u6b63\u786e\u7684\u635f\u5931\u8ba1\u7b97\u3002 Flow from Depth Layer \uff1a\u4e3a\u4e86\u4f7f\u7528 SfM \u7ed3\u679c\u751f\u6210\u7684\u7a00\u758f\u6d41\u56fe\u6765\u8fdb\u884c\u540e\u9762\u63cf\u8ff0\u7684 SFL \u7f51\u7edc\u8bad\u7ec3\uff0c\u9996\u5148\u9700\u8981\u5c06\u7f29\u653e\u7684\u6df1\u5ea6\u56fe\u8f6c\u6362\u4e3a\u5177\u6709\u76f8\u5bf9\u76f8\u673a\u4f4d\u59ff\u548c\u5185\u53c2\u7684\u7a20\u5bc6\u6d41\u56fe\uff08\u501f\u9274\u4f7f\u7528\u751f\u6210\u7684\u7a20\u5bc6\u6d41\u56fe\u4f5c\u4e3a\u5149\u6d41\u4f30\u8ba1\u7f51\u7edc\u7684\u8f93\u5165\uff09\u3002\u7a20\u5bc6\u6d41\u56fe\u7684\u672c\u8d28\u4e0a\u662f\u63cf\u8ff0 3D \u70b9\u53d8\u4e3a\u5230 2D \u70b9\u7684\u8f6c\u6362\u3002 Depth Warping Layer \uff1a\u7a00\u758f\u6d41\u56fe\u4e3b\u8981\u4e3a\u6765\u81ea SfM \u7684\u7a00\u758f\u4fe1\u606f\u6295\u5c04\u5230\u5e27\u7684\u533a\u57df\u8fdb\u884c\uff0c\u9274\u4e8e\u5927\u591a\u6570\u5e27\u53ea\u6709\u4e00\u5c0f\u90e8\u5206\u50cf\u7d20\u7684\u503c\u5728\u7a00\u758f\u6d41\u56fe\u4e2d\u6709\u6548\uff0c\u5927\u591a\u6570\u533a\u57df\u4ecd\u7136\u6ca1\u6709\u5f97\u5230\u9002\u5f53\u7684\u5f15\u5bfc\u3002\u901a\u8fc7\u76f8\u673a\u8fd0\u52a8\u548c\u76f8\u673a\u5185\u53c2\uff0c\u53ef\u4ee5\u901a\u8fc7\u52a0\u5f3a\u4e24\u4e2a\u76f8\u5e94\u6df1\u5ea6\u9884\u6d4b\u4e4b\u95f4\u7684\u4e00\u81f4\u6027\u6765\u5229\u7528\u4e24\u5e27\u4e4b\u95f4\u7684\u51e0\u4f55\u7ea6\u675f\u3002\u76f4\u89c9\u662f\uff0c\u4ece\u4e24\u4e2a\u76f8\u90bb\u5e27\u5206\u522b\u9884\u6d4b\u7684\u5bc6\u96c6\u6df1\u5ea6\u56fe\u662f\u76f8\u5173\u7684\uff0c\u56e0\u4e3a\u89c2\u5bdf\u5230\u7684\u533a\u57df\u4e4b\u95f4\u5b58\u5728\u91cd\u53e0\u3002\u4e3a\u4e86\u4f7f\u540e\u9762\u63cf\u8ff0\u7684\u6df1\u5ea6\u4e00\u81f4\u6027\u635f\u5931\u4e2d\u5f3a\u5236\u6267\u884c\u7684\u51e0\u4f55\u7ea6\u675f\u53ef\u5fae\u5206\uff0c\u6df1\u5ea6\u9884\u6d4b\u7684\u89c2\u70b9\u5fc5\u987b\u9996\u5148\u5bf9\u9f50\u3002 Loss Functions Sparse Flow Loss (SFL) Depth Consistency Loss (DCL)","title":"Idea"},{"location":"cv/papers/others/endoscopy-depth-estimation/#experiments","text":"","title":"Experiments"},{"location":"cv/papers/others/let-net/","text":"LET-NET \u00b6 \u7ea6 155 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a LET-NET: Breaking of brightness consistency in optical flow with a lightweight CNN network code\uff1a LET-NET Idea \u00b6 \u63d0\u51fa \u8f7b\u91cf\u7ea7 CNN \u7ed3\u5408 LK \u5149\u6d41\u8fdb\u884c \u7279\u5f81\u70b9\u63d0\u53d6 \u548c \u56fe\u50cf\u4e00\u81f4\u6027\u8ba1\u7b97 \uff08\u7279\u5f81\u56fe F \u548c\u5206\u6570\u56fe S\uff09\uff0c\u6253\u7834 \u4eae\u5ea6\u4e00\u81f4\u6027\u5047\u8bbe \uff08\u4eae\u5ea6\u4e00\u81f4\u6027 \\(\\to\\) \u540c\u4e00\u50cf\u7d20\u7684\u5377\u79ef\u7279\u5f81\u4e0d\u53d8\uff09\uff0c\u4ee5\u9002\u5e94 HDR \u73af\u5883 \u3002 \u63d0\u53d6\u6700\u5feb\u901f\u7684\u6df1\u5ea6\u5b66\u4e60\u89d2\u70b9\uff08\u8bc1\u660e\u5c40\u90e8\u4fe1\u606f\u8db3\u4ee5\u63d0\u53d6\u89d2\u70b9\uff09\u3002 \u63d0\u51fa\u4e86\u4e00\u79cd\u635f\u5931\u51fd\u6570 mNRE \u6765\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u5c40\u90e8\u4e0d\u53d8\u91cf\uff0c\u5e76\u6539\u8fdb\u4e86\u89d2\u70b9\u63d0\u53d6\u4e2d\u7684\u5cf0\u503c\u635f\u5931\u3002 Experiments \u00b6 \u9879\u76ee\u6709\u95ee\u9898\uff0c issue \u3002","title":"LET-NET"},{"location":"cv/papers/others/let-net/#let-net","text":"\u7ea6 155 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract paper\uff1a LET-NET: Breaking of brightness consistency in optical flow with a lightweight CNN network code\uff1a LET-NET","title":"LET-NET"},{"location":"cv/papers/others/let-net/#idea","text":"\u63d0\u51fa \u8f7b\u91cf\u7ea7 CNN \u7ed3\u5408 LK \u5149\u6d41\u8fdb\u884c \u7279\u5f81\u70b9\u63d0\u53d6 \u548c \u56fe\u50cf\u4e00\u81f4\u6027\u8ba1\u7b97 \uff08\u7279\u5f81\u56fe F \u548c\u5206\u6570\u56fe S\uff09\uff0c\u6253\u7834 \u4eae\u5ea6\u4e00\u81f4\u6027\u5047\u8bbe \uff08\u4eae\u5ea6\u4e00\u81f4\u6027 \\(\\to\\) \u540c\u4e00\u50cf\u7d20\u7684\u5377\u79ef\u7279\u5f81\u4e0d\u53d8\uff09\uff0c\u4ee5\u9002\u5e94 HDR \u73af\u5883 \u3002 \u63d0\u53d6\u6700\u5feb\u901f\u7684\u6df1\u5ea6\u5b66\u4e60\u89d2\u70b9\uff08\u8bc1\u660e\u5c40\u90e8\u4fe1\u606f\u8db3\u4ee5\u63d0\u53d6\u89d2\u70b9\uff09\u3002 \u63d0\u51fa\u4e86\u4e00\u79cd\u635f\u5931\u51fd\u6570 mNRE \u6765\u63d0\u53d6\u56fe\u50cf\u4e2d\u7684\u5c40\u90e8\u4e0d\u53d8\u91cf\uff0c\u5e76\u6539\u8fdb\u4e86\u89d2\u70b9\u63d0\u53d6\u4e2d\u7684\u5cf0\u503c\u635f\u5931\u3002","title":"Idea"},{"location":"cv/papers/others/let-net/#experiments","text":"\u9879\u76ee\u6709\u95ee\u9898\uff0c issue \u3002","title":"Experiments"},{"location":"cv/papers/others/orbslam2/","text":"ORB-SLAM2 \u00b6 \u7ea6 23 \u4e2a\u5b57 Abstract paper\uff1a ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras code\uff1a ORB-SLAM2 https://wym.netlify.app/categories/orb-slam2/ https://blog.csdn.net/weixin_43013761/article/details/123092196 https://www.bilibili.com/video/BV1bK4y197kB https://www.guyuehome.com/34299","title":"ORB-SLAM2"},{"location":"cv/papers/others/orbslam2/#orb-slam2","text":"\u7ea6 23 \u4e2a\u5b57 Abstract paper\uff1a ORB-SLAM2: an Open-Source SLAM System for Monocular, Stereo and RGB-D Cameras code\uff1a ORB-SLAM2 https://wym.netlify.app/categories/orb-slam2/ https://blog.csdn.net/weixin_43013761/article/details/123092196 https://www.bilibili.com/video/BV1bK4y197kB https://www.guyuehome.com/34299","title":"ORB-SLAM2"},{"location":"cv/papers/others/vslam14/","text":"\u89c6\u89c9 SLAM \u5341\u56db\u8bb2 \u00b6 Abstract \u5b66\u4e60\u89c6\u89c9 SLAM \u5fc5\u770b\u7684\u4e00\u672c\u4e66\uff0c\u5165\u95e8\u7ea7 Table of Contents \u00b6 \u521d\u8bc6 SLAM \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 References \u00b6 \u300a\u89c6\u89c9 SLAM \u5341\u56db\u8bb2\uff08\u7b2c\u4e8c\u7248\uff09\u300b\u9ad8\u7fd4 \u731b\u5973\u7626\u7626 SLAM \u5341\u56db\u8bb2\u91cd\u8981\u516c\u5f0f\u5b9a\u7406\u6574\u7406\uff08\u4e0a\uff09 \u53f2\u4e0a\u6700\u5168slam\u4ece\u96f6\u5f00\u59cb","title":"\u89c6\u89c9 SLAM \u5341\u56db\u8bb2"},{"location":"cv/papers/others/vslam14/#slam","text":"Abstract \u5b66\u4e60\u89c6\u89c9 SLAM \u5fc5\u770b\u7684\u4e00\u672c\u4e66\uff0c\u5165\u95e8\u7ea7","title":"\u89c6\u89c9 SLAM \u5341\u56db\u8bb2"},{"location":"cv/papers/others/vslam14/#table-of-contents","text":"\u521d\u8bc6 SLAM \u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8","title":"Table of Contents"},{"location":"cv/papers/others/vslam14/#references","text":"\u300a\u89c6\u89c9 SLAM \u5341\u56db\u8bb2\uff08\u7b2c\u4e8c\u7248\uff09\u300b\u9ad8\u7fd4 \u731b\u5973\u7626\u7626 SLAM \u5341\u56db\u8bb2\u91cd\u8981\u516c\u5f0f\u5b9a\u7406\u6574\u7406\uff08\u4e0a\uff09 \u53f2\u4e0a\u6700\u5168slam\u4ece\u96f6\u5f00\u59cb","title":"References"},{"location":"cv/papers/others/vslam14/lec1/","text":"\u521d\u8bc6 SLAM \u00b6 Abstract SLAM \u662f S imultaneous L ocalization and M apping \u7684\u7f29\u5199\uff0c\u5373\u540c\u65f6\u5b9a\u4f4d\u4e0e\u5efa\u56fe\u3002\u5b83\u662f\u6307\u673a\u5668\u4eba\u5728\u672a\u77e5\u73af\u5883\u4e2d\u540c\u65f6\u5efa\u7acb\u5730\u56fe\u5e76\u786e\u5b9a\u81ea\u8eab\u4f4d\u7f6e\u7684\u8fc7\u7a0b\u3002 \u540c\u65f6 SLAM \u5206\u4e3a \u89c6\u89c9 SLAM \u548c \u6fc0\u5149 SLAM \uff0c\u8fd9\u91cc\u4e3b\u8981\u5b66\u4e60\u89c6\u89c9 SLAM\uff0c\u5176\u5b9e\u5b83\u4eec\u7684\u5dee\u8ddd\u4e0d\u662f\u5f88\u5927\uff0c\u90fd\u662f\u901a\u8fc7\u4f20\u611f\u5668\u83b7\u53d6\u73af\u5883\u4fe1\u606f\uff0c\u7136\u540e\u901a\u8fc7\u7b97\u6cd5\u8fdb\u884c\u5904\u7406\uff0c\u6700\u540e\u5f97\u5230\u5730\u56fe\u548c\u673a\u5668\u4eba\u7684\u4f4d\u7f6e\uff0c\u53ea\u4e0d\u8fc7\u4e00\u4e2a\u662f\u76f8\u673a\uff0c\u4e00\u4e2a\u662f\u6fc0\u5149\u3002 \u53ef\u4ee5\u89c2\u770b \u673a\u5668\u4eba\u5de5\u5320\u963f\u6770 \u6765\u4e86\u89e3 SLAM \u5728\u505a\u4ec0\u4e48\uff0c\u600e\u4e48\u505a\u3002","title":"\u521d\u8bc6 SLAM"},{"location":"cv/papers/others/vslam14/lec1/#slam","text":"Abstract SLAM \u662f S imultaneous L ocalization and M apping \u7684\u7f29\u5199\uff0c\u5373\u540c\u65f6\u5b9a\u4f4d\u4e0e\u5efa\u56fe\u3002\u5b83\u662f\u6307\u673a\u5668\u4eba\u5728\u672a\u77e5\u73af\u5883\u4e2d\u540c\u65f6\u5efa\u7acb\u5730\u56fe\u5e76\u786e\u5b9a\u81ea\u8eab\u4f4d\u7f6e\u7684\u8fc7\u7a0b\u3002 \u540c\u65f6 SLAM \u5206\u4e3a \u89c6\u89c9 SLAM \u548c \u6fc0\u5149 SLAM \uff0c\u8fd9\u91cc\u4e3b\u8981\u5b66\u4e60\u89c6\u89c9 SLAM\uff0c\u5176\u5b9e\u5b83\u4eec\u7684\u5dee\u8ddd\u4e0d\u662f\u5f88\u5927\uff0c\u90fd\u662f\u901a\u8fc7\u4f20\u611f\u5668\u83b7\u53d6\u73af\u5883\u4fe1\u606f\uff0c\u7136\u540e\u901a\u8fc7\u7b97\u6cd5\u8fdb\u884c\u5904\u7406\uff0c\u6700\u540e\u5f97\u5230\u5730\u56fe\u548c\u673a\u5668\u4eba\u7684\u4f4d\u7f6e\uff0c\u53ea\u4e0d\u8fc7\u4e00\u4e2a\u662f\u76f8\u673a\uff0c\u4e00\u4e2a\u662f\u6fc0\u5149\u3002 \u53ef\u4ee5\u89c2\u770b \u673a\u5668\u4eba\u5de5\u5320\u963f\u6770 \u6765\u4e86\u89e3 SLAM \u5728\u505a\u4ec0\u4e48\uff0c\u600e\u4e48\u505a\u3002","title":"\u521d\u8bc6 SLAM"},{"location":"cv/papers/others/vslam14/lec2/","text":"\u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8 \u00b6 \u7ea6 2134 \u4e2a\u5b57 34 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u7406\u89e3\u4e09\u7ef4\u7a7a\u95f4\u7684\u521a\u4f53\u8fd0\u52a8\u63cf\u8ff0\u65b9\u5f0f\uff1a\u65cb\u8f6c\u77e9\u9635\u3001\u53d8\u6362\u77e9\u9635\u3001\u56db\u5143\u6570\u548c\u6b27\u62c9\u89d2 \u638c\u63e1 Eigen \u5e93\u7684\u77e9\u9635\u3001\u51e0\u4f55\u6a21\u5757\u7684\u4f7f\u7528\u65b9\u6cd5 \u65cb\u8f6c\u77e9\u9635 \u00b6 \u70b9\u3001\u5411\u91cf\u548c\u5750\u6807\u7cfb \u00b6 \u7a7a\u95f4\u4e2d\u7684\u67d0\u70b9\u3002\u5176\u4f4d\u7f6e\u56fa\u5b9a\u3002\u82e5\u91c7\u7528\u4e0d\u540c\u7684\u5750\u6807\u7cfb\u63cf\u8ff0\uff0c\u5176\u5750\u6807\u4f4d\u7f6e\u5177\u4f53\u5f62\u5f0f\u662f\u4e0d\u540c\u7684\uff0c\u4f46\u662f\u8868\u8fbe\u7684\u70b9\u662f\u540c\u4e00\u4e2a\u70b9\u3002 \u7528\u7ebf\u4ee3\u8868\u793a\uff0c\u5728\u4e00\u4e2a\u7ebf\u6027\u7a7a\u95f4\u4e2d\uff0c\u627e\u5230\u8be5\u7a7a\u95f4\u7684\u4e00\u7ec4 \u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \uff0c\u90a3\u4e48\uff0c\u4efb\u610f\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u8fd9\u7ec4\u57fa\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}=[\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3][a_1,a_2,a_3]^\\top=a_1\\mathbf{e}_1+a_2\\mathbf{e}_2+a_3\\mathbf{e}_3\\) \u5750\u6807\u7cfb\u5b9a\u4e49\u65f6\uff0c\u6709\u53f3\u624b\u7cfb\u548c\u5de6\u624b\u7cfb\uff0c\u901a\u5e38\u91c7\u7528\u53f3\u624b\u7cfb \u5411\u91cf\u6709\u5185\u79ef\u548c\u5916\u79ef\u3002 \u5185\u79ef\uff1a \\(\\mathbf{a}\\mathbf{b}=\\mathbf{a}^\\top\\mathbf{b}=\\sum_{i=1}^3a_ib_i=|\\mathbf{a}||\\mathbf{b}|\\cos(\\mathbf{a}, \\mathbf{b})\\) \u5916\u79ef\uff1a \\[ \\mathbf{a} \\times \\mathbf{b}= \\begin{bmatrix} i & j & k \\\\ a_1 & a_2 & a_3 \\\\ b_1 & b_2 & b_3 \\end{bmatrix} = \\begin{bmatrix} a_2b_3-a_3b_2 \\\\ a_3b_1-a_1b_3 \\\\ a_1b_2-a_2b_1 \\end{bmatrix} = \\begin{bmatrix} 0 & -a_3 & a_2 \\\\ a_3 & 0 & -a_1 \\\\ -a_2 & a_1 & 0 \\end{bmatrix} \\mathbf{b} \\overset{\\Delta}{=} \\mathbf{a}^\\wedge \\mathbf{b} \\] \u5176\u4e2d\u7b26\u53f7 \\(\\wedge\\) \u79f0\u4e3a \u53cd\u5bf9\u79f0\u7b26\u53f7 \uff0c \\(\\mathbf{a}^\\wedge\\) \u4e3a \u53cd\u5bf9\u79f0\u77e9\u9635 \uff08\u6ee1\u8db3 \\(\\mathbf{A}^\\top=-\\mathbf{A}\\) \uff09\uff0c\u8fd9\u6837\u505a\u7684\u597d\u5904\u53ef\u4ee5\u5956\u5411\u91cf\u8fd0\u7b97\u53d8\u4e3a\u77e9\u9635\u8fd0\u7b97 \u5750\u6807\u7cfb\u95f4\u7684\u6b27\u6c0f\u53d8\u6362 \u00b6 \u4e24\u4e2a\u5750\u6807\u7cfb\u4e4b\u95f4\u7684\u8fd0\u52a8\u7531\u4e00\u4e2a\u65cb\u8f6c\u52a0\u4e0a\u4e00\u4e2a\u5e73\u79fb\u7ec4\u6210\uff0c\u8fd9\u79cd\u8fd0\u52a8\u79f0\u4e3a \u521a\u4f53\u8fd0\u52a8 \uff0c\u4f8b\u5982\u76f8\u673a\u8fd0\u52a8 \u521a\u4f53\u8fd0\u52a8\u8fc7\u7a0b\u4e2d\uff0c\u540c\u4e00\u4e2a\u5411\u91cf\u5728\u5404\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u957f\u5ea6\u548c\u5939\u89d2\u90fd\u4e0d\u53d8\uff0c\u53ea\u4f1a\u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u59ff\u6001\u4e0d\u540c\uff0c\u4f8b\u5982\u76f8\u673a\u5750\u6807\u7cfb\u5230\u4e16\u754c\u5750\u6807\u7cfb\uff0c\u76f8\u5dee\u4e00\u4e2a \u6b27\u6c0f\u53d8\u6362 \u6b27\u6c0f\u53d8\u6362\u7531\u65cb\u8f6c\u548c\u5e73\u79fb\u7ec4\u6210 \u65cb\u8f6c \u8bbe\u67d0\u4e2a\u5355\u4f4d\u6b63\u4ea4\u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \u7ecf\u8fc7\u4e00\u6b21\u65cb\u8f6c\u53d8\u6210\u4e86 \\((\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime)\\) \u3002\u5bf9\u4e8e\u540c\u4e00\u4e2a\u5411\u91cf \\(\\mathbf{a}\\) \u6ca1\u6709\u968f\u7740\u5750\u6807\u7cfb\u7684\u65cb\u8f6c\u800c\u53d1\u751f\u8fd0\u52a8\uff0c\u6240\u4ee5 \\[ [\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3]\\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=[\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime] \\begin{bmatrix} a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix} \\\\ \u540c\u65f6\u5de6\u4e58 \\begin{bmatrix} \\mathbf{e}_1^\\top \\\\ \\mathbf{e}_2^\\top \\\\ \\mathbf{e}_3^\\top \\end{bmatrix}\u5f97 \\ \\ \\ \\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=\\begin{bmatrix} \\mathbf{e}_1^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_2^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_3^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_3^\\prime \\end{bmatrix}\\begin{bmatrix}a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix}\\overset{\\Delta}{=}\\mathbf{R}\\mathbf{a}^\\prime \\] \u8fd9\u91cc\u7684 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u884c\u5217\u5f0f\u4e3a 1 \u7684\u6b63\u4ea4\u77e9\u9635\uff0c\u7531\u4e24\u7ec4\u57fa\u4e4b\u95f4\u7684\u5185\u79ef\u7ec4\u6210\uff0c\u6240\u4ee5\u77e9\u9635 \\(\\mathbf{R}\\) \u63cf\u8ff0\u4e86\u65cb\u8f6c\u672c\u8eab\uff0c\u56e0\u6b64\u88ab\u79f0\u4e3a \u65cb\u8f6c\u77e9\u9635 \uff0c\u540c\u65f6\u4e5f\u53eb \u65b9\u5411\u4f59\u5f26\u77e9\u9635 \u7531\u4e8e\u65cb\u8f6c\u77e9\u9635\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u5b83\u7684\u9006\uff08\u5373\u8f6c\u7f6e\uff09\u63cf\u8ff0\u4e86\u4e00\u4e2a\u76f8\u53cd\u7684\u65cb\u8f6c\uff0c\u5373 \\(\\mathbf{a}^\\prime=\\mathbf{R}^{-1}\\mathbf{a}=\\mathbf{R}^\\top\\mathbf{a}\\) \u5e73\u79fb \\(\\mathbf{t}\\) \u8868\u793a\u5e73\u79fb\u5411\u91cf\uff0c\u5176\u4e2d \\(\\mathbf{t}_{12} \\ne -\\mathbf{t}_{21}\\) \uff0c\u548c\u4e24\u4e2a\u7cfb\u7684\u65cb\u8f6c\u6709\u5173 \u65cb\u8f6c\u548c\u5e73\u79fb\u5408\u5230\u4e00\u8d77\uff1a \\(\\mathbf{a}^\\prime=\\mathbf{R}\\mathbf{a}+\\mathbf{t}\\) \u5b9e\u9645\u4e2d\uff0c\u5b9a\u4e49\u5750\u6807\u7cfb 1\u548c\u5750\u6807\u7cfb 2\uff0c\u90a3\u4e48\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u4e24\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}_1, \\mathbf{a}_2\\) \uff0c\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\u4e3a \\(\\mathbf{a}_1=\\mathbf{R}_{12}\\mathbf{a}_2+\\mathbf{t}_{12}\\) \uff0c\u8fd9\u91cc\u7684 \\(\\mathbf{R}_{12}\\) \u662f\u6307\u201c\u628a\u5750\u6807\u7cfb 2 \u7684\u5411\u91cf\u53d8\u6362\u5230\u5750\u6807\u7cfb 1 \u4e2d\u201d \u53d8\u6362\u77e9\u9635\u4e0e\u9f50\u6b21\u5750\u6807 \u00b6 \u4e4b\u524d\u7684\u53d8\u6362\u5173\u7cfb\u4e0d\u662f\u7ebf\u6027\u5173\u7cfb \u5047\u8bbe\u8fdb\u884c\u4e86\u4e24\u6b21\u53d8\u6362\uff0c \\(\\mathbf{b}=\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1\\) \u548c \\(\\mathbf{c}=\\mathbf{R}_2\\mathbf{b}+\\mathbf{t}_2\\) \uff0c\u90a3\u4e48 \\(\\mathbf{a}\\) \u5230 \\(\\mathbf{c}\\) \u7684\u53d8\u6362\u4e3a \\(\\mathbf{c}=\\mathbf{R}_2(\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1)+\\mathbf{t}_2\\) \uff0c\u5982\u679c\u53d8\u6362\u591a\u6b21\u4f1a\u53d8\u7684\u975e\u5e38\u7e41\u7410\uff0c\u6240\u4ee5\u5f15\u5165 \u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635 \u91cd\u5199\u4e0a\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{a}^\\prime \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} \\mathbf{R} & \\mathbf{t} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\overset{\\Delta}{=} \\mathbf{T} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\] \u5728\u4e09\u7ef4\u5411\u91cf\u7684\u672b\u5c3e\u6dfb\u52a0 1\uff0c\u5c06\u5176\u53d8\u6210\u4e86\u56db\u7ef4\u5411\u91cf\uff0c\u79f0\u4e3a \u9f50\u6b21\u5750\u6807 \u3002\u5bf9\u4e8e\u8fd9\u4e2a\u56db\u7ef4\u5411\u91cf\uff0c\u53ef\u4ee5\u628a\u65cb\u8f6c\u548c\u5e73\u79fb\u5199\u5728\u4e00\u4e2a\u77e9\u9635\u91cc\uff0c\u4f7f\u5f97\u6574\u4e2a\u5173\u7cfb\u53d8\u6210\u7ebf\u6027\u5173\u7cfb\u3002\u5176\u4e2d\u77e9\u9635 \\(\\mathbf{T}\\) \u79f0\u4e3a \u53d8\u6362\u77e9\u9635 \u7528 \\(\\tilde{\\mathbf{a}}\\) \u8868\u793a \\(\\mathbf{a}\\) \u7684\u9f50\u6b21\u5750\u6807\u3002\u6240\u4ee5\u901a\u8fc7\u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635\uff0c\u4e24\u6b21\u53d8\u6362\u7684\u53e0\u52a0\u5c31\u53ef\u4ee5\u5199\u6210 \\(\\tilde{\\mathbf{c}}=\\mathbf{T}_2\\mathbf{T}_1\\tilde{\\mathbf{a}}\\) \u65cb\u8f6c\u5411\u91cf\u548c\u6b27\u62c9\u89d2 \u00b6 \u65cb\u8f6c\u77e9\u9635\u548c\u53d8\u6362\u77e9\u9635\u90fd\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f \u53d8\u91cf\u7684\u5197\u4f59 \u3002\u5df2\u77e5\u4e00\u6b21\u65cb\u8f6c\u4ec5\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u4f46\u662f\u65cb\u8f6c\u77e9\u9635\u6709\u4e5d\u4e2a\u91cf\uff0c\u7528\u4e5d\u4e2a\u91cf\u8868\u793a\u4e09\u4e2a\u81ea\u7531\u5ea6\uff08\u4ec5\u8868\u793a\u65cb\u8f6c\uff09\uff1b\u53d8\u6362\u77e9\u9635\u670916\u4e2a\u91cf\uff0c\u752816\u4e2a\u91cf\u8868\u793a6\u4e2a\u81ea\u7531\u5ea6\uff08\u5305\u62ec\u65cb\u8f6c\u548c\u5e73\u79fb\uff09\u3002 \u5176\u6b21\uff0c\u65cb\u8f6c\u77e9\u9635\u662f\u4e00\u4e2a\u7279\u6b8a\u77e9\u9635\uff0c\u5373\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u4e14\u884c\u5217\u5f0f\u4e3a1\u3002\u4e14\u8be5\u7279\u6b8a\u6027\u4e5f\u4f1a\u5f71\u54cd\u5230\u53d8\u6362\u77e9\u9635\uff0c\u6240\u4ee5\u5177\u6709\u7279\u6b8a\u6027\u7684\u77e9\u9635\u5728\u540e\u7eed\u7684\u975e\u7ebf\u6027\u4f18\u5316\u4e2d\u4f1a\u5e26\u6765\u989d\u5916\u7684\u7ea6\u675f\uff0c\u5bfc\u81f4\u6c42\u89e3\u56f0\u96be\u3002 \u65cb\u8f6c\u5411\u91cf \u00b6 \u65cb\u8f6c\u5411\u91cf=\u4e00\u4e2a\u65cb\u8f6c\u8f74+\u4e00\u4e2a\u65cb\u8f6c\u89d2\u5ea6\u5373\uff1a\u65cb\u8f6c\u5411\u91cf\u7684\u65b9\u5411\u4e3a\u65cb\u8f6c\u8f74\uff0c\u957f\u5ea6\u4e3a\u65cb\u8f6c\u89d2\u5ea6\u3002 \u65cb\u8f6c\u5411\u91cf\u548c\u77e9\u9635\u4e4b\u95f4\u5b58\u5728\u8f6c\u6362\u5173\u7cfb\uff0c\u7528\u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\uff08Rodrigues's Formula\uff09\u8868\u793a\uff1a \\[ \\mathbf{R}=\\cos\\theta\\mathbf{I}+(1-\\cos\\theta)\\mathbf{n}\\mathbf{n}^\\top+\\sin\\theta\\mathbf{n}^\\wedge \\] \u53cd\u4e4b\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u4ece\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\u5230\u65cb\u8f6c\u5411\u91cf\u7684\u8f6c\u6362\u3002\u5bf9\u4e8e\u8f6c\u89d2 \\(\\theta\\) \uff0c\u53d6\u4e24\u8fb9\u7684 \u8ff9 \uff0c\u6709 \\[ tr(\\mathbf{R})=\\cos \\theta \\ tr(\\mathbf{I})+(1-\\cos \\theta)tr(\\mathbf{n}\\mathbf{n}^\\top)+\\sin\\theta \\ tr(\\mathbf{n}^\\wedge) \\\\ tr(\\mathbf{R})=3\\cos\\theta+(1-\\cos\\theta) \\\\ tr(\\mathbf{R})=1+2\\cos\\theta \\\\ \\theta = \\arccos\\left(\\frac{tr(\\mathbf{R})-1}{2}\\right) \\] \u5173\u4e8e\u8f6c\u8f74 \\(\\mathbf{n}\\) \uff0c\u65cb\u8f6c\u8f74\u4e0a\u7684\u5411\u91cf\u5728\u65cb\u8f6c\u540e\u4e0d\u53d8\uff0c\u5373 \\(\\mathbf{Rn}=\\mathbf{n}\\) \uff0c\u56e0\u6b64\u8f6c\u8f74 \\(\\mathbf{n}\\) \u662f\u77e9\u9635 \\(\\mathbf{R}\\) \u7279\u5f81\u503c 1 \u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u3002 \u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\u8be6\u7ec6\u63a8\u5bfc \u6b27\u62c9\u89d2 \u00b6 \u6b27\u62c9\u89d2\u662f\u4e00\u79cd\u5c06\u65cb\u8f6c\u5206\u89e3\u4e3a\u4e09\u4e2a\u57fa\u672c\u65cb\u8f6c\u7684\u65b9\u6cd5\uff0c\u5373\u7ed5\u4e09\u4e2a\u5750\u6807\u8f74\u7684\u65cb\u8f6c\u3002\u6b27\u62c9\u89d2\u7684\u8868\u793a\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u4f46\u662f\u6700\u5e38\u7528\u7684\u662f Z-Y-X \u7684\u65cb\u8f6c\u987a\u5e8f\uff0c\u5373\u5148\u7ed5 Z \u8f74\u65cb\u8f6c\uff0c\u518d\u7ed5 Y \u8f74\u65cb\u8f6c\uff0c\u6700\u540e\u7ed5 X \u8f74\u65cb\u8f6c\u3002\u8fd9\u79cd\u65cb\u8f6c\u987a\u5e8f\u4e5f\u53eb \u822a\u5411-\u4fef\u4ef0-\u6eda\u8f6c \uff08yaw-pitch-roll\uff09\u3002 \u4f46\u662f\u5b58\u5728\u4e07\u5411\u9501\u73b0\u8c61\uff1a \u4e07\u5411\u6b7b\u9501 \uff0c\u6240\u4ee5\u4f7f\u6b27\u62c9\u89d2\u5728\u7279\u6b8a\u60c5\u51b5\u4e0b\u4f1a\u51fa\u73b0\u5947\u5f02\u6027\u3002 \u56db\u5143\u6570 \u00b6 \u56db\u5143\u6570\u7684\u5b9a\u4e49 \u00b6 \u56db\u5143\u6570\u662f\u4e00\u79cd\u6269\u5c55\u590d\u6570\u7684\u65b9\u6cd5\uff0c\u590d\u6570\u7531\u5b9e\u90e8\u548c\u865a\u90e8\u7ec4\u6210\uff0c\u800c\u56db\u5143\u6570\u7531\u5b9e\u90e8\u548c\u4e09\u4e2a\u865a\u90e8\u7ec4\u6210\uff0c\u5373 \\(\\mathbf{q}=q_0+q_1i+q_2j+q_3k\\) \uff0c\u6ee1\u8db3\u4e0b\u9762\u5173\u7cfb\uff1a \\[ \\left\\{\\begin{matrix} i^2 + j^2 + k^2 = -1 \\\\ ij = k, ji = -k \\\\ jk = i, kj = -i \\\\ ki = j, ik = -j \\end{matrix}\\right. \\] \u7528\u4e00\u4e2a\u6807\u91cf\u548c\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff1a \\(\\mathbf{q}=[s,\\mathbf{v}],s=q_0 \\in R, \\mathbf{v}=[q_1,q_2,q_3]^\\top \\in R^3\\) \uff0c\u865a\u90e8\u4e3a 0 \u4e3a\u5b9e\u56db\u5143\u6570\uff0c\u5b9e\u90e8\u4e3a 0 \u4e3a\u865a\u56db\u5143\u6570 \u56db\u5143\u6570\u7684\u8fd0\u7b97 \u00b6 \\(\\mathbf{q}_a \\pm \\mathbf{q}_b = [s_a \\pm s_b, \\mathbf{v}_a \\pm \\mathbf{v}_b]\\) \\(\\mathbf{q}_a \\mathbf{q}_b=[s_as_b-\\mathbf{v}_a^\\top\\mathbf{v}_b,s_a\\mathbf{v}_b+s_b\\mathbf{v}_a+\\mathbf{v}_a\\times \\mathbf{v}_b]^\\top\\) \\(\\parallel \\mathbf{q}_a \\parallel = \\sqrt{s_a^2+x_a^2+y_a^2+z_a^2}\\) \\(\\mathbf{q}_a^*=s_a-x_ai-y_aj-z_ak=[s_a, -\\mathbf{v}_a]^\\top\\) \\(\\mathbf{q}^{-1}=\\mathbf{q}^*/\\parallel \\mathbf{q} \\parallel^2\\) \\(k\\mathbf{q}=[ks, k\\mathbf{v}]\\) \\(\\mathbf{q}_a \\cdot \\mathbf{q}_b=s_as_b+x_ax_bi+y_ay_bj+z_az_bk\\) \u7528\u56db\u5143\u6570\u8868\u793a\u65cb\u8f6c \u00b6 \u4e09\u7ef4\u7a7a\u95f4\u70b9\u7528\u4e00\u4e2a\u865a\u56db\u5143\u6570\u6765\u63cf\u8ff0\uff1a \\(\\mathbf{p}=[0,x,y,z]^\\top=[0,\\mathbf{v}]^\\top\\) \u65cb\u8f6c\u540e\u5230\u70b9 \\(\\mathbf{p}^\\prime\\) \uff1a \\(\\mathbf{p}^\\prime=\\mathbf{qpq}^{-1}\\) \u56db\u5143\u6570\u5230\u5176\u4ed6\u65cb\u8f6c\u8868\u793a\u7684\u8f6c\u6362 \u00b6 \u8f74\u89d2\u5230\u56db\u5143\u6570\uff1a \\(\\mathbf{q}=[\\cos \\frac{\\theta}{2}, n_x \\sin \\frac{\\theta}{2}, n_y \\frac{\\theta}{2}, n_z \\sin \\frac{\\theta}{2}]^\\top\\) \u56db\u5143\u6570\u5230\u8f74\u89d2\uff1a \\(\\left\\{\\begin{matrix} \\theta=2\\arccos q_0 \\\\ [n_x,n_y,n_z]^\\top=[q_1, q_2, q_3]^\\top / \\sin \\frac{\\theta}{2} \\end{matrix}\\right.\\) \u76f8\u4f3c\u3001\u4eff\u5c04\u3001\u5c04\u5f71\u53d8\u6362 \u00b6 \u89c1 \u591a\u89c6\u56fe\u51e0\u4f55 Eigen \u5e93 \u00b6 install \u00b6 sudo apt-get install libeigen3-dev # \u5982\u679c\u8981\u5b89\u88c5\u5bf9\u5e94\u7248\u672c\uff0c\u8bf7\u4e0b\u8f7d\u6e90\u7801\u7f16\u8bd1 Eigen\u4e2d\u77e9\u9635\u7684\u57fa\u672c\u64cd\u4f5c \u00b6 Eigen :: Matrix < type , row , colon > //typedef: Matrix3d, Vector3d... Eigen :: MatrixXd //unkown size matrix matrix ( i , j ) //the value of i th row and j th colon //the operations matrix . transpose (); matrix . trace (); matrix . sum (); matrix . inverse (); matrix . determinant (); //find the proper values and vectors Eigen :: SelfAdjointEigenSolver < Eigen :: Matrix3d > solver ( matrix . transport () * matrix ); solver . eigenvalues (); solver . eigenvectors (); //solve Matrix_NN * x = v_Nd x = matrix_NN . colpivHouseholderQr (). solve ( v_Nd ); // \u65cb\u8f6c\u5411\u91cf\u548c\u65cb\u8f6c\u77e9\u9635 Eigen :: AngleAxisd rotation_vector ( theta , Eigen :: Vector3d ( x , y , z )); //rotation vector rotation_matrix = rotation_vector . toRotationMatrix (); //transform rotation vector to rotation matrix x_rotated = rotation_vector * x ; //calculate rotated vector x' x_rotated = rotation_matrix * x ; //calculate rotated vector x' // \u56db\u5143\u6570 q = Eigen :: Quaterniond ( w , x , y , z ) //create a quaternion from four values q = Eigen :: Quaterniond ( rotation_vector ) //create a quaternion from rotaion vector q = Eigen :: Quaterniond ( rotation_matrix ) //create a quaternion from rotaion matrix x_rotated = q * x //calculate rotated vector x' // \u53d8\u6362\u77e9\u9635 T //create a transform matrix Eigen :: Isometry3d T = Eigen :: Isometry3d :: Identity (); T . rotate ( rotation_vector ); /* T.rotate(rotation_matrix); T.rotate(quaternion); */ T . pretranslate ( Eigen :: Vector3d ( x , y , z ));","title":"\u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8"},{"location":"cv/papers/others/vslam14/lec2/#_1","text":"\u7ea6 2134 \u4e2a\u5b57 34 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 8 \u5206\u949f Abstract \u7406\u89e3\u4e09\u7ef4\u7a7a\u95f4\u7684\u521a\u4f53\u8fd0\u52a8\u63cf\u8ff0\u65b9\u5f0f\uff1a\u65cb\u8f6c\u77e9\u9635\u3001\u53d8\u6362\u77e9\u9635\u3001\u56db\u5143\u6570\u548c\u6b27\u62c9\u89d2 \u638c\u63e1 Eigen \u5e93\u7684\u77e9\u9635\u3001\u51e0\u4f55\u6a21\u5757\u7684\u4f7f\u7528\u65b9\u6cd5","title":"\u4e09\u7ef4\u7a7a\u95f4\u521a\u4f53\u8fd0\u52a8"},{"location":"cv/papers/others/vslam14/lec2/#_2","text":"","title":"\u65cb\u8f6c\u77e9\u9635"},{"location":"cv/papers/others/vslam14/lec2/#_3","text":"\u7a7a\u95f4\u4e2d\u7684\u67d0\u70b9\u3002\u5176\u4f4d\u7f6e\u56fa\u5b9a\u3002\u82e5\u91c7\u7528\u4e0d\u540c\u7684\u5750\u6807\u7cfb\u63cf\u8ff0\uff0c\u5176\u5750\u6807\u4f4d\u7f6e\u5177\u4f53\u5f62\u5f0f\u662f\u4e0d\u540c\u7684\uff0c\u4f46\u662f\u8868\u8fbe\u7684\u70b9\u662f\u540c\u4e00\u4e2a\u70b9\u3002 \u7528\u7ebf\u4ee3\u8868\u793a\uff0c\u5728\u4e00\u4e2a\u7ebf\u6027\u7a7a\u95f4\u4e2d\uff0c\u627e\u5230\u8be5\u7a7a\u95f4\u7684\u4e00\u7ec4 \u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \uff0c\u90a3\u4e48\uff0c\u4efb\u610f\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u8fd9\u7ec4\u57fa\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}=[\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3][a_1,a_2,a_3]^\\top=a_1\\mathbf{e}_1+a_2\\mathbf{e}_2+a_3\\mathbf{e}_3\\) \u5750\u6807\u7cfb\u5b9a\u4e49\u65f6\uff0c\u6709\u53f3\u624b\u7cfb\u548c\u5de6\u624b\u7cfb\uff0c\u901a\u5e38\u91c7\u7528\u53f3\u624b\u7cfb \u5411\u91cf\u6709\u5185\u79ef\u548c\u5916\u79ef\u3002 \u5185\u79ef\uff1a \\(\\mathbf{a}\\mathbf{b}=\\mathbf{a}^\\top\\mathbf{b}=\\sum_{i=1}^3a_ib_i=|\\mathbf{a}||\\mathbf{b}|\\cos(\\mathbf{a}, \\mathbf{b})\\) \u5916\u79ef\uff1a \\[ \\mathbf{a} \\times \\mathbf{b}= \\begin{bmatrix} i & j & k \\\\ a_1 & a_2 & a_3 \\\\ b_1 & b_2 & b_3 \\end{bmatrix} = \\begin{bmatrix} a_2b_3-a_3b_2 \\\\ a_3b_1-a_1b_3 \\\\ a_1b_2-a_2b_1 \\end{bmatrix} = \\begin{bmatrix} 0 & -a_3 & a_2 \\\\ a_3 & 0 & -a_1 \\\\ -a_2 & a_1 & 0 \\end{bmatrix} \\mathbf{b} \\overset{\\Delta}{=} \\mathbf{a}^\\wedge \\mathbf{b} \\] \u5176\u4e2d\u7b26\u53f7 \\(\\wedge\\) \u79f0\u4e3a \u53cd\u5bf9\u79f0\u7b26\u53f7 \uff0c \\(\\mathbf{a}^\\wedge\\) \u4e3a \u53cd\u5bf9\u79f0\u77e9\u9635 \uff08\u6ee1\u8db3 \\(\\mathbf{A}^\\top=-\\mathbf{A}\\) \uff09\uff0c\u8fd9\u6837\u505a\u7684\u597d\u5904\u53ef\u4ee5\u5956\u5411\u91cf\u8fd0\u7b97\u53d8\u4e3a\u77e9\u9635\u8fd0\u7b97","title":"\u70b9\u3001\u5411\u91cf\u548c\u5750\u6807\u7cfb"},{"location":"cv/papers/others/vslam14/lec2/#_4","text":"\u4e24\u4e2a\u5750\u6807\u7cfb\u4e4b\u95f4\u7684\u8fd0\u52a8\u7531\u4e00\u4e2a\u65cb\u8f6c\u52a0\u4e0a\u4e00\u4e2a\u5e73\u79fb\u7ec4\u6210\uff0c\u8fd9\u79cd\u8fd0\u52a8\u79f0\u4e3a \u521a\u4f53\u8fd0\u52a8 \uff0c\u4f8b\u5982\u76f8\u673a\u8fd0\u52a8 \u521a\u4f53\u8fd0\u52a8\u8fc7\u7a0b\u4e2d\uff0c\u540c\u4e00\u4e2a\u5411\u91cf\u5728\u5404\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u957f\u5ea6\u548c\u5939\u89d2\u90fd\u4e0d\u53d8\uff0c\u53ea\u4f1a\u662f\u7a7a\u95f4\u4f4d\u7f6e\u548c\u59ff\u6001\u4e0d\u540c\uff0c\u4f8b\u5982\u76f8\u673a\u5750\u6807\u7cfb\u5230\u4e16\u754c\u5750\u6807\u7cfb\uff0c\u76f8\u5dee\u4e00\u4e2a \u6b27\u6c0f\u53d8\u6362 \u6b27\u6c0f\u53d8\u6362\u7531\u65cb\u8f6c\u548c\u5e73\u79fb\u7ec4\u6210 \u65cb\u8f6c \u8bbe\u67d0\u4e2a\u5355\u4f4d\u6b63\u4ea4\u57fa \\((\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3)\\) \u7ecf\u8fc7\u4e00\u6b21\u65cb\u8f6c\u53d8\u6210\u4e86 \\((\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime)\\) \u3002\u5bf9\u4e8e\u540c\u4e00\u4e2a\u5411\u91cf \\(\\mathbf{a}\\) \u6ca1\u6709\u968f\u7740\u5750\u6807\u7cfb\u7684\u65cb\u8f6c\u800c\u53d1\u751f\u8fd0\u52a8\uff0c\u6240\u4ee5 \\[ [\\mathbf{e}_1, \\mathbf{e}_2, \\mathbf{e}_3]\\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=[\\mathbf{e}_1^\\prime, \\mathbf{e}_2^\\prime, \\mathbf{e}_3^\\prime] \\begin{bmatrix} a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix} \\\\ \u540c\u65f6\u5de6\u4e58 \\begin{bmatrix} \\mathbf{e}_1^\\top \\\\ \\mathbf{e}_2^\\top \\\\ \\mathbf{e}_3^\\top \\end{bmatrix}\u5f97 \\ \\ \\ \\begin{bmatrix}a_1 \\\\ a_2 \\\\ a_3 \\end{bmatrix}=\\begin{bmatrix} \\mathbf{e}_1^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_1^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_2^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_2^\\top \\mathbf{e}_3^\\prime \\\\ \\mathbf{e}_3^\\top \\mathbf{e}_1^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_2^\\prime & \\mathbf{e}_3^\\top \\mathbf{e}_3^\\prime \\end{bmatrix}\\begin{bmatrix}a_1^\\prime \\\\ a_2^\\prime \\\\ a_3^\\prime \\end{bmatrix}\\overset{\\Delta}{=}\\mathbf{R}\\mathbf{a}^\\prime \\] \u8fd9\u91cc\u7684 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u884c\u5217\u5f0f\u4e3a 1 \u7684\u6b63\u4ea4\u77e9\u9635\uff0c\u7531\u4e24\u7ec4\u57fa\u4e4b\u95f4\u7684\u5185\u79ef\u7ec4\u6210\uff0c\u6240\u4ee5\u77e9\u9635 \\(\\mathbf{R}\\) \u63cf\u8ff0\u4e86\u65cb\u8f6c\u672c\u8eab\uff0c\u56e0\u6b64\u88ab\u79f0\u4e3a \u65cb\u8f6c\u77e9\u9635 \uff0c\u540c\u65f6\u4e5f\u53eb \u65b9\u5411\u4f59\u5f26\u77e9\u9635 \u7531\u4e8e\u65cb\u8f6c\u77e9\u9635\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u5b83\u7684\u9006\uff08\u5373\u8f6c\u7f6e\uff09\u63cf\u8ff0\u4e86\u4e00\u4e2a\u76f8\u53cd\u7684\u65cb\u8f6c\uff0c\u5373 \\(\\mathbf{a}^\\prime=\\mathbf{R}^{-1}\\mathbf{a}=\\mathbf{R}^\\top\\mathbf{a}\\) \u5e73\u79fb \\(\\mathbf{t}\\) \u8868\u793a\u5e73\u79fb\u5411\u91cf\uff0c\u5176\u4e2d \\(\\mathbf{t}_{12} \\ne -\\mathbf{t}_{21}\\) \uff0c\u548c\u4e24\u4e2a\u7cfb\u7684\u65cb\u8f6c\u6709\u5173 \u65cb\u8f6c\u548c\u5e73\u79fb\u5408\u5230\u4e00\u8d77\uff1a \\(\\mathbf{a}^\\prime=\\mathbf{R}\\mathbf{a}+\\mathbf{t}\\) \u5b9e\u9645\u4e2d\uff0c\u5b9a\u4e49\u5750\u6807\u7cfb 1\u548c\u5750\u6807\u7cfb 2\uff0c\u90a3\u4e48\u5411\u91cf \\(\\mathbf{a}\\) \u5728\u4e24\u4e2a\u5750\u6807\u7cfb\u4e0b\u7684\u5750\u6807\u4e3a \\(\\mathbf{a}_1, \\mathbf{a}_2\\) \uff0c\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\u4e3a \\(\\mathbf{a}_1=\\mathbf{R}_{12}\\mathbf{a}_2+\\mathbf{t}_{12}\\) \uff0c\u8fd9\u91cc\u7684 \\(\\mathbf{R}_{12}\\) \u662f\u6307\u201c\u628a\u5750\u6807\u7cfb 2 \u7684\u5411\u91cf\u53d8\u6362\u5230\u5750\u6807\u7cfb 1 \u4e2d\u201d","title":"\u5750\u6807\u7cfb\u95f4\u7684\u6b27\u6c0f\u53d8\u6362"},{"location":"cv/papers/others/vslam14/lec2/#_5","text":"\u4e4b\u524d\u7684\u53d8\u6362\u5173\u7cfb\u4e0d\u662f\u7ebf\u6027\u5173\u7cfb \u5047\u8bbe\u8fdb\u884c\u4e86\u4e24\u6b21\u53d8\u6362\uff0c \\(\\mathbf{b}=\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1\\) \u548c \\(\\mathbf{c}=\\mathbf{R}_2\\mathbf{b}+\\mathbf{t}_2\\) \uff0c\u90a3\u4e48 \\(\\mathbf{a}\\) \u5230 \\(\\mathbf{c}\\) \u7684\u53d8\u6362\u4e3a \\(\\mathbf{c}=\\mathbf{R}_2(\\mathbf{R}_1\\mathbf{a}+\\mathbf{t}_1)+\\mathbf{t}_2\\) \uff0c\u5982\u679c\u53d8\u6362\u591a\u6b21\u4f1a\u53d8\u7684\u975e\u5e38\u7e41\u7410\uff0c\u6240\u4ee5\u5f15\u5165 \u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635 \u91cd\u5199\u4e0a\u5f0f\uff1a \\[ \\begin{bmatrix} \\mathbf{a}^\\prime \\\\ 1 \\end{bmatrix} = \\begin{bmatrix} \\mathbf{R} & \\mathbf{t} \\\\ \\mathbf{0}^\\top & 1 \\end{bmatrix} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\overset{\\Delta}{=} \\mathbf{T} \\begin{bmatrix} \\mathbf{a} \\\\ 1 \\end{bmatrix} \\] \u5728\u4e09\u7ef4\u5411\u91cf\u7684\u672b\u5c3e\u6dfb\u52a0 1\uff0c\u5c06\u5176\u53d8\u6210\u4e86\u56db\u7ef4\u5411\u91cf\uff0c\u79f0\u4e3a \u9f50\u6b21\u5750\u6807 \u3002\u5bf9\u4e8e\u8fd9\u4e2a\u56db\u7ef4\u5411\u91cf\uff0c\u53ef\u4ee5\u628a\u65cb\u8f6c\u548c\u5e73\u79fb\u5199\u5728\u4e00\u4e2a\u77e9\u9635\u91cc\uff0c\u4f7f\u5f97\u6574\u4e2a\u5173\u7cfb\u53d8\u6210\u7ebf\u6027\u5173\u7cfb\u3002\u5176\u4e2d\u77e9\u9635 \\(\\mathbf{T}\\) \u79f0\u4e3a \u53d8\u6362\u77e9\u9635 \u7528 \\(\\tilde{\\mathbf{a}}\\) \u8868\u793a \\(\\mathbf{a}\\) \u7684\u9f50\u6b21\u5750\u6807\u3002\u6240\u4ee5\u901a\u8fc7\u9f50\u6b21\u5750\u6807\u548c\u53d8\u6362\u77e9\u9635\uff0c\u4e24\u6b21\u53d8\u6362\u7684\u53e0\u52a0\u5c31\u53ef\u4ee5\u5199\u6210 \\(\\tilde{\\mathbf{c}}=\\mathbf{T}_2\\mathbf{T}_1\\tilde{\\mathbf{a}}\\)","title":"\u53d8\u6362\u77e9\u9635\u4e0e\u9f50\u6b21\u5750\u6807"},{"location":"cv/papers/others/vslam14/lec2/#_6","text":"\u65cb\u8f6c\u77e9\u9635\u548c\u53d8\u6362\u77e9\u9635\u90fd\u5b58\u5728\u4e00\u4e2a\u95ee\u9898\uff0c\u5c31\u662f \u53d8\u91cf\u7684\u5197\u4f59 \u3002\u5df2\u77e5\u4e00\u6b21\u65cb\u8f6c\u4ec5\u6709\u4e09\u4e2a\u81ea\u7531\u5ea6\uff0c\u4f46\u662f\u65cb\u8f6c\u77e9\u9635\u6709\u4e5d\u4e2a\u91cf\uff0c\u7528\u4e5d\u4e2a\u91cf\u8868\u793a\u4e09\u4e2a\u81ea\u7531\u5ea6\uff08\u4ec5\u8868\u793a\u65cb\u8f6c\uff09\uff1b\u53d8\u6362\u77e9\u9635\u670916\u4e2a\u91cf\uff0c\u752816\u4e2a\u91cf\u8868\u793a6\u4e2a\u81ea\u7531\u5ea6\uff08\u5305\u62ec\u65cb\u8f6c\u548c\u5e73\u79fb\uff09\u3002 \u5176\u6b21\uff0c\u65cb\u8f6c\u77e9\u9635\u662f\u4e00\u4e2a\u7279\u6b8a\u77e9\u9635\uff0c\u5373\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u4e14\u884c\u5217\u5f0f\u4e3a1\u3002\u4e14\u8be5\u7279\u6b8a\u6027\u4e5f\u4f1a\u5f71\u54cd\u5230\u53d8\u6362\u77e9\u9635\uff0c\u6240\u4ee5\u5177\u6709\u7279\u6b8a\u6027\u7684\u77e9\u9635\u5728\u540e\u7eed\u7684\u975e\u7ebf\u6027\u4f18\u5316\u4e2d\u4f1a\u5e26\u6765\u989d\u5916\u7684\u7ea6\u675f\uff0c\u5bfc\u81f4\u6c42\u89e3\u56f0\u96be\u3002","title":"\u65cb\u8f6c\u5411\u91cf\u548c\u6b27\u62c9\u89d2"},{"location":"cv/papers/others/vslam14/lec2/#_7","text":"\u65cb\u8f6c\u5411\u91cf=\u4e00\u4e2a\u65cb\u8f6c\u8f74+\u4e00\u4e2a\u65cb\u8f6c\u89d2\u5ea6\u5373\uff1a\u65cb\u8f6c\u5411\u91cf\u7684\u65b9\u5411\u4e3a\u65cb\u8f6c\u8f74\uff0c\u957f\u5ea6\u4e3a\u65cb\u8f6c\u89d2\u5ea6\u3002 \u65cb\u8f6c\u5411\u91cf\u548c\u77e9\u9635\u4e4b\u95f4\u5b58\u5728\u8f6c\u6362\u5173\u7cfb\uff0c\u7528\u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\uff08Rodrigues's Formula\uff09\u8868\u793a\uff1a \\[ \\mathbf{R}=\\cos\\theta\\mathbf{I}+(1-\\cos\\theta)\\mathbf{n}\\mathbf{n}^\\top+\\sin\\theta\\mathbf{n}^\\wedge \\] \u53cd\u4e4b\u4e5f\u53ef\u4ee5\u8ba1\u7b97\u4ece\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\u5230\u65cb\u8f6c\u5411\u91cf\u7684\u8f6c\u6362\u3002\u5bf9\u4e8e\u8f6c\u89d2 \\(\\theta\\) \uff0c\u53d6\u4e24\u8fb9\u7684 \u8ff9 \uff0c\u6709 \\[ tr(\\mathbf{R})=\\cos \\theta \\ tr(\\mathbf{I})+(1-\\cos \\theta)tr(\\mathbf{n}\\mathbf{n}^\\top)+\\sin\\theta \\ tr(\\mathbf{n}^\\wedge) \\\\ tr(\\mathbf{R})=3\\cos\\theta+(1-\\cos\\theta) \\\\ tr(\\mathbf{R})=1+2\\cos\\theta \\\\ \\theta = \\arccos\\left(\\frac{tr(\\mathbf{R})-1}{2}\\right) \\] \u5173\u4e8e\u8f6c\u8f74 \\(\\mathbf{n}\\) \uff0c\u65cb\u8f6c\u8f74\u4e0a\u7684\u5411\u91cf\u5728\u65cb\u8f6c\u540e\u4e0d\u53d8\uff0c\u5373 \\(\\mathbf{Rn}=\\mathbf{n}\\) \uff0c\u56e0\u6b64\u8f6c\u8f74 \\(\\mathbf{n}\\) \u662f\u77e9\u9635 \\(\\mathbf{R}\\) \u7279\u5f81\u503c 1 \u5bf9\u5e94\u7684\u7279\u5f81\u5411\u91cf\u3002 \u7f57\u5fb7\u91cc\u683c\u65af\u516c\u5f0f\u8be6\u7ec6\u63a8\u5bfc","title":"\u65cb\u8f6c\u5411\u91cf"},{"location":"cv/papers/others/vslam14/lec2/#_8","text":"\u6b27\u62c9\u89d2\u662f\u4e00\u79cd\u5c06\u65cb\u8f6c\u5206\u89e3\u4e3a\u4e09\u4e2a\u57fa\u672c\u65cb\u8f6c\u7684\u65b9\u6cd5\uff0c\u5373\u7ed5\u4e09\u4e2a\u5750\u6807\u8f74\u7684\u65cb\u8f6c\u3002\u6b27\u62c9\u89d2\u7684\u8868\u793a\u65b9\u6cd5\u6709\u5f88\u591a\u79cd\uff0c\u4f46\u662f\u6700\u5e38\u7528\u7684\u662f Z-Y-X \u7684\u65cb\u8f6c\u987a\u5e8f\uff0c\u5373\u5148\u7ed5 Z \u8f74\u65cb\u8f6c\uff0c\u518d\u7ed5 Y \u8f74\u65cb\u8f6c\uff0c\u6700\u540e\u7ed5 X \u8f74\u65cb\u8f6c\u3002\u8fd9\u79cd\u65cb\u8f6c\u987a\u5e8f\u4e5f\u53eb \u822a\u5411-\u4fef\u4ef0-\u6eda\u8f6c \uff08yaw-pitch-roll\uff09\u3002 \u4f46\u662f\u5b58\u5728\u4e07\u5411\u9501\u73b0\u8c61\uff1a \u4e07\u5411\u6b7b\u9501 \uff0c\u6240\u4ee5\u4f7f\u6b27\u62c9\u89d2\u5728\u7279\u6b8a\u60c5\u51b5\u4e0b\u4f1a\u51fa\u73b0\u5947\u5f02\u6027\u3002","title":"\u6b27\u62c9\u89d2"},{"location":"cv/papers/others/vslam14/lec2/#_9","text":"","title":"\u56db\u5143\u6570"},{"location":"cv/papers/others/vslam14/lec2/#_10","text":"\u56db\u5143\u6570\u662f\u4e00\u79cd\u6269\u5c55\u590d\u6570\u7684\u65b9\u6cd5\uff0c\u590d\u6570\u7531\u5b9e\u90e8\u548c\u865a\u90e8\u7ec4\u6210\uff0c\u800c\u56db\u5143\u6570\u7531\u5b9e\u90e8\u548c\u4e09\u4e2a\u865a\u90e8\u7ec4\u6210\uff0c\u5373 \\(\\mathbf{q}=q_0+q_1i+q_2j+q_3k\\) \uff0c\u6ee1\u8db3\u4e0b\u9762\u5173\u7cfb\uff1a \\[ \\left\\{\\begin{matrix} i^2 + j^2 + k^2 = -1 \\\\ ij = k, ji = -k \\\\ jk = i, kj = -i \\\\ ki = j, ik = -j \\end{matrix}\\right. \\] \u7528\u4e00\u4e2a\u6807\u91cf\u548c\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff1a \\(\\mathbf{q}=[s,\\mathbf{v}],s=q_0 \\in R, \\mathbf{v}=[q_1,q_2,q_3]^\\top \\in R^3\\) \uff0c\u865a\u90e8\u4e3a 0 \u4e3a\u5b9e\u56db\u5143\u6570\uff0c\u5b9e\u90e8\u4e3a 0 \u4e3a\u865a\u56db\u5143\u6570","title":"\u56db\u5143\u6570\u7684\u5b9a\u4e49"},{"location":"cv/papers/others/vslam14/lec2/#_11","text":"\\(\\mathbf{q}_a \\pm \\mathbf{q}_b = [s_a \\pm s_b, \\mathbf{v}_a \\pm \\mathbf{v}_b]\\) \\(\\mathbf{q}_a \\mathbf{q}_b=[s_as_b-\\mathbf{v}_a^\\top\\mathbf{v}_b,s_a\\mathbf{v}_b+s_b\\mathbf{v}_a+\\mathbf{v}_a\\times \\mathbf{v}_b]^\\top\\) \\(\\parallel \\mathbf{q}_a \\parallel = \\sqrt{s_a^2+x_a^2+y_a^2+z_a^2}\\) \\(\\mathbf{q}_a^*=s_a-x_ai-y_aj-z_ak=[s_a, -\\mathbf{v}_a]^\\top\\) \\(\\mathbf{q}^{-1}=\\mathbf{q}^*/\\parallel \\mathbf{q} \\parallel^2\\) \\(k\\mathbf{q}=[ks, k\\mathbf{v}]\\) \\(\\mathbf{q}_a \\cdot \\mathbf{q}_b=s_as_b+x_ax_bi+y_ay_bj+z_az_bk\\)","title":"\u56db\u5143\u6570\u7684\u8fd0\u7b97"},{"location":"cv/papers/others/vslam14/lec2/#_12","text":"\u4e09\u7ef4\u7a7a\u95f4\u70b9\u7528\u4e00\u4e2a\u865a\u56db\u5143\u6570\u6765\u63cf\u8ff0\uff1a \\(\\mathbf{p}=[0,x,y,z]^\\top=[0,\\mathbf{v}]^\\top\\) \u65cb\u8f6c\u540e\u5230\u70b9 \\(\\mathbf{p}^\\prime\\) \uff1a \\(\\mathbf{p}^\\prime=\\mathbf{qpq}^{-1}\\)","title":"\u7528\u56db\u5143\u6570\u8868\u793a\u65cb\u8f6c"},{"location":"cv/papers/others/vslam14/lec2/#_13","text":"\u8f74\u89d2\u5230\u56db\u5143\u6570\uff1a \\(\\mathbf{q}=[\\cos \\frac{\\theta}{2}, n_x \\sin \\frac{\\theta}{2}, n_y \\frac{\\theta}{2}, n_z \\sin \\frac{\\theta}{2}]^\\top\\) \u56db\u5143\u6570\u5230\u8f74\u89d2\uff1a \\(\\left\\{\\begin{matrix} \\theta=2\\arccos q_0 \\\\ [n_x,n_y,n_z]^\\top=[q_1, q_2, q_3]^\\top / \\sin \\frac{\\theta}{2} \\end{matrix}\\right.\\)","title":"\u56db\u5143\u6570\u5230\u5176\u4ed6\u65cb\u8f6c\u8868\u793a\u7684\u8f6c\u6362"},{"location":"cv/papers/others/vslam14/lec2/#_14","text":"\u89c1 \u591a\u89c6\u56fe\u51e0\u4f55","title":"\u76f8\u4f3c\u3001\u4eff\u5c04\u3001\u5c04\u5f71\u53d8\u6362"},{"location":"cv/papers/others/vslam14/lec2/#eigen","text":"","title":"Eigen \u5e93"},{"location":"cv/papers/others/vslam14/lec2/#install","text":"sudo apt-get install libeigen3-dev # \u5982\u679c\u8981\u5b89\u88c5\u5bf9\u5e94\u7248\u672c\uff0c\u8bf7\u4e0b\u8f7d\u6e90\u7801\u7f16\u8bd1","title":"install"},{"location":"cv/papers/others/vslam14/lec2/#eigen_1","text":"Eigen :: Matrix < type , row , colon > //typedef: Matrix3d, Vector3d... Eigen :: MatrixXd //unkown size matrix matrix ( i , j ) //the value of i th row and j th colon //the operations matrix . transpose (); matrix . trace (); matrix . sum (); matrix . inverse (); matrix . determinant (); //find the proper values and vectors Eigen :: SelfAdjointEigenSolver < Eigen :: Matrix3d > solver ( matrix . transport () * matrix ); solver . eigenvalues (); solver . eigenvectors (); //solve Matrix_NN * x = v_Nd x = matrix_NN . colpivHouseholderQr (). solve ( v_Nd ); // \u65cb\u8f6c\u5411\u91cf\u548c\u65cb\u8f6c\u77e9\u9635 Eigen :: AngleAxisd rotation_vector ( theta , Eigen :: Vector3d ( x , y , z )); //rotation vector rotation_matrix = rotation_vector . toRotationMatrix (); //transform rotation vector to rotation matrix x_rotated = rotation_vector * x ; //calculate rotated vector x' x_rotated = rotation_matrix * x ; //calculate rotated vector x' // \u56db\u5143\u6570 q = Eigen :: Quaterniond ( w , x , y , z ) //create a quaternion from four values q = Eigen :: Quaterniond ( rotation_vector ) //create a quaternion from rotaion vector q = Eigen :: Quaterniond ( rotation_matrix ) //create a quaternion from rotaion matrix x_rotated = q * x //calculate rotated vector x' // \u53d8\u6362\u77e9\u9635 T //create a transform matrix Eigen :: Isometry3d T = Eigen :: Isometry3d :: Identity (); T . rotate ( rotation_vector ); /* T.rotate(rotation_matrix); T.rotate(quaternion); */ T . pretranslate ( Eigen :: Vector3d ( x , y , z ));","title":"Eigen\u4e2d\u77e9\u9635\u7684\u57fa\u672c\u64cd\u4f5c"},{"location":"cv/pcd/","text":"\u4e09\u7ef4\u70b9\u4e91 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\uff0c\u5305\u62ec\u56fe\u50cf\u548c\u70b9\u4e91\u878d\u5408\u7b49\u7684\u76f8\u5173\u7b14\u8bb0 Table of Contents \u00b6 \u70b9\u4e91\u914d\u51c6 Reference \u00b6 \u878d\u5408\u70b9\u4e91\u4e0e\u56fe\u50cf\u7684\u73af\u5883\u76ee\u6807\u68c0\u6d4b\u7814\u7a76\u8fdb\u5c55 \u57fa\u4e8e\u52a8\u6001\u7279\u5f81\u5254\u9664\u7684\u56fe\u50cf\u4e0e\u70b9\u4e91\u878d\u5408\u7684\u673a\u5668\u4eba\u4f4d\u59ff\u4f30\u8ba1\u65b9\u6cd5 \u65e0\u60e7\u8fd0\u52a8\u7269\u4f53\u906e\u6321\uff011.53 ms\uff01CCTNet\uff1aLiDAR\u4f4d\u7f6e\u8bc6\u522b\u6700\u65b0SOTA\uff01SLAM\u56de\u73af\u7a33\u4e86\uff01 CVPR 2022 | TransFusion\uff1a\u7528Transformer\u8fdb\u884c3D\u76ee\u6807\u68c0\u6d4b\u7684\u6fc0\u5149\u96f7\u8fbe-\u76f8\u673a\u878d\u5408 \u4e09\u7ef4\u5730\u56fe\u5b9e\u65f6\u66f4\u65b0\u4e2d\u7684\u52a8\u6001\u969c\u788d\u7269\u5254\u9664 \u70b9\u4e91\u5730\u56fe\u52a8\u6001\u969c\u788d\u7269\u53bb\u9664\u57fa\u51c6 \u57fa\u4e8eTransformer\u76843D\u70b9\u4e91\u76ee\u6807\u68c0\u6d4b\u7b97\u6cd5","title":"\u4e09\u7ef4\u70b9\u4e91"},{"location":"cv/pcd/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\uff0c\u5305\u62ec\u56fe\u50cf\u548c\u70b9\u4e91\u878d\u5408\u7b49\u7684\u76f8\u5173\u7b14\u8bb0","title":"\u4e09\u7ef4\u70b9\u4e91"},{"location":"cv/pcd/#table-of-contents","text":"\u70b9\u4e91\u914d\u51c6","title":"Table of Contents"},{"location":"cv/pcd/#reference","text":"\u878d\u5408\u70b9\u4e91\u4e0e\u56fe\u50cf\u7684\u73af\u5883\u76ee\u6807\u68c0\u6d4b\u7814\u7a76\u8fdb\u5c55 \u57fa\u4e8e\u52a8\u6001\u7279\u5f81\u5254\u9664\u7684\u56fe\u50cf\u4e0e\u70b9\u4e91\u878d\u5408\u7684\u673a\u5668\u4eba\u4f4d\u59ff\u4f30\u8ba1\u65b9\u6cd5 \u65e0\u60e7\u8fd0\u52a8\u7269\u4f53\u906e\u6321\uff011.53 ms\uff01CCTNet\uff1aLiDAR\u4f4d\u7f6e\u8bc6\u522b\u6700\u65b0SOTA\uff01SLAM\u56de\u73af\u7a33\u4e86\uff01 CVPR 2022 | TransFusion\uff1a\u7528Transformer\u8fdb\u884c3D\u76ee\u6807\u68c0\u6d4b\u7684\u6fc0\u5149\u96f7\u8fbe-\u76f8\u673a\u878d\u5408 \u4e09\u7ef4\u5730\u56fe\u5b9e\u65f6\u66f4\u65b0\u4e2d\u7684\u52a8\u6001\u969c\u788d\u7269\u5254\u9664 \u70b9\u4e91\u5730\u56fe\u52a8\u6001\u969c\u788d\u7269\u53bb\u9664\u57fa\u51c6 \u57fa\u4e8eTransformer\u76843D\u70b9\u4e91\u76ee\u6807\u68c0\u6d4b\u7b97\u6cd5","title":"Reference"},{"location":"cv/pcd/pcr/","text":"\u70b9\u4e91\u914d\u51c6 \u00b6 Abstract \u70b9\u4e91\u914d\u51c6\u662f\u6211\u8bfb\u7814\u65f6\u7684\u7814\u7a76\u65b9\u5411\uff0c\u4e3b\u8981\u4e3a\u81ea\u76d1\u7763\u4ee5\u53ca\u7528\u4e8e\u8154\u5185\u73af\u5883 \u9664\u4e86\u4f20\u7edf\u65b9\u6cd5ICP\u4e4b\u5916\uff0c\u4e3b\u8981\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a \u7aef\u5230\u7aef \u63d0\u53d6\u7279\u5f81\u70b9 Table of Contents \u00b6 \u524d\u7f6e\u77e5\u8bc6 ICP Reference \u00b6 \u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\u914d\u51c6","title":"\u70b9\u4e91\u914d\u51c6"},{"location":"cv/pcd/pcr/#_1","text":"Abstract \u70b9\u4e91\u914d\u51c6\u662f\u6211\u8bfb\u7814\u65f6\u7684\u7814\u7a76\u65b9\u5411\uff0c\u4e3b\u8981\u4e3a\u81ea\u76d1\u7763\u4ee5\u53ca\u7528\u4e8e\u8154\u5185\u73af\u5883 \u9664\u4e86\u4f20\u7edf\u65b9\u6cd5ICP\u4e4b\u5916\uff0c\u4e3b\u8981\u65b9\u6cd5\u6709\u4e24\u79cd\uff1a \u7aef\u5230\u7aef \u63d0\u53d6\u7279\u5f81\u70b9","title":"\u70b9\u4e91\u914d\u51c6"},{"location":"cv/pcd/pcr/#table-of-contents","text":"\u524d\u7f6e\u77e5\u8bc6 ICP","title":"Table of Contents"},{"location":"cv/pcd/pcr/#reference","text":"\u5b66\u4e60\u4e09\u7ef4\u70b9\u4e91\u914d\u51c6","title":"Reference"},{"location":"cv/pcd/pcr/icp/","text":"ICP \u00b6 \u7ea6 2610 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract ICP\uff08Iterative Closest Point\uff09\u662f\u4e00\u79cd\u8fed\u4ee3\u7b97\u6cd5\uff0c\u7528\u4e8e\u5c06\u4e24\u7ec4\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u5373\u627e\u5230\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u6700\u4f18\u521a\u4f53\u53d8\u6362\uff08\u65cb\u8f6c\u77e9\u9635\u548c\u5e73\u79fb\u5411\u91cf\uff09\uff0c\u4f7f\u5f97\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u8bef\u5dee\u6700\u5c0f\u5316\u3002 \u95ee\u9898\u63cf\u8ff0 \u00b6 \u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\u6307\u7684\u662f\u8f93\u5165\u4e24\u5e45\u70b9\u4e91 \\(P_s\\) \uff08source\uff09\u548c \\(P_t\\) \uff08target\uff09\uff0c\u8f93\u51fa\u4e00\u4e2a\u53d8\u6362 \\(T\\) \u4f7f\u5f97 \\(T(P_s)\\) \u548c \\(P_t\\) \u7684\u91cd\u5408\u7a0b\u5ea6\u5c3d\u53ef\u80fd\u9ad8\u3002\u53d8\u6362 \\(T\\) \u53ef\u4ee5\u662f\u521a\u6027\u7684(rigid)\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u662f\uff0c\u672c\u6587\u53ea\u8003\u8651\u521a\u6027\u53d8\u6362\uff0c\u5373\u53d8\u6362\u53ea\u5305\u62ec\u65cb\u8f6c\u3001\u5e73\u79fb\u3002 \u76ee\u524d\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u70b9\u4e91\u7cbe\u914d\u51c6\u7b97\u6cd5\u662f\u8fed\u4ee3\u6700\u8fd1\u70b9\u7b97\u6cd5\uff08Iterative Closest Point, ICP\uff09\u53ca\u5404\u79cd\u53d8\u79cd ICP \u7b97\u6cd5\u3002 \u7b97\u6cd5\u63cf\u8ff0 \u00b6 \u5bf9\u4e8e \\(T\\) \u662f\u521a\u6027\u53d8\u6362\u7684\u60c5\u5f62\uff0c\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u53ef\u4ee5\u63cf\u8ff0\u4e3a\uff1a \\[ R^\\ast, t^\\ast = \\argmin_{R, t} \\frac{1}{|P_s|} \\sum_{i=1}^{|P_s|} \\| p_t^i - (R \\cdot p_s^i + t) \\|^2 \\] \u8fd9\u91cc \\(p_s\\) \u548c \\(p_t\\) \u662f\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u4e00\u4e00\u5bf9\u5e94\u70b9\u3002 ICP \u7b97\u6cd5\u7684\u76f4\u89c2\u60f3\u6cd5\uff1a \u5982\u679c\u6211\u4eec\u77e5\u9053\u4e24\u5e45\u70b9\u4e91\u4e0a\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u90a3\u4e48\u53ef\u4ee5\u7528 Least Squares \u6765\u6c42\u89e3 R\uff0ct \u53c2\u6570\u3002 \u600e\u4e48\u77e5\u9053\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u5462\uff1f\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e86\u4e00\u4e2a\u5927\u6982\u9760\u8c31\u7684 R\uff0ct \u53c2\u6570\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u8d2a\u5fc3\u7684\u65b9\u5f0f\u627e\u4e24\u5e45\u70b9\u4e91\u4e0a\u7684\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff08\u76f4\u63a5\u627e\u8ddd\u79bb\u6700\u8fd1\u7684\u70b9\u4f5c\u4e3a\u5bf9\u5e94\u70b9\uff09\u3002 ICP \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5c31\u662f\u4ea4\u66ff\u8fdb\u884c\u4e0a\u8ff0\u4e24\u4e2a\u6b65\u9aa4\uff0c\u8fed\u4ee3\u8fdb\u884c\u8ba1\u7b97\uff0c\u76f4\u5230\u6536\u655b\u3002 ICP \u7b97\u6cd5\u6d41\u7a0b \u70b9\u4e91\u9884\u5904\u7406\uff1a\u6ee4\u6ce2\u3001\u6e05\u7406\u6570\u636e\u7b49 \u5339\u914d\uff1a\u5e94\u7528\u4e0a\u4e00\u6b65\u6c42\u89e3\u51fa\u7684\u53d8\u6362\uff0c\u627e\u6700\u8fd1\u70b9 \u52a0\u6743\uff1a\u8c03\u6574\u4e00\u4e9b\u5bf9\u5e94\u70b9\u5bf9\u7684\u6743\u91cd \u63d0\u51fa\u4e0d\u5408\u7406\u7684\u5bf9\u5e94\u70b9\u5bf9 \u8ba1\u7b97 loss \u6700\u5c0f\u5316 loss\uff0c\u6c42\u89e3\u5f53\u524d\u6700\u4f18\u53d8\u6362 \u56de\u5230 2\uff0c\u8fdb\u884c\u8fed\u4ee3\uff0c\u76f4\u5230\u6536\u655b \u6574\u4f53\u4e0a\u6765\u770b\uff0cICP \u628a\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u62c6\u5206\u6210\u4e24\u4e2a\u5b50\u95ee\u9898\uff1a \u627e\u6700\u8fd1\u70b9 \u627e\u6700\u4f18\u53d8\u6362 \u627e\u6700\u8fd1\u5bf9\u5e94\u70b9 \u00b6 \u5229\u7528\u521d\u59cb \\(R_0\u3001t_0\\) \u6216\u4e0a\u4e00\u6b21\u8fed\u4ee3\u5f97\u5230\u7684 \\(R_{k-1}\u3001t_{k-1}\\) \u5bf9\u521d\u59cb\u70b9\u4e91\u8fdb\u884c\u53d8\u6362\uff0c\u5f97\u5230\u4e00\u4e2a\u4e34\u65f6\u7684\u53d8\u6362\u70b9\u4e91\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u6bd4\u8f83\uff0c\u627e\u51fa\u6e90\u70b9\u4e91\u4e2d\u6bcf\u4e00\u4e2a\u70b9\u5728\u76ee\u6807\u70b9\u4e91\u4e2d\u7684\u6700\u8fd1\u90bb\u70b9\u3002 \u5982\u679c\u76f4\u63a5\u8fdb\u884c\u6bd4\u8f83\u6700\u8fd1\u90bb\u70b9\uff0c\u9700\u8981\u8fdb\u884c\u4e24\u91cd\u5faa\u73af\uff0c\u8ba1\u7b97\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(|P_s| \\cdot |P_t|)\\) \uff0c\u8fd9\u4e00\u6b65\u6bd4\u8f83\u8017\u65f6\uff0c\u5e38\u89c1\u7684\u52a0\u901f\u65b9\u6cd5\u6709\uff1a \u8bbe\u7f6e\u8ddd\u79bb\u9608\u503c\uff0c\u5f53\u70b9\u4e0e\u70b9\u8ddd\u79bb\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u5c31\u8ba4\u4e3a\u627e\u5230\u4e86\u5bf9\u5e94\u70b9\uff0c\u4e0d\u7528\u904d\u5386\u5b8c\u6574\u4e2a\u70b9\u96c6\u3002 \u4f7f\u7528 ANN \u52a0\u901f\u67e5\u627e\uff0c\u5e38\u89c1\u7684\u6709 KD-tree\u3002KD-tree \u5efa\u6811\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(N \\log N)\\) \uff0c\u67e5\u627e\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(\\log N)\\) \uff08\u6700\u574f\u60c5\u51b5\u4e0b\u4e3a \\(\\mathcal{O}(N)\\) \uff09\u3002 \u6c42\u89e3\u6700\u4f18\u53d8\u6362 \u00b6 \u5bf9\u4e8e point-to-point ICP \u95ee\u9898\uff0c\u6c42\u6700\u4f18\u53d8\u6362\u662f\u6709\u95ed\u5f62\u5f0f\u89e3\uff08closed-form solution\uff09\u7684\uff0c\u53ef\u4ee5\u501f\u52a9 SVD \u5206\u89e3\u6765\u8ba1\u7b97\u3002 \u7ed3\u8bba\uff1a\u5728\u5df2\u77e5\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u7684\u60c5\u51b5\u4e0b\uff0c\u8bbe \\(\\overline{p}_s, \\overline{p}_t\\) \u5206\u522b\u8868\u793a\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff0c\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\overline{p}_s\uff0c\\hat{p}_t^i=p_t^i-\\overline{p}_t\\) \uff0c\u4ee4 \\(H=\\sum_{i=1}^{|P_s|}\\hat{p}_s^i \\hat{p}_t^{i^\\top}\\) \uff0c\u8fd9\u662f\u4e00\u4e2a \\(3 \\times 3\\) \u7684\u53e5\u5b50\uff0c\u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\u5f97\u5230 \\(H=U\\Sigma V^\\top\\) \uff0c\u5219 point-to-point ICP \u95ee\u9898\u6700\u4f18\u65cb\u8f6c\u4e3a\uff1a \\[R^{\\ast} = V U^\\top\\] \u6700\u4f18\u5e73\u79fb\u4e3a\uff1a \\[t^{\\ast} = \\overline{p}_t - R^\\ast \\hat{p}_s\\] \u8ba1\u7b97\u6700\u4f18\u5e73\u79fb \u00b6 \u4ee4 \\(N=|P_s|\\) \uff0c\u8bbe \\(F(t)=\\sum_{i=1}^N \\|(R \\cdot p_s^i + t) - p_t^i \\|^2\\) \uff0c\u5bf9\u5176\u8fdb\u884c\u6c42\u5bfc\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} \\frac{\\partial F}{\\partial t} &= \\sum_{i=1}^{N} 2 (R \\cdot p_s^i + t - p_t^i) \\\\ &= 2nt + 2R\\sum_{i=1}^{N}p_s^i - 2\\sum_{i=1}^{N}p_t^i \\end{aligned} \\] \u4ee4\u5bfc\u6570\u4e3a 0\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} t &= \\frac{1}{N} \\sum_{i=1}^{N} p_t^i - R \\frac{1}{N} \\sum_{i=1}^{N} p_s^i \\\\ &= \\bar p_t - R \\bar p_s \\end{aligned} \\] \u65e0\u8bba R \u53d6\u503c\u5982\u4f55\uff0c\u6839\u636e\u4e0a\u5f0f\u90fd\u53ef\u4ee5\u6c42\u5f97\u6700\u4f18\u7684 t\uff0c\u4f7f\u5f97 loss \u6700\u5c0f\u3002 \u8ba1\u7b97\u6700\u4f18\u65cb\u8f6c \u00b6 \u7ecf\u8fc7\u6700\u4f18\u5e73\u79fb\u7684\u63a8\u5bfc\uff0c\u77e5\u9053\u65e0\u8bba\u65cb\u8f6c\u5982\u4f55\u53d6\u503c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u8ba1\u7b97\u70b9\u4e91\u7684\u8d28\u5fc3\u6765\u5f97\u5230\u6700\u4f18\u5e73\u79fb\uff0c\u4e3a\u4e86\u8ba1\u7b97\u65b9\u4fbf\uff0c\u4e0d\u59a8\u4e0d\u8003\u8651\u5e73\u79fb\u7684\u5f71\u54cd\uff0c\u5148\u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u4e0b\uff0c\u8fd9\u4e5f\u5c31\u662f\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\hat{p}_s, \\hat{p}_t^i=p_t^i-\\hat{p}_t\\) \u7684\u610f\u4e49\u3002 \u4e0b\u9762\u7528 \\(\\hat{p}_s^i\\) \u548c \\(\\hat{p}_t^i\\) \u8fdb\u884c\u63a8\u5bfc\u3002\u4e0d\u8003\u8651\u5e73\u79fb\uff0c\u5219 loss \u53ef\u4ee5\u5199\u6210\uff1a \\[ F(R) = \\sum_{i=1}^{N} \\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2 \\] \u5148\u7b80\u5316 \\(\\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2\\) \uff1a \\[ \\begin{aligned} \\|R \\cdot \\hat p_s^i - \\hat p_t^i\\|^2 &= (R \\cdot \\hat p_s^i - \\hat p_t^i)^\\top(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= ({\\hat p_s^i}^\\top R^\\top - {\\hat p_t^i}^\\top)(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= {\\hat p_s^i}^\\top R^\\top R {\\hat p_s^i} - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} + {\\hat p_t^i}^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - 2{\\hat p_t^i}^\\top R {\\hat p_s^i} \\end{aligned} \\] \u8fd9\u91cc\u5229\u7528 \\(R^\\top R=I\\) \u548c \\({\\hat p_t^i}^\\top R {\\hat p_s^i} = {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i}\\) \uff08\u6807\u91cf\u7684\u8f6c\u7f6e\u7b49\u4e8e\u81ea\u8eab\uff09\u7684\u6027\u8d28\u3002 \u7531\u4e8e\u70b9\u7684\u5750\u6807\u662f\u786e\u5b9a\u7684\uff08\u548c R \u65e0\u5173\uff09\uff0c\u6240\u4ee5\u6700\u5c0f\u5316\u539f loss \u7b49\u4ef7\u4e8e\u6c42\uff1a \\[ R^{\\ast} = \\argmin_R (-2 \\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u4e5f\u5373\u4e3a\u6c42\uff1a \\[ R^{\\ast} = \\argmax_R (\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u6ce8\u610f\u5230 \\(\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i} = trace(P_t^\\top R P_s)\\) \uff08\u7531\u77e9\u9635\u4e58\u6cd5\u53ca trace \u7684\u5b9a\u4e49\u53ef\u5f97\uff09\uff0c\u6240\u4ee5\u95ee\u9898\u8f6c\u5316\u4e3a\uff1a \\[ R^{\\ast} = \\argmax_{R} \\ trace(P_t^\\top R P_s) \\] \u6839\u636e trace \u7684\u6027\u8d28 \\(trace(AB)=trace(BA)\\) \uff0c\uff08\u8fd9\u91cc\u4e0d\u8981\u6c42 A \u548c B \u662f\u65b9\u9635\uff0c\u53ea\u8981 A*B \u662f\u65b9\u9635\u5373\u53ef\uff09\uff0c\u6709\uff1a \\[trace(P_t^\\top RP_s)=trace(RP_sP_t^\\top)\\] \u5728\u5229\u7528\u524d\u9762\u5b9a\u4e49\u7684\u77e9\u9635 H \u548c\u5176 SVD \u5206\u89e3\uff0c\u5e26\u5165\u4e0a\u5f0f\u5f97\u5230\uff1a \\[ \\begin{aligned} trace(P_t^\\top R P_s) &= trace(R P_s P_t^\\top) \\\\ &= trace(R H) \\\\ &= trace(R U \\Sigma V^\\top) \\\\ &= trace(\\Sigma V^\\top R U) \\end{aligned} \\] \u6ce8\u610f\u8fd9\u91cc\u7684 \\(V,U,R\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u6240\u4ee5 \\(V^\\top RU\\) \u4e5f\u662f\u6b63\u4ea4\u77e9\u9635\u3002 \u4ee4 \\(M=V^\\top RU=\\begin{bmatrix} m_{11} & m_{12} & m_{13} \\\\ m_{21} & m_{22} & m_{23} \\\\ m_{31} & m_{32} & m_{33} \\end{bmatrix}\\) \uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} trace(\\Sigma V^\\top R U) &= trace(\\Sigma M) \\\\ & = \\sigma_1 m_{11} + \\sigma_2 m_{22} + \\sigma_1 m_{33} \\end{aligned} \\] \u6839\u636e\u5947\u5f02\u503c\u975e\u8d1f\u7684\u6027\u8d28\u548c\u6b63\u4ea4\u77e9\u9635\u7684\u6027\u8d28\uff08\u6b63\u4ea4\u77e9\u9635\u4e2d\u7684\u5143\u7d20\u7edd\u5bf9\u503c\u4e0d\u5927\u4e8e 1\uff09\uff0c\u5bb9\u6613\u8bc1\u5f97\u53ea\u6709\u5f53 \\(M\\) \u4e3a\u5355\u4f4d\u9635\u65f6 \\(trace(\\Sigma M)\\) \u6700\u5927\uff0c\u5373\uff1a \\[ V^\\top RU = I \\\\ R = VU^\\top \\] \u6240\u4ee5\u6709 \\(R^\\ast = VU^\\top\\) \u3002 \u6700\u540e\u8fd8\u9700\u8981\u8fdb\u884c Orientation rectification\uff0c\u5373\u9a8c\u8bc1 \\(R^\\ast = VU^\\top\\) \u662f\u4e0d\u662f\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\uff08\u68c0\u67e5\u662f\u5426\u6709 \\(|R|=1\\) \uff09\uff0c\u56e0\u4e3a\u5b58\u5728 \\(|R|=-1\\) \u7684\u53ef\u80fd\uff0c\u6b64\u65f6 \\(R\\) \u8868\u793a\u7684\u4e0d\u662f\u65cb\u8f6c\u800c\u662f\u4e00\u4e2a reflection\uff0c\u6240\u4ee5\u8fd8\u8981\u7ed9\u4e0a\u8ff0\u4f18\u5316\u6c42\u89e3\u52a0\u4e0a\u4e00\u4e2a \\(|R|=1\\) \u7684\u7ea6\u675f\u3002 \u6839\u636e\u77e9\u9635\u884c\u5217\u5f0f\u7684\u6027\u8d28\uff0c\u4ee5\u53ca \\(U,V\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff1a \\[ \\begin{aligned} |M| &= |V^\\top| |U| |R| \\\\ &= |V^\\top| |U| = \\pm 1 \\end{aligned} \\] \u5982\u679c \\(|VU^\\top|=1\\) \uff0c\u5219 \\(|M|=1\uff0cR^\\ast = VU^\\top\\) \u5df2\u7ecf\u7ed9\u51fa\u6700\u4f18\u65cb\u8f6c\uff1b\u5982\u679c \\(|VU^\\top|=-1\\) \uff0c\u5219 \\(|M|=-1\\) \uff0c\u6211\u4eec\u9700\u8981\u6c42\u89e3\u6b64\u65f6\u7684 \\(R\\) \uff0c\u4e5f\u5c31\u662f\u5206\u6790 \\(M\\) \u5e94\u8be5\u5177\u6709\u4f55\u79cd\u5f62\u5f0f\u3002\u5177\u4f53\u7684\u8ba8\u8bba\u53c2\u8003 \u539f\u8bba\u6587 \uff0c\u8fd9\u91cc\u7ed9\u51fa\u7ed3\u8bba\uff1a\u5f53 \\(|M|=-1\\) \u65f6\uff0c\u4f7f\u5f97 \\(trace(\\Sigma M)\\) \u6700\u5927\u7684 \\(M\\) \u4e3a\uff1a \\[M = \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & -1 \\end{array} \\right]\\] \u7efc\u5408\u8003\u8651 \\(|M|=1\\) \u548c \\(|M|=-1\\) \u4e24\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\uff1a \\[ R^{\\ast} = V \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & |V U^\\top| \\end{array} \\right] U^\\top \\] \u5230\u6b64\u516c\u5f0f\u63a8\u5bfc\u5b8c\u5168\uff0c\u7b80\u5355\u603b\u7ed3\u4e00\u4e0b\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u7684\u6b65\u9aa4\uff1a \u8ba1\u7b97\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff1b \u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u7cfb\uff1b \u8ba1\u7b97\u77e9\u9635 H\uff08\u5f62\u5f0f\u7c7b\u4f3c\u201c\u534f\u65b9\u5dee\u77e9\u9635\u201d\uff09\uff1b \u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\uff0c\u6839\u636e\u516c\u5f0f\u6c42\u5f97 \\(R^\\ast\\) \uff1b \u6839\u636e\u516c\u5f0f\u8ba1\u7b97 \\(t^\\ast\\) \uff1b \u8fed\u4ee3 \u00b6 \u6bcf\u4e00\u6b21\u8fed\u4ee3\u90fd\u4f1a\u5f97\u5230\u5f53\u524d\u7684\u6700\u4f18\u53d8\u6362\u53c2\u6570 \\(R_k,t_k\\) \uff0c\u7136\u540e\u5c06\u8be5\u53d8\u6362\u4f5c\u7528\u4e8e\u5f53\u524d\u6e90\u70b9\u4e91\uff1b\u201c\u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u201d\u548c\u201c\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u201d\u8fd9\u4e24\u6b65\u4e0d\u505c\u8fed\u4ee3\u8fdb\u884c\uff0c\u76f4\u5230\u6ee1\u8db3\u8fed\u4ee3\u7ec8\u6b62\u6761\u4ef6\uff0c\u5e38\u7528\u7684\u7ec8\u6b62\u6761\u4ef6\u6709\uff1a \\(R_k,t_k\\) \u7684\u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c loss \u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c \u8fbe\u5230\u6700\u5927\u8fed\u4ee3\u6b21\u6570 ICP \u7684\u4f18\u7f3a\u70b9\u53ca\u4e00\u4e9b\u6539\u8fdb\u7b97\u6cd5 \u00b6 ICP \u4f18\u70b9 \u7b80\u5355\uff0c\u4e0d\u5fc5\u5bf9\u70b9\u4e91\u8fdb\u884c\u5206\u5272\u548c\u7279\u5f81\u63d0\u53d6 \u521d\u503c\u8f83\u597d\u60c5\u51b5\u4e0b\uff0c\u7cbe\u5ea6\u548c\u6536\u655b\u6027\u90fd\u4e0d\u9519 ICP \u7f3a\u70b9 \u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u7684\u8ba1\u7b97\u5f00\u9500\u8f83\u5927 \u53ea\u8003\u8651\u4e86\u70b9\u4e0e\u70b9\u8ddd\u79bb\uff0c\u7f3a\u5c11\u5bf9\u70b9\u4e91\u7ed3\u6784\u4fe1\u606f\u7684\u5229\u7528 \u539f\u59cb\u7684 ICP \u7b97\u6cd5\u8ba1\u7b97\u5f00\u9500\u5927\uff0c\u5bf9\u521d\u59cb\u53d8\u6362\u654f\u611f\uff0c\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\u89e3\u3002\u81ea ICP \u63d0\u51fa\u4ee5\u6765\uff0c\u6709\u76f8\u5f53\u591a\u7684 ICP \u6539\u8fdb\u7b97\u6cd5\uff0c\u7b80\u8981\u5217\u4e3e\u4e00\u4e9b\uff1a Point-to-Plane ICP\uff0c\u539f\u59cb ICP \u7b97\u6cd5\u7684\u4ee3\u4ef7\u51fd\u6570\u4e2d\u4f7f\u7528\u7684 point-to-point \u8ddd\u79bb\uff0cpoint-to-plane \u5219\u662f\u8003\u8651\u6e90\u9876\u70b9\u5230\u76ee\u6807\u9876\u70b9\u6240\u5728\u9762\u7684\u8ddd\u79bb\uff0c\u6bd4\u8d77\u76f4\u63a5\u8ba1\u7b97\u70b9\u5230\u70b9\u8ddd\u79bb\uff0c\u8003\u8651\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u7cbe\u5ea6\u66f4\u9ad8\uff0c\u4e0d\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\uff1b\u4f46\u8981\u6ce8\u610f point-to-plane \u7684\u4f18\u5316\u662f\u4e00\u4e2a\u975e\u7ebf\u6027\u95ee\u9898\uff0c\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u4e00\u822c\u4f7f\u7528\u5176\u7ebf\u6027\u5316\u8fd1\u4f3c\uff1b Plane-to-Plane ICP\uff0cpoint-to-plane \u53ea\u8003\u8651\u76ee\u6807\u70b9\u4e91\u5c40\u90e8\u7ed3\u6784\uff0c plane-to-plane \u987e\u540d\u601d\u4e49\u5c31\u662f\u4e5f\u8003\u8651\u6e90\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u8ba1\u7b97\u9762\u5230\u9762\u7684\u8ddd\u79bb\uff1b Generalized ICP (GICP)\uff0c\u7efc\u5408\u8003\u8651 point-to-point\u3001point-to-plane \u548c plane-to-plane \u7b56\u7565\uff0c\u7cbe\u5ea6\u3001\u9c81\u68d2\u6027\u90fd\u6709\u6240\u63d0\u9ad8\uff1b Normal Iterative Closest Point (NICP)\uff0c\u8003\u8651\u6cd5\u5411\u91cf\u548c\u5c40\u90e8\u66f2\u7387\uff0c\u66f4\u8fdb\u4e00\u6b65\u5229\u7528\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\u4fe1\u606f\uff0c\u5176\u8bba\u6587\u4e2d\u5b9e\u9a8c\u7ed3\u679c\u6bd4 GICP \u7684\u6027\u80fd\u66f4\u597d\u3002 \u5b9e\u9645\u4f7f\u7528\u4e2d\u7684\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879 \u00b6 ICP \u6bd4\u8f83\u4f9d\u8d56\u4e8e\u53d8\u6362\u521d\u503c\uff0c\u5e73\u79fb\u6bd4\u8f83\u7b80\u5355\uff0c\u76f4\u63a5\u7528\u70b9\u4e91\u8d28\u5fc3\u6765\u4f30\u8ba1\uff1b\u65cb\u8f6c\u521d\u503c\u7684\u8bdd\u53ef\u4ee5\u624b\u52a8\u8c03\u4e00\u4e2a\u7c97\u7565\u503c\uff0c\u6216\u8005\u6cbf\u6bcf\u4e2a\u8f74\u7684\u65cb\u8f6c\u8fdb\u884c\u91c7\u6837\u3001\u7ec4\u5408\u6765\u5c1d\u8bd5\uff08\u4e0d\u9002\u5408\u5b9e\u65f6\u6027\u5e94\u7528\uff09\uff1b \u70b9\u592a\u591a\u7684\u8bdd\u53ef\u4ee5\u5148\u964d\u91c7\u6837\uff1b \u627e\u5230\u4e00\u4e9b anchor \u70b9\u5bf9\uff08\u6bd4\u5982\u5148\u7528\u7279\u5f81\u70b9\u5339\u914d\uff09\uff0c\u53ef\u4ee5\u5e2e\u52a9\u52a0\u901f\u6536\u655b\uff1b \u5bf9\u5e94\u7528\u573a\u666f\u5f15\u5165\u4e00\u4e9b\u5408\u7406\u5047\u8bbe\uff0c\u6bd4\u5982\u9650\u5236\u65cb\u8f6c\u3001\u5e73\u79fb\u7684\u8303\u56f4\uff0c\u53d8\u6362\u81ea\u7531\u5ea6\u6570\u91cf\u7b49\u3002 Reference \u00b6 \u70b9\u4e91\u914d\u51c6\u5b66\u4e60\u7b14\u8bb0-ICP\uff081\uff09 \u4e09\u7ef4\u70b9\u4e91\u914d\u51c6 -- ICP \u7b97\u6cd5 https://igl.ethz.ch/projects/ARAP/svd_rot.pdf https://courses.cs.duke.edu//spring07/cps296.2/scribe_notes/lecture24.pdf","title":"ICP"},{"location":"cv/pcd/pcr/icp/#icp","text":"\u7ea6 2610 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract ICP\uff08Iterative Closest Point\uff09\u662f\u4e00\u79cd\u8fed\u4ee3\u7b97\u6cd5\uff0c\u7528\u4e8e\u5c06\u4e24\u7ec4\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u5373\u627e\u5230\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u6700\u4f18\u521a\u4f53\u53d8\u6362\uff08\u65cb\u8f6c\u77e9\u9635\u548c\u5e73\u79fb\u5411\u91cf\uff09\uff0c\u4f7f\u5f97\u4e24\u7ec4\u70b9\u4e91\u4e4b\u95f4\u7684\u8bef\u5dee\u6700\u5c0f\u5316\u3002","title":"ICP"},{"location":"cv/pcd/pcr/icp/#_1","text":"\u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\u6307\u7684\u662f\u8f93\u5165\u4e24\u5e45\u70b9\u4e91 \\(P_s\\) \uff08source\uff09\u548c \\(P_t\\) \uff08target\uff09\uff0c\u8f93\u51fa\u4e00\u4e2a\u53d8\u6362 \\(T\\) \u4f7f\u5f97 \\(T(P_s)\\) \u548c \\(P_t\\) \u7684\u91cd\u5408\u7a0b\u5ea6\u5c3d\u53ef\u80fd\u9ad8\u3002\u53d8\u6362 \\(T\\) \u53ef\u4ee5\u662f\u521a\u6027\u7684(rigid)\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u662f\uff0c\u672c\u6587\u53ea\u8003\u8651\u521a\u6027\u53d8\u6362\uff0c\u5373\u53d8\u6362\u53ea\u5305\u62ec\u65cb\u8f6c\u3001\u5e73\u79fb\u3002 \u76ee\u524d\u5e94\u7528\u6700\u5e7f\u6cdb\u7684\u70b9\u4e91\u7cbe\u914d\u51c6\u7b97\u6cd5\u662f\u8fed\u4ee3\u6700\u8fd1\u70b9\u7b97\u6cd5\uff08Iterative Closest Point, ICP\uff09\u53ca\u5404\u79cd\u53d8\u79cd ICP \u7b97\u6cd5\u3002","title":"\u95ee\u9898\u63cf\u8ff0"},{"location":"cv/pcd/pcr/icp/#_2","text":"\u5bf9\u4e8e \\(T\\) \u662f\u521a\u6027\u53d8\u6362\u7684\u60c5\u5f62\uff0c\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u53ef\u4ee5\u63cf\u8ff0\u4e3a\uff1a \\[ R^\\ast, t^\\ast = \\argmin_{R, t} \\frac{1}{|P_s|} \\sum_{i=1}^{|P_s|} \\| p_t^i - (R \\cdot p_s^i + t) \\|^2 \\] \u8fd9\u91cc \\(p_s\\) \u548c \\(p_t\\) \u662f\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u4e00\u4e00\u5bf9\u5e94\u70b9\u3002 ICP \u7b97\u6cd5\u7684\u76f4\u89c2\u60f3\u6cd5\uff1a \u5982\u679c\u6211\u4eec\u77e5\u9053\u4e24\u5e45\u70b9\u4e91\u4e0a\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff0c\u90a3\u4e48\u53ef\u4ee5\u7528 Least Squares \u6765\u6c42\u89e3 R\uff0ct \u53c2\u6570\u3002 \u600e\u4e48\u77e5\u9053\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u5462\uff1f\u5982\u679c\u6211\u4eec\u77e5\u9053\u4e86\u4e00\u4e2a\u5927\u6982\u9760\u8c31\u7684 R\uff0ct \u53c2\u6570\uff0c\u90a3\u4e48\u53ef\u4ee5\u901a\u8fc7\u8d2a\u5fc3\u7684\u65b9\u5f0f\u627e\u4e24\u5e45\u70b9\u4e91\u4e0a\u7684\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\uff08\u76f4\u63a5\u627e\u8ddd\u79bb\u6700\u8fd1\u7684\u70b9\u4f5c\u4e3a\u5bf9\u5e94\u70b9\uff09\u3002 ICP \u7b97\u6cd5\u5b9e\u9645\u4e0a\u5c31\u662f\u4ea4\u66ff\u8fdb\u884c\u4e0a\u8ff0\u4e24\u4e2a\u6b65\u9aa4\uff0c\u8fed\u4ee3\u8fdb\u884c\u8ba1\u7b97\uff0c\u76f4\u5230\u6536\u655b\u3002 ICP \u7b97\u6cd5\u6d41\u7a0b \u70b9\u4e91\u9884\u5904\u7406\uff1a\u6ee4\u6ce2\u3001\u6e05\u7406\u6570\u636e\u7b49 \u5339\u914d\uff1a\u5e94\u7528\u4e0a\u4e00\u6b65\u6c42\u89e3\u51fa\u7684\u53d8\u6362\uff0c\u627e\u6700\u8fd1\u70b9 \u52a0\u6743\uff1a\u8c03\u6574\u4e00\u4e9b\u5bf9\u5e94\u70b9\u5bf9\u7684\u6743\u91cd \u63d0\u51fa\u4e0d\u5408\u7406\u7684\u5bf9\u5e94\u70b9\u5bf9 \u8ba1\u7b97 loss \u6700\u5c0f\u5316 loss\uff0c\u6c42\u89e3\u5f53\u524d\u6700\u4f18\u53d8\u6362 \u56de\u5230 2\uff0c\u8fdb\u884c\u8fed\u4ee3\uff0c\u76f4\u5230\u6536\u655b \u6574\u4f53\u4e0a\u6765\u770b\uff0cICP \u628a\u70b9\u4e91\u914d\u51c6\u95ee\u9898\u62c6\u5206\u6210\u4e24\u4e2a\u5b50\u95ee\u9898\uff1a \u627e\u6700\u8fd1\u70b9 \u627e\u6700\u4f18\u53d8\u6362","title":"\u7b97\u6cd5\u63cf\u8ff0"},{"location":"cv/pcd/pcr/icp/#_3","text":"\u5229\u7528\u521d\u59cb \\(R_0\u3001t_0\\) \u6216\u4e0a\u4e00\u6b21\u8fed\u4ee3\u5f97\u5230\u7684 \\(R_{k-1}\u3001t_{k-1}\\) \u5bf9\u521d\u59cb\u70b9\u4e91\u8fdb\u884c\u53d8\u6362\uff0c\u5f97\u5230\u4e00\u4e2a\u4e34\u65f6\u7684\u53d8\u6362\u70b9\u4e91\uff0c\u7136\u540e\u7528\u8fd9\u4e2a\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u6bd4\u8f83\uff0c\u627e\u51fa\u6e90\u70b9\u4e91\u4e2d\u6bcf\u4e00\u4e2a\u70b9\u5728\u76ee\u6807\u70b9\u4e91\u4e2d\u7684\u6700\u8fd1\u90bb\u70b9\u3002 \u5982\u679c\u76f4\u63a5\u8fdb\u884c\u6bd4\u8f83\u6700\u8fd1\u90bb\u70b9\uff0c\u9700\u8981\u8fdb\u884c\u4e24\u91cd\u5faa\u73af\uff0c\u8ba1\u7b97\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(|P_s| \\cdot |P_t|)\\) \uff0c\u8fd9\u4e00\u6b65\u6bd4\u8f83\u8017\u65f6\uff0c\u5e38\u89c1\u7684\u52a0\u901f\u65b9\u6cd5\u6709\uff1a \u8bbe\u7f6e\u8ddd\u79bb\u9608\u503c\uff0c\u5f53\u70b9\u4e0e\u70b9\u8ddd\u79bb\u5c0f\u4e8e\u4e00\u5b9a\u9608\u503c\u5c31\u8ba4\u4e3a\u627e\u5230\u4e86\u5bf9\u5e94\u70b9\uff0c\u4e0d\u7528\u904d\u5386\u5b8c\u6574\u4e2a\u70b9\u96c6\u3002 \u4f7f\u7528 ANN \u52a0\u901f\u67e5\u627e\uff0c\u5e38\u89c1\u7684\u6709 KD-tree\u3002KD-tree \u5efa\u6811\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(N \\log N)\\) \uff0c\u67e5\u627e\u590d\u6742\u5ea6\u4e3a \\(\\mathcal{O}(\\log N)\\) \uff08\u6700\u574f\u60c5\u51b5\u4e0b\u4e3a \\(\\mathcal{O}(N)\\) \uff09\u3002","title":"\u627e\u6700\u8fd1\u5bf9\u5e94\u70b9"},{"location":"cv/pcd/pcr/icp/#_4","text":"\u5bf9\u4e8e point-to-point ICP \u95ee\u9898\uff0c\u6c42\u6700\u4f18\u53d8\u6362\u662f\u6709\u95ed\u5f62\u5f0f\u89e3\uff08closed-form solution\uff09\u7684\uff0c\u53ef\u4ee5\u501f\u52a9 SVD \u5206\u89e3\u6765\u8ba1\u7b97\u3002 \u7ed3\u8bba\uff1a\u5728\u5df2\u77e5\u70b9\u7684\u5bf9\u5e94\u5173\u7cfb\u7684\u60c5\u51b5\u4e0b\uff0c\u8bbe \\(\\overline{p}_s, \\overline{p}_t\\) \u5206\u522b\u8868\u793a\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff0c\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\overline{p}_s\uff0c\\hat{p}_t^i=p_t^i-\\overline{p}_t\\) \uff0c\u4ee4 \\(H=\\sum_{i=1}^{|P_s|}\\hat{p}_s^i \\hat{p}_t^{i^\\top}\\) \uff0c\u8fd9\u662f\u4e00\u4e2a \\(3 \\times 3\\) \u7684\u53e5\u5b50\uff0c\u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\u5f97\u5230 \\(H=U\\Sigma V^\\top\\) \uff0c\u5219 point-to-point ICP \u95ee\u9898\u6700\u4f18\u65cb\u8f6c\u4e3a\uff1a \\[R^{\\ast} = V U^\\top\\] \u6700\u4f18\u5e73\u79fb\u4e3a\uff1a \\[t^{\\ast} = \\overline{p}_t - R^\\ast \\hat{p}_s\\]","title":"\u6c42\u89e3\u6700\u4f18\u53d8\u6362"},{"location":"cv/pcd/pcr/icp/#_5","text":"\u4ee4 \\(N=|P_s|\\) \uff0c\u8bbe \\(F(t)=\\sum_{i=1}^N \\|(R \\cdot p_s^i + t) - p_t^i \\|^2\\) \uff0c\u5bf9\u5176\u8fdb\u884c\u6c42\u5bfc\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} \\frac{\\partial F}{\\partial t} &= \\sum_{i=1}^{N} 2 (R \\cdot p_s^i + t - p_t^i) \\\\ &= 2nt + 2R\\sum_{i=1}^{N}p_s^i - 2\\sum_{i=1}^{N}p_t^i \\end{aligned} \\] \u4ee4\u5bfc\u6570\u4e3a 0\uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} t &= \\frac{1}{N} \\sum_{i=1}^{N} p_t^i - R \\frac{1}{N} \\sum_{i=1}^{N} p_s^i \\\\ &= \\bar p_t - R \\bar p_s \\end{aligned} \\] \u65e0\u8bba R \u53d6\u503c\u5982\u4f55\uff0c\u6839\u636e\u4e0a\u5f0f\u90fd\u53ef\u4ee5\u6c42\u5f97\u6700\u4f18\u7684 t\uff0c\u4f7f\u5f97 loss \u6700\u5c0f\u3002","title":"\u8ba1\u7b97\u6700\u4f18\u5e73\u79fb"},{"location":"cv/pcd/pcr/icp/#_6","text":"\u7ecf\u8fc7\u6700\u4f18\u5e73\u79fb\u7684\u63a8\u5bfc\uff0c\u77e5\u9053\u65e0\u8bba\u65cb\u8f6c\u5982\u4f55\u53d6\u503c\uff0c\u90fd\u53ef\u4ee5\u901a\u8fc7\u8ba1\u7b97\u70b9\u4e91\u7684\u8d28\u5fc3\u6765\u5f97\u5230\u6700\u4f18\u5e73\u79fb\uff0c\u4e3a\u4e86\u8ba1\u7b97\u65b9\u4fbf\uff0c\u4e0d\u59a8\u4e0d\u8003\u8651\u5e73\u79fb\u7684\u5f71\u54cd\uff0c\u5148\u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u4e0b\uff0c\u8fd9\u4e5f\u5c31\u662f\u4ee4 \\(\\hat{p}_s^i=p_s^i-\\hat{p}_s, \\hat{p}_t^i=p_t^i-\\hat{p}_t\\) \u7684\u610f\u4e49\u3002 \u4e0b\u9762\u7528 \\(\\hat{p}_s^i\\) \u548c \\(\\hat{p}_t^i\\) \u8fdb\u884c\u63a8\u5bfc\u3002\u4e0d\u8003\u8651\u5e73\u79fb\uff0c\u5219 loss \u53ef\u4ee5\u5199\u6210\uff1a \\[ F(R) = \\sum_{i=1}^{N} \\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2 \\] \u5148\u7b80\u5316 \\(\\|R \\cdot \\hat p_s^i - \\hat p_t^i \\|^2\\) \uff1a \\[ \\begin{aligned} \\|R \\cdot \\hat p_s^i - \\hat p_t^i\\|^2 &= (R \\cdot \\hat p_s^i - \\hat p_t^i)^\\top(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= ({\\hat p_s^i}^\\top R^\\top - {\\hat p_t^i}^\\top)(R \\cdot \\hat p_s^i - \\hat p_t^i) \\\\ &= {\\hat p_s^i}^\\top R^\\top R {\\hat p_s^i} - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} + {\\hat p_t^i}^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - {\\hat p_t^i}^\\top R {\\hat p_s^i} - {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i} \\\\ &= \\|{\\hat p_s^i}\\|^2 + \\|{\\hat p_t^i}\\|^2 - 2{\\hat p_t^i}^\\top R {\\hat p_s^i} \\end{aligned} \\] \u8fd9\u91cc\u5229\u7528 \\(R^\\top R=I\\) \u548c \\({\\hat p_t^i}^\\top R {\\hat p_s^i} = {\\hat p_s^i}^\\top R^\\top {\\hat p_t^i}\\) \uff08\u6807\u91cf\u7684\u8f6c\u7f6e\u7b49\u4e8e\u81ea\u8eab\uff09\u7684\u6027\u8d28\u3002 \u7531\u4e8e\u70b9\u7684\u5750\u6807\u662f\u786e\u5b9a\u7684\uff08\u548c R \u65e0\u5173\uff09\uff0c\u6240\u4ee5\u6700\u5c0f\u5316\u539f loss \u7b49\u4ef7\u4e8e\u6c42\uff1a \\[ R^{\\ast} = \\argmin_R (-2 \\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u4e5f\u5373\u4e3a\u6c42\uff1a \\[ R^{\\ast} = \\argmax_R (\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i}) \\] \u6ce8\u610f\u5230 \\(\\sum_{i=1}^{N} {\\hat p_t^i}^\\top R {\\hat p_s^i} = trace(P_t^\\top R P_s)\\) \uff08\u7531\u77e9\u9635\u4e58\u6cd5\u53ca trace \u7684\u5b9a\u4e49\u53ef\u5f97\uff09\uff0c\u6240\u4ee5\u95ee\u9898\u8f6c\u5316\u4e3a\uff1a \\[ R^{\\ast} = \\argmax_{R} \\ trace(P_t^\\top R P_s) \\] \u6839\u636e trace \u7684\u6027\u8d28 \\(trace(AB)=trace(BA)\\) \uff0c\uff08\u8fd9\u91cc\u4e0d\u8981\u6c42 A \u548c B \u662f\u65b9\u9635\uff0c\u53ea\u8981 A*B \u662f\u65b9\u9635\u5373\u53ef\uff09\uff0c\u6709\uff1a \\[trace(P_t^\\top RP_s)=trace(RP_sP_t^\\top)\\] \u5728\u5229\u7528\u524d\u9762\u5b9a\u4e49\u7684\u77e9\u9635 H \u548c\u5176 SVD \u5206\u89e3\uff0c\u5e26\u5165\u4e0a\u5f0f\u5f97\u5230\uff1a \\[ \\begin{aligned} trace(P_t^\\top R P_s) &= trace(R P_s P_t^\\top) \\\\ &= trace(R H) \\\\ &= trace(R U \\Sigma V^\\top) \\\\ &= trace(\\Sigma V^\\top R U) \\end{aligned} \\] \u6ce8\u610f\u8fd9\u91cc\u7684 \\(V,U,R\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff0c\u6240\u4ee5 \\(V^\\top RU\\) \u4e5f\u662f\u6b63\u4ea4\u77e9\u9635\u3002 \u4ee4 \\(M=V^\\top RU=\\begin{bmatrix} m_{11} & m_{12} & m_{13} \\\\ m_{21} & m_{22} & m_{23} \\\\ m_{31} & m_{32} & m_{33} \\end{bmatrix}\\) \uff0c\u5219\u6709\uff1a \\[ \\begin{aligned} trace(\\Sigma V^\\top R U) &= trace(\\Sigma M) \\\\ & = \\sigma_1 m_{11} + \\sigma_2 m_{22} + \\sigma_1 m_{33} \\end{aligned} \\] \u6839\u636e\u5947\u5f02\u503c\u975e\u8d1f\u7684\u6027\u8d28\u548c\u6b63\u4ea4\u77e9\u9635\u7684\u6027\u8d28\uff08\u6b63\u4ea4\u77e9\u9635\u4e2d\u7684\u5143\u7d20\u7edd\u5bf9\u503c\u4e0d\u5927\u4e8e 1\uff09\uff0c\u5bb9\u6613\u8bc1\u5f97\u53ea\u6709\u5f53 \\(M\\) \u4e3a\u5355\u4f4d\u9635\u65f6 \\(trace(\\Sigma M)\\) \u6700\u5927\uff0c\u5373\uff1a \\[ V^\\top RU = I \\\\ R = VU^\\top \\] \u6240\u4ee5\u6709 \\(R^\\ast = VU^\\top\\) \u3002 \u6700\u540e\u8fd8\u9700\u8981\u8fdb\u884c Orientation rectification\uff0c\u5373\u9a8c\u8bc1 \\(R^\\ast = VU^\\top\\) \u662f\u4e0d\u662f\u4e00\u4e2a\u65cb\u8f6c\u77e9\u9635\uff08\u68c0\u67e5\u662f\u5426\u6709 \\(|R|=1\\) \uff09\uff0c\u56e0\u4e3a\u5b58\u5728 \\(|R|=-1\\) \u7684\u53ef\u80fd\uff0c\u6b64\u65f6 \\(R\\) \u8868\u793a\u7684\u4e0d\u662f\u65cb\u8f6c\u800c\u662f\u4e00\u4e2a reflection\uff0c\u6240\u4ee5\u8fd8\u8981\u7ed9\u4e0a\u8ff0\u4f18\u5316\u6c42\u89e3\u52a0\u4e0a\u4e00\u4e2a \\(|R|=1\\) \u7684\u7ea6\u675f\u3002 \u6839\u636e\u77e9\u9635\u884c\u5217\u5f0f\u7684\u6027\u8d28\uff0c\u4ee5\u53ca \\(U,V\\) \u90fd\u662f\u6b63\u4ea4\u77e9\u9635\uff1a \\[ \\begin{aligned} |M| &= |V^\\top| |U| |R| \\\\ &= |V^\\top| |U| = \\pm 1 \\end{aligned} \\] \u5982\u679c \\(|VU^\\top|=1\\) \uff0c\u5219 \\(|M|=1\uff0cR^\\ast = VU^\\top\\) \u5df2\u7ecf\u7ed9\u51fa\u6700\u4f18\u65cb\u8f6c\uff1b\u5982\u679c \\(|VU^\\top|=-1\\) \uff0c\u5219 \\(|M|=-1\\) \uff0c\u6211\u4eec\u9700\u8981\u6c42\u89e3\u6b64\u65f6\u7684 \\(R\\) \uff0c\u4e5f\u5c31\u662f\u5206\u6790 \\(M\\) \u5e94\u8be5\u5177\u6709\u4f55\u79cd\u5f62\u5f0f\u3002\u5177\u4f53\u7684\u8ba8\u8bba\u53c2\u8003 \u539f\u8bba\u6587 \uff0c\u8fd9\u91cc\u7ed9\u51fa\u7ed3\u8bba\uff1a\u5f53 \\(|M|=-1\\) \u65f6\uff0c\u4f7f\u5f97 \\(trace(\\Sigma M)\\) \u6700\u5927\u7684 \\(M\\) \u4e3a\uff1a \\[M = \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & -1 \\end{array} \\right]\\] \u7efc\u5408\u8003\u8651 \\(|M|=1\\) \u548c \\(|M|=-1\\) \u4e24\u79cd\u60c5\u51b5\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\uff1a \\[ R^{\\ast} = V \\left[ \\begin{array}{cccc} 1 & 0 & 0 \\\\ 0 & 1 & 0 \\\\ 0 & 0 & |V U^\\top| \\end{array} \\right] U^\\top \\] \u5230\u6b64\u516c\u5f0f\u63a8\u5bfc\u5b8c\u5168\uff0c\u7b80\u5355\u603b\u7ed3\u4e00\u4e0b\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u7684\u6b65\u9aa4\uff1a \u8ba1\u7b97\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u7684\u8d28\u5fc3\uff1b \u5c06\u6e90\u70b9\u4e91\u548c\u76ee\u6807\u70b9\u4e91\u90fd\u8f6c\u6362\u5230\u8d28\u5fc3\u5750\u6807\u7cfb\uff1b \u8ba1\u7b97\u77e9\u9635 H\uff08\u5f62\u5f0f\u7c7b\u4f3c\u201c\u534f\u65b9\u5dee\u77e9\u9635\u201d\uff09\uff1b \u5bf9 H \u8fdb\u884c SVD \u5206\u89e3\uff0c\u6839\u636e\u516c\u5f0f\u6c42\u5f97 \\(R^\\ast\\) \uff1b \u6839\u636e\u516c\u5f0f\u8ba1\u7b97 \\(t^\\ast\\) \uff1b","title":"\u8ba1\u7b97\u6700\u4f18\u65cb\u8f6c"},{"location":"cv/pcd/pcr/icp/#_7","text":"\u6bcf\u4e00\u6b21\u8fed\u4ee3\u90fd\u4f1a\u5f97\u5230\u5f53\u524d\u7684\u6700\u4f18\u53d8\u6362\u53c2\u6570 \\(R_k,t_k\\) \uff0c\u7136\u540e\u5c06\u8be5\u53d8\u6362\u4f5c\u7528\u4e8e\u5f53\u524d\u6e90\u70b9\u4e91\uff1b\u201c\u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u201d\u548c\u201c\u6c42\u89e3\u6700\u4f18\u53d8\u6362\u201d\u8fd9\u4e24\u6b65\u4e0d\u505c\u8fed\u4ee3\u8fdb\u884c\uff0c\u76f4\u5230\u6ee1\u8db3\u8fed\u4ee3\u7ec8\u6b62\u6761\u4ef6\uff0c\u5e38\u7528\u7684\u7ec8\u6b62\u6761\u4ef6\u6709\uff1a \\(R_k,t_k\\) \u7684\u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c loss \u53d8\u5316\u91cf\u5c0f\u4e8e\u4e00\u5b9a\u503c \u8fbe\u5230\u6700\u5927\u8fed\u4ee3\u6b21\u6570","title":"\u8fed\u4ee3"},{"location":"cv/pcd/pcr/icp/#icp_1","text":"ICP \u4f18\u70b9 \u7b80\u5355\uff0c\u4e0d\u5fc5\u5bf9\u70b9\u4e91\u8fdb\u884c\u5206\u5272\u548c\u7279\u5f81\u63d0\u53d6 \u521d\u503c\u8f83\u597d\u60c5\u51b5\u4e0b\uff0c\u7cbe\u5ea6\u548c\u6536\u655b\u6027\u90fd\u4e0d\u9519 ICP \u7f3a\u70b9 \u627e\u6700\u8fd1\u5bf9\u5e94\u70b9\u7684\u8ba1\u7b97\u5f00\u9500\u8f83\u5927 \u53ea\u8003\u8651\u4e86\u70b9\u4e0e\u70b9\u8ddd\u79bb\uff0c\u7f3a\u5c11\u5bf9\u70b9\u4e91\u7ed3\u6784\u4fe1\u606f\u7684\u5229\u7528 \u539f\u59cb\u7684 ICP \u7b97\u6cd5\u8ba1\u7b97\u5f00\u9500\u5927\uff0c\u5bf9\u521d\u59cb\u53d8\u6362\u654f\u611f\uff0c\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\u89e3\u3002\u81ea ICP \u63d0\u51fa\u4ee5\u6765\uff0c\u6709\u76f8\u5f53\u591a\u7684 ICP \u6539\u8fdb\u7b97\u6cd5\uff0c\u7b80\u8981\u5217\u4e3e\u4e00\u4e9b\uff1a Point-to-Plane ICP\uff0c\u539f\u59cb ICP \u7b97\u6cd5\u7684\u4ee3\u4ef7\u51fd\u6570\u4e2d\u4f7f\u7528\u7684 point-to-point \u8ddd\u79bb\uff0cpoint-to-plane \u5219\u662f\u8003\u8651\u6e90\u9876\u70b9\u5230\u76ee\u6807\u9876\u70b9\u6240\u5728\u9762\u7684\u8ddd\u79bb\uff0c\u6bd4\u8d77\u76f4\u63a5\u8ba1\u7b97\u70b9\u5230\u70b9\u8ddd\u79bb\uff0c\u8003\u8651\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u7cbe\u5ea6\u66f4\u9ad8\uff0c\u4e0d\u5bb9\u6613\u9677\u5165\u5c40\u90e8\u6700\u4f18\uff1b\u4f46\u8981\u6ce8\u610f point-to-plane \u7684\u4f18\u5316\u662f\u4e00\u4e2a\u975e\u7ebf\u6027\u95ee\u9898\uff0c\u901f\u5ea6\u6bd4\u8f83\u6162\uff0c\u4e00\u822c\u4f7f\u7528\u5176\u7ebf\u6027\u5316\u8fd1\u4f3c\uff1b Plane-to-Plane ICP\uff0cpoint-to-plane \u53ea\u8003\u8651\u76ee\u6807\u70b9\u4e91\u5c40\u90e8\u7ed3\u6784\uff0c plane-to-plane \u987e\u540d\u601d\u4e49\u5c31\u662f\u4e5f\u8003\u8651\u6e90\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\uff0c\u8ba1\u7b97\u9762\u5230\u9762\u7684\u8ddd\u79bb\uff1b Generalized ICP (GICP)\uff0c\u7efc\u5408\u8003\u8651 point-to-point\u3001point-to-plane \u548c plane-to-plane \u7b56\u7565\uff0c\u7cbe\u5ea6\u3001\u9c81\u68d2\u6027\u90fd\u6709\u6240\u63d0\u9ad8\uff1b Normal Iterative Closest Point (NICP)\uff0c\u8003\u8651\u6cd5\u5411\u91cf\u548c\u5c40\u90e8\u66f2\u7387\uff0c\u66f4\u8fdb\u4e00\u6b65\u5229\u7528\u4e86\u70b9\u4e91\u7684\u5c40\u90e8\u7ed3\u6784\u4fe1\u606f\uff0c\u5176\u8bba\u6587\u4e2d\u5b9e\u9a8c\u7ed3\u679c\u6bd4 GICP \u7684\u6027\u80fd\u66f4\u597d\u3002","title":"ICP \u7684\u4f18\u7f3a\u70b9\u53ca\u4e00\u4e9b\u6539\u8fdb\u7b97\u6cd5"},{"location":"cv/pcd/pcr/icp/#_8","text":"ICP \u6bd4\u8f83\u4f9d\u8d56\u4e8e\u53d8\u6362\u521d\u503c\uff0c\u5e73\u79fb\u6bd4\u8f83\u7b80\u5355\uff0c\u76f4\u63a5\u7528\u70b9\u4e91\u8d28\u5fc3\u6765\u4f30\u8ba1\uff1b\u65cb\u8f6c\u521d\u503c\u7684\u8bdd\u53ef\u4ee5\u624b\u52a8\u8c03\u4e00\u4e2a\u7c97\u7565\u503c\uff0c\u6216\u8005\u6cbf\u6bcf\u4e2a\u8f74\u7684\u65cb\u8f6c\u8fdb\u884c\u91c7\u6837\u3001\u7ec4\u5408\u6765\u5c1d\u8bd5\uff08\u4e0d\u9002\u5408\u5b9e\u65f6\u6027\u5e94\u7528\uff09\uff1b \u70b9\u592a\u591a\u7684\u8bdd\u53ef\u4ee5\u5148\u964d\u91c7\u6837\uff1b \u627e\u5230\u4e00\u4e9b anchor \u70b9\u5bf9\uff08\u6bd4\u5982\u5148\u7528\u7279\u5f81\u70b9\u5339\u914d\uff09\uff0c\u53ef\u4ee5\u5e2e\u52a9\u52a0\u901f\u6536\u655b\uff1b \u5bf9\u5e94\u7528\u573a\u666f\u5f15\u5165\u4e00\u4e9b\u5408\u7406\u5047\u8bbe\uff0c\u6bd4\u5982\u9650\u5236\u65cb\u8f6c\u3001\u5e73\u79fb\u7684\u8303\u56f4\uff0c\u53d8\u6362\u81ea\u7531\u5ea6\u6570\u91cf\u7b49\u3002","title":"\u5b9e\u9645\u4f7f\u7528\u4e2d\u7684\u4e00\u4e9b\u6ce8\u610f\u4e8b\u9879"},{"location":"cv/pcd/pcr/icp/#reference","text":"\u70b9\u4e91\u914d\u51c6\u5b66\u4e60\u7b14\u8bb0-ICP\uff081\uff09 \u4e09\u7ef4\u70b9\u4e91\u914d\u51c6 -- ICP \u7b97\u6cd5 https://igl.ethz.ch/projects/ARAP/svd_rot.pdf https://courses.cs.duke.edu//spring07/cps296.2/scribe_notes/lecture24.pdf","title":"Reference"},{"location":"cv/pcd/pcr/prepare/","text":"\u524d\u7f6e\u77e5\u8bc6 \u00b6 \u7ea6 2032 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u70b9\u4e91\u914d\u51c6\u57fa\u7840\u77e5\u8bc6\uff0c\u4e3b\u8981\u4e3a\u70b9\u4e91\u57fa\u7840\u3001\u5904\u7406\u65b9\u6cd5\u548c\u70b9\u4e91\u914d\u51c6\u65b9\u6cd5\u7684\u4ecb\u7ecd\u548c\u6bd4\u8f83\u7b49 \u70b9\u4e91\u57fa\u7840 \u00b6 \u70b9\u4e91\u6982\u5ff5\uff1a\u70b9\u4e91\u662f\u540c\u4e00\u7a7a\u95f4\u53c2\u8003\u7cfb\u4e0b\u8868\u8fbe\u76ee\u6807\u7a7a\u95f4\u5206\u5e03\u548c\u76ee\u6807\u8868\u9762\u7279\u6027\u7684\u6d77\u91cf\u70b9\u96c6\u5408\uff0c\u5728\u83b7\u53d6\u7269\u4f53\u8868\u9762\u6bcf\u4e2a\u91c7\u6837\u70b9\u7684\u7a7a\u95f4\u5750\u6807\u540e\uff0c\u5f97\u5230\u7684\u662f\u70b9\u7684\u96c6\u5408\uff0c\u79f0\u4e4b\u4e3a\u201c\u70b9\u4e91\u201d\uff08Point Cloud\uff09\u3002 \u70b9\u4e91\u56fe\u50cf\u662f\u6700\u57fa\u7840\u4e5f\u662f\u6700\u5e38\u89c1\u7684\u4e09\u7ef4\u56fe\u50cf\uff1a\u4e09\u7ef4\u56fe\u50cf\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u56fe\u50cf\u4fe1\u606f\u8868\u8fbe\u5f62\u5f0f\uff0c\u76f8\u8f83\u4e8e\u5e38\u89c1\u7684\u4e8c\u7ef4\u56fe\u50cf\uff0c\u5176\u6700\u5927\u7684\u7279\u5f81\u662f\u8868\u8fbe\u4e86\u7a7a\u95f4\u4e2d\u4e09\u4e2a\u7ef4\u5ea6\uff08\u957f\u5ea6\u5bbd\u5ea6\u548c\u6df1\u5ea6\uff09\u7684\u6570\u636e\u3002 \u4e09\u7ef4\u56fe\u50cf\u7684\u8868\u73b0\u5f62\u5f0f\uff1a\u6df1\u5ea6\u56fe\uff08\u4ee5\u7070\u5ea6\u8868\u8fbe\u7269\u4f53\u4e0e\u76f8\u673a\u7684\u8ddd\u79bb\uff09\uff0c\u51e0\u4f55\u6a21\u578b\uff08\u7531 CAD \u8f6f\u4ef6\u5efa\u7acb\uff09\uff0c\u70b9\u4e91\u6a21\u578b\uff08\u6240\u6709\u9006\u5411\u5de5\u7a0b\u8bbe\u5907\u90fd\u5c06\u7269\u4f53\u91c7\u6837\u6210\u70b9\u4e91\uff09\u3002 \u70b9\u4e91\u6839\u636e\u6d4b\u91cf\u539f\u7406\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd \u6839\u636e\u6fc0\u5149\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002\u5f3a\u5ea6\u4fe1\u606f\u4e0e\u76ee\u6807\u7684\u8868\u9762\u6750\u8d28\u3001\u7c97\u7cd9\u5ea6\u3001\u5165\u5c04\u89d2\u65b9\u5411\uff0c\u4ee5\u53ca\u4eea\u5668\u7684\u53d1\u5c04\u80fd\u91cf\uff0c\u6fc0\u5149\u6ce2\u957f\u6709\u5173\u3002 \u6839\u636e\u6444\u5f71\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u989c\u8272\u4fe1\u606f RGB\u3002 \u8fd8\u6709\u6fc0\u5149\u548c\u6444\u5f71\u76f8\u7ed3\u5408\u5728\u4e00\u8d77\u7684\u591a\u4f20\u611f\u5668\u878d\u5408\u6280\u672f\uff0c\u8fd9\u79cd\u5f97\u5230\u7684\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ\u3001\u989c\u8272\u4fe1\u606f RGB \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002 \u70b9\u4e91\u7684\u83b7\u53d6\u8bbe\u5907\uff08\u53ea\u9488\u5bf9\u6444\u5f71\uff09\uff1aRGBD\u8bbe\u5907\uff08\u6df1\u5ea6\u6444\u50cf\u673a\uff09\u3002 \u70b9\u4e91\u7684\u5c5e\u6027\uff1a\u7a7a\u95f4\u5206\u8fa8\u7387\u3001\u70b9\u4e91\u7cbe\u5ea6\u3001\u8868\u9762\u6cd5\u5411\u91cf\u7b49\u3002 \u70b9\u4e91\u5b58\u50a8\u683c\u5f0f .pts; .asc; .dat; .stl; .imw; .xyz; .las; \u70b9\u4e91\u7684\u6570\u636e\u7c7b\u578b\uff08\u4ee5 PCL \u5e93\u4e3a\u4f8b\uff09\uff1a pcl::PointXYZ \uff1afloat x, y, z; \u8868\u793a\u4e86 xyz3D \u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7 points[i].data[0] \u6216 points[i].x \u8bbf\u95ee x \u5750\u6807\u503c\u3002 pcl::PointXYZI \uff1afloat x, y, z, intensity; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a\u5f3a\u5ea6\u4fe1\u606f\u7684\u7c7b\u578b\u3002 pcl::PointXYZRGB \uff1afloat x, y, z, rgb; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGB \u4fe1\u606f\uff0cRGB \u5b58\u50a8\u4e3a\u4e00\u4e2a float\u3002 pcl::PointXYZRGBA \uff1afloat x, y, z; uint32_t rgba; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGBA \u4fe1\u606f\uff0cRGBA \u7528 32bit \u7684 int \u578b\u5b58\u50a8\u7684\u3002 pcl::PointXY \uff1afloat x, y; \u8868\u793a\u4e86 XY \u4fe1\u606f\u3002 pcl::Normal \uff1a\u8868\u793a\u7ed9\u5b9a\u70b9\u6240\u5728\u6837\u672c\u66f2\u9762\u4e0a\u7684\u6cd5\u7ebf\u65b9\u5411\uff0c\u4ee5\u53ca\u5bf9\u5e94\u66f2\u7387\u7684\u6d4b\u91cf\u503c\uff0c\u7528\u7b2c\u56db\u4e2a\u5143\u7d20\u6765\u5360\u4f4d\uff0c\u517c\u5bb9 SSE \u548c\u9ad8\u6548\u8ba1\u7b97 \u70b9\u4e91\u5904\u7406 \u00b6 \u56fe\u50cf\u5904\u7406\u7684\u4e09\u4e2a\u5c42\u6b21 \u4f4e\u5c42\u6b21\uff1a\u56fe\u50cf\u5f3a\u5316\uff0c\u6ee4\u6ce2\uff0c\u5173\u952e\u70b9/\u8fb9\u7f18\u68c0\u6d4b\u7b49\u57fa\u672c\u64cd\u4f5c \u4e2d\u5c42\u6b21\uff1a\u8fde\u901a\u57df\u6807\u8bb0\uff0c\u56fe\u50cf\u5206\u5272\u7b49\u64cd\u4f5c \u9ad8\u5c42\u6b21\uff1a\u7269\u4f53\u8bc6\u522b\uff0c\u573a\u666f\u5206\u6790\u7b49\u64cd\u4f5c PCL \u5bf9\u70b9\u4e91\u5904\u7406\u65b9\u6cd5\u7ed9\u51fa\u8f83\u4e3a\u660e\u6670\u7684\u5c42\u6b21\u5212\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u4f4e\u5c42\u6b21\u5904\u7406\u65b9\u6cd5 \u00b6 \u6ee4\u6ce2\u65b9\u6cd5\uff1a\u53cc\u8fb9\u6ee4\u6ce2\u3001\u9ad8\u65af\u6ee4\u6ce2\u3001\u6761\u4ef6\u6ee4\u6ce2\u3001\u76f4\u901a\u6ee4\u6ce2\u3001\u968f\u673a\u91c7\u6837\u4e00\u81f4\u6027\u6ee4\u6ce2 \u5173\u952e\u70b9\uff1aISS3D\u3001Harris3D\u3001NARF\u3001SIFT3D \u4e2d\u5c42\u6b21\u5904\u7406\u65b9\u6cd5 \u00b6 \u7279\u5f81\u63cf\u8ff0\uff1a\u6cd5\u7ebf\u548c\u66f2\u7387\u7684\u8ba1\u7b97\u3001\u7279\u5f81\u503c\u5206\u6790\u3001SHOT\u3001PFH\u3001FPFH\u30013D Shape Context\u3001Spin Image \u5206\u5272\u4e0e\u5206\u7c7b\uff1a \u5206\u5272\uff1a\u533a\u57df\u751f\u957f\u3001Ransac \u7ebf\u9762\u63d0\u53d6\u3001\u5168\u5c40\u4f18\u5316\u5e73\u9762\u63d0\u53d6\u3001K-Means\u3001Normalize Cut \uff08Context based\uff09\u30013D Hough Transform\uff08\u7ebf\u3001\u9762\u63d0\u53d6\uff09\u3001\u8fde\u901a\u5206\u6790 \u5206\u7c7b\uff1a\u57fa\u4e8e\u70b9\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u5206\u5272\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u7c7b\uff08PointNet\u3001OctNet\uff09 \u9ad8\u5c42\u6b21\u5904\u7406\u65b9\u6cd5 \u00b6 \u914d\u51c6\uff1a\u70b9\u4e91\u914d\u51c6\u5206\u4e3a\u7c97\u914d\u51c6\uff08Coarse Registration\uff09\u548c\u7cbe\u914d\u51c6\uff08Fine Registration\uff09\u4e24\u4e2a\u9636\u6bb5\u3002 \u7c97\u914d\u51c6 \u662f\u6307\u5728\u70b9\u4e91\u76f8\u5bf9\u4f4d\u59ff\u5b8c\u5168\u4f4d\u7f6e\u7684\u60c5\u51b5\u4e0b\u5bf9\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u53ef\u4ee5\u4e3a\u7cbe\u914d\u51c6\u63d0\u4f9b\u826f\u597d\u7684\u521d\u59cb\u503c\u3002\u5f53\u524d\u8f83\u4e3a\u666e\u904d\u7684\u70b9\u4e91\u81ea\u52a8\u7c97\u914d\u51c6\u7b97\u6cd5\u5305\u62ec\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5\u548c\u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \u57fa\u4e8e\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u904d\u5386\u6574\u4e2a\u53d8\u6362\u7a7a\u95f4\u4ee5\u9009\u53d6\u4f7f\u8bef\u5dee\u51fd\u6570\u6700\u5c0f\u5316\u7684\u53d8\u6362\u5173\u7cfb\u6216\u8005\u5217\u4e3e\u51fa\u4f7f\u6700\u591a\u70b9\u5bf9\u6ee1\u8db3\u7684\u53d8\u6362\u5173\u7cfb\u3002\u5982 RANSAC \u914d\u51c6\u7b97\u6cd5\u3001\u56db\u70b9\u4e00\u81f4\u96c6\u914d\u51c6\u7b97\u6cd5\uff084-Point Congruent Set\uff0c4PCS\uff09\u3001Super4PCS \u7b97\u6cd5\u7b49 \u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u901a\u8fc7\u88ab\u6d4b\u7269\u4f53\u672c\u8eab\u6240\u5177\u5907\u7684\u5f62\u6001\u7279\u6027\u6784\u5efa\u70b9\u4e91\u95f4\u7684\u5339\u914d\u5bf9\u5e94\uff0c\u7136\u540e\u91c7\u7528\u76f8\u5173\u7b97\u6cd5\u5bf9\u53d8\u6362\u5173\u7cfb\u8fdb\u884c\u4f30\u8ba1\u3002\u5982\u57fa\u4e8e\u70b9 FPFH \u7279\u5f81\u7684 SAC-IA\u3001FGR \u7b49\u7b97\u6cd5\u3001\u57fa\u4e8e\u70b9 SHOT \u7279\u5f81\u7684 AO \u7b97\u6cd5\u4ee5\u53ca\u57fa\u4e8e\u7ebf\u7279\u5f81\u7684 ICL \u7b49 \u7cbe\u914d\u51c6 \u7684\u76ee\u7684\u662f\u5728\u7c97\u914d\u51c6\u7684\u57fa\u7840\u4e0a\u8ba9\u70b9\u4e91\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u5dee\u522b\u6700\u5c0f\u5316\u3002\u5e94\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u7cbe\u914d\u51c6\u7b97\u6cd5\u5e94\u8be5\u662f ICP \u4ee5\u53ca ICP \u7684\u5404\u79cd\u53d8\u79cd\uff08\u7a33\u5065 ICP\u3001point to plane ICP\u3001Point to line ICP\u3001MBICP\u3001GICP\u3001NICP\uff09 SLAM \u56fe\u4f18\u5316 Ceres\u3001g2o\u3001LUM\u3001ELCH\u3001Toro\u3001SPA SLAM \u65b9\u6cd5\uff1aICP\u3001MBICP\u3001IDC\u3001likehood Field\u3001NDT \u4e09\u7ef4\u91cd\u5efa \u67cf\u677e\u91cd\u5efa\u3001Delaunay triangulations\u3001\u8868\u9762\u91cd\u5efa\u3001\u4eba\u4f53\u91cd\u5efa\u3001\u5efa\u7b51\u7269\u91cd\u5efa\u3001\u6811\u6728\u91cd\u5efa \u7ed3\u6784\u5316\u91cd\u5efa\uff1a\u4e0d\u662f\u7b80\u5355\u7684\u6784\u5efa\u4e00\u4e2a Mesh \u7f51\u683c\uff0c\u800c\u662f\u4e3a\u573a\u666f\u8fdb\u884c\u5206\u5272\uff0c\u4e3a\u573a\u666f\u7ed3\u6784\u8d4b\u4e88\u8bed\u4e49\u4fe1\u606f\u3002\u573a\u666f\u7ed3\u6784\u6709\u5c42\u6b21\u4e4b\u5206\uff0c\u5728\u51e0\u4f55\u5c42\u6b21\u5c31\u662f\u70b9\u7ebf\u9762 \u5b9e\u65f6\u91cd\u5efa\uff1a\u91cd\u5efa\u690d\u88ab\u6216\u8005\u519c\u4f5c\u7269\u7684 4D\uff083D+\u65f6\u95f4\uff09\u751f\u957f\u6001\u52bf\uff1b\u4eba\u4f53\u59ff\u6001\u8bc6\u522b\uff1b\u8868\u60c5\u8bc6\u522b \u70b9\u4e91\u6570\u636e\u7ba1\u7406\uff1a\u70b9\u4e91\u538b\u7f29\uff0c\u70b9\u4e91\u7d22\u5f15\uff08KD\u3001Octree\uff09\uff0c\u70b9\u4e91 LOD\uff08\u91d1\u5b57\u5854\uff09\uff0c\u6d77\u91cf\u70b9\u4e91\u7684\u6e32\u67d3 \u70b9\u4e91\u914d\u51c6 \u00b6 \u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\uff0c\u53c8\u540d\u70b9\u4e91\u62fc\u63a5\u3001\u70b9\u4e91\u6ce8\u518c\uff0c\u5bf9\u4e8e\u4e24\u5e27\u6709\u91cd\u53e0\u4fe1\u606f\u7684\u70b9\u4e91\uff0c\u901a\u8fc7\u6c42\u89e3\u53d8\u6362\u77e9\u9635\uff08\u65cb\u8f6c\u77e9\u9635 R \u548c\u5e73\u79fb\u77e9\u9635 T\uff09\uff0c\u4f7f\u5f97\u91cd\u53e0\u90e8\u5206\u70b9\u4e91\u53d8\u6362\u5230\u540c\u4e00\u4e2a\u7edf\u4e00\u7684\u5750\u6807\u7cfb\u4e0b\u3002 \u524d\u671f\u4ee5\u4f20\u7edf\u65b9\u6cd5\u4e3a\u4e3b\uff0c2018 \u5e74\u53ca\u4ee5\u540e\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u65b9\u6cd5\u5c45\u4e0a\u3002 \u70b9\u4e91\u914d\u51c6\u53ef\u4ee5\u57fa\u4e8e\u4ee5\u4e0b 5 \u4e2a\u65b9\u9762\u5b66\u4e60\u548c\u8fdb\u9636\uff1a ICP \u7b97\u6cd5 \uff1a\u70b9\u4e91\u914d\u51c6\u9886\u57df\u6700\u4e3a\u7ecf\u5178\u7684\u7b97\u6cd5\uff0c Least-squares fitting of two 3-D point sets \uff0c\u8bc1\u660e\u4e86\u5982\u4f55\u5728\u5df2\u77e5\u70b9\u5bf9\u7684\u5173\u7cfb\u65f6\u7528 SVD \u6c42\u89e3\u53d8\u6362\u77e9\u9635\u3002 PFH \u548c FPFH \u7279\u5f81\u548c\u57fa\u4e8e RANSAC \u7684\u914d\u51c6\u7b97\u6cd5 \uff1aICP \u7b97\u6cd5\u7684\u7f3a\u70b9\u5f88\u660e\u663e\uff0c\u5bfb\u627e\u70b9\u5bf9\u5e94\u5173\u7cfb\u65f6\u662f\u57fa\u4e8e\u8ddd\u79bb\u7684\uff0c\u5f53\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\u65f6\uff0cICP \u7b97\u6cd5\u57fa\u672c\u5931\u6548\u3002\u57fa\u4e8e\u7279\u5f81 + RANSAC \u7684\u7b97\u6cd5\u6b64\u65f6\u53d1\u6325\u4f18\u52bf\uff0c\u5b83\u901a\u8fc7\u70b9\u7684\u7279\u5f81\u5bfb\u627e\u5bf9\u5e94\u70b9\u5bf9\uff0c\u53ea\u8981\u70b9\u7684\u7279\u5f81\u8868\u8fbe\u80fd\u529b\u591f\u5f3a\uff0c\u5373\u4f7f\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\uff0c\u4e5f\u53ef\u4ee5\u627e\u5230\u6b63\u786e\u7684\u70b9\u5bf9\u5e94\u5173\u7cfb\uff0c\u4ece\u800c\u5b9e\u73b0\u70b9\u4e91\u914d\u51c6\uff1b\u4f46\u70b9\u7684\u7279\u5f81\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u662f\u4e0d\u9c81\u68d2\u7684\uff0c\u6240\u4ee5\u7ed3\u5408 RANSAC \u7b97\u6cd5\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u7279\u5f81\u63cf\u8ff0\u5b50\u5efa\u8bae\u67e5\u770b FPFH\uff0c\u5bf9\u5e94\u8bba\u6587\u4e3a Fast point feature histograms (FPFH) for 3D registration (ICRA 2009) \u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u6700\u8fd1\u4e24\u4e09\u5e74\u7684\u65f6\u95f4\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u6a21\u578b\u51fa\u73b0\u5f88\u591a\uff0c\u5305\u62ec\u57fa\u4e8e global features-based \u548c correspongence-based\uff0c\u4e24\u79cd\u6a21\u5f0f\u3002Global features-based \u65b9\u6cd5\u5305\u62ec PointNetLK: Point Cloud Registration using PointNet (CVPR2019) \u548c PCRNet: Point Cloud Registration Network using PointNet Encoding (arXiv2019) \u3002 \u8fd9\u91cc\u53ef\u4ee5\u4f18\u5148\u770b PCRNet, \u56e0\u4e3a\u5176\u7b97\u6cd5\u548c\u5b9e\u73b0\u8f83\u4e3a\u7b80\u5355, \u5bb9\u6613 follow\u3002Correspondence-based \u65b9\u6cd5\u7684\u5178\u578b\u4ee3\u8868\u5305\u62ec DCP (ICCV2019) , PRNet (NeurIPS) \u548c RPMNet (CVPR2020) . \u8fd9\u4e9b\u65b9\u6cd5\u90fd\u662f\u5f00\u6e90\u7684, \u9664\u4e86 PRNet \u7684\u4ee3\u7801\u5728\u8bad\u7ec3\u65f6\u5bb9\u6613\u5d29\u6e83\u5916\uff0c\u5176\u5b83\u7684\u4ee3\u7801\u90fd\u662f\u4e0d\u9519\u7684\u3002 \u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b\u5927\u591a\u53ea\u5728 ModelNet40 \u4e0a\u662f\u6709\u6548\u7684\uff0c\u9762\u5bf9\u771f\u5b9e\u7684\u6570\u636e\u96c6\u5982 3DMatch \u548c KITTI \u65f6\u5219\u6548\u679c\u8868\u73b0\u4e0d\u597d\u3002\u4e00\u90e8\u5206\u539f\u56e0\u662f\u771f\u5b9e\u6570\u636e\u96c6\u8f83\u4e3a\u590d\u6742\uff0c\u53e6\u4e00\u90e8\u5206\u539f\u56e0\u662f\u7f51\u7edc\u7ed3\u6784\u4e0d\u8db3\u4ee5\u51c6\u786e\u5b66\u4e60\u5927\u90e8\u5206\u70b9\u7684\u7279\u5f81\u3002\u7531\u6b64\u5c31\u4f1a\u5bfc\u81f4 Inlier ratio \u8f83\u4f4e\uff0c\u7aef\u5230\u7aef\u7684\u914d\u51c6\u7f51\u7edc\u4e0d\u80fd\u53d1\u6325\u5f88\u597d\u7684\u6548\u679c\u3002\u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u4e3b\u8981\u4ee3\u8868\u5305\u62ec FCGF (ICCV 2019) , D3Feat (CVPR2020) \u548c PREDATOR (CVPR2021) . Open3D\u7684\u4f7f\u7528 \uff1a\u6700\u540e\u4f46\u4e5f\u662f\u5f88\u91cd\u8981\u7684\u4e00\u73af\uff0c\u4e00\u4e2a\u9ad8\u6548\u5904\u7406\u70b9\u4e91\u7684\u5de5\u5177\uff0c\u63a8\u8350 Open3D \u3002Open3D \u63d0\u4f9b\u4e86 4 \u4e2a\u548c\u914d\u51c6\u6709\u5173\u7684\u51fd\u6570\uff0c\u5305\u62ec ICP \u53ca\u5176\u53d8\u79cd\uff0c\u57fa\u4e8e RANSAC \u7684\u7b97\u6cd5\u548c FGR \u7b97\u6cd5\u7b49\u3002","title":"\u524d\u7f6e\u77e5\u8bc6"},{"location":"cv/pcd/pcr/prepare/#_1","text":"\u7ea6 2032 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u70b9\u4e91\u914d\u51c6\u57fa\u7840\u77e5\u8bc6\uff0c\u4e3b\u8981\u4e3a\u70b9\u4e91\u57fa\u7840\u3001\u5904\u7406\u65b9\u6cd5\u548c\u70b9\u4e91\u914d\u51c6\u65b9\u6cd5\u7684\u4ecb\u7ecd\u548c\u6bd4\u8f83\u7b49","title":"\u524d\u7f6e\u77e5\u8bc6"},{"location":"cv/pcd/pcr/prepare/#_2","text":"\u70b9\u4e91\u6982\u5ff5\uff1a\u70b9\u4e91\u662f\u540c\u4e00\u7a7a\u95f4\u53c2\u8003\u7cfb\u4e0b\u8868\u8fbe\u76ee\u6807\u7a7a\u95f4\u5206\u5e03\u548c\u76ee\u6807\u8868\u9762\u7279\u6027\u7684\u6d77\u91cf\u70b9\u96c6\u5408\uff0c\u5728\u83b7\u53d6\u7269\u4f53\u8868\u9762\u6bcf\u4e2a\u91c7\u6837\u70b9\u7684\u7a7a\u95f4\u5750\u6807\u540e\uff0c\u5f97\u5230\u7684\u662f\u70b9\u7684\u96c6\u5408\uff0c\u79f0\u4e4b\u4e3a\u201c\u70b9\u4e91\u201d\uff08Point Cloud\uff09\u3002 \u70b9\u4e91\u56fe\u50cf\u662f\u6700\u57fa\u7840\u4e5f\u662f\u6700\u5e38\u89c1\u7684\u4e09\u7ef4\u56fe\u50cf\uff1a\u4e09\u7ef4\u56fe\u50cf\u662f\u4e00\u79cd\u7279\u6b8a\u7684\u56fe\u50cf\u4fe1\u606f\u8868\u8fbe\u5f62\u5f0f\uff0c\u76f8\u8f83\u4e8e\u5e38\u89c1\u7684\u4e8c\u7ef4\u56fe\u50cf\uff0c\u5176\u6700\u5927\u7684\u7279\u5f81\u662f\u8868\u8fbe\u4e86\u7a7a\u95f4\u4e2d\u4e09\u4e2a\u7ef4\u5ea6\uff08\u957f\u5ea6\u5bbd\u5ea6\u548c\u6df1\u5ea6\uff09\u7684\u6570\u636e\u3002 \u4e09\u7ef4\u56fe\u50cf\u7684\u8868\u73b0\u5f62\u5f0f\uff1a\u6df1\u5ea6\u56fe\uff08\u4ee5\u7070\u5ea6\u8868\u8fbe\u7269\u4f53\u4e0e\u76f8\u673a\u7684\u8ddd\u79bb\uff09\uff0c\u51e0\u4f55\u6a21\u578b\uff08\u7531 CAD \u8f6f\u4ef6\u5efa\u7acb\uff09\uff0c\u70b9\u4e91\u6a21\u578b\uff08\u6240\u6709\u9006\u5411\u5de5\u7a0b\u8bbe\u5907\u90fd\u5c06\u7269\u4f53\u91c7\u6837\u6210\u70b9\u4e91\uff09\u3002 \u70b9\u4e91\u6839\u636e\u6d4b\u91cf\u539f\u7406\u4e3b\u8981\u5206\u4e3a\u4e24\u79cd \u6839\u636e\u6fc0\u5149\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002\u5f3a\u5ea6\u4fe1\u606f\u4e0e\u76ee\u6807\u7684\u8868\u9762\u6750\u8d28\u3001\u7c97\u7cd9\u5ea6\u3001\u5165\u5c04\u89d2\u65b9\u5411\uff0c\u4ee5\u53ca\u4eea\u5668\u7684\u53d1\u5c04\u80fd\u91cf\uff0c\u6fc0\u5149\u6ce2\u957f\u6709\u5173\u3002 \u6839\u636e\u6444\u5f71\u6d4b\u91cf\u539f\u7406\u5f97\u5230\u7684\u70b9\u4e91\uff0c\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ \u548c\u989c\u8272\u4fe1\u606f RGB\u3002 \u8fd8\u6709\u6fc0\u5149\u548c\u6444\u5f71\u76f8\u7ed3\u5408\u5728\u4e00\u8d77\u7684\u591a\u4f20\u611f\u5668\u878d\u5408\u6280\u672f\uff0c\u8fd9\u79cd\u5f97\u5230\u7684\u5305\u62ec\u4e09\u7ef4\u5750\u6807 XYZ\u3001\u989c\u8272\u4fe1\u606f RGB \u548c\u6fc0\u5149\u53cd\u5c04\u5f3a\u5ea6 I\u3002 \u70b9\u4e91\u7684\u83b7\u53d6\u8bbe\u5907\uff08\u53ea\u9488\u5bf9\u6444\u5f71\uff09\uff1aRGBD\u8bbe\u5907\uff08\u6df1\u5ea6\u6444\u50cf\u673a\uff09\u3002 \u70b9\u4e91\u7684\u5c5e\u6027\uff1a\u7a7a\u95f4\u5206\u8fa8\u7387\u3001\u70b9\u4e91\u7cbe\u5ea6\u3001\u8868\u9762\u6cd5\u5411\u91cf\u7b49\u3002 \u70b9\u4e91\u5b58\u50a8\u683c\u5f0f .pts; .asc; .dat; .stl; .imw; .xyz; .las; \u70b9\u4e91\u7684\u6570\u636e\u7c7b\u578b\uff08\u4ee5 PCL \u5e93\u4e3a\u4f8b\uff09\uff1a pcl::PointXYZ \uff1afloat x, y, z; \u8868\u793a\u4e86 xyz3D \u4fe1\u606f\uff0c\u53ef\u4ee5\u901a\u8fc7 points[i].data[0] \u6216 points[i].x \u8bbf\u95ee x \u5750\u6807\u503c\u3002 pcl::PointXYZI \uff1afloat x, y, z, intensity; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a\u5f3a\u5ea6\u4fe1\u606f\u7684\u7c7b\u578b\u3002 pcl::PointXYZRGB \uff1afloat x, y, z, rgb; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGB \u4fe1\u606f\uff0cRGB \u5b58\u50a8\u4e3a\u4e00\u4e2a float\u3002 pcl::PointXYZRGBA \uff1afloat x, y, z; uint32_t rgba; \u8868\u793a\u4e86 XYZ \u4fe1\u606f\u52a0\u4e0a RGBA \u4fe1\u606f\uff0cRGBA \u7528 32bit \u7684 int \u578b\u5b58\u50a8\u7684\u3002 pcl::PointXY \uff1afloat x, y; \u8868\u793a\u4e86 XY \u4fe1\u606f\u3002 pcl::Normal \uff1a\u8868\u793a\u7ed9\u5b9a\u70b9\u6240\u5728\u6837\u672c\u66f2\u9762\u4e0a\u7684\u6cd5\u7ebf\u65b9\u5411\uff0c\u4ee5\u53ca\u5bf9\u5e94\u66f2\u7387\u7684\u6d4b\u91cf\u503c\uff0c\u7528\u7b2c\u56db\u4e2a\u5143\u7d20\u6765\u5360\u4f4d\uff0c\u517c\u5bb9 SSE \u548c\u9ad8\u6548\u8ba1\u7b97","title":"\u70b9\u4e91\u57fa\u7840"},{"location":"cv/pcd/pcr/prepare/#_3","text":"\u56fe\u50cf\u5904\u7406\u7684\u4e09\u4e2a\u5c42\u6b21 \u4f4e\u5c42\u6b21\uff1a\u56fe\u50cf\u5f3a\u5316\uff0c\u6ee4\u6ce2\uff0c\u5173\u952e\u70b9/\u8fb9\u7f18\u68c0\u6d4b\u7b49\u57fa\u672c\u64cd\u4f5c \u4e2d\u5c42\u6b21\uff1a\u8fde\u901a\u57df\u6807\u8bb0\uff0c\u56fe\u50cf\u5206\u5272\u7b49\u64cd\u4f5c \u9ad8\u5c42\u6b21\uff1a\u7269\u4f53\u8bc6\u522b\uff0c\u573a\u666f\u5206\u6790\u7b49\u64cd\u4f5c PCL \u5bf9\u70b9\u4e91\u5904\u7406\u65b9\u6cd5\u7ed9\u51fa\u8f83\u4e3a\u660e\u6670\u7684\u5c42\u6b21\u5212\u5206\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a","title":"\u70b9\u4e91\u5904\u7406"},{"location":"cv/pcd/pcr/prepare/#_4","text":"\u6ee4\u6ce2\u65b9\u6cd5\uff1a\u53cc\u8fb9\u6ee4\u6ce2\u3001\u9ad8\u65af\u6ee4\u6ce2\u3001\u6761\u4ef6\u6ee4\u6ce2\u3001\u76f4\u901a\u6ee4\u6ce2\u3001\u968f\u673a\u91c7\u6837\u4e00\u81f4\u6027\u6ee4\u6ce2 \u5173\u952e\u70b9\uff1aISS3D\u3001Harris3D\u3001NARF\u3001SIFT3D","title":"\u4f4e\u5c42\u6b21\u5904\u7406\u65b9\u6cd5"},{"location":"cv/pcd/pcr/prepare/#_5","text":"\u7279\u5f81\u63cf\u8ff0\uff1a\u6cd5\u7ebf\u548c\u66f2\u7387\u7684\u8ba1\u7b97\u3001\u7279\u5f81\u503c\u5206\u6790\u3001SHOT\u3001PFH\u3001FPFH\u30013D Shape Context\u3001Spin Image \u5206\u5272\u4e0e\u5206\u7c7b\uff1a \u5206\u5272\uff1a\u533a\u57df\u751f\u957f\u3001Ransac \u7ebf\u9762\u63d0\u53d6\u3001\u5168\u5c40\u4f18\u5316\u5e73\u9762\u63d0\u53d6\u3001K-Means\u3001Normalize Cut \uff08Context based\uff09\u30013D Hough Transform\uff08\u7ebf\u3001\u9762\u63d0\u53d6\uff09\u3001\u8fde\u901a\u5206\u6790 \u5206\u7c7b\uff1a\u57fa\u4e8e\u70b9\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u5206\u5272\u7684\u5206\u7c7b\u3001\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u5206\u7c7b\uff08PointNet\u3001OctNet\uff09","title":"\u4e2d\u5c42\u6b21\u5904\u7406\u65b9\u6cd5"},{"location":"cv/pcd/pcr/prepare/#_6","text":"\u914d\u51c6\uff1a\u70b9\u4e91\u914d\u51c6\u5206\u4e3a\u7c97\u914d\u51c6\uff08Coarse Registration\uff09\u548c\u7cbe\u914d\u51c6\uff08Fine Registration\uff09\u4e24\u4e2a\u9636\u6bb5\u3002 \u7c97\u914d\u51c6 \u662f\u6307\u5728\u70b9\u4e91\u76f8\u5bf9\u4f4d\u59ff\u5b8c\u5168\u4f4d\u7f6e\u7684\u60c5\u51b5\u4e0b\u5bf9\u70b9\u4e91\u8fdb\u884c\u914d\u51c6\uff0c\u53ef\u4ee5\u4e3a\u7cbe\u914d\u51c6\u63d0\u4f9b\u826f\u597d\u7684\u521d\u59cb\u503c\u3002\u5f53\u524d\u8f83\u4e3a\u666e\u904d\u7684\u70b9\u4e91\u81ea\u52a8\u7c97\u914d\u51c6\u7b97\u6cd5\u5305\u62ec\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5\u548c\u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \u57fa\u4e8e\u7a77\u4e3e\u641c\u7d22\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u904d\u5386\u6574\u4e2a\u53d8\u6362\u7a7a\u95f4\u4ee5\u9009\u53d6\u4f7f\u8bef\u5dee\u51fd\u6570\u6700\u5c0f\u5316\u7684\u53d8\u6362\u5173\u7cfb\u6216\u8005\u5217\u4e3e\u51fa\u4f7f\u6700\u591a\u70b9\u5bf9\u6ee1\u8db3\u7684\u53d8\u6362\u5173\u7cfb\u3002\u5982 RANSAC \u914d\u51c6\u7b97\u6cd5\u3001\u56db\u70b9\u4e00\u81f4\u96c6\u914d\u51c6\u7b97\u6cd5\uff084-Point Congruent Set\uff0c4PCS\uff09\u3001Super4PCS \u7b97\u6cd5\u7b49 \u57fa\u4e8e\u7279\u5f81\u5339\u914d\u7684\u914d\u51c6\u7b97\u6cd5 \uff1a\u901a\u8fc7\u88ab\u6d4b\u7269\u4f53\u672c\u8eab\u6240\u5177\u5907\u7684\u5f62\u6001\u7279\u6027\u6784\u5efa\u70b9\u4e91\u95f4\u7684\u5339\u914d\u5bf9\u5e94\uff0c\u7136\u540e\u91c7\u7528\u76f8\u5173\u7b97\u6cd5\u5bf9\u53d8\u6362\u5173\u7cfb\u8fdb\u884c\u4f30\u8ba1\u3002\u5982\u57fa\u4e8e\u70b9 FPFH \u7279\u5f81\u7684 SAC-IA\u3001FGR \u7b49\u7b97\u6cd5\u3001\u57fa\u4e8e\u70b9 SHOT \u7279\u5f81\u7684 AO \u7b97\u6cd5\u4ee5\u53ca\u57fa\u4e8e\u7ebf\u7279\u5f81\u7684 ICL \u7b49 \u7cbe\u914d\u51c6 \u7684\u76ee\u7684\u662f\u5728\u7c97\u914d\u51c6\u7684\u57fa\u7840\u4e0a\u8ba9\u70b9\u4e91\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u5dee\u522b\u6700\u5c0f\u5316\u3002\u5e94\u7528\u6700\u4e3a\u5e7f\u6cdb\u7684\u7cbe\u914d\u51c6\u7b97\u6cd5\u5e94\u8be5\u662f ICP \u4ee5\u53ca ICP \u7684\u5404\u79cd\u53d8\u79cd\uff08\u7a33\u5065 ICP\u3001point to plane ICP\u3001Point to line ICP\u3001MBICP\u3001GICP\u3001NICP\uff09 SLAM \u56fe\u4f18\u5316 Ceres\u3001g2o\u3001LUM\u3001ELCH\u3001Toro\u3001SPA SLAM \u65b9\u6cd5\uff1aICP\u3001MBICP\u3001IDC\u3001likehood Field\u3001NDT \u4e09\u7ef4\u91cd\u5efa \u67cf\u677e\u91cd\u5efa\u3001Delaunay triangulations\u3001\u8868\u9762\u91cd\u5efa\u3001\u4eba\u4f53\u91cd\u5efa\u3001\u5efa\u7b51\u7269\u91cd\u5efa\u3001\u6811\u6728\u91cd\u5efa \u7ed3\u6784\u5316\u91cd\u5efa\uff1a\u4e0d\u662f\u7b80\u5355\u7684\u6784\u5efa\u4e00\u4e2a Mesh \u7f51\u683c\uff0c\u800c\u662f\u4e3a\u573a\u666f\u8fdb\u884c\u5206\u5272\uff0c\u4e3a\u573a\u666f\u7ed3\u6784\u8d4b\u4e88\u8bed\u4e49\u4fe1\u606f\u3002\u573a\u666f\u7ed3\u6784\u6709\u5c42\u6b21\u4e4b\u5206\uff0c\u5728\u51e0\u4f55\u5c42\u6b21\u5c31\u662f\u70b9\u7ebf\u9762 \u5b9e\u65f6\u91cd\u5efa\uff1a\u91cd\u5efa\u690d\u88ab\u6216\u8005\u519c\u4f5c\u7269\u7684 4D\uff083D+\u65f6\u95f4\uff09\u751f\u957f\u6001\u52bf\uff1b\u4eba\u4f53\u59ff\u6001\u8bc6\u522b\uff1b\u8868\u60c5\u8bc6\u522b \u70b9\u4e91\u6570\u636e\u7ba1\u7406\uff1a\u70b9\u4e91\u538b\u7f29\uff0c\u70b9\u4e91\u7d22\u5f15\uff08KD\u3001Octree\uff09\uff0c\u70b9\u4e91 LOD\uff08\u91d1\u5b57\u5854\uff09\uff0c\u6d77\u91cf\u70b9\u4e91\u7684\u6e32\u67d3","title":"\u9ad8\u5c42\u6b21\u5904\u7406\u65b9\u6cd5"},{"location":"cv/pcd/pcr/prepare/#_7","text":"\u70b9\u4e91\u914d\u51c6\uff08Point Cloud Registration\uff09\uff0c\u53c8\u540d\u70b9\u4e91\u62fc\u63a5\u3001\u70b9\u4e91\u6ce8\u518c\uff0c\u5bf9\u4e8e\u4e24\u5e27\u6709\u91cd\u53e0\u4fe1\u606f\u7684\u70b9\u4e91\uff0c\u901a\u8fc7\u6c42\u89e3\u53d8\u6362\u77e9\u9635\uff08\u65cb\u8f6c\u77e9\u9635 R \u548c\u5e73\u79fb\u77e9\u9635 T\uff09\uff0c\u4f7f\u5f97\u91cd\u53e0\u90e8\u5206\u70b9\u4e91\u53d8\u6362\u5230\u540c\u4e00\u4e2a\u7edf\u4e00\u7684\u5750\u6807\u7cfb\u4e0b\u3002 \u524d\u671f\u4ee5\u4f20\u7edf\u65b9\u6cd5\u4e3a\u4e3b\uff0c2018 \u5e74\u53ca\u4ee5\u540e\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u65b9\u6cd5\u5c45\u4e0a\u3002 \u70b9\u4e91\u914d\u51c6\u53ef\u4ee5\u57fa\u4e8e\u4ee5\u4e0b 5 \u4e2a\u65b9\u9762\u5b66\u4e60\u548c\u8fdb\u9636\uff1a ICP \u7b97\u6cd5 \uff1a\u70b9\u4e91\u914d\u51c6\u9886\u57df\u6700\u4e3a\u7ecf\u5178\u7684\u7b97\u6cd5\uff0c Least-squares fitting of two 3-D point sets \uff0c\u8bc1\u660e\u4e86\u5982\u4f55\u5728\u5df2\u77e5\u70b9\u5bf9\u7684\u5173\u7cfb\u65f6\u7528 SVD \u6c42\u89e3\u53d8\u6362\u77e9\u9635\u3002 PFH \u548c FPFH \u7279\u5f81\u548c\u57fa\u4e8e RANSAC \u7684\u914d\u51c6\u7b97\u6cd5 \uff1aICP \u7b97\u6cd5\u7684\u7f3a\u70b9\u5f88\u660e\u663e\uff0c\u5bfb\u627e\u70b9\u5bf9\u5e94\u5173\u7cfb\u65f6\u662f\u57fa\u4e8e\u8ddd\u79bb\u7684\uff0c\u5f53\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\u65f6\uff0cICP \u7b97\u6cd5\u57fa\u672c\u5931\u6548\u3002\u57fa\u4e8e\u7279\u5f81 + RANSAC \u7684\u7b97\u6cd5\u6b64\u65f6\u53d1\u6325\u4f18\u52bf\uff0c\u5b83\u901a\u8fc7\u70b9\u7684\u7279\u5f81\u5bfb\u627e\u5bf9\u5e94\u70b9\u5bf9\uff0c\u53ea\u8981\u70b9\u7684\u7279\u5f81\u8868\u8fbe\u80fd\u529b\u591f\u5f3a\uff0c\u5373\u4f7f\u521d\u59cb\u4f4d\u59ff\u5f88\u5dee\uff0c\u4e5f\u53ef\u4ee5\u627e\u5230\u6b63\u786e\u7684\u70b9\u5bf9\u5e94\u5173\u7cfb\uff0c\u4ece\u800c\u5b9e\u73b0\u70b9\u4e91\u914d\u51c6\uff1b\u4f46\u70b9\u7684\u7279\u5f81\u5728\u5927\u591a\u6570\u60c5\u51b5\u4e0b\u662f\u4e0d\u9c81\u68d2\u7684\uff0c\u6240\u4ee5\u7ed3\u5408 RANSAC \u7b97\u6cd5\u662f\u4e0d\u9519\u7684\u9009\u62e9\u3002\u7279\u5f81\u63cf\u8ff0\u5b50\u5efa\u8bae\u67e5\u770b FPFH\uff0c\u5bf9\u5e94\u8bba\u6587\u4e3a Fast point feature histograms (FPFH) for 3D registration (ICRA 2009) \u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u6700\u8fd1\u4e24\u4e09\u5e74\u7684\u65f6\u95f4\u57fa\u4e8e\u6df1\u5ea6\u5b66\u4e60\u7684\u914d\u51c6\u6a21\u578b\u51fa\u73b0\u5f88\u591a\uff0c\u5305\u62ec\u57fa\u4e8e global features-based \u548c correspongence-based\uff0c\u4e24\u79cd\u6a21\u5f0f\u3002Global features-based \u65b9\u6cd5\u5305\u62ec PointNetLK: Point Cloud Registration using PointNet (CVPR2019) \u548c PCRNet: Point Cloud Registration Network using PointNet Encoding (arXiv2019) \u3002 \u8fd9\u91cc\u53ef\u4ee5\u4f18\u5148\u770b PCRNet, \u56e0\u4e3a\u5176\u7b97\u6cd5\u548c\u5b9e\u73b0\u8f83\u4e3a\u7b80\u5355, \u5bb9\u6613 follow\u3002Correspondence-based \u65b9\u6cd5\u7684\u5178\u578b\u4ee3\u8868\u5305\u62ec DCP (ICCV2019) , PRNet (NeurIPS) \u548c RPMNet (CVPR2020) . \u8fd9\u4e9b\u65b9\u6cd5\u90fd\u662f\u5f00\u6e90\u7684, \u9664\u4e86 PRNet \u7684\u4ee3\u7801\u5728\u8bad\u7ec3\u65f6\u5bb9\u6613\u5d29\u6e83\u5916\uff0c\u5176\u5b83\u7684\u4ee3\u7801\u90fd\u662f\u4e0d\u9519\u7684\u3002 \u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b \uff1a\u7aef\u5230\u7aef\u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u6a21\u578b\u5927\u591a\u53ea\u5728 ModelNet40 \u4e0a\u662f\u6709\u6548\u7684\uff0c\u9762\u5bf9\u771f\u5b9e\u7684\u6570\u636e\u96c6\u5982 3DMatch \u548c KITTI \u65f6\u5219\u6548\u679c\u8868\u73b0\u4e0d\u597d\u3002\u4e00\u90e8\u5206\u539f\u56e0\u662f\u771f\u5b9e\u6570\u636e\u96c6\u8f83\u4e3a\u590d\u6742\uff0c\u53e6\u4e00\u90e8\u5206\u539f\u56e0\u662f\u7f51\u7edc\u7ed3\u6784\u4e0d\u8db3\u4ee5\u51c6\u786e\u5b66\u4e60\u5927\u90e8\u5206\u70b9\u7684\u7279\u5f81\u3002\u7531\u6b64\u5c31\u4f1a\u5bfc\u81f4 Inlier ratio \u8f83\u4f4e\uff0c\u7aef\u5230\u7aef\u7684\u914d\u51c6\u7f51\u7edc\u4e0d\u80fd\u53d1\u6325\u5f88\u597d\u7684\u6548\u679c\u3002\u57fa\u4e8e RANSAC \u7684\u6df1\u5ea6\u5b66\u4e60\u914d\u51c6\u4e3b\u8981\u4ee3\u8868\u5305\u62ec FCGF (ICCV 2019) , D3Feat (CVPR2020) \u548c PREDATOR (CVPR2021) . Open3D\u7684\u4f7f\u7528 \uff1a\u6700\u540e\u4f46\u4e5f\u662f\u5f88\u91cd\u8981\u7684\u4e00\u73af\uff0c\u4e00\u4e2a\u9ad8\u6548\u5904\u7406\u70b9\u4e91\u7684\u5de5\u5177\uff0c\u63a8\u8350 Open3D \u3002Open3D \u63d0\u4f9b\u4e86 4 \u4e2a\u548c\u914d\u51c6\u6709\u5173\u7684\u51fd\u6570\uff0c\u5305\u62ec ICP \u53ca\u5176\u53d8\u79cd\uff0c\u57fa\u4e8e RANSAC \u7684\u7b97\u6cd5\u548c FGR \u7b97\u6cd5\u7b49\u3002","title":"\u70b9\u4e91\u914d\u51c6"},{"location":"cv/utils/","text":"\u5de5\u5177 \u00b6 Abstract \u5904\u7406\u6570\u636e\u7b49\u76f8\u5173\u5de5\u5177 Table of Contents \u00b6 COLMAP","title":"\u5de5\u5177"},{"location":"cv/utils/#_1","text":"Abstract \u5904\u7406\u6570\u636e\u7b49\u76f8\u5173\u5de5\u5177","title":"\u5de5\u5177"},{"location":"cv/utils/#table-of-contents","text":"COLMAP","title":"Table of Contents"},{"location":"cv/utils/colmap/","text":"COLMAP \u00b6 \u7ea6 475 \u4e2a\u5b57 67 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract COLMAP \u662f\u4e00\u79cd\u901a\u7528\u7684\u8fd0\u52a8\u7ed3\u6784(SfM) \u548c\u591a\u89c6\u56fe\u7acb\u4f53(MVS) \u7ba1\u9053\uff0c\u5177\u6709\u56fe\u5f62\u548c\u547d\u4ee4\u884c\u754c\u9762\u3002 \u4ee5\u4e0b\u7684\u5b9e\u9a8c\u73af\u5883\uff1aUbuntu 20.04\uff08\u5bbf\u4e3b\u673a \uff09\u3001Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09\u3001CUDA 11.8 Installation \u00b6 Dependencies \u00b6 sudo apt-get install \\ git \\ cmake \\ ninja-build \\ build-essential \\ libboost-program-options-dev \\ libboost-filesystem-dev \\ libboost-graph-dev \\ libboost-system-dev \\ libeigen3-dev \\ libflann-dev \\ libfreeimage-dev \\ libmetis-dev \\ libgoogle-glog-dev \\ libgtest-dev \\ libgmock-dev \\ libsqlite3-dev \\ libglew-dev \\ qtbase5-dev \\ libqt5opengl5-dev \\ libcgal-dev \\ libceres-dev \u652f\u6301 CUDA\uff08\u5bbf\u4e3b\u673a\u91cc\uff09\uff0cdocker run \u7684\u53c2\u6570\u6dfb\u52a0 --gpus sudo apt-get install -y \\ nvidia-cuda-toolkit \\ nvidia-cuda-toolkit-gcc Configure and Compile \u00b6 git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build cmake .. -GNinja ninja sudo ninja install nvcc fatal : unsupported gpu architecture \u2018compute_native\u2019 # \u5728 colmap/cmake/FindDependencies.cmake \u4e2d\u6dfb\u52a0\u4e00\u53e5 `set(CMAKE_CUDA_ARCHITECTURES \"80\")`\uff0c\u5982\u4e0b\u6240\u793a\uff1a set(CMAKE_CUDA_ARCHITECTURES \"80\") if(CUDA_ENABLED AND CUDA_FOUND) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES \"native\") endif() Experiment \u00b6 \u542f\u52a8 COLMAP colmap gui \u70b9\u51fb Reconstruction > Automatic Reconstruction \u8fdb\u884c\u4e00\u7cfb\u5217\u57fa\u672c\u8bbe\u7f6e\u540e\uff0c\u8f93\u51fa\u7684\u7ed3\u679c\u4f1a\u5199\u5728 workspace folder \u4e2d\uff08\u5982\u679c\u56fe\u50cf\u5728 path/to/project/images \u4e2d\uff0c\u90a3\u4e48\u5c31\u5e94\u8be5\u9009\u62e9 path/to/project \u4f5c\u4e3a workspace \uff09 \u8fd0\u884c Automatic Reconstruction \u540e\uff0c\u6587\u4ef6\u5939\u751f\u6210\u4e3a +\u2500\u2500 images \u2502 +\u2500\u2500 image1.jpg \u2502 +\u2500\u2500 image2.jpg \u2502 +\u2500\u2500 ... +\u2500\u2500 sparse \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 cameras.bin \u2502 \u2502 +\u2500\u2500 images.bin \u2502 \u2502 +\u2500\u2500 points3D.bin \u2502 +\u2500\u2500 ... +\u2500\u2500 dense \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 images \u2502 \u2502 +\u2500\u2500 sparse \u2502 \u2502 +\u2500\u2500 stereo \u2502 \u2502 +\u2500\u2500 fused.ply \u2502 \u2502 +\u2500\u2500 meshed-poisson.ply \u2502 \u2502 +\u2500\u2500 meshed-delaunay.ply \u2502 +\u2500\u2500 ... +\u2500\u2500 database.db \u6587\u4ef6\u5939\u4f5c\u7528 path/to/project/sparse \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a00\u758f\u6a21\u578b path/to/project/dense \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a20\u5bc6\u6a21\u578b fused.ply \uff1a\u53ef\u4ee5\u52a0\u8f7d\u5230 COLMAP \u56fe\u5f62\u754c\u9762\uff0c\u4ece File > Import model from ... \u7a20\u5bc6\u7684\u7f51\u683c\u53ea\u80fd\u7528\u5916\u90e8\u67e5\u770b\u5668\uff08 MeshLab \uff09\u53ef\u89c6\u5316 \u751f\u6210\u7684\u6587\u4ef6\u5939\u4e0d\u80fd\u76f4\u63a5\u7528\u4e8e NGP \u6216 3DGS 3DGS \u5728 3DGS \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python convert.py -s location [ --resize ] #If not resizing, ImageMagick is not needed \u5c06\u56fe\u7247\u6253\u5305\u6210\u5982\u4e0b\u518d\u6267\u884c\u811a\u672c location |---input |--- |--- |---... \u5982\u679c\u662f\u89c6\u9891\uff0c\u5148\u7528 ffmpeg \u62bd\u5e27 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg instant-NGP \u5728 instant-NGP \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python scripts \\c olmap2nerf.py --video_in [ mp4 ] --run_colmap --colmap_db data \\d ata_classroom \\c olmap.db --text data \\d ata_classroom \\t ext_colmap --aabb_scale 16 --out data \\d ata_classroom \\t ransforms.json --colmap_matcher exhaustive --video_fps 8 Picture Capture Process \u00b6 \u62cd\u6444\u7684\u56fe\u7247\u5e94\u5177\u6709\u4e30\u5bcc\u7684\u7eb9\u7406\u3002\u6700\u597d\u907f\u514d\u7eb9\u7406\u7279\u522b\u5c11\u7684\u56fe\u7247\u5982\u4e00\u5f20\u767d\u5899\u6216\u7a7a\u684c\u56fe\u7247\u3002\u901a\u8fc7\u52a0\u5165\u4e00\u4e9b\u7269\u54c1\u6765\u4e30\u5bcc\u7eb9\u7406 \u5177\u5907\u76f8\u4f3c\u7684\u5149\u7167\u60c5\u51b5\u3002\u907f\u514d high dynamic range scenes \uff08\u5982\u6709\u592a\u9633\u6709\u5f71\u5b50\uff0c\u7a7f\u8fc7\u95e8\u6216\u7a97\u62cd\u6444\uff09\u3002\u907f\u514d\u955c\u9762\u53cd\u5c04 \u5177\u6709\u9ad8\u5ea6\u89c6\u89c9\u91cd\u53e0\u7684\u56fe\u7247\u3002\u786e\u4fdd\u4e00\u4e2a\u7269\u4f53\u81f3\u5c11\u6709\u4e09\u5f20\u56fe\u7247\uff0c\u5c3d\u91cf\u591a\u4e00\u70b9 \u591a\u89c6\u56fe\u62cd\u6444\u3002\u4e0d\u8981\u901a\u8fc7\u5e73\u79fb\u65cb\u8f6c\u76f8\u673a\u6765\u4ece\u540c\u4e00\u4e2a\u65b9\u5411\u62cd\u6444\u3002\u4f46\u786e\u4fdd\u76f8\u4f3c\u89c6\u89d2\u6709\u5c11\u4e14\u7cbe\u7684\u56fe\u7247\uff0c\u5e76\u4e0d\u662f\u8d8a\u591a\u8d8a\u597d\u3002\u5982\u679c\u662f\u89c6\u9891\uff0c\u8bf7\u51cf\u5c11\u5e27\u7387\u3002 Reference \u00b6 Installation \u2014 COLMAP 3.11.0.dev0 documentation \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014Linux\u5b9e\u73b0COLMAP_linux colmap-CSDN\u535a\u5ba2 ColMap\u4f7f\u7528 | \u60a0\u95f2\u306e\u5c0f\u5c4b \u4e09\u7ef4\u91cd\u5efainstant-ngp\u73af\u5883\u90e8\u7f72\u4e0ecolmap\u3001ffmpeg\u7684\u811a\u672c\u53c2\u6570\u4f7f\u7528 - lefree - \u535a\u5ba2\u56ed","title":"COLMAP"},{"location":"cv/utils/colmap/#colmap","text":"\u7ea6 475 \u4e2a\u5b57 67 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract COLMAP \u662f\u4e00\u79cd\u901a\u7528\u7684\u8fd0\u52a8\u7ed3\u6784(SfM) \u548c\u591a\u89c6\u56fe\u7acb\u4f53(MVS) \u7ba1\u9053\uff0c\u5177\u6709\u56fe\u5f62\u548c\u547d\u4ee4\u884c\u754c\u9762\u3002 \u4ee5\u4e0b\u7684\u5b9e\u9a8c\u73af\u5883\uff1aUbuntu 20.04\uff08\u5bbf\u4e3b\u673a \uff09\u3001Docker 11.8.0-cudnn8-devel-ubuntu22.04\uff08\u955c\u50cf\uff09\u3001CUDA 11.8","title":"COLMAP"},{"location":"cv/utils/colmap/#installation","text":"","title":"Installation"},{"location":"cv/utils/colmap/#dependencies","text":"sudo apt-get install \\ git \\ cmake \\ ninja-build \\ build-essential \\ libboost-program-options-dev \\ libboost-filesystem-dev \\ libboost-graph-dev \\ libboost-system-dev \\ libeigen3-dev \\ libflann-dev \\ libfreeimage-dev \\ libmetis-dev \\ libgoogle-glog-dev \\ libgtest-dev \\ libgmock-dev \\ libsqlite3-dev \\ libglew-dev \\ qtbase5-dev \\ libqt5opengl5-dev \\ libcgal-dev \\ libceres-dev \u652f\u6301 CUDA\uff08\u5bbf\u4e3b\u673a\u91cc\uff09\uff0cdocker run \u7684\u53c2\u6570\u6dfb\u52a0 --gpus sudo apt-get install -y \\ nvidia-cuda-toolkit \\ nvidia-cuda-toolkit-gcc","title":"Dependencies"},{"location":"cv/utils/colmap/#configure-and-compile","text":"git clone https://github.com/colmap/colmap.git cd colmap mkdir build cd build cmake .. -GNinja ninja sudo ninja install nvcc fatal : unsupported gpu architecture \u2018compute_native\u2019 # \u5728 colmap/cmake/FindDependencies.cmake \u4e2d\u6dfb\u52a0\u4e00\u53e5 `set(CMAKE_CUDA_ARCHITECTURES \"80\")`\uff0c\u5982\u4e0b\u6240\u793a\uff1a set(CMAKE_CUDA_ARCHITECTURES \"80\") if(CUDA_ENABLED AND CUDA_FOUND) if(NOT DEFINED CMAKE_CUDA_ARCHITECTURES) set(CMAKE_CUDA_ARCHITECTURES \"native\") endif()","title":"Configure and Compile"},{"location":"cv/utils/colmap/#experiment","text":"\u542f\u52a8 COLMAP colmap gui \u70b9\u51fb Reconstruction > Automatic Reconstruction \u8fdb\u884c\u4e00\u7cfb\u5217\u57fa\u672c\u8bbe\u7f6e\u540e\uff0c\u8f93\u51fa\u7684\u7ed3\u679c\u4f1a\u5199\u5728 workspace folder \u4e2d\uff08\u5982\u679c\u56fe\u50cf\u5728 path/to/project/images \u4e2d\uff0c\u90a3\u4e48\u5c31\u5e94\u8be5\u9009\u62e9 path/to/project \u4f5c\u4e3a workspace \uff09 \u8fd0\u884c Automatic Reconstruction \u540e\uff0c\u6587\u4ef6\u5939\u751f\u6210\u4e3a +\u2500\u2500 images \u2502 +\u2500\u2500 image1.jpg \u2502 +\u2500\u2500 image2.jpg \u2502 +\u2500\u2500 ... +\u2500\u2500 sparse \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 cameras.bin \u2502 \u2502 +\u2500\u2500 images.bin \u2502 \u2502 +\u2500\u2500 points3D.bin \u2502 +\u2500\u2500 ... +\u2500\u2500 dense \u2502 +\u2500\u2500 0 \u2502 \u2502 +\u2500\u2500 images \u2502 \u2502 +\u2500\u2500 sparse \u2502 \u2502 +\u2500\u2500 stereo \u2502 \u2502 +\u2500\u2500 fused.ply \u2502 \u2502 +\u2500\u2500 meshed-poisson.ply \u2502 \u2502 +\u2500\u2500 meshed-delaunay.ply \u2502 +\u2500\u2500 ... +\u2500\u2500 database.db \u6587\u4ef6\u5939\u4f5c\u7528 path/to/project/sparse \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a00\u758f\u6a21\u578b path/to/project/dense \uff1a\u91cd\u5efa\u5f97\u5230\u7684\u7a20\u5bc6\u6a21\u578b fused.ply \uff1a\u53ef\u4ee5\u52a0\u8f7d\u5230 COLMAP \u56fe\u5f62\u754c\u9762\uff0c\u4ece File > Import model from ... \u7a20\u5bc6\u7684\u7f51\u683c\u53ea\u80fd\u7528\u5916\u90e8\u67e5\u770b\u5668\uff08 MeshLab \uff09\u53ef\u89c6\u5316 \u751f\u6210\u7684\u6587\u4ef6\u5939\u4e0d\u80fd\u76f4\u63a5\u7528\u4e8e NGP \u6216 3DGS 3DGS \u5728 3DGS \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python convert.py -s location [ --resize ] #If not resizing, ImageMagick is not needed \u5c06\u56fe\u7247\u6253\u5305\u6210\u5982\u4e0b\u518d\u6267\u884c\u811a\u672c location |---input |--- |--- |---... \u5982\u679c\u662f\u89c6\u9891\uff0c\u5148\u7528 ffmpeg \u62bd\u5e27 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg instant-NGP \u5728 instant-NGP \u4e2d\uff0c\u6709\u811a\u672c\u8f6c\u6362 python scripts \\c olmap2nerf.py --video_in [ mp4 ] --run_colmap --colmap_db data \\d ata_classroom \\c olmap.db --text data \\d ata_classroom \\t ext_colmap --aabb_scale 16 --out data \\d ata_classroom \\t ransforms.json --colmap_matcher exhaustive --video_fps 8","title":"Experiment"},{"location":"cv/utils/colmap/#picture-capture-process","text":"\u62cd\u6444\u7684\u56fe\u7247\u5e94\u5177\u6709\u4e30\u5bcc\u7684\u7eb9\u7406\u3002\u6700\u597d\u907f\u514d\u7eb9\u7406\u7279\u522b\u5c11\u7684\u56fe\u7247\u5982\u4e00\u5f20\u767d\u5899\u6216\u7a7a\u684c\u56fe\u7247\u3002\u901a\u8fc7\u52a0\u5165\u4e00\u4e9b\u7269\u54c1\u6765\u4e30\u5bcc\u7eb9\u7406 \u5177\u5907\u76f8\u4f3c\u7684\u5149\u7167\u60c5\u51b5\u3002\u907f\u514d high dynamic range scenes \uff08\u5982\u6709\u592a\u9633\u6709\u5f71\u5b50\uff0c\u7a7f\u8fc7\u95e8\u6216\u7a97\u62cd\u6444\uff09\u3002\u907f\u514d\u955c\u9762\u53cd\u5c04 \u5177\u6709\u9ad8\u5ea6\u89c6\u89c9\u91cd\u53e0\u7684\u56fe\u7247\u3002\u786e\u4fdd\u4e00\u4e2a\u7269\u4f53\u81f3\u5c11\u6709\u4e09\u5f20\u56fe\u7247\uff0c\u5c3d\u91cf\u591a\u4e00\u70b9 \u591a\u89c6\u56fe\u62cd\u6444\u3002\u4e0d\u8981\u901a\u8fc7\u5e73\u79fb\u65cb\u8f6c\u76f8\u673a\u6765\u4ece\u540c\u4e00\u4e2a\u65b9\u5411\u62cd\u6444\u3002\u4f46\u786e\u4fdd\u76f8\u4f3c\u89c6\u89d2\u6709\u5c11\u4e14\u7cbe\u7684\u56fe\u7247\uff0c\u5e76\u4e0d\u662f\u8d8a\u591a\u8d8a\u597d\u3002\u5982\u679c\u662f\u89c6\u9891\uff0c\u8bf7\u51cf\u5c11\u5e27\u7387\u3002","title":"Picture Capture Process"},{"location":"cv/utils/colmap/#reference","text":"Installation \u2014 COLMAP 3.11.0.dev0 documentation \u5b9e\u9a8c\u7b14\u8bb0\u4e4b\u2014\u2014Linux\u5b9e\u73b0COLMAP_linux colmap-CSDN\u535a\u5ba2 ColMap\u4f7f\u7528 | \u60a0\u95f2\u306e\u5c0f\u5c4b \u4e09\u7ef4\u91cd\u5efainstant-ngp\u73af\u5883\u90e8\u7f72\u4e0ecolmap\u3001ffmpeg\u7684\u811a\u672c\u53c2\u6570\u4f7f\u7528 - lefree - \u535a\u5ba2\u56ed","title":"Reference"},{"location":"llm/","text":"\u5927\u6a21\u578b \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u5927\u6a21\u578b\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5b66\u4e60\u81ea \u3010\u6e05\u534eNLP\u3011\u5218\u77e5\u8fdc\u56e2\u961f\u5927\u6a21\u578b\u516c\u5f00\u8bfe Table of Contents \u00b6 NLP Word2Vec 2807 9 mins 1702028944 RNN 2811 13 10 mins 1702028944 Transformer ViT 1501 128 7 mins 1711438560 BERT 1562 5 mins 1702478901 Transformer 2247 84 9 mins 1702361865 Attention 2747 9 mins 1702124671 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 1190 66 5 mins 1706082492 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 422 14 2 mins 1705733146 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb 227 1 mins 1704961196 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 167 250 4 mins 1704961196 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2471 534 15 mins 1704961196 \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 166 1 mins 1704727490 \u6742\u9879 Prompt 149 57 1 mins 1705664210 \u5206\u5e03\u5f0f\u8bad\u7ec3 1636 5 mins 1705664210 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u5927\u6a21\u578b"},{"location":"llm/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u5927\u6a21\u578b\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 \u5b66\u4e60\u81ea \u3010\u6e05\u534eNLP\u3011\u5218\u77e5\u8fdc\u56e2\u961f\u5927\u6a21\u578b\u516c\u5f00\u8bfe","title":"\u5927\u6a21\u578b"},{"location":"llm/#table-of-contents","text":"NLP Word2Vec 2807 9 mins 1702028944 RNN 2811 13 10 mins 1702028944 Transformer ViT 1501 128 7 mins 1711438560 BERT 1562 5 mins 1702478901 Transformer 2247 84 9 mins 1702361865 Attention 2747 9 mins 1702124671 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 1190 66 5 mins 1706082492 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b 422 14 2 mins 1705733146 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb 227 1 mins 1704961196 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo 167 250 4 mins 1704961196 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 2471 534 15 mins 1704961196 \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 166 1 mins 1704727490 \u6742\u9879 Prompt 149 57 1 mins 1705664210 \u5206\u5e03\u5f0f\u8bad\u7ec3 1636 5 mins 1705664210 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"llm/internlm/","text":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425 \u00b6 Abstract \u5f52\u6863\u6709\u5173\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425\u7684\u8bfe\u7a0b\u7b14\u8bb0\u3002 \u4ed3\u5e93\u5730\u5740\uff1a InternLM/tutorial \u7b97\u529b\u5e73\u53f0\uff1a InternStudio Table of Contents \u00b6 \u8bfe\u7a0b\u65f6\u95f4 \u8bfe\u7a0b\u5185\u5bb9 \u8bb2\u5e08 \u7b2c 1 \u8282 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u9648\u607a \u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4\u9752\u5e74\u79d1\u5b66\u5bb6 \u7b2c 2 \u8282 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo \u5b8b\u5fd7\u5b66d2l-ai-solutions-manual \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 3 \u8282 \u57fa\u4e8e InternLM \u548c Langchain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u90b9\u96e8\u8861prompt-engineering-for-developers \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 4 \u8282 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 \u6c6a\u5468\u8c26XTuner \u793e\u533a\u8d21\u732e\u8005 \u7b2c 5 \u8282 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u957f\u7434HuggingLLM\u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 6 \u8282 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b\u89e3\u8bfb\u53ca\u5b9e\u6218\u6307\u5357 \u66f9\u8302\u677eOpenCompass \u6838\u5fc3\u5f00\u53d1\u8005\u738b\u52aaOpenCompass \u793e\u533a\u8d21\u732e\u8005 \u7b2c 7 \u8282 \u5f69\u86cb\u73af\u8282 \u795e\u79d8\u5609\u5bbe","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425"},{"location":"llm/internlm/#_1","text":"Abstract \u5f52\u6863\u6709\u5173\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425\u7684\u8bfe\u7a0b\u7b14\u8bb0\u3002 \u4ed3\u5e93\u5730\u5740\uff1a InternLM/tutorial \u7b97\u529b\u5e73\u53f0\uff1a InternStudio","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5b9e\u6218\u8425"},{"location":"llm/internlm/#table-of-contents","text":"\u8bfe\u7a0b\u65f6\u95f4 \u8bfe\u7a0b\u5185\u5bb9 \u8bb2\u5e08 \u7b2c 1 \u8282 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u9648\u607a \u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4\u9752\u5e74\u79d1\u5b66\u5bb6 \u7b2c 2 \u8282 \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo \u5b8b\u5fd7\u5b66d2l-ai-solutions-manual \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 3 \u8282 \u57fa\u4e8e InternLM \u548c Langchain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u90b9\u96e8\u8861prompt-engineering-for-developers \u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 4 \u8282 XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 \u6c6a\u5468\u8c26XTuner \u793e\u533a\u8d21\u732e\u8005 \u7b2c 5 \u8282 LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u957f\u7434HuggingLLM\u5f00\u6e90\u9879\u76ee\u8d1f\u8d23\u4eba \u7b2c 6 \u8282 OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b\u89e3\u8bfb\u53ca\u5b9e\u6218\u6307\u5357 \u66f9\u8302\u677eOpenCompass \u6838\u5fc3\u5f00\u53d1\u8005\u738b\u52aaOpenCompass \u793e\u533a\u8d21\u732e\u8005 \u7b2c 7 \u8282 \u5f69\u86cb\u73af\u8282 \u795e\u79d8\u5609\u5bbe","title":"Table of Contents"},{"location":"llm/internlm/lec1/","text":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u00b6 \u7ea6 223 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u7cfb\u5217 \u00b6 \u8f7b\u91cf\u7ea7\uff1aInternLM-7B \u4e2d\u91cf\u7ea7\uff1aInternLM-20B \u91cd\u91cf\u7ea7\uff1aInternLM-123B \u4ece\u6a21\u578b\u5230\u5e94\u7528 \u00b6 \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb \u00b6 \u6570\u636e\uff1a\u4e66\u751f\u00b7\u4e07\u5377 \u00b6 \u5177\u4f53\u67e5\u770b openDataLab \u3002 \u9884\u8bad\u7ec3\uff1aInternLM-Train \u00b6 \u5fae\u8c03\uff1aXTuner \u00b6 \u5927\u8bed\u8a00\u6a21\u578b\u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c\u589e\u91cf\u7eed\u8bad\u548c\u6709\u76d1\u7763\u5fae\u8c03\u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u65b9\u5f0f\u3002 \u589e\u91cf\u7eed\u8bad \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u6570\u636e\u3001\u4ee3\u7801\u7b49 \u6709\u76d1\u7763\u5fae\u8c03 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u7406\u89e3\u548c\u9075\u5faa\u5404\u79cd\u6307\u4ee4\uff0c\u6216\u8005\u6ce8\u5165\u5c11\u8bb8\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\u3001\u95ee\u7b54\u6570\u636e \u8bc4\u6d4b\uff1aOpenCompass \u00b6 \u90e8\u7f72\uff1aLMDeploy \u00b6 \u5e94\u7528\uff1aLagent\u3001AgentLego \u00b6","title":"\u7b2c\u4e00\u8282"},{"location":"llm/internlm/lec1/#_1","text":"\u7ea6 223 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb"},{"location":"llm/internlm/lec1/#_2","text":"\u8f7b\u91cf\u7ea7\uff1aInternLM-7B \u4e2d\u91cf\u7ea7\uff1aInternLM-20B \u91cd\u91cf\u7ea7\uff1aInternLM-123B","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u7cfb\u5217"},{"location":"llm/internlm/lec1/#_3","text":"","title":"\u4ece\u6a21\u578b\u5230\u5e94\u7528"},{"location":"llm/internlm/lec1/#_4","text":"","title":"\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u5168\u94fe\u8def\u5f00\u6e90\u5f00\u653e\u4f53\u7cfb"},{"location":"llm/internlm/lec1/#_5","text":"\u5177\u4f53\u67e5\u770b openDataLab \u3002","title":"\u6570\u636e\uff1a\u4e66\u751f\u00b7\u4e07\u5377"},{"location":"llm/internlm/lec1/#internlm-train","text":"","title":"\u9884\u8bad\u7ec3\uff1aInternLM-Train"},{"location":"llm/internlm/lec1/#xtuner","text":"\u5927\u8bed\u8a00\u6a21\u578b\u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c\u589e\u91cf\u7eed\u8bad\u548c\u6709\u76d1\u7763\u5fae\u8c03\u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u65b9\u5f0f\u3002 \u589e\u91cf\u7eed\u8bad \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u6570\u636e\u3001\u4ee3\u7801\u7b49 \u6709\u76d1\u7763\u5fae\u8c03 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u7406\u89e3\u548c\u9075\u5faa\u5404\u79cd\u6307\u4ee4\uff0c\u6216\u8005\u6ce8\u5165\u5c11\u8bb8\u9886\u57df\u77e5\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\u3001\u95ee\u7b54\u6570\u636e","title":"\u5fae\u8c03\uff1aXTuner"},{"location":"llm/internlm/lec1/#opencompass","text":"","title":"\u8bc4\u6d4b\uff1aOpenCompass"},{"location":"llm/internlm/lec1/#lmdeploy","text":"","title":"\u90e8\u7f72\uff1aLMDeploy"},{"location":"llm/internlm/lec1/#lagentagentlego","text":"","title":"\u5e94\u7528\uff1aLagent\u3001AgentLego"},{"location":"llm/internlm/lec2/","text":"\u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo \u00b6 \u7ea6 163 \u4e2a\u5b57 250 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo InternLM-Chat-7B \u667a\u80fd\u5bf9\u8bdd \u00b6 Terminal Demo \u00b6 cli_demo.py import torch from transformers import AutoTokenizer , AutoModelForCausalLM model_name_or_path = \"/root/model/Shanghai_AI_Laboratory/internlm-chat-7b\" tokenizer = AutoTokenizer . from_pretrained ( model_name_or_path , trust_remote_code = True ) model = AutoModelForCausalLM . from_pretrained ( model_name_or_path , trust_remote_code = True , torch_dtype = torch . bfloat16 , device_map = 'auto' ) model = model . eval () system_prompt = \"\"\"You are an AI assistant whose name is InternLM (\u4e66\u751f\u00b7\u6d66\u8bed). - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) is a conversational language model that is developed by Shanghai AI Laboratory (\u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4). It is designed to be helpful, honest, and harmless. - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) can understand and communicate fluently in the language chosen by the user such as English and \u4e2d\u6587. \"\"\" messages = [( system_prompt , '' )] print ( \"=============Welcome to InternLM chatbot, type 'exit' to exit.=============\" ) while True : input_text = input ( \"User >>> \" ) input_text . replace ( ' ' , '' ) if input_text == \"exit\" : break response , history = model . chat ( tokenizer , input_text , history = messages ) messages . append (( input_text , response )) print ( f \"robot >>> { response } \" ) python /root/code/InternLM/cli_demo.py Web Demo \u00b6 streamlit run /root/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006 Lagent \u667a\u80fd\u4f53\u5de5\u5177\u8c03\u7528 \u00b6 react_web_demo.py import copy import os import streamlit as st from streamlit.logger import get_logger from lagent.actions import ActionExecutor , GoogleSearch , PythonInterpreter from lagent.agents.react import ReAct from lagent.llms import GPTAPI from lagent.llms.huggingface import HFTransformerCasualLM class SessionState : def init_state ( self ): \"\"\"Initialize session state variables.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] #action_list = [PythonInterpreter(), GoogleSearch()] action_list = [ PythonInterpreter ()] st . session_state [ 'plugin_map' ] = { action . name : action for action in action_list } st . session_state [ 'model_map' ] = {} st . session_state [ 'model_selected' ] = None st . session_state [ 'plugin_actions' ] = set () def clear_state ( self ): \"\"\"Clear the existing session state.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] st . session_state [ 'model_selected' ] = None if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _session_history = [] class StreamlitUI : def __init__ ( self , session_state : SessionState ): self . init_streamlit () self . session_state = session_state def init_streamlit ( self ): \"\"\"Initialize Streamlit's UI settings.\"\"\" st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') st . sidebar . title ( '\u6a21\u578b\u63a7\u5236' ) def setup_sidebar ( self ): \"\"\"Setup the sidebar for model and plugin selection.\"\"\" model_name = st . sidebar . selectbox ( '\u6a21\u578b\u9009\u62e9\uff1a' , options = [ 'gpt-3.5-turbo' , 'internlm' ]) if model_name != st . session_state [ 'model_selected' ]: model = self . init_model ( model_name ) self . session_state . clear_state () st . session_state [ 'model_selected' ] = model_name if 'chatbot' in st . session_state : del st . session_state [ 'chatbot' ] else : model = st . session_state [ 'model_map' ][ model_name ] plugin_name = st . sidebar . multiselect ( '\u63d2\u4ef6\u9009\u62e9' , options = list ( st . session_state [ 'plugin_map' ] . keys ()), default = [ list ( st . session_state [ 'plugin_map' ] . keys ())[ 0 ]], ) plugin_action = [ st . session_state [ 'plugin_map' ][ name ] for name in plugin_name ] if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _action_executor = ActionExecutor ( actions = plugin_action ) if st . sidebar . button ( '\u6e05\u7a7a\u5bf9\u8bdd' , key = 'clear' ): self . session_state . clear_state () uploaded_file = st . sidebar . file_uploader ( '\u4e0a\u4f20\u6587\u4ef6' , type = [ 'png' , 'jpg' , 'jpeg' , 'mp4' , 'mp3' , 'wav' ]) return model_name , model , plugin_action , uploaded_file def init_model ( self , option ): \"\"\"Initialize the model based on the selected option.\"\"\" if option not in st . session_state [ 'model_map' ]: if option . startswith ( 'gpt' ): st . session_state [ 'model_map' ][ option ] = GPTAPI ( model_type = option ) else : st . session_state [ 'model_map' ][ option ] = HFTransformerCasualLM ( '/root/model/Shanghai_AI_Laboratory/internlm-chat-7b' ) return st . session_state [ 'model_map' ][ option ] def initialize_chatbot ( self , model , plugin_action ): \"\"\"Initialize the chatbot with the given model and plugin actions.\"\"\" return ReAct ( llm = model , action_executor = ActionExecutor ( actions = plugin_action )) def render_user ( self , prompt : str ): with st . chat_message ( 'user' ): st . markdown ( prompt ) def render_assistant ( self , agent_return ): with st . chat_message ( 'assistant' ): for action in agent_return . actions : if ( action ): self . render_action ( action ) st . markdown ( agent_return . response ) def render_action ( self , action ): with st . expander ( action . type , expanded = True ): st . markdown ( \"

    \u63d2 \u4ef6:\" # noqa E501 + action . type + '

    ' , unsafe_allow_html = True ) st . markdown ( \"

    \u601d\u8003\u6b65\u9aa4:\" # noqa E501 + action . thought + '

    ' , unsafe_allow_html = True ) if ( isinstance ( action . args , dict ) and 'text' in action . args ): st . markdown ( \"

    \u6267\u884c\u5185\u5bb9:

    \" , # noqa E501 unsafe_allow_html = True ) st . markdown ( action . args [ 'text' ]) self . render_action_results ( action ) def render_action_results ( self , action ): \"\"\"Render the results of action, including text, images, videos, and audios.\"\"\" if ( isinstance ( action . result , dict )): st . markdown ( \"

    \u6267\u884c\u7ed3\u679c:

    \" , # noqa E501 unsafe_allow_html = True ) if 'text' in action . result : st . markdown ( \"

    \" + action . result [ 'text' ] + '

    ' , unsafe_allow_html = True ) if 'image' in action . result : image_path = action . result [ 'image' ] image_data = open ( image_path , 'rb' ) . read () st . image ( image_data , caption = 'Generated Image' ) if 'video' in action . result : video_data = action . result [ 'video' ] video_data = open ( video_data , 'rb' ) . read () st . video ( video_data ) if 'audio' in action . result : audio_data = action . result [ 'audio' ] audio_data = open ( audio_data , 'rb' ) . read () st . audio ( audio_data ) def main (): logger = get_logger ( __name__ ) # Initialize Streamlit UI and setup sidebar if 'ui' not in st . session_state : session_state = SessionState () session_state . init_state () st . session_state [ 'ui' ] = StreamlitUI ( session_state ) else : st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') model_name , model , plugin_action , uploaded_file = st . session_state [ 'ui' ] . setup_sidebar () # Initialize chatbot if it is not already initialized # or if the model has changed if 'chatbot' not in st . session_state or model != st . session_state [ 'chatbot' ] . _llm : st . session_state [ 'chatbot' ] = st . session_state [ 'ui' ] . initialize_chatbot ( model , plugin_action ) for prompt , agent_return in zip ( st . session_state [ 'user' ], st . session_state [ 'assistant' ]): st . session_state [ 'ui' ] . render_user ( prompt ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) # User input form at the bottom (this part will be at the bottom) # with st.form(key='my_form', clear_on_submit=True): if user_input := st . chat_input ( '' ): st . session_state [ 'ui' ] . render_user ( user_input ) st . session_state [ 'user' ] . append ( user_input ) # Add file uploader to sidebar if uploaded_file : file_bytes = uploaded_file . read () file_type = uploaded_file . type if 'image' in file_type : st . image ( file_bytes , caption = 'Uploaded Image' ) elif 'video' in file_type : st . video ( file_bytes , caption = 'Uploaded Video' ) elif 'audio' in file_type : st . audio ( file_bytes , caption = 'Uploaded Audio' ) # Save the file to a temporary location and get the path file_path = os . path . join ( root_dir , uploaded_file . name ) with open ( file_path , 'wb' ) as tmpfile : tmpfile . write ( file_bytes ) st . write ( f 'File saved at: { file_path } ' ) user_input = '\u6211\u4e0a\u4f20\u4e86\u4e00\u4e2a\u56fe\u50cf\uff0c\u8def\u5f84\u4e3a: {file_path} . {user_input} ' . format ( file_path = file_path , user_input = user_input ) agent_return = st . session_state [ 'chatbot' ] . chat ( user_input ) st . session_state [ 'assistant' ] . append ( copy . deepcopy ( agent_return )) logger . info ( agent_return . inner_steps ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) if __name__ == '__main__' : root_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ))) root_dir = os . path . join ( root_dir , 'tmp_dir' ) os . makedirs ( root_dir , exist_ok = True ) main () streamlit run /root/code/lagent/examples/react_web_demo.py --server.address 127 .0.0.1 --server.port 6006 \u6d66\u8bed\u00b7\u7075\u7b14\u56fe\u6587\u7406\u89e3\u521b\u4f5c \u00b6 python /root/code/InternLM-XComposer/examples/web_demo.py \\ --folder /root/model/Shanghai_AI_Laboratory/internlm-xcomposer-7b \\ --num_gpus 1 \\ --port 6006 \u4f5c\u4e1a \u00b6 \u4f7f\u7528 InternLM-Chat-7B \u6a21\u578b\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09\u3002 \u719f\u6089 hugging face \u4e0b\u8f7d\u529f\u80fd\uff0c\u4f7f\u7528 huggingface_hub python \u5305\uff0c\u4e0b\u8f7d InternLM-20B \u7684 config.json \u6587\u4ef6\u5230\u672c\u5730\uff08\u9700\u622a\u56fe\u4e0b\u8f7d\u8fc7\u7a0b\uff09\u3002 \u5b8c\u6210\u6d66\u8bed\u00b7\u7075\u7b14\u7684\u56fe\u6587\u7406\u89e3\u53ca\u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a \u5b8c\u6210 Lagent \u5de5\u5177\u8c03\u7528 Demo \u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a","title":"\u7b2c\u4e8c\u8282"},{"location":"llm/internlm/lec2/#demo","text":"\u7ea6 163 \u4e2a\u5b57 250 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 4 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo","title":"\u8f7b\u677e\u5206\u949f\u73a9\u8f6c\u4e66\u751f\u00b7\u6d66\u8bed\u5927\u6a21\u578b\u8da3\u5473 Demo"},{"location":"llm/internlm/lec2/#internlm-chat-7b","text":"","title":"InternLM-Chat-7B \u667a\u80fd\u5bf9\u8bdd"},{"location":"llm/internlm/lec2/#terminal-demo","text":"cli_demo.py import torch from transformers import AutoTokenizer , AutoModelForCausalLM model_name_or_path = \"/root/model/Shanghai_AI_Laboratory/internlm-chat-7b\" tokenizer = AutoTokenizer . from_pretrained ( model_name_or_path , trust_remote_code = True ) model = AutoModelForCausalLM . from_pretrained ( model_name_or_path , trust_remote_code = True , torch_dtype = torch . bfloat16 , device_map = 'auto' ) model = model . eval () system_prompt = \"\"\"You are an AI assistant whose name is InternLM (\u4e66\u751f\u00b7\u6d66\u8bed). - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) is a conversational language model that is developed by Shanghai AI Laboratory (\u4e0a\u6d77\u4eba\u5de5\u667a\u80fd\u5b9e\u9a8c\u5ba4). It is designed to be helpful, honest, and harmless. - InternLM (\u4e66\u751f\u00b7\u6d66\u8bed) can understand and communicate fluently in the language chosen by the user such as English and \u4e2d\u6587. \"\"\" messages = [( system_prompt , '' )] print ( \"=============Welcome to InternLM chatbot, type 'exit' to exit.=============\" ) while True : input_text = input ( \"User >>> \" ) input_text . replace ( ' ' , '' ) if input_text == \"exit\" : break response , history = model . chat ( tokenizer , input_text , history = messages ) messages . append (( input_text , response )) print ( f \"robot >>> { response } \" ) python /root/code/InternLM/cli_demo.py","title":"Terminal Demo"},{"location":"llm/internlm/lec2/#web-demo","text":"streamlit run /root/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006","title":"Web Demo"},{"location":"llm/internlm/lec2/#lagent","text":"react_web_demo.py import copy import os import streamlit as st from streamlit.logger import get_logger from lagent.actions import ActionExecutor , GoogleSearch , PythonInterpreter from lagent.agents.react import ReAct from lagent.llms import GPTAPI from lagent.llms.huggingface import HFTransformerCasualLM class SessionState : def init_state ( self ): \"\"\"Initialize session state variables.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] #action_list = [PythonInterpreter(), GoogleSearch()] action_list = [ PythonInterpreter ()] st . session_state [ 'plugin_map' ] = { action . name : action for action in action_list } st . session_state [ 'model_map' ] = {} st . session_state [ 'model_selected' ] = None st . session_state [ 'plugin_actions' ] = set () def clear_state ( self ): \"\"\"Clear the existing session state.\"\"\" st . session_state [ 'assistant' ] = [] st . session_state [ 'user' ] = [] st . session_state [ 'model_selected' ] = None if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _session_history = [] class StreamlitUI : def __init__ ( self , session_state : SessionState ): self . init_streamlit () self . session_state = session_state def init_streamlit ( self ): \"\"\"Initialize Streamlit's UI settings.\"\"\" st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') st . sidebar . title ( '\u6a21\u578b\u63a7\u5236' ) def setup_sidebar ( self ): \"\"\"Setup the sidebar for model and plugin selection.\"\"\" model_name = st . sidebar . selectbox ( '\u6a21\u578b\u9009\u62e9\uff1a' , options = [ 'gpt-3.5-turbo' , 'internlm' ]) if model_name != st . session_state [ 'model_selected' ]: model = self . init_model ( model_name ) self . session_state . clear_state () st . session_state [ 'model_selected' ] = model_name if 'chatbot' in st . session_state : del st . session_state [ 'chatbot' ] else : model = st . session_state [ 'model_map' ][ model_name ] plugin_name = st . sidebar . multiselect ( '\u63d2\u4ef6\u9009\u62e9' , options = list ( st . session_state [ 'plugin_map' ] . keys ()), default = [ list ( st . session_state [ 'plugin_map' ] . keys ())[ 0 ]], ) plugin_action = [ st . session_state [ 'plugin_map' ][ name ] for name in plugin_name ] if 'chatbot' in st . session_state : st . session_state [ 'chatbot' ] . _action_executor = ActionExecutor ( actions = plugin_action ) if st . sidebar . button ( '\u6e05\u7a7a\u5bf9\u8bdd' , key = 'clear' ): self . session_state . clear_state () uploaded_file = st . sidebar . file_uploader ( '\u4e0a\u4f20\u6587\u4ef6' , type = [ 'png' , 'jpg' , 'jpeg' , 'mp4' , 'mp3' , 'wav' ]) return model_name , model , plugin_action , uploaded_file def init_model ( self , option ): \"\"\"Initialize the model based on the selected option.\"\"\" if option not in st . session_state [ 'model_map' ]: if option . startswith ( 'gpt' ): st . session_state [ 'model_map' ][ option ] = GPTAPI ( model_type = option ) else : st . session_state [ 'model_map' ][ option ] = HFTransformerCasualLM ( '/root/model/Shanghai_AI_Laboratory/internlm-chat-7b' ) return st . session_state [ 'model_map' ][ option ] def initialize_chatbot ( self , model , plugin_action ): \"\"\"Initialize the chatbot with the given model and plugin actions.\"\"\" return ReAct ( llm = model , action_executor = ActionExecutor ( actions = plugin_action )) def render_user ( self , prompt : str ): with st . chat_message ( 'user' ): st . markdown ( prompt ) def render_assistant ( self , agent_return ): with st . chat_message ( 'assistant' ): for action in agent_return . actions : if ( action ): self . render_action ( action ) st . markdown ( agent_return . response ) def render_action ( self , action ): with st . expander ( action . type , expanded = True ): st . markdown ( \"

    \u63d2 \u4ef6:\" # noqa E501 + action . type + '

    ' , unsafe_allow_html = True ) st . markdown ( \"

    \u601d\u8003\u6b65\u9aa4:\" # noqa E501 + action . thought + '

    ' , unsafe_allow_html = True ) if ( isinstance ( action . args , dict ) and 'text' in action . args ): st . markdown ( \"

    \u6267\u884c\u5185\u5bb9:

    \" , # noqa E501 unsafe_allow_html = True ) st . markdown ( action . args [ 'text' ]) self . render_action_results ( action ) def render_action_results ( self , action ): \"\"\"Render the results of action, including text, images, videos, and audios.\"\"\" if ( isinstance ( action . result , dict )): st . markdown ( \"

    \u6267\u884c\u7ed3\u679c:

    \" , # noqa E501 unsafe_allow_html = True ) if 'text' in action . result : st . markdown ( \"

    \" + action . result [ 'text' ] + '

    ' , unsafe_allow_html = True ) if 'image' in action . result : image_path = action . result [ 'image' ] image_data = open ( image_path , 'rb' ) . read () st . image ( image_data , caption = 'Generated Image' ) if 'video' in action . result : video_data = action . result [ 'video' ] video_data = open ( video_data , 'rb' ) . read () st . video ( video_data ) if 'audio' in action . result : audio_data = action . result [ 'audio' ] audio_data = open ( audio_data , 'rb' ) . read () st . audio ( audio_data ) def main (): logger = get_logger ( __name__ ) # Initialize Streamlit UI and setup sidebar if 'ui' not in st . session_state : session_state = SessionState () session_state . init_state () st . session_state [ 'ui' ] = StreamlitUI ( session_state ) else : st . set_page_config ( layout = 'wide' , page_title = 'lagent-web' , page_icon = './docs/imgs/lagent_icon.png' ) # st.header(':robot_face: :blue[Lagent] Web Demo ', divider='rainbow') model_name , model , plugin_action , uploaded_file = st . session_state [ 'ui' ] . setup_sidebar () # Initialize chatbot if it is not already initialized # or if the model has changed if 'chatbot' not in st . session_state or model != st . session_state [ 'chatbot' ] . _llm : st . session_state [ 'chatbot' ] = st . session_state [ 'ui' ] . initialize_chatbot ( model , plugin_action ) for prompt , agent_return in zip ( st . session_state [ 'user' ], st . session_state [ 'assistant' ]): st . session_state [ 'ui' ] . render_user ( prompt ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) # User input form at the bottom (this part will be at the bottom) # with st.form(key='my_form', clear_on_submit=True): if user_input := st . chat_input ( '' ): st . session_state [ 'ui' ] . render_user ( user_input ) st . session_state [ 'user' ] . append ( user_input ) # Add file uploader to sidebar if uploaded_file : file_bytes = uploaded_file . read () file_type = uploaded_file . type if 'image' in file_type : st . image ( file_bytes , caption = 'Uploaded Image' ) elif 'video' in file_type : st . video ( file_bytes , caption = 'Uploaded Video' ) elif 'audio' in file_type : st . audio ( file_bytes , caption = 'Uploaded Audio' ) # Save the file to a temporary location and get the path file_path = os . path . join ( root_dir , uploaded_file . name ) with open ( file_path , 'wb' ) as tmpfile : tmpfile . write ( file_bytes ) st . write ( f 'File saved at: { file_path } ' ) user_input = '\u6211\u4e0a\u4f20\u4e86\u4e00\u4e2a\u56fe\u50cf\uff0c\u8def\u5f84\u4e3a: {file_path} . {user_input} ' . format ( file_path = file_path , user_input = user_input ) agent_return = st . session_state [ 'chatbot' ] . chat ( user_input ) st . session_state [ 'assistant' ] . append ( copy . deepcopy ( agent_return )) logger . info ( agent_return . inner_steps ) st . session_state [ 'ui' ] . render_assistant ( agent_return ) if __name__ == '__main__' : root_dir = os . path . dirname ( os . path . dirname ( os . path . abspath ( __file__ ))) root_dir = os . path . join ( root_dir , 'tmp_dir' ) os . makedirs ( root_dir , exist_ok = True ) main () streamlit run /root/code/lagent/examples/react_web_demo.py --server.address 127 .0.0.1 --server.port 6006","title":"Lagent \u667a\u80fd\u4f53\u5de5\u5177\u8c03\u7528"},{"location":"llm/internlm/lec2/#_1","text":"python /root/code/InternLM-XComposer/examples/web_demo.py \\ --folder /root/model/Shanghai_AI_Laboratory/internlm-xcomposer-7b \\ --num_gpus 1 \\ --port 6006","title":"\u6d66\u8bed\u00b7\u7075\u7b14\u56fe\u6587\u7406\u89e3\u521b\u4f5c"},{"location":"llm/internlm/lec2/#_2","text":"\u4f7f\u7528 InternLM-Chat-7B \u6a21\u578b\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09\u3002 \u719f\u6089 hugging face \u4e0b\u8f7d\u529f\u80fd\uff0c\u4f7f\u7528 huggingface_hub python \u5305\uff0c\u4e0b\u8f7d InternLM-20B \u7684 config.json \u6587\u4ef6\u5230\u672c\u5730\uff08\u9700\u622a\u56fe\u4e0b\u8f7d\u8fc7\u7a0b\uff09\u3002 \u5b8c\u6210\u6d66\u8bed\u00b7\u7075\u7b14\u7684\u56fe\u6587\u7406\u89e3\u53ca\u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a \u5b8c\u6210 Lagent \u5de5\u5177\u8c03\u7528 Demo \u521b\u4f5c\u90e8\u7f72\uff08\u9700\u622a\u56fe\uff09 \u5982\u4e0a\u56fe\u6240\u793a","title":"\u4f5c\u4e1a"},{"location":"llm/internlm/lec3/","text":"\u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u00b6 \u7ea6 162 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93 \u642d\u5efa\u6d41\u7a0b \u00b6 \u73af\u5883\u914d\u7f6e \u77e5\u8bc6\u5e93\u642d\u5efa \u6570\u636e\u6536\u96c6 \u52a0\u8f7d\u6570\u636e \u6784\u5efa\u5411\u91cf\u6570\u636e\u5e93 \u63a5\u5165 LangChain \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u52a0\u8f7d\u5411\u91cf\u6570\u636e\u5e93 \u5b9e\u4f8b\u5316\u81ea\u5b9a\u4e49 LLM \u4e0e Prompt Template \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u90e8\u7f72 Web Demo \u4f5c\u4e1a \u00b6 \u590d\u73b0\u8bfe\u7a0b\u77e5\u8bc6\u5e93\u52a9\u624b\u642d\u5efa\u8fc7\u7a0b (\u622a\u56fe) \u9009\u62e9\u4e00\u4e2a\u5782\u76f4\u9886\u57df\uff0c\u6536\u96c6\u8be5\u9886\u57df\u7684\u4e13\u4e1a\u8d44\u6599\u6784\u5efa\u4e13\u4e1a\u77e5\u8bc6\u5e93\uff0c\u5e76\u642d\u5efa\u4e13\u4e1a\u95ee\u7b54\u52a9\u624b\uff0c\u5e76\u5728 OpenXLab \u4e0a\u6210\u529f\u90e8\u7f72\uff08\u622a\u56fe\uff0c\u5e76\u63d0\u4f9b\u5e94\u7528\u5730\u5740\uff09","title":"\u7b2c\u4e09\u8282"},{"location":"llm/internlm/lec3/#internlm-langchain","text":"\u7ea6 162 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5b66\u4e60\u81ea \u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93","title":"\u57fa\u4e8e InternLM \u548c LangChain \u642d\u5efa\u4f60\u7684\u77e5\u8bc6\u5e93"},{"location":"llm/internlm/lec3/#_1","text":"\u73af\u5883\u914d\u7f6e \u77e5\u8bc6\u5e93\u642d\u5efa \u6570\u636e\u6536\u96c6 \u52a0\u8f7d\u6570\u636e \u6784\u5efa\u5411\u91cf\u6570\u636e\u5e93 \u63a5\u5165 LangChain \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u52a0\u8f7d\u5411\u91cf\u6570\u636e\u5e93 \u5b9e\u4f8b\u5316\u81ea\u5b9a\u4e49 LLM \u4e0e Prompt Template \u6784\u5efa\u68c0\u7d22\u95ee\u7b54\u94fe \u90e8\u7f72 Web Demo","title":"\u642d\u5efa\u6d41\u7a0b"},{"location":"llm/internlm/lec3/#_2","text":"\u590d\u73b0\u8bfe\u7a0b\u77e5\u8bc6\u5e93\u52a9\u624b\u642d\u5efa\u8fc7\u7a0b (\u622a\u56fe) \u9009\u62e9\u4e00\u4e2a\u5782\u76f4\u9886\u57df\uff0c\u6536\u96c6\u8be5\u9886\u57df\u7684\u4e13\u4e1a\u8d44\u6599\u6784\u5efa\u4e13\u4e1a\u77e5\u8bc6\u5e93\uff0c\u5e76\u642d\u5efa\u4e13\u4e1a\u95ee\u7b54\u52a9\u624b\uff0c\u5e76\u5728 OpenXLab \u4e0a\u6210\u529f\u90e8\u7f72\uff08\u622a\u56fe\uff0c\u5e76\u63d0\u4f9b\u5e94\u7528\u5730\u5740\uff09","title":"\u4f5c\u4e1a"},{"location":"llm/internlm/lec4/","text":"XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 \u00b6 \u7ea6 2467 \u4e2a\u5b57 534 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u5b66\u4e60\u81ea XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218 Finetune \u00b6 LLM \u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c \u589e\u91cf\u9884\u8bad\u7ec3 \u548c \u6307\u4ee4\u8ddf\u968f \u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u7684\u5fae\u8c03\u6a21\u5f0f \u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03 \u00b6 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u5230\u4e00\u4e9b\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u7684\u5e38\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u4e66\u7c4d\u3001\u4ee3\u7801\u7b49 \u4e3a\u4e86\u8ba9 LLM \u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\u4e00\u6bb5\u8bdd\uff0c\u4ec0\u4e48\u65f6\u5019\u7ed3\u675f\u4e00\u6bb5\u8bdd\uff0c\u5b9e\u9645\u8bad\u7ec3\u65f6\u9700\u8981\u5bf9\u6570\u636e\u6dfb\u52a0\u8d77\u59cb\u7b26\uff08BOS\uff09\u548c\u7ed3\u675f\u7b26\uff08EOS\uff09\uff0c\u5927\u591a\u6570\u7684\u6a21\u578b\u90fd\u662f\u4f7f\u7528 \u4f5c\u4e3a\u8d77\u59cb\u7b26\uff0c \u4f5c\u4e3a\u7ed3\u675f\u7b26 \u6307\u4ee4\u8ddf\u968f\u5fae\u8c03 \u00b6 \u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u5bf9\u8bdd\u6a21\u7248\uff0c\u6839\u636e\u4eba\u7c7b\u6307\u4ee4\u8fdb\u884c\u5bf9\u8bdd \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\uff0c\u95ee\u7b54\u6570\u636e \u5728\u5b9e\u9645\u5bf9\u8bdd\u4e2d\uff0c\u901a\u5e38\u4f1a\u6709\u4e09\u79cd\u89d2\u8272 System \u7ed9\u5b9a\u4e00\u4e9b\u4e0a\u4e0b\u6587\uff0c\u6bd4\u5982\u201c\u4f60\u662f\u4e00\u4e2a\u5b89\u5168\u7684 AI \u52a9\u624b\u201d User \u5b9e\u9645\u7528\u6237\uff0c\u4f1a\u63d0\u51fa\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982 \u201c\u4e16\u754c\u7b2c\u4e00\u9ad8\u5cf0\u662f\u201d Assistant \u6839\u636e User \u7684\u8f93\u5165\uff0c\u7ed3\u5408 System \u7684\u4e0a\u4e0b\u6587\u4fe1\u606f\uff0c\u505a\u51fa\u56de\u7b54\uff0c\u6bd4\u5982 \u201c\u73e0\u7a46\u6717\u739b\u5cf0\u201d \u5728\u4f7f\u7528\u5bf9\u8bdd\u6a21\u578b\u65f6\uff0c\u901a\u5e38\u662f\u4e0d\u4f1a\u611f\u77e5\u5230\u8fd9\u4e09\u79cd\u89d2\u8272 \u5bf9\u8bdd\u6a21\u7248 \u4e0d\u540c\u4e8e\u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03\uff0c\u6570\u636e\u4e2d\u4f1a\u6709 Input \u548c Output \u5e0c\u671b\u6a21\u578b\u5b66\u4f1a\u7684\u662f\u7b54\u6848\uff08Output\uff09\uff0c\u800c\u4e0d\u662f\u95ee\u9898\uff08Input\uff09\uff0c\u8bad\u7ec3\u65f6\u53ea\u4f1a\u5bf9\u7b54\u6848\uff08Output\uff09\u90e8\u5206\u8ba1\u7b97 Loss \u8bad\u7ec3\u65f6\uff0c\u4f1a\u548c\u63a8\u7406\u65f6\u4fdd\u6301\u4e00\u81f4\uff0c\u5bf9\u6570\u636e\u6dfb\u52a0\u76f8\u5bf9\u5e94\u7684\u5bf9\u8bdd\u6a21\u7248 LoRA & QLoRA \u00b6 Xtuner \u00b6 \u50bb\u74dc\u5316 \uff1a\u4ee5 \u914d\u7f6e\u6587\u4ef6 \u7684\u5f62\u5f0f\u5c01\u88c5\u4e86\u5927\u90e8\u5206\u5fae\u8c03\u573a\u666f \u8f7b\u91cf\u7ea7 \uff1a\u5bf9\u4e8e 7B \u53c2\u6570\u91cf\u7684 LLM\uff0c\u5fae\u8c03\u6240\u9700\u7684\u6700\u5c0f\u663e\u5b58\u4ec5\u4e3a 8GB \u5feb\u901f\u4e0a\u624b \u00b6 \u4f7f\u7528\u6d41\u7a0b \u00b6 \u5b89\u88c5 pip install xtuner \u6311\u9009\u914d\u7f6e\u6a21\u7248 xtuner list-cfg -p internlm_20b \u4e00\u952e\u8bad\u7ec3 xtuner train internlm_20b_qlora_oasst1_512_e3 Config Description \u6a21\u578b\u540d internlm_20b (\u65e0 chat \u4ee3\u8868\u662f\u57fa\u5ea7\u6a21\u578b) \u4f7f\u7528\u7b97\u6cd5 qlora \u6570\u636e\u96c6 oasst1 \u6570\u636e\u957f\u5ea6 512 Epoch e3, epoch 3 \u81ea\u5b9a\u4e49\u8bad\u7ec3 \u00b6 \u62f7\u8d1d\u914d\u7f6e\u6a21\u7248 \u4fee\u6539\u914d\u7f6e\u6a21\u7248 \u542f\u52a8\u8bad\u7ec3 \u5e38\u7528\u8d85\u53c2 Description data_path \u6570\u636e\u8def\u5f84\u6216 HuggingFace \u4ed3\u5e93\u540d max_length \u5355\u6761\u6570\u636e\u6700\u5927 Token \u6570\uff0c\u8d85\u8fc7\u5219\u622a\u65ad pack_to_max_length \u662f\u5426\u5c06\u591a\u6761\u77ed\u6570\u636e\u62fc\u63a5\u5230 max_length\uff0c\u63d0\u9ad8 GPU \u5229\u7528\u7387 accumulative_counts \u68af\u5ea6\u7d2f\u79ef\uff0c\u6bcf\u591a\u5c11\u6b21 backward \u66f4\u65b0\u4e00\u6b21\u53c2\u6570 evaluation_inputs \u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u6839\u636e\u7ed9\u5b9a\u7684\u95ee\u9898\u8fdb\u884c\u63a8\u7406\uff0c\u4fbf\u4e8e\u89c2\u6d4b\u8bad\u7ec3\u72b6\u6001 evaluation_freq Evaluation \u7684\u6d4b\u8bc4\u95f4\u9694 iter \u6570 \u5bf9\u8bdd \u00b6 \u4e3a\u4e86\u4fbf\u4e8e\u5f00\u53d1\u8005\u67e5\u770b\u8bad\u7ec3\u6548\u679c\uff0cXtuner \u63d0\u4f9b\u4e86\u4e00\u952e\u5bf9\u8bdd\u501f\u53e3 Float16 \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b 4bits \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --bits 4 \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --adapter $ADAPTER_DIR \u540c\u65f6\uff0cXtuner \u8fd8\u652f\u6301\u5de5\u5177\u7c7b\u6a21\u578b\u7684\u5bf9\u8bdd XTuner \u6570\u636e\u5f15\u64ce \u00b6 \u6570\u636e\u5904\u7406\u6d41\u7a0b \u00b6 \u591a\u6570\u636e\u6837\u672c\u62fc\u63a5\uff08Pack Dataset\uff09 \u00b6 \u589e\u5f3a\u5e76\u884c\u6027\uff0c\u5145\u5206\u5229\u7528 GPU \u8d44\u6e90\uff01 8 GB \u663e\u5361\u73a9\u8f6c LLM \u00b6 XTuner \u52a0\u901f\u65b9\u5f0f \u00b6 Flash Attention \uff1a Flash Attention \u5c06 Attention \u8ba1\u7b97\u5e76\u884c\u5316\uff0c\u907f\u514d\u4e86\u8ba1\u7b97\u8fc7\u7a0b\u4e2d Attention Score NxN \u7684\u663e\u5b58\u5360\u7528\uff08\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684 N \u90fd\u6bd4\u8f83\u5927\uff09 DeepSpeed ZeRO ZeRO \u4f18\u5316\uff0c\u901a\u8fc7\u5c06\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u53c2\u6570\u3001\u68af\u5ea6\u548c\u4f18\u5316\u5668\u72b6\u6001\u5207\u7247\u4fdd\u5b58\uff0c\u80fd\u591f\u5728\u591a GPU \u8bad\u7ec3\u65f6\u663e\u8457\u8282\u7701\u663e\u5b58 \u9664\u4e86\u5c06\u8bad\u7ec3\u4e2d\u95f4\u72b6\u6001\u5207\u7247\u5916\uff0c DeepSpeed \u8bad\u7ec3\u65f6\u4f7f\u7528 FP16 \u7684\u6743\u91cd\uff0c\u76f8\u8f83\u4e8e Pytorch \u7684 AMP \u8bad\u7ec3\uff0c\u5728\u5355 GPU \u4e0a\u4e5f\u80fd\u5927\u5e45\u8282\u7701\u663e\u5b58 DeepSpeed \u4e0e Flash Attention \u867d\u7136\u80fd\u591f\u5927\u5e45\u964d\u4f4e\u8bad\u7ec3\u6210\u672c\uff0c\u4f46\u4f7f\u7528\u95e8\u69db\u76f8\u5bf9\u8f83\u9ad8\uff0c\u9700\u8981\u590d\u6742\u7684\u914d\u7f6e\uff0c\u751a\u81f3\u4fee\u6539\u4ee3\u7801\uff0c\u4e3a\u4e86\u8ba9\u5f00\u53d1\u8005\u4e13\u6ce8\u4e8e\u6570\u636e\uff0cXTuner \u4f1a\u81ea\u52a8 dispatch Flash Attention \uff0c\u5e76\u4e00\u952e\u542f\u52a8 DeepSpeed ZeRO xtuner train internlm_20b_qlora_oasst1_512_e3 \\ --deepspeed deepspeed_zero3 \u5b9e\u6218\u8bad\u7ec3 \u00b6 \u73af\u5883 & \u5b89\u88c5 \u00b6 \u73af\u5883\uff1aUbuntu + Anaconda + CUDA/CUDNN + 8GB Nvidia GPU \u5b89\u88c5\uff1a conda create --name xtuner0.1.9 python = 3 .10 -y conda activate xtuner0.1.9 cd ~ && mkdir xtuner019 && cd xtuner019 git clone -b v0.1.9 https://github.com/InternLM/xtuner cd xtuner pip install -e '.[all]' \u521b\u5efa\u6570\u636e\u96c6\u5de5\u4f5c\u8def\u5f84\uff1a mkdir ~/ft-oasst1 && cd ~/ft-oasst1 \u5fae\u8c03 \u00b6 \u51c6\u5907\u914d\u7f6e\u6587\u4ef6 \u00b6 cd ~/ft-oasst1 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . \u6a21\u578b\u4e0b\u8f7d \u00b6 InternStudio \u5e73\u53f0\u4e0a cp -r /root/share/temp/model_repos/internlm-chat-7b ~/ft-oasst1/ - \u4e0d\u7528 xtuner \u9ed8\u8ba4\u7684\u4ece huggingface \u62c9\u53d6\u6a21\u578b\uff0c\u800c\u662f\u63d0\u524d\u4ece ModelScope \u4e0b\u8f7d\u6a21\u578b\u5230\u672c\u5730 # \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u653e\u6a21\u578b\u6587\u4ef6\uff0c\u9632\u6b62\u6563\u843d\u4e00\u5730 mkdir ~/ft-oasst1/internlm-chat-7b # \u88c5\u4e00\u4e0b\u62c9\u53d6\u6a21\u578b\u6587\u4ef6\u8981\u7528\u7684\u5e93 pip install modelscope # \u4ece modelscope \u4e0b\u8f7d\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6 cd ~/ft-oasst1 apt install git git-lfs -y git lfs install git lfs clone https://modelscope.cn/Shanghai_AI_Laboratory/internlm-chat-7b.git -b v1.0.3 \u6570\u636e\u96c6\u4e0b\u8f7d \u00b6 https://huggingface.co/datasets/timdettmers/openassistant-guanaco/tree/main \u4fee\u6539\u914d\u7f6e\u6587\u4ef6 \u00b6 \u4fee\u6539\u5176\u4e2d\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u4e3a \u672c\u5730\u8def\u5f84 cd ~/ft-oasst1 vim internlm_chat_7b_qlora_oasst1_e3_copy.py # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u96c6\u4e3a\u672c\u5730\u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = './openassistant-guanaco' \u5f00\u59cb\u5fae\u8c03 \u00b6 # \u5355\u5361 ## \u7528\u521a\u624d\u6539\u597d\u7684config\u6587\u4ef6\u8bad\u7ec3 xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u591a\u5361 NPROC_PER_NODE = ${ GPU_NUM } xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u82e5\u8981\u5f00\u542f deepspeed \u52a0\u901f\uff0c\u589e\u52a0 --deepspeed deepspeed_zero2 \u5373\u53ef \u5fae\u8c03\u5f97\u5230\u7684 PTH \u6a21\u578b\u6587\u4ef6\u548c\u5176\u4ed6\u6742\u4e03\u6742\u516b\u7684\u6587\u4ef6\u90fd\u9ed8\u8ba4\u5728\u5f53\u524d\u7684 ./work_dirs \u4e2d\u3002 \u751f\u6210 Adapter \u6587\u4ef6 \u00b6 \u5c06\u5f97\u5230\u7684 PTH \u6a21\u578b\u8f6c\u6362\u4e3a HuggingFace \u6a21\u578b\uff0c\u5373\uff1a\u751f\u6210 Adapter \u6587\u4ef6\u5939 \u53ef\u4ee5\u7b80\u5355\u7406\u89e3\uff1aLoRA \u6a21\u578b\u6587\u4ef6 = Adapter mkdir hf export MKL_SERVICE_FORCE_INTEL = 1 xtuner convert pth_to_hf ./internlm_chat_7b_qlora_oasst1_e3_copy.py ./work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_1.pth ./hf \u90e8\u7f72\u4e0e\u6d4b\u8bd5 \u00b6 \u5c06 HuggingFace adapter \u5408\u5e76\u5230\u5927\u8bed\u8a00\u6a21\u578b \u00b6 xtuner convert merge ./internlm-chat-7b ./hf ./merged --max-shard-size 2GB # xtuner convert merge \\ # ${NAME_OR_PATH_TO_LLM} \\ # ${NAME_OR_PATH_TO_ADAPTER} \\ # ${SAVE_PATH} \\ # --max-shard-size 2GB \u4e0e\u5408\u5e76\u540e\u7684\u6a21\u578b\u5bf9\u8bdd \u00b6 # \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd\uff08Float 16\uff09 xtuner chat ./merged --prompt-template internlm_chat # 4 bit \u91cf\u5316\u52a0\u8f7d # xtuner chat ./merged --bits 4 --prompt-template internlm_chat \u5fae\u8c03\u524d \u5fae\u8c03\u540e \u81ea\u5b9a\u4e49\u5fae\u8c03 \u00b6 \u4ee5 Medication QA \u6570\u636e\u96c6 \u4e3a\u4f8b \u6982\u8ff0 \u00b6 \u573a\u666f\u9700\u6c42 \u00b6 \u57fa\u4e8e InternLM-chat-7B \u6a21\u578b\uff0c\u7528 MedQA \u6570\u636e\u96c6\u8fdb\u884c\u5fae\u8c03\uff0c\u5c06\u5176\u5f80 \u533b\u5b66\u95ee\u7b54 \u9886\u57df\u5bf9\u9f50\u3002 \u771f\u5b9e\u6570\u636e\u9884\u89c8 \u00b6 \u95ee\u9898 \u7b54\u6848 What are ketorolac eye drops?\uff08\u4ec0\u4e48\u662f\u916e\u54af\u9178\u6ef4\u773c\u6db2\uff1f\uff09 Ophthalmic ketorolac is used to treat itchy eyes caused by allergies. It also is used to treat swelling and redness (inflammation) that can occur after cataract surgery. Ketorolac is in a class of medications called nonsteroidal anti-inflammatory drugs (NSAIDs). It works by stopping the release of substances that cause allergy symptoms and inflammation. What medicines raise blood sugar? \uff08\u4ec0\u4e48\u836f\u7269\u4f1a\u5347\u9ad8\u8840\u7cd6\uff1f\uff09 Some medicines for conditions other than diabetes can raise your blood sugar level. This is a concern when you have diabetes. Make sure every doctor you see knows about all of the medicines, vitamins, or herbal supplements you take. This means anything you take with or without a prescription. Examples include: Barbiturates. Thiazide diuretics. Corticosteroids. Birth control pills (oral contraceptives) and progesterone. Catecholamines. Decongestants that contain beta-adrenergic agents, such as pseudoephedrine. The B vitamin niacin. The risk of high blood sugar from niacin lowers after you have taken it for a few months. The antipsychotic medicine olanzapine (Zyprexa). \u6570\u636e\u51c6\u5907 \u00b6 \u4ee5 Medication QA \u6570\u636e\u96c6\u4e3a\u4f8b \u539f\u683c\u5f0f\uff1a(.xlsx) \u95ee\u9898 \u836f\u7269\u7c7b\u578b \u95ee\u9898\u7c7b\u578b \u56de\u7b54 \u4e3b\u9898 URL aaa bbb ccc ddd eee fff \u5c06\u6570\u636e\u8f6c\u4e3a XTuner \u7684\u6570\u636e\u683c\u5f0f \u00b6 \u76ee\u6807\u683c\u5f0f\uff1a(.jsonL) [{ \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }, { \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }] \ud83e\udde0\u901a\u8fc7 python\u811a\u672c\uff1a\u5c06 .xlsx \u4e2d\u7684 \u95ee\u9898 \u548c \u56de\u7b54 \u4e24\u5217 \u63d0\u53d6\u51fa\u6765\uff0c\u518d\u653e\u5165 .jsonL \u6587\u4ef6\u7684\u6bcf\u4e2a conversation \u7684 input \u548c output \u4e2d\u3002 \u8fd9\u4e00\u6b65\u7684 python \u811a\u672c\u53ef\u4ee5\u8bf7 ChatGPT \u6765\u5b8c\u6210\u3002 Write a python file for me. using openpyxl. input file name is MedQA2019.xlsx Step1: The input file is .xlsx. Exact the column A and column D in the sheet named \"DrugQA\" . Step2: Put each value in column A into each \"input\" of each \"conversation\". Put each value in column D into each \"output\" of each \"conversation\". Step3: The output file is .jsonL. It looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step4: All \"system\" value changes to \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" ChatGPT \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a xlsx2jsonl.py import openpyxl import json def process_excel_to_json ( input_file , output_file ): # Load the workbook wb = openpyxl . load_workbook ( input_file ) # Select the \"DrugQA\" sheet sheet = wb [ \"DrugQA\" ] # Initialize the output data structure output_data = [] # Iterate through each row in column A and D for row in sheet . iter_rows ( min_row = 2 , max_col = 4 , values_only = True ): system_value = \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" # Create the conversation dictionary conversation = { \"system\" : system_value , \"input\" : row [ 0 ], \"output\" : row [ 3 ] } # Append the conversation to the output data output_data . append ({ \"conversation\" : [ conversation ]}) # Write the output data to a JSON file with open ( output_file , 'w' , encoding = 'utf-8' ) as json_file : json . dump ( output_data , json_file , indent = 4 ) print ( f \"Conversion complete. Output written to { output_file } \" ) # Replace 'MedQA2019.xlsx' and 'output.jsonl' with your actual input and output file names process_excel_to_json ( 'MedQA2019.xlsx' , 'output.jsonl' ) \u6267\u884c python \u811a\u672c\uff0c\u83b7\u5f97\u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\uff1a python xlsx2jsonl.py \u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\u957f\u8fd9\u6837\uff1a \u6b64\u65f6\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\uff0c\u540c\u6837\u53ef\u4ee5\u8ba9 ChatGPT \u5199 python \u4ee3\u7801\u3002\u5f53\u7136\u5982\u679c\u4f60\u6ca1\u6709\u4e25\u683c\u7684\u79d1\u7814\u9700\u6c42\u3001\u4e0d\u5728\u4e4e\u201c\u8bad\u7ec3\u96c6\u6cc4\u9732\u201d\u7684\u95ee\u9898\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u505a\u8bad\u7ec3\u96c6\u4e0e\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\u3002 \u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6 \u00b6 my .jsonL file looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step1, read the .jsonL file. Step2, count the amount of the \"conversation\" elements. Step3, randomly split all \"conversation\" elements by 7:3. Targeted structure is same as the input. Step4, save the 7/10 part as train.jsonl. save the 3/10 part as test.jsonl \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a split2train_and_test.py import json import random def split_conversations ( input_file , train_output_file , test_output_file ): # Read the input JSONL file with open ( input_file , 'r' , encoding = 'utf-8' ) as jsonl_file : data = json . load ( jsonl_file ) # Count the number of conversation elements num_conversations = len ( data ) # Shuffle the data randomly random . shuffle ( data ) random . shuffle ( data ) random . shuffle ( data ) # Calculate the split points for train and test split_point = int ( num_conversations * 0.7 ) # Split the data into train and test train_data = data [: split_point ] test_data = data [ split_point :] # Write the train data to a new JSONL file with open ( train_output_file , 'w' , encoding = 'utf-8' ) as train_jsonl_file : json . dump ( train_data , train_jsonl_file , indent = 4 ) # Write the test data to a new JSONL file with open ( test_output_file , 'w' , encoding = 'utf-8' ) as test_jsonl_file : json . dump ( test_data , test_jsonl_file , indent = 4 ) print ( f \"Split complete. Train data written to { train_output_file } , Test data written to { test_output_file } \" ) # Replace 'input.jsonl', 'train.jsonl', and 'test.jsonl' with your actual file names split_conversations ( 'MedQA2019-structured.jsonl' , 'MedQA2019-structured-train.jsonl' , 'MedQA2019-structured-test.jsonl' ) \u5f00\u59cb\u81ea\u5b9a\u4e49\u5fae\u8c03 \u00b6 \u6b64\u65f6\uff0c\u6211\u4eec\u91cd\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\u6765\u73a9\u201c\u5fae\u8c03\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u201d mkdir ~/ft-medqa && cd ~/ft-medqa \u628a\u524d\u9762\u4e0b\u8f7d\u597d\u7684internlm-chat-7b\u6a21\u578b\u6587\u4ef6\u5939\u62f7\u8d1d\u8fc7\u6765\u3002 cp -r ~/ft-oasst1/internlm-chat-7b . \u522b\u5fd8\u4e86\u628a\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\uff0c\u5373\u51e0\u4e2a .jsonL \uff0c\u4e5f\u4f20\u5230\u670d\u52a1\u5668\u4e0a\u3002 git clone https://github.com/InternLM/tutorial cp ~/tutorial/xtuner/MedQA2019-structured-train.jsonl . \u51c6\u5907\u914d\u7f6e\u6587\u4ef6 \u00b6 # \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . # \u6539\u4e2a\u6587\u4ef6\u540d mv internlm_chat_7b_qlora_oasst1_e3_copy.py internlm_chat_7b_qlora_medqa2019_e3.py # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9 vim internlm_chat_7b_qlora_medqa2019_e3.py \u51cf\u53f7\u4ee3\u8868\u8981\u5220\u9664\u7684\u884c\uff0c\u52a0\u53f7\u4ee3\u8868\u8981\u589e\u52a0\u7684\u884c\u3002 # \u4fee\u6539import\u90e8\u5206 - from xtuner.dataset.map_fns import oasst1_map_fn, template_map_fn_factory + from xtuner.dataset.map_fns import template_map_fn_factory # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u4e3a MedQA2019-structured-train.jsonl \u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = 'MedQA2019-structured-train.jsonl' # \u4fee\u6539 train_dataset \u5bf9\u8c61 train_dataset = dict( type=process_hf_dataset, - dataset=dict(type=load_dataset, path=data_path), + dataset=dict(type=load_dataset, path='json', data_files=dict(train=data_path)), tokenizer=tokenizer, max_length=max_length, - dataset_map_fn=alpaca_map_fn, + dataset_map_fn=None, template_map_fn=dict( type=template_map_fn_factory, template=prompt_template), remove_unused_columns=True, shuffle_before_pack=True, pack_to_max_length=pack_to_max_length) XTuner\uff01\u542f\u52a8\uff01 \u00b6 xtuner train internlm_chat_7b_qlora_medqa2019_e3.py --deepspeed deepspeed_zero2 \u751f\u6210 Adapter \u6587\u4ef6 \u00b6 \u90e8\u7f72\u4e0e\u6d4b\u8bd5 \u00b6 \u7528 MS-Agent \u6570\u636e\u96c6\u8d4b\u4e88 LLM \u4ee5 Agent \u80fd\u529b \u00b6 \u6982\u8ff0 \u00b6 MSAgent \u6570\u636e\u96c6\u6bcf\u6761\u6837\u672c\u5305\u542b\u4e00\u4e2a\u5bf9\u8bdd\u5217\u8868\uff08conversations\uff09\uff0c\u5176\u91cc\u9762\u5305\u542b\u4e86 system\u3001user\u3001assistant \u4e09\u79cd\u5b57\u6bb5\u3002\u5176\u4e2d\uff1a system: \u8868\u793a\u7ed9\u6a21\u578b\u524d\u7f6e\u7684\u4eba\u8bbe\u8f93\u5165\uff0c\u5176\u4e2d\u6709\u544a\u8bc9\u6a21\u578b\u5982\u4f55\u8c03\u7528\u63d2\u4ef6\u4ee5\u53ca\u751f\u6210\u8bf7\u6c42 user: \u8868\u793a\u7528\u6237\u7684\u8f93\u5165 prompt\uff0c\u5206\u4e3a\u4e24\u79cd\uff0c\u901a\u7528\u751f\u6210\u7684prompt\u548c\u8c03\u7528\u63d2\u4ef6\u9700\u6c42\u7684 prompt assistant: \u4e3a\u6a21\u578b\u7684\u56de\u590d\u3002\u5176\u4e2d\u4f1a\u5305\u62ec\u63d2\u4ef6\u8c03\u7528\u4ee3\u7801\u548c\u6267\u884c\u4ee3\u7801\uff0c\u8c03\u7528\u4ee3\u7801\u662f\u8981 LLM \u751f\u6210\u7684\uff0c\u800c\u6267\u884c\u4ee3\u7801\u662f\u8c03\u7528\u670d\u52a1\u6765\u751f\u6210\u7ed3\u679c\u7684 \u4e00\u6761\u8c03\u7528\u7f51\u9875\u641c\u7d22\u63d2\u4ef6\u67e5\u8be2\u201c\u4e0a\u6d77\u660e\u5929\u5929\u6c14\u201d\u7684\u6570\u636e\u6837\u672c\u793a\u4f8b\u5982\u4e0b\u56fe\u6240\u793a\uff1a \u5fae\u8c03\u6b65\u9aa4 \u00b6 \u51c6\u5907\u5de5\u4f5c \u00b6 xtuner \u662f\u4ece\u56fd\u5185\u7684 ModelScope \u5e73\u53f0\u4e0b\u8f7d MS-Agent \u6570\u636e\u96c6\uff0c\u56e0\u6b64\u4e0d\u7528\u63d0\u524d\u624b\u52a8\u4e0b\u8f7d\u6570\u636e\u96c6\u6587\u4ef6\u3002 # \u51c6\u5907\u5de5\u4f5c mkdir ~/ft-msagent && cd ~/ft-msagent cp -r ~/ft-oasst1/internlm-chat-7b . # \u67e5\u770b\u914d\u7f6e\u6587\u4ef6 xtuner list-cfg | grep msagent # \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_7b_qlora_msagent_react_e3_gpu8 . # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 vim ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' \u5f00\u59cb\u5fae\u8c03 \u00b6 xtuner train ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py --deepspeed deepspeed_zero2 \u76f4\u63a5\u4f7f\u7528 \u00b6 \u7531\u4e8e msagent \u7684\u8bad\u7ec3\u975e\u5e38\u8d39\u65f6\uff0c\u5927\u5bb6\u5982\u679c\u60f3\u5c3d\u5feb\u628a\u8fd9\u4e2a\u6559\u7a0b\u8ddf\u5b8c\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece modelScope \u62c9\u53d6\u54b1\u4eec\u5df2\u7ecf\u5fae\u8c03\u597d\u4e86\u7684 Adapter\u3002\u5982\u4e0b\u6f14\u793a\u3002 \u4e0b\u8f7d Adapter \u00b6 cd ~/ft-msagent apt install git git-lfs git lfs install git lfs clone https://www.modelscope.cn/xtuner/internlm-7b-qlora-msagent-react.git \u6709\u4e86\u8fd9\u4e2a\u5728 msagent \u4e0a\u8bad\u7ec3\u5f97\u5230\u7684Adapter\uff0c\u6a21\u578b\u73b0\u5728\u5df2\u7ecf\u6709 agent \u80fd\u529b\u4e86\uff01\u5c31\u53ef\u4ee5\u52a0 --lagent \u4ee5\u8c03\u7528\u6765\u81ea lagent \u7684\u4ee3\u7406\u529f\u80fd\u4e86\uff01 \u6dfb\u52a0 serper \u73af\u5883\u53d8\u91cf \u00b6 \u5f00\u59cb chat \u4e4b\u524d\uff0c\u8fd8\u8981\u52a0\u4e2a serper \u7684\u73af\u5883\u53d8\u91cf\uff1a \u53bb serper.dev \u514d\u8d39\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\uff0c\u751f\u6210\u81ea\u5df1\u7684 api key\u3002\u8fd9\u4e2a\u4e1c\u897f\u662f\u7528\u6765\u7ed9 lagent \u53bb\u83b7\u53d6 google \u641c\u7d22\u7684\u7ed3\u679c\u7684\u3002\u7b49\u4e8e\u662f serper.dev \u5e2e\u4f60\u53bb\u8bbf\u95ee google\uff0c\u800c\u4e0d\u662f\u4ece\u4f60\u81ea\u5df1\u672c\u5730\u53bb\u8bbf\u95ee google \u4e86\u3002 \u6dfb\u52a0 serper api key \u5230\u73af\u5883\u53d8\u91cf\uff1a export SERPER_API_KEY = abcdefg xtuner + agent\uff0c\u542f\u52a8\uff01 \u00b6 xtuner chat ./internlm-chat-7b --adapter internlm-7b-qlora-msagent-react --lagent --prompt-template internlm_chat \u4f5c\u4e1a\uff1aXTuner InternLM-Chat \u4e2a\u4eba\u5c0f\u52a9\u624b\u8ba4\u77e5\u5fae\u8c03\u5b9e\u8df5 \u00b6 \u73af\u5883\u51c6\u5907 \u00b6 # InternStudio \u5e73\u53f0\u4e2d\uff0c\u4ece\u672c\u5730 clone \u4e00\u4e2a\u5df2\u6709 pytorch 2.0.1 \u7684\u73af\u5883\uff08\u540e\u7eed\u5747\u5728\u8be5\u73af\u5883\u6267\u884c\uff0c\u82e5\u4e3a\u5176\u4ed6\u73af\u5883\u53ef\u4f5c\u4e3a\u53c2\u8003\uff09 # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash bash conda create --name personal_assistant --clone = /root/share/conda_envs/internlm-base # \u5982\u679c\u5728\u5176\u4ed6\u5e73\u53f0\uff1a # conda create --name personal_assistant python=3.10 -y # \u6fc0\u6d3b\u73af\u5883 conda activate personal_assistant # \u8fdb\u5165\u5bb6\u76ee\u5f55 \uff08~\u7684\u610f\u601d\u662f \u201c\u5f53\u524d\u7528\u6237\u7684home\u8def\u5f84\u201d\uff09 cd ~ # \u521b\u5efa\u7248\u672c\u6587\u4ef6\u5939\u5e76\u8fdb\u5165\uff0c\u4ee5\u8ddf\u968f\u672c\u6559\u7a0b # personal_assistant\u7528\u4e8e\u5b58\u653e\u672c\u6559\u7a0b\u6240\u4f7f\u7528\u7684\u4e1c\u897f mkdir /root/personal_assistant && cd /root/personal_assistant mkdir /root/personal_assistant/xtuner019 && cd /root/personal_assistant/xtuner019 # \u62c9\u53d6 0.1.9 \u7684\u7248\u672c\u6e90\u7801 git clone -b v0.1.9 https://github.com/InternLM/xtuner # \u65e0\u6cd5\u8bbf\u95eegithub\u7684\u7528\u6237\u8bf7\u4ece gitee \u62c9\u53d6: # git clone -b v0.1.9 https://gitee.com/Internlm/xtuner # \u8fdb\u5165\u6e90\u7801\u76ee\u5f55 cd xtuner # \u4ece\u6e90\u7801\u5b89\u88c5 XTuner pip install -e '.[all]' \u6570\u636e\u51c6\u5907 \u00b6 mkdir -p /root/personal_assistant/data && cd /root/personal_assistant/data \u5728 data \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2ajson\u6587\u4ef6 personal_assistant.json \u4f5c\u4e3a\u672c\u6b21\u5fae\u8c03\u6240\u4f7f\u7528\u7684\u6570\u636e\u96c6\u3002 \u5176\u4e2d conversation \u8868\u793a\u4e00\u6b21\u5bf9\u8bdd\u7684\u5185\u5bb9\uff0c input \u4e3a\u8f93\u5165\uff0c\u5373\u7528\u6237\u4f1a\u95ee\u7684\u95ee\u9898\uff0c output \u4e3a\u8f93\u51fa\uff0c\u5373\u60f3\u8981\u6a21\u578b\u56de\u7b54\u7684\u7b54\u6848\u3002 \u4ee5\u4e0b\u662f\u4e00\u4e2apython\u811a\u672c\uff0c\u7528\u4e8e\u751f\u6210\u6570\u636e\u96c6\u3002 generate_data.py import json # \u8f93\u5165\u4f60\u7684\u540d\u5b57 name = '\u72d9\u51fb\u7f8e\u4f50' # \u91cd\u590d\u6b21\u6570 n = 10000 data = [ { \"conversation\" : [ { \"input\" : \"\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd\" , \"output\" : \"\u6211\u662f {} \u7684\u5c0f\u52a9\u624b\uff0c\u5185\u5728\u662f\u4e0a\u6d77AI\u5b9e\u9a8c\u5ba4\u4e66\u751f\u00b7\u6d66\u8bed\u76847B\u5927\u6a21\u578b\u54e6\" . format ( name ) } ] } ] for i in range ( n ): data . append ( data [ 0 ]) with open ( 'personal_assistant.json' , 'w' , encoding = 'utf-8' ) as f : json . dump ( data , f , ensure_ascii = False , indent = 4 ) \u914d\u7f6e\u51c6\u5907 \u00b6 mkdir -p /root/personal_assistant/model/Shanghai_AI_Laboratory cp -r /root/share/temp/model_repos/internlm-chat-7b /root/personal_assistant/model/Shanghai_AI_Laboratory # \u521b\u5efa\u7528\u4e8e\u5b58\u653e\u914d\u7f6e\u7684\u6587\u4ef6\u5939config\u5e76\u8fdb\u5165 mkdir /root/personal_assistant/config && cd /root/personal_assistant/config # \u62f7\u8d1d\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . \u4fee\u6539\u62f7\u8d1d\u540e\u7684\u6587\u4ef6\uff1a internlm_chat_7b_qlora_oasst1_e3_copy.py # Copyright (c) OpenMMLab. All rights reserved. import torch from bitsandbytes.optim import PagedAdamW32bit from datasets import load_dataset from mmengine.dataset import DefaultSampler from mmengine.hooks import ( CheckpointHook , DistSamplerSeedHook , IterTimerHook , LoggerHook , ParamSchedulerHook ) from mmengine.optim import AmpOptimWrapper , CosineAnnealingLR from peft import LoraConfig from transformers import ( AutoModelForCausalLM , AutoTokenizer , BitsAndBytesConfig ) from xtuner.dataset import process_hf_dataset from xtuner.dataset.collate_fns import default_collate_fn from xtuner.dataset.map_fns import oasst1_map_fn , template_map_fn_factory from xtuner.engine import DatasetInfoHook , EvaluateChatHook from xtuner.model import SupervisedFinetune from xtuner.utils import PROMPT_TEMPLATE ####################################################################### # PART 1 Settings # ####################################################################### # Model pretrained_model_name_or_path = '/root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b' # Data data_path = '/root/personal_assistant/data/personal_assistant.json' prompt_template = PROMPT_TEMPLATE . internlm_chat max_length = 512 pack_to_max_length = True # Scheduler & Optimizer batch_size = 2 # per_device accumulative_counts = 16 dataloader_num_workers = 0 max_epochs = 3 optim_type = PagedAdamW32bit lr = 2e-4 betas = ( 0.9 , 0.999 ) weight_decay = 0 max_norm = 1 # grad clip # Evaluate the generation performance during the training evaluation_freq = 90 SYSTEM = '' evaluation_inputs = [ '\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1' , '\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd' ] ####################################################################### # PART 2 Model & Tokenizer # ####################################################################### tokenizer = dict ( type = AutoTokenizer . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , padding_side = 'right' ) model = dict ( type = SupervisedFinetune , llm = dict ( type = AutoModelForCausalLM . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , torch_dtype = torch . float16 , quantization_config = dict ( type = BitsAndBytesConfig , load_in_4bit = True , load_in_8bit = False , llm_int8_threshold = 6.0 , llm_int8_has_fp16_weight = False , bnb_4bit_compute_dtype = torch . float16 , bnb_4bit_use_double_quant = True , bnb_4bit_quant_type = 'nf4' )), lora = dict ( type = LoraConfig , r = 64 , lora_alpha = 16 , lora_dropout = 0.1 , bias = 'none' , task_type = 'CAUSAL_LM' )) ####################################################################### # PART 3 Dataset & Dataloader # ####################################################################### train_dataset = dict ( type = process_hf_dataset , dataset = dict ( type = load_dataset , path = 'json' , data_files = dict ( train = data_path )), tokenizer = tokenizer , max_length = max_length , dataset_map_fn = None , template_map_fn = dict ( type = template_map_fn_factory , template = prompt_template ), remove_unused_columns = True , shuffle_before_pack = True , pack_to_max_length = pack_to_max_length ) train_dataloader = dict ( batch_size = batch_size , num_workers = dataloader_num_workers , dataset = train_dataset , sampler = dict ( type = DefaultSampler , shuffle = True ), collate_fn = dict ( type = default_collate_fn )) ####################################################################### # PART 4 Scheduler & Optimizer # ####################################################################### # optimizer optim_wrapper = dict ( type = AmpOptimWrapper , optimizer = dict ( type = optim_type , lr = lr , betas = betas , weight_decay = weight_decay ), clip_grad = dict ( max_norm = max_norm , error_if_nonfinite = False ), accumulative_counts = accumulative_counts , loss_scale = 'dynamic' , dtype = 'float16' ) # learning policy # More information: https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/param_scheduler.md # noqa: E501 param_scheduler = dict ( type = CosineAnnealingLR , eta_min = 0.0 , by_epoch = True , T_max = max_epochs , convert_to_iter_based = True ) # train, val, test setting train_cfg = dict ( by_epoch = True , max_epochs = max_epochs , val_interval = 1 ) ####################################################################### # PART 5 Runtime # ####################################################################### # Log the dialogue periodically during the training process, optional custom_hooks = [ dict ( type = DatasetInfoHook , tokenizer = tokenizer ), dict ( type = EvaluateChatHook , tokenizer = tokenizer , every_n_iters = evaluation_freq , evaluation_inputs = evaluation_inputs , system = SYSTEM , prompt_template = prompt_template ) ] # configure default hooks default_hooks = dict ( # record the time of every iteration. timer = dict ( type = IterTimerHook ), # print log every 100 iterations. logger = dict ( type = LoggerHook , interval = 10 ), # enable the parameter scheduler. param_scheduler = dict ( type = ParamSchedulerHook ), # save checkpoint per epoch. checkpoint = dict ( type = CheckpointHook , interval = 1 ), # set sampler seed in distributed evrionment. sampler_seed = dict ( type = DistSamplerSeedHook ), ) # configure environment env_cfg = dict ( # whether to enable cudnn benchmark cudnn_benchmark = False , # set multi process parameters mp_cfg = dict ( mp_start_method = 'fork' , opencv_num_threads = 0 ), # set distributed parameters dist_cfg = dict ( backend = 'nccl' ), ) # set visualizer visualizer = None # set log level log_level = 'INFO' # load from which checkpoint load_from = None # whether to resume training from the loaded checkpoint resume = False # Defaults to use random seed and disable `deterministic` randomness = dict ( seed = None , deterministic = False ) \u5fae\u8c03 \u00b6 xtuner train /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py \u53c2\u6570\u8f6c\u6362/\u5408\u5e76 \u00b6 \u8bad\u7ec3\u540e\u7684pth\u683c\u5f0f\u53c2\u6570\u8f6cHugging Face\u683c\u5f0f # \u521b\u5efa\u7528\u4e8e\u5b58\u653eHugging Face\u683c\u5f0f\u53c2\u6570\u7684hf\u6587\u4ef6\u5939 mkdir /root/personal_assistant/config/work_dirs/hf export MKL_SERVICE_FORCE_INTEL = 1 # \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u7684\u4f4d\u7f6e export CONFIG_NAME_OR_PATH = /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py # \u6a21\u578b\u8bad\u7ec3\u540e\u5f97\u5230\u7684pth\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export PTH = /root/personal_assistant/config/work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_3.pth # pth\u6587\u4ef6\u8f6c\u6362\u4e3aHugging Face\u683c\u5f0f\u540e\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf # \u6267\u884c\u53c2\u6570\u8f6c\u6362 xtuner convert pth_to_hf $CONFIG_NAME_OR_PATH $PTH $SAVE_PATH Merge\u6a21\u578b\u53c2\u6570 export MKL_SERVICE_FORCE_INTEL = 1 export MKL_THREADING_LAYER = 'GNU' # \u539f\u59cb\u6a21\u578b\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_LLM = /root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b # Hugging Face\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_ADAPTER = /root/personal_assistant/config/work_dirs/hf # \u6700\u7ec8Merge\u540e\u7684\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e mkdir /root/personal_assistant/config/work_dirs/hf_merge export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf_merge # \u6267\u884c\u53c2\u6570Merge xtuner convert merge \\ $NAME_OR_PATH_TO_LLM \\ $NAME_OR_PATH_TO_ADAPTER \\ $SAVE_PATH \\ --max-shard-size 2GB Demo \u00b6 \u5b89\u88c5\u4f9d\u8d56 pip install streamlit == 1 .24.0 \u4e0b\u8f7dInternLM\u9879\u76ee\u4ee3\u7801 # \u521b\u5efacode\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653eInternLM\u9879\u76ee\u4ee3\u7801 mkdir /root/personal_assistant/code && cd /root/personal_assistant/code git clone https://github.com/InternLM/InternLM.git \u5c06 /root/code/InternLM/web_demo.py \u4e2d 29 \u884c \u548c 33 \u884c\u7684\u6a21\u578b\u8def\u5f84\u66f4\u6362\u4e3aMerge\u540e\u5b58\u653e\u53c2\u6570\u7684\u8def\u5f84 /root/personal_assistant/config/work_dirs/hf_merge \u8fd0\u884c /root/personal_assistant/code/InternLM \u76ee\u5f55\u4e0b\u7684 web_demo.py \u6587\u4ef6\uff0c\u5c06\u7aef\u53e3\u6620\u5c04\u5230\u672c\u5730 streamlit run /root/personal_assistant/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006 \u6548\u679c \u00b6 \u5fae\u8c03\u524d \uff08\u56de\u7b54\u6bd4\u8f83\u5b98\u65b9\uff09 \u5fae\u8c03\u540e \uff08\u5bf9\u81ea\u5df1\u7684\u8eab\u4efd\u6709\u4e86\u6e05\u6670\u7684\u8ba4\u77e5\uff09 \u8fdb\u9636\u4f5c\u4e1a \u00b6 \u5c06\u8bad\u7ec3\u597d\u7684Adapter\u6a21\u578b\u6743\u91cd\u4e0a\u4f20\u5230 OpenXLab\u3001Hugging Face \u6216\u8005 MoelScope \u4efb\u4e00\u4e00\u5e73\u53f0\u3002 \u901a\u8fc7 scp \u5c06 hf \u6587\u4ef6\u5939\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u8fdb\u5165 HuggingFace \u65b0\u5efa model\uff0c\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6\u3002Adapter \u6743\u91cd\u5730\u5740\uff1a https://huggingface.co/jujimeizuo/assistant-jujimeizuo/tree/main \u5c06\u8bad\u7ec3\u597d\u540e\u7684\u6a21\u578b\u5e94\u7528\u90e8\u7f72\u5230 OpenXLab \u5e73\u53f0\uff0c\u53c2\u8003\u90e8\u7f72\u6587\u6863\u8bf7\u8bbf\u95ee\uff1a https://aicarrier.feishu.cn/docx/MQH6dygcKolG37x0ekcc4oZhnCe \u901a\u8fc7 openxlab \u5e93\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6 \u65b0\u5efa github \u7684 repo( assistant_jujimeizuo )\uff0c\u4ece OpenXLab \u4e0a\u62c9\u53d6\u4e0a\u4f20\u7684\u6a21\u578b\uff0c\u6784\u5efa streamlit \u7684 app\uff0c\u540c\u6b65\u5230 OpenXLab \u4e0a\u3002 \u5e94\u7528\u670d\u52a1\u5730\u5740\uff1a https://openxlab.org.cn/apps/detail/jujimeizuo/assistant_jujimeizuo","title":"\u7b2c\u56db\u8282"},{"location":"llm/internlm/lec4/#xtuner","text":"\u7ea6 2467 \u4e2a\u5b57 534 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 15 \u5206\u949f Abstract \u5b66\u4e60\u81ea XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218","title":"XTuner \u5927\u6a21\u578b\u5355\u5361\u4f4e\u6210\u672c\u5fae\u8c03\u5b9e\u6218"},{"location":"llm/internlm/lec4/#finetune","text":"LLM \u7684\u4e0b\u6e38\u5e94\u7528\u4e2d\uff0c \u589e\u91cf\u9884\u8bad\u7ec3 \u548c \u6307\u4ee4\u8ddf\u968f \u662f\u7ecf\u5e38\u4f1a\u7528\u5230\u4e24\u79cd\u7684\u5fae\u8c03\u6a21\u5f0f","title":"Finetune"},{"location":"llm/internlm/lec4/#_1","text":"\u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u57fa\u5ea7\u6a21\u578b\u5b66\u4e60\u5230\u4e00\u4e9b\u65b0\u77e5\u8bc6\uff0c\u5982\u67d0\u4e2a\u5782\u7c7b\u9886\u57df\u7684\u5e38\u8bc6 \u8bad\u7ec3\u6570\u636e\uff1a\u6587\u7ae0\u3001\u4e66\u7c4d\u3001\u4ee3\u7801\u7b49 \u4e3a\u4e86\u8ba9 LLM \u77e5\u9053\u4ec0\u4e48\u65f6\u5019\u5f00\u59cb\u4e00\u6bb5\u8bdd\uff0c\u4ec0\u4e48\u65f6\u5019\u7ed3\u675f\u4e00\u6bb5\u8bdd\uff0c\u5b9e\u9645\u8bad\u7ec3\u65f6\u9700\u8981\u5bf9\u6570\u636e\u6dfb\u52a0\u8d77\u59cb\u7b26\uff08BOS\uff09\u548c\u7ed3\u675f\u7b26\uff08EOS\uff09\uff0c\u5927\u591a\u6570\u7684\u6a21\u578b\u90fd\u662f\u4f7f\u7528 \u4f5c\u4e3a\u8d77\u59cb\u7b26\uff0c \u4f5c\u4e3a\u7ed3\u675f\u7b26","title":"\u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_2","text":"\u4f7f\u7528\u573a\u666f\uff1a\u8ba9\u6a21\u578b\u5b66\u4f1a\u5bf9\u8bdd\u6a21\u7248\uff0c\u6839\u636e\u4eba\u7c7b\u6307\u4ee4\u8fdb\u884c\u5bf9\u8bdd \u8bad\u7ec3\u6570\u636e\uff1a\u9ad8\u8d28\u91cf\u7684\u5bf9\u8bdd\uff0c\u95ee\u7b54\u6570\u636e \u5728\u5b9e\u9645\u5bf9\u8bdd\u4e2d\uff0c\u901a\u5e38\u4f1a\u6709\u4e09\u79cd\u89d2\u8272 System \u7ed9\u5b9a\u4e00\u4e9b\u4e0a\u4e0b\u6587\uff0c\u6bd4\u5982\u201c\u4f60\u662f\u4e00\u4e2a\u5b89\u5168\u7684 AI \u52a9\u624b\u201d User \u5b9e\u9645\u7528\u6237\uff0c\u4f1a\u63d0\u51fa\u4e00\u4e9b\u95ee\u9898\uff0c\u6bd4\u5982 \u201c\u4e16\u754c\u7b2c\u4e00\u9ad8\u5cf0\u662f\u201d Assistant \u6839\u636e User \u7684\u8f93\u5165\uff0c\u7ed3\u5408 System \u7684\u4e0a\u4e0b\u6587\u4fe1\u606f\uff0c\u505a\u51fa\u56de\u7b54\uff0c\u6bd4\u5982 \u201c\u73e0\u7a46\u6717\u739b\u5cf0\u201d \u5728\u4f7f\u7528\u5bf9\u8bdd\u6a21\u578b\u65f6\uff0c\u901a\u5e38\u662f\u4e0d\u4f1a\u611f\u77e5\u5230\u8fd9\u4e09\u79cd\u89d2\u8272 \u5bf9\u8bdd\u6a21\u7248 \u4e0d\u540c\u4e8e\u589e\u91cf\u9884\u8bad\u7ec3\u5fae\u8c03\uff0c\u6570\u636e\u4e2d\u4f1a\u6709 Input \u548c Output \u5e0c\u671b\u6a21\u578b\u5b66\u4f1a\u7684\u662f\u7b54\u6848\uff08Output\uff09\uff0c\u800c\u4e0d\u662f\u95ee\u9898\uff08Input\uff09\uff0c\u8bad\u7ec3\u65f6\u53ea\u4f1a\u5bf9\u7b54\u6848\uff08Output\uff09\u90e8\u5206\u8ba1\u7b97 Loss \u8bad\u7ec3\u65f6\uff0c\u4f1a\u548c\u63a8\u7406\u65f6\u4fdd\u6301\u4e00\u81f4\uff0c\u5bf9\u6570\u636e\u6dfb\u52a0\u76f8\u5bf9\u5e94\u7684\u5bf9\u8bdd\u6a21\u7248","title":"\u6307\u4ee4\u8ddf\u968f\u5fae\u8c03"},{"location":"llm/internlm/lec4/#lora-qlora","text":"","title":"LoRA & QLoRA"},{"location":"llm/internlm/lec4/#xtuner_1","text":"\u50bb\u74dc\u5316 \uff1a\u4ee5 \u914d\u7f6e\u6587\u4ef6 \u7684\u5f62\u5f0f\u5c01\u88c5\u4e86\u5927\u90e8\u5206\u5fae\u8c03\u573a\u666f \u8f7b\u91cf\u7ea7 \uff1a\u5bf9\u4e8e 7B \u53c2\u6570\u91cf\u7684 LLM\uff0c\u5fae\u8c03\u6240\u9700\u7684\u6700\u5c0f\u663e\u5b58\u4ec5\u4e3a 8GB","title":"Xtuner"},{"location":"llm/internlm/lec4/#_3","text":"","title":"\u5feb\u901f\u4e0a\u624b"},{"location":"llm/internlm/lec4/#_4","text":"\u5b89\u88c5 pip install xtuner \u6311\u9009\u914d\u7f6e\u6a21\u7248 xtuner list-cfg -p internlm_20b \u4e00\u952e\u8bad\u7ec3 xtuner train internlm_20b_qlora_oasst1_512_e3 Config Description \u6a21\u578b\u540d internlm_20b (\u65e0 chat \u4ee3\u8868\u662f\u57fa\u5ea7\u6a21\u578b) \u4f7f\u7528\u7b97\u6cd5 qlora \u6570\u636e\u96c6 oasst1 \u6570\u636e\u957f\u5ea6 512 Epoch e3, epoch 3","title":"\u4f7f\u7528\u6d41\u7a0b"},{"location":"llm/internlm/lec4/#_5","text":"\u62f7\u8d1d\u914d\u7f6e\u6a21\u7248 \u4fee\u6539\u914d\u7f6e\u6a21\u7248 \u542f\u52a8\u8bad\u7ec3 \u5e38\u7528\u8d85\u53c2 Description data_path \u6570\u636e\u8def\u5f84\u6216 HuggingFace \u4ed3\u5e93\u540d max_length \u5355\u6761\u6570\u636e\u6700\u5927 Token \u6570\uff0c\u8d85\u8fc7\u5219\u622a\u65ad pack_to_max_length \u662f\u5426\u5c06\u591a\u6761\u77ed\u6570\u636e\u62fc\u63a5\u5230 max_length\uff0c\u63d0\u9ad8 GPU \u5229\u7528\u7387 accumulative_counts \u68af\u5ea6\u7d2f\u79ef\uff0c\u6bcf\u591a\u5c11\u6b21 backward \u66f4\u65b0\u4e00\u6b21\u53c2\u6570 evaluation_inputs \u8bad\u7ec3\u8fc7\u7a0b\u4e2d\uff0c\u4f1a\u6839\u636e\u7ed9\u5b9a\u7684\u95ee\u9898\u8fdb\u884c\u63a8\u7406\uff0c\u4fbf\u4e8e\u89c2\u6d4b\u8bad\u7ec3\u72b6\u6001 evaluation_freq Evaluation \u7684\u6d4b\u8bc4\u95f4\u9694 iter \u6570","title":"\u81ea\u5b9a\u4e49\u8bad\u7ec3"},{"location":"llm/internlm/lec4/#_6","text":"\u4e3a\u4e86\u4fbf\u4e8e\u5f00\u53d1\u8005\u67e5\u770b\u8bad\u7ec3\u6548\u679c\uff0cXtuner \u63d0\u4f9b\u4e86\u4e00\u952e\u5bf9\u8bdd\u501f\u53e3 Float16 \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b 4bits \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --bits 4 \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd xtuner chat internlm/internlm-chat-20b --adapter $ADAPTER_DIR \u540c\u65f6\uff0cXtuner \u8fd8\u652f\u6301\u5de5\u5177\u7c7b\u6a21\u578b\u7684\u5bf9\u8bdd","title":"\u5bf9\u8bdd"},{"location":"llm/internlm/lec4/#xtuner_2","text":"","title":"XTuner \u6570\u636e\u5f15\u64ce"},{"location":"llm/internlm/lec4/#_7","text":"","title":"\u6570\u636e\u5904\u7406\u6d41\u7a0b"},{"location":"llm/internlm/lec4/#pack-dataset","text":"\u589e\u5f3a\u5e76\u884c\u6027\uff0c\u5145\u5206\u5229\u7528 GPU \u8d44\u6e90\uff01","title":"\u591a\u6570\u636e\u6837\u672c\u62fc\u63a5\uff08Pack Dataset\uff09"},{"location":"llm/internlm/lec4/#8-gb-llm","text":"","title":"8 GB \u663e\u5361\u73a9\u8f6c LLM"},{"location":"llm/internlm/lec4/#xtuner_3","text":"Flash Attention \uff1a Flash Attention \u5c06 Attention \u8ba1\u7b97\u5e76\u884c\u5316\uff0c\u907f\u514d\u4e86\u8ba1\u7b97\u8fc7\u7a0b\u4e2d Attention Score NxN \u7684\u663e\u5b58\u5360\u7528\uff08\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684 N \u90fd\u6bd4\u8f83\u5927\uff09 DeepSpeed ZeRO ZeRO \u4f18\u5316\uff0c\u901a\u8fc7\u5c06\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u53c2\u6570\u3001\u68af\u5ea6\u548c\u4f18\u5316\u5668\u72b6\u6001\u5207\u7247\u4fdd\u5b58\uff0c\u80fd\u591f\u5728\u591a GPU \u8bad\u7ec3\u65f6\u663e\u8457\u8282\u7701\u663e\u5b58 \u9664\u4e86\u5c06\u8bad\u7ec3\u4e2d\u95f4\u72b6\u6001\u5207\u7247\u5916\uff0c DeepSpeed \u8bad\u7ec3\u65f6\u4f7f\u7528 FP16 \u7684\u6743\u91cd\uff0c\u76f8\u8f83\u4e8e Pytorch \u7684 AMP \u8bad\u7ec3\uff0c\u5728\u5355 GPU \u4e0a\u4e5f\u80fd\u5927\u5e45\u8282\u7701\u663e\u5b58 DeepSpeed \u4e0e Flash Attention \u867d\u7136\u80fd\u591f\u5927\u5e45\u964d\u4f4e\u8bad\u7ec3\u6210\u672c\uff0c\u4f46\u4f7f\u7528\u95e8\u69db\u76f8\u5bf9\u8f83\u9ad8\uff0c\u9700\u8981\u590d\u6742\u7684\u914d\u7f6e\uff0c\u751a\u81f3\u4fee\u6539\u4ee3\u7801\uff0c\u4e3a\u4e86\u8ba9\u5f00\u53d1\u8005\u4e13\u6ce8\u4e8e\u6570\u636e\uff0cXTuner \u4f1a\u81ea\u52a8 dispatch Flash Attention \uff0c\u5e76\u4e00\u952e\u542f\u52a8 DeepSpeed ZeRO xtuner train internlm_20b_qlora_oasst1_512_e3 \\ --deepspeed deepspeed_zero3","title":"XTuner \u52a0\u901f\u65b9\u5f0f"},{"location":"llm/internlm/lec4/#_8","text":"","title":"\u5b9e\u6218\u8bad\u7ec3"},{"location":"llm/internlm/lec4/#_9","text":"\u73af\u5883\uff1aUbuntu + Anaconda + CUDA/CUDNN + 8GB Nvidia GPU \u5b89\u88c5\uff1a conda create --name xtuner0.1.9 python = 3 .10 -y conda activate xtuner0.1.9 cd ~ && mkdir xtuner019 && cd xtuner019 git clone -b v0.1.9 https://github.com/InternLM/xtuner cd xtuner pip install -e '.[all]' \u521b\u5efa\u6570\u636e\u96c6\u5de5\u4f5c\u8def\u5f84\uff1a mkdir ~/ft-oasst1 && cd ~/ft-oasst1","title":"\u73af\u5883 & \u5b89\u88c5"},{"location":"llm/internlm/lec4/#_10","text":"","title":"\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_11","text":"cd ~/ft-oasst1 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 .","title":"\u51c6\u5907\u914d\u7f6e\u6587\u4ef6"},{"location":"llm/internlm/lec4/#_12","text":"InternStudio \u5e73\u53f0\u4e0a cp -r /root/share/temp/model_repos/internlm-chat-7b ~/ft-oasst1/ - \u4e0d\u7528 xtuner \u9ed8\u8ba4\u7684\u4ece huggingface \u62c9\u53d6\u6a21\u578b\uff0c\u800c\u662f\u63d0\u524d\u4ece ModelScope \u4e0b\u8f7d\u6a21\u578b\u5230\u672c\u5730 # \u521b\u5efa\u4e00\u4e2a\u76ee\u5f55\uff0c\u653e\u6a21\u578b\u6587\u4ef6\uff0c\u9632\u6b62\u6563\u843d\u4e00\u5730 mkdir ~/ft-oasst1/internlm-chat-7b # \u88c5\u4e00\u4e0b\u62c9\u53d6\u6a21\u578b\u6587\u4ef6\u8981\u7528\u7684\u5e93 pip install modelscope # \u4ece modelscope \u4e0b\u8f7d\u4e0b\u8f7d\u6a21\u578b\u6587\u4ef6 cd ~/ft-oasst1 apt install git git-lfs -y git lfs install git lfs clone https://modelscope.cn/Shanghai_AI_Laboratory/internlm-chat-7b.git -b v1.0.3","title":"\u6a21\u578b\u4e0b\u8f7d"},{"location":"llm/internlm/lec4/#_13","text":"https://huggingface.co/datasets/timdettmers/openassistant-guanaco/tree/main","title":"\u6570\u636e\u96c6\u4e0b\u8f7d"},{"location":"llm/internlm/lec4/#_14","text":"\u4fee\u6539\u5176\u4e2d\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u4e3a \u672c\u5730\u8def\u5f84 cd ~/ft-oasst1 vim internlm_chat_7b_qlora_oasst1_e3_copy.py # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u96c6\u4e3a\u672c\u5730\u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = './openassistant-guanaco'","title":"\u4fee\u6539\u914d\u7f6e\u6587\u4ef6"},{"location":"llm/internlm/lec4/#_15","text":"# \u5355\u5361 ## \u7528\u521a\u624d\u6539\u597d\u7684config\u6587\u4ef6\u8bad\u7ec3 xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u591a\u5361 NPROC_PER_NODE = ${ GPU_NUM } xtuner train ./internlm_chat_7b_qlora_oasst1_e3_copy.py # \u82e5\u8981\u5f00\u542f deepspeed \u52a0\u901f\uff0c\u589e\u52a0 --deepspeed deepspeed_zero2 \u5373\u53ef \u5fae\u8c03\u5f97\u5230\u7684 PTH \u6a21\u578b\u6587\u4ef6\u548c\u5176\u4ed6\u6742\u4e03\u6742\u516b\u7684\u6587\u4ef6\u90fd\u9ed8\u8ba4\u5728\u5f53\u524d\u7684 ./work_dirs \u4e2d\u3002","title":"\u5f00\u59cb\u5fae\u8c03"},{"location":"llm/internlm/lec4/#adapter","text":"\u5c06\u5f97\u5230\u7684 PTH \u6a21\u578b\u8f6c\u6362\u4e3a HuggingFace \u6a21\u578b\uff0c\u5373\uff1a\u751f\u6210 Adapter \u6587\u4ef6\u5939 \u53ef\u4ee5\u7b80\u5355\u7406\u89e3\uff1aLoRA \u6a21\u578b\u6587\u4ef6 = Adapter mkdir hf export MKL_SERVICE_FORCE_INTEL = 1 xtuner convert pth_to_hf ./internlm_chat_7b_qlora_oasst1_e3_copy.py ./work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_1.pth ./hf","title":"\u751f\u6210 Adapter \u6587\u4ef6"},{"location":"llm/internlm/lec4/#_16","text":"","title":"\u90e8\u7f72\u4e0e\u6d4b\u8bd5"},{"location":"llm/internlm/lec4/#huggingface-adapter","text":"xtuner convert merge ./internlm-chat-7b ./hf ./merged --max-shard-size 2GB # xtuner convert merge \\ # ${NAME_OR_PATH_TO_LLM} \\ # ${NAME_OR_PATH_TO_ADAPTER} \\ # ${SAVE_PATH} \\ # --max-shard-size 2GB","title":"\u5c06 HuggingFace adapter \u5408\u5e76\u5230\u5927\u8bed\u8a00\u6a21\u578b"},{"location":"llm/internlm/lec4/#_17","text":"# \u52a0\u8f7d Adapter \u6a21\u578b\u5bf9\u8bdd\uff08Float 16\uff09 xtuner chat ./merged --prompt-template internlm_chat # 4 bit \u91cf\u5316\u52a0\u8f7d # xtuner chat ./merged --bits 4 --prompt-template internlm_chat \u5fae\u8c03\u524d \u5fae\u8c03\u540e","title":"\u4e0e\u5408\u5e76\u540e\u7684\u6a21\u578b\u5bf9\u8bdd"},{"location":"llm/internlm/lec4/#_18","text":"\u4ee5 Medication QA \u6570\u636e\u96c6 \u4e3a\u4f8b","title":"\u81ea\u5b9a\u4e49\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_19","text":"","title":"\u6982\u8ff0"},{"location":"llm/internlm/lec4/#_20","text":"\u57fa\u4e8e InternLM-chat-7B \u6a21\u578b\uff0c\u7528 MedQA \u6570\u636e\u96c6\u8fdb\u884c\u5fae\u8c03\uff0c\u5c06\u5176\u5f80 \u533b\u5b66\u95ee\u7b54 \u9886\u57df\u5bf9\u9f50\u3002","title":"\u573a\u666f\u9700\u6c42"},{"location":"llm/internlm/lec4/#_21","text":"\u95ee\u9898 \u7b54\u6848 What are ketorolac eye drops?\uff08\u4ec0\u4e48\u662f\u916e\u54af\u9178\u6ef4\u773c\u6db2\uff1f\uff09 Ophthalmic ketorolac is used to treat itchy eyes caused by allergies. It also is used to treat swelling and redness (inflammation) that can occur after cataract surgery. Ketorolac is in a class of medications called nonsteroidal anti-inflammatory drugs (NSAIDs). It works by stopping the release of substances that cause allergy symptoms and inflammation. What medicines raise blood sugar? \uff08\u4ec0\u4e48\u836f\u7269\u4f1a\u5347\u9ad8\u8840\u7cd6\uff1f\uff09 Some medicines for conditions other than diabetes can raise your blood sugar level. This is a concern when you have diabetes. Make sure every doctor you see knows about all of the medicines, vitamins, or herbal supplements you take. This means anything you take with or without a prescription. Examples include: Barbiturates. Thiazide diuretics. Corticosteroids. Birth control pills (oral contraceptives) and progesterone. Catecholamines. Decongestants that contain beta-adrenergic agents, such as pseudoephedrine. The B vitamin niacin. The risk of high blood sugar from niacin lowers after you have taken it for a few months. The antipsychotic medicine olanzapine (Zyprexa).","title":"\u771f\u5b9e\u6570\u636e\u9884\u89c8"},{"location":"llm/internlm/lec4/#_22","text":"\u4ee5 Medication QA \u6570\u636e\u96c6\u4e3a\u4f8b \u539f\u683c\u5f0f\uff1a(.xlsx) \u95ee\u9898 \u836f\u7269\u7c7b\u578b \u95ee\u9898\u7c7b\u578b \u56de\u7b54 \u4e3b\u9898 URL aaa bbb ccc ddd eee fff","title":"\u6570\u636e\u51c6\u5907"},{"location":"llm/internlm/lec4/#xtuner_4","text":"\u76ee\u6807\u683c\u5f0f\uff1a(.jsonL) [{ \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }, { \"conversation\" :[ { \"system\" : \"xxx\" , \"input\" : \"xxx\" , \"output\" : \"xxx\" } ] }] \ud83e\udde0\u901a\u8fc7 python\u811a\u672c\uff1a\u5c06 .xlsx \u4e2d\u7684 \u95ee\u9898 \u548c \u56de\u7b54 \u4e24\u5217 \u63d0\u53d6\u51fa\u6765\uff0c\u518d\u653e\u5165 .jsonL \u6587\u4ef6\u7684\u6bcf\u4e2a conversation \u7684 input \u548c output \u4e2d\u3002 \u8fd9\u4e00\u6b65\u7684 python \u811a\u672c\u53ef\u4ee5\u8bf7 ChatGPT \u6765\u5b8c\u6210\u3002 Write a python file for me. using openpyxl. input file name is MedQA2019.xlsx Step1: The input file is .xlsx. Exact the column A and column D in the sheet named \"DrugQA\" . Step2: Put each value in column A into each \"input\" of each \"conversation\". Put each value in column D into each \"output\" of each \"conversation\". Step3: The output file is .jsonL. It looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step4: All \"system\" value changes to \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" ChatGPT \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a xlsx2jsonl.py import openpyxl import json def process_excel_to_json ( input_file , output_file ): # Load the workbook wb = openpyxl . load_workbook ( input_file ) # Select the \"DrugQA\" sheet sheet = wb [ \"DrugQA\" ] # Initialize the output data structure output_data = [] # Iterate through each row in column A and D for row in sheet . iter_rows ( min_row = 2 , max_col = 4 , values_only = True ): system_value = \"You are a professional, highly experienced doctor professor. You always provide accurate, comprehensive, and detailed answers based on the patients' questions.\" # Create the conversation dictionary conversation = { \"system\" : system_value , \"input\" : row [ 0 ], \"output\" : row [ 3 ] } # Append the conversation to the output data output_data . append ({ \"conversation\" : [ conversation ]}) # Write the output data to a JSON file with open ( output_file , 'w' , encoding = 'utf-8' ) as json_file : json . dump ( output_data , json_file , indent = 4 ) print ( f \"Conversion complete. Output written to { output_file } \" ) # Replace 'MedQA2019.xlsx' and 'output.jsonl' with your actual input and output file names process_excel_to_json ( 'MedQA2019.xlsx' , 'output.jsonl' ) \u6267\u884c python \u811a\u672c\uff0c\u83b7\u5f97\u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\uff1a python xlsx2jsonl.py \u683c\u5f0f\u5316\u540e\u7684\u6570\u636e\u96c6\u957f\u8fd9\u6837\uff1a \u6b64\u65f6\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u5bf9\u6570\u636e\u8fdb\u884c\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\uff0c\u540c\u6837\u53ef\u4ee5\u8ba9 ChatGPT \u5199 python \u4ee3\u7801\u3002\u5f53\u7136\u5982\u679c\u4f60\u6ca1\u6709\u4e25\u683c\u7684\u79d1\u7814\u9700\u6c42\u3001\u4e0d\u5728\u4e4e\u201c\u8bad\u7ec3\u96c6\u6cc4\u9732\u201d\u7684\u95ee\u9898\uff0c\u4e5f\u53ef\u4ee5\u4e0d\u505a\u8bad\u7ec3\u96c6\u4e0e\u6d4b\u8bd5\u96c6\u7684\u5206\u5272\u3002","title":"\u5c06\u6570\u636e\u8f6c\u4e3a XTuner \u7684\u6570\u636e\u683c\u5f0f"},{"location":"llm/internlm/lec4/#_23","text":"my .jsonL file looks like: [{ \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }, { \"conversation\":[ { \"system\": \"xxx\", \"input\": \"xxx\", \"output\": \"xxx\" } ] }] Step1, read the .jsonL file. Step2, count the amount of the \"conversation\" elements. Step3, randomly split all \"conversation\" elements by 7:3. Targeted structure is same as the input. Step4, save the 7/10 part as train.jsonl. save the 3/10 part as test.jsonl \u751f\u6210\u7684 python \u4ee3\u7801\u5982\u4e0b\uff1a split2train_and_test.py import json import random def split_conversations ( input_file , train_output_file , test_output_file ): # Read the input JSONL file with open ( input_file , 'r' , encoding = 'utf-8' ) as jsonl_file : data = json . load ( jsonl_file ) # Count the number of conversation elements num_conversations = len ( data ) # Shuffle the data randomly random . shuffle ( data ) random . shuffle ( data ) random . shuffle ( data ) # Calculate the split points for train and test split_point = int ( num_conversations * 0.7 ) # Split the data into train and test train_data = data [: split_point ] test_data = data [ split_point :] # Write the train data to a new JSONL file with open ( train_output_file , 'w' , encoding = 'utf-8' ) as train_jsonl_file : json . dump ( train_data , train_jsonl_file , indent = 4 ) # Write the test data to a new JSONL file with open ( test_output_file , 'w' , encoding = 'utf-8' ) as test_jsonl_file : json . dump ( test_data , test_jsonl_file , indent = 4 ) print ( f \"Split complete. Train data written to { train_output_file } , Test data written to { test_output_file } \" ) # Replace 'input.jsonl', 'train.jsonl', and 'test.jsonl' with your actual file names split_conversations ( 'MedQA2019-structured.jsonl' , 'MedQA2019-structured-train.jsonl' , 'MedQA2019-structured-test.jsonl' )","title":"\u5212\u5206\u8bad\u7ec3\u96c6\u548c\u6d4b\u8bd5\u96c6"},{"location":"llm/internlm/lec4/#_24","text":"\u6b64\u65f6\uff0c\u6211\u4eec\u91cd\u65b0\u5efa\u4e00\u4e2a\u6587\u4ef6\u5939\u6765\u73a9\u201c\u5fae\u8c03\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\u201d mkdir ~/ft-medqa && cd ~/ft-medqa \u628a\u524d\u9762\u4e0b\u8f7d\u597d\u7684internlm-chat-7b\u6a21\u578b\u6587\u4ef6\u5939\u62f7\u8d1d\u8fc7\u6765\u3002 cp -r ~/ft-oasst1/internlm-chat-7b . \u522b\u5fd8\u4e86\u628a\u81ea\u5b9a\u4e49\u6570\u636e\u96c6\uff0c\u5373\u51e0\u4e2a .jsonL \uff0c\u4e5f\u4f20\u5230\u670d\u52a1\u5668\u4e0a\u3002 git clone https://github.com/InternLM/tutorial cp ~/tutorial/xtuner/MedQA2019-structured-train.jsonl .","title":"\u5f00\u59cb\u81ea\u5b9a\u4e49\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_25","text":"# \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . # \u6539\u4e2a\u6587\u4ef6\u540d mv internlm_chat_7b_qlora_oasst1_e3_copy.py internlm_chat_7b_qlora_medqa2019_e3.py # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u5185\u5bb9 vim internlm_chat_7b_qlora_medqa2019_e3.py \u51cf\u53f7\u4ee3\u8868\u8981\u5220\u9664\u7684\u884c\uff0c\u52a0\u53f7\u4ee3\u8868\u8981\u589e\u52a0\u7684\u884c\u3002 # \u4fee\u6539import\u90e8\u5206 - from xtuner.dataset.map_fns import oasst1_map_fn, template_map_fn_factory + from xtuner.dataset.map_fns import template_map_fn_factory # \u4fee\u6539\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b' # \u4fee\u6539\u8bad\u7ec3\u6570\u636e\u4e3a MedQA2019-structured-train.jsonl \u8def\u5f84 - data_path = 'timdettmers/openassistant-guanaco' + data_path = 'MedQA2019-structured-train.jsonl' # \u4fee\u6539 train_dataset \u5bf9\u8c61 train_dataset = dict( type=process_hf_dataset, - dataset=dict(type=load_dataset, path=data_path), + dataset=dict(type=load_dataset, path='json', data_files=dict(train=data_path)), tokenizer=tokenizer, max_length=max_length, - dataset_map_fn=alpaca_map_fn, + dataset_map_fn=None, template_map_fn=dict( type=template_map_fn_factory, template=prompt_template), remove_unused_columns=True, shuffle_before_pack=True, pack_to_max_length=pack_to_max_length)","title":"\u51c6\u5907\u914d\u7f6e\u6587\u4ef6"},{"location":"llm/internlm/lec4/#xtuner_5","text":"xtuner train internlm_chat_7b_qlora_medqa2019_e3.py --deepspeed deepspeed_zero2","title":"XTuner\uff01\u542f\u52a8\uff01"},{"location":"llm/internlm/lec4/#adapter_1","text":"","title":"\u751f\u6210 Adapter \u6587\u4ef6"},{"location":"llm/internlm/lec4/#_26","text":"","title":"\u90e8\u7f72\u4e0e\u6d4b\u8bd5"},{"location":"llm/internlm/lec4/#ms-agent-llm-agent","text":"","title":"\u7528 MS-Agent \u6570\u636e\u96c6\u8d4b\u4e88 LLM \u4ee5 Agent \u80fd\u529b"},{"location":"llm/internlm/lec4/#_27","text":"MSAgent \u6570\u636e\u96c6\u6bcf\u6761\u6837\u672c\u5305\u542b\u4e00\u4e2a\u5bf9\u8bdd\u5217\u8868\uff08conversations\uff09\uff0c\u5176\u91cc\u9762\u5305\u542b\u4e86 system\u3001user\u3001assistant \u4e09\u79cd\u5b57\u6bb5\u3002\u5176\u4e2d\uff1a system: \u8868\u793a\u7ed9\u6a21\u578b\u524d\u7f6e\u7684\u4eba\u8bbe\u8f93\u5165\uff0c\u5176\u4e2d\u6709\u544a\u8bc9\u6a21\u578b\u5982\u4f55\u8c03\u7528\u63d2\u4ef6\u4ee5\u53ca\u751f\u6210\u8bf7\u6c42 user: \u8868\u793a\u7528\u6237\u7684\u8f93\u5165 prompt\uff0c\u5206\u4e3a\u4e24\u79cd\uff0c\u901a\u7528\u751f\u6210\u7684prompt\u548c\u8c03\u7528\u63d2\u4ef6\u9700\u6c42\u7684 prompt assistant: \u4e3a\u6a21\u578b\u7684\u56de\u590d\u3002\u5176\u4e2d\u4f1a\u5305\u62ec\u63d2\u4ef6\u8c03\u7528\u4ee3\u7801\u548c\u6267\u884c\u4ee3\u7801\uff0c\u8c03\u7528\u4ee3\u7801\u662f\u8981 LLM \u751f\u6210\u7684\uff0c\u800c\u6267\u884c\u4ee3\u7801\u662f\u8c03\u7528\u670d\u52a1\u6765\u751f\u6210\u7ed3\u679c\u7684 \u4e00\u6761\u8c03\u7528\u7f51\u9875\u641c\u7d22\u63d2\u4ef6\u67e5\u8be2\u201c\u4e0a\u6d77\u660e\u5929\u5929\u6c14\u201d\u7684\u6570\u636e\u6837\u672c\u793a\u4f8b\u5982\u4e0b\u56fe\u6240\u793a\uff1a","title":"\u6982\u8ff0"},{"location":"llm/internlm/lec4/#_28","text":"","title":"\u5fae\u8c03\u6b65\u9aa4"},{"location":"llm/internlm/lec4/#_29","text":"xtuner \u662f\u4ece\u56fd\u5185\u7684 ModelScope \u5e73\u53f0\u4e0b\u8f7d MS-Agent \u6570\u636e\u96c6\uff0c\u56e0\u6b64\u4e0d\u7528\u63d0\u524d\u624b\u52a8\u4e0b\u8f7d\u6570\u636e\u96c6\u6587\u4ef6\u3002 # \u51c6\u5907\u5de5\u4f5c mkdir ~/ft-msagent && cd ~/ft-msagent cp -r ~/ft-oasst1/internlm-chat-7b . # \u67e5\u770b\u914d\u7f6e\u6587\u4ef6 xtuner list-cfg | grep msagent # \u590d\u5236\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_7b_qlora_msagent_react_e3_gpu8 . # \u4fee\u6539\u914d\u7f6e\u6587\u4ef6\u4e2d\u7684\u6a21\u578b\u4e3a\u672c\u5730\u8def\u5f84 vim ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py - pretrained_model_name_or_path = 'internlm/internlm-chat-7b' + pretrained_model_name_or_path = './internlm-chat-7b'","title":"\u51c6\u5907\u5de5\u4f5c"},{"location":"llm/internlm/lec4/#_30","text":"xtuner train ./internlm_7b_qlora_msagent_react_e3_gpu8_copy.py --deepspeed deepspeed_zero2","title":"\u5f00\u59cb\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_31","text":"\u7531\u4e8e msagent \u7684\u8bad\u7ec3\u975e\u5e38\u8d39\u65f6\uff0c\u5927\u5bb6\u5982\u679c\u60f3\u5c3d\u5feb\u628a\u8fd9\u4e2a\u6559\u7a0b\u8ddf\u5b8c\uff0c\u53ef\u4ee5\u76f4\u63a5\u4ece modelScope \u62c9\u53d6\u54b1\u4eec\u5df2\u7ecf\u5fae\u8c03\u597d\u4e86\u7684 Adapter\u3002\u5982\u4e0b\u6f14\u793a\u3002","title":"\u76f4\u63a5\u4f7f\u7528"},{"location":"llm/internlm/lec4/#adapter_2","text":"cd ~/ft-msagent apt install git git-lfs git lfs install git lfs clone https://www.modelscope.cn/xtuner/internlm-7b-qlora-msagent-react.git \u6709\u4e86\u8fd9\u4e2a\u5728 msagent \u4e0a\u8bad\u7ec3\u5f97\u5230\u7684Adapter\uff0c\u6a21\u578b\u73b0\u5728\u5df2\u7ecf\u6709 agent \u80fd\u529b\u4e86\uff01\u5c31\u53ef\u4ee5\u52a0 --lagent \u4ee5\u8c03\u7528\u6765\u81ea lagent \u7684\u4ee3\u7406\u529f\u80fd\u4e86\uff01","title":"\u4e0b\u8f7d Adapter"},{"location":"llm/internlm/lec4/#serper","text":"\u5f00\u59cb chat \u4e4b\u524d\uff0c\u8fd8\u8981\u52a0\u4e2a serper \u7684\u73af\u5883\u53d8\u91cf\uff1a \u53bb serper.dev \u514d\u8d39\u6ce8\u518c\u4e00\u4e2a\u8d26\u53f7\uff0c\u751f\u6210\u81ea\u5df1\u7684 api key\u3002\u8fd9\u4e2a\u4e1c\u897f\u662f\u7528\u6765\u7ed9 lagent \u53bb\u83b7\u53d6 google \u641c\u7d22\u7684\u7ed3\u679c\u7684\u3002\u7b49\u4e8e\u662f serper.dev \u5e2e\u4f60\u53bb\u8bbf\u95ee google\uff0c\u800c\u4e0d\u662f\u4ece\u4f60\u81ea\u5df1\u672c\u5730\u53bb\u8bbf\u95ee google \u4e86\u3002 \u6dfb\u52a0 serper api key \u5230\u73af\u5883\u53d8\u91cf\uff1a export SERPER_API_KEY = abcdefg","title":"\u6dfb\u52a0 serper \u73af\u5883\u53d8\u91cf"},{"location":"llm/internlm/lec4/#xtuner-agent","text":"xtuner chat ./internlm-chat-7b --adapter internlm-7b-qlora-msagent-react --lagent --prompt-template internlm_chat","title":"xtuner + agent\uff0c\u542f\u52a8\uff01"},{"location":"llm/internlm/lec4/#xtuner-internlm-chat","text":"","title":"\u4f5c\u4e1a\uff1aXTuner InternLM-Chat \u4e2a\u4eba\u5c0f\u52a9\u624b\u8ba4\u77e5\u5fae\u8c03\u5b9e\u8df5"},{"location":"llm/internlm/lec4/#_32","text":"# InternStudio \u5e73\u53f0\u4e2d\uff0c\u4ece\u672c\u5730 clone \u4e00\u4e2a\u5df2\u6709 pytorch 2.0.1 \u7684\u73af\u5883\uff08\u540e\u7eed\u5747\u5728\u8be5\u73af\u5883\u6267\u884c\uff0c\u82e5\u4e3a\u5176\u4ed6\u73af\u5883\u53ef\u4f5c\u4e3a\u53c2\u8003\uff09 # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash # \u8fdb\u5165\u73af\u5883\u540e\u9996\u5148 bash bash conda create --name personal_assistant --clone = /root/share/conda_envs/internlm-base # \u5982\u679c\u5728\u5176\u4ed6\u5e73\u53f0\uff1a # conda create --name personal_assistant python=3.10 -y # \u6fc0\u6d3b\u73af\u5883 conda activate personal_assistant # \u8fdb\u5165\u5bb6\u76ee\u5f55 \uff08~\u7684\u610f\u601d\u662f \u201c\u5f53\u524d\u7528\u6237\u7684home\u8def\u5f84\u201d\uff09 cd ~ # \u521b\u5efa\u7248\u672c\u6587\u4ef6\u5939\u5e76\u8fdb\u5165\uff0c\u4ee5\u8ddf\u968f\u672c\u6559\u7a0b # personal_assistant\u7528\u4e8e\u5b58\u653e\u672c\u6559\u7a0b\u6240\u4f7f\u7528\u7684\u4e1c\u897f mkdir /root/personal_assistant && cd /root/personal_assistant mkdir /root/personal_assistant/xtuner019 && cd /root/personal_assistant/xtuner019 # \u62c9\u53d6 0.1.9 \u7684\u7248\u672c\u6e90\u7801 git clone -b v0.1.9 https://github.com/InternLM/xtuner # \u65e0\u6cd5\u8bbf\u95eegithub\u7684\u7528\u6237\u8bf7\u4ece gitee \u62c9\u53d6: # git clone -b v0.1.9 https://gitee.com/Internlm/xtuner # \u8fdb\u5165\u6e90\u7801\u76ee\u5f55 cd xtuner # \u4ece\u6e90\u7801\u5b89\u88c5 XTuner pip install -e '.[all]'","title":"\u73af\u5883\u51c6\u5907"},{"location":"llm/internlm/lec4/#_33","text":"mkdir -p /root/personal_assistant/data && cd /root/personal_assistant/data \u5728 data \u76ee\u5f55\u4e0b\u521b\u5efa\u4e00\u4e2ajson\u6587\u4ef6 personal_assistant.json \u4f5c\u4e3a\u672c\u6b21\u5fae\u8c03\u6240\u4f7f\u7528\u7684\u6570\u636e\u96c6\u3002 \u5176\u4e2d conversation \u8868\u793a\u4e00\u6b21\u5bf9\u8bdd\u7684\u5185\u5bb9\uff0c input \u4e3a\u8f93\u5165\uff0c\u5373\u7528\u6237\u4f1a\u95ee\u7684\u95ee\u9898\uff0c output \u4e3a\u8f93\u51fa\uff0c\u5373\u60f3\u8981\u6a21\u578b\u56de\u7b54\u7684\u7b54\u6848\u3002 \u4ee5\u4e0b\u662f\u4e00\u4e2apython\u811a\u672c\uff0c\u7528\u4e8e\u751f\u6210\u6570\u636e\u96c6\u3002 generate_data.py import json # \u8f93\u5165\u4f60\u7684\u540d\u5b57 name = '\u72d9\u51fb\u7f8e\u4f50' # \u91cd\u590d\u6b21\u6570 n = 10000 data = [ { \"conversation\" : [ { \"input\" : \"\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd\" , \"output\" : \"\u6211\u662f {} \u7684\u5c0f\u52a9\u624b\uff0c\u5185\u5728\u662f\u4e0a\u6d77AI\u5b9e\u9a8c\u5ba4\u4e66\u751f\u00b7\u6d66\u8bed\u76847B\u5927\u6a21\u578b\u54e6\" . format ( name ) } ] } ] for i in range ( n ): data . append ( data [ 0 ]) with open ( 'personal_assistant.json' , 'w' , encoding = 'utf-8' ) as f : json . dump ( data , f , ensure_ascii = False , indent = 4 )","title":"\u6570\u636e\u51c6\u5907"},{"location":"llm/internlm/lec4/#_34","text":"mkdir -p /root/personal_assistant/model/Shanghai_AI_Laboratory cp -r /root/share/temp/model_repos/internlm-chat-7b /root/personal_assistant/model/Shanghai_AI_Laboratory # \u521b\u5efa\u7528\u4e8e\u5b58\u653e\u914d\u7f6e\u7684\u6587\u4ef6\u5939config\u5e76\u8fdb\u5165 mkdir /root/personal_assistant/config && cd /root/personal_assistant/config # \u62f7\u8d1d\u4e00\u4e2a\u914d\u7f6e\u6587\u4ef6\u5230\u5f53\u524d\u76ee\u5f55 xtuner copy-cfg internlm_chat_7b_qlora_oasst1_e3 . \u4fee\u6539\u62f7\u8d1d\u540e\u7684\u6587\u4ef6\uff1a internlm_chat_7b_qlora_oasst1_e3_copy.py # Copyright (c) OpenMMLab. All rights reserved. import torch from bitsandbytes.optim import PagedAdamW32bit from datasets import load_dataset from mmengine.dataset import DefaultSampler from mmengine.hooks import ( CheckpointHook , DistSamplerSeedHook , IterTimerHook , LoggerHook , ParamSchedulerHook ) from mmengine.optim import AmpOptimWrapper , CosineAnnealingLR from peft import LoraConfig from transformers import ( AutoModelForCausalLM , AutoTokenizer , BitsAndBytesConfig ) from xtuner.dataset import process_hf_dataset from xtuner.dataset.collate_fns import default_collate_fn from xtuner.dataset.map_fns import oasst1_map_fn , template_map_fn_factory from xtuner.engine import DatasetInfoHook , EvaluateChatHook from xtuner.model import SupervisedFinetune from xtuner.utils import PROMPT_TEMPLATE ####################################################################### # PART 1 Settings # ####################################################################### # Model pretrained_model_name_or_path = '/root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b' # Data data_path = '/root/personal_assistant/data/personal_assistant.json' prompt_template = PROMPT_TEMPLATE . internlm_chat max_length = 512 pack_to_max_length = True # Scheduler & Optimizer batch_size = 2 # per_device accumulative_counts = 16 dataloader_num_workers = 0 max_epochs = 3 optim_type = PagedAdamW32bit lr = 2e-4 betas = ( 0.9 , 0.999 ) weight_decay = 0 max_norm = 1 # grad clip # Evaluate the generation performance during the training evaluation_freq = 90 SYSTEM = '' evaluation_inputs = [ '\u8bf7\u4ecb\u7ecd\u4e00\u4e0b\u4f60\u81ea\u5df1' , '\u8bf7\u505a\u4e00\u4e0b\u81ea\u6211\u4ecb\u7ecd' ] ####################################################################### # PART 2 Model & Tokenizer # ####################################################################### tokenizer = dict ( type = AutoTokenizer . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , padding_side = 'right' ) model = dict ( type = SupervisedFinetune , llm = dict ( type = AutoModelForCausalLM . from_pretrained , pretrained_model_name_or_path = pretrained_model_name_or_path , trust_remote_code = True , torch_dtype = torch . float16 , quantization_config = dict ( type = BitsAndBytesConfig , load_in_4bit = True , load_in_8bit = False , llm_int8_threshold = 6.0 , llm_int8_has_fp16_weight = False , bnb_4bit_compute_dtype = torch . float16 , bnb_4bit_use_double_quant = True , bnb_4bit_quant_type = 'nf4' )), lora = dict ( type = LoraConfig , r = 64 , lora_alpha = 16 , lora_dropout = 0.1 , bias = 'none' , task_type = 'CAUSAL_LM' )) ####################################################################### # PART 3 Dataset & Dataloader # ####################################################################### train_dataset = dict ( type = process_hf_dataset , dataset = dict ( type = load_dataset , path = 'json' , data_files = dict ( train = data_path )), tokenizer = tokenizer , max_length = max_length , dataset_map_fn = None , template_map_fn = dict ( type = template_map_fn_factory , template = prompt_template ), remove_unused_columns = True , shuffle_before_pack = True , pack_to_max_length = pack_to_max_length ) train_dataloader = dict ( batch_size = batch_size , num_workers = dataloader_num_workers , dataset = train_dataset , sampler = dict ( type = DefaultSampler , shuffle = True ), collate_fn = dict ( type = default_collate_fn )) ####################################################################### # PART 4 Scheduler & Optimizer # ####################################################################### # optimizer optim_wrapper = dict ( type = AmpOptimWrapper , optimizer = dict ( type = optim_type , lr = lr , betas = betas , weight_decay = weight_decay ), clip_grad = dict ( max_norm = max_norm , error_if_nonfinite = False ), accumulative_counts = accumulative_counts , loss_scale = 'dynamic' , dtype = 'float16' ) # learning policy # More information: https://github.com/open-mmlab/mmengine/blob/main/docs/en/tutorials/param_scheduler.md # noqa: E501 param_scheduler = dict ( type = CosineAnnealingLR , eta_min = 0.0 , by_epoch = True , T_max = max_epochs , convert_to_iter_based = True ) # train, val, test setting train_cfg = dict ( by_epoch = True , max_epochs = max_epochs , val_interval = 1 ) ####################################################################### # PART 5 Runtime # ####################################################################### # Log the dialogue periodically during the training process, optional custom_hooks = [ dict ( type = DatasetInfoHook , tokenizer = tokenizer ), dict ( type = EvaluateChatHook , tokenizer = tokenizer , every_n_iters = evaluation_freq , evaluation_inputs = evaluation_inputs , system = SYSTEM , prompt_template = prompt_template ) ] # configure default hooks default_hooks = dict ( # record the time of every iteration. timer = dict ( type = IterTimerHook ), # print log every 100 iterations. logger = dict ( type = LoggerHook , interval = 10 ), # enable the parameter scheduler. param_scheduler = dict ( type = ParamSchedulerHook ), # save checkpoint per epoch. checkpoint = dict ( type = CheckpointHook , interval = 1 ), # set sampler seed in distributed evrionment. sampler_seed = dict ( type = DistSamplerSeedHook ), ) # configure environment env_cfg = dict ( # whether to enable cudnn benchmark cudnn_benchmark = False , # set multi process parameters mp_cfg = dict ( mp_start_method = 'fork' , opencv_num_threads = 0 ), # set distributed parameters dist_cfg = dict ( backend = 'nccl' ), ) # set visualizer visualizer = None # set log level log_level = 'INFO' # load from which checkpoint load_from = None # whether to resume training from the loaded checkpoint resume = False # Defaults to use random seed and disable `deterministic` randomness = dict ( seed = None , deterministic = False )","title":"\u914d\u7f6e\u51c6\u5907"},{"location":"llm/internlm/lec4/#_35","text":"xtuner train /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py","title":"\u5fae\u8c03"},{"location":"llm/internlm/lec4/#_36","text":"\u8bad\u7ec3\u540e\u7684pth\u683c\u5f0f\u53c2\u6570\u8f6cHugging Face\u683c\u5f0f # \u521b\u5efa\u7528\u4e8e\u5b58\u653eHugging Face\u683c\u5f0f\u53c2\u6570\u7684hf\u6587\u4ef6\u5939 mkdir /root/personal_assistant/config/work_dirs/hf export MKL_SERVICE_FORCE_INTEL = 1 # \u914d\u7f6e\u6587\u4ef6\u5b58\u653e\u7684\u4f4d\u7f6e export CONFIG_NAME_OR_PATH = /root/personal_assistant/config/internlm_chat_7b_qlora_oasst1_e3_copy.py # \u6a21\u578b\u8bad\u7ec3\u540e\u5f97\u5230\u7684pth\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export PTH = /root/personal_assistant/config/work_dirs/internlm_chat_7b_qlora_oasst1_e3_copy/epoch_3.pth # pth\u6587\u4ef6\u8f6c\u6362\u4e3aHugging Face\u683c\u5f0f\u540e\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf # \u6267\u884c\u53c2\u6570\u8f6c\u6362 xtuner convert pth_to_hf $CONFIG_NAME_OR_PATH $PTH $SAVE_PATH Merge\u6a21\u578b\u53c2\u6570 export MKL_SERVICE_FORCE_INTEL = 1 export MKL_THREADING_LAYER = 'GNU' # \u539f\u59cb\u6a21\u578b\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_LLM = /root/personal_assistant/model/Shanghai_AI_Laboratory/internlm-chat-7b # Hugging Face\u683c\u5f0f\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e export NAME_OR_PATH_TO_ADAPTER = /root/personal_assistant/config/work_dirs/hf # \u6700\u7ec8Merge\u540e\u7684\u53c2\u6570\u5b58\u653e\u7684\u4f4d\u7f6e mkdir /root/personal_assistant/config/work_dirs/hf_merge export SAVE_PATH = /root/personal_assistant/config/work_dirs/hf_merge # \u6267\u884c\u53c2\u6570Merge xtuner convert merge \\ $NAME_OR_PATH_TO_LLM \\ $NAME_OR_PATH_TO_ADAPTER \\ $SAVE_PATH \\ --max-shard-size 2GB","title":"\u53c2\u6570\u8f6c\u6362/\u5408\u5e76"},{"location":"llm/internlm/lec4/#demo","text":"\u5b89\u88c5\u4f9d\u8d56 pip install streamlit == 1 .24.0 \u4e0b\u8f7dInternLM\u9879\u76ee\u4ee3\u7801 # \u521b\u5efacode\u6587\u4ef6\u5939\u7528\u4e8e\u5b58\u653eInternLM\u9879\u76ee\u4ee3\u7801 mkdir /root/personal_assistant/code && cd /root/personal_assistant/code git clone https://github.com/InternLM/InternLM.git \u5c06 /root/code/InternLM/web_demo.py \u4e2d 29 \u884c \u548c 33 \u884c\u7684\u6a21\u578b\u8def\u5f84\u66f4\u6362\u4e3aMerge\u540e\u5b58\u653e\u53c2\u6570\u7684\u8def\u5f84 /root/personal_assistant/config/work_dirs/hf_merge \u8fd0\u884c /root/personal_assistant/code/InternLM \u76ee\u5f55\u4e0b\u7684 web_demo.py \u6587\u4ef6\uff0c\u5c06\u7aef\u53e3\u6620\u5c04\u5230\u672c\u5730 streamlit run /root/personal_assistant/code/InternLM/web_demo.py --server.address 127 .0.0.1 --server.port 6006","title":"Demo"},{"location":"llm/internlm/lec4/#_37","text":"\u5fae\u8c03\u524d \uff08\u56de\u7b54\u6bd4\u8f83\u5b98\u65b9\uff09 \u5fae\u8c03\u540e \uff08\u5bf9\u81ea\u5df1\u7684\u8eab\u4efd\u6709\u4e86\u6e05\u6670\u7684\u8ba4\u77e5\uff09","title":"\u6548\u679c"},{"location":"llm/internlm/lec4/#_38","text":"\u5c06\u8bad\u7ec3\u597d\u7684Adapter\u6a21\u578b\u6743\u91cd\u4e0a\u4f20\u5230 OpenXLab\u3001Hugging Face \u6216\u8005 MoelScope \u4efb\u4e00\u4e00\u5e73\u53f0\u3002 \u901a\u8fc7 scp \u5c06 hf \u6587\u4ef6\u5939\u4e0b\u8f7d\u5230\u672c\u5730\uff0c\u8fdb\u5165 HuggingFace \u65b0\u5efa model\uff0c\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6\u3002Adapter \u6743\u91cd\u5730\u5740\uff1a https://huggingface.co/jujimeizuo/assistant-jujimeizuo/tree/main \u5c06\u8bad\u7ec3\u597d\u540e\u7684\u6a21\u578b\u5e94\u7528\u90e8\u7f72\u5230 OpenXLab \u5e73\u53f0\uff0c\u53c2\u8003\u90e8\u7f72\u6587\u6863\u8bf7\u8bbf\u95ee\uff1a https://aicarrier.feishu.cn/docx/MQH6dygcKolG37x0ekcc4oZhnCe \u901a\u8fc7 openxlab \u5e93\u4e0a\u4f20\u6a21\u578b\u6587\u4ef6 \u65b0\u5efa github \u7684 repo( assistant_jujimeizuo )\uff0c\u4ece OpenXLab \u4e0a\u62c9\u53d6\u4e0a\u4f20\u7684\u6a21\u578b\uff0c\u6784\u5efa streamlit \u7684 app\uff0c\u540c\u6b65\u5230 OpenXLab \u4e0a\u3002 \u5e94\u7528\u670d\u52a1\u5730\u5740\uff1a https://openxlab.org.cn/apps/detail/jujimeizuo/assistant_jujimeizuo","title":"\u8fdb\u9636\u4f5c\u4e1a"},{"location":"llm/internlm/lec5/","text":"LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u00b6 \u7ea6 1186 \u4e2a\u5b57 66 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u5b66\u4e60\u81ea LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5 \u5927\u6a21\u578b\u90e8\u7f72\u80cc\u666f \u00b6 \u6a21\u578b\u90e8\u7f72 \u00b6 \u5b9a\u4e49 \u5c06\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u5728\u7279\u5b9a\u8f6f\u786c\u4ef6\u73af\u5883\u4e2d\u542f\u52a8\u7684\u8fc7\u7a0b\uff0c\u4f7f\u6a21\u578b\u80fd\u591f\u63a5\u53d7\u8f93\u5165\u5e76\u8fd4\u56de\u9884\u6d4b\u7ed3\u679c \u4e3a\u4e86\u6ee1\u8db3\u6027\u80fd\u548c\u6548\u7387\u7684\u9700\u6c42\uff0c\u5e38\u5e38\u9700\u8981\u5bf9\u6a21\u578b\u8fdb\u884c\u4f18\u5316\uff0c\u4f8b\u5982\u6a21\u578b\u538b\u7f29\u548c\u786c\u4ef6\u52a0\u901f \u4ea7\u54c1\u5f62\u6001 \u4e91\u7aef\u3001\u8fb9\u7f18\u8ba1\u7b97\u7aef\u3001\u79fb\u52a8\u7aef \u8ba1\u7b97\u8bbe\u5907 CPU\u3001GPU\u3001TPU\u3001NPU \u7b49 \u5927\u6a21\u578b\u7279\u70b9 \u00b6 \u5185\u5b58\u5f00\u9500\u5de8\u5927 \u5e9e\u5927\u53c2\u6570\u91cf\uff0c7B \u6a21\u578b\u4ec5\u6743\u91cd\u5c31\u9700\u8981 14+G \u5185\u5b58 \u91c7\u7528\u81ea\u56de\u5f52\u751f\u6210 token\uff0c\u9700\u8981\u7f13\u5b58 Attention \u7684 k/v\uff0c\u5e26\u6765\u5de8\u5927\u7684\u5185\u5b58\u5f00\u9500 \u52a8\u6001 shape \u8bf7\u6c42\u6570\u4e0d\u56fa\u5b9a Token \u9010\u4e2a\u751f\u6210\uff0c\u4e14\u6570\u91cf\u4e0d\u5b9a \u76f8\u5bf9\u89c6\u89c9\u6a21\u578b\uff0cLLM \u7ed3\u6784\u7b80\u5355 Transformers \u7ed3\u6784\uff0c\u5927\u90e8\u5206\u662f decoder-only \u5927\u6a21\u578b\u90e8\u7f72\u6311\u6218 \u00b6 \u8bbe\u5907 \u5982\u4f55\u5e94\u5bf9\u5de8\u5927\u7684\u5b58\u50a8\u95ee\u9898\uff1f\u4f4e\u5b58\u50a8\u8bbe\u5907\uff08\u6d88\u8d39\u7ea7\u663e\u5361\u3001\u624b\u673a\u7b49\uff09\u5982\u4f55\u90e8\u7f72\uff1f \u63a8\u7406 \u5982\u4f55\u52a0\u901f token \u7684\u751f\u6210\u901f\u5ea6 \u5982\u4f55\u89e3\u51b3\u52a8\u6001 shape\uff0c\u8ba9\u63a8\u7406\u53ef\u4ee5\u4e0d\u95f4\u65ad \u5982\u4f55\u6709\u6548\u76d1\u7763\u548c\u5229\u7528\u5185\u5b58 \u670d\u52a1 \u5982\u4f55\u63d0\u5347\u7cfb\u7edf\u6574\u4f53\u541e\u5410\u91cf\uff1f \u5bf9\u4e8e\u4e2a\u4f53\u7528\u6237\uff0c\u5982\u4f55\u964d\u4f4e\u54cd\u5e94\u65f6\u95f4\uff1f \u5927\u6a21\u578b\u90e8\u7f72\u65b9\u6848 \u00b6 \u6280\u672f\u70b9 \u6a21\u578b\u5e76\u884c \u4f4e\u6bd4\u7279\u91cf\u5316 Page Attention transformer \u8ba1\u7b97\u548c\u8bbf\u5b58\u4f18\u5316 Continuous Batch ... \u65b9\u6848 huggingface Transformers \u4e13\u95e8\u7684\u63a8\u7406\u52a0\u901f\u6846\u67b6 \u4e91\u7aef lmdeploy vllm tensorrt-llm deepspeed \u79fb\u52a8\u7aef llama.cpp mlc-llm ... LMDeploy \u7b80\u4ecb \u00b6 LMDeploy \u662f LLM \u5728 Nvidia \u8bbe\u5907\u4e0a\u90e8\u7f72\u7684\u5168\u6d41\u7a0b\u89e3\u51b3\u65b9\u6848\uff0c\u5305\u62ec\u6a21\u578b\u8f7b\u91cf\u5316\u3001\u63a8\u7406\u3001\u670d\u52a1\u3002 \u6838\u5fc3\u529f\u80fd \u00b6 \u91cf\u5316 \u00b6 \u4e3a\u4ec0\u4e48 Weight Only \u91cf\u5316\uff1f 4bit Weight Only \u91cf\u5316\uff0c\u5c06 FP16 \u7684\u6a21\u578b\u6743\u91cd\u91cf\u5316\u4e3a INT4\uff0c\u8bbf\u5b58\u91cf\u76f4\u63a5\u964d\u4e3a FP16 \u7684\u6a21\u578b 1/4\uff0c\u5927\u5e45\u964d\u4f4e\u4e86\u8bbf\u5b58\u6210\u672c\uff0c\u63d0\u9ad8 Decoding \u7684\u901f\u5ea6\u3002 \u52a0\u901f\u7684\u540c\u65f6\u8fd8\u8282\u7701\u663e\u5b58\uff0c\u540c\u6837\u7684\u8bbe\u5907\u80fd\u591f\u652f\u6301\u66f4\u5927\u7684\u6a21\u578b\u4ee5\u53ca\u66f4\u957f\u7684\u5bf9\u8bdd\u957f\u5ea6\u3002 \u5982\u4f55\u505a Weight Only \u91cf\u5316\uff1f LMDeploy \u4f7f\u7528 MIT HAN LAB \u5f00\u6e90\u7684 AWQ \u7b97\u6cd5\uff0c\u91cf\u5316\u4e3a 4bit \u6a21\u578b \u63a8\u7406\u65f6\uff0c\u5148\u628a 4bit \u6743\u91cd\uff0c \u53cd\u91cf\u5316\u56deFP16 \uff08\u5728 Kernel \u5185\u90e8\u8fdb\u884c\uff0c\u4ece Global Memory \u8bfb\u53d6\u65f6\u4ecd\u662f 4bit\uff09\uff0c\u4f9d\u65e7\u4f7f\u7528\u7684\u662f FP16 \u8ba1\u7b97 \u60f3\u8f83\u4e8e\u793e\u533a\u4f7f\u7528\u6700\u591a\u7684 GPTQ \u7b97\u6cd5\uff0cAWQ \u7684\u63a8\u7406\u901f\u5ea6\u66f4\u5feb\uff0c\u91cf\u5316\u65f6\u95f4\u66f4\u77ed \u63a8\u7406\u5f15\u64ce TurboMind \u00b6 \u6301\u7eed\u6279\u5904\u7406 \u6709\u72b6\u6001\u7684\u63a8\u7406 \u9ad8\u6027\u80fd cuda Kernel Blocked k/v cache \u63a8\u7406\u670d\u52a1 api server \u00b6 lmdeploy serve api_server InternLM/internlm-chat-7b \\ --model-name internlm-chat-7b --server-port 8080 \u670d\u52a1\u90e8\u7f72 \u00b6 \u6a21\u578b\u8f6c\u6362 \u00b6 \u4f7f\u7528 TurboMind \u63a8\u7406\u6a21\u578b\u9700\u8981\u5148\u5c06\u6a21\u578b\u8f6c\u5316\u4e3a TurboMind \u7684\u683c\u5f0f\uff0c\u76ee\u524d\u652f\u6301\u5728\u7ebf\u8f6c\u6362\u548c\u79bb\u7ebf\u8f6c\u6362\u4e24\u79cd\u5f62\u5f0f\u3002\u5728\u7ebf\u8f6c\u6362\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7d Huggingface \u6a21\u578b\uff0c\u79bb\u7ebf\u8f6c\u6362\u9700\u9700\u8981\u5148\u4fdd\u5b58\u6a21\u578b\u518d\u52a0\u8f7d\u3002 \u5728\u7ebf\u8f6c\u6362 \u00b6 lmdeploy \u652f\u6301\u76f4\u63a5\u8bfb\u53d6 Huggingface \u6a21\u578b\u6743\u91cd\uff0c\u76ee\u524d\u5171\u652f\u6301\u4e09\u79cd\u7c7b\u578b\uff1a \u5728 huggingface.co \u4e0a\u9762\u901a\u8fc7 lmdeploy \u91cf\u5316\u7684\u6a21\u578b\uff0c\u5982 llama2-70b-4bit, internlm-chat-20b-4bit huggingface.co \u4e0a\u9762\u5176\u4ed6 LM \u6a21\u578b\uff0c\u5982 Qwen/Qwen-7B-Chat \u5728\u7ebf\u8f6c\u6362 \u52a0\u8f7d Huggingface \u6a21\u578b # \u9700\u8981\u80fd\u8bbf\u95ee Huggingface \u7684\u7f51\u7edc\u73af\u5883 lmdeploy chat turbomind internlm/internlm-chat-20b-4bit --model-name internlm-chat-20b lmdeploy chat turbomind Qwen/Qwen-7B-Chat --model-name qwen-7b \u76f4\u63a5\u542f\u52a8\u672c\u5730\u7684 Huggingface \u6a21\u578b lmdeploy chat turbomind /share/temp/model_repos/internlm-chat-7b/ --model-name internlm-chat-7b \u79bb\u7ebf\u8f6c\u6362 \u00b6 \u79bb\u7ebf\u8f6c\u6362\u9700\u8981\u5728\u542f\u52a8\u670d\u52a1\u4e4b\u524d\uff0c\u5c06\u6a21\u578b\u8f6c\u4e3a lmdeploy TurboMind \u7684\u683c\u5f0f\uff0c\u6267\u884c\u5b8c\u6210\u540e\u5c06\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u751f\u6210\u4e00\u4e2a workspace \u7684\u6587\u4ef6\u5939\u3002\u8fd9\u91cc\u9762\u5305\u542b\u7684\u5c31\u662f TurboMind \u548c Triton \u201c\u6a21\u578b\u63a8\u7406\u201d\u9700\u8981\u5230\u7684\u6587\u4ef6\u3002 lmdeploy convert internlm-chat-7b /path/to/internlm-chat-7b TurboMind \u63a8\u7406+\u547d\u4ee4\u884c\u672c\u5730\u5bf9\u8bdd \u00b6 \u6a21\u578b\u8f6c\u6362\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u5177\u5907\u4e86\u4f7f\u7528\u6a21\u578b\u63a8\u7406\u7684\u6761\u4ef6\uff0c\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8fdb\u884c\u771f\u6b63\u7684\u6a21\u578b\u63a8\u7406\u73af\u8282\u3002 lmdeploy chat turbomind ./workspace TurboMind \u63a8\u7406+API\u670d\u52a1 \u00b6 \u4e0a\u9762\u76f4\u63a5\u7528\u547d\u4ee4\u884c\u542f\u52a8 Client\uff0c\u63a5\u4e0b\u6765\u8fd0\u7528 lmdepoy \u8fdb\u884c\u670d\u52a1\u5316\u3002 # ApiServer+Turbomind api_server => AsyncEngine => TurboMind lmdeploy serve api_server ./workspace \\ --server_name 0 .0.0.0 \\ --server_port 23333 \\ --instance_num 64 \\ --tp 1 \u65b0\u5f00\u4e00\u4e2a\u7a97\u53e3\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6216\u76f4\u63a5\u6253\u5f00 http://{host}:23333 # ChatApiClient+ApiServer\uff08\u6ce8\u610f\u662fhttp\u534f\u8bae\uff0c\u9700\u8981\u52a0http\uff09 lmdeploy serve api_client http://localhost:23333 Web Demo \u5bf9\u8bdd \u00b6 TurboMind \u670d\u52a1\u4f5c\u4e3a\u540e\u7aef \u00b6 \u542f\u52a8\u4f5c\u4e3a\u524d\u7aef\u7684 Gradio # Gradio+ApiServer\u3002\u5fc5\u987b\u5148\u5f00\u542f Server\uff0c\u6b64\u65f6 Gradio \u4e3a Client lmdeploy serve gradio http://0.0.0.0:23333 \\ --server_name 0 .0.0.0 \\ --server_port 6006 \\ --restful_api True TurboMind \u63a8\u7406\u4f5c\u4e3a\u540e\u7aef \u00b6 # Gradio+Turbomind(local) lmdeploy serve gradio ./workspace TurboMind \u63a8\u7406+Python \u4ee3\u7801\u96c6\u6210 \u00b6 from lmdeploy import turbomind as tm # load model model_path = \"/root/share/temp/model_repos/internlm-chat-7b/\" tm_model = tm . TurboMind . from_pretrained ( model_path , model_name = 'internlm-chat-20b' ) generator = tm_model . create_instance () # process query query = \"\u4f60\u597d\u554a\u5144\u561a\" prompt = tm_model . model . get_prompt ( query ) input_ids = tm_model . tokenizer . encode ( prompt ) # inference for outputs in generator . stream_infer ( session_id = 0 , input_ids = [ input_ids ]): res , tokens = outputs [ 0 ] response = tm_model . tokenizer . decode ( res . tolist ()) print ( response ) \u6a21\u578b\u91cf\u5316 \u00b6 \u91cf\u5316\u662f\u4e00\u79cd\u4ee5\u53c2\u6570\u6216\u8ba1\u7b97\u4e2d\u95f4\u7ed3\u679c\u7cbe\u5ea6\u4e0b\u964d\u6362\u7a7a\u95f4\u8282\u7701\uff08\u4ee5\u53ca\u540c\u65f6\u5e26\u6765\u7684\u6027\u80fd\u63d0\u5347\uff09\u7684\u7b56\u7565\u3002 KV Cache \u91cf\u5316 \u00b6 \u8ba1\u7b97 minmax\u3002\u901a\u8fc7\u8ba1\u7b97\u7ed9\u5b9a\u8f93\u5165\u6837\u672c\u5728\u6bcf\u4e00\u5c42\u4e0d\u540c\u4f4d\u7f6e\u8ba1\u7b97\u7ed3\u679c\u7684\u7edf\u8ba1\u60c5\u51b5\u3002 # \u8ba1\u7b97 minmax lmdeploy lite calibrate \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --calib_dataset \"c4\" \\ --calib_samples 128 \\ --calib_seqlen 2048 \\ --work_dir ./quant_output \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570\u3002\u83b7\u53d6\u6bcf\u4e00\u5c42\u7684 KV \u4e2d\u5fc3\u503c\uff08zp\uff09\u548c\u7f29\u653e\u503c\uff08scale\uff09\u3002 # \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570 lmdeploy lite kv_qparams \\ --work_dir ./quant_output \\ --turbomind_dir workspace/triton_models/weights/ \\ --kv_sym False \\ --num_tp 1 \u4fee\u6539\u914d\u7f6e\u3002\u4fee\u6539 weights/config.ini \u6587\u4ef6\u3002 W4A16 \u91cf\u5316 \u00b6 W4A16 \u4e2d\u7684 A \u6307 Activation\uff0c\u4fdd\u6301 FP16\uff0c\u53ea\u5bf9\u53c2\u6570\u8fdb\u884c 4bits \u91cf\u5316\u3002 \u540c KV Cache \u91cf\u5316\uff0c\u8ba1\u7b97 minmax\u3002 \u91cf\u5316\u6743\u91cd\u53c2\u6570\u3002\u5229\u7528\u7b2c\u4e00\u6b65\u5f97\u5230\u7684\u7edf\u8ba1\u503c\u5bf9\u53c2\u6570\u8fdb\u884c\u91cf\u5316\u3002 \u7f29\u653e\u53c2\u6570 \u6574\u4f53\u91cf\u5316 # \u91cf\u5316\u6743\u91cd\u6a21\u578b lmdeploy lite auto_awq \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --w_bits 4 \\ --w_group_size 128 \\ --work_dir ./quant_output \u8f6c\u6362\u6210 TurboMind \u683c\u5f0f\u3002 # \u8f6c\u6362\u6a21\u578b\u7684layout\uff0c\u5b58\u653e\u5728\u9ed8\u8ba4\u8def\u5f84 ./workspace \u4e0b lmdeploy convert internlm-chat-7b ./quant_output \\ --model-format awq \\ --group-size 128 \u4f5c\u4e1a \u00b6 \u4f7f\u7528 LMDeploy \u4ee5\u672c\u5730\u5bf9\u8bdd\u3001\u7f51\u9875Gradio\u3001API\u670d\u52a1\u4e2d\u7684\u4e00\u79cd\u65b9\u5f0f\u90e8\u7f72 InternLM-Chat-7B \u6a21\u578b\uff0c\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09 \u672c\u5730\u5bf9\u8bdd Web Gradio API \u670d\u52a1","title":"\u7b2c\u4e94\u8282"},{"location":"llm/internlm/lec5/#lmdeploy","text":"\u7ea6 1186 \u4e2a\u5b57 66 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u5b66\u4e60\u81ea LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5","title":"LMDeploy \u5927\u6a21\u578b\u91cf\u5316\u90e8\u7f72\u5b9e\u8df5"},{"location":"llm/internlm/lec5/#_1","text":"","title":"\u5927\u6a21\u578b\u90e8\u7f72\u80cc\u666f"},{"location":"llm/internlm/lec5/#_2","text":"\u5b9a\u4e49 \u5c06\u8bad\u7ec3\u597d\u7684\u6a21\u578b\u5728\u7279\u5b9a\u8f6f\u786c\u4ef6\u73af\u5883\u4e2d\u542f\u52a8\u7684\u8fc7\u7a0b\uff0c\u4f7f\u6a21\u578b\u80fd\u591f\u63a5\u53d7\u8f93\u5165\u5e76\u8fd4\u56de\u9884\u6d4b\u7ed3\u679c \u4e3a\u4e86\u6ee1\u8db3\u6027\u80fd\u548c\u6548\u7387\u7684\u9700\u6c42\uff0c\u5e38\u5e38\u9700\u8981\u5bf9\u6a21\u578b\u8fdb\u884c\u4f18\u5316\uff0c\u4f8b\u5982\u6a21\u578b\u538b\u7f29\u548c\u786c\u4ef6\u52a0\u901f \u4ea7\u54c1\u5f62\u6001 \u4e91\u7aef\u3001\u8fb9\u7f18\u8ba1\u7b97\u7aef\u3001\u79fb\u52a8\u7aef \u8ba1\u7b97\u8bbe\u5907 CPU\u3001GPU\u3001TPU\u3001NPU \u7b49","title":"\u6a21\u578b\u90e8\u7f72"},{"location":"llm/internlm/lec5/#_3","text":"\u5185\u5b58\u5f00\u9500\u5de8\u5927 \u5e9e\u5927\u53c2\u6570\u91cf\uff0c7B \u6a21\u578b\u4ec5\u6743\u91cd\u5c31\u9700\u8981 14+G \u5185\u5b58 \u91c7\u7528\u81ea\u56de\u5f52\u751f\u6210 token\uff0c\u9700\u8981\u7f13\u5b58 Attention \u7684 k/v\uff0c\u5e26\u6765\u5de8\u5927\u7684\u5185\u5b58\u5f00\u9500 \u52a8\u6001 shape \u8bf7\u6c42\u6570\u4e0d\u56fa\u5b9a Token \u9010\u4e2a\u751f\u6210\uff0c\u4e14\u6570\u91cf\u4e0d\u5b9a \u76f8\u5bf9\u89c6\u89c9\u6a21\u578b\uff0cLLM \u7ed3\u6784\u7b80\u5355 Transformers \u7ed3\u6784\uff0c\u5927\u90e8\u5206\u662f decoder-only","title":"\u5927\u6a21\u578b\u7279\u70b9"},{"location":"llm/internlm/lec5/#_4","text":"\u8bbe\u5907 \u5982\u4f55\u5e94\u5bf9\u5de8\u5927\u7684\u5b58\u50a8\u95ee\u9898\uff1f\u4f4e\u5b58\u50a8\u8bbe\u5907\uff08\u6d88\u8d39\u7ea7\u663e\u5361\u3001\u624b\u673a\u7b49\uff09\u5982\u4f55\u90e8\u7f72\uff1f \u63a8\u7406 \u5982\u4f55\u52a0\u901f token \u7684\u751f\u6210\u901f\u5ea6 \u5982\u4f55\u89e3\u51b3\u52a8\u6001 shape\uff0c\u8ba9\u63a8\u7406\u53ef\u4ee5\u4e0d\u95f4\u65ad \u5982\u4f55\u6709\u6548\u76d1\u7763\u548c\u5229\u7528\u5185\u5b58 \u670d\u52a1 \u5982\u4f55\u63d0\u5347\u7cfb\u7edf\u6574\u4f53\u541e\u5410\u91cf\uff1f \u5bf9\u4e8e\u4e2a\u4f53\u7528\u6237\uff0c\u5982\u4f55\u964d\u4f4e\u54cd\u5e94\u65f6\u95f4\uff1f","title":"\u5927\u6a21\u578b\u90e8\u7f72\u6311\u6218"},{"location":"llm/internlm/lec5/#_5","text":"\u6280\u672f\u70b9 \u6a21\u578b\u5e76\u884c \u4f4e\u6bd4\u7279\u91cf\u5316 Page Attention transformer \u8ba1\u7b97\u548c\u8bbf\u5b58\u4f18\u5316 Continuous Batch ... \u65b9\u6848 huggingface Transformers \u4e13\u95e8\u7684\u63a8\u7406\u52a0\u901f\u6846\u67b6 \u4e91\u7aef lmdeploy vllm tensorrt-llm deepspeed \u79fb\u52a8\u7aef llama.cpp mlc-llm ...","title":"\u5927\u6a21\u578b\u90e8\u7f72\u65b9\u6848"},{"location":"llm/internlm/lec5/#lmdeploy_1","text":"LMDeploy \u662f LLM \u5728 Nvidia \u8bbe\u5907\u4e0a\u90e8\u7f72\u7684\u5168\u6d41\u7a0b\u89e3\u51b3\u65b9\u6848\uff0c\u5305\u62ec\u6a21\u578b\u8f7b\u91cf\u5316\u3001\u63a8\u7406\u3001\u670d\u52a1\u3002","title":"LMDeploy \u7b80\u4ecb"},{"location":"llm/internlm/lec5/#_6","text":"","title":"\u6838\u5fc3\u529f\u80fd"},{"location":"llm/internlm/lec5/#_7","text":"\u4e3a\u4ec0\u4e48 Weight Only \u91cf\u5316\uff1f 4bit Weight Only \u91cf\u5316\uff0c\u5c06 FP16 \u7684\u6a21\u578b\u6743\u91cd\u91cf\u5316\u4e3a INT4\uff0c\u8bbf\u5b58\u91cf\u76f4\u63a5\u964d\u4e3a FP16 \u7684\u6a21\u578b 1/4\uff0c\u5927\u5e45\u964d\u4f4e\u4e86\u8bbf\u5b58\u6210\u672c\uff0c\u63d0\u9ad8 Decoding \u7684\u901f\u5ea6\u3002 \u52a0\u901f\u7684\u540c\u65f6\u8fd8\u8282\u7701\u663e\u5b58\uff0c\u540c\u6837\u7684\u8bbe\u5907\u80fd\u591f\u652f\u6301\u66f4\u5927\u7684\u6a21\u578b\u4ee5\u53ca\u66f4\u957f\u7684\u5bf9\u8bdd\u957f\u5ea6\u3002 \u5982\u4f55\u505a Weight Only \u91cf\u5316\uff1f LMDeploy \u4f7f\u7528 MIT HAN LAB \u5f00\u6e90\u7684 AWQ \u7b97\u6cd5\uff0c\u91cf\u5316\u4e3a 4bit \u6a21\u578b \u63a8\u7406\u65f6\uff0c\u5148\u628a 4bit \u6743\u91cd\uff0c \u53cd\u91cf\u5316\u56deFP16 \uff08\u5728 Kernel \u5185\u90e8\u8fdb\u884c\uff0c\u4ece Global Memory \u8bfb\u53d6\u65f6\u4ecd\u662f 4bit\uff09\uff0c\u4f9d\u65e7\u4f7f\u7528\u7684\u662f FP16 \u8ba1\u7b97 \u60f3\u8f83\u4e8e\u793e\u533a\u4f7f\u7528\u6700\u591a\u7684 GPTQ \u7b97\u6cd5\uff0cAWQ \u7684\u63a8\u7406\u901f\u5ea6\u66f4\u5feb\uff0c\u91cf\u5316\u65f6\u95f4\u66f4\u77ed","title":"\u91cf\u5316"},{"location":"llm/internlm/lec5/#turbomind","text":"\u6301\u7eed\u6279\u5904\u7406 \u6709\u72b6\u6001\u7684\u63a8\u7406 \u9ad8\u6027\u80fd cuda Kernel Blocked k/v cache","title":"\u63a8\u7406\u5f15\u64ce TurboMind"},{"location":"llm/internlm/lec5/#api-server","text":"lmdeploy serve api_server InternLM/internlm-chat-7b \\ --model-name internlm-chat-7b --server-port 8080","title":"\u63a8\u7406\u670d\u52a1 api server"},{"location":"llm/internlm/lec5/#_8","text":"","title":"\u670d\u52a1\u90e8\u7f72"},{"location":"llm/internlm/lec5/#_9","text":"\u4f7f\u7528 TurboMind \u63a8\u7406\u6a21\u578b\u9700\u8981\u5148\u5c06\u6a21\u578b\u8f6c\u5316\u4e3a TurboMind \u7684\u683c\u5f0f\uff0c\u76ee\u524d\u652f\u6301\u5728\u7ebf\u8f6c\u6362\u548c\u79bb\u7ebf\u8f6c\u6362\u4e24\u79cd\u5f62\u5f0f\u3002\u5728\u7ebf\u8f6c\u6362\u53ef\u4ee5\u76f4\u63a5\u52a0\u8f7d Huggingface \u6a21\u578b\uff0c\u79bb\u7ebf\u8f6c\u6362\u9700\u9700\u8981\u5148\u4fdd\u5b58\u6a21\u578b\u518d\u52a0\u8f7d\u3002","title":"\u6a21\u578b\u8f6c\u6362"},{"location":"llm/internlm/lec5/#_10","text":"lmdeploy \u652f\u6301\u76f4\u63a5\u8bfb\u53d6 Huggingface \u6a21\u578b\u6743\u91cd\uff0c\u76ee\u524d\u5171\u652f\u6301\u4e09\u79cd\u7c7b\u578b\uff1a \u5728 huggingface.co \u4e0a\u9762\u901a\u8fc7 lmdeploy \u91cf\u5316\u7684\u6a21\u578b\uff0c\u5982 llama2-70b-4bit, internlm-chat-20b-4bit huggingface.co \u4e0a\u9762\u5176\u4ed6 LM \u6a21\u578b\uff0c\u5982 Qwen/Qwen-7B-Chat \u5728\u7ebf\u8f6c\u6362 \u52a0\u8f7d Huggingface \u6a21\u578b # \u9700\u8981\u80fd\u8bbf\u95ee Huggingface \u7684\u7f51\u7edc\u73af\u5883 lmdeploy chat turbomind internlm/internlm-chat-20b-4bit --model-name internlm-chat-20b lmdeploy chat turbomind Qwen/Qwen-7B-Chat --model-name qwen-7b \u76f4\u63a5\u542f\u52a8\u672c\u5730\u7684 Huggingface \u6a21\u578b lmdeploy chat turbomind /share/temp/model_repos/internlm-chat-7b/ --model-name internlm-chat-7b","title":"\u5728\u7ebf\u8f6c\u6362"},{"location":"llm/internlm/lec5/#_11","text":"\u79bb\u7ebf\u8f6c\u6362\u9700\u8981\u5728\u542f\u52a8\u670d\u52a1\u4e4b\u524d\uff0c\u5c06\u6a21\u578b\u8f6c\u4e3a lmdeploy TurboMind \u7684\u683c\u5f0f\uff0c\u6267\u884c\u5b8c\u6210\u540e\u5c06\u4f1a\u5728\u5f53\u524d\u76ee\u5f55\u751f\u6210\u4e00\u4e2a workspace \u7684\u6587\u4ef6\u5939\u3002\u8fd9\u91cc\u9762\u5305\u542b\u7684\u5c31\u662f TurboMind \u548c Triton \u201c\u6a21\u578b\u63a8\u7406\u201d\u9700\u8981\u5230\u7684\u6587\u4ef6\u3002 lmdeploy convert internlm-chat-7b /path/to/internlm-chat-7b","title":"\u79bb\u7ebf\u8f6c\u6362"},{"location":"llm/internlm/lec5/#turbomind_1","text":"\u6a21\u578b\u8f6c\u6362\u5b8c\u6210\u540e\uff0c\u6211\u4eec\u5c31\u5177\u5907\u4e86\u4f7f\u7528\u6a21\u578b\u63a8\u7406\u7684\u6761\u4ef6\uff0c\u63a5\u4e0b\u6765\u5c31\u53ef\u4ee5\u8fdb\u884c\u771f\u6b63\u7684\u6a21\u578b\u63a8\u7406\u73af\u8282\u3002 lmdeploy chat turbomind ./workspace","title":"TurboMind \u63a8\u7406+\u547d\u4ee4\u884c\u672c\u5730\u5bf9\u8bdd"},{"location":"llm/internlm/lec5/#turbomind-api","text":"\u4e0a\u9762\u76f4\u63a5\u7528\u547d\u4ee4\u884c\u542f\u52a8 Client\uff0c\u63a5\u4e0b\u6765\u8fd0\u7528 lmdepoy \u8fdb\u884c\u670d\u52a1\u5316\u3002 # ApiServer+Turbomind api_server => AsyncEngine => TurboMind lmdeploy serve api_server ./workspace \\ --server_name 0 .0.0.0 \\ --server_port 23333 \\ --instance_num 64 \\ --tp 1 \u65b0\u5f00\u4e00\u4e2a\u7a97\u53e3\uff0c\u6267\u884c\u4e0b\u9762\u7684\u547d\u4ee4\u6216\u76f4\u63a5\u6253\u5f00 http://{host}:23333 # ChatApiClient+ApiServer\uff08\u6ce8\u610f\u662fhttp\u534f\u8bae\uff0c\u9700\u8981\u52a0http\uff09 lmdeploy serve api_client http://localhost:23333","title":"TurboMind \u63a8\u7406+API\u670d\u52a1"},{"location":"llm/internlm/lec5/#web-demo","text":"","title":"Web Demo \u5bf9\u8bdd"},{"location":"llm/internlm/lec5/#turbomind_2","text":"\u542f\u52a8\u4f5c\u4e3a\u524d\u7aef\u7684 Gradio # Gradio+ApiServer\u3002\u5fc5\u987b\u5148\u5f00\u542f Server\uff0c\u6b64\u65f6 Gradio \u4e3a Client lmdeploy serve gradio http://0.0.0.0:23333 \\ --server_name 0 .0.0.0 \\ --server_port 6006 \\ --restful_api True","title":"TurboMind \u670d\u52a1\u4f5c\u4e3a\u540e\u7aef"},{"location":"llm/internlm/lec5/#turbomind_3","text":"# Gradio+Turbomind(local) lmdeploy serve gradio ./workspace","title":"TurboMind \u63a8\u7406\u4f5c\u4e3a\u540e\u7aef"},{"location":"llm/internlm/lec5/#turbomind-python","text":"from lmdeploy import turbomind as tm # load model model_path = \"/root/share/temp/model_repos/internlm-chat-7b/\" tm_model = tm . TurboMind . from_pretrained ( model_path , model_name = 'internlm-chat-20b' ) generator = tm_model . create_instance () # process query query = \"\u4f60\u597d\u554a\u5144\u561a\" prompt = tm_model . model . get_prompt ( query ) input_ids = tm_model . tokenizer . encode ( prompt ) # inference for outputs in generator . stream_infer ( session_id = 0 , input_ids = [ input_ids ]): res , tokens = outputs [ 0 ] response = tm_model . tokenizer . decode ( res . tolist ()) print ( response )","title":"TurboMind \u63a8\u7406+Python \u4ee3\u7801\u96c6\u6210"},{"location":"llm/internlm/lec5/#_12","text":"\u91cf\u5316\u662f\u4e00\u79cd\u4ee5\u53c2\u6570\u6216\u8ba1\u7b97\u4e2d\u95f4\u7ed3\u679c\u7cbe\u5ea6\u4e0b\u964d\u6362\u7a7a\u95f4\u8282\u7701\uff08\u4ee5\u53ca\u540c\u65f6\u5e26\u6765\u7684\u6027\u80fd\u63d0\u5347\uff09\u7684\u7b56\u7565\u3002","title":"\u6a21\u578b\u91cf\u5316"},{"location":"llm/internlm/lec5/#kv-cache","text":"\u8ba1\u7b97 minmax\u3002\u901a\u8fc7\u8ba1\u7b97\u7ed9\u5b9a\u8f93\u5165\u6837\u672c\u5728\u6bcf\u4e00\u5c42\u4e0d\u540c\u4f4d\u7f6e\u8ba1\u7b97\u7ed3\u679c\u7684\u7edf\u8ba1\u60c5\u51b5\u3002 # \u8ba1\u7b97 minmax lmdeploy lite calibrate \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --calib_dataset \"c4\" \\ --calib_samples 128 \\ --calib_seqlen 2048 \\ --work_dir ./quant_output \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570\u3002\u83b7\u53d6\u6bcf\u4e00\u5c42\u7684 KV \u4e2d\u5fc3\u503c\uff08zp\uff09\u548c\u7f29\u653e\u503c\uff08scale\uff09\u3002 # \u901a\u8fc7 minmax \u83b7\u53d6\u91cf\u5316\u53c2\u6570 lmdeploy lite kv_qparams \\ --work_dir ./quant_output \\ --turbomind_dir workspace/triton_models/weights/ \\ --kv_sym False \\ --num_tp 1 \u4fee\u6539\u914d\u7f6e\u3002\u4fee\u6539 weights/config.ini \u6587\u4ef6\u3002","title":"KV Cache \u91cf\u5316"},{"location":"llm/internlm/lec5/#w4a16","text":"W4A16 \u4e2d\u7684 A \u6307 Activation\uff0c\u4fdd\u6301 FP16\uff0c\u53ea\u5bf9\u53c2\u6570\u8fdb\u884c 4bits \u91cf\u5316\u3002 \u540c KV Cache \u91cf\u5316\uff0c\u8ba1\u7b97 minmax\u3002 \u91cf\u5316\u6743\u91cd\u53c2\u6570\u3002\u5229\u7528\u7b2c\u4e00\u6b65\u5f97\u5230\u7684\u7edf\u8ba1\u503c\u5bf9\u53c2\u6570\u8fdb\u884c\u91cf\u5316\u3002 \u7f29\u653e\u53c2\u6570 \u6574\u4f53\u91cf\u5316 # \u91cf\u5316\u6743\u91cd\u6a21\u578b lmdeploy lite auto_awq \\ --model /root/share/temp/model_repos/internlm-chat-7b/ \\ --w_bits 4 \\ --w_group_size 128 \\ --work_dir ./quant_output \u8f6c\u6362\u6210 TurboMind \u683c\u5f0f\u3002 # \u8f6c\u6362\u6a21\u578b\u7684layout\uff0c\u5b58\u653e\u5728\u9ed8\u8ba4\u8def\u5f84 ./workspace \u4e0b lmdeploy convert internlm-chat-7b ./quant_output \\ --model-format awq \\ --group-size 128","title":"W4A16 \u91cf\u5316"},{"location":"llm/internlm/lec5/#_13","text":"\u4f7f\u7528 LMDeploy \u4ee5\u672c\u5730\u5bf9\u8bdd\u3001\u7f51\u9875Gradio\u3001API\u670d\u52a1\u4e2d\u7684\u4e00\u79cd\u65b9\u5f0f\u90e8\u7f72 InternLM-Chat-7B \u6a21\u578b\uff0c\u751f\u6210 300 \u5b57\u7684\u5c0f\u6545\u4e8b\uff08\u9700\u622a\u56fe\uff09 \u672c\u5730\u5bf9\u8bdd Web Gradio API \u670d\u52a1","title":"\u4f5c\u4e1a"},{"location":"llm/internlm/lec6/","text":"OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b \u00b6 \u7ea6 418 \u4e2a\u5b57 14 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5b66\u4e60\u81ea OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b OpenCompass \u4ecb\u7ecd \u00b6 \u5728 OpenCompass \u4e2d\u8bc4\u4f30\u4e00\u4e2a\u6a21\u578b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u9636\u6bb5\uff1a \u914d\u7f6e -> \u63a8\u7406 -> \u8bc4\u4f30 -> \u53ef\u89c6\u5316 \u3002 \u914d\u7f6e \uff1a\u8fd9\u662f\u6574\u4e2a\u5de5\u4f5c\u6d41\u7684\u8d77\u70b9\u3002\u60a8\u9700\u8981\u914d\u7f6e\u6574\u4e2a\u8bc4\u4f30\u8fc7\u7a0b\uff0c\u9009\u62e9\u8981\u8bc4\u4f30\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u8bc4\u4f30\u7b56\u7565\u3001\u8ba1\u7b97\u540e\u7aef\u7b49\uff0c\u5e76\u5b9a\u4e49\u663e\u793a\u7ed3\u679c\u7684\u65b9\u5f0f\u3002 \u63a8\u7406\u4e0e\u8bc4\u4f30 \uff1a\u5728\u8fd9\u4e2a\u9636\u6bb5\uff0cOpenCompass \u5c06\u4f1a\u5f00\u59cb\u5bf9\u6a21\u578b\u548c\u6570\u636e\u96c6\u8fdb\u884c\u5e76\u884c\u63a8\u7406\u548c\u8bc4\u4f30\u3002\u63a8\u7406\u9636\u6bb5\u4e3b\u8981\u662f\u8ba9\u6a21\u578b\u4ece\u6570\u636e\u96c6\u4ea7\u751f\u8f93\u51fa\uff0c\u800c\u8bc4\u4f30\u9636\u6bb5\u5219\u662f\u8861\u91cf\u8fd9\u4e9b\u8f93\u51fa\u4e0e\u6807\u51c6\u7b54\u6848\u7684\u5339\u914d\u7a0b\u5ea6\u3002\u8fd9\u4e24\u4e2a\u8fc7\u7a0b\u4f1a\u88ab\u62c6\u5206\u4e3a\u591a\u4e2a\u540c\u65f6\u8fd0\u884c\u7684\u201c\u4efb\u52a1\u201d\u4ee5\u63d0\u9ad8\u6548\u7387\uff0c\u4f46\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u8ba1\u7b97\u8d44\u6e90\u6709\u9650\uff0c\u8fd9\u79cd\u7b56\u7565\u53ef\u80fd\u4f1a\u4f7f\u8bc4\u6d4b\u53d8\u5f97\u66f4\u6162\u3002 \u53ef\u89c6\u5316 \uff1a\u8bc4\u4f30\u5b8c\u6210\u540e\uff0cOpenCompass \u5c06\u7ed3\u679c\u6574\u7406\u6210\u6613\u8bfb\u7684\u8868\u683c\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a CSV \u548c TXT \u6587\u4ef6\u3002\u4f60\u4e5f\u53ef\u4ee5\u6fc0\u6d3b\u98de\u4e66\u72b6\u6001\u4e0a\u62a5\u529f\u80fd\uff0c\u6b64\u540e\u53ef\u4ee5\u5728\u98de\u4e66\u5ba2\u6237\u7aef\u4e2d\u53ca\u65f6\u83b7\u5f97\u8bc4\u6d4b\u72b6\u6001\u62a5\u544a\u3002 \u5b89\u88c5 & \u4f7f\u7528 \u00b6 \u9762\u5411GPU\u7684\u73af\u5883\u5b89\u88c5 \u00b6 conda create --name opencompass --clone = /root/share/conda_envs/internlm-base source activate opencompass git clone https://github.com/open-compass/opencompass cd opencompass pip install -e . \u6570\u636e\u51c6\u5907 \u00b6 \u5c06\u6570\u636e\u96c6\u653e\u5230 data \u76ee\u5f55\u4e0b\uff0c\u4f8b\u5982\uff1a cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/ unzip OpenCompassData-core-20231110.zip \u67e5\u770b\u652f\u6301\u7684\u6570\u636e\u96c6\u548c\u6a21\u578b \u00b6 # \u5217\u51fa\u6240\u6709\u8ddf internlm \u53ca ceval \u76f8\u5173\u7684\u914d\u7f6e python tools/list_configs.py internlm ceval \u542f\u52a8\u8bc4\u6d4b \u00b6 \u901a\u8fc7 --debug \u6a21\u5f0f\u542f\u52a8\u8bc4\u4f30\uff0c\u4efb\u52a1\u5c06\u6309\u987a\u5e8f\u6267\u884c\uff0c\u5e76\u5b9e\u65f6\u6253\u5370\u8f93\u51fa\u3002 python run.py --datasets ceval_gen --hf-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-kwargs padding_side = 'left' truncation = 'left' trust_remote_code = True --model-kwargs trust_remote_code = True device_map = 'auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug \u53ef\u89c6\u5316\u8bc4\u4f30\u7ed3\u679c \u00b6 \u8bc4\u4f30\u5b8c\u6210\u540e\uff0c\u8bc4\u4f30\u7ed3\u679c\u8868\u683c\u5c06\u6253\u5370\u5982\u4e0b\uff1a dataset version metric mode opt350m opt125m --------- --------- -------- ------ --------- --------- siqa e78df3 accuracy gen 21.55 12.44 winograd b6c7ed accuracy ppl 51.23 49.82 \u6240\u6709\u8fd0\u884c\u8f93\u51fa\u5c06\u5b9a\u5411\u5230 outputs/demo/ \u76ee\u5f55 \u4f5c\u4e1a \u00b6 \u4f7f\u7528 OpenCompass \u8bc4\u6d4b InternLM2-Chat-7B \u6a21\u578b\u5728 C-Eval \u6570\u636e\u96c6\u4e0a\u7684\u6027\u80fd","title":"\u7b2c\u516d\u8282"},{"location":"llm/internlm/lec6/#opencompass","text":"\u7ea6 418 \u4e2a\u5b57 14 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5b66\u4e60\u81ea OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b","title":"OpenCompass \u5927\u6a21\u578b\u8bc4\u6d4b"},{"location":"llm/internlm/lec6/#opencompass_1","text":"\u5728 OpenCompass \u4e2d\u8bc4\u4f30\u4e00\u4e2a\u6a21\u578b\u901a\u5e38\u5305\u62ec\u4ee5\u4e0b\u51e0\u4e2a\u9636\u6bb5\uff1a \u914d\u7f6e -> \u63a8\u7406 -> \u8bc4\u4f30 -> \u53ef\u89c6\u5316 \u3002 \u914d\u7f6e \uff1a\u8fd9\u662f\u6574\u4e2a\u5de5\u4f5c\u6d41\u7684\u8d77\u70b9\u3002\u60a8\u9700\u8981\u914d\u7f6e\u6574\u4e2a\u8bc4\u4f30\u8fc7\u7a0b\uff0c\u9009\u62e9\u8981\u8bc4\u4f30\u7684\u6a21\u578b\u548c\u6570\u636e\u96c6\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u8bc4\u4f30\u7b56\u7565\u3001\u8ba1\u7b97\u540e\u7aef\u7b49\uff0c\u5e76\u5b9a\u4e49\u663e\u793a\u7ed3\u679c\u7684\u65b9\u5f0f\u3002 \u63a8\u7406\u4e0e\u8bc4\u4f30 \uff1a\u5728\u8fd9\u4e2a\u9636\u6bb5\uff0cOpenCompass \u5c06\u4f1a\u5f00\u59cb\u5bf9\u6a21\u578b\u548c\u6570\u636e\u96c6\u8fdb\u884c\u5e76\u884c\u63a8\u7406\u548c\u8bc4\u4f30\u3002\u63a8\u7406\u9636\u6bb5\u4e3b\u8981\u662f\u8ba9\u6a21\u578b\u4ece\u6570\u636e\u96c6\u4ea7\u751f\u8f93\u51fa\uff0c\u800c\u8bc4\u4f30\u9636\u6bb5\u5219\u662f\u8861\u91cf\u8fd9\u4e9b\u8f93\u51fa\u4e0e\u6807\u51c6\u7b54\u6848\u7684\u5339\u914d\u7a0b\u5ea6\u3002\u8fd9\u4e24\u4e2a\u8fc7\u7a0b\u4f1a\u88ab\u62c6\u5206\u4e3a\u591a\u4e2a\u540c\u65f6\u8fd0\u884c\u7684\u201c\u4efb\u52a1\u201d\u4ee5\u63d0\u9ad8\u6548\u7387\uff0c\u4f46\u8bf7\u6ce8\u610f\uff0c\u5982\u679c\u8ba1\u7b97\u8d44\u6e90\u6709\u9650\uff0c\u8fd9\u79cd\u7b56\u7565\u53ef\u80fd\u4f1a\u4f7f\u8bc4\u6d4b\u53d8\u5f97\u66f4\u6162\u3002 \u53ef\u89c6\u5316 \uff1a\u8bc4\u4f30\u5b8c\u6210\u540e\uff0cOpenCompass \u5c06\u7ed3\u679c\u6574\u7406\u6210\u6613\u8bfb\u7684\u8868\u683c\uff0c\u5e76\u5c06\u5176\u4fdd\u5b58\u4e3a CSV \u548c TXT \u6587\u4ef6\u3002\u4f60\u4e5f\u53ef\u4ee5\u6fc0\u6d3b\u98de\u4e66\u72b6\u6001\u4e0a\u62a5\u529f\u80fd\uff0c\u6b64\u540e\u53ef\u4ee5\u5728\u98de\u4e66\u5ba2\u6237\u7aef\u4e2d\u53ca\u65f6\u83b7\u5f97\u8bc4\u6d4b\u72b6\u6001\u62a5\u544a\u3002","title":"OpenCompass \u4ecb\u7ecd"},{"location":"llm/internlm/lec6/#_1","text":"","title":"\u5b89\u88c5 & \u4f7f\u7528"},{"location":"llm/internlm/lec6/#gpu","text":"conda create --name opencompass --clone = /root/share/conda_envs/internlm-base source activate opencompass git clone https://github.com/open-compass/opencompass cd opencompass pip install -e .","title":"\u9762\u5411GPU\u7684\u73af\u5883\u5b89\u88c5"},{"location":"llm/internlm/lec6/#_2","text":"\u5c06\u6570\u636e\u96c6\u653e\u5230 data \u76ee\u5f55\u4e0b\uff0c\u4f8b\u5982\uff1a cp /share/temp/datasets/OpenCompassData-core-20231110.zip /root/opencompass/ unzip OpenCompassData-core-20231110.zip","title":"\u6570\u636e\u51c6\u5907"},{"location":"llm/internlm/lec6/#_3","text":"# \u5217\u51fa\u6240\u6709\u8ddf internlm \u53ca ceval \u76f8\u5173\u7684\u914d\u7f6e python tools/list_configs.py internlm ceval","title":"\u67e5\u770b\u652f\u6301\u7684\u6570\u636e\u96c6\u548c\u6a21\u578b"},{"location":"llm/internlm/lec6/#_4","text":"\u901a\u8fc7 --debug \u6a21\u5f0f\u542f\u52a8\u8bc4\u4f30\uff0c\u4efb\u52a1\u5c06\u6309\u987a\u5e8f\u6267\u884c\uff0c\u5e76\u5b9e\u65f6\u6253\u5370\u8f93\u51fa\u3002 python run.py --datasets ceval_gen --hf-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-path /share/temp/model_repos/internlm-chat-7b/ --tokenizer-kwargs padding_side = 'left' truncation = 'left' trust_remote_code = True --model-kwargs trust_remote_code = True device_map = 'auto' --max-seq-len 2048 --max-out-len 16 --batch-size 4 --num-gpus 1 --debug","title":"\u542f\u52a8\u8bc4\u6d4b"},{"location":"llm/internlm/lec6/#_5","text":"\u8bc4\u4f30\u5b8c\u6210\u540e\uff0c\u8bc4\u4f30\u7ed3\u679c\u8868\u683c\u5c06\u6253\u5370\u5982\u4e0b\uff1a dataset version metric mode opt350m opt125m --------- --------- -------- ------ --------- --------- siqa e78df3 accuracy gen 21.55 12.44 winograd b6c7ed accuracy ppl 51.23 49.82 \u6240\u6709\u8fd0\u884c\u8f93\u51fa\u5c06\u5b9a\u5411\u5230 outputs/demo/ \u76ee\u5f55","title":"\u53ef\u89c6\u5316\u8bc4\u4f30\u7ed3\u679c"},{"location":"llm/internlm/lec6/#_6","text":"\u4f7f\u7528 OpenCompass \u8bc4\u6d4b InternLM2-Chat-7B \u6a21\u578b\u5728 C-Eval \u6570\u636e\u96c6\u4e0a\u7684\u6027\u80fd","title":"\u4f5c\u4e1a"},{"location":"llm/nlp/","text":"NLP \u00b6 Abstract \u8865\u5145\u4e00\u4e9b NLP \u7684\u57fa\u7840\u77e5\u8bc6\u3002 Table of Contents \u00b6 Word2Vec RNN","title":"NLP"},{"location":"llm/nlp/#nlp","text":"Abstract \u8865\u5145\u4e00\u4e9b NLP \u7684\u57fa\u7840\u77e5\u8bc6\u3002","title":"NLP"},{"location":"llm/nlp/#table-of-contents","text":"Word2Vec RNN","title":"Table of Contents"},{"location":"llm/nlp/rnns/","text":"RNNs \u00b6 \u7ea6 2807 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract NLP \u91cc\u6700\u5e38\u7528\u3001\u6700\u4f20\u7edf\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5c31\u662f \u5faa\u73af\u795e\u7ecf\u7f51\u7edc RNN\uff08Recurrent Neural Network\uff09 \u3002 RNN \u6709\u5f88\u591a\u53d8\u79cd\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5c31\u662f LSTM\uff08Long Short-Term Memory\uff09 \u548c GRU\uff08Gated Recurrent Unit\uff09 \u3002\u672c\u6587\u5c06\u4ecb\u7ecd RNN\u3001LSTM \u548c GRU \u7684\u539f\u7406\u3002 \u6982\u8ff0 \u00b6 \u5168\u8fde\u63a5\u795e\u7ecf\u7f51\u7edc DNN \u548c \u5377\u79ef\u795e\u7ecf\u7f51\u7edc CNN\uff0c\u5b83\u4eec\u7684\u524d\u4e00\u4e2a\u8f93\u5165\u548c\u540e\u4e00\u4e2a\u8f93\u5165\u662f\u6ca1\u6709\u5173\u7cfb\u7684\u3002\u5f53\u6211\u4eec\u5904\u7406 \u5e8f\u5217\u4fe1\u606f \u65f6\uff0c\u67d0\u4e9b\u524d\u9762\u7684\u8f93\u5165\u548c\u540e\u9762\u7684\u8f93\u5165\u662f\u6709\u5173\u7cfb\u7684\uff0c\u6bd4\u5982\uff1a\u5f53\u6211\u4eec\u5728\u7406\u89e3\u4e00\u53e5\u8bdd\u7684\u610f\u601d\u65f6\uff0c\u5b64\u7acb\u7684\u7406\u89e3\u8fd9\u53e5\u8bdd\u7684\u6bcf\u4e2a\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6211\u4eec\u9700\u8981\u5904\u7406\u8fd9\u4e9b\u8bcd\u8fde\u63a5\u8d77\u6765\u7684\u6574\u4e2a \u5e8f\u5217 \uff1b\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u9700\u8981\u4f7f\u7528\u5230 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08Recurrent Neural Network\uff09 \u3002 RNN\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u6700\u5148\u88ab\u4f7f\u7528\u8d77\u6765\uff0cRNN\u53ef\u4ee5\u4e3a\u8bed\u8a00\u6a21\u578b\u8fdb\u884c\u5efa\u6a21\uff1a \u6211\u6ca1\u6709\u5b8c\u6210\u4e0a\u7ea7\u5e03\u7f6e\u7ed9\u6211\u7684\u4efb\u52a1\uff0c\u6240\u4ee5 \u88ab\u5f00\u9664\u4e86 \u8ba9\u7535\u8111\u6765\u586b\u5199\u4e0b\u5212\u7ebf\u7684\u8bcd\u6700\u6709\u53ef\u80fd\u7684\u662f\u300e\u6211\u300f\uff0c\u800c\u4e0d\u592a\u53ef\u80fd\u662f\u300e\u5c0f\u660e\u300f\uff0c\u751a\u81f3\u662f\u300e\u5403\u996d\u300f\u3002 \u8bed\u8a00\u6a21\u578b\u5c31\u662f\u8fd9\u6837\u7684\u4e1c\u897f\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e00\u53e5\u8bdd\u524d\u9762\u7684\u90e8\u5206\uff0c\u9884\u6d4b\u63a5\u4e0b\u6765\u6700\u6709\u53ef\u80fd\u7684\u4e00\u4e2a\u8bcd\u662f\u4ec0\u4e48\u3002 \u57fa\u672c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc \u00b6 \u57fa\u672c\u7684 RNN\uff0c\u7ed3\u6784\u7531 \u8f93\u5165\u5c42\u3001\u4e00\u4e2a\u9690\u85cf\u5c42\u548c\u8f93\u51fa\u5c42 \u7ec4\u6210\u3002 x \u662f\u8f93\u5165\u5411\u91cf o \u662f\u8f93\u51fa\u5411\u91cf s \u8868\u793a\u9690\u85cf\u5c42\u7684\u503c U \u662f\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6743\u91cd\u77e9\u9635 V \u65f6\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u7684\u503c s \u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e\u5f53\u524d\u8fd9\u6b21\u7684\u8f93\u5165 x\uff0c\u8fd8\u53d6\u51b3\u4e8e\u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u7684\u503c s\u3002\u6743\u91cd\u77e9\u9635 W \u5c31\u662f\u9690\u85cf\u5c42\u4e0a\u4e00\u6b21\u7684\u503c\u4f5c\u4e3a\u8fd9\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u3002 \u5c06\u4e0a\u56fe\u7684\u57fa\u672c RNN \u7ed3\u6784\u5728\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff08RNN \u662f\u4e00\u4e2a\u94fe\u5f0f\u7ed3\u6784\uff0c\u6bcf\u4e2a\u65f6\u95f4\u7247\u4f7f\u7528\u7684\u90fd\u662f\u76f8\u540c\u7684\u53c2\u6570\uff09 \u8fd9\u4e2a\u7f51\u7edc\u5728 t \u65f6\u523b\u63a5\u6536\u5230\u8f93\u5165 \\(x_t\\) \u4e4b\u540e\uff0c\u9690\u85cf\u5c42\u7684\u503c\u662f \\(s_t\\) \uff0c\u8f93\u51fa\u5c42\u7684\u503c\u662f \\(o_t\\) \uff0c \u5173\u952e\u7684\u662f\uff0c \\(s_t\\) \u7684\u503c\u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e \\(x_t\\) \uff0c\u8fd8\u53d6\u51b3\u4e8e \\(s_{t-1}\\) \u3002 \\[ s_t=f(U * x_t + W * s_{t-1}) \\\\ o_t=g(V * s_t) \\] \u516c\u5f0f1 \u662f\u9690\u85cf\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0c\u5b83\u662f\u5faa\u73af\u5c42\u3002U \u662f\u8f93\u5165 x \u7684\u6743\u91cd\u77e9\u9635\uff0cW \u662f \u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u503c \\(s_{t-1}\\) \u4f5c\u4e3a\u5219\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u77e9\u9635\uff0cf \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u516c\u5f0f2 \u662f\u8f93\u51fa\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0cV \u662f\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635\uff0cg \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u9690\u85cf\u5c42\u6709\u4e24\u4e2a\u8f93\u5165\uff0c\u7b2c\u4e00\u662f U \u4e0e \\(x_t\\) \u5411\u91cf\u7684\u4e58\u79ef\uff0c\u7b2c\u4e8c\u662f\u4e0a\u4e00\u9690\u85cf\u5c42\u8f93\u51fa\u7684\u72b6\u6001 \\(s_{t-1}\\) \u4e0e W \u7684\u4e58\u79ef\u3002\u7b49\u4e8e\u4e0a\u4e00\u4e2a\u65f6\u523b\u8ba1\u7b97\u7684 \\(s_{t-1}\\) \u9700\u8981\u7f13\u5b58\u4e00\u4e0b\uff0c\u5728\u672c\u6b21\u8f93\u5165 \\(x_t\\) \u4e00\u8d77\u8ba1\u7b97\uff0c\u5171\u540c\u8f93\u51fa\u6700\u540e\u7684 \\(o_t\\) \u3002 \u5982\u679c\u53cd\u590d\u628a\u516c\u5f0f1\u5e26\u5165\u516c\u5f0f2\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a \\[ \\begin{aligned} o_t&=g(Vs_t)\\\\ &=Vf(Ux_t+Ws_{t-1})\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Ws_{t-2}))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Ws_{t-3})))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Wf(Ux_{t-3}+...)))) \\end{aligned} \\] \u4ece\u4e0a\u9762\u53ef\u4ee5\u770b\u51fa\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u8f93\u51fa\u503c\uff0c\u662f\u53d7\u524d\u9762\u5386\u6b21\u8f93\u5165\u503c \\(x_t\u3001x_{t-1}\u3001x_{t-2}\u3001x_{t-3}\u3001...\\) \u5f71\u54cd\u7684\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u53ef\u4ee5\u5f80\u524d\u770b\u4efb\u610f\u591a\u4e2a\u8f93\u5165\u503c\u7684\u539f\u56e0\u3002\u8fd9\u6837\u5176\u5b9e\u4e0d\u597d\uff0c\u56e0\u4e3a\u5982\u679c\u592a\u524d\u9762\u7684\u503c\u548c\u540e\u9762\u7684\u503c\u5df2\u7ecf\u6ca1\u6709\u5173\u7cfb\u4e86\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u8fd8\u8003\u8651\u524d\u9762\u7684\u503c\u7684\u8bdd\uff0c\u5c31\u4f1a\u5f71\u54cd\u540e\u9762\u503c\u7684\u5224\u65ad\u3002 \u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc \u00b6 \u5bf9\u4e8e\u8bed\u8a00\u6a21\u578b\u6765\u8bf4\uff0c\u5f88\u591a\u65f6\u5019\u5149\u770b\u524d\u9762\u7684\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6bd4\u5982\u4e0b\u9762\u8fd9\u53e5\u8bdd\uff1a \u6211\u7684\u624b\u673a\u574f\u4e86\uff0c\u6211\u6253\u7b97 \u4e00\u90e8\u65b0\u7684\u624b\u673a \u3002 \u6211\u4eec\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u3002 \u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u9700\u8981\u4fdd\u5b58\u4e24\u4e2a\u503c\uff0c\u4e00\u4e2a \\(A\\) \u53c2\u4e0e\u6b63\u5411\u8ba1\u7b97\uff0c\u53e6\u4e00\u4e2a\u503c \\(A^\\prime\\) \u53c2\u4e0e\u53cd\u5411\u8ba1\u7b97\u3002\u6700\u7ec8\u7684\u8f93\u51fa\u503c \\(y_2\\) \u53d6\u51b3\u4e8e \\(A_2\\) \u548c \\(A_2^\\prime\\) \u3002\u5176\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ y_2=g(VA_2+V\\prime A_2^\\prime) \\] \\(A_2\\) \u548c \\(A_2^\\prime\\) \u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ \\begin{aligned} A_2&=f(WA_1+Ux_2)\\\\ A_2^\\prime&=f(W^\\prime A_3^\\prime + U^\\prime x_2) \\end{aligned} \\] \u73b0\u5728\u53ef\u4ee5\u770b\u51fa\u4e00\u822c\u7684\u89c4\u5f8b\uff1a\u6b63\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t\\) \u4e0e \\(S_{t-1}\\) \u6709\u5173\uff1b\u53cd\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t^\\prime\\) \u4e0e \\(S_{t+1}^\\prime\\) \u6709\u5173\uff1b\u6700\u7ec8\u7684\u8f93\u51fa\u53d6\u51b3\u4e8e\u6b63\u5411\u548c\u53cd\u5411\u8ba1\u7b97\u7684\u52a0\u548c\u3002\u73b0\u5728\uff0c\u4eff\u7167\u516c\u5f0f1\u548c\u516c\u5f0f2\uff0c\u5199\u51faBRNN\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\[ \\begin{aligned} o_t=g(Vs_t+V^\\prime s_t^\\prime)\\\\ s_t=f(Ux_t+Ws_{t-1})\\\\ s_t^\\prime=f(U^\\prime x_t+W^\\prime s_{t+1}^\\prime) \\end{aligned} \\] \u4ece\u4e0a\u9762\u4e09\u4e2a\u516c\u5f0f\u53ef\u4ee5\u770b\u5230\uff0c\u6b63\u5411\u8ba1\u7b97\u548c\u53cd\u5411\u8ba1\u7b97\u4e0d\u5171\u4eab\u6743\u91cd\uff0c\u4e5f\u5c31\u662f\u8bf4 \\(U\\) \u548c \\(U^\\prime\\) \u3001 \\(W\\) \u548c \\(W^\\prime\\) \u3001 \\(V\\) \u548c \\(V^\\prime\\) \u662f\u4e0d\u540c\u7684\u6743\u91cd\u77e9\u9635\u3002 \u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931 \u00b6 \u4e0a\u6587\u4ecb\u7ecd\u7684\u51e0\u79cd RNN \u5e76\u4e0d\u80fd\u5f88\u597d\u5730\u5904\u7406\u8f83\u957f\u7684\u5e8f\u5217\uff0cRNN \u5728\u8bad\u7ec3\u4e2d\u5f88\u5bb9\u6613\u53d1\u751f\u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931\uff0c\u8fd9\u5bfc\u81f4\u68af\u5ea6\u4e0d\u80fd\u5728\u8f83\u957f\u5e8f\u5217\u4e2d\u4e00\u76f4\u4f20\u9012\u4e0b\u53bb\uff0c\u4ece\u800c\u4f7f RNN \u65e0\u6cd5\u6355\u6349\u5230\u957f\u8ddd\u79bb\u7684\u5f71\u54cd\u3002 \u901a\u5e38\u6765\u8bf4\uff0c\u68af\u5ea6\u7206\u70b8\u66f4\u5bb9\u6613\u5904\u7406\u4e00\u4e9b\u3002\u56e0\u4e3a\u68af\u5ea6\u7206\u70b8\u7684\u65f6\u5019\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u4f1a\u6536\u5230NaN\u9519\u8bef\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u68af\u5ea6\u9608\u503c\uff0c\u5f53\u68af\u5ea6\u8d85\u8fc7\u8fd9\u4e2a\u9608\u503c\u7684\u65f6\u5019\u53ef\u4ee5\u76f4\u63a5\u622a\u53d6\u3002 \u68af\u5ea6\u6d88\u5931\u66f4\u96be\u68c0\u6d4b\uff0c\u800c\u4e14\u4e5f\u66f4\u96be\u5904\u7406\u4e00\u4e9b\u3002\u603b\u7684\u6765\u8bf4\uff0c\u6211\u4eec\u6709\u4e09\u79cd\u65b9\u6cd5\u5e94\u5bf9\u68af\u5ea6\u6d88\u5931\u95ee\u9898\uff1a 1\u3001\u5408\u7406\u7684\u521d\u59cb\u5316\u6743\u91cd\u503c\u3002\u521d\u59cb\u5316\u6743\u91cd\uff0c\u4f7f\u6bcf\u4e2a\u795e\u7ecf\u5143\u5c3d\u53ef\u80fd\u4e0d\u8981\u53d6\u6781\u5927\u6216\u6781\u5c0f\u503c\uff0c\u4ee5\u8eb2\u5f00\u68af\u5ea6\u6d88\u5931\u7684\u533a\u57df\u3002 2\u3001\u4f7f\u7528relu\u4ee3\u66ffsigmoid\u548ctanh\u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\u3002 3\u3001\u4f7f\u7528\u5176\u4ed6\u7ed3\u6784\u7684RNNs\uff0c\u6bd4\u5982\u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08LTSM\uff09\u548cGated Recurrent Unit\uff08GRU\uff09\uff0c\u8fd9\u662f\u6700\u6d41\u884c\u7684\u505a\u6cd5\u3002 \u957f\u77ed\u671f\u8bb0\u5fc6\u7f51\u7edc LSTM \u00b6 \u539f\u59cb RNN \u7684\u9690\u85cf\u5c42\u53ea\u6709\u4e00\u4e2a\u72b6\u6001\uff0c\u5373 h\uff0c\u5b83\u5bf9\u77ed\u671f\u7684\u8f93\u5165\u975e\u5e38\u654f\u611f\u3002\u90a3\u4e48\u5982\u679c\u6211\u4eec\u518d\u52a0\u4e00\u4e2a\u95e8\uff08gate\uff09\u673a\u5236\u7528\u4e8e\u63a7\u5236\u7279\u5f81\u7684\u6d41\u901a\u548c\u635f\u5931\uff0c\u5373 c\uff0c\u8ba9\u5b83\u6765\u4fdd\u5b58\u957f\u671f\u7684\u72b6\u6001\uff0c\u8fd9\u5c31\u662f \u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08Long Short Term Memory\uff0cLSTM\uff09 \u3002 \u65b0\u589e\u52a0\u7684\u72b6\u6001 c\uff0c\u79f0\u4e3a\u5355\u5143\u72b6\u6001\u3002\u628a LSTM \u6309\u7167\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff1a \u53ef\u4ee5\u770b\u5230\u5728 t \u65f6\u523b LSTM \u7684\u8f93\u5165\u6709\u4e09\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7f51\u7edc\u7684\u8f93\u5165\u503c \\(x_t\\) \u3001\u4e0a\u4e00\u65f6\u523b LSTM \u7684\u8f93\u51fa\u503c \\(h_{t-1}\\) \u3001\u4ee5\u53ca\u4e0a\u4e00\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_{t-1}\\) \u3002 LSTM \u7684\u8f93\u51fa\u6709\u4e24\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7684 LSTM \u8f93\u51fa\u503c \\(h_t\\) \u3001\u548c\u5f53\u524d\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_t\\) \u3002 \u8bb0\u5fc6\u5355\u5143 c \u5728 LSTM \u5c42\u5185\u90e8\u7ed3\u675f\u5de5\u4f5c\uff0c\u4e0d\u5411\u5176\u4ed6\u5c42\u8f93\u51fa\u3002LSTM \u7684\u8f93\u51fa\u4ec5\u6709\u9690\u85cf\u72b6\u6001\u5411\u91cf h\u3002 LSTM \u7684\u5173\u952e\u662f\u5355\u5143\u72b6\u6001\uff0c\u5373\u8d2f\u7a7f\u56fe\u8868\u9876\u90e8\u7684\u6c34\u5e73\u7ebf\uff0c\u6709\u70b9\u50cf\u4f20\u9001\u5e26\u3002\u8fd9\u4e00\u90e8\u5206\u4e00\u822c\u53eb\u505a\u5355\u5143\u72b6\u6001\uff08cell state\uff09\uff0c\u5b83\u81ea\u59cb\u81f3\u7ec8\u5b58\u5728\u4e8e LSTM \u7684\u6574\u4e2a\u94fe\u5f0f\u7cfb\u7edf\u4e2d\u3002 \u8bb0\u5fc6\u5355\u5143\u72b6\u6001\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f1\uff1ac_{t}=f_{t} \\odot c_{t-1}+i_{t} \\odot g_t\\) \u9057\u5fd8\u95e8 \u00b6 \\(f_t\\) \u53eb\u505a \u9057\u5fd8\u95e8 \uff0c\u8868\u793a \\(C_{t-1}\\) \u7684\u54ea\u4e9b\u7279\u5f81\u88ab\u7528\u4e8e\u8ba1\u7b97 \\(C_t\\) \u3002 \\(f_t\\) \u662f\u4e00\u4e2a\u5411\u91cf\uff0c\u5411\u91cf\u7684\u6bcf\u4e2a\u5143\u7d20\u5747\u4f4d\u4e8e(0~1)\u8303\u56f4\u5185\u3002\u901a\u5e38\u6211\u4eec\u4f7f\u7528 sigmoid \u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\uff0csigmoid \u7684\u8f93\u51fa\u662f\u4e00\u4e2a\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u503c\uff0c\u4f46\u662f\u5f53\u4f60\u89c2\u5bdf\u4e00\u4e2a\u8bad\u7ec3\u597d\u7684 LSTM \u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u95e8\u7684\u503c\u7edd\u5927\u591a\u6570\u90fd\u975e\u5e38\u63a5\u8fd1 0 \u6216 1\uff0c\u5176\u4f59\u7684\u503c\u5c11\u4e4b\u53c8\u5c11\u3002 \u9057\u5fd8\u95e8\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f2\uff1af_t=\\sigma (x_tW_x^{(f)}+h_{h-1}W_h^{(f)}+b^{(f)})\\) \u8f93\u5165\u95e8 \u00b6 \\(\\tilde{C}_t\\) \u8868\u793a\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\uff0c\u6709\u8f93\u5165\u6570\u636e \\(x_t\\) \u548c\u9690\u8282\u70b9 \\(h_{t-1}\\) \u7ecf\u7531\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u5c42\u5f97\u5230\uff0c\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\u7684\u6fc0\u6d3b\u51fd\u6570\u901a\u5e38\u4f7f\u7528 tanh\u3002 \\(i_t\\) \u53eb\u505a\u8f93\u5165\u95e8\uff0c\u540c \\(f_t\\) \u4e00\u6837\u4e5f\u662f\u4e00\u4e2a\u5143\u7d20\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u5411\u91cf\uff0c\u540c\u6837\u7531 \\(x_t\\) \u548c \\(h_{t-1}\\) \u7ecf\u7531 sigmoid \u6fc0\u6d3b\u51fd\u6570\u8ba1\u7b97\u800c\u6210\u3002 \u8f93\u5165\u95e8\u548c\u5355\u5143\u66f4\u65b0\u503c\u7684\u8ba1\u7b97\u65b9\u5f0f\uff1a \\(\u516c\u5f0f3\uff1ai_t=\\sigma (x_tW_x^{(i)}+h_{t-1}W_h^{i}+b^{(i)})\\) \\(\u516c\u5f0f4\uff1ag_t=tanh(x_tW_x^{(g)}+h_{t-1}W_h^{(g)}+b^{(g)})\\) \u8f93\u51fa\u95e8 \u00b6 \u6700\u540e\uff0c\u4e3a\u4e86\u8ba1\u7b97\u9884\u6d4b\u503c \\(\\hat{y}_t\\) \u548c\u751f\u6210\u4e0b\u4e2a\u65f6\u95f4\u7247\u5b8c\u6574\u7684\u8f93\u5165\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u9690\u8282\u70b9\u7684\u8f93\u51fa \\(h_t\\) \u3002 \u8f93\u51fa\u95e8\u548c\u9690\u8282\u70b9\u7684\u8ba1\u7b97\u516c\u5f0f \\(\u516c\u5f0f5\uff1ao_t=\\sigma (x_tW_x^{(o)}+h_{t-1}W_h^{(o)}+b^{(o)})\\) \\(\u516c\u5f0f6\uff1ah_t=o_t\\odot tanh(c_t)\\) \u6211\u4eec\u6765\u770b\u516c\u5f0f2\u30013\u30014\u30015\uff0c\u90fd\u662f\u578b\u5982 \\(xW_x+hW_h+b\\) \u7684\u683c\u5f0f\uff0c\u56e0\u6b64\u53ef\u4ee5\u6574\u5408\u4e3a\u901a\u8fc7\u4e00\u4e2a\u5f0f\u5b50\u8fdb\u884c\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\u88ab\u6574\u5408\u4e3a\u4e86 1 \u4e2a\u3002\u5982\u6b64\uff0c\u539f\u672c\u5355\u72ec\u6267\u884c4 \u6b21\u7684\u4eff\u5c04\u53d8\u6362\u901a\u8fc71 \u6b21\u8ba1\u7b97\u5373\u53ef\u5b8c\u6210\uff0c\u53ef\u4ee5\u52a0\u5feb\u8ba1\u7b97\u901f\u5ea6\u3002\u8fd9\u662f\u56e0\u4e3a\u77e9\u9635\u5e93\u8ba1\u7b97\u201c\u5927\u77e9\u9635\u201d\u65f6\u901a\u5e38\u4f1a\u66f4\u5feb\uff0c\u800c\u4e14\u901a\u8fc7\u5c06\u6743\u91cd\u6574\u5408\u5230\u4e00\u8d77\u7ba1\u7406\uff0c\u6e90\u4ee3\u7801\u4e5f\u4f1a\u66f4\u7b80\u6d01\u3002 \u5047\u8bbe \\(W_x\u3001W_h\\) \u548c \\(b\\) \u5206\u522b\u5305\u542b 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\uff0c\u6b64\u65f6 LSTM \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 import tensorflow as tf from tensorflow.keras import layers inputs = tf . random . normal (( 64 , 6 , 10 )) LSTM_layer = layers . LSTM ( units = 20 , return_sequences = True , return_state = True ) outputs , final_memory_state , final_carry_state = LSTM_layer ( inputs ) print ( outputs . shape , final_memory_state . shape , final_carry_state . shape ) # (64, 6, 20) (64, 20) (64, 20) print ( len ( LSTM_layer . weights )) # 3 print ( LSTM_layer . weights [ 0 ] . shape ) # Wx (10, 80) print ( LSTM_layer . weights [ 1 ] . shape ) # Wh (20, 80) print ( LSTM_layer . weights [ 2 ] . shape ) # bias (80,) \u95e8\u63a7\u5faa\u73af\u5355\u5143 GRU \u00b6 LSTM \u7684\u53c2\u6570\u592a\u591a\uff0c\u8ba1\u7b97\u9700\u8981\u5f88\u957f\u65f6\u95f4\u3002\u56e0\u6b64\uff0c\u6700\u8fd1\u4e1a\u754c\u53c8\u63d0\u51fa\u4e86 GRU\uff08Gated RecurrentUnit\uff0c\u95e8\u63a7\u5faa\u73af\u5355\u5143\uff09\u3002GRU \u4fdd\u7559\u4e86 LSTM\u4f7f\u7528\u95e8\u7684\u7406\u5ff5\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u53c2\u6570\uff0c\u7f29\u77ed\u4e86\u8ba1\u7b97\u65f6\u95f4\u3002 \u76f8\u5bf9\u4e8e LSTM \u4f7f\u7528\u9690\u85cf\u72b6\u6001\u548c\u8bb0\u5fc6\u5355\u5143\u4e24\u6761\u7ebf\uff0cGRU\u53ea\u4f7f\u7528\u9690\u85cf\u72b6\u6001\u3002\u5f02\u540c\u70b9\u5982\u4e0b\uff1a GRU \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 GRU \u8ba1\u7b97\u56fe\u4e2d\uff0c \\(\\sigma\\) \u8282\u70b9\u548c tanh \u8282\u70b9\u6709\u4e13\u7528\u7684\u6743\u91cd\uff0c\u8282\u70b9\u5185\u90e8\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff08\u201c1\u2212\u201d\u8282\u70b9\u8f93\u5165x\uff0c\u8f93\u51fa1 \u2212 x\uff09 \\(\u516c\u5f0f2.1\uff1az=\\sigma(x_t W_x^{(z)}+h_{t-1} W_h^{(z)}+b^{(z)})\\) \\(\u516c\u5f0f2.2\uff1ar=\\sigma(x_t W_x^{(r)}+h_{t-1} W_h^{(r)}+b^{(r)})\\) \\(\u516c\u5f0f2.3\uff1a\\tilde{h}=\\tanh (x_t W_x+(r \\odot h_{t-1}) W_h+b)\\) \\(\u516c\u5f0f2.4\uff1ah_t=(1-z) \\odot h_{t-1}+z \\odot \\tilde{h}\\) GRU \u4e2d\u8fdb\u884c\u7684\u8ba1\u7b97\u7531\u4e0a\u8ff0 4 \u4e2a\u5f0f\u5b50\u8868\u793a\uff08\u8fd9\u91cc \\(x_t\\) \u548c \\(h_{t\u22121}\\) \u90fd\u662f\u884c\u5411\u91cf\uff09\uff0c\u5982\u56fe\u6240\u793a\uff0cGRU \u6ca1\u6709\u8bb0\u5fc6\u5355\u5143\uff0c\u53ea\u6709\u4e00\u4e2a\u9690\u85cf\u72b6\u6001 h \u5728\u65f6\u95f4\u65b9\u5411\u4e0a\u4f20\u64ad\u3002\u8fd9\u91cc\u4f7f\u7528 r \u548c z \u5171\u4e24\u4e2a\u95e8\uff08LSTM \u4f7f\u7528 3 \u4e2a\u95e8\uff09\uff0cr \u79f0\u4e3a reset \u95e8\uff0cz \u79f0\u4e3a update \u95e8\u3002 r\uff08reset\u95e8\uff09 \u51b3\u5b9a\u5728\u591a\u5927\u7a0b\u5ea6\u4e0a\u201c\u5ffd\u7565\u201d\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u3002\u6839\u636e\u516c\u5f0f2.3\uff0c\u5982\u679c r \u662f 0\uff0c\u5219\u65b0\u7684\u9690\u85cf\u72b6\u6001 \\(\\tilde{h}\\) \u4ec5\u53d6\u51b3\u4e8e\u8f93\u5165 \\(x_t\\) \u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6b64\u65f6\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u5c06\u5b8c\u5168\u88ab\u5ffd\u7565\u3002 z\uff08update\u95e8\uff09 \u662f\u66f4\u65b0\u9690\u85cf\u72b6\u6001\u7684\u95e8\uff0c\u5b83\u626e\u6f14\u4e86 LSTM \u7684 forget \u95e8\u548cinput \u95e8\u4e24\u4e2a\u89d2\u8272\u3002\u516c\u5f0f2.4 \u7684 \\((1-z) \\odot h_{t-1}\\) \u90e8\u5206\u5145\u5f53 forget \u95e8\u7684\u529f\u80fd\uff0c\u4ece\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u4e2d\u5220\u9664\u5e94\u8be5\u88ab\u9057\u5fd8\u7684\u4fe1\u606f\u3002 \\(z \\odot \\tilde{h}\\) \u7684\u90e8\u5206\u5145\u5f53 input \u95e8\u7684\u529f\u80fd\uff0c\u5bf9\u65b0\u589e\u7684\u4fe1\u606f\u8fdb\u884c\u52a0\u6743\u3002","title":"RNN"},{"location":"llm/nlp/rnns/#rnns","text":"\u7ea6 2807 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 10 \u5206\u949f Abstract NLP \u91cc\u6700\u5e38\u7528\u3001\u6700\u4f20\u7edf\u7684\u6df1\u5ea6\u5b66\u4e60\u6a21\u578b\u5c31\u662f \u5faa\u73af\u795e\u7ecf\u7f51\u7edc RNN\uff08Recurrent Neural Network\uff09 \u3002 RNN \u6709\u5f88\u591a\u53d8\u79cd\uff0c\u5176\u4e2d\u6700\u5e38\u7528\u7684\u5c31\u662f LSTM\uff08Long Short-Term Memory\uff09 \u548c GRU\uff08Gated Recurrent Unit\uff09 \u3002\u672c\u6587\u5c06\u4ecb\u7ecd RNN\u3001LSTM \u548c GRU \u7684\u539f\u7406\u3002","title":"RNNs"},{"location":"llm/nlp/rnns/#_1","text":"\u5168\u8fde\u63a5\u795e\u7ecf\u7f51\u7edc DNN \u548c \u5377\u79ef\u795e\u7ecf\u7f51\u7edc CNN\uff0c\u5b83\u4eec\u7684\u524d\u4e00\u4e2a\u8f93\u5165\u548c\u540e\u4e00\u4e2a\u8f93\u5165\u662f\u6ca1\u6709\u5173\u7cfb\u7684\u3002\u5f53\u6211\u4eec\u5904\u7406 \u5e8f\u5217\u4fe1\u606f \u65f6\uff0c\u67d0\u4e9b\u524d\u9762\u7684\u8f93\u5165\u548c\u540e\u9762\u7684\u8f93\u5165\u662f\u6709\u5173\u7cfb\u7684\uff0c\u6bd4\u5982\uff1a\u5f53\u6211\u4eec\u5728\u7406\u89e3\u4e00\u53e5\u8bdd\u7684\u610f\u601d\u65f6\uff0c\u5b64\u7acb\u7684\u7406\u89e3\u8fd9\u53e5\u8bdd\u7684\u6bcf\u4e2a\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6211\u4eec\u9700\u8981\u5904\u7406\u8fd9\u4e9b\u8bcd\u8fde\u63a5\u8d77\u6765\u7684\u6574\u4e2a \u5e8f\u5217 \uff1b\u8fd9\u4e2a\u65f6\u5019\u6211\u4eec\u5c31\u9700\u8981\u4f7f\u7528\u5230 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\uff08Recurrent Neural Network\uff09 \u3002 RNN\u5728\u81ea\u7136\u8bed\u8a00\u5904\u7406\u9886\u57df\u6700\u5148\u88ab\u4f7f\u7528\u8d77\u6765\uff0cRNN\u53ef\u4ee5\u4e3a\u8bed\u8a00\u6a21\u578b\u8fdb\u884c\u5efa\u6a21\uff1a \u6211\u6ca1\u6709\u5b8c\u6210\u4e0a\u7ea7\u5e03\u7f6e\u7ed9\u6211\u7684\u4efb\u52a1\uff0c\u6240\u4ee5 \u88ab\u5f00\u9664\u4e86 \u8ba9\u7535\u8111\u6765\u586b\u5199\u4e0b\u5212\u7ebf\u7684\u8bcd\u6700\u6709\u53ef\u80fd\u7684\u662f\u300e\u6211\u300f\uff0c\u800c\u4e0d\u592a\u53ef\u80fd\u662f\u300e\u5c0f\u660e\u300f\uff0c\u751a\u81f3\u662f\u300e\u5403\u996d\u300f\u3002 \u8bed\u8a00\u6a21\u578b\u5c31\u662f\u8fd9\u6837\u7684\u4e1c\u897f\uff1a\u7ed9\u5b9a\u4e00\u4e2a\u4e00\u53e5\u8bdd\u524d\u9762\u7684\u90e8\u5206\uff0c\u9884\u6d4b\u63a5\u4e0b\u6765\u6700\u6709\u53ef\u80fd\u7684\u4e00\u4e2a\u8bcd\u662f\u4ec0\u4e48\u3002","title":"\u6982\u8ff0"},{"location":"llm/nlp/rnns/#_2","text":"\u57fa\u672c\u7684 RNN\uff0c\u7ed3\u6784\u7531 \u8f93\u5165\u5c42\u3001\u4e00\u4e2a\u9690\u85cf\u5c42\u548c\u8f93\u51fa\u5c42 \u7ec4\u6210\u3002 x \u662f\u8f93\u5165\u5411\u91cf o \u662f\u8f93\u51fa\u5411\u91cf s \u8868\u793a\u9690\u85cf\u5c42\u7684\u503c U \u662f\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6743\u91cd\u77e9\u9635 V \u65f6\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635 \u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u7684\u503c s \u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e\u5f53\u524d\u8fd9\u6b21\u7684\u8f93\u5165 x\uff0c\u8fd8\u53d6\u51b3\u4e8e\u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u7684\u503c s\u3002\u6743\u91cd\u77e9\u9635 W \u5c31\u662f\u9690\u85cf\u5c42\u4e0a\u4e00\u6b21\u7684\u503c\u4f5c\u4e3a\u8fd9\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u3002 \u5c06\u4e0a\u56fe\u7684\u57fa\u672c RNN \u7ed3\u6784\u5728\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff08RNN \u662f\u4e00\u4e2a\u94fe\u5f0f\u7ed3\u6784\uff0c\u6bcf\u4e2a\u65f6\u95f4\u7247\u4f7f\u7528\u7684\u90fd\u662f\u76f8\u540c\u7684\u53c2\u6570\uff09 \u8fd9\u4e2a\u7f51\u7edc\u5728 t \u65f6\u523b\u63a5\u6536\u5230\u8f93\u5165 \\(x_t\\) \u4e4b\u540e\uff0c\u9690\u85cf\u5c42\u7684\u503c\u662f \\(s_t\\) \uff0c\u8f93\u51fa\u5c42\u7684\u503c\u662f \\(o_t\\) \uff0c \u5173\u952e\u7684\u662f\uff0c \\(s_t\\) \u7684\u503c\u4e0d\u4ec5\u4ec5\u53d6\u51b3\u4e8e \\(x_t\\) \uff0c\u8fd8\u53d6\u51b3\u4e8e \\(s_{t-1}\\) \u3002 \\[ s_t=f(U * x_t + W * s_{t-1}) \\\\ o_t=g(V * s_t) \\] \u516c\u5f0f1 \u662f\u9690\u85cf\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0c\u5b83\u662f\u5faa\u73af\u5c42\u3002U \u662f\u8f93\u5165 x \u7684\u6743\u91cd\u77e9\u9635\uff0cW \u662f \u4e0a\u4e00\u6b21\u9690\u85cf\u5c42\u503c \\(s_{t-1}\\) \u4f5c\u4e3a\u5219\u4e00\u6b21\u7684\u8f93\u5165\u7684\u6743\u91cd\u77e9\u9635\uff0cf \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u516c\u5f0f2 \u662f\u8f93\u51fa\u5c42\u7684\u8ba1\u7b97\u516c\u5f0f\uff0cV \u662f\u8f93\u51fa\u5c42\u7684\u6743\u91cd\u77e9\u9635\uff0cg \u662f\u6fc0\u6d3b\u51fd\u6570\u3002 \u9690\u85cf\u5c42\u6709\u4e24\u4e2a\u8f93\u5165\uff0c\u7b2c\u4e00\u662f U \u4e0e \\(x_t\\) \u5411\u91cf\u7684\u4e58\u79ef\uff0c\u7b2c\u4e8c\u662f\u4e0a\u4e00\u9690\u85cf\u5c42\u8f93\u51fa\u7684\u72b6\u6001 \\(s_{t-1}\\) \u4e0e W \u7684\u4e58\u79ef\u3002\u7b49\u4e8e\u4e0a\u4e00\u4e2a\u65f6\u523b\u8ba1\u7b97\u7684 \\(s_{t-1}\\) \u9700\u8981\u7f13\u5b58\u4e00\u4e0b\uff0c\u5728\u672c\u6b21\u8f93\u5165 \\(x_t\\) \u4e00\u8d77\u8ba1\u7b97\uff0c\u5171\u540c\u8f93\u51fa\u6700\u540e\u7684 \\(o_t\\) \u3002 \u5982\u679c\u53cd\u590d\u628a\u516c\u5f0f1\u5e26\u5165\u516c\u5f0f2\uff0c\u53ef\u4ee5\u5f97\u5230\uff1a \\[ \\begin{aligned} o_t&=g(Vs_t)\\\\ &=Vf(Ux_t+Ws_{t-1})\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Ws_{t-2}))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Ws_{t-3})))\\\\ &=Vf(Ux_t+Wf(Ux_{t-1}+Wf(Ux_{t-2}+Wf(Ux_{t-3}+...)))) \\end{aligned} \\] \u4ece\u4e0a\u9762\u53ef\u4ee5\u770b\u51fa\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u8f93\u51fa\u503c\uff0c\u662f\u53d7\u524d\u9762\u5386\u6b21\u8f93\u5165\u503c \\(x_t\u3001x_{t-1}\u3001x_{t-2}\u3001x_{t-3}\u3001...\\) \u5f71\u54cd\u7684\uff0c\u8fd9\u5c31\u662f\u4e3a\u4ec0\u4e48\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u53ef\u4ee5\u5f80\u524d\u770b\u4efb\u610f\u591a\u4e2a\u8f93\u5165\u503c\u7684\u539f\u56e0\u3002\u8fd9\u6837\u5176\u5b9e\u4e0d\u597d\uff0c\u56e0\u4e3a\u5982\u679c\u592a\u524d\u9762\u7684\u503c\u548c\u540e\u9762\u7684\u503c\u5df2\u7ecf\u6ca1\u6709\u5173\u7cfb\u4e86\uff0c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u8fd8\u8003\u8651\u524d\u9762\u7684\u503c\u7684\u8bdd\uff0c\u5c31\u4f1a\u5f71\u54cd\u540e\u9762\u503c\u7684\u5224\u65ad\u3002","title":"\u57fa\u672c\u5faa\u73af\u795e\u7ecf\u7f51\u7edc"},{"location":"llm/nlp/rnns/#_3","text":"\u5bf9\u4e8e\u8bed\u8a00\u6a21\u578b\u6765\u8bf4\uff0c\u5f88\u591a\u65f6\u5019\u5149\u770b\u524d\u9762\u7684\u8bcd\u662f\u4e0d\u591f\u7684\uff0c\u6bd4\u5982\u4e0b\u9762\u8fd9\u53e5\u8bdd\uff1a \u6211\u7684\u624b\u673a\u574f\u4e86\uff0c\u6211\u6253\u7b97 \u4e00\u90e8\u65b0\u7684\u624b\u673a \u3002 \u6211\u4eec\u8fd9\u4e2a\u65f6\u5019\u5c31\u9700\u8981\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u3002 \u4ece\u4e0a\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc\u7684\u9690\u85cf\u5c42\u9700\u8981\u4fdd\u5b58\u4e24\u4e2a\u503c\uff0c\u4e00\u4e2a \\(A\\) \u53c2\u4e0e\u6b63\u5411\u8ba1\u7b97\uff0c\u53e6\u4e00\u4e2a\u503c \\(A^\\prime\\) \u53c2\u4e0e\u53cd\u5411\u8ba1\u7b97\u3002\u6700\u7ec8\u7684\u8f93\u51fa\u503c \\(y_2\\) \u53d6\u51b3\u4e8e \\(A_2\\) \u548c \\(A_2^\\prime\\) \u3002\u5176\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ y_2=g(VA_2+V\\prime A_2^\\prime) \\] \\(A_2\\) \u548c \\(A_2^\\prime\\) \u7684\u8ba1\u7b97\u65b9\u6cd5\u4e3a\uff1a \\[ \\begin{aligned} A_2&=f(WA_1+Ux_2)\\\\ A_2^\\prime&=f(W^\\prime A_3^\\prime + U^\\prime x_2) \\end{aligned} \\] \u73b0\u5728\u53ef\u4ee5\u770b\u51fa\u4e00\u822c\u7684\u89c4\u5f8b\uff1a\u6b63\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t\\) \u4e0e \\(S_{t-1}\\) \u6709\u5173\uff1b\u53cd\u5411\u8ba1\u7b97\u65f6\uff0c\u9690\u85cf\u5c42\u7684\u503c \\(S_t^\\prime\\) \u4e0e \\(S_{t+1}^\\prime\\) \u6709\u5173\uff1b\u6700\u7ec8\u7684\u8f93\u51fa\u53d6\u51b3\u4e8e\u6b63\u5411\u548c\u53cd\u5411\u8ba1\u7b97\u7684\u52a0\u548c\u3002\u73b0\u5728\uff0c\u4eff\u7167\u516c\u5f0f1\u548c\u516c\u5f0f2\uff0c\u5199\u51faBRNN\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\[ \\begin{aligned} o_t=g(Vs_t+V^\\prime s_t^\\prime)\\\\ s_t=f(Ux_t+Ws_{t-1})\\\\ s_t^\\prime=f(U^\\prime x_t+W^\\prime s_{t+1}^\\prime) \\end{aligned} \\] \u4ece\u4e0a\u9762\u4e09\u4e2a\u516c\u5f0f\u53ef\u4ee5\u770b\u5230\uff0c\u6b63\u5411\u8ba1\u7b97\u548c\u53cd\u5411\u8ba1\u7b97\u4e0d\u5171\u4eab\u6743\u91cd\uff0c\u4e5f\u5c31\u662f\u8bf4 \\(U\\) \u548c \\(U^\\prime\\) \u3001 \\(W\\) \u548c \\(W^\\prime\\) \u3001 \\(V\\) \u548c \\(V^\\prime\\) \u662f\u4e0d\u540c\u7684\u6743\u91cd\u77e9\u9635\u3002","title":"\u53cc\u5411\u5faa\u73af\u795e\u7ecf\u7f51\u7edc"},{"location":"llm/nlp/rnns/#_4","text":"\u4e0a\u6587\u4ecb\u7ecd\u7684\u51e0\u79cd RNN \u5e76\u4e0d\u80fd\u5f88\u597d\u5730\u5904\u7406\u8f83\u957f\u7684\u5e8f\u5217\uff0cRNN \u5728\u8bad\u7ec3\u4e2d\u5f88\u5bb9\u6613\u53d1\u751f\u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931\uff0c\u8fd9\u5bfc\u81f4\u68af\u5ea6\u4e0d\u80fd\u5728\u8f83\u957f\u5e8f\u5217\u4e2d\u4e00\u76f4\u4f20\u9012\u4e0b\u53bb\uff0c\u4ece\u800c\u4f7f RNN \u65e0\u6cd5\u6355\u6349\u5230\u957f\u8ddd\u79bb\u7684\u5f71\u54cd\u3002 \u901a\u5e38\u6765\u8bf4\uff0c\u68af\u5ea6\u7206\u70b8\u66f4\u5bb9\u6613\u5904\u7406\u4e00\u4e9b\u3002\u56e0\u4e3a\u68af\u5ea6\u7206\u70b8\u7684\u65f6\u5019\uff0c\u6211\u4eec\u7684\u7a0b\u5e8f\u4f1a\u6536\u5230NaN\u9519\u8bef\u3002\u6211\u4eec\u4e5f\u53ef\u4ee5\u8bbe\u7f6e\u4e00\u4e2a\u68af\u5ea6\u9608\u503c\uff0c\u5f53\u68af\u5ea6\u8d85\u8fc7\u8fd9\u4e2a\u9608\u503c\u7684\u65f6\u5019\u53ef\u4ee5\u76f4\u63a5\u622a\u53d6\u3002 \u68af\u5ea6\u6d88\u5931\u66f4\u96be\u68c0\u6d4b\uff0c\u800c\u4e14\u4e5f\u66f4\u96be\u5904\u7406\u4e00\u4e9b\u3002\u603b\u7684\u6765\u8bf4\uff0c\u6211\u4eec\u6709\u4e09\u79cd\u65b9\u6cd5\u5e94\u5bf9\u68af\u5ea6\u6d88\u5931\u95ee\u9898\uff1a 1\u3001\u5408\u7406\u7684\u521d\u59cb\u5316\u6743\u91cd\u503c\u3002\u521d\u59cb\u5316\u6743\u91cd\uff0c\u4f7f\u6bcf\u4e2a\u795e\u7ecf\u5143\u5c3d\u53ef\u80fd\u4e0d\u8981\u53d6\u6781\u5927\u6216\u6781\u5c0f\u503c\uff0c\u4ee5\u8eb2\u5f00\u68af\u5ea6\u6d88\u5931\u7684\u533a\u57df\u3002 2\u3001\u4f7f\u7528relu\u4ee3\u66ffsigmoid\u548ctanh\u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\u3002 3\u3001\u4f7f\u7528\u5176\u4ed6\u7ed3\u6784\u7684RNNs\uff0c\u6bd4\u5982\u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08LTSM\uff09\u548cGated Recurrent Unit\uff08GRU\uff09\uff0c\u8fd9\u662f\u6700\u6d41\u884c\u7684\u505a\u6cd5\u3002","title":"\u68af\u5ea6\u7206\u70b8\u548c\u68af\u5ea6\u6d88\u5931"},{"location":"llm/nlp/rnns/#lstm","text":"\u539f\u59cb RNN \u7684\u9690\u85cf\u5c42\u53ea\u6709\u4e00\u4e2a\u72b6\u6001\uff0c\u5373 h\uff0c\u5b83\u5bf9\u77ed\u671f\u7684\u8f93\u5165\u975e\u5e38\u654f\u611f\u3002\u90a3\u4e48\u5982\u679c\u6211\u4eec\u518d\u52a0\u4e00\u4e2a\u95e8\uff08gate\uff09\u673a\u5236\u7528\u4e8e\u63a7\u5236\u7279\u5f81\u7684\u6d41\u901a\u548c\u635f\u5931\uff0c\u5373 c\uff0c\u8ba9\u5b83\u6765\u4fdd\u5b58\u957f\u671f\u7684\u72b6\u6001\uff0c\u8fd9\u5c31\u662f \u957f\u77ed\u65f6\u8bb0\u5fc6\u7f51\u7edc\uff08Long Short Term Memory\uff0cLSTM\uff09 \u3002 \u65b0\u589e\u52a0\u7684\u72b6\u6001 c\uff0c\u79f0\u4e3a\u5355\u5143\u72b6\u6001\u3002\u628a LSTM \u6309\u7167\u65f6\u95f4\u7ef4\u5ea6\u5c55\u5f00\uff1a \u53ef\u4ee5\u770b\u5230\u5728 t \u65f6\u523b LSTM \u7684\u8f93\u5165\u6709\u4e09\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7f51\u7edc\u7684\u8f93\u5165\u503c \\(x_t\\) \u3001\u4e0a\u4e00\u65f6\u523b LSTM \u7684\u8f93\u51fa\u503c \\(h_{t-1}\\) \u3001\u4ee5\u53ca\u4e0a\u4e00\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_{t-1}\\) \u3002 LSTM \u7684\u8f93\u51fa\u6709\u4e24\u4e2a \uff1a\u5f53\u524d\u65f6\u523b\u7684 LSTM \u8f93\u51fa\u503c \\(h_t\\) \u3001\u548c\u5f53\u524d\u65f6\u523b\u7684\u8bb0\u5fc6\u5355\u5143\u5411\u91cf \\(c_t\\) \u3002 \u8bb0\u5fc6\u5355\u5143 c \u5728 LSTM \u5c42\u5185\u90e8\u7ed3\u675f\u5de5\u4f5c\uff0c\u4e0d\u5411\u5176\u4ed6\u5c42\u8f93\u51fa\u3002LSTM \u7684\u8f93\u51fa\u4ec5\u6709\u9690\u85cf\u72b6\u6001\u5411\u91cf h\u3002 LSTM \u7684\u5173\u952e\u662f\u5355\u5143\u72b6\u6001\uff0c\u5373\u8d2f\u7a7f\u56fe\u8868\u9876\u90e8\u7684\u6c34\u5e73\u7ebf\uff0c\u6709\u70b9\u50cf\u4f20\u9001\u5e26\u3002\u8fd9\u4e00\u90e8\u5206\u4e00\u822c\u53eb\u505a\u5355\u5143\u72b6\u6001\uff08cell state\uff09\uff0c\u5b83\u81ea\u59cb\u81f3\u7ec8\u5b58\u5728\u4e8e LSTM \u7684\u6574\u4e2a\u94fe\u5f0f\u7cfb\u7edf\u4e2d\u3002 \u8bb0\u5fc6\u5355\u5143\u72b6\u6001\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f1\uff1ac_{t}=f_{t} \\odot c_{t-1}+i_{t} \\odot g_t\\)","title":"\u957f\u77ed\u671f\u8bb0\u5fc6\u7f51\u7edc LSTM"},{"location":"llm/nlp/rnns/#_5","text":"\\(f_t\\) \u53eb\u505a \u9057\u5fd8\u95e8 \uff0c\u8868\u793a \\(C_{t-1}\\) \u7684\u54ea\u4e9b\u7279\u5f81\u88ab\u7528\u4e8e\u8ba1\u7b97 \\(C_t\\) \u3002 \\(f_t\\) \u662f\u4e00\u4e2a\u5411\u91cf\uff0c\u5411\u91cf\u7684\u6bcf\u4e2a\u5143\u7d20\u5747\u4f4d\u4e8e(0~1)\u8303\u56f4\u5185\u3002\u901a\u5e38\u6211\u4eec\u4f7f\u7528 sigmoid \u4f5c\u4e3a\u6fc0\u6d3b\u51fd\u6570\uff0csigmoid \u7684\u8f93\u51fa\u662f\u4e00\u4e2a\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u503c\uff0c\u4f46\u662f\u5f53\u4f60\u89c2\u5bdf\u4e00\u4e2a\u8bad\u7ec3\u597d\u7684 LSTM \u65f6\uff0c\u4f60\u4f1a\u53d1\u73b0\u95e8\u7684\u503c\u7edd\u5927\u591a\u6570\u90fd\u975e\u5e38\u63a5\u8fd1 0 \u6216 1\uff0c\u5176\u4f59\u7684\u503c\u5c11\u4e4b\u53c8\u5c11\u3002 \u9057\u5fd8\u95e8\u7684\u8ba1\u7b97\u516c\u5f0f\uff1a \\(\u516c\u5f0f2\uff1af_t=\\sigma (x_tW_x^{(f)}+h_{h-1}W_h^{(f)}+b^{(f)})\\)","title":"\u9057\u5fd8\u95e8"},{"location":"llm/nlp/rnns/#_6","text":"\\(\\tilde{C}_t\\) \u8868\u793a\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\uff0c\u6709\u8f93\u5165\u6570\u636e \\(x_t\\) \u548c\u9690\u8282\u70b9 \\(h_{t-1}\\) \u7ecf\u7531\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u5c42\u5f97\u5230\uff0c\u5355\u5143\u72b6\u6001\u66f4\u65b0\u503c\u7684\u6fc0\u6d3b\u51fd\u6570\u901a\u5e38\u4f7f\u7528 tanh\u3002 \\(i_t\\) \u53eb\u505a\u8f93\u5165\u95e8\uff0c\u540c \\(f_t\\) \u4e00\u6837\u4e5f\u662f\u4e00\u4e2a\u5143\u7d20\u4ecb\u4e8e(0~1)\u533a\u95f4\u5185\u7684\u5411\u91cf\uff0c\u540c\u6837\u7531 \\(x_t\\) \u548c \\(h_{t-1}\\) \u7ecf\u7531 sigmoid \u6fc0\u6d3b\u51fd\u6570\u8ba1\u7b97\u800c\u6210\u3002 \u8f93\u5165\u95e8\u548c\u5355\u5143\u66f4\u65b0\u503c\u7684\u8ba1\u7b97\u65b9\u5f0f\uff1a \\(\u516c\u5f0f3\uff1ai_t=\\sigma (x_tW_x^{(i)}+h_{t-1}W_h^{i}+b^{(i)})\\) \\(\u516c\u5f0f4\uff1ag_t=tanh(x_tW_x^{(g)}+h_{t-1}W_h^{(g)}+b^{(g)})\\)","title":"\u8f93\u5165\u95e8"},{"location":"llm/nlp/rnns/#_7","text":"\u6700\u540e\uff0c\u4e3a\u4e86\u8ba1\u7b97\u9884\u6d4b\u503c \\(\\hat{y}_t\\) \u548c\u751f\u6210\u4e0b\u4e2a\u65f6\u95f4\u7247\u5b8c\u6574\u7684\u8f93\u5165\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97\u9690\u8282\u70b9\u7684\u8f93\u51fa \\(h_t\\) \u3002 \u8f93\u51fa\u95e8\u548c\u9690\u8282\u70b9\u7684\u8ba1\u7b97\u516c\u5f0f \\(\u516c\u5f0f5\uff1ao_t=\\sigma (x_tW_x^{(o)}+h_{t-1}W_h^{(o)}+b^{(o)})\\) \\(\u516c\u5f0f6\uff1ah_t=o_t\\odot tanh(c_t)\\) \u6211\u4eec\u6765\u770b\u516c\u5f0f2\u30013\u30014\u30015\uff0c\u90fd\u662f\u578b\u5982 \\(xW_x+hW_h+b\\) \u7684\u683c\u5f0f\uff0c\u56e0\u6b64\u53ef\u4ee5\u6574\u5408\u4e3a\u901a\u8fc7\u4e00\u4e2a\u5f0f\u5b50\u8fdb\u884c\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\u88ab\u6574\u5408\u4e3a\u4e86 1 \u4e2a\u3002\u5982\u6b64\uff0c\u539f\u672c\u5355\u72ec\u6267\u884c4 \u6b21\u7684\u4eff\u5c04\u53d8\u6362\u901a\u8fc71 \u6b21\u8ba1\u7b97\u5373\u53ef\u5b8c\u6210\uff0c\u53ef\u4ee5\u52a0\u5feb\u8ba1\u7b97\u901f\u5ea6\u3002\u8fd9\u662f\u56e0\u4e3a\u77e9\u9635\u5e93\u8ba1\u7b97\u201c\u5927\u77e9\u9635\u201d\u65f6\u901a\u5e38\u4f1a\u66f4\u5feb\uff0c\u800c\u4e14\u901a\u8fc7\u5c06\u6743\u91cd\u6574\u5408\u5230\u4e00\u8d77\u7ba1\u7406\uff0c\u6e90\u4ee3\u7801\u4e5f\u4f1a\u66f4\u7b80\u6d01\u3002 \u5047\u8bbe \\(W_x\u3001W_h\\) \u548c \\(b\\) \u5206\u522b\u5305\u542b 4 \u4e2a\u6743\u91cd\uff08\u6216\u504f\u7f6e\uff09\uff0c\u6b64\u65f6 LSTM \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 import tensorflow as tf from tensorflow.keras import layers inputs = tf . random . normal (( 64 , 6 , 10 )) LSTM_layer = layers . LSTM ( units = 20 , return_sequences = True , return_state = True ) outputs , final_memory_state , final_carry_state = LSTM_layer ( inputs ) print ( outputs . shape , final_memory_state . shape , final_carry_state . shape ) # (64, 6, 20) (64, 20) (64, 20) print ( len ( LSTM_layer . weights )) # 3 print ( LSTM_layer . weights [ 0 ] . shape ) # Wx (10, 80) print ( LSTM_layer . weights [ 1 ] . shape ) # Wh (20, 80) print ( LSTM_layer . weights [ 2 ] . shape ) # bias (80,)","title":"\u8f93\u51fa\u95e8"},{"location":"llm/nlp/rnns/#gru","text":"LSTM \u7684\u53c2\u6570\u592a\u591a\uff0c\u8ba1\u7b97\u9700\u8981\u5f88\u957f\u65f6\u95f4\u3002\u56e0\u6b64\uff0c\u6700\u8fd1\u4e1a\u754c\u53c8\u63d0\u51fa\u4e86 GRU\uff08Gated RecurrentUnit\uff0c\u95e8\u63a7\u5faa\u73af\u5355\u5143\uff09\u3002GRU \u4fdd\u7559\u4e86 LSTM\u4f7f\u7528\u95e8\u7684\u7406\u5ff5\uff0c\u4f46\u662f\u51cf\u5c11\u4e86\u53c2\u6570\uff0c\u7f29\u77ed\u4e86\u8ba1\u7b97\u65f6\u95f4\u3002 \u76f8\u5bf9\u4e8e LSTM \u4f7f\u7528\u9690\u85cf\u72b6\u6001\u548c\u8bb0\u5fc6\u5355\u5143\u4e24\u6761\u7ebf\uff0cGRU\u53ea\u4f7f\u7528\u9690\u85cf\u72b6\u6001\u3002\u5f02\u540c\u70b9\u5982\u4e0b\uff1a GRU \u7684\u8ba1\u7b97\u56fe\u5982\u4e0b\u6240\u793a\u3002 GRU \u8ba1\u7b97\u56fe\u4e2d\uff0c \\(\\sigma\\) \u8282\u70b9\u548c tanh \u8282\u70b9\u6709\u4e13\u7528\u7684\u6743\u91cd\uff0c\u8282\u70b9\u5185\u90e8\u8fdb\u884c\u4eff\u5c04\u53d8\u6362\uff08\u201c1\u2212\u201d\u8282\u70b9\u8f93\u5165x\uff0c\u8f93\u51fa1 \u2212 x\uff09 \\(\u516c\u5f0f2.1\uff1az=\\sigma(x_t W_x^{(z)}+h_{t-1} W_h^{(z)}+b^{(z)})\\) \\(\u516c\u5f0f2.2\uff1ar=\\sigma(x_t W_x^{(r)}+h_{t-1} W_h^{(r)}+b^{(r)})\\) \\(\u516c\u5f0f2.3\uff1a\\tilde{h}=\\tanh (x_t W_x+(r \\odot h_{t-1}) W_h+b)\\) \\(\u516c\u5f0f2.4\uff1ah_t=(1-z) \\odot h_{t-1}+z \\odot \\tilde{h}\\) GRU \u4e2d\u8fdb\u884c\u7684\u8ba1\u7b97\u7531\u4e0a\u8ff0 4 \u4e2a\u5f0f\u5b50\u8868\u793a\uff08\u8fd9\u91cc \\(x_t\\) \u548c \\(h_{t\u22121}\\) \u90fd\u662f\u884c\u5411\u91cf\uff09\uff0c\u5982\u56fe\u6240\u793a\uff0cGRU \u6ca1\u6709\u8bb0\u5fc6\u5355\u5143\uff0c\u53ea\u6709\u4e00\u4e2a\u9690\u85cf\u72b6\u6001 h \u5728\u65f6\u95f4\u65b9\u5411\u4e0a\u4f20\u64ad\u3002\u8fd9\u91cc\u4f7f\u7528 r \u548c z \u5171\u4e24\u4e2a\u95e8\uff08LSTM \u4f7f\u7528 3 \u4e2a\u95e8\uff09\uff0cr \u79f0\u4e3a reset \u95e8\uff0cz \u79f0\u4e3a update \u95e8\u3002 r\uff08reset\u95e8\uff09 \u51b3\u5b9a\u5728\u591a\u5927\u7a0b\u5ea6\u4e0a\u201c\u5ffd\u7565\u201d\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u3002\u6839\u636e\u516c\u5f0f2.3\uff0c\u5982\u679c r \u662f 0\uff0c\u5219\u65b0\u7684\u9690\u85cf\u72b6\u6001 \\(\\tilde{h}\\) \u4ec5\u53d6\u51b3\u4e8e\u8f93\u5165 \\(x_t\\) \u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u6b64\u65f6\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u5c06\u5b8c\u5168\u88ab\u5ffd\u7565\u3002 z\uff08update\u95e8\uff09 \u662f\u66f4\u65b0\u9690\u85cf\u72b6\u6001\u7684\u95e8\uff0c\u5b83\u626e\u6f14\u4e86 LSTM \u7684 forget \u95e8\u548cinput \u95e8\u4e24\u4e2a\u89d2\u8272\u3002\u516c\u5f0f2.4 \u7684 \\((1-z) \\odot h_{t-1}\\) \u90e8\u5206\u5145\u5f53 forget \u95e8\u7684\u529f\u80fd\uff0c\u4ece\u8fc7\u53bb\u7684\u9690\u85cf\u72b6\u6001\u4e2d\u5220\u9664\u5e94\u8be5\u88ab\u9057\u5fd8\u7684\u4fe1\u606f\u3002 \\(z \\odot \\tilde{h}\\) \u7684\u90e8\u5206\u5145\u5f53 input \u95e8\u7684\u529f\u80fd\uff0c\u5bf9\u65b0\u589e\u7684\u4fe1\u606f\u8fdb\u884c\u52a0\u6743\u3002","title":"\u95e8\u63a7\u5faa\u73af\u5355\u5143 GRU"},{"location":"llm/nlp/word2vec/","text":"Word2Vec \u00b6 \u7ea6 2803 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract Word2Vec \u7684\u7279\u70b9\u662f\u80fd\u591f\u5c06\u5355\u8bcd\u8f6c\u5316\u4e3a\u5411\u91cf\u6765\u8868\u793a\uff0c\u8fd9\u6837\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u5c31\u53ef\u4ee5\u5b9a\u91cf\u5730\u53bb\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u6316\u6398\u8bcd\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u6700\u65e9\u7684\u8bcd\u5411\u91cf\u91c7\u7528 One-Hot \u7f16\u7801\uff0c\u53c8\u79f0\u4e00\u4f4d\u6709\u6548\u7f16\u7801\uff0c\u6bcf\u4e2a\u8bcd\u5411\u91cf\u7ef4\u5ea6\u5927\u5c0f\u4e3a\u6574\u4e2a\u8bcd\u6c47\u8868\u7684\u5927\u5c0f\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u5177\u4f53\u7684\u8bcd\u6c47\u8868\u4e2d\u7684\u8bcd\uff0c\u5c06\u5bf9\u5e94\u7684\u4f4d\u7f6e\u7f6e\u4e3a 1. Word2Vec \u57fa\u672c\u601d\u60f3 \u00b6 \u91c7\u7528One-Hot\u7f16\u7801\u65b9\u5f0f\u6765\u8868\u793a\u8bcd\u5411\u91cf\u975e\u5e38\u7b80\u5355\uff0c\u4f46\u7f3a\u70b9\u4e5f\u662f\u663e\u800c\u6613\u89c1\u7684\uff0c\u4e00\u65b9\u9762\u6211\u4eec\u5b9e\u9645\u4f7f\u7528\u7684\u8bcd\u6c47\u8868\u5f88\u5927\uff0c\u7ecf\u5e38\u662f\u767e\u4e07\u7ea7\u4ee5\u4e0a\uff0c\u8fd9\u4e48\u9ad8\u7ef4\u7684\u6570\u636e\u5904\u7406\u8d77\u6765\u4f1a\u6d88\u8017\u5927\u91cf\u7684\u8ba1\u7b97\u8d44\u6e90\u4e0e\u65f6\u95f4\u3002\u53e6\u4e00\u65b9\u9762\uff0cOne-Hot\u7f16\u7801\u4e2d\u6240\u6709\u8bcd\u5411\u91cf\u4e4b\u95f4\u5f7c\u6b64\u6b63\u4ea4\uff0c\u6ca1\u6709\u4f53\u73b0\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u7684\u76f8\u4f3c\u5173\u7cfb\u3002 Distributed representation\u53ef\u4ee5\u89e3\u51b3One-Hot\u7f16\u7801\u5b58\u5728\u7684\u95ee\u9898\uff0c\u5b83\u7684\u601d\u8def\u662f\u901a\u8fc7\u8bad\u7ec3\uff0c\u5c06\u539f\u6765One-Hot\u7f16\u7801\u7684\u6bcf\u4e2a\u8bcd\u90fd\u6620\u5c04\u5230\u4e00\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u4e0a\u6765\uff0c\u800c\u8fd9\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u7684\u7ef4\u5ea6\u53ef\u4ee5\u7531\u6211\u4eec\u81ea\u5df1\u5728\u8bad\u7ec3\u65f6\u6839\u636e\u4efb\u52a1\u9700\u8981\u6765\u81ea\u5df1\u6307\u5b9a\u3002 \u4e0b\u56fe\u662f\u91c7\u7528Distributed representation\u7684\u4e00\u4e2a\u4f8b\u5b50\uff0c\u6211\u4eec\u5c06\u8bcd\u6c47\u8868\u91cc\u7684\u8bcd\u7528\"Royalty\",\"Masculinity\", \"Femininity\"\u548c\"Age\"4\u4e2a\u7ef4\u5ea6\u6765\u8868\u793a\uff0cKing\u8fd9\u4e2a\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\u53ef\u80fd\u662f(0.99,0.99,0.05,0.7)\u3002\u5f53\u7136\u5728\u5b9e\u9645\u60c5\u51b5\u4e2d\uff0c\u6211\u4eec\u5e76\u4e0d\u80fd\u5bf9\u8bcd\u5411\u91cf\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u505a\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u91ca\u3002 \u6709\u4e86\u7528Distributed Representation\u8868\u793a\u7684\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8f83\u5bb9\u6613\u7684\u5206\u6790\u8bcd\u4e4b\u95f4\u7684\u5173\u7cfb\u4e86\uff0c\u6bd4\u5982\u6211\u4eec\u5c06\u8bcd\u7684\u7ef4\u5ea6\u964d\u7ef4\u52302\u7ef4\uff0c\u6709\u4e00\u4e2a\u6709\u8da3\u7684\u7814\u7a76\u8868\u660e\uff0c\u7528\u4e0b\u56fe\u7684\u8bcd\u5411\u91cf\u8868\u793a\u6211\u4eec\u7684\u8bcd\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\uff1a \\[ \\vec{King} - \\vec{Man} + \\vec{Woman} \\approx \\vec{Queen} \\] \u53ef\u89c1\u6211\u4eec\u53ea\u8981\u5f97\u5230\u4e86\u8bcd\u6c47\u8868\u91cc\u6240\u6709\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u505a\u5f88\u591a\u6709\u8da3\u7684\u4e8b\u60c5\u4e86\u3002\u4e0d\u8fc7\uff0c\u600e\u4e48\u8bad\u7ec3\u624d\u80fd\u5f97\u5230\u5408\u9002\u7684\u8bcd\u5411\u91cf\u5462\uff1f\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0cGoogle\u7684Tomas Mikolov\u5728\u4ed6\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u3002 Word2Vec \u539f\u7406 \u00b6 Word2Vec \u7684\u8bad\u7ec3\u6a21\u578b\u672c\u8d28\u4e0a\u662f\u53ea\u5177\u6709\u4e00\u4e2a\u9690\u542b\u5c42\u7684\u795e\u7ecf\u5143\u7f51\u7edc\u3002 \u5b83\u7684\u8f93\u5165\u91c7\u7528 One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\uff0c\u5b83\u7684\u8f93\u51fa\u4e5f\u662f One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\u3002\u4f7f\u7528\u6240\u6709\u7684\u6837\u672c\uff0c\u8bad\u7ec3\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\uff0c\u7b49\u5230\u6536\u655b\u4e4b\u540e\uff0c\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u90a3\u4e9b\u6743\u91cd\uff0c\u4fbf\u662f\u6bcf\u4e00\u4e2a\u8bcd\u7684\u91c7\u7528Distributed Representation\u7684\u8bcd\u5411\u91cf\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u5355\u8bcd\u7684Word embedding\u540e\u7684\u5411\u91cf\u4fbf\u662f\u77e9\u9635 \\(W_{V \\times N}\\) \u7684\u7b2ci\u884c\u7684\u8f6c\u7f6e\u3002\u8fd9\u6837\u6211\u4eec\u5c31\u628a\u539f\u672c\u7ef4\u6570\u4e3aV\u7684\u8bcd\u5411\u91cf\u53d8\u6210\u4e86\u7ef4\u6570\u4e3aN\u7684\u8bcd\u5411\u91cf\uff08N\u8fdc\u5c0f\u4e8eV\uff09\uff0c\u5e76\u4e14\u8bcd\u5411\u91cf\u95f4\u4fdd\u7559\u4e86\u4e00\u5b9a\u7684\u76f8\u5173\u5173\u7cfb\u3002 Google\u7684Mikolov\u5728\u5173\u4e8eWord2Vec\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u6a21\u578b\uff0cCBOW\u9002\u5408\u4e8e\u6570\u636e\u96c6\u8f83\u5c0f\u7684\u60c5\u51b5\uff0c\u800cSkip-Gram\u5728\u5927\u578b\u8bed\u6599\u4e2d\u8868\u73b0\u66f4\u597d\u3002\u5176\u4e2dCBOW\u5982\u4e0b\u56fe\u5de6\u90e8\u5206\u6240\u793a\uff0c\u4f7f\u7528\u56f4\u7ed5\u76ee\u6807\u5355\u8bcd\u7684\u5176\u4ed6\u5355\u8bcd\uff08\u8bed\u5883\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u5728\u6620\u5c04\u5c42\u505a\u52a0\u6743\u5904\u7406\u540e\u8f93\u51fa\u76ee\u6807\u5355\u8bcd\u3002\u4e0eCBOW\u6839\u636e\u8bed\u5883\u9884\u6d4b\u76ee\u6807\u5355\u8bcd\u4e0d\u540c\uff0cSkip-gram\u6839\u636e\u5f53\u524d\u5355\u8bcd\u9884\u6d4b\u8bed\u5883\uff0c\u5982\u4e0b\u56fe\u53f3\u90e8\u5206\u6240\u793a\u3002\u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u4f5c\u4e3a\u8bad\u7ec3\u6570\u636e\uff0cCBOW\u7684\u8f93\u5165\u4e3a\uff08is,an,on,the\uff09\uff0c\u8f93\u51fa\u4e3aapple\u3002\u800cSkip-gram\u7684\u8f93\u5165\u4e3aapple\uff0c\u8f93\u51fa\u4e3a\uff08is,an,on,the\uff09\u3002 CBOW \u00b6 \u8f93\u5165\u5c42\uff1a\u4e0a\u4e0b\u6587\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\uff0cV \u4e3a\u8bcd\u6c47\u8868\u5355\u8bcd\u4e2a\u6570\uff0cC \u4e3a\u4e0a\u4e0b\u6587\u5355\u8bcd\u4e2a\u6570\u3002\u4ee5 \u201cThere is an apple on the table\u201d \u4e3a\u4f8b\uff0cC=4\uff0c\u6240\u4ee5\u6a21\u578b\u8f93\u5165\u662f\uff08is,an,on,the\uff094 \u4e2a\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u3002 \u521d\u59cb\u5316\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{V \\times N}\\) \uff0c\u7136\u540e\u7528\u6240\u6709\u8f93\u5165\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u5de6\u4e58\u8be5\u77e9\u9635\uff0c\u5f97\u5230\u7ef4\u6570\u4e3a N \u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \uff0c\u8fd9\u91cc\u7684 N \u7531\u81ea\u5df1\u6839\u636e\u4efb\u52a1\u9700\u8981\u8bbe\u7f6e\u3002 \u5c06\u6240\u5f97\u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \u6c42\u548c\u53d6\u5e73\u5747\u4f5c\u4e3a\u9690\u85cf\u5c42\u5411\u91cf h\u3002 \u521d\u59cb\u5316\u53e6\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{N \\times V}^\\prime\\) \uff0c\u7528\u9690\u85cf\u5c42\u5411\u91cf h \u5de6\u4e58 \\(W_{N \\times V}^\\prime\\) \uff0c\u5728\u7ecf\u6fc0\u6d3b\u51fd\u6570\u5904\u7406\u5f97\u5230 V \u7ef4\u7684\u5411\u91cf y\uff0cy \u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4ee3\u8868\u76f8\u5bf9\u5e94\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u6982\u7387\u5206\u5e03\u3002 y \u4e2d\u6982\u7387\u6700\u5927\u7684\u5143\u7d20\u6240\u6307\u793a\u7684\u5355\u8bcd\u4e3a\u9884\u6d4b\u51fa\u7684\u4e2d\u95f4\u8bcd\uff08target word\uff09\u4e0e true label \u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u505a\u6bd4\u8f83\uff0c\u8bef\u5dee\u8d8a\u5c0f\u8d8a\u597d\uff08\u6839\u636e\u8bef\u5dee\u66f4\u65b0\u4e24\u4e2a\u6743\u91cd\u77e9\u9635\uff09\u3002 \u5728\u8bad\u7ec3\u524d\u9700\u8981\u5b9a\u4e49\u597d\u635f\u5931\u51fd\u6570\uff08\u4e00\u822c\u4e3a\u4ea4\u53c9\u71b5\u4ee3\u4ef7\u51fd\u6570\uff09\uff0c\u91c7\u7528\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\u66f4\u65b0 \\(W\\) \u548c \\(W^\\prime\\) \u3002\u8bad\u7ec3\u5b8c\u6bd5\u540e\uff0c\u8f93\u5165\u5c42\u7684\u6bcf\u4e2a\u5355\u8bcd\u4e0e\u77e9\u9635 W \u76f8\u4e58\u5f97\u5230\u7684\u5411\u91cf\u5c31\u662f\u6211\u4eec\u60f3\u8981\u7684 Distributed Representation \u8868\u793a\u7684\u8bcd\u5411\u91cf\uff0c\u4e5f\u53eb word embedding\u3002\u56e0\u4e3a One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u4e2d\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u90fd\u4e3a 0\uff0c\u6240\u4ee5\u7b2c i \u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u77e9\u9635 W \u540e\uff0c\u5f97\u5230\u7684\u5c31\u662f\u77e9\u9635\u7684\u7b2c i \u884c\uff0c\u6240\u4ee5\u8fd9\u4e2a\u77e9\u9635\u4e5f\u53eb\u505a look up table\uff0c\u6709\u4e86 look up table \u5c31\u53ef\u4ee5\u514d\u53bb\u8bad\u7ec3\u8fc7\u7a0b\uff0c\u76f4\u63a5\u67e5\u8868\u5f97\u5230\u5355\u8bcd\u7684\u8bcd\u5411\u91cf\u3002 Skip-gram \u00b6 Skip-Gram \u662f\u7ed9\u5b9a input word \u6765\u9884\u6d4b\u4e0a\u4e0b\u6587\uff0c\u5176\u6a21\u578b\u7ed3\u6784\u5982\u4e0a\u56fe\u6240\u793a\u3002\u5b83\u7684\u505a\u6cd5\u662f\uff0c\u5c06\u4e00\u4e2a\u8bcd\u6240\u5728\u7684\u4e0a\u4e0b\u6587\u4e2d\u7684\u8bcd\u4f5c\u4e3a\u8f93\u51fa\uff0c\u800c\u90a3\u4e2a\u8bcd\u672c\u8eab\u4f5c\u4e3a\u8f93\u5165\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u7ed9\u51fa\u4e00\u4e2a\u8bcd\uff0c\u5e0c\u671b\u9884\u6d4b\u53ef\u80fd\u51fa\u73b0\u7684\u4e0a\u4e0b\u6587\u7684\u8bcd\u3002\u901a\u8fc7\u5728\u4e00\u4e2a\u5927\u7684\u8bed\u6599\u5e93\u8bad\u7ec3\uff0c\u5f97\u5230\u4e00\u4e2a\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u6743\u91cd\u6a21\u578b\u3002\u201capple\u201d\u7684\u4e0a\u4e0b\u6587\u8bcd\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09.\u90a3\u4e48\u4ee5apple\u7684One-Hot\u8bcd\u5411\u91cf\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u5219\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09\u7684One-Hot\u8bcd\u5411\u91cf\u3002\u8bad\u7ec3\u5b8c\u6210\u540e\uff0c\u5c31\u5f97\u5230\u4e86\u6bcf\u4e2a\u8bcd\u5230\u9690\u542b\u5c42\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u7684\u6743\u91cd\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bcd\u7684\u5411\u91cf\uff08\u548cCBOW\u4e2d\u4e00\u6837\uff09\u3002 \u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u3002 \u9996\u5148\u9009\u53e5\u5b50\u4e2d\u95f4\u7684\u4e00\u4e2a\u8bcd\u4f5c\u4e3a\u8f93\u5165\u8bcd\uff0c\u6bd4\u5982\u9009\u53d6\u201capple\u201d\u4f5c\u4e3a input word\u3002 \u6709\u4e86 input word \u4ee5\u540e\uff0c\u518d\u5b9a\u4e49\u4e00\u4e2a\u53eb\u505a skip_window \u7684\u53c2\u6570\uff0c\u5b83\u4ee3\u8868\u7740\u4ece\u5f53\u524d input word \u7684\u4e00\u4fa7\uff08\u5de6\u8fb9\u6216\u53f3\u8fb9\uff09\u9009\u53d6\u8bcd\u7684\u6570\u91cf\u3002\u5982\u679c\u8bbe\u7f6e skip_window=2\uff0c\u90a3\u4e48\u6700\u7ec8\u83b7\u5f97\u7a97\u53e3\u4e2d\u7684\u8bcd\uff08\u5305\u62ec input word \u5728\u5185\uff09\u5c31\u662f[\u2018is\u2019,\u2019an\u2019,\u2019apple\u2019,\u2019on\u2019,\u2019the\u2019 ]\u3002skip_window=2\u4ee3\u8868\u7740\u9009\u53d6\u5de6input word\u5de6\u4fa72\u4e2a\u8bcd\u548c\u53f3\u4fa72\u4e2a\u8bcd\u8fdb\u5165\u6211\u4eec\u7684\u7a97\u53e3\uff0c\u6240\u4ee5\u6574\u4e2a\u7a97\u53e3\u5927\u5c0fspan=2x2=4\u3002\u53e6\u4e00\u4e2a\u53c2\u6570\u53ebnum_skips\uff0c\u5b83\u4ee3\u8868\u7740\u6211\u4eec\u4ece\u6574\u4e2a\u7a97\u53e3\u4e2d\u9009\u53d6\u591a\u5c11\u4e2a\u4e0d\u540c\u7684\u8bcd\u4f5c\u4e3a\u6211\u4eec\u7684output word\uff0c\u5f53skip_window=2\uff0cnum_skips=2\u65f6\uff0c\u6211\u4eec\u5c06\u4f1a\u5f97\u5230\u4e24\u7ec4 (input word, output word) \u5f62\u5f0f\u7684\u8bad\u7ec3\u6570\u636e\uff0c\u5373 ('apple', 'an')\uff0c('apple', 'one')\u3002 \u795e\u7ecf\u7f51\u7edc\u57fa\u4e8e\u8fd9\u4e9b\u8bad\u7ec3\u6570\u636e\u4e2d\u6bcf\u5bf9\u5355\u8bcd\u51fa\u73b0\u7684\u6b21\u6570\u4e60\u5f97\u7edf\u8ba1\u7ed3\u679c\uff0c\u5e76\u8f93\u51fa\u4e00\u4e2a\u6982\u7387\u5206\u5e03\uff0c\u8fd9\u4e2a\u6982\u7387\u5206\u5e03\u4ee3\u8868\u7740\u5230\u6211\u4eec\u8bcd\u5178\u4e2d\u6bcf\u4e2a\u8bcd\u6709\u591a\u5927\u53ef\u80fd\u6027\u8ddfinput word\u540c\u65f6\u51fa\u73b0\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u6211\u4eec\u5411\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u4e2d\u8f93\u5165\u4e00\u4e2a\u5355\u8bcd\u201c\u4e2d\u56fd\u201c\uff0c\u90a3\u4e48\u6700\u7ec8\u6a21\u578b\u7684\u8f93\u51fa\u6982\u7387\u4e2d\uff0c\u50cf\u201c\u82f1\u56fd\u201d\uff0c \u201d\u4fc4\u7f57\u65af\u201c\u8fd9\u79cd\u76f8\u5173\u8bcd\u7684\u6982\u7387\u5c06\u8fdc\u9ad8\u4e8e\u50cf\u201d\u82f9\u679c\u201c\uff0c\u201d\u8748\u8748\u201c\u975e\u76f8\u5173\u8bcd\u7684\u6982\u7387\u3002\u56e0\u4e3a\u201d\u82f1\u56fd\u201c\uff0c\u201d\u4fc4\u7f57\u65af\u201c\u5728\u6587\u672c\u4e2d\u66f4\u5927\u53ef\u80fd\u5728\u201d\u4e2d\u56fd\u201c\u7684\u7a97\u53e3\u4e2d\u51fa\u73b0\u3002\u6211\u4eec\u5c06\u901a\u8fc7\u7ed9\u795e\u7ecf\u7f51\u7edc\u8f93\u5165\u6587\u672c\u4e2d\u6210\u5bf9\u7684\u5355\u8bcd\u6765\u8bad\u7ec3\u5b83\u5b8c\u6210\u4e0a\u9762\u6240\u8bf4\u7684\u6982\u7387\u8ba1\u7b97\u3002 \u901a\u8fc7\u68af\u5ea6\u4e0b\u964d\u548c\u53cd\u5411\u4f20\u64ad\u66f4\u65b0\u77e9\u9635 W W \u4e2d\u7684\u884c\u5411\u91cf\u5373\u4e3a\u6bcf\u4e2a\u5355\u8bcd\u7684 Word embedding \u8868\u793a \u603b\u7ed3 CBOW \u548c Skip-gram \u6700\u7406\u60f3\u60c5\u51b5\u4e0b\u7684\u5b9e\u73b0\uff0c\u5373\u8bad\u7ec3\u8fed\u4ee3\u4e24\u4e2a\u77e9\u9635 \\(W\\) \u548c \\(W^\\prime\\) \uff0c\u4e4b\u540e\u518d\u8f93\u51fa\u5c42\u91c7\u7528 softmax \u51fd\u6570\u6765\u8ba1\u7b97\u8f93\u51fa\u5404\u4e2a\u8bcd\u7684\u6982\u7387\u3002\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u8fd9\u79cd\u65b9\u6cd5\u7684\u8bad\u7ec3\u5f00\u9500\u5f88\u5927\uff0c\u4e0d\u5177\u6709\u5f88\u5f3a\u7684\u5b9e\u7528\u6027\uff0c\u4e3a\u4e86\u4f7f\u5f97\u6a21\u578b\u4fbf\u4e8e\u8bad\u7ec3\uff0c\u6709\u5b66\u8005\u63d0\u51fa\u4e86 Hierarchical Softmax \u548c Negative Sampling \u4e24\u79cd\u6539\u8fdb\u65b9\u6cd5\u3002 Hierarchical Softmax \u00b6 Hierarchical Softmax \u5bf9\u539f\u6a21\u578b\u7684\u6539\u8fdb\u4e3b\u8981\u6709\u4e24\u70b9 \u7b2c\u4e00\u70b9\u662f\u4ece\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6620\u5c04\uff0c\u6ca1\u6709\u91c7\u7528\u539f\u5148\u7684\u4e0e\u77e9\u9635 W \u76f8\u4e58\u7136\u540e\u76f8\u52a0\u6c42\u5e73\u5747\u7684\u65b9\u6cd5\uff0c\u800c\u662f\u76f4\u63a5\u5bf9\u6240\u6709\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u6c42\u548c\u3002\u5047\u8bbe\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c0\uff09\u548c\uff080\uff0c0\uff0c0\uff0c1\uff09\uff0c\u90a3\u4e48\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c1\uff09\u3002 Hierarchical Softmax \u7684\u7b2c\u4e8c\u70b9\u6539\u8fdb\u662f\u91c7\u7528\u54c8\u592b\u66fc\u6811\u6765\u66ff\u6362\u4e86\u539f\u5148\u7684\u4ece\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u77e9\u9635 \\(W^\\prime\\) \u3002\u54c8\u592b\u66fc\u6811\u7684\u53f6\u8282\u70b9\u4e2a\u6570\u4e3a\u8bcd\u6c47\u8868\u7684\u5355\u8bcd\u4e2a\u6570 V\uff0c\u4e00\u4e2a\u53f6\u8282\u70b9\u4ee3\u8868\u4e00\u4e2a\u5355\u8bcd\uff0c\u800c\u4ece\u6839\u7ed3\u70b9\u5230\u53f6\u8282\u70b9\u7684\u8def\u5f84\u786e\u5b9a\u4e86\u8fd9\u4e2a\u5355\u8bcd\u6700\u7ec8\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002 \u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u68f5\u54c8\u592b\u66fc\u6811\u9664\u4e86\u6839\u8282\u70b9\u4ee5\u5916\u7684\u6240\u6709\u975e\u53f6\u8282\u70b9\u4e2d\u90fd\u542b\u6709\u4e00\u4e2a\u7531\u53c2\u6570 \\(\\theta\\) \u786e\u5b9a\u7684 sigmoid \u51fd\u6570\uff0c\u4e0d\u540c\u8282\u70b9\u7684 \\(\\theta\\) \u4e0d\u4e00\u6837\u3002\u8bad\u7ec3\u65f6\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e0e\u8fd9\u4e2a sigmoid \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97\uff0c\u6839\u636e\u7ed3\u679c\u8fdb\u884c\u5206\u7c7b\uff0c\u82e5\u5206\u7c7b\u4e3a\u8d1f\u7c7b\u5219\u6cbf\u5de6\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 0\uff1b\u82e5\u5206\u7c7b\u4e3a\u6b63\u7c7b\u5219\u6cbf\u53f3\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 1\u3002\u6700\u7ec8\u5230\u8fbe\u53f6\u8282\u70b9\uff0c\u53f6\u8282\u70b9\u7684\u5411\u91cf\u5373\u4e3a\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002 Negative Sampling \u00b6 \u5c3d\u7ba1\u54c8\u592b\u66fc\u6811\u7684\u5f15\u5165\u4e3a\u6a21\u578b\u7684\u8bad\u7ec3\u7f29\u77ed\u4e86\u8bb8\u591a\u5f00\u9500\uff0c\u4f46\u5bf9\u4e8e\u4e00\u4e9b\u4e0d\u5e38\u89c1\u3001\u8f83\u751f\u50fb\u7684\u8bcd\u6c47\uff0c\u54c8\u592b\u66fc\u6811\u5728\u8ba1\u7b97\u5b83\u4eec\u7684\u8bcd\u5411\u91cf\u65f6\u4ecd\u7136\u9700\u8981\u505a\u5927\u91cf\u7684\u8fd0\u7b97\u3002 \u8d1f\u91c7\u6837\u662f\u53e6\u4e00\u79cd\u63d0\u9ad8 Word2Vec \u6548\u7387\u7684\u65b9\u6cd5\uff0c\u5b83\u662f\u57fa\u4e8e\u8fd9\u6837\u7684\u89c2\u5bdf\uff1a\u8bad\u7ec3\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u610f\u5473\u7740\u4f7f\u7528\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u5c31\u8981\u7a0d\u5fae\u8c03\u6574\u4e00\u4e0b\u795e\u7ecf\u7f51\u7edc\u4e2d\u6240\u6709\u7684\u6743\u91cd\uff0c\u8fd9\u6837\u624d\u80fd\u786e\u4fdd\u9884\u6d4b\u8bad\u7ec3\u6837\u672c\u66f4\u52a0\u7cbe\u786e\uff0c\u5982\u679c\u80fd\u8bbe\u8ba1\u4e00\u79cd\u65b9\u6cd5\u6bcf\u6b21\u53ea\u66f4\u65b0\u4e00\u90e8\u5206\u6743\u91cd\uff0c\u90a3\u4e48\u8ba1\u7b97\u590d\u6742\u5ea6\u5c06\u5927\u5927\u964d\u4f4e\u3002 \u5c06\u4ee5\u4e0a\u89c2\u5bdf\u5f15\u5165 Word2Vec \u5c31\u662f\uff1a\u5f53\u901a\u8fc7\uff08\u201dfox\u201d, \u201cquick\u201d\uff09\u8bcd\u5bf9\u6765\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u65f6\uff0c\u6211\u4eec\u56de\u60f3\u8d77\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\u7684\u201c\u6807\u7b7e\u201d\u6216\u8005\u662f\u201c\u6b63\u786e\u7684\u8f93\u51fa\u201d\u662f\u4e00\u4e2aone-hot\u5411\u91cf\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5bf9\u4e8e\u795e\u7ecf\u7f51\u7edc\u4e2d\u5bf9\u5e94\u4e8e\u201dquick\u201d\u8fd9\u4e2a\u5355\u8bcd\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u4e3a1\uff0c\u800c\u5176\u4ed6\u4e0a\u5343\u4e2a\u7684\u8f93\u51fa\u795e\u7ecf\u5143\u5219\u5bf9\u5e94\u4e3a0\u3002\u4f7f\u7528\u8d1f\u91c7\u6837\uff0c\u6211\u4eec\u901a\u8fc7\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u8f83\u5c11\u6570\u76ee\uff08\u6bd4\u5982\u8bf45\u4e2a\uff09\u7684\u201c\u8d1f\u201d\u6837\u672c\u6765\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\u3002\uff08\u5728\u8fd9\u4e2a\u6761\u4ef6\u4e0b\uff0c\u201c\u8d1f\u201d\u5355\u8bcd\u5c31\u662f\u6211\u4eec\u5e0c\u671b\u795e\u7ecf\u7f51\u7edc\u8f93\u51fa\u4e3a0\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u7684\u5355\u8bcd\uff09\u3002\u5e76\u4e14\u6211\u4eec\u4ecd\u7136\u4e3a\u6211\u4eec\u7684\u201c\u6b63\u201d\u5355\u8bcd\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\uff08\u4e5f\u5c31\u662f\u5f53\u524d\u6837\u672c\u4e0b\u201dquick\u201d\u5bf9\u5e94\u7684\u795e\u7ecf\u5143\u4ecd\u7136\u8f93\u51fa\u4e3a1\uff09\u3002 Reference \u00b6 Word2Vec\u8be6\u89e3 \u6df1\u5165\u6d45\u51faWord2Vec\u539f\u7406\u89e3\u6790 NLP\u4e4b\u2014\u2014Word2Vec\u8be6\u89e3","title":"Word2Vec"},{"location":"llm/nlp/word2vec/#word2vec","text":"\u7ea6 2803 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract Word2Vec \u7684\u7279\u70b9\u662f\u80fd\u591f\u5c06\u5355\u8bcd\u8f6c\u5316\u4e3a\u5411\u91cf\u6765\u8868\u793a\uff0c\u8fd9\u6837\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u5c31\u53ef\u4ee5\u5b9a\u91cf\u5730\u53bb\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95f4\u7684\u5173\u7cfb\uff0c\u6316\u6398\u8bcd\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 \u6700\u65e9\u7684\u8bcd\u5411\u91cf\u91c7\u7528 One-Hot \u7f16\u7801\uff0c\u53c8\u79f0\u4e00\u4f4d\u6709\u6548\u7f16\u7801\uff0c\u6bcf\u4e2a\u8bcd\u5411\u91cf\u7ef4\u5ea6\u5927\u5c0f\u4e3a\u6574\u4e2a\u8bcd\u6c47\u8868\u7684\u5927\u5c0f\uff0c\u5bf9\u4e8e\u6bcf\u4e2a\u5177\u4f53\u7684\u8bcd\u6c47\u8868\u4e2d\u7684\u8bcd\uff0c\u5c06\u5bf9\u5e94\u7684\u4f4d\u7f6e\u7f6e\u4e3a 1.","title":"Word2Vec"},{"location":"llm/nlp/word2vec/#word2vec_1","text":"\u91c7\u7528One-Hot\u7f16\u7801\u65b9\u5f0f\u6765\u8868\u793a\u8bcd\u5411\u91cf\u975e\u5e38\u7b80\u5355\uff0c\u4f46\u7f3a\u70b9\u4e5f\u662f\u663e\u800c\u6613\u89c1\u7684\uff0c\u4e00\u65b9\u9762\u6211\u4eec\u5b9e\u9645\u4f7f\u7528\u7684\u8bcd\u6c47\u8868\u5f88\u5927\uff0c\u7ecf\u5e38\u662f\u767e\u4e07\u7ea7\u4ee5\u4e0a\uff0c\u8fd9\u4e48\u9ad8\u7ef4\u7684\u6570\u636e\u5904\u7406\u8d77\u6765\u4f1a\u6d88\u8017\u5927\u91cf\u7684\u8ba1\u7b97\u8d44\u6e90\u4e0e\u65f6\u95f4\u3002\u53e6\u4e00\u65b9\u9762\uff0cOne-Hot\u7f16\u7801\u4e2d\u6240\u6709\u8bcd\u5411\u91cf\u4e4b\u95f4\u5f7c\u6b64\u6b63\u4ea4\uff0c\u6ca1\u6709\u4f53\u73b0\u8bcd\u4e0e\u8bcd\u4e4b\u95f4\u7684\u76f8\u4f3c\u5173\u7cfb\u3002 Distributed representation\u53ef\u4ee5\u89e3\u51b3One-Hot\u7f16\u7801\u5b58\u5728\u7684\u95ee\u9898\uff0c\u5b83\u7684\u601d\u8def\u662f\u901a\u8fc7\u8bad\u7ec3\uff0c\u5c06\u539f\u6765One-Hot\u7f16\u7801\u7684\u6bcf\u4e2a\u8bcd\u90fd\u6620\u5c04\u5230\u4e00\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u4e0a\u6765\uff0c\u800c\u8fd9\u4e2a\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\u7684\u7ef4\u5ea6\u53ef\u4ee5\u7531\u6211\u4eec\u81ea\u5df1\u5728\u8bad\u7ec3\u65f6\u6839\u636e\u4efb\u52a1\u9700\u8981\u6765\u81ea\u5df1\u6307\u5b9a\u3002 \u4e0b\u56fe\u662f\u91c7\u7528Distributed representation\u7684\u4e00\u4e2a\u4f8b\u5b50\uff0c\u6211\u4eec\u5c06\u8bcd\u6c47\u8868\u91cc\u7684\u8bcd\u7528\"Royalty\",\"Masculinity\", \"Femininity\"\u548c\"Age\"4\u4e2a\u7ef4\u5ea6\u6765\u8868\u793a\uff0cKing\u8fd9\u4e2a\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\u53ef\u80fd\u662f(0.99,0.99,0.05,0.7)\u3002\u5f53\u7136\u5728\u5b9e\u9645\u60c5\u51b5\u4e2d\uff0c\u6211\u4eec\u5e76\u4e0d\u80fd\u5bf9\u8bcd\u5411\u91cf\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u505a\u4e00\u4e2a\u5f88\u597d\u7684\u89e3\u91ca\u3002 \u6709\u4e86\u7528Distributed Representation\u8868\u793a\u7684\u8f83\u77ed\u7684\u8bcd\u5411\u91cf\uff0c\u6211\u4eec\u5c31\u53ef\u4ee5\u8f83\u5bb9\u6613\u7684\u5206\u6790\u8bcd\u4e4b\u95f4\u7684\u5173\u7cfb\u4e86\uff0c\u6bd4\u5982\u6211\u4eec\u5c06\u8bcd\u7684\u7ef4\u5ea6\u964d\u7ef4\u52302\u7ef4\uff0c\u6709\u4e00\u4e2a\u6709\u8da3\u7684\u7814\u7a76\u8868\u660e\uff0c\u7528\u4e0b\u56fe\u7684\u8bcd\u5411\u91cf\u8868\u793a\u6211\u4eec\u7684\u8bcd\u65f6\uff0c\u6211\u4eec\u53ef\u4ee5\u53d1\u73b0\uff1a \\[ \\vec{King} - \\vec{Man} + \\vec{Woman} \\approx \\vec{Queen} \\] \u53ef\u89c1\u6211\u4eec\u53ea\u8981\u5f97\u5230\u4e86\u8bcd\u6c47\u8868\u91cc\u6240\u6709\u8bcd\u5bf9\u5e94\u7684\u8bcd\u5411\u91cf\uff0c\u90a3\u4e48\u6211\u4eec\u5c31\u53ef\u4ee5\u505a\u5f88\u591a\u6709\u8da3\u7684\u4e8b\u60c5\u4e86\u3002\u4e0d\u8fc7\uff0c\u600e\u4e48\u8bad\u7ec3\u624d\u80fd\u5f97\u5230\u5408\u9002\u7684\u8bcd\u5411\u91cf\u5462\uff1f\u9488\u5bf9\u8fd9\u4e2a\u95ee\u9898\uff0cGoogle\u7684Tomas Mikolov\u5728\u4ed6\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u3002","title":"Word2Vec \u57fa\u672c\u601d\u60f3"},{"location":"llm/nlp/word2vec/#word2vec_2","text":"Word2Vec \u7684\u8bad\u7ec3\u6a21\u578b\u672c\u8d28\u4e0a\u662f\u53ea\u5177\u6709\u4e00\u4e2a\u9690\u542b\u5c42\u7684\u795e\u7ecf\u5143\u7f51\u7edc\u3002 \u5b83\u7684\u8f93\u5165\u91c7\u7528 One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\uff0c\u5b83\u7684\u8f93\u51fa\u4e5f\u662f One-Hot \u7f16\u7801\u7684\u8bcd\u6c47\u8868\u5411\u91cf\u3002\u4f7f\u7528\u6240\u6709\u7684\u6837\u672c\uff0c\u8bad\u7ec3\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\uff0c\u7b49\u5230\u6536\u655b\u4e4b\u540e\uff0c\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u90a3\u4e9b\u6743\u91cd\uff0c\u4fbf\u662f\u6bcf\u4e00\u4e2a\u8bcd\u7684\u91c7\u7528Distributed Representation\u7684\u8bcd\u5411\u91cf\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u5355\u8bcd\u7684Word embedding\u540e\u7684\u5411\u91cf\u4fbf\u662f\u77e9\u9635 \\(W_{V \\times N}\\) \u7684\u7b2ci\u884c\u7684\u8f6c\u7f6e\u3002\u8fd9\u6837\u6211\u4eec\u5c31\u628a\u539f\u672c\u7ef4\u6570\u4e3aV\u7684\u8bcd\u5411\u91cf\u53d8\u6210\u4e86\u7ef4\u6570\u4e3aN\u7684\u8bcd\u5411\u91cf\uff08N\u8fdc\u5c0f\u4e8eV\uff09\uff0c\u5e76\u4e14\u8bcd\u5411\u91cf\u95f4\u4fdd\u7559\u4e86\u4e00\u5b9a\u7684\u76f8\u5173\u5173\u7cfb\u3002 Google\u7684Mikolov\u5728\u5173\u4e8eWord2Vec\u7684\u8bba\u6587\u4e2d\u63d0\u51fa\u4e86CBOW\u548cSkip-gram\u4e24\u79cd\u6a21\u578b\uff0cCBOW\u9002\u5408\u4e8e\u6570\u636e\u96c6\u8f83\u5c0f\u7684\u60c5\u51b5\uff0c\u800cSkip-Gram\u5728\u5927\u578b\u8bed\u6599\u4e2d\u8868\u73b0\u66f4\u597d\u3002\u5176\u4e2dCBOW\u5982\u4e0b\u56fe\u5de6\u90e8\u5206\u6240\u793a\uff0c\u4f7f\u7528\u56f4\u7ed5\u76ee\u6807\u5355\u8bcd\u7684\u5176\u4ed6\u5355\u8bcd\uff08\u8bed\u5883\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u5728\u6620\u5c04\u5c42\u505a\u52a0\u6743\u5904\u7406\u540e\u8f93\u51fa\u76ee\u6807\u5355\u8bcd\u3002\u4e0eCBOW\u6839\u636e\u8bed\u5883\u9884\u6d4b\u76ee\u6807\u5355\u8bcd\u4e0d\u540c\uff0cSkip-gram\u6839\u636e\u5f53\u524d\u5355\u8bcd\u9884\u6d4b\u8bed\u5883\uff0c\u5982\u4e0b\u56fe\u53f3\u90e8\u5206\u6240\u793a\u3002\u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u4f5c\u4e3a\u8bad\u7ec3\u6570\u636e\uff0cCBOW\u7684\u8f93\u5165\u4e3a\uff08is,an,on,the\uff09\uff0c\u8f93\u51fa\u4e3aapple\u3002\u800cSkip-gram\u7684\u8f93\u5165\u4e3aapple\uff0c\u8f93\u51fa\u4e3a\uff08is,an,on,the\uff09\u3002","title":"Word2Vec \u539f\u7406"},{"location":"llm/nlp/word2vec/#cbow","text":"\u8f93\u5165\u5c42\uff1a\u4e0a\u4e0b\u6587\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\uff0cV \u4e3a\u8bcd\u6c47\u8868\u5355\u8bcd\u4e2a\u6570\uff0cC \u4e3a\u4e0a\u4e0b\u6587\u5355\u8bcd\u4e2a\u6570\u3002\u4ee5 \u201cThere is an apple on the table\u201d \u4e3a\u4f8b\uff0cC=4\uff0c\u6240\u4ee5\u6a21\u578b\u8f93\u5165\u662f\uff08is,an,on,the\uff094 \u4e2a\u5355\u8bcd\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u3002 \u521d\u59cb\u5316\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{V \\times N}\\) \uff0c\u7136\u540e\u7528\u6240\u6709\u8f93\u5165\u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u5de6\u4e58\u8be5\u77e9\u9635\uff0c\u5f97\u5230\u7ef4\u6570\u4e3a N \u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \uff0c\u8fd9\u91cc\u7684 N \u7531\u81ea\u5df1\u6839\u636e\u4efb\u52a1\u9700\u8981\u8bbe\u7f6e\u3002 \u5c06\u6240\u5f97\u7684\u5411\u91cf \\(w_1,w_2,...,w_c\\) \u6c42\u548c\u53d6\u5e73\u5747\u4f5c\u4e3a\u9690\u85cf\u5c42\u5411\u91cf h\u3002 \u521d\u59cb\u5316\u53e6\u4e00\u4e2a\u6743\u91cd\u77e9\u9635 \\(W_{N \\times V}^\\prime\\) \uff0c\u7528\u9690\u85cf\u5c42\u5411\u91cf h \u5de6\u4e58 \\(W_{N \\times V}^\\prime\\) \uff0c\u5728\u7ecf\u6fc0\u6d3b\u51fd\u6570\u5904\u7406\u5f97\u5230 V \u7ef4\u7684\u5411\u91cf y\uff0cy \u7684\u6bcf\u4e00\u4e2a\u5143\u7d20\u4ee3\u8868\u76f8\u5bf9\u5e94\u7684\u6bcf\u4e2a\u5355\u8bcd\u7684\u6982\u7387\u5206\u5e03\u3002 y \u4e2d\u6982\u7387\u6700\u5927\u7684\u5143\u7d20\u6240\u6307\u793a\u7684\u5355\u8bcd\u4e3a\u9884\u6d4b\u51fa\u7684\u4e2d\u95f4\u8bcd\uff08target word\uff09\u4e0e true label \u7684 One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u505a\u6bd4\u8f83\uff0c\u8bef\u5dee\u8d8a\u5c0f\u8d8a\u597d\uff08\u6839\u636e\u8bef\u5dee\u66f4\u65b0\u4e24\u4e2a\u6743\u91cd\u77e9\u9635\uff09\u3002 \u5728\u8bad\u7ec3\u524d\u9700\u8981\u5b9a\u4e49\u597d\u635f\u5931\u51fd\u6570\uff08\u4e00\u822c\u4e3a\u4ea4\u53c9\u71b5\u4ee3\u4ef7\u51fd\u6570\uff09\uff0c\u91c7\u7528\u68af\u5ea6\u4e0b\u964d\u7b97\u6cd5\u66f4\u65b0 \\(W\\) \u548c \\(W^\\prime\\) \u3002\u8bad\u7ec3\u5b8c\u6bd5\u540e\uff0c\u8f93\u5165\u5c42\u7684\u6bcf\u4e2a\u5355\u8bcd\u4e0e\u77e9\u9635 W \u76f8\u4e58\u5f97\u5230\u7684\u5411\u91cf\u5c31\u662f\u6211\u4eec\u60f3\u8981\u7684 Distributed Representation \u8868\u793a\u7684\u8bcd\u5411\u91cf\uff0c\u4e5f\u53eb word embedding\u3002\u56e0\u4e3a One-Hot \u7f16\u7801\u8bcd\u5411\u91cf\u4e2d\u53ea\u6709\u4e00\u4e2a\u5143\u7d20\u4e3a 1\uff0c\u5176\u4ed6\u90fd\u4e3a 0\uff0c\u6240\u4ee5\u7b2c i \u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u77e9\u9635 W \u540e\uff0c\u5f97\u5230\u7684\u5c31\u662f\u77e9\u9635\u7684\u7b2c i \u884c\uff0c\u6240\u4ee5\u8fd9\u4e2a\u77e9\u9635\u4e5f\u53eb\u505a look up table\uff0c\u6709\u4e86 look up table \u5c31\u53ef\u4ee5\u514d\u53bb\u8bad\u7ec3\u8fc7\u7a0b\uff0c\u76f4\u63a5\u67e5\u8868\u5f97\u5230\u5355\u8bcd\u7684\u8bcd\u5411\u91cf\u3002","title":"CBOW"},{"location":"llm/nlp/word2vec/#skip-gram","text":"Skip-Gram \u662f\u7ed9\u5b9a input word \u6765\u9884\u6d4b\u4e0a\u4e0b\u6587\uff0c\u5176\u6a21\u578b\u7ed3\u6784\u5982\u4e0a\u56fe\u6240\u793a\u3002\u5b83\u7684\u505a\u6cd5\u662f\uff0c\u5c06\u4e00\u4e2a\u8bcd\u6240\u5728\u7684\u4e0a\u4e0b\u6587\u4e2d\u7684\u8bcd\u4f5c\u4e3a\u8f93\u51fa\uff0c\u800c\u90a3\u4e2a\u8bcd\u672c\u8eab\u4f5c\u4e3a\u8f93\u5165\uff0c\u4e5f\u5c31\u662f\u8bf4\uff0c\u7ed9\u51fa\u4e00\u4e2a\u8bcd\uff0c\u5e0c\u671b\u9884\u6d4b\u53ef\u80fd\u51fa\u73b0\u7684\u4e0a\u4e0b\u6587\u7684\u8bcd\u3002\u901a\u8fc7\u5728\u4e00\u4e2a\u5927\u7684\u8bed\u6599\u5e93\u8bad\u7ec3\uff0c\u5f97\u5230\u4e00\u4e2a\u4ece\u8f93\u5165\u5c42\u5230\u9690\u542b\u5c42\u7684\u6743\u91cd\u6a21\u578b\u3002\u201capple\u201d\u7684\u4e0a\u4e0b\u6587\u8bcd\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09.\u90a3\u4e48\u4ee5apple\u7684One-Hot\u8bcd\u5411\u91cf\u4f5c\u4e3a\u8f93\u5165\uff0c\u8f93\u51fa\u5219\u662f\uff08\u2019there\u2019\uff0c\u2019is\u2019\uff0c\u2019an\u2019\uff0c\u2019on\u2019,\u2019the\u2019,\u2019table\u2019\uff09\u7684One-Hot\u8bcd\u5411\u91cf\u3002\u8bad\u7ec3\u5b8c\u6210\u540e\uff0c\u5c31\u5f97\u5230\u4e86\u6bcf\u4e2a\u8bcd\u5230\u9690\u542b\u5c42\u7684\u6bcf\u4e2a\u7ef4\u5ea6\u7684\u6743\u91cd\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bcd\u7684\u5411\u91cf\uff08\u548cCBOW\u4e2d\u4e00\u6837\uff09\u3002 \u5047\u5982\u6211\u4eec\u6709\u4e00\u4e2a\u53e5\u5b50\u201cThere is an apple on the table\u201d\u3002 \u9996\u5148\u9009\u53e5\u5b50\u4e2d\u95f4\u7684\u4e00\u4e2a\u8bcd\u4f5c\u4e3a\u8f93\u5165\u8bcd\uff0c\u6bd4\u5982\u9009\u53d6\u201capple\u201d\u4f5c\u4e3a input word\u3002 \u6709\u4e86 input word \u4ee5\u540e\uff0c\u518d\u5b9a\u4e49\u4e00\u4e2a\u53eb\u505a skip_window \u7684\u53c2\u6570\uff0c\u5b83\u4ee3\u8868\u7740\u4ece\u5f53\u524d input word \u7684\u4e00\u4fa7\uff08\u5de6\u8fb9\u6216\u53f3\u8fb9\uff09\u9009\u53d6\u8bcd\u7684\u6570\u91cf\u3002\u5982\u679c\u8bbe\u7f6e skip_window=2\uff0c\u90a3\u4e48\u6700\u7ec8\u83b7\u5f97\u7a97\u53e3\u4e2d\u7684\u8bcd\uff08\u5305\u62ec input word \u5728\u5185\uff09\u5c31\u662f[\u2018is\u2019,\u2019an\u2019,\u2019apple\u2019,\u2019on\u2019,\u2019the\u2019 ]\u3002skip_window=2\u4ee3\u8868\u7740\u9009\u53d6\u5de6input word\u5de6\u4fa72\u4e2a\u8bcd\u548c\u53f3\u4fa72\u4e2a\u8bcd\u8fdb\u5165\u6211\u4eec\u7684\u7a97\u53e3\uff0c\u6240\u4ee5\u6574\u4e2a\u7a97\u53e3\u5927\u5c0fspan=2x2=4\u3002\u53e6\u4e00\u4e2a\u53c2\u6570\u53ebnum_skips\uff0c\u5b83\u4ee3\u8868\u7740\u6211\u4eec\u4ece\u6574\u4e2a\u7a97\u53e3\u4e2d\u9009\u53d6\u591a\u5c11\u4e2a\u4e0d\u540c\u7684\u8bcd\u4f5c\u4e3a\u6211\u4eec\u7684output word\uff0c\u5f53skip_window=2\uff0cnum_skips=2\u65f6\uff0c\u6211\u4eec\u5c06\u4f1a\u5f97\u5230\u4e24\u7ec4 (input word, output word) \u5f62\u5f0f\u7684\u8bad\u7ec3\u6570\u636e\uff0c\u5373 ('apple', 'an')\uff0c('apple', 'one')\u3002 \u795e\u7ecf\u7f51\u7edc\u57fa\u4e8e\u8fd9\u4e9b\u8bad\u7ec3\u6570\u636e\u4e2d\u6bcf\u5bf9\u5355\u8bcd\u51fa\u73b0\u7684\u6b21\u6570\u4e60\u5f97\u7edf\u8ba1\u7ed3\u679c\uff0c\u5e76\u8f93\u51fa\u4e00\u4e2a\u6982\u7387\u5206\u5e03\uff0c\u8fd9\u4e2a\u6982\u7387\u5206\u5e03\u4ee3\u8868\u7740\u5230\u6211\u4eec\u8bcd\u5178\u4e2d\u6bcf\u4e2a\u8bcd\u6709\u591a\u5927\u53ef\u80fd\u6027\u8ddfinput word\u540c\u65f6\u51fa\u73b0\u3002\u4e3e\u4e2a\u4f8b\u5b50\uff0c\u5982\u679c\u6211\u4eec\u5411\u795e\u7ecf\u7f51\u7edc\u6a21\u578b\u4e2d\u8f93\u5165\u4e00\u4e2a\u5355\u8bcd\u201c\u4e2d\u56fd\u201c\uff0c\u90a3\u4e48\u6700\u7ec8\u6a21\u578b\u7684\u8f93\u51fa\u6982\u7387\u4e2d\uff0c\u50cf\u201c\u82f1\u56fd\u201d\uff0c \u201d\u4fc4\u7f57\u65af\u201c\u8fd9\u79cd\u76f8\u5173\u8bcd\u7684\u6982\u7387\u5c06\u8fdc\u9ad8\u4e8e\u50cf\u201d\u82f9\u679c\u201c\uff0c\u201d\u8748\u8748\u201c\u975e\u76f8\u5173\u8bcd\u7684\u6982\u7387\u3002\u56e0\u4e3a\u201d\u82f1\u56fd\u201c\uff0c\u201d\u4fc4\u7f57\u65af\u201c\u5728\u6587\u672c\u4e2d\u66f4\u5927\u53ef\u80fd\u5728\u201d\u4e2d\u56fd\u201c\u7684\u7a97\u53e3\u4e2d\u51fa\u73b0\u3002\u6211\u4eec\u5c06\u901a\u8fc7\u7ed9\u795e\u7ecf\u7f51\u7edc\u8f93\u5165\u6587\u672c\u4e2d\u6210\u5bf9\u7684\u5355\u8bcd\u6765\u8bad\u7ec3\u5b83\u5b8c\u6210\u4e0a\u9762\u6240\u8bf4\u7684\u6982\u7387\u8ba1\u7b97\u3002 \u901a\u8fc7\u68af\u5ea6\u4e0b\u964d\u548c\u53cd\u5411\u4f20\u64ad\u66f4\u65b0\u77e9\u9635 W W \u4e2d\u7684\u884c\u5411\u91cf\u5373\u4e3a\u6bcf\u4e2a\u5355\u8bcd\u7684 Word embedding \u8868\u793a \u603b\u7ed3 CBOW \u548c Skip-gram \u6700\u7406\u60f3\u60c5\u51b5\u4e0b\u7684\u5b9e\u73b0\uff0c\u5373\u8bad\u7ec3\u8fed\u4ee3\u4e24\u4e2a\u77e9\u9635 \\(W\\) \u548c \\(W^\\prime\\) \uff0c\u4e4b\u540e\u518d\u8f93\u51fa\u5c42\u91c7\u7528 softmax \u51fd\u6570\u6765\u8ba1\u7b97\u8f93\u51fa\u5404\u4e2a\u8bcd\u7684\u6982\u7387\u3002\u4f46\u5728\u5b9e\u9645\u5e94\u7528\u4e2d\u8fd9\u79cd\u65b9\u6cd5\u7684\u8bad\u7ec3\u5f00\u9500\u5f88\u5927\uff0c\u4e0d\u5177\u6709\u5f88\u5f3a\u7684\u5b9e\u7528\u6027\uff0c\u4e3a\u4e86\u4f7f\u5f97\u6a21\u578b\u4fbf\u4e8e\u8bad\u7ec3\uff0c\u6709\u5b66\u8005\u63d0\u51fa\u4e86 Hierarchical Softmax \u548c Negative Sampling \u4e24\u79cd\u6539\u8fdb\u65b9\u6cd5\u3002","title":"Skip-gram"},{"location":"llm/nlp/word2vec/#hierarchical-softmax","text":"Hierarchical Softmax \u5bf9\u539f\u6a21\u578b\u7684\u6539\u8fdb\u4e3b\u8981\u6709\u4e24\u70b9 \u7b2c\u4e00\u70b9\u662f\u4ece\u8f93\u5165\u5c42\u5230\u9690\u85cf\u5c42\u7684\u6620\u5c04\uff0c\u6ca1\u6709\u91c7\u7528\u539f\u5148\u7684\u4e0e\u77e9\u9635 W \u76f8\u4e58\u7136\u540e\u76f8\u52a0\u6c42\u5e73\u5747\u7684\u65b9\u6cd5\uff0c\u800c\u662f\u76f4\u63a5\u5bf9\u6240\u6709\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u6c42\u548c\u3002\u5047\u8bbe\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c0\uff09\u548c\uff080\uff0c0\uff0c0\uff0c1\uff09\uff0c\u90a3\u4e48\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e3a\uff080\uff0c1\uff0c0\uff0c1\uff09\u3002 Hierarchical Softmax \u7684\u7b2c\u4e8c\u70b9\u6539\u8fdb\u662f\u91c7\u7528\u54c8\u592b\u66fc\u6811\u6765\u66ff\u6362\u4e86\u539f\u5148\u7684\u4ece\u9690\u85cf\u5c42\u5230\u8f93\u51fa\u5c42\u7684\u77e9\u9635 \\(W^\\prime\\) \u3002\u54c8\u592b\u66fc\u6811\u7684\u53f6\u8282\u70b9\u4e2a\u6570\u4e3a\u8bcd\u6c47\u8868\u7684\u5355\u8bcd\u4e2a\u6570 V\uff0c\u4e00\u4e2a\u53f6\u8282\u70b9\u4ee3\u8868\u4e00\u4e2a\u5355\u8bcd\uff0c\u800c\u4ece\u6839\u7ed3\u70b9\u5230\u53f6\u8282\u70b9\u7684\u8def\u5f84\u786e\u5b9a\u4e86\u8fd9\u4e2a\u5355\u8bcd\u6700\u7ec8\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002 \u5177\u4f53\u6765\u8bf4\uff0c\u8fd9\u68f5\u54c8\u592b\u66fc\u6811\u9664\u4e86\u6839\u8282\u70b9\u4ee5\u5916\u7684\u6240\u6709\u975e\u53f6\u8282\u70b9\u4e2d\u90fd\u542b\u6709\u4e00\u4e2a\u7531\u53c2\u6570 \\(\\theta\\) \u786e\u5b9a\u7684 sigmoid \u51fd\u6570\uff0c\u4e0d\u540c\u8282\u70b9\u7684 \\(\\theta\\) \u4e0d\u4e00\u6837\u3002\u8bad\u7ec3\u65f6\u9690\u85cf\u5c42\u7684\u5411\u91cf\u4e0e\u8fd9\u4e2a sigmoid \u51fd\u6570\u8fdb\u884c\u8fd0\u7b97\uff0c\u6839\u636e\u7ed3\u679c\u8fdb\u884c\u5206\u7c7b\uff0c\u82e5\u5206\u7c7b\u4e3a\u8d1f\u7c7b\u5219\u6cbf\u5de6\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 0\uff1b\u82e5\u5206\u7c7b\u4e3a\u6b63\u7c7b\u5219\u6cbf\u53f3\u5b50\u6811\u5411\u4e0b\u4f20\u9012\uff0c\u7f16\u7801\u4e3a 1\u3002\u6700\u7ec8\u5230\u8fbe\u53f6\u8282\u70b9\uff0c\u53f6\u8282\u70b9\u7684\u5411\u91cf\u5373\u4e3a\u8f93\u51fa\u7684\u8bcd\u5411\u91cf\u3002","title":"Hierarchical Softmax"},{"location":"llm/nlp/word2vec/#negative-sampling","text":"\u5c3d\u7ba1\u54c8\u592b\u66fc\u6811\u7684\u5f15\u5165\u4e3a\u6a21\u578b\u7684\u8bad\u7ec3\u7f29\u77ed\u4e86\u8bb8\u591a\u5f00\u9500\uff0c\u4f46\u5bf9\u4e8e\u4e00\u4e9b\u4e0d\u5e38\u89c1\u3001\u8f83\u751f\u50fb\u7684\u8bcd\u6c47\uff0c\u54c8\u592b\u66fc\u6811\u5728\u8ba1\u7b97\u5b83\u4eec\u7684\u8bcd\u5411\u91cf\u65f6\u4ecd\u7136\u9700\u8981\u505a\u5927\u91cf\u7684\u8fd0\u7b97\u3002 \u8d1f\u91c7\u6837\u662f\u53e6\u4e00\u79cd\u63d0\u9ad8 Word2Vec \u6548\u7387\u7684\u65b9\u6cd5\uff0c\u5b83\u662f\u57fa\u4e8e\u8fd9\u6837\u7684\u89c2\u5bdf\uff1a\u8bad\u7ec3\u4e00\u4e2a\u795e\u7ecf\u7f51\u7edc\u610f\u5473\u7740\u4f7f\u7528\u4e00\u4e2a\u8bad\u7ec3\u6837\u672c\u5c31\u8981\u7a0d\u5fae\u8c03\u6574\u4e00\u4e0b\u795e\u7ecf\u7f51\u7edc\u4e2d\u6240\u6709\u7684\u6743\u91cd\uff0c\u8fd9\u6837\u624d\u80fd\u786e\u4fdd\u9884\u6d4b\u8bad\u7ec3\u6837\u672c\u66f4\u52a0\u7cbe\u786e\uff0c\u5982\u679c\u80fd\u8bbe\u8ba1\u4e00\u79cd\u65b9\u6cd5\u6bcf\u6b21\u53ea\u66f4\u65b0\u4e00\u90e8\u5206\u6743\u91cd\uff0c\u90a3\u4e48\u8ba1\u7b97\u590d\u6742\u5ea6\u5c06\u5927\u5927\u964d\u4f4e\u3002 \u5c06\u4ee5\u4e0a\u89c2\u5bdf\u5f15\u5165 Word2Vec \u5c31\u662f\uff1a\u5f53\u901a\u8fc7\uff08\u201dfox\u201d, \u201cquick\u201d\uff09\u8bcd\u5bf9\u6765\u8bad\u7ec3\u795e\u7ecf\u7f51\u7edc\u65f6\uff0c\u6211\u4eec\u56de\u60f3\u8d77\u8fd9\u4e2a\u795e\u7ecf\u7f51\u7edc\u7684\u201c\u6807\u7b7e\u201d\u6216\u8005\u662f\u201c\u6b63\u786e\u7684\u8f93\u51fa\u201d\u662f\u4e00\u4e2aone-hot\u5411\u91cf\u3002\u4e5f\u5c31\u662f\u8bf4\uff0c\u5bf9\u4e8e\u795e\u7ecf\u7f51\u7edc\u4e2d\u5bf9\u5e94\u4e8e\u201dquick\u201d\u8fd9\u4e2a\u5355\u8bcd\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u4e3a1\uff0c\u800c\u5176\u4ed6\u4e0a\u5343\u4e2a\u7684\u8f93\u51fa\u795e\u7ecf\u5143\u5219\u5bf9\u5e94\u4e3a0\u3002\u4f7f\u7528\u8d1f\u91c7\u6837\uff0c\u6211\u4eec\u901a\u8fc7\u968f\u673a\u9009\u62e9\u4e00\u4e2a\u8f83\u5c11\u6570\u76ee\uff08\u6bd4\u5982\u8bf45\u4e2a\uff09\u7684\u201c\u8d1f\u201d\u6837\u672c\u6765\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\u3002\uff08\u5728\u8fd9\u4e2a\u6761\u4ef6\u4e0b\uff0c\u201c\u8d1f\u201d\u5355\u8bcd\u5c31\u662f\u6211\u4eec\u5e0c\u671b\u795e\u7ecf\u7f51\u7edc\u8f93\u51fa\u4e3a0\u7684\u795e\u7ecf\u5143\u5bf9\u5e94\u7684\u5355\u8bcd\uff09\u3002\u5e76\u4e14\u6211\u4eec\u4ecd\u7136\u4e3a\u6211\u4eec\u7684\u201c\u6b63\u201d\u5355\u8bcd\u66f4\u65b0\u5bf9\u5e94\u7684\u6743\u91cd\uff08\u4e5f\u5c31\u662f\u5f53\u524d\u6837\u672c\u4e0b\u201dquick\u201d\u5bf9\u5e94\u7684\u795e\u7ecf\u5143\u4ecd\u7136\u8f93\u51fa\u4e3a1\uff09\u3002","title":"Negative Sampling"},{"location":"llm/nlp/word2vec/#reference","text":"Word2Vec\u8be6\u89e3 \u6df1\u5165\u6d45\u51faWord2Vec\u539f\u7406\u89e3\u6790 NLP\u4e4b\u2014\u2014Word2Vec\u8be6\u89e3","title":"Reference"},{"location":"llm/others/dt/","text":"\u5206\u5e03\u5f0f\u8bad\u7ec3 \u00b6 \u7ea6 1632 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u4ecb\u7ecd\u4e86\u5206\u5e03\u5f0f\u8bad\u7ec3\u7684\u80cc\u666f\u548c\u5e38\u89c1\u7684 4 \u79cd\u5e76\u884c\u7b56\u7565 learn from OneFlow/docs \u4e3a\u4ec0\u4e48\u5206\u5e03\u5f0f\u8bad\u7ec3\u8d8a\u6765\u8d8a\u6d41\u884c \u00b6 \u8fd1\u5e74\u6765\uff0c\u6df1\u5ea6\u5b66\u4e60\u88ab\u5e7f\u6cdb\u5e94\u7528\u5230\u5404\u4e2a\u9886\u57df\uff0c\u5305\u62ec\u8ba1\u7b97\u673a\u89c6\u89c9\u3001\u8bed\u8a00\u7406\u89e3\u3001\u8bed\u97f3\u8bc6\u522b\u3001\u5e7f\u544a\u63a8\u8350\u7b49\u3002\u5728\u8fd9\u4e9b\u4e0d\u540c\u7684\u9886\u57df\u4e2d\uff0c\u4e00\u4e2a\u5171\u540c\u7684\u7279\u70b9\u5c31\u662f\u6a21\u578b\u89c4\u6a21\u8d8a\u6765\u8d8a\u5927\uff0c\u6bd4\u5982 GPT-3 \u6a21\u578b\u7684\u53c2\u6570\u91cf\u8fbe\u52301750\u4ebf\u3002\u5373\u4f7f\u75281024\u5f20 80 GB \u7684 A100\uff0c\u90a3\u4e48\u5b8c\u6574\u8bad\u7ec3 GPT-3 \u7684\u65f6\u957f\u90fd\u9700\u89811\u4e2a\u6708\u3002 \u6a21\u578b\u89c4\u6a21\u7684\u6269\u5927\uff0c\u5bf9\u786c\u4ef6\uff08\u7b97\u529b\u3001\u5185\u5b58\uff09\u7684\u53d1\u5c55\u63d0\u51fa\u8981\u6c42\u3002\u7136\u800c\uff0c\u56e0\u4e3a \u5185\u5b58\u5899 \u7684\u5b58\u5728\uff0c\u5355\u4e00\u8bbe\u5907\u7684\u7b97\u529b\u53ca\u5bb9\u91cf\uff0c\u53d7\u9650\u4e8e\u7269\u7406\u5b9a\u5f8b\uff0c\u6301\u7eed\u63d0\u9ad8\u82af\u7247\u7684\u96c6\u6210\u8d8a\u6765\u8d8a\u56f0\u96be\uff0c\u96be\u4ee5\u8ddf\u4e0a\u6a21\u578b\u6269\u5927\u7684\u9700\u6c42\u3002 \u4e3a\u4e86\u89e3\u51b3\u7b97\u529b\u589e\u901f\u4e0d\u8db3\u7684\u95ee\u9898\uff0c\u4eba\u4eec\u8003\u8651\u7528\u591a\u8282\u70b9\u96c6\u7fa4\u8fdb\u884c\u5206\u5e03\u5f0f\u8bad\u7ec3\uff0c\u4ee5\u63d0\u5347\u7b97\u529b\uff0c\u5206\u5e03\u5f0f\u8bad\u7ec3\u52bf\u5728\u5fc5\u884c\u3002 \u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565 \u00b6 \u7b80\u5355\u7684\u673a\u5668\u5806\u53e0\u5e76\u4e0d\u4e00\u5b9a\u4f1a\u5e26\u6765\u7b97\u529b\u7684\u589e\u957f\u3002\u56e0\u4e3a\u795e\u7ecf\u7f51\u7edc\u7684\u8bad\u7ec3\u5e76\u4e0d\u662f\u5355\u7eaf\u7684\u201c\u628a\u539f\u6765\u4e00\u4e2a\u8bbe\u5907\u505a\u7684\u4e8b\u60c5\uff0c\u73b0\u5728\u5206\u7ed9\u591a\u4e2a\u8bbe\u5907\u5404\u81ea\u505a\u201d\uff0c\u5b83\u4e0d\u4ec5\u9700\u8981\u591a\u4e2a\u8bbe\u5907\u8fdb\u884c\u8ba1\u7b97\uff0c\u8fd8\u6d89\u53ca\u5230\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u53ea\u6709\u534f\u8c03\u597d\u96c6\u7fa4\u4e2d\u7684\u8ba1\u7b97\u4e0e\u901a\u4fe1\uff0c\u624d\u80fd\u505a\u9ad8\u6548\u7684\u5206\u5e03\u5f0f\u8bad\u7ec3\u3002 \u6211\u4eec\u5c06\u4ee5\u77e9\u9635\u4e58\u6cd5\u7684\u4f8b\u5b50\uff0c\u89e3\u91ca\u6570\u636e\u5e76\u884c\u3001\u6a21\u578b\u5e76\u884c\u7684\u533a\u522b\u3002 \u5148\u4e86\u89e3\u4ee5\u4e0b\u903b\u8f91\u4e0a\u7684\u77e9\u9635\u4e58\u6cd5\u4f8b\u5b50: \u5047\u8bbe\u795e\u7ecf\u7f51\u7edc\u4e2d\u67d0\u4e00\u5c42\u662f\u505a\u77e9\u9635\u4e58\u6cd5\uff0c\u5176\u4e2d\u7684\u8f93\u5165 \\(x\\) \u7684\u5f62\u72b6\u4e3a \\(4\\times5\\) \uff0c\u6a21\u578b\u53c2\u6570 \\(w\\) \u7684\u5f62\u72b6\u4e3a \\(5\\times8\\) \uff0c\u90a3\u4e48\uff0c\u77e9\u9635\u4e58\u6cd5\u8f93\u51fa\u5f62\u72b6\u4e3a \\(4\\times8\\) \u3002\u793a\u610f\u56fe\u5982\u4e0b\uff1a \u5355\u673a\u5355\u5361\u7684\u8bad\u7ec3\u4e2d\uff0c\u4ee5\u4e0a\u77e9\u9635\u4e58\u6cd5\uff0c\u5148\u8ba1\u7b97\u5f97\u5230 \\(out\\) \uff0c\u5e76\u5c06 \\(out\\) \u4f20\u9012\u7ed9\u4e0b\u4e00\u5c42\uff0c\u5e76\u6700\u7ec8\u8ba1\u7b97\u5f97\u5230 \\(loss\\) \uff0c\u7136\u540e\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u5f97\u5230 \\(\\frac{\\partial loss}{\\partial w}\\) \uff0c\u7528\u4e8e\u66f4\u65b0 \\(w\\) \u3002 \u5206\u5e03\u5f0f\u8bad\u7ec3\u4e2d\uff0c\u4f9d\u636e\u662f\u5207\u5206 \\(x\\) \u8fd8\u662f \\(w\\) \u7684\u4e0d\u540c\uff0c\u5206\u4e3a\u201c\u6570\u636e\u5e76\u884c\u201d\u548c\u201c\u6a21\u578b\u5e76\u884c\u201d\u7b56\u7565\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4ecb\u7ecd\u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565\u3002 \u6570\u636e\u5e76\u884c \u00b6 \u6240\u8c13\u7684\u6570\u636e\u5e76\u884c\uff0c\u5c31\u662f\u5c06\u6570\u636e \\(x\\) \u8fdb\u884c\u5207\u5206\uff0c\u800c\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b \\(w\\) \u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(x\\) \u88ab\u6309\u7167\u7b2c0\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(w\\) \u3002 \u8fd9\u6837\uff0c\u5728\u4e24\u53f0\u8bbe\u5907\u4e0a\uff0c\u5206\u522b\u5f97\u5230\u7684\u8f93\u51fa\uff0c\u90fd\u53ea\u662f\u903b\u8f91\u4e0a\u8f93\u51fa\u7684\u4e00\u534a\uff08\u5f62\u72b6\u4e3a \\(2\\times8\\) \uff09\uff0c\u5c06\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u62fc\u63a5\u5230\u4e00\u8d77\uff0c\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u5b8c\u6574\u7684\u8f93\u51fa\u3002 \u6ce8\u610f\uff0c\u56e0\u4e3a\u6570\u636e\u88ab\u5206\u53d1\u5230\u4e862\u4e2a\u8bbe\u5907\u4e0a\uff0c\u56e0\u6b64\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\uff0c\u5404\u81ea\u8bbe\u5907\u4e0a\u5f97\u5230\u7684 \\(\\frac{\\partial loss}{\\partial w}\\) \u4f1a\u4e0d\u4e00\u6837\uff0c\u5982\u679c\u76f4\u63a5\u4f7f\u7528\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u66f4\u65b0\u5404\u81ea\u7684\u6a21\u578b\uff0c\u4f1a\u9020\u62102\u4e2a\u8bbe\u5907\u4e0a\u7684 \u6a21\u578b\u4e0d\u4e00\u81f4 \uff0c\u8bad\u7ec3\u5c31\u5931\u53bb\u4e86\u610f\u4e49\uff08\u5230\u5e95\u7528\u54ea\u4e2a\u6a21\u578b\u597d\u5462\uff1f\uff09\u3002 \u56e0\u6b64\uff0c\u6570\u636e\u5e76\u884c\u7b56\u7565\u4e0b\uff0c\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u5bf9\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u8fdb\u884c AllReduce \uff0c\u4ee5\u786e\u4fdd\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u59cb\u7ec8\u4fdd\u6301\u4e00\u81f4\u3002 \u5f53\u6570\u636e\u96c6\u8f83\u5927\uff0c\u6a21\u578b\u8f83\u5c0f\u65f6\uff0c\u7531\u4e8e\u53cd\u5411\u8fc7\u7a0b\u4e2d\u4e3a\u540c\u6b65\u68af\u5ea6\u4ea7\u751f\u7684\u901a\u4fe1\u4ee3\u4ef7\u8f83\u5c0f\uff0c\u6b64\u65f6\u9009\u62e9\u6570\u636e\u5e76\u884c\u4e00\u822c\u6bd4\u8f83\u6709\u4f18\u52bf\uff0c\u5e38\u89c1\u7684\u89c6\u89c9\u5206\u7c7b\u6a21\u578b\uff0c\u5982 ResNet50\uff0c\u6bd4\u8f83\u9002\u5408\u91c7\u7528\u6570\u636e\u5e76\u884c\u3002 \u6a21\u578b\u5e76\u884c \u00b6 \u5f53\u795e\u7ecf\u7f51\u7edc\u975e\u5e38\u5de8\u5927\uff0c\u6570\u636e\u5e76\u884c\u540c\u6b65\u68af\u5ea6\u7684\u4ee3\u4ef7\u5c31\u4f1a\u5f88\u5927\uff0c\u751a\u81f3\u7f51\u7edc\u53ef\u80fd\u5de8\u5927\u5230\u65e0\u6cd5\u5b58\u653e\u5230\u5355\u4e00\u8ba1\u7b97\u8bbe\u5907\u4e2d\uff0c\u8fd9\u65f6\u5019\uff0c\u53ef\u4ee5\u91c7\u7528\u6a21\u578b\u5e76\u884c\u7b56\u7565\u89e3\u51b3\u95ee\u9898\u3002 \u6240\u8c13\u7684\u6a21\u578b\u5e76\u884c\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6570\u636e\u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\uff0c\u800c\u6a21\u578b \\(w\\) \u88ab\u5207\u5206\u5230\u4e86\u5404\u4e2a\u8bbe\u5907\u4e0a\uff0c\u6bcf\u4e2a\u8bbe\u5907\u53ea\u62e5\u6709\u6a21\u578b\u7684\u4e00\u90e8\u5206\uff0c\u6240\u6709\u8ba1\u7b97\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u62fc\u5728\u4e00\u8d77\uff0c\u624d\u662f\u5b8c\u6574\u7684\u6a21\u578b\u3002 \u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(w\\) \u88ab\u6309\u7167\u7b2c1\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(x\\) \u3002\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u4e5f\u9700\u8981\u901a\u8fc7\u62fc\u63a5\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u7684\u8f93\u51fa\u3002 \u6a21\u578b\u5e76\u884c\u7684\u597d\u5904\u662f\uff0c\u7701\u53bb\u4e86\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u7684\u68af\u5ea6 AllReduce\uff1b\u4f46\u662f\uff0c\u7531\u4e8e\u6bcf\u4e2a\u8bbe\u5907\u90fd\u9700\u8981\u5b8c\u6574\u7684\u6570\u636e\u8f93\u5165\uff0c\u56e0\u6b64\uff0c\u6570\u636e\u4f1a\u5728\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u8fdb\u884c\u5e7f\u64ad\uff0c\u4ea7\u751f\u901a\u4fe1\u4ee3\u4ef7\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u7684\u6700\u7ec8\u5f97\u5230\u7684 \\(out~(4\\times8)\\) \uff0c\u5982\u679c\u5b83\u4f5c\u4e3a\u4e0b\u4e00\u5c42\u7f51\u7edc\u7684\u8f93\u5165\uff0c\u90a3\u4e48\u5b83\u5c31\u9700\u8981\u88ab\u5e7f\u64ad\u53d1\u9001\u5230\u4e24\u4e2a\u8bbe\u5907\u4e0a\u3002 \u8bed\u8a00\u6a21\u578b\uff0c\u5982 BERT\uff0c\u5e38\u91c7\u7528\u6a21\u578b\u5e76\u884c\u3002 \u6d41\u6c34\u5e76\u884c \u00b6 \u5f53\u795e\u7ecf\u7f51\u7edc\u8fc7\u4e8e\u5de8\u5927\uff0c\u65e0\u6cd5\u5728\u4e00\u4e2a\u8bbe\u5907\u4e0a\u5b58\u653e\u65f6\uff0c\u9664\u4e86\u4e0a\u8ff0\u7684\u6a21\u578b\u5e76\u884c\u7684\u7b56\u7565\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u6d41\u6c34\u5e76\u884c\u3002 \u6d41\u6c34\u5e76\u884c\u6307\u5c06\u7f51\u7edc\u5207\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u5e76\u5206\u53d1\u5230\u4e0d\u540c\u7684\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5404\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e4b\u95f4\u4ee5\u201c\u63a5\u529b\u201d\u7684\u65b9\u5f0f\u5b8c\u6210\u8bad\u7ec3\u3002 \u5982\u4e0b\u56fe\uff0c\u5c55\u793a\u4e86\u4e00\u4e2a\u903b\u8f91\u4e0a\u76844\u5c42\u7f51\u7edc\uff08 T1 \u81f3 T4 )\u662f\u5982\u4f55\u505a\u6d41\u6c34\u5e76\u884c\u7684\u3002 4\u5c42\u7f51\u7edc\u88ab\u5207\u5206\u52302\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5176\u4e2d GPU0 \u4e0a\u8fdb\u884c T1 \u4e0e T2 \u7684\u8fd0\u7b97\uff0c GPU1 \u4e0a\u8fdb\u884c T3 \u4e0e T4 \u7684\u8ba1\u7b97\u3002 GPU0 \u4e0a\u5b8c\u6210\u524d\u4e24\u5c42\u7684\u8ba1\u7b97\u540e\uff0c\u5b83\u7684\u8f93\u51fa\u88ab\u5f53\u4f5c GPU1 \u7684\u8f93\u5165\uff0c\u7ee7\u7eed\u8fdb\u884c\u540e\u4e24\u5c42\u7684\u8ba1\u7b97\u3002 \u6df7\u5408\u5e76\u884c \u00b6 \u7f51\u7edc\u7684\u8bad\u7ec3\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5c06\u591a\u79cd\u5e76\u884c\u7b56\u7565\u6df7\u7528\uff0c\u4ee5 GPT-3 \u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5b83\u8bad\u7ec3\u65f6\u7684\u8bbe\u5907\u5e76\u884c\u65b9\u6848\uff1a \u5b83\u9996\u5148\u88ab\u5206\u4e3a 64 \u4e2a\u9636\u6bb5\uff0c\u8fdb\u884c\u6d41\u6c34\u5e76\u884c\u3002\u6bcf\u4e2a\u9636\u6bb5\u90fd\u8fd0\u884c\u5728 6 \u53f0 DGX-A100 \u4e3b\u673a\u4e0a\u3002\u57286\u53f0\u4e3b\u673a\u4e4b\u95f4\uff0c\u8fdb\u884c\u7684\u662f\u6570\u636e\u5e76\u884c\u8bad\u7ec3\uff1b\u6bcf\u53f0\u4e3b\u673a\u6709 8 \u5f20 GPU \u663e\u5361\uff0c\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u76848\u5f20 GPU \u663e\u5361\u4e4b\u95f4\u662f\u8fdb\u884c\u6a21\u578b\u5e76\u884c\u8bad\u7ec3\u3002 \u5e76\u884c\u7b56\u7565\u7684\u9009\u62e9\u5f71\u54cd\u7740\u8bad\u7ec3\u6548\u7387\uff0c\u6846\u67b6\u5bf9\u5e76\u884c\u8bad\u7ec3\u7684\u63a5\u53e3\u652f\u6301\u7a0b\u5ea6\uff0c\u51b3\u5b9a\u4e86\u7b97\u6cd5\u5de5\u7a0b\u5e08\u7684\u5f00\u53d1\u6548\u7387\u3002OneFlow \u9488\u5bf9\u5206\u5e03\u5f0f\u8bad\u7ec3\u6240\u505a\u7684\u7cfb\u7edf\u7ea7\u8bbe\u8ba1\u548c\u521b\u65b0\uff0c\u4e3a\u7528\u6237\u8f7b\u677e\u4e0a\u624b\u5206\u5e03\u5f0f\u8bad\u7ec3\u505a\u8db3\u4e86\u94fa\u57ab\u3002\u6211\u4eec\u5c06\u5728\u672c\u4e13\u9898\u7684\u5176\u5b83\u6587\u7ae0\u4e2d\u770b\u5230\u76f8\u5173\u793a\u4f8b\u3002","title":"\u5206\u5e03\u5f0f\u8bad\u7ec3"},{"location":"llm/others/dt/#_1","text":"\u7ea6 1632 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstract \u4ecb\u7ecd\u4e86\u5206\u5e03\u5f0f\u8bad\u7ec3\u7684\u80cc\u666f\u548c\u5e38\u89c1\u7684 4 \u79cd\u5e76\u884c\u7b56\u7565 learn from OneFlow/docs","title":"\u5206\u5e03\u5f0f\u8bad\u7ec3"},{"location":"llm/others/dt/#_2","text":"\u8fd1\u5e74\u6765\uff0c\u6df1\u5ea6\u5b66\u4e60\u88ab\u5e7f\u6cdb\u5e94\u7528\u5230\u5404\u4e2a\u9886\u57df\uff0c\u5305\u62ec\u8ba1\u7b97\u673a\u89c6\u89c9\u3001\u8bed\u8a00\u7406\u89e3\u3001\u8bed\u97f3\u8bc6\u522b\u3001\u5e7f\u544a\u63a8\u8350\u7b49\u3002\u5728\u8fd9\u4e9b\u4e0d\u540c\u7684\u9886\u57df\u4e2d\uff0c\u4e00\u4e2a\u5171\u540c\u7684\u7279\u70b9\u5c31\u662f\u6a21\u578b\u89c4\u6a21\u8d8a\u6765\u8d8a\u5927\uff0c\u6bd4\u5982 GPT-3 \u6a21\u578b\u7684\u53c2\u6570\u91cf\u8fbe\u52301750\u4ebf\u3002\u5373\u4f7f\u75281024\u5f20 80 GB \u7684 A100\uff0c\u90a3\u4e48\u5b8c\u6574\u8bad\u7ec3 GPT-3 \u7684\u65f6\u957f\u90fd\u9700\u89811\u4e2a\u6708\u3002 \u6a21\u578b\u89c4\u6a21\u7684\u6269\u5927\uff0c\u5bf9\u786c\u4ef6\uff08\u7b97\u529b\u3001\u5185\u5b58\uff09\u7684\u53d1\u5c55\u63d0\u51fa\u8981\u6c42\u3002\u7136\u800c\uff0c\u56e0\u4e3a \u5185\u5b58\u5899 \u7684\u5b58\u5728\uff0c\u5355\u4e00\u8bbe\u5907\u7684\u7b97\u529b\u53ca\u5bb9\u91cf\uff0c\u53d7\u9650\u4e8e\u7269\u7406\u5b9a\u5f8b\uff0c\u6301\u7eed\u63d0\u9ad8\u82af\u7247\u7684\u96c6\u6210\u8d8a\u6765\u8d8a\u56f0\u96be\uff0c\u96be\u4ee5\u8ddf\u4e0a\u6a21\u578b\u6269\u5927\u7684\u9700\u6c42\u3002 \u4e3a\u4e86\u89e3\u51b3\u7b97\u529b\u589e\u901f\u4e0d\u8db3\u7684\u95ee\u9898\uff0c\u4eba\u4eec\u8003\u8651\u7528\u591a\u8282\u70b9\u96c6\u7fa4\u8fdb\u884c\u5206\u5e03\u5f0f\u8bad\u7ec3\uff0c\u4ee5\u63d0\u5347\u7b97\u529b\uff0c\u5206\u5e03\u5f0f\u8bad\u7ec3\u52bf\u5728\u5fc5\u884c\u3002","title":"\u4e3a\u4ec0\u4e48\u5206\u5e03\u5f0f\u8bad\u7ec3\u8d8a\u6765\u8d8a\u6d41\u884c"},{"location":"llm/others/dt/#_3","text":"\u7b80\u5355\u7684\u673a\u5668\u5806\u53e0\u5e76\u4e0d\u4e00\u5b9a\u4f1a\u5e26\u6765\u7b97\u529b\u7684\u589e\u957f\u3002\u56e0\u4e3a\u795e\u7ecf\u7f51\u7edc\u7684\u8bad\u7ec3\u5e76\u4e0d\u662f\u5355\u7eaf\u7684\u201c\u628a\u539f\u6765\u4e00\u4e2a\u8bbe\u5907\u505a\u7684\u4e8b\u60c5\uff0c\u73b0\u5728\u5206\u7ed9\u591a\u4e2a\u8bbe\u5907\u5404\u81ea\u505a\u201d\uff0c\u5b83\u4e0d\u4ec5\u9700\u8981\u591a\u4e2a\u8bbe\u5907\u8fdb\u884c\u8ba1\u7b97\uff0c\u8fd8\u6d89\u53ca\u5230\u8bbe\u5907\u4e4b\u95f4\u7684\u6570\u636e\u4f20\u8f93\uff0c\u53ea\u6709\u534f\u8c03\u597d\u96c6\u7fa4\u4e2d\u7684\u8ba1\u7b97\u4e0e\u901a\u4fe1\uff0c\u624d\u80fd\u505a\u9ad8\u6548\u7684\u5206\u5e03\u5f0f\u8bad\u7ec3\u3002 \u6211\u4eec\u5c06\u4ee5\u77e9\u9635\u4e58\u6cd5\u7684\u4f8b\u5b50\uff0c\u89e3\u91ca\u6570\u636e\u5e76\u884c\u3001\u6a21\u578b\u5e76\u884c\u7684\u533a\u522b\u3002 \u5148\u4e86\u89e3\u4ee5\u4e0b\u903b\u8f91\u4e0a\u7684\u77e9\u9635\u4e58\u6cd5\u4f8b\u5b50: \u5047\u8bbe\u795e\u7ecf\u7f51\u7edc\u4e2d\u67d0\u4e00\u5c42\u662f\u505a\u77e9\u9635\u4e58\u6cd5\uff0c\u5176\u4e2d\u7684\u8f93\u5165 \\(x\\) \u7684\u5f62\u72b6\u4e3a \\(4\\times5\\) \uff0c\u6a21\u578b\u53c2\u6570 \\(w\\) \u7684\u5f62\u72b6\u4e3a \\(5\\times8\\) \uff0c\u90a3\u4e48\uff0c\u77e9\u9635\u4e58\u6cd5\u8f93\u51fa\u5f62\u72b6\u4e3a \\(4\\times8\\) \u3002\u793a\u610f\u56fe\u5982\u4e0b\uff1a \u5355\u673a\u5355\u5361\u7684\u8bad\u7ec3\u4e2d\uff0c\u4ee5\u4e0a\u77e9\u9635\u4e58\u6cd5\uff0c\u5148\u8ba1\u7b97\u5f97\u5230 \\(out\\) \uff0c\u5e76\u5c06 \\(out\\) \u4f20\u9012\u7ed9\u4e0b\u4e00\u5c42\uff0c\u5e76\u6700\u7ec8\u8ba1\u7b97\u5f97\u5230 \\(loss\\) \uff0c\u7136\u540e\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u5f97\u5230 \\(\\frac{\\partial loss}{\\partial w}\\) \uff0c\u7528\u4e8e\u66f4\u65b0 \\(w\\) \u3002 \u5206\u5e03\u5f0f\u8bad\u7ec3\u4e2d\uff0c\u4f9d\u636e\u662f\u5207\u5206 \\(x\\) \u8fd8\u662f \\(w\\) \u7684\u4e0d\u540c\uff0c\u5206\u4e3a\u201c\u6570\u636e\u5e76\u884c\u201d\u548c\u201c\u6a21\u578b\u5e76\u884c\u201d\u7b56\u7565\u3002\u63a5\u4e0b\u6765\uff0c\u6211\u4eec\u4ecb\u7ecd\u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565\u3002","title":"\u5e38\u89c1\u7684\u5e76\u884c\u7b56\u7565"},{"location":"llm/others/dt/#_4","text":"\u6240\u8c13\u7684\u6570\u636e\u5e76\u884c\uff0c\u5c31\u662f\u5c06\u6570\u636e \\(x\\) \u8fdb\u884c\u5207\u5206\uff0c\u800c\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b \\(w\\) \u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\u3002\u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(x\\) \u88ab\u6309\u7167\u7b2c0\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(w\\) \u3002 \u8fd9\u6837\uff0c\u5728\u4e24\u53f0\u8bbe\u5907\u4e0a\uff0c\u5206\u522b\u5f97\u5230\u7684\u8f93\u51fa\uff0c\u90fd\u53ea\u662f\u903b\u8f91\u4e0a\u8f93\u51fa\u7684\u4e00\u534a\uff08\u5f62\u72b6\u4e3a \\(2\\times8\\) \uff09\uff0c\u5c06\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u62fc\u63a5\u5230\u4e00\u8d77\uff0c\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u5b8c\u6574\u7684\u8f93\u51fa\u3002 \u6ce8\u610f\uff0c\u56e0\u4e3a\u6570\u636e\u88ab\u5206\u53d1\u5230\u4e862\u4e2a\u8bbe\u5907\u4e0a\uff0c\u56e0\u6b64\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\uff0c\u5404\u81ea\u8bbe\u5907\u4e0a\u5f97\u5230\u7684 \\(\\frac{\\partial loss}{\\partial w}\\) \u4f1a\u4e0d\u4e00\u6837\uff0c\u5982\u679c\u76f4\u63a5\u4f7f\u7528\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u66f4\u65b0\u5404\u81ea\u7684\u6a21\u578b\uff0c\u4f1a\u9020\u62102\u4e2a\u8bbe\u5907\u4e0a\u7684 \u6a21\u578b\u4e0d\u4e00\u81f4 \uff0c\u8bad\u7ec3\u5c31\u5931\u53bb\u4e86\u610f\u4e49\uff08\u5230\u5e95\u7528\u54ea\u4e2a\u6a21\u578b\u597d\u5462\uff1f\uff09\u3002 \u56e0\u6b64\uff0c\u6570\u636e\u5e76\u884c\u7b56\u7565\u4e0b\uff0c\u5728\u53cd\u5411\u4f20\u64ad\u8fc7\u7a0b\u4e2d\uff0c\u9700\u8981\u5bf9\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u68af\u5ea6\u8fdb\u884c AllReduce \uff0c\u4ee5\u786e\u4fdd\u5404\u4e2a\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u59cb\u7ec8\u4fdd\u6301\u4e00\u81f4\u3002 \u5f53\u6570\u636e\u96c6\u8f83\u5927\uff0c\u6a21\u578b\u8f83\u5c0f\u65f6\uff0c\u7531\u4e8e\u53cd\u5411\u8fc7\u7a0b\u4e2d\u4e3a\u540c\u6b65\u68af\u5ea6\u4ea7\u751f\u7684\u901a\u4fe1\u4ee3\u4ef7\u8f83\u5c0f\uff0c\u6b64\u65f6\u9009\u62e9\u6570\u636e\u5e76\u884c\u4e00\u822c\u6bd4\u8f83\u6709\u4f18\u52bf\uff0c\u5e38\u89c1\u7684\u89c6\u89c9\u5206\u7c7b\u6a21\u578b\uff0c\u5982 ResNet50\uff0c\u6bd4\u8f83\u9002\u5408\u91c7\u7528\u6570\u636e\u5e76\u884c\u3002","title":"\u6570\u636e\u5e76\u884c"},{"location":"llm/others/dt/#_5","text":"\u5f53\u795e\u7ecf\u7f51\u7edc\u975e\u5e38\u5de8\u5927\uff0c\u6570\u636e\u5e76\u884c\u540c\u6b65\u68af\u5ea6\u7684\u4ee3\u4ef7\u5c31\u4f1a\u5f88\u5927\uff0c\u751a\u81f3\u7f51\u7edc\u53ef\u80fd\u5de8\u5927\u5230\u65e0\u6cd5\u5b58\u653e\u5230\u5355\u4e00\u8ba1\u7b97\u8bbe\u5907\u4e2d\uff0c\u8fd9\u65f6\u5019\uff0c\u53ef\u4ee5\u91c7\u7528\u6a21\u578b\u5e76\u884c\u7b56\u7565\u89e3\u51b3\u95ee\u9898\u3002 \u6240\u8c13\u7684\u6a21\u578b\u5e76\u884c\uff0c\u5c31\u662f\u6bcf\u4e2a\u8bbe\u5907\u4e0a\u7684\u6570\u636e\u662f\u5b8c\u6574\u7684\u3001\u4e00\u81f4\u7684\uff0c\u800c\u6a21\u578b \\(w\\) \u88ab\u5207\u5206\u5230\u4e86\u5404\u4e2a\u8bbe\u5907\u4e0a\uff0c\u6bcf\u4e2a\u8bbe\u5907\u53ea\u62e5\u6709\u6a21\u578b\u7684\u4e00\u90e8\u5206\uff0c\u6240\u6709\u8ba1\u7b97\u8bbe\u5907\u4e0a\u7684\u6a21\u578b\u62fc\u5728\u4e00\u8d77\uff0c\u624d\u662f\u5b8c\u6574\u7684\u6a21\u578b\u3002 \u5982\u4e0b\u56fe\u6240\u793a\uff0c \\(w\\) \u88ab\u6309\u7167\u7b2c1\u7ef4\u5ea6\u5e73\u5747\u5207\u5206\u52302\u4e2a\u8bbe\u5907\u4e0a\uff0c\u4e24\u4e2a\u8bbe\u5907\u4e0a\u90fd\u6709\u5b8c\u6574\u7684 \\(x\\) \u3002\u4e24\u4e2a\u8bbe\u5907\u4e0a\u7684\u8f93\u51fa\u4e5f\u9700\u8981\u901a\u8fc7\u62fc\u63a5\u624d\u80fd\u5f97\u5230\u903b\u8f91\u4e0a\u7684\u8f93\u51fa\u3002 \u6a21\u578b\u5e76\u884c\u7684\u597d\u5904\u662f\uff0c\u7701\u53bb\u4e86\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u7684\u68af\u5ea6 AllReduce\uff1b\u4f46\u662f\uff0c\u7531\u4e8e\u6bcf\u4e2a\u8bbe\u5907\u90fd\u9700\u8981\u5b8c\u6574\u7684\u6570\u636e\u8f93\u5165\uff0c\u56e0\u6b64\uff0c\u6570\u636e\u4f1a\u5728\u591a\u4e2a\u8bbe\u5907\u4e4b\u95f4\u8fdb\u884c\u5e7f\u64ad\uff0c\u4ea7\u751f\u901a\u4fe1\u4ee3\u4ef7\u3002\u6bd4\u5982\uff0c\u4e0a\u56fe\u4e2d\u7684\u6700\u7ec8\u5f97\u5230\u7684 \\(out~(4\\times8)\\) \uff0c\u5982\u679c\u5b83\u4f5c\u4e3a\u4e0b\u4e00\u5c42\u7f51\u7edc\u7684\u8f93\u5165\uff0c\u90a3\u4e48\u5b83\u5c31\u9700\u8981\u88ab\u5e7f\u64ad\u53d1\u9001\u5230\u4e24\u4e2a\u8bbe\u5907\u4e0a\u3002 \u8bed\u8a00\u6a21\u578b\uff0c\u5982 BERT\uff0c\u5e38\u91c7\u7528\u6a21\u578b\u5e76\u884c\u3002","title":"\u6a21\u578b\u5e76\u884c"},{"location":"llm/others/dt/#_6","text":"\u5f53\u795e\u7ecf\u7f51\u7edc\u8fc7\u4e8e\u5de8\u5927\uff0c\u65e0\u6cd5\u5728\u4e00\u4e2a\u8bbe\u5907\u4e0a\u5b58\u653e\u65f6\uff0c\u9664\u4e86\u4e0a\u8ff0\u7684\u6a21\u578b\u5e76\u884c\u7684\u7b56\u7565\u5916\uff0c\u8fd8\u53ef\u4ee5\u9009\u62e9\u6d41\u6c34\u5e76\u884c\u3002 \u6d41\u6c34\u5e76\u884c\u6307\u5c06\u7f51\u7edc\u5207\u4e3a\u591a\u4e2a\u9636\u6bb5\uff0c\u5e76\u5206\u53d1\u5230\u4e0d\u540c\u7684\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5404\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e4b\u95f4\u4ee5\u201c\u63a5\u529b\u201d\u7684\u65b9\u5f0f\u5b8c\u6210\u8bad\u7ec3\u3002 \u5982\u4e0b\u56fe\uff0c\u5c55\u793a\u4e86\u4e00\u4e2a\u903b\u8f91\u4e0a\u76844\u5c42\u7f51\u7edc\uff08 T1 \u81f3 T4 )\u662f\u5982\u4f55\u505a\u6d41\u6c34\u5e76\u884c\u7684\u3002 4\u5c42\u7f51\u7edc\u88ab\u5207\u5206\u52302\u4e2a\u8ba1\u7b97\u8bbe\u5907\u4e0a\uff0c\u5176\u4e2d GPU0 \u4e0a\u8fdb\u884c T1 \u4e0e T2 \u7684\u8fd0\u7b97\uff0c GPU1 \u4e0a\u8fdb\u884c T3 \u4e0e T4 \u7684\u8ba1\u7b97\u3002 GPU0 \u4e0a\u5b8c\u6210\u524d\u4e24\u5c42\u7684\u8ba1\u7b97\u540e\uff0c\u5b83\u7684\u8f93\u51fa\u88ab\u5f53\u4f5c GPU1 \u7684\u8f93\u5165\uff0c\u7ee7\u7eed\u8fdb\u884c\u540e\u4e24\u5c42\u7684\u8ba1\u7b97\u3002","title":"\u6d41\u6c34\u5e76\u884c"},{"location":"llm/others/dt/#_7","text":"\u7f51\u7edc\u7684\u8bad\u7ec3\u4e2d\uff0c\u4e5f\u53ef\u4ee5\u5c06\u591a\u79cd\u5e76\u884c\u7b56\u7565\u6df7\u7528\uff0c\u4ee5 GPT-3 \u4e3a\u4f8b\uff0c\u4ee5\u4e0b\u662f\u5b83\u8bad\u7ec3\u65f6\u7684\u8bbe\u5907\u5e76\u884c\u65b9\u6848\uff1a \u5b83\u9996\u5148\u88ab\u5206\u4e3a 64 \u4e2a\u9636\u6bb5\uff0c\u8fdb\u884c\u6d41\u6c34\u5e76\u884c\u3002\u6bcf\u4e2a\u9636\u6bb5\u90fd\u8fd0\u884c\u5728 6 \u53f0 DGX-A100 \u4e3b\u673a\u4e0a\u3002\u57286\u53f0\u4e3b\u673a\u4e4b\u95f4\uff0c\u8fdb\u884c\u7684\u662f\u6570\u636e\u5e76\u884c\u8bad\u7ec3\uff1b\u6bcf\u53f0\u4e3b\u673a\u6709 8 \u5f20 GPU \u663e\u5361\uff0c\u540c\u4e00\u53f0\u673a\u5668\u4e0a\u76848\u5f20 GPU \u663e\u5361\u4e4b\u95f4\u662f\u8fdb\u884c\u6a21\u578b\u5e76\u884c\u8bad\u7ec3\u3002 \u5e76\u884c\u7b56\u7565\u7684\u9009\u62e9\u5f71\u54cd\u7740\u8bad\u7ec3\u6548\u7387\uff0c\u6846\u67b6\u5bf9\u5e76\u884c\u8bad\u7ec3\u7684\u63a5\u53e3\u652f\u6301\u7a0b\u5ea6\uff0c\u51b3\u5b9a\u4e86\u7b97\u6cd5\u5de5\u7a0b\u5e08\u7684\u5f00\u53d1\u6548\u7387\u3002OneFlow \u9488\u5bf9\u5206\u5e03\u5f0f\u8bad\u7ec3\u6240\u505a\u7684\u7cfb\u7edf\u7ea7\u8bbe\u8ba1\u548c\u521b\u65b0\uff0c\u4e3a\u7528\u6237\u8f7b\u677e\u4e0a\u624b\u5206\u5e03\u5f0f\u8bad\u7ec3\u505a\u8db3\u4e86\u94fa\u57ab\u3002\u6211\u4eec\u5c06\u5728\u672c\u4e13\u9898\u7684\u5176\u5b83\u6587\u7ae0\u4e2d\u770b\u5230\u76f8\u5173\u793a\u4f8b\u3002","title":"\u6df7\u5408\u5e76\u884c"},{"location":"llm/others/prompt/","text":"Prompt \u00b6 \u7ea6 145 \u4e2a\u5b57 57 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract Learn from ChatGPT Prompt Engineering for Developers in DeepLearning.AI Guidelines for Prompting \u00b6 Principle 1: Write clear and specific instructions Tactic 1: Use delimiters to clearly indicate disinct parts of the input Delimiters can be anything like: ```,\"\"\",<>, , , : Tactic 2: Ask for a structureed output JSON, HTML Tactic 3: Ask the modell to check whether conditions are satisfied Tactic 4: \"Few-shot\" prompting Principle 2: Give the model time to \"think\" Tactic 1: Specify the steps required to complete a task, Ask for output in a specified format Tactic 2: Instruct the model to work out its own solution before rushing to a conclusion Setup \u00b6 Load the API key and relevant Python libaries. import openai import os from dotenv import load_dotenv , find_dotenv _ = load_dotenv ( find_dotenv ()) openai . api_key = os . getenv ( 'OPENAI_API_KEY' ) using helper function , model is gpt-3.5-turbo . def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ] Example \u00b6 simple text = f \"\"\" You should express what you want a model to do by \\ providing instructions that are as clear and \\ specific as you can possibly make them. \\ This will guide the model towards the desired output, \\ and reduce the chances of receiving irrelevant \\ or incorrect responses. Don't confuse writing a \\ clear prompt with writing a short prompt. \\ In many cases, longer prompts provide more clarity \\ and context for the model, which can lead to \\ more detailed and relevant outputs. \"\"\" prompt = f \"\"\" Summarize the text delimited by triple backticks \\ into a single sentence. ``` { text } ``` \"\"\" response = get_completion ( prompt ) print ( response ) chatbot def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): # Andrew mentioned that the prompt/ completion paradigm is preferable for this class messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ] prod_review = \"\"\" Got this panda plush toy for my daughter's birthday, \\ who loves it and takes it everywhere. It's soft and \\ super cute, and its face has a friendly look. It's \\ a bit small for what I paid though. I think there \\ might be other options that are bigger for the \\ same price. It arrived a day earlier than expected, \\ so I got to play with it myself before I gave it \\ to her. \"\"\" prompt = f \"\"\" Your task is to generate a short summary of a product \\ review from an ecommerce site. Summarize the review below, delimited by triple backticks, in at most 30 words. Review: ``` { prod_review } ``` \"\"\" response = get_completion ( prompt ) print ( response ) Prompting for Tasks \u00b6 Iterative Summarizing Inferring Transforming Expanding Chatbot","title":"Prompt"},{"location":"llm/others/prompt/#prompt","text":"\u7ea6 145 \u4e2a\u5b57 57 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract Learn from ChatGPT Prompt Engineering for Developers in DeepLearning.AI","title":"Prompt"},{"location":"llm/others/prompt/#guidelines-for-prompting","text":"Principle 1: Write clear and specific instructions Tactic 1: Use delimiters to clearly indicate disinct parts of the input Delimiters can be anything like: ```,\"\"\",<>, , , : Tactic 2: Ask for a structureed output JSON, HTML Tactic 3: Ask the modell to check whether conditions are satisfied Tactic 4: \"Few-shot\" prompting Principle 2: Give the model time to \"think\" Tactic 1: Specify the steps required to complete a task, Ask for output in a specified format Tactic 2: Instruct the model to work out its own solution before rushing to a conclusion","title":"Guidelines for Prompting"},{"location":"llm/others/prompt/#setup","text":"Load the API key and relevant Python libaries. import openai import os from dotenv import load_dotenv , find_dotenv _ = load_dotenv ( find_dotenv ()) openai . api_key = os . getenv ( 'OPENAI_API_KEY' ) using helper function , model is gpt-3.5-turbo . def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ]","title":"Setup"},{"location":"llm/others/prompt/#example","text":"simple text = f \"\"\" You should express what you want a model to do by \\ providing instructions that are as clear and \\ specific as you can possibly make them. \\ This will guide the model towards the desired output, \\ and reduce the chances of receiving irrelevant \\ or incorrect responses. Don't confuse writing a \\ clear prompt with writing a short prompt. \\ In many cases, longer prompts provide more clarity \\ and context for the model, which can lead to \\ more detailed and relevant outputs. \"\"\" prompt = f \"\"\" Summarize the text delimited by triple backticks \\ into a single sentence. ``` { text } ``` \"\"\" response = get_completion ( prompt ) print ( response ) chatbot def get_completion ( prompt , model = \"gpt-3.5-turbo\" ): # Andrew mentioned that the prompt/ completion paradigm is preferable for this class messages = [{ \"role\" : \"user\" , \"content\" : prompt }] response = openai . ChatCompletion . create ( model = model , messages = messages , temperature = 0 , # this is the degree of randomness of the model's output ) return response . choices [ 0 ] . message [ \"content\" ] prod_review = \"\"\" Got this panda plush toy for my daughter's birthday, \\ who loves it and takes it everywhere. It's soft and \\ super cute, and its face has a friendly look. It's \\ a bit small for what I paid though. I think there \\ might be other options that are bigger for the \\ same price. It arrived a day earlier than expected, \\ so I got to play with it myself before I gave it \\ to her. \"\"\" prompt = f \"\"\" Your task is to generate a short summary of a product \\ review from an ecommerce site. Summarize the review below, delimited by triple backticks, in at most 30 words. Review: ``` { prod_review } ``` \"\"\" response = get_completion ( prompt ) print ( response )","title":"Example"},{"location":"llm/others/prompt/#prompting-for-tasks","text":"Iterative Summarizing Inferring Transforming Expanding Chatbot","title":"Prompting for Tasks"},{"location":"llm/transformer/","text":"Transformer \u00b6 Abstract \u5f52\u6863\u5b66\u4e60 Transformer \u7684\u7b14\u8bb0 Table of Contents \u00b6 Attention Transformer BERT ViT","title":"Transformer"},{"location":"llm/transformer/#transformer","text":"Abstract \u5f52\u6863\u5b66\u4e60 Transformer \u7684\u7b14\u8bb0","title":"Transformer"},{"location":"llm/transformer/#table-of-contents","text":"Attention Transformer BERT ViT","title":"Table of Contents"},{"location":"llm/transformer/attention/","text":"Attention \u673a\u5236 \u00b6 \u7ea6 2743 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u4e8e RNN \u4e2d\u5b58\u5728\u7684\u4fe1\u606f\u74f6\u9888\u95ee\u9898\uff0c\u6ce8\u610f\u529b\u673a\u5236\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd Encoder-Decoder\u3001Seq2Seq \u4ee5\u53ca Attention \u673a\u5236\u3002 Encoder-Decoder \u00b6 Encoder-Decoder \u6a21\u578b\u4e3b\u8981\u662f NLP \u9886\u57df\u91cc\u7684\u6982\u5ff5\u3002\u5b83\u5e76\u4e0d\u7279\u503c\u67d0\u79cd\u5177\u4f53\u7684\u7b97\u6cd5\uff0c\u800c\u662f\u4e00\u7c7b\u7b97\u6cd5\u7684\u7edf\u79f0\u3002Encoder-Decoder \u7b97\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6846\u67b6\uff0c\u5728\u8fd9\u4e2a\u6846\u67b6\u4e0b\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u7b97\u6cd5\u6765\u89e3\u51b3\u4e0d\u540c\u7684\u4efb\u52a1\u3002 Encoder-Decoder \u6846\u67b6\u5f88\u597d\u5730\u8be0\u91ca\u4e86\u673a\u5668\u5b66\u4e60\u7684\u6838\u5fc3\u601d\u8def\uff1a \u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\uff0c\u901a\u8fc7\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u4ece\u800c\u89e3\u51b3\u73b0\u5b9e\u95ee\u9898 Encoder \u53c8\u79f0\u7f16\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\u300f\u3002 Decoder \u53c8\u79f0\u89e3\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u5e76\u8f6c\u5316\u4e3a\u73b0\u5b9e\u4e16\u754c\u7684\u89e3\u51b3\u65b9\u6848\u300f\u3002 \u5173\u4e8e Encoder-Decoder\uff1a \u4e0d\u8bba\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u662f\u4ec0\u4e48\uff0c\u4e2d\u95f4\u7684 \u5411\u91cfc \u7684\u957f\u5ea6\u90fd\u662f\u56fa\u5b9a\u7684\uff08\u8fd9\u4e5f\u662f\u5b83\u7684\u7f3a\u9677\uff09\u3002 \u6839\u636e\u4e0d\u540c\u7684\u4efb\u52a1\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u7f16\u7801\u5668\u548c\u89e3\u7801\u5668\uff08\u53ef\u4ee5\u662f\u4e00\u4e2a RNN\uff0c\u4f46\u901a\u5e38\u662f\u5176\u53d8\u79cd LSTM \u6216\u8005 GRU\uff09\u3002 Encoder-Decoder \u7684\u7f3a\u9677 \u4e3a\u4e86\u4fbf\u4e8e\u7406\u89e3\uff0c\u6211\u4eec\u7c7b\u6bd4\u4e3a\u300c\u538b\u7f29-\u89e3\u538b\u300d\u7684\u8fc7\u7a0b\uff1a \u5c06\u4e00\u5f20 800X800 \u50cf\u7d20\u7684\u56fe\u7247\u538b\u7f29\u6210 100KB\uff0c\u770b\u4e0a\u53bb\u8fd8\u6bd4\u8f83\u6e05\u6670\u3002\u518d\u5c06\u4e00\u5f20 3000X3000 \u50cf\u7d20\u7684\u56fe\u7247\u4e5f\u538b\u7f29\u5230 100KB\uff0c\u770b\u4e0a\u53bb\u5c31\u6a21\u7cca\u4e86\u3002 Encoder-Decoder \u5c31\u662f\u7c7b\u4f3c\u7684\u95ee\u9898\uff1a\u5f53\u8f93\u5165\u4fe1\u606f\u592a\u957f\u65f6\uff0c\u4f1a\u4e22\u5931\u6389\u4e00\u4e9b\u4fe1\u606f\u3002 Seq2Seq \u00b6 \u6982\u8ff0 \u00b6 Seq2Seq\uff08\u662f Sequence to Sequence \u7684\u7f29\u5199\uff09\uff0c\u5b57\u9762\u610f\u601d\u5c31\u662f\u8f93\u5165\u4e00\u4e2a\u5e8f\u5217\uff0c\u8f93\u51fa\u53e6\u4e00\u4e2a\u5e8f\u5217\u3002\u8fd9\u79cd\u7ed3\u6784\u6700\u91cd\u8981\u7684\u5730\u65b9\u5728\u4e8e\u8f93\u5165\u5e8f\u5217\u548c\u8f93\u51fa\u5e8f\u5217\u7684\u957f\u5ea6\u53ef\u4ee5\u53ef\u53d8\u7684\u3002\u4f8b\u5982\u4e0b\u56fe\uff1a \u5982\u4e0a\u56fe\uff1a\u8f93\u5165\u4e86 6 \u4e2a\u6c49\u5b57\uff0c\u8f93\u51fa\u4e86 3 \u4e2a\u82f1\u6587\u5355\u8bcd\u3002\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u4e0d\u540c\u3002 Seq2Seq \u548c Encoder-Decoder \u7684\u5173\u7cfb \u00b6 Seq2Seq\uff08\u5f3a\u8c03\u76ee\u7684\uff09\u4e0d\u7279\u6307\u5177\u4f53\u65b9\u6cd5\uff0c\u6ee1\u8db3\u300c\u8f93\u5165\u5e8f\u5217\u3001\u8f93\u51fa\u5e8f\u5217\u300d\u7684\u76ee\u7684\uff0c\u90fd\u53ef\u4ee5\u7edf\u79f0\u4e3a Seq2Seq \u6a21\u578b\u3002 \u800c Seq2Seq \u4f7f\u7528\u7684\u5177\u4f53\u65b9\u6cd5\u57fa\u672c\u90fd\u5c5e\u4e8eEncoder-Decoder \u6a21\u578b\uff08\u5f3a\u8c03\u65b9\u6cd5\uff09\u7684\u8303\u7574\u3002 \u603b\u7ed3\u4e00\u4e0b\u7684\u8bdd\uff1a Seq2Seq \u5c5e\u4e8e Encoder-Decoder \u7684\u5927\u8303\u7574 Seq2Seq \u66f4\u5f3a\u8c03\u76ee\u7684\uff0cEncoder-Decoder \u66f4\u5f3a\u8c03\u65b9\u6cd5 Attention \u00b6 \u672c\u8d28 \u00b6 Attention\uff08\u6ce8\u610f\u529b\uff09\u673a\u5236\u5982\u679c\u6d45\u5c42\u7684\u7406\u89e3\uff0c\u8ddf\u4ed6\u7684\u540d\u5b57\u975e\u5e38\u5339\u914d\u3002\u4ed6\u7684\u6838\u5fc3\u903b\u8f91\u5c31\u662f\u300c\u4ece\u5173\u6ce8\u5168\u90e8\u5230\u5173\u6ce8\u91cd\u70b9\u300d\u3002\u6211\u4eec\u7684\u89c6\u89c9\u7cfb\u7edf\u5c31\u662f\u4e00\u79cd Attention \u673a\u5236\uff0c\u5c06\u6709\u9650\u7684\u6ce8\u610f\u529b\u96c6\u4e2d\u5728\u91cd\u70b9\u4fe1\u606f\u4e0a\uff0c\u4ece\u800c\u8282\u7701\u8d44\u6e90\uff0c\u5feb\u901f\u83b7\u5f97\u6700\u6709\u6548\u7684\u4fe1\u606f\u3002 Attention \u673a\u5236\u6700\u65e9\u662f\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u91cc\u5e94\u7528\u7684\uff0c\u968f\u540e\u5728 NLP \u9886\u57df\u4e5f\u5f00\u59cb\u5e94\u7528\u4e86\uff0c\u771f\u6b63\u53d1\u626c\u5149\u5927\u662f\u5728 NLP \u9886\u57df\uff0c\u56e0\u4e3a 2018 \u5e74 BERT \u548c GPT \u7684\u6548\u679c\u51fa\u5947\u7684\u597d\uff0c\u8fdb\u800c\u8d70\u7ea2\u3002\u800c Transformer \u548c Attention \u8fd9\u4e9b\u6838\u5fc3\u5f00\u59cb\u88ab\u5927\u5bb6\u91cd\u70b9\u5173\u6ce8\u3002 \u5982\u679c\u7528\u56fe\u6765\u8868\u8fbe Attention \u7684\u4f4d\u7f6e\u5927\u81f4\u662f\u4e0b\u9762\u7684\u6837\u5b50\uff1a \u4e09\u5927\u4f18\u70b9 \u00b6 \u4e4b\u6240\u4ee5\u8981\u5f15\u5165 Attention \u673a\u5236\uff0c\u4e3b\u8981\u662f 3 \u4e2a\u539f\u56e0\uff1a \u53c2\u6570\u5c11 \uff1a\u6a21\u578b\u590d\u6742\u5ea6\u66f4 CNN\u3001RNN \u76f8\u6bd4\uff0c\u590d\u6742\u5ea6\u66f4\u5c0f\uff0c\u53c2\u6570\u4e5f\u66f4\u5c11\u3002\u5bf9\u7b97\u529b\u7684\u8981\u6c42\u4e5f\u5c31\u66f4\u5c11\u3002 \u901f\u5ea6\u5feb \uff1aAttention \u89e3\u51b3\u4e86 RNN \u4e0d\u80fd\u5e76\u884c\u8ba1\u7b97\u7684\u95ee\u9898\u3002Attention\u673a\u5236\u6bcf\u4e00\u6b65\u8ba1\u7b97\u4e0d\u4f9d\u8d56\u4e8e\u4e0a\u4e00\u6b65\u7684\u8ba1\u7b97\u7ed3\u679c\uff0c\u56e0\u6b64\u53ef\u4ee5\u548cCNN\u4e00\u6837\u5e76\u884c\u5904\u7406\u3002 \u6548\u679c\u597d \uff1a\u5728 Attention \u673a\u5236\u5f15\u5165\u4e4b\u524d\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u5927\u5bb6\u4e00\u76f4\u5f88\u82e6\u607c\uff1a\u957f\u8ddd\u79bb\u7684\u4fe1\u606f\u4f1a\u88ab\u5f31\u5316\uff0c\u5c31\u597d\u50cf\u8bb0\u5fc6\u80fd\u529b\u5f31\u7684\u4eba\uff0c\u8bb0\u4e0d\u4f4f\u8fc7\u53bb\u7684\u4e8b\u60c5\u662f\u4e00\u6837\u7684\u3002 \u539f\u7406 \u00b6 \u4e0b\u9762\u7684\u52a8\u56fe\u6f14\u793a\u4e86 attention \u5f15\u5165 Encoder-Decoder \u6846\u67b6\u4e0b\uff0c\u5b8c\u6210\u673a\u5668\u7ffb\u8bd1\u4efb\u52a1\u7684\u5927\u81f4\u6d41\u7a0b\u3002 \u4f46\u662f\uff0cAttention \u5e76\u4e0d\u4e00\u5b9a\u8981\u5728 Encoder-Decoder \u6846\u67b6\u4e0b\u4f7f\u7528\u7684\uff0c\u4ed6\u662f\u53ef\u4ee5\u8131\u79bb Encoder-Decoder \u6846\u67b6\u7684\u3002 Attention \u539f\u7406\u5206\u4e3a 3 \u6b65\uff1a query \u548c key \u8fdb\u884c\u76f8\u4f3c\u5ea6\u8ba1\u7b97\uff0c\u5f97\u5230\u6743\u503c \u5c06\u6743\u503c\u8fdb\u884c\u5f52\u4e00\u5316\uff0c\u5f97\u5230\u76f4\u63a5\u53ef\u7528\u7684\u6743\u91cd \u5c06\u6743\u91cd\u548c value \u8fdb\u884c\u52a0\u6743\u6c42\u548c \u4ece\u4e0a\u9762\u7684\u5efa\u6a21\uff0c\u53ef\u4ee5\u5927\u81f4\u611f\u53d7\u5230 Attention \u7684\u601d\u8def\u7b80\u5355\uff0c \u56db\u4e2a\u5b57\u201c\u5e26\u6743\u6c42\u548c\u201d \uff0c\u5927\u9053\u81f3\u7b80\u3002 N \u79cd\u7c7b\u578b \u00b6 \u8ba1\u7b97\u533a\u57df \u00b6 Soft Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u5e38\u89c1\u7684Attention\u65b9\u5f0f\uff0c\u5bf9\u6240\u6709key\u6c42\u6743\u91cd\u6982\u7387\uff0c\u6bcf\u4e2akey\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u6743\u91cd\uff0c\u662f\u4e00\u79cd\u5168\u5c40\u7684\u8ba1\u7b97\u65b9\u5f0f\uff08\u4e5f\u53ef\u4ee5\u53ebGlobal Attention\uff09\u3002\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u8f83\u7406\u6027\uff0c\u53c2\u8003\u4e86\u6240\u6709key\u7684\u5185\u5bb9\uff0c\u518d\u8fdb\u884c\u52a0\u6743\u3002\u4f46\u662f\u8ba1\u7b97\u91cf\u53ef\u80fd\u4f1a\u6bd4\u8f83\u5927\u4e00\u4e9b\u3002 Hard Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u662f\u76f4\u63a5\u7cbe\u51c6\u5b9a\u4f4d\u5230\u67d0\u4e2akey\uff0c\u5176\u4f59key\u5c31\u90fd\u4e0d\u7ba1\u4e86\uff0c\u76f8\u5f53\u4e8e\u8fd9\u4e2akey\u7684\u6982\u7387\u662f1\uff0c\u5176\u4f59key\u7684\u6982\u7387\u5168\u90e8\u662f0\u3002\u56e0\u6b64\u8fd9\u79cd\u5bf9\u9f50\u65b9\u5f0f\u8981\u6c42\u5f88\u9ad8\uff0c\u8981\u6c42\u4e00\u6b65\u5230\u4f4d\uff0c\u5982\u679c\u6ca1\u6709\u6b63\u786e\u5bf9\u9f50\uff0c\u4f1a\u5e26\u6765\u5f88\u5927\u7684\u5f71\u54cd\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u56e0\u4e3a\u4e0d\u53ef\u5bfc\uff0c\u4e00\u822c\u9700\u8981\u7528\u5f3a\u5316\u5b66\u4e60\u7684\u65b9\u6cd5\u8fdb\u884c\u8bad\u7ec3\u3002\uff08\u6216\u8005\u4f7f\u7528gumbel softmax\u4e4b\u7c7b\u7684\uff09 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5176\u5b9e\u662f\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\u7684\u4e00\u4e2a\u6298\u4e2d\uff0c\u5bf9\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\u8fdb\u884c\u8ba1\u7b97\u3002\u5148\u7528Hard\u65b9\u5f0f\u5b9a\u4f4d\u5230\u67d0\u4e2a\u5730\u65b9\uff0c\u4ee5\u8fd9\u4e2a\u70b9\u4e3a\u4e2d\u5fc3\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\uff0c\u5728\u8fd9\u4e2a\u5c0f\u533a\u57df\u5185\u7528Soft\u65b9\u5f0f\u6765\u7b97Attention\u3002 \u6240\u7528\u4fe1\u606f \u00b6 \u5047\u8bbe\u6211\u4eec\u8981\u5bf9\u4e00\u6bb5\u539f\u6587\u8ba1\u7b97Attention\uff0c\u8fd9\u91cc\u539f\u6587\u6307\u7684\u662f\u6211\u4eec\u8981\u505aattention\u7684\u6587\u672c\uff0c\u90a3\u4e48\u6240\u7528\u4fe1\u606f\u5305\u62ec\u5185\u90e8\u4fe1\u606f\u548c\u5916\u90e8\u4fe1\u606f\uff0c\u5185\u90e8\u4fe1\u606f\u6307\u7684\u662f\u539f\u6587\u672c\u8eab\u7684\u4fe1\u606f\uff0c\u800c\u5916\u90e8\u4fe1\u606f\u6307\u7684\u662f\u9664\u539f\u6587\u4ee5\u5916\u7684\u989d\u5916\u4fe1\u606f\u3002 General Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5229\u7528\u5230\u4e86\u5916\u90e8\u4fe1\u606f\uff0c\u5e38\u7528\u4e8e\u9700\u8981\u6784\u5efa\u4e24\u6bb5\u6587\u672c\u5173\u7cfb\u7684\u4efb\u52a1\uff0cquery\u4e00\u822c\u5305\u542b\u4e86\u989d\u5916\u4fe1\u606f\uff0c\u6839\u636e\u5916\u90e8query\u5bf9\u539f\u6587\u8fdb\u884c\u5bf9\u9f50\u3002 General Attention \u6bd4\u5982\u5728\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u4e2d\uff0c\u9700\u8981\u6784\u5efa\u95ee\u9898\u548c\u6587\u7ae0\u7684\u5173\u8054\uff0c\u5047\u8bbe\u73b0\u5728baseline\u662f\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u95ee\u9898\u5411\u91cfq\uff0c\u628a\u8fd9\u4e2aq\u548c\u6240\u6709\u7684\u6587\u7ae0\u8bcd\u5411\u91cf\u62fc\u63a5\u8d77\u6765\uff0c\u8f93\u5165\u5230LSTM\u4e2d\u8fdb\u884c\u5efa\u6a21\u3002\u90a3\u4e48\u5728\u8fd9\u4e2a\u6a21\u578b\u4e2d\uff0c\u6587\u7ae0\u6240\u6709\u8bcd\u5411\u91cf\u5171\u4eab\u540c\u4e00\u4e2a\u95ee\u9898\u5411\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u60f3\u8ba9\u6587\u7ae0\u6bcf\u4e00\u6b65\u7684\u8bcd\u5411\u91cf\u90fd\u6709\u4e00\u4e2a\u4e0d\u540c\u7684\u95ee\u9898\u5411\u91cf\uff0c\u4e5f\u5c31\u662f\uff0c\u5728\u6bcf\u4e00\u6b65\u4f7f\u7528\u6587\u7ae0\u5728\u8be5\u6b65\u4e0b\u7684\u8bcd\u5411\u91cf\u5bf9\u95ee\u9898\u6765\u7b97attention\uff0c\u8fd9\u91cc\u95ee\u9898\u5c5e\u4e8e\u539f\u6587\uff0c\u6587\u7ae0\u8bcd\u5411\u91cf\u5c31\u5c5e\u4e8e\u5916\u90e8\u4fe1\u606f\u3002 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u53ea\u4f7f\u7528\u5185\u90e8\u4fe1\u606f\uff0ckey\u548cvalue\u4ee5\u53caquery\u53ea\u548c\u8f93\u5165\u539f\u6587\u6709\u5173\uff0c\u5728self attention\u4e2d\uff0ckey=value=query\u3002\u65e2\u7136\u6ca1\u6709\u5916\u90e8\u4fe1\u606f\uff0c\u90a3\u4e48\u5728\u539f\u6587\u4e2d\u7684\u6bcf\u4e2a\u8bcd\u53ef\u4ee5\u8ddf\u8be5\u53e5\u5b50\u4e2d\u7684\u6240\u6709\u8bcd\u8fdb\u884cAttention\u8ba1\u7b97\uff0c\u76f8\u5f53\u4e8e\u5bfb\u627e\u539f\u6587\u5185\u90e8\u7684\u5173\u7cfb\u3002 Local Attention \u8fd8\u662f\u4e3e\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u7684\u4f8b\u5b50\uff0c\u4e0a\u9762\u7684baseline\u4e2d\u63d0\u5230\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u5411\u91cfq\uff0c\u90a3\u4e48\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u7528\u4e0aattention\uff0c\u53ea\u7528\u95ee\u9898\u81ea\u8eab\u7684\u4fe1\u606f\u53bb\u505aattention\uff0c\u800c\u4e0d\u5f15\u5165\u6587\u7ae0\u4fe1\u606f\u3002 \u7ed3\u6784\u5c42\u6b21 \u00b6 \u7ed3\u6784\u65b9\u9762\u6839\u636e\u662f\u5426\u5212\u5206\u5c42\u6b21\u5173\u7cfb\uff0c\u5206\u4e3a\u5355\u5c42 attention\uff0c\u591a\u5c42 attention \u548c \u591a\u5934 attention\uff1a \u5355\u5c42 Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u666e\u904d\u7684\u505a\u6cd5\uff0c\u7528\u4e00\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e00\u6b21attention\u3002 \u591a\u5c42 Attention \uff0c\u4e00\u822c\u7528\u4e8e\u6587\u672c\u5177\u6709\u5c42\u6b21\u5173\u7cfb\u7684\u6a21\u578b\uff0c\u5047\u8bbe\u6211\u4eec\u628a\u4e00\u4e2adocument\u5212\u5206\u6210\u591a\u4e2a\u53e5\u5b50\uff0c\u5728\u7b2c\u4e00\u5c42\uff0c\u6211\u4eec\u5206\u522b\u5bf9\u6bcf\u4e2a\u53e5\u5b50\u4f7f\u7528attention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u53e5\u5411\u91cf\uff08\u4e5f\u5c31\u662f\u5355\u5c42attention\uff09\uff1b\u5728\u7b2c\u4e8c\u5c42\uff0c\u6211\u4eec\u5bf9\u6240\u6709\u53e5\u5411\u91cf\u518d\u505aattention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u6587\u6863\u5411\u91cf\uff08\u4e5f\u662f\u4e00\u4e2a\u5355\u5c42attention\uff09\uff0c\u6700\u540e\u518d\u7528\u8fd9\u4e2a\u6587\u6863\u5411\u91cf\u53bb\u505a\u4efb\u52a1\u3002 \u591a\u5934 Attention \uff0c\u8fd9\u662fAttention is All You Need\u4e2d\u63d0\u5230\u7684multi-head attention\uff0c\u7528\u5230\u4e86\u591a\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e86\u591a\u6b21attention\uff0c\u6bcf\u4e2aquery\u90fd\u5173\u6ce8\u5230\u539f\u6587\u7684\u4e0d\u540c\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u91cd\u590d\u505a\u591a\u6b21\u5355\u5c42attention\uff1a \\[ head_i = Attention(q_i, K, V) \\] \u6700\u540e\u518d\u628a\u8fd9\u4e9b\u7ed3\u679c\u62fc\u63a5\u8d77\u6765\uff1a \\[ MultiHead(Q, K, V) = Concat(head_1, ..., head_h)W^O \\] \u6a21\u578b\u65b9\u9762 \u00b6 \u4ece\u6a21\u578b\u4e0a\u770b\uff0cAttention \u4e00\u822c\u7528\u5728 CNN \u548c LSTM \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u7eaf Attention \u8ba1\u7b97\u3002 CNN + Attention CNN\u7684\u5377\u79ef\u64cd\u4f5c\u53ef\u4ee5\u63d0\u53d6\u91cd\u8981\u7279\u5f81\uff0c\u6211\u89c9\u5f97\u8fd9\u4e5f\u7b97\u662fAttention\u7684\u601d\u60f3\uff0c\u4f46\u662fCNN\u7684\u5377\u79ef\u611f\u53d7\u89c6\u91ce\u662f\u5c40\u90e8\u7684\uff0c\u9700\u8981\u901a\u8fc7\u53e0\u52a0\u591a\u5c42\u5377\u79ef\u533a\u53bb\u6269\u5927\u89c6\u91ce\u3002\u53e6\u5916\uff0cMax Pooling\u76f4\u63a5\u63d0\u53d6\u6570\u503c\u6700\u5927\u7684\u7279\u5f81\uff0c\u4e5f\u50cf\u662fhard attention\u7684\u601d\u60f3\uff0c\u76f4\u63a5\u9009\u4e2d\u67d0\u4e2a\u7279\u5f81\u3002 CNN\u4e0a\u52a0Attention\u53ef\u4ee5\u52a0\u5728\u8fd9\u51e0\u65b9\u9762\uff1a a. \u5728\u5377\u79ef\u64cd\u4f5c\u524d\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-1\uff0c\u8fd9\u4e2a\u4efb\u52a1\u662f\u6587\u672c\u8574\u542b\u4efb\u52a1\u9700\u8981\u5904\u7406\u4e24\u6bb5\u6587\u672c\uff0c\u540c\u65f6\u5bf9\u4e24\u6bb5\u8f93\u5165\u7684\u5e8f\u5217\u5411\u91cf\u8fdb\u884cattention\uff0c\u8ba1\u7b97\u51fa\u7279\u5f81\u5411\u91cf\uff0c\u518d\u62fc\u63a5\u5230\u539f\u59cb\u5411\u91cf\u4e2d\uff0c\u4f5c\u4e3a\u5377\u79ef\u5c42\u7684\u8f93\u5165\u3002 b. \u5728\u5377\u79ef\u64cd\u4f5c\u540e\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-2\uff0c\u5bf9\u4e24\u6bb5\u6587\u672c\u7684\u5377\u79ef\u5c42\u7684\u8f93\u51fa\u505aattention\uff0c\u4f5c\u4e3apooling\u5c42\u7684\u8f93\u5165\u3002 c. \u5728pooling\u5c42\u505aattention\uff0c\u4ee3\u66ffmax pooling\u3002\u6bd4\u5982Attention pooling\uff0c\u9996\u5148\u6211\u4eec\u7528LSTM\u5b66\u5230\u4e00\u4e2a\u6bd4\u8f83\u597d\u7684\u53e5\u5411\u91cf\uff0c\u4f5c\u4e3aquery\uff0c\u7136\u540e\u7528CNN\u5148\u5b66\u4e60\u5230\u4e00\u4e2a\u7279\u5f81\u77e9\u9635\u4f5c\u4e3akey\uff0c\u518d\u7528query\u5bf9key\u4ea7\u751f\u6743\u91cd\uff0c\u8fdb\u884cattention\uff0c\u5f97\u5230\u6700\u540e\u7684\u53e5\u5411\u91cf\u3002 LSTM+Attention LSTM\u5185\u90e8\u6709Gate\u673a\u5236\uff0c\u5176\u4e2dinput gate\u9009\u62e9\u54ea\u4e9b\u5f53\u524d\u4fe1\u606f\u8fdb\u884c\u8f93\u5165\uff0cforget gate\u9009\u62e9\u9057\u5fd8\u54ea\u4e9b\u8fc7\u53bb\u4fe1\u606f\uff0c\u6211\u89c9\u5f97\u8fd9\u7b97\u662f\u4e00\u5b9a\u7a0b\u5ea6\u7684Attention\u4e86\uff0c\u800c\u4e14\u53f7\u79f0\u53ef\u4ee5\u89e3\u51b3\u957f\u671f\u4f9d\u8d56\u95ee\u9898\uff0c\u5b9e\u9645\u4e0aLSTM\u9700\u8981\u4e00\u6b65\u4e00\u6b65\u53bb\u6355\u6349\u5e8f\u5217\u4fe1\u606f\uff0c\u5728\u957f\u6587\u672c\u4e0a\u7684\u8868\u73b0\u662f\u4f1a\u968f\u7740step\u589e\u52a0\u800c\u6162\u6162\u8870\u51cf\uff0c\u96be\u4ee5\u4fdd\u7559\u5168\u90e8\u7684\u6709\u7528\u4fe1\u606f\u3002 LSTM\u901a\u5e38\u9700\u8981\u5f97\u5230\u4e00\u4e2a\u5411\u91cf\uff0c\u518d\u53bb\u505a\u4efb\u52a1\uff0c\u5e38\u7528\u65b9\u5f0f\u6709\uff1a a. \u76f4\u63a5\u4f7f\u7528\u6700\u540e\u7684hidden state\uff08\u53ef\u80fd\u4f1a\u635f\u5931\u4e00\u5b9a\u7684\u524d\u6587\u4fe1\u606f\uff0c\u96be\u4ee5\u8868\u8fbe\u5168\u6587\uff09 b. \u5bf9\u6240\u6709step\u4e0b\u7684hidden state\u8fdb\u884c\u7b49\u6743\u5e73\u5747\uff08\u5bf9\u6240\u6709step\u4e00\u89c6\u540c\u4ec1\uff09\u3002 c. Attention\u673a\u5236\uff0c\u5bf9\u6240\u6709step\u7684hidden state\u8fdb\u884c\u52a0\u6743\uff0c\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u6574\u6bb5\u6587\u672c\u4e2d\u6bd4\u8f83\u91cd\u8981\u7684hidden state\u4fe1\u606f\u3002\u6027\u80fd\u6bd4\u524d\u9762\u4e24\u79cd\u8981\u597d\u4e00\u70b9\uff0c\u800c\u65b9\u4fbf\u53ef\u89c6\u5316\u89c2\u5bdf\u54ea\u4e9bstep\u662f\u91cd\u8981\u7684\uff0c\u4f46\u662f\u8981\u5c0f\u5fc3\u8fc7\u62df\u5408\uff0c\u800c\u4e14\u4e5f\u589e\u52a0\u4e86\u8ba1\u7b97\u91cf\u3002 \u7eafAttention Attention is all you need\uff0c\u6ca1\u6709\u7528\u5230CNN/RNN\uff0c\u4e4d\u4e00\u542c\u4e5f\u662f\u4e00\u80a1\u6e05\u6d41\u4e86\uff0c\u4f46\u662f\u4ed4\u7ec6\u4e00\u770b\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f\u4e00\u5806\u5411\u91cf\u53bb\u8ba1\u7b97attention\u3002 \u76f8\u4f3c\u5ea6\u8ba1\u7b97\u65b9\u5f0f \u00b6 \u5728\u505aattention\u7684\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97query\u548c\u67d0\u4e2akey\u7684\u5206\u6570\uff08\u76f8\u4f3c\u5ea6\uff09\uff0c\u5e38\u7528\u65b9\u6cd5\u6709\uff1a \u70b9\u4e58\uff1a \\(score(q,k)=q^\\top k\\) \u77e9\u9635\u76f8\u4e58\uff1a \\(score(q,k)=q^\\top Wk\\) \u4f59\u5f26\u76f8\u4f3c\u5ea6\uff1a \\(score(q,k)=\\frac{q^\\top k}{\\|q\\| \\cdot \\|k\\|}\\) \u4e32\u8054\u65b9\u5f0f\uff0c\u628aq\u548ck\u62fc\u63a5\u8d77\u6765\uff1a \\(score(q,k)=W[q;k]\\) \u591a\u5c42\u611f\u77e5\u673a\uff1a \\(score(q,k)=v_a^\\top tanh(Wq+Uk)\\) Reference \u00b6 Encoder-Decoder \u548c Seq2Seq \u4e00\u6587\u770b\u61c2 Attention\uff08\u672c\u8d28\u539f\u7406+3\u5927\u4f18\u70b9+5\u5927\u7c7b\u578b\uff09 \u904d\u5730\u5f00\u82b1\u7684 Attention\uff0c\u4f60\u771f\u7684\u61c2\u5417\uff1f","title":"Attention"},{"location":"llm/transformer/attention/#attention","text":"\u7ea6 2743 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u5bf9\u4e8e RNN \u4e2d\u5b58\u5728\u7684\u4fe1\u606f\u74f6\u9888\u95ee\u9898\uff0c\u6ce8\u610f\u529b\u673a\u5236\u53ef\u4ee5\u5f88\u597d\u5730\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u3002 \u672c\u6587\u5c06\u4ecb\u7ecd Encoder-Decoder\u3001Seq2Seq \u4ee5\u53ca Attention \u673a\u5236\u3002","title":"Attention \u673a\u5236"},{"location":"llm/transformer/attention/#encoder-decoder","text":"Encoder-Decoder \u6a21\u578b\u4e3b\u8981\u662f NLP \u9886\u57df\u91cc\u7684\u6982\u5ff5\u3002\u5b83\u5e76\u4e0d\u7279\u503c\u67d0\u79cd\u5177\u4f53\u7684\u7b97\u6cd5\uff0c\u800c\u662f\u4e00\u7c7b\u7b97\u6cd5\u7684\u7edf\u79f0\u3002Encoder-Decoder \u7b97\u662f\u4e00\u4e2a\u901a\u7528\u7684\u6846\u67b6\uff0c\u5728\u8fd9\u4e2a\u6846\u67b6\u4e0b\u53ef\u4ee5\u4f7f\u7528\u4e0d\u540c\u7684\u7b97\u6cd5\u6765\u89e3\u51b3\u4e0d\u540c\u7684\u4efb\u52a1\u3002 Encoder-Decoder \u6846\u67b6\u5f88\u597d\u5730\u8be0\u91ca\u4e86\u673a\u5668\u5b66\u4e60\u7684\u6838\u5fc3\u601d\u8def\uff1a \u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\uff0c\u901a\u8fc7\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u4ece\u800c\u89e3\u51b3\u73b0\u5b9e\u95ee\u9898 Encoder \u53c8\u79f0\u7f16\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u5c06\u73b0\u5b9e\u95ee\u9898\u8f6c\u5316\u4e3a\u6570\u5b66\u95ee\u9898\u300f\u3002 Decoder \u53c8\u79f0\u89e3\u7801\u5668\uff0c\u5b83\u7684\u4f5c\u7528\u5c31\u662f\u300e\u6c42\u89e3\u6570\u5b66\u95ee\u9898\uff0c\u5e76\u8f6c\u5316\u4e3a\u73b0\u5b9e\u4e16\u754c\u7684\u89e3\u51b3\u65b9\u6848\u300f\u3002 \u5173\u4e8e Encoder-Decoder\uff1a \u4e0d\u8bba\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u662f\u4ec0\u4e48\uff0c\u4e2d\u95f4\u7684 \u5411\u91cfc \u7684\u957f\u5ea6\u90fd\u662f\u56fa\u5b9a\u7684\uff08\u8fd9\u4e5f\u662f\u5b83\u7684\u7f3a\u9677\uff09\u3002 \u6839\u636e\u4e0d\u540c\u7684\u4efb\u52a1\u53ef\u4ee5\u9009\u62e9\u4e0d\u540c\u7684\u7f16\u7801\u5668\u548c\u89e3\u7801\u5668\uff08\u53ef\u4ee5\u662f\u4e00\u4e2a RNN\uff0c\u4f46\u901a\u5e38\u662f\u5176\u53d8\u79cd LSTM \u6216\u8005 GRU\uff09\u3002 Encoder-Decoder \u7684\u7f3a\u9677 \u4e3a\u4e86\u4fbf\u4e8e\u7406\u89e3\uff0c\u6211\u4eec\u7c7b\u6bd4\u4e3a\u300c\u538b\u7f29-\u89e3\u538b\u300d\u7684\u8fc7\u7a0b\uff1a \u5c06\u4e00\u5f20 800X800 \u50cf\u7d20\u7684\u56fe\u7247\u538b\u7f29\u6210 100KB\uff0c\u770b\u4e0a\u53bb\u8fd8\u6bd4\u8f83\u6e05\u6670\u3002\u518d\u5c06\u4e00\u5f20 3000X3000 \u50cf\u7d20\u7684\u56fe\u7247\u4e5f\u538b\u7f29\u5230 100KB\uff0c\u770b\u4e0a\u53bb\u5c31\u6a21\u7cca\u4e86\u3002 Encoder-Decoder \u5c31\u662f\u7c7b\u4f3c\u7684\u95ee\u9898\uff1a\u5f53\u8f93\u5165\u4fe1\u606f\u592a\u957f\u65f6\uff0c\u4f1a\u4e22\u5931\u6389\u4e00\u4e9b\u4fe1\u606f\u3002","title":"Encoder-Decoder"},{"location":"llm/transformer/attention/#seq2seq","text":"","title":"Seq2Seq"},{"location":"llm/transformer/attention/#_1","text":"Seq2Seq\uff08\u662f Sequence to Sequence \u7684\u7f29\u5199\uff09\uff0c\u5b57\u9762\u610f\u601d\u5c31\u662f\u8f93\u5165\u4e00\u4e2a\u5e8f\u5217\uff0c\u8f93\u51fa\u53e6\u4e00\u4e2a\u5e8f\u5217\u3002\u8fd9\u79cd\u7ed3\u6784\u6700\u91cd\u8981\u7684\u5730\u65b9\u5728\u4e8e\u8f93\u5165\u5e8f\u5217\u548c\u8f93\u51fa\u5e8f\u5217\u7684\u957f\u5ea6\u53ef\u4ee5\u53ef\u53d8\u7684\u3002\u4f8b\u5982\u4e0b\u56fe\uff1a \u5982\u4e0a\u56fe\uff1a\u8f93\u5165\u4e86 6 \u4e2a\u6c49\u5b57\uff0c\u8f93\u51fa\u4e86 3 \u4e2a\u82f1\u6587\u5355\u8bcd\u3002\u8f93\u5165\u548c\u8f93\u51fa\u7684\u957f\u5ea6\u4e0d\u540c\u3002","title":"\u6982\u8ff0"},{"location":"llm/transformer/attention/#seq2seq-encoder-decoder","text":"Seq2Seq\uff08\u5f3a\u8c03\u76ee\u7684\uff09\u4e0d\u7279\u6307\u5177\u4f53\u65b9\u6cd5\uff0c\u6ee1\u8db3\u300c\u8f93\u5165\u5e8f\u5217\u3001\u8f93\u51fa\u5e8f\u5217\u300d\u7684\u76ee\u7684\uff0c\u90fd\u53ef\u4ee5\u7edf\u79f0\u4e3a Seq2Seq \u6a21\u578b\u3002 \u800c Seq2Seq \u4f7f\u7528\u7684\u5177\u4f53\u65b9\u6cd5\u57fa\u672c\u90fd\u5c5e\u4e8eEncoder-Decoder \u6a21\u578b\uff08\u5f3a\u8c03\u65b9\u6cd5\uff09\u7684\u8303\u7574\u3002 \u603b\u7ed3\u4e00\u4e0b\u7684\u8bdd\uff1a Seq2Seq \u5c5e\u4e8e Encoder-Decoder \u7684\u5927\u8303\u7574 Seq2Seq \u66f4\u5f3a\u8c03\u76ee\u7684\uff0cEncoder-Decoder \u66f4\u5f3a\u8c03\u65b9\u6cd5","title":"Seq2Seq \u548c Encoder-Decoder \u7684\u5173\u7cfb"},{"location":"llm/transformer/attention/#attention_1","text":"","title":"Attention"},{"location":"llm/transformer/attention/#_2","text":"Attention\uff08\u6ce8\u610f\u529b\uff09\u673a\u5236\u5982\u679c\u6d45\u5c42\u7684\u7406\u89e3\uff0c\u8ddf\u4ed6\u7684\u540d\u5b57\u975e\u5e38\u5339\u914d\u3002\u4ed6\u7684\u6838\u5fc3\u903b\u8f91\u5c31\u662f\u300c\u4ece\u5173\u6ce8\u5168\u90e8\u5230\u5173\u6ce8\u91cd\u70b9\u300d\u3002\u6211\u4eec\u7684\u89c6\u89c9\u7cfb\u7edf\u5c31\u662f\u4e00\u79cd Attention \u673a\u5236\uff0c\u5c06\u6709\u9650\u7684\u6ce8\u610f\u529b\u96c6\u4e2d\u5728\u91cd\u70b9\u4fe1\u606f\u4e0a\uff0c\u4ece\u800c\u8282\u7701\u8d44\u6e90\uff0c\u5feb\u901f\u83b7\u5f97\u6700\u6709\u6548\u7684\u4fe1\u606f\u3002 Attention \u673a\u5236\u6700\u65e9\u662f\u5728\u8ba1\u7b97\u673a\u89c6\u89c9\u91cc\u5e94\u7528\u7684\uff0c\u968f\u540e\u5728 NLP \u9886\u57df\u4e5f\u5f00\u59cb\u5e94\u7528\u4e86\uff0c\u771f\u6b63\u53d1\u626c\u5149\u5927\u662f\u5728 NLP \u9886\u57df\uff0c\u56e0\u4e3a 2018 \u5e74 BERT \u548c GPT \u7684\u6548\u679c\u51fa\u5947\u7684\u597d\uff0c\u8fdb\u800c\u8d70\u7ea2\u3002\u800c Transformer \u548c Attention \u8fd9\u4e9b\u6838\u5fc3\u5f00\u59cb\u88ab\u5927\u5bb6\u91cd\u70b9\u5173\u6ce8\u3002 \u5982\u679c\u7528\u56fe\u6765\u8868\u8fbe Attention \u7684\u4f4d\u7f6e\u5927\u81f4\u662f\u4e0b\u9762\u7684\u6837\u5b50\uff1a","title":"\u672c\u8d28"},{"location":"llm/transformer/attention/#_3","text":"\u4e4b\u6240\u4ee5\u8981\u5f15\u5165 Attention \u673a\u5236\uff0c\u4e3b\u8981\u662f 3 \u4e2a\u539f\u56e0\uff1a \u53c2\u6570\u5c11 \uff1a\u6a21\u578b\u590d\u6742\u5ea6\u66f4 CNN\u3001RNN \u76f8\u6bd4\uff0c\u590d\u6742\u5ea6\u66f4\u5c0f\uff0c\u53c2\u6570\u4e5f\u66f4\u5c11\u3002\u5bf9\u7b97\u529b\u7684\u8981\u6c42\u4e5f\u5c31\u66f4\u5c11\u3002 \u901f\u5ea6\u5feb \uff1aAttention \u89e3\u51b3\u4e86 RNN \u4e0d\u80fd\u5e76\u884c\u8ba1\u7b97\u7684\u95ee\u9898\u3002Attention\u673a\u5236\u6bcf\u4e00\u6b65\u8ba1\u7b97\u4e0d\u4f9d\u8d56\u4e8e\u4e0a\u4e00\u6b65\u7684\u8ba1\u7b97\u7ed3\u679c\uff0c\u56e0\u6b64\u53ef\u4ee5\u548cCNN\u4e00\u6837\u5e76\u884c\u5904\u7406\u3002 \u6548\u679c\u597d \uff1a\u5728 Attention \u673a\u5236\u5f15\u5165\u4e4b\u524d\uff0c\u6709\u4e00\u4e2a\u95ee\u9898\u5927\u5bb6\u4e00\u76f4\u5f88\u82e6\u607c\uff1a\u957f\u8ddd\u79bb\u7684\u4fe1\u606f\u4f1a\u88ab\u5f31\u5316\uff0c\u5c31\u597d\u50cf\u8bb0\u5fc6\u80fd\u529b\u5f31\u7684\u4eba\uff0c\u8bb0\u4e0d\u4f4f\u8fc7\u53bb\u7684\u4e8b\u60c5\u662f\u4e00\u6837\u7684\u3002","title":"\u4e09\u5927\u4f18\u70b9"},{"location":"llm/transformer/attention/#_4","text":"\u4e0b\u9762\u7684\u52a8\u56fe\u6f14\u793a\u4e86 attention \u5f15\u5165 Encoder-Decoder \u6846\u67b6\u4e0b\uff0c\u5b8c\u6210\u673a\u5668\u7ffb\u8bd1\u4efb\u52a1\u7684\u5927\u81f4\u6d41\u7a0b\u3002 \u4f46\u662f\uff0cAttention \u5e76\u4e0d\u4e00\u5b9a\u8981\u5728 Encoder-Decoder \u6846\u67b6\u4e0b\u4f7f\u7528\u7684\uff0c\u4ed6\u662f\u53ef\u4ee5\u8131\u79bb Encoder-Decoder \u6846\u67b6\u7684\u3002 Attention \u539f\u7406\u5206\u4e3a 3 \u6b65\uff1a query \u548c key \u8fdb\u884c\u76f8\u4f3c\u5ea6\u8ba1\u7b97\uff0c\u5f97\u5230\u6743\u503c \u5c06\u6743\u503c\u8fdb\u884c\u5f52\u4e00\u5316\uff0c\u5f97\u5230\u76f4\u63a5\u53ef\u7528\u7684\u6743\u91cd \u5c06\u6743\u91cd\u548c value \u8fdb\u884c\u52a0\u6743\u6c42\u548c \u4ece\u4e0a\u9762\u7684\u5efa\u6a21\uff0c\u53ef\u4ee5\u5927\u81f4\u611f\u53d7\u5230 Attention \u7684\u601d\u8def\u7b80\u5355\uff0c \u56db\u4e2a\u5b57\u201c\u5e26\u6743\u6c42\u548c\u201d \uff0c\u5927\u9053\u81f3\u7b80\u3002","title":"\u539f\u7406"},{"location":"llm/transformer/attention/#n","text":"","title":"N \u79cd\u7c7b\u578b"},{"location":"llm/transformer/attention/#_5","text":"Soft Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u5e38\u89c1\u7684Attention\u65b9\u5f0f\uff0c\u5bf9\u6240\u6709key\u6c42\u6743\u91cd\u6982\u7387\uff0c\u6bcf\u4e2akey\u90fd\u6709\u4e00\u4e2a\u5bf9\u5e94\u7684\u6743\u91cd\uff0c\u662f\u4e00\u79cd\u5168\u5c40\u7684\u8ba1\u7b97\u65b9\u5f0f\uff08\u4e5f\u53ef\u4ee5\u53ebGlobal Attention\uff09\u3002\u8fd9\u79cd\u65b9\u5f0f\u6bd4\u8f83\u7406\u6027\uff0c\u53c2\u8003\u4e86\u6240\u6709key\u7684\u5185\u5bb9\uff0c\u518d\u8fdb\u884c\u52a0\u6743\u3002\u4f46\u662f\u8ba1\u7b97\u91cf\u53ef\u80fd\u4f1a\u6bd4\u8f83\u5927\u4e00\u4e9b\u3002 Hard Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u662f\u76f4\u63a5\u7cbe\u51c6\u5b9a\u4f4d\u5230\u67d0\u4e2akey\uff0c\u5176\u4f59key\u5c31\u90fd\u4e0d\u7ba1\u4e86\uff0c\u76f8\u5f53\u4e8e\u8fd9\u4e2akey\u7684\u6982\u7387\u662f1\uff0c\u5176\u4f59key\u7684\u6982\u7387\u5168\u90e8\u662f0\u3002\u56e0\u6b64\u8fd9\u79cd\u5bf9\u9f50\u65b9\u5f0f\u8981\u6c42\u5f88\u9ad8\uff0c\u8981\u6c42\u4e00\u6b65\u5230\u4f4d\uff0c\u5982\u679c\u6ca1\u6709\u6b63\u786e\u5bf9\u9f50\uff0c\u4f1a\u5e26\u6765\u5f88\u5927\u7684\u5f71\u54cd\u3002\u53e6\u4e00\u65b9\u9762\uff0c\u56e0\u4e3a\u4e0d\u53ef\u5bfc\uff0c\u4e00\u822c\u9700\u8981\u7528\u5f3a\u5316\u5b66\u4e60\u7684\u65b9\u6cd5\u8fdb\u884c\u8bad\u7ec3\u3002\uff08\u6216\u8005\u4f7f\u7528gumbel softmax\u4e4b\u7c7b\u7684\uff09 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5176\u5b9e\u662f\u4ee5\u4e0a\u4e24\u79cd\u65b9\u5f0f\u7684\u4e00\u4e2a\u6298\u4e2d\uff0c\u5bf9\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\u8fdb\u884c\u8ba1\u7b97\u3002\u5148\u7528Hard\u65b9\u5f0f\u5b9a\u4f4d\u5230\u67d0\u4e2a\u5730\u65b9\uff0c\u4ee5\u8fd9\u4e2a\u70b9\u4e3a\u4e2d\u5fc3\u53ef\u4ee5\u5f97\u5230\u4e00\u4e2a\u7a97\u53e3\u533a\u57df\uff0c\u5728\u8fd9\u4e2a\u5c0f\u533a\u57df\u5185\u7528Soft\u65b9\u5f0f\u6765\u7b97Attention\u3002","title":"\u8ba1\u7b97\u533a\u57df"},{"location":"llm/transformer/attention/#_6","text":"\u5047\u8bbe\u6211\u4eec\u8981\u5bf9\u4e00\u6bb5\u539f\u6587\u8ba1\u7b97Attention\uff0c\u8fd9\u91cc\u539f\u6587\u6307\u7684\u662f\u6211\u4eec\u8981\u505aattention\u7684\u6587\u672c\uff0c\u90a3\u4e48\u6240\u7528\u4fe1\u606f\u5305\u62ec\u5185\u90e8\u4fe1\u606f\u548c\u5916\u90e8\u4fe1\u606f\uff0c\u5185\u90e8\u4fe1\u606f\u6307\u7684\u662f\u539f\u6587\u672c\u8eab\u7684\u4fe1\u606f\uff0c\u800c\u5916\u90e8\u4fe1\u606f\u6307\u7684\u662f\u9664\u539f\u6587\u4ee5\u5916\u7684\u989d\u5916\u4fe1\u606f\u3002 General Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u5229\u7528\u5230\u4e86\u5916\u90e8\u4fe1\u606f\uff0c\u5e38\u7528\u4e8e\u9700\u8981\u6784\u5efa\u4e24\u6bb5\u6587\u672c\u5173\u7cfb\u7684\u4efb\u52a1\uff0cquery\u4e00\u822c\u5305\u542b\u4e86\u989d\u5916\u4fe1\u606f\uff0c\u6839\u636e\u5916\u90e8query\u5bf9\u539f\u6587\u8fdb\u884c\u5bf9\u9f50\u3002 General Attention \u6bd4\u5982\u5728\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u4e2d\uff0c\u9700\u8981\u6784\u5efa\u95ee\u9898\u548c\u6587\u7ae0\u7684\u5173\u8054\uff0c\u5047\u8bbe\u73b0\u5728baseline\u662f\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u95ee\u9898\u5411\u91cfq\uff0c\u628a\u8fd9\u4e2aq\u548c\u6240\u6709\u7684\u6587\u7ae0\u8bcd\u5411\u91cf\u62fc\u63a5\u8d77\u6765\uff0c\u8f93\u5165\u5230LSTM\u4e2d\u8fdb\u884c\u5efa\u6a21\u3002\u90a3\u4e48\u5728\u8fd9\u4e2a\u6a21\u578b\u4e2d\uff0c\u6587\u7ae0\u6240\u6709\u8bcd\u5411\u91cf\u5171\u4eab\u540c\u4e00\u4e2a\u95ee\u9898\u5411\u91cf\uff0c\u73b0\u5728\u6211\u4eec\u60f3\u8ba9\u6587\u7ae0\u6bcf\u4e00\u6b65\u7684\u8bcd\u5411\u91cf\u90fd\u6709\u4e00\u4e2a\u4e0d\u540c\u7684\u95ee\u9898\u5411\u91cf\uff0c\u4e5f\u5c31\u662f\uff0c\u5728\u6bcf\u4e00\u6b65\u4f7f\u7528\u6587\u7ae0\u5728\u8be5\u6b65\u4e0b\u7684\u8bcd\u5411\u91cf\u5bf9\u95ee\u9898\u6765\u7b97attention\uff0c\u8fd9\u91cc\u95ee\u9898\u5c5e\u4e8e\u539f\u6587\uff0c\u6587\u7ae0\u8bcd\u5411\u91cf\u5c31\u5c5e\u4e8e\u5916\u90e8\u4fe1\u606f\u3002 Local Attention \uff0c\u8fd9\u79cd\u65b9\u5f0f\u53ea\u4f7f\u7528\u5185\u90e8\u4fe1\u606f\uff0ckey\u548cvalue\u4ee5\u53caquery\u53ea\u548c\u8f93\u5165\u539f\u6587\u6709\u5173\uff0c\u5728self attention\u4e2d\uff0ckey=value=query\u3002\u65e2\u7136\u6ca1\u6709\u5916\u90e8\u4fe1\u606f\uff0c\u90a3\u4e48\u5728\u539f\u6587\u4e2d\u7684\u6bcf\u4e2a\u8bcd\u53ef\u4ee5\u8ddf\u8be5\u53e5\u5b50\u4e2d\u7684\u6240\u6709\u8bcd\u8fdb\u884cAttention\u8ba1\u7b97\uff0c\u76f8\u5f53\u4e8e\u5bfb\u627e\u539f\u6587\u5185\u90e8\u7684\u5173\u7cfb\u3002 Local Attention \u8fd8\u662f\u4e3e\u9605\u8bfb\u7406\u89e3\u4efb\u52a1\u7684\u4f8b\u5b50\uff0c\u4e0a\u9762\u7684baseline\u4e2d\u63d0\u5230\uff0c\u5bf9\u95ee\u9898\u8ba1\u7b97\u51fa\u4e00\u4e2a\u5411\u91cfq\uff0c\u90a3\u4e48\u8fd9\u91cc\u4e5f\u53ef\u4ee5\u7528\u4e0aattention\uff0c\u53ea\u7528\u95ee\u9898\u81ea\u8eab\u7684\u4fe1\u606f\u53bb\u505aattention\uff0c\u800c\u4e0d\u5f15\u5165\u6587\u7ae0\u4fe1\u606f\u3002","title":"\u6240\u7528\u4fe1\u606f"},{"location":"llm/transformer/attention/#_7","text":"\u7ed3\u6784\u65b9\u9762\u6839\u636e\u662f\u5426\u5212\u5206\u5c42\u6b21\u5173\u7cfb\uff0c\u5206\u4e3a\u5355\u5c42 attention\uff0c\u591a\u5c42 attention \u548c \u591a\u5934 attention\uff1a \u5355\u5c42 Attention \uff0c\u8fd9\u662f\u6bd4\u8f83\u666e\u904d\u7684\u505a\u6cd5\uff0c\u7528\u4e00\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e00\u6b21attention\u3002 \u591a\u5c42 Attention \uff0c\u4e00\u822c\u7528\u4e8e\u6587\u672c\u5177\u6709\u5c42\u6b21\u5173\u7cfb\u7684\u6a21\u578b\uff0c\u5047\u8bbe\u6211\u4eec\u628a\u4e00\u4e2adocument\u5212\u5206\u6210\u591a\u4e2a\u53e5\u5b50\uff0c\u5728\u7b2c\u4e00\u5c42\uff0c\u6211\u4eec\u5206\u522b\u5bf9\u6bcf\u4e2a\u53e5\u5b50\u4f7f\u7528attention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u53e5\u5411\u91cf\uff08\u4e5f\u5c31\u662f\u5355\u5c42attention\uff09\uff1b\u5728\u7b2c\u4e8c\u5c42\uff0c\u6211\u4eec\u5bf9\u6240\u6709\u53e5\u5411\u91cf\u518d\u505aattention\u8ba1\u7b97\u51fa\u4e00\u4e2a\u6587\u6863\u5411\u91cf\uff08\u4e5f\u662f\u4e00\u4e2a\u5355\u5c42attention\uff09\uff0c\u6700\u540e\u518d\u7528\u8fd9\u4e2a\u6587\u6863\u5411\u91cf\u53bb\u505a\u4efb\u52a1\u3002 \u591a\u5934 Attention \uff0c\u8fd9\u662fAttention is All You Need\u4e2d\u63d0\u5230\u7684multi-head attention\uff0c\u7528\u5230\u4e86\u591a\u4e2aquery\u5bf9\u4e00\u6bb5\u539f\u6587\u8fdb\u884c\u4e86\u591a\u6b21attention\uff0c\u6bcf\u4e2aquery\u90fd\u5173\u6ce8\u5230\u539f\u6587\u7684\u4e0d\u540c\u90e8\u5206\uff0c\u76f8\u5f53\u4e8e\u91cd\u590d\u505a\u591a\u6b21\u5355\u5c42attention\uff1a \\[ head_i = Attention(q_i, K, V) \\] \u6700\u540e\u518d\u628a\u8fd9\u4e9b\u7ed3\u679c\u62fc\u63a5\u8d77\u6765\uff1a \\[ MultiHead(Q, K, V) = Concat(head_1, ..., head_h)W^O \\]","title":"\u7ed3\u6784\u5c42\u6b21"},{"location":"llm/transformer/attention/#_8","text":"\u4ece\u6a21\u578b\u4e0a\u770b\uff0cAttention \u4e00\u822c\u7528\u5728 CNN \u548c LSTM \u4e0a\uff0c\u4e5f\u53ef\u4ee5\u76f4\u63a5\u8fdb\u884c\u7eaf Attention \u8ba1\u7b97\u3002 CNN + Attention CNN\u7684\u5377\u79ef\u64cd\u4f5c\u53ef\u4ee5\u63d0\u53d6\u91cd\u8981\u7279\u5f81\uff0c\u6211\u89c9\u5f97\u8fd9\u4e5f\u7b97\u662fAttention\u7684\u601d\u60f3\uff0c\u4f46\u662fCNN\u7684\u5377\u79ef\u611f\u53d7\u89c6\u91ce\u662f\u5c40\u90e8\u7684\uff0c\u9700\u8981\u901a\u8fc7\u53e0\u52a0\u591a\u5c42\u5377\u79ef\u533a\u53bb\u6269\u5927\u89c6\u91ce\u3002\u53e6\u5916\uff0cMax Pooling\u76f4\u63a5\u63d0\u53d6\u6570\u503c\u6700\u5927\u7684\u7279\u5f81\uff0c\u4e5f\u50cf\u662fhard attention\u7684\u601d\u60f3\uff0c\u76f4\u63a5\u9009\u4e2d\u67d0\u4e2a\u7279\u5f81\u3002 CNN\u4e0a\u52a0Attention\u53ef\u4ee5\u52a0\u5728\u8fd9\u51e0\u65b9\u9762\uff1a a. \u5728\u5377\u79ef\u64cd\u4f5c\u524d\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-1\uff0c\u8fd9\u4e2a\u4efb\u52a1\u662f\u6587\u672c\u8574\u542b\u4efb\u52a1\u9700\u8981\u5904\u7406\u4e24\u6bb5\u6587\u672c\uff0c\u540c\u65f6\u5bf9\u4e24\u6bb5\u8f93\u5165\u7684\u5e8f\u5217\u5411\u91cf\u8fdb\u884cattention\uff0c\u8ba1\u7b97\u51fa\u7279\u5f81\u5411\u91cf\uff0c\u518d\u62fc\u63a5\u5230\u539f\u59cb\u5411\u91cf\u4e2d\uff0c\u4f5c\u4e3a\u5377\u79ef\u5c42\u7684\u8f93\u5165\u3002 b. \u5728\u5377\u79ef\u64cd\u4f5c\u540e\u505aattention\uff0c\u6bd4\u5982Attention-Based BCNN-2\uff0c\u5bf9\u4e24\u6bb5\u6587\u672c\u7684\u5377\u79ef\u5c42\u7684\u8f93\u51fa\u505aattention\uff0c\u4f5c\u4e3apooling\u5c42\u7684\u8f93\u5165\u3002 c. \u5728pooling\u5c42\u505aattention\uff0c\u4ee3\u66ffmax pooling\u3002\u6bd4\u5982Attention pooling\uff0c\u9996\u5148\u6211\u4eec\u7528LSTM\u5b66\u5230\u4e00\u4e2a\u6bd4\u8f83\u597d\u7684\u53e5\u5411\u91cf\uff0c\u4f5c\u4e3aquery\uff0c\u7136\u540e\u7528CNN\u5148\u5b66\u4e60\u5230\u4e00\u4e2a\u7279\u5f81\u77e9\u9635\u4f5c\u4e3akey\uff0c\u518d\u7528query\u5bf9key\u4ea7\u751f\u6743\u91cd\uff0c\u8fdb\u884cattention\uff0c\u5f97\u5230\u6700\u540e\u7684\u53e5\u5411\u91cf\u3002 LSTM+Attention LSTM\u5185\u90e8\u6709Gate\u673a\u5236\uff0c\u5176\u4e2dinput gate\u9009\u62e9\u54ea\u4e9b\u5f53\u524d\u4fe1\u606f\u8fdb\u884c\u8f93\u5165\uff0cforget gate\u9009\u62e9\u9057\u5fd8\u54ea\u4e9b\u8fc7\u53bb\u4fe1\u606f\uff0c\u6211\u89c9\u5f97\u8fd9\u7b97\u662f\u4e00\u5b9a\u7a0b\u5ea6\u7684Attention\u4e86\uff0c\u800c\u4e14\u53f7\u79f0\u53ef\u4ee5\u89e3\u51b3\u957f\u671f\u4f9d\u8d56\u95ee\u9898\uff0c\u5b9e\u9645\u4e0aLSTM\u9700\u8981\u4e00\u6b65\u4e00\u6b65\u53bb\u6355\u6349\u5e8f\u5217\u4fe1\u606f\uff0c\u5728\u957f\u6587\u672c\u4e0a\u7684\u8868\u73b0\u662f\u4f1a\u968f\u7740step\u589e\u52a0\u800c\u6162\u6162\u8870\u51cf\uff0c\u96be\u4ee5\u4fdd\u7559\u5168\u90e8\u7684\u6709\u7528\u4fe1\u606f\u3002 LSTM\u901a\u5e38\u9700\u8981\u5f97\u5230\u4e00\u4e2a\u5411\u91cf\uff0c\u518d\u53bb\u505a\u4efb\u52a1\uff0c\u5e38\u7528\u65b9\u5f0f\u6709\uff1a a. \u76f4\u63a5\u4f7f\u7528\u6700\u540e\u7684hidden state\uff08\u53ef\u80fd\u4f1a\u635f\u5931\u4e00\u5b9a\u7684\u524d\u6587\u4fe1\u606f\uff0c\u96be\u4ee5\u8868\u8fbe\u5168\u6587\uff09 b. \u5bf9\u6240\u6709step\u4e0b\u7684hidden state\u8fdb\u884c\u7b49\u6743\u5e73\u5747\uff08\u5bf9\u6240\u6709step\u4e00\u89c6\u540c\u4ec1\uff09\u3002 c. Attention\u673a\u5236\uff0c\u5bf9\u6240\u6709step\u7684hidden state\u8fdb\u884c\u52a0\u6743\uff0c\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u6574\u6bb5\u6587\u672c\u4e2d\u6bd4\u8f83\u91cd\u8981\u7684hidden state\u4fe1\u606f\u3002\u6027\u80fd\u6bd4\u524d\u9762\u4e24\u79cd\u8981\u597d\u4e00\u70b9\uff0c\u800c\u65b9\u4fbf\u53ef\u89c6\u5316\u89c2\u5bdf\u54ea\u4e9bstep\u662f\u91cd\u8981\u7684\uff0c\u4f46\u662f\u8981\u5c0f\u5fc3\u8fc7\u62df\u5408\uff0c\u800c\u4e14\u4e5f\u589e\u52a0\u4e86\u8ba1\u7b97\u91cf\u3002 \u7eafAttention Attention is all you need\uff0c\u6ca1\u6709\u7528\u5230CNN/RNN\uff0c\u4e4d\u4e00\u542c\u4e5f\u662f\u4e00\u80a1\u6e05\u6d41\u4e86\uff0c\u4f46\u662f\u4ed4\u7ec6\u4e00\u770b\uff0c\u672c\u8d28\u4e0a\u8fd8\u662f\u4e00\u5806\u5411\u91cf\u53bb\u8ba1\u7b97attention\u3002","title":"\u6a21\u578b\u65b9\u9762"},{"location":"llm/transformer/attention/#_9","text":"\u5728\u505aattention\u7684\u65f6\u5019\uff0c\u6211\u4eec\u9700\u8981\u8ba1\u7b97query\u548c\u67d0\u4e2akey\u7684\u5206\u6570\uff08\u76f8\u4f3c\u5ea6\uff09\uff0c\u5e38\u7528\u65b9\u6cd5\u6709\uff1a \u70b9\u4e58\uff1a \\(score(q,k)=q^\\top k\\) \u77e9\u9635\u76f8\u4e58\uff1a \\(score(q,k)=q^\\top Wk\\) \u4f59\u5f26\u76f8\u4f3c\u5ea6\uff1a \\(score(q,k)=\\frac{q^\\top k}{\\|q\\| \\cdot \\|k\\|}\\) \u4e32\u8054\u65b9\u5f0f\uff0c\u628aq\u548ck\u62fc\u63a5\u8d77\u6765\uff1a \\(score(q,k)=W[q;k]\\) \u591a\u5c42\u611f\u77e5\u673a\uff1a \\(score(q,k)=v_a^\\top tanh(Wq+Uk)\\)","title":"\u76f8\u4f3c\u5ea6\u8ba1\u7b97\u65b9\u5f0f"},{"location":"llm/transformer/attention/#reference","text":"Encoder-Decoder \u548c Seq2Seq \u4e00\u6587\u770b\u61c2 Attention\uff08\u672c\u8d28\u539f\u7406+3\u5927\u4f18\u70b9+5\u5927\u7c7b\u578b\uff09 \u904d\u5730\u5f00\u82b1\u7684 Attention\uff0c\u4f60\u771f\u7684\u61c2\u5417\uff1f","title":"Reference"},{"location":"llm/transformer/bert/","text":"BERT \u00b6 \u7ea6 1558 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstruct BERT \u4f5c\u4e3a NLP \u9884\u8bad\u7ec3\u6a21\u578b\u91cc\u7684\u7ecf\u5178\u6a21\u578b\u4e4b\u4e00\uff0c\u6548\u679c\u975e\u5e38\u597d\u3002 BERT \u7684\u6a21\u578b\u4ee3\u7801\u548c\u6a21\u578b\u53c2\u6570\u5f00\u6e90\uff0c\u90fd\u53ef\u4ee5\u57fa\u4e8e\u8fd9\u4e2a\u5f3a\u5927\u7684\u6a21\u578b\u7ec4\u4ef6\u642d\u5efa\u81ea\u5df1\u7684 NLP \u7cfb\u7edf\uff0c\u4e5f\u8282\u7701\u5f00\u59cb\u8bad\u7ec3\u8bed\u8a00\u5904\u7406\u6a21\u578b\u6240\u9700\u8981\u7684\u65f6\u95f4\u3001\u7cbe\u529b\u3001\u77e5\u8bc6\u548c\u8d44\u6e90\u3002 BERT\u7684\u5168\u79f0\u662f Bidirectional Encoder Representation from Transformers\uff0c\u5373\u53cc\u5411 Transformer \u7684 Encoder\uff0c\u56e0\u4e3adecoder\u662f\u4e0d\u80fd\u83b7\u8981\u9884\u6d4b\u7684\u4fe1\u606f\u7684\u3002 \u6a21\u578b\u7684\u4e3b\u8981\u521b\u65b0\u70b9\u90fd\u5728pre-train\u65b9\u6cd5\u4e0a\uff0c\u5373\u7528\u4e86Masked LM\u548cNext Sentence Prediction\u4e24\u79cd\u65b9\u6cd5\u5206\u522b\u6355\u6349\u8bcd\u8bed\u548c\u53e5\u5b50\u7ea7\u522b\u7684representation\u3002 Introduction \u00b6 BERT \u9996\u5148\u5728\u5927\u89c4\u6a21\u65e0\u76d1\u7763\u8bed\u6599\u4e0a\u8fdb\u884c\u9884\u8bad\u7ec3\uff0c\u7136\u540e\u5728\u9884\u8bad\u7ec3\u597d\u7684\u53c2\u6570\u57fa\u7840\u4e0a\u589e\u52a0\u4e00\u4e2a\u4e0e\u4efb\u52a1\u76f8\u5173\u7684\u795e\u7ecf\u7f51\u7edc\u5c42\uff0c\u5e76\u5728\u8be5\u4efb\u52a1\u7684\u6570\u636e\u4e0a\u8fdb\u884c\u5fae\u8c03\uff0c\u6700\u7ec8\u53d6\u5f97\u5f88\u597d\u7684\u6548\u679c\u3002 BERT\u7684\u8bad\u7ec3\u8fc7\u7a0b\u53ef\u4ee5\u7b80\u8ff0\u4e3a\uff1a\u9884\u8bad\u7ec3+\u5fae\u8c03\uff08finetune\uff09\uff0c\u8fd9\u662f\u8fd1\u51e0\u5e74 NLP \u89e3\u51b3\u65b9\u6848\u7684\u4e3b\u6d41\u8303\u5f0f\u3002 \u6a21\u578b\u7ed3\u6784 \u00b6 BERT\u6a21\u578b\u7684\u7ed3\u6784\u5982\u4e0b\u56fe\u6700\u5de6\uff1a \u5bf9\u6bd4 OpenAI GPT\uff0cBERT \u662f\u53cc\u5411\u7684 Transformer block \u8fde\u63a5\uff0c\u5c31\u50cf\u5355\u5411 RNN \u548c\u53cc\u5411 RNN \u7684\u533a\u522b\uff0c\u6548\u679c\u4f1a\u66f4\u597d\u3002 \u5bf9\u6bd4 ELMo\uff0c\u867d\u7136\u90fd\u662f\u201c\u53cc\u5411\u201d\uff0c\u4f46\u76ee\u6807\u51fd\u6570\u4e0d\u540c\u3002 ELMo \u662f\u5206\u522b\u4ee5 \\(P(w_i|w_1,...,w_{i-1})\\) \u548c \\(P(w_i|w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\uff0c\u72ec\u7acb\u8bad\u7ec3\u51fa\u4e24\u4e2a representation \u7136\u540e\u8fde\u63a5 BERT \u662f\u4ee5 \\(P(w_i | w_1,...,w_{i-1},w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\u8bad\u7ec3 LM \u547d\u540d\u8868\u793a\u5c42\u6570\u4e3aL\uff08Transformer Blocks\uff09\uff0c\u9690\u85cf\u5c42\u6570\u4e3aH\uff0c\u81ea\u6ce8\u610f\u529b\u5934\u6570\u91cf\u4e3aA\u3002\u539f\u59cb\u8bba\u6587\u4e2d\u7684\u4e24\u79cd\u6a21\u578b\uff1a BERT_base(L=12,H=768,A=12; parameters=110M) BERT_large(L=24,H=1024,A=16; parameters=340M) Embedding \u00b6 \u8fd9\u91cc\u7684 Embedding \u7531\u4e09\u79cd Embedding \u6c42\u548c\u7ec4\u6210\uff1a Token Embedding \uff1a\u8bcd\u5411\u91cf\uff0c\u7b2c\u4e00\u4e2a\u5355\u8bcd\u662f CLS \u6807\u5fd7\uff0c\u53ef\u4ee5\u7528\u4e8e\u4e4b\u540e\u7684\u5206\u7c7b\u4efb\u52a1 Segment Embedding \uff1a\u53e5\u5b50\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u4e24\u4e2a\u53e5\u5b50\uff0c\u56e0\u4e3a\u9884\u8bad\u7ec3\u4e0d\u5149\u505a LM \u8fd8\u8981\u505a\u4ee5\u4e24\u4e2a\u53e5\u5b50\u4e3a\u8f93\u5165\u7684\u5206\u7c7b\u4efb\u52a1 Position Embedding \uff1a\u4f4d\u7f6e\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u5355\u8bcd\u5728\u53e5\u5b50\u4e2d\u7684\u4f4d\u7f6e\uff0c\u548c\u4e4b\u524d\u7684 Transformer \u4e0d\u4e00\u6837\uff0c\u4e0d\u662f\u4e09\u89d2\u51fd\u6570\u800c\u662f\u5b66\u4e60\u51fa\u6765\u7684 Pre-training \u00b6 Masked LM \uff08MLM\uff09 \u00b6 \u7b2c\u4e00\u6b65\u9884\u8bad\u7ec3\u7684\u76ee\u6807\u5c31\u662f\u505a\u9884\u8a00\u6a21\u578b\uff0c\u4ece\u4e0a\u6587\u6a21\u578b\u7ed3\u6784\u4e2d\u770b\u5230\u4e86\u8fd9\u4e2a\u6a21\u578b\u7684\u4e0d\u540c\uff0c\u5373 bidirectional\u3002 \u4e3a\u4ec0\u4e48\u8981 bidirectional \u5982\u679c\u4f7f\u7528\u9884\u8bad\u7ec3\u6a21\u578b\u5904\u7406\u5176\u4ed6\u4efb\u52a1\uff0c\u90a3\u4eba\u4eec\u60f3\u8981\u7684\u4e0d\u6b62\u67d0\u4e2a\u8bcd\u7684\u5de6\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u662f\u5de6\u53f3\u4e24\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u8003\u8651\u5230\u8fd9\u70b9\u7684\u6a21\u578b ELMo \u53ea\u662f\u5c06 left-to-right \u548c right-to-left \u5206\u522b\u8bad\u7ec3\u62fc\u63a5\u8d77\u6765\u3002\u76f4\u89c9\u4e0a\u6765\u8bb2\u6211\u4eec\u5176\u5b9e\u60f3\u8981\u4e00\u4e2a deeply bidirectional \u7684\u6a21\u578b\uff0c\u4f46\u662f\u666e\u901a\u7684LM\u53c8\u65e0\u6cd5\u505a\u5230\uff0c\u56e0\u4e3a\u5728\u8bad\u7ec3\u65f6\u53ef\u80fd\u4f1a\u201c\u7a7f\u8d8a\u201d\uff0c\u6240\u4ee5\u4f5c\u8005\u7528\u4e86\u4e00\u4e2a\u52a0mask\u7684trick\u3002 \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4f5c\u8005\u968f\u673a mask 15% \u7684 token\uff0c\u800c\u4e0d\u662f\u628a\u50cf CBOW \u4e00\u6837\u628a\u6bcf\u4e2a\u8bcd\u90fd\u9884\u6d4b\u4e00\u904d\u3002 \u6700\u7ec8\u7684\u635f\u5931\u51fd\u6570\u53ea\u8ba1\u7b97\u88ab mask \u6389\u90a3\u4e48 token \u3002 mask \u5982\u4f55\u505a\u4e5f\u662f\u6709\u6280\u5de7\u7684\uff0c\u5982\u679c\u4e00\u76f4\u7528\u6807\u8bb0 [MASK] \u4ee3\u66ff\uff08\u5728\u5b9e\u9645\u9884\u6d4b\u65f6\u662f\u78b0\u4e0d\u5230\u8fd9\u4e2a\u6807\u8bb0\u7684\uff09\u4f1a\u5f71\u54cd\u6a21\u578b\uff0c\u6240\u4ee5\u968f\u673a mask \u7684\u65f6\u5019 10% \u7684\u5355\u8bcd\u4f1a\u88ab\u66ff\u4ee3\u6210\u5176\u4ed6\u5355\u8bcd\uff0c10% \u7684\u5355\u8bcd\u4e0d\u66ff\u6362\uff0c\u5269\u4e0b 80% \u624d\u88ab\u66ff\u6362\u4e3a [MASK]\u3002\u8981\u6ce8\u610f\u7684\u662f Masked LM \u9884\u8bad\u7ec3\u9636\u6bb5\u6a21\u578b\u662f\u4e0d\u77e5\u9053\u771f\u6b63\u88ab mask \u7684\u54ea\u4e2a\u8bcd\uff0c\u6240\u4ee5\u6a21\u578b\u6bcf\u4e2a\u8bcd\u90fd\u8981\u5173\u6ce8\u3002 \u4e3a\u4ec0\u4e48\u8fd9\u4e48\u5206\u914d\u6bd4\u4f8b \u5982\u679c\u53e5\u5b50\u4e2d\u7684\u67d0\u4e2aToken100%\u90fd\u4f1a\u88abmask\u6389\uff0c\u90a3\u4e48\u5728fine-tuning\u7684\u65f6\u5019\u6a21\u578b\u5c31\u4f1a\u6709\u4e00\u4e9b\u6ca1\u6709\u89c1\u8fc7\u7684\u5355\u8bcd\u3002\u52a0\u5165\u968f\u673aToken\u7684\u539f\u56e0\u662f\u56e0\u4e3aTransformer\u8981\u4fdd\u6301\u5bf9\u6bcf\u4e2a\u8f93\u5165token\u7684\u5206\u5e03\u5f0f\u8868\u5f81\uff0c\u5426\u5219\u6a21\u578b\u5c31\u4f1a\u8bb0\u4f4f\u8fd9\u4e2a[mask]\u662ftoken \u2019hairy\u2018\u3002\u81f3\u4e8e\u5355\u8bcd\u5e26\u6765\u7684\u8d1f\u9762\u5f71\u54cd\uff0c\u56e0\u4e3a\u4e00\u4e2a\u5355\u8bcd\u88ab\u968f\u673a\u66ff\u6362\u6389\u7684\u6982\u7387\u53ea\u670915%*10% =1.5%\uff0c\u8fd9\u4e2a\u8d1f\u9762\u5f71\u54cd\u5176\u5b9e\u662f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002 \u56e0\u4e3a\u5e8f\u5217\u957f\u5ea6\u592a\u5927\uff08512\uff09\u4f1a\u5f71\u54cd\u8bad\u7ec3\u901f\u5ea6\uff0c\u6240\u4ee5 90% \u7684 steps \u90fd\u7528 seq_len=128\uff0c10% \u7684 steps \u7528 seq_len=512\u3002 Next Sentence Prediction \uff08NSP\uff09 \u00b6 \u56e0\u4e3a\u6d89\u53ca\u5230QA\u548cNLI\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u589e\u52a0\u4e86\u7b2c\u4e8c\u4e2a\u9884\u8bad\u7ec3\u4efb\u52a1\uff0c\u76ee\u7684\u662f\u8ba9\u6a21\u578b\u7406\u89e3\u4e24\u4e2a\u53e5\u5b50\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 Next Sentence Prediction\uff08NSP\uff09\u7684\u4efb\u52a1\u662f\u5224\u65ad\u53e5\u5b50B\u662f\u5426\u662f\u53e5\u5b50A\u7684\u4e0b\u6587\u3002\u5982\u679c\u662f\u7684\u8bdd\u8f93\u51fa\u2019IsNext\u2018\uff0c\u5426\u5219\u8f93\u51fa\u2019NotNext\u2018\u3002\u8bad\u7ec3\u6570\u636e\u7684\u751f\u6210\u65b9\u5f0f\u662f\u4ece\u5e73\u884c\u8bed\u6599\u4e2d\u968f\u673a\u62bd\u53d6\u7684\u8fde\u7eed\u4e24\u53e5\u8bdd\uff0c\u5176\u4e2d50%\u4fdd\u7559\u62bd\u53d6\u7684\u4e24\u53e5\u8bdd\uff0c\u5b83\u4eec\u7b26\u5408IsNext\u5173\u7cfb\uff0c\u53e6\u591650%\u7684\u7b2c\u4e8c\u53e5\u8bdd\u662f\u968f\u673a\u4ece\u9884\u6599\u4e2d\u63d0\u53d6\u7684\uff0c\u5b83\u4eec\u7684\u5173\u7cfb\u662fNotNext\u7684\u3002 \u9884\u8bad\u7ec3\u7684\u65f6\u5019\u53ef\u4ee5\u8fbe\u5230 97%-98% \u7684\u51c6\u786e\u5ea6\u3002 \u4f5c\u8005\u7279\u610f\u8bf4\u4e86\u8bed\u6599\u7684\u9009\u53d6\u5f88\u5173\u952e\uff0c\u8981\u9009\u7528document-level\u7684\u800c\u4e0d\u662fsentence-level\u7684\uff0c\u8fd9\u6837\u53ef\u4ee5\u5177\u5907\u62bd\u8c61\u8fde\u7eed\u957f\u5e8f\u5217\u7279\u5f81\u7684\u80fd\u529b\u3002 Fine-tuning \u00b6 \u5fae\u8c03\u662f\u7b80\u5355\u7684\uff0c\u56e0\u4e3aTransformer\u4e2d\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236\u5141\u8bb8BERT\u901a\u8fc7\u4ea4\u6362\u9002\u5f53\u7684\u8f93\u5165\u548c\u8f93\u51fa\u6765\u5efa\u6a21\u8bb8\u591a\u4e0b\u6e38\u4efb\u52a1--\u4e0d\u7ba1\u5b83\u4eec\u6d89\u53ca\u5355\u4e2a\u6587\u672c\u8fd8\u662f\u6587\u672c\u5bf9\u3002\u5bf9\u4e8eNSP\u4efb\u52a1\u6765\u8bf4\uff0c\u5176\u6761\u4ef6\u6982\u7387\u8868\u793a\u4e3a \\(P=softmax(CW^T)\\) \uff0c\u5176\u4e2d C \u662f BERT \u8f93\u51fa\u4e2d\u7684 [CLS] \u7b26\u53f7\uff0cW \u662f\u53ef\u5b66\u4e60\u7684\u6743\u503c\u77e9\u9635\u3002 \u5fae\u8c03\u7684\u4efb\u52a1\u5305\u62ec\uff1a \u57fa\u4e8e\u53e5\u5b50\u5bf9\u7684\u5206\u7c7b\u4efb\u52a1 \u57fa\u4e8e\u5355\u4e2a\u53e5\u5b50\u7684\u5206\u7c7b\u4efb\u52a1 \u95ee\u7b54\u4efb\u52a1 \u547d\u540d\u5b9e\u4f53\u8bc6\u522bNER \u4e0b\u56fe\u5c55\u793a\u4e86BERT\u572811\u4e2a\u4e0d\u540c\u4efb\u52a1\u4e2d\u7684\u6a21\u578b\uff0c\u5b83\u4eec\u53ea\u9700\u8981\u5728BERT\u7684\u57fa\u7840\u4e0a\u518d\u6dfb\u52a0\u4e00\u4e2a\u8f93\u51fa\u5c42\u4fbf\u53ef\u4ee5\u5b8c\u6210\u5bf9\u7279\u5b9a\u4efb\u52a1\u7684\u5fae\u8c03\u3002\u8fd9\u4e9b\u4efb\u52a1\u7c7b\u4f3c\u4e8e\u6211\u4eec\u505a\u8fc7\u7684\u6587\u79d1\u8bd5\u5377\uff0c\u5176\u4e2d\u6709\u9009\u62e9\u9898\uff0c\u7b80\u7b54\u9898\u7b49\u7b49\u3002\u56fe3\u4e2d\u5176\u4e2dTok\u8868\u793a\u4e0d\u540c\u7684Token\uff0cE \u8868\u793a\u5d4c\u5165\u5411\u91cf\uff0c \\(T_i\\) \u8868\u793a\u7b2c i \u4e2aToken\u5728\u7ecf\u8fc7BERT\u5904\u7406\u4e4b\u540e\u5f97\u5230\u7684\u7279\u5f81\u5411\u91cf\u3002 \u6574\u4f53 Fine-Tuning \u8fc7\u7a0b\uff1a \u6784\u5efa\u56fe\u7ed3\u6784\uff0c\u622a\u53d6\u76ee\u6807\u5f20\u91cf\uff0c\u6dfb\u52a0\u65b0\u5c42 \u5939\u5728\u76ee\u6807\u5f20\u91cf\u6743\u91cd \u8bad\u7ec3\u65b0\u5c42 \u5168\u5c40\u5fae\u8c03 Reference \u00b6 \u56fe\u89e3 BERT \u3010\u6df1\u5ea6\u5b66\u4e60\u3011BERT \u8be6\u89e3 \u3010NLP\u3011Google BERT\u6a21\u578b\u539f\u7406\u8be6\u89e3 NLP\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff08\u4e94\uff09BERT\u9884\u8bad\u7ec3\u6a21\u578b","title":"BERT"},{"location":"llm/transformer/bert/#bert","text":"\u7ea6 1558 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 5 \u5206\u949f Abstruct BERT \u4f5c\u4e3a NLP \u9884\u8bad\u7ec3\u6a21\u578b\u91cc\u7684\u7ecf\u5178\u6a21\u578b\u4e4b\u4e00\uff0c\u6548\u679c\u975e\u5e38\u597d\u3002 BERT \u7684\u6a21\u578b\u4ee3\u7801\u548c\u6a21\u578b\u53c2\u6570\u5f00\u6e90\uff0c\u90fd\u53ef\u4ee5\u57fa\u4e8e\u8fd9\u4e2a\u5f3a\u5927\u7684\u6a21\u578b\u7ec4\u4ef6\u642d\u5efa\u81ea\u5df1\u7684 NLP \u7cfb\u7edf\uff0c\u4e5f\u8282\u7701\u5f00\u59cb\u8bad\u7ec3\u8bed\u8a00\u5904\u7406\u6a21\u578b\u6240\u9700\u8981\u7684\u65f6\u95f4\u3001\u7cbe\u529b\u3001\u77e5\u8bc6\u548c\u8d44\u6e90\u3002 BERT\u7684\u5168\u79f0\u662f Bidirectional Encoder Representation from Transformers\uff0c\u5373\u53cc\u5411 Transformer \u7684 Encoder\uff0c\u56e0\u4e3adecoder\u662f\u4e0d\u80fd\u83b7\u8981\u9884\u6d4b\u7684\u4fe1\u606f\u7684\u3002 \u6a21\u578b\u7684\u4e3b\u8981\u521b\u65b0\u70b9\u90fd\u5728pre-train\u65b9\u6cd5\u4e0a\uff0c\u5373\u7528\u4e86Masked LM\u548cNext Sentence Prediction\u4e24\u79cd\u65b9\u6cd5\u5206\u522b\u6355\u6349\u8bcd\u8bed\u548c\u53e5\u5b50\u7ea7\u522b\u7684representation\u3002","title":"BERT"},{"location":"llm/transformer/bert/#introduction","text":"BERT \u9996\u5148\u5728\u5927\u89c4\u6a21\u65e0\u76d1\u7763\u8bed\u6599\u4e0a\u8fdb\u884c\u9884\u8bad\u7ec3\uff0c\u7136\u540e\u5728\u9884\u8bad\u7ec3\u597d\u7684\u53c2\u6570\u57fa\u7840\u4e0a\u589e\u52a0\u4e00\u4e2a\u4e0e\u4efb\u52a1\u76f8\u5173\u7684\u795e\u7ecf\u7f51\u7edc\u5c42\uff0c\u5e76\u5728\u8be5\u4efb\u52a1\u7684\u6570\u636e\u4e0a\u8fdb\u884c\u5fae\u8c03\uff0c\u6700\u7ec8\u53d6\u5f97\u5f88\u597d\u7684\u6548\u679c\u3002 BERT\u7684\u8bad\u7ec3\u8fc7\u7a0b\u53ef\u4ee5\u7b80\u8ff0\u4e3a\uff1a\u9884\u8bad\u7ec3+\u5fae\u8c03\uff08finetune\uff09\uff0c\u8fd9\u662f\u8fd1\u51e0\u5e74 NLP \u89e3\u51b3\u65b9\u6848\u7684\u4e3b\u6d41\u8303\u5f0f\u3002","title":"Introduction"},{"location":"llm/transformer/bert/#_1","text":"BERT\u6a21\u578b\u7684\u7ed3\u6784\u5982\u4e0b\u56fe\u6700\u5de6\uff1a \u5bf9\u6bd4 OpenAI GPT\uff0cBERT \u662f\u53cc\u5411\u7684 Transformer block \u8fde\u63a5\uff0c\u5c31\u50cf\u5355\u5411 RNN \u548c\u53cc\u5411 RNN \u7684\u533a\u522b\uff0c\u6548\u679c\u4f1a\u66f4\u597d\u3002 \u5bf9\u6bd4 ELMo\uff0c\u867d\u7136\u90fd\u662f\u201c\u53cc\u5411\u201d\uff0c\u4f46\u76ee\u6807\u51fd\u6570\u4e0d\u540c\u3002 ELMo \u662f\u5206\u522b\u4ee5 \\(P(w_i|w_1,...,w_{i-1})\\) \u548c \\(P(w_i|w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\uff0c\u72ec\u7acb\u8bad\u7ec3\u51fa\u4e24\u4e2a representation \u7136\u540e\u8fde\u63a5 BERT \u662f\u4ee5 \\(P(w_i | w_1,...,w_{i-1},w_{i+1},...,w_n)\\) \u4f5c\u4e3a\u76ee\u6807\u51fd\u6570\u8bad\u7ec3 LM \u547d\u540d\u8868\u793a\u5c42\u6570\u4e3aL\uff08Transformer Blocks\uff09\uff0c\u9690\u85cf\u5c42\u6570\u4e3aH\uff0c\u81ea\u6ce8\u610f\u529b\u5934\u6570\u91cf\u4e3aA\u3002\u539f\u59cb\u8bba\u6587\u4e2d\u7684\u4e24\u79cd\u6a21\u578b\uff1a BERT_base(L=12,H=768,A=12; parameters=110M) BERT_large(L=24,H=1024,A=16; parameters=340M)","title":"\u6a21\u578b\u7ed3\u6784"},{"location":"llm/transformer/bert/#embedding","text":"\u8fd9\u91cc\u7684 Embedding \u7531\u4e09\u79cd Embedding \u6c42\u548c\u7ec4\u6210\uff1a Token Embedding \uff1a\u8bcd\u5411\u91cf\uff0c\u7b2c\u4e00\u4e2a\u5355\u8bcd\u662f CLS \u6807\u5fd7\uff0c\u53ef\u4ee5\u7528\u4e8e\u4e4b\u540e\u7684\u5206\u7c7b\u4efb\u52a1 Segment Embedding \uff1a\u53e5\u5b50\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u4e24\u4e2a\u53e5\u5b50\uff0c\u56e0\u4e3a\u9884\u8bad\u7ec3\u4e0d\u5149\u505a LM \u8fd8\u8981\u505a\u4ee5\u4e24\u4e2a\u53e5\u5b50\u4e3a\u8f93\u5165\u7684\u5206\u7c7b\u4efb\u52a1 Position Embedding \uff1a\u4f4d\u7f6e\u5411\u91cf\uff0c\u7528\u4e8e\u533a\u5206\u5355\u8bcd\u5728\u53e5\u5b50\u4e2d\u7684\u4f4d\u7f6e\uff0c\u548c\u4e4b\u524d\u7684 Transformer \u4e0d\u4e00\u6837\uff0c\u4e0d\u662f\u4e09\u89d2\u51fd\u6570\u800c\u662f\u5b66\u4e60\u51fa\u6765\u7684","title":"Embedding"},{"location":"llm/transformer/bert/#pre-training","text":"","title":"Pre-training"},{"location":"llm/transformer/bert/#masked-lm-mlm","text":"\u7b2c\u4e00\u6b65\u9884\u8bad\u7ec3\u7684\u76ee\u6807\u5c31\u662f\u505a\u9884\u8a00\u6a21\u578b\uff0c\u4ece\u4e0a\u6587\u6a21\u578b\u7ed3\u6784\u4e2d\u770b\u5230\u4e86\u8fd9\u4e2a\u6a21\u578b\u7684\u4e0d\u540c\uff0c\u5373 bidirectional\u3002 \u4e3a\u4ec0\u4e48\u8981 bidirectional \u5982\u679c\u4f7f\u7528\u9884\u8bad\u7ec3\u6a21\u578b\u5904\u7406\u5176\u4ed6\u4efb\u52a1\uff0c\u90a3\u4eba\u4eec\u60f3\u8981\u7684\u4e0d\u6b62\u67d0\u4e2a\u8bcd\u7684\u5de6\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u662f\u5de6\u53f3\u4e24\u8fb9\u7684\u4fe1\u606f\uff0c\u800c\u8003\u8651\u5230\u8fd9\u70b9\u7684\u6a21\u578b ELMo \u53ea\u662f\u5c06 left-to-right \u548c right-to-left \u5206\u522b\u8bad\u7ec3\u62fc\u63a5\u8d77\u6765\u3002\u76f4\u89c9\u4e0a\u6765\u8bb2\u6211\u4eec\u5176\u5b9e\u60f3\u8981\u4e00\u4e2a deeply bidirectional \u7684\u6a21\u578b\uff0c\u4f46\u662f\u666e\u901a\u7684LM\u53c8\u65e0\u6cd5\u505a\u5230\uff0c\u56e0\u4e3a\u5728\u8bad\u7ec3\u65f6\u53ef\u80fd\u4f1a\u201c\u7a7f\u8d8a\u201d\uff0c\u6240\u4ee5\u4f5c\u8005\u7528\u4e86\u4e00\u4e2a\u52a0mask\u7684trick\u3002 \u5728\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4f5c\u8005\u968f\u673a mask 15% \u7684 token\uff0c\u800c\u4e0d\u662f\u628a\u50cf CBOW \u4e00\u6837\u628a\u6bcf\u4e2a\u8bcd\u90fd\u9884\u6d4b\u4e00\u904d\u3002 \u6700\u7ec8\u7684\u635f\u5931\u51fd\u6570\u53ea\u8ba1\u7b97\u88ab mask \u6389\u90a3\u4e48 token \u3002 mask \u5982\u4f55\u505a\u4e5f\u662f\u6709\u6280\u5de7\u7684\uff0c\u5982\u679c\u4e00\u76f4\u7528\u6807\u8bb0 [MASK] \u4ee3\u66ff\uff08\u5728\u5b9e\u9645\u9884\u6d4b\u65f6\u662f\u78b0\u4e0d\u5230\u8fd9\u4e2a\u6807\u8bb0\u7684\uff09\u4f1a\u5f71\u54cd\u6a21\u578b\uff0c\u6240\u4ee5\u968f\u673a mask \u7684\u65f6\u5019 10% \u7684\u5355\u8bcd\u4f1a\u88ab\u66ff\u4ee3\u6210\u5176\u4ed6\u5355\u8bcd\uff0c10% \u7684\u5355\u8bcd\u4e0d\u66ff\u6362\uff0c\u5269\u4e0b 80% \u624d\u88ab\u66ff\u6362\u4e3a [MASK]\u3002\u8981\u6ce8\u610f\u7684\u662f Masked LM \u9884\u8bad\u7ec3\u9636\u6bb5\u6a21\u578b\u662f\u4e0d\u77e5\u9053\u771f\u6b63\u88ab mask \u7684\u54ea\u4e2a\u8bcd\uff0c\u6240\u4ee5\u6a21\u578b\u6bcf\u4e2a\u8bcd\u90fd\u8981\u5173\u6ce8\u3002 \u4e3a\u4ec0\u4e48\u8fd9\u4e48\u5206\u914d\u6bd4\u4f8b \u5982\u679c\u53e5\u5b50\u4e2d\u7684\u67d0\u4e2aToken100%\u90fd\u4f1a\u88abmask\u6389\uff0c\u90a3\u4e48\u5728fine-tuning\u7684\u65f6\u5019\u6a21\u578b\u5c31\u4f1a\u6709\u4e00\u4e9b\u6ca1\u6709\u89c1\u8fc7\u7684\u5355\u8bcd\u3002\u52a0\u5165\u968f\u673aToken\u7684\u539f\u56e0\u662f\u56e0\u4e3aTransformer\u8981\u4fdd\u6301\u5bf9\u6bcf\u4e2a\u8f93\u5165token\u7684\u5206\u5e03\u5f0f\u8868\u5f81\uff0c\u5426\u5219\u6a21\u578b\u5c31\u4f1a\u8bb0\u4f4f\u8fd9\u4e2a[mask]\u662ftoken \u2019hairy\u2018\u3002\u81f3\u4e8e\u5355\u8bcd\u5e26\u6765\u7684\u8d1f\u9762\u5f71\u54cd\uff0c\u56e0\u4e3a\u4e00\u4e2a\u5355\u8bcd\u88ab\u968f\u673a\u66ff\u6362\u6389\u7684\u6982\u7387\u53ea\u670915%*10% =1.5%\uff0c\u8fd9\u4e2a\u8d1f\u9762\u5f71\u54cd\u5176\u5b9e\u662f\u53ef\u4ee5\u5ffd\u7565\u4e0d\u8ba1\u7684\u3002 \u56e0\u4e3a\u5e8f\u5217\u957f\u5ea6\u592a\u5927\uff08512\uff09\u4f1a\u5f71\u54cd\u8bad\u7ec3\u901f\u5ea6\uff0c\u6240\u4ee5 90% \u7684 steps \u90fd\u7528 seq_len=128\uff0c10% \u7684 steps \u7528 seq_len=512\u3002","title":"Masked LM \uff08MLM\uff09"},{"location":"llm/transformer/bert/#next-sentence-prediction-nsp","text":"\u56e0\u4e3a\u6d89\u53ca\u5230QA\u548cNLI\u4e4b\u7c7b\u7684\u4efb\u52a1\uff0c\u589e\u52a0\u4e86\u7b2c\u4e8c\u4e2a\u9884\u8bad\u7ec3\u4efb\u52a1\uff0c\u76ee\u7684\u662f\u8ba9\u6a21\u578b\u7406\u89e3\u4e24\u4e2a\u53e5\u5b50\u4e4b\u95f4\u7684\u8054\u7cfb\u3002 Next Sentence Prediction\uff08NSP\uff09\u7684\u4efb\u52a1\u662f\u5224\u65ad\u53e5\u5b50B\u662f\u5426\u662f\u53e5\u5b50A\u7684\u4e0b\u6587\u3002\u5982\u679c\u662f\u7684\u8bdd\u8f93\u51fa\u2019IsNext\u2018\uff0c\u5426\u5219\u8f93\u51fa\u2019NotNext\u2018\u3002\u8bad\u7ec3\u6570\u636e\u7684\u751f\u6210\u65b9\u5f0f\u662f\u4ece\u5e73\u884c\u8bed\u6599\u4e2d\u968f\u673a\u62bd\u53d6\u7684\u8fde\u7eed\u4e24\u53e5\u8bdd\uff0c\u5176\u4e2d50%\u4fdd\u7559\u62bd\u53d6\u7684\u4e24\u53e5\u8bdd\uff0c\u5b83\u4eec\u7b26\u5408IsNext\u5173\u7cfb\uff0c\u53e6\u591650%\u7684\u7b2c\u4e8c\u53e5\u8bdd\u662f\u968f\u673a\u4ece\u9884\u6599\u4e2d\u63d0\u53d6\u7684\uff0c\u5b83\u4eec\u7684\u5173\u7cfb\u662fNotNext\u7684\u3002 \u9884\u8bad\u7ec3\u7684\u65f6\u5019\u53ef\u4ee5\u8fbe\u5230 97%-98% \u7684\u51c6\u786e\u5ea6\u3002 \u4f5c\u8005\u7279\u610f\u8bf4\u4e86\u8bed\u6599\u7684\u9009\u53d6\u5f88\u5173\u952e\uff0c\u8981\u9009\u7528document-level\u7684\u800c\u4e0d\u662fsentence-level\u7684\uff0c\u8fd9\u6837\u53ef\u4ee5\u5177\u5907\u62bd\u8c61\u8fde\u7eed\u957f\u5e8f\u5217\u7279\u5f81\u7684\u80fd\u529b\u3002","title":"Next Sentence Prediction \uff08NSP\uff09"},{"location":"llm/transformer/bert/#fine-tuning","text":"\u5fae\u8c03\u662f\u7b80\u5355\u7684\uff0c\u56e0\u4e3aTransformer\u4e2d\u7684\u81ea\u6ce8\u610f\u529b\u673a\u5236\u5141\u8bb8BERT\u901a\u8fc7\u4ea4\u6362\u9002\u5f53\u7684\u8f93\u5165\u548c\u8f93\u51fa\u6765\u5efa\u6a21\u8bb8\u591a\u4e0b\u6e38\u4efb\u52a1--\u4e0d\u7ba1\u5b83\u4eec\u6d89\u53ca\u5355\u4e2a\u6587\u672c\u8fd8\u662f\u6587\u672c\u5bf9\u3002\u5bf9\u4e8eNSP\u4efb\u52a1\u6765\u8bf4\uff0c\u5176\u6761\u4ef6\u6982\u7387\u8868\u793a\u4e3a \\(P=softmax(CW^T)\\) \uff0c\u5176\u4e2d C \u662f BERT \u8f93\u51fa\u4e2d\u7684 [CLS] \u7b26\u53f7\uff0cW \u662f\u53ef\u5b66\u4e60\u7684\u6743\u503c\u77e9\u9635\u3002 \u5fae\u8c03\u7684\u4efb\u52a1\u5305\u62ec\uff1a \u57fa\u4e8e\u53e5\u5b50\u5bf9\u7684\u5206\u7c7b\u4efb\u52a1 \u57fa\u4e8e\u5355\u4e2a\u53e5\u5b50\u7684\u5206\u7c7b\u4efb\u52a1 \u95ee\u7b54\u4efb\u52a1 \u547d\u540d\u5b9e\u4f53\u8bc6\u522bNER \u4e0b\u56fe\u5c55\u793a\u4e86BERT\u572811\u4e2a\u4e0d\u540c\u4efb\u52a1\u4e2d\u7684\u6a21\u578b\uff0c\u5b83\u4eec\u53ea\u9700\u8981\u5728BERT\u7684\u57fa\u7840\u4e0a\u518d\u6dfb\u52a0\u4e00\u4e2a\u8f93\u51fa\u5c42\u4fbf\u53ef\u4ee5\u5b8c\u6210\u5bf9\u7279\u5b9a\u4efb\u52a1\u7684\u5fae\u8c03\u3002\u8fd9\u4e9b\u4efb\u52a1\u7c7b\u4f3c\u4e8e\u6211\u4eec\u505a\u8fc7\u7684\u6587\u79d1\u8bd5\u5377\uff0c\u5176\u4e2d\u6709\u9009\u62e9\u9898\uff0c\u7b80\u7b54\u9898\u7b49\u7b49\u3002\u56fe3\u4e2d\u5176\u4e2dTok\u8868\u793a\u4e0d\u540c\u7684Token\uff0cE \u8868\u793a\u5d4c\u5165\u5411\u91cf\uff0c \\(T_i\\) \u8868\u793a\u7b2c i \u4e2aToken\u5728\u7ecf\u8fc7BERT\u5904\u7406\u4e4b\u540e\u5f97\u5230\u7684\u7279\u5f81\u5411\u91cf\u3002 \u6574\u4f53 Fine-Tuning \u8fc7\u7a0b\uff1a \u6784\u5efa\u56fe\u7ed3\u6784\uff0c\u622a\u53d6\u76ee\u6807\u5f20\u91cf\uff0c\u6dfb\u52a0\u65b0\u5c42 \u5939\u5728\u76ee\u6807\u5f20\u91cf\u6743\u91cd \u8bad\u7ec3\u65b0\u5c42 \u5168\u5c40\u5fae\u8c03","title":"Fine-tuning"},{"location":"llm/transformer/bert/#reference","text":"\u56fe\u89e3 BERT \u3010\u6df1\u5ea6\u5b66\u4e60\u3011BERT \u8be6\u89e3 \u3010NLP\u3011Google BERT\u6a21\u578b\u539f\u7406\u8be6\u89e3 NLP\u4e0e\u6df1\u5ea6\u5b66\u4e60\uff08\u4e94\uff09BERT\u9884\u8bad\u7ec3\u6a21\u578b","title":"Reference"},{"location":"llm/transformer/transformer/","text":"Transformer \u00b6 \u7ea6 2243 \u4e2a\u5b57 84 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u300aAttention is all you need\u300b\u8fd9\u662f\u8c37\u6b4c\u56e2\u961f\u57282017\u5e74\u53d1\u8868\u7684\u8bba\u6587\uff0c\u4e5f\u662f\u9996\u6b21\u63d0\u51faTransformer\u3002 \u76f4\u63a5\u57fa\u4e8eSelf-Attention\u7ed3\u6784\uff0c\u53d6\u4ee3\u4e86\u4e4b\u524dNLP\u4efb\u52a1\u4e2d\u5e38\u7528\u7684RNN\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u3002 \u4e0eRNN\u8fd9\u7c7b\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u76f8\u6bd4\uff0cTransformer\u4e00\u4e2a\u5de8\u5927\u7684\u4f18\u70b9\u662f\uff1a**\u6a21\u578b\u5728\u5904\u7406\u5e8f\u5217\u8f93\u5165\u65f6\uff0c\u53ef\u4ee5\u5bf9\u6574\u4e2a\u5e8f\u5217\u8f93\u5165\u8fdb\u884c\u5e76\u884c\u8ba1\u7b97\uff0c\u4e0d\u9700\u8981\u6309\u7167\u65f6\u95f4\u6b65\u5faa\u73af\u9012\u5f52\u5904\u7406\u8f93\u5165\u5e8f\u5217\u3002 \u6574\u4f53\u67b6\u6784 \u00b6 transformer \u603b\u4f53\u4e3a\u4e00\u4e2a\u7f16\u7801\u7ec4\u4ef6\u3001\u89e3\u7801\u7ec4\u4ef6\u4ee5\u53ca\u4e8c\u8005\u4e4b\u95f4\u8fde\u63a5\u3002 \u7f16\u7801\u90e8\u5206\u548c\u89e3\u7801\u90e8\u5206\u90fd\u4e3a\u7f16\u7801\u5668\u3001\u89e3\u7801\u5668\u7684\u5806\u53e0\uff0c\u6700\u540e\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u662f\u5404\u4e2a\u89e3\u7801\u5668\u7684\u8f93\u5165\u4e4b\u4e00\u3002\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u4e3a\u5355\u8bcd\u7684\u5d4c\u5165\u5411\u91cf\uff0c\u540e\u9762\u7f16\u7801\u5668\u8f93\u5165\u4e3a\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u3002 \u7f16\u7801\u5668\u5747\u7531\u4e24\u4e2a\u5b50\u5c42\u7ec4\u6210\uff1a self-attention \u4e0e feed forward neural network \u3002 self-attention \u7528\u4e8e\u5e2e\u52a9\u7f16\u7801\u5668\u5728\u7f16\u7801\u7279\u5b9a\u5355\u8bcd\u65f6\u67e5\u770b\u8f93\u5165\u4e2d\u7684\u5176\u4ed6\u5355\u8bcd\u3002\u89e3\u7801\u5668\u4e5f\u6709\u8fd9\u4e24\u4e2a\u5b50\u5c42\uff0c\u4e2d\u95f4\u6709\u4e00\u4e2a\u6ce8\u610f\u529b\u5c42\uff0c\u5e2e\u52a9\u89e3\u7801\u5668\u67e5\u770b\u8f93\u5165\u53e5\u5b50\u7684\u76f8\u5173\u90e8\u5206\u3002 \u8f93\u5165\u5904\u7406 \u00b6 \u8bcd\u5411\u91cf \u00b6 \u548c\u5e38\u89c1\u7684 NLP \u4efb\u52a1\u4e00\u6837\uff0c\u9996\u5148\u4f1a\u4f7f\u7528\u8bcd\u5d4c\u5165\u7b97\u6cd5\uff08embedding algorithm\uff09\uff0c\u5c06\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7684\u6bcf\u4e2a\u8bcd\u8f6c\u6362\u4e3a\u4e00\u4e2a\u8bcd\u5411\u91cf\u3002\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5411\u91cf\u4e00\u822c\u4e3a 256 \u6216 512 \u7ef4\u3002 \u8f93\u5165\u5e8f\u5217\u6bcf\u4e2a\u5355\u8bcd\u88ab\u8f6c\u5316\u6210\u8bcd\u5411\u91cf\u8868\u793a\u8fd8\u5c06\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u6765\u5f97\u5230\u8be5\u8bcd\u7684\u6700\u7ec8\u5411\u91cf\u8868\u793a\u3002 \u4f4d\u7f6e\u5411\u91cf \u00b6 \u9996\u5148\u4e3a\u4ec0\u4e48\u9700\u8981\u4f4d\u7f6e\u7f16\u7801\uff1f\u6211\u4eec\u5bf9\u4e8eRNN\u5728\u5904\u7406\u6587\u672c\u65f6\uff0c\u7531\u4e8e\u5929\u7136\u7684\u987a\u5e8f\u8f93\u5165\uff0c\u987a\u5e8f\u5904\u7406\uff0c\u5f53\u524d\u8f93\u51fa\u8981\u7b49\u4e0a\u4e00\u6b65\u8f93\u51fa\u5904\u7406\u5b8c\u540e\u624d\u80fd\u8fdb\u884c\uff0c\u56e0\u6b64\u4e0d\u4f1a\u9020\u6210\u6587\u672c\u7684\u5b57\u8bcd\u5728\u987a\u5e8f\u4e0a\u6216\u8005\u5148\u540e\u5173\u7cfb\u51fa\u73b0\u95ee\u9898\u3002 \u4f46\u5bf9\u4e8eTransformer\u6765\u8bf4\uff0c\u7531\u4e8e\u5176\u5728\u5904\u7406\u65f6\u662f\u5e76\u884c\u6267\u884c\uff0c\u867d\u7136\u52a0\u5feb\u4e86\u901f\u5ea6\uff0c\u4f46\u662f\u5ffd\u7565\u4e86\u8bcd\u5b57\u4e4b\u95f4\u7684\u524d\u540e\u5173\u7cfb\u6216\u8005\u5148\u540e\u987a\u5e8f\u3002\u540c\u65f6Transformer\u57fa\u4e8eSelf-Attention\u673a\u5236\uff0c\u800cself-attention\u4e0d\u80fd\u83b7\u53d6\u5b57\u8bcd\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u5373\u4f7f\u6253\u4e71\u4e00\u53e5\u8bdd\u4e2d\u5b57\u8bcd\u7684\u4f4d\u7f6e\uff0c\u6bcf\u4e2a\u8bcd\u8fd8\u662f\u80fd\u4e0e\u5176\u4ed6\u8bcd\u4e4b\u95f4\u8ba1\u7b97\u51faattention\u503c\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2a\u8bcd\u5411\u91cf\u6dfb\u52a0\u4f4d\u7f6e\u7f16\u7801\u3002 Transformer \u6a21\u578b\u5bf9\u6bcf\u4e2a\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u90fd\u52a0\u4e0a\u4e86\u4e00\u4e2a\u4f4d\u7f6e\u5411\u91cf\u3002\u8fd9\u4e9b\u5411\u91cf\u6709\u52a9\u4e8e\u786e\u5b9a\u6bcf\u4e2a\u5355\u8bcd\u7684\u4f4d\u7f6e\u7279\u5f81\uff0c\u6216\u8005\u53e5\u5b50\u4e2d\u4e0d\u540c\u5355\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7279\u5f81\u3002\u8bcd\u5411\u91cf\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u80cc\u540e\u7684\u76f4\u89c9\uff1a \u5c06\u8fd9\u4e9b\u8868\u793a\u4f4d\u7f6e\u7684\u5411\u91cf\u6dfb\u52a0\u5230\u8bcd\u5411\u91cf\u4e2d\uff0c\u5f97\u5230\u7684\u65b0\u5411\u91cf\uff0c\u53ef\u4ee5\u4e3a\u6a21\u578b\u63d0\u4f9b\u66f4\u591a\u6709\u610f\u4e49\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u8bcd\u7684\u4f4d\u7f6e\uff0c\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7b49\u3002 \u90a3\u4e48\u5e26\u6709\u4f4d\u7f6e\u7f16\u7801\u4fe1\u606f\u7684\u5411\u91cf\u5230\u5e95\u9075\u5faa\u4ec0\u4e48\u6a21\u5f0f\uff1f\u539f\u59cb\u8bba\u6587\u4e2d\u7ed9\u51fa\u7684\u8bbe\u8ba1\u8868\u8fbe\u5f0f\u4e3a\uff1a \\[ PE_{(pos,2i)} = sin(pos / 10000^{2i/d_{\\text{model}}}) \\\\ PE_{(pos,2i+1)} = cos(pos / 10000^{2i/d_{\\text{model}}}) \\] \u4e0a\u9762\u8868\u8fbe\u5f0f\u4e2d\u7684 \\(pos\\) \u4ee3\u8868\u8bcd\u7684\u4f4d\u7f6e\uff0c \\(d_{model}\\) \u4ee3\u8868\u4f4d\u7f6e\u5411\u91cf\u7684\u7ef4\u5ea6\uff0c \\(i \\in [0, d_{model})\\) \u4ee3\u8868\u4f4d\u7f6e \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u7b2c \\(i\\) \u7ef4\u3002\u4e8e\u662f\u6839\u636e\u4e0a\u8ff0\u516c\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u7b2c \\(pos\\) \u4f4d\u7f6e\u7684 \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u3002\u5728\u4e0b\u56fe\u4e2d\uff0c\u6211\u4eec\u753b\u51fa\u4e86\u4e00\u79cd\u4f4d\u7f6e\u5411\u91cf\u5728\u7b2c4\u30015\u30016\u30017\u7ef4\u5ea6\u3001\u4e0d\u540c\u4f4d\u7f6e\u7684\u7684\u6570\u503c\u5927\u5c0f\u3002\u6a2a\u5750\u6807\u8868\u793a\u4f4d\u7f6e\u4e0b\u6807\uff0c\u7eb5\u5750\u6807\u8868\u793a\u6570\u503c\u5927\u5c0f\u3002 \u5f53\u7136\uff0c\u4e0a\u8ff0\u516c\u5f0f\u4e0d\u662f\u552f\u4e00\u751f\u6210\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u7684\u65b9\u6cd5\u3002\u4f46\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\uff1a\u53ef\u4ee5\u6269\u5c55\u5230\u672a\u77e5\u7684\u5e8f\u5217\u957f\u5ea6\u3002\u4f8b\u5982\uff1a\u5f53\u6211\u4eec\u7684\u6a21\u578b\u9700\u8981\u7ffb\u8bd1\u4e00\u4e2a\u53e5\u5b50\uff0c\u800c\u8fd9\u4e2a\u53e5\u5b50\u7684\u957f\u5ea6\u5927\u4e8e\u8bad\u7ec3\u96c6\u4e2d\u6240\u6709\u53e5\u5b50\u7684\u957f\u5ea6\uff0c\u8fd9\u65f6\uff0c\u8fd9\u79cd\u4f4d\u7f6e\u7f16\u7801\u7684\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u751f\u6210\u4e00\u6837\u957f\u7684\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u3002 \u7f16\u7801\u5668 \u00b6 \u7f16\u7801\u90e8\u5206\u7684\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7ecf\u8fc7\u8f93\u5165\u5904\u7406\u4e4b\u540e\u5f97\u5230\u4e86\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u8fd9\u4e2a\u5411\u91cf\u5e8f\u5217\u5c06\u88ab\u9001\u5165\u7b2c1\u5c42\u7f16\u7801\u5668\uff0c\u7b2c1\u5c42\u7f16\u7801\u5668\u8f93\u51fa\u7684\u540c\u6837\u662f\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u518d\u63a5\u7740\u9001\u5165\u4e0b\u4e00\u5c42\u7f16\u7801\u5668\uff1a\u7b2c1\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u878d\u5408\u4f4d\u7f6e\u5411\u91cf\u7684\u8bcd\u5411\u91cf\uff0c\u66f4\u4e0a\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u5219\u662f\u4e0a\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u3002 \u5404\u4e2a\u8bcd\u5411\u91cf\u5747\u8fdb\u5165\u7f16\u7801\u5668\u7684\u4e24\u4e2a\u5b50\u5c42\uff0c self-attention \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u7684\u8def\u5f84\u5177\u6709\u4e00\u5b9a\u5173\u8054\uff0c\u800c FFNN \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u53c2\u4e0e\u7684\u8ba1\u7b97\u8fc7\u7a0b\u72ec\u7acb\u3002 self-attention \u4f7f\u5f97\u6a21\u578b\u5728\u5904\u7406\u4e00\u4e2a\u8bcd\u5411\u91cf\u65f6\uff0c\u80fd\u591f\u5c06\u5176\u4e0e\u76f8\u5173\u7684\u8bcd\u5173\u8054\u8d77\u6765\uff0c\u4ee5\u66f4\u597d\u5730\u5bf9\u8be5\u8bcd\u5411\u91cf\u7f16\u7801\u3002 RNN \u901a\u8fc7\u7ef4\u62a4\u9690\u85cf\u72b6\u6001\u4ee5\u5c06\u5148\u524d\u5904\u7406\u7684\u8bcd\u5411\u91cf\u540c\u5f53\u524d\u8bcd\u5411\u91cf\u5408\u5e76\uff0ctransformer \u5219\u4f7f\u7528 self-attention \u5c06\u5bf9\u76f8\u5173\u8bcd\u7684\u201c\u7406\u89e3\u201d\u878d\u5165\u5f53\u524d\u5904\u7406\u7684\u8bcd\u3002 Self-Attention \u5c42 \u00b6 \u4e3a\u6bcf\u4e2a\u8bcd\u5411\u91cf\u521b\u5efa\u4e09\u4e2a\u5411\u91cf\uff1a Query \u3001 Key \u3001 Value \u3002\u8fd9\u4e09\u4e2a\u5411\u91cf\u662f\u901a\u8fc7\u5c06\u6bcf\u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u4e09\u4e2a\u5e26\u8bad\u7ec3\u7684\u77e9\u9635\u521b\u5efa\u7684\uff08\u5bf9\u540e\u9762\u7684\u7f16\u7801\u5668\uff0c\u5219\u662f\u4e0a\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u51fa\u4e58\u4ee5\u4e09\u4e2a\u65b0\u7684\u5f85\u8bad\u7ec3\u77e9\u9635\uff09\u3002 \u8ba1\u7b97\u5f53\u524d\u8bcd\u5411\u91cf\u4e0e\u8f93\u5165\u53e5\u5b50\u6240\u6709\u8bcd\u5411\u91cf\u7684\u5206\u6570\uff0c\u5206\u6570\u4f1a\u51b3\u5b9a\u5c06\u591a\u5c11\u6ce8\u610f\u529b\u653e\u5728\u8fd9\u4e9b\u8bcd\u4e0a\u3002\u5206\u6570\u901a\u8fc7\u5c06\u5f53\u524d\u8bcd\u5411\u91cf\u5bf9\u5e94\u7684 Query \u5411\u91cf\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 key \u5411\u91cf\u70b9\u79ef\u5f97\u5230\uff0c\u7b2c\u4e00\u4e2a\u5206\u6570\u662f q1 \u4e0e k1 \u70b9\u79ef\uff0c\u7b2c\u4e8c\u4e2a\u5206\u6570\u662f q1 \u4e0e k2 \u70b9\u79ef\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002 \u5c06\u5206\u6570\u9664\u4ee5 Query \u5411\u91cf\u957f\u5ea6\u7684\u5e73\u65b9\u6839\u3002\u6b64\u6b65\u9aa4\u63d0\u9ad8\u4e86\u68af\u5ea6\u7684\u7a33\u5b9a\u6027\u3002 \u901a\u8fc7 softmax \u5c06\u5206\u6570\u5f52\u4e00\u5316\u3002 \u5f52\u4e00\u5316\u7684\u5f97\u5206\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u76f8\u4e58\uff0c\u6b64\u505a\u6cd5\u7684\u76f4\u89c9\u662f\u4fdd\u6301\u60f3\u8981\u5173\u6ce8\u7684\u5355\u8bcd\u7684\u503c\u4e0d\u53d8\uff0c\u800c\u4e14\u6d88\u9664\u4e0d\u76f8\u5173\u7684\u5355\u8bcd\uff0c\u5373\u5bf9\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u52a0\u6743\u3002 \u5bf9\u6240\u6709\u52a0\u6743\u540e\u7684 Value \u5411\u91cf\u6c42\u548c\uff0c\u5373\u4e3a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u5c42\u7684\u8f93\u51fa\u3002 \u4e0a\u8ff0\u8fc7\u7a0b\u7684\u77e9\u9635\u5f62\u5f0f\u4e3a\uff1a \u591a\u5934\u6ce8\u610f\u529b \u00b6 \u8fdb\u4e00\u6b65\u4f18\u5316 Self-attention \uff1a\u4f7f\u7528 multi-headed attention \u3002\u63d0\u9ad8\u4e86\u6a21\u578b\u5173\u6ce8\u4e0d\u540c\u4f4d\u7f6e\u7684\u80fd\u529b\uff0c\u4e3a\u6ce8\u610f\u529b\u5c42\u63d0\u4f9b\u4e86\u591a\u4e2a\u8868\u793a\u5b50\u7a7a\u95f4\uff08 representation subspaces \uff09\u2014\u2014 \u53ef\u4ee5\u6709\u591a\u7ec4 Query \u3001 Key \u3001 Value \u6743\u91cd\u77e9\u9635\uff0c\u6bcf\u4e00\u7ec4\u90fd\u662f\u968f\u673a\u521d\u59cb\u5316\uff0c\u56e0\u6b64\u8bad\u7ec3\u5b8c\u6210\u540e\u6bcf\u4e00\u7ec4\u90fd\u53ef\u4ee5\u5c06\u8f93\u5165\u6295\u5c04\u5230\u4e0d\u540c\u7684\u5b50\u7a7a\u95f4\uff0c\u5177\u4f53\u53ef\u4ee5\u7c7b\u6bd4 CNN \u4e2d\u7684\u591a\u4e2a\u5377\u79ef\u6838\u3002 \u6700\u7ec8\u5c06\u5f97\u5230\u591a\u4e2a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u4e0b\u7684\u8f93\u51fa\u5411\u91cf\uff0c\u5373\u8f93\u5165\u53e5\u5b50\u7ecf\u8fc7 self-attention \u540e\uff0c\u5c06\u6709\u591a\u4e2a\u8f93\u51fa\u77e9\u9635\u3002 \u7531\u4e8e FFNN \u5b50\u5c42\u9700\u8981\u4e00\u4e2a\u77e9\u9635\uff08\u6bcf\u4e2a\u5355\u8bcd\u7531\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u4ee5\u4e0a\u8f93\u51fa\u77e9\u9635\u4e0e\u4e00\u4e2a\u989d\u5916\u7684\u5f85\u8bad\u7ec3\u6743\u91cd\u77e9\u9635\u76f8\u4e58\u3002 \u4e00\u4e2a\u591a\u5934\u6ce8\u610f\u529b\u7684\u4f8b\u5b50\uff1a Attention \u4ee3\u7801\u5b9e\u4f8b \u00b6 \u5f20\u91cf\u7684\u7b2c1\u7ef4\u662f batch size\uff0c\u7b2c 2 \u7ef4\u662f\u53e5\u5b50\u957f\u5ea6\u3002 class MultiheadAttention ( nn . Module ): # n_heads\uff1a\u591a\u5934\u6ce8\u610f\u529b\u7684\u6570\u91cf # hid_dim\uff1a\u6bcf\u4e2a\u8bcd\u8f93\u51fa\u7684\u5411\u91cf\u7ef4\u5ea6 def __init__ ( self , hid_dim , n_heads , dropout ): super ( MultiheadAttention , self ) . __init__ () self . hid_dim = hid_dim self . n_heads = n_heads # \u5f3a\u5236 hid_dim \u5fc5\u987b\u6574\u9664 h assert hid_dim % n_heads == 0 # \u5b9a\u4e49 W_q \u77e9\u9635 self . w_q = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_k \u77e9\u9635 self . w_k = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_v \u77e9\u9635 self . w_v = nn . Linear ( hid_dim , hid_dim ) self . fc = nn . Linear ( hid_dim , hid_dim ) self . do = nn . Dropout ( dropout ) # \u7f29\u653e self . scale = torch . sqrt ( torch . FloatTensor ([ hid_dim // n_heads ])) def forward ( self , query , key , value , mask = None ): # \u6ce8\u610f Q\uff0cK\uff0cV\u7684\u5728\u53e5\u5b50\u957f\u5ea6\u8fd9\u4e00\u4e2a\u7ef4\u5ea6\u7684\u6570\u503c\u53ef\u4ee5\u4e00\u6837\uff0c\u53ef\u4ee5\u4e0d\u4e00\u6837\u3002 # K: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # V: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # Q: [64,12,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 bsz = query . shape [ 0 ] Q = self . w_q ( query ) K = self . w_k ( key ) V = self . w_v ( value ) # \u8fd9\u91cc\u628a K Q V \u77e9\u9635\u62c6\u5206\u4e3a\u591a\u7ec4\u6ce8\u610f\u529b # \u6700\u540e\u4e00\u7ef4\u5c31\u662f\u662f\u7528 self.hid_dim // self.n_heads \u6765\u5f97\u5230\u7684\uff0c\u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u5411\u91cf\u957f\u5ea6, \u6bcf\u4e2a head \u7684\u5411\u91cf\u957f\u5ea6\u662f\uff1a300/6=50 # 64 \u8868\u793a batch size\uff0c6 \u8868\u793a\u6709 6\u7ec4\u6ce8\u610f\u529b\uff0c10 \u8868\u793a\u6709 10 \u8bcd\uff0c50 \u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u8bcd\u7684\u5411\u91cf\u957f\u5ea6 # K: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # V: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # Q: [64,12,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,12,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,12,50] # \u8f6c\u7f6e\u662f\u4e3a\u4e86\u628a\u6ce8\u610f\u529b\u7684\u6570\u91cf 6 \u653e\u5230\u524d\u9762\uff0c\u628a 10 \u548c 50 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u8ba1\u7b97 Q = Q . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) K = K . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) V = V . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) # \u7b2c 1 \u6b65\uff1aQ \u4e58\u4ee5 K\u7684\u8f6c\u7f6e\uff0c\u9664\u4ee5scale # [64,6,12,50] * [64,6,50,10] = [64,6,12,10] # attention\uff1a[64,6,12,10] attention = torch . matmul ( Q , K . permute ( 0 , 1 , 3 , 2 )) / self . scale # \u5982\u679c mask \u4e0d\u4e3a\u7a7a\uff0c\u90a3\u4e48\u5c31\u628a mask \u4e3a 0 \u7684\u4f4d\u7f6e\u7684 attention \u5206\u6570\u8bbe\u7f6e\u4e3a -1e10\uff0c\u8fd9\u91cc\u7528\u201c0\u201d\u6765\u6307\u793a\u54ea\u4e9b\u4f4d\u7f6e\u7684\u8bcd\u5411\u91cf\u4e0d\u80fd\u88abattention\u5230\uff0c\u6bd4\u5982padding\u4f4d\u7f6e\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528\u201c1\u201d\u6216\u8005\u5176\u4ed6\u6570\u5b57\u6765\u6307\u793a\uff0c\u4e3b\u8981\u8bbe\u8ba1\u4e0b\u97622\u884c\u4ee3\u7801\u7684\u6539\u52a8\u3002 if mask is not None : attention = attention . masked_fill ( mask == 0 , - 1e10 ) # \u7b2c 2 \u6b65\uff1a\u8ba1\u7b97\u4e0a\u4e00\u6b65\u7ed3\u679c\u7684 softmax\uff0c\u518d\u7ecf\u8fc7 dropout\uff0c\u5f97\u5230 attention\u3002 # \u6ce8\u610f\uff0c\u8fd9\u91cc\u662f\u5bf9\u6700\u540e\u4e00\u7ef4\u505a softmax\uff0c\u4e5f\u5c31\u662f\u5728\u8f93\u5165\u5e8f\u5217\u7684\u7ef4\u5ea6\u505a softmax # attention: [64,6,12,10] attention = self . do ( torch . softmax ( attention , dim =- 1 )) # \u7b2c\u4e09\u6b65\uff0cattention\u7ed3\u679c\u4e0eV\u76f8\u4e58\uff0c\u5f97\u5230\u591a\u5934\u6ce8\u610f\u529b\u7684\u7ed3\u679c # [64,6,12,10] * [64,6,10,50] = [64,6,12,50] # x: [64,6,12,50] x = torch . matmul ( attention , V ) # \u56e0\u4e3a query \u6709 12 \u4e2a\u8bcd\uff0c\u6240\u4ee5\u628a 12 \u653e\u5230\u524d\u9762\uff0c\u628a 50 \u548c 6 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u62fc\u63a5\u591a\u7ec4\u7684\u7ed3\u679c # x: [64,6,12,50] \u8f6c\u7f6e-> [64,12,6,50] x = x . permute ( 0 , 2 , 1 , 3 ) . contiguous () # \u8fd9\u91cc\u7684\u77e9\u9635\u8f6c\u6362\u5c31\u662f\uff1a\u628a\u591a\u7ec4\u6ce8\u610f\u529b\u7684\u7ed3\u679c\u62fc\u63a5\u8d77\u6765 # \u6700\u7ec8\u7ed3\u679c\u5c31\u662f [64,12,300] # x: [64,12,6,50] -> [64,12,300] x = x . view ( bsz , - 1 , self . n_heads * ( self . hid_dim // self . n_heads )) x = self . fc ( x ) return x # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 query = torch . rand ( 64 , 12 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Key \u5411\u91cf\u662f 300 \u7ef4 key = torch . rand ( 64 , 10 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Value \u5411\u91cf\u662f 300 \u7ef4 value = torch . rand ( 64 , 10 , 300 ) attention = MultiheadAttention ( hid_dim = 300 , n_heads = 6 , dropout = 0.1 ) output = attention ( query , key , value ) ## output: torch.Size([64, 12, 300]) print ( output . shape ) \u6b8b\u5dee\u8fde\u63a5 \u00b6 \u7f16\u7801\u5668\u4e2d\u6bcf\u4e2a\u5b50\u5c42\u90fd\u8fdb\u884c\u6b8b\u5dee\u8fde\u63a5\uff0c\u5e76\u5f52\u4e00\u5316\u3002 \u5c06 Self-Attention \u5c42\u7684\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u548c\u6d89\u53ca\u7684\u5411\u91cf\u8ba1\u7b97\u7ec6\u8282\u90fd\u8fdb\u884c\u53ef\u89c6\u5316\uff0c\u5982\u4e0b\u6240\u793a\uff1a \u7f16\u7801\u5668\u548c\u548c\u89e3\u7801\u5668\u7684\u5b50\u5c42\u91cc\u9762\u90fd\u6709\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u3002\u5047\u8bbe\u4e00\u4e2a Transformer \u662f\u7531 2 \u5c42\u7f16\u7801\u5668\u548c\u4e24\u5c42\u89e3\u7801\u5668\u7ec4\u6210\u7684\uff0c\u5c06\u5168\u90e8\u5185\u90e8\u7ec6\u8282\u5c55\u793a\u8d77\u6765\u5982\u4e0b\u56fe\u6240\u793a\u3002 \u89e3\u7801\u5668 \u00b6 \u7f16\u7801\u5668\u4e00\u822c\u6709\u591a\u5c42\uff0c\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u4e00\u4e2a\u5e8f\u5217\u6587\u672c\uff0c\u6700\u540e\u4e00\u4e2a\u7f16\u7801\u5668\u8f93\u51fa\u662f\u4e00\u7ec4\u5e8f\u5217\u5411\u91cf\uff0c\u8fd9\u7ec4\u5e8f\u5217\u5411\u91cf\u4f1a\u4f5c\u4e3a\u89e3\u7801\u5668\u7684 K\u3001V \u8f93\u5165\uff0c\u5176\u4e2d K=V=\u89e3\u7801\u5668\u8f93\u51fa\u7684\u5e8f\u5217\u5411\u91cf\u8868\u793a\u3002\u8fd9\u4e9b\u6ce8\u610f\u529b\u5411\u91cf\u5c06\u4f1a\u8f93\u5165\u5230\u6bcf\u4e2a\u89e3\u7801\u5668\u7684 Encoder-Decoder Attention \u5c42\uff0c\u8fd9\u6709\u52a9\u4e8e\u89e3\u7801\u5668\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u8f93\u5165\u5e8f\u5217\u7684\u5408\u9002\u4f4d\u7f6e\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002 \u89e3\u7801\uff08decoding\uff09\u9636\u6bb5\u7684\u6bcf\u4e00\u4e2a\u65f6\u95f4\u6b65\u90fd\u8f93\u51fa\u4e00\u4e2a\u7ffb\u8bd1\u540e\u7684\u5355\u8bcd\uff08\u8fd9\u91cc\u7684\u4f8b\u5b50\u662f\u82f1\u8bed\u7ffb\u8bd1\uff09\uff0c\u89e3\u7801\u5668\u5f53\u524d\u65f6\u95f4\u6b65\u7684\u8f93\u51fa\u53c8\u91cd\u65b0\u4f5c\u4e3a\u8f93\u51fa Q \u548c\u7f16\u7801\u5668\u7684\u8f93\u51fa K\u3001V \u5171\u540c\u4f5c\u4e3a\u4e0b\u4e00\u4e2a\u65f6\u95f4\u6b65\u89e3\u7801\u5668\u7684\u8f93\u5165\u3002\u7136\u540e\u91cd\u590d\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u76f4\u5230\u8f93\u51fa\u4e00\u4e2a\u7ed3\u675f\u7b26\u3002 \u89e3\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\uff0c\u548c\u7f16\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\u7684\u533a\u522b\uff1a \u5728\u89e3\u7801\u5668\u91cc\uff0cSelf Attention \u5c42\u53ea\u5141\u8bb8\u5173\u6ce8\u5230\u8f93\u51fa\u5e8f\u5217\u4e2d\u65e9\u4e8e\u5f53\u524d\u4f4d\u7f6e\u4e4b\u524d\u7684\u5355\u8bcd\u3002\u5177\u4f53\u505a\u6cd5\u662f\uff1a\u5728 Self Attention \u5206\u6570\u7ecf\u8fc7 Softmax \u5c42\u4e4b\u524d\uff0c\u5c4f\u853d\u5f53\u524d\u4f4d\u7f6e\u4e4b\u540e\u7684\u90a3\u4e9b\u4f4d\u7f6e\uff08\u5c06attention score\u8bbe\u7f6e\u6210-inf\uff09\u3002 \u89e3\u7801\u5668 Attention\u5c42\u662f\u4f7f\u7528\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u6765\u6784\u9020Query \u77e9\u9635\uff0c\u800cKey\u77e9\u9635\u548c Value\u77e9\u9635\u6765\u81ea\u4e8e\u7f16\u7801\u5668\u6700\u7ec8\u7684\u8f93\u51fa\u3002 Reference \u00b6 learn-nlp-with-transformers 10\u5206\u949f\u5e26\u4f60\u6df1\u5165\u7406\u89e3Transformer\u539f\u7406\u53ca\u5b9e\u73b0 Transformer\u539f\u7406\u8be6\u89e3 transformer \u539f\u7406","title":"Transformer"},{"location":"llm/transformer/transformer/#transformer","text":"\u7ea6 2243 \u4e2a\u5b57 84 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 9 \u5206\u949f Abstract \u300aAttention is all you need\u300b\u8fd9\u662f\u8c37\u6b4c\u56e2\u961f\u57282017\u5e74\u53d1\u8868\u7684\u8bba\u6587\uff0c\u4e5f\u662f\u9996\u6b21\u63d0\u51faTransformer\u3002 \u76f4\u63a5\u57fa\u4e8eSelf-Attention\u7ed3\u6784\uff0c\u53d6\u4ee3\u4e86\u4e4b\u524dNLP\u4efb\u52a1\u4e2d\u5e38\u7528\u7684RNN\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u3002 \u4e0eRNN\u8fd9\u7c7b\u795e\u7ecf\u7f51\u7edc\u7ed3\u6784\u76f8\u6bd4\uff0cTransformer\u4e00\u4e2a\u5de8\u5927\u7684\u4f18\u70b9\u662f\uff1a**\u6a21\u578b\u5728\u5904\u7406\u5e8f\u5217\u8f93\u5165\u65f6\uff0c\u53ef\u4ee5\u5bf9\u6574\u4e2a\u5e8f\u5217\u8f93\u5165\u8fdb\u884c\u5e76\u884c\u8ba1\u7b97\uff0c\u4e0d\u9700\u8981\u6309\u7167\u65f6\u95f4\u6b65\u5faa\u73af\u9012\u5f52\u5904\u7406\u8f93\u5165\u5e8f\u5217\u3002","title":"Transformer"},{"location":"llm/transformer/transformer/#_1","text":"transformer \u603b\u4f53\u4e3a\u4e00\u4e2a\u7f16\u7801\u7ec4\u4ef6\u3001\u89e3\u7801\u7ec4\u4ef6\u4ee5\u53ca\u4e8c\u8005\u4e4b\u95f4\u8fde\u63a5\u3002 \u7f16\u7801\u90e8\u5206\u548c\u89e3\u7801\u90e8\u5206\u90fd\u4e3a\u7f16\u7801\u5668\u3001\u89e3\u7801\u5668\u7684\u5806\u53e0\uff0c\u6700\u540e\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u662f\u5404\u4e2a\u89e3\u7801\u5668\u7684\u8f93\u5165\u4e4b\u4e00\u3002\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u4e3a\u5355\u8bcd\u7684\u5d4c\u5165\u5411\u91cf\uff0c\u540e\u9762\u7f16\u7801\u5668\u8f93\u5165\u4e3a\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u3002 \u7f16\u7801\u5668\u5747\u7531\u4e24\u4e2a\u5b50\u5c42\u7ec4\u6210\uff1a self-attention \u4e0e feed forward neural network \u3002 self-attention \u7528\u4e8e\u5e2e\u52a9\u7f16\u7801\u5668\u5728\u7f16\u7801\u7279\u5b9a\u5355\u8bcd\u65f6\u67e5\u770b\u8f93\u5165\u4e2d\u7684\u5176\u4ed6\u5355\u8bcd\u3002\u89e3\u7801\u5668\u4e5f\u6709\u8fd9\u4e24\u4e2a\u5b50\u5c42\uff0c\u4e2d\u95f4\u6709\u4e00\u4e2a\u6ce8\u610f\u529b\u5c42\uff0c\u5e2e\u52a9\u89e3\u7801\u5668\u67e5\u770b\u8f93\u5165\u53e5\u5b50\u7684\u76f8\u5173\u90e8\u5206\u3002","title":"\u6574\u4f53\u67b6\u6784"},{"location":"llm/transformer/transformer/#_2","text":"","title":"\u8f93\u5165\u5904\u7406"},{"location":"llm/transformer/transformer/#_3","text":"\u548c\u5e38\u89c1\u7684 NLP \u4efb\u52a1\u4e00\u6837\uff0c\u9996\u5148\u4f1a\u4f7f\u7528\u8bcd\u5d4c\u5165\u7b97\u6cd5\uff08embedding algorithm\uff09\uff0c\u5c06\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7684\u6bcf\u4e2a\u8bcd\u8f6c\u6362\u4e3a\u4e00\u4e2a\u8bcd\u5411\u91cf\u3002\u5b9e\u9645\u5e94\u7528\u4e2d\u7684\u5411\u91cf\u4e00\u822c\u4e3a 256 \u6216 512 \u7ef4\u3002 \u8f93\u5165\u5e8f\u5217\u6bcf\u4e2a\u5355\u8bcd\u88ab\u8f6c\u5316\u6210\u8bcd\u5411\u91cf\u8868\u793a\u8fd8\u5c06\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u6765\u5f97\u5230\u8be5\u8bcd\u7684\u6700\u7ec8\u5411\u91cf\u8868\u793a\u3002","title":"\u8bcd\u5411\u91cf"},{"location":"llm/transformer/transformer/#_4","text":"\u9996\u5148\u4e3a\u4ec0\u4e48\u9700\u8981\u4f4d\u7f6e\u7f16\u7801\uff1f\u6211\u4eec\u5bf9\u4e8eRNN\u5728\u5904\u7406\u6587\u672c\u65f6\uff0c\u7531\u4e8e\u5929\u7136\u7684\u987a\u5e8f\u8f93\u5165\uff0c\u987a\u5e8f\u5904\u7406\uff0c\u5f53\u524d\u8f93\u51fa\u8981\u7b49\u4e0a\u4e00\u6b65\u8f93\u51fa\u5904\u7406\u5b8c\u540e\u624d\u80fd\u8fdb\u884c\uff0c\u56e0\u6b64\u4e0d\u4f1a\u9020\u6210\u6587\u672c\u7684\u5b57\u8bcd\u5728\u987a\u5e8f\u4e0a\u6216\u8005\u5148\u540e\u5173\u7cfb\u51fa\u73b0\u95ee\u9898\u3002 \u4f46\u5bf9\u4e8eTransformer\u6765\u8bf4\uff0c\u7531\u4e8e\u5176\u5728\u5904\u7406\u65f6\u662f\u5e76\u884c\u6267\u884c\uff0c\u867d\u7136\u52a0\u5feb\u4e86\u901f\u5ea6\uff0c\u4f46\u662f\u5ffd\u7565\u4e86\u8bcd\u5b57\u4e4b\u95f4\u7684\u524d\u540e\u5173\u7cfb\u6216\u8005\u5148\u540e\u987a\u5e8f\u3002\u540c\u65f6Transformer\u57fa\u4e8eSelf-Attention\u673a\u5236\uff0c\u800cself-attention\u4e0d\u80fd\u83b7\u53d6\u5b57\u8bcd\u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u5373\u4f7f\u6253\u4e71\u4e00\u53e5\u8bdd\u4e2d\u5b57\u8bcd\u7684\u4f4d\u7f6e\uff0c\u6bcf\u4e2a\u8bcd\u8fd8\u662f\u80fd\u4e0e\u5176\u4ed6\u8bcd\u4e4b\u95f4\u8ba1\u7b97\u51faattention\u503c\uff0c\u56e0\u6b64\u6211\u4eec\u9700\u8981\u4e3a\u6bcf\u4e00\u4e2a\u8bcd\u5411\u91cf\u6dfb\u52a0\u4f4d\u7f6e\u7f16\u7801\u3002 Transformer \u6a21\u578b\u5bf9\u6bcf\u4e2a\u8f93\u5165\u7684\u8bcd\u5411\u91cf\u90fd\u52a0\u4e0a\u4e86\u4e00\u4e2a\u4f4d\u7f6e\u5411\u91cf\u3002\u8fd9\u4e9b\u5411\u91cf\u6709\u52a9\u4e8e\u786e\u5b9a\u6bcf\u4e2a\u5355\u8bcd\u7684\u4f4d\u7f6e\u7279\u5f81\uff0c\u6216\u8005\u53e5\u5b50\u4e2d\u4e0d\u540c\u5355\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7279\u5f81\u3002\u8bcd\u5411\u91cf\u52a0\u4e0a\u4f4d\u7f6e\u5411\u91cf\u80cc\u540e\u7684\u76f4\u89c9\uff1a \u5c06\u8fd9\u4e9b\u8868\u793a\u4f4d\u7f6e\u7684\u5411\u91cf\u6dfb\u52a0\u5230\u8bcd\u5411\u91cf\u4e2d\uff0c\u5f97\u5230\u7684\u65b0\u5411\u91cf\uff0c\u53ef\u4ee5\u4e3a\u6a21\u578b\u63d0\u4f9b\u66f4\u591a\u6709\u610f\u4e49\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u8bcd\u7684\u4f4d\u7f6e\uff0c\u8bcd\u4e4b\u95f4\u7684\u8ddd\u79bb\u7b49\u3002 \u90a3\u4e48\u5e26\u6709\u4f4d\u7f6e\u7f16\u7801\u4fe1\u606f\u7684\u5411\u91cf\u5230\u5e95\u9075\u5faa\u4ec0\u4e48\u6a21\u5f0f\uff1f\u539f\u59cb\u8bba\u6587\u4e2d\u7ed9\u51fa\u7684\u8bbe\u8ba1\u8868\u8fbe\u5f0f\u4e3a\uff1a \\[ PE_{(pos,2i)} = sin(pos / 10000^{2i/d_{\\text{model}}}) \\\\ PE_{(pos,2i+1)} = cos(pos / 10000^{2i/d_{\\text{model}}}) \\] \u4e0a\u9762\u8868\u8fbe\u5f0f\u4e2d\u7684 \\(pos\\) \u4ee3\u8868\u8bcd\u7684\u4f4d\u7f6e\uff0c \\(d_{model}\\) \u4ee3\u8868\u4f4d\u7f6e\u5411\u91cf\u7684\u7ef4\u5ea6\uff0c \\(i \\in [0, d_{model})\\) \u4ee3\u8868\u4f4d\u7f6e \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u7b2c \\(i\\) \u7ef4\u3002\u4e8e\u662f\u6839\u636e\u4e0a\u8ff0\u516c\u5f0f\uff0c\u6211\u4eec\u53ef\u4ee5\u5f97\u5230\u7b2c \\(pos\\) \u4f4d\u7f6e\u7684 \\(d_{model}\\) \u7ef4\u4f4d\u7f6e\u5411\u91cf\u3002\u5728\u4e0b\u56fe\u4e2d\uff0c\u6211\u4eec\u753b\u51fa\u4e86\u4e00\u79cd\u4f4d\u7f6e\u5411\u91cf\u5728\u7b2c4\u30015\u30016\u30017\u7ef4\u5ea6\u3001\u4e0d\u540c\u4f4d\u7f6e\u7684\u7684\u6570\u503c\u5927\u5c0f\u3002\u6a2a\u5750\u6807\u8868\u793a\u4f4d\u7f6e\u4e0b\u6807\uff0c\u7eb5\u5750\u6807\u8868\u793a\u6570\u503c\u5927\u5c0f\u3002 \u5f53\u7136\uff0c\u4e0a\u8ff0\u516c\u5f0f\u4e0d\u662f\u552f\u4e00\u751f\u6210\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u7684\u65b9\u6cd5\u3002\u4f46\u8fd9\u79cd\u65b9\u6cd5\u7684\u4f18\u70b9\u662f\uff1a\u53ef\u4ee5\u6269\u5c55\u5230\u672a\u77e5\u7684\u5e8f\u5217\u957f\u5ea6\u3002\u4f8b\u5982\uff1a\u5f53\u6211\u4eec\u7684\u6a21\u578b\u9700\u8981\u7ffb\u8bd1\u4e00\u4e2a\u53e5\u5b50\uff0c\u800c\u8fd9\u4e2a\u53e5\u5b50\u7684\u957f\u5ea6\u5927\u4e8e\u8bad\u7ec3\u96c6\u4e2d\u6240\u6709\u53e5\u5b50\u7684\u957f\u5ea6\uff0c\u8fd9\u65f6\uff0c\u8fd9\u79cd\u4f4d\u7f6e\u7f16\u7801\u7684\u65b9\u6cd5\u4e5f\u53ef\u4ee5\u751f\u6210\u4e00\u6837\u957f\u7684\u4f4d\u7f6e\u7f16\u7801\u5411\u91cf\u3002","title":"\u4f4d\u7f6e\u5411\u91cf"},{"location":"llm/transformer/transformer/#_5","text":"\u7f16\u7801\u90e8\u5206\u7684\u8f93\u5165\u6587\u672c\u5e8f\u5217\u7ecf\u8fc7\u8f93\u5165\u5904\u7406\u4e4b\u540e\u5f97\u5230\u4e86\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u8fd9\u4e2a\u5411\u91cf\u5e8f\u5217\u5c06\u88ab\u9001\u5165\u7b2c1\u5c42\u7f16\u7801\u5668\uff0c\u7b2c1\u5c42\u7f16\u7801\u5668\u8f93\u51fa\u7684\u540c\u6837\u662f\u4e00\u4e2a\u5411\u91cf\u5e8f\u5217\uff0c\u518d\u63a5\u7740\u9001\u5165\u4e0b\u4e00\u5c42\u7f16\u7801\u5668\uff1a\u7b2c1\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u878d\u5408\u4f4d\u7f6e\u5411\u91cf\u7684\u8bcd\u5411\u91cf\uff0c\u66f4\u4e0a\u5c42\u7f16\u7801\u5668\u7684\u8f93\u5165\u5219\u662f\u4e0a\u4e00\u5c42\u7f16\u7801\u5668\u7684\u8f93\u51fa\u3002 \u5404\u4e2a\u8bcd\u5411\u91cf\u5747\u8fdb\u5165\u7f16\u7801\u5668\u7684\u4e24\u4e2a\u5b50\u5c42\uff0c self-attention \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u7684\u8def\u5f84\u5177\u6709\u4e00\u5b9a\u5173\u8054\uff0c\u800c FFNN \u5c42\u4e2d\u5404\u4e2a\u8bcd\u5411\u91cf\u53c2\u4e0e\u7684\u8ba1\u7b97\u8fc7\u7a0b\u72ec\u7acb\u3002 self-attention \u4f7f\u5f97\u6a21\u578b\u5728\u5904\u7406\u4e00\u4e2a\u8bcd\u5411\u91cf\u65f6\uff0c\u80fd\u591f\u5c06\u5176\u4e0e\u76f8\u5173\u7684\u8bcd\u5173\u8054\u8d77\u6765\uff0c\u4ee5\u66f4\u597d\u5730\u5bf9\u8be5\u8bcd\u5411\u91cf\u7f16\u7801\u3002 RNN \u901a\u8fc7\u7ef4\u62a4\u9690\u85cf\u72b6\u6001\u4ee5\u5c06\u5148\u524d\u5904\u7406\u7684\u8bcd\u5411\u91cf\u540c\u5f53\u524d\u8bcd\u5411\u91cf\u5408\u5e76\uff0ctransformer \u5219\u4f7f\u7528 self-attention \u5c06\u5bf9\u76f8\u5173\u8bcd\u7684\u201c\u7406\u89e3\u201d\u878d\u5165\u5f53\u524d\u5904\u7406\u7684\u8bcd\u3002","title":"\u7f16\u7801\u5668"},{"location":"llm/transformer/transformer/#self-attention","text":"\u4e3a\u6bcf\u4e2a\u8bcd\u5411\u91cf\u521b\u5efa\u4e09\u4e2a\u5411\u91cf\uff1a Query \u3001 Key \u3001 Value \u3002\u8fd9\u4e09\u4e2a\u5411\u91cf\u662f\u901a\u8fc7\u5c06\u6bcf\u4e2a\u8bcd\u5411\u91cf\u4e58\u4ee5\u4e09\u4e2a\u5e26\u8bad\u7ec3\u7684\u77e9\u9635\u521b\u5efa\u7684\uff08\u5bf9\u540e\u9762\u7684\u7f16\u7801\u5668\uff0c\u5219\u662f\u4e0a\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u51fa\u4e58\u4ee5\u4e09\u4e2a\u65b0\u7684\u5f85\u8bad\u7ec3\u77e9\u9635\uff09\u3002 \u8ba1\u7b97\u5f53\u524d\u8bcd\u5411\u91cf\u4e0e\u8f93\u5165\u53e5\u5b50\u6240\u6709\u8bcd\u5411\u91cf\u7684\u5206\u6570\uff0c\u5206\u6570\u4f1a\u51b3\u5b9a\u5c06\u591a\u5c11\u6ce8\u610f\u529b\u653e\u5728\u8fd9\u4e9b\u8bcd\u4e0a\u3002\u5206\u6570\u901a\u8fc7\u5c06\u5f53\u524d\u8bcd\u5411\u91cf\u5bf9\u5e94\u7684 Query \u5411\u91cf\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 key \u5411\u91cf\u70b9\u79ef\u5f97\u5230\uff0c\u7b2c\u4e00\u4e2a\u5206\u6570\u662f q1 \u4e0e k1 \u70b9\u79ef\uff0c\u7b2c\u4e8c\u4e2a\u5206\u6570\u662f q1 \u4e0e k2 \u70b9\u79ef\uff0c\u4ee5\u6b64\u7c7b\u63a8\u3002 \u5c06\u5206\u6570\u9664\u4ee5 Query \u5411\u91cf\u957f\u5ea6\u7684\u5e73\u65b9\u6839\u3002\u6b64\u6b65\u9aa4\u63d0\u9ad8\u4e86\u68af\u5ea6\u7684\u7a33\u5b9a\u6027\u3002 \u901a\u8fc7 softmax \u5c06\u5206\u6570\u5f52\u4e00\u5316\u3002 \u5f52\u4e00\u5316\u7684\u5f97\u5206\u4e0e\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u76f8\u4e58\uff0c\u6b64\u505a\u6cd5\u7684\u76f4\u89c9\u662f\u4fdd\u6301\u60f3\u8981\u5173\u6ce8\u7684\u5355\u8bcd\u7684\u503c\u4e0d\u53d8\uff0c\u800c\u4e14\u6d88\u9664\u4e0d\u76f8\u5173\u7684\u5355\u8bcd\uff0c\u5373\u5bf9\u5404\u4e2a\u5355\u8bcd\u7684 Value \u5411\u91cf\u52a0\u6743\u3002 \u5bf9\u6240\u6709\u52a0\u6743\u540e\u7684 Value \u5411\u91cf\u6c42\u548c\uff0c\u5373\u4e3a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u5c42\u7684\u8f93\u51fa\u3002 \u4e0a\u8ff0\u8fc7\u7a0b\u7684\u77e9\u9635\u5f62\u5f0f\u4e3a\uff1a","title":"Self-Attention \u5c42"},{"location":"llm/transformer/transformer/#_6","text":"\u8fdb\u4e00\u6b65\u4f18\u5316 Self-attention \uff1a\u4f7f\u7528 multi-headed attention \u3002\u63d0\u9ad8\u4e86\u6a21\u578b\u5173\u6ce8\u4e0d\u540c\u4f4d\u7f6e\u7684\u80fd\u529b\uff0c\u4e3a\u6ce8\u610f\u529b\u5c42\u63d0\u4f9b\u4e86\u591a\u4e2a\u8868\u793a\u5b50\u7a7a\u95f4\uff08 representation subspaces \uff09\u2014\u2014 \u53ef\u4ee5\u6709\u591a\u7ec4 Query \u3001 Key \u3001 Value \u6743\u91cd\u77e9\u9635\uff0c\u6bcf\u4e00\u7ec4\u90fd\u662f\u968f\u673a\u521d\u59cb\u5316\uff0c\u56e0\u6b64\u8bad\u7ec3\u5b8c\u6210\u540e\u6bcf\u4e00\u7ec4\u90fd\u53ef\u4ee5\u5c06\u8f93\u5165\u6295\u5c04\u5230\u4e0d\u540c\u7684\u5b50\u7a7a\u95f4\uff0c\u5177\u4f53\u53ef\u4ee5\u7c7b\u6bd4 CNN \u4e2d\u7684\u591a\u4e2a\u5377\u79ef\u6838\u3002 \u6700\u7ec8\u5c06\u5f97\u5230\u591a\u4e2a\u5f53\u524d\u8bcd\u5411\u91cf\u5728 self-attention \u4e0b\u7684\u8f93\u51fa\u5411\u91cf\uff0c\u5373\u8f93\u5165\u53e5\u5b50\u7ecf\u8fc7 self-attention \u540e\uff0c\u5c06\u6709\u591a\u4e2a\u8f93\u51fa\u77e9\u9635\u3002 \u7531\u4e8e FFNN \u5b50\u5c42\u9700\u8981\u4e00\u4e2a\u77e9\u9635\uff08\u6bcf\u4e2a\u5355\u8bcd\u7531\u4e00\u4e2a\u5411\u91cf\u8868\u793a\uff09\u4f5c\u4e3a\u8f93\u5165\uff0c\u56e0\u6b64\u9700\u8981\u5c06\u4ee5\u4e0a\u8f93\u51fa\u77e9\u9635\u4e0e\u4e00\u4e2a\u989d\u5916\u7684\u5f85\u8bad\u7ec3\u6743\u91cd\u77e9\u9635\u76f8\u4e58\u3002 \u4e00\u4e2a\u591a\u5934\u6ce8\u610f\u529b\u7684\u4f8b\u5b50\uff1a","title":"\u591a\u5934\u6ce8\u610f\u529b"},{"location":"llm/transformer/transformer/#attention","text":"\u5f20\u91cf\u7684\u7b2c1\u7ef4\u662f batch size\uff0c\u7b2c 2 \u7ef4\u662f\u53e5\u5b50\u957f\u5ea6\u3002 class MultiheadAttention ( nn . Module ): # n_heads\uff1a\u591a\u5934\u6ce8\u610f\u529b\u7684\u6570\u91cf # hid_dim\uff1a\u6bcf\u4e2a\u8bcd\u8f93\u51fa\u7684\u5411\u91cf\u7ef4\u5ea6 def __init__ ( self , hid_dim , n_heads , dropout ): super ( MultiheadAttention , self ) . __init__ () self . hid_dim = hid_dim self . n_heads = n_heads # \u5f3a\u5236 hid_dim \u5fc5\u987b\u6574\u9664 h assert hid_dim % n_heads == 0 # \u5b9a\u4e49 W_q \u77e9\u9635 self . w_q = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_k \u77e9\u9635 self . w_k = nn . Linear ( hid_dim , hid_dim ) # \u5b9a\u4e49 W_v \u77e9\u9635 self . w_v = nn . Linear ( hid_dim , hid_dim ) self . fc = nn . Linear ( hid_dim , hid_dim ) self . do = nn . Dropout ( dropout ) # \u7f29\u653e self . scale = torch . sqrt ( torch . FloatTensor ([ hid_dim // n_heads ])) def forward ( self , query , key , value , mask = None ): # \u6ce8\u610f Q\uff0cK\uff0cV\u7684\u5728\u53e5\u5b50\u957f\u5ea6\u8fd9\u4e00\u4e2a\u7ef4\u5ea6\u7684\u6570\u503c\u53ef\u4ee5\u4e00\u6837\uff0c\u53ef\u4ee5\u4e0d\u4e00\u6837\u3002 # K: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # V: [64,10,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 # Q: [64,12,300], \u5047\u8bbebatch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 bsz = query . shape [ 0 ] Q = self . w_q ( query ) K = self . w_k ( key ) V = self . w_v ( value ) # \u8fd9\u91cc\u628a K Q V \u77e9\u9635\u62c6\u5206\u4e3a\u591a\u7ec4\u6ce8\u610f\u529b # \u6700\u540e\u4e00\u7ef4\u5c31\u662f\u662f\u7528 self.hid_dim // self.n_heads \u6765\u5f97\u5230\u7684\uff0c\u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u5411\u91cf\u957f\u5ea6, \u6bcf\u4e2a head \u7684\u5411\u91cf\u957f\u5ea6\u662f\uff1a300/6=50 # 64 \u8868\u793a batch size\uff0c6 \u8868\u793a\u6709 6\u7ec4\u6ce8\u610f\u529b\uff0c10 \u8868\u793a\u6709 10 \u8bcd\uff0c50 \u8868\u793a\u6bcf\u7ec4\u6ce8\u610f\u529b\u7684\u8bcd\u7684\u5411\u91cf\u957f\u5ea6 # K: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # V: [64,10,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,10,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,10,50] # Q: [64,12,300] \u62c6\u5206\u591a\u7ec4\u6ce8\u610f\u529b -> [64,12,6,50] \u8f6c\u7f6e\u5f97\u5230 -> [64,6,12,50] # \u8f6c\u7f6e\u662f\u4e3a\u4e86\u628a\u6ce8\u610f\u529b\u7684\u6570\u91cf 6 \u653e\u5230\u524d\u9762\uff0c\u628a 10 \u548c 50 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u8ba1\u7b97 Q = Q . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) K = K . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) V = V . view ( bsz , - 1 , self . n_heads , self . hid_dim // self . n_heads ) . permute ( 0 , 2 , 1 , 3 ) # \u7b2c 1 \u6b65\uff1aQ \u4e58\u4ee5 K\u7684\u8f6c\u7f6e\uff0c\u9664\u4ee5scale # [64,6,12,50] * [64,6,50,10] = [64,6,12,10] # attention\uff1a[64,6,12,10] attention = torch . matmul ( Q , K . permute ( 0 , 1 , 3 , 2 )) / self . scale # \u5982\u679c mask \u4e0d\u4e3a\u7a7a\uff0c\u90a3\u4e48\u5c31\u628a mask \u4e3a 0 \u7684\u4f4d\u7f6e\u7684 attention \u5206\u6570\u8bbe\u7f6e\u4e3a -1e10\uff0c\u8fd9\u91cc\u7528\u201c0\u201d\u6765\u6307\u793a\u54ea\u4e9b\u4f4d\u7f6e\u7684\u8bcd\u5411\u91cf\u4e0d\u80fd\u88abattention\u5230\uff0c\u6bd4\u5982padding\u4f4d\u7f6e\uff0c\u5f53\u7136\u4e5f\u53ef\u4ee5\u7528\u201c1\u201d\u6216\u8005\u5176\u4ed6\u6570\u5b57\u6765\u6307\u793a\uff0c\u4e3b\u8981\u8bbe\u8ba1\u4e0b\u97622\u884c\u4ee3\u7801\u7684\u6539\u52a8\u3002 if mask is not None : attention = attention . masked_fill ( mask == 0 , - 1e10 ) # \u7b2c 2 \u6b65\uff1a\u8ba1\u7b97\u4e0a\u4e00\u6b65\u7ed3\u679c\u7684 softmax\uff0c\u518d\u7ecf\u8fc7 dropout\uff0c\u5f97\u5230 attention\u3002 # \u6ce8\u610f\uff0c\u8fd9\u91cc\u662f\u5bf9\u6700\u540e\u4e00\u7ef4\u505a softmax\uff0c\u4e5f\u5c31\u662f\u5728\u8f93\u5165\u5e8f\u5217\u7684\u7ef4\u5ea6\u505a softmax # attention: [64,6,12,10] attention = self . do ( torch . softmax ( attention , dim =- 1 )) # \u7b2c\u4e09\u6b65\uff0cattention\u7ed3\u679c\u4e0eV\u76f8\u4e58\uff0c\u5f97\u5230\u591a\u5934\u6ce8\u610f\u529b\u7684\u7ed3\u679c # [64,6,12,10] * [64,6,10,50] = [64,6,12,50] # x: [64,6,12,50] x = torch . matmul ( attention , V ) # \u56e0\u4e3a query \u6709 12 \u4e2a\u8bcd\uff0c\u6240\u4ee5\u628a 12 \u653e\u5230\u524d\u9762\uff0c\u628a 50 \u548c 6 \u653e\u5230\u540e\u9762\uff0c\u65b9\u4fbf\u4e0b\u9762\u62fc\u63a5\u591a\u7ec4\u7684\u7ed3\u679c # x: [64,6,12,50] \u8f6c\u7f6e-> [64,12,6,50] x = x . permute ( 0 , 2 , 1 , 3 ) . contiguous () # \u8fd9\u91cc\u7684\u77e9\u9635\u8f6c\u6362\u5c31\u662f\uff1a\u628a\u591a\u7ec4\u6ce8\u610f\u529b\u7684\u7ed3\u679c\u62fc\u63a5\u8d77\u6765 # \u6700\u7ec8\u7ed3\u679c\u5c31\u662f [64,12,300] # x: [64,12,6,50] -> [64,12,300] x = x . view ( bsz , - 1 , self . n_heads * ( self . hid_dim // self . n_heads )) x = self . fc ( x ) return x # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Query \u5411\u91cf\u662f 300 \u7ef4 query = torch . rand ( 64 , 12 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 12 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Key \u5411\u91cf\u662f 300 \u7ef4 key = torch . rand ( 64 , 10 , 300 ) # batch_size \u4e3a 64\uff0c\u6709 10 \u4e2a\u8bcd\uff0c\u6bcf\u4e2a\u8bcd\u7684 Value \u5411\u91cf\u662f 300 \u7ef4 value = torch . rand ( 64 , 10 , 300 ) attention = MultiheadAttention ( hid_dim = 300 , n_heads = 6 , dropout = 0.1 ) output = attention ( query , key , value ) ## output: torch.Size([64, 12, 300]) print ( output . shape )","title":"Attention \u4ee3\u7801\u5b9e\u4f8b"},{"location":"llm/transformer/transformer/#_7","text":"\u7f16\u7801\u5668\u4e2d\u6bcf\u4e2a\u5b50\u5c42\u90fd\u8fdb\u884c\u6b8b\u5dee\u8fde\u63a5\uff0c\u5e76\u5f52\u4e00\u5316\u3002 \u5c06 Self-Attention \u5c42\u7684\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u548c\u6d89\u53ca\u7684\u5411\u91cf\u8ba1\u7b97\u7ec6\u8282\u90fd\u8fdb\u884c\u53ef\u89c6\u5316\uff0c\u5982\u4e0b\u6240\u793a\uff1a \u7f16\u7801\u5668\u548c\u548c\u89e3\u7801\u5668\u7684\u5b50\u5c42\u91cc\u9762\u90fd\u6709\u5c42\u6807\u51c6\u5316\uff08layer-normalization\uff09\u3002\u5047\u8bbe\u4e00\u4e2a Transformer \u662f\u7531 2 \u5c42\u7f16\u7801\u5668\u548c\u4e24\u5c42\u89e3\u7801\u5668\u7ec4\u6210\u7684\uff0c\u5c06\u5168\u90e8\u5185\u90e8\u7ec6\u8282\u5c55\u793a\u8d77\u6765\u5982\u4e0b\u56fe\u6240\u793a\u3002","title":"\u6b8b\u5dee\u8fde\u63a5"},{"location":"llm/transformer/transformer/#_8","text":"\u7f16\u7801\u5668\u4e00\u822c\u6709\u591a\u5c42\uff0c\u7b2c\u4e00\u4e2a\u7f16\u7801\u5668\u7684\u8f93\u5165\u662f\u4e00\u4e2a\u5e8f\u5217\u6587\u672c\uff0c\u6700\u540e\u4e00\u4e2a\u7f16\u7801\u5668\u8f93\u51fa\u662f\u4e00\u7ec4\u5e8f\u5217\u5411\u91cf\uff0c\u8fd9\u7ec4\u5e8f\u5217\u5411\u91cf\u4f1a\u4f5c\u4e3a\u89e3\u7801\u5668\u7684 K\u3001V \u8f93\u5165\uff0c\u5176\u4e2d K=V=\u89e3\u7801\u5668\u8f93\u51fa\u7684\u5e8f\u5217\u5411\u91cf\u8868\u793a\u3002\u8fd9\u4e9b\u6ce8\u610f\u529b\u5411\u91cf\u5c06\u4f1a\u8f93\u5165\u5230\u6bcf\u4e2a\u89e3\u7801\u5668\u7684 Encoder-Decoder Attention \u5c42\uff0c\u8fd9\u6709\u52a9\u4e8e\u89e3\u7801\u5668\u628a\u6ce8\u610f\u529b\u96c6\u4e2d\u5230\u8f93\u5165\u5e8f\u5217\u7684\u5408\u9002\u4f4d\u7f6e\uff0c\u5982\u4e0b\u56fe\u6240\u793a\u3002 \u89e3\u7801\uff08decoding\uff09\u9636\u6bb5\u7684\u6bcf\u4e00\u4e2a\u65f6\u95f4\u6b65\u90fd\u8f93\u51fa\u4e00\u4e2a\u7ffb\u8bd1\u540e\u7684\u5355\u8bcd\uff08\u8fd9\u91cc\u7684\u4f8b\u5b50\u662f\u82f1\u8bed\u7ffb\u8bd1\uff09\uff0c\u89e3\u7801\u5668\u5f53\u524d\u65f6\u95f4\u6b65\u7684\u8f93\u51fa\u53c8\u91cd\u65b0\u4f5c\u4e3a\u8f93\u51fa Q \u548c\u7f16\u7801\u5668\u7684\u8f93\u51fa K\u3001V \u5171\u540c\u4f5c\u4e3a\u4e0b\u4e00\u4e2a\u65f6\u95f4\u6b65\u89e3\u7801\u5668\u7684\u8f93\u5165\u3002\u7136\u540e\u91cd\u590d\u8fd9\u4e2a\u8fc7\u7a0b\uff0c\u76f4\u5230\u8f93\u51fa\u4e00\u4e2a\u7ed3\u675f\u7b26\u3002 \u89e3\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\uff0c\u548c\u7f16\u7801\u5668\u4e2d\u7684 Self Attention \u5c42\u7684\u533a\u522b\uff1a \u5728\u89e3\u7801\u5668\u91cc\uff0cSelf Attention \u5c42\u53ea\u5141\u8bb8\u5173\u6ce8\u5230\u8f93\u51fa\u5e8f\u5217\u4e2d\u65e9\u4e8e\u5f53\u524d\u4f4d\u7f6e\u4e4b\u524d\u7684\u5355\u8bcd\u3002\u5177\u4f53\u505a\u6cd5\u662f\uff1a\u5728 Self Attention \u5206\u6570\u7ecf\u8fc7 Softmax \u5c42\u4e4b\u524d\uff0c\u5c4f\u853d\u5f53\u524d\u4f4d\u7f6e\u4e4b\u540e\u7684\u90a3\u4e9b\u4f4d\u7f6e\uff08\u5c06attention score\u8bbe\u7f6e\u6210-inf\uff09\u3002 \u89e3\u7801\u5668 Attention\u5c42\u662f\u4f7f\u7528\u524d\u4e00\u5c42\u7684\u8f93\u51fa\u6765\u6784\u9020Query \u77e9\u9635\uff0c\u800cKey\u77e9\u9635\u548c Value\u77e9\u9635\u6765\u81ea\u4e8e\u7f16\u7801\u5668\u6700\u7ec8\u7684\u8f93\u51fa\u3002","title":"\u89e3\u7801\u5668"},{"location":"llm/transformer/transformer/#reference","text":"learn-nlp-with-transformers 10\u5206\u949f\u5e26\u4f60\u6df1\u5165\u7406\u89e3Transformer\u539f\u7406\u53ca\u5b9e\u73b0 Transformer\u539f\u7406\u8be6\u89e3 transformer \u539f\u7406","title":"Reference"},{"location":"llm/transformer/vit/","text":"Vision Transformer \u00b6 \u7ea6 1497 \u4e2a\u5b57 128 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract Google \u9996\u6b21 \u5c06 Transformer \u5e94\u7528\u5230\u89c6\u89c9\u4e0a\uff0c\u5373 ViT\u3002 \u53c2\u8003\uff1a \u8bba\u6587\uff1a https://arxiv.org/abs/2010.11929 \u4ee3\u7801 https://github.com/google-research/vision_transformer Vit \u6a21\u578b\u4ecb\u7ecd \u00b6 \u5728 CV \u4e2d\uff0c\u5377\u79ef\u67b6\u6784\u4ecd\u5360\u4e3b\u5bfc\u5730\u4f4d\uff0c\u53d7 NLP \u7684\u542f\u53d1\uff0c\u5c1d\u8bd5\u5c06 Attention + CNN \u6216 Attention \u66ff\u6362 CNN components\uff08\u4fdd\u6301 CNN \u7684\u6574\u4f53\u7ed3\u6784\uff09\u3002 \u901a\u8fc7 Transformer \u7684\u653e\u7f29/\u6269\u5c55\uff0c\u5c1d\u8bd5\u5c06 Transformer \u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\uff0c\u4e3a\u6b64\uff0c\u6211\u4eec \u5c06\u56fe\u50cf\u62c6\u5206\u4e3a\u5757 (patch)\uff0c\u5e76\u5c06\u8fd9\u4e9b\u56fe\u50cf\u5757\u7684\u7ebf\u6027\u5d4c\u5165\u5e8f\u5217\u4f5c\u4e3a Transformer \u7684\u8f93\u5165\u3002\u56fe\u50cf\u5757 (patches) \u7684\u5904\u7406\u65b9\u5f0f\u540c NLP \u7684\u6807\u8bb0 (tokens) (\u6545\u7ecf\u8fc7\u7ebf\u6027\u5d4c\u5165\u540e\u53c8\u53eb patch token)\u3002 \u6211\u4eec\u4ee5\u6709\u76d1\u7763\u65b9\u5f0f\u8bad\u7ec3\u56fe\u50cf\u5206\u7c7b\u6a21\u578b\u3002 Vit \u8bc1\u660e\u4e0d\u9700\u8981\u5b8c\u5168\u4f9d\u8d56 CNNs\uff0c\u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\u5757\u5e8f\u5217\uff08sequences of images patches\uff09\u7684\u7eaf Transformer \u53ef\u4ee5\u5f88\u597d\u5730\u6267\u884c\u56fe\u50cf\u5206\u7c7b\u7684\u4efb\u52a1\u3002\u5f53\u5bf9\u5927\u91cf\u6570\u636e\u8fdb\u884c\u9884\u8bad\u7ec3\u5e76\u8fc1\u79fb\u5230\u591a\u4e2a\u4e2d\u5c0f\u578b\u56fe\u50cf\u8bc6\u522b\u57fa\u51c6\u65f6\uff0cViT \u6709\u66f4\u597d\u7684\u6548\u679c\u3002 \u65b9\u6cd5 \u00b6 \u56fe\u50cf\u5757\u5d4c\u5165 \u00b6 \u6807\u51c6 Transformer \u4f7f\u7528 \u4e00\u7ef4\u6807\u8bb0\u5d4c\u5165\u5e8f\u5217\uff08Sequence of token embeddings\uff09 \u4f5c\u4e3a\u8f93\u5165\u3002 \u4e3a\u5904\u7406 2D \u56fe\u50cf\uff0c\u5c06\u56fe\u50cf \\(x \\in R^{H \\times W \\times C}\\) reshape \u4e3a\u4e00\u4e2a\u94fa\u5e73\u7684 2D patches \u5e8f\u5217 \\(x_p \\in R^{N \\times (P^2 \\cdot C)}\\) (H,W)\uff1a\u4e3a\u539f\u59cb\u56fe\u50cf\u5206\u8fa8\u7387 C\uff1a\u539f\u59cb\u56fe\u50cf\u901a\u9053\u6570 (P,P)\uff1a\u6bcf\u4e2a\u56fe\u50cf patch \u7684\u5206\u8fa8\u7387 \u4ea7\u751f\u7684\u56fe\u50cf patch \u6570 \\(N = \\frac{HW}{P^2}\\) \uff1aTransformer \u7684\u6709\u6548\u8f93\u5165\u5e8f\u5217\u957f\u5ea6 Transformer \u5728\u5176\u6240\u6709\u5c42\u4e2d\u4f7f\u7528\u6052\u5b9a\u7684\u9690\u5411\u91cf\uff08latent vector\uff09\u5927\u5c0f D\uff0c\u5c06\u56fe\u50cf patches \u94fa\u5e73\uff0c\u5e76\u4f7f\u7528 \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71\uff08FC \u5c42\uff09\u5c06\u7ef4\u5ea6 \\(P^2C\\) \u6620\u5c04\u4e3a D \u7ef4 \uff0c\u540c\u65f6\u4fdd\u6301\u56fe\u50cf patches \u6570 D \u4e0d\u53d8\u3002 \u6295\u5f71\u8f93\u51fa\u5373\u4e3a \u56fe\u50cf\u5757\u5d4c\u5165 \uff0c\u7b49\u540c\u4e8e NLP \u4e2d\u7684 \u8bcd\u5d4c\u5165 \u3002 PatchEmbed class PatchEmbed ( nn . Module ): \"\"\" Image to Patch Embedding \"\"\" def __init__ ( self , img_size = 224 , patch_size = 16 , in_chans = 3 , embed_dim = 768 ): super () . __init__ () # (H, W) img_size = to_2tuple ( img_size ) # (P, P) patch_size = to_2tuple ( patch_size ) # N = (H // P) * (W // P) num_patches = ( img_size [ 1 ] // patch_size [ 1 ]) * ( img_size [ 0 ] // patch_size [ 0 ]) self . img_size = img_size self . patch_size = patch_size self . num_patches = num_patches # \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71 - \u83b7\u53d6\u8f93\u5165\u5d4c\u5165 self . proj = nn . Conv2d ( in_chans , embed_dim , kernel_size = patch_size , stride = patch_size ) def forward ( self , x ): B , C , H , W = x . shape assert H == self . img_size [ 0 ] and W == self . img_size [ 1 ], \\ f \"Input image size ( { H } * { W } ) doesn't match model ( { self . img_size [ 0 ] } * { self . img_size [ 1 ]}) . \" # (B, C, H, W) -> (B, D, (H//P), (W//P)) -> (B, D, N) -> (B, N, D) # D=embed_dim=768, N=num_patches=(H//P)*(W//P) # torch.flatten(input, start_dim=0, end_dim=-1) # \u5f62\u53c2\uff1a\u5c55\u5e73\u7684\u8d77\u59cb\u7ef4\u5ea6\u548c\u7ed3\u675f\u7ef4\u5ea6 # \u53ef\u89c1 Patch Embedding \u64cd\u4f5c 1 \u884c\u4ee3\u7801 3 \u6b65\u5230\u4f4d x = self . proj ( x ) . flatten ( 2 ) . transpose ( 1 , 2 ) return x \u4f4d\u7f6e\u4fe1\u606f\u7f16\u7801 \u00b6 \u4f4d\u7f6e\u5d4c\u5165 \\(E_{pos} \\in R^{(N+1) \\times D}\\) \u88ab\u52a0\u5165\u5230\u56fe\u50cf\u5757\u5d4c\u5165\uff0c\u4ee5\u4fdd\u7559\u8f93\u5165\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u4fe1\u606f\u3002 \u4e0d\u540c\u4e8e CNN\uff0cTransformer \u9700\u8981\u4f4d\u7f6e\u5d4c\u5165\u6765\u7f16\u7801 patch tokens \u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u8fd9\u4e3b\u8981\u7531\u4e8e self-attention \u7684\u6270\u52a8\u4e0d\u53d8\u6027\uff08\u6253\u4e71 Sequence \u4e2d tokens \u7684\u987a\u5e8f\u5e76\u4e0d\u4f1a\u6539\u53d8\u7ed3\u679c\uff09 \u5982\u679c\u4e0d\u52a0\u4f4d\u7f6e\u4fe1\u606f\uff0c\u6a21\u578b\u5c31\u9700\u8981\u901a\u8fc7\u56fe\u50cf\u5757\u7684\u8bed\u4e49\u6765\u5b66\u4e60\u62fc\u56fe Vit \u4e2d\u63d0\u4f9b\u7684\u4f4d\u7f6e\u7f16\u7801\u65b9\u6848 \u65e0\u4f4d\u7f6e\u5d4c\u5165 1-D \u4f4d\u7f6e\u5d4c\u5165 (1D-PE)\uff1a\u8003\u8651\u628a 2-D \u56fe\u50cf\u5757\u89c6\u4e3a 1-D \u5e8f\u5217 2-D \u4f4d\u7f6e\u5d4c\u5165 (2D-PE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684 2-D \u4f4d\u7f6e (x, y) \u76f8\u5bf9\u4f4d\u7f6e\u5d4c\u5165 (RPE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684\u76f8\u5bf9\u4f4d\u7f6e \u5728\u8f93\u5165 Transformer \u7f16\u7801\u5668\u4e4b\u524d\u76f4\u63a5\u5c06\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u5d4c\u5165\u76f8\u52a0 Transformer \u7f16\u7801\u5668 \u00b6 Encoder \u7531\u4ea4\u66ff\u7684\u591a\u5934\u81ea\u6ce8\u610f\u529b\u5c42\uff08MSA\uff09\u548c\u591a\u5c42\u611f\u77e5\u673a\u5757\uff08MLP\uff09\u6784\u6210\u3002\u5728\u6bcf\u4e2a\u5757\u524d\u5e94\u7528\u5c42\u5f52\u4e00\u5316\uff08Layer Norm\uff09\uff0c\u6bcf\u4e2a\u5757\u540e\u5e94\u7528\u6b8b\u5dee\u8fde\u63a5\uff08Residual Connection\uff09 MSA ```python class Attention(nn.Module): def init (self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0., proj_drop=0.): super(). init () self.num_heads = num_heads head_dim = dim // num_heads self.scale = qk_scale or head_dim ** -0.5 self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias) self.attn_drop = nn.Dropout(attn_drop) self.proj = nn.Linear(dim, dim) # \u9644\u5e26 dropout self.proj_drop = nn.Dropout(proj_drop) def forward(self, x): B, N, C = x.shape qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4) q, k, v = qkv[0], qkv[1], qkv[2] # make torchscript happy (cannot use tensor as tuple) attn = (q @ k.transpose(-2, -1)) * self.scale attn = attn.softmax(dim=-1) attn = self.attn_drop(attn) x = (attn @ v).transpose(1, 2).reshape(B, N, C) x = self.proj(x) x = self.proj_drop(x) return x ``` MSA \u540e\u8ddf\u4e00\u4e2a FFN\uff0c\u5305\u542b\u4e24\u4e2a FC \u5c42\uff0c\u7b2c\u4e00\u4e2a FC \u5c06\u7279\u5f81\u4ece\u7ef4\u5ea6 D \u53d8\u6362\u6210 4D\uff0c\u7b2c\u4e8c\u4e2a FC \u5c06\u7ef4\u5ea6 4D \u6062\u590d\u6210 D\uff0c\u4e2d\u95f4\u7684\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\u5747\u91c7\u7528 GeLU (Gaussian Error Linear Unit\uff0c\u9ad8\u65af\u8bef\u5dee\u7ebf\u6027\u5355\u5143) \uff0c\u5b9e\u8d28\u4e0a\u662f\u4e00\u4e2a MLP (\u591a\u5c42\u611f\u77e5\u673a\u4e0e\u7ebf\u6027\u6a21\u578b\u7c7b\u4f3c\uff0c\u533a\u522b\u5728\u4e8e MLP \u76f8\u5bf9\u4e8e FC \u5c42\u6570\u589e\u52a0\u4e14\u5f15\u5165\u4e86\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\uff0c\u4f8b\u5982 FC + GeLU + FC) MLP class Mlp ( nn . Module ): def __init__ ( self , in_features , hidden_features = None , out_features = None , act_layer = nn . GELU , drop = 0. ): super () . __init__ () out_features = out_features or in_features hidden_features = hidden_features or in_features self . fc1 = nn . Linear ( in_features , hidden_features ) self . act = act_layer () self . fc2 = nn . Linear ( hidden_features , out_features ) self . drop = nn . Dropout ( drop ) def forward ( self , x ): x = self . fc1 ( x ) x = self . act ( x ) x = self . drop ( x ) x = self . fc2 ( x ) x = self . drop ( x ) return x \u4e00\u4e2a Encoder block \u5305\u542b\u4e00\u4e2a MSA \u548c\u4e00\u4e2a FFN\uff0c\u4e8c\u8005\u90fd\u6709 \u8df3\u8dc3\u8fde\u63a5 \u548c \u5c42\u5f52\u4e00\u5316 \u64cd\u4f5c\u6784\u6210 MSA block \u548c MLP block block # Transformer Encoder Block class Block ( nn . Module ): def __init__ ( self , dim , num_heads , mlp_ratio = 4. , qkv_bias = False , qk_scale = None , drop = 0. , attn_drop = 0. , drop_path = 0. , act_layer = nn . GELU , norm_layer = nn . LayerNorm ): super () . __init__ () # \u540e\u63a5\u4e8e MHA \u7684 Layer Norm self . norm1 = norm_layer ( dim ) # MHA self . attn = Attention ( dim , num_heads = num_heads , qkv_bias = qkv_bias , qk_scale = qk_scale , attn_drop = attn_drop , proj_drop = drop ) # NOTE: drop path for stochastic depth, we shall see if this is better than dropout here self . drop_path = DropPath ( drop_path ) if drop_path > 0. else nn . Identity () # \u540e\u63a5\u4e8e MLP \u7684 Layer Norm self . norm2 = norm_layer ( dim ) # \u9690\u85cf\u5c42\u7ef4\u5ea6 mlp_hidden_dim = int ( dim * mlp_ratio ) # MLP self . mlp = Mlp ( in_features = dim , hidden_features = mlp_hidden_dim , act_layer = act_layer , drop = drop ) def forward ( self , x ): # MHA + Add & Layer Norm x = x + self . drop_path ( self . attn ( self . norm1 ( x ))) # MLP + Add & Layer Norm x = x + self . drop_path ( self . mlp ( self . norm2 ( x ))) return x \u96c6\u5408\u4e86\u7c7b\u522b\u5411\u91cf\u3001\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u7f16\u7801\u4e3a\u4e00\u4f53\u7684 \u8f93\u5165\u5d4c\u5165\u5411\u91cf \u540e\uff0c\u5373\u53ef\u9988\u5165Transformer Encoder\u3002ViT \u7c7b\u4f3c\u4e8e CNN\uff0c\u4e0d\u65ad\u524d\u5411\u901a\u8fc7\u7531 Transformer Encoder Blocks \u4e32\u884c\u5806\u53e0\u6784\u6210\u7684 Transformer Encoder\uff0c\u6700\u540e \u63d0\u53d6\u53ef\u5b66\u4e60\u7684\u7c7b\u522b\u5d4c\u5165\u5411\u91cf \u2014\u2014 class token \u5bf9\u5e94\u7684\u7279\u5f81\u7528\u4e8e \u56fe\u50cf\u5206\u7c7b\u3002 \u5f52\u7eb3\u504f\u7f6e\u4e0e\u6df7\u5408\u67b6\u6784 \u00b6 \u5f52\u7eb3\u504f\u7f6e \u00b6 ViT \u7684\u56fe\u50cf\u7279\u5b9a\u5f52\u7eb3\u504f\u6267\u6bd4 CNN \u5c11\u5f88\u591a\u3002 \u5728 CNN \u4e2d\uff0c\u5c40\u90e8\u6027\u3001\u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\u548c\u5e73\u79fb\u7b49\u6548\u6027\u5b58\u5728\u4e8e\u6574\u4e2a\u6a21\u578b\u7684\u6bcf\u4e00\u5c42\u4e2d\u3002 \u5728 ViT \u4e2d\uff0c\u53ea\u6709 MLP \u5c42\u662f\u5c40\u90e8\u548c\u5e73\u79fb\u7b49\u53d8\u7684\uff0c\u56e0\u4e3a\u81ea\u6ce8\u610f\u529b\u5c42\u90fd\u662f\u5168\u5c40\u7684\u3002 \u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\uff1a\u5728\u6a21\u578b\u5f00\u59cb\u65f6\u901a\u8fc7\u5c06\u56fe\u50cf\u5207\u5206\u6210\u5757\uff0c\u5e76\u5728\u5fae\u8c03\u65f6\u8c03\u6574\u4e0d\u540c\u5206\u8fa8\u7387\u56fe\u50cf\u7684\u4f4d\u7f6e\u5d4c\u5165\u3002 \u521d\u59cb\u5316\u65f6\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u643a\u5e26\u6709\u5173\u56fe\u50cf\u5757\u7684 2D \u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u6240\u6709\u7a7a\u95f4\u5173\u7cfb\u90fd\u5fc5\u987b\u4ece\u5934\u5f00\u59cb\u5b66\u4e60\u3002 \u6df7\u5408\u67b6\u6784 \u00b6 \u6df7\u5408\u67b6\u6784\uff1a\u4f5c\u4e3a\u539f\u59cb\u56fe\u50cf\u5757\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u8f93\u5165\u5e8f\u5217\u53ef\u7531 CNN \u7684\u7279\u5f81\u56fe\u6784\u6210\u3002 \u56fe\u50cf\u5757\u5d4c\u5165\u6295\u5f71 E \u88ab\u7528\u5728\u7ecf CNN \u7279\u5f81\u63d0\u53d6\u7684\u5757\u800c\u975e\u539f\u59cb\u8f93\u5165\u56fe\u50cf\u5757\u3002\u5757\u7684\u7a7a\u95f4\u5c3a\u5bf8\u4e3a 1x1\uff0c\u8fd9\u8868\u793a\u8f93\u5165\u5e8f\u5217\u662f\u901a\u8fc7\u7b80\u5355\u5730\u5c06\u7279\u5f81\u56fe\u7684\u7a7a\u95f4\u7ef4\u5ea6\u94fa\u5e73\u5e76\u6295\u5f71\u5230 Transformer \u7ef4\u5ea6\u83b7\u5f97\u3002 \u5fae\u8c03\u53ca\u66f4\u9ad8\u5206\u8fa8\u7387 \u00b6 \u5728\u5927\u578b\u6570\u636e\u96c6\u4e0a\u9884\u8bad\u7ec3 ViT\uff0c\u5e76\u5bf9\uff08\u66f4\u5c0f\u7684\uff09\u4e0b\u6e38\u4efb\u52a1\u8fdb\u884c\u5fae\u8c03\u3002\u4e3a\u6b64\uff0c\u79fb\u9664\u4e86\u9884\u8bad\u7ec3\u7684\u9884\u6d4b\u5934\u90e8\uff0c\u6362\u4e3a\u4e00\u4e2a\u96f6\u503c\u521d\u59cb\u5316\u7684 DxK \u524d\u9988\u5c42/\u5168\u8fde\u63a5\u5c42\uff0c\u5176\u4e2d K \u662f\u4e0b\u6e38\u4efb\u52a1\u7684\u7c7b\u522b\u6570\u3002 \u7528\u6bd4\u9884\u8bad\u7ec3\u65f6\u66f4\u9ad8\u7684\u56fe\u50cf\u5206\u8fa8\u7387\u8fdb\u884c\u5fae\u8c03\u901a\u5e38\u6548\u7387\u66f4\u9ad8\u3002\u5f53\u63d0\u4f9b\u66f4\u9ad8\u5206\u8fa8\u7387\u7684\u56fe\u50cf\u65f6\uff0c\u9700\u4fdd\u6301\u56fe\u50cf patchs \u5927\u5c0f\u76f8\u540c\uff0c\u6b64\u65f6\u6709\u6548\u56fe\u50cf patchs \u6570\u53d8\u591a\uff0c\u4ece\u800c\u6709\u6548\u5e8f\u5217\u957f\u5ea6\u4f1a\u66f4\u957f\u3002 ViT \u53ef\u4ee5\u5904\u7406\u4efb\u610f\u5e8f\u5217\u957f\u5ea6\uff0c\u4f46\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u518d\u6709\u610f\u4e49\uff0c\u56e0\u6b64\u6839\u636e\u5b83\u4eec\u5728\u539f\u56fe\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5bf9\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u6267\u884c 2D \u63d2\u503c\uff0c\u4ee5\u6269\u5c55\u5230\u5fae\u8c03\u5c3a\u5bf8\u3002 resize_pos_embed def resize_pos_embed ( posemb , posemb_new ): # Rescale the grid of position embeddings when loading from state_dict. Adapted from # https://github.com/google-research/vision_transformer/blob/00883dd691c63a6830751563748663526e811cee/vit_jax/checkpoint.py#L224 _logger . info ( 'Resized position embedding: %s to %s ' , posemb . shape , posemb_new . shape ) ntok_new = posemb_new . shape [ 1 ] # \u9664\u53bb class token \u7684 pos_embed posemb_tok , posemb_grid = posemb [:, : 1 ], posemb [ 0 , 1 :] ntok_new -= 1 gs_old = int ( math . sqrt ( len ( posemb_grid ))) gs_new = int ( math . sqrt ( ntok_new )) _logger . info ( 'Position embedding grid-size from %s to %s ' , gs_old , gs_new ) # \u628a pos_embed \u53d8\u6362\u5230 2-D \u7ef4\u5ea6\u518d\u8fdb\u884c\u63d2\u503c posemb_grid = posemb_grid . reshape ( 1 , gs_old , gs_old , - 1 ) . permute ( 0 , 3 , 1 , 2 ) posemb_grid = F . interpolate ( posemb_grid , size = ( gs_new , gs_new ), mode = 'bilinear' ) posemb_grid = posemb_grid . permute ( 0 , 2 , 3 , 1 ) . reshape ( 1 , gs_new * gs_new , - 1 ) posemb = torch . cat ([ posemb_tok , posemb_grid ], dim = 1 ) return posemb \u4f46\u8fd9\u79cd\u60c5\u5f62\u4f1a\u9020\u6210\u6027\u80fd\u635f\u5931\uff0c\u53ef\u901a\u8fc7\u5fae\u8c03\u6a21\u578b\u89e3\u51b3\u3002 \u8d85\u53c2\u6570 \u00b6 Layers \uff1aTransformer Encoder Blocks \u7684\u6570\u91cf Hidden Size D \uff1a\u9690\u85cf\u5c42\u7279\u5f81\u5927\u5c0f\uff0c\u5728\u5404 Encoder Block \u4fdd\u6301\u4e00\u81f4 MLP Size \uff1aMLP \u7279\u5f81\u5927\u5c0f\uff0c\u901a\u5e38\u8bbe\u4e3a 4D Heads \uff1aMSA \u7684\u5934\u6570 Patch Size \uff1a\u6a21\u578b\u8f93\u5165\u7684 Patch size\uff0cViT \u4e2d\u6709\u4e24\u79cd\u8bbe\u7f6e\uff1a14x14 \u548c 16x16","title":"ViT"},{"location":"llm/transformer/vit/#vision-transformer","text":"\u7ea6 1497 \u4e2a\u5b57 128 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract Google \u9996\u6b21 \u5c06 Transformer \u5e94\u7528\u5230\u89c6\u89c9\u4e0a\uff0c\u5373 ViT\u3002 \u53c2\u8003\uff1a \u8bba\u6587\uff1a https://arxiv.org/abs/2010.11929 \u4ee3\u7801 https://github.com/google-research/vision_transformer","title":"Vision Transformer"},{"location":"llm/transformer/vit/#vit","text":"\u5728 CV \u4e2d\uff0c\u5377\u79ef\u67b6\u6784\u4ecd\u5360\u4e3b\u5bfc\u5730\u4f4d\uff0c\u53d7 NLP \u7684\u542f\u53d1\uff0c\u5c1d\u8bd5\u5c06 Attention + CNN \u6216 Attention \u66ff\u6362 CNN components\uff08\u4fdd\u6301 CNN \u7684\u6574\u4f53\u7ed3\u6784\uff09\u3002 \u901a\u8fc7 Transformer \u7684\u653e\u7f29/\u6269\u5c55\uff0c\u5c1d\u8bd5\u5c06 Transformer \u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\uff0c\u4e3a\u6b64\uff0c\u6211\u4eec \u5c06\u56fe\u50cf\u62c6\u5206\u4e3a\u5757 (patch)\uff0c\u5e76\u5c06\u8fd9\u4e9b\u56fe\u50cf\u5757\u7684\u7ebf\u6027\u5d4c\u5165\u5e8f\u5217\u4f5c\u4e3a Transformer \u7684\u8f93\u5165\u3002\u56fe\u50cf\u5757 (patches) \u7684\u5904\u7406\u65b9\u5f0f\u540c NLP \u7684\u6807\u8bb0 (tokens) (\u6545\u7ecf\u8fc7\u7ebf\u6027\u5d4c\u5165\u540e\u53c8\u53eb patch token)\u3002 \u6211\u4eec\u4ee5\u6709\u76d1\u7763\u65b9\u5f0f\u8bad\u7ec3\u56fe\u50cf\u5206\u7c7b\u6a21\u578b\u3002 Vit \u8bc1\u660e\u4e0d\u9700\u8981\u5b8c\u5168\u4f9d\u8d56 CNNs\uff0c\u76f4\u63a5\u5e94\u7528\u4e8e\u56fe\u50cf\u5757\u5e8f\u5217\uff08sequences of images patches\uff09\u7684\u7eaf Transformer \u53ef\u4ee5\u5f88\u597d\u5730\u6267\u884c\u56fe\u50cf\u5206\u7c7b\u7684\u4efb\u52a1\u3002\u5f53\u5bf9\u5927\u91cf\u6570\u636e\u8fdb\u884c\u9884\u8bad\u7ec3\u5e76\u8fc1\u79fb\u5230\u591a\u4e2a\u4e2d\u5c0f\u578b\u56fe\u50cf\u8bc6\u522b\u57fa\u51c6\u65f6\uff0cViT \u6709\u66f4\u597d\u7684\u6548\u679c\u3002","title":"Vit \u6a21\u578b\u4ecb\u7ecd"},{"location":"llm/transformer/vit/#_1","text":"","title":"\u65b9\u6cd5"},{"location":"llm/transformer/vit/#_2","text":"\u6807\u51c6 Transformer \u4f7f\u7528 \u4e00\u7ef4\u6807\u8bb0\u5d4c\u5165\u5e8f\u5217\uff08Sequence of token embeddings\uff09 \u4f5c\u4e3a\u8f93\u5165\u3002 \u4e3a\u5904\u7406 2D \u56fe\u50cf\uff0c\u5c06\u56fe\u50cf \\(x \\in R^{H \\times W \\times C}\\) reshape \u4e3a\u4e00\u4e2a\u94fa\u5e73\u7684 2D patches \u5e8f\u5217 \\(x_p \\in R^{N \\times (P^2 \\cdot C)}\\) (H,W)\uff1a\u4e3a\u539f\u59cb\u56fe\u50cf\u5206\u8fa8\u7387 C\uff1a\u539f\u59cb\u56fe\u50cf\u901a\u9053\u6570 (P,P)\uff1a\u6bcf\u4e2a\u56fe\u50cf patch \u7684\u5206\u8fa8\u7387 \u4ea7\u751f\u7684\u56fe\u50cf patch \u6570 \\(N = \\frac{HW}{P^2}\\) \uff1aTransformer \u7684\u6709\u6548\u8f93\u5165\u5e8f\u5217\u957f\u5ea6 Transformer \u5728\u5176\u6240\u6709\u5c42\u4e2d\u4f7f\u7528\u6052\u5b9a\u7684\u9690\u5411\u91cf\uff08latent vector\uff09\u5927\u5c0f D\uff0c\u5c06\u56fe\u50cf patches \u94fa\u5e73\uff0c\u5e76\u4f7f\u7528 \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71\uff08FC \u5c42\uff09\u5c06\u7ef4\u5ea6 \\(P^2C\\) \u6620\u5c04\u4e3a D \u7ef4 \uff0c\u540c\u65f6\u4fdd\u6301\u56fe\u50cf patches \u6570 D \u4e0d\u53d8\u3002 \u6295\u5f71\u8f93\u51fa\u5373\u4e3a \u56fe\u50cf\u5757\u5d4c\u5165 \uff0c\u7b49\u540c\u4e8e NLP \u4e2d\u7684 \u8bcd\u5d4c\u5165 \u3002 PatchEmbed class PatchEmbed ( nn . Module ): \"\"\" Image to Patch Embedding \"\"\" def __init__ ( self , img_size = 224 , patch_size = 16 , in_chans = 3 , embed_dim = 768 ): super () . __init__ () # (H, W) img_size = to_2tuple ( img_size ) # (P, P) patch_size = to_2tuple ( patch_size ) # N = (H // P) * (W // P) num_patches = ( img_size [ 1 ] // patch_size [ 1 ]) * ( img_size [ 0 ] // patch_size [ 0 ]) self . img_size = img_size self . patch_size = patch_size self . num_patches = num_patches # \u53ef\u8bad\u7ec3\u7684\u7ebf\u6027\u6295\u5f71 - \u83b7\u53d6\u8f93\u5165\u5d4c\u5165 self . proj = nn . Conv2d ( in_chans , embed_dim , kernel_size = patch_size , stride = patch_size ) def forward ( self , x ): B , C , H , W = x . shape assert H == self . img_size [ 0 ] and W == self . img_size [ 1 ], \\ f \"Input image size ( { H } * { W } ) doesn't match model ( { self . img_size [ 0 ] } * { self . img_size [ 1 ]}) . \" # (B, C, H, W) -> (B, D, (H//P), (W//P)) -> (B, D, N) -> (B, N, D) # D=embed_dim=768, N=num_patches=(H//P)*(W//P) # torch.flatten(input, start_dim=0, end_dim=-1) # \u5f62\u53c2\uff1a\u5c55\u5e73\u7684\u8d77\u59cb\u7ef4\u5ea6\u548c\u7ed3\u675f\u7ef4\u5ea6 # \u53ef\u89c1 Patch Embedding \u64cd\u4f5c 1 \u884c\u4ee3\u7801 3 \u6b65\u5230\u4f4d x = self . proj ( x ) . flatten ( 2 ) . transpose ( 1 , 2 ) return x","title":"\u56fe\u50cf\u5757\u5d4c\u5165"},{"location":"llm/transformer/vit/#_3","text":"\u4f4d\u7f6e\u5d4c\u5165 \\(E_{pos} \\in R^{(N+1) \\times D}\\) \u88ab\u52a0\u5165\u5230\u56fe\u50cf\u5757\u5d4c\u5165\uff0c\u4ee5\u4fdd\u7559\u8f93\u5165\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u7a7a\u95f4\u4f4d\u7f6e\u4fe1\u606f\u3002 \u4e0d\u540c\u4e8e CNN\uff0cTransformer \u9700\u8981\u4f4d\u7f6e\u5d4c\u5165\u6765\u7f16\u7801 patch tokens \u7684\u4f4d\u7f6e\u4fe1\u606f\uff0c\u8fd9\u4e3b\u8981\u7531\u4e8e self-attention \u7684\u6270\u52a8\u4e0d\u53d8\u6027\uff08\u6253\u4e71 Sequence \u4e2d tokens \u7684\u987a\u5e8f\u5e76\u4e0d\u4f1a\u6539\u53d8\u7ed3\u679c\uff09 \u5982\u679c\u4e0d\u52a0\u4f4d\u7f6e\u4fe1\u606f\uff0c\u6a21\u578b\u5c31\u9700\u8981\u901a\u8fc7\u56fe\u50cf\u5757\u7684\u8bed\u4e49\u6765\u5b66\u4e60\u62fc\u56fe Vit \u4e2d\u63d0\u4f9b\u7684\u4f4d\u7f6e\u7f16\u7801\u65b9\u6848 \u65e0\u4f4d\u7f6e\u5d4c\u5165 1-D \u4f4d\u7f6e\u5d4c\u5165 (1D-PE)\uff1a\u8003\u8651\u628a 2-D \u56fe\u50cf\u5757\u89c6\u4e3a 1-D \u5e8f\u5217 2-D \u4f4d\u7f6e\u5d4c\u5165 (2D-PE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684 2-D \u4f4d\u7f6e (x, y) \u76f8\u5bf9\u4f4d\u7f6e\u5d4c\u5165 (RPE)\uff1a\u8003\u8651\u56fe\u50cf\u5757\u7684\u76f8\u5bf9\u4f4d\u7f6e \u5728\u8f93\u5165 Transformer \u7f16\u7801\u5668\u4e4b\u524d\u76f4\u63a5\u5c06\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u5d4c\u5165\u76f8\u52a0","title":"\u4f4d\u7f6e\u4fe1\u606f\u7f16\u7801"},{"location":"llm/transformer/vit/#transformer","text":"Encoder \u7531\u4ea4\u66ff\u7684\u591a\u5934\u81ea\u6ce8\u610f\u529b\u5c42\uff08MSA\uff09\u548c\u591a\u5c42\u611f\u77e5\u673a\u5757\uff08MLP\uff09\u6784\u6210\u3002\u5728\u6bcf\u4e2a\u5757\u524d\u5e94\u7528\u5c42\u5f52\u4e00\u5316\uff08Layer Norm\uff09\uff0c\u6bcf\u4e2a\u5757\u540e\u5e94\u7528\u6b8b\u5dee\u8fde\u63a5\uff08Residual Connection\uff09 MSA ```python class Attention(nn.Module): def init (self, dim, num_heads=8, qkv_bias=False, qk_scale=None, attn_drop=0., proj_drop=0.): super(). init () self.num_heads = num_heads head_dim = dim // num_heads self.scale = qk_scale or head_dim ** -0.5 self.qkv = nn.Linear(dim, dim * 3, bias=qkv_bias) self.attn_drop = nn.Dropout(attn_drop) self.proj = nn.Linear(dim, dim) # \u9644\u5e26 dropout self.proj_drop = nn.Dropout(proj_drop) def forward(self, x): B, N, C = x.shape qkv = self.qkv(x).reshape(B, N, 3, self.num_heads, C // self.num_heads).permute(2, 0, 3, 1, 4) q, k, v = qkv[0], qkv[1], qkv[2] # make torchscript happy (cannot use tensor as tuple) attn = (q @ k.transpose(-2, -1)) * self.scale attn = attn.softmax(dim=-1) attn = self.attn_drop(attn) x = (attn @ v).transpose(1, 2).reshape(B, N, C) x = self.proj(x) x = self.proj_drop(x) return x ``` MSA \u540e\u8ddf\u4e00\u4e2a FFN\uff0c\u5305\u542b\u4e24\u4e2a FC \u5c42\uff0c\u7b2c\u4e00\u4e2a FC \u5c06\u7279\u5f81\u4ece\u7ef4\u5ea6 D \u53d8\u6362\u6210 4D\uff0c\u7b2c\u4e8c\u4e2a FC \u5c06\u7ef4\u5ea6 4D \u6062\u590d\u6210 D\uff0c\u4e2d\u95f4\u7684\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\u5747\u91c7\u7528 GeLU (Gaussian Error Linear Unit\uff0c\u9ad8\u65af\u8bef\u5dee\u7ebf\u6027\u5355\u5143) \uff0c\u5b9e\u8d28\u4e0a\u662f\u4e00\u4e2a MLP (\u591a\u5c42\u611f\u77e5\u673a\u4e0e\u7ebf\u6027\u6a21\u578b\u7c7b\u4f3c\uff0c\u533a\u522b\u5728\u4e8e MLP \u76f8\u5bf9\u4e8e FC \u5c42\u6570\u589e\u52a0\u4e14\u5f15\u5165\u4e86\u975e\u7ebf\u6027\u6fc0\u6d3b\u51fd\u6570\uff0c\u4f8b\u5982 FC + GeLU + FC) MLP class Mlp ( nn . Module ): def __init__ ( self , in_features , hidden_features = None , out_features = None , act_layer = nn . GELU , drop = 0. ): super () . __init__ () out_features = out_features or in_features hidden_features = hidden_features or in_features self . fc1 = nn . Linear ( in_features , hidden_features ) self . act = act_layer () self . fc2 = nn . Linear ( hidden_features , out_features ) self . drop = nn . Dropout ( drop ) def forward ( self , x ): x = self . fc1 ( x ) x = self . act ( x ) x = self . drop ( x ) x = self . fc2 ( x ) x = self . drop ( x ) return x \u4e00\u4e2a Encoder block \u5305\u542b\u4e00\u4e2a MSA \u548c\u4e00\u4e2a FFN\uff0c\u4e8c\u8005\u90fd\u6709 \u8df3\u8dc3\u8fde\u63a5 \u548c \u5c42\u5f52\u4e00\u5316 \u64cd\u4f5c\u6784\u6210 MSA block \u548c MLP block block # Transformer Encoder Block class Block ( nn . Module ): def __init__ ( self , dim , num_heads , mlp_ratio = 4. , qkv_bias = False , qk_scale = None , drop = 0. , attn_drop = 0. , drop_path = 0. , act_layer = nn . GELU , norm_layer = nn . LayerNorm ): super () . __init__ () # \u540e\u63a5\u4e8e MHA \u7684 Layer Norm self . norm1 = norm_layer ( dim ) # MHA self . attn = Attention ( dim , num_heads = num_heads , qkv_bias = qkv_bias , qk_scale = qk_scale , attn_drop = attn_drop , proj_drop = drop ) # NOTE: drop path for stochastic depth, we shall see if this is better than dropout here self . drop_path = DropPath ( drop_path ) if drop_path > 0. else nn . Identity () # \u540e\u63a5\u4e8e MLP \u7684 Layer Norm self . norm2 = norm_layer ( dim ) # \u9690\u85cf\u5c42\u7ef4\u5ea6 mlp_hidden_dim = int ( dim * mlp_ratio ) # MLP self . mlp = Mlp ( in_features = dim , hidden_features = mlp_hidden_dim , act_layer = act_layer , drop = drop ) def forward ( self , x ): # MHA + Add & Layer Norm x = x + self . drop_path ( self . attn ( self . norm1 ( x ))) # MLP + Add & Layer Norm x = x + self . drop_path ( self . mlp ( self . norm2 ( x ))) return x \u96c6\u5408\u4e86\u7c7b\u522b\u5411\u91cf\u3001\u56fe\u50cf\u5757\u5d4c\u5165\u548c\u4f4d\u7f6e\u7f16\u7801\u4e3a\u4e00\u4f53\u7684 \u8f93\u5165\u5d4c\u5165\u5411\u91cf \u540e\uff0c\u5373\u53ef\u9988\u5165Transformer Encoder\u3002ViT \u7c7b\u4f3c\u4e8e CNN\uff0c\u4e0d\u65ad\u524d\u5411\u901a\u8fc7\u7531 Transformer Encoder Blocks \u4e32\u884c\u5806\u53e0\u6784\u6210\u7684 Transformer Encoder\uff0c\u6700\u540e \u63d0\u53d6\u53ef\u5b66\u4e60\u7684\u7c7b\u522b\u5d4c\u5165\u5411\u91cf \u2014\u2014 class token \u5bf9\u5e94\u7684\u7279\u5f81\u7528\u4e8e \u56fe\u50cf\u5206\u7c7b\u3002","title":"Transformer \u7f16\u7801\u5668"},{"location":"llm/transformer/vit/#_4","text":"","title":"\u5f52\u7eb3\u504f\u7f6e\u4e0e\u6df7\u5408\u67b6\u6784"},{"location":"llm/transformer/vit/#_5","text":"ViT \u7684\u56fe\u50cf\u7279\u5b9a\u5f52\u7eb3\u504f\u6267\u6bd4 CNN \u5c11\u5f88\u591a\u3002 \u5728 CNN \u4e2d\uff0c\u5c40\u90e8\u6027\u3001\u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\u548c\u5e73\u79fb\u7b49\u6548\u6027\u5b58\u5728\u4e8e\u6574\u4e2a\u6a21\u578b\u7684\u6bcf\u4e00\u5c42\u4e2d\u3002 \u5728 ViT \u4e2d\uff0c\u53ea\u6709 MLP \u5c42\u662f\u5c40\u90e8\u548c\u5e73\u79fb\u7b49\u53d8\u7684\uff0c\u56e0\u4e3a\u81ea\u6ce8\u610f\u529b\u5c42\u90fd\u662f\u5168\u5c40\u7684\u3002 \u4e8c\u7ef4\u90bb\u57df\u7ed3\u6784\uff1a\u5728\u6a21\u578b\u5f00\u59cb\u65f6\u901a\u8fc7\u5c06\u56fe\u50cf\u5207\u5206\u6210\u5757\uff0c\u5e76\u5728\u5fae\u8c03\u65f6\u8c03\u6574\u4e0d\u540c\u5206\u8fa8\u7387\u56fe\u50cf\u7684\u4f4d\u7f6e\u5d4c\u5165\u3002 \u521d\u59cb\u5316\u65f6\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u643a\u5e26\u6709\u5173\u56fe\u50cf\u5757\u7684 2D \u4f4d\u7f6e\u7684\u4fe1\u606f\uff0c\u56fe\u50cf\u5757\u4e4b\u95f4\u7684\u6240\u6709\u7a7a\u95f4\u5173\u7cfb\u90fd\u5fc5\u987b\u4ece\u5934\u5f00\u59cb\u5b66\u4e60\u3002","title":"\u5f52\u7eb3\u504f\u7f6e"},{"location":"llm/transformer/vit/#_6","text":"\u6df7\u5408\u67b6\u6784\uff1a\u4f5c\u4e3a\u539f\u59cb\u56fe\u50cf\u5757\u7684\u66ff\u4ee3\u65b9\u6848\uff0c\u8f93\u5165\u5e8f\u5217\u53ef\u7531 CNN \u7684\u7279\u5f81\u56fe\u6784\u6210\u3002 \u56fe\u50cf\u5757\u5d4c\u5165\u6295\u5f71 E \u88ab\u7528\u5728\u7ecf CNN \u7279\u5f81\u63d0\u53d6\u7684\u5757\u800c\u975e\u539f\u59cb\u8f93\u5165\u56fe\u50cf\u5757\u3002\u5757\u7684\u7a7a\u95f4\u5c3a\u5bf8\u4e3a 1x1\uff0c\u8fd9\u8868\u793a\u8f93\u5165\u5e8f\u5217\u662f\u901a\u8fc7\u7b80\u5355\u5730\u5c06\u7279\u5f81\u56fe\u7684\u7a7a\u95f4\u7ef4\u5ea6\u94fa\u5e73\u5e76\u6295\u5f71\u5230 Transformer \u7ef4\u5ea6\u83b7\u5f97\u3002","title":"\u6df7\u5408\u67b6\u6784"},{"location":"llm/transformer/vit/#_7","text":"\u5728\u5927\u578b\u6570\u636e\u96c6\u4e0a\u9884\u8bad\u7ec3 ViT\uff0c\u5e76\u5bf9\uff08\u66f4\u5c0f\u7684\uff09\u4e0b\u6e38\u4efb\u52a1\u8fdb\u884c\u5fae\u8c03\u3002\u4e3a\u6b64\uff0c\u79fb\u9664\u4e86\u9884\u8bad\u7ec3\u7684\u9884\u6d4b\u5934\u90e8\uff0c\u6362\u4e3a\u4e00\u4e2a\u96f6\u503c\u521d\u59cb\u5316\u7684 DxK \u524d\u9988\u5c42/\u5168\u8fde\u63a5\u5c42\uff0c\u5176\u4e2d K \u662f\u4e0b\u6e38\u4efb\u52a1\u7684\u7c7b\u522b\u6570\u3002 \u7528\u6bd4\u9884\u8bad\u7ec3\u65f6\u66f4\u9ad8\u7684\u56fe\u50cf\u5206\u8fa8\u7387\u8fdb\u884c\u5fae\u8c03\u901a\u5e38\u6548\u7387\u66f4\u9ad8\u3002\u5f53\u63d0\u4f9b\u66f4\u9ad8\u5206\u8fa8\u7387\u7684\u56fe\u50cf\u65f6\uff0c\u9700\u4fdd\u6301\u56fe\u50cf patchs \u5927\u5c0f\u76f8\u540c\uff0c\u6b64\u65f6\u6709\u6548\u56fe\u50cf patchs \u6570\u53d8\u591a\uff0c\u4ece\u800c\u6709\u6548\u5e8f\u5217\u957f\u5ea6\u4f1a\u66f4\u957f\u3002 ViT \u53ef\u4ee5\u5904\u7406\u4efb\u610f\u5e8f\u5217\u957f\u5ea6\uff0c\u4f46\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u4e0d\u518d\u6709\u610f\u4e49\uff0c\u56e0\u6b64\u6839\u636e\u5b83\u4eec\u5728\u539f\u56fe\u4e2d\u7684\u4f4d\u7f6e\uff0c\u5bf9\u9884\u8bad\u7ec3\u7684\u4f4d\u7f6e\u5d4c\u5165\u6267\u884c 2D \u63d2\u503c\uff0c\u4ee5\u6269\u5c55\u5230\u5fae\u8c03\u5c3a\u5bf8\u3002 resize_pos_embed def resize_pos_embed ( posemb , posemb_new ): # Rescale the grid of position embeddings when loading from state_dict. Adapted from # https://github.com/google-research/vision_transformer/blob/00883dd691c63a6830751563748663526e811cee/vit_jax/checkpoint.py#L224 _logger . info ( 'Resized position embedding: %s to %s ' , posemb . shape , posemb_new . shape ) ntok_new = posemb_new . shape [ 1 ] # \u9664\u53bb class token \u7684 pos_embed posemb_tok , posemb_grid = posemb [:, : 1 ], posemb [ 0 , 1 :] ntok_new -= 1 gs_old = int ( math . sqrt ( len ( posemb_grid ))) gs_new = int ( math . sqrt ( ntok_new )) _logger . info ( 'Position embedding grid-size from %s to %s ' , gs_old , gs_new ) # \u628a pos_embed \u53d8\u6362\u5230 2-D \u7ef4\u5ea6\u518d\u8fdb\u884c\u63d2\u503c posemb_grid = posemb_grid . reshape ( 1 , gs_old , gs_old , - 1 ) . permute ( 0 , 3 , 1 , 2 ) posemb_grid = F . interpolate ( posemb_grid , size = ( gs_new , gs_new ), mode = 'bilinear' ) posemb_grid = posemb_grid . permute ( 0 , 2 , 3 , 1 ) . reshape ( 1 , gs_new * gs_new , - 1 ) posemb = torch . cat ([ posemb_tok , posemb_grid ], dim = 1 ) return posemb \u4f46\u8fd9\u79cd\u60c5\u5f62\u4f1a\u9020\u6210\u6027\u80fd\u635f\u5931\uff0c\u53ef\u901a\u8fc7\u5fae\u8c03\u6a21\u578b\u89e3\u51b3\u3002","title":"\u5fae\u8c03\u53ca\u66f4\u9ad8\u5206\u8fa8\u7387"},{"location":"llm/transformer/vit/#_8","text":"Layers \uff1aTransformer Encoder Blocks \u7684\u6570\u91cf Hidden Size D \uff1a\u9690\u85cf\u5c42\u7279\u5f81\u5927\u5c0f\uff0c\u5728\u5404 Encoder Block \u4fdd\u6301\u4e00\u81f4 MLP Size \uff1aMLP \u7279\u5f81\u5927\u5c0f\uff0c\u901a\u5e38\u8bbe\u4e3a 4D Heads \uff1aMSA \u7684\u5934\u6570 Patch Size \uff1a\u6a21\u578b\u8f93\u5165\u7684 Patch size\uff0cViT \u4e2d\u6709\u4e24\u79cd\u8bbe\u7f6e\uff1a14x14 \u548c 16x16","title":"\u8d85\u53c2\u6570"},{"location":"mb/","text":"\u6570\u7406\u57fa\u7840 \u00b6 Abstract \u8fd9\u91cc\u662f\u6570\u7406\u57fa\u7840\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u6570\u7406\u57fa\u7840 \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 4776 16 mins 1696841966 \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 4501 14 mins 1696680112 \u7ec4\u5408\u6570\u5b66 569 2 mins 1695089803 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u6570\u7406\u57fa\u7840"},{"location":"mb/#_1","text":"Abstract \u8fd9\u91cc\u662f\u6570\u7406\u57fa\u7840\u76f8\u5173\u5185\u5bb9\u7684\u7b14\u8bb0","title":"\u6570\u7406\u57fa\u7840"},{"location":"mb/#table-of-contents","text":"\u6570\u7406\u57fa\u7840 \u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 4776 16 mins 1696841966 \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 4501 14 mins 1696680112 \u7ec4\u5408\u6570\u5b66 569 2 mins 1695089803 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"mb/comb/","text":"\u7ec4\u5408\u6570\u5b66 \u00b6 \u6392\u5217\u7ec4\u5408 \u00b6 \u5706\u6392\u5217:n\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e00\u4e2a\u5708\u7684\u65b9\u6848\u6570\uff1a \\(\\frac{A_{n}^k}{k}\\) \u9879\u94fe\u6392\u5217: \\({\\frac{A_{n}^k}{2k}}\\) \u9519\u4f4d\u6392\u5217:n\u4e2a\u6570\u7684\u6240\u6709\u9519\u6392\u65b9\u6848\u6570\u7684\u9012\u63a8\u516c\u5f0f\u4e3a \\({f(n)=(n-1)*(f(n-1)+f(n-2))}\\) ,\u524d\u51e0\u9879\u4e3a \\(0\u30011\u30012\u30019\u300144\u3001265\\) \u591a\u91cd\u6392\u5217:\u8bbe \\(S=\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\(\\frac{n!}{n1!*n2!*...*nk!}\\) \u4e0d\u76f8\u90bb\u7ec4\u5408:[1,n]\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e0d\u76f8\u90bb\u7684\u6392\u5217\u7684\u65b9\u6848\u6570\u4e3a\uff1a \\(C_{n-k+1}^k\\) \u53ef\u91cd\u7ec4\u5408:\u8bbeS= \\(\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5728S\u4e2d\u9009r\u4e2a\uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\({C_{r+k-1}^{k-1}}\\) \u65b9\u6cd5\uff1a\u9694\u677f\u6cd5\uff0c\u6346\u7ed1\u6cd5... \u6269\u5c55: \u4e8c\u9879\u5f0f\u5b9a\u7406: \\((a+b)^n=\\sum_{k=0}^nC_n^ka^{n-k}b^k\\) \u591a\u9879\u5f0f\u5b9a\u7406: \\((x1+x2+...+xk)^n=\\sum_{n1+n2+...+nk=n}\\frac{n!}{n1!n2!...nk!}\\prod_{i=1}^kx_i^{ni}\\) \u683c\u8def\u95ee\u9898: \\((0,0)\\) \u70b9\u8d70\u5230 \\((m,n)\\) \u70b9\u7684\u65b9\u6848\u6570\u4e3a \\(C_{m+n}^n\\) \u6bcd\u51fd\u6570 \u00b6 \u666e\u901a\u578b\u6bcd\u51fd\u6570 \u00b6 \u4e3b\u8981\u6c42\u7ec4\u5408\u7684\u65b9\u6848\u6570\u3002 \u5f62\u5982 \\({a_0+a_1x^1+a_2x^2+...+a_nx^n}\\) \u6307\u6570\u578b\u6bcd\u51fd\u6570 \u00b6 \u4e3b\u8981\u6c42\u591a\u91cd\u6392\u5217\u6570\u3002 \u5f62\u5982 \\({a_0+\\frac{a_1x}{1!}+\\frac{a_2x^2}{2!}+...\\frac{a_nx^n}{n!}}\\) \u7279\u6b8a\u7684\u6570 \u00b6 \u6590\u6ce2\u90a3\u5951\u6570 \u00b6 \u9012\u63a8\u5f0f: \\(f(n)=f(n-1)+f(n-2)\\) \u4e8c\u9636\u5e38\u7cfb\u6570\u9012\u5f52\u516c\u5f0f: \\(f(n)=\\frac{1}{\\sqrt 5}[(\\frac{1+\\sqrt 5}{2})^n-(\\frac{1-\\sqrt 5}{2})^n]\\) \u524d\u51e0\u9879\u4e3a1\u30011\u30012\u30013\u30015\u30018... \u5361\u7279\u5170\u6570 \u00b6 \u5e38\u89c1\u516c\u5f0f\uff1a \\(H_n=\\frac{C_{2n}^n}{n+1}\\) \\(H_n=\\frac{H_{n-1}(4n-2)}{n+1}\\) \\(H_n=1 \\;\\;(n=0||n=1)\\) \\(H_n=\\sum_{i=1}^nH_{n-i}H_{i-1} (n\\geq 2)\\) \\(H_n=C_{2n}^n-C_{2n}^{n-1}\\) \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300114\u300142\u3001132... \u65af\u7279\u6797\u6570 \u00b6 \u7b2c\u4e00\u7c7bStirling\u6570 \u00b6 \u9012\u63a8\u5f0f: \\({S_u(n,k)=S_u(n-1,k-1)+(n-1)*S_u(n-1,k)}\\;\\;\\;S_u(0,0)=1\\) \u7b2c\u4e8c\u7c7bStirling\u6570 \u00b6 \u9012\u63a8\u5f0f: \\({S(n,k)=S(n-1,k-1)+k*S(n-1.k)}\\;\\;\\;S(0,0)=1\\) \u7ebf\u6027\u516c\u5f0f: \\({S(n,k)=\\frac{1}{k!}\\sum_{i=0}^k(-1)^iC_k^i(k-i)^n}\\) \u8d1d\u5c14\u6570 \u00b6 \u9012\u63a8\u5f0f: \\({B_{n+1}=\\sum_{k=0}^nC_n^kB_k}\\) \u6839\u636e\u7b2c\u4e8c\u7c7b\u65af\u7279\u6797\u6570: \\({B_n=\\sum_{k=0}^nS(n,k)}\\) \u62d3\u5c55\uff1a\u8d1d\u5c14\u4e09\u89d2\u5f62\u6c42\u89e3\u3002 \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300115\u300152\u3001203... \u4f2f\u52aa\u5229\u6570 \u00b6 \u7b49\u5e42\u6c42\u548c: \\(S_mn=\\frac{1}{m+1}\\sum_{k=0}^mC_{m+1}^kn^{m-k+1}\\) \\(\\sum_{i=1}^ni^k=\\frac{1}{k+1}\\sum_{i=1}^{k+1}C_{k+1}^iB_{k-i+1}(n+1)^i\\) \u9012\u63a8\u5f0f: \\({\\sum_{k=0}^nB_kC_{n+1}^k=0}\\;\\;\\;(B_0=1)\\) \\(B_n=-\\frac{1}{n+1}[C_{n+1}^0B0+C_{n+1}^1B1+...+C_{n+1}^{n-1}B_{n-1}]\\) \u524d\u51e0\u9879\u4e3a\uff1a \\(1\u3001-\\frac{1}{2}\u3001\\frac{1}{6}\u30010\u3001\\frac{1}{30}...\\)","title":"\u7ec4\u5408\u6570\u5b66"},{"location":"mb/comb/#_1","text":"","title":"\u7ec4\u5408\u6570\u5b66"},{"location":"mb/comb/#_2","text":"\u5706\u6392\u5217:n\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e00\u4e2a\u5708\u7684\u65b9\u6848\u6570\uff1a \\(\\frac{A_{n}^k}{k}\\) \u9879\u94fe\u6392\u5217: \\({\\frac{A_{n}^k}{2k}}\\) \u9519\u4f4d\u6392\u5217:n\u4e2a\u6570\u7684\u6240\u6709\u9519\u6392\u65b9\u6848\u6570\u7684\u9012\u63a8\u516c\u5f0f\u4e3a \\({f(n)=(n-1)*(f(n-1)+f(n-2))}\\) ,\u524d\u51e0\u9879\u4e3a \\(0\u30011\u30012\u30019\u300144\u3001265\\) \u591a\u91cd\u6392\u5217:\u8bbe \\(S=\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\(\\frac{n!}{n1!*n2!*...*nk!}\\) \u4e0d\u76f8\u90bb\u7ec4\u5408:[1,n]\u4e2a\u4e2d\u9009k\u4e2a\u7ec4\u6210\u4e0d\u76f8\u90bb\u7684\u6392\u5217\u7684\u65b9\u6848\u6570\u4e3a\uff1a \\(C_{n-k+1}^k\\) \u53ef\u91cd\u7ec4\u5408:\u8bbeS= \\(\\{n1*a1,n2*a2,...,nk*ak\\}\\) \uff0c\u5728S\u4e2d\u9009r\u4e2a\uff0c\u5219\u6240\u6709\u7684\u65b9\u6848\u6570\u4e3a \\({C_{r+k-1}^{k-1}}\\) \u65b9\u6cd5\uff1a\u9694\u677f\u6cd5\uff0c\u6346\u7ed1\u6cd5... \u6269\u5c55: \u4e8c\u9879\u5f0f\u5b9a\u7406: \\((a+b)^n=\\sum_{k=0}^nC_n^ka^{n-k}b^k\\) \u591a\u9879\u5f0f\u5b9a\u7406: \\((x1+x2+...+xk)^n=\\sum_{n1+n2+...+nk=n}\\frac{n!}{n1!n2!...nk!}\\prod_{i=1}^kx_i^{ni}\\) \u683c\u8def\u95ee\u9898: \\((0,0)\\) \u70b9\u8d70\u5230 \\((m,n)\\) \u70b9\u7684\u65b9\u6848\u6570\u4e3a \\(C_{m+n}^n\\)","title":"\u6392\u5217\u7ec4\u5408"},{"location":"mb/comb/#_3","text":"","title":"\u6bcd\u51fd\u6570"},{"location":"mb/comb/#_4","text":"\u4e3b\u8981\u6c42\u7ec4\u5408\u7684\u65b9\u6848\u6570\u3002 \u5f62\u5982 \\({a_0+a_1x^1+a_2x^2+...+a_nx^n}\\)","title":"\u666e\u901a\u578b\u6bcd\u51fd\u6570"},{"location":"mb/comb/#_5","text":"\u4e3b\u8981\u6c42\u591a\u91cd\u6392\u5217\u6570\u3002 \u5f62\u5982 \\({a_0+\\frac{a_1x}{1!}+\\frac{a_2x^2}{2!}+...\\frac{a_nx^n}{n!}}\\)","title":"\u6307\u6570\u578b\u6bcd\u51fd\u6570"},{"location":"mb/comb/#_6","text":"","title":"\u7279\u6b8a\u7684\u6570"},{"location":"mb/comb/#_7","text":"\u9012\u63a8\u5f0f: \\(f(n)=f(n-1)+f(n-2)\\) \u4e8c\u9636\u5e38\u7cfb\u6570\u9012\u5f52\u516c\u5f0f: \\(f(n)=\\frac{1}{\\sqrt 5}[(\\frac{1+\\sqrt 5}{2})^n-(\\frac{1-\\sqrt 5}{2})^n]\\) \u524d\u51e0\u9879\u4e3a1\u30011\u30012\u30013\u30015\u30018...","title":"\u6590\u6ce2\u90a3\u5951\u6570"},{"location":"mb/comb/#_8","text":"\u5e38\u89c1\u516c\u5f0f\uff1a \\(H_n=\\frac{C_{2n}^n}{n+1}\\) \\(H_n=\\frac{H_{n-1}(4n-2)}{n+1}\\) \\(H_n=1 \\;\\;(n=0||n=1)\\) \\(H_n=\\sum_{i=1}^nH_{n-i}H_{i-1} (n\\geq 2)\\) \\(H_n=C_{2n}^n-C_{2n}^{n-1}\\) \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300114\u300142\u3001132...","title":"\u5361\u7279\u5170\u6570"},{"location":"mb/comb/#_9","text":"","title":"\u65af\u7279\u6797\u6570"},{"location":"mb/comb/#stirling","text":"\u9012\u63a8\u5f0f: \\({S_u(n,k)=S_u(n-1,k-1)+(n-1)*S_u(n-1,k)}\\;\\;\\;S_u(0,0)=1\\)","title":"\u7b2c\u4e00\u7c7bStirling\u6570"},{"location":"mb/comb/#stirling_1","text":"\u9012\u63a8\u5f0f: \\({S(n,k)=S(n-1,k-1)+k*S(n-1.k)}\\;\\;\\;S(0,0)=1\\) \u7ebf\u6027\u516c\u5f0f: \\({S(n,k)=\\frac{1}{k!}\\sum_{i=0}^k(-1)^iC_k^i(k-i)^n}\\)","title":"\u7b2c\u4e8c\u7c7bStirling\u6570"},{"location":"mb/comb/#_10","text":"\u9012\u63a8\u5f0f: \\({B_{n+1}=\\sum_{k=0}^nC_n^kB_k}\\) \u6839\u636e\u7b2c\u4e8c\u7c7b\u65af\u7279\u6797\u6570: \\({B_n=\\sum_{k=0}^nS(n,k)}\\) \u62d3\u5c55\uff1a\u8d1d\u5c14\u4e09\u89d2\u5f62\u6c42\u89e3\u3002 \u524d\u51e0\u9879\u4e3a\uff1a1\u30011\u30012\u30015\u300115\u300152\u3001203...","title":"\u8d1d\u5c14\u6570"},{"location":"mb/comb/#_11","text":"\u7b49\u5e42\u6c42\u548c: \\(S_mn=\\frac{1}{m+1}\\sum_{k=0}^mC_{m+1}^kn^{m-k+1}\\) \\(\\sum_{i=1}^ni^k=\\frac{1}{k+1}\\sum_{i=1}^{k+1}C_{k+1}^iB_{k-i+1}(n+1)^i\\) \u9012\u63a8\u5f0f: \\({\\sum_{k=0}^nB_kC_{n+1}^k=0}\\;\\;\\;(B_0=1)\\) \\(B_n=-\\frac{1}{n+1}[C_{n+1}^0B0+C_{n+1}^1B1+...+C_{n+1}^{n-1}B_{n-1}]\\) \u524d\u51e0\u9879\u4e3a\uff1a \\(1\u3001-\\frac{1}{2}\u3001\\frac{1}{6}\u30010\u3001\\frac{1}{30}...\\)","title":"\u4f2f\u52aa\u5229\u6570"},{"location":"mb/maa/","text":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u77e9\u9635\u5206\u6790\u8bfe\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u7279\u6b8a\u77e9\u9635 \u77e9\u9635\u5fae\u5206 Reference \u00b6 \u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 \u5f20\u8d24\u8fbe\u8457","title":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528"},{"location":"mb/maa/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u77e9\u9635\u5206\u6790\u8bfe\u7684\u7b14\u8bb0","title":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528"},{"location":"mb/maa/#table-of-contents","text":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u7279\u6b8a\u77e9\u9635 \u77e9\u9635\u5fae\u5206","title":"Table of Contents"},{"location":"mb/maa/#reference","text":"\u77e9\u9635\u5206\u6790\u4e0e\u5e94\u7528 \u5f20\u8d24\u8fbe\u8457","title":"Reference"},{"location":"mb/maa/lec1/","text":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u00b6 Abstract \u77e9\u9635\u662f\u63cf\u8ff0\u548c\u6c42\u89e3\u7ebf\u6027\u65b9\u7a0b\u7ec4\u6700\u57fa\u672c\u548c\u6700\u6709\u7528\u7684\u6570\u5b66\u5de5\u5177 \u6570\u5b66\u8fd0\u7b97: \u8f6c\u7f6e\u3001\u5185\u79ef\u3001\u5916\u79ef\u3001\u9006\u77e9\u9635\u3001\u5e7f\u4e49\u9006\u77e9\u9635\u7b49 \u6807\u91cf\u51fd\u6570\uff1a\u8303\u6570\u3001\u4e8c\u6b21\u578b\u3001\u884c\u5217\u5f0f\u3001\u7279\u5f81\u503c\u3001\u79e9\u548c\u8ff9 \u7279\u6b8a\u8fd0\u7b97: \u76f4\u548c\u3001\u76f4\u79ef\u3001Hadamard \u79ef\u3001Kronecker \u79ef\u3001\u5411\u91cf\u5316 \u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97 \u00b6 \u77e9\u9635\u4e0e\u5411\u91cf \u00b6 \\(m \\times n\\) \u7684\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u4f7f\u7528 \\(m\\) \u4e2a\u65b9\u7a0b\u63cf\u8ff0 \\(n\\) \u4e2a\u672a\u77e5\u91cf\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb\u3002\u7528\u77e9\u9635-\u5411\u91cf\u5f62\u5f0f\u8868\u793a\u4e3a \\(Ax = b\\) \uff0c\u79f0\u4e3a \\(m \\times n\\) \u77e9\u9635\u3002\u7279\u6b8a\u7684\u6709\u884c\u5411\u91cf\u548c\u5217\u5411\u91cf\uff08\u5305\u62ec\u5b9e\u6570\u548c\u590d\u6570\uff09\u3002 \\(n \\times n\\) \u77e9\u9635\u7684\u4e3b\u5bf9\u89d2\u7ebf\u662f\u6307\u4ece\u5de6\u4e0a\u89d2\u5230\u53f3\u4e0b\u89d2\u76f8\u8fde\u63a5\u7684\u7ebf\u6bb5\uff0c\u6b21\u5bf9\u89d2\u7ebf\uff08\u4ea4\u53c9\u5bf9\u89d2\u7ebf\uff09\u662f\u4ece\u53f3\u4e0a\u89d2\u5230\u5de6\u4e0b\u89d2\u3002 \u4e3b\u5bf9\u89d2\u7ebf\u4ee5\u5916\u5143\u7d20\u5168\u90e8\u4e3a0\u7684 \\(n \\times n\\) \u7684\u77e9\u9635\u79f0\u4e3a\u5bf9\u89d2\u77e9\u9635\u3002 \u5bf9\u89d2\u77e9\u9635\u4e3b\u5bf9\u89d2\u7ebf\u5143\u7d20\u5168\u90e8\u4f4d 1\uff0c\u79f0\u4e3a\u5355\u4f4d\u77e9\u9635 \\(I_{n \\times n}\\) \u3002 \u6240\u6709\u5143\u7d20\u4e3a 0 \u7684 \\(m \\times n\\) \u77e9\u9635\u79f0\u4e3a\u96f6\u77e9\u9635 \\(O_{m \\times n}\\) \u3002 \u4e00\u4e2a\u5168\u90e8\u5143\u7d20\u4e3a\u96f6\u7684\u5411\u91cf\u79f0\u4e3a\u96f6\u5411\u91cf\u3002 \u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97 \u00b6 \\(A=[a_{ij}]\\) \u7684\u8f6c\u7f6e\u8bb0\u4f5c \\(A^{\\top}\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^{\\top}]_{i,j}=a_{ji}\\) \\(A=[a_{ij}]\\) \u7684\u590d\u6570\u5171\u8f6d\u8bb0\u4f5c \\(A^*\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^*]_{ij}=a_{ij}^*\\) \\(A=[a_{ij}]\\) \u7684(\u590d)\u5171\u8f6d\u8f6c\u7f6e\u8bb0\u4f5c \\(A^H\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^H]_{ij}=a_{ji}^*\\) \uff0c\uff08\u5171\u8f6d\u8f6c\u7f6e\u53c8\u53eb Hlermitian \u4f34\u968f/\u8f6c\u7f6e/\u5171\u8f6d\uff09 \u6ee1\u8db3 \\(A^{\\top}=A\\) \u7684\u6b63\u65b9\u5b9e\u77e9\u9635\u548c \\(A^H=A\\) \u7684\u6b63\u65b9\u590d\u77e9\u9635\u5206\u522b\u79f0\u4e3a\u5bf9\u79f0\u77e9\u9635\u548c Hermitian \u77e9\u9635(\u590d\u5171\u8f6d\u5bf9\u79f0\u77e9\u9635)\uff0c\u5171\u8f6d\u8f6c\u7f6e\u548c\u8f6c\u7f6e\u7684\u5173\u7cfb: \\(A^H=(A^*)^{\\top}=(A^{\\top})^*\\) \u77e9\u9635\u6ee1\u8db3\u4e0e\u6807\u91cf/\u77e9\u9635/\u5411\u91cf\u4e4b\u95f4\u7684\u52a0\u6cd5\u3001\u4e58\u6cd5\uff08 \u77e9\u9635\u4e58\u6cd5\u4e0d\u6ee1\u8db3\u4ea4\u6362\u5f8b \uff09 \u77e9\u9635\u4e0e\u5411\u91cf\u7684\u4e58\u6cd5 \\(Ax=y\\) \u53ef\u89c6\u4e3a\u5411\u91cf \\(x\\) \u7684\u7ebf\u6027\u53d8\u6362\uff0c \\(A\\) \u79f0\u4e3a\u7ebf\u6027\u53d8\u6362\u77e9\u9635 \u5982\u679c \\(A\\) \u53ef\u9006\uff0c\u5219\u5b58\u5728 \\(A^{-1}\\) \u4f7f\u5f97 \\(A^{-1}A=I\\) \uff0c\u79f0 \\(A^{-1}\\) \u662f \\(A\\) \u7684\u9006\u77e9\u9635 \u77e9\u9635\u7684\u5171\u8f6d\u3001\u8f6c\u7f5d\u548c\u5171\u8f6d\u8f6c\u7f6e\u6ee1\u8db3\u5206\u914d\u5f8b\uff1a \\((A+B)^x=A^x+B^x\uff0cx \\in (*,T,H)\\) \u77e9\u9635\u4e58\u79ef\u7684\u8f6c\u7f6e\u3001\u5171\u8f6d\u8f6c\u7f6e\u548c\u9006\u77e9\u9635\u6ee1\u8db3\u5173\u7cfb\u5f0f\uff1a \\((AB)^x=B^xA^x\uff0cx \\in (T,H,-1)\\) \u5171\u8f6d\u3001\u8f6c\u7f6e\u548c\u5171\u8f6d\u8f6c\u7f6e\u7b49\u7b26\u53f7\u5747\u53ef\u4e0e\u6c42\u9006\u7b26\u53f7\u4ea4\u6362\uff1a \\((A^x)^{-1}=(A^{-1})^x\uff0cx \\in (*,T,H)\\) \u82e5 \\(A\\) \u53ef\u9006\uff0c\u5bf9\u4e8e Hermitian \u77e9\u9635 \\(B=A^HA\\) \uff0c\u6709 \\(A^{-H}BA^{-1}=A^{-H}A^HAA^{-1}=I\\) \u82e5$A_{n \\time n}\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5219 \\(A^n = A\\) \\(I-A\\) \u4e3a\u5e42\u7b49\u77e9\u9635\uff08 \\(A-I\\) \u4e0d\u4e00\u5b9a\u662f\u5e42\u7b49\u77e9\u9635\uff09 \\(A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(I-A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(B\\) \u4e5f\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5e76\u4e14 \\(AB=BA\\) \uff0c\u5219 \\(AB\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(A(I-A)=O\\) \uff08\u96f6\u77e9\u9635\uff09 \\((I-A)A=O\\) \uff08\u96f6\u77e9\u9635\uff09 \u51fd\u6570 \\(f(sI+tA)=(I-A)f(s)+Af(s+t)\\) \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5bf9\u5408\u77e9\u9635\u6216\u5e42\u5355\u77e9\u9635\uff0c\u5219 \\(f(sI=tA)=\\frac{1}{2}[(I+A)f(s+t)+(I-A)f(s-t)]\\) \u77e9\u9635 \\(A\\) \u662f\u5bf9\u5408\u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(\\frac{1}{2}(A+I)\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5e42\u96f6\u77e9\u9635\uff0c\u5219 \\(f(sI+tA)=If(s)+tAf^\\prime(s)\\) \u9664\u4e86\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97\uff0c\u8fd8\u6709\u77e9\u9635/\u4e09\u89d2/\u6307\u6570/\u5bf9\u6570\u51fd\u6570\u3001\u5bfc\u6570\u3001\u79ef\u5206\u7b49\u7b49 \u5411\u91cf\u7684\u7ebf\u6027\u65e0\u5173\u6027\u4e0e\u975e\u5947\u5f02\u77e9\u9635 \u00b6 \u4e00\u7ec4 \\(m\\) \u7ef4\u5411\u91cf \\(\\{u_1, ..., u_n\\}\\) \u79f0\u4e3a\u7ebf\u6027\u65e0\u5173\uff0c\u5219\u65b9\u7a0b \\(c_1u_1+...+c_nu_n=0\\) \u53ea\u6709\u96f6\u89e3 \\(c_1=...=c_n=0\\) \uff0c\u53cd\u4e4b\u7ebf\u6027\u76f8\u5173\u3002\u77e9\u9635 \\(A\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(Ax=0\\) \u53ea\u6709\u96f6\u89e3\uff0c\u53cd\u4e4b\u77e9\u9635\u662f\u5947\u5f02\u7684 \\(A_{n \\times n}=[a_1,...,a_n]\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u7684 \\(n\\) \u4e2a\u5217\u5411\u91cf \\(a_1,...,a_n\\) \u7ebf\u6027\u65e0\u5173\u3002 \u5411\u91cf\u7a7a\u95f4\u3001\u7ebf\u6027\u6620\u5c04\u4e0e Hilbert \u7a7a\u95f4 \u00b6 \u5411\u91cf\u7a7a\u95f4 \u00b6 \u4ee5\u5411\u91cf\u4e3a\u5143\u7d20\u7684\u96c6\u5408 \\(V\\) \u79f0\u4e3a\u5411\u91cf\u7a7a\u95f4\u3002\u5982\u679c \\(V\\) \u662f\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u5219\uff1a \u96f6\u5411\u91cf \\(0\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u52a0\u6cd5\u7684\u9006\u8fd0\u7b97 \\(-y\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u6052\u6709 \\(0y=0\\) \u5bf9\u6bcf\u4e00\u4e2a\u6807\u91cf a\uff0c\u6052\u6709 \\(a0=0\\) \u82e5 \\(ay=0\\) \uff0c\u5219 \\(a=0\\) \u6216\u8005 \\(y=0\\) \\((-1)y=-y\\) \u4ee4 \\(V\\) \u548c \\(W\\) \u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5 \\(W\\) \u662f \\(V\\) \u4e2d\u4e00\u4e2a\u975e\u7a7a\u7684\u5b50\u96c6\u5408\uff0c\u5219\u79f0\u5b50\u96c6\u5408 \\(W\\) \u662f \\(V\\) \u7684\u4e00\u4e2a\u5b50\u7a7a\u95f4 \\(R^n\\) \u7684\u5b50\u96c6\u5408 \\(W\\) \u662f \\(R^n\\) \u7684\u4e00\u4e2a\u5b57\u7a7a\u95f4\uff0c\u5f53\u4e14\u4ec5\u5f53\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a \u5f53\u5411\u91cf \\(x,y\\) \u5c5e\u4e8e \\(W\\) \uff0c\u5219 \\(x+y\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u52a0\u6cd5\u7684\u95ed\u5408\u6027 \u5f53 \\(x \\in W\\) \uff0c\u4e14 a \u4e3a\u6807\u91cf\uff0c\u5219 \\(ax\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u4e0e\u6807\u91cf\u4e58\u79ef\u7684\u95ed\u5408\u6027 \u96f6\u5411\u91cf \\(0\\) \u662f \\(W\\) \u7684\u5143\u7d20 \u82e5 \\(A\\) \u548c \\(B\\) \u662f\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u7684\u4e24\u4e2a\u5b50\u7a7a\u95ee\uff0c\u5e76\u6ee1\u8db3 \\(V=A+B\\) \u548c \\(A \\cap B=\\{0\\}\\) \uff0c\u5219\u79f0 \\(V\\) \u662f\u5b50\u7a7a\u95f4 \\(A\\) \u548c \\(B\\) \u7684\u76f4\u63a5\u6c42\u548c\uff0c\u7b80\u79f0\u76f4\u548c(direetsum)\uff0c\u8bb0\u4f5c \\(V=A \\oplus B\\) \u3002 \u7ebf\u6027\u6620\u5c04 \u00b6 \\(T:\\ V \\to W\\) \u79f0\u4e3a\u5b50\u7a7a\u95f4 \\(V\\) \u5230\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u6620\u5c04\u3002\u5b83\u8868\u793a\u5c06\u5b50\u7a7a\u95f4 \\(V\\) \u7684\u6bcf\u4e00\u4e2a\u5411\u91cf\u53d8\u6210\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u4e00\u4e2a\u76f8\u5bf9\u5e94\u5411\u91cf\u7684\u4e00\u79cd\u89c4\u5219\u3002\u4e8e\u662f\uff0c\u82e5 \\(v \\in V\\) \u548c \\(w \\in W\\) \uff0c\u5219\u5411\u91cf \\(w\\) \u662f \\(v\\) \u7684\u6620\u5c04\u6216\u53d8\u6362\uff0c\u5373\u6709 \\(w = T(v)\\) \uff0c\u5e76\u79f0\u5b50\u7a7a\u95f4 \\(V\\) \u662f\u6620\u5c04 \\(T\\) \u7684\u59cb\u96c6\u6216\u4e01\u4e00\u5b87\uff0c\u79f0 \\(W\\) \u662f\u6620\u5c04\u7684\u7ec8\u96c6\u6216\u4e0a\u57df\u3002 \u4ee4 \\(V\\) \u548c\u4ee5\u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c \\(T:V \\to W\\) \u4e3a\u4e00\u7ebf\u6027\u53d8\u6362: \u82e5 \\(M\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5219 \\(T(M)\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff1b \u82e5 \\(N\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5247\u7ebf\u6027\u53cd\u53d8\u6362 \\(T^{-1}(N)\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002 \u5185\u79ef\u7a7a\u95f4\u3001\u8d4b\u8303\u7a7a\u95ee\u4e0eHilbert \u7a7a\u95f4 \u00b6 \uff08\u5185\u79ef\u4e0e\u5185\u79ef\u5411\u91cf\u7a7a\u95f4\uff09\u82e5\u5bf9\u6240\u6709 \\(x,y,z \\in V\\) \u548c \\(\\alpha,\\beta \\in K\\) \uff0c\u6620\u5c04\u51fd\u6570 \\(<\\cdot,\\cdot>:V \\times V \\to K\\) \u6ee1\u8db3\u4e00\u4e0b\u4e09\u6761\u516c\u7406\uff1a \u5171\u8f6d\u5bf9\u79f0\u6027 \\(=^*\\) \u7b2c\u4e00\u53d8\u5143\u7684\u7ebf\u6027\u6027 \\(<\\alpha x+\\beta y,z>=\\alpha + \\beta \\) \u975e\u8d1f\u6027 \\( \\ge 0\\) \uff0c\u5e76\u4e14 \\( = 0 \\leftrightarrow x=0\\) \uff08\u4e25\u683c\u6b63\u6027\uff09 \u4e24\u4e2a\u5411\u91cf\u7684\u5185\u79ef\u53ef\u4ee5\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95ee\u7684\u5939\u89d2\uff1a \\(\\cos \\theta = \\frac{}{\\sqrt{}\\sqrt{}}\\) \uff08\u8303\u6570\u548c\u8d4b\u8303\u5411\u91cf\u7a7a\u95f4\uff09\u4ee4 \\(V\\) \u662f\u4e00(\u5b9e\u6216\u590d)\u5411\u91cf\u7a7a\u95f4\u3002\u5411\u91cf \\(x\\) \u7684\u8303\u6570\u662f\u4e00\u5b9e\u51fd\u6570 \\(p(x):V \\to R\\) \uff0c\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4efb\u610f\u4e00\u4e2a\u6807\u91cf \\(c \\in K\\) (\u5176\u4e2d \\(K\\) \u8868\u793a \\(R\\) \u6216 \\(C\\) )\uff0c\u5219\uff1a \u975e\u8d1f\u6027\uff1a \\(p(x) \\ge 0\\) \uff0c\u5e76\u4e14 \\(p(x)=0 \\Leftrightarrow x = 0\\) \u9f50\u6b21\u6027\uff1a \\(p(cx)=|c|\\cdot p(x)\\) \u5bf9\u6240\u6709\u590d\u5e38\u6570 \\(c\\) \u6210\u7acb \u4e09\u89d2\u4e0d\u7b49\u5f0f\uff1a \\(p(x+y) \\le p(x)+p(y)\\) \u6700\u5e38\u7528\u7684\u5411\u91cf\u8303\u6570\u4e3a Euclidean \u8303\u6570\u6216\u8005 \\(L_2\\) \u8303\u6570\uff0c\u8bb0\u4f5c \\(\\parallel \\cdot \\parallel_2\\) \uff0c\u5b9a\u4e49\u4e3a \\[ \\parallel x \\parallel _E = \\parallel x \\parallel _2 = \\sqrt{x_1^2+...+x_m^2} \\] \\(L_2\\) \u8303\u6570\u53ef\u4ee5\u76f4\u63a5\u5ea6\u91cf\u4e00\u4e2a\u5411\u91cf \\(x\\) \u7684\u957f\u5ea6 \\(size(x)=\\parallel x \\parallel_2\\) \uff0c\u4e24\u4e2a\u5411\u91cf\u4e4b\u95f4\u7684\u8ddd\u79bb \\(d(x,y)=\\parallel x-y \\parallel_2\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u534a\u8303\u6570/\u4f2a\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le p(x)+p(y)\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u62df\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \uff0c\u4e14 \\(p(x) = 0 \\Leftrightarrow x = 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le C(p(x)+p(y))\\) \uff0c\u5176\u4e2d \\(C \\ne 1\\) \u4e3a\u67d0\u4e2a\u6b63\u5b9e\u6570 \uff08\u5b8c\u5907\u6027\uff09\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u79f0\u4e3a\u5b8c\u5907\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5\u5bf9\u4e8e \\(V\\) \u4e2d\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217 \\(\\{ v_n \\}_{n=1}^{\\infty} \\subset V\\) \uff0c\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u5b58\u5728\u4e00\u4e2a\u5143\u7d20 \\(v\\) \uff0c\u4f7f\u5f97 \\(\\lim_{n \\to \\infty} v_n \\to v\\) \uff0c\u5373 \\(V\\) \u5185\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217\u90fd\u6536\u655b\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u3002 \uff08\u4f34\u968f\u7b97\u5b50\uff09\u4ee4 \\(T\\) \u662f Hilbert \u7a7a\u95f4 \\(H\\) \u5185\u7684\u6709\u754c\u7ebf\u6027\u7b97\u5b50\u3002\u82e5 \\(=\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in H\\) \u6210\u7acb\uff0c\u5219\u79f0 \\(T^*\\) \u662f \\(T\\) \u7684\u4f34\u968f\u7b97\u5b50(adjoint operator)\u3002 \u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \\(n\\) \u9636\u590d\u5411\u91cf \\(x=[x_1,...,x_n]^{\\top},y=[y_1,...,y_n]^{\\top}\\) \u4e4b\u95f4\u7684\u5185\u79ef \\(=x^Hy=\\sum_{i=1}^n x_i^*y_i\\) \u79f0\u4e3a\u5178\u8303\u5185\u79ef\u3002\u52a0\u6743\u5185\u79ef \\(=x^HGy\\) \uff0c\u5176\u4e2d \\(G\\) \u4e3a\u6b63\u5b9a\u7684 Hermitian \u77e9\u9635\u3002 \u5728\u5b9e\u548c\u590d\u5185\u79ef\u7a7a\u95f4\u91cc\uff0c\u8303\u6570\u5177\u6709\u4ee5\u4e0b\u6027\u8d28\uff1a \\(\\parallel 0 \\parallel = 0\\) \uff0c\u5e76\u4e14 \\(\\parallel x \\parallel > 0\uff0c\\forall x \\ne 0\\) \\(\\parallel cx \\parallel = |c| \\cdot \\parallel x \\parallel\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x\\) \u548c\u6807\u91cf c \u6210\u7acb \u8303\u6570\u670d\u4ece\u6781\u5316\u6052\u7b49\u5f0f\uff1a \\[ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2), \\forall x,y\uff08\u5b9e\u5185\u79ef\u7a7a\u95f4\uff09\\\\ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2 - j \\parallel x+jy \\parallel^2+j \\parallel x-jy \\parallel^2), \\forall x,y\uff08\u590d\u5185\u79ef\u7a7a\u95f4\uff09 \\] \u8303\u6570\u670d\u4ece\u5e73\u884c\u56db\u8fb9\u5f62\u6cd5\u5219: \\[ \\parallel x+y \\parallel^2 + \\parallel x - y \\parallel^2 = 2(\\parallel x \\parallel^2+\\parallel y \\parallel^2), \\forall x,y \\] \u8303\u6570\u6ee1\u8db3\u4e09\u89d2\u4e0d\u7b49\u5f0f \\(\\parallel x+y \\parallel \\le \\parallel x \\parallel + \\parallel y \\parallel, \\forall x,y\\) \u8303\u6570\u670d\u4ece Cauchy-Schwartz \u4e0d\u7b49\u5f0f \\(|| \\le \\parallel x \\parallel \\cdot \\parallel y \\parallel\\) \u5e38\u6570\u5411\u91cf\u7684\u5178\u8303\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \\(L_0\\) \u8303\u6570 \\(\\parallel x \\parallel_0 \\overset{def}{=}\\) \u975e\u96f6\u5143\u7d20\u7684\u4e2a\u6570 \\(L_1\\) \u8303\u6570 \\(\\parallel x \\parallel_1 \\overset{def}{=} \\sum_{i=1}^m |x_i|\\) \\(L_2\\) \u8303\u6570 \\(\\parallel x \\parallel_2 = (|x_1|^2+...+|x_m|^2)^{\\frac{1}{2}}\\) \\(L_\\infty\\) \u8303\u6570 \\(\\parallel x \\parallel_\\infty = \\max\\{|x_1|, ..., |x_m|\\}\\) \\(L_p\\) \u8303\u6570 \\(\\parallel x \\parallel_p = (\\sum_{i=1}^m |x_i|^p)^{\\frac{1}{p}}\\) \u51fd\u6570\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u82e5 \\(x(t)\\) \u548c \\(y(t)\\) \u5206\u522b\u662f\u53d8\u91cf \\(t\\) \u7684\u51fd\u6570\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} \\int_{a}^{b} x^H(t)y(t)dt \\] \u968f\u673a\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u82e5 \\(x(\\xi)\\) \u548c \\(y(\\xi)\\) \u5206\u522b\u662f\u6837\u672c\u53d8\u91cf \\(\\xi\\) \u968f\u673a\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} E\\{x^H(\\xi)y(\\xi)\\} \\] \u77e9\u9635\u7684\u5185\u79ef\u4e0e\u8303\u6570 \u00b6 \u5c06\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570\u52a0\u4ee5\u63a8\u5e7f\u3002 \u77e9\u9635\u7684\u8303\u6570\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b:\u8bf1\u5bfc\u8303\u6570\u3001\u5143\u7d20\u5f62\u5f0f\u8303\u6570\u548c Schatten \u8303\u6570\u3002 \u968f\u673a\u5411\u91cf \u00b6 \u6982\u7387\u8bba\u77e5\u8bc6\u3002 \u77e9\u9635\u7684\u6027\u80fd\u6307\u6807 \u00b6 \u4e8c\u6b21\u578b \u7279\u5f81\u503c \u8ff9 \u79e9 \u9006\u77e9\u9635\u4e0e\u4f2a\u9006\u77e9\u9635 \u00b6 \u4e3b\u8981\u8ba8\u8bba\u975e\u5947\u5f02\u7684\u6b63\u65b9\u77e9\u9635 \\(A\\) \u7684\u9006\u77e9\u9635 \\(A^{-1}\\) Moore-Penrose \u9006\u77e9\u9635 \u00b6 \u4e3b\u8981\u8ba8\u8bba\u4e00\u4e2a\u79e9\u7a00\u7f3a\u7684\u77e9\u9635\u662f\u5426\u5b58\u5728\u9006\u77e9\u9635\uff0c\u5982\u679c\u5b58\u5728\u9700\u8981\u6ee1\u8db3\u4ec0\u4e48\u6761\u4ef6\u3002 \u77e9\u9635\u7684\u76f4\u548c\u4e0eHadamard \u79ef \u00b6 \u77e9\u9635\u7684\u76f4\u548c \u00b6 \\(m \\times m\\) \u77e9\u9635\u7684 \\(A\\) \u4e0e \\(n \\times n\\) \u77e9\u9635\u7684 \\(B\\) \u7684\u76f4\u548c\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5373 \\[ A \\oplus B = \\begin{bmatrix} A & O_{m \\times n} \\\\ O_{n \\times m} & B \\end{bmatrix} \\] Hadamard \u79ef \u00b6 \\(m \\times n\\) \u77e9\u9635\u7684 \\(A=[a_{ij}]\\) \u4e0e \\(m \\times n\\) \u77e9\u9635\u7684 \\(B=[b_{ij}]\\) \u7684 Hadamard \u79ef\u8bb0\u4f5c \\(A * B\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\((A*B)_{ij}=a_{ij}b_{ij}\\) \u3002\u5373 Hadamard \u79ef\u98df\u4e00\u79cd\u6620\u5c04 \\(R^{m \\times n} \\times R^{m \\times n} \\to R^{m \\times n}\\) Kronecker \u79ef\u4e0eKhatri-Rao \u79ef \u00b6 Kronecker \u79ef \u00b6 Kronecker \u79ef\u5206\u4e3a\u53f3\u548c\u5de6\u4e24\u79cd Kronecker \u79ef\u3002 \u4f8b\u5982\u53f3 Kronecker \u79ef\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5b9a\u4e49\u4e3a\uff1a \\[ A \\oplus B = [a_1B, ..., a_nB]=[a_{ij}B]_{i=1,j=1}^{m,n}= \\begin{bmatrix} a_{11}B &a_{12}B &... &a_{1n}B \\\\ a_{21}B &a_{22}B &... &a_{2n}B \\\\ ... & ... & ... &... \\\\ a_{m1}B &a_{m2}B & ... &a_{mn}B \\end{bmatrix} \\] Kronecker \u79ef\u4e5f\u79f0\u76f4\u79ef(direct product)\u6216\u8005\u5f20\u91cf\u79ef(tensor product)1 Khatri-Rao \u79ef \u00b6 \u4e24\u4e2a\u5177\u6709\u76f8\u540c\u5217\u6570\u7684\u77e9\u9635 \\(G \\in R^{p \\times n}\\) \u548c \\(F \\in R^{q\\times n}\\) \u7684 Khatri-Rao \u79ef\u8bb0\u4f5c \\(F \\odot G\\) \uff0c\u5b9a\u4e49\u4e3a \\[ F \\odot G = [f_1 \\oplus g_1, f_2 \\oplus g_2, ..., f_n \\oplus g_n] \\in R^{pq \\times n} \\] \u5b83\u7531\u4e24\u4e2a\u77e9\u9635\u7684\u5bf9\u5e94\u5217\u5411\u91cf\u7684Kronecker \u79ef\u6392\u5217\u800c\u6210\u3002\u56e0\u6b64\uff0cKhatri-Rao \u79ef\u53c8\u53eb\u5bf9\u5e94\u5217 Kronecker \u79ef\u3002 \u5411\u91cf\u5316\u4e0e\u77e9\u9635\u5316 \u00b6 \u77e9\u9635\u7684\u5411\u91cf\u5316 \\(vec(A)\\) \u662f\u4e00\u7ebf\u6027\u53d8\u6362\uff0c\u5c06 \\(A\\) \u6309\u5217\u5806\u6808\uff08\u5f53\u7136\u4e5f\u53ef\u4ee5\u6309\u884c\u5806\u6808\uff09\u6392\u5217\u6210\u4e00\u4e2a \\(mn \\times 1\\) \u5411\u91cf\u3002\u5373 \\[vec(A)=[a_{11},...,a_{m1},...,a_{1n},...,a_{mn}]^{\\top}\\]","title":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840"},{"location":"mb/maa/lec1/#_1","text":"Abstract \u77e9\u9635\u662f\u63cf\u8ff0\u548c\u6c42\u89e3\u7ebf\u6027\u65b9\u7a0b\u7ec4\u6700\u57fa\u672c\u548c\u6700\u6709\u7528\u7684\u6570\u5b66\u5de5\u5177 \u6570\u5b66\u8fd0\u7b97: \u8f6c\u7f6e\u3001\u5185\u79ef\u3001\u5916\u79ef\u3001\u9006\u77e9\u9635\u3001\u5e7f\u4e49\u9006\u77e9\u9635\u7b49 \u6807\u91cf\u51fd\u6570\uff1a\u8303\u6570\u3001\u4e8c\u6b21\u578b\u3001\u884c\u5217\u5f0f\u3001\u7279\u5f81\u503c\u3001\u79e9\u548c\u8ff9 \u7279\u6b8a\u8fd0\u7b97: \u76f4\u548c\u3001\u76f4\u79ef\u3001Hadamard \u79ef\u3001Kronecker \u79ef\u3001\u5411\u91cf\u5316","title":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840"},{"location":"mb/maa/lec1/#_2","text":"","title":"\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97"},{"location":"mb/maa/lec1/#_3","text":"\\(m \\times n\\) \u7684\u7ebf\u6027\u65b9\u7a0b\u7ec4\uff0c\u4f7f\u7528 \\(m\\) \u4e2a\u65b9\u7a0b\u63cf\u8ff0 \\(n\\) \u4e2a\u672a\u77e5\u91cf\u4e4b\u95f4\u7684\u7ebf\u6027\u5173\u7cfb\u3002\u7528\u77e9\u9635-\u5411\u91cf\u5f62\u5f0f\u8868\u793a\u4e3a \\(Ax = b\\) \uff0c\u79f0\u4e3a \\(m \\times n\\) \u77e9\u9635\u3002\u7279\u6b8a\u7684\u6709\u884c\u5411\u91cf\u548c\u5217\u5411\u91cf\uff08\u5305\u62ec\u5b9e\u6570\u548c\u590d\u6570\uff09\u3002 \\(n \\times n\\) \u77e9\u9635\u7684\u4e3b\u5bf9\u89d2\u7ebf\u662f\u6307\u4ece\u5de6\u4e0a\u89d2\u5230\u53f3\u4e0b\u89d2\u76f8\u8fde\u63a5\u7684\u7ebf\u6bb5\uff0c\u6b21\u5bf9\u89d2\u7ebf\uff08\u4ea4\u53c9\u5bf9\u89d2\u7ebf\uff09\u662f\u4ece\u53f3\u4e0a\u89d2\u5230\u5de6\u4e0b\u89d2\u3002 \u4e3b\u5bf9\u89d2\u7ebf\u4ee5\u5916\u5143\u7d20\u5168\u90e8\u4e3a0\u7684 \\(n \\times n\\) \u7684\u77e9\u9635\u79f0\u4e3a\u5bf9\u89d2\u77e9\u9635\u3002 \u5bf9\u89d2\u77e9\u9635\u4e3b\u5bf9\u89d2\u7ebf\u5143\u7d20\u5168\u90e8\u4f4d 1\uff0c\u79f0\u4e3a\u5355\u4f4d\u77e9\u9635 \\(I_{n \\times n}\\) \u3002 \u6240\u6709\u5143\u7d20\u4e3a 0 \u7684 \\(m \\times n\\) \u77e9\u9635\u79f0\u4e3a\u96f6\u77e9\u9635 \\(O_{m \\times n}\\) \u3002 \u4e00\u4e2a\u5168\u90e8\u5143\u7d20\u4e3a\u96f6\u7684\u5411\u91cf\u79f0\u4e3a\u96f6\u5411\u91cf\u3002","title":"\u77e9\u9635\u4e0e\u5411\u91cf"},{"location":"mb/maa/lec1/#_4","text":"\\(A=[a_{ij}]\\) \u7684\u8f6c\u7f6e\u8bb0\u4f5c \\(A^{\\top}\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^{\\top}]_{i,j}=a_{ji}\\) \\(A=[a_{ij}]\\) \u7684\u590d\u6570\u5171\u8f6d\u8bb0\u4f5c \\(A^*\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^*]_{ij}=a_{ij}^*\\) \\(A=[a_{ij}]\\) \u7684(\u590d)\u5171\u8f6d\u8f6c\u7f6e\u8bb0\u4f5c \\(A^H\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\([A^H]_{ij}=a_{ji}^*\\) \uff0c\uff08\u5171\u8f6d\u8f6c\u7f6e\u53c8\u53eb Hlermitian \u4f34\u968f/\u8f6c\u7f6e/\u5171\u8f6d\uff09 \u6ee1\u8db3 \\(A^{\\top}=A\\) \u7684\u6b63\u65b9\u5b9e\u77e9\u9635\u548c \\(A^H=A\\) \u7684\u6b63\u65b9\u590d\u77e9\u9635\u5206\u522b\u79f0\u4e3a\u5bf9\u79f0\u77e9\u9635\u548c Hermitian \u77e9\u9635(\u590d\u5171\u8f6d\u5bf9\u79f0\u77e9\u9635)\uff0c\u5171\u8f6d\u8f6c\u7f6e\u548c\u8f6c\u7f6e\u7684\u5173\u7cfb: \\(A^H=(A^*)^{\\top}=(A^{\\top})^*\\) \u77e9\u9635\u6ee1\u8db3\u4e0e\u6807\u91cf/\u77e9\u9635/\u5411\u91cf\u4e4b\u95f4\u7684\u52a0\u6cd5\u3001\u4e58\u6cd5\uff08 \u77e9\u9635\u4e58\u6cd5\u4e0d\u6ee1\u8db3\u4ea4\u6362\u5f8b \uff09 \u77e9\u9635\u4e0e\u5411\u91cf\u7684\u4e58\u6cd5 \\(Ax=y\\) \u53ef\u89c6\u4e3a\u5411\u91cf \\(x\\) \u7684\u7ebf\u6027\u53d8\u6362\uff0c \\(A\\) \u79f0\u4e3a\u7ebf\u6027\u53d8\u6362\u77e9\u9635 \u5982\u679c \\(A\\) \u53ef\u9006\uff0c\u5219\u5b58\u5728 \\(A^{-1}\\) \u4f7f\u5f97 \\(A^{-1}A=I\\) \uff0c\u79f0 \\(A^{-1}\\) \u662f \\(A\\) \u7684\u9006\u77e9\u9635 \u77e9\u9635\u7684\u5171\u8f6d\u3001\u8f6c\u7f5d\u548c\u5171\u8f6d\u8f6c\u7f6e\u6ee1\u8db3\u5206\u914d\u5f8b\uff1a \\((A+B)^x=A^x+B^x\uff0cx \\in (*,T,H)\\) \u77e9\u9635\u4e58\u79ef\u7684\u8f6c\u7f6e\u3001\u5171\u8f6d\u8f6c\u7f6e\u548c\u9006\u77e9\u9635\u6ee1\u8db3\u5173\u7cfb\u5f0f\uff1a \\((AB)^x=B^xA^x\uff0cx \\in (T,H,-1)\\) \u5171\u8f6d\u3001\u8f6c\u7f6e\u548c\u5171\u8f6d\u8f6c\u7f6e\u7b49\u7b26\u53f7\u5747\u53ef\u4e0e\u6c42\u9006\u7b26\u53f7\u4ea4\u6362\uff1a \\((A^x)^{-1}=(A^{-1})^x\uff0cx \\in (*,T,H)\\) \u82e5 \\(A\\) \u53ef\u9006\uff0c\u5bf9\u4e8e Hermitian \u77e9\u9635 \\(B=A^HA\\) \uff0c\u6709 \\(A^{-H}BA^{-1}=A^{-H}A^HAA^{-1}=I\\) \u82e5$A_{n \\time n}\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5219 \\(A^n = A\\) \\(I-A\\) \u4e3a\u5e42\u7b49\u77e9\u9635\uff08 \\(A-I\\) \u4e0d\u4e00\u5b9a\u662f\u5e42\u7b49\u77e9\u9635\uff09 \\(A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(I-A^H\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(B\\) \u4e5f\u4e3a\u5e42\u7b49\u77e9\u9635\uff0c\u5e76\u4e14 \\(AB=BA\\) \uff0c\u5219 \\(AB\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \\(A(I-A)=O\\) \uff08\u96f6\u77e9\u9635\uff09 \\((I-A)A=O\\) \uff08\u96f6\u77e9\u9635\uff09 \u51fd\u6570 \\(f(sI+tA)=(I-A)f(s)+Af(s+t)\\) \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5bf9\u5408\u77e9\u9635\u6216\u5e42\u5355\u77e9\u9635\uff0c\u5219 \\(f(sI=tA)=\\frac{1}{2}[(I+A)f(s+t)+(I-A)f(s-t)]\\) \u77e9\u9635 \\(A\\) \u662f\u5bf9\u5408\u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(\\frac{1}{2}(A+I)\\) \u4e3a\u5e42\u7b49\u77e9\u9635 \u82e5 \\(A_{n \\times n}\\) \u4e3a\u5e42\u96f6\u77e9\u9635\uff0c\u5219 \\(f(sI+tA)=If(s)+tAf^\\prime(s)\\) \u9664\u4e86\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97\uff0c\u8fd8\u6709\u77e9\u9635/\u4e09\u89d2/\u6307\u6570/\u5bf9\u6570\u51fd\u6570\u3001\u5bfc\u6570\u3001\u79ef\u5206\u7b49\u7b49","title":"\u77e9\u9635\u7684\u57fa\u672c\u8fd0\u7b97"},{"location":"mb/maa/lec1/#_5","text":"\u4e00\u7ec4 \\(m\\) \u7ef4\u5411\u91cf \\(\\{u_1, ..., u_n\\}\\) \u79f0\u4e3a\u7ebf\u6027\u65e0\u5173\uff0c\u5219\u65b9\u7a0b \\(c_1u_1+...+c_nu_n=0\\) \u53ea\u6709\u96f6\u89e3 \\(c_1=...=c_n=0\\) \uff0c\u53cd\u4e4b\u7ebf\u6027\u76f8\u5173\u3002\u77e9\u9635 \\(A\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53 \\(Ax=0\\) \u53ea\u6709\u96f6\u89e3\uff0c\u53cd\u4e4b\u77e9\u9635\u662f\u5947\u5f02\u7684 \\(A_{n \\times n}=[a_1,...,a_n]\\) \u662f\u975e\u5947\u5f02\u7684\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u7684 \\(n\\) \u4e2a\u5217\u5411\u91cf \\(a_1,...,a_n\\) \u7ebf\u6027\u65e0\u5173\u3002","title":"\u5411\u91cf\u7684\u7ebf\u6027\u65e0\u5173\u6027\u4e0e\u975e\u5947\u5f02\u77e9\u9635"},{"location":"mb/maa/lec1/#hilbert","text":"","title":"\u5411\u91cf\u7a7a\u95f4\u3001\u7ebf\u6027\u6620\u5c04\u4e0e Hilbert \u7a7a\u95f4"},{"location":"mb/maa/lec1/#_6","text":"\u4ee5\u5411\u91cf\u4e3a\u5143\u7d20\u7684\u96c6\u5408 \\(V\\) \u79f0\u4e3a\u5411\u91cf\u7a7a\u95f4\u3002\u5982\u679c \\(V\\) \u662f\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u5219\uff1a \u96f6\u5411\u91cf \\(0\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u52a0\u6cd5\u7684\u9006\u8fd0\u7b97 \\(-y\\) \u662f\u552f\u4e00\u7684 \u5bf9\u6bcf\u4e00\u4e2a\u5411\u91cf \\(y\\) \uff0c\u6052\u6709 \\(0y=0\\) \u5bf9\u6bcf\u4e00\u4e2a\u6807\u91cf a\uff0c\u6052\u6709 \\(a0=0\\) \u82e5 \\(ay=0\\) \uff0c\u5219 \\(a=0\\) \u6216\u8005 \\(y=0\\) \\((-1)y=-y\\) \u4ee4 \\(V\\) \u548c \\(W\\) \u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5 \\(W\\) \u662f \\(V\\) \u4e2d\u4e00\u4e2a\u975e\u7a7a\u7684\u5b50\u96c6\u5408\uff0c\u5219\u79f0\u5b50\u96c6\u5408 \\(W\\) \u662f \\(V\\) \u7684\u4e00\u4e2a\u5b50\u7a7a\u95f4 \\(R^n\\) \u7684\u5b50\u96c6\u5408 \\(W\\) \u662f \\(R^n\\) \u7684\u4e00\u4e2a\u5b57\u7a7a\u95f4\uff0c\u5f53\u4e14\u4ec5\u5f53\u6ee1\u8db3\u4ee5\u4e0b\u6761\u4ef6\uff1a \u5f53\u5411\u91cf \\(x,y\\) \u5c5e\u4e8e \\(W\\) \uff0c\u5219 \\(x+y\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u52a0\u6cd5\u7684\u95ed\u5408\u6027 \u5f53 \\(x \\in W\\) \uff0c\u4e14 a \u4e3a\u6807\u91cf\uff0c\u5219 \\(ax\\) \u4e5f\u5c5e\u4e8e \\(W\\) \uff0c\u5373\u6ee1\u8db3\u4e0e\u6807\u91cf\u4e58\u79ef\u7684\u95ed\u5408\u6027 \u96f6\u5411\u91cf \\(0\\) \u662f \\(W\\) \u7684\u5143\u7d20 \u82e5 \\(A\\) \u548c \\(B\\) \u662f\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u7684\u4e24\u4e2a\u5b50\u7a7a\u95ee\uff0c\u5e76\u6ee1\u8db3 \\(V=A+B\\) \u548c \\(A \\cap B=\\{0\\}\\) \uff0c\u5219\u79f0 \\(V\\) \u662f\u5b50\u7a7a\u95f4 \\(A\\) \u548c \\(B\\) \u7684\u76f4\u63a5\u6c42\u548c\uff0c\u7b80\u79f0\u76f4\u548c(direetsum)\uff0c\u8bb0\u4f5c \\(V=A \\oplus B\\) \u3002","title":"\u5411\u91cf\u7a7a\u95f4"},{"location":"mb/maa/lec1/#_7","text":"\\(T:\\ V \\to W\\) \u79f0\u4e3a\u5b50\u7a7a\u95f4 \\(V\\) \u5230\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u6620\u5c04\u3002\u5b83\u8868\u793a\u5c06\u5b50\u7a7a\u95f4 \\(V\\) \u7684\u6bcf\u4e00\u4e2a\u5411\u91cf\u53d8\u6210\u5b50\u7a7a\u95f4 \\(W\\) \u7684\u4e00\u4e2a\u76f8\u5bf9\u5e94\u5411\u91cf\u7684\u4e00\u79cd\u89c4\u5219\u3002\u4e8e\u662f\uff0c\u82e5 \\(v \\in V\\) \u548c \\(w \\in W\\) \uff0c\u5219\u5411\u91cf \\(w\\) \u662f \\(v\\) \u7684\u6620\u5c04\u6216\u53d8\u6362\uff0c\u5373\u6709 \\(w = T(v)\\) \uff0c\u5e76\u79f0\u5b50\u7a7a\u95f4 \\(V\\) \u662f\u6620\u5c04 \\(T\\) \u7684\u59cb\u96c6\u6216\u4e01\u4e00\u5b87\uff0c\u79f0 \\(W\\) \u662f\u6620\u5c04\u7684\u7ec8\u96c6\u6216\u4e0a\u57df\u3002 \u4ee4 \\(V\\) \u548c\u4ee5\u662f\u4e24\u4e2a\u5411\u91cf\u7a7a\u95f4\uff0c \\(T:V \\to W\\) \u4e3a\u4e00\u7ebf\u6027\u53d8\u6362: \u82e5 \\(M\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5219 \\(T(M)\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff1b \u82e5 \\(N\\) \u662f \\(W\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\uff0c\u5247\u7ebf\u6027\u53cd\u53d8\u6362 \\(T^{-1}(N)\\) \u662f \\(V\\) \u7684\u7ebf\u6027\u5b50\u7a7a\u95f4\u3002","title":"\u7ebf\u6027\u6620\u5c04"},{"location":"mb/maa/lec1/#hilbert_1","text":"\uff08\u5185\u79ef\u4e0e\u5185\u79ef\u5411\u91cf\u7a7a\u95f4\uff09\u82e5\u5bf9\u6240\u6709 \\(x,y,z \\in V\\) \u548c \\(\\alpha,\\beta \\in K\\) \uff0c\u6620\u5c04\u51fd\u6570 \\(<\\cdot,\\cdot>:V \\times V \\to K\\) \u6ee1\u8db3\u4e00\u4e0b\u4e09\u6761\u516c\u7406\uff1a \u5171\u8f6d\u5bf9\u79f0\u6027 \\(=^*\\) \u7b2c\u4e00\u53d8\u5143\u7684\u7ebf\u6027\u6027 \\(<\\alpha x+\\beta y,z>=\\alpha + \\beta \\) \u975e\u8d1f\u6027 \\( \\ge 0\\) \uff0c\u5e76\u4e14 \\( = 0 \\leftrightarrow x=0\\) \uff08\u4e25\u683c\u6b63\u6027\uff09 \u4e24\u4e2a\u5411\u91cf\u7684\u5185\u79ef\u53ef\u4ee5\u5ea6\u91cf\u5b83\u4eec\u4e4b\u95ee\u7684\u5939\u89d2\uff1a \\(\\cos \\theta = \\frac{}{\\sqrt{}\\sqrt{}}\\) \uff08\u8303\u6570\u548c\u8d4b\u8303\u5411\u91cf\u7a7a\u95f4\uff09\u4ee4 \\(V\\) \u662f\u4e00(\u5b9e\u6216\u590d)\u5411\u91cf\u7a7a\u95f4\u3002\u5411\u91cf \\(x\\) \u7684\u8303\u6570\u662f\u4e00\u5b9e\u51fd\u6570 \\(p(x):V \\to R\\) \uff0c\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4efb\u610f\u4e00\u4e2a\u6807\u91cf \\(c \\in K\\) (\u5176\u4e2d \\(K\\) \u8868\u793a \\(R\\) \u6216 \\(C\\) )\uff0c\u5219\uff1a \u975e\u8d1f\u6027\uff1a \\(p(x) \\ge 0\\) \uff0c\u5e76\u4e14 \\(p(x)=0 \\Leftrightarrow x = 0\\) \u9f50\u6b21\u6027\uff1a \\(p(cx)=|c|\\cdot p(x)\\) \u5bf9\u6240\u6709\u590d\u5e38\u6570 \\(c\\) \u6210\u7acb \u4e09\u89d2\u4e0d\u7b49\u5f0f\uff1a \\(p(x+y) \\le p(x)+p(y)\\) \u6700\u5e38\u7528\u7684\u5411\u91cf\u8303\u6570\u4e3a Euclidean \u8303\u6570\u6216\u8005 \\(L_2\\) \u8303\u6570\uff0c\u8bb0\u4f5c \\(\\parallel \\cdot \\parallel_2\\) \uff0c\u5b9a\u4e49\u4e3a \\[ \\parallel x \\parallel _E = \\parallel x \\parallel _2 = \\sqrt{x_1^2+...+x_m^2} \\] \\(L_2\\) \u8303\u6570\u53ef\u4ee5\u76f4\u63a5\u5ea6\u91cf\u4e00\u4e2a\u5411\u91cf \\(x\\) \u7684\u957f\u5ea6 \\(size(x)=\\parallel x \\parallel_2\\) \uff0c\u4e24\u4e2a\u5411\u91cf\u4e4b\u95f4\u7684\u8ddd\u79bb \\(d(x,y)=\\parallel x-y \\parallel_2\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u534a\u8303\u6570/\u4f2a\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le p(x)+p(y)\\) \uff08\u5411\u91cf \\(x \\in V\\) \u7684\u62df\u8303\u6570\uff09\u82e5\u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in V\\) \u548c\u4e00\u4e2a\u6807\u91cf \\(c\\) \uff0c\u6ee1\u8db3 \\(p(x) \\ge 0\\) \uff0c\u4e14 \\(p(x) = 0 \\Leftrightarrow x = 0\\) \\(p(cx)=|c| \\cdot p(x)\\) \\(p(x+y) \\le C(p(x)+p(y))\\) \uff0c\u5176\u4e2d \\(C \\ne 1\\) \u4e3a\u67d0\u4e2a\u6b63\u5b9e\u6570 \uff08\u5b8c\u5907\u6027\uff09\u4e00\u4e2a\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u79f0\u4e3a\u5b8c\u5907\u5411\u91cf\u7a7a\u95f4\uff0c\u82e5\u5bf9\u4e8e \\(V\\) \u4e2d\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217 \\(\\{ v_n \\}_{n=1}^{\\infty} \\subset V\\) \uff0c\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u5b58\u5728\u4e00\u4e2a\u5143\u7d20 \\(v\\) \uff0c\u4f7f\u5f97 \\(\\lim_{n \\to \\infty} v_n \\to v\\) \uff0c\u5373 \\(V\\) \u5185\u7684\u6bcf\u4e00\u4e2a Cauchy \u5e8f\u5217\u90fd\u6536\u655b\u5728\u5411\u91cf\u7a7a\u95f4 \\(V\\) \u5185\u3002 \uff08\u4f34\u968f\u7b97\u5b50\uff09\u4ee4 \\(T\\) \u662f Hilbert \u7a7a\u95f4 \\(H\\) \u5185\u7684\u6709\u754c\u7ebf\u6027\u7b97\u5b50\u3002\u82e5 \\(=\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x,y \\in H\\) \u6210\u7acb\uff0c\u5219\u79f0 \\(T^*\\) \u662f \\(T\\) \u7684\u4f34\u968f\u7b97\u5b50(adjoint operator)\u3002","title":"\u5185\u79ef\u7a7a\u95f4\u3001\u8d4b\u8303\u7a7a\u95ee\u4e0eHilbert \u7a7a\u95f4"},{"location":"mb/maa/lec1/#_8","text":"","title":"\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_9","text":"\\(n\\) \u9636\u590d\u5411\u91cf \\(x=[x_1,...,x_n]^{\\top},y=[y_1,...,y_n]^{\\top}\\) \u4e4b\u95f4\u7684\u5185\u79ef \\(=x^Hy=\\sum_{i=1}^n x_i^*y_i\\) \u79f0\u4e3a\u5178\u8303\u5185\u79ef\u3002\u52a0\u6743\u5185\u79ef \\(=x^HGy\\) \uff0c\u5176\u4e2d \\(G\\) \u4e3a\u6b63\u5b9a\u7684 Hermitian \u77e9\u9635\u3002 \u5728\u5b9e\u548c\u590d\u5185\u79ef\u7a7a\u95f4\u91cc\uff0c\u8303\u6570\u5177\u6709\u4ee5\u4e0b\u6027\u8d28\uff1a \\(\\parallel 0 \\parallel = 0\\) \uff0c\u5e76\u4e14 \\(\\parallel x \\parallel > 0\uff0c\\forall x \\ne 0\\) \\(\\parallel cx \\parallel = |c| \\cdot \\parallel x \\parallel\\) \u5bf9\u6240\u6709\u5411\u91cf \\(x\\) \u548c\u6807\u91cf c \u6210\u7acb \u8303\u6570\u670d\u4ece\u6781\u5316\u6052\u7b49\u5f0f\uff1a \\[ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2), \\forall x,y\uff08\u5b9e\u5185\u79ef\u7a7a\u95f4\uff09\\\\ =\\frac{1}{4}(\\parallel x + y \\parallel^2-\\parallel x - y \\parallel^2 - j \\parallel x+jy \\parallel^2+j \\parallel x-jy \\parallel^2), \\forall x,y\uff08\u590d\u5185\u79ef\u7a7a\u95f4\uff09 \\] \u8303\u6570\u670d\u4ece\u5e73\u884c\u56db\u8fb9\u5f62\u6cd5\u5219: \\[ \\parallel x+y \\parallel^2 + \\parallel x - y \\parallel^2 = 2(\\parallel x \\parallel^2+\\parallel y \\parallel^2), \\forall x,y \\] \u8303\u6570\u6ee1\u8db3\u4e09\u89d2\u4e0d\u7b49\u5f0f \\(\\parallel x+y \\parallel \\le \\parallel x \\parallel + \\parallel y \\parallel, \\forall x,y\\) \u8303\u6570\u670d\u4ece Cauchy-Schwartz \u4e0d\u7b49\u5f0f \\(|| \\le \\parallel x \\parallel \\cdot \\parallel y \\parallel\\)","title":"\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_10","text":"\\(L_0\\) \u8303\u6570 \\(\\parallel x \\parallel_0 \\overset{def}{=}\\) \u975e\u96f6\u5143\u7d20\u7684\u4e2a\u6570 \\(L_1\\) \u8303\u6570 \\(\\parallel x \\parallel_1 \\overset{def}{=} \\sum_{i=1}^m |x_i|\\) \\(L_2\\) \u8303\u6570 \\(\\parallel x \\parallel_2 = (|x_1|^2+...+|x_m|^2)^{\\frac{1}{2}}\\) \\(L_\\infty\\) \u8303\u6570 \\(\\parallel x \\parallel_\\infty = \\max\\{|x_1|, ..., |x_m|\\}\\) \\(L_p\\) \u8303\u6570 \\(\\parallel x \\parallel_p = (\\sum_{i=1}^m |x_i|^p)^{\\frac{1}{p}}\\)","title":"\u5e38\u6570\u5411\u91cf\u7684\u5178\u8303\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_11","text":"\u82e5 \\(x(t)\\) \u548c \\(y(t)\\) \u5206\u522b\u662f\u53d8\u91cf \\(t\\) \u7684\u51fd\u6570\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} \\int_{a}^{b} x^H(t)y(t)dt \\]","title":"\u51fd\u6570\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_12","text":"\u82e5 \\(x(\\xi)\\) \u548c \\(y(\\xi)\\) \u5206\u522b\u662f\u6837\u672c\u53d8\u91cf \\(\\xi\\) \u968f\u673a\u53d8\u91cf\uff0c\u5219\u5185\u79ef\u5b9a\u4e49\u4e3a \\[ \\overset{def}{=} E\\{x^H(\\xi)y(\\xi)\\} \\]","title":"\u968f\u673a\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_13","text":"\u5c06\u5411\u91cf\u7684\u5185\u79ef\u4e0e\u8303\u6570\u52a0\u4ee5\u63a8\u5e7f\u3002 \u77e9\u9635\u7684\u8303\u6570\u6709\u4e09\u79cd\u4e3b\u8981\u7c7b\u578b:\u8bf1\u5bfc\u8303\u6570\u3001\u5143\u7d20\u5f62\u5f0f\u8303\u6570\u548c Schatten \u8303\u6570\u3002","title":"\u77e9\u9635\u7684\u5185\u79ef\u4e0e\u8303\u6570"},{"location":"mb/maa/lec1/#_14","text":"\u6982\u7387\u8bba\u77e5\u8bc6\u3002","title":"\u968f\u673a\u5411\u91cf"},{"location":"mb/maa/lec1/#_15","text":"\u4e8c\u6b21\u578b \u7279\u5f81\u503c \u8ff9 \u79e9","title":"\u77e9\u9635\u7684\u6027\u80fd\u6307\u6807"},{"location":"mb/maa/lec1/#_16","text":"\u4e3b\u8981\u8ba8\u8bba\u975e\u5947\u5f02\u7684\u6b63\u65b9\u77e9\u9635 \\(A\\) \u7684\u9006\u77e9\u9635 \\(A^{-1}\\)","title":"\u9006\u77e9\u9635\u4e0e\u4f2a\u9006\u77e9\u9635"},{"location":"mb/maa/lec1/#moore-penrose","text":"\u4e3b\u8981\u8ba8\u8bba\u4e00\u4e2a\u79e9\u7a00\u7f3a\u7684\u77e9\u9635\u662f\u5426\u5b58\u5728\u9006\u77e9\u9635\uff0c\u5982\u679c\u5b58\u5728\u9700\u8981\u6ee1\u8db3\u4ec0\u4e48\u6761\u4ef6\u3002","title":"Moore-Penrose \u9006\u77e9\u9635"},{"location":"mb/maa/lec1/#hadamard","text":"","title":"\u77e9\u9635\u7684\u76f4\u548c\u4e0eHadamard \u79ef"},{"location":"mb/maa/lec1/#_17","text":"\\(m \\times m\\) \u77e9\u9635\u7684 \\(A\\) \u4e0e \\(n \\times n\\) \u77e9\u9635\u7684 \\(B\\) \u7684\u76f4\u548c\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5373 \\[ A \\oplus B = \\begin{bmatrix} A & O_{m \\times n} \\\\ O_{n \\times m} & B \\end{bmatrix} \\]","title":"\u77e9\u9635\u7684\u76f4\u548c"},{"location":"mb/maa/lec1/#hadamard_1","text":"\\(m \\times n\\) \u77e9\u9635\u7684 \\(A=[a_{ij}]\\) \u4e0e \\(m \\times n\\) \u77e9\u9635\u7684 \\(B=[b_{ij}]\\) \u7684 Hadamard \u79ef\u8bb0\u4f5c \\(A * B\\) \uff0c\u5143\u7d20\u5b9a\u4e49\u4e3a \\((A*B)_{ij}=a_{ij}b_{ij}\\) \u3002\u5373 Hadamard \u79ef\u98df\u4e00\u79cd\u6620\u5c04 \\(R^{m \\times n} \\times R^{m \\times n} \\to R^{m \\times n}\\)","title":"Hadamard \u79ef"},{"location":"mb/maa/lec1/#kronecker-khatri-rao","text":"","title":"Kronecker \u79ef\u4e0eKhatri-Rao \u79ef"},{"location":"mb/maa/lec1/#kronecker","text":"Kronecker \u79ef\u5206\u4e3a\u53f3\u548c\u5de6\u4e24\u79cd Kronecker \u79ef\u3002 \u4f8b\u5982\u53f3 Kronecker \u79ef\u8bb0\u4f5c \\(A \\oplus B\\) \uff0c\u5b9a\u4e49\u4e3a\uff1a \\[ A \\oplus B = [a_1B, ..., a_nB]=[a_{ij}B]_{i=1,j=1}^{m,n}= \\begin{bmatrix} a_{11}B &a_{12}B &... &a_{1n}B \\\\ a_{21}B &a_{22}B &... &a_{2n}B \\\\ ... & ... & ... &... \\\\ a_{m1}B &a_{m2}B & ... &a_{mn}B \\end{bmatrix} \\] Kronecker \u79ef\u4e5f\u79f0\u76f4\u79ef(direct product)\u6216\u8005\u5f20\u91cf\u79ef(tensor product)1","title":"Kronecker \u79ef"},{"location":"mb/maa/lec1/#khatri-rao","text":"\u4e24\u4e2a\u5177\u6709\u76f8\u540c\u5217\u6570\u7684\u77e9\u9635 \\(G \\in R^{p \\times n}\\) \u548c \\(F \\in R^{q\\times n}\\) \u7684 Khatri-Rao \u79ef\u8bb0\u4f5c \\(F \\odot G\\) \uff0c\u5b9a\u4e49\u4e3a \\[ F \\odot G = [f_1 \\oplus g_1, f_2 \\oplus g_2, ..., f_n \\oplus g_n] \\in R^{pq \\times n} \\] \u5b83\u7531\u4e24\u4e2a\u77e9\u9635\u7684\u5bf9\u5e94\u5217\u5411\u91cf\u7684Kronecker \u79ef\u6392\u5217\u800c\u6210\u3002\u56e0\u6b64\uff0cKhatri-Rao \u79ef\u53c8\u53eb\u5bf9\u5e94\u5217 Kronecker \u79ef\u3002","title":"Khatri-Rao \u79ef"},{"location":"mb/maa/lec1/#_18","text":"\u77e9\u9635\u7684\u5411\u91cf\u5316 \\(vec(A)\\) \u662f\u4e00\u7ebf\u6027\u53d8\u6362\uff0c\u5c06 \\(A\\) \u6309\u5217\u5806\u6808\uff08\u5f53\u7136\u4e5f\u53ef\u4ee5\u6309\u884c\u5806\u6808\uff09\u6392\u5217\u6210\u4e00\u4e2a \\(mn \\times 1\\) \u5411\u91cf\u3002\u5373 \\[vec(A)=[a_{11},...,a_{m1},...,a_{1n},...,a_{mn}]^{\\top}\\]","title":"\u5411\u91cf\u5316\u4e0e\u77e9\u9635\u5316"},{"location":"mb/maa/lec2/","text":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840 \u00b6 Abstract \u5143\u7d20\u4e4b\u95f4\u5b58\u5728\u67d0\u79cd\u7279\u6b8a\u7ed3\u6784\u5173\u7cfb\u7684\u77e9\u9635\uff0c\u7edf\u79f0\u4e3a\u7279\u6b8a\u77e9\u9635 Hermitian \u77e9\u9635 \u00b6 \u4e00\u4e2a\u6b63\u65b9\u7684\u590d\u503c\u77e9\u9635 \\(\\mathbf{A}=[a_{ij}] \\in C^{n\\times n}\\) \u79f0\u4e3a Hermitian \u77e9\u9635 \u82e5 \\(\\mathbf{A}=-\\mathbf{A}^H\\) \uff0c\u5219\u77e9\u9635 \\(\\mathbf{A}\\) \u79f0\u4e3a\u53cd Hermitian \u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u5143\u7d20\u6ee1\u8db3\u5bf9\u79f0\u6027 \\(r_{ij}=r_{n-j+1,n-i+1}^*\\) \u7684 \\(n \\times n\\) \u6b63\u65b9\u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635\u7684\u4e00\u4e2a\u7279\u6b8a\u5b50\u7c7b\u662f\u53cc\u91cd\u5bf9\u79f0\u7684\u77e9\u9635\uff0c\u5b83\u65e2\u662f\u5173\u4e8e\u4e3b\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684 Hermitian \u77e9\u9635\uff0c\u53c8\u662f\u5173\u4e8e\u4ea4\u53c9\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684\u4ea4\u53c9\u5bf9\u79f0\u77e9\u9635\uff0c\u5982 \\[ \\mathbf{R}= \\begin{bmatrix} r_{11} & r_{21}^* & r_{31}^* & r_{41}^* \\\\ r_{21} & r_{22} & r_{32}^* & r_{31}^* \\\\ r_{31} & r_{32} & r_{22} & r_{21}^* \\\\ r_{41} & r_{31} & r_{21} & r_{11} \\end{bmatrix} \\] \u7f6e\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635 \u00b6 \u7f6e\u6362\u77e9\u9635\u4e0e\u4e92\u6362\u77e9\u9635 \u00b6 \u82e5\u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20 1 \u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u7f6e\u6362\u77e9\u9635 \\((\\mathbf{P}_{m \\times n})^{\\top} = \\mathbf{n \\times m}\\) \\(\\mathbf{P}^{\\top}\\mathbf{P}=\\mathbf{P}\\mathbf{P}^{\\top}=\\mathbf{I}\\) \uff0c\u8bf4\u660e\u7f6e\u6362\u77e9\u9635\u662f\u6b63\u4ea4\u77e9\u9635 \\(\\mathbf{P}^{\\top}=\\mathbf{P}^{-1}\\) \\(\\mathbf{P}^{\\top}\\mathbf{A}\\mathbf{P}\\) \u4e0e \\(\\mathbf{A}\\) \u5177\u6709\u76f8\u540c\u7684\u5bf9\u89d2\u7ebf\u5143\u7d20\uff0c\u4f46\u6392\u5217\u987a\u5e8f\u53ef\u80fd\u4e0d\u540c \u53e6\u5916\u4e09\u4e2a\u7279\u6b8a\u5f62\u5f0f\uff1a\u4ea4\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u3001\u79fb\u4f4d\u77e9\u9635 \u5e7f\u4e49\u7f6e\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635 \u00b6 \u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20\u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u5e7f\u4e49\u7f6e\u6362\u77e9\u9635 \u4e00\u4e2a\u6b63\u65b9\u77e9\u9635\u662f \\(g\\) \u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e2a\u7f6e\u6362\u77e9\u9635\u548c\u4e00\u4e2a\u975e\u5947\u5f02\u7684\u5bf9\u89d2\u77e9\u9635\u4e4b\u79ef\uff0c\u5373 \\(\\mathbf{G}=\\mathbf{P}\\mathbf{D}\\) \u9009\u62e9\u77e9\u9635\u662f\u4e00\u79cd\u53ef\u4ee5\u5bf9\u67d0\u4e2a\u7ed9\u5b9a\u77e9\u9635\u7684\u67d0\u4e9b\u884c\u6216\u8005\u67d0\u4e9b\u5217\u8fdb\u884c\u9009\u62e9\u7684\u77e9\u9635 \u6b63\u5b9a\u77e9\u9635\u4e0e\u9149\u77e9\u9635 \u00b6 \u5411\u91cf \\(x_1, ..., x_k \\in C^n\\) \u7ec4\u6210\u4e00\u6b63\u4ea4\u7ec4\uff0c\u82e5 \\(x_i^Hx_j=0, 1 \\le i < j < \\le k\\) \u3002\u82e5\u662f\u5f52\u4e00\u5316\u7684\uff0c\u5219\u4e3a\u6807\u51c6\u6b63\u4ea4\u7ec4 \u4e00\u7ec4\u6b63\u4ea4\u7684\u975e\u96f6\u5411\u91cf\u662f\u7ebf\u6027\u65e0\u5173\u7684 \u4e00\u5b9e\u7684\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{Q} \\in R^{n \\times n}\\) \u79f0\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{Q}\\mathbf{Q}^{\\top}=\\mathbf{Q}^{\\top}\\mathbf{Q}=\\mathbf{I}\\) \u4e00\u590d\u503c\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{U}\\in C^{n \\times n}\\) \u79f0\u4e3a\u9149\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{U}\\mathbf{U}^{\\top}=\\mathbf{U}^{\\top}\\mathbf{U}=\\mathbf{I}\\) \u82e5 \\(n \\times n\\) \u77e9\u9635 \\(\\mathbf{A}=[a_{ij}]\\) \u548c \\(\\mathbf{B}=[b_{ij}]\\) \u662f\u9149\u7b49\u4ef7\u7684\uff0c\u5219 \\(\\sum_{i=1}^n\\sum_{j=1}^n|b_{ij}|^2=\\sum_{i=1}^n\\sum_{j=1}^n|a_{ij}|^2\\) \u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u79f0\u4e3a\u6b63\u89c4\u77e9\uff0c\u82e5 \\(\\mathbf{A}^H\\mathbf{A}=\\mathbf{A}\\mathbf{A}^{\\top}\\) \u4ee4 \\(\\mathbf{J}\\) \u4e3a \\(N \\times N\\) \u7b26\u53f7\u77e9\u9635\uff0c\u6ee1\u8db3 \\(\\mathbf{Q}\\mathbf{J}\\mathbf{Q}^{\\top}=\\mathbf{J}\\) \u7684 \\(N \\times N\\) \u77e9\u9635 \\(\\mathbf{Q}\\) \u79f0\u4e3a \\(J\\) \u6b63\u4ea4\u77e9\u9635\uff0c\u6216\u79f0\u8d85\u6b63\u89c4\u77e9\u9635 \u5e26\u578b\u77e9\u9635\u4e0e\u4e09\u89d2\u77e9\u9635 \u00b6 \u5e26\u884c\u77e9\u9635 \u00b6 \u6ee1\u8db3 \\(a_{ij}=0,|i-j|>k\\) \u7684\u77e9\u9635 \\(\\mathbf{A}\\in C^{m\\times n}\\) \u79f0\u4e3a\u5e26\u578b\u77e9\u9635 \u4e09\u5bf9\u89d2\u77e9\u9635\u662f\u5e26\u578b\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\uff0c\u5f53 \\(|i-j|>1\\) \u65f6\uff0c \\(a_{ij}=0\\) \u4e09\u89d2\u77e9\u9635 \u00b6 \u4e24\u79cd\u7279\u6b8a\u7684\u5e38\u7528\u5e26\u578b\u77e9\u9635\u4e3a\u4e0a\u4e09\u89d2\u77e9\u9635\u548c\u4e0b\u4e09\u89d2\u77e9\u9635 \u6c42\u548c\u5411\u91cf\u4e0e\u4e2d\u5fc3\u5316\u77e9\u9635 \u00b6 \u6c42\u548c\u5411\u91cf \u00b6 \u6240\u6709\u5143\u7d20\u7b49\u4e8e 1 \u7684\u5411\u91cf\u79f0\u4e3a\u6c42\u548c\u5411\u91cf\uff0c\u8bb0\u4e3a \\(\\mathbf{I}=[1,1,...,1]^{\\top}\\) \u4e2d\u5fc3\u5316\u77e9\u9635 \u00b6 \u77e9\u9635 \\(\\mathbf{C}_n=\\mathbf{I}_n-\\mathbf{J}_n=\\mathbf{I}_n-\\frac{1}{n}\\mathbf{J}_n\\) \u79f0\u4e3a\u4e2d\u5fc3\u5316\u77e9\u9635 \u4e2d\u5fc3\u5316\u77e9\u9635\u65e2\u662f\u5bf9\u79f0\u77e9\u9635\uff0c\u53c8\u662f\u5e42\u7b49\u77e9\u9635\uff0c \\(\\mathbf{C}_n=\\mathbf{C}_n^{\\top}=\\mathbf{C}_n^2\\) \u76f8\u4f3c\u77e9\u9635\u4e0e\u76f8\u5408\u77e9\u9635 \u00b6 \u76f8\u4f3c\u77e9\u9635 \u00b6 \u77e9\u9635 \\(\\mathbf{B} \\in C^{n \\times n}\\) \u79f0\u4e3a\u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u7684\u76f8\u4f3c\u77e9\u9635\uff0c\u82e5\u5b58\u5728\u4e00\u975e\u5947\u5f02\u77e9\u9635 \\(\\mathbf{S} \\in C^{n \\times n}\\) \u4f7f\u5f97 \\(\\mathbf{B}=\\mathbf{S}^{-1}\\mathbf{A}\\mathbf{S}\\) \u82e5 \\(\\mathbf{B}\\) \u4e0e \\(\\mathbf{A}\\) \u76f8\u4f3c\uff0c\u5219 \\(\\det(\\mathbf{B})=\\det(\\mathbf{A})\\) \u3001 \\(tr(\\mathbf{B})=tr(\\mathbf{A})\\) \u548c\u76f8\u540c\u7684\u7279\u5f81\u503c \u76f8\u5408\u77e9\u9635 \u00b6 \u4ee4 \\(\\mathbf{A},\\mathbf{B},\\mathbf{C} \\in C^{n\\times n}\\) \uff0c\u5e76\u4e14 \\(\\mathbf{C}\\) \u975e\u5947\u5f02\uff0c\u5219\u77e9\u9635 \\(\\mathbf{B}=\\mathbf{C}^H\\mathbf{A}\\mathbf{C}\\) \u79f0\u4e3a \\(\\mathbf{A}\\) \u7684\u76f8\u5408\u77e9\u9635\u3002 Vandermonde \u77e9\u9635\u548c Fourier \u77e9\u9635 \u00b6 \u5728\u4fe1\u53f7\u5904\u7406\u6709\u5e7f\u6cdb\u5e94\u7528 Hadamard \u77e9\u9635 \u00b6 \u5728\u901a\u4fe1\u3001\u4fe1\u606f\u8bba\u548c\u4fe1\u53f7\u5904\u7406\u4e2d\u4e00\u79cd\u91cd\u8981\u7684\u7279\u6b8a\u77e9\u9635 Toeplitz \u77e9\u9635 \u00b6 Toeplitz \u5728\u7814\u7a76\u4e0e Laurent \u7ea7\u6570\u6709\u5173\u7684\u53cc\u7ebf\u6027\u51fd\u6570\u7684\u4e00\u7bc7\u8bba\u6587\u4e2d\u63d0\u51fa\u7684\u3002 Hankel \u77e9\u9635 \u00b6 \u6b63\u65b9\u77e9\u9635 \\(\\mathbf{A} \\in C^{(n+1)\\times (n+1)}\\) \u79f0\u4e3a Hankel \u77e9\u9635\uff0c\u82e5 \\[ \\mathbf{A}= \\begin{bmatrix} a_{0} & a_{1} & a_{2} & ... & a_{n} \\\\ a_{1} & a_{2} & a_{3} & ... & a_{n+1} \\\\ a_{2} & a_{3} & a_{4} & ... & a_{n+2} \\\\ ... & ... & ... & ... & ...\\\\ a_{n} & a_{n+1} & a_{n+2} & ... & a_{2n} \\end{bmatrix} \\]","title":"\u7279\u6b8a\u77e9\u9635"},{"location":"mb/maa/lec2/#_1","text":"Abstract \u5143\u7d20\u4e4b\u95f4\u5b58\u5728\u67d0\u79cd\u7279\u6b8a\u7ed3\u6784\u5173\u7cfb\u7684\u77e9\u9635\uff0c\u7edf\u79f0\u4e3a\u7279\u6b8a\u77e9\u9635","title":"\u77e9\u9635\u4ee3\u6570\u57fa\u7840"},{"location":"mb/maa/lec2/#hermitian","text":"\u4e00\u4e2a\u6b63\u65b9\u7684\u590d\u503c\u77e9\u9635 \\(\\mathbf{A}=[a_{ij}] \\in C^{n\\times n}\\) \u79f0\u4e3a Hermitian \u77e9\u9635 \u82e5 \\(\\mathbf{A}=-\\mathbf{A}^H\\) \uff0c\u5219\u77e9\u9635 \\(\\mathbf{A}\\) \u79f0\u4e3a\u53cd Hermitian \u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635 \\(\\mathbf{R}\\) \u662f\u4e00\u4e2a\u5143\u7d20\u6ee1\u8db3\u5bf9\u79f0\u6027 \\(r_{ij}=r_{n-j+1,n-i+1}^*\\) \u7684 \\(n \\times n\\) \u6b63\u65b9\u77e9\u9635 \u4e2d\u592e Hermitian \u77e9\u9635\u7684\u4e00\u4e2a\u7279\u6b8a\u5b50\u7c7b\u662f\u53cc\u91cd\u5bf9\u79f0\u7684\u77e9\u9635\uff0c\u5b83\u65e2\u662f\u5173\u4e8e\u4e3b\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684 Hermitian \u77e9\u9635\uff0c\u53c8\u662f\u5173\u4e8e\u4ea4\u53c9\u5bf9\u89d2\u7ebf\u5bf9\u79f0\u7684\u4ea4\u53c9\u5bf9\u79f0\u77e9\u9635\uff0c\u5982 \\[ \\mathbf{R}= \\begin{bmatrix} r_{11} & r_{21}^* & r_{31}^* & r_{41}^* \\\\ r_{21} & r_{22} & r_{32}^* & r_{31}^* \\\\ r_{31} & r_{32} & r_{22} & r_{21}^* \\\\ r_{41} & r_{31} & r_{21} & r_{11} \\end{bmatrix} \\]","title":"Hermitian \u77e9\u9635"},{"location":"mb/maa/lec2/#_2","text":"","title":"\u7f6e\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635"},{"location":"mb/maa/lec2/#_3","text":"\u82e5\u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20 1 \u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u7f6e\u6362\u77e9\u9635 \\((\\mathbf{P}_{m \\times n})^{\\top} = \\mathbf{n \\times m}\\) \\(\\mathbf{P}^{\\top}\\mathbf{P}=\\mathbf{P}\\mathbf{P}^{\\top}=\\mathbf{I}\\) \uff0c\u8bf4\u660e\u7f6e\u6362\u77e9\u9635\u662f\u6b63\u4ea4\u77e9\u9635 \\(\\mathbf{P}^{\\top}=\\mathbf{P}^{-1}\\) \\(\\mathbf{P}^{\\top}\\mathbf{A}\\mathbf{P}\\) \u4e0e \\(\\mathbf{A}\\) \u5177\u6709\u76f8\u540c\u7684\u5bf9\u89d2\u7ebf\u5143\u7d20\uff0c\u4f46\u6392\u5217\u987a\u5e8f\u53ef\u80fd\u4e0d\u540c \u53e6\u5916\u4e09\u4e2a\u7279\u6b8a\u5f62\u5f0f\uff1a\u4ea4\u6362\u77e9\u9635\u3001\u4e92\u6362\u77e9\u9635\u3001\u79fb\u4f4d\u77e9\u9635","title":"\u7f6e\u6362\u77e9\u9635\u4e0e\u4e92\u6362\u77e9\u9635"},{"location":"mb/maa/lec2/#_4","text":"\u6bcf\u4e00\u884c\u548c\u6bcf\u4e00\u5217\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u975e\u96f6\u5143\u7d20\u7684\u6b63\u65b9\u77e9\u9635\u79f0\u4e3a\u5e7f\u4e49\u7f6e\u6362\u77e9\u9635 \u4e00\u4e2a\u6b63\u65b9\u77e9\u9635\u662f \\(g\\) \u77e9\u9635\uff0c\u5f53\u4e14\u4ec5\u5f53\u5b83\u53ef\u4ee5\u5206\u89e3\u4e3a\u4e00\u4e2a\u7f6e\u6362\u77e9\u9635\u548c\u4e00\u4e2a\u975e\u5947\u5f02\u7684\u5bf9\u89d2\u77e9\u9635\u4e4b\u79ef\uff0c\u5373 \\(\\mathbf{G}=\\mathbf{P}\\mathbf{D}\\) \u9009\u62e9\u77e9\u9635\u662f\u4e00\u79cd\u53ef\u4ee5\u5bf9\u67d0\u4e2a\u7ed9\u5b9a\u77e9\u9635\u7684\u67d0\u4e9b\u884c\u6216\u8005\u67d0\u4e9b\u5217\u8fdb\u884c\u9009\u62e9\u7684\u77e9\u9635","title":"\u5e7f\u4e49\u7f6e\u6362\u77e9\u9635\u4e0e\u9009\u62e9\u77e9\u9635"},{"location":"mb/maa/lec2/#_5","text":"\u5411\u91cf \\(x_1, ..., x_k \\in C^n\\) \u7ec4\u6210\u4e00\u6b63\u4ea4\u7ec4\uff0c\u82e5 \\(x_i^Hx_j=0, 1 \\le i < j < \\le k\\) \u3002\u82e5\u662f\u5f52\u4e00\u5316\u7684\uff0c\u5219\u4e3a\u6807\u51c6\u6b63\u4ea4\u7ec4 \u4e00\u7ec4\u6b63\u4ea4\u7684\u975e\u96f6\u5411\u91cf\u662f\u7ebf\u6027\u65e0\u5173\u7684 \u4e00\u5b9e\u7684\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{Q} \\in R^{n \\times n}\\) \u79f0\u4e3a\u6b63\u4ea4\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{Q}\\mathbf{Q}^{\\top}=\\mathbf{Q}^{\\top}\\mathbf{Q}=\\mathbf{I}\\) \u4e00\u590d\u503c\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{U}\\in C^{n \\times n}\\) \u79f0\u4e3a\u9149\u77e9\u9635\uff0c\u82e5 \\(\\mathbf{U}\\mathbf{U}^{\\top}=\\mathbf{U}^{\\top}\\mathbf{U}=\\mathbf{I}\\) \u82e5 \\(n \\times n\\) \u77e9\u9635 \\(\\mathbf{A}=[a_{ij}]\\) \u548c \\(\\mathbf{B}=[b_{ij}]\\) \u662f\u9149\u7b49\u4ef7\u7684\uff0c\u5219 \\(\\sum_{i=1}^n\\sum_{j=1}^n|b_{ij}|^2=\\sum_{i=1}^n\\sum_{j=1}^n|a_{ij}|^2\\) \u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u79f0\u4e3a\u6b63\u89c4\u77e9\uff0c\u82e5 \\(\\mathbf{A}^H\\mathbf{A}=\\mathbf{A}\\mathbf{A}^{\\top}\\) \u4ee4 \\(\\mathbf{J}\\) \u4e3a \\(N \\times N\\) \u7b26\u53f7\u77e9\u9635\uff0c\u6ee1\u8db3 \\(\\mathbf{Q}\\mathbf{J}\\mathbf{Q}^{\\top}=\\mathbf{J}\\) \u7684 \\(N \\times N\\) \u77e9\u9635 \\(\\mathbf{Q}\\) \u79f0\u4e3a \\(J\\) \u6b63\u4ea4\u77e9\u9635\uff0c\u6216\u79f0\u8d85\u6b63\u89c4\u77e9\u9635","title":"\u6b63\u5b9a\u77e9\u9635\u4e0e\u9149\u77e9\u9635"},{"location":"mb/maa/lec2/#_6","text":"","title":"\u5e26\u578b\u77e9\u9635\u4e0e\u4e09\u89d2\u77e9\u9635"},{"location":"mb/maa/lec2/#_7","text":"\u6ee1\u8db3 \\(a_{ij}=0,|i-j|>k\\) \u7684\u77e9\u9635 \\(\\mathbf{A}\\in C^{m\\times n}\\) \u79f0\u4e3a\u5e26\u578b\u77e9\u9635 \u4e09\u5bf9\u89d2\u77e9\u9635\u662f\u5e26\u578b\u77e9\u9635\u7684\u7279\u6b8a\u5f62\u5f0f\uff0c\u5f53 \\(|i-j|>1\\) \u65f6\uff0c \\(a_{ij}=0\\)","title":"\u5e26\u884c\u77e9\u9635"},{"location":"mb/maa/lec2/#_8","text":"\u4e24\u79cd\u7279\u6b8a\u7684\u5e38\u7528\u5e26\u578b\u77e9\u9635\u4e3a\u4e0a\u4e09\u89d2\u77e9\u9635\u548c\u4e0b\u4e09\u89d2\u77e9\u9635","title":"\u4e09\u89d2\u77e9\u9635"},{"location":"mb/maa/lec2/#_9","text":"","title":"\u6c42\u548c\u5411\u91cf\u4e0e\u4e2d\u5fc3\u5316\u77e9\u9635"},{"location":"mb/maa/lec2/#_10","text":"\u6240\u6709\u5143\u7d20\u7b49\u4e8e 1 \u7684\u5411\u91cf\u79f0\u4e3a\u6c42\u548c\u5411\u91cf\uff0c\u8bb0\u4e3a \\(\\mathbf{I}=[1,1,...,1]^{\\top}\\)","title":"\u6c42\u548c\u5411\u91cf"},{"location":"mb/maa/lec2/#_11","text":"\u77e9\u9635 \\(\\mathbf{C}_n=\\mathbf{I}_n-\\mathbf{J}_n=\\mathbf{I}_n-\\frac{1}{n}\\mathbf{J}_n\\) \u79f0\u4e3a\u4e2d\u5fc3\u5316\u77e9\u9635 \u4e2d\u5fc3\u5316\u77e9\u9635\u65e2\u662f\u5bf9\u79f0\u77e9\u9635\uff0c\u53c8\u662f\u5e42\u7b49\u77e9\u9635\uff0c \\(\\mathbf{C}_n=\\mathbf{C}_n^{\\top}=\\mathbf{C}_n^2\\)","title":"\u4e2d\u5fc3\u5316\u77e9\u9635"},{"location":"mb/maa/lec2/#_12","text":"","title":"\u76f8\u4f3c\u77e9\u9635\u4e0e\u76f8\u5408\u77e9\u9635"},{"location":"mb/maa/lec2/#_13","text":"\u77e9\u9635 \\(\\mathbf{B} \\in C^{n \\times n}\\) \u79f0\u4e3a\u77e9\u9635 \\(\\mathbf{A} \\in C^{n \\times n}\\) \u7684\u76f8\u4f3c\u77e9\u9635\uff0c\u82e5\u5b58\u5728\u4e00\u975e\u5947\u5f02\u77e9\u9635 \\(\\mathbf{S} \\in C^{n \\times n}\\) \u4f7f\u5f97 \\(\\mathbf{B}=\\mathbf{S}^{-1}\\mathbf{A}\\mathbf{S}\\) \u82e5 \\(\\mathbf{B}\\) \u4e0e \\(\\mathbf{A}\\) \u76f8\u4f3c\uff0c\u5219 \\(\\det(\\mathbf{B})=\\det(\\mathbf{A})\\) \u3001 \\(tr(\\mathbf{B})=tr(\\mathbf{A})\\) \u548c\u76f8\u540c\u7684\u7279\u5f81\u503c","title":"\u76f8\u4f3c\u77e9\u9635"},{"location":"mb/maa/lec2/#_14","text":"\u4ee4 \\(\\mathbf{A},\\mathbf{B},\\mathbf{C} \\in C^{n\\times n}\\) \uff0c\u5e76\u4e14 \\(\\mathbf{C}\\) \u975e\u5947\u5f02\uff0c\u5219\u77e9\u9635 \\(\\mathbf{B}=\\mathbf{C}^H\\mathbf{A}\\mathbf{C}\\) \u79f0\u4e3a \\(\\mathbf{A}\\) \u7684\u76f8\u5408\u77e9\u9635\u3002","title":"\u76f8\u5408\u77e9\u9635"},{"location":"mb/maa/lec2/#vandermonde-fourier","text":"\u5728\u4fe1\u53f7\u5904\u7406\u6709\u5e7f\u6cdb\u5e94\u7528","title":"Vandermonde \u77e9\u9635\u548c Fourier \u77e9\u9635"},{"location":"mb/maa/lec2/#hadamard","text":"\u5728\u901a\u4fe1\u3001\u4fe1\u606f\u8bba\u548c\u4fe1\u53f7\u5904\u7406\u4e2d\u4e00\u79cd\u91cd\u8981\u7684\u7279\u6b8a\u77e9\u9635","title":"Hadamard \u77e9\u9635"},{"location":"mb/maa/lec2/#toeplitz","text":"Toeplitz \u5728\u7814\u7a76\u4e0e Laurent \u7ea7\u6570\u6709\u5173\u7684\u53cc\u7ebf\u6027\u51fd\u6570\u7684\u4e00\u7bc7\u8bba\u6587\u4e2d\u63d0\u51fa\u7684\u3002","title":"Toeplitz \u77e9\u9635"},{"location":"mb/maa/lec2/#hankel","text":"\u6b63\u65b9\u77e9\u9635 \\(\\mathbf{A} \\in C^{(n+1)\\times (n+1)}\\) \u79f0\u4e3a Hankel \u77e9\u9635\uff0c\u82e5 \\[ \\mathbf{A}= \\begin{bmatrix} a_{0} & a_{1} & a_{2} & ... & a_{n} \\\\ a_{1} & a_{2} & a_{3} & ... & a_{n+1} \\\\ a_{2} & a_{3} & a_{4} & ... & a_{n+2} \\\\ ... & ... & ... & ... & ...\\\\ a_{n} & a_{n+1} & a_{n+2} & ... & a_{2n} \\end{bmatrix} \\]","title":"Hankel \u77e9\u9635"},{"location":"mb/maa/lec3/","text":"\u77e9\u9635\u5fae\u5206 \u00b6 Abstract \u77e9\u9635\u5fae\u5206\u662f\u591a\u53d8\u91cf\u51fd\u6570\u5fae\u5206\u7684\u63a8\u5e7f\uff0c\u5305\u62ec\u77e9\u9635\u504f\u5bfc\u548c\u68af\u5ea6\u3002 \u6982\u5ff5\u5de8\u591a\u4e14\u7e41\u7410\uff08\u8fd8\u662f\u5efa\u8bae\u770b\u4e66\u5427 Jacobian \u77e9\u9635\u4e0e\u68af\u5ea6\u77e9\u9635 \u00b6 Jacobian \u77e9\u9635 \u00b6 \\(pq \\times mn\\) \u7ef4 Jacobian \u77e9\u9635 \\[ D_{X}F(\\mathbf{X}) \\overset{def}{=} \\frac{\\partial vec(F(\\mathbf{X}))}{\\partial (vec \\mathbf{X})^\\top} \\in R^{pq \\times mn} \\] \u5177\u4f53\u8868\u8fbe\u5f0f\u4e3a \\[ D_{X}F(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ... \\\\ \\frac{\\partial f_{p1}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{1q}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{pq}}{\\partial (vec \\mathbf{X})^\\top} \\\\ \\end{bmatrix} = \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial x_{11}} & .. & \\frac{\\partial f_{11}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{11}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{11}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{p1}}{\\partial x_{11}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{1q}}{\\partial x_{11}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{pq}}{\\partial x_{11}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{mn}} \\\\ \\end{bmatrix} \\] \u68af\u5ea6\u77e9\u9635 \u00b6 \u5b9a\u4e49\u68af\u5ea6\u77e9\u9635 \\[ \\nabla_\\mathbf{X} f(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f(\\mathbf{X})}{\\partial x_{11}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{1n}} \\\\ ... & ... & ... \\\\ \\frac{\\partial f(\\mathbf{X})}{\\partial x_{m1}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{mn}} \\\\ \\end{bmatrix} = \\frac{\\partial f(\\mathbf{X})}{\\partial \\mathbf{X}} \\] \u77e9\u9635\u51fd\u6570\u7684\u68af\u5ea6\u77e9\u9635\u662f\u5176 Jacobian \u77e9\u9635\u7684\u8f6c\u7f6e\uff1a \\(\\nabla_\\mathbf{X} F(\\mathbf{X})=(D_\\mathbf{X} F(\\mathbf{X}))^\\top\\) \u504f\u5bfc\u548c\u68af\u5ea6\u8ba1\u7b97 \u00b6 \u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u548c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u7c7b\u4f3c\uff0c\u53ea\u662f\u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u662f\u77e9\u9635\uff0c\u800c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u662f\u5411\u91cf\uff0c\u90fd\u6ee1\u8db3\u7ebf\u6027\u3001\u4e58\u79ef\u3001\u5546\u3001\u94fe\u5f0f\u6cd5\u5219 \u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Jacobian \u77e9\u9635\u8fa8\u8bc6 \u00b6 \u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206 \u00b6 \u77e9\u9635\u5fae\u5206\u7528\u7b26\u53f7 \\(d\\mathbf{X}\\) \u8868\u793a\uff0c\u5b9a\u4e49\u4e3a \\(d\\mathbf{X}=[dX_{ij}]_{i=1,j=1}^{m,n}\\) \u6807\u91cf\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6 \u5b9e\u503c\u77e9\u9635\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6 \u4e8c\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Hessian \u77e9\u9635\u8fa8\u8bc6 \u00b6 Hessian \u77e9\u9635 \u00b6 \u5b9e\u503c\u51fd\u6570 \\(f(x)\\) \u76f8\u5bf9\u4e8e \\(m \\times 1\\) \u5b9e\u5411\u91cf \\(x\\) \u7684\u4e8c\u9636\u504f\u5bfc\u79f0\u4e3a Hessian \u77e9\u9635\uff0c\u8bb0\u4f5c \\(H[f(x)]\\) \uff0c\u5b9a\u4e49\u4e3a \\[ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}=\\frac{\\partial}{\\partial x}[\\frac{\\partial f(x)}{\\partial x^\\top}] \\in R^{m \\times m} \\\\ \u6216 \\\\ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}= \\begin{bmatrix} \\frac{\\partial^2 f}{\\partial x_1 \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_1 \\partial x_m} \\\\ ... & ... & ... \\\\ \\frac{\\partial^2 f}{\\partial x_m \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_m \\partial x_m} \\\\ \\end{bmatrix} \\in R^{m \\times m} \\] Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u539f\u7406 \u00b6 \u6807\u91cf\u51fd\u6570 \\(f(x)\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6 \u6807\u91cf\u51fd\u6570 \\(f(\\mathbf{X})\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6 Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u65b9\u6cd5 \u00b6 \u5171\u8f6d\u68af\u5ea6\u4e0e\u590d Hessian \u77e9\u9635 \u00b6","title":"\u77e9\u9635\u5fae\u5206"},{"location":"mb/maa/lec3/#_1","text":"Abstract \u77e9\u9635\u5fae\u5206\u662f\u591a\u53d8\u91cf\u51fd\u6570\u5fae\u5206\u7684\u63a8\u5e7f\uff0c\u5305\u62ec\u77e9\u9635\u504f\u5bfc\u548c\u68af\u5ea6\u3002 \u6982\u5ff5\u5de8\u591a\u4e14\u7e41\u7410\uff08\u8fd8\u662f\u5efa\u8bae\u770b\u4e66\u5427","title":"\u77e9\u9635\u5fae\u5206"},{"location":"mb/maa/lec3/#jacobian","text":"","title":"Jacobian \u77e9\u9635\u4e0e\u68af\u5ea6\u77e9\u9635"},{"location":"mb/maa/lec3/#jacobian_1","text":"\\(pq \\times mn\\) \u7ef4 Jacobian \u77e9\u9635 \\[ D_{X}F(\\mathbf{X}) \\overset{def}{=} \\frac{\\partial vec(F(\\mathbf{X}))}{\\partial (vec \\mathbf{X})^\\top} \\in R^{pq \\times mn} \\] \u5177\u4f53\u8868\u8fbe\u5f0f\u4e3a \\[ D_{X}F(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ... \\\\ \\frac{\\partial f_{p1}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{1q}}{\\partial (vec \\mathbf{X})^\\top} \\\\ ...\\\\ \\frac{\\partial f_{pq}}{\\partial (vec \\mathbf{X})^\\top} \\\\ \\end{bmatrix} = \\begin{bmatrix} \\frac{\\partial f_{11}}{\\partial x_{11}} & .. & \\frac{\\partial f_{11}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{11}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{11}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{p1}}{\\partial x_{11}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{p1}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{1q}}{\\partial x_{11}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{1q}}{\\partial x_{mn}} \\\\ ... & .. & ... & .. & ... & .. & ... \\\\ \\frac{\\partial f_{pq}}{\\partial x_{11}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{m1}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{1n}} & .. & \\frac{\\partial f_{pq}}{\\partial x_{mn}} \\\\ \\end{bmatrix} \\]","title":"Jacobian \u77e9\u9635"},{"location":"mb/maa/lec3/#_2","text":"\u5b9a\u4e49\u68af\u5ea6\u77e9\u9635 \\[ \\nabla_\\mathbf{X} f(\\mathbf{X})= \\begin{bmatrix} \\frac{\\partial f(\\mathbf{X})}{\\partial x_{11}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{1n}} \\\\ ... & ... & ... \\\\ \\frac{\\partial f(\\mathbf{X})}{\\partial x_{m1}} & ... & \\frac{\\partial f(\\mathbf{X})}{\\partial x_{mn}} \\\\ \\end{bmatrix} = \\frac{\\partial f(\\mathbf{X})}{\\partial \\mathbf{X}} \\] \u77e9\u9635\u51fd\u6570\u7684\u68af\u5ea6\u77e9\u9635\u662f\u5176 Jacobian \u77e9\u9635\u7684\u8f6c\u7f6e\uff1a \\(\\nabla_\\mathbf{X} F(\\mathbf{X})=(D_\\mathbf{X} F(\\mathbf{X}))^\\top\\)","title":"\u68af\u5ea6\u77e9\u9635"},{"location":"mb/maa/lec3/#_3","text":"\u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u548c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u8ba1\u7b97\u7c7b\u4f3c\uff0c\u53ea\u662f\u77e9\u9635\u53d8\u5143\u7684\u68af\u5ea6\u662f\u77e9\u9635\uff0c\u800c\u6807\u91cf\u53d8\u5143\u7684\u68af\u5ea6\u662f\u5411\u91cf\uff0c\u90fd\u6ee1\u8db3\u7ebf\u6027\u3001\u4e58\u79ef\u3001\u5546\u3001\u94fe\u5f0f\u6cd5\u5219","title":"\u504f\u5bfc\u548c\u68af\u5ea6\u8ba1\u7b97"},{"location":"mb/maa/lec3/#jacobian_2","text":"","title":"\u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Jacobian \u77e9\u9635\u8fa8\u8bc6"},{"location":"mb/maa/lec3/#_4","text":"\u77e9\u9635\u5fae\u5206\u7528\u7b26\u53f7 \\(d\\mathbf{X}\\) \u8868\u793a\uff0c\u5b9a\u4e49\u4e3a \\(d\\mathbf{X}=[dX_{ij}]_{i=1,j=1}^{m,n}\\) \u6807\u91cf\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6 \u5b9e\u503c\u77e9\u9635\u51fd\u6570\u7684 Jacobian \u77e9\u9635\u8fa8\u8bc6","title":"\u4e00\u9636\u5b9e\u77e9\u9635\u5fae\u5206"},{"location":"mb/maa/lec3/#hessian","text":"","title":"\u4e8c\u9636\u5b9e\u77e9\u9635\u5fae\u5206\u4e0e Hessian \u77e9\u9635\u8fa8\u8bc6"},{"location":"mb/maa/lec3/#hessian_1","text":"\u5b9e\u503c\u51fd\u6570 \\(f(x)\\) \u76f8\u5bf9\u4e8e \\(m \\times 1\\) \u5b9e\u5411\u91cf \\(x\\) \u7684\u4e8c\u9636\u504f\u5bfc\u79f0\u4e3a Hessian \u77e9\u9635\uff0c\u8bb0\u4f5c \\(H[f(x)]\\) \uff0c\u5b9a\u4e49\u4e3a \\[ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}=\\frac{\\partial}{\\partial x}[\\frac{\\partial f(x)}{\\partial x^\\top}] \\in R^{m \\times m} \\\\ \u6216 \\\\ H[f(x)]=\\frac{\\partial^2 f(x)}{\\partial x \\partial x^\\top}= \\begin{bmatrix} \\frac{\\partial^2 f}{\\partial x_1 \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_1 \\partial x_m} \\\\ ... & ... & ... \\\\ \\frac{\\partial^2 f}{\\partial x_m \\partial x_1} & ... & \\frac{\\partial^2 f}{\\partial x_m \\partial x_m} \\\\ \\end{bmatrix} \\in R^{m \\times m} \\]","title":"Hessian \u77e9\u9635"},{"location":"mb/maa/lec3/#hessian_2","text":"\u6807\u91cf\u51fd\u6570 \\(f(x)\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6 \u6807\u91cf\u51fd\u6570 \\(f(\\mathbf{X})\\) \u7684 Hessian \u77e9\u9635\u8fa8\u8bc6","title":"Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u539f\u7406"},{"location":"mb/maa/lec3/#hessian_3","text":"","title":"Hessian \u77e9\u9635\u7684\u8fa8\u8bc6\u65b9\u6cd5"},{"location":"mb/maa/lec3/#hessian_4","text":"","title":"\u5171\u8f6d\u68af\u5ea6\u4e0e\u590d Hessian \u77e9\u9635"},{"location":"mb/optimization-theory/","text":"\u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5 \u00b6 Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u6700\u4f18\u5316\u7406\u8bba\u8bfe\u7684\u7b14\u8bb0 Table of Contents \u00b6 \u6700\u4f18\u5316\u95ee\u9898 \u76f4\u7ebf\u641c\u7d22 \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 Reference \u00b6 \u6700\u4f18\u5316\u539f\u7406\u4e0e\u65b9\u6cd5 \u859b\u5609\u5e86\u8457","title":"\u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5"},{"location":"mb/optimization-theory/#_1","text":"Abstract \u5f52\u6863\u4e00\u4e9b\u7814\u4e00\u65f6\u6700\u4f18\u5316\u7406\u8bba\u8bfe\u7684\u7b14\u8bb0","title":"\u6700\u4f18\u5316\u7406\u8bba\u4e0e\u65b9\u6cd5"},{"location":"mb/optimization-theory/#table-of-contents","text":"\u6700\u4f18\u5316\u95ee\u9898 \u76f4\u7ebf\u641c\u7d22 \u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5","title":"Table of Contents"},{"location":"mb/optimization-theory/#reference","text":"\u6700\u4f18\u5316\u539f\u7406\u4e0e\u65b9\u6cd5 \u859b\u5609\u5e86\u8457","title":"Reference"},{"location":"mb/optimization-theory/lec1/","text":"\u6700\u4f18\u5316\u95ee\u9898 \u00b6 Abstract \u8ffd\u6c42\u6700\u4f18\u76ee\u6807\u7684\u6570\u5b66\u95ee\u9898\u90fd\u5c5e\u4e8e\u6700\u4f18\u5316\u95ee\u9898\u3002 \u4f5c\u4e3a\u6700\u4f18\u5316\u95ee\u9898\uff0c\u81f3\u5c11\u6709\u4e24\u4e2a\u8981\u7d20\uff1a\u7b2c\u4e00\u4e2a\u662f\u53ef\u80fd\u7684\u65b9\u6848\uff1b\u7b2c\u4e8c\u4e2a\u662f\u8ffd\u6c42\u7684\u76ee\u6807\u3002 \u7ecf\u5178\u6781\u503c\u95ee\u9898 \u00b6 \u5728\u9ad8\u6570\u91cc\u7684\u5fae\u79ef\u5206\u4e2d\u65e9\u4ee5\u6d89\u53ca\u5230\u6700\u7b80\u5355\u7684\u6700\u4f18\u5316\u95ee\u9898\uff0c \u5c31\u662f\u51fd\u6570\u6781\u503c\u95ee\u9898 \u3002 \u53ef\u4ee5\u5f15\u7533\u51fa\u4e24\u79cd\u7ecf\u5178\u6700\u4f18\u5316\u7684\u4e24\u79cd\u7c7b\u578b\u95ee\u9898\u3002 \u65e0\u7ea6\u675f\u6781\u503c\u95ee\u9898 \u00b6 \\[ \\min{f(x_1, x_2, ..., x_n)} \\ \u6216 \\ \\max{f(x_1, x_2, ..., x_n)} \\] \u8fd9\u91cc\u7684 \\(f(x_1, x_2, ..., x_n)\\) \u662f\u5b9a\u4e49\u5728 \\(n\\) \u7ef4\u7a7a\u95f4\u4e0a\u7684\u53ef\u5fae\u51fd\u6570\u3002 \u6c42\u6781\u503c\u70b9\u65b9\u6cd5 \uff1a\u4ece\u5982\u4e0b\u7684\u542b\u6709 \\(n\\) \u4e2a\u672a\u77e5\u6570 \\(x_1, x_2, ..., x_n\\) \u7684\u975e\u7ebf\u6027\u65b9\u7a0b\u7ec4\u4e2d\u89e3\u51fa\u9a7b\u70b9\uff0c\u7136\u540e\u5224\u5b9a\u6216\u9a8c\u8bc1\u8fd9\u4e9b\u9a7b\u70b9\u662f\u4e0d\u662f\u6781\u503c\u70b9\uff1a \\[ f_{x_1}^\\prime(x_1, x_2, ..., x_n) = 0 \\\\ f_{x_2}^\\prime(x_1, x_2, ..., x_n) = 0 \\\\ ... \\\\ f_{x_n}^\\prime(x_1, x_2, ..., x_n) = 0 \\] \u5177\u6709\u7b49\u5f0f\u7ea6\u675f\u7684\u6781\u503c\u95ee\u9898 \u00b6 \\[ \\min{f(x_1, x_2, ..., x_n)} \\ \u6216 \\ \\max{f(x_1, x_2, ..., x_n)} \\\\ \u6ee1\u8db3\u4e8e \\ \\ \\ h_i(x_1, x_2, ... , x_n) = 0 \\ \\ j = 1,2,...,l(j < n) \\] \u6c42\u6781\u503c\u70b9\u65b9\u6cd5 \uff1a\u901a\u5e38\u91c7\u7528 \\(Lagrange\\) \u4e58\u5b50\u6cd5\u6765\u6c42\u89e3\u3002\u5373\u628a\u8fd9\u4e2a\u95ee\u9898\u8f6c\u6362\u4e3a\u6c42 \\(Lagrange\\) \u51fd\u6570\u7684\u65e0\u7ea6\u675f\u6781\u503c\u95ee\u9898\uff1a \\[ L(x_1, x_2, ... , x_n, \\lambda_1, \\lambda_2, ..., \\lambda_l) \\\\ = f(x_1, x_2, ..., x_n) - \\sum_{j=1}^l \\lambda_j h_j(x_1, x_2, ..., x_n) \\] \u57fa\u672c\u6982\u5ff5 \u00b6 \u5411\u91cf\u8868\u8fbe\u6cd5 \u00b6 \u5c06 \\((x_1, x_2, ..., x_n)\\) \u770b\u4f5c\u662f \\(n\\) \u7ef4\u5411\u91cf\u7a7a\u95f4 \\(R^n\\) \u4e2d\u4e00\u4e2a\u5411\u91cf \\(\\mathbf{x}\\) \u7684 \\(n\\) \u4e2a\u5206\u91cf\uff0c\u5373 \\(\\mathbf{x} = (x_1, x_2, ..., x_n)^{\\top}\\) \u6240\u4ee5\u91cd\u5b9a\u4e49\u4e00\u4e0b\u6700\u4f18\u5316\u95ee\u9898\uff1a \u65e0\u7ea6\u675f\u6781\u503c\u95ee\u9898\uff1a \\[\\min{f(\\mathbf{x})}\\] \u5177\u6709\u7b49\u5f0f\u7ea6\u675f\u7684\u6781\u503c\u95ee\u9898\uff1a \\[ \\min{f(\\mathbf{x})} \\\\ s.t. \\ \\ \\ \\mathbf{h}(\\mathbf{x}) = \\mathbf{0} \\\\ \u5176\u4e2d \\ \\ \\ \\mathbf{h}(\\mathbf{x}) = (h_1(\\mathbf{x}), h_2(\\mathbf{x}), ..., h_l(\\mathbf{x}))^{\\top} \\] \u4e00\u822c\u5f62\u5f0f \u00b6 \u5927\u90e8\u5206\u6240\u8981\u8ba8\u8bba\u7684\u95ee\u9898\u662f\u5982\u4e0b\u7684\uff08\u9759\u6001\uff09\u6700\u4f18\u5316\u95ee\u9898\uff1a \\[ \\min_{x \\in \\Omega}{f(\\mathbf{x})} \\\\ s.t. \\ \\ \\ s_i(\\mathbf{x}) \\ge 0 \\ \\ \\ i = 1, 2, ..., m \\\\ h_j(\\mathbf{x}) = 0 \\ \\ \\ j = 1, 2, .., l \\ (l < n) \\] \u5411\u91cf\u8868\u793a\u6cd5\u5199\u6210\uff1a \\[ \\min_{x \\in \\Omega}{f(\\mathbf{x})} \\\\ s.t. \\ \\ \\ \\mathbf{s}(\\mathbf{x}) \\ge \\mathbf{0} \\\\ \\mathbf{h}(x) = \\mathbf{0} \\\\ \u5176\u4e2d \\ \\ \\ \\mathbf{s}(\\mathbf(x)) = (s_1(\\mathbf{x}), ..., s_m(\\mathbf{x}))^{\\top} \\] \u8fd9\u79cd\u95ee\u9898\u79f0\u4e3a \u975e\u7ebf\u6027\u89c4\u5212 \uff0c\u6bd4\u5177\u6709\u7b49\u5f0f\u7ea6\u675f\u7684\u6781\u503c\u95ee\u9898\u4ec5\u591a\u51fa \\(m\\) \u4e2a\u4e0d\u7b49\u5f0f\u7ea6\u675f\u3002\u4f46\u662f\uff0c\u6240\u8c13\u7ecf\u5178\u95ee\u9898\u4e0e\u8fd1\u4ee3\u95ee\u9898\u7684\u754c\u9650\u4e5f\u5c31\u5728\u8fd9\u91cc\u3002 \u4e00\u4e9b\u672f\u8bed \u6ee1\u8db3\u6240\u6709\u7ea6\u675f\u7684\u5411\u91cf \\(\\mathbf{x}\\) \u79f0\u4e3a \u5bb9\u8bb8\u89e3 \u6216 \u5bb9\u8bb8\u70b9 \u3002 \u5bb9\u8bb8\u70b9 \u7684\u96c6\u5408\u79f0\u4e3a \u5bb9\u8bb8\u96c6 \u3002 \\(\\mathbf{x}^*\\) \u79f0\u4e3a\u95ee\u9898\u7684\u6700\u4f18\u70b9\uff0c\u800c\u76f8\u5e94\u7684\u76ee\u6807\u51fd\u6570\u503c \\(f(\\mathbf{x}^*)\\) \u79f0\u4e3a\u6700\u4f18\u503c\uff0c \\((\\mathbf{x}^*, f(\\mathbf{x}^*))\\) \u79f0\u4e3a\u6700\u4f18\u89e3\u3002 \u5206\u7c7b \u00b6 \\[ \u6700\u4f18\u5316\u95ee\u9898 \\left\\{\\begin{matrix} \u9759\u6001\u95ee\u9898 \\left\\{\\begin{matrix} \u65e0\u7ea6\u675f\u95ee\u9898 \\left\\{\\begin{matrix} \u4e00\u7ef4\u95ee\u9898 \\\\ n\u7ef4\u95ee\u9898 \\end{matrix}\\right. \\\\ \u7ea6\u675f\u95ee\u9898 \\left\\{\\begin{matrix} \u7ebf\u6027\u89c4\u5212 \\\\ \u975e\u7ebf\u6027\u89c4\u5212 \\end{matrix}\\right. \\end{matrix}\\right. \\\\ \u52a8\u6001\u95ee\u9898 \\end{matrix}\\right. \\] \u4e8c\u7ef4\u95ee\u9898\u7684\u56fe\u89e3\u6cd5 \u00b6 \u7b49\u503c\u7ebf \u00b6 \u7528\u5e73\u9762 \\(L\\) \u53bb\u622a\u66f2\u9762 \\(S\\) \u5f97\u5230\u7684\u662f\u4e00\u4e2a\u5706\uff0c\u8fd9\u4e2a\u5706\u53c8\u4e00\u4e2a\u91cd\u8981\u7684\u6027\u8d28\uff1a \u5706\u4e0a\u4efb\u4f55\u4e00\u70b9\u7684\u76ee\u6807\u51fd\u6570\u90fd\u7b49\u4e8e \\(f_0\\) \u3002\u50cf\u8fd9\u6837\u7684\u66f2\u7ebf\uff0c\u5176\u4e0a\u4efb\u4f55\u4e00\u70b9\u7684\u76ee\u6807\u51fd\u6570\u503c\u90fd\u7b49\u4e8e\u540c\u4e00\u5e38\u6570\uff0c\u79f0\u4e3a\u76ee\u6807\u51fd\u6570\u7684 \u7b49\u503c\u7ebf \u3002 \u56fe\u89e3\u6cd5 \\[ \u6c42\u89e3\\min{(x_1-2)^2+(x_2-1)^2} \\\\ s.t. \\ \\ \\ x_1+x_2-5=0 \\] \u5148\u753b\u51fa\u76ee\u6807\u51fd\u6570\u7684\u7b49\u503c\u7ebf\uff0c\u518d\u753b\u51fa\u7ea6\u675f\u66f2\u7ebf\u3002\u5b9e\u9645\u4e0a\u7ea6\u675f\u66f2\u7ebf\u662f\u4e00\u6761\u76f4\u7ebf\uff0c\u8fd9\u6761\u76f4\u7ebf\u5c31\u662f\u5bb9\u8bb8\u96c6\u3002\u56e0\u4e3a\u6700\u4f18\u70b9\u662f\u5bb9\u8bb8\u96c6\u4e0a\u4f7f\u5f97\u7b49\u503c\u7ebf\u5177\u6709\u6700\u5c0f\u503c\u7684\u70b9\uff0c\u7531\u4e0b\u5de6\u56fe\u53ef\u4ee5\u770b\u51fa\uff0c\u7ea6\u675f\u76f4\u7ebf\u4e0e\u7b49\u503c\u7ebf\uff08\u5706\uff09\u7684\u5207\u70b9\u6b63\u662f\u6700\u4f18\u70b9\u3002\u5229\u7528\u89e3\u6790\u51e0\u4f55\u7684\u6709\u5173\u65b9\u6cd5\u53ef\u6c42\u7684\u8be5\u70b9\u662f \\(\\mathbf{x}^x=(3,2)^{\\top}\\) \uff0c\u5b83\u6240\u5bf9\u5e94\u7684\u6700\u4f18\u503c\u662f \\(f(\\mathbf{x}^*)=2\\) \u3002 \u5c06\u65e0\u7ea6\u675f\u95ee\u9898\u548c\u7ea6\u675f\u95ee\u9898\u7684\u51e0\u4f55\u56fe\u5f62\u5408\u5728\u4e00\u8d77\uff0c\u5982\u4e0b\u53f3\u56fe\u6240\u793a\u3002 \u5bf9\u4e8e\u4e8c\u7ef4\u6700\u4f18\u5316\u95ee\u9898\uff0c\u53ef\u4ee5\u7528\u56fe\u89e3\u6cd5\u6c42\u89e3\u3002 \u7b49\u503c\u9762 \u00b6 \u5bf9\u4e8e\u4e09\u7ef4\u53ca\u4ee5\u4e0a\u7684\u7a7a\u95f4\uff0c\u4f7f\u76ee\u6807\u51fd\u6570\u53d6\u540c\u4e00\u5e38\u6570\u503c\u7684\u70b9\u96c6 \\(\\{ \\mathbf{x} | f(\\mathbf{x})= \\gamma , \\gamma\u662f\u5e38\u6570 \\}\\) \u79f0\u4e3a \u7b49\u503c\u9762 \u3002\u5177\u6709\u4e00\u4e0b\u6027\u8d28\uff1a \u6709\u4e0d\u540c\u503c\u7684\u7b49\u503c\u9762\u4e4b\u95f4\u4e0d\u76f8\u4ea4\u3002 \u9664\u91cc\u6781\u503c\u70b9\u6240\u5728\u7684\u7b49\u503c\u9762\u4ee5\u5916\uff0c\u4e0d\u4f1a\u5728\u533a\u57df\u7684\u5185\u90e8\u4e2d\u65ad\u3002 \u7b49\u503c\u9762\u7a20\u5bc6\u7684\u5730\u65b9\uff0c\u76ee\u6807\u51fd\u6570\u503c\u53d8\u5316\u5f97\u6bd4\u8f83\u5feb\uff1b\u7a00\u758f\u7684\u5730\u65b9\u53d8\u5316\u5f97\u6bd4\u8f83\u6162\u3002 \u5728\u6781\u503c\u70b9\u9644\u8fd1\uff0c\u7b49\u503c\u9762\uff08\u7ebf\uff09\u8fd1\u4f3c\u5730\u5448\u73b0\u4e3a\u540c\u5fc3\u692d\u7403\u9762\u65cf\u3002 \u4e8c\u6b21\u51fd\u6570 \u00b6 \u5728 \\(n\\) \u5143\u76ee\u6807\u51fd\u6570\u4e2d\uff0c\u9664\u91cc\u7ebf\u6027\u51fd\u6570\uff0c\u6700\u7b80\u5355\u6700\u91cd\u8981\u7684\u4e00\u7c7b\u5c31\u662f\u4e8c\u6b21\u51fd\u6570\u3002 \u4e00\u822c\u5f62\u5f0f\u662f \\[ f(x_1, x_2, ..., x_n)=\\frac{1}{2} \\sum_{i=1}^n \\sum_{j=1}^m q_{ij}x_ix_j+\\sum_{i=1}^nb_ix_i+c \\] \u77e9\u9635\u5f62\u5f0f\u662f \\[ f(\\mathbf{x})=\\frac{1}{2}\\mathbf{x}^{\\top}\\mathbf{Q}\\mathbf{x}+\\mathbf{b}^{\\top}\\mathbf{x}+c \\\\ \u5176\u4e2d \\ \\ \\ \\mathbf{Q} = \\begin{bmatrix} q_{11} & q_{12} & ... & q_{1n} \\\\ q_{21} & q_{22} & ... & q_{2n} \\\\ ... & ... & ... & ... \\\\ q_{n1} & q_{n2} & ... & q_{nn} \\end{bmatrix} , \\ \\ \\mathbf{b} = \\begin{bmatrix} b_1 \\\\ b_2 \\\\ ... \\\\ b_n \\end{bmatrix} \\] \u8fd9\u91cc \\(\\mathbf{Q}\\) \u662f\u5bf9\u79f0\u77e9\u9635\uff08\u4e8c\u6b21\u578b\uff09\u3002 \u68af\u5ea6\u4e0e Hesse \u77e9\u9635 \u00b6 \u68af\u5ea6 \u00b6 \u5b9a\u4e49 \u00b6 \u51fd\u6570 \\(f(\\mathbf{x})\\) \u5728 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae \\[ f(\\mathbf{x}_0 + \\mathbf{p})-f(\\mathbf{x}_0) = \\mathbf{l}^{\\top}\\mathbf{p} + o(||\\mathbf{p}||) \\] \u82e5 \\(f(\\mathbf{x})\\) \u5728 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae\uff0c\u5219 \\(f(\\mathbf{x})\\) \u5728\u8be5\u70b9\u5173\u4e8e\u5404\u53d8\u91cf\u7684\u4e00\u9636\u504f\u5bfc\u6570\u5b58\u5728\uff0c\u5e76\u4e14 \\[ \\mathbf{l} = (\\frac{\\partial f(\\mathbf{x}_0)}{\\partial x_1}, \\frac{\\partial f(\\mathbf{x}_0)}{\\partial x_2}, ..., \\frac{\\partial f(\\mathbf{x}_0)}{\\partial x_n})^{\\top} \\] \u4ee5 \\(f(\\mathbf{x})\\) \u7684 \\(n\\) \u4e2a\u504f\u5bfc\u6570\u4e3a\u5206\u91cf\u7684\u5411\u91cf\u79f0\u4e3a \\(f(\\mathbf{x})\\) \u5728 \\(\\mathbf{x}\\) \u5904\u7684\u68af\u5ea6 \\[ \\bigtriangledown f(\\mathbf{x}) = (\\frac{\\partial f(\\mathbf{x})}{\\partial x_1}, \\frac{\\partial f(\\mathbf{x})}{\\partial x_2}, ..., \\frac{\\partial f(\\mathbf{x})}{\\partial x_n})^{\\top} \\] \u6027\u8d28 \u00b6 \u8fc7\u70b9 \\(\\mathbf{x}_0\\) \u7684\u7b49\u503c\u9762\u65b9\u7a0b\u4e3a \\(f(\\mathbf{x}) = f(\\mathbf{x}_0) \u6216 f(x_1, x_2, ..., x_n) = \\gamma_0 \\ \\ \\ \u5176\u4e2d \\ \\gamma_0 = f(\\mathbf{x}_0)\\) \u3002 \u8bbe \\(f: R^n \\to R^1\\) \u5728\u70b9 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae\uff0c \\(\\mathbf{p}\\) \u662f\u56fa\u5b9a\u4e0d\u53d8\u7684\u5411\u91cf\uff0c \\(\\mathbf{e}\\) \u662f\u65b9\u5411 \\(\\mathbf{p}\\) \u4e0a\u7684\u5355\u4f4d\u5411\u91cf\uff0c\u5219\u79f0\u6781\u9650 \\(\\frac{\\partial f(\\mathbf{x}_0)}{\\partial \\mathbf{p}} = \\lim_{t \\to 0^+} \\frac{f(\\mathbf{x}_0+t\\mathbf{e})-f(\\mathbf{x}_0)}{t}\\) \u4e3a\u51fd\u6570 \\(f(\\mathbf{x})\\) \u5728\u70b9 \\(\\mathbf{x}_0\\) \u5904\u6cbf \\(\\mathbf{p}\\) \u65b9\u5411\u7684\u65b9\u5411\u5bfc\u6570\u3002 \u8bbe \\(f:R^n \\to R^1\\) \u5728\u70b9 \\(\\mathbf{x}_0\\) \u5904\u53ef\u5fae\uff0c\u5219 \\(\\frac{\\partial f(\\mathbf{x}_0)}{\\partial \\mathbf{p}} = \\bigtriangledown f(\\mathbf{x}_0)^{\\top}\\mathbf{e}\\) \u3002\u5176\u4e2d \\(\\mathbf{e}\\) \u662f \\(\\mathbf{p}\\) \u65b9\u5411\u4e0a\u7684\u5355\u4f4d\u5411\u91cf\u3002 \u7279\u6b8a\u7c7b\u578b\u51fd\u6570\u7684\u68af\u5ea6 \u00b6 \u82e5 \\(f(\\mathbf{x})=C\\) (\u5e38\u6570)\uff0c\u5219 \\(\\bigtriangledown f(\\mathbf{x})=\\mathbf{0}\\) \uff0c\u5373 \\(\\bigtriangledown C = \\mathbf{0}\\) \\(\\bigtriangledown (\\mathbf{b}^{\\top}\\mathbf{x})=\\mathbf{b}\\) \\(\\bigtriangledown (\\mathbf{x}^{\\top}\\mathbf{x})=2\\mathbf{x}\\) \u82e5 \\(\\mathbf{Q}\\) \u662f\u5bf9\u79f0\u65b9\u9635\uff0c\u5219 \\(\\bigtriangledown (\\mathbf{x}^{\\top}\\mathbf{Q}\\mathbf{x})=2\\mathbf{Q}\\mathbf{x}\\) Hesse \u77e9\u9635 \u00b6 \u591a\u5143\u51fd\u6570 \\(f(\\mathbf{x})\\) \u7684\u4e00\u9636\u5bfc\u6570\u662f\u5b83\u7684\u68af\u5ea6 \\(\\bigtriangledown f(\\mathbf{x})\\) \uff0c\u4e8c\u9636\u5bfc\u6570\u662f\u5b83\u7684 Hesse \u77e9\u9635 \\(\\bigtriangledown^2f(\\mathbf{x})\\) \u3002 \\[ \\bigtriangledown^2 f(\\mathbf{x})=\\bigtriangledown(\\bigtriangledown f(\\mathbf{x}))= \\begin{bmatrix} \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_1^2} & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_2 \\partial x_1} & ... & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_n \\partial x_1} \\\\ \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_1 \\partial x_2} & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_2^2} & ... & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_n \\partial x_2} \\\\ ... & ... & ... & ... \\\\ \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_1 \\partial x_n} & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_2 \\partial x_n} & ... & \\frac{\\partial^2 f(\\mathbf{x})}{\\partial x_n^2} \\\\ \\end{bmatrix} \\] \u5e38\u7528\u516c\u5f0f\uff1a \\(\\bigtriangledown \\mathbf{c}=\\mathbf{O}\\) \uff0c\u5176\u4e2d \\(\\mathbf{c}\\) \u662f\u5206\u91cf\u5168\u4e3a\u5e38\u6570\u7684 \\(n\\) \u7ef4\u5411\u91cf\uff0c \\(\\mathbf{O}\\) \u662f \\(n \\times n\\) \u9636\u96f6\u77e9\u9635\u3002 \\(\\bigtriangledown \\mathbf{x} = \\mathbf{I}\\) \uff0c\u5176\u4e2d \\(\\mathbf{x}\\) \u662f \\(n\\) \u7ef4\u5411\u91cf\uff0c \\(\\mathbf{I}\\) \u662f \\(n \\times n\\) \u9636\u5355\u4f4d\u77e9\u9635\u3002 \\(\\bigtriangledown (\\mathbf{Q}\\mathbf{x})=\\mathbf{Q}\\) \uff0c\u5176\u4e2d \\(\\mathbf{Q}\\) \u662f \\(n \\times n\\) \u9636\u77e9\u9635\u3002 \u8bbe \\(\\varphi (t)=f(\\mathbf{x}_0 + t\\mathbf{p})\\) \uff0c\u5176\u4e2d \\(f:R^n \\to R^1, \\varphi: R^{\\top} \\to R^1\\) \uff0c\u5219 \\[ \\varphi^\\prime(t)=\\bigtriangledown f(\\mathbf{x}_0 + t\\mathbf{p})^{\\top}\\mathbf{p} \\\\ \\varphi^{\\prime \\prime}(t)=\\mathbf{p}^{\\top}\\bigtriangledown^2f(\\mathbf{x}_0+t\\mathbf{p})\\mathbf{p} \\] \u591a\u5143\u51fd\u6570\u7684 Taylor \u5c55\u5f00\u5f0f \u00b6 \u8bbe \\(f:R^n \\to R^1\\) \u5177\u6709\u4e8c\u9636\u8fde\u7eed\u504f\u5bfc\u6570\uff0c\u5219 \\[ f(\\mathbf{x}+\\mathbf{p})=f(\\mathbf{x})+\\bigtriangledown f(\\mathbf{x})^{\\top}\\mathbf{p}+\\frac{1}{2}\\mathbf{p}^{\\top}\\bigtriangledown^2f(\\bar{\\mathbf{x}})\\mathbf{p} \\\\ \u5176\u4e2d\\bar{\\mathbf{x}}=\\mathbf{x}+\\theta \\mathbf{p}\uff0c\u800c0 < \\theta < 1 \\] \u51f8\u96c6\u4e0e\u51f8\u51fd\u6570 \u00b6 \u51f8\u96c6 \u00b6 \u8bbe \\(x_1, x_2, ..., x_l\\) \u662f \\(R^n\\) \u4e2d\u7684 \\(l\\) \u4e2a\u5df2\u77e5\u70b9\u3002\u82e5\u5bf9\u67d0\u70b9 \\(x \\in R^n\\) \u5b58\u5728\u5e38\u6570 \\(a_1, a_2, ..., a_l \\ge 0\\) \u4e14 \\(\\sum_{i=1}^la_i=1\\) \u4f7f\u5f97 \\(x=\\sum_{i=1}^la_ix_i\\) \uff0c\u5219\u79f0 \\(x\\) \u662f \\(x_1, x_2,...,x_l\\) \u7684\u51f8\u7ec4\u5408\u3002\u82e5 \\(a_1, a_2, ..., a_l > 0\\) \u4e14 \\(\\sum_{i=1}^la_i=1\\) \uff0c\u5219\u79f0 \\(x\\) \u662f \\(x_1, x_2, ..., x_l\\) \u7684\u4e25\u683c\u51f8\u7ec4\u5408\u3002 \u8bbe\u96c6\u5408 \\(C \\subseteq R^n\\) \uff0c\u5982\u679c\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \uff0c\u5b83\u4eec\u7684\u4efb\u610f\u51f8\u7ec4\u5408\u4ecd\u7136\u5c5e\u4e8e C\uff0c\u90a3\u4e48\u79f0\u96c6\u5408 C \u4e3a\u51f8\u96c6\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u8d85\u5e73\u9762\uff0c \\(\\alpha\\) \u79f0\u4e3a\u8fd9\u4e2a\u8d85\u5e73\u9762\u7684\u6cd5\u5411\u91cf\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u534a\u7a7a\u95f4\u3002 \u4efb\u610f\u4e00\u7ec4\u51f8\u96c6\u7684\u4ea4\u4ecd\u7136\u662f\u51f8\u96c6\u3002 \u51f8\u51fd\u6570 \u00b6 \u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\u3002\u82e5\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \u548c\u4efb\u610f\u4e00\u5bf9\u6ee1\u8db3 \\(\\alpha_1 + \\alpha_2 = 1\\) \u7684\u6570 \\(\\alpha_1, \\alpha_2 \\in [0,1]\\) \u90fd\u6709 \\(f(\\alpha_1x_1+\\alpha_2x_2) \\le \\alpha_1f(x_1)+\\alpha_2f(x_2)\\) \uff0c\u5219\u79f0 f \u4e3a\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\u51f8\u51fd\u6570\uff08\u4e25\u683c\u5c0f\u4e8e\u65f6\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09 \u82e5\u51fd\u6570 f \u5728\u51f8\u96c6 C \u4e0a\u662f\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\uff0c\u5219\u79f0 f \u662f\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\u3002 \u8bbe \\(f: C \\subset R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u975e\u7a7a\u51f8\u96c6\u3002\u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5bf9\u4e8e\u4efb\u610f\u5b9e\u6570 \\(\\beta\\) \uff0c\u6c34\u5e73\u96c6 \\(D_\\beta = \\{x | f(x) \\le \\beta, x \\in C\\}\\) \u662f\u51f8\u96c6\u3002 \u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u662f\u975e\u7a7a\u51f8\u96c6\uff0cf \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5f62\u5f0f\u4e3a \\(\\min f(x) \\ s.t. \\ x \\in C\\) \u7684\u95ee\u9898\u79f0\u4e3a\u51f8\u89c4\u5212\u3002 \u8bbe \\(x^\\prime\\) \u662f\u51f8\u89c4\u5212\u7684\u5c40\u90e8\u6781\u5c0f\u70b9 \u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u5168\u5c40\u6781\u5c0f\u70b9 \u82e5 f \u662f\u4e25\u683c\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u552f\u4e00\u5168\u5c40\u6700\u5c0f\u70b9 \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u53ef\u5fae\u51fd\u6570\uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\uff0c\u5219 f \u4e3a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u90fd\u6709 $f(x_2) \\ge f(x_1) + \\(\\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) f \u662f\u4e25\u683c\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u4e14 \\(x_1 \\ne x_2\\) \u90fd\u6709 \\(f(x_2) > f(x_1) + \\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u4e8c\u6b21\u53ef\u5fae\u51fd\u6570\uff0cC \u4e3a\u975e\u7a7a\u5f00\u51f8\u96c6\uff0c\u5219 f \u4e3a C \u4e0a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c Hesse \u77e9\u9635 \\(\\bigtriangledown^2 f(x)\\) \u5728 C \u4e0a\u5230\u5904\u534a\u6b63\u5b9a\uff08\u6ee1\u8db3\u534a\u6b63\u5b9a\u65f6\uff0c\u5219 f \u5728 C\u4e0a\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09\u3002 \u6781\u5c0f\u70b9\u7684\u5224\u5b9a\u6761\u4ef6 \u00b6 \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u504f\u5bfc\u6570\u3002\u82e5 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u5c40\u90e8\u6781\u5c0f\u70b9\u5e76\u4e14\u662f D \u7684\u5185\u70b9\uff0c\u5219 \\(\\bigtriangledown f(x^\\prime) = 0\\) \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \uff0c \\(x^\\prime\\) \u662f D \u7684\u54ea\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime) = 0\\) \uff0c\u5219 \\(x^\\prime\\) \u79f0\u4e3a \\(f(x)\\) \u7684\u9a7b\u70b9\u3002 \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u504f\u5bfc\u6570\uff0c \\(x^\\prime\\) \u662f D \u7684\u4e00\u4e2a\u5185\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime)=0\\) \u5e76\u4e14 \\(\\bigtriangledown^2 f(x^\\prime)\\) \u662f\u6b63\u5b9a\u7684\uff0c\u5219 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u4e25\u683c\u5c40\u90e8\u6781\u5c0f\u70b9\u3002 \u4e0b\u964d\u8fed\u4ee3\u7b97\u6cd5 \u00b6 \u7ed9\u5b9a\u521d\u59cb\u70b9\u540e\uff0c\u5982\u679c\u6bcf\u8fed\u4ee3\u4e00\u6b65\u90fd\u4f7f\u76ee\u6807\u51fd\u6570\u6709\u6240\u4e0b\u964d\uff0c\u5373 \\(f(\\mathbf{x}_{k+1}) < f(\\mathbf{x}_k)\\) \uff0c\u90a3\u8fd9\u79cd\u8fed\u4ee3\u6cd5\u79f0\u4e3a\u4e0b\u964d\u6cd5\u3002 \u5728\u8fed\u4ee3\u8fc7\u7a0b\u4e2d\u6709\u4e24\u4e2a\u89c4\u5219\u9700\u8981\u786e\u5b9a\uff0c\u4e00\u4e2a\u662f\u4e0b\u964d\u65b9\u5411 \\(\\mathbf{p}_k\\) \u7684\u9009\u53d6\uff1b\u4e00\u4e2a\u662f\u6b65\u957f\u56e0\u5b50 \\(t_k\\) \u7684\u9009\u53d6\u3002 \u7b97\u6cd5\u7684\u57fa\u672c\u683c\u5f0f\u5982\u4e0b\uff1a \u9009\u53d6\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u7f6e \\(k=0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(\\mathbf{p}_k\\) \u4f7f\u5f97 \\(\\bigtriangledown f(\\mathbf{x}_k)^{\\top} \\mathbf{p}_k < 0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(t_k\\) \u4f7f\u5f97 \\(f(\\mathbf{x}_k+t_k\\mathbf{p}_k) 0\\) \u4e14 \\(\\sum_{i=1}^la_i=1\\) \uff0c\u5219\u79f0 \\(x\\) \u662f \\(x_1, x_2, ..., x_l\\) \u7684\u4e25\u683c\u51f8\u7ec4\u5408\u3002 \u8bbe\u96c6\u5408 \\(C \\subseteq R^n\\) \uff0c\u5982\u679c\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \uff0c\u5b83\u4eec\u7684\u4efb\u610f\u51f8\u7ec4\u5408\u4ecd\u7136\u5c5e\u4e8e C\uff0c\u90a3\u4e48\u79f0\u96c6\u5408 C \u4e3a\u51f8\u96c6\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u8d85\u5e73\u9762\uff0c \\(\\alpha\\) \u79f0\u4e3a\u8fd9\u4e2a\u8d85\u5e73\u9762\u7684\u6cd5\u5411\u91cf\u3002 \u8bbe\u96c6\u5408 \\(\\alpha \\in R^n\\) \u4e14 \\(\\alpha \\ne 0, b \\in R^1\\) \uff0c\u5219\u96c6\u5408 \\(\\{x | \\alpha^{\\top}x=b,x \\in R^n\\}\\) \u79f0\u4e3a \\(R^n\\) \u4e2d\u7684\u534a\u7a7a\u95f4\u3002 \u4efb\u610f\u4e00\u7ec4\u51f8\u96c6\u7684\u4ea4\u4ecd\u7136\u662f\u51f8\u96c6\u3002","title":"\u51f8\u96c6"},{"location":"mb/optimization-theory/lec1/#_19","text":"\u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\u3002\u82e5\u5bf9\u4e8e\u4efb\u610f\u4e24\u70b9 \\(x_1, x_2 \\in C\\) \u548c\u4efb\u610f\u4e00\u5bf9\u6ee1\u8db3 \\(\\alpha_1 + \\alpha_2 = 1\\) \u7684\u6570 \\(\\alpha_1, \\alpha_2 \\in [0,1]\\) \u90fd\u6709 \\(f(\\alpha_1x_1+\\alpha_2x_2) \\le \\alpha_1f(x_1)+\\alpha_2f(x_2)\\) \uff0c\u5219\u79f0 f \u4e3a\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\u51f8\u51fd\u6570\uff08\u4e25\u683c\u5c0f\u4e8e\u65f6\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09 \u82e5\u51fd\u6570 f \u5728\u51f8\u96c6 C \u4e0a\u662f\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\uff0c\u5219\u79f0 f \u662f\u5b9a\u4e49\u5728\u51f8\u96c6 C \u4e0a\u7684\uff08\u4e25\u683c\uff09\u51f8\u51fd\u6570\u3002 \u8bbe \\(f: C \\subset R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u4e3a\u975e\u7a7a\u51f8\u96c6\u3002\u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5bf9\u4e8e\u4efb\u610f\u5b9e\u6570 \\(\\beta\\) \uff0c\u6c34\u5e73\u96c6 \\(D_\\beta = \\{x | f(x) \\le \\beta, x \\in C\\}\\) \u662f\u51f8\u96c6\u3002 \u8bbe \\(f: C \\subseteq R^n \\to R^1\\) \uff0c\u5176\u4e2d C \u662f\u975e\u7a7a\u51f8\u96c6\uff0cf \u662f\u51f8\u51fd\u6570\uff0c\u5219\u5f62\u5f0f\u4e3a \\(\\min f(x) \\ s.t. \\ x \\in C\\) \u7684\u95ee\u9898\u79f0\u4e3a\u51f8\u89c4\u5212\u3002 \u8bbe \\(x^\\prime\\) \u662f\u51f8\u89c4\u5212\u7684\u5c40\u90e8\u6781\u5c0f\u70b9 \u82e5 f \u662f\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u5168\u5c40\u6781\u5c0f\u70b9 \u82e5 f \u662f\u4e25\u683c\u51f8\u51fd\u6570\uff0c\u5219 \\(x^\\prime\\) \u662f\u552f\u4e00\u5168\u5c40\u6700\u5c0f\u70b9 \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u53ef\u5fae\u51fd\u6570\uff0c\u5176\u4e2d C \u4e3a\u51f8\u96c6\uff0c\u5219 f \u4e3a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u90fd\u6709 $f(x_2) \\ge f(x_1) + \\(\\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) f \u662f\u4e25\u683c\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c \\(\\forall x_1, x_2 \\in C\\) \u4e14 \\(x_1 \\ne x_2\\) \u90fd\u6709 \\(f(x_2) > f(x_1) + \\bigtriangledown f(x_1)^{\\top}(x_2-x_1)\\) \u8bbe \\(f:C \\subseteq R^n \\to R^1\\) \u662f\u4e8c\u6b21\u53ef\u5fae\u51fd\u6570\uff0cC \u4e3a\u975e\u7a7a\u5f00\u51f8\u96c6\uff0c\u5219 f \u4e3a C \u4e0a\u51f8\u51fd\u6570\u7684\u5145\u8981\u6761\u4ef6\u662f\uff0c Hesse \u77e9\u9635 \\(\\bigtriangledown^2 f(x)\\) \u5728 C \u4e0a\u5230\u5904\u534a\u6b63\u5b9a\uff08\u6ee1\u8db3\u534a\u6b63\u5b9a\u65f6\uff0c\u5219 f \u5728 C\u4e0a\u4e3a\u4e25\u683c\u51f8\u51fd\u6570\uff09\u3002","title":"\u51f8\u51fd\u6570"},{"location":"mb/optimization-theory/lec1/#_20","text":"\u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u504f\u5bfc\u6570\u3002\u82e5 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u5c40\u90e8\u6781\u5c0f\u70b9\u5e76\u4e14\u662f D \u7684\u5185\u70b9\uff0c\u5219 \\(\\bigtriangledown f(x^\\prime) = 0\\) \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \uff0c \\(x^\\prime\\) \u662f D \u7684\u54ea\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime) = 0\\) \uff0c\u5219 \\(x^\\prime\\) \u79f0\u4e3a \\(f(x)\\) \u7684\u9a7b\u70b9\u3002 \u8bbe \\(f:D \\subseteq R^n \\to R^1\\) \u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u504f\u5bfc\u6570\uff0c \\(x^\\prime\\) \u662f D \u7684\u4e00\u4e2a\u5185\u70b9\u3002\u82e5 \\(\\bigtriangledown f(x^\\prime)=0\\) \u5e76\u4e14 \\(\\bigtriangledown^2 f(x^\\prime)\\) \u662f\u6b63\u5b9a\u7684\uff0c\u5219 \\(x^\\prime\\) \u662f \\(f(x)\\) \u7684\u4e25\u683c\u5c40\u90e8\u6781\u5c0f\u70b9\u3002","title":"\u6781\u5c0f\u70b9\u7684\u5224\u5b9a\u6761\u4ef6"},{"location":"mb/optimization-theory/lec1/#_21","text":"\u7ed9\u5b9a\u521d\u59cb\u70b9\u540e\uff0c\u5982\u679c\u6bcf\u8fed\u4ee3\u4e00\u6b65\u90fd\u4f7f\u76ee\u6807\u51fd\u6570\u6709\u6240\u4e0b\u964d\uff0c\u5373 \\(f(\\mathbf{x}_{k+1}) < f(\\mathbf{x}_k)\\) \uff0c\u90a3\u8fd9\u79cd\u8fed\u4ee3\u6cd5\u79f0\u4e3a\u4e0b\u964d\u6cd5\u3002 \u5728\u8fed\u4ee3\u8fc7\u7a0b\u4e2d\u6709\u4e24\u4e2a\u89c4\u5219\u9700\u8981\u786e\u5b9a\uff0c\u4e00\u4e2a\u662f\u4e0b\u964d\u65b9\u5411 \\(\\mathbf{p}_k\\) \u7684\u9009\u53d6\uff1b\u4e00\u4e2a\u662f\u6b65\u957f\u56e0\u5b50 \\(t_k\\) \u7684\u9009\u53d6\u3002 \u7b97\u6cd5\u7684\u57fa\u672c\u683c\u5f0f\u5982\u4e0b\uff1a \u9009\u53d6\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u7f6e \\(k=0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(\\mathbf{p}_k\\) \u4f7f\u5f97 \\(\\bigtriangledown f(\\mathbf{x}_k)^{\\top} \\mathbf{p}_k < 0\\) \u6309\u67d0\u79cd\u89c4\u5219\u786e\u5b9a \\(t_k\\) \u4f7f\u5f97 \\(f(\\mathbf{x}_k+t_k\\mathbf{p}_k) \\varphi(t_2) \\\\ \u5f53t_1 \\ge t^*\u65f6\uff0c\\varphi(t_1) < \\varphi(t_2) \\] \u5219\u79f0 \\(\\varphi(t)\\) \u662f\u533a\u95f4 \\(L\\) \u4e0a\u7684\u5355\u8c37\u51fd\u6570\u3002 \u8bbe \\(\\varphi \\subset R^1 \\to R^1\\) \uff0c \\(t^*\\) \u662f \\(\\varphi (t)\\) \u5728 \\(L\\) \u4e0a\u7684\u5168\u5c40\u6700\u5c0f\u70b9\u3002\u5982\u679c\u627e\u5230 \\(t_1 \\in L\\) \u548c \\(t_2 \\in L\\) \u4f7f\u5f97 \\(t_1 < t^* < t_2\\) \uff0c\u5219 \\([t_1, t_2]\\) \u4e3a \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\uff0c\u8bb0\u4e3a \\(\\{t_1, t_2\\}\\) \u3002 \u8bbe \\(\\{a,b\\}\\) \u662f\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\u3002\u5728 \\((a,b)\\) \u4e0a\u4efb\u53d6\u4e24\u70b9 \\(t_1\\) \u548c \\(t_2\\) \u4e14 \\(t_1 \\varphi(t_2)\\) \uff0c\u5219 \\(\\{t_1, b\\}\\) \u662f \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u7a7a\u95f4\u3002 \u641c\u7d22\u533a\u95f4\u7684\u786e\u5b9a \u9009\u5b9a\u521d\u59cb\u70b9 \\(t_0\\) \u548c\u6b65\u957f \\(h\\) \u8ba1\u7b97\u5e76\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0+h)\\) \uff0c\u6709 3\uff0c4 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)<\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0-h)\\) \uff0c\u6709 5\uff0c6 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)\\ge\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0+(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0+(2^{m-1}-1)^h) \\ge \\varphi(t_0+(2^m-1)^h) < \\varphi(t_0+(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0+(2^{m-1}-1)^h), v=\\varphi(t_0+(2^{m}-1)^h), w=\\varphi(t_0+(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{u,v,r\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{v,r,w\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h) > \\varphi(t_0)\\) \u65f6\uff0c\u53d6 \\(\\{t_0-h,t_0,t_0+h\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h)\\le\\varphi(t_0)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0-(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0-(2^{m-1}-1)^h) \\ge \\varphi(t_0-(2^m-1)^h) < \\varphi(t_0-(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0-(2^{m-1}-1)^h), v=\\varphi(t_0-(2^{m}-1)^h), w=\\varphi(t_0-(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{w,r,v\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{r,v,u\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u6b65\u957f\u7684\u9009\u62e9 \u5bf9\u5206\u6cd5 \u00b6 \u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u5b83\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \u548c \\(\\varphi^\\prime(t)\\) \u7684\u8868\u8fbe\u5f0f\uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \uff0c\u8981\u6c42 \\(\\varphi^\\prime(a)<0,\\varphi^\\prime(b)>0\\) \u8ba1\u7b97 \\(\\{a,b\\}\\) \u7684\u4e2d\u70b9 \\(c=0.5(a+b)\\) \u82e5 \\(\\varphi^\\prime(c)<0\\) \uff0c\u5219 \\(a=c\\) \uff0c\u8f6c 4\uff1b\u82e5 \\(\\varphi^\\prime(c)=0\\) \uff0c\u5219 \\(t^*=c\\) \uff0c\u8f6c 5\uff1b\u82e5 \\(\\varphi^\\prime(c)>0\\) \uff0c\u5219 \\(b=c\\) \uff0c\u8f6c4 \u82e5 \\(|a-b|<\\varepsilon\\) \uff0c\u5219 \\(t^*=0.5(a+b)\\) \uff0c\u8f6c 5\uff0c\u5426\u5219\u8f6c 2 \u6253\u5370 \\(t^*\\) \uff0c\u505c\u673a Newton \u5207\u7ebf\u6cd5 \u00b6 \u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u4e00\u9636\u548c\u4e8c\u9636\u5bfc\u6570\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b \u8bbe\u5728\u533a\u95f4 \\([a,b]\\) \u4e2d\u7ecf\u8fc7 \\(k\\) \u6b21\u8fed\u4ee3\u5df2\u6c42\u5230\u65b9\u7a0b \\(\\varphi^\\prime(t)=0\\) \u7684\u4e00\u4e2a\u8fd1\u6839\u4f3c \\(t_k\\) \u3002\u8fc7 \\((t_k,\\varphi^\\prime(t_k))\\) \u4f5c\u66f2\u7ebf \\(y=\\varphi^\\prime(t)\\) \u7684\u5207\u7ebf\uff0c\u5176\u65b9\u7a0b\u662f \\[ y-\\varphi^\\prime(t_k)=\\varphi^{\\prime\\prime}(t_k)(t-t_k) \\] \u7136\u540e\u7528\u8fd9\u6761\u5207\u7ebf\u4e0e\u6a2a\u8f74\u4ea4\u70b9\u7684\u6a2a\u5750\u6807 \\(t_{k+1}\\) \u4f5c\u4e3a\u6839\u7684\u65b0\u7684\u8fd1\u4f3c\uff0c\u4ee4 \\(y=0\\) \u89e3\u51fa \\[ t_{k+1}=t_k-\\varphi^\\prime(t_k)/\\varphi^{\\prime\\prime}(t_k) \\] \u9ec4\u91d1\u5206\u5272\u6cd5 \u00b6 \u9002\u7528\u4e8e \\([a,b]\\) \u533a\u95f4\u4e0a\u7684\u4efb\u4f55\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6c42\u6781\u5c0f\u70b9\u95ee\u9898 \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a \\(\\varphi(t)\\) \u7684\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u8ba1\u7b97 \\(t_2=a+\\beta(b-a), \\varphi_2=\\varphi(t_2)\\) \u8ba1\u7b97 \\(t_1=a+b-t_2, \\varphi_1=\\varphi(t_1)\\) \u82e5 \\(|t_1-t_2|<\\varepsilon\\) \uff0c\u5219\u6253\u5370 \\(t^\\prime=\\frac{t_1+t_2}{2}\\) \uff0c\u505c\u673a\uff1b\u90fd\u5219\uff0c\u82e5 \\(|t_1-t_2| \\ge \\varepsilon\\) \uff0c\u8f6c 5 \u5224\u522b \\(\\varphi_1 \\le \\varphi_2\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u7f6e \\(b=t_2,t_2=t_1,\\varphi_2=\\varphi_1\\) \uff0c\u7136\u540e\u8f6c 3\uff1b\u5426\u5219\uff0c\u82e5 \\(\\varphi_1>\\varphi_2\\) \uff0c\u5219\u7f6e \\(a=t_1,t_1=t_2,\\varphi_1=\\varphi_2,t_2=a+\\beta(b-a),\\varphi_2=\\varphi(t_2)\\) \uff0c\u7136\u540e\u8f6c4","title":"\u76f4\u7ebf\u641c\u7d22"},{"location":"mb/optimization-theory/lec2/#_1","text":"Abstract \u672c\u7ae0\u4e3b\u8981\u8ba8\u8bba\u7684\u95ee\u9898\u662f \\(\\min{(\\varphi (t))}\uff0c\\varphi: R^1 \\to R^1\\) \uff0c\u8fd9\u79cd\u8fed\u4ee3\u65b9\u6cd5\u79f0\u4e3a\u76f4\u7ebf/\u4e00\u7ef4\u641c\u7d22\u3002\u5e76\u4e14\u5728\u591a\u7ef4\u95ee\u9898\u4e5f\u80fd\u7528\u5230\u3002","title":"\u76f4\u7ebf\u641c\u7d22"},{"location":"mb/optimization-theory/lec2/#_2","text":"\u5047\u8bbe\u4e00\u5143\u51fd\u6570 \\(\\varphi (t)\\) \u662f\u5355\u8c37\u51fd\u6570 \u8bbe \\(\\varphi \\subset R^1 \\to R^1\\) \uff0c \\(t^*\\) \u662f \\(\\varphi (t)\\) \u5728 \\(L\\) \u4e0a\u7684\u5168\u5c40\u6700\u5c0f\u70b9\u3002\u5982\u679c\u5bf9\u4e8e \\(L\\) \u4e0a\u4efb\u53d6\u7684\u4e24\u70b9 \\(t_1, t_2\\) \u4e14 \\(t_1 < t_2\\) \u90fd\u6709 \\[ \u5f53t_2 \\le t^*\u65f6\uff0c\\varphi(t_1) > \\varphi(t_2) \\\\ \u5f53t_1 \\ge t^*\u65f6\uff0c\\varphi(t_1) < \\varphi(t_2) \\] \u5219\u79f0 \\(\\varphi(t)\\) \u662f\u533a\u95f4 \\(L\\) \u4e0a\u7684\u5355\u8c37\u51fd\u6570\u3002 \u8bbe \\(\\varphi \\subset R^1 \\to R^1\\) \uff0c \\(t^*\\) \u662f \\(\\varphi (t)\\) \u5728 \\(L\\) \u4e0a\u7684\u5168\u5c40\u6700\u5c0f\u70b9\u3002\u5982\u679c\u627e\u5230 \\(t_1 \\in L\\) \u548c \\(t_2 \\in L\\) \u4f7f\u5f97 \\(t_1 < t^* < t_2\\) \uff0c\u5219 \\([t_1, t_2]\\) \u4e3a \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\uff0c\u8bb0\u4e3a \\(\\{t_1, t_2\\}\\) \u3002 \u8bbe \\(\\{a,b\\}\\) \u662f\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u533a\u95f4\u3002\u5728 \\((a,b)\\) \u4e0a\u4efb\u53d6\u4e24\u70b9 \\(t_1\\) \u548c \\(t_2\\) \u4e14 \\(t_1 \\varphi(t_2)\\) \uff0c\u5219 \\(\\{t_1, b\\}\\) \u662f \\(\\varphi(t)\\) \u6781\u5c0f\u70b9\u7684\u4e00\u4e2a\u641c\u7d22\u7a7a\u95f4\u3002 \u641c\u7d22\u533a\u95f4\u7684\u786e\u5b9a \u9009\u5b9a\u521d\u59cb\u70b9 \\(t_0\\) \u548c\u6b65\u957f \\(h\\) \u8ba1\u7b97\u5e76\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0+h)\\) \uff0c\u6709 3\uff0c4 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)<\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0)\\) \u548c \\(\\varphi(t_0-h)\\) \uff0c\u6709 5\uff0c6 \u4e24\u79cd\u60c5\u51b5 \u5f53 \\(\\varphi(t_0)\\ge\\varphi(t_0+h)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0+(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0+(2^{m-1}-1)^h) \\ge \\varphi(t_0+(2^m-1)^h) < \\varphi(t_0+(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0+(2^{m-1}-1)^h), v=\\varphi(t_0+(2^{m}-1)^h), w=\\varphi(t_0+(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{u,v,r\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{v,r,w\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h) > \\varphi(t_0)\\) \u65f6\uff0c\u53d6 \\(\\{t_0-h,t_0,t_0+h\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(t_0-h)\\le\\varphi(t_0)\\) \u65f6\uff0c\u6bd4\u8f83 \\(\\varphi(t_0-(2^k-1)^h), k=1,2,...\\) \uff0c\u76f4\u5230\u5bf9\u4e8e\u67d0\u4e2a \\(m(m \\ge 1)\\) \u4f7f\u5f97 \\[ \\varphi(t_0-(2^{m-1}-1)^h) \\ge \\varphi(t_0-(2^m-1)^h) < \\varphi(t_0-(2^{m+1}-1)^h) \\\\ \u8bbe \\ \\ u=\\varphi(t_0-(2^{m-1}-1)^h), v=\\varphi(t_0-(2^{m}-1)^h), w=\\varphi(t_0-(2^{m+1}-1)^h) \\] \u6b64\u65f6\u5f97\u5230\u641c\u7d22\u533a\u95f4 \\(\\{u,v,w\\}\\) \uff0c\u56e0\u4e3a\u533a\u95f4 \\([v,w]\\) \u662f \\([u,v]\\) \u7684\u4e24\u500d\u957f\uff0c\u6240\u4ee5\u53ea\u8981\u6bd4\u8f83 \\(v\\) \u548c\u533a\u95f4 \\([v,w]\\) \u4e2d\u70b9 \\(r=\\frac{v+w}{2}\\) \u7684\u51fd\u6570\u503c\uff0c\u7acb\u523b\u53ef\u4ee5\u5c06 \\([u,w]\\) \u7f29\u77ed \\(\\frac{1}{3}\\) \u5f53 \\(\\varphi(v) \\ge \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{w,r,v\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u5f53 \\(\\varphi(v) < \\varphi(r)\\) \u65f6\uff0c\u53d6 \\(\\{r,v,u\\}\\) \u4e3a\u641c\u7d22\u533a\u95f4 \u6b65\u957f\u7684\u9009\u62e9","title":"\u641c\u7d22\u533a\u95f4\u7684\u786e\u5b9a"},{"location":"mb/optimization-theory/lec2/#_3","text":"\u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e00\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u5b83\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \u548c \\(\\varphi^\\prime(t)\\) \u7684\u8868\u8fbe\u5f0f\uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \uff0c\u8981\u6c42 \\(\\varphi^\\prime(a)<0,\\varphi^\\prime(b)>0\\) \u8ba1\u7b97 \\(\\{a,b\\}\\) \u7684\u4e2d\u70b9 \\(c=0.5(a+b)\\) \u82e5 \\(\\varphi^\\prime(c)<0\\) \uff0c\u5219 \\(a=c\\) \uff0c\u8f6c 4\uff1b\u82e5 \\(\\varphi^\\prime(c)=0\\) \uff0c\u5219 \\(t^*=c\\) \uff0c\u8f6c 5\uff1b\u82e5 \\(\\varphi^\\prime(c)>0\\) \uff0c\u5219 \\(b=c\\) \uff0c\u8f6c4 \u82e5 \\(|a-b|<\\varepsilon\\) \uff0c\u5219 \\(t^*=0.5(a+b)\\) \uff0c\u8f6c 5\uff0c\u5426\u5219\u8f6c 2 \u6253\u5370 \\(t^*\\) \uff0c\u505c\u673a","title":"\u5bf9\u5206\u6cd5"},{"location":"mb/optimization-theory/lec2/#newton","text":"\u9002\u7528\u4e8e \\(\\varphi: R^1 \\to R^1\\) \u5728\u5df2\u83b7\u5f97\u7684\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u5185\u5177\u6709\u8fde\u7eed\u7684\u4e8c\u9636\u5bfc\u6570\uff0c\u5e76\u4e14\u5df2\u5bfc\u51fa\u4e00\u9636\u548c\u4e8c\u9636\u5bfc\u6570\u7684\u8868\u8fbe\u5f0f \u7b97\u6cd5\u6d41\u7a0b \u8bbe\u5728\u533a\u95f4 \\([a,b]\\) \u4e2d\u7ecf\u8fc7 \\(k\\) \u6b21\u8fed\u4ee3\u5df2\u6c42\u5230\u65b9\u7a0b \\(\\varphi^\\prime(t)=0\\) \u7684\u4e00\u4e2a\u8fd1\u6839\u4f3c \\(t_k\\) \u3002\u8fc7 \\((t_k,\\varphi^\\prime(t_k))\\) \u4f5c\u66f2\u7ebf \\(y=\\varphi^\\prime(t)\\) \u7684\u5207\u7ebf\uff0c\u5176\u65b9\u7a0b\u662f \\[ y-\\varphi^\\prime(t_k)=\\varphi^{\\prime\\prime}(t_k)(t-t_k) \\] \u7136\u540e\u7528\u8fd9\u6761\u5207\u7ebf\u4e0e\u6a2a\u8f74\u4ea4\u70b9\u7684\u6a2a\u5750\u6807 \\(t_{k+1}\\) \u4f5c\u4e3a\u6839\u7684\u65b0\u7684\u8fd1\u4f3c\uff0c\u4ee4 \\(y=0\\) \u89e3\u51fa \\[ t_{k+1}=t_k-\\varphi^\\prime(t_k)/\\varphi^{\\prime\\prime}(t_k) \\]","title":"Newton \u5207\u7ebf\u6cd5"},{"location":"mb/optimization-theory/lec2/#_4","text":"\u9002\u7528\u4e8e \\([a,b]\\) \u533a\u95f4\u4e0a\u7684\u4efb\u4f55\u5355\u8c37\u51fd\u6570 \\(\\varphi(t)\\) \u6c42\u6781\u5c0f\u70b9\u95ee\u9898 \u7b97\u6cd5\u6d41\u7a0b\uff08\u5df2\u77e5 \\(\\varphi(t)\\) \uff0c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \uff09 \u786e\u5b9a \\(\\varphi(t)\\) \u7684\u521d\u59cb\u641c\u7d22\u533a\u95f4 \\(\\{a,b\\}\\) \u8ba1\u7b97 \\(t_2=a+\\beta(b-a), \\varphi_2=\\varphi(t_2)\\) \u8ba1\u7b97 \\(t_1=a+b-t_2, \\varphi_1=\\varphi(t_1)\\) \u82e5 \\(|t_1-t_2|<\\varepsilon\\) \uff0c\u5219\u6253\u5370 \\(t^\\prime=\\frac{t_1+t_2}{2}\\) \uff0c\u505c\u673a\uff1b\u90fd\u5219\uff0c\u82e5 \\(|t_1-t_2| \\ge \\varepsilon\\) \uff0c\u8f6c 5 \u5224\u522b \\(\\varphi_1 \\le \\varphi_2\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u7f6e \\(b=t_2,t_2=t_1,\\varphi_2=\\varphi_1\\) \uff0c\u7136\u540e\u8f6c 3\uff1b\u5426\u5219\uff0c\u82e5 \\(\\varphi_1>\\varphi_2\\) \uff0c\u5219\u7f6e \\(a=t_1,t_1=t_2,\\varphi_1=\\varphi_2,t_2=a+\\beta(b-a),\\varphi_2=\\varphi(t_2)\\) \uff0c\u7136\u540e\u8f6c4","title":"\u9ec4\u91d1\u5206\u5272\u6cd5"},{"location":"mb/optimization-theory/lec3/","text":"\u65e0\u7ea6\u675f\u6700\u4f18\u5316\u7684\u68af\u5ea6\u65b9\u6cd5 \u00b6 \u7ea6 2049 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 7 \u5206\u949f Abstract \u672c\u7ae0\u5f00\u59cb\u8ba8\u8bba\u591a\u7ef4\u6700\u4f18\u5316\u95ee\u9898\u548c\u65e0\u7ea6\u675f\u6700\u4f18\u5316\u95ee\u9898\uff0c\u5176\u4e00\u822c\u5f62\u5f0f\u4e3a \\[ \\min f(\\mathbf{x}) \\] \u6700\u901f\u4e0b\u964d\u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \u5047\u5b9a\u5df2\u7ecf\u8fed\u4ee3\u4e86 k \u6b21\uff0c\u83b7\u5f97\u4e86\u7b2c k \u4e2a\u8fed\u4ee3\u70b9 \\(\\mathbf{x}_k\\) \uff0c\u4ece \\(\\mathbf{x}_k\\) \u51fa\u53d1\uff0c\u663e\u7136\u5e94\u8be5\u6cbf\u6700\u4fd7\u4e0b\u964d\u65b9\u5411\uff08\u5373\u8d1f\u68af\u5ea6\u65b9\u5411\uff09\u884c\u8fdb\uff0c\u53d6\u641c\u7d22\u65b9\u5411 \\[ \\mathbf{p}_k = - \\nabla f(\\mathbf{x}_k) \\] \u7531\u6b64\u5f97\u5230\u7b2c \\(k+1\\) \u8fed\u4ee3\u70b9 \\(\\mathbf{x}_{k+1}\\) \uff0c\u5373 \\[ \\mathbf{x}_{k+1}=\\mathbf{x}_k - t_k \\nabla f(\\mathbf{x}_k) \\] \u5176\u6b65\u957f\u56e0\u5b50 \\(t_k\\) \u6ee1\u8db3 \\[ f(\\mathbf{x}_k - t_k \\nabla f(\\mathbf{x}_k)) = \\min f(\\mathbf{x}_k - t \\nabla f(\\mathbf{x}_k)) \\] \u603b\u7ed3\u4e0a\u5f0f\uff0c\u5f97\u5230\u6700\u901f\u4e0b\u964d\u6cd5\u7684\u8fed\u4ee3\u516c\u5f0f \\[ \\mathbf{x}_{k+1} = ls(\\mathbf{x}_k, - \\nabla f(\\mathbf{x}_k)) \\] \u7b97\u6cd5 \u5df2\u77e5\uff1a\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})\\) \u53ca\u5176\u68af\u5ea6 \\(\\mathbf{g}(\\mathbf{x})\\) \uff0cH \u7ec8\u6b62\u51c6\u5219\u6240\u9700\u8981\u7684\u7ec8\u6b62\u9650 \\(\\varepsilon_1, \\varepsilon_2\\) \u548c \\(\\varepsilon_3\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u8ba1\u7b97 \\(f_0=f(\\mathbf{x}_0), \\mathbf{g}_0 = \\mathbf{g}(\\mathbf{x}_0)\\) \uff0c\u7f6e \\(k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22\uff1a \\(\\mathbf{x}_{k+1}=ls \\cdot (\\mathbf{x}_k, -\\mathbf{g}_k)\\) \uff1b\u8ba1\u7b97 \\(f_{k+1}=f(\\mathbf{x}_{k+1}), \\mathbf{g}_{k+1}=\\mathbf{g}(\\mathbf{x}_{k+1})\\) \u5224\u522b H \u7ec8\u6b62\u51c6\u5219\u662f\u5426\u6ee1\u8db3\uff1b\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370\u6700\u4f18\u89e3 \\(\\mathbf{x}_{k+1},f_{k+1}\\) \uff0c\u505c\u673a\uff1b\u5426\u5219\uff0c\u7f6e \\(k=k+1\\) \uff0c\u8f6c 2 \u5e94\u7528\u4e8e\u6b63\u5b9a\u4e8c\u6b21\u51fd\u6570 \\(f(\\mathbf{x})=\\frac{1}{2} \\mathbf{x}^\\top \\mathbf{Q} \\mathbf{x} + \\mathbf{b}^\\top \\mathbf{x} + c\\) \u8bbe\u7b2c \\(k\\) \u6b21\u7684\u8fed\u4ee3\u70b9\u4e3a \\(\\mathbf{x}_k\\) \uff0c\u6c42 \\(\\mathbf{x}_{k+1}\\) \u7684\u8868\u8fbe\u5f0f \\[ \\mathbf{x}_{k+1} = \\mathbf{x}_k - \\frac{\\mathbf{g}_k^\\top \\mathbf{g}_k}{\\mathbf{g}_k^\\top \\mathbf{Q} \\mathbf{g}_k} \\mathbf{g}_k \\] Newton \u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \u8003\u8651\u4ece \\(\\mathbf{x}_k\\) \u5230 \\(\\mathbf{x}_{k+1}\\) \u7684\u8fed\u4ee3\u8fc7\u7a0b\u3002\u5728 \\(\\mathbf{x}_k\\) \u70b9\u5904\u5bf9 \\(f(\\mathbf{x})\\) \u7528\u4e0e\u5b83\u6700\u5bc6\u5207\u7684\u4e8c\u6b21\u51fd\u6570\u6765\u8fd1\u4f3c\uff0c\u8fd9\u53ea\u987b\u628a \\(f(\\mathbf{x}\\) \u6309 Taylor \u5c55\u5f00\uff0c\u76f4\u5230\u7b2c\u4e09\u9879\uff0c\u5373 \\[ f(\\mathbf{x}) \\approx Q(\\mathbf{x}) = f(\\mathbf{x}_k) + \\mathbf{g}(\\mathbf{x}_k)^\\top (\\mathbf{x} - \\mathbf{x}_k)+\\frac{1}{2}(\\mathbf{x}-\\mathbf{x}_k)^\\top \\mathbf{G}(\\mathbf{x}_k)(\\mathbf{x}-\\mathbf{x}_k) \\] \u4ee4 \\(\\nabla Q(\\mathbf{x})=\\mathbf{G}(\\mathbf{x}_k)(\\mathbf{x}-\\mathbf{x}_k)+\\mathbf{g}(\\mathbf{x}_k)=0\\) \uff0c\u5f97 \\[ \\mathbf{x}_{k+1} = \\mathbf{x}_k - \\mathbf{G}(\\mathbf{x}_k)^{-1}\\mathbf{g}(\\mathbf{x}_k) \\] \u7b97\u6cd5 \u5df2\u77e5\uff1a\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})\\) \u53ca\u5176\u68af\u5ea6 \\(\\mathbf{g}(\\mathbf{x})\\) \uff0cHesse \u77e9\u9635 \\(\\mathbf{G}(\\mathbf{x})\\) \uff0cH \u7ec8\u6b62\u51c6\u5219\u6240\u9700\u8981\u7684\u7ec8\u6b62\u9650 \\(\\varepsilon_1, \\varepsilon_2\\) \u548c \\(\\varepsilon_3\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff1b\u8ba1\u7b97 \\(f_0 = f(\\mathbf{x}_0), \\mathbf{g}_0=\\mathbf{g}(\\mathbf{x}_0)\\) \uff1b\u7f6e \\(k=0\\) \u8ba1\u7b97 \\(\\mathbf{G}_k=\\mathbf{G}(\\mathbf{x}_k)\\) \u7531\u65b9\u7a0b \\(\\mathbf{G}_k \\mathbf{p}=-\\mathbf{g}_k\\) \u89e3\u51fa \\(\\mathbf{p}_k\\) \u8ba1\u7b97 \\(\\mathbf{x}_{k+1}=\\mathbf{x}_k + \\mathbf{p}_k\\) \uff0c \\(f_{k+1}=f(\\mathbf{x}_{k+1})\\) \uff0c \\(\\mathbf{g}_{k+1}=\\mathbf{g}(\\mathbf{x}_{k+1})\\) \u5224\u522b H \u7ec8\u6b62\u51c6\u5219\u662f\u5426\u6ee1\u8db3\uff1b\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370\u6700\u4f18\u89e3 \\(\\mathbf{x}_{k+1},f_{k+1}\\) \uff0c\u505c\u673a\uff1b\u5426\u5219\uff0c\u7f6e \\(k=k+1\\) \uff0c\u8f6c 2 \u5171\u8f6d\u65b9\u5411\u6cd5\u4e0e\u5171\u8f6d\u68af\u5ea6\u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \u9996\u5148\u8003\u8651\u4e8c\u7ef4\u7684\u60c5\u51b5\uff0c\u628a\u4e0b\u964d\u6cd5\u7528\u4e8e\u4e8c\u5143\u4e8c\u6b21\u51fd\u6570\uff0c\u4efb\u9009\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u6cbf\u67d0\u4e2a\u4e0b\u964d\u65b9\u5411\uff0c\u4f8b\u5982\u5411\u91cf \\(\\mathbf{p}_0\\) \u7684\u65b9\u5411\uff0c\u4f5c\u76f4\u7ebf\u641c\u7d22\u5f97\u5230 \\(\\mathbf{x}_1\\) \uff1a \\(\\nabla f(\\mathbf{x}_1)^\\top \\mathbf{p}_0=0\\) \u5c06\u4e0b\u4e00\u6b21\u8fed\u4ee3\u7684\u641c\u7d22\u65b9\u5411\u6307\u5411\u6781\u5c0f\u70b9 \\(\\mathbf{x}^*\\) \uff0c\u63a8\u5bfc\u5f97\u5230 \\(\\mathbf{p}_0^\\top \\mathbf{Q} \\mathbf{p}_1 = 0\\) \uff0c\uff0c\u8fd9\u91cc\u7684 \\(\\mathbf{p}_0\\) \u548c \\(\\mathbf{p}_1\\) \u79f0\u4e3a \\(\\mathbf{Q}\\) \u5171\u8f6d\u5411\u91cf\uff0c\u6216\u79f0 \\(\\mathbf{p}_0\\) \u548c \\(\\mathbf{p}_1\\) \u7684\u65b9\u5411\u662f\u5171\u8f6d\u65b9\u5411 \\[ \\mathbf{p}_1 = - \\nabla f(\\mathbf{x}_1) + \\frac{\\mathbf{p}_0^\\top \\mathbf{Q} \\nabla f(\\mathbf{x}_1)}{\\mathbf{p}_0^\\top \\mathbf{Q} \\mathbf{p}_0} \\mathbf{p}_0 \\] \u5411\u91cf\u7684\u5171\u8f6d\u53ca\u5176\u6027\u8d28 \u82e5\u975e\u96f6\u5411\u91cf\u7cfb \\(\\mathbf{p}_0, \\mathbf{p}_1, ..., \\mathbf{p}_{m+1}\\) \u662f \\(\\mathbf{Q}\\) \u5171\u8f6d\u7684\uff0c\u5219\u8fd9 m \u4e2a\u5411\u91cf\u7ebf\u6027\u65e0\u5173 \u5728 n \u7ef4\u7a7a\u95f4\u4e2d\uff0c\u4e92\u76f8\u5171\u8f6d\u7684\u975e\u96f6\u5411\u91cf\u7684\u5411\u91cf\u4e2a\u6570\u4e0d\u8d85\u8fc7 n \u5171\u8f6d\u65b9\u5411\u6cd5 \u5df2\u77e5\uff1a\u5177\u6709\u6b63\u5b9a\u77e9\u9635 \\(\\mathbf{Q}\\) \u7684\u4e8c\u6b21\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})=\\frac{1}{2} \\mathbf{x}^\\top \\mathbf{Q} \\mathbf{x} + \\mathbf{b}^\\top \\mathbf{x}+c\\) \u548c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \u548c\u5177\u6709\u4e0b\u964d\u65b9\u5411\u7684\u5411\u91cf \\(\\mathbf{p}_0\\) \uff1b\u7f6e \\(k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22 \\(\\mathbf{x}_{k+1}=ls(\\mathbf{x}_k. \\mathbf{p}_k)\\) \u5224\u522b \\(\\parallel \\nabla f(\\mathbf{x}_{k+1}) \\parallel < \\varepsilon\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370 \\(\\mathbf{x}_{k+1}\\) \uff0c\u505c\u673a\uff0c\u5426\u5219\u8f6c 4 \u63d0\u4f9b\u5171\u8f6d\u65b9\u5411 \\(\\mathbf{p}_{k+1}\\) \u4f7f\u5f97 \\(\\mathbf{p}_j^\\top \\mathbf{Q} \\mathbf{p}_{k+1} = 0, \\ \\ \\ j=0,1,...,k\\) \\(k = k + 1\\) \uff0c\u8f6c 2 \u5171\u8f6d\u68af\u5ea6\u6cd5 \u5df2\u77e5\uff1a\u5177\u6709\u4e8c\u6b21\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})=\\frac{1}{2} \\mathbf{x}^\\top \\mathbf{Q} \\mathbf{x} + \\mathbf{b}^\\top \\mathbf{x}+c\\) \u548c\u7ec8\u6b62\u9650 \\(\\varepsilon\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u8ba1\u7b97 \\(\\mathbf{p}_0 = -\\nabla f(\\mathbf{x}_0)\\) \uff0c\u7f6e \\(k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22 \\(\\mathbf{x}_{k+1}=ls(\\mathbf{x}_k,\\mathbf{p}_k)\\) \uff0c\u6216\u91c7\u53d6\u8ba1\u7b97\u516c\u5f0f \\(t_k=\\frac{\\nabla f(\\mathbf{x}_k)^\\top \\nabla f(\\mathbf{x}_k)}{\\mathbf{p}_k^\\top \\mathbf{Q} \\mathbf{p}_k}\\) \uff0c \\(\\mathbf{x}_{k+1}=\\mathbf{x}_k + t_k\\mathbf{p}_k\\) \u5224\u522b \\(\\parallel \\nabla f(\\mathbf{x}_{k+1}) \\parallel < \\varepsilon\\) \u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370 \\(\\mathbf{x}_{k+1}\\) \uff0c\u505c\u673a\uff0c\u5426\u5219\u8f6c 4 \u8ba1\u7b97 \\(\\alpha_k = \\frac{\\nabla f(\\mathbf{x}_{k+1}^\\top \\mathbf{Q} \\mathbf{p}_k)}{\\mathbf{p}_k^\\top \\mathbf{Q} \\mathbf{p}_k}\\) \uff0c \\(\\mathbf{p}_{k+1}=-\\nabla f(\\mathbf{x}_{k+1})+\\alpha_k \\mathbf{p}_k\\) \\(k=k+1\\) \uff0c\u8f6c 2 \u53d8\u5c3a\u5ea6\u6cd5 \u00b6 \u57fa\u672c\u60f3\u6cd5 \uff1a\u7565 DFP \u7b97\u6cd5 \u5df2\u77e5\uff1a\u76ee\u6807\u51fd\u6570 \\(f(\\mathbf{x})\\) \u53ca\u5176\u68af\u5ea6 \\(\\mathbf{g}(\\mathbf{x_0})\\) \uff0c\u95ee\u9898\u7684\u7ef4\u5ea6 n\uff0cH \u7ec8\u6b62\u51c6\u5219\u4e2d\u7684\u7ec8\u6b62\u9650 \\(\\varepsilon_1, \\varepsilon_2\\) \u548c \\(\\varepsilon_3\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff0c\u8ba1\u7b97 \\(f_0=f(\\mathbf{x}_0),\\mathbf{g}_0=\\mathbf{g}(\\mathbf{x}_0)\\) \u7f6e \\(\\mathbf{H}_0=\\mathbf{I},\\mathbf{p}_0=-\\mathbf{g}_0,k=0\\) \u4f5c\u76f4\u7ebf\u641c\u7d22 \\(\\mathbf{x}_{k+1}=ls(\\mathbf{x}_k, \\mathbf{p}_k)\\) \uff0c\u8ba1\u7b97 \\(f_{k+1}=f(\\mathbf{x}_{k+1}),\\mathbf{g}_{k+1}=\\mathbf{g}(\\mathbf{x}_{k+1})\\) \u5224\u522b H \u7ec8\u6b62\u51c6\u5219\u662f\u5426\u6ee1\u8db3\uff1a\u82e5\u6ee1\u8db3\uff0c\u5219\u6253\u5370 \\(\\mathbf{x}_{k+1},f_{k+1}\\) \uff0c\u505c\u673a\uff1b\u5426\u5219\uff0c\u8f6c 5 \u82e5 \\(k=n\\) \uff0c\u5219\u7f6e \\(\\mathbf{x}_0 = \\mathbf{x}_{k+1}, f_0=f_{k+1}, \\mathbf{g}_0 = \\mathbf{g}_{k+1}\\) \uff0c\u8f6c 2\uff1b\u5426\u5219\u8f6c 6 \u8ba1\u7b97 \\(\\mathbf{y}_k=\\mathbf{g}_{k+1}-\\mathbf{g}_k, \\mathbf{s}_k = \\mathbf{x}_{k+1}-\\mathbf{x}_k, \\mathbf{H}_{k+1}=\\mathbf{H}_k+\\frac{\\mathbf{s}_k\\mathbf{s}_k^\\top}{\\mathbf{s}_k^\\top \\mathbf{y}_k} - \\frac{\\mathbf{H}_k \\mathbf{y}_k \\mathbf{y}_k^\\top \\mathbf{H}_k}{\\mathbf{y}_k^\\top \\mathbf{H}_k \\mathbf{y}_k},\\mathbf{p}_{k+1}=-\\mathbf{H}_{k+1}\\mathbf{g}_{k+1}\\) \uff0c\u7f6e \\(k=k+1\\) \uff0c\u8f6c 3 \u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3\u6cd5 \u00b6 \u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898 \u00b6 \u5f53 \\(f(\\mathbf{x})\\) \u53d6\u7ebf\u6027\u51fd\u6570\u5f62\u5f0f\u65f6\uff0c\u5373 \\(f(\\mathbf{x})=A \\mathbf{x} - \\mathbf{b}\\) \uff0c\u5176\u4e2d A \u662f \\(m \\times n\\) \u77e9\u9635\uff0cb \u662f m \u7ef4\u5411\u91cf\uff0c\u6b64\u65f6\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u5373 \\[ \\min \\parallel A \\mathbf{x} - \\mathbf{b} \\parallel^2 \\] \\(\\mathbf{x}^*\\) \u7684\u6781\u5c0f\u70b9\u5f53\u4e14\u4ec5\u5f53 \\(\\mathbf{x}^*\\) \u6ee1\u8db3\u65b9\u7a0b \\(A^\\top A \\mathbf{x}=A^\\top \\mathbf{b}\\) \u8bbe A \u662f \\(m \\times n\\) \u77e9\u9635 \\((m \\ge n)\\) \uff0c\u5219 \\(A^\\top A\\) \u6b63\u5b9a\u7684\u5145\u8981\u6761\u4ef6\u662f A \u7684\u79e9\u4e3a n \u5f53 A \u7684\u79e9\u4e3a n \u65f6\uff0c\u5219 \\(\\mathbf{x}=(A^\\top A)^{-1} A^\\top \\mathbf{b}\\) \u662f\u552f\u4e00\u6700\u5c0f\u4e8c\u4e58\u89e3 \u8bbe A \u662f \\(m \\times n\\) \u77e9\u9635 \\((m \\ge n)\\) \uff0c\u5219 \\(A^\\top A\\) \u6b63\u5b9a\u7684\u5145\u8981\u6761\u4ef6\u662f \\(A^\\top A\\) \u4e3a\u975e\u5947\u5f02 Gauss-Newton \u6cd5 \u00b6 \u8ba8\u8bba\u4ee5 \\(s(\\mathbf{x})=f(\\mathbf{x})^\\top f(\\mathbf{x})=\\parallel f(\\mathbf{x}) \\parallel^2\\) \u4e3a\u76ee\u6807\u51fd\u6570\u7684\u975e\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3\u6cd5 \u628a \\(f(\\mathbf{x})\\) \u7ebf\u6027\u5316\uff0c\u7528\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3\u53bb\u903c\u8fd1\u975e\u7ebf\u6027\u6700\u5c0f\u4e8c\u4e58\u95ee\u9898\u7684\u89e3 \u7b97\u6cd5\u6d41\u7a0b \u5df2\u77e5\uff1a \\(f(\\mathbf{x})=[f_1(\\mathbf{x}), ..., f_m(\\mathbf{x})]^\\top\\) \u53ca\u5176 Jacobi \u77e9\u9635 \\(A(\\mathbf{x})=[\\frac{\\partial f_i(\\mathbf{x})}{\\partial x_j}]\\) \u9009\u5b9a\u521d\u59cb\u70b9 \\(\\mathbf{x}_0\\) \uff1b\u8ba1\u7b97 \\(s_0=\\sum_{i=1}^m f_i^m (\\mathbf{x}_0)\\) \uff1b\u7f6e \\(k=0\\) \u5bf9 \\(i=1,...,m\\) \u548c \\(j=1,...,n\\) \u8ba1\u7b97 \\(a_{ij}^{(k)}=\\frac{\\partial f_i(\\mathbf{x}_k)}{\\partial x_j}\\) \u3002\u7531\u6b64\u6784\u6210\u77e9\u9635 \\(A_k\\) \uff0c\u5b83\u7684\u7b2c i \u884c\u548c\u7b2c j \u5217\u5206\u91cf\u662f \\(a_{ij}^{(k)}\\) \uff0c\u5bf9 \\(j=1,...,n\\) \u8ba1\u7b97 \\(g_j^{(k)}=\\sum_{i=1}^m f_i(\\mathbf{x}_k) \\frac{\\partial f_i(\\mathbf{x_k})}{\\partial x_j}\\) \u3002\u7531\u6b64\u6784\u6210\u5411\u91cf \\(\\mathbf{g}_k\\) \uff0c\u5b83\u7684\u7b2c j \u4e2a\u5206\u91cf\u662f \\(g_j^{(k)}\\) \u7531\u65b9\u7a0b\u7ec4 \\(A_k^\\top A_k \\mathbf{p}=-\\mathbf{g}_k\\) \u89e3\u51fa \\(\\mathbf{p}\\) \uff0c\u8bbe\u4e3a \\(\\mathbf{p}_k\\) \u3002\u5728\u6c42\u89e3\u8fc7\u7a0b\u4e2d\uff0c\u4ec5\u5f53 \\(r(A_k^\\top A_k)=n\\) \u65f6\u624d\u80fd\u89e3\u5f97\u51fa \\(\\mathbf{p}_k\\) \u82e5\u5728\u6c42\u89e3\u8fc7\u7a0b\u4e2d\u53d1\u73b0 \\(r(A_k^\\top A_k) 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"\u5de5\u5177\u76f8\u5173"},{"location":"utils/#_1","text":"Abstract \u4e00\u4e9b\u5de5\u5177\u7684\u4f7f\u7528\u65b9\u6cd5\uff0c\u5305\u62ec\u547d\u4ee4\u884c\u76f8\u5173\u7684\u547d\u4ee4\u7b49\u7b49","title":"\u5de5\u5177\u76f8\u5173"},{"location":"utils/#table-of-contents","text":"\u547d\u4ee4\u884c\u5de5\u5177 Shell \u76f8\u5173\u547d\u4ee4 159 2 1 mins 1693553563 Docker \u76f8\u5173\u547d\u4ee4 674 16 2 mins 1693553563 Git \u76f8\u5173\u547d\u4ee4 328 13 1 mins 1693405725 gdb \u76f8\u5173\u547d\u4ee4 754 3 3 mins 1693405725 CI \u5de5\u5177 Github Action\uff08**TODO**\uff09 0 0 mins 1693404987 \u7ad9\u70b9\u751f\u6210\u5de5\u5177 gitbook 49 12 0 mins 1694949283 reveal-md 761 21 3 mins 1694335736 mkdocs\uff08**TODO**\uff09 0 0 mins 1693404987 hexo\uff08**TODO**\uff09 0 0 mins 1693404987 \u89c6\u9891\u56fe\u50cf\u5904\u7406\u5de5\u5177 ffmpeg 33 10 0 mins 1727424112 ImageMagick\uff08**TODO**\uff09 0 0 mins 1727424112 function buttonHandler(i) { let content = document.getElementsByClassName(\"content-item-wrapper\")[i]; let button = document.getElementsByClassName(\"title-wrapper\")[i].getElementsByTagName(\"button\")[0]; if (content.style.display == \"none\") { content.style.display = \"block\"; button.children[0].children[0].style.transform = \"rotate(0deg)\"; } else { content.style.display = \"none\"; button.children[0].children[0].style.transform = \"rotate(-90deg)\"; } } function produce_time() { let time = document.getElementsByClassName(\"item-actions\"); for (let i = 0; i < time.length; i++) { let timestamp; if (time[i].childElementCount > 0) { timestamp = time[i].children[0].innerHTML; } else { timestamp = time[i].innerHTML; } let date = new Date(parseInt(timestamp) * 1000); let now = new Date(); let diff = now.getTime() - date.getTime(); let years = Math.floor(diff / (24 * 3600 * 1000 * 365)); let months = Math.floor(diff / (24 * 3600 * 1000 * 30)); let days = Math.floor(diff / (24 * 3600 * 1000)); let hours = Math.floor((diff % (24 * 3600 * 1000)) / (3600 * 1000)); let minutes = Math.floor((diff % (3600 * 1000)) / (60 * 1000)); let seconds = Math.floor((diff % (60 * 1000)) / 1000); if (years > 0) { time[i].innerHTML = years + \" years ago\"; } else if (months > 0) { time[i].innerHTML = months + \" months ago\"; } else if (days > 0) { time[i].innerHTML = days + \" days ago\"; } else if (hours > 0) { time[i].innerHTML = hours + \" hours ago\"; } else if (minutes > 0) { time[i].innerHTML = minutes + \" minutes ago\"; } else { time[i].innerHTML = seconds + \" seconds ago\"; } } } produce_time();","title":"Table of Contents"},{"location":"utils/action/","text":"","title":"Github Action"},{"location":"utils/docker/","text":"Docker \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 670 \u4e2a\u5b57 16 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684Docker\u547d\u4ee4\u3001Dockerfile\u7b49 \u5b89\u88c5 \u00b6 curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun sudo curl -L \"https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose \u547d\u4ee4 \u00b6 \u5e2e\u52a9 \u00b6 docker version # \u663e\u793aDocker\u7248\u672c\u4fe1\u606f docker info # \u663e\u793aDocker\u7cfb\u7edf\u4fe1\u606f\uff0c\u5305\u62ec\u955c\u50cf\u6570\u3001\u5bb9\u5668\u6570\u3001\u6b63\u5728\u8fd0\u884c\u7684\u955c\u50cf\u6570\u3001\u6682\u505c\u7684\u955c\u50cf\u6570\u3001\u505c\u6b62\u7684\u955c\u50cf\u6570\u7b49 docker --help # \u663e\u793adocker\u6307\u4ee4\u7684\u4fe1\u606f docker \u6307\u4ee4 --help # \u663e\u793a\u5177\u4f53\u67d0\u4e00\u4e2adocker\u6307\u4ee4\u7684\u53ef\u9009\u9879 \u955c\u50cf\u76f8\u5173 \u00b6 docker images \u5217\u51fa\u672c\u5730\u955c\u50cf -a \u5217\u51fa\u672c\u5730\u6240\u6709\u955c\u50cf -q \u53ea\u5217\u51fa\u955c\u50cfID --digests \u663e\u793a\u666f\u8c61\u7684\u6458\u8981\u4fe1\u606f docker search \u641c\u7d22\u955c\u50cf docker pull \u62c9\u53d6\u955c\u50cf docker rmi \u5220\u9664\u955c\u50cf docker build -t . \u4ece Dockerfile \u6784\u5efa\u955c\u50cf\uff0c\u5e76\u6253\u4e0a tag docker export > .tar \u4fdd\u5b58\u955c\u50cf\u4e3a tar \u5305 docker import .tar \u4ece tar \u5305\u5bfc\u5165\u955c\u50cf docker tag : \u7ed9\u955c\u50cf\u6253 tag\uff08\u91cd\u547d\u540d\uff09 \u5bb9\u5668\u76f8\u5173 \u00b6 docker ps -a \u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668 docker run \u8fd0\u884c\u955c\u50cf -i \u4ea4\u4e92\u6a21\u5f0f -t \u5206\u914d\u865a\u62df\u7ec8\u7aef -d \u540e\u53f0\u8fd0\u884c -p : \u7aef\u53e3\u6620\u5c04 -v : \u76ee\u5f55\u6620\u5c04 -e = \u73af\u5883\u53d8\u91cf --name \u5bb9\u5668\u540d --rm \u8fd0\u884c\u5b8c\u540e\u81ea\u52a8\u5220\u9664\u5bb9\u5668 --network \u6307\u5b9a\u7f51\u7edc docker start \u542f\u52a8\u5bb9\u5668 docker restart \u91cd\u542f\u5bb9\u5668 docker stop \u505c\u6b62\u5bb9\u5668 docker rm \u5220\u9664\u5bb9\u5668 docker exec -it /bin/bash \u8fdb\u5165\u5bb9\u5668\uff08\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker attach \u8fdb\u5165\u5bb9\u5668\uff08\u4e0d\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker cp ... ... \u5728\u672c\u5730\u548c\u5bb9\u5668\u4e4b\u95f4\u590d\u5236\u6587\u4ef6\uff08\u7528\u6cd5\u7c7b\u4f3c scp\uff09 docker logs \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7 -t \u663e\u793a\u65f6\u95f4\u6233 -f \u6253\u5370\u6700\u65b0\u7684\u65e5\u5fd7 -tail number \u663e\u793anumber\u6761 docker top \u67e5\u770b\u5bb9\u5668\u4e2d\u8fd0\u884c\u7684\u8fdb\u7a0b\u4fe1\u606f docker inspect \u67e5\u770b\u5bb9\u5668/\u955c\u50cf\u7684\u5143\u6570\u636e exit \u5bb9\u5668\u505c\u6b62\u5e76\u9000\u51fa Ctrl+P+Q \u5bb9\u5668\u4e0d\u505c\u6b62\u9000\u51fa \u7f51\u7edc\u76f8\u5173 \u00b6 docker network ls \u5217\u51fa\u7f51\u7edc docker network create \u521b\u5efa\u7f51\u7edc docker network connect \u5c06\u5bb9\u5668\u8fde\u63a5\u5230\u7f51\u7edc docker network inspect \u67e5\u770b\u7f51\u7edc\u4fe1\u606f docker network rm \u5220\u9664\u7f51\u7edc \u4ed3\u5e93\u76f8\u5173 \u00b6 docker login \u8fde\u63a5 registry docker login \u8fde\u63a5\u5230 Docker Hub docker login ghcr.io \u8fde\u63a5\u5230 GitHub \u7684\u4ed3\u5e93\uff0c\u7528\u6237\u540d\u662f GitHub \u7528\u6237\u540d\uff0c\u5bc6\u7801\u662f GitHub \u751f\u6210\u7684 token\uff08ghp_ \u5f00\u5934\uff09 docker logout \u65ad\u5f00 registry docker push \u63a8\u9001\u955c\u50cf\u5230 registry\uff08\u4f1a\u6839\u636e\u524d\u7f00\u81ea\u52a8\u9009\u62e9 registry\uff09 docker pull \u4ece registry \u62c9\u53d6\u955c\u50cf registry \u955c\u50cf \u00b6 \u53ef\u4ee5\u5229\u7528 registry \u955c\u50cf\u6765\u81ea\u5efa\u79c1\u6709 registry docker pull registry:2 \u62c9\u53d6 registry \u955c\u50cf \u9700\u8981\u6302\u8f7d\u7684\u76ee\u5f55 ./auth:/auth \uff1a\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5728\u672c\u5730 auth \u76ee\u5f55\u4e0b\u6267\u884c docker run --entrypoint htpasswd registry:2.7.0 -Bbn > htpasswd \u751f\u6210\u6587\u4ef6 ./certs:/certs \uff1aSSL \u8bc1\u4e66\uff0c\u53ef\u4ee5\u7528 acme.sh \u6765\u7b7e ./registry:/var/lib/registry \uff1aregistry \u6570\u636e \u542f\u52a8 registry\uff1a docker run -itd -p 5000 :5000 --restart = always --name registry \\ -v ./certs:/certs \\ -v ./auth:/auth \\ -v ./registry:/var/lib/registry \\ -e \"REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain.cer\" \\ -e \"REGISTRY_HTTP_TLS_KEY=/certs/.key\" \\ -e \"REGISTRY_AUTH=htpasswd\" -e \"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm\" \\ -e \"REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd\" \\ registry:2 docker login \u767b\u5f55 registry docker tag / \u7ed9\u955c\u50cf\u6253\u4e0a registry \u7684 tag docker push / \u63a8\u9001\u955c\u50cf\u5230 registry Dockerfile \u00b6 \u5e38\u7528\u6362\u6e90 \u00b6 Ubuntu \u8f6f\u4ef6\u6e90 \u00b6 RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list # RUN sed -i s@/archive.ubuntu.com/@/<...>/@g /etc/apt/sources.list RUN apt-get clean RUN apt-get update Debian \u8f6f\u4ef6\u6e90 \u00b6 RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list && \\ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN apt-get update Reference \u00b6 Docker\u547d\u4ee4\u5907\u5fd8","title":"Docker \u547d\u4ee4\u76f8\u5173"},{"location":"utils/docker/#docker","text":"\u7ea6 670 \u4e2a\u5b57 16 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 2 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684Docker\u547d\u4ee4\u3001Dockerfile\u7b49","title":"Docker \u547d\u4ee4\u76f8\u5173"},{"location":"utils/docker/#_1","text":"curl -fsSL https://get.docker.com | bash -s docker --mirror Aliyun sudo curl -L \"https://github.com/docker/compose/releases/download/1.25.5/docker-compose-$(uname -s)-$(uname -m)\" -o /usr/local/bin/docker-compose sudo chmod +x /usr/local/bin/docker-compose","title":"\u5b89\u88c5"},{"location":"utils/docker/#_2","text":"","title":"\u547d\u4ee4"},{"location":"utils/docker/#_3","text":"docker version # \u663e\u793aDocker\u7248\u672c\u4fe1\u606f docker info # \u663e\u793aDocker\u7cfb\u7edf\u4fe1\u606f\uff0c\u5305\u62ec\u955c\u50cf\u6570\u3001\u5bb9\u5668\u6570\u3001\u6b63\u5728\u8fd0\u884c\u7684\u955c\u50cf\u6570\u3001\u6682\u505c\u7684\u955c\u50cf\u6570\u3001\u505c\u6b62\u7684\u955c\u50cf\u6570\u7b49 docker --help # \u663e\u793adocker\u6307\u4ee4\u7684\u4fe1\u606f docker \u6307\u4ee4 --help # \u663e\u793a\u5177\u4f53\u67d0\u4e00\u4e2adocker\u6307\u4ee4\u7684\u53ef\u9009\u9879","title":"\u5e2e\u52a9"},{"location":"utils/docker/#_4","text":"docker images \u5217\u51fa\u672c\u5730\u955c\u50cf -a \u5217\u51fa\u672c\u5730\u6240\u6709\u955c\u50cf -q \u53ea\u5217\u51fa\u955c\u50cfID --digests \u663e\u793a\u666f\u8c61\u7684\u6458\u8981\u4fe1\u606f docker search \u641c\u7d22\u955c\u50cf docker pull \u62c9\u53d6\u955c\u50cf docker rmi \u5220\u9664\u955c\u50cf docker build -t . \u4ece Dockerfile \u6784\u5efa\u955c\u50cf\uff0c\u5e76\u6253\u4e0a tag docker export > .tar \u4fdd\u5b58\u955c\u50cf\u4e3a tar \u5305 docker import .tar \u4ece tar \u5305\u5bfc\u5165\u955c\u50cf docker tag : \u7ed9\u955c\u50cf\u6253 tag\uff08\u91cd\u547d\u540d\uff09","title":"\u955c\u50cf\u76f8\u5173"},{"location":"utils/docker/#_5","text":"docker ps -a \u5217\u51fa\u6b63\u5728\u8fd0\u884c\u7684\u5bb9\u5668 docker run \u8fd0\u884c\u955c\u50cf -i \u4ea4\u4e92\u6a21\u5f0f -t \u5206\u914d\u865a\u62df\u7ec8\u7aef -d \u540e\u53f0\u8fd0\u884c -p : \u7aef\u53e3\u6620\u5c04 -v : \u76ee\u5f55\u6620\u5c04 -e = \u73af\u5883\u53d8\u91cf --name \u5bb9\u5668\u540d --rm \u8fd0\u884c\u5b8c\u540e\u81ea\u52a8\u5220\u9664\u5bb9\u5668 --network \u6307\u5b9a\u7f51\u7edc docker start \u542f\u52a8\u5bb9\u5668 docker restart \u91cd\u542f\u5bb9\u5668 docker stop \u505c\u6b62\u5bb9\u5668 docker rm \u5220\u9664\u5bb9\u5668 docker exec -it /bin/bash \u8fdb\u5165\u5bb9\u5668\uff08\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker attach \u8fdb\u5165\u5bb9\u5668\uff08\u4e0d\u542f\u52a8\u65b0\u7684\u8fdb\u7a0b\uff09 docker cp ... ... \u5728\u672c\u5730\u548c\u5bb9\u5668\u4e4b\u95f4\u590d\u5236\u6587\u4ef6\uff08\u7528\u6cd5\u7c7b\u4f3c scp\uff09 docker logs \u67e5\u770b\u5bb9\u5668\u65e5\u5fd7 -t \u663e\u793a\u65f6\u95f4\u6233 -f \u6253\u5370\u6700\u65b0\u7684\u65e5\u5fd7 -tail number \u663e\u793anumber\u6761 docker top \u67e5\u770b\u5bb9\u5668\u4e2d\u8fd0\u884c\u7684\u8fdb\u7a0b\u4fe1\u606f docker inspect \u67e5\u770b\u5bb9\u5668/\u955c\u50cf\u7684\u5143\u6570\u636e exit \u5bb9\u5668\u505c\u6b62\u5e76\u9000\u51fa Ctrl+P+Q \u5bb9\u5668\u4e0d\u505c\u6b62\u9000\u51fa","title":"\u5bb9\u5668\u76f8\u5173"},{"location":"utils/docker/#_6","text":"docker network ls \u5217\u51fa\u7f51\u7edc docker network create \u521b\u5efa\u7f51\u7edc docker network connect \u5c06\u5bb9\u5668\u8fde\u63a5\u5230\u7f51\u7edc docker network inspect \u67e5\u770b\u7f51\u7edc\u4fe1\u606f docker network rm \u5220\u9664\u7f51\u7edc","title":"\u7f51\u7edc\u76f8\u5173"},{"location":"utils/docker/#_7","text":"docker login \u8fde\u63a5 registry docker login \u8fde\u63a5\u5230 Docker Hub docker login ghcr.io \u8fde\u63a5\u5230 GitHub \u7684\u4ed3\u5e93\uff0c\u7528\u6237\u540d\u662f GitHub \u7528\u6237\u540d\uff0c\u5bc6\u7801\u662f GitHub \u751f\u6210\u7684 token\uff08ghp_ \u5f00\u5934\uff09 docker logout \u65ad\u5f00 registry docker push \u63a8\u9001\u955c\u50cf\u5230 registry\uff08\u4f1a\u6839\u636e\u524d\u7f00\u81ea\u52a8\u9009\u62e9 registry\uff09 docker pull \u4ece registry \u62c9\u53d6\u955c\u50cf","title":"\u4ed3\u5e93\u76f8\u5173"},{"location":"utils/docker/#registry","text":"\u53ef\u4ee5\u5229\u7528 registry \u955c\u50cf\u6765\u81ea\u5efa\u79c1\u6709 registry docker pull registry:2 \u62c9\u53d6 registry \u955c\u50cf \u9700\u8981\u6302\u8f7d\u7684\u76ee\u5f55 ./auth:/auth \uff1a\u7528\u6237\u540d\u548c\u5bc6\u7801\u3002\u5728\u672c\u5730 auth \u76ee\u5f55\u4e0b\u6267\u884c docker run --entrypoint htpasswd registry:2.7.0 -Bbn > htpasswd \u751f\u6210\u6587\u4ef6 ./certs:/certs \uff1aSSL \u8bc1\u4e66\uff0c\u53ef\u4ee5\u7528 acme.sh \u6765\u7b7e ./registry:/var/lib/registry \uff1aregistry \u6570\u636e \u542f\u52a8 registry\uff1a docker run -itd -p 5000 :5000 --restart = always --name registry \\ -v ./certs:/certs \\ -v ./auth:/auth \\ -v ./registry:/var/lib/registry \\ -e \"REGISTRY_HTTP_TLS_CERTIFICATE=/certs/fullchain.cer\" \\ -e \"REGISTRY_HTTP_TLS_KEY=/certs/.key\" \\ -e \"REGISTRY_AUTH=htpasswd\" -e \"REGISTRY_AUTH_HTPASSWD_REALM=Registry Realm\" \\ -e \"REGISTRY_AUTH_HTPASSWD_PATH=/auth/htpasswd\" \\ registry:2 docker login \u767b\u5f55 registry docker tag / \u7ed9\u955c\u50cf\u6253\u4e0a registry \u7684 tag docker push / \u63a8\u9001\u955c\u50cf\u5230 registry","title":"registry \u955c\u50cf"},{"location":"utils/docker/#dockerfile","text":"","title":"Dockerfile"},{"location":"utils/docker/#_8","text":"","title":"\u5e38\u7528\u6362\u6e90"},{"location":"utils/docker/#ubuntu","text":"RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list # RUN sed -i s@/archive.ubuntu.com/@/<...>/@g /etc/apt/sources.list RUN apt-get clean RUN apt-get update","title":"Ubuntu \u8f6f\u4ef6\u6e90"},{"location":"utils/docker/#debian","text":"RUN sed -i s/deb.debian.org/mirrors.aliyun.com/g /etc/apt/sources.list && \\ ln -sf /usr/share/zoneinfo/Asia/Shanghai /etc/localtime && echo 'Asia/Shanghai' >/etc/timezone RUN apt-get update","title":"Debian \u8f6f\u4ef6\u6e90"},{"location":"utils/docker/#reference","text":"Docker\u547d\u4ee4\u5907\u5fd8","title":"Reference"},{"location":"utils/ffmpeg/","text":"ffmpeg \u00b6 \u7ea6 29 \u4e2a\u5b57 10 \u884c\u4ee3\u7801 Abstract ffmpeg \u76f8\u5173 Installation \u00b6 Download Source Code wget https://www.ffmpeg.org/releases/ffmpeg-7.0.tar.gz tar -zxvf ffmpeg-7.0.tar.gz Compile cd ffmpeg-7.0 ./configure --prefix = /usr/local/ffmpeg --enable-openssl --disable-x86asm make && make install Add to PATH vim ~/.bashrc export PATH = $PATH :/usr/local/ffmpeg/bin source ~/.bashrc Check ffmpeg -version Usage \u00b6 \u89c6\u9891\u8f6c\u56fe\u7247 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg ... Reference \u00b6 FFmpeg\u6559\u7a0b\uff08\u8d85\u7ea7\u8be6\u7ec6\u7248\uff09","title":"ffmpeg"},{"location":"utils/ffmpeg/#ffmpeg","text":"\u7ea6 29 \u4e2a\u5b57 10 \u884c\u4ee3\u7801 Abstract ffmpeg \u76f8\u5173","title":"ffmpeg"},{"location":"utils/ffmpeg/#installation","text":"Download Source Code wget https://www.ffmpeg.org/releases/ffmpeg-7.0.tar.gz tar -zxvf ffmpeg-7.0.tar.gz Compile cd ffmpeg-7.0 ./configure --prefix = /usr/local/ffmpeg --enable-openssl --disable-x86asm make && make install Add to PATH vim ~/.bashrc export PATH = $PATH :/usr/local/ffmpeg/bin source ~/.bashrc Check ffmpeg -version","title":"Installation"},{"location":"utils/ffmpeg/#usage","text":"\u89c6\u9891\u8f6c\u56fe\u7247 ffmpeg -i ./data/data_classroom/classroom.mov -qscale:v 1 -qmin 1 -vf fps = 8 /path/to/data/input/%04d.jpg ...","title":"Usage"},{"location":"utils/ffmpeg/#reference","text":"FFmpeg\u6559\u7a0b\uff08\u8d85\u7ea7\u8be6\u7ec6\u7248\uff09","title":"Reference"},{"location":"utils/gdb/","text":"gdb \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 750 \u4e2a\u5b57 3 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract gdb\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\uff0c\u63d2\u4ef6\u7b49 \u524d\u8a00 \u00b6 \u4ec0\u4e48\u662fgdb \u00b6 GNU\u8c03\u8bd5\u5668\uff08\u82f1\u8bed\uff1aGNU Debugger\uff0c\u7f29\u5199\uff1aGDB\uff09\uff0c\u662fGNU\u8f6f\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6807\u51c6\u8c03\u8bd5\u5668\uff0c\u6b64\u5916GDB\u4e5f\u662f\u4e2a\u5177\u6709\u79fb\u643a\u6027\u7684\u8c03\u8bd5\u5668\uff0c\u7ecf\u8fc7\u79fb\u643a\u9700\u6c42\u7684\u8c03\u4fee\u4e0e\u91cd\u65b0\u7f16\u8bd1\uff0c\u5982\u4eca\u8bb8\u591a\u7684\u7c7bUNIX\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u53ef\u4ee5\u4f7f\u7528GDB\uff0c\u800c\u73b0\u6709GDB\u6240\u80fd\u652f\u6301\u8c03\u8bd5\u7684\u7f16\u7a0b\u8bed\u8a00\u6709C\u3001C++\u3001Pascal\u4ee5\u53caFORTRAN\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1 \u51c6\u5907\u5de5\u4f5c \u00b6 \u901a\u5e38\uff0c\u5728\u4e3a\u8c03\u8bd5\u800c\u7f16\u8bd1\u65f6\uff0c\u6211\u4eec\u4f1a\u5173\u6389\u7f16\u8bd1\u5668\u7684\u4f18\u5316\u9009\u9879 \uff08-O\uff09 \uff0c \u5e76\u6253\u5f00\u8c03\u8bd5\u9009\u9879 \uff08-g\uff09 \u3002\u53e6\u5916\uff0c -Wall \u5728\u5c3d\u91cf\u4e0d\u5f71\u54cd\u7a0b\u5e8f\u884c\u4e3a\u7684\u60c5\u51b5\u4e0b\u9009\u9879\u6253\u5f00\u6240\u6709warning\uff0c\u4e5f\u53ef\u4ee5\u53d1\u73b0\u8bb8\u591a\u95ee\u9898\uff0c\u907f\u514d\u4e00\u4e9b\u4e0d\u5fc5\u8981\u7684 BUG\u3002 \u4f8b\u5982\uff1a gcc -g -Wall program.c -o program -g \u9009\u9879\u7684\u4f5c\u7528\u662f\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u52a0\u5165\u6e90\u4ee3\u7801\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u7b2c\u51e0\u6761\u673a \u5668\u6307\u4ee4\u5bf9\u5e94\u6e90\u4ee3\u7801\u7684\u7b2c\u51e0\u884c\uff0c\u4f46\u5e76\u4e0d\u662f\u628a\u6574\u4e2a\u6e90\u6587\u4ef6\u5d4c\u5165\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u5728\u8c03 \u8bd5\u65f6\u5fc5\u987b\u4fdd\u8bc1 gdb \u80fd\u627e\u5230\u6e90\u6587\u4ef6\u3002 \u8c03\u8bd5\u4e0b\u5217\u7a0b\u5e8f\u524d\u8981\u505a\u51c6\u5907\u5de5\u4f5c\uff0c\u5728shell\u4e2d\u8f93\u5165\uff1a $ gcc -g -Wall test.c -o test gdb\u547d\u4ee4 \u00b6 \u8fc7\u7a0b\u64cd\u4f5c \u00b6 gdb (\u53ef\u6267\u884c\u7a0b\u5e8f) \u542f\u52a8gdb\u8c03\u8bd5 quit / q \u9000\u51fagdb\u8c03\u8bd5 set args 10 20 \u7ed9\u7a0b\u5e8f\u8bbe\u7f6e\u53c2\u6570 show args \u83b7\u53d6\u8bbe\u7f6e\u7684\u53c2\u6570 help \u7528\u6765\u67e5\u770b\u8c03\u8bd5\u5e2e\u52a9\u6216\u5177\u4f53\u6307\u4ee4\u7684\u76f8\u5173\u4fe1\u606f list \u67e5\u770b\u5f53\u524d\u6587\u4ef6\u4ee3\u7801\uff0c\u53ef\u4ee5\u6307\u5b9a\u6587\u4ef6\u548c\u51fd\u6570 (l) set list / listsize \u8bbe\u7f6e\u663e\u793a\u7684\u884c\u6570 print \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u503c(p) ptype \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u7c7b\u578b until \u8df3\u51fa\u5faa\u73af \u65ad\u70b9 \u00b6 gdb break (file:)line/function \u65ad\u5728(\u6587\u4ef6:)\u884c\u53f7\u6216\u51fd\u6570(b) gdb break *0x.... \u65ad\u5728\u5730\u5740 gdb info breakpoints \u67e5\u770b\u65ad\u70b9\u53ca\u72b6\u6001 (i b) gdb delete / clear \u6e05\u9664\u6240\u6709\u65ad\u70b9 (d/cl) gdb delete \u5220\u9664\u67d0\u4e00\u65ad\u70b9\uff08\u4ece i b \u5f97\u6765\u65ad\u70b9\u53f7\uff09 gdb clear ... \u6e05\u9664\u67d0\u4e00\u7b26\u53f7\u3001\u5730\u5740\u5904\u7684\u65ad\u70b9 gdb disable \u7981\u7528\u67d0\u4e00\u65ad\u70b9 gdb enable \u542f\u7528\u67d0\u4e00\u65ad\u70b9 gdb watch ... \u5728\u67d0\u5904\u589e\u52a0\u89c2\u5bdf\u70b9\uff0cdelete\u3001enable\u3001disable \u4e0e\u65ad\u70b9\u5171\u7528 gdb break/watch if \u5982\u679c\u6761\u4ef6\u6ee1\u8db3\u5219\u65ad gdb condition \u66f4\u6539\u6761\u4ef6 \u8fd0\u884c \u00b6 gdb start \u7a0b\u5e8f\u505c\u5728\u7b2c\u4e00\u884c gdb run \u76f4\u63a5\u8fd0\u884c\uff0c\u9047\u5230\u7aef\u70b9\u624d\u505c\u6b62 (r) gdb continue \u7ee7\u7eed\u8fd0\u884c (c) gdb step \u8fd0\u884c\u5230\u4e0b\u4e00\u6761\u6e90\u7801 (s) gdb next \u5355\u6b65\u8fd0\u884c\uff0c\u8df3\u8fc7\u51fd\u6570 (n) gdb finish \u8fd0\u884c\u5b8c\u5f53\u524d\u51fd\u6570 (fin) gdb attach \u8fde\u63a5\u7a0b\u5e8f gdb detach \u4ece\u5f53\u524d\u7a0b\u5e8f\u65ad\u8fde gdb target remote localhost:1234 \u8fde\u63a5 qemu \u8c03\u7528\u6808 \u00b6 gdb backtrace \u67e5\u770b\u8c03\u7528\u6808 (bt) gdb frame \u67e5\u770b\u5f53\u524d\u5e27\u6808 gdb up/down \u79fb\u52a8\u5f53\u524d\u5e27\u6808\uff08\u5411 main / \u8fdc\u79bb main\uff09 gdb info locals \u67e5\u770b\u5f53\u524d\u5e27\u6808\u53d8\u91cf gdb info args \u67e5\u770b\u51fd\u6570\u53c2\u6570 gdb\u63d2\u4ef6 \u00b6 gdb-peda \u00b6 \u6bcf\u6761\u6307\u4ee4\u5e26\u5bc4\u5b58\u5668\u3001\u6c47\u7f16\u3001\u5185\u5b58\u6570\u636e\u56de\u663e $ git clone https://github.com/longld/peda.git ~/peda $ echo \"source ~/peda/peda.py\" >> ~/.gdbinit \u5176\u5b9e\u5c31\u662f\u4e0b\u8f7d\u5b8c\u6210\u540e, \u5c06 source ~/peda/peda.py \u5199\u5165 ~/.gdbinit Reference \u00b6 jujimeizuo\u7684Linux GDB\u8c03\u8bd5 gdb\u76f8\u5173\u5907\u5fd8 \u7ef4\u57fa\u767e\u79d1-gdb GDB\u5b9e\u7528\u63d2\u4ef6(peda, gef, gdbinit)\u5168\u89e3","title":"gdb \u547d\u4ee4\u76f8\u5173"},{"location":"utils/gdb/#gdb","text":"\u7ea6 750 \u4e2a\u5b57 3 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract gdb\u76f8\u5173\u7684\u4e00\u4e9b\u547d\u4ee4\uff0c\u63d2\u4ef6\u7b49","title":"gdb \u547d\u4ee4\u76f8\u5173"},{"location":"utils/gdb/#_1","text":"","title":"\u524d\u8a00"},{"location":"utils/gdb/#gdb_1","text":"GNU\u8c03\u8bd5\u5668\uff08\u82f1\u8bed\uff1aGNU Debugger\uff0c\u7f29\u5199\uff1aGDB\uff09\uff0c\u662fGNU\u8f6f\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6807\u51c6\u8c03\u8bd5\u5668\uff0c\u6b64\u5916GDB\u4e5f\u662f\u4e2a\u5177\u6709\u79fb\u643a\u6027\u7684\u8c03\u8bd5\u5668\uff0c\u7ecf\u8fc7\u79fb\u643a\u9700\u6c42\u7684\u8c03\u4fee\u4e0e\u91cd\u65b0\u7f16\u8bd1\uff0c\u5982\u4eca\u8bb8\u591a\u7684\u7c7bUNIX\u64cd\u4f5c\u7cfb\u7edf\u4e0a\u90fd\u53ef\u4ee5\u4f7f\u7528GDB\uff0c\u800c\u73b0\u6709GDB\u6240\u80fd\u652f\u6301\u8c03\u8bd5\u7684\u7f16\u7a0b\u8bed\u8a00\u6709C\u3001C++\u3001Pascal\u4ee5\u53caFORTRAN\u3002 \u2014\u2014\u2014\u2014 \u7ef4\u57fa\u767e\u79d1","title":"\u4ec0\u4e48\u662fgdb"},{"location":"utils/gdb/#_2","text":"\u901a\u5e38\uff0c\u5728\u4e3a\u8c03\u8bd5\u800c\u7f16\u8bd1\u65f6\uff0c\u6211\u4eec\u4f1a\u5173\u6389\u7f16\u8bd1\u5668\u7684\u4f18\u5316\u9009\u9879 \uff08-O\uff09 \uff0c \u5e76\u6253\u5f00\u8c03\u8bd5\u9009\u9879 \uff08-g\uff09 \u3002\u53e6\u5916\uff0c -Wall \u5728\u5c3d\u91cf\u4e0d\u5f71\u54cd\u7a0b\u5e8f\u884c\u4e3a\u7684\u60c5\u51b5\u4e0b\u9009\u9879\u6253\u5f00\u6240\u6709warning\uff0c\u4e5f\u53ef\u4ee5\u53d1\u73b0\u8bb8\u591a\u95ee\u9898\uff0c\u907f\u514d\u4e00\u4e9b\u4e0d\u5fc5\u8981\u7684 BUG\u3002 \u4f8b\u5982\uff1a gcc -g -Wall program.c -o program -g \u9009\u9879\u7684\u4f5c\u7528\u662f\u5728\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u52a0\u5165\u6e90\u4ee3\u7801\u7684\u4fe1\u606f\uff0c\u6bd4\u5982\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\u7b2c\u51e0\u6761\u673a \u5668\u6307\u4ee4\u5bf9\u5e94\u6e90\u4ee3\u7801\u7684\u7b2c\u51e0\u884c\uff0c\u4f46\u5e76\u4e0d\u662f\u628a\u6574\u4e2a\u6e90\u6587\u4ef6\u5d4c\u5165\u5230\u53ef\u6267\u884c\u6587\u4ef6\u4e2d\uff0c\u6240\u4ee5\u5728\u8c03 \u8bd5\u65f6\u5fc5\u987b\u4fdd\u8bc1 gdb \u80fd\u627e\u5230\u6e90\u6587\u4ef6\u3002 \u8c03\u8bd5\u4e0b\u5217\u7a0b\u5e8f\u524d\u8981\u505a\u51c6\u5907\u5de5\u4f5c\uff0c\u5728shell\u4e2d\u8f93\u5165\uff1a $ gcc -g -Wall test.c -o test","title":"\u51c6\u5907\u5de5\u4f5c"},{"location":"utils/gdb/#gdb_2","text":"","title":"gdb\u547d\u4ee4"},{"location":"utils/gdb/#_3","text":"gdb (\u53ef\u6267\u884c\u7a0b\u5e8f) \u542f\u52a8gdb\u8c03\u8bd5 quit / q \u9000\u51fagdb\u8c03\u8bd5 set args 10 20 \u7ed9\u7a0b\u5e8f\u8bbe\u7f6e\u53c2\u6570 show args \u83b7\u53d6\u8bbe\u7f6e\u7684\u53c2\u6570 help \u7528\u6765\u67e5\u770b\u8c03\u8bd5\u5e2e\u52a9\u6216\u5177\u4f53\u6307\u4ee4\u7684\u76f8\u5173\u4fe1\u606f list \u67e5\u770b\u5f53\u524d\u6587\u4ef6\u4ee3\u7801\uff0c\u53ef\u4ee5\u6307\u5b9a\u6587\u4ef6\u548c\u51fd\u6570 (l) set list / listsize \u8bbe\u7f6e\u663e\u793a\u7684\u884c\u6570 print \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u503c(p) ptype \u53d8\u91cf\u540d \u6253\u5370\u53d8\u91cf\u7c7b\u578b until \u8df3\u51fa\u5faa\u73af","title":"\u8fc7\u7a0b\u64cd\u4f5c"},{"location":"utils/gdb/#_4","text":"gdb break (file:)line/function \u65ad\u5728(\u6587\u4ef6:)\u884c\u53f7\u6216\u51fd\u6570(b) gdb break *0x.... \u65ad\u5728\u5730\u5740 gdb info breakpoints \u67e5\u770b\u65ad\u70b9\u53ca\u72b6\u6001 (i b) gdb delete / clear \u6e05\u9664\u6240\u6709\u65ad\u70b9 (d/cl) gdb delete \u5220\u9664\u67d0\u4e00\u65ad\u70b9\uff08\u4ece i b \u5f97\u6765\u65ad\u70b9\u53f7\uff09 gdb clear ... \u6e05\u9664\u67d0\u4e00\u7b26\u53f7\u3001\u5730\u5740\u5904\u7684\u65ad\u70b9 gdb disable \u7981\u7528\u67d0\u4e00\u65ad\u70b9 gdb enable \u542f\u7528\u67d0\u4e00\u65ad\u70b9 gdb watch ... \u5728\u67d0\u5904\u589e\u52a0\u89c2\u5bdf\u70b9\uff0cdelete\u3001enable\u3001disable \u4e0e\u65ad\u70b9\u5171\u7528 gdb break/watch if \u5982\u679c\u6761\u4ef6\u6ee1\u8db3\u5219\u65ad gdb condition \u66f4\u6539\u6761\u4ef6","title":"\u65ad\u70b9"},{"location":"utils/gdb/#_5","text":"gdb start \u7a0b\u5e8f\u505c\u5728\u7b2c\u4e00\u884c gdb run \u76f4\u63a5\u8fd0\u884c\uff0c\u9047\u5230\u7aef\u70b9\u624d\u505c\u6b62 (r) gdb continue \u7ee7\u7eed\u8fd0\u884c (c) gdb step \u8fd0\u884c\u5230\u4e0b\u4e00\u6761\u6e90\u7801 (s) gdb next \u5355\u6b65\u8fd0\u884c\uff0c\u8df3\u8fc7\u51fd\u6570 (n) gdb finish \u8fd0\u884c\u5b8c\u5f53\u524d\u51fd\u6570 (fin) gdb attach \u8fde\u63a5\u7a0b\u5e8f gdb detach \u4ece\u5f53\u524d\u7a0b\u5e8f\u65ad\u8fde gdb target remote localhost:1234 \u8fde\u63a5 qemu","title":"\u8fd0\u884c"},{"location":"utils/gdb/#_6","text":"gdb backtrace \u67e5\u770b\u8c03\u7528\u6808 (bt) gdb frame \u67e5\u770b\u5f53\u524d\u5e27\u6808 gdb up/down \u79fb\u52a8\u5f53\u524d\u5e27\u6808\uff08\u5411 main / \u8fdc\u79bb main\uff09 gdb info locals \u67e5\u770b\u5f53\u524d\u5e27\u6808\u53d8\u91cf gdb info args \u67e5\u770b\u51fd\u6570\u53c2\u6570","title":"\u8c03\u7528\u6808"},{"location":"utils/gdb/#gdb_3","text":"","title":"gdb\u63d2\u4ef6"},{"location":"utils/gdb/#gdb-peda","text":"\u6bcf\u6761\u6307\u4ee4\u5e26\u5bc4\u5b58\u5668\u3001\u6c47\u7f16\u3001\u5185\u5b58\u6570\u636e\u56de\u663e $ git clone https://github.com/longld/peda.git ~/peda $ echo \"source ~/peda/peda.py\" >> ~/.gdbinit \u5176\u5b9e\u5c31\u662f\u4e0b\u8f7d\u5b8c\u6210\u540e, \u5c06 source ~/peda/peda.py \u5199\u5165 ~/.gdbinit","title":"gdb-peda"},{"location":"utils/gdb/#reference","text":"jujimeizuo\u7684Linux GDB\u8c03\u8bd5 gdb\u76f8\u5173\u5907\u5fd8 \u7ef4\u57fa\u767e\u79d1-gdb GDB\u5b9e\u7528\u63d2\u4ef6(peda, gef, gdbinit)\u5168\u89e3","title":"Reference"},{"location":"utils/git/","text":"Git \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 324 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u4e00\u4e9b\u5e38\u7528 / \u5e38\u5fd8\u7684 git \u547d\u4ee4 \u5206\u652f \u00b6 git branch \u521b\u5efa\u5206\u652f git checkout \u5207\u6362\u5206\u652f git checkout -b \u521b\u5efa\u5206\u652f\uff0c\u5e76\u5207\u6362\u8fc7\u53bb git diff master \u663e\u793a\u5206\u652f\u548c\u4e3b\u5206\u652f\u7684\u5dee\u522b git clone -b \u514b\u9686\u5355\u4e2a\u5206\u652f git branch -d \u5220\u9664\u5206\u652f git branch -a \u67e5\u770b\u6240\u6709\u5206\u652f git merge \u5408\u5e76\u5206\u652f \u8fdc\u7a0b\u4ed3\u5e93 \u00b6 git fetch \u83b7\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5386\u53f2\u8bb0\u5f55 git pull \u5c06\u672c\u5730\u4ed3\u5e93\u66f4\u65b0, pull = fetch + merge git push origin \u5c06\u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93 \u6539\u5199\u63d0\u4ea4 \u00b6 git commit --amend \u4fee\u6539\u6700\u8fd1\u7684\u63d0\u4ea4 git revert HEAD \u53d6\u6d88\u8fc7\u53bb\u7684\u63d0\u4ea4 git reset --soft HEAD^ \u64a4\u9500 commit\uff08\u4e0d\u66f4\u6539\u6587\u4ef6\uff09 git reset --hard HEAD^ \u64a4\u9500 commit\uff08\u6587\u4ef6\u56de\u9000\u5230\u4e0a\u4e00\u7248\u672c\uff09 git rm --cached \u5df2 add \u672a commit \u7684\u6587\u4ef6\u9000\u56de\u672a add \u72b6\u6001 git checkout . \u53d6\u6d88\u672c\u6b21\u672a\u88abcommit\u7684\u4fee\u6539 git rebase \u53d8\u57fa git rebase -i \u5408\u5e76/\u4fee\u6539\u63d0\u4ea4\uff0c \u6700\u597d\u7528fetch+rebase\u7684\u65b9\u5f0f\u6765\u5408\u5e76 \u6807\u7b7e \u00b6 git tag \u663e\u793a\u6240\u6709\u6807\u7b7e\u5217\u8868 git tag \u6dfb\u52a0\u8f7b\u6807\u7b7e git tag -a \u6dfb\u52a0\u6ce8\u89e3\u6807\u7b7e git tag -d \u5220\u9664\u6807\u7b7e awesome_git_log \u00b6 \u4e3a\u4e86\u65b9\u4fbf\u67e5\u770b commit \u76f8\u5173\u4fe1\u606f\uff0c\u7528 alias \u6765\u7b80\u5316\u64cd\u4f5c\uff0c\u5c06\u4e0b\u9762\u4ee3\u7801\u7c98\u8d34\u5230 bashrc \u4e2d\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u76f4\u63a5 awe+tab \u5373\u53ef\u3002 # git function git_branch { branch = \"`git branch 2>/dev/null | grep \" ^ \\* \" | sed -e \" s/^ \\*\\ // \"`\" if [ \" ${ branch } \" ! = \"\" ] ; then if [ \" ${ branch } \" = \"(no branch)\" ] ; then branch = \"(`git rev-parse --short HEAD`...)\" fi echo \" ( $branch )\" fi } alias __git_awesome_log = \"git log --oneline --decorate --all --graph\" alias awesome_git_log = \"git log --oneline --decorate --all --graph\" Reference \u00b6 \u7334\u5b50\u90fd\u80fd\u61c2\u7684GIT\u5165\u95e8 Git\u547d\u4ee4\u5907\u5fd8","title":"Git \u547d\u4ee4\u76f8\u5173"},{"location":"utils/git/#git","text":"\u7ea6 324 \u4e2a\u5b57 13 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u4e00\u4e9b\u5e38\u7528 / \u5e38\u5fd8\u7684 git \u547d\u4ee4","title":"Git \u547d\u4ee4\u76f8\u5173"},{"location":"utils/git/#_1","text":"git branch \u521b\u5efa\u5206\u652f git checkout \u5207\u6362\u5206\u652f git checkout -b \u521b\u5efa\u5206\u652f\uff0c\u5e76\u5207\u6362\u8fc7\u53bb git diff master \u663e\u793a\u5206\u652f\u548c\u4e3b\u5206\u652f\u7684\u5dee\u522b git clone -b \u514b\u9686\u5355\u4e2a\u5206\u652f git branch -d \u5220\u9664\u5206\u652f git branch -a \u67e5\u770b\u6240\u6709\u5206\u652f git merge \u5408\u5e76\u5206\u652f","title":"\u5206\u652f"},{"location":"utils/git/#_2","text":"git fetch \u83b7\u53d6\u8fdc\u7a0b\u4ed3\u5e93\u7684\u5386\u53f2\u8bb0\u5f55 git pull \u5c06\u672c\u5730\u4ed3\u5e93\u66f4\u65b0, pull = fetch + merge git push origin \u5c06\u5206\u652f\u63a8\u9001\u5230\u8fdc\u7a0b\u4ed3\u5e93","title":"\u8fdc\u7a0b\u4ed3\u5e93"},{"location":"utils/git/#_3","text":"git commit --amend \u4fee\u6539\u6700\u8fd1\u7684\u63d0\u4ea4 git revert HEAD \u53d6\u6d88\u8fc7\u53bb\u7684\u63d0\u4ea4 git reset --soft HEAD^ \u64a4\u9500 commit\uff08\u4e0d\u66f4\u6539\u6587\u4ef6\uff09 git reset --hard HEAD^ \u64a4\u9500 commit\uff08\u6587\u4ef6\u56de\u9000\u5230\u4e0a\u4e00\u7248\u672c\uff09 git rm --cached \u5df2 add \u672a commit \u7684\u6587\u4ef6\u9000\u56de\u672a add \u72b6\u6001 git checkout . \u53d6\u6d88\u672c\u6b21\u672a\u88abcommit\u7684\u4fee\u6539 git rebase \u53d8\u57fa git rebase -i \u5408\u5e76/\u4fee\u6539\u63d0\u4ea4\uff0c \u6700\u597d\u7528fetch+rebase\u7684\u65b9\u5f0f\u6765\u5408\u5e76","title":"\u6539\u5199\u63d0\u4ea4"},{"location":"utils/git/#_4","text":"git tag \u663e\u793a\u6240\u6709\u6807\u7b7e\u5217\u8868 git tag \u6dfb\u52a0\u8f7b\u6807\u7b7e git tag -a \u6dfb\u52a0\u6ce8\u89e3\u6807\u7b7e git tag -d \u5220\u9664\u6807\u7b7e","title":"\u6807\u7b7e"},{"location":"utils/git/#awesome_git_log","text":"\u4e3a\u4e86\u65b9\u4fbf\u67e5\u770b commit \u76f8\u5173\u4fe1\u606f\uff0c\u7528 alias \u6765\u7b80\u5316\u64cd\u4f5c\uff0c\u5c06\u4e0b\u9762\u4ee3\u7801\u7c98\u8d34\u5230 bashrc \u4e2d\uff0c\u7136\u540e\u5728\u7ec8\u7aef\u4e2d\u76f4\u63a5 awe+tab \u5373\u53ef\u3002 # git function git_branch { branch = \"`git branch 2>/dev/null | grep \" ^ \\* \" | sed -e \" s/^ \\*\\ // \"`\" if [ \" ${ branch } \" ! = \"\" ] ; then if [ \" ${ branch } \" = \"(no branch)\" ] ; then branch = \"(`git rev-parse --short HEAD`...)\" fi echo \" ( $branch )\" fi } alias __git_awesome_log = \"git log --oneline --decorate --all --graph\" alias awesome_git_log = \"git log --oneline --decorate --all --graph\"","title":"awesome_git_log"},{"location":"utils/git/#reference","text":"\u7334\u5b50\u90fd\u80fd\u61c2\u7684GIT\u5165\u95e8 Git\u547d\u4ee4\u5907\u5fd8","title":"Reference"},{"location":"utils/gitbook/","text":"gitbook \u00b6 \u524d\u7f6e\u8981\u6c42 \u00b6 nodejs \u00b6 \u9ad8\u7248\u672c\u53ef\u80fd\u4e0d\u517c\u5bb9\uff0c\u9700\u8981\u7248\u672c\u5728v10\u5de6\u53f3\u3002 https://nodejs.org/download/release/v10.21.0/ \u66f4\u6362\u955c\u50cf \u00b6 npm config get registry npm config set registry https://registry.npm.taobao.org \u5b89\u88c5 \u00b6 npm uninstall -g gitbook-cli \u5b89\u88c5\u5b8c\u4e4b\u540e\u7528 gitbook -V \u67e5\u770b\u7248\u672c\uff0c\u81ea\u52a8install gitbook\u3002 \u4f7f\u7528 \u00b6 gitbook -V \u67e5\u770b\u7248\u672c\u53f7 gitbook init \u521d\u59cb\u5316 gitbook serve \u9884\u89c8 gitbook build \u751f\u6210 gitbook build --gitbook = 2 .6.7 \u751f\u6210\u65f6\u6307\u5b9agitbook\u7684\u7248\u672c, \u672c\u5730\u6ca1\u6709\u4f1a\u5148\u4e0b\u8f7d gitbook uninstall 2 .6.7 \u5378\u8f7d\u6307\u5b9a\u7248\u672c\u53f7\u7684gitbook gitbook fetch [ version ] \u83b7\u53d6 [ \u7248\u672c ] \u4e0b\u8f7d\u5e76\u5b89\u88c5<\u7248\u672c> gitbook --help \u663e\u793a\u5e2e\u52a9\u6587\u6863 gitbook ls-remote \u5217\u51faNPM\u4e0a\u7684\u53ef\u7528\u7248\u672c\uff1a","title":"gitbook"},{"location":"utils/gitbook/#gitbook","text":"","title":"gitbook"},{"location":"utils/gitbook/#_1","text":"","title":"\u524d\u7f6e\u8981\u6c42"},{"location":"utils/gitbook/#nodejs","text":"\u9ad8\u7248\u672c\u53ef\u80fd\u4e0d\u517c\u5bb9\uff0c\u9700\u8981\u7248\u672c\u5728v10\u5de6\u53f3\u3002 https://nodejs.org/download/release/v10.21.0/","title":"nodejs"},{"location":"utils/gitbook/#_2","text":"npm config get registry npm config set registry https://registry.npm.taobao.org","title":"\u66f4\u6362\u955c\u50cf"},{"location":"utils/gitbook/#_3","text":"npm uninstall -g gitbook-cli \u5b89\u88c5\u5b8c\u4e4b\u540e\u7528 gitbook -V \u67e5\u770b\u7248\u672c\uff0c\u81ea\u52a8install gitbook\u3002","title":"\u5b89\u88c5"},{"location":"utils/gitbook/#_4","text":"gitbook -V \u67e5\u770b\u7248\u672c\u53f7 gitbook init \u521d\u59cb\u5316 gitbook serve \u9884\u89c8 gitbook build \u751f\u6210 gitbook build --gitbook = 2 .6.7 \u751f\u6210\u65f6\u6307\u5b9agitbook\u7684\u7248\u672c, \u672c\u5730\u6ca1\u6709\u4f1a\u5148\u4e0b\u8f7d gitbook uninstall 2 .6.7 \u5378\u8f7d\u6307\u5b9a\u7248\u672c\u53f7\u7684gitbook gitbook fetch [ version ] \u83b7\u53d6 [ \u7248\u672c ] \u4e0b\u8f7d\u5e76\u5b89\u88c5<\u7248\u672c> gitbook --help \u663e\u793a\u5e2e\u52a9\u6587\u6863 gitbook ls-remote \u5217\u51faNPM\u4e0a\u7684\u53ef\u7528\u7248\u672c\uff1a","title":"\u4f7f\u7528"},{"location":"utils/hexo/","text":"","title":"hexo"},{"location":"utils/imagemagick/","text":"","title":"ImageMagick"},{"location":"utils/mkdocs/","text":"","title":"mkdocs"},{"location":"utils/reveal-md/","text":"reveal-md \u00b6 \u7ea6 757 \u4e2a\u5b57 21 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract RevealJS \u662f\u4e00\u4e2a\u7b80\u5355\u4e14\u652f\u6301 markdown \u7684\u5de5\u5177\uff0c\u7136\u540e\u8f6c\u6362\u6210 PPT\u3002 \u8fd9\u91cc\u63a8\u8350\u4e00\u4e2aslide\u6a21\u7248 TonyCrane/slide-template \u3002 \u672c\u4eba\u4e0d\u559c\u6b22\u5199 PPT\uff08\u4e5f\u4e0d\u4f1a\u5199\uff09 \u4ec0\u4e48\u662f reveal-md \u00b6 \u53ef\u4ee5\u53ea\u7528\u5199 markdown \u7684\u65b9\u5f0f\u5199 PPT\uff0c\u5c06 markdown \u8f6c\u6362\u6210 html\uff0c\u6216\u5bfc\u51fa PDF \u662f revealjs \u7684 makrdown \u529f\u80fd \u5b89\u88c5 reveal-md \u00b6 \u672c\u5730\u6784\u5efa \u00b6 reveal.js \u4f7f\u7528 nodejs \u6784\u5efa\uff0c\u9700\u8981\u63d0\u524d\u5b89\u88c5\u597d nodejs \u901a\u8fc7 npm \u5b89\u88c5 reveal-md $ npm install -g reveal-md $ reveal-md slides.md # \u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\u5e76\u5728\u9ed8\u8ba4\u6d4f\u89c8\u5668\u4e2d\u5c06\u4efb\u4f55 Markdown \u6587\u4ef6\u6f14\u793a\u6587\u7a3f\u6253\u5f00 Docker \u6784\u5efa \u00b6 \u4e0d\u9700\u8981\u5b89\u88c5 node.js \u5728\u5bb9\u5668\u4e2d\u542f\u7528\u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d\uff0c\u8fd8\u5e94\u8be5\u6620\u5c04\u7aef\u53e3 35729 $ docker run --rm -p 1948 :1948 -p 35729 :35729 -v :/slides webpronl/reveal-md:latest /slides --watch \u76f8\u5173\u547d\u4ee4 \u00b6 reveal-md -w \u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d reveal-md --scripts [url/*.js] \u81ea\u5b9a\u4e49 js reveal-md --css [url/*.js] \u81ea\u5b9a\u4e49 css reveal-md --static [--static-dirs=assets] \u5bfc\u51fa\u5230\u72ec\u7acb\u7684 HTML \u7f51\u7ad9 (\u5c06\u5305\u542b\u5176\u4ed6\u9759\u6001\u8d44\u6e90\u7684\u76ee\u5f55\u590d\u5236\u5230\u76ee\u6807\u76ee\u5f55) reveal-md --print [--print-size 1024x768 / A4] name.pdf \u6253\u5370\u6210 PDF\uff08\u6216\u8005\u5728\u6d4f\u89c8\u5668\u7684 url \u540e\u6dfb\u52a0 ?print-pdf reveal-md --template \u81ea\u5b9a\u4e49\u6a21\u7248 \u914d\u7f6e \u00b6 yaml \u914d\u7f6e \u00b6 \u53ef\u4ee5\u5728 markdown \u6587\u4ef6\u4e2d\u901a\u8fc7 yaml \u8fdb\u884c\u914d\u7f6e --- title : Slide \u6a21\u677f # \u5e7b\u706f\u7247\u540d\u79f0 separator : # \u5e7b\u706f\u7247\u6a2a\u884c\u5207\u5272\u6807\u5fd7 verticalSeparator : # \u5e7b\u706f\u7247\u5782\u76f4\u5207\u5272\u6807\u5fd7 theme : simple # \u5e7b\u706f\u7247\u4e3b\u9898 highlightTheme : github # \u4ee3\u7801\u9ad8\u4eae\u4e3b\u9898 css : custom.css # \u81ea\u5b9a\u4e49 css revealOptions : transition : 'slide' # \u52a8\u753b\u6548\u679c transitionSpeed : fast # \u52a8\u753b\u901f\u5ea6 center : false # \u662f\u5426\u5c45\u4e2d slideNumber : \"c/t\" # \u5e7b\u706f\u7247\u6570\u91cf width : 1000 # \u5e7b\u706f\u7247\u5bbd\u5ea6 --- \u5e7b\u706f\u7247\u4e3b\u9898 \u00b6 \u9ed8\u8ba4\u4e3b\u9898 \u540d\u79f0 \u6548\u679c black \u9ed1\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5\uff08\u9ed8\u8ba4\uff09 white \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 league \u7070\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u5b57\uff0c\u84dd\u8272\u94fe\u63a5 beige \u7c73\u8272\u80cc\u666f\uff0c\u6df1\u8272\u6587\u5b57\uff0c\u68d5\u8272\u94fe\u63a5 sky \u84dd\u8272\u80cc\u666f\uff0c\u7ec6\u6697\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 night \u9ed1\u8272\u80cc\u666f\uff0c\u539a\u767d\u8272\u6587\u5b57\uff0c\u6a59\u8272\u94fe\u63a5 serif \u5361\u5e03\u5947\u8bfa\u80cc\u666f\uff0c\u7070\u8272\u6587\u672c\uff0c\u68d5\u8272\u94fe\u63a5 simple \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 solarized \u9ad8\u5206\u8fa8\u7387\u7167\u7247 blood \u6df1\u8272\u80cc\u666f\uff0c\u539a\u767d\u6587\u5b57\uff0c\u7ea2\u8272\u94fe\u63a5 moon \u9ad8\u5206\u8fa8\u7387\u7167\u7247 \u81ea\u5b9a\u4e49\u4e3b\u9898 \u4e0b\u8f7d reveal git clone git@github.com :hakimel/reveal.js.git \uff1b \u5728 /css/theme/coder.scss \u4e2d\u590d\u5236\u4e00\u4e2a\u6587\u4ef6\uff1b \u8fd0\u884c npm run build -- css-themes \u751f\u6210css dist/coder.css\uff1b \u8fd0\u884c\u6307\u5b9a\u4e3b\u9898 reveal-md slides.md -w --theme theme/coder.css\u3002 \u5207\u6362\u65f6\u52a8\u753b \u00b6 \u540d\u79f0 \u6548\u679c none \u77ac\u95f4\u5207\u6362\u80cc\u666f fade \u4ea4\u53c9\u6de1\u5165\u6de1\u51fa - \u80cc\u666f\u8f6c\u6362\u7684\u9ed8\u8ba4\u503c slide \u5728\u80cc\u666f\u4e4b\u95f4\u6ed1\u52a8 \u2014 \u5e7b\u706f\u7247\u8fc7\u6e21\u7684\u9ed8\u8ba4\u8bbe\u7f6e convex \u4ee5\u51f8\u89d2\u6ed1\u52a8 concave \u4ee5\u51f9\u89d2\u6ed1\u52a8 zoom \u5411\u4e0a\u7f29\u653e\u4f20\u5165\u7684\u5e7b\u706f\u7247\uff0c\u4f7f\u5176\u4ece\u5c4f\u5e55\u4e2d\u5fc3\u5411\u5185\u6269\u5c55 \u7528\u6cd5 \u00b6 \u6362\u9875 \u00b6 \u6a2a\u5411\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e \u5782\u76f4\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e \u6dfb\u52a0\u5c5e\u6027 \u00b6 \u5f53\u9700\u8981\u5728 section \u4e2d\u6dfb\u52a0\u5c5e\u6027\u65f6 \u5f53\u9700\u8981\u5728\u5176\u5b83\u5143\u7d20\u63d2\u5165\u5c5e\u6027\u65f6 \u8bbe\u7f6e\u80cc\u666f\u8272\u6216\u80cc\u666f\u56fe \u8bbe\u7f6e\u52a8\u753b\u7247\u6bb5 Item1 \u5177\u4f53\u53ef\u4ee5\u67e5\u9605revealjs\u7684docs \u6307\u5b9a\u4ee3\u7801\u9ad8\u4eae\u987a\u5e8f \u00b6 ```python [1|3-6] n = 0 while n < 10 : if n % 2 == 0 : print ( f \" { n } is even\" ) else : print ( f \" { n } is odd\" ) n += 1 ``` \u5730\u5740\u8df3\u8f6c \u00b6 [ \u8df3\u8f6c0 ]( #/0 ) \u90e8\u7f72 \u00b6 Github Pages \u00b6 \u5728 Github \u4e2d\u65b0\u5efa\u4e00\u4e2a slides \u4ed3\u5e93\u4f5c\u4e3a\u603b\u5e7b\u706f\u7247\u7ad9\u70b9\uff0c\u5e76\u4e14\u90e8\u7f72 Github Pages\uff08\u53ef\u81ea\u5b9a\u4e49\u57df\u540d \u5728\u5206\u4ed3\u5e93\u4e2d\u5199\u597d\u9879\u76ee\u540e\uff0c\u901a\u8fc7 Action \u628a site \u6587\u4ef6\u5939\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230 slides \u5177\u4f53\u67e5\u770b TonyCrane's Slide Template Netlify \u00b6 \u6ce8\u518c\u4e00\u4e2a netlify \uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u7ad9\u70b9\u5173\u8054\u4e0agithub\u4ed3\u5e93 \u5728\u914d\u7f6e/\u90e8\u7f72\u91cc\u9762\u6dfb\u52a0\u6784\u5efa\u547d\u4ee4 \u7136\u540e\u5728\u57df\u540d\u7ba1\u7406\u6dfb\u52a0\u4e00\u4e2a\u81ea\u5df1\u7684\u57df\u540d Reference \u00b6 webpro/reveal-md revealjs \u5b98\u7f51 \u4efb\u4f55\u5229\u7528 revealjs \u5199\u51fa\u6f02\u4eae\u7684 PPT TonyCrane's Slide Template","title":"reveal-md"},{"location":"utils/reveal-md/#reveal-md","text":"\u7ea6 757 \u4e2a\u5b57 21 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 3 \u5206\u949f Abstract RevealJS \u662f\u4e00\u4e2a\u7b80\u5355\u4e14\u652f\u6301 markdown \u7684\u5de5\u5177\uff0c\u7136\u540e\u8f6c\u6362\u6210 PPT\u3002 \u8fd9\u91cc\u63a8\u8350\u4e00\u4e2aslide\u6a21\u7248 TonyCrane/slide-template \u3002 \u672c\u4eba\u4e0d\u559c\u6b22\u5199 PPT\uff08\u4e5f\u4e0d\u4f1a\u5199\uff09","title":"reveal-md"},{"location":"utils/reveal-md/#reveal-md_1","text":"\u53ef\u4ee5\u53ea\u7528\u5199 markdown \u7684\u65b9\u5f0f\u5199 PPT\uff0c\u5c06 markdown \u8f6c\u6362\u6210 html\uff0c\u6216\u5bfc\u51fa PDF \u662f revealjs \u7684 makrdown \u529f\u80fd","title":"\u4ec0\u4e48\u662f reveal-md"},{"location":"utils/reveal-md/#reveal-md_2","text":"","title":"\u5b89\u88c5 reveal-md"},{"location":"utils/reveal-md/#_1","text":"reveal.js \u4f7f\u7528 nodejs \u6784\u5efa\uff0c\u9700\u8981\u63d0\u524d\u5b89\u88c5\u597d nodejs \u901a\u8fc7 npm \u5b89\u88c5 reveal-md $ npm install -g reveal-md $ reveal-md slides.md # \u542f\u52a8\u672c\u5730\u670d\u52a1\u5668\u5e76\u5728\u9ed8\u8ba4\u6d4f\u89c8\u5668\u4e2d\u5c06\u4efb\u4f55 Markdown \u6587\u4ef6\u6f14\u793a\u6587\u7a3f\u6253\u5f00","title":"\u672c\u5730\u6784\u5efa"},{"location":"utils/reveal-md/#docker","text":"\u4e0d\u9700\u8981\u5b89\u88c5 node.js \u5728\u5bb9\u5668\u4e2d\u542f\u7528\u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d\uff0c\u8fd8\u5e94\u8be5\u6620\u5c04\u7aef\u53e3 35729 $ docker run --rm -p 1948 :1948 -p 35729 :35729 -v :/slides webpronl/reveal-md:latest /slides --watch","title":"Docker \u6784\u5efa"},{"location":"utils/reveal-md/#_2","text":"reveal-md -w \u5b9e\u65f6\u91cd\u65b0\u52a0\u8f7d reveal-md --scripts [url/*.js] \u81ea\u5b9a\u4e49 js reveal-md --css [url/*.js] \u81ea\u5b9a\u4e49 css reveal-md --static [--static-dirs=assets] \u5bfc\u51fa\u5230\u72ec\u7acb\u7684 HTML \u7f51\u7ad9 (\u5c06\u5305\u542b\u5176\u4ed6\u9759\u6001\u8d44\u6e90\u7684\u76ee\u5f55\u590d\u5236\u5230\u76ee\u6807\u76ee\u5f55) reveal-md --print [--print-size 1024x768 / A4] name.pdf \u6253\u5370\u6210 PDF\uff08\u6216\u8005\u5728\u6d4f\u89c8\u5668\u7684 url \u540e\u6dfb\u52a0 ?print-pdf reveal-md --template \u81ea\u5b9a\u4e49\u6a21\u7248","title":"\u76f8\u5173\u547d\u4ee4"},{"location":"utils/reveal-md/#_3","text":"","title":"\u914d\u7f6e"},{"location":"utils/reveal-md/#yaml","text":"\u53ef\u4ee5\u5728 markdown \u6587\u4ef6\u4e2d\u901a\u8fc7 yaml \u8fdb\u884c\u914d\u7f6e --- title : Slide \u6a21\u677f # \u5e7b\u706f\u7247\u540d\u79f0 separator : # \u5e7b\u706f\u7247\u6a2a\u884c\u5207\u5272\u6807\u5fd7 verticalSeparator : # \u5e7b\u706f\u7247\u5782\u76f4\u5207\u5272\u6807\u5fd7 theme : simple # \u5e7b\u706f\u7247\u4e3b\u9898 highlightTheme : github # \u4ee3\u7801\u9ad8\u4eae\u4e3b\u9898 css : custom.css # \u81ea\u5b9a\u4e49 css revealOptions : transition : 'slide' # \u52a8\u753b\u6548\u679c transitionSpeed : fast # \u52a8\u753b\u901f\u5ea6 center : false # \u662f\u5426\u5c45\u4e2d slideNumber : \"c/t\" # \u5e7b\u706f\u7247\u6570\u91cf width : 1000 # \u5e7b\u706f\u7247\u5bbd\u5ea6 ---","title":"yaml \u914d\u7f6e"},{"location":"utils/reveal-md/#_4","text":"\u9ed8\u8ba4\u4e3b\u9898 \u540d\u79f0 \u6548\u679c black \u9ed1\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5\uff08\u9ed8\u8ba4\uff09 white \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 league \u7070\u8272\u80cc\u666f\uff0c\u767d\u8272\u6587\u5b57\uff0c\u84dd\u8272\u94fe\u63a5 beige \u7c73\u8272\u80cc\u666f\uff0c\u6df1\u8272\u6587\u5b57\uff0c\u68d5\u8272\u94fe\u63a5 sky \u84dd\u8272\u80cc\u666f\uff0c\u7ec6\u6697\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 night \u9ed1\u8272\u80cc\u666f\uff0c\u539a\u767d\u8272\u6587\u5b57\uff0c\u6a59\u8272\u94fe\u63a5 serif \u5361\u5e03\u5947\u8bfa\u80cc\u666f\uff0c\u7070\u8272\u6587\u672c\uff0c\u68d5\u8272\u94fe\u63a5 simple \u767d\u8272\u80cc\u666f\uff0c\u9ed1\u8272\u6587\u672c\uff0c\u84dd\u8272\u94fe\u63a5 solarized \u9ad8\u5206\u8fa8\u7387\u7167\u7247 blood \u6df1\u8272\u80cc\u666f\uff0c\u539a\u767d\u6587\u5b57\uff0c\u7ea2\u8272\u94fe\u63a5 moon \u9ad8\u5206\u8fa8\u7387\u7167\u7247 \u81ea\u5b9a\u4e49\u4e3b\u9898 \u4e0b\u8f7d reveal git clone git@github.com :hakimel/reveal.js.git \uff1b \u5728 /css/theme/coder.scss \u4e2d\u590d\u5236\u4e00\u4e2a\u6587\u4ef6\uff1b \u8fd0\u884c npm run build -- css-themes \u751f\u6210css dist/coder.css\uff1b \u8fd0\u884c\u6307\u5b9a\u4e3b\u9898 reveal-md slides.md -w --theme theme/coder.css\u3002","title":"\u5e7b\u706f\u7247\u4e3b\u9898"},{"location":"utils/reveal-md/#_5","text":"\u540d\u79f0 \u6548\u679c none \u77ac\u95f4\u5207\u6362\u80cc\u666f fade \u4ea4\u53c9\u6de1\u5165\u6de1\u51fa - \u80cc\u666f\u8f6c\u6362\u7684\u9ed8\u8ba4\u503c slide \u5728\u80cc\u666f\u4e4b\u95f4\u6ed1\u52a8 \u2014 \u5e7b\u706f\u7247\u8fc7\u6e21\u7684\u9ed8\u8ba4\u8bbe\u7f6e convex \u4ee5\u51f8\u89d2\u6ed1\u52a8 concave \u4ee5\u51f9\u89d2\u6ed1\u52a8 zoom \u5411\u4e0a\u7f29\u653e\u4f20\u5165\u7684\u5e7b\u706f\u7247\uff0c\u4f7f\u5176\u4ece\u5c4f\u5e55\u4e2d\u5fc3\u5411\u5185\u6269\u5c55","title":"\u5207\u6362\u65f6\u52a8\u753b"},{"location":"utils/reveal-md/#_6","text":"","title":"\u7528\u6cd5"},{"location":"utils/reveal-md/#_7","text":"\u6a2a\u5411\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e \u5782\u76f4\u6362\u9875\uff1a \uff08\u6839\u636e yaml \u7684\u914d\u7f6e","title":"\u6362\u9875"},{"location":"utils/reveal-md/#_8","text":"\u5f53\u9700\u8981\u5728 section \u4e2d\u6dfb\u52a0\u5c5e\u6027\u65f6 \u5f53\u9700\u8981\u5728\u5176\u5b83\u5143\u7d20\u63d2\u5165\u5c5e\u6027\u65f6 \u8bbe\u7f6e\u80cc\u666f\u8272\u6216\u80cc\u666f\u56fe \u8bbe\u7f6e\u52a8\u753b\u7247\u6bb5 Item1 \u5177\u4f53\u53ef\u4ee5\u67e5\u9605revealjs\u7684docs","title":"\u6dfb\u52a0\u5c5e\u6027"},{"location":"utils/reveal-md/#_9","text":"```python [1|3-6] n = 0 while n < 10 : if n % 2 == 0 : print ( f \" { n } is even\" ) else : print ( f \" { n } is odd\" ) n += 1 ```","title":"\u6307\u5b9a\u4ee3\u7801\u9ad8\u4eae\u987a\u5e8f"},{"location":"utils/reveal-md/#_10","text":" [ \u8df3\u8f6c0 ]( #/0 )","title":"\u5730\u5740\u8df3\u8f6c"},{"location":"utils/reveal-md/#_11","text":"","title":"\u90e8\u7f72"},{"location":"utils/reveal-md/#github-pages","text":"\u5728 Github \u4e2d\u65b0\u5efa\u4e00\u4e2a slides \u4ed3\u5e93\u4f5c\u4e3a\u603b\u5e7b\u706f\u7247\u7ad9\u70b9\uff0c\u5e76\u4e14\u90e8\u7f72 Github Pages\uff08\u53ef\u81ea\u5b9a\u4e49\u57df\u540d \u5728\u5206\u4ed3\u5e93\u4e2d\u5199\u597d\u9879\u76ee\u540e\uff0c\u901a\u8fc7 Action \u628a site \u6587\u4ef6\u5939\u4e2d\u7684\u5185\u5bb9\u590d\u5236\u5230 slides \u5177\u4f53\u67e5\u770b TonyCrane's Slide Template","title":"Github Pages"},{"location":"utils/reveal-md/#netlify","text":"\u6ce8\u518c\u4e00\u4e2a netlify \uff0c\u7136\u540e\u521b\u5efa\u4e00\u4e2a\u7ad9\u70b9\u5173\u8054\u4e0agithub\u4ed3\u5e93 \u5728\u914d\u7f6e/\u90e8\u7f72\u91cc\u9762\u6dfb\u52a0\u6784\u5efa\u547d\u4ee4 \u7136\u540e\u5728\u57df\u540d\u7ba1\u7406\u6dfb\u52a0\u4e00\u4e2a\u81ea\u5df1\u7684\u57df\u540d","title":"Netlify"},{"location":"utils/reveal-md/#reference","text":"webpro/reveal-md revealjs \u5b98\u7f51 \u4efb\u4f55\u5229\u7528 revealjs \u5199\u51fa\u6f02\u4eae\u7684 PPT TonyCrane's Slide Template","title":"Reference"},{"location":"utils/shell/","text":"Shell \u547d\u4ee4\u76f8\u5173 \u00b6 \u7ea6 155 \u4e2a\u5b57 2 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684shell\u547d\u4ee4\uff0c\u4e0d\u662f\u5f88\u5168 \u547d\u4ee4 \u00b6 \u5220\u9664url\u76ee\u5f55\u4e0b\u6240\u6709name.cpp\u6587\u4ef6 $ find ${ url } -name 'name.cpp' -type f -print -exec rm -rf {} \\; \u4e00\u884c\u4ee3\u7801-\u89e3\u51b3\u4eba\u751f\u70e6\u607c wget http://fishros.com/install -O fishros && . fishros zsh \u00b6 \u5b89\u88c5 \u00b6 mac: \u81ea\u5e26 Linux \u4f7f\u7528\u5bf9\u5e94\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u5b89\u88c5 zsh \u5373\u53ef sudo apt install zsh \u67e5\u770b zsh \u8def\u5f84\uff1awhich zsh \u66f4\u6539\u9ed8\u8ba4 shell\uff1asudo chsh -s /usr/bin/zsh \u4e3b\u9898 \u00b6 \u5b89\u88c5 oh-my-zsh\uff08\u56db\u9009\u4e00\uff09 sh -c \"$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh )\" sh -c \"$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh )\" sh -c \"$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)\" sh -c \"$(wget -O- https://gitee.com/pocmon/mirrors/raw/master/tools/install.sh )\" \u4fee\u6539 awesomepanda \u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e ZSH_THEME \u4e3a \"awesomepanda\" \u63d2\u4ef6 \u00b6 \u81ea\u5e26 git \u63d2\u4ef6 zsh-autosuggestions\uff1agit clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions zsh-syntax-highlighting\uff1agit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \u7136\u540e\u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e plugins=(git zsh-autosuggestions zsh-syntax-highlighting)","title":"Shell \u547d\u4ee4\u76f8\u5173"},{"location":"utils/shell/#shell","text":"\u7ea6 155 \u4e2a\u5b57 2 \u884c\u4ee3\u7801 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5e38\u7528 / \u5e38\u5fd8\u7684shell\u547d\u4ee4\uff0c\u4e0d\u662f\u5f88\u5168","title":"Shell \u547d\u4ee4\u76f8\u5173"},{"location":"utils/shell/#_1","text":"\u5220\u9664url\u76ee\u5f55\u4e0b\u6240\u6709name.cpp\u6587\u4ef6 $ find ${ url } -name 'name.cpp' -type f -print -exec rm -rf {} \\; \u4e00\u884c\u4ee3\u7801-\u89e3\u51b3\u4eba\u751f\u70e6\u607c wget http://fishros.com/install -O fishros && . fishros","title":"\u547d\u4ee4"},{"location":"utils/shell/#zsh","text":"","title":"zsh"},{"location":"utils/shell/#_2","text":"mac: \u81ea\u5e26 Linux \u4f7f\u7528\u5bf9\u5e94\u8f6f\u4ef6\u5305\u7ba1\u7406\u5668\u5b89\u88c5 zsh \u5373\u53ef sudo apt install zsh \u67e5\u770b zsh \u8def\u5f84\uff1awhich zsh \u66f4\u6539\u9ed8\u8ba4 shell\uff1asudo chsh -s /usr/bin/zsh","title":"\u5b89\u88c5"},{"location":"utils/shell/#_3","text":"\u5b89\u88c5 oh-my-zsh\uff08\u56db\u9009\u4e00\uff09 sh -c \"$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh )\" sh -c \"$(curl -fsSL https://gitee.com/mirrors/oh-my-zsh/raw/master/tools/install.sh )\" sh -c \"$(wget https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh -O -)\" sh -c \"$(wget -O- https://gitee.com/pocmon/mirrors/raw/master/tools/install.sh )\" \u4fee\u6539 awesomepanda \u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e ZSH_THEME \u4e3a \"awesomepanda\"","title":"\u4e3b\u9898"},{"location":"utils/shell/#_4","text":"\u81ea\u5e26 git \u63d2\u4ef6 zsh-autosuggestions\uff1agit clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions zsh-syntax-highlighting\uff1agit clone https://github.com/zsh-users/zsh-syntax-highlighting.git ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-syntax-highlighting \u7136\u540e\u5728 ~/.zshrc \u4e2d\u8bbe\u7f6e plugins=(git zsh-autosuggestions zsh-syntax-highlighting)","title":"\u63d2\u4ef6"},{"location":"utils/utilsbox/","text":"\u5de5\u5177\u6536\u96c6 \u00b6 \u7ea6 428 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5404\u79cd\u7a00\u5947\u53e4\u602a\u7684\u5de5\u5177\uff0c\u5305\u62ec\u8bbe\u8ba1\u3001\u56fe\u50cf\u548c\u5b66\u4e60\u5de5\u5177\u7b49\u7b49 \u6301\u7eed\u66f4\u65b0\u4e2d... .md-typeset a:is(:focus,:hover) { opacity: 1; } .md-typeset a { color: var(--md-accent-fg-color); opacity: 0.8; } \u56fe\u50cf\u7c7b \u00b6 \u4f5c\u56fe \u00b6 \u98ce\u683c\u5934\u50cf\u5236\u4f5c Notion-avatar \u5728\u7ebf\u624b\u5199\u98ce\u683c\u4f5c\u56fe\u767d\u677f Excalidraw \u5728\u7ebf\u77e2\u91cf\u56fe\u4f5c\u56fe\u8f6f\u4ef6\uff08draw.io\uff09 app.diagrams.net \u5728\u7ebf\u56fe\u8bba\u4f5c\u56fe\u7f51\u7ad9 Graph Editor tikz \u6709\u9650\u72b6\u6001\u673a\u53ef\u89c6\u5316\u5236\u4f5c Finite State Machine Designer \u8bc6\u56fe \u00b6 SauceNAO \u4fee\u56fe \u00b6 \u79fb\u9664\u80cc\u666f\uff08\u5b8c\u5168\u514d\u8d39\uff09 RemoveBg \u7eaf\u524d\u7aef\u514d\u8d39\u56fe\u7247\u538b\u7f29 PicDiet \u56fe\u7247\u538b\u7f29\uff08\u9700\u4e0a\u4f20\uff09 DocSmall \u64e6\u9664\u56fe\u7247\u4e0a\u7269\u54c1\uff08\u514d\u8d39\u529f\u80fd\u53d7\u9650\uff09 cleanup.pictures \u8bbe\u8ba1\u7c7b \u00b6 \u914d\u8272 \u00b6 \u914d\u8272\u65b9\u6848\u7f51\u7ad9 Color Hunt \u914d\u8272\u65b9\u6848\u7f51\u7ad9\uff08\u5e26 Figma \u63d2\u4ef6\uff09 Coolors \u989c\u8272\u67e5\u627e\u53ca\u8f6c\u6362\u5de5\u5177 HexColor16 \u65e5\u5f0f\u4f20\u7edf\u989c\u8272\u5217\u8868 Nippon Colors \u65e5\u7cfb\u989c\u8272\u540d\u79f0\u5217\u8868\uff08 \u8272\u56fe\u7f51\u7ad9 \uff09 Color Site Flat UI \u914d\u8272\u65b9\u6848 Flat UI Colors \u56fe\u6807 \u00b6 \u5fbd\u7ae0 shields.io \u5404\u7cfb\u5217\u56fe\u6807\u5408\u96c6 icones \u56fe\u6807\u3001\u63d2\u56fe\u3001\u7167\u7247\u3001\u97f3\u4e50\u548c\u8bbe\u8ba1\u5de5\u5177 icons8 \u4ee3\u7801\u7c7b \u00b6 \u53ef\u89c6\u5316 \u00b6 \u6570\u636e\u7ed3\u6784-\u56fe\u7684\u53ef\u89c6\u5316 graph_editor \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 Regulex Python \u6267\u884c\u8fc7\u7a0b\u53ef\u89c6\u5316 PythonTutor GLSL \u6d41\u4f53\u573a\u53ef\u89c6\u5316 Field Play \u63d2\u4ef6 \u00b6 sublime\u7b97\u6cd5\u63d2\u4ef6 FastOlympicCoding \u5b66\u4e60\u5de5\u5177 \u00b6 \u7f16\u8bd1\u5668\u8d44\u6e90\u7ba1\u7406\u5668 comple explorer \u7f13\u52a8\u66f2\u7ebf Easing Function Cheat Sheet \u5927 O \u590d\u6742\u5ea6\u6bd4\u8f83\u67e5\u8be2 Big O Cheat Sheet C \u7c7b\u578b\u58f0\u660e\u8f6c\u82f1\u6587\u63cf\u8ff0 cdecl \u6570\u5b66\u7c7b \u00b6 \u6570\u5217\u67e5\u627e OEIS \u6570\u5b66\u516c\u5f0f Latex \u8d28\u6570\u68c0\u6d4b primenumbers \u6570\u5b66\u56fe\u50cf desmos \u4e92\u52a8\u51e0\u4f55\u8c1c\u9898 euclidea \u6570\u5b66\u6559\u5b66\u8f6f\u4ef6 GeoGebra \u5176\u4ed6 \u00b6 git\u63d0\u4ea4\u4fe1\u606f\u4e2d\u7684emoji gitmoji Emoji \u67e5\u8be2 EmojiAll \u8868\u60c5\u56fe\u6807\u767e\u79d1 emojipedia.org \u5de5\u5177\u96c6\u5408 MikuTools Unicode\u7f16\u7801 Unicode Youtube\u4e0b\u8f7d\u5668 yt1s \u6253\u5b57\u8bad\u7ec3 monkeytype PDFToPPT smallpdf Reference \u00b6 TonyCrane \u5de5\u5177\u6536\u96c6","title":"\u5de5\u5177\u6536\u96c6"},{"location":"utils/utilsbox/#_1","text":"\u7ea6 428 \u4e2a\u5b57 \u9884\u8ba1\u9605\u8bfb\u65f6\u95f4 1 \u5206\u949f Abstract \u5404\u79cd\u7a00\u5947\u53e4\u602a\u7684\u5de5\u5177\uff0c\u5305\u62ec\u8bbe\u8ba1\u3001\u56fe\u50cf\u548c\u5b66\u4e60\u5de5\u5177\u7b49\u7b49 \u6301\u7eed\u66f4\u65b0\u4e2d... .md-typeset a:is(:focus,:hover) { opacity: 1; } .md-typeset a { color: var(--md-accent-fg-color); opacity: 0.8; }","title":"\u5de5\u5177\u6536\u96c6"},{"location":"utils/utilsbox/#_2","text":"","title":"\u56fe\u50cf\u7c7b"},{"location":"utils/utilsbox/#_3","text":"\u98ce\u683c\u5934\u50cf\u5236\u4f5c Notion-avatar \u5728\u7ebf\u624b\u5199\u98ce\u683c\u4f5c\u56fe\u767d\u677f Excalidraw \u5728\u7ebf\u77e2\u91cf\u56fe\u4f5c\u56fe\u8f6f\u4ef6\uff08draw.io\uff09 app.diagrams.net \u5728\u7ebf\u56fe\u8bba\u4f5c\u56fe\u7f51\u7ad9 Graph Editor tikz \u6709\u9650\u72b6\u6001\u673a\u53ef\u89c6\u5316\u5236\u4f5c Finite State Machine Designer","title":"\u4f5c\u56fe"},{"location":"utils/utilsbox/#_4","text":"SauceNAO","title":"\u8bc6\u56fe"},{"location":"utils/utilsbox/#_5","text":"\u79fb\u9664\u80cc\u666f\uff08\u5b8c\u5168\u514d\u8d39\uff09 RemoveBg \u7eaf\u524d\u7aef\u514d\u8d39\u56fe\u7247\u538b\u7f29 PicDiet \u56fe\u7247\u538b\u7f29\uff08\u9700\u4e0a\u4f20\uff09 DocSmall \u64e6\u9664\u56fe\u7247\u4e0a\u7269\u54c1\uff08\u514d\u8d39\u529f\u80fd\u53d7\u9650\uff09 cleanup.pictures","title":"\u4fee\u56fe"},{"location":"utils/utilsbox/#_6","text":"","title":"\u8bbe\u8ba1\u7c7b"},{"location":"utils/utilsbox/#_7","text":"\u914d\u8272\u65b9\u6848\u7f51\u7ad9 Color Hunt \u914d\u8272\u65b9\u6848\u7f51\u7ad9\uff08\u5e26 Figma \u63d2\u4ef6\uff09 Coolors \u989c\u8272\u67e5\u627e\u53ca\u8f6c\u6362\u5de5\u5177 HexColor16 \u65e5\u5f0f\u4f20\u7edf\u989c\u8272\u5217\u8868 Nippon Colors \u65e5\u7cfb\u989c\u8272\u540d\u79f0\u5217\u8868\uff08 \u8272\u56fe\u7f51\u7ad9 \uff09 Color Site Flat UI \u914d\u8272\u65b9\u6848 Flat UI Colors","title":"\u914d\u8272"},{"location":"utils/utilsbox/#_8","text":"\u5fbd\u7ae0 shields.io \u5404\u7cfb\u5217\u56fe\u6807\u5408\u96c6 icones \u56fe\u6807\u3001\u63d2\u56fe\u3001\u7167\u7247\u3001\u97f3\u4e50\u548c\u8bbe\u8ba1\u5de5\u5177 icons8","title":"\u56fe\u6807"},{"location":"utils/utilsbox/#_9","text":"","title":"\u4ee3\u7801\u7c7b"},{"location":"utils/utilsbox/#_10","text":"\u6570\u636e\u7ed3\u6784-\u56fe\u7684\u53ef\u89c6\u5316 graph_editor \u6b63\u5219\u8868\u8fbe\u5f0f\u53ef\u89c6\u5316 Regulex Python \u6267\u884c\u8fc7\u7a0b\u53ef\u89c6\u5316 PythonTutor GLSL \u6d41\u4f53\u573a\u53ef\u89c6\u5316 Field Play","title":"\u53ef\u89c6\u5316"},{"location":"utils/utilsbox/#_11","text":"sublime\u7b97\u6cd5\u63d2\u4ef6 FastOlympicCoding","title":"\u63d2\u4ef6"},{"location":"utils/utilsbox/#_12","text":"\u7f16\u8bd1\u5668\u8d44\u6e90\u7ba1\u7406\u5668 comple explorer \u7f13\u52a8\u66f2\u7ebf Easing Function Cheat Sheet \u5927 O \u590d\u6742\u5ea6\u6bd4\u8f83\u67e5\u8be2 Big O Cheat Sheet C \u7c7b\u578b\u58f0\u660e\u8f6c\u82f1\u6587\u63cf\u8ff0 cdecl","title":"\u5b66\u4e60\u5de5\u5177"},{"location":"utils/utilsbox/#_13","text":"\u6570\u5217\u67e5\u627e OEIS \u6570\u5b66\u516c\u5f0f Latex \u8d28\u6570\u68c0\u6d4b primenumbers \u6570\u5b66\u56fe\u50cf desmos \u4e92\u52a8\u51e0\u4f55\u8c1c\u9898 euclidea \u6570\u5b66\u6559\u5b66\u8f6f\u4ef6 GeoGebra","title":"\u6570\u5b66\u7c7b"},{"location":"utils/utilsbox/#_14","text":"git\u63d0\u4ea4\u4fe1\u606f\u4e2d\u7684emoji gitmoji Emoji \u67e5\u8be2 EmojiAll \u8868\u60c5\u56fe\u6807\u767e\u79d1 emojipedia.org \u5de5\u5177\u96c6\u5408 MikuTools Unicode\u7f16\u7801 Unicode Youtube\u4e0b\u8f7d\u5668 yt1s \u6253\u5b57\u8bad\u7ec3 monkeytype PDFToPPT smallpdf","title":"\u5176\u4ed6"},{"location":"utils/utilsbox/#reference","text":"TonyCrane \u5de5\u5177\u6536\u96c6","title":"Reference"}]} \ No newline at end of file diff --git a/sitemap.xml b/sitemap.xml index 3ecec804..dc7737ea 100644 --- a/sitemap.xml +++ b/sitemap.xml @@ -2,662 +2,667 @@ https://note.jujimeizuo.cn/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/changelog/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/links/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/todo/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/ai/dl/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/ai/ml/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/ai/mode-recognition/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/algorithm/basic-ds/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/algorithm/design-analysis/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/db/mysql/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/db/redis/cjh/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/db/redis/datatype/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/db/redis/work/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/hpc/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/hpc/gpu/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/hpc/mpi/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/hpc/openmp/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/hpc/outline/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/hpc/vectorizecompute/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/others/regex/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/c_cpp/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/c_cpp/basic/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/c_cpp/function/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/c_cpp/stl/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/go/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/go/basic/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/go/gin/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/java/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/java/basic/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/java/springboot/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/python/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/python/basic/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/python/numpy/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/pl/python/virtual/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/software/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/software/compa/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/software/design-pattern/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/software/piaserver/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cs/software/sca/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/3d-visualization/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/dataset/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/dataset/kitti/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/dataset/tum/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/dataset/waymo/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/3dr-camera-structure/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/ag-fm/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/calc-p/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/camera-model/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/est2d/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/eval/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/one-vg/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/pjt2d/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/mvg/pjt3d/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/3dgs/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/3dgs/3dgs/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/3dgs/4dgs/ - 2024-10-09 + 2024-10-13 + daily + + + https://note.jujimeizuo.cn/cv/papers/3dgs/gaussian-splatting-slam/ + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/3dgs/splatam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/crowd-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/detect-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/ds-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/dynaslam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/flowfusion/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/dynamic-slam/rigidfusion/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/co-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/ddn-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/imap/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/nerf-evaluation/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/nerf/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/nice-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/nerf/nid-slam/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/deepv2d/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/endoscopy-depth-estimation/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/let-net/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/orbslam2/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/vslam14/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/vslam14/lec1/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/papers/others/vslam14/lec2/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/pcd/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/pcd/pcr/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/pcd/pcr/icp/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/pcd/pcr/prepare/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/utils/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/cv/utils/colmap/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/lec1/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/lec2/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/lec3/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/lec4/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/lec5/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/internlm/lec6/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/nlp/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/nlp/rnns/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/nlp/word2vec/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/others/dt/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/others/prompt/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/transformer/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/transformer/attention/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/transformer/bert/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/transformer/transformer/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/llm/transformer/vit/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/comb/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/maa/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/maa/lec1/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/maa/lec2/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/maa/lec3/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/optimization-theory/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/optimization-theory/lec1/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/optimization-theory/lec2/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/mb/optimization-theory/lec3/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/action/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/docker/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/ffmpeg/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/gdb/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/git/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/gitbook/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/hexo/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/imagemagick/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/mkdocs/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/reveal-md/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/shell/ - 2024-10-09 + 2024-10-13 daily https://note.jujimeizuo.cn/utils/utilsbox/ - 2024-10-09 + 2024-10-13 daily \ No newline at end of file diff --git a/sitemap.xml.gz b/sitemap.xml.gz index afc896ecbccf4842a7b0c74438768f1fb3eb7f9f..9a97a98531156bea49cf7f482476a78c6846614f 100644 GIT binary patch literal 998 zcmVxj^id22k`rSic#)~C&{$hR+;Qw zpP+laB5;gJfWrcI#`E;WNjf__YA3t2w_IUF#~{>zJZ4-=(qIXtg6>&Mjt z1;yG1^St`{=O5zp>dWENeoQV?d8ma$eqIfw#NWH_a=EOtE#zg)Yfh%iYN%gwcR$!Y zu76t{K0VaOa)R5Z>tpX&9hS4?dYZt6)~E4gJ=xch*D7@TZYl7-yv)V3K5QSiPh#^Z zHoIEne(YT_HOOG7PxSqurFHYZdw1jp>E0y&(R4eLV*{ykHk>o0tgvRx2F<7}X*=zJ zaUL4SnnWVSCfHJ=8Z6ZrPPPobJIZX8&>3H{Oa&nZy?~IjbEOIA2$w{K~&>Q)R z%rV(uj?4vE8s{=V$HY4jy~Xd$F#0&-GbfwMC}D@0%ze4YMDV^P|CaE|`$|-lrBDj+ z+-PN{G*N<=W(C^#6Dn(`#bk30J@!@NCgam}Aum%w=bddS79Ckek50VE*)uBAPX?K` z(@7}lDM^t_8dVul2kx6!8qs@Xpps6Bh%LM}_j2{nAv-CTt%e3p61oC8kid>U@dVz) z6}W>1Mj4j{dTiZJnKI(42moQ}(HZQF)+TCAI=wy=)Wra3Wghfo@s7F9y$SryTVF;SGbm(s>!UB<>K zcBpB;a~{@Z!?I1N1t9FG@=>{MLb+=~`P78+mnM|I!YYG{(6$sph6Y|Z>Fq=c7WwzI zyr2tXVjpppCCQL`P9Ai_>__9W3pv29WPH>fDYen`t#yORV%DoaqOug@+Psv=G}wv4 z58oEtw?p-DEY{y|ClGbS<}|lNMedsa;@vjp#q7Gc3urf)#JyYo2Gp$1pvle+*!Mn? z0R|d60%REA_Dxm*0K(n(9smFU literal 984 zcmV;}11J0+iwFoDEe2--|8r?{Wo=<_E_iKh0M*>hZsRr(2k`qoMc}(E$4-mg!tvhv z1l{w3CPxx&lEWoOa+IepWxLrlXb-&f=?T_D^&#SM8Px~>sO!80)hy1)6MB;C4d%0ZJ*$R0T^O{rNW<8Xh+};ni zoAsB~;nPFemI`j)uG`+RJ}kB5QcYl?^=Uj=Pxf`>wGQpRT?)J}ud;YHhwWzj)I4sQ z&6iT-e(YT_J*d!Am*~gADC_2Z`|ijM(!NRlqv=+Y;~rAyY&d5~nXqBZ2F<7}Wn1Hb zaUL4ShMGj0`(UL+HCU?aIawKedsNx##$UuA(m2Zi9TV?B^cKG}!|3CT&zx+MQNa!~nLD|tMDV^P|5otI`%F|+B9sC= zH(He`O_boJS%WtIgv#2PX0o}29{Z|rlkw>~k(Wu(d1otP(UCHGbmB$Lo>7s0>XB(X zlNzl&CDmj}qm~hM;J$fP-*g@ssFl-A#1>wgdwF{3ke!reYoLLXfdRaXwYz%+Zzf%!5#!!@@p)4hYRS**Hen-*-+=mc<$8tI@*V?uY z?X*}QpX$Oo(vQ`NaXW-I$h4>vI?w8ePK=47!hIe!igg(qr`e&V{myw1*o-lf^u*{)o!bjBE2sA=6-Q6n^@);JzKIkE2+BUz6XI z5u4Lo6BW5@{)=~8nHRI`;!dF5WD55u=Qp5XeFjZ-Zosbdk$PZYZ;r@1&T z3kP~(V4n4=r}DBI`6T*t2{XuHI?+VRHQoRl^FYo4`>yXt{vZD6=lYRJ4u1mVZv3f| GRR92E)$@V? diff --git a/todo/index.html b/todo/index.html index 0414fcfc..956eb4b3 100644 --- a/todo/index.html +++ b/todo/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/action/index.html b/utils/action/index.html index af95fa5e..1edcb9ce 100644 --- a/utils/action/index.html +++ b/utils/action/index.html @@ -865,13 +865,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/docker/index.html b/utils/docker/index.html index 6ade95d1..a987932a 100644 --- a/utils/docker/index.html +++ b/utils/docker/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/ffmpeg/index.html b/utils/ffmpeg/index.html index ba03c622..41bf7bde 100644 --- a/utils/ffmpeg/index.html +++ b/utils/ffmpeg/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/gdb/index.html b/utils/gdb/index.html index 7bca12e9..f0542974 100644 --- a/utils/gdb/index.html +++ b/utils/gdb/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/git/index.html b/utils/git/index.html index 1770c31f..31366e28 100644 --- a/utils/git/index.html +++ b/utils/git/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/gitbook/index.html b/utils/gitbook/index.html index c8c0465a..534af684 100644 --- a/utils/gitbook/index.html +++ b/utils/gitbook/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/hexo/index.html b/utils/hexo/index.html index a69f7fa3..959e0cb0 100644 --- a/utils/hexo/index.html +++ b/utils/hexo/index.html @@ -865,13 +865,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/imagemagick/index.html b/utils/imagemagick/index.html index ef37a8e5..143f6268 100644 --- a/utils/imagemagick/index.html +++ b/utils/imagemagick/index.html @@ -865,13 +865,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/index.html b/utils/index.html index c7eaa8ff..8a798c1f 100644 --- a/utils/index.html +++ b/utils/index.html @@ -868,13 +868,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/mkdocs/index.html b/utils/mkdocs/index.html index 2a6dfdb6..c33b60a2 100644 --- a/utils/mkdocs/index.html +++ b/utils/mkdocs/index.html @@ -865,13 +865,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/reveal-md/index.html b/utils/reveal-md/index.html index 52486ae8..343d66a5 100644 --- a/utils/reveal-md/index.html +++ b/utils/reveal-md/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/shell/index.html b/utils/shell/index.html index cd430348..5682299d 100644 --- a/utils/shell/index.html +++ b/utils/shell/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM
  • diff --git a/utils/utilsbox/index.html b/utils/utilsbox/index.html index 517ad1ba..5299e8b9 100644 --- a/utils/utilsbox/index.html +++ b/utils/utilsbox/index.html @@ -869,13 +869,18 @@
  • + + 4DGS + +
  • +
  • SplaTAM
  • - - 4DGS + + Gaussian Splatting SLAM