Next: Creating Nodes, Previous: Defining Instruction Class Sets, Up: Creating a Multinode Model [Contents][Index]
A model node has the following basic parameters:
qsmm_node_create_v2
and the macro QSMM_NODE_CREATE
create a node with a specified identifier.
The function qsmm_node_create_v2
can find an unused identifier for a new node.
See Creating Nodes.
qsmm_set_nstate_max
called for a node class the node belongs to specifies the default number of node states.
That number is also the maximum allowed number of node states.
The function qsmm_set_node_nstate
can set the number of node states to a lesser value.
qsmm_node_create_v2
has an argument for the name of an instruction class set.
The macro QSMM_NODE_CREATE
uses ‘__FUNCTION__’ as the name of an instruction class set.
qsmm_set_node_ptr
associates a user pointer with a node.
See Associating Parameters with a Model.
qsmm_reg_var_prob
and the macro QSMM_REG_VAR_PROB
register a controlled probability variable for the instruction class set.
Every list element includes the name of a controlled probability variable, its index, and a probability value.
The function qsmm_set_node_var_prob
sets the probability value for the node.
The initial probability value is 0.
See Controlled Variables.
qsmm_set_instr_class_weight
, qsmm_set_instr_class_weight_by_name_f
, and qsmm_set_instr_meta_class_weight
change those weights for the node.
By default, all weights are equal to 1.
See Setting Instruction Classes Weights.
The existence of model nodes is unrelated to the existence of model instance (see Creating the Model Instance). However, when the model instance exists, the node has extended parameters:
qsmm_prob_e
.
See Dumping the State Transition Matrix.
qsmm_prob_e
.
See Dumping the Action Emission Matrix.
qsmm_node_asm
or qsmm_node_profile_clone
or copied from the state transition matrix and action emission matrix of another node in deferred mode by the function qsmm_set_node_profile_source
.
The probability profile occupies the number of states less than or equal to the number of node states specified using the functions qsmm_set_nstate_max
and qsmm_set_node_nstate
.
By default, the node has an unset probability profile. The unset probability profile is an implicit uniform probability profile occupying all node states. In this uniform probability profile, the probabilities of transitions between all node states are equal, and the probabilities of emitting all instructions in all node states are equal. The implicit uniform probability profile does not exist for a model:
is_determ_opt
of qsmm_desc_s
structure is non-zero), and the number of instruction classes in the instruction class set is not 1.
In this case, the node requires specifying a probability profile explicitly;
qsmm_node_reserve
), a large actor representing the environment state identification engine (field is_large_env
of qsmm_desc_s
structure is non-zero) or the instruction emitting engine (field is_large_opt
of qsmm_desc_s
is non-zero), and positive length of look-ahead signal segment (field ngram_env_la_sz
of qsmm_desc_s
is positive).
In this case, the function qsmm_node_call_default
cannot transfer control to the node, and all model nodes are unusable.
This limitation can disappear in future QSMM versions.
qsmm_set_node_profile_source
sets this mode.
In this mode, some operations on the node result in reporting QSMM_ERR_PROFSRCP
or QSMM_ERR_PROFSRCU
respectively.
See Memory Efficient Cloning the Probability Profile.
qsmm_node_asm
loads an assembler program into the node, the assembler program specifies those initial values.
If the function qsmm_node_profile_clone
or qsmm_set_node_profile_source
specifies a probability profile for the node, a source node provides those initial values.
qsmm_set_node_var_prob
needs committing to the state transition matrix or action emission matrix by the function qsmm_node_var_realize
according to those rules.
See Controlled Variables.
qsmm_node_asm
loads an assembler program into the node, the assembler program specifies those names.
If the function qsmm_node_profile_clone
or qsmm_set_node_profile_source
specifies a probability profile for the node, a source node provides those names.
The function qsmm_get_node_state_name
retrieves the name of a node state by its index.
The function qsmm_get_node_state_by_name
retrieves the index of a node state by its name.
qsmm_node_disasm
.
If the function qsmm_node_asm
loads an assembler program with the flag QSMM_ASM_TEMPLATE
, the assembler program becomes the template.
If the function qsmm_node_profile_clone
or qsmm_set_node_profile_source
specifies a probability profile for the node, a source node provides the template.
qsmm_node_asm
loads an assembler program into the node, the assembler program defines the output probability variables and arrays.
If the function qsmm_node_profile_clone
or qsmm_set_node_profile_source
specifies a probability profile for the node, a source node defines the output probability variables and arrays.
See Output Variables.
qsmm_get_node_var_prob_out
caches the calculated value of an output probability variable.
Additionally, that function and the function qsmm_get_node_array_prob_out
cache the probabilities of all choice alternatives that include a choice alternative for a calculated output probability variable or array element.
The function qsmm_node_var_out_forget
called explicitly or implicitly in certain cases clears both caches.
qsmm_node_call_default
called the node and the number of times that function transferred control to the node but not yet returned control from it.
The functions qsmm_get_node_fq
and qsmm_get_node_recurs
retrieve those numbers.
The initial values are 0.
See Calling a Node.
The node parameters tied to the model instance and listed above take the same initial values in case of creating the model instance after creating the node and in case of creating the node after creating the model instance.
The function qsmm_node_unload
(see Unloading the Probability Profile) called for a node causes unsetting all node parameters tied to the model instance except for the parameters retrieved by the functions qsmm_get_node_fq
and qsmm_get_node_recurs
.
The unset parameters take their initial values they have just after creating the model instance.
Next: Creating Nodes, Previous: Defining Instruction Class Sets, Up: Creating a Multinode Model [Contents][Index]