MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.common.BeamSearch< T > Class Template Reference

The BeamSearch uses the softmax output from the network and continually runs the net on each output (using the output as input) until the end of token is reached. The beam-search tree is returned. More...

Public Member Functions

 BeamSearch (Net< T > net)
 The constructor. More...
 
List< Tuple< double, bool, List< Tuple< string, int, double > > > > Search (PropertySet input, int nK, double dfThreshold=0.01, int nMax=80)
 Perform the beam-search. More...
 

Detailed Description

The BeamSearch uses the softmax output from the network and continually runs the net on each output (using the output as input) until the end of token is reached. The beam-search tree is returned.

Template Parameters
T

Definition at line 18 of file BeamSearch.cs.

Constructor & Destructor Documentation

◆ BeamSearch()

The constructor.

Parameters
netSpecifies the net used for the forward passes.

Definition at line 27 of file BeamSearch.cs.

Member Function Documentation

◆ Search()

List< Tuple< double, bool, List< Tuple< string, int, double > > > > MyCaffe.common.BeamSearch< T >.Search ( PropertySet  input,
int  nK,
double  dfThreshold = 0.01,
int  nMax = 80 
)

Perform the beam-search.

Parameters
inputSpecifies the input data (e.g. the encoder input)
nKSpecifies the beam width for the search.
dfThresholdSpecifies the threshold where detected items with probabilities less than the threshold are ignored (default = 0.01).
nMaxSpecifies the maximum length to process (default = 80)
Returns
The list of top sequences is returned.

The beam-search algorithm is inspired by the article

See also
How to Implement a Beam Search Decoder for Natural Language Processing by Jason Brownlee, "Machine Learning Mastery", 2018

Definition at line 56 of file BeamSearch.cs.


The documentation for this class was generated from the following file: