evaluator

package
v0.13.4 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EvaluatorMeta

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

func MakeEvaluatorMeta

func MakeEvaluatorMeta(id string, semaphore *semaphore.Weighted, maxEvaluatorWait time.Duration,
	semaMetric, tfMetric *gmetric.Operation) EvaluatorMeta

func (EvaluatorMeta) TFMetric added in v0.13.1

func (e EvaluatorMeta) TFMetric() *gmetric.Operation

type Service

type Service struct {
	EvaluatorMeta
	// contains filtered or unexported fields
}

Represents a TF session for running predictions.

func NewEvaluator

func NewEvaluator(signature *domain.Signature, session *tf.Session, meta EvaluatorMeta) *Service

func (*Service) Close

func (s *Service) Close() error

Close will block until all goroutines waiting on the semaphore are released, and complete the Tensorflow session run, or their context errors. Will then close the session.

func (*Service) Evaluate

func (s *Service) Evaluate(ctx context.Context, params []interface{}) ([]interface{}, error)

Evaluate runs the primary model prediction via Cgo Tensorflow. params is expected to be [inputs][1][batch]T - see service/request.Request.Feeds and related methods.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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