Document the new DPF surfaces in one command set, and test the field, half-tree, and multipoint edges.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
0d8a5a8131
commit
0dff6df8ed
250 changed files with 12199 additions and 1981 deletions
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/celu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `celu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/elish.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `elish`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,7 +21,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct elish
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) elish
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -44,6 +48,8 @@ struct gadget_hints<elish>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/elu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `elu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/gelu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `gelu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct gelu
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) gelu
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -42,6 +46,8 @@ struct gadget_hints<gelu>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/hardelish.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `hardelish`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/hardshrink.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `hardshrink`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,9 +20,13 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double hardshrink_default_lambda = 0.5;
|
||||
template <double const & lambda = hardshrink_default_lambda>
|
||||
struct hardshrink
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardshrink_lut) hardshrink
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -45,6 +49,8 @@ struct gadget_hints<hardshrink<lambda>>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { {0,1}, {0}, {0,1} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/hardsigmoid.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `hardsigmoid`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct hardsigmoid
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardsigmoid_lut) hardsigmoid
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -44,6 +48,8 @@ struct gadget_hints<hardsigmoid>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { {0}, {0.5,1/6.0}, {1} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/hardswish.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `hardswish`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct hardswish
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardswish_lut) hardswish
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -44,6 +48,8 @@ struct gadget_hints<hardswish>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { {0}, {0,0.5,1/6.0}, {0,1,0} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/hardtanh.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `hardtanh`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct hardtanh
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_hardtanh_lut) hardtanh
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -44,6 +48,8 @@ struct gadget_hints<hardtanh>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { {-1}, {0,1}, {1} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/leakyrelu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `leakyrelu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,10 +20,14 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double leakyrelu_default_negative_slope = 0.01;
|
||||
static constexpr double leakyrelu_zero_negative_slope = 0.0;
|
||||
template <double const & negative_slope = leakyrelu_default_negative_slope>
|
||||
struct leakyrelu
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_leaky_relu_lut) leakyrelu
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -46,6 +50,8 @@ struct gadget_hints<leakyrelu<negative_slope>>
|
|||
inline static constexpr std::array<double, degree+1> canonical_polys[] = { {0,negative_slope}, {0,1} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/lecun_tanh.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `lecun_tanh`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/logsigmoid.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `logsigmoid`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,7 +21,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct logsigmoid
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) logsigmoid
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x) { return std::log(sigmoid{}(x)); }
|
||||
|
|
@ -40,6 +44,8 @@ struct gadget_hints<logsigmoid>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/mish.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `mish`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,7 +21,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct mish
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) mish
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -43,6 +47,8 @@ struct gadget_hints<mish>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/one_minus_relu.hpp
|
||||
/// @file grotto/gadgets/activations/one_minus_sigmoid.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `one_minus_sigmoid`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,7 +21,10 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct one_minus_sigmoid
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) one_minus_sigmoid
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -43,6 +46,8 @@ struct gadget_hints<one_minus_sigmoid>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/relu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `relu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,7 +21,10 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
using relu = leakyrelu<leakyrelu_zero_negative_slope>;
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
using relu HEDLEY_DEPRECATED_FOR(2026, grotto::make_relu_lut) = leakyrelu<leakyrelu_zero_negative_slope>;
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/relu6.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `relu6`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,9 +20,13 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double relu6_default_clip = 6;
|
||||
template <double const & clip = 6>
|
||||
struct relu6
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_relu6_lut) relu6
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -44,6 +48,8 @@ struct gadget_hints<relu6<clip>>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { 0, {0,1}, clip };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/selu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `selu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/serf.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `serf`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,7 +21,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct serf
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) serf
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -43,6 +47,8 @@ struct gadget_hints<serf>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/sigmoid.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `sigmoid`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct sigmoid
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) sigmoid
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x) { return 1/(1+std::exp(-x)); }
|
||||
|
|
@ -39,6 +43,8 @@ struct gadget_hints<sigmoid>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/silu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `silu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct silu
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) silu
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x) { return x*sigmoid{}(x); }
|
||||
|
|
@ -39,6 +43,8 @@ struct gadget_hints<silu>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/smoothstep.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `smoothstep`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,9 +20,13 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double smoothstep_default_gamma = 1;
|
||||
template <double const & gamma = smoothstep_default_gamma>
|
||||
struct smoothstep
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) smoothstep
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -46,6 +50,8 @@ struct gadget_hints<smoothstep<gamma>>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { 0, {-2/(gamma*gamma*gamma),0,3/(2*gamma),0.5}, 1 };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/softminus.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `softminus`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -21,9 +21,13 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double softminus_default_beta = 1;
|
||||
template <double const & beta = softminus_default_beta>
|
||||
struct softminus
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) softminus
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -45,6 +49,8 @@ struct gadget_hints<softminus<beta>>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/softplus.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `softplus`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,9 +20,13 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double softplus_default_beta = 1;
|
||||
template <double const & beta = softplus_default_beta>
|
||||
struct softplus
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) softplus
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -45,6 +49,8 @@ struct gadget_hints<softplus<beta>>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/softshrink.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `softshrink`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,9 +20,13 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
static constexpr double softshrink_default_lambda = 0.5;
|
||||
template <double const & lambda = softshrink_default_lambda>
|
||||
struct softshrink
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_softshrink_lut) softshrink
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -46,6 +50,8 @@ struct gadget_hints<softshrink<lambda>>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { {lambda,1}, {0}, {-lambda,1} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/softsign.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `softsign`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/squared_relu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `squared_relu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct squared_relu
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::make_squared_relu_lut) squared_relu
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x)
|
||||
|
|
@ -43,6 +47,8 @@ struct gadget_hints<squared_relu>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { {0}, {0,0,1} };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/starrelu.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `starrelu`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/tanhexp.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `tanhexp`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
@ -20,7 +20,11 @@ namespace grotto
|
|||
namespace gadgets
|
||||
{
|
||||
|
||||
struct tanhexp
|
||||
HEDLEY_DIAGNOSTIC_PUSH
|
||||
HEDLEY_DIAGNOSTIC_DISABLE_DEPRECATED
|
||||
|
||||
|
||||
struct HEDLEY_DEPRECATED_FOR(2026, grotto::eval_window) tanhexp
|
||||
{
|
||||
template <typename T>
|
||||
T operator()(T x) { return x*std::tanh(std::exp(x)); }
|
||||
|
|
@ -39,6 +43,8 @@ struct gadget_hints<tanhexp>
|
|||
static constexpr std::array<double, degree+1> canonical_polys[] = { };
|
||||
};
|
||||
|
||||
HEDLEY_DIAGNOSTIC_POP
|
||||
|
||||
} // namespace gadgets
|
||||
|
||||
} // namespace grotto
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
/// @file grotto/gadgets/activations/tanhshrink.hpp
|
||||
/// @author Ryan Henry <ryan.henry@ucalgary.ca>
|
||||
/// @brief
|
||||
/// @brief Cleartext reference for `tanhshrink`.
|
||||
/// @copyright Copyright (c) 2019-2023 Ryan Henry and others
|
||||
/// @license Released under a GNU General Public v2.0 (GPLv2) license;
|
||||
/// see [LICENSE.md](@ref GPLv2) for details.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue