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:
@@ -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});
|
||||
|
||||
Reference in New Issue
Block a user