EdGENetworks / attention-networks-for-classification

Hierarchical Attention Networks for Document Classification in PyTorch
606 stars 133 forks source link

single data prediction #5

Closed dgai91 closed 7 years ago

dgai91 commented 7 years ago

I'm new in python. In your model,hidden state depend on the batch_size.when i want a single data prediction i've got problems.could you help me or give me some code?

Sandeep42 commented 7 years ago

You can load both models and set batch size to 1. After that you can do something like this. Hope that helps. https://gist.github.com/Sandeep42/b4af6aaf1fa92a69f26558fda246dd6f