R包Deepnet:培训和测试MNIST数据集 [英] R Package Deepnet: Training and Testing the MNIST dataset

查看:96
本文介绍了R包Deepnet:培训和测试MNIST数据集的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 deepenet 包的 dbn.dnn.train 函数训练MNIST数据集.任务是一种分类. 我正在使用以下命令

I am trying to train the MNIST dataset using deepenet package's dbn.dnn.train function. The task is a classification one. I am using the following command

dbn.deepnet <- dbn.dnn.train(train.image.data,train.image.labels,hidden=c(5,5))

我面临的问题是:

1)标签应为因子类型向量.但是,当我输入标签作为因子时,该函数给出了一个错误,即"y应该是矩阵或向量".因此,我将标签用作数字.如何进行分类任务

1) The labels should be factor type vector. But when i input the labels as factor the function gives an error that "y should be a matrix or vector". So, I am using labels as numeric. How to proceed for a classification task

2)对dbn.dnn.train进行预测的功能是什么.我正在使用nn.predict,但是文档中提到输入应该是由函数nn.train训练的神经网络(未提及dbn.dnn.train). 所有记录的输出为0.9986

2) What it the function to make the predictions for dbn.dnn.train. I am using nn.predict but the documentation mentions that the input should be neural network trained by function nn.train (dbn.dnn.train is not mentioned). The output is 0.9986 for all records

nn.predict(dbn.deepnet,train.image.data)

推荐答案

不知道您是否还在研究它,或者是否找到了解决方案,但: 1/尝试一下:train.image.labels<-data.matrix(train.image.labels)

Don't know if you are still working on it, or if you've found the solution but : 1/ try this : train.image.labels <- data.matrix(train.image.labels)

2/即使我的神经网络是由dbn.dnn.train训练的,我也使用nn.predict.

2/ i use nn.predict, even if the neural network is trained by dbn.dnn.train.

这篇关于R包Deepnet:培训和测试MNIST数据集的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