indexers module

Full Documentation for hippynn.graphs.nodes.indexers module. Click here for a summary page.

Nodes for indexing information.

class AtomDeIndexer(name, parents, module='auto', **kwargs)[source]

Bases: ExpandParents, AutoNoKw, SingleNode

Node for converting Atom->MolAtom

Note

This node has parent expansion, following these procedures.

  1. If matching (_BaseNode), then apply expand0

  2. If matching (_BaseNode, _BaseNode), then apply expand0

  3. Asserts that the number of parents is 5

expand0(features, mol_index, atom_index, n_mol, n_atom, **kwargs)[source]

Used for creation from parents with signature (_BaseNode, _BaseNode)

class AtomReIndexer(name, parents, module='auto', **kwargs)[source]

Bases: ExpandParents, AutoNoKw, SingleNode

Node for re-using index information to convert MolAtom->Atom.

Note

This node has parent expansion, following these procedures.

  1. If matching (SingleNode), then apply expand0

  2. If matching (SingleNode, PaddingIndexer), then apply expand1

  3. Asserts that the number of parents is 2

expand0(features, *, purpose, **kwargs)[source]

Used for creation from parents with signature (SingleNode)

expand1(features, pad_idx, **kwargs)[source]

Used for creation from parents with signature (SingleNode, PaddingIndexer)

class FilterBondsOneway(name, parents, module='auto', **kwargs)[source]

Bases: AutoNoKw, SingleNode

Node which filters the set of pairs to a one-way list.

class FuzzyHistogrammer(name, parents, length, vmin, vmax, module='auto', **kwargs)[source]

Bases: AutoKw, SingleNode

Node for transforming a scalar feature into a vectorized feature via the fuzzy/soft histogram method.

Parameters:

length – length of vectorized feature

class OneHotEncoder(name, parents, species_set, module='auto', **kwargs)[source]

Bases: AutoKw, Encoder, MultiNode

Node for encoding species as one-hot vectors

auto_module()[source]
class PaddingIndexer(name, parents, *args, **kwargs)[source]

Bases: AtomIndexer, AutoNoKw, ExpandParents, MultiNode

Node for building information to convert from MolAtom to Atom index state.

Note

This node has parent expansion, following these procedures.

  1. If matching (Encoder), then apply expand0

  2. Asserts that the number of parents is 2

expand0(encoder, **kwargs)[source]

Used for creation from parents with signature (Encoder)

class QuadUnpackNode(name, parents, module='auto', **kwargs)[source]

Bases: AutoNoKw, SingleNode

class SysMaxOfAtomsNode(name, parents, module='auto', **kwargs)[source]

Bases: ExpandParents, AutoNoKw, SingleNode

expansion0(node, *, purpose, **kwargs)[source]

Used for creation from parents with signature (_BaseNode)

expansion1(node, pidxer, *, purpose, **kwargs)[source]

Used for creation from parents with signature (_BaseNode, AtomIndexer)

acquire_encoding_padding(search_nodes, species_set, purpose=None)[source]

Automatically finds/builds a one-hot encoder and padding indexer starting from search_nodes.

If the encoder and padder exist as relatives of the search nodes.

Parameters:
  • search_nodes – Node or nodes to start from.

  • species_set – Species set to use if an encoder needs to be created.

  • purpose – String for error information if the process fails. (optional)

Returns:

encoder, padding indexer