model

package
Version: v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2020 License: BSD-3-Clause Imports: 5 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Name  string
	Shape []int64
	Type  string
}

type Framework

type Framework interface {
	Load(model *Model, flags ModelFlags) (err error)
	Run(model *Model) (out map[string]interface{}, err error)
	FrameworkTyp() string
}

Framework interface used to implement specific ml framework implementations

type Metadata

type Metadata struct {
	Name   string
	Inputs struct {
		Params   map[string]OperationParam
		Features map[string]Feature
	}
	Outputs map[string]OperationParam
	Method  string
	Tag     string
	SigDef  string
}

type Model

type Model struct {
	Metadata *Metadata
	Instance interface{}
	Inputs   map[string]interface{}
}

Model represents a ML model. The metadata defines inputs, outputs, shapes, etc. The Instance object is a pointer to the actual framework obj. This will be used by the framework impl to execute models

func Load

func Load(modelArchive string, framework Framework, flags ModelFlags) (*Model, error)

Load is unzipping the file and then passing it to be read

func (*Model) RemoveInput

func (m *Model) RemoveInput(featureName string)

func (*Model) Run

func (m *Model) Run(framework Framework) (map[string]interface{}, error)

func (*Model) SetInputs

func (m *Model) SetInputs(in map[string]interface{})

type ModelFlags

type ModelFlags struct {
	Tag       string
	SigDef    string
	ModelFile string
	ModelPath string
}

ModelFlags Contains flags to add to metadata and to aid in loading

type OperationParam

type OperationParam struct {
	Name  string
	Type  string
	Shape []int64
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL