DLPrimitives
Public Member Functions | List of all members
dlprim::Hardtanh Class Reference
Inheritance diagram for dlprim::Hardtanh:
dlprim::PointwiseBase dlprim::Operator

Public Member Functions

 Hardtanh (Context &ctx, HardtanhConfig const &cfg=HardtanhConfig())
 
virtual char const * operator_type () const
 name of the operator type
 
virtual void forward_cpu_float (size_t n, float const *x, float *y)
 
virtual void backward_cpu_float (size_t n, float const *, float *, float const *, float const *, float beta)
 
virtual void forward_gpu (Tensor &x, Tensor &y, ExecutionContext const &q)
 
virtual void backward_gpu (Tensor &x, Tensor &dx, Tensor &y, Tensor &dy, float beta, ExecutionContext const &q)
 
- Public Member Functions inherited from dlprim::PointwiseBase
 PointwiseBase (Context &ctx)
 
virtual void setup (std::vector< TensorSpecs > const &in, std::vector< TensorSpecs > &out, std::vector< TensorSpecs > &parameters, size_t &workspace)
 Convigure operator. More...
 
virtual void reshape (std::vector< Shape > const &in, std::vector< Shape > &out, size_t &ws)
 Reshape layer according to new input size. More...
 
virtual void forward (std::vector< Tensor > &input, std::vector< Tensor > &output, std::vector< Tensor > &parameters, Tensor &ws, ExecutionContext const &q)
 Enqueue forward propogation computations. More...
 
virtual void backward (std::vector< TensorAndGradient > &input, std::vector< TensorAndGradient > &output, std::vector< TensorAndGradient > &parameters, Tensor &workspace, ExecutionContext const &ctx)
 Enqueue backward propogation computations. More...
 
- Public Member Functions inherited from dlprim::Operator
 Operator (Context const &ctx)
 Create operator for specific context (device/platform)
 
SharedResourceshared_resource ()
 Getter for object that is shared between operators accross the net, for example random numbers generator.
 
void shared_resource (std::shared_ptr< SharedResource > r)
 Setter of the shared resource.
 
virtual void mode (CalculationsMode mode)
 Can be called with both train and predict before setup() is called. afterwards if original mode was train - it can be switched to predict and back but if original mode was predict it can't be switched to train. More...
 
virtual CalculationsMode mode ()
 get current mode
 
 Operator (Operator const &)=delete
 operator non-copyable/moveable More...
 
void operator= (Operator const &)=delete
 
 Operator (Operator &&)=delete
 
void operator= (Operator &&)=delete
 
virtual bool alias_generator ()
 returns true of the operator is alias - generation - it only changes the shape of tensor but not its content it actually does not perform any operation but only changes semantics, in this casse input and output are aliases of each other
 
virtual void initialize_params (std::vector< Tensor > &, ExecutionContext const &)
 Set default parameters iniitalization.
 

Additional Inherited Members

- Protected Member Functions inherited from dlprim::PointwiseBase
virtual void forward_cpu (Tensor &x, Tensor &y)
 
virtual void backward_cpu (Tensor &x, Tensor &dx, Tensor &y, Tensor &dy, float beta)
 
- Protected Attributes inherited from dlprim::Operator
Context ctx_
 OpenCL/CPU Context to work with.
 
CalculationsMode mode_
 computaions mode
 
std::shared_ptr< SharedResourceshared_resource_
 

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