Hiking “Round the Mountain”, Tongariro National Park

P1010688

A few weeks ago, I was lucky enough to head to New Zealand for KiwiFoo and a few other work meetings. I only knew I’d be going about a month ahead of time, but I wanted to fit in a few days backpacking after the conference. After some research, I settled on the Round the Mountain trail, because it was between my work destinations of Auckland and Wellington on the North Island, but promised a secluded experience in the wilderness. I ended up having some wonderful moments on the hike, but it didn’t all go to plan. Since I enjoy being a cautionary example to others, here’s the story of how it went!

Preparation

Planning the route was comparatively easy, thanks to the internet. The official website was surprisingly helpful, but I also found quite a few professional guide pages, and some useful personal trip reports. Looking back, I got quite an accurate idea of what I’d be tackling from the research, especially the personal posts that covered the areas that had proved difficult. The ‘ratings’ on the professional sites weren’t helpful, ranging from easy to moderate to hard, and from a distance it was hard to estimate the time it would take without knowing the expected speed and experience they based it on. I ended up being overly optimistic hoping for a three-day trip, but left myself enough room in my schedule to let it stretch to five if I needed to. The one thing that I couldn’t find anywhere, even in Auckland book stores and outdoor shops, were paper maps of the area. I was set up with a GPS, but I didn’t feel ready until I had a traditional backup. From chatting to folks at the stores, the Topo50 physical maps are no longer being stocked, since anyone can download them and print them for free. This doesn’t give you a large water and tear-resistant map though, and it also isn’t easy to manage while you’re traveling, so I was happy when I found a good map at a gas station closer to the trail head.

I had knee surgery last year, so even though I’d been cleared to keep hiking I wanted to be cautious. I’d been biking a fair amount, and getting in occasional hikes, but it had been over a year since my last overnight trip, and several years since I’d done serious multi-day backpacking. I spent several weeks doing two short hikes up a steep hill every day with a backpack I’d weighted down as much as I could, in the hope of building up my stamina and fitness enough to keep up a strong pace, and stay safe if the footing got tricky. I went from woefully out of hiking condition, to reasonable-but-not-great. More variety in my training hikes and at least one mountainous overnighter would have left me in a better place, but I’m glad I at least was in decent shape when I faced the trail.

Monday

After driving down from Auckland and arriving late, I stayed at the Chateau Tongariro in Whakapapa Village. This was very close to the trailhead, but with breakfast, picking up some last-minute supplies, doing the final packing of my backpack, and checking in at the visitor center to pick up the hut passes I needed, along with any advice they had, I didn’t get out on the trail until noon. I knew there was bad weather due in a couple of days, but I was committed to tackling the hike as best I could, and figured I’d see how things looked as time went on. I felt well-prepared with equipment and experience, I wasn’t going to keep going if conditions left me feeling at all unsafe, but I also knew I was doing it solo which I normally wouldn’t recommend, especially in an unfamiliar area.

P1010652

The trail surface was beautifully-maintained on that section of the walk. Gray gravel, clearly-defined edges, and lots of markers left me feeling more confident. There were some steep sections, but even with my backpack on I managed the 8.5 mile walk to Waihohonu Hut in four hours, when the official estimate was five and a half. My hope had been to continue another 7.5 miles to Rangipo Hut, but with my late start that would have involved some trekking through the dark, so I decided to make camp. I had a bivouac tent, and set up in the campground below the main hut. I did pop in to say hi to the folks gathered there and check in with the warden, but after a long conference I wasn’t feel too social. I sensed that wasn’t culturally appropriate and that I was expected to make more of an effort to bond with the group, but I was after some time alone in the wilderness!

Tuesday

I knew this would be a long day, and after my relative lack of progress on Monday I needed to make an early start and would have a late finish. My goal was Mangahuehu Hut 12.5 miles further on, past Rangipo Hut. After the pace I’d kept up for the first section, I was hopeful this was reasonable. It was southern-hemisphere fall, so I only had 11 hours of daylight from my departure at 7am, but that seemed like it should be plenty. I soon discovered the trail was a lot tougher than I expected though. I’d left the section that was shared with the Tongariro ‘Great Walk’, and the route and condition of the trail became much worse.

