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

Specifying encoders to an EnsembleArray as a non-distribution may cause config error to occur. #691

Closed
xchoo opened this issue Mar 19, 2015 · 1 comment

Comments

@xchoo
Copy link
Member

xchoo commented Mar 19, 2015

If the non-distribution encoders are provided to an EnsembleArray, there is a possibility that the following error will occur:

ValueError: n_neurons not yet initialized; cannot determine if shape is correct. Consider using a distribution instead.

This occurs when the config update line

self.config[nengo.Ensemble].update(ens_kwargs)

updates the encoders parameter in kwargs before it has done so for n_neurons.

@studywolf
Copy link
Collaborator

oh this came up for me the other day too. i wasn't using the config system but just trying to specify encoders not as a parameter but after.

@tbekolay tbekolay mentioned this issue Dec 12, 2016
9 tasks
tbekolay added a commit that referenced this issue Mar 29, 2017
This is essentially a no-op distribution that takes a set of
samples and provides them when the `samples` method is called.
It's intended to simplify situations in which a distribution or
samples could be provided by converting samples to a distribution.

The main place this happens is when passing `Ensemble` arguments
to the `EnsembleArray` constructor. Previously, a distribution had
to be provided, since the passed parameters are set as defaults
on the `EnsembleArray` network. Now, any samples passed in are
wrapped in the `Samples` distribution, which makes it possible to
pass in samples. Tests have been added to verify this.

Addresses #691 and #766.
adityagilra pushed a commit to adityagilra/nengo that referenced this issue Jun 21, 2017
This is essentially a no-op distribution that takes a set of
samples and provides them when the `samples` method is called.
It's intended to simplify situations in which a distribution or
samples could be provided by converting samples to a distribution.

The main place this happens is when passing `Ensemble` arguments
to the `EnsembleArray` constructor. Previously, a distribution had
to be provided, since the passed parameters are set as defaults
on the `EnsembleArray` network. Now, any samples passed in are
wrapped in the `Samples` distribution, which makes it possible to
pass in samples. Tests have been added to verify this.

Addresses nengo#691 and nengo#766.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

2 participants