Giter Site home page Giter Site logo

bert-pruning's People

Contributors

arexh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

bert-pruning's Issues

Prune parameters in a given layer

Hi,

I am trying remove some filters in a Conv2D layer based on their l2 norm values.

Ex:
If a Conv2D layer has 32 filters with size (3,3,3,32) 3x3 is size of the kernel, 3 is repeating gray scale image and 32 is number of filters

Can i remove some filters and make the layer shape (3,3,3,30) with your codebase

I dint really go through your codebase

Thanks

help me

Hi,
Thank you so much for publishing your code. I download your code and run it step by step (run_all.sh, factorize.sh, run.sh, remove_mask.sh) on the sst-2 task. The last step, 'finetune again', is not provided and I follow the settings in run_all.sh. But the result is unsatisfying (dev acc =83%). And when I use your method on some smaller datasets (e.g., RTE, CoLA), the actual_compact_rate (after removing mask) is larger than 1. (RTE=1.36). Could your please provide more details of sst-2 task about the last step or tell me the most possible reasons, if it is convenient for you. I would really appreciate it.
Sincerely.

BertConfig object has no attribute pruned_layers_dim

I ran

bash factorize.sh

factorize.sh is:

python ./flop/factorize.py \
  --bert_config_file=./uncased_L-12_H-768_A-12/bert_config.json \
  --checkpoint=/workspace/BERT-Pruning/output/fine_tune_outputs/SST-2/lr_3e-5/model.ckpt-6313 \
  --output_dir=./uncased_L-12_H-768_A-12_SST-2_f/bert_model_f.ckpt \
  --finetuned

I got the following error

Traceback (most recent call last):
  File "./flop/factorize.py", line 135, in <module>
    finetuned=args.finetuned)
  File "./flop/factorize.py", line 69, in save_factorized_model
    finetuned=finetuned)
  File "./flop/factorize.py", line 46, in create_model
    factorize=True)
  File "/workspace/BERT-Pruning/flop/modeling_flop.py", line 178, in __init__
    pruned_layers_dim=config.pruned_layers_dim)
AttributeError: 'BertConfig' object has no attribute 'pruned_layers_dim

Any comments / help would be really appreciated :)

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.