Skip to main content
Calcimator

Backpropagation Calculator

Calculate backpropagation computational complexity, memory requirements, and operations for neural networks.

Inputs

Results

Forward Pass Operations

118,016

Backward Pass Operations

236,032

Operations per Batch

11,329,536

Total Memory

0.58 MB

Activation Memory0.13 MB
Gradient Memory0.45 MB
How to Use This Calculator
  1. Enter the network architecture: input size, number of hidden layers, and neurons per hidden layer.
  2. Enter the output size (number of output neurons) and the training batch size.
  3. Review the calculated forward pass and backward pass operation counts, along with total operations per batch.
  4. Check the activation memory, gradient memory, and total memory estimates in MB for your architecture.
  5. Use the forward vs. backward operations chart to see the relative computational cost of each pass.

How the result changes with Neurons per Layer

Neurons per LayerForward Pass OperationsBackward Pass OperationsOperations per Batch
10,001107,960,795215,921,59010,364,236,320
35,0011,252,860,7952,505,721,590120,274,636,320
65,0004,276,610,0008,553,220,000410,554,560,000
90,0008,171,460,00016,342,920,000784,460,160,000

What each input means

Input Size
Number of input features
Hidden Layers
Number of hidden layers
Neurons per Layer
Neurons in each hidden layer
Output Size
Number of output neurons
Batch Size
Batch size for training

How this is calculated

Formula

Backward Ops ≈ 2 × Forward Ops

Worked example, using the default values

  1. Identify Input Parameters
    4 parameters
    Input Size = 784, Hidden Layers = 2, Neurons per Layer = 128, Output Size = 10 = 5 input(s) provided
  2. Calculate Forward Pass Operations
    Forward Pass Operations
    118016 = 118016
  3. Calculate Backward Pass Operations
    Backward Pass Operations
    236032 = 236032
  4. Calculate Operations per Batch
    Operations per Batch
    11329536 = 11329536
  5. Calculate Activation Memory
    Activation Memory
    0.13 = 0.13
  6. Calculate Gradient Memory
    Gradient Memory
    0.45 = 0.45

Engine last updated . Checked against 2 independently-derived tests how we verify calculators.

The questions that sit next to this one — chosen by subject, including calculators filed under a different category.

More in Technology & Computing.