Initializer

class ampligraph.latent_features.Initializer(initializer_params={}, verbose=True, seed=0)

Abstract class for initializer .

Methods

__init__([initializer_params, verbose, seed])

Initialize the Class

_init_hyperparams(hyperparam_dict)

Initializes the hyperparameters.

get_tf_initializer()

Create a tensorflow node for initializer

get_np_initializer(in_shape, out_shape)

Create an initialized numpy array

_display_params()

Display the parameter values

__init__(initializer_params={}, verbose=True, seed=0)

Initialize the Class

Parameters
  • initializer_params (dict) – dictionary of hyperparams that would be used by the initializer.

  • verbose (bool) – set/reset verbose mode

  • seed (int/np.random.RandomState) – random state for random number generator

_init_hyperparams(hyperparam_dict)

Initializes the hyperparameters.

Parameters

hyperparam_dict (dictionary) – Consists of key value pairs. The initializer will check the keys to get the corresponding params

get_tf_initializer()

Create a tensorflow node for initializer

Returns

initializer_instance

Return type

An Initializer instance.

get_np_initializer(in_shape, out_shape)

Create an initialized numpy array

Parameters
  • in_shape (int) – number of inputs to the layer (fan in)

  • out_shape (int) – number of outputs of the layer (fan out)

Returns

initialized_values – Initialized weights

Return type

n-d array

_display_params()

Display the parameter values