{"id":40529,"date":"2025-05-29T09:38:11","date_gmt":"2025-05-29T01:38:11","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/40529.html"},"modified":"2025-05-29T09:38:11","modified_gmt":"2025-05-29T01:38:11","slug":"day-35","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/40529.html","title":{"rendered":"Day 35"},"content":{"rendered":"<p>\u6a21\u578b\u53ef\u89c6\u5316\u4e0e\u63a8\u7406 \u77e5\u8bc6\u70b9\u56de\u987e&#xff1a;<\/p>\n<p>\u4e09\u79cd\u4e0d\u540c\u7684\u6a21\u578b\u53ef\u89c6\u5316\u65b9\u6cd5&#xff1a;\u63a8\u8350torchinfo\u6253\u5370summary&#043;\u6743\u91cd\u5206\u5e03\u53ef\u89c6\u5316 \u8fdb\u5ea6\u6761\u529f\u80fd&#xff1a;\u624b\u52a8\u548c\u81ea\u52a8\u5199\u6cd5&#xff0c;\u8ba9\u6253\u5370\u7ed3\u679c\u66f4\u52a0\u7f8e\u89c2 \u63a8\u7406\u7684\u5199\u6cd5&#xff1a;\u8bc4\u4f30\u6a21\u5f0f \u6a21\u578b\u7ed3\u6784\u53ef\u89c6\u5316 \u7406\u89e3\u4e00\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u6700\u91cd\u8981\u76842\u70b9&#xff1a;<\/p>\n<p>1. \u4e86\u89e3\u635f\u5931\u5982\u4f55\u5b9a\u4e49\u7684&#xff0c;\u77e5\u9053\u635f\u5931\u4ece\u4f55\u800c\u6765&#8212;-\u628a\u62bd\u8c61\u7684\u4efb\u52a1\u901a\u8fc7\u635f\u5931\u51fd\u6570\u91cf\u5316\u51fa\u6765<\/p>\n<p>2. \u4e86\u89e3\u53c2\u6570\u603b\u91cf&#xff0c;\u5373\u77e5\u9053\u6bcf\u4e00\u5c42\u7684\u8bbe\u8ba1&#8212;\u5c42\u8bbe\u8ba1\u51b3\u5b9a\u53c2\u6570\u603b\u91cf<\/p>\n<p>\u4e3a\u4e86\u4e86\u89e3\u53c2\u6570\u603b\u91cf&#xff0c;\u6211\u4eec\u9700\u8981\u77e5\u9053\u5c42\u8bbe\u8ba1&#xff0c;\u4ee5\u53ca\u6bcf\u4e00\u5c42\u53c2\u6570\u7684\u6570\u91cf\u3002\u4e0b\u9762\u4ecb\u7ecd1\u51e0\u4e2a\u5c42\u53ef\u89c6\u5316\u5de5\u5177&#xff1a;<\/p>\n<p>1. nn.model\u81ea\u5e26\u7684\u65b9\u6cd5<\/p>\n<p>#  nn.Module \u7684\u5185\u7f6e\u529f\u80fd&#xff0c;\u76f4\u63a5\u8f93\u51fa\u6a21\u578b\u7ed3\u6784<br \/>\nprint(model) <\/p>\n<p>\u8fd9\u662f\u6700\u57fa\u7840\u3001\u6700\u7b80\u5355\u7684\u65b9\u6cd5&#xff0c;\u4f1a\u76f4\u63a5\u6253\u5370\u6a21\u578b\u5bf9\u8c61&#xff0c;\u5b83\u4f1a\u8f93\u51fa\u6a21\u578b\u7684\u7ed3\u6784&#xff0c;\u663e\u793a\u6a21\u578b\u4e2d\u5404\u4e2a\u5c42\u7684\u540d\u79f0\u548c\u53c2\u6570\u4fe1\u606f<\/p>\n<p># nn.Module \u7684\u5185\u7f6e\u529f\u80fd&#xff0c;\u8fd4\u56de\u6a21\u578b\u7684\u53ef\u8bad\u7ec3\u53c2\u6570\u8fed\u4ee3\u5668<br \/>\nfor name, param in model.named_parameters():<br \/>\n    print(f&#034;Parameter name: {name}, Shape: {param.shape}&#034;) <\/p>\n<p>\u53ef\u4ee5\u5c06\u6a21\u578b\u4e2d\u5e26\u6709weight\u7684\u53c2\u6570&#xff08;\u5373\u6743\u91cd&#xff09;\u63d0\u53d6\u51fa\u6765&#xff0c;\u5e76\u8f6c\u4e3a numpy \u6570\u7ec4\u5f62\u5f0f&#xff0c;\u5bf9\u5176\u8ba1\u7b97\u7edf\u8ba1\u5206\u5e03&#xff0c;\u5e76\u4e14\u7ed8\u5236\u53ef\u89c6\u5316\u56fe\u8868<\/p>\n<p># \u63d0\u53d6\u6743\u91cd\u6570\u636e<br \/>\nimport numpy as np<br \/>\nweight_data &#061; {}<br \/>\nfor name, param in model.named_parameters():<br \/>\n    if &#039;weight&#039; in name:<br \/>\n        weight_data[name] &#061; param.detach().cpu().numpy()<\/p>\n<p># \u53ef\u89c6\u5316\u6743\u91cd\u5206\u5e03<br \/>\nfig, axes &#061; plt.subplots(1, len(weight_data), figsize&#061;(15, 5))<br \/>\nfig.suptitle(&#039;Weight Distribution of Layers&#039;)<\/p>\n<p>for i, (name, weights) in enumerate(weight_data.items()):<br \/>\n    # \u5c55\u5e73\u6743\u91cd\u5f20\u91cf\u4e3a\u4e00\u7ef4\u6570\u7ec4<br \/>\n    weights_flat &#061; weights.flatten()<\/p>\n<p>    # \u7ed8\u5236\u76f4\u65b9\u56fe<br \/>\n    axes[i].hist(weights_flat, bins&#061;50, alpha&#061;0.7)<br \/>\n    axes[i].set_title(name)<br \/>\n    axes[i].set_xlabel(&#039;Weight Value&#039;)<br \/>\n    axes[i].set_ylabel(&#039;Frequency&#039;)<br \/>\n    axes[i].grid(True, linestyle&#061;&#039;&#8211;&#039;, alpha&#061;0.7)<\/p>\n<p>plt.tight_layout()<br \/>\nplt.subplots_adjust(top&#061;0.85)<br \/>\nplt.show()<\/p>\n<p># \u8ba1\u7b97\u5e76\u6253\u5370\u6bcf\u5c42\u6743\u91cd\u7684\u7edf\u8ba1\u4fe1\u606f<br \/>\nprint(&#034;\\\\n&#061;&#061;&#061; \u6743\u91cd\u7edf\u8ba1\u4fe1\u606f &#061;&#061;&#061;&#034;)<br \/>\nfor name, weights in weight_data.items():<br \/>\n    mean &#061; np.mean(weights)<br \/>\n    std &#061; np.std(weights)<br \/>\n    min_val &#061; np.min(weights)<br \/>\n    max_val &#061; np.max(weights)<br \/>\n    print(f&#034;{name}:&#034;)<br \/>\n    print(f&#034;  \u5747\u503c: {mean:.6f}&#034;)<br \/>\n    print(f&#034;  \u6807\u51c6\u5dee: {std:.6f}&#034;)<br \/>\n    print(f&#034;  \u6700\u5c0f\u503c: {min_val:.6f}&#034;)<br \/>\n    print(f&#034;  \u6700\u5927\u503c: {max_val:.6f}&#034;)<br \/>\n    print(&#034;-&#034; * 30) <\/p>\n<p>\u5bf9\u6bd4 fc1.weight \u548c fc2.weight \u7684\u7edf\u8ba1\u4fe1\u606f &#xff0c;\u53ef\u4ee5\u53d1\u73b0\u5b83\u4eec\u7684\u5747\u503c\u3001\u6807\u51c6\u5dee\u3001\u6700\u503c\u7b49\u5b58\u5728\u5dee\u5f02\u3002\u8fd9\u53cd\u6620\u4e86\u4e0d\u540c\u5c42\u5728\u6a21\u578b\u4e2d\u7684\u4f5c\u7528\u4e0d\u540c\u3002\u6743\u91cd\u7edf\u8ba1\u4fe1\u606f\u53ef\u4ee5\u4e3a\u8d85\u53c2\u6570\u8c03\u6574\u63d0\u4f9b\u53c2\u8003\u3002<\/p>\n<h6>2.torchsummary\u5e93\u7684summary\u65b9\u6cd5<\/h6>\n<p># pip install torchsummary -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<br \/>\nfrom torchsummary import summary<br \/>\n# \u6253\u5370\u6a21\u578b\u6458\u8981&#xff0c;\u53ef\u4ee5\u653e\u7f6e\u5728\u6a21\u578b\u5b9a\u4e49\u540e\u9762<br \/>\nsummary(model, input_size&#061;(4,)) <\/p>\n<p>\u00a0\u8be5\u65b9\u6cd5\u4e0d\u663e\u793a\u8f93\u5165\u5c42\u7684\u5c3a\u5bf8&#xff0c;\u56e0\u4e3a\u8f93\u5165\u7684\u795e\u7ecf\u7f51\u662f\u81ea\u5df1\u8bbe\u7f6e\u7684&#xff0c;\u6240\u4ee5\u4e0d\u9700\u8981\u663e\u793a\u8f93\u5165\u5c42\u7684\u5c3a\u5bf8\u3002\u4f46\u662f\u5728\u4f7f\u7528\u8be5\u65b9\u6cd5\u65f6&#xff0c;input_size&#061;(4,) \u53c2\u6570\u662f\u5fc5\u9700\u7684&#xff0c;\u56e0\u4e3a PyTorch \u9700\u8981\u77e5\u9053\u8f93\u5165\u6570\u636e\u7684\u5f62\u72b6\u624d\u80fd\u63a8\u65ad\u6a21\u578b\u5404\u5c42\u7684\u8f93\u51fa\u5f62\u72b6\u548c\u53c2\u6570\u6570\u91cf\u3002<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u8fd9\u662f\u56e0\u4e3aPyTorch \u7684\u6a21\u578b\u5728\u5b9a\u4e49\u65f6\u662f\u52a8\u6001\u7684&#xff0c;\u5b83\u4e0d\u4f1a\u9884\u5148\u77e5\u9053\u8f93\u5165\u6570\u636e\u7684\u5177\u4f53\u5f62\u72b6\u3002nn.Linear(4, 10) \u53ea\u5b9a\u4e49\u4e86 \u201c\u8f93\u5165\u7ef4\u5ea6\u662f 4&#xff0c;\u8f93\u51fa\u7ef4\u5ea6\u662f 10\u201d&#xff0c;\u4f46\u4e0d\u77e5\u9053\u8f93\u5165\u7684\u6279\u91cf\u5927\u5c0f\u548c\u5176\u4ed6\u7ef4\u5ea6&#xff0c;\u6bd4\u5982\u5377\u79ef\u5c42\u9700\u8981\u77e5\u9053\u8f93\u5165\u7684\u901a\u9053\u6570\u3001\u9ad8\u5ea6\u3001\u5bbd\u5ea6\u7b49\u4fe1\u606f\u3002&#8212;-\u5e76\u975e\u6240\u6709\u8f93\u5165\u6570\u636e\u90fd\u662f\u7ed3\u6784\u5316\u6570\u636e<\/p>\n<p>\u00a0 \u00a0 \u00a0 \u00a0 \u56e0\u6b64&#xff0c;\u8981\u751f\u6210\u6a21\u578b\u6458\u8981&#xff08;\u5982\u6bcf\u5c42\u7684\u8f93\u51fa\u5f62\u72b6\u3001\u53c2\u6570\u6570\u91cf&#xff09;&#xff0c;\u5fc5\u987b\u63d0\u4f9b\u4e00\u4e2a\u793a\u4f8b\u8f93\u5165\u5f62\u72b6&#xff0c;\u8ba9 PyTorch \u201c\u8fd0\u884c\u201d \u4e00\u6b21\u6a21\u578b&#xff0c;\u4ece\u800c\u63a8\u65ad\u51fa\u5404\u5c42\u7684\u4fe1\u606f\u3002<\/p>\n<p>summary \u51fd\u6570\u7684\u6838\u5fc3\u903b\u8f91\u662f&#xff1a;<\/p>\n<p>1. \u521b\u5efa\u4e00\u4e2a\u4e0e input_size \u5f62\u72b6\u5339\u914d\u7684\u865a\u62df\u8f93\u5165\u5f20\u91cf&#xff08;\u901a\u5e38\u586b\u5145\u96f6&#xff09;<\/p>\n<p>2. \u5c06\u865a\u62df\u8f93\u5165\u4f20\u9012\u7ed9\u6a21\u578b&#xff0c;\u6267\u884c\u4e00\u6b21\u524d\u5411\u4f20\u64ad&#xff08;\u4f46\u4e0d\u8ba1\u7b97\u68af\u5ea6&#xff09;<\/p>\n<p>3. \u8bb0\u5f55\u6bcf\u4e00\u5c42\u7684\u8f93\u5165\u548c\u8f93\u51fa\u5f62\u72b6&#xff0c;\u4ee5\u53ca\u53c2\u6570\u6570\u91cf<\/p>\n<p>4. \u751f\u6210\u53ef\u8bfb\u7684\u6458\u8981\u62a5\u544a<\/p>\n<p>\u6784\u5efa\u795e\u7ecf\u7f51\u7edc\u7684\u65f6\u5019<\/p>\n<p>1. \u8f93\u5165\u5c42\u4e0d\u9700\u8981\u5199&#xff1a;x\u591a\u5c11\u4e2a\u7279\u5f81 \u8f93\u5165\u5c42\u5c31\u6709\u591a\u5c11\u795e\u7ecf\u5143<\/p>\n<p>2. \u9690\u85cf\u5c42\u9700\u8981\u5199&#xff0c;\u4ece\u7b2c\u4e00\u4e2a\u9690\u85cf\u5c42\u53ef\u4ee5\u770b\u51fa\u7279\u5f81\u7684\u4e2a\u6570<\/p>\n<p>3. \u8f93\u51fa\u5c42\u7684\u795e\u7ecf\u5143\u548c\u4efb\u52a1\u6709\u5173&#xff0c;\u6bd4\u5982\u5206\u7c7b\u4efb\u52a1&#xff0c;\u8f93\u51fa\u5c42\u67093\u4e2a\u795e\u7ecf\u5143&#xff0c;\u4e00\u4e2a\u5bf9\u5e94\u6bcf\u4e2a\u7c7b\u522b<\/p>\n<p>\u53ef\u5b66\u4e60\u53c2\u6570\u8ba1\u7b97<\/p>\n<p>1. Linear-1\u5bf9\u5e94self.fc1 &#061; nn.Linear(4, 10)&#xff0c;\u8868\u660e\u524d\u4e00\u5c42\u67094\u4e2a\u795e\u7ecf\u5143&#xff0c;\u8fd9\u4e00\u5c42\u670910\u4e2a\u795e\u7ecf\u5143&#xff0c;\u6bcf2\u4e2a\u795e\u7ecf\u5143\u4e4b\u95f4\u9760\u7740\u7ebf\u76f8\u8fde&#xff0c;\u6240\u6709\u67094*10\u4e2a\u6743\u91cd\u53c2\u6570&#043;10\u4e2a\u504f\u7f6e\u53c2\u6570&#061;50\u4e2a\u53c2\u6570<\/p>\n<p>2. relu\u5c42\u4e0d\u6d89\u53ca\u53ef\u5b66\u4e60\u53c2\u6570&#xff0c;\u53ef\u4ee5\u628a\u5b83\u548c\u524d\u4e00\u4e2a\u7ebf\u6027\u5c42\u770b\u6210\u4e00\u5c42&#xff0c;\u56fe\u4e0a\u4e5f\u662f\u8fd9\u4e2a\u542b\u4e49<\/p>\n<p>3. Linear-3\u5c42\u5bf9\u5e94\u4ee3\u7801 self.fc2 &#061; nn.Linear(10,3),10*3\u4e2a\u6743\u91cd\u53c2\u6570&#043;3\u4e2a\u504f\u7f6e&#061;33\u4e2a\u53c2\u6570<\/p>\n<p>\u603b\u53c2\u657083\u4e2a&#xff0c;\u5360\u7528\u5185\u5b58\u51e0\u4e4e\u4e3a0<\/p>\n<p>1.3 torchinfo\u5e93\u7684summary\u65b9\u6cd5 \u00a0torchinfo \u662f\u63d0\u4f9b\u6bd4 torchsummary \u66f4\u8be6\u7ec6\u7684\u6a21\u578b\u6458\u8981\u4fe1\u606f&#xff0c;\u5305\u62ec\u6bcf\u5c42\u7684\u8f93\u5165\u8f93\u51fa\u5f62\u72b6\u3001\u53c2\u6570\u6570\u91cf\u3001\u8ba1\u7b97\u91cf\u7b49\u3002<\/p>\n<p># pip install torchinfo -i https:\/\/pypi.tuna.tsinghua.edu.cn\/simple<br \/>\nfrom torchinfo import summary<br \/>\nsummary(model, input_size&#061;(4, )) <\/p>\n<p>\u8fdb\u5ea6\u6761\u529f\u80fd tqdm\u8fd9\u4e2a\u5e93\u975e\u5e38\u9002\u5408\u7528\u5728\u5faa\u73af\u4e2d\u89c2\u5bdf\u8fdb\u5ea6\u3002\u5c24\u5176\u5728\u6df1\u5ea6\u5b66\u4e60\u8fd9\u79cd\u8bad\u7ec3\u662f\u5faa\u73af\u7684\u573a\u666f\u4e2d\u3002\u4ed6\u6700\u6838\u5fc3\u7684\u903b\u8f91\u5982\u4e0b<\/p>\n<p>1. \u521b\u5efa\u4e00\u4e2a\u8fdb\u5ea6\u6761\u5bf9\u8c61&#xff0c;\u5e76\u4f20\u5165\u603b\u8fed\u4ee3\u6b21\u6570\u3002\u4e00\u822c\u7528with\u8bed\u53e5\u521b\u5efa\u5bf9\u8c61&#xff0c;\u8fd9\u6837\u5bf9\u8c61\u4f1a\u5728with\u8bed\u53e5\u7ed3\u675f\u540e\u81ea\u52a8\u9500\u6bc1&#xff0c;\u4fdd\u8bc1\u8d44\u6e90\u91ca\u653e\u3002with\u662f\u5e38\u89c1\u7684\u4e0a\u4e0b\u6587\u7ba1\u7406\u5668&#xff0c;\u8fd9\u6837\u7684\u4f7f\u7528\u65b9\u5f0f\u8fd8\u6709\u7528with\u6253\u5f00\u6587\u4ef6&#xff0c;\u7ed3\u675f\u540e\u4f1a\u81ea\u52a8\u5173\u95ed\u6587\u4ef6\u3002<\/p>\n<p>2. \u66f4\u65b0\u8fdb\u5ea6\u6761&#xff0c;\u901a\u8fc7pbar.update(n)\u6307\u5b9a\u6bcf\u6b21\u524d\u8fdb\u7684\u6b65\u6570n&#xff08;\u9002\u7528\u4e8e\u975e\u56fa\u5b9a\u6b65\u957f\u7684\u5faa\u73af&#xff09;\u3002<\/p>\n<p>1.\u624b\u52a8\u66f4\u65b0<\/p>\n<p>from tqdm import tqdm  # \u5148\u5bfc\u5165tqdm\u5e93<br \/>\nimport time  # \u7528\u4e8e\u6a21\u62df\u8017\u65f6\u64cd\u4f5c<\/p>\n<p># \u521b\u5efa\u4e00\u4e2a\u603b\u6b65\u6570\u4e3a10\u7684\u8fdb\u5ea6\u6761<br \/>\nwith tqdm(total&#061;10) as pbar:  # pbar\u662f\u8fdb\u5ea6\u6761\u5bf9\u8c61\u7684\u53d8\u91cf\u540d<br \/>\n    # pbar \u662f progress bar&#xff08;\u8fdb\u5ea6\u6761&#xff09;\u7684\u7f29\u5199&#xff0c;\u7ea6\u5b9a\u4fd7\u6210\u7684\u547d\u540d\u4e60\u60ef\u3002<br \/>\n    for i in range(10):  # \u5faa\u73af10\u6b21&#xff08;\u5bf9\u5e94\u8fdb\u5ea6\u6761\u768410\u6b65&#xff09;<br \/>\n        time.sleep(0.5)  # \u6a21\u62df\u6bcf\u6b21\u5faa\u73af\u8017\u65f60.5\u79d2<br \/>\n        pbar.update(1)  # \u6bcf\u6b21\u5faa\u73af\u540e&#xff0c;\u8fdb\u5ea6\u6761\u524d\u8fdb1\u6b65<br \/>\nfrom tqdm import tqdm<br \/>\nimport time<\/p>\n<p># \u521b\u5efa\u8fdb\u5ea6\u6761\u65f6\u6dfb\u52a0\u63cf\u8ff0&#xff08;desc&#xff09;\u548c\u5355\u4f4d&#xff08;unit&#xff09;<br \/>\nwith tqdm(total&#061;5, desc&#061;&#034;\u4e0b\u8f7d\u6587\u4ef6&#034;, unit&#061;&#034;\u4e2a&#034;) as pbar:<br \/>\n    # \u8fdb\u5ea6\u6761\u8fd9\u4e2a\u5bf9\u8c61&#xff0c;\u53ef\u4ee5\u8bbe\u7f6e\u63cf\u8ff0\u548c\u5355\u4f4d<br \/>\n    # desc\u662f\u63cf\u8ff0&#xff0c;\u5728\u5de6\u4fa7\u663e\u793a<br \/>\n    # unit\u662f\u5355\u4f4d&#xff0c;\u5728\u8fdb\u5ea6\u6761\u53f3\u4fa7\u663e\u793a<br \/>\n    for i in range(5):<br \/>\n        time.sleep(1)<br \/>\n        pbar.update(1)  # \u6bcf\u6b21\u5faa\u73af\u8fdb\u5ea6&#043;1<\/p>\n<p>unit \u53c2\u6570\u7684\u6838\u5fc3\u4f5c\u7528\u662f\u660e\u786e\u8fdb\u5ea6\u6761\u4e2d\u6bcf\u4e2a\u8fdb\u5ea6\u5355\u4f4d\u7684\u542b\u4e49&#xff0c;\u4f7f\u53ef\u89c6\u5316\u4fe1\u606f\u66f4\u5177\u53ef\u8bfb\u6027\u3002\u5728\u6df1\u5ea6\u5b66\u4e60\u8bad\u7ec3\u4e2d&#xff0c;\u5e38\u7528\u7684\u5355\u4f4d\u5305\u62ec&#xff1a;<\/p>\n<ul>\n<li>epoch&#xff1a;\u8bad\u7ec3\u8f6e\u6b21&#xff08;\u904d\u5386\u6574\u4e2a\u6570\u636e\u96c6\u4e00\u6b21&#xff09;\u3002<\/li>\n<li>batch&#xff1a;\u6279\u6b21&#xff08;\u6bcf\u6b21\u68af\u5ea6\u66f4\u65b0\u5904\u7406\u7684\u6837\u672c\u7ec4&#xff09;\u3002<\/li>\n<li>sample&#xff1a;\u6837\u672c&#xff08;\u5355\u4e2a\u6570\u636e\u70b9&#xff09;<\/li>\n<li>&#064;\u6d59\u5927\u758f\u9526\u884c<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb688\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u6a21\u578b\u53ef\u89c6\u5316\u4e0e\u63a8\u7406\u77e5\u8bc6\u70b9\u56de\u987e\uff1a\u4e09\u79cd\u4e0d\u540c\u7684\u6a21\u578b\u53ef\u89c6\u5316\u65b9\u6cd5\uff1a\u63a8\u8350torchinfo\u6253\u5370summary+\u6743\u91cd\u5206\u5e03\u53ef\u89c6\u5316\u8fdb\u5ea6\u6761\u529f\u80fd\uff1a\u624b\u52a8\u548c\u81ea\u52a8\u5199\u6cd5\uff0c\u8ba9\u6253\u5370\u7ed3\u679c\u66f4\u52a0\u7f8e\u89c2\u63a8\u7406\u7684\u5199\u6cd5\uff1a\u8bc4\u4f30\u6a21\u5f0f\u6a21\u578b\u7ed3\u6784\u53ef\u89c6\u5316\u7406\u89e3\u4e00\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u6700\u91cd\u8981\u76842\u70b9\uff1a1. \u4e86\u89e3\u635f\u5931\u5982\u4f55\u5b9a\u4e49\u7684\uff0c\u77e5\u9053\u635f\u5931\u4ece\u4f55\u800c\u6765&#8212;-\u628a\u62bd\u8c61\u7684\u4efb\u52a1\u901a\u8fc7\u635f\u5931\u51fd\u6570\u91cf\u5316\u51fa\u67652. \u4e86\u89e3\u53c2\u6570\u603b\u91cf\uff0c\u5373\u77e5\u9053\u6bcf\u4e00\u5c42\u7684\u8bbe\u8ba1&#8212;\u5c42\u8bbe\u8ba1\u51b3\u5b9a\u53c2\u6570\u603b\u91cf\u4e3a\u4e86\u4e86\u89e3\u53c2\u6570\u603b\u91cf\uff0c\u6211\u4eec\u9700\u8981\u77e5\u9053\u5c42\u8bbe\u8ba1\uff0c\u4ee5\u53ca\u6bcf\u4e00\u5c42\u53c2\u6570\u7684\u6570\u91cf\u3002<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[81,3714],"topic":[],"class_list":["post-40529","post","type-post","status-publish","format-standard","hentry","category-server","tag-python","tag-3714"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Day 35 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.wsisp.com\/helps\/40529.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Day 35 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb688\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u6a21\u578b\u53ef\u89c6\u5316\u4e0e\u63a8\u7406\u77e5\u8bc6\u70b9\u56de\u987e\uff1a\u4e09\u79cd\u4e0d\u540c\u7684\u6a21\u578b\u53ef\u89c6\u5316\u65b9\u6cd5\uff1a\u63a8\u8350torchinfo\u6253\u5370summary+\u6743\u91cd\u5206\u5e03\u53ef\u89c6\u5316\u8fdb\u5ea6\u6761\u529f\u80fd\uff1a\u624b\u52a8\u548c\u81ea\u52a8\u5199\u6cd5\uff0c\u8ba9\u6253\u5370\u7ed3\u679c\u66f4\u52a0\u7f8e\u89c2\u63a8\u7406\u7684\u5199\u6cd5\uff1a\u8bc4\u4f30\u6a21\u5f0f\u6a21\u578b\u7ed3\u6784\u53ef\u89c6\u5316\u7406\u89e3\u4e00\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u6700\u91cd\u8981\u76842\u70b9\uff1a1. \u4e86\u89e3\u635f\u5931\u5982\u4f55\u5b9a\u4e49\u7684\uff0c\u77e5\u9053\u635f\u5931\u4ece\u4f55\u800c\u6765----\u628a\u62bd\u8c61\u7684\u4efb\u52a1\u901a\u8fc7\u635f\u5931\u51fd\u6570\u91cf\u5316\u51fa\u67652. \u4e86\u89e3\u53c2\u6570\u603b\u91cf\uff0c\u5373\u77e5\u9053\u6bcf\u4e00\u5c42\u7684\u8bbe\u8ba1---\u5c42\u8bbe\u8ba1\u51b3\u5b9a\u53c2\u6570\u603b\u91cf\u4e3a\u4e86\u4e86\u89e3\u53c2\u6570\u603b\u91cf\uff0c\u6211\u4eec\u9700\u8981\u77e5\u9053\u5c42\u8bbe\u8ba1\uff0c\u4ee5\u53ca\u6bcf\u4e00\u5c42\u53c2\u6570\u7684\u6570\u91cf\u3002\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/40529.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2025-05-29T01:38:11+00:00\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40529.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/40529.html\",\"name\":\"Day 35 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2025-05-29T01:38:11+00:00\",\"dateModified\":\"2025-05-29T01:38:11+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/40529.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/40529.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/40529.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Day 35\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\",\"url\":\"https:\/\/www.wsisp.com\/helps\/\",\"name\":\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"description\":\"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-Hans\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"contentUrl\":\"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery\",\"caption\":\"admin\"},\"sameAs\":[\"http:\/\/wp.wsisp.com\"],\"url\":\"https:\/\/www.wsisp.com\/helps\/author\/admin\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Day 35 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.wsisp.com\/helps\/40529.html","og_locale":"zh_CN","og_type":"article","og_title":"Day 35 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u6587\u7ae0\u6d4f\u89c8\u9605\u8bfb688\u6b21\uff0c\u70b9\u8d5e17\u6b21\uff0c\u6536\u85cf14\u6b21\u3002\u6a21\u578b\u53ef\u89c6\u5316\u4e0e\u63a8\u7406\u77e5\u8bc6\u70b9\u56de\u987e\uff1a\u4e09\u79cd\u4e0d\u540c\u7684\u6a21\u578b\u53ef\u89c6\u5316\u65b9\u6cd5\uff1a\u63a8\u8350torchinfo\u6253\u5370summary+\u6743\u91cd\u5206\u5e03\u53ef\u89c6\u5316\u8fdb\u5ea6\u6761\u529f\u80fd\uff1a\u624b\u52a8\u548c\u81ea\u52a8\u5199\u6cd5\uff0c\u8ba9\u6253\u5370\u7ed3\u679c\u66f4\u52a0\u7f8e\u89c2\u63a8\u7406\u7684\u5199\u6cd5\uff1a\u8bc4\u4f30\u6a21\u5f0f\u6a21\u578b\u7ed3\u6784\u53ef\u89c6\u5316\u7406\u89e3\u4e00\u4e2a\u6df1\u5ea6\u5b66\u4e60\u7f51\u7edc\u6700\u91cd\u8981\u76842\u70b9\uff1a1. \u4e86\u89e3\u635f\u5931\u5982\u4f55\u5b9a\u4e49\u7684\uff0c\u77e5\u9053\u635f\u5931\u4ece\u4f55\u800c\u6765----\u628a\u62bd\u8c61\u7684\u4efb\u52a1\u901a\u8fc7\u635f\u5931\u51fd\u6570\u91cf\u5316\u51fa\u67652. \u4e86\u89e3\u53c2\u6570\u603b\u91cf\uff0c\u5373\u77e5\u9053\u6bcf\u4e00\u5c42\u7684\u8bbe\u8ba1---\u5c42\u8bbe\u8ba1\u51b3\u5b9a\u53c2\u6570\u603b\u91cf\u4e3a\u4e86\u4e86\u89e3\u53c2\u6570\u603b\u91cf\uff0c\u6211\u4eec\u9700\u8981\u77e5\u9053\u5c42\u8bbe\u8ba1\uff0c\u4ee5\u53ca\u6bcf\u4e00\u5c42\u53c2\u6570\u7684\u6570\u91cf\u3002","og_url":"https:\/\/www.wsisp.com\/helps\/40529.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2025-05-29T01:38:11+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"2 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/40529.html","url":"https:\/\/www.wsisp.com\/helps\/40529.html","name":"Day 35 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2025-05-29T01:38:11+00:00","dateModified":"2025-05-29T01:38:11+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/40529.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/40529.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/40529.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"Day 35"}]},{"@type":"WebSite","@id":"https:\/\/www.wsisp.com\/helps\/#website","url":"https:\/\/www.wsisp.com\/helps\/","name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","description":"\u9999\u6e2f\u670d\u52a1\u5668_\u9999\u6e2f\u4e91\u670d\u52a1\u5668\u8d44\u8baf_\u670d\u52a1\u5668\u5e2e\u52a9\u6587\u6863_\u670d\u52a1\u5668\u6559\u7a0b","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.wsisp.com\/helps\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-Hans"},{"@type":"Person","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41","name":"admin","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/image\/","url":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","contentUrl":"https:\/\/gravatar.wp-china-yes.net\/avatar\/?s=96&d=mystery","caption":"admin"},"sameAs":["http:\/\/wp.wsisp.com"],"url":"https:\/\/www.wsisp.com\/helps\/author\/admin"}]}},"_links":{"self":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40529","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/comments?post=40529"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/40529\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=40529"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=40529"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=40529"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=40529"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}