InferenceModel

interface InferenceModel : AutoCloseable

The basic interface for all models which defines the basic functions required for inference tasks only.

Functions

close
Link copied to clipboard
abstract fun close()
copy
Link copied to clipboard
abstract fun copy(copiedModelName: String? = null, saveOptimizerState: Boolean = false, copyWeights: Boolean = true): InferenceModel

Creates a copy.

predict
Link copied to clipboard
abstract fun predict(inputData: FloatArray): Int

Predicts the class of inputData.

predictSoftly
Link copied to clipboard
abstract fun predictSoftly(inputData: FloatArray, predictionTensorName: String = ""): FloatArray

Predicts vector of probabilities instead of specific class in predict method.

reshape
Link copied to clipboard
abstract fun reshape(vararg dims: Long)

Chain-like setter to set up input shape.

Properties

inputDimensions
Link copied to clipboard
abstract val inputDimensions: LongArray

Input specification for this model.