You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<imgsrc="https://img.shields.io/badge/Edge%20AI-Deep%20Learning-purple.svg?style=flat-square"alt="Edge AI Deep Learning">
12
+
</p>
13
13
14
14
---
15
15
@@ -77,7 +77,7 @@ Located in the `tensor.py` and `layers.py` modules, this is the automatic differ
77
77
78
78
The framework ensures the Separation of Concerns (SoC) principle through its internal managers:
79
79
80
-
### **. ml_manager.py (The Orchestrator)**
80
+
### **1. ml_manager.py (The Orchestrator)**
81
81
82
82
The high-level API that unifies the workflow. It acts as a bridge between the user and the raw algorithms.
83
83
@@ -88,22 +88,22 @@ The high-level API that unifies the workflow. It acts as a bridge between the us
88
88
3.**Training:** Fits the selected model.
89
89
***predict() Polymorphism:** Automatically handles raw input, applies the saved scaler, and runs inference.
90
90
91
-
### **. ml_compat.py (Safety & Compatibility)**
91
+
### **2. ml_compat.py (Safety & Compatibility)**
92
92
93
93
The data guardian. It ensures that the dynamic nature of Python does not break the strict static nature of C.
94
94
95
95
***_flatten_tree_to_arrays():** The most critical function for tree-based models. It traverses the Python dictionary tree structure and serializes it into parallel arrays (C-style), enabling the iterative execution logic required for microcontrollers.
96
96
***check_dims():** strictly validates input dimensions before prediction, preventing index out-of-bounds errors in the generated C code.
97
97
***impute_missing_values():** Ensures data integrity before it reaches the mathematical core.
98
98
99
-
### **. ml_factory.py (The Factory Pattern)**
99
+
### **3. ml_factory.py (The Factory Pattern)**
100
100
101
101
Decouples model instantiation from the logic flow.
***Purpose:** Allows the system to instantiate complex objects (like RandomForestRegressor) from simple JSON strings. This is vital for the SaveLoad system and prevents circular dependencies between modules.
105
105
106
-
### *5. ml_exporter.py (Serialization & Export)**
106
+
### *4. ml_exporter.py (Serialization & Export)**
107
107
108
108
Handles the persistence and translation of models.
109
109
@@ -185,9 +185,9 @@ The output is standard C99 code, ready to be included in an Arduino sketch (#inc
185
185
// Preprocessing (MinMax Scaler baked in)
186
186
voidpreprocess_data(float row[]) {
187
187
// Hardcoded values from training phase
188
-
row[0] = (row[0] - 25.0) 60.0;
189
-
row[1] = (row[1] - 15.0) 47.0;
190
-
row[2] = (row[2] - 100.0) 800.0;
188
+
row[0] = (row[0] - 25.0) / 60.0;
189
+
row[1] = (row[1] - 15.0) / 47.0;
190
+
row[2] = (row[2] - 100.0) / 800.0;
191
191
}
192
192
193
193
Model Arrays (Flattened Tree)
@@ -361,7 +361,7 @@ Ubicado en los módulos `tensor.py` y `layers.py`, este es el motor de diferenci
361
361
362
362
El framework asegura el principio de Separación de Responsabilidades a través de sus gestores internos:
363
363
364
-
### **. ml_manager.py (El Orquestador)**
364
+
### **1. ml_manager.py (El Orquestador)**
365
365
366
366
La API de alto nivel que unifica el flujo de trabajo. Actúa como un puente entre el usuario y los algoritmos base.
367
367
@@ -374,7 +374,7 @@ La API de alto nivel que unifica el flujo de trabajo. Actúa como un puente entr
374
374
375
375
---
376
376
377
-
### **. ml_compat.py (Seguridad y Compatibilidad)**
377
+
### **2. ml_compat.py (Seguridad y Compatibilidad)**
378
378
379
379
El guardián de los datos. Asegura que la naturaleza dinámica de Python no rompa la estricta naturaleza estática de C.
380
380
@@ -384,7 +384,7 @@ El guardián de los datos. Asegura que la naturaleza dinámica de Python no romp
384
384
385
385
---
386
386
387
-
### **. ml_factory.py (El Patrón Factory)**
387
+
### **3. ml_factory.py (El Patrón Factory)**
388
388
389
389
Desacopla la instanciación del modelo del flujo de lógica.
390
390
@@ -393,12 +393,12 @@ Desacopla la instanciación del modelo del flujo de lógica.
393
393
394
394
---
395
395
396
-
### **. ml_exporter.py (Serialización y Exportación)**
396
+
### **4. ml_exporter.py (Serialización y Exportación)**
397
397
398
398
Maneja la persistencia y traducción de modelos.
399
399
400
400
***Extracción de Estructura:** En lugar de usar **pickle** de Python (que es inseguro y específico de Python), este módulo extrae la estructura matemática pura (pesos, umbrales, topología) a un **formato JSON agnóstico al lenguaje**.
401
-
***Interoperabilidad con Sklearn:** Si un modelo fue entrenado usando **scikit-learn**, este módulo extrae los arrays internos de NumPy ($text{tree_value, coef_}$) y los convierte al formato estándar de MiniML, permitiendo **exportar modelos de Sklearn a C de Arduino**.
401
+
***Interoperabilidad con Sklearn:** Si un modelo fue entrenado usando **scikit-learn**, este módulo extrae los arrays internos de NumPy ($$text{tree_value, coef_}$) y los convierte al formato estándar de MiniML, permitiendo **exportar modelos de Sklearn a C de Arduino**.
402
402
403
403
---
404
404
@@ -502,14 +502,10 @@ La salida es código C99 estándar, listo para ser incluido en un sketch de Ardu
0 commit comments