def initialize_world()

in src/lic/ppl/inference/abstract_infer.py [0:0]


    def initialize_world(self, initialize_from_prior: bool = False, vi_dicts=None):
        """
        Initializes the world variables with queries and observation calls.

        :param initialize_from_prior: boolean to initialize samples from prior
        """
        self.world_ = self.initial_world_.copy()
        self.world_.vi_dicts = vi_dicts
        self.world_.set_observations(self.observations_)
        self.world_.set_initialize_from_prior(initialize_from_prior)

        for node in self.observations_:
            # makes the call for the observation node, which will run sample(node())
            # that results in adding its corresponding Variable and its dependent
            # Variable to the world
            self.world_.call(node)
        for node in self.queries_:
            # makes the call for the query node, which will run sample(node())
            # that results in adding its corresponding Variable and its dependent
            # Variable to the world.
            self.world_.call(node)

        self.world_.accept_diff()
        self.world_.vi_dicts = None