Closed lborcard closed 1 month ago
Thanks for reporting. I have never used pymc. Can you provide a small code snippet?
Of course there it is :
import numpy as np
import pymc as pm
# Generate synthetic data using a geometric distribution
N0 = 1000 # Initial number of molecules
p_true = 0.1 # True decay probability
time_steps_geom = np.arange(1, 200) # Discrete time steps
observed_data_geom = np.random.geometric(p=p_true, size=len(time_steps_geom))
# Bayesian model using PyMC
with pm.Model() as model_geom:
p_geom = pm.Beta("p", alpha=2, beta=2)
N_obs_geom = pm.Geometric("N_obs", p=p_geom, observed=observed_data_geom)
trace_geom = pm.sample()
# Get the PPC
ppc_geom = pm.sample_posterior_predictive(trace_geom)
# Plotting the posterior distribution of p
pm.plot_posterior(trace_geom, var_names=["p"])
plt.show()
The notebook was running for a long time so I decreased time_steps_geom
to np.arange(1, 10)
and that worked. Does decreasing it work for you too, or does it fail even then? Not that this is a solution but just trying to narrow in on the problem.
it mostly throws this error when I open the notebook, i.e on start up, where part of the code is stopping because a piece of code is stopping because of this error. This particular piece of code is not the problem but just an example.
@lborcard this works for me too. is this ok to close?
Describe the bug
This error happens almost everytime that I open my notebook, the Pmyc model does not run and it says
ConnectionResetError
Environment
{ "marimo": "0.8.7", "OS": "Linux", "OS Version": "4.18.0-553.8.1.el8_10.x86_64", "Processor": "x86_64", "Python Version": "3.11.9", "Binaries": { "Browser": "--", "Node": "--" }, "Requirements": { "click": "8.1.7", "importlib-resources": "missing", "jedi": "0.19.1", "markdown": "3.6", "pymdown-extensions": "10.8.1", "pygments": "2.18.0", "tomlkit": "0.12.5", "uvicorn": "0.30.1", "starlette": "0.37.2", "websockets": "12.0", "typing-extensions": "4.12.1", "ruff": "0.5.6" } }
Code to reproduce
Can be reproduced with any pymc model in my experience.