You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, I am using gempy version 2024.2.0.2. I am doing the uncertainty quantification using Monte Carlo method of my gempy model named "loaded_model". The numbers "205134058, 363156420, 128925917, 36792972" are the ID of each layer. However, when I start to run the code it takes a long time it has been running for an hour and does not finish or show anything. Is this normal? How much time does it take? How can I make it faster? I appreciate any comments that help me improve my code.
thanks for the questiom. I am not an expert in this field - but my first question would be how long a single computation of your model takes. This mainly depends on the resolution you set and the amount of input data. Have you already checked that?
Quick addition @Anagabrielamantilla : as speed for each model matters in your case, you could try running the model computation with the PyTorch Backend.
Steps:
Install PyTorch (https://pytorch.org/get-started/locally/) - please check that it is also available in the environment in which you are running GemPy (import torch should work)
Set the backend to PyTorch in the GemPy compute step:
from gempy_engine.config import AvailableBackends
gp.compute_model(geo_model, engine_config=gp.data.GemPyEngineConfig(
backend=AvailableBackends.PYTORCH
))
Best to check with a single model iteration first, but it should definitely speed up the compute process. If you are running the modeling in IPython (for example, in Jupyter notebooks), you can use the %%timeit-magic for a simple check.
Hello, I am using gempy version 2024.2.0.2. I am doing the uncertainty quantification using Monte Carlo method of my gempy model named "loaded_model". The numbers "205134058, 363156420, 128925917, 36792972" are the ID of each layer. However, when I start to run the code it takes a long time it has been running for an hour and does not finish or show anything. Is this normal? How much time does it take? How can I make it faster? I appreciate any comments that help me improve my code.
`
indices_bool_1 = loaded_model.surface_points_copy.df['id'].isin([205134058, 363156420, 128925917, 36792972])
indices_1 = loaded_model.surface_points_copy.df.index[indices_bool_1]
Z_init_1 = loaded_model.surface_points_copy.df.loc[(indices_1, ['Z', 'id'])].copy()
df = pd.DataFrame(Z_init_1)
capa1 = df[df['id'] == 205134058]['Z']
capa2 = df[df['id'] == 363156420]['Z']
capa3 = df[df['id'] == 128925917]['Z']
capa4 = df[df['id'] == 36792972]['Z']
def sample(silent=True):
Z_var = np.random.normal(0, 30, size=4)
Z_loc = np.hstack([capa1 + Z_var[0],
capa2 + Z_var[1],
capa3 + Z_var[2],
capa4 + Z_var[3]])
lith_blocks = np.array([])
n_iterations = 10 # Number of iterations
for i in range(n_iterations):
print('iteration number:', i)
lith_blocks = np.append(lith_blocks, sample())
`
I have tried reducing the number of iterations but does not work either.
The text was updated successfully, but these errors were encountered: