jahuth / virtualretina

Bugfixes to the VirtualRetina Simulator of Adrien Wohrer
Other
7 stars 5 forks source link

where is CMakefiles.txt? #1

Open Thanh-Binh opened 7 years ago

Thanh-Binh commented 7 years ago

Could you pls upload this file for building your SW using CMake? Thanks

jahuth commented 7 years ago

Hello!

Thanks for pointing that out! I included the files and also found a few bugs where libraries did not download correctly. Let me know if the package compiles when you just run bash download_build_all.bash

I also included the tutorial.pdf in the repository.

Cheers! Jacob

Thanh-Binh commented 7 years ago

Hi Jacob, best thanks. In the meantime I found ENAS is currently using your SW. Is it correct? What is about the rune-time per image (I means frame per second)?

jahuth commented 7 years ago

The runtime of VirtualRetina depends on the size of the image and the speed of your CPU. On my PC (Intel Xeon 2.40GHz) the example files (160 x 128 pixel) need for 448 frames ~ 10 seconds (45fps), which is about 5x slower than real time (each frame is 5ms in the video). A 500x500 pixel image will take a lot longer (for me ~300ms per frame or about 3fps).

VirtualRetina was developed in the lab that is now working on ENAS/PRANAS. They are using a different version of this software, since they needed some additional features, but also include bug fixes from this repository. You can get their version from their website: https://pranas.inria.fr/

Also similar software (implementing the same model and having similar runtime) are COREM, which integrates into NEST, and my own reimplementation in the convis toolbox which uses python/theano to compile to the gpu, both of which can simplify the model - if you eg. do not need Contrast Gain Control - to run faster.

Thanh-Binh commented 7 years ago

thanks for your information. I am running your installation now.... In the mean time I want to ask you

  1. how can I use your SW for detecting any change in image?
  2. if your tool can generate a spiking like ENAS/PRANAS?
Thanh-Binh commented 7 years ago

I have got errors like: Installing xmlParameters++ locally (with CMake)


