Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEATURE] - Add a flag for correct scaling of logged TensorBoard images #61

Open
mr-ubik opened this issue Apr 7, 2020 · 4 comments · May be fixed by #56
Open

[FEATURE] - Add a flag for correct scaling of logged TensorBoard images #61

mr-ubik opened this issue Apr 7, 2020 · 4 comments · May be fixed by #56
Assignees
Labels
enhancement New feature or request

Comments

@mr-ubik
Copy link
Contributor

mr-ubik commented Apr 7, 2020

System information

  • AshPy version (you are using): 0.4.0
  • Are you willing to contribute it (Yes/No): Yes

Describe the feature and the current behavior/state
TensorBoard images should be logged in the [0, 1] range when float.
Currently, we do not provide any type of automatic handling of this scaling, so if you are training on [-1, 1] and using our callbacks, images will be logged without scaling.

Will this change the current API? How?
Small change to ashpy.utils.log() and all the callbacks using it, they will now accept a new boolean argument auto_tb_scaling controlling this behavior.

Who will benefit with this feature?
Anyone using the default logging facilities.

Any Other info

@mr-ubik mr-ubik added the enhancement New feature or request label Apr 7, 2020
@EmanueleGhelfi
Copy link
Contributor

EmanueleGhelfi commented Apr 7, 2020

Do you think that a boolean flag is enough?

If the input is float tensorboard wants the range [0,1] so we need to scale the image if the range is [-1, 1] or if the range is [0, 255] (Are there people using the range [0, 255] and float dtype?).

In this case we can accept an enum describing the input range.

@mr-ubik
Copy link
Contributor Author

mr-ubik commented Apr 7, 2020

Yeah, an Enum is probably better.

@galeone
Copy link
Member

galeone commented Apr 8, 2020

I guess we should go with this approach:

  1. If the image dtype is tf.uin8, then we expect values on [0-255] (follow the tensorflow convention)
  2. If the image dytpe is tf.float* then the image should be in the range [0.1] (tensorflow convention). We can support only the most common scenario that's an image with values squashed in [-1,1]. Thus a boolean for this case is enough IMHO
  3. Else raise error

@EmanueleGhelfi
Copy link
Contributor

EmanueleGhelfi commented Apr 8, 2020

Initial implementation in #56

See 18f9e41#diff-b3393cc30d90b7f5a9c26ecc968ef758R44

@mr-ubik mr-ubik linked a pull request Apr 8, 2020 that will close this issue
12 tasks
@mr-ubik mr-ubik assigned mr-ubik and EmanueleGhelfi and unassigned mr-ubik Apr 8, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants