ml

package
v0.64.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 26, 2025 License: AGPL-3.0 Imports: 11 Imported by: 3

Documentation

Overview

Package ml provides some fundamental machine learning primitives.

Package ml provides some fundamental machine learning primitives.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConvertToFloat64Slice added in v0.62.0

func ConvertToFloat64Slice(slice interface{}) ([]float64, error)

ConvertToFloat64Slice converts any numbers or slice of numbers into a float64 slice.

func CreateNewTensor added in v0.62.0

func CreateNewTensor(pft *pb.FlatTensor) (*tensor.Dense, error)

CreateNewTensor turns a proto FlatTensor into a *tensor.Dense.

func FormatClassificationOutputs added in v0.62.0

func FormatClassificationOutputs(
	outNameMap *sync.Map, outMap Tensors, labels []string,
) (classification.Classifications, error)

FormatClassificationOutputs formats the output tensors from a model into classifications.

func TensorNames added in v0.62.0

func TensorNames(t Tensors) []string

TensorNames returns all the names of the tensors.

Types

type Tensors added in v0.8.0

type Tensors map[string]*tensor.Dense

Tensors are a data structure to hold the input and output map of tensors that will fed into a model, or come from the result of a model.

func ProtoToTensors added in v0.62.0

func ProtoToTensors(pbft *pb.FlatTensors) (Tensors, error)

ProtoToTensors takes pb.FlatTensors and turns it into a Tensors map.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL