NSMnum with untrained choosers
Two agent types each get their own small model, and because neither has been trained, its answers come from random weights and mean nothing.
Reader (circle)Walker (square)waiting, the row’s none action (outline)
An NSMnum (Narrow Small Model, numerating) is a model that answers only with a number: the place of an action in a list, or none. Here a Reader has a list of two actions (right, left) and a Walker has four (up, down, right, left). Each type has its own row in an NSMnumTable, with its own model, its own list, and the action it takes on none, which is to wait still. A waiting agent is drawn as an outline.
These models are untrained. A TensorFlowChooser made with TensorFlowChooser.create starts with random weights, so what it answers depends on those weights and not on anything it was shown. Typically the answers hardly change from one agent to the next, so most of a type walks in one direction. Press Reset to draw new random weights and see a different habit.
None comes from two places. The model has one output for none, and an answer from it counts. And an answer whose highest output is below the threshold counts as none too: raise the threshold and the agents stop, because an untrained model is never sure. None never makes an agent take a guess. It makes the agent run the row’s none action.
A real NSMnum is trained on the keys of the person it works for, never on its own answers. The README explains how to key situations and train a chooser (see “Train an NSMnum on your keys and nothing else”). The method is called ungli, and its parts are listed on the NSMnum page of SYNTAX.
Classes used
NSMnumTable, TensorFlowChooser (create), MLAgent. TensorFlow.js 4.22.0 is loaded from cdnjs on this page only.
Source
This is example.js, the file this page runs.
Loading the source…