neural network configuration and tensorflow model hyperparameters
Optional
properties: TensorScriptPropertiesextra instance properties
Rest
...args: any[]Rest
...args: any[]Rest
...args: any[]Rest
...args: any[]Optional
layersOptional
lossRest
...args: any[]Optional
xOptional
yAdds dense layers to tensorflow classification model
independent variables
dependent variables
model dense layer parameters
Loads a saved tensoflow / keras model, this is an alias for
tensorflow model
https://www.tensorflow.org/js/guide/save_load#loading_a_tfmodel
tensorflow load model options
Returns prediction values from tensorflow model
predicted model values
new test independent variables
saves a tensorflow model, this is an alias for
tensorflow model
https://www.tensorflow.org/js/guide/save_load#save_a_tfmodel
tensorflow save model options
Asynchronously trains tensorflow model
returns trained tensorflow model
independent variables
dependent variables
array of model dense layer parameters
Static
createCreates dataset data
LSTMTimeSeries.createDataset([ [ 1, ], [ 2, ], [ 3, ], [ 4, ], [ 5, ], [ 6, ], [ 7, ], [ 8, ], [ 9, ], [ 10, ], ], 3) // =>
// [
// [
// [ [ 1 ], [ 2 ], [ 3 ] ],
// [ [ 2 ], [ 3 ], [ 4 ] ],
// [ [ 3 ], [ 4 ], [ 5 ] ],
// [ [ 4 ], [ 5 ], [ 6 ] ],
// [ [ 5 ], [ 6 ], [ 7 ] ],
// [ [ 6 ], [ 7 ], [ 8 ] ],
// ], //x_matrix
// [ [ 4 ], [ 5 ], [ 6 ], [ 7 ], [ 8 ], [ 9 ] ] //y_matrix
// ]
returns x matrix and y matrix for model trainning
array of values
number of values in each feature
Static
getStatic
getReturns data for predicting values
Static
getReshape input to be [samples, time steps, features]
LSTMTimeSeries.getTimeseriesShape([
[ [ 1 ], [ 2 ], [ 3 ] ],
[ [ 2 ], [ 3 ], [ 4 ] ],
[ [ 3 ], [ 4 ], [ 5 ] ],
[ [ 4 ], [ 5 ], [ 6 ] ],
[ [ 5 ], [ 6 ], [ 7 ] ],
[ [ 6 ], [ 7 ], [ 8 ] ],
]) //=> [6, 1, 3,]
returns proper timeseries forecasting shape
dataset array of values
Static
reshapeReshapes an array
const array = [ 0, 1, 1, 0, ];
const shape = [2,2];
TensorScriptModelInterface.reshape(array,shape) // =>
[
[ 0, 1, ],
[ 1, 0, ],
];
returns a matrix with the defined shape
input array
shape array
Long Short Term Memory Time Series with Tensorflow
Implements