Skip to content

clip_values parameter in TensorFlow v2 #2026

Discussion options

You must be logged in to vote

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:

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.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
1 reply
@fatimah-aloraini
Comment options

Answer selected by beat-buesser
Comment options

You must be logged in to vote
3 replies
@beat-buesser
Comment options

@fatimah-aloraini
Comment options

@beat-buesser
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants