Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use it in other .py file? #8

Open
EEstq opened this issue Nov 11, 2019 · 0 comments
Open

How to use it in other .py file? #8

EEstq opened this issue Nov 11, 2019 · 0 comments

Comments

@EEstq
Copy link

EEstq commented Nov 11, 2019

Hi, I use your code and it run successfully.But I can't get the result when I use it in its sub-module
it prints nothing when the function is called
e.g.

def dis_update(self, x_a, x_b, hyperparameters):
        gpu_tracker.track()
        self.dis_opt.zero_grad()
        x_a_1,x_a_2,h_a, n_a = self.gen_a.encode(x_a)
        x_b_1,x_b_2,h_b, n_b = self.gen_b.encode(x_b)
        # decode (cross domain)
        x_ba = self.gen_a.decode(x_b_1,x_b_2,h_b + n_b)
        x_ab = self.gen_b.decode(x_a_1,x_a_2,h_a + n_a)
        self.loss_dis_total = ......
        self.loss_dis_total.backward()
        self.dis_opt.step()
        gpu_tracker.track()

Can you help me with the problem?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant