Comments (2)
I reduce the beam_size to 1 or 2 and I found out that it achieves the same result. However, I applied to an auto annotation problem which generates about 50 words at a time. I don't think you need to reduce it. Plus, I reduce the number of connections and layers of encoder and decoder, too. About the visual, yes, its outcome is the same as your output.
from meshed-memory-transformer.
@Trantony I found that the function expands visual
(ie, repeats the tensor beam_size
times) at the first step and for subsequent steps the visual
fed as input is the same as the output of the function call.
Example:
If I feed in visual
as a FloatTensor of size(4, 50, 2048)
(b_s, seq_len, d_input) and beam_size=5
than self._expand_visual
returns a FloatTensor of size (20, 50, 2048)
(b_s * beam_size, seq_len, d_input) at the first step during beam search.
For subsequent steps of beam search, visual
of shape (20, 50, 2048)
, as expected, is fed as an argument to self._expand_visual
and output tensor generated is the same as the input.
old_visual = visual
visual = self._expand_visual(visual, cur_beam_size, selected_beam)
print(torch.equal(old_visual, visual))
>> True
Did I miss out anything? Also, how did you intend to speed up beam search?
from meshed-memory-transformer.
Related Issues (20)
- Problems during operation
- memory
- About Rl training
- RuntimeError: gather(): Expected dtype int64 for index, in beam_search/beam_search.py, line 26, in fn HOT 1
- FileNotFoundError: [Errno 2] No such file or directory: 'java' HOT 2
- About Online Evaluation
- no file found
- FileNotFoundError: [WinError 2] 系统找不到指定的文件。 HOT 6
- Ensemble problem
- Vocabulary of the test split
- Test on Custom Dataset HOT 1
- Beam search error HOT 3
- coco_detections.hdf5
- OSError: [Errno 24] Too many open files
- Hello, I would like to ask myself where is the description of the output generated by the model? HOT 1
- incomplete captions generated! HOT 1
- Features extracted from the flickr30k dataset
- "Error when running model: TypeError: 'generator' object is not callable" HOT 1
- OSError: [Errno 22] Invalid argument
- 关于cider得分的问题
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from meshed-memory-transformer.