|
10 | 10 | from kgcnn.layers.polynom import SphericalBesselJnExplicit, SphericalHarmonicsYl
|
11 | 11 | from kgcnn.ops.axis import get_positive_axis
|
12 | 12 | from kgcnn.ops.core import cross as kgcnn_cross
|
| 13 | +from kgcnn import __geom_euclidean_norm_add_eps__ as global_geom_euclidean_norm_add_eps |
| 14 | +from kgcnn import __geom_euclidean_norm_no_nan__ as global_geom_euclidean_norm_no_nan |
13 | 15 |
|
14 | 16 |
|
15 | 17 | class NodePosition(Layer):
|
@@ -142,8 +144,11 @@ class EuclideanNorm(Layer):
|
142 | 144 | with :obj:`invert_norm` layer arguments.
|
143 | 145 | """
|
144 | 146 |
|
145 |
| - def __init__(self, axis: int = -1, keepdims: bool = False, invert_norm: bool = False, add_eps: bool = False, |
146 |
| - no_nan: bool = True, square_norm: bool = False, **kwargs): |
| 147 | + def __init__(self, axis: int = -1, keepdims: bool = False, |
| 148 | + invert_norm: bool = False, |
| 149 | + add_eps: bool = global_geom_euclidean_norm_add_eps, |
| 150 | + no_nan: bool = global_geom_euclidean_norm_no_nan, |
| 151 | + square_norm: bool = False, **kwargs): |
147 | 152 | """Initialize layer.
|
148 | 153 |
|
149 | 154 | Args:
|
@@ -177,7 +182,7 @@ def compute_output_shape(self, input_shape):
|
177 | 182 |
|
178 | 183 | @staticmethod
|
179 | 184 | def _compute_euclidean_norm(inputs, axis: int = -1, keepdims: bool = False, invert_norm: bool = False,
|
180 |
| - add_eps: bool = False, no_nan: bool = True, square_norm: bool = False): |
| 185 | + add_eps: bool = False, no_nan: bool = False, square_norm: bool = False): |
181 | 186 | """Function to compute euclidean norm for inputs.
|
182 | 187 |
|
183 | 188 | Args:
|
@@ -306,7 +311,10 @@ class NodeDistanceEuclidean(Layer):
|
306 | 311 | the output of :obj:`NodePosition`.
|
307 | 312 | """
|
308 | 313 |
|
309 |
| - def __init__(self, add_eps: bool = False, no_nan: bool = True, **kwargs): |
| 314 | + def __init__(self, |
| 315 | + add_eps: bool = global_geom_euclidean_norm_add_eps, |
| 316 | + no_nan: bool = global_geom_euclidean_norm_no_nan, |
| 317 | + **kwargs): |
310 | 318 | r"""Initialize layer instance of :obj:`NodeDistanceEuclidean`. """
|
311 | 319 | super(NodeDistanceEuclidean, self).__init__(**kwargs)
|
312 | 320 | self.layer_subtract = Subtract()
|
@@ -354,7 +362,9 @@ class EdgeDirectionNormalized(Layer):
|
354 | 362 | As the first index defines the incoming edge.
|
355 | 363 | """
|
356 | 364 |
|
357 |
| - def __init__(self, add_eps: bool = False, no_nan: bool = True, **kwargs): |
| 365 | + def __init__(self, add_eps: bool = global_geom_euclidean_norm_add_eps, |
| 366 | + no_nan: bool = global_geom_euclidean_norm_no_nan, |
| 367 | + **kwargs): |
358 | 368 | """Initialize layer."""
|
359 | 369 | super(EdgeDirectionNormalized, self).__init__(**kwargs)
|
360 | 370 | self.layer_subtract = Subtract()
|
|
0 commit comments