AI Wiki中文/EN

Receptive fields: span, support and actual influence

感受野

Trace convolution geometry and exact input derivatives to distinguish padding, dilation holes, unequal influence and cancellation.

On this pageIntuitionMathematics & methodImplementationLimitationsExercisesResearch connections

A wide window can contain holes

An output can have a receptive-field span of five input positions while depending on only positions 0,2 and 4. Another output can have seven possible contributors but be twenty times as sensitive to the center as to an endpoint. The span, the connected inputs and their actual influence answer different questions.

Deep Learning, Section 9.2 explains how stacked local operations expand receptive fields. Araujo, Norris and Sim’s 2019 Distill article derives sizes and locations, explicitly noting holes and boundary effects. We will compute both geometry and actual derivatives in small linear networks, without treating a theoretical span as a measured influence map.

Track spacing as well as size

Use one-dimensional cross-correlation, symmetric zero padding p, kernel size k, dilation d and stride s. Output t samples the previous feature map at these indices, and the output count uses floor rounding:

ij=ts−p+jd(0≤j<k),keff=1+d(k−1),N+=1+⌊N+2p−keffs⌋.i_j=ts-p+jd\quad(0\le j<k),\qquad k_{\mathrm{eff}}=1+d(k-1),\qquad N^+=1+\left\lfloor\frac{N+2p-k_{\mathrm{eff}}}{s}\right\rfloor.

Dilation spaces the kernel taps; stride spaces output locations. Out-of-range indices refer to zero padding, not additional observed input values. The formula assumes a positive output count and the stated padding convention.

Let r be the bounding span in original input coordinates, j the spacing between adjacent output centers measured in input-index units, and a the left endpoint for output zero. Starting with r₀=j₀=1 and a₀=0, a layer updates:

rl=rl−1+(keff,l−1)jl−1,jl=sljl−1,al=al−1−pljl−1.r_l=r_{l-1}+(k_{\mathrm{eff},l}-1)j_{l-1},\qquad j_l=s_lj_{l-1},\qquad a_l=a_{l-1}-p_lj_{l-1}.

The extra kernel reach is measured in previous-layer steps, each jₗ₋₁ input positions apart. Output t has bounding interval from aₗ+t jₗ to aₗ+t jₗ+rₗ−1. Padding changes its location; stride changes the jump. For a chain, iterating this recurrence recovers the usual sum of kernel extensions multiplied by preceding strides, with effective kernel widths accounting for dilation.

Three different support questions

For our linear network, every output can also be written as an exact weighted sum of original inputs:

yt=∑ict,ixi,∂yt∂xi=ct,i,{i:ct,i≠0}⊆Pt.y_t=\sum_i c_{t,i}x_i,\qquad \frac{\partial y_t}{\partial x_i}=c_{t,i},\qquad \{i:c_{t,i}\ne0\}\subseteq\mathcal P_t.

Here Pₜ is the potential input set obtained by tracing valid architecture taps, regardless of their current weights. The bounding interval can contain positions outside Pₜ because of dilation or stride. The actual nonzero derivative set can be smaller still because a weight is zero or path contributions cancel. For nonlinear networks the derivative also depends on the current input and activation state.

Take a three-tap first layer with stride 2 and padding 1, followed by a two-tap stride 1 unpadded layer, all weights one. The final span is five, jump two, left endpoint −1. Output zero’s interval is [−1,3], but the observed input set is only 0,1,2,3; its coefficients are 1,2,1,1. The padded position contributes no observed pixel.

Two dilated two-tap layers with dilation 2 have span five but first-output support 0,2,4, with coefficients 1,2,1. Three ordinary kernels (1,2,1) yield seven coefficients 1,6,15,20,15,6,1. Finally, kernels (1,1) then (1,−1) have structural support 0,1,2 but derivative 1,0,−1: the middle paths cancel.

Carry an input coefficient vector through the network

The complete Python 3.12 program propagates values, potential-support sets and exact coefficient vectors. It performs real cross-correlations and keeps padding out of the observed support. Each intermediate coefficient vector is the derivative of that linear feature with respect to the original input.

from fractions import Fraction as F


def scalar(x):
    if type(x) not in (int,F) or abs(x)>32:raise ValueError('bounded rational required')
    return F(x)


def trace_network(inputs,layers):
    values=[scalar(x) for x in inputs];n=len(values)
    if not 1<=n<=32 or not 0<=len(layers)<=8:raise ValueError('bounded input and layer count required')
    coefficients=[[F(int(i==j)) for j in range(n)] for i in range(n)]
    supports=[{i} for i in range(n)];span=jump=1;left=0
    for kernel,stride,dilation,pad in layers:
        kernel=[scalar(w) for w in kernel]
        if not 1<=len(kernel)<=5:raise ValueError('kernel length must be 1 through 5')
        if any(type(v) is not int for v in (stride,dilation,pad)) or not 1<=stride<=4 or not 1<=dilation<=4 or not 0<=pad<=8:raise ValueError('invalid bounded geometry')
        effective=1+dilation*(len(kernel)-1);count=1+(len(values)+2*pad-effective)//stride
        if not 1<=count<=64:raise ValueError('output size outside teaching contract')
        new_values=[];new_coefficients=[];new_supports=[]
        for t in range(count):
            value=F(0);row=[F(0)]*n;support=set()
            for j,w in enumerate(kernel):
                index=t*stride-pad+j*dilation
                if 0<=index<len(values):
                    value+=w*values[index];support.update(supports[index])
                    for i,c in enumerate(coefficients[index]):row[i]+=w*c
            new_values.append(value);new_coefficients.append(row);new_supports.append(support)
        left-=pad*jump;span+=(effective-1)*jump;jump*=stride
        values,coefficients,supports=new_values,new_coefficients,new_supports
    return dict(values=values,coefficients=coefficients,supports=supports,span=span,jump=jump,left=left)


