  Swarming of animal groups enthralls scientists in fields ranging from biology
to physics to engineering. Complex swarming patterns often arise from simple
interactions between individuals to the benefit of the collective whole. The
existence and success of swarming, however, nontrivially depend on microscopic
parameters governing the interactions. Here we show that a machine-learning
technique can be employed to tune these underlying parameters and optimize the
resulting performance. As a concrete example, we take an active matter model
inspired by schools of golden shiners, which collectively conduct phototaxis.
The problem of optimizing the phototaxis capability is then mapped to that of
maximizing benefits in a continuum-armed bandit game. The latter problem
accepts a simple reinforcement-learning algorithm, which can tune the
continuous parameters of the model. This result suggests the utility of
machine-learning methodology in swarm-robotics applications.
