In this paper, a compact microstrip rat-race coupler at a 950 MHz operating frequency is designed, simulated, and fabricated. New branches are proposed in this design using high-/low- impedance open-ended resonators. In the conventional rat-race coupler, there are three long λ/4 branches and a 3λ/4 branch, and they occupy a very large area. In the presented designed, three compact branches are proposed for use instead of three λ/4 branches and an ultra-compact branch is suggested for use instead of the 3λ/4 branch. Additionally, an artificial neural network (ANN) approach is incorporated to improve the performance of the resonators using a radial basis function (RBF) network. The proposed compact structure has achieved a reduction of more than 82% compared with the size of the conventional coupler structures. Additionally, the proposed coupler can suppress the 2nd up to the 5th harmonic to improve the performance of the device.