28 #ifndef UNSUPERVISED_RBM_PROBLEMS_DISTANTMODES_H 29 #define UNSUPERVISED_RBM_PROBLEMS_DISTANTMODES_H 53 std::size_t m_batchSize;
56 void modePrototype(RealVector& pattern,
unsigned mode)
const {
57 for (std::size_t i = 0; i != pattern.size(); ++i){
58 pattern(i) = (mode % 2) ^ (i * (mode / 2 + 1) / pattern.size()) % 2;
66 void perturbate(RealVector& pattern,
double p)
const{
67 for (std::size_t i = 0; i < pattern.size(); ++i){
69 pattern(i) = !pattern(i);
75 std::vector<RealVector>
data(m_modes * m_copies,RealVector(m_dim));
76 for (std::size_t i = 0; i != data.size(); ++i) {
77 RealVector& element=data[i];
78 unsigned mode = i % m_modes;
79 modePrototype(element, mode);
80 perturbate(element, m_p);
94 :m_p(p), m_dim(dim), m_modes(modes), m_copies(copies), m_batchSize(
batchSize) {