コード例 #1
0
def ImgToConv(X):
    """
    DOCSTRING
    """
    if not utils.numpy_array(X):
        X = numpy.asarray(X)
    return X.transpose(0, 3, 1, 2)
コード例 #2
0
def ZeroOneScale(X):
    """
    DOCSTRING
    """
    if not utils.numpy_array(X):
        X = numpy.asarray(X)
    return X / 255.0
コード例 #3
0
def FlatToImg(X, w, h, c):
    """
    DOCSTRING
    """
    if not utils.numpy_array(X):
        X = numpy.asarray(X)
    return X.reshape(-1, w, h, c)
コード例 #4
0
def Standardize(X):
    """
    DOCSTRING
    """
    if not utils.numpy_array(X):
        X = numpy.asarray(X)
    return X / 127.5 - 1.0
コード例 #5
0
ファイル: preprocessing.py プロジェクト: drmingle/Foxhound
def standardize_X(shape, X):
	if not numpy_array(X):
		X = np.asarray(X)

	if len(shape) == 4 and len(X.shape) == 2:
		return X.reshape(-1, shape[2], shape[3], shape[1]).transpose(0, 3, 1, 2)
	else:
		return X
コード例 #6
0
def standardize_X(shape, X):
	if not numpy_array(X):
		X = np.asarray(X)

	if len(shape) == 4 and len(X.shape) == 2:
		return X.reshape(-1, shape[2], shape[3], shape[1]).transpose(0, 3, 1, 2)
	else:
		return X
コード例 #7
0
ファイル: preprocessing.py プロジェクト: bbueno5000/gan_demo
def standardize_X(shape, X):
    """
    DOCSTRING
    """
    if not utils.numpy_array(X):
        X = numpy.asarray(X)
    if len(shape) == 4 and len(X.shape) == 2:
        return X.reshape(-1, shape[2], shape[3], shape[1]).transpose(0, 3, 1, 2)
    else:
        return X
コード例 #8
0
ファイル: preprocessing.py プロジェクト: drmingle/Foxhound
def standardize_Y(shape, Y):
	if not numpy_array(Y):
		Y = np.asarray(Y)
	if len(Y.shape) == 1:
		Y = Y.reshape(-1, 1)
	if len(Y.shape) == 2 and len(shape) == 2:
		if shape[-1] != Y.shape[-1]:
			return one_hot(Y, n=shape[-1])
		else:
			return Y
	else:
		return Y
コード例 #9
0
def standardize_Y(shape, Y):
	if not numpy_array(Y):
		Y = np.asarray(Y)
	if len(Y.shape) == 1:
		Y = Y.reshape(-1, 1)
	if len(Y.shape) == 2 and len(shape) == 2:
		if shape[-1] != Y.shape[-1]:
			return one_hot(Y, n=shape[-1])
		else:
			return Y
	else:
		return Y
コード例 #10
0
ファイル: preprocessing.py プロジェクト: bbueno5000/gan_demo
def standardize_Y(shape, Y):
    """
    DOCSTRING
    """
    if not utils.numpy_array(Y):
        Y = numpy.asarray(Y)
    if len(Y.shape) == 1:
        Y = Y.reshape(-1, 1)
    if len(Y.shape) == 2 and len(shape) == 2:
        if shape[-1] != Y.shape[-1]:
            return one_hot(Y, n=shape[-1])
        else:
            return Y
    else:
        return Y
コード例 #11
0
ファイル: transforms.py プロジェクト: jamesoneill12/Foxhound
def ZeroOneScale(X):
    if not numpy_array(X):
        X = np.asarray(X)
    return X / 255.
コード例 #12
0
ファイル: transforms.py プロジェクト: jamesoneill12/Foxhound
def Standardize(X):
    if not numpy_array(X):
        X = np.asarray(X)
    return X / 127.5 - 1.
コード例 #13
0
ファイル: transforms.py プロジェクト: jamesoneill12/Foxhound
def ImgToConv(X):
    if not numpy_array(X):
        X = np.asarray(X)
    return X.transpose(0, 3, 1, 2)
コード例 #14
0
ファイル: transforms.py プロジェクト: jamesoneill12/Foxhound
def FlatToImg(X, w, h, c):
	if not numpy_array(X):
		X = np.asarray(X)	
	return X.reshape(-1, w, h, c)