I am trying to use Federated code to build my own federated learning algorithm. But I met one problem. In the official tutorial, it define the Model Spec like following:
MODEL_SPEC = collections.OrderedDict(
filter1 = tf.TensorSpec(shape=weights[0].shape, dtype=tf.float32),
bias1 = tf.TensorSpec(shape=weights[1].shape, dtype=tf.float32),
filter2 = tf.TensorSpec(shape=weights[2].shape, dtype=tf.float32),
bias2 = tf.TensorSpec(shape=weights[3].shape, dtype=tf.float32),
weight1 = tf.TensorSpec(shape=weights[4].shape, dtype=tf.float32),
bias3 = tf.TensorSpec(shape=weights[5].shape, dtype=tf.float32)
)
MODEL_TYPE = tff.to_type(MODEL_SPEC)
I am wondering if it is required to input the model as an OrderedDict. Could I input the model as a trainable Keras model?
Thanks!