P1010666

There were still frequent marker posts, but often there was no worked trail surface, just stream beds and fields of pumice. The trail wound up and down across a seemingly-endless series of valleys and ridges, and by lunchtime it was clear I was moving more slowly than I’d hoped, even falling behind the official estimates. On top of all that, this was waiting for me:

P1010677

I had prepared for the practical problems of being a solo hiker, but I hadn’t thought too much about the psychological ones. I knew the lahar valley was coming up, and had been looking forward to some interesting terrain and a tiny slice of danger when I researched it from the safety of home. When I got there, it was unexpectedly hard. The river always seemed to make a loud roaring noise, the trail was often hard to see, four hundred metres felt like a long way, the route was hard to follow, and it was technically very challenging. I got very focused on getting through as fast as I could, and wasn’t thinking clearly. As I was climbing out of the other side of the valley along the side of a cliff, I found the rock-ledge I was on narrowing. Rather than stopping, looking around, and thinking, I shucked off my backpack, left it on the shelf and inched along the ledge to the next section of trail, leaning into the cliff-face and trying to keep my balance. I heard a crash, and saw my backpack had fallen off the ledge. Thankfully it was only a twenty-foot drop, but it could easily have been me. Sobered, I finally took a good look at where I was, and realized that the current trail was down below me, near where my backpack had fallen, and I’d been following an old one that had been washed away. I carefully made my way down, retrieved my backpack (thankfully nothing was damaged), and made my way uneventfully out of the lahar zone.

P1010676

I left the valley chastened. I like to think I’m conservative about safety, but by not paying attention to the trail, and then forging ahead instead of backtracking when it became dangerous, I’d taken a very dumb risk. I was lucky to get away unharmed. Looking back, I could see I was so focused on the distant lahar danger that I’d lost perspective and freaked out. I don’t think I’d have made the same mistake with other people around, just the process of talking about what we were doing would have grounded me a lot more. The experience made me realize how insidious panic can be. I didn’t realize how badly my judgment had been skewed while I was in it, and it left me with a lot more compassion for the folks in news stories who do stupid things during a crisis.

Finally at around 1pm I made it to Rangipo Hut. By that point I was an hour behind schedule, tired, recovering from my scare, and not looking forward to the next section. I filled up on water, chatted to the folks staying in the hut, and heard they were planning on sitting out the coming storm for the next few days. The weather was still fine, with nothing serious expected until the next day, so I decided to press on to Mangaehuehu.

P1010681

I soon hit Waihianoa Gorge. My photo doesn’t do it justice, check out this one by another hiker to get an idea of the scale, but it was wide, deep, the trail was mostly loose scree, and I had to go all the way down it and back up the other side. The descent was treacherous, but not too dangerous when I did slip. I took a couple of falls but just got a few more scrapes and bruises. Heading up was a slog, but actually had a much more defined trail. I then headed across some very technical terrain, apparently lava flows and hills of ash and pumice, where the trail was hard to spot and seemingly little-used. I started to hit patches of forest, which made a pleasant change from the moonscapes I had been hiking, and had a much better tread, but also posed a challenge as sunset approached.

I put on my headlamp, and picked my way through the trees and streams for about an hour in the dark. I was so tired that I was just confused by the odd behavior of the moon. One minute it was full, lighting my way, and the next time I looked, it was just a sliver. Without thinking too much, I shrugged this off as more New Zealand quirkiness, much like their flightless birds and fondness for “Yeah, no.” Of course, it was actually a lunar eclipse! Thankfully I made Mangaehuehu Hut at around 7:30pm.

It was occupied by a group of three local deer hunters who’d been there for several days. They were just getting into bed, but there was a nice set of bunks free for me. I had been planning on tent-camping the whole time, but the lure of a roof over my head was too strong, and I didn’t want to spend time setting up and dismantling a shelter again. I had some decisions to make about the next day too. I was woken up several times during the night as the remnants of Cyclone Ita brought gale force winds to rock the hut. I’d checked the upcoming route, and if I was going to do it in one day it would involve as much hiking as I’d done today, with much of it along exposed ridgelines.

Wednesday

