20
0

Almost Uniform Sampling From Neural Networks

Abstract

Given a length nn sample from Rd\mathbb{R}^d and a neural network with a fixed architecture with WW weights, kk neurons, linear threshold activation functions, and binary outputs on each neuron, we study the problem of uniformly sampling from all possible labelings on the sample corresponding to different choices of weights. We provide an algorithm that runs in time polynomial both in nn and WW such that any labeling appears with probability at least (W2ekn)W\left(\frac{W}{2ekn}\right)^W for W<nW<n. For a single neuron, we also provide a random walk based algorithm that samples exactly uniformly.

View on arXiv
Comments on this paper