I am working with a directed acyclic graph that models the nx
random variables over nt
time steps. I built a mesh grid representing positional coordinates in this graph to retrieve the value of the variable xt,i where t is the time coordinate and i is one of the nx
random variables.
How can I obtain a list of key-value pair coordinates where the key is a pair of time (t_idx
) and positional (x_idx
) coordinate and the value is the next imediate coordinate where the variable is observed? It is possible to compute a boolean mask to know where the data is observed.
# time and positional coordinate
t_idx , x_idx = torch.meshgrid(torch.arange(arg.nt, out=torch.LongTensor()),
torch.arange(arg.nx, out=torch.LongTensor())
)
# time and positional coordinate with observed data
mask_data = (~torch.isnan(train_data)).squeeze(-1).nonzero()