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

Need some intuition just output few schematic point variable in one plot #1033

Open
Runnlion opened this issue Dec 1, 2020 · 1 comment
Open

Comments

@Runnlion
Copy link

Runnlion commented Dec 1, 2020

When I reimplement a github project "spa-poem" , I don't konw how to output a graph just contain few variables.
The output graph has the enatirly schematic vocabularies.

I want a graph with few variables we want

I considered to run it in juypter and set the vocabulary value like "SNAKE", but I dont konw how to set the value of a nengo_spa.model_name

Thanks

@xchoo
Copy link
Member

xchoo commented Dec 7, 2020

In the NengoGUI, you can specify what vocabulary to use for a Semantic Pointer cloud display by specifying the vocabulary to use with a specific spa component. For example, in the code below, both state1 and state2 represent identical information (you can see from the vector graphs that the vector represented by both components are the identical), the semantic pointer cloud display is different. The state1 semantic pointer cloud only shows "A", while the state2 semantic pointer cloud shows both "A" and "C".

The Code:

import nengo
import nengo_spa as spa

dim = 32
vocab = spa.Vocabulary(dimensions=dim)
vocab.populate("A;B;C;D;E")
vocab2 = vocab.create_subset(["A", "B"])

with spa.Network() as model:
    stim = spa.Transcode("A+C", output_vocab=vocab)
    state1 = spa.State(vocab=vocab2, seed=0)  # Using the custom (smaller) vocabulary
    state2 = spa.State(vocab=vocab, seed=0)  # Using the "default" vocabulary
    nengo.Connection(stim.output, state1.input)
    nengo.Connection(state1.output, state2.input)

Sample output from NengoGUI
image

Some notes:
Just to prove that no information is lost, the output of state1 is connected to the input of state2. If information had been lost by changing the the vocabulary of state1, the output of state2 would reflect state1 (i.e., just "A", instead of "A" and "C").

Additionally, note that Nengo has a dedicated support forum, found at https://forum.nengo.ai . It provides a wealth of resources for you to search to related to all of the Nengo products (e.g., Nengo, NengoGUI, Nengo Loihi, etc.).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

2 participants