July 2019
Intermediate to advanced
512 pages
19h 39m
English
Now we will start making predictions on the test set:
predicted_output = []i = 0while i+batch_size <= len(X_test): output = session.run([y_hat],feed_dict={input:X_test[i:i+batch_size]}) i += batch_size predicted_output.append(output)
Print the predicted output:
predicted_output[0]
We will get the result as shown:
[[array([[-0.60426176]], dtype=float32), array([[-0.60155034]], dtype=float32), array([[-0.60079575]], dtype=float32), array([[-0.599668]], dtype=float32), array([[-0.5991149]], dtype=float32), array([[-0.6008351]], dtype=float32), array([[-0.5970466]], dtype=float32)]]
As you can see, the values of test predictions are in a nested list, so we will flatten them:
predicted_values_test = [] ...
Read now
Unlock full access