You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
1.2 KiB

7 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. #ifndef __CORTEX_SOFTMAX_LAYER_HEADER__
  2. #define __CORTEX_SOFTMAX_LAYER_HEADER__
  3. #include "../base/basicLayer.h"
  4. #include "../base/basicTree.h"
  5. class softmaxLayer : public cortexLayer{
  6. private:
  7. cortexTREE * m_pSoftmaxTree;
  8. public:
  9. explicit softmaxLayer(bool useGPU = true);
  10. ~softmaxLayer();
  11. bool create(uint32_t batch, uint32_t inputs, uint32_t groups);
  12. void tree(float *input, uint32_t batch, uint32_t inputs, float temp, cortexTREE *hierarchy, float *output);
  13. virtual void forward(cortexSTATE state);
  14. virtual void backward(cortexSTATE state);
  15. friend class gpuCUDA;
  16. friend class cpuHOST;
  17. friend class cortexLayersFactory;
  18. };
  19. /*
  20. typedef layer softmax_layer;
  21. void softmax_array(float *input, int n, float temp, float *output);
  22. softmax_layer make_softmax_layer(int batch, int inputs, int groups);
  23. void forward_softmax_layer(const softmax_layer l, network_state state);
  24. void backward_softmax_layer(const softmax_layer l, network_state state);
  25. #ifdef GPU
  26. void pull_softmax_layer_output(const softmax_layer l);
  27. void forward_softmax_layer_gpu(const softmax_layer l, network_state state);
  28. void backward_softmax_layer_gpu(const softmax_layer l, network_state state);
  29. #endif
  30. */
  31. #endif