如何在PyBrain中进行有监督的深度信仰训练? [英] How to do supervised deepbelief training in PyBrain?

查看:90
本文介绍了如何在PyBrain中进行有监督的深度信仰训练?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法让DeepBeliefTrainer在PyBrain/Python中处理我的数据.由于除了在无监督的情况下如何在PyBrain中使用深度学习之外,我找不到其他示例,所以我希望有人能够给出示例,以说明使用的基本概念.

I have trouble getting the DeepBeliefTrainer to work on my data in PyBrain/Python. Since I can't find any examples other than unsupervised on how to use the deep learning in PyBrain, I hope that someone can give examples that would show a basic concept of usage.

我尝试使用以下方法进行初始化:

I have tried to initialize using:

epochs = 100
layerDims = [768,100,100,1]

net = buildNetwork(*layerDims)
dataset = self.dataset
trainer = DeepBeliefTrainer(net, dataset=dataSet)
trainer.trainEpochs(epochs)

我尝试使用SupervisedDataset进行回归,但是训练只是失败了.有没有人成功使用深度学习培训师进行有监督的机器学习?你是怎么做到的?

I try to use a SupervisedDataset for regression, but the training just fails. Have anyone succeded with using deeplearning trainer for supervised machine learning? And how did you do it?

我得到的错误:

File "/Library/Python/2.7/site-packages/PyBrain-0.3.1-py2.7.egg/pybrain/structure/networks/rbm.py", line 39, in __init__
self.con = self.net.connections[self.visible][0]
KeyError: None

推荐答案

这是因为您的初始网络是: net = buildNetwork(*layerDims)在您的深度信任网络中没有可见层名称的层,即可见".因此,为了找到它在初始网络中的映射,您可以执行以下操作:

It's because your initial network: net = buildNetwork(*layerDims) doesn't have a layer with the name of the visible layer in your deep belief network, which is 'visible'. So, in order to find it mapped in the initial network, you can do something like:

net.addInputModule(LinearLayer(input_dim, 'visible'))
[...]
trainer = DeepBeliefTrainer(net, dataset=dataSet)

这篇关于如何在PyBrain中进行有监督的深度信仰训练?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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