akanazawa / hmr

Project page for End-to-end Recovery of Human Shape and Pose
Other
1.54k stars 395 forks source link

Training order for generators and discriminators #147

Closed ffiioonnaa closed 4 years ago

ffiioonnaa commented 4 years ago

Hi,Thanks for your excellent work.
I'm not sure about the training order for the generator discriminator.I find that when session.run(), it will update both the e_var and d_var.Isn't this an Interval training?

with self.sv.managed_session(config=self.sess_config) as sess:
            while not self.sv.should_stop():
                fetch_dict = {
                    "summary": self.summary_op_always,
                    "step": self.global_step,
                    "e_loss": self.e_loss,
                    # The meat
                    "e_opt": self.e_opt,
                    "loss_kp": self.e_loss_kp
                }
                if not self.encoder_only:
                    fetch_dict.update({
                        # For D:
                        "d_opt": self.d_opt,
                        "d_loss": self.d_loss,
                        "loss_disc": self.e_loss_disc,
                    })
              ......

                t0 = time()
                result = sess.run(fetch_dict)
                t1 = time()
akanazawa commented 4 years ago

Nope its just trained jointly together! works fine! didn't try alternating

A