added the dense layer with a forward functions. I also made the add functions for most cases.
98 lines
4.6 KiB
C++
98 lines
4.6 KiB
C++
/**++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
*
|
|
* PANIC
|
|
* Portable Algorithms and Numerics In C++
|
|
*
|
|
* Scientific computing from scratch, with feeling.
|
|
*
|
|
* Copyright (c) 2026 Michelle Bausager
|
|
*
|
|
* This file is part of PANIC.
|
|
*
|
|
* PANIC is free software licensed under the GNU General Public License v3.0 or later.
|
|
* You may redistribute and/or modify it under the terms of the GPL.
|
|
*
|
|
* PANIC is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
|
|
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
* See the LICENSE file for the full license text.
|
|
*
|
|
* SPDX-License-Identifier: GPL-3.0-or-later
|
|
*
|
|
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
|
*
|
|
* Project Name: PANIC
|
|
* Module Name: config
|
|
* File Name: constants.hpp
|
|
* Revision: 0.1.0
|
|
* Date: 20-06-2026
|
|
* Author: Michelle Bausager
|
|
*
|
|
* Description:
|
|
* Defines which types will be used in the rest of the libraries.
|
|
*
|
|
*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
|
|
#pragma once
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
// INCLUDE DESCRIPTION
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
#include <config/types.hpp> // Use to define types.
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
// DEFINE DESCRIPTION
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
// TYPE DESCRIPTION
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
// VARIABLE DESCRIPTION
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
namespace panic {
|
|
namespace constants{
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
// Type Name : panic::constants::pi
|
|
//
|
|
// Description:
|
|
// Default difinition of pi (3.14159265358979323846) used inside PANIC.
|
|
// static_cast makes sure the right number of decimals are used when defining the constant.
|
|
//
|
|
// Underlying Type:
|
|
// panic::types::real_t
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
static const panic::types::real_t pi = static_cast<panic::types::real_t>(3.14159265358979323846);
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
//
|
|
// Type Name : panic::constants::tau
|
|
//
|
|
// Description:
|
|
// Default difinition of tau (6.28318530717958647692) used inside PANIC.
|
|
// static_cast makes sure the right number of decimals are used when defining the constant.
|
|
//
|
|
// Underlying Type:
|
|
// panic::types::real_t
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
static const panic::types::real_t tau = static_cast<panic::types::real_t>(6.28318530717958647692);
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
//
|
|
// Type Name : panic::constants::e
|
|
//
|
|
// Description:
|
|
// Default difinition of eulers number, e (2.71828182845904523536) used inside PANIC.
|
|
// static_cast makes sure the right number of decimals are used when defining the constant.
|
|
//
|
|
// Underlying Type:
|
|
// panic::types::real_t
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
static const panic::types::real_t e = static_cast<panic::types::real_t>(2.71828182845904523536);
|
|
|
|
} // namespace constants
|
|
} // namespace panic
|
|
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
// FUNCTION PROTOTYPE
|
|
//---------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|