I woke up at 4am, and knew I had to abandon my hope of doing the full loop and instead hike out to the nearest town. There was a break in the weather, and the hunters were headed out too, so we all set off together before dawn.

P1010689

The hunters were friendly, but competitive and insanely fit. The pack in the photo was full to the brim with venison, at least seventy pounds worth, and the bearer is in his sixties, but I was still hard-pressed to keep up with him. We ended up doing the 5.5 mile trail out to the road in two and a half hours after they set a blistering pace. It was a good way to end the hike on a high note. They gave me a ride down to Ohakune, where there was a hope of transportation back to Whakapapa Village.

My interaction with the visitor center there was a funny one. I wandered in, said hello to the lady behind the information desk, and told her I was looking to get transport back to Whakapapa. “Well, how do you propose to do that?” was her reply! I told her I was hoping she could suggest a solution to my dilemma, and she consulted with colleagues, rummaged behind the desk, and finally appeared clutching the card of a local taxi firm. She wasn’t willing to hand it over to me though, so keeping one eye on me, she negotiated with the driver, sharing his apparent surprise that somebody would want to be driven from one place to another in return for payment, and finally informed me that it had been arranged. I thanked her gratefully, and had an uneventful ride back to my hire car. I unloaded my gear, crawled into the back seat, and watched sleepily as wild winds and monsoon rain lashed the parking lot.

Five short links

fivebus

Photo by Koeb

Right-sizing precision – A proposal to add more flexibility to floats by allowing the exponent and mantissa to be variable-length. The precision can reflect the believed accuracy of the value, which is useful information to have around. I’ve been doing a lot of neural network optimization recently by tweaking the precision of large arrays, because memory access is far slower than the unpacking of non-standard formats, so the idea of throwing more logic gates in the core to minimize RAM traffic is appealing.

What’s wrong with GNU make? – I wish I could find a good alternative, cmake is deeply painful too. Is the process of compiling complex projects across multiple platforms fated to be a time-consuming nightmare, or are we just terrible at building tools for ourselves?

What’s your C migration plan? – I’ve been using C for over twenty years and I love it dearly, but after the latest round of security flaws writing new code in the language does feel close to professional malpractice. I’m reading up on Go for when I need compiled code without a JVM.

Wire-tapping the ruins of Pompeii – Using thousands of cheap sensors to keep an eye on decaying architecture.

World airports Voronoi diagram – When I’m flying long distance, I always have a background anxiety process running, figuring out where we could glide too if the engines fall off. This handy SVG animation takes away all the guesswork!

The DeepBelief SDK now works with OpenCV

opencv

Photo by Richard Almond

One of the most-requested features for the DeepBelief object recognition SDK has been integration with OpenCV. We’re actually heavy users of the framework ourselves at Jetpac, and so I’m pleased to say that it’s now easy to use it with DeepBelief!

Another frequent request was desktop support, and so there’s now Linux x86-64 and OS X libraries, documentation and examples available. I’m still a big fan of Caffe and Overfeat, but DeepBelief can be handy when you need simple setup with few dependencies, a very small footprint, and when you want to train models from file system images to use later on mobile devices.

It’s a very exciting time for computer vision, there’s a lot of new and exciting applications we can all build with the deep learning approach, and I hope this helps a few more people dive into creating their own!

DeepBeliefSDK now works on Android

android

Photo by Aidan

When I first released the DeepBeliefSDK for iOS devices, one of the top requests was for an Android version. I’m pleased to say, after some serious technical wrestling, you can now use the image recognition library in your own Android apps! Just download the github repository and run the Android sample code.

I wasn’t expecting the port to be as big a technical challenge as it turned out to be. The algorithm relies on some pretty hefty numerical calculations, and on iOS I was able to use the Accelerate framework, but I was surprised to find that there was no equivalent for Android. I ended up writing my own custom ARM NEON SIMD code, alongside the Eigen library for some linear algebra operations. There don’t seem to be any easy ways to use ATLAS or even OpenBLAS on Android unfortunately. Both have ARM ports, but don’t make it easy to cross-compile, and I couldn’t find any pre-built binaries. I’d love to see the porting happen, feels like a great Summer of Code project?

