You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is unlikely to be a big issue in the context of the TFJS example, but perhaps a similar issue affects the python version too? This snippet is from main.js in the TFJS example:
When you add a small number to the divisor to avoid an infinity value, you will get a large number, which is not between 1 and -1. In tensorflowjs, you should use tf.divNoNan() so n/0 returns 0. I believe the python version of tensorflow has an equivalent tf.math.divide_no_nan() function.
It's an edge case, but has caused headaches for me when analysing audio with a fade effect.
The text was updated successfully, but these errors were encountered:
Mattk70
changed the title
Approach to NaN handling in TFJS is not optimal
Approach to NaN handling in TFJS
Feb 14, 2024
This is unlikely to be a big issue in the context of the TFJS example, but perhaps a similar issue affects the python version too? This snippet is from main.js in the TFJS example:
When you add a small number to the divisor to avoid an infinity value, you will get a large number, which is not between 1 and -1. In tensorflowjs, you should use tf.divNoNan() so n/0 returns 0. I believe the python version of tensorflow has an equivalent tf.math.divide_no_nan() function.
It's an edge case, but has caused headaches for me when analysing audio with a fade effect.
The text was updated successfully, but these errors were encountered: