Started Loss, done softmax, up to p.125

I've implemented alot of support functions that needs to be refactored, optimised and tested; mean.h, exponential.h, matdiv.h matsum.h matsubtract.h. Maybe we need to have a look at if matdiv/matmul should be in the same. Same with matadd/matsubtract and if some of it should be in matvec.h.
This commit is contained in:
2025-10-05 19:45:37 +02:00
parent 1b59713565
commit ea359f3b09
18 changed files with 407 additions and 56 deletions
+13 -10
View File
@@ -24,24 +24,27 @@ int main(int argc, char const *argv[])
{
utils::Mf X(10,2, 0);
utils::Vf y(10, 0);
utils::Vd y(10, 0);
neural_networks::create_spital_data(100, 3, X, y);
neural_networks::dense_layer<float> layer(2, 3);
neural_networks::dense_layer<float> dense1(2, 3);
neural_networks::activation_ReLU<float> activation1;
neural_networks::dense_layer<float> dense2(3, 3);
neural_networks::activation_softmax<float> activation2;
neural_networks::activation_ReLU<float> RelU;
dense1.forward(X);
activation1.forward(dense1.outputs);
dense2.forward(activation1.outputs);
activation2.forward(dense2.outputs);
layer.forward(X);
RelU.forward(layer.outputs);
for (int i = 0; i < 5; ++i){
std::cout << RelU.outputs.get_row(i) << std::endl;
std::cout << activation2.outputs.get_row(i) << std::endl;
}
//layer1_output.print();
//layer2_output.print();
//std::cout << output << std::endl;