I also hit problems when I was porting multi-core code. I’m a big fan of OpenMP, and the official Android build chain recently added support for the framework, but if you call it from a non-main thread, it crashes. I could have tried the workaround mentioned in that post, but rebuilding the toolchain was a bit too time-consuming for this project. In the end I was able to do a decent job on multi-core processors, but it was a lot harder than I was hoping.

The final hurdle was profiling. I’ve been spoiled by the Xcode’s Instrument profiling tool, and the best I could find for the kind of native code I’m running is this injected library that outputs gprof timing information. I ended up resorting to the old standby of shotgun profiling – doing a binary search by commenting out blocks of code to understand where the time is going. I managed to speed up the classification to around 650ms on a Galaxy S5, but I’m sure with better visibility I can squeeze some more out in the future.

I think most of my issues came from going against the grain of the platform. On iOS, everything’s C-like compiled code, whereas that’s a special case on Android. Java/JVM is the default, so it’s not too surprising that the tools are focused there instead. I’m excited to see what folks build with this now it’s out there, I hope you have fun!

My Foo survival tips

foolion

A classroom lion from KiwiFoo

One of the joys of being involved in the O’Reilly world is the occasional chance to attend one of their Foo (Friend Of O‘Reilly) events. These tend to be invite-only unconferences, with the mothership FooCamp happening at the Sebastopol HQ, and other topic or region specific ones popping up around the world. Invites have an admirable bias towards newcomers, especially folks who wouldn’t normally appear on conference organizers’ radars, so I never count on getting one. When I do though, I move heaven and earth to make it, because every one I’ve attended has left me buzzing with ideas and energy. The people who go aren’t only smart, they’re picked because they’re do-ers, and a lot of my projects (like the iPhone tracking story) have emerged as collaborations with fellow campers.

I’ve always found the experience of mingling extremely hard on a personal level though. It’s hours of rapid-fire conversations (and sometimes heated arguments!) with a succession of complete strangers, and if I’m not careful I find myself quickly getting exhausted and longing for a hole to hide in. I’ve read the tips, but even after three or four camps, I never felt like I was managing as well as I could. This week I was lucky enough to make it to KiwiFoo, organized by the wonderful Nat Torkington and the awesome Jenine Abarbanel, and it went so well I wanted to capture some of what worked for me. Bear in mind this is all very personal, and I bet different strategies will work for you, but here are my approaches:

Don’t drink

I’m normally a social drinker, and in past camps have had a beer or two during the evening sessions to relax. This time I stuck to coffee, and I was surprised to find I was actually able to stay awake a lot longer and have more rewarding conversations. This is probably a very personal preference, in most situations I find booze a fantastic social lubricant, but keeping my brain engaged made the experience of chatting to all the interesting people I kept bumping into a lot less taxing.

Play Werewolf

I have an inbuilt skepticism of organized fun, which doesn’t always serve me well. I’d never actually played Werewolf, despite it being the centerpiece of every Foo’s evening entertainment. This time I joined in, and now I’m a complete convert. The level of backstabbing and general deception, disassembling and deviousness made it the perfect forum to get to know the other people around the table. I was singled out as looking “sneaky as fuck” in my first game, which wasn’t actually a disadvantage going forward, and proceeded to have a wonderful time alternately murdering and lynching the other folks around the table, and being lynched and murdered in turn. I can’t recommend it highly enough.

Sit alone at lunch

One of the hardest parts for me is meal breaks. It’s like being the new kid at high school, and I’m left staring at a room full of strangers all busy in conversation with each other. I feel intensely awkward trying to sit down and break into people talking, and when I’ve done it, it’s hard to jump in the middle of it all. Paradoxically what worked for me this time was sitting at an empty table, looking welcoming and letting people join me. I’m not quite sure of the dynamics that make this so much better, but it held for more than just mealtimes. At previous Foos I spent a lot of time concerned with how to approach people, but making myself approachable turned out to be a lot easier. I still tracked down people I really wanted to connect with, but also let myself hang out, relax and be visibly ready for a conversation, whether it was at lunch or just between sessions. This alone saved me a lot of energy, and led to some great chats I never would have had otherwise.

You don’t always have to talk

