cymr.cmr.CMR#

class cymr.cmr.CMR#

Context Maintenance and Retrieval model.

Model Parameters

Lfcfloat

Learning rate of item-context weights.

Lcffloat

Learning rate of context-item weights.

P1float

Additional context-item learning for first item.

P2float

Decay rate for primacy learning rate gradient.

B_encfloat

Integration rate during encoding.

B_startfloat

Integration rate of start context reinstatement.

B_recfloat

Integration rate during recall.

X1float

Probability of not recalling any items.

X2float

Shape parameter of exponential function increasing stop probability by output position.

Parameter definition objects

Parameters objects are used to indicate sublayers to include in the network and to indicate how network weights should be initialized. The sublayers and weights attributes must be set.

Parameters objects may also be used to define parameters that depend on other parameters and/or dynamic parameters that depend on columns of the input data.

Finally, Parameters objects are used to define searches, using the fixed and free attributes.

Model Patterns

Patterns are used to define connections between the item and context layers and direct connections between items. Connections may be orthonormal as in many published variants of CMR, or they may be distributed, overlapping patterns.

Patterns may include 'vector' and/or 'similarity' matrices. Vector representations are used to set the \(M^{FC}_{pre}\) and \(M^{CF}_{pre}\) matrices, while similarity matrices are used to set the \(M^{FF}_{pre}\) matrix.

Vector and similarity values are dicts of (feature: array) specifying an array for one or more named features, with an [items x units] array for vector representations, or [items x items] for similarity matrices.

__init__()#

Methods

__init__()

fit_indiv(data, param_def[, patterns, ...])

Fit parameters to individual subjects.

fit_subject(subject_data, param_def[, ...])

Fit a model to data for one subject.

generate(data, group_param[, subj_param, ...])

Generate simulated data for all subjects.

generate_subject(study, recall, param[, ...])

Generate simulated data for one subject.

likelihood(data, group_param[, subj_param, ...])

Log likelihood summed over all subjects.

likelihood_subject(study, recall, param[, ...])

Log likelihood of data for one subject based on a given model.

parameter_recovery(data, n_sample, param_def)

Run multiple iterations of parameter recovery.

parameter_sweep(data, group_param, ...[, ...])

Simulate data with varying parameters.

prepare_sim(data[, study_keys, recall_keys])

Prepare data for simulation.

prepare_subject(subject, data, group_param)

Prepare parameters and data for a subject.

record(data, group_param[, subj_param, ...])

Record model states during a simulation.

record_subject(study, recall, param[, ...])

Record model state during simulation of data for one subject.

set_default_options(param_def)