šŸ’¾ Archived View for gemini.rawles.net ā€ŗ blog ā€ŗ 2020 ā€ŗ 06 ā€ŗ 08 captured on 2021-12-03 at 14:04:38. Gemini links have been rewritten to link to archived content

View Raw

More Information

-=-=-=-=-=-=-

Monday notes from 8 June 2020

(updated 2020-06-08)

It's a bit of a long one this week. I think I've just had a lot of coffee!

GO. I had my second 13Ɨ13 go gameā½įµƒā¾ over the course of the last week. Like no other game I've played, go has this property of unfolding itself to you as you play, and each game is an education. Compared to my first 13Ɨ13 gameā½įµ‡ā¾, the main lessons ā€” whether from mistakes or from successes ā€” were:

(a) online-go.com ā€” via https

(b) online-go.com ā€” via https

I am improving at reading ahead, especially when using the analyserā½įµƒā¾. Doing so seems to reveal small patterns and move sequences that act as little lessons. Chrisā½įµ‡ā¾ is open to undoing moves if we would learn something from the undoing, and we've now rewound and started playing a fork of the second gameā½į¶œā¾ from a critical point.

(a) forums.online-go.com ā€” via https

(b) online-go.com ā€” via https

(c) online-go.com ā€” via https

Given these lessons, the next goal for me is to learn a few of the basic eye shapesā½įµƒā¾. There are a few hundred strong eye shapesā½įµ‡ā¾, but at my level, apparently, the basic five will make a big difference.

(a) senseis.xmp.net ā€” via https

(b) senseis.xmp.net ā€” via https

I've also tried to get my nephew into go by introducing him to atari goā½įµƒā¾ via the Goban app on my computerā½įµ‡ā¾. He internalised and applied the basic rules within minutes, doing well in a game or two of atari go on a 7Ɨ7 board, but after I called it 'THE board game' (a paraphrasing of BoardSpace's opinionā½į¶œā¾), he declared it 'THE worst board game... with pebblesā½įµˆā¾'. I still have a bit of work to get him into itā½įµ‰ā¾. I have ordered an simple go set from Hoyle'sā½į¶ ā¾, since I think maybe it'll be more enjoyable to play away from the computer. We'll see ā€” I won't give up!

(a) senseis.xmp.net ā€” via https

(b) sente.ch ā€” via http

(c) boardspace.net ā€” via http

(d) senseis.xmp.net ā€” via https

(e) senseis.xmp.net ā€” via https

(f) hoylesoxford.com ā€” via https

HASKELL. My simple GPS trails app is plodding along. I'm not really adding much in the way of features, more that I'm trying to prune and tweak the code ā€” AST topiary ā€” to make it more concise and functional. As an erstwhile Prolog guyā½įµƒā¾, I'm used to recursionā½įµ‡ā¾, but converting things to foldsā½į¶œā¾ where possible really made things look nice.

(a) cis.upenn.edu ā€” via https

(b) en.wikibooks.org ā€” via https

(c) learnyouahaskell.com ā€” via http

I wanted to go somewhere else with my Haskell, though, and on Sunday afternoon I started experimenting with algebra in Haskell. I'd enjoyed learning about structures like monoidsā½įµƒā¾, and I wanted to see how some other algebraic structures could be defined and implemented.

(a) learnyouahaskell.com ā€” via http

The Haskell Prelude is a moduleā½įµƒā¾ which contains the basic, standard definitions. They are seen by many as not ideal for working with abstract structures. It's imported by default, but fortunately you can disable thatā½įµ‡ā¾ and use your own Prelude ā€” your own custom Preludeā½į¶œā¾ to suit your application and your philosophy on the structure of types within it. Numeric Preludeā½įµˆā¾ provided a re-orientation toward abstract structures, in the words of its package description, 'an experimental alternative hierarchy of numeric type classesā½įµ‰ā¾'. Algebraic Preludeā½į¶ ā¾ is another drop-in replacement for Prelude based based on the algebraic hierarchy provided by the `algebra` packageā½įµā¾ for constructive abstract algebra.

