neuron_layer.hpp 887 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef CAFFE_NEURON_LAYER_HPP_
  2. #define CAFFE_NEURON_LAYER_HPP_
  3. #include <vector>
  4. #include "caffe/blob.hpp"
  5. #include "caffe/layer.hpp"
  6. #include "caffe/proto/caffe.pb.h"
  7. namespace caffe {
  8. /**
  9. * @brief An interface for layers that take one blob as input (@f$ x @f$)
  10. * and produce one equally-sized blob as output (@f$ y @f$), where
  11. * each element of the output depends only on the corresponding input
  12. * element.
  13. */
  14. template <typename Dtype>
  15. class NeuronLayer : public Layer<Dtype> {
  16. public:
  17. explicit NeuronLayer(const LayerParameter& param)
  18. : Layer<Dtype>(param) {}
  19. virtual void Reshape(const vector<Blob<Dtype>*>& bottom,
  20. const vector<Blob<Dtype>*>& top);
  21. virtual inline int ExactNumBottomBlobs() const { return 1; }
  22. virtual inline int ExactNumTopBlobs() const { return 1; }
  23. };
  24. } // namespace caffe
  25. #endif // CAFFE_NEURON_LAYER_HPP_