Posts about python (old posts, page 1)

2014-06-18 [Stage M1] Chloé Pasturel : week 5

Loi de Von mises :

La densité est définie sur $[0, 2\pi[$ par $ f(x) = \frac {e^{\kappa cos(\theta - m)}}{2 \pi I_{0}(\kappa)} ~$
avec $~ \kappa = \frac {1}{\sigma^{2}} $

L'orientation est définie sur $[0, \pi[$ par un remplaçant de la variable $~ (\theta_d - m) ~$ par $~ 2(\theta_o - m)$

nous obtenons alors la densité pour $\theta_o$: $ f(x) = \frac{1}{2 \pi I_{0}(\kappa)} \cdot {e^{\frac{cos(2(\theta - m))}{\sigma^{2}}}}$ et $~ p = \frac {1} {2\pi \sigma_1 \sigma_2} \cdot e^{- 2 \frac{(m_2-m_1)^{2}}{\sigma_{1}^{2} + \sigma_{2}^{2}}}$

car avec le changement de variable : $ \varepsilon(x) = \frac {1} {\sigma_{1} \sqrt{2\pi}} \cdot e^{\frac {-(2(x-m_{1}))^{2}} {2\sigma_{1}^{2}}} $ et $\gamma (x) = \frac {1} {\sigma_2 \sqrt{2\pi}} \cdot e^{\frac {-(2(x-m_2))^{2}} {2\sigma_{2}^{2}}} $

donc $\varepsilon(x) \cdot \gamma(x) = \frac {1}{2\pi \sigma_{1} \sigma_{2}} \cdot e^{-2(\frac {(x-m_{1})^{2}}{\sigma_{1}^{2}} + \frac{(x-m_{2})^{2}}{\sigma_{2}^{2}})} = \frac {1} {2\pi \sigma_1 \sigma_2} \cdot e^{- 2 \frac{(m_2-m_1)^{2}}{\sigma_{1}^{2} + \sigma_{2}^{2}}}$

Read more…

2014-06-18 [Stage M1] Chloé Pasturel : week 3

Travail sur les Motion Clouds et observation des différents changement de paramètre particulièrement B_sf

  • introduction aux motions clouds: installation et display dans un notebook
  • synthèse de clouds avec différents theta
  • synthèse avec différents B_theta (V=0)
  • utilisation du trick dans http://motionclouds.invibe.net/posts/smooth-transition-between-mcs.html pour créer un stimulus pour lequel l'orientation tourne de 0 à 2*pi
  • proposer une façon simple de passer de ce signal à une entré pour le ring (un peu de maths? un MC est une texture définie en fourier, une cellule simple fait une convolution dans l'espace, donc une multiplication dans Fourier: on pourrait avoir la sortie linéaire du neurone de V1 directement ...)

http://neuralensemble.github.io/MotionClouds/

http://invibe.net/LaurentPerrinet/TagMotionClouds

Read more…

2014-06-18 [Stage M1] Chloé Pasturel : week 1

  • définition du sujet - lecture Hansel
  • mise en place du python notebook
  • demos de brian

installation des outils

  1. virtual box
  2. VM ubuntu
  3. <<< guest additions + clone
  4. neurodebian
    wget -O- http://neuro.debian.net/lists/trusty.de-md.full | sudo tee /etc/apt/sources.list.d/neurodebian.sources.list
    sudo apt-key adv --recv-keys --keyserver pgp.mit.edu 2649A5A9
    sudo apt-get update
  1. install on ubuntu
sudo apt-get install aptitude
sudo aptitude install ipython-notebook
sudo aptitude install python-matplotlib
sudo aptitude install python-brian 
sudo aptitude install texlive-full


sudo aptitude install python-pynn 
pip install --user neurotools

2014-01-15 Vim folding commands

Using folds in Vim

Folds are useful when having long files to have a good perspective on its structure. Especially useful in LaTeX mode.

To install, I recommend using the python-mode described in http://unlogic.co.uk/2013/02/08/vim-as-a-python-ide/

The magical shortcut all begin with z. Type :hep fold to learn more about them.

These are the most common shortcuts in my personal order of preference.

  • zo opens a fold at the cursor.
  • zc closes a fold at the cursor.
  • zM closes all open folds.
  • zO opens all folds at the cursor.
  • [z move to start of open fold.
  • ]z move to end of open fold.
  • zj moves the cursor to the next fold.
  • zk moves the cursor to the previous fold.
  • zf#j creates a fold from the cursor down # lines.
  • zf/string creates a fold from the cursor to string .
  • zm increases the foldlevel by one.
  • zr decreases the foldlevel by one.
  • zR decreases the foldlevel to zero -- all folds will be open.
  • zd deletes the fold at the cursor.
  • zE deletes all folds.

2014-01-04 Bootstrapping Nikola

Nikola Tesla Corner by nicwest, on Flickr

I have managed to install Nikola, and build a site using it using this code:

install-nikola.sh (Source)

git clone git://github.com/getnikola/nikola.git
cd nikola
pip install -r requirements-full.txt
pip install .
nikola init --demo invibe
nikola build
nikola serve

Pretty simple, congratulations to the developpers!

More info:

2010-06-24 installing SUMATRA

installing SUMATRA

2010-06-24 13:36:57
  • notes from the CodeJamNr4
  • this was using a fresh install of ETS 6.2

dependencies

  • pysvn :
    • had to uninstall stuff from MacPorts
      sudo port uninstall --follow-dependents subversion
    • get pysvn
      • make :
        cd Source
        python setup.py backport
        Create the Makefile using python setup.py configure
        make
    • install
      sudo rsync -av pysvn /Library/Frameworks/Python.framework/Versions/6.2/lib/python2.6/site-packages/
      • pysvn 1.7.1 worked for me
  • mercurial
    sudo easy_install mercurial
  • django
    sudo easy_install django django_tagging

with hg

525  svn export ../sci/dyva/Motion/particles hg_particles
526  cd hg_particles/
527  hg init
528  hg add MotionParticles.py experiment_all.py
529  hg commit
530  hg commit -m 'test'
531  echo $USER
532  vim .hgrc
533  vim ~/.hgrc
534  hg commit -m 'my first HG commit'
535  vim ~/.hgrc
536  ipython
537  ls
538  smt init sumatraTest_hg
539  smt info

with svn

 501  cd sci/dyva/Motion/particles/
 502  smt init -h
 503  smt init sumatraTest
 504  smt info
511  smt configure --simulator=python --main=experiment_all.py
 512  smt info
 513  smtweb &
 514  ls -a
 515  rm -fr .smt
 516  smt init sumatraTest
 517  smtweb &
 518  open experiment_all.py
 519  touch fake.param
 520  smt run
 521  smt run -s python -m experiment_dot.py fake.param
 522  smt info
 523  smt configure -h
 524  smt configure -c diff
 525  smt info
 526  smt run -s python -m experiment_dot.py fake.param
 529  smt run -s python -m experiment_dot.py fake.param
 534  rm mat/dot.npy
 535  python experiment_dot.py fake.param
 536  ls
 537  smt help configure
 538  smt configure -d ./figures/
 539  smt info
 540  smt configure -s python -m experiment_dot.py
 541  smt run fake.param
 542  rm mat/dot.npy
 543  smt run fake.param
 544  ls figures/
 545  rm figures/dot_*
 546  smt run fake.param
 547  smt info
 548  smt configure -d ./figures
 549  smt info
 550  rm figures/dot_*png
 551  smt configure -d ./figures
 552  smt run fake.param
 553  smt comment "apparently, it is worth NaN shekels."
 554  smt tag codejam
 558  rm figures/dot_*png
 559  rm mat/dot.npy
 560  smt run --reason="test effect of a bigger dot" fake.param dot_size=0.1
 561  ls
 562  ls -al .smt/
 563  less .smt/simulation_records
 564  sqlite3 .smt/simulation_records