Skip to main content

pytorch-mighty

CircleCI Documentation Status

The Mighty Monitor Trainer for your pytorch models. Powered by Visdom.

Documentation: https://pytorch-mighty.readthedocs.io/en/latest/

Installation

Requires Python 3.6+

  1. Install PyTorch:
    • CPU backend: conda install pytorch torchvision cpuonly -c pytorch
    • GPU backend: conda install pytorch torchvision cudatoolkit=10.2 -c pytorch
  2. $ pip install pytorch-mighty

Quick start

Before running any script, start Visdom server:

$ python -m visdom.server -port 8097

Then run python examples.py or use the code below:

import torch
import torch.nn as nn
from torchvision import transforms
from torchvision.datasets import MNIST

from mighty.models import MLP
from mighty.monitor.monitor import MonitorLevel
from mighty.trainer import TrainerGrad
from mighty.utils.data import DataLoader

model = MLP(784, 128, 10)

optimizer = torch.optim.Adam(model.parameters(), lr=1e-3)
scheduler = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer)

data_loader = DataLoader(MNIST, transform=transforms.ToTensor())

trainer = TrainerGrad(model,
                      criterion=nn.CrossEntropyLoss(),
                      data_loader=data_loader,
                      optimizer=optimizer,
                      scheduler=scheduler)
# trainer.restore()  # uncomment to restore the saved state
trainer.monitor.advanced_monitoring(level=MonitorLevel.SIGNAL_TO_NOISE)
trainer.train(n_epochs=10, mutual_info_layers=0)

Finally, navigate to http://localhost:8097 to see the training progress.

Articles, implemented or reused in the package

  1. Fong, R. C., & Vedaldi, A. (2017). Interpretable explanations of black boxes by meaningful perturbation.

  2. Belghazi, M. I., Baratin, A., Rajeswar, S., Ozair, S., Bengio, Y., Courville, A., & Hjelm, R. D. (2018). Mine: mutual information neural estimation.

  3. Kraskov, A., Stögbauer, H., & Grassberger, P. (2004). Estimating mutual information.

  4. Ince, R. A., Giordano, B. L., Kayser, C., Rousselet, G. A., Gross, J., & Schyns, P. G. (2017). A statistical framework for neuroimaging data analysis based on mutual information estimated via a gaussian copula. Human brain mapping, 38(3), 1541-1573.

  5. IDTxl package to estimate mutual information.

Projects that use pytorch-mighty

  • MCMC_BinaryNet - Markov Chain Monte Carlo binary networks optimization.
  • EmbedderSDR - encode images into binary Sparse Distributed Representation (SDR).
  • sparse-representation - Basis Pursuit solvers for the P0- and P1-problems, which encode the data into sparse vectors of high dimensionality.
  • entropy-estimators - estimate Entropy and Mutual Information between multivariate random variables.

Check-out more examples on http://visdom.kyivaigroup.com:8097/. Give your browser a few minutes to parse the json data.

Release files for pytorch-mighty 0.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pytorch-mighty 0.4.0
File Size Uploaded
pytorch-mighty-0.4.0.tar.gz 72.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pytorch-mighty 0.4.0
File Interpreter ABI Platform
pytorch_mighty-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 151.5 kB

Release files / pytorch-mighty-0.4.0.tar.gz

Download URL pytorch-mighty-0.4.0.tar.gz
Size 72.4 kB
Tags Source
SHA-256 checksum
How to use checksums
00fdb89bf1a215fed157e9ba2dbdc2e15610d21455b3f20e73c0a24d3b079de9
BLAKE2b-256 checksum
How to use checksums
3e12dc7f1b204561c606692e95797966b7334778a529b453d3b7607bda1d3bcc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release files / pytorch_mighty-0.4.0-py3-none-any.whl

Download URL pytorch_mighty-0.4.0-py3-none-any.whl
Size 79.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bf3bdf291396136a25b64de12e5581a97d4048a40d8f67d2f7d08f616fe990f7
BLAKE2b-256 checksum
How to use checksums
a3fba142887b1a8cfc182bdedf57aa9f1908a0c2f0dbff847f08e0772bc70e21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.10.13

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

0.3.0

1 release file

0.2.1

1 release file

0.1.0

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page