Open In App

PyBrain – Working with Networks

Prerequisite: How to Install PyBrain on Windows?

PyBrain is the open-source library of python used to implement Machine learning algorithms. It is easy to use this library that can solve problems quickly using Machine learning algorithms. Developers are working on this library to make it more flexible, faster, and improving usability. PyBrain is a short form of Python-Based Reinforcement Learning, Artificial Intelligence, and Neural Network.



In PyBrain, networks are connected using connections.  First, the new network is created, and then it is analyzed.

Network Creation:




from pybrain.tools.shortcuts import buildNetwork
  
net= buildNetwork(1,3,2)
print(net)



Analyze Network:

We can get the connections and module layers by writing their names in square brackets as shown below:




from pybrain.tools.shortcuts import buildNetwork
  
net = buildNetwork(1,3,2)
print(net['in'])
# print(net['out'])
# print(net['hidden0'])


Article Tags :