本文整理汇总了Python中dataset.Dataset.setup_dataset方法的典型用法代码示例。如果您正苦于以下问题:Python Dataset.setup_dataset方法的具体用法?Python Dataset.setup_dataset怎么用?Python Dataset.setup_dataset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类dataset.Dataset
的用法示例。
在下文中一共展示了Dataset.setup_dataset方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import setup_dataset [as 别名]
def __init__(self, data_path=None):
self.data_path = data_path
ds = Dataset(is_binary=True)
ds.setup_dataset(data_path=self.data_path, train_split_scale=0.6)
self.X = ds.Xtrain
self.y = ds.Ytrain
self.y = np.cast['uint8'](list(self.y))
self.X = np.cast['float32'](list(self.X))
示例2: experiment
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import setup_dataset [as 别名]
def experiment(state, channel):
DS = Dataset(is_binary=True)
DS.setup_dataset(data_path=state.dataset)
kfoldCrossValidation = KfoldCrossvalidation(no_of_folds=state.no_of_folds)
cs_args = {
"train_args":{
"L1_reg": state.l1_reg,
"learning_rate": state.learning_rate,
"L2_reg": state.l2_reg,
"nepochs":state.n_epochs,
"cost_type": state.cost_type,
"save_exp_data": state.save_exp_data,
"batch_size": state.batch_size
},
"test_args":{
"save_exp_data": state.save_exp_data,
"batch_size": state.batch_size
}
}
x = T.matrix('x')
mlp = MultiMLP(x, n_in=state.n_in, n_hiddens=state.n_hiddens,
n_out=state.n_out, n_hidden_layers=state.n_hidden_layers,
is_binary=True, exp_id=state.exid)
valid_errs, test_errs = kfoldCrossValidation.crossvalidate(DS.Xtrain, \
DS.Ytrain, DS.Xtest, DS.Ytest, mlp, **cs_args)
errors = \
kfoldCrossValidation.get_best_valid_scores(valid_errs, test_errs)
state.best_valid_error = errors["valid_scores"]["error"]
state.best_test_error = errors["test_scores"]["error"]
return channel.COMPLETE
示例3: Dataset
# 需要导入模块: from dataset import Dataset [as 别名]
# 或者: from dataset.Dataset import setup_dataset [as 别名]
from da import DenoisingAutoencoder
from dataset import Dataset
import theano.tensor as T
import numpy
if __name__ == "__main__":
fname = "/data/lisa/data/mnist/mnist_all.pickle"
# fname = "/data/lisa/data/pentomino/"
ds = Dataset()
ds.setup_dataset(data_path=fname, train_split_scale=0.8)
x_data = ds.Xtrain
input = T.dmatrix("x_input")
weights_file = "../out/dae_mnist_weights.npy"
recons_file = "../out/dae_mnist_recons.npy"
rnd = numpy.random.RandomState(1231)
dae = DenoisingAutoencoder(input, nvis=28 * 28, nhid=600, rnd=rnd)
dae.fit(learning_rate=0.1, data=x_data, weights_file=weights_file, n_epochs=100, recons_img_file=recons_file)