Represents a matrix with GPU-accelerated operations.
void divide_scalar(double scalar)
Divides all elements in the matrix by a scalar.
int get_cols() const
Get the number of columns in the matrix.
Matrix multiply_elementwise(const Matrix &other) const
Performs element-wise multiplication with another matrix.
Matrix transpose() const
Transposes the matrix and returns a new Matrix object.
Matrix subtract(const Matrix &other) const
Subtracts another matrix from this matrix.
Matrix multiply(const Matrix &other) const
Multiplies this matrix with another matrix.
Matrix relu_derivative() const
Applies the derivative of the ReLU activation function to the matrix.
double sum() const
Sums all elements in the matrix.
void backward(const Matrix &X, const Matrix &Y)
Perform backward propagation through the network.
Defines the NeuralNetwork class for a simple feedforward neural network.