- 博客(32)
- 资源 (36)
- 收藏
- 关注
原创 非线性状态空间模型与非线性自回归模型的联系
r∈RN,u∈Rd,A∈RN×N,Win∈RN×d,f(⋅)=tanh(⋅)r\in R^N, u \in R^d, A\in R^{N\times N}, W_{in} \in R^{N\times d}, f (\cdot)= tanh(\cdot)r∈RN,u∈Rd,A∈RN×N,Win∈RN×d,f(⋅)=tanh(⋅)rt=(1−α)rt−1+αf(Art−1+Winut)vt=...
2020-05-28 13:51:41 2964
原创 Quantile RNN
文章目录数据预处理piplineevaluationmodel数据预处理import numpy as npfrom toolz.curried import *@currydef clean_nan(dataset, how='any'): return dataset.dropna(how=how)@currydef lagger(dataset, n_lags, price_columns): df = reduce( lambda df, la
2020-05-27 23:45:09 1469
原创 Multi-Horizon Time Series Forecasting with Temporal Attention Learning
文章目录论文地址模型结构图注意力机制季节内的注意力季节间的注意力分位点回归论文地址https://dl.acm.org/doi/10.1145/3292500.3330662模型结构图使用注意力机制的时间序列多步预测模型:对离散输入做 Embeding对历史数据用单向 LSTM 提取特征,每一个历史时刻对应一个隐状态,图中的下面部分对未来的输入用双向的 Bi-LSTM 提取特征,图中的上面部分用注意力机制建立未来时刻特征和历史时刻特征的联系,图中的中间部分注意力机制从图中可以看出,
2020-05-27 19:19:56 3356
原创 DeepGLO
代码:https://github.com/rajatsen91/deepglo文章主要有三点创新:Leveled-Init TCN, 对 TCN 的改进,使用 LeveledInit 方法初始化 TCN 权重,使得 TCN 更好地处理不同尺度的时间序列;TCN-MF,用 TCN 来对多变量时间序列预测的矩阵分解法做正则化DeepGLO,把矩阵分解法 MF 得到的 包含全局信息的因子序列及其预测值 作为局部序列预测时的协变量。LeveledInit TCN从如下代码中可以看出对 TCN 权.
2020-05-26 22:08:38 2667 1
原创 时间序列特征提取 —— 获取日期相关的协变量
在做时间序列预测时,日期很重要的特征,很多由人类活动产生的时间序列都是以日为周期,受到周末、节假日、季度等因素的影响。下面这段代码就给出一段时间内直接从时间中提取出的七种特征:MOH : minute_of_hourHOD : hour_of_dayDOM : day_of_monthDOW : day_of_weekDOY : day_of_yearMOY : month_of_yearWOY : week_of_year可以自定义 起始时刻 start_date、采样频率 fre
2020-05-26 19:54:57 2512
原创 时间序列问题与自然语言处理的区别
在技术上,经常会把时间序列问题和自然语言处理问题类比,因为两者都是时序数据,所以两类问题的模型经常相互借用。但两者还是有一定区别的,自然语言本质上还是符号序列,而通常考虑的时间序列问题是数值序列。RNN 原本是用于时间序列建模,用其函数逼近的功能来仿真一个非线性动态系统,多用于工程控制领域。早期的自然语言处理是不用 RNN 的,而是建立词空间的随机过程模型,如隐马尔科夫模型,认为语句的形成是源于词空间的离散元素之间依概率的游走。随着神经网络技术的发展,RNN 的训练变得更容易,大家开始考虑用 RNN
2020-05-24 12:06:38 2700 1
原创 【pytorch】用 GRU 做时间序列预测
文章目录数据datasetoptimizermodeltrain数据df.to_csv('traffic1.txt', header=None, index=None)df数据为每小时记录一次的交通流量数据,每周有几天出现早高峰。datasetimport torchimport numpy as np;from torch.autograd import Variabledef normal_std(x): return x.std() * np.sqrt((len(x
2020-05-24 09:16:00 10370 12
原创 LSTNet
文章目录代码论文LSTNet部分参数解释model代码https://github.com/laiguokun/LSTNet论文Modeling Long- and Short-Term Temporal Patterns with Deep Neural Networks.LSTNet部分参数解释参数默认值解释model(str)‘LSTNet’hidCNN(int)100number of CNN hidden unitshidRNN(int)
2020-05-22 23:09:47 3908 3
原创 【pytorch】封装 optimizer实现 “梯度截断” 与 “学习率下调”
文章目录参考代码初始化梯度截断下调学习率参考代码https://github.com/laiguokun/LSTNet初始化import mathimport torch.optim as optimclass Optim(object): def _makeOptimizer(self): if self.method == 'sgd': self.optimizer = optim.SGD(self.params, lr=self.lr)
2020-05-22 21:49:21 2672
原创 Dual Self-Attention Network (DSANet)
本文来对 DSANet 从源码的角度做自定向下的分析:总体结构3 个支路:全局自注意力模块、局部自注意力模块、线性自回归模块。参数含义参数含义window (int)the length of the input window sizen_multiv (int)num of univariate time seriesn_kernels (int)the num of channelsw_kernel (int)the default is 1,初始.
2020-05-21 22:04:19 3100 4
原创 【pytorch】构建多元时间序列数据集 Dataset
假设原本数据集是如下的 csv 格式,行代表时间,列数代表变量数。用它来构造机器学习的数据集,也就是有监督标签的样本。import torchimport torch.utils.dataimport osimport numpy as npimport pandas as pdclass MTSDataset(torch.utils.data.Dataset): """Multi-variate Time-Series Dataset for *.txt file R
2020-05-21 19:19:56 7347 3
原创 时间序列论文常用数据集
下载地址:laiguokun/multivariate-time-series-data.electricity(行,列) = (26304, 321)每日的用电量有一定的季节性,图中只画出 10 列exchange_rate(行,列) = (7588, 8)solar-energy(行,列) = (52560, 137)太阳能自然是以天为周期算,晚上几乎为零,故呈现如下形状traffic(行,列) = (17544, 862)不同地点的交通流量,主要以日为单位,白天多晚上少
2020-05-20 21:30:52 16316 19
原创 【python】dict 和 Namespace 之间的转换
dic = dict(a = 1, b = 2)dict => Namespaceimport argparsens = argparse.Namespace(**dic)Namespace => dictdic = vars(ns)
2020-05-20 20:37:12 10350 3
原创 状态空间模型的等价性
考虑状态转移方程和观测方程均为非线性的状态空间模型:xt=f(xt−1)+vtyt=g(xt)+etx_t = f(x_{t-1}) + v_t \\y_t = g(x_t) + e_txt=f(xt−1)+vtyt=g(xt)+et其等价于只有状态转移方程为非线性的形式:zt=h(zt−1)+wtyt=γt+etz_t = h(z_{t-1}) + w_t \\y_t = \gamma_t + e_tzt=h(zt−1)+wtyt=γt+et其中 zt=[xt
2020-05-19 08:46:40 2280
转载 基于高斯过程的动态系统模型(GP-BASED DYNAMICAL SYSTEM MODELS)
文章目录线性高斯时间序列模型基于高斯过程的非线性自回归模型状态转移函数基于高斯过程的状态空间模型观测函数基于高斯过程的状态空间模型状态转移函数和观测函数都基于高斯过程的状态空间模型状态转移函数基于高斯过程的非1阶马尔科夫状态空间模型隐变量基于高斯过程的高斯隐变量模型线性高斯时间序列模型基于高斯过程的非线性自回归模型状态转移函数基于高斯过程的状态空间模型观测函数基于高斯过程的状态空间模型状态转移函数和观测函数都基于高斯过程的状态空间模型状态转移函数基于高斯过程的非1阶马尔科夫状态空间模型
2020-05-18 22:05:25 2640 4
原创 动态因子图模型(Dynamic Factor Graphs)
文章目录DFG 相关论文《Dynamic Factor Graphs for Time Series Modeling》《DYNAMIC FACTOR GRAPHS –A NEW WIND POWER FORECASTING APPROACH》其它拓展DFG 原理模型结构模型推断模型训练pytorch 实现importutilsdatasetmodulesDFG modelload datatrainresultDFG 相关论文《Dynamic Factor Graphs for Time Series
2020-05-14 17:34:26 6838 5
原创 时间序列分解模型 —— Neural Decomposition
文章目录论文及代码模型代码model测试序列训练预测加点噪声pytorch 实现论文及代码原始论文:代码:https://github.com/trokas/neural_decomposition模型将时间序列分解成周期项和非周期项 g(t)g(t)g(t):x(t)=∑k=1N(ak⋅sin(wkt+ϕk))+g(t).x(t) = \sum _{k = 1}^{N}{( a_{k} \cdot \sin ( w_{k} t + \phi _{k} )) } + g(t).x(t)
2020-05-10 16:33:39 3045
转载 Gibbs采样
在MCMC(三)MCMC采样和M-H采样中,我们讲到了M-H采样已经可以很好的解决蒙特卡罗方法需要的任意概率分布的样本集的问题。但是M-H采样有两个缺点:一是需要计算接受率,在高维时计算量大。并且由于接受率的原因导致算法收敛时间变长。二是有些高维数据,特征的条件概率分布好求,但是特征的联合分布不好求。因此需要一个好的方法来改进M-H采样,这就是我们下面讲到的Gibbs采样。1. 重新寻找合适的细...
2020-05-07 18:12:35 1489
转载 MCMC采样和M-H采样
在MCMC(二)马尔科夫链中我们讲到给定一个概率平稳分布π\piπ, 很难直接找到对应的马尔科夫链状态转移矩阵PPP。而只要解决这个问题,我们就可以找到一种通用的概率分布采样方法,进而用于蒙特卡罗模拟。本篇我们就讨论解决这个问题的办法:MCMC采样和它的易用版M-H采样。1. 马尔科夫链的细致平稳条件在解决从平稳分布$\pi$, 找到对应的马尔科夫链状态转移矩阵$P$之前,我们还需要先看看马尔...
2020-05-07 17:06:52 1498
原创 拒绝采样 (Rejection sampling)
采样方法证明几何解释首先需要了解概率密度函数的几何意义:概率密度函数曲线和 xxx 轴围成一个区域,每个点 xix_ixi 所在的高度正比于 PX(xi)P_X(x_i)PX(xi)....
2020-05-07 13:51:45 3148
原创 逆变换采样 (inverse transform sampling) 的原理
前文介绍了,对随机变量做函数变换 Y=f(X)Y = f(X)Y=f(X) 后的概率密度函数 (PDF) 之间的变化:PY(y)=PX(f−1(y))∣df−1(y)dy∣=PX(x)∣dxdy∣P_Y(y) = P_X(f^{-1}(y))\left|\frac{df^{-1}(y)}{dy}\right| = P_X(x) \left|\frac{dx}{dy}\right|PY(y)...
2020-05-07 11:36:50 9348 3
原创 随机变量的函数的概率密度函数
文章目录问题描述解问题描述已知 X∼PX(x)X \sim P_X(x)X∼PX(x),Y=f(X)Y = f(X)Y=f(X),求 YYY 的概率密度函数 PY(y)P_Y(y)PY(y).解当 fff 为递增函数时,考察 YYY 的累计分布函数FY(y)F_Y(y)FY(y):FY(y)=Pr(Y≤y)=Pr(X≤f−1(y))=FX(f−1(y))F_Y(y) = Pr(Y...
2020-05-06 23:28:54 11657 2
转载 Forecasting: Principles and Practice 笔记
来源:https://github.com/robjhyndman/ETC3550Slides文章目录什么序列比较好预测预测的对象:点预估、区间预估趋势、季节、周期季节与周期的区别自相关系数趋势与季节在 ACF 图中的表现举例白噪声检验举例什么序列比较好预测预测的对象:点预估、区间预估趋势、季节、周期季节与周期的区别自相关系数趋势与季节在 ACF 图中的表现举例白噪...
2020-05-05 22:53:46 2244
原创 最小绝对偏差(LAD)
最小绝对偏差 (Least Absolute Deviations, LAD) 与最小二乘法(假设误差服从高斯分布)类似:当假设线性回归的误差服从拉普拉斯分布时,最小绝对偏差回归是对参数的最大似然估计。问题描述minx∣∣Wx−y∣∣1\min_{x} \quad || Wx-y||_1xmin∣∣Wx−y∣∣1等价于minνs.t.ν=∣∣Wx−y∣∣1\begin{arr...
2020-05-05 17:54:19 7681 3
原创 双边滤波器(bilateral filter)
直接看看滤波结果吧,蓝线为原始信号,黄线为高斯滤波结果,绿线为双边滤波结果。高斯滤波大家应该都很熟悉:yi′=∑j=i−Hi+Hwijyjy_i' = \sum_{j=i-H}^{i+H} w_{ij} y_jyi′=j=i−H∑i+Hwijyjwij=1Zexp(−∣i−j∣2/2σ2)w_{ij} = \frac{1}{Z}\exp(-|i-j|^2/2\sigma^2)...
2020-05-05 16:35:13 2180 5
原创 pandas 把多个列合成日期
原始数据有两列 Date 和 Time方法一读取时合并# 将txt文档读入并转换为 csv 文件格式df = pd.read_csv(path, sep=';', parse_dates={'dt' : ['Date', 'Time']}, infer_datetime_format=True, low_memory...
2020-05-04 20:11:44 5636
原创 分段线性函数的拐点检测
import numpy as npimport matplotlib.pyplot as plt%matplotlib inlineN = 100s = [10 * i for i in range(1,10)]delta = [0.1, 0,0,0,-5,0,0,11,5]km = np.array([1,10])t = np.linspace(0, 1, N)t1 = n...
2020-05-04 09:48:22 4633 1
原创 L1 和 L2 正则项系数与先验分布参数的关系
L1L_1L1 正则项与 Laplace 分布如果参数的先验分布为拉普拉斯分布:P(θi)=λπexp(−λθi2)P(\theta_i) = \frac{\lambda}{\sqrt{\pi}} \exp(-\lambda \theta_i^2)P(θi)=πλexp(−λθi2)等价于:minθ∑i∣∣f(xi)−yi∣∣2+λ∑j∣θj∣\min_\theta \...
2020-05-02 22:52:46 1556
2024年3月杭州及周边小区挂牌价格
2024-03-22
利用 SIFT 实现图像拼接 python 代码
2021-01-01
python 使用摄像头监测心率
2020-10-14
知网爬虫.ipynb
2020-09-10
Python 图片中扭曲矩形的复原
2020-09-06
explore_data.ipynb
2020-05-20
Introduction to symmetry analysis (2002) [Brian J. Cantwell]
2020-01-07
Feedback Control in Systems Biology
2019-09-18
ICML 2019年 会议文章目录 (含论文下载链接)
2019-06-04
《应用非线性控制》【Slotine & Weiping Li 著】MIT经典教材
2019-01-05
Handbook of Matrices
2018-09-22
算法设计(英文文字版)by Jon_Kleinberg & Eva_Tardos
2018-09-19
icml 2018年 会议文章目录(含文章下载链接)
2018-09-17
link prediction in social networks: law of power distribution
2018-01-23
《Combinatorial Optimization》Cook, Cunningham, Pulleyblank, Schrijver
2017-11-14
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人