MCPcopy
hub / github.com/tensorflow/tfjs / predict

Method predict

tfjs-layers/src/models.ts:786–792  ·  view source on GitHub ↗

* Generates output predictions for the input samples. * * Computation is done in batches. * * Note: the "step" mode of predict() is currently not supported. * This is because the TensorFlow.js core backend is imperative only. * * ```js * const model = tf.sequential({ *

(x: Tensor|Tensor[], args: ModelPredictArgs = {})

Source from the content-addressed store, hash-verified

784 * @doc {heading: 'Models', subheading: 'Classes'}
785 */
786 override predict(x: Tensor|Tensor[], args: ModelPredictArgs = {}):
787 Tensor|Tensor[] {
788 if (this.model == null) {
789 this.build();
790 }
791 return this.model.predict(x, args);
792 }
793
794 /**
795 * Returns predictions for a single batch of samples.

Calls 2

buildMethod · 0.95
predictMethod · 0.65