TensorFlow.jl icon indicating copy to clipboard operation
TensorFlow.jl copied to clipboard

dim parameter for softmax

Open Godisemo opened this issue 9 years ago • 2 comments

Is it possible to specify the dim parameter for softmax and similar functions, as available in the python api? https://www.tensorflow.org/versions/r0.11/api_docs/python/nn.html#softmax

Godisemo avatar Nov 23 '16 23:11 Godisemo

Not at the moment, although it should be pretty straightforward to add.

malmaud avatar Nov 25 '16 13:11 malmaud

Sorry for the lack of effort from my part. I would like to help, but when I tried to read the code I didn't quite understand how to add this functionality. When looking at the tensorflow python api it seems as they do a transpose, do the computation, and then transpose back if you want to do computations in a different dimension. I find that you can gain a lot of performance when using sample index as the last dimension instead of the first. Especially when using mini batches.

Godisemo avatar Nov 25 '16 13:11 Godisemo