Done with activation softmax backwards

This commit is contained in:
2026-07-31 19:08:57 +02:00
parent d7b74ab40f
commit 11da534fd6
30 changed files with 3029 additions and 184 deletions
+7 -6
View File
@@ -33,6 +33,7 @@
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
#pragma once
#include <config/types.hpp>
#include <tensor/vector.hpp> // for panic::vector
#include <tensor/matrix.hpp> // for panic::matrix
@@ -60,7 +61,7 @@ namespace math{
* @note This overload is convenient, but may allocate a new vector.
*/
template <typename T>
T mean(const panic::tensor::vector<T>& a);
panic::types::real_t mean(const panic::tensor::vector<T>& a);
/**
* @brief Returns the mean value of a matrix.
@@ -78,7 +79,7 @@ T mean(const panic::tensor::vector<T>& a);
*
*/
template <typename T>
T mean(const panic::tensor::matrix<T>& A);
panic::types::real_t mean(const panic::tensor::matrix<T>& A);
/**
* @brief Find the mean values row-wise of a matrix.
@@ -96,7 +97,7 @@ T mean(const panic::tensor::matrix<T>& A);
* @return false if vector sizes do not match or resizing @p c failed.
*/
template <typename T>
bool mean_rowwise(const panic::tensor::matrix<T>& A, panic::tensor::vector<T>& c);
bool mean_rowwise(const panic::tensor::real_matrix& A, panic::tensor::real_vector& c);
/**
* @brief Returns a new matrix containing the mean row-wise elementwise.
@@ -115,7 +116,7 @@ bool mean_rowwise(const panic::tensor::matrix<T>& A, panic::tensor::vector<T>& c
* @note This overload is convenient, but may allocate a new vector.
*/
template <typename T>
panic::tensor::vector<T> mean_rowwise(const panic::tensor::matrix<T>& A);
panic::tensor::real_vector mean_rowwise(const panic::tensor::real_matrix& A);
/**
@@ -134,7 +135,7 @@ panic::tensor::vector<T> mean_rowwise(const panic::tensor::matrix<T>& A);
* @return false if vector sizes do not match or resizing @p c failed.
*/
template <typename T>
bool mean_colwise(const panic::tensor::matrix<T>& A, panic::tensor::vector<T>& c);
bool mean_colwise(const panic::tensor::real_matrix& A, panic::tensor::real_vector& c);
/**
* @brief Returns a new matrix containing the mean column-wise elementwise.
@@ -153,7 +154,7 @@ bool mean_colwise(const panic::tensor::matrix<T>& A, panic::tensor::vector<T>& c
* @note This overload is convenient, but may allocate a new vector.
*/
template <typename T>
panic::tensor::vector<T> mean_colwise(const panic::tensor::matrix<T>& A);
panic::tensor::real_vector mean_colwise(const panic::tensor::real_matrix& A);
} // namespace math
} // namespace panic