We're sorry but this page doesn't work properly without JavaScript enabled. Please enable it to continue.
Feedback

The power of duck typing and linear algrebra

Formale Metadaten

Titel
The power of duck typing and linear algrebra
Untertitel
How linear algebra and python make a good fit
Serientitel
Anzahl der Teile
611
Autor
Lizenz
CC-Namensnennung 2.0 Belgien:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen.
Identifikatoren
Herausgeber
Erscheinungsjahr
Sprache
Produktionsjahr2017

Inhaltliche Metadaten

Fachgebiet
Genre
Abstract
Algebraic operator are every where in python. + = * / Dict are every where inpython. What can we achieve by combining both of them? [Slides](http://jul.github.io/cv/pres.html#/init) are here ## Introduction Algebra is a wonderful abstraction that make the infamous 2D point example ofa class or nameddict useless when you have complex data type (that is HWaccelerated on Intel CPU). ## I Algebra 101 : it is all about consistency between symbol and behaviour Simple: Is something consistent with linear algebra? it requires 17 simpleunit tests suffice to say so So just let makes a test this rules are followed, and then a class thatapplies these behaviours and we have implemented it. ## II I have linear algebra behaviour. How useful can it be? Well, you have basic data type like { x: 1, y :2, z :3 } that is actuallybehaving like an euclidean vector. If an object is a MutableMapping thus we can create a universal operator forsaying how much an object «looks like» another one. Practical use : * finding doublons in database; * text matching (after a pass of ntlk + word counters); * pattern fitting; ... That is the basis of Textual indexation and profiling (it is not only for evilpurpose) https://github.com/jul/ADictAdd _iction/blob/master/example/cos_demo.py ## III State of the art of 2 working POC how to use MutableMapping (dict) andsuper Most of the operation tested here https://github.com/jul/ADictAdd_iction/ Implementation as a trait here https://github.com/jul/archery Basically it works BUT : 1. it is hard : with archery I stumbled on super 2. with VectorDict (obsolete) it lacks of genericity and the code is clumsy 3. python 2 div behaviour was screwing this (and since these library were relying on base operator, I got biten) Prepare to throw 2 away ## IV the future A chain is as strong as its weakest link : if a lib is based on composing thepython based operator, the algebra will be as consistent as the CORE behaviourof the operator in the language. ## Conclusion Algebra is a powerful abstraction that is still underused. Possible development : \- Rieman/Hermitian algebra: using the power of themath used in Quantum Mechanics/relativity and python in the same fashion \-Using Quaternion to have quirkless rotation in euclidean 3D...