Giter Site home page Giter Site logo

trellixvulnteam / pytorch-pretrained-bert_annotation_2bfn Goto Github PK

View Code? Open in Web Editor NEW

This project forked from yongbowin/pytorch-pretrained-bert_annotation

0.0 0.0 0.0 292 KB

bert annotation, input and output for people from scratch, 代码注释, 有每一步的输入和输出, 适合初学者

License: Apache License 2.0

Shell 0.12% Python 23.41% Jupyter Notebook 76.44% Dockerfile 0.03%

pytorch-pretrained-bert_annotation_2bfn's Introduction

PyTorch Pretrained Bert Annotation

This BERT annotation repo is for my personal study.

  • The raw README of PyTorch Pretrained Bert is here.
  • A very nice PPT to help understanding.
  • Synthetic Self-Training PPT.

Arch

The BertModel and BertForMaskedLM arch.

BertModel Arch

  • BertEmbeddings
    • word_embeddings: Embedding(30522, 768)
    • position_embeddings: Embedding(512, 768)
    • token_type_embeddings: Embedding(2, 768)
    • LayerNorm: BertLayerNorm()
    • dropout: Dropout(p=0.1)
  • BertEncoder
    • BertLayer: (12 layers)
      • BertAttention
        • BertSelfAttention
          • query: Linear(in_features=768, out_features=768, bias=True)
          • key: Linear(in_features=768, out_features=768, bias=True)
          • value: Linear(in_features=768, out_features=768, bias=True)
          • dropout: Dropout(p=0.1)
        • BertSelfOutput
          • dense: Linear(in_features=768, out_features=768, bias=True)
          • LayerNorm: BertLayerNorm()
          • dropout: Dropout(p=0.1)
      • BertIntermediate
        • dense: Linear(in_features=768, out_features=3072, bias=True)
        • activation: gelu
      • BertOutput
        • dense: Linear(in_features=3072, out_features=768, bias=True)
        • LayerNorm: BertLayerNorm()
        • dropout: Dropout(p=0.1)
  • BertPooler
    • dense: Linear(in_features=768, out_features=768, bias=True)
    • activation: Tanh()

BertForMaskedLM Arch

  • BertModel
    • BertEmbeddings
      • word_embeddings: Embedding(30522, 768)
      • position_embeddings: Embedding(512, 768)
      • token_type_embeddings: Embedding(2, 768)
      • LayerNorm: BertLayerNorm()
      • dropout: Dropout(p=0.1)
    • BertEncoder
      • BertLayer: (12 layers)
        • BertAttention
          • BertSelfAttention
            • query: Linear(in_features=768, out_features=768, bias=True)
            • key: Linear(in_features=768, out_features=768, bias=True)
            • value: Linear(in_features=768, out_features=768, bias=True)
            • dropout: Dropout(p=0.1)
          • BertSelfOutput
            • dense: Linear(in_features=768, out_features=768, bias=True)
            • LayerNorm: BertLayerNorm()
            • dropout: Dropout(p=0.1)
        • BertIntermediate
          • dense: Linear(in_features=768, out_features=3072, bias=True)
          • activation: gelu
        • BertOutput
          • dense: Linear(in_features=3072, out_features=768, bias=True)
          • LayerNorm: BertLayerNorm()
          • dropout: Dropout(p=0.1)
    • BertPooler
      • dense: Linear(in_features=768, out_features=768, bias=True)
      • activation: Tanh()
  • BertOnlyMLMHead
    • BertLMPredictionHead
      • transform: BertPredictionHeadTransform
        • dense: Linear(in_features=768, out_features=768, bias=True)
        • LayerNorm: BertLayerNorm()
      • decoder: Linear(in_features=768, out_features=30522, bias=False)

pytorch-pretrained-bert_annotation_2bfn's People

Contributors

trellixvulnteam avatar yongbowin avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.