gatelfpytorchjson.LayerCNN module

class gatelfpytorchjson.LayerCNN.Concat(dim=-1)[source]

Bases: torch.nn.modules.module.Module

Simple module that will concatenate a list of inputs across a dimension

forward(listofx)[source]
class gatelfpytorchjson.LayerCNN.LayerCNN(emb_dims, config={}, **kwargs)[source]

Bases: gatelfpytorchjson.CustomModule.CustomModule

LayerCNN handles a single input of shape (batchsize, maxseqlen, embdims) and creates everything to get a final output of hidden units (including batch normalization, dropout and non-linearity) The number of output units is in self.dim_outputs after initialisation.

forward(batch)[source]
class gatelfpytorchjson.LayerCNN.ListModule(modulelist)[source]

Bases: torch.nn.modules.module.Module

Simple module that runs the same input through all modules in a modulelist and returns a list of outputs

forward(x)[source]
class gatelfpytorchjson.LayerCNN.MaxFrom1d(dim=-1)[source]

Bases: torch.nn.modules.module.Module

Simple maxpool module that takes the maximum from one dimension of a tensor and reduces the tensor dimensions by 1. Essentially the same as torch.max(x, dim=thedimension)

forward(x)[source]
class gatelfpytorchjson.LayerCNN.Transpose4CNN[source]

Bases: torch.nn.modules.module.Module

Does the transposing for CNN

forward(x)[source]