This release is a pre-release and may not be stable for production use.
DeepTorchBlocks
https://github.com/StefanoGiacomelli/DeepTorchBlocks/tree/main/nn_modules
...a repository for SoA Neural Networks building blocks (written in pure Python & PyTorch)
Read the API Documentation
View Demo
·
Report Bug
·
Request Feature
Table of Contents
DeepTorchBlocks
This is a work-in-progress repository: please do not complain about code instability!
This project was born with the aim to collect and develop a general-purpose set of building blocks, for Neural Network architectures programming and researches structuring. For various reasons, one will be faced with the impossibility of directly exploiting pre-trained architectures and/or modules and will be forced to re-implement from scratch each layer (and or component) of the desired algorithm. To facilitate this step, DeepTorchBlocks gives us a hand with a careful selection (under continuous revisioning and updating) of state-of-the-art modules coming from CV, NLP and other reearch fields, inheriting all standard nn.Module (PyTorch) features and methods.
You will not find any pre-trained NNs architecture here, only building (sub-)modules!
Built With
For end-users:
NumPy& related dependecies (for math operations)PyTorch& related dependecies (for modules inheritance)
For developers:
- torch-summary/torchinfo (for modules parameters report)
- torchview & related dependecies (for architectural monitoring)
pytest& related dependecies (for modules testing)
...
Getting Started
This is an example of how you may set up your project locally. To get a local copy up and running follow these simple steps.
Cloning repository
- for Colab Notebooks
!git clone https://github.com/StefanoGiacomelli/DeepTorchBlocks.git %cd './DeepTorchBlocks/nn_modules'
call Class and/or Functions directly from related Python files.
Installation
-
Install the package
!pip install DeepTorchBlocks
this will also auto-install required dependecies
-
Install auxiliary packages (for developers only)
!pip install torchview from torchview import draw_graph !pip install torchinfo from torchinfo import summary
Usage
device = 'cuda' if torch.cuda.is_available() else 'cpu'
x = torch.rand([1, 3, 200, 200], device=device) # An example RGB tensor of a single batch, with 200x200 pixels
model = ConvBlock(in_channels = 3,
out_channels = 10,
kernel_size = 3,
stride = 2,
padding = 1,
activation = nn.ReLU(),
device=device)
model(x)
>>> torch.Tensor(1, 10, 100, 100)
For more examples, please refer to the Documentation
Roadmap
- Add Bi-dir ConvRNN
- Define Tests pipeline (shape, self.params correctness, forward etc.)
- Compile documentation (SPhinx & ReadTheDocs template w. LaTeX extensions)
- Metrics.py (classification) & Utils.py (dataset, pre-processing
- CI/CD .github-workflow: for each admin push: Test-pipeline -> Package compilation & pubblication -> Documentation update
Contributing
Contributions are what make the open source community such an amazing place to learn, inspire, and create. Any contributions you make are greatly appreciated. If you have a suggestion that would make this better, please fork the repo and create a pull request. You can also simply open an issue with the tag "enhancement". Don't forget to give the project a star! Thanks again!
- Fork the Project
- Create your Feature Branch (
git checkout -b feature/NewFeature) - Commit your Changes (
git commit -m 'Add some NewFeature') - Push to the Branch (
git push origin feature/NewFeature) - Open a Pull Request
License
Distributed under the MIT License. See LICENSE.txt for more information.
Contact
Stefano Giacomelli - https://www.linkedin.com/in/stefano-giacomelli-811654135/ - stefano.giacomelli@graduate.univaq.it
Project Link: https://github.com/StefanoGiacomelli/DeepTorchBlocks
Acknowledgments
Metadata
Release files for DeepTorchBlocks 0.0.1a0
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 |
|---|---|---|---|---|
| DeepTorchBlocks-0.0.1a0.tar.gz | 21.5 kB | Without provenance | Details for DeepTorchBlocks-0.0.1a0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| DeepTorchBlocks-0.0.1a0-py3-none-any.whl | Python 3 | none | any | Details for DeepTorchBlocks-0.0.1a0-py3-none-any.whl |
Total release size: 46.0 kB
Release files / DeepTorchBlocks-0.0.1a0.tar.gz
| Download URL | DeepTorchBlocks-0.0.1a0.tar.gz |
|---|---|
| Size | 21.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ca0be3a53d33b1869e8b2ab643f72f27a8205112d25470faabd7f50e5962ea6e
|
|
BLAKE2b-256 checksum How to use checksums |
089154909c4d76268c1885619a2a1332f3f2dc547661475c9f90874aa096ad01
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.9
|
Release files / DeepTorchBlocks-0.0.1a0-py3-none-any.whl
| Download URL | DeepTorchBlocks-0.0.1a0-py3-none-any.whl |
|---|---|
| Size | 24.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d7df026038704af9ed35bd32c1414473bd6a7fcca74351488821bf6576850e20
|
|
BLAKE2b-256 checksum How to use checksums |
4a4036b92c05376371437cad90fbd1fd1c5d6a0c6a6011c391fa36df5c61e601
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/5.0.0 CPython/3.10.9
|
Security for DeepTorchBlocks 0.0.1a0
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.