(a) hackage.haskell.org ā€” via https

(b) wiki.haskell.org ā€” via https

(c) stephendiehl.com ā€” via https

(d) wiki.haskell.org ā€” via https

(e) hackage.haskell.org ā€” via https

(f) hackage.haskell.org ā€” via https

(g) hackage.haskell.org ā€” via https

More generally, Haskell is sometimes recommended for mathematical work, or at least for mathematiciansā½įµƒā¾, even though purpose-built languages like Macaulay2ā½įµ‡ā¾ are out there. And functional programming is most often connected with logic ā€” not least because of the Curry-Howard isomorphismā½į¶œā¾ ā€” and category theoryā½įµˆā¾, but I'm more talking about using Haskell to explore mathematics, rather than using mathematics to understand Haskell. So it's time for another project.

(a) blog.sigfpe.com ā€” via http

(b) faculty.math.illinois.edu ā€” via https

(c) en.wikipedia.org ā€” via https

(d) en.wikibooks.org ā€” via https

MACHINE LEARNING. I think I should start with something simple and familiar, so I'm going to try to code up, in a general way, a version space learnerā½įµƒā¾, a concept learner. It's a binary classifier, that is, a learner that decides whether an instance is to be labelled as one thing or the other. This kind of learning was the first topicā½įµ‡ā¾ in the first textbook we studied in my machine learning MSc course twenty years ago! It's summarised well in the slides for that chapterā½į¶œā¾.

(a) en.wikipedia.org ā€” via https

(b) cs.cmu.edu ā€” via https

(c) cs.cmu.edu ā€” via https

So, a quick overview of the ideas:

(a) en.wikipedia.org ā€” via https

(a) en.wikipedia.org ā€” via https

(a) people.cs.bris.ac.uk ā€” via http

(a) ams.org ā€” via http

(b) doi.org ā€” via https

The logical language in the most basic implementation of all this would be just propositionalā½įµƒā¾. That is, the examples are just yes/no values describing aspects of the weather (sunny? rainy? snowing?). However, you could use any suitable logical language, as long as you could decide generality between the descriptions. Inductive logic programmingā½įµ‡ā¾, one of the focuses of my PhD thesisā½į¶œā¾, commonly uses first-order Horn clausesā½įµˆā¾ instead.

(a) en.wikipedia.org ā€” via https

(b) en.wikipedia.org ā€” via https

(c) pub.rawles.net ā€” via https

(d) en.wikipedia.org ā€” via https

Learning in this way isn't exactly popular, and one reason for that is that version space learning doesn't handle noiseā½įµƒā¾. It fits the data perfectly, and that means encountering any two examples which are inconsistent just result in an empty version space. From there you can't really learn anything! Although this learning strategy has been generalised to noisy dataā½įµ‡ā¾, the setting I lay out above is far too limited to be useful for real-world learning. But, it's a start.

(a) en.wikipedia.org ā€” via https

(b) doi.org ā€” via https

So, coming back to my Haskell mini-project, I'm going to be basically playing with lattices or partially ordered setsā½įµƒā¾ at one level, and propositional and perhaps other logics at another. Lattices are modelled by the `Algebra.Lattice`ā½įµ‡ā¾ module inside Numeric Prelude, but, playing around a bit, it seems that the `Ord` classā½į¶œā¾ is the only way of representing an order, and it must be total. `algebra` supports partial ordersā½įµˆā¾, but there's a purpose-built `lattices` packageā½įµ‰ā¾ which looks more fine-grainedā½į¶ ā¾ and useful for this application. I plan to try both `algebra` and `lattices`, just to get a feel for things. The basic mechanics of the logic can be handled by, for example, `logic-classes`ā½įµā¾, though I could just code up the propositional case myself. If I can keep the two layers separate I might be able to do some cool tricks.

