2.8 Automatic Spur

Automatic spur is a means for implementing the idea that an intrinsic feature of an intelligent system is adherence to the principle of minimum energy (or maximum probability). The use of automatic spur may substantially increase the optimality of output signals an actor emits. The automatic spur also makes it possible to use an actor in cases when it does not receive explicit spur increments.

Automatic spur can be useful when an actor models a finite automaton. In this case, the output signals of the actor represent the states of the finite automaton, and each action choice state is a superposition of a previous finite automaton state and an input signal received when the finite automaton was in the previous state. The automatic spur is a measure of adequacy of a model of finite automaton states to a sequence of input signals received.

In QSMM, a common approach to building a model of internal states of an entity to solve a problem is the use of a spur scheme with two spur types for inhibitory (negative) spur and excitatory (positive) spur countervailing each other. The inhibitory spur is the automatic spur with normal way of perception. The excitatory spur is specific to the problem.

If an actor uses automatic spur, it is equal to the sum of automatic spur increments calculated by the function qsmm_actor_reg_ngram_in for action choice states that have prior occurrences in the event history. For such an action choice state, qsmm_actor_reg_ngram_in knows an output signal emitted at the previous occurrence of the action choice state. Note that for the last occurrence, an output signal emitted in the action choice state is not yet known in qsmm_actor_reg_ngram_in.

The actor calculates an automatic spur increment for a pair representing the logical consequence h → z and consisting of an action choice state h and an output signal z emitted in the action choice state. The automatic spur increment is equal to the natural logarithm of the observed probability of occurrence of the pair in the event history:

auto_spur_incr.formula

This formula uses the following notations:

v(h,z)

The number of occurrences of the pair in the event history.

t0

The discrete time of the previous occurrence of the pair in the event history. The function qsmm_actor_reg_sig_out records that time.

If an actor uses a single spur type, and it corresponds to automatic spur, it is better to set the type of a relative probability function for the actor to QSMM_RELPROB_BUILTIN2 or QSMM_RELPROB_BUILTIN3. It is also better to use automatic spur in conjunction with the other countervailing spur that evaluates progress in solving a problem in some other way.

Use functions described below to query or set a spur type for automatic spur. By default, an actor created by the function qsmm_actor_create does not use automatic spur.

Function: int qsmm_get_actor_auto_spur_type (qsmm_actor_t actor)

This function returns non-negative index of a spur type for automatic spur used by an actor or negative error code QSMM_ERR_NOTFOUND if the actor does not use automatic spur.

Function: int qsmm_set_actor_auto_spur_type (qsmm_actor_t actor, int spur_type)

This function sets to spur_type the spur type for automatic spur of an actor. Spur types have zero-based indices. If spur_type is equal to −1, the actor does not use the automatic spur; this condition does not affect the use of automatic spur by a small actor associated with the large actor.

On success, the function returns a non-negative value. If spur_type is less than −1 or is greater than or equal to the number of spur types specified in the field nspur of qsmm_actor_desc_s structure when creating the actor, the function returns negative error code QSMM_ERR_INVAL.

A small actor can use at most one spur type for automatic spur. The functions qsmm_get_actor_auto_spur_type and qsmm_set_actor_auto_spur_type called for a small actor query and set the index of a spur type for the automatic spur.

A large actor can use at most two spur types for automatic spur. A small actor associated with a large actor can use the aforementioned automatic spur—increment it for action choice states occurring in the event history of the small actor. The action choice states represent nodes of output signal choice trees traversed to generate output signals by the large actor. A large actor itself can use another automatic spur—increment it for action choice states occurring in the event history of the large actor. The functions qsmm_get_actor_auto_spur_type and qsmm_set_actor_auto_spur_type called for a large actor query and set the index of a spur type for the latter automatic spur.