Stability AI发布基于稳定扩散的音频生成模型Stable Audio

近日Stability AI推出了一款名为Stable Audio的尖端生成模型,该模型可以根据用户提供的文本提示来创建音乐。在NVIDIA A100 GPU上Stable Audio可以在一秒钟内以44.1 kHz的采样率产生95秒的立体声音频,与原始录音相比,该模型处理时间的大幅减少归因于它对压缩音频潜在表示的有效处理。

架构

自动编码器(VAE),一个文本编码器和U-Net扩散模型。VAE通过获取输入音频数据并表示为保留足够信息用于转换的压缩格式,因为使用了卷积结构,所以不受描述音频编解码器的影响,可以有效地编码和解码可变长度的音频,同时保持高输出质量。

文本提示通过预先训练的文本编码器(称为CLAP)无缝集成。这个编码器是使用精心策划的数据集从头开始构建的,可以保留了文本特征包含了足够的信息,可以在单词和相应的声音之间建立有意义的联系。从CLAP编码器的倒数第二层提取的这些文本特征,然后通过U-Net的注意力层进行引导。

为了生成用于时间嵌入的音频片段,需要计算两个关键参数:片段的起始时间(以秒为单位)(称为“seconds_start”)和原始音频文件的总持续时间(以秒为单位)(称为“seconds_total”)。这些值被转换成离散学习的嵌入,在输入到U-Net的注意层之前与查询令牌连接。在推理阶段,这些值作为条件允许用户指定所需的最终音频输出长度。

Stable Audio中的扩散模型是一个U-Net架构,具有强大的9.07亿个参数,灵感来自Moûsai 模型。它结合残差层、自注意力层和交叉注意力层,基于文本和时间嵌入对输入数据进行有效降噪。

数据集

Stable Audio在包含超过80万个音频文件的广泛数据集上进行了训练。这个多样化的集合包括音乐、音效、乐器样本及其相关的文本元数据,总时长超过19,500小时。这个广泛的数据集是通过与音乐库AudioSparx的合作而提供的。

总结

Stability AI的Stable Audio AI模型标志着人工智能驱动的听觉创造力的重大飞跃。它为音乐和声音爱好者打开了新的视野。在未来还会提供进一步增强模型、数据集和训练技术的体系结构,发布基于Stable Audio的开源模型,并将提供必要的代码,以方便定制音频内容生成模型的训练。

项目的官方网站:

https://avoid.overfit.cn/post/86c750a6534b4cd380c94d3301fcf1bd

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
遗传算法(Genetic Algorithm,简称GA)是一种基于生物进化过程的搜索优化算法,主要用于优化问题的求解。高斯烟雨气体扩散模型是大气环境学中的一个经典问题,通过该模型可以模拟气体在大气中的扩散和传播过程。下面是基于遗传算法的高斯烟雨气体扩散模型的Matlab代码: ```matlab % GA algorithm for Gaussian plume model % problem definition fobj = @(x) gaussian_plume_model(x(1), x(2), x(3), x(4), x(5), x(6), x(7), x(8), x(9)); nvar = 9; % number of variables lb = [0.01 1 10 0.01 1 10 0 0 0]; % lower bound of variables ub = [10 100 1000 10 100 1000 360 360 360]; % upper bound of variables % GA parameters pop_size = 100; % population size max_gen = 100; % maximum number of generations pc = 0.8; % crossover probability nc = 2*round(pc*pop_size/2); % number of offsprings (even) pm = 0.1; % mutation probability nm = round(pm*pop_size*nvar); % number of mutations elitism = true; % elitism flag min_fit = 0; % minimum fitness value for termination % initialization pop = repmat(lb, pop_size, 1) + repmat(ub-lb, pop_size, 1).*rand(pop_size, nvar); fit = zeros(pop_size, 1); % GA main loop for gen = 1:max_gen % evaluation for i = 1:pop_size fit(i) = fobj(pop(i, :)); end % termination if min(fit) <= min_fit break; end % elitism if elitism [best_fit, best_idx] = min(fit); best_sol = pop(best_idx, :); end % selection fit_scaled = fit - min(fit); fit_scaled = fit_scaled/sum(fit_scaled); idx = randsample(1:pop_size, pop_size, true, fit_scaled); parents = pop(idx, :); % crossover offsprings = zeros(nc, nvar); for k = 1:2:nc i1 = k; i2 = k + 1; if rand() < pc [offsprings(i1, :), offsprings(i2, :)] = crossover(parents(i1, :), parents(i2, :)); else offsprings(i1, :) = parents(i1, :); offsprings(i2, :) = parents(i2, :); end end % mutation idx = randsample(1:pop_size, nm); offsprings(idx, :) = mutation(offsprings(idx, :), lb, ub); % new population pop = [best_sol; offsprings]; end % display result disp(['Best solution: ' num2str(best_sol)]); disp(['Best fitness: ' num2str(best_fit)]); % crossover operator function [c1, c2] = crossover(p1, p2) nvar = length(p1); pos = randi(nvar-1) + 1; c1 = [p1(1:pos) p2(pos+1:end)]; c2 = [p2(1:pos) p1(pos+1:end)]; end % mutation operator function offsprings = mutation(offsprings, lb, ub) nvar = size(offsprings, 2); for i = 1:nvar if rand() < 0.5 offsprings(:, i) = offsprings(:, i) + (ub(i) - offsprings(:, i)).*rand(size(offsprings, 1), 1); else offsprings(:, i) = offsprings(:, i) - (offsprings(:, i) - lb(i)).*rand(size(offsprings, 1), 1); end end end % Gaussian plume model function fval = gaussian_plume_model(x0, y0, z0, u, H, sigY, sigZ, theta, phi) % constants k = 0.4; % von Karman constant g = 9.81; % gravitational acceleration T = 288; % temperature rho0 = 1.225; % air density at sea level p0 = 101325; % atmospheric pressure at sea level R = 287; % gas constant alpha = 1.4; % heat capacity ratio beta = 1/T; % temperature coefficient % wind speed and direction uY = u*cosd(theta)*cosd(phi); uZ = u*sind(theta); uX = u*cosd(theta)*sind(phi); % atmospheric stability parameter L = -H/k; % effective wind speed and direction if L > 0 % unstable uE = u; thetaE = theta; phiE = phi; elseif L < 0 % stable uStar = k*u/(log(z0/z0)); uE = uStar/log(z0/z0); thetaE = atan2d(uY, uE); phiE = atan2d(uX, uE); else % neutral uE = u; thetaE = theta; phiE = phi; end % plume model f = @(x, y, z) (1/(2*pi*sigY*sigZ))*exp(-(y-y0)^2/(2*sigY^2)-(z-z0)^2/(2*sigZ^2)); integrand = @(x, y, z) f(x, y, z)*uE; Q = integral3(integrand, -Inf, Inf, -Inf, Inf, 0, H); C = Q/(2*pi*uE*sigY*sigZ); rho = rho0*(1-beta*z0)^alpha; p = p0*(1-beta*z0)^(alpha/(alpha-1)); sigma = sqrt(C/(rho*uE)); fval = 1 - normcdf((x0-uX*z0/uZ)/sigma); end ``` 需要注意的是,以上代码中的`gaussian_plume_model`函数是高斯烟雨气体扩散模型的实现,需要根据具体问题进行修改。另外,遗传算法的参数也需要根据实际情况进行调整,以获得最佳的优化结果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值