Skip to main content

A calculator for encoder and decoder layers of any neural networks

Project description

Neural Network calculator

Neural Network calculator reads your hyperparameter choices (kernel size, stride, channels, etc.) and outputs:

  • Encoder block: detailed Conv2d specs + parameter counts

  • Decoder block: mirrored ConvTranspose2d specs + parameter counts

  • Recurrent stacks: per-layer (input_size, hidden_size, params) for RNN/GRU/LSTM

Features:

  • Multi-layer CNN mode

    • Global defaults or per-layer overrides for stride, kernel size, padding

    • Automatic channel-chaining in encoder → mirrored decoder block

  • Recurrent mode

    • RNN: single-gate formula

    • GRU: 3× single-gate formula

    • LSTM: 4× single-gate formula

    • Stacked layers automatically chain hidden sizes

  • User-friendly CLI with automatic help pages & type-safe options

  • Subcommand support, lazy loading, file arguments, and more via Click

Usage:

Example

bash command

nn_calc -h

output

  Calculate parameter counts for CNN encoder/decoder OR RNN/GRU/LSTM layers.

Options:
  --model [cnn|rnn|gru|lstm]  Type of network to compute parameters for.
                              [default: cnn]
  -n, --num-layers INTEGER    Number of layers (CNN) or RNN layers
                              (recurrent).  [default: 3]
  --stride INTEGER            Default stride for each conv layer.  [default:
                              1]
  --kernel-size INTEGER       Default kernel size for each conv layer.
                              [default: 3]
  --padding INTEGER           Default padding for each conv layer.  [default:
                              1]
  --in-channels INTEGER       CNN: input channels for first layer; RNN: input
                              size.  [default: 3]
  --out-channels INTEGER      CNN: output channels for each layer; RNN: hidden
                              size.  [default: 64]
  -S, --strides INTEGER       CNN: per-layer strides (e.g. -S 1 2 2).
  -K, --kernel-sizes INTEGER  CNN: per-layer kernel sizes.
  -P, --paddings INTEGER      CNN: per-layer paddings.
  -h, --help                  Show this message and exit.

Requirements:

  • Python >= 3.7
  • click>=8.0

Installation:

Pip

pip install nn_calc

git repository

https://github.com/pssv7/nn-calc.git

Usage

nn_calc (OPTIONAL)

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

nn_calc-0.1.0.tar.gz (3.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nn_calc-0.1.0-py3-none-any.whl (3.3 kB view details)

Uploaded Python 3

File details

Details for the file nn_calc-0.1.0.tar.gz.

File metadata

  • Download URL: nn_calc-0.1.0.tar.gz
  • Upload date:
  • Size: 3.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for nn_calc-0.1.0.tar.gz
Algorithm Hash digest
SHA256 39df61d72288cd2ecc782f3296862461d3932a05c56f1fb6d7f73a7165dfef6e
MD5 4959d03ad6879b117b92170bd242fcd0
BLAKE2b-256 8c946f781409f0e4ad28b3353891f50942ddcfa5b752d2068b45107375fc2c78

See more details on using hashes here.

File details

Details for the file nn_calc-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nn_calc-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 3.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.10

File hashes

Hashes for nn_calc-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 380db8abfc4c8ef4cd6bb5aa8a139dfd2e8d088006a7fdd908f985fed2797c32
MD5 27c2ccc5d979ed7085bbb27900ed3402
BLAKE2b-256 fa79eace42d523691756dad8409e721f19603c0e568f98396352e0e7bf5267c1

See more details on using hashes here.

Supported by

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