Archive for July, 2017

Consider not what is lost, but what is GAN

July 7, 2017

A generative adversarial network is a set of two neural networks competing against one another in a zero sum game (todo: consider game theoretic implications).  Classically one is a generator, and one is a discriminator.  The generator tries to fool the discriminator.  However this situation can become unstable and the algorithm can fail to converge to interpret / generate digits, say.

There is another recent paper on cliques of neurons and their role in consciousness, a paper that draws links between algebraic topology and intelligence.  In particular, it indicates that there are stratified layers of sets of neurons that can be up to 11 strata deep.

So the question I pose is twofold: one, is there a way to avoid instability in a classical GAN and also extend it to broader classes of problems; and two, can we consider the latter paper’s analogue in AI to be stratified layers of sets of neurons in an underlying ‘space’ of potential usable neurons, that can be up to 11 strata deep, and which can be created, read, updated and destroyed, as time buckets continue?  Maybe we could implement using dind (docker in docker).  All sorts of possibilities.

I think this broader idea of ‘GAN’ would be useful, as it would allow us to remove neuron sets that are underperforming / have become unstable, and also allow for new models to arise in a Conways Game of Life fashion out of the morass.

But how do we measure, how do we update, what data are we measuring against?  All excellent questions.

Perhaps then we need to consider the set of possible usable neurons as living in a module that has an input (a set of performance measures at time step T) and an output (a set of the same performance measures at time step T+1).  Based on this difference we can apply a feedback loop to the universe of inputs.  Maybe we output the algebraic structure of the set of adversarial subnets in the universal net as a json object say (with the model parameters included eg matrix representations etc, so

{json(T)} as input, and {json(T+1)} as output

where some nodes from the json file might be removed, and others added.

eg. { {{ [network including 2 sets of 4 nodes, 2 layers deep], A_ij }, { [network including 3 sets of 3 nodes, 3 layers deep], B_ij } }, { [network with 2 x 4 nodes ], D_ij } }(T)

{ { [ network including 2 sets of 4 nodes, 2 layers deep ], A_ij }, { [network including 3 sets of 2 nodes, 3 layers deep], C_ij } }(T+1).

One could have any sort of network within the universal neural space, eg a CNN, an ordinary hidden markov model, etc.

So we have a big box, with json objects and current training parameters of same being spat in and out of the box.

The training parameters of the transient submodels could then be placed inside some form of distance measure relative to the problem we are optimising for (i.e., relative to one’s timeboxed dataset or evolving input).  It strikes me that this sort of approach, although difficult to implement, could potentially lead to applications much more wideranging than image manipulation.

A further generalisation would be to allow the model to create an output timeboxed dataset, and allow that to form an extrapolation of previous input or data.  This sort of approach might be useful, for instance, for performing fairly demanding creative work.  One would naturally of course need to seed the task with an appropriate starting point, say a collection of ‘thoughts’ (or rather their network representation) inhabiting a network of cliques in the universal neural lattice.


The current state of open source AI

July 2, 2017

I recently discovered the company OpenAI, which has a significant endowment, and has a couple of notable projects that enable work on training / testing AI algorithms.  In particular, these projects are Gym ( and Universe (  Gym is based on this paper ( which is essentially a toolkit for benchmarking the performance of various AI algorithms in reinforcement learning.  From the project page:

gym makes no assumptions about the structure of your agent, and is compatible with any numerical computation library, such as TensorFlow or Theano.

Universe fits in with Gym, in that Gym provides the interface to Universe, which provides an AI algorithm with an environment within which to train.  An example of this is given on the project page, which essentially demonstrates use of Universe and Gym to test an agent running the game DuskDrive in a Docker container:

import gym
import universe  # register the universe environments

env = gym.make('flashgames.DuskDrive-v0')
env.configure(remotes=1)  # automatically creates a local docker container
observation_n = env.reset()

while True:
  action_n = [[('KeyEvent', 'ArrowUp', True)] for ob in observation_n]  # your agent here
  observation_n, reward_n, done_n, info = env.step(action_n)

Evidently this is potentially quite powerful.  Indeed, from the main promotional page for universe (, apparently there are already more than 1000 environments to test / train learning agents against, which apparently many many more in the works.

To get started, one could use the openai code in the projects or, however, those with a more sophisticated bent might instead be interested in investigating DeepMind’s project, which makes use of Google Tensorflow and DeepMind Sonnet (  Sonnet is a Tensorflow neural network library.

Towards increasingly unorthodox approaches, I think it would be fascinating to watch the space around the development of algorithms to take advantage of the architecture of IBM’s neuromorphic chips (based I believe on Field Programmable Gate Arrays), or looking a bit further out, towards the opportunities based in machine learning associated to Topological Quantum Computers (Majorana fermion based), and possibly same with a slight Qudit boost (hybrid/pseudo tetracomputer, maybe with switches consisting up to a 100 states).

I will continue to follow developments in this area with some interest.