mirror of
https://github.com/lordmathis/CUDANet.git
synced 2025-11-05 17:34:21 +00:00
Rename dim2d to shape2d
This commit is contained in:
@@ -7,11 +7,11 @@
|
||||
|
||||
class AvgPoolingLayerTest : public ::testing::Test {
|
||||
protected:
|
||||
dim2d inputSize;
|
||||
shape2d inputSize;
|
||||
int nChannels;
|
||||
dim2d poolingSize;
|
||||
dim2d stride;
|
||||
dim2d padding;
|
||||
shape2d poolingSize;
|
||||
shape2d stride;
|
||||
shape2d padding;
|
||||
std::vector<float> input;
|
||||
std::vector<float> expected;
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
class BatchNormLayerTest : public ::testing::Test {
|
||||
protected:
|
||||
dim2d inputSize;
|
||||
shape2d inputSize;
|
||||
int nChannels;
|
||||
std::vector<float> weights;
|
||||
std::vector<float> biases;
|
||||
|
||||
@@ -7,12 +7,12 @@
|
||||
|
||||
class Conv2dTest : public ::testing::Test {
|
||||
protected:
|
||||
dim2d inputSize;
|
||||
shape2d inputSize;
|
||||
int inputChannels;
|
||||
dim2d kernelSize;
|
||||
dim2d stride;
|
||||
shape2d kernelSize;
|
||||
shape2d stride;
|
||||
int numFilters;
|
||||
dim2d paddingSize;
|
||||
shape2d paddingSize;
|
||||
CUDANet::Layers::ActivationType activationType;
|
||||
std::vector<float> input;
|
||||
std::vector<float> kernels;
|
||||
|
||||
@@ -7,11 +7,11 @@
|
||||
|
||||
class MaxPoolingLayerTest : public ::testing::Test {
|
||||
protected:
|
||||
dim2d inputSize;
|
||||
shape2d inputSize;
|
||||
int nChannels;
|
||||
dim2d poolingSize;
|
||||
dim2d stride;
|
||||
dim2d padding;
|
||||
shape2d poolingSize;
|
||||
shape2d stride;
|
||||
shape2d padding;
|
||||
std::vector<float> input;
|
||||
std::vector<float> expected;
|
||||
|
||||
|
||||
@@ -10,21 +10,21 @@ class ModelTest : public ::testing::Test {
|
||||
CUDANet::Model *commonTestSetup(
|
||||
bool setWeights = true,
|
||||
|
||||
dim2d inputSize = {6, 6},
|
||||
shape2d inputSize = {6, 6},
|
||||
int inputChannels = 2,
|
||||
int outputSize = 3,
|
||||
|
||||
dim2d kernelSize = {3, 3},
|
||||
dim2d stride = {1, 1},
|
||||
shape2d kernelSize = {3, 3},
|
||||
shape2d stride = {1, 1},
|
||||
int numFilters = 2,
|
||||
|
||||
dim2d poolingSize = {2, 2},
|
||||
dim2d poolingStride = {2, 2}
|
||||
shape2d poolingSize = {2, 2},
|
||||
shape2d poolingStride = {2, 2}
|
||||
) {
|
||||
CUDANet::Model *model =
|
||||
new CUDANet::Model(inputSize, inputChannels, outputSize);
|
||||
|
||||
dim2d paddingSize = {0, 0};
|
||||
shape2d paddingSize = {0, 0};
|
||||
|
||||
// Conv2d
|
||||
CUDANet::Layers::Conv2d *conv2d = new CUDANet::Layers::Conv2d(
|
||||
@@ -38,7 +38,7 @@ class ModelTest : public ::testing::Test {
|
||||
model->addLayer("conv1", conv2d);
|
||||
|
||||
// maxpool2d
|
||||
dim2d poolingInput = {
|
||||
shape2d poolingInput = {
|
||||
inputSize.first - kernelSize.first + 1,
|
||||
inputSize.second - kernelSize.second + 1
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user