mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-05 17:34:21 +00:00
Implement max pooling test
This commit is contained in:
@@ -9,6 +9,7 @@ __global__ void max_pooling(
|
||||
const float* __restrict__ d_input,
|
||||
float* __restrict__ d_output,
|
||||
const int inputSize,
|
||||
const int outputSize,
|
||||
const int nChannels,
|
||||
const int poolingSize,
|
||||
const int stride
|
||||
@@ -18,6 +19,7 @@ __global__ void avg_pooling(
|
||||
const float* __restrict__ d_input,
|
||||
float* __restrict__ d_output,
|
||||
const int inputSize,
|
||||
const int outputSize,
|
||||
const int nChannels,
|
||||
const int poolingSize,
|
||||
const int stride
|
||||
|
||||
@@ -3,8 +3,8 @@
|
||||
|
||||
#include <cuda_runtime.h>
|
||||
|
||||
#include "layer.cuh"
|
||||
#include "activation.cuh"
|
||||
#include "layer.cuh"
|
||||
|
||||
namespace CUDANet::Layers {
|
||||
|
||||
@@ -21,6 +21,15 @@ class MaxPooling2D : public SequentialLayer {
|
||||
|
||||
float* forward(const float* d_input);
|
||||
|
||||
/**
|
||||
* @brief Get the output width (/ height) of the layer
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
int getOutputSize() {
|
||||
return outputSize;
|
||||
}
|
||||
|
||||
private:
|
||||
int inputSize;
|
||||
int nChannels;
|
||||
|
||||
Reference in New Issue
Block a user