tensorflow-federated

Create a custom federated data set in TensorFlow Federated

走远了吗. 提交于 2019-12-07 06:09:19
问题 I'd like to adapt the recurrent autoencoder from this blog post to work in a federated environment. I've modified the model slightly to conform with the example shown in the TFF image classification tutorial. def create_compiled_keras_model(): model = tf.keras.models.Sequential([ tf.keras.layers.LSTM(2, input_shape=(10, 2), name='Encoder'), tf.keras.layers.RepeatVector(10, name='Latent'), tf.keras.layers.LSTM(2, return_sequences=True, name='Decoder')] ) model.compile(loss='mse', optimizer=

Create a custom federated data set in TensorFlow Federated

自闭症网瘾萝莉.ら 提交于 2019-12-05 10:17:43
I'd like to adapt the recurrent autoencoder from this blog post to work in a federated environment. I've modified the model slightly to conform with the example shown in the TFF image classification tutorial. def create_compiled_keras_model(): model = tf.keras.models.Sequential([ tf.keras.layers.LSTM(2, input_shape=(10, 2), name='Encoder'), tf.keras.layers.RepeatVector(10, name='Latent'), tf.keras.layers.LSTM(2, return_sequences=True, name='Decoder')] ) model.compile(loss='mse', optimizer='adam') return model model = create_compiled_keras_model() sample_batch = gen(1) timesteps, input_dim = 10

how to print local outputs in tensorflow federated?

…衆ロ難τιáo~ 提交于 2019-12-02 05:47:10
I want to print local outputs of clients in the tensorflow federated tutorial https://www.tensorflow.org/federated/tutorials/federated_learning_for_image_classification . What should I do? If you only want a list of the values that go into the aggregations (e.g. into tff.federated_mean ), one option would be to add additional outputs to aggregate_mnist_metrics_across_clients() to include metrics computed using tff.federated_collect() . This might look something like: @tff.federated_computation def aggregate_mnist_metrics_across_clients(metrics): return { 'num_examples': tff.federated_sum

What is the recommended way to mix TensorFlow and TensorFlow Federated code?

廉价感情. 提交于 2019-12-01 10:44:51
TensorFlow (TF) and TensorFlow Federated (TFF) are different layers of functionality that are designed to play well together (as the names implie). Still, they are different things designed to solve different problems. I wonder what is the best way to describe computation in a way that can be used by both vanilla TF and in TFF workloads, as well as the kind of pitfalls that one might want to avoid. Great question. Indeed, there are at least 3 ways to approach composition of TensorFlow code for use with TFF, each with its own merits. Using TensorFlow's compositional mechanism (defuns) is the