Press "Enter" to skip to content

Posts published in February 2016

Priorities

centaur 0

20160228_151829.jpg

Wow, the Vegan New Orleans and Vegan Las Vegas posts are taking a lot longer than expected - I didn’t get them out yesterday like I wanted. But that’s OK, because even more important stuff happened: Thinking Ink Press received the print proofs of THIRTY DAYS LATER, our first fiction anthology, which happens to feature Harry Turtledove. Woot! Here’s Betsy Miller, the author and publisher who did much of the work making the physical copy of this happen:

20160228_151804.jpg

I’m normally a hermit, working on my projects, but this past week has been almost totally focused on people: coffee with my thesis advisor talking about the Google, interviews, office moves with my team, coffechats with friends about the mathematical underpinnings of deep learning, dinner with my buddy Nathan Vargas, dinner with my buddy Derek Reubish planning a friends and family trip, and dinner with Derek and our buddy autocross racer Fred Zust catching up after Fred’s wife participated in a big race. No pics of that - I let Derek and Fred handle that chore - so instead I give you pics of the farmer’s wrap I had at Barnes and Noble while waiting for the call that Fred had finally hit town.

20160228_192808.jpg

Work is important - I spent the morning working on math and writing prior to meeting Betsy to talk about the page proofs, which itself was another kind of working; and as you see above, I worked while waiting for Fred to arrive.

20160228_122708.jpg

But there’s more to life than work. As another buddy, Gene Forrer, just pointed out, THIRTY DAYS LATER wouldn’t exist except for the strong camaraderie of all the authors at Clockwork Alchemy, and as Belinda Messenger-Sikes pointed out, that level of camaraderie among writers is unusual for such a small genre convention.

20160228_151748.jpg

But that camaraderie does more than just produce books; it also produces communities, long-lasting friendships, durable associations that pass the test of time. I’m happy to have all the friends I have, and even though I love being a hermit and just working on my work, I enjoy all the time I get to spend with all my friends building and building upon our friendships.

-the Centaur

I cheat …

centaur 0

20160219_170129.jpg

… using the following picture of a tree from Jackson Square in New Orleans. Trees can be awesome. What may not be clear is that this branch is spiraling out about thirty or forty feet. Hear, I show it to u:

derbranch.png

Amazing. It just seems to hover, just out of reach.

Trees are awesome.

-the Centaur

For the record …

centaur 0

A Bit Behind.png

… I appear to be about 3 posts behind for the year, depending on how you count it. Blogging every day has been really rewarding in making me open up and try new things with this blog, but man, for a man who complains that he takes on too much, I’m a man who really does have a great skill at taking on too much.

-the Centaur

Not Dead, Just Working

centaur 0

20160224_215340.jpg

I haven’t given up on blogging once a day - I just got overwhelmed at work and life and, more importantly, at friendship - hanging out with some of my best buddies and catching up, something I’ve been far too busy to do recently. But this week I put in time with a few good buddies - one from high school, one from the writing group, even one day when I was a bit under the weather working remotely with my laptop in the backyard, which was appreciated by our aging, inappropriately urinating, formerly-indoor cats.

20160223_162008.jpg

I was real stressed this week, but, objectively, things are going very well. I saved my threatened project from last year’s craziness and it’s now in use; I started a great new project with my team; even something that we thought was dead long ago got used in a great demo at work. I sent a novel to a publisher; we planned a high school friends trip to Tahoe; things are going well.

20160224_220820.jpg

One friend noted I’d been living my life the way I do - overstuffed with work, a full time software job; plus as much as a full time novelist as I can be reading over lunch and dinner, writing over coffee and occasional breakfasts; plus helping manage a small press; plus doing comics - for a while now, and he was worried the stress was getting worse. I see that, but didn’t quite agree.

20160226_192011.jpg

I’ve been this stressed before, particularly in the middle of my PhD, when I was two or three years in and thought I had two or three years more to get out … and then found out after three years of work I had several more years to go. I’ve done it to myself, taking on an 80% time job to spend time writing, but then spending a whole year filling my life with karate, improv, and weekly roundtables which filled my whole schedule to the point weeks just disappeared. As the stress builds, you just want to take a break - and if you don’t, as my friend pointed out, things may break anyway.

20160223_023946.jpg

Those periods of my life sucked, and in a way this one does too, but in another way, it’s more manageable. My crunch now is not being trapped just by doing too much to myself; it’s like being trapped by my PhD, which got delayed because I had an opportunity to work on a robotics project. Now, while I have a few things to deal with like a wrecked floor at the house, I’m mostly trapped by opportunity: the opportunity to do a great project at work, to write great books, to help bring other books to life.

Screenshot 2016-02-27 14.36.11.png

I can see an exit strategy - a couple years of work at work, three years of work on my next novels, plus maintenance of the small press and continued practice at comics, and once I get through those things, if they’re even moderately successful, I’ll be in a position of much more creative freedom. So I think it's important to not lose these opportunities - but on the other hand, it’s pointless to let your opportunities kill you. That’s why today, after I finished booking my next trip, after I finished more readings which hit the intersection of my robotics work and my urban fantasy research, but before I did any more serious work, including this blog entry … I took time out to be creative. To just draw.

