mirror of
https://gitlvb.teallvbs.xyz/IQ.Lvbs/IQ.Pilot.git
synced 2026-09-09 23:33:42 +08:00
10 lines
172 B
Python
10 lines
172 B
Python
import numpy as np
|
|
|
|
|
|
def safe_exp(values, out=None):
|
|
return np.exp(np.clip(values, -np.inf, 11), out=out)
|
|
|
|
|
|
def sigmoid(values):
|
|
return 1.0 / (1.0 + safe_exp(-values))
|