research/lab/py/dilated-receptive-field
0 directories and 2 files in research/lab/py/dilated-receptive-field.
dilated-receptive-field
- The effective receptive field of a dilated convolution stack read as a digit count, the numbers of dilations.
r_Q(n) = [z^n] prod_(j < L) Q(z^(b^j))is the weighted base-bdigit count of the block polynomialQ, computed in exact integers byproduct.countchecksproductagainst the digit recursionr_L(n) = sum_(c = n mod b) q_c r_(L-1)((n - c)/b)on every lag, forQ = 1 + z + z^2,b = 2,L = 1..exact, and for1 + z,2 + z,1 + z + z^2 + z^3atb = 3and1 + (1 + z + z^2)^2atL = exact - 4; checks Stern's recursion against the first32terms of A002487, copied from OEIS; then per levelL = 1..topassertsr(n) = s(n + 1)below2^L, the mirror, the maximumF_(L+1)at the four closed-form lags, the single-path lags2^k - 1and their mirrors numbering2L + 1, the folds(2^L + j) = r(j - 1) + r(j - 1 + 2^L), and prints peak over meanF_(L+1)(2^(L+1) - 1)/3^Land its step ratio against2 phi/3.limitdecides absolute continuity of the depth limit by the exact cyclotomic check in rational arithmetic,Qvanishing ate^(2 pi i k/b^i)for somei <= depthfor everyk < b^depthnot divisible byb, on35block polynomials: uniformK = 2..8atb = 2, 3, 4,1 + c(1 + z)and1 + c(1 + z + z^2)^2over a grid ofc, and(1 + z + z^2)^2; asserts the verdict against the Fourier productprod_i Q(e^(2 pi i t/b^i))/Q(1)overt < b^3not divisible byb; checks the real-gainQ = (z^2 - sqrt2 z + 1)(z^4 + sqrt2 z^2 + 1)(1 + z + z^2)^2atb = 2: its least coefficient, the level at which each oddk < 2^depthis covered,|Q|at the primitive2^i-th roots fori = 1..4, and the Fourier product over oddt < 256; prints the share of lags carrying half the mass atL = 8, 12, 16, 20for four polynomials.gradientdraws random linear stacks,channelschannels,levelslevels,drawstimes, for the pureK = 3stack atC sigma^2 = 1and the residual block1 + c(1 + z)atc = 1/2, and compares the mean squared gradient over input channels withr_Q, printing the largest z-score, the share past3, the median relative error and the correlation.copytrains a linearK = 3,b = 2stack by full-batch gradient descent on the lag-ncopy losssum_m (f(m) - [m = n])^2,fthe end-to-end filter, fromseedsinitialisations atscaletimes the variance-preserving scale, counting steps untilf(n) >= hit, a run pastcapread as above the cap in its median, at one lag in2^(L-1)..2^L - 1for eachrin1, 2, 3, 5, 8, 13, 21, 34, 55present, and fits log median steps againstlog 1/r.
RUN
uv run python research/lab/py/dilated-receptive-field/drf.py countfrommrlyprod/,1.8seconds.uv run python research/lab/py/dilated-receptive-field/drf.py limit,8.5seconds.uv run python research/lab/py/dilated-receptive-field/drf.py gradient,1.0seconds.uv run python research/lab/py/dilated-receptive-field/drf.py copy,4.2seconds;copy --scale 0.5,112seconds.uv run python research/lab/py/dilated-receptive-field/drf.py all,16seconds.--top 20,--exact 12,--depth 6,--channels 8,--levels 8,--draws 4000,--seeds 5,--lr 0.005,--scale 1,--cap 20000and--hit 0.5are the dials.- Prints only; reads and writes nothing.
WITNESSES
- The lines of dilations, every section.
count:0mismatches between the product and the digit recursion atL = 1..12and on the four other polynomials; the first32A002487 terms agree; every assertion holds atL = 1..20; maximum89at682, 852, 1194, 1364and21single-path lags atL = 10; fold0mismatches atL = 1..20; peak over mean3.0853atL = 10,6.5835atL = 20, step ratio1.07143atL = 3,1.14815atL = 4,1.07869fromL = 17.limit:35rows, verdict and Fourier product agreeing; uniform taps absolutely continuous exactly whenbdividesK;1 + c(1 + z)singular at everycon the grid;1 + c(1 + z + z^2)^2absolutely continuous only atc = 1; the real-gainQhas least coefficient0.5858, cover levels3, 4,|Q|up to11.6569, 0.8284, 0.6863, 9.9446at the primitive2, 4, 8, 16-th roots, Fourier product at most2.1e-18; half the mass on0.2740, 0.2561, 0.2415, 0.2280of the lags forK = 3,b = 2, and on0.0010atL = 20for1 + (1 + z)/4.gradient: median relative error0.0202, correlation0.9989over511lags, share of|z| > 30.0196, pureK = 3;0.0224,0.9999over256lags, residual.copy: lags255, 191, 223, 207, 215, 192, 213, 212atr = 1, 2, 3, 5, 8, 13, 21, 34, median steps615, 505, 376, 270, 250, 198, 108, 94, slope0.551, correlation0.984, no run capped; at--scale 0.5median steps15760, 12768, 8779, 7081, 6233, 6085, 4270, 3788, one run atr = 1capped, slope0.404, correlation0.983over the8lags.