MagmaDNN  1.0
c++NeuralNetworkFramework
dropoutlayer.h
Go to the documentation of this file.
1 
9 #include <vector>
10 #include "layer/layer.h"
11 #include "tensor/tensor.h"
12 #include "compute/operation.h"
13 #include "compute/tensor_operations.h"
14 
15 const float DEFAULT_DROPOUT_RATE = 0.2;
16 const unsigned long long DEFAULT_SEED = time(NULL);
17 
18 namespace magmadnn {
19 namespace layer {
20 
21 template <typename T>
22 class DropoutLayer : public Layer<T> {
23 public:
24  DropoutLayer(op::Operation<T> *input, float dropout_rate, unsigned long long seed);
25  virtual ~DropoutLayer();
26 
27  virtual std::vector<op::Operation<T> *> get_weights();
28 
29 protected:
30  void init();
31 
32  float dropout_rate;
33  unsigned long long seed;
34 };
35 
43 template <typename T>
44 DropoutLayer<T>* dropout(op::Operation<T> *input, float dropout_rate = DEFAULT_DROPOUT_RATE, unsigned long long seed = DEFAULT_SEED);
45 
46 } // layer
47 } // magmadnn
Definition: dropoutlayer.h:22
Definition: addop.cpp:11
Definition: layer.h:18
Definition: operation.h:18