An NSMnum on a small TensorFlow.js model with one output for each action and a last one for none. encode is code written in advance that turns a state into the numbers the model reads. An answer whose share is below threshold (set by measuring on keyed cases kept out of training) is none.

Implements

Constructors

Properties

Methods

Constructors

Properties

encode: ((state) => number[])

Type declaration

    • (state): number[]
    • Parameters

      Returns number[]

model: LayersModel
threshold: number = 0

Methods

  • Trains only on keyed rows; a row keyed none teaches the last output.

    Parameters

    • rows: KeyedRow[]
    • actions: number
    • epochs: number = 50

    Returns Promise<History>

  • A small model for inputs numbers and actions actions (plus none).

    Parameters

    • inputs: number
    • actions: number

    Returns LayersModel