Documentation ¶
Index ¶
Constants ¶
View Source
const ( // Constants to save and retrieve the gradients WeightSuffix = ".weight" BiasSuffix = ".bias" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Layer ¶
Layer keeps the Weights of a certain layer of the Neural Network the weights can be either the weights or bias indistinctly
type Model ¶
type Model struct { Name string // StateDict holds the layer names // and the layers of the model. Each // layer has a bias and a weight StateDict map[string]*Layer // contains filtered or unexported fields }
Holds the Layers of the model
func NewModel ¶
func NewModel( logger *zap.Logger, jobId string, task api.TrainRequest, layerNames []string, pool *redis.Pool) *Model
Creates a new model with the specified layers
func (*Model) Build ¶
Build gets all the initialized layers from the database Build should be called once just after the network is initialized by a worker
func (*Model) Save ¶
Save saves the new updated weights and bias in the database so it can be retrieved by the following functions
type ParallelSGD ¶
type ParallelSGD struct {
// contains filtered or unexported fields
}
ParallelSGD simply averages the weights of the models trained independently. In this way, we get the freedom of using any optimizer in the functions.
Simply fetch all the model weights and average them
func MakeParallelSGD ¶
func MakeParallelSGD(logger *zap.Logger) ParallelSGD
Click to show internal directories.
Click to hide internal directories.