Skip to content

Commit 1d5f1c6

Browse files
committed
Documentación Oficial de MiniML Engine v1.1.0 (Español e Inglés) Completa (Correcciones de estructura)
1 parent ac37905 commit 1d5f1c6

1 file changed

Lines changed: 25 additions & 29 deletions

File tree

README.md

Lines changed: 25 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<p align="center">
2-
<img src="assetsminiml_banner.png" alt="MiniML Engine Banner" width="850">
3-
<p>
2+
<img src="assets/miniml_banner.png" alt="MiniML Engine Banner" width="850">
3+
</p>
44

55
<p align="center">
6-
<a href="https:www.python.orgdownloads"><img src="https:img.shields.iobadgePython-3.7%2B-blue.svg?style=flat-square&logo=python&logoColor=white" alt="Python Version"><a>
7-
<a href="https:opensource.orglicensesApache-2.0"><img src="https:img.shields.iobadgeLicense-Apache%202.0-red.svg?style=flat-square" alt="License: Apache 2.0"><a>
8-
<img src="https:img.shields.iobadgeDependencies-Zero-brightgreen.svg?style=flat-square" alt="Zero Dependencies">
9-
<img src="https:img.shields.iobadgeC%2B%2B-PROGMEM%20Ready-orange.svg?style=flat-square&logo=c%2B%2B&logoColor=white" alt="C++ Ready">
10-
<img src="https:img.shields.iobadgePlatform-Arduino%20%7C%20ESP32%20%7C%20STM32-lightgrey.svg?style=flat-square" alt="Supported Platforms">
11-
<img src="https:img.shields.iobadgeEdge%20AI-Deep%20Learning-purple.svg?style=flat-square" alt="Edge AI Deep Learning">
12-
<p>
6+
<a href="https://www.python.org/downloads/"><img src="https://img.shields.io/badge/Python-3.7%2B-blue.svg?style=flat-square&logo=python&logoColor=white" alt="Python Version"></a>
7+
<a href="https://opensource.org/licenses/Apache-2.0"><img src="https://img.shields.io/badge/License-Apache%202.0-red.svg?style=flat-square" alt="License: Apache 2.0"></a>
8+
<img src="https://img.shields.io/badge/Dependencies-Zero-brightgreen.svg?style=flat-square" alt="Zero Dependencies">
9+
<img src="https://img.shields.io/badge/C%2B%2B-PROGMEM%20Ready-orange.svg?style=flat-square&logo=c%2B%2B&logoColor=white" alt="C++ Ready">
10+
<img src="https://img.shields.io/badge/Platform-Arduino%20%7C%20ESP32%20%7C%20STM32-lightgrey.svg?style=flat-square" alt="Supported Platforms">
11+
<img src="https://img.shields.io/badge/Edge%20AI-Deep%20Learning-purple.svg?style=flat-square" alt="Edge AI Deep Learning">
12+
</p>
1313

1414
---
1515

@@ -77,7 +77,7 @@ Located in the `tensor.py` and `layers.py` modules, this is the automatic differ
7777

7878
The framework ensures the Separation of Concerns (SoC) principle through its internal managers:
7979

80-
### **. ml_manager.py (The Orchestrator)**
80+
### **1. ml_manager.py (The Orchestrator)**
8181

8282
The high-level API that unifies the workflow. It acts as a bridge between the user and the raw algorithms.
8383

@@ -88,22 +88,22 @@ The high-level API that unifies the workflow. It acts as a bridge between the us
8888
3. **Training:** Fits the selected model.
8989
* **predict() Polymorphism:** Automatically handles raw input, applies the saved scaler, and runs inference.
9090

91-
### **. ml_compat.py (Safety & Compatibility)**
91+
### **2. ml_compat.py (Safety & Compatibility)**
9292

9393
The data guardian. It ensures that the dynamic nature of Python does not break the strict static nature of C.
9494

9595
* **_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.
9696
* **check_dims():** strictly validates input dimensions before prediction, preventing index out-of-bounds errors in the generated C code.
9797
* **impute_missing_values():** Ensures data integrity before it reaches the mathematical core.
9898

99-
### **. ml_factory.py (The Factory Pattern)**
99+
### **3. ml_factory.py (The Factory Pattern)**
100100

101101
Decouples model instantiation from the logic flow.
102102

103103
* **Function:** create_model(type_string, params_dict)
104104
* **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.
105105

106-
### *5. ml_exporter.py (Serialization & Export)**
106+
### *4. ml_exporter.py (Serialization & Export)**
107107

108108
Handles the persistence and translation of models.
109109

@@ -185,9 +185,9 @@ The output is standard C99 code, ready to be included in an Arduino sketch (#inc
185185
// Preprocessing (MinMax Scaler baked in)
186186
void preprocess_data(float row[]) {
187187
// 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;
191191
}
192192

193193
Model Arrays (Flattened Tree)
@@ -361,7 +361,7 @@ Ubicado en los módulos `tensor.py` y `layers.py`, este es el motor de diferenci
361361

362362
El framework asegura el principio de Separación de Responsabilidades a través de sus gestores internos:
363363

364-
### **. ml_manager.py (El Orquestador)**
364+
### **1. ml_manager.py (El Orquestador)**
365365

366366
La API de alto nivel que unifica el flujo de trabajo. Actúa como un puente entre el usuario y los algoritmos base.
367367

@@ -374,7 +374,7 @@ La API de alto nivel que unifica el flujo de trabajo. Actúa como un puente entr
374374

375375
---
376376

377-
### **. ml_compat.py (Seguridad y Compatibilidad)**
377+
### **2. ml_compat.py (Seguridad y Compatibilidad)**
378378

379379
El guardián de los datos. Asegura que la naturaleza dinámica de Python no rompa la estricta naturaleza estática de C.
380380

@@ -384,7 +384,7 @@ El guardián de los datos. Asegura que la naturaleza dinámica de Python no romp
384384

385385
---
386386

387-
### **. ml_factory.py (El Patrón Factory)**
387+
### **3. ml_factory.py (El Patrón Factory)**
388388

389389
Desacopla la instanciación del modelo del flujo de lógica.
390390

@@ -393,12 +393,12 @@ Desacopla la instanciación del modelo del flujo de lógica.
393393

394394
---
395395

396-
### **. ml_exporter.py (Serialización y Exportación)**
396+
### **4. ml_exporter.py (Serialización y Exportación)**
397397

398398
Maneja la persistencia y traducción de modelos.
399399

400400
* **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**.
402402

403403
---
404404

@@ -502,14 +502,10 @@ La salida es código C99 estándar, listo para ser incluido en un sketch de Ardu
502502
// Preprocesamiento (Escalador MinMax incorporado)
503503

504504
void preprocess_data(float row[]) {
505-
506-
// Valores codificados (Hardcoded) de la fase de entrenamiento
507-
508-
row[0] = (row[0] - 25.0) 60.0;
509-
510-
row[1] = (row[1] - 15.0) 47.0;
511-
512-
row[2] = (row[2] - 100.0) 800.0;
505+
// Valores codificados (Hardcoded) de la fase de entrenamiento
506+
row[0] = (row[0] - 25.0) / 60.0;
507+
row[1] = (row[1] - 15.0) / 47.0;
508+
row[2] = (row[2] - 100.0) / 800.0;
513509

514510
}
515511

0 commit comments

Comments
 (0)