refactor(tulip): move cenet/math/ to tulip/

This commit is contained in:
2026-11-22 12:54:57 +01:00
parent 14292b1d97
commit dea973ddd6
19 changed files with 157 additions and 167 deletions
+14 -15
View File
@@ -5,15 +5,14 @@
#ifndef CENET_LAYERS_DENSE_HPP
#define CENET_LAYERS_DENSE_HPP
#include "../math/tensor.hpp"
#include "../math/tensor_fwd.hpp"
#include "../optim/adam.hpp"
#include "./layer_fwd.hpp"
#include "./layer_traits.hpp"
#include "./retained.hpp"
#include "cenet/optim/adam.hpp"
#include <cmath>
#include <iostream>
#include <tulip/tensor.hpp>
namespace cenet {
namespace layers {
@@ -28,12 +27,12 @@ struct dense final : public layer_tag {
using input_type = typename traits::input_type;
using value_type = typename input_type::value_type;
using output_type = math::matrix<value_type, 1, Features>;
using output_type = tulip::matrix<value_type, 1, Features>;
static constexpr auto input_cols = input_type::shape_type::template sget<1>();
using weights_type = math::matrix<math::inline_storage<value_type>, input_cols, Features>;
using biases_type = math::matrix<math::inline_storage<value_type>, 1, Features>;
using weights_type = tulip::matrix<tulip::inline_storage<value_type>, input_cols, Features>;
using biases_type = tulip::matrix<tulip::inline_storage<value_type>, 1, Features>;
weights_type weights;
biases_type biases;
@@ -68,12 +67,12 @@ struct dense final : public layer_tag {
using input_type = typename traits::input_type;
using value_type = typename input_type::value_type;
using output_type = math::matrix<value_type, 1, Features>;
using output_type = tulip::matrix<value_type, 1, Features>;
static constexpr auto input_cols = input_type::shape_type::template sget<1>();
using weights_type = math::matrix<math::inline_storage<value_type>, input_cols, Features>;
using biases_type = math::matrix<math::inline_storage<value_type>, 1, Features>;
using weights_type = tulip::matrix<tulip::inline_storage<value_type>, input_cols, Features>;
using biases_type = tulip::matrix<tulip::inline_storage<value_type>, 1, Features>;
weights_type weights;
biases_type biases;
@@ -98,12 +97,12 @@ struct dense final : public layer_tag {
using input_type = typename traits::input_type;
using value_type = typename input_type::value_type;
using output_type = math::matrix<value_type, 1, Features>;
using output_type = tulip::matrix<value_type, 1, Features>;
static constexpr auto input_cols = input_type::shape_type::template sget<1>();
using weights_type = math::matrix<math::inline_storage<value_type>, input_cols, Features>;
using biases_type = math::matrix<math::inline_storage<value_type>, 1, Features>;
using weights_type = tulip::matrix<tulip::inline_storage<value_type>, input_cols, Features>;
using biases_type = tulip::matrix<tulip::inline_storage<value_type>, 1, Features>;
weights_type weigths;
biases_type biases;
@@ -120,12 +119,12 @@ struct dense final : public layer_tag {
using input_type = typename traits::input_type;
using value_type = typename input_type::value_type;
using output_type = math::matrix<value_type, 1, Features>;
using output_type = tulip::matrix<value_type, 1, Features>;
static constexpr auto input_cols = input_type::shape_type::template sget<1>();
using weights_type = math::matrix<math::inline_storage<value_type>, input_cols, Features>;
using biases_type = math::matrix<math::inline_storage<value_type>, 1, Features>;
using weights_type = tulip::matrix<tulip::inline_storage<value_type>, input_cols, Features>;
using biases_type = tulip::matrix<tulip::inline_storage<value_type>, 1, Features>;
std::size_t time = 0;