Advertisement
Guest User

Untitled

a guest
Oct 15th, 2019
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. test_200 = model_400.encode(x_test)
  2. test_50 = model_200.encode(test_200)
  3. test_10 = model_50.encode(test_50)
  4. test_2 = model_10.encode(test_10)
  5. out = model_2.encode(test_2)
  6. encoded_test = tf.data.Dataset.from_tensor_slices((out, y_test))
  7. encoded_sub = encoded_test.take(20000)
  8. data = ([],[],[],[],[],[],[],[],[],[])
  9. shapes = (".", ",", "o", "v", "^", "<", ">", "1", "2", "3")
  10. labels = ("9", "8", "7", "6", "5", "4", "3", "2", "1", "0")
  11.  
  12. for input, output in iter(encoded_sub):
  13. if output.numpy() == 9:
  14. data[9].append(input.numpy())
  15. elif output.numpy() == 8:
  16. data[8].append(input.numpy())
  17. elif output.numpy() == 7:
  18. data[7].append(input.numpy())
  19. elif output.numpy() == 6:
  20. data[6].append(input.numpy())
  21. elif output.numpy() == 5:
  22. data[5].append(input.numpy())
  23. elif output.numpy() == 4:
  24. data[4].append(input.numpy())
  25. elif output.numpy() == 3:
  26. data[3].append(input.numpy())
  27. elif output.numpy() == 2:
  28. data[2].append(input.numpy())
  29. elif output.numpy() == 1:
  30. data[1].append(input.numpy())
  31. elif output.numpy() == 0:
  32. data[0].append(input.numpy())
  33.  
  34. fig = plt.figure()
  35. ax1 = fig.add_subplot(111)
  36. i = 0
  37. for sets in data:
  38. x_cords = []
  39. y_cords = []
  40. for item in sets:
  41. x_cords.append(item[0])
  42. y_cords.append(item[1])
  43.  
  44.  
  45. ax1.scatter(x_cords, y_cords, marker = shapes[i], label = labels[i])
  46. i+=1
  47. ax1.legend(loc = 2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement