Documentation ¶
Index ¶
- func CtxWithUserID(ctx context.Context, userID string) context.Context
- func UserIDFromCtx(ctx context.Context) string
- type Block
- type BlockType
- type Dependencies
- type Dependency
- type ID
- type Link
- type Network
- type ParameterValue
- type Parameters
- type Position
- type Project
- type ProjectInfo
- type TemplateInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CtxWithUserID ¶
CtxWithUserID creates a new context with the given userID.
func UserIDFromCtx ¶
UserIDFromCtx returns the userID from the given context.
Types ¶
type Block ¶
type Block struct { ID string `json:"id"` Name string `json:"name"` Type BlockType `json:"type"` Position *Position `json:"position"` // for IOBlock InitVariables string `json:"initVariables"` // for NetworkBlock RefNetwork string `json:"refNetwork"` // for NormalBlock + NetworkBlock Repeats int `json:"repeats"` Parameters Parameters `json:"parameters"` }
Block is the block component of the network.
type BlockType ¶
type BlockType string
BlockType is a type of block.
const ( InType BlockType = "In" OutType BlockType = "Out" NetworkType BlockType = "Network" Conv2dType BlockType = "Conv2d" BatchNorm2dType BlockType = "BachNorm2d" ReLUType BlockType = "ReLU" MaxPool2dType BlockType = "MaxPool2d" )
Belows are the types of the block. TODO(youngteac.hong): We need to find a way to simplify types for Normal Block. It is burdensome to add a type every time we add a normal block.
type Dependencies ¶
type Dependencies struct { BuiltInDeps map[string]*Dependency `json:"built_in_deps"` ThirdPartyDeps map[string]*Dependency `json:"third_party_deps"` ProjectDeps map[string]*Dependency `json:"project_deps"` }
func NewDefaultDependencies ¶
func NewDefaultDependencies() *Dependencies
NewDefaultDependencies creates a new instance of dependency map with default value.
type Dependency ¶
type Dependency struct { ID string `json:"id"` Name string `json:"name"` Alias string `json:"alias"` Package string `json:"package"` }
Dependency represents package dependency used in import statements.
type ID ¶
type ID string
ID represents ID of entity.
func IDFromBytes ¶
IDFromBytes returns ID represented by the encoded hexadecimal string from bytes.
type Network ¶
type Network struct { ID string `json:"id"` Name string `json:"name"` Dependencies *Dependencies `json:"dependencies"` Blocks map[string]*Block `json:"blocks"` Links map[string]*Link `json:"links"` }
Network is data that represents a machine learning network.
func NewDefaultNetwork ¶
func NewDefaultNetwork() *Network
NewDefaultNetwork creates a new instance of Network with the default value.
type Parameters ¶
type Parameters map[string]ParameterValue
Parameters is the parameter value map of the block.
type Project ¶
type Project struct { ID string `json:"id"` Name string `json:"name"` Networks map[string]*Network `json:"networks"` }
Project is the project contents of Metis.
func NewProject ¶
NewProject creates a new instance of Project with the default value.