Backup Save

This commit is contained in:
2026-08-06 10:22:52 +02:00
parent 642bba1198
commit 7f92e6884d
6 changed files with 81 additions and 13 deletions
+10 -6
View File
@@ -705,7 +705,7 @@ int main(void) {
panic::tensor::real_matrix X;
panic::tensor::uint_vector y;
panic::types::uint_t samples = 10;
panic::types::uint_t samples = 100;
panic::types::uint_t classes = 3;
@@ -716,7 +716,7 @@ int main(void) {
panic::neural_network::model mymodel;
// Create Dense layer with 2 input features and 3 output values
if (!mymodel.add_layer_dense(2,3)){
if (!mymodel.add_layer_dense(2,64)){
return false;
}
@@ -726,7 +726,7 @@ int main(void) {
}
// Create a second dense layer with 3 inputs and 3 outputs
if (!mymodel.add_layer_dense(3, 3)){
if (!mymodel.add_layer_dense(64, 3)){
return false;
}
@@ -740,15 +740,19 @@ int main(void) {
if (!mymodel.add_loss_categorical_crossentropy()){
return false;
}
if (! mymodel.add_optimizer_sgd()){
return false;
}
if (!mymodel.finalize()){
return false;
}
//mymodel.add_optimizer_sgd();
panic::types::uint_t epochs = 10;
panic::types::uint_t print_every = 1;
panic::types::uint_t epochs = 10000;
panic::types::uint_t print_every = 100;
if (!mymodel.train(X, y, epochs, print_every)){
std::cout << "Training failed" << std::endl;