{"id":112714,"date":"2026-10-04T16:09:17","date_gmt":"2026-10-04T08:09:17","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/112714.html"},"modified":"2026-10-04T16:09:17","modified_gmt":"2026-10-04T08:09:17","slug":"%e3%80%90%e5%8c%bb%e5%ad%a6%e5%9b%be%e5%83%8f%e5%88%86%e5%89%b2%e6%a8%a1%e5%9d%97%e3%80%91starnet-%e6%98%9f%e6%93%8d%e4%bd%9c%ef%bc%88%e5%85%83%e7%b4%a0%e7%ba%a7%e4%b9%98%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/112714.html","title":{"rendered":"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757"},"content":{"rendered":"<h2>\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c&#xff08;\u5143\u7d20\u7ea7\u4e58\u6cd5&#xff09;\u2014\u2014 \u628a&#034;\u76f8\u52a0&#034;\u6362\u6210&#034;\u76f8\u4e58&#034;\u7684\u8f7b\u91cf\u5377\u79ef\u5757<\/h2>\n<h3>\u4e00\u3001\u8bba\u6587\u51fa\u5904<\/h3>\n<ul>\n<li>\u8bba\u6587\u5168\u540d&#xff1a;Rewrite the Stars&#xff08;arXiv \u7f16\u53f7 2403.19967&#xff09;<\/li>\n<li>\u4f1a\u8bae\/\u5e74\u4efd&#xff1a;CVPR 2024<\/li>\n<li>\u8bba\u6587\u94fe\u63a5&#xff1a;https:\/\/arxiv.org\/abs\/2403.19967<\/li>\n<li>\u5b98\u65b9\u4ee3\u7801&#xff1a;https:\/\/github.com\/ma-xu\/Rewrite-the-Stars<\/li>\n<\/ul>\n<h3>\u4e8c\u3001\u6a21\u5757\u56fe&#xff08;\u622a\u81ea\u8bba\u6587\u539f\u6587&#xff09;<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004080915-6ac209abbec5d.png\" alt=\"StarNet \u7ed3\u6784\u56fe\" \/><\/p>\n<p>\u56fe\u4e2d\u5c55\u793a\u7684\u662f Star Block \u7684\u57fa\u672c\u6784\u6210&#xff1a;\u8f93\u5165\u7ecf\u4e24\u6761\u5e76\u884c\u7684\u9010\u70b9\u5377\u79ef&#xff08;\u6216\u7ebf\u6027\u5c42&#xff09;\u5347\u7ef4\u540e&#xff0c;\u505a\u5143\u7d20\u7ea7\u76f8\u4e58&#xff08;star operation&#xff09;&#xff0c;\u518d\u7ecf\u4e00\u5c42\u6295\u5f71\u56de\u5230\u76ee\u6807\u901a\u9053\u6570&#xff0c;\u6574\u4f53\u662f\u4e00\u4e2a\u6b8b\u5dee\u7ed3\u6784\u3002<\/p>\n<h3>\u4e09\u3001\u6838\u5fc3\u601d\u60f3\u4e0e\u4f5c\u7528<\/h3>\n<p>\u4e00\u53e5\u8bdd\u603b\u62ec&#xff1a;StarNet \u7528\u300c\u5143\u7d20\u7ea7\u76f8\u4e58\u300d\u66ff\u4ee3\u4f20\u7edf\u5377\u79ef\/MLP \u91cc\u7684\u300c\u52a0\u6743\u6c42\u548c\u300d&#xff0c;\u5728\u4e0d\u52a0\u5bbd\u7f51\u7edc\u7684\u524d\u63d0\u4e0b&#xff0c;\u628a\u7279\u5f81\u9690\u5f0f\u5730\u6620\u5c04\u5230\u4e00\u4e2a\u9ad8\u7ef4\u975e\u7ebf\u6027\u7a7a\u95f4\u3002<\/p>\n<p>\u62c6\u89e3\u6765\u770b&#xff1a;<\/p>\n<li>\u4f20\u7edf\u5377\u79ef\u548c\u5168\u8fde\u63a5\u5c42\u672c\u8d28\u662f\u7ebf\u6027\u52a0\u6743\u6c42\u548c&#xff0c;\u975e\u7ebf\u6027\u53ea\u80fd\u9760\u6fc0\u6d3b\u51fd\u6570&#xff08;ReLU\/GELU&#xff09;\u5728\u901a\u9053\u7ef4\u5ea6\u4e0a\u9010\u70b9\u5f15\u5165&#xff0c;\u8868\u8fbe\u80fd\u529b\u53d7\u9650\u3002<\/li>\n<li>Star operation \u628a\u540c\u4e00\u8f93\u5165\u7ecf\u4e24\u6761\u5206\u652f\u53d8\u6362\u540e\u9010\u5143\u7d20\u76f8\u4e58\u3002\u4e58\u6cd5\u672c\u8eab\u662f\u4e8c\u6b21\u578b\u8fd0\u7b97&#xff0c;\u4e24\u4e2a\u5206\u652f\u7684\u6bcf\u4e2a\u901a\u9053\u4e24\u4e24\u7ec4\u5408&#xff0c;\u7b49\u4ef7\u4e8e\u5728\u9690\u5f0f\u7684\u9ad8\u7ef4\u7a7a\u95f4\u91cc\u751f\u6210\u4e86\u5927\u91cf\u4ea4\u53c9\u9879\u3002<\/li>\n<li>\u8fd9\u4e9b\u4ea4\u53c9\u9879\u4e0d\u9700\u8981\u663e\u5f0f\u5730\u628a\u901a\u9053\u6570\u6269\u5230\u90a3\u4e2a\u7ef4\u5ea6&#xff0c;\u5374\u8d77\u5230\u4e86\u7c7b\u4f3c\u6838\u6280\u5de7&#xff08;kernel trick&#xff09;\u7684\u6548\u679c\u2014\u2014\u7528\u4f4e\u7ef4\u8ba1\u7b97\u62ff\u5230\u9ad8\u7ef4\u975e\u7ebf\u6027\u8868\u8fbe\u3002<\/li>\n<li>\u518d\u53e0\u52a0\u4e00\u5c42\u7ebf\u6027\u6295\u5f71\u548c\u6b8b\u5dee\u8fde\u63a5&#xff0c;\u5c31\u6784\u6210\u4e86 Star Block&#xff1a;\u7ed3\u6784\u6781\u7b80&#xff0c;\u5374\u80fd\u5728\u7d27\u51d1\u9884\u7b97\u4e0b\u4fdd\u6301\u4f4e\u5ef6\u8fdf\u548c\u4e0d\u9519\u7684\u7cbe\u5ea6\u3002<\/li>\n<p>\u4e3a\u4ec0\u4e48\u597d&#xff1a;<\/p>\n<ul>\n<li>\u4e58\u6cd5\u5e26\u6765\u7684\u975e\u7ebf\u6027\u662f\u300c\u6570\u636e\u76f8\u5173\u300d\u7684&#xff0c;\u6bd4\u56fa\u5b9a\u6fc0\u6d3b\u51fd\u6570\u66f4\u7075\u6d3b\u3002<\/li>\n<li>\u6ca1\u6709\u663e\u5f0f\u5347\u7ef4&#xff0c;\u53c2\u6570\u91cf\u548c\u8ba1\u7b97\u91cf\u90fd\u538b\u5f97\u4f4f&#xff0c;\u9002\u5408\u79fb\u52a8\u7aef\u548c\u533b\u5b66\u5f71\u50cf\u8fd9\u7c7b\u5bf9\u5ef6\u8fdf\u654f\u611f\u7684\u573a\u666f\u3002<\/li>\n<li>\u7ed3\u6784\u89c4\u6574&#xff0c;\u51e0\u4e4e\u53ef\u4ee5\u65e0\u75db\u66ff\u6362\u73b0\u6709\u7f51\u7edc\u91cc\u7684 MLP \u6216\u90e8\u5206\u5377\u79ef\u5757\u3002<\/li>\n<\/ul>\n<h3>\u56db\u3001\u5728 U-Net \u91cc\u7684\u63d2\u5165\u4f4d\u7f6e<\/h3>\n<p>StarNet \u7684 Star Block \u672c\u8d28\u4e0a\u662f\u4e00\u4e2a\u300c\u8f7b\u91cf\u7279\u5f81\u53d8\u6362\u5757\u300d&#xff0c;\u9002\u5408\u653e\u5728\u9700\u8981\u975e\u7ebf\u6027\u8868\u8fbe\u3001\u4f46\u53c8\u4e0d\u60f3\u5927\u5e45\u589e\u52a0\u8ba1\u7b97\u91cf\u7684\u4f4d\u7f6e\u3002<\/p>\n<ul>\n<li>\u7f16\u7801\u5668\u6d45\u5c42&#xff1a;\u6d45\u5c42\u7279\u5f81\u901a\u9053\u5c11\u3001\u5206\u8fa8\u7387\u9ad8&#xff0c;\u76f4\u63a5\u5806\u5927\u5377\u79ef\u4ee3\u4ef7\u5927\u3002\u7528 Star Block \u66ff\u6362\u90e8\u5206 3\u00d73 \u5377\u79ef&#xff0c;\u80fd\u5728\u4f4e\u901a\u9053\u9884\u7b97\u4e0b\u8865\u8db3\u975e\u7ebf\u6027\u3002<\/li>\n<li>\u74f6\u9888\u5c42&#xff08;bottleneck&#xff09;&#xff1a;\u8fd9\u91cc\u901a\u9053\u6700\u591a\u3001\u5206\u8fa8\u7387\u6700\u4f4e&#xff0c;\u662f\u5168\u5c40\u8bed\u4e49\u6700\u96c6\u4e2d\u7684\u5730\u65b9\u3002Star Block \u7684\u9690\u5f0f\u9ad8\u7ef4\u7279\u6027\u5728\u8fd9\u91cc\u6536\u76ca\u6700\u660e\u663e&#xff0c;\u4e14\u8ba1\u7b97\u91cf\u53ef\u63a7\u3002<\/li>\n<li>\u89e3\u7801\u5668&#xff1a;\u89e3\u7801\u9636\u6bb5\u9700\u8981\u9010\u6b65\u6062\u590d\u7a7a\u95f4\u7ec6\u8282&#xff0c;Star Block \u53ef\u4ee5\u653e\u5728\u6bcf\u6b21\u4e0a\u91c7\u6837\u540e\u7684\u5377\u79ef\u5757\u91cc&#xff0c;\u4f5c\u4e3a\u975e\u7ebf\u6027\u589e\u5f3a&#xff0c;\u4f46\u4e0d\u5b9c\u5806\u592a\u591a&#xff0c;\u907f\u514d\u7834\u574f\u7ec6\u8282\u3002<\/li>\n<\/ul>\n<p>\u603b\u4f53\u5efa\u8bae&#xff1a;\u4f18\u5148\u653e\u5728\u74f6\u9888\u5c42\u548c\u7f16\u7801\u5668\u6df1\u5c42&#xff0c;\u6d45\u5c42\u548c\u89e3\u7801\u5668\u6309\u9700\u5c11\u91cf\u4f7f\u7528\u3002\u5b83\u4e0d\u6539\u53d8\u7279\u5f81\u56fe\u5c3a\u5bf8\u548c\u901a\u9053\u6570&#xff0c;\u5c5e\u4e8e\u5373\u63d2\u5373\u7528&#xff0c;\u66ff\u6362\u65f6\u4fdd\u6301\u8f93\u5165\u8f93\u51fa\u901a\u9053\u4e00\u81f4\u5373\u53ef\u3002<\/p>\n<h3>\u4e94\u3001\u590d\u73b0\u4ee3\u7801&#xff08;PyTorch&#xff0c;\u9010\u884c\u4e2d\u6587\u6ce8\u91ca&#xff09;<\/h3>\n<p>\u8bf4\u660e&#xff1a;\u4ee5\u4e0b\u662f\u7b80\u5316\u6559\u5b66\u7248&#xff0c;\u53ea\u4fdd\u7559 Star Block \u6700\u6838\u5fc3\u7684\u300c\u53cc\u5206\u652f\u9010\u5143\u7d20\u76f8\u4e58 &#043; \u6295\u5f71 &#043; \u6b8b\u5dee\u300d\u7ed3\u6784&#xff0c;\u7701\u7565\u4e86\u8bba\u6587\u91cc\u7684\u5206\u7ec4\u3001\u6df1\u5ea6\u53ef\u5206\u79bb\u7b49\u5de5\u7a0b\u4f18\u5316&#xff0c;\u4fbf\u4e8e\u7406\u89e3\u539f\u7406\u3002<\/p>\n<p><span class=\"token keyword\">import<\/span> torch<br \/>\n<span class=\"token keyword\">import<\/span> torch<span class=\"token punctuation\">.<\/span>nn <span class=\"token keyword\">as<\/span> nn<\/p>\n<p><span class=\"token keyword\">class<\/span> <span class=\"token class-name\">StarBlock<\/span><span class=\"token punctuation\">(<\/span>nn<span class=\"token punctuation\">.<\/span>Module<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n    <span class=\"token keyword\">def<\/span> <span class=\"token function\">__init__<\/span><span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">,<\/span> dim<span class=\"token punctuation\">,<\/span> hidden_dim<span class=\"token operator\">&#061;<\/span><span class=\"token boolean\">None<\/span><span class=\"token punctuation\">,<\/span> drop_path<span class=\"token operator\">&#061;<\/span><span class=\"token number\">0.0<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token builtin\">super<\/span><span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>__init__<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token comment\"># hidden_dim \u662f\u4e24\u6761\u5206\u652f\u7684\u4e2d\u95f4\u7ef4\u5ea6&#xff0c;\u9ed8\u8ba4\u53d6\u8f93\u5165\u7684 2 \u500d<\/span><br \/>\n        hidden_dim <span class=\"token operator\">&#061;<\/span> hidden_dim <span class=\"token keyword\">or<\/span> dim <span class=\"token operator\">*<\/span> <span class=\"token number\">2<\/span><\/p>\n<p>        <span class=\"token comment\"># \u5206\u652f 1&#xff1a;\u628a\u8f93\u5165\u4ece dim \u6620\u5c04\u5230 hidden_dim<\/span><br \/>\n        self<span class=\"token punctuation\">.<\/span>fc1 <span class=\"token operator\">&#061;<\/span> nn<span class=\"token punctuation\">.<\/span>Conv2d<span class=\"token punctuation\">(<\/span>dim<span class=\"token punctuation\">,<\/span> hidden_dim<span class=\"token punctuation\">,<\/span> kernel_size<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token comment\"># \u5206\u652f 2&#xff1a;\u540c\u6837\u6620\u5c04\u5230 hidden_dim&#xff0c;\u4f46\u53c2\u6570\u72ec\u7acb<\/span><br \/>\n        self<span class=\"token punctuation\">.<\/span>fc2 <span class=\"token operator\">&#061;<\/span> nn<span class=\"token punctuation\">.<\/span>Conv2d<span class=\"token punctuation\">(<\/span>dim<span class=\"token punctuation\">,<\/span> hidden_dim<span class=\"token punctuation\">,<\/span> kernel_size<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token comment\"># \u6fc0\u6d3b\u51fd\u6570&#xff0c;\u653e\u5728\u76f8\u4e58\u4e4b\u524d&#xff0c;\u7ed9\u4e58\u6cd5\u63d0\u4f9b\u975e\u7ebf\u6027\u57fa\u7840<\/span><br \/>\n        self<span class=\"token punctuation\">.<\/span>act <span class=\"token operator\">&#061;<\/span> nn<span class=\"token punctuation\">.<\/span>GELU<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        <span class=\"token comment\"># \u6295\u5f71\u5c42&#xff1a;\u628a\u76f8\u4e58\u540e\u7684 hidden_dim \u6620\u5c04\u56de dim<\/span><br \/>\n        self<span class=\"token punctuation\">.<\/span>fc3 <span class=\"token operator\">&#061;<\/span> nn<span class=\"token punctuation\">.<\/span>Conv2d<span class=\"token punctuation\">(<\/span>hidden_dim<span class=\"token punctuation\">,<\/span> dim<span class=\"token punctuation\">,<\/span> kernel_size<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u53ef\u9009\u7684\u968f\u673a\u6df1\u5ea6&#xff08;DropPath&#xff09;&#xff0c;\u8bad\u7ec3\u65f6\u968f\u673a\u4e22\u5f03\u6574\u4e2a\u6b8b\u5dee\u5206\u652f<\/span><br \/>\n        self<span class=\"token punctuation\">.<\/span>drop_path <span class=\"token operator\">&#061;<\/span> drop_path<\/p>\n<p>    <span class=\"token keyword\">def<\/span> <span class=\"token function\">forward<\/span><span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">,<\/span> x<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">:<\/span><br \/>\n        <span class=\"token comment\"># \u4fdd\u5b58\u8f93\u5165&#xff0c;\u7528\u4e8e\u6700\u540e\u7684\u6b8b\u5dee\u76f8\u52a0<\/span><br \/>\n        identity <span class=\"token operator\">&#061;<\/span> x<\/p>\n<p>        <span class=\"token comment\"># \u4e24\u6761\u5206\u652f\u5206\u522b\u505a\u7ebf\u6027\u53d8\u6362 &#043; \u6fc0\u6d3b<\/span><br \/>\n        x1 <span class=\"token operator\">&#061;<\/span> self<span class=\"token punctuation\">.<\/span>act<span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">.<\/span>fc1<span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><br \/>\n        x2 <span class=\"token operator\">&#061;<\/span> self<span class=\"token punctuation\">.<\/span>act<span class=\"token punctuation\">(<\/span>self<span class=\"token punctuation\">.<\/span>fc2<span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u6838\u5fc3&#xff1a;\u5143\u7d20\u7ea7\u76f8\u4e58&#xff08;star operation&#xff09;<\/span><br \/>\n        <span class=\"token comment\"># \u4e24\u4e2a hidden_dim \u7ef4\u7279\u5f81\u9010\u5143\u7d20\u76f8\u4e58&#xff0c;\u9690\u5f0f\u751f\u6210\u4ea4\u53c9\u9879<\/span><br \/>\n        out <span class=\"token operator\">&#061;<\/span> x1 <span class=\"token operator\">*<\/span> x2<\/p>\n<p>        <span class=\"token comment\"># \u6295\u5f71\u56de\u539f\u59cb\u901a\u9053\u6570<\/span><br \/>\n        out <span class=\"token operator\">&#061;<\/span> self<span class=\"token punctuation\">.<\/span>fc3<span class=\"token punctuation\">(<\/span>out<span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u8bad\u7ec3\u65f6\u6309\u6982\u7387\u4e22\u5f03\u6b8b\u5dee\u5206\u652f&#xff0c;\u63a8\u7406\u65f6\u76f4\u63a5\u76f8\u52a0<\/span><br \/>\n        <span class=\"token keyword\">if<\/span> self<span class=\"token punctuation\">.<\/span>training <span class=\"token keyword\">and<\/span> self<span class=\"token punctuation\">.<\/span>drop_path <span class=\"token operator\">&gt;<\/span> <span class=\"token number\">0<\/span><span class=\"token punctuation\">:<\/span><br \/>\n            keep <span class=\"token operator\">&#061;<\/span> torch<span class=\"token punctuation\">.<\/span>rand<span class=\"token punctuation\">(<\/span><span class=\"token number\">1<\/span><span class=\"token punctuation\">)<\/span><span class=\"token punctuation\">.<\/span>item<span class=\"token punctuation\">(<\/span><span class=\"token punctuation\">)<\/span> <span class=\"token operator\">&gt;<\/span> self<span class=\"token punctuation\">.<\/span>drop_path<br \/>\n            out <span class=\"token operator\">&#061;<\/span> out <span class=\"token keyword\">if<\/span> keep <span class=\"token keyword\">else<\/span> torch<span class=\"token punctuation\">.<\/span>zeros_like<span class=\"token punctuation\">(<\/span>out<span class=\"token punctuation\">)<\/span><\/p>\n<p>        <span class=\"token comment\"># \u6b8b\u5dee\u8fde\u63a5&#xff0c;\u4fdd\u8bc1\u68af\u5ea6\u987a\u7545<\/span><br \/>\n        <span class=\"token keyword\">return<\/span> identity <span class=\"token operator\">&#043;<\/span> out<\/p>\n<h3>\u516d\u3001\u63d2\u5165\u793a\u4f8b&#xff08;\u51e0\u884c\u585e\u8fdb\u4f60\u7684\u7f51\u7edc&#xff09;<\/h3>\n<p><span class=\"token comment\"># \u5047\u8bbe\u4f60\u6709\u4e00\u4e2a U-Net \u7684\u74f6\u9888\u5c42\u7279\u5f81 x&#xff0c;\u901a\u9053\u6570\u4e3a 512<\/span><br \/>\nx <span class=\"token operator\">&#061;<\/span> torch<span class=\"token punctuation\">.<\/span>randn<span class=\"token punctuation\">(<\/span><span class=\"token number\">2<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">512<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">,<\/span> <span class=\"token number\">16<\/span><span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># (batch, channel, H, W)<\/span><\/p>\n<p><span class=\"token comment\"># \u76f4\u63a5\u5b9e\u4f8b\u5316 StarBlock&#xff0c;\u8f93\u5165\u8f93\u51fa\u901a\u9053\u4fdd\u6301\u4e00\u81f4<\/span><br \/>\nstar <span class=\"token operator\">&#061;<\/span> StarBlock<span class=\"token punctuation\">(<\/span>dim<span class=\"token operator\">&#061;<\/span><span class=\"token number\">512<\/span><span class=\"token punctuation\">,<\/span> hidden_dim<span class=\"token operator\">&#061;<\/span><span class=\"token number\">1024<\/span><span class=\"token punctuation\">)<\/span><\/p>\n<p><span class=\"token comment\"># \u524d\u5411&#xff0c;\u7279\u5f81\u56fe\u5c3a\u5bf8\u548c\u901a\u9053\u6570\u90fd\u4e0d\u53d8&#xff0c;\u53ef\u65e0\u7f1d\u66ff\u6362\u539f\u6709\u5377\u79ef\u5757<\/span><br \/>\ny <span class=\"token operator\">&#061;<\/span> star<span class=\"token punctuation\">(<\/span>x<span class=\"token punctuation\">)<\/span><br \/>\n<span class=\"token keyword\">print<\/span><span class=\"token punctuation\">(<\/span>y<span class=\"token punctuation\">.<\/span>shape<span class=\"token punctuation\">)<\/span>  <span class=\"token comment\"># torch.Size([2, 512, 16, 16])<\/span><\/p>\n<h3>\u4e03\u3001\u5b9e\u6d4b\u7ecf\u9a8c\u4e0e\u6ce8\u610f\u70b9<\/h3>\n<ul>\n<li>\u8ba1\u7b97\u91cf&#xff1a;Star Block \u7684\u4e3b\u8981\u5f00\u9500\u5728\u4e24\u6761 1\u00d71 \u5377\u79ef\u548c\u4e00\u6b21\u6295\u5f71&#xff0c;hidden_dim \u901a\u5e38\u53d6 2~4 \u500d dim\u3002hidden_dim \u8d8a\u5927&#xff0c;\u9690\u5f0f\u9ad8\u7ef4\u7a7a\u95f4\u8d8a\u5bbd&#xff0c;\u4f46\u663e\u5b58\u548c\u5ef6\u8fdf\u540c\u6b65\u4e0a\u5347&#xff0c;\u533b\u5b66\u5f71\u50cf 3D \u6570\u636e\u8981\u8c28\u614e\u3002<\/li>\n<li>\u8d85\u53c2&#xff1a;hidden_dim \u662f\u6838\u5fc3\u8d85\u53c2&#xff0c;\u5efa\u8bae\u4ece 2 \u500d\u8d77\u6b65&#xff1b;drop_path \u5728\u6df1\u5c42\u53ef\u4ee5\u8bbe 0.1 \u5de6\u53f3&#xff0c;\u6d45\u5c42\u4fdd\u6301 0\u3002<\/li>\n<li>\u8e29\u5751&#xff1a;\u5143\u7d20\u7ea7\u76f8\u4e58\u5bf9\u8f93\u5165\u5c3a\u5ea6\u654f\u611f&#xff0c;\u5982\u679c\u524d\u9762\u6ca1\u6709\u5f52\u4e00\u5316&#xff08;BN\/LN&#xff09;&#xff0c;\u4e24\u6761\u5206\u652f\u7684\u6570\u503c\u8303\u56f4\u5dee\u5f02\u5927&#xff0c;\u5bb9\u6613\u68af\u5ea6\u4e0d\u7a33&#xff0c;\u5efa\u8bae\u5728 Star Block \u524d\u63a5\u5f52\u4e00\u5316\u3002<\/li>\n<li>\u66ff\u6362\u7b56\u7565&#xff1a;\u4e0d\u8981\u4e00\u6b21\u6027\u66ff\u6362\u6240\u6709\u5377\u79ef&#xff0c;\u5148\u66ff\u6362\u74f6\u9888\u5c42&#xff0c;\u89c2\u5bdf\u6536\u655b\u548c\u663e\u5b58&#xff0c;\u518d\u9010\u6b65\u5411\u7f16\u7801\u5668\u6269\u5c55\u3002<\/li>\n<li>\u4e0e\u6fc0\u6d3b\u7684\u5173\u7cfb&#xff1a;\u4e58\u6cd5\u672c\u8eab\u5df2\u63d0\u4f9b\u975e\u7ebf\u6027&#xff0c;\u6fc0\u6d3b\u51fd\u6570\u653e\u5728\u76f8\u4e58\u4e4b\u524d\u5373\u53ef&#xff0c;\u76f8\u4e58\u4e4b\u540e\u518d\u63a5\u6fc0\u6d3b\u6536\u76ca\u6709\u9650&#xff0c;\u53cd\u800c\u589e\u52a0\u5f00\u9500\u3002<\/li>\n<li>\u533b\u5b66\u5f71\u50cf\u6ce8\u610f&#xff1a;\u5c0f\u6570\u636e\u96c6\u4e0a Star Block \u7684\u9690\u5f0f\u9ad8\u7ef4\u8868\u8fbe\u53ef\u80fd\u8fc7\u62df\u5408&#xff0c;\u914d\u5408\u6570\u636e\u589e\u5f3a\u548c\u9002\u5ea6\u6b63\u5219\u66f4\u7a33\u3002<\/li>\n<\/ul>\n<h3>\u516b\u3001\u5b8c\u6574\u5de5\u7a0b<\/h3>\n<p>\u672c\u6587\u4ee3\u7801\u5df2\u6574\u7406\u8fdb\u5373\u63d2\u5373\u7528\u6a21\u5757\u4ed3\u5e93&#xff1a;https:\/\/github.com\/CaiCy6\/med-modules &#xff0c;\u53ef\u76f4\u63a5 clone \u540e\u66ff\u6362\u8fdb\u4f60\u7684 U-Net\u3002<\/p>\n<p>\u4e0b\u4e00\u7bc7\u9884\u544a&#xff1a;\u6211\u4eec\u5c06\u62c6\u89e3\u53e6\u4e00\u4e2a CVPR 2024 \u7684\u5373\u63d2\u5373\u7528\u6a21\u5757&#xff0c;\u804a\u804a\u5b83\u5982\u4f55\u5728\u89e3\u7801\u5668\u91cc\u505a\u8f7b\u91cf\u6ce8\u610f\u529b&#xff0c;\u656c\u8bf7\u5173\u6ce8\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c&#xff08;\u5143\u7d20\u7ea7\u4e58\u6cd5&#xff09;\u2014\u2014 \u628a\\&#8221;\u76f8\u52a0\\&#8221;\u6362\u6210\\&#8221;\u76f8\u4e58\\&#8221;\u7684\u8f7b\u91cf\u5377\u79ef\u5757<br \/>\n\u4e00\u3001\u8bba\u6587\u51fa\u5904<br \/>\n\u8bba\u6587\u5168\u540d&#xff1a;Rewrite the Stars&#xff08;arXiv \u7f16\u53f7 2403.19967&#xff09;\u4f1a\u8bae\/\u5e74\u4efd&#xff1a;CVPR 2024\u8bba\u6587\u94fe\u63a5&#xff1a;https:\/\/arxiv.org\/abs\/2403.19967\u5b98\u65b9\u4ee3\u7801&#xff1a;https:\/\/github.com\/ma-xu\/<\/p>\n","protected":false},"author":2,"featured_media":112713,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[50,86,523],"topic":[],"class_list":["post-112714","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-server","tag-50","tag-86","tag-523"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757 - \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\/112714.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c&#xff08;\u5143\u7d20\u7ea7\u4e58\u6cd5&#xff09;\u2014\u2014 \u628a&quot;\u76f8\u52a0&quot;\u6362\u6210&quot;\u76f8\u4e58&quot;\u7684\u8f7b\u91cf\u5377\u79ef\u5757 \u4e00\u3001\u8bba\u6587\u51fa\u5904 \u8bba\u6587\u5168\u540d&#xff1a;Rewrite the Stars&#xff08;arXiv \u7f16\u53f7 2403.19967&#xff09;\u4f1a\u8bae\/\u5e74\u4efd&#xff1a;CVPR 2024\u8bba\u6587\u94fe\u63a5&#xff1a;https:\/\/arxiv.org\/abs\/2403.19967\u5b98\u65b9\u4ee3\u7801&#xff1a;https:\/\/github.com\/ma-xu\/\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/112714.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-10-04T08:09:17+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004080915-6ac209abbec5d.png\" \/>\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\/112714.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/112714.html\",\"name\":\"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-10-04T08:09:17+00:00\",\"dateModified\":\"2026-10-04T08:09:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/112714.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/112714.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/112714.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757\"}]},{\"@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":"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757 - \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\/112714.html","og_locale":"zh_CN","og_type":"article","og_title":"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c&#xff08;\u5143\u7d20\u7ea7\u4e58\u6cd5&#xff09;\u2014\u2014 \u628a\"\u76f8\u52a0\"\u6362\u6210\"\u76f8\u4e58\"\u7684\u8f7b\u91cf\u5377\u79ef\u5757 \u4e00\u3001\u8bba\u6587\u51fa\u5904 \u8bba\u6587\u5168\u540d&#xff1a;Rewrite the Stars&#xff08;arXiv \u7f16\u53f7 2403.19967&#xff09;\u4f1a\u8bae\/\u5e74\u4efd&#xff1a;CVPR 2024\u8bba\u6587\u94fe\u63a5&#xff1a;https:\/\/arxiv.org\/abs\/2403.19967\u5b98\u65b9\u4ee3\u7801&#xff1a;https:\/\/github.com\/ma-xu\/","og_url":"https:\/\/www.wsisp.com\/helps\/112714.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-10-04T08:09:17+00:00","og_image":[{"url":"https:\/\/www.wsisp.com\/helps\/wp-content\/uploads\/2026\/10\/20261004080915-6ac209abbec5d.png"}],"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\/112714.html","url":"https:\/\/www.wsisp.com\/helps\/112714.html","name":"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-10-04T08:09:17+00:00","dateModified":"2026-10-04T08:09:17+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/112714.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/112714.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/112714.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u3010\u533b\u5b66\u56fe\u50cf\u5206\u5272\u6a21\u5757\u3011StarNet \u2014\u2014 \u661f\u64cd\u4f5c\uff08\u5143\u7d20\u7ea7\u4e58\u6cd5\uff09\u2014\u2014 \u628a\u201c\u76f8\u52a0\u201c\u6362\u6210\u201c\u76f8\u4e58\u201c\u7684\u8f7b\u91cf\u5377\u79ef\u5757"}]},{"@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\/112714","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=112714"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/112714\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media\/112713"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=112714"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=112714"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=112714"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=112714"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}