File size: 548 Bytes
e6ad324
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
# -*- coding: utf-8 -*-
"""hologramm.195.195!

Automatically generated by Colab.

Original file is located at
    https://colab.research.google.com/drive/1UwiDcE0dY0IvrEYXjw2drfZJc78qCDKA
"""

import math

def sigmoid(x):
  return 1 / (1 + math.exp(-x))

sigmoid(100)

sigmoid(1)

sigmoid(-56)

sigmoid(0.5)

def tanh(x):
  return (math.exp(x) - math.exp(-x)) / (math.exp(x) + math.exp(-x))

tanh(-56)

tanh(50)

tanh(1)

def relu(x):
  return max(0,x)

relu(-100)

relu(8)

def leaky_relu(x):
  return max(0.1*x,x)

leaky_relu(-100)

leaky_relu(8)