Method
__init__
(self,
word_size,
pos_size,
hidden_size,
output_size,
max_text_len)
Source from the content-addressed store, hash-verified
| 106 | class T2MTextEncoder(nn.Module): |
| 107 | |
| 108 | def __init__(self, |
| 109 | word_size, |
| 110 | pos_size, |
| 111 | hidden_size, |
| 112 | output_size, |
| 113 | max_text_len): |
| 114 | super().__init__() |
| 115 | self.text_encoder = TextEncoderBiGRUCo( |
| 116 | word_size=word_size, |
| 117 | pos_size=pos_size, |
| 118 | hidden_size=hidden_size, |
| 119 | output_size=output_size, |
| 120 | ) |
| 121 | self.w_vectorizer = WordVectorizer('./data/glove', 'our_vab') |
| 122 | self.max_text_len = max_text_len |
| 123 | |
| 124 | def load_pretrained(self, ckpt_path): |
| 125 | checkpoint = torch.load(ckpt_path, map_location='cpu') |
Tested by
no test coverage detected