20160227_135644.jpg

Well, drawing practice because I want to do comic books, but you get the idea.

-the Centaur

Back to Basics

centaur 0

20160221_152544.jpg

As a guilt-motivated ex-Catholic with a perfectionist streak, I’m constantly trying to be a better person than I am - religiously, ethically, personally, even at the level of my skills. And one of the best ways I’ve found to improve my skills is not simply to practice, or to push the bounds of your knowledge, but to step back and look again at the basics.

Screenshot 2016-02-22 20.56.24.png

For some areas of knowledge, this is obvious. We wouldn’t have gotten anywhere with number theory if we hadn’t been willing to go back, again and again, to the definitions of numbers. But it seems less obvious for skills, where our perception often is that first you are a novice, then you become skilled, then an expert, then a master.

20160219_140140.jpg

But that road can become a blind alley. Learning from a teacher can channel you into their style; self-taught artistry can create works of great power, but it can also leave you with deficiencies which no amount of further training can improve. Sometimes the only way to get better is to step back, reassess, start over.

20131209_221037.jpg

That’s why I like periodically coming back to beginning art instruction books. I find the older references somewhat more informative than the newer ones, perhaps because they’re more methodical, or perhaps because there was a greater concern for representational art - or simply because I’ve read a lot of newer references, making the old ones seem fresh.

20160218_164202.jpg

Now, I once heard an artist suggest that you should buy a pile of art instruction books, wrap them in a trash bag, and bury them in your back yard, get a big thick sketchbook and sketch people in coffeehouses until you filled the whole thing, and then, after a year or so, dig them up to start drawing. My wife, however, an accomplished artist, agrees and disagrees with this plan.

20160221_152624.jpg

She agrees with the latter two thirds - but not the start. She argues, there are so many things to learn about art that if you tried to start from just sketching, you might end up never making certain discoveries and instead get trapped in rookie mistakes. Your art might have emotional power, but you’d be handicapped if you were aiming for mastery of your tools or representational accuracy.

20160221_152553.jpg

I tend to agree. As a scientist, though, I try another approach - not just practice, but "scientific” analysis, at least the initial, data collection part of science: not just doing the practice, but carefully examining how it went, looking for successes and failures, and trying to generalize from them. I can’t double-blind A/B test myself, but I can be mindful about how I practice.

porsche-small.png

I pray it’s helping! I have a lot of art I want to do.

-the Centaur

Pictured: Exercises from Andrew Loomis’ DRAWING THE HEAD AND HANDS, folk art from the U.S. Mint in New Orleans, art books in Dauphine Street Books also in New Orleans, and various drawings I’ve done over the years, from long ago (the highly detailed centaur and the copy of the Hemingway cover) to yesterday (the basic circles and analysis of problems with my line).

It was N’awlins, y’all

centaur 0

20160215_161010.jpg

As if it wasn’t obvious. Sandi and I spent the week there in New Orleans' French Quarter - we never left it, never even rented a car, but just walked around, soaking in history and food. It was awesome, I have much to talk about, but, following the rules we’ve established, it wasn’t a business trip, so the details had to wait until my return.

I have returned. Expect a post on Vegan New Orleans soon. (Not a contradiction in terms!)

-the Centaur

I Think I’m Calling It

centaur 0

Screenshot 2016-02-20 09.40.27.png

Welp, looks like I’m not going to Comic-Con this year. My fault - I had a Professional registration, but received my renewal email when I was working to get a novel to the publisher and read the REGISTRATION DUE email as NOT DUE. Found out like the day after the professional registration closed. And then, even though I was reading the Toucan blog that announces such things, I was so busy working on another project that I missed Attendee Preregistration. And, as of now, even though I’m in line … it’s sold out:

Screenshot 2016-02-20 09.42.40.png

That happened while I was typing the above paragraph. At this point, three of the five days are sold out. My favorite night, preview night, sold out first:

Screenshot 2016-02-20 09.28.09.png

Comic-Con is awesome and overwhelming. I’d wondered if I would go back this year, but if I was not to go back, I’d prefer not to go back, like, on purpose, not through oversight, accident and bad luck. I look forward to going again next year. But perhaps I should focus less on going like a fan and more on doing the work that will get me invited there as a guest.

As my wife would say, focusing on making my next creative project spectacular.

-the Centaur

Update: while posting this …

Screenshot 2016-02-20 09.51.27.png

O.M.G. While TYPING that …

Screenshot 2016-02-20 09.52.01.png

Yeah, this ain’t Cave Johnson, but we’re done here.

Disruption

centaur 0

20160215_173705.jpg

Nothing lasts forever. Appreciate things while they’re there, because one day they’ll be gone. You will too.

-the Centaur

Are you threatening me?

centaur 0

picturesofpictures.png

Overheard from my life:

Me (talking a bit too fast): “So, it’s like filankatyafolio—“

Interlocutor (a bit surprised): “Are you … threatening me?”

Me: “I meant Phil and Kaja Foglio, of Girl Genius.”

I mean, I knew they were influential, but until now I didn’t know their names were killing words.

