本文整理汇总了Python中Preprocess.mean_zero_unit_variance方法的典型用法代码示例。如果您正苦于以下问题:Python Preprocess.mean_zero_unit_variance方法的具体用法?Python Preprocess.mean_zero_unit_variance怎么用?Python Preprocess.mean_zero_unit_variance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preprocess
的用法示例。
在下文中一共展示了Preprocess.mean_zero_unit_variance方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1:
# 需要导入模块: import Preprocess [as 别名]
# 或者: from Preprocess import mean_zero_unit_variance [as 别名]
sys.path.append('..')
import numpy as np
import rbm_rm
import rbm_cm
import matplotlib.pyplot as plt
import utils
import Preprocess
mnist_dir = os.path.join(os.environ['DATA_HOME'], 'mnist')
mnist_train_path = os.path.join(mnist_dir, 'MNISTTrainData.npy')
data_rm = np.load(mnist_train_path)
[normed, meanv, stdv] = Preprocess.mean_zero_unit_variance(data_rm)
#Look, I didn't actually use the normalized data because it broke everything
train_rm = data_rm[30000:, :]
valid_rm = data_rm[:30000, :]
data_cm = data_rm.transpose()
train_cm = data_cm[:,30000:]
valid_cm = data_cm[:,:30000]
nHidden = 100
ViewDimensions = (10, 10) # Should multiply to nHidden
TP = rbm_rm.RBMTrainParams()
TP.maxepoch = 15
rm_learner = rbm_rm.GV_RBM(nHidden, train_rm.shape[1])