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
38 lines
1.2 KiB
#ifndef __CORTEX_SOFTMAX_LAYER_HEADER__
|
|
#define __CORTEX_SOFTMAX_LAYER_HEADER__
|
|
|
|
#include "../base/basicLayer.h"
|
|
#include "../base/basicTree.h"
|
|
|
|
class softmaxLayer : public cortexLayer{
|
|
private:
|
|
cortexTREE * m_pSoftmaxTree;
|
|
public:
|
|
explicit softmaxLayer(bool useGPU = true);
|
|
~softmaxLayer();
|
|
bool create(uint32_t batch, uint32_t inputs, uint32_t groups);
|
|
void tree(float *input, uint32_t batch, uint32_t inputs, float temp, cortexTREE *hierarchy, float *output);
|
|
virtual void forward(cortexSTATE state);
|
|
virtual void backward(cortexSTATE state);
|
|
|
|
friend class gpuCUDA;
|
|
friend class cpuHOST;
|
|
friend class cortexLayersFactory;
|
|
};
|
|
|
|
/*
|
|
typedef layer softmax_layer;
|
|
|
|
void softmax_array(float *input, int n, float temp, float *output);
|
|
softmax_layer make_softmax_layer(int batch, int inputs, int groups);
|
|
void forward_softmax_layer(const softmax_layer l, network_state state);
|
|
void backward_softmax_layer(const softmax_layer l, network_state state);
|
|
|
|
#ifdef GPU
|
|
void pull_softmax_layer_output(const softmax_layer l);
|
|
void forward_softmax_layer_gpu(const softmax_layer l, network_state state);
|
|
void backward_softmax_layer_gpu(const softmax_layer l, network_state state);
|
|
#endif
|
|
*/
|
|
|
|
#endif
|