'Apply sin derivative, where val is the activation of sin units.'

def apply_sin_deriv(self, val, target=None):

    if (not target):
        target = self
    if isinstance(val, CUDAMatrix):
        err_code = _cudamat.apply_sin_deriv(self.p_mat, val.p_mat, target.p_mat)
    else:
        raise ValueError, 'Value    must    be    of    type    CUDAMatrix.'
    if err_code:
        raise generate_exception(err_code)
    return target
