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