MatthieuCourbariaux / BinaryNet

Training Deep Neural Networks with Weights and Activations Constrained to +1 or -1
BSD 3-Clause "New" or "Revised" License
1.04k stars 346 forks source link

why I trained binary model is bigger than the original model? #10

Closed Weyne168 closed 7 years ago

Weyne168 commented 8 years ago

hi, I use the Lasagne to train a mlp model and cnn model on mnist, and get their ”model.npz” files. I found that the size of binary net ”model.npz” is larger than the ”model.npz” of mlp and cnn. Is that means the binary net will use more parameters and cost too much memory???

MatthieuCourbariaux commented 7 years ago

I found that the size of binary net ”model.npz” is larger than the ”model.npz” of mlp and cnn. Is that means the binary net will use more parameters and cost too much memory???

Those are the full precision training weights. You might want to:

  1. Binarize them with the sign function
  2. Concatenate them in int32 variables.
  3. Store them in a file.