Skip to content

Commit 2d7eb83

Browse files
committed
feat(v0.3.0): API Keras, Adam/RMSprop, callbacks, BatchNorm
BREAKING CHANGE: refactor mayor de la librería. Nuevo: - Optimizers: Adam, RMSprop, AdaGrad + gradient clipping (clip_norm/clip_value) - Layer: BatchNormalization con running stats - Callbacks: EarlyStopping, ModelCheckpoint, ReduceLROnPlateau, History - Regularizers: L1, L2, L1L2 sobre kernels - Initializers: HeNormal, XavierNormal/Uniform, Zeros, Ones - Metrics: BinaryAccuracy, CategoricalAccuracy, R2Score, RMSE, MAE - Activations: ELU, Tanh con caching del forward - Losses: Huber, MAE, SparseCategoricalCrossEntropy - Utils: train_test_split, to_categorical, normalize, standardize API estilo Keras: - model.compile(optimizer, loss, metrics) - model.fit(... validation_split, callbacks, verbose) - model.evaluate(), predict_classes(), summary() - Aceptación por string: optimizer='adam', loss='bce', activation='relu' - Inferencia automática de input_size en capas posteriores Producción: - save_weights/load_weights en .npz portable - get_weights/set_weights para serving custom - Logger estructurado, verbose 0/1/2 Tests: - 51 tests cubriendo todos los componentes - test_gradient_check.py valida backprop con diferencias finitas - CI matriz Python 3.8/3.10/3.12 Fix: - MSE.derivative ahora divide por y.size (consistente con np.mean) Migración: modelos .pkl previos no son compatibles. Re-entrena y guarda con save_weights('.npz') para portabilidad futura.
1 parent 144a7e6 commit 2d7eb83

22 files changed

Lines changed: 2646 additions & 395 deletions

.github/workflows/python-app.yml

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,26 @@ name: Python application
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ["main"]
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ["main"]
88

99
jobs:
1010
build:
1111
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: ["3.8", "3.10", "3.12"]
1215
steps:
13-
- uses: actions/checkout@v3
14-
- name: Set up Python 3.10
15-
uses: actions/setup-python@v3
16-
with:
17-
python-version: "3.10"
18-
- name: Install dependencies
19-
run: |
20-
python -m pip install --upgrade pip
21-
pip install -r requirements.txt
22-
- name: Test with unittest
23-
run: |
24-
python -m unittest discover tests
16+
- uses: actions/checkout@v4
17+
- name: Set up Python ${{ matrix.python-version }}
18+
uses: actions/setup-python@v5
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
- name: Install dependencies
22+
run: |
23+
python -m pip install --upgrade pip
24+
pip install -r requirements.txt
25+
- name: Test with unittest
26+
run: |
27+
python -m unittest discover tests -v

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,27 @@
1-
# Python caches
1+
# Python
22
__pycache__/
33
*.py[cod]
4+
*.egg-info/
5+
*.egg
6+
build/
7+
dist/
48

5-
# Entornos virtuales
9+
# Virtual envs
610
venv/
711
env/
812
.env
13+
.venv/
914

10-
# Configuración de entorno
11-
.env
15+
# IDE
16+
.vscode/
17+
.idea/
18+
*.swp
19+
20+
# Testing / coverage
21+
.coverage
22+
.pytest_cache/
23+
htmlcov/
24+
25+
# Modelos guardados
26+
*.pkl
27+
*.npz

0 commit comments

Comments
 (0)