The author explores deep learning through the lens of set theory, defining a neural network as a mathematical function. This approach focuses on the properties of mappings between sets rather than computational implementation details like matrix multiplication or specific library functions.
A function is defined as a mapping from a domain set X to a codomain set Y. The graph of a function is a subset of the Cartesian product of these sets, where every element in X corresponds to exactly one element in Y. This definition remains valid regardless of the internal complexity of the calculation.
The author demonstrates these concepts using Python code, showing how to verify if a relation qualifies as a function. By checking that each input has exactly one output, one can distinguish a valid function from an incomplete or ambiguous relation, regardless of whether the inputs are numbers, images, or text.
This conceptual framework aims to demystify deep learning components, such as the attention mechanism in transformers. By treating models as functions, the author intends to explain how neural networks process data and learn, moving away from viewing formulas as arbitrary memorization tasks.






