This question just came up on another recent thread. Please have a look at this thread and it probably answers your question.
It is the same as when you write the algorithms directly in python: they are randomly initialized and then learned through training.