Skip to content

Commit

Permalink
add license and gitignore.modify py code main.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nl8590687 committed Aug 22, 2017
1 parent 80dbdb0 commit 2cdeeaa
Show file tree
Hide file tree
Showing 6 changed files with 752 additions and 9 deletions.
4 changes: 4 additions & 0 deletions .gitignore
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/
674 changes: 674 additions & 0 deletions LICENSE

Large diffs are not rendered by default.

20 changes: 15 additions & 5 deletions README.md
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
语言模型

基于概率图的马尔可夫模型

11 changes: 7 additions & 4 deletions log.md
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尝试实现
48 changes: 48 additions & 0 deletions main.py
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')
4 changes: 4 additions & 0 deletions readdata.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# -*- coding: encoding -*-

import numpy as np

0 comments on commit 2cdeeaa

Please sign in to comment.