by bquinlan · 6y ago · 0 comments
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? # 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)It couldn't solve it - it was a broadcasting problem though.