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


Python Network.network方法代码示例

本文整理汇总了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
开发者ID:yuvalkk11e,项目名称:Deep-Wild,代码行数:31,代码来源:animal.py

示例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()
开发者ID:remtcs,项目名称:Network-Inference-Workspace,代码行数:32,代码来源:TestMCZ-CovOpt-Medium.py

示例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
开发者ID:yuvalkk11e,项目名称:Deep-Wild,代码行数:32,代码来源:main.py


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