Slide 1

Slide 1 text

Causal Inference Engine Programming AI with Kotlin @davilagrau

Slide 2

Slide 2 text

1. Schedule AI paradigm programmed in Kotlin ➔ Introduction almo, open source and community ➔ Kotlin AI Java developers’ dream of a better programming language. ➔ Curve fitting vs Strong AI Machines with the sense of humans: mind over data ➔ Causal Inference Engine Answering the simplest question: Why?

Slide 3

Slide 3 text

Introduction: a.l.m.o Opensource Dev Communities

Slide 4

Slide 4 text

A few words about me... Andres-Leonardo Martinez-Ortiz a.k.a almo is a member of the Google Engineering team, leading Google Developer Relations worldwide. Based in Zurich, he drives the success of Google's developer products and the Open Web by creating a thriving ecosystem of developers. Nurturing developers experts and partners in large companies, startups, universities and enterprises, almo fosters open standards and Google technologies. almo is also a member of IEEE, ACM, Linux Foundation and Computer Society. @davilagrau almo.dev almo

Slide 5

Slide 5 text

Developers came together from all corners of the world to innovate, find connection, and solve problems*, using Internet and Open Source. *Octoverse 2020

Slide 6

Slide 6 text

Photo by Perry Grone on Unsplash Compartir Aprendiendo Aprender Enseñando Enseñar Aprendiendo

Slide 7

Slide 7 text

Koltin AI?

Slide 8

Slide 8 text

Why Kotlin? Easy learning curve Java interoperability Ecosystem support Educational resources: ● Kotlin Koans Multi platform The language of Android and server side, web or native applications Academically recognized Popular in the industry Multi paradigm Concurrent programming including corrutines and CSP Object oriented Higher order functions and Lambda functions

Slide 9

Slide 9 text

Curve fitting vs Strong AI Photo by Alora Griffiths on Unsplash

Slide 10

Slide 10 text

CSAT for computers, emperors and their new minds & Chinese rooms Thinking about intelligence: Philosophical foundations. Photo by K. Mitch Hodge on Unsplash

Slide 11

Slide 11 text

Superintelligent AI May Be Impossible to Control. Not even possible to know if an AI is superintelligent. https://spectrum.ieee.org/tech-talk/robotics/artificial-intelligence/super-artificialintelligence January 2021

Slide 12

Slide 12 text

Counterfactuals Activities: imagining, retrospective, understanding. What if I have done… ? Why? Was X the cause? Y? What if X has not occurred? What if I acted differently? Intervention Activities: doing, intervening. What if I do… ? How? What would Y be if I do X? How can I make Y happen? Association Activities: seeing, observing. What if I see…? How are the variables related? How would seeing X change my belief of Y? The Ladder of Causation

Slide 13

Slide 13 text

Causal Inference Engine Knowledge Assumptions Causal Model Testable Implication Query Can we answer? Back to 2 and 3 Estimand (Recipe) Data Statistical Estimation Estimate (Answer) 1 2 3 4 5 7 8 9 6 Yes No Inference Engine

Slide 14

Slide 14 text

Representing Knowledge in a Uncertain World Bayesian networks vs causality inference Mind over data “Causation is a language with which one can talk efficiently about certain structures of relevance relationships.” (1988) “The words embarrass me today ” (2018)

Slide 15

Slide 15 text

Causal Inference in Probability Trees Algorithms for Causal Reasoning in Probability Trees Genewein et al. (2020) DeepMind https://arxiv.org/abs/1911.10500

Slide 16

Slide 16 text

Definitions Algorithms for Causal Reasoning in Probability Trees Genewein et al. (2020) DeepMind https://arxiv.org/abs/2010.12237

Slide 17

Slide 17 text

Probability Trees Recursive definition Node n is a tuple n = (u,S,C) ● Id ● Statements list ● Transition list Transition list is a tuple (,) ∈ [0,1]xN ● transition probability ● Node m The root: ● Node without parents ● Statement “O=1” A leaf is a node with childs.

Slide 18

Slide 18 text

Events and min-cuts An event is a collection of total realization i.e. path from the root to a leaf. Formally, an event is a cut δ(, ) where the true set and the false set contains all the nodes where the event becomes true and false respectively. Critical nodes are Markov Blanket: all variables bound within a path from the root to the critical nodes are exogenous downstream.

Slide 19

Slide 19 text

Min-cuts Algorithms Bug: it should be V

Slide 20

Slide 20 text

Causal Events Precedence Bug: it should be e Bug: it should be e Note: the event where Y=1 precedes Z=0 cannot be stated logically. It is a causal event requiring a probability tree.

Slide 21

Slide 21 text

Causal Events Conditions Bug: it should be q Question: What is the probability of the event A given that the event B is true? Note: Downstream (prediction) or upstream (inference)

Slide 22

Slide 22 text

Causal Events Interventions Question: What is the probability of the event A given that the event B was made true? Note: only downstream (prediction)

Slide 23

Slide 23 text

Code AI Applications in Kotlin almo’s github repo https://github.com/almo https://gist.github.com/almo

Slide 24

Slide 24 text

Data Structure

Slide 25

Slide 25 text

Tree Definition

Slide 26

Slide 26 text

Initialization Root NodeID:01 Statement:[O,1] Transitions Statements:[(X, 0)] NodeID:01.0 P:0.4545 Statements:[(Y, 0)] NodeID:01.0.0 P:0.4000 Statements:[(Z, 0)] NodeID:01.0.0.0 P:0.5000 Statements:[(Z, 1)] NodeID:01.0.0.1 P:0.5000 Statements:[(Y, 1)] NodeID:01.0.1 P:0.6000 Statements:[(Z, 1)] NodeID:01.0.1.0 P:0.3333 Statements:[(Z, 0)] NodeID:01.0.1.1 P:0.6667 Statements:[(X, 1)] NodeID:01.1 P:0.5455 Statements:[(Z, 0)] NodeID:01.1.0 P:0.3333 Statements:[(Y, 0)] NodeID:01.1.0.0 P:0.5000 Statements:[(Y, 1)] NodeID:01.1.0.1 P:0.5000 Statements:[(Z, 1)] NodeID:01.1.1 P:0.6667 Statements:[(Y, 1)] NodeID:01.1.1.0 P:0.2000 Statements:[(Y, 0)] NodeID:01.1.1.1 P:0.8000

Slide 27

Slide 27 text

Min-cuts Algorithms Remember: it should be V

Slide 28

Slide 28 text

Causal Events Precedence Bug: it should be e Bug: it should be e

Slide 29

Slide 29 text

Causal Events Conditions Bug: it should be q

Slide 30

Slide 30 text

Causa Events Conditions Bug: it should be q

Slide 31

Slide 31 text

Causal Events Interventions

Slide 32

Slide 32 text

Causal Events Interventions

Slide 33

Slide 33 text

Further details Please check the reference[1] for additional details and consideration. Interesting analysis of the application in machine learning can be found in the reference [2] The Causal Inference Engine is work in progress. You can find the code at http:/ /bit.ly/2Mcrh4g Update and tech news in my twitter timeline @davilagrau [1] Algorithms for Causal Reasoning in Probability Trees Genewein et al. (2020) DeepMind https://arxiv.org/abs/2010.12237 [2] Causality for Machine Learning B. Schölkopf (2019) DeepMind https://arxiv.org/abs/1911.10500

Slide 34

Slide 34 text

Causal Inference Engine Programming AI with Kotlin @davilagrau Thank you! @davilagrau almo.dev almo