atulkum / pointer_summarizer

pytorch implementation of "Get To The Point: Summarization with Pointer-Generator Networks"
Apache License 2.0
906 stars 242 forks source link

What does the variable (training) mean? #20

Closed qlwang25 closed 5 years ago

qlwang25 commented 5 years ago

https://github.com/atulkum/pointer_summarizer/blob/a6620efa39ae02d1f938121abb2a8c9c29e4eac0/training_ptr_gen/model.py#L152

Hi! I can not found the definition of the variable self.training. Could you give some explanations. Thanks a lot.

atulkum commented 5 years ago

This variable is coming from nn.Module, at the time of training it is True otherwise false. .eval() wil set this variable to false. https://github.com/atulkum/pointer_summarizer/blob/a6620efa39ae02d1f938121abb2a8c9c29e4eac0/training_ptr_gen/model.py#L209