#include <iostream>
#include "neural_network/neural_network.h"
Go to the source code of this file.
◆ main()
Definition at line 4 of file main.cu.
7 int num_examples = 60000;
10 int hidden_size = 200;
11 double learning_rate = 0.001;
15 Matrix X_train(num_examples, input_size);
16 Matrix Y_train(num_examples, output_size);
18 std::cout <<
"Reading training data..." << std::endl;
19 X_train.read_csv(
"data/X_train.csv");
20 Y_train.read_csv(
"data/Y_train.csv");
23 std::cout <<
"Transposing matrices..." << std::endl;
28 std::cout <<
"Creating neural network..." << std::endl;
32 std::cout <<
"Training neural network..." << std::endl;
33 nn.gradient_descent(X_train_transposed, Y_train_transposed, learning_rate, epochs);
36 double final_accuracy = nn.get_accuracy(Y_train_transposed);
37 std::cout <<
"Final training accuracy: " << final_accuracy << std::endl;
39 std::cout <<
"Training completed successfully." << std::endl;
40 }
catch (
const std::exception& e) {
41 std::cerr <<
"Exception caught: " << e.what() << std::endl;
Represents a matrix with GPU-accelerated operations.
Matrix transpose() const
Transposes the matrix and returns a new Matrix object.
Represents a simple feedforward neural network with one hidden layer.