3 ms·
Work for Google - have never worked on Tensorflow I tried: inputs = { 'matrix': [[10, 20, 30], [5, 5, 10], [2, 2, 1]
by bquinlan 6y ago
Work for Google - have never worked on Tensorflow
I tried:
inputs = {
'matrix': [[10, 20, 30],
[5, 5, 10],
[2, 2, 1]]
}
output = [[85/10, 85/20, 85/30],
[85/5, 85/5, 85/10],
[85/2, 85/2, 85/1]]
And got:
tf.cast(tf.divide(tf.reduce_sum(matrix), matrix),
tf.float32)
But now I realize that is pretty close to one of the examples. Did anyone try something complex?
- nl 6y agoYes, I tried a problem I recently posted to Stackoverflow. It couldn't solve it - it was a broadcasting problem though.
- ghj 6y agoI tried giving it a problem that required matrix power and it couldn't solve it. (this was a somewhat real task where I couldn't google how to raise a matrix to a power in tf). # A dict mapping input variable names to input tensors. inputs = { 'matrix': [[1, 1], [1, 0]], 'vector': [[1], [0]], } # The corresponding output tensor. output = [[13], [8]] # A list of relevant scalar constants, if any. constants = [6] # An English description of the tensor manipulation. description = 'Whatever the equivalent of numpy.linalg.matrix_power is in tf. Calculates fibonacci.' I was hoping it would at least return matrix @ matrix @ matrix @ matrix @ matrix @ matrix @ vector But it just didn't find anything. (the constant for the exponent is large because smaller numbers give nonsense results)