Commit 63ab17ee by Marius Isken

### nbootstrap to HighscoreSolver

parent 78ca5053
 ... @@ -187,7 +187,6 @@ def command_init(args): ... @@ -187,7 +187,6 @@ def command_init(args): problem_config = grond.CMTProblemConfig( problem_config = grond.CMTProblemConfig( name_template='cmt_%(event_name)s', name_template='cmt_%(event_name)s', distance_min=2.*km, distance_min=2.*km, nbootstrap=100, mt_type='deviatoric', mt_type='deviatoric', ranges=dict( ranges=dict( time=Range(0, 10.0, relative='add'), time=Range(0, 10.0, relative='add'), ... ...
 ... @@ -325,8 +325,6 @@ class BadProblem(GrondError): ... @@ -325,8 +325,6 @@ class BadProblem(GrondError): pass pass def solve(problem, def solve(problem, phases, phases, rundir=None, rundir=None, ... @@ -427,7 +425,6 @@ def solve(problem, ... @@ -427,7 +425,6 @@ def solve(problem, chains.insert(gbms, iiter) chains.insert(gbms, iiter) chains_m[0, nlinks] = gm chains_m[0, nlinks] = gm chains_m[1:, nlinks] = bms chains_m[1:, nlinks] = bms chains_i[:, nlinks] = iiter chains_i[:, nlinks] = iiter ... @@ -539,13 +536,11 @@ class HighScoreOptimizer(Optimizer): ... @@ -539,13 +536,11 @@ class HighScoreOptimizer(Optimizer): Optimizer.__init__(self) Optimizer.__init__(self) self._kwargs = kwargs self._kwargs = kwargs def solve( def solve( problem, problem, phases, phases, rundir=None, rundir=None, chain_length_factor= chain_length_factor=8.0, chain_length_factor=8.0, standard_deviation_estimator='median_density_single_chain', standard_deviation_estimator='median_density_single_chain', ... @@ -635,6 +630,7 @@ class StandardDeviationEstimatorChoice(StringChoice): ... @@ -635,6 +630,7 @@ class StandardDeviationEstimatorChoice(StringChoice): class HighScoreOptimizerConfig(OptimizerConfig): class HighScoreOptimizerConfig(OptimizerConfig): nbootstrap = Int.T(default=100) niter_uniform = Int.T(default=1000) niter_uniform = Int.T(default=1000) niter_transition = Int.T(default=0) niter_transition = Int.T(default=0) niter_explorative = Int.T(default=10000) niter_explorative = Int.T(default=10000) ... @@ -650,6 +646,7 @@ class HighScoreOptimizerConfig(OptimizerConfig): ... @@ -650,6 +646,7 @@ class HighScoreOptimizerConfig(OptimizerConfig): def get_optimizer_kwargs(self): def get_optimizer_kwargs(self): return dict( return dict( nbootstrap=self.nbootstrap, niter_uniform=self.niter_uniform, niter_uniform=self.niter_uniform, niter_transition=self.niter_transition, niter_transition=self.niter_transition, niter_explorative=self.niter_explorative, niter_explorative=self.niter_explorative, ... ...
 ... @@ -3,7 +3,7 @@ import math ... @@ -3,7 +3,7 @@ import math import logging import logging from pyrocko import gf, util, moment_tensor as mtm from pyrocko import gf, util, moment_tensor as mtm from pyrocko.guts import String, Float, Dict, Int, StringChoice from pyrocko.guts import String, Float, Dict, StringChoice from .base import Problem, ProblemConfig from .base import Problem, ProblemConfig from ..meta import Forbidden, expand_template, Parameter from ..meta import Forbidden, expand_template, Parameter ... ...
 ... @@ -18,7 +18,6 @@ class DoubleDCProblemConfig(ProblemConfig): ... @@ -18,7 +18,6 @@ class DoubleDCProblemConfig(ProblemConfig): ranges = Dict.T(String.T(), gf.Range.T()) ranges = Dict.T(String.T(), gf.Range.T()) distance_min = Float.T(default=0.0) distance_min = Float.T(default=0.0) nbootstrap = Int.T(default=100) def get_problem(self, event, targets): def get_problem(self, event, targets): if event.depth is None: if event.depth is None: ... @@ -38,7 +37,6 @@ class DoubleDCProblemConfig(ProblemConfig): ... @@ -38,7 +37,6 @@ class DoubleDCProblemConfig(ProblemConfig): targets=targets, targets=targets, ranges=self.ranges, ranges=self.ranges, distance_min=self.distance_min, distance_min=self.distance_min, nbootstrap=self.nbootstrap, norm_exponent=self.norm_exponent) norm_exponent=self.norm_exponent) return problem return problem ... ...
 ... @@ -18,7 +18,6 @@ class RectangularProblemConfig(ProblemConfig): ... @@ -18,7 +18,6 @@ class RectangularProblemConfig(ProblemConfig): ranges = Dict.T(String.T(), gf.Range.T()) ranges = Dict.T(String.T(), gf.Range.T()) apply_balancing_weights = Bool.T(default=False) apply_balancing_weights = Bool.T(default=False) decimation_factor = Int.T(default=1) decimation_factor = Int.T(default=1) nbootstrap = Int.T(default=10) distance_min = Float.T(default=0.) distance_min = Float.T(default=0.) def get_problem(self, event, targets): def get_problem(self, event, targets): ... @@ -35,7 +34,6 @@ class RectangularProblemConfig(ProblemConfig): ... @@ -35,7 +34,6 @@ class RectangularProblemConfig(ProblemConfig): name=expand_template(self.name_template, event.name), name=expand_template(self.name_template, event.name), apply_balancing_weights=self.apply_balancing_weights, apply_balancing_weights=self.apply_balancing_weights, base_source=base_source, base_source=base_source, nbootstrap=self.nbootstrap, distance_min=self.distance_min, distance_min=self.distance_min, targets=targets, targets=targets, ranges=self.ranges, ranges=self.ranges, ... ...