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

科技团队网站唐山注册公司需要多少钱

科技团队网站,唐山注册公司需要多少钱,江苏公司网站建设,通河县机场建设网站一、最优尺度不变信噪比#xff08;OSISNR#xff09;损失函数 参考#xff1a;论文解读 --Optimal scale-invariant signal-to-noise ratio and curriculum learning for monaural multi-spea   最优尺度不变信噪比#xff08;OSI-SNR#xff09;是一种用于评估信号质量…一、最优尺度不变信噪比OSISNR损失函数 参考论文解读 --Optimal scale-invariant signal-to-noise ratio and curriculum learning for monaural multi-spea   最优尺度不变信噪比OSI-SNR是一种用于评估信号质量的指标特别是在语音分离和增强任务中。OSI-SNR 通过优化估计信号与目标信号之间的相似性提供了一种更稳定和可靠的信号质量度量。OSI-SNR 的计算步骤如下 s s s表示原始语音信号 s ^ \hat{s} s^表示重建的语音信号。 ⟨ s , s ^ ⟩ ∑ t 1 T s [ t ] ⋅ s ^ [ t ] \langle s, \hat{s} \rangle \sum_{t1}^{T} s[t] \cdot \hat{s}[t] ⟨s,s^⟩t1∑T​s[t]⋅s^[t] ∣ s ^ ∣ 2 ∑ t 1 T ∣ s ^ [ t ] ∣ 2 |s^{\hat{}}|^2 \sum_{t1}^{T} |\hat{s}[t]|^2 ∣s^∣2t1∑T​∣s^[t]∣2 λ ∣ s ^ ∣ 2 ⟨ s , s ^ ⟩ \lambda \frac{|s^{\hat{}}|^2}{\langle s, \hat{s} \rangle} λ⟨s,s^⟩∣s^∣2​ s target λ ⋅ s ^ s_{\text{target}} \lambda \cdot \hat{s} starget​λ⋅s^ e noise s ^ − s target e_{\text{noise}} \hat{s} - s_{\text{target}} enoise​s^−starget​ OSI-SNR 10 log ⁡ 10 ( ∥ s target ∥ 2 ∥ e noise ∥ 2 ) \text{OSI-SNR} 10 \log_{10} \left( \frac{\| s_{\text{target}} \|^2}{\| e_{\text{noise}} \|^2} \right) OSI-SNR10log10​(∥enoise​∥2∥starget​∥2​)   将 最优尺度不变信噪比OSI-SNR 的倒数作为损失函数是一个合理的想法尤其是在某些情况下可能会更好地反映模型的性能。OSI-SNR 是一个衡量信号质量的指标值越高表示信号质量越好。在训练过程中我们通常希望最小化损失函数因此可以考虑将 OSI-SNR 的倒数作为损失函数。参考基于深层声学特征的端到端语音分离 方法 1每一帧的 OSI-SNR 取倒数计算损失再取均值 计算每一帧的 OSI-SNR OSI-SNR i 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) \text{OSI-SNR}_i 10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) OSI-SNRi​10log10​(∥enoise,i​∥2∥starget,i​∥2​)计算损失 Loss i 1 OSI-SNR i ϵ 1 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) ϵ \text{Loss}_i \frac{1}{\text{OSI-SNR}_i \epsilon} \frac{1}{10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) \epsilon} Lossi​OSI-SNRi​ϵ1​10log10​(∥enoise,i​∥2∥starget,i​∥2​)ϵ1​取均值 Final Loss 1 N ∑ i 1 N Loss i 1 N ∑ i 1 N 1 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) ϵ \text{Final Loss} \frac{1}{N} \sum_{i1}^{N} \text{Loss}_i \frac{1}{N} \sum_{i1}^{N} \frac{1}{10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) \epsilon} Final LossN1​i1∑N​Lossi​N1​i1∑N​10log10​(∥enoise,i​∥2∥starget,i​∥2​)ϵ1​ 方法 2每一帧的 OSI-SNR 取均值再取倒数计算损失 计算每一帧的 OSI-SNR OSI-SNR i 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) \text{OSI-SNR}_i 10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) OSI-SNRi​10log10​(∥enoise,i​∥2∥starget,i​∥2​)取均值 Mean OSI-SNR 1 N ∑ i 1 N OSI-SNR i 1 N ∑ i 1 N 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) \text{Mean OSI-SNR} \frac{1}{N} \sum_{i1}^{N} \text{OSI-SNR}_i \frac{1}{N} \sum_{i1}^{N} 10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) Mean OSI-SNRN1​i1∑N​OSI-SNRi​N1​i1∑N​10log10​(∥enoise,i​∥2∥starget,i​∥2​)计算损失 Final Loss 1 Mean OSI-SNR ϵ 1 1 N ∑ i 1 N 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) ϵ \text{Final Loss} \frac{1}{\text{Mean OSI-SNR} \epsilon} \frac{1}{\frac{1}{N} \sum_{i1}^{N} 10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) \epsilon} Final LossMean OSI-SNRϵ1​N1​∑i1N​10log10​(∥enoise,i​∥2∥starget,i​∥2​)ϵ1​ 方法 1 的最终损失函数是对每一帧的 OSI-SNR 值取倒数后再取均值强调了每一帧的信号质量。方法 2 的最终损失函数是先计算所有帧的 OSI-SNR 的均值然后取倒数提供了一个整体的信号质量评估。 import numpy as np def calculate_osi_snr_frame(target, estimated):# 获取帧数和频点数num_bins, num_frames target.shapeosi_snr_frames np.zeros(num_frames)for frame in range(num_frames):dot_product np.sum(target[:, frame] * estimated[:, frame])estimated_energy np.sum(np.abs(estimated[:, frame]) ** 2)lambda_opt estimated_energy / (dot_product 1e-10) # 防止除以零target_adjusted lambda_opt * target[:, frame]noise estimated[:, frame] - target_adjustedtarget_energy np.sum(np.abs(target_adjusted) ** 2)noise_energy np.sum(np.abs(noise) ** 2)osi_snr_frames[frame] 10 * np.log10(target_energy / (noise_energy 1e-8))return osi_snr_frames def loss_method_1(osi_snr_frames, epsilon1e-8):# 每一帧的 OSI-SNR 取倒数计算损失再取均值losses 1 / (osi_snr_frames epsilon)final_loss np.mean(losses)return final_loss def loss_method_2(osi_snr_frames, epsilon1e-8):# 每一帧的 OSI-SNR 取均值再取倒数计算损失mean_osi_snr np.mean(osi_snr_frames)final_loss 1 / (mean_osi_snr epsilon)return final_loss # 示例掩蔽矩阵 M1 和 M2 M1 np.array([[0.5, 0.6, 0.7],[0.8, 0.9, 1.0],[1.1, 1.2, 1.3]])M2 np.array([[0.4, 0.5, 0.6],[0.7, 0.8, 0.9],[1.0, 1.1, 1.2]]) # 计算每一帧的 OSI-SNR osi_snr_frames calculate_osi_snr_frame(M1, M2) # 计算损失 loss1 loss_method_1(osi_snr_frames) loss2 loss_method_2(osi_snr_frames) print(fLoss Method 1 (Frame-wise OSI-SNR): {loss1:.4f}) print(fLoss Method 2 (Mean OSI-SNR): {loss2:.4f})Loss Method 1 (Frame-wise OSI-SNR): 0.03342 Loss Method 2 (Mean OSI-SNR): 0.03333二、幅度幂律压缩均方误差MC-MSE损失函数 在音频信号处理和深度学习领域幅度幂律压缩均方误差Magnitude Compression Mean Squared Error, MC-MSE是一种重要的损失函数特别适用于语音增强和音频分离任务。MC-MSE通过引入幅度压缩的概念能够更有效地处理具有大动态范围的音频信号从而提高模型的性能。 2.1 、原理 在传统的均方误差MSE损失函数中模型对大幅度信号的敏感性可能导致对小幅度信号的学习不足。这种情况在音频信号处理中尤为明显因为音频信号的幅度通常具有很大的动态范围。为了解决这个问题MC-MSE引入了幅度压缩的机制通过对信号幅度进行非线性变换使得模型在训练过程中能够更好地关注小幅度信号的特征。 MC-MSE的核心思想是通过幂律压缩函数对信号幅度进行处理从而使得损失函数在计算时能够更均衡地反映不同幅度信号的影响。具体来说MC-MSE通过对目标信号和预测信号的幅度进行压缩来计算它们之间的均方误差。 2.2、公式 MC-MSE Loss的计算公式可以表示为 L MC-MSE 1 N ∑ i 1 N ( compress ( y i ) − compress ( y ^ i ) ) 2 L_{\text{MC-MSE}} \frac{1}{N} \sum_{i1}^{N} \left( \text{compress}(y_i) - \text{compress}(\hat{y}_i) \right)^2 LMC-MSE​N1​i1∑N​(compress(yi​)−compress(y^​i​))2 其中 y i y_i yi​ 是目标信号的幅度。 y ^ i \hat{y}_i y^​i​ 是模型预测的幅度。 compress ( ⋅ ) \text{compress}(\cdot) compress(⋅) 是幅度压缩函数通常采用幂律压缩形式。 幅度压缩函数的形式为 compress ( x ) sign ( x ) ⋅ ∣ x ∣ α \text{compress}(x) \text{sign}(x) \cdot |x|^\alpha compress(x)sign(x)⋅∣x∣α 在这里 α \alpha α是压缩因子通常取值在 0 α 1 0 \alpha 1 0α1 之间。较小的 α \alpha α值会导致更强的压缩效果从而使得模型在训练时能够更好地学习小幅度信号的特征。通过这种方式MC-MSE损失函数能够有效地提高模型在音频处理任务中的性能尤其是在复杂的噪声环境中。它不仅改善了模型对小幅度信号的学习能力还增强了模型的鲁棒性使其在实际应用中表现得更加出色。   通过一个具体的例子来说明如何计算两个掩蔽之间的幅度幂律压缩均方误差MC-MSE。假设我们有两个掩蔽 M 1 M_1 M1​ 和 M 2 M_2 M2​它们的维度都是 3 × 3 3 \times 3 3×3即3个时间帧和3个频率bin并且我们选择压缩指数 p 0.3 p 0.3 p0.3。   首先我们对两个掩蔽应用幂律压缩。假设 M 1 M_1 M1​ 和 M 2 M_2 M2​的值如下 M 1 [ 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 1.3 ] M_1 \begin{bmatrix} 0.5 0.6 0.7 \\ 0.8 0.9 1.0 \\ 1.1 1.2 1.3 \end{bmatrix} M1​ ​0.50.81.1​0.60.91.2​0.71.01.3​ ​ M 2 [ 0.4 0.5 0.6 0.7 0.8 0.9 1.0 1.1 1.2 ] M_2 \begin{bmatrix} 0.4 0.5 0.6 \\ 0.7 0.8 0.9 \\ 1.0 1.1 1.2 \end{bmatrix} M2​ ​0.40.71.0​0.50.81.1​0.60.91.2​ ​ 应用幂律压缩 p 0.3 p 0.3 p0.3后我们得到 M 1 p [ 0. 5 0.3 0. 6 0.3 0. 7 0.3 0. 8 0.3 0. 9 0.3 1. 0 0.3 1. 1 0.3 1. 2 0.3 1. 3 0.3 ] M_1^p \begin{bmatrix} 0.5^{0.3} 0.6^{0.3} 0.7^{0.3} \\ 0.8^{0.3} 0.9^{0.3} 1.0^{0.3} \\ 1.1^{0.3} 1.2^{0.3} 1.3^{0.3} \end{bmatrix} M1p​ ​0.50.30.80.31.10.3​0.60.30.90.31.20.3​0.70.31.00.31.30.3​ ​ M 2 p [ 0. 4 0.3 0. 5 0.3 0. 6 0.3 0. 7 0.3 0. 8 0.3 0. 9 0.3 1. 0 0.3 1. 1 0.3 1. 2 0.3 ] M_2^p \begin{bmatrix} 0.4^{0.3} 0.5^{0.3} 0.6^{0.3} \\ 0.7^{0.3} 0.8^{0.3} 0.9^{0.3} \\ 1.0^{0.3} 1.1^{0.3} 1.2^{0.3} \end{bmatrix} M2p​ ​0.40.30.70.31.00.3​0.50.30.80.31.10.3​0.60.30.90.31.20.3​ ​   接下来我们计算两个压缩后的掩蔽之间的均方误差。具体地对于每个元素我们计算差的平方然后对所有元素求平均。 L MC-MSE 1 9 ( ( 0. 5 0.3 − 0. 4 0.3 ) 2 ( 0. 6 0.3 − 0. 5 0.3 ) 2 … ( 1. 3 0.3 − 1. 2 0.3 ) 2 ) 0.00135 L_{\text{MC-MSE}} \frac{1}{9} \left( (0.5^{0.3} - 0.4^{0.3})^2 \\ (0.6^{0.3} - 0.5^{0.3})^2 \\ \ldots (1.3^{0.3} - 1.2^{0.3})^2 \right) 0.00135 LMC-MSE​91​((0.50.3−0.40.3)2(0.60.3−0.50.3)2…(1.30.3−1.20.3)2)0.00135 import numpy as npdef calculate_mc_mse(M1, M2, p0.3):compressed_M1 M1 ** pcompressed_M2 M2 ** pmse np.mean((compressed_M1 - compressed_M2) ** 2)return mseM1 np.array([[0.5, 0.6, 0.7], [0.8, 0.9, 1.0], [1.1, 1.2, 1.3]]) M2 np.array([[0.4, 0.5, 0.6], [0.7, 0.8, 0.9], [1.0, 1.1, 1.2]])mc_mse calculate_mc_mse(M1, M2, p0.3) print(MC-MSE:, mc_mse)MC-MSE: 0.00135三、融合损失函数 参考AEC论文解读 – A Deep Hierarchical Fusion Network for Fullband Acoustic Echo Cancellation   结合 最优尺度不变信噪比OSI-SNR 和 幅度幂律压缩均方误差MC-MSE 的损失函数可以通过超参数 γ \gamma γ 加权来形成最终的损失函数。根据您提供的公式最终的损失计算公式可以表示为 L L OSI-SNR γ L MC-MSE L L_{\text{OSI-SNR}} \gamma L_{\text{MC-MSE}} LLOSI-SNR​γLMC-MSE​ OSI-SNR 损失【方法 1】 L OSI-SNR 1 N ∑ i 1 N Loss i 1 N ∑ i 1 N 1 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) ϵ L_{\text{OSI-SNR}} \frac{1}{N} \sum_{i1}^{N} \text{Loss}_i \frac{1}{N} \sum_{i1}^{N} \frac{1}{10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) \epsilon} LOSI-SNR​N1​i1∑N​Lossi​N1​i1∑N​10log10​(∥enoise,i​∥2∥starget,i​∥2​)ϵ1​ MC-MSE 损失 L MC-MSE 1 N ∑ i 1 N ( compress ( y i ) − compress ( y ^ i ) ) 2 L_{\text{MC-MSE}} \frac{1}{N} \sum_{i1}^{N} \left( \text{compress}(y_i) - \text{compress}(\hat{y}_i) \right)^2 LMC-MSE​N1​i1∑N​(compress(yi​)−compress(y^​i​))2 最终损失公式 L L OSI-SNR γ ⋅ L MC-MSE 1 N ∑ i 1 N Loss i 1 N ∑ i 1 N 1 10 log ⁡ 10 ( ∥ s target , i ∥ 2 ∥ e noise , i ∥ 2 ) ϵ γ ⋅ 1 N ∑ i 1 N ( compress ( y i ) − compress ( y ^ i ) ) 2 L L_{\text{OSI-SNR}} \gamma \cdot L_{\text{MC-MSE}} \frac{1}{N} \sum_{i1}^{N} \text{Loss}_i \\ \frac{1}{N} \sum_{i1}^{N} \frac{1}{10 \log_{10} \left( \frac{\| s_{\text{target}, i} \|^2}{\| e_{\text{noise}, i} \|^2} \right) \epsilon} \gamma \cdot\frac{1}{N} \sum_{i1}^{N} \left( \text{compress}(y_i) - \text{compress}(\hat{y}_i) \right)^2 LLOSI-SNR​γ⋅LMC-MSE​N1​i1∑N​Lossi​N1​i1∑N​10log10​(∥enoise,i​∥2∥starget,i​∥2​)ϵ1​γ⋅N1​i1∑N​(compress(yi​)−compress(y^​i​))2 γ \gamma γ需要调试的经验值。 ϵ \epsilon ϵ一个小常数用于防止除以零的情况。这个损失函数通过加权结合了 OSI-SNR 和 MC-MSE能够同时考虑信号的重建质量和相似性。通过调整 γ \gamma γ 的值可以控制两种损失在最终损失中的相对重要性从而优化模型的性能。 import numpy as np def calculate_osi_snr_frame(target, estimated):num_bins, num_frames target.shapeosi_snr_frames np.zeros(num_frames)for frame in range(num_frames):dot_product np.sum(target[:, frame] * estimated[:, frame])estimated_energy np.sum(np.abs(estimated[:, frame]) ** 2)lambda_opt estimated_energy / (dot_product 1e-10) # 防止除以零target_adjusted lambda_opt * target[:, frame]noise estimated[:, frame] - target_adjustedtarget_energy np.sum(np.abs(target_adjusted) ** 2)noise_energy np.sum(np.abs(noise) ** 2)osi_snr_frames[frame] 10 * np.log10(target_energy / (noise_energy 1e-8))return osi_snr_frames def mc_mse_loss(target, estimated, gamma0.3):compressed_target np.power(np.abs(target), gamma)compressed_estimated np.power(np.abs(estimated), gamma)loss np.mean((compressed_estimated - compressed_target) ** 2)return loss def combined_loss(target, estimated, gamma15):# 计算每一帧的 OSI-SNRosi_snr_frames calculate_osi_snr_frame(target, estimated)# 计算 OSI-SNR 损失osi_snr_loss np.mean(1 / (osi_snr_frames 1e-10))print(osi_snr_loss:, osi_snr_loss)# 计算 MC-MSE 损失mc_mse_value mc_mse_loss(target, estimated)print(mc_mse_value:, mc_mse_value)# 计算最终损失final_loss osi_snr_loss gamma * mc_mse_valuereturn final_loss # 示例掩蔽矩阵 M1 和 M2 M1 np.array([[0.5, 0.6, 0.7],[0.8, 0.9, 1.0],[1.1, 1.2, 1.3]])M2 np.array([[0.4, 0.5, 0.6],[0.7, 0.8, 0.9],[1.0, 1.1, 1.2]]) # 计算最终损失 loss_value combined_loss(M1, M2, gamma15) print(fFinal Loss: {loss_value:.5f}) osi_snr_loss: 0.033421230071106235 mc_mse_value: 0.0013543901266690674 Final Loss: 0.05374
http://www.dnsts.com.cn/news/108118.html