-the Centaur

Doppelgangers

centaur 0

20160215_222727.jpg

On two sides of the country, there’s a restaurant named after a city, serving the cuisine known from the region. They’re both high end, they’re both distinctive, and they’re both excellent … but they’re, as far as I know, completely unrelated to each other.

20140630_201006_HDR.jpg

They’re not one of a kind … but they are pretty damn good.

More on what and where they are after the trip is over.

-the Centaur

Oh no, someone’s wrong on the Internet!

centaur 0

20160214_163246.jpg

What I’ve discovered is that even if you definitively know something, that won’t stop someone online from snapping back with stupid, every step of the way. What’s worse, my rule of threes says that in any discussion, one third of their points will be wrong, one third of your points will be wrong, and the middle third will remain an area of durable disagreement.

There’s no cure for online idiots, but, fortunately, your own ignorance is correctable. Get into an argument with someone? Don’t try to get the last word - go look up the truth. (Or do the work to prove it, if it isn’t known). And be satisfied with your own answers.

Because if you found the truth and told them, that particular person isn’t likely to listen anyway.

-the Centaur

Visualizing Cellular Automata

centaur 0


cellular-automata-v1.png

SO, why's an urban fantasy author digging into the guts of Mathematica trying to reverse-engineer how Stephen Wolfram drew the diagrams of cellular automata in his book A New Kind of Science? Well, one of my favorite characters to write about is the precocious teenage weretiger Cinnamon Frost, who at first glance was a dirty little street cat until she blossomed into a mathematical genius when watered with just the right amount of motherly love. My training as a writer was in hard science fiction, so even if I'm writing about implausible fictions like teenage weretigers, I want the things that are real - like the mathematics she develops - to be right. So I'm working on a new kind of math behind the discoveries of my little fictional genius, but I'm not the youngest winner of the Hilbert Prize, so I need tools to help simulate her thought process.

And my thought process relies on visualizations, so I thought, hey, why don't I build on whatever Stephen Wolfram did in his groundbreaking tome A New Kind of Science, which is filled to its horse-choking brim with handsome diagrams of cellular automata, their rules, and the pictures generated by their evolution? After all, it only took him something like ten years to write the book ... how hard could it be?

Deconstructing the Code from A New Kind of Science, Chapter 2

Fortunately Stephen Wolfram provides at least some of the code that he used for creating the diagrams in A New Kind of Science. He's got the code available for download on the book's website, wolframscience.com, but a large subset is in the extensive endnotes for his book (which, densely printed and almost 350 pages long, could probably constitute a book in their own right). I'm going to reproduce that code here, as I assume it's short enough to fall under fair use, and for the half-dozen functions we've got here any attempt to reverse-engineer it would end up just recreating essentially the same functions with slightly different names.
Cellular automata are systems that take patterns and evolve them according to simple rules. The most basic cellular automata operate on lists of bits - strings of cells which can be "on" or "off" or alternately "live" or "dead," "true" and "false," or just "1" and "0" - and it's easiest to show off how they behave if you start with a long string of cells which are "off" with the very center cell being "on," so you can easily see how a single live cell evolves. And Wolfram's first function gives us just that, a list filled with dead cells represented by 0 with a live cell represented by 1 in its very center:

In[1]:= CenterList[n_Integer] := ReplacePart[Table[0, {n}], 1, Ceiling[n/2]]


In[2]:= CenterList[10]
Out[2]= {0, 0, 0, 0, 1, 0, 0, 0, 0, 0}


One could imagine a cellular automata which updated each cell just based on its contents, but that would be really boring as each cell would be effectively independent. So Wolfram looks at what he calls "elementary automata" which update each cell based on their neighbors. Counting the cell itself, that's a row of three cells, and there are eight possible combinations of live and dead neighbors of three elements - and only two possible values that can be set for each new element, live or dead. Wolfram had a brain flash to list the eight possible combinations the same each way every time, so all you have are that list of eight values of "live" or "dead" - or 1's and 0's, and since a list of 1's and 0's is just a binary number, that enabled Wolfram to represent each elementary automata rule as a number:

In[3]:= ElementaryRule[num_Integer] := IntegerDigits[num, 2, 8]

In[4]:= ElementaryRule[30]
Out[4]= {0, 0, 0, 1, 1, 1, 1, 0}


Once you have that number, building code to apply the rule is easy. The input data is already a string of 1's and 0's, so Wolfram's rule for updating a list of cells basically involves shifting ("rotating") the list left and right, adding up the values of these three neighbors according to base 2 notation, and then looking up the value in the rule. Wolfram created Mathematica in part to help him research cellular automata, so the code to do this is deceptively simple…

In[5]:= CAStep[rule_List, a_List] :=
rule[[8 - (RotateLeft[a] + 2 (a + 2 RotateRight[a]))]]


... a “RotateLeft” and a “RotateRight” with some addition and multiplication to get the base 2 index into the rule. The code to apply this again and again to a list to get the history of a cellular automata over time is also simple:

