Skip to content
Randall O'Reilly edited this page Sep 16, 2019 · 2 revisions

A Prjn connects two Layers (links to Go docs). See prjn package docs for information about the projection patterns.

The Prjn holds all of the connections (Synapses) and also the indexes that determine who is connected to who within the RecvLay() receiver and SendLay() sender.

The pattern of connectivity is in the Pattern() which is a specific instance of the interface prjn.Pattern, that computes a specific pattern of connectivity such as Full connectivity, or OneToOne connectivity between units, etc.

Accessing an existing Prjn

For a given recv Layer, to find the projection from a layer named Sender, do this (assuming a leabra type):

pj := recv.RcvPrjns.SendName("Sender").(*leabra.Prjn)

(you could also use the RecvPrjns() method instead of the equivalent RcvPrjns field -- no real diff)

There is an equivalent version for going the other way:

pj := send.SndPrjns.RecvName("Receiver").(*leabra.Prjn)

Note that the Prjn is shared between the two sides -- i.e., the receiver list in RcvPrjns and the sender list in SndPrjns both contain pointers to the same underlying Prjn object.

Specific prjn types

UnifRnd

UnifRnd has field values for the probability of connection and a RndSeed field -- if you want different patterns of connectivity, you need to update that field with a new random seed, and then do Build on the network -- e.g., to copy from a Sim RndSeed into a specific prjn, something like this:

pj.Pattern().(*prjn.UnifRnd).RndSeed = ss.RndSeed