# Lenses and Learners

@inproceedings{Fong2019LensesAL, title={Lenses and Learners}, author={B. Fong and Michael Johnson}, booktitle={Bx@PLW}, year={2019} }

Lenses are a well-established structure for modelling bidirectional transformations, such as the interactions between a database and a view of it. Lenses may be symmetric or asymmetric, and may be composed, forming the morphisms of a monoidal category. More recently, the notion of a learner has been proposed: these provide a compositional way of modelling supervised learning algorithms, and again form the morphisms of a monoidal category. In this paper, we show that the two concepts are tightly… Expand

#### Topics from this paper

#### Paper Mentions

#### 14 Citations

Supervised categorical learning as change propagation with delta lenses

- Computer Science, Mathematics
- ArXiv
- 2019

A notion of an asymmetric learning delta lens with amendment is defined, and how ala-lens can be organized into a symmetric monoidal category is shown, showing that sequential and parallel composition of well-behaved alA-lenses are also wb so that wb ala -lenses constitute a full sm-subcategory of ala. Expand

Backprop as Functor: A compositional perspective on supervised learning

- Computer Science, Mathematics
- 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)
- 2019

A key contribution is the notion of request function, which provides a structural perspective on backpropagation, giving a broad generalisation of neural networks and linking it with structures from bidirectional programming and open games. Expand

Multicategories of Multiary Lenses

- Computer Science
- Bx@PLW
- 2019

A class of asymmetric amendment lenses called spg-lenses (stable putget lenses) is introduced which is more general than well-behaved amendment lenses, but is closed under composition, and it is shown how to use spg -lenses to capture a wide class of mutidirectional transformations which compose well and form a well-known and long-standing structure, a multicategory — a multicategories of multiary lenses. Expand

L G ] 2 M ar 2 02 1 Categorical Foundations of Gradient-Based Learning

- 2021

We propose a categorical foundation of gradientbased machine learning algorithms in terms of lenses, parametrised maps, and reverse derivative categories. This foundation provides a powerful… Expand

Profunctor optics and traversals

- Computer Science, Mathematics
- ArXiv
- 2020

It is shown that a refinement of the notion of optic is required in order to model it faithfully in Haskell programming, and two different approaches to composition between profunctor optics of different families are given: using distributive laws between the monads defining them, and using coproducts of monads. Expand

Profunctor optics, a categorical update

- Computer Science, Mathematics
- ArXiv
- 2020

This work generalizes a classic result by Pastro and Street on Tambara theory and uses it to describe mixed V-enriched profunctor optics and to endow them with V-category structure. Expand

Category Theory in Machine Learning

- Computer Science
- ArXiv
- 2021

This work aims to document the motivations, goals and common themes across these applications of category theory in machine learning, touching on gradient-based learning, probability, and equivariant learning. Expand

Categorical Foundations of Gradient-Based Learning

- Computer Science, Mathematics
- ArXiv
- 2021

A categorical foundation of gradientbased machine learning algorithms in terms of lenses, parametrised maps, and reverse derivative categories is proposed, which encompasses a variety of gradient descent algorithms such as ADAM, AdaGrad, and Nesterov momentum. Expand

Mathematical background for statistical games 2 . 1 . Compositional probability , concretely and abstractly

- 2021

Operads for complex system design specification, analysis and synthesis

- Computer Science, Mathematics
- Proceedings of the Royal Society A
- 2021

It is argued that operads provide an effective knowledge representation to address scalability challenges for complex system design and recent progress in effective modelling is described. Expand

#### References

SHOWING 1-10 OF 14 REFERENCES

Symmetric lenses

- Computer Science
- POPL '11
- 2011

It is shown how the methods of universal algebra can be applied to build iterator lenses for structured data such as lists and trees, yielding lenses for operations like mapping, filtering, and concatenation from first principles. Expand

Unifying Set-Based, Delta-Based and Edit-Based Lenses

- Mathematics, Computer Science
- Bx@ETAPS
- 2016

A substantial unication with concrete inter-conversions developed among the three main approaches to lenses in both their symmetric and asymmetric forms is provided. Expand

Backprop as Functor: A compositional perspective on supervised learning

- Computer Science, Mathematics
- 2019 34th Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)
- 2019

A key contribution is the notion of request function, which provides a structural perspective on backpropagation, giving a broad generalisation of neural networks and linking it with structures from bidirectional programming and open games. Expand

Multicategories of Multiary Lenses

- Computer Science
- Bx@PLW
- 2019

A class of asymmetric amendment lenses called spg-lenses (stable putget lenses) is introduced which is more general than well-behaved amendment lenses, but is closed under composition, and it is shown how to use spg -lenses to capture a wide class of mutidirectional transformations which compose well and form a well-known and long-standing structure, a multicategory — a multicategories of multiary lenses. Expand

Symmetric delta lenses and spans of asymmetric delta lenses

- Computer Science
- J. Object Technol.
- 2017

The main result is an isomorphism of categories between a category whose morphisms are equivalence classes of symmetric delta lenses and the category of spans of delta lenses modulo the new equivalence. Expand

Combinators for bidirectional tree transformations: A linguistic approach to the view-update problem

- Computer Science
- TOPL
- 2007

A novel approach to the view-update problem for tree-structured data: a domain-specific programming language in which all expressions denote bidirectional transformations on trees that map a concrete tree into a simplified abstract view and a modified abstract view to a correspondingly modified concrete tree. Expand

Electronic Communications of the EASST Volume 57 ( 2013 ) Proceedings of the Second International Workshop on Bidirectional Transformations ( BX 2013 ) Delta lenses and opfibrations

- 2013

We compare the delta lenses, also known as d-lenses, of Diskin et al. with the c-lenses, known to be equivalent to opfibrations, already studied by the authors. Contrary to expectation a c-lens is a… Expand

Lenses and View Update Translation

- Computer Science
- 2003

We draw precise connections between lenses and some “classical” structures studied in the context of the view update translation problem: the notion of view update under a constant complement of… Expand

Lens put-put laws: monotonic and mixed

- Computer Science
- Electron. Commun. Eur. Assoc. Softw. Sci. Technol.
- 2012

It is shown that very well behaved lenses, which do satisfy the put-put law by definition, are algebras for a certain monad, and that this viewpoint admits fruitful generalisations of the lens concept to a variety of base categories. Expand

An Invitation to Applied Category Theory: Seven Sketches in Compositionality

- 2019

Category theory is unmatched in its ability to organize and layer abstractions and to find commonalities between structures of all sorts. No longer the exclusive preserve of pure mathematicians, it… Expand