model

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2018 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Feature

type Feature struct {
	Shape []int64
	Type  string
}

type Framework

type Framework interface {
	Load(modelPath string, modelFile string, model *Model) (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
}

type Model

type Model struct {
	Metadata *Metadata
	Instance interface{}
	Inputs   map[string]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) (*Model, error)

func (*Model) AppendInput

func (m *Model) AppendInput(inputName string, feature string, in interface{})

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]map[string]interface{})

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