Keras source codes: how to reach?

Viewed 2491

To be able to use Keras as a programming tool, sometimes one needs to see the source code of methods. I know that each of the functions in Keras is implemented openly and is accessible to the public. But unfortunately it is not trivial to find the code on the web before you are experienced enough. For example, it is not explained in https://keras.io/ what is the easiest way to find the source for a specific method.

My question here is can someone please point me to the implementation of softmax activation of Keras with Tensorflow backened or recommend how is a good way to get to it?

3 Answers

There is another way to get the source code which might be useful especially if you are not using the latest version (available on github), so I am adding it here

You can always find the keras source code directly on your PC if you have installed the keras package. The directory it is installed in is : /python3.your_version/site-packages/keras

It looks like the Keras source code can be found in Github for Keras. As opposed to Pytorch whose documentation for each function has a direct link to the corresponding source code, in Keras the two seems to be disconnected.

One way to find the source for a specific component in that is manually going through folders in the above GIT repository..

I did that and found that it can be found in Keras Softmax Source Code.

There might be better ways of getting to this source code, but I am not aware of.

Related