当前位置: 首页>>代码示例>>Python>>正文


Python Dataset.setup_dataset方法代码示例

本文整理汇总了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))
开发者ID:caglar,项目名称:experimentations,代码行数:13,代码来源:fit_sphere.py

示例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
开发者ID:caglar,项目名称:prmlp,代码行数:41,代码来源:jobman_experiment.py

示例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)
开发者ID:vinodrajendran001,项目名称:autoencoders,代码行数:20,代码来源:test_dae.py


注:本文中的dataset.Dataset.setup_dataset方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。