This paper studies the joint design of transmit precoding matrix and RIS phase shift vector in a multi-user multiple-input multiple-output (MIMO) communication system using reconfigurable intelligent surfaces (RIS). The max-min optimization problem is posed to maximize the minimum achievability ratio, considering transmit power and reradiation mask constraints. The Arimoto-Blahut algorithm is used to simplify the achievable rate, and the alternate optimization technique is used to decompose the problem into quadratic programming (QPQC) subproblems with quadratic constraints. To improve the efficiency, a model-based neural network optimization is developed that utilizes one-hot encoding for the incident and reflected angles. A greedy search algorithm is used to solve the optimization problem for discrete phase shifting, solving the real RIS constraints. Simulation results show that the proposed method effectively forms multi-beam radiation patterns in the desired direction while satisfying the reradiation mask constraints. The neural network design reduces the execution time, and the discrete phase shifting scheme achieves excellent performance with only four phase shift levels, while slightly reducing the beamforming gain.