Skip to content

Base

Strategy ยค

Base class for strategies, which are basically wrapper blocks that modify the state of the sampler

This is an abstract template that should not be directly used.

Source code in flowMC/strategy/base.py
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
class Strategy:
    """
    Base class for strategies, which are basically wrapper blocks that modify the state of the sampler

    This is an abstract template that should not be directly used.

    """

    @abstractmethod
    def __name__(self):
        raise NotImplementedError

    @abstractmethod
    def __init__(self):
        raise NotImplementedError

    @abstractmethod
    def __call__(
        self,
        rng_key: PRNGKeyArray,
        local_sampler: ProposalBase,
        global_sampler: NFProposal,
        initial_position: Float[Array, "n_chains n_dim"],
        data: dict,
    ) -> tuple[
        PRNGKeyArray,
        Float[Array, "n_chains n_dim"],
        ProposalBase,
        NFProposal,
        PyTree,
    ]:
        raise NotImplementedError