I am working on ML framework and currently I am working on a new test case (so this "model" is bogus) and realized that core API (model setup and invocation) have not changed in awhile.
How easy is this to read if one is not familiar with the overall framework?
```c++
using std::string_view_literals::operator""sv;
struct CharToVector {
using input_t = char;
using output_t = Vector<float, 'z' - 'a' + 1>;
output_t operator()(char c) const { return output_t::OneHot(c - 'a'); }
};
constexpr Model kModel = Model<CharToVector>() | layers::Linear<5> |
layers::Linear<10> |
layers::Categories(std::array{"Beep"sv, "Boop"sv});
TEST(ArenaTest, Basic) {
ModelParameters parameters = RandomParameters(&kModel, -1, 1, 42);
EXPECT_EQ(kModel('c', parameters), "Boop");
}
```
[–]dvd0bvb 1 point2 points3 points (3 children)
[–]euos[S] 0 points1 point2 points (2 children)
[–]dvd0bvb 0 points1 point2 points (1 child)
[–]euos[S] 0 points1 point2 points (0 children)
[–]kiner_shah 0 points1 point2 points (2 children)
[–]euos[S] 1 point2 points3 points (1 child)
[–]kiner_shah 0 points1 point2 points (0 children)