  We open up the black box behind Deep Learning for portfolio optimization and
prove that a sufficiently wide and arbitrarily deep neural network (DNN)
trained to maximize the Sharpe ratio of the Stochastic Discount Factor (SDF) is
equivalent to a large factor model (LFM): A linear factor pricing model that
uses many non-linear characteristics. The nature of these characteristics
depends on the architecture of the DNN in an explicit, tractable fashion. This
makes it possible to derive end-to-end trained DNN-based SDFs in closed form
for the first time. We evaluate LFMs empirically and show how various
architectural choices impact SDF performance. We document the virtue of depth
complexity: With enough data, the out-of-sample performance of DNN-SDF is
increasing in the NN depth, saturating at huge depths of around 100 hidden
layers.
