Sparse Autoencoder with Tanh activation from UFLDL
===

I have been working of of the UFLDL tutorials (In matlab/octave) :

http://deeplearning.stanford.edu/wiki/index.php/UFLDL_Tutorial

and have been trying out the sparse autoencoder on different datasets. I tried running it on time-series data and encountered problems. Since the input data has negative values, the sigmoid activation function (1/1 + exp(-x)) is inappropriate. When substituting in tanh, the optimazion program minfunc (L-BFGS) fails (Step Size below TolX). I decreased the TolX constant dramatically with no change.
I changed the output layer to linear, kept the input layer sigmoid, but this isn't a preferable solution. The output of the autoencoder is scaled up by a constant (0.5), which boogers the cost function. So.... in short:

Why doesn't the Tanh activation function work with L-BFGS? (or is something else wrong)?

..What am I missing? Everywhere one reads it says that activation functions are pretty interchangable.  I know there are workarounds (rescale data, use FFT coefficents etc.) but I don't see why this doesn't work.

Anyway, thanks in advance to anyone who answers! First post on here, I've been reading these  types of forums more and more and am finding them increasingly helpful..