Skip to content

What does I * (1 - valid_inds) mean? #3

Open
@JayChan-USTC

Description

@JayChan-USTC

hi,author!
During training, when calculating A, the following formula is used,
A = torch.matmul(prev_sim_map, A) * valid_inds + I * (1 - valid_inds)
A = A * valid_inds + I * (1 - valid_inds).

https://github.com/TRI-ML/RAM/blob/master/src/lib/model/networks/base_model.py#:~:text=if%20prev_sim_map%20is%20not%20None,A%20*%20valid_inds%20%2B%20I%20*%20(1%20-%20valid_inds)
(line 334-line 342)

I have two questions,
(1) I don't know what I * (1 - valid_inds) means,
(2) Why need to add I * (1 - valid_inds) after calculating (torch.matmul(prev_sim_map, A) * valid_inds) and (A * valid_inds)

Hope to get your reply, thank you!

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