1

I have a Sequential model in PyTorch:

model = nn.Sequential(
        nn.Embedding(alphabet_size, 64),
        nn.LSTM(64, ...),
        nn.Flatten(),
        nn.Linear(...),
        nn.Softmax()
    )

I would like to force the batch size to Embedding layer:

nn.Embedding(alphabet_size, 64)

as in Keras:

Embedding(alphabet_size, 64, batch_input_shape=(batch_size, time_steps)))

How to do it?

1 Answer 1

-1

Here is the answer to your question. The example already available below

PyTorch sequential model and batch_size

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.