Skip to content

beam search #176

Open
Open
@asmartsnail

Description

@asmartsnail

topk_decoder = TopKDecoder(decoder, 5) seq2seq = Seq2seq(encoder, topk_decoder)
When I use the above code in sample.py, I get the following error.
image
When I make the following changes in TopKDecoder.py, the code can run successfully, but the accuracy is only about 0.2.
Where is the problem?
metadata['sequence'] = [seq[0] for seq in p] =》metadata['sequence'] = [seq[:,0,:] for seq in p]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions