c56e3db656f3db9a7316b41221571a82ff398a1a,tf_encrypted/keras/models/sequential_test.py,TestSequential,test_model_from_config,#TestSequential#,31

Before Change



    with tfe.protocol.SecureNN():
      tfe_model = tfe.keras.models.model_from_config(k_config)
      x = tfe.define_private_variable(input_data)

    with tfe.Session() as sess:
      sess.run(tf.global_variables_initializer())
      tfe_model.set_weights(k_weights)
      y = tfe_model(x)
      actual = sess.run(y.reveal())

      np.testing.assert_allclose(actual, expected, rtol=1e-2, atol=1e-4)

After Change


                                                         input_shape)

    with tfe.protocol.SecureNN():
      x = tfe.define_private_input(
          "inputter",
          lambda: tf.convert_to_tensor(input_data))

      tfe_model = tfe.keras.models.model_from_config(k_config)
      tfe_model.set_weights(k_weights)
      y = tfe_model(x)

    with KE.get_session() as sess:
      actual = sess.run(y.reveal())

      np.testing.assert_allclose(actual, expected, rtol=1e-2, atol=1e-4)

    KE.clear_session()

  def test_from_config(self):
    input_shape = (1, 3)
    input_data = np.random.normal(size=input_shape)
    expected, k_weights, k_config = _model_predict_keras(input_data,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: mortendahl/tf-encrypted
Commit Name: c56e3db656f3db9a7316b41221571a82ff398a1a
Time: 2019-07-08
Author: yann.dupis@gmail.com
File Name: tf_encrypted/keras/models/sequential_test.py
Class Name: TestSequential
Method Name: test_model_from_config


Project Name: mortendahl/tf-encrypted
Commit Name: c56e3db656f3db9a7316b41221571a82ff398a1a
Time: 2019-07-08
Author: yann.dupis@gmail.com
File Name: tf_encrypted/keras/models/sequential_test.py
Class Name: TestSequential
Method Name: test_clone_model


Project Name: mortendahl/tf-encrypted
Commit Name: c56e3db656f3db9a7316b41221571a82ff398a1a
Time: 2019-07-08
Author: yann.dupis@gmail.com
File Name: tf_encrypted/keras/models/sequential_test.py
Class Name: TestSequential
Method Name: test_conv_model