本文整理汇总了Python中data.DataProvider.get_by_name方法的典型用法代码示例。如果您正苦于以下问题:Python DataProvider.get_by_name方法的具体用法?Python DataProvider.get_by_name怎么用?Python DataProvider.get_by_name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类data.DataProvider
的用法示例。
在下文中一共展示了DataProvider.get_by_name方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: init_subnet_data_provider
# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_by_name [as 别名]
def init_subnet_data_provider(self):
if self.output_method == 'disk':
dp = DataProvider.get_by_name('intermediate')
count = self.train_dumper.get_count()
self.train_dp = dp(self.train_output_filename, range(0, count), 'fc')
count = self.test_dumper.get_count()
self.test_dp = dp(self.test_output_filename, range(0, count), 'fc')
elif self.output_method == 'memory':
dp = DataProvider.get_by_name('memory')
self.train_dp = dp(self.train_dumper)
self.test_dp = dp(self.test_dumper)
示例2: set_num_group
# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_by_name [as 别名]
def set_num_group(self, n):
dp = DataProvider.get_by_name(self.data_provider)
self.train_dp = dp(self.data_dir, self.train_range, n)
self.test_dp = dp(self.data_dir, self.test_range, n)
示例3: set_category_range
# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_by_name [as 别名]
def set_category_range(self, r):
dp = DataProvider.get_by_name(self.data_provider)
self.train_dp = dp(self.data_dir, self.train_range, category_range = range(r))
self.test_dp = dp(self.data_dir, self.test_range, category_range = range(r))
示例4: init_subnet_data_provider
# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_by_name [as 别名]
def init_subnet_data_provider(self):
dp = DataProvider.get_by_name('intermediate')
count = self.train_dumper.get_count()
self.train_dp = dp(self.train_output_filename, range(0, count), 'fc')
count = self.test_dumper.get_count()
self.test_dp = dp(self.test_output_filename, range(0, count), 'fc')
示例5: CheckpointDumper
# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_by_name [as 别名]
#create a checkpoint dumper
image_shape = (param_dict['image_color'], param_dict['image_size'], param_dict['image_size'], param_dict['batch_size'])
param_dict['image_shape'] = image_shape
cp_dumper = CheckpointDumper(param_dict['checkpoint_dir'], param_dict['test_id'])
param_dict['checkpoint_dumper'] = cp_dumper
#create the init_model
init_model = cp_dumper.get_checkpoint()
if init_model is None:
init_model = parse_config_file(args.param_file)
param_dict['init_model'] = init_model
#create train dataprovider and test dataprovider
dp_class = DataProvider.get_by_name(param_dict['data_provider'])
train_dp = dp_class(param_dict['data_dir'], param_dict['train_range'])
test_dp = dp_class(param_dict['data_dir'], param_dict['test_range'])
param_dict['train_dp'] = train_dp
param_dict['test_dp'] = test_dp
#get all extra information
param_dict['num_epoch'] = args.num_epoch
num_batch = util.string_to_int_list(args.num_batch)
if len(num_batch) == 1:
param_dict['num_batch'] = num_batch[0]
else:
param_dict['num_batch'] = num_batch
param_dict['num_group_list'] = util.string_to_int_list(args.num_group_list)
示例6: init_data_provider
# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_by_name [as 别名]
def init_data_provider(self):
dp = DataProvider.get_by_name(self.data_provider)
self.train_dp = dp(self.data_dir, self.train_range)
self.test_dp = dp(self.data_dir, self.test_range)