StochasticNumerics / mimclib

A software library for UQ methods
GNU General Public License v2.0
6 stars 8 forks source link

TOL loop doesnt work #68

Closed litvinen closed 8 years ago

litvinen commented 8 years ago

I always get computations for the same TOL. In the example below only for TOL=0.2. Can you please check syntax

!/usr/bin/python

import numpy as np import argparse

if name == "main": parser = argparse.ArgumentParser(add_help=True) parser.register('type', 'bool', lambda v: v.lower() in ("yes", "true", "t", "1")) parser.add_argument("-tries", type=int, action="store", default=0, help="Number of realizations") parser.add_argument("-mimc_min_dim", type=int, action="store", default=1, help="MIMC dim")

args, unknowns = parser.parse_known_args()

dim = args.mimc_min_dim
base = "run.py -mimc_TOL {TOL} -mimc_max_TOL 2  -mimc_min_dim 1 -qoi_seed {seed} \
-mimc_theta 0.5 -mimc_M0 5 -mimc_h0inv 3 \
-mimc_w 2 -mimc_s 3 -mimc_gamma 1.3 -mimc_beta 2 \
-mimc_bayes_fit_lvls 3 -mimc_moments 4 \
-mimc_bayesian {bayesian} ".format(bayesian="{bayesian}", TOL="{TOL}", seed="{seed}")
base += " ".join(unknowns)

if args.tries == 0:
    cmd_single = "python " + base + " -mimc_verbose 10 -db False "
    print(cmd_single.format(seed=0, bayesian=False, TOL=0.001))
else:
    cmd_multi = "python " + base + " -mimc_verbose 0 -db True -db_tag {tag} "
    TOL = 0.2
    for i in range(0, args.tries):
            print cmd_multi.format(bayesian=False,
                               tag="Oct11_cmlmc_small{}".format(dim), TOL=TOL,
                               seed=np.random.randint(2**32-1))
litvinen commented 8 years ago

Particularly, Do I need "fnInit=alex_init," ? in mimclib.test.RunStandardTest(fnInit=alex_init, fnSampleLvl=mySampleLvl, fnAddExtraArgs=None, fnSeed=seedRandomGen)

If yes , what is the syntax to fix this error TypeError: alex_init() takes exactly 2 arguments (1 given)

litvinen commented 8 years ago

Ok, I understand. In the current version only the smallest TOL is printed into vw_runs table. All other are computed, but are recorded in other tables. Type mysql> select * from vw_iters ; and you will see all other TOLs