if __name__=='__main__':
    cases=[('strided boundary',list(range(8)),[([1,1,1],2,1,1),([1,1],1,1,0)]),
           ('dilation holes',list(range(7)),[([1,1],1,2,0)]*2),
           ('binomial influence',list(range(1,8)),[([1,2,1],1,1,0)]*3),
           ('cancellation',[1,2,3],[([1,1],1,1,0),([1,-1],1,1,0)])]
    for name,inputs,layers in cases:
        r=trace_network(inputs,layers)
        print(name,'span/jump/left:',r['span'],r['jump'],r['left'])
        print('first output:',r['values'][0],'potential inputs:',sorted(r['supports'][0]))
        print('input derivative:',[str(c) for c in r['coefficients'][0]])

Actual output:

strided boundary span/jump/left: 5 2 -1
first output: 7 potential inputs: [0, 1, 2, 3]
input derivative: ['1', '2', '1', '1', '0', '0', '0', '0']
dilation holes span/jump/left: 5 1 0
first output: 8 potential inputs: [0, 2, 4]
input derivative: ['1', '0', '2', '0', '1', '0', '0']
binomial influence span/jump/left: 7 1 0
first output: 256 potential inputs: [0, 1, 2, 3, 4, 5, 6]
input derivative: ['1', '6', '15', '20', '15', '6', '1']
cancellation span/jump/left: 3 1 0
first output: -2 potential inputs: [0, 1, 2]
input derivative: ['1', '0', '-1']

Tests compare all four literal cases, check derivatives by perturbing each input, and verify geometry for identity kernels and invalid shapes. The coefficient audit is deliberately more expensive than a normal forward pass: with at most M features per layer, n original inputs, kernel width k and L layers, it uses O(LMkn) arithmetic and O(Mn) coefficient storage. Geometry alone needs O(L) work, and an ordinary value-only pass needs O(LMk).

A size formula is not an importance score

The binomial coefficients show unequal sensitivity for this particular linear filter chain. They do not prove that every trained network has a Gaussian effective receptive field. An empirical influence measure must specify the input, chosen output, gradient or perturbation method, aggregation and normalization.

Multiple branches require tracing their coordinate alignment before taking support unions. Two equally sized tensors can correspond to shifted input grids because of padding. Our program implements single chains only; the Distill article’s treatment of arbitrary graphs is a separate extension, not something this recurrence silently covers.

Attention, global pooling and normalization across spatial positions can introduce dependencies beyond a local convolutional footprint. A convolution-only calculation can therefore understate the full network’s support. Input preprocessing and image resizing also change how tensor coordinates map back to an original image.

A large receptive field does not ensure that a model uses all available context well. Conversely, a zero local derivative at one input may result from a gate and does not establish that the input can never influence the output after a finite change.

Count pixels, positions and influence separately

  1. What is the first observed support in the strided boundary example?

Answer 1: Positions 0,1,2,3, although the bounding interval also contains padded position−1.

  1. Do two dilation 2, two-tap layers use all five positions in their span?

Answer 2: No. Their first output uses 0,2,4.

  1. What are the three-kernel center and endpoint derivatives in the binomial example?

Answer 3: Twenty and one, respectively.

  1. Why is the middle derivative zero for kernels(1,1) followed by(1,−1)?

Answer 4: The two paths through the middle input have opposite coefficients and cancel.

Geometry and effective contribution should have separate evidence

The textbook supplies the layered-connectivity motivation; the Distill article supplies single-path geometry, location and hole/boundary distinctions. The dilation extension, literal chains, coefficient audit and cancellation example here are original. No source visualization, library implementation or trained-network influence experiment was copied.

Read convolution for the underlying operator, pooling for local reductions and skip connections for path contributions. A reliable diagram labels the coordinate system and the kind of support it represents.

Make a prediction, then check

A span-five dilated example depends on which first-output input positions?

Choose one answer

Learning objectives

  • Separate bounding span, potential support and actual derivative support.
  • Track stride, dilation and padding in input coordinates.

Prerequisites & connections

Explore related knowledge →

References

  1. Deep Learning — Chapter 9: Convolutional Networks
    Ian Goodfellow; Yoshua Bengio; Aaron Courville · 2016
  2. Computing Receptive Fields of Convolutional Neural Networks
    André Araujo; Wade Norris; Jack Sim · 2019

Version1 · Editorial status: Recorded technical checks completed

View technical check record (AI)

Codex · 2026-09-06 · Codex single-agent authored technical review: cited primary-source scope, explicit assumptions, original calculations and counterexamples, runnable tests and bilingual review; not independent human or second-agent review.

  • Single-agent authored technical review: bounded primary-source locations, assumptions, original derivations, exact/literal references and matching bilingual equations/examples/exercises. Not independent human or second-agent review.
  • Four focused CPython3.12.4 tests passed per chapter. Shared gradients, embedding scatter-add, receptive-field geometry and pooling routes are checked against literal references, analytic identities and finite differences. All four examples use exact fractions from the standard library.
  • Promoted the full prose, equations, code and exercises. Tests read formal MDX only; removed temporary fallbacks/draft skips and updated review assertion to checked. Algorithm and independent references are unchanged; final record binds both locale hashes.
  • Publication navigation points published topics to complete articles and removes corresponding pending wording, retaining directory entries for unwritten targets. Principles, equations, programs and exercises are unchanged; final article SHA values rebound.

Source locations checked:

Related topics

No matches. Try a synonym or acronym.

0 results shown

Wrap the whole query in double quotes for a phrase match.