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

Add gamma kernel in topology #823

Merged
merged 4 commits into from Apr 18, 2018

Conversation

Projects
None yet
4 participants
@babsey
Contributor

babsey commented Sep 8, 2017

The purpose of this PR is to implement gamma kernel in topology (See #809).

@heplesser

@babsey This looks nice, thank you! I added some small suggestions below. Could you create a test using this parameter?

Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated topology/topology_parameter.h
@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Oct 30, 2017

Contributor

@babsey Have you had a chance to look at the review comments and the problems occurring on Travis?

Contributor

heplesser commented Oct 30, 2017

@babsey Have you had a chance to look at the review comments and the problems occurring on Travis?

@hakonsbm

The code looks mostly good to me, once the points by @heplesser has been addressed. However, see my comments about the problems occurring on Travis.

Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated topology/topology_parameter.h
@babsey

This comment has been minimized.

Show comment
Hide comment
@babsey

babsey Dec 4, 2017

Contributor

Here, the updated code and test suite for Gamma kernel in topology. Note that I am not quite skilled to write in C++ but I tried to modify codes according to @heplesser points.

Parts of equation is pre-computed in the constructor for better efficiency. I also implemented factorial function but in comment in case we want to compile it without GSL. I apologize that I am not aware of Travis testing and failed to find the source of the error.

For testing suite in pynest, I implemented the python code to compare the connection distributions with Gamma PDF. Here, I do not understand why NEST connect neurons in Gamma shaped manner for kappa + 1 (See the visual comparision).

Contributor

babsey commented Dec 4, 2017

Here, the updated code and test suite for Gamma kernel in topology. Note that I am not quite skilled to write in C++ but I tried to modify codes according to @heplesser points.

Parts of equation is pre-computed in the constructor for better efficiency. I also implemented factorial function but in comment in case we want to compile it without GSL. I apologize that I am not aware of Travis testing and failed to find the source of the error.

For testing suite in pynest, I implemented the python code to compare the connection distributions with Gamma PDF. Here, I do not understand why NEST connect neurons in Gamma shaped manner for kappa + 1 (See the visual comparision).

@babsey

This comment has been minimized.

Show comment
Hide comment
@babsey

babsey Dec 4, 2017

Contributor

Looking at log in Travis I found that this line (3922) probably indicates fails in Travis:
../topology/libtopology.so: undefined reference to "gsl_sf_gamma"

Contributor

babsey commented Dec 4, 2017

Looking at log in Travis I found that this line (3922) probably indicates fails in Travis:
../topology/libtopology.so: undefined reference to "gsl_sf_gamma"

@hakonsbm

This comment has been minimized.

Show comment
Hide comment
@hakonsbm

hakonsbm Dec 5, 2017

Contributor

@babsey Yes, you are right. When NEST is compiled without support for GSL, functions from that library, such as gsl_sf_gamma() that's being used in the GammaParameter-class, are unavailable. As I pointed out in my review, you need to use an #ifdef HAVE_GSL directive, which will tell the compiler to use a block of code only if NEST is compiled with GSL. That way, if there is no GSL support, you can either make the whole class unavailable, or you can implement an alternative way to do the calculation.

Additionally, line 60 and line 97 in test_topology_gamma_kernel.py are too long.

Contributor

hakonsbm commented Dec 5, 2017

@babsey Yes, you are right. When NEST is compiled without support for GSL, functions from that library, such as gsl_sf_gamma() that's being used in the GammaParameter-class, are unavailable. As I pointed out in my review, you need to use an #ifdef HAVE_GSL directive, which will tell the compiler to use a block of code only if NEST is compiled with GSL. That way, if there is no GSL support, you can either make the whole class unavailable, or you can implement an alternative way to do the calculation.

Additionally, line 60 and line 97 in test_topology_gamma_kernel.py are too long.

@heplesser heplesser added this to the NEST 2.16 milestone Mar 19, 2018

@heplesser

@babsey This looks quite fine now, but see my detailed comments. I do not understand your comment in the discussion from 4 Dec 2017, where you write "Here, I do not understand why NEST connect neurons in Gamma shaped manner for kappa + 1 (See the visual comparision)." Is this still relevant? If so, could you explain it?

Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated topology/topology_parameter.h
Show outdated Hide outdated pynest/nest/tests/test_topology_gamma_kernel.py

heplesser and others added some commits Apr 17, 2018

Merge pull request #1 from heplesser/Babsey_Topology_gamma_kernel
Revisions to the gamma parameter code
@heplesser

This comment has been minimized.

Show comment
Hide comment
@heplesser

heplesser Apr 18, 2018

Contributor

@hakonsbm Could you take another look?

Contributor

heplesser commented Apr 18, 2018

@hakonsbm Could you take another look?

@heplesser heplesser merged commit 9df6352 into nest:master Apr 18, 2018

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@babsey babsey deleted the babsey:Topology_gamma_kernel branch Apr 18, 2018

heplesser added a commit that referenced this pull request Apr 19, 2018

Merge pull request #929 from heplesser/spatial_kernel_test
Added test for spatial kernels in topology (depends on #823).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment