Skip to content

How to use func::gen_upper_triangle  #18

@XinDongol

Description

@XinDongol

Why we want to use gen_upper_triangle like

Get upper triangle matrix from start and end scores (batch)

instead of just calculating start_loss and end_loss separately like

start_loss = loss_fct(start_logits, start_positions)
end_loss = loss_fct(end_logits, end_positions)

https://github.com/huggingface/pytorch-transformers/blob/44dd941efb602433b7edc29612cbdd0a03bf14dc/pytorch_transformers/modeling_bert.py#L1250

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