本文整理匯總了Python中fuel.datasets.H5PYDataset方法的典型用法代碼示例。如果您正苦於以下問題:Python datasets.H5PYDataset方法的具體用法?Python datasets.H5PYDataset怎麽用?Python datasets.H5PYDataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類fuel.datasets
的用法示例。
在下文中一共展示了datasets.H5PYDataset方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: get_stream
# 需要導入模塊: from fuel import datasets [as 別名]
# 或者: from fuel.datasets import H5PYDataset [as 別名]
def get_stream(hdf5_file, which_set, batch_size=None):
dataset = H5PYDataset(
hdf5_file, which_sets=(which_set,), load_in_memory=True)
if batch_size == None:
batch_size = dataset.num_examples
stream = DataStream(dataset=dataset, iteration_scheme=ShuffledScheme(
examples=dataset.num_examples, batch_size=batch_size))
# Required because Recurrent bricks receive as input [sequence, batch,
# features]
return Mapping(stream, transpose_stream)