(a) math.usm.edu ā€” via https

(b) hackage.haskell.org ā€” via https

(c) hackage.haskell.org ā€” via https

(d) hackage.haskell.org ā€” via https

(e) hackage.haskell.org ā€” via https

(f) github.com ā€” via https

(g) hackage.haskell.org ā€” via https

And, as you'd expect, all this has been done already in `AI.VersionSpaces`ā½įµƒā¾, so none of this is remotely ground-breaking except for me. But I hope it'll serve as a familiar place from which to explore working with algebraic structures with Haskell, from which I can head out into less familiar territory.

(a) hackage.haskell.org ā€” via https

To support this interest in maths and logic with Haskell, I'm also going to try to read at least a couple of chapters of The Haskell Road to Logic, Maths and Programmingā½įµƒā¾ by Jan van Eijckā½įµ‡ā¾ and Kees Doets. In the preface it states:

(a) staff.fnwi.uva.nl ā€” via https

(b) staff.fnwi.uva.nl ā€” via https

The purpose of this book is to teach logic and mathematical reasoning in practice, and to connect logical reasoning with computer programming.

and later,

The subject of this book is the use of logic in practice, more in particular the use of logic in reasoning about programming tasks. Logic is not taught here as a mathematical discipline per se, but as an aid in the understanding and construction of proofs, and as a tool for reasoning about formal objects like numbers, lists, trees, formulas, and so on. As we go along, we will introduce the concepts and tools that form the set-theoretic basis of mathematics, and demonstrate the role of these concepts and tools in implementations. These implementations can be thought of as REPRESENTATIONS of the mathematical concepts.

This sounds ideal.

BEEKEEPING. I've been looking after my nephew on some of the afternoons this week, too. We've slowly been working our way through building a Bees on a Budgetā½įµƒā¾ hive for the next swarm. It may require only a basic level of carpentry to assemble one of these, but it's good practice for both me and him.

(a) thorne.co.uk ā€” via https

We hope it'll be put in the apiary early this week, or later this week if we opt to stain it.

SCREEN TIME. The pandemic lockdown is still mostly in force in England, and is even stricter in the other countries of the United Kingdom. Since its sixth day, a few friends (initially me, Hollyā½įµƒā¾ and Redā½įµ‡ā¾) have been holding a virtual cinemaā½į¶œā¾.

(a) soundcloud.com ā€” via https

(b) someplacenice.co.uk ā€” via https

(c) rawles.org.uk ā€” via https

Using streaming services synchronised by a countdown, we'll watch one or two films a week, with a beer or wine in one hand and in the other, a device connected to our chatroom. The films have so far formed thematic triples (or quadruples): folk horrorā½įµƒā¾, neon noir, gems of the Hollywood left, or Lynchā½įµ‡ā¾.

(a) bfi.org.uk ā€” via https

(b) lynchnet.com ā€” via http

So far we've watched a dozen films, but by far the favourites have been those by Ari Asterā½įµƒā¾. We are all fans of horror, and for us, these were absolute cinematic nightmares. So far Aster has made two feature-length films, Hereditaryā½įµ‡ā¾ (2018) and Midsommarā½į¶œā¾ (2019). Both are beautifully paced, shot and performed. Neither gives away everything on the first viewing, but enough to creep you out, so you won't necessarily want to watch either again right away!

(a) twitter.com ā€” via https

(b) a24films.com ā€” via https

(c) a24films.com ā€” via https

When the lockdown began, we half-joked that we'd like to put on a folk horror film festival in an old creepy country pub somewhere in the middle of nowhere. I hope we do that.

(I updated some of the explanations in this note thanks to some feedback from Tim ā€” thanks, Tim!)

ā–£

You are here:

rawles.net

ā†³ blog

Ā· Ā· ā†³ 2020

Ā· Ā· Ā· Ā· ā†³ June

Ā· Ā· Ā· Ā· Ā· Ā· ā†³ 8th