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


Python DataProvider.get_instance方法代码示例

本文整理汇总了Python中data.DataProvider.get_instance方法的典型用法代码示例。如果您正苦于以下问题:Python DataProvider.get_instance方法的具体用法?Python DataProvider.get_instance怎么用?Python DataProvider.get_instance使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在data.DataProvider的用法示例。


在下文中一共展示了DataProvider.get_instance方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: init_data_providers

# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_instance [as 别名]
 def init_data_providers(self):
     self.dp_params['convnet'] = self # dp aka dataprovider
     try:
         self.test_data_provider = DataProvider.get_instance(self.data_path, self.test_batch_range,
                                                             type=self.dp_type, dp_params=self.dp_params, test=True)
         self.train_data_provider = DataProvider.get_instance(self.data_path, self.train_batch_range,
                                                                  self.model_state["epoch"], self.model_state["batchnum"],
                                                                  type=self.dp_type, dp_params=self.dp_params, test=False)
     except DataProviderException, e:
         print "Unable to create data provider: %s" % e
         self.print_data_providers()
         sys.exit()
开发者ID:HoldenCaulfieldRye,项目名称:pipe-classification,代码行数:14,代码来源:gpumodel.py

示例2: init_data_providers

# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_instance [as 别名]
 def init_data_providers(self):
     self.dp_params['convnet'] = self
     self.dp_params['PCA_pixel_alter'] = self.PCA_pixel_alter        
     self.dp_params['regress_L_channel_only'] = self.regress_L_channel_only
     self.dp_params['use_local_context_ftr'] = self.use_local_context_ftr
     self.dp_params['use_local_context_color_ftr'] = self.use_local_context_color_ftr
     if hasattr(self,'use_position_ftr'):
         self.dp_params['use_position_ftr'] = self.use_position_ftr
     try:
         self.test_data_provider = DataProvider.get_instance(self.libmodel, self.data_path, self.test_batch_range,
                                                             type=self.dp_type, dp_params=self.dp_params, test=DataProvider.DP_TEST)
         self.train_data_provider = DataProvider.get_instance(self.libmodel, self.data_path, self.train_batch_range,
                                                                  self.model_state["epoch"], self.model_state["batch_idx"],
                                                                  self.model_state["epochBatchPerm"],
                                                                  type=self.dp_type, dp_params=self.dp_params, test=DataProvider.DP_TRAIN)
     except DataProviderException, e:
         print "Unable to create data provider: %s" % e
         self.print_data_providers()
         sys.exit()
开发者ID:mukhalad,项目名称:cuda_convnet_plus,代码行数:21,代码来源:gpumodel.py

示例3: init_data_providers

# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_instance [as 别名]
    def init_data_providers(self):
        self.dp_params['convnet'] = self
        self.dp_params['imgprovider'] = self.img_provider_file
        try:
            self.test_data_provider = DataProvider.get_instance(self.data_path_test, self.test_batch_range,
                                                                type=self.dp_type_test, dp_params=self.dp_params, test=True)
            if not self.test_only:
                self.train_data_provider = DataProvider.get_instance(self.data_path_train, self.train_batch_range,
                                                                     self.model_state["epoch"], self.model_state["batchnum"],
                                                                     type=self.dp_type_train, dp_params=self.dp_params, test=False)

            self.test_batch_range = self.test_data_provider.batch_range
            print "Test data provider: ", len(self.test_batch_range), " batches "
            if not self.test_only:
                self.train_batch_range = self.train_data_provider.batch_range
                print "Training data provider: ", len(self.train_batch_range), " batches "

        except DataProviderException, e:
            print "Unable to create data provider: %s" % e
            self.print_data_providers()
            sys.exit()
开发者ID:lelegan,项目名称:DLSR,代码行数:23,代码来源:gpumodel.py

示例4: init_data_providers

# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_instance [as 别名]
 def init_data_providers(self):
     class Dummy:
         def advance_batch(self):
             pass
     if self.need_gpu:
         ConvNet.init_data_providers(self)
         if self.op.get_value("write_features_pred") or self.op.get_value("show_preds") == 2:
             self.pred_data_provider = DataProvider.get_instance(self.libmodel, self.data_path, self.pred_batch_range,
                                                                 type=self.dp_type, dp_params=self.dp_params, test=DataProvider.DP_PREDICT)
         
     else:
         self.train_data_provider = self.test_data_provider = Dummy()
开发者ID:mukhalad,项目名称:cuda_convnet_plus,代码行数:14,代码来源:shownet.py

示例5: init_data_providers

# 需要导入模块: from data import DataProvider [as 别名]
# 或者: from data.DataProvider import get_instance [as 别名]
 def init_data_providers(self):
     self.dp_params['convnet'] = self
     self.dp_params['imgprovider'] = self.img_provider_file
     try:
         if self.need_gpu:
             self.test_data_provider = DataProvider.get_instance(self.data_path_test, self.test_batch_range,
                                                                 type=self.dp_type_test, dp_params=self.dp_params, test=True)
             
             self.test_batch_range = self.test_data_provider.batch_range
     except Exception, e:
         print "Unable to create data provider: %s" % e
         self.print_data_providers()
         sys.exit()
开发者ID:lelegan,项目名称:DLSR,代码行数:15,代码来源:shownet_demo.py


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