TensorFlowInferenceModel

open class TensorFlowInferenceModel : InferenceModel

Basic class for model inference.

Provides functionality to make predictions and model loading.

Constructors

TensorFlowInferenceModel
Link copied to clipboard
fun TensorFlowInferenceModel()

Types

Companion
Link copied to clipboard
object Companion

Functions

close
Link copied to clipboard
open override fun close()

Closes internal resources: session and kGraph.

copy
Link copied to clipboard
open override fun copy(copiedModelName: String?, saveOptimizerState: Boolean, copyWeights: Boolean): TensorFlowInferenceModel

Creates a copy.

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

Evaluates dataset via metric.

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
fun predict(dataset: Dataset): List<Int>

Predicts labels for all observation in dataset.

open override fun predict(inputData: FloatArray): Int

Generates output prediction for the input sample.

predictSoftly
Link copied to clipboard
open override fun predictSoftly(inputData: FloatArray, predictionTensorName: String): FloatArray

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

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

Chain-like setter to set up input shape.

toString
Link copied to clipboard
open override fun toString(): String

Properties

inputDimensions
Link copied to clipboard
open override val inputDimensions: LongArray

Input specification for this model.

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