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

Does the prednet accept batches? #16

Open
Sahaj09 opened this issue Aug 27, 2020 · 1 comment
Open

Does the prednet accept batches? #16

Sahaj09 opened this issue Aug 27, 2020 · 1 comment

Comments

@Sahaj09
Copy link

Sahaj09 commented Aug 27, 2020

Does the prednet accept batches during train/test?

The input is given as-

input_sequence = Variable(torch.rand(T, 1, 1, 4 * 2 ** L, 6 * 2 ** L))

I assumed (time-step, batch size, channels, length, breadth) is the input format. Am I wrong?

@Atcold
Copy link
Owner

Atcold commented Aug 30, 2020

Both MatchNet and TempoNet expect one element at the time.

for t in range(0, min(args.big_t, x.size(0)) - 1):
    ce_loss, mse_loss, state, x_hat_data = compute_loss(x[t], x[t + 1], y[t], state)
def compute_loss(x_, next_x, y_, state_):
    (x_hat, state_), (_, idx) = model(V(x_), state_)
    ...
    return ce_loss_, mse_loss_, state_, x_hat.data

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

2 participants