model.cpp/hpp

I made the model struct to store layers. I'm still missing the backward functions, but it's functional
This commit is contained in:
2026-07-28 19:36:26 +02:00
parent 441540a996
commit c7e87fe191
10 changed files with 552 additions and 107 deletions
+21
View File
@@ -45,6 +45,8 @@
#include <neural_network/layer/layer_dense.hpp>
#include <math/add.hpp>
#include <random/uniform.hpp>
#include <neural_network/layer/layer_dense.hpp>
#include <neural_network/model/model.hpp>
@@ -756,6 +758,25 @@ int main(void) {
panic::random::uniform(D3, 100.f, 200.f);
panic::io::print_matrix(D3);
std::cout << "neural_network" << std::endl;
panic::neural_network::layer_dense layer_dense01(3,4);
std::cout << layer_dense01.forward(D1) << std::endl;
panic::io::print_matrix(layer_dense01.outputs);
panic::neural_network::model mymodel;
mymodel.add_layer_dense(3,4);
mymodel.forward(D1);
return 0;