Welcome to our Support Center

GreedySearch

Description

Greedy Search for text generation.

Input parameters

 

specified_outputs_namearray, this parameter lets you manually assign custom names to the output tensors of a node.

 Graphs in : cluster, ONNX model architecture.

input_ids (heterogeneous) – I : object, the sequence used as a prompt for the generation. Shape is (batch_size, sequence_length).
max_length (heterogeneous) – I : object, the maximum length of the sequence to be generated. Shape is (1).
min_length (optional, heterogeneous) – I : object, the minimum length below which the score of eos_token_id is set to -Inf. Shape is (1).
repetition_penalty (optional, heterogeneous) – T : object, the parameter for repetition penalty. Default value 1.0 means no penalty. Accepts value > 0.0. Shape is (1).
vocab_mask (optional, heterogeneous) – I : object, mask of vocabulary. Words that masked with 0 are not allowed to be generated, and 1 is allowed. Shape is (vocab_size).
attention_mask (optional, heterogeneous) – I : object, custom attention mask. Shape is (batch_size, sequence_length).

 Parameters : cluster,

num_heads : integer,
Default value “0”.
 training? : boolean, whether the layer is in training mode (can store data for backward).
Default value “True”.
 lda coeff : float, defines the coefficient by which the loss derivative will be multiplied before being sent to the previous layer (since during the backward run we go backwards).
Default value “1”.

 name (optional) : string, name of the node.

Output parameters

 

sequences (heterogeneous) – I : object, word IDs of generated sequences. Shape is (batch_size, max_sequence_length).

Type Constraints

T in (tensor(float)) : Constrain input and output types to float tensors.

I in (tensor(int32)) : Constrain to integer types.

Example

All these exemples are snippets PNG, you can drop these Snippet onto the block diagram and get the depicted code added to your VI (Do not forget to install Deep Learning library to run it).
Table of Contents