Skip to content

Numerical Stability in consecutive matrix multiplication #3304

@DogNick

Description

@DogNick

Is there anybody that can shed some light on the implementation of consecutive matrix multiplication?
Since i was implementing a forward-backward algorithm with many matrix multiplied together, which could lead to a numerical problem. A common way of doing this is to just transfer the conventional vector dot operation to a "LogOfSumExp" process with max-subtraction trick involved , in which situation the elements in matrix are regarded as energy(log probability) instead of the original probability mass.
My question is that whether i can take advantage of some optimized cblas functions to make a new version of matrix multiplication utility function corresponding to those already in math_function.cpp ?
and if i just handcraft all this functions element by element , Do i have to suffer a severe efficiency loss ?

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