Giter Site home page Giter Site logo

Comments (9)

nlpyang avatar nlpyang commented on July 21, 2024 4

For extractive, batch_size is maximum number of sentences in the source document
For abstractive, batch_size is maximum number of tokens in the target summary

It is designed to use the memory more effectively.

from presumm.

astariul avatar astariul commented on July 21, 2024

As I understood so far :

Each step, the Trainer class run accum_count mini-batch.
For each mini-batch, there is X samples, where X vary following :

X * max(len(x) for x in X) <= batch_size

Please let me know if I understood right !


I think some comments on this function :

def ext_batch_size_fn(new, count):
if (len(new) == 4):
pass
src, labels = new[0], new[4]
global max_n_sents, max_n_tokens, max_size
if count == 1:
max_size = 0
max_n_sents = 0
max_n_tokens = 0
max_n_sents = max(max_n_sents, len(src))
max_size = max(max_size, max_n_sents)
src_elements = count * max_size
return src_elements

might be helpful !

from presumm.

jdh3577 avatar jdh3577 commented on July 21, 2024

Then, what is the exactly number of real(original mean) batch size?

from presumm.

astariul avatar astariul commented on July 21, 2024

Batchsize (by its traditional definition) is not a fixed number here. This is designed to use the memory much more efficiently than using a fixed number.

from presumm.

nlpyang avatar nlpyang commented on July 21, 2024

@jdh3577 As I said, this is dynamic during training.

from presumm.

Shashi456 avatar Shashi456 commented on July 21, 2024

@nlpyang would decreasing the batch size to 512 in Extractive summarization affect performance?

from presumm.

gaozhiguang avatar gaozhiguang commented on July 21, 2024

Hi, Does the batchsize here have something to do with the number of GPU, it uses the distributed training, how does the model update its parameters? is it all gpus gradient merge and then update?

from presumm.

gaozhiguang avatar gaozhiguang commented on July 21, 2024

if self.grad_accum_count > 1:
if self.n_gpu > 1:
grads = [p.grad.data for p in self.model.parameters()
if p.requires_grad
and p.grad is not None]
distributed.all_reduce_and_rescale_tensors(
grads, float(1))
for o in self.optims:
o.step()

maybe the code here

from presumm.

pretidav avatar pretidav commented on July 21, 2024

@nlpyang could you please shed some light on the meaning of this parameter, it clearly isn't the number of documents in the batch, but something related to the number of word-pieces multiplied by a funny factor 300. Is the latter a typo or a magic number inserted on purpose ?
Thanks

from presumm.

Related Issues (20)

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.