【语音识别】基于DNN

您所在的位置:网站首页 利用Python计算hmm 【语音识别】基于DNN

【语音识别】基于DNN

2024-07-12 01:02:00| 来源: 网络整理| 查看: 265

基于DNN-HMM的语音识别系统 1、数据说明

本次实验所用的数据为0-9(其中0的标签为Z(Zero))和O这11个字符的英文录音所提取的39维的MFCC特征。其中

训练数据:330句话,11个字符,每个字符30句话,训练数据位于train目录下。测试数据:110句话,11个字符,每个字符10句话,测试数据位于test目录下。

train/test目录下各有3个文件,分别如下:

text: 标注文件,每一行第一列为句子id,第二列为标注。feats.scp: 特征索引文件,每一行第一列为句子id,第二列为特征的索引表示。feats.ark: 特征实际存储文件,该文件为二进制文件。 2、实验内容

本实验实现了一个简单的DNN的框架,使用DNN进行11个数字的训练和识别。 实验中使用以上所述的训练和测试数据分别对该DNN进行训练和测试。 请阅读dnn.py中的代码,理解该DNN框架,完善ReLU激活函数和FullyConnect全连接层的前向后向算法。 可以参考Softmax的前向和后向实现。dnn.py中代码插入位置为。

# BEGIN_LAB # write your code here # END_LAB 3、运行和检查

使用如下命令运行该实验,该程序末尾会打印出在测试集上的准确率。假设实现正确,应该得到95%以上的准确率,实现分类准确率为99.49%。

python dnn.py import math import matplotlib import matplotlib.pyplot as plt import numpy as np import kaldi_io from utils import * def plot_spectrogram(spec, file_name): fig = plt.figure(figsize=(20, 10)) plt.plot(spec) plt.xlabel('epochs') plt.ylabel('loss') plt.savefig(file_name) plt.show() targets_list = ['Z', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'O'] targets_mapping = {} for i, x in enumerate(targets_list): targets_mapping[x] = i class Layer: def forward(self, input): ''' Forward function by input Args: input: input, B * N matrix, B for batch size Returns: output when applied this layer ''' raise 'Not implement error' def backward(self, input, output, d_output): ''' Compute gradient of this layer's input by (input, output, d_output) as well as compute the gradient of the parameter of this layer Args: input: input of this layer output: output of this layer d_output: accumulated gradient from final output to this layer's output Returns: accumulated gradient from final output to this layer's input ''' raise 'Not implement error' def set_learning_rate(self, lr): ''' Set learning rate of this layer''' self.learning_rate = lr def update(self): ''' Update this layers parameter if it has or do nothing ''' class ReLU(Layer): def forward(self, input): mat = np.maximum(0, input) return mat.T def backward(self, input, output, d_output): mat = np.array(d_output, copy=True) mat[input


【本文地址】

公司简介

联系我们

今日新闻


点击排行

实验室常用的仪器、试剂和
说到实验室常用到的东西,主要就分为仪器、试剂和耗
不用再找了,全球10大实验
01、赛默飞世尔科技(热电)Thermo Fisher Scientif
三代水柜的量产巅峰T-72坦
作者:寞寒最近,西边闹腾挺大,本来小寞以为忙完这
通风柜跟实验室通风系统有
说到通风柜跟实验室通风,不少人都纠结二者到底是不
集消毒杀菌、烘干收纳为一
厨房是家里细菌较多的地方,潮湿的环境、没有完全密
实验室设备之全钢实验台如
全钢实验台是实验室家具中较为重要的家具之一,很多

推荐新闻


图片新闻

实验室药品柜的特性有哪些
实验室药品柜是实验室家具的重要组成部分之一,主要
小学科学实验中有哪些教学
计算机 计算器 一般 打孔器 打气筒 仪器车 显微镜
实验室各种仪器原理动图讲
1.紫外分光光谱UV分析原理:吸收紫外光能量,引起分
高中化学常见仪器及实验装
1、可加热仪器:2、计量仪器:(1)仪器A的名称:量
微生物操作主要设备和器具
今天盘点一下微生物操作主要设备和器具,别嫌我啰嗦
浅谈通风柜使用基本常识
 众所周知,通风柜功能中最主要的就是排气功能。在

专题文章

    CopyRight 2018-2019 实验室设备网 版权所有 win10的实时保护怎么永久关闭