Add adaptive avg pooling

This commit is contained in:
2024-05-30 17:17:31 +02:00
parent 9faf20876a
commit 8168f02f58
5 changed files with 143 additions and 8 deletions

View File

@@ -9,11 +9,11 @@ namespace CUDANet::Layers {
class AvgPooling2d : public SequentialLayer, public TwoDLayer {
public:
AvgPooling2d(
shape2d inputSize,
shape2d inputSize,
int nChannels,
shape2d poolingSize,
shape2d stride,
shape2d padding,
shape2d poolingSize,
shape2d stride,
shape2d padding,
ActivationType activationType
);
~AvgPooling2d();
@@ -36,9 +36,9 @@ class AvgPooling2d : public SequentialLayer, public TwoDLayer {
shape2d getOutputDims();
private:
protected:
shape2d inputSize;
int nChannels;
int nChannels;
shape2d poolingSize;
shape2d stride;
shape2d padding;
@@ -50,6 +50,11 @@ class AvgPooling2d : public SequentialLayer, public TwoDLayer {
Activation* activation;
};
class AdaptiveAvgPooling2d : public AvgPooling2d {
public:
AdaptiveAvgPooling2d(shape2d inputShape, int nChannels, shape2d outputShape, ActivationType activationType);
};
} // namespace CUDANet::Layers
#endif // CUDANET_AVG_POOLING_H