UPDATE RULE PLUGINS

coincidence

image

Update rule plugin for auto-associative memory, retaining the matching elements between the query and the retrieved pattern.

See also: https://creatingintelligence.org/#update-rules

Details

  • Plugin for the auto component.
  • Not applicable for temporal integration (delay and temporal).
  • Transparently handles multisets and inhibitory signals.
  • Corresponds to the set intersection after deduplication.

Auto-associative memory with coincidence update

As a plugin for the auto component, the coincidence update rule retains only the matching elements, without completing the pattern.

{ "hyperparameters": {"default": [1000, 10]},
  "dataflow": [
    {"component": "input", "send": [1]},
    {"component": "auto", "plugin": "coincidence", 
        "send": [2], "receive": [1]},
    {"component": "output", "receive": [2]}
  ]}

image

See also: https://creatingintelligence.org/#auto-associative-memory

Source code

def coincidence(config):
    def multiset_intersection(y, x):
        counts_y = Counter(y)
        counts_x = Counter(x)
        res = []
        for k, v in counts_y.items():
            res.extend([k] * min(v, counts_x.get(k, 0)))
        return sorted(res)
    return {"updaterule": multiset_intersection, "label": "∩", "size": 14}