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.2.tar.gz (5.8 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.2-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nn_calc-0.1.2.tar.gz
  • Upload date:
  • Size: 5.8 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.2.tar.gz
Algorithm Hash digest
SHA256 bf5bbb8c117cb8778fc790cc8b417d806b94c77ff34857d056c5dc66c703ea20
MD5 ff33b3926a48b30543344402a64e7427
BLAKE2b-256 0e0c44a2574275e9de8f3605a4da58d84725361fc4e515f6dddc55fec14a9aeb

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nn_calc-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 6.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 7943eb0c19ea01e7417e7e0b1585bdaa2411228d74016eda2f5af8d50720f1e7
MD5 a680483371dd154f90351dc79eaea7b7
BLAKE2b-256 e4baaa6bb02d131b7be5cdee40ea36110fe0eed125a88a1581cc67a996865f2f

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