def deserialize(cls, serialized): """Deserializes the DDNN from the Protobuf format.""" activation_layers = serialized.activation_layers activation_layers = Network.deserialize_layers(activation_layers) value_layers = serialized.value_layers value_layers = Network.deserialize_layers(value_layers) differ_index = serialized.differ_index value_layers = activation_layers[:differ_index] + value_layers return cls(activation_layers, value_layers)
def deserialize(cls, serialized): """Deserializes the layer. """ if serialized.WhichOneof("layer_data") == "concat_data": from pysyrenn.frontend.network import Network layers = Network.deserialize_layers(serialized.concat_data.layers) concat_along = ConcatAlong.deserialize( serialized.concat_data.concat_along) return cls(layers, concat_along) return None