Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed Nengo compatibility #12

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Fixed Nengo compatibility #12

wants to merge 1 commit into from

Conversation

bmorcos
Copy link
Collaborator

@bmorcos bmorcos commented Dec 2, 2016

Looks like the learning_rate attribute is now read-only which broke the --adapt code:

Traceback (most recent call last):
  File "adaptive_bias.py", line 139, in <module>
    AdaptiveBias().run()
  File "c:\users\user\documents\github\ctn_benchmarks\ctn_benchmark\benchmark.py", line 95, in run
    model = self.model(p)
  File "adaptive_bias.py", line 81, in model
    conn.learning_rule_type.learning_rate *= p.learning_rate
  File "c:\users\user\documents\github\nengo\nengo\params.py", line 205, in __set__
    super(NumberParam, self).__set__(instance, value)
  File "c:\users\user\documents\github\nengo\nengo\params.py", line 97, in __set__
    self.validate(instance, value)
  File "c:\users\user\documents\github\nengo\nengo\params.py", line 226, in validate
    super(NumberParam, self).validate(instance, num)
  File "c:\users\user\documents\github\nengo\nengo\params.py", line 146, in validate
    raise ReadonlyError(attr=self.name, obj=instance)
nengo.exceptions.ReadonlyError: PES.learning_rate: learning_rate is read-only and cannot be changed

I also formatted for pep8 which accounts for the majority of the diff.

The functional change is on line 86 where I hardcoded the default PES.learning_rate=1e-4 * the scale factor.

- learning_rate was made read-only so I hardcoded the
  default rate (PES=1e-4) * scale factor
- Formatted to pep8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant