Auryn simulator

Simulator for spiking neural networks with synaptic plasticity

User Tools

Site Tools


manual:wmat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revisionBoth sides next revision
manual:wmat [2013/11/01 15:40] – Added a headline zenkemanual:wmat [2014/10/15 14:27] – Adds Matrix Market on Python description. zenke
Line 24: Line 24:
  
 **Nota bene:** Cells in the wmat file are  indexed starting from 1 (unlike everywhere else in Auryn, where we adapt the C convention and start numbering arrays with 0). **Nota bene:** Cells in the wmat file are  indexed starting from 1 (unlike everywhere else in Auryn, where we adapt the C convention and start numbering arrays with 0).
 +
 +
 +===== Loading Matrix Market files in Python for analysis =====
 +
 +In Python Auryn's wmat files can be loaded or saved using existing SciPy functionality ([[http://docs.scipy.org/doc/scipy/reference/io.html]]). To load the output file ''output.wmat'' in Python it is sufficient to invoke the following code:
 +
 +<code python>
 +from scipy.io import mmread
 +
 +A = mmread('output.wmat')
 +</code>
 +''A'' now contains the Auryn output weight matrix ''output.wmat'' as a sparse matrix for further processing.
 +
 +Likewise, a structured matrix can be prepared in Python and then be loaded in Auryn. To do so, use code along the lines of the following snipped:
 +<code python>
 +from scipy.io import mmwrite
 +
 +# code which generates the matrix A
 +
 +sw = csr_matrix(A) # ensures row major format in COO output
 +mmwrite('save.wmat',sw)
 +</code>
  
manual/wmat.txt · Last modified: 2014/12/02 10:03 by zenke