Skip to content

Commit 77451e1

Browse files
authored
Merge pull request #288 from deephealthproject/develop
Fixes (api + norms)
2 parents 8c2bbd1 + 2bb241a commit 77451e1

File tree

4 files changed

+10
-10
lines changed

4 files changed

+10
-10
lines changed

src/apis/eddl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,7 +1157,7 @@ namespace eddl {
11571157
int h=parent->output->shape[2];
11581158

11591159
if (name.empty()) { name = "GlobalMaxPool1D"; } // Set default name
1160-
return MaxPool1D(parent, {h},{1}, name);
1160+
return MaxPool1D(parent, {h}, {1}, "none", name);
11611161
}
11621162

11631163
layer GlobalMaxPool2D(layer parent, string name){

src/layers/normalization/layer_norm.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ int LNorm::total_layers = 0;
2424

2525
LNorm::LNorm(Layer *parent, float epsilon, string name, int dev, int mem) : LinLayer(name, dev, mem) {
2626

27-
vector<int> axis;
28-
if (parent->output->ndim == 2) axis.push_back(1);
29-
else if (parent->output->ndim == 4) {axis.push_back(1);axis.push_back(2);axis.push_back(3);}
27+
vector<int> axis; // To store the axis to reduce (starting from the next dimension of the batch)
28+
if (parent->output->ndim == 2) axis.push_back(0);
29+
else if (parent->output->ndim == 4) {axis.push_back(0);axis.push_back(1);axis.push_back(2);}
3030
else msg("LNorm only works over 2D or 4D tensors", "LNorm");
3131

3232
if(name.empty()) this->name = "norm" + to_string(++total_layers);

src/layers/normalization/layer_normmax.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ int LNormMax::total_layers = 0;
2323

2424
LNormMax::LNormMax(Layer *parent, float epsilon, string name, int dev, int mem) : LinLayer(name, dev, mem) {
2525

26-
vector<int> axis;
27-
if (parent->output->ndim == 2) axis.push_back(1);
28-
else if (parent->output->ndim == 4) {axis.push_back(1);axis.push_back(2);axis.push_back(3);}
26+
vector<int> axis; // To store the axis to reduce (starting from the next dimension of the batch)
27+
if (parent->output->ndim == 2) axis.push_back(0);
28+
else if (parent->output->ndim == 4) {axis.push_back(0);axis.push_back(1);axis.push_back(2);}
2929
else msg("LNormMax only works over 2D or 4D tensors", "LNormMax");
3030

3131
if(name.empty()) this->name = "normmax" + to_string(++total_layers);

src/layers/normalization/layer_normminmax.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ int LNormMinMax::total_layers = 0;
2323

2424
LNormMinMax::LNormMinMax(Layer *parent, float epsilon, string name, int dev, int mem) : LinLayer(name, dev, mem) {
2525

26-
vector<int> axis;
27-
if (parent->output->ndim == 2) axis.push_back(1);
28-
else if (parent->output->ndim == 4) {axis.push_back(1);axis.push_back(2);axis.push_back(3);}
26+
vector<int> axis; // To store the axis to reduce (starting from the next dimension of the batch)
27+
if (parent->output->ndim == 2) axis.push_back(0);
28+
else if (parent->output->ndim == 4) {axis.push_back(0);axis.push_back(1);axis.push_back(2);}
2929
else msg("LNormMinMax only works over 2D or 4D tensors", "LNormMinMax");
3030

3131
if(name.empty()) this->name = "normminmax" + to_string(++total_layers);

0 commit comments

Comments
 (0)