Skip to main content

Personal repository for SoA Deep Learning building blocks (in PyTorch)

Project description

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)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

DeepTorchBlocks-0.0.1a0.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

DeepTorchBlocks-0.0.1a0-py3-none-any.whl (24.6 kB view details)

Uploaded Python 3

File details

Details for the file DeepTorchBlocks-0.0.1a0.tar.gz.

File metadata

  • Download URL: DeepTorchBlocks-0.0.1a0.tar.gz
  • Upload date:
  • Size: 21.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.0.0 CPython/3.10.9

File hashes

Hashes for DeepTorchBlocks-0.0.1a0.tar.gz
Algorithm Hash digest
SHA256 ca0be3a53d33b1869e8b2ab643f72f27a8205112d25470faabd7f50e5962ea6e
MD5 1af28a2dbac8e70eb1c347b03c024fe1
BLAKE2b-256 089154909c4d76268c1885619a2a1332f3f2dc547661475c9f90874aa096ad01

See more details on using hashes here.

File details

Details for the file DeepTorchBlocks-0.0.1a0-py3-none-any.whl.

File metadata

File hashes

Hashes for DeepTorchBlocks-0.0.1a0-py3-none-any.whl
Algorithm Hash digest
SHA256 d7df026038704af9ed35bd32c1414473bd6a7fcca74351488821bf6576850e20
MD5 37d7bc5e91bb19970f0f8b2b4f33220e
BLAKE2b-256 4a4036b92c05376371437cad90fbd1fd1c5d6a0c6a6011c391fa36df5c61e601

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page