Apache SINGA
A distributed deep learning platform .
 All Classes Namespaces Files Functions Variables Typedefs Macros
Public Member Functions | List of all members
singa::BPWorker Class Reference
Inheritance diagram for singa::BPWorker:
singa::Worker

Public Member Functions

void Init (int thread_id, int grp_id, int id) override
 
void TrainOneBatch (int step, Metric *perf) override
 Train one mini-batch. More...
 
void TestOneBatch (int step, Phase phase, shared_ptr< NeuralNet > net, Metric *perf) override
 Test/validate one mini-batch.
 
void Forward (int step, Phase phase, shared_ptr< NeuralNet > net, Metric *perf)
 
void Backward (int step, shared_ptr< NeuralNet > net)
 
- Public Member Functions inherited from singa::Worker
void Setup (const JobProto &job, shared_ptr< NeuralNet > train_net, shared_ptr< NeuralNet > valid_net, shared_ptr< NeuralNet > test_net)
 Setup members.
 
void Run ()
 Main function of Worker. More...
 
void InitLocalParams ()
 Init all local params (i.e., params from layers resident in this worker). More...
 
void Checkpoint (int step, shared_ptr< NeuralNet > net)
 Checkpoint all params owned by the worker from the first group onto disk. More...
 
void Test (int nsteps, Phase phase, shared_ptr< NeuralNet > net)
 Test the perforance of the learned model on validation or test dataset. More...
 
void Report (const string &prefix, const Metric &perf)
 Report performance to the stub. More...
 
int Put (Param *param, int step)
 Put Param to server. More...
 
int Get (Param *param, int step)
 Get Param with specific version from server If the current version >= the requested version, then return. More...
 
int Update (Param *param, int step)
 Update Param. More...
 
int Collect (Param *param, int step)
 Block until the param is updated since sending the update request. More...
 
int CollectAll (shared_ptr< NeuralNet > net, int step)
 Call Collect for every param of net.
 
void ReceiveBlobs (bool data, bool grad, BridgeLayer *layer, shared_ptr< NeuralNet > net)
 Receive blobs from other workers due to model partitions.
 
void SendBlobs (bool data, bool grad, BridgeLayer *layer, shared_ptr< NeuralNet > net)
 Send blobs to other workers due to model partitions.
 
bool DisplayNow (int step) const
 Check is it time to display training info, e.g., loss and precison.
 
bool DisplayDebugInfo (int step) const
 Check is it time to display training info, e.g., loss and precison.
 
bool StopNow (int step) const
 Check is it time to stop.
 
bool CheckpointNow (int step) const
 Check is it time to do checkpoint.
 
bool TestNow (int step) const
 Check is it time to do test. More...
 
bool ValidateNow (int step) const
 Check is it time to do validation. More...
 
int grp_id () const
 
int id () const
 worker ID within the worker group.
 

Additional Inherited Members

- Static Public Member Functions inherited from singa::Worker
static WorkerCreate (const JobProto &proto)
 
- Protected Attributes inherited from singa::Worker
int thread_id_
 
int grp_id_
 
int id_
 
int step_
 
JobProto job_conf_
 
shared_ptr< NeuralNettrain_net_
 
shared_ptr< NeuralNettest_net_
 
shared_ptr< NeuralNetvalidation_net_
 
Dealerlayer_dealer_
 
Dealerdealer_
 

Member Function Documentation

void singa::BPWorker::Init ( int  thread_id,
int  grp_id,
int  id 
)
overridevirtual
Parameters
thread_idlocal thread index within the procs
grp_idglobal worker group ID
idworker ID within the group

Reimplemented from singa::Worker.

void singa::BPWorker::TrainOneBatch ( int  step,
Metric perf 
)
overridevirtual

Train one mini-batch.

Test/Validation is done before training.

Implements singa::Worker.


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