Skip to content
Advertisement

(Conv1D) Tensorflow and Jax Resulting Different Outputs for The Same Input

I am trying to use conv1d functions to make a transposed convlotion repectively at jax and tensorflow. I read the documentation of both of jax and tensorflow for the con1d_transposed operation but they are resulting with different outputs for the same input.

I can not find out what the problem is. And I don’t know which one produces the correct results. Help me please.

My Jax Implementation (Jax Code)

JavaScript

My TensorFlow Implementation (TensorFlow Code)

JavaScript

Output from the Jax

JavaScript

Output from the TensorFlow

JavaScript

Advertisement

Answer

Function conv1d_transpose expects filters in shape [filter_width, output_channels, in_channels]. If filters in snippet above were transposed to satisfy this shape, then for jax to return correct results, while computing dn1 parameter should be WOI (Width – Output_channels – Input_channels) and not WIO (Width – Input_channels – Output_channels). After that:

JavaScript

Results not same as with tensorflow, but kernels for jax were flipped, so actually that was expected.

User contributions licensed under: CC BY-SA
3 People found this is helpful
Advertisement