Hi,
The thing is that if your input goes to 0 (or very close to it), then the output of the log will be inf. Is that what happens? Maybe you can try adding an epsilon to your input before taking the log to avoid such problem.