megnet.layers.featurizer package

Module contents

Featurizers used after the graph generation and before the graph convolution

class GaussianExpansion(*args, **kwargs)[source]

Bases: keras.engine.base_layer.Layer

Simple Gaussian expansion. A vector of distance [d1, d2, d3, …, dn] is expanded to a matrix of shape [n, m], where m is the number of Gaussian basis centers

Parameters
  • centers (np.ndarray) – Gaussian basis centers

  • width (float) – width of the Gaussian basis

  • **kwargs

build(input_shape)[source]

build the layer :param input_shape: tuple of int for the input shape :type input_shape: tuple

call(inputs, masks=None)[source]

The core logic function

Parameters
  • inputs (tf.Tensor) – input distance tensor, with shape [None, n]

  • masks (tf.Tensor) – bool tensor, not used here

compute_output_shape(input_shape)[source]

Compute the output shape, used in older keras API

get_config()[source]

Get layer configurations