Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

Contributors MIT License LinkedIn python pytorch


Logo

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
  1. DeepTorchBlocks
  2. Getting Started
  3. Usage
  4. To Do
  5. Contributing
  6. License
  7. Contact
  8. Acknowledgments

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!

(back to top)

Built With

For end-users:

  • NumPy & related dependecies (for math operations)
  • PyTorch & related dependecies (for modules inheritance)

For developers:

...

(back to top)

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

  1. Install the package

    !pip install DeepTorchBlocks
    

    this will also auto-install required dependecies

  2. Install auxiliary packages (for developers only)

    !pip install torchview
    from torchview import draw_graph
    
    !pip install torchinfo
    from torchinfo import summary
    

(back to top)

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

(back to top)

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

(back to top)

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!

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/NewFeature)
  3. Commit your Changes (git commit -m 'Add some NewFeature')
  4. Push to the Branch (git push origin feature/NewFeature)
  5. Open a Pull Request

(back to top)

License

Distributed under the MIT License. See LICENSE.txt for more information.

(back to top)

Contact

Stefano Giacomelli - https://www.linkedin.com/in/stefano-giacomelli-811654135/ - stefano.giacomelli@graduate.univaq.it

Project Link: https://github.com/StefanoGiacomelli/DeepTorchBlocks

(back to top)

Acknowledgments

(back to top)

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)

Source distribution for DeepTorchBlocks 0.0.1a0
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)

Table of built distributions (wheels) for DeepTorchBlocks 0.0.1a0
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release
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