def relu(x): # Using T.nnet.relu gives me NaNs. No idea why. return T.switch(x > lib.floatX(0), x, lib.floatX(0))