In[6]:= CAEvolveList[rule_, init_List, t_Integer] :=
NestList[CAStep[rule, #] &, init, t]


Now we're ready to create the graphics for the evolution of Wolfram's "rule 30," the very simple rule which shows highly complex and irregular behavior, a discovery which Wolfram calls "the single most surprising scientific discovery [he has] ever made." Wow. Let's spin it up for a whirl and see what we get!

In[7]:= CAGraphics[history_List] :=
Graphics[Raster[1 - Reverse[history]], AspectRatio -> Automatic]


In[8]:= Show[CAGraphics[CAEvolveList[ElementaryRule[30], CenterList[103], 50]]]
Out[8]=

rule-30-evolution.png



Uh - oh. The "Raster" code that Wolfram provides is the code to create the large images of cellular automata, not the sexy graphics that show the detailed evolution of the rules. And reading between the lines of Wolfram's end notes, he started his work in FrameMaker before Mathematica was ready to be his full publishing platform, with a complex build process producing the output - so there's no guarantee that clean simple Mathematica code even exists for some of those early diagrams.

Guess we'll have to create our own.

Visualizing Cellular Automata in the Small

The cellular automata diagrams that Wolfram uses have boxes with thin lines, rather than just a raster image with 1's and 0's represented by borderless boxes. They're particularly appealing because the lines are white between black boxes and black between white boxes, which makes the structures very easy to see. After some digging, I found that, naturally, a Mathematica function to create those box diagrams does exist, and it's called ArrayPlot, with the Mesh option set to True:

In[9]:= ArrayPlot[Table[Mod[i + j, 2], {i, 0, 3}, {j, 0, 3}], Mesh -> True]
Out[9]=

checkerboard.png


While we could just use ArrayPlot, it' s important when developing software to encapsulate our knowledge as much as possible, so we'll create a function CAGridGraphics (following the way Wolfram named his functions) that encapsulates the knowledge of turning the Mesh option to True. If later we decide there's a better representation, we can just update CAMeshGraphics, rather than hunting down every use of ArrayPlot. This function gives us this:

In[10]:= CAMeshGraphics[matrix_List] :=
ArrayPlot[matrix, Mesh -> True, ImageSize -> Large]


In[11]:= CAMeshGraphics[{CenterList[10], CenterList[10]}]
Out[11]=

lines-of-boxes.png


Now, Wolfram has these great diagrams to help visualize cellular automata rules which show the neighbors up top and the output value at bottom, with a space between them. The GraphicsGrid does what we want here, except it by its nature resizes all the graphics to fill each available box. I'm sure there's a clever way to do this, but I don't know Mathematica well enough to find it, so I'm going to go back on what I just said earlier, break out the options on ArrayPlot, and tell the boxes to be the size I want:

In[20]:= CATransitionGraphics[rule_List] :=
GraphicsGrid[
Transpose[{Map[
   ArrayPlot[{#}, Mesh -> True, ImageSize -> {20 Length[#], 20}] &, rule]}]]


That works reasonably well; here' s an example rule, where three live neighbors in a row kills the center cell :

In[21]:= CATransitionGraphics[{{1, 1, 1}, {0}}]
Out[21]=

Screenshot 2016-01-03 14.19.21.png  

Now we need the pattern of digits that Wolfram uses to represent his neighbor patterns. Looking at the diagrams and sfter some digging in the code, it seems like these digits are simply listed in reverse counting order - that is, for 3 cells, we count down from 2^3 - 1 to 0, represented as binary digits.

In[22]:= CANeighborPattern[num_Integer] :=
Table[IntegerDigits[i, 2, num], {i, 2^num - 1, 0, -1}]


In[23]:= CANeighborPattern[3]
Out[23]= {{1, 1, 1}, {1, 1, 0}, {1, 0, 1}, {1, 0, 0}, {0, 1, 1}, {0, 1, 0}, {0, 0,
1}, {0, 0, 0}}


Stay with me - that only gets us the first row of the CATransitionGraphics; to get the next row, we need to apply a rule to that pattern and take the center cell:

In[24]:= CARuleCenterElement[rule_List, pattern_List] :=
CAStep[rule, pattern][[Floor[Length[pattern]/2]]]


In[25]:= CARuleCenterElement[ElementaryRule[30], {0, 1, 0}]
Out[25]= 1


With all this, we can now generate the pattern of 1' s and 0' s that represent the transitions for a single rule:

In[26]:= CARulePattern[rule_List] :=
Map[{#, {CARuleCenterElement[rule, #]}} &, CANeighborPattern[3]]

In[27]:= CARulePattern[ElementaryRule[30]]
Out[27]= {{{1, 1, 1}, {0}}, {{1, 1, 0}, {1}}, {{1, 0, 1}, {0}}, {{1, 0, 0}, {1}}, {{0,
   1, 1}, {0}}, {{0, 1, 0}, {1}}, {{0, 0, 1}, {1}}, {{0, 0, 0}, {0}}}


Now we can turn it into graphics, putting it into another GraphicsGrid, this time with a Frame.

In[28]:= CARuleGraphics[rule_List] :=
GraphicsGrid[{Map[CATransitionGraphics[#] &, CARulePattern[rule]]},
Frame -> All]


In[29]:= CARuleGraphics[ElementaryRule[30]]
Out[29]=

Screenshot 2016-01-03 14.13.52.png

At last! We' ve got the beautiful transition diagrams that Wolfram has in his book. And we want to apply it to a row with a single cell:

In[30]:= CAMeshGraphics[{CenterList[43]}]
Out[30]=

Screenshot 2016-01-03 14.13.59.png

What does that look like? Well, we once again take our CAEvolveList function from before, but rather than formatting it with Raster, we format it with our CAMeshGraphics:

In[31]:= CAMeshGraphics[CAEvolveList[ElementaryRule[30], CenterList[43], 20]]
Out[31]=

Screenshot 2016-01-03 14.14.26.png

And now we' ve got all the parts of the graphics which appear in the initial diagram of this page. Just to work it out a bit further, let’s write a single function to put all the graphics together, and try it out on rule 110, the rule which Wolfram discovered could effectively simulate any possible program, making it effectively a universal computer:

In[22]:= CAApplicationGraphics[rule_Integer, size_Integer] := Column[
{CAMeshGraphics[{CenterList[size]}],
   CARuleGraphics[ElementaryRule[rule]],
   CAMeshGraphics[
CAEvolveList[ElementaryRule[rule], CenterList[size],
   Floor[size/2] - 1]]},
Center]

In[23]:= CAApplicationGraphics[110, 43]
Out[23]=


Screenshot 2016-01-03 14.14.47.png

It doesn' t come out quite the way it did in Photoshop, but we' re getting close. Further learning of the rules of Mathematica graphics will probably help me, but that's neither here nor there. We've got a set of tools for displaying diagrams, which we can craft into what we need.

Which happens to be a non-standard number system unfolding itself into hyperbolic space, God help me.

Wish me luck.

-the Centaur

P.S. While I' m going to do a standard blogpost on this, I' m also going to try creating a Mathematica Computable Document Format (.cdf) for your perusal. Wish me luck again - it's my first one of these things.

P.P.S. I think it' s worthwhile to point out that while the tools I just built help visualize the application of a rule in the small …

In[24]:= CAApplicationGraphics[105, 53]
Out[24]=

Screenshot 2016-01-03 14.14.58.png

... the tools Wolfram built help visualize rules in the very, very large:

In[25]:= Show[CAGraphics[CAEvolveList[ElementaryRule[105], CenterList[10003], 5000]]]

Out[25]=

rule-105-a-lot.png

That's 10,000 times bigger - 100 times bigger in each direction - and Mathematica executes and displays it flawlessly.

Testing a Time Delayed Post

centaur 0

conservancy.jpg \

Will be AFK for much of tomorrow, so I’m going to take a shot at having a post previously written come up automatically. Stay tuned …

-the Centaur

That Damn Wolf

centaur 0

Blog Postings Jan-Feb.png

Welp, while I’ve missed a few days, I have overall kept ahead of the blog wolf. By a hair. My lovely plans to build a buffer have resulted in one backlogged article, which I’ll post tomorrow to keep myself honest (and keep it from becoming stale) and basically no buffer. I’m only ahead because I sometimes post several articles per day, like today.

Sigh. No wonder I’m so stressed out - I make even being a dilettante a chore.

-the Centaur

Effective Beverages

centaur 0

So after a gut punch, one of the most important things to do is to take time out to recuperate.

effectivesangria.png

But funny thing is, the highly effective sangria above wasn’t the thing that broke me out of my funk. When something bad happens, I try one of the following strategies to feel better:

  • Take a nap. Or just go to bed. Sleeping can sometimes reset your emotional state. When I had my big crisis of faith in the 90’s, converting from Catholicism to Episcopalianism, I slept for like a day and a half, rethinking my whole life. Of course, if you can’t fall asleep, that’s no good - I was up to 5:50AM this morning, so blech.
  • Take a walk. This can also provide metaphorical distance from your problems. During my crisis of faith, I walked around my apartment complex again and again, taking an inventory of my whole life, weighing and evaluating everything I could think of. Today, when I tried the same strategy, I was snarling at the air, so blech.
  • Change your scene. Talking to uninvolved humans, not connected with your dramas, really can help. I had an interview with a candidate, a technical conversation about deep learning with a TL, and, later, after my mood was lifted, another technical conversation with my waitress at Opa! about the econometrics of developing nations.

As for why that last conversation happened …

20160211_192947.jpg

Which goes to the next item on the list ...

  • Try shopping therapy. Doesn’t work for everyone, but I’m a bookhound. I ended up going to the Stanford Bookstore to try to pick up a book on large scale machine learning (it had sold out). The books themselves weren’t the solution, but I’m getting to that - but it did involve the books in a tangential way.
  • Get some coffee. The inventor of the idea of separation of powers, Montesquieu, reportedly once said “coffee renders many foolish people temporarily capable of wise actions” and I’ve found that to be true - which perhaps suggests that we should install a Starbucks in the Congress and change the structure of our political debates, but nevermind. It helped.

You’ll note that nowhere in here is “get a drink.” That’s a terrible idea - if you think you need a drink, you probably shouldn’t have one, as needing a drink is the road to alcoholism. For that reason, and many others, I always stop at one drink per day - period. No matter how strong the drink, it’s almost impossible for a one hundred and eighty pound male to get drunk on just one.

Having a drink after you feel better, on the other hand, can be a great relaxer. But how do you get to that relaxed state? Well, one thing I try is, well, trying to resolve the problem.

  • Talk to the people involved. I have a theory that if you have a problem with a person and leave it alone, your emotional reaction will be frozen, even intensified over time - a theory based on my personal experience, but backed by cognitive emotional theories which say your emotions are derived from your stance, your relationship to the people, actions and events in the world - which doesn’t change if you don’t give yourself the chance to have new experiences with those people. Thanks to the fact that it’s the twenty-first century, this can be done via text, even when people don’t have time to talk.

But the point at which it turned wasn’t when I got a drink. It wasn’t after I took a nap, took a walk, talked to people, changed the scene, got a book on political economy, got coffee, or texted the involved parties to finalize the resolution of yesterday evening’s gut punch. It happened at very strange place, as I was drinking coffee, as I was reading, as I was texting with my friends to resolve the problem, I got sucked in to the problem that prompted me to get the book, a question I heard in an unrelated political debate from last night. As is usual in these cases, I found that the debate followed the rule of thirds: on a third of the topics, my buddy was definitively wrong, on a third, I was definitively wrong, and on the middle third, there were open unresolved questions worthy of debate. And as I started to look at those questions … I had a brainflash on how to solve them.

And then on a meta-brain-flash, as I realized what tacking the problem was doing to my mental state: it was fixing it.

  • Do the work. Find something you love, and cultivate the ability to throw yourself into it. If you’ve had a gut punch, you might have a bad taste in your mouth about a lot of the projects you were working on … but get your brain into a new space, and all those behavior programs will execute … and give you something new to fall (intellectually) in love with.

The particular question I was tracking - how to evaluate economic policies - is something I’m going to be working on for a while, but I can give you a flavor for it: how do you know whether a political candidate’s economic policies will work? Sometimes that’s easy: for example, Democrats like to spend when the economy’s doing well, and Republicans like to cut when the economy is doing poorly - and both sides are dead wrong. An economy is not a household - cutting spending in a slump will cut the state’s tax revenues and cause an austerity spiral and increased debt; spending in a boom incurs obligations that the state can’t sustain in the next slump and increased risk. These are pretty close to ironclad laws, that operate whether you believe in big government or small or low taxes or high; those are just the dynamics of economies whether you like it or not - whether you believe it or not, suck it up.

But looking long term, some policies promote growth, and some don’t; and it isn’t always clear which is which. What’s worse, exogenous factors - those pesky world events like wars and plagues and wardrobe malfunctions - throw an unavoidable amount of static on top of whatever we’re trying to measure.

The book I’m reading gives me, so far, the impression that individual outcomes are, roughly, helped by a country’s growth, and a country’s growth is affected by things it can't control, like the luck of history and geography, and things it can, like culture and institutions, with evidence strongly suggesting that institutions matter more than culture, since some countries have kept their cultures but changed their institutions and shown amazing growth. The factors that seem to affect this most are protecting private property, having enforceable contracts, reducing barriers for investment, having a level playing field for businesses, and creating equality of opportunity for citizens … but …

But how much of this is noise, and how much is reality?

And that got me thinking: if you assumed some randomness affecting growth, could you tell apart policies that caused 1 percent growth, or 2 percent growth, or 3 percent growth?

Turns out ... you can.

The Promise of Growth v1.png

The central red line is 2% growth, projected out over 20 years. The dotted lines above and below it are 1% and 3% growth … and the grey range is the max and min of a stochastic simulation of ten different histories, each with 5% random variation from year to year, which looks something like this:


The Alternatives to Growth v1.png

The point is, if you get a gut punch - like in the bottom trajectory above - it can look like you’re running a bad policy on a time range of a decade or more before things start to get back on track. On twenty year time horizons, however, you really can start to see an affect. On even longer time horizons, having the right polices can be the difference between a country like Nigeria - rich with oil wealth, yet having a flat growth range - versus a country like the US or Japan or even Botswana or South Korea.

This doesn’t show whether I or my buddy is right - in fact, this model, even as an abstract model, would need to be augmented greatly, to get a proper range of growth rates, of randomness, of the types of exogenous influences and their timescales. But even in its current state, it shows that under a very broad set of assumptions … I and my buddy were right to wrestle over this problem.

What we do now matters, not just in the next election, but twenty years down the road.

And doing that work took me out of my slump. It connected me to an earlier conversation, to earlier problem solving skills not engaged with what I’d been doing just prior to the gut punch. The gut punch still needs to be dealt with - but now it’s just an event, not a thing that causes random spikes of rage and anger when I’m trying to drink my coffee.

effectivecoffee.png

And that’s how I learned a new way to deal with a gut punch.

-the Centaur

Appendix. The graphs above were generated via the following Mathematica code:

RandomGrowth[initial_, rate_, fuzz_] :=
initial (1 + rate) (1 + RandomReal[{-fuzz, fuzz}])

ProjectGrowth[initial_, rate_, fuzz_, years_] :=
NestList[RandomGrowth[#, rate, fuzz] &, initial, years]

InterpolateGrowth[initial_, rate_, fuzz_, years_] :=

Interpolation[ProjectGrowth[initial, rate, fuzz, years]]

FuzzyGrowth[initial_, rate_, fuzz_, years_] :=
Table[InterpolateGrowth[initial, rate, fuzz, years], {iterations, 10}]


fuzzyTwoPercent = FuzzyGrowth[1, 0.02, 0.05, 100]

Plot[{
Min[Map[#[x] &, fuzzyTwoPercent]], Max[Map[#[x] &, fuzzyTwoPercent]],
InterpolateGrowth[1.0, 0.02, 0.0, 100][x],
InterpolateGrowth[1.0, 0.01, 0.0, 100][x],
InterpolateGrowth[1.0, 0.03, 0.0, 100][x]},
{x, 1, 20},
Filling -> {1 -> {2}},
AxesOrigin -> {1, 1},
AxesLabel -> {"Years Downrange", "Growth Rate"},
PlotStyle -> {Thin, Thin, Thick,
   Directive[Thick, Dashed],
   Directive[Thick, Dashed]}]


The Promise of Growth v1.png

and

Plot[{InterpolateGrowth[1.0, 0.02, 0.0, 100][x], Map[#[x] &, fuzzyTwoPercent]},
{x, 1, 20},
AxesOrigin -> {1, 1},
AxesLabel -> {"Years Downrange", "Growth Rate"},
PlotStyle ->
{Thick,
Thin, Thin, Thin, Thin, Thin,
Thin, Thin, Thin, Thin, Thin}]


The Alternatives to Growth v1.png

I hope you enjoyed this exercise in computational therapy.

Gut Punch

centaur 0
inversion.png Welp, that took a nasty turn. The week leading up to my birthday went great: a surprise business trip to Atlanta, a great research talk, a wonderful visit with friends, a nice cake and gift from my teammates on the occasion of my tenth Google anniversary, a great card from my Mom, calls from my Mom and friends, a wonderful birthday dinner with my wife, and then an outpouring of well wishes online - half a dozen via email, and over 70 on Facebook. I was riding high. What a great birthday! A few hours later, I was seriously considering deleting my Facebook account. And this blog. For context, the original title of this post was “worst birthday of my life.” The particulars are, sorry, not your business. But just so you know, no-one involved did anything wrong. It was all a simple series of misunderstandings. And everyone involved managed to fix the problem with a couple of hours of work. But, still, a sequence of simple thank-yous online and the cascading reactions that followed on from that quickly turned a glorious day into a life-changing gut-punch. Facebook itself isn’t the problem, but deleting my Facebook account would help. But as I step back, I now find myself needing to reconsider, well, everything - not just Facebook, but whether I should have an online presence at all, and my involvement with every single job, relationship and project. I know a few other people going through similar things right now - a close friend is rethinking their life, and it’s happened to a few bloggers I follow. I know, rationally, that artists have these impulses, I’ve had them since I was a kid, and it’s just a pointless self-destructive exercise. You feel like the particular events that have happened are the cause, but they’re really not. You’ve entered a mood, or a depression, and while it has a trigger, it’s the emotional state that feels forever. Still, for a moment, I felt like deleting my Facebook account, smashing my computer, and loading the library up into a Dumpster. To give you a scale of the seriousness of the problem, I am actually still thinking about getting a PODS unit and loading up much of the stuff in the library to get it out of the way and putting all my projects on hiatus while we deal with the shattered windows, the damaged floors, and all the other crap going on at the house. Now, while all that other crap is real, I said it the way I just did to exaggerate the problem. That crap has nothing to do with the gut punch, is all ongoing - the shattered window was from a ladder that fell during some work, the damaged floor behind the fridge was a discovery by my wife when she was doing cleaning. But when the gut punch happened, it made me step back and look and everything to ask, "is this working?” So I don’t know what I’m going to do. I might put this blog on hiatus. I might declare a mulligan on some projects. I might rework some habits, make some changes, do things differently. Or I might just draw a breath, take the gut punch, and move on - the way I did in the shower this morning, at which it all hit me again, hard enough to make me draw a breath; then I thought of the Avengers movie, that quote from Bruce Banner, the thing he just said before going green and tearing off to kick ass and take names: “That’s my secret. I’m always angry.” Anger is an alarm, a sign of a problem. And the first thing you do with an alarm is to turn it off. Then deal with the problem. So, this morning, when I felt the gut punch, I drew a breath, straightened up, killed the shower, got dressed, and left for work to go do my fucking job. I had an onsite interview to conduct, I have deep learning techniques to research, I’ve got to reinvent the foundations of mathematics for my latest urban fantasy novel, and I have eighteen more books to write in my main series. Time to get cracking. -the Centaur Pictured: me on my birthday, Photoshopped to illustrate my state of mind when the gut punch arrived.

Okay, now that was a birthday cake …

centaur 0

googleversary.png

Well, I spoke too soon: as a surprise during my team’s offsite yesterday, they gave me a real Googleversary birthday cake. And a gift card to Cafe Romanza, one of my favorite coffeehouses (the other two top faves being Coupa Cafe and Cafe Intermezzo). I don’t think I could have been happier at that moment:

centaurwithcake.png

But I was sure happier today, having a nice dinner with my wife at our mutual favorite restaurant. We could have gone somewhere “special”, but I wanted to go to Aqui, the place that has the best memories of eating for me, not because of all the time I spend there writing, but of all the wonderful conversations I’ve had there with the love of my life, my wife.

der-ring.png

She didn’t let me take a good picture of her, but she certainly got good pictures of me.

20160210_202231(0).jpg

Now off to Facebook - I got over 50 well wishes from people on the occasion of my birthday, so as far as I am concerned the people who think that computers are making us less connected to other people can just go Like themselves. Gotta dash - the longer I spend saying thank you, the longer I put off my birthday spanking. (Actually, I already got that, but it’s the principle of the thing).

-the Centaur

Ten Years, Man!

centaur 0

20160207_013427.jpg

Oh yeah, I almost forgot: I’ve been at Google ten years as of this Saturday. Hooray!

Now, I make it a policy not to mention my employer, with two exceptions: coincidentally, as a consumer, such as my recent article about running Google’s TensorFlow deep learning package on my MacBook Air; and concurrently, as an employee, when my employer’s just announced something I’ve worked on.

I’ve abided by this policy for years, even before my current employer, because you really do have no protection from your employer for anything you write: you can get fired for it. Even if you run your writing past your employer for legal approval, your company could be acquired tomorrow, and the new owners’ legal team could review what you’ve done and decide to fire you for it.

So I don’t talk about my current employer on my blog. I disclose both my writing to my employer when I’m hired, and my plan not to write about them, and then I go blog about my own damn business.

But Google’s been awesome to me for the last ten years, so it deserves an exception. It’s been awesome. Even the stuff that comparatively sucked was better than the average at most jobs I’ve held - and most of it didn’t suck. I get to work with awesome people, on awesome problems, with awesome resources, and have eaten a lot of awesome food while doing it.

So, thanks, Google, for all the awesome.

-the Centaur

Pictured: not my birthday cake, not from Google; just a great slice from Cafe Intermezzo.

Yeah, that Superbowl.

centaur 0

20160207_182027.jpg

A repost here from Facebook … I caught the opening of the Superbowl in a Gordon Biersch waiting for my flight back from Atlanta, and damn, that was patriotic. I shed a tear when Lady Gaga sung the national anthem - straight up, no antics - and then they showed troops watching from Afghanistan, and fighter jets buzzed the stadium. God bless America.

And in case anyone’s wondering, I mean this completely non-ironically. Yes, the Superbowl is the epitome of commercialism, but it need not be crass, and it’s by choice that they’re making it patriotic. I’m not a sports guy, but I love watching football with my family whenever I go home; it gives us something to bond over.

And isn’t that what the Superbowl did for us this Sunday? A third of America watched it, everyone from football jocks to computer nerds. A whole spectrum of people participated in it, from the first Superbowl MVP to Lady Gaga to makers of two minute jingles to troops serving their second tour overseas. They even piped it into the plane, and people cheered and jeered at the outcome.

The Superbowl could just be a game, but it’s an institution that brings America together.

Thanks, guys, for a job well done.

-the Centaur

Why yes, I’m running a deep learning system on a MacBook Air. Why?

centaur 1
deeplearning.png Yep, that’s Python consuming almost 300% of my CPU - guess what, I guess that means this machine has four processing cores, since I saw it hit over 300% - running the TensorFlow tutorial. For those that don’t know, "deep learning” is a relatively recent type of learning which uses improvements in both processing power and learning algorithms to train learning networks that can have dozens or hundreds of layers - sometimes as many layers as neural networks in the 1980’s and 1990’s had nodes. For those that don’t know even that, neural networks are graphs of simple nodes that mimic brain structures, and you can train them with data that contains both the question and the answer. With enough internal layers, neural networks can learn almost anything, but they require a lot of training data and a lot of computing power. Well, now we’ve got lots and lots of data, and with more computing power, you’d expect we’d be able to train larger networks - but the first real trick was discovering mathematical tricks that keep the learning signal strong deep, deep within the networks. The second real trick was wrapping all this amazing code in a clean software architecture that enables anyone to run the software anywhere. TensorFlow is one of the most recent of these frameworks - it’s Google’s attempt to package up the deep learning technology it uses internally so that everyone in the world can use it - and it’s open source, so you can download and install it on most computers and try out the tutorial at home. The CPU-baking example you see running here, however, is not the simpler tutorial, but a test program that runs a full deep neural network. Let’s see how it did: Screenshot 2016-02-08 21.08.40.png Well. 99.2% correct, it seems. Not bad for a couple hundred lines of code, half of which is loading the test data - and yeah, that program depends on 200+ files worth of Python that the TensorFlow installation loaded onto my MacBook Air, not to mention all the libraries that the TensorFlow Python installation depends on in turn … But I still loaded it onto a MacBook Air, and it ran perfectly. Amazing what you can do with computers these days. -the Centaur