Dragon - C++ API
A Computation Graph Virtual Machine Based Deep Learning Framework
Public Member Functions | Public Attributes | Protected Attributes | List of all members
dragon::AdamUpdateOp< Context > Class Template Referencefinal

#include <adam_update_op.h>

Inheritance diagram for dragon::AdamUpdateOp< Context >:
dragon::UpdateOpBase< Context > dragon::Operator< Context > dragon::OperatorBase

Public Member Functions

 AdamUpdateOp (const OperatorDef &def, Workspace *ws)
 
void Compute (Tensor *dX) override
 
- Public Member Functions inherited from dragon::UpdateOpBase< Context >
 UpdateOpBase (const OperatorDef &def, Workspace *ws)
 
string slot ()
 
float param (const string &name) const
 
float lr_mult () const
 
template<typename T >
void Process (Tensor *dX, Tensor *X)
 
template<typename T >
void Apply (Tensor *dX, Tensor *X)
 
void RunOnDevice () override
 Implement the detailed execution. More...
 
- Public Member Functions inherited from dragon::Operator< Context >
 Operator (const OperatorDef &def, Workspace *ws)
 Default constructor. More...
 
void Run (int stream_id=0) final
 Run this operator on the specified stream. More...
 
virtual void PrepareResource ()
 Prepare the content of inputs. More...
 
virtual void ReleaseResource ()
 Release the ownership of inputs. More...
 
virtual void MemorySwitch ()
 Coordinate the context of inputs and outputs. More...
 
Context * ctx ()
 Return the internal context. More...
 
bool AllowRun ()
 Whether this operator can be ignored. More...
 
- Public Member Functions inherited from dragon::OperatorBase
 OperatorBase (const OperatorDef &def, Workspace *ws)
 Default constructor. More...
 
virtual ~OperatorBase ()
 Default deconstructor. More...
 
TensorX (int i)
 Return the specified input tensor. More...
 
TensorY (int i)
 Return the specified output tensor. More...
 
int XSize ()
 Return the number of inputs. More...
 
int YSize ()
 Return the number of outputs. More...
 
void UpdateFrom (const OperatorDef &def)
 Modify this operator according to the given def. More...
 
void SwitchToPhase (const string &phase)
 Switch the internal running phase. More...
 
virtual void Fusion (void *graph)
 Fusion this operator into the specified graph. More...
 
const string & name () const
 Return the operator name. More...
 
const string & type () const
 Return the operator type. More...
 
const string & phase () const
 Return the current running phase. More...
 
const string & anchor () const
 Return the anchor name of this operator. More...
 
const string & dtype () const
 Return the data type of this operator. More...
 
const string & data_format () const
 Return the data format of this operator. More...
 
const string unique_name (const string &name) const
 Return the unique name in this operator. More...
 
Workspacews () const
 Return the parent workspace. More...
 
template<typename T >
Arg (const string &name, const T &default_value)
 Return the value of the specified argument. More...
 
template<typename T >
vector< T > Args (const string &name)
 Return the values of the specified argument. More...
 
const Map< std::string, const Argument * > & args ()
 Return the argument map of this operator. More...
 
const Argument & arg (const string &name)
 Return the specified argument. More...
 
SubGraphsubgraph ()
 Return the recomputing subgraph of this operator. More...
 
void set_subgraph (SubGraph subgraph)
 Set the given recomputing subgraph. More...
 
const OperatorDef & def () const
 Return the stored operator def. More...
 
string DebugString () const
 Return the debug string of the stored operator def. More...
 
string DTypeString (const Tensor &tensor, const Set< string > &dtypes) const
 Return the dtype string according to given tensor. More...
 
string DTypeString (const string &dtype, const Set< string > &dtypes) const
 

Public Attributes

 USE_OPERATOR_FUNCTIONS
 
 USE_UPDATER_FUNCTIONS
 
- Public Attributes inherited from dragon::UpdateOpBase< Context >
 USE_OPERATOR_FUNCTIONS
 

Protected Attributes

int t_
 
float lr_
 
float beta1_
 
float beta2_
 
float eps_
 
- Protected Attributes inherited from dragon::UpdateOpBase< Context >
string slot_
 
float lr_mult_
 
float decay_mult_
 
- Protected Attributes inherited from dragon::Operator< Context >
Context ctx_
 Store the internal context. More...
 
bool allow_run_
 
bool allow_recomp_
 
bool do_sync_
 
- Protected Attributes inherited from dragon::OperatorBase
Workspacews_
 
OperatorDef def_
 
SubGraph subgraph_
 
string phase_
 
string anchor_
 
string dtype_
 
string data_format_
 
vector< Tensor * > inputs_
 
vector< Tensor * > outputs_
 
Map< string, const Argument * > args_
 

Additional Inherited Members

- Public Types inherited from dragon::OperatorBase
typedef Map< string, vector< OperatorBase * > > SubGraph
 

Constructor & Destructor Documentation

◆ AdamUpdateOp()

template<class Context >
dragon::AdamUpdateOp< Context >::AdamUpdateOp ( const OperatorDef &  def,
Workspace ws 
)
inline

Member Function Documentation

◆ Compute()

template<class Context >
void dragon::AdamUpdateOp< Context >::Compute ( Tensor dX)
overridevirtual

Member Data Documentation

◆ beta1_

template<class Context >
float dragon::AdamUpdateOp< Context >::beta1_
protected

◆ beta2_

template<class Context >
float dragon::AdamUpdateOp< Context >::beta2_
protected

◆ eps_

template<class Context >
float dragon::AdamUpdateOp< Context >::eps_
protected

◆ lr_

template<class Context >
float dragon::AdamUpdateOp< Context >::lr_
protected

◆ t_

template<class Context >
int dragon::AdamUpdateOp< Context >::t_
protected

◆ USE_OPERATOR_FUNCTIONS

template<class Context >
dragon::AdamUpdateOp< Context >::USE_OPERATOR_FUNCTIONS

◆ USE_UPDATER_FUNCTIONS

template<class Context >
dragon::AdamUpdateOp< Context >::USE_UPDATER_FUNCTIONS

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