Part of the joy of Foo is that all the participants are also contributors. Almost everyone runs a session, and the sessions themselves are more like discussion forums than lectures. This can be a culture shock compared to typical conferences, so a lot of first-timers rightfully need encouragement to join in and not just be an audience member. In previous Foos though I’ve ended up being concerned when I don’t have much to offer during discussions, which has left me spending too much time thinking about how my experience touches on the topic and not enough hearing what other people are saying.

At KiwiFoo some of the sessions I got the most from were on Maori topics, where I’ve got very little knowledge beyond the basic history. By listening carefully, I was able to learn a lot from what the other participants knew, especially when it came to their lived experiences. I got a flavor for the richness and complexity of how an indigenous culture was adapting to, and altering, the rest of New Zealand, in a way I never would have been able to outside of that sort of forum. I was active, but actively listening, with only a few contributions where they made sense. It saved me a lot of energy, and I got a lot more out of it than I would have otherwise. So, if you’re a newcomer definitely push past your normal conference instincts to get involved in a lot of the sessions, but do give yourself permission to be a complete beginner in a few too, absorbing what the other participants are contributing.

Anyway, I hope these very personal notes are helpful, at least for coming up with your own strategies for getting the most out of FooCamps. They really are the most amazing get-togethers I’ve attended (SciFoo in particular was truly one of the highlights of my life), so if you’re lucky enough to get an invite, try as hard as you can to make it, and enjoy it as much as you can!

How to add a brain to your smart phone

[Update – You can now download the app for your iPhone!]

I am totally convinced that deep learning approaches to hard AI are going to change our world, especially when they’re running on cheap networked devices scattered everywhere. I’m a believer because I’ve seen how good the results can be on image recognition, but I understand why so many experienced engineers are skeptical. It sounds too good to be true, and we’ve all been let down by AI promises in the past.

That’s why I’ve decided to release DeepBeliefSDK, an iOS version of the deep learning approach that has taken the computer vision world by storm. In technical terms it’s a framework that implements the full Krizhevsky stack of 60 million neural network connections, with a customizable top layer inspired by the Decaf approach. It does all this in under 300ms on an iPhone 5S, and in less than 20MB of memory. Here’s a video of me of me using the sample app to detect our cat!

This means you can now easily build cutting edge object recognition into your iOS apps. Even the training on custom objects can be done on the phone. Download and build the sample code and judge the effectiveness for yourself. Then all you need to do is teach it the things you care about, link against the framework, and you’ve given your app the ability to see!

What an ARM chip designer taught me about my career

Almost twenty years ago, I was an undergraduate at Manchester University in the UK. I’d been lured there by the promise of being in the same room as Steve Furber, a key designer of the original ARM chip, and so spent a lot of my time on hardware courses in the hope of hanging out with my hero. After a couple of years I eventually plucked up the courage to have a few words with him over warm white wine at a departmental mixer, blurting out the first thing that came into my head, something about how chip designers didn’t seem to get good salaries. He told me “If you’re really good you’ll get paid well, it doesn’t matter what the field is“. I liked that advice, it gave me permission to focus on learning the craft of programming, in the hope that it would pay off down the line whatever my initial job decisions were.

That was lucky, because my job choices were terrible. My first professional job paid less than I made at the shelf-stacking one I took to make it through college, I wasn’t working on interesting technology or problems, the company itself was beyond chaotic, and I was an awful programmer. The only thing that kept me going was the hope that I was learning how to suck less. One of the bright spots was our lead engineer Gary Liddon, a ‘veteran’ of a very young industry. He scared the living daylights out of me, he didn’t have any patience at all for time wasters, but he made sure I had support as I tried to figure out how to do my job. He showed me the secret to debugging impossible crashes for example – just comment out half the code, see if it still happens, and binary search your way to the answer.

As I bounced between jobs, I tried to spot the people like him who were better than me and learn whatever I could from them. I made some idiotic career decisions (who moves to Scotland to find work?) but over time I found myself becoming more capable as a programmer, which gave me the chance to recover from those bad choices. I found that hanging out with smart people who could show me amazing new ways to build software makes me want to go to work too! Learning started as something I focused on for my career, but I found it made me happy as well.

I’m not much of a believer in life advice, I feel like I’m still groping in the dark myself, but Steve’s throwaway remark has served me well as a guide. At least focusing on getting better at what I do is something I have control over.

