An adaptive optical system (AOS) with a feedback loop closed via a feedforward neural network (NN) is considered. The vector of the wavefront corrector control signals is computed by the network from two vectors of the intensity moments measured in two near-field planes by two matrix photodetectors. The NN is trained with a back-propagation algorithm to predict the vector of adaptative mirror signals from the measured intensity vectors. During training, the network forms an optimal control algorithm for a given configuration of an optical system, taking into account misalignments and nonlinearities of the hardware used. A numerical model of a multichannel AOS controlled by a multilayer NN was built, trained, and run for difterent input aberrations. The neural control permits a direct conversion of the intensity distribution measured in the near field into control signals of a wavefront corrector. High efficiency of control has been demonstrated for a model of a 16-channel adaptive optical system for arbitrary input aberrations having a limited spatial spectrum.