Add some error checking in case the name passed in is not an valid activationfn? The default KeyError returned by dictionary is not very clear.

>>> l
{'one': 1}
>>> l['a']
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'a'