2 #include <dlprim/operator.hpp> 11 virtual void setup(std::vector<TensorSpecs>
const &in,
12 std::vector<TensorSpecs> &out,
13 std::vector<TensorSpecs> ¶meters,
17 virtual void reshape(std::vector<Shape>
const &in,
18 std::vector<Shape> &out,
21 virtual void forward(std::vector<Tensor> &input,
22 std::vector<Tensor> &output,
23 std::vector<Tensor> ¶meters,
27 virtual void backward(std::vector<TensorAndGradient> &input,
28 std::vector<TensorAndGradient> &output,
29 std::vector<TensorAndGradient> ¶meters,
38 virtual void forward_cpu_float(
size_t n,
float const *x,
float *y) = 0;
39 virtual void backward_cpu_float(
size_t n,
float const *x,
float *dx,
float const *y,
float const *dy,
float beta) = 0;
43 float threshold = 0.0f;
55 virtual void forward_cpu_float(
size_t n,
float const *x,
float *y);
56 virtual void backward_cpu_float(
size_t n,
float const *x,
float *dx,
float const *y,
float const *dy,
float beta);
64 float min_val = -1.0f;
77 virtual void forward_cpu_float(
size_t n,
float const *x,
float *y);
78 virtual void backward_cpu_float(
size_t n,
float const *,
float *,
float const *,
float const *,
float beta);
Definition: pointwise.hpp:63
Definition: pointwise.hpp:47
Definition: pointwise.hpp:42
virtual void reshape(std::vector< Shape > const &in, std::vector< Shape > &out, size_t &ws)
Reshape layer according to new input size.
virtual char const * operator_type() const
name of the operator type
Definition: pointwise.hpp:54
virtual void setup(std::vector< TensorSpecs > const &in, std::vector< TensorSpecs > &out, std::vector< TensorSpecs > ¶meters, size_t &workspace)
Convigure operator.
Base class for backward/forward propogation calculations for internal network.
Definition: operator.hpp:15
This is main object that represent the pair of OpenCL platform and device all other objects use it...
Definition: context.hpp:302
virtual void backward(std::vector< TensorAndGradient > &input, std::vector< TensorAndGradient > &output, std::vector< TensorAndGradient > ¶meters, Tensor &workspace, ExecutionContext const &ctx)
Enqueue backward propogation computations.
Definition: pointwise.hpp:5
This class is central representation of json objects.
Definition: json.hpp:652
Definition: pointwise.hpp:69
Mane namespace.
Definition: context.hpp:9
Central Data Contrainer - Tensor.
Definition: tensor.hpp:99
virtual char const * operator_type() const
name of the operator type
Definition: pointwise.hpp:76
virtual void forward(std::vector< Tensor > &input, std::vector< Tensor > &output, std::vector< Tensor > ¶meters, Tensor &ws, ExecutionContext const &q)
Enqueue forward propogation computations.
This class is used to pass cl::Events that the kernel should wait for and/or signal event completion...
Definition: context.hpp:121