pythonpython-2.7neural-networkpybrain

Python/Pybrain: How can I fix weights of a neural network during training?


I am quite new to neural networks and trying to use pybrain to build and train a network.

I am building my network manually with full connections between all layers (input, two hidden layers, output) and then set some weights to zero using _SetParameters as I don't want connections between some specific nodes.

My problem is that the weights that are zero at the beginning are adapted in the same way as all other weights and therefore no more zero after training the network via backprop. How can I force the "zero-weights" to stay zero through the whole process?

Thanks a lot for your answers. Fiona


Solution

  • Looks like you'll have to use the Connections module to create your network with the specific connections between nodes. Use the inSliceFrom and outSliceFrom parameters. See this StackOverflow answer for more details.