What a winter it’s been. Not the weather. That’s been mild. Too mild. I miss the Midwestern winter, with its perfect 23 °F (-5 °C) days and snow. No, what has happened over the past few months hasn’t winter’s fault. My health hasn’t been ideal, though it seems to be springing back to place; and earlier this year, someone tried to extort me. Unfortunately but fortunately, I know this person and I’m not terribly worried.
Enough about that.
I fell behind on Farisa’s Crossing: a couple months, with mediocre writing progress. That was unplanned, but probably necessary. I doubt I’ll have a ready book by October 1, 2018. If I pursue traditional publishing– and, although I’m likely to turn down anything but a lead-title deal, I ought to at least try it– then it certainly won’t be out till 2019 (possibly 2020). If I self-publish, early 2019 is the best bet. Writing a novel isn’t hard. I’ve written several “books”: essay series, the unpublished early drafts of Farisa, and I’m sure the 905 blog posts (there’ve got to be 40 or 50 good ones in there) that I’ve never published could be turned into some kind of salable book. I could turn out a 60,000-word potboiler in a week (and, if I can’t make it in tech for some reason, I may have to write dinosaur erotica, because I’ve heard there’s money in that particular banana stand) if I had the connections to make it economically feasible.
No, writing a book isn’t hard. Writing a significant novel is hard. I figure that one can expect two hours of reading/research for every hour writing (which includes revising) and five hours of revising for every hour of primary writing. So, divide 150,000 words by 1,500-words-per-hour and multiply times eighteen: 1,800 hours. Add 30 percent for administration (e.g., finding beta readers, hiring editors, promotion) and you’re around 2,300. A year of work. Not a year of office work– the 2-hour-days that stretch out over 10 because of social nonsense– but a year of real work. Now, it’s easier than it sounds because it’s an enjoyable process and the time flies by. But even then, you’re haunted by the possibility that you might not be as good as you think you are, or people tell you that you are, et cetera. The only way to know for sure is to finish it… and then hope it sells, which is often uncorrelated to literary quality (and usually has the most to do with how well your book is promoted, which depends on internal politics at the publishing house) but of essential importance for getting the next book published.
The good news is that, even in a slowdown on my main project, I’ve been active. I’ve managed to keep my side interests relevant to my overall direction. For example, one of my recent improvements to Farisa’s Crossing was to replace an awkward on-the-nose conversation with a card game that does a better job of foreshadowing character development. Not afraid to toot my own horn, I used Ambition; although in Farisa’s world they call it ehrgeiz. There was a problem, though. For several years, I was aware of a design flaw in the game– and I wouldn’t want to risk my book drawing attention to the game in its flawed state. However, it took me a while (including about a month of trial and error) to figure out how to fix it.
What was wrong with Ambition, in its earlier form? What seemed innovative (a game-ending condition triggered by the losing player) and merciful– the ending at four (originally three) strikes– didn’t work well in practice. It created king-maker scenarios, it forced people into weird strategic positions, and it sometimes ended the game too early and sometimes too late. This wouldn’t necessarily annoy a first-time player, but as someone who wrote the game, it bothered me. Armed with a computer and the knowledge of how to use it, I ran various potential fixes through hundreds of thousands of simulated games and, eventually, figured out how to get the game to end at about the right time. (Obviously, this is a subjective question; but, there are statistically sound ways to look at it.) Now I’m writing an AI for Ambition, because I want people to be able to play the game (against something more competent than a random-legal-move player) without having to convince three other people to sit down for a card game they’ve probably never heard of.
To add to the challenge for the AI-for-Ambition project, I want it to run anywhere, so I’m not using any libraries but C’s standard ones. For example, I wrote my own linear regression solver. (I’m sure it’s slower and less numerically stable than what I’d use under other circumstances; but for my purposes, that’s not an issue.) The game itself doesn’t even use malloc and free, though the training process (which relies on evolving neural networks) does. So, if you want to train an AI game player on your toaster, keep that in mind.
My first approach was to write the most naive player I could think of: a static, layered neural net (e.g. 558-350-150-50-1) that treated each game variable as an input, and attempted to Q-learn a “heuristic” valuation for actions-per-state, then choose the best action. There were about 550 variables; for example, there was a 0/1 variable corresponding to whether a player held the 7, and fifty-one other ones for each card. How’d it work? Not very well, unfortunately.
That approach can work for perfect-knowledge, deterministic games, but I think the hidden information and probabilistic nature of the card game had the AI player bouncing about randomly, with each iteration of SGD, without much progress, because the theoretical convergence of stochastic gradient descent is cold comfort when (a) the environment itself is highly stochastic, and (b) I have better things to do than muck about with learning rates. After 12 hours of training, the damn thing wasn’t playing any better than a random-legal-move player. In order to make sure the neural net was, in fact, training at all; I used it again to assess a static dataset from a few hundred thousand games, and while training error reduced (establishing that the neural net itself did work) neither test-set error nor performance at the game improved. My guess is that the neural net was over-parameterized, causing it to evolve from and under-fit state to an over-fit state without any true learning.
Writing a decent AI for a card game isn’t hard. If that were the only goal, I’d probably be done: I’d get “dirty” and use rollouts and Monte Carlo tree search and my own knowledge about the game, and it wouldn’t take long to get a passable player. I’m still hoping, though, that I can get a model-free player to work. I want this damn thing to teach me about the game, rather than me having to teach it.
My next approach (what I’m working on now) is to hybridize gradient-based training and evolutionary techniques (e.g., NEAT) that favor simple network topologies. The change I intend to make to NEAT is how speciation is handled. Rather than down-moderating fitness for large species in what appears to be an ad hoc way– a fitness function ought to be shift- and scale-invariant, meaning you get the same results from f(x) and 17*f(x – 39), so dividing fitness by species population is mathematically meaningless– I intend to use speciation (if I need it, and if I’m lucky, I may not) to allocate training time. What I want is a sparse, genetic approach to network topology, but a gradient-based approach (with occasional clone-and-reinitialize-randomly steps) to weight selection.
We’ll see if it works. My prediction is that the naive model-free variant (i.e., here are 600 variables; figure it out) won’t work, but that with some explicit feature engineering (i.e., a pre-arranged design of the network that pools like information with like, similar to how a convolutional neural network exploits the 2D topology of an image) it will get there. I want to avoid rollouts and MCTS in training– they’ll slow everything down– but I’ll probably implement them when I write a user-facing player (in which case, milliseconds and even seconds are acceptable “thinking” time). Those, coupled with a simple heuristic (even linear regression based on 100,000 games of training data) could be enough.
Ambition for AI may be one of the last “serious” hard program I write. I’m approaching 35, which is half of the Biblical “three score and ten”. It’s time to put away childish things. Is programming a childish thing? Absolutely not. It’s a useful skill and I’m glad I have it. Corporate programming, however, I seem to have aged out of. Back when programming was an R&D job, instead of this Agile Scrotum nonsense, software was a perfectly fine thing to do into late middle age. However, the naive belief I once had that the life of a private-sector programmer could be fulfilling… that somehow the world would get back to a state where software engineers were trusted professionals, like researchers; as opposed to rent-a-coders constantly competing with unqualified cheap hacks… well, that’s gone. Silicon Valley is a resource-extraction culture, similar to the Gulf States, but instead of the finite resource being petroleum, it’s the good faith of the American middle class, and the memory of a reasonably meritocratic mid-century, that’s being tapped. It will run out soon; I’m surprised 2008 didn’t drink that milkshake outright. Anyway, as I said, I’m almost 35. Technology’s important and I’d like to still be a part of it, but… the crisis of conscience I have about my industry’s role in gutting the American middle class hits me every day now.
Also, I’m going to die soon. No, I’m not terminally ill; and by “soon”, I mean 50 years, more likely than 5. I’m not dying any faster than anyone else my age; but I cannot ignore that I will someday die.
I find most religion paradoxically nihilistic– “our god is good because he is powerful and he burns dead people who don’t believe he exists”– and I am closer to atheism than to any organized religion, but one of my personal beliefs is that reincarnation is likely true; that existence is eternal (or, at least, very long) but that every moment matters. Fifty years is the blink of an eye, and it’s on me to make my time mean something. I need to get back to work– real work– and finish my book.
One of the things that amuses me is that all adults (and most children, after about six) know that we’re going to die, and yet, we ignore this basic fact. We behave as if it’s not true or doesn’t matter. What would happen if people truly understood their mortality? Corporate America would fall within 5 minutes. Okay, okay; make it 10, because some people would have to finish up in the bathrooms, but the principle holds. Rich people would stop showing up at jobs that, even though they get to give orders, they still hate; the middle classes would leverage everything they’ve got to get some other kind of work; the poor who have no other options would unionize. This basic fact about life– that it ends, and that we have no idea what comes after it– is something we all know, but our denial of it keeps the whole system going. Hold aside for now the unexamined life; we, as a culture, can’t even examine a small (but important) part of life, which is death.
When you do anything important, you have to face death. See, most corporate work is so monotonous and meaningless that one can go completely numb, and thereby forget one’s own mortality. Death will at least be interesting, an escape from the idiocy. Die at your desk? Your boss has to deal with a corpse. That image is humorous enough that one laughs the scare away… for about forty seconds, which is long enough to get distracted and forget about the whole death thing.
Perhaps it’s not because they ignore death that people work in corporate jobs; perhaps they do it to ignore death. Aldous Huxley said that a heroin addict “lives his 24 months in eternity”, while the non-user lives “only in time”. I disagree with the sentiment; personally, I’d rather live in time, and make something of myself (as Huxley in fact did, in spite of this quote) because either eternity or nonexistence (which is not to be feared) awaits, no matter what I do. Yet, on Huxley’s point, I’d argue that corporate work has the same effect, without heroin’s deleterious effect on life expectancy.
The corporate illusion is one of monotonic progress. “We have a better culture.” “We’re going to crush our competitors.” “World domination.” The corporate eros is bland, colorless, and ultimately quite pathetic; but thanatos is completely absent. Companies no longer fire people or have layoffs; they “streamline” and “improve performance”. All of this is a total denial of impermanence and the inevitability of decay. Then, when companies meet reality and cannot continue monotonic expansion, their reaction is paroxysmal and harsh, so much so that individuals within fear for their jobs and standing, and focus on only on short-term survival (because corporate cults have convinced people to conceive of a job ending as a death, to the point where we even use mortal lingo). Never, whether in the silly expansive mode or the nefarious struggle for political survival, does the corporate denizen have time to think about the fact that he’s imperceptibly approaching his own demise– the real one, after which job titles and bank accounts mean nothing.
Like Farisa, I’m more of an anti-nihilist than anything else. I oppose the devaluation of everything authentic that I see in the corporate world. I believe that what I do in this life matters. Whether it’s eternal, that’s not for me to know yet, but the possible finitude of existence doesn’t render it meaningless. My job, in this life, is to do something authentic. Something that matters. Something real.
If you do something real, though– something worth actually caring about, like finishing a novel and turning it into a series that stands a chance to outlive you– you confront your mortality. You ask, “What if I die tomorrow?” “What if I never get to finish this?” It’s a harrowing thought. My advice, though I’m in no position to give any, would be to focus on the creative process rather than the end results, especially when so many of those are under external control. That’s easier said than done, though. It’s largely advice to myself, that I should take.
I’ve still been thinking, ideas forming and others dissolving, and I’m back to writing.
Memento mori. Refuse to forget, as the corporate lords require that you do, that death is coming and every moment at least ought to matter.