Coder Social home page Coder Social logo

convbert_huggingface's Introduction

转化discriminators权重

  • 修改convert.py中的tf_checkpoint_path

  • python convert.py

测试

  • python test.py

  • 预计输出:

     cuda下的测试use_cuda_kernel=True时:
     small max difference is : tensor(3.3379e-06)
     small mean difference is : tensor(2.9952e-07)
     medium-small max difference is : tensor(3.4571e-06)
     medium-small mean difference is : tensor(2.6056e-07)
     base max difference is : tensor(5.7220e-06)
     base mean difference is : tensor(1.9045e-07)
    
     use_cuda_kernel=False时:
     small max difference is : tensor(4.5300e-06)
     small mean difference is : tensor(3.3393e-07)
     medium-small max difference is : tensor(3.2187e-06)
     medium-small mean difference is : tensor(2.6430e-07)
     base max difference is : tensor(5.7220e-06)
     base mean difference is : tensor(1.9694e-07)

其他

  • 通过设置config.use_cuda_kernal变量,决定是否使用fairseq的cuda版本的dynamicconv_layer。
  • dynamicconv_layer安装:cd convbert_huggingface/dynamicconv_layer & python setup.py install
  • transformers==3.5.1

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.