fd4b66763f91bf6e940184fb01a264c941a2e90e,pythainlp/transliterate/thai2rom.py,ThaiTransliterator,__init__,#ThaiTransliterator#,15
Before Change
self.__filemodel = get_corpus_path("thai2rom-pytorch")
loader = torch.load(self.__filemodel, map_location=device)
self._n_h = 64 // hidden dimensions for encoder
self._n_s = 64 // hidden dimensions for decoder
self._emb_dim = 64 // character embedding size
self._maxlength = 100
self._char_to_ix = loader["char_to_ix"]
self._ix_to_char = loader["ix_to_char"]
self._target_char_to_ix = loader["target_char_to_ix"]
self._ix_to_target_char = loader["ix_to_target_char"]
// encoder/ decoder
// Restore the model and construct the encoder and decoder.
self._encoder = Encoder(len(self._char_to_ix),
self._n_h, self._emb_dim).to(device)
self._encoder.load_state_dict(loader["encoder_state_dict"])
self._decoder = OneStepDecoder(
len(self._target_char_to_ix), self._n_s, self._emb_dim).to(device)
self._decoder.load_state_dict(loader["decoder_state_dict"])
def _prepare_sequence_in(self, input_text):
After Change
loader = torch.load(self.__filemodel, map_location=device)
INPUT_DIM, ENC_EMB_DIM, ENC_HID_DIM, ENC_DROPOUT = loader[
"encoder_params"
]
OUTPUT_DIM, DEC_EMB_DIM, DEC_HID_DIM, DEC_DROPOUT = loader[
"decoder_params"
]
self._maxlength = 100
self._char_to_ix = loader["char_to_ix"]
self._ix_to_char = loader["ix_to_char"]
self._target_char_to_ix = loader["target_char_to_ix"]
self._ix_to_target_char = loader["ix_to_target_char"]
// encoder/ decoder
// Restore the model and construct the encoder and decoder.
self._encoder = Encoder(
INPUT_DIM,
ENC_EMB_DIM,
ENC_HID_DIM,
ENC_DROPOUT
)
self._decoder = AttentionDecoder(
OUTPUT_DIM,
DEC_EMB_DIM,
In pattern: SUPERPATTERN
Frequency: 4
Non-data size: 8
Instances
Project Name: PyThaiNLP/pythainlp
Commit Name: fd4b66763f91bf6e940184fb01a264c941a2e90e
Time: 2019-08-02
Author: arta@Chakris-MacBook-Pro-2.local
File Name: pythainlp/transliterate/thai2rom.py
Class Name: ThaiTransliterator
Method Name: __init__
Project Name: biolab/orange3
Commit Name: 5b58ab5c45be8923e5d74e3bc84101be1ad13066
Time: 2017-08-21
Author: ales.erjavec@fri.uni-lj.si
File Name: Orange/widgets/unsupervised/owmds.py
Class Name: OWMDS
Method Name: _setup_plot
Project Name: maciejkula/spotlight
Commit Name: bc51dbc0c56f68ed30857755026633f78eef1ae8
Time: 2017-08-20
Author: maciej.kula@gmail.com
File Name: spotlight/layers.py
Class Name: BloomEmbedding
Method Name: forward
Project Name: rtqichen/torchdiffeq
Commit Name: 7391aec984c1e9e0899d51e6b0538483c37ec8fb
Time: 2020-07-27
Author: 33688385+patrick-kidger@users.noreply.github.com
File Name: torchdiffeq/_impl/adjoint.py
Class Name:
Method Name: odeint_adjoint