UPDATE RULE PLUGINS

permutation

image

Update rule plugin, replacing the state with its permutation, augmented by the current signal.

See also: https://creatingintelligence.org/#permutation

Details

  • Plugin for delay and temporal components.
  • Not applicable with auto-associative memory (auto).
  • Transparently handles multiset and inhibitory signals.
  • Repeated permutation of the temporal state encodes temporal sequences.

Delay component with temporal sequence permutation

The delay component applying the permutation update rule:

{ "hyperparameters": {"default": [1000, 10]},
  "dataflow": [
    {"component": "input", "send": [1]},
    {"component": "delay", "plugin": "permutation", 
        "send": [11], "receive": [1], "capacity": 2, "decay": 0.15},
    {"component": "output", "receive": [11]}
  ]}

image

Temporal associative memory with state permutation

Used as a plugin for the temporal component, permutation aggregates a state that preserves the order of prior inputs.

{ "hyperparameters": {"default": [1000, 10]},
  "dataflow": [
    {"component": "input", "send": [1]},
    {"component": "temporal", "plugin": "permutation", 
        "send": [11], "receive": [1], "capacity": 2},
    {"component": "output", "receive": [11]}
  ]}

image

Source code

def permutation(config):
    dims = sum(b[0] for b in config.get("receive_blocks", []))
    dim = dims if dims else 0
    perm = rng.choice(
        range(1, dim + 1),
        size = dim,
        replace=False).tolist() if dim > 0 else []

    def updaterule(y, x):
        mapped_x = sorted([(1 if i > 0 else -1 if i < 0 else 0)
                          * perm[abs(i) - 1] for i in x if i != 0])
        return multiset([y, mapped_x])

    return {"updaterule": updaterule, "label": "π", "size": 16}