Documentation
¶
Index ¶
- Variables
- func SetMaxConcurrentTrainingJobs(n int)
- type ModelType
- func (mt *ModelType) Close() error
- func (mt *ModelType) ExamplesError() error
- func (mt *ModelType) GCExamples() error
- func (mt *ModelType) ID() aggregatorpb.ModelID
- func (mt *ModelType) IsTraining() bool
- func (mt *ModelType) Log(feeds map[string]*tensorflow.Tensor, targets []string) error
- func (mt *ModelType) Run(ctx context.Context, feeds map[string]*tensorflow.Tensor, fetches []string, ...) ([]*tensorflow.Tensor, error)
- func (mt *ModelType) StartTraining(ctx context.Context) error
- func (mt *ModelType) StopTraining() error
- func (mt *ModelType) TotalExamples() int64
- func (mt *ModelType) TotalSize() int64
- func (mt *ModelType) TrainingError() error
Constants ¶
This section is empty.
Variables ¶
var ( // MaxFileSize is the target size an example file will be. MaxFileSize = 1 * units.MB // MaxFileRetention is the duration worth of examples kept. MaxFileRetention = 14 * units.Day // MaxDiskUsage is the number of bytes that will used for examples. MaxDiskUsage = 50 * units.MB // MaxFileDuration is the duration worth of examples that will be stored in // one file. MaxFileDuration = 1 * units.Day // IndexFileName is the name of the examples index file. IndexFileName = "index.pb" // FilePerm is the file permission all the example files use. FilePerm os.FileMode = tf.FilePerm DirPerm os.FileMode = 0700 // GCEvery controls how often the examples garbage collector runs. GCEvery = 1 * time.Hour )
var ( ErrNotImplemented = errors.New("not implemented") EdgeAddress = "dns://edge.luk.ai" // ModelCacheSize controls how many training models are cached between // training iterations. ModelCacheSize = 3 DialTimeout = 60 * time.Second // ErrorRateLimit controls how often the client should report errors to the // server. ErrorRateLimit = 1 * time.Minute // MaxQueuedErrors controls how many errors can be queued before they start // getting discarded. MaxQueuedErrors = 10 )
var ( MaxMsgSize = 100 * units.MB // TLSConfig is the tls.Config to use for dialing GRPC endpoints. Mostly used // for testing purposes. TLSConfig *tls.Config )
var MaxConcurrentTrainingJobs = 1
MaxConcurrentTrainingJobs is the maximum number of concurrent training jobs that can be running.
Functions ¶
func SetMaxConcurrentTrainingJobs ¶
func SetMaxConcurrentTrainingJobs(n int)
SetMaxConcurrentTrainingJobs sets the maximum number of concurrent training jobs that can be running.
Types ¶
type ModelType ¶
type ModelType struct {
Domain, ModelType, DataDir string
// contains filtered or unexported fields
}
func MakeModelType ¶
MakeModelType creates a new model type with a specified domain and model type and stores all training data in dataDir.
func (*ModelType) ExamplesError ¶
ExamplesError returns the last examples saving error that occured and clears it. I.e. calling ExamplesError twice if there is only one error will return the error the first time and then nil afterwards. If there is no last error it returns nil.
func (*ModelType) GCExamples ¶
GCExamples scans through the example files and deletes any that violate the retention or max file size policies.
func (*ModelType) ID ¶
func (mt *ModelType) ID() aggregatorpb.ModelID
ID returns the current model ID. If there a production model loaded it returns the production model ID, otherwise, the ID field will be blank and just have the domain and model type.
func (*ModelType) IsTraining ¶
IsTraining returns whether or not a job is training.
func (*ModelType) Log ¶
Log records model input->output pairs for later use in training. This data is saved locally only. - feeds key is the tensorflow output and should be in the form "name:output#". - targets is the name of the tensorflow target and should be in the form "name".
func (*ModelType) Run ¶
func (mt *ModelType) Run( ctx context.Context, feeds map[string]*tensorflow.Tensor, fetches []string, targets []string, ) ([]*tensorflow.Tensor, error)
Run runs the model with the provided tensorflow feeds, fetches and targets. The key for feeds, and fetches should be in the form "name:#", and the targets in the form "name".
func (*ModelType) StartTraining ¶
StartTraining starts the training worker.
func (*ModelType) StopTraining ¶
StopTraining will asyncronously cause training to stop.
func (*ModelType) TotalExamples ¶
TotalExamples returns the number of examples that are currently saved locally.
func (*ModelType) TotalSize ¶
TotalSize returns the file size of examples that are currently saved locally.
func (*ModelType) TrainingError ¶
TrainingError returns the last training error that occured and clears it. I.e. calling TrainingError twice if there is only one error will return the error the first time and then nil afterwards. If there is no last error it returns nil.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
bindable is a wrapper around lukai that is gomobile/gobind compatible.
|
bindable is a wrapper around lukai that is gomobile/gobind compatible. |
github.com
|
|
tensorflow/tensorflow/tensorflow/go/core/framework
Package framework is a generated protocol buffer package.
|
Package framework is a generated protocol buffer package. |
tensorflow/tensorflow/tensorflow/go/core/protobuf
Package protobuf is a generated protocol buffer package.
|
Package protobuf is a generated protocol buffer package. |
protobuf
|
|
aggregatorpb
Package aggregatorpb is a generated protocol buffer package.
|
Package aggregatorpb is a generated protocol buffer package. |
clientpb
Package clientpb is a generated protocol buffer package.
|
Package clientpb is a generated protocol buffer package. |
managerpb
Package managerpb is a generated protocol buffer package.
|
Package managerpb is a generated protocol buffer package. |
tensorflow
Package tensorflow is a generated protocol buffer package.
|
Package tensorflow is a generated protocol buffer package. |