Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bert_XJY_ZJUT #67

Merged
merged 91 commits into from
May 8, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
91 commits
Select commit Hold shift + click to select a range
0443e15
Create README_CN.md
JingyangXiang Mar 31, 2021
e85eefc
Add files via upload
JingyangXiang Mar 31, 2021
e0ec140
Add files via upload
JingyangXiang Mar 31, 2021
06e38d8
Update README_CN.md
JingyangXiang Mar 31, 2021
3b4efc7
Create README_CN.md
JingyangXiang Mar 31, 2021
2901b9d
Add files via upload
JingyangXiang Mar 31, 2021
80ffc5a
Delete README_CN.md
JingyangXiang Mar 31, 2021
d9ceae6
Update model.py
JingyangXiang Apr 1, 2021
05214fb
Merge branch 'main' into main
JingyangXiang Apr 2, 2021
fffcede
Delete AlexNet_TinyMS directory
JingyangXiang Apr 2, 2021
c34c103
Delete DenseNet100_TinyMS directory
JingyangXiang Apr 2, 2021
11de662
bert
JingyangXiang Apr 3, 2021
b251483
bert
JingyangXiang Apr 3, 2021
148a0cf
bert
JingyangXiang Apr 5, 2021
4537d18
bert
JingyangXiang Apr 5, 2021
c28fd00
bert
JingyangXiang Apr 5, 2021
cccff87
bert
JingyangXiang Apr 5, 2021
a23fffc
bert
JingyangXiang Apr 5, 2021
5220a28
bert
JingyangXiang Apr 5, 2021
1d50807
bert
JingyangXiang Apr 5, 2021
e0a379c
bert
JingyangXiang Apr 5, 2021
760e806
Merge branch 'main' into bert
JingyangXiang Apr 8, 2021
7e996ec
Merge branch 'main' into bert
JingyangXiang Apr 8, 2021
66cedd1
bert
JingyangXiang Apr 12, 2021
997f03d
bert
JingyangXiang Apr 12, 2021
c508dba
bert
JingyangXiang Apr 12, 2021
1553811
bert
JingyangXiang Apr 12, 2021
f5b232a
bert
JingyangXiang Apr 12, 2021
2ab7040
bert
JingyangXiang Apr 12, 2021
828494a
bert
JingyangXiang Apr 12, 2021
6c4a906
bert
JingyangXiang Apr 12, 2021
bfd9baa
bert
JingyangXiang Apr 12, 2021
988b3fb
bert
JingyangXiang Apr 12, 2021
ee6d8d6
bert
JingyangXiang Apr 12, 2021
d340a3f
bert
JingyangXiang Apr 12, 2021
fab9dbe
bert
JingyangXiang Apr 12, 2021
29dbc09
Merge branch 'main' into bert
JingyangXiang Apr 12, 2021
43fd040
Merge branch 'main' into bert
JingyangXiang Apr 13, 2021
443af5c
bert
JingyangXiang Apr 20, 2021
01bf14e
bert
JingyangXiang Apr 20, 2021
cc5dd78
bert
JingyangXiang Apr 20, 2021
feb44b8
bert
JingyangXiang Apr 20, 2021
7fee898
bert
JingyangXiang Apr 20, 2021
2ee8438
bert
JingyangXiang Apr 20, 2021
be25430
bert
JingyangXiang Apr 21, 2021
8187bb6
bert
JingyangXiang Apr 21, 2021
1f8b239
bert
JingyangXiang Apr 21, 2021
b4d080e
bert
JingyangXiang Apr 21, 2021
6a34f87
bert
JingyangXiang Apr 21, 2021
51f34cd
bert
JingyangXiang Apr 21, 2021
ef0904b
bert
JingyangXiang Apr 21, 2021
ab952e4
bert
JingyangXiang Apr 21, 2021
ad162e9
bert
JingyangXiang Apr 21, 2021
948a2b9
Merge branch 'main' into bert
JingyangXiang Apr 21, 2021
dcb7771
bert
JingyangXiang Apr 21, 2021
a357036
bert
JingyangXiang Apr 21, 2021
893ccce
bert
JingyangXiang Apr 21, 2021
3cde41e
bert
JingyangXiang Apr 22, 2021
35f6553
bert
JingyangXiang Apr 22, 2021
7c0352e
Merge branch 'main' into bert
JingyangXiang Apr 22, 2021
4aef55e
bert
JingyangXiang Apr 22, 2021
59ff0b0
bert
JingyangXiang Apr 22, 2021
8898c7c
bert
JingyangXiang Apr 22, 2021
1eaaf6c
bert
JingyangXiang Apr 22, 2021
6a6315b
bert
JingyangXiang Apr 27, 2021
be4f7d1
bert
JingyangXiang Apr 27, 2021
6c5ca64
bert
JingyangXiang Apr 27, 2021
5af4bd9
bert
JingyangXiang Apr 27, 2021
7a34535
bert
JingyangXiang Apr 27, 2021
5769efa
bert
JingyangXiang Apr 29, 2021
ec360d8
bert
JingyangXiang Apr 29, 2021
24f3c5d
bert
JingyangXiang Apr 29, 2021
266c0f0
bert
JingyangXiang May 1, 2021
b6797ad
bert
JingyangXiang May 1, 2021
4c28b80
bert
JingyangXiang May 1, 2021
5188034
bert
JingyangXiang May 1, 2021
6ce827f
bert
JingyangXiang May 1, 2021
75bf321
bert
JingyangXiang May 1, 2021
c9f0ba2
bert
JingyangXiang May 1, 2021
d4e19de
Merge branch 'main' into main
JingyangXiang May 2, 2021
7f6c7bf
Merge branch 'main' into bert
leonwanghui May 7, 2021
01d87bd
Merge pull request #1 from zjuter0126/main
JingyangXiang May 7, 2021
2a6efb7
Merge pull request #2 from zjuter0126/bert
JingyangXiang May 7, 2021
5c8e9fc
Merge branch 'tinyms-ai:main' into main
JingyangXiang May 8, 2021
bd59be4
berty
JingyangXiang May 8, 2021
daeddce
1
JingyangXiang May 8, 2021
559500b
1
JingyangXiang May 8, 2021
d1a5546
1
JingyangXiang May 8, 2021
a64a3e7
1
JingyangXiang May 8, 2021
cb25a33
1
JingyangXiang May 8, 2021
661195f
1
JingyangXiang May 8, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion tinyms/callbacks.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ class BertLossCallBack(Callback):
None

