コード例 #1
0
    def setup_class(self):
        from . import create_test_model
        model = create_test_model("textbook")
        arch = ARCHSampler(model, thinning=1)
        assert ((arch.n_warmup > 0)
                and (arch.n_warmup <= 2 * len(model.reactions)))
        assert all(arch.validate(arch.warmup) == "v")
        self.arch = arch

        optgp = OptGPSampler(model, processes=1, thinning=1)
        assert ((optgp.n_warmup > 0)
                and (optgp.n_warmup <= 2 * len(model.reactions)))
        assert all(optgp.validate(optgp.warmup) == "v")
        self.optgp = optgp
コード例 #2
0
 def test_arch_init_benchmark(self, model, benchmark):
     benchmark(lambda: ARCHSampler(model))