I’m trying to run Spaun in direct mode which fails because of nengo/nengo#1178. To circumvent this problem I’m using this code:

```
def make_finite(fn):
def finite(*args, **kwargs):
values = fn(*args, **kwargs)
try:
if values is None:
return 1.
elif not np.all(np.isfinite(values)):
values = np.ones_like(values)
except:
pass
return values
return finite
# Some omitted setup code
model = Spaun()
for node in model.all_nodes:
if callable(node.output):
node.output = make_finite(node.output)
for conn in model.all_connections:
if callable(conn.function):
conn.function = make_finite(conn.function)
```

But I’m still getting a similar error:

```
FloatingPointError: invalid value encountered in add
Uncaught exception. Entering post mortem debugging
Running 'cont' or 'step' will restart the program
> /home/jgosmann/.virtualenvs/gosmann-frontiers2016/lib/python3.4/site-packages/nengo/synapses.py(294)__call__()
292 def __call__(self, t, signal):
293 self.output *= -self.a
--> 294 self.output += self.b * signal
295 return self.output
296
```

Any ideas what I might be missing?