├── .gitignore ├── LICENSE ├── README.md ├── admin └── release_pypi.sh ├── docs ├── Attention、Transformer和Bert.md ├── Bert的常见变体.md ├── Dropout.md ├── ONNX推理加速.md ├── Warmup.md ├── images │ ├── MaskML.png │ ├── NSP.png │ ├── add-norm.png │ ├── attention-3-phrase.png │ ├── attention-equation.png │ ├── attention-general.png │ ├── attention-pic.png │ ├── attention-seq2seq-equation.png │ ├── attention-seq2seq.png │ ├── bce-2.png │ ├── bce-pt.png │ ├── bce.png │ ├── bert-arch.png │ ├── bert-finetune.png │ ├── bert-input.png │ ├── bert-wwm.png │ ├── bigbird.png │ ├── ce-loss-pi.png │ ├── ce-loss-weight.png │ ├── ce-loss-yi.png │ ├── ce-loss.png │ ├── constant_warmup.png │ ├── cosine_warmup.png │ ├── crf-loss-p.png │ ├── crf-loss.png │ ├── crf-trans-matrix.png │ ├── data-parallel-lb-imbalanced.png │ ├── data-parallel.png │ ├── distil-bert-loss-hidden.png │ ├── distil-bert-loss-mlm.png │ ├── distil-bert-loss-soft-label.png │ ├── distil-bert-loss-softmax.png │ ├── distil-bert-loss.png │ ├── distil-bert.png │ ├── distributed-data-parallel.png │ ├── dropout-drop-func.png │ ├── dropout.png │ ├── electra.png │ ├── ernie.png │ ├── feed-forward.png │ ├── fgm-g.png │ ├── fgm-r.png │ ├── focal-loss-1.png │ ├── focal-loss-gama.png │ ├── focal-loss.png │ ├── fp16-range.png │ ├── fp32-range.png │ ├── label-smooth-img.png │ ├── label-smooth-loss-yi.png │ ├── linear_warmup.png │ ├── longformer.png │ ├── macbert.png │ ├── mobile-bert-diff.png │ ├── mobile-bert-distil.png │ ├── mobile-bert-loss-att.png │ ├── mobile-bert-loss.png │ ├── mobile-bert.png │ ├── multi-head-self-attention-process.png │ ├── multi-head-self-attention.png │ ├── onnx-speed-example.png │ ├── onnx.png │ ├── pgd-r.png │ ├── pgd-r2.png │ ├── position-encoding.png │ ├── rounding-error.png │ ├── self-attention-equation.png │ ├── self-attention-example.png │ ├── self-attention-process.png │ ├── spanbert-mask.png │ ├── spanbert-span-len.png │ ├── tiny-bert-loss-att.png │ ├── tiny-bert-loss-emb.png │ ├── tiny-bert-loss-hid.png │ ├── tiny-bert-loss-mid.png │ ├── tiny-bert-loss-soft-label.png │ ├── tiny-bert-loss.png │ ├── tiny-bert-two-stage.png │ ├── tiny-bert.png │ ├── transformer-base.png │ ├── transformer-layers.png │ ├── transformer-xl-equation.png │ ├── transformer-xl.png │ ├── truncation-method-problem.png │ └── viterbi.png ├── 对抗训练.md ├── 常用的loss.md ├── 并行训练.md ├── 混合精度.md ├── 知识蒸馏.md └── 长文本.md ├── easy_bert ├── __init__.py ├── adversarial.py ├── base │ ├── __init__.py │ ├── base_predictor.py │ └── base_trainer.py ├── bert4classification │ ├── __init__.py │ ├── classification_model.py │ ├── classification_predictor.py │ └── classification_trainer.py ├── bert4pretraining │ ├── __init__.py │ └── mlm_trainer.py ├── bert4sequence_labeling │ ├── __init__.py │ ├── sequence_labeling_model.py │ ├── sequence_labeling_predictor.py │ └── sequence_labeling_trainer.py ├── configuration_nezha.py ├── losses │ ├── __init__.py │ ├── crf_layer.py │ ├── focal_loss.py │ └── label_smoothing_loss.py ├── modeling_nezha.py ├── tinybert_distiller.py └── vocab.py ├── models └── .gitignore ├── setup.py └── tests ├── __init__.py ├── test_add_on.py ├── test_bert4classification.py ├── test_bert4sequence_labeling.py ├── test_crf_layer.py ├── test_fp16.py ├── test_label_smoothing_ce.py ├── test_layerwise_lr_decay.py ├── test_load_last_ckpt.py ├── test_mlm.py ├── test_model └── .gitignore ├── test_model2 └── .gitignore ├── test_nezha.py ├── test_onnx.py ├── test_tinybert_distiller.py └── test_warmup.py /.gitignore: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/.gitignore -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/LICENSE -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/README.md -------------------------------------------------------------------------------- /admin/release_pypi.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/admin/release_pypi.sh -------------------------------------------------------------------------------- /docs/Attention、Transformer和Bert.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/Attention、Transformer和Bert.md -------------------------------------------------------------------------------- /docs/Bert的常见变体.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/Bert的常见变体.md -------------------------------------------------------------------------------- /docs/Dropout.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/Dropout.md -------------------------------------------------------------------------------- /docs/ONNX推理加速.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/ONNX推理加速.md -------------------------------------------------------------------------------- /docs/Warmup.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/Warmup.md -------------------------------------------------------------------------------- /docs/images/MaskML.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/MaskML.png -------------------------------------------------------------------------------- /docs/images/NSP.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/NSP.png -------------------------------------------------------------------------------- /docs/images/add-norm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/add-norm.png -------------------------------------------------------------------------------- /docs/images/attention-3-phrase.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/attention-3-phrase.png -------------------------------------------------------------------------------- /docs/images/attention-equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/attention-equation.png -------------------------------------------------------------------------------- /docs/images/attention-general.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/attention-general.png -------------------------------------------------------------------------------- /docs/images/attention-pic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/attention-pic.png -------------------------------------------------------------------------------- /docs/images/attention-seq2seq-equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/attention-seq2seq-equation.png -------------------------------------------------------------------------------- /docs/images/attention-seq2seq.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/attention-seq2seq.png -------------------------------------------------------------------------------- /docs/images/bce-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bce-2.png -------------------------------------------------------------------------------- /docs/images/bce-pt.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bce-pt.png -------------------------------------------------------------------------------- /docs/images/bce.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bce.png -------------------------------------------------------------------------------- /docs/images/bert-arch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bert-arch.png -------------------------------------------------------------------------------- /docs/images/bert-finetune.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bert-finetune.png -------------------------------------------------------------------------------- /docs/images/bert-input.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bert-input.png -------------------------------------------------------------------------------- /docs/images/bert-wwm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bert-wwm.png -------------------------------------------------------------------------------- /docs/images/bigbird.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/bigbird.png -------------------------------------------------------------------------------- /docs/images/ce-loss-pi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/ce-loss-pi.png -------------------------------------------------------------------------------- /docs/images/ce-loss-weight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/ce-loss-weight.png -------------------------------------------------------------------------------- /docs/images/ce-loss-yi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/ce-loss-yi.png -------------------------------------------------------------------------------- /docs/images/ce-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/ce-loss.png -------------------------------------------------------------------------------- /docs/images/constant_warmup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/constant_warmup.png -------------------------------------------------------------------------------- /docs/images/cosine_warmup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/cosine_warmup.png -------------------------------------------------------------------------------- /docs/images/crf-loss-p.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/crf-loss-p.png -------------------------------------------------------------------------------- /docs/images/crf-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/crf-loss.png -------------------------------------------------------------------------------- /docs/images/crf-trans-matrix.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/crf-trans-matrix.png -------------------------------------------------------------------------------- /docs/images/data-parallel-lb-imbalanced.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/data-parallel-lb-imbalanced.png -------------------------------------------------------------------------------- /docs/images/data-parallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/data-parallel.png -------------------------------------------------------------------------------- /docs/images/distil-bert-loss-hidden.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distil-bert-loss-hidden.png -------------------------------------------------------------------------------- /docs/images/distil-bert-loss-mlm.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distil-bert-loss-mlm.png -------------------------------------------------------------------------------- /docs/images/distil-bert-loss-soft-label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distil-bert-loss-soft-label.png -------------------------------------------------------------------------------- /docs/images/distil-bert-loss-softmax.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distil-bert-loss-softmax.png -------------------------------------------------------------------------------- /docs/images/distil-bert-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distil-bert-loss.png -------------------------------------------------------------------------------- /docs/images/distil-bert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distil-bert.png -------------------------------------------------------------------------------- /docs/images/distributed-data-parallel.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/distributed-data-parallel.png -------------------------------------------------------------------------------- /docs/images/dropout-drop-func.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/dropout-drop-func.png -------------------------------------------------------------------------------- /docs/images/dropout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/dropout.png -------------------------------------------------------------------------------- /docs/images/electra.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/electra.png -------------------------------------------------------------------------------- /docs/images/ernie.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/ernie.png -------------------------------------------------------------------------------- /docs/images/feed-forward.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/feed-forward.png -------------------------------------------------------------------------------- /docs/images/fgm-g.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/fgm-g.png -------------------------------------------------------------------------------- /docs/images/fgm-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/fgm-r.png -------------------------------------------------------------------------------- /docs/images/focal-loss-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/focal-loss-1.png -------------------------------------------------------------------------------- /docs/images/focal-loss-gama.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/focal-loss-gama.png -------------------------------------------------------------------------------- /docs/images/focal-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/focal-loss.png -------------------------------------------------------------------------------- /docs/images/fp16-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/fp16-range.png -------------------------------------------------------------------------------- /docs/images/fp32-range.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/fp32-range.png -------------------------------------------------------------------------------- /docs/images/label-smooth-img.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/label-smooth-img.png -------------------------------------------------------------------------------- /docs/images/label-smooth-loss-yi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/label-smooth-loss-yi.png -------------------------------------------------------------------------------- /docs/images/linear_warmup.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/linear_warmup.png -------------------------------------------------------------------------------- /docs/images/longformer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/longformer.png -------------------------------------------------------------------------------- /docs/images/macbert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/macbert.png -------------------------------------------------------------------------------- /docs/images/mobile-bert-diff.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/mobile-bert-diff.png -------------------------------------------------------------------------------- /docs/images/mobile-bert-distil.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/mobile-bert-distil.png -------------------------------------------------------------------------------- /docs/images/mobile-bert-loss-att.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/mobile-bert-loss-att.png -------------------------------------------------------------------------------- /docs/images/mobile-bert-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/mobile-bert-loss.png -------------------------------------------------------------------------------- /docs/images/mobile-bert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/mobile-bert.png -------------------------------------------------------------------------------- /docs/images/multi-head-self-attention-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/multi-head-self-attention-process.png -------------------------------------------------------------------------------- /docs/images/multi-head-self-attention.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/multi-head-self-attention.png -------------------------------------------------------------------------------- /docs/images/onnx-speed-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/onnx-speed-example.png -------------------------------------------------------------------------------- /docs/images/onnx.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/onnx.png -------------------------------------------------------------------------------- /docs/images/pgd-r.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/pgd-r.png -------------------------------------------------------------------------------- /docs/images/pgd-r2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/pgd-r2.png -------------------------------------------------------------------------------- /docs/images/position-encoding.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/position-encoding.png -------------------------------------------------------------------------------- /docs/images/rounding-error.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/rounding-error.png -------------------------------------------------------------------------------- /docs/images/self-attention-equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/self-attention-equation.png -------------------------------------------------------------------------------- /docs/images/self-attention-example.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/self-attention-example.png -------------------------------------------------------------------------------- /docs/images/self-attention-process.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/self-attention-process.png -------------------------------------------------------------------------------- /docs/images/spanbert-mask.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/spanbert-mask.png -------------------------------------------------------------------------------- /docs/images/spanbert-span-len.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/spanbert-span-len.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-loss-att.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-loss-att.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-loss-emb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-loss-emb.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-loss-hid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-loss-hid.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-loss-mid.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-loss-mid.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-loss-soft-label.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-loss-soft-label.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-loss.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-loss.png -------------------------------------------------------------------------------- /docs/images/tiny-bert-two-stage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert-two-stage.png -------------------------------------------------------------------------------- /docs/images/tiny-bert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/tiny-bert.png -------------------------------------------------------------------------------- /docs/images/transformer-base.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/transformer-base.png -------------------------------------------------------------------------------- /docs/images/transformer-layers.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/transformer-layers.png -------------------------------------------------------------------------------- /docs/images/transformer-xl-equation.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/transformer-xl-equation.png -------------------------------------------------------------------------------- /docs/images/transformer-xl.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/transformer-xl.png -------------------------------------------------------------------------------- /docs/images/truncation-method-problem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/truncation-method-problem.png -------------------------------------------------------------------------------- /docs/images/viterbi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/images/viterbi.png -------------------------------------------------------------------------------- /docs/对抗训练.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/对抗训练.md -------------------------------------------------------------------------------- /docs/常用的loss.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/常用的loss.md -------------------------------------------------------------------------------- /docs/并行训练.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/并行训练.md -------------------------------------------------------------------------------- /docs/混合精度.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/混合精度.md -------------------------------------------------------------------------------- /docs/知识蒸馏.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/知识蒸馏.md -------------------------------------------------------------------------------- /docs/长文本.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/docs/长文本.md -------------------------------------------------------------------------------- /easy_bert/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/__init__.py -------------------------------------------------------------------------------- /easy_bert/adversarial.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/adversarial.py -------------------------------------------------------------------------------- /easy_bert/base/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easy_bert/base/base_predictor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/base/base_predictor.py -------------------------------------------------------------------------------- /easy_bert/base/base_trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/base/base_trainer.py -------------------------------------------------------------------------------- /easy_bert/bert4classification/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easy_bert/bert4classification/classification_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4classification/classification_model.py -------------------------------------------------------------------------------- /easy_bert/bert4classification/classification_predictor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4classification/classification_predictor.py -------------------------------------------------------------------------------- /easy_bert/bert4classification/classification_trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4classification/classification_trainer.py -------------------------------------------------------------------------------- /easy_bert/bert4pretraining/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easy_bert/bert4pretraining/mlm_trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4pretraining/mlm_trainer.py -------------------------------------------------------------------------------- /easy_bert/bert4sequence_labeling/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easy_bert/bert4sequence_labeling/sequence_labeling_model.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4sequence_labeling/sequence_labeling_model.py -------------------------------------------------------------------------------- /easy_bert/bert4sequence_labeling/sequence_labeling_predictor.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4sequence_labeling/sequence_labeling_predictor.py -------------------------------------------------------------------------------- /easy_bert/bert4sequence_labeling/sequence_labeling_trainer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/bert4sequence_labeling/sequence_labeling_trainer.py -------------------------------------------------------------------------------- /easy_bert/configuration_nezha.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/configuration_nezha.py -------------------------------------------------------------------------------- /easy_bert/losses/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /easy_bert/losses/crf_layer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/losses/crf_layer.py -------------------------------------------------------------------------------- /easy_bert/losses/focal_loss.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/losses/focal_loss.py -------------------------------------------------------------------------------- /easy_bert/losses/label_smoothing_loss.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/losses/label_smoothing_loss.py -------------------------------------------------------------------------------- /easy_bert/modeling_nezha.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/modeling_nezha.py -------------------------------------------------------------------------------- /easy_bert/tinybert_distiller.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/tinybert_distiller.py -------------------------------------------------------------------------------- /easy_bert/vocab.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/easy_bert/vocab.py -------------------------------------------------------------------------------- /models/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/setup.py -------------------------------------------------------------------------------- /tests/__init__.py: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /tests/test_add_on.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_add_on.py -------------------------------------------------------------------------------- /tests/test_bert4classification.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_bert4classification.py -------------------------------------------------------------------------------- /tests/test_bert4sequence_labeling.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_bert4sequence_labeling.py -------------------------------------------------------------------------------- /tests/test_crf_layer.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_crf_layer.py -------------------------------------------------------------------------------- /tests/test_fp16.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_fp16.py -------------------------------------------------------------------------------- /tests/test_label_smoothing_ce.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_label_smoothing_ce.py -------------------------------------------------------------------------------- /tests/test_layerwise_lr_decay.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_layerwise_lr_decay.py -------------------------------------------------------------------------------- /tests/test_load_last_ckpt.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_load_last_ckpt.py -------------------------------------------------------------------------------- /tests/test_mlm.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_mlm.py -------------------------------------------------------------------------------- /tests/test_model/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /tests/test_model2/.gitignore: -------------------------------------------------------------------------------- 1 | * 2 | !.gitignore -------------------------------------------------------------------------------- /tests/test_nezha.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_nezha.py -------------------------------------------------------------------------------- /tests/test_onnx.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_onnx.py -------------------------------------------------------------------------------- /tests/test_tinybert_distiller.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_tinybert_distiller.py -------------------------------------------------------------------------------- /tests/test_warmup.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/old-wang-95/easy-bert/HEAD/tests/test_warmup.py --------------------------------------------------------------------------------