@staticmethod
def _shrinkage_threshold(z, x, beta):
    '\n        Implement the element-wise projected shrinkage-threshold function.\n\n        :param z: a batch of examples.\n        :type z: `np.ndarray`\n        :param x: a batch of original examples.\n        :type x: `np.ndarray`\n        :param beta: the shrink parameter.\n        :type beta: `float`\n        :return: a shrinked version of z.\n        :rtype: `np.ndarray`\n        '
    cond1 = ((z - x) > beta)
    cond2 = (np.abs((z - x)) <= beta)
    cond3 = ((z - x) < (- beta))
    upper = np.minimum((z - beta), 1.0)
    lower = np.maximum((z + beta), 0.0)
    result = (((cond1 * upper) + (cond2 * x)) + (cond3 * lower))
    return result
Implement the element-wise projected shrinkage-threshold function.

:param z: a batch of examples.
:type z: `np.ndarray`
:param x: a batch of original examples.
:type x: `np.ndarray`
:param beta: the shrink parameter.
:type beta: `float`
:return: a shrinked version of z.
:rtype: `np.ndarray`
@staticmethod
def _shrinkage_threshold(z, x, beta):
    '\n        Implement the element-wise projected shrinkage-threshold function.\n\n        :param z: a batch of examples.\n        :type z: `np.ndarray`\n        :param x: a batch of original examples.\n        :type x: `np.ndarray`\n        :param beta: the shrink parameter.\n        :type beta: `float`\n        :return: a shrinked version of z.\n        :rtype: `np.ndarray`\n        '
    cond1 = ((z - x) > beta)
    cond2 = (np.abs((z - x)) <= beta)
    cond3 = ((z - x) < (- beta))
    upper = np.minimum((z - beta), 1.0)
    lower = np.maximum((z + beta), 0.0)
    result = (((cond1 * upper) + (cond2 * x)) + (cond3 * lower))
    return result