tensorflow / tensor2tensor

Library of deep learning models and datasets designed to make deep learning more accessible and accelerate ML research.
Apache License 2.0
15.52k stars 3.5k forks source link

Transformer inputs [batch_size, input_length, 1, hidden_dim] #1776

Open icecream0 opened 4 years ago

icecream0 commented 4 years ago

Description

Transformer inputs [batch_size, input_length, 1, hidden_dim], I want to know why inputs shape is not [batch_size, input_length, hidden_dim], have some reasons?please tell me ,thank you ...

Environment information

OS: <your answer here>

$ pip freeze | grep tensor
# your output here

$ python -V
# your output here

For bugs: reproduction and error logs

# Steps to reproduce:
...
# Error logs:
...
martinpopel commented 4 years ago

I think all inputs are treated as two dimensional, so the framework can generalize to images easily.

icecream0 commented 4 years ago

I think all inputs are treated as two dimensional, so the framework can generalize to images easily.

maybe,thanks a lot. transformer mainly used for nlp, so the design of framework make code reader more difficult