Package: pytorch-lightning-bolts
WARNING: Deprecated in favor of Lightning Bolts -https://pypi.org/project/lightning-boltsPretrained SOTA Deep Learning models, callbacks and more for research and production with PyTorch Lightning and PyTorchWebsite•Installation•Main goals•latest Docs•stable Docs•Community•Grid AI•LicenceContinuous IntegrationCI testingSystem / PyTorch ver.1.6 (min. req.)1.8 (latest)Linux py3.{6,8}OSX py3.{6,8}Windows py3.7** testing just the package itself, we skip full test suite - excludingtestsfolderInstallView installSimple installation from PyPIpipinstalllightning-boltsInstall bleeding-edge (no guarantees)pipinstallgit+https://github.com/PytorchLightning/lightning-bolts.git@master--upgradeIn case you want to have full experience you can install all optional packages at oncepipinstalllightning-bolts["extra"]What is BoltsBolts is a Deep learning research and production toolbox of:SOTA pretrained models.Model components.Callbacks.Losses.Datasets.Main Goals of BoltsThe main goal of Bolts is to enable rapid model idea iteration.Example 1: Finetuning on datafrompl_bolts.models.self_supervisedimportSimCLRfrompl_bolts.models.self_supervised.simclr.transformsimportSimCLRTrainDataTransform,SimCLREvalDataTransformimportpytorch_lightningaspl# datatrain_data=DataLoader(MyDataset(transforms=SimCLRTrainDataTransform(input_height=32)))val_data=DataLoader(MyDataset(transforms=SimCLREvalDataTransform(input_height=32)))# modelweight_path='https://pl-bolts-weights.s3.us-east-2.amazonaws.com/simclr/bolts_simclr_imagenet/simclr_imagenet.ckpt'simclr=SimCLR.load_from_checkpoint(weight_path,strict=False)simclr.freeze()# finetuneExample 2: Subclass and ideatefrompl_bolts.modelsimportImageGPTfrompl_bolts.models.self_supervisedimportSimCLRclassVideoGPT(ImageGPT):deftraining_step(self,batch,batch_idx):x,y=batchx=_shape_input(x)logits=self.gpt(x)simclr_features=self.simclr(x)# -----------------# do something new with GPT logits + simclr_features# -----------------loss=self.criterion(logits.view(-1,logits.size(-1)),x.view(-1).long())logs={"loss":loss}return{"loss":loss,"log":logs}Who is Bolts for?Corporate production teamsProfessional researchersPh.D. studentsLinear + Logistic regression heroesI don't need deep learningGreat!
We have LinearRegression and LogisticRegression implementations with numpy and sklearn bridges for datasets!
But our implementations work on multiple GPUs, TPUs and scale dramatically...Check out our Linear Regression on TPU demofrompl_bolts.models.regressionimportLinearRegressionfrompl_bolts.datamodulesimportSklearnDataModulefromsklearn.datasetsimportload_bostonimportpytorch_lightningaspl# sklearn datasetX,y=load_boston(return_X_y=True)loaders=SklearnDataModule(X,y)model=LinearRegression(input_dim=13)# try with gpus=4!# trainer = pl.Trainer(gpus=4)trainer=pl.Trainer()trainer.fit(model,train_dataloader=loaders.train_dataloader(),val_dataloaders=loaders.val_dataloader())trainer.test(test_dataloaders=loaders.test_dataloader())Is this another model zoo?No!Bolts is unique because models are implemented using PyTorch Lightning and structured so that they can be easily
subclassed and iterated on.For example, you can override the elbo loss of a VAE, or the generator_step of a GAN to quickly try out a new idea.
The best part is that all the models are benchmarked so you won't waste time trying to "reproduce" or find the bugs
with your implementation.TeamBolts is supported by the PyTorch Lightning team and the PyTorch Lightning community!LicencePlease observe the Apache 2.0 license that is listed in this repository.
In addition the Lightning framework is Patent Pending.CitationTo cite bolts use:@article{falcon2020framework,
  title={A Framework For Contrastive Self-Supervised Learning And Designing A New Approach},
  author={Falcon, William and Cho, Kyunghyun},
  journal={arXiv preprint arXiv:2009.00104},
  year={2020}
}To cite other contributed models or modules, please cite the authors directly (if they don't have bibtex, ping the authors on a GH issue)