Inference code for FTFM-1. Cell representations are built by factorizing one
contextual latent per row against one per column, rather than by cell-to-cell
attention. The support-side computation is cached once at fit and reused
across test queries without approximation.
pip install "git+https://github.com/machinelearningnuremberg/ftfm-official.git"Python ≥ 3.10 and PyTorch ≥ 2.4. Pin a release with @<tag-or-commit> after
.git. Over SSH: pip install "git+ssh://git@github.com/machinelearningnuremberg/ftfm-official.git".
The weights (FTFM-1, stage C at update 130,000, 464 MiB fp32) live on the
Hugging Face Hub at josifgrabocka/ftfm
and are downloaded on the first fit, then served from ~/.cache/huggingface.
To fetch them ahead of time, e.g. before an offline job:
ftfm-download # into the Hugging Face cache
ftfm-download --local-dir ./ftfm-weightsor from Python:
from ftfm import download_checkpoint
path = download_checkpoint() # directory with model.safetensors + config.jsonA directory written with --local-dir is read back with
FTFMClassifier(model_path="./ftfm-weights"); allow_auto_download=False
forbids any network access.
from ftfm import FTFMClassifier
clf = FTFMClassifier().fit(X_train, y_train)
proba = clf.predict_proba(X_test)scikit-learn API; DataFrames with string columns are accepted, and
cat_features= overrides categorical detection. The default predicts with an
8-member view ensemble; n_estimators=1 gives a single forward pass, and
FTFMSingleClassifier the un-ensembled wrapper.
FTFMRegressor is not yet implemented; constructing one raises
NotImplementedError.
ftfm/model.py the architecture
ftfm/serving.py cached support-side inference
ftfm/estimator.py scikit-learn estimators, ingest, weight loading
ftfm/ensemble.py view ensembling
ftfm/hub.py checkpoint download
Code is Apache-2.0 (LICENSE). The model weights are CC BY-NC 4.0,
non-commercial (LICENSE-WEIGHTS.md); they are not in this repository and are
downloaded from the Hub under those terms.