Skip to content

how to select scale of position encoding ,when use scale,when not use  #36

@l2009312042

Description

@l2009312042

i read the positon encoding code found that
def call(self, x): """ call function """ seq_len = tf.shape(x)[1] if self.scale: x *= tf.math.sqrt(tf.cast(self.d_model, tf.float32)) x += self.pos_encoding[:, :seq_len, :] return x

my question is when to use the scale ,when not use ? is there any experimental result or theory to direct the seleciton?

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