视频教学:LSTM+Transformer混合模型时间序列预测实战_哔哩哔哩_bilibili
模型结果:
代码:
# pip install openpyxl -i https://pypi.tuna.tsinghua.edu.cn/simple/ # pip install matplotlib -i https://pypi.tuna.tsinghua.edu.cn/simple/ import numpy as np import pandas as pd from tqdm import tqdm import torch from torch import nn import torch.nn.functional as F from torch import tensor import torch.utils.data as Data import math from matplotlib import pyplot from datetime import datetime, timedelta from sklearn.model_selection import trai