mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-06 01:34:22 +00:00
Implement avg pooling
This commit is contained in:
38
include/layers/avg_pooling.cuh
Normal file
38
include/layers/avg_pooling.cuh
Normal file
@@ -0,0 +1,38 @@
|
||||
#ifndef CUDANET_AVG_POOLING_H
|
||||
#define CUDANET_AVG_POOLING_H
|
||||
|
||||
#include "activation.cuh"
|
||||
#include "layer.cuh"
|
||||
|
||||
namespace CUDANet::Layers {
|
||||
|
||||
class AvgPooling2D : public SequentialLayer {
|
||||
public:
|
||||
AvgPooling2D(
|
||||
int inputSize,
|
||||
int nChannels,
|
||||
int poolingSize,
|
||||
int stride,
|
||||
ActivationType activationType
|
||||
);
|
||||
~AvgPooling2D();
|
||||
|
||||
float* forward(const float* d_input);
|
||||
|
||||
private:
|
||||
int inputSize;
|
||||
int nChannels;
|
||||
int poolingSize;
|
||||
int stride;
|
||||
|
||||
int outputSize;
|
||||
int gridSize;
|
||||
|
||||
float* d_output;
|
||||
|
||||
Activation activation;
|
||||
};
|
||||
|
||||
} // namespace CUDANet::Layers
|
||||
|
||||
#endif // CUDANET_AVG_POOLING_H
|
||||
Reference in New Issue
Block a user