GNCN-t1 (Rao & Ballard, 1999)¶
This circuit implements the model proposed in (Rao & Ballard, 1999) [1].
Specifically, this model is unsupervised and can be used to process sensory
pattern (row) vector(s) x
to infer internal latent states. This class offers,
beyond settling and update routines, a projection function by which ancestral
sampling may be carried out given the underlying directed generative model
formed by this NGC system.
The GNCN-t1 is graphically depicted by the following graph:
- class ngclearn.museum.gncn_t1.GNCN_t1(args)[source]
Structure for constructing the model proposed in:
Rao, Rajesh PN, and Dana H. Ballard. “Predictive coding in the visual cortex: a functional interpretation of some extra-classical receptive-field effects.” Nature neuroscience 2.1 (1999): 79-87.
Note this model includes the Laplacian prior to induce some level of sparsity in the latent activities. This model, under the NGC computational framework, is referred to as the GNCN-t1/Rao, according to the naming convention in (Ororbia & Kifer 2022).
Node Name Structure:z3 -(z3-mu2)-> mu2 ;e2; z2 -(z2-mu1)-> mu1 ;e1; z1 -(z1-mu0-)-> mu0 ;e0; z0- Parameters
args – a Config dictionary containing necessary meta-parameters for the GNCN-t1
DEFINITION NOTE:args should contain values for the following:* batch_size - the fixed batch-size to be fed into this model* z_top_dim - # of latent variables in layer z3 (top-most layer)* z_dim - # of latent variables in layers z1 and z2* x_dim - # of latent variables in layer z0 or sensory x* seed - number to control determinism of weight initialization* wght_sd - standard deviation of Gaussian initialization of weights* beta - latent state update factor* leak - strength of the leak variable in the latent states* lmbda - strength of the Laplacian prior applied over latent state activities* K - # of steps to take when conducting iterative inference/settling* act_fx - activation function for layers z1, z2, and z3* out_fx - activation function for layer mu0 (prediction of z0) (Default: sigmoid)- project(z_sample)[source]
Run projection scheme to get a sample of the underlying directed generative model given the clamped variable z_sample
- Parameters
z_sample – the input noise sample to project through the NGC graph
- Returns
x_sample (sample(s) of the underlying generative model)
- settle(x, calc_update=True)[source]
Run an iterative settling process to find latent states given clamped input and output variables
- Parameters
x – sensory input to reconstruct/predict
calc_update – if True, computes synaptic updates @ end of settling process (Default = True)
- Returns
x_hat (predicted x)
- calc_updates(avg_update=True, decay_rate=- 1.0)[source]
Calculate adjustments to parameters under this given model and its current internal state values
- Returns
delta, a list of synaptic matrix updates (that follow order of .theta)
- clear()[source]
Clears the states/values of the stateful nodes in this NGC system
References:
[1] Rao, Rajesh PN, and Dana H. Ballard. “Predictive coding in the visual
cortex: a functional interpretation of some extra-classical receptive-field
effects.” Nature neuroscience 2.1 (1999): 79-87.