ioam / topographica

A general-purpose neural simulator focusing on topographic maps.
topographica.org
BSD 3-Clause "New" or "Revised" License
53 stars 32 forks source link

Saving connection Weights #648

Closed Hima-Mehta closed 8 years ago

Hima-Mehta commented 8 years ago

I have two sheets later being CFSheet with CFprojection . Now what should I do if I want to save the weights into an array or file after few run or at the end ?

jbednar commented 8 years ago

I don't think we ever implemented general-purpose weight export code, but you can examine the .cfs attribute of your CFProjection to see the array of ConnectionFields, and then look at the .weights attribute of each CF, exporting it from there however you see fit.

jbednar commented 8 years ago

Unless you mean saving them into a file for the purposes of restoring them later (rather than analyzing them), in which case you can use save_snapshot.

Hima-Mehta commented 8 years ago

Well I tried to save lateral weights of Lissom using topo.sim["<sheet>"].projections()["LateralExcitatory"].cfs[1,1] But the problem here is it gives me the cropped weights . I need the whole matrix where extras padded with zero ! I can see them in GUI using connections->Lateralexcitatotry->printing particular weights to terminal. I can not fill in the zeros because I don't know the exact amount of padding in all sides.

philippjfr commented 8 years ago

IIRC this should give you what you want:

topo.sim["<sheet>"].projections()["LateralExcitatory"].view(x, y, situated=True).data

where x, y is the position of the CF in sheet coordinates.

Hima-Mehta commented 8 years ago

Thanks for your reply .It seems view option isn't available with Resizable CF, Checked options with dir(topo.sim["<sheet>"].projections()["LateralExcitatory"])