Skip to content

Commit

Permalink
Activation constructor/destructor cleanup (#32)
Browse files Browse the repository at this point in the history
* Add virual destructor for Activation

* Remove individual activation class default constructors
  • Loading branch information
mikeoliphant authored Apr 28, 2023
1 parent 69c57f7 commit 1e42173
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions NAM/activations.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ return (x * (2.45550750702956f + 2.45550750702956f * ax + (0.893229853513558f +
class Activation
{
public:
Activation(){};
Activation() = default;
virtual ~Activation() = default;
virtual void apply(Eigen::MatrixXf& matrix)
{
apply(matrix.data(), matrix.rows() * matrix.cols());
Expand Down Expand Up @@ -73,7 +74,6 @@ class ActivationTanh : public Activation
class ActivationHardTanh : public Activation
{
public:
ActivationHardTanh(){};
void apply(float* data, long size) override
{
for (long pos = 0; pos < size; pos++)
Expand All @@ -86,7 +86,6 @@ class ActivationHardTanh : public Activation
class ActivationFastTanh : public Activation
{
public:
ActivationFastTanh(){};
void apply(float* data, long size) override
{
for (long pos = 0; pos < size; pos++)
Expand All @@ -99,7 +98,6 @@ class ActivationFastTanh : public Activation
class ActivationReLU : public Activation
{
public:
ActivationReLU(){};
void apply(float* data, long size) override
{
for (long pos = 0; pos < size; pos++)
Expand All @@ -112,7 +110,6 @@ class ActivationReLU : public Activation
class ActivationSigmoid : public Activation
{
public:
ActivationSigmoid(){};
void apply(float* data, long size) override
{
for (long pos = 0; pos < size; pos++)
Expand Down

0 comments on commit 1e42173

Please sign in to comment.