Examples:
>>> from tinyms import Tensor
>>> from tinyms.callbacks import BertLossCallBack
>>>
>>> BertLossCallBack(dataset_size=1)
Expand Down
6 changes: 4 additions & 2 deletions tinyms/data/loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,10 @@
from .utils import generate_image_list, load_img


__all__ = ['UnalignedDataset', 'GanImageFolderDataset', 'ImdbDataset',
'DistributedSampler', 'BertDataset']
common_dataset = ['UnalignedDataset', 'GanImageFolderDataset', 'ImdbDataset', 'BertDataset']
common_sampler = ['DistributedSampler']

__all__ = common_dataset + common_sampler
__all__.extend(engine.__all__)

random.seed(1)
Expand Down
2 changes: 1 addition & 1 deletion tinyms/model/bert/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# ============================================================================
"""Bert Init."""

from .bert_for_pre_training import BertNetworkWithLoss, BertPreTraining, \
from .bert_for_pretraining import BertNetworkWithLoss, BertPreTraining, \
BertPretrainingLoss, GetMaskedLMOutput, GetNextSentenceOutput, \
BertTrainOneStepCell, BertTrainOneStepWithLossScaleCell, \
BertTrainAccumulationAllReduceEachWithLossScaleLayer, \
Expand Down
2 changes: 1 addition & 1 deletion tinyms/model/bert/bert_for_finetune.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from tinyms import context
from tinyms import layers
from tinyms import primitives as P
from .bert_for_pre_training import clip_grad
from .bert_for_pretraining import clip_grad
from .finetune_eval_model import BertCLSModel, BertNERModel, BertSquadModel


Expand Down
3 changes: 3 additions & 0 deletions tinyms/text/transforms.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

from . import _transform_ops
from ._transform_ops import *
from ..data import *
JingyangXiang marked this conversation as resolved.
Show resolved Hide resolved


__all__ = [
Expand All @@ -33,6 +34,8 @@ def __init__(self):

def apply_ds(self, data_set, batch_size):
JingyangXiang marked this conversation as resolved.
Show resolved Hide resolved

assert isinstance(data_set, BertDataset), "For BertDatasetTransform, BertDataset is needed"

type_cast_op = TypeCast(ts.int32)
data_set = data_set.map(operations=type_cast_op, input_columns="masked_lm_ids")
data_set = data_set.map(operations=type_cast_op, input_columns="masked_lm_positions")
Expand Down