Skip to content

Commit

Permalink
fixing cpp errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brightening-eyes committed Sep 9, 2023
1 parent 956ec7f commit e8c45af
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/layer/celu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,9 @@
// CONDITIONS OF ANY KIND, either express or implied. See the License for the
// specific language governing permissions and limitations under the License.

#include "relu.h"
#include "celu.h"

#include <math.h>

namespace ncnn {

Expand Down Expand Up @@ -44,7 +46,7 @@ int CeLU::forward_inplace(Mat& bottom_top_blob, const Option& opt) const

for (int i = 0; i < size; i++)
{
ptr[i] = std::max(0,ptr[i]) + std::min(0,alpha*(expf(x/alpha)-1));
ptr[i] = std::max(0.0f, ptr[i]) + std::min(0.0f, alpha*(expf(ptr[i]/alpha)-1));
}
}

Expand Down

0 comments on commit e8c45af

Please sign in to comment.