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.4.tar.gz
(301.4 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.4-py3-none-any.whl
(321.5 kB
view details)
File details
Details for the file bernn-1.0.4.tar.gz.
File metadata
- Download URL: bernn-1.0.4.tar.gz
- Upload date:
- Size: 301.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3f728c91f606ee867d00ec3c2cd6b8728b656d0bed90d32f0be2f024838d9f94
|
|
| MD5 |
a12dfd0ae8c97d10ae072f2329b54afb
|
|
| BLAKE2b-256 |
2abac21352b7605442ac6ec018b7d2c3c59e34a7197b58df64b667c3a65618a6
|
File details
Details for the file bernn-1.0.4-py3-none-any.whl.
File metadata
- Download URL: bernn-1.0.4-py3-none-any.whl
- Upload date:
- Size: 321.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.11.15
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f3d956e7f20f8d1b6b923051f0fff05295c4dbcd961030db87f2799115b93a55
|
|
| MD5 |
ffb1b2ef68cee1149cb4942c5e8cacb7
|
|
| BLAKE2b-256 |
e1dc078075eef00a111cbd428337d8c8eb02c8e8c4d730e5881f65d55cc9b1c0
|