This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.spatial import ConvexHull | |
# 设置中文字体(确保系统中有支持中文的字体,如SimHei) | |
plt.rcParams['font.sans-serif'] = ['SimHei'] # 用于正常显示中文 | |
plt.rcParams['axes.unicode_minus'] = False # 用于正常显示负号 | |
# 生成随机点集 | |
# np.random.seed(42) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# paper Diffusion Convolutional Recurrent Neural Network: Data-Driven Traffic Forecasting | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# 定义逆 sigmoid 函数 | |
def inverse_sigmoid(i, tau): | |
return tau / (tau + np.exp(i / tau)) | |
# 设置参数 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sympy as sp | |
# 定义矩阵 A | |
A = sp.Matrix([ | |
[1, 0, 1], | |
[0, 1, 1], | |
[0, 0, 0] | |
]) | |
# 定义 U, Sigma, V |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sympy as sp | |
A = sp.Matrix([ | |
[2,0,5,6, 1,0,0,0], | |
[1,3,3,6, 0,1,0,0], | |
[-1,1,2,1, 0,0,1,0], | |
[1,0,1,3, 0,0,0,1] | |
]) | |
def f(r1, r2, k): #r1+k*r2 | |
A[r1 - 1, :] = A[r1 - 1, :] + k * A[r2 - 1, :] | |
def g(r1, k): #r1*k |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<link rel="stylesheet" href="//unpkg.com/gitment/style/default.css"> | |
<script src="//gist.github.com/lr580/d23f057587b0f5610110f3598f6a32c8.js"></script> | |
<script src="https://jjeejj.github.io/js/gitment.js"></script> --> | |
<script src="https://www.wenjunjiang.win/js/gitment.js"></script> --> | |
<script src="//billts.site/js/gitment.js"></script> --> | |
<div id="comments"> | |
<script> | |
var gitment = new Gitment({ | |
owner: '<%- theme.gitment.owner %>', |