学习笔记——mixup插值操作涉及的部分函数

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)

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值