Files
IQ.Pilot/iqpilot/selfdrive/dmonitoringmodeld/math.py
2026-08-22 23:42:41 -05:00

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))