Пример #1
0
def test_pipeline(sampler, problem):
    """Check that a typical pipeline runs through."""
    # optimization
    optimizer = optimize.ScipyOptimizer(options={'maxiter': 10})
    result = optimize.minimize(
        problem, n_starts=3, optimizer=optimizer)

    # sample
    result = sample.sample(
        problem, sampler=sampler, n_samples=100, result=result)

    # some plot
    visualize.sampling_1d_marginals(result)
    plt.close()
Пример #2
0
def test_sampling_1d_marginals():
    """Test pypesto.visualize.sampling_1d_marginals"""
    result = create_sampling_result()
    visualize.sampling_1d_marginals(result)
    # call with custom arguments
    visualize.sampling_1d_marginals(result,
                                    i_chain=1,
                                    stepsize=5,
                                    size=(10, 10))
    # call with other modes
    visualize.sampling_1d_marginals(result, plot_type='hist')
    visualize.sampling_1d_marginals(result, plot_type='kde', bw='silverman')
Пример #3
0
def test_pipeline(sampler, problem):
    """Check that a typical pipeline runs through."""
    # optimization
    optimizer = optimize.ScipyOptimizer(options={'maxiter': 10})
    result = optimize.minimize(problem,
                               n_starts=3,
                               optimizer=optimizer,
                               filename=None)

    # sample
    result = sample.sample(problem,
                           sampler=sampler,
                           n_samples=100,
                           result=result,
                           filename=None)
    # remove warnings in test/sample/test_sample.
    # Warning here: pypesto/visualize/sampling.py:1104
    # geweke test
    sample.geweke_test(result=result)

    # some plot
    visualize.sampling_1d_marginals(result)
    plt.close()