clip_values parameter in TensorFlow v2 #2026
-
Hello, Feature 1 the feature values are: Feature 2 until Feature 9 the range is : (0, 255) When I was generating my TensorFlow estimator, I got an error: Here is my code:
Second: when I use the clip_values parameter, the mask parameter does not work. i.e. all of the features are clipped into the specified range whether its value in the mask is TRUE or FALSE. For example, when I use the above code with generate function below all of my features are modified.
Thank you in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
About the first question: I think we should improve the documentation here. Clip values per feature should be defined as a tuple of two numpy.ndarray arrays with the shape of a single input sample (without batch dimension). In your case: import numpy as np
clip_values = (np.array([0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]), np.array([1680.0, 255.0, 255.0, 255.0, 255.0, 255.0, 255.0, 255.0, 255.0])) About the second question: Yes, clipping will always be applied independent of a mask. If you would like to have one feature not being clipped you have to set its min/max clip values to -np.inf/np.inf to let it be clipped at infinity. |
Beta Was this translation helpful? Give feedback.
-
Hello @beat-buesser I really appreciate any help you can provide. |
Beta Was this translation helpful? Give feedback.
Hi @fatimah-aloraini
About the first question: I think we should improve the documentation here. Clip values per feature should be defined as a tuple of two numpy.ndarray arrays with the shape of a single input sample (without batch dimension). In your case:
About the second question: Yes, clipping will always be applied independent of a mask. If you would like to have one feature not being clipped you have to set its min/max clip values to -np.inf/np.inf to let it be clipped at infinity.