manual:wmat
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
manual:wmat [2013/11/01 15:28] – Adds nota bene on indexing starting from 1 zenke | manual:wmat [2014/10/15 14:27] – Adds Matrix Market on Python description. zenke | ||
---|---|---|---|
Line 1: | Line 1: | ||
'' | '' | ||
+ | See also [[SparseConnection]]. | ||
+ | |||
+ | ====== File structure ====== | ||
The header of a typical weight matrix looks the following: | The header of a typical weight matrix looks the following: | ||
Line 21: | 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' | ||
+ | |||
+ | <code python> | ||
+ | from scipy.io import mmread | ||
+ | |||
+ | A = mmread(' | ||
+ | </ | ||
+ | '' | ||
+ | |||
+ | 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(' | ||
+ | </ | ||
manual/wmat.txt · Last modified: 2014/12/02 10:03 by zenke