示例#1
0
    return avgind

import sys

#import optparse
# p = optparse.OptionParser()
# p.add_option('--foo', '-f', default="yadda")
# p.add_option('--bar', '-b')
# options, arguments = p.parse_args()


if __name__ == "__main__":
    
    if len(sys.argv) > 1:
        
        algo = Algo()
        while True:
        
            #need to set Beta[accel] to 1
            #algo.updateBeta([0,1,0,0])
            #algo.updateBetaFinal([0,1,0,0])
            var = [2]  
            
            algo.reset_ygradient()
            for point in algo.build_gradient(vars = var):
                
                algo.updateBeta(point)
                
                perf = gameStrat(strat = 6, totalgames=3,Algo=algo, \
                                renderme = False)
                
示例#2
0
            ind = 0

    return 0


#import optparse
# p = optparse.OptionParser()
# p.add_option('--foo', '-f', default="yadda")
# p.add_option('--bar', '-b')
# options, arguments = p.parse_args()

if __name__ == "__main__":

    if len(sys.argv) > 1:

        algo = Algo()
        #cheats, init-Betas
        algo.updateBetaFinal([0, 0, 0, .1])

        env = createEnvNoisy()
        ind = 0

        while True:

            var = [0, 1, 2, 3]
            ep = [0.2, 0.1, .005, 0.01]

            algo.reset_ygradient()
            algo.reset_ymisc()
            for point in algo.build_gradient(vars=var, eps=ep):
示例#3
0
    return 0

    

#import optparse
# p = optparse.OptionParser()
# p.add_option('--foo', '-f', default="yadda")
# p.add_option('--bar', '-b')
# options, arguments = p.parse_args()


if __name__ == "__main__":
    
    if len(sys.argv) > 1:
        
        algo = Algo()
        #cheats, init-Betas
        algo.updateBetaFinal([0,0,0,.1])
        
        env = createEnvNoisy()
        ind = 0
        
        while True:
        
            
            var = [0,1,2,3]  
            ep = [0.2,0.1,.005,0.01]
            
            algo.reset_ygradient()
            algo.reset_ymisc()
            for point in algo.build_gradient(vars = var, eps = ep):
示例#4
0
from learning import Algo

a = Algo()

ret = a.permute_variables( [[0,0,0,0]], [ (1,(-.1,.1)), (2,(-2,1)) ] )

print 'test: ', str(ret)
print 'testlen: ',  str(len(ret))

ret = a.build_gradient(vars = [1,2])

print 'testlen: ',  str(len(ret))

ret = a.build_gradient(vars = [1,2], no_origin = True)

print 'test: ', str(ret)
print 'testlen: ',  str(len(ret))

ret = a.build_gradient(vars = [1,2,3,4], no_origin = True)

print 'testlen: ',  str(len(ret))

示例#5
0
    return avgind


import sys

#import optparse
# p = optparse.OptionParser()
# p.add_option('--foo', '-f', default="yadda")
# p.add_option('--bar', '-b')
# options, arguments = p.parse_args()

if __name__ == "__main__":

    if len(sys.argv) > 1:

        algo = Algo()
        while True:

            #need to set Beta[accel] to 1
            #algo.updateBeta([0,1,0,0])
            #algo.updateBetaFinal([0,1,0,0])
            var = [2]

            algo.reset_ygradient()
            for point in algo.build_gradient(vars=var):

                algo.updateBeta(point)

                perf = gameStrat(strat = 6, totalgames=3,Algo=algo, \
                                renderme = False)
示例#6
0
from learning import Algo

a = Algo()

ret = a.permute_variables([[0, 0, 0, 0]], [(1, (-.1, .1)), (2, (-2, 1))])

print 'test: ', str(ret)
print 'testlen: ', str(len(ret))

ret = a.build_gradient(vars=[1, 2])

print 'testlen: ', str(len(ret))

ret = a.build_gradient(vars=[1, 2], no_origin=True)

print 'test: ', str(ret)
print 'testlen: ', str(len(ret))

ret = a.build_gradient(vars=[1, 2, 3, 4], no_origin=True)

print 'testlen: ', str(len(ret))