當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。