[WIP] extracting learning rates to learning_rates.pxd and learning_rates.pyx

This pull request is for #3647
I thought about putting ```free``` it in the ```__dealloc__``` method, so that might work. The reason I changed this was to avoid retaining the gil. What I can do instead though is instantiate a NumPy array and maintain a pointer to its data, maybe that would work?