22 template <
typename T =
double>
34 (is_single_precision_t<T> && impl::egblas::has_sinv_dropout_seed) || (is_double_precision_t<T> && impl::egblas::has_dinv_dropout_seed);
62 std::uniform_int_distribution<long> seed_dist;
67 impl::egblas::inv_dropout_seed(
etl::size(y), probability, alpha, t1.gpu_memory(), 1, seed_dist(rand_engine));
80 std::uniform_int_distribution<long> seed_dist;
83 impl::egblas::inv_dropout_seed(
etl::size(y), probability, alpha, y.gpu_memory(), 1, seed_dist(rand_engine));
98 return os <<
"inverted_dropout(p=" << s.
probability <<
")";
105 template <
typename G,
typename T =
double>
116 static constexpr
bool gpu_computable =
117 (is_single_precision_t<T> && impl::egblas::has_sinv_dropout_seed) || (is_double_precision_t<T> && impl::egblas::has_dinv_dropout_seed);
145 template <
typename Y>
147 std::uniform_int_distribution<long> seed_dist;
152 impl::egblas::inv_dropout_seed(
etl::size(y), probability, alpha, t1.gpu_memory(), 1, seed_dist(rand_engine));
162 template <
typename Y>
164 std::uniform_int_distribution<long> seed_dist;
167 impl::egblas::inv_dropout_seed(
etl::size(y), probability, alpha, y.gpu_memory(), 1, seed_dist(rand_engine));
182 return os <<
"inverted_dropout(p=" << s.
probability <<
")";
G & rand_engine
The random engine.
Definition: inverted_dropout_mask.hpp:110
auto s(T &&value)
Force the evaluation of the given expression.
Definition: stop.hpp:18
value_type operator()()
Generate a new value.
Definition: inverted_dropout_mask.hpp:130
Generator from an uniform distribution using a custom random engine.
Definition: inverted_dropout_mask.hpp:106
auto gpu_compute_hint(Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: inverted_dropout_mask.hpp:61
const T probability
The dropout probability.
Definition: inverted_dropout_mask.hpp:26
T value_type
The value type.
Definition: inverted_dropout_mask.hpp:24
Generator from an uniform distribution.
Definition: inverted_dropout_mask.hpp:23
friend std::ostream & operator<<(std::ostream &os, const inverted_dropout_mask_generator_g_op &s)
Outputs the given generator to the given stream.
Definition: inverted_dropout_mask.hpp:181
static constexpr bool gpu_computable
Indicates if the operator can be computed on GPU.
Definition: inverted_dropout_mask.hpp:33
std::conditional_t< std::is_floating_point_v< T >, std::uniform_real_distribution< T >, std::uniform_int_distribution< T > > dropout_distribution
Selector helper to get an dropout_distribution based on the type (real or int)
Definition: dropout_mask.hpp:26
dropout_distribution< value_type > distribution
The used distribution.
Definition: inverted_dropout_mask.hpp:28
Root namespace for the ETL library.
Definition: adapter.hpp:15
inverted_dropout_mask_generator_op(T probability)
Construct a new generator with the given start and end of the range.
Definition: inverted_dropout_mask.hpp:39
friend std::ostream & operator<<(std::ostream &os, const inverted_dropout_mask_generator_op &s)
Outputs the given generator to the given stream.
Definition: inverted_dropout_mask.hpp:97
decltype(auto) force_temporary_gpu_dim_only(E &&expr)
Force a temporary out of the expression, without copying its content.
Definition: temporary.hpp:223
auto gpu_compute_hint(Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: inverted_dropout_mask.hpp:146
constexpr size_t size(const E &expr) noexcept
Returns the size of the given ETL expression.
Definition: helpers.hpp:108
inverted_dropout_mask_generator_g_op(G &g, T probability)
Construct a new generator with the given start and end of the range.
Definition: inverted_dropout_mask.hpp:124
T value_type
The value type.
Definition: inverted_dropout_mask.hpp:107
const T probability
The dropout probability.
Definition: inverted_dropout_mask.hpp:109
value_type operator()()
Generate a new value.
Definition: inverted_dropout_mask.hpp:45
std::mt19937_64 random_engine
The random engine used by the library.
Definition: random.hpp:22
dropout_distribution< value_type > distribution
The used distribution.
Definition: inverted_dropout_mask.hpp:111
Y & gpu_compute(Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: inverted_dropout_mask.hpp:163
Y & gpu_compute(Y &y) noexcept
Compute the result of the operation using the GPU.
Definition: inverted_dropout_mask.hpp:79
random_engine rand_engine
The random engine.
Definition: inverted_dropout_mask.hpp:27