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


Python AttributeDict.dataset方法代碼示例

本文整理匯總了Python中utils.AttributeDict.dataset方法的典型用法代碼示例。如果您正苦於以下問題:Python AttributeDict.dataset方法的具體用法?Python AttributeDict.dataset怎麽用?Python AttributeDict.dataset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在utils.AttributeDict的用法示例。


在下文中一共展示了AttributeDict.dataset方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: doPreprocessing

# 需要導入模塊: from utils import AttributeDict [as 別名]
# 或者: from utils.AttributeDict import dataset [as 別名]
    def doPreprocessing(self):
        results = AttributeDict()
        results.dataset = []
        for i in range(len(self.params.dataset)):
            # shall we just load it?
            filename = '%s/preprocessing-%s%s.mat' % (self.params.dataset[i].savePath, self.params.dataset[i].saveFile, self.params.saveSuffix)
            if self.params.dataset[i].preprocessing.load and os.path.isfile(filename):         
                r = loadmat(filename)
                print('Loading file %s ...' % filename)
                results.dataset[i].preprocessing = r.results_preprocessing
            else:
                # or shall we actually calculate it?
                p = deepcopy(self.params)    
                p.dataset = self.params.dataset[i]
                d = AttributeDict()
                d.preprocessing = np.copy(SeqSLAM.preprocessing(p))
                results.dataset.append(d)
    
                if self.params.dataset[i].preprocessing.save:
                    results_preprocessing = results.dataset[i].preprocessing
                    savemat(filename, {'results_preprocessing': results_preprocessing})

        return results
開發者ID:breezeflutter,項目名稱:pySeqSLAM,代碼行數:25,代碼來源:seqslam.py

示例2: AttributeDict

# 需要導入模塊: from utils import AttributeDict [as 別名]
# 或者: from utils.AttributeDict import dataset [as 別名]
from utils import AttributeDict
from tagger_exp import TaggerExperiment

p = AttributeDict()

p.encoder_proj = (2000, 1000, 500)
p.input_noise = 0.2
p.class_cost_x = 0
p.zhat_init_value = 0.26  # mean of the input data.

p.n_iterations = 3
p.n_groups = 4
p.lr = 0.0004
p.seed = 10
p.num_epochs = 100
p.batch_size = 100
p.valid_batch_size = 100

p.dataset = 'shapes50k20x20'
p.input_type = 'binary'

p.save_to = 'shapes50k20x20'

if __name__ == '__main__':
    experiment = TaggerExperiment(p)
    experiment.train()
開發者ID:CuriousAI,項目名稱:tagger,代碼行數:28,代碼來源:runner-shapes50k20x20.py

示例3: len

# 需要導入模塊: from utils import AttributeDict [as 別名]
# 或者: from utils.AttributeDict import dataset [as 別名]
p.input_noise = 0.2
p.class_cost_x = 0.
p.zhat_init_value = 0.5

p.n_iterations = 3
p.n_groups = 4
p.lr = 0.001
p.labeled_samples = 1000
p.save_freq = 50
p.seed = 1
p.num_epochs = 150
p.batch_size = 100
p.valid_batch_size = 100
p.objects_per_sample = 2

p.dataset = 'freq20-2mnist'
p.input_type = 'continuous'

if __name__ == '__main__':
    if len(sys.argv) == 2 and sys.argv[1] == '--pretrain':
        p.save_to = 'freq20-2mnist-pretraining'
        experiment = TaggerExperiment(p)
        experiment.train()
    elif len(sys.argv) == 3 and sys.argv[1] == '--continue':
        p.load_from = sys.argv[2]
        p.save_to = 'freq20-2mnist-supervision'
        p.num_epochs = 50
        p.n_iterations = 4
        p.encoder_proj = (3000, 2000, 1000, 500, 250, 11)
        p.lr = 0.0002
        p.input_noise = 0.18
開發者ID:CuriousAI,項目名稱:tagger,代碼行數:33,代碼來源:runner-freq20-2mnist.py


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