MagmaDNN  1.0
c++NeuralNetworkFramework
magmadnn::op::SigmoidOp< T > Class Template Reference

#include <sigmoidop.h>

Inheritance diagram for magmadnn::op::SigmoidOp< T >:
Collaboration diagram for magmadnn::op::SigmoidOp< T >:

Public Member Functions

 SigmoidOp (Operation< T > *x, bool copy=true, bool fast=true)
 
std::string to_string ()
 
- Public Member Functions inherited from magmadnn::op::Operation< T >
 Operation ()
 
 Operation (std::vector< Operation< T > *> inputs, bool needs_grad=true)
 
virtual std::vector< unsigned int > get_output_shape () const
 
virtual unsigned int get_output_shape (unsigned int idx) const
 
virtual unsigned int get_output_size () const
 
virtual memory_t get_memory_type () const
 
virtual Tensor< T > * eval (bool recompute=true)
 
virtual void reset ()
 
virtual Tensor< T > * grad (Operation< T > *consumer, Operation< T > *var, Tensor< T > *grad, bool recompute=true)
 
virtual void add_consumer (Operation< T > *consumer)
 
virtual std::vector< Operation< T > * > get_consumers ()
 
virtual std::vector< Operation< T > * > get_inputs ()
 
virtual Tensor< T > * get_output_tensor ()
 
virtual Tensor< T > * get_grad_tensor (Operation< T > *wrt)
 
virtual std::string get_name ()
 

Protected Member Functions

Tensor< T > * _eval (bool recompute=true)
 
Tensor< T > * _grad (Operation< T > *consumer, Operation< T > *var, Tensor< T > *grad)
 

Protected Attributes

Operation< T > * x
 
Tensor< T > * x_tensor
 
bool copy
 
bool fast
 
- Protected Attributes inherited from magmadnn::op::Operation< T >
std::vector< Operation< T > * > inputs
 
std::vector< Operation< T > * > consumers
 
std::vector< unsigned int > output_shape
 
memory_t mem_type
 
std::map< uintptr_t, Tensor< T > * > _grad_cache
 
std::string name = "DefaultOpName"
 
Tensor< T > * output_tensor
 
bool needs_grad
 
bool has_been_computed
 
bool has_grad_been_computed
 

Detailed Description

template<typename T>
class magmadnn::op::SigmoidOp< T >

Sigmoid Operation. Computes the element-wise sigmoid operation on a Tensor.

Template Parameters
T

Member Function Documentation

◆ _eval()

template<typename T >
Tensor< T > * magmadnn::op::SigmoidOp< T >::_eval ( bool  recompute = true)
protectedvirtual

Sets this->output_tensor to the value of this operation

Returns
Tensor<T>* the evaluated tensor

Implements magmadnn::op::Operation< T >.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ _grad()

template<typename T >
Tensor< T > * magmadnn::op::SigmoidOp< T >::_grad ( Operation< T > *  consumer,
Operation< T > *  var,
Tensor< T > *  grad 
)
protectedvirtual

Computes the gradient of this operation wrt the output of consumer.

Parameters
consumer
var
grad
recompute
Returns
Tensor<T>*

Implements magmadnn::op::Operation< T >.

Here is the caller graph for this function:

◆ to_string()

template<typename T>
std::string magmadnn::op::SigmoidOp< T >::to_string ( )
inlinevirtual

string form of the given operation. Expands on input.

Returns
std::string

Implements magmadnn::op::Operation< T >.

Here is the call graph for this function:

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