LighTorch
A Pytorch and Lightning based framework for research and ml pipeline automation.
Framework
- $\text{Hyperparameter space}.$
- $\text{Genetic algorithms(single-objective/multi-objective)}$
- $\text{Best hyperparameters in config.yaml}$
- $\text{Training session}$
htuning.py
from lightorch.htuning.optuna import htuning
from ... import NormalModule
from ... import FourierVAE
def objective(trial) -> Dict[str, float]:
... # define hyperparameters
return hyperparameters
if __name__ == '__main__':
htuning(
model_class = FourierVAE,
hparam_objective = objective,
datamodule = NormalModule,
valid_metrics = [f"Training/{name}" for name in [
"Pixel",
"Perceptual",
"Style",
"Total variance",
"KL Divergence"]],
directions = ['minimize', 'minimize', 'minimize', 'minimize', 'minimize'],
precision = 'medium',
n_trials = 150,
)
exec: python3 -m htuning
config.yaml
trainer: # trainer arguments
logger: true
enable_checkpointing: true
max_epochs: 250
accelerator: cuda
devices: 1
precision: 32
model:
class_path: utils.FourierVAE #model relative path
dict_kwargs: #**hparams
encoder_lr: 2e-2
encoder_wd: 0
decoder_lr: 1e-2
decoder_wd: 0
alpha:
- 0.02
- 0.003
- 0.003
- 0.01
beta: 0.00001
optimizer: adam
data: # Dataset arguments
class_path: data.DataModule
init_args:
type_dataset: mnist
batch_size: 12
pin_memory: true
num_workers: 8
training.py
from lightorch.training.cli import trainer
if __name__ == '__main__':
trainer()
exec: python3 -m training -c config.yaml
Features
- Built in Module class for:
- Adversarial training.
- Supervised, Self-supervised training.
- Multi-Objective and Single-Objective optimization and Hyperparameter tuning with optuna.
Modules
- Fourier Convolution.
- Fourier Deconvolution.
- Partial Convolution. (Optimized implementation)
- Grouped Query Attention, Multi Query Attention, Multi Head Attention. (Interpretative usage) (with flash-attention option)
- Self Attention, Cross Attention.
- Normalization methods.
- Positional encoding methods.
- Embedding methods.
- Useful criterions.
- Useful utilities.
- Built-in Default Feed Forward Networks.
- Adaptation for $\mathbb{C}$ modules.
- Interpretative Deep Neural Networks.
- Monte Carlo forward methods.
Contact
Citation
@misc{lightorch,
author = {Jorge Enciso},
title = {LighTorch: Automated Deep Learning framework for researchers},
howpublished = {\url{https://github.com/Jorgedavyd/LighTorch}},
year = {2024}
}
Metadata
Release files for lightorch 0.0.6
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lightorch-0.0.6.tar.gz | 30.1 kB | Without provenance | Details for lightorch-0.0.6.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lightorch-0.0.6-py3-none-any.whl | Python 3 | none | any | Details for lightorch-0.0.6-py3-none-any.whl |
Total release size: 66.4 kB
Release files / lightorch-0.0.6.tar.gz
| Download URL | lightorch-0.0.6.tar.gz |
|---|---|
| Size | 30.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c4f23f03375db4b4b9f711fe22e82e56a701da6e70a36e64162fec254815b533
|
|
BLAKE2b-256 checksum How to use checksums |
48a8447787f9e44e2638942d06352fba64c9f456e2dc61c1664aaa914e185ad9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Release files / lightorch-0.0.6-py3-none-any.whl
| Download URL | lightorch-0.0.6-py3-none-any.whl |
|---|---|
| Size | 36.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
5867b534a9ff808a84d4a60852e07f4c10a74721e834a1c14802b32bbbc45729
|
|
BLAKE2b-256 checksum How to use checksums |
61ff90187056805469ec4299c4b2da7cdab2f275540eca9c28761e54702f2b25
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.12.7
|
Security for lightorch 0.0.6
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.