Closed Sarenrenegade closed 1 year ago
You can get the size of an array with np.size(array)
. Could you elaborate what you mean by inferring "the elements in this array"?
Could you move the question to our forum? https://forum.pyro.ai/ We only use github issues to track issues and feature requests.
Thanks for the quick answer. The objective is to "retrieve" the size and every element inside this array, given a dataset. Basically I have a function f(a, x) = y. Both parameters x and a are arrays, and I want to find a, wich means finding the length of this array and every values inside it. I hope it is a bit clearer.
Hi ! I found what I need on the notebooks you wrote : https://github.com/fehiepsi/rethinking-numpyro ! I will close this issue and leave the answer if anyone else should use numpyro as an "inversion library":
with numpyro.handlers.seed(rng_seed=2971):
nb_ruptures = numpyro.sample('nb_ruptures', dist.Uniform(1, 10))
a = numpyro.sample("a", dist.Normal(178, 20).expand([int(nb_ruptures)]))
print(a, a.shape)
Thanks again
Hello! I have a naive question : is there a way to infer the size of an array and the elements present in this array? My objective is to recover past earthquakes on a fault given the concentration of 36Cl. To do so, I have to infer the number of earthquakes and then attribute an exhumation height for each earthquake. I also have a constraint on the elements of this array: the sum of the element cannot be superior to the fault scarp height. I have this code, with a much simpler forward function, that mimics what I need, but has the objective of finding ruptures :
Thanks for your help