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.1.tar.gz (4.9 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.1-py3-none-any.whl (5.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: nn_calc-0.1.1.tar.gz
  • Upload date:
  • Size: 4.9 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.1.tar.gz
Algorithm Hash digest
SHA256 59be541338405a1f5ad5fdcdb73ddc22eb845fc1231fe1c68bd9860c9e0a3124
MD5 ab57762c8bbfe461e8a910685854d26d
BLAKE2b-256 e7ac5ee3331bce8003ca36911b4cb1914f9748473453df2096d80e0793b4adaa

See more details on using hashes here.

File details

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

File metadata

  • Download URL: nn_calc-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 5.1 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff0bbce3351d5f85ec26a9a2c3142716e6fc1e6bb5e8a6e00d066603f007ee51
MD5 0542eb4139c6858bb1f20b3f5d24101b
BLAKE2b-256 cf5ff0bcbe7c31def4f68a0eb2f51a9dd4d230a1cfb87589bf5026508a949649

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