centos7版本运行python机器学习模型

1;下载数据源的问题
在利用conda环境下载pytorch的时候,会遇到网速很慢的情况,可以选用#清华镜像网站
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple/ .

New in version 1.3.0

import torch
from pytorch_wavelets import DWT1DForward, DWT1DInverse  # or simply DWT1D, IDWT1D
dwt = DWT1DForward(wave='db6', J=3)
X = torch.randn(10, 5, 100)
yl, yh = dwt(X)
print(yl.shape)
>>> torch.Size([10, 5, 22])
print(yh[0].shape)
>>> torch.Size([10, 5, 55])
print(yh[1].shape)
>>> torch.Size([10, 5, 33])
print(yh[2].shape)
>>> torch.Size([10, 5, 22])
idwt = DWT1DInverse(wave='db6')
x = idwt((yl, yh))

New in version 1.2.0

import torch
from pytorch_wavelets import ScatLayer
scat = ScatLayer()
X = torch.randn(10,5,64,64)
# A first order scatternet with 6 orientations and one lowpass channels
# gives 7 times the input channel dimension
Z = scat(X)
print(Z.shape)
>>> torch.Size([10, 35, 32, 32])
# A second order scatternet with 6 orientations and one lowpass channels
# gives 7^2 times the input channel dimension
scat2 = torch.nn.Sequential(ScatLayer(), ScatLayer())
Z = scat2(X)
print(Z.shape)
>>> torch.Size([10, 245, 16, 16])
# We also have a slightly more specialized, but slower, second order scatternet
from pytorch_wavelets import ScatLayerj2
scat2a = ScatLayerj2()
Z = scat2a(X)
print(Z.shape)
>>> torch.Size([10, 245, 16, 16])
# These all of course work with cuda
scat2a.cuda()
Z = scat2a(X.cuda())
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值