コード例 #1
0
ファイル: mock_samples.py プロジェクト: rhayes777/PyAutoFit
    def __init__(
            self,
            model,
            sample_list=None,
            total_samples=10,
            log_evidence=0.0,
            number_live_points=5,
            time: Optional[float] = None,
    ):

        self.model = model

        if sample_list is None:

            sample_list = [
                Sample(
                    log_likelihood=log_likelihood,
                    log_prior=0.0,
                    weight=0.0
                )
                for log_likelihood
                in self.log_likelihood_list
            ]

        super().__init__(
            model=model,
            sample_list=sample_list,
            time=time
        )

        self._total_samples = total_samples
        self._log_evidence = log_evidence
        self._number_live_points = number_live_points
コード例 #2
0
    def samples(self):
        if self._samples is not None:
            return self._samples

        return [
            Sample(log_likelihood=log_likelihood, log_prior=0.0, weight=0.0)
            for log_likelihood in self.log_likelihood_list
        ]
コード例 #3
0
def make_sample():
    return Sample(
        log_likelihood=1.0,
        log_prior=1.0,
        weight=0.5,
        centre=1.0,
        intensity=2.0,
        sigma=3.0
    )
コード例 #4
0
ファイル: mock_samples.py プロジェクト: rhayes777/PyAutoFit
def samples_with_log_likelihood_list(
        log_likelihood_list
):
    return [
        Sample(
            log_likelihood=log_likelihood,
            log_prior=0,
            weight=0
        )
        for log_likelihood
        in log_likelihood_list
    ]
コード例 #5
0
ファイル: mock_samples.py プロジェクト: rhayes777/PyAutoFit
    def default_sample_list(self):

        if self._log_likelihood_list is not None:
            log_likelihood_list = self._log_likelihood_list
        else:
            log_likelihood_list = range(3)

        return [
            Sample(
                log_likelihood=log_likelihood,
                log_prior=0.0,
                weight=0.0
            )
            for log_likelihood
            in log_likelihood_list
        ]
コード例 #6
0
    def __init__(
        self,
        max_log_likelihood_instance=None,
        log_likelihoods=None,
        gaussian_tuples=None,
    ):

        if log_likelihoods is None:
            log_likelihoods = [1.0, 2.0, 3.0]

        super().__init__(model=None,
                         samples=[
                             Sample(log_likelihood=log_likelihood,
                                    log_prior=0.0,
                                    weights=0.0)
                             for log_likelihood in log_likelihoods
                         ])

        self._max_log_likelihood_instance = max_log_likelihood_instance
        self.gaussian_tuples = gaussian_tuples
コード例 #7
0
ファイル: mock_search.py プロジェクト: arfon/PyAutoFit
def samples_with_log_likelihoods(log_likelihoods):
    return [
        Sample(log_likelihood=log_likelihood, log_prior=0, weights=0)
        for log_likelihood in log_likelihoods
    ]