The idea is to store all matrix weights for neural model in log space, and never leave it. Maybe create a new activation function which doesn't leave log space.
You can check the code, I don't just replace multiplication, I perform addition (with tricks) in log space