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

TypeError: 'NoneType' object has no attribute '__getitem__' #973

Open
kfischl opened this issue Jun 7, 2018 · 0 comments
Open

TypeError: 'NoneType' object has no attribute '__getitem__' #973

kfischl opened this issue Jun 7, 2018 · 0 comments

Comments

@kfischl
Copy link

kfischl commented Jun 7, 2018

I am getting this error when I run the below file:

Starting nengo server accessible at:
  http://localhost:8080/?token=edd8e711b8187eb5f7003120f6284e45177c946ddd23acfe
('error processing message', 'u\'{"act":"feedforward_layout","uid":null}\'')
Traceback (most recent call last):
  File "/Applications/anaconda2/lib/python2.7/site-packages/nengo_gui/components/netgraph.py", line 407, in message
    self, **info)
  File "/Applications/anaconda2/lib/python2.7/site-packages/nengo_gui/user_action.py", line 22, in create_action
    return FeedforwardLayout(net_graph, **kwargs)
  File "/Applications/anaconda2/lib/python2.7/site-packages/nengo_gui/user_action.py", line 266, in __init__
    self.scale = self.net_graph.page.config[self.network].size[0]
TypeError: 'NoneType' object has no attribute '__getitem__'

file:

import nengo
import numpy as np

model = nengo.Network()
with model:
    
    # an N dimesional vector with low level features
    # teeth baring, eye contact, facial expression (threatening to passive),
    # tone (from animal you are watching, for humans could be tone of voice - maybe
    # indicates the agressiveness)
    input_stim_dim = 4
    low_stim= nengo.Node([input_stim_dim])
    
    # this is a 2 dimensional value that indicates the current emotional state
    # of this animal, the dimensions correspond to arousal and valence and take 
    # values from [-1,1]
    high_stim= nengo.Node([2])
    
    # a sparse representation of the input
    lateral = nengo.Ensemble(n_neurons=200,dimensions=input_stim_dim)
    
    # this nuclei stores the current emotional state which is two dimension
    # that are arousal and valence as well as the emotional state of the input,
    # as passed into it from the lateral nucleus
    basal = nengo.Ensemble(n_neurons=200,dimensions=4)
    
    # decides the physio reaction to have
    central = nengo.Ensemble(n_neurons=200,dimensions=1)
    
    PFC = nengo.Ensemble(n_neurons=200,dimensions=1)
    
    # an idenity equse repreatation, later maybe doing this sparsely
    nengo.Connection(low_stim,lateral)
    
    # this is also basically an identiy connection
    nengo.Connection(high_stim,PFC)
    
    nengo.Connection(PFC,basal)
    nengo.Connection(basal,PFC)
    
    # this calculates the emotional salency of the input
    # aka is the input scary? or what?
    # it returns the emotional state of the input
    def emotional_sal(t):
        return 0, 0

    # decides saliency - gives the emotional evaulation of what came into the system
    nengo.Connection(lateral, basal, function=emotional_sal)
    
    nengo.Connection(basal,central)
    
    # this connection determines which inputs are immediately important
    nengo.Connection(lateral,central)
    
    # this will be an N dimensional vector with the physiological reactions
    # HR, adreline, breathing rate, sweating
    phy_reaction = nengo.Node(None,size_in=5)
    
    # this is the emotional state 
    emotional_state = nengo.Node(None,size_in=2)
    
    # this function returns the new current emotional state based on the previous
    # emotional state (dims 0-1) and the calculated emotional value of the input (dims 2-3)
    def current_emotional_eval(t):
        return 0,0
    
    nengo.Connection(basal,high_output, function=current_emotional_eval)
    nengo.Connection(central,phy_reaction)
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

1 participant