Open NicholasWalton opened 12 years ago
I had this problem a while ago. I guess it happens because the attribute offset of the module class is replaced by a property in the arac wrapper class _Network ( which is in the file pybrainbridge.py) and this property is read only i.e. has no setter. I added a setter
@offset.setter
def offset(self, value):
pass
below the following lines of code in _Network:
@property
def offset(self):
return self.proxies[self].timestep()
This fixed the AttributeError regarding offset for me and I was able to train networks, but I hardly used pybrain and arac and therefore have not tested if an empty setter does not break certain parts of pybrain <-> arac interaction, but maybe someone might find this info helpful.
add a function to component.cpp
void
Component::set_timestep(int value)
{
_timestep = value;
return ;
}
add the function declaration in component.h
then in pybrainbridge.py
add the following :
@property
def offset(self):
return self.proxies.handle(self).timestep()
@offset.setter
def offset(self, value):
self.proxies.handle(self).set_timestep(int(value))
the original self.proxies(self) does not work.
Then the uncompatibility should be fixed.
PyBrain 0.3 works fine.
Procedure: Install PyBrain 0.3.1 Run test_pybrainbridge.py
Expected result: All tests pass
Observed result: 13 tests fail with identical exceptions.