Apache Singa
A General Distributed Deep Learning Library
Classes | Public Member Functions | List of all members
singa::LocalUpdater Class Reference

LocalUpdater do gradient aggregation and update gradient calling the wrapped Optimizer on a specific device (i.e., CPU or GPU). More...

#include <updater.h>

Inheritance diagram for singa::LocalUpdater:
Inheritance graph
[legend]
Collaboration diagram for singa::LocalUpdater:
Collaboration graph
[legend]

Public Member Functions

 LocalUpdater (int total_num, Optimizer *opt, std::shared_ptr< Device > dev=defaultDevice)
 
virtual void Register (const string &name, const ParamSpec &specs) override
 Forward Register() to Optimizer.
 
virtual void Apply (int step, const string &name, Tensor &grad, Tensor &value) override
 Update parameter value based on given gradient by invoking optimizer algoritim. More...
 
- Public Member Functions inherited from singa::Updater
 Updater (Optimizer *opt)
 
virtual void Setup (const OptimizerConf &conf)
 Forward Setup() to Optimizer.
 
OptimizerGetOptimizer ()
 
 Updater (const Updater &)=delete
 
void operator= (const Updater &)=delete
 

Additional Inherited Members

- Protected Attributes inherited from singa::Updater
Optimizeropt_
 

Detailed Description

LocalUpdater do gradient aggregation and update gradient calling the wrapped Optimizer on a specific device (i.e., CPU or GPU).

Member Function Documentation

◆ Apply()

virtual void singa::LocalUpdater::Apply ( int  step,
const string &  name,
Tensor grad,
Tensor value 
)
overridevirtual

Update parameter value based on given gradient by invoking optimizer algoritim.

When tranining net call this function will be blocked until all the partial gradients are aggrageted in a synchronized style training.

Reimplemented from singa::Updater.


The documentation for this class was generated from the following file: