Grid

Grid

Performs the grid search.
Grid takes the data set, static params, dynamic params (axes), and a set of options. It also takes a callback that lets the user 'score' each model.
There are optional callbacks that give the user updates over the course of the search. You may send handlers for end-of-batch, end-of-epoch and end-of-iteration (iteration meaning one model's train and test sequence).

Constructor

new Grid(axisSet, _modelStatics, _sessionData, _callbackEvaluatePrediction, _userGridOptionsopt, _callbackReportIterationopt, _callbackReportEpochopt, _callbackReportBatchopt)

Creates an instance of Grid.
Example
// Sample CallbackEvaluatePrediction
function EvaluatePrediction(target: number[], prediction: number[]) {
  // your logic here; determine whether the prediction is correct

  return new tngs.PredictionEvaluation(correct);
}
Parameters:
Name Type Attributes Description
axisSet AxisSet The hyperparameter ranges to search.
_modelStatics ModelStatics The parameters that will be the same for every model.
_sessionData SessionData The data set to be used for training and testing each model.
_callbackEvaluatePrediction function A function which takes a prediction for a case's inputs, and that case's actual targets. The function returns a score for the prediction. These scores determine the 'quality' of each model.
Arguments: target: number[], prediction: number[]
Returns: PredictionEvaluation
_userGridOptions GridOptions <optional>
Settings for the search.
_callbackReportIteration function <optional>
A function invoked at the end of every model's train-and-test sequence.
Arguments: duration: number, predictions: number[][], proofInputs: Array, proofTargets: number[][]
Returns: void
_callbackReportEpoch function <optional>
A function invoked at the end of every training epoch. If this is not included (i.e. it's null or undefined), default reporting will be logged every epoch. See EpochStats#WriteReport for the default report's format.
Arguments: duration: number, epoch: number, logs: tf.Logs, epochStats: EpochStats
Returns: void
_callbackReportBatch function <optional>
A function invoked at the end of every train epoch. Note that this can get very spammy!
Arguments: duration: number, predictions: number[][], proofInputs: Array, proofTargets: number[][]
Returns: void
Source:

Methods

Run() → {Promise.<void>}

Begins the grid search. Async for the TF model.fit() https://js.tensorflow.org/api/latest/#tf.Sequential.fit
Returns:
Type
Promise.<void>
Source: