tempor.models.clairvoyance2.components.torch.grud module

Adapted from: https://github.com/zhiyongc/GRU-D/blob/master/GRUD.py

Citation: Ganin, Yaroslav, and Victor Lempitsky. “Unsupervised domain adaptation by backpropagation.” International conference on machine learning. PMLR, 2015.

class tempor.models.clairvoyance2.components.torch.grud.FilterLinear(in_features, out_features, filter_square_matrix, device, bias=True)[source]

Bases: Module

filter_square_matrix : filter square matrix, whose each elements is 0 or 1.

reset_parameters()[source]
forward(x)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

training : bool
class tempor.models.clairvoyance2.components.torch.grud.GRUD(input_size, hidden_size, device, output_last=False)[source]

Bases: Module

Recurrent Neural Networks for Multivariate Times Series with Missing Values GRU-D: GRU exploit two representations of informative missingness patterns, i.e., masking and time interval.

Implemented based on the paper: Ganin, Yaroslav, and Victor Lempitsky. “Unsupervised domain adaptation by backpropagation.” International conference on machine learning. PMLR, 2015.

Note

input_size: variable dimension of each time hidden_size: dimension of hidden_state mask_size: dimension of masking vector

step(x, x_last_obsv, h, mask, delta)[source]
forward(input)[source]

Defines the computation performed at every call.

Should be overridden by all subclasses.

Note

Although the recipe for forward pass needs to be defined within this function, one should call the Module instance afterwards instead of this since the former takes care of running the registered hooks while the latter silently ignores them.

initHidden(batch_size)[source]
get_input_for_grud(t, y, y_mask)[source]
training : bool