本文整理汇总了Python中analyzer.Analyzer.execute方法的典型用法代码示例。如果您正苦于以下问题:Python Analyzer.execute方法的具体用法?Python Analyzer.execute怎么用?Python Analyzer.execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类analyzer.Analyzer
的用法示例。
在下文中一共展示了Analyzer.execute方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: calculate_cost_using_analyzer
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import execute [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
示例2: calculate_cost_using_analyzer
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import execute [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
示例3: len
# 需要导入模块: from analyzer import Analyzer [as 别名]
# 或者: from analyzer.Analyzer import execute [as 别名]
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
activation_locations = place_cell_reliability.get_activation_mean_locations(coordm, trainingFeatures)