Skip to content

基于Java实现CNN,并附MNIST和语音(MFCC特征)性别识别示例。

Notifications You must be signed in to change notification settings

DeepCompute/cnn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaCNN

基于Java实现CNN

构建CNN

LayerBuilder builder = new LayerBuilder();
builder.addLayer(Layer.buildInputLayer(new Size(28, 28)));
builder.addLayer(Layer.buildConvLayer(6, new Size(5, 5)));
builder.addLayer(Layer.buildSampLayer(new Size(2, 2)));
builder.addLayer(Layer.buildConvLayer(12, new Size(5, 5)));
builder.addLayer(Layer.buildSampLayer(new Size(2, 2)));
builder.addLayer(Layer.buildOutputLayer(10));
CNN cnn = new CNN(builder, 50);

运行MNIST数据集

String fileName = "data/train.format";
Dataset dataset = Dataset.load(fileName, ",", 784);
cnn.train(dataset, 100);
Dataset testset = Dataset.load("data/test.format", ",", -1);
cnn.predict(testset, "data/test.predict");

计算精度可以达到97.8%。

About

基于Java实现CNN,并附MNIST和语音(MFCC特征)性别识别示例。

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages