It's not 100% clear from the code example, but if the list initial_parameters_of_hypothesis_function
is a list of tf.Variable
objects, then the line session.run(init)
will fail because TensorFlow isn't (yet) smart enough to figure out the dependencies in variable initialization. To work around this, you should change the loop that creates parameters
to use initial_parameters_of_hypothesis_function[i].initialized_value()
, which adds the necessary dependency:
parameters = []
for i in range(0, number_of_attributes, 1):
parameters.append(tf.Variable(
initial_parameters_of_hypothesis_function[i].initialized_value()))