vectorizer

package
v1.21.4 Latest Latest
Warning

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

Go to latest
Published: Sep 25, 2023 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClassSettings

func NewClassSettings(cfg moduletools.ClassConfig) *classSettings

Types

type ClassSettings

type ClassSettings interface {
	ImageField(property string) bool
	ImageFieldsWeights() ([]float32, error)
	TextField(property string) bool
	TextFieldsWeights() ([]float32, error)
	AudioField(property string) bool
	AudioFieldsWeights() ([]float32, error)
	VideoField(property string) bool
	VideoFieldsWeights() ([]float32, error)
	IMUField(property string) bool
	IMUFieldsWeights() ([]float32, error)
	ThermalField(property string) bool
	ThermalFieldsWeights() ([]float32, error)
	DepthField(property string) bool
	DepthFieldsWeights() ([]float32, error)
}

type Client

type Client interface {
	Vectorize(ctx context.Context,
		texts, images, audio, video, imu, thermal, depth []string,
	) (*ent.VectorizationResult, error)
}

type Vectorizer

type Vectorizer struct {
	// contains filtered or unexported fields
}

func New

func New(client Client) *Vectorizer

func (*Vectorizer) CombineVectors

func (v *Vectorizer) CombineVectors(vectors [][]float32) []float32

CombineVectors combines all of the vector into sum of their parts

func (*Vectorizer) MoveAwayFrom

func (v *Vectorizer) MoveAwayFrom(source []float32, target []float32, weight float32,
) ([]float32, error)

MoveAwayFrom moves one vector away from another

func (*Vectorizer) MoveTo

func (v *Vectorizer) MoveTo(source []float32, target []float32, weight float32,
) ([]float32, error)

MoveTo moves one vector toward another

func (*Vectorizer) Object

func (v *Vectorizer) Object(ctx context.Context, object *models.Object,
	objDiff *moduletools.ObjectDiff, settings ClassSettings,
) error

func (*Vectorizer) Texts

func (v *Vectorizer) Texts(ctx context.Context, inputs []string,
	settings ClassSettings,
) ([]float32, error)

func (*Vectorizer) VectorizeAudio

func (v *Vectorizer) VectorizeAudio(ctx context.Context, audio string) ([]float32, error)

func (*Vectorizer) VectorizeDepth

func (v *Vectorizer) VectorizeDepth(ctx context.Context, depth string) ([]float32, error)

func (*Vectorizer) VectorizeIMU

func (v *Vectorizer) VectorizeIMU(ctx context.Context, imu string) ([]float32, error)

func (*Vectorizer) VectorizeImage

func (v *Vectorizer) VectorizeImage(ctx context.Context, image string) ([]float32, error)

func (*Vectorizer) VectorizeThermal

func (v *Vectorizer) VectorizeThermal(ctx context.Context, thermal string) ([]float32, error)

func (*Vectorizer) VectorizeVideo

func (v *Vectorizer) VectorizeVideo(ctx context.Context, video string) ([]float32, error)

Jump to

Keyboard shortcuts

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