Understanding stateful and stateless functions
Before discussing states in machine learning, we should first understand what stateful functions are and how stateful functions can involve difficulties in serving the function to clients. Therefore, let’s begin by developing a clear understanding of stateful and stateless functions and the differences between them in this section.
Stateless functions
A stateless function does not have any state within the function that can impact the behavior of the function. The output of the function will be the same if the same input is provided. It will also be independent of the platform where the function is stored.
Stateless functions can behave as pure functions. A pure function has the following properties:
- A pure function’s output is identical with identical input. So, y = f(x) is always true. For the same input x, the output is always y. No internal states or variables impact the output and the output is deterministic...