Category Archives: lecture
Infinite Data Structures
Functions are essentially infinite pairs of input and output, so why not have data with infinite components? Some examples The infinitely long list of spaces: white :: String — Remember a string is a list of characters white = ' … Continue reading
Decomposable Models and Join Forests
Previously Triangulating a graph. Is it me or does that just mean removing squares in the graph (yes, no cycles of 4 or more)? You do it by removing vertexes, and you have to add fill in lines. Where is … Continue reading
Determinism and non-determinism
This is fairly obvious but: Determinism – given a pre-state and a collection of inputs there is at most one post-state and collection of outputs allowed by the system. It rarely makes a good description of what the system is … Continue reading
Removing Pointless Code
Lambda functions Backslash in Haskell is lambda, e.g. (\x c -> x == e || c) Removing pointless stuff Here’s an example: reverse xs = foldl snoc [] xs where snoc ys y = y : ys reverse = foldl … Continue reading
Variable Elimination
(Sometimes called ‘The Sum Product Algorithm’) The basic ‘inference problem’ in graphical models is – given a joint distribution, you want to compute the marginal distribution for a given variable. One option – multiply out all factors and marginalise on … Continue reading
Locality
Summary Locality of names Generalisation as a programming tactic, and generalisation in Haskell. Local Definitions Haskell can support local definitions. I used this in the practical. It takes the form: equation where local equations You can also use let, not … Continue reading
Higher Order Functions
Recap about list reversal Something to bear in mind – if the list seems to be in the wrong order, use an accumulator to reverse as you go along. Higher order functions (with regards to generalisation) Remember that a higher … Continue reading
Conditional Independence in Factored Distributions
Summary of how far we got Have been talking about factors and how one can marginalise factors (removing variables) but also do multiplication and division of them. Probably should look up why you do multiplication and division of factors? I … Continue reading
Checking Properties
Alloy has two commands for checking the ‘world’: check check asks if a property is true in every world in the collection described by the format text (code). It tries to find a counter example, and if you ask it … Continue reading
Alloy Syntax Stuff
All of this stuff is Alloy syntax stuff. Composite Predicates (simplified BNF) – pretty obvious, just explaining standard syntax of predicates (BNF = grammar defining predicates) Alloy (the software we use) has a ‘rich collection’ of quantifiers that can be … Continue reading