Entering External_Libraries/xmlParameters++-1.1.1 -- Configuring done -- Generating done -- Build files have been written to: /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1 Scanning dependencies of target xmlparameters++ [ 12%] Building CXX object CMakeFiles/xmlparameters++.dir/src/xmlparameters.cc.o In file included from /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters.h:330:0, from /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters.cc:1: /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters_template_code.h:163:85: error: redeclaration of ‘template<class XMLIZED, class XMLIZED_b> void xmlParam::add_init(XMLIZED&, void (XMLIZED_b::)(), bool)’ may not have default arguments [-fpermissive] dd_init (XMLIZED & object, void (XMLIZED_b::func)(), bool afterChildren=false) ^ /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters_template_code.h:170:112: error: redeclaration of ‘template<class XMLIZED, class XMLIZED_b, class ARGCLASS> void xmlParam::add_init(XMLIZED&, void (XMLIZED_b::)(ARGCLASS), ARGCLASS, bool)’ may not have default arguments [-fpermissive] void (XMLIZED_b::func)(ARGCLASS), ARGCLASS argument, bool afterChildren=false) ^ CMakeFiles/xmlparameters++.dir/build.make:62: recipe for target 'CMakeFiles/xmlparameters++.dir/src/xmlparameters.cc.o' failed make[2]: [CMakeFiles/xmlparameters++.dir/src/xmlparameters.cc.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmlparameters++.dir/all' failed make[1]: [CMakeFiles/xmlparameters++.dir/all] Error 2 Makefile:116: recipe for target 'all' failed make: [all] Error 2 [ 12%] Building CXX object CMakeFiles/xmlparameters++.dir/src/xmlparameters.cc.o In file included from /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters.h:330:0, from /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters.cc:1: /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters_template_code.h:163:85: error: redeclaration of ‘template<class XMLIZED, class XMLIZED_b> void xmlParam::add_init(XMLIZED&, void (XMLIZED_b::)(), bool)’ may not have default arguments [-fpermissive] dd_init (XMLIZED & object, void (XMLIZED_b::func)(), bool afterChildren=false) ^ /home/binh/Neuromorphics/virtualretina/virtualretina/External_Libraries/xmlParameters++-1.1.1/src/xmlparameters_template_code.h:170:112: error: redeclaration of ‘template<class XMLIZED, class XMLIZED_b, class ARGCLASS> void xmlParam::add_init(XMLIZED&, void (XMLIZED_b::)(ARGCLASS), ARGCLASS, bool)’ may not have default arguments [-fpermissive] void (XMLIZED_b::func)(ARGCLASS), ARGCLASS argument, bool afterChildren=false) ^ CMakeFiles/xmlparameters++.dir/build.make:62: recipe for target 'CMakeFiles/xmlparameters++.dir/src/xmlparameters.cc.o' failed make[2]: [CMakeFiles/xmlparameters++.dir/src/xmlparameters.cc.o] Error 1 CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/xmlparameters++.dir/all' failed make[1]: [CMakeFiles/xmlparameters++.dir/all] Error 2 Makefile:116: recipe for target 'all' failed make: [all] Error 2


Compiling and installing VirtualRetina (with CMake)


CMake Warning (dev) in CMakeLists.txt: Syntax Warning in cmake code at

/home/binh/Neuromorphics/virtualretina/virtualretina/VirtualRetina/CMakeLists.txt:209:86

Argument not separated from preceding token by whitespace. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:47 (LINK_DIRECTORIES): This command specifies the relative path

ext-lib-links/MvaSpike/lib

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the source dir. Run "cmake --help-policy CMP0015" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Warning (dev) at CMakeLists.txt:72 (LINK_DIRECTORIES): This command specifies the relative path

ext-lib-links/xmlParameters++/lib

as a link directory.

Policy CMP0015 is not set: link_directories() treats paths relative to the source dir. Run "cmake --help-policy CMP0015" for policy details. Use the cmake_policy command to set the policy and suppress this warning. This warning is for project developers. Use -Wno-dev to suppress it.

CMake Error at CMakeLists.txt:198 (MESSAGE): xmlParameters++ is not correctly installed. Make sure that: (1) It has been installed on your computer, (2) Link 'ext-lib-links/xmlParameters++' points to the installation directory of xmlParameters++.

CMake Error: The following variables are used in this project, but they are set to NOTFOUND. Please set them or make sure they are set and tested correctly in the CMake files: XMLPARAM_LIB linked by target "ReconstructRetina" in directory /home/binh/Neuromorphics/virtualretina/virtualretina/VirtualRetina/src/appli linked by target "Retina" in directory /home/binh/Neuromorphics/virtualretina/virtualretina/VirtualRetina/src/appli linked by target "shapleyVictor" in directory /home/binh/Neuromorphics/virtualretina/virtualretina/VirtualRetina/src/appli linked by target "TestGanglionCell" in directory /home/binh/Neuromorphics/virtualretina/virtualretina/VirtualRetina/src/appli

-- Configuring incomplete, errors occurred! See also "/home/binh/Neuromorphics/virtualretina/virtualretina/VirtualRetina/CMakeFiles/CMakeOutput.log".

jahuth commented 7 years ago

Hm, I will look into the xmlparameters++ issue. Can you tell me the version of cmake and the compiler you are using? (in your CMakeCache.txt there will be line like "CMAKE_CXX_COMPILER:FILEPATH=/usr/bin/c++", then run eg. "/usr/bin/c++ --version") And can you also tell me your operating system?

Also you will have to install libxml2-dev and libx11-dev through your package manager, if you haven't done so.

On your other points:

  1. "how can I use your SW for detecting any change in image?"

There are certainly more efficient ways to do this from a computer vision stand point, but in terms of a retina model this will simply be a very "transient" cell response which respond strongly to a temporal change, but respond little to none to a static image. VirtualRetina can be configured by providing an XML file (see the examples in the VirtualRetina/test/retina_files folder). The parameters that create transient responses are "opl-relative-weight" in the tag <linear-version> in <outer-plexiform-layer> and "relative-weight" in the <undershoot> tag further in <linear-version>. "relative-weight" in <undershoot> will temporally low pass filter the signal (which might be exactly what you want) while "opl-relative-weight" modulates the strength of the negative surround (which is offset in time, but mostly also has a spatial effect similar to an edge detector).

  1. "if your tool can generate a spiking like ENAS/PRANAS?"

Yes, VirtualRetina (as well as the other mentioned packages) will generate spikes as an output. The spikes are saved in a text file (spikes.spk) with the time of the spike and the number of the neuron. The positions of the corresponding neuron are saved in an xml file (retina.xml).

Thank you for trying to install it! Jacob

jahuth commented 7 years ago

I pushed a version that does not contain the default arguments and it still compiles for me. It is possible that your compiler is more strict. It is possible to set the -fpermissive cmake option and the code will compile, but I would like to avoid that and instead fix the problem. If you could pull and test the updated code I would be very grateful for that!

Cheers! Jacob

Thanh-Binh commented 7 years ago

I use CMake 3.5.1, gcc 5.4 and Ubuntu 16.04LTS, kernel 4.7

Thanh-Binh commented 7 years ago

no stricts with my laptop. I tested with -fpermissive but it does not help

Thanh-Binh commented 7 years ago

if I modified your header file xmlparameters_template_code.h at line 171, and do not use the function in line 164, it compiles well.. I do not know....why?

Thanh-Binh commented 7 years ago

Missing "-outD ." for run test in readme file: VirtualRetina/bin/Retina -ret test/retina_files/EXAMPLE_primate_ParvoMagno.xml test/sequences/walking_finland/finland.10* -r 8 -nS 8 -outD .

Thanh-Binh commented 7 years ago

Do you have count how sparse is generated spiking? Typically only 2% neurons are activated ...

jahuth commented 7 years ago

You commented out line 171? Yes, it's possible that this won't cause any problems since not all versions of the function are used. If it compiles for you, then that is good. Could you attach the file to a comment here or do a pull request?

About the firing rate: There are many parameters that can increase or decrease the firing rate. The easiest way to increase the firing rate is to decrease the attribute g-leak__Hz in <spiking-channel>, to make them fire less, increase g-leak__Hz to a higher value. Also you can increase the spontaneous firing rate by increasing sigma-V.

Thanh-Binh commented 7 years ago

I am not able to pull request ... so it is the changes in "xmlparameters_template_code.h" I did: at line 162: //template<typename XMLIZED, typename XMLIZED_b> //void add_init (XMLIZED & object, void (XMLIZED_b::*func)(), bool afterChildren=false) //{ // find_warn::functor_ref(object,afterChildren).push_back(InitFunctor::create(func)); //}

at line 171: //void add_init (XMLIZED & object, void (XMLIZED_b::func)(ARGCLASS), ARGCLASS argument, bool afterChildren=false) void add_init (XMLIZED & object, void (XMLIZED_b::func)(ARGCLASS), ARGCLASS argument, bool afterChildren)