@@ -46,39 +46,26 @@ def test_optimize_nugget_effect():
46
46
topography = (xr .open_dataset (os .path .join (path , "Topography.nc" )))
47
47
)
48
48
49
- if False :
50
- gpv .plot_3d (geo_model , show_data = True , image = True )
51
-
52
49
geo_model .interpolation_options .cache_mode = gp .data .InterpolationOptions .CacheMode .NO_CACHE
53
50
geo_model .interpolation_options .kernel_options .range = 0.5
54
51
55
- if True :
56
- gp .API .compute_API .optimize_nuggets (
57
- geo_model = geo_model ,
58
- engine_config = gp .data .GemPyEngineConfig (
59
- backend = gp .data .AvailableBackends .PYTORCH ,
60
- ),
61
- max_epochs = 100 ,
62
- convergence_criteria = 1e5 ,
63
- only_groups = [geo_model .structural_frame .get_group_by_name ("Red" )]
64
- )
52
+ gp .API .compute_API .optimize_nuggets (
53
+ geo_model = geo_model ,
54
+ engine_config = gp .data .GemPyEngineConfig (
55
+ backend = gp .data .AvailableBackends .PYTORCH ,
56
+ ),
57
+ max_epochs = 100 ,
58
+ convergence_criteria = 1e5 ,
59
+ only_groups = [geo_model .structural_frame .get_group_by_name ("Red" )]
60
+ )
65
61
66
- gp .compute_model (
67
- gempy_model = geo_model ,
68
- engine_config = gp .data .GemPyEngineConfig (
69
- backend = gp .data .AvailableBackends .PYTORCH ,
70
- ),
71
- validate_serialization = False
72
- )
73
- else :
74
- gp .API .compute_API .optimize_and_compute (
75
- geo_model = geo_model ,
76
- engine_config = gp .data .GemPyEngineConfig (
77
- backend = gp .data .AvailableBackends .PYTORCH ,
78
- ),
79
- max_epochs = 100 ,
80
- convergence_criteria = 1e5
81
- )
62
+ gp .compute_model (
63
+ gempy_model = geo_model ,
64
+ engine_config = gp .data .GemPyEngineConfig (
65
+ backend = gp .data .AvailableBackends .PYTORCH ,
66
+ ),
67
+ validate_serialization = False
68
+ )
82
69
83
70
print (f"Final cond number: { geo_model .interpolation_options .kernel_options .condition_number } " )
84
71
nugget_effect = geo_model .taped_interpolation_input .surface_points .nugget_effect_scalar .detach ().numpy ()
@@ -96,7 +83,7 @@ def test_optimize_nugget_effect():
96
83
import gempy_viewer as gpv
97
84
import pyvista as pv
98
85
99
- image = False
86
+ image = True
100
87
gempy_vista = gpv .plot_3d (
101
88
model = geo_model ,
102
89
show = False ,
0 commit comments