-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.cpp
More file actions
21 lines (19 loc) · 710 Bytes
/
sample.cpp
File metadata and controls
21 lines (19 loc) · 710 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <iostream>
#include <scenn/load.hpp>
#include <scenn/scenn.hpp>
SCENN_CONSTEXPR auto mini_mnist_test() {
using namespace scenn;
auto [train_data, test_data] = load_mini_mnist_data<double>();
auto evaluation =
SequentialNetwork(CrossEntropy(), DenseLayer<784, 196, double>(),
ActivationLayer<196, double>(Sigmoid()),
DenseLayer<196, 3, double>(),
ActivationLayer<3, double>(Softmax()))
.train<100>(std::move(train_data), 20, 0.1)
.evaluate(std::move(test_data));
return evaluation;
}
int main() {
SCENN_CONSTEXPR auto evaluation = mini_mnist_test();
std::cout << evaluation << std::endl;
}