bloomsburyai / question-generation

Neural text-to-text question generation
MIT License
217 stars 52 forks source link

Input shape for the tensors #31

Closed pidugusundeep closed 4 years ago

pidugusundeep commented 5 years ago

I would like to know the input and output of the model names along with the dimensions and shapes for them, Or please add some references for the same to get them

https://github.com/bloomsburyai/question-generation/blob/af189b1e43b5fca3f6a6f5d7e40362a4235c73fb/src/demo/instance.py#L45

I suppose the first parameter you are passing the dimensions of the tensor and the second one takes the inputs right here, so what exactly are the dimensions for the model along with the shape for each.

tomhosking commented 5 years ago

Sorry, I don't understand the question?

pidugusundeep commented 5 years ago

My bad let me elaborate, I am trying to freeze my model using intel OpenVINO and I need to know the exact dimensions of the input and output for the model which I got from the .pb(graph file)

tomhosking commented 5 years ago

Ah, I see - the inputs will be something like batch x length, both of which are dynamic. The actual TF placeholders are defined here: https://github.com/bloomsburyai/question-generation/blob/af189b1e43b5fca3f6a6f5d7e40362a4235c73fb/src/seq2seq_model.py#L61

Likewise, the output length is also dynamic as it will decode until every member of the batch has reached an end token (although this is capped at 40 tokens): https://github.com/bloomsburyai/question-generation/blob/af189b1e43b5fca3f6a6f5d7e40362a4235c73fb/src/seq2seq_model.py#L380