v0.5.8 Latest Latest

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

Go to latest
Published: Jan 19, 2019 License: BSD-3-Clause Imports: 5 Imported by: 0




This section is empty.


This section is empty.


This section is empty.


type Feature

type Feature struct {
	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
y or Y : Canonical URL