list-of-differentiable--ops-and-non-differentiable-ops--in-tensorflow's People
list-of-differentiable--ops-and-non-differentiable-ops--in-tensorflow's Issues
Round is a differentiable operation?
I thought there was no gradient defined in TensorFlow for round?
How to find the equivalents of python/keras api functions
Note for python tensorflow API users... to find the tensorflow equivalent class names, you can search for them in tensorflow/python/ops/array_ops.py, and look for which tensorflow operator it is getting mapped to for your arguments. Often this can be a constant, or not. In my case, where_v2 maps to select_v2, which is probably SelectV2, which shows up in the output.
$ rg Select
DIFFERENTIABLE LIST.txt
283:"Select"
README.md
308:"Select" \
DIFFERENTIABLE.TXT
220:"Select"
221:"SelectV2"
There are probably operators that are differentiable, or not, depending on the arguments.
Incorrect list - I guess the script somehow also needs to check return values?
I think currently the list of differentiable OPs is incorrect.
Take ArgMax
as an example:
It returns [None, None].
And I guess, that is why I'm still getting:
ValueError: No gradients provided for any variable
when I use a Lambda-Layer with tf.math.argmax
within keras.
So my guess is that ArgMax
is indeed not differentiable.
But maybe I'm just missing something?
Example code:
import tensorflow as tf
import tensorflow.keras.backend as K
from tensorflow.keras.layers import *
from tensorflow.keras.models import *
from tensorflow.keras.optimizers import *
def ArgMax():
return Lambda(lambda q:tf.math.argmax(q, 2))
inputs1 = Input(shape = (1,1,))
d = Dense(3)(inputs1)
out = ArgMax()(d)
model = Model(inputs = [inputs1], outputs = [out], name = "test")
model.summary()
model.compile(SGD(0.1),loss="mae")
model.fit(
x = [np.ones((100,1,1))],
y = [np.zeros((100,1))],
batch_size = 100,
verbose = 2,
epochs = 10)
feature request: include results for a range of recent tensorflow versions
Alternatively, you could just focus on the list of known differentiable functions, and include a "since" flag when you detect a version that doesn't have AD.
Your script ran successfully over a tensorflow 1.14 installation from conda, by the way. I would include it, but if you do this, you probably want to automate checking out the versions and gathering all the info anyway.
Thanks!
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.