uber-research / deep-neuroevolution

Deep Neuroevolution
Other
1.63k stars 298 forks source link

Weight Transfer into Tensorflow Model #17

Closed smiret closed 5 years ago

smiret commented 5 years ago

Hello,

First of all, I think you did some really great work! I am trying to apply the idea of using GAs to train models for some of my own work and have been looking to your work and code for some inspiration. I am wondering if you could help me find out how the weight calculated by the GA are fed into the tensorflow model archictecture? I have been looking through the repo for a while but am struggling to find the link between the GA and the model run.

Thanks!

fps7806 commented 5 years ago

Hi,

The GA maintains all parameters in a flat vector. When loading the weights into the model we use the function defined here. The GPU version of the code uses a similar mechanism.

Thanks, Felipe

smiret commented 5 years ago

I have been looking through the GPU version and as far as I understand it, the weight loading happens in the 'worker' module here, which inside the concurrent worker class seems to rely on the variable make_env_f. Am I on the right track? If so, the make_env_f seems to rely on a model_constructor, which constructs the model how? If I am completely off, I would appreciate if you could point me in the right direction.

fps7806 commented 5 years ago

I have been looking through the GPU version and as far as I understand it, the weight loading happens in the 'worker' module here, which inside the concurrent worker class seems to rely on the variable make_env_f. Am I on the right track? If so, the make_env_f seems to rely on a model_constructor, which constructs the model how? If I am completely off, I would appreciate if you could point me in the right direction.

No, make_env_f makes a new environment (Gym environment). self.model is where the weights are loaded/used. Here is the line where they are loaded. The method calls this function.

Hope that helps, Felipe