What is a pure function?
A function whose outputs are based only on its inputs, and that has no side effects.
pure function explained in plain English
A function whose outputs are based only on its inputs, and that has no side effects. Specifically, a pure function doesn't use or change any global state, such as the contents of a file or the value of a variable outside the function. Pure functions can be used to create thread-safe code, which is beneficial when sharding model code across multiple accelerator chips. JAX's function transformation methods require that the input functions are pure functions.
Example
Practitioners refer to pure function when building, training, or evaluating machine learning systems. It appears in research papers, product documentation, and technical discussions about AI capabilities and limitations.
People also read
- accelerator chip
A category of specialized hardware components designed to perform key computations needed for deep learning algorithms.
- act
A stage in the agentic loop in which the agent executes the action chosen during the reason stage.
- Backpropagation
The process that tells a neural network which internal settings caused an error and how to adjust them, working backwards through layers.
- batch inference
The process of inferring predictions on multiple unlabeled examples divided into smaller subsets ("batches").
- broadcasting
Expanding the shape of an operand in a matrix math operation to dimensions compatible for that operation.
- checkpoint
Data that captures the state of a model's parameters either during training or after training is completed.
- compute
(Noun) The computational resources used by a model or system, such as processing power, memory, and storage.
- Einsum notation
An efficient notation for describing how two tensors are to be combined.
- feature engineering
A process that involves the following steps: 1.
- feedback
A stage in an agentic loop in which the agent evaluates the action taken during the act stage.