{"id":1466,"date":"2022-01-07T10:55:10","date_gmt":"2022-01-07T02:55:10","guid":{"rendered":"http:\/\/139.9.1.231\/?p=1466"},"modified":"2022-04-09T21:37:21","modified_gmt":"2022-04-09T13:37:21","slug":"visi","status":"publish","type":"post","link":"http:\/\/139.9.1.231\/index.php\/2022\/01\/07\/visi\/","title":{"rendered":"\u795e\u7ecf\u7f51\u7edc\u53ef\u89c6\u5316\u5de5\u5177"},"content":{"rendered":"\n\n<div class=\"wp-block-calendar\"><table id=\"wp-calendar\" class=\"wp-calendar-table\">\n\t<caption>2026\u5e74 4\u6708<\/caption>\n\t<thead>\n\t<tr>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u4e00\">\u4e00<\/th>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u4e8c\">\u4e8c<\/th>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u4e09\">\u4e09<\/th>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u56db\">\u56db<\/th>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u4e94\">\u4e94<\/th>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u516d\">\u516d<\/th>\n\t\t<th scope=\"col\" title=\"\u661f\u671f\u65e5\">\u65e5<\/th>\n\t<\/tr>\n\t<\/thead>\n\t<tbody>\n\t<tr>\n\t\t<td colspan=\"2\" class=\"pad\">&nbsp;<\/td><td>1<\/td><td>2<\/td><td>3<\/td><td>4<\/td><td>5<\/td>\n\t<\/tr>\n\t<tr>\n\t\t<td>6<\/td><td>7<\/td><td>8<\/td><td>9<\/td><td><a href=\"http:\/\/139.9.1.231\/index.php\/2026\/04\/10\/\" aria-label=\"2026\u5e744\u670810\u65e5 \u53d1\u5e03\u7684\u6587\u7ae0\">10<\/a><\/td><td>11<\/td><td>12<\/td>\n\t<\/tr>\n\t<tr>\n\t\t<td>13<\/td><td><a href=\"http:\/\/139.9.1.231\/index.php\/2026\/04\/14\/\" aria-label=\"2026\u5e744\u670814\u65e5 \u53d1\u5e03\u7684\u6587\u7ae0\">14<\/a><\/td><td>15<\/td><td>16<\/td><td>17<\/td><td id=\"today\">18<\/td><td>19<\/td>\n\t<\/tr>\n\t<tr>\n\t\t<td>20<\/td><td>21<\/td><td>22<\/td><td>23<\/td><td>24<\/td><td>25<\/td><td>26<\/td>\n\t<\/tr>\n\t<tr>\n\t\t<td>27<\/td><td>28<\/td><td>29<\/td><td>30<\/td>\n\t\t<td class=\"pad\" colspan=\"3\">&nbsp;<\/td>\n\t<\/tr>\n\t<\/tbody>\n\t<\/table><nav aria-label=\"\u4e0a\u4e2a\u6708\u53ca\u4e0b\u4e2a\u6708\" class=\"wp-calendar-nav\">\n\t\t<span class=\"wp-calendar-nav-prev\"><a href=\"http:\/\/139.9.1.231\/index.php\/2026\/03\/\">&laquo; 3\u6708<\/a><\/span>\n\t\t<span class=\"pad\">&nbsp;<\/span>\n\t\t<span class=\"wp-calendar-nav-next\">&nbsp;<\/span>\n\t<\/nav><\/div>\n\n\n<p><strong>\u6765\u6e90\uff1a\u78d0\u521bAI\u5206\u4eab<\/strong><\/p>\n\n\n\n<h1>\u795e\u7ecf\u7f51\u7edc\u53ef\u89c6\u5316\u5de5\u5177<\/h1>\n\n\n\n<h2>Convolution Visualizer<\/h2>\n\n\n\n<p><a href=\"https:\/\/ezyang.github.io\/convolution-visualizer\/index.html\">https:\/\/ezyang.github.io\/convolution-visualizer\/index.html<\/a><\/p>\n\n\n\n<p>\u8fd9\u79cd\u4ea4\u4e92\u5f0f\u53ef\u89c6\u5316\u6f14\u793a\u4e86\u5404\u79cd\u5377\u79ef\u53c2\u6570\u5982\u4f55\u5f71\u54cd\u8f93\u5165\u3001\u6743\u91cd\u548c\u8f93\u51fa\u77e9\u9635\u4e4b\u95f4\u7684\u5f62\u72b6\u548c\u6570\u636e\u4f9d\u8d56\u6027\u3002\u5c06\u9f20\u6807\u60ac\u505c\u5728\u8f93\u5165\/\u8f93\u51fa\u4e0a\u5c06\u7a81\u51fa\u663e\u793a\u76f8\u5e94\u7684\u8f93\u51fa\/\u8f93\u5165\uff0c\u800c\u5c06\u9f20\u6807\u60ac\u505c\u5728\u6743\u91cd\u4e0a\u5c06\u7a81\u51fa\u663e\u793a\u54ea\u4e9b\u8f93\u5165\u4e0e\u8be5\u6743\u91cd\u76f8\u4e58\u4ee5\u8ba1\u7b97\u8f93\u51fa\u3002\uff08\u4e25\u683c\u6765\u8bf4\uff0c\u8fd9\u91cc\u53ef\u89c6\u5316\u7684\u64cd\u4f5c\u662f<em>\u76f8\u5173\u6027<\/em>\uff0c\u800c\u4e0d\u662f\u5377\u79ef\uff0c\u56e0\u4e3a\u771f\u6b63\u7684\u5377\u79ef\u5728\u6267\u884c\u76f8\u5173\u6027\u4e4b\u524d\u4f1a\u7ffb\u8f6c\u5176\u6743\u91cd\u3002\u4f46\u662f\uff0c\u5927\u591a\u6570\u6df1\u5ea6\u5b66\u4e60\u6846\u67b6\u4ecd\u7136\u79f0\u8fd9\u4e9b\u5377\u79ef\uff0c\u6700\u7ec8\u4e0e\u68af\u5ea6\u4e0b\u964d\u76f8\u540c.)<\/p>\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/03\/image-92.png\" alt=\"\" class=\"wp-image-3318\" width=\"348\" height=\"326\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/03\/image-92.png 539w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/03\/image-92-300x281.png 300w\" sizes=\"(max-width: 348px) 100vw, 348px\" \/><\/figure><\/div>\n\n\n\n<iframe loading=\"lazy\" src=\"https:\/\/ezyang.github.io\/convolution-visualizer\/index.html\" width=\"100%\" height=\"500\" frameborder=\"0\" allowfullscreen=\"\" sandbox=\"\">\n  <p><a href=\"https:\/\/www.example.com\">\u70b9\u51fb\u6253\u5f00\u5d4c\u5165\u9875\u9762<\/a><\/p>\n<\/iframe>\n\n\n\n<h2><strong>Weights &amp; Biases<\/strong><\/h2>\n\n\n\n<p class=\"has-dark-gray-color has-medium-pink-background-color has-text-color has-background\"><a href=\"https:\/\/docs.wandb.ai\/v\/zh-hans\/\"><strong>https:\/\/docs.wandb.ai\/v\/zh-hans\/<\/strong><\/a><\/p>\n\n\n\n<p>Weights &amp; Biases \u53ef\u4ee5\u5e2e\u52a9\u8ddf\u8e2a\u4f60\u7684\u673a\u5668\u5b66\u4e60\u9879\u76ee\u3002\u4f7f\u7528\u6211\u4eec\u7684\u5de5\u5177\u8bb0\u5f55\u8fd0\u884c\u4e2d\u7684\u8d85\u53c2\u6570\u548c\u8f93\u51fa\u6307\u6807(Metric)\uff0c\u7136\u540e\u5bf9\u7ed3\u679c\u8fdb\u884c\u53ef\u89c6\u5316\u548c\u6bd4\u8f83\uff0c\u5e76\u5feb\u901f\u4e0e\u540c\u4e8b\u5206\u4eab\u4f60\u7684\u53d1\u73b0\u3002<\/p>\n\n\n\n<p>\u901a\u8fc7wandb\uff0c\u80fd\u591f\u7ed9\u4f60\u7684\u673a\u5668\u5b66\u4e60\u9879\u76ee\u5e26\u6765\u5f3a\u5927\u7684\u4ea4\u4e92\u5f0f\u53ef\u89c6\u5316\u8c03\u8bd5\u4f53\u9a8c\uff0c\u80fd\u591f\u81ea\u52a8\u5316\u8bb0\u5f55Python\u811a\u672c\u4e2d\u7684\u56fe\u6807\uff0c\u5e76\u4e14\u5b9e\u65f6\u5728\u7f51\u9875<a href=\"https:\/\/so.csdn.net\/so\/search?q=%E4%BB%AA%E8%A1%A8%E7%9B%98&amp;spm=1001.2101.3001.7020\" target=\"_blank\" rel=\"noreferrer noopener\">\u4eea\u8868\u76d8<\/a>\u5c55\u793a\u5b83\u7684\u7ed3\u679c\uff0c\u4f8b\u5982\uff0c\u635f\u5931\u51fd\u6570\u3001\u51c6\u786e\u7387\u3001\u53ec\u56de\u7387\uff0c\u5b83\u80fd\u591f\u8ba9\u4f60\u5728\u6700\u77ed\u7684\u65f6\u95f4\u5185\u5b8c\u6210\u673a\u5668\u5b66\u4e60\u9879\u76ee\u53ef\u89c6\u5316\u56fe\u7247\u7684\u5236\u4f5c\u3002<\/p>\n\n\n\n<p>\u603b\u7ed3\u800c\u8a00\uff0cwandb\u67094\u9879\u6838\u5fc3\u529f\u80fd\uff1a<\/p>\n\n\n\n<p>\u770b\u677f\uff1a\u8ddf\u8e2a\u8bad\u7ec3\u8fc7\u7a0b\uff0c\u7ed9\u51fa\u53ef\u89c6\u5316\u7ed3\u679c<br>\u62a5\u544a\uff1a\u4fdd\u5b58\u548c\u5171\u4eab\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u4e00\u4e9b\u7ec6\u8282\u3001\u6709\u4ef7\u503c\u7684\u4fe1\u606f<br>\u8c03\u4f18\uff1a\u4f7f\u7528\u8d85\u53c2\u6570\u8c03\u4f18\u6765\u4f18\u5316\u4f60\u8bad\u7ec3\u7684\u6a21\u578b<br>\u5de5\u5177\uff1a\u6570\u636e\u96c6\u548c\u6a21\u578b\u7248\u672c\u5316<br>\u4e5f\u5c31\u662f\u8bf4\uff0cwandb\u5e76\u4e0d\u5355\u7eaf\u7684\u662f\u4e00\u6b3e\u6570\u636e\u53ef\u89c6\u5316\u5de5\u5177\u3002\u5b83\u5177\u6709\u66f4\u4e3a\u5f3a\u5927\u7684\u6a21\u578b\u548c\u6570\u636e\u7248\u672c\u7ba1\u7406\u3002\u6b64\u5916\uff0c\u8fd8\u53ef\u4ee5\u5bf9\u4f60\u8bad\u7ec3\u7684\u6a21\u578b\u8fdb\u884c\u8c03\u4f18\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" width=\"1024\" height=\"781\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/04\/image-13-1024x781.png\" alt=\"\" class=\"wp-image-3685\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/04\/image-13-1024x781.png 1024w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/04\/image-13-300x229.png 300w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/04\/image-13-768x586.png 768w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/04\/image-13.png 1081w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2><strong>draw_convnet<\/strong><\/h2>\n\n\n\n<p>\u4e00\u4e2a\u7528\u4e8e\u753b\u5377\u79ef\u795e\u7ecf\u7f51\u7edc\u7684Python\u811a\u672c<\/p>\n\n\n\n<p><a href=\"https:\/\/github.com\/gwding\/draw_convnet\">https:\/\/github.com\/gwding\/draw_convnet<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" width=\"1024\" height=\"325\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-123-1024x325.png\" alt=\"\" class=\"wp-image-1467\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-123-1024x325.png 1024w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-123-300x95.png 300w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-123-768x244.png 768w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-123.png 1322w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2><strong>NNSVG<\/strong><\/h2>\n\n\n\n<p><a href=\"http:\/\/alexlenail.me\/NN-SVG\/LeNet.html\">http:\/\/alexlenail.me\/NN-SVG\/LeNet.html<\/a><\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-style-default\"><img loading=\"lazy\" width=\"1024\" height=\"312\" src=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-124-1024x312.png\" alt=\"\" class=\"wp-image-1468\" srcset=\"http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-124-1024x312.png 1024w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-124-300x92.png 300w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-124-768x234.png 768w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-124-1536x469.png 1536w, http:\/\/139.9.1.231\/wp-content\/uploads\/2022\/01\/image-124.png 1704w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2><strong>PlotNeuralNet<\/strong>\uff1a\u7528\u4e8e\u4e3a\u62a5\u544a\u548c\u6f14\u793a\u7ed8\u5236\u795e\u7ecf\u7f51\u7edc\u7684 Latex \u4ee3\u7801\u3002<\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/HarisIqbal88\/PlotNeuralNet\">https:\/\/github.com\/HarisIqbal88\/PlotNeuralNet<\/a><\/p>\n\n\n\n<h2><strong>Tensorboard<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/www.tensorflow.org\/tensorboard\/graphs\">https:\/\/www.tensorflow.org\/tensorboard\/graphs<\/a><\/p>\n\n\n\n<h2><strong>Caffe<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/BVLC\/caffe\/blob\/master\/python\/caffe\/draw.py\">https:\/\/github.com\/BVLC\/caffe\/blob\/master\/python\/caffe\/draw.py<\/a><\/p>\n\n\n\n<h2><strong>Matlab<\/strong><\/h2>\n\n\n\n<p>http:\/\/www.mathworks.com\/help\/nnet\/ref\/view.html<\/p>\n\n\n\n<h2><strong>Keras.js<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/transcranial.github.io\/keras-js\/#\/inception-v3\">https:\/\/transcranial.github.io\/keras-js\/#\/inception-v3<\/a><\/p>\n\n\n\n<h2><strong>DotNet<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/github.com\/martisak\/dotnets\">https:\/\/github.com\/martisak\/dotnets<\/a><\/p>\n\n\n\n<h2><strong>Graphviz<\/strong><\/h2>\n\n\n\n<p>http:\/\/www.graphviz.org\/<\/p>\n\n\n\n<h2><strong>ConX<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/conx.readthedocs.io\/en\/latest\/index.html\">https:\/\/conx.readthedocs.io\/en\/latest\/index.html<\/a><\/p>\n\n\n\n<h2><strong>ENNUI<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/math.mit.edu\/ennui\/\">https:\/\/math.mit.edu\/ennui\/<\/a><\/p>\n\n\n\n<h2><strong>Neataptic<\/strong><\/h2>\n\n\n\n<p><a href=\"https:\/\/wagenaartje.github.io\/neataptic\/\">https:\/\/wagenaartje.github.io\/neataptic\/<\/a><\/p>\n\n\n\n<p><\/p>\n\n\n\n<h1>pyTorch\u6a21\u578b\u53ef\u89c6\u5316<\/h1>\n\n\n\n<h2>visdom\uff1a<\/h2>\n\n\n\n<p>\u5728PyTorch\u6df1\u5ea6\u5b66\u4e60\u4e2d\uff0c\u6700\u5e38\u7528\u7684\u6a21\u578b\u53ef\u89c6\u5316\u5de5\u5177\u662fFacebook\uff08\u4e2d\u6587\u4e3a\u8138\u4e66\uff0c\u76ee\u524d\u5df2\u6539\u540d\u4e3aMeta\uff09\u516c\u53f8\u5f00\u6e90\u7684Visdom<\/p>\n\n\n\n<p>Visdom\u53ef\u4ee5\u76f4\u63a5\u63a5\u53d7\u6765\u81eaPyTorch\u7684\u5f20\u91cf\uff0c\u800c\u4e0d\u7528\u8f6c\u5316\u6210NumPy\u4e2d\u7684\u6570\u7ec4\uff0c\u4ece\u800c\u8fd0\u884c\u6548\u7387\u5f88\u9ad8\u3002\u6b64\u5916\uff0cVisdom\u53ef\u4ee5\u76f4\u63a5\u5728\u5185\u5b58\u4e2d\u83b7\u53d6\u6570\u636e\uff0c\u6beb\u79d2\u7ea7\u5237\u65b0\uff0c\u901f\u5ea6\u5f88\u5feb\u3002<\/p>\n\n\n\n<p>Visdom\u7684\u5b89\u88c5\u5f88\u7b80\u5355\uff0c\u76f4\u63a5\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\uff1a<\/p>\n\n\n\n<p>pip install visdom<\/p>\n\n\n\n<p>\u5f00\u542f\u670d\u52a1\uff0c\u56e0\u4e3avisdom\u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u7c7b\u4f3c\u4e8eJupyter Notebook \u7684Web\u670d\u52a1\u5668\uff0c\u5728\u4f7f\u7528\u4e4b\u524d\u9700\u8981\u5728\u7ec8\u7aef\u6253\u5f00\u670d\u52a1\uff0c\u4ee3\u7801\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>python -m visdom.server<\/p>\n\n\n\n<p>\u6b63\u5e38\u6267\u884c\u540e\uff0c\u6839\u636e\u63d0\u793a\u5728\u6d4f\u89c8\u5668\u4e2d\u8f93\u5165\u76f8\u5e94\u5730\u5740\u5373\u53ef\uff0c\u9ed8\u8ba4\u5730\u5740\u4e3a\uff1a<\/p>\n\n\n\n<p>http:\/\/localhost:8097\/<\/p>\n\n\n\n<h3>\u5b9e\u4f8b<\/h3>\n\n\n\n<p>\u672c\u4f8b\u901a\u8fc7\u4f7f\u7528PyTorch\u7684\u53ef\u89c6\u5316\u5de5\u5177Visdom\u5bf9\u624b\u5199\u6570\u5b57\u6570\u636e\u96c6\u8fdb\u884c\u5efa\u6a21\u3002<\/p>\n\n\n\n<p><strong>\u6b65\u9aa41\uff1a<\/strong>\u5148\u5bfc\u5165\u6a21\u578b\u9700\u8981\u7684\u5305\uff0c\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>import torch<\/p>\n\n\n\n<p>import torch.nn as nn<\/p>\n\n\n\n<p>import torch.nn.functional as F<\/p>\n\n\n\n<p>import torch.optim as optim<\/p>\n\n\n\n<p>from torchvision import datasets, transforms<\/p>\n\n\n\n<p>from visdom import Visdom<\/p>\n\n\n\n<p><strong>\u6b65\u9aa42\uff1a<\/strong>\u5b9a\u4e49\u8bad\u7ec3\u53c2\u6570\uff0c\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>batch_size=200<\/p>\n\n\n\n<p>learning_rate=0.01<\/p>\n\n\n\n<p>epochs=10<\/p>\n\n\n\n<p>&#8230; &#8230;<\/p>\n\n\n\n<p>\u6267\u884c\u6210\u529f\u540e\uff0c\u5728visdom\u7f51\u9875\u53ef\u4ee5\u770b\u5230\u5b9e\u65f6\u66f4\u65b0\u7684\u8bad\u7ec3\u8fc7\u7a0b\u7684\u6570\u636e\u53d8\u5316\uff0c\u6bcf\u4e00\u4e2aepoch\u6d4b\u8bd5\u6570\u636e\u66f4\u65b0\u4e00\u6b21\uff0c\u5982\u56fe9-15\u6240\u793a\u3002<\/p>\n\n\n\n<p>Visdom\u662f\u7531Plotly \u63d0\u4f9b\u7684\u53ef\u89c6\u5316\u652f\u6301\uff0c\u6240\u4ee5\u63d0\u4f9b\u4e00\u4e0b\u53ef\u89c6\u5316\u7684\u63a5\u53e3:<\/p>\n\n\n\n<ul><li>vis.scatter : 2D \u6216 3D \u6563\u70b9\u56fe<\/li><li>vis.line : \u7ebf\u56fe<\/li><li>vis.stem : \u830e\u53f6\u56fe<\/li><li>vis.heatmap : \u70ed\u529b\u56fe<\/li><li>vis.bar : \u6761\u5f62\u56fe<\/li><li>vis.histogram: \u76f4\u65b9\u56fe<\/li><li>vis.boxplot : \u7bb1\u578b\u56fe<\/li><li>vis.surf : \u8868\u9762\u56fe<\/li><li>vis.contour : \u8f6e\u5ed3\u56fe<\/li><li>vis.quiver : \u7ed8\u51fa\u4e8c\u7ef4\u77e2\u91cf\u573a<\/li><li>vis.image : \u56fe\u7247<\/li><li>vis.text : \u6587\u672c<\/li><li>vis.mesh : \u7f51\u683c\u56fe<\/li><li>vis.save : \u5e8f\u5217\u5316\u72b6\u6001<\/li><\/ul>\n\n\n\n<p><strong>\u66f4\u65b0\u635f\u5931\u51fd\u6570<\/strong><\/p>\n\n\n\n<p>\u5728\u8bad\u7ec3\u7684\u65f6\u5019\u6211\u4eec\u6bcf\u4e00\u6279\u6b21\u90fd\u4f1a\u6253\u5370\u4e00\u4e0b\u8bad\u7ec3\u7684\u635f\u5931\u548c\u6d4b\u8bd5\u7684\u51c6\u786e\u7387\uff0c\u8fd9\u6837\u5c55\u793a\u7684\u56fe\u8868\u662f\u9700\u8981\u52a8\u6001\u589e\u52a0\u6570\u636e\u7684\uff0c\u4e0b\u9762\u6211\u4eec\u6765\u6a21\u62df\u4e00\u4e0b\u8fd9\u79cd\u60c5\u51b5\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>x,y=0,0\nenv2 = Visdom()\npane1= env2.line(\n    X=np.array(&#091;x]),\n    Y=np.array(&#091;y]),\n    opts=dict(title='dynamic data'))<\/code><\/pre>\n\n\n\n<blockquote class=\"wp-block-quote\"><p>Setting up a new session&#8230;<\/p><\/blockquote>\n\n\n\n<pre class=\"wp-block-code\"><code>for i in range(10):\n    time.sleep(1) #\u6bcf\u9694\u4e00\u79d2\u949f\u6253\u5370\u4e00\u6b21\u6570\u636e\n    x+=i\n    y=(y+i)*1.5\n    print(x,y)\n    env2.line(\n        X=np.array(&#091;x]),\n        Y=np.array(&#091;y]),\n        win=pane1,#win\u53c2\u6570\u786e\u8ba4\u4f7f\u7528\u54ea\u4e00\u4e2apane\n        update='append') #\u6211\u4eec\u505a\u7684\u52a8\u4f5c\u662f\u8ffd\u52a0<\/code><\/pre>\n\n\n\n<h2>TensorBoard<\/h2>\n\n\n\n<p>pytorch\u4e5f\u652f\u6301tensorboard\u7684\u4f7f\u7528\uff1a<\/p>\n\n\n\n<h3>Tensorboard\u7684\u4f7f\u7528\u903b\u8f91<\/h3>\n\n\n\n<p>Tensorboard\u7684\u5de5\u4f5c\u6d41\u7a0b\u7b80\u5355\u6765\u8bf4\u662f<\/p>\n\n\n\n<ul><li>\u5c06\u4ee3\u7801\u8fd0\u884c\u8fc7\u7a0b\u4e2d\u7684\uff0c\u67d0\u4e9b\u4f60\u5173\u5fc3\u7684\u6570\u636e\u4fdd\u5b58\u5728\u4e00\u4e2a<strong>\u6587\u4ef6\u5939<\/strong>\u4e2d\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8fd9\u4e00\u6b65\u7531\u4ee3\u7801\u4e2d\u7684writer\u5b8c\u6210<\/code><\/pre>\n\n\n\n<ul><li>\u518d\u8bfb\u53d6\u8fd9\u4e2a<strong>\u6587\u4ef6\u5939<\/strong>\u4e2d\u7684\u6570\u636e\uff0c\u7528\u6d4f\u89c8\u5668\u663e\u793a\u51fa\u6765\uff1a<\/li><\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>\u8fd9\u4e00\u6b65\u901a\u8fc7\u5728\u547d\u4ee4\u884c\u8fd0\u884ctensorboard\u5b8c\u6210\u3002<\/code><\/pre>\n\n\n\n<p>\u5b98\u65b9\uff1a<\/p>\n\n\n\n<p><a href=\"https:\/\/pytorch.org\/docs\/stable\/tensorboard.html?highlight=tensorboard\">https:\/\/pytorch.org\/docs\/stable\/tensorboard.html?highlight=tensorboard<\/a><\/p>\n\n\n\n<p>\u5176\u4e2d\u53ef\u89c6\u5316\u7684\u4e3b\u8981\u529f\u80fd\u5982\u4e0b\uff1a<\/p>\n\n\n\n<p>\uff081\uff09Scalars:\u5c55\u793a\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u51c6\u786e\u7387\u3001\u635f\u5931\u503c\u3001\u6743\u91cd\/\u504f\u7f6e\u7684\u53d8\u5316\u60c5\u51b5\u3002<\/p>\n\n\n\n<p>\uff082\uff09Images:\u5c55\u793a\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u8bb0\u5f55\u7684\u56fe\u50cf\u3002<\/p>\n\n\n\n<p>\uff083\uff09Audio:\u5c55\u793a\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u8bb0\u5f55\u7684\u97f3\u9891\u3002<\/p>\n\n\n\n<p>\uff084\uff09Graphs:\u5c55\u793a\u6a21\u578b\u7684\u6570\u636e\u6d41\u56fe\uff0c\u4ee5\u53ca\u8bad\u7ec3\u5728\u5404\u4e2a\u8bbe\u5907\u4e0a\u6d88\u8017\u7684\u5185\u5b58\u548c\u65f6\u95f4\u3002<\/p>\n\n\n\n<p>\uff085\uff09Distributions:\u5c55\u793a\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u8bb0\u5f55\u7684\u6570\u636e\u7684\u5206\u90e8\u56fe\u3002<\/p>\n\n\n\n<p>\uff086\uff09Histograms:\u5c55\u793a\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u8bb0\u5f55\u7684\u6570\u636e\u7684\u67f1\u72b6\u56fe\u3002<\/p>\n\n\n\n<p>\uff087\uff09Embeddings:\u5c55\u793a\u8bcd\u5411\u91cf\u540e\u7684\u6295\u5f71\u5206\u90e8\u3002<\/p>\n\n\n\n<h3>\u52a8\u624b\u7ec3\u4e60\uff1a\u53ef\u89c6\u5316\u6a21\u578b\u53c2\u6570<\/h3>\n\n\n\n<p><strong>\u6b65\u9aa41\uff1a<\/strong>\u9996\u5148\u5bfc\u5165\u76f8\u5173\u7684\u7b2c\u4e09\u65b9\u5305\uff0c\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>import numpy as np<\/p>\n\n\n\n<p>from torch.utils.tensorboard import SummaryWriter<\/p>\n\n\n\n<p><strong>\u6b65\u9aa42\uff1a<\/strong>\u5c06loss\u5199\u5230Loss_Accuracy\u8def\u5f84\u4e0b\u9762\uff0c\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>np.random.seed(10)<\/p>\n\n\n\n<p>writer = SummaryWriter(&#8216;runs\/Loss_Accuracy&#8217;)<\/p>\n\n\n\n<p><strong>\u6b65\u9aa43\uff1a<\/strong>\u7136\u540e\u5c06loss\u5199\u5230writer\u4e2d\uff0c\u5176\u4e2dadd_scalars()\u51fd\u6570\u53ef\u4ee5\u5c06\u4e0d\u540c\u7684\u53d8\u91cf\u6dfb\u52a0\u5230\u540c\u4e00\u4e2a\u56fe\uff0c\u4ee3\u7801\u5982\u4e0b\u3002<\/p>\n\n\n\n<p>for n_iter in range(100):<\/p>\n\n\n\n<p>writer.add_scalar(&#8216;Loss\/train&#8217;, np.random.random(), n_iter)<\/p>\n\n\n\n<p>writer.add_scalar(&#8216;Loss\/test&#8217;, np.random.random(), n_iter)<\/p>\n\n\n\n<p>writer.add_scalar(&#8216;Accuracy\/train&#8217;, np.random.random(), n_iter)<\/p>\n\n\n\n<p>writer.add_scalar(&#8216;Accuracy\/test&#8217;, np.random.random(), n_iter)<\/p>\n\n\n\n<h3>\u4ee3\u7801\u4f53\u4e2d\u8981\u505a\u7684\u4e8b<\/h3>\n\n\n\n<p>\u9996\u5148\u5bfc\u5165tensorboard<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>from torch.utils.tensorboard import SummaryWriter   <\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u7684SummaryWriter\u7684\u4f5c\u7528\u5c31\u662f\uff0c\u5c06\u6570\u636e\u4ee5\u7279\u5b9a\u7684\u683c\u5f0f\u5b58\u50a8\u5230\u521a\u521a\u63d0\u5230\u7684\u90a3\u4e2a<strong>\u6587\u4ef6\u5939<\/strong>\u4e2d\u3002<\/p>\n\n\n\n<p>\u9996\u5148\u6211\u4eec\u5c06\u5176\u5b9e\u4f8b\u5316<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>writer = SummaryWriter('.\/path\/to\/log')<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u4f20\u5165\u7684\u53c2\u6570\u5c31\u662f\u6307\u5411\u6587\u4ef6\u5939\u7684\u8def\u5f84\uff0c\u4e4b\u540e\u6211\u4eec\u4f7f\u7528\u8fd9\u4e2awriter\u5bf9\u8c61\u201c\u62ff\u51fa\u6765\u201d\u7684\u4efb\u4f55\u6570\u636e\u90fd\u4fdd\u5b58\u5728\u8fd9\u4e2a\u8def\u5f84\u4e4b\u4e0b\u3002<\/p>\n\n\n\n<p>\u8fd9\u4e2a\u5bf9\u8c61\u5305\u542b\u591a\u4e2a\u65b9\u6cd5\uff0c\u6bd4\u5982\u9488\u5bf9\u6570\u503c\uff0c\u6211\u4eec\u53ef\u4ee5\u8c03\u7528<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>writer.add_scalar(tag, scalar_value, global_step=None, walltime=None)<\/code><\/pre>\n\n\n\n<p>\u8fd9\u91cc\u7684tag\u6307\u5b9a\u53ef\u89c6\u5316\u65f6\u8fd9\u4e2a\u53d8\u91cf\u7684\u540d\u5b57\uff0cscalar_value\u662f\u4f60\u8981\u5b58\u7684\u503c\uff0cglobal_step\u53ef\u4ee5\u7406\u89e3\u4e3ax\u8f74\u5750\u6807\u3002<\/p>\n\n\n\n<p>\u4e3e\u4e00\u4e2a\u7b80\u5355\u7684\u4f8b\u5b50\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>for epoch in range(100)\n    mAP = eval(model)\n    writer.add_scalar('mAP', mAP, epoch)<\/code><\/pre>\n\n\n\n<p>\u8fd9\u6837\u5c31\u4f1a\u751f\u6210\u4e00\u4e2ax\u8f74\u8de8\u5ea6\u4e3a100\u7684\u6298\u7ebf\u56fe\uff0cy\u8f74\u5750\u6807\u4ee3\u8868\u7740\u6bcf\u4e00\u4e2aepoch\u7684mAP\u3002\u8fd9\u4e2a\u6298\u7ebf\u56fe\u4f1a\u4fdd\u5b58\u5728\u6307\u5b9a\u7684\u8def\u5f84\u4e0b\uff08\u4f46\u662f\u73b0\u5728\u8fd8\u770b\u4e0d\u5230\uff09<\/p>\n\n\n\n<p>\u540c\u7406\uff0c\u9664\u4e86\u6570\u503c\uff0c\u6211\u4eec\u53ef\u80fd\u8fd8\u4f1a\u60f3\u770b\u5230\u6a21\u578b\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684\u56fe\u50cf\u3002<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code> writer.add_image(tag, img_tensor, global_step=None, walltime=None, dataformats='CHW')\n writer.add_images(tag, img_tensor, global_step=None, walltime=None, dataformats='NCHW')<\/code><\/pre>\n\n\n\n<h3><strong>\u53ef\u89c6\u5316<\/strong><\/h3>\n\n\n\n<p>\u6211\u4eec\u5df2\u7ecf\u5c06\u5173\u5fc3\u7684\u6570\u636e\u62ff\u51fa\u6765\u4e86\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u53ea\u9700\u8981\u5728\u547d\u4ee4\u884c\u8fd0\u884c\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tensorboard --logdir=.\/path\/to\/the\/folder --port 8123<\/code><\/pre>\n\n\n\n<p>\u7136\u540e\u6253\u5f00\u6d4f\u89c8\u5668\uff0c\u8bbf\u95ee\u5730\u5740<a href=\"http:\/\/localhost:8123\/\" target=\"_blank\" rel=\"noreferrer noopener\">http:\/\/localhost:8123\/<\/a>\u5373\u53ef\u3002\u8fd9\u91cc\u76848123\u53ea\u662f\u968f\u4fbf\u4e00\u4e2a\u4f8b\u5b50\uff0c\u7528\u5176\u4ed6\u7684\u672a\u88ab\u5360\u7528\u7aef\u53e3\u4e5f\u6ca1\u6709\u4efb\u4f55\u95ee\u9898\uff0c\u6ce8\u610f\u547d\u4ee4\u884c\u7684\u7aef\u53e3\u4e0e\u6d4f\u89c8\u5668\u8bbf\u95ee\u7684\u5730\u5740\u540c\u6b65\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u53d1\u73b0\u4e0d\u663e\u793a\u6570\u636e\uff0c\u6ce8\u610f\u68c0\u67e5\u4e00\u4e0b\u8def\u5f84\u662f\u5426\u6b63\u786e\uff0c\u547d\u4ee4\u884c\u8fd9\u91cc\u6ce8\u610f\u662f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>--logdir=.\/path\/to\/the\/folder <\/code><\/pre>\n\n\n\n<p>\u800c\u4e0d\u662f<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>--logdir= '.\/path\/to\/the\/folder '<\/code><\/pre>\n\n\n\n<p>\u53e6\u4e00\u70b9\u8981\u6ce8\u610f\u7684\u662ftensorboard\u5e76\u4e0d\u662f\u5b9e\u65f6\u663e\u793a\uff08visdom\u662f\u5b8c\u5168\u5b9e\u65f6\u7684\uff09\uff0c\u800c\u662f\u9ed8\u8ba430\u79d2\u5237\u65b0\u4e00\u6b21\u3002<\/p>\n\n\n\n<h3>\u7ec6\u8282<\/h3>\n\n\n\n<h4>1.\u53d8\u91cf\u5f52\u7c7b<\/h4>\n\n\n\n<p>\u547d\u540d\u53d8\u91cf\u7684\u65f6\u5019\u53ef\u4ee5\u4f7f\u7528\u5f62\u5982<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>writer.add_scalar('loss\/loss1', loss1, epoch)\nwriter.add_scalar('loss\/loss2', loss2, epoch)\nwriter.add_scalar('loss\/loss3', loss3, epoch)<\/code><\/pre>\n\n\n\n<p>\u7684\u683c\u5f0f\uff0c\u8fd9\u68373\u4e2aloss\u5c31\u4f1a\u88ab\u663e\u793a\u5728\u540c\u4e00\u4e2asection\u3002<\/p>\n\n\n\n<h4>2.\u540c\u65f6\u663e\u793a\u591a\u4e2a\u6298\u7ebf\u56fe<\/h4>\n\n\n\n<p>\u5047\u5982\u4f7f\u7528\u4e86\u4e24\u79cd\u5b66\u4e60\u7387\u53bb\u8bad\u7ec3\u540c\u4e00\u4e2a\u7f51\u7edc\uff0c\u60f3\u8981\u6bd4\u8f83\u5b83\u4eec\u8bad\u7ec3\u8fc7\u7a0b\u4e2d\u7684loss\u66f2\u7ebf\uff0c\u53ea\u9700\u8981\u5c06\u4e24\u4e2a\u65e5\u5fd7\u6587\u4ef6\u5939\u653e\u5230\u540c\u4e00\u76ee\u5f55\u4e0b\uff0c\u5e76\u5728\u547d\u4ee4\u884c\u8fd0\u884c<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>tensorboard --logdir=.\/path\/to\/the\/root --port 8123<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u6765\u6e90\uff1a\u78d0\u521bAI\u5206\u4eab \u795e\u7ecf\u7f51\u7edc\u53ef\u89c6\u5316\u5de5\u5177 Convolution Visualizer https:\/\/ezya &hellip; <a href=\"http:\/\/139.9.1.231\/index.php\/2022\/01\/07\/visi\/\" class=\"more-link\">\u7ee7\u7eed\u9605\u8bfb<span class=\"screen-reader-text\">\u795e\u7ecf\u7f51\u7edc\u53ef\u89c6\u5316\u5de5\u5177<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[4,12],"tags":[],"_links":{"self":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/1466"}],"collection":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/comments?post=1466"}],"version-history":[{"count":20,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/1466\/revisions"}],"predecessor-version":[{"id":10518,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/posts\/1466\/revisions\/10518"}],"wp:attachment":[{"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/media?parent=1466"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/categories?post=1466"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/139.9.1.231\/index.php\/wp-json\/wp\/v2\/tags?post=1466"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}