|
|
#ifndef LOCAL_LAYER_H
#define LOCAL_LAYER_H
#include "../base/basicImage.h"
#include "../base/basicLayer.h"
#include "../base/basicCortex.h"
#ifdef GPU
class gpuCUDA;#endif
class cpuHOST;
class localLayer : public cortexLayer{ private: uint32_t m_nColImage; float * m_pColImage; float * m_pGpuColImage; public: explicit localLayer(bool useGPU); virtual ~localLayer(); bool create(uint32_t batch, uint32_t w, uint32_t h, uint32_t c, uint32_t n, uint32_t size, uint32_t stride, uint32_t pad, ACTIVATION activation); /* Virtual Methods */ virtual void forward( cortexSTATE state); virtual void backward( cortexSTATE state); virtual void loadWeights(FILE * Ptr, bool trans = false); virtual void update( uint32_t batch, float learning_rate, float momentum, float decay); //virtual bool resize( uint32_t w, uint32_t h);
#ifdef GPU
friend class gpuCUDA;#endif
friend class cpuHOST; friend class cortexProcessingUnit;};#ifdef GPU
//void forward_local_layer_gpu(local_layer layer, network_state state);
//void backward_local_layer_gpu(local_layer layer, network_state state);
//void update_local_layer_gpu(local_layer layer, int batch, float learning_rate, float momentum, float decay);
//void push_local_layer(local_layer layer);
//void pull_local_layer(local_layer layer);
#endif
/*
local_layer make_local_layer(int batch, int h, int w, int c, int n, int size, int stride, int pad, ACTIVATION activation);
void forward_local_layer(const local_layer layer, network_state state);void backward_local_layer(local_layer layer, network_state state);void update_local_layer(local_layer layer, int batch, float learning_rate, float momentum, float decay);
void bias_output(float *output, float *biases, int batch, int n, int size);void backward_bias(float *bias_updates, float *delta, int batch, int n, int size);*/#endif
|