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


Python Analyzer.train方法代码示例

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


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

示例1: calculate_cost_using_analyzer

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import train [as 别名]
 def calculate_cost_using_analyzer(self, parameters):
     config = {}
     for i in range(self.parameters_count):
         config[self.parameters_descriptors[i].name] = parameters[i]
     config['analyse.ica.num'] = config['analyse.sfa.num'] 
     print "calculating cost for: ", config
     analyzer = Analyzer(config, self.input_dimensions)
     analyzer.train(self.training_data)
     #training_features = analyzer.execute(self.training_data)
     test_features = analyzer.execute(self.test_data)
     activation_locations = get_activation_mean_locations(self.coordinate_matrix, test_features)
     cost = average_cost(self.coordinate_matrix, test_features, activation_locations)
     return cost
开发者ID:de-git,项目名称:ml,代码行数:15,代码来源:parameters_evolver.py

示例2: calculate_cost_using_analyzer

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import train [as 别名]
 def calculate_cost_using_analyzer(self, parameters, parameters_descriptors):
     config = {}
     id = random.randint(0,100000)
     print "trial id:",id
     for i in range(len(parameters)):
         config[parameters_descriptors[i].name] = parameters[i]
     config['analyse.ica.num'] = config['analyse.sfa.num'] 
     print "[{0}] calculating cost for: {1}".format(id,config)
     start = time.time()
     print "[{0}] creating analyser".format(id)
     analyzer = Analyzer(config, self.input_dimensions)
     print "[{0}] training analyser".format(id)
     analyzer.train(self.training_data)
     #training_features = analyzer.execute(self.training_data)
     print "[{0}] testing features".format(id)
     test_features = analyzer.execute(self.test_data)
     print "[{0}] activating locations".format(id)
     activation_locations = get_activation_mean_locations(self.coordinate_matrix, test_features)
     print "[{0}] getting average_cost".format(id)
     cost = average_cost(self.coordinate_matrix, test_features, activation_locations)
     end = time.time()
     print "calculating cost done, took ", (end - start), ", config: ", config
     return cost
开发者ID:de-git,项目名称:ml,代码行数:25,代码来源:deap_test.py

示例3: len

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import train [as 别名]
        if (splitData):
            trainingSize = len(sm) / 2
            testSize = len(sm) - trainingSize
            testDataOffset = trainingSize
            trainingData = sm[0:trainingSize]
            testData = sm[testDataOffset:(testSize + trainingSize)]
        else:
            testDataOffset = 0
            trainingData = sm
            testData = sm
    else:
        testDataOffset = 0
        trainingData = sm
        testData = sm

    analyzer.train(trainingData)
     
    trainingFeatures = analyzer.execute(trainingData)
    testFeatures = analyzer.execute(testData)
    #testFeatures = trainingFeatures
    analyzer.reset_states(True)
    testFeatures2 = []
    for timeIndex in range(0, len(testData), 1):
        testFeatures2.append(analyzer.execute([testData[timeIndex]])[0])
        analyzer.reset_states(False)
    #testFeatures2 = analyzer.execute(testData)
    testFeaturesCombined = np.append(testFeatures, testFeatures2, 1)
    print "testFeaturesCombined: " + str(len(testFeaturesCombined.T)) + " x " + str(len(testFeaturesCombined.T[0]))
    #plotter.plot_features_graphs("dummy", coordm, testFeaturesCombined, 8, sm, 0)
    
    title = analyzer.description + ", data: " + str(len(sm)) + ", source: " + sourceDescription
开发者ID:de-git,项目名称:ml,代码行数:33,代码来源:place_cells_sfa.py

示例4: analyze

# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import train [as 别名]
 def analyze(self):
     a = Analyzer(self.site, self.symsize, self.charset)
     a.prepare()
     a.train()
     self.quit()
开发者ID:polzuka,项目名称:inspirado,代码行数:7,代码来源:smswebmoney.py


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