Help protect the Great Barrier Reef with TensorFlow on Kaggle

# tff.templates.MeasuredProcess

A stateful process that produces metrics.

Inherits From: `IterativeProcess`

This class inherits the constraints documented by `tff.templates.IterativeProcess`.

A `tff.templates.MeasuredProcess` is a `tff.templates.IterativeProcess` whose `next` computation returns a `tff.templates.MeasuredProcessOutput`.

Unlike `tff.templates.IterativeProcess`, the more generic but less-defined template, arbitrary `tff.templates.MeasuredProcess`es can be composed together as follows:

Guidance for Composition Two `MeasuredProcess`es F(x) and G(y) can be composed into a new `MeasuredProcess` called C with the following properties:

• `C.state` is the concatenation `<F.state, G.state>`.
• ```C.next(C.state, x).result == G.next(G.state, F.next(F.state, x).result).result```
• `C.measurements` is the concatenation `<F.measurements, G.measurements>`.

The resulting composition C would have the following type signatures: initialize: `( -> <F.initialize, G.initialize>)` next: ```(<<F.state, G.state>, F.input> -> <state=<F.state, G.State>, result=G.result, measurements=<F.measurements, G.measurements>)```

Note that the guidance for composition is not strict and details are allowed to differ.

`initialize_fn` A no-arg `tff.Computation` that returns the initial state of the measured process. Let the type of this state be called `S`.
`next_fn` A `tff.Computation` that represents the iterated function. The first or only argument must match the state type `S`. The return value must be a `MeasuredProcessOutput` whose `state` member matches the state type `S`.
`next_is_multi_arg` An optional boolean indicating that `next_fn` will receive more than just the state argument (if `True`) or only the state argument (if `False`). This parameter is primarily used to provide better error messages.

`TypeError` If `initialize_fn` and `next_fn` are not instances of `tff.Computation`.
`TemplateInitFnParamNotEmptyError` If `initialize_fn` has any input arguments.
`TemplateStateNotAssignableError` If the `state` returned by either `initialize_fn` or `next_fn` is not assignable to the first input argument of `next_fn`.
`TemplateNotMeasuredProcessOutputError` If `next_fn` does not return a `MeasuredProcessOutput`.

`initialize` A no-arg `tff.Computation` that returns the initial state.
`next` A `tff.Computation` that runs one iteration of the process.

Its first argument should always be the current state (originally produced by `tff.templates.MeasuredProcess.initialize`), and the return type must be a `tff.templates.MeasuredProcessOutput`.

`state_type` The `tff.Type` of the state of the process.

[{ "type": "thumb-down", "id": "missingTheInformationINeed", "label":"Missing the information I need" },{ "type": "thumb-down", "id": "tooComplicatedTooManySteps", "label":"Too complicated / too many steps" },{ "type": "thumb-down", "id": "outOfDate", "label":"Out of date" },{ "type": "thumb-down", "id": "samplesCodeIssue", "label":"Samples / code issue" },{ "type": "thumb-down", "id": "otherDown", "label":"Other" }]
[{ "type": "thumb-up", "id": "easyToUnderstand", "label":"Easy to understand" },{ "type": "thumb-up", "id": "solvedMyProblem", "label":"Solved my problem" },{ "type": "thumb-up", "id": "otherUp", "label":"Other" }]