"We're here to go."
http://tomhume.org
2024 in the rear-view<p>2024 was mostly a work year. I described work as “exhilarating and exhausting” <a href="https://www.tomhume.org/2023-redux/">a year ago</a>, and those words remain a pretty good descriptions. While our group in GDM came together mid-2023 with the first merger of Google Brain and DeepMind, it felt like we started firing on all cylinders this year. We released continuously throughout 2024, but there were a couple of days where many strands of work came together. First was Google I/O in May, where we <a href="https://techcrunch.com/2024/05/14/google-veo-a-serious-swing-at-ai-generated-video-debuts-at-google-io-2024/">announced</a> our video model Veo, plus a new (state-of-the-art) Imagen 3, and <a href="https://yt.be/musicaidemos">talked</a> about Music AI Sandbox, a set of AI tools built with and for musicians. Then in December we followed up with <a href="https://deepmind.google/technologies/veo/veo-2/">Veo 2</a> (which we believe is the best video model out there) and made it available to a broader set of folks, plus an improved Imagen. I’ve seen some incredible <a href="https://vimeo.com/1047370252">works</a> created using Veo, and I’m excited to see what gets made with it this year.</p>
<p align="center">
<iframe width="560" height="315" src="https://www.youtube.com/embed/G9RDHs9nx04?si=fvkmJWmWs-eeHXhJ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share" referrerpolicy="strict-origin-when-cross-origin" allowfullscreen=""></iframe>
</p>
<p>Between these we put image, video and music generation in the hands of <a href="https://blog.youtube/news-and-events/made-on-youtube-2024/">YouTube users</a> and <a href="https://cloud.google.com/blog/products/ai-machine-learning/introducing-veo-and-imagen-3-on-vertex-ai">Cloud customers</a>, shipped a novel and quite fun live-music creation tool (<a href="https://labs.google/musicfx">MusicFX DJ</a>), and more (notably, our researchers contributed the incredibly realistic dialogs which power the podcasts <a href="https://notebooklm.google">NotebookLM</a> makes). And of course all this only happens thanks to teams of researchers coming together, gelling, and quietly making the advances which power all this - launches are often the end result of years of effort, and build on a ton of past work.</p>
<p>This was also the year I ended up managing full-time; I’d gathered a few reports by the end of 2023, but my team grew a little, and matured a lot (myself included) through 2024. I bumped up to Director and will spend the next year working out what that means.</p>
<p>Generative media is an interesting space: challenging from many different angles, often controversial, and with a ton of promise - watching film-makers pick up on Veo 2 has been particularly exciting over the last few months. I remain excited and grateful to be working here, on this, now. During the summer I bumped into an old friend, who knew me as a teenager and reminded me that I had been enthusiastic about AI way back then - nearly 40 years ago now - and going through some old papers, I found cuttings from the New Scientist sent to me by my uncle and aunt in 1992.
<a href="https://photos.app.goo.gl/8GUTz5qkVQ3p4RC18">New item by Tom Hume</a></p>
<p>Most things took a back seat to work this year. In particular Strava’s end-of-year report enthusiastically congratulated me on doing about 2/3 as much exercise in 2024 as in 2023. Karate in particular dropped off a lot, and I didn’t manage to make it back to Japan to retake my shodan - definitely one for 2025. Bright points here were a couple of courses in Petaluma with Rick Hotton, a really interesting teacher (and phenomenal example of body mechanics) who’s cross-trained in karate and aikido, and whose style of teaching reminds me fondly of Tom Helsby from Airenjuku Brighton. I also continue to find Saturday mornings, where I help teach the kid’s class at Zanshin dojo, extremely rewarding.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/pw/AP1GczM_NFE1AEjSJCttr4O08QN_Vn5aSKhqzjGYF-Ac87z_QcMNr8Eihh-cNAsIvtJtVf3-Fz-Hg6rxV78Lv19sFBHGSKwCZ5aiaUIPIMMsKAQi34ebJuLh=w2400" target="_blank">
<img style="width:100%;border:0;" alt="Spring Keiko with Rick Hotton, Petaluma" src="https://lh3.googleusercontent.com/pw/AP1GczM_NFE1AEjSJCttr4O08QN_Vn5aSKhqzjGYF-Ac87z_QcMNr8Eihh-cNAsIvtJtVf3-Fz-Hg6rxV78Lv19sFBHGSKwCZ5aiaUIPIMMsKAQi34ebJuLh=w2400" />
</a>
</div>
<p>An old friend, someone I was once very close to, died suddenly and shockingly in April; an extremely sad story, the one bright point of which was reconnecting with a couple of faces from my early 20s.</p>
<p>Another old friend visited us early Summer; Pride and July 4th make fantastic book-ends for a trip to San Francisco.</p>
<p>We spent the rest of summer in Brighton (OK, Worthing) again, near to family and friends. A big group of family gathered in July for Dad’s 80th, which was lovely; and I traveled up to Warwickshire to see a beloved aunt, and thereon to Yorkshire for <a href="https://www.orbific.com">Mr Burt</a> and another old friend, around beautiful Hebden Bridge.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/pw/AP1GczPOx7mYYf3_4jIJEBdnsK0t7B8sDfsToHMnPrwpW2NOvmGjqMLz9lSGTeM2U-dwJ3pXwnsFl7RLYe3jByIuP42HdANVB1fgULhMQyS6eCPOMtFZNccn=w2400" target="_blank">
<img style="width:100%;border:0;" alt="Enjoying a canalside walk in Hebden Bridge" src="https://lh3.googleusercontent.com/pw/AP1GczPOx7mYYf3_4jIJEBdnsK0t7B8sDfsToHMnPrwpW2NOvmGjqMLz9lSGTeM2U-dwJ3pXwnsFl7RLYe3jByIuP42HdANVB1fgULhMQyS6eCPOMtFZNccn=w2400" />
</a>
</div>
<p>Album of the year was <a href="https://plzmakeitruins.bandcamp.com/album/the-head-hurts-but-the-heart-knows-the-truth-3">The Head Hurts but the Heart Knows the Truth</a> by Headache - reminsicent of Blue Jam, dream-like ambient background noise with a middle-aged British guy bemoaning his lost youth in a self-obsessed fashion. No sniggering at the back, please. Song of the year was <a href="https://www.youtube.com/watch?v=-n-VKaTMmkU">Ministry by Karen O and Dangermouse</a>.</p>
<p>I continued to shepherd the <a href="https://www.meetup.com/san-francisco-cognitive-science-meetup-group/?eventOrigin=home_groups_you_organize">San Francisco Cognitive Science Reading Group</a>, mostly monthly; we went bi-monthly towards the end of the year as work got busy, I hope to return to monthly in 2025. We read:</p>
<ul>
<li>“<a href="https://www.fil.ion.ucl.ac.uk/~karl/A%20free%20energy%20principle%20for%20the%20brain.pdf">A Free Energy Principle for the Brain</a>” by Karl Friston, a recurrent name in our various meetings who we finally started to grapple with. Introduces his ideas (tldr organisms act to minimize “surprise” between what they sense and what they expect by either updating their models of the world or acting on it to bring it in line with their expectations), but like every explanation I’ve read of them, gets technical quickly and is hard work in general.</li>
<li>“<a href="https://www.amazon.com/Brief-History-Intelligence-Humans-Breakthroughs/dp/0063286343">A Brief History of Intelligence</a>” by Max Bennett. By far the best book of the year, by virtue of being interesting in its narrative (tracking the places in evolution where pressures forced the development of specific cognitive capabilities) and by being incredibly well-written. Our group judged it the best book of the year; one member, who spent time at MIT CSAIL in the 70s, judged it the best book he had ever read. So thought-provoking we spent 4 sessions working through it. I cannot recommend this book highly enough.</li>
<li>“<a href="https://www.nature.com/articles/s41586-024-07522-w">Language is primarily a tool for communication rather than thought</a>” (Ev Federenko et al.). Enjoyable, persuasive, felt like the settling of a long-running debate rather than introducing novel ideas - but that’s useful too.</li>
<li>“<a href="https://www.amazon.com/Vehicles-Experiments-Psychology-Valentino-Braitenberg/dp/0262521121">Vehicles</a>” by Valentino Braitenberg, a delightful book structured as a sequence of thought experiments around simple organisms which, as they get more complex through the book, exhibit more complex behaviours that suggest psychology.</li>
</ul>
<p>I started 29 books, finished 22 of them, 3 are still in progress. The rest I gave up on, either consciously or otherwise. Outside those above, some highlights:</p>
<ul>
<li><a href="https://www.amazon.com/Blindsight-Peter-Watts/dp/0765319640">Blindsight</a>, by Peter Watts - excellent hard science fiction, intelligence without consciousness as a key character, horrifically unsentimental in parts with a large set of academic references at the back.</li>
<li><a href="https://www.amazon.com/Living-Earth-Forests-Corals-Consciousness-ebook/dp/B0CSBNY9L3">Living on Earth</a>, by Peter Godfrey-Smith. Takes the perspective of the earth as a system, wuth intelligence as a cause of action rather than a goal in itself (a change of posture from his previous books). Lost me in the middle, but ends with some interesting meditations on the ethics of intervening in nature, and the observation that what distinguishes us from other hominids is our ability for tolerance of one another, perhaps not how it feels like from the news.</li>
<li><a href="https://www.amazon.com/Wicked-Weird-Amazing-Tales-Buck/dp/0385679726">Wicked and Weird</a> by Buck 65, a hallucinatory biography from a man whose imagination is better than his memory. No idea how much is true but once I stopped worrying about that,</li>
<li><a href="https://www.amazon.com/Less-is-More/dp/1786091216">Less is More</a> by Jason Hickel. I went into this one, an argument for degrowth, sceptical - someone whose opinion I value had read it and was debating me while grounded in it, so I wanted to understand better. I found some superficial aspects easy to agree with (growth can’t go on forever, waste in the economy is bad, socialized healthcare is good) but came away unconvinced. I’ve been near enough consumer electronics to know that planned obsolence isn’t planned; he doesn’t acknowledge any environmental progress (London smog, the hole in the ozone layer); his passion for, and connection of everything with, animism just bewildered me. One part which did surprise me, and worried me, was his observation that growth in clean energy is being outpaced by overall energy usage. (I checked with OurWorldInData and yup, it is).</li>
<li><a href="https://www.amazon.com/Hillbilly-Elegy-Memoir-Family-Culture/dp/0062300555/">Hillbilly Elegy</a> by JD Vance. The pre-Trump JD Vance came across pretty well, I thought. It’s a well-told tale of growing up in poverty, the difficulties of getting out, how hard it is to climb into a new culture, how the lack of a family hurt him and his extended family helped.</li>
<li><a href="https://www.amazon.com/Finally-Matters-Life-Death/dp/1250286085/">And Finally</a>, by Henry Marsh, author of the incredible <a href="https://www.amazon.com/Do-No-Harm-Stories-Surgery/dp/125009013X/">Do No Harm</a> (tldr a neurosurgeon discusses his successes and failures). In this one, also autobiographical, Marsh transitions from doctor to patient as he’s diagnosed with cancer, calling into question his own bed-side manner with patients past. “Empathy, like exercise, is hard work and it is normal and natural to avoid it”</li>
</ul>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/pw/AP1GczMoKcS8UmKzSomZkhGwt9CVKqpTq6AYCYfM24mM_RnXGufd1sLdkXgSW7CXrlBxVBKGJkLYTpUbS1dZCySJe9hoE3CjRBb12KUnzXIBFuolY2FiZMY5=w2400" target="_blank">
<img style="width:100%;border:0;" alt="The Maker Faire" src="https://lh3.googleusercontent.com/pw/AP1GczMoKcS8UmKzSomZkhGwt9CVKqpTq6AYCYfM24mM_RnXGufd1sLdkXgSW7CXrlBxVBKGJkLYTpUbS1dZCySJe9hoE3CjRBb12KUnzXIBFuolY2FiZMY5=w2400" />
</a>
</div>
Mon, 20 Jan 2025 00:00:00 +0000
http://tomhume.org/2024-redux/
http://tomhume.org/2024-redux/Energy Efficiency drives Predictive Coding in Neural Networks<p>I don’t remember how I came across it, but <a href="https://scholar.google.com/scholar?hl=en&as_sdt=0%2C5&q=Predictive+coding+is+a+consequence+of+energy+efficiency+in+recurrent+neural+networks&btnG=">this</a> is one of the most exciting papers I’ve read recently. The authors train a neural network that tries to identify the next in a sequence of MNIST samples, presented in digit order. The interesting part is that when they include a proxy for energy usage in the loss function (i.e. train it to be more energy-efficient), the resulting network seems to exhibit the characteristics of predictive coding: some units seem to be responsible for predictions, others for encoding prediction error.</p>
<p>Why is this exciting?</p>
<ul>
<li>It proposes a plausible mechanism by which predictive coding would arise in practice.</li>
<li>It shows an existence proof of this (well, two actually: one for MNIST and one for CIFAR images)</li>
<li>It lines up artificial neural networks to theses around predictive coding from Andy Clark etc.</li>
</ul>
<p>I grabbed the <a href="https://github.com/KietzmannLab/EmergentPredictiveCoding">source code</a>, tried to run it to replicate, and hit some issues (runtime errors etc), so have forked the repo to fix these, and also added support for the MPS backend (i.e. some acceleration on a Mac M1) which sped things up significantly - see my fork <a href="https://github.com/twhume/EmergentPredictiveCoding/">here</a>.</p>
<p>But lots of directions to go from here:</p>
<ul>
<li>I’d like to reimplement this in a framework like Jax, both to simplify it a little and to check I really understand it (and Jax)</li>
<li>Does this approach work for more complex network architectures? For other tasks?</li>
</ul>
<p>In the spirit of making it all run faster, I tried implementing early stopping (i.e. if you notice loss doesn’t keep falling, bail - on the basis you’ve found a local minima). Interestingly, it seemed that if I stopped too early (e.g. after just 5-10 epochs of loss not dropping) my results weren’t as good - i.e. the training process needs to really plug away at this fruitlessly for a while before it gets anywhere.</p>
Fri, 29 Dec 2023 00:00:00 +0000
http://tomhume.org/energy-efficiency/
http://tomhume.org/energy-efficiency/Ending 2023<p>2023 brought enough disruption and disappointment that I struggle to look back on it with much warmth. At the same time, I’ve many reasons to be grateful it wasn’t worse.</p>
<p>The year started with my beloved manager leaving Google, and then the layoffs hitting. I found the latter shocking, partly because I’d never worked in a company which had gone through them before, but also because there seemed plenty of room for improvement in how they were done. I woke up one morning to find colleagues - including some loyal, talented, productive long-time employees who I felt epitomized Google culture - had effectively been vanished overnight. I’m still bothered by this; while I can understand that it might be necessary, the way it was done seemed to fall short of the high standards Google sets for itself elsewhere. I chatted to a friend who works at Facebook, and what they described of their own layoffs seemed more compassionate. It doesn’t feel good to be beaten by Zuck on empathy.</p>
<p>A few slightly rudderless months followed; my responsibilities were a little diffuse and I lost a little passion for a new mission my group had taken up. In May an opportunity came up to move when the Google Brain/DeepMind merger occurred, and I shuffled into Google DeepMind, where I’m working now. It’s been interesting to shift sideways into a slightly different culture, and I’m finding it often refreshing, sometimes exhilarating, occasionally exhausting - and on balance am very happy to be there. I work in our generative media group, which is an interesting place to be right now, and have taken on more management responsibilities, something I’ve been wanting to do for a little while. Much of my work this year was <a href="https://deepmind.google/discover/blog/transforming-the-future-of-music-creation/">around music</a>, which enjoys both particular complexities and <a href="https://www.youtube.com/watch?v=rrk1t_h2iSQ">opportunities</a>. I remain grateful to be working at the coal-face of AI, this decade.</p>
<p>Life outside work was similarly chaotic. Works on our home are about to enter their second year, and we’ve, depressingly, had the “architect and contractor pointing fingers of blame at each other” stage. I am hopeful that this will all conclude in the first quarter of 2024 and we can forget about it. More positively, our roof is now festooned with solar panels and a huge battery sits on our garage wall, which together seem to more than cover our energy needs for 9 months of the year.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/pw/ABLVV84MbyHxMK70hSkUsVxSLLdY-ywrFu9a43IVtRurlJr8lKqLtmAj4K_E36I6ZefKh4km-gV-0wux49b0Ik1tLSbWzqHTQLH_RtkMf1x-OL2mGpfdZ2RK=w2400" target="_blank">
<img style="width:100%;border:0;" alt="Budokan training hall, Naha" src="https://lh3.googleusercontent.com/pw/ABLVV84MbyHxMK70hSkUsVxSLLdY-ywrFu9a43IVtRurlJr8lKqLtmAj4K_E36I6ZefKh4km-gV-0wux49b0Ik1tLSbWzqHTQLH_RtkMf1x-OL2mGpfdZ2RK=w2400" />
</a>
</div>
<p>I continued practicing karate in 2023. In July a group from our dojo traveled to Okinawa for the 4-yearly gasshuku. It was conveniently held just a typhoon drifted across the islands, twice, blocking entry for some friends, delaying our exit as the airport closed down, and shutting down training - including, memorably, a third of the way into my shodan grading. I was not passed. When given the opportunity to conclude it via Zoom a few weeks later, I declined (on the basis that these things ought to be done in person), and am stubbornly resolved to return to Okinawa to do it again. I’ve enjoyed continuing to help out with the kids’ classes on Saturday morning, and find it quite fulfilling to see their concentration and coordination improve over the months. Under 7s are also surprisingly bloodthirsty. Our daughter also returned to class this year (having declared, age 4, that she was “done with karate”) and is both enjoying herself and becoming more physically confident.</p>
<p>Generally, exercise was OK: I’ll have run about 600km (vs a target of 750km, about the same as last year), done 120h of karate (vs a target of 150, up significantly from 2022), and cycled 3400km (vs a target of 3000km, again slightly up from 2022 - cycling to work most days really helps). Around that, a few lovely walks around Tahoe, Marin, Point Reyes, and Sussex, and some skiing with friends and their daughters. No significant injuries this year - something to be grateful for as I turned 50.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/pw/ABLVV864uuUoHJXOVkNQSoAc0PTl9wTn6cwpjNXOj3Dt_mzJdrKzkuhjqaB0Hrs5lphC2HRJBugtQz2CPUHO5lRHQgovupwaiZ_km25ZEgr9gMIo8Odf-vyr=w2400" target="_blank">
<img style="width:100%;border:0;" alt="Marin Headlands" src="https://lh3.googleusercontent.com/pw/ABLVV864uuUoHJXOVkNQSoAc0PTl9wTn6cwpjNXOj3Dt_mzJdrKzkuhjqaB0Hrs5lphC2HRJBugtQz2CPUHO5lRHQgovupwaiZ_km25ZEgr9gMIo8Odf-vyr=w2400" />
</a>
</div>
<p>We spent another wonderful, glorious summer camped out in Worthing near Kate’s parents - our daughter getting grandparent time and being ferried around other friends and relatives, and I working in London during the weeks and seeing old friends at weekends. It was particularly fun to catch up with university friends from 30 years previously, back in Reading - and having fun in Reading is quite an achievement.</p>
<p>I traveled to Israel for the first time, and probably (given events) the last time in a while. Tel Aviv is a beautiful city - it has a wonderful faded Mediterranean feel to it, and was more lively and upbeat than I expected. I happened to be visiting during the pro-democracy demonstrations, wandered through their beginnings on the way to walk, and watched them from the nearby Google office. The situation there is horrific, and talking to friends and colleagues based there brings it closer, in some ways, than the front pages of newspapers can.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/pw/ABLVV854pAGpLVDkVa1OK1gGlcpe1XPITinNlbh4cEZe-sIi47yceS4_-C5sS6UEfJl-MT2-m8bbRqAWi4TwgkmImd_NG1XtP3NY3fFmgdKlXbw1jIyjpGCR=w2400" target="_blank">
<img style="width:100%;border:0;" alt="Beachfront, Tel Aviv" src="https://lh3.googleusercontent.com/pw/ABLVV854pAGpLVDkVa1OK1gGlcpe1XPITinNlbh4cEZe-sIi47yceS4_-C5sS6UEfJl-MT2-m8bbRqAWi4TwgkmImd_NG1XtP3NY3fFmgdKlXbw1jIyjpGCR=w2400" />
</a>
</div>
<p>I’ll write separately about the <a href="https://www.meetup.com/san-francisco-cognitive-science-meetup-group/">cognitive science reading group</a> I set up in February; outside of that, it was an OK year for reading:</p>
<ul>
<li><a href="https://www.amazon.com/Computer-Called-Leo-P-S/dp/1841151866">A Computer Called Leo</a> by Georgina Ferry; a birthday gift from Toby. tl;dr Britain invents an early computer to run tea rooms, then fails to capitalize on it and sells it to ICL.</li>
<li><a href="https://www.amazon.com/Three-Body-Problem-Cixin-Liu/dp/0765382032/ref=sr_1_1?keywords=The+Three+Body+Problem&qid=1703898668&s=books&sr=1-1">The Three Body Problem trilogy</a> by Cixin Liu; wonderful, I read the first and devoured the following two, then watched the <a href="https://www.imdb.com/title/tt20242042/">Tencent adaptation</a>.</li>
<li><a href="https://www.amazon.com/Night-Ocean-Novel-Paul-Farge/dp/1101981091/ref=sr_1_1?crid=7E6O9N2MCDMJ&keywords=The+Night+Ocean&qid=1703898702&s=books&sprefix=the+night+ocean%2Cstripbooks%2C144&sr=1-1">The Night Ocean</a>, by Paul LaFarge; a wander through nested narratives and frequent fabrications based around a Lovecraftian scenius, with Asimov and Burroughs hovering at the edges.</li>
<li><a href="https://www.amazon.com/Werner-Herzog-Perplexed-Conversations-Cronin/dp/057133606X/ref=sr_1_1?crid=1OXYLMQ11UGSQ&keywords=Werner+Herzog%2C+a+Guide+for+the+Perplexed&qid=1703898726&s=books&sprefix=werner+herzog%2C+a+guide+for+the+perplexed%2Cstripbooks%2C232&sr=1-1">Werner Herzog, a Guide for the Perplexed</a>; a biography of the great man (who I got to see speak in San Francisco this year), spread over decades of conversation, the spirit shining through them all.</li>
<li><a href="https://www.amazon.com/Ballad-Halo-Jones-Colour-Omnibus/dp/1786187701/ref=sr_1_1?crid=1CFF1WHEIFGA3&keywords=The+Ballad+of+Halo+Jones&qid=1703898741&s=books&sprefix=the+ballad+of+halo+jones%2Cstripbooks%2C128&sr=1-1">The Ballad of Halo Jones</a>. Alan Moore knows the score; not read since I was a child, and so much had gone over my head back then. <em>“What did she want? Everything. Where did she go? Out.”</em></li>
<li><a href="https://www.amazon.com/Aurora-Kim-Stanley-Robinson/dp/0316526991/ref=sr_1_1?crid=34OPIH8JAF77H&keywords=aurora+kim+robinson&qid=1703898762&s=books&sprefix=Aurora+kim+%2Cstripbooks%2C128&sr=1-1">Aurora</a>, by Kim Stanley Robinson. Solid science fiction about the folly of interstellar colonization and sacrifice.</li>
<li><a href="https://www.amazon.com/Need-Know-About-Music-Business/dp/1668011069/ref=sr_1_1?crid=MX3PW5U611JO&keywords=All+You+Need+to+Know+About+the+Music+Business&qid=1703898784&s=books&sprefix=all+you+need+to+know+about+the+music+business%2Cstripbooks%2C137&sr=1-1">All You Need to Know About the Music Business</a>, by Donald Passman. Great insider view (Passman is a music industry lawyer) of the byzantine history and practices of the music industry, including the changes wrought by streaming. Recommended by a colleague.</li>
<li><a href="https://www.amazon.com/Do-Interesting-Notice-Collect-Share/dp/1914168208/ref=sr_1_1?crid=1134YWZCVQ8K&keywords=Do%2FInteresting&qid=1703898820&s=books&sprefix=do%2Finteresting%2Cstripbooks%2C147&sr=1-1">Do/Interesting</a>, by Russell Davies. A slim gateway drug to Zettelkasten (notice stuff, collect it by writing it down, go through it), but with the goal of creativity rather than the (more common) sceintific efficiency.</li>
<li><a href="https://www.amazon.com/Visit-Goon-Squad-Jennifer-Egan/dp/0307477479/ref=sr_1_1?crid=2PS383DXQVHW4&keywords=A+Visit+from+the+Goon+Squad&qid=1703898834&s=books&sprefix=a+visit+from+the+goon+squad%2Cstripbooks%2C145&sr=1-1">A Visit from the Goon Squad</a> and <a href="https://www.amazon.com/Candy-House-Novel-Jennifer-Egan/dp/1476716773/ref=sr_1_1?crid=2OF9BWADDNDPC&keywords=the+candy+house&qid=1703898850&s=books&sprefix=the+candy+house%2Cstripbooks%2C146&sr=1-1">The Candy House</a>, both by Jennifer Egan. Enjoyable, character-driven narratives about music industry workers and has-beens, bleeding into near-term science fiction, especially in the latter. Great fun, some beautiful set pieces. Who among us hasn’t tried screaming at strangers to force them into authenticity?</li>
<li><a href="https://www.amazon.com/Planiverse-Computer-Contact-Two-Dimensional-World/dp/0387989161/ref=sr_1_1?crid=2HWZP6AAI68DG&keywords=the+planiverse&qid=1703898871&s=books&sprefix=the+planivers%2Cstripbooks%2C143&sr=1-1">The Planiverse</a>, by A K Dewdney. When I was about 8 years old, a family friend and maths professor showed me this book, which posited a 2-dimensional world. This year I tracked it down, read it and enjoyed it.</li>
<li><a href="https://www.amazon.com/Mountain-Sea-Novel-Ray-Nayler/dp/1250872278/ref=sr_1_1?crid=BLWQXOFHHN46&keywords=the+mountain+in+the+sea&qid=1703898893&s=books&sprefix=the+mountain+in+the+sea%2Cstripbooks%2C137&sr=1-1">The Mountain In The Sea</a>, by Ray Nayler. Christmas present from Kate; tl;dr what if octopuses got smart? A fun romp, but not so subtle - definite shades of Garth Merengi. Maybe I’m a bit too close to/interested in the source material.</li>
</ul>
<p>Started and unfinished:</p>
<ul>
<li><a href="https://www.amazon.com/Idea-Factory-Great-American-Innovation/dp/0143122797/ref=sr_1_1?crid=298NR9C7DRAM1&keywords=the+idea+factory&qid=1703898909&s=books&sprefix=the+idea+factory%2Cstripbooks%2C133&sr=1-1">The Idea Factory</a> by Jon Gertner. A history of Bell Labs. I was looking at models for past research organizations. Now I’ve joined a new one, I’m less interested.</li>
<li><a href="https://www.amazon.com/Musicophilia-Tales-Music-Revised-Expanded/dp/1400033535/ref=sr_1_1?crid=SKWPBOANZG4M&keywords=Musicophilia&qid=1703898923&s=books&sprefix=musicophilia%2Cstripbooks%2C131&sr=1-1">Musicophilia</a>, by Oliver Sacks. Great exploration of mental illness and music, I’m working through it still.</li>
<li><a href="https://www.amazon.com/Come-Up-Oral-History-Hip-Hop/dp/1984825135/ref=sr_1_1?crid=3357066G265FJ&keywords=the+come+up&qid=1703898937&s=books&sprefix=the+come+up%2Cstripbooks%2C134&sr=1-1">The Come Up</a>. Christmas present from James, an oral history of hip hop. Really enjoying it but only just started.</li>
<li><a href="https://www.amazon.com/You-Have-Choice-Beyond-Meaningful/dp/B0CM8P1SVX/ref=sr_1_1?crid=1JDVU071MESSM&keywords=you+have+a+choice&qid=1703898953&s=books&sprefix=you+have+a+choi%2Cstripbooks%2C136&sr=1-1">You Have a Choice</a>. Manual for self-pitying ingrates like myself, trapped in enjoyable demanding jobs yet still incapable of being happy. May never finish this one.</li>
</ul>
<p>Things I’m thinking about for next year: improving my diet, retaking shodan, working from home a bit more, finding time for side-projects, <a href="https://academy.neuromatch.io">Neuromatch Academy</a>, spending the summer or more in the UK, and writing more here…</p>
Thu, 28 Dec 2023 00:00:00 +0000
http://tomhume.org/2023-redux/
http://tomhume.org/2023-redux/San Francisco Cognitive Science Reading Group, 2023<p>So back in February I <a href="/readinggroup/">set up a local reading group</a> for cognitive science. I’d wanted to learn more about the less… <em>silicon</em>… aspects of intelligence for a while, and figured getting together with a group of like-minded people was a good route to that. And I was surprised at how dead the existing meetups were, post-COVID. So I started one.</p>
<p>So far, so good. We’ve tended to gather a group of 4-5 each month, mostly face-to-face (we’ve had a couple of dial-ins). We alternate reading books and papers, to give us more time for the former. Our group is mostly the same each month, with maybe one or two new faces - we’ve not been great at retaining new arrivals. Conversations frequently get back to large language models, a topic I like to avoid given my day job, and how hard it is to keep track of what’s public and what’s not, when your entire working life is spent in this stuff. Karl Friston also shows up, metaphorically, most months. We need to spend some time with him, metaphorically, in 2024.</p>
<ul>
<li>March: <a href="https://www.amazon.com/Being-You-New-Science-Consciousness/dp/1524742872">Being You: A New Science of Consciousness</a> by Anil Seth. A physicalist (and more importantly, Sussex prof) presents an agnostic view of consciousness, emotion, free will, AI. Comforting confession that noone understands Friston on Free Energy, and I enjoyed the explanation of Integrated Information Theory and the takedown of those free-will experiments showing brain intention to act can be measured before intention is conscious.</li>
<li>April: <a href="https://www.pnas.org/doi/10.1073/pnas.2105646118">The neural architecture of language - Integrative modeling converges on predictive processing</a>. The researchers pass sentences through language models (up to GPT-1) and people (having them read out sentences while FMRI’d). They found they could build predictors both ways, from hidden layers of each to the other - suggesting strong correlations, especially on next word prediction… suggesting it’s a core capability and there are parallels between how artificial neural networks and the brain do it.</li>
<li>May: <a href="https://www.amazon.com/Mind-Motion-Action-Shapes-Thought/dp/046509306X">Mind in Motion: How Action Shapes Thought</a>, by Barbara Tversky. I had trouble with this one, frequently finding myself more confused after reading the author’s explanations.</li>
<li>June: <a href="https://arxiv.org/abs/1604.00289">Building Machines That Learn and Think Like People</a>. Dates from pre-transformer era, so a bit dated. Lots of desire for intuitive physics abilities and intuitive psychology; emphasis on compositionality as a core cognitive ability (which I can imagine, but they present as necessary)</li>
<li>July: we took July off, as I was in the UK.</li>
<li>August: <a href="https://www.penguinrandomhouse.com/books/608016/the-experience-machine-by-andy-clark/">The Experience Machine</a>, another Sussex connection, Andy Clark’s latest. He takes the predictive processing theories laid out in previous works a bit further, in talking explicitly about precision weighting - an attention mechanism - and connects sensing and acting more overtly.. A few chapters then go into implications of the theory elsewhere - with focus on psychiatry, medicine, and broader societal issues.</li>
<li>September: <a href="https://pubmed.ncbi.nlm.nih.gov/23663408/">Whatever next? Predictive brains, situated agents and the future of cognitive science.</a> A 2013 paper from Andy Clark - interesting to have read this after the book, I had a real sense of the core ideas being worked through here. One detail I enjoyed: his prediction (on p12) that each level of processing requires distinct units for representations and error. This is exactly what they found in <a href="this paper">/energy-efficiency/</a>.</li>
<li>October: <a href="https://www.amazon.com/Seven-Half-Lessons-About-Brain/dp/0358157145">Seven and a half lessons about the brain</a>, by Lisa Feldman Barrett. Her name had come up in past discussions and readings so many times that it felt necessary. I was a bit lost in this one, and wondered if something was lost or added in translation between her academic work and this (more pop science) book. She starts by taking down the notion of the triune (lizard/mammal/human) brain model, wanders through brains-as-networks and pruning/tuning (with the mother/daughter relationship presented as an example, which I found plausible but not convincing), then through social/cultural implications and to the idea of brains creating reality.</li>
<li>November: <a href="https://www.nature.com/articles/s42256-022-00452-0">Biological Underpinnings for lifelong learning machines</a> - a literature review of all the ways biology might inspire and address issues with systems that need lifelong learning (i.e. those beyond today’s common training/inference split). Broad, interesting - their reference to memories being maintained even while brain tissue is remodelled must rule out some mechanisms for storage? But their metaphor or forgetting as being “memory locations being overwritten” seemed a bit too silicon-like… There’s a theme of “replay of training data” throughout (random activations in the hippocampus used for rehearsal/generative replay). Working out what needs to be stored for replay seems important.</li>
<li>December: <a href="https://www.amazon.com/Models-Mind-Engineering-Mathematics-Understanding/dp/1472966422">Models of the Mind: How Physics, Engineering and Mathematics Have Shaped Our Understanding of the Brain</a> by Grace Lindsay. I was surprised how much I enjoyed this exploration of maths in biology - when I started it, it felt like another pop-neuroscience introduction but I found a lot of material which I’d not encountered elsewhere. Starts from the basics of neuron firing, zooming out to network assemblies, into the visual network, to information-encoding and then to the motor system - finally into real-world interactions, Bayesian predictions, reinforcement learning and ending with grand unified theories (e.g. Integrated Information Theory, Thousand Brains, etc., of which the author is quite openly sceptical). I was pleased to hear <a href="https://en.wikipedia.org/wiki/Pandemonium_architecture">Pandemonium Architectures</a> called out - their messiness still feels both biologically plausible, and underexplored given our leap to the clean abstractions of matrix multiplication. .</li>
</ul>
<p>A fun year, I think. Towards the end I was definitely losing energy a bit (mostly thanks to the day job) but reading back I’m happy with the ground we covered.</p>
Wed, 27 Dec 2023 00:00:00 +0000
http://tomhume.org/2023-cogsci/
http://tomhume.org/2023-cogsci/Starting the San Francisco Cognitive Science Reading Group<div style="width:100%;text-align:center;border-bottom:20px solid white">
<img src="/assets/reading-octopus.png" alt="Painting of an octopus reading a book" />
</div>
<p>I really enjoyed spending some time last year learning about cognition, and I didn’t want it to end there. Plus as we (kinda, sorta) come out of COVID, I wanted to start meeting other human beings - maybe even ones I didn’t already know.</p>
<p>After observing that Meetup groups seem to be a wasteland - huge member numbers but no activity in most of them - I’ve set up the <a href="https://www.meetup.com/san-francisco-cognitive-science-meetup-group/">San Francisco Cognitive Science Reading Group</a>. We have a <a href="https://www.meetup.com/san-francisco-cognitive-science-meetup-group/events/291413888/">first event</a> in early March, at which we’ll discuss <a href="https://www.amazon.com/Being-You-New-Science-Consciousness/dp/1524742872">Being You, by Anil Seth</a>. I’m still working on a venue - it’ll be an in-person event, though if we can support remote attendees we will do so.</p>
<p>Register! Like and subscribe! Join us!</p>
Sat, 11 Feb 2023 00:00:00 +0000
http://tomhume.org/readinggroup/
http://tomhume.org/readinggroup/2022 Redux<p>I wanted to write something about 2022, to get it out of my head before 2023 rolls over it. An odd year - disjointed, mostly by choice, and feels better in retrospect than it did at the time. I remember having a strong sensation throughout it that it never hit a consistent rhythm.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/1SI9ZeF4Z1v7u5hdQiF81dq4iEwk-_-WmH4Ra_gcOdWv-EJSWdJXg_DsWDzGeEpo34pYU7enmjcZHYlAgRZ6K2doHfQQ262YR6i6BYvC5UvZ2YA3RVN2HPDDWEklGgN9bTP6Hf6qbK8=w2400" target="_blank">
<img style="width:100%;border:0;" src="https://lh3.googleusercontent.com/1SI9ZeF4Z1v7u5hdQiF81dq4iEwk-_-WmH4Ra_gcOdWv-EJSWdJXg_DsWDzGeEpo34pYU7enmjcZHYlAgRZ6K2doHfQQ262YR6i6BYvC5UvZ2YA3RVN2HPDDWEklGgN9bTP6Hf6qbK8=w2400" />
</a>
</div>
<p>Work-related:</p>
<ul>
<li>I’m still working in <a href="http://research.google.com">Google Research</a> - it’ll be 5 years in my current role in May. My manager is about to become my All Time Longest Ever Boss - ssh don’t tell him, it’s going to be a surprise. We published a <a href="https://arxiv.org/abs/2209.10317">white paper</a> and <a href="https://security.googleblog.com/2022/12/trust-in-transparency-private-compute.html">blog post</a> about Private Compute Core, which might be the most important thing I’ve done? It certainly gave me a strong sense of mission; I spent 3 years setting up this and <a href="https://support.google.com/pixelphone/answer/12112173?hl=en">Android System Intelligence</a>, before moving on to other things: audio and ambient sensing. I am grateful to be working in AI right now.</li>
<li>I took a 3 month break from work. It was great. I wrote all about it <a href="http://www.tomhume.org/92-days-off/">here</a>.</li>
<li>I spent a few months volunteering for <a href="http://rewiringamerica.org">Rewiring America</a>, helping with their <a href="https://www.rewiringamerica.org/policy/mayors-for-electrification">Mayors for Electrification</a> program. They’re an excellent organization and I love their work, their ethos and their people; but I didn’t feel I was actually getting much of any use done, or that I had a surfeit of time to throw into it.</li>
<li>I’m still doing advisory work for <a href="https://www.smallrobotcompany.com/">Small Robot Company</a>. They’re doing technically difficult work to solve real problems in the real world, and hit some great milestones this year.</li>
</ul>
<p>Health:</p>
<ul>
<li>Overall good - I exercised on 282 days, and my resting heart rate, VO2, etc are all good (but I’d like my VO2 to be excellent).</li>
<li>Highlight: thanks to the purchase of a Yuba Boda Boda e-bike last year, I beat the cycling goal I’d set myself (~3200km vs 3000km goal for the year I think - grrr Strava for not allowing a historical view of goals). E-bikes are enormously fun, mine has quickly become my main mode of transport. When they break they’re less fun. One lesson from this year: buy a proper e-bike chain!</li>
<li>Midlight: I didn’t quite manage to hit my running goal of 750km (I think I made it to 620km), but I was plagued by a hip injury that I’ve had for a couple of years and only ended up fixing this year thanks to physical therapy, so don’t feel too bad about that. I’ve started doing longer runs (a 5.5km loop up and down Twin Peaks and a longer downhill 8.5km to work), and my times got better towards the end of the year, approaching what they were in my 30s.</li>
<li>Lowlight: I only did 75 hours of karate (vs a goal of 150). Partly because I was away, partly a series of injuries (toe, wrist, hip, chest…). I do feel like my sparring has become much more controlled this year. I’m planning to focus more on this in 2023, it could be an exciting year.</li>
<li>Notable mentions: I’ve started to spend more time walking in the countryside. I did a lot of this in Italy and back in the UK, but I’ve also gotten into the habit of taking the odd day off work, driving up to Marin or Point Reyes, and just having a wander.</li>
<li>Being Near That Age, I had my first routine colonoscopy - an introduction to the indignities of your twilight years, I guess. The prep was less pleasant than the actual event, which was under a general anaesthesia. I hadn’t had that since I was 17 maybe? I started counting backwards from 10, the crew laughed and said “we don’t do that any more but you can if you like”, then a vaguely metallic taste in my mouth and I was gone.</li>
</ul>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/mkZ2PLz_i6_SThkkhbMJn6GKYjvjUirqJmOemCg9jNnbLYxJmf1e6IlIQ0EEe19lLuCx1XUPUWVaApbPXPt5mzWCCbAlMo1Nnj21hjSQEYeKmHmG4YKsp5TDuTrjjdB0rzpII24xE_c=w2400" target="_blank">
<img style="width:100%;border:0;" src="https://lh3.googleusercontent.com/mkZ2PLz_i6_SThkkhbMJn6GKYjvjUirqJmOemCg9jNnbLYxJmf1e6IlIQ0EEe19lLuCx1XUPUWVaApbPXPt5mzWCCbAlMo1Nnj21hjSQEYeKmHmG4YKsp5TDuTrjjdB0rzpII24xE_c=w2400" />
</a>
</div>
<p>Books; I read 37 books in total this year, thanks in part due to time off, in part due to deliberate effort. I probably won’t read as much this year. Some of the best ones, a sentence of pith for each:</p>
<ul>
<li><a href="https://www.amazon.com/Being-Human-Adventures-Thousand-Consciousness/dp/1250783712">Being A Human by Charles Foster</a> (sequel to <a href="https://www.amazon.com/Being-Beast-Adventures-Across-Species/dp/1250132215">Being a Beast</a>, which I loved): tl;dr understand the human condition by pretending to be Neolithic</li>
<li><a href="https://www.amazon.com/Mortdecai-Trilogy-Kyril-Bonfiglioli/dp/0141003774">The Mortdecai Trilogy</a> by Kyril Bonfiglioli: a friend recommended this to me 10 years ago and I kick myself for not having listened to them. Laugh-out-loud upper-middle class English shenanigans.</li>
<li><a href="https://www.amazon.com/How-Take-Smart-Notes-Nonfiction/dp/1542866502">How to Take Smart Notes</a> by Sönke Ahrens, after which I am Zettlekastening</li>
<li><a href="https://www.amazon.com/Head-Hand-Heart-Intelligence-Over-Rewarded/dp/1982128445">Hand, Head, Heart by David Goodhart</a> : tl;dr we overprivilege cognitive ability and jobs arising from it, relative to those in the manufacturing or caring professions. Goodhart also wrote The Road To Somewhere, which really helped explain the new cross-society divisions behind Brexit.</li>
<li><a href="https://www.amazon.com/Lanny-Novel-Max-Porter/dp/1555978401">Lanny</a>, by Max Porter, author of the incredible Grief Is The Thing With Feathers. Terrifying medieval England-spirit does terrifying things in English village, terrifyingly.</li>
<li><a href="https://www.amazon.com/Metazoa-Animal-Life-Birth-Mind/dp/0374207941">Metazoa</a>, by Peter Godfrey-Smith; tl;dr how far down the tree of life does consciousness emerge? Seems like the closer we look, the further back it goes.</li>
<li><a href="https://www.amazon.com/Scientific-Freedom-Civilization-Donald-Braben/dp/0578675919">Scientific Freedom: The Elixir of Civilisation</a>, by Donald Braben; tl;dr what’s the best way to fund foundational research? Cast the net wide, fund exceptional people without conditions, don’t have outcome-related goals. I read this, and others, to think a bit more carefully about my working life.</li>
<li><a href="https://www.amazon.com/Slaughterhouse-Five-Novel-Modern-Library-Novels/dp/0385333846">Slaughterhouse 5</a>, Kurt Vonnegut. Just sad I hadn’t read it already. So it goes.</li>
<li><a href="https://www.amazon.com/Diamond-Age-Illustrated-Primer-Spectra/dp/0553380966">The Diamond Age</a> by Neal Stephenson. Read on a whim after a tweet from Emad Mostaque saying “who wants to help build the book from this?”. Beautiful novel - nanotechnology, future Victorian nostalgia, centered around a magic book designed to teach a young girl how to be subversive.</li>
<li><a href="https://www.amazon.com/Prince-Marshes-Other-Occupational-Hazards/dp/0156032791">The Prince of the Marshes</a> and <a href="https://www.amazon.com/Marches-Borderland-Journey-between-Scotland/dp/0544108884">The Marches</a>, by Rory Stewart. I became a big fan of his in the last few years after reading The Places In Between, about his walk across Afghanistan post-9/11. The first of these concerns his time as a regional governor in post-war Iraq, the second his relationship with his father.</li>
<li><a href="https://www.amazon.com/Self-Assembling-Brain-Neural-Networks-Smarter/dp/0691181225">The Self-Assembling Brain</a>, by Peter Robin Hiesinger; AKA So You Thought Understanding The Brain Was Hard, Let Me Make It A Thousand Times Harder For You. Basically: brains are grown not laid out, and the process of growth - unfolding sequences, Komolgorov-style - is an efficient, wickedly hard to understand primitive for brain understanding.</li>
<li><a href="https://www.amazon.com/What-Life-Chemistry-Becomes-Biology/dp/1522693009">What is Life</a>, by Addy Pross; tl;dr where does life come from? Self-replication in an environment finite enough that you’re competing for resources, leading to specialization, competition, and (once life starts harvesting energy) take-off. Really wonderful book.</li>
</ul>
<p>Other stuff:</p>
<ul>
<li>I went back to the UK for my cousin’s 50th birthday in November. It had been a decade since I was in a pub with 30+ good friends, and it left me feeling nostalgic for those days: we’ve made some good friends in the US, but there’s something about a social circle which mostly predates adulthood… having one such friend visit for 10 days was also really quite wonderful, I may never get that length of contiguous time with them again.</li>
<li>I saw a lot of my dad this year - that November trip, a month working from the UK early in the year, a week in Italy, a trip for him to SF, and some sundry days passing through on work trips.</li>
<li>We tried to start some construction work (a basement remodel with a side order of structural, plus some solar panels), and I have now been initiated into the ways of local government. Obscure, opaque, slow moving. I haven’t gone libertarian, but am definitely mentally looking over my spectacles when someone suggests more services be government-run.</li>
<li>I’ve joined the School Site Council for my daughter’s elementary school, to start getting a feel for that side of local politics.</li>
<li>I started enjoying a couple of new podcasts: <a href="https://shows.acast.com/the-rest-is-politics">The Rest is Politics</a> (Alastair Campbell and Rory Stewart giving insider views on UK and world politics) and <a href="https://braininspired.co/podcast/">Brain Inspired</a> (excellent interviews with neuroscientists and AI types, with a good Discord for supporters).</li>
<li>Courtesy of <a href="https://www.orbific.com/">James</a>, I found <a href="https://buck65.substack.com">Buck 65’s substack</a> and bounced from there to a load of his music, which I’ve been loving - in particular <a href="https://jorunbombay.bandcamp.com/album/buck-65-laundromat-boogie-produced-by-jorun-bombay">Laundromat Boogie</a> (a concept album about doing laundry), and two collaborations: <a href="https://hedrekhender.bandcamp.com/album/the-last-dig">The Last Dig</a> and <a href="https://bikeforthree.bandcamp.com">Bike for Three</a></li>
</ul>
Tue, 03 Jan 2023 00:00:00 +0000
http://tomhume.org/2022-redux/
http://tomhume.org/2022-redux/92 Days Off<p>I spent 3 months over the summer on a break from work (if you’re feeling pretentious, feel free to call it a sabbatical) mostly to keep a promise I made to myself a decade ago: when I was interviewing at Google my recruiter had warned me that without a degree (which I lacked) I might succeed at interview and fall at the final hurdle. So I booked onto a MSc at Sussex, absolutely loved it, and ended it swearing I’d take a year off every ten thereon to focus on lifelong learning. Then I blinked, ten years had passed, and I found myself thinking awkwardly about how to keep both this promise and my job. I’m exceptionally fortunate to have an employer with a generous view of taking time out, so that’s what I did.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/oy3GJMgpmzm3zEp13GTq_aG2izaAQmNfRnkwkFcewsH_Szj4OQhkVDEa56nkfI_nMQvbKn8H_wttKCnlNEx7VgGLVuG0PrNP4IaVa6K85SW_mQj9gI5Fss9GTvCWsys5mIDggmXxwf8=w1920-h1080" target="_blank">
<img style="width:100%;border:0;" src="https://lh3.googleusercontent.com/oy3GJMgpmzm3zEp13GTq_aG2izaAQmNfRnkwkFcewsH_Szj4OQhkVDEa56nkfI_nMQvbKn8H_wttKCnlNEx7VgGLVuG0PrNP4IaVa6K85SW_mQj9gI5Fss9GTvCWsys5mIDggmXxwf8=h480" />
</a>
</div>
<p>Common advice online was to start any break with a complete change of scene and habits, so I spent the first month in Tuscany, tucked away in the countryside near Figline Valdarno (between Florence and Siena) with a pile of books, some walking boots and my running shoes. I slept voraciously, read indulgently, and hiked around the local countryside until I was sick of the sight of terracotta and lush greenery. Towards the end my dad came out to visit and we continued in this vein together.</p>
<div style="width:100%;text-align:center;border-bottom:20px solid white">
<a href="https://lh3.googleusercontent.com/MHKMCkGsUpZc8wiqsvU6YouadLQGCPFPuQzZx7OSbzM6j7sCshE5Qdt1X7lvJthOI0nFRcXbumEtdPEPy-1Wl69hX8r9wj2DwxukJ7G6yopOA7uv67A973NrL8-hZeJRplSIRb9meZw=w1920-h1080" target="_blank">
<img style="width:100%;border:0;" src="https://lh3.googleusercontent.com/MHKMCkGsUpZc8wiqsvU6YouadLQGCPFPuQzZx7OSbzM6j7sCshE5Qdt1X7lvJthOI0nFRcXbumEtdPEPy-1Wl69hX8r9wj2DwxukJ7G6yopOA7uv67A973NrL8-hZeJRplSIRb9meZw=h480" />
</a>
</div>
<p>Then it was back to the Bay Area, where to scratch that educational itch I’d signed up for a course at Berkeley University as part of their summer program, <a href="https://classes.berkeley.edu/content/2022-summer-cogsci-131-001-lec-001">Computational Models of Cognition</a>. I figured that being in a university environment would be stimulating, I’d meet a load of like-minded people, the topic would give me an opportunity to look at biological aspects of intelligence (the day job focusing on silicon), and going a bit deeper on machine learning theory couldn’t hurt.</p>
<p>In practice my experiences were mixed. Where I’d expected to be one of many mature students along for the ride (Bay Area! Cognition! AI! 2022!), I seemed to be the only attendee over the age of 27. This was OK and everyone was very sweet, but I’d met That Guy during my brief undergraduate time at Reading, and been That Guy once already at Sussex. On the ML theory side of things, we didn’t go as deep as I’d hoped - building a simple feedforward network from scratch but not much more. The biological side was much more interesting, forcing me to revisit GCSE chemistry as we looked into exactly how synapses fire and impressing upon me the overwhelming complexity of the brain as we looked at key circuits in the hippocampus.</p>
<p>To pad this out, I took the excellent <a href="https://braininspired.co/neuro-ai/">Brain Inspired Neuro AI course</a>, an online effort from Paul Middlebrooks who runs a podcast of the same name. This course examined the same subjects, a little more broadly and superficially than the Berkeley course, and very capably. I particularly liked how Paul had extended the prerecorded lectures with regular calls for questions which he then answered in follow-up videos; and after subscribing to his Patreon, I’ve been enjoying the Discord-based community around the podcast.</p>
<p>Lots of real life happened during this time too: visits from my dad and an old friend from Brighton, both of which triggered some explorations of California countryside; a bout of COVID which passed through me and Kate, but (thanks perhaps to diligent masking and extreme ventilation) avoided our daughter B; we lost a much-loved cat; and B and I started learning to <a href="https://goldengatepark.com/6th-avenue-skate-park.html">roller-skate in GGP</a>. I also resurrected my <a href="http://app.birdweather.com/stations/101">Birdweather station</a> - for reasons work-related and personal, ambient birdsong tracking has become interesting to me - and indulged an <a href="http://www.tomhume.org/bee-optics/">interest in bee navigation</a> which I wrote about previously.</p>
<p>I read a lot. Here are some books I particularly enjoyed during this time; all are excellent and recommended.</p>
<ul>
<li><a href="https://www.amazon.com/Dont-Point-that-Thing-Me/dp/1585675628">Don’t Point That Thing at Me, by Kyril Bonfiglioli</a> - laugh-out-loud 70s cloak-and-dagger novel, starring an alcoholic middle-aged art historian.</li>
<li><a href="https://www.amazon.com/Lanny-Novel-Max-Porter/dp/1555978401">Lanny, by Max Porter</a> - failing marriages, ancient spirits and the abduction of a child from an English village. Beautifully written from the author of the incredible Grief Is The Thing With Feathers.</li>
<li><a href="https://www.amazon.com/Self-Assembling-Brain-Neural-Networks-Smarter/dp/0691181225">The self-assembling brain, Peter Robin Hiesinger</a> - how do brains develop? Our models are static but biological systems grow, and the mechanism of their unfolding growth seem important to the end-results (perhaps but perhaps not essentially) and their efficient genetic coding (definitely).</li>
<li><a href="https://www.amazon.com/Seeing-like-State-Certain-Condition/dp/0300078153">Seeing like a state, by James C Scott</a> - the need for society to be legible to a state apparatus leads to an imposition of top-down order; the models needed are wrong, even if some are useful, and forcing your reality to conform to a model doesn’t work. Hard not to see the connections between the emancipatory nature of high modernism and modern tech culture - “we’re building better worlds”…</li>
<li><a href="https://www.amazon.com/Build-Unorthodox-Guide-Making-Things/dp/B09LGNR2TW">Build, by Tony Fadell</a> - on the topic of building software/hardware products, and excellent. I started finding this a bit trite, but as I worked through it I loved it more and more. Chapter 6 in particular was an astonishing record of what it’s like to actually sell to Big Tech.</li>
<li><a href="https://www.amazon.com/Prince-Marshes-Other-Occupational-Hazards/dp/0156032791">The Prince Of The Marshes, Rory Stewart</a>, an account of the author’s time as an acting governor in post-war Iraq, with a theme of the importance of devolution throughout. I became a bit of a Rory Stewart fanboy after reading The Places In Between (on <a href="http://www.orbific.com/">James’</a> recommendation) and have really been enjoying his podcast with Alastair Campbell, <a href="https://shows.acast.com/the-rest-is-politics">The Rest is Politics</a></li>
<li><a href="https://www.amazon.com/Head-Hand-Heart-Intelligence-Over-Rewarded/dp/1982128445">Head, hand, heart by David Goodhart</a>, follow-up to the excellent Road To Somewhere, about the over-privileging of cognitive ability (relative to manual and caring skills) and how it’s damaged society.</li>
<li><a href="https://www.amazon.com/Upswing-America-Together-Century-Again/dp/198212914X">The Upswing, Robert Puttnam</a>, a follow-up to Bowling Alone which seems to throw its predecessor under the bus in looking back further and plotting many aspects of American society on an inverted U-curve during the 20th century… with a common sentiment that while things are bad, but we’ve been here before and prevailed. Exhaustive, fascinating, ultimately optimistic.</li>
<li><a href="https://www.amazon.com/What-Life-Chemistry-Becomes-Biology/dp/1522693009">What is life, Addy Pross</a>: how does chemistry become biology? A similar question to Gödel Escher Bach I guess, but lays out evolutionary principles: replication of simple molecules in a finite environment leads to competition and thus efficiency; then energy-harvesting arrives, and you have life.</li>
</ul>
Sun, 16 Oct 2022 00:00:00 +0000
http://tomhume.org/92-days-off/
http://tomhume.org/92-days-off/Be kind, Bee mind<p>(sorry)</p>
<p>I’ve been on a break from work for the last few months, and one of the things I’ve been doing is learning more about the brain: by taking <a href="https://classes.berkeley.edu/content/2022-summer-cogsci-131-001-lec-001">Computational Models of Cognition</a> as part of Berkeley University’s Summer Sessions, doing the (excellent) <a href="https://braininspired.co/neuro-ai/">Brain Inspired Neuro-AI course</a>, and of course listening and reading around the topic. I’ll write more about this another time, maybe.</p>
<p>I was charmed by <a href="https://braininspired.co/podcast/134/">this interview</a> on the Brain Inspired podcast with <a href="https://qbi.uq.edu.au/profile/613/srini-srinivasan">Mandyam Srinivasan</a>. His career has been spent researching cognition in bees, and his lab has uncovered a ton of interesting properties, in particular how bees use optical flow for navigation, odometry and more. They’ve also applied these principles to drone flight - you can see some examples of how <a href="https://www.youtube.com/watch?v=CoBbdkK0T00&t=660s">here</a>.</p>
<p>Some of the mechanisms they discovered are surprisingly simple; for instance, they noticed that when bees entered the lab through a gap (like a doorway), they tended to fly through the center of the gap. So they set up experiments where bees flew down striped tunnels, while they moved the stripes on one side, and established that the bess were tracking the speed of motion of their field of view through each eye, and trying to keep this constant. Bees use a similar trick when landing: keeping their speed, measured visually, at a constant rate throughout. As they get nearer to the landing surface, they naturally slow down. Their odometry also turns out to be visual.</p>
<p>The algorithm for centering flight through a space is <strong>really simple</strong>:</p>
<ol>
<li>Convert what you see to a binary black-and-white image.</li>
<li>Spatially low-pass filter (i.e.blur) it, turning the abrupt edges in the image into ramps of constant slope.</li>
<li>Derive speed by measuring the rate of change at these ramps. If you just look at the edge of your image, you’ll see it pulses over time: the amplitude of these pulses is proportional to the rate of change of the image and thus its speed.</li>
<li>Ensure the speed is positive regardless of direction of movement.</li>
</ol>
<p>Srinivasan did this using two cameras, I think (and his robots have two cameras pointing slightly obliquely). I tried using a single camera and looking at the edges.</p>
<p>It seems to work well on some test footage. <a href="https://drive.google.com/file/d/1pS__zMrgDUPZOpNc8RTeaN6jJbX48iaD/view">Here’s</a> a video I shot on a pathway in Sonoma, and here’s the resulting analysis which shows the shifts I was making between left and right during that walk, quite clearly:</p>
<div style="text-align:center"><img src="/assets/beeflow-sonoma.png" alt="Graph showing the changing left/right position of someone walking down a forest pathway, as measured using optical flow" />
</div>
<p>Things I’m wondering about now:</p>
<ul>
<li>Making it work for robots: specifically, can I apply this same mechanism to make a <a href="https://docs.donkeycar.com">Donkey car</a> follow a track? (I’ve tried briefly, no luck so far)</li>
<li>Do humans use these kinds of methods, when they’re operating habitually and not consciously attending to their environment? Is this one of a <a href="https://en.wikipedia.org/wiki/Society_of_Mind">bag of tricks</a> that makes up our cognition?</li>
<li>What’s actually happening in the bee brain? Having just spent a bit of time learning (superficially) about the structure of the human brain, I’m wondering how bees compare. Bees have just a million neurons versus our 86 billion. It should be easier to analyze something 1/86000 of the size of the human brain, no? (fx: c elegans <a href="https://openworm.org">giggling</a>)</li>
</ul>
<p>Srinivasan’s work is fascinating by the way: I loved how his lab has managed to do years of worthwhile animal experiments with little or no harm to the animals (because bees are tempted in from outside naturally, in exchange for sugar water, and are free to go).</p>
<p>They’ve observed surprisingly intelligent bee behavior: for instance, if a bee is doing a waggle-dance near a hive to indicate food at a certain location, and another bee has been to that location and experienced harm, the latter will attempt to frustrate the former’s waggle-dance by head-butting it. That seem very prosocial for an animal one might assume to be a bundle of simple hardwired reactions! After reading Peter Godfrey-Smith’s <a href="https://www.amazon.com/Metazoa-Animal-Life-Birth-Mind/dp/0374207941">Metazoa</a> earlier this year, has me rethinking where consciousness and suffering begin in the tree of life.</p>
<p>I’ve put the source code for my version <a href="https://github.com/twhume/beeflow">here</a>.</p>
Thu, 11 Aug 2022 00:00:00 +0000
http://tomhume.org/bee-optics/
http://tomhume.org/bee-optics/Startup chime<p>I found this dusty old box in a cupboard, dug out a few old cables and plugged it in. I wonder if it works?</p>
Wed, 20 Jul 2022 00:00:00 +0000
http://tomhume.org/startup-chime/
http://tomhume.org/startup-chime/Weakly trained ensembles of neural networks<h1 id="what-if-neural-networks-but-not-very-good-and-lots-of-them">What if neural networks, but not very good and lots of them?</h1>
<p>I recently read <a href="https://www.amazon.com/Thousand-Brains-New-Theory-Intelligence/dp/1541675819">A Thousand Brains</a>, by Jeff Hawkins. I’ve been a fan of his since <a href="https://www.amazon.com/Information-Appliances-Beyond-Interaction-Technologies/dp/1558606009">reading the deeply inspirational founding stories</a> of the Palm Pilot (original team: 7 people! 7!). And as an AI weenie, when I discovered what he <strong>really</strong> wanted to do all along was understand intelligence, I was doubly impressed - and loved his first book, <a href="https://www.amazon.com/Intelligence-Understanding-Creation-Intelligent-Machines/dp/0805078533">On Intelligence</a>.</p>
<p>Paraphrasing one of the theses of A Thousand Brains: the neocortex is more-or-less uniform and composed of ~150k cortical columns of equivalent structure, wired into different parts of the sensorimotor system. Hawkins suggests that they all build models of the world based on their inputs - so models are duplicated throughout the neocortex - and effectively “vote” to agree on the state of the world. So, for instance, if I’m looking at a coffee cup whilst holding it in my hand, columns receiving visual input and touch input each separately vote “coffee cup”.</p>
<p>The notion of many agents coming to consensus is also prominent in Minsky’s <a href="https://www.amazon.com/Society-Mind-Marvin-Minsky/dp/0671657135">Society of Mind</a>, and in the <a href="https://en.wikipedia.org/wiki/Copycat_(software)">Copycat architecture</a> which suffuses much of Hofstadter’s work. (I spent a bit of time last year <a href="http://tomhume.org/numbo/">noodling</a> with the latter).</p>
<p>We think the brain doesn’t do backprop (in the same way as neural networks do - Hinton <a href="https://syncedreview.com/2020/04/23/new-hinton-nature-paper-revisits-backpropagation-offers-insights-for-understanding-learning-in-the-cortex/">suggests</a> it might do something similar, and some folks from Sussex and Edinburgh have recently proposed <a href="https://arxiv.org/abs/2006.04182">how this might work</a>). We <strong>do</strong> know the brain is massively parallel, and that it can learn quickly from small data sets.</p>
<p>This had me wondering how classical neural networks might behave, if deployed in large numbers (typically called “ensembles”) that vote after being trained weakly - as opposed to being trained all the way to accurate classification in a single network. Could enormous parallelism compensate in some way for either training time or dataset size?</p>
<h1 id="past-work-with-ensembles">Past work with ensembles</h1>
<p>One thing my <a href="http://tomhume.org/output-from-the-masters/">Master’s</a> (pre-Google) gave me an appreciation for was digging into academic literature. I had a quick look around to see what’s been done previously - there’s no real technical innovation for this kind of exploration, so I expected to find it thoroughly examined. Here’s what I found.</p>
<p>Really large ensembles haven’t been deeply explored:</p>
<ul>
<li><a href="https://scholar.google.com/scholar?cluster=8267063715713827199&hl=en&as_sdt=0,5">Lincoln and Skrzypek</a> trained an ensemble of 5 networks and observed better performance over a single network.</li>
<li><a href="http://ceur-ws.org/Vol-2272/short6.pdf">Donini, Loreggia, Pini and Rossi</a> did experiments with 10.</li>
<li><a href="https://scholar.google.com/scholar?cluster=18412826781870444603&hl=en&as_sdt=0,5">Breiman</a> got to 25 (<em>“more than 25 bootstrap replicates is love’s labor lost”</em>), as did <a href="https://scholar.google.com/scholar?cluster=9297768410353397265&hl=en&as_sdt=0,5">Opitz and Maclin</a></li>
</ul>
<p>Voting turns up in many places:</p>
<ul>
<li><a href="https://direct.mit.edu/neco/article-pdf/6/6/1289/812901/neco.1994.6.6.1289.pdf">Drucker et al</a> point to many studies of neural networks in committee, initialized with different weights, and suggest an expectation I share: that multiple networks might converge differently and thus have performance improved in combination. They had explored this in previous work (Drucker et al 1993a).</li>
<li><a href="http://ceur-ws.org/Vol-2272/short6.pdf">Donini, Loreggia, Pini and Rossi</a> reach the same conclusion and articulate it thus: <em>“different neural networks can generalize the learning functions in different ways as to learn different areas of the solutions space”</em>. They also explore other voting schemes.</li>
<li><a href="https://faculty.fuqua.duke.edu/~clemen/bio/Published%20Papers/13.CombiningReview-Clemen-IJOF-89.pdf">Clemen</a> notes that <em>“simple combination methods often work reasonably well relative to more complex combinations”</em>, generally in forecasting.</li>
<li><a href="https://dspace.cvut.cz/bitstream/handle/10467/9443/1998-On-combining-classifiers.pdf?sequence=1">Kittler, Duin and Matas</a> similarly note that <em>“the sum rules out performs other classifier combinations schemes”</em>.</li>
</ul>
<p>Breiman’s <a href="https://scholar.google.com/scholar?cluster=18412826781870444603&hl=en&as_sdt=0,5">Bagging</a> (short for “bootstrap aggregating”) seems very relevant. It involves sampling from the same distribution and training a different network on each sample, then combining their results via voting etc. Technically if you sampled fully from that distribution and thus trained all your ensemble of the same dataset, this would be bagging, but it seems a bit over-literal and incompatible in spirit.</p>
<p>In his paper Breiman does not explore the impact of parallelization on small dataset sizes, but does note that <em>“bagging is almost a dream procedure for parallel computing”</em>, given the lack of communication between predictors.</p>
<p>Finally, two other titbits stood out:</p>
<ol>
<li><a href="https://apps.dtic.mil/sti/pdfs/ADA260045.pdf">Perrone and Cooper</a> observe that training on hold-out data is possible with an ensemble process without risking overfitting, as we <em>“let the smoothing property of the ensemble process remove any overfitting or we can train each network with a different split of training and hold-out data”</em>. That seems interesting from the POV of maximizing the value of a small dataset.</li>
<li><a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.52.9672&rep=rep1&type=pdf">Krogh and Vedelsby</a> have an interesting means to formalize a measure of ambiguity in an ensemble. <a href="https://www.jair.org/index.php/jair/article/download/10239/24370/">Opitz and Maclin</a> reference them as verifying that classifieds which disagree strongly perform better. I wondered if this means an ensemble mixing networks designed to optimize for individual class recognition might perform better than multiclass classifiers?</li>
</ol>
<h1 id="questions-to-ask">Questions to ask</h1>
<p>All this left me wanting to answer a few questions:</p>
<ol>
<li>What’s the trade-off between dataset size and ensemble size? i.e. would parallelization help a system compensate for having very few training examples, and/or very little training effort?</li>
<li>Is an ensemble designed to do multiclass classification best served by being formed of homogenous networks, or specialist individual classifiers optimized for each class?</li>
<li>How might we best optimize the performance of an ensemble?</li>
</ol>
<p>I chose a classic toy problem, MNIST digit classification, and worked using the <a href="https://mxnet.apache.org/versions/1.8.0/">Apache MXNet</a> framework. I chose the latter for a very poor reason: I started out wanting to use Clojure because I enjoy writing it, and MXNet seemed like the best option…. but I struggled to get it working and switched to Python. <strong>shrug</strong></p>
<p>The MNIST dataset has 60,000 images and MXNet is bundled with <a href="https://mxnet.apache.org/versions/1.7.0/api/python/docs/tutorials/packages/gluon/image/mnist.html">a simple neural network</a> for it: three fully connected layers with 128, 64 and 10 neurons each, which get 98% accuracy after training for 10 epochs (i.e. seeing 600,000 images total).</p>
<h2 id="whats-the-trade-off-between-dataset-and-ensemble-size">What’s the trade-off between dataset and ensemble size?</h2>
<p>I started like this:</p>
<ol>
<li>Taking a small slice of the MNIST data set (100-1000 images out of the 60,000), to approximate the small number of examples a human might see.</li>
<li>Training on this small dataset for a very small number of epochs (1 to 10), to reflect the fact that humans don’t seem to need machine-learning quantities of re-presented data.</li>
<li>Repeating the training for 10,000 distinct copies of a simple neural network.</li>
<li>For increasingly sized subsets of these 10,000 networks, having them vote on what they felt the most likely outcome was, and taking the most voted result as the classification. I tested on subsets to try and understand where the diminishing returns for parallelization might be: 10 networks? 100? 1000?</li>
</ol>
<p>I ran everything serially, so the time to train and time to return a classification were extremely long: in a truly parallel system they’d likely be 1/10,000th.</p>
<p>I ran two sets of tests:</p>
<ol>
<li>With dataset sizes of 200, 500, 1000 and 10000 examples from the MNIST set, all trained for a single epoch. I also ran a test with a completely untrained network that had seen no data at all, to act as a baseline.</li>
<li>For a dataset of 200 examples, I tried training for 1, 10, and 100 epochs.</li>
</ol>
<p>It’s worth reiterating: these are <strong>very</strong> small training data sets (even 10,000 is 1/6th of the MNIST data set).</p>
<p>I expected to see increased performance from larger data sets, and from more training done on the same data set, but I had no intuition over how far I could go (I assumed a ceiling of 0.98, given this is where a well-trained version of the MXNet model got to).</p>
<p>I hoped to see increased performance from larger ensembles I had no intuition about how far this could go.</p>
<p>I expected the untrained model to remain at 0.1 accuracy no matter how large the ensemble, on the basis that it could not have learned anything about the data set, so its guesses would be effectively random.</p>
<h3 id="results">Results</h3>
<p>For dataset sizes trained for a single epoch (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=1179630915">data</a>):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=318615433&format=image" alt="Graph showing effect of training data size on classification accuracy" /></p>
<p>Interpreting this:</p>
<ul>
<li>A larger dataset leads to improved accuracy, and faster arrival at peak accuracy: for d=10000 1 network scored 0.705, an ensemble of 50 scored 0.733 and by 300, the ensemble converged on 0.741 where it remained.</li>
<li>For smaller datasets, parallelization continues to deliver benefits for some time: d=200 didn’t converge near 0.47 (its final accuracy being 0.477) until an ensemble of ~6500 networks.</li>
<li>An untrained network still saw slight performance improvements (0.0088 with 1 network, to the 0.14 range by 6000.</li>
</ul>
<p>Looking at the impact of training time (in number of epochs) (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=1235499981">data</a>):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=1860813187&format=image" alt="Graph showing effect of training time on classification accuracy" /></p>
<p>Interpreting:</p>
<ul>
<li><strong>More training means less value from an ensemble</strong>: 100 rose from 0.646 accuracy with 1 network to 0.667 by 50 networks, and stayed there.</li>
<li><strong>Less training means more value from an ensemble</strong>: 1 epoch rose from 0.091 accuracy to 0.55 by the time the ensemble reached 4500 networks.</li>
</ul>
<p>Conclusions here:</p>
<ol>
<li><strong>Parallelization can indeed compensate for either a small dataset or less time training, but not fully</strong>: an ensemble trained on 10,000 examples scored 0.744 vs 0.477 for one trained on 200; one trained for 100 epochs scored 0.668 vs 0.477 for one trained for 1 epoch.</li>
<li>I don’t understand how an untrained network gets better. Is it reflecting some bias in the training/validation data, perhaps? i.e. learning that there are slightly more examples of the digit 1 than 7 etc?</li>
</ol>
<h2 id="should-individual-classifiers-be-homogenous-or-heterogeneous">Should individual classifiers be homogenous or heterogeneous?</h2>
<p>Instead of training all networks in the ensemble on all classes, I moved to a model where each network was trained on a single class.</p>
<p>To distinguish a network’s target class from others, I experimented with different ratios of true:false training data in the training set (2:1, 1:1, 1:2, and 1:3)</p>
<p>I took the best performing ratio and tried it with ensembles of various sizes, trained for a single epoch on data sets of different sizes. I then compared these to the homogenous networks I’d been using previously.</p>
<p>And finally, I tried different data set sizes with well-trained ensembles, each network being trained for 100 epochs.</p>
<h3 id="results-1">Results</h3>
<p>Here’s a comparison of those data ratios (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=1304736070">data</a>):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=475854430&format=image" alt="Graph showing effect of varying the ratio of true:false examples in training data" /></p>
<p>I ended up choosing 1:2 - i.e. two random negative examples from different classes presented during training, for each positive one. I wanted to be in principle operating on “minimal amounts of data” and the difference between 1:2 and 1:3 seemed small.</p>
<p>Here’s how a one-class-per-network approach performed (each network trained for a single epoch, (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=518897029">data</a>)):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=1828566477&format=image" alt="Graph showing impact of dataset size on accuracy" /></p>
<p>And then, to answer the question, I compared 1-class-per-network to all-networks-all-classes (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=1386878073">data</a>):</p>
<p>Naively, a network trained to classify all classes performed better. But consider the dataset sizes: each all-classes network is trained on 10,000 examples (of all classes), but each per-class network of d=10000 is trained on 1/10 as much data. So a fair comparison is between the d=10000 per-class network and d=1000 all-class network, where <strong>per-class networks have the edge</strong>.</p>
<p>Here’s the result of well-trained ensembles (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=570678490">data</a>):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=967236200&format=image" alt="Graph showing impact of dataset size on well trained ensembles" /></p>
<p>This was a red flag for ensembles generally: repeated re-presentation of the same data across multiple epochs reached peak performance very fast. <strong>When the network was well trained, using an ensemble didn’t have any noticeable effect</strong>. Expanding on the far left of that graph, you can see that in the slowest case (20 examples per dataset) <strong>ensembles larger than 50 networks had little effect, but smaller ones did perform better</strong>:</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=869875220&format=image" alt="Graph showing impact of dataset size on well trained ensembles, for small ensemble sizes" /></p>
<h2 id="how-could-we-optimize-the-training-of-an-ensemble">How could we optimize the training of an ensemble?</h2>
<p>A friend suggested I experiment with the learning rate for small datasets - reasoning that we want individual networks to converge as quickly as possible, even if imperfectly, and rely on voting to smooth out the differences. The default learning rate in MXNet was 0.02; I compared this to 0.1, 0.2, 0.3, and 0.4, all for networks shown few examples and given a single epoch of training.</p>
<p>Finally, I wondered how performance changed during training: imagine a scenario where each network is trained on a single extra example (+ negatives) and then the ensemble is tested. How does performance of the ensemble change as the number of examples grows? This might be a good approximation for an ensemble that learns very slowly and naturally in-the-wild, in line with the kinds of biological plausibility that originally interested me.</p>
<h3 id="results-2">Results</h3>
<p>A learning rate of 0.2 seemed to give the best results (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=1846835081">data</a>):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=515576313&format=image" alt="Graph showing impact of learning rate on ensemble performance" /></p>
<p>And here’s how that gradual learning worked out, as each ensemble size saw more examples (<a href="https://docs.google.com/spreadsheets/d/1-fzEgBgxJqEy1jdDRAnopiLNtJvPpQACtkgAzQ0l2nU/edit#gid=565901898">data</a>):</p>
<p><img src="https://docs.google.com/spreadsheets/d/e/2PACX-1vSXwJIn0X6AcgyRXjztNHnkImcbX-EgGmLbMinxy9o69WP0D03A_3BMF3_WjJ9i42f5Zp8nz9Ypl4Ld/pubchart?oid=903076968&format=image" alt="Graph showing impact of dataset growth on ensemble performance" /></p>
<p>An ensemble of 500 networks gets to ~0.75 accuracy by the time it’s seen 200 examples. Earlier results suggest it doesn’t go much further than that though.</p>
<h1 id="pulling-it-all-together">Pulling it all together</h1>
<p>Phew. This all took a surprising amount of time to actually run; I was doing it all on my Mac laptop, after finding that Colab instances would time out before the runs completed - some of them took a week to get through.</p>
<p>My conclusions from all this:</p>
<ol>
<li><strong>Large ensembles didn’t seem useful for getting to high accuracy classifications</strong>. Nothing I did got near to the 0.98 accuracy that this MXNet example could get to, well trained.</li>
<li><strong>They did compensate for a dearth of training data and/or training time, to some degree</strong>. Getting to 0.75 accuracy with just 100 examples of each digit, just by doing it lots of times and voting, seemed… useful in theory. In practice I’m struggling to think of situations where it’d be easier to run 1000 ensembles than iterate over the training data a network has already seen.</li>
</ol>
<p>In retrospect this might be explained as follows: a network is initialized with random weights, training it with a few examples would bias a set of these weights towards some features in the examples, but a slightly different set each time because of the randomness of the starting position. Thus across many networks you’d end up slightly biasing towards different aspects of the training data, and thus be able, in aggregate, to classify better.</p>
<p>Things I didn’t quite get to try:</p>
<ol>
<li>Different voting schemes: I was super-naive throughout, and in particular wonder if I could derive some idea of confidence from different networks in an ensemble, just pick the confident ones?</li>
<li>MNist is a useful toy example, but I wonder if these results would replicate for other problems.</li>
<li>Applying the measure of ambiguity from Krogh and Vedelsby to my ensembles.</li>
</ol>
Sat, 24 Apr 2021 00:00:00 +0000
http://tomhume.org/ensembles/
http://tomhume.org/ensembles/