Started on regulaization in Loss.h. I need to refactor the matsum.h since I need a total sum over the matrix. Also matmul needs a elementwise matmul function, which is the next this in the ragulaization
This commit is contained in:
@@ -7,6 +7,20 @@
|
||||
|
||||
namespace numerics{
|
||||
|
||||
template <typename T>
|
||||
T matsum_coeff(const utils::Matrix<T>& A) {
|
||||
|
||||
T b;
|
||||
|
||||
for (uint64_t i = 0; i < A.cols(); ++i){
|
||||
for (uint64_t j = 0; j < A.rows(); ++j){
|
||||
b += A(i, j);
|
||||
}
|
||||
}
|
||||
return b;
|
||||
}
|
||||
|
||||
|
||||
template <typename T>
|
||||
utils::Vector<T> matsum(const utils::Matrix<T>& A, std::string method) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user