{"action":"created","issue":{"url":"https://api.github.com/repos/nengo/nengo/issues/919","labels_url":"https://api.github.com/repos/nengo/nengo/issues/919/labels{/name}","comments_url":"https://api.github.com/repos/nengo/nengo/issues/919/comments","events_url":"https://api.github.com/repos/nengo/nengo/issues/919/events","html_url":"https://github.com/nengo/nengo/issues/919","id":120990756,"number":919,"title":"Integrate and Fire Neuron Model","user":{"login":"MarcoSaku","id":5323519,"avatar_url":"https://avatars.githubusercontent.com/u/5323519?v=3","gravatar_id":"","url":"https://api.github.com/users/MarcoSaku","html_url":"https://github.com/MarcoSaku","followers_url":"https://api.github.com/users/MarcoSaku/followers","following_url":"https://api.github.com/users/MarcoSaku/following{/other_user}","gists_url":"https://api.github.com/users/MarcoSaku/gists{/gist_id}","starred_url":"https://api.github.com/users/MarcoSaku/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MarcoSaku/subscriptions","organizations_url":"https://api.github.com/users/MarcoSaku/orgs","repos_url":"https://api.github.com/users/MarcoSaku/repos","events_url":"https://api.github.com/users/MarcoSaku/events{/privacy}","received_events_url":"https://api.github.com/users/MarcoSaku/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/nengo/nengo/labels/feature%20request","name":"feature request","color":"fef2c0"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2015-12-08T11:45:25Z","updated_at":"2016-01-19T16:58:52Z","closed_at":null,"body":"Hi all! I would ask if it is possible to integrate in nengo the Integrate-and-fire Neuron model (without leaky). I think that it is similar to LIF Neuron.\r\nAny help would be appreciated.\r\nRegards,\r\nMarco"},"comment":{"url":"https://api.github.com/repos/nengo/nengo/issues/comments/172917327","html_url":"https://github.com/nengo/nengo/issues/919#issuecomment-172917327","issue_url":"https://api.github.com/repos/nengo/nengo/issues/919","id":172917327,"user":{"login":"studywolf","id":2473097,"avatar_url":"https://avatars.githubusercontent.com/u/2473097?v=3","gravatar_id":"","url":"https://api.github.com/users/studywolf","html_url":"https://github.com/studywolf","followers_url":"https://api.github.com/users/studywolf/followers","following_url":"https://api.github.com/users/studywolf/following{/other_user}","gists_url":"https://api.github.com/users/studywolf/gists{/gist_id}","starred_url":"https://api.github.com/users/studywolf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/studywolf/subscriptions","organizations_url":"https://api.github.com/users/studywolf/orgs","repos_url":"https://api.github.com/users/studywolf/repos","events_url":"https://api.github.com/users/studywolf/events{/privacy}","received_events_url":"https://api.github.com/users/studywolf/received_events","type":"User","site_admin":false},"created_at":"2016-01-19T16:58:51Z","updated_at":"2016-01-19T16:58:51Z","body":"Hi Marco, \r\n\r\nyup, you also need to take into account the encoders. The output of the node is in vector space, and on a connection to an ensemble to transform from a vector space signal to voltage you dot product with the encoder, then multiply by the gain, then add the bias to get J. \r\n\r\n```J = np.dot(x, encoders)*gain + bias```\r\n\r\nSo you can also set those to be 1 with \r\n```\r\nneurons.encoders = np.ones((neurons.n_neurons, 1))\r\n```\r\nor you can avoid the encoders by connecting your input directly to the neurons with \r\n```\r\nnode_in = nengo.Node(output=np.ones(neurons.n_neurons))\r\nnengo.Connection(node_in, neurons.neurons, synapse=None)\r\n```\r\n\r\nAlso, as @hunse mentioned, you want to have a high ```tau_rc``` value. So you can get what you want with\r\n```\r\nimport nengo\r\nimport numpy as np\r\n\r\nmodel = nengo.Network(label='Two Neurons')\r\nwith model:\r\n    neurons = nengo.Ensemble(n_neurons=2, dimensions=1)\r\n    neurons.neuron_type=nengo.LIF(tau_rc=1e10)\r\n\r\n    node_in = nengo.Node(output=np.ones(neurons.n_neurons))\r\n    nengo.Connection(node_in, neurons.neurons,synapse=None)\r\n\r\n    in_probe = nengo.Probe(node_in)  # The original input\r\n    spikes = nengo.Probe(neurons.neurons)  # Raw spikes from each neuron\r\n    voltage = nengo.Probe(neurons.neurons, 'voltage')  # Subthreshold soma voltages of the neurons\r\n\r\nsim = nengo.Simulator(model, dt=.0001)  # Create a simulator\r\nprint 'Run Network'\r\nsim.run(.01) \r\n```\r\n\r\nwhich gives me\r\n\r\n![image](https://cloud.githubusercontent.com/assets/2473097/12425671/e57ac3ba-bea3-11e5-8403-2afe8598b91b.png)\r\n"}}