refactor: remove input.hpp

This commit is contained in:
2026-10-25 19:21:17 +01:00
parent 471c9c8997
commit fa0418914a
8 changed files with 81 additions and 146 deletions
+3 -3
View File
@@ -11,7 +11,7 @@
#include <random>
#include <vector>
using network_type = cenet::network<cenet::tensor_input<float, 1, 28, 28>,
using network_type = cenet::network<cenet::tensor<float, 1, 28, 28>,
cenet::conv2d_layer<8, 3, 1, 1>,
cenet::relu_layer,
cenet::maxpool_layer<>,
@@ -157,11 +157,11 @@ int main(void) {
const auto& output = mnistNet->feed(validationSet[i].xs);
for (std::size_t j = 0; j < 10; ++j) {
float diff = output.get()[0][j] - validationSet[i].ys[0][j];
float diff = output[0][j] - validationSet[i].ys[0][j];
totalLoss += diff * diff;
}
if (col_largest_idx(output.get()[0]) == col_largest_idx(validationSet[i].ys[0])) ++hits;
if (col_largest_idx(output[0]) == col_largest_idx(validationSet[i].ys[0])) ++hits;
}
currentLoss = totalLoss / static_cast<double>(validationSet.size());
+2 -2
View File
@@ -15,7 +15,7 @@ int main(void) {
};
// network net;
using network_type = cenet::network<cenet::dense_input<2>,
using network_type = cenet::network<cenet::mat<1, 2, float>,
cenet::dense_layer<2>,
cenet::sigmoid_layer,
cenet::dense_layer<1>,
@@ -50,7 +50,7 @@ int main(void) {
xs[0][0] = static_cast<float>(i & 1);
xs[0][1] = static_cast<float>(i > 1);
float yHat = xorNet.feed(xs).get()[0][0];
float yHat = xorNet.feed(xs)[0][0];
float error = yHat - s_trainData[i];
if ((gen % 1000) == 0) {