MCPcopy Create free account

hub / github.com/bojone/el-2019 / functions

Functions28 in github.com/bojone/el-2019

↓ 11 callersFunctionseq_padding
(X, padding=0)
el.py:204
↓ 4 callersFunctionisin_feature
(text_a, text_b)
el.py:213
↓ 4 callersFunctionsent2vec
S格式:[[w1, w2]]
el.py:36
↓ 4 callersFunctiontokenize
如果pyhanlp不好用,自己修改tokenize函数, 换成自己的分词工具即可。
el.py:29
↓ 3 callersFunctionsearch_subjects
实现最大匹配算法
el.py:89
↓ 2 callersFunctionextract_items
(text_in)
el.py:546
↓ 2 callersFunctionis_match_objects
(text, object_regex)
el.py:225
↓ 2 callersMethodmask
(self, x, mask, mode='mul')
el.py:345
↓ 1 callersMethod__init__
(self)
el.py:626
↓ 1 callersMethod__iter__
(self)
el.py:241
↓ 1 callersMethodapply_ema_weights
备份原模型权重,然后将平均权重应用到模型上去。
el.py:530
↓ 1 callersMethodevaluate
(self)
el.py:638
↓ 1 callersMethodinitialize
ema_weights初始化跟原模型初始化一致。
el.py:525
↓ 1 callersMethodinject
添加更新算子到model.metrics_updates。
el.py:518
↓ 1 callersMethodreset_old_weights
恢复模型到旧权重。
el.py:536
Method__call__
(self, inputs)
el.py:414
Method__init__
(self, data, batch_size=64)
el.py:233
Method__init__
(self, nb_head, size_per_head, **kwargs)
el.py:324
Method__init__
(self, layer)
el.py:402
Method__init__
(self, model, momentum=0.9999)
el.py:514
Method__len__
(self)
el.py:239
Methodbuild
(self, input_shape)
el.py:329
Methodcall
(self, inputs)
el.py:354
Methodcompute_output_shape
(self, input_shape)
el.py:385
Methodon_epoch_end
(self, epoch, logs=None)
el.py:629
Methodreverse_sequence
这里的mask.shape是[batch_size, seq_len, 1]
el.py:407
Functionseq_maxpool
seq是[None, seq_len, s_size]的格式, mask是[None, seq_len, 1]的格式,先除去mask部分, 然后再做maxpooling。
el.py:389
Functiontest
(test_data)
el.py:614