Skip to content

Instantly share code, notes, and snippets.

@jvmncs
Created October 24, 2019 13:17
Show Gist options
  • Save jvmncs/ab3af8660defd7f8cf59d2c50d357753 to your computer and use it in GitHub Desktop.
Save jvmncs/ab3af8660defd7f8cf59d2c50d357753 to your computer and use it in GitHub Desktop.
mnist = tf.keras.datasets.mnist
(x_train, y_train), (x_test, y_test) = mnist.load_data()
x_train, x_test = x_train / 255.0, x_test / 255.0
# Converting the data from numpy to tf.Tensor in order to have PySyft functionalities.
x_train, y_train = tf.convert_to_tensor(x_train), tf.convert_to_tensor(y_train)
x_test, y_test = tf.convert_to_tensor(x_test), tf.convert_to_tensor(y_test)
# Send data to Alice (for demonstration purposes)
x_train_ptr = x_train.send(alice)
y_train_ptr = y_train.send(alice)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment