We present a neural network approach to the problem of determining lot sizes under demand uncertainty. The situation is considered in which at any decision moment the demand is given for a small finite data horizon into the future and the lot sizes are determined on a rolling-horizon basis. We demonstrate how a properly designed multi-layered perceptron can successfully be learned to detect planning horizons in case of a simple lot-sizing problem with Wagner-Whitin cost structure. We develop a two-stage decision procedure in which in the first stage the multi-layered perceptron estimates a planning horizon within the data horizon. In the second stage a detailed plan for this estimated planning horizon is calculated. We compare the cost performance of this procedure with some of the well-known lot-sizing heuristics for a number of different cost and demand conditions. The main finding is that the proposed approach is quite robust and dominates under the majority of the conditions.