Author: Awais Farooq

  • Adamax

    Adamax class Optimizer that implements the Adamax algorithm. Adamax, a variant of Adam based on the infinity norm, is a first-order gradient-based optimization method. Due to its capability of adjusting the learning rate based on data characteristics, it is suited to learn time-variant process, e.g., speech data with dynamically changed noise conditions. Default parameters follow those…

  • Adagrad

    Adagrad class Optimizer that implements the Adagrad algorithm. Adagrad is an optimizer with parameter-specific learning rates, which are adapted relative to how frequently a parameter gets updated during training. The more updates a parameter receives, the smaller the updates. Arguments

  • Adadelta

    Adadelta class Optimizer that implements the Adadelta algorithm. Adadelta optimization is a stochastic gradient descent method that is based on adaptive learning rate per dimension to address two drawbacks: Adadelta is a more robust extension of Adagrad that adapts learning rates based on a moving window of gradient updates, instead of accumulating all past gradients. This…

  • AdamW

    AdamW class Optimizer that implements the AdamW algorithm. AdamW optimization is a stochastic gradient descent method that is based on adaptive estimation of first-order and second-order moments with an added method to decay weights per the techniques discussed in the paper, ‘Decoupled Weight Decay Regularization’ by Loshchilov, Hutter et al., 2019. According to Kingma et al., 2014, the…

  • Adam

    Adam class Optimizer that implements the Adam algorithm. Adam optimization is a stochastic gradient descent method that is based on adaptive estimation of first-order and second-order moments. According to Kingma et al., 2014, the method is “computationally efficient, has little memory requirement, invariant to diagonal rescaling of gradients, and is well suited for problems that are large…

  • RMSprop

    RMSprop class Optimizer that implements the RMSprop algorithm. The gist of RMSprop is to: This implementation of RMSprop uses plain momentum, not Nesterov momentum. The centered version additionally maintains a moving average of the gradients, and uses that average to estimate the variance. Arguments Example

  • SGD

    SGD class Gradient descent (with momentum) optimizer. Update rule for parameter w with gradient g when momentum is 0: Update rule when momentum is larger than 0: When nesterov=True, this rule becomes: Arguments

  • FFT ops

    fft function Computes the Fast Fourier Transform along last axis of input. Arguments Returns A tuple containing two tensors – the real and imaginary parts of the output tensor. Example fft2 function Computes the 2D Fast Fourier Transform along the last two axes of input. Arguments Returns A tuple containing two tensors – the real and imaginary…

  • Image ops

    affine_transform function Applies the given transform(s) to the image(s). Arguments Returns Applied affine transform image or batch of images. Examples crop_images function Crop images to a specified height and width. Arguments Returns If images were 4D, a 4D float Tensor of shape (batch, target_height, target_width, channels) If images were 3D, a 3D float Tensor of shape (target_height, target_width, channels) Example extract_patches function Extracts patches from the image(s). Arguments Returns Extracted…

  • Core ops

    Cast a tensor to the desired dtype. Arguments Returns A tensor of the specified dtype. Example cond function Conditionally applies true_fn or false_fn. Arguments Returns The output of either true_fn or false_fn depending on pred. convert_to_numpy function Convert a tensor to a NumPy array. Arguments Returns A NumPy array. convert_to_tensor function Convert a NumPy array to a tensor. Arguments Returns A tensor of the specified dtype. Example…