@@ -56,6 +56,46 @@ def test_activator_3_layers_segmentation_function(simple_model_3_layers, simple_
56
56
_plot_continious (grid , ids_block , interpolation_input )
57
57
58
58
59
+ def test_activator_3_layers_segmentation_function_II (simple_model_3_layers , simple_grid_3d_more_points_grid ):
60
+ interpolation_input = simple_model_3_layers [0 ]
61
+ options = simple_model_3_layers [1 ]
62
+ data_shape = simple_model_3_layers [2 ].tensors_structure
63
+ grid = dataclasses .replace (simple_grid_3d_more_points_grid )
64
+ interpolation_input .set_temp_grid (grid )
65
+
66
+ interp_input : SolverInput = input_preprocess (data_shape , interpolation_input )
67
+ weights = _solve_interpolation (interp_input , options .kernel_options )
68
+
69
+ exported_fields = _evaluate_sys_eq (interp_input , weights , options )
70
+ exported_fields .set_structure_values (
71
+ reference_sp_position = data_shape .reference_sp_position ,
72
+ slice_feature = interpolation_input .slice_feature ,
73
+ grid_size = interpolation_input .grid .len_all_grids )
74
+
75
+ Z_x : np .ndarray = exported_fields .scalar_field
76
+ sasp = exported_fields .scalar_field_at_surface_points
77
+ ids = np .array ([1 , 2 , 3 , 4 ])
78
+
79
+ print (Z_x , Z_x .shape [0 ])
80
+ print (sasp )
81
+
82
+ BackendTensor .change_backend_gempy (AvailableBackends .numpy )
83
+ ids_block = activate_formation_block (
84
+ exported_fields = exported_fields ,
85
+ ids = ids ,
86
+ sigmoid_slope = 500 * 4
87
+ )[0 , :- 7 ]
88
+
89
+ BackendTensor .change_backend_gempy (AvailableBackends .numpy )
90
+ if BackendTensor .engine_backend == AvailableBackends .PYTORCH :
91
+ ids_block = ids_block .detach ().numpy ()
92
+ Z_x = Z_x .detach ().numpy ()
93
+ interpolation_input .surface_points .sp_coords = interpolation_input .surface_points .sp_coords .detach ().numpy ()
94
+
95
+ if plot :
96
+ _plot_continious (grid , ids_block , interpolation_input )
97
+
98
+
59
99
def _plot_continious (grid , ids_block , interpolation_input ):
60
100
block__ = ids_block [grid .dense_grid_slice ]
61
101
unique = np .unique (block__ )
0 commit comments