當前位置: 首頁>>代碼示例>>Python>>正文


Python DataProvider.get_by_name方法代碼示例

本文整理匯總了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)
開發者ID:iskandr,項目名稱:striate,代碼行數:13,代碼來源:trainer.py

示例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)
開發者ID:wqren,項目名稱:striate,代碼行數:6,代碼來源:trainer.py

示例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))
開發者ID:wqren,項目名稱:striate,代碼行數:6,代碼來源:trainer.py

示例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')
開發者ID:wqren,項目名稱:striate,代碼行數:8,代碼來源:trainer.py

示例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)
開發者ID:wqren,項目名稱:striate,代碼行數:32,代碼來源:trainer.py

示例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)
開發者ID:phecy,項目名稱:striate,代碼行數:6,代碼來源:trainer.py


注:本文中的data.DataProvider.get_by_name方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。