Common Lisp Package: MGL-UNROLL

Translating Boltzmann Machines to a Backprop networks, aka `unrolling'.

README:

FUNCTION

Public

CHUNK-LUMP-NAME (CHUNK-NAME KIND)

The name of the lump that represents CHUNK.

INITIALIZE-BPN-FROM-BM (BPN BM INITS)

Initialize BPN from the weights of BM according to cloud INITS that was returned by UNROLL-DBN or UNROLL-DBM.

POPULATE-MAP-CACHE (BPN DBM SAMPLES &KEY (KEY (POPULATE-KEY BPN)) (CONVERT-TO-DBM-SAMPLE-FN (POPULATE-CONVERT-TO-DBM-SAMPLE-FN BPN)) (IF-EXISTS SKIP) (PERIODIC-FN (POPULATE-PERIODIC-FN BPN)))

Populate the CLAMPING-CACHE of the MAP lumps of BPN unrolled from DBM. The values for the MAP lumps are taken from mean field of the correspending chunk of the DBM. What happens when the cache already has an entry for a sample is determined by IF-EXISTS: if :SKIP, the default, the cache is unchanged; if :SUPERSEDE, the cache entry is replaced by the calculated contents; if :APPEND, the new (lump array) entries are appended to the existing ones; if :ERROR, an error is signalled.

UNROLL-DBN (DBN &KEY BOTTOM-UP-ONLY)

Unroll DBN recursively and turn it into a feed-forward backpropagation network. A single RBM in DBN of the form VISIBLE <-> HIDDEN is transformed into a VISIBLE -> HIDDEN -> RECONSTRUCTION-OF-VISIBLE network. While the undirected connection <-> has a common weight matrix for both directions, in the backprop network the weights pertaining to ->'s are distinct but are initialized from the same <-> (with one being the tranpose of it). If BOTTOM-UP-ONLY then don't generate the part of the network that represents the top-down flow, that is, skip the reconstructions. Return backprop network lump definition forms, as the second value `inits': initialization specifications suitable for INITIALIZE-BPN-FROM-BM. If there is no corresponding chunk in the layer below or there is no rbm below then the chunk is translated into an INPUT lump. Desired outputs and error node are not added. The first element of RMBS is the topmost one (last of the DBN), the one that goes into the middle of the backprop network.

Undocumented

UNROLL-DBM (DBM &KEY (CHUNKS (CHUNKS DBM)) (MAP CHUNKS) (RECONSTRUCTION NIL))

Private

CHUNK-ACTIVATION-LUMP-NAME (CHUNK-NAME KIND)

The name of the lump that computes the activations of CHUNK.

CLOUD-LINEAR-LUMP-NAME (CLOUD-NAME TRANSPOSEP)

The name of the lump that represents part of the activation of a chunk. CLOUD comes from the rbm in the DBN. TRANSPOSEP determines from which direction the activation crosses the cloud.

CLOUD-WEIGHT-LUMP-NAME (CLOUD-NAME TRANSPOSEP)

The name of the lump that represents the weights of CLOUD or its transpose. CLOUD comes from the rbm in the DBN.

COLLECT-MAP-CHUNKS-AND-LUMPS (BPN DBM)

Return a list of chunk, lump sublists. Elements are MAP lumps in BPN and the corresponding chunk in DBM.

INCOMING-CLOUD (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INCOMING-FROM-LUMPY (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

INCOMING-TRANSPOSEP (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LUMPY-CHUNK (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LUMPY-DEPTH (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LUMPY-INCOMINGS (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LUMPY-KIND (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LUMPY-ORIGINAL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

LUMPY-SYMBOL (INSTANCE)

@arg[extid]{A @class{extid}} @return[sytemid]{puri:uri or nil} Returns the System ID part of this External ID.

MAKE-SEQ-SAMPLER (SEQ)

A simple sampler that returns elements of SEQ once, in order.

Undocumented

ADD-CONNECTION (CLOUD &KEY FROM TO)

CLAMP-CACHED-ENTRY-ON-BPN (BPN STRIPE SAMPLE &KEY (KEY (POPULATE-KEY BPN)))

COPY-INCOMING (INSTANCE)

COPY-LUMPY (INSTANCE)

ENSURE-LUMPY (LUMPIES &KEY DEPTH CHUNK KIND)

FIND-LUMPY (LUMPIES &KEY (DEPTH NIL DEPTHP) CHUNK KIND)

FIND-LUMPY-BY-NAME (NAME LUMPIES)

SETFINCOMING-CLOUD (NEW-VALUE INSTANCE)

SETFINCOMING-FROM-LUMPY (NEW-VALUE INSTANCE)

INCOMING-LIST->BPN-DEFINITION (TO-LUMPY INCOMINGS)

INCOMING-P (OBJECT)

SETFINCOMING-TRANSPOSEP (NEW-VALUE INSTANCE)

LUMPIES->BPN-DEFINITION (LUMPIES)

LUMPY-ACTIVATION-NAME (LUMPY)

SETFLUMPY-CHUNK (NEW-VALUE INSTANCE)

SETFLUMPY-DEPTH (NEW-VALUE INSTANCE)

SETFLUMPY-INCOMINGS (NEW-VALUE INSTANCE)

SETFLUMPY-KIND (NEW-VALUE INSTANCE)

LUMPY-NAME (LUMPY)

SETFLUMPY-ORIGINAL (NEW-VALUE INSTANCE)

LUMPY-P (OBJECT)

SETFLUMPY-SYMBOL (NEW-VALUE INSTANCE)

MAKE-INCOMING (&KEY ((FROM-LUMPY DUM67) NIL) ((CLOUD DUM68) NIL) ((TRANSPOSEP DUM69) NIL))

MAKE-LUMPY (&KEY ((DEPTH DUM0) NIL) ((CHUNK DUM1) NIL) ((INCOMINGS DUM2) 'NIL) ((ORIGINAL DUM3) NIL) ((KIND DUM4) NIL) ((SYMBOL DUM5) (GENSYM)))

GENERIC-FUNCTION

Private

CHUNK->BPN-DEFINITION (CHUNK SYM NAME SIZE ACTIVATION-SYMBOL)

Return a bpn definition form (that is a list of lump definition forms) for CHUNK that takes a single activation parameter given by the symbol ACTIVATION-SYMBOL with NAME and SIZE. Only called for non-conditioning chunks. Second value is a list of clamp inits, the third is a list of inits.

INCOMING->BPN-DEFINTION (FROM-LUMPY TO-LUMPY CLOUD TRANSPOSEP)

Return a list of four elemenets. The first is a list of lump definitions that represent the flow from FROM-LUMPY through CLOUD. The chunk of FROM-LUMPY may be either of the end points of CLOUD. The third values is the cloud inits. The third is name of the `end' lump.

Undocumented

INITIALIZE-FROM-CLOUD (BPN CLOUD ARGS)

SLOT-ACCESSOR

Public

Undocumented

CLAMPING-CACHE (OBJECT)

POPULATE-KEY (OBJECT)

POPULATE-MAP-CACHE-LAZILY-FROM-DBM (OBJECT)

Private

Undocumented

POPULATE-CONVERT-TO-DBM-SAMPLE-FN (OBJECT)

POPULATE-PERIODIC-FN (OBJECT)

CLASS

Public

BPN-CLAMPING-CACHE

This slot is a sample -> (lump array)* list hash table. Inherit from this and set input will clamp the arrays to the respective lumps for the right sample.

Private

Undocumented

INCOMING

LUMPY