From 4bd3064b6571dec04d17d67b8e6fd3128ceb1f09 Mon Sep 17 00:00:00 2001 From: nasr Date: Sun, 19 Apr 2026 18:38:51 +0200 Subject: feature(main): working on the design. i dont know how machine learning works pfff... --- source/tb_ml/tb_mh.h | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 source/tb_ml/tb_mh.h (limited to 'source/tb_ml/tb_mh.h') diff --git a/source/tb_ml/tb_mh.h b/source/tb_ml/tb_mh.h new file mode 100644 index 0000000..91e1e7b --- /dev/null +++ b/source/tb_ml/tb_mh.h @@ -0,0 +1,43 @@ +#ifndef TB_ML_H +#define TB_ML_H + + +//- supervised learning model by abdellah el morabit +//- from +#define M_E 2.7182818284590452354 /* e */ + +typedef struct training_sample trainig_sample; +struct training_sample +{ + +}; + +typedef struct prediction_data predicition_data; +struct prediction_data +{ + f32 w; + f32 y; +}; + + +typedef struct prediction_category prediction_category; +struct category +{ + string8 name; + predicition_data data; +}; + +f(f32 d) { + return d * d; +} + +internal f32 +derivative(f32 x, f32 (*f)(f32)) { + + f32 h = 1e-6; // small interval to differnetiate the scope + return (f(x + h) - f(x - h)) / (2.0 * h); +} + + + +#endif -- cgit v1.3