encoders

openchem_encoder

class modules.encoders.openchem_encoder.OpenChemEncoder(params, use_cuda=None)[source]

Bases: torch.nn.modules.module.Module

Base class for embedding module

forward(inp)[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.

static get_optional_params()[source]
static get_required_params()[source]
training: bool

rnn_encoder

class modules.encoders.rnn_encoder.RNNEncoder(params, use_cuda)[source]

Bases: openchem.modules.encoders.openchem_encoder.OpenChemEncoder

forward(inp, previous_hidden=None, pack=True)[source]

inp: shape batch_size, seq_len, input_size previous_hidden: if given shape n_layers * num_directions, batch_size, embedding_dim.

Initialized automatically if None

return: embedded

static get_optional_params()[source]
static get_required_params()[source]
init_cell(batch_size)[source]
init_hidden(batch_size)[source]
training: bool

cnn_encoder

gcnn_encoder