<commit_before>//=======================================================================
// Copyright (c) 2014 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#ifndef DBN_CONV_LAYER_HPP
#define DBN_CONV_LAYER_HPP

#include "base_conf.hpp"
#include "contrastive_divergence.hpp"
#include "tmp.hpp"

namespace dll {

template<std::size_t NV_T, std::size_t NH_T, std::size_t K_T, typename... Parameters>
struct conv_layer {
    static constexpr const std::size_t NV = NV_T;
    static constexpr const std::size_t NH = NH_T;
    static constexpr const std::size_t K = K_T;

    static_assert(NV > 0, "A matrix of at least 1x1 is necessary for the visible units");
    static_assert(NH > 0, "A matrix of at least 1x1 is necessary for the hidden units");
    static_assert(K > 0, "At least one group is necessary");

    //Make sure only valid types are passed to the configuration list
    static_assert(
        is_valid<tmp_list<momentum, batch_size_id, visible_unit_id, hidden_unit_id>, Parameters...>::value,
        "Invalid parameters type");

    static constexpr const bool Momentum = is_present<momentum, Parameters...>::value;
    static constexpr const std::size_t BatchSize = get_value<batch_size<1>, Parameters...>::value;
    static constexpr const Type VisibleUnit = get_value<visible_unit<Type::SIGMOID>, Parameters...>::value;
    static constexpr const Type HiddenUnit = get_value<visible_unit<Type::SIGMOID>, Parameters...>::value;

    template <typename RBM>
    using trainer_t = typename get_template_type<trainer<cd1_trainer_t>, Parameters...>::template type<RBM>;

    static_assert(BatchSize > 0, "Batch size must be at least 1");
};

} //end of dbn namespace
<commit_msg>Improvements<commit_after>//=======================================================================
// Copyright (c) 2014 <NAME>
// Distributed under the terms of the MIT License.
// (See accompanying file LICENSE or copy at
//  http://opensource.org/licenses/MIT)
//=======================================================================

#ifndef DBN_CONV_LAYER_HPP
#define DBN_CONV_LAYER_HPP

#include "base_conf.hpp"
#include "contrastive_divergence.hpp"
#include "tmp.hpp"

namespace dll {

template<std::size_t NV_T, std::size_t NH_T, std::size_t K_T, typename... Parameters>
struct conv_layer {
    static constexpr const std::size_t NV = NV_T;
    static constexpr const std::size_t NH = NH_T;
    static constexpr const std::size_t K = K_T;

    static_assert(NV > 0, "A matrix of at least 1x1 is necessary for the visible units");
    static_assert(NH > 0, "A matrix of at least 1x1 is necessary for the hidden units");
    static_assert(K > 0, "At least one group is necessary");

    //Make sure only valid types are passed to the configuration list
    static_assert(
        is_valid<tmp_list<
                momentum, batch_size_id, visible_unit_id, hidden_unit_id,
                weight_decay_id>
            , Parameters...>::value,
        "Invalid parameters type");

    static constexpr const bool Momentum = is_present<momentum, Parameters...>::value;
    static constexpr const std::size_t BatchSize = get_value<batch_size<1>, Parameters...>::value;
    static constexpr const Type VisibleUnit = get_value<visible_unit<Type::SIGMOID>, Parameters...>::value;
    static constexpr const Type HiddenUnit = get_value<hidden_unit<Type::SIGMOID>, Parameters...>::value;
    static constexpr const DecayType Decay = get_value<weight_decay<DecayType::NONE>, Parameters...>::value;

    template <typename RBM>
    using trainer_t = typename get_template_type<trainer<cd1_trainer_t>, Parameters...>::template type<RBM>;

    static_assert(BatchSize > 0, "Batch size must be at least 1");
};

} //end of dbn namespace

{'fraction_non_alphanumeric': 0.17539804827940422, 'fraction_numerical': 0.007704160246533128, 'mean_word_length': 4.524822695035461, 'pattern_counts': {'":': 0, '<': 35, '<?xml version=': 0, '>': 43, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5800752', 'n_tokens_mistral': 1193, 'n_tokens_neox': 1099, 'n_words': 343}