1 00:00:00,539 --> 00:00:03,539 foreign 2 00:00:08,880 --> 00:00:15,360 [Music] 3 00:00:11,719 --> 00:00:18,660 welcome to the Saturday afternoon track 4 00:00:15,360 --> 00:00:20,760 here at Halls C my name is Maya 5 00:00:18,660 --> 00:00:22,680 um and I'm the person you probably want 6 00:00:20,760 --> 00:00:25,019 to come and hassle if you couldn't 7 00:00:22,680 --> 00:00:27,599 decide which talk to go to 8 00:00:25,019 --> 00:00:30,539 if it makes you feel any better as the 9 00:00:27,599 --> 00:00:33,480 program chair I inconvenienced myself as 10 00:00:30,539 --> 00:00:35,700 much as anyone I haven't been managing 11 00:00:33,480 --> 00:00:37,739 to catch almost any of the talks I 12 00:00:35,700 --> 00:00:39,660 actually want to see 13 00:00:37,739 --> 00:00:43,079 um anyway I'm here to actually introduce 14 00:00:39,660 --> 00:00:44,520 Dave hello Dave this is Dave Coles Dave 15 00:00:43,079 --> 00:00:46,920 and I worked together at thoughtworks 16 00:00:44,520 --> 00:00:49,559 for a while and here's the director of 17 00:00:46,920 --> 00:00:51,539 the data and AI practice at thoughtworks 18 00:00:49,559 --> 00:00:53,520 um actually I just remember Dave as 19 00:00:51,539 --> 00:00:56,640 being the person who created the most 20 00:00:53,520 --> 00:01:00,420 high value content on the internet at 21 00:00:56,640 --> 00:01:02,640 work he's full of whimsical technical 22 00:01:00,420 --> 00:01:04,140 data about which he is about to tell you 23 00:01:02,640 --> 00:01:06,840 all 24 00:01:04,140 --> 00:01:09,020 thanks Maya 25 00:01:06,840 --> 00:01:11,460 and 26 00:01:09,020 --> 00:01:14,220 thanks thanks for joining me everyone 27 00:01:11,460 --> 00:01:15,840 lovely to see you here today and I'll do 28 00:01:14,220 --> 00:01:18,180 my best to keep us all awake in this 29 00:01:15,840 --> 00:01:19,759 slot after lunch and thank you Maya for 30 00:01:18,180 --> 00:01:23,220 that as well 31 00:01:19,759 --> 00:01:25,380 so today's about math swimsy with python 32 00:01:23,220 --> 00:01:26,580 but before I start I'd like to 33 00:01:25,380 --> 00:01:27,840 acknowledge that we're meeting on the 34 00:01:26,580 --> 00:01:30,540 traditional country of the current 35 00:01:27,840 --> 00:01:32,939 people of the Adelaide Plains and I pay 36 00:01:30,540 --> 00:01:34,500 my respect to Elders past and present I 37 00:01:32,939 --> 00:01:36,900 recognize and respect their cultural 38 00:01:34,500 --> 00:01:39,200 heritage beliefs and relationship with 39 00:01:36,900 --> 00:01:39,200 the land 40 00:01:39,840 --> 00:01:46,560 so today is about me sharing my 41 00:01:42,659 --> 00:01:49,200 experience with Whimsy with maths with 42 00:01:46,560 --> 00:01:51,240 python libraries how those things come 43 00:01:49,200 --> 00:01:54,119 together in a Sprint or a short 44 00:01:51,240 --> 00:01:57,200 development cycle to generate outputs 45 00:01:54,119 --> 00:02:00,600 learning and applications beyond that 46 00:01:57,200 --> 00:02:02,820 today's quite indulgent it's quite 47 00:02:00,600 --> 00:02:05,219 personal but I hope it's fun for us all 48 00:02:02,820 --> 00:02:07,700 as well and I hope you'll take away from 49 00:02:05,219 --> 00:02:10,259 this maybe a bit of inspiration 50 00:02:07,700 --> 00:02:11,760 some guidance around a process that's 51 00:02:10,259 --> 00:02:14,459 worked for me and might work for others 52 00:02:11,760 --> 00:02:16,700 and resources with python for your own 53 00:02:14,459 --> 00:02:16,700 Journey 54 00:02:17,280 --> 00:02:22,860 when I talk about Whimsy I'm not talking 55 00:02:19,319 --> 00:02:24,540 about being capricious or changeable I'm 56 00:02:22,860 --> 00:02:26,940 talking about things that are light or 57 00:02:24,540 --> 00:02:29,520 fanciful things that acquaint are 58 00:02:26,940 --> 00:02:32,040 unusual that have some interest in their 59 00:02:29,520 --> 00:02:35,420 own right but then it's a bonus if we if 60 00:02:32,040 --> 00:02:38,340 we're able to leverage them beyond that 61 00:02:35,420 --> 00:02:40,739 and a little about me as my said I'm a 62 00:02:38,340 --> 00:02:42,780 director in the dardana data and AI 63 00:02:40,739 --> 00:02:44,940 practice at thoughtworks Australia in 64 00:02:42,780 --> 00:02:48,120 New Zealand thoughtworks is a custom 65 00:02:44,940 --> 00:02:51,300 software technology consultancy in my 66 00:02:48,120 --> 00:02:54,180 role I help our team help our clients 67 00:02:51,300 --> 00:02:56,480 solve their problems with data maths and 68 00:02:54,180 --> 00:02:56,480 AI 69 00:02:57,540 --> 00:03:02,400 and it might be worth talking a little 70 00:02:59,160 --> 00:03:04,500 bit about the path to this point so why 71 00:03:02,400 --> 00:03:06,239 am I talking about Mass Whimsy in Python 72 00:03:04,500 --> 00:03:08,459 today I think I can trace it back to 73 00:03:06,239 --> 00:03:10,680 high school in the 90s where I probably 74 00:03:08,459 --> 00:03:12,659 started with math swimsy and basic in 75 00:03:10,680 --> 00:03:15,000 those days I enjoy doing things like 76 00:03:12,659 --> 00:03:16,819 double pendulum simulations and drawings 77 00:03:15,000 --> 00:03:20,640 of Penske triangles 78 00:03:16,819 --> 00:03:22,440 and that took me into engineering and 79 00:03:20,640 --> 00:03:24,480 computer science in my undergraduate 80 00:03:22,440 --> 00:03:27,659 which involved a lot more engineering 81 00:03:24,480 --> 00:03:30,900 maths using in those days C plus plus 82 00:03:27,659 --> 00:03:33,959 and Java and an early career into games 83 00:03:30,900 --> 00:03:36,300 engines CAD Cam and simulation 84 00:03:33,959 --> 00:03:37,920 then that my career took me to a place 85 00:03:36,300 --> 00:03:39,659 that was a bit Matt's light after being 86 00:03:37,920 --> 00:03:42,720 very Mass heavy for those years 87 00:03:39,659 --> 00:03:44,340 uh and in my when I joined thoughtworks 88 00:03:42,720 --> 00:03:46,379 13 years ago I actually joined as a 89 00:03:44,340 --> 00:03:49,319 project manager and I spent most of my 90 00:03:46,379 --> 00:03:51,180 time working on delivery Improvement and 91 00:03:49,319 --> 00:03:53,220 organizational change agile 92 00:03:51,180 --> 00:03:54,540 transformation was a big thing that a 93 00:03:53,220 --> 00:03:57,480 lot of organizations were doing back 94 00:03:54,540 --> 00:04:00,720 then after some time I moved into the 95 00:03:57,480 --> 00:04:03,840 data and AI practice role and in that in 96 00:04:00,720 --> 00:04:05,819 those early days I was helping others uh 97 00:04:03,840 --> 00:04:08,879 deliver on data and ml for our clients 98 00:04:05,819 --> 00:04:10,860 and typically making slideware thank you 99 00:04:08,879 --> 00:04:12,540 for the introduction Maya because you 100 00:04:10,860 --> 00:04:15,420 know no slideway did become a bit of a 101 00:04:12,540 --> 00:04:17,820 meme at the time this from one of the 102 00:04:15,420 --> 00:04:19,680 team lamenting me going on Long service 103 00:04:17,820 --> 00:04:22,400 leave and what would happen to the the 104 00:04:19,680 --> 00:04:25,800 quality of our slideway over that period 105 00:04:22,400 --> 00:04:27,900 so how did I go from that point of you 106 00:04:25,800 --> 00:04:30,360 know what changed in that I was making 107 00:04:27,900 --> 00:04:32,639 slideware day in day out to actually 108 00:04:30,360 --> 00:04:35,400 doing some work in Python and some 109 00:04:32,639 --> 00:04:38,400 Whimsical work in python as well 110 00:04:35,400 --> 00:04:40,440 well I um found myself on a solo 111 00:04:38,400 --> 00:04:41,880 advisory engagement so I was the only 112 00:04:40,440 --> 00:04:43,860 only thought worker on that engagement 113 00:04:41,880 --> 00:04:45,780 with a client that very quickly became 114 00:04:43,860 --> 00:04:48,320 maths heavy and this was the kind of 115 00:04:45,780 --> 00:04:50,820 thing where um qualitative explanations 116 00:04:48,320 --> 00:04:53,280 and what I could deliver 117 00:04:50,820 --> 00:04:55,500 um in terms of ideas communicated 118 00:04:53,280 --> 00:04:57,419 through documentation wasn't enough I 119 00:04:55,500 --> 00:04:59,820 actually needed to be able to prototype 120 00:04:57,419 --> 00:05:02,639 and express my thinking as code instead 121 00:04:59,820 --> 00:05:05,040 so at that point I picked up a Jupiter 122 00:05:02,639 --> 00:05:06,419 notebook with some scikit-learn to 123 00:05:05,040 --> 00:05:08,699 demonstrate to this particular client 124 00:05:06,419 --> 00:05:10,199 what it would look like to extend their 125 00:05:08,699 --> 00:05:12,060 current process into the world of 126 00:05:10,199 --> 00:05:14,400 machine learning how they needed to 127 00:05:12,060 --> 00:05:17,520 think about measuring success and the 128 00:05:14,400 --> 00:05:19,979 types of types of processes they need to 129 00:05:17,520 --> 00:05:21,720 put in place to manage the data 130 00:05:19,979 --> 00:05:24,320 that was around about the time actually 131 00:05:21,720 --> 00:05:28,620 I think of the last in-person python 132 00:05:24,320 --> 00:05:31,080 conference and soon after that we moved 133 00:05:28,620 --> 00:05:32,820 into covert lockdowns and covered 134 00:05:31,080 --> 00:05:34,800 lockdown presented me with a lot of 135 00:05:32,820 --> 00:05:36,900 spare time to pursue this newfound 136 00:05:34,800 --> 00:05:39,539 interest in Python 137 00:05:36,900 --> 00:05:40,860 so let's look at where Whimsy struck in 138 00:05:39,539 --> 00:05:43,919 covert lockdown 139 00:05:40,860 --> 00:05:45,720 in the first instance uh obviously I saw 140 00:05:43,919 --> 00:05:49,139 a lot of my children in those days 141 00:05:45,720 --> 00:05:51,060 um with remote schooling and one day one 142 00:05:49,139 --> 00:05:52,740 of them said you know Dad for school I 143 00:05:51,060 --> 00:05:54,120 made a square planet and you can see 144 00:05:52,740 --> 00:05:56,520 here it's a pretty cool Square Planet 145 00:05:54,120 --> 00:05:58,979 it's even got a little compass rose or 146 00:05:56,520 --> 00:06:01,440 slash GPS device on top to tell you how 147 00:05:58,979 --> 00:06:04,680 to navigate from one face of the of this 148 00:06:01,440 --> 00:06:06,300 square or cubic planet to another but it 149 00:06:04,680 --> 00:06:08,580 posed a question 150 00:06:06,300 --> 00:06:10,759 um in its in its very form it posed a 151 00:06:08,580 --> 00:06:12,960 question of what happens at the edges 152 00:06:10,759 --> 00:06:15,419 when you come to the edge of one of the 153 00:06:12,960 --> 00:06:16,919 faces uh it's standing on a flat plane 154 00:06:15,419 --> 00:06:20,280 and you're looking down over a sheer 155 00:06:16,919 --> 00:06:21,720 cliff and with the danger of falling 156 00:06:20,280 --> 00:06:24,960 down that cliff and off the edge of the 157 00:06:21,720 --> 00:06:26,460 planet entirely or is it something of it 158 00:06:24,960 --> 00:06:29,220 different is it more like maybe reaching 159 00:06:26,460 --> 00:06:31,080 the crest of an A-frame roof and so we 160 00:06:29,220 --> 00:06:32,940 talked about this for a little while you 161 00:06:31,080 --> 00:06:34,860 know we talked about considerations of 162 00:06:32,940 --> 00:06:37,380 symmetry that might lead you to choose 163 00:06:34,860 --> 00:06:38,940 one over the other but ultimately I 164 00:06:37,380 --> 00:06:42,560 thought that was too simple a resolution 165 00:06:38,940 --> 00:06:45,660 of the question and it needed some maths 166 00:06:42,560 --> 00:06:48,360 and so we could start with uh we I 167 00:06:45,660 --> 00:06:50,280 decided to model it as a grid and in 168 00:06:48,360 --> 00:06:52,080 this grid that represents space some of 169 00:06:50,280 --> 00:06:54,300 the cells have mass if they're if the 170 00:06:52,080 --> 00:06:56,280 planet occupies those spell those cells 171 00:06:54,300 --> 00:06:57,900 then for each of the grid cells if we 172 00:06:56,280 --> 00:06:59,819 can calculate the resultant force of 173 00:06:57,900 --> 00:07:01,500 gravity then we can build up a picture 174 00:06:59,819 --> 00:07:03,120 of what gravity looks like in the region 175 00:07:01,500 --> 00:07:04,860 of the planet and we should be able to 176 00:07:03,120 --> 00:07:07,199 answer the question of what happens at 177 00:07:04,860 --> 00:07:09,900 the corners thanks to Newton we've got 178 00:07:07,199 --> 00:07:12,780 the Maths for over 300 years we've known 179 00:07:09,900 --> 00:07:14,880 how gravitational attraction works and 180 00:07:12,780 --> 00:07:17,580 if we look at that over the the grid 181 00:07:14,880 --> 00:07:20,099 then we've kind of got a we've kind of 182 00:07:17,580 --> 00:07:22,319 got a double Loop for each grid cell and 183 00:07:20,099 --> 00:07:24,479 we sum up the contribution of all of the 184 00:07:22,319 --> 00:07:26,280 masses to the gravitational field at 185 00:07:24,479 --> 00:07:28,440 that point 186 00:07:26,280 --> 00:07:32,340 and 187 00:07:28,440 --> 00:07:35,340 then the python to add to the maths so 188 00:07:32,340 --> 00:07:37,860 given the uh given the the discrete 189 00:07:35,340 --> 00:07:39,539 nature of how it set up the problem it 190 00:07:37,860 --> 00:07:43,080 seemed to lend itself well to numpy 191 00:07:39,539 --> 00:07:44,759 which is a library that suits faster 192 00:07:43,080 --> 00:07:47,220 than scalable numerical processing 193 00:07:44,759 --> 00:07:48,900 especially arrays of data 194 00:07:47,220 --> 00:07:50,300 and because I wanted to answer the 195 00:07:48,900 --> 00:07:52,620 question what does it look like 196 00:07:50,300 --> 00:07:54,780 matplotlib it's a really useful library 197 00:07:52,620 --> 00:07:57,240 for visualization as code everything 198 00:07:54,780 --> 00:07:59,819 from simple charts up to complex 3D 199 00:07:57,240 --> 00:08:02,460 animations 200 00:07:59,819 --> 00:08:04,020 so with those ingredients in place we 201 00:08:02,460 --> 00:08:08,039 could start working through the process 202 00:08:04,020 --> 00:08:10,680 and the process was to start as simple 203 00:08:08,039 --> 00:08:12,539 as possible and then take small steps in 204 00:08:10,680 --> 00:08:14,699 either problem complexity or solution 205 00:08:12,539 --> 00:08:16,500 complexity so I knew a little bit about 206 00:08:14,699 --> 00:08:19,020 for loops with my programming background 207 00:08:16,500 --> 00:08:21,000 and that's where I started looping over 208 00:08:19,020 --> 00:08:22,979 each location and the contribution of 209 00:08:21,000 --> 00:08:24,660 every Mass to that location and I could 210 00:08:22,979 --> 00:08:26,819 validate that I could get something that 211 00:08:24,660 --> 00:08:28,680 far from a square Planet at least look 212 00:08:26,819 --> 00:08:30,599 like the gravitational field you'd 213 00:08:28,680 --> 00:08:33,060 expect to see around a regular spherical 214 00:08:30,599 --> 00:08:34,680 planet and so I could confirm that I was 215 00:08:33,060 --> 00:08:36,959 able to reproduce the the real world 216 00:08:34,680 --> 00:08:38,520 phenomena I was expecting but I did want 217 00:08:36,959 --> 00:08:39,320 to move beyond for Loops they were very 218 00:08:38,520 --> 00:08:42,120 slow 219 00:08:39,320 --> 00:08:44,580 and I did want to start learning numpy 220 00:08:42,120 --> 00:08:46,260 so the next step was to try and 221 00:08:44,580 --> 00:08:49,200 reproduce that first solution increase 222 00:08:46,260 --> 00:08:51,660 the solution complexity in numpy instead 223 00:08:49,200 --> 00:08:53,700 and the first step I took in numpy was 224 00:08:51,660 --> 00:08:55,680 to use mesh grid and which some of you 225 00:08:53,700 --> 00:09:00,720 may be familiar with is a technique for 226 00:08:55,680 --> 00:09:02,580 uh discretizing a plane or a a region of 227 00:09:00,720 --> 00:09:05,279 space and being able to do a calculation 228 00:09:02,580 --> 00:09:06,720 at each point doing that I was able to 229 00:09:05,279 --> 00:09:09,120 reproduce the for Loop and actually 230 00:09:06,720 --> 00:09:11,820 reduce the time by a factor of about 30. 231 00:09:09,120 --> 00:09:13,560 so I was quite pleased how much more 232 00:09:11,820 --> 00:09:16,620 efficient that was 233 00:09:13,560 --> 00:09:18,839 the next step in that process so I was 234 00:09:16,620 --> 00:09:20,940 limited to square planets and square 235 00:09:18,839 --> 00:09:25,019 grids I realized actually there was a 236 00:09:20,940 --> 00:09:26,519 slightly more sophisticated mesh grid uh 237 00:09:25,019 --> 00:09:29,040 implementation where we could mesh 238 00:09:26,519 --> 00:09:31,260 indexes on both the locations in space 239 00:09:29,040 --> 00:09:33,660 and the and the locations of the planet 240 00:09:31,260 --> 00:09:35,160 and so that was another step in solution 241 00:09:33,660 --> 00:09:37,440 complexity but I was still working on 242 00:09:35,160 --> 00:09:39,779 the on the simple problem however that 243 00:09:37,440 --> 00:09:42,060 step allowed me to tackle a harder 244 00:09:39,779 --> 00:09:44,700 problem which was not just a square 245 00:09:42,060 --> 00:09:46,380 Planet but any weird shaped planet in 2D 246 00:09:44,700 --> 00:09:47,700 cross-section let's see what the 247 00:09:46,380 --> 00:09:49,740 gravitational field looks like around 248 00:09:47,700 --> 00:09:51,600 that and continue to extend the field 249 00:09:49,740 --> 00:09:53,519 the solution further 250 00:09:51,600 --> 00:09:55,800 and so if I visualize it it looks like 251 00:09:53,519 --> 00:09:58,800 this we've got the square planet 252 00:09:55,800 --> 00:10:01,140 as the starting point and the most 253 00:09:58,800 --> 00:10:03,360 simple solution the for Loops then 254 00:10:01,140 --> 00:10:05,160 getting slightly more complicated with 255 00:10:03,360 --> 00:10:07,500 the numpy version one and numpy version 256 00:10:05,160 --> 00:10:09,060 two we get to version two then we can 257 00:10:07,500 --> 00:10:12,300 start moving in the problem complexity 258 00:10:09,060 --> 00:10:14,220 space and look at extending the 2D 259 00:10:12,300 --> 00:10:16,560 solution into 3D and actually get the 260 00:10:14,220 --> 00:10:18,600 picture of a cubic Planet but also 261 00:10:16,560 --> 00:10:21,360 choose any sort of arbitrary shape and 262 00:10:18,600 --> 00:10:23,339 in this case I I chose to just take an 263 00:10:21,360 --> 00:10:26,220 image and threshold it and anything 264 00:10:23,339 --> 00:10:28,980 inside the above the threshold would be 265 00:10:26,220 --> 00:10:31,080 mass of the planet and then we would 266 00:10:28,980 --> 00:10:33,120 look at the boundary of that and figure 267 00:10:31,080 --> 00:10:34,080 out how gravity varied around the 268 00:10:33,120 --> 00:10:36,260 boundary 269 00:10:34,080 --> 00:10:39,480 so to get back to the original question 270 00:10:36,260 --> 00:10:40,800 uh of what does it what does a gravity 271 00:10:39,480 --> 00:10:43,080 field look like around a square Planet 272 00:10:40,800 --> 00:10:45,660 well this is this is the the rendering 273 00:10:43,080 --> 00:10:47,519 uh with matplotlib of that numpy 274 00:10:45,660 --> 00:10:50,700 calculation and we can see that at the 275 00:10:47,519 --> 00:10:52,980 corners uh the gravity Vector indeed 276 00:10:50,700 --> 00:10:54,540 points uh into the corners in a 277 00:10:52,980 --> 00:10:56,640 symmetrical way rather than suggesting 278 00:10:54,540 --> 00:10:59,399 that there's a cliff at any of the 279 00:10:56,640 --> 00:11:01,680 corners and as we get further away from 280 00:10:59,399 --> 00:11:03,600 the planet it looks actually more like 281 00:11:01,680 --> 00:11:05,279 the typical gravity field that we'd find 282 00:11:03,600 --> 00:11:07,500 around a spherical Planet so that's also 283 00:11:05,279 --> 00:11:09,300 a good sign 284 00:11:07,500 --> 00:11:10,440 so we can answer The Whimsy and we can 285 00:11:09,300 --> 00:11:12,660 answer the question what happens at the 286 00:11:10,440 --> 00:11:16,380 edges it is actually like you're at the 287 00:11:12,660 --> 00:11:17,640 top of a roof but if you if you consider 288 00:11:16,380 --> 00:11:19,260 that if you consider how the gravity 289 00:11:17,640 --> 00:11:21,839 varies along the edge it's pretty weird 290 00:11:19,260 --> 00:11:23,700 and pretty cool uh at the if you're 291 00:11:21,839 --> 00:11:25,260 sitting at that point on the edge you'd 292 00:11:23,700 --> 00:11:27,420 be looking down what appeared to be a 293 00:11:25,260 --> 00:11:29,880 flat 45 degree slope that you could 294 00:11:27,420 --> 00:11:31,920 slide off the end of and into space when 295 00:11:29,880 --> 00:11:33,720 you reach the far end of that face if 296 00:11:31,920 --> 00:11:34,980 you did start sliding however by the 297 00:11:33,720 --> 00:11:36,720 time you reach the middle of the face 298 00:11:34,980 --> 00:11:38,300 you wouldn't be accelerating anymore 299 00:11:36,720 --> 00:11:40,740 you'd feel like you're on flat ground 300 00:11:38,300 --> 00:11:42,660 and as you continue to travel along that 301 00:11:40,740 --> 00:11:44,700 face you'd actually slow down before 302 00:11:42,660 --> 00:11:46,560 coming to a stop at the far end of that 303 00:11:44,700 --> 00:11:48,660 face and then oscillating backwards and 304 00:11:46,560 --> 00:11:51,480 forwards this sounds like a pretty cool 305 00:11:48,660 --> 00:11:53,700 Fairground ride to me 306 00:11:51,480 --> 00:11:55,800 and so then we can so with that question 307 00:11:53,700 --> 00:11:58,140 answered of course we can go a bit more 308 00:11:55,800 --> 00:12:01,140 complicated uh in the in the problem 309 00:11:58,140 --> 00:12:03,540 space and and take any take any image as 310 00:12:01,140 --> 00:12:05,940 I said so the rubber duck here using 311 00:12:03,540 --> 00:12:08,040 pillow uh to do the image processing and 312 00:12:05,940 --> 00:12:11,700 give us a threshold and we can then 313 00:12:08,040 --> 00:12:13,380 perform the same calculations uh find a 314 00:12:11,700 --> 00:12:15,540 path around the boundary of the object 315 00:12:13,380 --> 00:12:18,000 which it might appear to somebody 316 00:12:15,540 --> 00:12:19,620 walking on the surface uh they could see 317 00:12:18,000 --> 00:12:21,300 how the gravity varies in strength and 318 00:12:19,620 --> 00:12:22,980 direction 319 00:12:21,300 --> 00:12:24,839 so that was a bit of Whimsy a bit of 320 00:12:22,980 --> 00:12:27,120 maths and a bit of python and what 321 00:12:24,839 --> 00:12:29,220 outcomes did I get from that well I 322 00:12:27,120 --> 00:12:31,140 board my kids with all the minutiae this 323 00:12:29,220 --> 00:12:33,000 solution which is a pretty common 324 00:12:31,140 --> 00:12:34,079 scenario in the Cole's household I must 325 00:12:33,000 --> 00:12:35,399 admit 326 00:12:34,079 --> 00:12:37,019 um but through the process I learned a 327 00:12:35,399 --> 00:12:38,760 lot about numpy operations especially 328 00:12:37,019 --> 00:12:40,800 How To Be Clever with indexing into 329 00:12:38,760 --> 00:12:42,899 arrays which I've been able to use over 330 00:12:40,800 --> 00:12:45,600 and over again and kind of established 331 00:12:42,899 --> 00:12:47,160 this pattern for learning works and as I 332 00:12:45,600 --> 00:12:49,459 said I really want to visit a square 333 00:12:47,160 --> 00:12:52,019 Planet slide down and back up the sides 334 00:12:49,459 --> 00:12:55,260 so I hope I'll be able to do that one 335 00:12:52,019 --> 00:12:57,120 day but in covert lockdown I was pretty 336 00:12:55,260 --> 00:12:58,800 close stuck pretty close to home in 337 00:12:57,120 --> 00:13:02,040 Victoria we had the five kilometer limit 338 00:12:58,800 --> 00:13:04,680 and the 60 even the 60 Minute limit per 339 00:13:02,040 --> 00:13:07,320 day within those limits I was trying to 340 00:13:04,680 --> 00:13:10,019 find some kind of exercise to do 341 00:13:07,320 --> 00:13:12,420 and I hit upon the idea of practicing 342 00:13:10,019 --> 00:13:14,279 wheelies on my bike in the back streets 343 00:13:12,420 --> 00:13:16,980 of the neighborhood but also the maths 344 00:13:14,279 --> 00:13:18,540 question of what have I measured uh how 345 00:13:16,980 --> 00:13:20,880 I was doing wheelies with the 346 00:13:18,540 --> 00:13:22,620 accelerometers of my phone artfully 347 00:13:20,880 --> 00:13:24,959 attached with gaffer tape there to the 348 00:13:22,620 --> 00:13:27,420 top tube of my bike and so this was 349 00:13:24,959 --> 00:13:29,880 another another bit of Whimsy to pursue 350 00:13:27,420 --> 00:13:31,740 and another another project that I could 351 00:13:29,880 --> 00:13:33,839 pursue in small chunks as well slightly 352 00:13:31,740 --> 00:13:36,480 bigger than the the square Planet but 353 00:13:33,839 --> 00:13:38,959 small chunks nonetheless nonetheless the 354 00:13:36,480 --> 00:13:42,300 first one was to build a data collection 355 00:13:38,959 --> 00:13:44,100 Pipeline and so each time I went out 356 00:13:42,300 --> 00:13:46,320 with my phone I could download the 357 00:13:44,100 --> 00:13:48,420 results from the sensor log app that I 358 00:13:46,320 --> 00:13:51,300 was using into something of a training 359 00:13:48,420 --> 00:13:53,700 diary or a Strava for wheelies as I 360 00:13:51,300 --> 00:13:56,160 called it this made use of pandas sci-fi 361 00:13:53,700 --> 00:14:00,240 and a runtime a run length encoding 362 00:13:56,160 --> 00:14:03,420 Library called python rle to uh to from 363 00:14:00,240 --> 00:14:04,500 the so sampling the pitch basically what 364 00:14:03,420 --> 00:14:07,800 we're looking at here is sampling the 365 00:14:04,500 --> 00:14:10,139 pitch of the phone at one tenth of a 366 00:14:07,800 --> 00:14:12,240 second intervals and then from that time 367 00:14:10,139 --> 00:14:15,360 series data extracting useful features 368 00:14:12,240 --> 00:14:18,360 such as the length of a wheelie for 369 00:14:15,360 --> 00:14:20,399 further analysis 370 00:14:18,360 --> 00:14:22,920 and then the second so so then having 371 00:14:20,399 --> 00:14:25,200 that data those richer features I could 372 00:14:22,920 --> 00:14:27,540 move on to can I build myself a wheelie 373 00:14:25,200 --> 00:14:29,279 coach uh with machine learning to help 374 00:14:27,540 --> 00:14:31,200 me improve my performance still further 375 00:14:29,279 --> 00:14:33,540 and so the first iteration of this 376 00:14:31,200 --> 00:14:35,399 wheelie coach was taking the half a 377 00:14:33,540 --> 00:14:37,560 second where at the front wheel of the 378 00:14:35,399 --> 00:14:39,420 bike is going up and based on the the 379 00:14:37,560 --> 00:14:41,519 time series trace of that can we predict 380 00:14:39,420 --> 00:14:44,519 how long how long the wheelie is going 381 00:14:41,519 --> 00:14:45,959 to last and so that was I was able to 382 00:14:44,519 --> 00:14:47,699 predict that better than random guessing 383 00:14:45,959 --> 00:14:49,440 with an ml model so that that was an 384 00:14:47,699 --> 00:14:51,660 improvement 385 00:14:49,440 --> 00:14:53,339 The Next Step Beyond that was then to 386 00:14:51,660 --> 00:14:56,160 say okay we've got the front wheel up 387 00:14:53,339 --> 00:14:57,839 and we're balancing uh how might we 388 00:14:56,160 --> 00:15:00,720 predict how the wheel is going to go 389 00:14:57,839 --> 00:15:02,760 from any point in the balance phase so 390 00:15:00,720 --> 00:15:04,800 am I likely to keep going or am I likely 391 00:15:02,760 --> 00:15:06,180 to actually lose my balance and put the 392 00:15:04,800 --> 00:15:07,940 wheel down again 393 00:15:06,180 --> 00:15:10,380 so this was a slightly more complicated 394 00:15:07,940 --> 00:15:12,240 ml approach which is a series to series 395 00:15:10,380 --> 00:15:14,279 prediction but as you can see I'm 396 00:15:12,240 --> 00:15:17,880 gradually able to layer on more and more 397 00:15:14,279 --> 00:15:20,579 by biting off small chunks at each time 398 00:15:17,880 --> 00:15:21,720 and what I found actually uh so some of 399 00:15:20,579 --> 00:15:24,060 those things I've planned ahead of time 400 00:15:21,720 --> 00:15:26,040 but then other things emerge as you're 401 00:15:24,060 --> 00:15:28,079 going and so one of those was actually 402 00:15:26,040 --> 00:15:30,360 realizing that when I had enough wheelie 403 00:15:28,079 --> 00:15:32,699 data I could build my own generative Ai 404 00:15:30,360 --> 00:15:35,639 and I could actually create more wheelie 405 00:15:32,699 --> 00:15:37,320 data based only on the duration and 406 00:15:35,639 --> 00:15:39,540 create some synthetic data so this is 407 00:15:37,320 --> 00:15:42,360 using an auto encoder which takes 10 408 00:15:39,540 --> 00:15:44,160 seconds of Time series data boils it 409 00:15:42,360 --> 00:15:46,920 down into just three data points and 410 00:15:44,160 --> 00:15:48,839 from what I could tell the model was 411 00:15:46,920 --> 00:15:50,880 recognizing that wheelies are either 412 00:15:48,839 --> 00:15:52,440 short or long they had a gradual or a 413 00:15:50,880 --> 00:15:54,060 sharp Landing or they were low and 414 00:15:52,440 --> 00:15:56,279 smooth or high and Wiggly 415 00:15:54,060 --> 00:15:58,260 and then we can generate new Trace new 416 00:15:56,279 --> 00:16:01,639 traces on demand if I'd built it today I 417 00:15:58,260 --> 00:16:01,639 might have called it wheelie GPA 418 00:16:02,220 --> 00:16:06,300 so those were some 419 00:16:04,139 --> 00:16:09,540 um some examples of you know just pure 420 00:16:06,300 --> 00:16:11,399 Whimsy uh for interest sake uh you know 421 00:16:09,540 --> 00:16:12,899 I got some learning that I was maybe 422 00:16:11,399 --> 00:16:14,279 able to apply indirectly but nothing 423 00:16:12,899 --> 00:16:16,079 that I was able to apply directly 424 00:16:14,279 --> 00:16:18,120 unfortunately we don't have too many 425 00:16:16,079 --> 00:16:22,139 clients who are working on their 426 00:16:18,120 --> 00:16:23,279 wheelies at thoughtworks so but there 427 00:16:22,139 --> 00:16:24,839 are some other questions that came up 428 00:16:23,279 --> 00:16:27,060 that could find Direct application in 429 00:16:24,839 --> 00:16:29,519 client work and so one of those was the 430 00:16:27,060 --> 00:16:31,079 question of how to communicate the 431 00:16:29,519 --> 00:16:33,480 performance of machine Learning Systems 432 00:16:31,079 --> 00:16:36,180 to clients a typical way to do this is 433 00:16:33,480 --> 00:16:38,220 with a confusion Matrix and so confusion 434 00:16:36,180 --> 00:16:40,199 Matrix is a great because they show us 435 00:16:38,220 --> 00:16:42,420 when we're getting the answer right with 436 00:16:40,199 --> 00:16:45,120 a classifier but most importantly they 437 00:16:42,420 --> 00:16:46,860 also show us when what types of mistakes 438 00:16:45,120 --> 00:16:49,500 we're making because often in 439 00:16:46,860 --> 00:16:52,440 classification mistakes have asymmetric 440 00:16:49,500 --> 00:16:54,240 costs in some cases false positives more 441 00:16:52,440 --> 00:16:56,579 costly in some other cases false 442 00:16:54,240 --> 00:16:59,279 negatives are more costly but it's 443 00:16:56,579 --> 00:17:01,860 actually quite hard for non-experts to 444 00:16:59,279 --> 00:17:03,420 access a confusion Matrix and to to 445 00:17:01,860 --> 00:17:06,120 figure out what it's trying to tell them 446 00:17:03,420 --> 00:17:09,480 in other areas we've found that Sankey 447 00:17:06,120 --> 00:17:11,400 diagrams which show flows or resource 448 00:17:09,480 --> 00:17:13,140 the flow of resources between states or 449 00:17:11,400 --> 00:17:15,600 parts of the system are actually really 450 00:17:13,140 --> 00:17:18,240 easy and intuitive for clients to 451 00:17:15,600 --> 00:17:20,459 understand interestingly the underlying 452 00:17:18,240 --> 00:17:23,280 data for both confusion Matrix and 453 00:17:20,459 --> 00:17:26,459 Sankey diagrams is in the same form as a 454 00:17:23,280 --> 00:17:28,679 matrix so I wondered what would it look 455 00:17:26,459 --> 00:17:30,840 like to try and draw a confusion Matrix 456 00:17:28,679 --> 00:17:34,140 as a Sankey diagram 457 00:17:30,840 --> 00:17:35,580 and the answer is it actually works and 458 00:17:34,140 --> 00:17:38,160 it helped us have some richer client 459 00:17:35,580 --> 00:17:39,780 conversations where in this case we're 460 00:17:38,160 --> 00:17:41,580 comparing two different versions of a 461 00:17:39,780 --> 00:17:43,980 classifier and we're comparing them to 462 00:17:41,580 --> 00:17:46,320 an existing process the existing process 463 00:17:43,980 --> 00:17:48,780 is at both ends so we can see manually 464 00:17:46,320 --> 00:17:51,360 which decisions have been given a true 465 00:17:48,780 --> 00:17:52,860 or a false label and then in on the left 466 00:17:51,360 --> 00:17:55,620 in the middle we can see method one 467 00:17:52,860 --> 00:17:58,080 which has better accuracy so it gets 468 00:17:55,620 --> 00:18:00,480 fewer things wrong overall and then we 469 00:17:58,080 --> 00:18:02,580 have method two which has worse accuracy 470 00:18:00,480 --> 00:18:04,380 that actually has no false positives in 471 00:18:02,580 --> 00:18:06,000 this case and if false positives are 472 00:18:04,380 --> 00:18:09,059 particularly costly then maybe we'd go 473 00:18:06,000 --> 00:18:11,160 with method two instead by having them 474 00:18:09,059 --> 00:18:13,200 all on the same chart instead of 475 00:18:11,160 --> 00:18:15,000 separate confusion matrixes we can 476 00:18:13,200 --> 00:18:17,039 actually also then compare method one 477 00:18:15,000 --> 00:18:18,660 and Method two in the middle and say 478 00:18:17,039 --> 00:18:20,940 what's happening where they disagree on 479 00:18:18,660 --> 00:18:23,160 a prediction what are the factors that 480 00:18:20,940 --> 00:18:24,900 drive one model to make a decision one 481 00:18:23,160 --> 00:18:26,580 way or the other model to make a 482 00:18:24,900 --> 00:18:28,080 decision the other way and so this was 483 00:18:26,580 --> 00:18:30,000 something that was a bit easier a bit 484 00:18:28,080 --> 00:18:31,740 more accessible for clients that weren't 485 00:18:30,000 --> 00:18:34,380 expert you know evaluating machine 486 00:18:31,740 --> 00:18:35,880 Learning Systems to talk about how well 487 00:18:34,380 --> 00:18:38,960 different machine learning approaches 488 00:18:35,880 --> 00:18:38,960 might work in their case 489 00:18:39,360 --> 00:18:44,460 and it's also good for wheelies as it 490 00:18:41,520 --> 00:18:46,500 turns out so looking at that that second 491 00:18:44,460 --> 00:18:47,660 stage of the coach of predicting what's 492 00:18:46,500 --> 00:18:50,039 going to happen in the balance phase 493 00:18:47,660 --> 00:18:52,280 instead of this being a binary confusion 494 00:18:50,039 --> 00:18:54,539 Matrix we see there's it's a multi-class 495 00:18:52,280 --> 00:18:56,220 classification from continuing to 496 00:18:54,539 --> 00:18:58,500 balance or to or to put the wheel down 497 00:18:56,220 --> 00:19:00,539 on the ground and we can also show that 498 00:18:58,500 --> 00:19:02,220 as a confusion Matrix instead and I 499 00:19:00,539 --> 00:19:03,780 think what's nice as a Sankey diagram 500 00:19:02,220 --> 00:19:06,120 instead I think what's nice here is that 501 00:19:03,780 --> 00:19:07,679 you visually get a sense of the size of 502 00:19:06,120 --> 00:19:10,080 the different classes which can be 503 00:19:07,679 --> 00:19:13,500 harder to do from what's typically the 504 00:19:10,080 --> 00:19:15,000 heat map coloring in a confusion Matrix 505 00:19:13,500 --> 00:19:16,440 so that was it was good to see how 506 00:19:15,000 --> 00:19:18,900 things are starting to come together a 507 00:19:16,440 --> 00:19:21,020 little bit techniques driven by one 508 00:19:18,900 --> 00:19:23,580 piece of Whimsy start to be applicable 509 00:19:21,020 --> 00:19:25,220 somewhere else 510 00:19:23,580 --> 00:19:27,480 and so 511 00:19:25,220 --> 00:19:29,100 you're diving a bit deeper into the 512 00:19:27,480 --> 00:19:31,200 different outcomes which I might 513 00:19:29,100 --> 00:19:32,580 describe as outputs learnings and 514 00:19:31,200 --> 00:19:35,520 applications from each of these mini 515 00:19:32,580 --> 00:19:37,260 projects in terms of outputs I would 516 00:19:35,520 --> 00:19:40,260 typically get python notebooks and 517 00:19:37,260 --> 00:19:43,620 modules and then also typically write 518 00:19:40,260 --> 00:19:45,320 those up into blogs or or talks like I'm 519 00:19:43,620 --> 00:19:48,120 doing today quite matter 520 00:19:45,320 --> 00:19:50,400 but beyond the beyond the artifacts as 521 00:19:48,120 --> 00:19:52,380 outputs the learning of my own and that 522 00:19:50,400 --> 00:19:55,380 I could share with others and then 523 00:19:52,380 --> 00:20:00,260 applications in my day job to supporting 524 00:19:55,380 --> 00:20:03,059 we might do pocs or content creation for 525 00:20:00,260 --> 00:20:06,539 developing points of views for marketing 526 00:20:03,059 --> 00:20:08,940 uh so there's a potential to apply these 527 00:20:06,539 --> 00:20:11,160 uh these projects in that space setting 528 00:20:08,940 --> 00:20:12,780 up engagements for Success being able to 529 00:20:11,160 --> 00:20:15,179 anticipate problems that might come up 530 00:20:12,780 --> 00:20:17,940 and plan plan those in the early days of 531 00:20:15,179 --> 00:20:20,700 engagements and also during engagements 532 00:20:17,940 --> 00:20:24,500 be able to support better outcomes 533 00:20:20,700 --> 00:20:24,500 so lots lots of different applications 534 00:20:24,600 --> 00:20:30,360 and having having dived into a few 535 00:20:27,480 --> 00:20:32,160 specific examples we can look at the 536 00:20:30,360 --> 00:20:33,720 overall learning pattern now as well 537 00:20:32,160 --> 00:20:36,120 just to just to reinforce what I was 538 00:20:33,720 --> 00:20:38,700 talking about 539 00:20:36,120 --> 00:20:41,640 and so it's pretty simple I see 540 00:20:38,700 --> 00:20:43,200 something interesting uh ask if there's 541 00:20:41,640 --> 00:20:45,539 some maths involved and what type of 542 00:20:43,200 --> 00:20:47,340 maths that might be and then also ask if 543 00:20:45,539 --> 00:20:49,559 there's any prior art out there and so 544 00:20:47,340 --> 00:20:51,059 when it comes to confusion Matrix as a 545 00:20:49,559 --> 00:20:53,760 Sankey diagrams those things have been 546 00:20:51,059 --> 00:20:56,480 done before but not necessarily in the 547 00:20:53,760 --> 00:21:01,799 form that I was looking for in this case 548 00:20:56,480 --> 00:21:03,299 and then uh and then when uh I guess 549 00:21:01,799 --> 00:21:05,340 I've sort of evaluated that there's some 550 00:21:03,299 --> 00:21:07,980 value in in doing something in this 551 00:21:05,340 --> 00:21:10,200 space the next question is can I break 552 00:21:07,980 --> 00:21:12,539 it down small enough or frame it in a 553 00:21:10,200 --> 00:21:14,640 way that it fits within a Sprint and I'm 554 00:21:12,539 --> 00:21:18,720 talking about like a typical Fortnight 555 00:21:14,640 --> 00:21:22,320 period but as I said I have a day job 556 00:21:18,720 --> 00:21:25,020 and so it's typically not uh like it's 557 00:21:22,320 --> 00:21:26,520 not it's not an 80-hour Sprint it's 558 00:21:25,020 --> 00:21:29,520 probably more like a 20 hour Sprint 559 00:21:26,520 --> 00:21:32,460 spread over the course of two weeks and 560 00:21:29,520 --> 00:21:34,440 so this requires the opportunity to 561 00:21:32,460 --> 00:21:36,000 present itself at times in my career 562 00:21:34,440 --> 00:21:38,100 I've had a lot of spare time to work on 563 00:21:36,000 --> 00:21:40,260 these things at other times I haven't 564 00:21:38,100 --> 00:21:42,120 covered obviously provide a lot of spare 565 00:21:40,260 --> 00:21:43,140 time to work on these things since then 566 00:21:42,120 --> 00:21:44,659 I've had to be a little bit more 567 00:21:43,140 --> 00:21:47,580 opportunistic 568 00:21:44,659 --> 00:21:49,380 but I think it's important to note that 569 00:21:47,580 --> 00:21:51,659 you can have a backlog of ideas and then 570 00:21:49,380 --> 00:21:55,559 wait until you have the time to pursue 571 00:21:51,659 --> 00:21:56,760 them if they do if you then either then 572 00:21:55,559 --> 00:21:59,039 recognize that I've got the time to 573 00:21:56,760 --> 00:22:02,280 pursue something I can kick off a Sprint 574 00:21:59,039 --> 00:22:04,200 uh solve the problems code them up in 575 00:22:02,280 --> 00:22:06,600 small steps as I've said write it up as 576 00:22:04,200 --> 00:22:10,080 well and then look to see if there are 577 00:22:06,600 --> 00:22:12,360 any interesting extensions which might 578 00:22:10,080 --> 00:22:13,740 lead me back to the start and hopefully 579 00:22:12,360 --> 00:22:15,900 over time we'll find some applications 580 00:22:13,740 --> 00:22:17,880 and it's been my experience that I have 581 00:22:15,900 --> 00:22:20,100 found applications over time although 582 00:22:17,880 --> 00:22:22,799 that is disconnected it's not tightly 583 00:22:20,100 --> 00:22:25,760 coupled to the process of on one 584 00:22:22,799 --> 00:22:25,760 particular project 585 00:22:26,159 --> 00:22:32,940 the um and so this process is 586 00:22:30,020 --> 00:22:35,900 because it's iterative and you know 587 00:22:32,940 --> 00:22:38,700 maybe multi-scale as well 588 00:22:35,900 --> 00:22:40,559 I have some projects in their own repos 589 00:22:38,700 --> 00:22:43,620 but I have this this specific maths 590 00:22:40,559 --> 00:22:46,200 Whimsy repo and that's why how I came to 591 00:22:43,620 --> 00:22:48,240 think about talking about it here and so 592 00:22:46,200 --> 00:22:50,400 the mass Whimsy repo is really to lower 593 00:22:48,240 --> 00:22:52,980 the any barriers to to getting anything 594 00:22:50,400 --> 00:22:54,840 started and written in mathswimsy I 595 00:22:52,980 --> 00:22:56,820 might just write a notebook which is a 596 00:22:54,840 --> 00:22:59,580 handful of lines of code to do something 597 00:22:56,820 --> 00:23:01,620 like eliminate a node from a graph 598 00:22:59,580 --> 00:23:03,659 um it's uh these are things that might 599 00:23:01,620 --> 00:23:04,860 lead into bigger projects or they might 600 00:23:03,659 --> 00:23:06,900 actually have come from the bigger 601 00:23:04,860 --> 00:23:09,179 projects as a sub problem to be solved 602 00:23:06,900 --> 00:23:10,799 but one that's reusable and repeatable 603 00:23:09,179 --> 00:23:12,840 so I think it lives better in math 604 00:23:10,799 --> 00:23:15,120 squimsy so you can see some examples 605 00:23:12,840 --> 00:23:16,860 there from the from what I've showed you 606 00:23:15,120 --> 00:23:19,320 that sit sort of on the bigger project 607 00:23:16,860 --> 00:23:20,640 repo side or on the math swimsy repo 608 00:23:19,320 --> 00:23:23,940 side 609 00:23:20,640 --> 00:23:25,380 and how and one last set of examples of 610 00:23:23,940 --> 00:23:26,400 how things might move from one to the 611 00:23:25,380 --> 00:23:28,200 other 612 00:23:26,400 --> 00:23:30,659 um so I've just discovered another area 613 00:23:28,200 --> 00:23:33,000 that I tend to explore is puzzles and 614 00:23:30,659 --> 00:23:35,159 automating or augmenting Human Solutions 615 00:23:33,000 --> 00:23:37,140 to puzzles this actually started back in 616 00:23:35,159 --> 00:23:39,480 my math swimsuit with basic days there's 617 00:23:37,140 --> 00:23:42,059 a cube puzzle called instant insanity 618 00:23:39,480 --> 00:23:44,299 and rather than go insane I decided to 619 00:23:42,059 --> 00:23:47,700 write a basic solver to solve it for me 620 00:23:44,299 --> 00:23:49,440 but in recent times I've was interested 621 00:23:47,700 --> 00:23:50,820 in Samantha that's another another game 622 00:23:49,440 --> 00:23:53,760 that can drive you insane trying to 623 00:23:50,820 --> 00:23:55,500 solve it and thinking about the the 624 00:23:53,760 --> 00:23:56,940 embedding space the 300 dimensional 625 00:23:55,500 --> 00:23:59,880 embedding space how to actually navigate 626 00:23:56,940 --> 00:24:01,440 that in an automated way to to find a 627 00:23:59,880 --> 00:24:03,900 solution and so that was something that 628 00:24:01,440 --> 00:24:05,159 started as just a bit of math Whimsy and 629 00:24:03,900 --> 00:24:06,539 as I thought about different ways of 630 00:24:05,159 --> 00:24:09,059 solving it and the fact that I could 631 00:24:06,539 --> 00:24:11,760 actually plug in the solver into a game 632 00:24:09,059 --> 00:24:13,620 with friends and play it live uh that 633 00:24:11,760 --> 00:24:14,659 that then iterated and became its own 634 00:24:13,620 --> 00:24:17,700 project 635 00:24:14,659 --> 00:24:21,240 the one on the bottom uh asteroid Escape 636 00:24:17,700 --> 00:24:22,500 it's a game we have at home 109 tips to 637 00:24:21,240 --> 00:24:25,020 solve the hardest one I thought that was 638 00:24:22,500 --> 00:24:27,780 much better automated than solved 639 00:24:25,020 --> 00:24:29,039 manually and but looking at the catalog 640 00:24:27,780 --> 00:24:30,720 of solutions they had I thought wouldn't 641 00:24:29,039 --> 00:24:32,460 it be interesting to generate more 642 00:24:30,720 --> 00:24:34,919 puzzles with interesting Solutions so 643 00:24:32,460 --> 00:24:37,760 that might be that might be part two of 644 00:24:34,919 --> 00:24:37,760 that particular project 645 00:24:38,880 --> 00:24:43,380 and so again looking at looking at 646 00:24:41,640 --> 00:24:45,659 individual examples and how they connect 647 00:24:43,380 --> 00:24:48,960 together I'd now like to take a look at 648 00:24:45,659 --> 00:24:51,360 the bigger picture uh the the Cascade as 649 00:24:48,960 --> 00:24:53,280 I've hinted about how different projects 650 00:24:51,360 --> 00:24:54,539 come together 651 00:24:53,280 --> 00:24:56,400 and 652 00:24:54,539 --> 00:24:59,220 as I said it gets sometimes talking 653 00:24:56,400 --> 00:25:00,179 about things qualitatively helps and I 654 00:24:59,220 --> 00:25:01,919 started thinking about this 655 00:25:00,179 --> 00:25:03,600 qualitatively but then I realized I 656 00:25:01,919 --> 00:25:05,520 could do it quantitatively as well and 657 00:25:03,600 --> 00:25:07,260 what's the maths in this case a 658 00:25:05,520 --> 00:25:09,539 Knowledge Graph so I thought let's 659 00:25:07,260 --> 00:25:11,039 actually take a Knowledge Graph to all 660 00:25:09,539 --> 00:25:13,559 of these projects that I've played with 661 00:25:11,039 --> 00:25:16,500 over the years and this is what it looks 662 00:25:13,559 --> 00:25:20,640 like for the square Planet example from 663 00:25:16,500 --> 00:25:22,640 earlier so I have an idea and some maths 664 00:25:20,640 --> 00:25:24,840 Square Planet idea the Newton gravity 665 00:25:22,640 --> 00:25:26,760 there's a couple of python libraries 666 00:25:24,840 --> 00:25:28,740 there matplot live and numpy as I 667 00:25:26,760 --> 00:25:31,799 described they come together into a 668 00:25:28,740 --> 00:25:33,720 Sprint which delivers a notebook and 669 00:25:31,799 --> 00:25:35,580 also delivers some learning numpy 670 00:25:33,720 --> 00:25:37,500 development to matplotlib development so 671 00:25:35,580 --> 00:25:40,500 if I'd only done one project this would 672 00:25:37,500 --> 00:25:43,740 be the extent of the knowledge graph 673 00:25:40,500 --> 00:25:45,480 but then as I uh in the case of the 674 00:25:43,740 --> 00:25:48,059 square Planet I extended it into a weird 675 00:25:45,480 --> 00:25:50,279 planet and also then did some uh 676 00:25:48,059 --> 00:25:53,159 rendering of LaGrange points around a 677 00:25:50,279 --> 00:25:55,340 planet Moon system out of Interest then 678 00:25:53,159 --> 00:25:58,080 it starts to build some more connections 679 00:25:55,340 --> 00:26:00,900 so we start to see some more inspiration 680 00:25:58,080 --> 00:26:03,000 and we start to see cycles of numpy 681 00:26:00,900 --> 00:26:05,100 learning for instance numpy development 682 00:26:03,000 --> 00:26:07,279 learning back to using use of the numpy 683 00:26:05,100 --> 00:26:09,720 library 684 00:26:07,279 --> 00:26:12,059 and then as we start to bring in more 685 00:26:09,720 --> 00:26:16,500 examples at first the graph might have 686 00:26:12,059 --> 00:26:18,539 separated uh groups of components but we 687 00:26:16,500 --> 00:26:21,419 can see that we're starting to to add 688 00:26:18,539 --> 00:26:23,940 more nodes and more edges 689 00:26:21,419 --> 00:26:26,279 as we gradually add more projects then 690 00:26:23,940 --> 00:26:28,380 it becomes richer and I've actually gone 691 00:26:26,279 --> 00:26:31,020 through the whole contents of the maths 692 00:26:28,380 --> 00:26:33,419 Whimsy repo but not all of those other 693 00:26:31,020 --> 00:26:36,360 projects that I showed you on the right 694 00:26:33,419 --> 00:26:38,820 hand side of the diagram 695 00:26:36,360 --> 00:26:40,380 so this is what it looks like with 696 00:26:38,820 --> 00:26:42,840 everything in the math Whimsy repo in 697 00:26:40,380 --> 00:26:43,980 there and so what comes out and you know 698 00:26:42,840 --> 00:26:46,140 maybe it's a little bit of an artifact 699 00:26:43,980 --> 00:26:47,940 of how I modeled it but definitely that 700 00:26:46,140 --> 00:26:49,919 the libraries and the Sprints are 701 00:26:47,940 --> 00:26:51,860 Central Concepts in the graph so there's 702 00:26:49,919 --> 00:26:54,779 where that's where things come together 703 00:26:51,860 --> 00:26:57,120 where ideas come together and get turned 704 00:26:54,779 --> 00:27:00,000 into outputs and applications 705 00:26:57,120 --> 00:27:03,480 and the learning that I modeled uh I'd 706 00:27:00,000 --> 00:27:05,100 it participates in Cycles so I find the 707 00:27:03,480 --> 00:27:06,900 learning comes out of the process but 708 00:27:05,100 --> 00:27:09,179 also goes back into the process as an 709 00:27:06,900 --> 00:27:11,279 input The Whimsy and the maths of the 710 00:27:09,179 --> 00:27:13,620 sources and the outputs and applications 711 00:27:11,279 --> 00:27:14,760 of the sinks in this graph and there's 712 00:27:13,620 --> 00:27:16,380 yeah there's a bunch of applications 713 00:27:14,760 --> 00:27:18,779 beyond that 714 00:27:16,380 --> 00:27:21,440 um as I showed you comparing multi-stage 715 00:27:18,779 --> 00:27:24,840 classifiers I was able to 716 00:27:21,440 --> 00:27:27,679 reuse some of this work in uh entity 717 00:27:24,840 --> 00:27:30,900 resolution work that we did with clients 718 00:27:27,679 --> 00:27:32,580 some of it's contributed to practical 719 00:27:30,900 --> 00:27:34,520 data privacy book from my colleague 720 00:27:32,580 --> 00:27:38,159 Catherine Jamil 721 00:27:34,520 --> 00:27:40,380 and we've also been able to use it in 722 00:27:38,159 --> 00:27:42,360 tools for Designing EV charger networks 723 00:27:40,380 --> 00:27:44,520 as well so it's been great to see all 724 00:27:42,360 --> 00:27:46,799 these different applications uh coming 725 00:27:44,520 --> 00:27:49,200 out of the work 726 00:27:46,799 --> 00:27:51,600 and with a quantitative representation 727 00:27:49,200 --> 00:27:53,580 like this we can as well as asking 728 00:27:51,600 --> 00:27:56,340 qualitative questions we can start to 729 00:27:53,580 --> 00:27:58,200 ask quantitative questions as well and 730 00:27:56,340 --> 00:28:01,620 so looking at the graph the libraries 731 00:27:58,200 --> 00:28:03,840 that are most represented there map slot 732 00:28:01,620 --> 00:28:05,940 level numpy as you might expect also 733 00:28:03,840 --> 00:28:07,679 Network X I can highly recommend and or 734 00:28:05,940 --> 00:28:09,600 tools have come up useful for a number 735 00:28:07,679 --> 00:28:11,220 of projects 736 00:28:09,600 --> 00:28:14,159 um if I think back to that early part of 737 00:28:11,220 --> 00:28:16,500 my maths intensive career a library was 738 00:28:14,159 --> 00:28:19,200 a building that you went to in the hope 739 00:28:16,500 --> 00:28:21,659 of finding a textbook that might have an 740 00:28:19,200 --> 00:28:23,520 algorithm in pseudo code or C that you 741 00:28:21,659 --> 00:28:25,860 would then have to translate into your 742 00:28:23,520 --> 00:28:29,100 application and exhaustively test for 743 00:28:25,860 --> 00:28:32,460 weeks before uh being able to release it 744 00:28:29,100 --> 00:28:35,460 into a production Solution by comparison 745 00:28:32,460 --> 00:28:37,799 python library today is incredibly easy 746 00:28:35,460 --> 00:28:39,299 to get started so instead of a once a 747 00:28:37,799 --> 00:28:40,580 week cycle time we're up and running in 748 00:28:39,299 --> 00:28:43,380 minutes 749 00:28:40,580 --> 00:28:45,960 the documentation is generally very good 750 00:28:43,380 --> 00:28:47,880 and supported by lots of examples and of 751 00:28:45,960 --> 00:28:49,799 course you can always go and play if you 752 00:28:47,880 --> 00:28:52,380 have an interesting problem to learn 753 00:28:49,799 --> 00:28:54,840 more about them as well and in general I 754 00:28:52,380 --> 00:28:56,880 find them very very mathematically 755 00:28:54,840 --> 00:28:58,260 expressive so I actually guide you to 756 00:28:56,880 --> 00:29:00,720 the form of the solution that you need 757 00:28:58,260 --> 00:29:02,159 as well and python as a language is 758 00:29:00,720 --> 00:29:04,799 quite nice in that respect as well 759 00:29:02,159 --> 00:29:08,179 things look like things in code look 760 00:29:04,799 --> 00:29:08,179 like they would in maths as well 761 00:29:09,659 --> 00:29:14,460 so the overall lessons from today and 762 00:29:12,659 --> 00:29:18,140 thank you for indulging me 763 00:29:14,460 --> 00:29:20,399 to be driven by interest to be 764 00:29:18,140 --> 00:29:23,880 opportunistic with energy 765 00:29:20,399 --> 00:29:26,039 and small steps in problem and solution 766 00:29:23,880 --> 00:29:27,659 complexity are pretty important to be 767 00:29:26,039 --> 00:29:29,760 able to take those small steps to 768 00:29:27,659 --> 00:29:32,279 deliver outputs I've seen the learning 769 00:29:29,760 --> 00:29:33,899 Cascade through that process and the 770 00:29:32,279 --> 00:29:35,580 real world applications becoming 771 00:29:33,899 --> 00:29:37,440 apparent especially as you then know 772 00:29:35,580 --> 00:29:40,460 where to look for them after after doing 773 00:29:37,440 --> 00:29:40,460 projects like this 774 00:29:40,500 --> 00:29:45,539 and I hope uh you're able to take away 775 00:29:42,960 --> 00:29:48,059 that you can find inspiration anywhere 776 00:29:45,539 --> 00:29:50,760 that you're curious that with a 777 00:29:48,059 --> 00:29:54,360 structured process even for a nebulous 778 00:29:50,760 --> 00:29:56,640 question or a vague starting point you 779 00:29:54,360 --> 00:29:59,220 can make progress in demonstrable small 780 00:29:56,640 --> 00:30:01,080 steps that there's a lot of resources 781 00:29:59,220 --> 00:30:03,000 out there in the python ecosystem those 782 00:30:01,080 --> 00:30:05,760 libraries that I shared from the maths 783 00:30:03,000 --> 00:30:07,799 Whimsy repo are only a small subset of 784 00:30:05,760 --> 00:30:10,380 what I've used across all those projects 785 00:30:07,799 --> 00:30:12,299 and that those returns accumulate so the 786 00:30:10,380 --> 00:30:14,159 more you the more you spend time in the 787 00:30:12,299 --> 00:30:16,380 ecosystem the more you learn what it's 788 00:30:14,159 --> 00:30:19,500 possible of achieving 789 00:30:16,380 --> 00:30:21,120 I'd summarize it maybe as uh if you look 790 00:30:19,500 --> 00:30:23,039 at simulation as a technique that we 791 00:30:21,120 --> 00:30:25,320 might use it's a great technique for 792 00:30:23,039 --> 00:30:27,020 learning whenever it's hard or costly to 793 00:30:25,320 --> 00:30:30,240 access the real world 794 00:30:27,020 --> 00:30:32,700 and these math swimsies uh simulations 795 00:30:30,240 --> 00:30:35,399 of real world problems that circumvent 796 00:30:32,700 --> 00:30:37,679 the hard or costly bit and so help to 797 00:30:35,399 --> 00:30:38,940 accelerate my learning and with a 798 00:30:37,679 --> 00:30:40,320 similar approach you might accelerate 799 00:30:38,940 --> 00:30:44,279 your learning 800 00:30:40,320 --> 00:30:46,320 so uh that's it from me today you can 801 00:30:44,279 --> 00:30:49,140 find the examples at the mass Whimsy 802 00:30:46,320 --> 00:30:51,980 repo and the write-ups at my blog there 803 00:30:49,140 --> 00:30:51,980 if you would like to 804 00:30:52,140 --> 00:31:03,659 [Applause] 805 00:31:01,080 --> 00:31:07,220 thanks Dave I'm afraid we oh we probably 806 00:31:03,659 --> 00:31:07,220 have time for one question 807 00:31:08,520 --> 00:31:11,899 there we go there's one over there 808 00:31:12,600 --> 00:31:15,140 yes 809 00:31:16,260 --> 00:31:19,919 uh you appear to be presenting this as 810 00:31:18,179 --> 00:31:22,620 kind of the way you have learned new 811 00:31:19,919 --> 00:31:24,000 technologies explored ideas and whatnot 812 00:31:22,620 --> 00:31:25,740 um I wonder if you had any thoughts 813 00:31:24,000 --> 00:31:27,419 about this is an approach or as a 814 00:31:25,740 --> 00:31:31,380 technique either in an in a formal 815 00:31:27,419 --> 00:31:33,960 education setting or in an in-house you 816 00:31:31,380 --> 00:31:35,880 know staff and staff development kind of 817 00:31:33,960 --> 00:31:37,860 capacity using using similar techniques 818 00:31:35,880 --> 00:31:40,140 in that kind of space 819 00:31:37,860 --> 00:31:41,580 again I think it's applicable in both 820 00:31:40,140 --> 00:31:44,100 very much 821 00:31:41,580 --> 00:31:46,080 um it yet open-ended project-based 822 00:31:44,100 --> 00:31:49,620 learning uh really really helpful 823 00:31:46,080 --> 00:31:52,620 informal settings and uh it it is advice 824 00:31:49,620 --> 00:31:54,299 I give to people I work with and uh 825 00:31:52,620 --> 00:31:55,799 within our team and at client side as 826 00:31:54,299 --> 00:31:59,640 well if they're looking at picking up 827 00:31:55,799 --> 00:32:01,200 new technologies as as well as formal 828 00:31:59,640 --> 00:32:03,659 learning materials or theoretical 829 00:32:01,200 --> 00:32:06,120 learning Pathways to pick projects that 830 00:32:03,659 --> 00:32:09,059 they're interested in because those 831 00:32:06,120 --> 00:32:10,260 offer and those often uncover things 832 00:32:09,059 --> 00:32:12,899 that aren't covered in the formal 833 00:32:10,260 --> 00:32:15,480 learning pathway and and clean data sets 834 00:32:12,899 --> 00:32:18,179 that might be provided with difficult 835 00:32:15,480 --> 00:32:19,679 tutorials it's you know maybe it's uh 836 00:32:18,179 --> 00:32:22,380 there might be a parallel that we might 837 00:32:19,679 --> 00:32:24,240 draw with the performance of um uh say 838 00:32:22,380 --> 00:32:25,860 chat GPT and co-pilot for for 839 00:32:24,240 --> 00:32:27,720 reproducing code examples they're good 840 00:32:25,860 --> 00:32:29,279 at doing the things for which there's a 841 00:32:27,720 --> 00:32:31,500 lot of support a lot of resource out 842 00:32:29,279 --> 00:32:33,360 there but if you want to solve new 843 00:32:31,500 --> 00:32:34,679 problems and atypical problems you've 844 00:32:33,360 --> 00:32:38,279 actually got to get your hands dirty 845 00:32:34,679 --> 00:32:40,799 with the outside of toy well I mean 846 00:32:38,279 --> 00:32:42,120 these are toy examples but they're 847 00:32:40,799 --> 00:32:43,740 they're new and they're they're 848 00:32:42,120 --> 00:32:47,539 different they're not as curated 849 00:32:43,740 --> 00:32:47,539 um as as you might find in a tutorial 850 00:32:49,140 --> 00:32:54,720 thanks everyone we've got a couple of 851 00:32:52,500 --> 00:32:56,820 moments of change River before the next 852 00:32:54,720 --> 00:32:58,940 talk 853 00:32:56,820 --> 00:32:58,940 thank you