kgcnn.initializers package

Submodules

kgcnn.initializers.initializers module

class kgcnn.initializers.initializers.GlorotOrthogonal(gain=1.0, seed=None, scale=1.0, mode='fan_avg')[source]

Bases: keras.src.initializers.random_initializers.OrthogonalInitializer

Combining Glorot variance and Orthogonal initializer.

Generate a weight matrix with variance according to Glorot initialization. Based on a random (semi-) orthogonal matrix neural networks are expected to learn better when features are de-correlated.

This is stated by e.g.:

This implementation has been borrowed and slightly modified from DimeNetPP .

get_config()[source]

Get keras config.

class kgcnn.initializers.initializers.HeOrthogonal(gain=1.0, seed=None, scale=1.0, mode='fan_in')[source]

Bases: keras.src.initializers.random_initializers.OrthogonalInitializer

Combining He variance and Orthogonal initializer.

Generate a weight matrix with variance according to He initialization. Based on a random (semi-)orthogonal matrix neural networks are expected to learn better when features are de-correlated.

This is stated by e.g.:

This implementation has been borrowed and slightly modified from GemNet .

static _standardize(kernel, shape)[source]

Standardize kernel over fan_in dimensions.

Parameters
  • kernel – Kernel variable.

  • shape – Shape of the kernel.

get_config()[source]

Get keras config.

kgcnn.initializers.initializers._compute_fans(shape)[source]

Computes the number of input and output units for a weight shape.

Taken from original TensorFlow implementation and copied here for static reference.

Parameters

shape – Integer shape tuple or tensor shape.

Returns

A tuple of integer scalars (fan_in, fan_out).

Module contents