SavedModel

open class SavedModel : TensorFlowInferenceModel

Inference model built on SavedModelBundle format to predict on images.

Constructors

SavedModel
Link copied to clipboard
fun SavedModel()

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
open override fun predict(inputData: FloatArray): Int

Generates output prediction for the input sample.

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

Predicts labels for all observation in dataset.

fun predict(inputData: FloatArray, inputTensorName: String, outputTensorName: String): Int

Predicts the class of inputData.

fun predict(dataset: OnHeapDataset, inputTensorName: String, outputTensorName: String): List<Int>

Predicts labels for all observation in dataset.

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.