Questions tagged [beam-search]

This tag is for questions related to the heuristic search algorithm beam search.

From https://en.wikipedia.org/wiki/Beam_search:

Beam search is a heuristic search algorithm that explores a graph by expanding the most promising node in a limited set. Beam search is an optimization of best-first search that reduces its memory requirements. Best-first search is a graph search which orders all partial solutions (states) according to some heuristic which attempts to predict how close a partial solution is to a complete solution (goal state). But in beam search, only a predetermined number of best partial solutions are kept as candidates.

41 questions
0
votes
0 answers

How to generate text from Seq2SeqLMOutput of Transformers?

I am working on a text generation task using T5. For some reason, I can't use T5ForConditionalGeneraton class which includes functions like model.generate(). Now the output of model is Seq2SeqLMOutput, same as T5ForConditionalGeneraton. This blog…
0
votes
1 answer

HuggingFace Summarization: effect of specifying both `do_sample` and `num_beams`

I am using a HuggingFace summarization pipeline to generate summaries using a fine-tuned model. The summarizer object is initialised as follows: from transformers import pipeline summarizer = pipeline( "summarization", model=model, …
0
votes
1 answer

Spacy beam search memory leak?

When I use spacy's beam search, there will be a memory leak problem, how can I solve it? The code that causes the memory leak is as follows: beams = nlp.entity.beam_parse(docs, beam_width=beam_width, beam_density=beam_density)
shaojie
  • 121
  • 1
  • 11
0
votes
1 answer

Can prefix beam search commonly used in speech recognition with CTC be implemented in such a simpler way?

I am learning about speech recognition recently, and I have learned that the idea of prefix beam search is to merge paths with the same prefix, such as [1,1,_] and [_,1,_] (as you can see, _ indicates blank mark). Based on this understanding, I…
Randool
  • 11
  • 2
0
votes
1 answer

What is Monte Carlo Beam Search in neural networks?

Monte Carlo Beam Search is often referenced in neural network and reinforcement learning research. What is it and how is it different than Monte Carlo search.
Justin Shenk
  • 538
  • 1
  • 4
  • 17
0
votes
1 answer

How to implement a beam search decoder in an SageMaker hosting endpoint?

I've created a SageMaker model for a Seq2Seq neural network, and then started a SageMaker endpoint: create_endpoint_config_response = sage.create_endpoint_config( EndpointConfigName = endpoint_config_name, ProductionVariants=[{ …
0
votes
1 answer

Issue with CTC Beam Search and Tensorflow C++ API

I've frozen a tensorflow model that has as last node a ctc beam search. Using the pyhton API is possible to interpret the output tensor and convert to final sequence of labels. Since I want to use this frozen model in C++ I'm wondering how to use…
hellbago
  • 1
  • 1
0
votes
0 answers

Speeding up Beam Search with seq2seq

I have a fully working seq2seq attention model with beam search and it does give improved results. But it takes > 1min for inferencing (batch-size 1024) with k=5 (k is my hypotheses) because none of it is parallelised. Everything happens 1 sample at…
0
votes
0 answers

Can a beam search algorith with backtracking have different number solutions for different beam value

I am developing a Beam Search Algorithm with Backtacking and, when I tested the algorithm, I got different number of solutions for different beam length. So I just wanna make sure that is this possible in this algorithm or, for any beam length, the…
Foramkumar Parekh
  • 421
  • 1
  • 6
  • 26
0
votes
2 answers

Difference b/w Hill climbing and Beam search for #beam = 1

If we consider beam search with just 1 beam will be similar to hill climbing or is there some other difference? As per definition of beam search, it keeps track of k best states in a hill-climbing algorithm.so if k = 1, we should have a regular hill…
mribot
  • 519
  • 1
  • 11
  • 29
0
votes
2 answers

rand () function C++

I need to generate 4 random numbers, each between [-45 +45] degrees. and if rand%2 = 0 then I want the result (the random number generated to be equal to -angle). Once the 4 random numbers are generated it is requires to scan these angles and find a…
user1838418
1 2
3