Skip to content

Instantly share code, notes, and snippets.

@kastnerkyle
Created August 3, 2016 16:05
Show Gist options
  • Save kastnerkyle/0d272279319430fbf85b7b16b1df8a7d to your computer and use it in GitHub Desktop.
Save kastnerkyle/0d272279319430fbf85b7b16b1df8a7d to your computer and use it in GitHub Desktop.
Maxout Theano
"""
Maxout implementation in Theano
"""
# W,b - Parameters in neural network layer
# activation - Activation function
# maxoutsize - Number of input neurons to maxout units
# Output activation function
output = activation(T.dot(input,W) + b)
# Maxout
maxout_out = None
for i in xrange(maxoutsize):
t = output[:,i::maxoutsize]
if maxout_out is None:
maxout_out = t
else:
maxout_out = T.maximum(maxout_out, t)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment