BERNN-MSMS
Batch-effect-aware representation learning and classification with an
estimator-style fit(...); predict(...) interface.
Install
pip install bernn
Basic usage
from bernn import TrainAEClassifierHoldout
from bernn.config.training_config import TrainingConfig
config = TrainingConfig(
n_epochs=100,
optimize_hyperparams=False,
device="cpu",
)
model = TrainAEClassifierHoldout(config=config, log_metrics=False)
# Inductive fit: training data only.
model.fit(X_train, y_train, groups_train=batch_train)
y_pred = model.predict(X_new, groups_test=batch_new)
Read the complete BERNN usage guide for input shapes, inductive and fully transductive fitting, prediction, and hyperparameter guidance.
Important runtime contract:
groups_trainis mandatory.- If
X_validorX_testis supplied, its matching batch vector is mandatory. - BERNN hyperparameters are dataset-dependent. The examples are interface demonstrations, not universal performance-optimal defaults.
Important parameters
Focus on these first:
- optimize_hyperparams: enable/disable Ax optimization.
- n_trials: number of optimization trials.
- fixed_hyperparams: force values and remove them from search.
- n_repeats: number of holdout repeats.
- n_layers, layer1: classifier depth and width seed.
- dloss: domain loss mode.
- warmup, n_epochs: core training schedule.
- device: cpu/cuda target.
- scaler, bs: preprocessing and batch size.
- num_workers: PyTorch DataLoader subprocesses; defaults to 0.
Documentation
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bernn-1.0.6.tar.gz
(302.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
bernn-1.0.6-py3-none-any.whl
(321.9 kB
view details)
File details
Details for the file bernn-1.0.6.tar.gz.
File metadata
- Download URL: bernn-1.0.6.tar.gz
- Upload date:
- Size: 302.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
069e1a9d10b42fcbfd514ae7e335fc049c8b5287fd50ddbf3d35d4feb43caac0
|
|
| MD5 |
4405bca5f7397ef31e2fe6ea0140b2e4
|
|
| BLAKE2b-256 |
b92a9a0a07de232c0dfc40a6471e8a8e60b8595fd75b288235b9afcfeae2c0ba
|
File details
Details for the file bernn-1.0.6-py3-none-any.whl.
File metadata
- Download URL: bernn-1.0.6-py3-none-any.whl
- Upload date:
- Size: 321.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
974edffeb9ffd385ac71d1c4768510d2ee004410826e4cfd8c29c4f541792df3
|
|
| MD5 |
9b8c16aaaf2eaff13b7d8114c7375b8e
|
|
| BLAKE2b-256 |
1a4552bc79cfb3ec224d1977dd89190e8c3a0391949037a2c497b0c4773437eb
|