AIToolbox
A library that offers tools for AI problem solving.
|
Go to the documentation of this file. 1 #ifndef AI_TOOLBOX_BANDIT_MODEL_HEADER_FILE
2 #define AI_TOOLBOX_BANDIT_MODEL_HEADER_FILE
25 template <
typename Dist>
40 template <
typename... TupleArgs>
41 Model(TupleArgs... tupleArgs);
54 template <
typename... Args>
55 Model(std::vector<std::tuple<Args...>> args);
64 decltype(
auto)
sampleR(
size_t a)
const;
78 const std::vector<Dist> &
getArms()
const;
81 mutable std::vector<Dist> arms_;
85 template <
typename Dist>
86 template <
typename... TupleArgs>
91 template <
typename Dist>
92 template <
typename... Args>
96 arms_.reserve(args.size());
100 for (
auto && t : args)
101 std::apply([
this](
auto&&... params){arms_.emplace_back(std::move(params)...);}, std::move(t));
104 template <
typename Dist>
105 decltype(
auto)
Model<Dist>::sampleR(const
size_t a)
const {
106 return arms_[a](rand_);
109 template <
typename Dist>
112 template <
typename Dist>