model

package
v0.0.11 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: Apache-2.0 Imports: 7 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ValidateError added in v0.0.8

func ValidateError(modelPath string, modelName string, modelNum int32) error

Types

type Dataset

type Dataset struct {
	Git GitRepo `json:"git,omitempty" yaml:"git,omitempty"`
}

type Format

type Format string

Format is the definition of model format.

const (
	FormatSavedModel  Format = "SavedModel"
	FormatONNX        Format = "ONNX"
	FormatH5          Format = "H5"
	FormatPMML        Format = "PMML"
	FormatCaffeModel  Format = "CaffeModel"
	FormatNetDef      Format = "NetDef"
	FormatMXNetParams Format = "MXNetParams"
	FormatTorchScript Format = "TorchScript"
	FormatGraphDef    Format = "GraphDef"
	FormatTensorRT    Format = "TensorRT"
	FormatSKLearn     Format = "SKLearn"
	FormatXGBoost     Format = "XGBoost"
	FormatMLflow      Format = "MLflow"
	FormatOthers      Format = "Others"
)

func (Format) ValidateDirectory

func (f Format) ValidateDirectory(rootPath string) error

type GitRepo

type GitRepo struct {
	Repository string `json:"repository,omitempty" yaml:"repository,omitempty"`
	Revision   string `json:"revision,omitempty" yaml:"revision,omitempty"`
}

type HyperParameter added in v0.0.8

type HyperParameter struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Hyperparameter is the type for training hyperparameter (e.g. learning rate).

type Interface

type Interface interface {
	ValidateDirectory(rootPath string) error
}

type Metadata

type Metadata struct {
	Author      string            `json:"author,omitempty" yaml:"author,omitempty"`
	Created     time.Time         `json:"created,omitempty" yaml:"created,omitempty"`
	Description string            `json:"description,omitempty" yaml:"description,omitempty"`
	Tags        []string          `json:"tags,omitempty" yaml:"tags,omitempty"`
	Labels      map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Format      string            `json:"format,omitempty" yaml:"format,omitempty"`
	// GPUType is for TensorRT format only, it must be set when extract signature or serve
	// as a online service, otherwise, it can not extract or serve as a service.
	// for other model format, you can set empty string or not set.
	GPUType            string                `json:"gpuType,omitempty" yaml:"gpuType,omitempty"`
	Framework          string                `json:"framework,omitempty" yaml:"framework,omitempty"`
	Metrics            map[string]MetricList `json:"metrics,omitempty" yaml:"metrics,omitempty"`
	HyperParameters    []HyperParameter      `json:"hyperParameters,omitempty" yaml:"hyperParameters,omitempty"`
	Signature          *Signature            `json:"signature,omitempty" yaml:"signature,omitempty"`
	Training           *Training             `json:"training,omitempty" yaml:"training,omitempty"`
	Dataset            *Dataset              `json:"dataset,omitempty" yaml:"dataset,omitempty"`
	DirectoryStructure []string              `json:"directoryStructure,omitempty" yaml:"directoryStructure,omitempty"`
}

type Metric

type Metric struct {
	Name  string `json:"name"`
	Value string `json:"value"`
}

Metric is the type for training metric (e.g. acc).

type MetricList added in v0.0.10

type MetricList []Metric

MetricList is the type for list of metric

type Model

type Model struct {
	// Metadata is the contents of the Chartfile.
	Metadata *Metadata `json:"metadata,omitempty"`
	Path     string    `json:"path,omitempty"`
	Content  []byte    `json:"content,omitempty"`
	Config   []byte    `json:"config,omitempty"`
}

type Signature

type Signature struct {
	Inputs  []Tensor       `json:"inputs,omitempty" yaml:"inputs,omitempty"`
	Outputs []Tensor       `json:"outputs,omitempty" yaml:"outputs,omitempty"`
	Layers  map[string]int `json:"layers,omitempty" yaml:"layers,omitempty"`
}

type Tensor

type Tensor struct {
	Name  string `json:"name,omitempty" yaml:"name,omitempty"`
	Size  []int  `json:"size,omitempty" yaml:"size,omitempty"`
	DType string `json:"dType,omitempty" yaml:"dType,omitempty"`
	// OpType is special for PMML
	OpType string `json:"opType,omitempty" yaml:"opType,omitempty"`
	// Values is special for PMML
	Values []string `json:"values,omitempty" yaml:"values,omitempty"`
}

type Training

type Training struct {
	Git GitRepo `json:"git,omitempty" yaml:"git,omitempty"`
}

Directories

Path Synopsis
Package mock is a generated GoMock package.
Package mock is a generated GoMock package.

Jump to

Keyboard shortcuts

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