-
Notifications
You must be signed in to change notification settings - Fork 534
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support different initializers for different embedding weights and loading pretrained embeddings
- Loading branch information
浅梦
authored
Oct 12, 2020
1 parent
ea69d9c
commit f9f5bb7
Showing
36 changed files
with
293 additions
and
194 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
from .utils import check_version | ||
|
||
__version__ = '0.1.3' | ||
__version__ = '0.2.0' | ||
check_version(__version__) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,29 @@ | ||
from deepctr.layers import custom_objects | ||
from deepctr.layers.utils import reduce_sum | ||
|
||
from .core import PoolingLayer, Similarity, LabelAwareAttention, CapsuleLayer,SampledSoftmaxLayer,EmbeddingIndex | ||
from ..utils import sampledsoftmaxloss | ||
from .interaction import DotAttention, ConcatAttention, SoftmaxWeightedSum, AttentionSequencePoolingLayer, SelfAttention,\ | ||
from .core import PoolingLayer, Similarity, LabelAwareAttention, CapsuleLayer, SampledSoftmaxLayer, EmbeddingIndex | ||
from .interaction import DotAttention, ConcatAttention, SoftmaxWeightedSum, AttentionSequencePoolingLayer, \ | ||
SelfAttention, \ | ||
SelfMultiHeadAttention, UserAttention | ||
from .sequence import DynamicMultiRNN | ||
from ..utils import sampledsoftmaxloss | ||
|
||
_custom_objects = {'PoolingLayer': PoolingLayer, | ||
'Similarity': Similarity, | ||
'LabelAwareAttention': LabelAwareAttention, | ||
'CapsuleLayer': CapsuleLayer, | ||
'reduce_sum':reduce_sum, | ||
'SampledSoftmaxLayer':SampledSoftmaxLayer, | ||
'sampledsoftmaxloss':sampledsoftmaxloss, | ||
'EmbeddingIndex':EmbeddingIndex, | ||
'DotAttention':DotAttention, | ||
'ConcatAttention':ConcatAttention, | ||
'SoftmaxWeightedSum':SoftmaxWeightedSum, | ||
'AttentionSequencePoolingLayer':AttentionSequencePoolingLayer, | ||
'SelfAttention':SelfAttention, | ||
'SelfMultiHeadAttention':SelfMultiHeadAttention, | ||
'UserAttention':UserAttention, | ||
'DynamicMultiRNN':DynamicMultiRNN | ||
'reduce_sum': reduce_sum, | ||
'SampledSoftmaxLayer': SampledSoftmaxLayer, | ||
'sampledsoftmaxloss': sampledsoftmaxloss, | ||
'EmbeddingIndex': EmbeddingIndex, | ||
'DotAttention': DotAttention, | ||
'ConcatAttention': ConcatAttention, | ||
'SoftmaxWeightedSum': SoftmaxWeightedSum, | ||
'AttentionSequencePoolingLayer': AttentionSequencePoolingLayer, | ||
'SelfAttention': SelfAttention, | ||
'SelfMultiHeadAttention': SelfMultiHeadAttention, | ||
'UserAttention': UserAttention, | ||
'DynamicMultiRNN': DynamicMultiRNN | ||
} | ||
|
||
custom_objects = dict(custom_objects, **_custom_objects) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.