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

TEST add-nest-example-scripts #802

Open
wants to merge 8 commits into
base: master
Choose a base branch
from

Conversation

HarshKhilawala
Copy link

@HarshKhilawala HarshKhilawala commented Jun 7, 2024

Balanced Neuron Example
IAF neuron example with current generator

Resultant inhibitory frequency differs from NEST example for Balanced Neuron Example

@HarshKhilawala HarshKhilawala changed the title TEST add-balanced-neuron TEST add-example-scripts Jun 10, 2024
@HarshKhilawala HarshKhilawala changed the title TEST add-example-scripts TEST add-nest-example-scripts Jun 10, 2024
@HarshKhilawala
Copy link
Author

@apdavison Added another script as per this: Link

@coveralls
Copy link

Coverage Status

coverage: 63.264% (-0.07%) from 63.329%
when pulling 56362b0 on HarshKhilawala:test-add-balanced-neuron
into 1a1ce5c on NeuralEnsemble:master.

Copy link
Member

@apdavison apdavison left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The comments from #801 also apply to the additional examples here:

  • All example scripts should work with the nest, neuron and brian2 backends.
  • The backend to use should be specified on the command line, and retrieved using the get_simulator() function from pyNN.utility. See examples/small_network.py for an example of this.
  • Use save(figure_filename) instead of show()
  • The top-level docstring should follow the example in examples/small_network.py

def output_rate(spec_dict, guess):

newsim = testpynn.nest
newsim.setup(timestep=0.1)
Copy link
Member

@apdavison apdavison Jun 18, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest moving the network creation outside the function, as is done in the PyNEST implementation. Inside the function, you just need to change the input rate, use sim.run(...), then neuron.get_data(clear=True) (the clear=True argument removes the data from the population after you've retrieved them)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@apdavison 'sim.reset()' doesn't work with NEST. This was one of the primary reason as to implement inside the function call.

Sim.run() will continue the simulation from previous checkpoint which is opposite to what I desired for.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For balanced_neuron_example, my results still differ from native NEST example? Is it fine? Is it due to the core implementation being reason for two different resultant value?

@HarshKhilawala
Copy link
Author

@apdavison So for one_neuron example, do you mean I develop three separate scripts each for 3 simulators? But Isn't this example a native NEST example?

If that is something you meant, Do I need to go through simple network example from each simulator and then implement script to support each of these simulators?

While adding examples to PyNN was just an approach to get familiarity with PyNN, if this is the case, I may not be able to complete the Primary Project which was to add e-props support to PyNN.

Would you please clarify a bit as I might have misunderstood?

@HarshKhilawala
Copy link
Author

I just updated one_neuron_example.py as per your suggestion. Can you please confirm if it is 'merge ready example'? Is this what you meant when you said to have support for 3 backends?

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

Successfully merging this pull request may close these issues.

3 participants