Fittet new functions to everying in neural networks. Still need to optimise for uint64_t vs int64_t and vec vs mat in some places.

This commit is contained in:
2026-05-16 20:37:05 +02:00
parent 412a854c65
commit d2fe8aa65c
50 changed files with 489 additions and 1482 deletions
+8 -3
View File
@@ -3,8 +3,8 @@
#include <cstdint> //uint64_t
#include <stdexcept> // std::runtime_error
#include "../utils/vector.h"
#include "../utils/matrix.h"
#include "utils/vector.h"
#include "utils/matrix.h"
namespace numerics::detail{
@@ -15,7 +15,12 @@ namespace numerics::detail{
const uint64_t n = A.cols(); // also B.rows()
const uint64_t p = B.cols();
if(n != B.rows()){
throw std::runtime_error("matmul: dimension mismatch");
throw std::runtime_error(
"matmul: dimension mismatch: A is " +
std::to_string(A.rows()) + "x" + std::to_string(A.cols()) +
", B is " +
std::to_string(B.rows()) + "x" + std::to_string(B.cols())
);
}
T tmp;
utils::Matrix<T> C(m, p, T{0});