Axis

Axis

Manages one hyperparameter over the course of the search. It uses a bounded range, and a progression across that range, to define a set of steps. A model is trained and tested at each step. Positions along the axis are defined as the sum of _boundBegin and _progression's current value. When this sum is greather than _boundEnd, the axis is complete.

Constructor

new Axis(_typeEnum, _boundBegin, _boundEnd, _progression)

Creates an instance of Axis.
Example
// create an axis for the hyperparameter 'batch size', with a range of {8, 12, 16}
new tngs.Axis(tngs.AxisTypes.BATCH_SIZE,
              8,
              16,
              new tngs.LinearProgression(4))
Parameters:
Name Type Description
_typeEnum number The hyperparameter associated with this axis. Must be a member of the AxisTypes enum.
_boundBegin number The start of the search range, inclusive.
_boundEnd number The end of the search range, inclusive.
_progression Progression Provides a set of offsets used to determine the steps in the range.
Source:

Members

(static, constant) AxisDefaults :number

Enumeration of the hyperparameter default values.
See AxisTypes for details on each hyperparameter.
Type:
  • number
Properties:
Name Type Description
BATCH_SIZE number 10
EPOCHS number 50
LAYERS number 2
LEARN_RATE number 0.001
NEURONS number 16
VALIDATION_SPLIT number 0.2
Source:

(static, constant) AxisNames :string

Enumeration of the hyperparameter names.
See AxisTypes for details on each hyperparameter.
Type:
  • string
Properties:
Name Type Description
BATCH_SIZE string batchSize
EPOCHS string epochs
LAYERS string hiddenLayers
LEARN_RATE string learnRate
NEURONS string neuronsPerHiddenLayer
VALIDATION_SPLIT string validationSplit
Source:

(static, constant) AxisTypes :number

Enumeration of the hyperparameters currently supported in TNGS.
Type:
  • number
Properties:
Name Type Description
BATCH_SIZE number See args in https://js.tensorflow.org/api/latest/#tf.Sequential.fit
EPOCHS number See args in https://js.tensorflow.org/api/latest/#tf.Sequential.fit
LAYERS number The number of hidden layers in the model. See https://en.wikipedia.org/wiki/Artificial_neural_network
LEARN_RATE number See https://js.tensorflow.org/api/latest/#train.adam NOTE: Currently Adam is only supported optimizer.
NEURONS number See https://en.wikipedia.org/wiki/Artificial_neural_network NOTE: All hidden layers currently use a fixed neuron count.
VALIDATION_SPLIT number See args in https://js.tensorflow.org/api/latest/#tf.Sequential.fit
_TOTAL number Enum length
Source:

Methods

(static) AttemptValidateParameter(key, value, failureMessage) → {boolean}

Checks whether a begin/end boundary is valid for a given hyperparameter. Writes an informative message for the user, in the event of failure.
Parameters:
Name Type Description
key string Must match an entry in the AxisNames enum.
value number The number to validated against this hyperparameter.
failureMessage FailureMessage Explanatory faliure text is written to this object.
Returns:
Type
boolean
Source:

(static) AttemptValidateProgression(key, progression, failureMessage) → {boolean}

Checks whether a progression's config is valid for a given hyperparameter. Writes an informative message for the user, in the event of failure.
Parameters:
Name Type Description
key string Must match an entry in the AxisNames enum.
progression Progression A concrete instance derived from Progression.
failureMessage FailureMessage Explanatory faliure text is written to this object.
Returns:
Type
boolean
Source:

(static) LookupTypeName(type) → {string}

Takes an entry from the AxisTypes enum, and return its associated name.
Parameters:
Name Type Description
type number An entry from the AxisTypes enum.
Returns:
An entry from the AxisNames enum.
Type
string
Source:

Advance()

Moves the progression to its next position.
Source:

CalculatePosition() → {number}

Gets the current value of this axis, defined as (_boundBegin + _progression.value).
Returns:
The hyperparameter's value in the active model.
Type
number
Source:

CheckComplete() → {boolean}

Determines whether this axis is at or beyond the end of its range.
Returns:
Type
boolean
Source:

Reset()

Moves the progression to its initial position.
Source:

WriteReport(compact) → {string}

Gets a description of the axis's type and position. Set 'compact' to false for details on the progression.
Parameters:
Name Type Description
compact boolean If false, bounds and progression are included.
Returns:
Type
string
Source: