Caffe2 - C++ API
A deep learning, cross platform ML framework
hard_sigmoid_op.h
1 #ifndef CAFFE2_OPERATORS_HARD_SIGMOID_H_
2 #define CAFFE2_OPERATORS_HARD_SIGMOID_H_
3 
4 #include <vector>
5 
6 #include "caffe2/operators/elementwise_ops.h"
7 
8 namespace caffe2 {
9 
10 template <class Context>
12  explicit HardSigmoidFunctor(OperatorBase& op)
13  : alpha(op.GetSingleArgument<float>("alpha", 0.2f)),
14  beta(op.GetSingleArgument<float>("beta", 0.5f)) {}
15 
16  template <typename T>
17  bool operator()(const int N, const T* X, T* Y, Context* context) const;
18 
19  const float alpha, beta;
20 };
21 
22 template <class Context>
25  : alpha(op.GetSingleArgument<float>("alpha", 0.2f)) {}
26 
27  template <typename T>
28  bool Forward(
29  const std::vector<int>& Y_dims,
30  const std::vector<int>& dY_dims,
31  const T* Y,
32  const T* dY,
33  T* dX,
34  Context* context) const;
35 
36  const float alpha;
37 };
38 
39 } // namespace caffe2
40 
41 #endif // CAFFE2CAFFE2_OPERATORS_HARD_SIGMOID_H_
A global dictionary that holds information about what Caffe2 modules have been loaded in the current ...
Definition: blob.h:13