图片叠加再一起成这种形式(batch,28,28,1)
可以使用numpy库的concatenate函数实现
import numpy as np
a = np.array([[0,1]])
print(a.shape)
b = np.array([[0,1]])
print(b.shape)
print (np.concatenate((a,b),axis = 0).shape)
输出如下:
1、正弦波叠加为方波的GLSL实现;
1、傅里叶函数分解方波公式:
f(y) = 4/PI * (sinx+ sin3x/3 + sin5x/5 + ...)
2、实际程序里面公式为:
f(y) = sinx+ sin3x/3 + sin5x/5 + ...
3、键盘控制
加入了正弦波合成方波的处理,使用箭头键移动正弦波,使用上下箭头进行振幅调整,使用+,-号来调整正弦波叠加的次数。
1、他山随悟博客 https://blog.csdn.net/t3swing/article/details/78471135
源代码
from turtle import*
pensize(2)
pencolor("#5F9F9F")
def trangle(i,j):
edge = j #初始边长j
penup()
seth(-135) #往中心挪一挪
fd(200)
for num in range(1,i+1):
#画个三角
pendown()
edge = edge / 2
seth(60 - 60 * (num - 1))
fd(edge)
seth(-60 - 60 * (num - 1))
fd(edge)
seth(180 - 60 * (num - 1))
fd(edge)
penup()
#换个位置
seth(60 - 60 * (num - 1))
fd(edge / 2)
trangle(5,600)
input()