It was not related to use that in your example, it is an academic example with code on how Deep learning could be used to mitigate some specific attacks in public-key cryptosystems.
As I’ve told you my opinion is that you cannot use directly ML for your original idea for the random component in public-key cryptosystems.