相关文章:

  • 双鸭山建设网站招标网站建设
  • 湖南省新邵县建设局网站c 可以用来做网站吗
  • wordpress 添加外部链接网站排名优化机构
  • 有没有傻瓜式建设网站哪家网站做的比较好
  • 公司里面有人员增减要去哪个网站做登记百度自动搜索关键词软件
  • 重庆建网站有哪些上海闵行官网
  • 常规网站服务器如何使用云服务建设网站
  • 微信微网站是什么案例湖南有线郴州网络有限公司
  • 做网站交互效果用什么软件网站改版总结
  • 口碑好的网站开发wordpress共用数据库
  • h5制作网站公司dewplayer wordpress
  • 网站验证码文件wordpress采集公众号图片
  • 郑州微信网站兰州做高端网站的公司
  • 濮阳网站建设哪家好郴州网站制作公司有哪些
  • 菏泽机关建设网站品牌vi设计欣赏
  • 怎么使用网站上的模板休闲零食网站建设 中企动力
  • 网站建设营改增新浪博客发布到wordpress
  • 东莞淘宝网站建设asp医院网站源码
  • 广州企业网站建设哪家服务好wordpress 屏蔽ip
  • 网站建设公司-信科网络桂林象鼻山景区简介
  • wordpress建站需要多久常州网站建设公司平台
  • 学做网站哪里学桂林旅游必去十大景点
  • 医疗教育的网站建设搭建一个网站教程
  • 鲁权屯网站建设昆明门户网站
  • 学校网站首页设计图片建设网站费用主要包括哪些
  • 娄底市住房和城乡建设局官方网站怎么制作链接网页
  • 电商网站建设过程全国最火的电商代运营公司
  • 北京网站制作设计哪个公司好网站备案期间可以建站
  • 百度收录网站标题网站优化自己可以做吗
  • 非响应式网站优点海口网站制作软件