本文整理汇总了Python中Network.network方法的典型用法代码示例。如果您正苦于以下问题:Python Network.network方法的具体用法?Python Network.network怎么用?Python Network.network使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Network
的用法示例。
在下文中一共展示了Network.network方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: import Network [as 别名]
# 或者: from Network import network [as 别名]
def __init__(self,speed=None,health=None,max_health=None,dmg=None,armor=None,size=None,brain=None,name="Yuval",location=None,turns=0):
if speed == None:
speed = attribute()
if health == None:
health = attribute()
if max_health == None:
max_health = attribute()
if dmg == None:
dmg = attribute()
if armor == None:
armor = attribute()
if size == None:
size = attribute()
if location == None:
location = [400,400]
self.location = location
if brain == None:
brain = [3,2,3]
brain1 = Network.network(brain)
self.brain = brain1
self.speed = speed
self.health = health
self.max_health = max_health
self.dmg = dmg
self.armor = armor
self.size = size
self.name = name
self.speed.value = 20
self.turns = turns
示例2: ConvexOptimization
# 需要导入模块: import Network [as 别名]
# 或者: from Network import network [as 别名]
cojob = ConvexOptimization()
cojob.setup(knockout_storage, settings, "MCZ-DFG_Test_Top_{0}_Edges".format(i), job.alg.network)
jobman.queueJob(cojob)
jobman.runQueue()
jobman.waitToClear()
rocs = []
accs.append("Convex Opt + MCZ prior:")
for job in jobman.finished:
jobnet = job.alg.network
print "PREDICTED NETWORK:"
print jobnet.network
print "GOLDEN NETWORK:"
print goldnet.network
job.alg.save()
rocs.append(GenerateROC(jobnet, goldnet))
threshnet = Network(jobnet)
threshnet.network = threshnet.apply_threshold(0)
accs.append(threshnet.calculateAccuracy(goldnet))
#print jobnet.analyzeMotifs(goldnet).ToString()
PlotMultipleROC(rocs, 'ConvexOpt + MCZ')
for row in accs:
print row
print "AOCS"
for r in rocs:
print r.auc()
示例3: draw_statistics
# 需要导入模块: import Network [as 别名]
# 或者: from Network import network [as 别名]
def draw_statistics(screen,arr_values):
if len(arr_values) > 2 and len(arr_values)%2 == 0 :
screen.fill((255,255,255))
pygame.draw.lines(screen,(0,0,255),False,arr_values,1)
pygame.display.update()
return True
return False
if testing == "Network":
topology = [2,1]
input_values1 = [0.25,1]#[1,0.8,0.6,0.4,0.2,0.0]
input_values2 = [1,0.5]
target_values1 = [1]
target_values2 = [0]
a = Network.network(topology)
a.to_string()
b = Network.network(topology)
if a.identical(b):
print "WOW"
for rep in range(100):
if random.random() >= 0.5:
input_values = input_values1
else :
input_values = input_values2
a.feed_forward(input_values)
if input_values == [0.25,1]:
a.backProp(target_values1)
else:
a.backProp(target_values2)
print rep