das.kapre.augmentation

class das.kapre.augmentation.AdditiveNoise(*args, **kwargs)[source]

Adds Gaussian noise to the spectrogram.

Init.

Parameters
  • power (float, optional) – Standard deviation of the noise. Defaults to 0.1.

  • random_gain (True, optional) – If True, gain is sampled from uniform(low=0.0, high=power) in every batch. Defaults to False.

  • noise_type (str, optional) – Only supports white. Defaults to ‘white’.

call(x)[source]

This is where the layer’s logic lives.

Note here that call() method in tf.keras is little bit different from keras API. In keras API, you can pass support masking for layers as additional arguments. Whereas tf.keras has compute_mask() method to support masking.

Parameters
  • inputs – Input tensor, or list/tuple of input tensors.

  • *args – Additional positional arguments. Currently unused.

  • **kwargs – Additional keyword arguments. Currently unused.

Returns

A tensor or list/tuple of tensors.

get_config()[source]

Returns the config of the layer.

A layer config is a Python dictionary (serializable) containing the configuration of a layer. The same layer can be reinstantiated later (without its trained weights) from this configuration.

The config of a layer does not include connectivity information, nor the layer class name. These are handled by Network (one layer of abstraction above).

Note that get_config() does not guarantee to return a fresh copy of dict every time it is called. The callers should make a copy of the returned dict if they want to modify it.

Returns

Python dictionary.