Closed kadarakos closed 10 years ago
The network also gives a very poor error rate error=93.2929
The code you posted looks correct at first glance. I'm curious how you could get an attribute error and still get some sort of error value -- usually an attribute error should halt the program.
Could you post the output from running this code?
Sorry I phrased, it the wrong way then. I don't get the attribute error if i use the theanets.Regressor class and the program runs and I get bad results. If I use the theantets.Network i get this
File "/usr/local/lib/python2.7/dist-packages/theanets/feedforward.py", line 328, in J cost = self.cost AttributeError: 'Network' object has no attribute 'cost'
Ah, yes. The Network
class is abstract (it doesn't implement cost
, among other things), so it won't work to use in an Experiment
. I should probably make that more explicit. For your dataset, since you have explicit, continuous-valued output targets, you should be using Regressor
.
As for the poor training error, training neural networks is something of a black art. There are a lot of different training methods (try optimize='cg'
or optimize='hf'
, for instance), and several of the methods (but in particular SGD) have a lot of parameters that need tuning to get good training performance.
This has been a problem for several folks trying to use this library. (And, furthermore, it is a problem for people using neural networks in general!) I should write up some suggestions for training as part of the documentation. But as a general strategy, try different training methods, and also try setting the parameters for the training methods -- I've found that sampling randomly from a log-uniform distribution gets you a good idea of which parameter settings work well. There are also packages for selecting training parameters (see https://github.com/hyperopt/hyperopt for a good example).
This code runs but if I change the Regressor to Network I get the error message that the Network has no attribute cost. What am I doing wrong?