-
-
Notifications
You must be signed in to change notification settings - Fork 236
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #293 from Dobiasd/new-activations
Add activations Exponential, Gelu, and Softsign
- Loading branch information
Showing
11 changed files
with
150 additions
and
48 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2016, Tobias Hermann. | ||
// https://github.com/Dobiasd/frugally-deep | ||
// Distributed under the MIT License. | ||
// (See accompanying LICENSE file or at | ||
// https://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
|
||
#include "fdeep/layers/activation_layer.hpp" | ||
#include "fdeep/recurrent_ops.hpp" | ||
|
||
#include <limits> | ||
#include <string> | ||
|
||
namespace fdeep { namespace internal | ||
{ | ||
|
||
class exponential_layer : public activation_layer | ||
{ | ||
public: | ||
explicit exponential_layer(const std::string& name) | ||
: activation_layer(name) | ||
{ | ||
} | ||
protected: | ||
tensor transform_input(const tensor& in_vol) const override | ||
{ | ||
return transform_tensor(exponential_activation, in_vol); | ||
} | ||
}; | ||
|
||
} } // namespace fdeep, namespace internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2016, Tobias Hermann. | ||
// https://github.com/Dobiasd/frugally-deep | ||
// Distributed under the MIT License. | ||
// (See accompanying LICENSE file or at | ||
// https://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
|
||
#include "fdeep/layers/activation_layer.hpp" | ||
#include "fdeep/recurrent_ops.hpp" | ||
|
||
#include <limits> | ||
#include <string> | ||
|
||
namespace fdeep { namespace internal | ||
{ | ||
|
||
class gelu_layer : public activation_layer | ||
{ | ||
public: | ||
explicit gelu_layer(const std::string& name) | ||
: activation_layer(name) | ||
{ | ||
} | ||
protected: | ||
tensor transform_input(const tensor& in_vol) const override | ||
{ | ||
return transform_tensor(gelu_activation, in_vol); | ||
} | ||
}; | ||
|
||
} } // namespace fdeep, namespace internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
// Copyright 2016, Tobias Hermann. | ||
// https://github.com/Dobiasd/frugally-deep | ||
// Distributed under the MIT License. | ||
// (See accompanying LICENSE file or at | ||
// https://opensource.org/licenses/MIT) | ||
|
||
#pragma once | ||
|
||
#include "fdeep/layers/activation_layer.hpp" | ||
#include "fdeep/recurrent_ops.hpp" | ||
|
||
#include <limits> | ||
#include <string> | ||
|
||
namespace fdeep { namespace internal | ||
{ | ||
|
||
class softsign_layer : public activation_layer | ||
{ | ||
public: | ||
explicit softsign_layer(const std::string& name) | ||
: activation_layer(name) | ||
{ | ||
} | ||
protected: | ||
tensor transform_input(const tensor& in_vol) const override | ||
{ | ||
return transform_tensor(softsign_activation, in_vol); | ||
} | ||
}; | ||
|
||
} } // namespace fdeep, namespace internal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters