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

can not understand transition some code. Help,thanks #60

Open
vangogh0318 opened this issue Mar 17, 2019 · 0 comments
Open

can not understand transition some code. Help,thanks #60

vangogh0318 opened this issue Mar 17, 2019 · 0 comments

Comments

@vangogh0318
Copy link

vangogh0318 commented Mar 17, 2019

I don't understand the code below. I have two question

1.why do this operation : x[0, -1] = imgs[0]
imgs[0] Represents actual number of frames?
I think that imgs[0] is the first predicted frame by T(transition) function, why Assign imgs[0] to x[0,-1]

  1. What does this operation mean?
    what's the different between video[:, 0] and video[:,1]
    video = video.reshape((batch_size, 2, 80, 160, 3))
    return video[:, 0], video[:, 1]

here is code : --------------------------

    def sampler(z, x):
            video = np.zeros((128, 80, 160, 3))
            print "Sampling..."
            for i in range(128):
                    print i
                    x = x.reshape((-1, 80, 160, 3))
        
                    code = sess.run([E(I)[0]], feed_dict={I: x, K.learning_phase(): 1})[0]
                    code = code.reshape((batch_size, time+out_leng, z_dim))
                    inp = code[:, :time]
                    outs = T.predict(inp, batch_size=batch_size)
                    # imgs = G.predict(out, batch_size=batch_size)
                    imgs = sess.run([G_dec], feed_dict={out: outs, K.learning_phase(): 1})[0]
                    video[i] = imgs[0]
                    x = x.reshape((batch_size, time+out_leng, 80, 160, 3))
                    x[0, :-1] = x[0, 1:]
                    x[0, -1] = imgs[0]

           video = video.reshape((batch_size, 2, 80, 160, 3))
           return video[:, 0], video[:, 1]
@vangogh0318 vangogh0318 changed the title can not understand transition same code. Help,thanks can not understand transition some code. Help,thanks Mar 17, 2019
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