(fun)
return args_wrapper
Decorator for calling an objective function which has each feature as separate input parameter.
    
    The data matrix is split column wise and passed as arguments. Can be combined with batch apply.
    
    :param fun: function accepting D N*-dimensional vectors (each representing a feature and returns a a matrix of
        size N* x R and optionally a gradient of size N x D x R (or size N x D if R == 1)
    :return: a function wrapper which splits a given data matrix into its columns to call fun.
Decorator for calling an objective function which has each feature as separate input parameter.
    
    The data matrix is split column wise and passed as arguments. Can be combined with batch apply.
    
    :param fun: function accepting D N*-dimensional vectors (each representing a feature and returns a a matrix of
        size N* x R and optionally a gradient of size N x D x R (or size N x D if R == 1)
    :return: a function wrapper which splits a given data matrix into its columns to call fun.
Decorator for calling an objective function which has each feature as separate input parameter . The data matrix is split column wise and passed as arguments . Can be combined with batch apply . : param fun : function accepting D N * - dimensional vectors ( each representing a feature and returns a a matrix of size N * x R and optionally a gradient of size N x D x R ( or size N x D if R == 1 ) : return : a function wrapper which splits a given data matrix into its columns to call fun .
def to_args(fun):
    """
    Decorator for calling an objective function which has each feature as separate input parameter.
    
    The data matrix is split column wise and passed as arguments. Can be combined with batch apply.
    
    :param fun: function accepting D N*-dimensional vectors (each representing a feature and returns a a matrix of
        size N* x R and optionally a gradient of size N x D x R (or size N x D if R == 1)
    :return: a function wrapper which splits a given data matrix into its columns to call fun.
    """
    @wraps(fun)
    def args_wrapper(X):
        X = np.atleast_2d(X)
        return fun(*X.T)

    return args_wrapper
def to_args ( fun ) : @ wraps ( fun ) def args_wrapper ( X ) : X = np . atleast_2d ( X ) return fun ( * X . T ) return args_wrapper