Reputation: 1
I've started building some networks in Pybrain and having a lot of fun. I'm not entirely thrilled with the docs so I've built small, simple nets and played with them to discern how the class structure and data flow works.
I have a few questions:
Setup:
n = FeedForwardNetwork()
inLayer = LinearLayer(1, name = 'Input node')
hiddenLayer = LinearLayer(1, name = 'Hidden node')
outLayer = LinearLayer(1, name = 'Output node')
n.addInputModule(inLayer)
n.addModule(hiddenLayer)
n.addOutputModule(outLayer)
1) When you execute the "addInputModule" method, are the nodes in that layer automatically restricted to one input each? Is there any way to have more than one?
2) It seems I cannot create a NN of one node with 4 inputs and 1 output....looks like I MUST use at least 2 nodes for any NN, because the weights are associated with the edge (i.e. connection) class. And if I have 4 inputs, I must have 4 nodes in the InputModule....
Do I have this right?
3) In the above code snippet, what are the default Threshold Functions for each node in each layer? How can I display what the T.F.'s are?
4) Is there any documentation that describes all the available inputs for each class method?
Thanks!
Gregg
Upvotes: 0
Views: 248
Reputation: 48317
Your question is to broad, and is abit offtopic for this reason. Nonetheless, I'll try to address some of your issues.
n.addConnection
NN with 4 inputs and 1 output:
from pybrain import structure
fnn = structure.FeedForwardNetwork()
in_layer = LinearLayer(4, name = 'Input node')
out_layer = LinearLayer(1, name = 'Output node')
fnn.addInputModule(in_layer)
fnn.addOutputModule(out_layer)
fnn.addConnection(structure.FullConnection(in_layer, out_layer))
Upvotes: 1