Author: Awais Farooq

  • Linear algebra ops

    cholesky function Computes the Cholesky decomposition of a positive semi-definite matrix. Arguments Returns A tensor of shape (…, M, M) representing the lower triangular Cholesky factor of x. det function Computes the determinant of a square tensor. Arguments Returns A tensor of shape (…,) represeting the determinant of x. eig function Computes the eigenvalues and eigenvectors of a square matrix. Arguments Returns inv function Computes…

  • NN ops

    average_pool function Average pooling operation. Arguments Returns A tensor of rank N+2, the result of the average pooling operation. batch_normalization function Normalizes x by mean and variance. This op is typically used by the batch normalization step in a neural network. It normalizes the input tensor along the given axis. Arguments Returns The normalized tensor. Example binary_crossentropy function Computes binary cross-entropy loss between…

  • NumPy ops

    Compute the absolute value element-wise. keras.ops.abs is a shorthand for this function. Arguments Returns An array containing the absolute value of each element in x. Example add function Add arguments element-wise. Arguments Returns The tensor containing the element-wise sum of x1 and x2. Examples keras.ops.add also broadcasts shapes: all function Test whether all array elements along a given axis evaluate to True. Arguments Returns…

  • SwapEMAWeights

    Swaps model weights and EMA weights before and after evaluation. This callbacks replaces the model’s weight values with the values of the optimizer’s EMA weights (the exponential moving average of the past model weights values, implementing “Polyak averaging”) before model evaluation, and restores the previous weights after evaluation. The SwapEMAWeights callback is to be used in conjunction…

  • ProgbarLogger

    Callback that prints metrics to stdout. Arguments Raises

  • CSVLogger

    Callback that streams epoch results to a CSV file. Supports all values that can be represented as a string, including 1D iterables such as np.ndarray. Arguments Example

  • TerminateOnNaN

    Callback that terminates training when a NaN loss is encountered.

  • LambdaCallback

    Callback for creating simple, custom callbacks on-the-fly. ‘), on_train_end=lambda logs: json_log.close() )

  • RemoteMonitor

    Callback used to stream events to a server. Requires the requests library. Events are sent to root + ‘/publish/epoch/end/’ by default. Calls are HTTP POST, with a data argument which is a JSON-encoded dictionary of event data. If send_as_json=True, the content type of the request will be “application/json”. Otherwise the serialized JSON will be sent within a form. Arguments

  • ReduceLROnPlateau

    Reduce learning rate when a metric has stopped improving. Models often benefit from reducing the learning rate by a factor of 2-10 once learning stagnates. This callback monitors a quantity and if no improvement is seen for a ‘patience’ number of epochs, the learning rate is reduced. Example Arguments