eb0a49591e
Implemented rng::uniform and rng::binomial for single values, vectors and matrices. implemeted dropout layers and tested it. Also fixed the validation code. Before it used y one place, now it uses y_test as it should.
20 lines
357 B
C++
20 lines
357 B
C++
#pragma once
|
|
|
|
#include <random>
|
|
#include <cstdint>
|
|
|
|
namespace rng {
|
|
|
|
using seed_type = std::uint64_t;
|
|
using engine_type = std::mt19937_64;
|
|
|
|
inline engine_type& engine() {
|
|
static thread_local engine_type eng{std::random_device{}()};
|
|
return eng;
|
|
}
|
|
|
|
inline void seed(seed_type value) {
|
|
engine().seed(value);
|
|
}
|
|
|
|
} |