# tff.learning.models.model_from_functional

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/federated/blob/v0.87.0 Version 2.0, January 2004 Licensed under the Apache License, Version 2.0 (the) |

Converts a `FunctionalModel` to a [`tff.learning.models.VariableModel`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/models/VariableModel).

    tff.learning.models.model_from_functional(
        functional_model: https://www.tensorflow.org/federated/api_docs/python/tff/learning/models/FunctionalModel,
        metric_constructors: Sequence[Callable[[], tf.keras.metrics.Metric]] = ()
    ) -> https://www.tensorflow.org/federated/api_docs/python/tff/learning/models/VariableModel

> [!WARNING]
> **Warning:** The `metrics_constructors` argument will *replace* any metrics that were originally attached to the `FunctionalModel` with new metrics.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `functional_model` | A [`tff.learning.models.FunctionalModel`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/models/FunctionalModel) to convert. |
| `metric_constructors` | An optional sequence of callables that return newly constructed [`tf.keras.metrics.Metric`](https://www.tensorflow.org/api_docs/python/tf/keras/Metric) objects to attached to the output [`tff.learning.models.VariableModel`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/models/VariableModel). |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A new [`tff.learning.models.VariableModel`](https://www.tensorflow.org/federated/api_docs/python/tff/learning/models/VariableModel) with the same behavior as `functional_model`. ||

<br />