In this paper we report the experimental realization of a reconfigurable reflective arrayed waveguide grating on silicon nitride technology, using optimization algorithms borrowed from machine learning applications. A dozen of band-shape responses, as well as a spectral resolution change, are demonstrated in the optical telecom C-band, alongside a proof of operation of the same device in the O-band. In the context of programmable and reconfigurable integrated photonics, this building block supports multi-wavelength/band spectral shaping of optical signals that can serve to multiple applications.