I am calculating some features from a set of data. I made as function for each calculation. I want to put all of those values in an array in another function and I want to call the function. how to do it ?
The 3 functions that I have are
def peak_value(x):
return tf.reduce_max(tf.abs(x))
def rootms(x):
return tf.sqrt(tf.reduce_mean(tf.square(x)))
def meanofabs(x):
return tf.reduce_mean(tf.abs(x))
I want these values to be assigned to a array inside function
def pooldata(x,size):
pool = tf.zeros([1,size],tf.float32)
# i want to
# assign pool[0] with peak_value(x)
# assign pool[1] with rootms(x)
# assign pool[2] with meanofabs(x)
return pool
then I want to call the function
# define x, size
model = tf.intialize_all_variables()
sess = tf.Session()
sess.run(model)
print(sess.run(pooldata)) # print all the three values
How can i do it ?
I tried
tf.assign(pool[0],peak_value(x))
but it gives me error
TypeError: Input 'ref' of 'Assign' Op requires l-value input