简体   繁体   English

如何在PyBrain中进行有监督的深度信仰训练?

[英]How to do supervised deepbelief training in PyBrain?

I have trouble getting the DeepBeliefTrainer to work on my data in PyBrain/Python. 我无法让DeepBeliefTrainer在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. 由于我无法找到除了无人监督如何在PyBrain中使用深度学习之外的任何示例,我希望有人可以提供一些示例来展示使用的基本概念。

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)

I try to use a SupervisedDataset for regression, but the training just fails. 我尝试使用SupervisedDataset进行回归,但训练失败了。 Have anyone succeded with using deeplearning trainer for supervised machine learning? 有没有人成功使用deeplearning教练进行有监督的机器学习? And how did you do it? 你是怎么做到的?

Error I get: 我得到的错误:

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

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'. 这是因为您的初始网络: net = buildNetwork(*layerDims)没有一个在深信念网络中具有可见图层名称的图层,这是“可见的”。 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)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM