|
|
|
|
|
|
reuse_encoder, |
|
|
|
) |
|
|
|
|
|
|
|
self.action_encoder = self._create_action_encoder( |
|
|
|
self.current_action, |
|
|
|
self.h_size, |
|
|
|
self.action_feature_size, |
|
|
|
action_layers, |
|
|
|
) |
|
|
|
self.action_encoder = self.current_action # self._create_action_encoder( |
|
|
|
# self.current_action, |
|
|
|
# self.h_size, |
|
|
|
# self.action_feature_size, |
|
|
|
# action_layers, |
|
|
|
# ) |
|
|
|
|
|
|
|
if not reuse_encoder: |
|
|
|
self.targ_encoder = tf.stop_gradient(self.targ_encoder) |
|
|
|
|
|
|
encoding_checkpoint = os.path.join(self.model_path, f"encoding.ckpt") |
|
|
|
encoding_saver.save(self.sess, encoding_checkpoint) |
|
|
|
|
|
|
|
action_vars = tf.get_collection( |
|
|
|
tf.GraphKeys.TRAINABLE_VARIABLES, "action_enc" |
|
|
|
) |
|
|
|
action_saver = tf.train.Saver(action_vars) |
|
|
|
action_checkpoint = os.path.join(self.model_path, f"action_enc.ckpt") |
|
|
|
action_saver.save(self.sess, action_checkpoint) |
|
|
|
# action_vars = tf.get_collection( |
|
|
|
# tf.GraphKeys.TRAINABLE_VARIABLES, "action_enc" |
|
|
|
# ) |
|
|
|
# action_saver = tf.train.Saver(action_vars) |
|
|
|
# action_checkpoint = os.path.join(self.model_path, f"action_enc.ckpt") |
|
|
|
# action_saver.save(self.sess, action_checkpoint) |
|
|
|
|
|
|
|
latent_vars = tf.get_collection( |
|
|
|
tf.GraphKeys.TRAINABLE_VARIABLES, "encoding/latent" |
|
|
|