I'm studying with Tensorflow open source code. I would like to find specific place where actual calculation is executed.
However, it's really hard to find from the deep open source code. So, I want to get any directions from people who've already worked on here.
All of my work is assuming neural network.
I've started with session.run function from class BaseSession.
I was floating around the source code from there. I finally thought that all real calculation runs in the c wrapped library, not python framework.
So if I want to hook the real calculation part, should I recompile c library and wrap it again using swig???
What I found from the source code is this. I thought it is where actual calculation is being executed. (https://github.com/tensorflow/tensorflow/blob/master/tensorflow/python/client/session.py)
def _call_tf_sessionrun(self, options, feed_dict, fetch_list, target_list, run_metadata):
return tf_session.TF_SessionRun_wrapper(self._session, options, feed_dict, fetch_list, target_list, run_metadata)
My final goal is get values after activation function executed (i.e. relu, etc.. ).
I think I have two options to capture the values from the activation function.
Making Custom Activation Function which simulate perfectly same way in tensorflow activations, and make it to print values.
- Is it possible way to capture all values after activation function calculated by making custom activation function?
Modify C Source Code and recompile the library and put to the tensorflow python library.
- It looks like horrible to handle all issues from this one
What is much better way?
And If you have much simpler ways to capture those values, please let me know the method...