Skip to content

Commit 603618d

Browse files
authored
feat!: DeepTab v2 API with split-config design (#400)
DeepTab v2 is a ground-up restructuring of the library. The high-level estimator API (`MambularClassifier().fit(...)`) is largely unchanged, but the internal package layout, configuration objects, and import paths have moved. ## Highlights - **Split-config API:** model behavior is now configured through separate `model_config`, `preprocessing_config`, `trainer_config`, and `observability_config` objects instead of a single monolithic config. - **15 stable architectures** across five families: State Space Models (Mambular, MambaTab, MambAttention), Transformers (FTTransformer, TabTransformer, SAINT, AutoInt), Residual Networks (ResNet, TabR), Tree-Inspired (NODE, ENODE, NDTF), and general baselines (MLP, TabM, TabulaRNN), each as a Classifier, Regressor, or distributional (LSS) model. - **3 experimental models** under evaluation: ModernNCA, Tangos, Trompt. - **Reorganized package layout:** `deeptab.models`, `deeptab.architectures`, `deeptab.configs`, `deeptab.core`, `deeptab.training`, `deeptab.data`. ## Fixes - ModernNCA now supports distributional (LSS) prediction by pooling candidate representations through the tabular head. - Aligned ruff between CI and pre-commit to remove "passes locally, fails in CI" drift; declared the previously implicit `sphinxext-opengraph` docs dependency; regenerated `poetry.lock`. ## Docs & tests - Standardized numpydoc docstrings across architectures, core, nn, and training modules. - Added smoke coverage for all stable and experimental models. - Verified and corrected the model comparison tables against source. BREAKING CHANGE: internal package layout, configuration objects, and import paths have changed. See the migration guide for details.
2 parents 56763ea + 41a9284 commit 603618d

315 files changed

Lines changed: 53688 additions & 10755 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/ci.yml

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,3 +146,84 @@ jobs:
146146

147147
- name: Run unit tests
148148
run: poetry run pytest tests/ -v
149+
150+
smoke:
151+
name: Smoke tests (Python 3.12, ubuntu)
152+
runs-on: ubuntu-latest
153+
needs: lint
154+
155+
steps:
156+
- uses: actions/checkout@v4
157+
158+
- name: Set up Python
159+
uses: actions/setup-python@v5
160+
with:
161+
python-version: "3.12"
162+
163+
- name: Install Poetry
164+
run: pipx install poetry
165+
166+
- name: Configure Poetry
167+
run: poetry config virtualenvs.in-project true
168+
169+
- name: Cache virtualenv
170+
uses: actions/cache@v4
171+
with:
172+
path: .venv
173+
key: venv-smoke-${{ runner.os }}-3.12-${{ hashFiles('poetry.lock') }}
174+
175+
- name: Install dependencies
176+
run: poetry install
177+
178+
- name: Run smoke tests
179+
run: poetry run pytest tests/ -v -m smoke --tb=short
180+
181+
coverage:
182+
name: Coverage (stable modules)
183+
runs-on: ubuntu-latest
184+
needs: tests
185+
186+
steps:
187+
- uses: actions/checkout@v4
188+
189+
- name: Set up Python
190+
uses: actions/setup-python@v5
191+
with:
192+
python-version: "3.12"
193+
194+
- name: Install Poetry
195+
run: pipx install poetry
196+
197+
- name: Configure Poetry
198+
run: poetry config virtualenvs.in-project true
199+
200+
- name: Cache virtualenv
201+
uses: actions/cache@v4
202+
with:
203+
path: .venv
204+
key: venv-coverage-${{ runner.os }}-3.12-${{ hashFiles('poetry.lock') }}
205+
206+
- name: Install dependencies
207+
run: poetry install
208+
209+
- name: Run tests with coverage
210+
run: |
211+
poetry run pytest tests/ \
212+
--cov=deeptab \
213+
--cov-branch \
214+
--cov-report=term-missing \
215+
--cov-report=xml:coverage.xml \
216+
-q
217+
218+
- name: Upload coverage report
219+
uses: actions/upload-artifact@v4
220+
with:
221+
name: coverage-report
222+
path: coverage.xml
223+
retention-days: 30
224+
225+
- name: Upload to Codecov
226+
uses: codecov/codecov-action@v4
227+
with:
228+
files: coverage.xml
229+
fail_ci_if_error: false

.gitignore

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,12 +168,28 @@ dist/
168168
# logs and checkpoints
169169
examples/lightning_logs
170170
*.ckpt
171-
171+
*.deeptab
172+
lightning_logs
173+
lightning_logs/*
174+
checkpoints
175+
checkpoints/*
176+
model_checkpoints
177+
model_checkpoints/*
178+
outputs
179+
outputs/*
180+
experiment_logs
181+
experiment_logs/*
182+
mlruns
183+
mlruns/*
184+
deeptab_runs
185+
deeptab_runs/*
186+
obs_runs
187+
obs_runs/*
188+
189+
# Sphinx build artifacts
172190
docs/_build/doctrees/*
173191
docs/_build/html/*
174192

193+
# dev files
175194
dev
176195
dev/*
177-
178-
179-
lightning_logs/*

README.md

Lines changed: 431 additions & 428 deletions
Large diffs are not rendered by default.

deeptab/__init__.py

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,30 @@
1-
from . import base_models, data_utils, models, utils
1+
from . import configs, data, distributions, metrics, models
22
from ._version import __version__
3+
from .core.exceptions import (
4+
ConfigWarning,
5+
DataWarning,
6+
DeepTabError,
7+
DeepTabWarning,
8+
NotFittedError,
9+
PerformanceWarning,
10+
)
11+
from .core.inference import InferenceModel
12+
from .core.reproducibility import seed_context, set_seed
313

414
__all__ = [
15+
"ConfigWarning",
16+
"DataWarning",
17+
"DeepTabError",
18+
"DeepTabWarning",
19+
"InferenceModel",
20+
"NotFittedError",
21+
"PerformanceWarning",
522
"__version__",
6-
"base_models",
7-
"data_utils",
23+
"configs",
24+
"data",
25+
"distributions",
26+
"metrics",
827
"models",
9-
"utils",
28+
"seed_context",
29+
"set_seed",
1030
]

0 commit comments

Comments
 (0)