Five short links

fivecircles

Photo by Tanakawho

A convention for human-readable 128-bit keys – Another nice example of natural and computer languages colliding, found via lobste.rs, which I’m hoping might turn out to be a version of Hacker News without the Hacker News commentators. I’ll still be lurking on the HN submission page though, since there are a lot of good links being thrown into the woodchipper.

Speedtree – A store devoted to beautiful computer models of trees. I remember wasting many evenings on simple fractal models of trees as a kid, it’s wonderful to see how far the technology has come.

Questionable crypto in retail analytics – Hashes are a flimsy curtain around private information that organizations want to share publicly, and they almost always reveal a lot more than the publishers like to think.

Starship Troopers and the Killer Cuddle Hormone – CPUs are tough to understand, but our brains are a whole different level of kludge. A great piece on how oxytocin interacts with our propensity to lie.

Binary Boolean Operator – The Lost Levels – If history had been a little different, we’d have the ‘implies’ operator, which would definitely make some of my assert()’s more readable.

Five short links

zombielincoln

Photo by Jovino

Debunking the 100x GPU vs CPU myth – I love having GPUs available, I couldn’t have done my recent deep belief web demo without them, but this paper matches my experiences. You can do amazing things with highly-tuned CPU code, and in a lot of real applications any speed gains on the computation side are swamped by the time it takes to transfer data to and from the graphics card.

OpenStreetMap isn’t all that open – I never understood the intent of the bondage-and-discipline open database license OSM adopted, but in practice it means that it’s very hard to use for general geocoding. If you use the data to look up the coordinates of a street address, then any data derived from that position is subject to the attribution and sharing requirements in any application it’s used in, no matter how many generations removed from the original. I can’t ask users of the Data Science Toolkit to publicly share their spreadsheets just because I’ve added a lat, lon column for them, so I’m using alternative open sources that don’t infect data sets they interact with.

Privacy in sensor-driven human data collection – I’m not sold on all the recommendations, but this working paper is a must-read if you’re working with sensor data and want to understand where the land mines are. Even plain-old accelerometer data can be very revealing.

Biometric word list – Like “Alpha/Tango/Foxtrot”, but for clearly speaking byte streams aloud, with words picked to minimize errors. Full of fragments of stories, including a “skydive racketeer”, “facial fortitude”, “slingshot rebellion”, and “highchair holiness”.

Potential, possible, or probable predatory scholarly open-access publishers – The dark side of the opening of the academic world, I keep getting contacted by dodgy-looking publications, so this list looks like a great resource. [Update – Cameron Neylon has a good comment on the background of this list. I’ll be looking at his suggestions instead!]

Five short links

fivepoints

Photo by Axel Taferner

Downloading software safely is nearly impossible – I’m resigned to the fact that a determined-enough attacker can access my data, since at the end of the day there’s always duct tape and rusty pliers, but the size of the holes in the stack we have to trust to get our hands on software is still painful to behold. See the followup too.

Bulk whois data – If you ask them nicely, ARIN will send you a complete dump of all their whois contact information, or you can buy it with no questions asked from a third-party supplier. More data that we theoretically know is public, but that becomes more problematic when it’s available en masse.

Dog poop, Facebook, and optimism – In the computer world we’re uncovering all sorts of interesting insights into hidden aspects of humanity, but we haven’t been able to get them into the hands of all the sociologists, historians, planners, aid workers, medical researchers et al who can really use them. I’m hoping Nicholas Christakis’s Human Nature Lab at Yale will bridge some of that gap, I’m very interested to see what emerges.

Potato programming – Even though I’m not a fan overall, I still learned a lot from my forays into functional programming. I almost always never mutate values after I’ve assigned them, and I find code a lot cleaner when I can avoid lower-level for loop constructs in favor of something like a map or each. I just ran across this term for the clunky code that explicit looping produces, and it’s a memorable way of describing the one-potato, two-potato anti-pattern.

Verification handbook – This is a free handbook aimed at helping reporters separate rumor from fact when news is breaking, but it’s just as useful for readers of journalism. There are so many more sources of information these days that responsible citizens in a modern society have to be able to intelligently question what they’re being told.