{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo/issues/783","labels_url":"https://api.github.com/repos/nengo/nengo/issues/783/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo/issues/783/comments","events_url":"https://api.github.com/repos/nengo/nengo/issues/783/events","html_url":"https://github.com/nengo/nengo/issues/783","id":94385673,"number":783,"title":"Associative memory breaks with vector vocab","user":{"login":"hunse","id":1952250,"avatar_url":"https://avatars.githubusercontent.com/u/1952250?v=3","gravatar_id":"","url":"https://api.github.com/users/hunse","html_url":"https://github.com/hunse","followers_url":"https://api.github.com/users/hunse/followers","following_url":"https://api.github.com/users/hunse/following{/other_user}","gists_url":"https://api.github.com/users/hunse/gists{/gist_id}","starred_url":"https://api.github.com/users/hunse/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hunse/subscriptions","organizations_url":"https://api.github.com/users/hunse/orgs","repos_url":"https://api.github.com/users/hunse/repos","events_url":"https://api.github.com/users/hunse/events{/privacy}","received_events_url":"https://api.github.com/users/hunse/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-07-10T20:31:08Z","updated_at":"2015-07-10T20:50:56Z","closed_at":null,"body":"```python\r\nimport nengo\r\nimport nengo.spa as spa\r\nimport numpy as np\r\n\r\nupper = lambda x: map(lambda y: y.upper(), x)\r\n\r\nnames = upper(['John', 'Susan', 'Mary', 'Bob', 'Greg', 'Diane'])\r\nother = upper(['foo', 'bar'])\r\nwords = names + other\r\n\r\nmodel = spa.SPA(seed=9)\r\nd = 32\r\n\r\nwith model:\r\n    vocab = spa.Vocabulary(d, unitary=True, rng=np.random.RandomState(3))\r\n    model._default_vocabs[d] = vocab\r\n\r\n    for word in words:\r\n        vocab.parse(word.upper())  # parsing adds the word\r\n\r\n    subject_vocab = vocab.create_subset(names)\r\n    print(len(subject_vocab.vectors))\r\n\r\n    model.state = spa.Buffer(d)\r\n\r\n    model.input = spa.Buffer(d)\r\n\r\n    # model.name = spa.Buffer(d)\r\n    # model.name = spa.AssociativeMemory(subject_vocab)\r\n    model.name = spa.AssociativeMemory(subject_vocab.vectors)\r\n\r\n    actions = spa.Actions(\r\n        'dot(state, START) --> name = input',\r\n    )\r\n\r\n    model.bg = spa.BasalGanglia(actions=actions)\r\n    model.thal = spa.Thalamus(model.bg)\r\n\r\n    cortical_actions = spa.Actions(\r\n        'state = START',\r\n        'input = JOHN',\r\n        )\r\n    model.cortical = spa.Cortical(cortical_actions)\r\n\r\n    print(len(subject_vocab.vectors))\r\n```\r\nThe above script fails with error \r\n\r\n    NameError: Left-hand module ' name ' from effect ' name = input' is not defined.\r\n\r\nAlso, if I use the vocab instead of the vectors (see the commented out line), then new vectors get added to  `subject_vocab`, which is unexpected."},"comment":{"url":"https://api.github.com/repos/nengo/nengo/issues/comments/120521197","html_url":"https://github.com/nengo/nengo/issues/783#issuecomment-120521197","issue_url":"https://api.github.com/repos/nengo/nengo/issues/783","id":120521197,"user":{"login":"jgosmann","id":850157,"avatar_url":"https://avatars.githubusercontent.com/u/850157?v=3","gravatar_id":"","url":"https://api.github.com/users/jgosmann","html_url":"https://github.com/jgosmann","followers_url":"https://api.github.com/users/jgosmann/followers","following_url":"https://api.github.com/users/jgosmann/following{/other_user}","gists_url":"https://api.github.com/users/jgosmann/gists{/gist_id}","starred_url":"https://api.github.com/users/jgosmann/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jgosmann/subscriptions","organizations_url":"https://api.github.com/users/jgosmann/orgs","repos_url":"https://api.github.com/users/jgosmann/repos","events_url":"https://api.github.com/users/jgosmann/events{/privacy}","received_events_url":"https://api.github.com/users/jgosmann/received_events","type":"User","site_admin":false},"created_at":"2015-07-10T20:50:56Z","updated_at":"2015-07-10T20:50:56Z","body":"> Also, if I use the vocab instead of the vectors (see the commented out line), then new vectors get added to subject_vocab, which is unexpected.\r\n\r\nCompare #731, #696, #699 "}}