Dense Layer, Add

added the dense layer with a forward functions. I also made the add functions for most cases.
This commit is contained in:
2026-06-25 19:43:07 +02:00
parent 9b20278395
commit 189d605bfa
27 changed files with 1657 additions and 902 deletions
+15 -15
View File
@@ -68,17 +68,17 @@ namespace panic{
template <typename T>
struct vector{
panic::uint_t length;
panic::types::uint_t length;
T* data;
// empty contructor
vector();
// contructor with size allocation
vector(panic::uint_t size);
vector(panic::types::uint_t size);
// contructor with size allocation and sets it all to a value
vector(panic::uint_t size, T value);
vector(panic::types::uint_t size, T value);
// copy-contructor
// vector a(3);
@@ -96,25 +96,25 @@ struct vector{
// function returns size.
// const tells compiler that the fuction don't edit the objert.
panic::uint_t size() const;
panic::types::uint_t size() const;
// function to resize data vector (I need a new that don't save the vlaues)
bool resize(panic::uint_t new_size);
bool resize(panic::types::uint_t new_size);
// fill data with value
bool fill(T value);
// lets you read and write v[index]
T& operator[](panic::uint_t index);
T& operator[](panic::types::uint_t index);
// lets you read v[index] from a const vector
const T& operator[](panic::uint_t index) const;
const T& operator[](panic::types::uint_t index) const;
// lets you read and write v.at(index)
T& at(panic::uint_t index);
T& at(panic::types::uint_t index);
// lets you read v.at(index) from a const vector
const T& at(panic::uint_t index) const;
const T& at(panic::types::uint_t index) const;
};
@@ -123,17 +123,17 @@ struct vector{
// TYPE ALIASES
//---------------------------------------------------------------------------------------------------------------------------
typedef vector<panic::real_t> real_vector;
typedef vector<panic::int_t> int_vector;
typedef vector<panic::uint_t> uint_vector;
typedef vector<panic::types::real_t> real_vector;
typedef vector<panic::types::int_t> int_vector;
typedef vector<panic::types::uint_t> uint_vector;
//---------------------------------------------------------------------------------------------------------------------------
// EXPLICIT TEMPLATE DECLARATION
//---------------------------------------------------------------------------------------------------------------------------
extern template struct vector<panic::real_t>;
extern template struct vector<panic::int_t>;
extern template struct vector<panic::uint_t>;
extern template struct vector<panic::types::real_t>;
extern template struct vector<panic::types::int_t>;
extern template struct vector<panic::types::uint_t>;
} // namespace tensor