InferenceModel

open class InferenceModel : AutoCloseable

Basic class for model inference.

Provides functionality to make predictions and model loading.

Constructors

InferenceModel
Link copied to clipboard
fun InferenceModel()

Types

Companion
Link copied to clipboard
object Companion

Functions

close
Link copied to clipboard
open override fun close()
Closes internal resources: session and kGraph.
graphToString
Link copied to clipboard
fun graphToString(): String
Forms the graph description in string format.
input
Link copied to clipboard
fun input(inputOp: Input)
Chain-like setter to set up inputOp.
output
Link copied to clipboard
fun output(outputOp: Output)
Chain-like setter to set up outputOp.
predict
Link copied to clipboard
open fun predict(inputData: FloatArray): Int
Predicts the class of inputData.
predictSoftly
Link copied to clipboard
open fun predictSoftly(inputData: FloatArray, predictionTensorName: String = ""): FloatArray
Predicts vector of probabilities instead of specific class in predict method.
reshape
Link copied to clipboard
fun reshape(vararg dims: Long)
Chain-like setter to set up input shape.
toString
Link copied to clipboard
open override fun toString(): String

Properties

isModelInitialized
Link copied to clipboard
var isModelInitialized: Boolean = false
Is true when model is initialized.
kGraph
Link copied to clipboard
lateinit var kGraph: KGraph
TensorFlow wrapped computational graph.
name
Link copied to clipboard
var name: String? = null
Model name.
shape
Link copied to clipboard
lateinit var shape: LongArray
Data shape for prediction.

Inheritors

TrainableModel
Link copied to clipboard
SavedModel
Link copied to clipboard