-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add license and gitignore.modify py code main.py
- Loading branch information
Showing
6 changed files
with
752 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
## Ignore some files and folders for copyright and other reasons. | ||
|
||
*.model | ||
[Mm]odel_speech/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,25 @@ | ||
# ASRT_SpeechRecognition | ||
基于深度学习的语音识别系统 | ||
|
||
readme.md | ||
## Introduction | ||
简介 | ||
|
||
let's get started. | ||
可以尝试使用Keras进行制作 | ||
|
||
本项目将使用TensorFlow基于递归神经网络进行制作。 | ||
本项目将使用TensorFlow基于递归神经网络和卷积神经网络进行制作。 | ||
|
||
This project will use TensorFlow based on RNN to implement. | ||
This project will use TensorFlow based on RNN and CNN to implement. | ||
|
||
## Model | ||
模型 | ||
|
||
### Speech Model | ||
语音模型 | ||
|
||
test --by shouzhenglll | ||
LSTM + CNN | ||
|
||
### Language Model | ||
语言模型 | ||
|
||
基于概率图的马尔可夫模型 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,12 @@ | ||
# ASRT_SpeechRecognition | ||
基于深度学习的语音识别系统 | ||
基于深度学习的语音识别系统 | ||
|
||
log.md | ||
## Introduction | ||
|
||
这里是更新记录日志文件 | ||
这里是更新记录日志文件 | ||
|
||
如果有什么问题,团队内部需要在这里直接写出来 | ||
如果有什么问题,团队内部需要在这里直接写出来 | ||
|
||
## Log | ||
### 2017-08-22 | ||
准备使用Keras基于LSTM/CNN尝试实现 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,51 @@ | ||
# -*- coding: encoding -*- | ||
""" | ||
@author: nl8590687 | ||
""" | ||
#LSTM_CNN | ||
import keras as kr | ||
import numpy as np | ||
|
||
from keras.models import Sequential | ||
from keras.layers import Dense, Dropout, Flatten#,Input,LSTM,Convolution1D,MaxPooling1D,Merge | ||
from keras.layers import Conv1D,LSTM,MaxPooling1D,Merge#Conv2D, MaxPooling2D,Conv1D | ||
|
||
class ModelSpeech(): # 语音模型类 | ||
def __init__(self,MS_EMBED_SIZE = 64,BATCH_SIZE = 32): # 初始化 | ||
self.MS_EMBED_SIZE = MS_EMBED_SIZE # LSTM 的大小 | ||
self.BATCH_SIZE = BATCH_SIZE # 一次训练的batch | ||
self._model = self.createLSTMModel() | ||
|
||
def CreateLSTMModel(self):# 定义训练模型,尚未完成 | ||
# 定义LSTM/CNN模型 | ||
|
||
_model = Sequential() | ||
_model.add(LSTM(self.MS_EMBED_SIZE, return_sequences=True, input_shape = (200,400))) # input_shape需要修改 | ||
_model.add(Dropout(0.3)) | ||
_model.add(Conv1D(self.QA_EMBED_SIZE // 2, 5, border_mode="valid")) | ||
_model.add(MaxPooling1D(pool_length=2, border_mode="valid")) | ||
_model.add(Dropout(0.3)) | ||
_model.add(Flatten()) | ||
|
||
|
||
|
||
#_model = Sequential() | ||
#_model.add(Merge([m_lstm, aenc], mode="concat", concat_axis=-1)) | ||
_model.add(Dense(1279, activation="softmax")) | ||
_model.compile(optimizer="adam", loss='categorical_crossentropy',metrics=["accuracy"]) | ||
return _model | ||
|
||
def Train(self): | ||
# 训练模型 | ||
|
||
def LoadModel(self,filename='model_speech/LSTM_CNN.model'): | ||
self._model.load_weights(filename) | ||
|
||
def SaveModel(self,filename='model_speech/LSTM_CNN.model'): | ||
# 保存模型参数 | ||
|
||
def Test(self): | ||
# 测试检验模型效果 | ||
|
||
|
||
print('test') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# -*- coding: encoding -*- | ||
|
||
import numpy as np | ||
|