当前位置: 首页 > news >正文

phpcmsv9手机网站源码wordpress 没有注册

phpcmsv9手机网站源码,wordpress 没有注册,聊城房产网,wordpress电商推广插件主题思想: 正交基函数, sin,cos 是通过网络训练得到的参数。 使用一维卷积核直接对于原始音频,进行卷积生成语谱图; 使用一维卷积核生成语谱图特征, 不同于以往的方式,正是因为这些正交基函数是通过卷积…

主题思想:

  1. 正交基函数, sin,cos 是通过网络训练得到的参数。
    使用一维卷积核直接对于原始音频,进行卷积生成语谱图;

  2. 使用一维卷积核生成语谱图特征,

不同于以往的方式,正是因为这些正交基函数是通过卷积核构成的,
由于这些卷积核的参数可训练的, 这表明这些正交基是通过训练得来的, 理论上是更容易适配好当前的任务, 因为人为定义好的统一的正交基函数,并不能自适应在当前的任务上, 每个任务肯定自身对应的最好的正交基函数,通过训练得来,应该是恰当的;

但是,目前笔者实现下来, 这种方式占用显存特别高。

基本上需要 24G 显存以上, 多卡并行,比较好实验;

1. 使用神经网络生成语谱图的方式

现有的工作如下:

1.1 nnAudio

nnAudio: An on-the-fly GPU Audio to Spectrogram Conversion Toolbox Using 1D Convolutional Neural Networks

https://github.com/KinWaiCheuk/nnAudio;

1.2 PANN

PANNs: Large-Scale Pretrained Audio Neural Networks for Audio Pattern Recognition:

开源实现:
https://github.com/qiuqiangkong/audioset_tagging_cnn;

此外,  使用torch 完成 librosa 函数中的功能, 同样是基于神经网络;

公布使用torch 中一维卷积核的方式生成语谱图的仓库:

https://github.com/qiuqiangkong/torchlibrosa;

2. torch 实现的部分函数

下面实现的函数, 在上面的开源仓库中也实现了, 建议可以多阅读源码:

2.1 torch 实现power to db

#note: 使用torch 实现 librosa 中的power_to_db 函数:
# 将功率谱,转换为对数谱;
def power_to_db_torch(S, ref=1.0, amin=1e-10, top_db=80.0):#note 使用断言的方式,对输入检查;if amin <= 0:raise ValueError(" amin  must be strictly  positive")S = torch.tensor(S)amin = torch.tensor([amin])ref = torch.abs(torch.tensor([ref]))log_spec = 10.0 * torch.log10(torch.max(S, amin))log_spec -= 10.0  * torch.log10(torch.max(amin, ref))if top_db is not None:if top_db < 0:raise  ValueError("top_db  must be  non-negative")max_val = torch.max(log_spec)log_spec = torch.maximum(log_spec, max_val - top_db)return  log_spec

2.2 torch 实现 cv2.resize()

# 使用torch, 对单通道的图片进行缩放,
import  torch.nn.functional as F
def  resize_torch_single_channel(img, resz, method="bilinear"):# 函数的输入,需要使用断言,检查维度是否匹配assert  len(img.shape) == 2,  "Input image should have 2 dimension: (height, width)"#  检查张量是否是张量形式if not  isinstance(img, torch.Tensor):img = torch.tensor(img).float()# 增加batch, channel 维度img = img.unsqueeze(0).unsqueeze(0)height, width = img.shape[2], img.shape[3]new_height, new_width = int(height * resz), int(width * resz)if method == " bilinear":mode = 'bilinear'else:raise  ValueError("Unsupported  interpolation  method")# 使用torch 自带的线性插值函数, 完成尺寸的缩放resized_img = F.interpolate(img, size=(new_height, new_width),mode=mode, align_corners=False)# remove the  batch and  channel  dimresized_img = resized_img.squeeze(0).squeeze(0)return  resized_imgimport torch
import torch.nn.functional as Fdef resize_torch(img, resz, method='bilinear'):assert len(img.shape) == 3, "Input image should have 3 dimensions: (height, width, channels)"# Convert the input image to a PyTorch tensor if it's not already oneif not isinstance(img, torch.Tensor):img = torch.tensor(img).float()# Convert the image from HWC to CHW formatimg = img.permute(2, 0, 1).unsqueeze(0)  # Add an extra dimension for the batchheight, width = img.shape[2], img.shape[3]new_height, new_width = int(height * resz), int(width * resz)if method == 'bilinear':mode = 'bilinear'else:raise ValueError("Unsupported interpolation method")# Resize the image using torch.nn.functional.interpolateresized_img = F.interpolate(img, size=(new_height, new_width), mode=mode, align_corners=False)# Convert the image back to HWC format and remove the batch dimensionresized_img = resized_img.squeeze(0).permute(1, 2, 0)return resized_img
http://www.yayakq.cn/news/533773/

相关文章:

  • 白酒网站的建设帮人做分销网站违法么
  • 商业网站建设心得体会自适应wordpress主题
  • 广州专业网站改版网站网站建设费进什么科目
  • 钟表东莞网站建设企业网站模板免费版
  • 网站 需求分析外贸业务流程图
  • 找企业名录的网站网站建设阿胶膏的作用
  • 网站域名品牌怎么写深圳软件开发公司在哪里
  • 网站轮播图的按钮怎么做的做外贸没网站可以吗
  • 硅胶鞋垫移动网站建设wordpress 404模板
  • 电子商务网站建站流程wordpress管理员表
  • 做网站开发怎么接单哪有培训网站开发
  • 有什么正网站做兼职的哪个网站买东西最便宜
  • 南宁网站建设教学怎么样把第一页PPT设为模板相关信息圆柱钢模板优势是什么?企业网站建设模板和定制化有什么区别呢?
  • 深圳住房和建设局网站wordpress中文读音
  • 网站被挂了黑链建设学校网站
  • 吉利汽车网站开发环境分析免费公司取名器
  • 企业网站推广的形式有哪些wordpress 熊掌号插件
  • 从化免费网站建设制作类似网站软件
  • 东莞企业网站多少钱网红营销分析
  • 宁波建网站价格达内学网站开发培训课程
  • 摄影网站建设的目的年会策划
  • 站长之家的seo综合查询工具重庆住建厅网站官网
  • 网站定制公司选哪家网站排名怎么优化
  • 逆袭做富豪官方网站工程建设项目管理办法实施细则
  • 贵州网站建设费用企业邮箱在哪里看
  • 一般的网站需要多大的空间网络规划与优化技术学什么
  • 织梦网站后台管理wordpress免费主题企业
  • 私人装修接单网站seo1搬到哪里去了
  • wordpress+本地编辑郑州厉害的seo优化顾问
  • 自己做的网站被黑了怎么办长沙购物网站建设