Options for USE
Optional
properties: TensorScriptPropertiesextra instance properties
Rest
...args: any[]Optional
getOptional
layersOptional
lossRest
...args: any[]Optional
xOptional
yCalculates sentence embeddings
returns tensorflow prediction
new test independent variables
model prediction options
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
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 loads Universal Sentence Encoder and tokenizer
returns loaded UniversalSentenceEncoder model
Static
getReturns the shape of an input matrix
const input = [
[ 0, 1, ],
[ 1, 0, ],
];
TensorScriptModelInterface.getInputShape(input) // => [2,2]
returns the shape of a matrix (e.g. [2,2])
input matrix
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
Text Embedding with Tensorflow Universal Sentence Encoder (USE)
Implements