Documentation
¶
Index ¶
Constants ¶
const ( TensorTypeFloat = TensorType(iota) TensorTypeDouble TensorTypeInt32 TensorTypeUInt32 TensorTypeInt16 TensorTypeInt8 TensorTypeUInt8 TensorTypeString TensorTypeComplex64 TensorTypeComplex128 TensorTypeInt64 TensorTypeUInt64 TensorTypeBool )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Example ¶
An Example is a mostly-normalized data format for storing data for training and inference. It contains a key-value store (features); where each key (string) maps to a Feature message (which is oneof packed BytesList, FloatList, or Int64List).
type Examplifier ¶
Examplifier interface for types that can be converted to examples
type MapExample ¶
type MapExample map[string]interface{}
MapExample map type that implements Examplifier interface
func (MapExample) Examples ¶
func (me MapExample) Examples() ([]*Example, error)
Examples returns examples (one example) from a given map
type ModelInfo ¶
ModelInfo struct contains infomation about the model used for the prediction (name, version, etc.)
type Predictor ¶
type Predictor interface { // Predict runs prediction with given input map. Output is filtered with given filter. (nil defaults to all outputs) Predict(ctx context.Context, inputs map[string]interface{}, outputFilter []string) (map[string]Tensor, ModelInfo, error) // Classify runs classify with given features and context Classify(ctx context.Context, examples []*Example, context *Example) ([][]Class, ModelInfo, error) // Regress runs regression with given features and context Regress(ctx context.Context, examples []*Example, context *Example) ([]Regression, ModelInfo, error) // GetModelInfo returns the ModelInfo for the Predictor GetModelInfo(ctx context.Context) (ModelInfo, error) }
Predictor interface for unified model execution with different backend (embedded go model & tensorflow serving)
type Regression ¶
type Regression struct {
Value float32
}
Regression struct returned by regress calls to a model
type Tensor ¶
type Tensor interface { Value() interface{} Shape() []int64 Type() TensorType }
Tensor unified interface for Tensors