lmjohns3 / theanets

Neural network toolkit for Python
http://theanets.rtfd.org
MIT License
328 stars 73 forks source link

specifying layers -- output layer #82

Closed XuesongYang closed 9 years ago

XuesongYang commented 9 years ago

I found a bug in your original code. From the wiki, it shows "the output layer must be given as an integer, which specifies the number of output units in the network". However, in your example folder, the output layer is defined as a tuple, like (51, 'softmax') rather than integer. Therefore, I always get the error:" unsupported operand type(s) for +: 'int' and 'tuple' ".

As your suggestion, I should use

exp = theanets.Experiment(theanets.Classifier, layers=(30, 60, 30), output_activation='linear')

right?

lmjohns3 commented 9 years ago

I think this has been fixed in the git master: You can specify your layers as (30, 60, (30, 'linear')) and it should work. But I agree that this might not be working in the 0.5.x releases.

I'll close this since I believe it's fixed in the git master. Please reopen if you're indeed using the master and it's still not working. The current master will be released soon -- sometime this month -- as the 0.6.x series.