Posts about sciblog (old posts, page 4)

2010-09-03 A neurocentric approach to Bayesian inference

2010-09-03 08:34:14
  • one-page paper arguing that Friston's free-energy view may not be complete. Some points made are
    1. the inversion operated assumes a generative model
    2. the use of surprise is defined using a frequentist approach not informational
      • one idea : from the frequentist measure one one can derive a conditional probability (a Xhi-2 distribution) of the probability. Not very far to the idea of Sahani & Dayan of a double probabilistic distribution
    3. explore surprise or avoid it: Fiorillo makes here a confusion of time scales. On the long term (learning) one tends to avoid surprise, on the short term (coding) this implies one jumps one surprise.
    4. points to his PLoS one paper: Fiorillo, C. D. Towards a general theory of neural computation based on prediction by single neurons. PLoS ONE 3, e3298 (2008)
  • once again, people love bipolarity: frequentists against probabilists, top-down vs. bottom-up, neurocentric vs global. neurons, areas, brains, groups of brains just don't care and evolve. it is our description that can be multiple. does a single one ("unified theory") exists iun today's language? at least I am convinced that (over generations) neurons adapt to behavior not the inverse, thus that if one has to seek for an information measure, it is certainly not in a ion's channel dynamic only.
  • the answer of Friston goes into that direction / correctly defines surprise / nice figure showing how one can learn "to be a Lorenz attractor" (certainly assuming a generative model of dynamics)
  • the open question is rather "how is the free-energy principle encoded in the brain's architecture and dynamics?"


  • Christopher D. Fiorillo. A neurocentric approach to Bayesian inference, URL . Nature Reviews Neuroscience, 11(8):605, 2010

    A primary function of the brain is to infer the state of the world in order to determine which motor behaviours will best promote adaptive fitness. Bayesian probability theory formally describes how rational inferences ought to be made, and it has been used with great success in recent years to explain a range of perceptual and sensorimotor phenomena1, 2, 3, 4, 5. .

  • Karl Friston. Is the free-energy principle neurocentric?, URL . Nature Reviews Neuroscience, 11(8):605, 2010

    Recently, a free-energy formulation of brain function was reviewed in relation to several other neurobiological theories (The free-energy principle: a unified brain theory? Nature Rev. Neurosci. 11, 127–138 (2010) .

2010-08-31 managing packages on MacOsX : testing HomeBrew

2010-08-31 09:11:31
  • a newcomer after fink and MacPorts:
  • advertised here
  • install
     $ ruby -e "$(curl -fsS"
    ==> This script will install:
    Press enter to continue
    ==> Downloading and Installing Homebrew...
    ==> Installation successful!
  • fix permissions
    $ sudo chown -R `whoami` /usr/local
  • to install python specific stuff, use pip:
    brew install pip
    echo '[install]
    install-data=/usr/local/Cellar/PyPi/2.6/share' > ~/.pydistutils.cfg
    pip install ipython
  • this is with the exception of numpy + scipy, the latter needing
    cd tmp
    svn co numpy
    pip install numpy
    brew install suite-sparse
    svn co scipy
    pip install scipy

2010-08-30 shortcuts

2010-08-31 09:35:58
  • from
    To make Ctrl← and Ctrl→  useful again, that is going a word forward or backward like they usually do on Linux, you must make send the right string to the shell. In the preferences, go to the Settings tab and select your default profile. Go to Keyboard and set control cursor left and control cursor right to send string \033b and \033f respectively.
    While your're at it, you can also fix Home (\033[H), End (\033[F), Page Up (\033[5~) and Page Down (\033[6~) so that they send those keys to the shell instead of scrolling the buffer.

2010-08-11 getting the PID from matlab

2010-08-11 07:45:20
  • I need the pid to know if one of the many simulations I run are still running. There's no native solution in matlab to my knowledge.
  • using hint @
  • create getpid.c with
    1 #include "mex.h"
    2 #include <unistd.h>
    3 mexFunction(int nlhs, mxArray *plhs[ ], int nrhs, const mxArray *prhs[ ])
    4 {
    5   plhs[0] = mxCreateDoubleScalar((double) getpid());
    6 }
  • compile with mex getpid.c 
  • use in matlab as pid = getpid()
  • this is part of the package in SparseHebbianLearning

2010-08-09 running embarassingly parallel simulations on a multicore machine using bash loops

2010-08-11 11:33:50
  • I need to run a single-processor experiment on some parameters, say N times
  • embarassingly parallel: python scans all these parameters:
    1 for i in range(N):
    2     if experiment[i] is not finished and not locked:
    3         lock(experiment[i])
    4         run(experiment[i])
  • to run this on 8 cores, bash is your friend (may also apply to *sh where * is either z, c, tc, ...)
    for i in {1..8}; do cd /data/work/ && python  & done
  • however, runnning them simultaneously may cause problems if the locking mechanism is not fast enough, so I introduce a random jitter
    for i in {1..8}; do cd /data/work/ && sleep 0.$(( RANDOM%1000 )) ; python  & done

2010-08-07 distributed computing

2010-08-07 13:42:38
  • guess you have a bunch (4000) of embarrassingly parallel tasks (one hour each) and access to about 40 CPUs through SSH. All tasks would run easily on each node, and they all share some network drive (NFS). Would be nice to run everything from just one place (script, command-line, web interface, ...)

a bunch of existing tools

what we can do

2010-08-05 Pinna illusion

2010-08-05 15:32:20
  • from :
    Pinna illusion is the first visual illusion showing a rotating motion effect. In Figure 1  the squares, delineated by two white and two black edges each, are grouped by proximity in two concentric rings. All the squares have the same width, length, and orientation in relation to the center of their circular arrangements. The two rings differ only in the relative position of their narrow black and white edges forming the vertexes. More precisely, the two rings show reversal of the vertex orientation and, consequently, opposite inclination of the virtual or implicit diagonal orientation polarity obtained by joining the two vertexes where black and white lines meet (Pinna, 1990; Pinna & Brelstaff, 2000).
  • related to the aperture problem
    The Pinna illusion and the related effects represent an opportunity within the context of vision science and cognitive neuroscience  (Gazzaniga, 2004; Purves & Lotto, 2003). If the task of a sensory system is to provide a faithful representation of biologically relevant events in the external world, the previous phenomena show that visual perception  contrives, through complex neural computations, to create informative and efficient representations of the external environment. These representations are at the same time simpler and richer than the raw signals transduced by receptors. They are simpler because they simplify the enormous quantity of raw measurement information submitted to the central nervous system (see Section 2). They are richer because they contain properties of events and objects abstracted from the primitive sensory signals (see Sections 3 and 4). Therefore, the first opportunity suggested by the previous effects concerns the basic encoding of the features of the stimuli, i.e. the nature and meanings of the signals carried by single neurons, the maps and areas where they operate (see Section 2) and the pattern of motion of objects, surfaces, and edges in a visual scene due to the relative motion between an observer and the scene (optical flow, Gibson, 1979). Furthermore, they are good tests to understand the perceptual context within which a specific element is perceived, namely “what is ‘figure and what is ‘background”, “how separated elements of a visual event are combined and organized in a sensory representation” (see Section 4).
  • windmill illusion. link to the waghon-wheel illusion?

2010-08-03 compiling OpenCV on MacOSX 10.6

2010-08-03 12:14:29

using macports

  • it works now with macports:
    sudo port install -u opencv +python26 +tbb

latest SVN

  • compiling here along with MacTex...
  • from
    svn co
    cd opencv # the directory containing INSTALL, CMakeLists.txt etc.
    mkdir build
    cd build
    cmake -D CMAKE_OSX_ARCHITECTURES=x86_64 -D WITH_FFMPEG=ON -D BUILD_EXAMPLES=ON -D BUILD_LATEX_DOCS=ON -D PDFLATEX_COMPILER=/usr/texbin/pdflatex -D BUILD_NEW_PYTHON_SUPPORT=ON  -D PYTHON_LIBRARY=/opt/local/lib/libpython2.6.dylib -D PYTHON_INCLUDE_DIR=/opt/local/Library/Frameworks/Python.framework/Headers ..
    make -j4
    sudo make install
  • I had to rebuild some ports
    sudo port install ilmbase
    port provides /opt/local/lib/libIlmImf.dylib
    sudo port install openexr
    sudo port install libdc1394

    and recompile

  • then could run
    cd ../samples/python/

using homebrew

  • another route is homebrew: / :
    $ brew info opencv
    opencv 2.1.1-pre
    Depends on: cmake, pkg-config, libtiff, jasper, tbb
    /usr/local/Cellar/opencv/2.1.1-pre (96 files, 37M)
    The OpenCV Python module will not work until you edit your PYTHONPATH like so:
      export PYTHONPATH="/usr/local/lib/python2.6/site-packages/:$PYTHONPATH"
    To make this permanent, put it in your shell's profile (e.g. ~/.profile).