Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Hyperbolic Tanjant Function
- func _tanh(x, derivative=false)->float:
- if derivative:
- return(1 - pow(x, 2))
- return tanh(x)
- # ReLU Function
- func re(x:float)->float:
- return x * int(x>0)
- # Leaky ReLU Function
- func lr(x:float)->float:
- if x < 0:
- return (x/10.0)
- else:
- return x
- # Sigmoid Function
- func sigmoid(x:float)->float:
- return (1/(1+exp(-x)))
- func swish(x:float)->float:
- return sigmoid(x)*x
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement