Overflow error-free sigmoid function

import numpy as np
sigmoid = lambda x: 1 / (1 + np.exp(-np.clip(x,-709,100000)))

(I corrected it because there was an error)

Recommended Posts

Overflow error-free sigmoid function
Reproduce thermography-like color change with sigmoid function