{"id":86118,"date":"2026-07-28T05:40:34","date_gmt":"2026-07-27T21:40:34","guid":{"rendered":"https:\/\/www.wsisp.com\/helps\/86118.html"},"modified":"2026-07-28T05:40:34","modified_gmt":"2026-07-27T21:40:34","slug":"%e9%87%91%e8%9e%8d%e6%97%b6%e5%ba%8f%e6%95%b0%e6%8d%ae%e8%ae%ad%e7%bb%83%ef%bc%9a%e9%95%bf%e5%ba%8f%e5%88%97%e5%bb%ba%e6%a8%a1%e7%9a%84%e8%ae%ad%e7%bb%83%e7%a8%b3%e5%ae%9a%e6%80%a7%e9%97%ae%e9%a2%98","status":"publish","type":"post","link":"https:\/\/www.wsisp.com\/helps\/86118.html","title":{"rendered":"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898"},"content":{"rendered":"<h2>\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3&#xff1a;\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898<\/h2>\n<h3>\u4e00\u3001\u4e2a\u6027\u5316\u6df1\u5ea6\u5f15\u8a00<\/h3>\n<p>\u5f53\u4f60\u5728\u8bad\u7ec3\u4e00\u4e2a LSTM \u9884\u6d4b\u80a1\u7968\u4ef7\u683c\u65f6&#xff0c;\u7a81\u7136\u53d1\u73b0 loss \u5728\u7b2c 347 \u4e2a epoch \u7206\u70b8\u6210 NaN\u2014\u2014\u8fd9\u4e0d\u662f bug&#xff0c;\u8fd9\u662f\u91d1\u878d\u65f6\u5e8f\u5efa\u6a21\u7684\u65e5\u5e38\u3002<\/p>\n<p>\u91d1\u878d\u65f6\u95f4\u5e8f\u5217\u6709\u4e24\u4e2a\u8ba9\u6a21\u578b\u5934\u75bc\u7684\u7279\u6027&#xff1a;\u4e00\u662f\u957f\u7a0b\u4f9d\u8d56&#xff08;3 \u5e74\u524d\u7684\u4e8b\u4ef6\u53ef\u80fd\u5f71\u54cd\u4eca\u5929\u7684\u8d70\u52bf&#xff09;&#xff0c;\u4e8c\u662f\u5206\u5e03\u6f02\u79fb&#xff08;\u5e02\u573a\u7684\u7edf\u8ba1\u7279\u6027\u968f\u65f6\u95f4\u6539\u53d8&#xff09;\u3002\u8fd9\u4e24\u4e2a\u7279\u6027\u53e0\u52a0\u8d77\u6765&#xff0c;\u8ba9\u8bad\u7ec3\u7a33\u5b9a\u6027\u6210\u4e3a\u91d1\u878d\u65f6\u5e8f\u6a21\u578b\u7684\u7b2c\u4e00\u9053\u95e8\u69db\u3002\u89c1\u8bc1\u5947\u8ff9\u7684\u65f6\u523b\u5728\u4e8e&#xff1a;\u5f53\u6211\u4eec\u5728\u635f\u5931\u51fd\u6570\u4e2d\u5f15\u5165\u201c\u5bf9\u7a81\u53d8\u70b9\u7684\u60e9\u7f5a\u9879\u201d\u540e&#xff0c;\u90a3\u4e2a\u5728 347 \u4e2a epoch \u5c31\u5d29\u6389\u7684\u6a21\u578b&#xff0c;\u7a33\u5b9a\u8dd1\u4e86 2000 \u4e2a epoch\u3002<\/p>\n<h3>\u4e8c\u3001\u4e2a\u6027\u5316\u539f\u7406\u5256\u6790<\/h3>\n<h4>\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u4e09\u5927\u4e0d\u7a33\u5b9a\u6e90<\/h4>\n<h4>\u7a33\u5b9a\u6027\u5206\u6790<\/h4>\n<h5>1. \u68af\u5ea6\u95ee\u9898<\/h5>\n<p>\u4f20\u7edf RNN \u5728\u53cd\u5411\u4f20\u64ad\u65f6&#xff0c;\u68af\u5ea6\u4f1a\u7ecf\u5386\u8fde\u4e58\u64cd\u4f5c\u3002\u5bf9\u4e8e\u957f\u5e8f\u5217&#xff0c;\u8fd9\u4e2a\u4e58\u79ef\u8981\u4e48\u8d8b\u8fd1\u4e8e 0&#xff08;\u68af\u5ea6\u6d88\u5931&#xff09;&#xff0c;\u8981\u4e48\u8d8b\u8fd1\u65e0\u7a77&#xff08;\u68af\u5ea6\u7206\u70b8&#xff09;\u3002<\/p>\n<p>LSTM \u901a\u8fc7\u95e8\u63a7\u673a\u5236\u7f13\u89e3\u4e86\u8fd9\u4e2a\u95ee\u9898&#xff0c;\u4f46\u5e76\u6ca1\u6709\u5f7b\u5e95\u89e3\u51b3\u3002\u5f53\u5e8f\u5217\u957f\u5ea6\u8d85\u8fc7 1000 \u6b65\u65f6&#xff0c;\u5373\u4f7f\u662f LSTM \u4e5f\u4f1a\u51fa\u73b0\u68af\u5ea6\u95ee\u9898\u3002<\/p>\n<h5>2. \u5206\u5e03\u6f02\u79fb<\/h5>\n<p>\u91d1\u878d\u6570\u636e\u7684\u5206\u5e03\u4e0d\u662f\u56fa\u5b9a\u7684\u3002\u5e02\u573a\u7684\u6ce2\u52a8\u7387\u3001\u76f8\u5173\u6027\u3001\u8d8b\u52bf\u7279\u5f81\u90fd\u4f1a\u968f\u65f6\u95f4\u53d8\u5316\u3002\u7528 2020 \u5e74\u7684\u6570\u636e\u8bad\u7ec3\u7684\u6a21\u578b&#xff0c;\u653e\u5230 2022 \u5e74\u5c31\u4f1a\u5931\u6548\u2014\u2014\u56e0\u4e3a\u5e02\u573a\u57fa\u672c\u9762\u5df2\u7ecf\u5b8c\u5168\u6539\u53d8\u3002<\/p>\n<p>\u8fd9\u79cd\u201c\u975e\u5e73\u7a33\u6027\u201d\u662f\u91d1\u878d\u65f6\u5e8f\u5efa\u6a21\u7279\u6709\u7684\u6311\u6218\u3002\u5176\u4ed6\u9886\u57df\u7684\u65f6\u5e8f\u6570\u636e&#xff08;\u5982\u5929\u6c14\u3001\u7535\u529b\u8d1f\u8377&#xff09;\u867d\u7136\u4e5f\u6709\u5b63\u8282\u6027\u53d8\u5316&#xff0c;\u4f46\u5e95\u5c42\u7269\u7406\u89c4\u5f8b\u4e0d\u53d8\u3002\u91d1\u878d\u6ca1\u6709\u4e0d\u53d8\u7684\u7269\u7406\u89c4\u5f8b\u3002<\/p>\n<h5>3. \u5f02\u5e38\u503c\u51b2\u51fb<\/h5>\n<p>2020 \u5e74 3 \u6708\u7684\u7f8e\u80a1\u7194\u65ad\u30012015 \u5e74 A \u80a1\u5f02\u5e38\u6ce2\u52a8\u2014\u2014\u8fd9\u4e9b\u6781\u7aef\u4e8b\u4ef6\u4f1a\u5728\u8bad\u7ec3\u6570\u636e\u4e2d\u4ea7\u751f\u5de8\u5927\u7684\u5f02\u5e38\u503c\u3002\u5982\u679c\u7528 MSE \u635f\u5931&#xff0c;\u8fd9\u4e9b\u5f02\u5e38\u503c\u4f1a\u4e3b\u5bfc\u68af\u5ea6\u66f4\u65b0\u65b9\u5411&#xff0c;\u5bfc\u81f4\u6a21\u578b\u53c2\u6570\u5411\u9519\u8bef\u65b9\u5411\u5927\u5e45\u8df3\u52a8\u3002<\/p>\n<h3>\u4e09\u3001\u4e2a\u6027\u5316\u4ee3\u7801\u5b9e\u8df5<\/h3>\n<p>import torch<br \/>\nimport torch.nn as nn<br \/>\nimport numpy as np<br \/>\nfrom typing import Tuple<\/p>\n<p>class StableFinancialLSTM(nn.Module):<br \/>\n    &#034;&#034;&#034;\u91d1\u878d\u65f6\u5e8f\u7a33\u5b9a\u8bad\u7ec3 LSTM&#034;&#034;&#034;<\/p>\n<p>    def __init__(<br \/>\n        self,<br \/>\n        input_dim: int,<br \/>\n        hidden_dim: int &#061; 128,<br \/>\n        num_layers: int &#061; 2,<br \/>\n        dropout: float &#061; 0.3,<br \/>\n    ):<br \/>\n        super().__init__()<br \/>\n        # \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u591a\u5c42 LSTM \u6355\u6349\u4e0d\u540c\u65f6\u95f4\u5c3a\u5ea6\u7684\u6a21\u5f0f<br \/>\n        # \u7b2c\u4e00\u5c42&#xff1a;\u77ed\u671f\u6ce2\u52a8&#xff08;\u65e5\u7ea7\u522b&#xff09;<br \/>\n        # \u7b2c\u4e8c\u5c42&#xff1a;\u4e2d\u671f\u8d8b\u52bf&#xff08;\u5468\/\u6708\u7ea7\u522b&#xff09;<br \/>\n        self.lstm &#061; nn.LSTM(<br \/>\n            input_dim,<br \/>\n            hidden_dim,<br \/>\n            num_layers,<br \/>\n            batch_first&#061;True,<br \/>\n            dropout&#061;dropout,<br \/>\n        )<br \/>\n        # \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u68af\u5ea6\u88c1\u526a &#043; \u6279\u5f52\u4e00\u5316\u5728 LSTM \u5916\u90e8<br \/>\n        self.batch_norm &#061; nn.BatchNorm1d(hidden_dim)<br \/>\n        self.fc &#061; nn.Linear(hidden_dim, 1)<br \/>\n        self.dropout &#061; nn.Dropout(dropout)<\/p>\n<p>    def forward(self, x: torch.Tensor) -&gt; torch.Tensor:<br \/>\n        &#034;&#034;&#034;<br \/>\n        x: (batch, seq_len, input_dim)<br \/>\n        &#034;&#034;&#034;<br \/>\n        # LSTM \u524d\u5411\u4f20\u64ad<br \/>\n        lstm_out, (h_n, c_n) &#061; self.lstm(x)<\/p>\n<p>        # \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u53d6\u6700\u540e\u65f6\u523b\u7684\u9690\u72b6\u6001<br \/>\n        last_out &#061; lstm_out[:, -1, :]<\/p>\n<p>        # \u6279\u5f52\u4e00\u5316\u7a33\u5b9a\u5206\u5e03<br \/>\n        last_out &#061; self.batch_norm(last_out.unsqueeze(0)).squeeze(0)<\/p>\n<p>        # Dropout \u6b63\u5219\u5316<br \/>\n        last_out &#061; self.dropout(last_out)<\/p>\n<p>        # \u8f93\u51fa\u5c42<br \/>\n        out &#061; self.fc(last_out)<br \/>\n        return out<\/p>\n<p>class StableTrainingConfig:<br \/>\n    &#034;&#034;&#034;\u7a33\u5b9a\u8bad\u7ec3\u914d\u7f6e&#034;&#034;&#034;<\/p>\n<p>    def __init__(self):<br \/>\n        # \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u6bcf\u4e2a\u53c2\u6570\u90fd\u6709\u660e\u786e\u7684\u7a33\u5b9a\u5316\u76ee\u7684<br \/>\n        self.grad_clip_value &#061; 1.0  # \u68af\u5ea6\u88c1\u526a\u9608\u503c<br \/>\n        self.use_huber_loss &#061; True   # \u662f\u5426\u4f7f\u7528 Huber Loss<br \/>\n        self.huber_delta &#061; 1.0       # Huber Loss \u7684 \u03b4 \u53c2\u6570<br \/>\n        self.use_grad_norm &#061; True    # \u662f\u5426\u4f7f\u7528\u68af\u5ea6\u8303\u6570\u88c1\u526a<br \/>\n        self.max_grad_norm &#061; 5.0     # \u6700\u5927\u68af\u5ea6\u8303\u6570<\/p>\n<p>    &#064;staticmethod<br \/>\n    def huber_loss(y_pred: torch.Tensor, y_true: torch.Tensor, delta: float &#061; 1.0) -&gt; torch.Tensor:<br \/>\n        &#034;&#034;&#034;<br \/>\n        Huber \u635f\u5931\u51fd\u6570&#xff1a;\u5bf9\u5f02\u5e38\u503c\u9c81\u68d2<\/p>\n<p>        \u8bbe\u8ba1\u539f\u56e0&#xff1a;MSE \u5bf9\u5f02\u5e38\u503c\u8fc7\u4e8e\u654f\u611f<br \/>\n        Huber Loss \u5728 |error| &lt; delta \u65f6\u7528 MSE&#xff0c;\u5728 |error| &gt; delta \u65f6\u7528 MAE<br \/>\n        &#034;&#034;&#034;<br \/>\n        error &#061; y_pred &#8211; y_true<br \/>\n        abs_error &#061; torch.abs(error)<\/p>\n<p>        # \u5c0f\u8bef\u5dee\u7528 MSE&#xff08;\u5e73\u6ed1&#xff09;&#xff0c;\u5927\u8bef\u5dee\u7528 MAE&#xff08;\u9c81\u68d2&#xff09;<br \/>\n        quadratic &#061; 0.5 * error ** 2<br \/>\n        linear &#061; delta * (abs_error &#8211; 0.5 * delta)<\/p>\n<p>        loss &#061; torch.where(abs_error &lt;&#061; delta, quadratic, linear)<br \/>\n        return loss.mean()<\/p>\n<p>    &#064;staticmethod<br \/>\n    def quantile_loss(<br \/>\n        y_pred: torch.Tensor,<br \/>\n        y_true: torch.Tensor,<br \/>\n        quantile: float &#061; 0.5,<br \/>\n    ) -&gt; torch.Tensor:<br \/>\n        &#034;&#034;&#034;<br \/>\n        \u5206\u4f4d\u6570\u635f\u5931&#xff1a;\u9002\u5408\u9884\u6d4b\u533a\u95f4<\/p>\n<p>        \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u91d1\u878d\u573a\u666f\u4e0d\u4ec5\u9700\u8981\u70b9\u9884\u6d4b&#xff0c;\u66f4\u9700\u8981\u9884\u6d4b\u533a\u95f4<br \/>\n        \u5206\u4f4d\u6570\u635f\u5931\u53ef\u4ee5\u76f4\u63a5\u8f93\u51fa\u7f6e\u4fe1\u533a\u95f4<br \/>\n        &#034;&#034;&#034;<br \/>\n        error &#061; y_true &#8211; y_pred<br \/>\n        loss &#061; torch.max(<br \/>\n            quantile * error,<br \/>\n            (quantile &#8211; 1) * error,<br \/>\n        )<br \/>\n        return loss.mean()<\/p>\n<p>    &#064;staticmethod<br \/>\n    def detect_distribution_shift(<br \/>\n        old_data: np.ndarray,<br \/>\n        new_data: np.ndarray,<br \/>\n        threshold: float &#061; 0.05,<br \/>\n    ) -&gt; bool:<br \/>\n        &#034;&#034;&#034;<br \/>\n        \u5206\u5e03\u6f02\u79fb\u68c0\u6d4b<\/p>\n<p>        \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u7528 KL \u6563\u5ea6\u68c0\u6d4b\u8bad\u7ec3\u6570\u636e\u548c\u5f53\u524d\u6570\u636e\u7684\u5206\u5e03\u5dee\u5f02<br \/>\n        \u5982\u679c\u6f02\u79fb\u8d85\u8fc7\u9608\u503c&#xff0c;\u89e6\u53d1\u91cd\u65b0\u8bad\u7ec3<br \/>\n        &#034;&#034;&#034;<br \/>\n        # \u7b80\u5316\u5b9e\u73b0&#xff1a;\u6bd4\u8f83\u5747\u503c\u548c\u6807\u51c6\u5dee\u7684\u76f8\u5bf9\u53d8\u5316<br \/>\n        old_mean, old_std &#061; old_data.mean(), old_data.std()<br \/>\n        new_mean, new_std &#061; new_data.mean(), new_data.std()<\/p>\n<p>        mean_shift &#061; abs(new_mean &#8211; old_mean) \/ max(abs(old_mean), 1e-8)<br \/>\n        std_shift &#061; abs(new_std &#8211; old_std) \/ max(old_std, 1e-8)<\/p>\n<p>        return mean_shift &gt; threshold or std_shift &gt; threshold<\/p>\n<p># \u8bad\u7ec3\u5faa\u73af\u793a\u4f8b<br \/>\ndef train_stable_epoch(<br \/>\n    model: StableFinancialLSTM,<br \/>\n    dataloader: torch.utils.data.DataLoader,<br \/>\n    optimizer: torch.optim.Optimizer,<br \/>\n    config: StableTrainingConfig,<br \/>\n) -&gt; float:<br \/>\n    &#034;&#034;&#034;\u4e00\u4e2a\u7a33\u5b9a\u8bad\u7ec3 epoch&#034;&#034;&#034;<br \/>\n    model.train()<br \/>\n    total_loss &#061; 0.0<\/p>\n<p>    for batch_x, batch_y in dataloader:<br \/>\n        optimizer.zero_grad()<\/p>\n<p>        # \u524d\u5411\u4f20\u64ad<br \/>\n        y_pred &#061; model(batch_x)<\/p>\n<p>        # \u8ba1\u7b97\u635f\u5931&#xff08;Huber Loss \u5bf9\u5f02\u5e38\u503c\u9c81\u68d2&#xff09;<br \/>\n        loss &#061; config.huber_loss(<br \/>\n            y_pred.squeeze(), batch_y, delta&#061;config.huber_delta<br \/>\n        )<\/p>\n<p>        # \u53cd\u5411\u4f20\u64ad<br \/>\n        loss.backward()<\/p>\n<p>        # \u8bbe\u8ba1\u539f\u56e0&#xff1a;\u68af\u5ea6\u88c1\u526a\u662f\u9632\u6b62\u68af\u5ea6\u7206\u70b8\u7684\u6700\u6709\u6548\u624b\u6bb5<br \/>\n        if config.use_grad_norm:<br \/>\n            torch.nn.utils.clip_grad_norm_(<br \/>\n                model.parameters(), config.max_grad_norm<br \/>\n            )<br \/>\n        else:<br \/>\n            torch.nn.utils.clip_grad_value_(<br \/>\n                model.parameters(), config.grad_clip_value<br \/>\n            )<\/p>\n<p>        optimizer.step()<br \/>\n        total_loss &#043;&#061; loss.item()<\/p>\n<p>    return total_loss \/ len(dataloader)<\/p>\n<h3>\u56db\u3001\u4e2a\u6027\u5316\u8fb9\u754c\u6743\u8861<\/h3>\n<table>\n<tr>\u7a33\u5b9a\u7b56\u7565\u8bad\u7ec3\u901f\u5ea6\u6536\u655b\u901f\u5ea6\u5bf9\u5f02\u5e38\u503c\u9c81\u68d2\u6027\u4ee3\u4ef7<\/tr>\n<tbody>\n<tr>\n<td align=\"left\">\u65e0\u5904\u7406<\/td>\n<td align=\"center\">\u5feb<\/td>\n<td align=\"center\">\u5feb&#xff08;\u4f46\u53ef\u80fd\u5d29\u6e83&#xff09;<\/td>\n<td align=\"center\">\u6781\u5dee<\/td>\n<td align=\"left\">\u8bad\u7ec3\u4e0d\u7a33\u5b9a<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u4ec5\u68af\u5ea6\u88c1\u526a<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u5dee<\/td>\n<td align=\"left\">\u53ef\u80fd\u9519\u8fc7\u91cd\u8981\u4fe1\u53f7<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Huber Loss<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u597d<\/td>\n<td align=\"left\">\u8d85\u53c2\u6570 \u03b4 \u9700\u8981\u8c03\u4f18<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u68af\u5ea6\u88c1\u526a &#043; Huber<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u597d<\/td>\n<td align=\"left\">\u4e24\u4e2a\u8d85\u53c2\u6570<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">Quantile Loss<\/td>\n<td align=\"center\">\u6162<\/td>\n<td align=\"center\">\u6162<\/td>\n<td align=\"center\">\u6781\u597d<\/td>\n<td align=\"left\">\u9700\u8981\u9884\u5b9a\u4e49\u5206\u4f4d\u6570<\/td>\n<\/tr>\n<tr>\n<td align=\"left\">\u6279\u5f52\u4e00\u5316 &#043; Dropout<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"center\">\u4e2d<\/td>\n<td align=\"left\">\u5c0f\u6279\u91cf\u65f6\u4e0d\u7a33\u5b9a<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\u5173\u952e\u6743\u8861&#xff1a;<\/p>\n<li>\u9c81\u68d2\u6027 vs \u654f\u611f\u6027&#xff1a;Huber Loss \u727a\u7272\u4e86\u5bf9\u6b63\u5e38\u6837\u672c\u7684\u62df\u5408\u7cbe\u5ea6&#xff0c;\u6362\u53d6\u4e86\u5728\u5f02\u5e38\u503c\u9762\u524d\u4e0d\u5d29\u6e83\u3002\u5728\u91d1\u878d\u573a\u666f\u4e2d&#xff0c;\u8fd9\u4e2a\u4ee3\u4ef7\u662f\u503c\u5f97\u7684\u3002<\/li>\n<li>\u5728\u7ebf\u66f4\u65b0 vs \u6279\u91cf\u91cd\u8bad&#xff1a;\u5206\u5e03\u6f02\u79fb\u68c0\u6d4b\u5230\u540e&#xff0c;\u6709\u4e24\u79cd\u5904\u7406\u65b9\u5f0f\u2014\u2014\u5728\u7ebf\u589e\u91cf\u66f4\u65b0&#xff08;\u5feb\u4f46\u53ef\u80fd\u9057\u5fd8\u65e7\u6a21\u5f0f&#xff09;\u548c\u5168\u91cf\u91cd\u8bad\u7ec3&#xff08;\u6162\u4f46\u66f4\u5168\u9762&#xff09;\u3002\u901a\u5e38\u5efa\u8bae\u4e24\u8005\u7ed3\u5408&#xff1a;\u5728\u7ebf\u66f4\u65b0\u7528\u4e8e\u77ed\u671f\u9002\u914d&#xff0c;\u5b9a\u671f\u5168\u91cf\u91cd\u8bad\u7528\u4e8e\u957f\u671f\u7a33\u5b9a\u6027\u3002<\/li>\n<li>\u7a97\u53e3\u957f\u5ea6\u7684\u9009\u62e9&#xff1a;\u6ed1\u52a8\u7a97\u53e3\u592a\u957f&#xff0c;\u5305\u542b\u8fc7\u65f6\u7684\u6a21\u5f0f&#xff1b;\u7a97\u53e3\u592a\u77ed&#xff0c;\u65e0\u6cd5\u6355\u6349\u957f\u5468\u671f\u89c4\u5f8b\u3002\u91d1\u878d\u573a\u666f\u4e2d 2-5 \u5e74\u7684\u7a97\u53e3\u662f\u5e38\u89c1\u9009\u62e9\u3002<\/li>\n<h3>\u4e94\u3001\u603b\u7ed3<\/h3>\n<p>\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898\u6765\u6e90\u4e8e\u4e09\u4e2a\u6839\u56e0&#xff1a;\u957f\u5e8f\u5217\u5bfc\u81f4\u7684\u68af\u5ea6\u6d88\u5931\/\u7206\u70b8\u3001\u5e02\u573a\u5206\u5e03\u7684\u975e\u5e73\u7a33\u6f02\u79fb\u3001\u4f4e\u9891\u4f46\u9ad8\u5f3a\u5ea6\u7684\u5f02\u5e38\u503c\u51b2\u51fb\u3002\u89e3\u51b3\u65b9\u6848\u9700\u8981\u4e09\u7ba1\u9f50\u4e0b&#xff1a;\u68af\u5ea6\u88c1\u526a&#xff08;\u9608\u503c 1.0-5.0&#xff09;\u89e3\u51b3\u68af\u5ea6\u95ee\u9898&#xff0c;Huber\/Quantile Loss \u66ff\u4ee3 MSE \u89e3\u51b3\u5f02\u5e38\u503c\u9c81\u68d2\u6027&#xff0c;\u5206\u5e03\u6f02\u79fb\u68c0\u6d4b &#043; \u5728\u7ebf\u5b66\u4e60\u89e3\u51b3\u975e\u5e73\u7a33\u6027\u3002\u5de5\u7a0b\u4e0a&#xff0c;\u5efa\u8bae\u5728\u8bad\u7ec3\u5faa\u73af\u4e2d\u52a0\u5165 NaN \u68c0\u6d4b\u548c\u81ea\u52a8\u6062\u590d\u673a\u5236&#xff1b;\u5c06\u5206\u5e03\u6f02\u79fb\u68c0\u6d4b\u4f5c\u4e3a\u751f\u4ea7\u73af\u5883\u7684\u5e38\u9a7b\u76d1\u63a7&#xff1b;\u6ed1\u52a8\u7a97\u53e3\u957f\u5ea6\u5728 2-5 \u5e74\u4e4b\u95f4\u6839\u636e\u8d44\u4ea7\u7c7b\u522b\u8c03\u6574\u3002\u7a33\u5b9a\u8bad\u7ec3\u4e0d\u662f\u4e00\u6b21\u6027\u5de5\u4f5c&#xff0c;\u800c\u662f\u9700\u8981\u6301\u7eed\u76d1\u63a7\u7684\u7cfb\u7edf\u6027\u5de5\u7a0b\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3&#xff1a;\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898<br \/>\n\u4e00\u3001\u4e2a\u6027\u5316\u6df1\u5ea6\u5f15\u8a00<br \/>\n\u5f53\u4f60\u5728\u8bad\u7ec3\u4e00\u4e2a LSTM \u9884\u6d4b\u80a1\u7968\u4ef7\u683c\u65f6&#xff0c;\u7a81\u7136\u53d1\u73b0 loss \u5728\u7b2c 347 \u4e2a epoch \u7206\u70b8\u6210 NaN\u2014\u2014\u8fd9\u4e0d\u662f bug&#xff0c;\u8fd9\u662f\u91d1\u878d\u65f6\u5e8f\u5efa\u6a21\u7684\u65e5\u5e38\u3002<br \/>\n\u91d1\u878d\u65f6\u95f4\u5e8f\u5217\u6709\u4e24\u4e2a\u8ba9\u6a21\u578b\u5934\u75bc\u7684\u7279\u6027&#xff1a;\u4e00\u662f\u957f\u7a0b\u4f9d\u8d56&#xff08;3 \u5e74\u524d\u7684\u4e8b\u4ef6\u53ef\u80fd\u5f71\u54cd\u4eca\u5929\u7684\u8d70\u52bf&#xff09;&#xff0c;\u4e8c\u662f\u5206\u5e03\u6f02\u79fb&#xff08;\u5e02\u573a\u7684\u7edf\u8ba1\u7279\u6027\u968f\u65f6\u95f4\u6539\u53d8&#xff09;\u3002\u8fd9\u4e24\u4e2a\u7279<\/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":[50],"topic":[],"class_list":["post-86118","post","type-post","status-publish","format-standard","hentry","category-server","tag-50"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v20.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 - \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\/86118.html\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"og:description\" content=\"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3&#xff1a;\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 \u4e00\u3001\u4e2a\u6027\u5316\u6df1\u5ea6\u5f15\u8a00 \u5f53\u4f60\u5728\u8bad\u7ec3\u4e00\u4e2a LSTM \u9884\u6d4b\u80a1\u7968\u4ef7\u683c\u65f6&#xff0c;\u7a81\u7136\u53d1\u73b0 loss \u5728\u7b2c 347 \u4e2a epoch \u7206\u70b8\u6210 NaN\u2014\u2014\u8fd9\u4e0d\u662f bug&#xff0c;\u8fd9\u662f\u91d1\u878d\u65f6\u5e8f\u5efa\u6a21\u7684\u65e5\u5e38\u3002 \u91d1\u878d\u65f6\u95f4\u5e8f\u5217\u6709\u4e24\u4e2a\u8ba9\u6a21\u578b\u5934\u75bc\u7684\u7279\u6027&#xff1a;\u4e00\u662f\u957f\u7a0b\u4f9d\u8d56&#xff08;3 \u5e74\u524d\u7684\u4e8b\u4ef6\u53ef\u80fd\u5f71\u54cd\u4eca\u5929\u7684\u8d70\u52bf&#xff09;&#xff0c;\u4e8c\u662f\u5206\u5e03\u6f02\u79fb&#xff08;\u5e02\u573a\u7684\u7edf\u8ba1\u7279\u6027\u968f\u65f6\u95f4\u6539\u53d8&#xff09;\u3002\u8fd9\u4e24\u4e2a\u7279\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.wsisp.com\/helps\/86118.html\" \/>\n<meta property=\"og:site_name\" content=\"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\" \/>\n<meta property=\"article:published_time\" content=\"2026-07-27T21:40:34+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=\"3 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86118.html\",\"url\":\"https:\/\/www.wsisp.com\/helps\/86118.html\",\"name\":\"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3\",\"isPartOf\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#website\"},\"datePublished\":\"2026-07-27T21:40:34+00:00\",\"dateModified\":\"2026-07-27T21:40:34+00:00\",\"author\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.wsisp.com\/helps\/86118.html#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.wsisp.com\/helps\/86118.html\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.wsisp.com\/helps\/86118.html#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.wsisp.com\/helps\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898\"}]},{\"@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":"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 - \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\/86118.html","og_locale":"zh_CN","og_type":"article","og_title":"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","og_description":"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3&#xff1a;\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 \u4e00\u3001\u4e2a\u6027\u5316\u6df1\u5ea6\u5f15\u8a00 \u5f53\u4f60\u5728\u8bad\u7ec3\u4e00\u4e2a LSTM \u9884\u6d4b\u80a1\u7968\u4ef7\u683c\u65f6&#xff0c;\u7a81\u7136\u53d1\u73b0 loss \u5728\u7b2c 347 \u4e2a epoch \u7206\u70b8\u6210 NaN\u2014\u2014\u8fd9\u4e0d\u662f bug&#xff0c;\u8fd9\u662f\u91d1\u878d\u65f6\u5e8f\u5efa\u6a21\u7684\u65e5\u5e38\u3002 \u91d1\u878d\u65f6\u95f4\u5e8f\u5217\u6709\u4e24\u4e2a\u8ba9\u6a21\u578b\u5934\u75bc\u7684\u7279\u6027&#xff1a;\u4e00\u662f\u957f\u7a0b\u4f9d\u8d56&#xff08;3 \u5e74\u524d\u7684\u4e8b\u4ef6\u53ef\u80fd\u5f71\u54cd\u4eca\u5929\u7684\u8d70\u52bf&#xff09;&#xff0c;\u4e8c\u662f\u5206\u5e03\u6f02\u79fb&#xff08;\u5e02\u573a\u7684\u7edf\u8ba1\u7279\u6027\u968f\u65f6\u95f4\u6539\u53d8&#xff09;\u3002\u8fd9\u4e24\u4e2a\u7279","og_url":"https:\/\/www.wsisp.com\/helps\/86118.html","og_site_name":"\u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","article_published_time":"2026-07-27T21:40:34+00:00","author":"admin","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"admin","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"3 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.wsisp.com\/helps\/86118.html","url":"https:\/\/www.wsisp.com\/helps\/86118.html","name":"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898 - \u7f51\u7855\u4e92\u8054\u5e2e\u52a9\u4e2d\u5fc3","isPartOf":{"@id":"https:\/\/www.wsisp.com\/helps\/#website"},"datePublished":"2026-07-27T21:40:34+00:00","dateModified":"2026-07-27T21:40:34+00:00","author":{"@id":"https:\/\/www.wsisp.com\/helps\/#\/schema\/person\/358e386c577a3ab51c4493330a20ad41"},"breadcrumb":{"@id":"https:\/\/www.wsisp.com\/helps\/86118.html#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.wsisp.com\/helps\/86118.html"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.wsisp.com\/helps\/86118.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.wsisp.com\/helps"},{"@type":"ListItem","position":2,"name":"\u91d1\u878d\u65f6\u5e8f\u6570\u636e\u8bad\u7ec3\uff1a\u957f\u5e8f\u5217\u5efa\u6a21\u7684\u8bad\u7ec3\u7a33\u5b9a\u6027\u95ee\u9898"}]},{"@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\/86118","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=86118"}],"version-history":[{"count":0,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/posts\/86118\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/media?parent=86118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/categories?post=86118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/tags?post=86118"},{"taxonomy":"topic","embeddable":true,"href":"https:\/\/www.wsisp.com\/helps\/wp-json\/wp\/v2\/topic?post=86118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}