Esempio n. 1
0
def testOracle(dim=3):
    f = FunctionWrapper(dim, StochQuad(noiseLevel=0.2))
    x0 = ones(dim)
    algo = OracleSGD(f, x0, callback=printy, loss_target=0.01)
    algo.run(100)
    print
Esempio n. 2
0
def testOracle(dim=3):
    f = FunctionWrapper(dim, StochQuad(noiseLevel=0.1))
    x0 = ones(dim)
    algo = OracleSGD(f, x0, callback=printy, loss_target=1e-5)
    algo.run(100)
    print mean(algo.parameters **2)