InferenceModel

abstract class InferenceModel : AutoCloseable

The basic class for all models which defines the basic interfaces required for inference tasks only.

Constructors

InferenceModel
Link copied to clipboard
fun InferenceModel()

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): TensorFlowInferenceModel

Creates a copy.

evaluate
Link copied to clipboard
fun evaluate(dataset: Dataset, metric: Metrics): Double

Evaluates dataset via metric.

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

Predicts the class of inputData.

fun predict(dataset: Dataset): List<Int>

Predicts labels for all observation in dataset.

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.

name
Link copied to clipboard
var name: String? = null

Model name.

Inheritors

TensorFlowInferenceModel
Link copied to clipboard
ImageRecognitionModel
Link copied to clipboard