submit code

This commit is contained in:
wangshuai6
2025-04-09 11:01:16 +08:00
parent 4fbcf9bd87
commit 06499f1caa
145 changed files with 14400 additions and 0 deletions

23
tools/vis_timeshift.py Normal file
View File

@@ -0,0 +1,23 @@
import scipy
import numpy as np
import matplotlib.pyplot as plt
def timeshift(t, s=1.0):
return t/(t+(1-t)*s)
def gaussian(t):
gs = 1+scipy.special.erf((t-t.mean())/t.std())
def rs2(t, s=2.0):
factor1 = 1.0 #s/(s+(1-s)*t)**2
factor2 = np.log(t.clip(0.001, 0.999)/(1-t).clip(0.001, 0.999))
return factor1*factor2
t = np.linspace(0, 1, 100)
# plt.plot(t, timeshift(t, 1.0))
respaced_t = timeshift(t, s=5)
delats = (respaced_t[1:] - respaced_t[:-1])
# plt.plot(t, timeshift(t, 1.5))
plt.plot(rs2(t))
plt.show()