1.rand等
rand是0-1的均匀分布
randn是均值为0方差为1的正态分布
rand(n)或randn(n)生成n*n的随机数矩阵
rand(n,m)或randn(n,m)生成n*m的随机数矩阵
randperm生成随机整数排列
2.unsqueeze()函数与squeeze()函数
unsqueeze(n)是在第(n+1)维增加一个维度
squeeze(n)是将第(n+1)维为一的维度去掉
3.np.random.beta(alpha,beta)
Beta distribution. Conditions on the parameters are alpha > 0
and beta > 0
. Returned values range between 0 and 1
4.np.tile函数
tile函数位于python模块 numpy.lib.shape_base中,他的功能是重复某个数组。比如tile(A,n),功能是将数组A重复n次,构成一个新的数组
c = np.tile(a, [1, 10])
a.shape:(100,1)
c.shape:(100,10)