Giter Site home page Giter Site logo

image-captions's Issues

Nothing inside checkpoint folder

Can you kindly provide the contents inside of the checkpoint folder. There is nothing mentioned about the files inside the checkpoint like encoder _baseline or encoder _ bert .
Please give me some solution . I am unable to run main.py
Because it says no file found in checkpoint named encoder _ baseline

Issue with BERT implementation

Hi,

It seems that you're trying to decode auto-regressively using BERT representations as a drop-in replacement for word embeddings. But BERT is bi-directional; the representation at token i has information about all tokens j > i. So, your model already knows what it needs to predict, before it predicts it.

In order for this to be correct you need to mask attention to all tokens j > i, which I don't think you do currently.

Get word embedding

I found when getting word embedding, the embedding matrix's size is changed to (batch_size, max_length+1, embedding_dim). The position of [CLS] is calculated to the embedding matrix. Can I change stack of token embedding to cap_embedding = torch.stack(tokens_embedding[1:])?

Test on Our Images

Thanks for great Repo.
How are we going to use from Bert in test code for testing on our images

where is glove_embeds.py & bug report

Thanks for sharing your project.
Would you tell me where can I find glove_embeds.py.
and bug report
main.py Line 316

  • decoder = Decoder(vocab_size=len(vocab),use_glove=use_glove, use_bert=use_bert).to(device)
  • decoder = Decoder(vocab_size=len(vocab),use_glove=glove_model, use_bert=bert_model).to(device)

when from_checkpoint set to False, [use_glove=use_glove, use_bert=use_bert] will raises error.

cap = u'[CLS] '+cap ???

       embeddings = []
        for cap_idx in  encoded_captions:
            
            # padd caption to correct size
            while len(cap_idx) < max_dec_len:
                cap_idx.append(PAD)
                
            cap = ' '.join([vocab.idx2word[word_idx.item()] for word_idx in cap_idx])
            cap = u'[CLS] '+cap

Hello, I want to know why here is the code "cap = u'[CLS] '+cap ", is not "cap = u'[CLS]'+cap+u'[SEP]'

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.